From 7b06e87959f3e7210bce6c6d90079c1bf6fd4b98 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Fri, 30 Jan 2026 22:30:22 +0800 Subject: [PATCH 01/12] =?UTF-8?q?[update]=E6=B7=BB=E5=8A=A0=E4=BA=86=20=20?= =?UTF-8?q?=E5=92=8C=20=20=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L2_Core/hal/inc/ek_hal_i2c.h | 38 +++++++++++ L2_Core/hal/src/ek_hal_i2c.c | 120 +++++++++++++++++++++++++++++++++++ L2_Core/hal/src/ek_hal_spi.c | 2 + 3 files changed, 160 insertions(+) create mode 100644 L2_Core/hal/inc/ek_hal_i2c.h create mode 100644 L2_Core/hal/src/ek_hal_i2c.c diff --git a/L2_Core/hal/inc/ek_hal_i2c.h b/L2_Core/hal/inc/ek_hal_i2c.h new file mode 100644 index 0000000..7450e58 --- /dev/null +++ b/L2_Core/hal/inc/ek_hal_i2c.h @@ -0,0 +1,38 @@ +#ifndef EK_HAL_I2C_H +#define EK_HAL_I2C_H + +#include "../../utils/inc/ek_def.h" +#include "../../utils/inc/ek_list.h" + +typedef struct ek_hal_i2c_t ek_hal_i2c_t; + +typedef enum +{ + EK_HAL_I2C_MEM_8B, + EK_HAL_I2C_MEM_16B, +} ek_hal_i2c_mem_size_t; + +struct ek_hal_i2c_t +{ + uint8_t idx; + ek_list_node_t node; + uint32_t speed_hz; + + bool lock; + + void (*init)(void); + bool (*write)(uint16_t dev_addr, uint8_t *txdata, size_t size); + bool (*read)(uint16_t dev_addr, uint8_t *txdata, size_t size); + bool (*mem_write)( + uint16_t dev_addr, uint16_t mem_addr, ek_hal_i2c_mem_size_t mem_size, uint8_t *txdata, size_t size); + bool (*mem_read)( + uint16_t dev_addr, uint16_t mem_addr, ek_hal_i2c_mem_size_t mem_size, uint8_t *rxdata, size_t size); +}; + +extern ek_list_node_t ek_hal_i2c_head; + +extern ek_hal_i2c_t hal_drv_i2c1; + +void ek_hal_i2c_init(void); + +#endif diff --git a/L2_Core/hal/src/ek_hal_i2c.c b/L2_Core/hal/src/ek_hal_i2c.c new file mode 100644 index 0000000..26d51e1 --- /dev/null +++ b/L2_Core/hal/src/ek_hal_i2c.c @@ -0,0 +1,120 @@ +#include "../inc/ek_hal_i2c.h" +#include "../../utils/inc/ek_assert.h" +#include "../../utils/inc/ek_export.h" + +#define EK_HAL_LOCK_ON(x) ((x)->lock = true) +#define EK_HAL_LOCK_OFF(x) ((x)->lock = false) +#define EK_HAL_LOCK_TEST(x) ((x)->lock == true) + +#define STM32F429XX_TIMEOUT (100) +static void i2c1_init(void); +static bool i2c1_send(uint16_t dev_addr, uint8_t *txdata, size_t size); +static bool i2c1_recieve(uint16_t dev_addr, uint8_t *rxdata, size_t size); +static bool +i2c1_mem_write(uint16_t dev_addr, uint16_t mem_addr, ek_hal_i2c_mem_size_t mem_size, uint8_t *txdata, size_t size); +static bool +i2c1_mem_read(uint16_t dev_addr, uint16_t mem_addr, ek_hal_i2c_mem_size_t mem_size, uint8_t *rxdata, size_t size); + +ek_list_node_t ek_hal_i2c_head; + +ek_hal_i2c_t hal_drv_i2c1 = { + .idx = 1, + .speed_hz = 400000, + + .lock = false, + + .init = i2c1_init, + .read = i2c1_recieve, + .write = i2c1_send, + + .mem_read = i2c1_mem_read, + .mem_write = i2c1_mem_write, +}; + +static void i2c1_init(void) +{ + hal_drv_i2c1.lock = false; +} + +static bool i2c1_send(uint16_t dev_addr, uint8_t *txdata, size_t size) +{ + if (EK_HAL_LOCK_TEST(&hal_drv_i2c1) == true) return false; + + EK_HAL_LOCK_ON(&hal_drv_i2c1); + + __UNUSED(dev_addr); + __UNUSED(txdata); + __UNUSED(size); + // 具体的i2c底层 + + EK_HAL_LOCK_OFF(&hal_drv_i2c1); + + return true; +} + +static bool i2c1_recieve(uint16_t dev_addr, uint8_t *rxdata, size_t size) +{ + if (EK_HAL_LOCK_TEST(&hal_drv_i2c1) == true) return false; + + EK_HAL_LOCK_ON(&hal_drv_i2c1); + + __UNUSED(dev_addr); + __UNUSED(rxdata); + __UNUSED(size); + // 具体的i2c底层 + + EK_HAL_LOCK_OFF(&hal_drv_i2c1); + + return true; +} + +static bool +i2c1_mem_write(uint16_t dev_addr, uint16_t mem_addr, ek_hal_i2c_mem_size_t mem_size, uint8_t *txdata, size_t size) +{ + if (EK_HAL_LOCK_TEST(&hal_drv_i2c1) == true) return false; + + // uint16_t msize = (mem_size == EK_HAL_I2C_MEM_8B) ? I2C_MEMADD_SIZE_8BIT : I2C_MEMADD_SIZE_16BIT; + // msize 来判断从机设备长度 + + EK_HAL_LOCK_ON(&hal_drv_i2c1); + + __UNUSED(dev_addr); + __UNUSED(mem_addr); + __UNUSED(txdata); + __UNUSED(size); + // 具体的i2c底层 + + EK_HAL_LOCK_OFF(&hal_drv_i2c1); + + return true; +} + +static bool +i2c1_mem_read(uint16_t dev_addr, uint16_t mem_addr, ek_hal_i2c_mem_size_t mem_size, uint8_t *rxdata, size_t size) +{ + if (EK_HAL_LOCK_TEST(&hal_drv_i2c1) == true) return false; + + // uint16_t msize = (mem_size == EK_HAL_I2C_MEM_8B) ? I2C_MEMADD_SIZE_8BIT : I2C_MEMADD_SIZE_16BIT; + // msize 来判断从机设备长度 + + EK_HAL_LOCK_ON(&hal_drv_i2c1); + + __UNUSED(dev_addr); + __UNUSED(mem_addr); + __UNUSED(rxdata); + __UNUSED(size); + // 具体的i2c底层 + + EK_HAL_LOCK_OFF(&hal_drv_i2c1); + + return true; +} + +void ek_hal_i2c_init(void) +{ + ek_list_init(&ek_hal_i2c_head); + + ek_list_add_tail(&ek_hal_i2c_head, &hal_drv_i2c1.node); +} + +EK_EXPORT(ek_hal_i2c_init, 0); diff --git a/L2_Core/hal/src/ek_hal_spi.c b/L2_Core/hal/src/ek_hal_spi.c index 7683cf4..8bbe44e 100644 --- a/L2_Core/hal/src/ek_hal_spi.c +++ b/L2_Core/hal/src/ek_hal_spi.c @@ -54,6 +54,7 @@ static bool spi1_recieve(uint8_t *rxdata, size_t size) __UNUSED(rxdata); __UNUSED(size); + // 具体的spi底层 EK_HAL_LOCK_OFF(&hal_drv_spi1); @@ -69,6 +70,7 @@ static bool spi1_write_recieve(uint8_t *txdata, uint8_t *rxdata, size_t size) __UNUSED(txdata); __UNUSED(rxdata); __UNUSED(size); + // 具体的spi底层 EK_HAL_LOCK_OFF(&hal_drv_spi1); From 7babe1d07551f8117c9b7dffb943bec0fdfb4c5b Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Fri, 30 Jan 2026 22:31:14 +0800 Subject: [PATCH 02/12] update --- L2_Core/hal/src/ek_hal_i2c.c | 1 - L2_Core/hal/src/ek_hal_spi.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/L2_Core/hal/src/ek_hal_i2c.c b/L2_Core/hal/src/ek_hal_i2c.c index 26d51e1..821cef1 100644 --- a/L2_Core/hal/src/ek_hal_i2c.c +++ b/L2_Core/hal/src/ek_hal_i2c.c @@ -6,7 +6,6 @@ #define EK_HAL_LOCK_OFF(x) ((x)->lock = false) #define EK_HAL_LOCK_TEST(x) ((x)->lock == true) -#define STM32F429XX_TIMEOUT (100) static void i2c1_init(void); static bool i2c1_send(uint16_t dev_addr, uint8_t *txdata, size_t size); static bool i2c1_recieve(uint16_t dev_addr, uint8_t *rxdata, size_t size); diff --git a/L2_Core/hal/src/ek_hal_spi.c b/L2_Core/hal/src/ek_hal_spi.c index 8bbe44e..d7db42f 100644 --- a/L2_Core/hal/src/ek_hal_spi.c +++ b/L2_Core/hal/src/ek_hal_spi.c @@ -6,8 +6,6 @@ #define EK_HAL_LOCK_OFF(x) ((x)->lock = false) #define EK_HAL_LOCK_TEST(x) ((x)->lock == true) -#define STM32F429XX_TIMEOUT (100) - ek_list_node_t ek_hal_spi_head; static void spi1_init(void); From d1c57f45c0019de2786b23590388fe4407e993c2 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Fri, 30 Jan 2026 22:57:57 +0800 Subject: [PATCH 03/12] =?UTF-8?q?[update]=E4=BC=98=E5=8C=96FreeRTOS?= =?UTF-8?q?=E7=9A=84=20FreeRTOSConfig.h=20=E7=9A=84=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h | 357 +++++++----------- 1 file changed, 137 insertions(+), 220 deletions(-) diff --git a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h index ef2b2a9..83e8cc1 100644 --- a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h +++ b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h @@ -9,233 +9,150 @@ #ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H -/* ============================================================================ */ -/* 基础配置参数 */ -/* ============================================================================ */ - -/** - * @brief MCU 系统时钟频率 (Hz) - * @note 必须与实际系统时钟配置一致,STM32F429 典型值为 168MHz - */ -#define configCPU_CLOCK_HZ 168000000UL - -/** - * @brief RTOS 系统节拍频率 (Hz) - * @note 常用值: 100Hz (10ms), 1000Hz (1ms) - */ -#define configTICK_RATE_HZ 1000 - -/** - * @brief 系统节拍计数器位宽 - * @note 0 = 16位, 1 = 32位 (ARM Cortex-M 推荐) - */ -#define configUSE_16_BIT_TICKS 0 - -/** - * @brief 最大任务优先级数量 - * @note 实际可用的优先级为 1 ~ configMAX_PRIORITIES-1 - */ -#define configMAX_PRIORITIES 5 - -/** - * @brief 使用抢占式调度器 - * @note 1=启用抢占, 0=使用协作式调度 - */ -#define configUSE_PREEMPTION 1 - -/** - * @brief 使用时间片调度 (同等优先级任务轮转) - */ -#define configUSE_TIME_SLICING 1 - -/** - * @brief 使用互斥信号量 - * @note 必须启用才能使用递归互斥锁 - */ -#define configUSE_MUTEXES 1 - -/** - * @brief 空闲任务执行时运行空闲钩子函数 - */ -#define configUSE_IDLE_HOOK 0 - -/** - * @brief 每次节拍中断执行后运行节拍钩子函数 - */ -#define configUSE_TICK_HOOK 0 - -/* ============================================================================ */ -/* 内存配置 */ -/* ============================================================================ */ - -/** - * @brief FreeRTOS 堆总大小 (字节) - * @note heap_4.c 管理的内存池大小 - * @warning 需要根据实际可用 RAM 调整,STM32F429 有 256KB SRAM - */ -#define configTOTAL_HEAP_SIZE (32 * 1024) - -/** - * @brief 支持静态内存分配 - */ -#define configSUPPORT_STATIC_ALLOCATION 0 - -/** - * @brief 支持动态内存分配 - */ +/* ======================================================================== + * 基础配置参数 + * - configCPU_CLOCK_HZ: MCU系统时钟频率(Hz),需与实际系统时钟配置一致 + * - configTICK_RATE_HZ: RTOS系统节拍频率(Hz),常用值100Hz(10ms)或1000Hz(1ms) + * - configUSE_16_BIT_TICKS: 系统节拍计数器位宽,0=32位(ARM Cortex-M推荐),1=16位 + * - configMAX_PRIORITIES: 最大任务优先级数量,实际可用为1~(configMAX_PRIORITIES-1) + * - configUSE_PREEMPTION: 使用抢占式调度器,1=启用抢占,0=使用协作式调度 + * - configUSE_TIME_SLICING: 使用时间片调度(同等优先级任务轮转) + * - configUSE_MUTEXES: 使用互斥信号量,必须启用才能使用递归互斥锁 + * ======================================================================== */ +#define configCPU_CLOCK_HZ 168000000UL +#define configTICK_RATE_HZ 1000 +#define configUSE_16_BIT_TICKS 0 +#define configMAX_PRIORITIES 5 +#define configUSE_PREEMPTION 1 +#define configUSE_TIME_SLICING 1 +#define configUSE_MUTEXES 1 + +/* ======================================================================== + * 内存配置 + * - configTOTAL_HEAP_SIZE: FreeRTOS堆总大小(字节),heap_4.c管理的内存池 + * - configSUPPORT_STATIC_ALLOCATION: 支持静态内存分配 + * - configSUPPORT_DYNAMIC_ALLOCATION: 支持动态内存分配 + * ======================================================================== */ +#define configTOTAL_HEAP_SIZE (32 * 1024) +#define configSUPPORT_STATIC_ALLOCATION 0 #define configSUPPORT_DYNAMIC_ALLOCATION 1 -/* ============================================================================ */ -/* 任务相关配置 */ -/* ============================================================================ */ - -/** - * @brief 最小任务栈大小 (字) - * @note 空闲任务使用的栈大小 - */ -#define configMINIMAL_STACK_SIZE 128 - -/** - * @brief 任务名称最大长度 - */ -#define configMAX_TASK_NAME_LEN 16 - -/** - * @brief 任务本地存储缓冲区索引 (0 = 不使用) - */ +/* ======================================================================== + * 任务相关配置 + * - configMINIMAL_STACK_SIZE: 最小任务栈大小(字),空闲任务使用的栈大小 + * - configMAX_TASK_NAME_LEN: 任务名称最大长度 + * - configTASK_NOTIFICATION_ARRAY_ENTRIES: 任务本地存储缓冲区索引,0表示不使用 + * ======================================================================== */ +#define configMINIMAL_STACK_SIZE 128 +#define configMAX_TASK_NAME_LEN 16 #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1 -/* ============================================================================ */ -/* 队列/信号量配置 */ -/* ============================================================================ */ - -/** - * @brief 队列注册机制 (调试用) - */ -#define configUSE_QUEUE_SETS 0 - -/** - * @brief 互斥信号量使用递归 - */ -#define configUSE_RECURSIVE_MUTEXES 1 - -/** - * @brief 使用计数型信号量 - */ -#define configUSE_COUNTING_SEMAPHORES 1 - -/* ============================================================================ */ -/* 断言配置 */ -/* ============================================================================ */ - -/** - * @brief 断言宏定义 - * @note 断言失败时禁用中断并进入死循环 - */ -#define configASSERT(x) if((x) == 0) { taskDISABLE_INTERRUPTS(); for(;;); } - -/* ============================================================================ */ -/* API 函数包含配置 */ -/* ============================================================================ */ - -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_xTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 +/* ======================================================================== + * 钩子函数配置 + * - configUSE_IDLE_HOOK: 空闲任务执行时运行空闲钩子函数 + * - configUSE_TICK_HOOK: 每次节拍中断执行后运行节拍钩子函数 + * ======================================================================== */ +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 + +/* ======================================================================== + * 队列/信号量配置 + * - configUSE_QUEUE_SETS: 队列注册机制(调试用) + * - configUSE_RECURSIVE_MUTEXES: 互斥信号量使用递归 + * - configUSE_COUNTING_SEMAPHORES: 使用计数型信号量 + * ======================================================================== */ +#define configUSE_QUEUE_SETS 0 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_COUNTING_SEMAPHORES 1 + +/* ======================================================================== + * 断言配置 + * - configASSERT: 断言宏定义,断言失败时禁用中断并进入死循环 + * ======================================================================== */ +#define configASSERT(x) \ + if ((x) == 0) \ + { \ + taskDISABLE_INTERRUPTS(); \ + for (;;); \ + } + +/* ======================================================================== + * API函数包含配置 + * - INCLUDE_vTaskPrioritySet: 使能vTaskPrioritySet函数 + * - INCLUDE_uxTaskPriorityGet: 使能uxTaskPriorityGet函数 + * - INCLUDE_vTaskDelete: 使能vTaskDelete函数 + * - INCLUDE_vTaskSuspend: 使能vTaskSuspend函数 + * - INCLUDE_xTaskDelayUntil: 使能xTaskDelayUntil函数 + * - INCLUDE_vTaskDelay: 使能vTaskDelay函数 + * - INCLUDE_xTaskGetSchedulerState: 使能xTaskGetSchedulerState函数 + * - INCLUDE_xTaskGetCurrentTaskHandle: 使能xTaskGetCurrentTaskHandle函数 + * ======================================================================== */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_xTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 #define INCLUDE_xTaskGetCurrentTaskHandle 1 -/* ============================================================================ */ -/* 协程配置 (本项目不使用) */ -/* ============================================================================ */ - -#define USE_CO_ROUTINES 0 - -/* ============================================================================ */ -/* 中断配置 */ -/* ============================================================================ */ - -/** - * @brief 系统节拍中断优先级配置 - * @note Cortex-M4F 优先级位数为 4,范围 0-15 (0 最高) - */ - -/** - * @brief 库配置的最低中断优先级 (数值越大优先级越低) - */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 - -/** - * @brief 库配置的最高系统调用中断优先级 - * @note 优先级高于此值的中断不能调用 FreeRTOS API - */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 - -/** - * @brief 内核使用的最低中断优先级 - */ -#define configKERNEL_INTERRUPT_PRIORITY \ - ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - -/** - * @brief 最高系统调用中断优先级 (转换为硬件值) - */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY \ - ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - -/* ============================================================================ */ -/* 硬件特定配置 */ -/* ============================================================================ */ - -/** - * @brief Cortex-M4F 优先级位数 - */ -#define configPRIO_BITS 4 - -/** - * @brief SysTick 中断优先级 - */ -#define xPortPendSVHandler PendSV_Handler -#define vPortSVCHandler SVC_Handler - -/* ============================================================================ */ -/* ARM Cortex-M 特定配置 */ -/* ============================================================================ */ - -/* 使能 ARMv8-M 专用扩展 (不适用于 Cortex-M4F) */ -#define configENABLE_MPU 0 -#define configENABLE_FZ 0 -#define configENABLE_TRUSTZONE 0 - -/* ============================================================================ */ -/* 调试配置 */ -/* ============================================================================ */ - -/** - * @brief 生成运行时任务统计信息 - */ -#define configGENERATE_RUN_TIME_STATS 0 - -/** - * @brief 使用追踪钩子 - */ -#define configUSE_TRACE_FACILITY 0 - -/* ============================================================================ */ -/* 应用特定钩子函数说明 */ -/* ============================================================================ */ - -/** - * @note 以下钩子函数需要在用户代码中实现 (通常在 L5_App 层): +/* ======================================================================== + * 协程配置 (本项目不使用) + * - USE_CO_ROUTINES: 使能协程功能 + * ======================================================================== */ +#define USE_CO_ROUTINES 0 + +/* ======================================================================== + * 中断配置 + * - configLIBRARY_LOWEST_INTERRUPT_PRIORITY: 库配置的最低中断优先级(数值越大优先级越低) + * - configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY: 库配置的最高系统调用中断优先级 + * - configKERNEL_INTERRUPT_PRIORITY: 内核使用的最低中断优先级(转换为硬件值) + * - configMAX_SYSCALL_INTERRUPT_PRIORITY: 最高系统调用中断优先级(转换为硬件值) + * - xPortPendSVHandler: PendSV中断处理函数映射 + * - vPortSVCHandler: SVC中断处理函数映射 + * ======================================================================== */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 +#define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) +#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) +#define xPortPendSVHandler PendSV_Handler +#define vPortSVCHandler SVC_Handler + +/* ======================================================================== + * 硬件特定配置 + * - configPRIO_BITS: Cortex-M4F优先级位数 + * ======================================================================== */ +#define configPRIO_BITS 4 + +/* ======================================================================== + * ARM Cortex-M特定配置 + * - configENABLE_MPU: 使能ARMv8-M MPU扩展(不适用于Cortex-M4F) + * - configENABLE_FZ: 使能ARMv8-M FZ扩展(不适用于Cortex-M4F) + * - configENABLE_TRUSTZONE: 使能ARMv8-M TrustZone扩展(不适用于Cortex-M4F) + * ======================================================================== */ +#define configENABLE_MPU 0 +#define configENABLE_FZ 0 +#define configENABLE_TRUSTZONE 0 + +/* ======================================================================== + * 调试配置 + * - configGENERATE_RUN_TIME_STATS: 生成运行时任务统计信息 + * - configUSE_TRACE_FACILITY: 使用追踪钩子 + * ======================================================================== */ +#define configGENERATE_RUN_TIME_STATS 0 +#define configUSE_TRACE_FACILITY 0 + +/* ======================================================================== + * 应用特定钩子函数说明 + * ======================================================================== + * 以下钩子函数需要在用户代码中实现(通常在L5_App层): * - * - vApplicationIdleHook() (当 configUSE_IDLE_HOOK = 1 时) - * - vApplicationTickHook() (当 configUSE_TICK_HOOK = 1 时) - * - vApplicationStackOverflowHook() (任务名作为 char* 传入) + * - vApplicationIdleHook() (当configUSE_IDLE_HOOK = 1时) + * - vApplicationTickHook() (当configUSE_TICK_HOOK = 1时) + * - vApplicationStackOverflowHook() (任务名作为char*传入) * - vApplicationMallocFailedHook() - * - vApplicationGetIdleTaskMemory() (当 configSUPPORT_STATIC_ALLOCATION = 1 时) - * - vApplicationGetTimerTaskMemory() (当 configSUPPORT_STATIC_ALLOCATION = 1 时) - */ + * - vApplicationGetIdleTaskMemory() (当configSUPPORT_STATIC_ALLOCATION = 1时) + * - vApplicationGetTimerTaskMemory() (当configSUPPORT_STATIC_ALLOCATION = 1时) + * ======================================================================== */ #endif /* FREERTOS_CONFIG_H */ From 2580184e7f960f969c71bfbbbf8509af48ccebe2 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Fri, 30 Jan 2026 23:01:25 +0800 Subject: [PATCH 04/12] =?UTF-8?q?[update]=E4=BC=98=E5=8C=96FreeRTOS?= =?UTF-8?q?=E7=9A=84=20FreeRTOSConfig.h=20=E7=9A=84=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h index 83e8cc1..baa7707 100644 --- a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h +++ b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h @@ -97,7 +97,7 @@ #define INCLUDE_xTaskGetCurrentTaskHandle 1 /* ======================================================================== - * 协程配置 (本项目不使用) + * 协程配置 * - USE_CO_ROUTINES: 使能协程功能 * ======================================================================== */ #define USE_CO_ROUTINES 0 @@ -126,9 +126,9 @@ /* ======================================================================== * ARM Cortex-M特定配置 - * - configENABLE_MPU: 使能ARMv8-M MPU扩展(不适用于Cortex-M4F) - * - configENABLE_FZ: 使能ARMv8-M FZ扩展(不适用于Cortex-M4F) - * - configENABLE_TRUSTZONE: 使能ARMv8-M TrustZone扩展(不适用于Cortex-M4F) + * - configENABLE_MPU: 使能ARMv8-M MPU扩展 + * - configENABLE_FZ: 使能ARMv8-M FZ扩展 + * - configENABLE_TRUSTZONE: 使能ARMv8-M TrustZone扩展 * ======================================================================== */ #define configENABLE_MPU 0 #define configENABLE_FZ 0 From f29c6ae661a284c37b32c1c51eee98837539ca04 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Fri, 30 Jan 2026 23:41:02 +0800 Subject: [PATCH 05/12] =?UTF-8?q?[fix]=E4=BF=AE=E5=A4=8DFreeRTOS=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h index baa7707..40b78f8 100644 --- a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h +++ b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h @@ -110,6 +110,7 @@ * - configMAX_SYSCALL_INTERRUPT_PRIORITY: 最高系统调用中断优先级(转换为硬件值) * - xPortPendSVHandler: PendSV中断处理函数映射 * - vPortSVCHandler: SVC中断处理函数映射 + * - xPortSysTickHandler:滴答计时器函数映射 * ======================================================================== */ #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 @@ -117,6 +118,7 @@ #define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) #define xPortPendSVHandler PendSV_Handler #define vPortSVCHandler SVC_Handler +#define xPortSysTickHandler SysTick_Handler /* ======================================================================== * 硬件特定配置 From 0d0170d34e7ebef6cf76582821b2c6966a96dd8f Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Fri, 30 Jan 2026 23:54:14 +0800 Subject: [PATCH 06/12] =?UTF-8?q?[fix]=E4=BF=AE=E5=A4=8DFreeRTOS=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h | 160 ++++++++++-------- 1 file changed, 88 insertions(+), 72 deletions(-) diff --git a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h index 40b78f8..c7b0efb 100644 --- a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h +++ b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h @@ -2,72 +2,104 @@ * @file FreeRTOSConfig.h * @brief FreeRTOS 配置文件 - EmbeddedKit 项目 * - * 本文件定义了 FreeRTOS 在 EmbeddedKit 项目中的所有配置参数。 - * 针对 STM32F429 (ARM Cortex-M4F, 168MHz) 进行了优化配置。 */ #ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H +#include + +extern uint32_t SystemCoreClock; + /* ======================================================================== * 基础配置参数 - * - configCPU_CLOCK_HZ: MCU系统时钟频率(Hz),需与实际系统时钟配置一致 - * - configTICK_RATE_HZ: RTOS系统节拍频率(Hz),常用值100Hz(10ms)或1000Hz(1ms) - * - configUSE_16_BIT_TICKS: 系统节拍计数器位宽,0=32位(ARM Cortex-M推荐),1=16位 - * - configMAX_PRIORITIES: 最大任务优先级数量,实际可用为1~(configMAX_PRIORITIES-1) - * - configUSE_PREEMPTION: 使用抢占式调度器,1=启用抢占,0=使用协作式调度 + * - configCPU_CLOCK_HZ: MCU系统时钟频率(Hz),使用SystemCoreClock变量确保动态更新 + * - configTICK_RATE_HZ: RTOS系统节拍频率(Hz),常用值1000Hz(1ms) + * - configUSE_16_BIT_TICKS: 系统节拍计数器位宽,0=32位(ARM Cortex-M推荐) + * - configMAX_PRIORITIES: 最大任务优先级数量,实际可用为0~(configMAX_PRIORITIES-1) + * - configUSE_PREEMPTION: 使用抢占式调度器,1=启用抢占 * - configUSE_TIME_SLICING: 使用时间片调度(同等优先级任务轮转) - * - configUSE_MUTEXES: 使用互斥信号量,必须启用才能使用递归互斥锁 + * - configUSE_MUTEXES: 使用互斥信号量 + * - configUSE_PORT_OPTIMISED_TASK_SELECTION: 使用硬件指令(CLZ)加速任务选择(ARM CM4专用) * ======================================================================== */ -#define configCPU_CLOCK_HZ 168000000UL -#define configTICK_RATE_HZ 1000 -#define configUSE_16_BIT_TICKS 0 -#define configMAX_PRIORITIES 5 -#define configUSE_PREEMPTION 1 -#define configUSE_TIME_SLICING 1 -#define configUSE_MUTEXES 1 +#define configCPU_CLOCK_HZ (SystemCoreClock) +#define configTICK_RATE_HZ 1000 +#define configUSE_16_BIT_TICKS 0 +#define configMAX_PRIORITIES 5 +#define configUSE_PREEMPTION 1 +#define configUSE_TIME_SLICING 1 +#define configUSE_MUTEXES 1 +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 /* ======================================================================== * 内存配置 * - configTOTAL_HEAP_SIZE: FreeRTOS堆总大小(字节),heap_4.c管理的内存池 * - configSUPPORT_STATIC_ALLOCATION: 支持静态内存分配 * - configSUPPORT_DYNAMIC_ALLOCATION: 支持动态内存分配 + * - configAPPLICATION_ALLOCATED_HEAP: 用户自定义堆内存定义(如需放置在CCM RAM) * ======================================================================== */ #define configTOTAL_HEAP_SIZE (32 * 1024) #define configSUPPORT_STATIC_ALLOCATION 0 #define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configAPPLICATION_ALLOCATED_HEAP 0 + +/* ======================================================================== + * 钩子函数与检测配置 + * - configUSE_IDLE_HOOK: 空闲任务执行时运行空闲钩子函数 + * - configUSE_TICK_HOOK: 每次节拍中断执行后运行节拍钩子函数 + * - configUSE_MALLOC_FAILED_HOOK: 内存申请失败钩子 + * - configCHECK_FOR_STACK_OVERFLOW: 栈溢出检测 (1=简单检测, 2=深度检测) + * ======================================================================== */ +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 1 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configCHECK_FOR_STACK_OVERFLOW 2 /* ======================================================================== * 任务相关配置 - * - configMINIMAL_STACK_SIZE: 最小任务栈大小(字),空闲任务使用的栈大小 + * - configMINIMAL_STACK_SIZE: 最小任务栈大小(字),空闲任务/定时器任务使用 * - configMAX_TASK_NAME_LEN: 任务名称最大长度 - * - configTASK_NOTIFICATION_ARRAY_ENTRIES: 任务本地存储缓冲区索引,0表示不使用 + * - configTASK_NOTIFICATION_ARRAY_ENTRIES: 任务本地存储缓冲区索引 + * - configUSE_STATS_FORMATTING_FUNCTIONS: 启用 vTaskList/vTaskGetRunTimeStats 格式化输出 * ======================================================================== */ #define configMINIMAL_STACK_SIZE 128 #define configMAX_TASK_NAME_LEN 16 #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1 +#define configUSE_STATS_FORMATTING_FUNCTIONS 1 /* ======================================================================== - * 钩子函数配置 - * - configUSE_IDLE_HOOK: 空闲任务执行时运行空闲钩子函数 - * - configUSE_TICK_HOOK: 每次节拍中断执行后运行节拍钩子函数 + * 软件定时器配置 + * - configUSE_TIMERS: 启用软件定时器功能 + * - configTIMER_TASK_PRIORITY: 定时器服务任务优先级(建议设为最高) + * - configTIMER_QUEUE_LENGTH: 定时器命令队列长度 + * - configTIMER_TASK_STACK_DEPTH: 定时器任务栈大小 * ======================================================================== */ -#define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 0 +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES - 1) +#define configTIMER_QUEUE_LENGTH 10 +#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE /* ======================================================================== * 队列/信号量配置 - * - configUSE_QUEUE_SETS: 队列注册机制(调试用) - * - configUSE_RECURSIVE_MUTEXES: 互斥信号量使用递归 - * - configUSE_COUNTING_SEMAPHORES: 使用计数型信号量 + * - configUSE_QUEUE_SETS: 队列注册机制 + * - configUSE_RECURSIVE_MUTEXES: 启用递归互斥锁 + * - configUSE_COUNTING_SEMAPHORES: 启用计数型信号量 * ======================================================================== */ #define configUSE_QUEUE_SETS 0 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_COUNTING_SEMAPHORES 1 +/* ======================================================================== + * 协程配置 (现代 FreeRTOS 项目极少使用,通常用 Task 代替) + * - configUSE_CO_ROUTINES: 启用协程功能 + * - configMAX_CO_ROUTINE_PRIORITIES: 协程的最大优先级数量 + * ======================================================================== */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES 2 + /* ======================================================================== * 断言配置 - * - configASSERT: 断言宏定义,断言失败时禁用中断并进入死循环 + * - configASSERT: 推荐实现为打印出错的文件名和行号 * ======================================================================== */ #define configASSERT(x) \ if ((x) == 0) \ @@ -78,14 +110,6 @@ /* ======================================================================== * API函数包含配置 - * - INCLUDE_vTaskPrioritySet: 使能vTaskPrioritySet函数 - * - INCLUDE_uxTaskPriorityGet: 使能uxTaskPriorityGet函数 - * - INCLUDE_vTaskDelete: 使能vTaskDelete函数 - * - INCLUDE_vTaskSuspend: 使能vTaskSuspend函数 - * - INCLUDE_xTaskDelayUntil: 使能xTaskDelayUntil函数 - * - INCLUDE_vTaskDelay: 使能vTaskDelay函数 - * - INCLUDE_xTaskGetSchedulerState: 使能xTaskGetSchedulerState函数 - * - INCLUDE_xTaskGetCurrentTaskHandle: 使能xTaskGetCurrentTaskHandle函数 * ======================================================================== */ #define INCLUDE_vTaskPrioritySet 1 #define INCLUDE_uxTaskPriorityGet 1 @@ -95,66 +119,58 @@ #define INCLUDE_vTaskDelay 1 #define INCLUDE_xTaskGetSchedulerState 1 #define INCLUDE_xTaskGetCurrentTaskHandle 1 - -/* ======================================================================== - * 协程配置 - * - USE_CO_ROUTINES: 使能协程功能 - * ======================================================================== */ -#define USE_CO_ROUTINES 0 +#define INCLUDE_xTimerPendFunctionCall 1 /* ======================================================================== * 中断配置 - * - configLIBRARY_LOWEST_INTERRUPT_PRIORITY: 库配置的最低中断优先级(数值越大优先级越低) - * - configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY: 库配置的最高系统调用中断优先级 - * - configKERNEL_INTERRUPT_PRIORITY: 内核使用的最低中断优先级(转换为硬件值) - * - configMAX_SYSCALL_INTERRUPT_PRIORITY: 最高系统调用中断优先级(转换为硬件值) - * - xPortPendSVHandler: PendSV中断处理函数映射 - * - vPortSVCHandler: SVC中断处理函数映射 - * - xPortSysTickHandler:滴答计时器函数映射 + * - configLIBRARY_LOWEST_INTERRUPT_PRIORITY: 最低优先级(15) + * - configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY: FreeRTOS可管理的最高优先级(5) + * - xPortPendSVHandler: 映射到标准 PendSV_Handler + * - vPortSVCHandler: 映射到标准 SVC_Handler + * - xPortSysTickHandler: 映射到标准 SysTick_Handler * ======================================================================== */ +#ifdef __NVIC_PRIO_BITS +# define configPRIO_BITS __NVIC_PRIO_BITS +#else +# define configPRIO_BITS 4 +#endif + #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 + #define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) #define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) + #define xPortPendSVHandler PendSV_Handler #define vPortSVCHandler SVC_Handler #define xPortSysTickHandler SysTick_Handler /* ======================================================================== - * 硬件特定配置 - * - configPRIO_BITS: Cortex-M4F优先级位数 - * ======================================================================== */ -#define configPRIO_BITS 4 - -/* ======================================================================== - * ARM Cortex-M特定配置 - * - configENABLE_MPU: 使能ARMv8-M MPU扩展 - * - configENABLE_FZ: 使能ARMv8-M FZ扩展 - * - configENABLE_TRUSTZONE: 使能ARMv8-M TrustZone扩展 + * ARM Cortex-M 安全扩展配置 * ======================================================================== */ #define configENABLE_MPU 0 #define configENABLE_FZ 0 #define configENABLE_TRUSTZONE 0 /* ======================================================================== - * 调试配置 - * - configGENERATE_RUN_TIME_STATS: 生成运行时任务统计信息 - * - configUSE_TRACE_FACILITY: 使用追踪钩子 + * 调试与运行时统计 * ======================================================================== */ #define configGENERATE_RUN_TIME_STATS 0 #define configUSE_TRACE_FACILITY 0 -/* ======================================================================== - * 应用特定钩子函数说明 - * ======================================================================== - * 以下钩子函数需要在用户代码中实现(通常在L5_App层): - * - * - vApplicationIdleHook() (当configUSE_IDLE_HOOK = 1时) - * - vApplicationTickHook() (当configUSE_TICK_HOOK = 1时) - * - vApplicationStackOverflowHook() (任务名作为char*传入) - * - vApplicationMallocFailedHook() - * - vApplicationGetIdleTaskMemory() (当configSUPPORT_STATIC_ALLOCATION = 1时) - * - vApplicationGetTimerTaskMemory() (当configSUPPORT_STATIC_ALLOCATION = 1时) - * ======================================================================== */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/* 钩子函数原型声明,确保编译器不会报错 */ +void vApplicationIdleHook(void); +void vApplicationTickHook(void); +void vApplicationMallocFailedHook(void); +void vApplicationStackOverflowHook(void *xTask, char *pcTaskName); + +#ifdef __cplusplus +} +#endif #endif /* FREERTOS_CONFIG_H */ From 36c3f0b862e2565b9593f743b3505d34d8604428 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Sat, 31 Jan 2026 00:06:20 +0800 Subject: [PATCH 07/12] =?UTF-8?q?[fix]=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h index c7b0efb..0d7bdd4 100644 --- a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h +++ b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h @@ -50,10 +50,10 @@ extern uint32_t SystemCoreClock; * - configUSE_MALLOC_FAILED_HOOK: 内存申请失败钩子 * - configCHECK_FOR_STACK_OVERFLOW: 栈溢出检测 (1=简单检测, 2=深度检测) * ======================================================================== */ -#define configUSE_IDLE_HOOK 1 -#define configUSE_TICK_HOOK 1 -#define configUSE_MALLOC_FAILED_HOOK 1 -#define configCHECK_FOR_STACK_OVERFLOW 2 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configUSE_MALLOC_FAILED_HOOK 0 +#define configCHECK_FOR_STACK_OVERFLOW 0 /* ======================================================================== * 任务相关配置 @@ -74,7 +74,7 @@ extern uint32_t SystemCoreClock; * - configTIMER_QUEUE_LENGTH: 定时器命令队列长度 * - configTIMER_TASK_STACK_DEPTH: 定时器任务栈大小 * ======================================================================== */ -#define configUSE_TIMERS 1 +#define configUSE_TIMERS 0 #define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES - 1) #define configTIMER_QUEUE_LENGTH 10 #define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE @@ -163,11 +163,11 @@ extern "C" { #endif -/* 钩子函数原型声明,确保编译器不会报错 */ -void vApplicationIdleHook(void); -void vApplicationTickHook(void); -void vApplicationMallocFailedHook(void); -void vApplicationStackOverflowHook(void *xTask, char *pcTaskName); +/* 钩子函数原型声明 */ +// void vApplicationIdleHook(void); +// void vApplicationTickHook(void); +// void vApplicationMallocFailedHook(void); +// void vApplicationStackOverflowHook(TaskHandle_t xTask, char *pcTaskName); #ifdef __cplusplus } From 048f3f189661bc6aa4fbbf94feee22146f41cd3c Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Sat, 31 Jan 2026 14:03:19 +0800 Subject: [PATCH 08/12] =?UTF-8?q?[update]=E6=9B=B4=E6=96=B0=20=20=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=81=B5=E6=B4=BB=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L2_Core/utils/inc/ek_mem.h | 204 +++++++++++++++---------------------- L2_Core/utils/src/ek_mem.c | 67 ++++++++++++ 2 files changed, 151 insertions(+), 120 deletions(-) diff --git a/L2_Core/utils/inc/ek_mem.h b/L2_Core/utils/inc/ek_mem.h index ccab656..ec722c5 100644 --- a/L2_Core/utils/inc/ek_mem.h +++ b/L2_Core/utils/inc/ek_mem.h @@ -1,119 +1,25 @@ -/* - * @note 内存管理都来自于 tlsf(../third_party/tlsf/tlsf.c),对于不同大小的内存需求管理, - * 建议修改下面两个参数来抉择一个合适的内存管理的开销(去上述的源码中修改) - * 这里的两个参数决定了内存分配器的管理开销 (Overhead) 和 运行效率。 - * 管理结构体大小(字节) ≈ FL_INDEX_MAX * (2 ^ SL_INDEX_COUNT_LOG2) * 4 - * 我们设置的默认值如下 - * FL_INDEX_MAX = 24 ; SL_INDEX_COUNT_LOG2 = 3; - * 管理结构体大小 = 24 * 2^3 * 4 Bytes = 768 Bytes - * 最大可以管理 = 2^24 = 16M byes - * @para1: FL_INDEX_MAX (First Level Index) - * ---------------------------------------------------------------------------------- - * 含义: 决定内存池能管理的最大连续内存块大小 (2的N次方)。 - * 策略: 根据你的 最大内存池大小 (Pool Size) 查表填入。 - * (填入值必须 >= log2(Pool Size)) - * - * | 内存池大小 (Pool Size) | 建议填入值 (FL_INDEX_MAX) | 备注 | - * | :--------------------- | :-----------------------: | :---------------------- | - * | < 16 KB | 14 | 适用于极小 RAM (M0/M3) | - * | < 32 KB | 15 | | - * | < 64 KB | 16 | 适用于 50KB 典型场景 | - * | < 128 KB | 17 | | - * | < 512 KB | 19 | | - * | < 16 MB | 24 | 通用嵌入式配置 | - * | < 1 GB | 30 | 桌面级/Linux配置 | - * - * @para2: SL_INDEX_COUNT_LOG2 (Second Level Index Log2) - * ---------------------------------------------------------------------------------- - * 含义: 决定空闲块的分类细致度 (2^N 份)。 - * 影响: 值越大,碎片率越低(分配越准),但内存开销(RAM)呈倍数增长。 - * - * | 填入值 | 分割份数 | 32位系统下每级开销 | 适用场景建议 (Trade-off) | - * | :----: | :------: | :----------------: | :------------------------------------- | - * | 5 | 32 份 | 128 字节/级 | [高性能PC] 追求极低碎片,内存充足 | - * | 4 | 16 份 | 64 字节/级 | [折中方案] 适合 >1MB 的内存池 | - * | 3 | 8 份 | 32 字节/级 | [嵌入式推荐] 适合 10KB-100KB,性价比高 | - * | 2 | 4 份 | 16 字节/级 | [极限压缩] RAM极度紧缺(<5KB)时使用 | - * - * ================================================================================== - * @example - * [开销计算示例 - 帮助您抉择] (基于32位系统指针) - * 场景 A: 10KB ~ 50KB 内存池 (推荐配置) - * -> FL_INDEX_MAX = 16 (支持到64KB) - * -> SL_INDEX_COUNT_LOG2 = 3 (切8份) - * -> 固定开销 ≈ 16 * 8 * 4 = 【512 字节】 (非常节省) - * - * 场景 B: 标准默认配置 (不建议用于小内存) - * -> FL_INDEX_MAX = 30 (支持到1GB) - * -> SL_INDEX_COUNT_LOG2 = 5 (切32份) - * -> 固定开销 ≈ 30 * 32 * 4 = 【3840 字节】 (对小内存池是巨大浪费) - * ================================================================================== - */ #ifndef EK_MEM_H #define EK_MEM_H #include "ek_def.h" -// 使用 tlsf 来作为 malloc free -#include "../../third_party/tlsf/tlsf.h" #include "../../../ek_conf.h" +#ifndef EK_HEAP_NO_TLSF +# define EK_HEAP_NO_TLSF 0 /* 默认使用 TLSF 内存分配器 */ +#endif + #ifndef EK_HEAP_SIZE # define EK_HEAP_SIZE (10 * 1024) -#endif /* EK_HEAP_SIZE */ +#endif #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif -/** - * @brief 获取内存池总大小 - * @retval 内存池总字节数 - */ -#ifndef ek_heap_total_size -# define ek_heap_total_size() (EK_HEAP_SIZE - tlsf_size()) -#endif /* ek_heap_total_size */ - -/** - * @brief 初始化默认内存堆 - * @note 使用 TLSF 内存分配器创建默认内存池 - * 如果创建失败会阻塞等待直到成功 - */ -#ifndef ek_heap_init -# define ek_heap_init() \ - do \ - { \ - ek_default_tlsf = tlsf_create_with_pool(ek_default_heap, EK_HEAP_SIZE); \ - while (ek_default_tlsf == NULL); \ - } while (0) -#endif /* ek_heap_init */ - -/** - * @brief 销毁默认内存堆 - * @note 释放 TLSF 内存分配器及其管理的所有内存 - */ -#ifndef ek_heap_destory -# define ek_heap_destory() tlsf_destroy(ek_default_tlsf) -#endif /* ek_heap_destory */ - -/** - * @brief 向默认内存堆添加内存池 - * @param ptr: 内存池起始地址 - * @param size: 内存池大小(字节) - * @note 可以动态扩展内存堆,添加额外的内存区域 - */ -#ifndef ek_heap_add_pool -# define ek_heap_add_pool(ptr, size) tlsf_add_pool(ek_default_tlsf, ptr, size) -#endif /* ek_heap_add_pool */ - -/** - * @brief 从默认内存堆移除内存池 - * @param pool: 要移除的内存池指针 - * @note 移除后该内存池不再可用,确保池内无已分配的内存块 - */ -#ifndef ek_heap_remove_pool -# define ek_heap_remove_pool(pool) tlsf_remove_pool(ek_default_tlsf, pool) -#endif /* ek_heap_remove_pool */ +void *_ek_malloc(size_t size); +void _ek_free(void *ptr); +void *_ek_realloc(void *ptr, size_t size); /** * @brief 从默认内存堆分配内存 @@ -121,20 +27,18 @@ extern "C" * @retval 分配的内存指针,失败返回 NULL */ #ifndef ek_malloc -# define ek_malloc(size) tlsf_malloc(ek_default_tlsf, size) -#endif /* ek_malloc */ +# define ek_malloc(size) _ek_malloc(size) +#endif /** * @brief 重新分配内存大小 * @param ptr: 原内存指针 * @param size: 新的内存大小(字节) * @retval 重新分配后的内存指针,失败返回 NULL - * @note 如果 ptr 为 NULL,等同于 ek_malloc - * 如果 size 为 0,等同于 ek_free */ #ifndef ek_realloc -# define ek_realloc(ptr, size) tlsf_realloc(ek_default_tlsf, ptr, size) -#endif /* ek_realloc */ +# define ek_realloc(ptr, size) _ek_realloc(ptr, size) +#endif /** * @brief 释放内存到默认内存堆 @@ -142,37 +46,97 @@ extern "C" * @note 释放后指针会被置为 NULL,避免悬空指针 */ #ifndef ek_free -# define ek_free(ptr) \ - do \ - { \ - tlsf_free(ek_default_tlsf, ptr); \ - ptr = NULL; \ +# define ek_free(ptr) \ + do \ + { \ + _ek_free(ptr); \ + ptr = NULL; \ } while (0) -#endif /* ek_free */ +#endif #if EK_HEAP_NO_TLSF == 0 +# include "../../third_party/tlsf/tlsf.h" + extern uint8_t ek_default_heap[]; extern tlsf_t ek_default_tlsf; +/** + * @brief 初始化默认内存堆 + * @note 使用 TLSF 内存分配器创建默认内存池 + */ +# ifndef ek_heap_init +# define ek_heap_init() \ + do \ + { \ + ek_default_tlsf = tlsf_create_with_pool(ek_default_heap, EK_HEAP_SIZE); \ + while (ek_default_tlsf == NULL); \ + } while (0) +# endif + +/** + * @brief 获取内存池总大小 + * @retval 内存池总字节数 + */ +# ifndef ek_heap_total_size +# define ek_heap_total_size() (EK_HEAP_SIZE - tlsf_size()) +# endif + +/** + * @brief 销毁默认内存堆 + */ +# ifndef ek_heap_destory +# define ek_heap_destory() tlsf_destroy(ek_default_tlsf) +# endif + +/** + * @brief 向默认内存堆添加内存池 + * @param ptr: 内存池起始地址 + * @param size: 内存池大小(字节) + */ +# ifndef ek_heap_add_pool +# define ek_heap_add_pool(ptr, size) tlsf_add_pool(ek_default_tlsf, ptr, size) +# endif + +/** + * @brief 从默认内存堆移除内存池 + * @param pool: 要移除的内存池指针 + */ +# ifndef ek_heap_remove_pool +# define ek_heap_remove_pool(pool) tlsf_remove_pool(ek_default_tlsf, pool) +# endif + /** * @brief 获取当前空闲内存大小 * @retval 空闲字节数 - * @note 每次调用都会遍历内存池统计,有一定开销 */ size_t ek_heap_unused(void); /** - * @brief 获取当使用的内存大小 + * @brief 获取当前已使用的内存大小 * @retval 使用的字节数 - * @note 每次调用都会遍历内存池统计,有一定开销 */ size_t ek_heap_used(void); +#else + +/* ======================================================================== + * EK_HEAP_NO_TLSF == 1: 用户自定义内存分配器 + * 用户需要: + * 定义 _ek_malloc, _ek_free, _ek_realloc 函数 + * ======================================================================== */ + +/** + * @brief 初始化内存堆 (用户需自行实现或定义为空) + */ +# ifndef ek_heap_init +# define ek_heap_init() ((void)0) +# endif + #endif /* EK_HEAP_NO_TLSF */ #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif -#endif /* EK_MEM_H */ +#endif /* EK_MEM_H */ diff --git a/L2_Core/utils/src/ek_mem.c b/L2_Core/utils/src/ek_mem.c index fc33c30..bcfd527 100644 --- a/L2_Core/utils/src/ek_mem.c +++ b/L2_Core/utils/src/ek_mem.c @@ -2,12 +2,79 @@ #if EK_HEAP_NO_TLSF == 0 +/* + * @note 内存管理都来自于 tlsf(../third_party/tlsf/tlsf.c),对于不同大小的内存需求管理, + * 建议修改下面两个参数来抉择一个合适的内存管理的开销(去上述的源码中修改) + * 这里的两个参数决定了内存分配器的管理开销 (Overhead) 和 运行效率。 + * 管理结构体大小(字节) ≈ FL_INDEX_MAX * (2 ^ SL_INDEX_COUNT_LOG2) * 4 + * 我们设置的默认值如下 + * FL_INDEX_MAX = 24 ; SL_INDEX_COUNT_LOG2 = 3; + * 管理结构体大小 = 24 * 2^3 * 4 Bytes = 768 Bytes + * 最大可以管理 = 2^24 = 16M byes + * @para1: FL_INDEX_MAX (First Level Index) + * ---------------------------------------------------------------------------------- + * 含义: 决定内存池能管理的最大连续内存块大小 (2的N次方)。 + * 策略: 根据你的 最大内存池大小 (Pool Size) 查表填入。 + * (填入值必须 >= log2(Pool Size)) + * + * | 内存池大小 (Pool Size) | 建议填入值 (FL_INDEX_MAX) | 备注 | + * | :--------------------- | :-----------------------: | :---------------------- | + * | < 16 KB | 14 | 适用于极小 RAM (M0/M3) | + * | < 32 KB | 15 | | + * | < 64 KB | 16 | 适用于 50KB 典型场景 | + * | < 128 KB | 17 | | + * | < 512 KB | 19 | | + * | < 16 MB | 24 | 通用嵌入式配置 | + * | < 1 GB | 30 | 桌面级/Linux配置 | + * + * @para2: SL_INDEX_COUNT_LOG2 (Second Level Index Log2) + * ---------------------------------------------------------------------------------- + * 含义: 决定空闲块的分类细致度 (2^N 份)。 + * 影响: 值越大,碎片率越低(分配越准),但内存开销(RAM)呈倍数增长。 + * + * | 填入值 | 分割份数 | 32位系统下每级开销 | 适用场景建议 (Trade-off) | + * | :----: | :------: | :----------------: | :------------------------------------- | + * | 5 | 32 份 | 128 字节/级 | [高性能PC] 追求极低碎片,内存充足 | + * | 4 | 16 份 | 64 字节/级 | [折中方案] 适合 >1MB 的内存池 | + * | 3 | 8 份 | 32 字节/级 | [嵌入式推荐] 适合 10KB-100KB,性价比高 | + * | 2 | 4 份 | 16 字节/级 | [极限压缩] RAM极度紧缺(<5KB)时使用 | + * + * ================================================================================== + * @example + * [开销计算示例 - 帮助您抉择] (基于32位系统指针) + * 场景 A: 10KB ~ 50KB 内存池 (推荐配置) + * -> FL_INDEX_MAX = 16 (支持到64KB) + * -> SL_INDEX_COUNT_LOG2 = 3 (切8份) + * -> 固定开销 ≈ 16 * 8 * 4 = 【512 字节】 (非常节省) + * + * 场景 B: 标准默认配置 (不建议用于小内存) + * -> FL_INDEX_MAX = 30 (支持到1GB) + * -> SL_INDEX_COUNT_LOG2 = 5 (切32份) + * -> 固定开销 ≈ 30 * 32 * 4 = 【3840 字节】 (对小内存池是巨大浪费) + * ================================================================================== + */ + uint8_t ek_default_heap[EK_HEAP_SIZE]; tlsf_t ek_default_tlsf; static size_t ek_unused_bytes = 0; static size_t ek_used_bytes = 0; +__WEAK void *_ek_malloc(size_t size) +{ + return tlsf_malloc(ek_default_tlsf, size); +} + +__WEAK void *_ek_realloc(void *ptr, size_t size) +{ + return tlsf_realloc(ek_default_tlsf, ptr, size); +} + +__WEAK void _ek_free(void *ptr) +{ + tlsf_free(ek_default_tlsf, ptr); +} + // walker 函数:统计空闲内存 static void ek_mem_walker(void *ptr, size_t size, int used, void *user) { From 5a61e3ccc5219eae7741103712fd436b543be614 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Sat, 31 Jan 2026 14:03:50 +0800 Subject: [PATCH 09/12] =?UTF-8?q?[update]=E4=BC=98=E5=8C=96=20=20=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h | 206 ++++++++++++++---- 1 file changed, 161 insertions(+), 45 deletions(-) diff --git a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h index 0d7bdd4..eba4064 100644 --- a/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h +++ b/L3_Middlewares/FreeRTOS/conf/FreeRTOSConfig.h @@ -15,21 +15,25 @@ extern uint32_t SystemCoreClock; * 基础配置参数 * - configCPU_CLOCK_HZ: MCU系统时钟频率(Hz),使用SystemCoreClock变量确保动态更新 * - configTICK_RATE_HZ: RTOS系统节拍频率(Hz),常用值1000Hz(1ms) - * - configUSE_16_BIT_TICKS: 系统节拍计数器位宽,0=32位(ARM Cortex-M推荐) + * - configTICK_TYPE_WIDTH_IN_BITS: 节拍计数器类型位宽 * - configMAX_PRIORITIES: 最大任务优先级数量,实际可用为0~(configMAX_PRIORITIES-1) * - configUSE_PREEMPTION: 使用抢占式调度器,1=启用抢占 * - configUSE_TIME_SLICING: 使用时间片调度(同等优先级任务轮转) + * - configUSE_TICKLESS_IDLE: 低功耗无节拍空闲模式,0=禁用 * - configUSE_MUTEXES: 使用互斥信号量 * - configUSE_PORT_OPTIMISED_TASK_SELECTION: 使用硬件指令(CLZ)加速任务选择(ARM CM4专用) + * - configIDLE_SHOULD_YIELD: 空闲任务是否主动让出CPU给同优先级任务 * ======================================================================== */ #define configCPU_CLOCK_HZ (SystemCoreClock) #define configTICK_RATE_HZ 1000 -#define configUSE_16_BIT_TICKS 0 +#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS #define configMAX_PRIORITIES 5 #define configUSE_PREEMPTION 1 #define configUSE_TIME_SLICING 1 +#define configUSE_TICKLESS_IDLE 0 #define configUSE_MUTEXES 1 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 +#define configIDLE_SHOULD_YIELD 1 /* ======================================================================== * 内存配置 @@ -37,35 +41,61 @@ extern uint32_t SystemCoreClock; * - configSUPPORT_STATIC_ALLOCATION: 支持静态内存分配 * - configSUPPORT_DYNAMIC_ALLOCATION: 支持动态内存分配 * - configAPPLICATION_ALLOCATED_HEAP: 用户自定义堆内存定义(如需放置在CCM RAM) + * - configSTACK_ALLOCATION_FROM_SEPARATE_HEAP: 任务栈从独立堆分配(需实现pvPortMallocStack/vPortFreeStack) + * - configENABLE_HEAP_PROTECTOR: 启用堆保护(heap_4/heap_5边界检查和指针混淆) + * - configHEAP_CLEAR_MEMORY_ON_FREE: 释放内存时清零 + * - configUSE_MINI_LIST_ITEM: 使用精简链表项节省RAM(可能违反严格别名规则) + * - configSTACK_DEPTH_TYPE: 栈深度类型定义 + * - configMESSAGE_BUFFER_LENGTH_TYPE: 消息缓冲区长度类型 * ======================================================================== */ -#define configTOTAL_HEAP_SIZE (32 * 1024) -#define configSUPPORT_STATIC_ALLOCATION 0 -#define configSUPPORT_DYNAMIC_ALLOCATION 1 -#define configAPPLICATION_ALLOCATED_HEAP 0 +#define configTOTAL_HEAP_SIZE (32 * 1024) +#define configSUPPORT_STATIC_ALLOCATION 0 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configAPPLICATION_ALLOCATED_HEAP 0 +#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0 +#define configENABLE_HEAP_PROTECTOR 0 +#define configHEAP_CLEAR_MEMORY_ON_FREE 0 +#define configUSE_MINI_LIST_ITEM 1 +#define configSTACK_DEPTH_TYPE size_t +#define configMESSAGE_BUFFER_LENGTH_TYPE size_t /* ======================================================================== * 钩子函数与检测配置 * - configUSE_IDLE_HOOK: 空闲任务执行时运行空闲钩子函数 * - configUSE_TICK_HOOK: 每次节拍中断执行后运行节拍钩子函数 * - configUSE_MALLOC_FAILED_HOOK: 内存申请失败钩子 - * - configCHECK_FOR_STACK_OVERFLOW: 栈溢出检测 (1=简单检测, 2=深度检测) + * - configUSE_DAEMON_TASK_STARTUP_HOOK: 定时器守护任务启动钩子 + * - configUSE_SB_COMPLETED_CALLBACK: 流/消息缓冲区完成回调 + * - configCHECK_FOR_STACK_OVERFLOW: 栈溢出检测 (0=禁用, 1=简单检测, 2=深度检测) * ======================================================================== */ -#define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 0 -#define configUSE_MALLOC_FAILED_HOOK 0 -#define configCHECK_FOR_STACK_OVERFLOW 0 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configUSE_MALLOC_FAILED_HOOK 0 +#define configUSE_DAEMON_TASK_STARTUP_HOOK 0 +#define configUSE_SB_COMPLETED_CALLBACK 0 +#define configCHECK_FOR_STACK_OVERFLOW 0 /* ======================================================================== * 任务相关配置 * - configMINIMAL_STACK_SIZE: 最小任务栈大小(字),空闲任务/定时器任务使用 - * - configMAX_TASK_NAME_LEN: 任务名称最大长度 - * - configTASK_NOTIFICATION_ARRAY_ENTRIES: 任务本地存储缓冲区索引 + * - configMAX_TASK_NAME_LEN: 任务名称最大长度(含NULL终止符) + * - configTASK_NOTIFICATION_ARRAY_ENTRIES: 任务通知数组条目数 + * - configUSE_TASK_NOTIFICATIONS: 启用任务通知功能 + * - configUSE_APPLICATION_TASK_TAG: 启用任务标签功能 + * - configNUM_THREAD_LOCAL_STORAGE_POINTERS: 线程本地存储指针数量 + * - configUSE_NEWLIB_REENTRANT: 为每个任务分配newlib重入结构 * - configUSE_STATS_FORMATTING_FUNCTIONS: 启用 vTaskList/vTaskGetRunTimeStats 格式化输出 + * - configSTATS_BUFFER_MAX_LENGTH: 统计信息缓冲区最大长度 * ======================================================================== */ -#define configMINIMAL_STACK_SIZE 128 -#define configMAX_TASK_NAME_LEN 16 -#define configTASK_NOTIFICATION_ARRAY_ENTRIES 1 -#define configUSE_STATS_FORMATTING_FUNCTIONS 1 +#define configMINIMAL_STACK_SIZE 128 +#define configMAX_TASK_NAME_LEN 16 +#define configTASK_NOTIFICATION_ARRAY_ENTRIES 1 +#define configUSE_TASK_NOTIFICATIONS 1 +#define configUSE_APPLICATION_TASK_TAG 0 +#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0 +#define configUSE_NEWLIB_REENTRANT 0 +#define configUSE_STATS_FORMATTING_FUNCTIONS 0 +#define configSTATS_BUFFER_MAX_LENGTH 0xFFFF /* ======================================================================== * 软件定时器配置 @@ -74,21 +104,35 @@ extern uint32_t SystemCoreClock; * - configTIMER_QUEUE_LENGTH: 定时器命令队列长度 * - configTIMER_TASK_STACK_DEPTH: 定时器任务栈大小 * ======================================================================== */ -#define configUSE_TIMERS 0 +#define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES - 1) #define configTIMER_QUEUE_LENGTH 10 #define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE /* ======================================================================== * 队列/信号量配置 - * - configUSE_QUEUE_SETS: 队列注册机制 + * - configUSE_QUEUE_SETS: 启用队列集功能 + * - configQUEUE_REGISTRY_SIZE: 队列注册表大小(调试器使用) * - configUSE_RECURSIVE_MUTEXES: 启用递归互斥锁 * - configUSE_COUNTING_SEMAPHORES: 启用计数型信号量 * ======================================================================== */ #define configUSE_QUEUE_SETS 0 +#define configQUEUE_REGISTRY_SIZE 0 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_COUNTING_SEMAPHORES 1 +/* ======================================================================== + * 事件组配置 + * - configUSE_EVENT_GROUPS: 启用事件组功能(需包含event_groups.c) + * ======================================================================== */ +#define configUSE_EVENT_GROUPS 1 + +/* ======================================================================== + * 流缓冲区配置 + * - configUSE_STREAM_BUFFERS: 启用流缓冲区/消息缓冲区功能(需包含stream_buffer.c) + * ======================================================================== */ +#define configUSE_STREAM_BUFFERS 1 + /* ======================================================================== * 协程配置 (现代 FreeRTOS 项目极少使用,通常用 Task 代替) * - configUSE_CO_ROUTINES: 启用协程功能 @@ -111,20 +155,34 @@ extern uint32_t SystemCoreClock; /* ======================================================================== * API函数包含配置 * ======================================================================== */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_xTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_xResumeFromISR 1 +#define INCLUDE_xTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 0 +#define INCLUDE_xTaskGetIdleTaskHandle 0 +#define INCLUDE_eTaskGetState 0 +#define INCLUDE_xEventGroupSetBitFromISR 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xTaskAbortDelay 0 +#define INCLUDE_xTaskGetHandle 0 +#define INCLUDE_xTaskResumeFromISR 1 + +/* ======================================================================== + * 兼容性配置 + * - configENABLE_BACKWARD_COMPATIBILITY: 启用旧版API名称映射 + * ======================================================================== */ +#define configENABLE_BACKWARD_COMPATIBILITY 1 /* ======================================================================== * 中断配置 * - configLIBRARY_LOWEST_INTERRUPT_PRIORITY: 最低优先级(15) - * - configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY: FreeRTOS可管理的最高优先级(5) + * - configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY: FreeRTOS可管理的最高优先级(5); * - xPortPendSVHandler: 映射到标准 PendSV_Handler * - vPortSVCHandler: 映射到标准 SVC_Handler * - xPortSysTickHandler: 映射到标准 SysTick_Handler @@ -147,30 +205,88 @@ extern uint32_t SystemCoreClock; /* ======================================================================== * ARM Cortex-M 安全扩展配置 + * - configENABLE_MPU: 启用内存保护单元(MPU) + * - configENABLE_FPU: 启用浮点单元(FPU) + * - configENABLE_TRUSTZONE: 启用TrustZone支持(ARMv8-M) + * - configRUN_FREERTOS_SECURE_ONLY: 仅在安全侧运行FreeRTOS + * - configENABLE_MVE: 启用M-Profile矢量扩展(Cortex-M55/M85) + * ======================================================================== */ +#define configENABLE_MPU 0 +#define configENABLE_FPU 0 +#define configENABLE_TRUSTZONE 0 +#define configRUN_FREERTOS_SECURE_ONLY 0 +#define configENABLE_MVE 0 + +/* ======================================================================== + * MPU 相关配置 (仅当 configENABLE_MPU=1 时有效) + * - configTOTAL_MPU_REGIONS: MPU区域数量(通常为8或16) + * - configTEX_S_C_B_FLASH: Flash区域的TEX/S/C/B位配置 + * - configTEX_S_C_B_SRAM: SRAM区域的TEX/S/C/B位配置 + * - configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY: 仅允许内核代码进行特权提升 + * - configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS: 允许非特权任务进入临界区 + * - configUSE_MPU_WRAPPERS_V1: 使用v1版本MPU包装器(0=使用v2) + * - configPROTECTED_KERNEL_OBJECT_POOL_SIZE: 受保护内核对象池大小(v2 MPU) + * - configSYSTEM_CALL_STACK_SIZE: 系统调用栈大小(字)(v2 MPU) + * - configENABLE_ACCESS_CONTROL_LIST: 启用访问控制列表(v2 MPU) * ======================================================================== */ -#define configENABLE_MPU 0 -#define configENABLE_FZ 0 -#define configENABLE_TRUSTZONE 0 +#define configTOTAL_MPU_REGIONS 8 +#define configTEX_S_C_B_FLASH 0x07UL +#define configTEX_S_C_B_SRAM 0x07UL +#define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1 +#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0 +#define configUSE_MPU_WRAPPERS_V1 0 +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE 10 +#define configSYSTEM_CALL_STACK_SIZE 128 +#define configENABLE_ACCESS_CONTROL_LIST 0 +#define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0 + +/* ======================================================================== + * ARMv8-M 安全侧配置 + * - secureconfigMAX_SECURE_CONTEXTS: 可调用安全侧的最大任务数 + * - configKERNEL_PROVIDED_STATIC_MEMORY: 内核提供静态内存分配实现 + * ======================================================================== */ +#define secureconfigMAX_SECURE_CONTEXTS 5 +#define configKERNEL_PROVIDED_STATIC_MEMORY 1 + +/* ======================================================================== + * SMP(对称多处理)配置 (多核系统使用) + * - configNUMBER_OF_CORES: 处理器核心数量(单核时为1或不定义) + * - configRUN_MULTIPLE_PRIORITIES: 允许不同优先级任务同时运行 + * - configUSE_CORE_AFFINITY: 启用核心亲和性功能 + * - configTASK_DEFAULT_CORE_AFFINITY: 默认核心亲和性掩码 + * - configUSE_TASK_PREEMPTION_DISABLE: 允许单独禁用任务抢占 + * - configUSE_PASSIVE_IDLE_HOOK: 启用被动空闲钩子 + * - configTIMER_SERVICE_TASK_CORE_AFFINITY: 定时器任务核心亲和性 + * ======================================================================== */ +/* #define configNUMBER_OF_CORES 1 */ +#define configRUN_MULTIPLE_PRIORITIES 0 +#define configUSE_CORE_AFFINITY 0 +#define configTASK_DEFAULT_CORE_AFFINITY tskNO_AFFINITY +#define configUSE_TASK_PREEMPTION_DISABLE 0 +#define configUSE_PASSIVE_IDLE_HOOK 0 +#define configTIMER_SERVICE_TASK_CORE_AFFINITY tskNO_AFFINITY /* ======================================================================== * 调试与运行时统计 + * - configGENERATE_RUN_TIME_STATS: 生成任务运行时间统计(需提供时钟源) + * - configUSE_TRACE_FACILITY: 启用跟踪功能(任务结构包含额外调试字段) * ======================================================================== */ #define configGENERATE_RUN_TIME_STATS 0 #define configUSE_TRACE_FACILITY 0 -#ifdef __cplusplus -extern "C" -{ -#endif - -/* 钩子函数原型声明 */ -// void vApplicationIdleHook(void); -// void vApplicationTickHook(void); -// void vApplicationMallocFailedHook(void); -// void vApplicationStackOverflowHook(TaskHandle_t xTask, char *pcTaskName); +/* ======================================================================== + * ARMv7-M/ARMv8-M 端口特定配置 + * - configCHECK_HANDLER_INSTALLATION: 验证FreeRTOS中断处理程序安装正确性 + * ======================================================================== */ +#define configCHECK_HANDLER_INSTALLATION 1 -#ifdef __cplusplus -} -#endif +/* ======================================================================== + * 钩子函数原型声明 + * ======================================================================== */ +/* void vApplicationIdleHook(void); */ +/* void vApplicationTickHook(void); */ +/* void vApplicationMallocFailedHook(void); */ +/* void vApplicationStackOverflowHook(TaskHandle_t xTask, char *pcTaskName); */ +/* void vApplicationDaemonTaskStartupHook(void); */ #endif /* FREERTOS_CONFIG_H */ From 2942d9fc966d7df1e17db5eb1057632340bad4d8 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Sat, 31 Jan 2026 15:23:55 +0800 Subject: [PATCH 10/12] =?UTF-8?q?[update]=E6=9B=B4=E6=8D=A2lvgl=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=B8=BA=E6=9B=B4=E9=80=9A=E7=94=A8=E7=9A=84v8.3.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 17 +- L3_Middlewares/CMakeLists.txt | 8 - L3_Middlewares/LVGL/CMakeLists.txt | 25 +- L3_Middlewares/LVGL/doc/README.md | 186 + L3_Middlewares/LVGL/doc/README_pt_BR.md | 206 + L3_Middlewares/LVGL/doc/README_zh.md | 193 + .../LVGL/env_support/cmake/custom.cmake | 205 +- .../LVGL/env_support/cmake/esp.cmake | 26 +- .../LVGL/env_support/cmake/micropython.cmake | 6 +- .../LVGL/env_support/cmake/version.cmake | 8 - .../LVGL/env_support/cmake/zephyr.cmake | 3 +- L3_Middlewares/LVGL/lv_conf.h | 597 +- L3_Middlewares/LVGL/lv_conf_template.h | 947 +- L3_Middlewares/LVGL/lv_version.h | 14 - L3_Middlewares/LVGL/lv_version.h.in | 14 - L3_Middlewares/LVGL/lvgl.h | 120 +- L3_Middlewares/LVGL/src/core/lv_core.mk | 20 + L3_Middlewares/LVGL/src/core/lv_disp.c | 539 + L3_Middlewares/LVGL/src/core/lv_disp.h | 264 + L3_Middlewares/LVGL/src/core/lv_event.c | 527 + L3_Middlewares/LVGL/src/core/lv_event.h | 363 + L3_Middlewares/LVGL/src/core/lv_global.h | 266 - L3_Middlewares/LVGL/src/core/lv_group.c | 212 +- L3_Middlewares/LVGL/src/core/lv_group.h | 91 +- .../LVGL/src/core/lv_group_private.h | 75 - L3_Middlewares/LVGL/src/core/lv_indev.c | 1180 + L3_Middlewares/LVGL/src/core/lv_indev.h | 176 + .../LVGL/src/core/lv_indev_scroll.c | 690 + .../src/{indev => core}/lv_indev_scroll.h | 12 +- L3_Middlewares/LVGL/src/core/lv_obj.c | 751 +- L3_Middlewares/LVGL/src/core/lv_obj.h | 349 +- L3_Middlewares/LVGL/src/core/lv_obj_class.c | 88 +- L3_Middlewares/LVGL/src/core/lv_obj_class.h | 46 +- .../LVGL/src/core/lv_obj_class_private.h | 78 - L3_Middlewares/LVGL/src/core/lv_obj_draw.c | 238 +- L3_Middlewares/LVGL/src/core/lv_obj_draw.h | 85 +- .../LVGL/src/core/lv_obj_draw_private.h | 48 - L3_Middlewares/LVGL/src/core/lv_obj_event.c | 419 - L3_Middlewares/LVGL/src/core/lv_obj_event.h | 198 - .../LVGL/src/core/lv_obj_event_private.h | 62 - .../LVGL/src/core/lv_obj_id_builtin.c | 122 - L3_Middlewares/LVGL/src/core/lv_obj_pos.c | 609 +- L3_Middlewares/LVGL/src/core/lv_obj_pos.h | 152 +- L3_Middlewares/LVGL/src/core/lv_obj_private.h | 88 - .../LVGL/src/core/lv_obj_property.c | 302 - .../LVGL/src/core/lv_obj_property.h | 209 - L3_Middlewares/LVGL/src/core/lv_obj_scroll.c | 337 +- L3_Middlewares/LVGL/src/core/lv_obj_scroll.h | 83 +- .../LVGL/src/core/lv_obj_scroll_private.h | 50 - L3_Middlewares/LVGL/src/core/lv_obj_style.c | 642 +- L3_Middlewares/LVGL/src/core/lv_obj_style.h | 239 +- .../LVGL/src/core/lv_obj_style_gen.c | 430 +- .../LVGL/src/core/lv_obj_style_gen.h | 722 +- .../LVGL/src/core/lv_obj_style_private.h | 95 - L3_Middlewares/LVGL/src/core/lv_obj_tree.c | 408 +- L3_Middlewares/LVGL/src/core/lv_obj_tree.h | 117 +- L3_Middlewares/LVGL/src/core/lv_refr.c | 1494 +- L3_Middlewares/LVGL/src/core/lv_refr.h | 59 +- .../LVGL/src/core/lv_refr_private.h | 75 - .../LVGL/src/{themes => core}/lv_theme.c | 46 +- .../LVGL/src/{themes => core}/lv_theme.h | 22 +- L3_Middlewares/LVGL/src/display/lv_display.c | 1134 - L3_Middlewares/LVGL/src/display/lv_display.h | 593 - .../LVGL/src/display/lv_display_private.h | 181 - .../LVGL/src/draw/arm2d/lv_draw_arm2d.mk | 6 + .../LVGL/src/draw/arm2d/lv_gpu_arm2d.c | 1574 ++ .../LVGL/src/draw/arm2d/lv_gpu_arm2d.h | 51 + L3_Middlewares/LVGL/src/draw/lv_draw.c | 460 +- L3_Middlewares/LVGL/src/draw/lv_draw.h | 349 +- L3_Middlewares/LVGL/src/draw/lv_draw.mk | 25 + L3_Middlewares/LVGL/src/draw/lv_draw_arc.c | 124 +- L3_Middlewares/LVGL/src/draw/lv_draw_arc.h | 45 +- L3_Middlewares/LVGL/src/draw/lv_draw_buf.c | 669 - L3_Middlewares/LVGL/src/draw/lv_draw_buf.h | 356 - .../LVGL/src/draw/lv_draw_buf_private.h | 53 - L3_Middlewares/LVGL/src/draw/lv_draw_image.c | 314 - L3_Middlewares/LVGL/src/draw/lv_draw_image.h | 129 - .../LVGL/src/draw/lv_draw_image_private.h | 85 - L3_Middlewares/LVGL/src/draw/lv_draw_img.c | 375 + L3_Middlewares/LVGL/src/draw/lv_draw_img.h | 104 + L3_Middlewares/LVGL/src/draw/lv_draw_label.c | 447 +- L3_Middlewares/LVGL/src/draw/lv_draw_label.h | 108 +- .../LVGL/src/draw/lv_draw_label_private.h | 68 - L3_Middlewares/LVGL/src/draw/lv_draw_layer.c | 93 + L3_Middlewares/LVGL/src/draw/lv_draw_layer.h | 83 + L3_Middlewares/LVGL/src/draw/lv_draw_line.c | 31 +- L3_Middlewares/LVGL/src/draw/lv_draw_line.h | 37 +- L3_Middlewares/LVGL/src/draw/lv_draw_mask.c | 1506 +- L3_Middlewares/LVGL/src/draw/lv_draw_mask.h | 365 +- .../LVGL/src/draw/lv_draw_mask_private.h | 51 - .../LVGL/src/draw/lv_draw_private.h | 196 - L3_Middlewares/LVGL/src/draw/lv_draw_rect.c | 257 +- L3_Middlewares/LVGL/src/draw/lv_draw_rect.h | 124 +- .../LVGL/src/draw/lv_draw_transform.c | 54 + .../LVGL/src/draw/lv_draw_transform.h | 44 + .../LVGL/src/draw/lv_draw_triangle.c | 47 +- .../LVGL/src/draw/lv_draw_triangle.h | 31 +- L3_Middlewares/LVGL/src/draw/lv_draw_vector.c | 804 - L3_Middlewares/LVGL/src/draw/lv_draw_vector.h | 489 - .../LVGL/src/draw/lv_draw_vector_private.h | 109 - .../LVGL/src/draw/lv_image_decoder.c | 415 - .../LVGL/src/draw/lv_image_decoder.h | 194 - .../LVGL/src/draw/lv_image_decoder_private.h | 142 - L3_Middlewares/LVGL/src/draw/lv_image_dsc.h | 141 - L3_Middlewares/LVGL/src/draw/lv_img_buf.c | 392 + L3_Middlewares/LVGL/src/draw/lv_img_buf.h | 249 + L3_Middlewares/LVGL/src/draw/lv_img_cache.c | 215 + L3_Middlewares/LVGL/src/draw/lv_img_cache.h | 78 + L3_Middlewares/LVGL/src/draw/lv_img_decoder.c | 730 + L3_Middlewares/LVGL/src/draw/lv_img_decoder.h | 274 + .../LVGL/src/draw/nxp/lv_draw_nxp.mk | 7 + .../LVGL/src/draw/nxp/pxp/lv_draw_buf_pxp.c | 117 - .../LVGL/src/draw/nxp/pxp/lv_draw_nxp_pxp.mk | 9 + .../LVGL/src/draw/nxp/pxp/lv_draw_pxp.c | 581 +- .../LVGL/src/draw/nxp/pxp/lv_draw_pxp.h | 55 +- .../LVGL/src/draw/nxp/pxp/lv_draw_pxp_blend.c | 573 + .../LVGL/src/draw/nxp/pxp/lv_draw_pxp_blend.h | 130 + .../LVGL/src/draw/nxp/pxp/lv_draw_pxp_fill.c | 149 - .../LVGL/src/draw/nxp/pxp/lv_draw_pxp_img.c | 367 - .../LVGL/src/draw/nxp/pxp/lv_draw_pxp_layer.c | 158 - .../LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp.c | 138 + .../LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp.h | 166 + .../src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c | 180 + .../src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.h | 78 + .../LVGL/src/draw/nxp/pxp/lv_pxp_cfg.c | 93 - .../LVGL/src/draw/nxp/pxp/lv_pxp_cfg.h | 104 - .../LVGL/src/draw/nxp/pxp/lv_pxp_osa.c | 188 - .../LVGL/src/draw/nxp/pxp/lv_pxp_osa.h | 62 - .../LVGL/src/draw/nxp/pxp/lv_pxp_utils.c | 149 - .../LVGL/src/draw/nxp/pxp/lv_pxp_utils.h | 84 - .../src/draw/nxp/vglite/lv_draw_buf_vglite.c | 131 - .../src/draw/nxp/vglite/lv_draw_nxp_vglite.mk | 12 + .../LVGL/src/draw/nxp/vglite/lv_draw_vglite.c | 875 +- .../LVGL/src/draw/nxp/vglite/lv_draw_vglite.h | 66 +- .../src/draw/nxp/vglite/lv_draw_vglite_arc.c | 467 +- .../src/draw/nxp/vglite/lv_draw_vglite_arc.h | 83 + .../draw/nxp/vglite/lv_draw_vglite_blend.c | 635 + .../draw/nxp/vglite/lv_draw_vglite_blend.h | 168 + .../draw/nxp/vglite/lv_draw_vglite_border.c | 203 - .../src/draw/nxp/vglite/lv_draw_vglite_fill.c | 237 - .../src/draw/nxp/vglite/lv_draw_vglite_img.c | 443 - .../draw/nxp/vglite/lv_draw_vglite_label.c | 180 - .../draw/nxp/vglite/lv_draw_vglite_layer.c | 157 - .../src/draw/nxp/vglite/lv_draw_vglite_line.c | 131 +- .../src/draw/nxp/vglite/lv_draw_vglite_line.h | 83 + .../src/draw/nxp/vglite/lv_draw_vglite_rect.c | 459 + .../src/draw/nxp/vglite/lv_draw_vglite_rect.h | 97 + .../draw/nxp/vglite/lv_draw_vglite_triangle.c | 182 - .../LVGL/src/draw/nxp/vglite/lv_vglite_buf.c | 97 +- .../LVGL/src/draw/nxp/vglite/lv_vglite_buf.h | 84 +- .../src/draw/nxp/vglite/lv_vglite_matrix.c | 81 - .../src/draw/nxp/vglite/lv_vglite_matrix.h | 78 - .../LVGL/src/draw/nxp/vglite/lv_vglite_path.c | 217 - .../LVGL/src/draw/nxp/vglite/lv_vglite_path.h | 97 - .../src/draw/nxp/vglite/lv_vglite_utils.c | 283 +- .../src/draw/nxp/vglite/lv_vglite_utils.h | 209 +- .../src/draw/renesas/dave2d/lv_draw_dave2d.c | 597 - .../src/draw/renesas/dave2d/lv_draw_dave2d.h | 105 - .../draw/renesas/dave2d/lv_draw_dave2d_arc.c | 188 - .../renesas/dave2d/lv_draw_dave2d_border.c | 417 - .../draw/renesas/dave2d/lv_draw_dave2d_fill.c | 310 - .../renesas/dave2d/lv_draw_dave2d_image.c | 328 - .../renesas/dave2d/lv_draw_dave2d_label.c | 163 - .../draw/renesas/dave2d/lv_draw_dave2d_line.c | 93 - .../dave2d/lv_draw_dave2d_mask_rectangle.c | 57 - .../renesas/dave2d/lv_draw_dave2d_triangle.c | 176 - .../renesas/dave2d/lv_draw_dave2d_utils.c | 140 - .../renesas/dave2d/lv_draw_dave2d_utils.h | 45 - .../LVGL/src/draw/renesas/lv_draw_renesas.mk | 7 + .../src/draw/renesas/lv_gpu_d2_draw_label.c | 292 + .../LVGL/src/draw/renesas/lv_gpu_d2_ra6m3.c | 742 + .../LVGL/src/draw/renesas/lv_gpu_d2_ra6m3.h | 56 + L3_Middlewares/LVGL/src/draw/sdl/README.md | 28 + .../LVGL/src/draw/sdl/lv_draw_sdl.c | 478 +- .../LVGL/src/draw/sdl/lv_draw_sdl.h | 86 +- .../LVGL/src/draw/sdl/lv_draw_sdl.mk | 19 + .../LVGL/src/draw/sdl/lv_draw_sdl_arc.c | 245 + .../LVGL/src/draw/sdl/lv_draw_sdl_bg.c | 106 + .../LVGL/src/draw/sdl/lv_draw_sdl_composite.c | 279 + .../LVGL/src/draw/sdl/lv_draw_sdl_composite.h | 84 + .../LVGL/src/draw/sdl/lv_draw_sdl_img.c | 499 + .../LVGL/src/draw/sdl/lv_draw_sdl_img.h | 86 + .../LVGL/src/draw/sdl/lv_draw_sdl_label.c | 189 + .../LVGL/src/draw/sdl/lv_draw_sdl_layer.c | 147 + .../LVGL/src/draw/sdl/lv_draw_sdl_layer.h | 56 + .../LVGL/src/draw/sdl/lv_draw_sdl_line.c | 157 + .../LVGL/src/draw/sdl/lv_draw_sdl_mask.c | 84 + .../LVGL/src/draw/sdl/lv_draw_sdl_mask.h | 51 + .../LVGL/src/draw/sdl/lv_draw_sdl_polygon.c | 139 + .../LVGL/src/draw/sdl/lv_draw_sdl_priv.h | 73 + .../LVGL/src/draw/sdl/lv_draw_sdl_rect.c | 1013 + .../LVGL/src/draw/sdl/lv_draw_sdl_rect.h | 104 + .../src/draw/sdl/lv_draw_sdl_stack_blur.c | 249 + .../sdl/lv_draw_sdl_stack_blur.h} | 19 +- .../src/draw/sdl/lv_draw_sdl_texture_cache.c | 176 + .../src/draw/sdl/lv_draw_sdl_texture_cache.h | 109 + .../LVGL/src/draw/sdl/lv_draw_sdl_utils.c | 183 + .../LVGL/src/draw/sdl/lv_draw_sdl_utils.h | 65 + .../draw/stm32_dma2d/lv_draw_stm32_dma2d.mk | 6 + .../src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.c | 796 + .../src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.h | 67 + .../LVGL/src/draw/sw/arm2d/lv_draw_sw_arm2d.h | 589 - .../src/draw/sw/arm2d/lv_draw_sw_helium.h | 60 - .../src/draw/sw/blend/arm2d/lv_blend_arm2d.h | 937 - .../draw/sw/blend/helium/lv_blend_helium.S | 701 - .../draw/sw/blend/helium/lv_blend_helium.h | 1313 - .../LVGL/src/draw/sw/blend/lv_draw_sw_blend.c | 228 - .../LVGL/src/draw/sw/blend/lv_draw_sw_blend.h | 52 - .../draw/sw/blend/lv_draw_sw_blend_private.h | 92 - .../draw/sw/blend/lv_draw_sw_blend_to_al88.c | 1036 - .../draw/sw/blend/lv_draw_sw_blend_to_al88.h | 45 - .../sw/blend/lv_draw_sw_blend_to_argb8888.c | 1064 - .../sw/blend/lv_draw_sw_blend_to_argb8888.h | 45 - .../draw/sw/blend/lv_draw_sw_blend_to_i1.c | 1117 - .../draw/sw/blend/lv_draw_sw_blend_to_i1.h | 45 - .../draw/sw/blend/lv_draw_sw_blend_to_l8.c | 897 - .../draw/sw/blend/lv_draw_sw_blend_to_l8.h | 45 - .../sw/blend/lv_draw_sw_blend_to_rgb565.c | 1150 - .../sw/blend/lv_draw_sw_blend_to_rgb565.h | 45 - .../sw/blend/lv_draw_sw_blend_to_rgb888.c | 985 - .../sw/blend/lv_draw_sw_blend_to_rgb888.h | 47 - .../src/draw/sw/blend/neon/lv_blend_neon.S | 685 - .../src/draw/sw/blend/neon/lv_blend_neon.h | 1301 - L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.c | 826 +- L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.h | 200 +- L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.mk | 17 + .../LVGL/src/draw/sw/lv_draw_sw_arc.c | 625 +- .../LVGL/src/draw/sw/lv_draw_sw_blend.c | 1061 + .../LVGL/src/draw/sw/lv_draw_sw_blend.h | 70 + .../LVGL/src/draw/sw/lv_draw_sw_border.c | 336 - .../LVGL/src/draw/sw/lv_draw_sw_box_shadow.c | 743 - .../LVGL/src/draw/sw/lv_draw_sw_dither.c | 213 + .../LVGL/src/draw/sw/lv_draw_sw_dither.h | 71 + .../LVGL/src/draw/sw/lv_draw_sw_fill.c | 342 - .../LVGL/src/draw/sw/lv_draw_sw_gradient.c | 810 +- .../LVGL/src/draw/sw/lv_draw_sw_gradient.h | 192 +- .../LVGL/src/draw/sw/lv_draw_sw_img.c | 604 +- .../LVGL/src/draw/sw/lv_draw_sw_layer.c | 150 + .../LVGL/src/draw/sw/lv_draw_sw_letter.c | 573 +- .../LVGL/src/draw/sw/lv_draw_sw_line.c | 363 +- .../LVGL/src/draw/sw/lv_draw_sw_mask.c | 1236 - .../LVGL/src/draw/sw/lv_draw_sw_mask.h | 185 - .../src/draw/sw/lv_draw_sw_mask_private.h | 157 - .../LVGL/src/draw/sw/lv_draw_sw_mask_rect.c | 134 - .../LVGL/src/draw/sw/lv_draw_sw_polygon.c | 207 + .../LVGL/src/draw/sw/lv_draw_sw_private.h | 68 - .../LVGL/src/draw/sw/lv_draw_sw_rect.c | 1436 ++ .../LVGL/src/draw/sw/lv_draw_sw_transform.c | 886 +- .../LVGL/src/draw/sw/lv_draw_sw_triangle.c | 200 - .../LVGL/src/draw/sw/lv_draw_sw_vector.c | 453 - .../draw/swm341_dma2d/lv_draw_swm341_dma2d.mk | 6 + .../draw/swm341_dma2d/lv_gpu_swm341_dma2d.c | 241 + .../draw/swm341_dma2d/lv_gpu_swm341_dma2d.h | 64 + .../src/draw/vg_lite/lv_draw_buf_vg_lite.c | 58 - .../LVGL/src/draw/vg_lite/lv_draw_vg_lite.c | 281 - .../LVGL/src/draw/vg_lite/lv_draw_vg_lite.h | 90 - .../src/draw/vg_lite/lv_draw_vg_lite_arc.c | 209 - .../src/draw/vg_lite/lv_draw_vg_lite_border.c | 114 - .../draw/vg_lite/lv_draw_vg_lite_box_shadow.c | 98 - .../src/draw/vg_lite/lv_draw_vg_lite_fill.c | 114 - .../src/draw/vg_lite/lv_draw_vg_lite_img.c | 199 - .../src/draw/vg_lite/lv_draw_vg_lite_label.c | 362 - .../src/draw/vg_lite/lv_draw_vg_lite_layer.c | 74 - .../src/draw/vg_lite/lv_draw_vg_lite_line.c | 212 - .../draw/vg_lite/lv_draw_vg_lite_mask_rect.c | 144 - .../draw/vg_lite/lv_draw_vg_lite_triangle.c | 114 - .../src/draw/vg_lite/lv_draw_vg_lite_type.h | 72 - .../src/draw/vg_lite/lv_draw_vg_lite_vector.c | 435 - .../src/draw/vg_lite/lv_vg_lite_decoder.c | 393 - .../src/draw/vg_lite/lv_vg_lite_decoder.h | 47 - .../LVGL/src/draw/vg_lite/lv_vg_lite_grad.c | 687 - .../LVGL/src/draw/vg_lite/lv_vg_lite_grad.h | 69 - .../LVGL/src/draw/vg_lite/lv_vg_lite_math.c | 62 - .../LVGL/src/draw/vg_lite/lv_vg_lite_math.h | 75 - .../LVGL/src/draw/vg_lite/lv_vg_lite_path.c | 647 - .../LVGL/src/draw/vg_lite/lv_vg_lite_path.h | 128 - .../src/draw/vg_lite/lv_vg_lite_pending.c | 99 - .../src/draw/vg_lite/lv_vg_lite_pending.h | 83 - .../LVGL/src/draw/vg_lite/lv_vg_lite_stroke.c | 310 - .../LVGL/src/draw/vg_lite/lv_vg_lite_stroke.h | 84 - .../LVGL/src/draw/vg_lite/lv_vg_lite_utils.c | 1217 - .../LVGL/src/draw/vg_lite/lv_vg_lite_utils.h | 188 - L3_Middlewares/LVGL/src/drivers/README.md | 1 - .../src/drivers/display/drm/lv_linux_drm.c | 852 - .../src/drivers/display/drm/lv_linux_drm.h | 46 - .../src/drivers/display/fb/lv_linux_fbdev.c | 359 - .../src/drivers/display/fb/lv_linux_fbdev.h | 52 - .../src/drivers/display/ili9341/lv_ili9341.c | 117 - .../src/drivers/display/ili9341/lv_ili9341.h | 93 - .../drivers/display/lcd/lv_lcd_generic_mipi.c | 340 - .../drivers/display/lcd/lv_lcd_generic_mipi.h | 241 - .../display/renesas_glcdc/lv_renesas_glcdc.c | 360 - .../display/renesas_glcdc/lv_renesas_glcdc.h | 57 - .../src/drivers/display/st7735/lv_st7735.c | 113 - .../src/drivers/display/st7735/lv_st7735.h | 93 - .../src/drivers/display/st7789/lv_st7789.c | 116 - .../src/drivers/display/st7789/lv_st7789.h | 93 - .../src/drivers/display/st7796/lv_st7796.c | 121 - .../src/drivers/display/st7796/lv_st7796.h | 93 - .../drivers/display/tft_espi/lv_tft_espi.cpp | 110 - .../drivers/display/tft_espi/lv_tft_espi.h | 43 - .../LVGL/src/drivers/evdev/lv_evdev.c | 244 - .../LVGL/src/drivers/evdev/lv_evdev.h | 64 - .../LVGL/src/drivers/glfw/lv_glfw_window.c | 391 - .../LVGL/src/drivers/glfw/lv_glfw_window.h | 108 - .../src/drivers/glfw/lv_glfw_window_private.h | 70 - .../LVGL/src/drivers/glfw/lv_opengles_debug.h | 38 - .../src/drivers/glfw/lv_opengles_driver.c | 409 - .../src/drivers/glfw/lv_opengles_driver.h | 82 - .../src/drivers/glfw/lv_opengles_texture.c | 151 - .../src/drivers/glfw/lv_opengles_texture.h | 66 - .../LVGL/src/drivers/libinput/lv_libinput.c | 672 - .../LVGL/src/drivers/libinput/lv_libinput.h | 101 - .../drivers/libinput/lv_libinput_private.h | 83 - .../LVGL/src/drivers/libinput/lv_xkb.c | 180 - .../LVGL/src/drivers/libinput/lv_xkb.h | 64 - .../src/drivers/libinput/lv_xkb_private.h | 53 - L3_Middlewares/LVGL/src/drivers/lv_drivers.h | 68 - .../LVGL/src/drivers/nuttx/lv_nuttx_cache.c | 96 - .../LVGL/src/drivers/nuttx/lv_nuttx_entry.c | 306 - .../LVGL/src/drivers/nuttx/lv_nuttx_entry.h | 112 - .../LVGL/src/drivers/nuttx/lv_nuttx_fbdev.c | 407 - .../LVGL/src/drivers/nuttx/lv_nuttx_fbdev.h | 55 - .../src/drivers/nuttx/lv_nuttx_image_cache.c | 176 - .../LVGL/src/drivers/nuttx/lv_nuttx_lcd.c | 238 - .../LVGL/src/drivers/nuttx/lv_nuttx_lcd.h | 49 - .../LVGL/src/drivers/nuttx/lv_nuttx_libuv.c | 340 - .../LVGL/src/drivers/nuttx/lv_nuttx_libuv.h | 66 - .../src/drivers/nuttx/lv_nuttx_profiler.c | 96 - .../src/drivers/nuttx/lv_nuttx_profiler.h | 39 - .../src/drivers/nuttx/lv_nuttx_touchscreen.c | 200 - .../src/drivers/nuttx/lv_nuttx_touchscreen.h | 57 - L3_Middlewares/LVGL/src/drivers/qnx/lv_qnx.c | 542 - L3_Middlewares/LVGL/src/drivers/qnx/lv_qnx.h | 86 - .../LVGL/src/drivers/sdl/lv_sdl_keyboard.c | 218 - .../LVGL/src/drivers/sdl/lv_sdl_keyboard.h | 46 - .../LVGL/src/drivers/sdl/lv_sdl_mouse.c | 204 - .../LVGL/src/drivers/sdl/lv_sdl_mouse.h | 43 - .../LVGL/src/drivers/sdl/lv_sdl_mousewheel.c | 142 - .../LVGL/src/drivers/sdl/lv_sdl_mousewheel.h | 43 - .../LVGL/src/drivers/sdl/lv_sdl_private.h | 49 - .../LVGL/src/drivers/sdl/lv_sdl_window.c | 495 - .../LVGL/src/drivers/sdl/lv_sdl_window.h | 62 - .../LVGL/src/drivers/wayland/lv_wayland.c | 2860 --- .../LVGL/src/drivers/wayland/lv_wayland.h | 142 - .../LVGL/src/drivers/wayland/lv_wayland_smm.c | 675 - .../LVGL/src/drivers/wayland/lv_wayland_smm.h | 105 - .../src/drivers/windows/lv_windows_context.c | 720 - .../src/drivers/windows/lv_windows_context.h | 134 - .../src/drivers/windows/lv_windows_display.c | 170 - .../src/drivers/windows/lv_windows_display.h | 127 - .../src/drivers/windows/lv_windows_input.c | 825 - .../src/drivers/windows/lv_windows_input.h | 83 - .../windows/lv_windows_input_private.h | 65 - L3_Middlewares/LVGL/src/drivers/x11/lv_x11.h | 81 - .../LVGL/src/drivers/x11/lv_x11_display.c | 394 - .../LVGL/src/drivers/x11/lv_x11_input.c | 324 - L3_Middlewares/LVGL/src/extra/README.md | 31 + .../src/{ => extra}/layouts/flex/lv_flex.c | 307 +- .../LVGL/src/extra/layouts/flex/lv_flex.h | 152 + .../LVGL/src/extra/layouts/grid/lv_grid.c | 782 + .../LVGL/src/extra/layouts/grid/lv_grid.h | 194 + .../layouts/lv_layouts.h} | 17 +- .../LVGL/src/extra/libs/bmp/lv_bmp.c | 258 + .../LVGL/src/{ => extra}/libs/bmp/lv_bmp.h | 3 +- .../src/{ => extra}/libs/ffmpeg/lv_ffmpeg.c | 210 +- .../src/{ => extra}/libs/ffmpeg/lv_ffmpeg.h | 19 +- .../src/{ => extra}/libs/freetype/arial.ttf | Bin .../src/extra/libs/freetype/lv_freetype.c | 687 + .../src/extra/libs/freetype/lv_freetype.h | 83 + .../src/{ => extra}/libs/fsdrv/lv_fs_fatfs.c | 132 +- .../src/extra/libs/fsdrv/lv_fs_littlefs.c | 332 + .../LVGL/src/extra/libs/fsdrv/lv_fs_posix.c | 319 + .../src/{ => extra}/libs/fsdrv/lv_fs_stdio.c | 152 +- .../src/{ => extra}/libs/fsdrv/lv_fs_win32.c | 117 +- .../src/{ => extra}/libs/fsdrv/lv_fsdrv.h | 34 +- .../LVGL/src/{ => extra}/libs/gif/gifdec.c | 627 +- .../LVGL/src/extra/libs/gif/gifdec.h | 60 + .../LVGL/src/{ => extra}/libs/gif/lv_gif.c | 116 +- .../libs/gif/lv_gif.h} | 35 +- .../libs/lv_libs.h} | 31 +- .../LVGL/src/extra/libs/png/lodepng.c | 6469 +++++ .../lodepng => extra/libs/png}/lodepng.h | 1236 +- .../LVGL/src/extra/libs/png/lv_png.c | 278 + .../lv_libpng.h => extra/libs/png/lv_png.h} | 18 +- .../LVGL/src/extra/libs/qrcode/lv_qrcode.c | 215 + .../LVGL/src/extra/libs/qrcode/lv_qrcode.h | 69 + .../LVGL/src/extra/libs/qrcode/qrcodegen.c | 1035 + .../src/{ => extra}/libs/qrcode/qrcodegen.h | 101 +- .../src/{ => extra}/libs/rlottie/lv_rlottie.c | 138 +- .../src/{ => extra}/libs/rlottie/lv_rlottie.h | 25 +- .../LVGL/src/extra/libs/sjpg/lv_sjpg.c | 917 + .../libs/sjpg/lv_sjpg.h} | 16 +- .../LVGL/src/extra/libs/sjpg/tjpgd.c | 1155 + .../LVGL/src/extra/libs/sjpg/tjpgd.h | 93 + .../tjpgd => extra/libs/sjpg}/tjpgdcnf.h | 10 +- .../src/extra/libs/tiny_ttf/lv_tiny_ttf.c | 284 + .../src/extra/libs/tiny_ttf/lv_tiny_ttf.h | 62 + .../{ => extra}/libs/tiny_ttf/stb_rect_pack.h | 6 +- .../libs/tiny_ttf/stb_truetype_htcw.h | 56 +- L3_Middlewares/LVGL/src/extra/lv_extra.c | 97 + .../lv_os_private.h => extra/lv_extra.h} | 23 +- L3_Middlewares/LVGL/src/extra/lv_extra.mk | 1 + .../src/{ => extra}/others/fragment/README.md | 0 .../{ => extra}/others/fragment/lv_fragment.c | 37 +- .../{ => extra}/others/fragment/lv_fragment.h | 58 +- .../others/fragment/lv_fragment_manager.c | 92 +- .../{ => extra}/others/gridnav/lv_gridnav.c | 120 +- .../{ => extra}/others/gridnav/lv_gridnav.h | 60 +- .../{ => extra}/others/ime/lv_ime_pinyin.c | 380 +- .../{ => extra}/others/ime/lv_ime_pinyin.h | 38 +- .../{ => extra}/others/imgfont/lv_imgfont.c | 67 +- .../{ => extra}/others/imgfont/lv_imgfont.h | 11 +- .../others/lv_others.h} | 21 +- .../src/{ => extra}/others/monkey/lv_monkey.c | 59 +- .../src/{ => extra}/others/monkey/lv_monkey.h | 19 +- .../LVGL/src/extra/others/msg/lv_msg.c | 189 + .../LVGL/src/extra/others/msg/lv_msg.h | 145 + .../src/extra/others/snapshot/lv_snapshot.c | 213 + .../src/extra/others/snapshot/lv_snapshot.h | 84 + .../src/extra/themes/basic/lv_theme_basic.c | 428 + .../themes/basic/lv_theme_basic.h} | 28 +- .../extra/themes/default/lv_theme_default.c | 1181 + .../themes/default/lv_theme_default.h | 11 +- .../themes/lv_themes.h} | 13 +- .../src/extra/themes/mono/lv_theme_mono.c | 504 + .../{ => extra}/themes/mono/lv_theme_mono.h | 19 +- .../widgets/animimg/lv_animimg.c} | 89 +- .../src/extra/widgets/animimg/lv_animimg.h | 103 + .../widgets/calendar/lv_calendar.c | 235 +- .../widgets/calendar/lv_calendar.h | 64 +- .../calendar/lv_calendar_header_arrow.c | 43 +- .../calendar/lv_calendar_header_arrow.h | 6 +- .../calendar/lv_calendar_header_dropdown.c | 67 +- .../calendar/lv_calendar_header_dropdown.h | 19 +- .../LVGL/src/extra/widgets/chart/lv_chart.c | 1810 ++ .../src/{ => extra}/widgets/chart/lv_chart.h | 218 +- .../extra/widgets/colorwheel/lv_colorwheel.c | 713 + .../extra/widgets/colorwheel/lv_colorwheel.h | 142 + .../LVGL/src/extra/widgets/imgbtn/lv_imgbtn.c | 386 + .../LVGL/src/extra/widgets/imgbtn/lv_imgbtn.h | 131 + .../src/extra/widgets/keyboard/lv_keyboard.c | 430 + .../widgets/keyboard/lv_keyboard.h | 104 +- .../LVGL/src/{ => extra}/widgets/led/lv_led.c | 65 +- .../LVGL/src/{ => extra}/widgets/led/lv_led.h | 41 +- .../src/{ => extra}/widgets/list/lv_list.c | 63 +- .../LVGL/src/extra/widgets/list/lv_list.h | 54 + .../LVGL/src/extra/widgets/lv_widgets.h | 56 + .../src/{ => extra}/widgets/menu/lv_menu.c | 247 +- .../LVGL/src/extra/widgets/menu/lv_menu.h | 233 + .../LVGL/src/extra/widgets/meter/lv_meter.c | 702 + .../LVGL/src/extra/widgets/meter/lv_meter.h | 266 + .../LVGL/src/extra/widgets/msgbox/lv_msgbox.c | 212 + .../LVGL/src/extra/widgets/msgbox/lv_msgbox.h | 99 + .../src/{ => extra}/widgets/span/lv_span.c | 406 +- .../LVGL/src/extra/widgets/span/lv_span.h | 245 + .../{ => extra}/widgets/spinbox/lv_spinbox.c | 289 +- .../{ => extra}/widgets/spinbox/lv_spinbox.h | 82 +- .../{ => extra}/widgets/spinner/lv_spinner.c | 62 +- .../{ => extra}/widgets/spinner/lv_spinner.h | 19 +- .../src/extra/widgets/tabview/lv_tabview.c | 354 + .../src/extra/widgets/tabview/lv_tabview.h | 65 + .../widgets/tileview/lv_tileview.c | 103 +- .../widgets/tileview/lv_tileview.h | 25 +- .../LVGL/src/{ => extra}/widgets/win/lv_win.c | 28 +- .../LVGL/src/{ => extra}/widgets/win/lv_win.h | 21 +- L3_Middlewares/LVGL/src/font/korean.ttf | Bin 0 -> 3371440 bytes .../LVGL/src/font/lv_binfont_loader.h | 61 - L3_Middlewares/LVGL/src/font/lv_font.c | 81 +- L3_Middlewares/LVGL/src/font/lv_font.h | 135 +- L3_Middlewares/LVGL/src/font/lv_font.mk | 36 + .../font/lv_font_dejavu_16_persian_hebrew.c | 17 +- .../LVGL/src/font/lv_font_fmt_txt.c | 413 +- .../LVGL/src/font/lv_font_fmt_txt.h | 72 +- .../LVGL/src/font/lv_font_fmt_txt_private.h | 56 - .../{lv_binfont_loader.c => lv_font_loader.c} | 213 +- .../lv_font_loader.h} | 13 +- .../LVGL/src/font/lv_font_montserrat_10.c | 17 +- .../LVGL/src/font/lv_font_montserrat_12.c | 17 +- .../src/font/lv_font_montserrat_12_subpx.c | 3865 +++ .../LVGL/src/font/lv_font_montserrat_14.c | 17 +- .../LVGL/src/font/lv_font_montserrat_16.c | 17 +- .../LVGL/src/font/lv_font_montserrat_18.c | 17 +- .../LVGL/src/font/lv_font_montserrat_20.c | 17 +- .../LVGL/src/font/lv_font_montserrat_22.c | 17 +- .../LVGL/src/font/lv_font_montserrat_24.c | 17 +- .../LVGL/src/font/lv_font_montserrat_26.c | 17 +- .../LVGL/src/font/lv_font_montserrat_28.c | 16 +- .../font/lv_font_montserrat_28_compressed.c | 17 +- .../LVGL/src/font/lv_font_montserrat_30.c | 17 +- .../LVGL/src/font/lv_font_montserrat_32.c | 17 +- .../LVGL/src/font/lv_font_montserrat_34.c | 17 +- .../LVGL/src/font/lv_font_montserrat_36.c | 17 +- .../LVGL/src/font/lv_font_montserrat_38.c | 17 +- .../LVGL/src/font/lv_font_montserrat_40.c | 17 +- .../LVGL/src/font/lv_font_montserrat_42.c | 17 +- .../LVGL/src/font/lv_font_montserrat_44.c | 17 +- .../LVGL/src/font/lv_font_montserrat_46.c | 17 +- .../LVGL/src/font/lv_font_montserrat_48.c | 17 +- .../LVGL/src/font/lv_font_montserrat_8.c | 17 +- .../LVGL/src/font/lv_font_simsun_14_cjk.c | 20783 ---------------- .../LVGL/src/font/lv_font_simsun_16_cjk.c | 2785 +-- .../LVGL/src/font/lv_font_unscii_16.c | 19 +- .../LVGL/src/font/lv_font_unscii_8.c | 19 +- L3_Middlewares/LVGL/src/font/lv_symbol_def.h | 134 +- L3_Middlewares/LVGL/src/hal/lv_hal.h | 48 + L3_Middlewares/LVGL/src/hal/lv_hal.mk | 8 + L3_Middlewares/LVGL/src/hal/lv_hal_disp.c | 720 + L3_Middlewares/LVGL/src/hal/lv_hal_disp.h | 373 + L3_Middlewares/LVGL/src/hal/lv_hal_indev.c | 195 + L3_Middlewares/LVGL/src/hal/lv_hal_indev.h | 240 + .../src/{tick/lv_tick.c => hal/lv_hal_tick.c} | 81 +- L3_Middlewares/LVGL/src/hal/lv_hal_tick.h | 69 + L3_Middlewares/LVGL/src/indev/lv_indev.c | 1741 -- L3_Middlewares/LVGL/src/indev/lv_indev.h | 413 - .../LVGL/src/indev/lv_indev_private.h | 134 - .../LVGL/src/indev/lv_indev_scroll.c | 733 - .../LVGL/src/layouts/flex/lv_flex.h | 102 - .../LVGL/src/layouts/grid/lv_grid.c | 665 - .../LVGL/src/layouts/grid/lv_grid.h | 99 - L3_Middlewares/LVGL/src/layouts/lv_layout.c | 79 - L3_Middlewares/LVGL/src/layouts/lv_layout.h | 67 - .../LVGL/src/layouts/lv_layout_private.h | 58 - .../LVGL/src/libs/barcode/code128.c | 582 - .../LVGL/src/libs/barcode/code128.h | 47 - .../LVGL/src/libs/barcode/lv_barcode.c | 300 - .../LVGL/src/libs/barcode/lv_barcode.h | 118 - .../src/libs/barcode/lv_barcode_private.h | 55 - .../src/libs/bin_decoder/lv_bin_decoder.c | 1157 - .../src/libs/bin_decoder/lv_bin_decoder.h | 70 - L3_Middlewares/LVGL/src/libs/bmp/lv_bmp.c | 253 - .../LVGL/src/libs/ffmpeg/lv_ffmpeg_private.h | 51 - .../LVGL/src/libs/freetype/ftmodule.h | 33 - .../LVGL/src/libs/freetype/ftoption.h | 964 - .../LVGL/src/libs/freetype/lv_freetype.c | 408 - .../LVGL/src/libs/freetype/lv_freetype.h | 127 - .../src/libs/freetype/lv_freetype_glyph.c | 201 - .../src/libs/freetype/lv_freetype_image.c | 188 - .../src/libs/freetype/lv_freetype_outline.c | 373 - .../src/libs/freetype/lv_freetype_private.h | 151 - .../LVGL/src/libs/freetype/lv_ftsystem.c | 291 - .../libs/fsdrv/lv_fs_arduino_esp_littlefs.cpp | 201 - .../LVGL/src/libs/fsdrv/lv_fs_arduino_sd.cpp | 192 - .../LVGL/src/libs/fsdrv/lv_fs_cbfs.c | 10 - .../LVGL/src/libs/fsdrv/lv_fs_littlefs.c | 286 - .../LVGL/src/libs/fsdrv/lv_fs_memfs.c | 227 - .../LVGL/src/libs/fsdrv/lv_fs_posix.c | 341 - L3_Middlewares/LVGL/src/libs/gif/gifdec.h | 71 - L3_Middlewares/LVGL/src/libs/gif/gifdec_mve.h | 140 - L3_Middlewares/LVGL/src/libs/gif/lv_gif.h | 104 - .../src/libs/libjpeg_turbo/lv_libjpeg_turbo.c | 598 - .../src/libs/libjpeg_turbo/lv_libjpeg_turbo.h | 48 - .../LVGL/src/libs/libpng/lv_libpng.c | 331 - .../LVGL/src/libs/lodepng/lodepng.c | 7657 ------ .../LVGL/src/libs/lodepng/lv_lodepng.c | 261 - .../LVGL/src/libs/lodepng/lv_lodepng.h | 48 - L3_Middlewares/LVGL/src/libs/lz4/LICENSE | 24 - L3_Middlewares/LVGL/src/libs/lz4/lz4.c | 2761 -- L3_Middlewares/LVGL/src/libs/lz4/lz4.h | 877 - .../LVGL/src/libs/qrcode/lv_qrcode.c | 242 - .../LVGL/src/libs/qrcode/lv_qrcode.h | 85 - .../LVGL/src/libs/qrcode/lv_qrcode_private.h | 52 - .../LVGL/src/libs/qrcode/qrcodegen.c | 1116 - L3_Middlewares/LVGL/src/libs/rle/lv_rle.c | 112 - L3_Middlewares/LVGL/src/libs/rle/lv_rle.h | 46 - .../src/libs/rlottie/lv_rlottie_private.h | 61 - .../LVGL/src/libs/thorvg/add_lvgl_if.sh | 13 - L3_Middlewares/LVGL/src/libs/thorvg/config.h | 15 - .../src/libs/thorvg/rapidjson/allocators.h | 693 - .../thorvg/rapidjson/cursorstreamwrapper.h | 78 - .../LVGL/src/libs/thorvg/rapidjson/document.h | 3043 --- .../src/libs/thorvg/rapidjson/encodedstream.h | 299 - .../src/libs/thorvg/rapidjson/encodings.h | 716 - .../LVGL/src/libs/thorvg/rapidjson/error/en.h | 176 - .../src/libs/thorvg/rapidjson/error/error.h | 285 - .../libs/thorvg/rapidjson/filereadstream.h | 99 - .../libs/thorvg/rapidjson/filewritestream.h | 104 - .../LVGL/src/libs/thorvg/rapidjson/fwd.h | 151 - .../thorvg/rapidjson/internal/biginteger.h | 297 - .../libs/thorvg/rapidjson/internal/clzll.h | 71 - .../libs/thorvg/rapidjson/internal/diyfp.h | 261 - .../src/libs/thorvg/rapidjson/internal/dtoa.h | 249 - .../libs/thorvg/rapidjson/internal/ieee754.h | 78 - .../src/libs/thorvg/rapidjson/internal/itoa.h | 308 - .../src/libs/thorvg/rapidjson/internal/meta.h | 186 - .../libs/thorvg/rapidjson/internal/pow10.h | 55 - .../libs/thorvg/rapidjson/internal/regex.h | 739 - .../libs/thorvg/rapidjson/internal/stack.h | 232 - .../libs/thorvg/rapidjson/internal/strfunc.h | 83 - .../libs/thorvg/rapidjson/internal/strtod.h | 293 - .../src/libs/thorvg/rapidjson/internal/swap.h | 46 - .../libs/thorvg/rapidjson/istreamwrapper.h | 128 - .../src/libs/thorvg/rapidjson/memorybuffer.h | 70 - .../src/libs/thorvg/rapidjson/memorystream.h | 71 - .../thorvg/rapidjson/msinttypes/inttypes.h | 316 - .../libs/thorvg/rapidjson/msinttypes/stdint.h | 300 - .../libs/thorvg/rapidjson/ostreamwrapper.h | 81 - .../LVGL/src/libs/thorvg/rapidjson/pointer.h | 1470 -- .../src/libs/thorvg/rapidjson/prettywriter.h | 277 - .../src/libs/thorvg/rapidjson/rapidjson.h | 741 - .../LVGL/src/libs/thorvg/rapidjson/reader.h | 2246 -- .../LVGL/src/libs/thorvg/rapidjson/schema.h | 3262 --- .../LVGL/src/libs/thorvg/rapidjson/stream.h | 223 - .../src/libs/thorvg/rapidjson/stringbuffer.h | 121 - .../LVGL/src/libs/thorvg/rapidjson/uri.h | 481 - .../LVGL/src/libs/thorvg/rapidjson/writer.h | 710 - L3_Middlewares/LVGL/src/libs/thorvg/thorvg.h | 2182 -- .../LVGL/src/libs/thorvg/thorvg_capi.h | 2508 -- .../LVGL/src/libs/thorvg/thorvg_lottie.h | 100 - .../LVGL/src/libs/thorvg/tvgAccessor.cpp | 91 - .../LVGL/src/libs/thorvg/tvgAnimation.cpp | 132 - .../LVGL/src/libs/thorvg/tvgAnimation.h | 54 - .../LVGL/src/libs/thorvg/tvgArray.h | 209 - .../LVGL/src/libs/thorvg/tvgBinaryDesc.h | 106 - .../LVGL/src/libs/thorvg/tvgCanvas.cpp | 99 - .../LVGL/src/libs/thorvg/tvgCanvas.h | 165 - .../LVGL/src/libs/thorvg/tvgCapi.cpp | 871 - .../LVGL/src/libs/thorvg/tvgCommon.h | 96 - .../LVGL/src/libs/thorvg/tvgCompressor.cpp | 481 - .../LVGL/src/libs/thorvg/tvgCompressor.h | 41 - .../LVGL/src/libs/thorvg/tvgFill.cpp | 256 - L3_Middlewares/LVGL/src/libs/thorvg/tvgFill.h | 118 - .../LVGL/src/libs/thorvg/tvgFrameModule.h | 68 - .../LVGL/src/libs/thorvg/tvgGlCanvas.cpp | 96 - .../LVGL/src/libs/thorvg/tvgInitializer.cpp | 185 - .../LVGL/src/libs/thorvg/tvgInlist.h | 117 - .../src/libs/thorvg/tvgIteratorAccessor.h | 49 - .../LVGL/src/libs/thorvg/tvgLines.cpp | 249 - .../LVGL/src/libs/thorvg/tvgLines.h | 66 - .../LVGL/src/libs/thorvg/tvgLoadModule.h | 113 - .../LVGL/src/libs/thorvg/tvgLoader.cpp | 441 - .../LVGL/src/libs/thorvg/tvgLoader.h | 46 - L3_Middlewares/LVGL/src/libs/thorvg/tvgLock.h | 77 - .../src/libs/thorvg/tvgLottieAnimation.cpp | 98 - .../LVGL/src/libs/thorvg/tvgLottieBuilder.cpp | 1378 - .../LVGL/src/libs/thorvg/tvgLottieBuilder.h | 54 - .../src/libs/thorvg/tvgLottieExpressions.cpp | 1298 - .../src/libs/thorvg/tvgLottieExpressions.h | 171 - .../src/libs/thorvg/tvgLottieInterpolator.cpp | 146 - .../src/libs/thorvg/tvgLottieInterpolator.h | 51 - .../LVGL/src/libs/thorvg/tvgLottieLoader.cpp | 407 - .../LVGL/src/libs/thorvg/tvgLottieLoader.h | 86 - .../LVGL/src/libs/thorvg/tvgLottieModel.cpp | 424 - .../LVGL/src/libs/thorvg/tvgLottieModel.h | 685 - .../LVGL/src/libs/thorvg/tvgLottieParser.cpp | 1405 -- .../LVGL/src/libs/thorvg/tvgLottieParser.h | 124 - .../libs/thorvg/tvgLottieParserHandler.cpp | 241 - .../src/libs/thorvg/tvgLottieParserHandler.h | 206 - .../LVGL/src/libs/thorvg/tvgLottieProperty.h | 935 - .../LVGL/src/libs/thorvg/tvgMath.cpp | 108 - L3_Middlewares/LVGL/src/libs/thorvg/tvgMath.h | 228 - .../LVGL/src/libs/thorvg/tvgPaint.cpp | 481 - .../LVGL/src/libs/thorvg/tvgPaint.h | 152 - .../LVGL/src/libs/thorvg/tvgPicture.cpp | 238 - .../LVGL/src/libs/thorvg/tvgPicture.h | 250 - .../LVGL/src/libs/thorvg/tvgRawLoader.cpp | 88 - .../LVGL/src/libs/thorvg/tvgRawLoader.h | 46 - .../LVGL/src/libs/thorvg/tvgRender.cpp | 100 - .../LVGL/src/libs/thorvg/tvgRender.h | 356 - .../LVGL/src/libs/thorvg/tvgSaveModule.h | 49 - .../LVGL/src/libs/thorvg/tvgSaver.cpp | 209 - .../LVGL/src/libs/thorvg/tvgScene.cpp | 87 - .../LVGL/src/libs/thorvg/tvgScene.h | 235 - .../LVGL/src/libs/thorvg/tvgShape.cpp | 411 - .../LVGL/src/libs/thorvg/tvgShape.h | 407 - .../LVGL/src/libs/thorvg/tvgStr.cpp | 248 - L3_Middlewares/LVGL/src/libs/thorvg/tvgStr.h | 43 - .../LVGL/src/libs/thorvg/tvgSvgCssStyle.cpp | 271 - .../LVGL/src/libs/thorvg/tvgSvgCssStyle.h | 40 - .../LVGL/src/libs/thorvg/tvgSvgLoader.cpp | 3917 --- .../LVGL/src/libs/thorvg/tvgSvgLoader.h | 74 - .../LVGL/src/libs/thorvg/tvgSvgLoaderCommon.h | 577 - .../LVGL/src/libs/thorvg/tvgSvgPath.cpp | 577 - .../LVGL/src/libs/thorvg/tvgSvgPath.h | 36 - .../src/libs/thorvg/tvgSvgSceneBuilder.cpp | 888 - .../LVGL/src/libs/thorvg/tvgSvgSceneBuilder.h | 36 - .../LVGL/src/libs/thorvg/tvgSvgUtil.cpp | 76 - .../LVGL/src/libs/thorvg/tvgSvgUtil.h | 36 - .../LVGL/src/libs/thorvg/tvgSwCanvas.cpp | 118 - .../LVGL/src/libs/thorvg/tvgSwCommon.h | 593 - .../LVGL/src/libs/thorvg/tvgSwFill.cpp | 790 - .../LVGL/src/libs/thorvg/tvgSwImage.cpp | 164 - .../LVGL/src/libs/thorvg/tvgSwMath.cpp | 329 - .../LVGL/src/libs/thorvg/tvgSwMemPool.cpp | 135 - .../LVGL/src/libs/thorvg/tvgSwRaster.cpp | 1967 -- .../LVGL/src/libs/thorvg/tvgSwRasterAvx.h | 214 - .../LVGL/src/libs/thorvg/tvgSwRasterC.h | 169 - .../LVGL/src/libs/thorvg/tvgSwRasterNeon.h | 184 - .../LVGL/src/libs/thorvg/tvgSwRasterTexmap.h | 1214 - .../LVGL/src/libs/thorvg/tvgSwRenderer.cpp | 859 - .../LVGL/src/libs/thorvg/tvgSwRenderer.h | 91 - .../LVGL/src/libs/thorvg/tvgSwRle.cpp | 1134 - .../LVGL/src/libs/thorvg/tvgSwShape.cpp | 675 - .../LVGL/src/libs/thorvg/tvgSwStroke.cpp | 913 - .../LVGL/src/libs/thorvg/tvgTaskScheduler.cpp | 235 - .../LVGL/src/libs/thorvg/tvgTaskScheduler.h | 117 - .../LVGL/src/libs/thorvg/tvgText.cpp | 115 - L3_Middlewares/LVGL/src/libs/thorvg/tvgText.h | 189 - .../LVGL/src/libs/thorvg/tvgWgCanvas.cpp | 89 - .../LVGL/src/libs/thorvg/tvgXmlParser.cpp | 595 - .../LVGL/src/libs/thorvg/tvgXmlParser.h | 64 - .../LVGL/src/libs/tiny_ttf/lv_tiny_ttf.c | 558 - .../LVGL/src/libs/tiny_ttf/lv_tiny_ttf.h | 98 - L3_Middlewares/LVGL/src/libs/tjpgd/lv_tjpgd.c | 301 - L3_Middlewares/LVGL/src/libs/tjpgd/lv_tjpgd.h | 45 - L3_Middlewares/LVGL/src/libs/tjpgd/tjpgd.c | 1139 - L3_Middlewares/LVGL/src/libs/tjpgd/tjpgd.h | 108 - L3_Middlewares/LVGL/src/lv_api_map.h | 88 + L3_Middlewares/LVGL/src/lv_api_map_v8.h | 328 - L3_Middlewares/LVGL/src/lv_api_map_v9_0.h | 66 - L3_Middlewares/LVGL/src/lv_api_map_v9_1.h | 98 - L3_Middlewares/LVGL/src/lv_conf_internal.h | 2894 +-- L3_Middlewares/LVGL/src/lv_conf_kconfig.h | 94 +- L3_Middlewares/LVGL/src/lv_init.c | 444 - L3_Middlewares/LVGL/src/lv_init.h | 55 - L3_Middlewares/LVGL/src/lvgl.h | 4 +- L3_Middlewares/LVGL/src/lvgl_private.h | 125 - L3_Middlewares/LVGL/src/misc/cache/lv_cache.c | 348 - L3_Middlewares/LVGL/src/misc/cache/lv_cache.h | 230 - .../LVGL/src/misc/cache/lv_cache_entry.c | 167 - .../LVGL/src/misc/cache/lv_cache_entry.h | 114 - .../src/misc/cache/lv_cache_entry_private.h | 50 - .../LVGL/src/misc/cache/lv_cache_lru_rb.c | 462 - .../LVGL/src/misc/cache/lv_cache_lru_rb.h | 44 - .../LVGL/src/misc/cache/lv_cache_private.h | 193 - .../LVGL/src/misc/cache/lv_image_cache.c | 145 - .../LVGL/src/misc/cache/lv_image_cache.h | 71 - .../src/misc/cache/lv_image_header_cache.c | 133 - .../src/misc/cache/lv_image_header_cache.h | 72 - L3_Middlewares/LVGL/src/misc/lv_anim.c | 539 +- L3_Middlewares/LVGL/src/misc/lv_anim.h | 345 +- .../LVGL/src/misc/lv_anim_private.h | 56 - .../LVGL/src/misc/lv_anim_timeline.c | 257 +- .../LVGL/src/misc/lv_anim_timeline.h | 47 +- L3_Middlewares/LVGL/src/misc/lv_area.c | 380 +- L3_Middlewares/LVGL/src/misc/lv_area.h | 222 +- .../LVGL/src/misc/lv_area_private.h | 115 - L3_Middlewares/LVGL/src/misc/lv_array.c | 222 - L3_Middlewares/LVGL/src/misc/lv_array.h | 191 - L3_Middlewares/LVGL/src/misc/lv_assert.h | 12 +- L3_Middlewares/LVGL/src/misc/lv_async.c | 35 +- L3_Middlewares/LVGL/src/misc/lv_async.h | 4 +- L3_Middlewares/LVGL/src/misc/lv_bidi.c | 204 +- L3_Middlewares/LVGL/src/misc/lv_bidi.h | 80 +- .../LVGL/src/misc/lv_bidi_private.h | 101 - L3_Middlewares/LVGL/src/misc/lv_color.c | 406 +- L3_Middlewares/LVGL/src/misc/lv_color.h | 869 +- L3_Middlewares/LVGL/src/misc/lv_color_op.c | 74 - L3_Middlewares/LVGL/src/misc/lv_color_op.h | 82 - L3_Middlewares/LVGL/src/misc/lv_event.c | 224 - L3_Middlewares/LVGL/src/misc/lv_event.h | 215 - .../LVGL/src/misc/lv_event_private.h | 73 - L3_Middlewares/LVGL/src/misc/lv_fs.c | 489 +- L3_Middlewares/LVGL/src/misc/lv_fs.h | 77 +- L3_Middlewares/LVGL/src/misc/lv_fs_private.h | 63 - .../glfw/lv_opengles_debug.c => misc/lv_gc.c} | 29 +- L3_Middlewares/LVGL/src/misc/lv_gc.h | 97 + L3_Middlewares/LVGL/src/misc/lv_ll.c | 161 +- L3_Middlewares/LVGL/src/misc/lv_ll.h | 44 +- L3_Middlewares/LVGL/src/misc/lv_log.c | 92 +- L3_Middlewares/LVGL/src/misc/lv_log.h | 42 +- L3_Middlewares/LVGL/src/misc/lv_lru.c | 59 +- L3_Middlewares/LVGL/src/misc/lv_lru.h | 20 +- L3_Middlewares/LVGL/src/misc/lv_math.c | 407 +- L3_Middlewares/LVGL/src/misc/lv_math.h | 64 +- L3_Middlewares/LVGL/src/misc/lv_matrix.c | 225 - L3_Middlewares/LVGL/src/misc/lv_matrix.h | 129 - L3_Middlewares/LVGL/src/misc/lv_mem.c | 566 + L3_Middlewares/LVGL/src/misc/lv_mem.h | 243 + L3_Middlewares/LVGL/src/misc/lv_misc.mk | 26 + L3_Middlewares/LVGL/src/misc/lv_palette.c | 130 - L3_Middlewares/LVGL/src/misc/lv_palette.h | 68 - .../lv_sprintf_builtin.c => misc/lv_printf.c} | 27 +- L3_Middlewares/LVGL/src/misc/lv_printf.h | 98 + L3_Middlewares/LVGL/src/misc/lv_profiler.h | 52 - .../LVGL/src/misc/lv_profiler_builtin.c | 262 - .../LVGL/src/misc/lv_profiler_builtin.h | 85 - .../src/misc/lv_profiler_builtin_private.h | 56 - L3_Middlewares/LVGL/src/misc/lv_rb.c | 556 - L3_Middlewares/LVGL/src/misc/lv_rb.h | 66 - L3_Middlewares/LVGL/src/misc/lv_rb_private.h | 54 - L3_Middlewares/LVGL/src/misc/lv_style.c | 515 +- L3_Middlewares/LVGL/src/misc/lv_style.h | 497 +- L3_Middlewares/LVGL/src/misc/lv_style_gen.c | 366 +- L3_Middlewares/LVGL/src/misc/lv_style_gen.h | 358 +- L3_Middlewares/LVGL/src/misc/lv_text.h | 94 - .../LVGL/src/misc/lv_text_private.h | 273 - L3_Middlewares/LVGL/src/misc/lv_timer.c | 310 +- L3_Middlewares/LVGL/src/misc/lv_timer.h | 103 +- .../LVGL/src/misc/lv_timer_private.h | 81 - .../src/{stdlib/builtin => misc}/lv_tlsf.c | 33 +- .../src/{stdlib/builtin => misc}/lv_tlsf.h | 10 +- .../LVGL/src/misc/{lv_text.c => lv_txt.c} | 314 +- L3_Middlewares/LVGL/src/misc/lv_txt.h | 264 + .../src/misc/{lv_text_ap.c => lv_txt_ap.c} | 66 +- .../src/misc/{lv_text_ap.h => lv_txt_ap.h} | 16 +- L3_Middlewares/LVGL/src/misc/lv_types.h | 303 +- L3_Middlewares/LVGL/src/misc/lv_utils.c | 58 +- L3_Middlewares/LVGL/src/misc/lv_utils.h | 22 +- L3_Middlewares/LVGL/src/osal/lv_cmsis_rtos2.c | 195 - L3_Middlewares/LVGL/src/osal/lv_cmsis_rtos2.h | 53 - L3_Middlewares/LVGL/src/osal/lv_freertos.c | 563 - L3_Middlewares/LVGL/src/osal/lv_freertos.h | 105 - L3_Middlewares/LVGL/src/osal/lv_mqx.c | 169 - L3_Middlewares/LVGL/src/osal/lv_mqx.h | 51 - L3_Middlewares/LVGL/src/osal/lv_os.c | 71 - L3_Middlewares/LVGL/src/osal/lv_os.h | 186 - L3_Middlewares/LVGL/src/osal/lv_os_none.c | 127 - L3_Middlewares/LVGL/src/osal/lv_os_none.h | 43 - L3_Middlewares/LVGL/src/osal/lv_pthread.c | 178 - L3_Middlewares/LVGL/src/osal/lv_pthread.h | 57 - L3_Middlewares/LVGL/src/osal/lv_rtthread.c | 190 - L3_Middlewares/LVGL/src/osal/lv_rtthread.h | 54 - L3_Middlewares/LVGL/src/osal/lv_windows.c | 222 - L3_Middlewares/LVGL/src/osal/lv_windows.h | 54 - .../others/file_explorer/lv_file_explorer.c | 707 - .../others/file_explorer/lv_file_explorer.h | 168 - .../file_explorer/lv_file_explorer_private.h | 69 - .../src/others/fragment/lv_fragment_private.h | 77 - .../src/others/ime/lv_ime_pinyin_private.h | 68 - .../src/others/monkey/lv_monkey_private.h | 43 - .../LVGL/src/others/observer/lv_observer.c | 725 - .../LVGL/src/others/observer/lv_observer.h | 406 - .../src/others/observer/lv_observer_private.h | 57 - .../LVGL/src/others/snapshot/lv_snapshot.c | 178 - .../LVGL/src/others/snapshot/lv_snapshot.h | 101 - .../LVGL/src/others/sysmon/lv_sysmon.c | 335 - .../LVGL/src/others/sysmon/lv_sysmon.h | 91 - .../src/others/sysmon/lv_sysmon_private.h | 91 - .../LVGL/src/others/vg_lite_tvg/vg_lite.h | 1387 -- .../src/others/vg_lite_tvg/vg_lite_matrix.c | 162 - .../src/others/vg_lite_tvg/vg_lite_tvg.cpp | 2767 -- .../src/stdlib/builtin/lv_mem_core_builtin.c | 273 - .../src/stdlib/builtin/lv_string_builtin.c | 269 - .../LVGL/src/stdlib/builtin/lv_tlsf_private.h | 53 - .../LVGL/src/stdlib/clib/lv_mem_core_clib.c | 94 - .../LVGL/src/stdlib/clib/lv_sprintf_clib.c | 58 - .../LVGL/src/stdlib/clib/lv_string_clib.c | 114 - L3_Middlewares/LVGL/src/stdlib/lv_mem.c | 168 - L3_Middlewares/LVGL/src/stdlib/lv_mem.h | 141 - .../LVGL/src/stdlib/lv_mem_private.h | 39 - L3_Middlewares/LVGL/src/stdlib/lv_sprintf.h | 45 - L3_Middlewares/LVGL/src/stdlib/lv_string.h | 158 - .../micropython/lv_mem_core_micropython.c | 110 - .../stdlib/rtthread/lv_mem_core_rtthread.c | 98 - .../src/stdlib/rtthread/lv_sprintf_rtthread.c | 61 - .../src/stdlib/rtthread/lv_string_rtthread.c | 123 - .../src/themes/default/lv_theme_default.c | 1228 - .../LVGL/src/themes/lv_theme_private.h | 53 - .../LVGL/src/themes/mono/lv_theme_mono.c | 532 - .../LVGL/src/themes/simple/lv_theme_simple.c | 438 - L3_Middlewares/LVGL/src/tick/lv_tick.h | 85 - .../LVGL/src/tick/lv_tick_private.h | 46 - .../LVGL/src/widgets/animimage/lv_animimage.h | 129 - .../widgets/animimage/lv_animimage_private.h | 55 - L3_Middlewares/LVGL/src/widgets/arc/lv_arc.h | 247 - .../LVGL/src/widgets/arc/lv_arc_private.h | 64 - .../LVGL/src/widgets/bar/lv_bar_private.h | 66 - .../src/widgets/button/lv_button_private.h | 53 - .../widgets/buttonmatrix/lv_buttonmatrix.h | 202 - .../buttonmatrix/lv_buttonmatrix_private.h | 57 - .../widgets/calendar/lv_calendar_chinese.c | 285 - .../widgets/calendar/lv_calendar_chinese.h | 68 - .../calendar/lv_calendar_chinese_private.h | 53 - .../widgets/calendar/lv_calendar_private.h | 70 - .../LVGL/src/widgets/canvas/lv_canvas.c | 435 - .../LVGL/src/widgets/canvas/lv_canvas.h | 185 - .../src/widgets/canvas/lv_canvas_private.h | 52 - .../LVGL/src/widgets/chart/lv_chart.c | 1360 - .../LVGL/src/widgets/chart/lv_chart_private.h | 85 - .../widgets/checkbox/lv_checkbox_private.h | 55 - .../widgets/dropdown/lv_dropdown_private.h | 69 - .../LVGL/src/widgets/image/lv_image.c | 885 - .../LVGL/src/widgets/image/lv_image.h | 310 - .../LVGL/src/widgets/image/lv_image_private.h | 66 - .../src/widgets/imagebutton/lv_imagebutton.c | 340 - .../src/widgets/imagebutton/lv_imagebutton.h | 121 - .../imagebutton/lv_imagebutton_private.h | 58 - .../LVGL/src/widgets/keyboard/lv_keyboard.c | 490 - .../widgets/keyboard/lv_keyboard_private.h | 53 - .../LVGL/src/widgets/label/lv_label_private.h | 73 - .../LVGL/src/widgets/led/lv_led_private.h | 52 - .../LVGL/src/widgets/line/lv_line.c | 267 - .../LVGL/src/widgets/line/lv_line_private.h | 57 - .../LVGL/src/widgets/list/lv_list.h | 85 - .../LVGL/src/widgets/lottie/lv_lottie.c | 237 - .../LVGL/src/widgets/lottie/lv_lottie.h | 102 - .../src/widgets/lottie/lv_lottie_private.h | 60 - .../LVGL/src/widgets/{arc => }/lv_arc.c | 525 +- L3_Middlewares/LVGL/src/widgets/lv_arc.h | 257 + .../LVGL/src/widgets/{bar => }/lv_bar.c | 465 +- .../LVGL/src/widgets/{bar => }/lv_bar.h | 86 +- .../widgets/{button/lv_button.c => lv_btn.c} | 26 +- .../widgets/{button/lv_button.h => lv_btn.h} | 28 +- .../lv_buttonmatrix.c => lv_btnmatrix.c} | 591 +- .../LVGL/src/widgets/lv_btnmatrix.h | 226 + L3_Middlewares/LVGL/src/widgets/lv_canvas.c | 836 + L3_Middlewares/LVGL/src/widgets/lv_canvas.h | 280 + .../src/widgets/{checkbox => }/lv_checkbox.c | 165 +- .../src/widgets/{checkbox => }/lv_checkbox.h | 32 +- .../src/widgets/{dropdown => }/lv_dropdown.c | 429 +- .../src/widgets/{dropdown => }/lv_dropdown.h | 54 +- L3_Middlewares/LVGL/src/widgets/lv_img.c | 692 + L3_Middlewares/LVGL/src/widgets/lv_img.h | 234 + .../LVGL/src/widgets/{label => }/lv_label.c | 713 +- .../LVGL/src/widgets/{label => }/lv_label.h | 101 +- L3_Middlewares/LVGL/src/widgets/lv_line.c | 201 + .../LVGL/src/widgets/{line => }/lv_line.h | 53 +- .../widgets/{objx_templ => }/lv_objx_templ.c | 11 +- .../widgets/{objx_templ => }/lv_objx_templ.h | 2 +- .../LVGL/src/widgets/{roller => }/lv_roller.c | 488 +- .../LVGL/src/widgets/{roller => }/lv_roller.h | 47 +- L3_Middlewares/LVGL/src/widgets/lv_slider.c | 447 + .../LVGL/src/widgets/{slider => }/lv_slider.h | 88 +- .../LVGL/src/widgets/{switch => }/lv_switch.c | 101 +- .../LVGL/src/widgets/{switch => }/lv_switch.h | 21 +- .../LVGL/src/widgets/{table => }/lv_table.c | 427 +- .../LVGL/src/widgets/{table => }/lv_table.h | 88 +- .../src/widgets/{textarea => }/lv_textarea.c | 434 +- .../src/widgets/{textarea => }/lv_textarea.h | 77 +- L3_Middlewares/LVGL/src/widgets/lv_widgets.mk | 20 + .../LVGL/src/widgets/menu/lv_menu.h | 213 - .../LVGL/src/widgets/menu/lv_menu_private.h | 84 - .../LVGL/src/widgets/msgbox/lv_msgbox.c | 294 - .../LVGL/src/widgets/msgbox/lv_msgbox.h | 141 - .../src/widgets/msgbox/lv_msgbox_private.h | 57 - .../widgets/property/lv_dropdown_properties.c | 31 - .../widgets/property/lv_image_properties.c | 33 - .../widgets/property/lv_keyboard_properties.c | 26 - .../widgets/property/lv_label_properties.c | 26 - .../src/widgets/property/lv_obj_properties.c | 93 - .../widgets/property/lv_obj_property_names.h | 22 - .../widgets/property/lv_roller_properties.c | 25 - .../widgets/property/lv_style_properties.c | 132 - .../widgets/property/lv_style_properties.h | 130 - .../widgets/property/lv_textarea_properties.c | 37 - .../src/widgets/roller/lv_roller_private.h | 55 - .../LVGL/src/widgets/scale/lv_scale.c | 1504 -- .../LVGL/src/widgets/scale/lv_scale.h | 258 - .../LVGL/src/widgets/scale/lv_scale_private.h | 82 - .../LVGL/src/widgets/slider/lv_slider.c | 556 - .../src/widgets/slider/lv_slider_private.h | 55 - .../LVGL/src/widgets/span/lv_span.h | 237 - .../LVGL/src/widgets/span/lv_span_private.h | 65 - .../src/widgets/spinbox/lv_spinbox_private.h | 59 - .../src/widgets/switch/lv_switch_private.h | 54 - .../LVGL/src/widgets/table/lv_table_private.h | 64 - .../LVGL/src/widgets/tabview/lv_tabview.c | 357 - .../LVGL/src/widgets/tabview/lv_tabview.h | 115 - .../src/widgets/tabview/lv_tabview_private.h | 55 - .../widgets/textarea/lv_textarea_private.h | 75 - .../widgets/tileview/lv_tileview_private.h | 58 - .../LVGL/src/widgets/win/lv_win_private.h | 52 - gcc_build.sh | 4 +- starm_clang_build.sh | 1 - 955 files changed, 75139 insertions(+), 219515 deletions(-) create mode 100644 L3_Middlewares/LVGL/doc/README.md create mode 100644 L3_Middlewares/LVGL/doc/README_pt_BR.md create mode 100644 L3_Middlewares/LVGL/doc/README_zh.md delete mode 100644 L3_Middlewares/LVGL/env_support/cmake/version.cmake delete mode 100644 L3_Middlewares/LVGL/lv_version.h delete mode 100644 L3_Middlewares/LVGL/lv_version.h.in create mode 100644 L3_Middlewares/LVGL/src/core/lv_core.mk create mode 100644 L3_Middlewares/LVGL/src/core/lv_disp.c create mode 100644 L3_Middlewares/LVGL/src/core/lv_disp.h create mode 100644 L3_Middlewares/LVGL/src/core/lv_event.c create mode 100644 L3_Middlewares/LVGL/src/core/lv_event.h delete mode 100644 L3_Middlewares/LVGL/src/core/lv_global.h delete mode 100644 L3_Middlewares/LVGL/src/core/lv_group_private.h create mode 100644 L3_Middlewares/LVGL/src/core/lv_indev.c create mode 100644 L3_Middlewares/LVGL/src/core/lv_indev.h create mode 100644 L3_Middlewares/LVGL/src/core/lv_indev_scroll.c rename L3_Middlewares/LVGL/src/{indev => core}/lv_indev_scroll.h (78%) delete mode 100644 L3_Middlewares/LVGL/src/core/lv_obj_class_private.h delete mode 100644 L3_Middlewares/LVGL/src/core/lv_obj_draw_private.h delete mode 100644 L3_Middlewares/LVGL/src/core/lv_obj_event.c delete mode 100644 L3_Middlewares/LVGL/src/core/lv_obj_event.h delete mode 100644 L3_Middlewares/LVGL/src/core/lv_obj_event_private.h delete mode 100644 L3_Middlewares/LVGL/src/core/lv_obj_id_builtin.c delete mode 100644 L3_Middlewares/LVGL/src/core/lv_obj_private.h delete mode 100644 L3_Middlewares/LVGL/src/core/lv_obj_property.c delete mode 100644 L3_Middlewares/LVGL/src/core/lv_obj_property.h delete mode 100644 L3_Middlewares/LVGL/src/core/lv_obj_scroll_private.h delete mode 100644 L3_Middlewares/LVGL/src/core/lv_obj_style_private.h delete mode 100644 L3_Middlewares/LVGL/src/core/lv_refr_private.h rename L3_Middlewares/LVGL/src/{themes => core}/lv_theme.c (69%) rename L3_Middlewares/LVGL/src/{themes => core}/lv_theme.h (80%) delete mode 100644 L3_Middlewares/LVGL/src/display/lv_display.c delete mode 100644 L3_Middlewares/LVGL/src/display/lv_display.h delete mode 100644 L3_Middlewares/LVGL/src/display/lv_display_private.h create mode 100644 L3_Middlewares/LVGL/src/draw/arm2d/lv_draw_arm2d.mk create mode 100644 L3_Middlewares/LVGL/src/draw/arm2d/lv_gpu_arm2d.c create mode 100644 L3_Middlewares/LVGL/src/draw/arm2d/lv_gpu_arm2d.h create mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw.mk delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_buf.c delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_buf.h delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_buf_private.h delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_image.c delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_image.h delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_image_private.h create mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_img.c create mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_img.h delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_label_private.h create mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_layer.c create mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_layer.h delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_mask_private.h delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_private.h create mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_transform.c create mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_transform.h delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_vector.c delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_vector.h delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_draw_vector_private.h delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_image_decoder.c delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_image_decoder.h delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_image_decoder_private.h delete mode 100644 L3_Middlewares/LVGL/src/draw/lv_image_dsc.h create mode 100644 L3_Middlewares/LVGL/src/draw/lv_img_buf.c create mode 100644 L3_Middlewares/LVGL/src/draw/lv_img_buf.h create mode 100644 L3_Middlewares/LVGL/src/draw/lv_img_cache.c create mode 100644 L3_Middlewares/LVGL/src/draw/lv_img_cache.h create mode 100644 L3_Middlewares/LVGL/src/draw/lv_img_decoder.c create mode 100644 L3_Middlewares/LVGL/src/draw/lv_img_decoder.h create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/lv_draw_nxp.mk delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_buf_pxp.c create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_nxp_pxp.mk create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_blend.c create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_blend.h delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_fill.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_img.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_layer.c create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp.c create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp.h create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.h delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_cfg.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_cfg.h delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_osa.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_osa.h delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_utils.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_utils.h delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_buf_vglite.c create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_nxp_vglite.mk create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_arc.h create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_blend.c create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_blend.h delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_border.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_fill.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_img.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_label.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_layer.c create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_line.h create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_rect.c create mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_rect.h delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_triangle.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_matrix.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_matrix.h delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_path.c delete mode 100644 L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_path.h delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d.c delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d.h delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_arc.c delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_border.c delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_fill.c delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_image.c delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_label.c delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_line.c delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_mask_rectangle.c delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_triangle.c delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_utils.c delete mode 100644 L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_utils.h create mode 100644 L3_Middlewares/LVGL/src/draw/renesas/lv_draw_renesas.mk create mode 100644 L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_draw_label.c create mode 100644 L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_ra6m3.c create mode 100644 L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_ra6m3.h create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/README.md create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.mk create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_arc.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_bg.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_composite.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_composite.h create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_img.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_img.h create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_label.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_layer.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_layer.h create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_line.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_mask.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_mask.h create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_polygon.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_priv.h create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_rect.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_rect.h create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_stack_blur.c rename L3_Middlewares/LVGL/src/{drivers/nuttx/lv_nuttx_image_cache.h => draw/sdl/lv_draw_sdl_stack_blur.h} (61%) create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_texture_cache.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_texture_cache.h create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_utils.c create mode 100644 L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_utils.h create mode 100644 L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_draw_stm32_dma2d.mk create mode 100644 L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.c create mode 100644 L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/arm2d/lv_draw_sw_arm2d.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/arm2d/lv_draw_sw_helium.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/arm2d/lv_blend_arm2d.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/helium/lv_blend_helium.S delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/helium/lv_blend_helium.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_private.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_al88.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_al88.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_i1.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_i1.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_l8.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_l8.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/neon/lv_blend_neon.S delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/blend/neon/lv_blend_neon.h create mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.mk create mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_blend.c create mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_blend.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_border.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_box_shadow.c create mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_dither.c create mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_dither.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_fill.c create mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_layer.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask_private.h delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask_rect.c create mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_polygon.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_private.h create mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_rect.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_triangle.c delete mode 100644 L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_vector.c create mode 100644 L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_draw_swm341_dma2d.mk create mode 100644 L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_gpu_swm341_dma2d.c create mode 100644 L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_gpu_swm341_dma2d.h delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_buf_vg_lite.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite.h delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_arc.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_border.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_box_shadow.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_fill.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_img.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_label.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_layer.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_line.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_mask_rect.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_triangle.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_type.h delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_vector.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_decoder.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_decoder.h delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_grad.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_grad.h delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_math.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_math.h delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_path.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_path.h delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_pending.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_pending.h delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_stroke.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_stroke.h delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_utils.c delete mode 100644 L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_utils.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/README.md delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/drm/lv_linux_drm.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/drm/lv_linux_drm.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/fb/lv_linux_fbdev.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/fb/lv_linux_fbdev.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/ili9341/lv_ili9341.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/ili9341/lv_ili9341.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/lcd/lv_lcd_generic_mipi.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/lcd/lv_lcd_generic_mipi.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/renesas_glcdc/lv_renesas_glcdc.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/renesas_glcdc/lv_renesas_glcdc.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/st7735/lv_st7735.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/st7735/lv_st7735.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/st7789/lv_st7789.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/st7789/lv_st7789.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/st7796/lv_st7796.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/st7796/lv_st7796.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/tft_espi/lv_tft_espi.cpp delete mode 100644 L3_Middlewares/LVGL/src/drivers/display/tft_espi/lv_tft_espi.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/evdev/lv_evdev.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/evdev/lv_evdev.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window_private.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_debug.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_driver.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_driver.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_texture.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_texture.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput_private.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb_private.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/lv_drivers.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_cache.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_entry.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_entry.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_fbdev.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_fbdev.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_image_cache.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_lcd.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_lcd.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_libuv.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_libuv.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_profiler.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_profiler.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_touchscreen.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_touchscreen.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/qnx/lv_qnx.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/qnx/lv_qnx.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_keyboard.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_keyboard.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mouse.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mouse.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mousewheel.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mousewheel.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_private.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_window.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_window.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland_smm.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland_smm.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/windows/lv_windows_context.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/windows/lv_windows_context.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/windows/lv_windows_display.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/windows/lv_windows_display.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input_private.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/x11/lv_x11.h delete mode 100644 L3_Middlewares/LVGL/src/drivers/x11/lv_x11_display.c delete mode 100644 L3_Middlewares/LVGL/src/drivers/x11/lv_x11_input.c create mode 100644 L3_Middlewares/LVGL/src/extra/README.md rename L3_Middlewares/LVGL/src/{ => extra}/layouts/flex/lv_flex.c (60%) create mode 100644 L3_Middlewares/LVGL/src/extra/layouts/flex/lv_flex.h create mode 100644 L3_Middlewares/LVGL/src/extra/layouts/grid/lv_grid.c create mode 100644 L3_Middlewares/LVGL/src/extra/layouts/grid/lv_grid.h rename L3_Middlewares/LVGL/src/{draw/lv_draw_rect_private.h => extra/layouts/lv_layouts.h} (60%) create mode 100644 L3_Middlewares/LVGL/src/extra/libs/bmp/lv_bmp.c rename L3_Middlewares/LVGL/src/{ => extra}/libs/bmp/lv_bmp.h (90%) rename L3_Middlewares/LVGL/src/{ => extra}/libs/ffmpeg/lv_ffmpeg.c (82%) rename L3_Middlewares/LVGL/src/{ => extra}/libs/ffmpeg/lv_ffmpeg.h (81%) rename L3_Middlewares/LVGL/src/{ => extra}/libs/freetype/arial.ttf (100%) create mode 100644 L3_Middlewares/LVGL/src/extra/libs/freetype/lv_freetype.c create mode 100644 L3_Middlewares/LVGL/src/extra/libs/freetype/lv_freetype.h rename L3_Middlewares/LVGL/src/{ => extra}/libs/fsdrv/lv_fs_fatfs.c (62%) create mode 100644 L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_littlefs.c create mode 100644 L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_posix.c rename L3_Middlewares/LVGL/src/{ => extra}/libs/fsdrv/lv_fs_stdio.c (62%) rename L3_Middlewares/LVGL/src/{ => extra}/libs/fsdrv/lv_fs_win32.c (77%) rename L3_Middlewares/LVGL/src/{ => extra}/libs/fsdrv/lv_fsdrv.h (63%) rename L3_Middlewares/LVGL/src/{ => extra}/libs/gif/gifdec.c (50%) create mode 100644 L3_Middlewares/LVGL/src/extra/libs/gif/gifdec.h rename L3_Middlewares/LVGL/src/{ => extra}/libs/gif/lv_gif.c (54%) rename L3_Middlewares/LVGL/src/{libs/gif/lv_gif_private.h => extra/libs/gif/lv_gif.h} (54%) rename L3_Middlewares/LVGL/src/{draw/sw/lv_draw_sw_gradient_private.h => extra/libs/lv_libs.h} (54%) create mode 100644 L3_Middlewares/LVGL/src/extra/libs/png/lodepng.c rename L3_Middlewares/LVGL/src/{libs/lodepng => extra/libs/png}/lodepng.h (61%) create mode 100644 L3_Middlewares/LVGL/src/extra/libs/png/lv_png.c rename L3_Middlewares/LVGL/src/{libs/libpng/lv_libpng.h => extra/libs/png/lv_png.h} (68%) create mode 100644 L3_Middlewares/LVGL/src/extra/libs/qrcode/lv_qrcode.c create mode 100644 L3_Middlewares/LVGL/src/extra/libs/qrcode/lv_qrcode.h create mode 100644 L3_Middlewares/LVGL/src/extra/libs/qrcode/qrcodegen.c rename L3_Middlewares/LVGL/src/{ => extra}/libs/qrcode/qrcodegen.h (82%) rename L3_Middlewares/LVGL/src/{ => extra}/libs/rlottie/lv_rlottie.c (58%) rename L3_Middlewares/LVGL/src/{ => extra}/libs/rlottie/lv_rlottie.h (59%) create mode 100644 L3_Middlewares/LVGL/src/extra/libs/sjpg/lv_sjpg.c rename L3_Middlewares/LVGL/src/{misc/lv_style_private.h => extra/libs/sjpg/lv_sjpg.h} (72%) create mode 100644 L3_Middlewares/LVGL/src/extra/libs/sjpg/tjpgd.c create mode 100644 L3_Middlewares/LVGL/src/extra/libs/sjpg/tjpgd.h rename L3_Middlewares/LVGL/src/{libs/tjpgd => extra/libs/sjpg}/tjpgdcnf.h (84%) create mode 100644 L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/lv_tiny_ttf.c create mode 100644 L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/lv_tiny_ttf.h rename L3_Middlewares/LVGL/src/{ => extra}/libs/tiny_ttf/stb_rect_pack.h (99%) rename L3_Middlewares/LVGL/src/{ => extra}/libs/tiny_ttf/stb_truetype_htcw.h (99%) create mode 100644 L3_Middlewares/LVGL/src/extra/lv_extra.c rename L3_Middlewares/LVGL/src/{osal/lv_os_private.h => extra/lv_extra.h} (60%) create mode 100644 L3_Middlewares/LVGL/src/extra/lv_extra.mk rename L3_Middlewares/LVGL/src/{ => extra}/others/fragment/README.md (100%) rename L3_Middlewares/LVGL/src/{ => extra}/others/fragment/lv_fragment.c (77%) rename L3_Middlewares/LVGL/src/{ => extra}/others/fragment/lv_fragment.h (85%) rename L3_Middlewares/LVGL/src/{ => extra}/others/fragment/lv_fragment_manager.c (73%) rename L3_Middlewares/LVGL/src/{ => extra}/others/gridnav/lv_gridnav.c (74%) rename L3_Middlewares/LVGL/src/{ => extra}/others/gridnav/lv_gridnav.h (72%) rename L3_Middlewares/LVGL/src/{ => extra}/others/ime/lv_ime_pinyin.c (73%) rename L3_Middlewares/LVGL/src/{ => extra}/others/ime/lv_ime_pinyin.h (67%) rename L3_Middlewares/LVGL/src/{ => extra}/others/imgfont/lv_imgfont.c (55%) rename L3_Middlewares/LVGL/src/{ => extra}/others/imgfont/lv_imgfont.h (68%) rename L3_Middlewares/LVGL/src/{draw/lv_draw_triangle_private.h => extra/others/lv_others.h} (58%) rename L3_Middlewares/LVGL/src/{ => extra}/others/monkey/lv_monkey.c (76%) rename L3_Middlewares/LVGL/src/{ => extra}/others/monkey/lv_monkey.h (90%) create mode 100644 L3_Middlewares/LVGL/src/extra/others/msg/lv_msg.c create mode 100644 L3_Middlewares/LVGL/src/extra/others/msg/lv_msg.h create mode 100644 L3_Middlewares/LVGL/src/extra/others/snapshot/lv_snapshot.c create mode 100644 L3_Middlewares/LVGL/src/extra/others/snapshot/lv_snapshot.h create mode 100644 L3_Middlewares/LVGL/src/extra/themes/basic/lv_theme_basic.c rename L3_Middlewares/LVGL/src/{themes/simple/lv_theme_simple.h => extra/themes/basic/lv_theme_basic.h} (57%) create mode 100644 L3_Middlewares/LVGL/src/extra/themes/default/lv_theme_default.c rename L3_Middlewares/LVGL/src/{ => extra}/themes/default/lv_theme_default.h (81%) rename L3_Middlewares/LVGL/src/{misc/lv_color_op_private.h => extra/themes/lv_themes.h} (69%) create mode 100644 L3_Middlewares/LVGL/src/extra/themes/mono/lv_theme_mono.c rename L3_Middlewares/LVGL/src/{ => extra}/themes/mono/lv_theme_mono.h (69%) rename L3_Middlewares/LVGL/src/{widgets/animimage/lv_animimage.c => extra/widgets/animimg/lv_animimg.c} (56%) create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/animimg/lv_animimg.h rename L3_Middlewares/LVGL/src/{ => extra}/widgets/calendar/lv_calendar.c (54%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/calendar/lv_calendar.h (64%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/calendar/lv_calendar_header_arrow.c (71%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/calendar/lv_calendar_header_arrow.h (83%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/calendar/lv_calendar_header_dropdown.c (64%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/calendar/lv_calendar_header_dropdown.h (52%) create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/chart/lv_chart.c rename L3_Middlewares/LVGL/src/{ => extra}/widgets/chart/lv_chart.h (65%) create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/colorwheel/lv_colorwheel.c create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/colorwheel/lv_colorwheel.h create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/imgbtn/lv_imgbtn.c create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/imgbtn/lv_imgbtn.h create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/keyboard/lv_keyboard.c rename L3_Middlewares/LVGL/src/{ => extra}/widgets/keyboard/lv_keyboard.h (51%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/led/lv_led.c (77%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/led/lv_led.h (58%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/list/lv_list.c (53%) create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/list/lv_list.h create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/lv_widgets.h rename L3_Middlewares/LVGL/src/{ => extra}/widgets/menu/lv_menu.c (75%) create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/menu/lv_menu.h create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/meter/lv_meter.c create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/meter/lv_meter.h create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/msgbox/lv_msgbox.c create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/msgbox/lv_msgbox.h rename L3_Middlewares/LVGL/src/{ => extra}/widgets/span/lv_span.c (66%) create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/span/lv_span.h rename L3_Middlewares/LVGL/src/{ => extra}/widgets/spinbox/lv_spinbox.c (56%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/spinbox/lv_spinbox.h (53%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/spinner/lv_spinner.c (64%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/spinner/lv_spinner.h (53%) create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/tabview/lv_tabview.c create mode 100644 L3_Middlewares/LVGL/src/extra/widgets/tabview/lv_tabview.h rename L3_Middlewares/LVGL/src/{ => extra}/widgets/tileview/lv_tileview.c (57%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/tileview/lv_tileview.h (59%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/win/lv_win.c (79%) rename L3_Middlewares/LVGL/src/{ => extra}/widgets/win/lv_win.h (63%) create mode 100644 L3_Middlewares/LVGL/src/font/korean.ttf delete mode 100644 L3_Middlewares/LVGL/src/font/lv_binfont_loader.h create mode 100644 L3_Middlewares/LVGL/src/font/lv_font.mk delete mode 100644 L3_Middlewares/LVGL/src/font/lv_font_fmt_txt_private.h rename L3_Middlewares/LVGL/src/font/{lv_binfont_loader.c => lv_font_loader.c} (74%) rename L3_Middlewares/LVGL/src/{drivers/nuttx/lv_nuttx_cache.h => font/lv_font_loader.h} (69%) create mode 100644 L3_Middlewares/LVGL/src/font/lv_font_montserrat_12_subpx.c delete mode 100644 L3_Middlewares/LVGL/src/font/lv_font_simsun_14_cjk.c create mode 100644 L3_Middlewares/LVGL/src/hal/lv_hal.h create mode 100644 L3_Middlewares/LVGL/src/hal/lv_hal.mk create mode 100644 L3_Middlewares/LVGL/src/hal/lv_hal_disp.c create mode 100644 L3_Middlewares/LVGL/src/hal/lv_hal_disp.h create mode 100644 L3_Middlewares/LVGL/src/hal/lv_hal_indev.c create mode 100644 L3_Middlewares/LVGL/src/hal/lv_hal_indev.h rename L3_Middlewares/LVGL/src/{tick/lv_tick.c => hal/lv_hal_tick.c} (53%) create mode 100644 L3_Middlewares/LVGL/src/hal/lv_hal_tick.h delete mode 100644 L3_Middlewares/LVGL/src/indev/lv_indev.c delete mode 100644 L3_Middlewares/LVGL/src/indev/lv_indev.h delete mode 100644 L3_Middlewares/LVGL/src/indev/lv_indev_private.h delete mode 100644 L3_Middlewares/LVGL/src/indev/lv_indev_scroll.c delete mode 100644 L3_Middlewares/LVGL/src/layouts/flex/lv_flex.h delete mode 100644 L3_Middlewares/LVGL/src/layouts/grid/lv_grid.c delete mode 100644 L3_Middlewares/LVGL/src/layouts/grid/lv_grid.h delete mode 100644 L3_Middlewares/LVGL/src/layouts/lv_layout.c delete mode 100644 L3_Middlewares/LVGL/src/layouts/lv_layout.h delete mode 100644 L3_Middlewares/LVGL/src/layouts/lv_layout_private.h delete mode 100644 L3_Middlewares/LVGL/src/libs/barcode/code128.c delete mode 100644 L3_Middlewares/LVGL/src/libs/barcode/code128.h delete mode 100644 L3_Middlewares/LVGL/src/libs/barcode/lv_barcode.c delete mode 100644 L3_Middlewares/LVGL/src/libs/barcode/lv_barcode.h delete mode 100644 L3_Middlewares/LVGL/src/libs/barcode/lv_barcode_private.h delete mode 100644 L3_Middlewares/LVGL/src/libs/bin_decoder/lv_bin_decoder.c delete mode 100644 L3_Middlewares/LVGL/src/libs/bin_decoder/lv_bin_decoder.h delete mode 100644 L3_Middlewares/LVGL/src/libs/bmp/lv_bmp.c delete mode 100644 L3_Middlewares/LVGL/src/libs/ffmpeg/lv_ffmpeg_private.h delete mode 100644 L3_Middlewares/LVGL/src/libs/freetype/ftmodule.h delete mode 100644 L3_Middlewares/LVGL/src/libs/freetype/ftoption.h delete mode 100644 L3_Middlewares/LVGL/src/libs/freetype/lv_freetype.c delete mode 100644 L3_Middlewares/LVGL/src/libs/freetype/lv_freetype.h delete mode 100644 L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_glyph.c delete mode 100644 L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_image.c delete mode 100644 L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_outline.c delete mode 100644 L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_private.h delete mode 100644 L3_Middlewares/LVGL/src/libs/freetype/lv_ftsystem.c delete mode 100644 L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_arduino_esp_littlefs.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_arduino_sd.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_cbfs.c delete mode 100644 L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_littlefs.c delete mode 100644 L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_memfs.c delete mode 100644 L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_posix.c delete mode 100644 L3_Middlewares/LVGL/src/libs/gif/gifdec.h delete mode 100644 L3_Middlewares/LVGL/src/libs/gif/gifdec_mve.h delete mode 100644 L3_Middlewares/LVGL/src/libs/gif/lv_gif.h delete mode 100644 L3_Middlewares/LVGL/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c delete mode 100644 L3_Middlewares/LVGL/src/libs/libjpeg_turbo/lv_libjpeg_turbo.h delete mode 100644 L3_Middlewares/LVGL/src/libs/libpng/lv_libpng.c delete mode 100644 L3_Middlewares/LVGL/src/libs/lodepng/lodepng.c delete mode 100644 L3_Middlewares/LVGL/src/libs/lodepng/lv_lodepng.c delete mode 100644 L3_Middlewares/LVGL/src/libs/lodepng/lv_lodepng.h delete mode 100644 L3_Middlewares/LVGL/src/libs/lz4/LICENSE delete mode 100644 L3_Middlewares/LVGL/src/libs/lz4/lz4.c delete mode 100644 L3_Middlewares/LVGL/src/libs/lz4/lz4.h delete mode 100644 L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode.c delete mode 100644 L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode.h delete mode 100644 L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode_private.h delete mode 100644 L3_Middlewares/LVGL/src/libs/qrcode/qrcodegen.c delete mode 100644 L3_Middlewares/LVGL/src/libs/rle/lv_rle.c delete mode 100644 L3_Middlewares/LVGL/src/libs/rle/lv_rle.h delete mode 100644 L3_Middlewares/LVGL/src/libs/rlottie/lv_rlottie_private.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/add_lvgl_if.sh delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/config.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/allocators.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/cursorstreamwrapper.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/document.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/encodedstream.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/encodings.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/error/en.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/error/error.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/filereadstream.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/filewritestream.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/fwd.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/biginteger.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/clzll.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/diyfp.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/dtoa.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/ieee754.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/itoa.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/meta.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/pow10.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/regex.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/stack.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/strfunc.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/strtod.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/swap.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/istreamwrapper.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/memorybuffer.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/memorystream.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/msinttypes/inttypes.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/msinttypes/stdint.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/ostreamwrapper.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/pointer.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/prettywriter.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/rapidjson.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/reader.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/schema.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/stream.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/stringbuffer.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/uri.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/writer.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/thorvg.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/thorvg_capi.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/thorvg_lottie.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgAccessor.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgAnimation.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgAnimation.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgArray.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgBinaryDesc.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgCanvas.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgCanvas.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgCapi.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgCommon.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgCompressor.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgCompressor.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgFill.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgFill.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgFrameModule.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgGlCanvas.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgInitializer.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgInlist.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgIteratorAccessor.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLines.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLines.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLoadModule.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLoader.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLoader.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLock.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieAnimation.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieBuilder.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieBuilder.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieExpressions.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieExpressions.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieInterpolator.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieInterpolator.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieLoader.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieLoader.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieModel.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieModel.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParser.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParser.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParserHandler.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParserHandler.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieProperty.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgMath.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgMath.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgPaint.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgPaint.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgPicture.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgPicture.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgRawLoader.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgRawLoader.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgRender.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgRender.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSaveModule.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSaver.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgScene.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgScene.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgShape.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgShape.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgStr.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgStr.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgCssStyle.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgCssStyle.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoader.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoader.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoaderCommon.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgPath.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgPath.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgSceneBuilder.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgSceneBuilder.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgUtil.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgUtil.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwCanvas.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwCommon.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwFill.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwImage.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwMath.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwMemPool.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRaster.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterAvx.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterC.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterNeon.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterTexmap.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRenderer.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRenderer.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRle.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwShape.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgSwStroke.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgTaskScheduler.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgTaskScheduler.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgText.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgText.h delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgWgCanvas.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgXmlParser.cpp delete mode 100644 L3_Middlewares/LVGL/src/libs/thorvg/tvgXmlParser.h delete mode 100644 L3_Middlewares/LVGL/src/libs/tiny_ttf/lv_tiny_ttf.c delete mode 100644 L3_Middlewares/LVGL/src/libs/tiny_ttf/lv_tiny_ttf.h delete mode 100644 L3_Middlewares/LVGL/src/libs/tjpgd/lv_tjpgd.c delete mode 100644 L3_Middlewares/LVGL/src/libs/tjpgd/lv_tjpgd.h delete mode 100644 L3_Middlewares/LVGL/src/libs/tjpgd/tjpgd.c delete mode 100644 L3_Middlewares/LVGL/src/libs/tjpgd/tjpgd.h create mode 100644 L3_Middlewares/LVGL/src/lv_api_map.h delete mode 100644 L3_Middlewares/LVGL/src/lv_api_map_v8.h delete mode 100644 L3_Middlewares/LVGL/src/lv_api_map_v9_0.h delete mode 100644 L3_Middlewares/LVGL/src/lv_api_map_v9_1.h delete mode 100644 L3_Middlewares/LVGL/src/lv_init.c delete mode 100644 L3_Middlewares/LVGL/src/lv_init.h delete mode 100644 L3_Middlewares/LVGL/src/lvgl_private.h delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_cache.c delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_cache.h delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry.c delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry.h delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry_private.h delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_cache_lru_rb.c delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_cache_lru_rb.h delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_cache_private.h delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_image_cache.c delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_image_cache.h delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_image_header_cache.c delete mode 100644 L3_Middlewares/LVGL/src/misc/cache/lv_image_header_cache.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_anim_private.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_area_private.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_array.c delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_array.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_bidi_private.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_color_op.c delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_color_op.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_event.c delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_event.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_event_private.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_fs_private.h rename L3_Middlewares/LVGL/src/{drivers/glfw/lv_opengles_debug.c => misc/lv_gc.c} (54%) create mode 100644 L3_Middlewares/LVGL/src/misc/lv_gc.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_matrix.c delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_matrix.h create mode 100644 L3_Middlewares/LVGL/src/misc/lv_mem.c create mode 100644 L3_Middlewares/LVGL/src/misc/lv_mem.h create mode 100644 L3_Middlewares/LVGL/src/misc/lv_misc.mk delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_palette.c delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_palette.h rename L3_Middlewares/LVGL/src/{stdlib/builtin/lv_sprintf_builtin.c => misc/lv_printf.c} (97%) create mode 100644 L3_Middlewares/LVGL/src/misc/lv_printf.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_profiler.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_profiler_builtin.c delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_profiler_builtin.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_profiler_builtin_private.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_rb.c delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_rb.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_rb_private.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_text.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_text_private.h delete mode 100644 L3_Middlewares/LVGL/src/misc/lv_timer_private.h rename L3_Middlewares/LVGL/src/{stdlib/builtin => misc}/lv_tlsf.c (98%) rename L3_Middlewares/LVGL/src/{stdlib/builtin => misc}/lv_tlsf.h (94%) rename L3_Middlewares/LVGL/src/misc/{lv_text.c => lv_txt.c} (64%) create mode 100644 L3_Middlewares/LVGL/src/misc/lv_txt.h rename L3_Middlewares/LVGL/src/misc/{lv_text_ap.c => lv_txt_ap.c} (83%) rename L3_Middlewares/LVGL/src/misc/{lv_text_ap.h => lv_txt_ap.h} (74%) delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_cmsis_rtos2.c delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_cmsis_rtos2.h delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_freertos.c delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_freertos.h delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_mqx.c delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_mqx.h delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_os.c delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_os.h delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_os_none.c delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_os_none.h delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_pthread.c delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_pthread.h delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_rtthread.c delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_rtthread.h delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_windows.c delete mode 100644 L3_Middlewares/LVGL/src/osal/lv_windows.h delete mode 100644 L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer.c delete mode 100644 L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer.h delete mode 100644 L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer_private.h delete mode 100644 L3_Middlewares/LVGL/src/others/fragment/lv_fragment_private.h delete mode 100644 L3_Middlewares/LVGL/src/others/ime/lv_ime_pinyin_private.h delete mode 100644 L3_Middlewares/LVGL/src/others/monkey/lv_monkey_private.h delete mode 100644 L3_Middlewares/LVGL/src/others/observer/lv_observer.c delete mode 100644 L3_Middlewares/LVGL/src/others/observer/lv_observer.h delete mode 100644 L3_Middlewares/LVGL/src/others/observer/lv_observer_private.h delete mode 100644 L3_Middlewares/LVGL/src/others/snapshot/lv_snapshot.c delete mode 100644 L3_Middlewares/LVGL/src/others/snapshot/lv_snapshot.h delete mode 100644 L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon.c delete mode 100644 L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon.h delete mode 100644 L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon_private.h delete mode 100644 L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite.h delete mode 100644 L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite_matrix.c delete mode 100644 L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite_tvg.cpp delete mode 100644 L3_Middlewares/LVGL/src/stdlib/builtin/lv_mem_core_builtin.c delete mode 100644 L3_Middlewares/LVGL/src/stdlib/builtin/lv_string_builtin.c delete mode 100644 L3_Middlewares/LVGL/src/stdlib/builtin/lv_tlsf_private.h delete mode 100644 L3_Middlewares/LVGL/src/stdlib/clib/lv_mem_core_clib.c delete mode 100644 L3_Middlewares/LVGL/src/stdlib/clib/lv_sprintf_clib.c delete mode 100644 L3_Middlewares/LVGL/src/stdlib/clib/lv_string_clib.c delete mode 100644 L3_Middlewares/LVGL/src/stdlib/lv_mem.c delete mode 100644 L3_Middlewares/LVGL/src/stdlib/lv_mem.h delete mode 100644 L3_Middlewares/LVGL/src/stdlib/lv_mem_private.h delete mode 100644 L3_Middlewares/LVGL/src/stdlib/lv_sprintf.h delete mode 100644 L3_Middlewares/LVGL/src/stdlib/lv_string.h delete mode 100644 L3_Middlewares/LVGL/src/stdlib/micropython/lv_mem_core_micropython.c delete mode 100644 L3_Middlewares/LVGL/src/stdlib/rtthread/lv_mem_core_rtthread.c delete mode 100644 L3_Middlewares/LVGL/src/stdlib/rtthread/lv_sprintf_rtthread.c delete mode 100644 L3_Middlewares/LVGL/src/stdlib/rtthread/lv_string_rtthread.c delete mode 100644 L3_Middlewares/LVGL/src/themes/default/lv_theme_default.c delete mode 100644 L3_Middlewares/LVGL/src/themes/lv_theme_private.h delete mode 100644 L3_Middlewares/LVGL/src/themes/mono/lv_theme_mono.c delete mode 100644 L3_Middlewares/LVGL/src/themes/simple/lv_theme_simple.c delete mode 100644 L3_Middlewares/LVGL/src/tick/lv_tick.h delete mode 100644 L3_Middlewares/LVGL/src/tick/lv_tick_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/animimage/lv_animimage.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/animimage/lv_animimage_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/arc/lv_arc.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/arc/lv_arc_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/bar/lv_bar_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/button/lv_button_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/buttonmatrix/lv_buttonmatrix.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/buttonmatrix/lv_buttonmatrix_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/chart/lv_chart.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/chart/lv_chart_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/checkbox/lv_checkbox_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/dropdown/lv_dropdown_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/image/lv_image.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/image/lv_image.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/image/lv_image_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/keyboard/lv_keyboard.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/keyboard/lv_keyboard_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/label/lv_label_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/led/lv_led_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/line/lv_line.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/line/lv_line_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/list/lv_list.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie_private.h rename L3_Middlewares/LVGL/src/widgets/{arc => }/lv_arc.c (62%) create mode 100644 L3_Middlewares/LVGL/src/widgets/lv_arc.h rename L3_Middlewares/LVGL/src/widgets/{bar => }/lv_bar.c (52%) rename L3_Middlewares/LVGL/src/widgets/{bar => }/lv_bar.h (60%) rename L3_Middlewares/LVGL/src/widgets/{button/lv_button.c => lv_btn.c} (63%) rename L3_Middlewares/LVGL/src/widgets/{button/lv_button.h => lv_btn.h} (58%) rename L3_Middlewares/LVGL/src/widgets/{buttonmatrix/lv_buttonmatrix.c => lv_btnmatrix.c} (56%) create mode 100644 L3_Middlewares/LVGL/src/widgets/lv_btnmatrix.h create mode 100644 L3_Middlewares/LVGL/src/widgets/lv_canvas.c create mode 100644 L3_Middlewares/LVGL/src/widgets/lv_canvas.h rename L3_Middlewares/LVGL/src/widgets/{checkbox => }/lv_checkbox.c (52%) rename L3_Middlewares/LVGL/src/widgets/{checkbox => }/lv_checkbox.h (68%) rename L3_Middlewares/LVGL/src/widgets/{dropdown => }/lv_dropdown.c (70%) rename L3_Middlewares/LVGL/src/widgets/{dropdown => }/lv_dropdown.h (82%) create mode 100644 L3_Middlewares/LVGL/src/widgets/lv_img.c create mode 100644 L3_Middlewares/LVGL/src/widgets/lv_img.h rename L3_Middlewares/LVGL/src/widgets/{label => }/lv_label.c (62%) rename L3_Middlewares/LVGL/src/widgets/{label => }/lv_label.h (71%) create mode 100644 L3_Middlewares/LVGL/src/widgets/lv_line.c rename L3_Middlewares/LVGL/src/widgets/{line => }/lv_line.h (51%) rename L3_Middlewares/LVGL/src/widgets/{objx_templ => }/lv_objx_templ.c (94%) rename L3_Middlewares/LVGL/src/widgets/{objx_templ => }/lv_objx_templ.h (95%) rename L3_Middlewares/LVGL/src/widgets/{roller => }/lv_roller.c (57%) rename L3_Middlewares/LVGL/src/widgets/{roller => }/lv_roller.h (72%) create mode 100644 L3_Middlewares/LVGL/src/widgets/lv_slider.c rename L3_Middlewares/LVGL/src/widgets/{slider => }/lv_slider.h (57%) rename L3_Middlewares/LVGL/src/widgets/{switch => }/lv_switch.c (70%) rename L3_Middlewares/LVGL/src/widgets/{switch => }/lv_switch.h (60%) rename L3_Middlewares/LVGL/src/widgets/{table => }/lv_table.c (67%) rename L3_Middlewares/LVGL/src/widgets/{table => }/lv_table.h (73%) rename L3_Middlewares/LVGL/src/widgets/{textarea => }/lv_textarea.c (73%) rename L3_Middlewares/LVGL/src/widgets/{textarea => }/lv_textarea.h (79%) create mode 100644 L3_Middlewares/LVGL/src/widgets/lv_widgets.mk delete mode 100644 L3_Middlewares/LVGL/src/widgets/menu/lv_menu.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/menu/lv_menu_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/property/lv_dropdown_properties.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/property/lv_image_properties.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/property/lv_keyboard_properties.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/property/lv_label_properties.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/property/lv_obj_properties.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/property/lv_obj_property_names.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/property/lv_roller_properties.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/property/lv_style_properties.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/property/lv_style_properties.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/property/lv_textarea_properties.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/roller/lv_roller_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/scale/lv_scale.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/scale/lv_scale.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/scale/lv_scale_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/slider/lv_slider.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/slider/lv_slider_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/span/lv_span.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/span/lv_span_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/spinbox/lv_spinbox_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/switch/lv_switch_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/table/lv_table_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview.c delete mode 100644 L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/textarea/lv_textarea_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/tileview/lv_tileview_private.h delete mode 100644 L3_Middlewares/LVGL/src/widgets/win/lv_win_private.h diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0da7f8..cdc14f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,19 +16,12 @@ jobs: - name: "Default (All OFF)" freertos: "OFF" lvgl: "OFF" - thorvg: "OFF" - name: "FreeRTOS ON" freertos: "ON" lvgl: "OFF" - thorvg: "OFF" - name: "LVGL ON" freertos: "OFF" lvgl: "ON" - thorvg: "OFF" - - name: "LVGL + ThorVG ON" - freertos: "OFF" - lvgl: "ON" - thorvg: "ON" steps: - name: Checkout repository @@ -60,8 +53,7 @@ jobs: -DMCU_MODEL="STM32F429ZIT6_GCC" \ -DUSE_FREERTOS=${{ matrix.config.freertos }} \ -DUSE_FATFS=OFF \ - -DUSE_LVGL=${{ matrix.config.lvgl }} \ - -DUSE_LVGL_THORVG=${{ matrix.config.thorvg }} + -DUSE_LVGL=${{ matrix.config.lvgl }} ninja -C build build-gcc-windows: @@ -73,19 +65,12 @@ jobs: - name: "Default (All OFF)" freertos: "OFF" lvgl: "OFF" - thorvg: "OFF" - name: "FreeRTOS ON" freertos: "ON" lvgl: "OFF" - thorvg: "OFF" - name: "LVGL ON" freertos: "OFF" lvgl: "ON" - thorvg: "OFF" - - name: "LVGL + ThorVG ON" - freertos: "OFF" - lvgl: "ON" - thorvg: "ON" steps: - name: Checkout repository diff --git a/L3_Middlewares/CMakeLists.txt b/L3_Middlewares/CMakeLists.txt index eabf959..53d7747 100644 --- a/L3_Middlewares/CMakeLists.txt +++ b/L3_Middlewares/CMakeLists.txt @@ -1,7 +1,6 @@ option(USE_FREERTOS "Enable FreeRTOS" OFF) option(USE_FATFS "ENABLE FATFS" OFF) option(USE_LVGL "ENABLE LVGL" OFF) -option(USE_LVGL_THORVG "Enable LVGL ThorVG vector graphics library" OFF) # 汇总库 add_library(l3_middlewares INTERFACE) @@ -19,9 +18,6 @@ if(USE_LVGL) if(USE_FREERTOS) target_compile_definitions(l3_middlewares INTERFACE LVGL_USE_FREERTOS=1) endif() - if(NOT USE_LVGL_THORVG) - set(LV_CONF_BUILD_DISABLE_THORVG_INTERNAL 1 CACHE INTERNAL "Disable ThorVG") - endif() add_subdirectory(LVGL) add_library(lvgl_config INTERFACE) @@ -29,7 +25,6 @@ if(USE_LVGL) target_compile_definitions(lvgl_config INTERFACE LV_CONF_BUILD_DISABLE_EXAMPLES=1 LV_CONF_BUILD_DISABLE_DEMOS=1 - LV_CONF_BUILD_DISABLE_THORVG_INTERNAL=$> ) endif() @@ -44,9 +39,6 @@ endif() if(USE_LVGL) target_link_libraries(l3_middlewares INTERFACE lvgl lvgl_config) - if(USE_LVGL_THORVG) - target_link_libraries(l3_middlewares INTERFACE lvgl::thorvg) - endif() endif() target_link_libraries(l3_middlewares INTERFACE l2_core global_macros global_options) diff --git a/L3_Middlewares/LVGL/CMakeLists.txt b/L3_Middlewares/LVGL/CMakeLists.txt index 8751ddc..c1f72b8 100644 --- a/L3_Middlewares/LVGL/CMakeLists.txt +++ b/L3_Middlewares/LVGL/CMakeLists.txt @@ -1,13 +1,7 @@ cmake_minimum_required(VERSION 3.12.4) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - if(NOT ESP_PLATFORM) - if(NOT (CMAKE_C_COMPILER_ID STREQUAL "MSVC")) - project(lvgl LANGUAGES C CXX ASM HOMEPAGE_URL https://github.com/lvgl/lvgl) - else() - project(lvgl LANGUAGES C CXX HOMEPAGE_URL https://github.com/lvgl/lvgl) - endif() + project(lvgl HOMEPAGE_URL https://github.com/lvgl/lvgl) endif() set(LVGL_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}) @@ -21,20 +15,3 @@ elseif(MICROPY_DIR) else() include(${CMAKE_CURRENT_LIST_DIR}/env_support/cmake/custom.cmake) endif() - -#[[ - unfortunately CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS does not work for global data. - for global data we still need decl specs. - Check out the docs to learn more about the limitations of CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS - https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html#prop_tgt:WINDOWS_EXPORT_ALL_SYMBOLS - - For all compiled sources within the library (i.e. basically all lvgl files) we need to use dllexport. - For all compiled sources from outside the library (i.e. files which include lvgl headers) we need to use dllimport. - We can do this by using CMakes INTERFACE and PRIVATE keyword. - ]] -if (MSVC) - target_compile_definitions(lvgl - INTERFACE LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllimport\) - PRIVATE LV_ATTRIBUTE_EXTERN_DATA=__declspec\(dllexport\) - ) -endif() \ No newline at end of file diff --git a/L3_Middlewares/LVGL/doc/README.md b/L3_Middlewares/LVGL/doc/README.md new file mode 100644 index 0000000..aea07a8 --- /dev/null +++ b/L3_Middlewares/LVGL/doc/README.md @@ -0,0 +1,186 @@ +

LVGL - Light and Versatile Graphics Library

+ +

+ +

+ +

+LVGL provides everything you need to create an embedded GUI with easy-to-use graphical elements, beautiful visual effects and a low memory footprint. +

+ +

+Website · +Docs · +Forum · +Services · +Interactive examples +

+ + +**English** | [中文](./README_zh.md) | [Português do Brasil](./README_pt_BR.md) + + +--- + +#### Table of content +- [Overview](#overview) +- [Get started](#get-started) +- [Examples](#examples) +- [Services](#services) +- [Contributing](#contributing) + +## Overview +### Features +* Powerful [building blocks](https://docs.lvgl.io/master/widgets/index.html): buttons, charts, lists, sliders, images, etc. +* Advanced graphics engine: animations, anti-aliasing, opacity, smooth scrolling, blending modes, etc +* Supports [various input devices](https://docs.lvgl.io/master/overview/indev.html): touchscreen, mouse, keyboard, encoder, buttons, etc. +* Supports [multiple displays](https://docs.lvgl.io/master/overview/display.html) +* Hardware independent, can be use with any microcontroller and display +* Scalable to operate with little memory (64 kB Flash, 16 kB RAM) +* Multi-language support with UTF-8 handling, CJK, Bidirectional and Arabic script support +* Fully customizable graphical elements via [CSS-like styles](https://docs.lvgl.io/master/overview/style.html) +* Powerful layouts inspired by CSS: [Flexbox](https://docs.lvgl.io/master/layouts/flex.html) and [Grid](https://docs.lvgl.io/master/layouts/grid.html) +* OS, External memory and GPU are supported but not required. (built in support for STM32 DMA2D, SWM341 DMA2D, and NXP PXP and VGLite) +* Smooth rendering even with a [single frame buffer](https://docs.lvgl.io/master/porting/display.html) +* Written in C and compatible with C++ +* Micropython Binding exposes [LVGL API in Micropython](https://blog.lvgl.io/2019-02-20/micropython-bindings) +* [Simulator](https://docs.lvgl.io/master/get-started/platforms/pc-simulator.html) to develop on PC without embedded hardware +* 100+ simple [Examples](https://github.com/lvgl/lvgl/tree/master/examples) +* [Documentation](http://docs.lvgl.io/) and API references online and in PDF + +### Requirements +Basically, every modern controller (which is able to drive a display) is suitable to run LVGL. The minimal requirements are: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name MinimalRecommended
Architecture16, 32 or 64 bit microcontroller or processor
Clock > 16 MHz > 48 MHz
Flash/ROM > 64 kB > 180 kB
Static RAM > 16 kB > 48 kB
Draw buffer > 1 × hor. res. pixels > 1/10 screen size
Compiler C99 or newer
+ +*Note that the memory usage might vary depending on the architecture, compiler and build options.* + +### Supported platforms +LVGL is completely platform independent and can be used with any MCU that fulfills the requirements. +Just to mention some platforms: +- NXP: Kinetis, LPC, iMX, iMX RT +- STM32F1, STM32F3, STM32F4, STM32F7, STM32L4, STM32L5, STM32H7 +- Microchip dsPIC33, PIC24, PIC32MX, PIC32MZ +- [Linux frame buffer](https://blog.lvgl.io/2018-01-03/linux_fb) (/dev/fb) +- [Raspberry Pi](https://github.com/lvgl/lv_port_linux_frame_buffer) +- [Espressif ESP32](https://github.com/lvgl/lv_port_esp32) +- [Infineon Aurix](https://github.com/lvgl/lv_port_aurix) +- Nordic NRF52 Bluetooth modules +- Quectel modems +- [SYNWIT SWM341](http://www.synwit.cn/) + +LVGL is also available as: +- [Arduino library](https://docs.lvgl.io/master/get-started/platforms/arduino.html) +- [PlatformIO package](https://registry.platformio.org/libraries/lvgl/lvgl) +- [Zephyr library](https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_LVGL.html) +- [ESP32 component](https://docs.lvgl.io/master/get-started/platforms/espressif.html) +- [NXP MCUXpresso component](https://www.nxp.com/design/software/embedded-software/lvgl-open-source-graphics-library:LITTLEVGL-OPEN-SOURCE-GRAPHICS-LIBRARY) +- [NuttX library](https://docs.lvgl.io/master/get-started/os/nuttx.html) +- [RT-Thread RTOS](https://docs.lvgl.io/master/get-started/os/rt-thread.html) + + +## Get started +This list shows the recommended way of learning the library: +1. Check the [Online demos](https://lvgl.io/demos) to see LVGL in action (3 minutes) +2. Read the [Introduction](https://docs.lvgl.io/master/intro/index.html) page of the documentation (5 minutes) +3. Get familiar with the basics on the [Quick overview](https://docs.lvgl.io/master/get-started/quick-overview.html) page (15 minutes) +4. Set up a [Simulator](https://docs.lvgl.io/master/get-started/platforms/pc-simulator.html) (10 minutes) +5. Try out some [Examples](https://github.com/lvgl/lvgl/tree/master/examples) +6. Port LVGL to a board. See the [Porting](https://docs.lvgl.io/master/porting/index.html) guide or check the ready to use [Projects](https://github.com/lvgl?q=lv_port_) +7. Read the [Overview](https://docs.lvgl.io/master/overview/index.html) page to get a better understanding of the library (2-3 hours) +8. Check the documentation of the [Widgets](https://docs.lvgl.io/master/widgets/index.html) to see their features and usage +9. If you have questions go to the [Forum](http://forum.lvgl.io/) +10. Read the [Contributing](https://docs.lvgl.io/master/CONTRIBUTING.html) guide to see how you can help to improve LVGL (15 minutes) + +## Examples + +For more examples see the [examples](https://github.com/lvgl/lvgl/tree/master/examples) folder. + +![LVGL button with label example](https://github.com/lvgl/lvgl/raw/master/docs/misc/btn_example.png) + +### C +```c +lv_obj_t * btn = lv_btn_create(lv_scr_act()); /*Add a button to the current screen*/ +lv_obj_set_pos(btn, 10, 10); /*Set its position*/ +lv_obj_set_size(btn, 100, 50); /*Set its size*/ +lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_CLICKED, NULL); /*Assign a callback to the button*/ + +lv_obj_t * label = lv_label_create(btn); /*Add a label to the button*/ +lv_label_set_text(label, "Button"); /*Set the labels text*/ +lv_obj_center(label); /*Align the label to the center*/ +... + +void btn_event_cb(lv_event_t * e) +{ + printf("Clicked\n"); +} +``` +### Micropython +Learn more about [Micropython](https://docs.lvgl.io/master/get-started/bindings/micropython.html). +```python +def btn_event_cb(e): + print("Clicked") + +# Create a Button and a Label +btn = lv.btn(lv.scr_act()) +btn.set_pos(10, 10) +btn.set_size(100, 50) +btn.add_event_cb(btn_event_cb, lv.EVENT.CLICKED, None) + +label = lv.label(btn) +label.set_text("Button") +label.center() +``` + +## Services +LVGL Kft was established to provide a solid background for LVGL library. We offer several type of services to help you in UI development: +- Graphics design +- UI implementation +- Consulting/Support + +For more information see https://lvgl.io/services +Feel free to contact us if you have any questions. + + +## Contributing +LVGL is an open project and contribution is very welcome. There are many ways to contribute from simply speaking about your project, through writing examples, improving the documentation, fixing bugs to hosting your own project under the LVGL organization. + +For a detailed description of contribution opportunities visit the [Contributing](https://docs.lvgl.io/master/CONTRIBUTING.html) section of the documentation. + diff --git a/L3_Middlewares/LVGL/doc/README_pt_BR.md b/L3_Middlewares/LVGL/doc/README_pt_BR.md new file mode 100644 index 0000000..f62f0a0 --- /dev/null +++ b/L3_Middlewares/LVGL/doc/README_pt_BR.md @@ -0,0 +1,206 @@ +

LVGL - Biblioteca gráfica leve e versátil

+

+ +

+

+ O LVGL fornece tudo o que você precisa para criar uma GUI incorporada com elementos gráficos fáceis de usar, belos efeitos visuais e um baixo consumo de memória. +

+

+ Site · + Documentação · + Fórum · + Serviços · + Exemplos interativos +

+ +[English](./README.md) | [中文](./README_zh.md) | **Português do Brasil** + +--- + +### Tabela de conteúdo + +- [Visão Geral](#visão-geral) +- [Iniciando](#iniciando) +- [Exemplos](#exemplos) +- [Serviços](#serviços) +- [Contribuindo](#contribuindo) + +## Visão Geral + +### Recursos +* Poderosos [widgets](https://docs.lvgl.io/master/widgets/index.html): botões, gráficos, listas, controles deslizantes (sliders), imagens, etc. +* Mecanismo gráfico avançado: animações, anti-aliasing, opacidade, rolagem suave, modos de mesclagem (blending modes), etc. +* Suporte à [vários dispositivos de entrada](https://docs.lvgl.io/master/overview/indev.html): tela sensível ao toque, mouse, teclado, codificador, botões, etc. +* Suporte à [vários monitores](https://docs.lvgl.io/master/overview/display.html) +* Pode ser usado com qualquer microcontrolador e display, independente do hardware +* Escalável para operar com pouca memória (64 kB Flash, 16 kB RAM) +* Suporte multilíngue com manipulação UTF-8, suporte ao alfabeto bidirecional, árabe e CJK (Chinês, Japonês e Coreano) +* Elementos gráficos totalmente personalizáveis por meio de [CSS](https://docs.lvgl.io/master/overview/style.html) +* Layouts poderosos inspirados em CSS: [Flexbox](https://docs.lvgl.io/master/layouts/flex.html) e [Grid](https://docs.lvgl.io/master/layouts/grid.html) +* SO, memória externa e GPU são suportados, mas não obrigatórios. (suporte integrado para STM32 DMA2D, SWM341 DMA2D e NXP PXP e VGLite) +* Renderização suave mesmo com um [buffer de quadro único](https://docs.lvgl.io/master/porting/display.html) (single frame buffer) +* Escrito em C e compatível com C++ +* Uso do LittlevGL com Micropython simplificado com [LVGL API in Micropython](https://blog.lvgl.io/2019-02-20/micropython-bindings) +* [Simulador](https://docs.lvgl.io/master/get-started/platforms/pc-simulator.html) para desenvolver no PC sem hardware embutido +* Mais de 100 [exemplos simples](https://github.com/lvgl/lvgl/tree/master/examples) +* [Documentação](http://docs.lvgl.io/) e referências de API online e em PDF + +### Requerimentos +Basicamente, todo controlador moderno (que é capaz de acionar um display) é adequado para executar LVGL. Os requisitos mínimos são: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Nome + + Minímo + + Recomendado +
+ Arquitetura + Microcontrolador ou processador de 16, 32 ou 64 bits
+ Clock + > 16 MHz> 48 MHz
+ Flash/ROM + > 64 kB> 180 kB
+ RAM estática + > 16 kB> 48 kB
+ Draw buffer + > 1 × hor. res. pixels> tamanho da tela de 1/10
+ Compilador + Padrão C99 ou mais recente
+ +*Observe que o uso de memória pode variar dependendo da arquitetura, do compilador e das opções de compilação.* + +### Plataformas suportadas +O LVGL é completamente independente de plataforma e pode ser usado com qualquer MCU que atenda aos requisitos. +Apenas para citar algumas plataformas: + +- NXP: Kinetis, LPC, iMX, iMX RT +- STM32F1, STM32F3, STM32F4, STM32F7, STM32L4, STM32L5, STM32H7 +- Microchip dsPIC33, PIC24, PIC32MX, PIC32MZ +- [Linux frame buffer](https://blog.lvgl.io/2018-01-03/linux_fb) (/dev/fb) +- [Raspberry Pi](http://www.vk3erw.com/index.php/16-software/63-raspberry-pi-official-7-touchscreen-and-littlevgl) +- [Espressif ESP32](https://github.com/lvgl/lv_port_esp32) +- [Infineon Aurix](https://github.com/lvgl/lv_port_aurix) +- Nordic NRF52 Bluetooth modules +- Quectel modems +- [SYNWIT SWM341](https://www.synwit.cn/) + +LVGL também está disponível para: +- [Arduino library](https://docs.lvgl.io/master/get-started/platforms/arduino.html) +- [PlatformIO package](https://registry.platformio.org/libraries/lvgl/lvgl) +- [Zephyr library](https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_LVGL.html) +- [ESP32 component](https://docs.lvgl.io/master/get-started/platforms/espressif.html) +- [NXP MCUXpresso component](https://www.nxp.com/design/software/embedded-software/lvgl-open-source-graphics-library:LITTLEVGL-OPEN-SOURCE-GRAPHICS-LIBRARY) +- [NuttX library](https://docs.lvgl.io/master/get-started/os/nuttx.html) +- [RT-Thread RTOS](https://docs.lvgl.io/master/get-started/os/rt-thread.html) + +## Iniciando +Esta lista mostra a maneira recomendada de aprender sobre a biblioteca: + +1. Confira as [demos on-line](https://lvgl.io/demos) para ver o LVGL em ação (3 minutos) +2. Leia a [introdução](https://docs.lvgl.io/master/intro/index.html) da documentação (5 minutos) +3. Familiarize-se com o básico da [Visão geral rápida](https://docs.lvgl.io/master/get-started/quick-overview.html) (15 minutos) +4. Configure um [simulador](https://docs.lvgl.io/master/get-started/platforms/pc-simulator.html) (10 minutos) +5. Experimente alguns [Exemplos](https://github.com/lvgl/lvgl/tree/master/examples) +6. Placa para porta LVGL. Veja o guia [porting](https://docs.lvgl.io/master/porting/index.html) ou verifique o pronto para usar [Projects](https://github.com/lvgl?q=lv_port_) +7. Leia a [visão geral](https://docs.lvgl.io/master/overview/index.html) para entender melhor a biblioteca (2-3 horas) +8. Verifique a documentação dos [widgets](https://docs.lvgl.io/master/widgets/index.html) para ver seus recursos e como utilizá-los +9. Se você tiver dúvidas, acesse o [fórum](http://forum.lvgl.io/) +10. Leia o guia de [contribuição](https://docs.lvgl.io/master/CONTRIBUTING.html) para ver como você pode ajudar a melhorar o LVGL (15 minutos) + +## Exemplos +Para mais exemplos, veja a pasta [examples](https://github.com/lvgl/lvgl/tree/master/examples). + +![Exemplo de botão LVGL com rótulo (label)](https://github.com/lvgl/lvgl/raw/master/docs/misc/btn_example.png) + +### C + +```c +lv_obj_t * button = lv_btn_create(lv_scr_act()); /* Adiciona um botão à tela atual */ +lv_obj_set_pos(button, 10, 10); /* Define uma posição ao botão na tela */ +lv_obj_set_size(button, 100, 50); /* Define o tamanho */ +lv_obj_add_event_cb(button, button_event_callback, LV_EVENT_CLICKED, NULL); /* Atribui um retorno de chamada (callback) */ + +lv_obj_t * label = lv_label_create(button); /* Adiciona um rótulo (label) */ +lv_label_set_text(label, "Clique aqui"); /* Define o texto do rótulo (label) */ +lv_obj_center(label); /* Alinha o texto ao centro */ +... + +void button_event_callback(lv_event_t * e) +{ + printf("Clicado\n"); +} +``` + +### Micropython +Saiba mais em [Micropython](https://docs.lvgl.io/master/get-started/bindings/micropython.html) + +```python +def button_event_callback(event): + print("Clicado") + +# Cria um botão e um rótulo (label) +button = lv.btn(lv.scr_act()) +button.set_pos(10, 10) +button.set_size(100, 50) +button.add_event_cb(button_event_callback, lv.EVENT.CLICKED, None) + +label = lv.label(button) +label.set_text("Cliquq aqui") +label.center() +``` + +## Serviços +O LVGL Kft foi estabelecido para fornecer uma base sólida para a biblioteca LVGL. Oferecemos vários tipos de serviços +para ajudá-lo no desenvolvimento da interface do usuário: + +- Design gráfico +- Implementação de IU +- Consultoria/Suporte + +Para mais informações, consulte [LVGL Serviços](https://lvgl.io/services). Sinta-se à vontade para entrar em contato +conosco se tiver alguma dúvida. + +## Contribuindo +O LVGL é um projeto aberto e sua contribuição é muito bem-vinda. Há muitas maneiras de contribuir, desde simplesmente +falando sobre seu projeto, escrevendo exemplos, melhorando a documentação, corrigindo bugs até hospedar seu próprio +projeto sob a organização LVGL. + +Para obter uma descrição detalhada das oportunidades de contribuição, visite a seção de [contribuição](https://docs.lvgl.io/master/CONTRIBUTING.html) da documentação. diff --git a/L3_Middlewares/LVGL/doc/README_zh.md b/L3_Middlewares/LVGL/doc/README_zh.md new file mode 100644 index 0000000..cac080d --- /dev/null +++ b/L3_Middlewares/LVGL/doc/README_zh.md @@ -0,0 +1,193 @@ +

LVGL - Light and Versatile Graphics Library

+

LVGL - 轻量级通用型图形库

+ + + +

+ +

+

+LVGL是一个高度可裁剪、低资源占用、界面美观且易用的嵌入式系统图形库 +

+ + +

+官网 · +文档 · +论坛 · +服务 · +例程 +

+ + +[English](./README.md) | **中文** | [Português do Brasil](./README_pt_BR.md) + + +--- + +#### 目录 +- [概况与总览](#概况与总览) +- [如何入门](#如何入门) +- [例程](#例程) +- [服务](#服务) +- [如何向社区贡献](#如何向社区贡献) + +## 概况与总览 +### 特性 +* 丰富且强大的模块化[图形组件](https://docs.lvgl.io/master/widgets/index.html):按钮 (buttons)、图表 (charts)、列表 (lists)、滑动条 (sliders)、图片 (images) 等 +* 高级的图形引擎:动画、抗锯齿、透明度、平滑滚动、图层混合等效果 +* 支持多种[输入设备](https://docs.lvgl.io/master/overview/indev.html):触摸屏、 键盘、编码器、按键等 +* 支持[多显示设备](https://docs.lvgl.io/master/overview/display.html) +* 不依赖特定的硬件平台,可以在任何显示屏上运行 +* 配置可裁剪(最低资源占用:64 kB Flash,16 kB RAM) +* 基于UTF-8的多语种支持,例如中文、日文、韩文、阿拉伯文等 +* 可以通过[类CSS](https://docs.lvgl.io/master/overview/style.html)的方式来设计、布局图形界面(例如:[Flexbox](https://docs.lvgl.io/master/layouts/flex.html)、[Grid](https://docs.lvgl.io/master/layouts/grid.html)) +* 支持操作系统、外置内存、以及硬件加速(LVGL已内建支持STM32 DMA2D、SWM341 DMA2D、NXP PXP和VGLite) +* 即便仅有[单缓冲区(frame buffer)](https://docs.lvgl.io/master/porting/display.html)的情况下,也可保证渲染如丝般顺滑 +* 全部由C编写完成,并支持C++调用 +* 支持Micropython编程,参见:[LVGL API in Micropython](https://blog.lvgl.io/2019-02-20/micropython-bindings) +* 支持[模拟器](https://docs.lvgl.io/master/get-started/platforms/pc-simulator.html)仿真,可以无硬件依托进行开发 +* 丰富详实的[例程](https://github.com/lvgl/lvgl/tree/master/examples) +* 详尽的[文档](http://docs.lvgl.io/)以及API参考手册,可线上查阅或可下载为PDF格式 + +### 硬件要求 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
要求 最低要求建议要求
架构16、32、64位微控制器或微处理器
时钟 > 16 MHz > 48 MHz
Flash/ROM > 64 kB > 180 kB
Static RAM > 16 kB > 48 kB
Draw buffer > 1 × hor. res. pixels > 1/10屏幕大小
编译器 C99或更新
+ +*注意:资源占用情况与具体硬件平台、编译器等因素有关,上表中仅给出参考值* + +### 已经支持的平台 +LVGL本身并不依赖特定的硬件平台,任何满足LVGL硬件配置要求的微控制器均可运行LVGL。 +如下仅列举其中一部分: + +- NXP: Kinetis, LPC, iMX, iMX RT +- STM32F1, STM32F3, STM32F4, STM32F7, STM32L4, STM32L5, STM32H7 +- Microchip dsPIC33, PIC24, PIC32MX, PIC32MZ +- [Linux frame buffer](https://blog.lvgl.io/2018-01-03/linux_fb) (/dev/fb) +- [Raspberry Pi](http://www.vk3erw.com/index.php/16-software/63-raspberry-pi-official-7-touchscreen-and-littlevgl) +- [Espressif ESP32](https://github.com/lvgl/lv_port_esp32) +- [Infineon Aurix](https://github.com/lvgl/lv_port_aurix) +- Nordic NRF52 Bluetooth modules +- Quectel modems +- [SYNWIT SWM341](https://www.synwit.cn/) + +LVGL也支持: +- [Arduino library](https://docs.lvgl.io/master/get-started/platforms/arduino.html) +- [PlatformIO package](https://platformio.org/lib/show/12440/lvgl) +- [Zephyr library](https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_LVGL.html) +- [ESP32 component](https://docs.lvgl.io/master/get-started/platforms/espressif.html) +- [NXP MCUXpresso component](https://www.nxp.com/design/software/embedded-software/lvgl-open-source-graphics-library:LITTLEVGL-OPEN-SOURCE-GRAPHICS-LIBRARY) +- [NuttX library](https://docs.lvgl.io/master/get-started/os/nuttx.html) +- [RT-Thread RTOS](https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/packages-manual/lvgl-docs/introduction) + + +## 如何入门 +请按照如下顺序来学习LVGL: +1. 使用[网页在线例程](https://lvgl.io/demos)来体验LVGL(3分钟) +2. 阅读文档[简介](https://docs.lvgl.io/master/intro/index.html)章节来初步了解LVGL(5分钟) +3. 再来阅读一下文档快速[快速概览](https://docs.lvgl.io/master/get-started/quick-overview.html)章节来了解LVGL的基本知识(15分钟) +4. 学习如何使用[模拟器](https://docs.lvgl.io/master/get-started/platforms/pc-simulator.html)来在电脑上仿真LVGL(10分钟) +5. 试着动手实践一些[例程](https://github.com/lvgl/lvgl/tree/master/examples) +6. 参考[移植指南](https://docs.lvgl.io/master/porting/index.html)尝试将LVGL移植到一块开发板上,LVGL也已经提供了一些移植好的[工程](https://github.com/lvgl?q=lv_port_) +7. 仔细阅读文档[总览](https://docs.lvgl.io/master/overview/index.html)章节来更加深入的了解和熟悉LVGL(2-3小时) +8. 浏览文档[组件(Widgets)](https://docs.lvgl.io/master/widgets/index.html)章节来了解如何使用它们 +9. 如果你有问题可以到LVGL[论坛](http://forum.lvgl.io/)提问 +10. 阅读文档[如何向社区贡献](https://docs.lvgl.io/master/CONTRIBUTING.html)章节来看看你能帮LVGL社区做些什么,以促进LVGL软件质量的不断提高(15分钟) + +## 例程 + +更多例程请参见 [examples](https://github.com/lvgl/lvgl/tree/master/examples) 文件夹。 + +![LVGL button with label example](https://github.com/lvgl/lvgl/raw/master/docs/misc/btn_example.png) + +### C +```c +lv_obj_t * btn = lv_btn_create(lv_scr_act()); /*Add a button to the current screen*/ +lv_obj_set_pos(btn, 10, 10); /*Set its position*/ +lv_obj_set_size(btn, 100, 50); /*Set its size*/ +lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_CLICKED, NULL); /*Assign a callback to the button*/ + +lv_obj_t * label = lv_label_create(btn); /*Add a label to the button*/ +lv_label_set_text(label, "Button"); /*Set the labels text*/ +lv_obj_center(label); /*Align the label to the center*/ +... + +void btn_event_cb(lv_event_t * e) +{ + printf("Clicked\n"); +} +``` +### Micropython +更多信息请到 [Micropython官网](https://docs.lvgl.io/master/get-started/bindings/micropython.html) 查询. +```python +def btn_event_cb(e): + print("Clicked") + +# Create a Button and a Label +btn = lv.btn(lv.scr_act()) +btn.set_pos(10, 10) +btn.set_size(100, 50) +btn.add_event_cb(btn_event_cb, lv.EVENT.CLICKED, None) + +label = lv.label(btn) +label.set_text("Button") +label.center() +``` + +## 服务 +LVGL 责任有限公司成立的目的是为了给用户使用LVGL图形库提供额外的技术支持,我们致力于提供以下服务: + +- 图形设计 +- UI设计 +- 技术咨询以及技术支持 + +更多信息请参见 https://lvgl.io/services ,如果有任何问题请随时联系我们。 + + +## 如何向社区贡献 +LVGL是一个开源项目,非常欢迎您参与到社区贡献当中。您有很多种方式来为提高LVGL贡献您的一份力量,包括但不限于: + +- 介绍你基于LVGL设计的作品或项目 +- 写一些例程 +- 修改以及完善文档 +- 修复bug + +请参见文档[如何向社区贡献](https://docs.lvgl.io/master/CONTRIBUTING.html)章节来获取更多信息。 diff --git a/L3_Middlewares/LVGL/env_support/cmake/custom.cmake b/L3_Middlewares/LVGL/env_support/cmake/custom.cmake index d45ba72..6390cb0 100644 --- a/L3_Middlewares/LVGL/env_support/cmake/custom.cmake +++ b/L3_Middlewares/LVGL/env_support/cmake/custom.cmake @@ -1,217 +1,98 @@ -include("${CMAKE_CURRENT_LIST_DIR}/version.cmake") - # Option to define LV_LVGL_H_INCLUDE_SIMPLE, default: ON option(LV_LVGL_H_INCLUDE_SIMPLE "Use #include \"lvgl.h\" instead of #include \"../../lvgl.h\"" ON) # Option to define LV_CONF_INCLUDE_SIMPLE, default: ON option(LV_CONF_INCLUDE_SIMPLE - "Use #include \"lv_conf.h\" instead of #include \"../../lv_conf.h\"" ON) + "Simple include of \"lv_conf.h\" and \"lv_drv_conf.h\"" ON) -# Option LV_CONF_PATH, which should be the path for lv_conf.h -# If set parent path LV_CONF_DIR is added to includes -if( LV_CONF_PATH ) - get_filename_component(LV_CONF_DIR ${LV_CONF_PATH} DIRECTORY) -endif( LV_CONF_PATH ) +# Option to set LV_CONF_PATH, if set parent path LV_CONF_DIR is added to +# includes +option(LV_CONF_PATH "Path defined for lv_conf.h") +get_filename_component(LV_CONF_DIR ${LV_CONF_PATH} DIRECTORY) # Option to build shared libraries (as opposed to static), default: OFF option(BUILD_SHARED_LIBS "Build shared libraries" OFF) -# Set sources used for LVGL components -file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c ${LVGL_ROOT_DIR}/src/*.S) +file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c) file(GLOB_RECURSE EXAMPLE_SOURCES ${LVGL_ROOT_DIR}/examples/*.c) file(GLOB_RECURSE DEMO_SOURCES ${LVGL_ROOT_DIR}/demos/*.c) -file(GLOB_RECURSE THORVG_SOURCES ${LVGL_ROOT_DIR}/src/libs/thorvg/*.cpp ${LVGL_ROOT_DIR}/src/others/vg_lite_tvg/*.cpp) - -# Build LVGL library -add_library(lvgl ${SOURCES}) -add_library(lvgl::lvgl ALIAS lvgl) - -target_compile_definitions( - lvgl PUBLIC $<$:LV_LVGL_H_INCLUDE_SIMPLE> - $<$:LV_CONF_INCLUDE_SIMPLE>) -# Add definition of LV_CONF_PATH only if needed -if(LV_CONF_PATH) - target_compile_definitions(lvgl PUBLIC LV_CONF_PATH=${LV_CONF_PATH}) +if (BUILD_SHARED_LIBS) + add_library(lvgl SHARED ${SOURCES}) +else() + add_library(lvgl STATIC ${SOURCES}) endif() -# Add definition of LV_CONF_SKIP only if needed -if(LV_CONF_SKIP) - target_compile_definitions(lvgl PUBLIC LV_CONF_SKIP=1) -endif() - -# Include root and optional parent path of LV_CONF_PATH -target_include_directories(lvgl SYSTEM PUBLIC ${LVGL_ROOT_DIR} ${LV_CONF_DIR} ${CMAKE_CURRENT_BINARY_DIR}) - +add_library(lvgl::lvgl ALIAS lvgl) -if(NOT LV_CONF_BUILD_DISABLE_THORVG_INTERNAL) - add_library(lvgl_thorvg ${THORVG_SOURCES}) - add_library(lvgl::thorvg ALIAS lvgl_thorvg) - target_include_directories(lvgl_thorvg SYSTEM PUBLIC ${LVGL_ROOT_DIR}/src/libs/thorvg) - target_link_libraries(lvgl_thorvg PUBLIC lvgl) +# Only create examples library if sources exist +if(EXAMPLE_SOURCES) + add_library(lvgl_examples STATIC ${EXAMPLE_SOURCES}) + add_library(lvgl::examples ALIAS lvgl_examples) endif() -if(NOT (CMAKE_C_COMPILER_ID STREQUAL "MSVC")) - set_source_files_properties(${LVGL_ROOT_DIR}/src/others/vg_lite_tvg/vg_lite_tvg.cpp PROPERTIES COMPILE_FLAGS -Wunused-parameter) +# Only create demos library if sources exist +if(DEMO_SOURCES) + add_library(lvgl_demos STATIC ${DEMO_SOURCES}) + add_library(lvgl::demos ALIAS lvgl_demos) endif() -# Build LVGL example library -if(NOT LV_CONF_BUILD_DISABLE_EXAMPLES AND EXAMPLE_SOURCES) - add_library(lvgl_examples ${EXAMPLE_SOURCES}) - add_library(lvgl::examples ALIAS lvgl_examples) +target_compile_definitions( + lvgl PUBLIC $<$:LV_LVGL_H_INCLUDE_SIMPLE> + $<$:LV_CONF_INCLUDE_SIMPLE>) - target_include_directories(lvgl_examples SYSTEM PUBLIC ${LVGL_ROOT_DIR}/examples) +# Include root and optional parent path of LV_CONF_PATH +target_include_directories(lvgl SYSTEM PUBLIC ${LVGL_ROOT_DIR} ${LV_CONF_DIR}) + +# Include /examples folder (only if library exists) +if(EXAMPLE_SOURCES) + target_include_directories(lvgl_examples SYSTEM + PUBLIC ${LVGL_ROOT_DIR}/examples) target_link_libraries(lvgl_examples PUBLIC lvgl) endif() -# Build LVGL demos library -if(NOT LV_CONF_BUILD_DISABLE_DEMOS AND DEMO_SOURCES) - add_library(lvgl_demos ${DEMO_SOURCES}) - add_library(lvgl::demos ALIAS lvgl_demos) - - target_include_directories(lvgl_demos SYSTEM PUBLIC ${LVGL_ROOT_DIR}/demos) +# Include /demos folder (only if library exists) +if(DEMO_SOURCES) + target_include_directories(lvgl_demos SYSTEM + PUBLIC ${LVGL_ROOT_DIR}/demos) target_link_libraries(lvgl_demos PUBLIC lvgl) endif() -# Library and headers can be installed to system using make install -file(GLOB LVGL_PUBLIC_HEADERS - "${LVGL_ROOT_DIR}/lvgl.h" - "${LVGL_ROOT_DIR}/lv_version.h") - -if(NOT LV_CONF_SKIP) - if (LV_CONF_PATH) - list(APPEND LVGL_PUBLIC_HEADERS - ${LV_CONF_PATH}) - else() - list(APPEND LVGL_PUBLIC_HEADERS - "${CMAKE_SOURCE_DIR}/lv_conf.h") - endif() -endif() +# Lbrary and headers can be installed to system using make install +file(GLOB LVGL_PUBLIC_HEADERS "${CMAKE_SOURCE_DIR}/lv_conf.h" + "${CMAKE_SOURCE_DIR}/lvgl.h") if("${LIB_INSTALL_DIR}" STREQUAL "") set(LIB_INSTALL_DIR "lib") endif() -if("${RUNTIME_INSTALL_DIR}" STREQUAL "") - set(RUNTIME_INSTALL_DIR "bin") -endif() if("${INC_INSTALL_DIR}" STREQUAL "") set(INC_INSTALL_DIR "include/lvgl") endif() -#Install headers install( - DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src" + DIRECTORY "${CMAKE_SOURCE_DIR}/src" DESTINATION "${CMAKE_INSTALL_PREFIX}/${INC_INSTALL_DIR}/" FILES_MATCHING PATTERN "*.h") -# Install headers from the LVGL_PUBLIC_HEADERS variable install( - FILES ${LVGL_PUBLIC_HEADERS} - DESTINATION "${CMAKE_INSTALL_PREFIX}/${INC_INSTALL_DIR}/" -) - -# install example headers -if(NOT LV_CONF_BUILD_DISABLE_EXAMPLES) - install( - DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/examples" - DESTINATION "${CMAKE_INSTALL_PREFIX}/${INC_INSTALL_DIR}/" - FILES_MATCHING - PATTERN "*.h") -endif() - -# install demo headers -if(NOT LV_CONF_BUILD_DISABLE_DEMOS) - install( - DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/demos" - DESTINATION "${CMAKE_INSTALL_PREFIX}/${INC_INSTALL_DIR}/" - FILES_MATCHING - PATTERN "*.h") -endif() + FILES "${LV_CONF_PATH}" + DESTINATION "${CMAKE_INSTALL_PREFIX}/${INC_INSTALL_DIR}/../" + RENAME "lv_conf.h" + OPTIONAL) -# configure_file("${LVGL_ROOT_DIR}/lvgl.pc.in" lvgl.pc @ONLY) # 已删除 lvgl.pc.in,跳过 pkg-config 配置 -configure_file("${LVGL_ROOT_DIR}/lv_version.h.in" lv_version.h @ONLY) - -# install( # 已删除 lvgl.pc.in,跳过 pkg-config 安装 -# FILES "${CMAKE_CURRENT_BINARY_DIR}/lvgl.pc" -# DESTINATION "${LIB_INSTALL_DIR}/pkgconfig/") - -# Install library set_target_properties( lvgl PROPERTIES OUTPUT_NAME lvgl - VERSION ${LVGL_VERSION} - SOVERSION ${LVGL_SOVERSION} ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" PUBLIC_HEADER "${LVGL_PUBLIC_HEADERS}") install( TARGETS lvgl ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" LIBRARY DESTINATION "${LIB_INSTALL_DIR}" - RUNTIME DESTINATION "${RUNTIME_INSTALL_DIR}" + RUNTIME DESTINATION "${LIB_INSTALL_DIR}" PUBLIC_HEADER DESTINATION "${INC_INSTALL_DIR}") - - -# Install library thorvg -if(NOT LV_CONF_BUILD_DISABLE_THORVG_INTERNAL) - set_target_properties( - lvgl_thorvg - PROPERTIES OUTPUT_NAME lvgl_thorvg - VERSION ${LVGL_VERSION} - SOVERSION ${LVGL_SOVERSION} - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - PUBLIC_HEADER "${LVGL_PUBLIC_HEADERS}") - - install( - TARGETS lvgl_thorvg - ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" - LIBRARY DESTINATION "${LIB_INSTALL_DIR}" - RUNTIME DESTINATION "${RUNTIME_INSTALL_DIR}" - PUBLIC_HEADER DESTINATION "${INC_INSTALL_DIR}") -endif() - -# Install library demos -if(NOT LV_CONF_BUILD_DISABLE_DEMOS AND DEMO_SOURCES) - set_target_properties( - lvgl_demos - PROPERTIES OUTPUT_NAME lvgl_demos - VERSION ${LVGL_VERSION} - SOVERSION ${LVGL_SOVERSION} - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - PUBLIC_HEADER "${LVGL_PUBLIC_HEADERS}") - - install( - TARGETS lvgl_demos - ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" - LIBRARY DESTINATION "${LIB_INSTALL_DIR}" - RUNTIME DESTINATION "${RUNTIME_INSTALL_DIR}" - PUBLIC_HEADER DESTINATION "${INC_INSTALL_DIR}") -endif() - -#install library examples -if(NOT LV_CONF_BUILD_DISABLE_EXAMPLES AND EXAMPLE_SOURCES) - set_target_properties( - lvgl_examples - PROPERTIES OUTPUT_NAME lvgl_examples - VERSION ${LVGL_VERSION} - SOVERSION ${LVGL_SOVERSION} - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - PUBLIC_HEADER "${LVGL_PUBLIC_HEADERS}") - - install( - TARGETS lvgl_examples - ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" - LIBRARY DESTINATION "${LIB_INSTALL_DIR}" - RUNTIME DESTINATION "${RUNTIME_INSTALL_DIR}" - PUBLIC_HEADER DESTINATION "${INC_INSTALL_DIR}") -endif() diff --git a/L3_Middlewares/LVGL/env_support/cmake/esp.cmake b/L3_Middlewares/LVGL/env_support/cmake/esp.cmake index 8aaed35..edc3709 100644 --- a/L3_Middlewares/LVGL/env_support/cmake/esp.cmake +++ b/L3_Middlewares/LVGL/env_support/cmake/esp.cmake @@ -1,6 +1,4 @@ -include("${CMAKE_CURRENT_LIST_DIR}/version.cmake") - -file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c ${LVGL_ROOT_DIR}/src/*.cpp) +file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c) idf_build_get_property(LV_MICROPYTHON LV_MICROPYTHON) @@ -36,22 +34,6 @@ else() file(GLOB_RECURSE DEMO_STRESS_SOURCES ${LVGL_ROOT_DIR}/demos/stress/*.c) list(APPEND DEMO_SOURCES ${DEMO_STRESS_SOURCES}) endif() - if(CONFIG_LV_USE_DEMO_TRANSFORM) - file(GLOB_RECURSE DEMO_TRANSFORM_SOURCES ${LVGL_ROOT_DIR}/demos/transform/*.c) - list(APPEND DEMO_SOURCES ${DEMO_TRANSFORM_SOURCES}) - endif() - if(CONFIG_LV_USE_DEMO_MULTILANG) - file(GLOB_RECURSE DEMO_MULTILANG_SOURCES ${LVGL_ROOT_DIR}/demos/multilang/*.c) - list(APPEND DEMO_SOURCES ${DEMO_MULTILANG_SOURCES}) - endif() - if(CONFIG_LV_USE_DEMO_FLEX_LAYOUT) - file(GLOB_RECURSE DEMO_FLEX_LAYOUT_SOURCES ${LVGL_ROOT_DIR}/demos/flex_layout/*.c) - list(APPEND DEMO_SOURCES ${DEMO_FLEX_LAYOUT_SOURCES}) - endif() - if(CONFIG_LV_USE_DEMO_SCROLL) - file(GLOB_RECURSE DEMO_SCROLL_SOURCES ${LVGL_ROOT_DIR}/demos/scroll/*.c) - list(APPEND DEMO_SOURCES ${DEMO_SCROLL_SOURCES}) - endif() if(CONFIG_LV_USE_DEMO_MUSIC) file(GLOB_RECURSE DEMO_MUSIC_SOURCES ${LVGL_ROOT_DIR}/demos/music/*.c) list(APPEND DEMO_SOURCES ${DEMO_MUSIC_SOURCES}) @@ -70,9 +52,3 @@ if(CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM) target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR") endif() - -if(CONFIG_FREERTOS_SMP) - target_include_directories(${COMPONENT_LIB} PRIVATE "${IDF_PATH}/components/freertos/FreeRTOS-Kernel-SMP/include/freertos/") -else() - target_include_directories(${COMPONENT_LIB} PRIVATE "${IDF_PATH}/components/freertos/FreeRTOS-Kernel/include/freertos/") -endif() \ No newline at end of file diff --git a/L3_Middlewares/LVGL/env_support/cmake/micropython.cmake b/L3_Middlewares/LVGL/env_support/cmake/micropython.cmake index 207e6d9..43ce7c4 100644 --- a/L3_Middlewares/LVGL/env_support/cmake/micropython.cmake +++ b/L3_Middlewares/LVGL/env_support/cmake/micropython.cmake @@ -1,5 +1,3 @@ -include("${CMAKE_CURRENT_LIST_DIR}/version.cmake") - file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c) file(GLOB_RECURSE EXAMPLE_SOURCES ${LVGL_ROOT_DIR}/examples/*.c) @@ -10,11 +8,11 @@ add_library(lvgl_interface INTERFACE) # ${SOURCES} must NOT be given to add_library directly for some reason (won't be # built) target_sources(lvgl_interface INTERFACE ${SOURCES}) -# MicroPython builds with -Werror; we need to suppress some warnings, such as: +# Micropython builds with -Werror; we need to suppress some warnings, such as: # # /home/test/build/lv_micropython/ports/rp2/build-PICO/lv_mp.c:29316:16: error: # 'lv_style_transition_dsc_t_path_xcb_callback' defined but not used # [-Werror=unused-function] 29316 | STATIC int32_t -# lv_style_transition_dsc_t_path_xcb_callback(const lv_anim_t * arg0) | +# lv_style_transition_dsc_t_path_xcb_callback(const struct _lv_anim_t * arg0) | # ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ target_compile_options(lvgl_interface INTERFACE -Wno-unused-function) diff --git a/L3_Middlewares/LVGL/env_support/cmake/version.cmake b/L3_Middlewares/LVGL/env_support/cmake/version.cmake deleted file mode 100644 index bb877f4..0000000 --- a/L3_Middlewares/LVGL/env_support/cmake/version.cmake +++ /dev/null @@ -1,8 +0,0 @@ -set(LVGL_VERSION_MAJOR "9") -set(LVGL_VERSION_MINOR "2") -set(LVGL_VERSION_PATCH "3") -set(LVGL_VERSION_INFO "dev") - -set(LVGL_VERSION ${LVGL_VERSION_MAJOR}.${LVGL_VERSION_MINOR}.${LVGL_VERSION_PATCH}) # This is a CMake variable -set(ENV{LVGL_VERSION} ${LVGL_VERSION}) # This is exported Environmental variable -set(LVGL_SOVERSION ${LVGL_VERSION_MAJOR}) diff --git a/L3_Middlewares/LVGL/env_support/cmake/zephyr.cmake b/L3_Middlewares/LVGL/env_support/cmake/zephyr.cmake index 826810d..f9ae517 100644 --- a/L3_Middlewares/LVGL/env_support/cmake/zephyr.cmake +++ b/L3_Middlewares/LVGL/env_support/cmake/zephyr.cmake @@ -1,11 +1,10 @@ if(CONFIG_LVGL) - include("${CMAKE_CURRENT_LIST_DIR}/version.cmake") zephyr_include_directories(${ZEPHYR_BASE}/lib/gui/lvgl) target_include_directories(lvgl INTERFACE ${LVGL_ROOT_DIR}) - zephyr_compile_definitions(LV_CONF_KCONFIG_EXTERNAL_INCLUDE=) + zephyr_compile_definitions(LV_CONF_KCONFIG_EXTERNAL_INCLUDE=) zephyr_library() diff --git a/L3_Middlewares/LVGL/lv_conf.h b/L3_Middlewares/LVGL/lv_conf.h index 3d315c0..4f38977 100644 --- a/L3_Middlewares/LVGL/lv_conf.h +++ b/L3_Middlewares/LVGL/lv_conf.h @@ -1,359 +1,320 @@ /** * @file lv_conf.h - * Configuration file for LVGL v9.x + * Configuration file for LVGL v8.3.11 * * EmbeddedKit 项目定制配置 - * 目标平台: STM32F429VGT6 - * 显示: RGB565 (16位色深) */ -/* clang-format off */ #if 1 /*Set it to "1" to enable content*/ -#ifndef LV_CONF_H -#define LV_CONF_H +# ifndef LV_CONF_H +# define LV_CONF_H -/* 注意: EK_USE_RTOS 由 L2_Core 的 ek_def.h 定义 - * 由于 LVGL 配置文件需要在更早阶段被包含, - * 这里直接使用宏判断,依赖项目构建配置传递 */ +# include /*==================== COLOR SETTINGS *====================*/ -/*Color depth: 1 (I1), 8 (L8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/ -#define LV_COLOR_DEPTH 16 +# define LV_COLOR_DEPTH 16 +# define LV_COLOR_16_SWAP 0 +# define LV_COLOR_SCREEN_TRANSP 0 +# define LV_COLOR_MIX_ROUND_OFS 0 +# define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*========================= - STDLIB WRAPPER SETTINGS + MEMORY SETTINGS *=========================*/ -/* 使用内置内存管理器 */ -#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN -#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN -#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN - -#define LV_STDINT_INCLUDE -#define LV_STDDEF_INCLUDE -#define LV_STDBOOL_INCLUDE -#define LV_INTTYPES_INCLUDE -#define LV_LIMITS_INCLUDE -#define LV_STDARG_INCLUDE - -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN - /*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/ - #define LV_MEM_SIZE (128 * 1024U) /*[bytes]*/ - - /*Size of the memory expand for `lv_malloc()` in bytes*/ - #define LV_MEM_POOL_EXPAND_SIZE 0 - - /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ - #define LV_MEM_ADR 0 /*0: unused*/ - /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ - #if LV_MEM_ADR == 0 - #undef LV_MEM_POOL_INCLUDE - #undef LV_MEM_POOL_ALLOC - #endif -#endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/ +# define LV_MEM_CUSTOM 0 +# if LV_MEM_CUSTOM == 0 +# define LV_MEM_SIZE (48U * 1024U) +# define LV_MEM_ADR 0 +# if LV_MEM_ADR == 0 +# undef LV_MEM_POOL_INCLUDE +# undef LV_MEM_POOL_ALLOC +# endif +# else +# define LV_MEM_CUSTOM_INCLUDE +# define LV_MEM_CUSTOM_ALLOC malloc +# define LV_MEM_CUSTOM_FREE free +# define LV_MEM_CUSTOM_REALLOC realloc +# endif + +# define LV_MEM_BUF_MAX_NUM 16 +# define LV_MEMCPY_MEMSET_STD 0 /*==================== HAL SETTINGS *====================*/ -/*Default display refresh, input device read and animation step period.*/ -#define LV_DEF_REFR_PERIOD 33 /*[ms]*/ - -/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. - *(Not so important, you can adjust it to modify default sizes and spaces)*/ -#define LV_DPI_DEF 130 /*[px/inch]*/ - -/*================= - * OPERATING SYSTEM - *=================*/ -/*操作系统选择 - 可通过 CMake 的 LVGL_USE_FREERTOS 变量配置*/ -#if defined(LVGL_USE_FREERTOS) && (LVGL_USE_FREERTOS == 1) - #define LV_USE_OS LV_OS_FREERTOS - #define LV_USE_FREERTOS_TASK_NOTIFY 1 -#else - #define LV_USE_OS LV_OS_NONE -#endif - -/*======================== - * RENDERING CONFIGURATION - *========================*/ - -/*Align the stride of all layers and images to this bytes*/ -#define LV_DRAW_BUF_STRIDE_ALIGN 1 - -/*Align the start address of draw_buf addresses to this bytes*/ -#define LV_DRAW_BUF_ALIGN 4 - -/*Enable matrix support for transformations*/ -#define LV_USE_FLOAT 1 -#define LV_USE_MATRIX 1 - -/*Using matrix for transformations. - *Requirements: - `LV_USE_MATRIX = 1`. - The rendering engine needs to support 3x3 matrix transformations.*/ -#define LV_DRAW_TRANSFORM_USE_MATRIX 1 - -/*The target buffer size for simple layer chunks.*/ -#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ - -/* The stack size of the drawing thread. - * NOTE: If FreeType or ThorVG is enabled, it is recommended to set it to 32KB or more. - */ -#define LV_DRAW_THREAD_STACK_SIZE (32 * 1024) /*[bytes] - 增大以支持 ThorVG*/ - -#define LV_USE_DRAW_SW 1 -#if LV_USE_DRAW_SW == 1 - #define LV_DRAW_SW_SUPPORT_RGB565 1 - #define LV_DRAW_SW_SUPPORT_RGB565A8 1 - #define LV_DRAW_SW_SUPPORT_RGB888 1 - #define LV_DRAW_SW_SUPPORT_XRGB8888 1 - #define LV_DRAW_SW_SUPPORT_ARGB8888 1 - #define LV_DRAW_SW_SUPPORT_L8 1 - #define LV_DRAW_SW_SUPPORT_AL88 1 - #define LV_DRAW_SW_SUPPORT_A8 1 - #define LV_DRAW_SW_SUPPORT_I1 1 - - #define LV_DRAW_SW_DRAW_UNIT_CNT 1 - - /* Use Arm-2D to accelerate the sw render */ - #define LV_USE_DRAW_ARM2D_SYNC 0 - - /* Enable native helium assembly to be compiled */ - #define LV_USE_NATIVE_HELIUM_ASM 0 - - /* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only - * 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */ - #define LV_DRAW_SW_COMPLEX 1 - - #if LV_DRAW_SW_COMPLEX == 1 - #define LV_DRAW_SW_SHADOW_CACHE_SIZE 0 - #define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4 - #endif - - #define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE - - /* Enable drawing complex gradients in software: linear at an angle, radial or conical */ - #define LV_USE_DRAW_SW_COMPLEX_GRADIENTS 0 -#endif - -/* GPU 加速 - STM32F429 不支持 */ -#define LV_USE_DRAW_VGLITE 0 -#define LV_USE_DRAW_PPG 0 -#define LV_USE_DRAW_SDL 0 -#define LV_USE_DRAW_OPENGLES 0 - -/*================= - * WIDGET USAGE +# define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/ +# define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/ +# define LV_TICK_CUSTOM 0 +# define LV_DPI_DEF 130 /*[px/inch]*/ + +/*======================= + * FEATURE CONFIGURATION + *=======================*/ + +/*------------- Drawing-----------*/ +# define LV_DRAW_COMPLEX 1 +# if LV_DRAW_COMPLEX != 0 +# define LV_SHADOW_CACHE_SIZE 0 +# define LV_CIRCLE_CACHE_SIZE 4 +# endif + +# define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024) +# define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (3 * 1024) + +# define LV_IMG_CACHE_DEF_SIZE 0 +# define LV_GRADIENT_MAX_STOPS 2 +# define LV_GRAD_CACHE_DEF_SIZE 0 +# define LV_DITHER_GRADIENT 0 +# define LV_DISP_ROT_MAX_BUF (10 * 1024) + +/*------------- GPU-----------*/ +# define LV_USE_GPU_ARM2D 0 +# define LV_USE_GPU_STM32_DMA2D 0 +# define LV_USE_GPU_RA6M3_G2D 0 +# define LV_USE_GPU_SWM341_DMA2D 0 +# define LV_USE_GPU_NXP_PXP 0 +# define LV_USE_GPU_NXP_VG_LITE 0 +# define LV_USE_GPU_SDL 0 + +/*------------- Logging-----------*/ +# define LV_USE_LOG 0 +# if LV_USE_LOG +# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN +# define LV_LOG_PRINTF 0 +# define LV_LOG_TRACE_MEM 1 +# define LV_LOG_TRACE_TIMER 1 +# define LV_LOG_TRACE_INDEV 1 +# define LV_LOG_TRACE_DISP_REFR 1 +# define LV_LOG_TRACE_EVENT 1 +# define LV_LOG_TRACE_OBJ_CREATE 1 +# define LV_LOG_TRACE_LAYOUT 1 +# define LV_LOG_TRACE_ANIM 1 +# endif + +/*------------- Asserts-----------*/ +# define LV_USE_ASSERT_NULL 1 +# define LV_USE_ASSERT_MALLOC 1 +# define LV_USE_ASSERT_STYLE 0 +# define LV_USE_ASSERT_MEM_INTEGRITY 0 +# define LV_USE_ASSERT_OBJ 0 +# define LV_ASSERT_HANDLER_INCLUDE +# define LV_ASSERT_HANDLER while (1); + +/*------------- Others-----------*/ +# define LV_USE_PERF_MONITOR 0 +# define LV_USE_MEM_MONITOR 0 +# define LV_USE_REFR_DEBUG 0 +# define LV_SPRINTF_CUSTOM 0 +# define LV_USE_USER_DATA 1 +# define LV_ENABLE_GC 0 + +/*===================== + * COMPILER SETTINGS *====================*/ -/* 基础控件 */ -#define LV_USE_ANIMIMAGE 1 -#define LV_USE_ARC 1 -#define LV_USE_BAR 1 -#define LV_USE_BUTTON 1 -#define LV_USE_BUTTONMATRIX 1 -#define LV_USE_CALENDAR 1 -#define LV_USE_CANVAS 1 -#define LV_USE_CHART 1 -#define LV_USE_CHECKBOX 1 -#define LV_USE_DROPDOWN 1 -#define LV_USE_IMAGE 1 -#define LV_USE_IMAGEBUTTON 1 -#define LV_USE_KEYBOARD 1 -#define LV_USE_LABEL 1 -#define LV_USE_LED 1 -#define LV_USE_LINE 1 -#define LV_USE_LIST 1 -#define LV_USE_LOTTIE 1 -#define LV_USE_MENU 1 -#define LV_USE_MSGBOX 1 -#define LV_USE_ROLLER 1 -#define LV_USE_SCALE 1 -#define LV_USE_SLIDER 1 -#define LV_USE_SPAN 1 -#define LV_USE_SPINBOX 1 -#define LV_USE_SPINNER 1 -#define LV_USE_SWITCH 1 -#define LV_USE_TABLE 1 -#define LV_USE_TABVIEW 1 -#define LV_USE_TEXTAREA 1 -#define LV_USE_TILEVIEW 1 -#define LV_USE_WIN 1 +# define LV_BIG_ENDIAN_SYSTEM 0 +# define LV_ATTRIBUTE_TICK_INC +# define LV_ATTRIBUTE_TIMER_HANDLER +# define LV_ATTRIBUTE_FLUSH_READY +# define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 +# define LV_ATTRIBUTE_MEM_ALIGN +# define LV_ATTRIBUTE_LARGE_CONST +# define LV_ATTRIBUTE_LARGE_RAM_ARRAY +# define LV_ATTRIBUTE_FAST_MEM +# define LV_ATTRIBUTE_DMA +# define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning +# define LV_USE_LARGE_COORD 0 /*================== - * LAYOUTS - *==================*/ - -#define LV_USE_FLEX 1 -#define LV_USE_GRID 1 - -/*================== - * THEMES - *==================*/ - -#define LV_USE_THEME_DEFAULT 1 -#if LV_USE_THEME_DEFAULT - #define LV_THEME_DEFAULT_DARK 0 -#endif - -#define LV_USE_THEME_SIMPLE 1 - -/*================== - * OTHERS - *==================*/ - -/*1: Enable API to take snapshot for object*/ -#define LV_USE_SNAPSHOT 1 - -/*1: Enable system monitor component*/ -#define LV_USE_SYSMON 1 -#if LV_USE_SYSMON - /*1: Show CPU usage and FPS count*/ - #define LV_USE_PERF_MONITOR 0 - /*1: Show the used memory and the memory fragmentation*/ - #define LV_USE_MEM_MONITOR 0 -#endif - -/*1: Enable the runtime performance profiler*/ -#define LV_USE_PROFILER 0 - -/*1: Enable monkey test*/ -#define LV_USE_MONKEY 0 - -/*1: Enable grid navigation*/ -#define LV_USE_GRIDNAV 0 + * FONT USAGE + *===================*/ + +# define LV_FONT_MONTSERRAT_8 0 +# define LV_FONT_MONTSERRAT_10 0 +# define LV_FONT_MONTSERRAT_12 0 +# define LV_FONT_MONTSERRAT_14 1 +# define LV_FONT_MONTSERRAT_16 1 +# define LV_FONT_MONTSERRAT_18 1 +# define LV_FONT_MONTSERRAT_20 1 +# define LV_FONT_MONTSERRAT_22 0 +# define LV_FONT_MONTSERRAT_24 1 +# define LV_FONT_MONTSERRAT_26 0 +# define LV_FONT_MONTSERRAT_28 0 +# define LV_FONT_MONTSERRAT_30 0 +# define LV_FONT_MONTSERRAT_32 0 +# define LV_FONT_MONTSERRAT_34 0 +# define LV_FONT_MONTSERRAT_36 0 +# define LV_FONT_MONTSERRAT_38 0 +# define LV_FONT_MONTSERRAT_40 0 +# define LV_FONT_MONTSERRAT_42 0 +# define LV_FONT_MONTSERRAT_44 0 +# define LV_FONT_MONTSERRAT_46 0 +# define LV_FONT_MONTSERRAT_48 0 + +# define LV_FONT_MONTSERRAT_12_SUBPX 0 +# define LV_FONT_MONTSERRAT_28_COMPRESSED 0 +# define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 +# define LV_FONT_SIMSUN_16_CJK 0 +# define LV_FONT_UNSCII_8 0 +# define LV_FONT_UNSCII_16 0 + +# define LV_FONT_CUSTOM_DECLARE +# define LV_FONT_DEFAULT &lv_font_montserrat_14 +# define LV_FONT_FMT_TXT_LARGE 0 +# define LV_USE_FONT_COMPRESSED 0 +# define LV_USE_FONT_SUBPX 0 +# define LV_USE_FONT_PLACEHOLDER 1 -/*1: Enable lv_obj fragment*/ -#define LV_USE_FRAGMENT 0 - -/*1: Support using images as font in label or span widgets */ -#define LV_USE_IMGFONT 0 - -/*1: Enable an observer pattern implementation and API*/ -#define LV_USE_OBSERVER 1 - -/*1: Enable Pinyin input method*/ -#define LV_USE_IME_PINYIN 0 - -/*1: Enable file explorer*/ -#define LV_USE_FILE_EXPLORER 0 - -/*================== - * LIBRARIES - *==================*/ - -/*PNG decoder library*/ -#define LV_USE_PNG 1 - -/*BMP decoder library*/ -#define LV_USE_BMP 1 - -/*JPG + split JPG decoder library*/ -#define LV_USE_SJPG 0 - -/*GIF decoder library*/ -#define LV_USE_GIF 0 - -/*QR code library*/ -#define LV_USE_QRCODE 1 - -/*Barcode code library*/ -#define LV_USE_BARCODE 0 - -/*FreeType library*/ -#define LV_USE_FREETYPE 0 - -/* Built-in TTF decoder */ -#define LV_USE_TINY_TTF 0 - -/*Rlottie library*/ -#define LV_USE_RLOTTIE 0 - -/*Enable Vector Graphic APIs - *Requires `LV_USE_MATRIX = 1`*/ -#define LV_USE_VECTOR_GRAPHIC 1 - -/* Enable ThorVG (vector graphics library) from the src/libs folder - * 由 CMake 变量 USE_LVGL_THORVG 控制 - * 如果定义了 LV_CONF_BUILD_DISABLE_THORVG_INTERNAL 则禁用 */ -#if defined(LV_CONF_BUILD_DISABLE_THORVG_INTERNAL) && (LV_CONF_BUILD_DISABLE_THORVG_INTERNAL == 1) - #define LV_USE_THORVG_INTERNAL 0 -#else - #define LV_USE_THORVG_INTERNAL 1 -#endif - -/*FFmpeg library for image decoding and playing videos*/ -#define LV_USE_FFMPEG 0 - -/*================== - * FONT SUPPORT - *==================*/ - -/*Montserrat fonts with various sizes and character sets*/ -#define LV_FONT_MONTSERRAT_8 0 -#define LV_FONT_MONTSERRAT_10 0 -#define LV_FONT_MONTSERRAT_12 0 -#define LV_FONT_MONTSERRAT_14 1 -#define LV_FONT_MONTSERRAT_16 1 -#define LV_FONT_MONTSERRAT_18 1 -#define LV_FONT_MONTSERRAT_20 1 -#define LV_FONT_MONTSERRAT_22 0 -#define LV_FONT_MONTSERRAT_24 1 -#define LV_FONT_MONTSERRAT_26 0 -#define LV_FONT_MONTSERRAT_28 0 -#define LV_FONT_MONTSERRAT_30 0 -#define LV_FONT_MONTSERRAT_32 0 -#define LV_FONT_MONTSERRAT_34 0 -#define LV_FONT_MONTSERRAT_36 0 -#define LV_FONT_MONTSERRAT_38 0 -#define LV_FONT_MONTSERRAT_40 0 -#define LV_FONT_MONTSERRAT_42 0 -#define LV_FONT_MONTSERRAT_44 0 -#define LV_FONT_MONTSERRAT_46 0 -#define LV_FONT_MONTSERRAT_48 0 - -/* Demonstrate special features*/ -#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /* [12KB] compressed pixels */ -#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /* [21KB] Hebrew, Arabic, Perisan letters */ -#define LV_FONT_SIMSUN_16_CJK 0 /* [2MB] CJK characters */ - -/*================== - * TEXT ENCODING - *==================*/ +/*================= + * TEXT SETTINGS + *=================*/ -/*Select a character encoding. - * - LV_TEXT_ENC_UTF8 - * - LV_TEXT_ENC_ASCII - * */ -#define LV_TEXT_ENC LV_TEXT_ENC_UTF8 +# define LV_TXT_ENC LV_TXT_ENC_UTF8 +# define LV_TXT_BREAK_CHARS " ,.;:-_" +# define LV_TXT_LINE_BREAK_LONG_LEN 0 +# define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 +# define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 +# define LV_TXT_COLOR_CMD "#" +# define LV_USE_BIDI 0 +# define LV_USE_ARABIC_PERSIAN_CHARS 0 /*================== - * BIDI SETTINGS + * WIDGET USAGE *==================*/ -/*Configure the supported Bidirectional languages. - * - LV_BASE_DIR_LTR: Left-to-Right language - * - LV_BASE_DIR_RTL: Right-to-Left language - * - LV_BASE_DIR_AUTO: Detects the direction automatically - * */ -#define LV_BASE_DIR_LTR LV_DIR_BASE_DIR_LTR +# define LV_USE_ARC 1 +# define LV_USE_BAR 1 +# define LV_USE_BTN 1 +# define LV_USE_BTNMATRIX 1 +# define LV_USE_CANVAS 1 +# define LV_USE_CHECKBOX 1 +# define LV_USE_DROPDOWN 1 +# define LV_USE_IMG 1 +# define LV_USE_LABEL 1 +# if LV_USE_LABEL +# define LV_LABEL_TEXT_SELECTION 1 +# define LV_LABEL_LONG_TXT_HINT 1 +# endif +# define LV_USE_LINE 1 +# define LV_USE_ROLLER 1 +# if LV_USE_ROLLER +# define LV_ROLLER_INF_PAGES 7 +# endif +# define LV_USE_SLIDER 1 +# define LV_USE_SWITCH 1 +# define LV_USE_TEXTAREA 1 +# if LV_USE_TEXTAREA != 0 +# define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 +# endif +# define LV_USE_TABLE 1 /*================== - * USE CUSTOM CONFIG HEADER + * EXTRA COMPONENTS *==================*/ -/* Include custom configuration header if needed */ -/* #define LV_CONF_PATH "path/to/custom/lv_conf.h" */ +# define LV_USE_ANIMIMG 1 +# define LV_USE_CALENDAR 1 +# if LV_USE_CALENDAR +# define LV_CALENDAR_WEEK_STARTS_MONDAY 0 +# if LV_CALENDAR_WEEK_STARTS_MONDAY +# define LV_CALENDAR_DEFAULT_DAY_NAMES \ + { \ + "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su" \ + } +# else +# define LV_CALENDAR_DEFAULT_DAY_NAMES \ + { \ + "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" \ + } +# endif +# define LV_CALENDAR_DEFAULT_MONTH_NAMES \ + { \ + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", \ + "November", "December" \ + } +# define LV_USE_CALENDAR_HEADER_ARROW 1 +# define LV_USE_CALENDAR_HEADER_DROPDOWN 1 +# endif +# define LV_USE_CHART 1 +# define LV_USE_COLORWHEEL 1 +# define LV_USE_IMGBTN 1 +# define LV_USE_KEYBOARD 1 +# define LV_USE_LED 1 +# define LV_USE_LIST 1 +# define LV_USE_MENU 1 +# define LV_USE_METER 1 +# define LV_USE_MSGBOX 1 +# define LV_USE_SPAN 1 +# if LV_USE_SPAN +# define LV_SPAN_SNIPPET_STACK_SIZE 64 +# endif +# define LV_USE_SPINBOX 1 +# define LV_USE_SPINNER 1 +# define LV_USE_TABVIEW 1 +# define LV_USE_TILEVIEW 1 +# define LV_USE_WIN 1 + +/*----------- Themes----------*/ +# define LV_USE_THEME_DEFAULT 1 +# if LV_USE_THEME_DEFAULT +# define LV_THEME_DEFAULT_DARK 0 +# define LV_THEME_DEFAULT_GROW 1 +# define LV_THEME_DEFAULT_TRANSITION_TIME 80 +# endif +# define LV_USE_THEME_BASIC 1 +# define LV_USE_THEME_MONO 1 + +/*----------- Layouts----------*/ +# define LV_USE_FLEX 1 +# define LV_USE_GRID 1 + +/*--------------------- 3rd party libraries--------------------*/ + +# define LV_USE_FS_STDIO 0 +# define LV_USE_FS_POSIX 0 +# define LV_USE_FS_WIN32 0 +# define LV_USE_FS_FATFS 0 +# define LV_USE_FS_LITTLEFS 0 + +# define LV_USE_PNG 1 +# define LV_USE_BMP 1 +# define LV_USE_SJPG 0 +# define LV_USE_GIF 0 +# define LV_USE_QRCODE 1 +# define LV_USE_FREETYPE 0 +# define LV_USE_TINY_TTF 0 +# define LV_USE_RLOTTIE 0 +# define LV_USE_FFMPEG 0 + +/*----------- Others----------*/ +# define LV_USE_SNAPSHOT 1 +# define LV_USE_MONKEY 0 +# define LV_USE_GRIDNAV 0 +# define LV_USE_FRAGMENT 0 +# define LV_USE_IMGFONT 0 +# define LV_USE_MSG 0 +# define LV_USE_IME_PINYIN 0 /*================== - * END OF CONFIGURATION - *==================*/ - -#endif /*LV_CONF_H*/ +* EXAMPLES +*==================*/ +# define LV_BUILD_EXAMPLES 0 + +/*=================== + * DEMO USAGE + ====================*/ +# define LV_USE_DEMO_WIDGETS 0 +# define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 +# define LV_USE_DEMO_BENCHMARK 0 +# define LV_USE_DEMO_STRESS 0 +# define LV_USE_DEMO_MUSIC 0 + +# endif /*LV_CONF_H*/ #endif /*End of "Content enable"*/ diff --git a/L3_Middlewares/LVGL/lv_conf_template.h b/L3_Middlewares/LVGL/lv_conf_template.h index 965d5ba..bed77fb 100644 --- a/L3_Middlewares/LVGL/lv_conf_template.h +++ b/L3_Middlewares/LVGL/lv_conf_template.h @@ -1,6 +1,6 @@ -/** +/** * @file lv_conf.h - * Configuration file for v9.2.3-dev + * Configuration file for v8.3.11 */ /* @@ -17,46 +17,39 @@ #ifndef LV_CONF_H #define LV_CONF_H -/*If you need to include anything here, do it inside the `__ASSEMBLY__` guard */ -#if 0 && defined(__ASSEMBLY__) -#include "my_include.h" -#endif +#include /*==================== COLOR SETTINGS *====================*/ -/*Color depth: 1 (I1), 8 (L8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/ +/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ #define LV_COLOR_DEPTH 16 -/*========================= - STDLIB WRAPPER SETTINGS - *=========================*/ +/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/ +#define LV_COLOR_16_SWAP 0 -/* Possible values - * - LV_STDLIB_BUILTIN: LVGL's built in implementation - * - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc - * - LV_STDLIB_MICROPYTHON: MicroPython implementation - * - LV_STDLIB_RTTHREAD: RT-Thread implementation - * - LV_STDLIB_CUSTOM: Implement the functions externally - */ -#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN -#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN -#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN +/*Enable features to draw on transparent background. + *It's required if opa, and transform_* style properties are used. + *Can be also used if the UI is above another layer, e.g. an OSD menu or video player.*/ +#define LV_COLOR_SCREEN_TRANSP 0 + +/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. + * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ +#define LV_COLOR_MIX_ROUND_OFS 0 -#define LV_STDINT_INCLUDE -#define LV_STDDEF_INCLUDE -#define LV_STDBOOL_INCLUDE -#define LV_INTTYPES_INCLUDE -#define LV_LIMITS_INCLUDE -#define LV_STDARG_INCLUDE +/*Images pixels with this color will not be drawn if they are chroma keyed)*/ +#define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/ -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN - /*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/ - #define LV_MEM_SIZE (64 * 1024U) /*[bytes]*/ +/*========================= + MEMORY SETTINGS + *=========================*/ - /*Size of the memory expand for `lv_malloc()` in bytes*/ - #define LV_MEM_POOL_EXPAND_SIZE 0 +/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/ +#define LV_MEM_CUSTOM 0 +#if LV_MEM_CUSTOM == 0 + /*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ + #define LV_MEM_SIZE (48U * 1024U) /*[bytes]*/ /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ #define LV_MEM_ADR 0 /*0: unused*/ @@ -65,211 +58,173 @@ #undef LV_MEM_POOL_INCLUDE #undef LV_MEM_POOL_ALLOC #endif -#endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/ + +#else /*LV_MEM_CUSTOM*/ + #define LV_MEM_CUSTOM_INCLUDE /*Header for the dynamic memory function*/ + #define LV_MEM_CUSTOM_ALLOC malloc + #define LV_MEM_CUSTOM_FREE free + #define LV_MEM_CUSTOM_REALLOC realloc +#endif /*LV_MEM_CUSTOM*/ + +/*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms. + *You will see an error log message if there wasn't enough buffers. */ +#define LV_MEM_BUF_MAX_NUM 16 + +/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/ +#define LV_MEMCPY_MEMSET_STD 0 /*==================== HAL SETTINGS *====================*/ -/*Default display refresh, input device read and animation step period.*/ -#define LV_DEF_REFR_PERIOD 33 /*[ms]*/ +/*Default display refresh period. LVG will redraw changed areas with this period time*/ +#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/ + +/*Input device read period in milliseconds*/ +#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/ + +/*Use a custom tick source that tells the elapsed time in milliseconds. + *It removes the need to manually update the tick with `lv_tick_inc()`)*/ +#define LV_TICK_CUSTOM 0 +#if LV_TICK_CUSTOM + #define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ + #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ + /*If using lvgl as ESP32 component*/ + // #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h" + // #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL)) +#endif /*LV_TICK_CUSTOM*/ /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. *(Not so important, you can adjust it to modify default sizes and spaces)*/ #define LV_DPI_DEF 130 /*[px/inch]*/ -/*================= - * OPERATING SYSTEM - *=================*/ -/*Select an operating system to use. Possible options: - * - LV_OS_NONE - * - LV_OS_PTHREAD - * - LV_OS_FREERTOS - * - LV_OS_CMSIS_RTOS2 - * - LV_OS_RTTHREAD - * - LV_OS_WINDOWS - * - LV_OS_MQX - * - LV_OS_CUSTOM */ -#define LV_USE_OS LV_OS_NONE - -#if LV_USE_OS == LV_OS_CUSTOM - #define LV_OS_CUSTOM_INCLUDE -#endif -#if LV_USE_OS == LV_OS_FREERTOS - /* - * Unblocking an RTOS task with a direct notification is 45% faster and uses less RAM - * than unblocking a task using an intermediary object such as a binary semaphore. - * RTOS task notifications can only be used when there is only one task that can be the recipient of the event. - */ - #define LV_USE_FREERTOS_TASK_NOTIFY 1 -#endif - -/*======================== - * RENDERING CONFIGURATION - *========================*/ - -/*Align the stride of all layers and images to this bytes*/ -#define LV_DRAW_BUF_STRIDE_ALIGN 1 +/*======================= + * FEATURE CONFIGURATION + *=======================*/ -/*Align the start address of draw_buf addresses to this bytes*/ -#define LV_DRAW_BUF_ALIGN 4 +/*------------- + * Drawing + *-----------*/ -/*Using matrix for transformations. - *Requirements: - `LV_USE_MATRIX = 1`. - The rendering engine needs to support 3x3 matrix transformations.*/ -#define LV_DRAW_TRANSFORM_USE_MATRIX 0 +/*Enable complex draw engine. + *Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/ +#define LV_DRAW_COMPLEX 1 +#if LV_DRAW_COMPLEX != 0 -/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode - * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. - * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers - * and can't be drawn in chunks. */ + /*Allow buffering some shadow calculation. + *LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` + *Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/ + #define LV_SHADOW_CACHE_SIZE 0 -/*The target buffer size for simple layer chunks.*/ -#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ + /* Set number of maximally cached circle data. + * The circumference of 1/4 circle are saved for anti-aliasing + * radius * 4 bytes are used per circle (the most often used radiuses are saved) + * 0: to disable caching */ + #define LV_CIRCLE_CACHE_SIZE 4 +#endif /*LV_DRAW_COMPLEX*/ -/* The stack size of the drawing thread. - * NOTE: If FreeType or ThorVG is enabled, it is recommended to set it to 32KB or more. +/** + * "Simple layers" are used when a widget has `style_opa < 255` to buffer the widget into a layer + * and blend it as an image with the given opacity. + * Note that `bg_opa`, `text_opa` etc don't require buffering into layer) + * The widget can be buffered in smaller chunks to avoid using large buffers. + * + * - LV_LAYER_SIMPLE_BUF_SIZE: [bytes] the optimal target buffer size. LVGL will try to allocate it + * - LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE: [bytes] used if `LV_LAYER_SIMPLE_BUF_SIZE` couldn't be allocated. + * + * Both buffer sizes are in bytes. + * "Transformed layers" (where transform_angle/zoom properties are used) use larger buffers + * and can't be drawn in chunks. So these settings affects only widgets with opacity. */ -#define LV_DRAW_THREAD_STACK_SIZE (8 * 1024) /*[bytes]*/ - -#define LV_USE_DRAW_SW 1 -#if LV_USE_DRAW_SW == 1 - - /* - * Selectively disable color format support in order to reduce code size. - * NOTE: some features use certain color formats internally, e.g. - * - gradients use RGB888 - * - bitmaps with transparency may use ARGB8888 - */ - - #define LV_DRAW_SW_SUPPORT_RGB565 1 - #define LV_DRAW_SW_SUPPORT_RGB565A8 1 - #define LV_DRAW_SW_SUPPORT_RGB888 1 - #define LV_DRAW_SW_SUPPORT_XRGB8888 1 - #define LV_DRAW_SW_SUPPORT_ARGB8888 1 - #define LV_DRAW_SW_SUPPORT_L8 1 - #define LV_DRAW_SW_SUPPORT_AL88 1 - #define LV_DRAW_SW_SUPPORT_A8 1 - #define LV_DRAW_SW_SUPPORT_I1 1 - - /* Set the number of draw unit. - * > 1 requires an operating system enabled in `LV_USE_OS` - * > 1 means multiple threads will render the screen in parallel */ - #define LV_DRAW_SW_DRAW_UNIT_CNT 1 - - /* Use Arm-2D to accelerate the sw render */ - #define LV_USE_DRAW_ARM2D_SYNC 0 - - /* Enable native helium assembly to be compiled */ - #define LV_USE_NATIVE_HELIUM_ASM 0 - - /* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only - * 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */ - #define LV_DRAW_SW_COMPLEX 1 - - #if LV_DRAW_SW_COMPLEX == 1 - /*Allow buffering some shadow calculation. - *LV_DRAW_SW_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` - *Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost*/ - #define LV_DRAW_SW_SHADOW_CACHE_SIZE 0 - - /* Set number of maximally cached circle data. - * The circumference of 1/4 circle are saved for anti-aliasing - * radius * 4 bytes are used per circle (the most often used radiuses are saved) - * 0: to disable caching */ - #define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4 - #endif - - #define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE - - #if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM - #define LV_DRAW_SW_ASM_CUSTOM_INCLUDE "" - #endif - - /* Enable drawing complex gradients in software: linear at an angle, radial or conical */ - #define LV_USE_DRAW_SW_COMPLEX_GRADIENTS 0 -#endif +#define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024) +#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (3 * 1024) -/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */ -#define LV_USE_DRAW_VGLITE 0 +/*Default image cache size. Image caching keeps the images opened. + *If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added) + *With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. + *However the opened images might consume additional RAM. + *0: to disable caching*/ +#define LV_IMG_CACHE_DEF_SIZE 0 -#if LV_USE_DRAW_VGLITE - /* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */ - #define LV_USE_VGLITE_BLIT_SPLIT 0 +/*Number of stops allowed per gradient. Increase this to allow more stops. + *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ +#define LV_GRADIENT_MAX_STOPS 2 + +/*Default gradient buffer size. + *When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again. + *LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes. + *If the cache is too small the map will be allocated only while it's required for the drawing. + *0 mean no caching.*/ +#define LV_GRAD_CACHE_DEF_SIZE 0 + +/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display) + *LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface + *The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */ +#define LV_DITHER_GRADIENT 0 +#if LV_DITHER_GRADIENT + /*Add support for error diffusion dithering. + *Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing. + *The increase in memory consumption is (24 bits * object's width)*/ + #define LV_DITHER_ERROR_DIFFUSION 0 +#endif + +/*Maximum buffer size to allocate for rotation. + *Only used if software rotation is enabled in the display driver.*/ +#define LV_DISP_ROT_MAX_BUF (10*1024) - #if LV_USE_OS - /* Use additional draw thread for VG-Lite processing.*/ - #define LV_USE_VGLITE_DRAW_THREAD 1 +/*------------- + * GPU + *-----------*/ - #if LV_USE_VGLITE_DRAW_THREAD - /* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */ - #define LV_USE_VGLITE_DRAW_ASYNC 1 - #endif - #endif +/*Use Arm's 2D acceleration library Arm-2D */ +#define LV_USE_GPU_ARM2D 0 - /* Enable VGLite asserts. */ - #define LV_USE_VGLITE_ASSERT 0 +/*Use STM32's DMA2D (aka Chrom Art) GPU*/ +#define LV_USE_GPU_STM32_DMA2D 0 +#if LV_USE_GPU_STM32_DMA2D + /*Must be defined to include path of CMSIS header of target processor + e.g. "stm32f7xx.h" or "stm32f4xx.h"*/ + #define LV_GPU_DMA2D_CMSIS_INCLUDE #endif -/* Use NXP's PXP on iMX RTxxx platforms. */ -#define LV_USE_PXP 0 - -#if LV_USE_PXP - /* Use PXP for drawing.*/ - #define LV_USE_DRAW_PXP 1 - - /* Use PXP to rotate display.*/ - #define LV_USE_ROTATE_PXP 0 - - #if LV_USE_DRAW_PXP && LV_USE_OS - /* Use additional draw thread for PXP processing.*/ - #define LV_USE_PXP_DRAW_THREAD 1 - #endif - - /* Enable PXP asserts. */ - #define LV_USE_PXP_ASSERT 0 +/*Enable RA6M3 G2D GPU*/ +#define LV_USE_GPU_RA6M3_G2D 0 +#if LV_USE_GPU_RA6M3_G2D + /*include path of target processor + e.g. "hal_data.h"*/ + #define LV_GPU_RA6M3_G2D_INCLUDE "hal_data.h" #endif -/* Use Renesas Dave2D on RA platforms. */ -#define LV_USE_DRAW_DAVE2D 0 - -/* Draw using cached SDL textures*/ -#define LV_USE_DRAW_SDL 0 - -/* Use VG-Lite GPU. */ -#define LV_USE_DRAW_VG_LITE 0 - -#if LV_USE_DRAW_VG_LITE - /* Enable VG-Lite custom external 'gpu_init()' function */ - #define LV_VG_LITE_USE_GPU_INIT 0 - - /* Enable VG-Lite assert. */ - #define LV_VG_LITE_USE_ASSERT 0 - - /* VG-Lite flush commit trigger threshold. GPU will try to batch these many draw tasks. */ - #define LV_VG_LITE_FLUSH_MAX_COUNT 8 - - /* Enable border to simulate shadow - * NOTE: which usually improves performance, - * but does not guarantee the same rendering quality as the software. */ - #define LV_VG_LITE_USE_BOX_SHADOW 0 +/*Use SWM341's DMA2D GPU*/ +#define LV_USE_GPU_SWM341_DMA2D 0 +#if LV_USE_GPU_SWM341_DMA2D + #define LV_GPU_SWM341_DMA2D_INCLUDE "SWM341.h" +#endif - /* VG-Lite gradient maximum cache number. - * NOTE: The memory usage of a single gradient image is 4K bytes. - */ - #define LV_VG_LITE_GRAD_CACHE_CNT 32 +/*Use NXP's PXP GPU iMX RTxxx platforms*/ +#define LV_USE_GPU_NXP_PXP 0 +#if LV_USE_GPU_NXP_PXP + /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) + * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS + * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. + *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() + */ + #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 +#endif - /* VG-Lite stroke maximum cache number. - */ - #define LV_VG_LITE_STROKE_CACHE_CNT 32 +/*Use NXP's VG-Lite GPU iMX RTxxx platforms*/ +#define LV_USE_GPU_NXP_VG_LITE 0 +/*Use SDL renderer API*/ +#define LV_USE_GPU_SDL 0 +#if LV_USE_GPU_SDL + #define LV_GPU_SDL_INCLUDE_PATH + /*Texture cache size, 8MB by default*/ + #define LV_GPU_SDL_LRU_SIZE (1024 * 1024 * 8) + /*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/ + #define LV_GPU_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6)) #endif -/*======================= - * FEATURE CONFIGURATION - *=======================*/ - /*------------- * Logging *-----------*/ @@ -291,20 +246,6 @@ *0: User need to register a callback with `lv_log_register_print_cb()`*/ #define LV_LOG_PRINTF 0 - /*Set callback to print the logs. - *E.g `my_print`. The prototype should be `void my_print(lv_log_level_t level, const char * buf)` - *Can be overwritten by `lv_log_register_print_cb`*/ - //#define LV_LOG_PRINT_CB - - /*1: Enable print timestamp; - *0: Disable print timestamp*/ - #define LV_LOG_USE_TIMESTAMP 1 - - /*1: Print file and line number of the log; - *0: Do not print file and line number of the log*/ - #define LV_LOG_USE_FILE_LINE 1 - - /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ #define LV_LOG_TRACE_MEM 1 #define LV_LOG_TRACE_TIMER 1 @@ -314,7 +255,6 @@ #define LV_LOG_TRACE_OBJ_CREATE 1 #define LV_LOG_TRACE_LAYOUT 1 #define LV_LOG_TRACE_ANIM 1 - #define LV_LOG_TRACE_CACHE 1 #endif /*LV_USE_LOG*/ @@ -334,97 +274,44 @@ #define LV_ASSERT_HANDLER_INCLUDE #define LV_ASSERT_HANDLER while(1); /*Halt by default*/ -/*------------- - * Debug - *-----------*/ - -/*1: Draw random colored rectangles over the redrawn areas*/ -#define LV_USE_REFR_DEBUG 0 - -/*1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/ -#define LV_USE_LAYER_DEBUG 0 - -/*1: Draw overlays with different colors for each draw_unit's tasks. - *Also add the index number of the draw unit on white background. - *For layers add the index number of the draw unit on black background.*/ -#define LV_USE_PARALLEL_DRAW_DEBUG 0 - /*------------- * Others *-----------*/ -#define LV_ENABLE_GLOBAL_CUSTOM 0 -#if LV_ENABLE_GLOBAL_CUSTOM - /*Header to include for the custom 'lv_global' function"*/ - #define LV_GLOBAL_CUSTOM_INCLUDE +/*1: Show CPU usage and FPS count*/ +#define LV_USE_PERF_MONITOR 0 +#if LV_USE_PERF_MONITOR + #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT #endif -/*Default cache size in bytes. - *Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory. - *If size is not set to 0, the decoder will fail to decode when the cache is full. - *If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/ -#define LV_CACHE_DEF_SIZE 0 - -/*Default number of image header cache entries. The cache is used to store the headers of images - *The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/ -#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0 - -/*Number of stops allowed per gradient. Increase this to allow more stops. - *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ -#define LV_GRADIENT_MAX_STOPS 2 - -/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. - * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ -#define LV_COLOR_MIX_ROUND_OFS 0 - -/* Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties */ -#define LV_OBJ_STYLE_CACHE 0 - -/* Add `id` field to `lv_obj_t` */ -#define LV_USE_OBJ_ID 0 - -/* Automatically assign an ID when obj is created */ -#define LV_OBJ_ID_AUTO_ASSIGN LV_USE_OBJ_ID - -/*Use the builtin obj ID handler functions: -* - lv_obj_assign_id: Called when a widget is created. Use a separate counter for each widget class as an ID. -* - lv_obj_id_compare: Compare the ID to decide if it matches with a requested value. -* - lv_obj_stringify_id: Return e.g. "button3" -* - lv_obj_free_id: Does nothing, as there is no memory allocation for the ID. -* When disabled these functions needs to be implemented by the user.*/ -#define LV_USE_OBJ_ID_BUILTIN 1 - -/*Use obj property set/get API*/ -#define LV_USE_OBJ_PROPERTY 0 - -/*Enable property name support*/ -#define LV_USE_OBJ_PROPERTY_NAME 1 - -/* VG-Lite Simulator */ -/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */ -#define LV_USE_VG_LITE_THORVG 0 - -#if LV_USE_VG_LITE_THORVG - - /*Enable LVGL's blend mode support*/ - #define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0 - - /*Enable YUV color format support*/ - #define LV_VG_LITE_THORVG_YUV_SUPPORT 0 - - /*Enable Linear gradient extension support*/ - #define LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT 0 - - /*Enable 16 pixels alignment*/ - #define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1 - - /*Buffer address alignment*/ - #define LV_VG_LITE_THORVG_BUF_ADDR_ALIGN 64 +/*1: Show the used memory and the memory fragmentation + * Requires LV_MEM_CUSTOM = 0*/ +#define LV_USE_MEM_MONITOR 0 +#if LV_USE_MEM_MONITOR + #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT +#endif - /*Enable multi-thread render*/ - #define LV_VG_LITE_THORVG_THREAD_RENDER 0 +/*1: Draw random colored rectangles over the redrawn areas*/ +#define LV_USE_REFR_DEBUG 0 -#endif +/*Change the built in (v)snprintf functions*/ +#define LV_SPRINTF_CUSTOM 0 +#if LV_SPRINTF_CUSTOM + #define LV_SPRINTF_INCLUDE + #define lv_snprintf snprintf + #define lv_vsnprintf vsnprintf +#else /*LV_SPRINTF_CUSTOM*/ + #define LV_SPRINTF_USE_FLOAT 0 +#endif /*LV_SPRINTF_CUSTOM*/ + +#define LV_USE_USER_DATA 1 + +/*Garbage Collector settings + *Used if lvgl is bound to higher level language and the memory is managed by that language*/ +#define LV_ENABLE_GC 0 +#if LV_ENABLE_GC != 0 + #define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ +#endif /*LV_ENABLE_GC*/ /*===================== * COMPILER SETTINGS @@ -439,7 +326,7 @@ /*Define a custom attribute to `lv_timer_handler` function*/ #define LV_ATTRIBUTE_TIMER_HANDLER -/*Define a custom attribute to `lv_display_flush_ready` function*/ +/*Define a custom attribute to `lv_disp_flush_ready` function*/ #define LV_ATTRIBUTE_FLUSH_READY /*Required alignment size for buffers*/ @@ -458,22 +345,15 @@ /*Place performance critical functions into a faster memory (e.g RAM)*/ #define LV_ATTRIBUTE_FAST_MEM +/*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/ +#define LV_ATTRIBUTE_DMA + /*Export integer constant to binding. This macro is used with constants in the form of LV_ that - *should also appear on LVGL binding API such as MicroPython.*/ + *should also appear on LVGL binding API such as Micropython.*/ #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ -/*Prefix all global extern data with this*/ -#define LV_ATTRIBUTE_EXTERN_DATA - -/* Use `float` as `lv_value_precise_t` */ -#define LV_USE_FLOAT 0 - -/*Enable matrix support - *Requires `LV_USE_FLOAT = 1`*/ -#define LV_USE_MATRIX 0 - -/*Include `lvgl_private.h` in `lvgl.h` to access internal data and functions by default*/ -#define LV_USE_PRIVATE_API 0 +/*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/ +#define LV_USE_LARGE_COORD 0 /*================== * FONT USAGE @@ -504,9 +384,9 @@ #define LV_FONT_MONTSERRAT_48 0 /*Demonstrate special features*/ +#define LV_FONT_MONTSERRAT_12_SUBPX 0 #define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/ #define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/ -#define LV_FONT_SIMSUN_14_CJK 0 /*1000 most common CJK radicals*/ #define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/ /*Pixel perfect monospace fonts*/ @@ -529,6 +409,13 @@ /*Enables/disables support for compressed fonts.*/ #define LV_USE_FONT_COMPRESSED 0 +/*Enable subpixel rendering*/ +#define LV_USE_FONT_SUBPX 0 +#if LV_USE_FONT_SUBPX + /*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ + #define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ +#endif + /*Enable drawing placeholders when glyph dsc is not found*/ #define LV_USE_FONT_PLACEHOLDER 1 @@ -545,7 +432,7 @@ #define LV_TXT_ENC LV_TXT_ENC_UTF8 /*Can break (wrap) texts on these chars*/ -#define LV_TXT_BREAK_CHARS " ,.;:-_)]}" +#define LV_TXT_BREAK_CHARS " ,.;:-_" /*If a word is at least this long, will break wherever "prettiest" *To disable, set to a value <= 0*/ @@ -559,6 +446,9 @@ *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ #define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 +/*The control character to use for signalling text recoloring.*/ +#define LV_TXT_COLOR_CMD "#" + /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. *The direction will be processed according to the Unicode Bidirectional Algorithm: *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ @@ -572,26 +462,63 @@ #endif /*Enable Arabic/Persian processing - *In these languages characters should be replaced with another form based on their position in the text*/ + *In these languages characters should be replaced with an other form based on their position in the text*/ #define LV_USE_ARABIC_PERSIAN_CHARS 0 /*================== - * WIDGETS + * WIDGET USAGE *================*/ /*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ -#define LV_WIDGETS_HAS_DEFAULT_VALUE 1 - -#define LV_USE_ANIMIMG 1 - #define LV_USE_ARC 1 #define LV_USE_BAR 1 -#define LV_USE_BUTTON 1 +#define LV_USE_BTN 1 + +#define LV_USE_BTNMATRIX 1 + +#define LV_USE_CANVAS 1 + +#define LV_USE_CHECKBOX 1 + +#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ + +#define LV_USE_IMG 1 /*Requires: lv_label*/ + +#define LV_USE_LABEL 1 +#if LV_USE_LABEL + #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ + #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ +#endif + +#define LV_USE_LINE 1 + +#define LV_USE_ROLLER 1 /*Requires: lv_label*/ +#if LV_USE_ROLLER + #define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ +#endif + +#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ + +#define LV_USE_SWITCH 1 -#define LV_USE_BUTTONMATRIX 1 +#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ +#if LV_USE_TEXTAREA != 0 + #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ +#endif + +#define LV_USE_TABLE 1 + +/*================== + * EXTRA COMPONENTS + *==================*/ + +/*----------- + * Widgets + *----------*/ +#define LV_USE_ANIMIMG 1 #define LV_USE_CALENDAR 1 #if LV_USE_CALENDAR @@ -605,47 +532,25 @@ #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} #define LV_USE_CALENDAR_HEADER_ARROW 1 #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 - #define LV_USE_CALENDAR_CHINESE 0 #endif /*LV_USE_CALENDAR*/ -#define LV_USE_CANVAS 1 - #define LV_USE_CHART 1 -#define LV_USE_CHECKBOX 1 - -#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ - -#define LV_USE_IMAGE 1 /*Requires: lv_label*/ +#define LV_USE_COLORWHEEL 1 -#define LV_USE_IMAGEBUTTON 1 +#define LV_USE_IMGBTN 1 #define LV_USE_KEYBOARD 1 -#define LV_USE_LABEL 1 -#if LV_USE_LABEL - #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ - #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ - #define LV_LABEL_WAIT_CHAR_COUNT 3 /*The count of wait chart*/ -#endif - #define LV_USE_LED 1 -#define LV_USE_LINE 1 - #define LV_USE_LIST 1 -#define LV_USE_LOTTIE 0 /*Requires: lv_canvas, thorvg */ - #define LV_USE_MENU 1 -#define LV_USE_MSGBOX 1 - -#define LV_USE_ROLLER 1 /*Requires: lv_label*/ - -#define LV_USE_SCALE 1 +#define LV_USE_METER 1 -#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ +#define LV_USE_MSGBOX 1 #define LV_USE_SPAN 1 #if LV_USE_SPAN @@ -657,24 +562,15 @@ #define LV_USE_SPINNER 1 -#define LV_USE_SWITCH 1 - -#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ -#if LV_USE_TEXTAREA != 0 - #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ -#endif - -#define LV_USE_TABLE 1 - #define LV_USE_TABVIEW 1 #define LV_USE_TILEVIEW 1 #define LV_USE_WIN 1 -/*================== - * THEMES - *==================*/ +/*----------- + * Themes + *----------*/ /*A simple, impressive and very complete theme*/ #define LV_USE_THEME_DEFAULT 1 @@ -691,14 +587,14 @@ #endif /*LV_USE_THEME_DEFAULT*/ /*A very simple theme that is a good starting point for a custom theme*/ -#define LV_USE_THEME_SIMPLE 1 +#define LV_USE_THEME_BASIC 1 /*A theme designed for monochrome displays*/ #define LV_USE_THEME_MONO 1 -/*================== - * LAYOUTS - *==================*/ +/*----------- + * Layouts + *----------*/ /*A layout similar to Flexbox in CSS.*/ #define LV_USE_FLEX 1 @@ -706,15 +602,12 @@ /*A layout similar to Grid in CSS.*/ #define LV_USE_GRID 1 -/*==================== - * 3RD PARTS LIBRARIES - *====================*/ +/*--------------------- + * 3rd party libraries + *--------------------*/ /*File system interfaces for common APIs */ -/*Setting a default driver letter allows skipping the driver prefix in filepaths*/ -#define LV_FS_DEFAULT_DRIVE_LETTER '\0' - /*API for fopen, fread, etc*/ #define LV_USE_FS_STDIO 0 #if LV_USE_FS_STDIO @@ -746,105 +639,56 @@ #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ #endif -/*API for memory-mapped file access. */ -#define LV_USE_FS_MEMFS 0 -#if LV_USE_FS_MEMFS - #define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ -#endif - -/*API for LittleFs. */ +/*API for LittleFS (library needs to be added separately). Uses lfs_file_open, lfs_file_read, etc*/ #define LV_USE_FS_LITTLEFS 0 #if LV_USE_FS_LITTLEFS #define LV_FS_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_LITTLEFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ #endif -/*API for Arduino LittleFs. */ -#define LV_USE_FS_ARDUINO_ESP_LITTLEFS 0 -#if LV_USE_FS_ARDUINO_ESP_LITTLEFS - #define LV_FS_ARDUINO_ESP_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ -#endif - -/*API for Arduino Sd. */ -#define LV_USE_FS_ARDUINO_SD 0 -#if LV_USE_FS_ARDUINO_SD - #define LV_FS_ARDUINO_SD_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ -#endif - -/*LODEPNG decoder library*/ -#define LV_USE_LODEPNG 0 - -/*PNG decoder(libpng) library*/ -#define LV_USE_LIBPNG 0 +/*PNG decoder library*/ +#define LV_USE_PNG 0 /*BMP decoder library*/ #define LV_USE_BMP 0 /* JPG + split JPG decoder library. * Split JPG is a custom format optimized for embedded systems. */ -#define LV_USE_TJPGD 0 - -/* libjpeg-turbo decoder library. - * Supports complete JPEG specifications and high-performance JPEG decoding. */ -#define LV_USE_LIBJPEG_TURBO 0 +#define LV_USE_SJPG 0 /*GIF decoder library*/ #define LV_USE_GIF 0 -#if LV_USE_GIF - /*GIF decoder accelerate*/ - #define LV_GIF_CACHE_DECODE_DATA 0 -#endif - - -/*Decode bin images to RAM*/ -#define LV_BIN_DECODER_RAM_LOAD 0 - -/*RLE decompress library*/ -#define LV_USE_RLE 0 /*QR code library*/ #define LV_USE_QRCODE 0 -/*Barcode code library*/ -#define LV_USE_BARCODE 0 - /*FreeType library*/ #define LV_USE_FREETYPE 0 #if LV_USE_FREETYPE - /*Let FreeType to use LVGL memory and file porting*/ - #define LV_FREETYPE_USE_LVGL_PORT 0 - - /*Cache count of the glyphs in FreeType. It means the number of glyphs that can be cached. - *The higher the value, the more memory will be used.*/ - #define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256 + /*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/ + #define LV_FREETYPE_CACHE_SIZE (16 * 1024) + #if LV_FREETYPE_CACHE_SIZE >= 0 + /* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */ + /* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */ + /* if font size >= 256, must be configured as image cache */ + #define LV_FREETYPE_SBIT_CACHE 0 + /* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */ + /* (0:use system defaults) */ + #define LV_FREETYPE_CACHE_FT_FACES 0 + #define LV_FREETYPE_CACHE_FT_SIZES 0 + #endif #endif -/* Built-in TTF decoder */ +/*Tiny TTF library*/ #define LV_USE_TINY_TTF 0 #if LV_USE_TINY_TTF - /* Enable loading TTF data from files */ + /*Load TTF data from files*/ #define LV_TINY_TTF_FILE_SUPPORT 0 - #define LV_TINY_TTF_CACHE_GLYPH_CNT 256 #endif /*Rlottie library*/ #define LV_USE_RLOTTIE 0 -/*Enable Vector Graphic APIs - *Requires `LV_USE_MATRIX = 1`*/ -#define LV_USE_VECTOR_GRAPHIC 0 - -/* Enable ThorVG (vector graphics library) from the src/libs folder */ -#define LV_USE_THORVG_INTERNAL 0 - -/* Enable ThorVG by assuming that its installed and linked to the project */ -#define LV_USE_THORVG_EXTERNAL 0 - -/*Use lvgl built-in LZ4 lib*/ -#define LV_USE_LZ4_INTERNAL 0 - -/*Use external LZ4 library*/ -#define LV_USE_LZ4_EXTERNAL 0 - /*FFmpeg library for image decoding and playing videos *Supports all major image formats so do not enable other image decoder with it*/ #define LV_USE_FFMPEG 0 @@ -853,65 +697,13 @@ #define LV_FFMPEG_DUMP_FORMAT 0 #endif -/*================== - * OTHERS - *==================*/ +/*----------- + * Others + *----------*/ /*1: Enable API to take snapshot for object*/ #define LV_USE_SNAPSHOT 0 -/*1: Enable system monitor component*/ -#define LV_USE_SYSMON 0 -#if LV_USE_SYSMON - /*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/ - #define LV_SYSMON_GET_IDLE lv_timer_get_idle - - /*1: Show CPU usage and FPS count - * Requires `LV_USE_SYSMON = 1`*/ - #define LV_USE_PERF_MONITOR 0 - #if LV_USE_PERF_MONITOR - #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT - - /*0: Displays performance data on the screen, 1: Prints performance data using log.*/ - #define LV_USE_PERF_MONITOR_LOG_MODE 0 - #endif - - /*1: Show the used memory and the memory fragmentation - * Requires `LV_USE_STDLIB_MALLOC = LV_STDLIB_BUILTIN` - * Requires `LV_USE_SYSMON = 1`*/ - #define LV_USE_MEM_MONITOR 0 - #if LV_USE_MEM_MONITOR - #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT - #endif - -#endif /*LV_USE_SYSMON*/ - -/*1: Enable the runtime performance profiler*/ -#define LV_USE_PROFILER 0 -#if LV_USE_PROFILER - /*1: Enable the built-in profiler*/ - #define LV_USE_PROFILER_BUILTIN 1 - #if LV_USE_PROFILER_BUILTIN - /*Default profiler trace buffer size*/ - #define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /*[bytes]*/ - #endif - - /*Header to include for the profiler*/ - #define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h" - - /*Profiler start point function*/ - #define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN - - /*Profiler end point function*/ - #define LV_PROFILER_END LV_PROFILER_BUILTIN_END - - /*Profiler start point function with custom tag*/ - #define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG - - /*Profiler end point function with custom tag*/ - #define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG -#endif - /*1: Enable Monkey test*/ #define LV_USE_MONKEY 0 @@ -924,15 +716,15 @@ /*1: Support using images as font in label or span widgets */ #define LV_USE_IMGFONT 0 -/*1: Enable an observer pattern implementation*/ -#define LV_USE_OBSERVER 1 +/*1: Enable a published subscriber based messaging system */ +#define LV_USE_MSG 0 /*1: Enable Pinyin input method*/ /*Requires: lv_keyboard*/ #define LV_USE_IME_PINYIN 0 #if LV_USE_IME_PINYIN /*1: Use default thesaurus*/ - /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesaurus*/ + /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/ #define LV_IME_PINYIN_USE_DEFAULT_DICT 1 /*Set the maximum number of candidate panels that can be displayed*/ /*This needs to be adjusted according to the size of the screen*/ @@ -942,131 +734,7 @@ #define LV_IME_PINYIN_USE_K9_MODE 1 #if LV_IME_PINYIN_USE_K9_MODE == 1 #define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3 - #endif /*LV_IME_PINYIN_USE_K9_MODE*/ -#endif - -/*1: Enable file explorer*/ -/*Requires: lv_table*/ -#define LV_USE_FILE_EXPLORER 0 -#if LV_USE_FILE_EXPLORER - /*Maximum length of path*/ - #define LV_FILE_EXPLORER_PATH_MAX_LEN (128) - /*Quick access bar, 1:use, 0:not use*/ - /*Requires: lv_list*/ - #define LV_FILE_EXPLORER_QUICK_ACCESS 1 -#endif - -/*================== - * DEVICES - *==================*/ - -/*Use SDL to open window on PC and handle mouse and keyboard*/ -#define LV_USE_SDL 0 -#if LV_USE_SDL - #define LV_SDL_INCLUDE_PATH - #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/ - #define LV_SDL_BUF_COUNT 1 /*1 or 2*/ - #define LV_SDL_ACCELERATED 1 /*1: Use hardware acceleration*/ - #define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/ - #define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/ - #define LV_SDL_MOUSEWHEEL_MODE LV_SDL_MOUSEWHEEL_MODE_ENCODER /*LV_SDL_MOUSEWHEEL_MODE_ENCODER/CROWN*/ -#endif - -/*Use X11 to open window on Linux desktop and handle mouse and keyboard*/ -#define LV_USE_X11 0 -#if LV_USE_X11 - #define LV_X11_DIRECT_EXIT 1 /*Exit the application when all X11 windows have been closed*/ - #define LV_X11_DOUBLE_BUFFER 1 /*Use double buffers for rendering*/ - /*select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!)*/ - #define LV_X11_RENDER_MODE_PARTIAL 1 /*Partial render mode (preferred)*/ - #define LV_X11_RENDER_MODE_DIRECT 0 /*direct render mode*/ - #define LV_X11_RENDER_MODE_FULL 0 /*Full render mode*/ -#endif - -/*Use Wayland to open a window and handle input on Linux or BSD desktops */ -#define LV_USE_WAYLAND 0 -#if LV_USE_WAYLAND - #define LV_WAYLAND_WINDOW_DECORATIONS 0 /*Draw client side window decorations only necessary on Mutter/GNOME*/ - #define LV_WAYLAND_WL_SHELL 0 /*Use the legacy wl_shell protocol instead of the default XDG shell*/ -#endif - -/*Driver for /dev/fb*/ -#define LV_USE_LINUX_FBDEV 0 -#if LV_USE_LINUX_FBDEV - #define LV_LINUX_FBDEV_BSD 0 - #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL - #define LV_LINUX_FBDEV_BUFFER_COUNT 0 - #define LV_LINUX_FBDEV_BUFFER_SIZE 60 -#endif - -/*Use Nuttx to open window and handle touchscreen*/ -#define LV_USE_NUTTX 0 - -#if LV_USE_NUTTX - #define LV_USE_NUTTX_LIBUV 0 - - /*Use Nuttx custom init API to open window and handle touchscreen*/ - #define LV_USE_NUTTX_CUSTOM_INIT 0 - - /*Driver for /dev/lcd*/ - #define LV_USE_NUTTX_LCD 0 - #if LV_USE_NUTTX_LCD - #define LV_NUTTX_LCD_BUFFER_COUNT 0 - #define LV_NUTTX_LCD_BUFFER_SIZE 60 - #endif - - /*Driver for /dev/input*/ - #define LV_USE_NUTTX_TOUCHSCREEN 0 - -#endif - -/*Driver for /dev/dri/card*/ -#define LV_USE_LINUX_DRM 0 - -/*Interface for TFT_eSPI*/ -#define LV_USE_TFT_ESPI 0 - -/*Driver for evdev input devices*/ -#define LV_USE_EVDEV 0 - -/*Driver for libinput input devices*/ -#define LV_USE_LIBINPUT 0 - -#if LV_USE_LIBINPUT - #define LV_LIBINPUT_BSD 0 - - /*Full keyboard support*/ - #define LV_LIBINPUT_XKB 0 - #if LV_LIBINPUT_XKB - /*"setxkbmap -query" can help find the right values for your keyboard*/ - #define LV_LIBINPUT_XKB_KEY_MAP { .rules = NULL, .model = "pc101", .layout = "us", .variant = NULL, .options = NULL } - #endif -#endif - -/*Drivers for LCD devices connected via SPI/parallel port*/ -#define LV_USE_ST7735 0 -#define LV_USE_ST7789 0 -#define LV_USE_ST7796 0 -#define LV_USE_ILI9341 0 - -#define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341) - -/*Driver for Renesas GLCD*/ -#define LV_USE_RENESAS_GLCDC 0 - -/* LVGL Windows backend */ -#define LV_USE_WINDOWS 0 - -/* Use OpenGL to open window on PC and handle mouse and keyboard */ -#define LV_USE_OPENGLES 0 -#if LV_USE_OPENGLES - #define LV_USE_OPENGLES_DEBUG 1 /* Enable or disable debug for opengles */ -#endif - -/* QNX Screen display and input drivers */ -#define LV_USE_QNX 0 -#if LV_USE_QNX - #define LV_QNX_BUF_COUNT 1 /*1 or 2*/ + #endif // LV_IME_PINYIN_USE_K9_MODE #endif /*================== @@ -1082,15 +750,19 @@ /*Show some widget. It might be required to increase `LV_MEM_SIZE` */ #define LV_USE_DEMO_WIDGETS 0 +#if LV_USE_DEMO_WIDGETS +#define LV_DEMO_WIDGETS_SLIDESHOW 0 +#endif /*Demonstrate the usage of encoder and keyboard*/ #define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 /*Benchmark your system*/ #define LV_USE_DEMO_BENCHMARK 0 - -/*Render test for each primitives. Requires at least 480x272 display*/ -#define LV_USE_DEMO_RENDER 0 +#if LV_USE_DEMO_BENCHMARK +/*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/ +#define LV_DEMO_BENCHMARK_RGB565A8 0 +#endif /*Stress test for LVGL*/ #define LV_USE_DEMO_STRESS 0 @@ -1105,21 +777,6 @@ #define LV_DEMO_MUSIC_AUTO_PLAY 0 #endif -/*Flex layout demo*/ -#define LV_USE_DEMO_FLEX_LAYOUT 0 - -/*Smart-phone like multi-language demo*/ -#define LV_USE_DEMO_MULTILANG 0 - -/*Widget transformation demo*/ -#define LV_USE_DEMO_TRANSFORM 0 - -/*Demonstrate scroll settings*/ -#define LV_USE_DEMO_SCROLL 0 - -/*Vector graphic demo*/ -#define LV_USE_DEMO_VECTOR_GRAPHIC 0 - /*--END OF LV_CONF_H--*/ #endif /*LV_CONF_H*/ diff --git a/L3_Middlewares/LVGL/lv_version.h b/L3_Middlewares/LVGL/lv_version.h deleted file mode 100644 index 98416cc..0000000 --- a/L3_Middlewares/LVGL/lv_version.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @file lv_version.h - * The current version of LVGL - */ - -#ifndef LVGL_VERSION_H -#define LVGL_VERSION_H - -#define LVGL_VERSION_MAJOR 9 -#define LVGL_VERSION_MINOR 2 -#define LVGL_VERSION_PATCH 3 -#define LVGL_VERSION_INFO "dev" - -#endif /* LVGL_VERSION_H */ diff --git a/L3_Middlewares/LVGL/lv_version.h.in b/L3_Middlewares/LVGL/lv_version.h.in deleted file mode 100644 index cad0daa..0000000 --- a/L3_Middlewares/LVGL/lv_version.h.in +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @file version.h - * The current version of LVGL - */ - -#ifndef LVGL_VERSION_H -#define LVGL_VERSION_H - -#define LVGL_VERSION_MAJOR @LVGL_VERSION_MAJOR@ -#define LVGL_VERSION_MINOR @LVGL_VERSION_MINOR@ -#define LVGL_VERSION_PATCH @LVGL_VERSION_PATCH@ -#define LVGL_VERSION_INFO "@LVGL_VERSION_INFO@" - -#endif /*LVGL_VERSION_H*/ diff --git a/L3_Middlewares/LVGL/lvgl.h b/L3_Middlewares/LVGL/lvgl.h index df6140e..47700d4 100644 --- a/L3_Middlewares/LVGL/lvgl.h +++ b/L3_Middlewares/LVGL/lvgl.h @@ -13,116 +13,60 @@ extern "C" { /*************************** * CURRENT VERSION OF LVGL ***************************/ -#include "lv_version.h" +#define LVGL_VERSION_MAJOR 8 +#define LVGL_VERSION_MINOR 3 +#define LVGL_VERSION_PATCH 11 +#define LVGL_VERSION_INFO "" /********************* * INCLUDES *********************/ -#include "src/lv_init.h" - -#include "src/stdlib/lv_mem.h" -#include "src/stdlib/lv_string.h" -#include "src/stdlib/lv_sprintf.h" #include "src/misc/lv_log.h" #include "src/misc/lv_timer.h" #include "src/misc/lv_math.h" -#include "src/misc/lv_array.h" +#include "src/misc/lv_mem.h" #include "src/misc/lv_async.h" #include "src/misc/lv_anim_timeline.h" -#include "src/misc/lv_profiler_builtin.h" -#include "src/misc/lv_rb.h" -#include "src/misc/lv_utils.h" +#include "src/misc/lv_printf.h" -#include "src/tick/lv_tick.h" +#include "src/hal/lv_hal.h" #include "src/core/lv_obj.h" #include "src/core/lv_group.h" -#include "src/indev/lv_indev.h" +#include "src/core/lv_indev.h" #include "src/core/lv_refr.h" -#include "src/display/lv_display.h" +#include "src/core/lv_disp.h" +#include "src/core/lv_theme.h" #include "src/font/lv_font.h" -#include "src/font/lv_binfont_loader.h" +#include "src/font/lv_font_loader.h" #include "src/font/lv_font_fmt_txt.h" -#include "src/widgets/animimage/lv_animimage.h" -#include "src/widgets/arc/lv_arc.h" -#include "src/widgets/bar/lv_bar.h" -#include "src/widgets/button/lv_button.h" -#include "src/widgets/buttonmatrix/lv_buttonmatrix.h" -#include "src/widgets/calendar/lv_calendar.h" -#include "src/widgets/canvas/lv_canvas.h" -#include "src/widgets/chart/lv_chart.h" -#include "src/widgets/checkbox/lv_checkbox.h" -#include "src/widgets/dropdown/lv_dropdown.h" -#include "src/widgets/image/lv_image.h" -#include "src/widgets/imagebutton/lv_imagebutton.h" -#include "src/widgets/keyboard/lv_keyboard.h" -#include "src/widgets/label/lv_label.h" -#include "src/widgets/led/lv_led.h" -#include "src/widgets/line/lv_line.h" -#include "src/widgets/list/lv_list.h" -#include "src/widgets/lottie/lv_lottie.h" -#include "src/widgets/menu/lv_menu.h" -#include "src/widgets/msgbox/lv_msgbox.h" -#include "src/widgets/roller/lv_roller.h" -#include "src/widgets/scale/lv_scale.h" -#include "src/widgets/slider/lv_slider.h" -#include "src/widgets/span/lv_span.h" -#include "src/widgets/spinbox/lv_spinbox.h" -#include "src/widgets/spinner/lv_spinner.h" -#include "src/widgets/switch/lv_switch.h" -#include "src/widgets/table/lv_table.h" -#include "src/widgets/tabview/lv_tabview.h" -#include "src/widgets/textarea/lv_textarea.h" -#include "src/widgets/tileview/lv_tileview.h" -#include "src/widgets/win/lv_win.h" - -#include "src/others/snapshot/lv_snapshot.h" -#include "src/others/sysmon/lv_sysmon.h" -#include "src/others/monkey/lv_monkey.h" -#include "src/others/gridnav/lv_gridnav.h" -#include "src/others/fragment/lv_fragment.h" -#include "src/others/imgfont/lv_imgfont.h" -#include "src/others/observer/lv_observer.h" -#include "src/others/ime/lv_ime_pinyin.h" -#include "src/others/file_explorer/lv_file_explorer.h" - -#include "src/libs/barcode/lv_barcode.h" -#include "src/libs/bin_decoder/lv_bin_decoder.h" -#include "src/libs/bmp/lv_bmp.h" -#include "src/libs/rle/lv_rle.h" -#include "src/libs/fsdrv/lv_fsdrv.h" -#include "src/libs/lodepng/lv_lodepng.h" -#include "src/libs/libpng/lv_libpng.h" -#include "src/libs/gif/lv_gif.h" -#include "src/libs/qrcode/lv_qrcode.h" -#include "src/libs/tjpgd/lv_tjpgd.h" -#include "src/libs/libjpeg_turbo/lv_libjpeg_turbo.h" -#include "src/libs/freetype/lv_freetype.h" -#include "src/libs/rlottie/lv_rlottie.h" -#include "src/libs/ffmpeg/lv_ffmpeg.h" -#include "src/libs/tiny_ttf/lv_tiny_ttf.h" - -#include "src/layouts/lv_layout.h" +#include "src/widgets/lv_arc.h" +#include "src/widgets/lv_btn.h" +#include "src/widgets/lv_img.h" +#include "src/widgets/lv_label.h" +#include "src/widgets/lv_line.h" +#include "src/widgets/lv_table.h" +#include "src/widgets/lv_checkbox.h" +#include "src/widgets/lv_bar.h" +#include "src/widgets/lv_slider.h" +#include "src/widgets/lv_btnmatrix.h" +#include "src/widgets/lv_dropdown.h" +#include "src/widgets/lv_roller.h" +#include "src/widgets/lv_textarea.h" +#include "src/widgets/lv_canvas.h" +#include "src/widgets/lv_switch.h" #include "src/draw/lv_draw.h" -#include "src/draw/lv_draw_buf.h" -#include "src/draw/lv_draw_vector.h" -#include "src/draw/sw/lv_draw_sw.h" - -#include "src/themes/lv_theme.h" -#include "src/drivers/lv_drivers.h" +#include "src/lv_api_map.h" -#include "src/lv_api_map_v8.h" -#include "src/lv_api_map_v9_0.h" -#include "src/lv_api_map_v9_1.h" - -#if LV_USE_PRIVATE_API -#include "src/lvgl_private.h" -#endif +/*----------------- + * EXTRAS + *----------------*/ +#include "src/extra/lv_extra.h" /********************* * DEFINES @@ -182,7 +126,7 @@ static inline int lv_version_patch(void) return LVGL_VERSION_PATCH; } -static inline const char * lv_version_info(void) +static inline const char *lv_version_info(void) { return LVGL_VERSION_INFO; } diff --git a/L3_Middlewares/LVGL/src/core/lv_core.mk b/L3_Middlewares/LVGL/src/core/lv_core.mk new file mode 100644 index 0000000..677a9f6 --- /dev/null +++ b/L3_Middlewares/LVGL/src/core/lv_core.mk @@ -0,0 +1,20 @@ +CSRCS += lv_disp.c +CSRCS += lv_group.c +CSRCS += lv_indev.c +CSRCS += lv_indev_scroll.c +CSRCS += lv_obj.c +CSRCS += lv_obj_class.c +CSRCS += lv_obj_draw.c +CSRCS += lv_obj_pos.c +CSRCS += lv_obj_scroll.c +CSRCS += lv_obj_style.c +CSRCS += lv_obj_style_gen.c +CSRCS += lv_obj_tree.c +CSRCS += lv_event.c +CSRCS += lv_refr.c +CSRCS += lv_theme.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/core +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/core + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/core" diff --git a/L3_Middlewares/LVGL/src/core/lv_disp.c b/L3_Middlewares/LVGL/src/core/lv_disp.c new file mode 100644 index 0000000..cacade5 --- /dev/null +++ b/L3_Middlewares/LVGL/src/core/lv_disp.c @@ -0,0 +1,539 @@ +/** + * @file lv_disp.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_disp.h" +#include "../misc/lv_math.h" +#include "../core/lv_refr.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void scr_load_internal(lv_obj_t * scr); +static void scr_load_anim_start(lv_anim_t * a); +static void opa_scale_anim(void * obj, int32_t v); +static void set_x_anim(void * obj, int32_t v); +static void set_y_anim(void * obj, int32_t v); +static void scr_anim_ready(lv_anim_t * a); +static bool is_out_anim(lv_scr_load_anim_t a); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Return with a pointer to the active screen + * @param disp pointer to display which active screen should be get. (NULL to use the default + * screen) + * @return pointer to the active screen object (loaded by 'lv_scr_load()') + */ +lv_obj_t * lv_disp_get_scr_act(lv_disp_t * disp) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("no display registered to get its active screen"); + return NULL; + } + + return disp->act_scr; +} + +/** + * Return with a pointer to the previous screen. Only used during screen transitions. + * @param disp pointer to display which previous screen should be get. (NULL to use the default + * screen) + * @return pointer to the previous screen object or NULL if not used now + */ +lv_obj_t * lv_disp_get_scr_prev(lv_disp_t * disp) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("no display registered to get its previous screen"); + return NULL; + } + + return disp->prev_scr; +} + +/** + * Make a screen active + * @param scr pointer to a screen + */ +void lv_disp_load_scr(lv_obj_t * scr) +{ + lv_scr_load_anim(scr, LV_SCR_LOAD_ANIM_NONE, 0, 0, false); +} + +/** + * Return with the top layer. (Same on every screen and it is above the normal screen layer) + * @param disp pointer to display which top layer should be get. (NULL to use the default screen) + * @return pointer to the top layer object (transparent screen sized lv_obj) + */ +lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("lv_layer_top: no display registered to get its top layer"); + return NULL; + } + + return disp->top_layer; +} + +/** + * Return with the sys. layer. (Same on every screen and it is above the normal screen and the top + * layer) + * @param disp pointer to display which sys. layer should be retrieved. (NULL to use the default screen) + * @return pointer to the sys layer object (transparent screen sized lv_obj) + */ +lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("lv_layer_sys: no display registered to get its sys. layer"); + return NULL; + } + + return disp->sys_layer; +} + +/** + * Set the theme of a display + * @param disp pointer to a display + */ +void lv_disp_set_theme(lv_disp_t * disp, lv_theme_t * th) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("no display registered"); + return; + } + + disp->theme = th; + + if(disp->screen_cnt == 3 && + lv_obj_get_child_cnt(disp->screens[0]) == 0 && + lv_obj_get_child_cnt(disp->screens[1]) == 0 && + lv_obj_get_child_cnt(disp->screens[2]) == 0) { + lv_theme_apply(disp->screens[0]); + } +} +/** + * Get the theme of a display + * @param disp pointer to a display + * @return the display's theme (can be NULL) + */ +lv_theme_t * lv_disp_get_theme(lv_disp_t * disp) +{ + if(disp == NULL) disp = lv_disp_get_default(); + return disp->theme; +} + +/** + * Set the background color of a display + * @param disp pointer to a display + * @param color color of the background + */ +void lv_disp_set_bg_color(lv_disp_t * disp, lv_color_t color) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("no display registered"); + return; + } + + disp->bg_color = color; + + lv_area_t a; + lv_area_set(&a, 0, 0, lv_disp_get_hor_res(disp) - 1, lv_disp_get_ver_res(disp) - 1); + _lv_inv_area(disp, &a); + +} + +/** + * Set the background image of a display + * @param disp pointer to a display + * @param img_src path to file or pointer to an `lv_img_dsc_t` variable + */ +void lv_disp_set_bg_image(lv_disp_t * disp, const void * img_src) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("no display registered"); + return; + } + + disp->bg_img = img_src; + + lv_area_t a; + lv_area_set(&a, 0, 0, lv_disp_get_hor_res(disp) - 1, lv_disp_get_ver_res(disp) - 1); + _lv_inv_area(disp, &a); +} + +/** + * Set opacity of the background + * @param disp pointer to a display + * @param opa opacity (0..255) + */ +void lv_disp_set_bg_opa(lv_disp_t * disp, lv_opa_t opa) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("no display registered"); + return; + } + + disp->bg_opa = opa; + + lv_area_t a; + lv_area_set(&a, 0, 0, lv_disp_get_hor_res(disp) - 1, lv_disp_get_ver_res(disp) - 1); + _lv_inv_area(disp, &a); +} + +/** + * Switch screen with animation + * @param scr pointer to the new screen to load + * @param anim_type type of the animation from `lv_scr_load_anim_t`, e.g. `LV_SCR_LOAD_ANIM_MOVE_LEFT` + * @param time time of the animation + * @param delay delay before the transition + * @param auto_del true: automatically delete the old screen + */ +void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del) +{ + + lv_disp_t * d = lv_obj_get_disp(new_scr); + lv_obj_t * act_scr = lv_scr_act(); + + if(act_scr == new_scr || d->scr_to_load == new_scr) { + return; + } + + /*If an other screen load animation is in progress + *make target screen loaded immediately. */ + if(d->scr_to_load) { + scr_load_internal(d->scr_to_load); + lv_anim_del(d->scr_to_load, NULL); + lv_obj_set_pos(d->scr_to_load, 0, 0); + lv_obj_remove_local_style_prop(d->scr_to_load, LV_STYLE_OPA, 0); + + if(d->del_prev) { + lv_obj_del(act_scr); + } + act_scr = d->scr_to_load; + } + + d->scr_to_load = new_scr; + + if(d->prev_scr && d->del_prev) { + lv_obj_del(d->prev_scr); + d->prev_scr = NULL; + } + + d->draw_prev_over_act = is_out_anim(anim_type); + d->del_prev = auto_del; + + /*Be sure there is no other animation on the screens*/ + lv_anim_del(new_scr, NULL); + lv_anim_del(lv_scr_act(), NULL); + + /*Be sure both screens are in a normal position*/ + lv_obj_set_pos(new_scr, 0, 0); + lv_obj_set_pos(lv_scr_act(), 0, 0); + lv_obj_remove_local_style_prop(new_scr, LV_STYLE_OPA, 0); + lv_obj_remove_local_style_prop(lv_scr_act(), LV_STYLE_OPA, 0); + + /*Shortcut for immediate load*/ + if(time == 0 && delay == 0) { + scr_load_internal(new_scr); + if(auto_del) lv_obj_del(act_scr); + return; + } + + lv_anim_t a_new; + lv_anim_init(&a_new); + lv_anim_set_var(&a_new, new_scr); + lv_anim_set_start_cb(&a_new, scr_load_anim_start); + lv_anim_set_ready_cb(&a_new, scr_anim_ready); + lv_anim_set_time(&a_new, time); + lv_anim_set_delay(&a_new, delay); + + lv_anim_t a_old; + lv_anim_init(&a_old); + lv_anim_set_var(&a_old, d->act_scr); + lv_anim_set_time(&a_old, time); + lv_anim_set_delay(&a_old, delay); + + switch(anim_type) { + case LV_SCR_LOAD_ANIM_NONE: + /*Create a dummy animation to apply the delay*/ + lv_anim_set_exec_cb(&a_new, set_x_anim); + lv_anim_set_values(&a_new, 0, 0); + break; + case LV_SCR_LOAD_ANIM_OVER_LEFT: + lv_anim_set_exec_cb(&a_new, set_x_anim); + lv_anim_set_values(&a_new, lv_disp_get_hor_res(d), 0); + break; + case LV_SCR_LOAD_ANIM_OVER_RIGHT: + lv_anim_set_exec_cb(&a_new, set_x_anim); + lv_anim_set_values(&a_new, -lv_disp_get_hor_res(d), 0); + break; + case LV_SCR_LOAD_ANIM_OVER_TOP: + lv_anim_set_exec_cb(&a_new, set_y_anim); + lv_anim_set_values(&a_new, lv_disp_get_ver_res(d), 0); + break; + case LV_SCR_LOAD_ANIM_OVER_BOTTOM: + lv_anim_set_exec_cb(&a_new, set_y_anim); + lv_anim_set_values(&a_new, -lv_disp_get_ver_res(d), 0); + break; + case LV_SCR_LOAD_ANIM_MOVE_LEFT: + lv_anim_set_exec_cb(&a_new, set_x_anim); + lv_anim_set_values(&a_new, lv_disp_get_hor_res(d), 0); + + lv_anim_set_exec_cb(&a_old, set_x_anim); + lv_anim_set_values(&a_old, 0, -lv_disp_get_hor_res(d)); + break; + case LV_SCR_LOAD_ANIM_MOVE_RIGHT: + lv_anim_set_exec_cb(&a_new, set_x_anim); + lv_anim_set_values(&a_new, -lv_disp_get_hor_res(d), 0); + + lv_anim_set_exec_cb(&a_old, set_x_anim); + lv_anim_set_values(&a_old, 0, lv_disp_get_hor_res(d)); + break; + case LV_SCR_LOAD_ANIM_MOVE_TOP: + lv_anim_set_exec_cb(&a_new, set_y_anim); + lv_anim_set_values(&a_new, lv_disp_get_ver_res(d), 0); + + lv_anim_set_exec_cb(&a_old, set_y_anim); + lv_anim_set_values(&a_old, 0, -lv_disp_get_ver_res(d)); + break; + case LV_SCR_LOAD_ANIM_MOVE_BOTTOM: + lv_anim_set_exec_cb(&a_new, set_y_anim); + lv_anim_set_values(&a_new, -lv_disp_get_ver_res(d), 0); + + lv_anim_set_exec_cb(&a_old, set_y_anim); + lv_anim_set_values(&a_old, 0, lv_disp_get_ver_res(d)); + break; + case LV_SCR_LOAD_ANIM_FADE_IN: + lv_anim_set_exec_cb(&a_new, opa_scale_anim); + lv_anim_set_values(&a_new, LV_OPA_TRANSP, LV_OPA_COVER); + break; + case LV_SCR_LOAD_ANIM_FADE_OUT: + lv_anim_set_exec_cb(&a_old, opa_scale_anim); + lv_anim_set_values(&a_old, LV_OPA_COVER, LV_OPA_TRANSP); + break; + case LV_SCR_LOAD_ANIM_OUT_LEFT: + lv_anim_set_exec_cb(&a_old, set_x_anim); + lv_anim_set_values(&a_old, 0, -lv_disp_get_hor_res(d)); + break; + case LV_SCR_LOAD_ANIM_OUT_RIGHT: + lv_anim_set_exec_cb(&a_old, set_x_anim); + lv_anim_set_values(&a_old, 0, lv_disp_get_hor_res(d)); + break; + case LV_SCR_LOAD_ANIM_OUT_TOP: + lv_anim_set_exec_cb(&a_old, set_y_anim); + lv_anim_set_values(&a_old, 0, -lv_disp_get_ver_res(d)); + break; + case LV_SCR_LOAD_ANIM_OUT_BOTTOM: + lv_anim_set_exec_cb(&a_old, set_y_anim); + lv_anim_set_values(&a_old, 0, lv_disp_get_ver_res(d)); + break; + } + + lv_event_send(act_scr, LV_EVENT_SCREEN_UNLOAD_START, NULL); + + lv_anim_start(&a_new); + lv_anim_start(&a_old); +} + +/** + * Get elapsed time since last user activity on a display (e.g. click) + * @param disp pointer to a display (NULL to get the overall smallest inactivity) + * @return elapsed ticks (milliseconds) since the last activity + */ +uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp) +{ + if(disp) return lv_tick_elaps(disp->last_activity_time); + + lv_disp_t * d; + uint32_t t = UINT32_MAX; + d = lv_disp_get_next(NULL); + while(d) { + uint32_t elaps = lv_tick_elaps(d->last_activity_time); + t = LV_MIN(t, elaps); + d = lv_disp_get_next(d); + } + + return t; +} + +/** + * Manually trigger an activity on a display + * @param disp pointer to a display (NULL to use the default display) + */ +void lv_disp_trig_activity(lv_disp_t * disp) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("lv_disp_trig_activity: no display registered"); + return; + } + + disp->last_activity_time = lv_tick_get(); +} + +/** + * Clean any CPU cache that is related to the display. + * @param disp pointer to a display (NULL to use the default display) + */ +void lv_disp_clean_dcache(lv_disp_t * disp) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("lv_disp_clean_dcache: no display registered"); + return; + } + + if(disp->driver->clean_dcache_cb) + disp->driver->clean_dcache_cb(disp->driver); +} + +/** + * Temporarily enable and disable the invalidation of the display. + * @param disp pointer to a display (NULL to use the default display) + * @param en true: enable invalidation; false: invalidation + */ +void lv_disp_enable_invalidation(lv_disp_t * disp, bool en) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("no display registered"); + return; + } + + disp->inv_en_cnt += en ? 1 : -1; +} + +/** + * Get display invalidation is enabled. + * @param disp pointer to a display (NULL to use the default display) + * @return return true if invalidation is enabled + */ +bool lv_disp_is_invalidation_enabled(lv_disp_t * disp) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("no display registered"); + return false; + } + + return (disp->inv_en_cnt > 0); +} + +/** + * Get a pointer to the screen refresher timer to + * modify its parameters with `lv_timer_...` functions. + * @param disp pointer to a display + * @return pointer to the display refresher timer. (NULL on error) + */ +lv_timer_t * _lv_disp_get_refr_timer(lv_disp_t * disp) +{ + if(!disp) disp = lv_disp_get_default(); + if(!disp) { + LV_LOG_WARN("lv_disp_get_refr_timer: no display registered"); + return NULL; + } + + return disp->refr_timer; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void scr_load_internal(lv_obj_t * scr) +{ + lv_disp_t * d = lv_obj_get_disp(scr); + if(!d) return; /*Shouldn't happen, just to be sure*/ + + lv_obj_t * old_scr = d->act_scr; + + if(d->act_scr) lv_event_send(old_scr, LV_EVENT_SCREEN_UNLOAD_START, NULL); + if(d->act_scr) lv_event_send(scr, LV_EVENT_SCREEN_LOAD_START, NULL); + + d->act_scr = scr; + d->scr_to_load = NULL; + + if(d->act_scr) lv_event_send(scr, LV_EVENT_SCREEN_LOADED, NULL); + if(d->act_scr) lv_event_send(old_scr, LV_EVENT_SCREEN_UNLOADED, NULL); + + lv_obj_invalidate(scr); +} + +static void scr_load_anim_start(lv_anim_t * a) +{ + lv_disp_t * d = lv_obj_get_disp(a->var); + + d->prev_scr = lv_scr_act(); + d->act_scr = a->var; + + lv_event_send(d->act_scr, LV_EVENT_SCREEN_LOAD_START, NULL); +} + +static void opa_scale_anim(void * obj, int32_t v) +{ + lv_obj_set_style_opa(obj, v, 0); +} + +static void set_x_anim(void * obj, int32_t v) +{ + lv_obj_set_x(obj, v); +} + +static void set_y_anim(void * obj, int32_t v) +{ + lv_obj_set_y(obj, v); +} + +static void scr_anim_ready(lv_anim_t * a) +{ + lv_disp_t * d = lv_obj_get_disp(a->var); + + lv_event_send(d->act_scr, LV_EVENT_SCREEN_LOADED, NULL); + lv_event_send(d->prev_scr, LV_EVENT_SCREEN_UNLOADED, NULL); + + if(d->prev_scr && d->del_prev) lv_obj_del(d->prev_scr); + d->prev_scr = NULL; + d->draw_prev_over_act = false; + d->scr_to_load = NULL; + lv_obj_remove_local_style_prop(a->var, LV_STYLE_OPA, 0); + lv_obj_invalidate(d->act_scr); +} + +static bool is_out_anim(lv_scr_load_anim_t anim_type) +{ + return anim_type == LV_SCR_LOAD_ANIM_FADE_OUT || + anim_type == LV_SCR_LOAD_ANIM_OUT_LEFT || + anim_type == LV_SCR_LOAD_ANIM_OUT_RIGHT || + anim_type == LV_SCR_LOAD_ANIM_OUT_TOP || + anim_type == LV_SCR_LOAD_ANIM_OUT_BOTTOM; +} diff --git a/L3_Middlewares/LVGL/src/core/lv_disp.h b/L3_Middlewares/LVGL/src/core/lv_disp.h new file mode 100644 index 0000000..7854cb7 --- /dev/null +++ b/L3_Middlewares/LVGL/src/core/lv_disp.h @@ -0,0 +1,264 @@ +/** + * @file lv_disp.h + * + */ + +#ifndef LV_DISP_H +#define LV_DISP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../hal/lv_hal.h" +#include "lv_obj.h" +#include "lv_theme.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef enum { + LV_SCR_LOAD_ANIM_NONE, + LV_SCR_LOAD_ANIM_OVER_LEFT, + LV_SCR_LOAD_ANIM_OVER_RIGHT, + LV_SCR_LOAD_ANIM_OVER_TOP, + LV_SCR_LOAD_ANIM_OVER_BOTTOM, + LV_SCR_LOAD_ANIM_MOVE_LEFT, + LV_SCR_LOAD_ANIM_MOVE_RIGHT, + LV_SCR_LOAD_ANIM_MOVE_TOP, + LV_SCR_LOAD_ANIM_MOVE_BOTTOM, + LV_SCR_LOAD_ANIM_FADE_IN, + LV_SCR_LOAD_ANIM_FADE_ON = LV_SCR_LOAD_ANIM_FADE_IN, /*For backward compatibility*/ + LV_SCR_LOAD_ANIM_FADE_OUT, + LV_SCR_LOAD_ANIM_OUT_LEFT, + LV_SCR_LOAD_ANIM_OUT_RIGHT, + LV_SCR_LOAD_ANIM_OUT_TOP, + LV_SCR_LOAD_ANIM_OUT_BOTTOM, +} lv_scr_load_anim_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Return with a pointer to the active screen + * @param disp pointer to display which active screen should be get. (NULL to use the default + * screen) + * @return pointer to the active screen object (loaded by 'lv_scr_load()') + */ +lv_obj_t * lv_disp_get_scr_act(lv_disp_t * disp); + +/** + * Return with a pointer to the previous screen. Only used during screen transitions. + * @param disp pointer to display which previous screen should be get. (NULL to use the default + * screen) + * @return pointer to the previous screen object or NULL if not used now + */ +lv_obj_t * lv_disp_get_scr_prev(lv_disp_t * disp); + +/** + * Make a screen active + * @param scr pointer to a screen + */ +void lv_disp_load_scr(lv_obj_t * scr); + +/** + * Return with the top layer. (Same on every screen and it is above the normal screen layer) + * @param disp pointer to display which top layer should be get. (NULL to use the default screen) + * @return pointer to the top layer object (transparent screen sized lv_obj) + */ +lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp); + +/** + * Return with the sys. layer. (Same on every screen and it is above the normal screen and the top + * layer) + * @param disp pointer to display which sys. layer should be retrieved. (NULL to use the default screen) + * @return pointer to the sys layer object (transparent screen sized lv_obj) + */ +lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp); + +/** + * Set the theme of a display + * @param disp pointer to a display + */ +void lv_disp_set_theme(lv_disp_t * disp, lv_theme_t * th); + +/** + * Get the theme of a display + * @param disp pointer to a display + * @return the display's theme (can be NULL) + */ +lv_theme_t * lv_disp_get_theme(lv_disp_t * disp); + +/** + * Set the background color of a display + * @param disp pointer to a display + * @param color color of the background + */ +void lv_disp_set_bg_color(lv_disp_t * disp, lv_color_t color); + +/** + * Set the background image of a display + * @param disp pointer to a display + * @param img_src path to file or pointer to an `lv_img_dsc_t` variable + */ +void lv_disp_set_bg_image(lv_disp_t * disp, const void * img_src); + +/** + * Set opacity of the background + * @param disp pointer to a display + * @param opa opacity (0..255) + */ +void lv_disp_set_bg_opa(lv_disp_t * disp, lv_opa_t opa); + +/** + * Switch screen with animation + * @param scr pointer to the new screen to load + * @param anim_type type of the animation from `lv_scr_load_anim_t`, e.g. `LV_SCR_LOAD_ANIM_MOVE_LEFT` + * @param time time of the animation + * @param delay delay before the transition + * @param auto_del true: automatically delete the old screen + */ +void lv_scr_load_anim(lv_obj_t * scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del); + +/** + * Get elapsed time since last user activity on a display (e.g. click) + * @param disp pointer to a display (NULL to get the overall smallest inactivity) + * @return elapsed ticks (milliseconds) since the last activity + */ +uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp); + +/** + * Manually trigger an activity on a display + * @param disp pointer to a display (NULL to use the default display) + */ +void lv_disp_trig_activity(lv_disp_t * disp); + +/** + * Clean any CPU cache that is related to the display. + * @param disp pointer to a display (NULL to use the default display) + */ +void lv_disp_clean_dcache(lv_disp_t * disp); + +/** + * Temporarily enable and disable the invalidation of the display. + * @param disp pointer to a display (NULL to use the default display) + * @param en true: enable invalidation; false: invalidation + */ +void lv_disp_enable_invalidation(lv_disp_t * disp, bool en); + +/** + * Get display invalidation is enabled. + * @param disp pointer to a display (NULL to use the default display) + * @return return true if invalidation is enabled + */ +bool lv_disp_is_invalidation_enabled(lv_disp_t * disp); + +/** + * Get a pointer to the screen refresher timer to + * modify its parameters with `lv_timer_...` functions. + * @param disp pointer to a display + * @return pointer to the display refresher timer. (NULL on error) + */ +lv_timer_t * _lv_disp_get_refr_timer(lv_disp_t * disp); + +/*------------------------------------------------ + * To improve backward compatibility + * Recommended only if you have one display + *------------------------------------------------*/ + +/** + * Get the active screen of the default display + * @return pointer to the active screen + */ +static inline lv_obj_t * lv_scr_act(void) +{ + return lv_disp_get_scr_act(lv_disp_get_default()); +} + +/** + * Get the top layer of the default display + * @return pointer to the top layer + */ +static inline lv_obj_t * lv_layer_top(void) +{ + return lv_disp_get_layer_top(lv_disp_get_default()); +} + +/** + * Get the active screen of the default display + * @return pointer to the sys layer + */ +static inline lv_obj_t * lv_layer_sys(void) +{ + return lv_disp_get_layer_sys(lv_disp_get_default()); +} + +static inline void lv_scr_load(lv_obj_t * scr) +{ + lv_disp_load_scr(scr); +} + +/********************** + * MACROS + **********************/ + +/*------------------------------------------------ + * To improve backward compatibility + * Recommended only if you have one display + *------------------------------------------------*/ + +#ifndef LV_HOR_RES +/** + * The horizontal resolution of the currently active display. + */ +#define LV_HOR_RES lv_disp_get_hor_res(lv_disp_get_default()) +#endif + +#ifndef LV_VER_RES +/** + * The vertical resolution of the currently active display. + */ +#define LV_VER_RES lv_disp_get_ver_res(lv_disp_get_default()) +#endif + +/** + * Scale the given number of pixels (a distance or size) relative to a 160 DPI display + * considering the DPI of the default display. + * It ensures that e.g. `lv_dpx(100)` will have the same physical size regardless to the + * DPI of the display. + * @param n the number of pixels to scale + * @return `n x current_dpi/160` + */ +static inline lv_coord_t lv_dpx(lv_coord_t n) +{ + return LV_DPX(n); +} + +/** + * Scale the given number of pixels (a distance or size) relative to a 160 DPI display + * considering the DPI of the given display. + * It ensures that e.g. `lv_dpx(100)` will have the same physical size regardless to the + * DPI of the display. + * @param obj a display whose dpi should be considered + * @param n the number of pixels to scale + * @return `n x current_dpi/160` + */ +static inline lv_coord_t lv_disp_dpx(const lv_disp_t * disp, lv_coord_t n) +{ + return _LV_DPX_CALC(lv_disp_get_dpi(disp), n); +} + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DISP_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_event.c b/L3_Middlewares/LVGL/src/core/lv_event.c new file mode 100644 index 0000000..f53ceac --- /dev/null +++ b/L3_Middlewares/LVGL/src/core/lv_event.c @@ -0,0 +1,527 @@ +/** + * @file lv_event.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_obj.h" +#include "lv_indev.h" + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_obj_class + +/********************** + * TYPEDEFS + **********************/ +typedef struct _lv_event_dsc_t { + lv_event_cb_t cb; + void * user_data; + lv_event_code_t filter : 8; +} lv_event_dsc_t; + +/********************** + * STATIC PROTOTYPES + **********************/ +static lv_event_dsc_t * lv_obj_get_event_dsc(const lv_obj_t * obj, uint32_t id); +static lv_res_t event_send_core(lv_event_t * e); +static bool event_is_bubbled(lv_event_t * e); + + +/********************** + * STATIC VARIABLES + **********************/ +static lv_event_t * event_head; + +/********************** + * MACROS + **********************/ +#if LV_LOG_TRACE_EVENT + #define EVENT_TRACE(...) LV_LOG_TRACE(__VA_ARGS__) +#else + #define EVENT_TRACE(...) +#endif + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_res_t lv_event_send(lv_obj_t * obj, lv_event_code_t event_code, void * param) +{ + if(obj == NULL) return LV_RES_OK; + + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_event_t e; + e.target = obj; + e.current_target = obj; + e.code = event_code; + e.user_data = NULL; + e.param = param; + e.deleted = 0; + e.stop_bubbling = 0; + e.stop_processing = 0; + + /*Build a simple linked list from the objects used in the events + *It's important to know if this object was deleted by a nested event + *called from this `event_cb`.*/ + e.prev = event_head; + event_head = &e; + + /*Send the event*/ + lv_res_t res = event_send_core(&e); + + /*Remove this element from the list*/ + event_head = e.prev; + + return res; +} + + +lv_res_t lv_obj_event_base(const lv_obj_class_t * class_p, lv_event_t * e) +{ + const lv_obj_class_t * base; + if(class_p == NULL) base = e->current_target->class_p; + else base = class_p->base_class; + + /*Find a base in which call the ancestor's event handler_cb if set*/ + while(base && base->event_cb == NULL) base = base->base_class; + + if(base == NULL) return LV_RES_OK; + if(base->event_cb == NULL) return LV_RES_OK; + + /*Call the actual event callback*/ + e->user_data = NULL; + base->event_cb(base, e); + + lv_res_t res = LV_RES_OK; + /*Stop if the object is deleted*/ + if(e->deleted) res = LV_RES_INV; + + return res; +} + + +lv_obj_t * lv_event_get_target(lv_event_t * e) +{ + return e->target; +} + +lv_obj_t * lv_event_get_current_target(lv_event_t * e) +{ + return e->current_target; +} + +lv_event_code_t lv_event_get_code(lv_event_t * e) +{ + return e->code & ~LV_EVENT_PREPROCESS; +} + +void * lv_event_get_param(lv_event_t * e) +{ + return e->param; +} + +void * lv_event_get_user_data(lv_event_t * e) +{ + return e->user_data; +} + +void lv_event_stop_bubbling(lv_event_t * e) +{ + e->stop_bubbling = 1; +} + +void lv_event_stop_processing(lv_event_t * e) +{ + e->stop_processing = 1; +} + + +uint32_t lv_event_register_id(void) +{ + static uint32_t last_id = _LV_EVENT_LAST; + last_id ++; + return last_id; +} + +void _lv_event_mark_deleted(lv_obj_t * obj) +{ + lv_event_t * e = event_head; + + while(e) { + if(e->current_target == obj || e->target == obj) e->deleted = 1; + e = e->prev; + } +} + + +struct _lv_event_dsc_t * lv_obj_add_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb, lv_event_code_t filter, + void * user_data) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_obj_allocate_spec_attr(obj); + + obj->spec_attr->event_dsc_cnt++; + obj->spec_attr->event_dsc = lv_mem_realloc(obj->spec_attr->event_dsc, + obj->spec_attr->event_dsc_cnt * sizeof(lv_event_dsc_t)); + LV_ASSERT_MALLOC(obj->spec_attr->event_dsc); + + obj->spec_attr->event_dsc[obj->spec_attr->event_dsc_cnt - 1].cb = event_cb; + obj->spec_attr->event_dsc[obj->spec_attr->event_dsc_cnt - 1].filter = filter; + obj->spec_attr->event_dsc[obj->spec_attr->event_dsc_cnt - 1].user_data = user_data; + + return &obj->spec_attr->event_dsc[obj->spec_attr->event_dsc_cnt - 1]; +} + +bool lv_obj_remove_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + if(obj->spec_attr == NULL) return false; + + int32_t i = 0; + for(i = 0; i < obj->spec_attr->event_dsc_cnt; i++) { + if(event_cb == NULL || obj->spec_attr->event_dsc[i].cb == event_cb) { + /*Shift the remaining event handlers forward*/ + for(; i < (obj->spec_attr->event_dsc_cnt - 1); i++) { + obj->spec_attr->event_dsc[i] = obj->spec_attr->event_dsc[i + 1]; + } + obj->spec_attr->event_dsc_cnt--; + obj->spec_attr->event_dsc = lv_mem_realloc(obj->spec_attr->event_dsc, + obj->spec_attr->event_dsc_cnt * sizeof(lv_event_dsc_t)); + LV_ASSERT_MALLOC(obj->spec_attr->event_dsc); + return true; + } + } + + /*No event handler found*/ + return false; +} + +bool lv_obj_remove_event_cb_with_user_data(lv_obj_t * obj, lv_event_cb_t event_cb, const void * user_data) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + if(obj->spec_attr == NULL) return false; + + int32_t i = 0; + for(i = 0; i < obj->spec_attr->event_dsc_cnt; i++) { + if((event_cb == NULL || obj->spec_attr->event_dsc[i].cb == event_cb) && + obj->spec_attr->event_dsc[i].user_data == user_data) { + /*Shift the remaining event handlers forward*/ + for(; i < (obj->spec_attr->event_dsc_cnt - 1); i++) { + obj->spec_attr->event_dsc[i] = obj->spec_attr->event_dsc[i + 1]; + } + obj->spec_attr->event_dsc_cnt--; + obj->spec_attr->event_dsc = lv_mem_realloc(obj->spec_attr->event_dsc, + obj->spec_attr->event_dsc_cnt * sizeof(lv_event_dsc_t)); + LV_ASSERT_MALLOC(obj->spec_attr->event_dsc); + return true; + } + } + + /*No event handler found*/ + return false; +} + + +bool lv_obj_remove_event_dsc(lv_obj_t * obj, struct _lv_event_dsc_t * event_dsc) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + if(obj->spec_attr == NULL) return false; + + int32_t i = 0; + for(i = 0; i < obj->spec_attr->event_dsc_cnt; i++) { + if(&obj->spec_attr->event_dsc[i] == event_dsc) { + /*Shift the remaining event handlers forward*/ + for(; i < (obj->spec_attr->event_dsc_cnt - 1); i++) { + obj->spec_attr->event_dsc[i] = obj->spec_attr->event_dsc[i + 1]; + } + obj->spec_attr->event_dsc_cnt--; + obj->spec_attr->event_dsc = lv_mem_realloc(obj->spec_attr->event_dsc, + obj->spec_attr->event_dsc_cnt * sizeof(lv_event_dsc_t)); + LV_ASSERT_MALLOC(obj->spec_attr->event_dsc); + return true; + } + } + + /*No event handler found*/ + return false; +} + +void * lv_obj_get_event_user_data(struct _lv_obj_t * obj, lv_event_cb_t event_cb) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + if(obj->spec_attr == NULL) return NULL; + + int32_t i = 0; + for(i = 0; i < obj->spec_attr->event_dsc_cnt; i++) { + if(event_cb == obj->spec_attr->event_dsc[i].cb) return obj->spec_attr->event_dsc[i].user_data; + } + return NULL; +} + +lv_indev_t * lv_event_get_indev(lv_event_t * e) +{ + + if(e->code == LV_EVENT_PRESSED || + e->code == LV_EVENT_PRESSING || + e->code == LV_EVENT_PRESS_LOST || + e->code == LV_EVENT_SHORT_CLICKED || + e->code == LV_EVENT_LONG_PRESSED || + e->code == LV_EVENT_LONG_PRESSED_REPEAT || + e->code == LV_EVENT_CLICKED || + e->code == LV_EVENT_RELEASED || + e->code == LV_EVENT_SCROLL_BEGIN || + e->code == LV_EVENT_SCROLL_END || + e->code == LV_EVENT_SCROLL || + e->code == LV_EVENT_GESTURE || + e->code == LV_EVENT_KEY || + e->code == LV_EVENT_FOCUSED || + e->code == LV_EVENT_DEFOCUSED || + e->code == LV_EVENT_LEAVE) { + return lv_event_get_param(e); + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + return NULL; + } +} + +lv_obj_draw_part_dsc_t * lv_event_get_draw_part_dsc(lv_event_t * e) +{ + if(e->code == LV_EVENT_DRAW_PART_BEGIN || + e->code == LV_EVENT_DRAW_PART_END) { + return lv_event_get_param(e); + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + return NULL; + } +} + +lv_draw_ctx_t * lv_event_get_draw_ctx(lv_event_t * e) +{ + if(e->code == LV_EVENT_DRAW_MAIN || + e->code == LV_EVENT_DRAW_MAIN_BEGIN || + e->code == LV_EVENT_DRAW_MAIN_END || + e->code == LV_EVENT_DRAW_POST || + e->code == LV_EVENT_DRAW_POST_BEGIN || + e->code == LV_EVENT_DRAW_POST_END) { + return lv_event_get_param(e); + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + return NULL; + } +} + +const lv_area_t * lv_event_get_old_size(lv_event_t * e) +{ + if(e->code == LV_EVENT_SIZE_CHANGED) { + return lv_event_get_param(e); + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + return NULL; + } +} + +uint32_t lv_event_get_key(lv_event_t * e) +{ + if(e->code == LV_EVENT_KEY) { + uint32_t * k = lv_event_get_param(e); + if(k) return *k; + else return 0; + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + return 0; + } +} + +lv_anim_t * lv_event_get_scroll_anim(lv_event_t * e) +{ + if(e->code == LV_EVENT_SCROLL_BEGIN) { + return lv_event_get_param(e); + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + return 0; + } +} + +void lv_event_set_ext_draw_size(lv_event_t * e, lv_coord_t size) +{ + if(e->code == LV_EVENT_REFR_EXT_DRAW_SIZE) { + lv_coord_t * cur_size = lv_event_get_param(e); + *cur_size = LV_MAX(*cur_size, size); + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + } +} + +lv_point_t * lv_event_get_self_size_info(lv_event_t * e) +{ + if(e->code == LV_EVENT_GET_SELF_SIZE) { + return lv_event_get_param(e); + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + return 0; + } +} + +lv_hit_test_info_t * lv_event_get_hit_test_info(lv_event_t * e) +{ + if(e->code == LV_EVENT_HIT_TEST) { + return lv_event_get_param(e); + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + return 0; + } +} + +const lv_area_t * lv_event_get_cover_area(lv_event_t * e) +{ + if(e->code == LV_EVENT_COVER_CHECK) { + lv_cover_check_info_t * p = lv_event_get_param(e); + return p->area; + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + return NULL; + } +} + +void lv_event_set_cover_res(lv_event_t * e, lv_cover_res_t res) +{ + if(e->code == LV_EVENT_COVER_CHECK) { + lv_cover_check_info_t * p = lv_event_get_param(e); + if(res > p->res) p->res = res; /*Save only "stronger" results*/ + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static lv_event_dsc_t * lv_obj_get_event_dsc(const lv_obj_t * obj, uint32_t id) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + if(!obj->spec_attr) return NULL; + if(id >= obj->spec_attr->event_dsc_cnt) return NULL; + + return &obj->spec_attr->event_dsc[id]; +} + +static lv_res_t event_send_core(lv_event_t * e) +{ + EVENT_TRACE("Sending event %d to %p with %p param", e->code, (void *)e->current_target, e->param); + + /*Call the input device's feedback callback if set*/ + lv_indev_t * indev_act = lv_indev_get_act(); + if(indev_act) { + if(indev_act->driver->feedback_cb) indev_act->driver->feedback_cb(indev_act->driver, e->code); + if(e->stop_processing) return LV_RES_OK; + if(e->deleted) return LV_RES_INV; + } + + lv_res_t res = LV_RES_OK; + lv_event_dsc_t * event_dsc = lv_obj_get_event_dsc(e->current_target, 0); + + uint32_t i = 0; + while(event_dsc && res == LV_RES_OK) { + if(event_dsc->cb && ((event_dsc->filter & LV_EVENT_PREPROCESS) == LV_EVENT_PREPROCESS) + && (event_dsc->filter == (LV_EVENT_ALL | LV_EVENT_PREPROCESS) || + (event_dsc->filter & ~LV_EVENT_PREPROCESS) == e->code)) { + e->user_data = event_dsc->user_data; + event_dsc->cb(e); + + if(e->stop_processing) return LV_RES_OK; + /*Stop if the object is deleted*/ + if(e->deleted) return LV_RES_INV; + } + + i++; + event_dsc = lv_obj_get_event_dsc(e->current_target, i); + } + + res = lv_obj_event_base(NULL, e); + + event_dsc = res == LV_RES_INV ? NULL : lv_obj_get_event_dsc(e->current_target, 0); + + i = 0; + while(event_dsc && res == LV_RES_OK) { + if(event_dsc->cb && ((event_dsc->filter & LV_EVENT_PREPROCESS) == 0) + && (event_dsc->filter == LV_EVENT_ALL || event_dsc->filter == e->code)) { + e->user_data = event_dsc->user_data; + event_dsc->cb(e); + + if(e->stop_processing) return LV_RES_OK; + /*Stop if the object is deleted*/ + if(e->deleted) return LV_RES_INV; + } + + i++; + event_dsc = lv_obj_get_event_dsc(e->current_target, i); + } + + if(res == LV_RES_OK && e->current_target->parent && event_is_bubbled(e)) { + e->current_target = e->current_target->parent; + res = event_send_core(e); + if(res != LV_RES_OK) return LV_RES_INV; + } + + return res; +} + +static bool event_is_bubbled(lv_event_t * e) +{ + if(e->stop_bubbling) return false; + + /*Event codes that always bubble*/ + switch(e->code) { + case LV_EVENT_CHILD_CREATED: + case LV_EVENT_CHILD_DELETED: + return true; + default: + break; + } + + /*Check other codes only if bubbling is enabled*/ + if(lv_obj_has_flag(e->current_target, LV_OBJ_FLAG_EVENT_BUBBLE) == false) return false; + + switch(e->code) { + case LV_EVENT_HIT_TEST: + case LV_EVENT_COVER_CHECK: + case LV_EVENT_REFR_EXT_DRAW_SIZE: + case LV_EVENT_DRAW_MAIN_BEGIN: + case LV_EVENT_DRAW_MAIN: + case LV_EVENT_DRAW_MAIN_END: + case LV_EVENT_DRAW_POST_BEGIN: + case LV_EVENT_DRAW_POST: + case LV_EVENT_DRAW_POST_END: + case LV_EVENT_DRAW_PART_BEGIN: + case LV_EVENT_DRAW_PART_END: + case LV_EVENT_REFRESH: + case LV_EVENT_DELETE: + case LV_EVENT_CHILD_CREATED: + case LV_EVENT_CHILD_DELETED: + case LV_EVENT_CHILD_CHANGED: + case LV_EVENT_SIZE_CHANGED: + case LV_EVENT_STYLE_CHANGED: + case LV_EVENT_GET_SELF_SIZE: + return false; + default: + return true; + } +} diff --git a/L3_Middlewares/LVGL/src/core/lv_event.h b/L3_Middlewares/LVGL/src/core/lv_event.h new file mode 100644 index 0000000..d5a9eb6 --- /dev/null +++ b/L3_Middlewares/LVGL/src/core/lv_event.h @@ -0,0 +1,363 @@ +/** + * @file lv_event.h + * + */ + +#ifndef LV_EVENT_H +#define LV_EVENT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +struct _lv_obj_t; +struct _lv_event_dsc_t; + +/** + * Type of event being sent to the object. + */ +typedef enum { + LV_EVENT_ALL = 0, + + /** Input device events*/ + LV_EVENT_PRESSED, /**< The object has been pressed*/ + LV_EVENT_PRESSING, /**< The object is being pressed (called continuously while pressing)*/ + LV_EVENT_PRESS_LOST, /**< The object is still being pressed but slid cursor/finger off of the object */ + LV_EVENT_SHORT_CLICKED, /**< The object was pressed for a short period of time, then released it. Not called if scrolled.*/ + LV_EVENT_LONG_PRESSED, /**< Object has been pressed for at least `long_press_time`. Not called if scrolled.*/ + LV_EVENT_LONG_PRESSED_REPEAT, /**< Called after `long_press_time` in every `long_press_repeat_time` ms. Not called if scrolled.*/ + LV_EVENT_CLICKED, /**< Called on release if not scrolled (regardless to long press)*/ + LV_EVENT_RELEASED, /**< Called in every cases when the object has been released*/ + LV_EVENT_SCROLL_BEGIN, /**< Scrolling begins. The event parameter is a pointer to the animation of the scroll. Can be modified*/ + LV_EVENT_SCROLL_END, /**< Scrolling ends*/ + LV_EVENT_SCROLL, /**< Scrolling*/ + LV_EVENT_GESTURE, /**< A gesture is detected. Get the gesture with `lv_indev_get_gesture_dir(lv_indev_get_act());` */ + LV_EVENT_KEY, /**< A key is sent to the object. Get the key with `lv_indev_get_key(lv_indev_get_act());`*/ + LV_EVENT_FOCUSED, /**< The object is focused*/ + LV_EVENT_DEFOCUSED, /**< The object is defocused*/ + LV_EVENT_LEAVE, /**< The object is defocused but still selected*/ + LV_EVENT_HIT_TEST, /**< Perform advanced hit-testing*/ + + /** Drawing events*/ + LV_EVENT_COVER_CHECK, /**< Check if the object fully covers an area. The event parameter is `lv_cover_check_info_t *`.*/ + LV_EVENT_REFR_EXT_DRAW_SIZE, /**< Get the required extra draw area around the object (e.g. for shadow). The event parameter is `lv_coord_t *` to store the size.*/ + LV_EVENT_DRAW_MAIN_BEGIN, /**< Starting the main drawing phase*/ + LV_EVENT_DRAW_MAIN, /**< Perform the main drawing*/ + LV_EVENT_DRAW_MAIN_END, /**< Finishing the main drawing phase*/ + LV_EVENT_DRAW_POST_BEGIN, /**< Starting the post draw phase (when all children are drawn)*/ + LV_EVENT_DRAW_POST, /**< Perform the post draw phase (when all children are drawn)*/ + LV_EVENT_DRAW_POST_END, /**< Finishing the post draw phase (when all children are drawn)*/ + LV_EVENT_DRAW_PART_BEGIN, /**< Starting to draw a part. The event parameter is `lv_obj_draw_dsc_t *`. */ + LV_EVENT_DRAW_PART_END, /**< Finishing to draw a part. The event parameter is `lv_obj_draw_dsc_t *`. */ + + /** Special events*/ + LV_EVENT_VALUE_CHANGED, /**< The object's value has changed (i.e. slider moved)*/ + LV_EVENT_INSERT, /**< A text is inserted to the object. The event data is `char *` being inserted.*/ + LV_EVENT_REFRESH, /**< Notify the object to refresh something on it (for the user)*/ + LV_EVENT_READY, /**< A process has finished*/ + LV_EVENT_CANCEL, /**< A process has been cancelled */ + + /** Other events*/ + LV_EVENT_DELETE, /**< Object is being deleted*/ + LV_EVENT_CHILD_CHANGED, /**< Child was removed, added, or its size, position were changed */ + LV_EVENT_CHILD_CREATED, /**< Child was created, always bubbles up to all parents*/ + LV_EVENT_CHILD_DELETED, /**< Child was deleted, always bubbles up to all parents*/ + LV_EVENT_SCREEN_UNLOAD_START, /**< A screen unload started, fired immediately when scr_load is called*/ + LV_EVENT_SCREEN_LOAD_START, /**< A screen load started, fired when the screen change delay is expired*/ + LV_EVENT_SCREEN_LOADED, /**< A screen was loaded*/ + LV_EVENT_SCREEN_UNLOADED, /**< A screen was unloaded*/ + LV_EVENT_SIZE_CHANGED, /**< Object coordinates/size have changed*/ + LV_EVENT_STYLE_CHANGED, /**< Object's style has changed*/ + LV_EVENT_LAYOUT_CHANGED, /**< The children position has changed due to a layout recalculation*/ + LV_EVENT_GET_SELF_SIZE, /**< Get the internal size of a widget*/ + + _LV_EVENT_LAST, /** Number of default events*/ + + + LV_EVENT_PREPROCESS = 0x80, /** This is a flag that can be set with an event so it's processed + before the class default event processing */ +} lv_event_code_t; + +typedef struct _lv_event_t { + struct _lv_obj_t * target; + struct _lv_obj_t * current_target; + lv_event_code_t code; + void * user_data; + void * param; + struct _lv_event_t * prev; + uint8_t deleted : 1; + uint8_t stop_processing : 1; + uint8_t stop_bubbling : 1; +} lv_event_t; + +/** + * @brief Event callback. + * Events are used to notify the user of some action being taken on the object. + * For details, see ::lv_event_t. + */ +typedef void (*lv_event_cb_t)(lv_event_t * e); + +/** + * Used as the event parameter of ::LV_EVENT_HIT_TEST to check if an `point` can click the object or not. + * `res` should be set like this: + * - If already set to `false` an other event wants that point non clickable. If you want to respect it leave it as `false` or set `true` to overwrite it. + * - If already set `true` and `point` shouldn't be clickable set to `false` + * - If already set to `true` you agree that `point` can click the object leave it as `true` + */ +typedef struct { + const lv_point_t * point; /**< A point relative to screen to check if it can click the object or not*/ + bool res; /**< true: `point` can click the object; false: it cannot*/ +} lv_hit_test_info_t; + +/** + * Used as the event parameter of ::LV_EVENT_COVER_CHECK to check if an area is covered by the object or not. + * In the event use `const lv_area_t * area = lv_event_get_cover_area(e)` to get the area to check + * and `lv_event_set_cover_res(e, res)` to set the result. + */ +typedef struct { + lv_cover_res_t res; + const lv_area_t * area; +} lv_cover_check_info_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Send an event to the object + * @param obj pointer to an object + * @param event_code the type of the event from `lv_event_t` + * @param param arbitrary data depending on the widget type and the event. (Usually `NULL`) + * @return LV_RES_OK: `obj` was not deleted in the event; LV_RES_INV: `obj` was deleted in the event_code + */ +lv_res_t lv_event_send(struct _lv_obj_t * obj, lv_event_code_t event_code, void * param); + +/** + * Used by the widgets internally to call the ancestor widget types's event handler + * @param class_p pointer to the class of the widget (NOT the ancestor class) + * @param e pointer to the event descriptor + * @return LV_RES_OK: the target object was not deleted in the event; LV_RES_INV: it was deleted in the event_code + */ +lv_res_t lv_obj_event_base(const lv_obj_class_t * class_p, lv_event_t * e); + +/** + * Get the object originally targeted by the event. It's the same even if the event is bubbled. + * @param e pointer to the event descriptor + * @return the target of the event_code + */ +struct _lv_obj_t * lv_event_get_target(lv_event_t * e); + +/** + * Get the current target of the event. It's the object which event handler being called. + * If the event is not bubbled it's the same as "normal" target. + * @param e pointer to the event descriptor + * @return pointer to the current target of the event_code + */ +struct _lv_obj_t * lv_event_get_current_target(lv_event_t * e); + +/** + * Get the event code of an event + * @param e pointer to the event descriptor + * @return the event code. (E.g. `LV_EVENT_CLICKED`, `LV_EVENT_FOCUSED`, etc) + */ +lv_event_code_t lv_event_get_code(lv_event_t * e); + +/** + * Get the parameter passed when the event was sent + * @param e pointer to the event descriptor + * @return pointer to the parameter + */ +void * lv_event_get_param(lv_event_t * e); + +/** + * Get the user_data passed when the event was registered on the object + * @param e pointer to the event descriptor + * @return pointer to the user_data + */ +void * lv_event_get_user_data(lv_event_t * e); + +/** + * Stop the event from bubbling. + * This is only valid when called in the middle of an event processing chain. + * @param e pointer to the event descriptor + */ +void lv_event_stop_bubbling(lv_event_t * e); + +/** + * Stop processing this event. + * This is only valid when called in the middle of an event processing chain. + * @param e pointer to the event descriptor + */ +void lv_event_stop_processing(lv_event_t * e); + +/** + * Register a new, custom event ID. + * It can be used the same way as e.g. `LV_EVENT_CLICKED` to send custom events + * @return the new event id + * @example + * uint32_t LV_EVENT_MINE = 0; + * ... + * e = lv_event_register_id(); + * ... + * lv_event_send(obj, LV_EVENT_MINE, &some_data); + */ +uint32_t lv_event_register_id(void); + +/** + * Nested events can be called and one of them might belong to an object that is being deleted. + * Mark this object's `event_temp_data` deleted to know that its `lv_event_send` should return `LV_RES_INV` + * @param obj pointer to an object to mark as deleted + */ +void _lv_event_mark_deleted(struct _lv_obj_t * obj); + + +/** + * Add an event handler function for an object. + * Used by the user to react on event which happens with the object. + * An object can have multiple event handler. They will be called in the same order as they were added. + * @param obj pointer to an object + * @param filter and event code (e.g. `LV_EVENT_CLICKED`) on which the event should be called. `LV_EVENT_ALL` can be sued the receive all the events. + * @param event_cb the new event function + * @param user_data custom data data will be available in `event_cb` + * @return a pointer the event descriptor. Can be used in ::lv_obj_remove_event_dsc + */ +struct _lv_event_dsc_t * lv_obj_add_event_cb(struct _lv_obj_t * obj, lv_event_cb_t event_cb, lv_event_code_t filter, + void * user_data); + +/** + * Remove an event handler function for an object. + * @param obj pointer to an object + * @param event_cb the event function to remove, or `NULL` to remove the firstly added event callback + * @return true if any event handlers were removed + */ +bool lv_obj_remove_event_cb(struct _lv_obj_t * obj, lv_event_cb_t event_cb); + +/** + * Remove an event handler function with a specific user_data from an object. + * @param obj pointer to an object + * @param event_cb the event function to remove, or `NULL` only `user_data` matters. + * @param event_user_data the user_data specified in ::lv_obj_add_event_cb + * @return true if any event handlers were removed + */ +bool lv_obj_remove_event_cb_with_user_data(struct _lv_obj_t * obj, lv_event_cb_t event_cb, + const void * event_user_data); + +/** + * DEPRECATED because doesn't work if multiple event handlers are added to an object. + * Remove an event handler function for an object. + * @param obj pointer to an object + * @param event_dsc pointer to an event descriptor to remove (returned by ::lv_obj_add_event_cb) + * @return true if any event handlers were removed + */ +bool lv_obj_remove_event_dsc(struct _lv_obj_t * obj, struct _lv_event_dsc_t * event_dsc); + +/** + * The user data of an event object event callback. Always the first match with `event_cb` will be returned. + * @param obj pointer to an object + * @param event_cb the event function + * @return the user_data + */ +void * lv_obj_get_event_user_data(struct _lv_obj_t * obj, lv_event_cb_t event_cb); + +/** + * Get the input device passed as parameter to indev related events. + * @param e pointer to an event + * @return the indev that triggered the event or NULL if called on a not indev related event + */ +lv_indev_t * lv_event_get_indev(lv_event_t * e); + +/** + * Get the part draw descriptor passed as parameter to `LV_EVENT_DRAW_PART_BEGIN/END`. + * @param e pointer to an event + * @return the part draw descriptor to hook the drawing or NULL if called on an unrelated event + */ +lv_obj_draw_part_dsc_t * lv_event_get_draw_part_dsc(lv_event_t * e); + +/** + * Get the draw context which should be the first parameter of the draw functions. + * Namely: `LV_EVENT_DRAW_MAIN/POST`, `LV_EVENT_DRAW_MAIN/POST_BEGIN`, `LV_EVENT_DRAW_MAIN/POST_END` + * @param e pointer to an event + * @return pointer to a draw context or NULL if called on an unrelated event + */ +lv_draw_ctx_t * lv_event_get_draw_ctx(lv_event_t * e); + +/** + * Get the old area of the object before its size was changed. Can be used in `LV_EVENT_SIZE_CHANGED` + * @param e pointer to an event + * @return the old absolute area of the object or NULL if called on an unrelated event + */ +const lv_area_t * lv_event_get_old_size(lv_event_t * e); + +/** + * Get the key passed as parameter to an event. Can be used in `LV_EVENT_KEY` + * @param e pointer to an event + * @return the triggering key or NULL if called on an unrelated event + */ +uint32_t lv_event_get_key(lv_event_t * e); + +/** + * Get the animation descriptor of a scrolling. Can be used in `LV_EVENT_SCROLL_BEGIN` + * @param e pointer to an event + * @return the animation that will scroll the object. (can be modified as required) + */ +lv_anim_t * lv_event_get_scroll_anim(lv_event_t * e); + +/** + * Set the new extra draw size. Can be used in `LV_EVENT_REFR_EXT_DRAW_SIZE` + * @param e pointer to an event + * @param size The new extra draw size + */ +void lv_event_set_ext_draw_size(lv_event_t * e, lv_coord_t size); + +/** + * Get a pointer to an `lv_point_t` variable in which the self size should be saved (width in `point->x` and height `point->y`). + * Can be used in `LV_EVENT_GET_SELF_SIZE` + * @param e pointer to an event + * @return pointer to `lv_point_t` or NULL if called on an unrelated event + */ +lv_point_t * lv_event_get_self_size_info(lv_event_t * e); + +/** + * Get a pointer to an `lv_hit_test_info_t` variable in which the hit test result should be saved. Can be used in `LV_EVENT_HIT_TEST` + * @param e pointer to an event + * @return pointer to `lv_hit_test_info_t` or NULL if called on an unrelated event + */ +lv_hit_test_info_t * lv_event_get_hit_test_info(lv_event_t * e); + +/** + * Get a pointer to an area which should be examined whether the object fully covers it or not. + * Can be used in `LV_EVENT_HIT_TEST` + * @param e pointer to an event + * @return an area with absolute coordinates to check + */ +const lv_area_t * lv_event_get_cover_area(lv_event_t * e); + +/** + * Set the result of cover checking. Can be used in `LV_EVENT_COVER_CHECK` + * @param e pointer to an event + * @param res an element of ::lv_cover_check_info_t + */ +void lv_event_set_cover_res(lv_event_t * e, lv_cover_res_t res); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_EVENT_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_global.h b/L3_Middlewares/LVGL/src/core/lv_global.h deleted file mode 100644 index c106e4f..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_global.h +++ /dev/null @@ -1,266 +0,0 @@ -/** - * @file lv_global.h - * - */ - -#ifndef LV_GLOBAL_H -#define LV_GLOBAL_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_conf_internal.h" - -#include "../misc/lv_types.h" -#include "../draw/lv_draw.h" -#if LV_USE_DRAW_SW -#include "../draw/sw/lv_draw_sw.h" -#endif -#include "../misc/lv_anim.h" -#include "../misc/lv_area.h" -#include "../misc/lv_color_op.h" -#include "../misc/lv_ll.h" -#include "../misc/lv_log.h" -#include "../misc/lv_style.h" -#include "../misc/lv_timer.h" -#include "../osal/lv_os.h" -#include "../others/sysmon/lv_sysmon.h" -#include "../stdlib/builtin/lv_tlsf.h" - -#if LV_USE_FONT_COMPRESSED -#include "../font/lv_font_fmt_txt_private.h" -#endif - -#include "../tick/lv_tick.h" -#include "../layouts/lv_layout.h" - -#include "../misc/lv_types.h" - -#include "../misc/lv_timer_private.h" -#include "../misc/lv_anim_private.h" -#include "../tick/lv_tick_private.h" -#include "../draw/lv_draw_buf_private.h" -#include "../draw/lv_draw_private.h" -#include "../draw/sw/lv_draw_sw_private.h" -#include "../draw/sw/lv_draw_sw_mask_private.h" -#include "../stdlib/builtin/lv_tlsf_private.h" -#include "../others/sysmon/lv_sysmon_private.h" -#include "../layouts/lv_layout_private.h" - -/********************* - * DEFINES - *********************/ -#define ZERO_MEM_SENTINEL 0xa1b2c3d4 - -/********************** - * TYPEDEFS - **********************/ - -#if LV_USE_SPAN != 0 -struct _snippet_stack; -#endif - -#if LV_USE_FREETYPE -struct lv_freetype_context_t; -#endif - -#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN -struct lv_profiler_builtin_ctx_t; -#endif - -#if LV_USE_NUTTX -struct lv_nuttx_ctx_t; -#endif - -typedef struct lv_global_t { - bool inited; - bool deinit_in_progress; /**< Can be used e.g. in the LV_EVENT_DELETE to deinit the drivers too */ - - lv_ll_t disp_ll; - lv_display_t * disp_refresh; - lv_display_t * disp_default; - - lv_ll_t style_trans_ll; - bool style_refresh; - uint32_t style_custom_table_size; - uint32_t style_last_custom_prop_id; - uint8_t * style_custom_prop_flag_lookup_table; - - lv_ll_t group_ll; - lv_group_t * group_default; - - lv_ll_t indev_ll; - lv_indev_t * indev_active; - lv_obj_t * indev_obj_active; - - uint32_t layout_count; - lv_layout_dsc_t * layout_list; - bool layout_update_mutex; - - uint32_t memory_zero; - uint32_t math_rand_seed; - - lv_event_t * event_header; - uint32_t event_last_register_id; - - lv_timer_state_t timer_state; - lv_anim_state_t anim_state; - lv_tick_state_t tick_state; - - lv_draw_buf_handlers_t draw_buf_handlers; - lv_draw_buf_handlers_t font_draw_buf_handlers; - lv_draw_buf_handlers_t image_cache_draw_buf_handlers; /**< Ensure that all assigned draw buffers - * can be managed by image cache. */ - - lv_ll_t img_decoder_ll; - - lv_cache_t * img_cache; - lv_cache_t * img_header_cache; - - lv_draw_global_info_t draw_info; -#if defined(LV_DRAW_SW_SHADOW_CACHE_SIZE) && LV_DRAW_SW_SHADOW_CACHE_SIZE > 0 - lv_draw_sw_shadow_cache_t sw_shadow_cache; -#endif -#if LV_DRAW_SW_COMPLEX - lv_draw_sw_mask_radius_circle_dsc_arr_t sw_circle_cache; -#endif - -#if LV_USE_LOG - lv_log_print_g_cb_t custom_log_print_cb; -#endif - -#if LV_USE_LOG && LV_LOG_USE_TIMESTAMP - uint32_t log_last_log_time; -#endif - -#if LV_USE_THEME_SIMPLE - void * theme_simple; -#endif - -#if LV_USE_THEME_DEFAULT - void * theme_default; -#endif - -#if LV_USE_THEME_MONO - void * theme_mono; -#endif - -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN - lv_tlsf_state_t tlsf_state; -#endif - - lv_ll_t fsdrv_ll; -#if LV_USE_FS_STDIO != '\0' - lv_fs_drv_t stdio_fs_drv; -#endif -#if LV_USE_FS_POSIX - lv_fs_drv_t posix_fs_drv; -#endif - -#if LV_USE_FS_FATFS - lv_fs_drv_t fatfs_fs_drv; -#endif - -#if LV_USE_FS_WIN32 != '\0' - lv_fs_drv_t win32_fs_drv; -#endif - -#if LV_USE_FS_LITTLEFS - lv_fs_drv_t littlefs_fs_drv; -#endif - -#if LV_USE_FS_ARDUINO_ESP_LITTLEFS - lv_fs_drv_t arduino_esp_littlefs_fs_drv; -#endif - -#if LV_USE_FS_ARDUINO_SD - lv_fs_drv_t arduino_sd_fs_drv; -#endif - -#if LV_USE_FREETYPE - struct lv_freetype_context_t * ft_context; -#endif - -#if LV_USE_FONT_COMPRESSED - lv_font_fmt_rle_t font_fmt_rle; -#endif - -#if LV_USE_SPAN != 0 - struct _snippet_stack * span_snippet_stack; -#endif - -#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN - struct lv_profiler_builtin_ctx_t * profiler_context; -#endif - -#if LV_USE_FILE_EXPLORER != 0 - lv_style_t fe_list_button_style; -#endif - -#if LV_USE_MEM_MONITOR - lv_sysmon_backend_data_t sysmon_mem; -#endif - -#if LV_USE_IME_PINYIN != 0 - size_t ime_cand_len; -#endif - -#if LV_USE_OBJ_ID_BUILTIN - void * objid_array; - uint32_t objid_count; -#endif - -#if LV_USE_NUTTX - struct lv_nuttx_ctx_t * nuttx_ctx; -#endif - -#if LV_USE_OS != LV_OS_NONE - lv_mutex_t lv_general_mutex; -#endif - -#if LV_USE_OS == LV_OS_FREERTOS - uint32_t freertos_idle_time_sum; - uint32_t freertos_non_idle_time_sum; - uint32_t freertos_task_switch_timestamp; - bool freertos_idle_task_running; -#endif - - - void * user_data; -} lv_global_t; - -/********************** - * MACROS - **********************/ - -#if LV_ENABLE_GLOBAL_CUSTOM -#include LV_GLOBAL_CUSTOM_INCLUDE - -#ifndef LV_GLOBAL_CUSTOM -#define LV_GLOBAL_CUSTOM() lv_global_default() -#endif -#define LV_GLOBAL_DEFAULT() LV_GLOBAL_CUSTOM() -#else -LV_ATTRIBUTE_EXTERN_DATA extern lv_global_t lv_global; -#define LV_GLOBAL_DEFAULT() (&lv_global) -#endif - -/********************** - * GLOBAL PROTOTYPES - **********************/ -#if LV_ENABLE_GLOBAL_CUSTOM -/** - * Get the default global object for current thread - * @return pointer to the default global object - */ -lv_global_t * lv_global_default(void); -#endif -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_GLOBAL_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_group.c b/L3_Middlewares/LVGL/src/core/lv_group.c index d1cdb31..63fde71 100644 --- a/L3_Middlewares/LVGL/src/core/lv_group.c +++ b/L3_Middlewares/LVGL/src/core/lv_group.c @@ -6,17 +6,16 @@ /********************* * INCLUDES *********************/ -#include "lv_group_private.h" -#include "../core/lv_obj_private.h" -#include "../core/lv_global.h" -#include "../indev/lv_indev.h" -#include "../misc/lv_types.h" +#include + +#include "lv_group.h" +#include "../misc/lv_gc.h" +#include "../core/lv_obj.h" +#include "../core/lv_indev.h" /********************* * DEFINES *********************/ -#define default_group LV_GLOBAL_DEFAULT()->group_default -#define group_ll_p &(LV_GLOBAL_DEFAULT()->group_ll) /********************** * TYPEDEFS @@ -33,6 +32,7 @@ static lv_indev_t * get_indev(const lv_group_t * g); /********************** * STATIC VARIABLES **********************/ +static lv_group_t * default_group; /********************** * MACROS @@ -42,22 +42,17 @@ static lv_indev_t * get_indev(const lv_group_t * g); * GLOBAL FUNCTIONS **********************/ -void lv_group_init(void) -{ - lv_ll_init(group_ll_p, sizeof(lv_group_t)); -} - -void lv_group_deinit(void) +void _lv_group_init(void) { - lv_ll_clear(group_ll_p); + _lv_ll_init(&LV_GC_ROOT(_lv_group_ll), sizeof(lv_group_t)); } lv_group_t * lv_group_create(void) { - lv_group_t * group = lv_ll_ins_head(group_ll_p); + lv_group_t * group = _lv_ll_ins_head(&LV_GC_ROOT(_lv_group_ll)); LV_ASSERT_MALLOC(group); if(group == NULL) return NULL; - lv_ll_init(&group->obj_ll, sizeof(lv_obj_t *)); + _lv_ll_init(&group->obj_ll, sizeof(lv_obj_t *)); group->obj_focus = NULL; group->frozen = 0; @@ -66,41 +61,41 @@ lv_group_t * lv_group_create(void) group->editing = 0; group->refocus_policy = LV_GROUP_REFOCUS_POLICY_PREV; group->wrap = 1; - group->user_data = NULL; + +#if LV_USE_USER_DATA + group->user_data = NULL; +#endif return group; } -void lv_group_delete(lv_group_t * group) +void lv_group_del(lv_group_t * group) { /*Defocus the currently focused object*/ - LV_ASSERT_NULL(group); if(group->obj_focus != NULL) { - lv_obj_send_event(*group->obj_focus, LV_EVENT_DEFOCUSED, get_indev(group)); + lv_event_send(*group->obj_focus, LV_EVENT_DEFOCUSED, get_indev(group)); lv_obj_invalidate(*group->obj_focus); } /*Remove the objects from the group*/ lv_obj_t ** obj; - LV_LL_READ(&group->obj_ll, obj) { + _LV_LL_READ(&group->obj_ll, obj) { if((*obj)->spec_attr)(*obj)->spec_attr->group_p = NULL; } /*Remove the group from any indev devices */ lv_indev_t * indev = lv_indev_get_next(NULL); while(indev) { - if(lv_indev_get_group(indev) == group) { + if(indev->group == group) { lv_indev_set_group(indev, NULL); } indev = lv_indev_get_next(indev); } - /*If the group is the default group, set the default group as NULL*/ - if(group == lv_group_get_default()) lv_group_set_default(NULL); - - lv_ll_clear(&(group->obj_ll)); - lv_ll_remove(group_ll_p, group); - lv_free(group); + if(default_group == group) default_group = NULL; + _lv_ll_clear(&(group->obj_ll)); + _lv_ll_remove(&LV_GC_ROOT(_lv_group_ll), group); + lv_mem_free(group); } void lv_group_set_default(lv_group_t * group) @@ -122,17 +117,36 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj) /*Be sure the object is removed from its current group*/ lv_group_remove_obj(obj); + /*Do not add the object twice*/ + lv_obj_t ** obj_i; + _LV_LL_READ(&group->obj_ll, obj_i) { + if((*obj_i) == obj) { + LV_LOG_INFO("the object is already added to this group"); + return; + } + } + + /*If the object is already in a group and focused then refocus it*/ + lv_group_t * group_cur = lv_obj_get_group(obj); + if(group_cur) { + if(obj->spec_attr->group_p && *(obj->spec_attr->group_p->obj_focus) == obj) { + lv_group_refocus(group_cur); + + LV_LOG_INFO("changing object's group"); + } + } + if(obj->spec_attr == NULL) lv_obj_allocate_spec_attr(obj); obj->spec_attr->group_p = group; - lv_obj_t ** next = lv_ll_ins_tail(&group->obj_ll); + lv_obj_t ** next = _lv_ll_ins_tail(&group->obj_ll); LV_ASSERT_MALLOC(next); if(next == NULL) return; *next = obj; /*If the head and the tail is equal then there is only one object in the linked list. *In this case automatically activate it*/ - if(lv_ll_get_head(&group->obj_ll) == next) { + if(_lv_ll_get_head(&group->obj_ll) == next) { lv_group_refocus(group); } @@ -148,14 +162,13 @@ void lv_group_swap_obj(lv_obj_t * obj1, lv_obj_t * obj2) /*Do not add the object twice*/ lv_obj_t ** obj_i; - LV_LL_READ(&g1->obj_ll, obj_i) { + _LV_LL_READ(&g1->obj_ll, obj_i) { if((*obj_i) == obj1)(*obj_i) = obj2; else if((*obj_i) == obj2)(*obj_i) = obj1; } - lv_obj_t * focused = lv_group_get_focused(g1); - if(focused == obj1) lv_group_focus_obj(obj2); - else if(focused == obj2) lv_group_focus_obj(obj1); + if(*g1->obj_focus == obj1) lv_group_focus_obj(obj2); + else if(*g1->obj_focus == obj2) lv_group_focus_obj(obj1); } @@ -171,8 +184,8 @@ void lv_group_remove_obj(lv_obj_t * obj) if(g->frozen) g->frozen = 0; /*If this is the only object in the group then focus to nothing.*/ - if(lv_ll_get_head(&g->obj_ll) == g->obj_focus && lv_ll_get_tail(&g->obj_ll) == g->obj_focus) { - lv_obj_send_event(*g->obj_focus, LV_EVENT_DEFOCUSED, get_indev(g)); + if(_lv_ll_get_head(&g->obj_ll) == g->obj_focus && _lv_ll_get_tail(&g->obj_ll) == g->obj_focus) { + lv_event_send(*g->obj_focus, LV_EVENT_DEFOCUSED, get_indev(g)); } /*If there more objects in the group then focus to the next/prev object*/ else { @@ -189,10 +202,10 @@ void lv_group_remove_obj(lv_obj_t * obj) /*Search the object and remove it from its group*/ lv_obj_t ** i; - LV_LL_READ(&g->obj_ll, i) { + _LV_LL_READ(&g->obj_ll, i) { if(*i == obj) { - lv_ll_remove(&g->obj_ll, i); - lv_free(i); + _lv_ll_remove(&g->obj_ll, i); + lv_mem_free(i); if(obj->spec_attr) obj->spec_attr->group_p = NULL; break; } @@ -202,22 +215,20 @@ void lv_group_remove_obj(lv_obj_t * obj) void lv_group_remove_all_objs(lv_group_t * group) { - LV_ASSERT_NULL(group); - /*Defocus the currently focused object*/ if(group->obj_focus != NULL) { - lv_obj_send_event(*group->obj_focus, LV_EVENT_DEFOCUSED, get_indev(group)); + lv_event_send(*group->obj_focus, LV_EVENT_DEFOCUSED, get_indev(group)); lv_obj_invalidate(*group->obj_focus); group->obj_focus = NULL; } /*Remove the objects from the group*/ lv_obj_t ** obj; - LV_LL_READ(&group->obj_ll, obj) { + _LV_LL_READ(&group->obj_ll, obj) { if((*obj)->spec_attr)(*obj)->spec_attr->group_p = NULL; } - lv_ll_clear(&(group->obj_ll)); + _lv_ll_clear(&(group->obj_ll)); } void lv_group_focus_obj(lv_obj_t * obj) @@ -232,11 +243,11 @@ void lv_group_focus_obj(lv_obj_t * obj) lv_group_set_editing(g, false); lv_obj_t ** i; - LV_LL_READ(&g->obj_ll, i) { + _LV_LL_READ(&g->obj_ll, i) { if(*i == obj) { if(g->obj_focus != NULL && obj != *g->obj_focus) { /*Do not defocus if the same object needs to be focused again*/ - lv_result_t res = lv_obj_send_event(*g->obj_focus, LV_EVENT_DEFOCUSED, get_indev(g)); - if(res != LV_RESULT_OK) return; + lv_res_t res = lv_event_send(*g->obj_focus, LV_EVENT_DEFOCUSED, get_indev(g)); + if(res != LV_RES_OK) return; lv_obj_invalidate(*g->obj_focus); } @@ -244,8 +255,8 @@ void lv_group_focus_obj(lv_obj_t * obj) if(g->obj_focus != NULL) { if(g->focus_cb) g->focus_cb(g); - lv_result_t res = lv_obj_send_event(*g->obj_focus, LV_EVENT_FOCUSED, get_indev(g)); - if(res != LV_RESULT_OK) return; + lv_res_t res = lv_event_send(*g->obj_focus, LV_EVENT_FOCUSED, get_indev(g)); + if(res != LV_RES_OK) return; lv_obj_invalidate(*g->obj_focus); } break; @@ -255,9 +266,7 @@ void lv_group_focus_obj(lv_obj_t * obj) void lv_group_focus_next(lv_group_t * group) { - LV_ASSERT_NULL(group); - - bool focus_changed = focus_next_core(group, lv_ll_get_head, lv_ll_get_next); + bool focus_changed = focus_next_core(group, _lv_ll_get_head, _lv_ll_get_next); if(group->edge_cb) { if(!focus_changed) group->edge_cb(group, true); @@ -266,9 +275,7 @@ void lv_group_focus_next(lv_group_t * group) void lv_group_focus_prev(lv_group_t * group) { - LV_ASSERT_NULL(group); - - bool focus_changed = focus_next_core(group, lv_ll_get_tail, lv_ll_get_prev); + bool focus_changed = focus_next_core(group, _lv_ll_get_tail, _lv_ll_get_prev); if(group->edge_cb) { if(!focus_changed) group->edge_cb(group, false); @@ -277,41 +284,33 @@ void lv_group_focus_prev(lv_group_t * group) void lv_group_focus_freeze(lv_group_t * group, bool en) { - LV_ASSERT_NULL(group); - if(en == false) group->frozen = 0; else group->frozen = 1; } -lv_result_t lv_group_send_data(lv_group_t * group, uint32_t c) +lv_res_t lv_group_send_data(lv_group_t * group, uint32_t c) { - LV_ASSERT_NULL(group); - lv_obj_t * act = lv_group_get_focused(group); - if(act == NULL) return LV_RESULT_OK; + if(act == NULL) return LV_RES_OK; - if(lv_obj_has_state(act, LV_STATE_DISABLED)) return LV_RESULT_OK; + if(lv_obj_has_state(act, LV_STATE_DISABLED)) return LV_RES_OK; - return lv_obj_send_event(act, LV_EVENT_KEY, &c); + return lv_event_send(act, LV_EVENT_KEY, &c); } void lv_group_set_focus_cb(lv_group_t * group, lv_group_focus_cb_t focus_cb) { - if(group == NULL) return; - group->focus_cb = focus_cb; } void lv_group_set_edge_cb(lv_group_t * group, lv_group_edge_cb_t edge_cb) { - LV_ASSERT_NULL(group); - group->edge_cb = edge_cb; } void lv_group_set_editing(lv_group_t * group, bool edit) { - LV_ASSERT_NULL(group); + if(group == NULL) return; uint8_t en_val = edit ? 1 : 0; if(en_val == group->editing) return; /*Do not set the same mode again*/ @@ -320,8 +319,8 @@ void lv_group_set_editing(lv_group_t * group, bool edit) lv_obj_t * focused = lv_group_get_focused(group); if(focused) { - lv_result_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_FOCUSED, get_indev(group)); - if(res != LV_RESULT_OK) return; + lv_res_t res = lv_event_send(*group->obj_focus, LV_EVENT_FOCUSED, get_indev(group)); + if(res != LV_RES_OK) return; lv_obj_invalidate(focused); } @@ -329,13 +328,11 @@ void lv_group_set_editing(lv_group_t * group, bool edit) void lv_group_set_refocus_policy(lv_group_t * group, lv_group_refocus_policy_t policy) { - LV_ASSERT_NULL(group); group->refocus_policy = policy & 0x01; } void lv_group_set_wrap(lv_group_t * group, bool en) { - LV_ASSERT_NULL(group); group->wrap = en ? 1 : 0; } @@ -362,53 +359,18 @@ lv_group_edge_cb_t lv_group_get_edge_cb(const lv_group_t * group) bool lv_group_get_editing(const lv_group_t * group) { if(!group) return false; - return group->editing; + return group->editing ? true : false; } bool lv_group_get_wrap(lv_group_t * group) { if(!group) return false; - return group->wrap; + return group->wrap ? true : false; } uint32_t lv_group_get_obj_count(lv_group_t * group) { - LV_ASSERT_NULL(group); - return lv_ll_get_len(&group->obj_ll); -} - -lv_obj_t * lv_group_get_obj_by_index(lv_group_t * group, uint32_t index) -{ - uint32_t len = 0; - lv_obj_t ** obj; - - LV_LL_READ(&group->obj_ll, obj) { - if(len == index) { - return *obj; - } - len++; - } - return NULL; -} - -uint32_t lv_group_get_count(void) -{ - return lv_ll_get_len(group_ll_p); -} - -lv_group_t * lv_group_by_index(uint32_t index) -{ - uint32_t len = 0; - lv_group_t * group; - - LV_LL_READ_BACK(group_ll_p, group) { - if(len == index) { - return group; - } - len++; - } - - return NULL; + return _lv_ll_get_len(&group->obj_ll); } /********************** * STATIC FUNCTIONS @@ -487,15 +449,15 @@ static bool focus_next_core(lv_group_t * group, void * (*begin)(const lv_ll_t *) if(obj_next == group->obj_focus) return focus_changed; /*There's only one visible object and it's already focused*/ if(group->obj_focus) { - lv_result_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_DEFOCUSED, get_indev(group)); - if(res != LV_RESULT_OK) return focus_changed; + lv_res_t res = lv_event_send(*group->obj_focus, LV_EVENT_DEFOCUSED, get_indev(group)); + if(res != LV_RES_OK) return focus_changed; lv_obj_invalidate(*group->obj_focus); } group->obj_focus = obj_next; - lv_result_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_FOCUSED, get_indev(group)); - if(res != LV_RESULT_OK) return focus_changed; + lv_res_t res = lv_event_send(*group->obj_focus, LV_EVENT_FOCUSED, get_indev(group)); + if(res != LV_RES_OK) return focus_changed; lv_obj_invalidate(*group->obj_focus); @@ -505,7 +467,7 @@ static bool focus_next_core(lv_group_t * group, void * (*begin)(const lv_ll_t *) } /** - * Find an indev preferably with POINTER type (because it's the most generic) that uses the given group. + * Find an indev preferably with KEYPAD or ENCOEDR type that uses the given group. * In other words, find an indev, that is related to the given group. * In the worst case simply return the latest indev * @param g a group the find in the indevs @@ -513,18 +475,24 @@ static bool focus_next_core(lv_group_t * group, void * (*begin)(const lv_ll_t *) */ static lv_indev_t * get_indev(const lv_group_t * g) { - lv_indev_t * indev_guess = NULL; + lv_indev_t * indev_encoder = NULL; + lv_indev_t * indev_group = NULL; lv_indev_t * indev = lv_indev_get_next(NULL); - while(indev) { lv_indev_type_t indev_type = lv_indev_get_type(indev); - /*Prefer POINTER*/ - if(indev_type == LV_INDEV_TYPE_POINTER) return indev; - if(lv_indev_get_group(indev) == g) { - indev_guess = indev; + if(indev->group == g) { + /*Prefer KEYPAD*/ + if(indev_type == LV_INDEV_TYPE_KEYPAD) return indev; + if(indev_type == LV_INDEV_TYPE_ENCODER) indev_encoder = indev; + indev_group = indev; } indev = lv_indev_get_next(indev); } - return indev_guess; + if(indev_encoder) return indev_encoder; + if(indev_group) return indev_group; + + /*In lack of a better option use the first input device. (It can be NULL if there is no input device)*/ + return lv_indev_get_next(NULL); } + diff --git a/L3_Middlewares/LVGL/src/core/lv_group.h b/L3_Middlewares/LVGL/src/core/lv_group.h index e5f267d..0910597 100644 --- a/L3_Middlewares/LVGL/src/core/lv_group.h +++ b/L3_Middlewares/LVGL/src/core/lv_group.h @@ -13,16 +13,20 @@ extern "C" { /********************* * INCLUDES *********************/ + #include "../lv_conf_internal.h" -#include "../misc/lv_types.h" +#include +#include #include "../misc/lv_ll.h" +#include "../misc/lv_types.h" /********************* * DEFINES *********************/ -/** Predefined keys to control focused object via lv_group_send(group, c) */ -typedef enum { +/*Predefined keys to control the focused object via lv_group_send(group, c)*/ + +enum { LV_KEY_UP = 17, /*0x11*/ LV_KEY_DOWN = 18, /*0x12*/ LV_KEY_RIGHT = 19, /*0x13*/ @@ -35,14 +39,44 @@ typedef enum { LV_KEY_PREV = 11, /*0x0B, '*/ LV_KEY_HOME = 2, /*0x02, STX*/ LV_KEY_END = 3, /*0x03, ETX*/ -} lv_key_t; +}; +typedef uint8_t lv_key_t; /********************** * TYPEDEFS **********************/ -typedef void (*lv_group_focus_cb_t)(lv_group_t *); -typedef void (*lv_group_edge_cb_t)(lv_group_t *, bool); +struct _lv_obj_t; +struct _lv_group_t; + +typedef void (*lv_group_focus_cb_t)(struct _lv_group_t *); +typedef void (*lv_group_edge_cb_t)(struct _lv_group_t *, bool); + +/** + * Groups can be used to logically hold objects so that they can be individually focused. + * They are NOT for laying out objects on a screen (try layouts for that). + */ +typedef struct _lv_group_t { + lv_ll_t obj_ll; /**< Linked list to store the objects in the group*/ + struct _lv_obj_t ** obj_focus; /**< The object in focus*/ + + lv_group_focus_cb_t focus_cb; /**< A function to call when a new object is focused (optional)*/ + lv_group_edge_cb_t edge_cb; /**< A function to call when an edge is reached, no more focus + targets are available in this direction (to allow edge feedback + like a sound or a scroll bounce) */ + +#if LV_USE_USER_DATA + void * user_data; +#endif + + uint8_t frozen : 1; /**< 1: can't focus to new object*/ + uint8_t editing : 1; /**< 1: Edit mode, 0: Navigate mode*/ + uint8_t refocus_policy : 1; /**< 1: Focus prev if focused on deletion. 0: Focus next if focused on + deletion.*/ + uint8_t wrap : 1; /**< 1: Focus next/prev can wrap at end of list. 0: Focus next/prev stops at end + of list.*/ +} lv_group_t; + typedef enum { LV_GROUP_REFOCUS_POLICY_NEXT = 0, @@ -53,6 +87,12 @@ typedef enum { * GLOBAL PROTOTYPES **********************/ +/** + * Init. the group module + * @remarks Internal function, do not call directly. + */ +void _lv_group_init(void); + /** * Create a new object group * @return pointer to the new object group @@ -63,7 +103,7 @@ lv_group_t * lv_group_create(void); * Delete a group object * @param group pointer to a group */ -void lv_group_delete(lv_group_t * group); +void lv_group_del(lv_group_t * group); /** * Set a default group. New object are added to this group if it's enabled in their class with `add_to_def_group = true` @@ -82,20 +122,20 @@ lv_group_t * lv_group_get_default(void); * @param group pointer to a group * @param obj pointer to an object to add */ -void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj); +void lv_group_add_obj(lv_group_t * group, struct _lv_obj_t * obj); /** * Swap 2 object in a group. The object must be in the same group * @param obj1 pointer to an object - * @param obj2 pointer to another object + * @param obj2 pointer to an other object */ -void lv_group_swap_obj(lv_obj_t * obj1, lv_obj_t * obj2); +void lv_group_swap_obj(struct _lv_obj_t * obj1, struct _lv_obj_t * obj2); /** * Remove an object from its group * @param obj pointer to an object to remove */ -void lv_group_remove_obj(lv_obj_t * obj); +void lv_group_remove_obj(struct _lv_obj_t * obj); /** * Remove all objects from a group @@ -107,7 +147,7 @@ void lv_group_remove_all_objs(lv_group_t * group); * Focus on an object (defocus the current) * @param obj pointer to an object to focus on */ -void lv_group_focus_obj(lv_obj_t * obj); +void lv_group_focus_obj(struct _lv_obj_t * obj); /** * Focus the next object in a group (defocus the current) @@ -134,7 +174,7 @@ void lv_group_focus_freeze(lv_group_t * group, bool en); * @param c a character (use LV_KEY_.. to navigate) * @return result of focused object in group. */ -lv_result_t lv_group_send_data(lv_group_t * group, uint32_t c); +lv_res_t lv_group_send_data(lv_group_t * group, uint32_t c); /** * Set a function for a group which will be called when a new object is focused @@ -150,6 +190,7 @@ void lv_group_set_focus_cb(lv_group_t * group, lv_group_focus_cb_t focus_cb); */ void lv_group_set_edge_cb(lv_group_t * group, lv_group_edge_cb_t edge_cb); + /** * Set whether the next or previous item in a group is focused if the currently focused obj is * deleted. @@ -177,7 +218,7 @@ void lv_group_set_wrap(lv_group_t * group, bool en); * @param group pointer to a group * @return pointer to the focused object */ -lv_obj_t * lv_group_get_focused(const lv_group_t * group); +struct _lv_obj_t * lv_group_get_focused(const lv_group_t * group); /** * Get the focus callback function of a group @@ -203,6 +244,7 @@ bool lv_group_get_editing(const lv_group_t * group); /** * Get whether focus next/prev will allow wrapping from first->last or last->first object. * @param group pointer to group + * @param en true: wrapping enabled; false: wrapping disabled */ bool lv_group_get_wrap(lv_group_t * group); @@ -213,27 +255,6 @@ bool lv_group_get_wrap(lv_group_t * group); */ uint32_t lv_group_get_obj_count(lv_group_t * group); -/** - * Get the nth object within a group - * @param group pointer to a group - * @param index index of object within the group - * @return pointer to the object - */ -lv_obj_t * lv_group_get_obj_by_index(lv_group_t * group, uint32_t index); - -/** - * Get the number of groups - * @return number of groups - */ -uint32_t lv_group_get_count(void); - -/** - * Get a group by its index - * @param index index of the group - * @return pointer to the group - */ -lv_group_t * lv_group_by_index(uint32_t index); - /********************** * MACROS **********************/ diff --git a/L3_Middlewares/LVGL/src/core/lv_group_private.h b/L3_Middlewares/LVGL/src/core/lv_group_private.h deleted file mode 100644 index 33b7640..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_group_private.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file lv_group_private.h - * - */ - -#ifndef LV_GROUP_PRIVATE_H -#define LV_GROUP_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_group.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * Groups can be used to logically hold objects so that they can be individually focused. - * They are NOT for laying out objects on a screen (try layouts for that). - */ -struct lv_group_t { - lv_ll_t obj_ll; /**< Linked list to store the objects in the group*/ - lv_obj_t ** obj_focus; /**< The object in focus*/ - - lv_group_focus_cb_t focus_cb; /**< A function to call when a new object is focused (optional)*/ - lv_group_edge_cb_t edge_cb; /**< A function to call when an edge is reached, no more focus - targets are available in this direction (to allow edge feedback - like a sound or a scroll bounce) */ - - void * user_data; - - uint8_t frozen : 1; /**< 1: can't focus to new object*/ - uint8_t editing : 1; /**< 1: Edit mode, 0: Navigate mode*/ - uint8_t refocus_policy : 1; /**< 1: Focus prev if focused on deletion. 0: Focus next if focused on - deletion.*/ - uint8_t wrap : 1; /**< 1: Focus next/prev can wrap at end of list. 0: Focus next/prev stops at end - of list.*/ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Init the group module - * @remarks Internal function, do not call directly. - */ -void lv_group_init(void); - -/** - * Deinit the group module - * @remarks Internal function, do not call directly. - */ -void lv_group_deinit(void); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_GROUP_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_indev.c b/L3_Middlewares/LVGL/src/core/lv_indev.c new file mode 100644 index 0000000..9192f84 --- /dev/null +++ b/L3_Middlewares/LVGL/src/core/lv_indev.c @@ -0,0 +1,1180 @@ +/** + * @file lv_indev.c + * + */ + +/********************* + * INCLUDES + ********************/ +#include "lv_indev.h" +#include "lv_disp.h" +#include "lv_obj.h" +#include "lv_indev_scroll.h" +#include "lv_group.h" +#include "lv_refr.h" + +#include "../hal/lv_hal_tick.h" +#include "../misc/lv_timer.h" +#include "../misc/lv_math.h" + +/********************* + * DEFINES + *********************/ +#if LV_INDEV_DEF_SCROLL_THROW <= 0 + #warning "LV_INDEV_DRAG_THROW must be greater than 0" +#endif + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data); +static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data); +static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data); +static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data); +static void indev_proc_press(_lv_indev_proc_t * proc); +static void indev_proc_release(_lv_indev_proc_t * proc); +static void indev_proc_reset_query_handler(lv_indev_t * indev); +static void indev_click_focus(_lv_indev_proc_t * proc); +static void indev_gesture(_lv_indev_proc_t * proc); +static bool indev_reset_check(_lv_indev_proc_t * proc); + +/********************** + * STATIC VARIABLES + **********************/ +static lv_indev_t * indev_act; +static lv_obj_t * indev_obj_act = NULL; + +/********************** + * MACROS + **********************/ +#if LV_LOG_TRACE_INDEV + #define INDEV_TRACE(...) LV_LOG_TRACE(__VA_ARGS__) +#else + #define INDEV_TRACE(...) +#endif + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_indev_read_timer_cb(lv_timer_t * timer) +{ + INDEV_TRACE("begin"); + + lv_indev_data_t data; + + indev_act = timer->user_data; + + /*Read and process all indevs*/ + if(indev_act->driver->disp == NULL) return; /*Not assigned to any displays*/ + + /*Handle reset query before processing the point*/ + indev_proc_reset_query_handler(indev_act); + + if(indev_act->proc.disabled || + indev_act->driver->disp->prev_scr != NULL) return; /*Input disabled or screen animation active*/ + bool continue_reading; + do { + /*Read the data*/ + _lv_indev_read(indev_act, &data); + continue_reading = data.continue_reading; + + /*The active object might be deleted even in the read function*/ + indev_proc_reset_query_handler(indev_act); + indev_obj_act = NULL; + + indev_act->proc.state = data.state; + + /*Save the last activity time*/ + if(indev_act->proc.state == LV_INDEV_STATE_PRESSED) { + indev_act->driver->disp->last_activity_time = lv_tick_get(); + } + else if(indev_act->driver->type == LV_INDEV_TYPE_ENCODER && data.enc_diff) { + indev_act->driver->disp->last_activity_time = lv_tick_get(); + } + + if(indev_act->driver->type == LV_INDEV_TYPE_POINTER) { + indev_pointer_proc(indev_act, &data); + } + else if(indev_act->driver->type == LV_INDEV_TYPE_KEYPAD) { + indev_keypad_proc(indev_act, &data); + } + else if(indev_act->driver->type == LV_INDEV_TYPE_ENCODER) { + indev_encoder_proc(indev_act, &data); + } + else if(indev_act->driver->type == LV_INDEV_TYPE_BUTTON) { + indev_button_proc(indev_act, &data); + } + /*Handle reset query if it happened in during processing*/ + indev_proc_reset_query_handler(indev_act); + } while(continue_reading); + + /*End of indev processing, so no act indev*/ + indev_act = NULL; + indev_obj_act = NULL; + + INDEV_TRACE("finished"); +} + +void lv_indev_enable(lv_indev_t * indev, bool en) +{ + uint8_t enable = en ? 0 : 1; + + if(indev) { + indev->proc.disabled = enable; + } + else { + lv_indev_t * i = lv_indev_get_next(NULL); + while(i) { + i->proc.disabled = enable; + i = lv_indev_get_next(i); + } + } +} + +lv_indev_t * lv_indev_get_act(void) +{ + return indev_act; +} + +lv_indev_type_t lv_indev_get_type(const lv_indev_t * indev) +{ + if(indev == NULL) return LV_INDEV_TYPE_NONE; + + return indev->driver->type; +} + +void lv_indev_reset(lv_indev_t * indev, lv_obj_t * obj) +{ + if(indev) { + indev->proc.reset_query = 1; + if(indev_act == indev) indev_obj_act = NULL; + if(indev->driver->type == LV_INDEV_TYPE_POINTER || indev->driver->type == LV_INDEV_TYPE_KEYPAD) { + if(obj == NULL || indev->proc.types.pointer.last_pressed == obj) { + indev->proc.types.pointer.last_pressed = NULL; + } + if(obj == NULL || indev->proc.types.pointer.act_obj == obj) { + indev->proc.types.pointer.act_obj = NULL; + } + if(obj == NULL || indev->proc.types.pointer.last_obj == obj) { + indev->proc.types.pointer.last_obj = NULL; + } + } + } + else { + lv_indev_t * i = lv_indev_get_next(NULL); + while(i) { + i->proc.reset_query = 1; + if(i->driver->type == LV_INDEV_TYPE_POINTER || i->driver->type == LV_INDEV_TYPE_KEYPAD) { + if(obj == NULL || i->proc.types.pointer.last_pressed == obj) { + i->proc.types.pointer.last_pressed = NULL; + } + if(obj == NULL || i->proc.types.pointer.act_obj == obj) { + i->proc.types.pointer.act_obj = NULL; + } + if(obj == NULL || i->proc.types.pointer.last_obj == obj) { + i->proc.types.pointer.last_obj = NULL; + } + } + i = lv_indev_get_next(i); + } + indev_obj_act = NULL; + } +} + +void lv_indev_reset_long_press(lv_indev_t * indev) +{ + indev->proc.long_pr_sent = 0; + indev->proc.longpr_rep_timestamp = lv_tick_get(); + indev->proc.pr_timestamp = lv_tick_get(); +} + +void lv_indev_set_cursor(lv_indev_t * indev, lv_obj_t * cur_obj) +{ + if(indev->driver->type != LV_INDEV_TYPE_POINTER) return; + + indev->cursor = cur_obj; + lv_obj_set_parent(indev->cursor, lv_disp_get_layer_sys(indev->driver->disp)); + lv_obj_set_pos(indev->cursor, indev->proc.types.pointer.act_point.x, indev->proc.types.pointer.act_point.y); + lv_obj_clear_flag(indev->cursor, LV_OBJ_FLAG_CLICKABLE); + lv_obj_add_flag(indev->cursor, LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_FLOATING); +} + +void lv_indev_set_group(lv_indev_t * indev, lv_group_t * group) +{ + if(indev->driver->type == LV_INDEV_TYPE_KEYPAD || indev->driver->type == LV_INDEV_TYPE_ENCODER) { + indev->group = group; + } +} + +void lv_indev_set_button_points(lv_indev_t * indev, const lv_point_t points[]) +{ + if(indev->driver->type == LV_INDEV_TYPE_BUTTON) { + indev->btn_points = points; + } +} + +void lv_indev_get_point(const lv_indev_t * indev, lv_point_t * point) +{ + if(indev == NULL) { + point->x = 0; + point->y = 0; + return; + } + if(indev->driver->type != LV_INDEV_TYPE_POINTER && indev->driver->type != LV_INDEV_TYPE_BUTTON) { + point->x = -1; + point->y = -1; + } + else { + point->x = indev->proc.types.pointer.act_point.x; + point->y = indev->proc.types.pointer.act_point.y; + } +} + +lv_dir_t lv_indev_get_gesture_dir(const lv_indev_t * indev) +{ + return indev->proc.types.pointer.gesture_dir; +} + +uint32_t lv_indev_get_key(const lv_indev_t * indev) +{ + if(indev->driver->type != LV_INDEV_TYPE_KEYPAD) + return 0; + else + return indev->proc.types.keypad.last_key; +} + +lv_dir_t lv_indev_get_scroll_dir(const lv_indev_t * indev) +{ + if(indev == NULL) return false; + if(indev->driver->type != LV_INDEV_TYPE_POINTER && indev->driver->type != LV_INDEV_TYPE_BUTTON) return false; + return indev->proc.types.pointer.scroll_dir; +} + +lv_obj_t * lv_indev_get_scroll_obj(const lv_indev_t * indev) +{ + if(indev == NULL) return NULL; + if(indev->driver->type != LV_INDEV_TYPE_POINTER && indev->driver->type != LV_INDEV_TYPE_BUTTON) return NULL; + return indev->proc.types.pointer.scroll_obj; +} + +void lv_indev_get_vect(const lv_indev_t * indev, lv_point_t * point) +{ + point->x = 0; + point->y = 0; + + if(indev == NULL) return; + + if(indev->driver->type == LV_INDEV_TYPE_POINTER || indev->driver->type == LV_INDEV_TYPE_BUTTON) { + point->x = indev->proc.types.pointer.vect.x; + point->y = indev->proc.types.pointer.vect.y; + } +} + +void lv_indev_wait_release(lv_indev_t * indev) +{ + if(indev == NULL)return; + indev->proc.wait_until_release = 1; +} + +lv_obj_t * lv_indev_get_obj_act(void) +{ + return indev_obj_act; +} + +lv_timer_t * lv_indev_get_read_timer(lv_disp_t * indev) +{ + if(!indev) { + LV_LOG_WARN("lv_indev_get_read_timer: indev was NULL"); + return NULL; + } + + return indev->refr_timer; +} + + +lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point) +{ + lv_obj_t * found_p = NULL; + + /*If this obj is hidden the children are hidden too so return immediately*/ + if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return NULL; + + lv_point_t p_trans = *point; + lv_obj_transform_point(obj, &p_trans, false, true); + + bool hit_test_ok = lv_obj_hit_test(obj, &p_trans); + + /*If the point is on this object or has overflow visible check its children too*/ + if(_lv_area_is_point_on(&obj->coords, &p_trans, 0) || lv_obj_has_flag(obj, LV_OBJ_FLAG_OVERFLOW_VISIBLE)) { + int32_t i; + uint32_t child_cnt = lv_obj_get_child_cnt(obj); + + /*If a child matches use it*/ + for(i = child_cnt - 1; i >= 0; i--) { + lv_obj_t * child = obj->spec_attr->children[i]; + found_p = lv_indev_search_obj(child, &p_trans); + if(found_p) return found_p; + } + } + + /*If not return earlier for a clicked child and this obj's hittest was ok use it + *else return NULL*/ + if(hit_test_ok) return obj; + else return NULL; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +/** + * Process a new point from LV_INDEV_TYPE_POINTER input device + * @param i pointer to an input device + * @param data pointer to the data read from the input device + */ +static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data) +{ + lv_disp_t * disp = i->driver->disp; + /*Save the raw points so they can be used again in _lv_indev_read*/ + i->proc.types.pointer.last_raw_point.x = data->point.x; + i->proc.types.pointer.last_raw_point.y = data->point.y; + + if(disp->driver->rotated == LV_DISP_ROT_180 || disp->driver->rotated == LV_DISP_ROT_270) { + data->point.x = disp->driver->hor_res - data->point.x - 1; + data->point.y = disp->driver->ver_res - data->point.y - 1; + } + if(disp->driver->rotated == LV_DISP_ROT_90 || disp->driver->rotated == LV_DISP_ROT_270) { + lv_coord_t tmp = data->point.y; + data->point.y = data->point.x; + data->point.x = disp->driver->ver_res - tmp - 1; + } + + /*Simple sanity check*/ + if(data->point.x < 0) { + LV_LOG_WARN("X is %d which is smaller than zero", (int)data->point.x); + } + if(data->point.x >= lv_disp_get_hor_res(i->driver->disp)) { + LV_LOG_WARN("X is %d which is greater than hor. res", (int)data->point.x); + } + if(data->point.y < 0) { + LV_LOG_WARN("Y is %d which is smaller than zero", (int)data->point.y); + } + if(data->point.y >= lv_disp_get_ver_res(i->driver->disp)) { + LV_LOG_WARN("Y is %d which is greater than ver. res", (int)data->point.y); + } + + /*Move the cursor if set and moved*/ + if(i->cursor != NULL && + (i->proc.types.pointer.last_point.x != data->point.x || i->proc.types.pointer.last_point.y != data->point.y)) { + lv_obj_set_pos(i->cursor, data->point.x, data->point.y); + } + + i->proc.types.pointer.act_point.x = data->point.x; + i->proc.types.pointer.act_point.y = data->point.y; + + if(i->proc.state == LV_INDEV_STATE_PRESSED) { + indev_proc_press(&i->proc); + } + else { + indev_proc_release(&i->proc); + } + + i->proc.types.pointer.last_point.x = i->proc.types.pointer.act_point.x; + i->proc.types.pointer.last_point.y = i->proc.types.pointer.act_point.y; +} + +/** + * Process a new point from LV_INDEV_TYPE_KEYPAD input device + * @param i pointer to an input device + * @param data pointer to the data read from the input device + */ +static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data) +{ + if(data->state == LV_INDEV_STATE_PRESSED && i->proc.wait_until_release) return; + + if(i->proc.wait_until_release) { + i->proc.wait_until_release = 0; + i->proc.pr_timestamp = 0; + i->proc.long_pr_sent = 0; + i->proc.types.keypad.last_state = LV_INDEV_STATE_RELEASED; /*To skip the processing of release*/ + } + + lv_group_t * g = i->group; + if(g == NULL) return; + + indev_obj_act = lv_group_get_focused(g); + if(indev_obj_act == NULL) return; + + bool dis = lv_obj_has_state(indev_obj_act, LV_STATE_DISABLED); + + /*Save the last key to compare it with the current latter on RELEASE*/ + uint32_t prev_key = i->proc.types.keypad.last_key; + + /*Save the last key. + *It must be done here else `lv_indev_get_key` will return the last key in events*/ + i->proc.types.keypad.last_key = data->key; + + /*Save the previous state so we can detect state changes below and also set the last state now + *so if any event handler on the way returns `LV_RES_INV` the last state is remembered + *for the next time*/ + uint32_t prev_state = i->proc.types.keypad.last_state; + i->proc.types.keypad.last_state = data->state; + + /*Key press happened*/ + if(data->state == LV_INDEV_STATE_PRESSED && prev_state == LV_INDEV_STATE_RELEASED) { + LV_LOG_INFO("%" LV_PRIu32 " key is pressed", data->key); + i->proc.pr_timestamp = lv_tick_get(); + + /*Move the focus on NEXT*/ + if(data->key == LV_KEY_NEXT) { + lv_group_set_editing(g, false); /*Editing is not used by KEYPAD is be sure it is disabled*/ + lv_group_focus_next(g); + if(indev_reset_check(&i->proc)) return; + } + /*Move the focus on PREV*/ + else if(data->key == LV_KEY_PREV) { + lv_group_set_editing(g, false); /*Editing is not used by KEYPAD is be sure it is disabled*/ + lv_group_focus_prev(g); + if(indev_reset_check(&i->proc)) return; + } + else if(!dis) { + /*Simulate a press on the object if ENTER was pressed*/ + if(data->key == LV_KEY_ENTER) { + /*Send the ENTER as a normal KEY*/ + lv_group_send_data(g, LV_KEY_ENTER); + if(indev_reset_check(&i->proc)) return; + + if(!dis) lv_event_send(indev_obj_act, LV_EVENT_PRESSED, indev_act); + if(indev_reset_check(&i->proc)) return; + } + else if(data->key == LV_KEY_ESC) { + /*Send the ESC as a normal KEY*/ + lv_group_send_data(g, LV_KEY_ESC); + if(indev_reset_check(&i->proc)) return; + + lv_event_send(indev_obj_act, LV_EVENT_CANCEL, indev_act); + if(indev_reset_check(&i->proc)) return; + } + /*Just send other keys to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT`)*/ + else { + lv_group_send_data(g, data->key); + if(indev_reset_check(&i->proc)) return; + } + } + } + /*Pressing*/ + else if(!dis && data->state == LV_INDEV_STATE_PRESSED && prev_state == LV_INDEV_STATE_PRESSED) { + + if(data->key == LV_KEY_ENTER) { + lv_event_send(indev_obj_act, LV_EVENT_PRESSING, indev_act); + if(indev_reset_check(&i->proc)) return; + } + + /*Long press time has elapsed?*/ + if(i->proc.long_pr_sent == 0 && lv_tick_elaps(i->proc.pr_timestamp) > i->driver->long_press_time) { + i->proc.long_pr_sent = 1; + if(data->key == LV_KEY_ENTER) { + i->proc.longpr_rep_timestamp = lv_tick_get(); + lv_event_send(indev_obj_act, LV_EVENT_LONG_PRESSED, indev_act); + if(indev_reset_check(&i->proc)) return; + } + } + /*Long press repeated time has elapsed?*/ + else if(i->proc.long_pr_sent != 0 && + lv_tick_elaps(i->proc.longpr_rep_timestamp) > i->driver->long_press_repeat_time) { + + i->proc.longpr_rep_timestamp = lv_tick_get(); + + /*Send LONG_PRESS_REP on ENTER*/ + if(data->key == LV_KEY_ENTER) { + lv_event_send(indev_obj_act, LV_EVENT_LONG_PRESSED_REPEAT, indev_act); + if(indev_reset_check(&i->proc)) return; + } + /*Move the focus on NEXT again*/ + else if(data->key == LV_KEY_NEXT) { + lv_group_set_editing(g, false); /*Editing is not used by KEYPAD is be sure it is disabled*/ + lv_group_focus_next(g); + if(indev_reset_check(&i->proc)) return; + } + /*Move the focus on PREV again*/ + else if(data->key == LV_KEY_PREV) { + lv_group_set_editing(g, false); /*Editing is not used by KEYPAD is be sure it is disabled*/ + lv_group_focus_prev(g); + if(indev_reset_check(&i->proc)) return; + } + /*Just send other keys again to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT)*/ + else { + lv_group_send_data(g, data->key); + if(indev_reset_check(&i->proc)) return; + } + } + } + /*Release happened*/ + else if(!dis && data->state == LV_INDEV_STATE_RELEASED && prev_state == LV_INDEV_STATE_PRESSED) { + LV_LOG_INFO("%" LV_PRIu32 " key is released", data->key); + /*The user might clear the key when it was released. Always release the pressed key*/ + data->key = prev_key; + if(data->key == LV_KEY_ENTER) { + + lv_event_send(indev_obj_act, LV_EVENT_RELEASED, indev_act); + if(indev_reset_check(&i->proc)) return; + + if(i->proc.long_pr_sent == 0) { + lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, indev_act); + if(indev_reset_check(&i->proc)) return; + } + + lv_event_send(indev_obj_act, LV_EVENT_CLICKED, indev_act); + if(indev_reset_check(&i->proc)) return; + + } + i->proc.pr_timestamp = 0; + i->proc.long_pr_sent = 0; + } + indev_obj_act = NULL; +} + +/** + * Process a new point from LV_INDEV_TYPE_ENCODER input device + * @param i pointer to an input device + * @param data pointer to the data read from the input device + */ +static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) +{ + if(data->state == LV_INDEV_STATE_PRESSED && i->proc.wait_until_release) return; + + if(i->proc.wait_until_release) { + i->proc.wait_until_release = 0; + i->proc.pr_timestamp = 0; + i->proc.long_pr_sent = 0; + i->proc.types.keypad.last_state = LV_INDEV_STATE_RELEASED; /*To skip the processing of release*/ + } + + /*Save the last keys before anything else. + *They need to be already saved if the function returns for any reason*/ + lv_indev_state_t last_state = i->proc.types.keypad.last_state; + i->proc.types.keypad.last_state = data->state; + i->proc.types.keypad.last_key = data->key; + + lv_group_t * g = i->group; + if(g == NULL) return; + + indev_obj_act = lv_group_get_focused(g); + if(indev_obj_act == NULL) return; + + /*Process the steps they are valid only with released button*/ + if(data->state != LV_INDEV_STATE_RELEASED) { + data->enc_diff = 0; + } + + /*Refresh the focused object. It might change due to lv_group_focus_prev/next*/ + indev_obj_act = lv_group_get_focused(g); + if(indev_obj_act == NULL) return; + + /*Button press happened*/ + if(data->state == LV_INDEV_STATE_PRESSED && last_state == LV_INDEV_STATE_RELEASED) { + LV_LOG_INFO("pressed"); + + i->proc.pr_timestamp = lv_tick_get(); + + if(data->key == LV_KEY_ENTER) { + bool editable_or_scrollable = lv_obj_is_editable(indev_obj_act) || + lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_SCROLLABLE); + if(lv_group_get_editing(g) == true || editable_or_scrollable == false) { + lv_event_send(indev_obj_act, LV_EVENT_PRESSED, indev_act); + if(indev_reset_check(&i->proc)) return; + } + } + else if(data->key == LV_KEY_LEFT) { + /*emulate encoder left*/ + data->enc_diff--; + } + else if(data->key == LV_KEY_RIGHT) { + /*emulate encoder right*/ + data->enc_diff++; + } + else if(data->key == LV_KEY_ESC) { + /*Send the ESC as a normal KEY*/ + lv_group_send_data(g, LV_KEY_ESC); + if(indev_reset_check(&i->proc)) return; + + lv_event_send(indev_obj_act, LV_EVENT_CANCEL, indev_act); + if(indev_reset_check(&i->proc)) return; + } + /*Just send other keys to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT`)*/ + else { + lv_group_send_data(g, data->key); + if(indev_reset_check(&i->proc)) return; + } + } + /*Pressing*/ + else if(data->state == LV_INDEV_STATE_PRESSED && last_state == LV_INDEV_STATE_PRESSED) { + /*Long press*/ + if(i->proc.long_pr_sent == 0 && lv_tick_elaps(i->proc.pr_timestamp) > i->driver->long_press_time) { + + i->proc.long_pr_sent = 1; + i->proc.longpr_rep_timestamp = lv_tick_get(); + + if(data->key == LV_KEY_ENTER) { + bool editable_or_scrollable = lv_obj_is_editable(indev_obj_act) || + lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_SCROLLABLE); + + /*On enter long press toggle edit mode.*/ + if(editable_or_scrollable) { + /*Don't leave edit mode if there is only one object (nowhere to navigate)*/ + if(lv_group_get_obj_count(g) > 1) { + LV_LOG_INFO("toggling edit mode"); + lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/ + lv_obj_clear_state(indev_obj_act, LV_STATE_PRESSED); /*Remove the pressed state manually*/ + } + } + /*If not editable then just send a long press Call the ancestor's event handler*/ + else { + lv_event_send(indev_obj_act, LV_EVENT_LONG_PRESSED, indev_act); + if(indev_reset_check(&i->proc)) return; + } + } + + i->proc.long_pr_sent = 1; + } + /*Long press repeated time has elapsed?*/ + else if(i->proc.long_pr_sent != 0 && lv_tick_elaps(i->proc.longpr_rep_timestamp) > i->driver->long_press_repeat_time) { + + i->proc.longpr_rep_timestamp = lv_tick_get(); + + if(data->key == LV_KEY_ENTER) { + lv_event_send(indev_obj_act, LV_EVENT_LONG_PRESSED_REPEAT, indev_act); + if(indev_reset_check(&i->proc)) return; + } + else if(data->key == LV_KEY_LEFT) { + /*emulate encoder left*/ + data->enc_diff--; + } + else if(data->key == LV_KEY_RIGHT) { + /*emulate encoder right*/ + data->enc_diff++; + } + else { + lv_group_send_data(g, data->key); + if(indev_reset_check(&i->proc)) return; + } + + } + + } + /*Release happened*/ + else if(data->state == LV_INDEV_STATE_RELEASED && last_state == LV_INDEV_STATE_PRESSED) { + LV_LOG_INFO("released"); + + if(data->key == LV_KEY_ENTER) { + bool editable_or_scrollable = lv_obj_is_editable(indev_obj_act) || + lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_SCROLLABLE); + + /*The button was released on a non-editable object. Just send enter*/ + if(editable_or_scrollable == false) { + lv_event_send(indev_obj_act, LV_EVENT_RELEASED, indev_act); + if(indev_reset_check(&i->proc)) return; + + if(i->proc.long_pr_sent == 0) lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, indev_act); + if(indev_reset_check(&i->proc)) return; + + lv_event_send(indev_obj_act, LV_EVENT_CLICKED, indev_act); + if(indev_reset_check(&i->proc)) return; + + } + /*An object is being edited and the button is released.*/ + else if(lv_group_get_editing(g)) { + /*Ignore long pressed enter release because it comes from mode switch*/ + if(!i->proc.long_pr_sent || lv_group_get_obj_count(g) <= 1) { + lv_event_send(indev_obj_act, LV_EVENT_RELEASED, indev_act); + if(indev_reset_check(&i->proc)) return; + + lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, indev_act); + if(indev_reset_check(&i->proc)) return; + + lv_event_send(indev_obj_act, LV_EVENT_CLICKED, indev_act); + if(indev_reset_check(&i->proc)) return; + + lv_group_send_data(g, LV_KEY_ENTER); + if(indev_reset_check(&i->proc)) return; + } + else { + lv_obj_clear_state(indev_obj_act, LV_STATE_PRESSED); /*Remove the pressed state manually*/ + } + } + /*If the focused object is editable and now in navigate mode then on enter switch edit + mode*/ + else if(!i->proc.long_pr_sent) { + LV_LOG_INFO("entering edit mode"); + lv_group_set_editing(g, true); /*Set edit mode*/ + } + } + + i->proc.pr_timestamp = 0; + i->proc.long_pr_sent = 0; + } + indev_obj_act = NULL; + + /*if encoder steps or simulated steps via left/right keys*/ + if(data->enc_diff != 0) { + /*In edit mode send LEFT/RIGHT keys*/ + if(lv_group_get_editing(g)) { + LV_LOG_INFO("rotated by %+d (edit)", data->enc_diff); + int32_t s; + if(data->enc_diff < 0) { + for(s = 0; s < -data->enc_diff; s++) { + lv_group_send_data(g, LV_KEY_LEFT); + if(indev_reset_check(&i->proc)) return; + } + } + else if(data->enc_diff > 0) { + for(s = 0; s < data->enc_diff; s++) { + lv_group_send_data(g, LV_KEY_RIGHT); + if(indev_reset_check(&i->proc)) return; + } + } + } + /*In navigate mode focus on the next/prev objects*/ + else { + LV_LOG_INFO("rotated by %+d (nav)", data->enc_diff); + int32_t s; + if(data->enc_diff < 0) { + for(s = 0; s < -data->enc_diff; s++) { + lv_group_focus_prev(g); + if(indev_reset_check(&i->proc)) return; + } + } + else if(data->enc_diff > 0) { + for(s = 0; s < data->enc_diff; s++) { + lv_group_focus_next(g); + if(indev_reset_check(&i->proc)) return; + } + } + } + } +} + +/** + * Process new points from an input device. indev->state.pressed has to be set + * @param indev pointer to an input device state + * @param x x coordinate of the next point + * @param y y coordinate of the next point + */ +static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data) +{ + /*Die gracefully if i->btn_points is NULL*/ + if(i->btn_points == NULL) { + LV_LOG_WARN("btn_points is NULL"); + return; + } + + lv_coord_t x = i->btn_points[data->btn_id].x; + lv_coord_t y = i->btn_points[data->btn_id].y; + + static lv_indev_state_t prev_state = LV_INDEV_STATE_RELEASED; + if(prev_state != data->state) { + if(data->state == LV_INDEV_STATE_PRESSED) { + LV_LOG_INFO("button %" LV_PRIu32 " is pressed (x:%d y:%d)", data->btn_id, x, y); + } + else { + LV_LOG_INFO("button %" LV_PRIu32 " is released (x:%d y:%d)", data->btn_id, x, y); + } + } + + /*If a new point comes always make a release*/ + if(data->state == LV_INDEV_STATE_PRESSED) { + if(i->proc.types.pointer.last_point.x != x || + i->proc.types.pointer.last_point.y != y) { + indev_proc_release(&i->proc); + } + } + + if(indev_reset_check(&i->proc)) return; + + /*Save the new points*/ + i->proc.types.pointer.act_point.x = x; + i->proc.types.pointer.act_point.y = y; + + if(data->state == LV_INDEV_STATE_PRESSED) indev_proc_press(&i->proc); + else indev_proc_release(&i->proc); + + if(indev_reset_check(&i->proc)) return; + + i->proc.types.pointer.last_point.x = i->proc.types.pointer.act_point.x; + i->proc.types.pointer.last_point.y = i->proc.types.pointer.act_point.y; +} + +/** + * Process the pressed state of LV_INDEV_TYPE_POINTER input devices + * @param indev pointer to an input device 'proc' + * @return LV_RES_OK: no indev reset required; LV_RES_INV: indev reset is required + */ +static void indev_proc_press(_lv_indev_proc_t * proc) +{ + LV_LOG_INFO("pressed at x:%d y:%d", proc->types.pointer.act_point.x, proc->types.pointer.act_point.y); + indev_obj_act = proc->types.pointer.act_obj; + + if(proc->wait_until_release != 0) return; + + lv_disp_t * disp = indev_act->driver->disp; + bool new_obj_searched = false; + + /*If there is no last object then search*/ + if(indev_obj_act == NULL) { + indev_obj_act = lv_indev_search_obj(lv_disp_get_layer_sys(disp), &proc->types.pointer.act_point); + if(indev_obj_act == NULL) indev_obj_act = lv_indev_search_obj(lv_disp_get_layer_top(disp), + &proc->types.pointer.act_point); + if(indev_obj_act == NULL) indev_obj_act = lv_indev_search_obj(lv_disp_get_scr_act(disp), + &proc->types.pointer.act_point); + new_obj_searched = true; + } + /*If there is last object but it is not scrolled and not protected also search*/ + else if(proc->types.pointer.scroll_obj == NULL && + lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_PRESS_LOCK) == false) { + indev_obj_act = lv_indev_search_obj(lv_disp_get_layer_sys(disp), &proc->types.pointer.act_point); + if(indev_obj_act == NULL) indev_obj_act = lv_indev_search_obj(lv_disp_get_layer_top(disp), + &proc->types.pointer.act_point); + if(indev_obj_act == NULL) indev_obj_act = lv_indev_search_obj(lv_disp_get_scr_act(disp), + &proc->types.pointer.act_point); + new_obj_searched = true; + } + + /*The last object might have scroll throw. Stop it manually*/ + if(new_obj_searched && proc->types.pointer.last_obj) { + proc->types.pointer.scroll_throw_vect.x = 0; + proc->types.pointer.scroll_throw_vect.y = 0; + _lv_indev_scroll_throw_handler(proc); + if(indev_reset_check(proc)) return; + } + + /*If a new object was found reset some variables and send a pressed event handler*/ + if(indev_obj_act != proc->types.pointer.act_obj) { + proc->types.pointer.last_point.x = proc->types.pointer.act_point.x; + proc->types.pointer.last_point.y = proc->types.pointer.act_point.y; + + /*If a new object found the previous was lost, so send a Call the ancestor's event handler*/ + if(proc->types.pointer.act_obj != NULL) { + /*Save the obj because in special cases `act_obj` can change in the Call the ancestor's event handler function*/ + lv_obj_t * last_obj = proc->types.pointer.act_obj; + + lv_event_send(last_obj, LV_EVENT_PRESS_LOST, indev_act); + if(indev_reset_check(proc)) return; + } + + proc->types.pointer.act_obj = indev_obj_act; /*Save the pressed object*/ + proc->types.pointer.last_obj = indev_obj_act; + + if(indev_obj_act != NULL) { + /*Save the time when the obj pressed to count long press time.*/ + proc->pr_timestamp = lv_tick_get(); + proc->long_pr_sent = 0; + proc->types.pointer.scroll_sum.x = 0; + proc->types.pointer.scroll_sum.y = 0; + proc->types.pointer.scroll_dir = LV_DIR_NONE; + proc->types.pointer.gesture_dir = LV_DIR_NONE; + proc->types.pointer.gesture_sent = 0; + proc->types.pointer.gesture_sum.x = 0; + proc->types.pointer.gesture_sum.y = 0; + proc->types.pointer.vect.x = 0; + proc->types.pointer.vect.y = 0; + + /*Call the ancestor's event handler about the press*/ + lv_event_send(indev_obj_act, LV_EVENT_PRESSED, indev_act); + if(indev_reset_check(proc)) return; + + if(indev_act->proc.wait_until_release) return; + + /*Handle focus*/ + indev_click_focus(&indev_act->proc); + if(indev_reset_check(proc)) return; + + } + } + + /*Calculate the vector and apply a low pass filter: new value = 0.5 * old_value + 0.5 * new_value*/ + proc->types.pointer.vect.x = proc->types.pointer.act_point.x - proc->types.pointer.last_point.x; + proc->types.pointer.vect.y = proc->types.pointer.act_point.y - proc->types.pointer.last_point.y; + + proc->types.pointer.scroll_throw_vect.x = (proc->types.pointer.scroll_throw_vect.x + proc->types.pointer.vect.x) / 2; + proc->types.pointer.scroll_throw_vect.y = (proc->types.pointer.scroll_throw_vect.y + proc->types.pointer.vect.y) / 2; + + proc->types.pointer.scroll_throw_vect_ori = proc->types.pointer.scroll_throw_vect; + + if(indev_obj_act) { + lv_event_send(indev_obj_act, LV_EVENT_PRESSING, indev_act); + if(indev_reset_check(proc)) return; + + if(indev_act->proc.wait_until_release) return; + + _lv_indev_scroll_handler(proc); + if(indev_reset_check(proc)) return; + indev_gesture(proc); + if(indev_reset_check(proc)) return; + + /*If there is no scrolling then check for long press time*/ + if(proc->types.pointer.scroll_obj == NULL && proc->long_pr_sent == 0) { + /*Call the ancestor's event handler about the long press if enough time elapsed*/ + if(lv_tick_elaps(proc->pr_timestamp) > indev_act->driver->long_press_time) { + lv_event_send(indev_obj_act, LV_EVENT_LONG_PRESSED, indev_act); + if(indev_reset_check(proc)) return; + + /*Mark the Call the ancestor's event handler sending to do not send it again*/ + proc->long_pr_sent = 1; + + /*Save the long press time stamp for the long press repeat handler*/ + proc->longpr_rep_timestamp = lv_tick_get(); + } + } + + /*Send long press repeated Call the ancestor's event handler*/ + if(proc->types.pointer.scroll_obj == NULL && proc->long_pr_sent == 1) { + /*Call the ancestor's event handler about the long press repeat if enough time elapsed*/ + if(lv_tick_elaps(proc->longpr_rep_timestamp) > indev_act->driver->long_press_repeat_time) { + lv_event_send(indev_obj_act, LV_EVENT_LONG_PRESSED_REPEAT, indev_act); + if(indev_reset_check(proc)) return; + proc->longpr_rep_timestamp = lv_tick_get(); + } + } + } +} + +/** + * Process the released state of LV_INDEV_TYPE_POINTER input devices + * @param proc pointer to an input device 'proc' + */ +static void indev_proc_release(_lv_indev_proc_t * proc) +{ + if(proc->wait_until_release != 0) { + lv_event_send(proc->types.pointer.act_obj, LV_EVENT_PRESS_LOST, indev_act); + if(indev_reset_check(proc)) return; + + proc->types.pointer.act_obj = NULL; + proc->types.pointer.last_obj = NULL; + proc->pr_timestamp = 0; + proc->longpr_rep_timestamp = 0; + proc->wait_until_release = 0; + } + indev_obj_act = proc->types.pointer.act_obj; + lv_obj_t * scroll_obj = proc->types.pointer.scroll_obj; + + /*Forget the act obj and send a released Call the ancestor's event handler*/ + if(indev_obj_act) { + LV_LOG_INFO("released"); + + /*Send RELEASE Call the ancestor's event handler and event*/ + lv_event_send(indev_obj_act, LV_EVENT_RELEASED, indev_act); + if(indev_reset_check(proc)) return; + + /*Send CLICK if no scrolling*/ + if(scroll_obj == NULL) { + if(proc->long_pr_sent == 0) { + lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, indev_act); + if(indev_reset_check(proc)) return; + } + + lv_event_send(indev_obj_act, LV_EVENT_CLICKED, indev_act); + if(indev_reset_check(proc)) return; + } + + proc->types.pointer.act_obj = NULL; + proc->pr_timestamp = 0; + proc->longpr_rep_timestamp = 0; + + + /*Get the transformed vector with this object*/ + if(scroll_obj) { + int16_t angle = 0; + int16_t zoom = 256; + lv_point_t pivot = { 0, 0 }; + lv_obj_t * parent = scroll_obj; + while(parent) { + angle += lv_obj_get_style_transform_angle(parent, 0); + zoom *= (lv_obj_get_style_transform_zoom(parent, 0) / 256); + parent = lv_obj_get_parent(parent); + } + + if(angle != 0 || zoom != LV_IMG_ZOOM_NONE) { + angle = -angle; + zoom = (256 * 256) / zoom; + lv_point_transform(&proc->types.pointer.scroll_throw_vect, angle, zoom, &pivot); + lv_point_transform(&proc->types.pointer.scroll_throw_vect_ori, angle, zoom, &pivot); + } + } + + } + + /*The reset can be set in the Call the ancestor's event handler function. + * In case of reset query ignore the remaining parts.*/ + if(scroll_obj) { + _lv_indev_scroll_throw_handler(proc); + if(indev_reset_check(proc)) return; + } +} + +/** + * Process a new point from LV_INDEV_TYPE_BUTTON input device + * @param i pointer to an input device + * @param data pointer to the data read from the input device + * Reset input device if a reset query has been sent to it + * @param indev pointer to an input device + */ +static void indev_proc_reset_query_handler(lv_indev_t * indev) +{ + if(indev->proc.reset_query) { + indev->proc.types.pointer.act_obj = NULL; + indev->proc.types.pointer.last_obj = NULL; + indev->proc.types.pointer.scroll_obj = NULL; + indev->proc.long_pr_sent = 0; + indev->proc.pr_timestamp = 0; + indev->proc.longpr_rep_timestamp = 0; + indev->proc.types.pointer.scroll_sum.x = 0; + indev->proc.types.pointer.scroll_sum.y = 0; + indev->proc.types.pointer.scroll_dir = LV_DIR_NONE; + indev->proc.types.pointer.scroll_throw_vect.x = 0; + indev->proc.types.pointer.scroll_throw_vect.y = 0; + indev->proc.types.pointer.gesture_sum.x = 0; + indev->proc.types.pointer.gesture_sum.y = 0; + indev->proc.reset_query = 0; + indev_obj_act = NULL; + } +} + +/** + * Handle focus/defocus on click for POINTER input devices + * @param proc pointer to the state of the indev + */ +static void indev_click_focus(_lv_indev_proc_t * proc) +{ + /*Handle click focus*/ + if(lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_CLICK_FOCUSABLE) == false || + proc->types.pointer.last_pressed == indev_obj_act) { + return; + } + + lv_group_t * g_act = lv_obj_get_group(indev_obj_act); + lv_group_t * g_prev = proc->types.pointer.last_pressed ? lv_obj_get_group(proc->types.pointer.last_pressed) : NULL; + + /*If both the last and act. obj. are in the same group (or have no group)*/ + if(g_act == g_prev) { + /*The objects are in a group*/ + if(g_act) { + lv_group_focus_obj(indev_obj_act); + if(indev_reset_check(proc)) return; + } + /*The object are not in group*/ + else { + if(proc->types.pointer.last_pressed) { + lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act); + if(indev_reset_check(proc)) return; + } + + lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, indev_act); + if(indev_reset_check(proc)) return; + } + } + /*The object are not in the same group (in different groups or one has no group)*/ + else { + /*If the prev. obj. is not in a group then defocus it.*/ + if(g_prev == NULL && proc->types.pointer.last_pressed) { + lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act); + if(indev_reset_check(proc)) return; + } + /*Focus on a non-group object*/ + else { + if(proc->types.pointer.last_pressed) { + /*If the prev. object also wasn't in a group defocus it*/ + if(g_prev == NULL) { + lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act); + if(indev_reset_check(proc)) return; + } + /*If the prev. object also was in a group at least "LEAVE" it instead of defocus*/ + else { + lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_LEAVE, indev_act); + if(indev_reset_check(proc)) return; + } + } + } + + /*Focus to the act. in its group*/ + if(g_act) { + lv_group_focus_obj(indev_obj_act); + if(indev_reset_check(proc)) return; + } + else { + lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, indev_act); + if(indev_reset_check(proc)) return; + } + } + proc->types.pointer.last_pressed = indev_obj_act; +} + +/** +* Handle the gesture of indev_proc_p->types.pointer.act_obj +* @param indev pointer to an input device state +*/ +void indev_gesture(_lv_indev_proc_t * proc) +{ + + if(proc->types.pointer.scroll_obj) return; + if(proc->types.pointer.gesture_sent) return; + + lv_obj_t * gesture_obj = proc->types.pointer.act_obj; + + /*If gesture parent is active check recursively the gesture attribute*/ + while(gesture_obj && lv_obj_has_flag(gesture_obj, LV_OBJ_FLAG_GESTURE_BUBBLE)) { + gesture_obj = lv_obj_get_parent(gesture_obj); + } + + if(gesture_obj == NULL) return; + + if((LV_ABS(proc->types.pointer.vect.x) < indev_act->driver->gesture_min_velocity) && + (LV_ABS(proc->types.pointer.vect.y) < indev_act->driver->gesture_min_velocity)) { + proc->types.pointer.gesture_sum.x = 0; + proc->types.pointer.gesture_sum.y = 0; + } + + /*Count the movement by gesture*/ + proc->types.pointer.gesture_sum.x += proc->types.pointer.vect.x; + proc->types.pointer.gesture_sum.y += proc->types.pointer.vect.y; + + if((LV_ABS(proc->types.pointer.gesture_sum.x) > indev_act->driver->gesture_limit) || + (LV_ABS(proc->types.pointer.gesture_sum.y) > indev_act->driver->gesture_limit)) { + + proc->types.pointer.gesture_sent = 1; + + if(LV_ABS(proc->types.pointer.gesture_sum.x) > LV_ABS(proc->types.pointer.gesture_sum.y)) { + if(proc->types.pointer.gesture_sum.x > 0) + proc->types.pointer.gesture_dir = LV_DIR_RIGHT; + else + proc->types.pointer.gesture_dir = LV_DIR_LEFT; + } + else { + if(proc->types.pointer.gesture_sum.y > 0) + proc->types.pointer.gesture_dir = LV_DIR_BOTTOM; + else + proc->types.pointer.gesture_dir = LV_DIR_TOP; + } + + lv_event_send(gesture_obj, LV_EVENT_GESTURE, indev_act); + if(indev_reset_check(proc)) return; + } +} + +/** + * Checks if the reset_query flag has been set. If so, perform necessary global indev cleanup actions + * @param proc pointer to an input device 'proc' + * @return true if indev query should be immediately truncated. + */ +static bool indev_reset_check(_lv_indev_proc_t * proc) +{ + if(proc->reset_query) { + indev_obj_act = NULL; + } + + return proc->reset_query ? true : false; +} diff --git a/L3_Middlewares/LVGL/src/core/lv_indev.h b/L3_Middlewares/LVGL/src/core/lv_indev.h new file mode 100644 index 0000000..a98df86 --- /dev/null +++ b/L3_Middlewares/LVGL/src/core/lv_indev.h @@ -0,0 +1,176 @@ +/** + * @file lv_indev.h + * + */ + +#ifndef LV_INDEV_H +#define LV_INDEV_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "lv_obj.h" +#include "../hal/lv_hal_indev.h" +#include "lv_group.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Called periodically to read the input devices + * @param timer pointer to a timer to read + */ +void lv_indev_read_timer_cb(lv_timer_t * timer); + +/** + * Enable or disable one or all input devices (default enabled) + * @param indev pointer to an input device or NULL to enable/disable all of them + * @param en true to enable, false to disable + */ +void lv_indev_enable(lv_indev_t * indev, bool en); + +/** + * Get the currently processed input device. Can be used in action functions too. + * @return pointer to the currently processed input device or NULL if no input device processing + * right now + */ +lv_indev_t * lv_indev_get_act(void); + +/** + * Get the type of an input device + * @param indev pointer to an input device + * @return the type of the input device from `lv_hal_indev_type_t` (`LV_INDEV_TYPE_...`) + */ +lv_indev_type_t lv_indev_get_type(const lv_indev_t * indev); + +/** + * Reset one or all input devices + * @param indev pointer to an input device to reset or NULL to reset all of them + * @param obj pointer to an object which triggers the reset. + */ +void lv_indev_reset(lv_indev_t * indev, lv_obj_t * obj); + +/** + * Reset the long press state of an input device + * @param indev pointer to an input device + */ +void lv_indev_reset_long_press(lv_indev_t * indev); + +/** + * Set a cursor for a pointer input device (for LV_INPUT_TYPE_POINTER and LV_INPUT_TYPE_BUTTON) + * @param indev pointer to an input device + * @param cur_obj pointer to an object to be used as cursor + */ +void lv_indev_set_cursor(lv_indev_t * indev, lv_obj_t * cur_obj); + +/** + * Set a destination group for a keypad input device (for LV_INDEV_TYPE_KEYPAD) + * @param indev pointer to an input device + * @param group point to a group + */ +void lv_indev_set_group(lv_indev_t * indev, lv_group_t * group); + +/** + * Set the an array of points for LV_INDEV_TYPE_BUTTON. + * These points will be assigned to the buttons to press a specific point on the screen + * @param indev pointer to an input device + * @param group point to a group + */ +void lv_indev_set_button_points(lv_indev_t * indev, const lv_point_t points[]); + +/** + * Get the last point of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON) + * @param indev pointer to an input device + * @param point pointer to a point to store the result + */ +void lv_indev_get_point(const lv_indev_t * indev, lv_point_t * point); + +/** +* Get the current gesture direct +* @param indev pointer to an input device +* @return current gesture direct +*/ +lv_dir_t lv_indev_get_gesture_dir(const lv_indev_t * indev); + +/** + * Get the last pressed key of an input device (for LV_INDEV_TYPE_KEYPAD) + * @param indev pointer to an input device + * @return the last pressed key (0 on error) + */ +uint32_t lv_indev_get_key(const lv_indev_t * indev); + +/** + * Check the current scroll direction of an input device (for LV_INDEV_TYPE_POINTER and + * LV_INDEV_TYPE_BUTTON) + * @param indev pointer to an input device + * @return LV_DIR_NONE: no scrolling now + * LV_DIR_HOR/VER + */ +lv_dir_t lv_indev_get_scroll_dir(const lv_indev_t * indev); + +/** + * Get the currently scrolled object (for LV_INDEV_TYPE_POINTER and + * LV_INDEV_TYPE_BUTTON) + * @param indev pointer to an input device + * @return pointer to the currently scrolled object or NULL if no scrolling by this indev + */ +lv_obj_t * lv_indev_get_scroll_obj(const lv_indev_t * indev); + +/** + * Get the movement vector of an input device (for LV_INDEV_TYPE_POINTER and + * LV_INDEV_TYPE_BUTTON) + * @param indev pointer to an input device + * @param point pointer to a point to store the types.pointer.vector + */ +void lv_indev_get_vect(const lv_indev_t * indev, lv_point_t * point); + +/** + * Do nothing until the next release + * @param indev pointer to an input device + */ +void lv_indev_wait_release(lv_indev_t * indev); + +/** + * Gets a pointer to the currently active object in the currently processed input device. + * @return pointer to currently active object or NULL if no active object + */ +lv_obj_t * lv_indev_get_obj_act(void); + +/** + * Get a pointer to the indev read timer to + * modify its parameters with `lv_timer_...` functions. + * @param indev pointer to an input device + * @return pointer to the indev read refresher timer. (NULL on error) + */ +lv_timer_t * lv_indev_get_read_timer(lv_disp_t * indev); + +/** + * Search the most top, clickable object by a point + * @param obj pointer to a start object, typically the screen + * @param point pointer to a point for searching the most top child + * @return pointer to the found object or NULL if there was no suitable object + */ +lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_INDEV_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_indev_scroll.c b/L3_Middlewares/LVGL/src/core/lv_indev_scroll.c new file mode 100644 index 0000000..8a36ab3 --- /dev/null +++ b/L3_Middlewares/LVGL/src/core/lv_indev_scroll.c @@ -0,0 +1,690 @@ +/** + * @file lv_indev_scroll.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_indev.h" +#include "lv_indev_scroll.h" + +/********************* + * DEFINES + *********************/ +#define ELASTIC_SLOWNESS_FACTOR 4 /*Scrolling on elastic parts are slower by this factor*/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static lv_obj_t * find_scroll_obj(_lv_indev_proc_t * proc); +static void init_scroll_limits(_lv_indev_proc_t * proc); +static lv_coord_t find_snap_point_x(const lv_obj_t * obj, lv_coord_t min, lv_coord_t max, lv_coord_t ofs); +static lv_coord_t find_snap_point_y(const lv_obj_t * obj, lv_coord_t min, lv_coord_t max, lv_coord_t ofs); +static void scroll_limit_diff(_lv_indev_proc_t * proc, lv_coord_t * diff_x, lv_coord_t * diff_y); +static lv_coord_t scroll_throw_predict_y(_lv_indev_proc_t * proc); +static lv_coord_t scroll_throw_predict_x(_lv_indev_proc_t * proc); +static lv_coord_t elastic_diff(lv_obj_t * scroll_obj, lv_coord_t diff, lv_coord_t scroll_start, lv_coord_t scroll_end, + lv_dir_t dir); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void _lv_indev_scroll_handler(_lv_indev_proc_t * proc) +{ + if(proc->types.pointer.vect.x == 0 && proc->types.pointer.vect.y == 0) { + return; + } + + lv_obj_t * scroll_obj = proc->types.pointer.scroll_obj; + /*If there is no scroll object yet try to find one*/ + if(scroll_obj == NULL) { + scroll_obj = find_scroll_obj(proc); + if(scroll_obj == NULL) return; + + init_scroll_limits(proc); + + lv_event_send(scroll_obj, LV_EVENT_SCROLL_BEGIN, NULL); + if(proc->reset_query) return; + } + + /*Set new position or scroll if the vector is not zero*/ + int16_t angle = 0; + int16_t zoom = 256; + lv_obj_t * parent = scroll_obj; + while(parent) { + angle += lv_obj_get_style_transform_angle(parent, 0); + zoom *= (lv_obj_get_style_transform_zoom(parent, 0) / 256); + parent = lv_obj_get_parent(parent); + } + + if(angle != 0 || zoom != LV_IMG_ZOOM_NONE) { + angle = -angle; + zoom = (256 * 256) / zoom; + lv_point_t pivot = { 0, 0 }; + lv_point_transform(&proc->types.pointer.vect, angle, zoom, &pivot); + } + + + + lv_coord_t diff_x = 0; + lv_coord_t diff_y = 0; + if(proc->types.pointer.scroll_dir == LV_DIR_HOR) { + lv_coord_t sr = lv_obj_get_scroll_right(scroll_obj); + lv_coord_t sl = lv_obj_get_scroll_left(scroll_obj); + diff_x = elastic_diff(scroll_obj, proc->types.pointer.vect.x, sl, sr, LV_DIR_HOR); + } + else { + lv_coord_t st = lv_obj_get_scroll_top(scroll_obj); + lv_coord_t sb = lv_obj_get_scroll_bottom(scroll_obj); + diff_y = elastic_diff(scroll_obj, proc->types.pointer.vect.y, st, sb, LV_DIR_VER); + } + + lv_dir_t scroll_dir = lv_obj_get_scroll_dir(scroll_obj); + if((scroll_dir & LV_DIR_LEFT) == 0 && diff_x > 0) diff_x = 0; + if((scroll_dir & LV_DIR_RIGHT) == 0 && diff_x < 0) diff_x = 0; + if((scroll_dir & LV_DIR_TOP) == 0 && diff_y > 0) diff_y = 0; + if((scroll_dir & LV_DIR_BOTTOM) == 0 && diff_y < 0) diff_y = 0; + + /*Respect the scroll limit area*/ + scroll_limit_diff(proc, &diff_x, &diff_y); + + _lv_obj_scroll_by_raw(scroll_obj, diff_x, diff_y); + if(proc->reset_query) return; + proc->types.pointer.scroll_sum.x += diff_x; + proc->types.pointer.scroll_sum.y += diff_y; +} + + +void _lv_indev_scroll_throw_handler(_lv_indev_proc_t * proc) +{ + lv_obj_t * scroll_obj = proc->types.pointer.scroll_obj; + if(scroll_obj == NULL) return; + if(proc->types.pointer.scroll_dir == LV_DIR_NONE) return; + + lv_indev_t * indev_act = lv_indev_get_act(); + lv_coord_t scroll_throw = indev_act->driver->scroll_throw; + + if(lv_obj_has_flag(scroll_obj, LV_OBJ_FLAG_SCROLL_MOMENTUM) == false) { + proc->types.pointer.scroll_throw_vect.y = 0; + proc->types.pointer.scroll_throw_vect.x = 0; + } + + lv_scroll_snap_t align_x = lv_obj_get_scroll_snap_x(scroll_obj); + lv_scroll_snap_t align_y = lv_obj_get_scroll_snap_y(scroll_obj); + + if(proc->types.pointer.scroll_dir == LV_DIR_VER) { + proc->types.pointer.scroll_throw_vect.x = 0; + /*If no snapping "throw"*/ + if(align_y == LV_SCROLL_SNAP_NONE) { + proc->types.pointer.scroll_throw_vect.y = + proc->types.pointer.scroll_throw_vect.y * (100 - scroll_throw) / 100; + + lv_coord_t sb = lv_obj_get_scroll_bottom(scroll_obj); + lv_coord_t st = lv_obj_get_scroll_top(scroll_obj); + + proc->types.pointer.scroll_throw_vect.y = elastic_diff(scroll_obj, proc->types.pointer.scroll_throw_vect.y, st, sb, + LV_DIR_VER); + + lv_obj_scroll_by(scroll_obj, 0, proc->types.pointer.scroll_throw_vect.y, LV_ANIM_OFF); + } + /*With snapping find the nearest snap point and scroll there*/ + else { + lv_coord_t diff_y = scroll_throw_predict_y(proc); + proc->types.pointer.scroll_throw_vect.y = 0; + scroll_limit_diff(proc, NULL, &diff_y); + lv_coord_t y = find_snap_point_y(scroll_obj, LV_COORD_MIN, LV_COORD_MAX, diff_y); + lv_obj_scroll_by(scroll_obj, 0, diff_y + y, LV_ANIM_ON); + } + } + else if(proc->types.pointer.scroll_dir == LV_DIR_HOR) { + proc->types.pointer.scroll_throw_vect.y = 0; + /*If no snapping "throw"*/ + if(align_x == LV_SCROLL_SNAP_NONE) { + proc->types.pointer.scroll_throw_vect.x = + proc->types.pointer.scroll_throw_vect.x * (100 - scroll_throw) / 100; + + lv_coord_t sl = lv_obj_get_scroll_left(scroll_obj); + lv_coord_t sr = lv_obj_get_scroll_right(scroll_obj); + + proc->types.pointer.scroll_throw_vect.x = elastic_diff(scroll_obj, proc->types.pointer.scroll_throw_vect.x, sl, sr, + LV_DIR_HOR); + + lv_obj_scroll_by(scroll_obj, proc->types.pointer.scroll_throw_vect.x, 0, LV_ANIM_OFF); + } + /*With snapping find the nearest snap point and scroll there*/ + else { + lv_coord_t diff_x = scroll_throw_predict_x(proc); + proc->types.pointer.scroll_throw_vect.x = 0; + scroll_limit_diff(proc, &diff_x, NULL); + lv_coord_t x = find_snap_point_x(scroll_obj, LV_COORD_MIN, LV_COORD_MAX, diff_x); + lv_obj_scroll_by(scroll_obj, x + diff_x, 0, LV_ANIM_ON); + } + } + + /*Check if the scroll has finished*/ + if(proc->types.pointer.scroll_throw_vect.x == 0 && proc->types.pointer.scroll_throw_vect.y == 0) { + /*Revert if scrolled in*/ + /*If vertically scrollable and not controlled by snap*/ + if(align_y == LV_SCROLL_SNAP_NONE) { + lv_coord_t st = lv_obj_get_scroll_top(scroll_obj); + lv_coord_t sb = lv_obj_get_scroll_bottom(scroll_obj); + if(st > 0 || sb > 0) { + if(st < 0) { + lv_obj_scroll_by(scroll_obj, 0, st, LV_ANIM_ON); + } + else if(sb < 0) { + lv_obj_scroll_by(scroll_obj, 0, -sb, LV_ANIM_ON); + } + } + } + + /*If horizontally scrollable and not controlled by snap*/ + if(align_x == LV_SCROLL_SNAP_NONE) { + lv_coord_t sl = lv_obj_get_scroll_left(scroll_obj); + lv_coord_t sr = lv_obj_get_scroll_right(scroll_obj); + if(sl > 0 || sr > 0) { + if(sl < 0) { + lv_obj_scroll_by(scroll_obj, sl, 0, LV_ANIM_ON); + } + else if(sr < 0) { + lv_obj_scroll_by(scroll_obj, -sr, 0, LV_ANIM_ON); + } + } + } + + lv_event_send(scroll_obj, LV_EVENT_SCROLL_END, indev_act); + if(proc->reset_query) return; + + proc->types.pointer.scroll_dir = LV_DIR_NONE; + proc->types.pointer.scroll_obj = NULL; + } +} + +/** + * Predict where would a scroll throw end + * @param indev pointer to an input device + * @param dir `LV_DIR_VER` or `LV_DIR_HOR` + * @return the difference compared to the current position when the throw would be finished + */ +lv_coord_t lv_indev_scroll_throw_predict(lv_indev_t * indev, lv_dir_t dir) +{ + if(indev == NULL) return 0; + lv_coord_t v; + switch(dir) { + case LV_DIR_VER: + v = indev->proc.types.pointer.scroll_throw_vect_ori.y; + break; + case LV_DIR_HOR: + v = indev->proc.types.pointer.scroll_throw_vect_ori.x; + break; + default: + return 0; + } + + lv_coord_t scroll_throw = indev->driver->scroll_throw; + lv_coord_t sum = 0; + while(v) { + sum += v; + v = v * (100 - scroll_throw) / 100; + } + + return sum; +} + +void lv_indev_scroll_get_snap_dist(lv_obj_t * obj, lv_point_t * p) +{ + p->x = find_snap_point_x(obj, obj->coords.x1, obj->coords.x2, 0); + p->y = find_snap_point_y(obj, obj->coords.y1, obj->coords.y2, 0); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static lv_obj_t * find_scroll_obj(_lv_indev_proc_t * proc) +{ + lv_obj_t * obj_candidate = NULL; + lv_dir_t dir_candidate = LV_DIR_NONE; + lv_indev_t * indev_act = lv_indev_get_act(); + lv_coord_t scroll_limit = indev_act->driver->scroll_limit; + + /*Go until find a scrollable object in the current direction + *More precisely: + * 1. Check the pressed object and all of its ancestors and try to find an object which is scrollable + * 2. Scrollable means it has some content out of its area + * 3. If an object can be scrolled into the current direction then use it ("real match"") + * 4. If can be scrolled on the current axis (hor/ver) save it as candidate (at least show an elastic scroll effect) + * 5. Use the last candidate. Always the "deepest" parent or the object from point 3*/ + lv_obj_t * obj_act = proc->types.pointer.act_obj; + + /*Decide if it's a horizontal or vertical scroll*/ + bool hor_en = false; + bool ver_en = false; + + proc->types.pointer.scroll_sum.x += proc->types.pointer.vect.x; + proc->types.pointer.scroll_sum.y += proc->types.pointer.vect.y; + + while(obj_act) { + /*Get the transformed scroll_sum with this object*/ + int16_t angle = 0; + int32_t zoom = 256; + lv_point_t pivot = { 0, 0 }; + lv_obj_t * parent = obj_act; + while(parent) { + angle += lv_obj_get_style_transform_angle(parent, 0); + int32_t zoom_act = lv_obj_get_style_transform_zoom(parent, 0); + zoom = (zoom * zoom_act) >> 8; + parent = lv_obj_get_parent(parent); + } + + lv_point_t obj_scroll_sum = proc->types.pointer.scroll_sum; + if(angle != 0 || zoom != LV_IMG_ZOOM_NONE) { + angle = -angle; + zoom = (256 * 256) / zoom; + lv_point_transform(&obj_scroll_sum, angle, zoom, &pivot); + } + + if(LV_ABS(obj_scroll_sum.x) > LV_ABS(obj_scroll_sum.y)) { + hor_en = true; + } + else { + ver_en = true; + } + + if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLLABLE) == false) { + /*If this object don't want to chain the scroll to the parent stop searching*/ + if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_HOR) == false && hor_en) break; + if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_VER) == false && ver_en) break; + + obj_act = lv_obj_get_parent(obj_act); + continue; + } + + /*Consider both up-down or left/right scrollable according to the current direction*/ + bool up_en = ver_en; + bool down_en = ver_en; + bool left_en = hor_en; + bool right_en = hor_en; + + /*The object might have disabled some directions.*/ + lv_dir_t scroll_dir = lv_obj_get_scroll_dir(obj_act); + if((scroll_dir & LV_DIR_LEFT) == 0) left_en = false; + if((scroll_dir & LV_DIR_RIGHT) == 0) right_en = false; + if((scroll_dir & LV_DIR_TOP) == 0) up_en = false; + if((scroll_dir & LV_DIR_BOTTOM) == 0) down_en = false; + + /*The object is scrollable to a direction if its content overflow in that direction.*/ + lv_coord_t st = lv_obj_get_scroll_top(obj_act); + lv_coord_t sb = lv_obj_get_scroll_bottom(obj_act); + lv_coord_t sl = lv_obj_get_scroll_left(obj_act); + lv_coord_t sr = lv_obj_get_scroll_right(obj_act); + + /*If this object is scrollable into the current scroll direction then save it as a candidate. + *It's important only to be scrollable on the current axis (hor/ver) because if the scroll + *is propagated to this object it can show at least elastic scroll effect. + *But if not hor/ver scrollable do not scroll it at all (so it's not a good candidate)*/ + if((st > 0 || sb > 0) && + ((up_en && obj_scroll_sum.y >= scroll_limit) || + (down_en && obj_scroll_sum.y <= - scroll_limit))) { + obj_candidate = obj_act; + dir_candidate = LV_DIR_VER; + } + + if((sl > 0 || sr > 0) && + ((left_en && obj_scroll_sum.x >= scroll_limit) || + (right_en && obj_scroll_sum.x <= - scroll_limit))) { + obj_candidate = obj_act; + dir_candidate = LV_DIR_HOR; + } + + if(st <= 0) up_en = false; + if(sb <= 0) down_en = false; + if(sl <= 0) left_en = false; + if(sr <= 0) right_en = false; + + /*If the object really can be scrolled into the current direction then use it.*/ + if((left_en && obj_scroll_sum.x >= scroll_limit) || + (right_en && obj_scroll_sum.x <= - scroll_limit) || + (up_en && obj_scroll_sum.y >= scroll_limit) || + (down_en && obj_scroll_sum.y <= - scroll_limit)) { + proc->types.pointer.scroll_dir = hor_en ? LV_DIR_HOR : LV_DIR_VER; + break; + } + + /*If this object don't want to chain the scroll to the parent stop searching*/ + if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_HOR) == false && hor_en) break; + if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_VER) == false && ver_en) break; + + /*Try the parent*/ + obj_act = lv_obj_get_parent(obj_act); + } + + /*Use the last candidate*/ + if(obj_candidate) { + proc->types.pointer.scroll_dir = dir_candidate; + proc->types.pointer.scroll_obj = obj_candidate; + proc->types.pointer.scroll_sum.x = 0; + proc->types.pointer.scroll_sum.y = 0; + } + + return obj_candidate; +} + +static void init_scroll_limits(_lv_indev_proc_t * proc) +{ + lv_obj_t * obj = proc->types.pointer.scroll_obj; + /*If there no STOP allow scrolling anywhere*/ + if(lv_obj_has_flag(obj, LV_OBJ_FLAG_SCROLL_ONE) == false) { + lv_area_set(&proc->types.pointer.scroll_area, LV_COORD_MIN, LV_COORD_MIN, LV_COORD_MAX, LV_COORD_MAX); + } + /*With STOP limit the scrolling to the perv and next snap point*/ + else { + switch(lv_obj_get_scroll_snap_y(obj)) { + case LV_SCROLL_SNAP_START: + proc->types.pointer.scroll_area.y1 = find_snap_point_y(obj, obj->coords.y1 + 1, LV_COORD_MAX, 0); + proc->types.pointer.scroll_area.y2 = find_snap_point_y(obj, LV_COORD_MIN, obj->coords.y1 - 1, 0); + break; + case LV_SCROLL_SNAP_END: + proc->types.pointer.scroll_area.y1 = find_snap_point_y(obj, obj->coords.y2, LV_COORD_MAX, 0); + proc->types.pointer.scroll_area.y2 = find_snap_point_y(obj, LV_COORD_MIN, obj->coords.y2, 0); + break; + case LV_SCROLL_SNAP_CENTER: { + lv_coord_t y_mid = obj->coords.y1 + lv_area_get_height(&obj->coords) / 2; + proc->types.pointer.scroll_area.y1 = find_snap_point_y(obj, y_mid + 1, LV_COORD_MAX, 0); + proc->types.pointer.scroll_area.y2 = find_snap_point_y(obj, LV_COORD_MIN, y_mid - 1, 0); + break; + } + default: + proc->types.pointer.scroll_area.y1 = LV_COORD_MIN; + proc->types.pointer.scroll_area.y2 = LV_COORD_MAX; + break; + } + + switch(lv_obj_get_scroll_snap_x(obj)) { + case LV_SCROLL_SNAP_START: + proc->types.pointer.scroll_area.x1 = find_snap_point_x(obj, obj->coords.x1, LV_COORD_MAX, 0); + proc->types.pointer.scroll_area.x2 = find_snap_point_x(obj, LV_COORD_MIN, obj->coords.x1, 0); + break; + case LV_SCROLL_SNAP_END: + proc->types.pointer.scroll_area.x1 = find_snap_point_x(obj, obj->coords.x2, LV_COORD_MAX, 0); + proc->types.pointer.scroll_area.x2 = find_snap_point_x(obj, LV_COORD_MIN, obj->coords.x2, 0); + break; + case LV_SCROLL_SNAP_CENTER: { + lv_coord_t x_mid = obj->coords.x1 + lv_area_get_width(&obj->coords) / 2; + proc->types.pointer.scroll_area.x1 = find_snap_point_x(obj, x_mid + 1, LV_COORD_MAX, 0); + proc->types.pointer.scroll_area.x2 = find_snap_point_x(obj, LV_COORD_MIN, x_mid - 1, 0); + break; + } + default: + proc->types.pointer.scroll_area.x1 = LV_COORD_MIN; + proc->types.pointer.scroll_area.x2 = LV_COORD_MAX; + break; + } + } + + /*Allow scrolling on the edges. It will be reverted to the edge due to snapping anyway*/ + if(proc->types.pointer.scroll_area.x1 == 0) proc->types.pointer.scroll_area.x1 = LV_COORD_MIN; + if(proc->types.pointer.scroll_area.x2 == 0) proc->types.pointer.scroll_area.x2 = LV_COORD_MAX; + if(proc->types.pointer.scroll_area.y1 == 0) proc->types.pointer.scroll_area.y1 = LV_COORD_MIN; + if(proc->types.pointer.scroll_area.y2 == 0) proc->types.pointer.scroll_area.y2 = LV_COORD_MAX; +} + +/** + * Search for snap point in the `min` - `max` range. + * @param obj the object on which snap point should be found + * @param min ignore snap points smaller than this. (Absolute coordinate) + * @param max ignore snap points greater than this. (Absolute coordinate) + * @param ofs offset to snap points. Useful the get a snap point in an imagined case + * what if children are already moved by this value + * @return the distance of the snap point. + */ +static lv_coord_t find_snap_point_x(const lv_obj_t * obj, lv_coord_t min, lv_coord_t max, lv_coord_t ofs) +{ + lv_scroll_snap_t align = lv_obj_get_scroll_snap_x(obj); + if(align == LV_SCROLL_SNAP_NONE) return 0; + + lv_coord_t dist = LV_COORD_MAX; + + lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t pad_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + + uint32_t i; + uint32_t child_cnt = lv_obj_get_child_cnt(obj); + for(i = 0; i < child_cnt; i++) { + lv_obj_t * child = obj->spec_attr->children[i]; + if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; + if(lv_obj_has_flag(child, LV_OBJ_FLAG_SNAPPABLE)) { + lv_coord_t x_child = 0; + lv_coord_t x_parent = 0; + switch(align) { + case LV_SCROLL_SNAP_START: + x_child = child->coords.x1; + x_parent = obj->coords.x1 + pad_left; + break; + case LV_SCROLL_SNAP_END: + x_child = child->coords.x2; + x_parent = obj->coords.x2 - pad_right; + break; + case LV_SCROLL_SNAP_CENTER: + x_child = child->coords.x1 + lv_area_get_width(&child->coords) / 2; + x_parent = obj->coords.x1 + pad_left + (lv_area_get_width(&obj->coords) - pad_left - pad_right) / 2; + break; + default: + continue; + } + + x_child += ofs; + if(x_child >= min && x_child <= max) { + lv_coord_t x = x_child - x_parent; + if(LV_ABS(x) < LV_ABS(dist)) dist = x; + } + } + } + + return dist == LV_COORD_MAX ? 0 : -dist; +} + +/** + * Search for snap point in the `min` - `max` range. + * @param obj the object on which snap point should be found + * @param min ignore snap points smaller than this. (Absolute coordinate) + * @param max ignore snap points greater than this. (Absolute coordinate) + * @param ofs offset to snap points. Useful to get a snap point in an imagined case + * what if children are already moved by this value + * @return the distance of the snap point. + */ +static lv_coord_t find_snap_point_y(const lv_obj_t * obj, lv_coord_t min, lv_coord_t max, lv_coord_t ofs) +{ + lv_scroll_snap_t align = lv_obj_get_scroll_snap_y(obj); + if(align == LV_SCROLL_SNAP_NONE) return 0; + + lv_coord_t dist = LV_COORD_MAX; + + lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); + + uint32_t i; + uint32_t child_cnt = lv_obj_get_child_cnt(obj); + for(i = 0; i < child_cnt; i++) { + lv_obj_t * child = obj->spec_attr->children[i]; + if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; + if(lv_obj_has_flag(child, LV_OBJ_FLAG_SNAPPABLE)) { + lv_coord_t y_child = 0; + lv_coord_t y_parent = 0; + switch(align) { + case LV_SCROLL_SNAP_START: + y_child = child->coords.y1; + y_parent = obj->coords.y1 + pad_top; + break; + case LV_SCROLL_SNAP_END: + y_child = child->coords.y2; + y_parent = obj->coords.y2 - pad_bottom; + break; + case LV_SCROLL_SNAP_CENTER: + y_child = child->coords.y1 + lv_area_get_height(&child->coords) / 2; + y_parent = obj->coords.y1 + pad_top + (lv_area_get_height(&obj->coords) - pad_top - pad_bottom) / 2; + break; + default: + continue; + } + + y_child += ofs; + if(y_child >= min && y_child <= max) { + lv_coord_t y = y_child - y_parent; + if(LV_ABS(y) < LV_ABS(dist)) dist = y; + } + } + } + + return dist == LV_COORD_MAX ? 0 : -dist; +} + +static void scroll_limit_diff(_lv_indev_proc_t * proc, lv_coord_t * diff_x, lv_coord_t * diff_y) +{ + if(diff_y) { + if(proc->types.pointer.scroll_sum.y + *diff_y < proc->types.pointer.scroll_area.y1) { + *diff_y = proc->types.pointer.scroll_area.y1 - proc->types.pointer.scroll_sum.y; + } + + if(proc->types.pointer.scroll_sum.y + *diff_y > proc->types.pointer.scroll_area.y2) { + *diff_y = proc->types.pointer.scroll_area.y2 - proc->types.pointer.scroll_sum.y; + } + } + + if(diff_x) { + if(proc->types.pointer.scroll_sum.x + *diff_x < proc->types.pointer.scroll_area.x1) { + *diff_x = proc->types.pointer.scroll_area.x1 - proc->types.pointer.scroll_sum.x; + } + + if(proc->types.pointer.scroll_sum.x + *diff_x > proc->types.pointer.scroll_area.x2) { + *diff_x = proc->types.pointer.scroll_area.x2 - proc->types.pointer.scroll_sum.x; + } + } +} + + + +static lv_coord_t scroll_throw_predict_y(_lv_indev_proc_t * proc) +{ + lv_coord_t y = proc->types.pointer.scroll_throw_vect.y; + lv_coord_t move = 0; + + lv_indev_t * indev_act = lv_indev_get_act(); + lv_coord_t scroll_throw = indev_act->driver->scroll_throw; + + while(y) { + move += y; + y = y * (100 - scroll_throw) / 100; + } + return move; +} + + +static lv_coord_t scroll_throw_predict_x(_lv_indev_proc_t * proc) +{ + lv_coord_t x = proc->types.pointer.scroll_throw_vect.x; + lv_coord_t move = 0; + + lv_indev_t * indev_act = lv_indev_get_act(); + lv_coord_t scroll_throw = indev_act->driver->scroll_throw; + + while(x) { + move += x; + x = x * (100 - scroll_throw) / 100; + } + return move; +} + +static lv_coord_t elastic_diff(lv_obj_t * scroll_obj, lv_coord_t diff, lv_coord_t scroll_start, lv_coord_t scroll_end, + lv_dir_t dir) +{ + if(lv_obj_has_flag(scroll_obj, LV_OBJ_FLAG_SCROLL_ELASTIC)) { + /*If there is snapping in the current direction don't use the elastic factor because + *it's natural that the first and last items are scrolled (snapped) in.*/ + lv_scroll_snap_t snap; + snap = dir == LV_DIR_HOR ? lv_obj_get_scroll_snap_x(scroll_obj) : lv_obj_get_scroll_snap_y(scroll_obj); + + lv_obj_t * act_obj = lv_indev_get_obj_act(); + lv_coord_t snap_point = 0; + lv_coord_t act_obj_point = 0; + + if(dir == LV_DIR_HOR) { + lv_coord_t pad_left = lv_obj_get_style_pad_left(scroll_obj, LV_PART_MAIN); + lv_coord_t pad_right = lv_obj_get_style_pad_right(scroll_obj, LV_PART_MAIN); + + switch(snap) { + case LV_SCROLL_SNAP_CENTER: + snap_point = pad_left + (lv_area_get_width(&scroll_obj->coords) - pad_left - pad_right) / 2 + scroll_obj->coords.x1; + act_obj_point = lv_area_get_width(&act_obj->coords) / 2 + act_obj->coords.x1; + break; + case LV_SCROLL_SNAP_START: + snap_point = scroll_obj->coords.x1 + pad_left; + act_obj_point = act_obj->coords.x1; + break; + case LV_SCROLL_SNAP_END: + snap_point = scroll_obj->coords.x2 - pad_right; + act_obj_point = act_obj->coords.x2; + break; + } + } + else { + lv_coord_t pad_top = lv_obj_get_style_pad_top(scroll_obj, LV_PART_MAIN); + lv_coord_t pad_bottom = lv_obj_get_style_pad_bottom(scroll_obj, LV_PART_MAIN); + + switch(snap) { + case LV_SCROLL_SNAP_CENTER: + snap_point = pad_top + (lv_area_get_height(&scroll_obj->coords) - pad_top - pad_bottom) / 2 + scroll_obj->coords.y1; + act_obj_point = lv_area_get_height(&act_obj->coords) / 2 + act_obj->coords.y1; + break; + case LV_SCROLL_SNAP_START: + snap_point = scroll_obj->coords.y1 + pad_top; + act_obj_point = act_obj->coords.y1; + break; + case LV_SCROLL_SNAP_END: + snap_point = scroll_obj->coords.y2 - pad_bottom; + act_obj_point = act_obj->coords.y2; + break; + } + } + + if(scroll_end < 0) { + if(snap != LV_SCROLL_SNAP_NONE && act_obj_point > snap_point) return diff; + + /*Rounding*/ + if(diff < 0) diff -= ELASTIC_SLOWNESS_FACTOR / 2; + if(diff > 0) diff += ELASTIC_SLOWNESS_FACTOR / 2; + return diff / ELASTIC_SLOWNESS_FACTOR; + } + else if(scroll_start < 0) { + if(snap != LV_SCROLL_SNAP_NONE && act_obj_point < snap_point) return diff; + + /*Rounding*/ + if(diff < 0) diff -= ELASTIC_SLOWNESS_FACTOR / 2; + if(diff > 0) diff += ELASTIC_SLOWNESS_FACTOR / 2; + return diff / ELASTIC_SLOWNESS_FACTOR; + } + } + else { + /*Scroll back to the boundary if required*/ + if(scroll_end + diff < 0) diff = - scroll_end; + if(scroll_start - diff < 0) diff = scroll_start; + } + + return diff; +} + + diff --git a/L3_Middlewares/LVGL/src/indev/lv_indev_scroll.h b/L3_Middlewares/LVGL/src/core/lv_indev_scroll.h similarity index 78% rename from L3_Middlewares/LVGL/src/indev/lv_indev_scroll.h rename to L3_Middlewares/LVGL/src/core/lv_indev_scroll.h index 413376f..76c64d1 100644 --- a/L3_Middlewares/LVGL/src/indev/lv_indev_scroll.h +++ b/L3_Middlewares/LVGL/src/core/lv_indev_scroll.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../core/lv_obj.h" +#include "lv_obj.h" /********************* * DEFINES @@ -29,15 +29,15 @@ extern "C" { /** * Handle scrolling. Called by LVGL during input device processing - * @param indev pointer to an input device + * @param proc pointer to an input device's proc field */ -void lv_indev_scroll_handler(lv_indev_t * indev); +void _lv_indev_scroll_handler(_lv_indev_proc_t * proc); /** * Handle throwing after scrolling. Called by LVGL during input device processing - * @param indev pointer to an input device + * @param proc pointer to an input device's proc field */ -void lv_indev_scroll_throw_handler(lv_indev_t * indev); +void _lv_indev_scroll_throw_handler(_lv_indev_proc_t * proc); /** * Predict where would a scroll throw end @@ -45,7 +45,7 @@ void lv_indev_scroll_throw_handler(lv_indev_t * indev); * @param dir ` LV_DIR_VER` or `LV_DIR_HOR` * @return the difference compared to the current position when the throw would be finished */ -int32_t lv_indev_scroll_throw_predict(lv_indev_t * indev, lv_dir_t dir); +lv_coord_t lv_indev_scroll_throw_predict(lv_indev_t * indev, lv_dir_t dir); /** * Get the distance of the nearest snap point diff --git a/L3_Middlewares/LVGL/src/core/lv_obj.c b/L3_Middlewares/LVGL/src/core/lv_obj.c index c58e955..f0f4d55 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj.c +++ b/L3_Middlewares/LVGL/src/core/lv_obj.c @@ -6,31 +6,46 @@ /********************* * INCLUDES *********************/ -#include "lv_obj_private.h" -#include "../misc/lv_event_private.h" -#include "../misc/lv_area_private.h" -#include "lv_obj_style_private.h" -#include "lv_obj_event_private.h" -#include "lv_obj_class_private.h" -#include "../indev/lv_indev.h" -#include "../indev/lv_indev_private.h" +#include "lv_obj.h" +#include "lv_indev.h" #include "lv_refr.h" #include "lv_group.h" -#include "../display/lv_display.h" -#include "../display/lv_display_private.h" -#include "../themes/lv_theme.h" +#include "lv_disp.h" +#include "lv_theme.h" #include "../misc/lv_assert.h" +#include "../draw/lv_draw.h" +#include "../misc/lv_anim.h" +#include "../misc/lv_timer.h" +#include "../misc/lv_async.h" +#include "../misc/lv_fs.h" +#include "../misc/lv_gc.h" #include "../misc/lv_math.h" #include "../misc/lv_log.h" -#include "../misc/lv_types.h" -#include "../tick/lv_tick.h" -#include "../stdlib/lv_string.h" -#include "lv_obj_draw_private.h" +#include "../hal/lv_hal.h" +#include "../extra/lv_extra.h" +#include +#include + +#if LV_USE_GPU_STM32_DMA2D + #include "../draw/stm32_dma2d/lv_gpu_stm32_dma2d.h" +#endif + +#if LV_USE_GPU_RA6M3_G2D + #include "../draw/renesas/lv_gpu_d2_ra6m3.h" +#endif + +#if LV_USE_GPU_SWM341_DMA2D + #include "../draw/swm341_dma2d/lv_gpu_swm341_dma2d.h" +#endif + +#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT + #include "../draw/nxp/pxp/lv_gpu_nxp_pxp.h" +#endif /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_obj_class) +#define MY_CLASS &lv_obj_class #define LV_OBJ_DEF_WIDTH (LV_DPX(100)) #define LV_OBJ_DEF_HEIGHT (LV_DPX(50)) #define STYLE_TRANSITION_MAX 32 @@ -46,137 +61,15 @@ static void lv_obj_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); static void lv_obj_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); static void lv_obj_draw(lv_event_t * e); static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e); -static void draw_scrollbar(lv_obj_t * obj, lv_layer_t * layer); -static lv_result_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * dsc); +static void draw_scrollbar(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx); +static lv_res_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * dsc); static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_find); -static void update_obj_state(lv_obj_t * obj, lv_state_t new_state); -static void null_on_delete_cb(lv_event_t * e); - -#if LV_USE_OBJ_PROPERTY - static lv_result_t lv_obj_set_any(lv_obj_t *, lv_prop_id_t, const lv_property_t *); - static lv_result_t lv_obj_get_any(const lv_obj_t *, lv_prop_id_t, lv_property_t *); -#endif +static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state); /********************** * STATIC VARIABLES **********************/ -#if LV_USE_OBJ_PROPERTY -static const lv_property_ops_t properties[] = { - { - .id = LV_PROPERTY_OBJ_PARENT, - .setter = lv_obj_set_parent, - .getter = lv_obj_get_parent, - }, - { - .id = LV_PROPERTY_OBJ_X, - .setter = lv_obj_set_x, - .getter = lv_obj_get_x, - }, - { - .id = LV_PROPERTY_OBJ_Y, - .setter = lv_obj_set_y, - .getter = lv_obj_get_y, - }, - { - .id = LV_PROPERTY_OBJ_W, - .setter = lv_obj_set_width, - .getter = lv_obj_get_width, - }, - { - .id = LV_PROPERTY_OBJ_H, - .setter = lv_obj_set_height, - .getter = lv_obj_get_height, - }, - { - .id = LV_PROPERTY_OBJ_CONTENT_WIDTH, - .setter = lv_obj_set_content_width, - .getter = lv_obj_get_content_width, - }, - { - .id = LV_PROPERTY_OBJ_CONTENT_HEIGHT, - .setter = lv_obj_set_content_height, - .getter = lv_obj_get_content_height, - }, - { - .id = LV_PROPERTY_OBJ_LAYOUT, - .setter = lv_obj_set_layout, - }, - { - .id = LV_PROPERTY_OBJ_ALIGN, - .setter = lv_obj_set_align, - }, - { - .id = LV_PROPERTY_OBJ_SCROLLBAR_MODE, - .setter = lv_obj_set_scrollbar_mode, - .getter = lv_obj_get_scrollbar_mode, - }, - { - .id = LV_PROPERTY_OBJ_SCROLL_DIR, - .setter = lv_obj_set_scroll_dir, - .getter = lv_obj_get_scroll_dir, - }, - { - .id = LV_PROPERTY_OBJ_SCROLL_SNAP_X, - .setter = lv_obj_set_scroll_snap_x, - .getter = lv_obj_get_scroll_snap_x, - }, - { - .id = LV_PROPERTY_OBJ_SCROLL_SNAP_Y, - .setter = lv_obj_set_scroll_snap_y, - .getter = lv_obj_get_scroll_snap_y, - }, - { - .id = LV_PROPERTY_OBJ_SCROLL_TOP, - .getter = lv_obj_get_scroll_top, - }, - { - .id = LV_PROPERTY_OBJ_SCROLL_BOTTOM, - .getter = lv_obj_get_scroll_bottom, - }, - { - .id = LV_PROPERTY_OBJ_SCROLL_LEFT, - .getter = lv_obj_get_scroll_left, - }, - { - .id = LV_PROPERTY_OBJ_SCROLL_RIGHT, - .getter = lv_obj_get_scroll_right, - }, - { - .id = LV_PROPERTY_OBJ_SCROLL_END, - .getter = lv_obj_get_scroll_end, - }, - { - .id = LV_PROPERTY_OBJ_EXT_DRAW_SIZE, - .getter = lv_obj_get_ext_draw_size, - }, - { - .id = LV_PROPERTY_OBJ_EVENT_COUNT, - .getter = lv_obj_get_event_count, - }, - { - .id = LV_PROPERTY_OBJ_SCREEN, - .getter = lv_obj_get_screen, - }, - { - .id = LV_PROPERTY_OBJ_DISPLAY, - .getter = lv_obj_get_display, - }, - { - .id = LV_PROPERTY_OBJ_CHILD_COUNT, - .getter = lv_obj_get_child_count, - }, - { - .id = LV_PROPERTY_OBJ_INDEX, - .getter = lv_obj_get_index, - }, - { - .id = LV_PROPERTY_ID_ANY, - .setter = lv_obj_set_any, - .getter = lv_obj_get_any, - } -}; -#endif - +static bool lv_initialized = false; const lv_obj_class_t lv_obj_class = { .constructor_cb = lv_obj_constructor, .destructor_cb = lv_obj_destructor, @@ -187,19 +80,6 @@ const lv_obj_class_t lv_obj_class = { .group_def = LV_OBJ_CLASS_GROUP_DEF_FALSE, .instance_size = (sizeof(lv_obj_t)), .base_class = NULL, - .name = "obj", -#if LV_USE_OBJ_PROPERTY - .prop_index_start = LV_PROPERTY_OBJ_START, - .prop_index_end = LV_PROPERTY_OBJ_END, - .properties = properties, - .properties_count = sizeof(properties) / sizeof(properties[0]), - -#if LV_USE_OBJ_PROPERTY_NAME - .property_names = lv_obj_property_names, - .names_count = sizeof(lv_obj_property_names) / sizeof(lv_property_name_t), -#endif - -#endif }; /********************** @@ -210,12 +90,130 @@ const lv_obj_class_t lv_obj_class = { * GLOBAL FUNCTIONS **********************/ +bool lv_is_initialized(void) +{ + return lv_initialized; +} + +void lv_init(void) +{ + /*Do nothing if already initialized*/ + if(lv_initialized) { + LV_LOG_WARN("lv_init: already inited"); + return; + } + + LV_LOG_INFO("begin"); + + /*Initialize the misc modules*/ + lv_mem_init(); + + _lv_timer_core_init(); + + _lv_fs_init(); + + _lv_anim_core_init(); + + _lv_group_init(); + + lv_draw_init(); + +#if LV_USE_GPU_STM32_DMA2D + /*Initialize DMA2D GPU*/ + lv_draw_stm32_dma2d_init(); +#endif + +#if LV_USE_GPU_RA6M3_G2D + /*Initialize G2D GPU*/ + lv_draw_ra6m3_g2d_init(); +#endif + +#if LV_USE_GPU_SWM341_DMA2D + /*Initialize DMA2D GPU*/ + lv_draw_swm341_dma2d_init(); +#endif + +#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT + PXP_COND_STOP(!lv_gpu_nxp_pxp_init(), "PXP init failed."); +#endif + + _lv_obj_style_init(); + _lv_ll_init(&LV_GC_ROOT(_lv_disp_ll), sizeof(lv_disp_t)); + _lv_ll_init(&LV_GC_ROOT(_lv_indev_ll), sizeof(lv_indev_t)); + + /*Initialize the screen refresh system*/ + _lv_refr_init(); + + _lv_img_decoder_init(); +#if LV_IMG_CACHE_DEF_SIZE + lv_img_cache_set_size(LV_IMG_CACHE_DEF_SIZE); +#endif + /*Test if the IDE has UTF-8 encoding*/ + const char * txt = "Á"; + + const uint8_t * txt_u8 = (uint8_t *)txt; + if(txt_u8[0] != 0xc3 || txt_u8[1] != 0x81 || txt_u8[2] != 0x00) { + LV_LOG_WARN("The strings have no UTF-8 encoding. Non-ASCII characters won't be displayed."); + } + + uint32_t endianess_test = 0x11223344; + uint8_t * endianess_test_p = (uint8_t *) &endianess_test; + bool big_endian = endianess_test_p[0] == 0x11 ? true : false; + + if(big_endian) { + LV_ASSERT_MSG(LV_BIG_ENDIAN_SYSTEM == 1, + "It's a big endian system but LV_BIG_ENDIAN_SYSTEM is not enabled in lv_conf.h"); + } + else { + LV_ASSERT_MSG(LV_BIG_ENDIAN_SYSTEM == 0, + "It's a little endian system but LV_BIG_ENDIAN_SYSTEM is enabled in lv_conf.h"); + } + +#if LV_USE_ASSERT_MEM_INTEGRITY + LV_LOG_WARN("Memory integrity checks are enabled via LV_USE_ASSERT_MEM_INTEGRITY which makes LVGL much slower"); +#endif + +#if LV_USE_ASSERT_OBJ + LV_LOG_WARN("Object sanity checks are enabled via LV_USE_ASSERT_OBJ which makes LVGL much slower"); +#endif + +#if LV_USE_ASSERT_STYLE + LV_LOG_WARN("Style sanity checks are enabled that uses more RAM"); +#endif + +#if LV_LOG_LEVEL == LV_LOG_LEVEL_TRACE + LV_LOG_WARN("Log level is set to 'Trace' which makes LVGL much slower"); +#endif + + lv_extra_init(); + + lv_initialized = true; + + LV_LOG_TRACE("finished"); +} + +#if LV_ENABLE_GC || !LV_MEM_CUSTOM + +void lv_deinit(void) +{ + _lv_gc_clear_roots(); + + lv_disp_set_default(NULL); + lv_mem_deinit(); + lv_initialized = false; + + LV_LOG_INFO("lv_deinit done"); + +#if LV_USE_LOG + lv_log_register_print_cb(NULL); +#endif +} +#endif + lv_obj_t * lv_obj_create(lv_obj_t * parent) { LV_LOG_INFO("begin"); lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - LV_ASSERT_NULL(obj); - if(obj == NULL) return NULL; lv_obj_class_init_obj(obj); return obj; } @@ -265,7 +263,7 @@ void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f) } } -void lv_obj_remove_flag(lv_obj_t * obj, lv_obj_flag_t f) +void lv_obj_clear_flag(lv_obj_t * obj, lv_obj_flag_t f) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -293,43 +291,26 @@ void lv_obj_remove_flag(lv_obj_t * obj, lv_obj_flag_t f) } -void lv_obj_update_flag(lv_obj_t * obj, lv_obj_flag_t f, bool v) -{ - if(v) lv_obj_add_flag(obj, f); - else lv_obj_remove_flag(obj, f); -} - void lv_obj_add_state(lv_obj_t * obj, lv_state_t state) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_state_t new_state = obj->state | state; if(obj->state != new_state) { - - if(new_state & ~obj->state & LV_STATE_DISABLED) { - lv_indev_reset(NULL, obj); - } - - update_obj_state(obj, new_state); + lv_obj_set_state(obj, new_state); } } -void lv_obj_remove_state(lv_obj_t * obj, lv_state_t state) +void lv_obj_clear_state(lv_obj_t * obj, lv_state_t state) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_state_t new_state = obj->state & (~state); if(obj->state != new_state) { - update_obj_state(obj, new_state); + lv_obj_set_state(obj, new_state); } } -void lv_obj_set_state(lv_obj_t * obj, lv_state_t state, bool v) -{ - if(v) lv_obj_add_state(obj, state); - else lv_obj_remove_state(obj, state); -} - /*======================= * Getter functions *======================*/ @@ -338,14 +319,14 @@ bool lv_obj_has_flag(const lv_obj_t * obj, lv_obj_flag_t f) { LV_ASSERT_OBJ(obj, MY_CLASS); - return (obj->flags & f) == f; + return (obj->flags & f) == f ? true : false; } bool lv_obj_has_flag_any(const lv_obj_t * obj, lv_obj_flag_t f) { LV_ASSERT_OBJ(obj, MY_CLASS); - return !!(obj->flags & f); + return (obj->flags & f) ? true : false; } lv_state_t lv_obj_get_state(const lv_obj_t * obj) @@ -359,10 +340,10 @@ bool lv_obj_has_state(const lv_obj_t * obj, lv_state_t state) { LV_ASSERT_OBJ(obj, MY_CLASS); - return !!(obj->state & state); + return obj->state & state ? true : false; } -lv_group_t * lv_obj_get_group(const lv_obj_t * obj) +void * lv_obj_get_group(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -379,10 +360,14 @@ void lv_obj_allocate_spec_attr(lv_obj_t * obj) LV_ASSERT_OBJ(obj, MY_CLASS); if(obj->spec_attr == NULL) { - obj->spec_attr = lv_malloc_zeroed(sizeof(lv_obj_spec_attr_t)); + static uint32_t x = 0; + x++; + obj->spec_attr = lv_mem_alloc(sizeof(_lv_obj_spec_attr_t)); LV_ASSERT_MALLOC(obj->spec_attr); if(obj->spec_attr == NULL) return; + lv_memset_00(obj->spec_attr, sizeof(_lv_obj_spec_attr_t)); + obj->spec_attr->scroll_dir = LV_DIR_ALL; obj->spec_attr->scrollbar_mode = LV_SCROLLBAR_MODE_AUTO; } @@ -391,7 +376,7 @@ void lv_obj_allocate_spec_attr(lv_obj_t * obj) bool lv_obj_check_type(const lv_obj_t * obj, const lv_obj_class_t * class_p) { if(obj == NULL) return false; - return obj->class_p == class_p; + return obj->class_p == class_p ? true : false; } bool lv_obj_has_class(const lv_obj_t * obj, const lv_obj_class_t * class_p) @@ -412,7 +397,7 @@ const lv_obj_class_t * lv_obj_get_class(const lv_obj_t * obj) bool lv_obj_is_valid(const lv_obj_t * obj) { - lv_display_t * disp = lv_display_get_next(NULL); + lv_disp_t * disp = lv_disp_get_next(NULL); while(disp) { uint32_t i; for(i = 0; i < disp->screen_cnt; i++) { @@ -421,57 +406,12 @@ bool lv_obj_is_valid(const lv_obj_t * obj) if(found) return true; } - disp = lv_display_get_next(disp); + disp = lv_disp_get_next(disp); } return false; } -void lv_obj_null_on_delete(lv_obj_t ** obj_ptr) -{ - lv_obj_add_event_cb(*obj_ptr, null_on_delete_cb, LV_EVENT_DELETE, obj_ptr); -} - -#if LV_USE_OBJ_ID -void * lv_obj_get_id(const lv_obj_t * obj) -{ - LV_ASSERT_NULL(obj); - return obj->id; -} - -lv_obj_t * lv_obj_get_child_by_id(const lv_obj_t * obj, const void * id) -{ - if(obj == NULL) obj = lv_display_get_screen_active(NULL); - if(obj == NULL) return NULL; - - uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); - for(i = 0; i < child_cnt; i++) { - lv_obj_t * child = obj->spec_attr->children[i]; - if(lv_obj_id_compare(child->id, id) == 0) return child; - } - - /*Search children*/ - for(i = 0; i < child_cnt; i++) { - lv_obj_t * child = obj->spec_attr->children[i]; - lv_obj_t * found = lv_obj_get_child_by_id(child, id); - if(found != NULL) return found; - } - - return NULL; -} -#endif - -void lv_obj_set_user_data(lv_obj_t * obj, void * user_data) -{ - obj->user_data = user_data; -} - -void * lv_obj_get_user_data(lv_obj_t * obj) -{ - return obj->user_data; -} - /********************** * STATIC FUNCTIONS **********************/ @@ -483,8 +423,8 @@ static void lv_obj_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_t * parent = obj->parent; if(parent) { - int32_t sl = lv_obj_get_scroll_left(parent); - int32_t st = lv_obj_get_scroll_top(parent); + lv_coord_t sl = lv_obj_get_scroll_left(parent); + lv_coord_t st = lv_obj_get_scroll_top(parent); obj->coords.y1 = parent->coords.y1 + lv_obj_get_style_pad_top(parent, LV_PART_MAIN) - st; obj->coords.y2 = obj->coords.y1 - 1; @@ -504,10 +444,6 @@ static void lv_obj_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) obj->flags |= LV_OBJ_FLAG_SCROLL_WITH_ARROW; if(parent) obj->flags |= LV_OBJ_FLAG_GESTURE_BUBBLE; -#if LV_OBJ_ID_AUTO_ASSIGN - lv_obj_assign_id(class_p, obj); -#endif - LV_TRACE_OBJ_CREATE("finished"); } @@ -515,7 +451,7 @@ static void lv_obj_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { LV_UNUSED(class_p); - lv_event_mark_deleted(obj); + _lv_event_mark_deleted(obj); /*Remove all style*/ lv_obj_enable_style_refresh(false); /*No need to refresh the style because the object will be deleted*/ @@ -523,7 +459,7 @@ static void lv_obj_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_enable_style_refresh(true); /*Remove the animations from this object*/ - lv_anim_delete(obj, NULL); + lv_anim_del(obj, NULL); /*Delete from the group*/ lv_group_t * group = lv_obj_get_group(obj); @@ -531,25 +467,23 @@ static void lv_obj_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) if(obj->spec_attr) { if(obj->spec_attr->children) { - lv_free(obj->spec_attr->children); + lv_mem_free(obj->spec_attr->children); obj->spec_attr->children = NULL; } + if(obj->spec_attr->event_dsc) { + lv_mem_free(obj->spec_attr->event_dsc); + obj->spec_attr->event_dsc = NULL; + } - lv_event_remove_all(&obj->spec_attr->event_list); - - lv_free(obj->spec_attr); + lv_mem_free(obj->spec_attr); obj->spec_attr = NULL; } - -#if LV_OBJ_ID_AUTO_ASSIGN - lv_obj_free_id(obj); -#endif } static void lv_obj_draw(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); if(code == LV_EVENT_COVER_CHECK) { lv_cover_check_info_t * info = lv_event_get_param(e); if(info->res == LV_COVER_RES_MASKED) return; @@ -559,14 +493,17 @@ static void lv_obj_draw(lv_event_t * e) } /*Most trivial test. Is the mask fully IN the object? If no it surely doesn't cover it*/ - int32_t r = lv_obj_get_style_radius(obj, LV_PART_MAIN); - int32_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN); - int32_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN); + lv_coord_t r = lv_obj_get_style_radius(obj, LV_PART_MAIN); + lv_coord_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN); + lv_coord_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN); lv_area_t coords; lv_area_copy(&coords, &obj->coords); - lv_area_increase(&coords, w, h); + coords.x1 -= w; + coords.x2 += w; + coords.y1 -= h; + coords.y2 += h; - if(lv_area_is_in(info->area, &coords, r) == false) { + if(_lv_area_is_in(info->area, &coords, r) == false) { info->res = LV_COVER_RES_NOT_COVER; return; } @@ -581,69 +518,118 @@ static void lv_obj_draw(lv_event_t * e) return; } - if(lv_obj_get_style_bg_grad_dir(obj, 0) != LV_GRAD_DIR_NONE) { - if(lv_obj_get_style_bg_grad_opa(obj, 0) < LV_OPA_MAX) { - info->res = LV_COVER_RES_NOT_COVER; - return; - } - } - const lv_grad_dsc_t * grad_dsc = lv_obj_get_style_bg_grad(obj, 0); - if(grad_dsc) { - uint32_t i; - for(i = 0; i < grad_dsc->stops_count; i++) { - if(grad_dsc->stops[i].opa < LV_OPA_MAX) { - info->res = LV_COVER_RES_NOT_COVER; - return; - } - } - } info->res = LV_COVER_RES_COVER; + } else if(code == LV_EVENT_DRAW_MAIN) { - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); lv_draw_rect_dsc_t draw_dsc; lv_draw_rect_dsc_init(&draw_dsc); - - lv_obj_init_draw_rect_dsc(obj, LV_PART_MAIN, &draw_dsc); /*If the border is drawn later disable loading its properties*/ if(lv_obj_get_style_border_post(obj, LV_PART_MAIN)) { draw_dsc.border_post = 1; } - int32_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN); - int32_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN); + lv_obj_init_draw_rect_dsc(obj, LV_PART_MAIN, &draw_dsc); + lv_coord_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN); + lv_coord_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN); lv_area_t coords; lv_area_copy(&coords, &obj->coords); - lv_area_increase(&coords, w, h); + coords.x1 -= w; + coords.x2 += w; + coords.y1 -= h; + coords.y2 += h; + + lv_obj_draw_part_dsc_t part_dsc; + lv_obj_draw_dsc_init(&part_dsc, draw_ctx); + part_dsc.class_p = MY_CLASS; + part_dsc.type = LV_OBJ_DRAW_PART_RECTANGLE; + part_dsc.rect_dsc = &draw_dsc; + part_dsc.draw_area = &coords; + part_dsc.part = LV_PART_MAIN; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_dsc); + +#if LV_DRAW_COMPLEX + /*With clip corner enabled draw the bg img separately to make it clipped*/ + bool clip_corner = (lv_obj_get_style_clip_corner(obj, LV_PART_MAIN) && draw_dsc.radius != 0) ? true : false; + const void * bg_img_src = draw_dsc.bg_img_src; + if(clip_corner) { + draw_dsc.bg_img_src = NULL; + } +#endif + + lv_draw_rect(draw_ctx, &draw_dsc, &coords); + + +#if LV_DRAW_COMPLEX + if(clip_corner) { + lv_draw_mask_radius_param_t * mp = lv_mem_buf_get(sizeof(lv_draw_mask_radius_param_t)); + lv_draw_mask_radius_init(mp, &obj->coords, draw_dsc.radius, false); + /*Add the mask and use `obj+8` as custom id. Don't use `obj` directly because it might be used by the user*/ + lv_draw_mask_add(mp, obj + 8); - lv_draw_rect(layer, &draw_dsc, &coords); + if(bg_img_src) { + draw_dsc.bg_opa = LV_OPA_TRANSP; + draw_dsc.border_opa = LV_OPA_TRANSP; + draw_dsc.outline_opa = LV_OPA_TRANSP; + draw_dsc.shadow_opa = LV_OPA_TRANSP; + draw_dsc.bg_img_src = bg_img_src; + lv_draw_rect(draw_ctx, &draw_dsc, &coords); + } + + } +#endif + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_dsc); } else if(code == LV_EVENT_DRAW_POST) { - lv_layer_t * layer = lv_event_get_layer(e); - draw_scrollbar(obj, layer); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); + draw_scrollbar(obj, draw_ctx); + +#if LV_DRAW_COMPLEX + if(lv_obj_get_style_clip_corner(obj, LV_PART_MAIN)) { + lv_draw_mask_radius_param_t * param = lv_draw_mask_remove_custom(obj + 8); + if(param) { + lv_draw_mask_free_param(param); + lv_mem_buf_release(param); + } + } +#endif /*If the border is drawn later disable loading other properties*/ if(lv_obj_get_style_border_post(obj, LV_PART_MAIN)) { lv_draw_rect_dsc_t draw_dsc; lv_draw_rect_dsc_init(&draw_dsc); draw_dsc.bg_opa = LV_OPA_TRANSP; - draw_dsc.bg_image_opa = LV_OPA_TRANSP; + draw_dsc.bg_img_opa = LV_OPA_TRANSP; draw_dsc.outline_opa = LV_OPA_TRANSP; draw_dsc.shadow_opa = LV_OPA_TRANSP; lv_obj_init_draw_rect_dsc(obj, LV_PART_MAIN, &draw_dsc); - int32_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN); - int32_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN); + lv_coord_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN); + lv_coord_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN); lv_area_t coords; lv_area_copy(&coords, &obj->coords); - lv_area_increase(&coords, w, h); + coords.x1 -= w; + coords.x2 += w; + coords.y1 -= h; + coords.y2 += h; + + lv_obj_draw_part_dsc_t part_dsc; + lv_obj_draw_dsc_init(&part_dsc, draw_ctx); + part_dsc.class_p = MY_CLASS; + part_dsc.type = LV_OBJ_DRAW_PART_BORDER_POST; + part_dsc.rect_dsc = &draw_dsc; + part_dsc.draw_area = &coords; + part_dsc.part = LV_PART_MAIN; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_dsc); - lv_draw_rect(layer, &draw_dsc, &coords); + lv_draw_rect(draw_ctx, &draw_dsc, &coords); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_dsc); } } } -static void draw_scrollbar(lv_obj_t * obj, lv_layer_t * layer) +static void draw_scrollbar(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx) { lv_area_t hor_area; @@ -653,16 +639,28 @@ static void draw_scrollbar(lv_obj_t * obj, lv_layer_t * layer) if(lv_area_get_size(&hor_area) <= 0 && lv_area_get_size(&ver_area) <= 0) return; lv_draw_rect_dsc_t draw_dsc; - lv_result_t sb_res = scrollbar_init_draw_dsc(obj, &draw_dsc); - if(sb_res != LV_RESULT_OK) return; + lv_res_t sb_res = scrollbar_init_draw_dsc(obj, &draw_dsc); + if(sb_res != LV_RES_OK) return; + + lv_obj_draw_part_dsc_t part_dsc; + lv_obj_draw_dsc_init(&part_dsc, draw_ctx); + part_dsc.class_p = MY_CLASS; + part_dsc.type = LV_OBJ_DRAW_PART_SCROLLBAR; + part_dsc.rect_dsc = &draw_dsc; + part_dsc.part = LV_PART_SCROLLBAR; if(lv_area_get_size(&hor_area) > 0) { - draw_dsc.base.id1 = 0; - lv_draw_rect(layer, &draw_dsc, &hor_area); + part_dsc.draw_area = &hor_area; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_dsc); + lv_draw_rect(draw_ctx, &draw_dsc, &hor_area); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_dsc); } if(lv_area_get_size(&ver_area) > 0) { - draw_dsc.base.id1 = 1; - lv_draw_rect(layer, &draw_dsc, &ver_area); + part_dsc.draw_area = &ver_area; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_dsc); + part_dsc.draw_area = &ver_area; + lv_draw_rect(draw_ctx, &draw_dsc, &ver_area); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_dsc); } } @@ -670,9 +668,9 @@ static void draw_scrollbar(lv_obj_t * obj, lv_layer_t * layer) * Initialize the draw descriptor for the scrollbar * @param obj pointer to an object * @param dsc the draw descriptor to initialize - * @return LV_RESULT_OK: the scrollbar is visible; LV_RESULT_INVALID: the scrollbar is not visible + * @return LV_RES_OK: the scrollbar is visible; LV_RES_INV: the scrollbar is not visible */ -static lv_result_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * dsc) +static lv_res_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * dsc) { lv_draw_rect_dsc_init(dsc); dsc->bg_opa = lv_obj_get_style_bg_opa(obj, LV_PART_SCROLLBAR); @@ -691,6 +689,7 @@ static lv_result_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * } } +#if LV_DRAW_COMPLEX dsc->shadow_opa = lv_obj_get_style_shadow_opa(obj, LV_PART_SCROLLBAR); if(dsc->shadow_opa > LV_OPA_MIN) { dsc->shadow_width = lv_obj_get_style_shadow_width(obj, LV_PART_SCROLLBAR); @@ -705,19 +704,22 @@ static lv_result_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, LV_PART_SCROLLBAR); if(opa < LV_OPA_MAX) { - lv_opa_t v = LV_OPA_MIX2(dsc->bg_opa, opa); - dsc->bg_opa = v; - dsc->border_opa = v; - dsc->shadow_opa = v; + dsc->bg_opa = (dsc->bg_opa * opa) >> 8; + dsc->border_opa = (dsc->bg_opa * opa) >> 8; + dsc->shadow_opa = (dsc->bg_opa * opa) >> 8; } if(dsc->bg_opa != LV_OPA_TRANSP || dsc->border_opa != LV_OPA_TRANSP || dsc->shadow_opa != LV_OPA_TRANSP) { dsc->radius = lv_obj_get_style_radius(obj, LV_PART_SCROLLBAR); - return LV_RESULT_OK; + return LV_RES_OK; } else { - return LV_RESULT_INVALID; + return LV_RES_INV; } +#else + if(dsc->bg_opa != LV_OPA_TRANSP || dsc->border_opa != LV_OPA_TRANSP) return LV_RES_OK; + else return LV_RES_INV; +#endif } static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) @@ -730,22 +732,22 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) lv_obj_add_state(obj, LV_STATE_PRESSED); } else if(code == LV_EVENT_RELEASED) { - lv_obj_remove_state(obj, LV_STATE_PRESSED); - void * param = lv_event_get_param(e); + lv_obj_clear_state(obj, LV_STATE_PRESSED); + lv_indev_t * indev = lv_event_get_indev(e); /*Go the checked state if enabled*/ - if(lv_indev_get_scroll_obj(param) == NULL && lv_obj_has_flag(obj, LV_OBJ_FLAG_CHECKABLE)) { + if(lv_indev_get_scroll_obj(indev) == NULL && lv_obj_has_flag(obj, LV_OBJ_FLAG_CHECKABLE)) { if(!(lv_obj_get_state(obj) & LV_STATE_CHECKED)) lv_obj_add_state(obj, LV_STATE_CHECKED); - else lv_obj_remove_state(obj, LV_STATE_CHECKED); + else lv_obj_clear_state(obj, LV_STATE_CHECKED); - lv_result_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - if(res != LV_RESULT_OK) return; + lv_res_t res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return; } } else if(code == LV_EVENT_PRESS_LOST) { - lv_obj_remove_state(obj, LV_STATE_PRESSED); + lv_obj_clear_state(obj, LV_STATE_PRESSED); } else if(code == LV_EVENT_STYLE_CHANGED) { - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); for(uint32_t i = 0; i < child_cnt; i++) { lv_obj_t * child = obj->spec_attr->children[i]; lv_obj_mark_layout_as_dirty(child); @@ -753,26 +755,26 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) } else if(code == LV_EVENT_KEY) { if(lv_obj_has_flag(obj, LV_OBJ_FLAG_CHECKABLE)) { - uint32_t c = lv_event_get_key(e); + char c = *((char *)lv_event_get_param(e)); if(c == LV_KEY_RIGHT || c == LV_KEY_UP) { lv_obj_add_state(obj, LV_STATE_CHECKED); } else if(c == LV_KEY_LEFT || c == LV_KEY_DOWN) { - lv_obj_remove_state(obj, LV_STATE_CHECKED); + lv_obj_clear_state(obj, LV_STATE_CHECKED); } /*With Enter LV_EVENT_RELEASED will send VALUE_CHANGE event*/ if(c != LV_KEY_ENTER) { - lv_result_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - if(res != LV_RESULT_OK) return; + lv_res_t res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return; } } else if(lv_obj_has_flag(obj, LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_SCROLL_WITH_ARROW) && !lv_obj_is_editable(obj)) { /*scroll by keypad or encoder*/ lv_anim_enable_t anim_enable = LV_ANIM_OFF; - int32_t sl = lv_obj_get_scroll_left(obj); - int32_t sr = lv_obj_get_scroll_right(obj); - uint32_t c = lv_event_get_key(e); + lv_coord_t sl = lv_obj_get_scroll_left(obj); + lv_coord_t sr = lv_obj_get_scroll_right(obj); + char c = *((char *)lv_event_get_param(e)); if(c == LV_KEY_DOWN) { /*use scroll_to_x/y functions to enforce scroll limits*/ lv_obj_scroll_to_y(obj, lv_obj_get_scroll_y(obj) + lv_obj_get_height(obj) / 4, anim_enable); @@ -808,7 +810,7 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) /* Use the indev for then indev handler. * But if the obj was focused manually it returns NULL so try to * use the indev from the event*/ - lv_indev_t * indev = lv_indev_active(); + lv_indev_t * indev = lv_indev_get_act(); if(indev == NULL) indev = lv_event_get_indev(e); lv_indev_type_t indev_type = lv_indev_get_type(indev); @@ -819,14 +821,14 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) } else { lv_obj_add_state(obj, state); - lv_obj_remove_state(obj, LV_STATE_EDITED); + lv_obj_clear_state(obj, LV_STATE_EDITED); } } else if(code == LV_EVENT_SCROLL_BEGIN) { lv_obj_add_state(obj, LV_STATE_SCROLLED); } else if(code == LV_EVENT_SCROLL_END) { - lv_obj_remove_state(obj, LV_STATE_SCROLLED); + lv_obj_clear_state(obj, LV_STATE_SCROLLED); if(lv_obj_get_scrollbar_mode(obj) == LV_SCROLLBAR_MODE_ACTIVE) { lv_area_t hor_area, ver_area; lv_obj_get_scrollbar_area(obj, &hor_area, &ver_area); @@ -835,26 +837,26 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) } } else if(code == LV_EVENT_DEFOCUSED) { - lv_obj_remove_state(obj, LV_STATE_FOCUSED | LV_STATE_EDITED | LV_STATE_FOCUS_KEY); + lv_obj_clear_state(obj, LV_STATE_FOCUSED | LV_STATE_EDITED | LV_STATE_FOCUS_KEY); } else if(code == LV_EVENT_SIZE_CHANGED) { - int32_t align = lv_obj_get_style_align(obj, LV_PART_MAIN); + lv_coord_t align = lv_obj_get_style_align(obj, LV_PART_MAIN); uint16_t layout = lv_obj_get_style_layout(obj, LV_PART_MAIN); if(layout || align) { lv_obj_mark_layout_as_dirty(obj); } uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); for(i = 0; i < child_cnt; i++) { lv_obj_t * child = obj->spec_attr->children[i]; lv_obj_mark_layout_as_dirty(child); } } else if(code == LV_EVENT_CHILD_CHANGED) { - int32_t w = lv_obj_get_style_width(obj, LV_PART_MAIN); - int32_t h = lv_obj_get_style_height(obj, LV_PART_MAIN); - int32_t align = lv_obj_get_style_align(obj, LV_PART_MAIN); + lv_coord_t w = lv_obj_get_style_width(obj, LV_PART_MAIN); + lv_coord_t h = lv_obj_get_style_height(obj, LV_PART_MAIN); + lv_coord_t align = lv_obj_get_style_align(obj, LV_PART_MAIN); uint16_t layout = lv_obj_get_style_layout(obj, LV_PART_MAIN); if(layout || align || w == LV_SIZE_CONTENT || h == LV_SIZE_CONTENT) { lv_obj_mark_layout_as_dirty(obj); @@ -865,22 +867,12 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) lv_obj_mark_layout_as_dirty(obj); } else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { - int32_t d = lv_obj_calculate_ext_draw_size(obj, LV_PART_MAIN); + lv_coord_t d = lv_obj_calculate_ext_draw_size(obj, LV_PART_MAIN); lv_event_set_ext_draw_size(e, d); } else if(code == LV_EVENT_DRAW_MAIN || code == LV_EVENT_DRAW_POST || code == LV_EVENT_COVER_CHECK) { lv_obj_draw(e); } - else if(code == LV_EVENT_INDEV_RESET) { - lv_obj_remove_state(obj, LV_STATE_PRESSED); - lv_obj_remove_state(obj, LV_STATE_SCROLLED); - } - else if(code == LV_EVENT_HOVER_OVER) { - lv_obj_add_state(obj, LV_STATE_HOVERED); - } - else if(code == LV_EVENT_HOVER_LEAVE) { - lv_obj_remove_state(obj, LV_STATE_HOVERED); - } } /** @@ -889,31 +881,25 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e) * @param obj pointer to an object * @param state the new state */ -static void update_obj_state(lv_obj_t * obj, lv_state_t new_state) +static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state) { if(obj->state == new_state) return; LV_ASSERT_OBJ(obj, MY_CLASS); lv_state_t prev_state = obj->state; + obj->state = new_state; - lv_style_state_cmp_t cmp_res = lv_obj_style_state_compare(obj, prev_state, new_state); + _lv_style_state_cmp_t cmp_res = _lv_obj_style_state_compare(obj, prev_state, new_state); /*If there is no difference in styles there is nothing else to do*/ - if(cmp_res == LV_STYLE_STATE_CMP_SAME) { - obj->state = new_state; - return; - } - - /*Invalidate the object in their current state*/ - lv_obj_invalidate(obj); + if(cmp_res == _LV_STYLE_STATE_CMP_SAME) return; - obj->state = new_state; - lv_obj_update_layer_type(obj); - lv_obj_style_transition_dsc_t * ts = lv_malloc_zeroed(sizeof(lv_obj_style_transition_dsc_t) * STYLE_TRANSITION_MAX); + _lv_obj_style_transition_dsc_t * ts = lv_mem_buf_get(sizeof(_lv_obj_style_transition_dsc_t) * STYLE_TRANSITION_MAX); + lv_memset_00(ts, sizeof(_lv_obj_style_transition_dsc_t) * STYLE_TRANSITION_MAX); uint32_t tsi = 0; uint32_t i; for(i = 0; i < obj->style_cnt && tsi < STYLE_TRANSITION_MAX; i++) { - lv_obj_style_t * obj_style = &obj->styles[i]; + _lv_obj_style_t * obj_style = &obj->styles[i]; lv_state_t state_act = lv_obj_style_get_selector_state(obj->styles[i].selector); lv_part_t part_act = lv_obj_style_get_selector_part(obj->styles[i].selector); if(state_act & (~new_state)) continue; /*Skip unrelated styles*/ @@ -940,7 +926,9 @@ static void update_obj_state(lv_obj_t * obj, lv_state_t new_state) ts[tsi].delay = tr->delay; ts[tsi].path_cb = tr->path_xcb; ts[tsi].prop = tr->props[j]; +#if LV_USE_USER_DATA ts[tsi].user_data = tr->user_data; +#endif ts[tsi].selector = obj_style->selector; tsi++; } @@ -949,19 +937,18 @@ static void update_obj_state(lv_obj_t * obj, lv_state_t new_state) for(i = 0; i < tsi; i++) { lv_part_t part_act = lv_obj_style_get_selector_part(ts[i].selector); - lv_obj_style_create_transition(obj, part_act, prev_state, new_state, &ts[i]); + _lv_obj_style_create_transition(obj, part_act, prev_state, new_state, &ts[i]); } - lv_free(ts); + lv_mem_buf_release(ts); - if(cmp_res == LV_STYLE_STATE_CMP_DIFF_REDRAW) { - /*Invalidation is not enough, e.g. layer type needs to be updated too*/ - lv_obj_refresh_style(obj, LV_PART_ANY, LV_STYLE_PROP_ANY); + if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_REDRAW) { + lv_obj_invalidate(obj); } - else if(cmp_res == LV_STYLE_STATE_CMP_DIFF_LAYOUT) { + else if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_LAYOUT) { lv_obj_refresh_style(obj, LV_PART_ANY, LV_STYLE_PROP_ANY); } - else if(cmp_res == LV_STYLE_STATE_CMP_DIFF_DRAW_PAD) { + else if(cmp_res == _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD) { lv_obj_invalidate(obj); lv_obj_refresh_ext_draw_size(obj); } @@ -987,61 +974,3 @@ static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_fin } return false; } - -static void null_on_delete_cb(lv_event_t * e) -{ - lv_obj_t ** obj_ptr = lv_event_get_user_data(e); - *obj_ptr = NULL; -} - -#if LV_USE_OBJ_PROPERTY -static lv_result_t lv_obj_set_any(lv_obj_t * obj, lv_prop_id_t id, const lv_property_t * prop) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - if(id >= LV_PROPERTY_OBJ_FLAG_START && id <= LV_PROPERTY_OBJ_FLAG_END) { - lv_obj_flag_t flag = 1L << (id - LV_PROPERTY_OBJ_FLAG_START); - if(prop->num) lv_obj_add_flag(obj, flag); - else lv_obj_remove_flag(obj, flag); - return LV_RESULT_OK; - } - else if(id >= LV_PROPERTY_OBJ_STATE_START && id <= LV_PROPERTY_OBJ_STATE_END) { - lv_state_t state = 1L << (id - LV_PROPERTY_OBJ_STATE_START); - if(id == LV_PROPERTY_OBJ_STATE_ANY) { - state = LV_STATE_ANY; - } - - if(prop->num) lv_obj_add_state(obj, state); - else lv_obj_remove_state(obj, state); - return LV_RESULT_OK; - } - else { - return LV_RESULT_INVALID; - } -} - -static lv_result_t lv_obj_get_any(const lv_obj_t * obj, lv_prop_id_t id, lv_property_t * prop) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - if(id >= LV_PROPERTY_OBJ_FLAG_START && id <= LV_PROPERTY_OBJ_FLAG_END) { - lv_obj_flag_t flag = 1L << (id - LV_PROPERTY_OBJ_FLAG_START); - prop->id = id; - prop->num = obj->flags & flag; - return LV_RESULT_OK; - } - else if(id >= LV_PROPERTY_OBJ_STATE_START && id <= LV_PROPERTY_OBJ_STATE_END) { - prop->id = id; - if(id == LV_PROPERTY_OBJ_STATE_ANY) { - prop->num = obj->state; - } - else { - lv_obj_flag_t flag = 1L << (id - LV_PROPERTY_OBJ_STATE_START); - prop->num = obj->state & flag; - } - return LV_RESULT_OK; - } - else { - return LV_RESULT_INVALID; - } -} -#endif diff --git a/L3_Middlewares/LVGL/src/core/lv_obj.h b/L3_Middlewares/LVGL/src/core/lv_obj.h index 4ae648f..830d122 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj.h +++ b/L3_Middlewares/LVGL/src/core/lv_obj.h @@ -15,21 +15,14 @@ extern "C" { *********************/ #include "../lv_conf_internal.h" -#include "../misc/lv_types.h" +#include +#include #include "../misc/lv_style.h" +#include "../misc/lv_types.h" #include "../misc/lv_area.h" #include "../misc/lv_color.h" #include "../misc/lv_assert.h" - -#include "lv_obj_tree.h" -#include "lv_obj_pos.h" -#include "lv_obj_scroll.h" -#include "lv_obj_style.h" -#include "lv_obj_draw.h" -#include "lv_obj_class.h" -#include "lv_obj_event.h" -#include "lv_obj_property.h" -#include "lv_group.h" +#include "../hal/lv_hal.h" /********************* * DEFINES @@ -39,6 +32,8 @@ extern "C" { * TYPEDEFS **********************/ +struct _lv_obj_t; + /** * Possible states of a widget. * OR-ed values are possible @@ -53,6 +48,7 @@ enum { LV_STATE_PRESSED = 0x0020, LV_STATE_SCROLLED = 0x0040, LV_STATE_DISABLED = 0x0080, + LV_STATE_USER_1 = 0x1000, LV_STATE_USER_2 = 0x2000, LV_STATE_USER_3 = 0x4000, @@ -61,13 +57,14 @@ enum { LV_STATE_ANY = 0xFFFF, /**< Special value can be used in some functions to target all states*/ }; +typedef uint16_t lv_state_t; + /** * The possible parts of widgets. * The parts can be considered as the internal building block of the widgets. * E.g. slider = background + indicator + knob * Not all parts are used by every widget */ - enum { LV_PART_MAIN = 0x000000, /**< A background like rectangle*/ LV_PART_SCROLLBAR = 0x010000, /**< The scrollbar(s)*/ @@ -75,21 +72,21 @@ enum { LV_PART_KNOB = 0x030000, /**< Like handle to grab to adjust the value*/ LV_PART_SELECTED = 0x040000, /**< Indicate the currently selected option or section*/ LV_PART_ITEMS = 0x050000, /**< Used if the widget has multiple similar elements (e.g. table cells)*/ - LV_PART_CURSOR = 0x060000, /**< Mark a specific place e.g. for text area's cursor or on a chart*/ + LV_PART_TICKS = 0x060000, /**< Ticks on scale e.g. for a chart or meter*/ + LV_PART_CURSOR = 0x070000, /**< Mark a specific place e.g. for text area's cursor or on a chart*/ LV_PART_CUSTOM_FIRST = 0x080000, /**< Extension point for custom widgets*/ LV_PART_ANY = 0x0F0000, /**< Special value can be used in some functions to target all parts*/ }; +typedef uint32_t lv_part_t; + /** * On/Off features controlling the object's behavior. * OR-ed values are possible - * - * Note: update obj flags corresponding properties below - * whenever add/remove flags or change bit definition of flags. */ -typedef enum { +enum { LV_OBJ_FLAG_HIDDEN = (1L << 0), /**< Make the object hidden. (Like it wasn't there at all)*/ LV_OBJ_FLAG_CLICKABLE = (1L << 1), /**< Make the object clickable by the input devices*/ LV_OBJ_FLAG_CLICK_FOCUSABLE = (1L << 2), /**< Add focused state to the object when clicked*/ @@ -108,13 +105,9 @@ typedef enum { LV_OBJ_FLAG_EVENT_BUBBLE = (1L << 14), /**< Propagate the events to the parent too*/ LV_OBJ_FLAG_GESTURE_BUBBLE = (1L << 15), /**< Propagate the gestures to the parent*/ LV_OBJ_FLAG_ADV_HITTEST = (1L << 16), /**< Allow performing more accurate hit (click) test. E.g. consider rounded corners.*/ - LV_OBJ_FLAG_IGNORE_LAYOUT = (1L << 17), /**< Make the object not positioned by the layouts*/ + LV_OBJ_FLAG_IGNORE_LAYOUT = (1L << 17), /**< Make the object position-able by the layouts*/ LV_OBJ_FLAG_FLOATING = (1L << 18), /**< Do not scroll the object when the parent scrolls and ignore layout*/ - LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS = (1L << 19), /**< Send `LV_EVENT_DRAW_TASK_ADDED` events*/ - LV_OBJ_FLAG_OVERFLOW_VISIBLE = (1L << 20),/**< Do not clip the children to the parent's ext draw size*/ -#if LV_USE_FLEX - LV_OBJ_FLAG_FLEX_IN_NEW_TRACK = (1L << 21), /**< Start a new flex track on this item*/ -#endif + LV_OBJ_FLAG_OVERFLOW_VISIBLE = (1L << 19), /**< Do not clip the children's content to the parent's boundary*/ LV_OBJ_FLAG_LAYOUT_1 = (1L << 23), /**< Custom flag, free to use by layouts*/ LV_OBJ_FLAG_LAYOUT_2 = (1L << 24), /**< Custom flag, free to use by layouts*/ @@ -125,102 +118,106 @@ typedef enum { LV_OBJ_FLAG_USER_2 = (1L << 28), /**< Custom flag, free to use by user*/ LV_OBJ_FLAG_USER_3 = (1L << 29), /**< Custom flag, free to use by user*/ LV_OBJ_FLAG_USER_4 = (1L << 30), /**< Custom flag, free to use by user*/ -} lv_obj_flag_t; -#if LV_USE_OBJ_PROPERTY -enum { - /*OBJ flag properties */ - LV_PROPERTY_ID(OBJ, FLAG_START, LV_PROPERTY_TYPE_INT, 0), - LV_PROPERTY_ID(OBJ, FLAG_HIDDEN, LV_PROPERTY_TYPE_INT, 0), - LV_PROPERTY_ID(OBJ, FLAG_CLICKABLE, LV_PROPERTY_TYPE_INT, 1), - LV_PROPERTY_ID(OBJ, FLAG_CLICK_FOCUSABLE, LV_PROPERTY_TYPE_INT, 2), - LV_PROPERTY_ID(OBJ, FLAG_CHECKABLE, LV_PROPERTY_TYPE_INT, 3), - LV_PROPERTY_ID(OBJ, FLAG_SCROLLABLE, LV_PROPERTY_TYPE_INT, 4), - LV_PROPERTY_ID(OBJ, FLAG_SCROLL_ELASTIC, LV_PROPERTY_TYPE_INT, 5), - LV_PROPERTY_ID(OBJ, FLAG_SCROLL_MOMENTUM, LV_PROPERTY_TYPE_INT, 6), - LV_PROPERTY_ID(OBJ, FLAG_SCROLL_ONE, LV_PROPERTY_TYPE_INT, 7), - LV_PROPERTY_ID(OBJ, FLAG_SCROLL_CHAIN_HOR, LV_PROPERTY_TYPE_INT, 8), - LV_PROPERTY_ID(OBJ, FLAG_SCROLL_CHAIN_VER, LV_PROPERTY_TYPE_INT, 9), - LV_PROPERTY_ID(OBJ, FLAG_SCROLL_ON_FOCUS, LV_PROPERTY_TYPE_INT, 10), - LV_PROPERTY_ID(OBJ, FLAG_SCROLL_WITH_ARROW, LV_PROPERTY_TYPE_INT, 11), - LV_PROPERTY_ID(OBJ, FLAG_SNAPPABLE, LV_PROPERTY_TYPE_INT, 12), - LV_PROPERTY_ID(OBJ, FLAG_PRESS_LOCK, LV_PROPERTY_TYPE_INT, 13), - LV_PROPERTY_ID(OBJ, FLAG_EVENT_BUBBLE, LV_PROPERTY_TYPE_INT, 14), - LV_PROPERTY_ID(OBJ, FLAG_GESTURE_BUBBLE, LV_PROPERTY_TYPE_INT, 15), - LV_PROPERTY_ID(OBJ, FLAG_ADV_HITTEST, LV_PROPERTY_TYPE_INT, 16), - LV_PROPERTY_ID(OBJ, FLAG_IGNORE_LAYOUT, LV_PROPERTY_TYPE_INT, 17), - LV_PROPERTY_ID(OBJ, FLAG_FLOATING, LV_PROPERTY_TYPE_INT, 18), - LV_PROPERTY_ID(OBJ, FLAG_SEND_DRAW_TASK_EVENTS, LV_PROPERTY_TYPE_INT, 19), - LV_PROPERTY_ID(OBJ, FLAG_OVERFLOW_VISIBLE, LV_PROPERTY_TYPE_INT, 20), - LV_PROPERTY_ID(OBJ, FLAG_FLEX_IN_NEW_TRACK, LV_PROPERTY_TYPE_INT, 21), - LV_PROPERTY_ID(OBJ, FLAG_LAYOUT_1, LV_PROPERTY_TYPE_INT, 23), - LV_PROPERTY_ID(OBJ, FLAG_LAYOUT_2, LV_PROPERTY_TYPE_INT, 24), - LV_PROPERTY_ID(OBJ, FLAG_WIDGET_1, LV_PROPERTY_TYPE_INT, 25), - LV_PROPERTY_ID(OBJ, FLAG_WIDGET_2, LV_PROPERTY_TYPE_INT, 26), - LV_PROPERTY_ID(OBJ, FLAG_USER_1, LV_PROPERTY_TYPE_INT, 27), - LV_PROPERTY_ID(OBJ, FLAG_USER_2, LV_PROPERTY_TYPE_INT, 28), - LV_PROPERTY_ID(OBJ, FLAG_USER_3, LV_PROPERTY_TYPE_INT, 29), - LV_PROPERTY_ID(OBJ, FLAG_USER_4, LV_PROPERTY_TYPE_INT, 30), - LV_PROPERTY_ID(OBJ, FLAG_END, LV_PROPERTY_TYPE_INT, 30), - - LV_PROPERTY_ID(OBJ, STATE_START, LV_PROPERTY_TYPE_INT, 31), - LV_PROPERTY_ID(OBJ, STATE_CHECKED, LV_PROPERTY_TYPE_INT, 31), - LV_PROPERTY_ID(OBJ, STATE_FOCUSED, LV_PROPERTY_TYPE_INT, 32), - LV_PROPERTY_ID(OBJ, STATE_FOCUS_KEY, LV_PROPERTY_TYPE_INT, 33), - LV_PROPERTY_ID(OBJ, STATE_EDITED, LV_PROPERTY_TYPE_INT, 34), - LV_PROPERTY_ID(OBJ, STATE_HOVERED, LV_PROPERTY_TYPE_INT, 35), - LV_PROPERTY_ID(OBJ, STATE_PRESSED, LV_PROPERTY_TYPE_INT, 36), - LV_PROPERTY_ID(OBJ, STATE_SCROLLED, LV_PROPERTY_TYPE_INT, 37), - LV_PROPERTY_ID(OBJ, STATE_DISABLED, LV_PROPERTY_TYPE_INT, 38), - /*not used bit8-bit11*/ - LV_PROPERTY_ID(OBJ, STATE_USER_1, LV_PROPERTY_TYPE_INT, 43), - LV_PROPERTY_ID(OBJ, STATE_USER_2, LV_PROPERTY_TYPE_INT, 44), - LV_PROPERTY_ID(OBJ, STATE_USER_3, LV_PROPERTY_TYPE_INT, 45), - LV_PROPERTY_ID(OBJ, STATE_USER_4, LV_PROPERTY_TYPE_INT, 46), - LV_PROPERTY_ID(OBJ, STATE_ANY, LV_PROPERTY_TYPE_INT, 47), - LV_PROPERTY_ID(OBJ, STATE_END, LV_PROPERTY_TYPE_INT, 47), - - /*OBJ normal properties*/ - LV_PROPERTY_ID(OBJ, PARENT, LV_PROPERTY_TYPE_OBJ, 48), - LV_PROPERTY_ID(OBJ, X, LV_PROPERTY_TYPE_INT, 49), - LV_PROPERTY_ID(OBJ, Y, LV_PROPERTY_TYPE_INT, 50), - LV_PROPERTY_ID(OBJ, W, LV_PROPERTY_TYPE_INT, 51), - LV_PROPERTY_ID(OBJ, H, LV_PROPERTY_TYPE_INT, 52), - LV_PROPERTY_ID(OBJ, CONTENT_WIDTH, LV_PROPERTY_TYPE_INT, 53), - LV_PROPERTY_ID(OBJ, CONTENT_HEIGHT, LV_PROPERTY_TYPE_INT, 54), - LV_PROPERTY_ID(OBJ, LAYOUT, LV_PROPERTY_TYPE_INT, 55), - LV_PROPERTY_ID(OBJ, ALIGN, LV_PROPERTY_TYPE_INT, 56), - LV_PROPERTY_ID(OBJ, SCROLLBAR_MODE, LV_PROPERTY_TYPE_INT, 57), - LV_PROPERTY_ID(OBJ, SCROLL_DIR, LV_PROPERTY_TYPE_INT, 58), - LV_PROPERTY_ID(OBJ, SCROLL_SNAP_X, LV_PROPERTY_TYPE_INT, 59), - LV_PROPERTY_ID(OBJ, SCROLL_SNAP_Y, LV_PROPERTY_TYPE_INT, 60), - LV_PROPERTY_ID(OBJ, SCROLL_X, LV_PROPERTY_TYPE_INT, 61), - LV_PROPERTY_ID(OBJ, SCROLL_Y, LV_PROPERTY_TYPE_INT, 62), - LV_PROPERTY_ID(OBJ, SCROLL_TOP, LV_PROPERTY_TYPE_INT, 63), - LV_PROPERTY_ID(OBJ, SCROLL_BOTTOM, LV_PROPERTY_TYPE_INT, 64), - LV_PROPERTY_ID(OBJ, SCROLL_LEFT, LV_PROPERTY_TYPE_INT, 65), - LV_PROPERTY_ID(OBJ, SCROLL_RIGHT, LV_PROPERTY_TYPE_INT, 66), - LV_PROPERTY_ID(OBJ, SCROLL_END, LV_PROPERTY_TYPE_INT, 67), - LV_PROPERTY_ID(OBJ, EXT_DRAW_SIZE, LV_PROPERTY_TYPE_INT, 68), - LV_PROPERTY_ID(OBJ, EVENT_COUNT, LV_PROPERTY_TYPE_INT, 69), - LV_PROPERTY_ID(OBJ, SCREEN, LV_PROPERTY_TYPE_OBJ, 70), - LV_PROPERTY_ID(OBJ, DISPLAY, LV_PROPERTY_TYPE_POINTER, 71), - LV_PROPERTY_ID(OBJ, CHILD_COUNT, LV_PROPERTY_TYPE_INT, 72), - LV_PROPERTY_ID(OBJ, INDEX, LV_PROPERTY_TYPE_INT, 73), - - LV_PROPERTY_OBJ_END, }; -#endif + + +typedef uint32_t lv_obj_flag_t; + +/** + * `type` field in `lv_obj_draw_part_dsc_t` if `class_p = lv_obj_class` + * Used in `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` + */ +typedef enum { + LV_OBJ_DRAW_PART_RECTANGLE, /**< The main rectangle*/ + LV_OBJ_DRAW_PART_BORDER_POST,/**< The border if style_border_post = true*/ + LV_OBJ_DRAW_PART_SCROLLBAR, /**< The scrollbar*/ +} lv_obj_draw_part_type_t; + +#include "lv_obj_tree.h" +#include "lv_obj_pos.h" +#include "lv_obj_scroll.h" +#include "lv_obj_style.h" +#include "lv_obj_draw.h" +#include "lv_obj_class.h" +#include "lv_event.h" +#include "lv_group.h" /** * Make the base object's class publicly available. */ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_obj_class; +extern const lv_obj_class_t lv_obj_class; + +/** + * Special, rarely used attributes. + * They are allocated automatically if any elements is set. + */ +typedef struct { + struct _lv_obj_t ** children; /**< Store the pointer of the children in an array.*/ + uint32_t child_cnt; /**< Number of children*/ + lv_group_t * group_p; + + struct _lv_event_dsc_t * event_dsc; /**< Dynamically allocated event callback and user data array*/ + lv_point_t scroll; /**< The current X/Y scroll offset*/ + + lv_coord_t ext_click_pad; /**< Extra click padding in all direction*/ + lv_coord_t ext_draw_size; /**< EXTend the size in every direction for drawing.*/ + + lv_scrollbar_mode_t scrollbar_mode : 2; /**< How to display scrollbars*/ + lv_scroll_snap_t scroll_snap_x : 2; /**< Where to align the snappable children horizontally*/ + lv_scroll_snap_t scroll_snap_y : 2; /**< Where to align the snappable children vertically*/ + lv_dir_t scroll_dir : 4; /**< The allowed scroll direction(s)*/ + uint8_t event_dsc_cnt : 6; /**< Number of event callbacks stored in `event_dsc` array*/ + uint8_t layer_type : 2; /**< Cache the layer type here. Element of @lv_intermediate_layer_type_t */ +} _lv_obj_spec_attr_t; + +typedef struct _lv_obj_t { + const lv_obj_class_t * class_p; + struct _lv_obj_t * parent; + _lv_obj_spec_attr_t * spec_attr; + _lv_obj_style_t * styles; +#if LV_USE_USER_DATA + void * user_data; +#endif + lv_area_t coords; + lv_obj_flag_t flags; + lv_state_t state; + uint16_t layout_inv : 1; + uint16_t readjust_scroll_after_layout : 1; + uint16_t scr_layout_inv : 1; + uint16_t skip_trans : 1; + uint16_t style_cnt : 6; + uint16_t h_layout : 1; + uint16_t w_layout : 1; + uint16_t being_deleted : 1; +} lv_obj_t; + /********************** * GLOBAL PROTOTYPES **********************/ +/** + * Initialize LVGL library. + * Should be called before any other LVGL related function. + */ +void lv_init(void); + +#if LV_ENABLE_GC || !LV_MEM_CUSTOM + +/** + * Deinit the 'lv' library + * Currently only implemented when not using custom allocators, or GC is enabled. + */ +void lv_deinit(void); + +#endif + +/** + * Returns whether the 'lv' library is currently initialized + */ +bool lv_is_initialized(void); + /** * Create a base object (a rectangle) * @param parent pointer to a parent object. If NULL then a screen will be created. @@ -228,6 +225,7 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_obj_class; */ lv_obj_t * lv_obj_create(lv_obj_t * parent); + /*===================== * Setter functions *====================*/ @@ -235,24 +233,17 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent); /** * Set one or more flags * @param obj pointer to an object - * @param f OR-ed values from `lv_obj_flag_t` to set. + * @param f R-ed values from `lv_obj_flag_t` to set. */ void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f); /** - * Remove one or more flags + * Clear one or more flags * @param obj pointer to an object - * @param f OR-ed values from `lv_obj_flag_t` to clear. + * @param f OR-ed values from `lv_obj_flag_t` to set. */ -void lv_obj_remove_flag(lv_obj_t * obj, lv_obj_flag_t f); +void lv_obj_clear_flag(lv_obj_t * obj, lv_obj_flag_t f); -/** - * Set add or remove one or more flags. - * @param obj pointer to an object - * @param f OR-ed values from `lv_obj_flag_t` to update. - * @param v true: add the flags; false: remove the flags - */ -void lv_obj_update_flag(lv_obj_t * obj, lv_obj_flag_t f, bool v); /** * Add one or more states to the object. The other state bits will remain unchanged. @@ -268,22 +259,19 @@ void lv_obj_add_state(lv_obj_t * obj, lv_state_t state); * @param obj pointer to an object * @param state the states to add. E.g `LV_STATE_PRESSED | LV_STATE_FOCUSED` */ -void lv_obj_remove_state(lv_obj_t * obj, lv_state_t state); - -/** - * Add or remove one or more states to the object. The other state bits will remain unchanged. - * @param obj pointer to an object - * @param state the states to add. E.g `LV_STATE_PRESSED | LV_STATE_FOCUSED` - * @param v true: add the states; false: remove the states - */ -void lv_obj_set_state(lv_obj_t * obj, lv_state_t state, bool v); +void lv_obj_clear_state(lv_obj_t * obj, lv_state_t state); /** * Set the user_data field of the object * @param obj pointer to an object * @param user_data pointer to the new user_data. */ -void lv_obj_set_user_data(lv_obj_t * obj, void * user_data); +#if LV_USE_USER_DATA +static inline void lv_obj_set_user_data(lv_obj_t * obj, void * user_data) +{ + obj->user_data = user_data; +} +#endif /*======================= * Getter functions @@ -301,7 +289,7 @@ bool lv_obj_has_flag(const lv_obj_t * obj, lv_obj_flag_t f); * Check if a given flag or any of the flags are set on an object. * @param obj pointer to an object * @param f the flag(s) to check (OR-ed values can be used) - * @return true: at least one flag is set; false: none of the flags are set + * @return true: at lest one flag flag is set; false: none of the flags are set */ bool lv_obj_has_flag_any(const lv_obj_t * obj, lv_obj_flag_t f); @@ -325,14 +313,19 @@ bool lv_obj_has_state(const lv_obj_t * obj, lv_state_t state); * @param obj pointer to an object * @return the pointer to group of the object */ -lv_group_t * lv_obj_get_group(const lv_obj_t * obj); +void * lv_obj_get_group(const lv_obj_t * obj); /** * Get the user_data field of the object * @param obj pointer to an object * @return the pointer to the user_data of the object */ -void * lv_obj_get_user_data(lv_obj_t * obj); +#if LV_USE_USER_DATA +static inline void * lv_obj_get_user_data(lv_obj_t * obj) +{ + return obj->user_data; +} +#endif /*======================= * Other functions @@ -376,87 +369,18 @@ const lv_obj_class_t * lv_obj_get_class(const lv_obj_t * obj); bool lv_obj_is_valid(const lv_obj_t * obj); /** - * Utility to set an object reference to NULL when it gets deleted. - * The reference should be in a location that will not become invalid - * during the object's lifetime, i.e. static or allocated. - * @param obj_ptr a pointer to a pointer to an object + * Scale the given number of pixels (a distance or size) relative to a 160 DPI display + * considering the DPI of the `obj`'s display. + * It ensures that e.g. `lv_dpx(100)` will have the same physical size regardless to the + * DPI of the display. + * @param obj an object whose display's dpi should be considered + * @param n the number of pixels to scale + * @return `n x current_dpi/160` */ -void lv_obj_null_on_delete(lv_obj_t ** obj_ptr); - -#if LV_USE_OBJ_ID -/** - * Set an id for an object. - * @param obj pointer to an object - * @param id the id of the object - */ -void lv_obj_set_id(lv_obj_t * obj, void * id); - -/** - * Get the id of an object. - * @param obj pointer to an object - * @return the id of the object - */ -void * lv_obj_get_id(const lv_obj_t * obj); - -/** - * Get the child object by its id. - * It will check children and grandchildren recursively. - * Function `lv_obj_id_compare` is used to matched obj id with given id. - * - * @param obj pointer to an object - * @param id the id of the child object - * @return pointer to the child object or NULL if not found - */ -lv_obj_t * lv_obj_get_child_by_id(const lv_obj_t * obj, const void * id); - -/** - * Assign id to object if not previously assigned. - * This function gets called automatically when LV_OBJ_ID_AUTO_ASSIGN is enabled. - * - * Set `LV_USE_OBJ_ID_BUILTIN` to use the builtin method to generate object ID. - * Otherwise, these functions including `lv_obj_[set|assign|free|stringify]_id` and - * `lv_obj_id_compare`should be implemented externally. - * - * @param class_p the class this obj belongs to. Note obj->class_p is the class currently being constructed. - * @param obj pointer to an object - */ -void lv_obj_assign_id(const lv_obj_class_t * class_p, lv_obj_t * obj); - -/** - * Free resources allocated by `lv_obj_assign_id` or `lv_obj_set_id`. - * This function is also called automatically when object is deleted. - * @param obj pointer to an object - */ -void lv_obj_free_id(lv_obj_t * obj); - -/** - * Compare two obj id, return 0 if they are equal. - * - * Set `LV_USE_OBJ_ID_BUILTIN` to use the builtin method for compare. - * Otherwise, it must be implemented externally. - * - * @param id1: the first id - * @param id2: the second id - * @return 0 if they are equal, non-zero otherwise. - */ -int lv_obj_id_compare(const void * id1, const void * id2); - -/** - * Format an object's id into a string. - * @param obj pointer to an object - * @param buf buffer to write the string into - * @param len length of the buffer - */ -const char * lv_obj_stringify_id(lv_obj_t * obj, char * buf, uint32_t len); - -#if LV_USE_OBJ_ID_BUILTIN -/** - * Free resources used by builtin ID generator. - */ -void lv_objid_builtin_destroy(void); -#endif - -#endif /*LV_USE_OBJ_ID*/ +static inline lv_coord_t lv_obj_dpx(const lv_obj_t * obj, lv_coord_t n) +{ + return _LV_DPX_CALC(lv_disp_get_dpi(lv_obj_get_disp(obj)), n); +} /********************** * MACROS @@ -479,6 +403,7 @@ void lv_objid_builtin_destroy(void); # define LV_TRACE_OBJ_CREATE(...) #endif + #ifdef __cplusplus } /*extern "C"*/ #endif diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_class.c b/L3_Middlewares/LVGL/src/core/lv_obj_class.c index cb5a396..fe20448 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_class.c +++ b/L3_Middlewares/LVGL/src/core/lv_obj_class.c @@ -6,17 +6,13 @@ /********************* * INCLUDES *********************/ -#include "lv_obj_class_private.h" -#include "lv_obj_private.h" -#include "../themes/lv_theme.h" -#include "../display/lv_display.h" -#include "../display/lv_display_private.h" -#include "../stdlib/lv_string.h" +#include "lv_obj.h" +#include "lv_theme.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_obj_class) +#define MY_CLASS &lv_obj_class /********************** * TYPEDEFS @@ -29,7 +25,7 @@ /********************** * STATIC PROTOTYPES **********************/ -static void lv_obj_construct(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_obj_construct(lv_obj_t * obj); static uint32_t get_instance_size(const lv_obj_class_t * class_p); /********************** @@ -48,41 +44,38 @@ lv_obj_t * lv_obj_class_create_obj(const lv_obj_class_t * class_p, lv_obj_t * pa { LV_TRACE_OBJ_CREATE("Creating object with %p class on %p parent", (void *)class_p, (void *)parent); uint32_t s = get_instance_size(class_p); - lv_obj_t * obj = lv_malloc_zeroed(s); + lv_obj_t * obj = lv_mem_alloc(s); if(obj == NULL) return NULL; + lv_memset_00(obj, s); obj->class_p = class_p; obj->parent = parent; /*Create a screen*/ if(parent == NULL) { LV_TRACE_OBJ_CREATE("creating a screen"); - lv_display_t * disp = lv_display_get_default(); + lv_disp_t * disp = lv_disp_get_default(); if(!disp) { LV_LOG_WARN("No display created yet. No place to assign the new screen"); - lv_free(obj); + lv_mem_free(obj); return NULL; } if(disp->screens == NULL) { - disp->screen_cnt = 0; + disp->screens = lv_mem_alloc(sizeof(lv_obj_t *)); + disp->screens[0] = obj; + disp->screen_cnt = 1; } - - lv_obj_t ** screens = lv_realloc(disp->screens, sizeof(lv_obj_t *) * (disp->screen_cnt + 1)); - LV_ASSERT_MALLOC(screens); - if(screens == NULL) { - lv_free(obj); - return NULL; + else { + disp->screen_cnt++; + disp->screens = lv_mem_realloc(disp->screens, sizeof(lv_obj_t *) * disp->screen_cnt); + disp->screens[disp->screen_cnt - 1] = obj; } - disp->screen_cnt++; - disp->screens = screens; - disp->screens[disp->screen_cnt - 1] = obj; - /*Set coordinates to full screen size*/ obj->coords.x1 = 0; obj->coords.y1 = 0; - obj->coords.x2 = lv_display_get_horizontal_resolution(NULL) - 1; - obj->coords.y2 = lv_display_get_vertical_resolution(NULL) - 1; + obj->coords.x2 = lv_disp_get_hor_res(NULL) - 1; + obj->coords.y2 = lv_disp_get_ver_res(NULL) - 1; } /*Create a normal object*/ else { @@ -92,10 +85,17 @@ lv_obj_t * lv_obj_class_create_obj(const lv_obj_class_t * class_p, lv_obj_t * pa lv_obj_allocate_spec_attr(parent); } - parent->spec_attr->child_cnt++; - parent->spec_attr->children = lv_realloc(parent->spec_attr->children, - sizeof(lv_obj_t *) * parent->spec_attr->child_cnt); - parent->spec_attr->children[parent->spec_attr->child_cnt - 1] = obj; + if(parent->spec_attr->children == NULL) { + parent->spec_attr->children = lv_mem_alloc(sizeof(lv_obj_t *)); + parent->spec_attr->children[0] = obj; + parent->spec_attr->child_cnt = 1; + } + else { + parent->spec_attr->child_cnt++; + parent->spec_attr->children = lv_mem_realloc(parent->spec_attr->children, + sizeof(lv_obj_t *) * parent->spec_attr->child_cnt); + parent->spec_attr->children[parent->spec_attr->child_cnt - 1] = obj; + } } return obj; @@ -103,13 +103,11 @@ lv_obj_t * lv_obj_class_create_obj(const lv_obj_class_t * class_p, lv_obj_t * pa void lv_obj_class_init_obj(lv_obj_t * obj) { - if(obj == NULL) return; - lv_obj_mark_layout_as_dirty(obj); lv_obj_enable_style_refresh(false); lv_theme_apply(obj); - lv_obj_construct(obj->class_p, obj); + lv_obj_construct(obj); lv_obj_enable_style_refresh(true); lv_obj_refresh_style(obj, LV_PART_ANY, LV_STYLE_PROP_ANY); @@ -125,15 +123,15 @@ void lv_obj_class_init_obj(lv_obj_t * obj) if(parent) { /*Call the ancestor's event handler to the parent to notify it about the new child. *Also triggers layout update*/ - lv_obj_send_event(parent, LV_EVENT_CHILD_CHANGED, obj); - lv_obj_send_event(parent, LV_EVENT_CHILD_CREATED, obj); + lv_event_send(parent, LV_EVENT_CHILD_CHANGED, obj); + lv_event_send(parent, LV_EVENT_CHILD_CREATED, obj); /*Invalidate the area if not screen created*/ lv_obj_invalidate(obj); } } -void lv_obj_destruct(lv_obj_t * obj) +void _lv_obj_destruct(lv_obj_t * obj) { if(obj->class_p->destructor_cb) obj->class_p->destructor_cb(obj->class_p, obj); @@ -142,7 +140,7 @@ void lv_obj_destruct(lv_obj_t * obj) obj->class_p = obj->class_p->base_class; /*Call the base class's destructor too*/ - lv_obj_destruct(obj); + _lv_obj_destruct(obj); } } @@ -155,7 +153,7 @@ bool lv_obj_is_editable(lv_obj_t * obj) if(class_p == NULL) return false; - return class_p->editable == LV_OBJ_CLASS_EDITABLE_TRUE; + return class_p->editable == LV_OBJ_CLASS_EDITABLE_TRUE ? true : false; } bool lv_obj_is_group_def(lv_obj_t * obj) @@ -167,29 +165,29 @@ bool lv_obj_is_group_def(lv_obj_t * obj) if(class_p == NULL) return false; - return class_p->group_def == LV_OBJ_CLASS_GROUP_DEF_TRUE; + return class_p->group_def == LV_OBJ_CLASS_GROUP_DEF_TRUE ? true : false; } /********************** * STATIC FUNCTIONS **********************/ -static void lv_obj_construct(const lv_obj_class_t * class_p, lv_obj_t * obj) +static void lv_obj_construct(lv_obj_t * obj) { - if(obj->class_p->base_class) { - const lv_obj_class_t * original_class_p = obj->class_p; + const lv_obj_class_t * original_class_p = obj->class_p; + if(obj->class_p->base_class) { /*Don't let the descendant methods run during constructing the ancestor type*/ obj->class_p = obj->class_p->base_class; /*Construct the base first*/ - lv_obj_construct(class_p, obj); - - /*Restore the original class*/ - obj->class_p = original_class_p; + lv_obj_construct(obj); } - if(obj->class_p->constructor_cb) obj->class_p->constructor_cb(class_p, obj); + /*Restore the original class*/ + obj->class_p = original_class_p; + + if(obj->class_p->constructor_cb) obj->class_p->constructor_cb(obj->class_p, obj); } static uint32_t get_instance_size(const lv_obj_class_t * class_p) diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_class.h b/L3_Middlewares/LVGL/src/core/lv_obj_class.h index 4c3bdcb..01a7248 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_class.h +++ b/L3_Middlewares/LVGL/src/core/lv_obj_class.h @@ -13,18 +13,22 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../misc/lv_types.h" -#include "../misc/lv_area.h" -#include "lv_obj_property.h" +#include +#include /********************* * DEFINES *********************/ + /********************** * TYPEDEFS **********************/ +struct _lv_obj_t; +struct _lv_obj_class_t; +struct _lv_event_t; + typedef enum { LV_OBJ_CLASS_EDITABLE_INHERIT, /**< Check the base class. Must have 0 value to let zero initialized class inherit*/ LV_OBJ_CLASS_EDITABLE_TRUE, @@ -37,12 +41,27 @@ typedef enum { LV_OBJ_CLASS_GROUP_DEF_FALSE, } lv_obj_class_group_def_t; -typedef enum { - LV_OBJ_CLASS_THEME_INHERITABLE_FALSE, /**< Do not inherit theme from base class. */ - LV_OBJ_CLASS_THEME_INHERITABLE_TRUE, -} lv_obj_class_theme_inheritable_t; +typedef void (*lv_obj_class_event_cb_t)(struct _lv_obj_class_t * class_p, struct _lv_event_t * e); +/** + * Describe the common methods of every object. + * Similar to a C++ class. + */ +typedef struct _lv_obj_class_t { + const struct _lv_obj_class_t * base_class; + void (*constructor_cb)(const struct _lv_obj_class_t * class_p, struct _lv_obj_t * obj); + void (*destructor_cb)(const struct _lv_obj_class_t * class_p, struct _lv_obj_t * obj); +#if LV_USE_USER_DATA + void * user_data; +#endif + void (*event_cb)(const struct _lv_obj_class_t * class_p, + struct _lv_event_t * e); /**< Widget type specific event function*/ + lv_coord_t width_def; + lv_coord_t height_def; + uint32_t editable : 2; /**< Value from ::lv_obj_class_editable_t*/ + uint32_t group_def : 2; /**< Value from ::lv_obj_class_group_def_t*/ + uint32_t instance_size : 16; +} lv_obj_class_t; -typedef void (*lv_obj_class_event_cb_t)(lv_obj_class_t * class_p, lv_event_t * e); /********************** * GLOBAL PROTOTYPES **********************/ @@ -53,18 +72,21 @@ typedef void (*lv_obj_class_event_cb_t)(lv_obj_class_t * class_p, lv_event_t * e * @param parent pointer to an object where the new object should be created * @return pointer to the created object */ -lv_obj_t * lv_obj_class_create_obj(const lv_obj_class_t * class_p, lv_obj_t * parent); +struct _lv_obj_t * lv_obj_class_create_obj(const struct _lv_obj_class_t * class_p, struct _lv_obj_t * parent); -void lv_obj_class_init_obj(lv_obj_t * obj); +void lv_obj_class_init_obj(struct _lv_obj_t * obj); -bool lv_obj_is_editable(lv_obj_t * obj); +void _lv_obj_destruct(struct _lv_obj_t * obj); -bool lv_obj_is_group_def(lv_obj_t * obj); +bool lv_obj_is_editable(struct _lv_obj_t * obj); + +bool lv_obj_is_group_def(struct _lv_obj_t * obj); /********************** * MACROS **********************/ + #ifdef __cplusplus } /*extern "C"*/ #endif diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_class_private.h b/L3_Middlewares/LVGL/src/core/lv_obj_class_private.h deleted file mode 100644 index 1279b9c..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_obj_class_private.h +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @file lv_obj_class_private.h - * - */ - -#ifndef LV_OBJ_CLASS_PRIVATE_H -#define LV_OBJ_CLASS_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_obj_class.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * Describe the common methods of every object. - * Similar to a C++ class. - */ -struct lv_obj_class_t { - const lv_obj_class_t * base_class; - /** class_p is the final class while obj->class_p is the class currently being [de]constructed. */ - void (*constructor_cb)(const lv_obj_class_t * class_p, lv_obj_t * obj); - void (*destructor_cb)(const lv_obj_class_t * class_p, lv_obj_t * obj); - - /** class_p is the class in which event is being processed. */ - void (*event_cb)(const lv_obj_class_t * class_p, lv_event_t * e); /**< Widget type specific event function*/ - -#if LV_USE_OBJ_PROPERTY - uint32_t prop_index_start; - uint32_t prop_index_end; - const lv_property_ops_t * properties; - uint32_t properties_count; - -#if LV_USE_OBJ_PROPERTY_NAME - /* An array of property ID and name */ - const lv_property_name_t * property_names; - uint32_t names_count; -#endif -#endif - - void * user_data; - const char * name; - int32_t width_def; - int32_t height_def; - uint32_t editable : 2; /**< Value from ::lv_obj_class_editable_t*/ - uint32_t group_def : 2; /**< Value from ::lv_obj_class_group_def_t*/ - uint32_t instance_size : 16; - uint32_t theme_inheritable : 1; /**< Value from ::lv_obj_class_theme_inheritable_t*/ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_obj_destruct(lv_obj_t * obj); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OBJ_CLASS_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_draw.c b/L3_Middlewares/LVGL/src/core/lv_obj_draw.c index b3694b9..d906126 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_draw.c +++ b/L3_Middlewares/LVGL/src/core/lv_obj_draw.c @@ -6,18 +6,15 @@ /********************* * INCLUDES *********************/ -#include "lv_obj_draw_private.h" -#include "lv_obj_private.h" -#include "lv_obj_style.h" -#include "../display/lv_display.h" -#include "../indev/lv_indev.h" -#include "../stdlib/lv_string.h" -#include "../draw/lv_draw_arc.h" +#include "lv_obj_draw.h" +#include "lv_obj.h" +#include "lv_disp.h" +#include "lv_indev.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_obj_class) +#define MY_CLASS &lv_obj_class /********************** * TYPEDEFS @@ -39,16 +36,13 @@ * GLOBAL FUNCTIONS **********************/ -void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_t * draw_dsc) +void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t * draw_dsc) { - draw_dsc->base.obj = obj; - draw_dsc->base.part = part; - lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part); if(part != LV_PART_MAIN) { if(opa <= LV_OPA_MIN) { draw_dsc->bg_opa = LV_OPA_TRANSP; - draw_dsc->bg_image_opa = LV_OPA_TRANSP; + draw_dsc->bg_img_opa = LV_OPA_TRANSP; draw_dsc->border_opa = LV_OPA_TRANSP; draw_dsc->outline_opa = LV_OPA_TRANSP; draw_dsc->shadow_opa = LV_OPA_TRANSP; @@ -56,6 +50,9 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_ } } +#if LV_DRAW_COMPLEX + if(part != LV_PART_MAIN) draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part); + draw_dsc->radius = lv_obj_get_style_radius(obj, part); if(draw_dsc->bg_opa != LV_OPA_TRANSP) { @@ -73,16 +70,15 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_ draw_dsc->bg_grad.stops[1].color = lv_obj_get_style_bg_grad_color_filtered(obj, part); draw_dsc->bg_grad.stops[0].frac = lv_obj_get_style_bg_main_stop(obj, part); draw_dsc->bg_grad.stops[1].frac = lv_obj_get_style_bg_grad_stop(obj, part); - draw_dsc->bg_grad.stops[0].opa = lv_obj_get_style_bg_main_opa(obj, part); - draw_dsc->bg_grad.stops[1].opa = lv_obj_get_style_bg_grad_opa(obj, part); } + draw_dsc->bg_grad.dither = lv_obj_get_style_bg_dither_mode(obj, part); } } } - if(draw_dsc->border_opa != LV_OPA_TRANSP) { - draw_dsc->border_width = lv_obj_get_style_border_width(obj, part); - if(draw_dsc->border_width) { + draw_dsc->border_width = lv_obj_get_style_border_width(obj, part); + if(draw_dsc->border_width) { + if(draw_dsc->border_opa != LV_OPA_TRANSP) { draw_dsc->border_opa = lv_obj_get_style_border_opa(obj, part); if(draw_dsc->border_opa > LV_OPA_MIN) { draw_dsc->border_side = lv_obj_get_style_border_side(obj, part); @@ -91,9 +87,9 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_ } } - if(draw_dsc->outline_opa != LV_OPA_TRANSP) { - draw_dsc->outline_width = lv_obj_get_style_outline_width(obj, part); - if(draw_dsc->outline_width) { + draw_dsc->outline_width = lv_obj_get_style_outline_width(obj, part); + if(draw_dsc->outline_width) { + if(draw_dsc->outline_opa != LV_OPA_TRANSP) { draw_dsc->outline_opa = lv_obj_get_style_outline_opa(obj, part); if(draw_dsc->outline_opa > LV_OPA_MIN) { draw_dsc->outline_pad = lv_obj_get_style_outline_pad(obj, part); @@ -102,19 +98,19 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_ } } - if(draw_dsc->bg_image_opa != LV_OPA_TRANSP) { - draw_dsc->bg_image_src = lv_obj_get_style_bg_image_src(obj, part); - if(draw_dsc->bg_image_src) { - draw_dsc->bg_image_opa = lv_obj_get_style_bg_image_opa(obj, part); - if(draw_dsc->bg_image_opa > LV_OPA_MIN) { - if(lv_image_src_get_type(draw_dsc->bg_image_src) == LV_IMAGE_SRC_SYMBOL) { - draw_dsc->bg_image_symbol_font = lv_obj_get_style_text_font(obj, part); - draw_dsc->bg_image_recolor = lv_obj_get_style_text_color_filtered(obj, part); + if(draw_dsc->bg_img_opa != LV_OPA_TRANSP) { + draw_dsc->bg_img_src = lv_obj_get_style_bg_img_src(obj, part); + if(draw_dsc->bg_img_src) { + draw_dsc->bg_img_opa = lv_obj_get_style_bg_img_opa(obj, part); + if(draw_dsc->bg_img_opa > LV_OPA_MIN) { + if(lv_img_src_get_type(draw_dsc->bg_img_src) == LV_IMG_SRC_SYMBOL) { + draw_dsc->bg_img_symbol_font = lv_obj_get_style_text_font(obj, part); + draw_dsc->bg_img_recolor = lv_obj_get_style_text_color_filtered(obj, part); } else { - draw_dsc->bg_image_recolor = lv_obj_get_style_bg_image_recolor_filtered(obj, part); - draw_dsc->bg_image_recolor_opa = lv_obj_get_style_bg_image_recolor_opa(obj, part); - draw_dsc->bg_image_tiled = lv_obj_get_style_bg_image_tiled(obj, part); + draw_dsc->bg_img_recolor = lv_obj_get_style_bg_img_recolor_filtered(obj, part); + draw_dsc->bg_img_recolor_opa = lv_obj_get_style_bg_img_recolor_opa(obj, part); + draw_dsc->bg_img_tiled = lv_obj_get_style_bg_img_tiled(obj, part); } } } @@ -126,8 +122,8 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_ if(draw_dsc->shadow_opa > LV_OPA_MIN) { draw_dsc->shadow_opa = lv_obj_get_style_shadow_opa(obj, part); if(draw_dsc->shadow_opa > LV_OPA_MIN) { - draw_dsc->shadow_offset_x = lv_obj_get_style_shadow_offset_x(obj, part); - draw_dsc->shadow_offset_y = lv_obj_get_style_shadow_offset_y(obj, part); + draw_dsc->shadow_ofs_x = lv_obj_get_style_shadow_ofs_x(obj, part); + draw_dsc->shadow_ofs_y = lv_obj_get_style_shadow_ofs_y(obj, part); draw_dsc->shadow_spread = lv_obj_get_style_shadow_spread(obj, part); draw_dsc->shadow_color = lv_obj_get_style_shadow_color_filtered(obj, part); } @@ -135,26 +131,75 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_ } } +#else /*LV_DRAW_COMPLEX*/ + if(draw_dsc->bg_opa != LV_OPA_TRANSP) { + draw_dsc->bg_opa = lv_obj_get_style_bg_opa(obj, part); + if(draw_dsc->bg_opa > LV_OPA_MIN) { + draw_dsc->bg_color = lv_obj_get_style_bg_color_filtered(obj, part); + } + } + + draw_dsc->border_width = lv_obj_get_style_border_width(obj, part); + if(draw_dsc->border_width) { + if(draw_dsc->border_opa != LV_OPA_TRANSP) { + draw_dsc->border_opa = lv_obj_get_style_border_opa(obj, part); + if(draw_dsc->border_opa > LV_OPA_MIN) { + draw_dsc->border_color = lv_obj_get_style_border_color_filtered(obj, part); + draw_dsc->border_side = lv_obj_get_style_border_side(obj, part); + } + } + } + + draw_dsc->outline_width = lv_obj_get_style_outline_width(obj, part); + if(draw_dsc->outline_width) { + if(draw_dsc->outline_opa != LV_OPA_TRANSP) { + draw_dsc->outline_opa = lv_obj_get_style_outline_opa(obj, part); + if(draw_dsc->outline_opa > LV_OPA_MIN) { + draw_dsc->outline_pad = lv_obj_get_style_outline_pad(obj, part); + draw_dsc->outline_color = lv_obj_get_style_outline_color_filtered(obj, part); + } + } + } + + if(draw_dsc->bg_img_opa != LV_OPA_TRANSP) { + draw_dsc->bg_img_src = lv_obj_get_style_bg_img_src(obj, part); + if(draw_dsc->bg_img_src) { + draw_dsc->bg_img_opa = lv_obj_get_style_bg_img_opa(obj, part); + if(draw_dsc->bg_img_opa > LV_OPA_MIN) { + if(lv_img_src_get_type(draw_dsc->bg_img_src) == LV_IMG_SRC_SYMBOL) { + draw_dsc->bg_img_symbol_font = lv_obj_get_style_text_font(obj, part); + draw_dsc->bg_img_recolor = lv_obj_get_style_text_color_filtered(obj, part); + } + else { + draw_dsc->bg_img_recolor = lv_obj_get_style_bg_img_recolor_filtered(obj, part); + draw_dsc->bg_img_recolor_opa = lv_obj_get_style_bg_img_recolor_opa(obj, part); + draw_dsc->bg_img_tiled = lv_obj_get_style_bg_img_tiled(obj, part); + } + } + } + } +#endif if(opa < LV_OPA_MAX) { - draw_dsc->bg_opa = LV_OPA_MIX2(draw_dsc->bg_opa, opa); - draw_dsc->bg_image_opa = LV_OPA_MIX2(draw_dsc->bg_image_opa, opa); - draw_dsc->border_opa = LV_OPA_MIX2(draw_dsc->border_opa, opa); - draw_dsc->shadow_opa = LV_OPA_MIX2(draw_dsc->shadow_opa, opa); - draw_dsc->outline_opa = LV_OPA_MIX2(draw_dsc->outline_opa, opa); + draw_dsc->bg_opa = (opa * draw_dsc->bg_opa) >> 8; + draw_dsc->bg_img_opa = (opa * draw_dsc->bg_img_opa) >> 8; + draw_dsc->border_opa = (opa * draw_dsc->border_opa) >> 8; + draw_dsc->outline_opa = (opa * draw_dsc->outline_opa) >> 8; + draw_dsc->shadow_opa = (opa * draw_dsc->shadow_opa) >> 8; } } -void lv_obj_init_draw_label_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_label_dsc_t * draw_dsc) +void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint32_t part, lv_draw_label_dsc_t * draw_dsc) { - draw_dsc->base.obj = obj; - draw_dsc->base.part = part; - draw_dsc->opa = lv_obj_get_style_text_opa(obj, part); if(draw_dsc->opa <= LV_OPA_MIN) return; lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part); + if(opa <= LV_OPA_MIN) { + draw_dsc->opa = LV_OPA_TRANSP; + return; + } if(opa < LV_OPA_MAX) { - draw_dsc->opa = LV_OPA_MIX2(draw_dsc->opa, opa); + draw_dsc->opa = (opa * draw_dsc->opa) >> 8; } if(draw_dsc->opa <= LV_OPA_MIN) return; @@ -162,7 +207,9 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_label_ds draw_dsc->letter_space = lv_obj_get_style_text_letter_space(obj, part); draw_dsc->line_space = lv_obj_get_style_text_line_space(obj, part); draw_dsc->decor = lv_obj_get_style_text_decor(obj, part); +#if LV_DRAW_COMPLEX if(part != LV_PART_MAIN) draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part); +#endif draw_dsc->font = lv_obj_get_style_text_font(obj, part); @@ -173,43 +220,47 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_label_ds draw_dsc->align = lv_obj_get_style_text_align(obj, part); } -void lv_obj_init_draw_image_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_image_dsc_t * draw_dsc) +void lv_obj_init_draw_img_dsc(lv_obj_t * obj, uint32_t part, lv_draw_img_dsc_t * draw_dsc) { - draw_dsc->base.obj = obj; - draw_dsc->base.part = part; - - draw_dsc->opa = lv_obj_get_style_image_opa(obj, part); + draw_dsc->opa = lv_obj_get_style_img_opa(obj, part); if(draw_dsc->opa <= LV_OPA_MIN) return; lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part); + if(opa <= LV_OPA_MIN) { + draw_dsc->opa = LV_OPA_TRANSP; + return; + } if(opa < LV_OPA_MAX) { - draw_dsc->opa = LV_OPA_MIX2(draw_dsc->opa, opa); + draw_dsc->opa = (opa * draw_dsc->opa) >> 8; } if(draw_dsc->opa <= LV_OPA_MIN) return; - draw_dsc->rotation = 0; - draw_dsc->scale_x = LV_SCALE_NONE; - draw_dsc->scale_y = LV_SCALE_NONE; + draw_dsc->angle = 0; + draw_dsc->zoom = LV_IMG_ZOOM_NONE; draw_dsc->pivot.x = lv_area_get_width(&obj->coords) / 2; draw_dsc->pivot.y = lv_area_get_height(&obj->coords) / 2; - draw_dsc->recolor_opa = lv_obj_get_style_image_recolor_opa(obj, part); - draw_dsc->recolor = lv_obj_get_style_image_recolor_filtered(obj, part); - + draw_dsc->recolor_opa = lv_obj_get_style_img_recolor_opa(obj, part); + if(draw_dsc->recolor_opa > 0) { + draw_dsc->recolor = lv_obj_get_style_img_recolor_filtered(obj, part); + } +#if LV_DRAW_COMPLEX if(part != LV_PART_MAIN) draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part); +#endif } -void lv_obj_init_draw_line_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_line_dsc_t * draw_dsc) +void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint32_t part, lv_draw_line_dsc_t * draw_dsc) { - draw_dsc->base.obj = obj; - draw_dsc->base.part = part; - draw_dsc->opa = lv_obj_get_style_line_opa(obj, part); if(draw_dsc->opa <= LV_OPA_MIN) return; lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part); + if(opa <= LV_OPA_MIN) { + draw_dsc->opa = LV_OPA_TRANSP; + return; + } if(opa < LV_OPA_MAX) { - draw_dsc->opa = LV_OPA_MIX2(draw_dsc->opa, opa); + draw_dsc->opa = (opa * draw_dsc->opa) >> 8; } if(draw_dsc->opa <= LV_OPA_MIN) return; @@ -226,14 +277,13 @@ void lv_obj_init_draw_line_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_line_dsc_ draw_dsc->round_start = lv_obj_get_style_line_rounded(obj, part); draw_dsc->round_end = draw_dsc->round_start; +#if LV_DRAW_COMPLEX if(part != LV_PART_MAIN) draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part); +#endif } -void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_arc_dsc_t * draw_dsc) +void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, uint32_t part, lv_draw_arc_dsc_t * draw_dsc) { - draw_dsc->base.obj = obj; - draw_dsc->base.part = part; - draw_dsc->width = lv_obj_get_style_arc_width(obj, part); if(draw_dsc->width == 0) return; @@ -241,58 +291,80 @@ void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_arc_dsc_t if(draw_dsc->opa <= LV_OPA_MIN) return; lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part); + if(opa <= LV_OPA_MIN) { + draw_dsc->opa = LV_OPA_TRANSP; + return; + } if(opa < LV_OPA_MAX) { - draw_dsc->opa = LV_OPA_MIX2(draw_dsc->opa, opa); + draw_dsc->opa = (opa * draw_dsc->opa) >> 8; } if(draw_dsc->opa <= LV_OPA_MIN) return; draw_dsc->color = lv_obj_get_style_arc_color_filtered(obj, part); - draw_dsc->img_src = lv_obj_get_style_arc_image_src(obj, part); + draw_dsc->img_src = lv_obj_get_style_arc_img_src(obj, part); draw_dsc->rounded = lv_obj_get_style_arc_rounded(obj, part); + +#if LV_DRAW_COMPLEX + if(part != LV_PART_MAIN) draw_dsc->blend_mode = lv_obj_get_style_blend_mode(obj, part); +#endif } -int32_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, lv_part_t part) +lv_coord_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, uint32_t part) { - int32_t s = 0; + lv_coord_t s = 0; - int32_t sh_width = lv_obj_get_style_shadow_width(obj, part); + lv_coord_t sh_width = lv_obj_get_style_shadow_width(obj, part); if(sh_width) { lv_opa_t sh_opa = lv_obj_get_style_shadow_opa(obj, part); if(sh_opa > LV_OPA_MIN) { sh_width = sh_width / 2 + 1; /*The blur adds only half width*/ sh_width += lv_obj_get_style_shadow_spread(obj, part); - int32_t sh_ofs_x = lv_obj_get_style_shadow_offset_x(obj, part); - int32_t sh_ofs_y = lv_obj_get_style_shadow_offset_y(obj, part); + lv_coord_t sh_ofs_x = lv_obj_get_style_shadow_ofs_x(obj, part); + lv_coord_t sh_ofs_y = lv_obj_get_style_shadow_ofs_y(obj, part); sh_width += LV_MAX(LV_ABS(sh_ofs_x), LV_ABS(sh_ofs_y)); s = LV_MAX(s, sh_width); } } - int32_t outline_width = lv_obj_get_style_outline_width(obj, part); + lv_coord_t outline_width = lv_obj_get_style_outline_width(obj, part); if(outline_width) { lv_opa_t outline_opa = lv_obj_get_style_outline_opa(obj, part); if(outline_opa > LV_OPA_MIN) { - int32_t outline_pad = lv_obj_get_style_outline_pad(obj, part); + lv_coord_t outline_pad = lv_obj_get_style_outline_pad(obj, part); s = LV_MAX(s, outline_pad + outline_width); } } - int32_t w = lv_obj_get_style_transform_width(obj, part); - int32_t h = lv_obj_get_style_transform_height(obj, part); - int32_t wh = LV_MAX(w, h); + lv_coord_t w = lv_obj_get_style_transform_width(obj, part); + lv_coord_t h = lv_obj_get_style_transform_height(obj, part); + lv_coord_t wh = LV_MAX(w, h); if(wh > 0) s += wh; return s; } +void lv_obj_draw_dsc_init(lv_obj_draw_part_dsc_t * dsc, lv_draw_ctx_t * draw_ctx) +{ + lv_memset_00(dsc, sizeof(lv_obj_draw_part_dsc_t)); + dsc->draw_ctx = draw_ctx; +} + +bool lv_obj_draw_part_check_type(lv_obj_draw_part_dsc_t * dsc, const lv_obj_class_t * class_p, uint32_t type) +{ + if(dsc->class_p == class_p && dsc->type == type) return true; + else return false; +} + void lv_obj_refresh_ext_draw_size(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - int32_t s_old = lv_obj_get_ext_draw_size(obj); - int32_t s_new = 0; - lv_obj_send_event(obj, LV_EVENT_REFR_EXT_DRAW_SIZE, &s_new); + lv_coord_t s_old = _lv_obj_get_ext_draw_size(obj); + lv_coord_t s_new = 0; + lv_event_send(obj, LV_EVENT_REFR_EXT_DRAW_SIZE, &s_new); + + if(s_new != s_old) lv_obj_invalidate(obj); /*Store the result if the special attrs already allocated*/ if(obj->spec_attr) { @@ -308,16 +380,16 @@ void lv_obj_refresh_ext_draw_size(lv_obj_t * obj) if(s_new != s_old) lv_obj_invalidate(obj); } -int32_t lv_obj_get_ext_draw_size(const lv_obj_t * obj) +lv_coord_t _lv_obj_get_ext_draw_size(const lv_obj_t * obj) { if(obj->spec_attr) return obj->spec_attr->ext_draw_size; else return 0; } -lv_layer_type_t lv_obj_get_layer_type(const lv_obj_t * obj) +lv_layer_type_t _lv_obj_get_layer_type(const lv_obj_t * obj) { - if(obj->spec_attr) return (lv_layer_type_t)obj->spec_attr->layer_type; + if(obj->spec_attr) return obj->spec_attr->layer_type; else return LV_LAYER_TYPE_NONE; } diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_draw.h b/L3_Middlewares/LVGL/src/core/lv_obj_draw.h index c0dbee4..3f9d0f3 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_draw.h +++ b/L3_Middlewares/LVGL/src/core/lv_obj_draw.h @@ -13,12 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../misc/lv_types.h" -#include "../draw/lv_draw_rect.h" -#include "../draw/lv_draw_label.h" -#include "../draw/lv_draw_image.h" -#include "../draw/lv_draw_line.h" -#include "../draw/lv_draw_arc.h" +#include "../draw/lv_draw.h" /********************* * DEFINES @@ -28,12 +23,49 @@ extern "C" { * TYPEDEFS **********************/ +struct _lv_obj_t; +struct _lv_obj_class_t; + +/** Cover check results.*/ +typedef enum { + LV_COVER_RES_COVER = 0, + LV_COVER_RES_NOT_COVER = 1, + LV_COVER_RES_MASKED = 2, +} lv_cover_res_t; + typedef enum { LV_LAYER_TYPE_NONE, LV_LAYER_TYPE_SIMPLE, LV_LAYER_TYPE_TRANSFORM, } lv_layer_type_t; +typedef struct { + lv_draw_ctx_t * draw_ctx; /**< Draw context*/ + const struct _lv_obj_class_t * class_p; /**< The class that sent the event */ + uint32_t type; /**< The type if part being draw. Element of `lv__draw_part_type_t` */ + lv_area_t * draw_area; /**< The area of the part being drawn*/ + lv_draw_rect_dsc_t * + rect_dsc; /**< A draw descriptor that can be modified to changed what LVGL will draw. Set only for rectangle-like parts*/ + lv_draw_label_dsc_t * + label_dsc; /**< A draw descriptor that can be modified to changed what LVGL will draw. Set only for text-like parts*/ + lv_draw_line_dsc_t * + line_dsc; /**< A draw descriptor that can be modified to changed what LVGL will draw. Set only for line-like parts*/ + lv_draw_img_dsc_t * + img_dsc; /**< A draw descriptor that can be modified to changed what LVGL will draw. Set only for image-like parts*/ + lv_draw_arc_dsc_t * + arc_dsc; /**< A draw descriptor that can be modified to changed what LVGL will draw. Set only for arc-like parts*/ + const lv_point_t * + p1; /**< A point calculated during drawing. E.g. a point of chart or the center of an arc.*/ + const lv_point_t * p2; /**< A point calculated during drawing. E.g. a point of chart.*/ + char * text; /**< A text calculated during drawing. Can be modified. E.g. tick labels on a chart axis.*/ + uint32_t text_length; /**< Size of the text buffer containing null-terminated text string calculated during drawing.*/ + uint32_t part; /**< The current part for which the event is sent*/ + uint32_t id; /**< The index of the part. E.g. a button's index on button matrix or table cell index.*/ + lv_coord_t radius; /**< E.g. the radius of an arc (not the corner radius).*/ + int32_t value; /**< A value calculated during drawing. E.g. Chart's tick line value.*/ + const void * sub_part_ptr; /**< A pointer the identifies something in the part. E.g. chart series. */ +} lv_obj_draw_part_dsc_t; + /********************** * GLOBAL PROTOTYPES **********************/ @@ -48,7 +80,7 @@ typedef enum { * @note Only the relevant fields will be set. * E.g. if `border width == 0` the other border properties won't be evaluated. */ -void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_t * draw_dsc); +void lv_obj_init_draw_rect_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t * draw_dsc); /** * Initialize a label draw descriptor from an object's styles in its current state @@ -58,7 +90,7 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_rect_dsc_ * If the `opa` field is set to or the property is equal to `LV_OPA_TRANSP` the rest won't be initialized. * Should be initialized with `lv_draw_label_dsc_init(draw_dsc)`. */ -void lv_obj_init_draw_label_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_label_dsc_t * draw_dsc); +void lv_obj_init_draw_label_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_label_dsc_t * draw_dsc); /** * Initialize an image draw descriptor from an object's styles in its current state @@ -67,7 +99,8 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_label_ds * @param draw_dsc the descriptor to initialize. * Should be initialized with `lv_draw_image_dsc_init(draw_dsc)`. */ -void lv_obj_init_draw_image_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_image_dsc_t * draw_dsc); +void lv_obj_init_draw_img_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_img_dsc_t * draw_dsc); + /** * Initialize a line draw descriptor from an object's styles in its current state @@ -76,7 +109,7 @@ void lv_obj_init_draw_image_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_image_ds * @param draw_dsc the descriptor to initialize. * Should be initialized with `lv_draw_line_dsc_init(draw_dsc)`. */ -void lv_obj_init_draw_line_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_line_dsc_t * draw_dsc); +void lv_obj_init_draw_line_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_line_dsc_t * draw_dsc); /** * Initialize an arc draw descriptor from an object's styles in its current state @@ -85,7 +118,7 @@ void lv_obj_init_draw_line_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_line_dsc_ * @param draw_dsc the descriptor to initialize. * Should be initialized with `lv_draw_arc_dsc_init(draw_dsc)`. */ -void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_arc_dsc_t * draw_dsc); +void lv_obj_init_draw_arc_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_arc_dsc_t * draw_dsc); /** * Get the required extra size (around the object's part) to draw shadow, outline, value etc. @@ -93,14 +126,40 @@ void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, lv_part_t part, lv_draw_arc_dsc_t * @param part part of the object * @return the extra size required around the object */ -int32_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, lv_part_t part); +lv_coord_t lv_obj_calculate_ext_draw_size(struct _lv_obj_t * obj, uint32_t part); + +/** + * Initialize a draw descriptor used in events. + * @param dsc pointer to a descriptor. Later it should be passed as parameter to an `LV_EVENT_DRAW_PART_BEGIN/END` event. + * @param draw the current draw context. (usually returned by `lv_event_get_draw_ctx(e)`) + */ +void lv_obj_draw_dsc_init(lv_obj_draw_part_dsc_t * dsc, lv_draw_ctx_t * draw_ctx); + +/** + * Check the type obj a part draw descriptor + * @param dsc the descriptor (normally the event parameter) + * @param class_p pointer to class to which `type` is related + * @param type element of `lv__draw_part_type_t` + * @return true if ::dsc is related to ::class_p and ::type + */ +bool lv_obj_draw_part_check_type(lv_obj_draw_part_dsc_t * dsc, const struct _lv_obj_class_t * class_p, uint32_t type); /** * Send a 'LV_EVENT_REFR_EXT_DRAW_SIZE' Call the ancestor's event handler to the object to refresh the value of the extended draw size. * The result will be saved in `obj`. * @param obj pointer to an object */ -void lv_obj_refresh_ext_draw_size(lv_obj_t * obj); +void lv_obj_refresh_ext_draw_size(struct _lv_obj_t * obj); + +/** + * Get the extended draw area of an object. + * @param obj pointer to an object + * @return the size extended draw area around the real coordinates + */ +lv_coord_t _lv_obj_get_ext_draw_size(const struct _lv_obj_t * obj); + + +lv_layer_type_t _lv_obj_get_layer_type(const struct _lv_obj_t * obj); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_draw_private.h b/L3_Middlewares/LVGL/src/core/lv_obj_draw_private.h deleted file mode 100644 index 36c8bff..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_obj_draw_private.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file lv_obj_draw_private.h - * - */ - -#ifndef LV_OBJ_DRAW_PRIVATE_H -#define LV_OBJ_DRAW_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_obj_draw.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Get the extended draw area of an object. - * @param obj pointer to an object - * @return the size extended draw area around the real coordinates - */ -int32_t lv_obj_get_ext_draw_size(const lv_obj_t * obj); - -lv_layer_type_t lv_obj_get_layer_type(const lv_obj_t * obj); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OBJ_DRAW_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_event.c b/L3_Middlewares/LVGL/src/core/lv_obj_event.c deleted file mode 100644 index 3831fee..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_obj_event.c +++ /dev/null @@ -1,419 +0,0 @@ -/** - * @file lv_obj_event.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../misc/lv_event_private.h" -#include "lv_obj_event_private.h" -#include "lv_obj_class_private.h" -#include "lv_obj_private.h" -#include "../indev/lv_indev.h" -#include "../indev/lv_indev_private.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_obj_class) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static lv_result_t event_send_core(lv_event_t * e); -static bool event_is_bubbled(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ -#if LV_USE_LOG && LV_LOG_TRACE_EVENT - #define LV_TRACE_EVENT(...) LV_LOG_TRACE(__VA_ARGS__) -#else - #define LV_TRACE_EVENT(...) -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_obj_send_event(lv_obj_t * obj, lv_event_code_t event_code, void * param) -{ - if(obj == NULL) return LV_RESULT_OK; - - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_event_t e; - e.current_target = obj; - e.original_target = obj; - e.code = event_code; - e.user_data = NULL; - e.param = param; - e.deleted = 0; - e.stop_bubbling = 0; - e.stop_processing = 0; - - lv_event_push(&e); - - /*Send the event*/ - lv_result_t res = event_send_core(&e); - - /*Remove this element from the list*/ - lv_event_pop(&e); - - return res; -} - -lv_result_t lv_obj_event_base(const lv_obj_class_t * class_p, lv_event_t * e) -{ - const lv_obj_class_t * base; - if(class_p == NULL) base = ((lv_obj_t *)e->current_target)->class_p; - else base = class_p->base_class; - - /*Find a base in which call the ancestor's event handler_cb if set*/ - while(base && base->event_cb == NULL) base = base->base_class; - - if(base == NULL) return LV_RESULT_OK; - if(base->event_cb == NULL) return LV_RESULT_OK; - - /*Call the actual event callback*/ - e->user_data = NULL; - base->event_cb(base, e); - - lv_result_t res = LV_RESULT_OK; - /*Stop if the object is deleted*/ - if(e->deleted) res = LV_RESULT_INVALID; - - return res; -} - -lv_event_dsc_t * lv_obj_add_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_obj_allocate_spec_attr(obj); - - return lv_event_add(&obj->spec_attr->event_list, event_cb, filter, user_data); -} - -uint32_t lv_obj_get_event_count(lv_obj_t * obj) -{ - LV_ASSERT_NULL(obj); - if(obj->spec_attr == NULL) return 0; - return lv_event_get_count(&obj->spec_attr->event_list); -} - -lv_event_dsc_t * lv_obj_get_event_dsc(lv_obj_t * obj, uint32_t index) -{ - LV_ASSERT_NULL(obj); - if(obj->spec_attr == NULL) return NULL; - return lv_event_get_dsc(&obj->spec_attr->event_list, index); -} - -bool lv_obj_remove_event(lv_obj_t * obj, uint32_t index) -{ - LV_ASSERT_NULL(obj); - if(obj->spec_attr == NULL) return false; - return lv_event_remove(&obj->spec_attr->event_list, index); -} - -bool lv_obj_remove_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb) -{ - LV_ASSERT_NULL(obj); - - uint32_t event_cnt = lv_obj_get_event_count(obj); - uint32_t i; - for(i = 0; i < event_cnt; i++) { - lv_event_dsc_t * dsc = lv_obj_get_event_dsc(obj, i); - if(dsc->cb == event_cb) { - lv_obj_remove_event(obj, i); - return true; - } - } - - return false; -} - -bool lv_obj_remove_event_dsc(lv_obj_t * obj, lv_event_dsc_t * dsc) -{ - LV_ASSERT_NULL(obj); - LV_ASSERT_NULL(dsc); - if(obj->spec_attr == NULL) return false; - return lv_event_remove_dsc(&obj->spec_attr->event_list, dsc); -} - -uint32_t lv_obj_remove_event_cb_with_user_data(lv_obj_t * obj, lv_event_cb_t event_cb, void * user_data) -{ - LV_ASSERT_NULL(obj); - - uint32_t event_cnt = lv_obj_get_event_count(obj); - uint32_t removed_count = 0; - int32_t i; - - for(i = event_cnt - 1; i >= 0; i--) { - lv_event_dsc_t * dsc = lv_obj_get_event_dsc(obj, i); - if(dsc && dsc->cb == event_cb && dsc->user_data == user_data) { - lv_obj_remove_event(obj, i); - removed_count ++; - } - } - - return removed_count; -} - -lv_obj_t * lv_event_get_current_target_obj(lv_event_t * e) -{ - return lv_event_get_current_target(e); -} - -lv_obj_t * lv_event_get_target_obj(lv_event_t * e) -{ - return lv_event_get_target(e); -} - -lv_indev_t * lv_event_get_indev(lv_event_t * e) -{ - - if(e->code == LV_EVENT_PRESSED || - e->code == LV_EVENT_PRESSING || - e->code == LV_EVENT_PRESS_LOST || - e->code == LV_EVENT_SHORT_CLICKED || - e->code == LV_EVENT_LONG_PRESSED || - e->code == LV_EVENT_LONG_PRESSED_REPEAT || - e->code == LV_EVENT_CLICKED || - e->code == LV_EVENT_RELEASED || - e->code == LV_EVENT_SCROLL_BEGIN || - e->code == LV_EVENT_SCROLL_END || - e->code == LV_EVENT_SCROLL || - e->code == LV_EVENT_GESTURE || - e->code == LV_EVENT_KEY || - e->code == LV_EVENT_FOCUSED || - e->code == LV_EVENT_DEFOCUSED || - e->code == LV_EVENT_LEAVE || - e->code == LV_EVENT_HOVER_OVER || - e->code == LV_EVENT_HOVER_LEAVE) { - return lv_event_get_param(e); - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - return NULL; - } -} - -lv_layer_t * lv_event_get_layer(lv_event_t * e) -{ - if(e->code == LV_EVENT_DRAW_MAIN || - e->code == LV_EVENT_DRAW_MAIN_BEGIN || - e->code == LV_EVENT_DRAW_MAIN_END || - e->code == LV_EVENT_DRAW_POST || - e->code == LV_EVENT_DRAW_POST_BEGIN || - e->code == LV_EVENT_DRAW_POST_END) { - return lv_event_get_param(e); - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - return NULL; - } -} - -const lv_area_t * lv_event_get_old_size(lv_event_t * e) -{ - if(e->code == LV_EVENT_SIZE_CHANGED) { - return lv_event_get_param(e); - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - return NULL; - } -} - -uint32_t lv_event_get_key(lv_event_t * e) -{ - if(e->code == LV_EVENT_KEY) { - uint32_t * k = lv_event_get_param(e); - if(k) return *k; - else return 0; - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - return 0; - } -} - -int32_t lv_event_get_rotary_diff(lv_event_t * e) -{ - if(e->code == LV_EVENT_ROTARY) { - int32_t * r = lv_event_get_param(e); - if(r) return *r; - else return 0; - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - return 0; - } -} - -lv_anim_t * lv_event_get_scroll_anim(lv_event_t * e) -{ - if(e->code == LV_EVENT_SCROLL_BEGIN) { - return lv_event_get_param(e); - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - return NULL; - } -} - -void lv_event_set_ext_draw_size(lv_event_t * e, int32_t size) -{ - if(e->code == LV_EVENT_REFR_EXT_DRAW_SIZE) { - int32_t * cur_size = lv_event_get_param(e); - *cur_size = LV_MAX(*cur_size, size); - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - } -} - -lv_point_t * lv_event_get_self_size_info(lv_event_t * e) -{ - if(e->code == LV_EVENT_GET_SELF_SIZE) { - return lv_event_get_param(e); - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - return 0; - } -} - -lv_hit_test_info_t * lv_event_get_hit_test_info(lv_event_t * e) -{ - if(e->code == LV_EVENT_HIT_TEST) { - return lv_event_get_param(e); - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - return 0; - } -} - -const lv_area_t * lv_event_get_cover_area(lv_event_t * e) -{ - if(e->code == LV_EVENT_COVER_CHECK) { - lv_cover_check_info_t * p = lv_event_get_param(e); - return p->area; - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - return NULL; - } -} - -void lv_event_set_cover_res(lv_event_t * e, lv_cover_res_t res) -{ - if(e->code == LV_EVENT_COVER_CHECK) { - lv_cover_check_info_t * p = lv_event_get_param(e); - if(res > p->res) p->res = res; /*Save only "stronger" results*/ - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - } -} - -lv_draw_task_t * lv_event_get_draw_task(lv_event_t * e) -{ - if(e->code == LV_EVENT_DRAW_TASK_ADDED) { - return lv_event_get_param(e); - } - else { - LV_LOG_WARN("Not interpreted with this event code"); - return NULL; - } - -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static lv_result_t event_send_core(lv_event_t * e) -{ - LV_TRACE_EVENT("Sending event %d to %p with %p param", e->code, (void *)e->original_target, e->param); - - /*Call the input device's feedback callback if set*/ - lv_indev_t * indev_act = lv_indev_active(); - if(indev_act) { - if(e->stop_processing) return LV_RESULT_OK; - if(e->deleted) return LV_RESULT_INVALID; - } - - lv_obj_t * target = e->current_target; - lv_result_t res = LV_RESULT_OK; - lv_event_list_t * list = target->spec_attr ? &target->spec_attr->event_list : NULL; - - res = lv_event_send(list, e, true); - if(res != LV_RESULT_OK || e->stop_processing) return res; - - res = lv_obj_event_base(NULL, e); - if(res != LV_RESULT_OK || e->stop_processing) return res; - - res = lv_event_send(list, e, false); - if(res != LV_RESULT_OK || e->stop_processing) return res; - - lv_obj_t * parent = lv_obj_get_parent(e->current_target); - if(parent && event_is_bubbled(e)) { - e->current_target = parent; - res = event_send_core(e); - if(res != LV_RESULT_OK || e->stop_processing || e->stop_bubbling) return res; - } - - return res; -} - -static bool event_is_bubbled(lv_event_t * e) -{ - if(e->stop_bubbling) return false; - - /*Event codes that always bubble*/ - switch(e->code) { - case LV_EVENT_CHILD_CREATED: - case LV_EVENT_CHILD_DELETED: - return true; - default: - break; - } - - /*Check other codes only if bubbling is enabled*/ - if(lv_obj_has_flag(e->current_target, LV_OBJ_FLAG_EVENT_BUBBLE) == false) return false; - - switch(e->code) { - case LV_EVENT_HIT_TEST: - case LV_EVENT_COVER_CHECK: - case LV_EVENT_REFR_EXT_DRAW_SIZE: - case LV_EVENT_DRAW_MAIN_BEGIN: - case LV_EVENT_DRAW_MAIN: - case LV_EVENT_DRAW_MAIN_END: - case LV_EVENT_DRAW_POST_BEGIN: - case LV_EVENT_DRAW_POST: - case LV_EVENT_DRAW_POST_END: - case LV_EVENT_DRAW_TASK_ADDED: - case LV_EVENT_REFRESH: - case LV_EVENT_DELETE: - case LV_EVENT_CHILD_CREATED: - case LV_EVENT_CHILD_DELETED: - case LV_EVENT_CHILD_CHANGED: - case LV_EVENT_SIZE_CHANGED: - case LV_EVENT_STYLE_CHANGED: - case LV_EVENT_GET_SELF_SIZE: - return false; - default: - return true; - } -} diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_event.h b/L3_Middlewares/LVGL/src/core/lv_obj_event.h deleted file mode 100644 index 2035f17..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_obj_event.h +++ /dev/null @@ -1,198 +0,0 @@ -/** - * @file lv_obj_event.h - * - */ - -#ifndef LV_OBJ_EVENT_H -#define LV_OBJ_EVENT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../misc/lv_types.h" -#include "../misc/lv_event.h" -#include "../indev/lv_indev.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Cover check results.*/ -typedef enum { - LV_COVER_RES_COVER = 0, - LV_COVER_RES_NOT_COVER = 1, - LV_COVER_RES_MASKED = 2, -} lv_cover_res_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Send an event to the object - * @param obj pointer to an object - * @param event_code the type of the event from `lv_event_t` - * @param param arbitrary data depending on the widget type and the event. (Usually `NULL`) - * @return LV_RESULT_OK: `obj` was not deleted in the event; LV_RESULT_INVALID: `obj` was deleted in the event_code - */ -lv_result_t lv_obj_send_event(lv_obj_t * obj, lv_event_code_t event_code, void * param); - -/** - * Used by the widgets internally to call the ancestor widget types's event handler - * @param class_p pointer to the class of the widget (NOT the ancestor class) - * @param e pointer to the event descriptor - * @return LV_RESULT_OK: the target object was not deleted in the event; LV_RESULT_INVALID: it was deleted in the event_code - */ -lv_result_t lv_obj_event_base(const lv_obj_class_t * class_p, lv_event_t * e); - -/** - * Get the current target of the event. It's the object which event handler being called. - * If the event is not bubbled it's the same as "original" target. - * @param e pointer to the event descriptor - * @return the target of the event_code - */ -lv_obj_t * lv_event_get_current_target_obj(lv_event_t * e); - -/** - * Get the object originally targeted by the event. It's the same even if the event is bubbled. - * @param e pointer to the event descriptor - * @return pointer to the original target of the event_code - */ -lv_obj_t * lv_event_get_target_obj(lv_event_t * e); - -/** - * Add an event handler function for an object. - * Used by the user to react on event which happens with the object. - * An object can have multiple event handler. They will be called in the same order as they were added. - * @param obj pointer to an object - * @param filter an event code (e.g. `LV_EVENT_CLICKED`) on which the event should be called. `LV_EVENT_ALL` can be used to receive all the events. - * @param event_cb the new event function - * @param user_data custom data will be available in `event_cb` - * @return handler to the event. It can be used in `lv_obj_remove_event_dsc`. - */ -lv_event_dsc_t * lv_obj_add_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data); - -uint32_t lv_obj_get_event_count(lv_obj_t * obj); - -lv_event_dsc_t * lv_obj_get_event_dsc(lv_obj_t * obj, uint32_t index); - -bool lv_obj_remove_event(lv_obj_t * obj, uint32_t index); - -bool lv_obj_remove_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb); - -bool lv_obj_remove_event_dsc(lv_obj_t * obj, lv_event_dsc_t * dsc); - -/** - * Remove an event_cb with user_data - * @param obj pointer to a obj - * @param event_cb the event_cb of the event to remove - * @param user_data user_data - * @return the count of the event removed - */ -uint32_t lv_obj_remove_event_cb_with_user_data(lv_obj_t * obj, lv_event_cb_t event_cb, void * user_data); - -/** - * Get the input device passed as parameter to indev related events. - * @param e pointer to an event - * @return the indev that triggered the event or NULL if called on a not indev related event - */ -lv_indev_t * lv_event_get_indev(lv_event_t * e); - -/** - * Get the draw context which should be the first parameter of the draw functions. - * Namely: `LV_EVENT_DRAW_MAIN/POST`, `LV_EVENT_DRAW_MAIN/POST_BEGIN`, `LV_EVENT_DRAW_MAIN/POST_END` - * @param e pointer to an event - * @return pointer to a draw context or NULL if called on an unrelated event - */ -lv_layer_t * lv_event_get_layer(lv_event_t * e); - -/** - * Get the old area of the object before its size was changed. Can be used in `LV_EVENT_SIZE_CHANGED` - * @param e pointer to an event - * @return the old absolute area of the object or NULL if called on an unrelated event - */ -const lv_area_t * lv_event_get_old_size(lv_event_t * e); - -/** - * Get the key passed as parameter to an event. Can be used in `LV_EVENT_KEY` - * @param e pointer to an event - * @return the triggering key or NULL if called on an unrelated event - */ -uint32_t lv_event_get_key(lv_event_t * e); - -/** - * Get the signed rotary encoder diff. passed as parameter to an event. Can be used in `LV_EVENT_ROTARY` - * @param e pointer to an event - * @return the triggering key or NULL if called on an unrelated event - */ -int32_t lv_event_get_rotary_diff(lv_event_t * e); - -/** - * Get the animation descriptor of a scrolling. Can be used in `LV_EVENT_SCROLL_BEGIN` - * @param e pointer to an event - * @return the animation that will scroll the object. (can be modified as required) - */ -lv_anim_t * lv_event_get_scroll_anim(lv_event_t * e); - -/** - * Set the new extra draw size. Can be used in `LV_EVENT_REFR_EXT_DRAW_SIZE` - * @param e pointer to an event - * @param size The new extra draw size - */ -void lv_event_set_ext_draw_size(lv_event_t * e, int32_t size); - -/** - * Get a pointer to an `lv_point_t` variable in which the self size should be saved (width in `point->x` and height `point->y`). - * Can be used in `LV_EVENT_GET_SELF_SIZE` - * @param e pointer to an event - * @return pointer to `lv_point_t` or NULL if called on an unrelated event - */ -lv_point_t * lv_event_get_self_size_info(lv_event_t * e); - -/** - * Get a pointer to an `lv_hit_test_info_t` variable in which the hit test result should be saved. Can be used in `LV_EVENT_HIT_TEST` - * @param e pointer to an event - * @return pointer to `lv_hit_test_info_t` or NULL if called on an unrelated event - */ -lv_hit_test_info_t * lv_event_get_hit_test_info(lv_event_t * e); - -/** - * Get a pointer to an area which should be examined whether the object fully covers it or not. - * Can be used in `LV_EVENT_HIT_TEST` - * @param e pointer to an event - * @return an area with absolute coordinates to check - */ -const lv_area_t * lv_event_get_cover_area(lv_event_t * e); - -/** - * Set the result of cover checking. Can be used in `LV_EVENT_COVER_CHECK` - * @param e pointer to an event - * @param res an element of ::lv_cover_check_info_t - */ -void lv_event_set_cover_res(lv_event_t * e, lv_cover_res_t res); - -/** - * Get the draw task which was just added. - * Can be used in `LV_EVENT_DRAW_TASK_ADDED event` - * @param e pointer to an event - * @return the added draw task - */ -lv_draw_task_t * lv_event_get_draw_task(lv_event_t * e); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OBJ_EVENT_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_event_private.h b/L3_Middlewares/LVGL/src/core/lv_obj_event_private.h deleted file mode 100644 index 731d332..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_obj_event_private.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file lv_obj_event_private.h - * - */ - -#ifndef LV_OBJ_EVENT_PRIVATE_H -#define LV_OBJ_EVENT_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_obj_event.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * Used as the event parameter of ::LV_EVENT_HIT_TEST to check if an `point` can click the object or not. - * `res` should be set like this: - * - If already set to `false` another event wants that point non clickable. If you want to respect it leave it as `false` or set `true` to overwrite it. - * - If already set `true` and `point` shouldn't be clickable set to `false` - * - If already set to `true` you agree that `point` can click the object leave it as `true` - */ -struct lv_hit_test_info_t { - const lv_point_t * point; /**< A point relative to screen to check if it can click the object or not*/ - bool res; /**< true: `point` can click the object; false: it cannot*/ -}; - -/** - * Used as the event parameter of ::LV_EVENT_COVER_CHECK to check if an area is covered by the object or not. - * In the event use `const lv_area_t * area = lv_event_get_cover_area(e)` to get the area to check - * and `lv_event_set_cover_res(e, res)` to set the result. - */ -struct lv_cover_check_info_t { - lv_cover_res_t res; - const lv_area_t * area; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OBJ_EVENT_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_id_builtin.c b/L3_Middlewares/LVGL/src/core/lv_obj_id_builtin.c deleted file mode 100644 index ed8f745..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_obj_id_builtin.c +++ /dev/null @@ -1,122 +0,0 @@ -/** - * @file lv_obj_id.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_obj_class_private.h" -#include "lv_obj_private.h" -#include "lv_global.h" -#include "../osal/lv_os.h" -#include "../stdlib/lv_sprintf.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -typedef struct _class_info_t { - const lv_obj_class_t * class_p; - uint32_t obj_count; -} class_info_t; - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -#if LV_USE_OBJ_ID && LV_USE_OBJ_ID_BUILTIN - -void lv_obj_assign_id(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_ASSERT(obj && class_p); - - uint32_t i; - uint32_t id = 0; - lv_global_t * global = LV_GLOBAL_DEFAULT(); - class_info_t * info = NULL; - - if(obj == NULL || class_p == NULL) return; - if(global == NULL) return; - - obj->id = NULL; - - for(i = 0; i < global->objid_count; i ++) { - info = ((class_info_t *)global->objid_array) + i; - if(class_p == info->class_p) break; - } - - /*Resize array*/ - if(i == global->objid_count) { - void * array = lv_realloc(global->objid_array, sizeof(class_info_t) * (global->objid_count + 1)); - LV_ASSERT_MALLOC(array); - if(array == NULL) return; - global->objid_array = array; - global->objid_count ++; - info = ((class_info_t *)global->objid_array) + i; - info->obj_count = 0; - info->class_p = class_p; - } - - id = ++info->obj_count; - - obj->id = (void *)(lv_uintptr_t)id; -} - -void lv_obj_set_id(lv_obj_t * obj, void * id) -{ - LV_ASSERT_NULL(obj); - if(obj->id) lv_obj_free_id(obj); - obj->id = id; -} - -void lv_obj_free_id(lv_obj_t * obj) -{ - LV_UNUSED(obj); - obj->id = NULL; -} - -const char * lv_obj_stringify_id(lv_obj_t * obj, char * buf, uint32_t len) -{ - const char * name; - if(obj == NULL || obj->class_p == NULL) return NULL; - if(buf == NULL) return NULL; - - name = obj->class_p->name; - if(name == NULL) name = "nameless"; - - lv_snprintf(buf, len, "%s%" LV_PRIu32 "", name, (uint32_t)(lv_uintptr_t)obj->id); - return buf; -} - -void lv_objid_builtin_destroy(void) -{ - lv_global_t * global = LV_GLOBAL_DEFAULT(); - if(global == NULL) return; - - lv_free(global->objid_array); - global->objid_count = 0; -} - -int lv_obj_id_compare(const void * id1, const void * id2) -{ - return id1 == id2 ? 0 : 1; -} - -#endif /*LV_USE_OBJ_ID_BUILTIN*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_pos.c b/L3_Middlewares/LVGL/src/core/lv_obj_pos.c index 0f10d7d..c50ea3a 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_pos.c +++ b/L3_Middlewares/LVGL/src/core/lv_obj_pos.c @@ -6,21 +6,15 @@ /********************* * INCLUDES *********************/ -#include "../misc/lv_area_private.h" -#include "../layouts/lv_layout_private.h" -#include "lv_obj_event_private.h" -#include "lv_obj_draw_private.h" -#include "lv_obj_private.h" -#include "../display/lv_display.h" -#include "../display/lv_display_private.h" -#include "lv_refr_private.h" -#include "../core/lv_global.h" +#include "lv_obj.h" +#include "lv_disp.h" +#include "lv_refr.h" +#include "../misc/lv_gc.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_obj_class) -#define update_layout_mutex LV_GLOBAL_DEFAULT()->layout_update_mutex +#define MY_CLASS &lv_obj_class /********************** * TYPEDEFS @@ -29,14 +23,15 @@ /********************** * STATIC PROTOTYPES **********************/ -static int32_t calc_content_width(lv_obj_t * obj); -static int32_t calc_content_height(lv_obj_t * obj); +static lv_coord_t calc_content_width(lv_obj_t * obj); +static lv_coord_t calc_content_height(lv_obj_t * obj); static void layout_update_core(lv_obj_t * obj); -static void transform_point_array(const lv_obj_t * obj, lv_point_t * p, size_t p_count, bool inv); +static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv); /********************** * STATIC VARIABLES **********************/ +static uint32_t layout_cnt; /********************** * MACROS @@ -46,7 +41,7 @@ static void transform_point_array(const lv_obj_t * obj, lv_point_t * p, size_t p * GLOBAL FUNCTIONS **********************/ -void lv_obj_set_pos(lv_obj_t * obj, int32_t x, int32_t y) +void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -54,30 +49,30 @@ void lv_obj_set_pos(lv_obj_t * obj, int32_t x, int32_t y) lv_obj_set_y(obj, y); } -void lv_obj_set_x(lv_obj_t * obj, int32_t x) +void lv_obj_set_x(lv_obj_t * obj, lv_coord_t x) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_style_res_t res_x; + lv_res_t res_x; lv_style_value_t v_x; res_x = lv_obj_get_local_style_prop(obj, LV_STYLE_X, &v_x, 0); - if((res_x == LV_STYLE_RES_FOUND && v_x.num != x) || res_x == LV_STYLE_RES_NOT_FOUND) { + if((res_x == LV_RES_OK && v_x.num != x) || res_x == LV_RES_INV) { lv_obj_set_style_x(obj, x, 0); } } -void lv_obj_set_y(lv_obj_t * obj, int32_t y) +void lv_obj_set_y(lv_obj_t * obj, lv_coord_t y) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_style_res_t res_y; + lv_res_t res_y; lv_style_value_t v_y; res_y = lv_obj_get_local_style_prop(obj, LV_STYLE_Y, &v_y, 0); - if((res_y == LV_STYLE_RES_FOUND && v_y.num != y) || res_y == LV_STYLE_RES_NOT_FOUND) { + if((res_y == LV_RES_OK && v_y.num != y) || res_y == LV_RES_INV) { lv_obj_set_style_y(obj, y, 0); } } @@ -92,18 +87,19 @@ bool lv_obj_refr_size(lv_obj_t * obj) lv_obj_t * parent = lv_obj_get_parent(obj); if(parent == NULL) return false; + lv_coord_t sl_ori = lv_obj_get_scroll_left(obj); bool w_is_content = false; bool w_is_pct = false; - int32_t w; + lv_coord_t w; if(obj->w_layout) { w = lv_obj_get_width(obj); } else { w = lv_obj_get_style_width(obj, LV_PART_MAIN); - w_is_content = w == LV_SIZE_CONTENT; - w_is_pct = LV_COORD_IS_PCT(w); - int32_t parent_w = lv_obj_get_content_width(parent); + w_is_content = w == LV_SIZE_CONTENT ? true : false; + w_is_pct = LV_COORD_IS_PCT(w) ? true : false; + lv_coord_t parent_w = lv_obj_get_content_width(parent); if(w_is_content) { w = calc_content_width(obj); @@ -112,20 +108,22 @@ bool lv_obj_refr_size(lv_obj_t * obj) /*If parent has content size and the child has pct size *a circular dependency will occur. To solve it keep child size at zero */ if(parent->w_layout == 0 && lv_obj_get_style_width(parent, 0) == LV_SIZE_CONTENT) { - w = lv_obj_get_style_space_left(obj, 0) + lv_obj_get_style_space_right(obj, 0); + lv_coord_t border_w = lv_obj_get_style_border_width(obj, 0); + w = lv_obj_get_style_pad_left(obj, 0) + border_w; + w += lv_obj_get_style_pad_right(obj, 0) + border_w; } else { w = (LV_COORD_GET_PCT(w) * parent_w) / 100; - w -= lv_obj_get_style_margin_left(obj, LV_PART_MAIN) + lv_obj_get_style_margin_right(obj, LV_PART_MAIN); } } - int32_t minw = lv_obj_get_style_min_width(obj, LV_PART_MAIN); - int32_t maxw = lv_obj_get_style_max_width(obj, LV_PART_MAIN); + lv_coord_t minw = lv_obj_get_style_min_width(obj, LV_PART_MAIN); + lv_coord_t maxw = lv_obj_get_style_max_width(obj, LV_PART_MAIN); w = lv_clamp_width(w, minw, maxw, parent_w); } - int32_t h; + lv_coord_t st_ori = lv_obj_get_scroll_top(obj); + lv_coord_t h; bool h_is_content = false; bool h_is_pct = false; if(obj->h_layout) { @@ -133,9 +131,9 @@ bool lv_obj_refr_size(lv_obj_t * obj) } else { h = lv_obj_get_style_height(obj, LV_PART_MAIN); - h_is_content = h == LV_SIZE_CONTENT; - h_is_pct = LV_COORD_IS_PCT(h); - int32_t parent_h = lv_obj_get_content_height(parent); + h_is_content = h == LV_SIZE_CONTENT ? true : false; + h_is_pct = LV_COORD_IS_PCT(h) ? true : false; + lv_coord_t parent_h = lv_obj_get_content_height(parent); if(h_is_content) { h = calc_content_height(obj); @@ -144,19 +142,25 @@ bool lv_obj_refr_size(lv_obj_t * obj) /*If parent has content size and the child has pct size *a circular dependency will occur. To solve it keep child size at zero */ if(parent->h_layout == 0 && lv_obj_get_style_height(parent, 0) == LV_SIZE_CONTENT) { - h = lv_obj_get_style_space_top(obj, 0) + lv_obj_get_style_space_bottom(obj, 0); + lv_coord_t border_w = lv_obj_get_style_border_width(obj, 0); + h = lv_obj_get_style_pad_top(obj, 0) + border_w; + h += lv_obj_get_style_pad_bottom(obj, 0) + border_w; } else { h = (LV_COORD_GET_PCT(h) * parent_h) / 100; - h -= lv_obj_get_style_margin_top(obj, LV_PART_MAIN) + lv_obj_get_style_margin_bottom(obj, LV_PART_MAIN); } } - int32_t minh = lv_obj_get_style_min_height(obj, LV_PART_MAIN); - int32_t maxh = lv_obj_get_style_max_height(obj, LV_PART_MAIN); + lv_coord_t minh = lv_obj_get_style_min_height(obj, LV_PART_MAIN); + lv_coord_t maxh = lv_obj_get_style_max_height(obj, LV_PART_MAIN); h = lv_clamp_height(h, minh, maxh, parent_h); } + /*calc_auto_size set the scroll x/y to 0 so revert the original value*/ + if(w_is_content || h_is_content) { + lv_obj_scroll_to(obj, sl_ori, st_ori, LV_ANIM_OFF); + } + /*Do nothing if the size is not changed*/ /*It is very important else recursive resizing can occur without size change*/ if(lv_obj_get_width(obj) == w && lv_obj_get_height(obj) == h) return false; @@ -174,7 +178,7 @@ bool lv_obj_refr_size(lv_obj_t * obj) /*If the object is already out of the parent and its position is changes *surely the scrollbars also changes so invalidate them*/ - bool on1 = lv_area_is_in(&ori, &parent_fit_area, 0); + bool on1 = _lv_area_is_in(&ori, &parent_fit_area, 0); if(!on1) lv_obj_scrollbar_invalidate(parent); /*Set the length and height @@ -188,10 +192,10 @@ bool lv_obj_refr_size(lv_obj_t * obj) } /*Call the ancestor's event handler to the object with its new coordinates*/ - lv_obj_send_event(obj, LV_EVENT_SIZE_CHANGED, &ori); + lv_event_send(obj, LV_EVENT_SIZE_CHANGED, &ori); /*Call the ancestor's event handler to the parent too*/ - lv_obj_send_event(parent, LV_EVENT_CHILD_CHANGED, obj); + lv_event_send(parent, LV_EVENT_CHILD_CHANGED, obj); /*Invalidate the new area*/ lv_obj_invalidate(obj); @@ -200,7 +204,7 @@ bool lv_obj_refr_size(lv_obj_t * obj) /*If the object was out of the parent invalidate the new scrollbar area too. *If it wasn't out of the parent but out now, also invalidate the scrollbars*/ - bool on2 = lv_area_is_in(&obj->coords, &parent_fit_area, 0); + bool on2 = _lv_area_is_in(&obj->coords, &parent_fit_area, 0); if(on1 || (!on1 && on2)) lv_obj_scrollbar_invalidate(parent); lv_obj_refresh_ext_draw_size(obj); @@ -208,7 +212,7 @@ bool lv_obj_refr_size(lv_obj_t * obj) return true; } -void lv_obj_set_size(lv_obj_t * obj, int32_t w, int32_t h) +void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -216,44 +220,48 @@ void lv_obj_set_size(lv_obj_t * obj, int32_t w, int32_t h) lv_obj_set_height(obj, h); } -void lv_obj_set_width(lv_obj_t * obj, int32_t w) +void lv_obj_set_width(lv_obj_t * obj, lv_coord_t w) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_style_res_t res_w; + lv_res_t res_w; lv_style_value_t v_w; res_w = lv_obj_get_local_style_prop(obj, LV_STYLE_WIDTH, &v_w, 0); - if((res_w == LV_STYLE_RES_FOUND && v_w.num != w) || res_w == LV_STYLE_RES_NOT_FOUND) { + if((res_w == LV_RES_OK && v_w.num != w) || res_w == LV_RES_INV) { lv_obj_set_style_width(obj, w, 0); } } -void lv_obj_set_height(lv_obj_t * obj, int32_t h) +void lv_obj_set_height(lv_obj_t * obj, lv_coord_t h) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_style_res_t res_h; + lv_res_t res_h; lv_style_value_t v_h; res_h = lv_obj_get_local_style_prop(obj, LV_STYLE_HEIGHT, &v_h, 0); - if((res_h == LV_STYLE_RES_FOUND && v_h.num != h) || res_h == LV_STYLE_RES_NOT_FOUND) { + if((res_h == LV_RES_OK && v_h.num != h) || res_h == LV_RES_INV) { lv_obj_set_style_height(obj, h, 0); } } -void lv_obj_set_content_width(lv_obj_t * obj, int32_t w) +void lv_obj_set_content_width(lv_obj_t * obj, lv_coord_t w) { - int32_t left = lv_obj_get_style_space_left(obj, LV_PART_MAIN); - int32_t right = lv_obj_get_style_space_right(obj, LV_PART_MAIN); - lv_obj_set_width(obj, w + left + right); + lv_coord_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t pright = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + + lv_obj_set_width(obj, w + pleft + pright + 2 * border_width); } -void lv_obj_set_content_height(lv_obj_t * obj, int32_t h) +void lv_obj_set_content_height(lv_obj_t * obj, lv_coord_t h) { - int32_t top = lv_obj_get_style_space_top(obj, LV_PART_MAIN); - int32_t bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN); - lv_obj_set_height(obj, h + top + bottom); + lv_coord_t ptop = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t pbottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + + lv_obj_set_height(obj, h + ptop + pbottom + 2 * border_width); } void lv_obj_set_layout(lv_obj_t * obj, uint32_t layout) @@ -286,30 +294,41 @@ void lv_obj_mark_layout_as_dirty(lv_obj_t * obj) scr->scr_layout_inv = 1; /*Make the display refreshing*/ - lv_display_t * disp = lv_obj_get_display(scr); - lv_display_send_event(disp, LV_EVENT_REFR_REQUEST, NULL); + lv_disp_t * disp = lv_obj_get_disp(scr); + if(disp->refr_timer) lv_timer_resume(disp->refr_timer); } void lv_obj_update_layout(const lv_obj_t * obj) { - if(update_layout_mutex) { + static bool mutex = false; + if(mutex) { LV_LOG_TRACE("Already running, returning"); return; } - LV_PROFILER_BEGIN; - update_layout_mutex = true; + mutex = true; lv_obj_t * scr = lv_obj_get_screen(obj); - /*Repeat until there are no more layout invalidations*/ + + /*Repeat until there where layout invalidations*/ while(scr->scr_layout_inv) { - LV_LOG_TRACE("Layout update begin"); + LV_LOG_INFO("Layout update begin"); scr->scr_layout_inv = 0; layout_update_core(scr); LV_LOG_TRACE("Layout update end"); } - update_layout_mutex = false; - LV_PROFILER_END; + mutex = false; +} + +uint32_t lv_layout_register(lv_layout_update_cb_t cb, void * user_data) +{ + layout_cnt++; + LV_GC_ROOT(_lv_layout_list) = lv_mem_realloc(LV_GC_ROOT(_lv_layout_list), layout_cnt * sizeof(lv_layout_dsc_t)); + LV_ASSERT_MALLOC(LV_GC_ROOT(_lv_layout_list)); + + LV_GC_ROOT(_lv_layout_list)[layout_cnt - 1].cb = cb; + LV_GC_ROOT(_lv_layout_list)[layout_cnt - 1].user_data = user_data; + return layout_cnt; /*No -1 to skip 0th index*/ } void lv_obj_set_align(lv_obj_t * obj, lv_align_t align) @@ -317,13 +336,13 @@ void lv_obj_set_align(lv_obj_t * obj, lv_align_t align) lv_obj_set_style_align(obj, align, 0); } -void lv_obj_align(lv_obj_t * obj, lv_align_t align, int32_t x_ofs, int32_t y_ofs) +void lv_obj_align(lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs) { lv_obj_set_style_align(obj, align, 0); lv_obj_set_pos(obj, x_ofs, y_ofs); } -void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, int32_t x_ofs, int32_t y_ofs) +void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -332,18 +351,17 @@ void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, in LV_ASSERT_OBJ(base, MY_CLASS); - int32_t x = 0; - int32_t y = 0; + lv_coord_t x = 0; + lv_coord_t y = 0; lv_obj_t * parent = lv_obj_get_parent(obj); + lv_coord_t pborder = lv_obj_get_style_border_width(parent, LV_PART_MAIN); + lv_coord_t pleft = lv_obj_get_style_pad_left(parent, LV_PART_MAIN) + pborder; + lv_coord_t ptop = lv_obj_get_style_pad_top(parent, LV_PART_MAIN) + pborder; - LV_ASSERT_OBJ(parent, MY_CLASS); - - int32_t pleft = lv_obj_get_style_space_left(parent, LV_PART_MAIN); - int32_t ptop = lv_obj_get_style_space_top(parent, LV_PART_MAIN); - - int32_t bleft = lv_obj_get_style_space_left(base, LV_PART_MAIN); - int32_t btop = lv_obj_get_style_space_top(base, LV_PART_MAIN); + lv_coord_t bborder = lv_obj_get_style_border_width(base, LV_PART_MAIN); + lv_coord_t bleft = lv_obj_get_style_pad_left(base, LV_PART_MAIN) + bborder; + lv_coord_t btop = lv_obj_get_style_pad_top(base, LV_PART_MAIN) + bborder; if(align == LV_ALIGN_DEFAULT) { if(lv_obj_get_style_base_dir(base, LV_PART_MAIN) == LV_BASE_DIR_RTL) align = LV_ALIGN_TOP_RIGHT; @@ -355,12 +373,10 @@ void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, in x = lv_obj_get_content_width(base) / 2 - lv_obj_get_width(obj) / 2 + bleft; y = lv_obj_get_content_height(base) / 2 - lv_obj_get_height(obj) / 2 + btop; break; - case LV_ALIGN_TOP_LEFT: x = bleft; y = btop; break; - case LV_ALIGN_TOP_MID: x = lv_obj_get_content_width(base) / 2 - lv_obj_get_width(obj) / 2 + bleft; y = btop; @@ -454,13 +470,8 @@ void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, in x = lv_obj_get_width(base); y = lv_obj_get_height(base) - lv_obj_get_height(obj); break; - - case LV_ALIGN_DEFAULT: - break; } - if(LV_COORD_IS_PCT(x_ofs)) x_ofs = (lv_obj_get_width(base) * LV_COORD_GET_PCT(x_ofs)) / 100; - if(LV_COORD_IS_PCT(y_ofs)) y_ofs = (lv_obj_get_height(base) * LV_COORD_GET_PCT(y_ofs)) / 100; if(lv_obj_get_style_base_dir(parent, LV_PART_MAIN) == LV_BASE_DIR_RTL) { x += x_ofs + base->coords.x1 - parent->coords.x1 + lv_obj_get_scroll_right(parent) - pleft; } @@ -480,16 +491,17 @@ void lv_obj_get_coords(const lv_obj_t * obj, lv_area_t * coords) lv_area_copy(coords, &obj->coords); } -int32_t lv_obj_get_x(const lv_obj_t * obj) +lv_coord_t lv_obj_get_x(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - int32_t rel_x; + lv_coord_t rel_x; lv_obj_t * parent = lv_obj_get_parent(obj); if(parent) { rel_x = obj->coords.x1 - parent->coords.x1; rel_x += lv_obj_get_scroll_x(parent); - rel_x -= lv_obj_get_style_space_left(parent, LV_PART_MAIN); + rel_x -= lv_obj_get_style_pad_left(parent, LV_PART_MAIN); + rel_x -= lv_obj_get_style_border_width(parent, LV_PART_MAIN); } else { rel_x = obj->coords.x1; @@ -497,23 +509,24 @@ int32_t lv_obj_get_x(const lv_obj_t * obj) return rel_x; } -int32_t lv_obj_get_x2(const lv_obj_t * obj) +lv_coord_t lv_obj_get_x2(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return lv_obj_get_x(obj) + lv_obj_get_width(obj); } -int32_t lv_obj_get_y(const lv_obj_t * obj) +lv_coord_t lv_obj_get_y(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - int32_t rel_y; + lv_coord_t rel_y; lv_obj_t * parent = lv_obj_get_parent(obj); if(parent) { rel_y = obj->coords.y1 - parent->coords.y1; rel_y += lv_obj_get_scroll_y(parent); - rel_y -= lv_obj_get_style_space_top(parent, LV_PART_MAIN); + rel_y -= lv_obj_get_style_pad_top(parent, LV_PART_MAIN); + rel_y -= lv_obj_get_style_border_width(parent, LV_PART_MAIN); } else { rel_y = obj->coords.y1; @@ -521,87 +534,92 @@ int32_t lv_obj_get_y(const lv_obj_t * obj) return rel_y; } -int32_t lv_obj_get_y2(const lv_obj_t * obj) +lv_coord_t lv_obj_get_y2(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return lv_obj_get_y(obj) + lv_obj_get_height(obj); } -int32_t lv_obj_get_x_aligned(const lv_obj_t * obj) +lv_coord_t lv_obj_get_x_aligned(const lv_obj_t * obj) { return lv_obj_get_style_x(obj, LV_PART_MAIN); } -int32_t lv_obj_get_y_aligned(const lv_obj_t * obj) +lv_coord_t lv_obj_get_y_aligned(const lv_obj_t * obj) { return lv_obj_get_style_y(obj, LV_PART_MAIN); } -int32_t lv_obj_get_width(const lv_obj_t * obj) + +lv_coord_t lv_obj_get_width(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return lv_area_get_width(&obj->coords); } -int32_t lv_obj_get_height(const lv_obj_t * obj) +lv_coord_t lv_obj_get_height(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return lv_area_get_height(&obj->coords); } -int32_t lv_obj_get_content_width(const lv_obj_t * obj) +lv_coord_t lv_obj_get_content_width(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - int32_t left = lv_obj_get_style_space_left(obj, LV_PART_MAIN); - int32_t right = lv_obj_get_style_space_right(obj, LV_PART_MAIN); + lv_coord_t left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - return lv_obj_get_width(obj) - left - right; + return lv_obj_get_width(obj) - left - right - 2 * border_width; } -int32_t lv_obj_get_content_height(const lv_obj_t * obj) +lv_coord_t lv_obj_get_content_height(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - int32_t top = lv_obj_get_style_space_top(obj, LV_PART_MAIN); - int32_t bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN); + lv_coord_t top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - return lv_obj_get_height(obj) - top - bottom; + return lv_obj_get_height(obj) - top - bottom - 2 * border_width; } void lv_obj_get_content_coords(const lv_obj_t * obj, lv_area_t * area) { LV_ASSERT_OBJ(obj, MY_CLASS); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); lv_obj_get_coords(obj, area); - area->x1 += lv_obj_get_style_space_left(obj, LV_PART_MAIN); - area->x2 -= lv_obj_get_style_space_right(obj, LV_PART_MAIN); - area->y1 += lv_obj_get_style_space_top(obj, LV_PART_MAIN); - area->y2 -= lv_obj_get_style_space_bottom(obj, LV_PART_MAIN); + lv_area_increase(area, -border_width, -border_width); + area->x1 += lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + area->x2 -= lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + area->y1 += lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + area->y2 -= lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); } -int32_t lv_obj_get_self_width(const lv_obj_t * obj) +lv_coord_t lv_obj_get_self_width(const lv_obj_t * obj) { lv_point_t p = {0, LV_COORD_MIN}; - lv_obj_send_event((lv_obj_t *)obj, LV_EVENT_GET_SELF_SIZE, &p); + lv_event_send((lv_obj_t *)obj, LV_EVENT_GET_SELF_SIZE, &p); return p.x; } -int32_t lv_obj_get_self_height(const lv_obj_t * obj) +lv_coord_t lv_obj_get_self_height(const lv_obj_t * obj) { lv_point_t p = {LV_COORD_MIN, 0}; - lv_obj_send_event((lv_obj_t *)obj, LV_EVENT_GET_SELF_SIZE, &p); + lv_event_send((lv_obj_t *)obj, LV_EVENT_GET_SELF_SIZE, &p); return p.y; } bool lv_obj_refresh_self_size(lv_obj_t * obj) { - int32_t w_set = lv_obj_get_style_width(obj, LV_PART_MAIN); - int32_t h_set = lv_obj_get_style_height(obj, LV_PART_MAIN); + lv_coord_t w_set = lv_obj_get_style_width(obj, LV_PART_MAIN); + lv_coord_t h_set = lv_obj_get_style_height(obj, LV_PART_MAIN); if(w_set != LV_SIZE_CONTENT && h_set != LV_SIZE_CONTENT) return false; lv_obj_mark_layout_as_dirty(obj); @@ -612,9 +630,10 @@ void lv_obj_refr_pos(lv_obj_t * obj) { if(lv_obj_is_layout_positioned(obj)) return; + lv_obj_t * parent = lv_obj_get_parent(obj); - int32_t x = lv_obj_get_style_x(obj, LV_PART_MAIN); - int32_t y = lv_obj_get_style_y(obj, LV_PART_MAIN); + lv_coord_t x = lv_obj_get_style_x(obj, LV_PART_MAIN); + lv_coord_t y = lv_obj_get_style_y(obj, LV_PART_MAIN); if(parent == NULL) { lv_obj_move_to(obj, x, y); @@ -622,16 +641,16 @@ void lv_obj_refr_pos(lv_obj_t * obj) } /*Handle percentage value*/ - int32_t pw = lv_obj_get_content_width(parent); - int32_t ph = lv_obj_get_content_height(parent); + lv_coord_t pw = lv_obj_get_content_width(parent); + lv_coord_t ph = lv_obj_get_content_height(parent); if(LV_COORD_IS_PCT(x)) x = (pw * LV_COORD_GET_PCT(x)) / 100; if(LV_COORD_IS_PCT(y)) y = (ph * LV_COORD_GET_PCT(y)) / 100; /*Handle percentage value of translate*/ - int32_t tr_x = lv_obj_get_style_translate_x(obj, LV_PART_MAIN); - int32_t tr_y = lv_obj_get_style_translate_y(obj, LV_PART_MAIN); - int32_t w = lv_obj_get_width(obj); - int32_t h = lv_obj_get_height(obj); + lv_coord_t tr_x = lv_obj_get_style_translate_x(obj, LV_PART_MAIN); + lv_coord_t tr_y = lv_obj_get_style_translate_y(obj, LV_PART_MAIN); + lv_coord_t w = lv_obj_get_width(obj); + lv_coord_t h = lv_obj_get_height(obj); if(LV_COORD_IS_PCT(tr_x)) tr_x = (w * LV_COORD_GET_PCT(tr_x)) / 100; if(LV_COORD_IS_PCT(tr_y)) tr_y = (h * LV_COORD_GET_PCT(tr_y)) / 100; @@ -646,61 +665,68 @@ void lv_obj_refr_pos(lv_obj_t * obj) else align = LV_ALIGN_TOP_LEFT; } - switch(align) { - case LV_ALIGN_TOP_LEFT: - break; - case LV_ALIGN_TOP_MID: - x += pw / 2 - w / 2; - break; - case LV_ALIGN_TOP_RIGHT: - x += pw - w; - break; - case LV_ALIGN_LEFT_MID: - y += ph / 2 - h / 2; - break; - case LV_ALIGN_BOTTOM_LEFT: - y += ph - h; - break; - case LV_ALIGN_BOTTOM_MID: - x += pw / 2 - w / 2; - y += ph - h; - break; - case LV_ALIGN_BOTTOM_RIGHT: - x += pw - w; - y += ph - h; - break; - case LV_ALIGN_RIGHT_MID: - x += pw - w; - y += ph / 2 - h / 2; - break; - case LV_ALIGN_CENTER: - x += pw / 2 - w / 2; - y += ph / 2 - h / 2; - break; - default: - break; + if(align == LV_ALIGN_TOP_LEFT) { + lv_obj_move_to(obj, x, y); } + else { - lv_obj_move_to(obj, x, y); + switch(align) { + case LV_ALIGN_TOP_MID: + x += pw / 2 - w / 2; + break; + case LV_ALIGN_TOP_RIGHT: + x += pw - w; + break; + case LV_ALIGN_LEFT_MID: + y += ph / 2 - h / 2; + break; + case LV_ALIGN_BOTTOM_LEFT: + y += ph - h; + break; + case LV_ALIGN_BOTTOM_MID: + x += pw / 2 - w / 2; + y += ph - h; + break; + case LV_ALIGN_BOTTOM_RIGHT: + x += pw - w; + y += ph - h; + break; + case LV_ALIGN_RIGHT_MID: + x += pw - w; + y += ph / 2 - h / 2; + break; + case LV_ALIGN_CENTER: + x += pw / 2 - w / 2; + y += ph / 2 - h / 2; + break; + default: + break; + } + lv_obj_move_to(obj, x, y); + } } -void lv_obj_move_to(lv_obj_t * obj, int32_t x, int32_t y) +void lv_obj_move_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y) { /*Convert x and y to absolute coordinates*/ lv_obj_t * parent = obj->parent; if(parent) { + lv_coord_t pad_left = lv_obj_get_style_pad_left(parent, LV_PART_MAIN); + lv_coord_t pad_top = lv_obj_get_style_pad_top(parent, LV_PART_MAIN); + if(lv_obj_has_flag(obj, LV_OBJ_FLAG_FLOATING)) { - x += parent->coords.x1; - y += parent->coords.y1; + x += pad_left + parent->coords.x1; + y += pad_top + parent->coords.y1; } else { - x += parent->coords.x1 - lv_obj_get_scroll_x(parent); - y += parent->coords.y1 - lv_obj_get_scroll_y(parent); + x += pad_left + parent->coords.x1 - lv_obj_get_scroll_x(parent); + y += pad_top + parent->coords.y1 - lv_obj_get_scroll_y(parent); } - x += lv_obj_get_style_space_left(parent, LV_PART_MAIN); - y += lv_obj_get_style_space_top(parent, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(parent, LV_PART_MAIN); + x += border_width; + y += border_width; } /*Calculate and set the movement*/ @@ -728,7 +754,7 @@ void lv_obj_move_to(lv_obj_t * obj, int32_t x, int32_t y) /*If the object is already out of the parent and its position is changes *surely the scrollbars also changes so invalidate them*/ - on1 = lv_area_is_in(&ori, &parent_fit_area, 0); + on1 = _lv_area_is_in(&ori, &parent_fit_area, 0); if(!on1) lv_obj_scrollbar_invalidate(parent); } @@ -740,23 +766,23 @@ void lv_obj_move_to(lv_obj_t * obj, int32_t x, int32_t y) lv_obj_move_children_by(obj, diff.x, diff.y, false); /*Call the ancestor's event handler to the parent too*/ - if(parent) lv_obj_send_event(parent, LV_EVENT_CHILD_CHANGED, obj); + if(parent) lv_event_send(parent, LV_EVENT_CHILD_CHANGED, obj); /*Invalidate the new area*/ lv_obj_invalidate(obj); /*If the object was out of the parent invalidate the new scrollbar area too. - *If it wasn't out of the parent but out now, also invalidate the scrollbars*/ + *If it wasn't out of the parent but out now, also invalidate the srollbars*/ if(parent) { - bool on2 = lv_area_is_in(&obj->coords, &parent_fit_area, 0); + bool on2 = _lv_area_is_in(&obj->coords, &parent_fit_area, 0); if(on1 || (!on1 && on2)) lv_obj_scrollbar_invalidate(parent); } } -void lv_obj_move_children_by(lv_obj_t * obj, int32_t x_diff, int32_t y_diff, bool ignore_floating) +void lv_obj_move_children_by(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff, bool ignore_floating) { uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); for(i = 0; i < child_cnt; i++) { lv_obj_t * child = obj->spec_attr->children[i]; if(ignore_floating && lv_obj_has_flag(child, LV_OBJ_FLAG_FLOATING)) continue; @@ -769,73 +795,57 @@ void lv_obj_move_children_by(lv_obj_t * obj, int32_t x_diff, int32_t y_diff, boo } } -void lv_obj_transform_point(const lv_obj_t * obj, lv_point_t * p, lv_obj_point_transform_flag_t flags) -{ - lv_obj_transform_point_array(obj, p, 1, flags); -} - -void lv_obj_transform_point_array(const lv_obj_t * obj, lv_point_t points[], size_t count, - lv_obj_point_transform_flag_t flags) +void lv_obj_transform_point(const lv_obj_t * obj, lv_point_t * p, bool recursive, bool inv) { if(obj) { - lv_layer_type_t layer_type = lv_obj_get_layer_type(obj); + lv_layer_type_t layer_type = _lv_obj_get_layer_type(obj); bool do_tranf = layer_type == LV_LAYER_TYPE_TRANSFORM; - bool recursive = flags & LV_OBJ_POINT_TRANSFORM_FLAG_RECURSIVE; - bool inverse = flags & LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE; - if(inverse) { - if(recursive) lv_obj_transform_point_array(lv_obj_get_parent(obj), points, count, flags); - if(do_tranf) transform_point_array(obj, points, count, inverse); + if(inv) { + if(recursive) lv_obj_transform_point(lv_obj_get_parent(obj), p, recursive, inv); + if(do_tranf) transform_point(obj, p, inv); } else { - if(do_tranf) transform_point_array(obj, points, count, inverse); - if(recursive) lv_obj_transform_point_array(lv_obj_get_parent(obj), points, count, flags); + if(do_tranf) transform_point(obj, p, inv); + if(recursive) lv_obj_transform_point(lv_obj_get_parent(obj), p, recursive, inv); } } } -void lv_obj_get_transformed_area(const lv_obj_t * obj, lv_area_t * area, lv_obj_point_transform_flag_t flags) +void lv_obj_get_transformed_area(const lv_obj_t * obj, lv_area_t * area, bool recursive, + bool inv) { lv_point_t p[4] = { {area->x1, area->y1}, - {area->x1, area->y2 + 1}, - {area->x2 + 1, area->y1}, - {area->x2 + 1, area->y2 + 1}, + {area->x1, area->y2}, + {area->x2, area->y1}, + {area->x2, area->y2}, }; - lv_obj_transform_point_array(obj, p, 4, flags); + lv_obj_transform_point(obj, &p[0], recursive, inv); + lv_obj_transform_point(obj, &p[1], recursive, inv); + lv_obj_transform_point(obj, &p[2], recursive, inv); + lv_obj_transform_point(obj, &p[3], recursive, inv); area->x1 = LV_MIN4(p[0].x, p[1].x, p[2].x, p[3].x); area->x2 = LV_MAX4(p[0].x, p[1].x, p[2].x, p[3].x); area->y1 = LV_MIN4(p[0].y, p[1].y, p[2].y, p[3].y); area->y2 = LV_MAX4(p[0].y, p[1].y, p[2].y, p[3].y); + lv_area_increase(area, 5, 5); } + void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_display_t * disp = lv_obj_get_display(obj); - if(!lv_display_is_invalidation_enabled(disp)) return; + lv_disp_t * disp = lv_obj_get_disp(obj); + if(!lv_disp_is_invalidation_enabled(disp)) return; lv_area_t area_tmp; lv_area_copy(&area_tmp, area); - if(!lv_obj_area_is_visible(obj, &area_tmp)) return; -#if LV_DRAW_TRANSFORM_USE_MATRIX - /** - * When using the global matrix, the vertex coordinates of clip_area lose precision after transformation, - * which can be solved by expanding the redrawing area. - */ - lv_area_increase(&area_tmp, 5, 5); -#else - if(obj->spec_attr && obj->spec_attr->layer_type == LV_LAYER_TYPE_TRANSFORM) { - /*Make the area slightly larger to avoid rounding errors. - *5 is an empirical value*/ - lv_area_increase(&area_tmp, 5, 5); - } -#endif - lv_inv_area(lv_obj_get_display(obj), &area_tmp); + _lv_inv_area(lv_obj_get_disp(obj), &area_tmp); } void lv_obj_invalidate(const lv_obj_t * obj) @@ -844,7 +854,7 @@ void lv_obj_invalidate(const lv_obj_t * obj) /*Truncate the area to the object*/ lv_area_t obj_coords; - int32_t ext_size = lv_obj_get_ext_draw_size(obj); + lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj); lv_area_copy(&obj_coords, &obj->coords); obj_coords.x1 -= ext_size; obj_coords.y1 -= ext_size; @@ -852,6 +862,7 @@ void lv_obj_invalidate(const lv_obj_t * obj) obj_coords.y2 += ext_size; lv_obj_invalidate_area(obj, &obj_coords); + } bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area) @@ -860,43 +871,45 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area) /*Invalidate the object only if it belongs to the current or previous or one of the layers'*/ lv_obj_t * obj_scr = lv_obj_get_screen(obj); - lv_display_t * disp = lv_obj_get_display(obj_scr); - if(obj_scr != lv_display_get_screen_active(disp) && - obj_scr != lv_display_get_screen_prev(disp) && - obj_scr != lv_display_get_layer_bottom(disp) && - obj_scr != lv_display_get_layer_top(disp) && - obj_scr != lv_display_get_layer_sys(disp)) { + lv_disp_t * disp = lv_obj_get_disp(obj_scr); + if(obj_scr != lv_disp_get_scr_act(disp) && + obj_scr != lv_disp_get_scr_prev(disp) && + obj_scr != lv_disp_get_layer_top(disp) && + obj_scr != lv_disp_get_layer_sys(disp)) { return false; } /*Truncate the area to the object*/ - lv_area_t obj_coords; - int32_t ext_size = lv_obj_get_ext_draw_size(obj); - lv_area_copy(&obj_coords, &obj->coords); - lv_area_increase(&obj_coords, ext_size, ext_size); + if(!lv_obj_has_flag_any(obj, LV_OBJ_FLAG_OVERFLOW_VISIBLE)) { + lv_area_t obj_coords; + lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj); + lv_area_copy(&obj_coords, &obj->coords); + obj_coords.x1 -= ext_size; + obj_coords.y1 -= ext_size; + obj_coords.x2 += ext_size; + obj_coords.y2 += ext_size; + + /*The area is not on the object*/ + if(!_lv_area_intersect(area, area, &obj_coords)) return false; + } - /*The area is not on the object*/ - if(!lv_area_intersect(area, area, &obj_coords)) return false; + lv_obj_get_transformed_area(obj, area, true, false); - lv_obj_get_transformed_area(obj, area, LV_OBJ_POINT_TRANSFORM_FLAG_RECURSIVE); /*Truncate recursively to the parents*/ - lv_obj_t * parent = lv_obj_get_parent(obj); - while(parent != NULL) { + lv_obj_t * par = lv_obj_get_parent(obj); + while(par != NULL) { /*If the parent is hidden then the child is hidden and won't be drawn*/ - if(lv_obj_has_flag(parent, LV_OBJ_FLAG_HIDDEN)) return false; + if(lv_obj_has_flag(par, LV_OBJ_FLAG_HIDDEN)) return false; /*Truncate to the parent and if no common parts break*/ - lv_area_t parent_coords = parent->coords; - if(lv_obj_has_flag(parent, LV_OBJ_FLAG_OVERFLOW_VISIBLE)) { - int32_t parent_ext_size = lv_obj_get_ext_draw_size(parent); - lv_area_increase(&parent_coords, parent_ext_size, parent_ext_size); + if(!lv_obj_has_flag_any(par, LV_OBJ_FLAG_OVERFLOW_VISIBLE)) { + lv_area_t par_area = par->coords; + lv_obj_get_transformed_area(par, &par_area, true, false); + if(!_lv_area_intersect(area, area, &par_area)) return false; } - lv_obj_get_transformed_area(parent, &parent_coords, LV_OBJ_POINT_TRANSFORM_FLAG_RECURSIVE); - if(!lv_area_intersect(area, area, &parent_coords)) return false; - - parent = lv_obj_get_parent(parent); + par = lv_obj_get_parent(par); } return true; @@ -907,7 +920,7 @@ bool lv_obj_is_visible(const lv_obj_t * obj) LV_ASSERT_OBJ(obj, MY_CLASS); lv_area_t obj_coords; - int32_t ext_size = lv_obj_get_ext_draw_size(obj); + lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj); lv_area_copy(&obj_coords, &obj->coords); obj_coords.x1 -= ext_size; obj_coords.y1 -= ext_size; @@ -915,9 +928,10 @@ bool lv_obj_is_visible(const lv_obj_t * obj) obj_coords.y2 += ext_size; return lv_obj_area_is_visible(obj, &obj_coords); + } -void lv_obj_set_ext_click_area(lv_obj_t * obj, int32_t size) +void lv_obj_set_ext_click_area(lv_obj_t * obj, lv_coord_t size) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -929,71 +943,71 @@ void lv_obj_get_click_area(const lv_obj_t * obj, lv_area_t * area) { lv_area_copy(area, &obj->coords); if(obj->spec_attr) { - lv_area_increase(area, obj->spec_attr->ext_click_pad, obj->spec_attr->ext_click_pad); + area->x1 -= obj->spec_attr->ext_click_pad; + area->x2 += obj->spec_attr->ext_click_pad; + area->y1 -= obj->spec_attr->ext_click_pad; + area->y2 += obj->spec_attr->ext_click_pad; } } bool lv_obj_hit_test(lv_obj_t * obj, const lv_point_t * point) { if(!lv_obj_has_flag(obj, LV_OBJ_FLAG_CLICKABLE)) return false; + if(lv_obj_has_state(obj, LV_STATE_DISABLED)) return false; lv_area_t a; lv_obj_get_click_area(obj, &a); - bool res = lv_area_is_point_on(&a, point, 0); + bool res = _lv_area_is_point_on(&a, point, 0); if(res == false) return false; if(lv_obj_has_flag(obj, LV_OBJ_FLAG_ADV_HITTEST)) { lv_hit_test_info_t hit_info; hit_info.point = point; hit_info.res = true; - lv_obj_send_event(obj, LV_EVENT_HIT_TEST, &hit_info); + lv_event_send(obj, LV_EVENT_HIT_TEST, &hit_info); return hit_info.res; } return res; } -int32_t lv_clamp_width(int32_t width, int32_t min_width, int32_t max_width, int32_t ref_width) +lv_coord_t lv_clamp_width(lv_coord_t width, lv_coord_t min_width, lv_coord_t max_width, lv_coord_t ref_width) { if(LV_COORD_IS_PCT(min_width)) min_width = (ref_width * LV_COORD_GET_PCT(min_width)) / 100; if(LV_COORD_IS_PCT(max_width)) max_width = (ref_width * LV_COORD_GET_PCT(max_width)) / 100; return LV_CLAMP(min_width, width, max_width); } -int32_t lv_clamp_height(int32_t height, int32_t min_height, int32_t max_height, int32_t ref_height) +lv_coord_t lv_clamp_height(lv_coord_t height, lv_coord_t min_height, lv_coord_t max_height, lv_coord_t ref_height) { if(LV_COORD_IS_PCT(min_height)) min_height = (ref_height * LV_COORD_GET_PCT(min_height)) / 100; if(LV_COORD_IS_PCT(max_height)) max_height = (ref_height * LV_COORD_GET_PCT(max_height)) / 100; return LV_CLAMP(min_height, height, max_height); } -void lv_obj_center(lv_obj_t * obj) -{ - lv_obj_align(obj, LV_ALIGN_CENTER, 0, 0); -} + /********************** * STATIC FUNCTIONS **********************/ -static int32_t calc_content_width(lv_obj_t * obj) +static lv_coord_t calc_content_width(lv_obj_t * obj) { - int32_t scroll_x_tmp = lv_obj_get_scroll_x(obj); - if(obj->spec_attr) obj->spec_attr->scroll.x = 0; + lv_obj_scroll_to_x(obj, 0, LV_ANIM_OFF); - int32_t space_right = lv_obj_get_style_space_right(obj, LV_PART_MAIN); - int32_t space_left = lv_obj_get_style_space_left(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t pad_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN) + border_width; + lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; - int32_t self_w; - self_w = lv_obj_get_self_width(obj) + space_left + space_right; + lv_coord_t self_w; + self_w = lv_obj_get_self_width(obj) + pad_left + pad_right; - int32_t child_res = LV_COORD_MIN; + lv_coord_t child_res = LV_COORD_MIN; uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); /*With RTL find the left most coordinate*/ if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) == LV_BASE_DIR_RTL) { for(i = 0; i < child_cnt; i++) { - int32_t child_res_tmp = LV_COORD_MIN; lv_obj_t * child = obj->spec_attr->children[i]; if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; @@ -1005,31 +1019,27 @@ static int32_t calc_content_width(lv_obj_t * obj) case LV_ALIGN_BOTTOM_RIGHT: case LV_ALIGN_RIGHT_MID: /*Normal right aligns. Other are ignored due to possible circular dependencies*/ - child_res_tmp = obj->coords.x2 - child->coords.x1 + 1; + child_res = LV_MAX(child_res, obj->coords.x2 - child->coords.x1 + 1); break; default: /* Consider other cases only if x=0 and use the width of the object. * With x!=0 circular dependency could occur. */ if(lv_obj_get_style_x(child, 0) == 0) { - child_res_tmp = lv_area_get_width(&child->coords) + space_right; - child_res_tmp += lv_obj_get_style_margin_left(child, LV_PART_MAIN); + child_res = LV_MAX(child_res, lv_area_get_width(&child->coords) + pad_right); } - break; } } else { - child_res_tmp = obj->coords.x2 - child->coords.x1 + 1; + child_res = LV_MAX(child_res, obj->coords.x2 - child->coords.x1 + 1); } - child_res = LV_MAX(child_res, child_res_tmp + lv_obj_get_style_margin_left(child, LV_PART_MAIN)); } if(child_res != LV_COORD_MIN) { - child_res += space_left; + child_res += pad_left; } } /*Else find the right most coordinate*/ else { for(i = 0; i < child_cnt; i++) { - int32_t child_res_tmp = LV_COORD_MIN; lv_obj_t * child = obj->spec_attr->children[i]; if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; @@ -1041,55 +1051,49 @@ static int32_t calc_content_width(lv_obj_t * obj) case LV_ALIGN_BOTTOM_LEFT: case LV_ALIGN_LEFT_MID: /*Normal left aligns.*/ - child_res_tmp = child->coords.x2 - obj->coords.x1 + 1; + child_res = LV_MAX(child_res, child->coords.x2 - obj->coords.x1 + 1); break; default: /* Consider other cases only if x=0 and use the width of the object. * With x!=0 circular dependency could occur. */ - if(lv_obj_get_style_x(child, 0) == 0) { - child_res_tmp = lv_area_get_width(&child->coords) + space_left; - child_res_tmp += lv_obj_get_style_margin_right(child, LV_PART_MAIN); + if(lv_obj_get_style_y(child, 0) == 0) { + child_res = LV_MAX(child_res, lv_area_get_width(&child->coords) + pad_left); } - break; } } else { - child_res_tmp = child->coords.x2 - obj->coords.x1 + 1; + child_res = LV_MAX(child_res, child->coords.x2 - obj->coords.x1 + 1); } - - child_res = LV_MAX(child_res, child_res_tmp + lv_obj_get_style_margin_right(child, LV_PART_MAIN)); } if(child_res != LV_COORD_MIN) { - child_res += space_right; + child_res += pad_right; } } - if(obj->spec_attr) obj->spec_attr->scroll.x = -scroll_x_tmp; - if(child_res == LV_COORD_MIN) return self_w; - return LV_MAX(child_res, self_w); + else return LV_MAX(child_res, self_w); } -static int32_t calc_content_height(lv_obj_t * obj) +static lv_coord_t calc_content_height(lv_obj_t * obj) { - int32_t scroll_y_tmp = lv_obj_get_scroll_y(obj); - if(obj->spec_attr) obj->spec_attr->scroll.y = 0; + lv_obj_scroll_to_y(obj, 0, LV_ANIM_OFF); - int32_t space_top = lv_obj_get_style_space_top(obj, LV_PART_MAIN); - int32_t space_bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; + lv_coord_t pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN) + border_width; - int32_t self_h; - self_h = lv_obj_get_self_height(obj) + space_top + space_bottom; + lv_coord_t self_h; + self_h = lv_obj_get_self_height(obj) + pad_top + pad_bottom; - int32_t child_res = LV_COORD_MIN; + lv_coord_t child_res = LV_COORD_MIN; uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); for(i = 0; i < child_cnt; i++) { - int32_t child_res_tmp = LV_COORD_MIN; lv_obj_t * child = obj->spec_attr->children[i]; if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; + if(!lv_obj_is_layout_positioned(child)) { lv_align_t align = lv_obj_get_style_align(child, 0); switch(align) { @@ -1098,35 +1102,36 @@ static int32_t calc_content_height(lv_obj_t * obj) case LV_ALIGN_TOP_MID: case LV_ALIGN_TOP_LEFT: /*Normal top aligns. */ - child_res_tmp = child->coords.y2 - obj->coords.y1 + 1; + child_res = LV_MAX(child_res, child->coords.y2 - obj->coords.y1 + 1); break; default: /* Consider other cases only if y=0 and use the height of the object. * With y!=0 circular dependency could occur. */ if(lv_obj_get_style_y(child, 0) == 0) { - child_res_tmp = lv_area_get_height(&child->coords) + space_top; - child_res_tmp += lv_obj_get_style_margin_top(child, LV_PART_MAIN); + child_res = LV_MAX(child_res, lv_area_get_height(&child->coords) + pad_top); } break; } } else { - child_res_tmp = child->coords.y2 - obj->coords.y1 + 1; + child_res = LV_MAX(child_res, child->coords.y2 - obj->coords.y1 + 1); } - - child_res = LV_MAX(child_res, child_res_tmp + lv_obj_get_style_margin_bottom(child, LV_PART_MAIN)); } - if(obj->spec_attr) obj->spec_attr->scroll.y = -scroll_y_tmp; + if(child_res != LV_COORD_MIN) { + child_res += pad_bottom; + return LV_MAX(child_res, self_h); + } + else { + return self_h; + } - if(child_res == LV_COORD_MIN) return self_h; - return LV_MAX(self_h, child_res + space_bottom); } static void layout_update_core(lv_obj_t * obj) { uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); for(i = 0; i < child_cnt; i++) { lv_obj_t * child = obj->spec_attr->children[i]; layout_update_core(child); @@ -1138,7 +1143,11 @@ static void layout_update_core(lv_obj_t * obj) lv_obj_refr_pos(obj); if(child_cnt > 0) { - lv_layout_apply(obj); + uint32_t layout_id = lv_obj_get_style_layout(obj, LV_PART_MAIN); + if(layout_id > 0 && layout_id <= layout_cnt) { + void * user_data = LV_GC_ROOT(_lv_layout_list)[layout_id - 1].user_data; + LV_GC_ROOT(_lv_layout_list)[layout_id - 1].cb(obj, user_data); + } } } @@ -1148,15 +1157,12 @@ static void layout_update_core(lv_obj_t * obj) } } -static void transform_point_array(const lv_obj_t * obj, lv_point_t * p, size_t p_count, bool inv) +static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv) { - int32_t angle = lv_obj_get_style_transform_rotation(obj, 0); - int32_t scale_x = lv_obj_get_style_transform_scale_x_safe(obj, 0); - int32_t scale_y = lv_obj_get_style_transform_scale_y_safe(obj, 0); - if(scale_x == 0) scale_x = 1; - if(scale_y == 0) scale_y = 1; + int16_t angle = lv_obj_get_style_transform_angle(obj, 0); + int16_t zoom = lv_obj_get_style_transform_zoom(obj, 0); - if(angle == 0 && scale_x == LV_SCALE_NONE && scale_y == LV_SCALE_NONE) return; + if(angle == 0 && zoom == LV_IMG_ZOOM_NONE) return; lv_point_t pivot = { .x = lv_obj_get_style_transform_pivot_x(obj, 0), @@ -1175,9 +1181,8 @@ static void transform_point_array(const lv_obj_t * obj, lv_point_t * p, size_t p if(inv) { angle = -angle; - scale_x = (256 * 256 + scale_x - 1) / scale_x; - scale_y = (256 * 256 + scale_y - 1) / scale_y; + zoom = (256 * 256) / zoom; } - lv_point_array_transform(p, p_count, angle, scale_x, scale_y, &pivot, !inv); + lv_point_transform(p, angle, zoom, &pivot); } diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_pos.h b/L3_Middlewares/LVGL/src/core/lv_obj_pos.h index 584f0b7..d20ee96 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_pos.h +++ b/L3_Middlewares/LVGL/src/core/lv_obj_pos.h @@ -22,20 +22,13 @@ extern "C" { /********************** * TYPEDEFS **********************/ +struct _lv_obj_t; -typedef enum { - /** No flags */ - LV_OBJ_POINT_TRANSFORM_FLAG_NONE = 0x00, - - /** Consider the transformation properties of the parents too */ - LV_OBJ_POINT_TRANSFORM_FLAG_RECURSIVE = 0x01, - - /** Execute the inverse of the transformation (-angle and 1/zoom) */ - LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE = 0x02, - - /** Both inverse and recursive*/ - LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE_RECURSIVE = 0x03, -} lv_obj_point_transform_flag_t; +typedef void (*lv_layout_update_cb_t)(struct _lv_obj_t *, void * user_data); +typedef struct { + lv_layout_update_cb_t cb; + void * user_data; +} lv_layout_dsc_t; /********************** * GLOBAL PROTOTYPES @@ -51,7 +44,7 @@ typedef enum { * @note The position is interpreted on the content area of the parent * @note The values can be set in pixel or in percentage of parent size with `lv_pct(v)` */ -void lv_obj_set_pos(lv_obj_t * obj, int32_t x, int32_t y); +void lv_obj_set_pos(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y); /** * Set the x coordinate of an object @@ -62,7 +55,7 @@ void lv_obj_set_pos(lv_obj_t * obj, int32_t x, int32_t y); * @note The position is interpreted on the content area of the parent * @note The values can be set in pixel or in percentage of parent size with `lv_pct(v)` */ -void lv_obj_set_x(lv_obj_t * obj, int32_t x); +void lv_obj_set_x(struct _lv_obj_t * obj, lv_coord_t x); /** * Set the y coordinate of an object @@ -73,7 +66,7 @@ void lv_obj_set_x(lv_obj_t * obj, int32_t x); * @note The position is interpreted on the content area of the parent * @note The values can be set in pixel or in percentage of parent size with `lv_pct(v)` */ -void lv_obj_set_y(lv_obj_t * obj, int32_t y); +void lv_obj_set_y(struct _lv_obj_t * obj, lv_coord_t y); /** * Set the size of an object. @@ -83,17 +76,17 @@ void lv_obj_set_y(lv_obj_t * obj, int32_t y); * @note possible values are: * pixel simple set the size accordingly * LV_SIZE_CONTENT set the size to involve all children in the given direction - * lv_pct(x) to set size in percentage of the parent's content area size (the size without paddings). + * LV_SIZE_PCT(x) to set size in percentage of the parent's content area size (the size without paddings). * x should be in [0..1000]% range */ -void lv_obj_set_size(lv_obj_t * obj, int32_t w, int32_t h); +void lv_obj_set_size(struct _lv_obj_t * obj, lv_coord_t w, lv_coord_t h); /** * Recalculate the size of the object * @param obj pointer to an object * @return true: the size has been changed */ -bool lv_obj_refr_size(lv_obj_t * obj); +bool lv_obj_refr_size(struct _lv_obj_t * obj); /** * Set the width of an object @@ -105,7 +98,7 @@ bool lv_obj_refr_size(lv_obj_t * obj); * lv_pct(x) to set size in percentage of the parent's content area size (the size without paddings). * x should be in [0..1000]% range */ -void lv_obj_set_width(lv_obj_t * obj, int32_t w); +void lv_obj_set_width(struct _lv_obj_t * obj, lv_coord_t w); /** * Set the height of an object @@ -117,54 +110,62 @@ void lv_obj_set_width(lv_obj_t * obj, int32_t w); * lv_pct(x) to set size in percentage of the parent's content area size (the size without paddings). * x should be in [0..1000]% range */ -void lv_obj_set_height(lv_obj_t * obj, int32_t h); +void lv_obj_set_height(struct _lv_obj_t * obj, lv_coord_t h); /** * Set the width reduced by the left and right padding and the border width. * @param obj pointer to an object * @param w the width without paddings in pixels */ -void lv_obj_set_content_width(lv_obj_t * obj, int32_t w); +void lv_obj_set_content_width(struct _lv_obj_t * obj, lv_coord_t w); /** * Set the height reduced by the top and bottom padding and the border width. * @param obj pointer to an object * @param h the height without paddings in pixels */ -void lv_obj_set_content_height(lv_obj_t * obj, int32_t h); +void lv_obj_set_content_height(struct _lv_obj_t * obj, lv_coord_t h); /** * Set a layout for an object * @param obj pointer to an object * @param layout pointer to a layout descriptor to set */ -void lv_obj_set_layout(lv_obj_t * obj, uint32_t layout); +void lv_obj_set_layout(struct _lv_obj_t * obj, uint32_t layout); /** * Test whether the and object is positioned by a layout or not * @param obj pointer to an object to test * @return true: positioned by a layout; false: not positioned by a layout */ -bool lv_obj_is_layout_positioned(const lv_obj_t * obj); +bool lv_obj_is_layout_positioned(const struct _lv_obj_t * obj); /** * Mark the object for layout update. * @param obj pointer to an object whose children needs to be updated */ -void lv_obj_mark_layout_as_dirty(lv_obj_t * obj); +void lv_obj_mark_layout_as_dirty(struct _lv_obj_t * obj); /** * Update the layout of an object. * @param obj pointer to an object whose children needs to be updated */ -void lv_obj_update_layout(const lv_obj_t * obj); +void lv_obj_update_layout(const struct _lv_obj_t * obj); + +/** + * Register a new layout + * @param cb the layout update callback + * @param user_data custom data that will be passed to `cb` + * @return the ID of the new layout + */ +uint32_t lv_layout_register(lv_layout_update_cb_t cb, void * user_data); /** * Change the alignment of an object. * @param obj pointer to an object to align * @param align type of alignment (see 'lv_align_t' enum) `LV_ALIGN_OUT_...` can't be used. */ -void lv_obj_set_align(lv_obj_t * obj, lv_align_t align); +void lv_obj_set_align(struct _lv_obj_t * obj, lv_align_t align); /** * Change the alignment of an object and set new coordinates. @@ -176,33 +177,37 @@ void lv_obj_set_align(lv_obj_t * obj, lv_align_t align); * @param x_ofs x coordinate offset after alignment * @param y_ofs y coordinate offset after alignment */ -void lv_obj_align(lv_obj_t * obj, lv_align_t align, int32_t x_ofs, int32_t y_ofs); +void lv_obj_align(struct _lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs); /** - * Align an object to another object. + * Align an object to an other object. * @param obj pointer to an object to align - * @param base pointer to another object (if NULL `obj`s parent is used). 'obj' will be aligned to it. + * @param base pointer to an other object (if NULL `obj`s parent is used). 'obj' will be aligned to it. * @param align type of alignment (see 'lv_align_t' enum) * @param x_ofs x coordinate offset after alignment * @param y_ofs y coordinate offset after alignment * @note if the position or size of `base` changes `obj` needs to be aligned manually again */ -void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, int32_t x_ofs, - int32_t y_ofs); +void lv_obj_align_to(struct _lv_obj_t * obj, const struct _lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, + lv_coord_t y_ofs); /** * Align an object to the center on its parent. * @param obj pointer to an object to align * @note if the parent size changes `obj` needs to be aligned manually again */ -void lv_obj_center(lv_obj_t * obj); +static inline void lv_obj_center(struct _lv_obj_t * obj) +{ + lv_obj_align(obj, LV_ALIGN_CENTER, 0, 0); +} + /** * Copy the coordinates of an object to an area * @param obj pointer to an object * @param coords pointer to an area to store the coordinates */ -void lv_obj_get_coords(const lv_obj_t * obj, lv_area_t * coords); +void lv_obj_get_coords(const struct _lv_obj_t * obj, lv_area_t * coords); /** * Get the x coordinate of object. @@ -214,7 +219,7 @@ void lv_obj_get_coords(const lv_obj_t * obj, lv_area_t * coords); * @note Scrolling of the parent doesn't change the returned value. * @note The returned value is always the distance from the parent even if `obj` is positioned by a layout. */ -int32_t lv_obj_get_x(const lv_obj_t * obj); +lv_coord_t lv_obj_get_x(const struct _lv_obj_t * obj); /** * Get the x2 coordinate of object. @@ -226,7 +231,7 @@ int32_t lv_obj_get_x(const lv_obj_t * obj); * @note Scrolling of the parent doesn't change the returned value. * @note The returned value is always the distance from the parent even if `obj` is positioned by a layout. */ -int32_t lv_obj_get_x2(const lv_obj_t * obj); +lv_coord_t lv_obj_get_x2(const struct _lv_obj_t * obj); /** * Get the y coordinate of object. @@ -238,7 +243,7 @@ int32_t lv_obj_get_x2(const lv_obj_t * obj); * @note Scrolling of the parent doesn't change the returned value. * @note The returned value is always the distance from the parent even if `obj` is positioned by a layout. */ -int32_t lv_obj_get_y(const lv_obj_t * obj); +lv_coord_t lv_obj_get_y(const struct _lv_obj_t * obj); /** * Get the y2 coordinate of object. @@ -250,21 +255,21 @@ int32_t lv_obj_get_y(const lv_obj_t * obj); * @note Scrolling of the parent doesn't change the returned value. * @note The returned value is always the distance from the parent even if `obj` is positioned by a layout. */ -int32_t lv_obj_get_y2(const lv_obj_t * obj); +lv_coord_t lv_obj_get_y2(const struct _lv_obj_t * obj); /** - * Get the actually set x coordinate of object, i.e. the offset from the set alignment + * Get the actually set x coordinate of object, i.e. the offset form the set alignment * @param obj pointer to an object * @return the set x coordinate */ -int32_t lv_obj_get_x_aligned(const lv_obj_t * obj); +lv_coord_t lv_obj_get_x_aligned(const struct _lv_obj_t * obj); /** - * Get the actually set y coordinate of object, i.e. the offset from the set alignment + * Get the actually set y coordinate of object, i.e. the offset form the set alignment * @param obj pointer to an object * @return the set y coordinate */ -int32_t lv_obj_get_y_aligned(const lv_obj_t * obj); +lv_coord_t lv_obj_get_y_aligned(const struct _lv_obj_t * obj); /** * Get the width of an object @@ -273,7 +278,7 @@ int32_t lv_obj_get_y_aligned(const lv_obj_t * obj); * call `lv_obj_update_layout(obj)`. * @return the width in pixels */ -int32_t lv_obj_get_width(const lv_obj_t * obj); +lv_coord_t lv_obj_get_width(const struct _lv_obj_t * obj); /** * Get the height of an object @@ -282,7 +287,7 @@ int32_t lv_obj_get_width(const lv_obj_t * obj); * call `lv_obj_update_layout(obj)`. * @return the height in pixels */ -int32_t lv_obj_get_height(const lv_obj_t * obj); +lv_coord_t lv_obj_get_height(const struct _lv_obj_t * obj); /** * Get the width reduced by the left and right padding and the border width. @@ -291,7 +296,7 @@ int32_t lv_obj_get_height(const lv_obj_t * obj); * call `lv_obj_update_layout(obj)`. * @return the width which still fits into its parent without causing overflow (making the parent scrollable) */ -int32_t lv_obj_get_content_width(const lv_obj_t * obj); +lv_coord_t lv_obj_get_content_width(const struct _lv_obj_t * obj); /** * Get the height reduced by the top and bottom padding and the border width. @@ -300,7 +305,7 @@ int32_t lv_obj_get_content_width(const lv_obj_t * obj); * call `lv_obj_update_layout(obj)`. * @return the height which still fits into the parent without causing overflow (making the parent scrollable) */ -int32_t lv_obj_get_content_height(const lv_obj_t * obj); +lv_coord_t lv_obj_get_content_height(const struct _lv_obj_t * obj); /** * Get the area reduced by the paddings and the border width. @@ -309,7 +314,7 @@ int32_t lv_obj_get_content_height(const lv_obj_t * obj); * call `lv_obj_update_layout(obj)`. * @param area the area which still fits into the parent without causing overflow (making the parent scrollable) */ -void lv_obj_get_content_coords(const lv_obj_t * obj, lv_area_t * area); +void lv_obj_get_content_coords(const struct _lv_obj_t * obj, lv_area_t * area); /** * Get the width occupied by the "parts" of the widget. E.g. the width of all columns of a table. @@ -318,7 +323,7 @@ void lv_obj_get_content_coords(const lv_obj_t * obj, lv_area_t * area); * @note This size independent from the real size of the widget. * It just tells how large the internal ("virtual") content is. */ -int32_t lv_obj_get_self_width(const lv_obj_t * obj); +lv_coord_t lv_obj_get_self_width(const struct _lv_obj_t * obj); /** * Get the height occupied by the "parts" of the widget. E.g. the height of all rows of a table. @@ -327,46 +332,39 @@ int32_t lv_obj_get_self_width(const lv_obj_t * obj); * @note This size independent from the real size of the widget. * It just tells how large the internal ("virtual") content is. */ -int32_t lv_obj_get_self_height(const lv_obj_t * obj); +lv_coord_t lv_obj_get_self_height(const struct _lv_obj_t * obj); /** * Handle if the size of the internal ("virtual") content of an object has changed. * @param obj pointer to an object * @return false: nothing happened; true: refresh happened */ -bool lv_obj_refresh_self_size(lv_obj_t * obj); +bool lv_obj_refresh_self_size(struct _lv_obj_t * obj); + +void lv_obj_refr_pos(struct _lv_obj_t * obj); -void lv_obj_refr_pos(lv_obj_t * obj); +void lv_obj_move_to(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y); -void lv_obj_move_to(lv_obj_t * obj, int32_t x, int32_t y); -void lv_obj_move_children_by(lv_obj_t * obj, int32_t x_diff, int32_t y_diff, bool ignore_floating); +void lv_obj_move_children_by(struct _lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff, bool ignore_floating); /** * Transform a point using the angle and zoom style properties of an object * @param obj pointer to an object whose style properties should be used * @param p a point to transform, the result will be written back here too - * @param flags OR-ed valued of :cpp:enum:`lv_obj_point_transform_flag_t` - */ -void lv_obj_transform_point(const lv_obj_t * obj, lv_point_t * p, lv_obj_point_transform_flag_t flags); - -/** - * Transform an array of points using the angle and zoom style properties of an object - * @param obj pointer to an object whose style properties should be used - * @param points the array of points to transform, the result will be written back here too - * @param count number of points in the array - * @param flags OR-ed valued of :cpp:enum:`lv_obj_point_transform_flag_t` + * @param recursive consider the transformation properties of the parents too + * @param inv do the inverse of the transformation (-angle and 1/zoom) */ -void lv_obj_transform_point_array(const lv_obj_t * obj, lv_point_t points[], size_t count, - lv_obj_point_transform_flag_t flags); +void lv_obj_transform_point(const struct _lv_obj_t * obj, lv_point_t * p, bool recursive, bool inv); /** * Transform an area using the angle and zoom style properties of an object * @param obj pointer to an object whose style properties should be used * @param area an area to transform, the result will be written back here too - * @param flags OR-ed valued of :cpp:enum:`lv_obj_point_transform_flag_t` + * @param recursive consider the transformation properties of the parents too + * @param inv do the inverse of the transformation (-angle and 1/zoom) */ -void lv_obj_get_transformed_area(const lv_obj_t * obj, lv_area_t * area, lv_obj_point_transform_flag_t flags); +void lv_obj_get_transformed_area(const struct _lv_obj_t * obj, lv_area_t * area, bool recursive, bool inv); /** * Mark an area of an object as invalid. @@ -374,13 +372,13 @@ void lv_obj_get_transformed_area(const lv_obj_t * obj, lv_area_t * area, lv_obj_ * @param obj pointer to an object * @param area the area to redraw */ -void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area); +void lv_obj_invalidate_area(const struct _lv_obj_t * obj, const lv_area_t * area); /** * Mark the object as invalid to redrawn its area * @param obj pointer to an object */ -void lv_obj_invalidate(const lv_obj_t * obj); +void lv_obj_invalidate(const struct _lv_obj_t * obj); /** * Tell whether an area of an object is visible (even partially) now or not @@ -388,21 +386,21 @@ void lv_obj_invalidate(const lv_obj_t * obj); * @param area the are to check. The visible part of the area will be written back here. * @return true visible; false not visible (hidden, out of parent, on other screen, etc) */ -bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area); +bool lv_obj_area_is_visible(const struct _lv_obj_t * obj, lv_area_t * area); /** * Tell whether an object is visible (even partially) now or not * @param obj pointer to an object * @return true: visible; false not visible (hidden, out of parent, on other screen, etc) */ -bool lv_obj_is_visible(const lv_obj_t * obj); +bool lv_obj_is_visible(const struct _lv_obj_t * obj); /** * Set the size of an extended clickable area * @param obj pointer to an object * @param size extended clickable area in all 4 directions [px] */ -void lv_obj_set_ext_click_area(lv_obj_t * obj, int32_t size); +void lv_obj_set_ext_click_area(struct _lv_obj_t * obj, lv_coord_t size); /** * Get the an area where to object can be clicked. @@ -410,7 +408,7 @@ void lv_obj_set_ext_click_area(lv_obj_t * obj, int32_t size); * @param obj pointer to an object * @param area store the result area here */ -void lv_obj_get_click_area(const lv_obj_t * obj, lv_area_t * area); +void lv_obj_get_click_area(const struct _lv_obj_t * obj, lv_area_t * area); /** * Hit-test an object given a particular point in screen space. @@ -418,7 +416,7 @@ void lv_obj_get_click_area(const lv_obj_t * obj, lv_area_t * area); * @param point screen-space point (absolute coordinate) * @return true: if the object is considered under the point */ -bool lv_obj_hit_test(lv_obj_t * obj, const lv_point_t * point); +bool lv_obj_hit_test(struct _lv_obj_t * obj, const lv_point_t * point); /** * Clamp a width between min and max width. If the min/max width is in percentage value use the ref_width @@ -428,7 +426,7 @@ bool lv_obj_hit_test(lv_obj_t * obj, const lv_point_t * point); * @param ref_width the reference width used when min/max width is in percentage * @return the clamped width */ -int32_t lv_clamp_width(int32_t width, int32_t min_width, int32_t max_width, int32_t ref_width); +lv_coord_t lv_clamp_width(lv_coord_t width, lv_coord_t min_width, lv_coord_t max_width, lv_coord_t ref_width); /** * Clamp a height between min and max height. If the min/max height is in percentage value use the ref_height @@ -438,7 +436,7 @@ int32_t lv_clamp_width(int32_t width, int32_t min_width, int32_t max_width, int3 * @param ref_height the reference height used when min/max height is in percentage * @return the clamped height */ -int32_t lv_clamp_height(int32_t height, int32_t min_height, int32_t max_height, int32_t ref_height); +lv_coord_t lv_clamp_height(lv_coord_t height, lv_coord_t min_height, lv_coord_t max_height, lv_coord_t ref_height); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_private.h b/L3_Middlewares/LVGL/src/core/lv_obj_private.h deleted file mode 100644 index d9eee49..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_obj_private.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @file lv_obj_private.h - * - */ - -#ifndef LV_OBJ_PRIVATE_H -#define LV_OBJ_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_obj.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * Special, rarely used attributes. - * They are allocated automatically if any elements is set. - */ -struct lv_obj_spec_attr_t { - lv_obj_t ** children; /**< Store the pointer of the children in an array.*/ - lv_group_t * group_p; - lv_event_list_t event_list; - - lv_point_t scroll; /**< The current X/Y scroll offset*/ - - int32_t ext_click_pad; /**< Extra click padding in all direction*/ - int32_t ext_draw_size; /**< EXTend the size in every direction for drawing.*/ - - uint16_t child_cnt; /**< Number of children*/ - uint16_t scrollbar_mode : 2; /**< How to display scrollbars, see `lv_scrollbar_mode_t`*/ - uint16_t scroll_snap_x : 2; /**< Where to align the snappable children horizontally, see `lv_scroll_snap_t`*/ - uint16_t scroll_snap_y : 2; /**< Where to align the snappable children vertically*/ - uint16_t scroll_dir : 4; /**< The allowed scroll direction(s), see `lv_dir_t`*/ - uint16_t layer_type : 2; /**< Cache the layer type here. Element of lv_intermediate_layer_type_t */ -}; - -struct lv_obj_t { - const lv_obj_class_t * class_p; - lv_obj_t * parent; - lv_obj_spec_attr_t * spec_attr; - lv_obj_style_t * styles; -#if LV_OBJ_STYLE_CACHE - uint32_t style_main_prop_is_set; - uint32_t style_other_prop_is_set; -#endif - void * user_data; -#if LV_USE_OBJ_ID - void * id; -#endif - lv_area_t coords; - lv_obj_flag_t flags; - lv_state_t state; - uint16_t layout_inv : 1; - uint16_t readjust_scroll_after_layout : 1; - uint16_t scr_layout_inv : 1; - uint16_t skip_trans : 1; - uint16_t style_cnt : 6; - uint16_t h_layout : 1; - uint16_t w_layout : 1; - uint16_t is_deleting : 1; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OBJ_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_property.c b/L3_Middlewares/LVGL/src/core/lv_obj_property.c deleted file mode 100644 index 405b006..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_obj_property.c +++ /dev/null @@ -1,302 +0,0 @@ -/** - * @file lv_obj_id.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_obj_private.h" -#include "../core/lv_obj.h" -#include "../stdlib/lv_string.h" -#include "../misc/lv_utils.h" -#include "lv_obj_property.h" -#include "lv_obj_class_private.h" - -#if LV_USE_OBJ_PROPERTY - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef void (*lv_property_set_int_t)(lv_obj_t *, int32_t); -typedef void (*lv_property_set_bool_t)(lv_obj_t *, bool); -typedef void (*lv_property_set_precise_t)(lv_obj_t *, lv_value_precise_t); -typedef void (*lv_property_set_color_t)(lv_obj_t *, lv_color_t); -typedef void (*lv_property_set_point_t)(lv_obj_t *, lv_point_t *); -typedef void (*lv_property_set_pointer_t)(lv_obj_t *, const void *); -typedef lv_result_t (*lv_property_setter_t)(lv_obj_t *, lv_prop_id_t, const lv_property_t *); - -typedef int32_t (*lv_property_get_int_t)(const lv_obj_t *); -typedef bool (*lv_property_get_bool_t)(const lv_obj_t *); -typedef lv_value_precise_t (*lv_property_get_precise_t)(const lv_obj_t *); -typedef lv_color_t (*lv_property_get_color_t)(const lv_obj_t *); -typedef lv_point_t (*lv_property_get_point_t)(lv_obj_t *); -typedef void * (*lv_property_get_pointer_t)(const lv_obj_t *); -typedef lv_result_t (*lv_property_getter_t)(const lv_obj_t *, lv_prop_id_t, lv_property_t *); - -/********************** - * STATIC PROTOTYPES - **********************/ - -static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t * value, bool set); -static int property_name_compare(const void * ref, const void * element); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_obj_set_property(lv_obj_t * obj, const lv_property_t * value) -{ - LV_ASSERT(obj && value); - - uint32_t index = LV_PROPERTY_ID_INDEX(value->id); - if(value->id == LV_PROPERTY_ID_INVALID || index > LV_PROPERTY_ID_ANY) { - LV_LOG_WARN("Invalid property id set to %p", obj); - return LV_RESULT_INVALID; - } - - if(index < LV_PROPERTY_ID_START) { - lv_obj_set_local_style_prop(obj, index, value->style, value->selector); - return LV_RESULT_OK; - } - - return obj_property(obj, value->id, (lv_property_t *)value, true); -} - -lv_result_t lv_obj_set_properties(lv_obj_t * obj, const lv_property_t * value, uint32_t count) -{ - for(uint32_t i = 0; i < count; i++) { - lv_result_t result = lv_obj_set_property(obj, &value[i]); - if(result != LV_RESULT_OK) { - return result; - } - } - - return LV_RESULT_OK; -} - -lv_property_t lv_obj_get_property(lv_obj_t * obj, lv_prop_id_t id) -{ - lv_result_t result; - lv_property_t value = { 0 }; - - uint32_t index = LV_PROPERTY_ID_INDEX(id); - if(id == LV_PROPERTY_ID_INVALID || index > LV_PROPERTY_ID_ANY) { - LV_LOG_WARN("Invalid property id to get from %p", obj); - value.id = LV_PROPERTY_ID_INVALID; - value.num = 0; - return value; - } - - if(index < LV_PROPERTY_ID_START) { - lv_obj_get_local_style_prop(obj, index, &value.style, 0); - value.id = id; - value.selector = 0; - return value; - } - - result = obj_property(obj, id, &value, false); - if(result != LV_RESULT_OK) - value.id = LV_PROPERTY_ID_INVALID; - - return value; -} - -lv_property_t lv_obj_get_style_property(lv_obj_t * obj, lv_prop_id_t id, uint32_t selector) -{ - lv_property_t value; - uint32_t index = LV_PROPERTY_ID_INDEX(id); - - if(index == LV_PROPERTY_ID_INVALID || index >= LV_PROPERTY_ID_START) { - LV_LOG_WARN("invalid style property id 0x%" LV_PRIx32, id); - value.id = LV_PROPERTY_ID_INVALID; - value.num = 0; - return value; - } - - lv_obj_get_local_style_prop(obj, id, &value.style, selector); - value.id = id; - value.selector = selector; - return value; -} - -lv_prop_id_t lv_style_property_get_id(const char * name) -{ -#if LV_USE_OBJ_PROPERTY_NAME - lv_property_name_t * found; - /*Check style property*/ - found = lv_utils_bsearch(name, lv_style_property_names, sizeof(lv_style_property_names) / sizeof(lv_property_name_t), - sizeof(lv_property_name_t), property_name_compare); - if(found) return found->id; -#else - LV_UNUSED(name); -#endif - return LV_PROPERTY_ID_INVALID; -} - -lv_prop_id_t lv_obj_class_property_get_id(const lv_obj_class_t * clz, const char * name) -{ -#if LV_USE_OBJ_PROPERTY_NAME - const lv_property_name_t * names; - lv_property_name_t * found; - - names = clz->property_names; - if(names == NULL) { - /* try base class*/ - return LV_PROPERTY_ID_INVALID; - } - - found = lv_utils_bsearch(name, names, clz->names_count, sizeof(lv_property_name_t), property_name_compare); - if(found) return found->id; -#else - LV_UNUSED(obj); - LV_UNUSED(name); - LV_UNUSED(property_name_compare); -#endif - return LV_PROPERTY_ID_INVALID; -} - -lv_prop_id_t lv_obj_property_get_id(const lv_obj_t * obj, const char * name) -{ -#if LV_USE_OBJ_PROPERTY_NAME - const lv_obj_class_t * clz; - lv_prop_id_t id; - - for(clz = obj->class_p; clz; clz = clz->base_class) { - id = lv_obj_class_property_get_id(clz, name); - if(id != LV_PROPERTY_ID_INVALID) return id; - } - - /*Check style property*/ - id = lv_style_property_get_id(name); - if(id != LV_PROPERTY_ID_INVALID) return id; -#else - LV_UNUSED(obj); - LV_UNUSED(name); - LV_UNUSED(property_name_compare); -#endif - return LV_PROPERTY_ID_INVALID; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static lv_result_t obj_property(lv_obj_t * obj, lv_prop_id_t id, lv_property_t * value, bool set) -{ - const lv_property_ops_t * properties; - const lv_property_ops_t * prop; - - const lv_obj_class_t * clz; - uint32_t index = LV_PROPERTY_ID_INDEX(id); - - for(clz = obj->class_p ; clz; clz = clz->base_class) { - properties = clz->properties; - if(properties == NULL) { - /* try base class*/ - continue; - } - - if(id != LV_PROPERTY_ID_ANY && (index < clz->prop_index_start || index > clz->prop_index_end)) { - /* try base class*/ - continue; - } - - /*Check if there's setter available for this class*/ - for(uint32_t i = 0; i < clz->properties_count; i++) { - prop = &properties[i]; - - /*pass id and value directly to widget's property method*/ - if(prop->id == LV_PROPERTY_ID_ANY) { - value->id = prop->id; - if(set) return ((lv_property_setter_t)prop->setter)(obj, id, value); - else return ((lv_property_getter_t)prop->getter)(obj, id, value); - } - - /*Not this id, check next*/ - if(prop->id != id) - continue; - - /*id matched but we got null pointer to functions*/ - if(set ? prop->setter == NULL : prop->getter == NULL) { - LV_LOG_WARN("NULL %s provided, id: 0x%" LV_PRIx32, set ? "setter" : "getter", id); - return LV_RESULT_INVALID; - } - - /*Update value id if it's a read*/ - if(!set) value->id = prop->id; - - switch(LV_PROPERTY_ID_TYPE(prop->id)) { - case LV_PROPERTY_TYPE_INT: { - if(set)((lv_property_set_int_t)(prop->setter))(obj, value->num); - else value->num = ((lv_property_get_int_t)(prop->getter))(obj); - break; - } - case LV_PROPERTY_TYPE_BOOL: { - if(set)((lv_property_set_bool_t)(prop->setter))(obj, value->enable); - else value->enable = ((lv_property_get_bool_t)(prop->getter))(obj); - break; - } - - case LV_PROPERTY_TYPE_PRECISE: { - if(set)((lv_property_set_precise_t)(prop->setter))(obj, value->precise); - else value->precise = ((lv_property_get_precise_t)(prop->getter))(obj); - break; - } - case LV_PROPERTY_TYPE_COLOR: { - if(set)((lv_property_set_color_t)prop->setter)(obj, value->color); - else value->color = ((lv_property_get_color_t)(prop->getter))(obj); - break; - } - case LV_PROPERTY_TYPE_POINT: { - lv_point_t * point = &value->point; - if(set)((lv_property_set_point_t)(prop->setter))(obj, point); - else *point = ((lv_property_get_point_t)(prop->getter))(obj); - break; - } - case LV_PROPERTY_TYPE_POINTER: - case LV_PROPERTY_TYPE_IMGSRC: - case LV_PROPERTY_TYPE_TEXT: - case LV_PROPERTY_TYPE_OBJ: - case LV_PROPERTY_TYPE_DISPLAY: - case LV_PROPERTY_TYPE_FONT: { - if(set)((lv_property_set_pointer_t)(prop->setter))(obj, value->ptr); - else value->ptr = ((lv_property_get_pointer_t)(prop->getter))(obj); - break; - } - default: { - LV_LOG_WARN("Unknown property id: 0x%08" LV_PRIx32, prop->id); - return LV_RESULT_INVALID; - } - } - - return LV_RESULT_OK; - } - - /*If no setter found, try base class then*/ - } - - LV_LOG_WARN("Unknown property id: 0x%08" LV_PRIx32, id); - return LV_RESULT_INVALID; -} - -static int property_name_compare(const void * ref, const void * element) -{ - const lv_property_name_t * prop = element; - return lv_strcmp(ref, prop->name); -} - -#endif /*LV_USE_OBJ_PROPERTY*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_property.h b/L3_Middlewares/LVGL/src/core/lv_obj_property.h deleted file mode 100644 index 4c8c142..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_obj_property.h +++ /dev/null @@ -1,209 +0,0 @@ -/** - * @file lv_obj_property.h - * - */ - -#ifndef LV_OBJ_PROPERTY_H -#define LV_OBJ_PROPERTY_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../misc/lv_types.h" -#include "../misc/lv_style.h" - -#if LV_USE_OBJ_PROPERTY - -/********************* - * DEFINES - *********************/ - -/*All possible property value types*/ -#define LV_PROPERTY_TYPE_INVALID 0 /*Use default 0 as invalid to detect program outliers*/ -#define LV_PROPERTY_TYPE_INT 1 /*int32_t type*/ -#define LV_PROPERTY_TYPE_PRECISE 2 /*lv_value_precise_t, int32_t or float depending on LV_USE_FLOAT*/ -#define LV_PROPERTY_TYPE_COLOR 3 /*ARGB8888 type*/ -#define LV_PROPERTY_TYPE_POINT 4 /*lv_point_t */ -#define LV_PROPERTY_TYPE_POINTER 5 /*void * pointer*/ -#define LV_PROPERTY_TYPE_IMGSRC 6 /*Special pointer for image*/ -#define LV_PROPERTY_TYPE_TEXT 7 /*Special pointer of char* */ -#define LV_PROPERTY_TYPE_OBJ 8 /*Special pointer of lv_obj_t* */ -#define LV_PROPERTY_TYPE_DISPLAY 9 /*Special pointer of lv_display_t* */ -#define LV_PROPERTY_TYPE_FONT 10 /*Special pointer of lv_font_t* */ -#define LV_PROPERTY_TYPE_BOOL 11 /*int32_t type*/ - -#define LV_PROPERTY_TYPE_SHIFT 28 -#define LV_PROPERTY_ID(clz, name, type, index) LV_PROPERTY_## clz ##_##name = (LV_PROPERTY_## clz ##_START + (index)) | ((type) << LV_PROPERTY_TYPE_SHIFT) - -#define LV_PROPERTY_ID_TYPE(id) ((id) >> LV_PROPERTY_TYPE_SHIFT) -#define LV_PROPERTY_ID_INDEX(id) ((id) & 0xfffffff) - -/*Set properties from an array of lv_property_t*/ -#define LV_OBJ_SET_PROPERTY_ARRAY(obj, array) lv_obj_set_properties(obj, array, sizeof(array)/sizeof(array[0])) - - -/********************** - * TYPEDEFS - **********************/ - -/** - * Group of predefined widget ID start value. - */ -enum { - LV_PROPERTY_ID_INVALID = 0, - - /*ID 0x01 to 0xff are style ID, check lv_style_prop_t*/ - LV_PROPERTY_STYLE_START = 0x00, - - LV_PROPERTY_ID_START = 0x0100, /*ID smaller than 0xff is style ID*/ - /*Define the property ID for every widget here. */ - LV_PROPERTY_OBJ_START = 0x0100, /* lv_obj.c */ - LV_PROPERTY_IMAGE_START = 0x0200, /* lv_image.c */ - LV_PROPERTY_LABEL_START = 0x0300, /* lv_label.c */ - LV_PROPERTY_KEYBOARD_START = 0x0400, /* lv_keyboard.c */ - LV_PROPERTY_TEXTAREA_START = 0x0500, /* lv_textarea.c */ - LV_PROPERTY_ROLLER_START = 0x0600, /* lv_roller.c */ - LV_PROPERTY_DROPDOWN_START = 0x0700, /* lv_dropdown.c */ - - /*Special ID, use it to extend ID and make sure it's unique and compile time determinant*/ - LV_PROPERTY_ID_BUILTIN_LAST = 0xffff, /*ID of 0x10000 ~ 0xfffffff is reserved for user*/ - - LV_PROPERTY_ID_ANY = 0x7ffffffe, /*Special ID used by lvgl to intercept all setter/getter call.*/ -}; - -struct lv_property_name_t { - const char * name; - lv_prop_id_t id; -}; - -typedef struct { - lv_prop_id_t id; - union { - int32_t num; /**< Number integer number (opacity, enums, booleans or "normal" numbers)*/ - bool enable; /**< booleans*/ - const void * ptr; /**< Constant pointers (font, cone text, etc)*/ - lv_color_t color; /**< Colors*/ - lv_value_precise_t precise; /**< float or int for precise value*/ - lv_point_t point; /**< Point*/ - struct { - /** - * Note that place struct member `style` at first place is intended. - * `style` shares same memory with `num`, `ptr`, `color`. - * So we set the style value directly without using `prop.style.num`. - * - * E.g. - * - * static const lv_property_t obj_pos_x = { - * .id = LV_PROPERTY_STYLE_X, - * .num = 123, - * .selector = LV_STATE_PRESSED, - * } - * - * instead of: - * static const lv_property_t obj_pos_x = { - * .id = LV_PROPERTY_STYLE_X, - * .style.num = 123, // note this line. - * .selector = LV_STATE_PRESSED, - * } - */ - lv_style_value_t style; /**< Make sure it's the first element in struct. */ - uint32_t selector; /**< Style selector, lv_part_t | lv_state_t */ - }; - }; -} lv_property_t; - -typedef struct { - lv_prop_id_t id; - - void * setter; /**< Callback used to set property. */ - void * getter; /**< Callback used to get property. */ -} lv_property_ops_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/*===================== - * Setter functions - *====================*/ - -/** - * Set widget property. - * @param obj pointer to an object - * @param value The property value to set - * @return return LV_RESULT_OK if success - */ -lv_result_t lv_obj_set_property(lv_obj_t * obj, const lv_property_t * value); - -/** - * Set multiple widget properties. Helper `LV_OBJ_SET_PROPERTY_ARRAY` can be used for constant property array. - * @param obj pointer to an object - * @param value The property value array to set - * @param count The count of the property value array - * @return return LV_RESULT_OK if success - */ -lv_result_t lv_obj_set_properties(lv_obj_t * obj, const lv_property_t * value, uint32_t count); - -/*===================== - * Getter functions - *====================*/ - -/** - * Read property value from object. - * If id is a style property, the style selector is default to 0. - * @param obj pointer to an object - * @param id ID of which property to read - * @return return the property value read. The returned property ID is set to `LV_PROPERTY_ID_INVALID` if failed. - */ -lv_property_t lv_obj_get_property(lv_obj_t * obj, lv_prop_id_t id); - -/** - * Read a style property value from object - * @param obj pointer to an object - * @param id ID of style property - * @param selector selector for the style property. - * @return return the property value read. The returned property ID is set to `LV_PROPERTY_ID_INVALID` if failed. - */ -lv_property_t lv_obj_get_style_property(lv_obj_t * obj, lv_prop_id_t id, uint32_t selector); - -/** - * Get the property ID by name recursively to base classes. Requires to enable `LV_USE_OBJ_PROPERTY_NAME`. - * @param obj pointer to an object that has specified property or base class has. - * @param name property name - * @return property ID found or `LV_PROPERTY_ID_INVALID` if not found. - */ -lv_prop_id_t lv_obj_property_get_id(const lv_obj_t * obj, const char * name); - -/** - * Get the property ID by name without check base class recursively. Requires to enable `LV_USE_OBJ_PROPERTY_NAME`. - * @param clz pointer to an object class that has specified property or base class has. - * @param name property name - * @return property ID found or `LV_PROPERTY_ID_INVALID` if not found. - */ -lv_prop_id_t lv_obj_class_property_get_id(const lv_obj_class_t * clz, const char * name); - -/** - * Get the style property ID by name. Requires to enable `LV_USE_OBJ_PROPERTY_NAME`. - * @param name property name - * @return property ID found or `LV_PROPERTY_ID_INVALID` if not found. - */ -lv_prop_id_t lv_style_property_get_id(const char * name); - -/********************** - * MACROS - **********************/ - -#include "../widgets/property/lv_obj_property_names.h" -#include "../widgets/property/lv_style_properties.h" - -#endif /*LV_USE_OBJ_PROPERTY*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OBJ_PROPERTY_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_scroll.c b/L3_Middlewares/LVGL/src/core/lv_obj_scroll.c index fa5e16f..02b9826 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_scroll.c +++ b/L3_Middlewares/LVGL/src/core/lv_obj_scroll.c @@ -6,18 +6,16 @@ /********************* * INCLUDES *********************/ -#include "lv_obj_scroll_private.h" -#include "../misc/lv_anim_private.h" -#include "lv_obj_private.h" -#include "../indev/lv_indev.h" -#include "../indev/lv_indev_scroll.h" -#include "../display/lv_display.h" -#include "../misc/lv_area.h" +#include "lv_obj_scroll.h" +#include "lv_obj.h" +#include "lv_indev.h" +#include "lv_disp.h" +#include "lv_indev_scroll.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_obj_class) +#define MY_CLASS &lv_obj_class #define SCROLL_ANIM_TIME_MIN 200 /*ms*/ #define SCROLL_ANIM_TIME_MAX 400 /*ms*/ #define SCROLLBAR_MIN_SIZE (LV_DPX(10)) @@ -35,7 +33,7 @@ **********************/ static void scroll_x_anim(void * obj, int32_t v); static void scroll_y_anim(void * obj, int32_t v); -static void scroll_end_cb(lv_anim_t * a); +static void scroll_anim_ready_cb(lv_anim_t * a); static void scroll_area_into_view(const lv_area_t * area, lv_obj_t * child, lv_point_t * scroll_value, lv_anim_enable_t anim_en); @@ -93,75 +91,74 @@ void lv_obj_set_scroll_snap_y(lv_obj_t * obj, lv_scroll_snap_t align) lv_scrollbar_mode_t lv_obj_get_scrollbar_mode(const lv_obj_t * obj) { - if(obj->spec_attr) return (lv_scrollbar_mode_t) obj->spec_attr->scrollbar_mode; + if(obj->spec_attr) return obj->spec_attr->scrollbar_mode; else return LV_SCROLLBAR_MODE_AUTO; } lv_dir_t lv_obj_get_scroll_dir(const lv_obj_t * obj) { - if(obj->spec_attr) return (lv_dir_t) obj->spec_attr->scroll_dir; + if(obj->spec_attr) return obj->spec_attr->scroll_dir; else return LV_DIR_ALL; } lv_scroll_snap_t lv_obj_get_scroll_snap_x(const lv_obj_t * obj) { - if(obj->spec_attr) return (lv_scroll_snap_t) obj->spec_attr->scroll_snap_x; + if(obj->spec_attr) return obj->spec_attr->scroll_snap_x; else return LV_SCROLL_SNAP_NONE; } lv_scroll_snap_t lv_obj_get_scroll_snap_y(const lv_obj_t * obj) { - if(obj->spec_attr) return (lv_scroll_snap_t) obj->spec_attr->scroll_snap_y; + if(obj->spec_attr) return obj->spec_attr->scroll_snap_y; else return LV_SCROLL_SNAP_NONE; } -int32_t lv_obj_get_scroll_x(const lv_obj_t * obj) +lv_coord_t lv_obj_get_scroll_x(const lv_obj_t * obj) { if(obj->spec_attr == NULL) return 0; return -obj->spec_attr->scroll.x; } -int32_t lv_obj_get_scroll_y(const lv_obj_t * obj) +lv_coord_t lv_obj_get_scroll_y(const lv_obj_t * obj) { if(obj->spec_attr == NULL) return 0; return -obj->spec_attr->scroll.y; } -int32_t lv_obj_get_scroll_top(lv_obj_t * obj) +lv_coord_t lv_obj_get_scroll_top(lv_obj_t * obj) { if(obj->spec_attr == NULL) return 0; return -obj->spec_attr->scroll.y; } -int32_t lv_obj_get_scroll_bottom(lv_obj_t * obj) +lv_coord_t lv_obj_get_scroll_bottom(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - int32_t child_res = LV_COORD_MIN; + lv_coord_t child_res = LV_COORD_MIN; uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); for(i = 0; i < child_cnt; i++) { lv_obj_t * child = obj->spec_attr->children[i]; if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; - - int32_t tmp_y = child->coords.y2 + lv_obj_get_style_margin_bottom(child, LV_PART_MAIN); - child_res = LV_MAX(child_res, tmp_y); + child_res = LV_MAX(child_res, child->coords.y2); } - int32_t space_top = lv_obj_get_style_space_top(obj, LV_PART_MAIN); - int32_t space_bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN); + lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); if(child_res != LV_COORD_MIN) { - child_res -= (obj->coords.y2 - space_bottom); + child_res -= (obj->coords.y2 - pad_bottom - border_width); } - int32_t self_h = lv_obj_get_self_height(obj); - self_h = self_h - (lv_obj_get_height(obj) - space_top - space_bottom); + lv_coord_t self_h = lv_obj_get_self_height(obj); + self_h = self_h - (lv_obj_get_height(obj) - pad_top - pad_bottom - 2 * border_width); self_h -= lv_obj_get_scroll_y(obj); return LV_MAX(child_res, self_h); } -int32_t lv_obj_get_scroll_left(lv_obj_t * obj) +lv_coord_t lv_obj_get_scroll_left(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -173,38 +170,38 @@ int32_t lv_obj_get_scroll_left(lv_obj_t * obj) } /*With RTL base direction scrolling the left is normal so find the left most coordinate*/ - int32_t space_right = lv_obj_get_style_space_right(obj, LV_PART_MAIN); - int32_t space_left = lv_obj_get_style_space_left(obj, LV_PART_MAIN); + lv_coord_t pad_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - int32_t child_res = 0; + lv_coord_t child_res = 0; uint32_t i; - int32_t x1 = LV_COORD_MAX; - uint32_t child_cnt = lv_obj_get_child_count(obj); + lv_coord_t x1 = LV_COORD_MAX; + uint32_t child_cnt = lv_obj_get_child_cnt(obj); for(i = 0; i < child_cnt; i++) { lv_obj_t * child = obj->spec_attr->children[i]; if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; + x1 = LV_MIN(x1, child->coords.x1); - int32_t tmp_x = child->coords.x1 - lv_obj_get_style_margin_left(child, LV_PART_MAIN); - x1 = LV_MIN(x1, tmp_x); } if(x1 != LV_COORD_MAX) { child_res = x1; - child_res = (obj->coords.x1 + space_left) - child_res; + child_res = (obj->coords.x1 + pad_left + border_width) - child_res; } else { child_res = LV_COORD_MIN; } - int32_t self_w = lv_obj_get_self_width(obj); - self_w = self_w - (lv_obj_get_width(obj) - space_right - space_left); + lv_coord_t self_w = lv_obj_get_self_width(obj); + self_w = self_w - (lv_obj_get_width(obj) - pad_right - pad_left - 2 * border_width); self_w += lv_obj_get_scroll_x(obj); return LV_MAX(child_res, self_w); } -int32_t lv_obj_get_scroll_right(lv_obj_t * obj) +lv_coord_t lv_obj_get_scroll_right(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -216,32 +213,31 @@ int32_t lv_obj_get_scroll_right(lv_obj_t * obj) } /*With other base direction (LTR) scrolling to the right is normal so find the right most coordinate*/ - int32_t child_res = LV_COORD_MIN; + lv_coord_t child_res = LV_COORD_MIN; uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); for(i = 0; i < child_cnt; i++) { lv_obj_t * child = obj->spec_attr->children[i]; if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; - - int32_t tmp_x = child->coords.x2 + lv_obj_get_style_margin_right(child, LV_PART_MAIN); - child_res = LV_MAX(child_res, tmp_x); + child_res = LV_MAX(child_res, child->coords.x2); } - int32_t space_right = lv_obj_get_style_space_right(obj, LV_PART_MAIN); - int32_t space_left = lv_obj_get_style_space_left(obj, LV_PART_MAIN); + lv_coord_t pad_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); if(child_res != LV_COORD_MIN) { - child_res -= (obj->coords.x2 - space_right); + child_res -= (obj->coords.x2 - pad_right - border_width); } - int32_t self_w; + lv_coord_t self_w; self_w = lv_obj_get_self_width(obj); - self_w = self_w - (lv_obj_get_width(obj) - space_right - space_left); + self_w = self_w - (lv_obj_get_width(obj) - pad_right - pad_left - 2 * border_width); self_w -= lv_obj_get_scroll_x(obj); return LV_MAX(child_res, self_w); } -void lv_obj_get_scroll_end(lv_obj_t * obj, lv_point_t * end) +void lv_obj_get_scroll_end(struct _lv_obj_t * obj, lv_point_t * end) { lv_anim_t * a; a = lv_anim_get(obj, scroll_x_anim); @@ -255,21 +251,21 @@ void lv_obj_get_scroll_end(lv_obj_t * obj, lv_point_t * end) * Other functions *====================*/ -void lv_obj_scroll_by_bounded(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en) +void lv_obj_scroll_by_bounded(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enable_t anim_en) { if(dx == 0 && dy == 0) return; /*We need to know the final sizes for bound check*/ lv_obj_update_layout(obj); - /*Don't let scroll more than naturally possible by the size of the content*/ - int32_t x_current = -lv_obj_get_scroll_x(obj); - int32_t x_bounded = x_current + dx; + /*Don't let scroll more then naturally possible by the size of the content*/ + lv_coord_t x_current = -lv_obj_get_scroll_x(obj); + lv_coord_t x_bounded = x_current + dx; if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) != LV_BASE_DIR_RTL) { if(x_bounded > 0) x_bounded = 0; if(x_bounded < 0) { - int32_t scroll_max = lv_obj_get_scroll_left(obj) + lv_obj_get_scroll_right(obj); + lv_coord_t scroll_max = lv_obj_get_scroll_left(obj) + lv_obj_get_scroll_right(obj); if(scroll_max < 0) scroll_max = 0; if(x_bounded < -scroll_max) x_bounded = -scroll_max; @@ -278,20 +274,20 @@ void lv_obj_scroll_by_bounded(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_en else { if(x_bounded < 0) x_bounded = 0; if(x_bounded > 0) { - int32_t scroll_max = lv_obj_get_scroll_left(obj) + lv_obj_get_scroll_right(obj); + lv_coord_t scroll_max = lv_obj_get_scroll_left(obj) + lv_obj_get_scroll_right(obj); if(scroll_max < 0) scroll_max = 0; if(x_bounded > scroll_max) x_bounded = scroll_max; } } - /*Don't let scroll more than naturally possible by the size of the content*/ - int32_t y_current = -lv_obj_get_scroll_y(obj); - int32_t y_bounded = y_current + dy; + /*Don't let scroll more then naturally possible by the size of the content*/ + lv_coord_t y_current = -lv_obj_get_scroll_y(obj); + lv_coord_t y_bounded = y_current + dy; if(y_bounded > 0) y_bounded = 0; if(y_bounded < 0) { - int32_t scroll_max = lv_obj_get_scroll_top(obj) + lv_obj_get_scroll_bottom(obj); + lv_coord_t scroll_max = lv_obj_get_scroll_top(obj) + lv_obj_get_scroll_bottom(obj); if(scroll_max < 0) scroll_max = 0; if(y_bounded < -scroll_max) y_bounded = -scroll_max; } @@ -303,85 +299,88 @@ void lv_obj_scroll_by_bounded(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_en } } -void lv_obj_scroll_by(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en) + +void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enable_t anim_en) { if(dx == 0 && dy == 0) return; if(anim_en == LV_ANIM_ON) { - lv_display_t * d = lv_obj_get_display(obj); + lv_disp_t * d = lv_obj_get_disp(obj); lv_anim_t a; lv_anim_init(&a); lv_anim_set_var(&a, obj); - lv_anim_set_deleted_cb(&a, scroll_end_cb); + lv_anim_set_ready_cb(&a, scroll_anim_ready_cb); if(dx) { - uint32_t t = lv_anim_speed_clamped((lv_display_get_horizontal_resolution(d)) >> 1, SCROLL_ANIM_TIME_MIN, - SCROLL_ANIM_TIME_MAX); - lv_anim_set_duration(&a, t); - int32_t sx = lv_obj_get_scroll_x(obj); + uint32_t t = lv_anim_speed_to_time((lv_disp_get_hor_res(d) * 2) >> 2, 0, dx); + if(t < SCROLL_ANIM_TIME_MIN) t = SCROLL_ANIM_TIME_MIN; + if(t > SCROLL_ANIM_TIME_MAX) t = SCROLL_ANIM_TIME_MAX; + lv_anim_set_time(&a, t); + lv_coord_t sx = lv_obj_get_scroll_x(obj); lv_anim_set_values(&a, -sx, -sx + dx); lv_anim_set_exec_cb(&a, scroll_x_anim); lv_anim_set_path_cb(&a, lv_anim_path_ease_out); - lv_result_t res; - res = lv_obj_send_event(obj, LV_EVENT_SCROLL_BEGIN, &a); - if(res != LV_RESULT_OK) return; + lv_res_t res; + res = lv_event_send(obj, LV_EVENT_SCROLL_BEGIN, &a); + if(res != LV_RES_OK) return; lv_anim_start(&a); } if(dy) { - uint32_t t = lv_anim_speed_clamped((lv_display_get_vertical_resolution(d)) >> 1, SCROLL_ANIM_TIME_MIN, - SCROLL_ANIM_TIME_MAX); - lv_anim_set_duration(&a, t); - int32_t sy = lv_obj_get_scroll_y(obj); + uint32_t t = lv_anim_speed_to_time((lv_disp_get_ver_res(d) * 2) >> 2, 0, dy); + if(t < SCROLL_ANIM_TIME_MIN) t = SCROLL_ANIM_TIME_MIN; + if(t > SCROLL_ANIM_TIME_MAX) t = SCROLL_ANIM_TIME_MAX; + lv_anim_set_time(&a, t); + lv_coord_t sy = lv_obj_get_scroll_y(obj); lv_anim_set_values(&a, -sy, -sy + dy); lv_anim_set_exec_cb(&a, scroll_y_anim); lv_anim_set_path_cb(&a, lv_anim_path_ease_out); - lv_result_t res; - res = lv_obj_send_event(obj, LV_EVENT_SCROLL_BEGIN, &a); - if(res != LV_RESULT_OK) return; + lv_res_t res; + res = lv_event_send(obj, LV_EVENT_SCROLL_BEGIN, &a); + if(res != LV_RES_OK) return; lv_anim_start(&a); } } else { /*Remove pending animations*/ - lv_anim_delete(obj, scroll_y_anim); - lv_anim_delete(obj, scroll_x_anim); + lv_anim_del(obj, scroll_y_anim); + lv_anim_del(obj, scroll_x_anim); - lv_result_t res; - res = lv_obj_send_event(obj, LV_EVENT_SCROLL_BEGIN, NULL); - if(res != LV_RESULT_OK) return; + lv_res_t res; + res = lv_event_send(obj, LV_EVENT_SCROLL_BEGIN, NULL); + if(res != LV_RES_OK) return; - res = lv_obj_scroll_by_raw(obj, dx, dy); - if(res != LV_RESULT_OK) return; + res = _lv_obj_scroll_by_raw(obj, dx, dy); + if(res != LV_RES_OK) return; - res = lv_obj_send_event(obj, LV_EVENT_SCROLL_END, NULL); - if(res != LV_RESULT_OK) return; + res = lv_event_send(obj, LV_EVENT_SCROLL_END, NULL); + if(res != LV_RES_OK) return; } } -void lv_obj_scroll_to(lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t anim_en) +void lv_obj_scroll_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en) { lv_obj_scroll_to_x(obj, x, anim_en); lv_obj_scroll_to_y(obj, y, anim_en); } -void lv_obj_scroll_to_x(lv_obj_t * obj, int32_t x, lv_anim_enable_t anim_en) +void lv_obj_scroll_to_x(lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t anim_en) { - lv_anim_delete(obj, scroll_x_anim); + lv_anim_del(obj, scroll_x_anim); - int32_t scroll_x = lv_obj_get_scroll_x(obj); - int32_t diff = -x + scroll_x; + lv_coord_t scroll_x = lv_obj_get_scroll_x(obj); + lv_coord_t diff = -x + scroll_x; lv_obj_scroll_by_bounded(obj, diff, 0, anim_en); } -void lv_obj_scroll_to_y(lv_obj_t * obj, int32_t y, lv_anim_enable_t anim_en) +void lv_obj_scroll_to_y(lv_obj_t * obj, lv_coord_t y, lv_anim_enable_t anim_en) { - lv_anim_delete(obj, scroll_y_anim); + lv_anim_del(obj, scroll_y_anim); - int32_t scroll_y = lv_obj_get_scroll_y(obj); - int32_t diff = -y + scroll_y; + lv_coord_t scroll_y = lv_obj_get_scroll_y(obj); + lv_coord_t diff = -y + scroll_y; lv_obj_scroll_by_bounded(obj, 0, diff, anim_en); } @@ -410,9 +409,9 @@ void lv_obj_scroll_to_view_recursive(lv_obj_t * obj, lv_anim_enable_t anim_en) } } -lv_result_t lv_obj_scroll_by_raw(lv_obj_t * obj, int32_t x, int32_t y) +lv_res_t _lv_obj_scroll_by_raw(lv_obj_t * obj, lv_coord_t x, lv_coord_t y) { - if(x == 0 && y == 0) return LV_RESULT_OK; + if(x == 0 && y == 0) return LV_RES_OK; lv_obj_allocate_spec_attr(obj); @@ -420,12 +419,13 @@ lv_result_t lv_obj_scroll_by_raw(lv_obj_t * obj, int32_t x, int32_t y) obj->spec_attr->scroll.y += y; lv_obj_move_children_by(obj, x, y, true); - lv_result_t res = lv_obj_send_event(obj, LV_EVENT_SCROLL, NULL); - if(res != LV_RESULT_OK) return res; + lv_res_t res = lv_event_send(obj, LV_EVENT_SCROLL, NULL); + if(res != LV_RES_OK) return res; lv_obj_invalidate(obj); - return LV_RESULT_OK; + return LV_RES_OK; } + bool lv_obj_is_scrolling(const lv_obj_t * obj) { lv_indev_t * indev = lv_indev_get_next(NULL); @@ -442,8 +442,6 @@ void lv_obj_update_snap(lv_obj_t * obj, lv_anim_enable_t anim_en) lv_obj_update_layout(obj); lv_point_t p; lv_indev_scroll_get_snap_dist(obj, &p); - if(p.x == LV_COORD_MAX || p.x == LV_COORD_MIN) p.x = 0; - if(p.y == LV_COORD_MAX || p.y == LV_COORD_MIN) p.y = 0; lv_obj_scroll_by(obj, p.x, p.y, anim_en); } @@ -454,7 +452,7 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t * if(lv_obj_has_flag(obj, LV_OBJ_FLAG_SCROLLABLE) == false) return; - lv_scrollbar_mode_t sm = lv_obj_get_scrollbar_mode(obj); + lv_dir_t sm = lv_obj_get_scrollbar_mode(obj); if(sm == LV_SCROLLBAR_MODE_OFF) return; /*If there is no indev scrolling this object but `mode==active` return*/ @@ -467,10 +465,10 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t * if(indev == NULL) return; } - int32_t st = lv_obj_get_scroll_top(obj); - int32_t sb = lv_obj_get_scroll_bottom(obj); - int32_t sl = lv_obj_get_scroll_left(obj); - int32_t sr = lv_obj_get_scroll_right(obj); + lv_coord_t st = lv_obj_get_scroll_top(obj); + lv_coord_t sb = lv_obj_get_scroll_bottom(obj); + lv_coord_t sl = lv_obj_get_scroll_left(obj); + lv_coord_t sr = lv_obj_get_scroll_right(obj); lv_dir_t dir = lv_obj_get_scroll_dir(obj); @@ -482,6 +480,7 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t * ver_draw = true; } + bool hor_draw = false; if((dir & LV_DIR_HOR) && ((sm == LV_SCROLLBAR_MODE_ON) || @@ -492,21 +491,21 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t * if(!hor_draw && !ver_draw) return; - bool rtl = lv_obj_get_style_base_dir(obj, LV_PART_SCROLLBAR) == LV_BASE_DIR_RTL; + bool rtl = lv_obj_get_style_base_dir(obj, LV_PART_SCROLLBAR) == LV_BASE_DIR_RTL ? true : false; - int32_t top_space = lv_obj_get_style_pad_top(obj, LV_PART_SCROLLBAR); - int32_t bottom_space = lv_obj_get_style_pad_bottom(obj, LV_PART_SCROLLBAR); - int32_t left_space = lv_obj_get_style_pad_left(obj, LV_PART_SCROLLBAR); - int32_t right_space = lv_obj_get_style_pad_right(obj, LV_PART_SCROLLBAR); - int32_t thickness = lv_obj_get_style_width(obj, LV_PART_SCROLLBAR); + lv_coord_t top_space = lv_obj_get_style_pad_top(obj, LV_PART_SCROLLBAR); + lv_coord_t bottom_space = lv_obj_get_style_pad_bottom(obj, LV_PART_SCROLLBAR); + lv_coord_t left_space = lv_obj_get_style_pad_left(obj, LV_PART_SCROLLBAR); + lv_coord_t right_space = lv_obj_get_style_pad_right(obj, LV_PART_SCROLLBAR); + lv_coord_t tickness = lv_obj_get_style_width(obj, LV_PART_SCROLLBAR); - int32_t obj_h = lv_obj_get_height(obj); - int32_t obj_w = lv_obj_get_width(obj); + lv_coord_t obj_h = lv_obj_get_height(obj); + lv_coord_t obj_w = lv_obj_get_width(obj); /*Space required for the vertical and horizontal scrollbars*/ - int32_t ver_reg_space = ver_draw ? thickness : 0; - int32_t hor_req_space = hor_draw ? thickness : 0; - int32_t rem; + lv_coord_t ver_reg_space = ver_draw ? tickness : 0; + lv_coord_t hor_req_space = hor_draw ? tickness : 0; + lv_coord_t rem; if(lv_obj_get_style_bg_opa(obj, LV_PART_SCROLLBAR) < LV_OPA_MIN && lv_obj_get_style_border_opa(obj, LV_PART_SCROLLBAR) < LV_OPA_MIN) { @@ -514,30 +513,30 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t * } /*Draw vertical scrollbar if the mode is ON or can be scrolled in this direction*/ - int32_t content_h = obj_h + st + sb; + lv_coord_t content_h = obj_h + st + sb; if(ver_draw && content_h) { ver_area->y1 = obj->coords.y1; ver_area->y2 = obj->coords.y2; if(rtl) { ver_area->x1 = obj->coords.x1 + left_space; - ver_area->x2 = ver_area->x1 + thickness - 1; + ver_area->x2 = ver_area->x1 + tickness - 1; } else { ver_area->x2 = obj->coords.x2 - right_space; - ver_area->x1 = ver_area->x2 - thickness + 1; + ver_area->x1 = ver_area->x2 - tickness + 1; } - int32_t sb_h = ((obj_h - top_space - bottom_space - hor_req_space) * obj_h) / content_h; + lv_coord_t sb_h = ((obj_h - top_space - bottom_space - hor_req_space) * obj_h) / content_h; sb_h = LV_MAX(sb_h, SCROLLBAR_MIN_SIZE); rem = (obj_h - top_space - bottom_space - hor_req_space) - sb_h; /*Remaining size from the scrollbar track that is not the scrollbar itself*/ - int32_t scroll_h = content_h - obj_h; /*The size of the content which can be really scrolled*/ + lv_coord_t scroll_h = content_h - obj_h; /*The size of the content which can be really scrolled*/ if(scroll_h <= 0) { ver_area->y1 = obj->coords.y1 + top_space; ver_area->y2 = obj->coords.y2 - bottom_space - hor_req_space - 1; } else { - int32_t sb_y = (rem * sb) / scroll_h; + lv_coord_t sb_y = (rem * sb) / scroll_h; sb_y = rem - sb_y; ver_area->y1 = obj->coords.y1 + sb_y + top_space; @@ -558,18 +557,18 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t * } /*Draw horizontal scrollbar if the mode is ON or can be scrolled in this direction*/ - int32_t content_w = obj_w + sl + sr; + lv_coord_t content_w = obj_w + sl + sr; if(hor_draw && content_w) { hor_area->y2 = obj->coords.y2 - bottom_space; - hor_area->y1 = hor_area->y2 - thickness + 1; + hor_area->y1 = hor_area->y2 - tickness + 1; hor_area->x1 = obj->coords.x1; hor_area->x2 = obj->coords.x2; - int32_t sb_w = ((obj_w - left_space - right_space - ver_reg_space) * obj_w) / content_w; + lv_coord_t sb_w = ((obj_w - left_space - right_space - ver_reg_space) * obj_w) / content_w; sb_w = LV_MAX(sb_w, SCROLLBAR_MIN_SIZE); rem = (obj_w - left_space - right_space - ver_reg_space) - sb_w; /*Remaining size from the scrollbar track that is not the scrollbar itself*/ - int32_t scroll_w = content_w - obj_w; /*The size of the content which can be really scrolled*/ + lv_coord_t scroll_w = content_w - obj_w; /*The size of the content which can be really scrolled*/ if(scroll_w <= 0) { if(rtl) { hor_area->x1 = obj->coords.x1 + left_space + ver_reg_space - 1; @@ -581,7 +580,7 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t * } } else { - int32_t sb_x = (rem * sr) / scroll_w; + lv_coord_t sb_x = (rem * sr) / scroll_w; sb_x = rem - sb_x; if(rtl) { @@ -637,8 +636,8 @@ void lv_obj_readjust_scroll(lv_obj_t * obj, lv_anim_enable_t anim_en) /*Be sure the bottom side is not remains scrolled in*/ /*With snapping the content can't be scrolled in*/ if(lv_obj_get_scroll_snap_y(obj) == LV_SCROLL_SNAP_NONE) { - int32_t st = lv_obj_get_scroll_top(obj); - int32_t sb = lv_obj_get_scroll_bottom(obj); + lv_coord_t st = lv_obj_get_scroll_top(obj); + lv_coord_t sb = lv_obj_get_scroll_bottom(obj); if(sb < 0 && st > 0) { sb = LV_MIN(st, -sb); lv_obj_scroll_by(obj, 0, sb, anim_en); @@ -646,8 +645,8 @@ void lv_obj_readjust_scroll(lv_obj_t * obj, lv_anim_enable_t anim_en) } if(lv_obj_get_scroll_snap_x(obj) == LV_SCROLL_SNAP_NONE) { - int32_t sl = lv_obj_get_scroll_left(obj); - int32_t sr = lv_obj_get_scroll_right(obj); + lv_coord_t sl = lv_obj_get_scroll_left(obj); + lv_coord_t sr = lv_obj_get_scroll_right(obj); if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) != LV_BASE_DIR_RTL) { /*Be sure the left side is not remains scrolled in*/ if(sr < 0 && sl > 0) { @@ -669,20 +668,20 @@ void lv_obj_readjust_scroll(lv_obj_t * obj, lv_anim_enable_t anim_en) * STATIC FUNCTIONS **********************/ + static void scroll_x_anim(void * obj, int32_t v) { - lv_obj_scroll_by_raw(obj, v + lv_obj_get_scroll_x(obj), 0); + _lv_obj_scroll_by_raw(obj, v + lv_obj_get_scroll_x(obj), 0); } static void scroll_y_anim(void * obj, int32_t v) { - lv_obj_scroll_by_raw(obj, 0, v + lv_obj_get_scroll_y(obj)); + _lv_obj_scroll_by_raw(obj, 0, v + lv_obj_get_scroll_y(obj)); } -static void scroll_end_cb(lv_anim_t * a) +static void scroll_anim_ready_cb(lv_anim_t * a) { - /*Do not sent END event if there wasn't a BEGIN*/ - if(a->start_cb_called) lv_obj_send_event(a->var, LV_EVENT_SCROLL_END, NULL); + lv_event_send(a->var, LV_EVENT_SCROLL_END, NULL); } static void scroll_area_into_view(const lv_area_t * area, lv_obj_t * child, lv_point_t * scroll_value, @@ -692,101 +691,103 @@ static void scroll_area_into_view(const lv_area_t * area, lv_obj_t * child, lv_p if(!lv_obj_has_flag(parent, LV_OBJ_FLAG_SCROLLABLE)) return; lv_dir_t scroll_dir = lv_obj_get_scroll_dir(parent); - int32_t snap_goal = 0; - int32_t act = 0; + lv_coord_t snap_goal = 0; + lv_coord_t act = 0; const lv_area_t * area_tmp; - int32_t y_scroll = 0; + lv_coord_t y_scroll = 0; lv_scroll_snap_t snap_y = lv_obj_get_scroll_snap_y(parent); if(snap_y != LV_SCROLL_SNAP_NONE) area_tmp = &child->coords; else area_tmp = area; - int32_t stop = lv_obj_get_style_space_top(parent, LV_PART_MAIN); - int32_t sbottom = lv_obj_get_style_space_bottom(parent, LV_PART_MAIN); - int32_t top_diff = parent->coords.y1 + stop - area_tmp->y1 - scroll_value->y; - int32_t bottom_diff = -(parent->coords.y2 - sbottom - area_tmp->y2 - scroll_value->y); - int32_t parent_h = lv_obj_get_height(parent) - stop - sbottom; + lv_coord_t border_width = lv_obj_get_style_border_width(parent, LV_PART_MAIN); + lv_coord_t ptop = lv_obj_get_style_pad_top(parent, LV_PART_MAIN) + border_width; + lv_coord_t pbottom = lv_obj_get_style_pad_bottom(parent, LV_PART_MAIN) + border_width; + lv_coord_t top_diff = parent->coords.y1 + ptop - area_tmp->y1 - scroll_value->y; + lv_coord_t bottom_diff = -(parent->coords.y2 - pbottom - area_tmp->y2 - scroll_value->y); + lv_coord_t parent_h = lv_obj_get_height(parent) - ptop - pbottom; if((top_diff >= 0 && bottom_diff >= 0)) y_scroll = 0; else if(top_diff > 0) { y_scroll = top_diff; /*Do not let scrolling in*/ - int32_t st = lv_obj_get_scroll_top(parent); + lv_coord_t st = lv_obj_get_scroll_top(parent); if(st - y_scroll < 0) y_scroll = 0; } else if(bottom_diff > 0) { y_scroll = -bottom_diff; /*Do not let scrolling in*/ - int32_t sb = lv_obj_get_scroll_bottom(parent); + lv_coord_t sb = lv_obj_get_scroll_bottom(parent); if(sb + y_scroll < 0) y_scroll = 0; } switch(snap_y) { case LV_SCROLL_SNAP_START: - snap_goal = parent->coords.y1 + stop; + snap_goal = parent->coords.y1 + ptop; act = area_tmp->y1 + y_scroll; y_scroll += snap_goal - act; break; case LV_SCROLL_SNAP_END: - snap_goal = parent->coords.y2 - sbottom; + snap_goal = parent->coords.y2 - pbottom; act = area_tmp->y2 + y_scroll; y_scroll += snap_goal - act; break; case LV_SCROLL_SNAP_CENTER: - snap_goal = parent->coords.y1 + stop + parent_h / 2; + snap_goal = parent->coords.y1 + ptop + parent_h / 2; act = lv_area_get_height(area_tmp) / 2 + area_tmp->y1 + y_scroll; y_scroll += snap_goal - act; break; - case LV_SCROLL_SNAP_NONE: - break; } - int32_t x_scroll = 0; + lv_coord_t x_scroll = 0; lv_scroll_snap_t snap_x = lv_obj_get_scroll_snap_x(parent); if(snap_x != LV_SCROLL_SNAP_NONE) area_tmp = &child->coords; else area_tmp = area; - int32_t sleft = lv_obj_get_style_space_left(parent, LV_PART_MAIN); - int32_t sright = lv_obj_get_style_space_right(parent, LV_PART_MAIN); - int32_t left_diff = parent->coords.x1 + sleft - area_tmp->x1 - scroll_value->x; - int32_t right_diff = -(parent->coords.x2 - sright - area_tmp->x2 - scroll_value->x); + lv_coord_t pleft = lv_obj_get_style_pad_left(parent, LV_PART_MAIN) + border_width; + lv_coord_t pright = lv_obj_get_style_pad_right(parent, LV_PART_MAIN) + border_width; + lv_coord_t left_diff = parent->coords.x1 + pleft - area_tmp->x1 - scroll_value->x; + lv_coord_t right_diff = -(parent->coords.x2 - pright - area_tmp->x2 - scroll_value->x); if((left_diff >= 0 && right_diff >= 0)) x_scroll = 0; else if(left_diff > 0) { x_scroll = left_diff; /*Do not let scrolling in*/ - int32_t sl = lv_obj_get_scroll_left(parent); + lv_coord_t sl = lv_obj_get_scroll_left(parent); if(sl - x_scroll < 0) x_scroll = 0; } else if(right_diff > 0) { x_scroll = -right_diff; /*Do not let scrolling in*/ - int32_t sr = lv_obj_get_scroll_right(parent); + lv_coord_t sr = lv_obj_get_scroll_right(parent); if(sr + x_scroll < 0) x_scroll = 0; } - int32_t parent_w = lv_obj_get_width(parent) - sleft - sright; + lv_coord_t parent_w = lv_obj_get_width(parent) - pleft - pright; switch(snap_x) { case LV_SCROLL_SNAP_START: - snap_goal = parent->coords.x1 + sleft; + snap_goal = parent->coords.x1 + pleft; act = area_tmp->x1 + x_scroll; x_scroll += snap_goal - act; break; case LV_SCROLL_SNAP_END: - snap_goal = parent->coords.x2 - sright; + snap_goal = parent->coords.x2 - pright; act = area_tmp->x2 + x_scroll; x_scroll += snap_goal - act; break; case LV_SCROLL_SNAP_CENTER: - snap_goal = parent->coords.x1 + sleft + parent_w / 2; + snap_goal = parent->coords.x1 + pleft + parent_w / 2; act = lv_area_get_width(area_tmp) / 2 + area_tmp->x1 + x_scroll; x_scroll += snap_goal - act; break; - case LV_SCROLL_SNAP_NONE: - break; } /*Remove any pending scroll animations.*/ - lv_anim_delete(parent, scroll_y_anim); - lv_anim_delete(parent, scroll_x_anim); + bool y_del = lv_anim_del(parent, scroll_y_anim); + bool x_del = lv_anim_del(parent, scroll_x_anim); + if(y_del || x_del) { + lv_res_t res; + res = lv_event_send(parent, LV_EVENT_SCROLL_END, NULL); + if(res != LV_RES_OK) return; + } if((scroll_dir & LV_DIR_LEFT) == 0 && x_scroll < 0) x_scroll = 0; if((scroll_dir & LV_DIR_RIGHT) == 0 && x_scroll > 0) x_scroll = 0; diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_scroll.h b/L3_Middlewares/LVGL/src/core/lv_obj_scroll.h index f2cb2f1..459389e 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_scroll.h +++ b/L3_Middlewares/LVGL/src/core/lv_obj_scroll.h @@ -26,22 +26,26 @@ extern "C" { **********************/ /*Can't include lv_obj.h because it includes this header file*/ +struct _lv_obj_t; /** Scrollbar modes: shows when should the scrollbars be visible*/ -typedef enum { +enum { LV_SCROLLBAR_MODE_OFF, /**< Never show scrollbars*/ LV_SCROLLBAR_MODE_ON, /**< Always show scrollbars*/ LV_SCROLLBAR_MODE_ACTIVE, /**< Show scroll bars when object is being scrolled*/ LV_SCROLLBAR_MODE_AUTO, /**< Show scroll bars when the content is large enough to be scrolled*/ -} lv_scrollbar_mode_t; +}; +typedef uint8_t lv_scrollbar_mode_t; + /** Scroll span align options. Tells where to align the snappable children when scroll stops.*/ -typedef enum { +enum { LV_SCROLL_SNAP_NONE, /**< Do not align, leave where it is*/ LV_SCROLL_SNAP_START, /**< Align to the left/top*/ LV_SCROLL_SNAP_END, /**< Align to the right/bottom*/ LV_SCROLL_SNAP_CENTER /**< Align to the center*/ -} lv_scroll_snap_t; +}; +typedef uint8_t lv_scroll_snap_t; /********************** * GLOBAL PROTOTYPES @@ -56,28 +60,28 @@ typedef enum { * @param obj pointer to an object * @param mode LV_SCROLL_MODE_ON/OFF/AUTO/ACTIVE */ -void lv_obj_set_scrollbar_mode(lv_obj_t * obj, lv_scrollbar_mode_t mode); +void lv_obj_set_scrollbar_mode(struct _lv_obj_t * obj, lv_scrollbar_mode_t mode); /** * Set the object in which directions can be scrolled * @param obj pointer to an object * @param dir the allow scroll directions. An element or OR-ed values of `lv_dir_t` */ -void lv_obj_set_scroll_dir(lv_obj_t * obj, lv_dir_t dir); +void lv_obj_set_scroll_dir(struct _lv_obj_t * obj, lv_dir_t dir); /** * Set where to snap the children when scrolling ends horizontally * @param obj pointer to an object * @param align the snap align to set from `lv_scroll_snap_t` */ -void lv_obj_set_scroll_snap_x(lv_obj_t * obj, lv_scroll_snap_t align); +void lv_obj_set_scroll_snap_x(struct _lv_obj_t * obj, lv_scroll_snap_t align); /** * Set where to snap the children when scrolling ends vertically * @param obj pointer to an object * @param align the snap align to set from `lv_scroll_snap_t` */ -void lv_obj_set_scroll_snap_y(lv_obj_t * obj, lv_scroll_snap_t align); +void lv_obj_set_scroll_snap_y(struct _lv_obj_t * obj, lv_scroll_snap_t align); /*===================== * Getter functions @@ -88,27 +92,28 @@ void lv_obj_set_scroll_snap_y(lv_obj_t * obj, lv_scroll_snap_t align); * @param obj pointer to an object * @return the current scroll mode from `lv_scrollbar_mode_t` */ -lv_scrollbar_mode_t lv_obj_get_scrollbar_mode(const lv_obj_t * obj); +lv_scrollbar_mode_t lv_obj_get_scrollbar_mode(const struct _lv_obj_t * obj); /** * Get the object in which directions can be scrolled * @param obj pointer to an object + * @param dir the allow scroll directions. An element or OR-ed values of `lv_dir_t` */ -lv_dir_t lv_obj_get_scroll_dir(const lv_obj_t * obj); +lv_dir_t lv_obj_get_scroll_dir(const struct _lv_obj_t * obj); /** * Get where to snap the children when scrolling ends horizontally * @param obj pointer to an object * @return the current snap align from `lv_scroll_snap_t` */ -lv_scroll_snap_t lv_obj_get_scroll_snap_x(const lv_obj_t * obj); +lv_scroll_snap_t lv_obj_get_scroll_snap_x(const struct _lv_obj_t * obj); /** * Get where to snap the children when scrolling ends vertically * @param obj pointer to an object * @return the current snap align from `lv_scroll_snap_t` */ -lv_scroll_snap_t lv_obj_get_scroll_snap_y(const lv_obj_t * obj); +lv_scroll_snap_t lv_obj_get_scroll_snap_y(const struct _lv_obj_t * obj); /** * Get current X scroll position. @@ -118,7 +123,7 @@ lv_scroll_snap_t lv_obj_get_scroll_snap_y(const lv_obj_t * obj); * If scrolled return > 0 * If scrolled in (elastic scroll) return < 0 */ -int32_t lv_obj_get_scroll_x(const lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_x(const struct _lv_obj_t * obj); /** * Get current Y scroll position. @@ -128,7 +133,7 @@ int32_t lv_obj_get_scroll_x(const lv_obj_t * obj); * If scrolled return > 0 * If scrolled inside return < 0 */ -int32_t lv_obj_get_scroll_y(const lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_y(const struct _lv_obj_t * obj); /** * Return the height of the area above the object. @@ -137,7 +142,7 @@ int32_t lv_obj_get_scroll_y(const lv_obj_t * obj); * @param obj pointer to an object * @return the scrollable area above the object in pixels */ -int32_t lv_obj_get_scroll_top(lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_top(struct _lv_obj_t * obj); /** * Return the height of the area below the object. @@ -146,7 +151,7 @@ int32_t lv_obj_get_scroll_top(lv_obj_t * obj); * @param obj pointer to an object * @return the scrollable area below the object in pixels */ -int32_t lv_obj_get_scroll_bottom(lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_bottom(struct _lv_obj_t * obj); /** * Return the width of the area on the left the object. @@ -155,7 +160,7 @@ int32_t lv_obj_get_scroll_bottom(lv_obj_t * obj); * @param obj pointer to an object * @return the scrollable area on the left the object in pixels */ -int32_t lv_obj_get_scroll_left(lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_left(struct _lv_obj_t * obj); /** * Return the width of the area on the right the object. @@ -164,7 +169,7 @@ int32_t lv_obj_get_scroll_left(lv_obj_t * obj); * @param obj pointer to an object * @return the scrollable area on the right the object in pixels */ -int32_t lv_obj_get_scroll_right(lv_obj_t * obj); +lv_coord_t lv_obj_get_scroll_right(struct _lv_obj_t * obj); /** * Get the X and Y coordinates where the scrolling will end for this object if a scrolling animation is in progress. @@ -172,7 +177,7 @@ int32_t lv_obj_get_scroll_right(lv_obj_t * obj); * @param obj pointer to an object * @param end pointer to store the result */ -void lv_obj_get_scroll_end(lv_obj_t * obj, lv_point_t * end); +void lv_obj_get_scroll_end(struct _lv_obj_t * obj, lv_point_t * end); /*===================== * Other functions @@ -181,13 +186,13 @@ void lv_obj_get_scroll_end(lv_obj_t * obj, lv_point_t * end); /** * Scroll by a given amount of pixels * @param obj pointer to an object to scroll - * @param x pixels to scroll horizontally - * @param y pixels to scroll vertically + * @param dx pixels to scroll horizontally + * @param dy pixels to scroll vertically * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately * @note > 0 value means scroll right/bottom (show the more content on the right/bottom) * @note e.g. dy = -20 means scroll down 20 px */ -void lv_obj_scroll_by(lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t anim_en); +void lv_obj_scroll_by(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en); /** * Scroll by a given amount of pixels. @@ -198,7 +203,7 @@ void lv_obj_scroll_by(lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t ani * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately * @note e.g. dy = -20 means scroll down 20 px */ -void lv_obj_scroll_by_bounded(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en); +void lv_obj_scroll_by_bounded(struct _lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enable_t anim_en); /** * Scroll to a given coordinate on an object. @@ -208,7 +213,7 @@ void lv_obj_scroll_by_bounded(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_en * @param y pixels to scroll vertically * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately */ -void lv_obj_scroll_to(lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t anim_en); +void lv_obj_scroll_to(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en); /** * Scroll to a given X coordinate on an object. @@ -217,7 +222,7 @@ void lv_obj_scroll_to(lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t ani * @param x pixels to scroll horizontally * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately */ -void lv_obj_scroll_to_x(lv_obj_t * obj, int32_t x, lv_anim_enable_t anim_en); +void lv_obj_scroll_to_x(struct _lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t anim_en); /** * Scroll to a given Y coordinate on an object @@ -226,14 +231,14 @@ void lv_obj_scroll_to_x(lv_obj_t * obj, int32_t x, lv_anim_enable_t anim_en); * @param y pixels to scroll vertically * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately */ -void lv_obj_scroll_to_y(lv_obj_t * obj, int32_t y, lv_anim_enable_t anim_en); +void lv_obj_scroll_to_y(struct _lv_obj_t * obj, lv_coord_t y, lv_anim_enable_t anim_en); /** * Scroll to an object until it becomes visible on its parent * @param obj pointer to an object to scroll into view * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately */ -void lv_obj_scroll_to_view(lv_obj_t * obj, lv_anim_enable_t anim_en); +void lv_obj_scroll_to_view(struct _lv_obj_t * obj, lv_anim_enable_t anim_en); /** * Scroll to an object until it becomes visible on its parent. @@ -242,21 +247,33 @@ void lv_obj_scroll_to_view(lv_obj_t * obj, lv_anim_enable_t anim_en); * @param obj pointer to an object to scroll into view * @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately */ -void lv_obj_scroll_to_view_recursive(lv_obj_t * obj, lv_anim_enable_t anim_en); +void lv_obj_scroll_to_view_recursive(struct _lv_obj_t * obj, lv_anim_enable_t anim_en); + + +/** + * Low level function to scroll by given x and y coordinates. + * `LV_EVENT_SCROLL` is sent. + * @param obj pointer to an object to scroll + * @param x pixels to scroll horizontally + * @param y pixels to scroll vertically + * @return `LV_RES_INV`: to object was deleted in `LV_EVENT_SCROLL`; + * `LV_RES_OK`: if the object is still valid + */ +lv_res_t _lv_obj_scroll_by_raw(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y); /** * Tell whether an object is being scrolled or not at this moment * @param obj pointer to an object * @return true: `obj` is being scrolled */ -bool lv_obj_is_scrolling(const lv_obj_t * obj); +bool lv_obj_is_scrolling(const struct _lv_obj_t * obj); /** * Check the children of `obj` and scroll `obj` to fulfill the scroll_snap settings * @param obj an object whose children needs to checked and snapped * @param anim_en LV_ANIM_ON/OFF */ -void lv_obj_update_snap(lv_obj_t * obj, lv_anim_enable_t anim_en); +void lv_obj_update_snap(struct _lv_obj_t * obj, lv_anim_enable_t anim_en); /** * Get the area of the scrollbars @@ -264,20 +281,20 @@ void lv_obj_update_snap(lv_obj_t * obj, lv_anim_enable_t anim_en); * @param hor pointer to store the area of the horizontal scrollbar * @param ver pointer to store the area of the vertical scrollbar */ -void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor, lv_area_t * ver); +void lv_obj_get_scrollbar_area(struct _lv_obj_t * obj, lv_area_t * hor, lv_area_t * ver); /** * Invalidate the area of the scrollbars * @param obj pointer to an object */ -void lv_obj_scrollbar_invalidate(lv_obj_t * obj); +void lv_obj_scrollbar_invalidate(struct _lv_obj_t * obj); /** * Checks if the content is scrolled "in" and adjusts it to a normal position. * @param obj pointer to an object * @param anim_en LV_ANIM_ON/OFF */ -void lv_obj_readjust_scroll(lv_obj_t * obj, lv_anim_enable_t anim_en); +void lv_obj_readjust_scroll(struct _lv_obj_t * obj, lv_anim_enable_t anim_en); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_scroll_private.h b/L3_Middlewares/LVGL/src/core/lv_obj_scroll_private.h deleted file mode 100644 index 9ae6332..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_obj_scroll_private.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file lv_obj_scroll_private.h - * - */ - -#ifndef LV_OBJ_SCROLL_PRIVATE_H -#define LV_OBJ_SCROLL_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_obj_scroll.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Low level function to scroll by given x and y coordinates. - * `LV_EVENT_SCROLL` is sent. - * @param obj pointer to an object to scroll - * @param x pixels to scroll horizontally - * @param y pixels to scroll vertically - * @return `LV_RESULT_INVALID`: to object was deleted in `LV_EVENT_SCROLL`; - * `LV_RESULT_OK`: if the object is still valid - */ -lv_result_t lv_obj_scroll_by_raw(lv_obj_t * obj, int32_t x, int32_t y); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OBJ_SCROLL_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_style.c b/L3_Middlewares/LVGL/src/core/lv_obj_style.c index 06e3ffe..ecffca9 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_style.c +++ b/L3_Middlewares/LVGL/src/core/lv_obj_style.c @@ -6,23 +6,14 @@ /********************* * INCLUDES *********************/ -#include "lv_obj_private.h" -#include "../misc/lv_anim_private.h" -#include "lv_obj_style_private.h" -#include "lv_obj_class_private.h" -#include "../display/lv_display.h" -#include "../display/lv_display_private.h" -#include "../misc/lv_color.h" -#include "../stdlib/lv_string.h" -#include "../core/lv_global.h" +#include "lv_obj.h" +#include "lv_disp.h" +#include "../misc/lv_gc.h" + /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_obj_class) -#define style_refr LV_GLOBAL_DEFAULT()->style_refresh -#define style_trans_ll_p &(LV_GLOBAL_DEFAULT()->style_trans_ll) -#define _style_custom_prop_flag_lookup_table LV_GLOBAL_DEFAULT()->style_custom_prop_flag_lookup_table -#define STYLE_PROP_SHIFTED(prop) ((uint32_t)1 << ((prop) >> 3)) +#define MY_CLASS &lv_obj_class /********************** * TYPEDEFS @@ -52,26 +43,22 @@ typedef enum { * STATIC PROTOTYPES **********************/ static lv_style_t * get_local_style(lv_obj_t * obj, lv_style_selector_t selector); -static lv_obj_style_t * get_trans_style(lv_obj_t * obj, lv_part_t part); -static lv_style_res_t get_prop_core(const lv_obj_t * obj, lv_style_selector_t selector, lv_style_prop_t prop, - lv_style_value_t * v); +static _lv_obj_style_t * get_trans_style(lv_obj_t * obj, uint32_t part); +static lv_style_res_t get_prop_core(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, lv_style_value_t * v); static void report_style_change_core(void * style, lv_obj_t * obj); static void refresh_children_style(lv_obj_t * obj); -static bool trans_delete(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, trans_t * tr_limit); +static bool trans_del(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, trans_t * tr_limit); static void trans_anim_cb(void * _tr, int32_t v); static void trans_anim_start_cb(lv_anim_t * a); -static void trans_anim_completed_cb(lv_anim_t * a); +static void trans_anim_ready_cb(lv_anim_t * a); static lv_layer_type_t calculate_layer_type(lv_obj_t * obj); -static void full_cache_refresh(lv_obj_t * obj, lv_part_t part); static void fade_anim_cb(void * obj, int32_t v); -static void fade_in_anim_completed(lv_anim_t * a); -static bool style_has_flag(const lv_style_t * style, uint32_t flag); -static lv_style_res_t get_selector_style_prop(const lv_obj_t * obj, lv_style_selector_t selector, lv_style_prop_t prop, - lv_style_value_t * value_act); +static void fade_in_anim_ready(lv_anim_t * a); /********************** * STATIC VARIABLES **********************/ +static bool style_refr = true; /********************** * MACROS @@ -81,34 +68,14 @@ static lv_style_res_t get_selector_style_prop(const lv_obj_t * obj, lv_style_sel * GLOBAL FUNCTIONS **********************/ -void lv_obj_style_init(void) -{ - lv_ll_init(style_trans_ll_p, sizeof(trans_t)); -} - -void lv_obj_style_deinit(void) +void _lv_obj_style_init(void) { - lv_ll_clear(style_trans_ll_p); - if(_style_custom_prop_flag_lookup_table != NULL) { - lv_free(_style_custom_prop_flag_lookup_table); - _style_custom_prop_flag_lookup_table = NULL; - } + _lv_ll_init(&LV_GC_ROOT(_lv_obj_style_trans_ll), sizeof(trans_t)); } -void lv_obj_add_style(lv_obj_t * obj, const lv_style_t * style, lv_style_selector_t selector) +void lv_obj_add_style(lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector) { - LV_ASSERT(obj->style_cnt < 63); - - trans_delete(obj, selector, LV_STYLE_PROP_ANY, NULL); - - lv_part_t part = lv_obj_style_get_selector_part(selector); - - if(style && part == LV_PART_MAIN && style_has_flag(style, LV_STYLE_PROP_FLAG_TRANSFORM)) { - lv_obj_invalidate(obj); - } - - /*Try removing the style first to be sure it won't be added twice*/ - lv_obj_remove_style(obj, style, selector); + trans_del(obj, selector, LV_STYLE_PROP_ANY, NULL); uint32_t i; /*Go after the transition and local styles*/ @@ -122,95 +89,27 @@ void lv_obj_add_style(lv_obj_t * obj, const lv_style_t * style, lv_style_selecto /*Allocate space for the new style and shift the rest of the style to the end*/ obj->style_cnt++; - LV_ASSERT(obj->style_cnt != 0); - obj->styles = lv_realloc(obj->styles, obj->style_cnt * sizeof(lv_obj_style_t)); - LV_ASSERT_MALLOC(obj->styles); + obj->styles = lv_mem_realloc(obj->styles, obj->style_cnt * sizeof(_lv_obj_style_t)); uint32_t j; for(j = obj->style_cnt - 1; j > i ; j--) { obj->styles[j] = obj->styles[j - 1]; } - lv_memzero(&obj->styles[i], sizeof(lv_obj_style_t)); + lv_memset_00(&obj->styles[i], sizeof(_lv_obj_style_t)); obj->styles[i].style = style; obj->styles[i].selector = selector; -#if LV_OBJ_STYLE_CACHE - uint32_t * prop_is_set = part == LV_PART_MAIN ? &obj->style_main_prop_is_set : &obj->style_other_prop_is_set; - if(lv_style_is_const(style)) { - lv_style_const_prop_t * props = style->values_and_props; - for(i = 0; props[i].prop != LV_STYLE_PROP_INV; i++) { - (*prop_is_set) |= STYLE_PROP_SHIFTED(props[i].prop); - } - } - else { - lv_style_prop_t * props = (lv_style_prop_t *)style->values_and_props + style->prop_cnt * sizeof(lv_style_value_t); - for(i = 0; i < style->prop_cnt; i++) { - (*prop_is_set) |= STYLE_PROP_SHIFTED(props[i]); - } - } -#endif - lv_obj_refresh_style(obj, selector, LV_STYLE_PROP_ANY); } -bool lv_obj_replace_style(lv_obj_t * obj, const lv_style_t * old_style, const lv_style_t * new_style, - lv_style_selector_t selector) -{ - lv_state_t state = lv_obj_style_get_selector_state(selector); - lv_part_t part = lv_obj_style_get_selector_part(selector); - - /*All objects must exist*/ - if(!obj || !old_style || !new_style || (old_style == new_style)) { - return false; - } - - /*Similar to lv_obj_add_style, delete transition*/ - trans_delete(obj, selector, LV_STYLE_PROP_ANY, NULL); - - bool replaced = false; - uint32_t i; - for(i = 0; i < obj->style_cnt; i++) { - lv_state_t state_act = lv_obj_style_get_selector_state(obj->styles[i].selector); - lv_part_t part_act = lv_obj_style_get_selector_part(obj->styles[i].selector); - - /*Skip local styles and transitions*/ - if(obj->styles[i].is_local || obj->styles[i].is_trans) { - continue; - } - - /*Skip non-matching styles*/ - if((state != LV_STATE_ANY && state_act != state) || - (part != LV_PART_ANY && part_act != part) || - (old_style != obj->styles[i].style)) { - continue; - } - - lv_memzero(&obj->styles[i], sizeof(lv_obj_style_t)); - obj->styles[i].style = new_style; - obj->styles[i].selector = selector; - - replaced = true; - /*Don't break and continue replacing other occurrences*/ - } - if(replaced) { - full_cache_refresh(obj, part); - lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ANY); - } - return replaced; -} - -void lv_obj_remove_style(lv_obj_t * obj, const lv_style_t * style, lv_style_selector_t selector) +void lv_obj_remove_style(lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector) { lv_state_t state = lv_obj_style_get_selector_state(selector); lv_part_t part = lv_obj_style_get_selector_part(selector); lv_style_prop_t prop = LV_STYLE_PROP_ANY; if(style && style->prop_cnt == 0) prop = LV_STYLE_PROP_INV; - if(style && part == LV_PART_MAIN && style_has_flag(style, LV_STYLE_PROP_FLAG_TRANSFORM)) { - lv_obj_invalidate(obj); - } - uint32_t i = 0; bool deleted = false; while(i < obj->style_cnt) { @@ -224,12 +123,12 @@ void lv_obj_remove_style(lv_obj_t * obj, const lv_style_t * style, lv_style_sele } if(obj->styles[i].is_trans) { - trans_delete(obj, part, LV_STYLE_PROP_ANY, NULL); + trans_del(obj, part, LV_STYLE_PROP_ANY, NULL); } if(obj->styles[i].is_local || obj->styles[i].is_trans) { - if(obj->styles[i].style) lv_style_reset((lv_style_t *)obj->styles[i].style); - lv_free((lv_style_t *)obj->styles[i].style); + lv_style_reset(obj->styles[i].style); + lv_mem_free(obj->styles[i].style); obj->styles[i].style = NULL; } @@ -240,35 +139,28 @@ void lv_obj_remove_style(lv_obj_t * obj, const lv_style_t * style, lv_style_sele } obj->style_cnt--; - obj->styles = lv_realloc(obj->styles, obj->style_cnt * sizeof(lv_obj_style_t)); + obj->styles = lv_mem_realloc(obj->styles, obj->style_cnt * sizeof(_lv_obj_style_t)); deleted = true; /*The style from the current `i` index is removed, so `i` points to the next style. *Therefore it doesn't needs to be incremented*/ } - if(deleted && prop != LV_STYLE_PROP_INV) { - full_cache_refresh(obj, part); lv_obj_refresh_style(obj, part, prop); } } -void lv_obj_remove_style_all(lv_obj_t * obj) -{ - lv_obj_remove_style(obj, NULL, LV_PART_ANY | LV_STATE_ANY); -} - void lv_obj_report_style_change(lv_style_t * style) { if(!style_refr) return; - lv_display_t * d = lv_display_get_next(NULL); + lv_disp_t * d = lv_disp_get_next(NULL); while(d) { uint32_t i; for(i = 0; i < d->screen_cnt; i++) { report_style_change_core(style, d->screens[i]); } - d = lv_display_get_next(d); + d = lv_disp_get_next(d); } } @@ -282,17 +174,17 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_selector_t selector, lv_style lv_part_t part = lv_obj_style_get_selector_part(selector); - bool is_layout_refr = lv_style_prop_has_flag(prop, LV_STYLE_PROP_FLAG_LAYOUT_UPDATE); - bool is_ext_draw = lv_style_prop_has_flag(prop, LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE); - bool is_inheritable = lv_style_prop_has_flag(prop, LV_STYLE_PROP_FLAG_INHERITABLE); - bool is_layer_refr = lv_style_prop_has_flag(prop, LV_STYLE_PROP_FLAG_LAYER_UPDATE); + bool is_layout_refr = lv_style_prop_has_flag(prop, LV_STYLE_PROP_LAYOUT_REFR); + bool is_ext_draw = lv_style_prop_has_flag(prop, LV_STYLE_PROP_EXT_DRAW); + bool is_inheritable = lv_style_prop_has_flag(prop, LV_STYLE_PROP_INHERIT); + bool is_layer_refr = lv_style_prop_has_flag(prop, LV_STYLE_PROP_LAYER_REFR); if(is_layout_refr) { if(part == LV_PART_ANY || part == LV_PART_MAIN || lv_obj_get_style_height(obj, 0) == LV_SIZE_CONTENT || lv_obj_get_style_width(obj, 0) == LV_SIZE_CONTENT) { - lv_obj_send_event(obj, LV_EVENT_STYLE_CHANGED, NULL); + lv_event_send(obj, LV_EVENT_STYLE_CHANGED, NULL); lv_obj_mark_layout_as_dirty(obj); } } @@ -303,7 +195,12 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_selector_t selector, lv_style /*Cache the layer type*/ if((part == LV_PART_ANY || part == LV_PART_MAIN) && is_layer_refr) { - lv_obj_update_layer_type(obj); + lv_layer_type_t layer_type = calculate_layer_type(obj); + if(obj->spec_attr) obj->spec_attr->layer_type = layer_type; + else if(layer_type != LV_LAYER_TYPE_NONE) { + lv_obj_allocate_spec_attr(obj); + obj->spec_attr->layer_type = layer_type; + } } if(prop == LV_STYLE_PROP_ANY || is_ext_draw) { @@ -325,57 +222,68 @@ void lv_obj_enable_style_refresh(bool en) lv_style_value_t lv_obj_get_style_prop(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop) { - LV_ASSERT_NULL(obj) - - lv_style_selector_t selector = part | obj->state; - lv_style_value_t value_act = { .ptr = NULL }; - lv_style_res_t found; - - found = get_selector_style_prop(obj, selector, prop, &value_act); - if(found == LV_STYLE_RES_FOUND) return value_act; - - return lv_style_prop_get_default(prop); -} + lv_style_value_t value_act; + bool inheritable = lv_style_prop_has_flag(prop, LV_STYLE_PROP_INHERIT); + lv_style_res_t found = LV_STYLE_RES_NOT_FOUND; + while(obj) { + found = get_prop_core(obj, part, prop, &value_act); + if(found == LV_STYLE_RES_FOUND) break; + if(!inheritable) break; -bool lv_obj_has_style_prop(const lv_obj_t * obj, lv_style_selector_t selector, lv_style_prop_t prop) -{ - LV_ASSERT_NULL(obj) + /*If not found, check the `MAIN` style first*/ + if(found != LV_STYLE_RES_INHERIT && part != LV_PART_MAIN) { + part = LV_PART_MAIN; + continue; + } - lv_style_value_t value_act = { .ptr = NULL }; - lv_style_res_t found; + /*Check the parent too.*/ + obj = lv_obj_get_parent(obj); + } - found = get_selector_style_prop(obj, selector, prop, &value_act); - if(found == LV_STYLE_RES_FOUND) return true; + if(found != LV_STYLE_RES_FOUND) { + if(part == LV_PART_MAIN && (prop == LV_STYLE_WIDTH || prop == LV_STYLE_HEIGHT)) { + const lv_obj_class_t * cls = obj->class_p; + while(cls) { + if(prop == LV_STYLE_WIDTH) { + if(cls->width_def != 0) break; + } + else { + if(cls->height_def != 0) break; + } + cls = cls->base_class; + } - return false; + if(cls) { + value_act.num = prop == LV_STYLE_WIDTH ? cls->width_def : cls->height_def; + } + else { + value_act.num = 0; + } + } + else { + value_act = lv_style_prop_get_default(prop); + } + } + return value_act; } void lv_obj_set_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t value, lv_style_selector_t selector) { - /*Stop running transitions wit this property */ - trans_delete(obj, lv_obj_style_get_selector_part(selector), prop, NULL); - lv_style_t * style = get_local_style(obj, selector); - if(selector == LV_PART_MAIN && lv_style_prop_has_flag(prop, LV_STYLE_PROP_FLAG_TRANSFORM)) { - lv_obj_invalidate(obj); - } - lv_style_set_prop(style, prop, value); + lv_obj_refresh_style(obj, selector, prop); +} -#if LV_OBJ_STYLE_CACHE - uint32_t prop_shifted = STYLE_PROP_SHIFTED(prop); - if(lv_obj_style_get_selector_part(selector) == LV_PART_MAIN) { - obj->style_main_prop_is_set |= prop_shifted; - } - else { - obj->style_other_prop_is_set |= prop_shifted; - } -#endif - +void lv_obj_set_local_style_prop_meta(lv_obj_t * obj, lv_style_prop_t prop, uint16_t meta, + lv_style_selector_t selector) +{ + lv_style_t * style = get_local_style(obj, selector); + lv_style_set_prop_meta(style, prop, meta); lv_obj_refresh_style(obj, selector, prop); } + lv_style_res_t lv_obj_get_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t * value, lv_style_selector_t selector) { @@ -406,17 +314,16 @@ bool lv_obj_remove_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_sty /*The style is not found*/ if(i == obj->style_cnt) return false; - lv_result_t res = lv_style_remove_prop((lv_style_t *)obj->styles[i].style, prop); - if(res == LV_RESULT_OK) { - full_cache_refresh(obj, lv_obj_style_get_selector_part(selector)); + lv_res_t res = lv_style_remove_prop(obj->styles[i].style, prop); + if(res == LV_RES_OK) { lv_obj_refresh_style(obj, selector, prop); } return res; } -void lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t prev_state, lv_state_t new_state, - const lv_obj_style_transition_dsc_t * tr_dsc) +void _lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t prev_state, lv_state_t new_state, + const _lv_obj_style_transition_dsc_t * tr_dsc) { trans_t * tr; @@ -428,25 +335,24 @@ void lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t p lv_style_value_t v2 = lv_obj_get_style_prop(obj, part, tr_dsc->prop); obj->skip_trans = 0; - if(v1.ptr == v2.ptr && v1.num == v2.num && lv_color_eq(v1.color, v2.color)) return; + if(v1.ptr == v2.ptr && v1.num == v2.num && v1.color.full == v2.color.full) return; obj->state = prev_state; v1 = lv_obj_get_style_prop(obj, part, tr_dsc->prop); obj->state = new_state; - lv_obj_style_t * style_trans = get_trans_style(obj, part); - lv_style_set_prop((lv_style_t *)style_trans->style, tr_dsc->prop, v1); /*Be sure `trans_style` has a valid value*/ - lv_obj_refresh_style(obj, tr_dsc->selector, tr_dsc->prop); + _lv_obj_style_t * style_trans = get_trans_style(obj, part); + lv_style_set_prop(style_trans->style, tr_dsc->prop, v1); /*Be sure `trans_style` has a valid value*/ if(tr_dsc->prop == LV_STYLE_RADIUS) { if(v1.num == LV_RADIUS_CIRCLE || v2.num == LV_RADIUS_CIRCLE) { - int32_t whalf = lv_obj_get_width(obj) / 2; - int32_t hhalf = lv_obj_get_height(obj) / 2; + lv_coord_t whalf = lv_obj_get_width(obj) / 2; + lv_coord_t hhalf = lv_obj_get_height(obj) / 2; if(v1.num == LV_RADIUS_CIRCLE) v1.num = LV_MIN(whalf + 1, hhalf + 1); if(v2.num == LV_RADIUS_CIRCLE) v2.num = LV_MIN(whalf + 1, hhalf + 1); } } - tr = lv_ll_ins_head(style_trans_ll_p); + tr = _lv_ll_ins_head(&LV_GC_ROOT(_lv_obj_style_trans_ll)); LV_ASSERT_MALLOC(tr); if(tr == NULL) return; tr->start_value = v1; @@ -460,17 +366,20 @@ void lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t p lv_anim_set_var(&a, tr); lv_anim_set_exec_cb(&a, trans_anim_cb); lv_anim_set_start_cb(&a, trans_anim_start_cb); - lv_anim_set_completed_cb(&a, trans_anim_completed_cb); + lv_anim_set_ready_cb(&a, trans_anim_ready_cb); lv_anim_set_values(&a, 0x00, 0xFF); - lv_anim_set_duration(&a, tr_dsc->time); + lv_anim_set_time(&a, tr_dsc->time); lv_anim_set_delay(&a, tr_dsc->delay); lv_anim_set_path_cb(&a, tr_dsc->path_cb); lv_anim_set_early_apply(&a, false); - lv_anim_set_user_data(&a, tr_dsc->user_data); +#if LV_USE_USER_DATA + a.user_data = tr_dsc->user_data; +#endif lv_anim_start(&a); } -lv_style_value_t lv_obj_style_apply_color_filter(const lv_obj_t * obj, lv_part_t part, lv_style_value_t v) + +lv_style_value_t _lv_obj_style_apply_color_filter(const lv_obj_t * obj, uint32_t part, lv_style_value_t v) { if(obj == NULL) return v; const lv_color_filter_dsc_t * f = lv_obj_get_style_color_filter_dsc(obj, part); @@ -481,9 +390,9 @@ lv_style_value_t lv_obj_style_apply_color_filter(const lv_obj_t * obj, lv_part_t return v; } -lv_style_state_cmp_t lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t state1, lv_state_t state2) +_lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t state1, lv_state_t state2) { - lv_style_state_cmp_t res = LV_STYLE_STATE_CMP_SAME; + _lv_style_state_cmp_t res = _LV_STYLE_STATE_CMP_SAME; /*Are there any new styles for the new state?*/ uint32_t i; @@ -495,7 +404,7 @@ lv_style_state_cmp_t lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t state bool valid1 = state_act & (~state1) ? false : true; bool valid2 = state_act & (~state2) ? false : true; if(valid1 != valid2) { - const lv_style_t * style = obj->styles[i].style; + lv_style_t * style = obj->styles[i].style; lv_style_value_t v; /*If there is layout difference on the main part, return immediately. There is no more serious difference*/ bool layout_diff = false; @@ -515,27 +424,28 @@ lv_style_state_cmp_t lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t state else if(lv_style_get_prop(style, LV_STYLE_MIN_HEIGHT, &v)) layout_diff = true; else if(lv_style_get_prop(style, LV_STYLE_MAX_HEIGHT, &v)) layout_diff = true; else if(lv_style_get_prop(style, LV_STYLE_BORDER_WIDTH, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_ANGLE, &v)) layout_diff = true; + else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_ZOOM, &v)) layout_diff = true; if(layout_diff) { - return LV_STYLE_STATE_CMP_DIFF_LAYOUT; + return _LV_STYLE_STATE_CMP_DIFF_LAYOUT; } /*Check for draw pad changes*/ - if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_WIDTH, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_HEIGHT, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_ROTATION, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_SCALE_X, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_SCALE_Y, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_OUTLINE_OPA, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_OUTLINE_PAD, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_OUTLINE_WIDTH, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_SHADOW_WIDTH, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OPA, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OFFSET_X, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OFFSET_Y, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_SHADOW_SPREAD, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(lv_style_get_prop(style, LV_STYLE_LINE_WIDTH, &v)) res = LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; - else if(res == LV_STYLE_STATE_CMP_SAME) res = LV_STYLE_STATE_CMP_DIFF_REDRAW; + if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_HEIGHT, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_ANGLE, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_ZOOM, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_OUTLINE_OPA, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_OUTLINE_PAD, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_OUTLINE_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_SHADOW_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OPA, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OFS_X, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_SHADOW_OFS_Y, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_SHADOW_SPREAD, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(lv_style_get_prop(style, LV_STYLE_LINE_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD; + else if(res == _LV_STYLE_STATE_CMP_SAME) res = _LV_STYLE_STATE_CMP_DIFF_REDRAW; } } @@ -549,8 +459,8 @@ void lv_obj_fade_in(lv_obj_t * obj, uint32_t time, uint32_t delay) lv_anim_set_var(&a, obj); lv_anim_set_values(&a, 0, LV_OPA_COVER); lv_anim_set_exec_cb(&a, fade_anim_cb); - lv_anim_set_completed_cb(&a, fade_in_anim_completed); - lv_anim_set_duration(&a, time); + lv_anim_set_ready_cb(&a, fade_in_anim_ready); + lv_anim_set_time(&a, time); lv_anim_set_delay(&a, delay); lv_anim_start(&a); } @@ -562,12 +472,23 @@ void lv_obj_fade_out(lv_obj_t * obj, uint32_t time, uint32_t delay) lv_anim_set_var(&a, obj); lv_anim_set_values(&a, lv_obj_get_style_opa(obj, 0), LV_OPA_TRANSP); lv_anim_set_exec_cb(&a, fade_anim_cb); - lv_anim_set_duration(&a, time); + lv_anim_set_time(&a, time); lv_anim_set_delay(&a, delay); lv_anim_start(&a); } -lv_text_align_t lv_obj_calculate_style_text_align(const lv_obj_t * obj, lv_part_t part, const char * txt) +lv_state_t lv_obj_style_get_selector_state(lv_style_selector_t selector) +{ + return selector & 0xFFFF; +} + +lv_part_t lv_obj_style_get_selector_part(lv_style_selector_t selector) +{ + return selector & 0xFF0000; +} + + +lv_text_align_t lv_obj_calculate_style_text_align(const struct _lv_obj_t * obj, lv_part_t part, const char * txt) { lv_text_align_t align = lv_obj_get_style_text_align(obj, part); lv_base_dir_t base_dir = lv_obj_get_style_base_dir(obj, part); @@ -583,7 +504,7 @@ lv_opa_t lv_obj_get_style_opa_recursive(const lv_obj_t * obj, lv_part_t part) lv_opa_t opa_final = LV_OPA_COVER; if(opa_obj < LV_OPA_MAX) { - opa_final = LV_OPA_MIX2(opa_final, opa_obj); + opa_final = ((uint32_t)opa_final * opa_obj) >> 8; } if(part != LV_PART_MAIN) { @@ -597,7 +518,7 @@ lv_opa_t lv_obj_get_style_opa_recursive(const lv_obj_t * obj, lv_part_t part) opa_obj = lv_obj_get_style_opa(obj, part); if(opa_obj <= LV_OPA_MIN) return LV_OPA_TRANSP; if(opa_obj < LV_OPA_MAX) { - opa_final = LV_OPA_MIX2(opa_final, opa_obj); + opa_final = ((uint32_t)opa_final * opa_obj) >> 8; } obj = lv_obj_get_parent(obj); @@ -608,15 +529,6 @@ lv_opa_t lv_obj_get_style_opa_recursive(const lv_obj_t * obj, lv_part_t part) return opa_final; } -void lv_obj_update_layer_type(lv_obj_t * obj) -{ - lv_layer_type_t layer_type = calculate_layer_type(obj); - if(obj->spec_attr) obj->spec_attr->layer_type = layer_type; - else if(layer_type != LV_LAYER_TYPE_NONE) { - lv_obj_allocate_spec_attr(obj); - obj->spec_attr->layer_type = layer_type; - } -} /********************** * STATIC FUNCTIONS @@ -635,13 +547,12 @@ static lv_style_t * get_local_style(lv_obj_t * obj, lv_style_selector_t selector for(i = 0; i < obj->style_cnt; i++) { if(obj->styles[i].is_local && obj->styles[i].selector == selector) { - return (lv_style_t *)obj->styles[i].style; + return obj->styles[i].style; } } obj->style_cnt++; - LV_ASSERT(obj->style_cnt != 0); - obj->styles = lv_realloc(obj->styles, obj->style_cnt * sizeof(lv_obj_style_t)); + obj->styles = lv_mem_realloc(obj->styles, obj->style_cnt * sizeof(_lv_obj_style_t)); LV_ASSERT_MALLOC(obj->styles); for(i = obj->style_cnt - 1; i > 0 ; i--) { @@ -651,13 +562,12 @@ static lv_style_t * get_local_style(lv_obj_t * obj, lv_style_selector_t selector obj->styles[i] = obj->styles[i - 1]; } - lv_memzero(&obj->styles[i], sizeof(lv_obj_style_t)); - obj->styles[i].style = lv_malloc(sizeof(lv_style_t)); - lv_style_init((lv_style_t *)obj->styles[i].style); - + lv_memset_00(&obj->styles[i], sizeof(_lv_obj_style_t)); + obj->styles[i].style = lv_mem_alloc(sizeof(lv_style_t)); + lv_style_init(obj->styles[i].style); obj->styles[i].is_local = 1; obj->styles[i].selector = selector; - return (lv_style_t *)obj->styles[i].style; + return obj->styles[i].style; } /** @@ -667,7 +577,7 @@ static lv_style_t * get_local_style(lv_obj_t * obj, lv_style_selector_t selector * @param selector OR-ed value of parts and state for which the style should be get * @return pointer to the transition style */ -static lv_obj_style_t * get_trans_style(lv_obj_t * obj, lv_style_selector_t selector) +static _lv_obj_style_t * get_trans_style(lv_obj_t * obj, lv_style_selector_t selector) { uint32_t i; for(i = 0; i < obj->style_cnt; i++) { @@ -678,36 +588,33 @@ static lv_obj_style_t * get_trans_style(lv_obj_t * obj, lv_style_selector_t sel if(i != obj->style_cnt) return &obj->styles[i]; obj->style_cnt++; - LV_ASSERT(obj->style_cnt != 0); - obj->styles = lv_realloc(obj->styles, obj->style_cnt * sizeof(lv_obj_style_t)); + obj->styles = lv_mem_realloc(obj->styles, obj->style_cnt * sizeof(_lv_obj_style_t)); for(i = obj->style_cnt - 1; i > 0 ; i--) { obj->styles[i] = obj->styles[i - 1]; } - lv_memzero(&obj->styles[0], sizeof(lv_obj_style_t)); - obj->styles[0].style = lv_malloc(sizeof(lv_style_t)); - lv_style_init((lv_style_t *)obj->styles[0].style); - + lv_memset_00(&obj->styles[0], sizeof(_lv_obj_style_t)); + obj->styles[0].style = lv_mem_alloc(sizeof(lv_style_t)); + lv_style_init(obj->styles[0].style); obj->styles[0].is_trans = 1; obj->styles[0].selector = selector; return &obj->styles[0]; } -static lv_style_res_t get_prop_core(const lv_obj_t * obj, lv_style_selector_t selector, lv_style_prop_t prop, - lv_style_value_t * v) -{ - const uint32_t group = (uint32_t)1 << lv_style_get_prop_group(prop); - const lv_part_t part = lv_obj_style_get_selector_part(selector); - const lv_state_t state = lv_obj_style_get_selector_state(selector); - const lv_state_t state_inv = ~state; - const bool skip_trans = (const bool) obj->skip_trans; +static lv_style_res_t get_prop_core(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, lv_style_value_t * v) +{ + uint8_t group = 1 << _lv_style_get_prop_group(prop); int32_t weight = -1; - lv_style_res_t found; + lv_state_t state = obj->state; + lv_state_t state_inv = ~state; + lv_style_value_t value_tmp; + bool skip_trans = obj->skip_trans; uint32_t i; + lv_style_res_t found; for(i = 0; i < obj->style_cnt; i++) { - lv_obj_style_t * obj_style = &obj->styles[i]; + _lv_obj_style_t * obj_style = &obj->styles[i]; if(obj_style->is_trans == false) break; if(skip_trans) continue; @@ -715,36 +622,51 @@ static lv_style_res_t get_prop_core(const lv_obj_t * obj, lv_style_selector_t se if(part_act != part) continue; if((obj_style->style->has_group & group) == 0) continue; - found = lv_style_get_prop_inlined(obj_style->style, prop, v); + found = lv_style_get_prop(obj_style->style, prop, &value_tmp); if(found == LV_STYLE_RES_FOUND) { + *v = value_tmp; return LV_STYLE_RES_FOUND; } + else if(found == LV_STYLE_RES_INHERIT) { + return LV_STYLE_RES_INHERIT; + } } for(; i < obj->style_cnt; i++) { if((obj->styles[i].style->has_group & group) == 0) continue; - lv_obj_style_t * obj_style = &obj->styles[i]; + _lv_obj_style_t * obj_style = &obj->styles[i]; lv_part_t part_act = lv_obj_style_get_selector_part(obj->styles[i].selector); + lv_state_t state_act = lv_obj_style_get_selector_state(obj->styles[i].selector); if(part_act != part) continue; /*Be sure the style not specifies other state than the requested. *E.g. For HOVER+PRESS object state, HOVER style only is OK, but HOVER+FOCUS style is not*/ - lv_state_t state_act = lv_obj_style_get_selector_state(obj->styles[i].selector); if((state_act & state_inv)) continue; /*Check only better candidates*/ if(state_act <= weight) continue; - found = lv_style_get_prop_inlined(obj_style->style, prop, v); + found = lv_style_get_prop(obj_style->style, prop, &value_tmp); + if(found == LV_STYLE_RES_FOUND) { if(state_act == state) { + *v = value_tmp; return LV_STYLE_RES_FOUND; } - weight = state_act; + if(weight < state_act) { + weight = state_act; + *v = value_tmp; + } + } + else if(found == LV_STYLE_RES_INHERIT) { + return LV_STYLE_RES_INHERIT; } } - if(weight >= 0) return LV_STYLE_RES_FOUND; + if(weight >= 0) { + *v = value_tmp; + return LV_STYLE_RES_FOUND; + } else return LV_STYLE_RES_NOT_FOUND; } @@ -758,13 +680,12 @@ static void report_style_change_core(void * style, lv_obj_t * obj) uint32_t i; for(i = 0; i < obj->style_cnt; i++) { if(style == NULL || obj->styles[i].style == style) { - full_cache_refresh(obj, lv_obj_style_get_selector_part(obj->styles[i].selector)); lv_obj_refresh_style(obj, LV_PART_ANY, LV_STYLE_PROP_ANY); break; } } - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); for(i = 0; i < child_cnt; i++) { report_style_change_core(style, obj->spec_attr->children[i]); } @@ -778,11 +699,11 @@ static void report_style_change_core(void * style, lv_obj_t * obj) static void refresh_children_style(lv_obj_t * obj) { uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); for(i = 0; i < child_cnt; i++) { lv_obj_t * child = obj->spec_attr->children[i]; lv_obj_invalidate(child); - lv_obj_send_event(child, LV_EVENT_STYLE_CHANGED, NULL); + lv_event_send(child, LV_EVENT_STYLE_CHANGED, NULL); lv_obj_invalidate(child); refresh_children_style(child); /*Check children too*/ @@ -791,24 +712,24 @@ static void refresh_children_style(lv_obj_t * obj) /** * Remove the transition from object's part's property. - * - Remove the transition from `lv_obj_style_trans_ll` and free it + * - Remove the transition from `_lv_obj_style_trans_ll` and free it * - Delete pending transitions * @param obj pointer to an object which transition(s) should be removed * @param part a part of object or 0xFF to remove from all parts * @param prop a property or 0xFF to remove all properties * @param tr_limit delete transitions only "older" than this. `NULL` if not used */ -static bool trans_delete(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, trans_t * tr_limit) +static bool trans_del(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, trans_t * tr_limit) { trans_t * tr; trans_t * tr_prev; bool removed = false; - tr = lv_ll_get_tail(style_trans_ll_p); + tr = _lv_ll_get_tail(&LV_GC_ROOT(_lv_obj_style_trans_ll)); while(tr != NULL) { if(tr == tr_limit) break; /*'tr' might be deleted, so get the next object while 'tr' is valid*/ - tr_prev = lv_ll_get_prev(style_trans_ll_p, tr); + tr_prev = _lv_ll_get_prev(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr); if(tr->obj == obj && (part == tr->selector || part == LV_PART_ANY) && (prop == tr->prop || prop == LV_STYLE_PROP_ANY)) { /*Remove any transitioned properties from the trans. style @@ -816,14 +737,14 @@ static bool trans_delete(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, t uint32_t i; for(i = 0; i < obj->style_cnt; i++) { if(obj->styles[i].is_trans && (part == LV_PART_ANY || obj->styles[i].selector == part)) { - lv_style_remove_prop((lv_style_t *)obj->styles[i].style, tr->prop); + lv_style_remove_prop(obj->styles[i].style, tr->prop); } } /*Free the transition descriptor too*/ - lv_anim_delete(tr, NULL); - lv_ll_remove(style_trans_ll_p, tr); - lv_free(tr); + lv_anim_del(tr, NULL); + _lv_ll_remove(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr); + lv_mem_free(tr); removed = true; } @@ -841,7 +762,7 @@ static void trans_anim_cb(void * _tr, int32_t v) for(i = 0; i < obj->style_cnt; i++) { if(obj->styles[i].is_trans == 0 || obj->styles[i].selector != tr->selector) continue; - lv_style_value_t value_final = {0}; + lv_style_value_t value_final; switch(tr->prop) { case LV_STYLE_BORDER_SIDE: @@ -867,7 +788,7 @@ static void trans_anim_cb(void * _tr, int32_t v) case LV_STYLE_TEXT_COLOR: case LV_STYLE_SHADOW_COLOR: case LV_STYLE_OUTLINE_COLOR: - case LV_STYLE_IMAGE_RECOLOR: + case LV_STYLE_IMG_RECOLOR: if(v <= 0) value_final.color = tr->start_value.color; else if(v >= 255) value_final.color = tr->end_value.color; else value_final.color = lv_color_mix(tr->end_value.color, tr->start_value.color, v); @@ -880,15 +801,15 @@ static void trans_anim_cb(void * _tr, int32_t v) break; } - lv_style_value_t old_value = {0}; + lv_style_value_t old_value; bool refr = true; if(lv_style_get_prop(obj->styles[i].style, tr->prop, &old_value)) { - if(value_final.ptr == old_value.ptr && lv_color_eq(value_final.color, old_value.color) && + if(value_final.ptr == old_value.ptr && value_final.color.full == old_value.color.full && value_final.num == old_value.num) { refr = false; } } - lv_style_set_prop((lv_style_t *)obj->styles[i].style, tr->prop, value_final); + lv_style_set_prop(obj->styles[i].style, tr->prop, value_final); if(refr) lv_obj_refresh_style(tr->obj, tr->selector, tr->prop); break; @@ -908,18 +829,16 @@ static void trans_anim_start_cb(lv_anim_t * a) tr->prop = LV_STYLE_PROP_INV; /*Delete the related transitions if any*/ - trans_delete(tr->obj, part, prop_tmp, tr); + trans_del(tr->obj, part, prop_tmp, tr); tr->prop = prop_tmp; - lv_obj_style_t * style_trans = get_trans_style(tr->obj, tr->selector); - /*Be sure `trans_style` has a valid value*/ - lv_style_set_prop((lv_style_t *)style_trans->style, tr->prop, tr->start_value); - lv_obj_refresh_style(tr->obj, tr->selector, tr->prop); + _lv_obj_style_t * style_trans = get_trans_style(tr->obj, tr->selector); + lv_style_set_prop(style_trans->style, tr->prop, tr->start_value); /*Be sure `trans_style` has a valid value*/ } -static void trans_anim_completed_cb(lv_anim_t * a) +static void trans_anim_ready_cb(lv_anim_t * a) { trans_t * tr = a->var; lv_obj_t * obj = tr->obj; @@ -930,7 +849,7 @@ static void trans_anim_completed_cb(lv_anim_t * a) *It allows changing it by normal styles*/ bool running = false; trans_t * tr_i; - LV_LL_READ(style_trans_ll_p, tr_i) { + _LV_LL_READ(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr_i) { if(tr_i != tr && tr_i->obj == tr->obj && tr_i->selector == tr->selector && tr_i->prop == tr->prop) { running = true; break; @@ -941,14 +860,14 @@ static void trans_anim_completed_cb(lv_anim_t * a) uint32_t i; for(i = 0; i < obj->style_cnt; i++) { if(obj->styles[i].is_trans && obj->styles[i].selector == tr->selector) { - lv_ll_remove(style_trans_ll_p, tr); - lv_free(tr); + _lv_ll_remove(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr); + lv_mem_free(tr); - lv_obj_style_t * obj_style = &obj->styles[i]; - lv_style_remove_prop((lv_style_t *)obj_style->style, prop); + _lv_obj_style_t * obj_style = &obj->styles[i]; + lv_style_remove_prop(obj_style->style, prop); if(lv_style_is_empty(obj->styles[i].style)) { - lv_obj_remove_style(obj, (lv_style_t *)obj_style->style, obj_style->selector); + lv_obj_remove_style(obj, obj_style->style, obj_style->selector); } break; @@ -959,65 +878,13 @@ static void trans_anim_completed_cb(lv_anim_t * a) static lv_layer_type_t calculate_layer_type(lv_obj_t * obj) { - if(lv_obj_get_style_transform_rotation(obj, 0) != 0) return LV_LAYER_TYPE_TRANSFORM; - if(lv_obj_get_style_transform_scale_x(obj, 0) != 256) return LV_LAYER_TYPE_TRANSFORM; - if(lv_obj_get_style_transform_scale_y(obj, 0) != 256) return LV_LAYER_TYPE_TRANSFORM; - if(lv_obj_get_style_transform_skew_x(obj, 0) != 0) return LV_LAYER_TYPE_TRANSFORM; - if(lv_obj_get_style_transform_skew_y(obj, 0) != 0) return LV_LAYER_TYPE_TRANSFORM; + if(lv_obj_get_style_transform_angle(obj, 0) != 0) return LV_LAYER_TYPE_TRANSFORM; + if(lv_obj_get_style_transform_zoom(obj, 0) != 256) return LV_LAYER_TYPE_TRANSFORM; if(lv_obj_get_style_opa_layered(obj, 0) != LV_OPA_COVER) return LV_LAYER_TYPE_SIMPLE; - if(lv_obj_get_style_bitmap_mask_src(obj, 0) != NULL) return LV_LAYER_TYPE_SIMPLE; +#if LV_DRAW_COMPLEX if(lv_obj_get_style_blend_mode(obj, 0) != LV_BLEND_MODE_NORMAL) return LV_LAYER_TYPE_SIMPLE; - return LV_LAYER_TYPE_NONE; -} - -static void full_cache_refresh(lv_obj_t * obj, lv_part_t part) -{ -#if LV_OBJ_STYLE_CACHE - uint32_t i; - if(part == LV_PART_MAIN || part == LV_PART_ANY) { - obj->style_main_prop_is_set = 0; - for(i = 0; i < obj->style_cnt; i++) { - if(lv_obj_style_get_selector_part(obj->styles[i].selector) != LV_PART_MAIN) continue; - lv_style_t * style = (lv_style_t *)obj->styles[i].style; - uint32_t j; - if(lv_style_is_const(style)) { - lv_style_const_prop_t * props = style->values_and_props; - for(j = 0; props[j].prop != LV_STYLE_PROP_INV; j++) { - obj->style_main_prop_is_set |= STYLE_PROP_SHIFTED(props[j].prop); - } - } - else { - lv_style_prop_t * props = (lv_style_prop_t *)style->values_and_props + style->prop_cnt * sizeof(lv_style_value_t); - for(j = 0; j < style->prop_cnt; j++) { - obj->style_main_prop_is_set |= STYLE_PROP_SHIFTED(props[j]); - } - } - } - } - if(part != LV_PART_MAIN || part == LV_PART_ANY) { - obj->style_other_prop_is_set = 0; - for(i = 0; i < obj->style_cnt; i++) { - if(lv_obj_style_get_selector_part(obj->styles[i].selector) == LV_PART_MAIN) continue; - lv_style_t * style = (lv_style_t *)obj->styles[i].style; - uint32_t j; - if(lv_style_is_const(style)) { - lv_style_const_prop_t * props = style->values_and_props; - for(j = 0; props[j].prop != LV_STYLE_PROP_INV; j++) { - obj->style_other_prop_is_set |= STYLE_PROP_SHIFTED(props[j].prop); - } - } - else { - lv_style_prop_t * props = (lv_style_prop_t *)style->values_and_props + style->prop_cnt * sizeof(lv_style_value_t); - for(j = 0; j < style->prop_cnt; j++) { - obj->style_other_prop_is_set |= STYLE_PROP_SHIFTED(props[j]); - } - } - } - } -#else - LV_UNUSED(obj); - LV_UNUSED(part); #endif + return LV_LAYER_TYPE_NONE; } static void fade_anim_cb(void * obj, int32_t v) @@ -1025,102 +892,9 @@ static void fade_anim_cb(void * obj, int32_t v) lv_obj_set_style_opa(obj, v, 0); } -static void fade_in_anim_completed(lv_anim_t * a) +static void fade_in_anim_ready(lv_anim_t * a) { lv_obj_remove_local_style_prop(a->var, LV_STYLE_OPA, 0); } -static bool style_has_flag(const lv_style_t * style, uint32_t flag) -{ - if(lv_style_is_const(style)) { - lv_style_const_prop_t * props = style->values_and_props; - uint32_t i; - for(i = 0; props[i].prop != LV_STYLE_PROP_INV; i++) { - if(lv_style_prop_has_flag(props[i].prop, flag)) { - return true; - } - } - } - else { - lv_style_prop_t * props = (lv_style_prop_t *)style->values_and_props + style->prop_cnt * sizeof(lv_style_value_t); - uint32_t i; - for(i = 0; i < style->prop_cnt; i++) { - if(lv_style_prop_has_flag(props[i], flag)) { - return true; - } - } - } - return false; -} - -static lv_style_res_t get_selector_style_prop(const lv_obj_t * obj, lv_style_selector_t selector, lv_style_prop_t prop, - lv_style_value_t * value_act) -{ - lv_style_res_t found; - lv_part_t part = lv_obj_style_get_selector_part(selector); - /*The happy path*/ -#if LV_OBJ_STYLE_CACHE - const uint32_t prop_shifted = STYLE_PROP_SHIFTED(prop); - if((part == LV_PART_MAIN ? obj->style_main_prop_is_set : obj->style_other_prop_is_set) & prop_shifted) -#endif - { - found = get_prop_core(obj, selector, prop, value_act); - if(found == LV_STYLE_RES_FOUND) return LV_STYLE_RES_FOUND; - } - - extern const uint8_t lv_style_builtin_prop_flag_lookup_table[]; - bool inheritable = false; - if(prop < LV_STYLE_NUM_BUILT_IN_PROPS) { - inheritable = lv_style_builtin_prop_flag_lookup_table[prop] & LV_STYLE_PROP_FLAG_INHERITABLE; - } - else { - if(_style_custom_prop_flag_lookup_table != NULL) { - inheritable = _style_custom_prop_flag_lookup_table[prop - LV_STYLE_NUM_BUILT_IN_PROPS] & - LV_STYLE_PROP_FLAG_INHERITABLE; - } - } - - if(inheritable) { - /*If not found, check the `MAIN` style first, if already on the MAIN part go to the parent*/ - if(part != LV_PART_MAIN) part = LV_PART_MAIN; - else obj = obj->parent; - - while(obj) { -#if LV_OBJ_STYLE_CACHE - if(obj->style_main_prop_is_set & prop_shifted) -#endif - { - selector = part | obj->state; - found = get_prop_core(obj, selector, prop, value_act); - if(found == LV_STYLE_RES_FOUND) return LV_STYLE_RES_FOUND; - } - /*Check the parent too.*/ - obj = obj->parent; - } - } - else { - /*Get the width and height from the class. - * WIDTH and HEIGHT are not inherited so add them in the `else` to skip checking them for inherited properties */ - if(part == LV_PART_MAIN && (prop == LV_STYLE_WIDTH || prop == LV_STYLE_HEIGHT)) { - const lv_obj_class_t * cls = obj->class_p; - while(cls) { - if(prop == LV_STYLE_WIDTH) { - if(cls->width_def != 0) { - value_act->num = cls->width_def; - return LV_STYLE_RES_FOUND; - } - } - else { - if(cls->height_def != 0) { - value_act->num = cls->height_def; - return LV_STYLE_RES_FOUND; - } - } - cls = cls->base_class; - } - } - } - - return LV_STYLE_RES_NOT_FOUND; -} diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_style.h b/L3_Middlewares/LVGL/src/core/lv_obj_style.h index ff4e365..ecc24db 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_style.h +++ b/L3_Middlewares/LVGL/src/core/lv_obj_style.h @@ -13,9 +13,9 @@ extern "C" { /********************* * INCLUDES *********************/ +#include +#include #include "../misc/lv_bidi.h" -#include "../misc/lv_style.h" -#include "../misc/lv_types.h" /********************* * DEFINES @@ -24,74 +24,75 @@ extern "C" { /********************** * TYPEDEFS **********************/ +/*Can't include lv_obj.h because it includes this header file*/ +struct _lv_obj_t; typedef enum { - LV_STYLE_STATE_CMP_SAME, /**< The style properties in the 2 states are identical */ - LV_STYLE_STATE_CMP_DIFF_REDRAW, /**< The differences can be shown with a simple redraw */ - LV_STYLE_STATE_CMP_DIFF_DRAW_PAD, /**< The differences can be shown with a simple redraw */ - LV_STYLE_STATE_CMP_DIFF_LAYOUT, /**< The differences can be shown with a simple redraw */ -} lv_style_state_cmp_t; + _LV_STYLE_STATE_CMP_SAME, /*The style properties in the 2 states are identical*/ + _LV_STYLE_STATE_CMP_DIFF_REDRAW, /*The differences can be shown with a simple redraw*/ + _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD, /*The differences can be shown with a simple redraw*/ + _LV_STYLE_STATE_CMP_DIFF_LAYOUT, /*The differences can be shown with a simple redraw*/ +} _lv_style_state_cmp_t; typedef uint32_t lv_style_selector_t; +typedef struct { + lv_style_t * style; + uint32_t selector : 24; + uint32_t is_local : 1; + uint32_t is_trans : 1; +} _lv_obj_style_t; + +typedef struct { + uint16_t time; + uint16_t delay; + lv_style_selector_t selector; + lv_style_prop_t prop; + lv_anim_path_cb_t path_cb; +#if LV_USE_USER_DATA + void * user_data; +#endif +} _lv_obj_style_transition_dsc_t; + /********************** * GLOBAL PROTOTYPES **********************/ +/** + * Initialize the object related style manager module. + * Called by LVGL in `lv_init()` + */ +void _lv_obj_style_init(void); + /** * Add a style to an object. * @param obj pointer to an object * @param style pointer to a style to add * @param selector OR-ed value of parts and state to which the style should be added - * - * Examples: - * @code - * lv_obj_add_style(btn, &style_btn, 0); //Default button style - * - * lv_obj_add_style(btn, &btn_red, LV_STATE_PRESSED); //Overwrite only some colors to red when pressed - * @endcode + * @example lv_obj_add_style(btn, &style_btn, 0); //Default button style + * @example lv_obj_add_style(btn, &btn_red, LV_STATE_PRESSED); //Overwrite only some colors to red when pressed */ -void lv_obj_add_style(lv_obj_t * obj, const lv_style_t * style, lv_style_selector_t selector); +void lv_obj_add_style(struct _lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector); /** - * Replaces a style of an object, preserving the order of the style stack (local styles and transitions are ignored). - * @param obj pointer to an object - * @param old_style pointer to a style to replace. - * @param new_style pointer to a style to replace the old style with. - * @param selector OR-ed values of states and a part to replace only styles with matching selectors. LV_STATE_ANY and LV_PART_ANY can be used - * - * Examples: - * @code - * lv_obj_replace_style(obj, &yellow_style, &blue_style, LV_PART_ANY | LV_STATE_ANY); //Replace a specific style - * - * lv_obj_replace_style(obj, &yellow_style, &blue_style, LV_PART_MAIN | LV_STATE_PRESSED); //Replace a specific style assigned to the main part when it is pressed - * @endcode - */ -bool lv_obj_replace_style(lv_obj_t * obj, const lv_style_t * old_style, const lv_style_t * new_style, - lv_style_selector_t selector); - -/** - * Remove a style from an object. + * Add a style to an object. * @param obj pointer to an object * @param style pointer to a style to remove. Can be NULL to check only the selector * @param selector OR-ed values of states and a part to remove only styles with matching selectors. LV_STATE_ANY and LV_PART_ANY can be used - * - * Examples: - * @code - * lv_obj_remove_style(obj, &style, LV_PART_ANY | LV_STATE_ANY); //Remove a specific style - * - * lv_obj_remove_style(obj, NULL, LV_PART_MAIN | LV_STATE_ANY); //Remove all styles from the main part - * - * lv_obj_remove_style(obj, NULL, LV_PART_ANY | LV_STATE_ANY); //Remove all styles - * @endcode + * @example lv_obj_remove_style(obj, &style, LV_PART_ANY | LV_STATE_ANY); //Remove a specific style + * @example lv_obj_remove_style(obj, NULL, LV_PART_MAIN | LV_STATE_ANY); //Remove all styles from the main part + * @example lv_obj_remove_style(obj, NULL, LV_PART_ANY | LV_STATE_ANY); //Remove all styles */ -void lv_obj_remove_style(lv_obj_t * obj, const lv_style_t * style, lv_style_selector_t selector); +void lv_obj_remove_style(struct _lv_obj_t * obj, lv_style_t * style, lv_style_selector_t selector); /** * Remove all styles from an object * @param obj pointer to an object */ -void lv_obj_remove_style_all(lv_obj_t * obj); +static inline void lv_obj_remove_style_all(struct _lv_obj_t * obj) +{ + lv_obj_remove_style(obj, NULL, LV_PART_ANY | LV_STATE_ANY); +} /** * Notify all object if a style is modified @@ -108,7 +109,7 @@ void lv_obj_report_style_change(lv_style_t * style); * It is used to optimize what needs to be refreshed. * `LV_STYLE_PROP_INV` to perform only a style cache update */ -void lv_obj_refresh_style(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop); +void lv_obj_refresh_style(struct _lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop); /** * Enable or disable automatic style refreshing when a new style is added/removed to/from an object @@ -127,16 +128,7 @@ void lv_obj_enable_style_refresh(bool en); * @return the value of the property. * Should be read from the correct field of the `lv_style_value_t` according to the type of the property. */ -lv_style_value_t lv_obj_get_style_prop(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop); - -/** - * Check if an object has a specified style property for a given style selector. - * @param obj pointer to an object - * @param selector the style selector to be checked, defining the scope of the style to be examined. - * @param prop the property to be checked. - * @return true if the object has the specified selector and property, false otherwise. - */ -bool lv_obj_has_style_prop(const lv_obj_t * obj, lv_style_selector_t selector, lv_style_prop_t prop); +lv_style_value_t lv_obj_get_style_prop(const struct _lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop); /** * Set local style property on an object's part and state. @@ -145,10 +137,13 @@ bool lv_obj_has_style_prop(const lv_obj_t * obj, lv_style_selector_t selector, l * @param value value of the property. The correct element should be set according to the type of the property * @param selector OR-ed value of parts and state for which the style should be set */ -void lv_obj_set_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t value, +void lv_obj_set_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t value, lv_style_selector_t selector); -lv_style_res_t lv_obj_get_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t * value, +void lv_obj_set_local_style_prop_meta(struct _lv_obj_t * obj, lv_style_prop_t prop, uint16_t meta, + lv_style_selector_t selector); + +lv_style_res_t lv_obj_get_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t * value, lv_style_selector_t selector); /** @@ -158,12 +153,32 @@ lv_style_res_t lv_obj_get_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, * @param selector OR-ed value of parts and state for which the style should be removed * @return true the property was found and removed; false: the property was not found */ -bool lv_obj_remove_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_selector_t selector); +bool lv_obj_remove_local_style_prop(struct _lv_obj_t * obj, lv_style_prop_t prop, lv_style_selector_t selector); /** * Used internally for color filtering */ -lv_style_value_t lv_obj_style_apply_color_filter(const lv_obj_t * obj, lv_part_t part, lv_style_value_t v); +lv_style_value_t _lv_obj_style_apply_color_filter(const struct _lv_obj_t * obj, uint32_t part, lv_style_value_t v); + +/** + * Used internally to create a style transition + * @param obj + * @param part + * @param prev_state + * @param new_state + * @param tr + */ +void _lv_obj_style_create_transition(struct _lv_obj_t * obj, lv_part_t part, lv_state_t prev_state, + lv_state_t new_state, const _lv_obj_style_transition_dsc_t * tr); + +/** + * Used internally to compare the appearance of an object in 2 states + * @param obj + * @param state1 + * @param state2 + * @return + */ +_lv_style_state_cmp_t _lv_obj_style_state_compare(struct _lv_obj_t * obj, lv_state_t state1, lv_state_t state2); /** * Fade in an an object and all its children. @@ -171,7 +186,7 @@ lv_style_value_t lv_obj_style_apply_color_filter(const lv_obj_t * obj, lv_part_t * @param time time of fade * @param delay delay to start the animation */ -void lv_obj_fade_in(lv_obj_t * obj, uint32_t time, uint32_t delay); +void lv_obj_fade_in(struct _lv_obj_t * obj, uint32_t time, uint32_t delay); /** * Fade out an an object and all its children. @@ -179,21 +194,15 @@ void lv_obj_fade_in(lv_obj_t * obj, uint32_t time, uint32_t delay); * @param time time of fade * @param delay delay to start the animation */ -void lv_obj_fade_out(lv_obj_t * obj, uint32_t time, uint32_t delay); +void lv_obj_fade_out(struct _lv_obj_t * obj, uint32_t time, uint32_t delay); -static inline lv_state_t lv_obj_style_get_selector_state(lv_style_selector_t selector) -{ - return selector & 0xFFFF; -} +lv_state_t lv_obj_style_get_selector_state(lv_style_selector_t selector); -static inline lv_part_t lv_obj_style_get_selector_part(lv_style_selector_t selector) -{ - return selector & 0xFF0000; -} +lv_part_t lv_obj_style_get_selector_part(lv_style_selector_t selector); #include "lv_obj_style_gen.h" -static inline void lv_obj_set_style_pad_all(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_pad_all(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_obj_set_style_pad_left(obj, value, selector); lv_obj_set_style_pad_right(obj, value, selector); @@ -201,111 +210,47 @@ static inline void lv_obj_set_style_pad_all(lv_obj_t * obj, int32_t value, lv_st lv_obj_set_style_pad_bottom(obj, value, selector); } -static inline void lv_obj_set_style_pad_hor(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_pad_hor(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_obj_set_style_pad_left(obj, value, selector); lv_obj_set_style_pad_right(obj, value, selector); } -static inline void lv_obj_set_style_pad_ver(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_pad_ver(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_obj_set_style_pad_top(obj, value, selector); lv_obj_set_style_pad_bottom(obj, value, selector); } -static inline void lv_obj_set_style_margin_all(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_obj_set_style_margin_left(obj, value, selector); - lv_obj_set_style_margin_right(obj, value, selector); - lv_obj_set_style_margin_top(obj, value, selector); - lv_obj_set_style_margin_bottom(obj, value, selector); -} - -static inline void lv_obj_set_style_margin_hor(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_obj_set_style_margin_left(obj, value, selector); - lv_obj_set_style_margin_right(obj, value, selector); -} - -static inline void lv_obj_set_style_margin_ver(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_obj_set_style_margin_top(obj, value, selector); - lv_obj_set_style_margin_bottom(obj, value, selector); -} - -static inline void lv_obj_set_style_pad_gap(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +static inline void lv_obj_set_style_pad_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_obj_set_style_pad_row(obj, value, selector); lv_obj_set_style_pad_column(obj, value, selector); } -static inline void lv_obj_set_style_size(lv_obj_t * obj, int32_t width, int32_t height, - lv_style_selector_t selector) -{ - lv_obj_set_style_width(obj, width, selector); - lv_obj_set_style_height(obj, height, selector); -} - -static inline void lv_obj_set_style_transform_scale(lv_obj_t * obj, int32_t value, - lv_style_selector_t selector) +static inline void lv_obj_set_style_size(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { - lv_obj_set_style_transform_scale_x(obj, value, selector); - lv_obj_set_style_transform_scale_y(obj, value, selector); + lv_obj_set_style_width(obj, value, selector); + lv_obj_set_style_height(obj, value, selector); } -static inline int32_t lv_obj_get_style_space_left(const lv_obj_t * obj, lv_part_t part) -{ - int32_t padding = lv_obj_get_style_pad_left(obj, part); - int32_t border_width = lv_obj_get_style_border_width(obj, part); - lv_border_side_t border_side = lv_obj_get_style_border_side(obj, part); - return (border_side & LV_BORDER_SIDE_LEFT) ? padding + border_width : padding; -} - -static inline int32_t lv_obj_get_style_space_right(const lv_obj_t * obj, lv_part_t part) -{ - int32_t padding = lv_obj_get_style_pad_right(obj, part); - int32_t border_width = lv_obj_get_style_border_width(obj, part); - lv_border_side_t border_side = lv_obj_get_style_border_side(obj, part); - return (border_side & LV_BORDER_SIDE_RIGHT) ? padding + border_width : padding; -} - -static inline int32_t lv_obj_get_style_space_top(const lv_obj_t * obj, lv_part_t part) -{ - int32_t padding = lv_obj_get_style_pad_top(obj, part); - int32_t border_width = lv_obj_get_style_border_width(obj, part); - lv_border_side_t border_side = lv_obj_get_style_border_side(obj, part); - return (border_side & LV_BORDER_SIDE_TOP) ? padding + border_width : padding; -} +lv_text_align_t lv_obj_calculate_style_text_align(const struct _lv_obj_t * obj, lv_part_t part, const char * txt); -static inline int32_t lv_obj_get_style_space_bottom(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_transform_zoom_safe(const struct _lv_obj_t * obj, uint32_t part) { - int32_t padding = lv_obj_get_style_pad_bottom(obj, part); - int32_t border_width = lv_obj_get_style_border_width(obj, part); - lv_border_side_t border_side = lv_obj_get_style_border_side(obj, part); - return (border_side & LV_BORDER_SIDE_BOTTOM) ? padding + border_width : padding; + int16_t zoom = lv_obj_get_style_transform_zoom(obj, part); + return zoom != 0 ? zoom : 1; } -lv_text_align_t lv_obj_calculate_style_text_align(const lv_obj_t * obj, lv_part_t part, const char * txt); - -static inline int32_t lv_obj_get_style_transform_scale_x_safe(const lv_obj_t * obj, lv_part_t part) -{ - int32_t scale = lv_obj_get_style_transform_scale_x(obj, part); - return scale > 0 ? scale : 1; -} - -static inline int32_t lv_obj_get_style_transform_scale_y_safe(const lv_obj_t * obj, lv_part_t part) -{ - int32_t scale = lv_obj_get_style_transform_scale_y(obj, part); - return scale > 0 ? scale : 1; -} /** * Get the `opa` style property from all parents and multiply and `>> 8` them. * @param obj the object whose opacity should be get - * @param part the part whose opacity should be get. Non-MAIN parts will consider the `opa` of the MAIN part too + * @param part the part whose opacity should be get. Non-MAIN parts will consider the `opa` of teh MAIN part too * @return the final opacity considering the parents' opacity too */ -lv_opa_t lv_obj_get_style_opa_recursive(const lv_obj_t * obj, lv_part_t part); +lv_opa_t lv_obj_get_style_opa_recursive(const struct _lv_obj_t * obj, lv_part_t part); + /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_style_gen.c b/L3_Middlewares/LVGL/src/core/lv_obj_style_gen.c index ad97db5..81358ab 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_style_gen.c +++ b/L3_Middlewares/LVGL/src/core/lv_obj_style_gen.c @@ -1,16 +1,6 @@ - -/* - ********************************************************************** - * DO NOT EDIT - * This file is automatically generated by "style_api_gen.py" - ********************************************************************** - */ - - #include "lv_obj.h" - -void lv_obj_set_style_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -18,7 +8,7 @@ void lv_obj_set_style_width(lv_obj_t * obj, int32_t value, lv_style_selector_t s lv_obj_set_local_style_prop(obj, LV_STYLE_WIDTH, v, selector); } -void lv_obj_set_style_min_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_min_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -26,7 +16,7 @@ void lv_obj_set_style_min_width(lv_obj_t * obj, int32_t value, lv_style_selector lv_obj_set_local_style_prop(obj, LV_STYLE_MIN_WIDTH, v, selector); } -void lv_obj_set_style_max_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_max_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -34,7 +24,7 @@ void lv_obj_set_style_max_width(lv_obj_t * obj, int32_t value, lv_style_selector lv_obj_set_local_style_prop(obj, LV_STYLE_MAX_WIDTH, v, selector); } -void lv_obj_set_style_height(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -42,7 +32,7 @@ void lv_obj_set_style_height(lv_obj_t * obj, int32_t value, lv_style_selector_t lv_obj_set_local_style_prop(obj, LV_STYLE_HEIGHT, v, selector); } -void lv_obj_set_style_min_height(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_min_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -50,7 +40,7 @@ void lv_obj_set_style_min_height(lv_obj_t * obj, int32_t value, lv_style_selecto lv_obj_set_local_style_prop(obj, LV_STYLE_MIN_HEIGHT, v, selector); } -void lv_obj_set_style_max_height(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_max_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -58,15 +48,7 @@ void lv_obj_set_style_max_height(lv_obj_t * obj, int32_t value, lv_style_selecto lv_obj_set_local_style_prop(obj, LV_STYLE_MAX_HEIGHT, v, selector); } -void lv_obj_set_style_length(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_LENGTH, v, selector); -} - -void lv_obj_set_style_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -74,7 +56,7 @@ void lv_obj_set_style_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selec lv_obj_set_local_style_prop(obj, LV_STYLE_X, v, selector); } -void lv_obj_set_style_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -82,7 +64,7 @@ void lv_obj_set_style_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selec lv_obj_set_local_style_prop(obj, LV_STYLE_Y, v, selector); } -void lv_obj_set_style_align(lv_obj_t * obj, lv_align_t value, lv_style_selector_t selector) +void lv_obj_set_style_align(struct _lv_obj_t * obj, lv_align_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -90,7 +72,7 @@ void lv_obj_set_style_align(lv_obj_t * obj, lv_align_t value, lv_style_selector_ lv_obj_set_local_style_prop(obj, LV_STYLE_ALIGN, v, selector); } -void lv_obj_set_style_transform_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -98,7 +80,7 @@ void lv_obj_set_style_transform_width(lv_obj_t * obj, int32_t value, lv_style_se lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_WIDTH, v, selector); } -void lv_obj_set_style_transform_height(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_transform_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -106,7 +88,7 @@ void lv_obj_set_style_transform_height(lv_obj_t * obj, int32_t value, lv_style_s lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_HEIGHT, v, selector); } -void lv_obj_set_style_translate_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_translate_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -114,7 +96,7 @@ void lv_obj_set_style_translate_x(lv_obj_t * obj, int32_t value, lv_style_select lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSLATE_X, v, selector); } -void lv_obj_set_style_translate_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_translate_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -122,31 +104,23 @@ void lv_obj_set_style_translate_y(lv_obj_t * obj, int32_t value, lv_style_select lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSLATE_Y, v, selector); } -void lv_obj_set_style_transform_scale_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_transform_zoom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_SCALE_X, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_ZOOM, v, selector); } -void lv_obj_set_style_transform_scale_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_transform_angle(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_SCALE_Y, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_ANGLE, v, selector); } -void lv_obj_set_style_transform_rotation(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_ROTATION, v, selector); -} - -void lv_obj_set_style_transform_pivot_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_transform_pivot_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -154,7 +128,7 @@ void lv_obj_set_style_transform_pivot_x(lv_obj_t * obj, int32_t value, lv_style_ lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_PIVOT_X, v, selector); } -void lv_obj_set_style_transform_pivot_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_transform_pivot_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -162,23 +136,7 @@ void lv_obj_set_style_transform_pivot_y(lv_obj_t * obj, int32_t value, lv_style_ lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_PIVOT_Y, v, selector); } -void lv_obj_set_style_transform_skew_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_SKEW_X, v, selector); -} - -void lv_obj_set_style_transform_skew_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_SKEW_Y, v, selector); -} - -void lv_obj_set_style_pad_top(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_pad_top(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -186,7 +144,7 @@ void lv_obj_set_style_pad_top(lv_obj_t * obj, int32_t value, lv_style_selector_t lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_TOP, v, selector); } -void lv_obj_set_style_pad_bottom(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -194,7 +152,7 @@ void lv_obj_set_style_pad_bottom(lv_obj_t * obj, int32_t value, lv_style_selecto lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_BOTTOM, v, selector); } -void lv_obj_set_style_pad_left(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -202,7 +160,7 @@ void lv_obj_set_style_pad_left(lv_obj_t * obj, int32_t value, lv_style_selector_ lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_LEFT, v, selector); } -void lv_obj_set_style_pad_right(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -210,7 +168,7 @@ void lv_obj_set_style_pad_right(lv_obj_t * obj, int32_t value, lv_style_selector lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_RIGHT, v, selector); } -void lv_obj_set_style_pad_row(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -218,7 +176,7 @@ void lv_obj_set_style_pad_row(lv_obj_t * obj, int32_t value, lv_style_selector_t lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_ROW, v, selector); } -void lv_obj_set_style_pad_column(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -226,39 +184,7 @@ void lv_obj_set_style_pad_column(lv_obj_t * obj, int32_t value, lv_style_selecto lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_COLUMN, v, selector); } -void lv_obj_set_style_margin_top(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_MARGIN_TOP, v, selector); -} - -void lv_obj_set_style_margin_bottom(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_MARGIN_BOTTOM, v, selector); -} - -void lv_obj_set_style_margin_left(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_MARGIN_LEFT, v, selector); -} - -void lv_obj_set_style_margin_right(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_MARGIN_RIGHT, v, selector); -} - -void lv_obj_set_style_bg_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +void lv_obj_set_style_bg_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -266,7 +192,7 @@ void lv_obj_set_style_bg_color(lv_obj_t * obj, lv_color_t value, lv_style_select lv_obj_set_local_style_prop(obj, LV_STYLE_BG_COLOR, v, selector); } -void lv_obj_set_style_bg_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_bg_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -274,7 +200,7 @@ void lv_obj_set_style_bg_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t lv_obj_set_local_style_prop(obj, LV_STYLE_BG_OPA, v, selector); } -void lv_obj_set_style_bg_grad_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +void lv_obj_set_style_bg_grad_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -282,7 +208,7 @@ void lv_obj_set_style_bg_grad_color(lv_obj_t * obj, lv_color_t value, lv_style_s lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_COLOR, v, selector); } -void lv_obj_set_style_bg_grad_dir(lv_obj_t * obj, lv_grad_dir_t value, lv_style_selector_t selector) +void lv_obj_set_style_bg_grad_dir(struct _lv_obj_t * obj, lv_grad_dir_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -290,7 +216,7 @@ void lv_obj_set_style_bg_grad_dir(lv_obj_t * obj, lv_grad_dir_t value, lv_style_ lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_DIR, v, selector); } -void lv_obj_set_style_bg_main_stop(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -298,7 +224,7 @@ void lv_obj_set_style_bg_main_stop(lv_obj_t * obj, int32_t value, lv_style_selec lv_obj_set_local_style_prop(obj, LV_STYLE_BG_MAIN_STOP, v, selector); } -void lv_obj_set_style_bg_grad_stop(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -306,71 +232,63 @@ void lv_obj_set_style_bg_grad_stop(lv_obj_t * obj, int32_t value, lv_style_selec lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_STOP, v, selector); } -void lv_obj_set_style_bg_main_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_bg_grad(struct _lv_obj_t * obj, const lv_grad_dsc_t * value, lv_style_selector_t selector) { lv_style_value_t v = { - .num = (int32_t)value + .ptr = value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_BG_MAIN_OPA, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD, v, selector); } -void lv_obj_set_style_bg_grad_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_bg_dither_mode(struct _lv_obj_t * obj, lv_dither_mode_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_OPA, v, selector); -} - -void lv_obj_set_style_bg_grad(lv_obj_t * obj, const lv_grad_dsc_t * value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .ptr = value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_BG_DITHER_MODE, v, selector); } -void lv_obj_set_style_bg_image_src(lv_obj_t * obj, const void * value, lv_style_selector_t selector) +void lv_obj_set_style_bg_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector) { lv_style_value_t v = { .ptr = value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMAGE_SRC, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_SRC, v, selector); } -void lv_obj_set_style_bg_image_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_bg_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMAGE_OPA, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_OPA, v, selector); } -void lv_obj_set_style_bg_image_recolor(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +void lv_obj_set_style_bg_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMAGE_RECOLOR, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_RECOLOR, v, selector); } -void lv_obj_set_style_bg_image_recolor_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_bg_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMAGE_RECOLOR_OPA, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_RECOLOR_OPA, v, selector); } -void lv_obj_set_style_bg_image_tiled(lv_obj_t * obj, bool value, lv_style_selector_t selector) +void lv_obj_set_style_bg_img_tiled(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMAGE_TILED, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_BG_IMG_TILED, v, selector); } -void lv_obj_set_style_border_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +void lv_obj_set_style_border_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -378,7 +296,7 @@ void lv_obj_set_style_border_color(lv_obj_t * obj, lv_color_t value, lv_style_se lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_COLOR, v, selector); } -void lv_obj_set_style_border_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_border_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -386,7 +304,7 @@ void lv_obj_set_style_border_opa(lv_obj_t * obj, lv_opa_t value, lv_style_select lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_OPA, v, selector); } -void lv_obj_set_style_border_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_border_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -394,7 +312,7 @@ void lv_obj_set_style_border_width(lv_obj_t * obj, int32_t value, lv_style_selec lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_WIDTH, v, selector); } -void lv_obj_set_style_border_side(lv_obj_t * obj, lv_border_side_t value, lv_style_selector_t selector) +void lv_obj_set_style_border_side(struct _lv_obj_t * obj, lv_border_side_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -402,7 +320,7 @@ void lv_obj_set_style_border_side(lv_obj_t * obj, lv_border_side_t value, lv_sty lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_SIDE, v, selector); } -void lv_obj_set_style_border_post(lv_obj_t * obj, bool value, lv_style_selector_t selector) +void lv_obj_set_style_border_post(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -410,7 +328,7 @@ void lv_obj_set_style_border_post(lv_obj_t * obj, bool value, lv_style_selector_ lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_POST, v, selector); } -void lv_obj_set_style_outline_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -418,7 +336,7 @@ void lv_obj_set_style_outline_width(lv_obj_t * obj, int32_t value, lv_style_sele lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_WIDTH, v, selector); } -void lv_obj_set_style_outline_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +void lv_obj_set_style_outline_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -426,7 +344,7 @@ void lv_obj_set_style_outline_color(lv_obj_t * obj, lv_color_t value, lv_style_s lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_COLOR, v, selector); } -void lv_obj_set_style_outline_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_outline_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -434,7 +352,7 @@ void lv_obj_set_style_outline_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selec lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_OPA, v, selector); } -void lv_obj_set_style_outline_pad(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -442,7 +360,7 @@ void lv_obj_set_style_outline_pad(lv_obj_t * obj, int32_t value, lv_style_select lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_PAD, v, selector); } -void lv_obj_set_style_shadow_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -450,23 +368,23 @@ void lv_obj_set_style_shadow_width(lv_obj_t * obj, int32_t value, lv_style_selec lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_WIDTH, v, selector); } -void lv_obj_set_style_shadow_offset_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_shadow_ofs_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFFSET_X, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFS_X, v, selector); } -void lv_obj_set_style_shadow_offset_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_shadow_ofs_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFFSET_Y, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFS_Y, v, selector); } -void lv_obj_set_style_shadow_spread(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -474,7 +392,7 @@ void lv_obj_set_style_shadow_spread(lv_obj_t * obj, int32_t value, lv_style_sele lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_SPREAD, v, selector); } -void lv_obj_set_style_shadow_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +void lv_obj_set_style_shadow_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -482,7 +400,7 @@ void lv_obj_set_style_shadow_color(lv_obj_t * obj, lv_color_t value, lv_style_se lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_COLOR, v, selector); } -void lv_obj_set_style_shadow_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_shadow_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -490,31 +408,31 @@ void lv_obj_set_style_shadow_opa(lv_obj_t * obj, lv_opa_t value, lv_style_select lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OPA, v, selector); } -void lv_obj_set_style_image_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_IMAGE_OPA, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_IMG_OPA, v, selector); } -void lv_obj_set_style_image_recolor(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +void lv_obj_set_style_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_IMAGE_RECOLOR, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_IMG_RECOLOR, v, selector); } -void lv_obj_set_style_image_recolor_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_IMAGE_RECOLOR_OPA, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_IMG_RECOLOR_OPA, v, selector); } -void lv_obj_set_style_line_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_line_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -522,7 +440,7 @@ void lv_obj_set_style_line_width(lv_obj_t * obj, int32_t value, lv_style_selecto lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_WIDTH, v, selector); } -void lv_obj_set_style_line_dash_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -530,7 +448,7 @@ void lv_obj_set_style_line_dash_width(lv_obj_t * obj, int32_t value, lv_style_se lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_DASH_WIDTH, v, selector); } -void lv_obj_set_style_line_dash_gap(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -538,7 +456,7 @@ void lv_obj_set_style_line_dash_gap(lv_obj_t * obj, int32_t value, lv_style_sele lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_DASH_GAP, v, selector); } -void lv_obj_set_style_line_rounded(lv_obj_t * obj, bool value, lv_style_selector_t selector) +void lv_obj_set_style_line_rounded(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -546,7 +464,7 @@ void lv_obj_set_style_line_rounded(lv_obj_t * obj, bool value, lv_style_selector lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_ROUNDED, v, selector); } -void lv_obj_set_style_line_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +void lv_obj_set_style_line_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -554,7 +472,7 @@ void lv_obj_set_style_line_color(lv_obj_t * obj, lv_color_t value, lv_style_sele lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_COLOR, v, selector); } -void lv_obj_set_style_line_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_line_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -562,7 +480,7 @@ void lv_obj_set_style_line_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_OPA, v, selector); } -void lv_obj_set_style_arc_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -570,7 +488,7 @@ void lv_obj_set_style_arc_width(lv_obj_t * obj, int32_t value, lv_style_selector lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_WIDTH, v, selector); } -void lv_obj_set_style_arc_rounded(lv_obj_t * obj, bool value, lv_style_selector_t selector) +void lv_obj_set_style_arc_rounded(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -578,7 +496,7 @@ void lv_obj_set_style_arc_rounded(lv_obj_t * obj, bool value, lv_style_selector_ lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_ROUNDED, v, selector); } -void lv_obj_set_style_arc_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +void lv_obj_set_style_arc_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -586,7 +504,7 @@ void lv_obj_set_style_arc_color(lv_obj_t * obj, lv_color_t value, lv_style_selec lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_COLOR, v, selector); } -void lv_obj_set_style_arc_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_arc_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -594,15 +512,15 @@ void lv_obj_set_style_arc_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_ lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_OPA, v, selector); } -void lv_obj_set_style_arc_image_src(lv_obj_t * obj, const void * value, lv_style_selector_t selector) +void lv_obj_set_style_arc_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector) { lv_style_value_t v = { .ptr = value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_IMAGE_SRC, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_ARC_IMG_SRC, v, selector); } -void lv_obj_set_style_text_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) +void lv_obj_set_style_text_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) { lv_style_value_t v = { .color = value @@ -610,7 +528,7 @@ void lv_obj_set_style_text_color(lv_obj_t * obj, lv_color_t value, lv_style_sele lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_COLOR, v, selector); } -void lv_obj_set_style_text_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_text_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -618,7 +536,7 @@ void lv_obj_set_style_text_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_OPA, v, selector); } -void lv_obj_set_style_text_font(lv_obj_t * obj, const lv_font_t * value, lv_style_selector_t selector) +void lv_obj_set_style_text_font(struct _lv_obj_t * obj, const lv_font_t * value, lv_style_selector_t selector) { lv_style_value_t v = { .ptr = value @@ -626,7 +544,7 @@ void lv_obj_set_style_text_font(lv_obj_t * obj, const lv_font_t * value, lv_styl lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_FONT, v, selector); } -void lv_obj_set_style_text_letter_space(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -634,7 +552,7 @@ void lv_obj_set_style_text_letter_space(lv_obj_t * obj, int32_t value, lv_style_ lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_LETTER_SPACE, v, selector); } -void lv_obj_set_style_text_line_space(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -642,7 +560,7 @@ void lv_obj_set_style_text_line_space(lv_obj_t * obj, int32_t value, lv_style_se lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_LINE_SPACE, v, selector); } -void lv_obj_set_style_text_decor(lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector) +void lv_obj_set_style_text_decor(struct _lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -650,7 +568,7 @@ void lv_obj_set_style_text_decor(lv_obj_t * obj, lv_text_decor_t value, lv_style lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_DECOR, v, selector); } -void lv_obj_set_style_text_align(lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector) +void lv_obj_set_style_text_align(struct _lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -658,7 +576,7 @@ void lv_obj_set_style_text_align(lv_obj_t * obj, lv_text_align_t value, lv_style lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_ALIGN, v, selector); } -void lv_obj_set_style_radius(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -666,7 +584,7 @@ void lv_obj_set_style_radius(lv_obj_t * obj, int32_t value, lv_style_selector_t lv_obj_set_local_style_prop(obj, LV_STYLE_RADIUS, v, selector); } -void lv_obj_set_style_clip_corner(lv_obj_t * obj, bool value, lv_style_selector_t selector) +void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -674,7 +592,7 @@ void lv_obj_set_style_clip_corner(lv_obj_t * obj, bool value, lv_style_selector_ lv_obj_set_local_style_prop(obj, LV_STYLE_CLIP_CORNER, v, selector); } -void lv_obj_set_style_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -682,7 +600,7 @@ void lv_obj_set_style_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t se lv_obj_set_local_style_prop(obj, LV_STYLE_OPA, v, selector); } -void lv_obj_set_style_opa_layered(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_opa_layered(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -690,7 +608,7 @@ void lv_obj_set_style_opa_layered(lv_obj_t * obj, lv_opa_t value, lv_style_selec lv_obj_set_local_style_prop(obj, LV_STYLE_OPA_LAYERED, v, selector); } -void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector) +void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector) { lv_style_value_t v = { .ptr = value @@ -698,7 +616,7 @@ void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc lv_obj_set_local_style_prop(obj, LV_STYLE_COLOR_FILTER_DSC, v, selector); } -void lv_obj_set_style_color_filter_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value @@ -706,7 +624,7 @@ void lv_obj_set_style_color_filter_opa(lv_obj_t * obj, lv_opa_t value, lv_style_ lv_obj_set_local_style_prop(obj, LV_STYLE_COLOR_FILTER_OPA, v, selector); } -void lv_obj_set_style_anim(lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector) +void lv_obj_set_style_anim(struct _lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector) { lv_style_value_t v = { .ptr = value @@ -714,184 +632,50 @@ void lv_obj_set_style_anim(lv_obj_t * obj, const lv_anim_t * value, lv_style_sel lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM, v, selector); } -void lv_obj_set_style_anim_duration(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM_DURATION, v, selector); -} - -void lv_obj_set_style_transition(lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .ptr = value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSITION, v, selector); -} - -void lv_obj_set_style_blend_mode(lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_BLEND_MODE, v, selector); -} - -void lv_obj_set_style_layout(lv_obj_t * obj, uint16_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_LAYOUT, v, selector); -} - -void lv_obj_set_style_base_dir(lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_BASE_DIR, v, selector); -} - -void lv_obj_set_style_bitmap_mask_src(lv_obj_t * obj, const void * value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .ptr = value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_BITMAP_MASK_SRC, v, selector); -} - -void lv_obj_set_style_rotary_sensitivity(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_ROTARY_SENSITIVITY, v, selector); -} -#if LV_USE_FLEX - -void lv_obj_set_style_flex_flow(lv_obj_t * obj, lv_flex_flow_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_FLOW, v, selector); -} - -void lv_obj_set_style_flex_main_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_MAIN_PLACE, v, selector); -} - -void lv_obj_set_style_flex_cross_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_CROSS_PLACE, v, selector); -} - -void lv_obj_set_style_flex_track_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector) +void lv_obj_set_style_anim_time(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_TRACK_PLACE, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM_TIME, v, selector); } -void lv_obj_set_style_flex_grow(lv_obj_t * obj, uint8_t value, lv_style_selector_t selector) +void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_GROW, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM_SPEED, v, selector); } -#endif /*LV_USE_FLEX*/ -#if LV_USE_GRID - -void lv_obj_set_style_grid_column_dsc_array(lv_obj_t * obj, const int32_t * value, lv_style_selector_t selector) +void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector) { lv_style_value_t v = { .ptr = value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_COLUMN_DSC_ARRAY, v, selector); -} - -void lv_obj_set_style_grid_column_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_COLUMN_ALIGN, v, selector); -} - -void lv_obj_set_style_grid_row_dsc_array(lv_obj_t * obj, const int32_t * value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .ptr = value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_ROW_DSC_ARRAY, v, selector); -} - -void lv_obj_set_style_grid_row_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_ROW_ALIGN, v, selector); -} - -void lv_obj_set_style_grid_cell_column_pos(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_COLUMN_POS, v, selector); -} - -void lv_obj_set_style_grid_cell_x_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_X_ALIGN, v, selector); -} - -void lv_obj_set_style_grid_cell_column_span(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_COLUMN_SPAN, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSITION, v, selector); } -void lv_obj_set_style_grid_cell_row_pos(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_blend_mode(struct _lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_ROW_POS, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_BLEND_MODE, v, selector); } -void lv_obj_set_style_grid_cell_y_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector) +void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint16_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_Y_ALIGN, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_LAYOUT, v, selector); } -void lv_obj_set_style_grid_cell_row_span(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) +void lv_obj_set_style_base_dir(struct _lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector) { lv_style_value_t v = { .num = (int32_t)value }; - lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_ROW_SPAN, v, selector); + lv_obj_set_local_style_prop(obj, LV_STYLE_BASE_DIR, v, selector); } -#endif /*LV_USE_GRID*/ - diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_style_gen.h b/L3_Middlewares/LVGL/src/core/lv_obj_style_gen.h index 77cf537..4a135be 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_style_gen.h +++ b/L3_Middlewares/LVGL/src/core/lv_obj_style_gen.h @@ -1,875 +1,655 @@ - -/* - ********************************************************************** - * DO NOT EDIT - * This file is automatically generated by "style_api_gen.py" - ********************************************************************** - */ - - -#ifndef LV_OBJ_STYLE_GEN_H -#define LV_OBJ_STYLE_GEN_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "../misc/lv_area.h" -#include "../misc/lv_style.h" -#include "../core/lv_obj_style.h" -#include "../misc/lv_types.h" - -static inline int32_t lv_obj_get_style_width(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_width(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_WIDTH); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_min_width(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_min_width(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MIN_WIDTH); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_max_width(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_max_width(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MAX_WIDTH); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_height(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_height(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_HEIGHT); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_min_height(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_min_height(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MIN_HEIGHT); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_max_height(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_max_height(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MAX_HEIGHT); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_length(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LENGTH); - return (int32_t)v.num; -} - -static inline int32_t lv_obj_get_style_x(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_x(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_X); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_y(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_y(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_Y); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline lv_align_t lv_obj_get_style_align(const lv_obj_t * obj, lv_part_t part) +static inline lv_align_t lv_obj_get_style_align(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ALIGN); return (lv_align_t)v.num; } -static inline int32_t lv_obj_get_style_transform_width(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_transform_width(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_WIDTH); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_transform_height(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_transform_height(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_HEIGHT); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_translate_x(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_translate_x(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSLATE_X); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_translate_y(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_translate_y(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSLATE_Y); - return (int32_t)v.num; -} - -static inline int32_t lv_obj_get_style_transform_scale_x(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_SCALE_X); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_transform_scale_y(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_transform_zoom(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_SCALE_Y); - return (int32_t)v.num; + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ZOOM); + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_transform_rotation(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_transform_angle(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ROTATION); - return (int32_t)v.num; + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ANGLE); + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_transform_pivot_x(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_transform_pivot_x(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_PIVOT_X); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_transform_pivot_y(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_transform_pivot_y(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_PIVOT_Y); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_transform_skew_x(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_SKEW_X); - return (int32_t)v.num; -} - -static inline int32_t lv_obj_get_style_transform_skew_y(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_SKEW_Y); - return (int32_t)v.num; -} - -static inline int32_t lv_obj_get_style_pad_top(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_pad_top(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_TOP); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_pad_bottom(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_pad_bottom(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_BOTTOM); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_pad_left(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_pad_left(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_LEFT); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_pad_right(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_pad_right(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_RIGHT); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_pad_row(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_pad_row(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_ROW); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_pad_column(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_pad_column(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_COLUMN); - return (int32_t)v.num; -} - -static inline int32_t lv_obj_get_style_margin_top(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MARGIN_TOP); - return (int32_t)v.num; -} - -static inline int32_t lv_obj_get_style_margin_bottom(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MARGIN_BOTTOM); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_margin_left(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MARGIN_LEFT); - return (int32_t)v.num; -} - -static inline int32_t lv_obj_get_style_margin_right(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MARGIN_RIGHT); - return (int32_t)v.num; -} - -static inline lv_color_t lv_obj_get_style_bg_color(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_bg_color(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_bg_color_filtered(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_bg_color_filtered(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_COLOR)); + lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_COLOR)); return v.color; } -static inline lv_opa_t lv_obj_get_style_bg_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_bg_opa(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_OPA); return (lv_opa_t)v.num; } -static inline lv_color_t lv_obj_get_style_bg_grad_color(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_bg_grad_color(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, - LV_STYLE_BG_GRAD_COLOR)); + lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR)); return v.color; } -static inline lv_grad_dir_t lv_obj_get_style_bg_grad_dir(const lv_obj_t * obj, lv_part_t part) +static inline lv_grad_dir_t lv_obj_get_style_bg_grad_dir(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_DIR); return (lv_grad_dir_t)v.num; } -static inline int32_t lv_obj_get_style_bg_main_stop(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_bg_main_stop(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_MAIN_STOP); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_bg_grad_stop(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_bg_grad_stop(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_STOP); - return (int32_t)v.num; -} - -static inline lv_opa_t lv_obj_get_style_bg_main_opa(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_MAIN_OPA); - return (lv_opa_t)v.num; + return (lv_coord_t)v.num; } -static inline lv_opa_t lv_obj_get_style_bg_grad_opa(const lv_obj_t * obj, lv_part_t part) +static inline const lv_grad_dsc_t * lv_obj_get_style_bg_grad(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_OPA); - return (lv_opa_t)v.num; + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD); + return (const lv_grad_dsc_t *)v.ptr; } -static inline const lv_grad_dsc_t * lv_obj_get_style_bg_grad(const lv_obj_t * obj, lv_part_t part) +static inline lv_dither_mode_t lv_obj_get_style_bg_dither_mode(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD); - return (const lv_grad_dsc_t *)v.ptr; + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_DITHER_MODE); + return (lv_dither_mode_t)v.num; } -static inline const void * lv_obj_get_style_bg_image_src(const lv_obj_t * obj, lv_part_t part) +static inline const void * lv_obj_get_style_bg_img_src(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMAGE_SRC); + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_SRC); return (const void *)v.ptr; } -static inline lv_opa_t lv_obj_get_style_bg_image_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_bg_img_opa(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMAGE_OPA); + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_OPA); return (lv_opa_t)v.num; } -static inline lv_color_t lv_obj_get_style_bg_image_recolor(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_bg_img_recolor(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMAGE_RECOLOR); + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_RECOLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_bg_image_recolor_filtered(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_bg_img_recolor_filtered(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, - LV_STYLE_BG_IMAGE_RECOLOR)); + lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_RECOLOR)); return v.color; } -static inline lv_opa_t lv_obj_get_style_bg_image_recolor_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_bg_img_recolor_opa(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMAGE_RECOLOR_OPA); + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_RECOLOR_OPA); return (lv_opa_t)v.num; } -static inline bool lv_obj_get_style_bg_image_tiled(const lv_obj_t * obj, lv_part_t part) +static inline bool lv_obj_get_style_bg_img_tiled(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMAGE_TILED); + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMG_TILED); return (bool)v.num; } -static inline lv_color_t lv_obj_get_style_border_color(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_border_color(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_border_color_filtered(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_border_color_filtered(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, - LV_STYLE_BORDER_COLOR)); + lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR)); return v.color; } -static inline lv_opa_t lv_obj_get_style_border_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_border_opa(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_OPA); return (lv_opa_t)v.num; } -static inline int32_t lv_obj_get_style_border_width(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_border_width(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_WIDTH); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline lv_border_side_t lv_obj_get_style_border_side(const lv_obj_t * obj, lv_part_t part) +static inline lv_border_side_t lv_obj_get_style_border_side(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_SIDE); return (lv_border_side_t)v.num; } -static inline bool lv_obj_get_style_border_post(const lv_obj_t * obj, lv_part_t part) +static inline bool lv_obj_get_style_border_post(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_POST); return (bool)v.num; } -static inline int32_t lv_obj_get_style_outline_width(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_outline_width(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_WIDTH); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline lv_color_t lv_obj_get_style_outline_color(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_outline_color(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_outline_color_filtered(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_outline_color_filtered(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, - LV_STYLE_OUTLINE_COLOR)); + lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR)); return v.color; } -static inline lv_opa_t lv_obj_get_style_outline_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_outline_opa(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_OPA); return (lv_opa_t)v.num; } -static inline int32_t lv_obj_get_style_outline_pad(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_outline_pad(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_PAD); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_shadow_width(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_shadow_width(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_WIDTH); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_shadow_offset_x(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_shadow_ofs_x(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFFSET_X); - return (int32_t)v.num; + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFS_X); + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_shadow_offset_y(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_shadow_ofs_y(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFFSET_Y); - return (int32_t)v.num; + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFS_Y); + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_shadow_spread(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_shadow_spread(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_SPREAD); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline lv_color_t lv_obj_get_style_shadow_color(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_shadow_color(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, - LV_STYLE_SHADOW_COLOR)); + lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR)); return v.color; } -static inline lv_opa_t lv_obj_get_style_shadow_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_shadow_opa(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OPA); return (lv_opa_t)v.num; } -static inline lv_opa_t lv_obj_get_style_image_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_img_opa(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMAGE_OPA); + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_OPA); return (lv_opa_t)v.num; } -static inline lv_color_t lv_obj_get_style_image_recolor(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_img_recolor(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMAGE_RECOLOR); + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_image_recolor_filtered(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_img_recolor_filtered(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, - LV_STYLE_IMAGE_RECOLOR)); + lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR)); return v.color; } -static inline lv_opa_t lv_obj_get_style_image_recolor_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_img_recolor_opa(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMAGE_RECOLOR_OPA); + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_IMG_RECOLOR_OPA); return (lv_opa_t)v.num; } -static inline int32_t lv_obj_get_style_line_width(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_line_width(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_WIDTH); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_line_dash_width(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_line_dash_width(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_DASH_WIDTH); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_line_dash_gap(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_line_dash_gap(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_DASH_GAP); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline bool lv_obj_get_style_line_rounded(const lv_obj_t * obj, lv_part_t part) +static inline bool lv_obj_get_style_line_rounded(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_ROUNDED); return (bool)v.num; } -static inline lv_color_t lv_obj_get_style_line_color(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_line_color(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_line_color_filtered(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_line_color_filtered(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_COLOR)); + lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_COLOR)); return v.color; } -static inline lv_opa_t lv_obj_get_style_line_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_line_opa(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_OPA); return (lv_opa_t)v.num; } -static inline int32_t lv_obj_get_style_arc_width(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_arc_width(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_WIDTH); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline bool lv_obj_get_style_arc_rounded(const lv_obj_t * obj, lv_part_t part) +static inline bool lv_obj_get_style_arc_rounded(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_ROUNDED); return (bool)v.num; } -static inline lv_color_t lv_obj_get_style_arc_color(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_arc_color(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_arc_color_filtered(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_arc_color_filtered(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_COLOR)); + lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_COLOR)); return v.color; } -static inline lv_opa_t lv_obj_get_style_arc_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_arc_opa(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_OPA); return (lv_opa_t)v.num; } -static inline const void * lv_obj_get_style_arc_image_src(const lv_obj_t * obj, lv_part_t part) +static inline const void * lv_obj_get_style_arc_img_src(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_IMAGE_SRC); + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_IMG_SRC); return (const void *)v.ptr; } -static inline lv_color_t lv_obj_get_style_text_color(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_text_color(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_COLOR); return v.color; } -static inline lv_color_t lv_obj_get_style_text_color_filtered(const lv_obj_t * obj, lv_part_t part) +static inline lv_color_t lv_obj_get_style_text_color_filtered(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_COLOR)); + lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_COLOR)); return v.color; } -static inline lv_opa_t lv_obj_get_style_text_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_text_opa(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_OPA); return (lv_opa_t)v.num; } -static inline const lv_font_t * lv_obj_get_style_text_font(const lv_obj_t * obj, lv_part_t part) +static inline const lv_font_t * lv_obj_get_style_text_font(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_FONT); return (const lv_font_t *)v.ptr; } -static inline int32_t lv_obj_get_style_text_letter_space(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_text_letter_space(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_LETTER_SPACE); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline int32_t lv_obj_get_style_text_line_space(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_text_line_space(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_LINE_SPACE); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline lv_text_decor_t lv_obj_get_style_text_decor(const lv_obj_t * obj, lv_part_t part) +static inline lv_text_decor_t lv_obj_get_style_text_decor(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_DECOR); return (lv_text_decor_t)v.num; } -static inline lv_text_align_t lv_obj_get_style_text_align(const lv_obj_t * obj, lv_part_t part) +static inline lv_text_align_t lv_obj_get_style_text_align(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_ALIGN); return (lv_text_align_t)v.num; } -static inline int32_t lv_obj_get_style_radius(const lv_obj_t * obj, lv_part_t part) +static inline lv_coord_t lv_obj_get_style_radius(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_RADIUS); - return (int32_t)v.num; + return (lv_coord_t)v.num; } -static inline bool lv_obj_get_style_clip_corner(const lv_obj_t * obj, lv_part_t part) +static inline bool lv_obj_get_style_clip_corner(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_CLIP_CORNER); return (bool)v.num; } -static inline lv_opa_t lv_obj_get_style_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_opa(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OPA); return (lv_opa_t)v.num; } -static inline lv_opa_t lv_obj_get_style_opa_layered(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_opa_layered(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OPA_LAYERED); return (lv_opa_t)v.num; } -static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const lv_obj_t * obj, lv_part_t part) +static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_DSC); return (const lv_color_filter_dsc_t *)v.ptr; } -static inline lv_opa_t lv_obj_get_style_color_filter_opa(const lv_obj_t * obj, lv_part_t part) +static inline lv_opa_t lv_obj_get_style_color_filter_opa(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_OPA); return (lv_opa_t)v.num; } -static inline const lv_anim_t * lv_obj_get_style_anim(const lv_obj_t * obj, lv_part_t part) +static inline const lv_anim_t * lv_obj_get_style_anim(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ANIM); return (const lv_anim_t *)v.ptr; } -static inline uint32_t lv_obj_get_style_anim_duration(const lv_obj_t * obj, lv_part_t part) +static inline uint32_t lv_obj_get_style_anim_time(const struct _lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ANIM_TIME); + return (uint32_t)v.num; +} + +static inline uint32_t lv_obj_get_style_anim_speed(const struct _lv_obj_t * obj, uint32_t part) { - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ANIM_DURATION); + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ANIM_SPEED); return (uint32_t)v.num; } -static inline const lv_style_transition_dsc_t * lv_obj_get_style_transition(const lv_obj_t * obj, lv_part_t part) +static inline const lv_style_transition_dsc_t * lv_obj_get_style_transition(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSITION); return (const lv_style_transition_dsc_t *)v.ptr; } -static inline lv_blend_mode_t lv_obj_get_style_blend_mode(const lv_obj_t * obj, lv_part_t part) +static inline lv_blend_mode_t lv_obj_get_style_blend_mode(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BLEND_MODE); return (lv_blend_mode_t)v.num; } -static inline uint16_t lv_obj_get_style_layout(const lv_obj_t * obj, lv_part_t part) +static inline uint16_t lv_obj_get_style_layout(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LAYOUT); return (uint16_t)v.num; } -static inline lv_base_dir_t lv_obj_get_style_base_dir(const lv_obj_t * obj, lv_part_t part) +static inline lv_base_dir_t lv_obj_get_style_base_dir(const struct _lv_obj_t * obj, uint32_t part) { lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BASE_DIR); return (lv_base_dir_t)v.num; } -static inline const void * lv_obj_get_style_bitmap_mask_src(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BITMAP_MASK_SRC); - return (const void *)v.ptr; -} - -static inline uint32_t lv_obj_get_style_rotary_sensitivity(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ROTARY_SENSITIVITY); - return (uint32_t)v.num; -} - -#if LV_USE_FLEX -static inline lv_flex_flow_t lv_obj_get_style_flex_flow(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_FLEX_FLOW); - return (lv_flex_flow_t)v.num; -} - -static inline lv_flex_align_t lv_obj_get_style_flex_main_place(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_FLEX_MAIN_PLACE); - return (lv_flex_align_t)v.num; -} - -static inline lv_flex_align_t lv_obj_get_style_flex_cross_place(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_FLEX_CROSS_PLACE); - return (lv_flex_align_t)v.num; -} - -static inline lv_flex_align_t lv_obj_get_style_flex_track_place(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_FLEX_TRACK_PLACE); - return (lv_flex_align_t)v.num; -} - -static inline uint8_t lv_obj_get_style_flex_grow(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_FLEX_GROW); - return (uint8_t)v.num; -} - -#endif /*LV_USE_FLEX*/ - -#if LV_USE_GRID -static inline const int32_t * lv_obj_get_style_grid_column_dsc_array(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_COLUMN_DSC_ARRAY); - return (const int32_t *)v.ptr; -} - -static inline lv_grid_align_t lv_obj_get_style_grid_column_align(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_COLUMN_ALIGN); - return (lv_grid_align_t)v.num; -} - -static inline const int32_t * lv_obj_get_style_grid_row_dsc_array(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_ROW_DSC_ARRAY); - return (const int32_t *)v.ptr; -} - -static inline lv_grid_align_t lv_obj_get_style_grid_row_align(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_ROW_ALIGN); - return (lv_grid_align_t)v.num; -} - -static inline int32_t lv_obj_get_style_grid_cell_column_pos(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_COLUMN_POS); - return (int32_t)v.num; -} - -static inline lv_grid_align_t lv_obj_get_style_grid_cell_x_align(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_X_ALIGN); - return (lv_grid_align_t)v.num; -} - -static inline int32_t lv_obj_get_style_grid_cell_column_span(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_COLUMN_SPAN); - return (int32_t)v.num; -} - -static inline int32_t lv_obj_get_style_grid_cell_row_pos(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_ROW_POS); - return (int32_t)v.num; -} - -static inline lv_grid_align_t lv_obj_get_style_grid_cell_y_align(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_Y_ALIGN); - return (lv_grid_align_t)v.num; -} - -static inline int32_t lv_obj_get_style_grid_cell_row_span(const lv_obj_t * obj, lv_part_t part) -{ - lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_ROW_SPAN); - return (int32_t)v.num; -} - -#endif /*LV_USE_GRID*/ - -void lv_obj_set_style_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_min_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_max_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_height(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_min_height(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_max_height(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_length(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_align(lv_obj_t * obj, lv_align_t value, lv_style_selector_t selector); -void lv_obj_set_style_transform_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_transform_height(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_translate_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_translate_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_transform_scale_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_transform_scale_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_transform_rotation(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_transform_pivot_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_transform_pivot_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_transform_skew_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_transform_skew_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_pad_top(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_pad_bottom(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_pad_left(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_pad_right(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_pad_row(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_pad_column(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_margin_top(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_margin_bottom(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_margin_left(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_margin_right(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_grad_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_grad_dir(lv_obj_t * obj, lv_grad_dir_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_main_stop(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_grad_stop(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_main_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_grad_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_grad(lv_obj_t * obj, const lv_grad_dsc_t * value, lv_style_selector_t selector); -void lv_obj_set_style_bg_image_src(lv_obj_t * obj, const void * value, lv_style_selector_t selector); -void lv_obj_set_style_bg_image_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_image_recolor(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_image_recolor_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_bg_image_tiled(lv_obj_t * obj, bool value, lv_style_selector_t selector); -void lv_obj_set_style_border_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); -void lv_obj_set_style_border_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_border_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_border_side(lv_obj_t * obj, lv_border_side_t value, lv_style_selector_t selector); -void lv_obj_set_style_border_post(lv_obj_t * obj, bool value, lv_style_selector_t selector); -void lv_obj_set_style_outline_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_outline_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); -void lv_obj_set_style_outline_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_outline_pad(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_shadow_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_shadow_offset_x(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_shadow_offset_y(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_shadow_spread(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_shadow_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); -void lv_obj_set_style_shadow_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_image_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_image_recolor(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); -void lv_obj_set_style_image_recolor_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_line_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_line_dash_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_line_dash_gap(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_line_rounded(lv_obj_t * obj, bool value, lv_style_selector_t selector); -void lv_obj_set_style_line_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); -void lv_obj_set_style_line_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_arc_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_arc_rounded(lv_obj_t * obj, bool value, lv_style_selector_t selector); -void lv_obj_set_style_arc_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); -void lv_obj_set_style_arc_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_arc_image_src(lv_obj_t * obj, const void * value, lv_style_selector_t selector); -void lv_obj_set_style_text_color(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); -void lv_obj_set_style_text_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_text_font(lv_obj_t * obj, const lv_font_t * value, lv_style_selector_t selector); -void lv_obj_set_style_text_letter_space(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_text_line_space(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_text_decor(lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector); -void lv_obj_set_style_text_align(lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector); -void lv_obj_set_style_radius(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_clip_corner(lv_obj_t * obj, bool value, lv_style_selector_t selector); -void lv_obj_set_style_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_opa_layered(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_color_filter_dsc(lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector); -void lv_obj_set_style_color_filter_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); -void lv_obj_set_style_anim(lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector); -void lv_obj_set_style_anim_duration(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector); -void lv_obj_set_style_transition(lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector); -void lv_obj_set_style_blend_mode(lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector); -void lv_obj_set_style_layout(lv_obj_t * obj, uint16_t value, lv_style_selector_t selector); -void lv_obj_set_style_base_dir(lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector); -void lv_obj_set_style_bitmap_mask_src(lv_obj_t * obj, const void * value, lv_style_selector_t selector); -void lv_obj_set_style_rotary_sensitivity(lv_obj_t * obj, uint32_t value, lv_style_selector_t selector); -#if LV_USE_FLEX -void lv_obj_set_style_flex_flow(lv_obj_t * obj, lv_flex_flow_t value, lv_style_selector_t selector); -void lv_obj_set_style_flex_main_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector); -void lv_obj_set_style_flex_cross_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector); -void lv_obj_set_style_flex_track_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector); -void lv_obj_set_style_flex_grow(lv_obj_t * obj, uint8_t value, lv_style_selector_t selector); -#endif /*LV_USE_FLEX*/ - -#if LV_USE_GRID -void lv_obj_set_style_grid_column_dsc_array(lv_obj_t * obj, const int32_t * value, lv_style_selector_t selector); -void lv_obj_set_style_grid_column_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector); -void lv_obj_set_style_grid_row_dsc_array(lv_obj_t * obj, const int32_t * value, lv_style_selector_t selector); -void lv_obj_set_style_grid_row_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector); -void lv_obj_set_style_grid_cell_column_pos(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_grid_cell_x_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector); -void lv_obj_set_style_grid_cell_column_span(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_grid_cell_row_pos(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -void lv_obj_set_style_grid_cell_y_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector); -void lv_obj_set_style_grid_cell_row_span(lv_obj_t * obj, int32_t value, lv_style_selector_t selector); -#endif /*LV_USE_GRID*/ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_OBJ_STYLE_GEN_H */ +void lv_obj_set_style_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_min_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_max_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_min_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_max_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_align(struct _lv_obj_t * obj, lv_align_t value, lv_style_selector_t selector); +void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_transform_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_translate_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_translate_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_transform_zoom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_transform_angle(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_transform_pivot_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_transform_pivot_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_pad_top(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_bg_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); +void lv_obj_set_style_bg_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_bg_grad_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); +void lv_obj_set_style_bg_grad_dir(struct _lv_obj_t * obj, lv_grad_dir_t value, lv_style_selector_t selector); +void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_bg_grad(struct _lv_obj_t * obj, const lv_grad_dsc_t * value, lv_style_selector_t selector); +void lv_obj_set_style_bg_dither_mode(struct _lv_obj_t * obj, lv_dither_mode_t value, lv_style_selector_t selector); +void lv_obj_set_style_bg_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector); +void lv_obj_set_style_bg_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_bg_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); +void lv_obj_set_style_bg_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_bg_img_tiled(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector); +void lv_obj_set_style_border_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); +void lv_obj_set_style_border_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_border_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_border_side(struct _lv_obj_t * obj, lv_border_side_t value, lv_style_selector_t selector); +void lv_obj_set_style_border_post(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector); +void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_outline_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); +void lv_obj_set_style_outline_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_shadow_ofs_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_shadow_ofs_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_shadow_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); +void lv_obj_set_style_shadow_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_img_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_img_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); +void lv_obj_set_style_img_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_line_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_line_rounded(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector); +void lv_obj_set_style_line_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); +void lv_obj_set_style_line_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_arc_rounded(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector); +void lv_obj_set_style_arc_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); +void lv_obj_set_style_arc_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_arc_img_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector); +void lv_obj_set_style_text_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector); +void lv_obj_set_style_text_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_text_font(struct _lv_obj_t * obj, const lv_font_t * value, lv_style_selector_t selector); +void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_text_decor(struct _lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector); +void lv_obj_set_style_text_align(struct _lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector); +void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector); +void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_opa_layered(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector); +void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); +void lv_obj_set_style_anim(struct _lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector); +void lv_obj_set_style_anim_time(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector); +void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector); +void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector); +void lv_obj_set_style_blend_mode(struct _lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector); +void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint16_t value, lv_style_selector_t selector); +void lv_obj_set_style_base_dir(struct _lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector); diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_style_private.h b/L3_Middlewares/LVGL/src/core/lv_obj_style_private.h deleted file mode 100644 index 7fafc58..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_obj_style_private.h +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @file lv_obj_style_private.h - * - */ - -#ifndef LV_OBJ_STYLE_PRIVATE_H -#define LV_OBJ_STYLE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_obj_style.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_obj_style_t { - const lv_style_t * style; - uint32_t selector : 24; - uint32_t is_local : 1; - uint32_t is_trans : 1; -}; - -struct lv_obj_style_transition_dsc_t { - uint16_t time; - uint16_t delay; - lv_style_selector_t selector; - lv_style_prop_t prop; - lv_anim_path_cb_t path_cb; - void * user_data; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize the object related style manager module. - * Called by LVGL in `lv_init()` - */ -void lv_obj_style_init(void); - -/** - * Deinitialize the object related style manager module. - * Called by LVGL in `lv_deinit()` - */ -void lv_obj_style_deinit(void); - -/** - * Used internally to create a style transition - * @param obj - * @param part - * @param prev_state - * @param new_state - * @param tr - */ -void lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t prev_state, - lv_state_t new_state, const lv_obj_style_transition_dsc_t * tr); - -/** - * Used internally to compare the appearance of an object in 2 states - * @param obj - * @param state1 - * @param state2 - * @return - */ -lv_style_state_cmp_t lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t state1, lv_state_t state2); - -/** - * Update the layer type of a widget bayed on its current styles. - * The result will be stored in `obj->spec_attr->layer_type` - * @param obj the object whose layer should be updated - */ -void lv_obj_update_layer_type(lv_obj_t * obj); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OBJ_STYLE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_tree.c b/L3_Middlewares/LVGL/src/core/lv_obj_tree.c index 15c069e..5ae629e 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_tree.c +++ b/L3_Middlewares/LVGL/src/core/lv_obj_tree.c @@ -6,23 +6,18 @@ /********************* * INCLUDES *********************/ -#include "lv_obj_private.h" -#include "lv_obj_class_private.h" -#include "../indev/lv_indev.h" -#include "../indev/lv_indev_private.h" -#include "../display/lv_display.h" -#include "../display/lv_display_private.h" -#include "../misc/lv_anim_private.h" +#include + +#include "lv_obj.h" +#include "lv_indev.h" +#include "../misc/lv_anim.h" +#include "../misc/lv_gc.h" #include "../misc/lv_async.h" -#include "../core/lv_global.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_obj_class) -#define disp_ll_p &(LV_GLOBAL_DEFAULT()->disp_ll) - -#define OBJ_DUMP_STRING_LEN 128 +#define MY_CLASS &lv_obj_class /********************** * TYPEDEFS @@ -31,11 +26,9 @@ /********************** * STATIC PROTOTYPES **********************/ -static void lv_obj_delete_async_cb(void * obj); -static void obj_delete_core(lv_obj_t * obj); +static void lv_obj_del_async_cb(void * obj); +static void obj_del_core(lv_obj_t * obj); static lv_obj_tree_walk_res_t walk_core(lv_obj_t * obj, lv_obj_tree_walk_cb_t cb, void * user_data); -static void dump_tree_core(lv_obj_t * obj, int32_t depth); -static lv_obj_t * lv_obj_get_first_not_deleting_child(lv_obj_t * obj); /********************** * STATIC VARIABLES @@ -49,36 +42,33 @@ static lv_obj_t * lv_obj_get_first_not_deleting_child(lv_obj_t * obj); * GLOBAL FUNCTIONS **********************/ -void lv_obj_delete(lv_obj_t * obj) +void lv_obj_del(lv_obj_t * obj) { - if(obj->is_deleting) - return; - LV_LOG_TRACE("begin (delete %p)", (void *)obj); LV_ASSERT_OBJ(obj, MY_CLASS); lv_obj_invalidate(obj); lv_obj_t * par = lv_obj_get_parent(obj); - lv_display_t * disp = NULL; - bool act_screen_del = false; + lv_disp_t * disp = NULL; + bool act_scr_del = false; if(par == NULL) { - disp = lv_obj_get_display(obj); + disp = lv_obj_get_disp(obj); if(!disp) return; /*Shouldn't happen*/ - if(disp->act_scr == obj) act_screen_del = true; + if(disp->act_scr == obj) act_scr_del = true; } - obj_delete_core(obj); + obj_del_core(obj); /*Call the ancestor's event handler to the parent to notify it about the child delete*/ - if(par && !par->is_deleting) { + if(par) { lv_obj_scrollbar_invalidate(par); - lv_obj_send_event(par, LV_EVENT_CHILD_CHANGED, NULL); - lv_obj_send_event(par, LV_EVENT_CHILD_DELETED, NULL); + lv_event_send(par, LV_EVENT_CHILD_CHANGED, NULL); + lv_event_send(par, LV_EVENT_CHILD_DELETED, NULL); } /*Handle if the active screen was deleted*/ - if(act_screen_del) { + if(act_scr_del) { LV_LOG_WARN("the active screen was deleted"); disp->act_scr = NULL; } @@ -89,16 +79,15 @@ void lv_obj_delete(lv_obj_t * obj) void lv_obj_clean(lv_obj_t * obj) { - LV_LOG_TRACE("begin (clean %p)", (void *)obj); + LV_LOG_TRACE("begin (delete %p)", (void *)obj); LV_ASSERT_OBJ(obj, MY_CLASS); lv_obj_invalidate(obj); - uint32_t cnt = lv_obj_get_child_count(obj); - lv_obj_t * child = lv_obj_get_first_not_deleting_child(obj); + lv_obj_t * child = lv_obj_get_child(obj, 0); while(child) { - obj_delete_core(child); - child = lv_obj_get_first_not_deleting_child(obj); + obj_del_core(child); + child = lv_obj_get_child(obj, 0); } /*Just to remove scroll animations if any*/ lv_obj_scroll_to(obj, 0, 0, LV_ANIM_OFF); @@ -107,37 +96,32 @@ void lv_obj_clean(lv_obj_t * obj) obj->spec_attr->scroll.y = 0; } - if(lv_obj_get_child_count(obj) < cnt) { - lv_obj_send_event(obj, LV_EVENT_CHILD_CHANGED, NULL); - lv_obj_send_event(obj, LV_EVENT_CHILD_DELETED, NULL); - } - LV_ASSERT_MEM_INTEGRITY(); - LV_LOG_TRACE("finished (clean %p)", (void *)obj); + LV_LOG_TRACE("finished (delete %p)", (void *)obj); } -void lv_obj_delete_delayed(lv_obj_t * obj, uint32_t delay_ms) +void lv_obj_del_delayed(lv_obj_t * obj, uint32_t delay_ms) { lv_anim_t a; lv_anim_init(&a); lv_anim_set_var(&a, obj); lv_anim_set_exec_cb(&a, NULL); - lv_anim_set_duration(&a, 1); + lv_anim_set_time(&a, 1); lv_anim_set_delay(&a, delay_ms); - lv_anim_set_completed_cb(&a, lv_obj_delete_anim_completed_cb); + lv_anim_set_ready_cb(&a, lv_obj_del_anim_ready_cb); lv_anim_start(&a); } -void lv_obj_delete_anim_completed_cb(lv_anim_t * a) +void lv_obj_del_anim_ready_cb(lv_anim_t * a) { - lv_obj_delete(a->var); + lv_obj_del(a->var); } -void lv_obj_delete_async(lv_obj_t * obj) +void lv_obj_del_async(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_async_call(lv_obj_delete_async_cb, obj); + lv_async_call(lv_obj_del_async_cb, obj); } void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent) @@ -155,10 +139,6 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent) return; } - if(parent == obj->parent) { - return; - } - lv_obj_invalidate(obj); lv_obj_allocate_spec_attr(parent); @@ -166,35 +146,35 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent) lv_obj_t * old_parent = obj->parent; /*Remove the object from the old parent's child list*/ int32_t i; - for(i = lv_obj_get_index(obj); i <= (int32_t)lv_obj_get_child_count(old_parent) - 2; i++) { + for(i = lv_obj_get_index(obj); i <= (int32_t)lv_obj_get_child_cnt(old_parent) - 2; i++) { old_parent->spec_attr->children[i] = old_parent->spec_attr->children[i + 1]; } old_parent->spec_attr->child_cnt--; if(old_parent->spec_attr->child_cnt) { - old_parent->spec_attr->children = lv_realloc(old_parent->spec_attr->children, - old_parent->spec_attr->child_cnt * (sizeof(lv_obj_t *))); + old_parent->spec_attr->children = lv_mem_realloc(old_parent->spec_attr->children, + old_parent->spec_attr->child_cnt * (sizeof(lv_obj_t *))); } else { - lv_free(old_parent->spec_attr->children); + lv_mem_free(old_parent->spec_attr->children); old_parent->spec_attr->children = NULL; } /*Add the child to the new parent as the last (newest child)*/ parent->spec_attr->child_cnt++; - parent->spec_attr->children = lv_realloc(parent->spec_attr->children, - parent->spec_attr->child_cnt * (sizeof(lv_obj_t *))); - parent->spec_attr->children[lv_obj_get_child_count(parent) - 1] = obj; + parent->spec_attr->children = lv_mem_realloc(parent->spec_attr->children, + parent->spec_attr->child_cnt * (sizeof(lv_obj_t *))); + parent->spec_attr->children[lv_obj_get_child_cnt(parent) - 1] = obj; obj->parent = parent; /*Notify the original parent because one of its children is lost*/ lv_obj_scrollbar_invalidate(old_parent); - lv_obj_send_event(old_parent, LV_EVENT_CHILD_CHANGED, obj); - lv_obj_send_event(old_parent, LV_EVENT_CHILD_DELETED, NULL); + lv_event_send(old_parent, LV_EVENT_CHILD_CHANGED, obj); + lv_event_send(old_parent, LV_EVENT_CHILD_DELETED, NULL); /*Notify the new parent about the child*/ - lv_obj_send_event(parent, LV_EVENT_CHILD_CHANGED, obj); - lv_obj_send_event(parent, LV_EVENT_CHILD_CREATED, NULL); + lv_event_send(parent, LV_EVENT_CHILD_CHANGED, obj); + lv_event_send(parent, LV_EVENT_CHILD_CREATED, NULL); lv_obj_mark_layout_as_dirty(obj); @@ -205,31 +185,17 @@ void lv_obj_move_to_index(lv_obj_t * obj, int32_t index) { LV_ASSERT_OBJ(obj, MY_CLASS); - /* Check parent validity */ - lv_obj_t * parent = lv_obj_get_parent(obj); - if(!parent) { - LV_LOG_WARN("parent is NULL"); - return; + if(index < 0) { + index = lv_obj_get_child_cnt(lv_obj_get_parent(obj)) + index; } - const uint32_t parent_child_count = lv_obj_get_child_count(parent); - /* old_index only can be 0 or greater, this point cannot be reached if the parent is not null */ const int32_t old_index = lv_obj_get_index(obj); - LV_ASSERT(0 <= old_index); - - if(index < 0) { - index += parent_child_count; - } - /* Index was negative and the absolute value is greater than parent child count */ - if((index < 0) - /* Index is same or bigger than parent child count */ - || (index >= (int32_t) parent_child_count) - /* If both previous and new index are the same */ - || (index == old_index)) { + lv_obj_t * parent = lv_obj_get_parent(obj); - return; - } + if(index < 0) return; + if(index >= (int32_t) lv_obj_get_child_cnt(parent)) return; + if(index == old_index) return; int32_t i = old_index; if(index < old_index) { @@ -246,7 +212,7 @@ void lv_obj_move_to_index(lv_obj_t * obj, int32_t index) } parent->spec_attr->children[index] = obj; - lv_obj_send_event(parent, LV_EVENT_CHILD_CHANGED, NULL); + lv_event_send(parent, LV_EVENT_CHILD_CHANGED, NULL); lv_obj_invalidate(parent); } @@ -261,19 +227,16 @@ void lv_obj_swap(lv_obj_t * obj1, lv_obj_t * obj2) uint_fast32_t index1 = lv_obj_get_index(obj1); uint_fast32_t index2 = lv_obj_get_index(obj2); - lv_obj_send_event(parent2, LV_EVENT_CHILD_DELETED, obj2); - lv_obj_send_event(parent, LV_EVENT_CHILD_DELETED, obj1); + lv_event_send(parent2, LV_EVENT_CHILD_DELETED, obj2); + lv_event_send(parent, LV_EVENT_CHILD_DELETED, obj1); parent->spec_attr->children[index1] = obj2; - obj2->parent = parent; - parent2->spec_attr->children[index2] = obj1; - obj1->parent = parent2; - lv_obj_send_event(parent, LV_EVENT_CHILD_CHANGED, obj2); - lv_obj_send_event(parent, LV_EVENT_CHILD_CREATED, obj2); - lv_obj_send_event(parent2, LV_EVENT_CHILD_CHANGED, obj1); - lv_obj_send_event(parent2, LV_EVENT_CHILD_CREATED, obj1); + lv_event_send(parent, LV_EVENT_CHILD_CHANGED, obj2); + lv_event_send(parent, LV_EVENT_CHILD_CREATED, obj2); + lv_event_send(parent2, LV_EVENT_CHILD_CHANGED, obj1); + lv_event_send(parent2, LV_EVENT_CHILD_CREATED, obj1); lv_obj_invalidate(parent); @@ -298,7 +261,7 @@ lv_obj_t * lv_obj_get_screen(const lv_obj_t * obj) return (lv_obj_t *)act_par; } -lv_display_t * lv_obj_get_display(const lv_obj_t * obj) +lv_disp_t * lv_obj_get_disp(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -307,9 +270,8 @@ lv_display_t * lv_obj_get_display(const lv_obj_t * obj) if(obj->parent == NULL) scr = obj; /*`obj` is a screen*/ else scr = lv_obj_get_screen(obj); /*get the screen of `obj`*/ - lv_display_t * d; - lv_ll_t * disp_head = disp_ll_p; - LV_LL_READ(disp_head, d) { + lv_disp_t * d; + _LV_LL_READ(&LV_GC_ROOT(_lv_disp_ll), d) { uint32_t i; for(i = 0; i < d->screen_cnt; i++) { if(d->screens[i] == scr) return d; @@ -328,130 +290,46 @@ lv_obj_t * lv_obj_get_parent(const lv_obj_t * obj) return obj->parent; } -lv_obj_t * lv_obj_get_child(const lv_obj_t * obj, int32_t idx) +lv_obj_t * lv_obj_get_child(const lv_obj_t * obj, int32_t id) { LV_ASSERT_OBJ(obj, MY_CLASS); if(obj->spec_attr == NULL) return NULL; uint32_t idu; - if(idx < 0) { - idx = obj->spec_attr->child_cnt + idx; - if(idx < 0) return NULL; - idu = (uint32_t) idx; + if(id < 0) { + id = obj->spec_attr->child_cnt + id; + if(id < 0) return NULL; + idu = (uint32_t) id; } else { - idu = idx; + idu = id; } if(idu >= obj->spec_attr->child_cnt) return NULL; - else return obj->spec_attr->children[idx]; + else return obj->spec_attr->children[id]; } -lv_obj_t * lv_obj_get_child_by_type(const lv_obj_t * obj, int32_t idx, const lv_obj_class_t * class_p) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - if(obj->spec_attr == NULL) return NULL; - - int32_t i; - int32_t cnt = (int32_t)obj->spec_attr->child_cnt; - if(idx >= 0) { - for(i = 0; i < cnt; i++) { - if(obj->spec_attr->children[i]->class_p == class_p) { - if(idx == 0) return obj->spec_attr->children[i]; - else idx--; - } - } - } - else { - idx++; /*-1 means the first child*/ - for(i = cnt - 1; i >= 0; i--) { - if(obj->spec_attr->children[i]->class_p == class_p) { - if(idx == 0) return obj->spec_attr->children[i]; - else idx++; - } - } - } - return NULL; -} - -lv_obj_t * lv_obj_get_sibling(const lv_obj_t * obj, int32_t idx) -{ - lv_obj_t * parent = lv_obj_get_parent(obj); - int32_t sibling_idx = (int32_t)lv_obj_get_index(obj) + idx; - if(sibling_idx < 0) return NULL; - - return lv_obj_get_child(parent, sibling_idx); -} - -lv_obj_t * lv_obj_get_sibling_by_type(const lv_obj_t * obj, int32_t idx, const lv_obj_class_t * class_p) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_obj_t * parent = lv_obj_get_parent(obj); - int32_t sibling_idx = (int32_t)lv_obj_get_index_by_type(obj, class_p) + idx; - if(sibling_idx < 0) return NULL; - - return lv_obj_get_child_by_type(parent, sibling_idx, class_p); -} - -uint32_t lv_obj_get_child_count(const lv_obj_t * obj) +uint32_t lv_obj_get_child_cnt(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); if(obj->spec_attr == NULL) return 0; return obj->spec_attr->child_cnt; } -uint32_t lv_obj_get_child_count_by_type(const lv_obj_t * obj, const lv_obj_class_t * class_p) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - if(obj->spec_attr == NULL) return 0; - - uint32_t i; - uint32_t cnt = 0; - for(i = 0; i < obj->spec_attr->child_cnt; i++) { - if(obj->spec_attr->children[i]->class_p == class_p) cnt++; - } - return cnt; -} - -int32_t lv_obj_get_index(const lv_obj_t * obj) +uint32_t lv_obj_get_index(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_obj_t * parent = lv_obj_get_parent(obj); - if(parent == NULL) return -1; - - int32_t i = 0; - for(i = 0; i < parent->spec_attr->child_cnt; i++) { - if(parent->spec_attr->children[i] == obj) return i; - } - - /*Shouldn't reach this point*/ - LV_ASSERT(0); - return -1; -} - -int32_t lv_obj_get_index_by_type(const lv_obj_t * obj, const lv_obj_class_t * class_p) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_obj_t * parent = lv_obj_get_parent(obj); - if(parent == NULL) return 0xFFFFFFFF; + if(parent == NULL) return 0; uint32_t i = 0; - uint32_t idx = 0; - for(i = 0; i < parent->spec_attr->child_cnt; i++) { - lv_obj_t * child = parent->spec_attr->children[i]; - if(child->class_p == class_p) { - if(child == obj) return idx; - idx++; - } + for(i = 0; i < lv_obj_get_child_cnt(parent); i++) { + if(lv_obj_get_child(parent, i) == obj) return i; } - /*Can happen if there was no children with the given type*/ - return -1; + return 0xFFFFFFFF; /*Shouldn't happen*/ } void lv_obj_tree_walk(lv_obj_t * start_obj, lv_obj_tree_walk_cb_t cb, void * user_data) @@ -459,69 +337,29 @@ void lv_obj_tree_walk(lv_obj_t * start_obj, lv_obj_tree_walk_cb_t cb, void * use walk_core(start_obj, cb, user_data); } -void lv_obj_dump_tree(lv_obj_t * start_obj) -{ - if(start_obj == NULL) { - lv_display_t * disp = lv_display_get_next(NULL); - while(disp) { - uint32_t i; - for(i = 0; i < disp->screen_cnt; i++) { - dump_tree_core(disp->screens[i], 0); - } - disp = lv_display_get_next(disp); - } - } - else { - dump_tree_core(start_obj, 0); - } -} - /********************** * STATIC FUNCTIONS **********************/ -static void lv_obj_delete_async_cb(void * obj) +static void lv_obj_del_async_cb(void * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_obj_delete(obj); + lv_obj_del(obj); } -static void obj_indev_reset(lv_indev_t * indev, lv_obj_t * obj) +static void obj_del_core(lv_obj_t * obj) { - /* If the input device is already in the release state, - * there is no need to wait for the input device to be released - */ - if(lv_indev_get_state(indev) != LV_INDEV_STATE_RELEASED) { - /*Wait for release to avoid accidentally triggering other obj to be clicked*/ - lv_indev_wait_release(indev); - } - - /*Reset the input device*/ - lv_indev_reset(indev, obj); -} - -static void obj_delete_core(lv_obj_t * obj) -{ - if(obj->is_deleting) - return; - - obj->is_deleting = true; - /*Let the user free the resources used in `LV_EVENT_DELETE`*/ - lv_result_t res = lv_obj_send_event(obj, LV_EVENT_DELETE, NULL); - if(res == LV_RESULT_INVALID) { - obj->is_deleting = false; - return; - } + lv_res_t res = lv_event_send(obj, LV_EVENT_DELETE, NULL); + if(res == LV_RES_INV) return; - /*Clean registered event_cb*/ - if(obj->spec_attr) lv_event_remove_all(&(obj->spec_attr->event_list)); + obj->being_deleted = 1; /*Recursively delete the children*/ lv_obj_t * child = lv_obj_get_child(obj, 0); while(child) { - obj_delete_core(child); + obj_del_core(child); child = lv_obj_get_child(obj, 0); } @@ -530,37 +368,25 @@ static void obj_delete_core(lv_obj_t * obj) /*Reset all input devices if the object to delete is used*/ lv_indev_t * indev = lv_indev_get_next(NULL); while(indev) { - lv_indev_type_t indev_type = lv_indev_get_type(indev); - if(indev_type == LV_INDEV_TYPE_POINTER || indev_type == LV_INDEV_TYPE_BUTTON) { - if(indev->pointer.act_obj == obj || indev->pointer.last_obj == obj || indev->pointer.scroll_obj == obj) { - obj_indev_reset(indev, obj); - } - if(indev->pointer.last_pressed == obj) { - indev->pointer.last_pressed = NULL; - } - if(indev->pointer.last_hovered == obj) { - indev->pointer.last_hovered = NULL; - } + if(indev->proc.types.pointer.act_obj == obj || indev->proc.types.pointer.last_obj == obj) { + lv_indev_reset(indev, obj); + } + if(indev->proc.types.pointer.last_pressed == obj) { + indev->proc.types.pointer.last_pressed = NULL; } - if(indev->group == group && obj == lv_indev_get_active_obj()) { - obj_indev_reset(indev, obj); + if(indev->group == group && obj == lv_indev_get_obj_act()) { + lv_indev_reset(indev, obj); } indev = lv_indev_get_next(indev); } - /*Delete all pending async del-s*/ - lv_result_t async_cancel_res = LV_RESULT_OK; - while(async_cancel_res == LV_RESULT_OK) { - async_cancel_res = lv_async_call_cancel(lv_obj_delete_async_cb, obj); - } - /*All children deleted. Now clean up the object specific data*/ - lv_obj_destruct(obj); + _lv_obj_destruct(obj); /*Remove the screen for the screen list*/ if(obj->parent == NULL) { - lv_display_t * disp = lv_obj_get_display(obj); + lv_disp_t * disp = lv_obj_get_disp(obj); uint32_t i; /*Find the screen in the list*/ for(i = 0; i < disp->screen_cnt; i++) { @@ -572,36 +398,37 @@ static void obj_delete_core(lv_obj_t * obj) disp->screens[i] = disp->screens[i + 1]; } disp->screen_cnt--; - disp->screens = lv_realloc(disp->screens, disp->screen_cnt * sizeof(lv_obj_t *)); + disp->screens = lv_mem_realloc(disp->screens, disp->screen_cnt * sizeof(lv_obj_t *)); } /*Remove the object from the child list of its parent*/ else { - int32_t id = lv_obj_get_index(obj); - uint16_t i; + uint32_t id = lv_obj_get_index(obj); + uint32_t i; for(i = id; i < obj->parent->spec_attr->child_cnt - 1; i++) { obj->parent->spec_attr->children[i] = obj->parent->spec_attr->children[i + 1]; } obj->parent->spec_attr->child_cnt--; - obj->parent->spec_attr->children = lv_realloc(obj->parent->spec_attr->children, - obj->parent->spec_attr->child_cnt * sizeof(lv_obj_t *)); + obj->parent->spec_attr->children = lv_mem_realloc(obj->parent->spec_attr->children, + obj->parent->spec_attr->child_cnt * sizeof(lv_obj_t *)); } /*Free the object itself*/ - lv_free(obj); + lv_mem_free(obj); } + static lv_obj_tree_walk_res_t walk_core(lv_obj_t * obj, lv_obj_tree_walk_cb_t cb, void * user_data) { lv_obj_tree_walk_res_t res = LV_OBJ_TREE_WALK_NEXT; if(obj == NULL) { - lv_display_t * disp = lv_display_get_next(NULL); + lv_disp_t * disp = lv_disp_get_next(NULL); while(disp) { uint32_t i; for(i = 0; i < disp->screen_cnt; i++) { walk_core(disp->screens[i], cb, user_data); } - disp = lv_display_get_next(disp); + disp = lv_disp_get_next(disp); } return LV_OBJ_TREE_WALK_END; /*The value doesn't matter as it wasn't called recursively*/ } @@ -612,51 +439,10 @@ static lv_obj_tree_walk_res_t walk_core(lv_obj_t * obj, lv_obj_tree_walk_cb_t cb if(res != LV_OBJ_TREE_WALK_SKIP_CHILDREN) { uint32_t i; - for(i = 0; i < lv_obj_get_child_count(obj); i++) { + for(i = 0; i < lv_obj_get_child_cnt(obj); i++) { res = walk_core(lv_obj_get_child(obj, i), cb, user_data); if(res == LV_OBJ_TREE_WALK_END) return LV_OBJ_TREE_WALK_END; } } return LV_OBJ_TREE_WALK_NEXT; } - -static void dump_tree_core(lv_obj_t * obj, int32_t depth) -{ -#if LV_USE_LOG - const char * id; - -#if LV_USE_OBJ_ID - char buf[OBJ_DUMP_STRING_LEN]; - id = lv_obj_stringify_id(obj, buf, sizeof(buf)); - if(id == NULL) id = "obj0"; -#else - id = "obj0"; -#endif - - /*id of `obj0` is an invalid id for builtin id*/ - LV_LOG_USER("parent:%p, obj:%p, id:%s;", (void *)(obj ? obj->parent : NULL), (void *)obj, id); -#endif /*LV_USE_LOG*/ - - if(obj && obj->spec_attr && obj->spec_attr->child_cnt) { - for(uint32_t i = 0; i < obj->spec_attr->child_cnt; i++) { - dump_tree_core(lv_obj_get_child(obj, i), depth + 1); - } - } -} - -static lv_obj_t * lv_obj_get_first_not_deleting_child(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - if(obj->spec_attr == NULL) return NULL; - - int32_t i; - int32_t cnt = (int32_t)obj->spec_attr->child_cnt; - for(i = 0; i < cnt; i++) { - if(!obj->spec_attr->children[i]->is_deleting) { - return obj->spec_attr->children[i]; - } - } - - return NULL; -} diff --git a/L3_Middlewares/LVGL/src/core/lv_obj_tree.h b/L3_Middlewares/LVGL/src/core/lv_obj_tree.h index 9f679dd..bee9e16 100644 --- a/L3_Middlewares/LVGL/src/core/lv_obj_tree.h +++ b/L3_Middlewares/LVGL/src/core/lv_obj_tree.h @@ -1,5 +1,5 @@ /** - * @file lv_obj_tree.h + * @file struct _lv_obj_tree.h * */ @@ -13,25 +13,28 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../misc/lv_types.h" -#include "../misc/lv_anim.h" -#include "../display/lv_display.h" +#include +#include /********************* * DEFINES *********************/ + /********************** * TYPEDEFS **********************/ +struct _lv_obj_t; +struct _lv_obj_class_t; + typedef enum { LV_OBJ_TREE_WALK_NEXT, LV_OBJ_TREE_WALK_SKIP_CHILDREN, LV_OBJ_TREE_WALK_END, } lv_obj_tree_walk_res_t; -typedef lv_obj_tree_walk_res_t (*lv_obj_tree_walk_cb_t)(lv_obj_t *, void *); +typedef lv_obj_tree_walk_res_t (*lv_obj_tree_walk_cb_t)(struct _lv_obj_t *, void *); /********************** * GLOBAL PROTOTYPES @@ -43,7 +46,7 @@ typedef lv_obj_tree_walk_res_t (*lv_obj_tree_walk_cb_t)(lv_obj_t *, void *); * Send `LV_EVENT_DELETED` to deleted objects. * @param obj pointer to an object */ -void lv_obj_delete(lv_obj_t * obj); +void lv_obj_del(struct _lv_obj_t * obj); /** * Delete all children of an object. @@ -51,20 +54,20 @@ void lv_obj_delete(lv_obj_t * obj); * Send `LV_EVENT_DELETED` to deleted objects. * @param obj pointer to an object */ -void lv_obj_clean(lv_obj_t * obj); +void lv_obj_clean(struct _lv_obj_t * obj); /** * Delete an object after some delay * @param obj pointer to an object * @param delay_ms time to wait before delete in milliseconds */ -void lv_obj_delete_delayed(lv_obj_t * obj, uint32_t delay_ms); +void lv_obj_del_delayed(struct _lv_obj_t * obj, uint32_t delay_ms); /** * A function to be easily used in animation ready callback to delete an object when the animation is ready * @param a pointer to the animation */ -void lv_obj_delete_anim_completed_cb(lv_anim_t * a); +void lv_obj_del_anim_ready_cb(lv_anim_t * a); /** * Helper function for asynchronously deleting objects. @@ -72,7 +75,7 @@ void lv_obj_delete_anim_completed_cb(lv_anim_t * a); * @param obj object to delete * @see lv_async_call */ -void lv_obj_delete_async(lv_obj_t * obj); +void lv_obj_del_async(struct _lv_obj_t * obj); /** * Move the parent of an object. The relative coordinates will be kept. @@ -80,7 +83,7 @@ void lv_obj_delete_async(lv_obj_t * obj); * @param obj pointer to an object whose parent needs to be changed * @param parent pointer to the new parent */ -void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent); +void lv_obj_set_parent(struct _lv_obj_t * obj, struct _lv_obj_t * parent); /** * Swap the positions of two objects. @@ -88,7 +91,7 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent); * @param obj1 pointer to the first object * @param obj2 pointer to the second object */ -void lv_obj_swap(lv_obj_t * obj1, lv_obj_t * obj2); +void lv_obj_swap(struct _lv_obj_t * obj1, struct _lv_obj_t * obj2); /** * moves the object to the given index in its parent. @@ -98,33 +101,33 @@ void lv_obj_swap(lv_obj_t * obj1, lv_obj_t * obj2); * @note to move to the background: lv_obj_move_to_index(obj, 0) * @note to move forward (up): lv_obj_move_to_index(obj, lv_obj_get_index(obj) - 1) */ -void lv_obj_move_to_index(lv_obj_t * obj, int32_t index); +void lv_obj_move_to_index(struct _lv_obj_t * obj, int32_t index); /** * Get the screen of an object * @param obj pointer to an object * @return pointer to the object's screen */ -lv_obj_t * lv_obj_get_screen(const lv_obj_t * obj); +struct _lv_obj_t * lv_obj_get_screen(const struct _lv_obj_t * obj); /** * Get the display of the object * @param obj pointer to an object * @return pointer to the object's display */ -lv_display_t * lv_obj_get_display(const lv_obj_t * obj); +lv_disp_t * lv_obj_get_disp(const struct _lv_obj_t * obj); /** * Get the parent of an object * @param obj pointer to an object * @return the parent of the object. (NULL if `obj` was a screen) */ -lv_obj_t * lv_obj_get_parent(const lv_obj_t * obj); +struct _lv_obj_t * lv_obj_get_parent(const struct _lv_obj_t * obj); /** * Get the child of an object by the child's index. * @param obj pointer to an object whose child should be get - * @param idx the index of the child. + * @param id the index of the child. * 0: the oldest (firstly created) child * 1: the second oldest * child count-1: the youngest @@ -132,85 +135,22 @@ lv_obj_t * lv_obj_get_parent(const lv_obj_t * obj); * -2: the second youngest * @return pointer to the child or NULL if the index was invalid */ -lv_obj_t * lv_obj_get_child(const lv_obj_t * obj, int32_t idx); - -/** - * Get the child of an object by the child's index. Consider the children only with a given type. - * @param obj pointer to an object whose child should be get - * @param idx the index of the child. - * 0: the oldest (firstly created) child - * 1: the second oldest - * child count-1: the youngest - * -1: the youngest - * -2: the second youngest - * @param class_p the type of the children to check - * @return pointer to the child or NULL if the index was invalid - */ -lv_obj_t * lv_obj_get_child_by_type(const lv_obj_t * obj, int32_t idx, - const lv_obj_class_t * class_p); - -/** - * Return a sibling of an object - * @param obj pointer to an object whose sibling should be get - * @param idx 0: `obj` itself - * -1: the first older sibling - * -2: the next older sibling - * 1: the first younger sibling - * 2: the next younger sibling - * etc - * @return pointer to the requested sibling or NULL if there is no such sibling - */ -lv_obj_t * lv_obj_get_sibling(const lv_obj_t * obj, int32_t idx); - -/** - * Return a sibling of an object. Consider the siblings only with a given type. - * @param obj pointer to an object whose sibling should be get - * @param idx 0: `obj` itself - * -1: the first older sibling - * -2: the next older sibling - * 1: the first younger sibling - * 2: the next younger sibling - * etc - * @param class_p the type of the children to check - * @return pointer to the requested sibling or NULL if there is no such sibling - */ -lv_obj_t * lv_obj_get_sibling_by_type(const lv_obj_t * obj, int32_t idx, - const lv_obj_class_t * class_p); +struct _lv_obj_t * lv_obj_get_child(const struct _lv_obj_t * obj, int32_t id); /** * Get the number of children * @param obj pointer to an object * @return the number of children */ -uint32_t lv_obj_get_child_count(const lv_obj_t * obj); - -/** - * Get the number of children having a given type. - * @param obj pointer to an object - * @param class_p the type of the children to check - * @return the number of children - */ - -uint32_t lv_obj_get_child_count_by_type(const lv_obj_t * obj, const lv_obj_class_t * class_p); +uint32_t lv_obj_get_child_cnt(const struct _lv_obj_t * obj); /** * Get the index of a child. * @param obj pointer to an object * @return the child index of the object. - * E.g. 0: the oldest (firstly created child). - * (-1 if child could not be found or no parent exists) + * E.g. 0: the oldest (firstly created child) */ -int32_t lv_obj_get_index(const lv_obj_t * obj); - -/** - * Get the index of a child. Consider the children only with a given type. - * @param obj pointer to an object - * @param class_p the type of the children to check - * @return the child index of the object. - * E.g. 0: the oldest (firstly created child with the given class). - * (-1 if child could not be found or no parent exists) - */ -int32_t lv_obj_get_index_by_type(const lv_obj_t * obj, const lv_obj_class_t * class_p); +uint32_t lv_obj_get_index(const struct _lv_obj_t * obj); /** * Iterate through all children of any object. @@ -218,18 +158,13 @@ int32_t lv_obj_get_index_by_type(const lv_obj_t * obj, const lv_obj_class_t * cl * @param cb call this callback on the objects * @param user_data pointer to any user related data (will be passed to `cb`) */ -void lv_obj_tree_walk(lv_obj_t * start_obj, lv_obj_tree_walk_cb_t cb, void * user_data); - -/** - * Iterate through all children of any object and print their ID. - * @param start_obj start integrating from this object - */ -void lv_obj_dump_tree(lv_obj_t * start_obj); +void lv_obj_tree_walk(struct _lv_obj_t * start_obj, lv_obj_tree_walk_cb_t cb, void * user_data); /********************** * MACROS **********************/ + #ifdef __cplusplus } /*extern "C"*/ #endif diff --git a/L3_Middlewares/LVGL/src/core/lv_refr.c b/L3_Middlewares/LVGL/src/core/lv_refr.c index e91fc00..bfd2748 100644 --- a/L3_Middlewares/LVGL/src/core/lv_refr.c +++ b/L3_Middlewares/LVGL/src/core/lv_refr.c @@ -6,35 +6,47 @@ /********************* * INCLUDES *********************/ -#include "lv_refr_private.h" -#include "lv_obj_draw_private.h" -#include "../misc/lv_area_private.h" -#include "../draw/sw/lv_draw_sw_mask_private.h" -#include "../draw/lv_draw_mask_private.h" -#include "lv_obj_private.h" -#include "lv_obj_event_private.h" -#include "../display/lv_display.h" -#include "../display/lv_display_private.h" -#include "../tick/lv_tick.h" -#include "../misc/lv_timer_private.h" +#include +#include "lv_refr.h" +#include "lv_disp.h" +#include "../hal/lv_hal_tick.h" +#include "../hal/lv_hal_disp.h" +#include "../misc/lv_timer.h" +#include "../misc/lv_mem.h" #include "../misc/lv_math.h" -#include "../misc/lv_profiler.h" -#include "../misc/lv_types.h" -#include "../draw/lv_draw_private.h" +#include "../misc/lv_gc.h" +#include "../draw/lv_draw.h" #include "../font/lv_font_fmt_txt.h" -#include "../stdlib/lv_string.h" -#include "lv_global.h" +#include "../extra/others/snapshot/lv_snapshot.h" + +#if LV_USE_PERF_MONITOR || LV_USE_MEM_MONITOR + #include "../widgets/lv_label.h" +#endif /********************* * DEFINES *********************/ -/*Display being refreshed*/ -#define disp_refr LV_GLOBAL_DEFAULT()->disp_refresh - /********************** * TYPEDEFS **********************/ +typedef struct { + uint32_t perf_last_time; + uint32_t elaps_sum; + uint32_t frame_cnt; + uint32_t fps_sum_cnt; + uint32_t fps_sum_all; +#if LV_USE_LABEL + lv_obj_t * perf_label; +#endif +} perf_monitor_t; + +typedef struct { + uint32_t mem_last_time; +#if LV_USE_LABEL + lv_obj_t * mem_label; +#endif +} mem_monitor_t; /********************** * STATIC PROTOTYPES @@ -43,26 +55,42 @@ static void lv_refr_join_area(void); static void refr_invalid_areas(void); static void refr_sync_areas(void); static void refr_area(const lv_area_t * area_p); -static void refr_area_part(lv_layer_t * layer); +static void refr_area_part(lv_draw_ctx_t * draw_ctx); static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj); -static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj); -static void refr_obj(lv_layer_t * layer, lv_obj_t * obj); -static uint32_t get_max_row(lv_display_t * disp, int32_t area_w, int32_t area_h); -static void draw_buf_flush(lv_display_t * disp); -static void call_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map); -static void wait_for_flushing(lv_display_t * disp); +static void refr_obj_and_children(lv_draw_ctx_t * draw_ctx, lv_obj_t * top_obj); +static void refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj); +static uint32_t get_max_row(lv_disp_t * disp, lv_coord_t area_w, lv_coord_t area_h); +static void draw_buf_flush(lv_disp_t * disp); +static void call_flush_cb(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_p); + +#if LV_USE_PERF_MONITOR + static void perf_monitor_init(perf_monitor_t * perf_monitor); +#endif +#if LV_USE_MEM_MONITOR + static void mem_monitor_init(mem_monitor_t * mem_monitor); +#endif /********************** * STATIC VARIABLES **********************/ +static uint32_t px_num; +static lv_disp_t * disp_refr; /*Display being refreshed*/ + +#if LV_USE_PERF_MONITOR + static perf_monitor_t perf_monitor; +#endif + +#if LV_USE_MEM_MONITOR + static mem_monitor_t mem_monitor; +#endif /********************** * MACROS **********************/ -#if LV_USE_LOG && LV_LOG_TRACE_DISP_REFR - #define LV_TRACE_REFR(...) LV_LOG_TRACE(__VA_ARGS__) +#if LV_LOG_TRACE_DISP_REFR + #define REFR_TRACE(...) LV_LOG_TRACE(__VA_ARGS__) #else - #define LV_TRACE_REFR(...) + #define REFR_TRACE(...) #endif /********************** @@ -72,206 +100,119 @@ static void wait_for_flushing(lv_display_t * disp); /** * Initialize the screen refresh subsystem */ -void lv_refr_init(void) -{ -} - -void lv_refr_deinit(void) +void _lv_refr_init(void) { +#if LV_USE_PERF_MONITOR + perf_monitor_init(&perf_monitor); +#endif +#if LV_USE_MEM_MONITOR + mem_monitor_init(&mem_monitor); +#endif } -void lv_refr_now(lv_display_t * disp) +void lv_refr_now(lv_disp_t * disp) { lv_anim_refr_now(); if(disp) { - if(disp->refr_timer) lv_display_refr_timer(disp->refr_timer); + if(disp->refr_timer) _lv_disp_refr_timer(disp->refr_timer); } else { - lv_display_t * d; - d = lv_display_get_next(NULL); + lv_disp_t * d; + d = lv_disp_get_next(NULL); while(d) { - if(d->refr_timer) lv_display_refr_timer(d->refr_timer); - d = lv_display_get_next(d); + if(d->refr_timer) _lv_disp_refr_timer(d->refr_timer); + d = lv_disp_get_next(d); } } } -void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj) +void lv_obj_redraw(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj) { - lv_area_t clip_area_ori = layer->_clip_area; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; lv_area_t clip_coords_for_obj; /*Truncate the clip area to `obj size + ext size` area*/ lv_area_t obj_coords_ext; lv_obj_get_coords(obj, &obj_coords_ext); - int32_t ext_draw_size = lv_obj_get_ext_draw_size(obj); + lv_coord_t ext_draw_size = _lv_obj_get_ext_draw_size(obj); lv_area_increase(&obj_coords_ext, ext_draw_size, ext_draw_size); - - if(!lv_area_intersect(&clip_coords_for_obj, &clip_area_ori, &obj_coords_ext)) return; - /*If the object is visible on the current clip area*/ - layer->_clip_area = clip_coords_for_obj; - - lv_obj_send_event(obj, LV_EVENT_DRAW_MAIN_BEGIN, layer); - lv_obj_send_event(obj, LV_EVENT_DRAW_MAIN, layer); - lv_obj_send_event(obj, LV_EVENT_DRAW_MAIN_END, layer); + bool com_clip_res = _lv_area_intersect(&clip_coords_for_obj, clip_area_ori, &obj_coords_ext); + /*If the object is visible on the current clip area OR has overflow visible draw it. + *With overflow visible drawing should happen to apply the masks which might affect children */ + bool should_draw = com_clip_res || lv_obj_has_flag(obj, LV_OBJ_FLAG_OVERFLOW_VISIBLE); + if(should_draw) { + draw_ctx->clip_area = &clip_coords_for_obj; + + lv_event_send(obj, LV_EVENT_DRAW_MAIN_BEGIN, draw_ctx); + lv_event_send(obj, LV_EVENT_DRAW_MAIN, draw_ctx); + lv_event_send(obj, LV_EVENT_DRAW_MAIN_END, draw_ctx); #if LV_USE_REFR_DEBUG - lv_color_t debug_color = lv_color_make(lv_rand(0, 0xFF), lv_rand(0, 0xFF), lv_rand(0, 0xFF)); - lv_draw_rect_dsc_t draw_dsc; - lv_draw_rect_dsc_init(&draw_dsc); - draw_dsc.bg_color = debug_color; - draw_dsc.bg_opa = LV_OPA_20; - draw_dsc.border_width = 1; - draw_dsc.border_opa = LV_OPA_30; - draw_dsc.border_color = debug_color; - lv_draw_rect(layer, &draw_dsc, &obj_coords_ext); + lv_color_t debug_color = lv_color_make(lv_rand(0, 0xFF), lv_rand(0, 0xFF), lv_rand(0, 0xFF)); + lv_draw_rect_dsc_t draw_dsc; + lv_draw_rect_dsc_init(&draw_dsc); + draw_dsc.bg_color.full = debug_color.full; + draw_dsc.bg_opa = LV_OPA_20; + draw_dsc.border_width = 1; + draw_dsc.border_opa = LV_OPA_30; + draw_dsc.border_color = debug_color; + lv_draw_rect(draw_ctx, &draw_dsc, &obj_coords_ext); #endif + } - const lv_area_t * obj_coords; + /*With overflow visible keep the previous clip area to let the children visible out of this object too + *With not overflow visible limit the clip are to the object's coordinates to clip the children*/ + lv_area_t clip_coords_for_children; + bool refr_children = true; if(lv_obj_has_flag(obj, LV_OBJ_FLAG_OVERFLOW_VISIBLE)) { - obj_coords = &obj_coords_ext; + clip_coords_for_children = *clip_area_ori; } else { - obj_coords = &obj->coords; - } - lv_area_t clip_coords_for_children; - bool refr_children = true; - if(!lv_area_intersect(&clip_coords_for_children, &clip_area_ori, obj_coords)) { - refr_children = false; + if(!_lv_area_intersect(&clip_coords_for_children, clip_area_ori, &obj->coords)) { + refr_children = false; + } } if(refr_children) { + draw_ctx->clip_area = &clip_coords_for_children; uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); - if(child_cnt == 0) { - /*If the object was visible on the clip area call the post draw events too*/ - layer->_clip_area = clip_coords_for_obj; - /*If all the children are redrawn make 'post draw' draw*/ - lv_obj_send_event(obj, LV_EVENT_DRAW_POST_BEGIN, layer); - lv_obj_send_event(obj, LV_EVENT_DRAW_POST, layer); - lv_obj_send_event(obj, LV_EVENT_DRAW_POST_END, layer); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); + for(i = 0; i < child_cnt; i++) { + lv_obj_t * child = obj->spec_attr->children[i]; + refr_obj(draw_ctx, child); } - else { - layer->_clip_area = clip_coords_for_children; - bool clip_corner = lv_obj_get_style_clip_corner(obj, LV_PART_MAIN); - - int32_t radius = 0; - if(clip_corner) { - radius = lv_obj_get_style_radius(obj, LV_PART_MAIN); - if(radius == 0) clip_corner = false; - } - - if(clip_corner == false) { - for(i = 0; i < child_cnt; i++) { - lv_obj_t * child = obj->spec_attr->children[i]; - refr_obj(layer, child); - } - - /*If the object was visible on the clip area call the post draw events too*/ - layer->_clip_area = clip_coords_for_obj; - /*If all the children are redrawn make 'post draw' draw*/ - lv_obj_send_event(obj, LV_EVENT_DRAW_POST_BEGIN, layer); - lv_obj_send_event(obj, LV_EVENT_DRAW_POST, layer); - lv_obj_send_event(obj, LV_EVENT_DRAW_POST_END, layer); - } - else { - lv_layer_t * layer_children; - lv_draw_mask_rect_dsc_t mask_draw_dsc; - lv_draw_mask_rect_dsc_init(&mask_draw_dsc); - mask_draw_dsc.radius = radius; - mask_draw_dsc.area = obj->coords; - - lv_draw_image_dsc_t img_draw_dsc; - lv_draw_image_dsc_init(&img_draw_dsc); - - int32_t short_side = LV_MIN(lv_area_get_width(&obj->coords), lv_area_get_height(&obj->coords)); - int32_t rout = LV_MIN(radius, short_side >> 1); - - lv_area_t bottom = obj->coords; - bottom.y1 = bottom.y2 - rout + 1; - if(lv_area_intersect(&bottom, &bottom, &clip_area_ori)) { - layer_children = lv_draw_layer_create(layer, LV_COLOR_FORMAT_ARGB8888, &bottom); - - for(i = 0; i < child_cnt; i++) { - lv_obj_t * child = obj->spec_attr->children[i]; - refr_obj(layer_children, child); - } - - /*If all the children are redrawn send 'post draw' draw*/ - lv_obj_send_event(obj, LV_EVENT_DRAW_POST_BEGIN, layer_children); - lv_obj_send_event(obj, LV_EVENT_DRAW_POST, layer_children); - lv_obj_send_event(obj, LV_EVENT_DRAW_POST_END, layer_children); - - lv_draw_mask_rect(layer_children, &mask_draw_dsc); - - img_draw_dsc.src = layer_children; - lv_draw_layer(layer, &img_draw_dsc, &bottom); - } - - lv_area_t top = obj->coords; - top.y2 = top.y1 + rout - 1; - if(lv_area_intersect(&top, &top, &clip_area_ori)) { - layer_children = lv_draw_layer_create(layer, LV_COLOR_FORMAT_ARGB8888, &top); - - for(i = 0; i < child_cnt; i++) { - lv_obj_t * child = obj->spec_attr->children[i]; - refr_obj(layer_children, child); - } - - /*If all the children are redrawn send 'post draw' draw*/ - lv_obj_send_event(obj, LV_EVENT_DRAW_POST_BEGIN, layer_children); - lv_obj_send_event(obj, LV_EVENT_DRAW_POST, layer_children); - lv_obj_send_event(obj, LV_EVENT_DRAW_POST_END, layer_children); - - lv_draw_mask_rect(layer_children, &mask_draw_dsc); - - img_draw_dsc.src = layer_children; - lv_draw_layer(layer, &img_draw_dsc, &top); - - } - - lv_area_t mid = obj->coords; - mid.y1 += rout; - mid.y2 -= rout; - if(lv_area_intersect(&mid, &mid, &clip_area_ori)) { - layer->_clip_area = mid; - for(i = 0; i < child_cnt; i++) { - lv_obj_t * child = obj->spec_attr->children[i]; - refr_obj(layer, child); - } - - /*If all the children are redrawn make 'post draw' draw*/ - lv_obj_send_event(obj, LV_EVENT_DRAW_POST_BEGIN, layer); - lv_obj_send_event(obj, LV_EVENT_DRAW_POST, layer); - lv_obj_send_event(obj, LV_EVENT_DRAW_POST_END, layer); + } - } + /*If the object was visible on the clip area call the post draw events too*/ + if(should_draw) { + draw_ctx->clip_area = &clip_coords_for_obj; - } - } + /*If all the children are redrawn make 'post draw' draw*/ + lv_event_send(obj, LV_EVENT_DRAW_POST_BEGIN, draw_ctx); + lv_event_send(obj, LV_EVENT_DRAW_POST, draw_ctx); + lv_event_send(obj, LV_EVENT_DRAW_POST_END, draw_ctx); } - layer->_clip_area = clip_area_ori; + draw_ctx->clip_area = clip_area_ori; } -void lv_inv_area(lv_display_t * disp, const lv_area_t * area_p) + +/** + * Invalidate an area on display to redraw it + * @param area_p pointer to area which should be invalidated (NULL: delete the invalidated areas) + * @param disp pointer to display where the area should be invalidated (NULL can be used if there is + * only one display) + */ +void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p) { - if(!disp) disp = lv_display_get_default(); + if(!disp) disp = lv_disp_get_default(); if(!disp) return; - if(!lv_display_is_invalidation_enabled(disp)) return; - - /** - * There are two reasons for this issue: - * 1.LVGL API is being used across threads, such as modifying widget properties in another thread - * or within an interrupt handler during the main thread rendering process. - * 2.User-customized widget modify widget properties/styles again within the DRAW event. - * - * Therefore, ensure that LVGL is used in a single-threaded manner, or refer to - * documentation: https://docs.lvgl.io/master/porting/os.html for proper locking mechanisms. - * Additionally, ensure that only drawing-related tasks are performed within the DRAW event, - * and move widget property/style modifications to other events. - */ - LV_ASSERT_MSG(!disp->rendering_in_progress, "Invalidate area is not allowed during rendering."); + if(!lv_disp_is_invalidation_enabled(disp)) return; + + if(disp->rendering_in_progress) { + LV_LOG_ERROR("detected modifying dirty areas in render"); + return; + } /*Clear the invalidate buffer if the parameter is NULL*/ if(area_p == NULL) { @@ -282,155 +223,251 @@ void lv_inv_area(lv_display_t * disp, const lv_area_t * area_p) lv_area_t scr_area; scr_area.x1 = 0; scr_area.y1 = 0; - scr_area.x2 = lv_display_get_horizontal_resolution(disp) - 1; - scr_area.y2 = lv_display_get_vertical_resolution(disp) - 1; + scr_area.x2 = lv_disp_get_hor_res(disp) - 1; + scr_area.y2 = lv_disp_get_ver_res(disp) - 1; lv_area_t com_area; bool suc; - suc = lv_area_intersect(&com_area, area_p, &scr_area); + suc = _lv_area_intersect(&com_area, area_p, &scr_area); if(suc == false) return; /*Out of the screen*/ - if(disp->color_format == LV_COLOR_FORMAT_I1) { - /*Make sure that the X coordinates start and end on byte boundary. - *E.g. convert 11;27 to 8;31*/ - com_area.x1 &= ~0x7; /*Round down: Nx8*/ - com_area.x2 |= 0x7; /*Round up: Nx8 - 1*/ - } - /*If there were at least 1 invalid area in full refresh mode, redraw the whole screen*/ - if(disp->render_mode == LV_DISPLAY_RENDER_MODE_FULL) { + if(disp->driver->full_refresh) { disp->inv_areas[0] = scr_area; disp->inv_p = 1; - lv_display_send_event(disp, LV_EVENT_REFR_REQUEST, NULL); + if(disp->refr_timer) lv_timer_resume(disp->refr_timer); return; } - lv_result_t res = lv_display_send_event(disp, LV_EVENT_INVALIDATE_AREA, &com_area); - if(res != LV_RESULT_OK) return; + if(disp->driver->rounder_cb) disp->driver->rounder_cb(disp->driver, &com_area); /*Save only if this area is not in one of the saved areas*/ uint16_t i; for(i = 0; i < disp->inv_p; i++) { - if(lv_area_is_in(&com_area, &disp->inv_areas[i], 0) != false) return; + if(_lv_area_is_in(&com_area, &disp->inv_areas[i], 0) != false) return; } /*Save the area*/ - lv_area_t * tmp_area_p = &com_area; - if(disp->inv_p >= LV_INV_BUF_SIZE) { /*If no place for the area add the screen*/ + if(disp->inv_p < LV_INV_BUF_SIZE) { + lv_area_copy(&disp->inv_areas[disp->inv_p], &com_area); + } + else { /*If no place for the area add the screen*/ disp->inv_p = 0; - tmp_area_p = &scr_area; + lv_area_copy(&disp->inv_areas[disp->inv_p], &scr_area); } - lv_area_copy(&disp->inv_areas[disp->inv_p], tmp_area_p); disp->inv_p++; - - lv_display_send_event(disp, LV_EVENT_REFR_REQUEST, NULL); + if(disp->refr_timer) lv_timer_resume(disp->refr_timer); } /** * Get the display which is being refreshed * @return the display being refreshed */ -lv_display_t * lv_refr_get_disp_refreshing(void) +lv_disp_t * _lv_refr_get_disp_refreshing(void) { return disp_refr; } /** - * Get the display which is being refreshed - * @return the display being refreshed + * Set the display which is being refreshed. + * It shouldn't be used directly by the user. + * It can be used to trick the drawing functions about there is an active display. + * @param the display being refreshed */ -void lv_refr_set_disp_refreshing(lv_display_t * disp) +void _lv_refr_set_disp_refreshing(lv_disp_t * disp) { disp_refr = disp; } -void lv_display_refr_timer(lv_timer_t * tmr) +/** + * Called periodically to handle the refreshing + * @param tmr pointer to the timer itself + */ +void _lv_disp_refr_timer(lv_timer_t * tmr) { - LV_PROFILER_BEGIN; - LV_TRACE_REFR("begin"); + REFR_TRACE("begin"); + + uint32_t start = lv_tick_get(); + volatile uint32_t elaps = 0; if(tmr) { disp_refr = tmr->user_data; - /* Ensure the timer does not run again automatically. +#if LV_USE_PERF_MONITOR == 0 && LV_USE_MEM_MONITOR == 0 + /** + * Ensure the timer does not run again automatically. * This is done before refreshing in case refreshing invalidates something else. - * However if the performance monitor is enabled keep the timer running to count the FPS.*/ -#if !LV_USE_PERF_MONITOR + */ lv_timer_pause(tmr); #endif } else { - disp_refr = lv_display_get_default(); - } - - if(disp_refr == NULL) { - LV_LOG_WARN("No display registered"); - return; - } - - lv_draw_buf_t * buf_act = disp_refr->buf_act; - if(!(buf_act && buf_act->data && buf_act->data_size)) { - LV_LOG_WARN("No draw buffer"); - return; + disp_refr = lv_disp_get_default(); } - lv_display_send_event(disp_refr, LV_EVENT_REFR_START, NULL); - /*Refresh the screen's layout if required*/ - LV_PROFILER_BEGIN_TAG("layout"); lv_obj_update_layout(disp_refr->act_scr); if(disp_refr->prev_scr) lv_obj_update_layout(disp_refr->prev_scr); - lv_obj_update_layout(disp_refr->bottom_layer); lv_obj_update_layout(disp_refr->top_layer); lv_obj_update_layout(disp_refr->sys_layer); - LV_PROFILER_END_TAG("layout"); /*Do nothing if there is no active screen*/ if(disp_refr->act_scr == NULL) { disp_refr->inv_p = 0; LV_LOG_WARN("there is no active screen"); - goto refr_finish; + REFR_TRACE("finished"); + return; } lv_refr_join_area(); refr_sync_areas(); refr_invalid_areas(); - if(disp_refr->inv_p == 0) goto refr_finish; - /*If refresh happened ...*/ - lv_display_send_event(disp_refr, LV_EVENT_RENDER_READY, NULL); + if(disp_refr->inv_p != 0) { - /*In double buffered direct mode save the updated areas. - *They will be used on the next call to synchronize the buffers.*/ - if(lv_display_is_double_buffered(disp_refr) && disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_DIRECT) { - uint32_t i; - for(i = 0; i < disp_refr->inv_p; i++) { - if(disp_refr->inv_area_joined[i]) - continue; + /*Copy invalid areas for sync next refresh in double buffered direct mode*/ + if(disp_refr->driver->direct_mode && disp_refr->driver->draw_buf->buf2) { - lv_area_t * sync_area = lv_ll_ins_tail(&disp_refr->sync_areas); - *sync_area = disp_refr->inv_areas[i]; + uint16_t i; + for(i = 0; i < disp_refr->inv_p; i++) { + if(disp_refr->inv_area_joined[i]) + continue; + + lv_area_t * sync_area = _lv_ll_ins_tail(&disp_refr->sync_areas); + *sync_area = disp_refr->inv_areas[i]; + } + } + + /*Clean up*/ + lv_memset_00(disp_refr->inv_areas, sizeof(disp_refr->inv_areas)); + lv_memset_00(disp_refr->inv_area_joined, sizeof(disp_refr->inv_area_joined)); + disp_refr->inv_p = 0; + + elaps = lv_tick_elaps(start); + + /*Call monitor cb if present*/ + if(disp_refr->driver->monitor_cb) { + disp_refr->driver->monitor_cb(disp_refr->driver, elaps, px_num); } } - lv_memzero(disp_refr->inv_areas, sizeof(disp_refr->inv_areas)); - lv_memzero(disp_refr->inv_area_joined, sizeof(disp_refr->inv_area_joined)); - disp_refr->inv_p = 0; + lv_mem_buf_free_all(); + _lv_font_clean_up_fmt_txt(); -refr_finish: +#if LV_DRAW_COMPLEX + _lv_draw_mask_cleanup(); +#endif -#if LV_DRAW_SW_COMPLEX == 1 - lv_draw_sw_mask_cleanup(); +#if LV_USE_PERF_MONITOR && LV_USE_LABEL + lv_obj_t * perf_label = perf_monitor.perf_label; + if(perf_label == NULL) { + perf_label = lv_label_create(lv_layer_sys()); + lv_obj_set_style_bg_opa(perf_label, LV_OPA_50, 0); + lv_obj_set_style_bg_color(perf_label, lv_color_black(), 0); + lv_obj_set_style_text_color(perf_label, lv_color_white(), 0); + lv_obj_set_style_pad_top(perf_label, 3, 0); + lv_obj_set_style_pad_bottom(perf_label, 3, 0); + lv_obj_set_style_pad_left(perf_label, 3, 0); + lv_obj_set_style_pad_right(perf_label, 3, 0); + lv_obj_set_style_text_align(perf_label, LV_TEXT_ALIGN_RIGHT, 0); + lv_label_set_text(perf_label, "?"); + lv_obj_align(perf_label, LV_USE_PERF_MONITOR_POS, 0, 0); + perf_monitor.perf_label = perf_label; + } + + if(lv_tick_elaps(perf_monitor.perf_last_time) < 300) { + if(px_num > 5000) { + perf_monitor.elaps_sum += elaps; + perf_monitor.frame_cnt ++; + } + } + else { + perf_monitor.perf_last_time = lv_tick_get(); + uint32_t fps_limit; + uint32_t fps; + + if(disp_refr->refr_timer) { + fps_limit = 1000 / disp_refr->refr_timer->period; + } + else { + fps_limit = 1000 / LV_DISP_DEF_REFR_PERIOD; + } + + if(perf_monitor.elaps_sum == 0) { + perf_monitor.elaps_sum = 1; + } + if(perf_monitor.frame_cnt == 0) { + fps = fps_limit; + } + else { + fps = (1000 * perf_monitor.frame_cnt) / perf_monitor.elaps_sum; + } + perf_monitor.elaps_sum = 0; + perf_monitor.frame_cnt = 0; + if(fps > fps_limit) { + fps = fps_limit; + } + + perf_monitor.fps_sum_all += fps; + perf_monitor.fps_sum_cnt ++; + uint32_t cpu = 100 - lv_timer_get_idle(); + lv_label_set_text_fmt(perf_label, "%"LV_PRIu32" FPS\n%"LV_PRIu32"%% CPU", fps, cpu); + } #endif - lv_display_send_event(disp_refr, LV_EVENT_REFR_READY, NULL); +#if LV_USE_MEM_MONITOR && LV_MEM_CUSTOM == 0 && LV_USE_LABEL + lv_obj_t * mem_label = mem_monitor.mem_label; + if(mem_label == NULL) { + mem_label = lv_label_create(lv_layer_sys()); + lv_obj_set_style_bg_opa(mem_label, LV_OPA_50, 0); + lv_obj_set_style_bg_color(mem_label, lv_color_black(), 0); + lv_obj_set_style_text_color(mem_label, lv_color_white(), 0); + lv_obj_set_style_pad_top(mem_label, 3, 0); + lv_obj_set_style_pad_bottom(mem_label, 3, 0); + lv_obj_set_style_pad_left(mem_label, 3, 0); + lv_obj_set_style_pad_right(mem_label, 3, 0); + lv_label_set_text(mem_label, "?"); + lv_obj_align(mem_label, LV_USE_MEM_MONITOR_POS, 0, 0); + mem_monitor.mem_label = mem_label; + } - LV_TRACE_REFR("finished"); - LV_PROFILER_END; + if(lv_tick_elaps(mem_monitor.mem_last_time) > 300) { + mem_monitor.mem_last_time = lv_tick_get(); + lv_mem_monitor_t mon; + lv_mem_monitor(&mon); + uint32_t used_size = mon.total_size - mon.free_size;; + uint32_t used_kb = used_size / 1024; + uint32_t used_kb_tenth = (used_size - (used_kb * 1024)) / 102; + lv_label_set_text_fmt(mem_label, + "%"LV_PRIu32 ".%"LV_PRIu32 " kB used (%d %%)\n" + "%d%% frag.", + used_kb, used_kb_tenth, mon.used_pct, + mon.frag_pct); + } +#endif + + REFR_TRACE("finished"); } +#if LV_USE_PERF_MONITOR +void lv_refr_reset_fps_counter(void) +{ + perf_monitor.fps_sum_all = 0; + perf_monitor.fps_sum_cnt = 0; +} + +uint32_t lv_refr_get_fps_avg(void) +{ + if(perf_monitor.fps_sum_cnt == 0) { + return 0; + } + return perf_monitor.fps_sum_all / perf_monitor.fps_sum_cnt; +} +#endif + + /********************** * STATIC FUNCTIONS **********************/ @@ -440,7 +477,6 @@ void lv_display_refr_timer(lv_timer_t * tmr) */ static void lv_refr_join_area(void) { - LV_PROFILER_BEGIN; uint32_t join_from; uint32_t join_in; lv_area_t joined_area; @@ -455,11 +491,11 @@ static void lv_refr_join_area(void) } /*Check if the areas are on each other*/ - if(lv_area_is_on(&disp_refr->inv_areas[join_in], &disp_refr->inv_areas[join_from]) == false) { + if(_lv_area_is_on(&disp_refr->inv_areas[join_in], &disp_refr->inv_areas[join_from]) == false) { continue; } - lv_area_join(&joined_area, &disp_refr->inv_areas[join_in], &disp_refr->inv_areas[join_from]); + _lv_area_join(&joined_area, &disp_refr->inv_areas[join_in], &disp_refr->inv_areas[join_from]); /*Join two area only if the joined area size is smaller*/ if(lv_area_get_size(&joined_area) < (lv_area_get_size(&disp_refr->inv_areas[join_in]) + @@ -471,7 +507,6 @@ static void lv_refr_join_area(void) } } } - LV_PROFILER_END; } /** @@ -479,56 +514,52 @@ static void lv_refr_join_area(void) */ static void refr_sync_areas(void) { - /*Do not sync if not direct or double buffered*/ - if(disp_refr->render_mode != LV_DISPLAY_RENDER_MODE_DIRECT) return; + /*Do not sync if not direct mode*/ + if(!disp_refr->driver->direct_mode) return; /*Do not sync if not double buffered*/ - if(!lv_display_is_double_buffered(disp_refr)) return; + if(disp_refr->driver->draw_buf->buf2 == NULL) return; /*Do not sync if no sync areas*/ - if(lv_ll_is_empty(&disp_refr->sync_areas)) return; - - LV_PROFILER_BEGIN; - /*With double buffered direct mode synchronize the rendered areas to the other buffer*/ - /*We need to wait for ready here to not mess up the active screen*/ - wait_for_flushing(disp_refr); + if(_lv_ll_is_empty(&disp_refr->sync_areas)) return; /*The buffers are already swapped. *So the active buffer is the off screen buffer where LVGL will render*/ - lv_draw_buf_t * off_screen = disp_refr->buf_act; - lv_draw_buf_t * on_screen = disp_refr->buf_act == disp_refr->buf_1 ? disp_refr->buf_2 : disp_refr->buf_1; + void * buf_off_screen = disp_refr->driver->draw_buf->buf_act; + void * buf_on_screen = disp_refr->driver->draw_buf->buf_act == disp_refr->driver->draw_buf->buf1 + ? disp_refr->driver->draw_buf->buf2 + : disp_refr->driver->draw_buf->buf1; - uint32_t hor_res = lv_display_get_horizontal_resolution(disp_refr); - uint32_t ver_res = lv_display_get_vertical_resolution(disp_refr); + /*Get stride for buffer copy*/ + lv_coord_t stride = lv_disp_get_hor_res(disp_refr); /*Iterate through invalidated areas to see if sync area should be copied*/ - uint16_t i; - int8_t j; lv_area_t res[4] = {0}; - int8_t res_c; - lv_area_t * sync_area, * new_area, * next_area; + int8_t res_c, j; + uint32_t i; + lv_area_t * sync_area, *new_area, *next_area; for(i = 0; i < disp_refr->inv_p; i++) { /*Skip joined areas*/ if(disp_refr->inv_area_joined[i]) continue; /*Iterate over sync areas*/ - sync_area = lv_ll_get_head(&disp_refr->sync_areas); + sync_area = _lv_ll_get_head(&disp_refr->sync_areas); while(sync_area != NULL) { /*Get next sync area*/ - next_area = lv_ll_get_next(&disp_refr->sync_areas, sync_area); + next_area = _lv_ll_get_next(&disp_refr->sync_areas, sync_area); /*Remove intersect of redraw area from sync area and get remaining areas*/ - res_c = lv_area_diff(res, sync_area, &disp_refr->inv_areas[i]); + res_c = _lv_area_diff(res, sync_area, &disp_refr->inv_areas[i]); /*New sub areas created after removing intersect*/ if(res_c != -1) { /*Replace old sync area with new areas*/ for(j = 0; j < res_c; j++) { - new_area = lv_ll_ins_prev(&disp_refr->sync_areas, sync_area); + new_area = _lv_ll_ins_prev(&disp_refr->sync_areas, sync_area); *new_area = res[j]; } - lv_ll_remove(&disp_refr->sync_areas, sync_area); - lv_free(sync_area); + _lv_ll_remove(&disp_refr->sync_areas, sync_area); + lv_mem_free(sync_area); } /*Move on to next sync area*/ @@ -536,20 +567,18 @@ static void refr_sync_areas(void) } } - lv_area_t disp_area = {0, 0, (int32_t)hor_res - 1, (int32_t)ver_res - 1}; /*Copy sync areas (if any remaining)*/ - for(sync_area = lv_ll_get_head(&disp_refr->sync_areas); sync_area != NULL; - sync_area = lv_ll_get_next(&disp_refr->sync_areas, sync_area)) { - /** - * @todo Resize SDL window will trigger crash because of sync_area is larger than disp_area - */ - lv_area_intersect(sync_area, sync_area, &disp_area); - lv_draw_buf_copy(off_screen, sync_area, on_screen, sync_area); + for(sync_area = _lv_ll_get_head(&disp_refr->sync_areas); sync_area != NULL; + sync_area = _lv_ll_get_next(&disp_refr->sync_areas, sync_area)) { + disp_refr->driver->draw_ctx->buffer_copy( + disp_refr->driver->draw_ctx, + buf_off_screen, stride, sync_area, + buf_on_screen, stride, sync_area + ); } /*Clear sync areas*/ - lv_ll_clear(&disp_refr->sync_areas); - LV_PROFILER_END; + _lv_ll_clear(&disp_refr->sync_areas); } /** @@ -557,8 +586,9 @@ static void refr_sync_areas(void) */ static void refr_invalid_areas(void) { + px_num = 0; + if(disp_refr->inv_p == 0) return; - LV_PROFILER_BEGIN; /*Find the last area which will be drawn*/ int32_t i; @@ -571,40 +601,27 @@ static void refr_invalid_areas(void) } /*Notify the display driven rendering has started*/ - lv_display_send_event(disp_refr, LV_EVENT_RENDER_START, NULL); + if(disp_refr->driver->render_start_cb) { + disp_refr->driver->render_start_cb(disp_refr->driver); + } - disp_refr->last_area = 0; - disp_refr->last_part = 0; + disp_refr->driver->draw_buf->last_area = 0; + disp_refr->driver->draw_buf->last_part = 0; disp_refr->rendering_in_progress = true; - for(i = 0; i < (int32_t)disp_refr->inv_p; i++) { + for(i = 0; i < disp_refr->inv_p; i++) { /*Refresh the unjoined areas*/ if(disp_refr->inv_area_joined[i] == 0) { - if(i == last_i) disp_refr->last_area = 1; - disp_refr->last_part = 0; + if(i == last_i) disp_refr->driver->draw_buf->last_area = 1; + disp_refr->driver->draw_buf->last_part = 0; refr_area(&disp_refr->inv_areas[i]); + + px_num += lv_area_get_size(&disp_refr->inv_areas[i]); } } disp_refr->rendering_in_progress = false; - LV_PROFILER_END; -} - -/** - * Reshape the draw buffer if required - * @param layer pointer to a layer which will be drawn - */ -static void layer_reshape_draw_buf(lv_layer_t * layer, uint32_t stride) -{ - lv_draw_buf_t * ret = lv_draw_buf_reshape( - layer->draw_buf, - layer->color_format, - lv_area_get_width(&layer->buf_area), - lv_area_get_height(&layer->buf_area), - stride); - LV_UNUSED(ret); - LV_ASSERT_NULL(ret); } /** @@ -613,54 +630,40 @@ static void layer_reshape_draw_buf(lv_layer_t * layer, uint32_t stride) */ static void refr_area(const lv_area_t * area_p) { - LV_PROFILER_BEGIN; - lv_layer_t * layer = disp_refr->layer_head; - layer->draw_buf = disp_refr->buf_act; - -#if LV_DRAW_TRANSFORM_USE_MATRIX - lv_matrix_identity(&layer->matrix); -#endif + lv_draw_ctx_t * draw_ctx = disp_refr->driver->draw_ctx; + draw_ctx->buf = disp_refr->driver->draw_buf->buf_act; /*With full refresh just redraw directly into the buffer*/ /*In direct mode draw directly on the absolute coordinates of the buffer*/ - if(disp_refr->render_mode != LV_DISPLAY_RENDER_MODE_PARTIAL) { - layer->buf_area.x1 = 0; - layer->buf_area.y1 = 0; - layer->buf_area.x2 = lv_display_get_horizontal_resolution(disp_refr) - 1; - layer->buf_area.y2 = lv_display_get_vertical_resolution(disp_refr) - 1; + if(disp_refr->driver->full_refresh || disp_refr->driver->direct_mode) { lv_area_t disp_area; - lv_area_set(&disp_area, 0, 0, lv_display_get_horizontal_resolution(disp_refr) - 1, - lv_display_get_vertical_resolution(disp_refr) - 1); - - if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_FULL) { - disp_refr->last_part = 1; - layer_reshape_draw_buf(layer, layer->draw_buf->header.stride); - layer->_clip_area = disp_area; - layer->phy_clip_area = disp_area; - refr_area_part(layer); + lv_area_set(&disp_area, 0, 0, lv_disp_get_hor_res(disp_refr) - 1, lv_disp_get_ver_res(disp_refr) - 1); + draw_ctx->buf_area = &disp_area; + + if(disp_refr->driver->full_refresh) { + disp_refr->driver->draw_buf->last_part = 1; + draw_ctx->clip_area = &disp_area; + refr_area_part(draw_ctx); } - else if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_DIRECT) { - disp_refr->last_part = disp_refr->last_area; - layer_reshape_draw_buf(layer, layer->draw_buf->header.stride); - layer->_clip_area = *area_p; - layer->phy_clip_area = *area_p; - refr_area_part(layer); + else { + disp_refr->driver->draw_buf->last_part = disp_refr->driver->draw_buf->last_area; + draw_ctx->clip_area = area_p; + refr_area_part(draw_ctx); } - LV_PROFILER_END; return; } /*Normal refresh: draw the area in parts*/ /*Calculate the max row num*/ - int32_t w = lv_area_get_width(area_p); - int32_t h = lv_area_get_height(area_p); - int32_t y2 = area_p->y2 >= lv_display_get_vertical_resolution(disp_refr) ? - lv_display_get_vertical_resolution(disp_refr) - 1 : area_p->y2; + lv_coord_t w = lv_area_get_width(area_p); + lv_coord_t h = lv_area_get_height(area_p); + lv_coord_t y2 = area_p->y2 >= lv_disp_get_ver_res(disp_refr) ? + lv_disp_get_ver_res(disp_refr) - 1 : area_p->y2; int32_t max_row = get_max_row(disp_refr, w, h); - int32_t row; - int32_t row_last = 0; + lv_coord_t row; + lv_coord_t row_last = 0; lv_area_t sub_area; for(row = area_p->y1; row + max_row - 1 <= y2; row += max_row) { /*Calc. the next y coordinates of draw_buf*/ @@ -668,15 +671,13 @@ static void refr_area(const lv_area_t * area_p) sub_area.x2 = area_p->x2; sub_area.y1 = row; sub_area.y2 = row + max_row - 1; - layer->draw_buf = disp_refr->buf_act; - layer->buf_area = sub_area; - layer->_clip_area = sub_area; - layer->phy_clip_area = sub_area; - layer_reshape_draw_buf(layer, LV_STRIDE_AUTO); + draw_ctx->buf_area = &sub_area; + draw_ctx->clip_area = &sub_area; + draw_ctx->buf = disp_refr->driver->draw_buf->buf_act; if(sub_area.y2 > y2) sub_area.y2 = y2; row_last = sub_area.y2; - if(y2 == row_last) disp_refr->last_part = 1; - refr_area_part(layer); + if(y2 == row_last) disp_refr->driver->draw_buf->last_part = 1; + refr_area_part(draw_ctx); } /*If the last y coordinates are not handled yet ...*/ @@ -686,79 +687,115 @@ static void refr_area(const lv_area_t * area_p) sub_area.x2 = area_p->x2; sub_area.y1 = row; sub_area.y2 = y2; - layer->draw_buf = disp_refr->buf_act; - layer->buf_area = sub_area; - layer->_clip_area = sub_area; - layer->phy_clip_area = sub_area; - layer_reshape_draw_buf(layer, LV_STRIDE_AUTO); - disp_refr->last_part = 1; - refr_area_part(layer); + draw_ctx->buf_area = &sub_area; + draw_ctx->clip_area = &sub_area; + draw_ctx->buf = disp_refr->driver->draw_buf->buf_act; + disp_refr->driver->draw_buf->last_part = 1; + refr_area_part(draw_ctx); } - LV_PROFILER_END; } -static void refr_area_part(lv_layer_t * layer) +static void refr_area_part(lv_draw_ctx_t * draw_ctx) { - LV_PROFILER_BEGIN; - disp_refr->refreshed_area = layer->_clip_area; - - /* In single buffered mode wait here until the buffer is freed. - * Else we would draw into the buffer while it's still being transferred to the display*/ - if(!lv_display_is_double_buffered(disp_refr)) { - wait_for_flushing(disp_refr); - } - /*If the screen is transparent initialize it when the flushing is ready*/ - if(lv_color_format_has_alpha(disp_refr->color_format)) { - lv_area_t a = disp_refr->refreshed_area; - if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_PARTIAL) { - /*The area always starts at 0;0*/ - lv_area_move(&a, -disp_refr->refreshed_area.x1, -disp_refr->refreshed_area.y1); + lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp_refr); + + if(draw_ctx->init_buf) + draw_ctx->init_buf(draw_ctx); + + /* Below the `area_p` area will be redrawn into the draw buffer. + * In single buffered mode wait here until the buffer is freed. + * In full double buffered mode wait here while the buffers are swapped and a buffer becomes available*/ + bool full_sized = draw_buf->size == (uint32_t)disp_refr->driver->hor_res * disp_refr->driver->ver_res; + if((draw_buf->buf1 && !draw_buf->buf2) || + (draw_buf->buf1 && draw_buf->buf2 && full_sized)) { + while(draw_buf->flushing) { + if(disp_refr->driver->wait_cb) disp_refr->driver->wait_cb(disp_refr->driver); } - lv_draw_buf_clear(layer->draw_buf, &a); + /*If the screen is transparent initialize it when the flushing is ready*/ +#if LV_COLOR_SCREEN_TRANSP + if(disp_refr->driver->screen_transp) { + if(disp_refr->driver->clear_cb) { + disp_refr->driver->clear_cb(disp_refr->driver, disp_refr->driver->draw_buf->buf_act, disp_refr->driver->draw_buf->size); + } + else { + lv_memset_00(disp_refr->driver->draw_buf->buf_act, disp_refr->driver->draw_buf->size * LV_IMG_PX_SIZE_ALPHA_BYTE); + } + } +#endif } lv_obj_t * top_act_scr = NULL; lv_obj_t * top_prev_scr = NULL; /*Get the most top object which is not covered by others*/ - top_act_scr = lv_refr_get_top_obj(&layer->_clip_area, lv_display_get_screen_active(disp_refr)); + top_act_scr = lv_refr_get_top_obj(draw_ctx->buf_area, lv_disp_get_scr_act(disp_refr)); if(disp_refr->prev_scr) { - top_prev_scr = lv_refr_get_top_obj(&layer->_clip_area, disp_refr->prev_scr); + top_prev_scr = lv_refr_get_top_obj(draw_ctx->buf_area, disp_refr->prev_scr); } - /*Draw a bottom layer background if there is no top object*/ + /*Draw a display background if there is no top object*/ if(top_act_scr == NULL && top_prev_scr == NULL) { - refr_obj_and_children(layer, lv_display_get_layer_bottom(disp_refr)); + lv_area_t a; + lv_area_set(&a, 0, 0, + lv_disp_get_hor_res(disp_refr) - 1, lv_disp_get_ver_res(disp_refr) - 1); + if(draw_ctx->draw_bg) { + lv_draw_rect_dsc_t dsc; + lv_draw_rect_dsc_init(&dsc); + dsc.bg_img_src = disp_refr->bg_img; + dsc.bg_img_opa = disp_refr->bg_opa; + dsc.bg_color = disp_refr->bg_color; + dsc.bg_opa = disp_refr->bg_opa; + draw_ctx->draw_bg(draw_ctx, &dsc, &a); + } + else if(disp_refr->bg_img) { + lv_img_header_t header; + lv_res_t res = lv_img_decoder_get_info(disp_refr->bg_img, &header); + if(res == LV_RES_OK) { + lv_draw_img_dsc_t dsc; + lv_draw_img_dsc_init(&dsc); + dsc.opa = disp_refr->bg_opa; + lv_draw_img(draw_ctx, &dsc, &a, disp_refr->bg_img); + } + else { + LV_LOG_WARN("Can't draw the background image"); + } + } + else { + lv_draw_rect_dsc_t dsc; + lv_draw_rect_dsc_init(&dsc); + dsc.bg_color = disp_refr->bg_color; + dsc.bg_opa = disp_refr->bg_opa; + lv_draw_rect(draw_ctx, &dsc, draw_ctx->buf_area); + } } if(disp_refr->draw_prev_over_act) { if(top_act_scr == NULL) top_act_scr = disp_refr->act_scr; - refr_obj_and_children(layer, top_act_scr); + refr_obj_and_children(draw_ctx, top_act_scr); /*Refresh the previous screen if any*/ if(disp_refr->prev_scr) { if(top_prev_scr == NULL) top_prev_scr = disp_refr->prev_scr; - refr_obj_and_children(layer, top_prev_scr); + refr_obj_and_children(draw_ctx, top_prev_scr); } } else { /*Refresh the previous screen if any*/ if(disp_refr->prev_scr) { if(top_prev_scr == NULL) top_prev_scr = disp_refr->prev_scr; - refr_obj_and_children(layer, top_prev_scr); + refr_obj_and_children(draw_ctx, top_prev_scr); } if(top_act_scr == NULL) top_act_scr = disp_refr->act_scr; - refr_obj_and_children(layer, top_act_scr); + refr_obj_and_children(draw_ctx, top_act_scr); } /*Also refresh top and sys layer unconditionally*/ - refr_obj_and_children(layer, lv_display_get_layer_top(disp_refr)); - refr_obj_and_children(layer, lv_display_get_layer_sys(disp_refr)); + refr_obj_and_children(draw_ctx, lv_disp_get_layer_top(disp_refr)); + refr_obj_and_children(draw_ctx, lv_disp_get_layer_sys(disp_refr)); draw_buf_flush(disp_refr); - LV_PROFILER_END; } /** @@ -771,19 +808,19 @@ static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj) { lv_obj_t * found_p = NULL; - if(lv_area_is_in(area_p, &obj->coords, 0) == false) return NULL; + if(_lv_area_is_in(area_p, &obj->coords, 0) == false) return NULL; if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return NULL; - if(lv_obj_get_layer_type(obj) != LV_LAYER_TYPE_NONE) return NULL; + if(_lv_obj_get_layer_type(obj) != LV_LAYER_TYPE_NONE) return NULL; /*If this object is fully cover the draw area then check the children too*/ lv_cover_check_info_t info; info.res = LV_COVER_RES_COVER; info.area = area_p; - lv_obj_send_event(obj, LV_EVENT_COVER_CHECK, &info); + lv_event_send(obj, LV_EVENT_COVER_CHECK, &info); if(info.res == LV_COVER_RES_MASKED) return NULL; int32_t i; - int32_t child_cnt = lv_obj_get_child_count(obj); + int32_t child_cnt = lv_obj_get_child_cnt(obj); for(i = child_cnt - 1; i >= 0; i--) { lv_obj_t * child = obj->spec_attr->children[i]; found_p = lv_refr_get_top_obj(area_p, child); @@ -807,17 +844,16 @@ static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj) * @param top_p pointer to an objects. Start the drawing from it. * @param mask_p pointer to an area, the objects will be drawn only here */ -static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj) +static void refr_obj_and_children(lv_draw_ctx_t * draw_ctx, lv_obj_t * top_obj) { /*Normally always will be a top_obj (at least the screen) *but in special cases (e.g. if the screen has alpha) it won't. *In this case use the screen directly*/ - if(top_obj == NULL) top_obj = lv_display_get_screen_active(disp_refr); + if(top_obj == NULL) top_obj = lv_disp_get_scr_act(disp_refr); if(top_obj == NULL) return; /*Shouldn't happen*/ - LV_PROFILER_BEGIN; /*Refresh the top object and its children*/ - refr_obj(layer, top_obj); + refr_obj(draw_ctx, top_obj); /*Draw the 'younger' sibling objects because they can be on top_obj*/ lv_obj_t * parent; @@ -829,7 +865,7 @@ static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj) while(parent != NULL) { bool go = false; uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(parent); + uint32_t child_cnt = lv_obj_get_child_cnt(parent); for(i = 0; i < child_cnt; i++) { lv_obj_t * child = parent->spec_attr->children[i]; if(!go) { @@ -837,14 +873,14 @@ static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj) } else { /*Refresh the objects*/ - refr_obj(layer, child); + refr_obj(draw_ctx, child); } } - /*Call the post draw function of the parents of the to object*/ - lv_obj_send_event(parent, LV_EVENT_DRAW_POST_BEGIN, (void *)layer); - lv_obj_send_event(parent, LV_EVENT_DRAW_POST, (void *)layer); - lv_obj_send_event(parent, LV_EVENT_DRAW_POST_END, (void *)layer); + /*Call the post draw draw function of the parents of the to object*/ + lv_event_send(parent, LV_EVENT_DRAW_POST_BEGIN, (void *)draw_ctx); + lv_event_send(parent, LV_EVENT_DRAW_POST, (void *)draw_ctx); + lv_event_send(parent, LV_EVENT_DRAW_POST_END, (void *)draw_ctx); /*The new border will be the last parents, *so the 'younger' brothers of parent will be refreshed*/ @@ -852,388 +888,464 @@ static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj) /*Go a level deeper*/ parent = lv_obj_get_parent(parent); } - LV_PROFILER_END; } -static lv_result_t layer_get_area(lv_layer_t * layer, lv_obj_t * obj, lv_layer_type_t layer_type, - lv_area_t * layer_area_out, lv_area_t * obj_draw_size_out) + +static lv_res_t layer_get_area(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj, lv_layer_type_t layer_type, + lv_area_t * layer_area_out) { - int32_t ext_draw_size = lv_obj_get_ext_draw_size(obj); - lv_obj_get_coords(obj, obj_draw_size_out); - lv_area_increase(obj_draw_size_out, ext_draw_size, ext_draw_size); + lv_coord_t ext_draw_size = _lv_obj_get_ext_draw_size(obj); + lv_area_t obj_coords_ext; + lv_obj_get_coords(obj, &obj_coords_ext); + lv_area_increase(&obj_coords_ext, ext_draw_size, ext_draw_size); if(layer_type == LV_LAYER_TYPE_TRANSFORM) { /*Get the transformed area and clip it to the current clip area. *This area needs to be updated on the screen.*/ lv_area_t clip_coords_for_obj; - lv_area_t tranf_coords = *obj_draw_size_out; - lv_obj_get_transformed_area(obj, &tranf_coords, LV_OBJ_POINT_TRANSFORM_FLAG_NONE); - if(!lv_area_intersect(&clip_coords_for_obj, &layer->_clip_area, &tranf_coords)) { - return LV_RESULT_INVALID; + lv_area_t tranf_coords = obj_coords_ext; + lv_obj_get_transformed_area(obj, &tranf_coords, false, false); + if(!_lv_area_intersect(&clip_coords_for_obj, draw_ctx->clip_area, &tranf_coords)) { + return LV_RES_INV; } /*Transform back (inverse) the transformed area. *It will tell which area of the non-transformed widget needs to be redrawn *in order to cover transformed area after transformation.*/ lv_area_t inverse_clip_coords_for_obj = clip_coords_for_obj; - lv_obj_get_transformed_area(obj, &inverse_clip_coords_for_obj, LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE); - if(!lv_area_intersect(&inverse_clip_coords_for_obj, &inverse_clip_coords_for_obj, obj_draw_size_out)) { - return LV_RESULT_INVALID; + lv_obj_get_transformed_area(obj, &inverse_clip_coords_for_obj, false, true); + if(!_lv_area_intersect(&inverse_clip_coords_for_obj, &inverse_clip_coords_for_obj, &obj_coords_ext)) { + return LV_RES_INV; } *layer_area_out = inverse_clip_coords_for_obj; - lv_area_increase(layer_area_out, 5, 5); /*To avoid rounding error*/ } else if(layer_type == LV_LAYER_TYPE_SIMPLE) { lv_area_t clip_coords_for_obj; - if(!lv_area_intersect(&clip_coords_for_obj, &layer->_clip_area, obj_draw_size_out)) { - return LV_RESULT_INVALID; + if(!_lv_area_intersect(&clip_coords_for_obj, draw_ctx->clip_area, &obj_coords_ext)) { + return LV_RES_INV; } *layer_area_out = clip_coords_for_obj; } else { - LV_LOG_WARN("Unhandled layer type"); - return LV_RESULT_INVALID; + LV_LOG_WARN("Unhandled intermediate layer type"); + return LV_RES_INV; } - return LV_RESULT_OK; + return LV_RES_OK; } -static bool alpha_test_area_on_obj(lv_obj_t * obj, const lv_area_t * area) +static void layer_alpha_test(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx, + lv_draw_layer_flags_t flags) { - /*Test for alpha by assuming there is no alpha. If it fails, fall back to rendering with alpha*/ - /*If the layer area is not fully on the object, it can't fully cover it*/ - if(!lv_area_is_on(area, &obj->coords)) return true; + bool has_alpha; + /*If globally the layer has alpha maybe this smaller section has not (e.g. not on a rounded corner) + *If turns out that this section has no alpha renderer can choose faster algorithms*/ + if(flags & LV_DRAW_LAYER_FLAG_HAS_ALPHA) { + /*Test for alpha by assuming there is no alpha. If it fails, fall back to rendering with alpha*/ + has_alpha = true; + if(_lv_area_is_in(&layer_ctx->area_act, &obj->coords, 0)) { + lv_cover_check_info_t info; + info.res = LV_COVER_RES_COVER; + info.area = &layer_ctx->area_act; + lv_event_send(obj, LV_EVENT_COVER_CHECK, &info); + if(info.res == LV_COVER_RES_COVER) has_alpha = false; + } - lv_cover_check_info_t info; - info.res = LV_COVER_RES_COVER; - info.area = area; - lv_obj_send_event(obj, LV_EVENT_COVER_CHECK, &info); - if(info.res == LV_COVER_RES_COVER) return false; - else return true; + if(has_alpha) { + layer_ctx->area_act.y2 = layer_ctx->area_act.y1 + layer_ctx->max_row_with_alpha - 1; + } + } + else { + has_alpha = false; + } + + if(layer_ctx->area_act.y2 > layer_ctx->area_full.y2) layer_ctx->area_act.y2 = layer_ctx->area_full.y2; + lv_draw_layer_adjust(draw_ctx, layer_ctx, has_alpha ? LV_DRAW_LAYER_FLAG_HAS_ALPHA : LV_DRAW_LAYER_FLAG_NONE); } -#if LV_DRAW_TRANSFORM_USE_MATRIX -static void refr_obj_matrix(lv_layer_t * layer, lv_obj_t * obj) +void refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj) { - lv_matrix_t ori_matrix = layer->matrix; - lv_matrix_t obj_matrix; - lv_matrix_identity(&obj_matrix); + /*Do not refresh hidden objects*/ + if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return; + lv_layer_type_t layer_type = _lv_obj_get_layer_type(obj); + if(layer_type == LV_LAYER_TYPE_NONE) { + lv_obj_redraw(draw_ctx, obj); + } + else { + lv_opa_t opa = lv_obj_get_style_opa_layered(obj, 0); + if(opa < LV_OPA_MIN) return; - lv_point_t pivot = { - .x = lv_obj_get_style_transform_pivot_x(obj, 0), - .y = lv_obj_get_style_transform_pivot_y(obj, 0) - }; + lv_area_t layer_area_full; + lv_res_t res = layer_get_area(draw_ctx, obj, layer_type, &layer_area_full); + if(res != LV_RES_OK) return; - pivot.x = obj->coords.x1 + lv_pct_to_px(pivot.x, lv_area_get_width(&obj->coords)); - pivot.y = obj->coords.y1 + lv_pct_to_px(pivot.y, lv_area_get_height(&obj->coords)); + lv_draw_layer_flags_t flags = LV_DRAW_LAYER_FLAG_HAS_ALPHA; - int32_t rotation = lv_obj_get_style_transform_rotation(obj, 0); - int32_t scale_x = lv_obj_get_style_transform_scale_x(obj, 0); - int32_t scale_y = lv_obj_get_style_transform_scale_y(obj, 0); - int32_t skew_x = lv_obj_get_style_transform_skew_x(obj, 0); - int32_t skew_y = lv_obj_get_style_transform_skew_y(obj, 0); + if(_lv_area_is_in(&layer_area_full, &obj->coords, 0)) { + lv_cover_check_info_t info; + info.res = LV_COVER_RES_COVER; + info.area = &layer_area_full; + lv_event_send(obj, LV_EVENT_COVER_CHECK, &info); + if(info.res == LV_COVER_RES_COVER) flags &= ~LV_DRAW_LAYER_FLAG_HAS_ALPHA; + } - if(scale_x <= 0 || scale_y <= 0) { - /* NOT draw if scale is negative or zero */ - return; - } + if(layer_type == LV_LAYER_TYPE_SIMPLE) flags |= LV_DRAW_LAYER_FLAG_CAN_SUBDIVIDE; - /* generate the obj matrix */ - lv_matrix_translate(&obj_matrix, pivot.x, pivot.y); - if(rotation != 0) { - lv_matrix_rotate(&obj_matrix, rotation * 0.1f); - } + lv_draw_layer_ctx_t * layer_ctx = lv_draw_layer_create(draw_ctx, &layer_area_full, flags); + if(layer_ctx == NULL) { + LV_LOG_WARN("Couldn't create a new layer context"); + return; + } + lv_point_t pivot = { + .x = lv_obj_get_style_transform_pivot_x(obj, 0), + .y = lv_obj_get_style_transform_pivot_y(obj, 0) + }; - if(scale_x != LV_SCALE_NONE || scale_y != LV_SCALE_NONE) { - lv_matrix_scale( - &obj_matrix, - (float)scale_x / LV_SCALE_NONE, - (float)scale_y / LV_SCALE_NONE - ); - } + if(LV_COORD_IS_PCT(pivot.x)) { + pivot.x = (LV_COORD_GET_PCT(pivot.x) * lv_area_get_width(&obj->coords)) / 100; + } + if(LV_COORD_IS_PCT(pivot.y)) { + pivot.y = (LV_COORD_GET_PCT(pivot.y) * lv_area_get_height(&obj->coords)) / 100; + } - if(skew_x != 0 || skew_y != 0) { - lv_matrix_skew(&obj_matrix, skew_x, skew_y); - } + lv_draw_img_dsc_t draw_dsc; + lv_draw_img_dsc_init(&draw_dsc); + draw_dsc.opa = opa; + draw_dsc.angle = lv_obj_get_style_transform_angle(obj, 0); + if(draw_dsc.angle > 3600) draw_dsc.angle -= 3600; + else if(draw_dsc.angle < 0) draw_dsc.angle += 3600; + + draw_dsc.zoom = lv_obj_get_style_transform_zoom(obj, 0); + draw_dsc.blend_mode = lv_obj_get_style_blend_mode(obj, 0); + draw_dsc.antialias = disp_refr->driver->antialiasing; + + if(flags & LV_DRAW_LAYER_FLAG_CAN_SUBDIVIDE) { + layer_ctx->area_act = layer_ctx->area_full; + layer_ctx->area_act.y2 = layer_ctx->area_act.y1 + layer_ctx->max_row_with_no_alpha - 1; + if(layer_ctx->area_act.y2 > layer_ctx->area_full.y2) layer_ctx->area_act.y2 = layer_ctx->area_full.y2; + } + + while(layer_ctx->area_act.y1 <= layer_area_full.y2) { + if(flags & LV_DRAW_LAYER_FLAG_CAN_SUBDIVIDE) { + layer_alpha_test(obj, draw_ctx, layer_ctx, flags); + } + + lv_obj_redraw(draw_ctx, obj); - lv_matrix_translate(&obj_matrix, -pivot.x, -pivot.y); + draw_dsc.pivot.x = obj->coords.x1 + pivot.x - draw_ctx->buf_area->x1; + draw_dsc.pivot.y = obj->coords.y1 + pivot.y - draw_ctx->buf_area->y1; - /* apply the obj matrix */ - lv_matrix_multiply(&layer->matrix, &obj_matrix); + /*With LV_DRAW_LAYER_FLAG_CAN_SUBDIVIDE it should also go the next chunk*/ + lv_draw_layer_blend(draw_ctx, layer_ctx, &draw_dsc); - /* calculate clip area without transform */ - lv_matrix_t matrix_reverse; - lv_matrix_inverse(&matrix_reverse, &obj_matrix); + if((flags & LV_DRAW_LAYER_FLAG_CAN_SUBDIVIDE) == 0) break; - lv_area_t clip_area = layer->_clip_area; - lv_area_t clip_area_ori = layer->_clip_area; - clip_area = lv_matrix_transform_area(&matrix_reverse, &clip_area); + layer_ctx->area_act.y1 = layer_ctx->area_act.y2 + 1; + layer_ctx->area_act.y2 = layer_ctx->area_act.y1 + layer_ctx->max_row_with_no_alpha - 1; + } - /* increase the clip area by 1 pixel to avoid rounding errors */ - if(!lv_matrix_is_identity_or_translation(&obj_matrix)) { - lv_area_increase(&clip_area, 1, 1); + lv_draw_layer_destroy(draw_ctx, layer_ctx); } +} + + +static uint32_t get_max_row(lv_disp_t * disp, lv_coord_t area_w, lv_coord_t area_h) +{ + int32_t max_row = (uint32_t)disp->driver->draw_buf->size / area_w; - layer->_clip_area = clip_area; + if(max_row > area_h) max_row = area_h; - /* redraw obj */ - lv_obj_redraw(layer, obj); + /*Round down the lines of draw_buf if rounding is added*/ + if(disp_refr->driver->rounder_cb) { + lv_area_t tmp; + tmp.x1 = 0; + tmp.x2 = 0; + tmp.y1 = 0; + + lv_coord_t h_tmp = max_row; + do { + tmp.y2 = h_tmp - 1; + disp_refr->driver->rounder_cb(disp_refr->driver, &tmp); + + /*If this height fits into `max_row` then fine*/ + if(lv_area_get_height(&tmp) <= max_row) break; + + /*Decrement the height of the area until it fits into `max_row` after rounding*/ + h_tmp--; + } while(h_tmp > 0); + + if(h_tmp <= 0) { + LV_LOG_WARN("Can't set draw_buf height using the round function. (Wrong round_cb or to " + "small draw_buf)"); + return 0; + } + else { + max_row = tmp.y2 + 1; + } + } - /* restore original matrix */ - layer->matrix = ori_matrix; - /* restore clip area */ - layer->_clip_area = clip_area_ori; + return max_row; } -static bool refr_check_obj_clip_overflow(lv_layer_t * layer, lv_obj_t * obj) +static void draw_buf_rotate_180(lv_disp_drv_t * drv, lv_area_t * area, lv_color_t * color_p) { - if(lv_obj_get_style_transform_rotation(obj, 0) == 0) { - return false; + lv_coord_t area_w = lv_area_get_width(area); + lv_coord_t area_h = lv_area_get_height(area); + uint32_t total = area_w * area_h; + /*Swap the beginning and end values*/ + lv_color_t tmp; + uint32_t i = total - 1, j = 0; + while(i > j) { + tmp = color_p[i]; + color_p[i] = color_p[j]; + color_p[j] = tmp; + i--; + j++; } + lv_coord_t tmp_coord; + tmp_coord = area->y2; + area->y2 = drv->ver_res - area->y1 - 1; + area->y1 = drv->ver_res - tmp_coord - 1; + tmp_coord = area->x2; + area->x2 = drv->hor_res - area->x1 - 1; + area->x1 = drv->hor_res - tmp_coord - 1; +} - /*Truncate the area to the object*/ - lv_area_t obj_coords; - int32_t ext_size = lv_obj_get_ext_draw_size(obj); - lv_area_copy(&obj_coords, &obj->coords); - lv_area_increase(&obj_coords, ext_size, ext_size); - - lv_obj_get_transformed_area(obj, &obj_coords, LV_OBJ_POINT_TRANSFORM_FLAG_RECURSIVE); +static void LV_ATTRIBUTE_FAST_MEM draw_buf_rotate_90(bool invert_i, lv_coord_t area_w, lv_coord_t area_h, + lv_color_t * orig_color_p, lv_color_t * rot_buf) +{ - lv_area_t clip_coords_for_obj; - if(!lv_area_intersect(&clip_coords_for_obj, &layer->_clip_area, &obj_coords)) { - return false; + uint32_t invert = (area_w * area_h) - 1; + uint32_t initial_i = ((area_w - 1) * area_h); + for(lv_coord_t y = 0; y < area_h; y++) { + uint32_t i = initial_i + y; + if(invert_i) + i = invert - i; + for(lv_coord_t x = 0; x < area_w; x++) { + rot_buf[i] = *(orig_color_p++); + if(invert_i) + i += area_h; + else + i -= area_h; + } } - - bool has_clip = lv_memcmp(&clip_coords_for_obj, &obj_coords, sizeof(lv_area_t)) != 0; - return has_clip; } -#endif /* LV_DRAW_TRANSFORM_USE_MATRIX */ +/** + * Helper function for draw_buf_rotate_90_sqr. Given a list of four numbers, rotate the entire list to the left. + */ +static inline void draw_buf_rotate4(lv_color_t * a, lv_color_t * b, lv_color_t * c, lv_color_t * d) +{ + lv_color_t tmp; + tmp = *a; + *a = *b; + *b = *c; + *c = *d; + *d = tmp; +} -static void refr_obj(lv_layer_t * layer, lv_obj_t * obj) +/** + * Rotate a square image 90/270 degrees in place. + * @note inspired by https://stackoverflow.com/a/43694906 + */ +static void draw_buf_rotate_90_sqr(bool is_270, lv_coord_t w, lv_color_t * color_p) { - if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return; + for(lv_coord_t i = 0; i < w / 2; i++) { + for(lv_coord_t j = 0; j < (w + 1) / 2; j++) { + lv_coord_t inv_i = (w - 1) - i; + lv_coord_t inv_j = (w - 1) - j; + if(is_270) { + draw_buf_rotate4( + &color_p[i * w + j], + &color_p[inv_j * w + i], + &color_p[inv_i * w + inv_j], + &color_p[j * w + inv_i] + ); + } + else { + draw_buf_rotate4( + &color_p[i * w + j], + &color_p[j * w + inv_i], + &color_p[inv_i * w + inv_j], + &color_p[inv_j * w + i] + ); + } - lv_opa_t opa = lv_obj_get_style_opa_layered(obj, 0); - if(opa < LV_OPA_MIN) return; + } + } +} -#if LV_DRAW_TRANSFORM_USE_MATRIX - /*If the layer opa is full then use the matrix transform*/ - if(opa >= LV_OPA_MAX && !refr_check_obj_clip_overflow(layer, obj)) { - refr_obj_matrix(layer, obj); +/** + * Rotate the draw_buf to the display's native orientation. + */ +static void draw_buf_rotate(lv_area_t * area, lv_color_t * color_p) +{ + lv_disp_drv_t * drv = disp_refr->driver; + if(disp_refr->driver->full_refresh && drv->sw_rotate) { + LV_LOG_ERROR("cannot rotate a full refreshed display!"); return; } -#endif /* LV_DRAW_TRANSFORM_USE_MATRIX */ - - lv_layer_type_t layer_type = lv_obj_get_layer_type(obj); - if(layer_type == LV_LAYER_TYPE_NONE) { - lv_obj_redraw(layer, obj); + if(drv->rotated == LV_DISP_ROT_180) { + draw_buf_rotate_180(drv, area, color_p); + call_flush_cb(drv, area, color_p); } - else { - lv_area_t layer_area_full; - lv_area_t obj_draw_size; - lv_result_t res = layer_get_area(layer, obj, layer_type, &layer_area_full, &obj_draw_size); - if(res != LV_RESULT_OK) return; - - /*Simple layers can be subdivided into smaller layers*/ - uint32_t max_rgb_row_height = lv_area_get_height(&layer_area_full); - uint32_t max_argb_row_height = lv_area_get_height(&layer_area_full); - if(layer_type == LV_LAYER_TYPE_SIMPLE) { - int32_t w = lv_area_get_width(&layer_area_full); - uint8_t px_size = lv_color_format_get_size(disp_refr->color_format); - max_rgb_row_height = LV_DRAW_LAYER_SIMPLE_BUF_SIZE / w / px_size; - max_argb_row_height = LV_DRAW_LAYER_SIMPLE_BUF_SIZE / w / sizeof(lv_color32_t); + else if(drv->rotated == LV_DISP_ROT_90 || drv->rotated == LV_DISP_ROT_270) { + /*Allocate a temporary buffer to store rotated image*/ + lv_color_t * rot_buf = NULL; + lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp_refr); + lv_coord_t area_w = lv_area_get_width(area); + lv_coord_t area_h = lv_area_get_height(area); + /*Determine the maximum number of rows that can be rotated at a time*/ + lv_coord_t max_row = LV_MIN((lv_coord_t)((LV_DISP_ROT_MAX_BUF / sizeof(lv_color_t)) / area_w), area_h); + lv_coord_t init_y_off; + init_y_off = area->y1; + if(drv->rotated == LV_DISP_ROT_90) { + area->y2 = drv->ver_res - area->x1 - 1; + area->y1 = area->y2 - area_w + 1; + } + else { + area->y1 = area->x1; + area->y2 = area->y1 + area_w - 1; } - lv_area_t layer_area_act; - layer_area_act.x1 = layer_area_full.x1; - layer_area_act.x2 = layer_area_full.x2; - layer_area_act.y1 = layer_area_full.y1; - layer_area_act.y2 = layer_area_full.y1; - - while(layer_area_act.y2 < layer_area_full.y2) { - /* Test with an RGB layer size (which is larger than the ARGB layer size) - * If it really doesn't need alpha use it. Else switch to the ARGB size*/ - layer_area_act.y2 = layer_area_act.y1 + max_rgb_row_height - 1; - if(layer_area_act.y2 > layer_area_full.y2) layer_area_act.y2 = layer_area_full.y2; - bool area_need_alpha = alpha_test_area_on_obj(obj, &layer_area_act); - if(area_need_alpha) { - layer_area_act.y2 = layer_area_act.y1 + max_argb_row_height - 1; - if(layer_area_act.y2 > layer_area_full.y2) layer_area_act.y2 = layer_area_full.y2; + /*Rotate the screen in chunks, flushing after each one*/ + lv_coord_t row = 0; + while(row < area_h) { + lv_coord_t height = LV_MIN(max_row, area_h - row); + draw_buf->flushing = 1; + if((row == 0) && (area_h >= area_w)) { + /*Rotate the initial area as a square*/ + height = area_w; + draw_buf_rotate_90_sqr(drv->rotated == LV_DISP_ROT_270, area_w, color_p); + if(drv->rotated == LV_DISP_ROT_90) { + area->x1 = init_y_off; + area->x2 = init_y_off + area_w - 1; + } + else { + area->x2 = drv->hor_res - 1 - init_y_off; + area->x1 = area->x2 - area_w + 1; + } } + else { + /*Rotate other areas using a maximum buffer size*/ + if(rot_buf == NULL) rot_buf = lv_mem_buf_get(LV_DISP_ROT_MAX_BUF); + draw_buf_rotate_90(drv->rotated == LV_DISP_ROT_270, area_w, height, color_p, rot_buf); - lv_layer_t * new_layer = lv_draw_layer_create(layer, - area_need_alpha ? LV_COLOR_FORMAT_ARGB8888 : LV_COLOR_FORMAT_NATIVE, &layer_area_act); - lv_obj_redraw(new_layer, obj); - - lv_point_t pivot = { - .x = lv_obj_get_style_transform_pivot_x(obj, 0), - .y = lv_obj_get_style_transform_pivot_y(obj, 0) - }; + if(drv->rotated == LV_DISP_ROT_90) { + area->x1 = init_y_off + row; + area->x2 = init_y_off + row + height - 1; + } + else { + area->x2 = drv->hor_res - 1 - init_y_off - row; + area->x1 = area->x2 - height + 1; + } + } - if(LV_COORD_IS_PCT(pivot.x)) { - pivot.x = (LV_COORD_GET_PCT(pivot.x) * lv_area_get_width(&obj->coords)) / 100; + /* The original part (chunk of the current area) were split into more parts here. + * Set the original last_part flag on the last part of rotation. */ + if(row + height >= area_h && draw_buf->last_area && draw_buf->last_part) { + draw_buf->flushing_last = 1; } - if(LV_COORD_IS_PCT(pivot.y)) { - pivot.y = (LV_COORD_GET_PCT(pivot.y) * lv_area_get_height(&obj->coords)) / 100; + else { + draw_buf->flushing_last = 0; } - lv_draw_image_dsc_t layer_draw_dsc; - lv_draw_image_dsc_init(&layer_draw_dsc); - layer_draw_dsc.pivot.x = obj->coords.x1 + pivot.x - new_layer->buf_area.x1; - layer_draw_dsc.pivot.y = obj->coords.y1 + pivot.y - new_layer->buf_area.y1; - - layer_draw_dsc.opa = opa; - layer_draw_dsc.rotation = lv_obj_get_style_transform_rotation(obj, 0); - while(layer_draw_dsc.rotation > 3600) layer_draw_dsc.rotation -= 3600; - while(layer_draw_dsc.rotation < 0) layer_draw_dsc.rotation += 3600; - layer_draw_dsc.scale_x = lv_obj_get_style_transform_scale_x(obj, 0); - layer_draw_dsc.scale_y = lv_obj_get_style_transform_scale_y(obj, 0); - layer_draw_dsc.skew_x = lv_obj_get_style_transform_skew_x(obj, 0); - layer_draw_dsc.skew_y = lv_obj_get_style_transform_skew_y(obj, 0); - layer_draw_dsc.blend_mode = lv_obj_get_style_blend_mode(obj, 0); - layer_draw_dsc.antialias = disp_refr->antialiasing; - layer_draw_dsc.bitmap_mask_src = lv_obj_get_style_bitmap_mask_src(obj, 0); - layer_draw_dsc.image_area = obj_draw_size; - layer_draw_dsc.src = new_layer; - - lv_draw_layer(layer, &layer_draw_dsc, &layer_area_act); - - layer_area_act.y1 = layer_area_act.y2 + 1; + /*Flush the completed area to the display*/ + call_flush_cb(drv, area, rot_buf == NULL ? color_p : rot_buf); + /*FIXME: Rotation forces legacy behavior where rendering and flushing are done serially*/ + while(draw_buf->flushing) { + if(drv->wait_cb) drv->wait_cb(drv); + } + color_p += area_w * height; + row += height; } + /*Free the allocated buffer at the end if necessary*/ + if(rot_buf != NULL) lv_mem_buf_release(rot_buf); } } -static uint32_t get_max_row(lv_display_t * disp, int32_t area_w, int32_t area_h) -{ - lv_color_format_t cf = disp->color_format; - uint32_t stride = lv_draw_buf_width_to_stride(area_w, cf); - uint32_t overhead = LV_COLOR_INDEXED_PALETTE_SIZE(cf) * sizeof(lv_color32_t); - - int32_t max_row = (uint32_t)(disp->buf_act->data_size - overhead) / stride; - - if(max_row > area_h) max_row = area_h; - - /*Round down the lines of draw_buf if rounding is added*/ - lv_area_t tmp; - tmp.x1 = 0; - tmp.x2 = 0; - tmp.y1 = 0; - - int32_t h_tmp = max_row; - do { - tmp.y2 = h_tmp - 1; - lv_display_send_event(disp_refr, LV_EVENT_INVALIDATE_AREA, &tmp); - - /*If this height fits into `max_row` then fine*/ - if(lv_area_get_height(&tmp) <= max_row) break; - - /*Decrement the height of the area until it fits into `max_row` after rounding*/ - h_tmp--; - } while(h_tmp > 0); - - if(h_tmp <= 0) { - LV_LOG_WARN("Can't set draw_buf height using the round function. (Wrong round_cb or too " - "small draw_buf)"); - return 0; - } - else { - max_row = tmp.y2 + 1; - } - - return max_row; -} - /** * Flush the content of the draw buffer */ -static void draw_buf_flush(lv_display_t * disp) +static void draw_buf_flush(lv_disp_t * disp) { - /*Flush the rendered content to the display*/ - lv_layer_t * layer = disp->layer_head; + lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp_refr); - while(layer->draw_task_head) { - lv_draw_dispatch_wait_for_request(); - lv_draw_dispatch(); - } - - /* In double buffered mode wait until the other buffer is freed - * and driver is ready to receive the new buffer. - * If we need to wait here it means that the content of one buffer is being sent to display - * and other buffer already contains the new rendered image. */ - if(lv_display_is_double_buffered(disp)) { - wait_for_flushing(disp_refr); + /*Flush the rendered content to the display*/ + lv_draw_ctx_t * draw_ctx = disp->driver->draw_ctx; + if(draw_ctx->wait_for_finish) draw_ctx->wait_for_finish(draw_ctx); + + /* In partial double buffered mode wait until the other buffer is freed + * and driver is ready to receive the new buffer */ + bool full_sized = draw_buf->size == (uint32_t)disp_refr->driver->hor_res * disp_refr->driver->ver_res; + if(draw_buf->buf1 && draw_buf->buf2 && !full_sized) { + while(draw_buf->flushing) { + if(disp_refr->driver->wait_cb) disp_refr->driver->wait_cb(disp_refr->driver); + } } - disp->flushing = 1; + draw_buf->flushing = 1; - if(disp->last_area && disp->last_part) disp->flushing_last = 1; - else disp->flushing_last = 0; + if(disp_refr->driver->draw_buf->last_area && disp_refr->driver->draw_buf->last_part) draw_buf->flushing_last = 1; + else draw_buf->flushing_last = 0; - bool flushing_last = disp->flushing_last; + bool flushing_last = draw_buf->flushing_last; - if(disp->flush_cb) { - call_flush_cb(disp, &disp->refreshed_area, layer->draw_buf->data); - } - /*If there are 2 buffers swap them. With direct mode swap only on the last area*/ - if(lv_display_is_double_buffered(disp) && (disp->render_mode != LV_DISPLAY_RENDER_MODE_DIRECT || flushing_last)) { - if(disp->buf_act == disp->buf_1) { - disp->buf_act = disp->buf_2; + if(disp->driver->flush_cb) { + /*Rotate the buffer to the display's native orientation if necessary*/ + if(disp->driver->rotated != LV_DISP_ROT_NONE && disp->driver->sw_rotate) { + draw_buf_rotate(draw_ctx->buf_area, draw_ctx->buf); } else { - disp->buf_act = disp->buf_1; + call_flush_cb(disp->driver, draw_ctx->buf_area, draw_ctx->buf); } } + + /*If there are 2 buffers swap them. With direct mode swap only on the last area*/ + if(draw_buf->buf1 && draw_buf->buf2 && (!disp->driver->direct_mode || flushing_last)) { + if(draw_buf->buf_act == draw_buf->buf1) + draw_buf->buf_act = draw_buf->buf2; + else + draw_buf->buf_act = draw_buf->buf1; + } } -static void call_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map) +static void call_flush_cb(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_p) { - LV_PROFILER_BEGIN; - LV_TRACE_REFR("Calling flush_cb on (%d;%d)(%d;%d) area with %p image pointer", - (int)area->x1, (int)area->y1, (int)area->x2, (int)area->y2, (void *)px_map); + REFR_TRACE("Calling flush_cb on (%d;%d)(%d;%d) area with %p image pointer", area->x1, area->y1, area->x2, area->y2, + (void *)color_p); lv_area_t offset_area = { - .x1 = area->x1 + disp->offset_x, - .y1 = area->y1 + disp->offset_y, - .x2 = area->x2 + disp->offset_x, - .y2 = area->y2 + disp->offset_y + .x1 = area->x1 + drv->offset_x, + .y1 = area->y1 + drv->offset_y, + .x2 = area->x2 + drv->offset_x, + .y2 = area->y2 + drv->offset_y }; - lv_display_send_event(disp, LV_EVENT_FLUSH_START, &offset_area); - - /*For backward compatibility support LV_COLOR_16_SWAP (from v8)*/ -#if defined(LV_COLOR_16_SWAP) && LV_COLOR_16_SWAP - lv_draw_sw_rgb565_swap(px_map, lv_area_get_size(&offset_area)); -#endif - - disp->flush_cb(disp, &offset_area, px_map); - lv_display_send_event(disp, LV_EVENT_FLUSH_FINISH, &offset_area); - - LV_PROFILER_END; + drv->flush_cb(drv, &offset_area, color_p); } -static void wait_for_flushing(lv_display_t * disp) +#if LV_USE_PERF_MONITOR +static void perf_monitor_init(perf_monitor_t * _perf_monitor) { - LV_PROFILER_BEGIN; - LV_LOG_TRACE("begin"); - - lv_display_send_event(disp, LV_EVENT_FLUSH_WAIT_START, NULL); - - if(disp->flush_wait_cb) { - if(disp->flushing) { - disp->flush_wait_cb(disp); - } - disp->flushing = 0; - } - else { - while(disp->flushing); - } - disp->flushing_last = 0; - - lv_display_send_event(disp, LV_EVENT_FLUSH_WAIT_FINISH, NULL); + LV_ASSERT_NULL(_perf_monitor); + _perf_monitor->elaps_sum = 0; + _perf_monitor->fps_sum_all = 0; + _perf_monitor->fps_sum_cnt = 0; + _perf_monitor->frame_cnt = 0; + _perf_monitor->perf_last_time = 0; + _perf_monitor->perf_label = NULL; +} +#endif - LV_LOG_TRACE("end"); - LV_PROFILER_END; +#if LV_USE_MEM_MONITOR +static void mem_monitor_init(mem_monitor_t * _mem_monitor) +{ + LV_ASSERT_NULL(_mem_monitor); + _mem_monitor->mem_last_time = 0; + _mem_monitor->mem_label = NULL; } +#endif + diff --git a/L3_Middlewares/LVGL/src/core/lv_refr.h b/L3_Middlewares/LVGL/src/core/lv_refr.h index 6b756ed..72e8d6c 100644 --- a/L3_Middlewares/LVGL/src/core/lv_refr.h +++ b/L3_Middlewares/LVGL/src/core/lv_refr.h @@ -14,13 +14,14 @@ extern "C" { * INCLUDES *********************/ #include "lv_obj.h" -#include "../display/lv_display.h" -#include "../misc/lv_types.h" +#include /********************* * DEFINES *********************/ +#define LV_REFR_TASK_PRIO LV_TASK_PRIO_MID + /********************** * TYPEDEFS **********************/ @@ -41,6 +42,11 @@ extern "C" { * GLOBAL FUNCTIONS **********************/ +/** + * Initialize the screen refresh subsystem + */ +void _lv_refr_init(void); + /** * Redraw the invalidated areas now. * Normally the redrawing is periodically executed in `lv_timer_handler` but a long blocking process @@ -48,14 +54,55 @@ extern "C" { * (e.g. progress bar) this function can be called when the screen should be updated. * @param disp pointer to display to refresh. NULL to refresh all displays. */ -void lv_refr_now(lv_display_t * disp); +void lv_refr_now(lv_disp_t * disp); /** - * Redrawn on object and all its children using the passed draw context - * @param layer pointer to a layer where to draw. + * Redrawn on object an all its children using the passed draw context + * @param draw pointer to an initialized draw context * @param obj the start object from the redraw should start */ -void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj); +void lv_obj_redraw(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj); + +/** + * Invalidate an area on display to redraw it + * @param area_p pointer to area which should be invalidated (NULL: delete the invalidated areas) + * @param disp pointer to display where the area should be invalidated (NULL can be used if there is + * only one display) + */ +void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p); + +/** + * Get the display which is being refreshed + * @return the display being refreshed + */ +lv_disp_t * _lv_refr_get_disp_refreshing(void); + +/** + * Set the display which is being refreshed. + * It shouldn't be used directly by the user. + * It can be used to trick the drawing functions about there is an active display. + * @param the display being refreshed + */ +void _lv_refr_set_disp_refreshing(lv_disp_t * disp); + +#if LV_USE_PERF_MONITOR +/** + * Reset FPS counter + */ +void lv_refr_reset_fps_counter(void); + +/** + * Get the average FPS + * @return the average FPS + */ +uint32_t lv_refr_get_fps_avg(void); +#endif + +/** + * Called periodically to handle the refreshing + * @param timer pointer to the timer itself + */ +void _lv_disp_refr_timer(lv_timer_t * timer); /********************** * STATIC FUNCTIONS diff --git a/L3_Middlewares/LVGL/src/core/lv_refr_private.h b/L3_Middlewares/LVGL/src/core/lv_refr_private.h deleted file mode 100644 index 8f84078..0000000 --- a/L3_Middlewares/LVGL/src/core/lv_refr_private.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file lv_refr_private.h - * - */ - -#ifndef LV_REFR_PRIVATE_H -#define LV_REFR_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_refr.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize the screen refresh subsystem - */ -void lv_refr_init(void); - -/** - * Deinitialize the screen refresh subsystem - */ -void lv_refr_deinit(void); - -/** - * Invalidate an area on display to redraw it - * @param area_p pointer to area which should be invalidated (NULL: delete the invalidated areas) - * @param disp pointer to display where the area should be invalidated (NULL can be used if there is - * only one display) - */ -void lv_inv_area(lv_display_t * disp, const lv_area_t * area_p); - -/** - * Get the display which is being refreshed - * @return the display being refreshed - */ -lv_display_t * lv_refr_get_disp_refreshing(void); - -/** - * Set the display which is being refreshed - * @param disp the display being refreshed - */ -void lv_refr_set_disp_refreshing(lv_display_t * disp); - -/** - * Called periodically to handle the refreshing - * @param timer pointer to the timer itself - */ -void lv_display_refr_timer(lv_timer_t * timer); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_REFR_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/themes/lv_theme.c b/L3_Middlewares/LVGL/src/core/lv_theme.c similarity index 69% rename from L3_Middlewares/LVGL/src/themes/lv_theme.c rename to L3_Middlewares/LVGL/src/core/lv_theme.c index 5dcd6c6..b46cdcc 100644 --- a/L3_Middlewares/LVGL/src/themes/lv_theme.c +++ b/L3_Middlewares/LVGL/src/core/lv_theme.c @@ -6,9 +6,6 @@ /********************* * INCLUDES *********************/ -#include "lv_theme_private.h" -#include "../core/lv_obj_private.h" -#include "../core/lv_obj_class_private.h" #include "../../lvgl.h" /********************* @@ -23,7 +20,6 @@ * STATIC PROTOTYPES **********************/ static void apply_theme(lv_theme_t * th, lv_obj_t * obj); -static void apply_theme_recursion(lv_theme_t * th, lv_obj_t * obj); /********************** * STATIC VARIABLES @@ -39,10 +35,15 @@ static void apply_theme_recursion(lv_theme_t * th, lv_obj_t * obj); lv_theme_t * lv_theme_get_from_obj(lv_obj_t * obj) { - lv_display_t * disp = obj ? lv_obj_get_display(obj) : lv_display_get_default(); - return lv_display_get_theme(disp); + lv_disp_t * disp = obj ? lv_obj_get_disp(obj) : lv_disp_get_default(); + return lv_disp_get_theme(disp); } +/** + * Apply the active theme on an object + * @param obj pointer to an object + * @param name the name of the theme element to apply. E.g. `LV_THEME_BTN` + */ void lv_theme_apply(lv_obj_t * obj) { lv_theme_t * th = lv_theme_get_from_obj(obj); @@ -50,14 +51,27 @@ void lv_theme_apply(lv_obj_t * obj) lv_obj_remove_style_all(obj); - apply_theme_recursion(th, obj); /*Apply the theme including the base theme(s)*/ + apply_theme(th, obj); /*Apply the theme including the base theme(s)*/ } +/** + * Set a base theme for a theme. + * The styles from the base them will be added before the styles of the current theme. + * Arbitrary long chain of themes can be created by setting base themes. + * @param new_theme pointer to theme which base should be set + * @param base pointer to the base theme + */ void lv_theme_set_parent(lv_theme_t * new_theme, lv_theme_t * base) { new_theme->parent = base; } +/** + * Set a callback for a theme. + * The callback is used to add styles to different objects + * @param theme pointer to theme which callback should be set + * @param cb pointer to the callback + */ void lv_theme_set_apply_cb(lv_theme_t * theme, lv_theme_apply_cb_t apply_cb) { theme->apply_cb = apply_cb; @@ -102,21 +116,3 @@ static void apply_theme(lv_theme_t * th, lv_obj_t * obj) if(th->parent) apply_theme(th->parent, obj); if(th->apply_cb) th->apply_cb(th, obj); } - -static void apply_theme_recursion(lv_theme_t * th, lv_obj_t * obj) -{ - const lv_obj_class_t * original_class_p = obj->class_p; - - if(obj->class_p->base_class && obj->class_p->theme_inheritable == LV_OBJ_CLASS_THEME_INHERITABLE_TRUE) { - /*Apply the base class theme in obj*/ - obj->class_p = obj->class_p->base_class; - - /*apply the base first*/ - apply_theme_recursion(th, obj); - } - - /*Restore the original class*/ - obj->class_p = original_class_p; - - apply_theme(th, obj); -} diff --git a/L3_Middlewares/LVGL/src/themes/lv_theme.h b/L3_Middlewares/LVGL/src/core/lv_theme.h similarity index 80% rename from L3_Middlewares/LVGL/src/themes/lv_theme.h rename to L3_Middlewares/LVGL/src/core/lv_theme.h index 21cb09b..ef46336 100644 --- a/L3_Middlewares/LVGL/src/themes/lv_theme.h +++ b/L3_Middlewares/LVGL/src/core/lv_theme.h @@ -23,7 +23,23 @@ extern "C" { * TYPEDEFS **********************/ -typedef void (*lv_theme_apply_cb_t)(lv_theme_t *, lv_obj_t *); +struct _lv_theme_t; +struct _lv_disp_t; + +typedef void (*lv_theme_apply_cb_t)(struct _lv_theme_t *, lv_obj_t *); + +typedef struct _lv_theme_t { + lv_theme_apply_cb_t apply_cb; + struct _lv_theme_t * parent; /**< Apply the current theme's style on top of this theme.*/ + void * user_data; + struct _lv_disp_t * disp; + lv_color_t color_primary; + lv_color_t color_secondary; + const lv_font_t * font_small; + const lv_font_t * font_normal; + const lv_font_t * font_large; + uint32_t flags; /*Any custom flag used by the theme*/ +} lv_theme_t; /********************** * GLOBAL PROTOTYPES @@ -97,10 +113,6 @@ lv_color_t lv_theme_get_color_secondary(lv_obj_t * obj); * MACROS **********************/ -#include "default/lv_theme_default.h" -#include "mono/lv_theme_mono.h" -#include "simple/lv_theme_simple.h" - #ifdef __cplusplus } /*extern "C"*/ #endif diff --git a/L3_Middlewares/LVGL/src/display/lv_display.c b/L3_Middlewares/LVGL/src/display/lv_display.c deleted file mode 100644 index df4bb9b..0000000 --- a/L3_Middlewares/LVGL/src/display/lv_display.c +++ /dev/null @@ -1,1134 +0,0 @@ -/** - * @file lv_disp.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../display/lv_display_private.h" -#include "../misc/lv_event_private.h" -#include "../misc/lv_anim_private.h" -#include "../draw/lv_draw_private.h" -#include "../core/lv_obj_private.h" -#include "lv_display.h" -#include "../misc/lv_math.h" -#include "../core/lv_refr_private.h" -#include "../stdlib/lv_string.h" -#include "../themes/lv_theme.h" -#include "../core/lv_global.h" -#include "../others/sysmon/lv_sysmon.h" - -#if LV_USE_DRAW_SW - #include "../draw/sw/lv_draw_sw.h" -#endif - -/********************* - * DEFINES - *********************/ -#define disp_def LV_GLOBAL_DEFAULT()->disp_default -#define disp_ll_p &(LV_GLOBAL_DEFAULT()->disp_ll) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static lv_obj_tree_walk_res_t invalidate_layout_cb(lv_obj_t * obj, void * user_data); -static void update_resolution(lv_display_t * disp); -static void scr_load_internal(lv_obj_t * scr); -static void scr_load_anim_start(lv_anim_t * a); -static void opa_scale_anim(void * obj, int32_t v); -static void set_x_anim(void * obj, int32_t v); -static void set_y_anim(void * obj, int32_t v); -static void scr_anim_completed(lv_anim_t * a); -static bool is_out_anim(lv_screen_load_anim_t a); -static void disp_event_cb(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res) -{ - lv_display_t * disp = lv_ll_ins_head(disp_ll_p); - LV_ASSERT_MALLOC(disp); - if(!disp) return NULL; - - lv_memzero(disp, sizeof(lv_display_t)); - - disp->hor_res = hor_res; - disp->ver_res = ver_res; - disp->physical_hor_res = -1; - disp->physical_ver_res = -1; - disp->offset_x = 0; - disp->offset_y = 0; - disp->antialiasing = LV_COLOR_DEPTH > 8 ? 1 : 0; - disp->dpi = LV_DPI_DEF; - disp->color_format = LV_COLOR_FORMAT_NATIVE; - - disp->layer_head = lv_malloc_zeroed(sizeof(lv_layer_t)); - LV_ASSERT_MALLOC(disp->layer_head); - if(disp->layer_head == NULL) return NULL; - - if(disp->layer_init) disp->layer_init(disp, disp->layer_head); - disp->layer_head->buf_area.x1 = 0; - disp->layer_head->buf_area.y1 = 0; - disp->layer_head->buf_area.x2 = hor_res - 1; - disp->layer_head->buf_area.y2 = ver_res - 1; - disp->layer_head->color_format = disp->color_format; - - disp->inv_en_cnt = 1; - disp->last_activity_time = lv_tick_get(); - - lv_ll_init(&disp->sync_areas, sizeof(lv_area_t)); - - lv_display_t * disp_def_tmp = disp_def; - disp_def = disp; /*Temporarily change the default screen to create the default screens on the - new display*/ - /*Create a refresh timer*/ - disp->refr_timer = lv_timer_create(lv_display_refr_timer, LV_DEF_REFR_PERIOD, disp); - LV_ASSERT_MALLOC(disp->refr_timer); - if(disp->refr_timer == NULL) { - lv_free(disp); - return NULL; - } - -#if LV_USE_THEME_DEFAULT - if(lv_theme_default_is_inited() == false) { - disp->theme = lv_theme_default_init(disp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), - LV_THEME_DEFAULT_DARK, LV_FONT_DEFAULT); - } - else { - disp->theme = lv_theme_default_get(); - } -#elif LV_USE_THEME_SIMPLE - if(lv_theme_simple_is_inited() == false) { - disp->theme = lv_theme_simple_init(disp); - } - else { - disp->theme = lv_theme_simple_get(); - } -#endif - - disp->bottom_layer = lv_obj_create(NULL); /*Create bottom layer on the display*/ - disp->act_scr = lv_obj_create(NULL); /*Create a default screen on the display*/ - disp->top_layer = lv_obj_create(NULL); /*Create top layer on the display*/ - disp->sys_layer = lv_obj_create(NULL); /*Create sys layer on the display*/ - lv_obj_remove_style_all(disp->bottom_layer); - lv_obj_remove_style_all(disp->top_layer); - lv_obj_remove_style_all(disp->sys_layer); - lv_obj_remove_flag(disp->top_layer, LV_OBJ_FLAG_CLICKABLE); - lv_obj_remove_flag(disp->sys_layer, LV_OBJ_FLAG_CLICKABLE); - - lv_obj_set_scrollbar_mode(disp->bottom_layer, LV_SCROLLBAR_MODE_OFF); - lv_obj_set_scrollbar_mode(disp->top_layer, LV_SCROLLBAR_MODE_OFF); - lv_obj_set_scrollbar_mode(disp->sys_layer, LV_SCROLLBAR_MODE_OFF); - - lv_obj_invalidate(disp->act_scr); - - disp_def = disp_def_tmp; /*Revert the default display*/ - if(disp_def == NULL) disp_def = disp; /*Initialize the default display*/ - - lv_display_add_event_cb(disp, disp_event_cb, LV_EVENT_REFR_REQUEST, NULL); - - lv_timer_ready(disp->refr_timer); /*Be sure the screen will be refreshed immediately on start up*/ - -#if LV_USE_PERF_MONITOR - lv_sysmon_show_performance(disp); -#endif - -#if LV_USE_MEM_MONITOR - lv_sysmon_show_memory(disp); -#endif - - return disp; -} - -void lv_display_delete(lv_display_t * disp) -{ - bool was_default = false; - bool was_refr = false; - if(disp == lv_display_get_default()) was_default = true; - if(disp == lv_refr_get_disp_refreshing()) was_refr = true; - - lv_display_send_event(disp, LV_EVENT_DELETE, NULL); - lv_event_remove_all(&(disp->event_list)); - - /*Detach the input devices*/ - lv_indev_t * indev; - indev = lv_indev_get_next(NULL); - while(indev) { - if(lv_indev_get_display(indev) == disp) { - lv_indev_set_display(indev, NULL); - } - indev = lv_indev_get_next(indev); - } - - /* Delete screen and other obj */ - if(disp->sys_layer) { - lv_obj_delete(disp->sys_layer); - disp->sys_layer = NULL; - } - if(disp->top_layer) { - lv_obj_delete(disp->top_layer); - disp->top_layer = NULL; - } - - if(disp->bottom_layer) { - lv_obj_delete(disp->bottom_layer); - disp->bottom_layer = NULL; - } - - disp->act_scr = NULL; - - while(disp->screen_cnt != 0) { - /*Delete the screens*/ - lv_obj_delete(disp->screens[0]); - } - - lv_ll_clear(&disp->sync_areas); - lv_ll_remove(disp_ll_p, disp); - if(disp->refr_timer) lv_timer_delete(disp->refr_timer); - - if(disp->layer_deinit) disp->layer_deinit(disp, disp->layer_head); - lv_free(disp->layer_head); - - lv_free(disp); - - if(was_default) lv_display_set_default(lv_ll_get_head(disp_ll_p)); - - if(was_refr) lv_refr_set_disp_refreshing(NULL); -} - -void lv_display_set_default(lv_display_t * disp) -{ - disp_def = disp; -} - -lv_display_t * lv_display_get_default(void) -{ - return disp_def; -} - -lv_display_t * lv_display_get_next(lv_display_t * disp) -{ - if(disp == NULL) - return lv_ll_get_head(disp_ll_p); - else - return lv_ll_get_next(disp_ll_p, disp); -} - -/*--------------------- - * RESOLUTION - *--------------------*/ - -void lv_display_set_resolution(lv_display_t * disp, int32_t hor_res, int32_t ver_res) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return; - - if(disp->hor_res == hor_res && disp->ver_res == ver_res) return; - - disp->hor_res = hor_res; - disp->ver_res = ver_res; - - update_resolution(disp); -} - -void lv_display_set_physical_resolution(lv_display_t * disp, int32_t hor_res, int32_t ver_res) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return; - - disp->physical_hor_res = hor_res; - disp->physical_ver_res = ver_res; - - lv_obj_invalidate(disp->sys_layer); - -} - -void lv_display_set_offset(lv_display_t * disp, int32_t x, int32_t y) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return; - - disp->offset_x = x; - disp->offset_y = y; - - lv_obj_invalidate(disp->sys_layer); - -} - -void lv_display_set_dpi(lv_display_t * disp, int32_t dpi) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return; - - disp->dpi = dpi; -} - -int32_t lv_display_get_horizontal_resolution(const lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - - if(disp == NULL) { - return 0; - } - else { - switch(disp->rotation) { - case LV_DISPLAY_ROTATION_90: - case LV_DISPLAY_ROTATION_270: - return disp->ver_res; - default: - return disp->hor_res; - } - } -} - -int32_t lv_display_get_vertical_resolution(const lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - - if(disp == NULL) { - return 0; - } - else { - switch(disp->rotation) { - case LV_DISPLAY_ROTATION_90: - case LV_DISPLAY_ROTATION_270: - return disp->hor_res; - default: - return disp->ver_res; - } - } -} - -int32_t lv_display_get_physical_horizontal_resolution(const lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - - if(disp == NULL) { - return 0; - } - else { - switch(disp->rotation) { - case LV_DISPLAY_ROTATION_90: - case LV_DISPLAY_ROTATION_270: - return disp->physical_ver_res > 0 ? disp->physical_ver_res : disp->ver_res; - default: - return disp->physical_hor_res > 0 ? disp->physical_hor_res : disp->hor_res; - } - } -} - -int32_t lv_display_get_physical_vertical_resolution(const lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - - if(disp == NULL) { - return 0; - } - else { - switch(disp->rotation) { - case LV_DISPLAY_ROTATION_90: - case LV_DISPLAY_ROTATION_270: - return disp->physical_hor_res > 0 ? disp->physical_hor_res : disp->hor_res; - default: - return disp->physical_ver_res > 0 ? disp->physical_ver_res : disp->ver_res; - } - } -} - -int32_t lv_display_get_offset_x(const lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - - if(disp == NULL) { - return 0; - } - else { - switch(disp->rotation) { - case LV_DISPLAY_ROTATION_90: - return disp->offset_y; - case LV_DISPLAY_ROTATION_180: - return lv_display_get_physical_horizontal_resolution(disp) - disp->offset_x; - case LV_DISPLAY_ROTATION_270: - return lv_display_get_physical_horizontal_resolution(disp) - disp->offset_y; - default: - return disp->offset_x; - } - } -} - -int32_t lv_display_get_offset_y(const lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - - if(disp == NULL) { - return 0; - } - else { - switch(disp->rotation) { - case LV_DISPLAY_ROTATION_90: - return disp->offset_x; - case LV_DISPLAY_ROTATION_180: - return lv_display_get_physical_vertical_resolution(disp) - disp->offset_y; - case LV_DISPLAY_ROTATION_270: - return lv_display_get_physical_vertical_resolution(disp) - disp->offset_x; - default: - return disp->offset_y; - } - } -} - -int32_t lv_display_get_dpi(const lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return LV_DPI_DEF; /*Do not return 0 because it might be a divider*/ - return disp->dpi; -} - -/*--------------------- - * BUFFERING - *--------------------*/ - -void lv_display_set_draw_buffers(lv_display_t * disp, lv_draw_buf_t * buf1, lv_draw_buf_t * buf2) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return; - - disp->buf_1 = buf1; - disp->buf_2 = buf2; - disp->buf_act = disp->buf_1; -} - -void lv_display_set_buffers(lv_display_t * disp, void * buf1, void * buf2, uint32_t buf_size, - lv_display_render_mode_t render_mode) -{ - LV_ASSERT_MSG(buf1 != NULL, "Null buffer"); - lv_color_format_t cf = lv_display_get_color_format(disp); - uint32_t w = lv_display_get_horizontal_resolution(disp); - uint32_t h = lv_display_get_vertical_resolution(disp); - - LV_ASSERT_MSG(w != 0 && h != 0, "display resolution is 0"); - - /* buf1 or buf2 is not aligned according to LV_DRAW_BUF_ALIGN */ - LV_ASSERT_FORMAT_MSG(buf1 == lv_draw_buf_align(buf1, cf), "buf1 is not aligned: %p", buf1); - LV_ASSERT_FORMAT_MSG(buf2 == NULL || buf2 == lv_draw_buf_align(buf2, cf), "buf2 is not aligned: %p", buf2); - - uint32_t stride = lv_draw_buf_width_to_stride(w, cf); - if(render_mode == LV_DISPLAY_RENDER_MODE_PARTIAL) { - /* for partial mode, we calculate the height based on the buf_size and stride */ - h = buf_size / stride; - LV_ASSERT_MSG(h != 0, "the buffer is too small"); - } - else { - LV_ASSERT_FORMAT_MSG(stride * h <= buf_size, "%s mode requires screen sized buffer(s)", - render_mode == LV_DISPLAY_RENDER_MODE_FULL ? "FULL" : "DIRECT"); - } - - lv_draw_buf_init(&disp->_static_buf1, w, h, cf, stride, buf1, buf_size); - lv_draw_buf_init(&disp->_static_buf2, w, h, cf, stride, buf2, buf_size); - lv_display_set_draw_buffers(disp, &disp->_static_buf1, buf2 ? &disp->_static_buf2 : NULL); - lv_display_set_render_mode(disp, render_mode); -} - -void lv_display_set_render_mode(lv_display_t * disp, lv_display_render_mode_t render_mode) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return; - disp->render_mode = render_mode; -} - -void lv_display_set_flush_cb(lv_display_t * disp, lv_display_flush_cb_t flush_cb) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return; - - disp->flush_cb = flush_cb; -} - -void lv_display_set_flush_wait_cb(lv_display_t * disp, lv_display_flush_wait_cb_t wait_cb) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return; - - disp->flush_wait_cb = wait_cb; -} - -void lv_display_set_color_format(lv_display_t * disp, lv_color_format_t color_format) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return; - - disp->color_format = color_format; - disp->layer_head->color_format = color_format; - if(disp->buf_1) disp->buf_1->header.cf = color_format; - if(disp->buf_2) disp->buf_2->header.cf = color_format; - - lv_display_send_event(disp, LV_EVENT_COLOR_FORMAT_CHANGED, NULL); -} - -lv_color_format_t lv_display_get_color_format(lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return LV_COLOR_FORMAT_UNKNOWN; - - return disp->color_format; -} - -void lv_display_set_antialiasing(lv_display_t * disp, bool en) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return; - - disp->antialiasing = en; -} - -bool lv_display_get_antialiasing(lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return false; - - return disp->antialiasing; -} - -LV_ATTRIBUTE_FLUSH_READY void lv_display_flush_ready(lv_display_t * disp) -{ - disp->flushing = 0; -} - -LV_ATTRIBUTE_FLUSH_READY bool lv_display_flush_is_last(lv_display_t * disp) -{ - return disp->flushing_last; -} - -bool lv_display_is_double_buffered(lv_display_t * disp) -{ - return disp->buf_2 != NULL; -} - -/*--------------------- - * SCREENS - *--------------------*/ - -lv_obj_t * lv_display_get_screen_active(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) { - LV_LOG_WARN("no display registered to get its active screen"); - return NULL; - } - - return disp->act_scr; -} - -lv_obj_t * lv_display_get_screen_prev(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) { - LV_LOG_WARN("no display registered to get its previous screen"); - return NULL; - } - - return disp->prev_scr; -} - -lv_obj_t * lv_display_get_layer_top(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) { - LV_LOG_WARN("lv_layer_top: no display registered to get its top layer"); - return NULL; - } - - return disp->top_layer; -} - -lv_obj_t * lv_display_get_layer_sys(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) { - LV_LOG_WARN("lv_layer_sys: no display registered to get its sys. layer"); - return NULL; - } - - return disp->sys_layer; -} - -lv_obj_t * lv_display_get_layer_bottom(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) { - LV_LOG_WARN("lv_layer_bottom: no display registered to get its bottom layer"); - return NULL; - } - - return disp->bottom_layer; -} - -void lv_screen_load(struct lv_obj_t * scr) -{ - lv_screen_load_anim(scr, LV_SCR_LOAD_ANIM_NONE, 0, 0, false); -} - -void lv_screen_load_anim(lv_obj_t * new_scr, lv_screen_load_anim_t anim_type, uint32_t time, uint32_t delay, - bool auto_del) -{ - lv_display_t * d = lv_obj_get_display(new_scr); - lv_obj_t * act_scr = d->act_scr; - - if(act_scr == new_scr || d->scr_to_load == new_scr) { - return; - } - - /*If another screen load animation is in progress - *make target screen loaded immediately. */ - if(d->scr_to_load && act_scr != d->scr_to_load) { - lv_anim_delete(d->scr_to_load, NULL); - lv_obj_set_pos(d->scr_to_load, 0, 0); - lv_obj_remove_local_style_prop(d->scr_to_load, LV_STYLE_OPA, 0); - - d->prev_scr = d->act_scr; - act_scr = d->scr_to_load; /*Active screen changed.*/ - - scr_load_internal(d->scr_to_load); - } - - d->scr_to_load = new_scr; - - if(d->prev_scr && d->del_prev) lv_obj_delete(d->prev_scr); - d->prev_scr = NULL; - - d->draw_prev_over_act = is_out_anim(anim_type); - d->del_prev = auto_del; - - /*Be sure there is no other animation on the screens*/ - lv_anim_delete(new_scr, NULL); - if(act_scr) lv_anim_delete(act_scr, NULL); - - /*Be sure both screens are in a normal position*/ - lv_obj_set_pos(new_scr, 0, 0); - if(act_scr) lv_obj_set_pos(act_scr, 0, 0); - lv_obj_remove_local_style_prop(new_scr, LV_STYLE_OPA, 0); - if(act_scr) lv_obj_remove_local_style_prop(act_scr, LV_STYLE_OPA, 0); - - /*Shortcut for immediate load*/ - if(time == 0 && delay == 0) { - scr_load_internal(new_scr); - if(auto_del && act_scr) lv_obj_delete(act_scr); - return; - } - - lv_anim_t a_new; - lv_anim_init(&a_new); - lv_anim_set_var(&a_new, new_scr); - lv_anim_set_start_cb(&a_new, scr_load_anim_start); - lv_anim_set_completed_cb(&a_new, scr_anim_completed); - lv_anim_set_duration(&a_new, time); - lv_anim_set_delay(&a_new, delay); - - lv_anim_t a_old; - lv_anim_init(&a_old); - lv_anim_set_var(&a_old, act_scr); - lv_anim_set_duration(&a_old, time); - lv_anim_set_delay(&a_old, delay); - - switch(anim_type) { - case LV_SCR_LOAD_ANIM_NONE: - /*Create a dummy animation to apply the delay*/ - lv_anim_set_exec_cb(&a_new, set_x_anim); - lv_anim_set_values(&a_new, 0, 0); - break; - case LV_SCR_LOAD_ANIM_OVER_LEFT: - lv_anim_set_exec_cb(&a_new, set_x_anim); - lv_anim_set_values(&a_new, lv_display_get_horizontal_resolution(d), 0); - break; - case LV_SCR_LOAD_ANIM_OVER_RIGHT: - lv_anim_set_exec_cb(&a_new, set_x_anim); - lv_anim_set_values(&a_new, -lv_display_get_horizontal_resolution(d), 0); - break; - case LV_SCR_LOAD_ANIM_OVER_TOP: - lv_anim_set_exec_cb(&a_new, set_y_anim); - lv_anim_set_values(&a_new, lv_display_get_vertical_resolution(d), 0); - break; - case LV_SCR_LOAD_ANIM_OVER_BOTTOM: - lv_anim_set_exec_cb(&a_new, set_y_anim); - lv_anim_set_values(&a_new, -lv_display_get_vertical_resolution(d), 0); - break; - case LV_SCR_LOAD_ANIM_MOVE_LEFT: - lv_anim_set_exec_cb(&a_new, set_x_anim); - lv_anim_set_values(&a_new, lv_display_get_horizontal_resolution(d), 0); - - lv_anim_set_exec_cb(&a_old, set_x_anim); - lv_anim_set_values(&a_old, 0, -lv_display_get_horizontal_resolution(d)); - break; - case LV_SCR_LOAD_ANIM_MOVE_RIGHT: - lv_anim_set_exec_cb(&a_new, set_x_anim); - lv_anim_set_values(&a_new, -lv_display_get_horizontal_resolution(d), 0); - - lv_anim_set_exec_cb(&a_old, set_x_anim); - lv_anim_set_values(&a_old, 0, lv_display_get_horizontal_resolution(d)); - break; - case LV_SCR_LOAD_ANIM_MOVE_TOP: - lv_anim_set_exec_cb(&a_new, set_y_anim); - lv_anim_set_values(&a_new, lv_display_get_vertical_resolution(d), 0); - - lv_anim_set_exec_cb(&a_old, set_y_anim); - lv_anim_set_values(&a_old, 0, -lv_display_get_vertical_resolution(d)); - break; - case LV_SCR_LOAD_ANIM_MOVE_BOTTOM: - lv_anim_set_exec_cb(&a_new, set_y_anim); - lv_anim_set_values(&a_new, -lv_display_get_vertical_resolution(d), 0); - - lv_anim_set_exec_cb(&a_old, set_y_anim); - lv_anim_set_values(&a_old, 0, lv_display_get_vertical_resolution(d)); - break; - case LV_SCR_LOAD_ANIM_FADE_IN: - lv_anim_set_exec_cb(&a_new, opa_scale_anim); - lv_anim_set_values(&a_new, LV_OPA_TRANSP, LV_OPA_COVER); - break; - case LV_SCR_LOAD_ANIM_FADE_OUT: - lv_anim_set_exec_cb(&a_old, opa_scale_anim); - lv_anim_set_values(&a_old, LV_OPA_COVER, LV_OPA_TRANSP); - break; - case LV_SCR_LOAD_ANIM_OUT_LEFT: - lv_anim_set_exec_cb(&a_old, set_x_anim); - lv_anim_set_values(&a_old, 0, -lv_display_get_horizontal_resolution(d)); - break; - case LV_SCR_LOAD_ANIM_OUT_RIGHT: - lv_anim_set_exec_cb(&a_old, set_x_anim); - lv_anim_set_values(&a_old, 0, lv_display_get_horizontal_resolution(d)); - break; - case LV_SCR_LOAD_ANIM_OUT_TOP: - lv_anim_set_exec_cb(&a_old, set_y_anim); - lv_anim_set_values(&a_old, 0, -lv_display_get_vertical_resolution(d)); - break; - case LV_SCR_LOAD_ANIM_OUT_BOTTOM: - lv_anim_set_exec_cb(&a_old, set_y_anim); - lv_anim_set_values(&a_old, 0, lv_display_get_vertical_resolution(d)); - break; - } - - if(act_scr) lv_obj_send_event(act_scr, LV_EVENT_SCREEN_UNLOAD_START, NULL); - - lv_anim_start(&a_new); - if(act_scr) lv_anim_start(&a_old); -} - -/*--------------------- - * OTHERS - *--------------------*/ - -void lv_display_add_event_cb(lv_display_t * disp, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data) -{ - LV_ASSERT_NULL(disp); - - lv_event_add(&disp->event_list, event_cb, filter, user_data); -} - -uint32_t lv_display_get_event_count(lv_display_t * disp) -{ - LV_ASSERT_NULL(disp); - return lv_event_get_count(&disp->event_list); -} - -lv_event_dsc_t * lv_display_get_event_dsc(lv_display_t * disp, uint32_t index) -{ - LV_ASSERT_NULL(disp); - return lv_event_get_dsc(&disp->event_list, index); - -} - -bool lv_display_delete_event(lv_display_t * disp, uint32_t index) -{ - LV_ASSERT_NULL(disp); - - return lv_event_remove(&disp->event_list, index); -} - -uint32_t lv_display_remove_event_cb_with_user_data(lv_display_t * disp, lv_event_cb_t event_cb, void * user_data) -{ - LV_ASSERT_NULL(disp); - - uint32_t event_cnt = lv_display_get_event_count(disp); - uint32_t removed_count = 0; - int32_t i; - - for(i = event_cnt - 1; i >= 0; i--) { - lv_event_dsc_t * dsc = lv_display_get_event_dsc(disp, i); - if(dsc && dsc->cb == event_cb && dsc->user_data == user_data) { - lv_display_delete_event(disp, i); - removed_count ++; - } - } - - return removed_count; -} - -lv_result_t lv_display_send_event(lv_display_t * disp, lv_event_code_t code, void * param) -{ - - lv_event_t e; - lv_memzero(&e, sizeof(e)); - e.code = code; - e.current_target = disp; - e.original_target = disp; - e.param = param; - lv_result_t res; - res = lv_event_send(&disp->event_list, &e, true); - if(res != LV_RESULT_OK) return res; - - res = lv_event_send(&disp->event_list, &e, false); - if(res != LV_RESULT_OK) return res; - - return res; -} - -void lv_display_set_rotation(lv_display_t * disp, lv_display_rotation_t rotation) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return; - - disp->rotation = rotation; - update_resolution(disp); -} - -lv_display_rotation_t lv_display_get_rotation(lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) return LV_DISPLAY_ROTATION_0; - return disp->rotation; -} - -void lv_display_set_theme(lv_display_t * disp, lv_theme_t * th) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) { - LV_LOG_WARN("no display registered"); - return; - } - - disp->theme = th; - - if(disp->screen_cnt == 4 && - lv_obj_get_child_count(disp->screens[0]) == 0 && - lv_obj_get_child_count(disp->screens[1]) == 0 && - lv_obj_get_child_count(disp->screens[2]) == 0) { - lv_theme_apply(disp->screens[0]); - } -} - -lv_theme_t * lv_display_get_theme(lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - return disp->theme; -} - -uint32_t lv_display_get_inactive_time(const lv_display_t * disp) -{ - if(disp) return lv_tick_elaps(disp->last_activity_time); - - lv_display_t * d; - uint32_t t = UINT32_MAX; - d = lv_display_get_next(NULL); - while(d) { - uint32_t elaps = lv_tick_elaps(d->last_activity_time); - t = LV_MIN(t, elaps); - d = lv_display_get_next(d); - } - - return t; -} - -void lv_display_trigger_activity(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) { - LV_LOG_WARN("lv_display_trigger_activity: no display registered"); - return; - } - - disp->last_activity_time = lv_tick_get(); -} - -void lv_display_enable_invalidation(lv_display_t * disp, bool en) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) { - LV_LOG_WARN("no display registered"); - return; - } - - disp->inv_en_cnt += en ? 1 : -1; -} - -bool lv_display_is_invalidation_enabled(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) { - LV_LOG_WARN("no display registered"); - return false; - } - - return (disp->inv_en_cnt > 0); -} - -lv_timer_t * lv_display_get_refr_timer(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) return NULL; - - return disp->refr_timer; -} - -void lv_display_delete_refr_timer(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp || !disp->refr_timer) return; - - lv_timer_delete(disp->refr_timer); - disp->refr_timer = NULL; -} - -void lv_display_set_user_data(lv_display_t * disp, void * user_data) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) return; - disp->user_data = user_data; -} - -void lv_display_set_driver_data(lv_display_t * disp, void * driver_data) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) return; - - disp->driver_data = driver_data; -} - -void * lv_display_get_user_data(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) return NULL; - return disp->user_data; -} - -void * lv_display_get_driver_data(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) return NULL; - - return disp->driver_data; -} - -lv_draw_buf_t * lv_display_get_buf_active(lv_display_t * disp) -{ - if(!disp) disp = lv_display_get_default(); - if(!disp) return NULL; - return disp->buf_act; -} - -void lv_display_rotate_area(lv_display_t * disp, lv_area_t * area) -{ - lv_display_rotation_t rotation = lv_display_get_rotation(disp); - - int32_t w = lv_area_get_width(area); - int32_t h = lv_area_get_height(area); - - switch(rotation) { - case LV_DISPLAY_ROTATION_0: - return; - case LV_DISPLAY_ROTATION_90: - area->y2 = disp->ver_res - area->x1 - 1; - area->x1 = area->y1; - area->x2 = area->x1 + h - 1; - area->y1 = area->y2 - w + 1; - break; - case LV_DISPLAY_ROTATION_180: - area->y2 = disp->ver_res - area->y1 - 1; - area->y1 = area->y2 - h + 1; - area->x2 = disp->hor_res - area->x1 - 1; - area->x1 = area->x2 - w + 1; - break; - case LV_DISPLAY_ROTATION_270: - area->x1 = disp->hor_res - area->y2 - 1; - area->y2 = area->x2; - area->x2 = area->x1 + h - 1; - area->y1 = area->y2 - w + 1; - break; - } -} - -lv_obj_t * lv_screen_active(void) -{ - return lv_display_get_screen_active(lv_display_get_default()); -} - -lv_obj_t * lv_layer_top(void) -{ - return lv_display_get_layer_top(lv_display_get_default()); -} - -lv_obj_t * lv_layer_sys(void) -{ - return lv_display_get_layer_sys(lv_display_get_default()); -} - -lv_obj_t * lv_layer_bottom(void) -{ - return lv_display_get_layer_bottom(lv_display_get_default()); -} - -int32_t lv_dpx(int32_t n) -{ - return LV_DPX(n); -} - -int32_t lv_display_dpx(const lv_display_t * disp, int32_t n) -{ - return LV_DPX_CALC(lv_display_get_dpi(disp), n); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void update_resolution(lv_display_t * disp) -{ - int32_t hor_res = lv_display_get_horizontal_resolution(disp); - int32_t ver_res = lv_display_get_vertical_resolution(disp); - - lv_area_t prev_coords; - lv_obj_get_coords(disp->sys_layer, &prev_coords); - uint32_t i; - for(i = 0; i < disp->screen_cnt; i++) { - lv_area_set_width(&disp->screens[i]->coords, hor_res); - lv_area_set_height(&disp->screens[i]->coords, ver_res); - lv_obj_send_event(disp->screens[i], LV_EVENT_SIZE_CHANGED, &prev_coords); - } - - lv_area_set_width(&disp->top_layer->coords, hor_res); - lv_area_set_height(&disp->top_layer->coords, ver_res); - lv_obj_send_event(disp->top_layer, LV_EVENT_SIZE_CHANGED, &prev_coords); - - lv_area_set_width(&disp->sys_layer->coords, hor_res); - lv_area_set_height(&disp->sys_layer->coords, ver_res); - lv_obj_send_event(disp->sys_layer, LV_EVENT_SIZE_CHANGED, &prev_coords); - - lv_area_set_width(&disp->bottom_layer->coords, hor_res); - lv_area_set_height(&disp->bottom_layer->coords, ver_res); - lv_obj_send_event(disp->bottom_layer, LV_EVENT_SIZE_CHANGED, &prev_coords); - - lv_memzero(disp->inv_areas, sizeof(disp->inv_areas)); - lv_memzero(disp->inv_area_joined, sizeof(disp->inv_area_joined)); - disp->inv_p = 0; - lv_obj_invalidate(disp->sys_layer); - - lv_obj_tree_walk(NULL, invalidate_layout_cb, NULL); - - lv_display_send_event(disp, LV_EVENT_RESOLUTION_CHANGED, NULL); -} - -static lv_obj_tree_walk_res_t invalidate_layout_cb(lv_obj_t * obj, void * user_data) -{ - LV_UNUSED(user_data); - lv_obj_mark_layout_as_dirty(obj); - return LV_OBJ_TREE_WALK_NEXT; -} - -static void scr_load_internal(lv_obj_t * scr) -{ - /*scr must not be NULL, but d->act_scr might be*/ - LV_ASSERT_NULL(scr); - if(scr == NULL) return; - - lv_display_t * d = lv_obj_get_display(scr); - if(!d) return; /*Shouldn't happen, just to be sure*/ - - lv_obj_t * old_scr = d->act_scr; - - if(old_scr) lv_obj_send_event(old_scr, LV_EVENT_SCREEN_UNLOAD_START, NULL); - lv_obj_send_event(scr, LV_EVENT_SCREEN_LOAD_START, NULL); - - d->act_scr = scr; - d->scr_to_load = NULL; - - lv_obj_send_event(scr, LV_EVENT_SCREEN_LOADED, NULL); - if(old_scr) lv_obj_send_event(old_scr, LV_EVENT_SCREEN_UNLOADED, NULL); - - lv_obj_invalidate(scr); -} - -static void scr_load_anim_start(lv_anim_t * a) -{ - lv_display_t * d = lv_obj_get_display(a->var); - - d->prev_scr = d->act_scr; - d->act_scr = a->var; - - lv_obj_send_event(d->act_scr, LV_EVENT_SCREEN_LOAD_START, NULL); -} - -static void opa_scale_anim(void * obj, int32_t v) -{ - lv_obj_set_style_opa(obj, v, 0); -} - -static void set_x_anim(void * obj, int32_t v) -{ - lv_obj_set_x(obj, v); -} - -static void set_y_anim(void * obj, int32_t v) -{ - lv_obj_set_y(obj, v); -} - -static void scr_anim_completed(lv_anim_t * a) -{ - lv_display_t * d = lv_obj_get_display(a->var); - - lv_obj_send_event(d->act_scr, LV_EVENT_SCREEN_LOADED, NULL); - lv_obj_send_event(d->prev_scr, LV_EVENT_SCREEN_UNLOADED, NULL); - - if(d->prev_scr && d->del_prev) lv_obj_delete(d->prev_scr); - d->prev_scr = NULL; - d->draw_prev_over_act = false; - d->scr_to_load = NULL; - lv_obj_remove_local_style_prop(a->var, LV_STYLE_OPA, 0); - lv_obj_invalidate(d->act_scr); -} - -static bool is_out_anim(lv_screen_load_anim_t anim_type) -{ - return anim_type == LV_SCR_LOAD_ANIM_FADE_OUT || - anim_type == LV_SCR_LOAD_ANIM_OUT_LEFT || - anim_type == LV_SCR_LOAD_ANIM_OUT_RIGHT || - anim_type == LV_SCR_LOAD_ANIM_OUT_TOP || - anim_type == LV_SCR_LOAD_ANIM_OUT_BOTTOM; -} - -static void disp_event_cb(lv_event_t * e) -{ - lv_event_code_t code = lv_event_get_code(e); - lv_display_t * disp = lv_event_get_target(e); - switch(code) { - case LV_EVENT_REFR_REQUEST: - if(disp->refr_timer) lv_timer_resume(disp->refr_timer); - break; - - default: - break; - } -} diff --git a/L3_Middlewares/LVGL/src/display/lv_display.h b/L3_Middlewares/LVGL/src/display/lv_display.h deleted file mode 100644 index e3e7c49..0000000 --- a/L3_Middlewares/LVGL/src/display/lv_display.h +++ /dev/null @@ -1,593 +0,0 @@ -/** - * @file lv_display.h - * - */ - -#ifndef LV_DISPLAY_H -#define LV_DISPLAY_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../misc/lv_types.h" -#include "../misc/lv_timer.h" -#include "../misc/lv_event.h" -#include "../misc/lv_color.h" -#include "../draw/lv_draw.h" - -/********************* - * DEFINES - *********************/ - -#ifndef LV_ATTRIBUTE_FLUSH_READY -#define LV_ATTRIBUTE_FLUSH_READY -#endif - -/********************** - * TYPEDEFS - **********************/ - -typedef enum { - LV_DISPLAY_ROTATION_0 = 0, - LV_DISPLAY_ROTATION_90, - LV_DISPLAY_ROTATION_180, - LV_DISPLAY_ROTATION_270 -} lv_display_rotation_t; - -typedef enum { - /** - * Use the buffer(s) to render the screen is smaller parts. - * This way the buffers can be smaller then the display to save RAM. At least 1/10 screen size buffer(s) are recommended. - */ - LV_DISPLAY_RENDER_MODE_PARTIAL, - - /** - * The buffer(s) has to be screen sized and LVGL will render into the correct location of the buffer. - * This way the buffer always contain the whole image. Only the changed ares will be updated. - * With 2 buffers the buffers' content are kept in sync automatically and in flush_cb only address change is required. - */ - LV_DISPLAY_RENDER_MODE_DIRECT, - - /** - * Always redraw the whole screen even if only one pixel has been changed. - * With 2 buffers in flush_cb only and address change is required. - */ - LV_DISPLAY_RENDER_MODE_FULL, -} lv_display_render_mode_t; - -typedef enum { - LV_SCR_LOAD_ANIM_NONE, - LV_SCR_LOAD_ANIM_OVER_LEFT, - LV_SCR_LOAD_ANIM_OVER_RIGHT, - LV_SCR_LOAD_ANIM_OVER_TOP, - LV_SCR_LOAD_ANIM_OVER_BOTTOM, - LV_SCR_LOAD_ANIM_MOVE_LEFT, - LV_SCR_LOAD_ANIM_MOVE_RIGHT, - LV_SCR_LOAD_ANIM_MOVE_TOP, - LV_SCR_LOAD_ANIM_MOVE_BOTTOM, - LV_SCR_LOAD_ANIM_FADE_IN, - LV_SCR_LOAD_ANIM_FADE_ON = LV_SCR_LOAD_ANIM_FADE_IN, /*For backward compatibility*/ - LV_SCR_LOAD_ANIM_FADE_OUT, - LV_SCR_LOAD_ANIM_OUT_LEFT, - LV_SCR_LOAD_ANIM_OUT_RIGHT, - LV_SCR_LOAD_ANIM_OUT_TOP, - LV_SCR_LOAD_ANIM_OUT_BOTTOM, -} lv_screen_load_anim_t; - -typedef void (*lv_display_flush_cb_t)(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map); -typedef void (*lv_display_flush_wait_cb_t)(lv_display_t * disp); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a new display with the given resolution - * @param hor_res horizontal resolution in pixels - * @param ver_res vertical resolution in pixels - * @return pointer to a display object or `NULL` on error - */ -lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res); - -/** - * Remove a display - * @param disp pointer to display - */ -void lv_display_delete(lv_display_t * disp); - -/** - * Set a default display. The new screens will be created on it by default. - * @param disp pointer to a display - */ -void lv_display_set_default(lv_display_t * disp); - -/** - * Get the default display - * @return pointer to the default display - */ -lv_display_t * lv_display_get_default(void); - -/** - * Get the next display. - * @param disp pointer to the current display. NULL to initialize. - * @return the next display or NULL if no more. Gives the first display when the parameter is NULL. - */ -lv_display_t * lv_display_get_next(lv_display_t * disp); - -/*--------------------- - * RESOLUTION - *--------------------*/ - -/** - * Sets the resolution of a display. `LV_EVENT_RESOLUTION_CHANGED` event will be sent. - * Here the native resolution of the device should be set. If the display will be rotated later with - * `lv_display_set_rotation` LVGL will swap the hor. and ver. resolution automatically. - * @param disp pointer to a display - * @param hor_res the new horizontal resolution - * @param ver_res the new vertical resolution - */ -void lv_display_set_resolution(lv_display_t * disp, int32_t hor_res, int32_t ver_res); - -/** - * It's not mandatory to use the whole display for LVGL, however in some cases physical resolution is important. - * For example the touchpad still sees whole resolution and the values needs to be converted - * to the active LVGL display area. - * @param disp pointer to a display - * @param hor_res the new physical horizontal resolution, or -1 to assume it's the same as the normal hor. res. - * @param ver_res the new physical vertical resolution, or -1 to assume it's the same as the normal hor. res. - */ -void lv_display_set_physical_resolution(lv_display_t * disp, int32_t hor_res, int32_t ver_res); - -/** - * If physical resolution is not the same as the normal resolution - * the offset of the active display area can be set here. - * @param disp pointer to a display - * @param x X offset - * @param y Y offset - */ -void lv_display_set_offset(lv_display_t * disp, int32_t x, int32_t y); - -/** - * Set the rotation of this display. LVGL will swap the horizontal and vertical resolutions internally. - * @param disp pointer to a display (NULL to use the default display) - * @param rotation `LV_DISPLAY_ROTATION_0/90/180/270` - */ -void lv_display_set_rotation(lv_display_t * disp, lv_display_rotation_t rotation); - -/** - * Set the DPI (dot per inch) of the display. - * dpi = sqrt(hor_res^2 + ver_res^2) / diagonal" - * @param disp pointer to a display - * @param dpi the new DPI - */ -void lv_display_set_dpi(lv_display_t * disp, int32_t dpi); - -/** - * Get the horizontal resolution of a display. - * @param disp pointer to a display (NULL to use the default display) - * @return the horizontal resolution of the display. - */ -int32_t lv_display_get_horizontal_resolution(const lv_display_t * disp); - -/** - * Get the vertical resolution of a display - * @param disp pointer to a display (NULL to use the default display) - * @return the vertical resolution of the display - */ -int32_t lv_display_get_vertical_resolution(const lv_display_t * disp); - -/** - * Get the physical horizontal resolution of a display - * @param disp pointer to a display (NULL to use the default display) - * @return the physical horizontal resolution of the display - */ -int32_t lv_display_get_physical_horizontal_resolution(const lv_display_t * disp); - -/** - * Get the physical vertical resolution of a display - * @param disp pointer to a display (NULL to use the default display) - * @return the physical vertical resolution of the display - */ -int32_t lv_display_get_physical_vertical_resolution(const lv_display_t * disp); - -/** - * Get the horizontal offset from the full / physical display - * @param disp pointer to a display (NULL to use the default display) - * @return the horizontal offset from the physical display - */ -int32_t lv_display_get_offset_x(const lv_display_t * disp); - -/** - * Get the vertical offset from the full / physical display - * @param disp pointer to a display (NULL to use the default display) - * @return the horizontal offset from the physical display - */ -int32_t lv_display_get_offset_y(const lv_display_t * disp); - -/** - * Get the current rotation of this display. - * @param disp pointer to a display (NULL to use the default display) - * @return the current rotation - */ -lv_display_rotation_t lv_display_get_rotation(lv_display_t * disp); - -/** - * Get the DPI of the display - * @param disp pointer to a display (NULL to use the default display) - * @return dpi of the display - */ -int32_t lv_display_get_dpi(const lv_display_t * disp); - -/*--------------------- - * BUFFERING - *--------------------*/ - -/** - * Set the buffers for a display, similarly to `lv_display_set_draw_buffers`, but accept the raw buffer pointers. - * For DIRECT/FULL rending modes, the buffer size must be at least - * `hor_res * ver_res * lv_color_format_get_size(lv_display_get_color_format(disp))` - * @param disp pointer to a display - * @param buf1 first buffer - * @param buf2 second buffer (can be `NULL`) - * @param buf_size buffer size in byte - * @param render_mode LV_DISPLAY_RENDER_MODE_PARTIAL/DIRECT/FULL - */ -void lv_display_set_buffers(lv_display_t * disp, void * buf1, void * buf2, uint32_t buf_size, - lv_display_render_mode_t render_mode); - -/** - * Set the buffers for a display, accept a draw buffer pointer. - * Normally use `lv_display_set_buffers` is enough for most cases. - * Use this function when an existing lv_draw_buf_t is available. - * @param disp pointer to a display - * @param buf1 first buffer - * @param buf2 second buffer (can be `NULL`) - */ -void lv_display_set_draw_buffers(lv_display_t * disp, lv_draw_buf_t * buf1, lv_draw_buf_t * buf2); - -/** - * Set display render mode - * @param disp pointer to a display - * @param render_mode LV_DISPLAY_RENDER_MODE_PARTIAL/DIRECT/FULL - */ -void lv_display_set_render_mode(lv_display_t * disp, lv_display_render_mode_t render_mode); - -/** - * Set the flush callback which will be called to copy the rendered image to the display. - * @param disp pointer to a display - * @param flush_cb the flush callback (`px_map` contains the rendered image as raw pixel map and it should be copied to `area` on the display) - */ -void lv_display_set_flush_cb(lv_display_t * disp, lv_display_flush_cb_t flush_cb); - -/** - * Set a callback to be used while LVGL is waiting flushing to be finished. - * It can do any complex logic to wait, including semaphores, mutexes, polling flags, etc. - * If not set the `disp->flushing` flag is used which can be cleared with `lv_display_flush_ready()` - * @param disp pointer to a display - * @param wait_cb a callback to call while LVGL is waiting for flush ready. - * If NULL `lv_display_flush_ready()` can be used to signal that flushing is ready. - */ -void lv_display_set_flush_wait_cb(lv_display_t * disp, lv_display_flush_wait_cb_t wait_cb); - -/** - * Set the color format of the display. - * @param disp pointer to a display - * @param color_format Possible values are - * - LV_COLOR_FORMAT_RGB565 - * - LV_COLOR_FORMAT_RGB888 - * - LV_COLOR_FORMAT_XRGB888 - * - LV_COLOR_FORMAT_ARGB888 - *@note To change the endianness of the rendered image in case of RGB565 format - * (i.e. swap the 2 bytes) call `lv_draw_sw_rgb565_swap` in the flush_cb - */ -void lv_display_set_color_format(lv_display_t * disp, lv_color_format_t color_format); - -/** - * Get the color format of the display - * @param disp pointer to a display - * @return the color format - */ -lv_color_format_t lv_display_get_color_format(lv_display_t * disp); - -/** - * Enable anti-aliasing for the render engine - * @param disp pointer to a display - * @param en true/false - */ -void lv_display_set_antialiasing(lv_display_t * disp, bool en); - -/** - * Get if anti-aliasing is enabled for a display or not - * @param disp pointer to a display (NULL to use the default display) - * @return true/false - */ -bool lv_display_get_antialiasing(lv_display_t * disp); - -//! @cond Doxygen_Suppress - -/** - * Call from the display driver when the flushing is finished - * @param disp pointer to display whose `flush_cb` was called - */ -LV_ATTRIBUTE_FLUSH_READY void lv_display_flush_ready(lv_display_t * disp); - -/** - * Tell if it's the last area of the refreshing process. - * Can be called from `flush_cb` to execute some special display refreshing if needed when all areas area flushed. - * @param disp pointer to display - * @return true: it's the last area to flush; - * false: there are other areas too which will be refreshed soon - */ -LV_ATTRIBUTE_FLUSH_READY bool lv_display_flush_is_last(lv_display_t * disp); - -//! @endcond - -bool lv_display_is_double_buffered(lv_display_t * disp); - -/*--------------------- - * SCREENS - *--------------------*/ - -/** - * Return a pointer to the active screen on a display - * @param disp pointer to display which active screen should be get. - * (NULL to use the default screen) - * @return pointer to the active screen object (loaded by 'lv_screen_load()') - */ -lv_obj_t * lv_display_get_screen_active(lv_display_t * disp); - -/** - * Return with a pointer to the previous screen. Only used during screen transitions. - * @param disp pointer to display which previous screen should be get. - * (NULL to use the default screen) - * @return pointer to the previous screen object or NULL if not used now - */ -lv_obj_t * lv_display_get_screen_prev(lv_display_t * disp); - -/** - * Return the top layer. The top layer is the same on all screens and it is above the normal screen layer. - * @param disp pointer to display which top layer should be get. (NULL to use the default screen) - * @return pointer to the top layer object - */ -lv_obj_t * lv_display_get_layer_top(lv_display_t * disp); - -/** - * Return the sys. layer. The system layer is the same on all screen and it is above the normal screen and the top layer. - * @param disp pointer to display which sys. layer should be retrieved. (NULL to use the default screen) - * @return pointer to the sys layer object - */ -lv_obj_t * lv_display_get_layer_sys(lv_display_t * disp); - -/** - * Return the bottom layer. The bottom layer is the same on all screen and it is under the normal screen layer. - * It's visible only if the screen is transparent. - * @param disp pointer to display (NULL to use the default screen) - * @return pointer to the bottom layer object - */ -lv_obj_t * lv_display_get_layer_bottom(lv_display_t * disp); - -/** - * Load a screen on the default display - * @param scr pointer to a screen - */ -void lv_screen_load(struct lv_obj_t * scr); - -/** - * Switch screen with animation - * @param scr pointer to the new screen to load - * @param anim_type type of the animation from `lv_screen_load_anim_t`, e.g. `LV_SCR_LOAD_ANIM_MOVE_LEFT` - * @param time time of the animation - * @param delay delay before the transition - * @param auto_del true: automatically delete the old screen - */ -void lv_screen_load_anim(lv_obj_t * scr, lv_screen_load_anim_t anim_type, uint32_t time, uint32_t delay, - bool auto_del); - -/** - * Get the active screen of the default display - * @return pointer to the active screen - */ -lv_obj_t * lv_screen_active(void); - -/** - * Get the top layer of the default display - * @return pointer to the top layer - */ -lv_obj_t * lv_layer_top(void); - -/** - * Get the system layer of the default display - * @return pointer to the sys layer - */ -lv_obj_t * lv_layer_sys(void); - -/** - * Get the bottom layer of the default display - * @return pointer to the bottom layer - */ -lv_obj_t * lv_layer_bottom(void); - -/*--------------------- - * OTHERS - *--------------------*/ - -/** - * Add an event handler to the display - * @param disp pointer to a display - * @param event_cb an event callback - * @param filter event code to react or `LV_EVENT_ALL` - * @param user_data optional user_data - */ -void lv_display_add_event_cb(lv_display_t * disp, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data); - -/** - * Get the number of event attached to a display - * @param disp pointer to a display - * @return number of events - */ -uint32_t lv_display_get_event_count(lv_display_t * disp); - -/** - * Get an event descriptor for an event - * @param disp pointer to a display - * @param index the index of the event - * @return the event descriptor - */ -lv_event_dsc_t * lv_display_get_event_dsc(lv_display_t * disp, uint32_t index); - -/** - * Remove an event - * @param disp pointer to a display - * @param index the index of the event to remove - * @return true: and event was removed; false: no event was removed - */ -bool lv_display_delete_event(lv_display_t * disp, uint32_t index); - -/** - * Remove an event_cb with user_data - * @param disp pointer to a display - * @param event_cb the event_cb of the event to remove - * @param user_data user_data - * @return the count of the event removed - */ -uint32_t lv_display_remove_event_cb_with_user_data(lv_display_t * disp, lv_event_cb_t event_cb, void * user_data); - -/** - * Send an event to a display - * @param disp pointer to a display - * @param code an event code. LV_EVENT_... - * @param param optional param - * @return LV_RESULT_OK: disp wasn't deleted in the event. - */ -lv_result_t lv_display_send_event(lv_display_t * disp, lv_event_code_t code, void * param); - -/** - * Set the theme of a display. If there are no user created widgets yet the screens' theme will be updated - * @param disp pointer to a display - * @param th pointer to a theme - */ -void lv_display_set_theme(lv_display_t * disp, lv_theme_t * th); - -/** - * Get the theme of a display - * @param disp pointer to a display - * @return the display's theme (can be NULL) - */ -lv_theme_t * lv_display_get_theme(lv_display_t * disp); - -/** - * Get elapsed time since last user activity on a display (e.g. click) - * @param disp pointer to a display (NULL to get the overall smallest inactivity) - * @return elapsed ticks (milliseconds) since the last activity - */ -uint32_t lv_display_get_inactive_time(const lv_display_t * disp); - -/** - * Manually trigger an activity on a display - * @param disp pointer to a display (NULL to use the default display) - */ -void lv_display_trigger_activity(lv_display_t * disp); - -/** - * Temporarily enable and disable the invalidation of the display. - * @param disp pointer to a display (NULL to use the default display) - * @param en true: enable invalidation; false: invalidation - */ -void lv_display_enable_invalidation(lv_display_t * disp, bool en); - -/** - * Get display invalidation is enabled. - * @param disp pointer to a display (NULL to use the default display) - * @return return true if invalidation is enabled - */ -bool lv_display_is_invalidation_enabled(lv_display_t * disp); - -/** - * Get a pointer to the screen refresher timer to - * modify its parameters with `lv_timer_...` functions. - * @param disp pointer to a display - * @return pointer to the display refresher timer. (NULL on error) - */ -lv_timer_t * lv_display_get_refr_timer(lv_display_t * disp); - -/** - * Delete screen refresher timer - * @param disp pointer to a display - */ -void lv_display_delete_refr_timer(lv_display_t * disp); - -void lv_display_set_user_data(lv_display_t * disp, void * user_data); -void lv_display_set_driver_data(lv_display_t * disp, void * driver_data); -void * lv_display_get_user_data(lv_display_t * disp); -void * lv_display_get_driver_data(lv_display_t * disp); -lv_draw_buf_t * lv_display_get_buf_active(lv_display_t * disp); - -/** - * Rotate an area in-place according to the display's rotation - * @param disp pointer to a display - * @param area pointer to an area to rotate - */ -void lv_display_rotate_area(lv_display_t * disp, lv_area_t * area); - -/********************** - * MACROS - **********************/ - -/*------------------------------------------------ - * To improve backward compatibility - * Recommended only if you have one display - *------------------------------------------------*/ - -#ifndef LV_HOR_RES -/** - * The horizontal resolution of the currently active display. - */ -#define LV_HOR_RES lv_display_get_horizontal_resolution(lv_display_get_default()) -#endif - -#ifndef LV_VER_RES -/** - * The vertical resolution of the currently active display. - */ -#define LV_VER_RES lv_display_get_vertical_resolution(lv_display_get_default()) -#endif - -/** - * Same as Android's DIP. (Different name is chosen to avoid mistype between LV_DPI and LV_DIP) - * 1 dip is 1 px on a 160 DPI screen - * 1 dip is 2 px on a 320 DPI screen - * https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp - */ -#define LV_DPX_CALC(dpi, n) ((n) == 0 ? 0 :LV_MAX((( (dpi) * (n) + 80) / 160), 1)) /*+80 for rounding*/ -#define LV_DPX(n) LV_DPX_CALC(lv_display_get_dpi(NULL), n) - -/** - * Scale the given number of pixels (a distance or size) relative to a 160 DPI display - * considering the DPI of the default display. - * It ensures that e.g. `lv_dpx(100)` will have the same physical size regardless to the - * DPI of the display. - * @param n the number of pixels to scale - * @return `n x current_dpi/160` - */ -int32_t lv_dpx(int32_t n); - -/** - * Scale the given number of pixels (a distance or size) relative to a 160 DPI display - * considering the DPI of the given display. - * It ensures that e.g. `lv_dpx(100)` will have the same physical size regardless to the - * DPI of the display. - * @param disp a display whose dpi should be considered - * @param n the number of pixels to scale - * @return `n x current_dpi/160` - */ -int32_t lv_display_dpx(const lv_display_t * disp, int32_t n); - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DISPLAY_H*/ diff --git a/L3_Middlewares/LVGL/src/display/lv_display_private.h b/L3_Middlewares/LVGL/src/display/lv_display_private.h deleted file mode 100644 index 7dc9f18..0000000 --- a/L3_Middlewares/LVGL/src/display/lv_display_private.h +++ /dev/null @@ -1,181 +0,0 @@ -/** - * @file lv_display_private.h - * - */ - -#ifndef LV_DISPLAY_PRIVATE_H -#define LV_DISPLAY_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../misc/lv_types.h" -#include "../core/lv_obj.h" -#include "../draw/lv_draw.h" -#include "lv_display.h" - -#if LV_USE_SYSMON -#include "../others/sysmon/lv_sysmon_private.h" -#endif - -/********************* - * DEFINES - *********************/ -#ifndef LV_INV_BUF_SIZE -#define LV_INV_BUF_SIZE 32 /**< Buffer size for invalid areas */ -#endif - -/********************** - * TYPEDEFS - **********************/ - -struct lv_display_t { - - /*--------------------- - * Resolution - *--------------------*/ - - /** Horizontal resolution.*/ - int32_t hor_res; - - /** Vertical resolution.*/ - int32_t ver_res; - - /** Horizontal resolution of the full / physical display. Set to -1 for fullscreen mode.*/ - int32_t physical_hor_res; - - /** Vertical resolution of the full / physical display. Set to -1 for fullscreen mode.*/ - int32_t physical_ver_res; - - /** Horizontal offset from the full / physical display. Set to 0 for fullscreen mode.*/ - int32_t offset_x; - - /** Vertical offset from the full / physical display. Set to 0 for fullscreen mode.*/ - int32_t offset_y; - - /** DPI (dot per inch) of the display. Default value is `LV_DPI_DEF`.*/ - uint32_t dpi; - - /*--------------------- - * Buffering - *--------------------*/ - lv_draw_buf_t * buf_1; - lv_draw_buf_t * buf_2; - - /** Internal, used by the library*/ - lv_draw_buf_t * buf_act; - - /** MANDATORY: Write the internal buffer (draw_buf) to the display. 'lv_display_flush_ready()' has to be - * called when finished*/ - lv_display_flush_cb_t flush_cb; - - /** - * Used to wait while flushing is ready. - * It can do any complex logic to wait, including semaphores, mutexes, polling flags, etc. - * If not set `flushing` flag is used which can be cleared with `lv_display_flush_ready()` */ - lv_display_flush_wait_cb_t flush_wait_cb; - - /** 1: flushing is in progress. (It can't be a bit field because when it's cleared from IRQ - * Read-Modify-Write issue might occur) */ - volatile int flushing; - - /** 1: It was the last chunk to flush. (It can't be a bit field because when it's cleared - * from IRQ Read-Modify-Write issue might occur) */ - volatile int flushing_last; - volatile uint32_t last_area : 1; /**< 1: last area is being rendered */ - volatile uint32_t last_part : 1; /**< 1: last part of the current area is being rendered */ - - lv_display_render_mode_t render_mode; - uint32_t antialiasing : 1; /**< 1: anti-aliasing is enabled on this display.*/ - - /** 1: The current screen rendering is in progress*/ - uint32_t rendering_in_progress : 1; - - lv_color_format_t color_format; - - /** Invalidated (marked to redraw) areas*/ - lv_area_t inv_areas[LV_INV_BUF_SIZE]; - uint8_t inv_area_joined[LV_INV_BUF_SIZE]; - uint32_t inv_p; - int32_t inv_en_cnt; - - /** Double buffer sync areas (redrawn during last refresh) */ - lv_ll_t sync_areas; - - lv_draw_buf_t _static_buf1; /**< Used when user pass in a raw buffer as display draw buffer */ - lv_draw_buf_t _static_buf2; - /*--------------------- - * Layer - *--------------------*/ - lv_layer_t * layer_head; - void (*layer_init)(lv_display_t * disp, lv_layer_t * layer); - void (*layer_deinit)(lv_display_t * disp, lv_layer_t * layer); - - /*--------------------- - * Screens - *--------------------*/ - - /** Screens of the display*/ - lv_obj_t ** screens; /**< Array of screen objects.*/ - lv_obj_t * sys_layer; /**< @see lv_display_get_layer_sys*/ - lv_obj_t * top_layer; /**< @see lv_display_get_layer_top*/ - lv_obj_t * act_scr; /**< Currently active screen on this display*/ - lv_obj_t * bottom_layer;/**< @see lv_display_get_layer_bottom*/ - lv_obj_t * prev_scr; /**< Previous screen. Used during screen animations*/ - lv_obj_t * scr_to_load; /**< The screen prepared to load in lv_screen_load_anim*/ - uint32_t screen_cnt; - uint8_t draw_prev_over_act : 1;/** 1: Draw previous screen over active screen*/ - uint8_t del_prev : 1; /** 1: Automatically delete the previous screen when the screen load animation is ready*/ - - /*--------------------- - * Others - *--------------------*/ - - void * driver_data; /**< Custom user data*/ - - void * user_data; /**< Custom user data*/ - - lv_event_list_t event_list; - - uint32_t rotation : 3; /**< Element of lv_display_rotation_t*/ - - lv_theme_t * theme; /**< The theme assigned to the screen*/ - - /** A timer which periodically checks the dirty areas and refreshes them*/ - lv_timer_t * refr_timer; - - /*Miscellaneous data*/ - uint32_t last_activity_time; /**< Last time when there was activity on this display*/ - - /** The area being refreshed*/ - lv_area_t refreshed_area; - -#if LV_USE_PERF_MONITOR - lv_obj_t * perf_label; - lv_sysmon_backend_data_t perf_sysmon_backend; - lv_sysmon_perf_info_t perf_sysmon_info; -#endif - -#if LV_USE_MEM_MONITOR - lv_obj_t * mem_label; -#endif - -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DISPLAY_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/arm2d/lv_draw_arm2d.mk b/L3_Middlewares/LVGL/src/draw/arm2d/lv_draw_arm2d.mk new file mode 100644 index 0000000..17219b0 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/arm2d/lv_draw_arm2d.mk @@ -0,0 +1,6 @@ +CSRCS += lv_gpu_arm2d.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/arm2d +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/arm2d + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/arm2d" diff --git a/L3_Middlewares/LVGL/src/draw/arm2d/lv_gpu_arm2d.c b/L3_Middlewares/LVGL/src/draw/arm2d/lv_gpu_arm2d.c new file mode 100644 index 0000000..cc1ef60 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/arm2d/lv_gpu_arm2d.c @@ -0,0 +1,1574 @@ +/** + * @file lv_gpu_arm2d.c + * + */ + +/* + * Copyright (C) 2010-2023 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. + */ + +/********************* + * INCLUDES + *********************/ +#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" + #pragma clang diagnostic ignored "-Wdisabled-macro-expansion" + #pragma clang diagnostic ignored "-Wunused-variable" + #pragma clang diagnostic ignored "-Wunused-but-set-variable" + #pragma clang diagnostic ignored "-Wint-conversion" +#endif + + +#include "lv_gpu_arm2d.h" +#include "../../core/lv_refr.h" + +#if LV_USE_GPU_ARM2D +#define __ARM_2D_IMPL__ +#include "arm_2d.h" +#include "__arm_2d_impl.h" + + +#if 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 + +/********************* + * DEFINES + *********************/ +#if ( !defined(__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__) \ + || !__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__) \ +&& LV_COLOR_DEPTH == 32 \ +&& !defined(__ARM_2D_LVGL_CFG_NO_WARNING__) +#warning Please set macro __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ to 1 to get more acceleration opportunities. Or you can define macro __ARM_2D_LVGL_CFG_NO_WARNING__ to suppress this warning. +#endif + +#define MAX_BUF_SIZE (uint32_t) lv_disp_get_hor_res(_lv_refr_get_disp_refreshing()) + +#if LV_COLOR_DEPTH == 16 +#define arm_2d_fill_colour arm_2d_rgb16_fill_colour +#define arm_2d_fill_colour_with_alpha arm_2d_rgb565_fill_colour_with_alpha +#define arm_2d_fill_colour_with_mask arm_2d_rgb565_fill_colour_with_mask +#define arm_2d_fill_colour_with_mask_and_opacity \ + arm_2d_rgb565_fill_colour_with_mask_and_opacity +#define arm_2d_tile_copy arm_2d_rgb16_tile_copy +#define arm_2d_alpha_blending arm_2d_rgb565_alpha_blending +#define arm_2d_tile_copy_with_src_mask arm_2d_rgb565_tile_copy_with_src_mask +#define arm_2d_color_t arm_2d_color_rgb565_t + +/* arm-2d direct mode apis */ +#define __arm_2d_impl_colour_filling __arm_2d_impl_rgb16_colour_filling +#define __arm_2d_impl_colour_filling_with_opacity \ + __arm_2d_impl_rgb565_colour_filling_with_opacity +#define __arm_2d_impl_colour_filling_mask \ + __arm_2d_impl_rgb565_colour_filling_mask +#define __arm_2d_impl_colour_filling_mask_opacity \ + __arm_2d_impl_rgb565_colour_filling_mask_opacity +#define __arm_2d_impl_copy __arm_2d_impl_rgb16_copy +#define __arm_2d_impl_alpha_blending __arm_2d_impl_rgb565_alpha_blending +#define __arm_2d_impl_src_msk_copy __arm_2d_impl_rgb565_src_msk_copy +#define __arm_2d_impl_src_chn_msk_copy __arm_2d_impl_rgb565_src_chn_msk_copy +#define __arm_2d_impl_cl_key_copy __arm_2d_impl_rgb16_cl_key_copy +#define __arm_2d_impl_alpha_blending_colour_keying \ + __arm_2d_impl_rgb565_alpha_blending_colour_keying +#define arm_2d_tile_transform_with_src_mask_and_opacity_prepare \ + arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare +#define arm_2d_tile_transform_with_opacity_prepare \ + arm_2dp_rgb565_tile_transform_with_opacity_prepare +#define arm_2d_tile_transform_only_with_opacity_prepare \ + arm_2dp_rgb565_tile_transform_only_with_opacity_prepare +#define arm_2d_tile_transform_prepare \ + arm_2dp_rgb565_tile_transform_prepare + +#define __ARM_2D_PIXEL_BLENDING_OPA __ARM_2D_PIXEL_BLENDING_OPA_RGB565 + +#define color_int uint16_t + +#elif LV_COLOR_DEPTH == 32 +#define arm_2d_fill_colour arm_2d_rgb32_fill_colour +#define arm_2d_fill_colour_with_alpha arm_2d_cccn888_fill_colour_with_alpha +#define arm_2d_fill_colour_with_mask arm_2d_cccn888_fill_colour_with_mask +#define arm_2d_fill_colour_with_mask_and_opacity \ + arm_2d_cccn888_fill_colour_with_mask_and_opacity +#define arm_2d_tile_copy arm_2d_rgb32_tile_copy +#define arm_2d_alpha_blending arm_2d_cccn888_alpha_blending +#define arm_2d_tile_copy_with_src_mask arm_2d_cccn888_tile_copy_with_src_mask +#define arm_2d_color_t arm_2d_color_cccn888_t + +/* arm-2d direct mode apis */ +#define __arm_2d_impl_colour_filling __arm_2d_impl_rgb32_colour_filling +#define __arm_2d_impl_colour_filling_with_opacity \ + __arm_2d_impl_cccn888_colour_filling_with_opacity +#define __arm_2d_impl_colour_filling_mask \ + __arm_2d_impl_cccn888_colour_filling_mask +#define __arm_2d_impl_colour_filling_mask_opacity \ + __arm_2d_impl_cccn888_colour_filling_mask_opacity +#define __arm_2d_impl_copy __arm_2d_impl_rgb32_copy +#define __arm_2d_impl_alpha_blending __arm_2d_impl_cccn888_alpha_blending +#define __arm_2d_impl_src_msk_copy __arm_2d_impl_cccn888_src_msk_copy +#define __arm_2d_impl_src_chn_msk_copy __arm_2d_impl_cccn888_src_chn_msk_copy +#define __arm_2d_impl_cl_key_copy __arm_2d_impl_rgb32_cl_key_copy +#define __arm_2d_impl_alpha_blending_colour_keying \ + __arm_2d_impl_cccn888_alpha_blending_colour_keying +#define arm_2d_tile_transform_with_src_mask_and_opacity_prepare \ + arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare +#define arm_2d_tile_transform_with_opacity_prepare \ + arm_2dp_cccn888_tile_transform_with_opacity_prepare +#define arm_2d_tile_transform_only_with_opacity_prepare \ + arm_2dp_cccn888_tile_transform_only_with_opacity_prepare +#define arm_2d_tile_transform_prepare \ + arm_2dp_cccn888_tile_transform_prepare + +#define __ARM_2D_PIXEL_BLENDING_OPA __ARM_2D_PIXEL_BLENDING_OPA_CCCN888 + +#define color_int uint32_t + +#else +#error The specified LV_COLOR_DEPTH is not supported by this version of lv_gpu_arm2d.c. +#endif + +/* *INDENT-OFF* */ +#define __PREPARE_LL_ACCELERATION__() \ + int32_t src_stride = lv_area_get_width(coords); \ + \ + uint8_t px_size_byte = cf == LV_IMG_CF_TRUE_COLOR_ALPHA \ + ? LV_IMG_PX_SIZE_ALPHA_BYTE \ + : sizeof(lv_color_t); \ + \ + const uint8_t * src_buf_tmp = src_buf; \ + src_buf_tmp += src_stride \ + * (draw_area.y1 - coords->y1) \ + * px_size_byte; \ + src_buf_tmp += (draw_area.x1 - coords->x1) * px_size_byte; \ + \ + lv_area_t blend_area2; \ + if(!_lv_area_intersect(&blend_area2, \ + &draw_area, \ + draw_ctx->clip_area)) return; \ + \ + int32_t w = lv_area_get_width(&blend_area2); \ + int32_t h = lv_area_get_height(&blend_area2); \ + \ + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); \ + \ + lv_color_t * dest_buf = draw_ctx->buf; \ + dest_buf += dest_stride * (blend_area2.y1 - draw_ctx->buf_area->y1) \ + + (blend_area2.x1 - draw_ctx->buf_area->x1); \ + \ + arm_2d_size_t copy_size = { \ + .iWidth = lv_area_get_width(&blend_area2), \ + .iHeight = lv_area_get_height(&blend_area2), \ + } + +#define __PREPARE_TARGET_TILE__(__blend_area) \ + static arm_2d_tile_t target_tile; \ + static arm_2d_region_t target_region; \ + \ + lv_color_t * dest_buf = draw_ctx->buf; \ + \ + target_tile = (arm_2d_tile_t) { \ + .tRegion = { \ + .tSize = { \ + .iWidth = lv_area_get_width(draw_ctx->buf_area), \ + .iHeight = lv_area_get_height(draw_ctx->buf_area), \ + }, \ + }, \ + .tInfo.bIsRoot = true, \ + .phwBuffer = (uint16_t *)draw_ctx->buf, \ + }; \ + \ + target_region = (arm_2d_region_t) { \ + .tLocation = { \ + .iX = (__blend_area).x1 - draw_ctx->buf_area->x1, \ + .iY = (__blend_area).y1 - draw_ctx->buf_area->y1, \ + }, \ + .tSize = { \ + .iWidth = lv_area_get_width(&(__blend_area)), \ + .iHeight = lv_area_get_height(&(__blend_area)), \ + }, \ + } + +#define __PREPARE_SOURCE_TILE__(__dsc, __blend_area) \ + static arm_2d_tile_t source_tile_orig; \ + static arm_2d_tile_t source_tile; \ + const lv_color_t * src_buf = (__dsc)->src_buf; \ + if (src_buf) { \ + source_tile_orig = (arm_2d_tile_t) { \ + .tRegion = { \ + .tSize = { \ + .iWidth = lv_area_get_width((__dsc)->blend_area), \ + .iHeight = lv_area_get_height((__dsc)->blend_area), \ + }, \ + }, \ + .tInfo.bIsRoot = true, \ + .phwBuffer = (uint16_t *)src_buf, \ + }; \ + \ + arm_2d_tile_generate_child( \ + &source_tile_orig, \ + (arm_2d_region_t []) { \ + { \ + .tLocation = { \ + .iX = (__blend_area).x1 - (__dsc)->blend_area->x1, \ + .iY = (__blend_area).y1 - (__dsc)->blend_area->y1, \ + }, \ + .tSize = source_tile_orig.tRegion.tSize, \ + } \ + }, \ + &source_tile, \ + false); \ + source_tile.tInfo.bDerivedResource = true; \ + } + +#define __PREPARE_MASK_TILE__(__dsc, __blend_area, __mask, __is_chn) \ + static arm_2d_tile_t mask_tile_orig; \ + static arm_2d_tile_t mask_tile; \ + if(NULL != (__mask)) { \ + mask_tile_orig = (arm_2d_tile_t) { \ + .tRegion = { \ + .tSize = { \ + .iWidth = lv_area_get_width((__dsc)->mask_area), \ + .iHeight = lv_area_get_height((__dsc)->mask_area), \ + }, \ + }, \ + .tInfo = { \ + .bIsRoot = true, \ + .bHasEnforcedColour = true, \ + .tColourInfo = { \ + .chScheme = (__is_chn) ? ARM_2D_CHANNEL_8in32 \ + : ARM_2D_COLOUR_8BIT, \ + }, \ + }, \ + .pchBuffer = ((uint8_t *)(__mask)) + (__is_chn) ? 3 : 0, \ + }; \ + \ + arm_2d_tile_generate_child( \ + &mask_tile_orig, \ + (arm_2d_region_t []) { \ + { \ + .tLocation = { \ + .iX = (__dsc)->mask_area->x1 - (__blend_area).x1, \ + .iY = (__dsc)->mask_area->y1 - (__blend_area).y1, \ + }, \ + .tSize = mask_tile_orig.tRegion.tSize, \ + } \ + }, \ + &mask_tile, \ + false); \ + mask_tile.tInfo.bDerivedResource = true; \ + } +/* *INDENT-ON* */ + +/* *INDENT-OFF* */ +#define __RECOLOUR_WRAPPER(...) \ + do { \ + lv_color_t *rgb_tmp_buf = NULL; \ + if(draw_dsc->recolor_opa > LV_OPA_MIN) { \ + rgb_tmp_buf \ + = lv_mem_buf_get(src_w * src_h * sizeof(lv_color_t)); \ + if (NULL == rgb_tmp_buf) { \ + LV_LOG_WARN( \ + "Failed to allocate memory for accelerating recolour, " \ + "use normal route instead."); \ + break; \ + } \ + lv_memcpy(rgb_tmp_buf, src_buf, src_w * src_h * sizeof(lv_color_t));\ + arm_2d_size_t copy_size = { \ + .iWidth = src_w, \ + .iHeight = src_h, \ + }; \ + /* apply re-colour */ \ + __arm_2d_impl_colour_filling_with_opacity( \ + (color_int *)rgb_tmp_buf, \ + src_w, \ + ©_size, \ + (color_int)draw_dsc->recolor.full, \ + draw_dsc->recolor_opa); \ + \ + /* replace src_buf for the following operation */ \ + src_buf = (const uint8_t *)rgb_tmp_buf; \ + } \ + do { \ + __VA_ARGS__ \ + } while(0); \ + if (NULL != rgb_tmp_buf) { \ + lv_mem_buf_release(rgb_tmp_buf); \ + } \ + } while(0); \ + src_buf = src_buf_org; + +#define __RECOLOUR_BEGIN() \ + do { \ + lv_color_t *rgb_tmp_buf = NULL; \ + if(draw_dsc->recolor_opa > LV_OPA_MIN) { \ + rgb_tmp_buf \ + = lv_mem_buf_get(src_w * src_h * sizeof(lv_color_t)); \ + if (NULL == rgb_tmp_buf) { \ + LV_LOG_WARN( \ + "Failed to allocate memory for accelerating recolour, " \ + "use normal route instead."); \ + break; \ + } \ + lv_memcpy(rgb_tmp_buf, src_buf, src_w * src_h * sizeof(lv_color_t));\ + arm_2d_size_t copy_size = { \ + .iWidth = src_w, \ + .iHeight = src_h, \ + }; \ + /* apply re-colour */ \ + __arm_2d_impl_colour_filling_with_opacity( \ + (color_int *)rgb_tmp_buf, \ + src_w, \ + ©_size, \ + (color_int)draw_dsc->recolor.full, \ + draw_dsc->recolor_opa); \ + \ + /* replace src_buf for the following operation */ \ + src_buf = (const uint8_t *)rgb_tmp_buf; \ + } \ + do { + +#define __RECOLOUR_END() \ + } while(0); \ + if (NULL != rgb_tmp_buf) { \ + lv_mem_buf_release(rgb_tmp_buf); \ + } \ + } while(0); \ + src_buf = src_buf_org; + +#define __ARM_2D_PREPARE_TRANS_AND_TARGET_REGION(__TRANS_PREPARE, ...) \ + do { \ + __TRANS_PREPARE( \ + NULL, \ + __VA_ARGS__); \ + \ + target_region = (arm_2d_region_t) { \ + .tLocation = { \ + .iX = coords->x1 - draw_ctx->clip_area->x1, \ + .iY = coords->y1 - draw_ctx->clip_area->y1, \ + }, \ + .tSize = { \ + .iWidth = lv_area_get_width(coords), \ + .iHeight = lv_area_get_height(coords), \ + }, \ + }; \ + \ + arm_2d_size_t tTransSize \ + = ARM_2D_CTRL.DefaultOP \ + .tTransform.Source.ptTile->tRegion.tSize; \ + \ + if (target_region.tSize.iWidth < tTransSize.iWidth) { \ + int16_t iDelta = tTransSize.iWidth - target_region.tSize.iWidth;\ + target_region.tLocation.iX -= iDelta / 2; \ + target_region.tSize.iWidth = tTransSize.iWidth; \ + } \ + \ + if (target_region.tSize.iHeight < tTransSize.iHeight) { \ + int16_t iDelta \ + = tTransSize.iHeight - target_region.tSize.iHeight; \ + target_region.tLocation.iY -= iDelta / 2; \ + target_region.tSize.iHeight = tTransSize.iHeight; \ + } \ + } while(0) + +/* *INDENT-ON* */ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +#if __ARM_2D_HAS_HW_ACC__ +static bool /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile, + const arm_2d_region_t * region, + lv_color_t color, + lv_opa_t opa, + const arm_2d_tile_t * mask_tile); + +static bool /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_tile_copy(const arm_2d_tile_t * target_tile, + const arm_2d_region_t * region, + arm_2d_tile_t * source_tile, + lv_opa_t opa, + arm_2d_tile_t * mask_tile); +#else + +static void convert_cb(const lv_area_t * dest_area, + const void * src_buf, + lv_coord_t src_w, + lv_coord_t src_h, + lv_coord_t src_stride, + const lv_draw_img_dsc_t * draw_dsc, + lv_img_cf_t cf, + lv_color_t * cbuf, + lv_opa_t * abuf); + +static bool /* LV_ATTRIBUTE_FAST_MEM */ arm_2d_fill_normal(lv_color_t * dest_buf, + const lv_area_t * dest_area, + lv_coord_t dest_stride, + lv_color_t color, + lv_opa_t opa, + const lv_opa_t * mask, + lv_coord_t mask_stride); + +static bool /* LV_ATTRIBUTE_FAST_MEM */ arm_2d_copy_normal(lv_color_t * dest_buf, + const lv_area_t * dest_area, + lv_coord_t dest_stride, + const lv_color_t * src_buf, + lv_coord_t src_stride, + lv_opa_t opa, + const lv_opa_t * mask, + lv_coord_t mask_stride); +#endif + +static void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, + const lv_draw_sw_blend_dsc_t * dsc); +static void /* LV_ATTRIBUTE_FAST_MEM */ lv_gpu_arm2d_wait_cb(lv_draw_ctx_t * draw_ctx); +static void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx, + const lv_draw_img_dsc_t * draw_dsc, + const lv_area_t * coords, + const uint8_t * src_buf, + lv_img_cf_t cf); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_draw_arm2d_ctx_init(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) +{ + arm_2d_init(); + + lv_draw_sw_init_ctx(drv, draw_ctx); + + lv_draw_arm2d_ctx_t * arm2d_draw_ctx = (lv_draw_sw_ctx_t *)draw_ctx; + + arm2d_draw_ctx->blend = lv_draw_arm2d_blend; + arm2d_draw_ctx->base_draw.wait_for_finish = lv_gpu_arm2d_wait_cb; + +#if !__ARM_2D_HAS_HW_ACC__ + arm2d_draw_ctx->base_draw.draw_img_decoded = lv_draw_arm2d_img_decoded; +#endif + +} + +void lv_draw_arm2d_ctx_deinit(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) +{ + LV_UNUSED(drv); + LV_UNUSED(draw_ctx); +} + +extern void test_flush(lv_color_t * color_p); + +#if __ARM_2D_HAS_HW_ACC__ +static void LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, + const lv_draw_sw_blend_dsc_t * dsc) +{ + const lv_opa_t * mask; + if(dsc->mask_buf == NULL) mask = NULL; + if(dsc->mask_buf && dsc->mask_res == LV_DRAW_MASK_RES_TRANSP) return; + else if(dsc->mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask = NULL; + else mask = dsc->mask_buf; + + + lv_area_t blend_area; + if(!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area)) { + return; + } + + bool is_accelerated = false; + + if(dsc->blend_mode == LV_BLEND_MODE_NORMAL + && lv_area_get_size(&blend_area) > 100) { + + __PREPARE_TARGET_TILE__(blend_area); + __PREPARE_SOURCE_TILE__(dsc, blend_area); + __PREPARE_MASK_TILE__(dsc, blend_area, mask, false); + + if(src_buf) { + is_accelerated = lv_draw_arm2d_tile_copy( + &target_tile, + &target_region, + &source_tile, + dsc->opa, + (NULL == mask) ? NULL : &mask_tile); + } + else { + is_accelerated = lv_draw_arm2d_fill_colour( + &target_tile, + &target_region, + dsc->color, + dsc->opa, + (NULL == mask) ? NULL : &mask_tile); + } + } + + if(!is_accelerated) { + lv_draw_sw_blend_basic(draw_ctx, dsc); + } +} + + +static bool LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile, + const arm_2d_region_t * region, + lv_color_t color, + lv_opa_t opa, + const arm_2d_tile_t * mask_tile) +{ + arm_fsm_rt_t result = (arm_fsm_rt_t)ARM_2D_ERR_NONE; + + if(NULL == mask_tile) { + if(opa >= LV_OPA_MAX) { + result = arm_2d_fill_colour(target_tile, region, color.full); + } + else { +#if LV_COLOR_SCREEN_TRANSP + return false; +#else + result = arm_2d_fill_colour_with_alpha( + target_tile, + region, + (arm_2d_color_t) { + color.full + }, + opa); +#endif + } + } + else { + + if(opa >= LV_OPA_MAX) { + result = arm_2d_fill_colour_with_mask( + target_tile, + region, + mask_tile, + (arm_2d_color_t) { + color.full + }); + } + else { +#if LV_COLOR_SCREEN_TRANSP + return false; +#else + result = arm_2d_fill_colour_with_mask_and_opacity( + target_tile, + region, + mask_tile, + (arm_2d_color_t) { + color.full + }, + opa); +#endif + } + } + + if(result < 0) { + /* error detected */ + return false; + } + + return true; + +} + +static bool LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_tile_copy(const arm_2d_tile_t * target_tile, + const arm_2d_region_t * region, + arm_2d_tile_t * source_tile, + lv_opa_t opa, + arm_2d_tile_t * mask_tile) +{ + arm_fsm_rt_t result = (arm_fsm_rt_t)ARM_2D_ERR_NONE; + + if(NULL == mask_tile) { + if(opa >= LV_OPA_MAX) { + result = arm_2d_tile_copy(source_tile, + target_tile, + region, + ARM_2D_CP_MODE_COPY); + } +#if LV_COLOR_SCREEN_TRANSP + else { + return false; /* not supported */ + } +#else + else { + result = arm_2d_alpha_blending(source_tile, + target_tile, + region, + opa); + } +#endif + } + else { +#if LV_COLOR_SCREEN_TRANSP + return false; /* not support */ +#else + + if(opa >= LV_OPA_MAX) { + result = arm_2d_tile_copy_with_src_mask(source_tile, + mask_tile, + target_tile, + region, + ARM_2D_CP_MODE_COPY); + } + else { + return false; + } +#endif + } + + if(result < 0) { + /* error detected */ + return false; + } + + return true; +} + +static void lv_gpu_arm2d_wait_cb(lv_draw_ctx_t * draw_ctx) +{ + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + + arm_2d_op_wait_async(NULL); + if(disp->driver && disp->driver->wait_cb) { + disp->driver->wait_cb(disp->driver); + } + lv_draw_sw_wait_for_finish(draw_ctx); +} +#else + + +static void LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, + const lv_draw_sw_blend_dsc_t * dsc) +{ + const lv_opa_t * mask; + if(dsc->mask_buf == NULL) mask = NULL; + if(dsc->mask_buf && dsc->mask_res == LV_DRAW_MASK_RES_TRANSP) return; + else if(dsc->mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask = NULL; + else mask = dsc->mask_buf; + + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); + + lv_area_t blend_area; + if(!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area)) return; + + //lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + + bool is_accelerated = false; + do { + + /* target buffer */ + lv_color_t * dest_buf = draw_ctx->buf; + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + if(disp->driver->screen_transp == 0) { + dest_buf += dest_stride * (blend_area.y1 - draw_ctx->buf_area->y1) + (blend_area.x1 - draw_ctx->buf_area->x1); + } + else { + /*With LV_COLOR_DEPTH 16 it means ARGB8565 (3 bytes format)*/ + uint8_t * dest_buf8 = (uint8_t *) dest_buf; + dest_buf8 += dest_stride * (blend_area.y1 - draw_ctx->buf_area->y1) * LV_IMG_PX_SIZE_ALPHA_BYTE; + dest_buf8 += (blend_area.x1 - draw_ctx->buf_area->x1) * LV_IMG_PX_SIZE_ALPHA_BYTE; + dest_buf = (lv_color_t *)dest_buf8; + } + + /* source buffer */ + const lv_color_t * src_buf = dsc->src_buf; + lv_coord_t src_stride; + if(src_buf) { + src_stride = lv_area_get_width(dsc->blend_area); + src_buf += src_stride * (blend_area.y1 - dsc->blend_area->y1) + (blend_area.x1 - dsc->blend_area->x1); + } + else { + src_stride = 0; + } + + lv_coord_t mask_stride; + if(mask) { + mask_stride = lv_area_get_width(dsc->mask_area); + mask += mask_stride * (blend_area.y1 - dsc->mask_area->y1) + (blend_area.x1 - dsc->mask_area->x1); + } + else { + mask_stride = 0; + } + + lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + + if(disp->driver->screen_transp) { + break; + } + if(dsc->src_buf == NULL) { + if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { + is_accelerated = arm_2d_fill_normal(dest_buf, + &blend_area, + dest_stride, + dsc->color, + dsc->opa, + mask, + mask_stride); + } + } + else { + if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { + is_accelerated = arm_2d_copy_normal(dest_buf, + &blend_area, + dest_stride, + src_buf, + src_stride, + dsc->opa, + mask, + mask_stride); + } + } + } while(0); + + if(!is_accelerated) lv_draw_sw_blend_basic(draw_ctx, dsc); +} + +static bool LV_ATTRIBUTE_FAST_MEM arm_2d_fill_normal(lv_color_t * dest_buf, + const lv_area_t * dest_area, + lv_coord_t dest_stride, + lv_color_t color, + lv_opa_t opa, + const lv_opa_t * mask, + lv_coord_t mask_stride) +{ + arm_2d_size_t target_size = { + .iWidth = lv_area_get_width(dest_area), + .iHeight = lv_area_get_height(dest_area), + }; + + /*No mask*/ + if(mask == NULL) { + if(opa >= LV_OPA_MAX) { + __arm_2d_impl_colour_filling((color_int *)dest_buf, + dest_stride, + &target_size, + color.full); + } + /*Has opacity*/ + else { + __arm_2d_impl_colour_filling_with_opacity((color_int *)dest_buf, + dest_stride, + &target_size, + color.full, + opa); + } + } + /*Masked*/ + else { + /*Only the mask matters*/ + if(opa >= LV_OPA_MAX) { + __arm_2d_impl_colour_filling_mask((color_int *)dest_buf, + dest_stride, + (uint8_t *)mask, + mask_stride, + &target_size, + color.full); + } + /*With opacity*/ + else { + __arm_2d_impl_colour_filling_mask_opacity((color_int *)dest_buf, + dest_stride, + (uint8_t *)mask, + mask_stride, + &target_size, + color.full, + opa); + } + } + + return true; +} + + +static bool LV_ATTRIBUTE_FAST_MEM arm_2d_copy_normal(lv_color_t * dest_buf, + const lv_area_t * dest_area, + lv_coord_t dest_stride, + const lv_color_t * src_buf, + lv_coord_t src_stride, + lv_opa_t opa, + const lv_opa_t * mask, + lv_coord_t mask_stride) + +{ + int32_t w = lv_area_get_width(dest_area); + int32_t h = lv_area_get_height(dest_area); + + arm_2d_size_t copy_size = { + .iWidth = lv_area_get_width(dest_area), + .iHeight = lv_area_get_height(dest_area), + }; + + /*Simple fill (maybe with opacity), no masking*/ + if(mask == NULL) { + if(opa >= LV_OPA_MAX) { + __arm_2d_impl_copy((color_int *)src_buf, + src_stride, + (color_int *)dest_buf, + dest_stride, + ©_size); + } + else { + __arm_2d_impl_alpha_blending((color_int *)src_buf, + src_stride, + (color_int *)dest_buf, + dest_stride, + ©_size, + opa); + } + } + /*Masked*/ + else { + /*Only the mask matters*/ + if(opa > LV_OPA_MAX) { + __arm_2d_impl_src_msk_copy((color_int *)src_buf, + src_stride, + (uint8_t *)mask, + mask_stride, + ©_size, + (color_int *)dest_buf, + dest_stride, + ©_size); + } + /*Handle opa and mask values too*/ + else { + __arm_2d_impl_gray8_alpha_blending((uint8_t *)mask, + mask_stride, + (uint8_t *)mask, + mask_stride, + ©_size, + opa); + + __arm_2d_impl_src_msk_copy((color_int *)src_buf, + src_stride, + (uint8_t *)mask, + mask_stride, + ©_size, + (color_int *)dest_buf, + dest_stride, + ©_size); + } + } + + return true; +} + +static void LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx, + const lv_draw_img_dsc_t * draw_dsc, + const lv_area_t * coords, + const uint8_t * src_buf, + lv_img_cf_t cf) +{ + /*Use the clip area as draw area*/ + lv_area_t draw_area; + lv_area_copy(&draw_area, draw_ctx->clip_area); + const uint8_t * src_buf_org = src_buf; + + bool mask_any = lv_draw_mask_is_any(&draw_area); + bool transform = draw_dsc->angle != 0 || draw_dsc->zoom != LV_IMG_ZOOM_NONE ? true : false; + + lv_area_t blend_area; + lv_draw_sw_blend_dsc_t blend_dsc; + + lv_memset_00(&blend_dsc, sizeof(lv_draw_sw_blend_dsc_t)); + blend_dsc.opa = draw_dsc->opa; + blend_dsc.blend_mode = draw_dsc->blend_mode; + blend_dsc.blend_area = &blend_area; + + if(lv_img_cf_is_chroma_keyed(cf)) cf = LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED; + else if(cf == LV_IMG_CF_ALPHA_8BIT) {} + else if(cf == LV_IMG_CF_RGB565A8) {} + else if(lv_img_cf_has_alpha(cf)) cf = LV_IMG_CF_TRUE_COLOR_ALPHA; + else cf = LV_IMG_CF_TRUE_COLOR; + + + /*The simplest case just copy the pixels into the draw_buf*/ + if(!mask_any && !transform && cf == LV_IMG_CF_TRUE_COLOR && draw_dsc->recolor_opa == LV_OPA_TRANSP) { + blend_dsc.src_buf = (const lv_color_t *)src_buf; + + blend_dsc.blend_area = coords; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + else if(!mask_any && !transform && cf == LV_IMG_CF_ALPHA_8BIT) { + lv_area_t clipped_coords; + if(!_lv_area_intersect(&clipped_coords, coords, draw_ctx->clip_area)) return; + + blend_dsc.mask_buf = (lv_opa_t *)src_buf; + blend_dsc.mask_area = coords; + blend_dsc.src_buf = NULL; + blend_dsc.color = draw_dsc->recolor; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + + blend_dsc.blend_area = coords; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } +#if LV_COLOR_DEPTH == 16 + else if(!mask_any && !transform && cf == LV_IMG_CF_RGB565A8 && draw_dsc->recolor_opa == LV_OPA_TRANSP && + blend_dsc.opa >= LV_OPA_MAX) { + lv_coord_t src_w = lv_area_get_width(coords); + lv_coord_t src_h = lv_area_get_height(coords); + blend_dsc.src_buf = (const lv_color_t *)src_buf; + blend_dsc.mask_buf = (lv_opa_t *)src_buf; + blend_dsc.mask_buf += sizeof(lv_color_t) * src_w * src_h; + blend_dsc.blend_area = coords; + blend_dsc.mask_area = coords; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } +#endif + /*In the other cases every pixel need to be checked one-by-one*/ + else { + blend_area.x1 = draw_ctx->clip_area->x1; + blend_area.x2 = draw_ctx->clip_area->x2; + blend_area.y1 = draw_ctx->clip_area->y1; + blend_area.y2 = draw_ctx->clip_area->y2; + + lv_coord_t src_w = lv_area_get_width(coords); + lv_coord_t src_h = lv_area_get_height(coords); + lv_coord_t blend_h = lv_area_get_height(&blend_area); + lv_coord_t blend_w = lv_area_get_width(&blend_area); + + uint32_t max_buf_size = MAX_BUF_SIZE; + uint32_t blend_size = lv_area_get_size(&blend_area); + uint32_t buf_h; + uint32_t buf_w = blend_w; + if(blend_size <= max_buf_size) { + buf_h = blend_h; + } + else { + /*Round to full lines*/ + buf_h = max_buf_size / blend_w; + } + + /*Create buffers and masks*/ + uint32_t buf_size = buf_w * buf_h; + + lv_color_t * rgb_buf = lv_mem_buf_get(buf_size * sizeof(lv_color_t)); + lv_opa_t * mask_buf = lv_mem_buf_get(buf_size); + blend_dsc.mask_buf = mask_buf; + blend_dsc.mask_area = &blend_area; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + blend_dsc.src_buf = rgb_buf; + lv_coord_t y_last = blend_area.y2; + blend_area.y2 = blend_area.y1 + buf_h - 1; + + lv_draw_mask_res_t mask_res_def = (cf != LV_IMG_CF_TRUE_COLOR || draw_dsc->angle || + draw_dsc->zoom != LV_IMG_ZOOM_NONE) ? + LV_DRAW_MASK_RES_CHANGED : LV_DRAW_MASK_RES_FULL_COVER; + blend_dsc.mask_res = mask_res_def; + + if(cf == LV_IMG_CF_ALPHA_8BIT) { + /* original code: + lv_color_fill(rgb_buf, draw_dsc->recolor, buf_size); + */ + arm_2d_size_t copy_size = { + .iWidth = buf_w, + .iHeight = buf_h, + }; + + /* apply re-colour */ + __arm_2d_impl_colour_filling( + (color_int *)rgb_buf, + buf_w, + ©_size, + (color_int)draw_dsc->recolor.full); + } + + bool is_accelerated = false; + + if(!transform) { + if(LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED == cf) { + /* copy with colour keying */ + + /* *INDENT-OFF* */ + __RECOLOUR_WRAPPER( + + lv_color_t chrome_key = LV_COLOR_CHROMA_KEY; + /* calculate new chrome-key colour */ + if(draw_dsc->recolor_opa > LV_OPA_MIN) { + __ARM_2D_PIXEL_BLENDING_OPA( + (color_int *) & (draw_dsc->recolor.full), + (color_int *) & (chrome_key.full), + draw_dsc->recolor_opa + ); + } + + __PREPARE_LL_ACCELERATION__(); + + if(blend_dsc.opa >= LV_OPA_MAX) { + __arm_2d_impl_cl_key_copy( + (color_int *)src_buf_tmp, + src_stride, + (color_int *)dest_buf, + dest_stride, + ©_size, + (color_int)chrome_key.full); + } + else { + __arm_2d_impl_alpha_blending_colour_keying( + (color_int *)src_buf_tmp, + src_stride, + (color_int *)dest_buf, + dest_stride, + ©_size, + blend_dsc.opa, + (color_int)chrome_key.full); + } + is_accelerated = true; + ) + /* *INDENT-ON* */ + } + else if((LV_COLOR_DEPTH == 32) + && !mask_any + && (LV_IMG_CF_TRUE_COLOR_ALPHA == cf)) { + /* accelerate copy-with-source-masks-and-opacity */ + + /* *INDENT-OFF* */ + __RECOLOUR_WRAPPER( + __PREPARE_LL_ACCELERATION__(); + + uint8_t * mask_temp_buf = NULL; + if(blend_dsc.opa < LV_OPA_MAX) { + mask_temp_buf = lv_mem_buf_get(copy_size.iHeight * copy_size.iWidth); + if(NULL == mask_temp_buf) { + LV_LOG_WARN( + "Failed to allocate memory for alpha mask," + " use normal route instead."); + break; + } + lv_memset_00(mask_temp_buf, copy_size.iHeight * copy_size.iWidth); + + __arm_2d_impl_gray8_colour_filling_channel_mask_opacity( + mask_temp_buf, + src_stride, + (uint32_t *) + ((uintptr_t)src_buf_tmp + LV_IMG_PX_SIZE_ALPHA_BYTE - 1), + src_stride, + ©_size, + 0xFF, + blend_dsc.opa); + + __arm_2d_impl_src_msk_copy( + (color_int *)src_buf_tmp, + src_stride, + mask_temp_buf, + src_stride, + ©_size, + (color_int *)dest_buf, + dest_stride, + ©_size); + + lv_mem_buf_release(mask_temp_buf); + } + else { + __arm_2d_impl_src_chn_msk_copy( + (color_int *)src_buf_tmp, + src_stride, + (uint32_t *) + ((uintptr_t)src_buf_tmp + LV_IMG_PX_SIZE_ALPHA_BYTE - 1), + src_stride, + ©_size, + (color_int *)dest_buf, + dest_stride, + ©_size); + } + + is_accelerated = true; + ) + /* *INDENT-ON* */ + } + else if(!mask_any + && (LV_IMG_CF_RGB565A8 == cf)) { + /* accelerate copy-with-source-masks-and-opacity */ + + uint8_t * mask_after_rgb = src_buf + sizeof(lv_color_t) * src_w * src_h; + /* *INDENT-OFF* */ + __RECOLOUR_WRAPPER( + __PREPARE_LL_ACCELERATION__(); + + uint8_t * mask_temp_buf = NULL; + if(blend_dsc.opa < LV_OPA_MAX) { + mask_temp_buf = lv_mem_buf_get(copy_size.iHeight * copy_size.iWidth); + if(NULL == mask_temp_buf) { + LV_LOG_WARN( + "Failed to allocate memory for alpha mask," + " use normal route instead."); + break; + } + lv_memset_00(mask_temp_buf, copy_size.iHeight * copy_size.iWidth); + + __arm_2d_impl_gray8_colour_filling_mask_opacity( + mask_temp_buf, + src_stride, + mask_after_rgb, + src_stride, + ©_size, + 0xFF, + blend_dsc.opa); + + __arm_2d_impl_src_msk_copy( + (color_int *)src_buf_tmp, + src_stride, + mask_temp_buf, + src_stride, + ©_size, + (color_int *)dest_buf, + dest_stride, + ©_size); + + lv_mem_buf_release(mask_temp_buf); + } + else { + __arm_2d_impl_src_msk_copy( + (color_int *)src_buf_tmp, + src_stride, + mask_after_rgb, + src_stride, + ©_size, + (color_int *)dest_buf, + dest_stride, + ©_size); + } + + is_accelerated = true; + ) + /* *INDENT-ON* */ + } + else if(!mask_any && (cf == LV_IMG_CF_TRUE_COLOR)) { + /* accelerate copy-with-source-masks-and-opacity */ + + /* *INDENT-OFF* */ + __RECOLOUR_WRAPPER( + __PREPARE_LL_ACCELERATION__(); + + if(blend_dsc.opa >= LV_OPA_MAX) { + __arm_2d_impl_copy( + (color_int *)src_buf_tmp, + src_stride, + (color_int *)dest_buf, + dest_stride, + ©_size); + } + else { + __arm_2d_impl_alpha_blending( + (color_int *)src_buf_tmp, + src_stride, + (color_int *)dest_buf, + dest_stride, + ©_size, + blend_dsc.opa); + } + is_accelerated = true; + ) + /* *INDENT-ON* */ + } + } + else if(!mask_any +#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ + && (draw_dsc->antialias == 1) +#else + && (draw_dsc->antialias == 0) +#endif + && (draw_dsc->recolor_opa == LV_OPA_TRANSP) + && (((LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED == cf) + || (LV_IMG_CF_TRUE_COLOR == cf)) + || (LV_IMG_CF_RGB565A8 == cf) +#if defined(__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__) && __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ + || ((LV_IMG_CF_TRUE_COLOR_ALPHA == cf) + && (LV_COLOR_DEPTH == 32)) +#endif + ) + ) { + + uint8_t * mask_after_rgb = src_buf + sizeof(lv_color_t) * src_w * src_h; + /* *INDENT-OFF* */ + __RECOLOUR_WRAPPER( + /* accelerate transform without re-color */ + + static arm_2d_tile_t target_tile_origin; + static arm_2d_tile_t target_tile; + arm_2d_region_t clip_region; + static arm_2d_region_t target_region; + + lv_color_t * dest_buf = draw_ctx->buf; + + target_tile_origin = (arm_2d_tile_t) { + .tRegion = { + .tSize = { + .iWidth = lv_area_get_width(draw_ctx->buf_area), + .iHeight = lv_area_get_height(draw_ctx->buf_area), + }, + }, + .tInfo.bIsRoot = true, + .phwBuffer = (uint16_t *)draw_ctx->buf, + }; + + clip_region = (arm_2d_region_t) { + .tLocation = { + .iX = draw_ctx->clip_area->x1 - draw_ctx->buf_area->x1, + .iY = draw_ctx->clip_area->y1 - draw_ctx->buf_area->y1, + }, + .tSize = { + .iWidth = lv_area_get_width(draw_ctx->clip_area), + .iHeight = lv_area_get_height(draw_ctx->clip_area), + }, + }; + + arm_2d_tile_generate_child(&target_tile_origin, + &clip_region, + &target_tile, + false); + + static arm_2d_tile_t source_tile; + + source_tile = (arm_2d_tile_t) { + .tRegion = { + .tSize = { + .iWidth = src_w, + .iHeight = src_h, + }, + }, + .tInfo.bIsRoot = true, + .pchBuffer = (uint8_t *)src_buf, + }; + + static arm_2d_location_t source_center, target_center; + source_center.iX = draw_dsc->pivot.x; + source_center.iY = draw_dsc->pivot.y; + + if(LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED == cf) { + + __ARM_2D_PREPARE_TRANS_AND_TARGET_REGION( + arm_2d_tile_transform_with_opacity_prepare, + &source_tile, + source_center, + ARM_2D_ANGLE((draw_dsc->angle / 10.0f)), + draw_dsc->zoom / 256.0f, + (color_int)LV_COLOR_CHROMA_KEY.full, + blend_dsc.opa); + + arm_2d_tile_transform( + &target_tile, + &target_region, + NULL + ); + is_accelerated = true; + } + #if ARM_2D_VERISON >= 10103 + else if (LV_IMG_CF_TRUE_COLOR == cf) { + __ARM_2D_PREPARE_TRANS_AND_TARGET_REGION( + arm_2d_tile_transform_only_with_opacity_prepare, + &source_tile, + source_center, + ARM_2D_ANGLE((draw_dsc->angle / 10.0f)), + draw_dsc->zoom / 256.0f, + blend_dsc.opa); + + arm_2d_tile_transform( + &target_tile, + &target_region, + NULL + ); + is_accelerated = true; + } + #endif + else if (LV_IMG_CF_RGB565A8 == cf) { + static arm_2d_tile_t mask_tile; + mask_tile = source_tile; + + mask_tile.tInfo.bHasEnforcedColour = true; + mask_tile.tInfo.tColourInfo.chScheme = ARM_2D_COLOUR_GRAY8; + mask_tile.pchBuffer = mask_after_rgb; + + __ARM_2D_PREPARE_TRANS_AND_TARGET_REGION( + arm_2d_tile_transform_with_src_mask_and_opacity_prepare, + &source_tile, + &mask_tile, + source_center, + ARM_2D_ANGLE((draw_dsc->angle / 10.0f)), + draw_dsc->zoom / 256.0f, + blend_dsc.opa + ); + + arm_2d_tile_transform( + &target_tile, + &target_region, + NULL + ); + + is_accelerated = true; + } + #if defined(__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__) \ + && __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ + else if((LV_IMG_CF_TRUE_COLOR_ALPHA == cf) && + (LV_COLOR_DEPTH == 32)) { + static arm_2d_tile_t mask_tile; + mask_tile = source_tile; + + mask_tile.tInfo.bHasEnforcedColour = true; + mask_tile.tInfo.tColourInfo.chScheme = ARM_2D_CHANNEL_8in32; + mask_tile.pchBuffer += 3; + + __ARM_2D_PREPARE_TRANS_AND_TARGET_REGION( + arm_2d_tile_transform_with_src_mask_and_opacity_prepare, + &source_tile, + &mask_tile, + source_center, + ARM_2D_ANGLE((draw_dsc->angle / 10.0f)), + draw_dsc->zoom / 256.0f, + blend_dsc.opa + ); + + arm_2d_tile_transform( + &target_tile, + &target_region, + NULL + ); + + is_accelerated = true; + } + #endif + ) + /* *INDENT-ON* */ + } + + /* *INDENT-OFF* */ + if(!is_accelerated) while(blend_area.y1 <= y_last) { + /*Apply transformations if any or separate the channels*/ + lv_area_t transform_area; + lv_area_copy(&transform_area, &blend_area); + lv_area_move(&transform_area, -coords->x1, -coords->y1); + if(transform) { + lv_draw_transform(draw_ctx, &transform_area, src_buf, src_w, src_h, src_w, + draw_dsc, cf, rgb_buf, mask_buf); + } + else { + convert_cb(&transform_area, src_buf, src_w, src_h, src_w, draw_dsc, cf, rgb_buf, mask_buf); + } + + /*Apply recolor*/ + if(draw_dsc->recolor_opa > LV_OPA_MIN) { + arm_2d_size_t copy_size = { + .iWidth = buf_w, + .iHeight = buf_h, + }; + + /* apply re-colour */ + __arm_2d_impl_colour_filling_with_opacity( + (color_int *)rgb_buf, + buf_w, + ©_size, + (color_int)draw_dsc->recolor.full, + draw_dsc->recolor_opa); + } +#if LV_USE_DRAW_MASKS + /*Apply the masks if any*/ + if(mask_any) { + lv_coord_t y; + lv_opa_t * mask_buf_tmp = mask_buf; + for(y = blend_area.y1; y <= blend_area.y2; y++) { + lv_draw_mask_res_t mask_res_line; + mask_res_line = lv_draw_mask_apply(mask_buf_tmp, blend_area.x1, y, blend_w); + + if(mask_res_line == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(mask_buf_tmp, blend_w); + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + } + else if(mask_res_line == LV_DRAW_MASK_RES_CHANGED) { + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + } + mask_buf_tmp += blend_w; + } + } +#endif + + /*Blend*/ + lv_draw_sw_blend(draw_ctx, &blend_dsc); + + /*Go the the next lines*/ + blend_area.y1 = blend_area.y2 + 1; + blend_area.y2 = blend_area.y1 + buf_h - 1; + if(blend_area.y2 > y_last) blend_area.y2 = y_last; + } + + lv_mem_buf_release(mask_buf); + lv_mem_buf_release(rgb_buf); + } +} + +static void lv_gpu_arm2d_wait_cb(lv_draw_ctx_t * draw_ctx) +{ + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + + arm_2d_op_wait_async(NULL); + if(disp->driver && disp->driver->wait_cb) { + disp->driver->wait_cb(disp->driver); + } + lv_draw_sw_wait_for_finish(draw_ctx); +} + + +#endif + + +/********************** + * STATIC FUNCTIONS + **********************/ +/* Separate the image channels to RGB and Alpha to match LV_COLOR_DEPTH settings*/ +static void convert_cb(const lv_area_t * dest_area, const void * src_buf, lv_coord_t src_w, lv_coord_t src_h, + lv_coord_t src_stride, const lv_draw_img_dsc_t * draw_dsc, lv_img_cf_t cf, lv_color_t * cbuf, lv_opa_t * abuf) +{ + LV_UNUSED(draw_dsc); + LV_UNUSED(src_h); + LV_UNUSED(src_w); + + const uint8_t * src_tmp8 = (const uint8_t *)src_buf; + lv_coord_t y; + lv_coord_t x; + + if(cf == LV_IMG_CF_TRUE_COLOR || cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { + uint32_t px_cnt = lv_area_get_size(dest_area); + lv_memset(abuf, 0xff, px_cnt); + + src_tmp8 += (src_stride * dest_area->y1 * sizeof(lv_color_t)) + dest_area->x1 * sizeof(lv_color_t); + uint32_t dest_w = lv_area_get_width(dest_area); + uint32_t dest_w_byte = dest_w * sizeof(lv_color_t); + + lv_coord_t src_stride_byte = src_stride * sizeof(lv_color_t); + lv_color_t * cbuf_tmp = cbuf; + for(y = dest_area->y1; y <= dest_area->y2; y++) { + lv_memcpy(cbuf_tmp, src_tmp8, dest_w_byte); + src_tmp8 += src_stride_byte; + cbuf_tmp += dest_w; + } + + /*Make "holes" for with Chroma keying*/ + if(cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { + uint32_t i; + lv_color_t chk = LV_COLOR_CHROMA_KEY; +#if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1 + uint8_t * cbuf_uint = (uint8_t *)cbuf; + uint8_t chk_v = chk.full; +#elif LV_COLOR_DEPTH == 16 + uint16_t * cbuf_uint = (uint16_t *)cbuf; + uint16_t chk_v = chk.full; +#elif LV_COLOR_DEPTH == 32 + uint32_t * cbuf_uint = (uint32_t *)cbuf; + uint32_t chk_v = chk.full; +#endif + for(i = 0; i < px_cnt; i++) { + if(chk_v == cbuf_uint[i]) abuf[i] = 0x00; + } + } + } + else if(cf == LV_IMG_CF_TRUE_COLOR_ALPHA) { + src_tmp8 += (src_stride * dest_area->y1 * LV_IMG_PX_SIZE_ALPHA_BYTE) + dest_area->x1 * LV_IMG_PX_SIZE_ALPHA_BYTE; + + lv_coord_t src_new_line_step_px = (src_stride - lv_area_get_width(dest_area)); + lv_coord_t src_new_line_step_byte = src_new_line_step_px * LV_IMG_PX_SIZE_ALPHA_BYTE; + + lv_coord_t dest_h = lv_area_get_height(dest_area); + lv_coord_t dest_w = lv_area_get_width(dest_area); + for(y = 0; y < dest_h; y++) { + for(x = 0; x < dest_w; x++) { + abuf[x] = src_tmp8[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; +#if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1 + cbuf[x].full = *src_tmp8; +#elif LV_COLOR_DEPTH == 16 + cbuf[x].full = *src_tmp8 + ((*(src_tmp8 + 1)) << 8); +#elif LV_COLOR_DEPTH == 32 + cbuf[x] = *((lv_color_t *) src_tmp8); + cbuf[x].ch.alpha = 0xff; +#endif + src_tmp8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + + } + cbuf += dest_w; + abuf += dest_w; + src_tmp8 += src_new_line_step_byte; + } + } + else if(cf == LV_IMG_CF_RGB565A8) { + src_tmp8 += (src_stride * dest_area->y1 * sizeof(lv_color_t)) + dest_area->x1 * sizeof(lv_color_t); + + lv_coord_t src_stride_byte = src_stride * sizeof(lv_color_t); + + lv_coord_t dest_h = lv_area_get_height(dest_area); + lv_coord_t dest_w = lv_area_get_width(dest_area); + for(y = 0; y < dest_h; y++) { + lv_memcpy(cbuf, src_tmp8, dest_w * sizeof(lv_color_t)); + cbuf += dest_w; + src_tmp8 += src_stride_byte; + } + + src_tmp8 = (const uint8_t *)src_buf; + src_tmp8 += sizeof(lv_color_t) * src_w * src_h; + src_tmp8 += src_stride * dest_area->y1 + dest_area->x1; + for(y = 0; y < dest_h; y++) { + lv_memcpy(abuf, src_tmp8, dest_w); + abuf += dest_w; + src_tmp8 += src_stride; + } + } +} + +#if 0 +static void invalidate_cache(void) +{ + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + if(disp->driver->clean_dcache_cb) disp->driver->clean_dcache_cb(disp->driver); + else { +#if __CORTEX_M >= 0x07 + if((SCB->CCR) & (uint32_t)SCB_CCR_DC_Msk) + SCB_CleanInvalidateDCache(); +#endif + } +} +#endif + +#endif diff --git a/L3_Middlewares/LVGL/src/draw/arm2d/lv_gpu_arm2d.h b/L3_Middlewares/LVGL/src/draw/arm2d/lv_gpu_arm2d.h new file mode 100644 index 0000000..50fa5a8 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/arm2d/lv_gpu_arm2d.h @@ -0,0 +1,51 @@ +/** + * @file lv_gpu_arm2d.h + * + */ + +#ifndef LV_GPU_ARM2D_H +#define LV_GPU_ARM2D_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../misc/lv_color.h" +#include "../../hal/lv_hal_disp.h" +#include "../sw/lv_draw_sw.h" + +#if LV_USE_GPU_ARM2D + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ +typedef lv_draw_sw_ctx_t lv_draw_arm2d_ctx_t; + +struct _lv_disp_drv_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +void lv_draw_arm2d_ctx_init(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); + +void lv_draw_arm2d_ctx_deinit(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_ARM2D*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_GPU_ARM2D_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw.c b/L3_Middlewares/LVGL/src/draw/lv_draw.c index dbaec70..823f707 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw.c +++ b/L3_Middlewares/LVGL/src/draw/lv_draw.c @@ -3,25 +3,15 @@ * */ -/** - * Modified by NXP in 2024 - */ - /********************* * INCLUDES *********************/ -#include "../misc/lv_area_private.h" -#include "lv_draw_private.h" +#include "lv_draw.h" #include "sw/lv_draw_sw.h" -#include "../display/lv_display_private.h" -#include "../core/lv_global.h" -#include "../core/lv_refr_private.h" -#include "../stdlib/lv_string.h" /********************* * DEFINES *********************/ -#define _draw_info LV_GLOBAL_DEFAULT()->draw_info /********************** * TYPEDEFS @@ -30,12 +20,7 @@ /********************** * STATIC PROTOTYPES **********************/ -static bool is_independent(lv_layer_t * layer, lv_draw_task_t * t_check); -static inline uint32_t get_layer_size_kb(uint32_t size_byte) -{ - return size_byte < 1024 ? 1 : size_byte >> 10; -} /********************** * STATIC VARIABLES **********************/ @@ -54,452 +39,15 @@ static inline uint32_t get_layer_size_kb(uint32_t size_byte) void lv_draw_init(void) { -#if LV_USE_OS - lv_thread_sync_init(&_draw_info.sync); -#endif -} - -void lv_draw_deinit(void) -{ -#if LV_USE_OS - lv_thread_sync_delete(&_draw_info.sync); -#endif - - lv_draw_unit_t * u = _draw_info.unit_head; - while(u) { - lv_draw_unit_t * cur_unit = u; - u = u->next; - - if(cur_unit->delete_cb) cur_unit->delete_cb(cur_unit); - lv_free(cur_unit); - } - _draw_info.unit_head = NULL; -} - -void * lv_draw_create_unit(size_t size) -{ - lv_draw_unit_t * new_unit = lv_malloc_zeroed(size); - - new_unit->next = _draw_info.unit_head; - _draw_info.unit_head = new_unit; - _draw_info.unit_cnt++; - - return new_unit; -} - -lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords) -{ - LV_PROFILER_BEGIN; - lv_draw_task_t * new_task = lv_malloc_zeroed(sizeof(lv_draw_task_t)); - - new_task->area = *coords; - new_task->_real_area = *coords; - new_task->clip_area = layer->_clip_area; -#if LV_DRAW_TRANSFORM_USE_MATRIX - new_task->matrix = layer->matrix; -#endif - new_task->state = LV_DRAW_TASK_STATE_QUEUED; - - /*Find the tail*/ - if(layer->draw_task_head == NULL) { - layer->draw_task_head = new_task; - } - else { - lv_draw_task_t * tail = layer->draw_task_head; - while(tail->next) tail = tail->next; - - tail->next = new_task; - } - - LV_PROFILER_END; - return new_task; -} - -void lv_draw_finalize_task_creation(lv_layer_t * layer, lv_draw_task_t * t) -{ - LV_PROFILER_BEGIN; - lv_draw_dsc_base_t * base_dsc = t->draw_dsc; - base_dsc->layer = layer; - - lv_draw_global_info_t * info = &_draw_info; - - /*Send LV_EVENT_DRAW_TASK_ADDED and dispatch only on the "main" draw_task - *and not on the draw tasks added in the event. - *Sending LV_EVENT_DRAW_TASK_ADDED events might cause recursive event sends and besides - *dispatching might remove the "main" draw task while it's still being used in the event*/ - - if(info->task_running == false) { - if(base_dsc->obj && lv_obj_has_flag(base_dsc->obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS)) { - info->task_running = true; - lv_obj_send_event(base_dsc->obj, LV_EVENT_DRAW_TASK_ADDED, t); - info->task_running = false; - } - - /*Let the draw units set their preference score*/ - t->preference_score = 100; - t->preferred_draw_unit_id = 0; - lv_draw_unit_t * u = info->unit_head; - while(u) { - if(u->evaluate_cb) u->evaluate_cb(u, t); - u = u->next; - } - - lv_draw_dispatch(); - } - else { - /*Let the draw units set their preference score*/ - t->preference_score = 100; - t->preferred_draw_unit_id = 0; - lv_draw_unit_t * u = info->unit_head; - while(u) { - if(u->evaluate_cb) u->evaluate_cb(u, t); - u = u->next; - } - } - LV_PROFILER_END; -} - -void lv_draw_wait_for_finish(void) -{ -#if LV_USE_OS - lv_draw_unit_t * u = _draw_info.unit_head; - while(u) { - if(u->wait_for_finish_cb) - u->wait_for_finish_cb(u); - u = u->next; - } -#endif -} - -void lv_draw_dispatch(void) -{ - LV_PROFILER_BEGIN; - bool task_dispatched = false; - lv_display_t * disp = lv_display_get_next(NULL); - while(disp) { - lv_layer_t * layer = disp->layer_head; - while(layer) { - if(lv_draw_dispatch_layer(disp, layer)) - task_dispatched = true; - layer = layer->next; - } - if(!task_dispatched) { - lv_draw_wait_for_finish(); - lv_draw_dispatch_request(); - } - disp = lv_display_get_next(disp); - } - LV_PROFILER_END; -} - -bool lv_draw_dispatch_layer(lv_display_t * disp, lv_layer_t * layer) -{ - LV_PROFILER_BEGIN; - /*Remove the finished tasks first*/ - lv_draw_task_t * t_prev = NULL; - lv_draw_task_t * t = layer->draw_task_head; - while(t) { - lv_draw_task_t * t_next = t->next; - if(t->state == LV_DRAW_TASK_STATE_READY) { - if(t_prev) t_prev->next = t->next; /*Remove it by assigning the next task to the previous*/ - else layer->draw_task_head = t_next; /*If it was the head, set the next as head*/ - - /*If it was layer drawing free the layer too*/ - if(t->type == LV_DRAW_TASK_TYPE_LAYER) { - lv_draw_image_dsc_t * draw_image_dsc = t->draw_dsc; - lv_layer_t * layer_drawn = (lv_layer_t *)draw_image_dsc->src; - - if(layer_drawn->draw_buf) { - int32_t h = lv_area_get_height(&layer_drawn->buf_area); - uint32_t layer_size_byte = h * layer_drawn->draw_buf->header.stride; - - _draw_info.used_memory_for_layers_kb -= get_layer_size_kb(layer_size_byte); - LV_LOG_INFO("Layer memory used: %" LV_PRIu32 " kB\n", _draw_info.used_memory_for_layers_kb); - lv_draw_buf_destroy(layer_drawn->draw_buf); - layer_drawn->draw_buf = NULL; - } - - /*Remove the layer from the display's*/ - if(disp) { - lv_layer_t * l2 = disp->layer_head; - while(l2) { - if(l2->next == layer_drawn) { - l2->next = layer_drawn->next; - break; - } - l2 = l2->next; - } - - if(disp->layer_deinit) disp->layer_deinit(disp, layer_drawn); - lv_free(layer_drawn); - } - } - lv_draw_label_dsc_t * draw_label_dsc = lv_draw_task_get_label_dsc(t); - if(draw_label_dsc && draw_label_dsc->text_local) { - lv_free((void *)draw_label_dsc->text); - draw_label_dsc->text = NULL; - } - - lv_free(t->draw_dsc); - lv_free(t); - } - else { - t_prev = t; - } - t = t_next; - } - - bool task_dispatched = false; - - /*This layer is ready, enable blending its buffer*/ - if(layer->parent && layer->all_tasks_added && layer->draw_task_head == NULL) { - /*Find a draw task with TYPE_LAYER in the layer where the src is this layer*/ - lv_draw_task_t * t_src = layer->parent->draw_task_head; - while(t_src) { - if(t_src->type == LV_DRAW_TASK_TYPE_LAYER && t_src->state == LV_DRAW_TASK_STATE_WAITING) { - lv_draw_image_dsc_t * draw_dsc = t_src->draw_dsc; - if(draw_dsc->src == layer) { - t_src->state = LV_DRAW_TASK_STATE_QUEUED; - lv_draw_dispatch_request(); - break; - } - } - t_src = t_src->next; - } - } - /*Assign draw tasks to the draw_units*/ - else { - /*Find a draw unit which is not busy and can take at least one task*/ - /*Let all draw units to pick draw tasks*/ - lv_draw_unit_t * u = _draw_info.unit_head; - while(u) { - int32_t taken_cnt = u->dispatch_cb(u, layer); - if(taken_cnt != LV_DRAW_UNIT_IDLE) task_dispatched = true; - u = u->next; - } - } - - LV_PROFILER_END; - return task_dispatched; -} - -void lv_draw_dispatch_wait_for_request(void) -{ -#if LV_USE_OS - lv_thread_sync_wait(&_draw_info.sync); -#else - while(!_draw_info.dispatch_req); - _draw_info.dispatch_req = 0; -#endif + /*Nothing to init now*/ } -void lv_draw_dispatch_request(void) +void lv_draw_wait_for_finish(lv_draw_ctx_t * draw_ctx) { -#if LV_USE_OS - lv_thread_sync_signal(&_draw_info.sync); -#else - _draw_info.dispatch_req = 1; -#endif -} - -uint32_t lv_draw_get_unit_count(void) -{ - return _draw_info.unit_cnt; -} - -lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id) -{ - LV_PROFILER_BEGIN; - - /* If there is only 1 draw unit the task can be consumed linearly as - * they are added in the correct order. However, it can happen that - * there is a `LV_DRAW_TASK_TYPE_LAYER` which can be blended only when - * all its tasks are ready. As other areas might be on top of that - * layer-to-blend don't skip it. Instead stop there, so that the - * draw tasks of that layer can be consumed and can be finished. - * After that this layer-to-blenf will have `LV_DRAW_TASK_STATE_QUEUED` - * so it can be blended normally.*/ - if(_draw_info.unit_cnt <= 1) { - lv_draw_task_t * t = layer->draw_task_head; - while(t) { - /*Mark unsupported draw tasks as ready as no one else will consume them*/ - if(t->state == LV_DRAW_TASK_STATE_QUEUED && - t->preferred_draw_unit_id != LV_DRAW_UNIT_NONE && - t->preferred_draw_unit_id != draw_unit_id) { - t->state = LV_DRAW_TASK_STATE_READY; - } - /*Not queued yet, leave this layer while the first task will be queued*/ - else if(t->state != LV_DRAW_TASK_STATE_QUEUED) { - t = NULL; - break; - } - /*It's a supported and queued task, process it*/ - else { - break; - } - t = t->next; - } - LV_PROFILER_END; - return t; - } - - /*Handle the case of multiply draw units*/ - - /*If the first task is screen sized, there cannot be independent areas*/ - if(layer->draw_task_head) { - int32_t hor_res = lv_display_get_horizontal_resolution(lv_refr_get_disp_refreshing()); - int32_t ver_res = lv_display_get_vertical_resolution(lv_refr_get_disp_refreshing()); - lv_draw_task_t * t = layer->draw_task_head; - if(t->state != LV_DRAW_TASK_STATE_QUEUED && - t->area.x1 <= 0 && t->area.x2 >= hor_res - 1 && - t->area.y1 <= 0 && t->area.y2 >= ver_res - 1) { - LV_PROFILER_END; - return NULL; - } - } - - lv_draw_task_t * t = t_prev ? t_prev->next : layer->draw_task_head; - while(t) { - /*Find a queued and independent task*/ - if(t->state == LV_DRAW_TASK_STATE_QUEUED && - (t->preferred_draw_unit_id == LV_DRAW_UNIT_NONE || t->preferred_draw_unit_id == draw_unit_id) && - is_independent(layer, t)) { - LV_PROFILER_END; - return t; - } - t = t->next; - } - - LV_PROFILER_END; - return NULL; -} - -uint32_t lv_draw_get_dependent_count(lv_draw_task_t * t_check) -{ - if(t_check == NULL) return 0; - if(t_check->next == NULL) return 0; - - LV_PROFILER_BEGIN; - uint32_t cnt = 0; - - lv_draw_task_t * t = t_check->next; - while(t) { - if((t->state == LV_DRAW_TASK_STATE_QUEUED || t->state == LV_DRAW_TASK_STATE_WAITING) && - lv_area_is_on(&t_check->area, &t->area)) { - cnt++; - } - - t = t->next; - } - LV_PROFILER_END; - return cnt; -} - -lv_layer_t * lv_draw_layer_create(lv_layer_t * parent_layer, lv_color_format_t color_format, const lv_area_t * area) -{ - lv_display_t * disp = lv_refr_get_disp_refreshing(); - lv_layer_t * new_layer = lv_malloc_zeroed(sizeof(lv_layer_t)); - LV_ASSERT_MALLOC(new_layer); - if(new_layer == NULL) return NULL; - - new_layer->parent = parent_layer; - new_layer->_clip_area = *area; - new_layer->buf_area = *area; - new_layer->phy_clip_area = *area; - new_layer->color_format = color_format; - -#if LV_DRAW_TRANSFORM_USE_MATRIX - lv_matrix_identity(&new_layer->matrix); -#endif - - if(disp->layer_head) { - lv_layer_t * tail = disp->layer_head; - while(tail->next) tail = tail->next; - tail->next = new_layer; - } - else { - disp->layer_head = new_layer; - } - - return new_layer; -} - -void * lv_draw_layer_alloc_buf(lv_layer_t * layer) -{ - /*If the buffer of the layer is already allocated return it*/ - if(layer->draw_buf != NULL) { - return layer->draw_buf->data; - } - - /*If the buffer of the layer is not allocated yet, allocate it now*/ - int32_t w = lv_area_get_width(&layer->buf_area); - int32_t h = lv_area_get_height(&layer->buf_area); - uint32_t layer_size_byte = h * lv_draw_buf_width_to_stride(w, layer->color_format); - - layer->draw_buf = lv_draw_buf_create(w, h, layer->color_format, 0); - - if(layer->draw_buf == NULL) { - LV_LOG_WARN("Allocating layer buffer failed. Try later"); - return NULL; - } - - _draw_info.used_memory_for_layers_kb += get_layer_size_kb(layer_size_byte); - LV_LOG_INFO("Layer memory used: %" LV_PRIu32 " kB\n", _draw_info.used_memory_for_layers_kb); - - if(lv_color_format_has_alpha(layer->color_format)) { - lv_draw_buf_clear(layer->draw_buf, NULL); - } - - return layer->draw_buf->data; -} - -void * lv_draw_layer_go_to_xy(lv_layer_t * layer, int32_t x, int32_t y) -{ - return lv_draw_buf_goto_xy(layer->draw_buf, x, y); -} - -lv_draw_task_type_t lv_draw_task_get_type(const lv_draw_task_t * t) -{ - return t->type; -} - -void * lv_draw_task_get_draw_dsc(const lv_draw_task_t * t) -{ - return t->draw_dsc; -} - -void lv_draw_task_get_area(const lv_draw_task_t * t, lv_area_t * area) -{ - *area = t->area; + if(draw_ctx->wait_for_finish) draw_ctx->wait_for_finish(draw_ctx); } /********************** * STATIC FUNCTIONS **********************/ -/** - * Check if there are older draw task overlapping the area of `t_check` - * @param layer the draw ctx to search in - * @param t_check check this task if it overlaps with the older ones - * @return true: `t_check` is not overlapping with older tasks so it's independent - */ -static bool is_independent(lv_layer_t * layer, lv_draw_task_t * t_check) -{ - LV_PROFILER_BEGIN; - lv_draw_task_t * t = layer->draw_task_head; - - /*If t_check is outside of the older tasks then it's independent*/ - while(t && t != t_check) { - if(t->state != LV_DRAW_TASK_STATE_READY) { - lv_area_t a; - if(lv_area_intersect(&a, &t->_real_area, &t_check->_real_area)) { - LV_PROFILER_END; - return false; - } - } - t = t->next; - } - LV_PROFILER_END; - - return true; -} diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw.h b/L3_Middlewares/LVGL/src/draw/lv_draw.h index 2985267..ffe1d4e 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw.h +++ b/L3_Middlewares/LVGL/src/draw/lv_draw.h @@ -3,10 +3,6 @@ * */ -/** - * Modified by NXP in 2024 - */ - #ifndef LV_DRAW_H #define LV_DRAW_H @@ -19,243 +15,190 @@ extern "C" { *********************/ #include "../lv_conf_internal.h" -#include "../misc/lv_types.h" #include "../misc/lv_style.h" -#include "../misc/lv_text.h" -#include "../misc/lv_profiler.h" -#include "../misc/lv_matrix.h" -#include "lv_image_decoder.h" -#include "../osal/lv_os.h" -#include "lv_draw_buf.h" +#include "../misc/lv_txt.h" +#include "lv_img_decoder.h" +#include "lv_img_cache.h" + +#include "lv_draw_rect.h" +#include "lv_draw_label.h" +#include "lv_draw_img.h" +#include "lv_draw_line.h" +#include "lv_draw_triangle.h" +#include "lv_draw_arc.h" +#include "lv_draw_mask.h" +#include "lv_draw_transform.h" +#include "lv_draw_layer.h" /********************* * DEFINES *********************/ -#define LV_DRAW_UNIT_NONE 0 -#define LV_DRAW_UNIT_IDLE -1 /**< The draw unit is idle, new dispatching might be requested to try again */ - -#if LV_DRAW_TRANSFORM_USE_MATRIX -#if !LV_USE_MATRIX -#error "LV_DRAW_TRANSFORM_USE_MATRIX requires LV_USE_MATRIX = 1" -#endif -#endif /********************** * TYPEDEFS **********************/ -typedef enum { - LV_DRAW_TASK_TYPE_NONE = 0, - LV_DRAW_TASK_TYPE_FILL, - LV_DRAW_TASK_TYPE_BORDER, - LV_DRAW_TASK_TYPE_BOX_SHADOW, - LV_DRAW_TASK_TYPE_LABEL, - LV_DRAW_TASK_TYPE_IMAGE, - LV_DRAW_TASK_TYPE_LAYER, - LV_DRAW_TASK_TYPE_LINE, - LV_DRAW_TASK_TYPE_ARC, - LV_DRAW_TASK_TYPE_TRIANGLE, - LV_DRAW_TASK_TYPE_MASK_RECTANGLE, - LV_DRAW_TASK_TYPE_MASK_BITMAP, - LV_DRAW_TASK_TYPE_VECTOR, -} lv_draw_task_type_t; - -typedef enum { - LV_DRAW_TASK_STATE_WAITING, /*Waiting for something to be finished. E.g. rendering a layer*/ - LV_DRAW_TASK_STATE_QUEUED, - LV_DRAW_TASK_STATE_IN_PROGRESS, - LV_DRAW_TASK_STATE_READY, -} lv_draw_task_state_t; - -struct lv_layer_t { - - /** Target draw buffer of the layer*/ - lv_draw_buf_t * draw_buf; - - /** The absolute coordinates of the buffer */ - lv_area_t buf_area; - - /** The color format of the layer. LV_COLOR_FORMAT_... */ - lv_color_format_t color_format; +typedef struct { + void * user_data; +} lv_draw_mask_t; + +typedef struct _lv_draw_layer_ctx_t { + lv_area_t area_full; + lv_area_t area_act; + lv_coord_t max_row_with_alpha; + lv_coord_t max_row_with_no_alpha; + void * buf; + struct { + const lv_area_t * clip_area; + lv_area_t * buf_area; + void * buf; + bool screen_transp; + } original; +} lv_draw_layer_ctx_t; + +typedef struct _lv_draw_ctx_t { + /** + * Pointer to a buffer to draw into + */ + void * buf; /** - * NEVER USE IT DRAW UNITS. USED INTERNALLY DURING DRAW TASK CREATION. - * The current clip area with absolute coordinates, always the same or smaller than `buf_area` - * Can be set before new draw tasks are added to indicate the clip area of the draw tasks. - * Therefore `lv_draw_add_task()` always saves it in the new draw task to know the clip area when the draw task was added. - * During drawing the draw units also sees the saved clip_area and should use it during drawing. - * During drawing the layer's clip area shouldn't be used as it might be already changed for other draw tasks. + * The position and size of `buf` (absolute coordinates) */ - lv_area_t _clip_area; + lv_area_t * buf_area; /** - * The physical clipping area relative to the display. + * The current clip area with absolute coordinates, always the same or smaller than `buf_area` */ - lv_area_t phy_clip_area; + const lv_area_t * clip_area; -#if LV_DRAW_TRANSFORM_USE_MATRIX - /** Transform matrix to be applied when rendering the layer */ - lv_matrix_t matrix; -#endif + void (*init_buf)(struct _lv_draw_ctx_t * draw_ctx); - /** Linked list of draw tasks */ - lv_draw_task_t * draw_task_head; + void (*draw_rect)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); - lv_layer_t * parent; - lv_layer_t * next; - bool all_tasks_added; - void * user_data; -}; + void (*draw_arc)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center, + uint16_t radius, uint16_t start_angle, uint16_t end_angle); -typedef struct { - lv_obj_t * obj; - lv_part_t part; - uint32_t id1; - uint32_t id2; - lv_layer_t * layer; - size_t dsc_size; - void * user_data; -} lv_draw_dsc_base_t; + void (*draw_img_decoded)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, + const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t color_format); -/********************** - * GLOBAL PROTOTYPES - **********************/ + lv_res_t (*draw_img)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * draw_dsc, + const lv_area_t * coords, const void * src); -/** - * Used internally to initialize the drawing module - */ -void lv_draw_init(void); + void (*draw_letter)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p, + uint32_t letter); -/** - * Deinitialize the drawing module - */ -void lv_draw_deinit(void); -/** - * Allocate a new draw unit with the given size and appends it to the list of draw units - * @param size the size to allocate. E.g. `sizeof(my_draw_unit_t)`, - * where the first element of `my_draw_unit_t` is `lv_draw_unit_t`. - */ -void * lv_draw_create_unit(size_t size); + void (*draw_line)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, const lv_point_t * point1, + const lv_point_t * point2); -/** - * Add an empty draw task to the draw task list of a layer. - * @param layer pointer to a layer - * @param coords the coordinates of the draw task - * @return the created draw task which needs to be - * further configured e.g. by added a draw descriptor - */ -lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords); -/** - * Needs to be called when a draw task is created and configured. - * It will send an event about the new draw task to the widget - * and assign it to a draw unit. - * @param layer pointer to a layer - * @param t pointer to a draw task - */ -void lv_draw_finalize_task_creation(lv_layer_t * layer, lv_draw_task_t * t); + void (*draw_polygon)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc, + const lv_point_t * points, uint16_t point_cnt); -/** - * Try dispatching draw tasks to draw units - */ -void lv_draw_dispatch(void); -/** - * Used internally to try dispatching draw tasks of a specific layer - * @param disp pointer to a display on which the dispatching was requested - * @param layer pointer to a layer - * @return at least one draw task is being rendered (maybe it was taken earlier) - */ -bool lv_draw_dispatch_layer(lv_display_t * disp, lv_layer_t * layer); + /** + * Get an area of a transformed image (zoomed and/or rotated) + * @param draw_ctx pointer to a draw context + * @param dest_area get this area of the result image. It assumes that the original image is placed to the 0;0 position. + * @param src_buf the source image + * @param src_w width of the source image in [px] + * @param src_h height of the source image in [px] + * @param src_stride the stride in [px]. + * @param draw_dsc an `lv_draw_img_dsc_t` descriptor containing the transformation parameters + * @param cf the color format of `src_buf` + * @param cbuf place the colors of the pixels on `dest_area` here in RGB format + * @param abuf place the opacity of the pixels on `dest_area` here + */ + void (*draw_transform)(struct _lv_draw_ctx_t * draw_ctx, const lv_area_t * dest_area, const void * src_buf, + lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, + const lv_draw_img_dsc_t * draw_dsc, lv_img_cf_t cf, lv_color_t * cbuf, lv_opa_t * abuf); -/** - * Wait for a new dispatch request. - * It's blocking if `LV_USE_OS == 0` else it yields - */ -void lv_draw_dispatch_wait_for_request(void); + /** + * Replace the buffer with a rect without decoration like radius or borders + */ + void (*draw_bg)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc, const lv_area_t * coords); -/** - * Wait for draw finish in case of asynchronous task execution. - * If `LV_USE_OS == 0` it just return. - */ -void lv_draw_wait_for_finish(void); + /** + * Wait until all background operations are finished. (E.g. GPU operations) + */ + void (*wait_for_finish)(struct _lv_draw_ctx_t * draw_ctx); -/** - * When a draw unit finished a draw task it needs to request dispatching - * to let LVGL assign a new draw task to it - */ -void lv_draw_dispatch_request(void); + /** + * Copy an area from buffer to an other + * @param draw_ctx pointer to a draw context + * @param dest_buf copy the buffer into this buffer + * @param dest_stride the width of the dest_buf in pixels + * @param dest_area the destination area + * @param src_buf copy from this buffer + * @param src_stride the width of src_buf in pixels + * @param src_area the source area. + * + * @note dest_area and src_area must have the same width and height + * but can have different x and y position. + * @note dest_area and src_area must be clipped to the real dimensions of the buffers + */ + void (*buffer_copy)(struct _lv_draw_ctx_t * draw_ctx, void * dest_buf, lv_coord_t dest_stride, + const lv_area_t * dest_area, + void * src_buf, lv_coord_t src_stride, const lv_area_t * src_area); -/** - * Get the total number of draw units. - */ -uint32_t lv_draw_get_unit_count(void); + /** + * Initialize a new layer context. + * The original buffer and area data are already saved from `draw_ctx` to `layer_ctx` + * @param draw_ctx pointer to the current draw context + * @param layer_area the coordinates of the layer + * @param flags OR-ed flags from @lv_draw_layer_flags_t + * @return pointer to the layer context, or NULL on error + */ + struct _lv_draw_layer_ctx_t * (*layer_init)(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx, + lv_draw_layer_flags_t flags); -/** - * Find and available draw task - * @param layer the draw ctx to search in - * @param t_prev continue searching from this task - * @param draw_unit_id check the task where `preferred_draw_unit_id` equals this value or `LV_DRAW_UNIT_NONE` - * @return tan available draw task or NULL if there is no any - */ -lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id); + /** + * Adjust the layer_ctx and/or draw_ctx based on the `layer_ctx->area_act`. + * It's called only if flags has `LV_DRAW_LAYER_FLAG_CAN_SUBDIVIDE` + * @param draw_ctx pointer to the current draw context + * @param layer_ctx pointer to a layer context + * @param flags OR-ed flags from @lv_draw_layer_flags_t + */ + void (*layer_adjust)(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx, + lv_draw_layer_flags_t flags); -/** - * Tell how many draw task are waiting to be drawn on the area of `t_check`. - * It can be used to determine if a GPU shall combine many draw tasks into one or not. - * If a lot of tasks are waiting for the current ones it makes sense to draw them one-by-one - * to not block the dependent tasks' rendering - * @param t_check the task whose dependent tasks shall be counted - * @return number of tasks depending on `t_check` - */ -uint32_t lv_draw_get_dependent_count(lv_draw_task_t * t_check); + /** + * Blend a rendered layer to `layer_ctx->area_act` + * @param draw_ctx pointer to the current draw context + * @param layer_ctx pointer to a layer context + * @param draw_dsc pointer to an image draw descriptor + */ + void (*layer_blend)(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx, + const lv_draw_img_dsc_t * draw_dsc); -/** - * Create a new layer on a parent layer - * @param parent_layer the parent layer to which the layer will be merged when it's rendered - * @param color_format the color format of the layer - * @param area the areas of the layer (absolute coordinates) - * @return the new target_layer or NULL on error - */ -lv_layer_t * lv_draw_layer_create(lv_layer_t * parent_layer, lv_color_format_t color_format, const lv_area_t * area); + /** + * Destroy a layer context. The original buffer and area data of the `draw_ctx` will be restored + * and the `layer_ctx` itself will be freed automatically. + * @param draw_ctx pointer to the current draw context + * @param layer_ctx pointer to a layer context + */ + void (*layer_destroy)(struct _lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx); -/** - * Try to allocate a buffer for the layer. - * @param layer pointer to a layer - * @return pointer to the allocated aligned buffer or NULL on failure - */ -void * lv_draw_layer_alloc_buf(lv_layer_t * layer); + /** + * Size of a layer context in bytes. + */ + size_t layer_instance_size; -/** - * Got to a pixel at X and Y coordinate on a layer - * @param layer pointer to a layer - * @param x the target X coordinate - * @param y the target X coordinate - * @return `buf` offset to point to the given X and Y coordinate - */ -void * lv_draw_layer_go_to_xy(lv_layer_t * layer, int32_t x, int32_t y); +#if LV_USE_USER_DATA + void * user_data; +#endif -/** - * Get the type of a draw task - * @param t the draw task to get the type of - * @return the draw task type -*/ -lv_draw_task_type_t lv_draw_task_get_type(const lv_draw_task_t * t); +} lv_draw_ctx_t; -/** - * Get the draw descriptor of a draw task - * @param t the draw task to get the draw descriptor of - * @return a void pointer to the draw descriptor -*/ -void * lv_draw_task_get_draw_dsc(const lv_draw_task_t * t); +/********************** + * GLOBAL PROTOTYPES + **********************/ -/** - * Get the draw area of a draw task - * @param t the draw task to get the draw area of - * @param area the destination where the draw area will be stored -*/ -void lv_draw_task_get_area(const lv_draw_task_t * t, lv_area_t * area); +void lv_draw_init(void); + + +void lv_draw_wait_for_finish(lv_draw_ctx_t * draw_ctx); /********************** * GLOBAL VARIABLES @@ -265,6 +208,10 @@ void lv_draw_task_get_area(const lv_draw_task_t * t, lv_area_t * area); * MACROS **********************/ +/********************** + * POST INCLUDES + *********************/ + #ifdef __cplusplus } /*extern "C"*/ #endif diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw.mk b/L3_Middlewares/LVGL/src/draw/lv_draw.mk new file mode 100644 index 0000000..f48f48f --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_draw.mk @@ -0,0 +1,25 @@ +CSRCS += lv_draw_arc.c +CSRCS += lv_draw.c +CSRCS += lv_draw_img.c +CSRCS += lv_draw_label.c +CSRCS += lv_draw_line.c +CSRCS += lv_draw_mask.c +CSRCS += lv_draw_rect.c +CSRCS += lv_draw_transform.c +CSRCS += lv_draw_layer.c +CSRCS += lv_draw_triangle.c +CSRCS += lv_img_buf.c +CSRCS += lv_img_cache.c +CSRCS += lv_img_decoder.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw" + +include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/arm2d/lv_draw_arm2d.mk +include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp/lv_draw_nxp.mk +include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sdl/lv_draw_sdl.mk +include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/stm32_dma2d/lv_draw_stm32_dma2d.mk +include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sw/lv_draw_sw.mk +include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/swm341_dma2d/lv_draw_swm341_dma2d.mk diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_arc.c b/L3_Middlewares/LVGL/src/draw/lv_draw_arc.c index f092ea7..b806a00 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_arc.c +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_arc.c @@ -6,11 +6,8 @@ /********************* * INCLUDES *********************/ -#include "lv_draw_private.h" -#include "../core/lv_obj.h" +#include "lv_draw.h" #include "lv_draw_arc.h" -#include "../core/lv_obj_event.h" -#include "../stdlib/lv_string.h" /********************* * DEFINES @@ -38,51 +35,32 @@ void lv_draw_arc_dsc_init(lv_draw_arc_dsc_t * dsc) { - lv_memzero(dsc, sizeof(lv_draw_arc_dsc_t)); + lv_memset_00(dsc, sizeof(lv_draw_arc_dsc_t)); dsc->width = 1; dsc->opa = LV_OPA_COVER; dsc->color = lv_color_black(); - dsc->base.dsc_size = sizeof(lv_draw_arc_dsc_t); } -lv_draw_arc_dsc_t * lv_draw_task_get_arc_dsc(lv_draw_task_t * task) -{ - return task->type == LV_DRAW_TASK_TYPE_ARC ? (lv_draw_arc_dsc_t *)task->draw_dsc : NULL; -} - -void lv_draw_arc(lv_layer_t * layer, const lv_draw_arc_dsc_t * dsc) +void lv_draw_arc(lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center, uint16_t radius, + uint16_t start_angle, uint16_t end_angle) { if(dsc->opa <= LV_OPA_MIN) return; if(dsc->width == 0) return; - if(dsc->start_angle == dsc->end_angle) return; - - LV_PROFILER_BEGIN; - lv_area_t a; - a.x1 = dsc->center.x - dsc->radius; - a.y1 = dsc->center.y - dsc->radius; - a.x2 = dsc->center.x + dsc->radius - 1; - a.y2 = dsc->center.y + dsc->radius - 1; - lv_draw_task_t * t = lv_draw_add_task(layer, &a); - - t->draw_dsc = lv_malloc(sizeof(*dsc)); - lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc)); - t->type = LV_DRAW_TASK_TYPE_ARC; + if(start_angle == end_angle) return; - lv_draw_finalize_task_creation(layer, t); + draw_ctx->draw_arc(draw_ctx, dsc, center, radius, start_angle, end_angle); - LV_PROFILER_END; + // const lv_draw_backend_t * backend = lv_draw_backend_get(); + // backend->draw_arc(center_x, center_y, radius, start_angle, end_angle, clip_area, dsc); } -void lv_draw_arc_get_area(int32_t x, int32_t y, uint16_t radius, lv_value_precise_t start_angle, - lv_value_precise_t end_angle, - int32_t w, bool rounded, lv_area_t * area) +void lv_draw_arc_get_area(lv_coord_t x, lv_coord_t y, uint16_t radius, uint16_t start_angle, uint16_t end_angle, + lv_coord_t w, bool rounded, lv_area_t * area) { - int32_t rout = radius; - int32_t start_angle_int = (int32_t) start_angle; - int32_t end_angle_int = (int32_t) end_angle; + lv_coord_t rout = radius; /*Special case: full arc invalidation */ - if(end_angle_int == start_angle_int + 360) { + if(end_angle == start_angle + 360) { area->x1 = x - rout; area->y1 = y - rout; area->x2 = x + rout; @@ -90,75 +68,75 @@ void lv_draw_arc_get_area(int32_t x, int32_t y, uint16_t radius, lv_value_preci return; } - if(start_angle_int > 360) start_angle_int -= 360; - if(end_angle_int > 360) end_angle_int -= 360; + if(start_angle > 360) start_angle -= 360; + if(end_angle > 360) end_angle -= 360; - int32_t rin = radius - w; - int32_t extra_area = rounded ? w / 2 + 1 : 0; - uint8_t start_quarter = start_angle_int / 90; - uint8_t end_quarter = end_angle_int / 90; + lv_coord_t rin = radius - w; + lv_coord_t extra_area = rounded ? w / 2 + 1 : 0; + uint8_t start_quarter = start_angle / 90; + uint8_t end_quarter = end_angle / 90; /*360 deg still counts as quarter 3 (360 / 90 would be 4)*/ if(start_quarter == 4) start_quarter = 3; if(end_quarter == 4) end_quarter = 3; - if(start_quarter == end_quarter && start_angle_int <= end_angle_int) { + if(start_quarter == end_quarter && start_angle <= end_angle) { if(start_quarter == 0) { - area->y1 = y + ((lv_trigo_sin(start_angle_int) * rin) >> LV_TRIGO_SHIFT) - extra_area; - area->x2 = x + ((lv_trigo_sin(start_angle_int + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; + area->y1 = y + ((lv_trigo_sin(start_angle) * rin) >> LV_TRIGO_SHIFT) - extra_area; + area->x2 = x + ((lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; - area->y2 = y + ((lv_trigo_sin(end_angle_int) * rout) >> LV_TRIGO_SHIFT) + extra_area; - area->x1 = x + ((lv_trigo_sin(end_angle_int + 90) * rin) >> LV_TRIGO_SHIFT) - extra_area; + area->y2 = y + ((lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; + area->x1 = x + ((lv_trigo_sin(end_angle + 90) * rin) >> LV_TRIGO_SHIFT) - extra_area; } else if(start_quarter == 1) { - area->y2 = y + ((lv_trigo_sin(start_angle_int) * rout) >> LV_TRIGO_SHIFT) + extra_area; - area->x2 = x + ((lv_trigo_sin(start_angle_int + 90) * rin) >> LV_TRIGO_SHIFT) + extra_area; + area->y2 = y + ((lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; + area->x2 = x + ((lv_trigo_sin(start_angle + 90) * rin) >> LV_TRIGO_SHIFT) + extra_area; - area->y1 = y + ((lv_trigo_sin(end_angle_int) * rin) >> LV_TRIGO_SHIFT) - extra_area; - area->x1 = x + ((lv_trigo_sin(end_angle_int + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; + area->y1 = y + ((lv_trigo_sin(end_angle) * rin) >> LV_TRIGO_SHIFT) - extra_area; + area->x1 = x + ((lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; } else if(start_quarter == 2) { - area->x1 = x + ((lv_trigo_sin(start_angle_int + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; - area->y2 = y + ((lv_trigo_sin(start_angle_int) * rin) >> LV_TRIGO_SHIFT) + extra_area; + area->x1 = x + ((lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; + area->y2 = y + ((lv_trigo_sin(start_angle) * rin) >> LV_TRIGO_SHIFT) + extra_area; - area->y1 = y + ((lv_trigo_sin(end_angle_int) * rout) >> LV_TRIGO_SHIFT) - extra_area; - area->x2 = x + ((lv_trigo_sin(end_angle_int + 90) * rin) >> LV_TRIGO_SHIFT) + extra_area; + area->y1 = y + ((lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; + area->x2 = x + ((lv_trigo_sin(end_angle + 90) * rin) >> LV_TRIGO_SHIFT) + extra_area; } else if(start_quarter == 3) { - area->x1 = x + ((lv_trigo_sin(start_angle_int + 90) * rin) >> LV_TRIGO_SHIFT) - extra_area; - area->y1 = y + ((lv_trigo_sin(start_angle_int) * rout) >> LV_TRIGO_SHIFT) - extra_area; + area->x1 = x + ((lv_trigo_sin(start_angle + 90) * rin) >> LV_TRIGO_SHIFT) - extra_area; + area->y1 = y + ((lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; - area->x2 = x + ((lv_trigo_sin(end_angle_int + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; - area->y2 = y + ((lv_trigo_sin(end_angle_int) * rin) >> LV_TRIGO_SHIFT) + extra_area; + area->x2 = x + ((lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; + area->y2 = y + ((lv_trigo_sin(end_angle) * rin) >> LV_TRIGO_SHIFT) + extra_area; } } else if(start_quarter == 0 && end_quarter == 1) { - area->x1 = x + ((lv_trigo_sin(end_angle_int + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; - area->y1 = y + ((LV_MIN(lv_trigo_sin(end_angle_int), - lv_trigo_sin(start_angle_int)) * rin) >> LV_TRIGO_SHIFT) - extra_area; - area->x2 = x + ((lv_trigo_sin(start_angle_int + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; + area->x1 = x + ((lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; + area->y1 = y + ((LV_MIN(lv_trigo_sin(end_angle), + lv_trigo_sin(start_angle)) * rin) >> LV_TRIGO_SHIFT) - extra_area; + area->x2 = x + ((lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; area->y2 = y + rout + extra_area; } else if(start_quarter == 1 && end_quarter == 2) { area->x1 = x - rout - extra_area; - area->y1 = y + ((lv_trigo_sin(end_angle_int) * rout) >> LV_TRIGO_SHIFT) - extra_area; - area->x2 = x + ((LV_MAX(lv_trigo_sin(start_angle_int + 90), - lv_trigo_sin(end_angle_int + 90)) * rin) >> LV_TRIGO_SHIFT) + extra_area; - area->y2 = y + ((lv_trigo_sin(start_angle_int) * rout) >> LV_TRIGO_SHIFT) + extra_area; + area->y1 = y + ((lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; + area->x2 = x + ((LV_MAX(lv_trigo_sin(start_angle + 90), + lv_trigo_sin(end_angle + 90)) * rin) >> LV_TRIGO_SHIFT) + extra_area; + area->y2 = y + ((lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; } else if(start_quarter == 2 && end_quarter == 3) { - area->x1 = x + ((lv_trigo_sin(start_angle_int + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; + area->x1 = x + ((lv_trigo_sin(start_angle + 90) * rout) >> LV_TRIGO_SHIFT) - extra_area; area->y1 = y - rout - extra_area; - area->x2 = x + ((lv_trigo_sin(end_angle_int + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; - area->y2 = y + (LV_MAX(lv_trigo_sin(end_angle_int) * rin, - lv_trigo_sin(start_angle_int) * rin) >> LV_TRIGO_SHIFT) + extra_area; + area->x2 = x + ((lv_trigo_sin(end_angle + 90) * rout) >> LV_TRIGO_SHIFT) + extra_area; + area->y2 = y + (LV_MAX(lv_trigo_sin(end_angle) * rin, + lv_trigo_sin(start_angle) * rin) >> LV_TRIGO_SHIFT) + extra_area; } else if(start_quarter == 3 && end_quarter == 0) { - area->x1 = x + ((LV_MIN(lv_trigo_sin(end_angle_int + 90), - lv_trigo_sin(start_angle_int + 90)) * rin) >> LV_TRIGO_SHIFT) - extra_area; - area->y1 = y + ((lv_trigo_sin(start_angle_int) * rout) >> LV_TRIGO_SHIFT) - extra_area; + area->x1 = x + ((LV_MIN(lv_trigo_sin(end_angle + 90), + lv_trigo_sin(start_angle + 90)) * rin) >> LV_TRIGO_SHIFT) - extra_area; + area->y1 = y + ((lv_trigo_sin(start_angle) * rout) >> LV_TRIGO_SHIFT) - extra_area; area->x2 = x + rout + extra_area; - area->y2 = y + ((lv_trigo_sin(end_angle_int) * rout) >> LV_TRIGO_SHIFT) + extra_area; + area->y2 = y + ((lv_trigo_sin(end_angle) * rout) >> LV_TRIGO_SHIFT) + extra_area; } else { diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_arc.h b/L3_Middlewares/LVGL/src/draw/lv_draw_arc.h index 726bd68..8783f13 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_arc.h +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_arc.h @@ -25,44 +25,38 @@ extern "C" { /********************** * TYPEDEFS **********************/ - typedef struct { - lv_draw_dsc_base_t base; - lv_color_t color; - int32_t width; - lv_value_precise_t start_angle; - lv_value_precise_t end_angle; - lv_point_t center; - uint16_t radius; + lv_coord_t width; + uint16_t start_angle; + uint16_t end_angle; const void * img_src; lv_opa_t opa; + lv_blend_mode_t blend_mode : 2; uint8_t rounded : 1; } lv_draw_arc_dsc_t; +struct _lv_draw_ctx_t; + /********************** * GLOBAL PROTOTYPES **********************/ -/** - * Initialize an arc draw descriptor. - * @param dsc pointer to a draw descriptor - */ void lv_draw_arc_dsc_init(lv_draw_arc_dsc_t * dsc); /** - * Try to get an arc draw descriptor from a draw task. - * @param task draw task - * @return the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_ARC - */ -lv_draw_arc_dsc_t * lv_draw_task_get_arc_dsc(lv_draw_task_t * task); - -/** - * Create an arc draw task. - * @param layer pointer to a layer - * @param dsc pointer to an initialized draw descriptor variable + * Draw an arc. (Can draw pie too with great thickness.) + * @param center_x the x coordinate of the center of the arc + * @param center_y the y coordinate of the center of the arc + * @param radius the radius of the arc + * @param mask the arc will be drawn only in this mask + * @param start_angle the start angle of the arc (0 deg on the bottom, 90 deg on the right) + * @param end_angle the end angle of the arc + * @param clip_area the arc will be drawn only in this area + * @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable */ -void lv_draw_arc(lv_layer_t * layer, const lv_draw_arc_dsc_t * dsc); +void lv_draw_arc(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center, + uint16_t radius, uint16_t start_angle, uint16_t end_angle); /** * Get an area the should be invalidated when the arcs angle changed between start_angle and end_ange @@ -75,9 +69,8 @@ void lv_draw_arc(lv_layer_t * layer, const lv_draw_arc_dsc_t * dsc); * @param rounded true: the arc is rounded * @param area store the area to invalidate here */ -void lv_draw_arc_get_area(int32_t x, int32_t y, uint16_t radius, lv_value_precise_t start_angle, - lv_value_precise_t end_angle, - int32_t w, bool rounded, lv_area_t * area); +void lv_draw_arc_get_area(lv_coord_t x, lv_coord_t y, uint16_t radius, uint16_t start_angle, uint16_t end_angle, + lv_coord_t w, bool rounded, lv_area_t * area); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_buf.c b/L3_Middlewares/LVGL/src/draw/lv_draw_buf.c deleted file mode 100644 index a6dc29b..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_buf.c +++ /dev/null @@ -1,669 +0,0 @@ -/** - * @file lv_draw_buf.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_buf_private.h" -#include "../misc/lv_types.h" -#include "../stdlib/lv_string.h" -#include "../core/lv_global.h" -#include "../misc/lv_math.h" -#include "../misc/lv_area_private.h" - -/********************* - * DEFINES - *********************/ -#define default_handlers LV_GLOBAL_DEFAULT()->draw_buf_handlers -#define font_draw_buf_handlers LV_GLOBAL_DEFAULT()->font_draw_buf_handlers -#define image_cache_draw_buf_handlers LV_GLOBAL_DEFAULT()->image_cache_draw_buf_handlers - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void * buf_malloc(size_t size, lv_color_format_t color_format); -static void buf_free(void * buf); -static void * buf_align(void * buf, lv_color_format_t color_format); -static void * draw_buf_malloc(const lv_draw_buf_handlers_t * handler, size_t size_bytes, - lv_color_format_t color_format); -static void draw_buf_free(const lv_draw_buf_handlers_t * handler, void * buf); -static uint32_t width_to_stride(uint32_t w, lv_color_format_t color_format); -static uint32_t _calculate_draw_buf_size(uint32_t w, uint32_t h, lv_color_format_t cf, uint32_t stride); -static void draw_buf_get_full_area(const lv_draw_buf_t * draw_buf, lv_area_t * full_area); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_buf_init_handlers(void) -{ - lv_draw_buf_init_with_default_handlers(&default_handlers); - lv_draw_buf_init_with_default_handlers(&font_draw_buf_handlers); - lv_draw_buf_init_with_default_handlers(&image_cache_draw_buf_handlers); -} - -void lv_draw_buf_init_with_default_handlers(lv_draw_buf_handlers_t * handlers) -{ - lv_draw_buf_handlers_init(handlers, buf_malloc, buf_free, buf_align, NULL, NULL, width_to_stride); -} - -void lv_draw_buf_handlers_init(lv_draw_buf_handlers_t * handlers, - lv_draw_buf_malloc_cb buf_malloc_cb, - lv_draw_buf_free_cb buf_free_cb, - lv_draw_buf_align_cb align_pointer_cb, - lv_draw_buf_cache_operation_cb invalidate_cache_cb, - lv_draw_buf_cache_operation_cb flush_cache_cb, - lv_draw_buf_width_to_stride_cb width_to_stride_cb) -{ - lv_memzero(handlers, sizeof(lv_draw_buf_handlers_t)); - handlers->buf_malloc_cb = buf_malloc_cb; - handlers->buf_free_cb = buf_free_cb; - handlers->align_pointer_cb = align_pointer_cb; - handlers->invalidate_cache_cb = invalidate_cache_cb; - handlers->flush_cache_cb = flush_cache_cb; - handlers->width_to_stride_cb = width_to_stride_cb; -} - -lv_draw_buf_handlers_t * lv_draw_buf_get_handlers(void) -{ - return &default_handlers; -} - -lv_draw_buf_handlers_t * lv_draw_buf_get_font_handlers(void) -{ - return &font_draw_buf_handlers; -} - -lv_draw_buf_handlers_t * lv_draw_buf_get_image_handlers(void) -{ - return &image_cache_draw_buf_handlers; -} - -uint32_t lv_draw_buf_width_to_stride(uint32_t w, lv_color_format_t color_format) -{ - return lv_draw_buf_width_to_stride_ex(&default_handlers, w, color_format); -} - -uint32_t lv_draw_buf_width_to_stride_ex(const lv_draw_buf_handlers_t * handlers, uint32_t w, - lv_color_format_t color_format) -{ - if(handlers->width_to_stride_cb) return handlers->width_to_stride_cb(w, color_format); - else return 0; -} - -void * lv_draw_buf_align(void * data, lv_color_format_t color_format) -{ - return lv_draw_buf_align_ex(&default_handlers, data, color_format); -} - -void * lv_draw_buf_align_ex(const lv_draw_buf_handlers_t * handlers, void * data, lv_color_format_t color_format) -{ - if(handlers->align_pointer_cb) return handlers->align_pointer_cb(data, color_format); - else return NULL; -} - -void lv_draw_buf_invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area) -{ - LV_ASSERT_NULL(draw_buf); - LV_ASSERT_NULL(draw_buf->handlers); - - const lv_draw_buf_handlers_t * handlers = draw_buf->handlers; - if(!handlers->invalidate_cache_cb) { - return; - } - - lv_area_t full; - if(area == NULL) { - draw_buf_get_full_area(draw_buf, &full); - area = &full; - } - - handlers->invalidate_cache_cb(draw_buf, area); -} - -void lv_draw_buf_flush_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area) -{ - LV_ASSERT_NULL(draw_buf); - LV_ASSERT_NULL(draw_buf->handlers); - - const lv_draw_buf_handlers_t * handlers = draw_buf->handlers; - if(!handlers->flush_cache_cb) { - return; - } - - lv_area_t full; - if(area == NULL) { - draw_buf_get_full_area(draw_buf, &full); - area = &full; - } - - handlers->flush_cache_cb(draw_buf, area); -} - -void lv_draw_buf_clear(lv_draw_buf_t * draw_buf, const lv_area_t * a) -{ - LV_ASSERT_NULL(draw_buf); - - const lv_image_header_t * header = &draw_buf->header; - uint32_t stride = header->stride; - - if(a == NULL) { - uint8_t * buf = lv_draw_buf_goto_xy(draw_buf, 0, 0); - lv_memzero(buf, header->h * stride); - return; - } - - lv_area_t a_draw_buf; - a_draw_buf.x1 = 0; - a_draw_buf.y1 = 0; - a_draw_buf.x2 = draw_buf->header.w - 1; - a_draw_buf.y2 = draw_buf->header.h - 1; - - lv_area_t a_clipped; - if(!lv_area_intersect(&a_clipped, a, &a_draw_buf)) return; - if(lv_area_get_width(&a_clipped) <= 0) return; - if(lv_area_get_height(&a_clipped) <= 0) return; - - uint8_t * buf = lv_draw_buf_goto_xy(draw_buf, a_clipped.x1, a_clipped.y1); - uint8_t bpp = lv_color_format_get_bpp(header->cf); - uint32_t line_length = (lv_area_get_width(&a_clipped) * bpp + 7) >> 3; - int32_t y; - for(y = a_clipped.y1; y <= a_clipped.y2; y++) { - lv_memzero(buf, line_length); - buf += stride; - } -} - -void lv_draw_buf_copy(lv_draw_buf_t * dest, const lv_area_t * dest_area, - const lv_draw_buf_t * src, const lv_area_t * src_area) -{ - uint8_t * dest_bufc; - uint8_t * src_bufc; - int32_t line_width; - - /*Source and dest color format must be same. Color conversion is not supported yet.*/ - LV_ASSERT_FORMAT_MSG(dest->header.cf == src->header.cf, "Color format mismatch: %d != %d", - dest->header.cf, src->header.cf); - - if(dest_area == NULL) line_width = dest->header.w; - else line_width = lv_area_get_width(dest_area); - - /* For indexed image, copy the palette if we are copying full image area*/ - if(dest_area == NULL || src_area == NULL) { - if(LV_COLOR_FORMAT_IS_INDEXED(dest->header.cf)) { - lv_memcpy(dest->data, src->data, LV_COLOR_INDEXED_PALETTE_SIZE(dest->header.cf) * sizeof(lv_color32_t)); - } - } - - /*Check source and dest area have same width*/ - if((src_area == NULL && line_width != src->header.w) || \ - (src_area != NULL && line_width != lv_area_get_width(src_area))) { - LV_ASSERT_MSG(0, "Source and destination areas have different width"); - return; - } - - if(src_area) src_bufc = lv_draw_buf_goto_xy(src, src_area->x1, src_area->y1); - else src_bufc = lv_draw_buf_goto_xy(src, 0, 0); - - if(dest_area) dest_bufc = lv_draw_buf_goto_xy(dest, dest_area->x1, dest_area->y1); - else dest_bufc = lv_draw_buf_goto_xy(dest, 0, 0); - - int32_t start_y, end_y; - if(dest_area) { - start_y = dest_area->y1; - end_y = dest_area->y2; - } - else { - start_y = 0; - end_y = dest->header.h - 1; - } - - uint32_t dest_stride = dest->header.stride; - uint32_t src_stride = src->header.stride; - uint32_t line_bytes = (line_width * lv_color_format_get_bpp(dest->header.cf) + 7) >> 3; - - for(; start_y <= end_y; start_y++) { - lv_memcpy(dest_bufc, src_bufc, line_bytes); - dest_bufc += dest_stride; - src_bufc += src_stride; - } -} - -lv_result_t lv_draw_buf_init(lv_draw_buf_t * draw_buf, uint32_t w, uint32_t h, lv_color_format_t cf, uint32_t stride, - void * data, uint32_t data_size) -{ - LV_ASSERT_NULL(draw_buf); - if(draw_buf == NULL) return LV_RESULT_INVALID; - - lv_memzero(draw_buf, sizeof(lv_draw_buf_t)); - if(stride == 0) stride = lv_draw_buf_width_to_stride(w, cf); - if(stride * h > data_size) { - LV_LOG_WARN("Data size too small, required: %" LV_PRId32 ", provided: %" LV_PRId32, stride * h, - data_size); - return LV_RESULT_INVALID; - } - - lv_image_header_t * header = &draw_buf->header; - header->w = w; - header->h = h; - header->cf = cf; - header->stride = stride; - header->flags = 0; - header->magic = LV_IMAGE_HEADER_MAGIC; - - draw_buf->data = data; - draw_buf->unaligned_data = data; - draw_buf->handlers = &default_handlers; - draw_buf->data_size = data_size; - if(lv_draw_buf_align(data, cf) != draw_buf->unaligned_data) { - LV_LOG_WARN("Data is not aligned, ignored"); - } - return LV_RESULT_OK; -} - -lv_draw_buf_t * lv_draw_buf_create(uint32_t w, uint32_t h, lv_color_format_t cf, uint32_t stride) -{ - return lv_draw_buf_create_ex(&default_handlers, w, h, cf, stride); -} - -lv_draw_buf_t * lv_draw_buf_create_ex(const lv_draw_buf_handlers_t * handlers, uint32_t w, uint32_t h, - lv_color_format_t cf, uint32_t stride) -{ - lv_draw_buf_t * draw_buf = lv_malloc_zeroed(sizeof(lv_draw_buf_t)); - LV_ASSERT_MALLOC(draw_buf); - if(draw_buf == NULL) return NULL; - if(stride == 0) stride = lv_draw_buf_width_to_stride(w, cf); - - uint32_t size = _calculate_draw_buf_size(w, h, cf, stride); - - void * buf = draw_buf_malloc(handlers, size, cf); - /*Do not assert here as LVGL or the app might just want to try creating a draw_buf*/ - if(buf == NULL) { - LV_LOG_WARN("No memory: %"LV_PRIu32"x%"LV_PRIu32", cf: %d, stride: %"LV_PRIu32", %"LV_PRIu32"Byte, ", - w, h, cf, stride, size); - lv_free(draw_buf); - return NULL; - } - - draw_buf->header.w = w; - draw_buf->header.h = h; - draw_buf->header.cf = cf; - draw_buf->header.flags = LV_IMAGE_FLAGS_MODIFIABLE | LV_IMAGE_FLAGS_ALLOCATED; - draw_buf->header.stride = stride; - draw_buf->header.magic = LV_IMAGE_HEADER_MAGIC; - draw_buf->data = lv_draw_buf_align(buf, cf); - draw_buf->unaligned_data = buf; - draw_buf->data_size = size; - draw_buf->handlers = handlers; - return draw_buf; -} - -lv_draw_buf_t * lv_draw_buf_dup(const lv_draw_buf_t * draw_buf) -{ - return lv_draw_buf_dup_ex(&default_handlers, draw_buf); -} - -lv_draw_buf_t * lv_draw_buf_dup_ex(const lv_draw_buf_handlers_t * handlers, const lv_draw_buf_t * draw_buf) -{ - const lv_image_header_t * header = &draw_buf->header; - lv_draw_buf_t * new_buf = lv_draw_buf_create_ex(handlers, header->w, header->h, header->cf, header->stride); - if(new_buf == NULL) return NULL; - - new_buf->header.flags = draw_buf->header.flags; - new_buf->header.flags |= LV_IMAGE_FLAGS_MODIFIABLE | LV_IMAGE_FLAGS_ALLOCATED; - - /*Choose the smaller size to copy*/ - uint32_t size = LV_MIN(draw_buf->data_size, new_buf->data_size); - - /*Copy image data*/ - lv_memcpy(new_buf->data, draw_buf->data, size); - return new_buf; -} - -lv_draw_buf_t * lv_draw_buf_reshape(lv_draw_buf_t * draw_buf, lv_color_format_t cf, uint32_t w, uint32_t h, - uint32_t stride) -{ - if(draw_buf == NULL) return NULL; - - /*If color format is unknown, keep using the original color format.*/ - if(cf == LV_COLOR_FORMAT_UNKNOWN) cf = draw_buf->header.cf; - if(stride == 0) stride = lv_draw_buf_width_to_stride(w, cf); - - uint32_t size = _calculate_draw_buf_size(w, h, cf, stride); - - if(size > draw_buf->data_size) { - LV_LOG_TRACE("Draw buf too small for new shape"); - return NULL; - } - - draw_buf->header.cf = cf; - draw_buf->header.w = w; - draw_buf->header.h = h; - draw_buf->header.stride = stride; - - return draw_buf; -} - -void lv_draw_buf_destroy(lv_draw_buf_t * draw_buf) -{ - LV_ASSERT_NULL(draw_buf); - if(draw_buf == NULL) return; - - if(draw_buf->header.flags & LV_IMAGE_FLAGS_ALLOCATED) { - LV_ASSERT_NULL(draw_buf->handlers); - - const lv_draw_buf_handlers_t * handlers = draw_buf->handlers; - draw_buf_free(handlers, draw_buf->unaligned_data); - lv_free(draw_buf); - } - else { - LV_LOG_ERROR("draw buffer is not allocated, ignored"); - } -} - -void * lv_draw_buf_goto_xy(const lv_draw_buf_t * buf, uint32_t x, uint32_t y) -{ - LV_ASSERT_NULL(buf); - if(buf == NULL) return NULL; - - uint8_t * data = buf->data; - - /*Skip palette*/ - data += LV_COLOR_INDEXED_PALETTE_SIZE(buf->header.cf) * sizeof(lv_color32_t); - data += buf->header.stride * y; - - if(x == 0) return data; - - return data + x * lv_color_format_get_bpp(buf->header.cf) / 8; -} - -lv_result_t lv_draw_buf_adjust_stride(lv_draw_buf_t * src, uint32_t stride) -{ - LV_ASSERT_NULL(src); - LV_ASSERT_NULL(src->data); - if(src == NULL) return LV_RESULT_INVALID; - if(src->data == NULL) return LV_RESULT_INVALID; - - const lv_image_header_t * header = &src->header; - uint32_t w = header->w; - uint32_t h = header->h; - - if(!lv_draw_buf_has_flag(src, LV_IMAGE_FLAGS_MODIFIABLE)) { - return LV_RESULT_INVALID; - } - - /*Use global stride*/ - if(stride == 0) stride = lv_draw_buf_width_to_stride(w, header->cf); - - /*Check if stride already match*/ - if(header->stride == stride) return LV_RESULT_OK; - - /*Calculate the minimal stride allowed from bpp*/ - uint32_t bpp = lv_color_format_get_bpp(header->cf); - uint32_t min_stride = (w * bpp + 7) >> 3; - if(stride < min_stride) { - LV_LOG_WARN("New stride is too small. min: %" LV_PRId32, min_stride); - return LV_RESULT_INVALID; - } - - /*Check if buffer has enough space. */ - uint32_t new_size = _calculate_draw_buf_size(w, h, header->cf, stride); - if(new_size > src->data_size) { - return LV_RESULT_INVALID; - } - - uint32_t offset = LV_COLOR_INDEXED_PALETTE_SIZE(header->cf) * 4; - - if(stride > header->stride) { - /*Copy from the last line to the first*/ - uint8_t * src_data = src->data + offset + header->stride * (h - 1); - uint8_t * dst_data = src->data + offset + stride * (h - 1); - for(uint32_t y = 0; y < h; y++) { - lv_memmove(dst_data, src_data, min_stride); - src_data -= header->stride; - dst_data -= stride; - } - } - else { - /*Copy from the first line to the last*/ - uint8_t * src_data = src->data + offset; - uint8_t * dst_data = src->data + offset; - for(uint32_t y = 0; y < h; y++) { - lv_memmove(dst_data, src_data, min_stride); - src_data += header->stride; - dst_data += stride; - } - } - - src->header.stride = stride; - - return LV_RESULT_OK; -} - -lv_result_t lv_draw_buf_premultiply(lv_draw_buf_t * draw_buf) -{ - LV_ASSERT_NULL(draw_buf); - if(draw_buf == NULL) return LV_RESULT_INVALID; - - if(draw_buf->header.flags & LV_IMAGE_FLAGS_PREMULTIPLIED) return LV_RESULT_INVALID; - if((draw_buf->header.flags & LV_IMAGE_FLAGS_MODIFIABLE) == 0) { - LV_LOG_WARN("draw buf is not modifiable: 0x%04x", draw_buf->header.flags); - return LV_RESULT_INVALID; - } - - /*Premultiply color with alpha, do case by case by judging color format*/ - lv_color_format_t cf = draw_buf->header.cf; - if(LV_COLOR_FORMAT_IS_INDEXED(cf)) { - int size = LV_COLOR_INDEXED_PALETTE_SIZE(cf); - lv_color32_t * palette = (lv_color32_t *)draw_buf->data; - for(int i = 0; i < size; i++) { - lv_color_premultiply(&palette[i]); - } - } - else if(cf == LV_COLOR_FORMAT_ARGB8888) { - uint32_t h = draw_buf->header.h; - uint32_t w = draw_buf->header.w; - uint32_t stride = draw_buf->header.stride; - uint8_t * line = (uint8_t *)draw_buf->data; - for(uint32_t y = 0; y < h; y++) { - lv_color32_t * pixel = (lv_color32_t *)line; - for(uint32_t x = 0; x < w; x++) { - lv_color_premultiply(pixel); - pixel++; - } - line += stride; - } - } - else if(cf == LV_COLOR_FORMAT_RGB565A8) { - uint32_t h = draw_buf->header.h; - uint32_t w = draw_buf->header.w; - uint32_t stride = draw_buf->header.stride; - uint32_t alpha_stride = stride / 2; - uint8_t * line = (uint8_t *)draw_buf->data; - lv_opa_t * alpha = (lv_opa_t *)(line + stride * h); - for(uint32_t y = 0; y < h; y++) { - lv_color16_t * pixel = (lv_color16_t *)line; - for(uint32_t x = 0; x < w; x++) { - lv_color16_premultiply(pixel, alpha[x]); - pixel++; - } - line += stride; - alpha += alpha_stride; - } - } - else if(cf == LV_COLOR_FORMAT_ARGB8565) { - uint32_t h = draw_buf->header.h; - uint32_t w = draw_buf->header.w; - uint32_t stride = draw_buf->header.stride; - uint8_t * line = (uint8_t *)draw_buf->data; - for(uint32_t y = 0; y < h; y++) { - uint8_t * pixel = line; - for(uint32_t x = 0; x < w; x++) { - uint8_t alpha = pixel[2]; - lv_color16_premultiply((lv_color16_t *)pixel, alpha); - pixel += 3; - } - line += stride; - } - } - else if(LV_COLOR_FORMAT_IS_ALPHA_ONLY(cf)) { - /*Pass*/ - } - else { - LV_LOG_WARN("draw buf has no alpha, cf: %d", cf); - } - - draw_buf->header.flags |= LV_IMAGE_FLAGS_PREMULTIPLIED; - - return LV_RESULT_OK; -} - -void lv_draw_buf_set_palette(lv_draw_buf_t * draw_buf, uint8_t index, lv_color32_t color) -{ - LV_ASSERT_NULL(draw_buf); - if(draw_buf == NULL) return; - - if(!LV_COLOR_FORMAT_IS_INDEXED(draw_buf->header.cf)) { - LV_LOG_WARN("Not indexed color format"); - return; - } - - lv_color32_t * palette = (lv_color32_t *)draw_buf->data; - palette[index] = color; -} - -bool lv_draw_buf_has_flag(const lv_draw_buf_t * draw_buf, lv_image_flags_t flag) -{ - return draw_buf->header.flags & flag; -} - -void lv_draw_buf_set_flag(lv_draw_buf_t * draw_buf, lv_image_flags_t flag) -{ - draw_buf->header.flags |= flag; -} - -void lv_draw_buf_clear_flag(lv_draw_buf_t * draw_buf, lv_image_flags_t flag) -{ - draw_buf->header.flags &= ~flag; -} - -void lv_draw_buf_from_image(lv_draw_buf_t * buf, const lv_image_dsc_t * img) -{ - lv_draw_buf_init(buf, img->header.w, img->header.h, img->header.cf, img->header.stride, - (void *)img->data, img->data_size); - buf->header.flags = img->header.flags; -} - -void lv_draw_buf_to_image(const lv_draw_buf_t * buf, lv_image_dsc_t * img) -{ - lv_memcpy((void *)img, buf, sizeof(lv_image_dsc_t)); -} - -void lv_image_buf_set_palette(lv_image_dsc_t * dsc, uint8_t id, lv_color32_t c) -{ - LV_LOG_WARN("Deprecated API, use lv_draw_buf_set_palette instead."); - lv_draw_buf_set_palette((lv_draw_buf_t *)dsc, id, c); -} - -void lv_image_buf_free(lv_image_dsc_t * dsc) -{ - LV_LOG_WARN("Deprecated API, use lv_draw_buf_destroy instead."); - if(dsc != NULL) { - if(dsc->data != NULL) - lv_free((void *)dsc->data); - - lv_free((void *)dsc); - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void * buf_malloc(size_t size_bytes, lv_color_format_t color_format) -{ - LV_UNUSED(color_format); - - /*Allocate larger memory to be sure it can be aligned as needed*/ - size_bytes += LV_DRAW_BUF_ALIGN - 1; - return lv_malloc(size_bytes); -} - -static void buf_free(void * buf) -{ - lv_free(buf); -} - -static void * buf_align(void * buf, lv_color_format_t color_format) -{ - LV_UNUSED(color_format); - - uint8_t * buf_u8 = buf; - if(buf_u8) { - buf_u8 = (uint8_t *)LV_ROUND_UP((lv_uintptr_t)buf_u8, LV_DRAW_BUF_ALIGN); - } - return buf_u8; -} - -static uint32_t width_to_stride(uint32_t w, lv_color_format_t color_format) -{ - uint32_t width_byte; - width_byte = w * lv_color_format_get_bpp(color_format); - width_byte = (width_byte + 7) >> 3; /*Round up*/ - - return LV_ROUND_UP(width_byte, LV_DRAW_BUF_STRIDE_ALIGN); -} - -static void * draw_buf_malloc(const lv_draw_buf_handlers_t * handlers, size_t size_bytes, - lv_color_format_t color_format) -{ - if(handlers->buf_malloc_cb) return handlers->buf_malloc_cb(size_bytes, color_format); - else return NULL; -} - -static void draw_buf_free(const lv_draw_buf_handlers_t * handlers, void * buf) -{ - if(handlers->buf_free_cb) - handlers->buf_free_cb(buf); -} - -/** - * For given width, height, color format, and stride, calculate the size needed for a new draw buffer. - */ -static uint32_t _calculate_draw_buf_size(uint32_t w, uint32_t h, lv_color_format_t cf, uint32_t stride) -{ - uint32_t size; - - if(stride == 0) stride = lv_draw_buf_width_to_stride(w, cf); - - size = stride * h; - if(cf == LV_COLOR_FORMAT_RGB565A8) { - size += (stride / 2) * h; /*A8 mask*/ - } - else if(LV_COLOR_FORMAT_IS_INDEXED(cf)) { - /*@todo we have to include palette right before image data*/ - size += LV_COLOR_INDEXED_PALETTE_SIZE(cf) * 4; - } - - return size; -} - -static void draw_buf_get_full_area(const lv_draw_buf_t * draw_buf, lv_area_t * full_area) -{ - const lv_image_header_t * header = &draw_buf->header; - lv_area_set(full_area, 0, 0, header->w - 1, header->h - 1); -} diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_buf.h b/L3_Middlewares/LVGL/src/draw/lv_draw_buf.h deleted file mode 100644 index 22b09de..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_buf.h +++ /dev/null @@ -1,356 +0,0 @@ -/** - * @file lv_draw_buf.h - * - */ - -#ifndef LV_DRAW_BUF_H -#define LV_DRAW_BUF_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../misc/lv_types.h" -#include "../misc/lv_area.h" -#include "../misc/lv_color.h" -#include "../stdlib/lv_string.h" -#include "lv_image_dsc.h" - -/********************* - * DEFINES - *********************/ - -/** Use this value to let LVGL calculate stride automatically */ -#define LV_STRIDE_AUTO 0 -LV_EXPORT_CONST_INT(LV_STRIDE_AUTO); - -/** - * Stride alignment for draw buffers. - * It may vary between different color formats and hardware. - * Refine it to suit your needs. - */ - -#define LV_DRAW_BUF_STRIDE(w, cf) \ - LV_ROUND_UP(((w) * LV_COLOR_FORMAT_GET_BPP(cf) + 7) / 8, LV_DRAW_BUF_STRIDE_ALIGN) - -/** Allocate a slightly larger buffer, so we can adjust the start address to meet alignment */ -#define LV_DRAW_BUF_SIZE(w, h, cf) \ - (LV_DRAW_BUF_STRIDE(w, cf) * (h) + LV_DRAW_BUF_ALIGN + \ - LV_COLOR_INDEXED_PALETTE_SIZE(cf) * sizeof(lv_color32_t)) - -/** - * Define a static draw buffer with the given width, height, and color format. - * Stride alignment is set to LV_DRAW_BUF_STRIDE_ALIGN. - * - * For platform that needs special buffer alignment, call LV_DRAW_BUF_INIT_STATIC. - */ -#define LV_DRAW_BUF_DEFINE_STATIC(name, _w, _h, _cf) \ - static uint8_t buf_##name[LV_DRAW_BUF_SIZE(_w, _h, _cf)]; \ - static lv_draw_buf_t name = { \ - .header = { \ - .magic = LV_IMAGE_HEADER_MAGIC, \ - .cf = (_cf), \ - .flags = LV_IMAGE_FLAGS_MODIFIABLE, \ - .w = (_w), \ - .h = (_h), \ - .stride = LV_DRAW_BUF_STRIDE(_w, _cf), \ - .reserved_2 = 0, \ - }, \ - .data_size = sizeof(buf_##name), \ - .data = buf_##name, \ - .unaligned_data = buf_##name, \ - } - -#define LV_DRAW_BUF_INIT_STATIC(name) \ - do { \ - lv_image_header_t * header = &name.header; \ - lv_draw_buf_init(&name, header->w, header->h, (lv_color_format_t)header->cf, header->stride, buf_##name, sizeof(buf_##name)); \ - lv_draw_buf_set_flag(&name, LV_IMAGE_FLAGS_MODIFIABLE); \ - } while(0) - -/********************** - * TYPEDEFS - **********************/ - -typedef void * (*lv_draw_buf_malloc_cb)(size_t size, lv_color_format_t color_format); - -typedef void (*lv_draw_buf_free_cb)(void * draw_buf); - -typedef void * (*lv_draw_buf_align_cb)(void * buf, lv_color_format_t color_format); - -typedef void (*lv_draw_buf_cache_operation_cb)(const lv_draw_buf_t * draw_buf, const lv_area_t * area); - -typedef uint32_t (*lv_draw_buf_width_to_stride_cb)(uint32_t w, lv_color_format_t color_format); - -struct lv_draw_buf_t { - lv_image_header_t header; - uint32_t data_size; /**< Total buf size in bytes */ - uint8_t * data; - void * unaligned_data; /**< Unaligned address of `data`, used internally by lvgl */ - const lv_draw_buf_handlers_t * handlers; /**< draw buffer alloc/free ops. */ -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize the draw buffer with the default handlers. - * - * @param handlers the draw buffer handlers to set - */ -void lv_draw_buf_init_with_default_handlers(lv_draw_buf_handlers_t * handlers); - -/** - * Initialize the draw buffer with given handlers. - * - * @param handlers the draw buffer handlers to set - * @param buf_malloc_cb the callback to allocate memory for the buffer - * @param buf_free_cb the callback to free memory of the buffer - * @param align_pointer_cb the callback to align the buffer - * @param invalidate_cache_cb the callback to invalidate the cache of the buffer - * @param flush_cache_cb the callback to flush buffer - * @param width_to_stride_cb the callback to calculate the stride based on the width and color format - */ -void lv_draw_buf_handlers_init(lv_draw_buf_handlers_t * handlers, - lv_draw_buf_malloc_cb buf_malloc_cb, - lv_draw_buf_free_cb buf_free_cb, - lv_draw_buf_align_cb align_pointer_cb, - lv_draw_buf_cache_operation_cb invalidate_cache_cb, - lv_draw_buf_cache_operation_cb flush_cache_cb, - lv_draw_buf_width_to_stride_cb width_to_stride_cb); - -/** - * Get the struct which holds the callbacks for draw buf management. - * Custom callback can be set on the returned value - * @return pointer to the struct of handlers - */ -lv_draw_buf_handlers_t * lv_draw_buf_get_handlers(void); -lv_draw_buf_handlers_t * lv_draw_buf_get_font_handlers(void); -lv_draw_buf_handlers_t * lv_draw_buf_get_image_handlers(void); - - -/** - * Align the address of a buffer. The buffer needs to be large enough for the real data after alignment - * @param buf the data to align - * @param color_format the color format of the buffer - * @return the aligned buffer - */ -void * lv_draw_buf_align(void * buf, lv_color_format_t color_format); - -/** - * Align the address of a buffer with custom draw buffer handlers. - * The buffer needs to be large enough for the real data after alignment - * @param handlers the draw buffer handlers - * @param buf the data to align - * @param color_format the color format of the buffer - * @return the aligned buffer - */ -void * lv_draw_buf_align_ex(const lv_draw_buf_handlers_t * handlers, void * buf, lv_color_format_t color_format); - -/** - * Invalidate the cache of the buffer - * @param draw_buf the draw buffer needs to be invalidated - * @param area the area to invalidate in the buffer, - * use NULL to invalidate the whole draw buffer address range - */ -void lv_draw_buf_invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area); - -/** - * Flush the cache of the buffer - * @param draw_buf the draw buffer needs to be flushed - * @param area the area to flush in the buffer, - * use NULL to flush the whole draw buffer address range - */ -void lv_draw_buf_flush_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area); - -/** - * Calculate the stride in bytes based on a width and color format - * @param w the width in pixels - * @param color_format the color format - * @return the stride in bytes - */ -uint32_t lv_draw_buf_width_to_stride(uint32_t w, lv_color_format_t color_format); - -/** - * Calculate the stride in bytes based on a width and color format - * @param handlers the draw buffer handlers - * @param w the width in pixels - * @param color_format the color format - * @return the stride in bytes - */ -uint32_t lv_draw_buf_width_to_stride_ex(const lv_draw_buf_handlers_t * handlers, uint32_t w, - lv_color_format_t color_format); - -/** - * Clear an area on the buffer - * @param draw_buf pointer to draw buffer - * @param a the area to clear, or NULL to clear the whole buffer - */ -void lv_draw_buf_clear(lv_draw_buf_t * draw_buf, const lv_area_t * a); - -/** - * Copy an area from a buffer to another - * @param dest pointer to the destination draw buffer - * @param dest_area the area to copy from the destination buffer, if NULL, use the whole buffer - * @param src pointer to the source draw buffer - * @param src_area the area to copy from the destination buffer, if NULL, use the whole buffer - * @note `dest_area` and `src_area` should have the same width and height - * @note `dest` and `src` should have same color format. Color converting is not supported fow now. - */ -void lv_draw_buf_copy(lv_draw_buf_t * dest, const lv_area_t * dest_area, - const lv_draw_buf_t * src, const lv_area_t * src_area); - -/** - * Note: Eventually, lv_draw_buf_malloc/free will be kept as private. - * For now, we use `create` to distinguish with malloc. - * - * Create an draw buf by allocating struct for `lv_draw_buf_t` and allocating a buffer for it - * that meets specified requirements. - * - * @param w the buffer width in pixels - * @param h the buffer height in pixels - * @param cf the color format for image - * @param stride the stride in bytes for image. Use 0 for automatic calculation based on - * w, cf, and global stride alignment configuration. - */ -lv_draw_buf_t * lv_draw_buf_create(uint32_t w, uint32_t h, lv_color_format_t cf, uint32_t stride); - -/** - * Note: Eventually, lv_draw_buf_malloc/free will be kept as private. - * For now, we use `create` to distinguish with malloc. - * - * Create an draw buf by allocating struct for `lv_draw_buf_t` and allocating a buffer for it - * that meets specified requirements. - * - * @param handlers the draw buffer handlers - * @param w the buffer width in pixels - * @param h the buffer height in pixels - * @param cf the color format for image - * @param stride the stride in bytes for image. Use 0 for automatic calculation based on - * w, cf, and global stride alignment configuration. - */ -lv_draw_buf_t * lv_draw_buf_create_ex(const lv_draw_buf_handlers_t * handlers, uint32_t w, uint32_t h, - lv_color_format_t cf, uint32_t stride); - -/** - * Duplicate a draw buf with same image size, stride and color format. Copy the image data too. - * @param draw_buf the draw buf to duplicate - * @return the duplicated draw buf on success, NULL if failed - */ -lv_draw_buf_t * lv_draw_buf_dup(const lv_draw_buf_t * draw_buf); - -/** - * Duplicate a draw buf with same image size, stride and color format. Copy the image data too. - * @param handlers the draw buffer handlers - * @param draw_buf the draw buf to duplicate - * @return the duplicated draw buf on success, NULL if failed - */ -lv_draw_buf_t * lv_draw_buf_dup_ex(const lv_draw_buf_handlers_t * handlers, const lv_draw_buf_t * draw_buf); - -/** - * Initialize a draw buf with the given buffer and parameters. Clear draw buffer flag to zero. - * @param draw_buf the draw buf to initialize - * @param w the buffer width in pixels - * @param h the buffer height in pixels - * @param cf the color format - * @param stride the stride in bytes. Use 0 for automatic calculation - * @param data the buffer used for drawing. Unaligned `data` will be aligned internally - * @param data_size the size of the buffer in bytes - * @return return LV_RESULT_OK on success, LV_RESULT_INVALID otherwise - */ -lv_result_t lv_draw_buf_init(lv_draw_buf_t * draw_buf, uint32_t w, uint32_t h, lv_color_format_t cf, uint32_t stride, - void * data, uint32_t data_size); - -/** - * Keep using the existing memory, reshape the draw buffer to the given width and height. - * Return NULL if data_size is smaller than the required size. - * @param draw_buf pointer to a draw buffer - * @param cf the new color format, use 0 or LV_COLOR_FORMAT_UNKNOWN to keep using the original color format. - * @param w the new width in pixels - * @param h the new height in pixels - * @param stride the stride in bytes for image. Use 0 for automatic calculation. - */ -lv_draw_buf_t * lv_draw_buf_reshape(lv_draw_buf_t * draw_buf, lv_color_format_t cf, uint32_t w, uint32_t h, - uint32_t stride); - -/** - * Destroy a draw buf by freeing the actual buffer if it's marked as LV_IMAGE_FLAGS_ALLOCATED in header. - * Then free the lv_draw_buf_t struct. - * - * @param draw_buf the draw buffer to destroy - */ -void lv_draw_buf_destroy(lv_draw_buf_t * draw_buf); - -/** - * Return pointer to the buffer at the given coordinates - */ -void * lv_draw_buf_goto_xy(const lv_draw_buf_t * buf, uint32_t x, uint32_t y); - -/** - * Adjust the stride of a draw buf in place. - * @param src pointer to a draw buffer - * @param stride the new stride in bytes for image. Use LV_STRIDE_AUTO for automatic calculation. - * @return LV_RESULT_OK: success or LV_RESULT_INVALID: failed - */ -lv_result_t lv_draw_buf_adjust_stride(lv_draw_buf_t * src, uint32_t stride); - -/** - * Premultiply draw buffer color with alpha channel. - * If it's already premultiplied, return directly. - * Only color formats with alpha channel will be processed. - * - * @return LV_RESULT_OK: premultiply success - */ -lv_result_t lv_draw_buf_premultiply(lv_draw_buf_t * draw_buf); - -bool lv_draw_buf_has_flag(const lv_draw_buf_t * draw_buf, lv_image_flags_t flag); - -void lv_draw_buf_set_flag(lv_draw_buf_t * draw_buf, lv_image_flags_t flag); - -void lv_draw_buf_clear_flag(lv_draw_buf_t * draw_buf, lv_image_flags_t flag); - -/** - * As of now, draw buf share same definition as `lv_image_dsc_t`. - * And is interchangeable with `lv_image_dsc_t`. - */ - -void lv_draw_buf_from_image(lv_draw_buf_t * buf, const lv_image_dsc_t * img); - -void lv_draw_buf_to_image(const lv_draw_buf_t * buf, lv_image_dsc_t * img); - -/** - * Set the palette color of an indexed image. Valid only for `LV_COLOR_FORMAT_I1/2/4/8` - * @param draw_buf pointer to an image descriptor - * @param index the palette color to set: - * - for `LV_COLOR_FORMAT_I1`: 0..1 - * - for `LV_COLOR_FORMAT_I2`: 0..3 - * - for `LV_COLOR_FORMAT_I4`: 0..15 - * - for `LV_COLOR_FORMAT_I8`: 0..255 - * @param color the color to set in lv_color32_t format - */ -void lv_draw_buf_set_palette(lv_draw_buf_t * draw_buf, uint8_t index, lv_color32_t color); - -/** - * @deprecated Use lv_draw_buf_set_palette instead. - */ -void lv_image_buf_set_palette(lv_image_dsc_t * dsc, uint8_t id, lv_color32_t c); - -/** - * @deprecated Use lv_draw_buffer_create/destroy instead. - * Free the data pointer and dsc struct of an image. - */ -void lv_image_buf_free(lv_image_dsc_t * dsc); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_BUF_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_buf_private.h b/L3_Middlewares/LVGL/src/draw/lv_draw_buf_private.h deleted file mode 100644 index 051f9ba..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_buf_private.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file lv_draw_buf_private.h - * - */ - -#ifndef LV_DRAW_BUF_PRIVATE_H -#define LV_DRAW_BUF_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_buf.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_draw_buf_handlers_t { - lv_draw_buf_malloc_cb buf_malloc_cb; - lv_draw_buf_free_cb buf_free_cb; - lv_draw_buf_align_cb align_pointer_cb; - lv_draw_buf_cache_operation_cb invalidate_cache_cb; - lv_draw_buf_cache_operation_cb flush_cache_cb; - lv_draw_buf_width_to_stride_cb width_to_stride_cb; -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Called internally to initialize the draw_buf_handlers in lv_global - */ -void lv_draw_buf_init_handlers(void); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_BUF_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_image.c b/L3_Middlewares/LVGL/src/draw/lv_draw_image.c deleted file mode 100644 index 4580457..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_image.c +++ /dev/null @@ -1,314 +0,0 @@ -/** - * @file lv_draw_img.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_image_private.h" -#include "../misc/lv_area_private.h" -#include "lv_image_decoder_private.h" -#include "lv_draw_private.h" -#include "../display/lv_display.h" -#include "../misc/lv_log.h" -#include "../misc/lv_math.h" -#include "../core/lv_refr.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void img_decode_and_draw(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - lv_image_decoder_dsc_t * decoder_dsc, lv_area_t * relative_decoded_area, - const lv_area_t * img_area, const lv_area_t * clipped_img_area, - lv_draw_image_core_cb draw_core_cb); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_image_dsc_init(lv_draw_image_dsc_t * dsc) -{ - lv_memzero(dsc, sizeof(lv_draw_image_dsc_t)); - dsc->recolor = lv_color_black(); - dsc->opa = LV_OPA_COVER; - dsc->scale_x = LV_SCALE_NONE; - dsc->scale_y = LV_SCALE_NONE; - dsc->antialias = LV_COLOR_DEPTH > 8 ? 1 : 0; - dsc->image_area.x2 = LV_COORD_MIN; /*Indicate invalid area by default by setting a negative size*/ - dsc->base.dsc_size = sizeof(lv_draw_image_dsc_t); -} - -lv_draw_image_dsc_t * lv_draw_task_get_image_dsc(lv_draw_task_t * task) -{ - return task->type == LV_DRAW_TASK_TYPE_IMAGE ? (lv_draw_image_dsc_t *)task->draw_dsc : NULL; -} - -void lv_draw_layer(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords) -{ - if(dsc->scale_x <= 0 || dsc->scale_y <= 0) { - /* NOT draw if scale is negative or zero */ - return; - } - - lv_draw_task_t * t = lv_draw_add_task(layer, coords); - - t->draw_dsc = lv_malloc(sizeof(*dsc)); - lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc)); - t->type = LV_DRAW_TASK_TYPE_LAYER; - t->state = LV_DRAW_TASK_STATE_WAITING; - - lv_image_buf_get_transformed_area(&t->_real_area, lv_area_get_width(coords), lv_area_get_height(coords), - dsc->rotation, dsc->scale_x, dsc->scale_y, &dsc->pivot); - lv_area_move(&t->_real_area, coords->x1, coords->y1); - - lv_layer_t * layer_to_draw = (lv_layer_t *)dsc->src; - layer_to_draw->all_tasks_added = true; - - lv_draw_finalize_task_creation(layer, t); -} - -void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords) -{ - if(dsc->src == NULL) { - LV_LOG_WARN("Image draw: src is NULL"); - return; - } - if(dsc->opa <= LV_OPA_MIN) return; - - if(dsc->scale_x <= 0 || dsc->scale_y <= 0) { - /* NOT draw if scale is negative or zero */ - return; - } - - LV_PROFILER_BEGIN; - - lv_draw_image_dsc_t * new_image_dsc = lv_malloc(sizeof(*dsc)); - lv_memcpy(new_image_dsc, dsc, sizeof(*dsc)); - lv_result_t res = lv_image_decoder_get_info(new_image_dsc->src, &new_image_dsc->header); - if(res != LV_RESULT_OK) { - LV_LOG_WARN("Couldn't get info about the image"); - lv_free(new_image_dsc); - return; - } - - lv_draw_task_t * t = lv_draw_add_task(layer, coords); - t->draw_dsc = new_image_dsc; - t->type = LV_DRAW_TASK_TYPE_IMAGE; - - lv_image_buf_get_transformed_area(&t->_real_area, lv_area_get_width(coords), lv_area_get_height(coords), - dsc->rotation, dsc->scale_x, dsc->scale_y, &dsc->pivot); - lv_area_move(&t->_real_area, coords->x1, coords->y1); - - lv_draw_finalize_task_creation(layer, t); - LV_PROFILER_END; -} - -lv_image_src_t lv_image_src_get_type(const void * src) -{ - if(src == NULL) return LV_IMAGE_SRC_UNKNOWN; - const uint8_t * u8_p = src; - - /*The first byte shows the type of the image source*/ - if(u8_p[0] >= 0x20 && u8_p[0] <= 0x7F) { - return LV_IMAGE_SRC_FILE; /*If it's an ASCII character then it's file name*/ - } - else if(u8_p[0] >= 0x80) { - return LV_IMAGE_SRC_SYMBOL; /*Symbols begins after 0x7F*/ - } - else { - return LV_IMAGE_SRC_VARIABLE; /*`lv_image_dsc_t` is draw to the first byte < 0x20*/ - } -} - -void lv_draw_image_normal_helper(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords, lv_draw_image_core_cb draw_core_cb) -{ - if(draw_core_cb == NULL) { - LV_LOG_WARN("draw_core_cb is NULL"); - return; - } - - lv_area_t draw_area; - lv_area_copy(&draw_area, coords); - if(draw_dsc->rotation || draw_dsc->scale_x != LV_SCALE_NONE || draw_dsc->scale_y != LV_SCALE_NONE) { - int32_t w = lv_area_get_width(coords); - int32_t h = lv_area_get_height(coords); - - lv_image_buf_get_transformed_area(&draw_area, w, h, draw_dsc->rotation, draw_dsc->scale_x, draw_dsc->scale_y, - &draw_dsc->pivot); - - draw_area.x1 += coords->x1; - draw_area.y1 += coords->y1; - draw_area.x2 += coords->x1; - draw_area.y2 += coords->y1; - } - - lv_area_t clipped_img_area; - if(!lv_area_intersect(&clipped_img_area, &draw_area, draw_unit->clip_area)) { - return; - } - - lv_image_decoder_dsc_t decoder_dsc; - lv_result_t res = lv_image_decoder_open(&decoder_dsc, draw_dsc->src, NULL); - if(res != LV_RESULT_OK) { - LV_LOG_ERROR("Failed to open image"); - return; - } - - img_decode_and_draw(draw_unit, draw_dsc, &decoder_dsc, NULL, coords, &clipped_img_area, draw_core_cb); - - lv_image_decoder_close(&decoder_dsc); -} - -void lv_draw_image_tiled_helper(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords, lv_draw_image_core_cb draw_core_cb) -{ - if(draw_core_cb == NULL) { - LV_LOG_WARN("draw_core_cb is NULL"); - return; - } - - lv_image_decoder_dsc_t decoder_dsc; - lv_result_t res = lv_image_decoder_open(&decoder_dsc, draw_dsc->src, NULL); - if(res != LV_RESULT_OK) { - LV_LOG_ERROR("Failed to open image"); - return; - } - - int32_t img_w = draw_dsc->header.w; - int32_t img_h = draw_dsc->header.h; - - lv_area_t tile_area; - if(lv_area_get_width(&draw_dsc->image_area) >= 0) { - tile_area = draw_dsc->image_area; - } - else { - tile_area = *coords; - } - lv_area_set_width(&tile_area, img_w); - lv_area_set_height(&tile_area, img_h); - - int32_t tile_x_start = tile_area.x1; - - lv_area_t relative_decoded_area = { - .x1 = LV_COORD_MIN, - .y1 = LV_COORD_MIN, - .x2 = LV_COORD_MIN, - .y2 = LV_COORD_MIN, - }; - - while(tile_area.y1 <= coords->y2) { - while(tile_area.x1 <= coords->x2) { - - lv_area_t clipped_img_area; - if(lv_area_intersect(&clipped_img_area, &tile_area, coords)) { - img_decode_and_draw(draw_unit, draw_dsc, &decoder_dsc, &relative_decoded_area, &tile_area, &clipped_img_area, - draw_core_cb); - } - - tile_area.x1 += img_w; - tile_area.x2 += img_w; - } - - tile_area.y1 += img_h; - tile_area.y2 += img_h; - tile_area.x1 = tile_x_start; - tile_area.x2 = tile_x_start + img_w - 1; - } - - lv_image_decoder_close(&decoder_dsc); -} - -void lv_image_buf_get_transformed_area(lv_area_t * res, int32_t w, int32_t h, int32_t angle, - uint16_t scale_x, uint16_t scale_y, const lv_point_t * pivot) -{ - if(angle == 0 && scale_x == LV_SCALE_NONE && scale_y == LV_SCALE_NONE) { - res->x1 = 0; - res->y1 = 0; - res->x2 = w - 1; - res->y2 = h - 1; - return; - } - - lv_point_t p[4] = { - {0, 0}, - {w, 0}, - {0, h}, - {w, h}, - }; - lv_point_transform(&p[0], angle, scale_x, scale_y, pivot, true); - lv_point_transform(&p[1], angle, scale_x, scale_y, pivot, true); - lv_point_transform(&p[2], angle, scale_x, scale_y, pivot, true); - lv_point_transform(&p[3], angle, scale_x, scale_y, pivot, true); - res->x1 = LV_MIN4(p[0].x, p[1].x, p[2].x, p[3].x); - res->x2 = LV_MAX4(p[0].x, p[1].x, p[2].x, p[3].x) - 1; - res->y1 = LV_MIN4(p[0].y, p[1].y, p[2].y, p[3].y); - res->y2 = LV_MAX4(p[0].y, p[1].y, p[2].y, p[3].y) - 1; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void img_decode_and_draw(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - lv_image_decoder_dsc_t * decoder_dsc, lv_area_t * relative_decoded_area, - const lv_area_t * img_area, const lv_area_t * clipped_img_area, - lv_draw_image_core_cb draw_core_cb) -{ - lv_draw_image_sup_t sup; - sup.alpha_color = draw_dsc->recolor; - sup.palette = decoder_dsc->palette; - sup.palette_size = decoder_dsc->palette_size; - - /*The whole image is available, just draw it*/ - if(decoder_dsc->decoded && (relative_decoded_area == NULL || relative_decoded_area->x1 == LV_COORD_MIN)) { - draw_core_cb(draw_unit, draw_dsc, decoder_dsc, &sup, img_area, clipped_img_area); - } - /*Draw in smaller pieces*/ - else { - lv_area_t relative_full_area_to_decode = *clipped_img_area; - lv_area_move(&relative_full_area_to_decode, -img_area->x1, -img_area->y1); - lv_area_t tmp; - if(relative_decoded_area == NULL) relative_decoded_area = &tmp; - relative_decoded_area->x1 = LV_COORD_MIN; - relative_decoded_area->y1 = LV_COORD_MIN; - relative_decoded_area->x2 = LV_COORD_MIN; - relative_decoded_area->y2 = LV_COORD_MIN; - lv_result_t res = LV_RESULT_OK; - - while(res == LV_RESULT_OK) { - res = lv_image_decoder_get_area(decoder_dsc, &relative_full_area_to_decode, relative_decoded_area); - - lv_area_t absolute_decoded_area = *relative_decoded_area; - lv_area_move(&absolute_decoded_area, img_area->x1, img_area->y1); - if(res == LV_RESULT_OK) { - /*Limit draw area to the current decoded area and draw the image*/ - lv_area_t clipped_img_area_sub; - if(lv_area_intersect(&clipped_img_area_sub, clipped_img_area, &absolute_decoded_area)) { - draw_core_cb(draw_unit, draw_dsc, decoder_dsc, &sup, - &absolute_decoded_area, &clipped_img_area_sub); - } - } - } - } -} diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_image.h b/L3_Middlewares/LVGL/src/draw/lv_draw_image.h deleted file mode 100644 index a16f6d0..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_image.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @file lv_draw_image.h - * - */ - -#ifndef LV_DRAW_IMAGE_H -#define LV_DRAW_IMAGE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_draw.h" -#include "lv_image_decoder.h" -#include "lv_draw_buf.h" -#include "../misc/lv_style.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * MACROS - **********************/ - -typedef struct lv_draw_image_dsc_t { - lv_draw_dsc_base_t base; - - const void * src; - lv_image_header_t header; - - int32_t rotation; - int32_t scale_x; - int32_t scale_y; - int32_t skew_x; - int32_t skew_y; - lv_point_t pivot; - - lv_color_t recolor; - lv_opa_t recolor_opa; - - lv_opa_t opa; - lv_blend_mode_t blend_mode : 4; - - uint16_t antialias : 1; - uint16_t tile : 1; - lv_draw_image_sup_t * sup; - - /** Used to indicate the entire original, non-clipped area where the image is to be drawn. - * This is important for: - * 1. Layer rendering, where it might happen that only a smaller area of the layer is rendered. - * 2. Tiled images, where the target draw area is larger than the image to be tiled. - */ - lv_area_t image_area; - - int32_t clip_radius; - - const lv_image_dsc_t * bitmap_mask_src; -} lv_draw_image_dsc_t; - -/** - * PErform the actual rendering of a decoded image - * @param draw_unit pointer to a draw unit - * @param draw_dsc the draw descriptor of the image - * @param decoder_dsc pointer to the decoded image's descriptor - * @param sup supplementary data - * @param img_coords the absolute coordinates of the image - * @param clipped_img_area the absolute clip coordinates - */ -typedef void (*lv_draw_image_core_cb)(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_image_decoder_dsc_t * decoder_dsc, lv_draw_image_sup_t * sup, - const lv_area_t * img_coords, const lv_area_t * clipped_img_area); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize an image draw descriptor. - * @param dsc pointer to a draw descriptor - */ -void lv_draw_image_dsc_init(lv_draw_image_dsc_t * dsc); - -/** - * Try to get an image draw descriptor from a draw task. - * @param task draw task - * @return the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_IMAGE - */ -lv_draw_image_dsc_t * lv_draw_task_get_image_dsc(lv_draw_task_t * task); - -/** - * Create an image draw task - * @param layer pointer to a layer - * @param dsc pointer to an initialized draw descriptor - * @param coords the coordinates of the image - * @note `coords` can be small than the real image area - * (if only a part of the image is rendered) - * or can be larger (in case of tiled images). . - */ -void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords); - -/** - * Create a draw task to blend a layer to another layer - * @param layer pointer to a layer - * @param dsc pointer to an initialized draw descriptor - * @param coords the coordinates of the layer. - * @note `coords` can be small than the total widget area from which the layer is created - * (if only a part of the widget was rendered to a layer) - */ -void lv_draw_layer(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords); - -/** - * Get the type of an image source - * @param src pointer to an image source: - * - pointer to an 'lv_image_t' variable (image stored internally and compiled into the code) - * - a path to a file (e.g. "S:/folder/image.bin") - * - or a symbol (e.g. LV_SYMBOL_CLOSE) - * @return type of the image source LV_IMAGE_SRC_VARIABLE/FILE/SYMBOL/UNKNOWN - */ -lv_image_src_t lv_image_src_get_type(const void * src); - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_IMAGE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_image_private.h b/L3_Middlewares/LVGL/src/draw/lv_draw_image_private.h deleted file mode 100644 index a39ee61..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_image_private.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @file lv_draw_image_private.h - * - */ - -#ifndef LV_DRAW_IMAGE_PRIVATE_H -#define LV_DRAW_IMAGE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_image.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_draw_image_sup_t { - lv_color_t alpha_color; - const lv_color32_t * palette; - uint32_t palette_size : 9; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Can be used by draw units to handle the decoding and - * prepare everything for the actual image rendering - * @param draw_unit pointer to a draw unit - * @param draw_dsc the draw descriptor of the image - * @param coords the absolute coordinates of the image - * @param draw_core_cb a callback to perform the actual rendering - */ -void lv_draw_image_normal_helper(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords, lv_draw_image_core_cb draw_core_cb); - -/** - * Can be used by draw units for TILED images to handle the decoding and - * prepare everything for the actual image rendering - * @param draw_unit pointer to a draw unit - * @param draw_dsc the draw descriptor of the image - * @param coords the absolute coordinates of the image - * @param draw_core_cb a callback to perform the actual rendering - */ -void lv_draw_image_tiled_helper(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords, lv_draw_image_core_cb draw_core_cb); - -/** - * Get the area of a rectangle if its rotated and scaled - * @param res store the coordinates here - * @param w width of the rectangle to transform - * @param h height of the rectangle to transform - * @param angle angle of rotation - * @param scale_x zoom in x direction, (256 no zoom) - * @param scale_y zoom in y direction, (256 no zoom) - * @param pivot x,y pivot coordinates of rotation - */ -void lv_image_buf_get_transformed_area(lv_area_t * res, int32_t w, int32_t h, int32_t angle, - uint16_t scale_x, uint16_t scale_y, const lv_point_t * pivot); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_IMAGE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_img.c b/L3_Middlewares/LVGL/src/draw/lv_draw_img.c new file mode 100644 index 0000000..5e67f88 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_img.c @@ -0,0 +1,375 @@ +/** + * @file lv_draw_img.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_draw_img.h" +#include "lv_img_cache.h" +#include "../hal/lv_hal_disp.h" +#include "../misc/lv_log.h" +#include "../core/lv_refr.h" +#include "../misc/lv_mem.h" +#include "../misc/lv_math.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static lv_res_t /* LV_ATTRIBUTE_FAST_MEM */ decode_and_draw(lv_draw_ctx_t * draw_ctx, + const lv_draw_img_dsc_t * draw_dsc, + const lv_area_t * coords, const void * src); + +static void show_error(lv_draw_ctx_t * draw_ctx, const lv_area_t * coords, const char * msg); +static void draw_cleanup(_lv_img_cache_entry_t * cache); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_draw_img_dsc_init(lv_draw_img_dsc_t * dsc) +{ + lv_memset_00(dsc, sizeof(lv_draw_img_dsc_t)); + dsc->recolor = lv_color_black(); + dsc->opa = LV_OPA_COVER; + dsc->zoom = LV_IMG_ZOOM_NONE; + dsc->antialias = LV_COLOR_DEPTH > 8 ? 1 : 0; +} + +/** + * Draw an image + * @param coords the coordinates of the image + * @param mask the image will be drawn only in this area + * @param src pointer to a lv_color_t array which contains the pixels of the image + * @param dsc pointer to an initialized `lv_draw_img_dsc_t` variable + */ +void lv_draw_img(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, const lv_area_t * coords, const void * src) +{ + if(src == NULL) { + LV_LOG_WARN("Image draw: src is NULL"); + show_error(draw_ctx, coords, "No\ndata"); + return; + } + + if(dsc->opa <= LV_OPA_MIN) return; + + lv_res_t res = LV_RES_INV; + + if(draw_ctx->draw_img) { + res = draw_ctx->draw_img(draw_ctx, dsc, coords, src); + } + + if(res != LV_RES_OK) { + res = decode_and_draw(draw_ctx, dsc, coords, src); + } + + if(res != LV_RES_OK) { + LV_LOG_WARN("Image draw error"); + show_error(draw_ctx, coords, "No\ndata"); + } +} + +/** + * Get the pixel size of a color format in bits + * @param cf a color format (`LV_IMG_CF_...`) + * @return the pixel size in bits + */ +uint8_t lv_img_cf_get_px_size(lv_img_cf_t cf) +{ + uint8_t px_size = 0; + + switch(cf) { + case LV_IMG_CF_UNKNOWN: + case LV_IMG_CF_RAW: + px_size = 0; + break; + case LV_IMG_CF_TRUE_COLOR: + case LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED: + px_size = LV_COLOR_SIZE; + break; + case LV_IMG_CF_TRUE_COLOR_ALPHA: + px_size = LV_IMG_PX_SIZE_ALPHA_BYTE << 3; + break; + case LV_IMG_CF_INDEXED_1BIT: + case LV_IMG_CF_ALPHA_1BIT: + px_size = 1; + break; + case LV_IMG_CF_INDEXED_2BIT: + case LV_IMG_CF_ALPHA_2BIT: + px_size = 2; + break; + case LV_IMG_CF_INDEXED_4BIT: + case LV_IMG_CF_ALPHA_4BIT: + px_size = 4; + break; + case LV_IMG_CF_INDEXED_8BIT: + case LV_IMG_CF_ALPHA_8BIT: + px_size = 8; + break; + default: + px_size = 0; + break; + } + + return px_size; +} + +/** + * Check if a color format is chroma keyed or not + * @param cf a color format (`LV_IMG_CF_...`) + * @return true: chroma keyed; false: not chroma keyed + */ +bool lv_img_cf_is_chroma_keyed(lv_img_cf_t cf) +{ + bool is_chroma_keyed = false; + + switch(cf) { + case LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED: + case LV_IMG_CF_RAW_CHROMA_KEYED: + is_chroma_keyed = true; + break; + + default: + is_chroma_keyed = false; + break; + } + + return is_chroma_keyed; +} + +/** + * Check if a color format has alpha channel or not + * @param cf a color format (`LV_IMG_CF_...`) + * @return true: has alpha channel; false: doesn't have alpha channel + */ +bool lv_img_cf_has_alpha(lv_img_cf_t cf) +{ + bool has_alpha = false; + + switch(cf) { + case LV_IMG_CF_TRUE_COLOR_ALPHA: + case LV_IMG_CF_RAW_ALPHA: + case LV_IMG_CF_INDEXED_1BIT: + case LV_IMG_CF_INDEXED_2BIT: + case LV_IMG_CF_INDEXED_4BIT: + case LV_IMG_CF_INDEXED_8BIT: + case LV_IMG_CF_ALPHA_1BIT: + case LV_IMG_CF_ALPHA_2BIT: + case LV_IMG_CF_ALPHA_4BIT: + case LV_IMG_CF_ALPHA_8BIT: + has_alpha = true; + break; + default: + has_alpha = false; + break; + } + + return has_alpha; +} + +/** + * Get the type of an image source + * @param src pointer to an image source: + * - pointer to an 'lv_img_t' variable (image stored internally and compiled into the code) + * - a path to a file (e.g. "S:/folder/image.bin") + * - or a symbol (e.g. LV_SYMBOL_CLOSE) + * @return type of the image source LV_IMG_SRC_VARIABLE/FILE/SYMBOL/UNKNOWN + */ +lv_img_src_t lv_img_src_get_type(const void * src) +{ + lv_img_src_t img_src_type = LV_IMG_SRC_UNKNOWN; + + if(src == NULL) return img_src_type; + const uint8_t * u8_p = src; + + /*The first or fourth byte depending on platform endianess shows the type of the image source*/ +#if LV_BIG_ENDIAN_SYSTEM + if(u8_p[3] >= 0x20 && u8_p[3] <= 0x7F) { +#else + if(u8_p[0] >= 0x20 && u8_p[0] <= 0x7F) { +#endif + img_src_type = LV_IMG_SRC_FILE; /*If it's an ASCII character then it's file name*/ + } +#if LV_BIG_ENDIAN_SYSTEM + else if(u8_p[3] >= 0x80) { +#else + else if(u8_p[0] >= 0x80) { +#endif + img_src_type = LV_IMG_SRC_SYMBOL; /*Symbols begins after 0x7F*/ + } + else { + img_src_type = LV_IMG_SRC_VARIABLE; /*`lv_img_dsc_t` is draw to the first byte < 0x20*/ + } + + if(LV_IMG_SRC_UNKNOWN == img_src_type) { + LV_LOG_WARN("lv_img_src_get_type: unknown image type"); + } + + return img_src_type; +} + +void lv_draw_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, + const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t color_format) +{ + if(draw_ctx->draw_img_decoded == NULL) return; + + draw_ctx->draw_img_decoded(draw_ctx, dsc, coords, map_p, color_format); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static lv_res_t LV_ATTRIBUTE_FAST_MEM decode_and_draw(lv_draw_ctx_t * draw_ctx, + const lv_draw_img_dsc_t * draw_dsc, + const lv_area_t * coords, const void * src) +{ + if(draw_dsc->opa <= LV_OPA_MIN) return LV_RES_OK; + + _lv_img_cache_entry_t * cdsc = _lv_img_cache_open(src, draw_dsc->recolor, draw_dsc->frame_id); + + if(cdsc == NULL) return LV_RES_INV; + + lv_img_cf_t cf; + if(lv_img_cf_is_chroma_keyed(cdsc->dec_dsc.header.cf)) cf = LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED; + else if(LV_IMG_CF_ALPHA_8BIT == cdsc->dec_dsc.header.cf) cf = LV_IMG_CF_ALPHA_8BIT; + else if(LV_IMG_CF_RGB565A8 == cdsc->dec_dsc.header.cf) cf = LV_IMG_CF_RGB565A8; + else if(lv_img_cf_has_alpha(cdsc->dec_dsc.header.cf)) cf = LV_IMG_CF_TRUE_COLOR_ALPHA; + else cf = LV_IMG_CF_TRUE_COLOR; + + if(cf == LV_IMG_CF_ALPHA_8BIT) { + if(draw_dsc->angle || draw_dsc->zoom != LV_IMG_ZOOM_NONE) { + /* resume normal method */ + cf = LV_IMG_CF_TRUE_COLOR_ALPHA; + cdsc->dec_dsc.img_data = NULL; + } + } + + if(cdsc->dec_dsc.error_msg != NULL) { + LV_LOG_WARN("Image draw error"); + + show_error(draw_ctx, coords, cdsc->dec_dsc.error_msg); + } + /*The decoder could open the image and gave the entire uncompressed image. + *Just draw it!*/ + else if(cdsc->dec_dsc.img_data) { + lv_area_t map_area_rot; + lv_area_copy(&map_area_rot, coords); + if(draw_dsc->angle || draw_dsc->zoom != LV_IMG_ZOOM_NONE) { + int32_t w = lv_area_get_width(coords); + int32_t h = lv_area_get_height(coords); + + _lv_img_buf_get_transformed_area(&map_area_rot, w, h, draw_dsc->angle, draw_dsc->zoom, &draw_dsc->pivot); + + map_area_rot.x1 += coords->x1; + map_area_rot.y1 += coords->y1; + map_area_rot.x2 += coords->x1; + map_area_rot.y2 += coords->y1; + } + + lv_area_t clip_com; /*Common area of mask and coords*/ + bool union_ok; + union_ok = _lv_area_intersect(&clip_com, draw_ctx->clip_area, &map_area_rot); + /*Out of mask. There is nothing to draw so the image is drawn successfully.*/ + if(union_ok == false) { + draw_cleanup(cdsc); + return LV_RES_OK; + } + + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_com; + lv_draw_img_decoded(draw_ctx, draw_dsc, coords, cdsc->dec_dsc.img_data, cf); + draw_ctx->clip_area = clip_area_ori; + } + /*The whole uncompressed image is not available. Try to read it line-by-line*/ + else { + lv_area_t mask_com; /*Common area of mask and coords*/ + bool union_ok; + union_ok = _lv_area_intersect(&mask_com, draw_ctx->clip_area, coords); + /*Out of mask. There is nothing to draw so the image is drawn successfully.*/ + if(union_ok == false) { + draw_cleanup(cdsc); + return LV_RES_OK; + } + + int32_t width = lv_area_get_width(&mask_com); + + uint8_t * buf = lv_mem_buf_get(lv_area_get_width(&mask_com) * + LV_IMG_PX_SIZE_ALPHA_BYTE); /*+1 because of the possible alpha byte*/ + + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + lv_area_t line; + lv_area_copy(&line, &mask_com); + lv_area_set_height(&line, 1); + int32_t x = mask_com.x1 - coords->x1; + int32_t y = mask_com.y1 - coords->y1; + int32_t row; + lv_res_t read_res; + for(row = mask_com.y1; row <= mask_com.y2; row++) { + lv_area_t mask_line; + union_ok = _lv_area_intersect(&mask_line, clip_area_ori, &line); + if(union_ok == false) continue; + + read_res = lv_img_decoder_read_line(&cdsc->dec_dsc, x, y, width, buf); + if(read_res != LV_RES_OK) { + lv_img_decoder_close(&cdsc->dec_dsc); + LV_LOG_WARN("Image draw can't read the line"); + lv_mem_buf_release(buf); + draw_cleanup(cdsc); + draw_ctx->clip_area = clip_area_ori; + return LV_RES_INV; + } + + draw_ctx->clip_area = &mask_line; + lv_draw_img_decoded(draw_ctx, draw_dsc, &line, buf, cf); + line.y1++; + line.y2++; + y++; + } + draw_ctx->clip_area = clip_area_ori; + lv_mem_buf_release(buf); + } + + draw_cleanup(cdsc); + return LV_RES_OK; +} + + +static void show_error(lv_draw_ctx_t * draw_ctx, const lv_area_t * coords, const char * msg) +{ + lv_draw_rect_dsc_t rect_dsc; + lv_draw_rect_dsc_init(&rect_dsc); + rect_dsc.bg_color = lv_color_white(); + lv_draw_rect(draw_ctx, &rect_dsc, coords); + + lv_draw_label_dsc_t label_dsc; + lv_draw_label_dsc_init(&label_dsc); + lv_draw_label(draw_ctx, &label_dsc, coords, msg, NULL); +} + +static void draw_cleanup(_lv_img_cache_entry_t * cache) +{ + /*Automatically close images with no caching*/ +#if LV_IMG_CACHE_DEF_SIZE == 0 + lv_img_decoder_close(&cache->dec_dsc); +#else + LV_UNUSED(cache); +#endif +} diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_img.h b/L3_Middlewares/LVGL/src/draw/lv_draw_img.h new file mode 100644 index 0000000..a88a33c --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_img.h @@ -0,0 +1,104 @@ +/** + * @file lv_draw_img.h + * + */ + +#ifndef LV_DRAW_IMG_H +#define LV_DRAW_IMG_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "lv_img_decoder.h" +#include "lv_img_buf.h" +#include "../misc/lv_style.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + + int16_t angle; + uint16_t zoom; + lv_point_t pivot; + + lv_color_t recolor; + lv_opa_t recolor_opa; + + lv_opa_t opa; + lv_blend_mode_t blend_mode : 4; + + int32_t frame_id; + uint8_t antialias : 1; +} lv_draw_img_dsc_t; + +struct _lv_draw_ctx_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +void lv_draw_img_dsc_init(lv_draw_img_dsc_t * dsc); +/** + * Draw an image + * @param coords the coordinates of the image + * @param mask the image will be drawn only in this area + * @param src pointer to a lv_color_t array which contains the pixels of the image + * @param dsc pointer to an initialized `lv_draw_img_dsc_t` variable + */ +void lv_draw_img(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, const lv_area_t * coords, + const void * src); + + +void lv_draw_img_decoded(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, + const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t color_format); + +/** + * Get the type of an image source + * @param src pointer to an image source: + * - pointer to an 'lv_img_t' variable (image stored internally and compiled into the code) + * - a path to a file (e.g. "S:/folder/image.bin") + * - or a symbol (e.g. LV_SYMBOL_CLOSE) + * @return type of the image source LV_IMG_SRC_VARIABLE/FILE/SYMBOL/UNKNOWN + */ +lv_img_src_t lv_img_src_get_type(const void * src); + +/** + * Get the pixel size of a color format in bits + * @param cf a color format (`LV_IMG_CF_...`) + * @return the pixel size in bits + */ +uint8_t lv_img_cf_get_px_size(lv_img_cf_t cf); + +/** + * Check if a color format is chroma keyed or not + * @param cf a color format (`LV_IMG_CF_...`) + * @return true: chroma keyed; false: not chroma keyed + */ +bool lv_img_cf_is_chroma_keyed(lv_img_cf_t cf); + +/** + * Check if a color format has alpha channel or not + * @param cf a color format (`LV_IMG_CF_...`) + * @return true: has alpha channel; false: doesn't have alpha channel + */ +bool lv_img_cf_has_alpha(lv_img_cf_t cf); + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_IMG_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_label.c b/L3_Middlewares/LVGL/src/draw/lv_draw_label.c index e733c40..daf4474 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_label.c +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_label.c @@ -6,20 +6,13 @@ /********************* * INCLUDES *********************/ -#include "lv_draw_label_private.h" -#include "lv_draw_private.h" -#include "../misc/lv_area_private.h" -#include "lv_draw_vector_private.h" -#include "lv_draw_rect_private.h" -#include "../core/lv_obj.h" +#include "lv_draw.h" +#include "lv_draw_label.h" #include "../misc/lv_math.h" -#include "../core/lv_obj_event.h" -#include "../misc/lv_bidi_private.h" -#include "../misc/lv_text_private.h" +#include "../hal/lv_hal_disp.h" +#include "../core/lv_refr.h" +#include "../misc/lv_bidi.h" #include "../misc/lv_assert.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_string.h" -#include "../core/lv_global.h" /********************* * DEFINES @@ -27,17 +20,21 @@ #define LABEL_RECOLOR_PAR_LENGTH 6 #define LV_LABEL_HINT_UPDATE_TH 1024 /*Update the "hint" if the label's y coordinates have changed more then this*/ -#define font_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->font_draw_buf_handlers) - /********************** * TYPEDEFS **********************/ +enum { + CMD_STATE_WAIT, + CMD_STATE_PAR, + CMD_STATE_IN, +}; +typedef uint8_t cmd_state_t; /********************** * STATIC PROTOTYPES **********************/ -static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc, const lv_point_t * pos, - const lv_font_t * font, uint32_t letter, lv_draw_glyph_cb_t cb); + +static uint8_t hex_char_to_num(char hex); /********************** * STATIC VARIABLES @@ -55,9 +52,9 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc, * GLOBAL FUNCTIONS **********************/ -void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc) +void LV_ATTRIBUTE_FAST_MEM lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc) { - lv_memzero(dsc, sizeof(lv_draw_label_dsc_t)); + lv_memset_00(dsc, sizeof(lv_draw_label_dsc_t)); dsc->opa = LV_OPA_COVER; dsc->color = lv_color_black(); dsc->font = LV_FONT_DEFAULT; @@ -66,101 +63,48 @@ void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc) dsc->sel_color = lv_color_black(); dsc->sel_bg_color = lv_palette_main(LV_PALETTE_BLUE); dsc->bidi_dir = LV_BASE_DIR_LTR; - dsc->base.dsc_size = sizeof(lv_draw_label_dsc_t); -} - -lv_draw_label_dsc_t * lv_draw_task_get_label_dsc(lv_draw_task_t * task) -{ - return task->type == LV_DRAW_TASK_TYPE_LABEL ? (lv_draw_label_dsc_t *)task->draw_dsc : NULL; } -void lv_draw_glyph_dsc_init(lv_draw_glyph_dsc_t * dsc) -{ - lv_memzero(dsc, sizeof(lv_draw_glyph_dsc_t)); -} - -void LV_ATTRIBUTE_FAST_MEM lv_draw_label(lv_layer_t * layer, const lv_draw_label_dsc_t * dsc, - const lv_area_t * coords) +/** + * Write a text + * @param coords coordinates of the label + * @param mask the label will be drawn only in this area + * @param dsc pointer to draw descriptor + * @param txt `\0` terminated text to write + * @param hint pointer to a `lv_draw_label_hint_t` variable. + * It is managed by the draw to speed up the drawing of very long texts (thousands of lines). + */ +void LV_ATTRIBUTE_FAST_MEM lv_draw_label(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, + const lv_area_t * coords, const char * txt, lv_draw_label_hint_t * hint) { if(dsc->opa <= LV_OPA_MIN) return; - if(dsc->text == NULL || dsc->text[0] == '\0') return; if(dsc->font == NULL) { LV_LOG_WARN("dsc->font == NULL"); return; } - LV_PROFILER_BEGIN; - lv_draw_task_t * t = lv_draw_add_task(layer, coords); - - t->draw_dsc = lv_malloc(sizeof(*dsc)); - lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc)); - t->type = LV_DRAW_TASK_TYPE_LABEL; - - /*The text is stored in a local variable so malloc memory for it*/ - if(dsc->text_local) { - lv_draw_label_dsc_t * new_dsc = t->draw_dsc; - new_dsc->text = lv_strdup(dsc->text); - } - - lv_draw_finalize_task_creation(layer, t); - LV_PROFILER_END; -} - -void LV_ATTRIBUTE_FAST_MEM lv_draw_character(lv_layer_t * layer, lv_draw_label_dsc_t * dsc, - const lv_point_t * point, uint32_t unicode_letter) -{ - if(dsc->opa <= LV_OPA_MIN) return; - if(dsc->font == NULL) { - LV_LOG_WARN("dsc->font == NULL"); + if(draw_ctx->draw_letter == NULL) { + LV_LOG_WARN("draw->draw_letter == NULL (there is no function to draw letters)"); return; } - if(lv_text_is_marker(unicode_letter)) return; + lv_draw_label_dsc_t dsc_mod = *dsc; - LV_PROFILER_BEGIN; - - lv_font_glyph_dsc_t g; - lv_font_get_glyph_dsc(dsc->font, &g, unicode_letter, 0); - - lv_area_t a; - a.x1 = point->x; - a.y1 = point->y; - a.x2 = a.x1 + g.adv_w; - a.y2 = a.y1 + lv_font_get_line_height(g.resolved_font ? g.resolved_font : dsc->font); - - /*lv_draw_label needs UTF8 text so convert the Unicode character to an UTF8 string */ - uint32_t letter_buf[2]; - letter_buf[0] = lv_text_unicode_to_encoded(unicode_letter); - letter_buf[1] = '\0'; - - const char * letter_buf_char = (const char *)letter_buf; - -#if LV_BIG_ENDIAN_SYSTEM - while(*letter_buf_char == 0) ++letter_buf_char; -#endif - - dsc->text = letter_buf_char; - dsc->text_local = 1; - - lv_draw_label(layer, dsc, &a); - LV_PROFILER_END; -} - -void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc, - const lv_area_t * coords, - lv_draw_glyph_cb_t cb) -{ const lv_font_t * font = dsc->font; int32_t w; + /*No need to waste processor time if string is empty*/ + if(txt == NULL || txt[0] == '\0') + return; + lv_area_t clipped_area; - bool clip_ok = lv_area_intersect(&clipped_area, coords, draw_unit->clip_area); + bool clip_ok = _lv_area_intersect(&clipped_area, coords, draw_ctx->clip_area); if(!clip_ok) return; lv_text_align_t align = dsc->align; lv_base_dir_t base_dir = dsc->bidi_dir; - lv_bidi_calculate_align(&align, &base_dir, dsc->text); + lv_bidi_calculate_align(&align, &base_dir, txt); if((dsc->flag & LV_TEXT_FLAG_EXPAND) == 0) { /*Normally use the label's width as width*/ @@ -169,8 +113,8 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_ else { /*If EXPAND is enabled then not limit the text's width to the object's width*/ lv_point_t p; - lv_text_get_size(&p, dsc->text, dsc->font, dsc->letter_space, dsc->line_space, LV_COORD_MAX, - dsc->flag); + lv_txt_get_size(&p, txt, dsc->font, dsc->letter_space, dsc->line_space, LV_COORD_MAX, + dsc->flag); w = p.x; } @@ -180,7 +124,8 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_ /*Init variables for the first line*/ int32_t line_width = 0; lv_point_t pos; - lv_point_set(&pos, coords->x1, coords->y1); + pos.x = coords->x1; + pos.y = coords->y1; int32_t x_ofs = 0; int32_t y_ofs = 0; @@ -192,53 +137,51 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_ int32_t last_line_start = -1; /*Check the hint to use the cached info*/ - if(dsc->hint && y_ofs == 0 && coords->y1 < 0) { + if(hint && y_ofs == 0 && coords->y1 < 0) { /*If the label changed too much recalculate the hint.*/ - if(LV_ABS(dsc->hint->coord_y - coords->y1) > LV_LABEL_HINT_UPDATE_TH - 2 * line_height) { - dsc->hint->line_start = -1; + if(LV_ABS(hint->coord_y - coords->y1) > LV_LABEL_HINT_UPDATE_TH - 2 * line_height) { + hint->line_start = -1; } - last_line_start = dsc->hint->line_start; + last_line_start = hint->line_start; } /*Use the hint if it's valid*/ - if(dsc->hint && last_line_start >= 0) { + if(hint && last_line_start >= 0) { line_start = last_line_start; - pos.y += dsc->hint->y; + pos.y += hint->y; } - uint32_t line_end = line_start + lv_text_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL, - dsc->flag); + uint32_t line_end = line_start + _lv_txt_get_next_line(&txt[line_start], font, dsc->letter_space, w, NULL, dsc->flag); /*Go the first visible line*/ - while(pos.y + line_height_font < draw_unit->clip_area->y1) { + while(pos.y + line_height_font < draw_ctx->clip_area->y1) { /*Go to next line*/ line_start = line_end; - line_end += lv_text_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL, dsc->flag); + line_end += _lv_txt_get_next_line(&txt[line_start], font, dsc->letter_space, w, NULL, dsc->flag); pos.y += line_height; /*Save at the threshold coordinate*/ - if(dsc->hint && pos.y >= -LV_LABEL_HINT_UPDATE_TH && dsc->hint->line_start < 0) { - dsc->hint->line_start = line_start; - dsc->hint->y = pos.y - coords->y1; - dsc->hint->coord_y = coords->y1; + if(hint && pos.y >= -LV_LABEL_HINT_UPDATE_TH && hint->line_start < 0) { + hint->line_start = line_start; + hint->y = pos.y - coords->y1; + hint->coord_y = coords->y1; } - if(dsc->text[line_start] == '\0') return; + if(txt[line_start] == '\0') return; } /*Align to middle*/ if(align == LV_TEXT_ALIGN_CENTER) { - line_width = lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space); + line_width = lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); pos.x += (lv_area_get_width(coords) - line_width) / 2; } /*Align to the right*/ else if(align == LV_TEXT_ALIGN_RIGHT) { - line_width = lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space); + line_width = lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); pos.x += lv_area_get_width(coords) - line_width; } - uint32_t sel_start = dsc->sel_start; uint32_t sel_end = dsc->sel_end; if(sel_start > sel_end) { @@ -246,201 +189,229 @@ void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_ sel_start = sel_end; sel_end = tmp; } + lv_draw_line_dsc_t line_dsc; + + if((dsc->decor & LV_TEXT_DECOR_UNDERLINE) || (dsc->decor & LV_TEXT_DECOR_STRIKETHROUGH)) { + lv_draw_line_dsc_init(&line_dsc); + line_dsc.color = dsc->color; + line_dsc.width = font->underline_thickness ? font->underline_thickness : 1; + line_dsc.opa = dsc->opa; + line_dsc.blend_mode = dsc->blend_mode; + } - lv_area_t bg_coords; - lv_draw_glyph_dsc_t draw_letter_dsc; - lv_draw_glyph_dsc_init(&draw_letter_dsc); - draw_letter_dsc.opa = dsc->opa; - draw_letter_dsc.bg_coords = &bg_coords; - draw_letter_dsc.color = dsc->color; - - lv_draw_fill_dsc_t fill_dsc; - lv_draw_fill_dsc_init(&fill_dsc); - fill_dsc.opa = dsc->opa; - int32_t underline_width = font->underline_thickness ? font->underline_thickness : 1; - int32_t line_start_x; + cmd_state_t cmd_state = CMD_STATE_WAIT; uint32_t i; + uint32_t par_start = 0; + lv_color_t recolor = lv_color_black(); + lv_color_t color = lv_color_black(); int32_t letter_w; + lv_draw_rect_dsc_t draw_dsc_sel; + lv_draw_rect_dsc_init(&draw_dsc_sel); + draw_dsc_sel.bg_color = dsc->sel_bg_color; + + int32_t pos_x_start = pos.x; /*Write out all lines*/ - while(dsc->text[line_start] != '\0') { + while(txt[line_start] != '\0') { pos.x += x_ofs; - line_start_x = pos.x; /*Write all letter of a line*/ - i = 0; + cmd_state = CMD_STATE_WAIT; + i = 0; #if LV_USE_BIDI - char * bidi_txt = lv_malloc(line_end - line_start + 1); - LV_ASSERT_MALLOC(bidi_txt); - lv_bidi_process_paragraph(dsc->text + line_start, bidi_txt, line_end - line_start, base_dir, NULL, 0); + char * bidi_txt = lv_mem_buf_get(line_end - line_start + 1); + _lv_bidi_process_paragraph(txt + line_start, bidi_txt, line_end - line_start, base_dir, NULL, 0); #else - const char * bidi_txt = dsc->text + line_start; + const char * bidi_txt = txt + line_start; #endif while(i < line_end - line_start) { uint32_t logical_char_pos = 0; if(sel_start != 0xFFFF && sel_end != 0xFFFF) { #if LV_USE_BIDI - logical_char_pos = lv_text_encoded_get_char_id(dsc->text, line_start); - uint32_t t = lv_text_encoded_get_char_id(bidi_txt, i); - logical_char_pos += lv_bidi_get_logical_pos(bidi_txt, NULL, line_end - line_start, base_dir, t, NULL); + logical_char_pos = _lv_txt_encoded_get_char_id(txt, line_start); + uint32_t t = _lv_txt_encoded_get_char_id(bidi_txt, i); + logical_char_pos += _lv_bidi_get_logical_pos(bidi_txt, NULL, line_end - line_start, base_dir, t, NULL); #else - logical_char_pos = lv_text_encoded_get_char_id(dsc->text, line_start + i); + logical_char_pos = _lv_txt_encoded_get_char_id(txt, line_start + i); #endif } uint32_t letter; uint32_t letter_next; - lv_text_encoded_letter_next_2(bidi_txt, &letter, &letter_next, &i); - - letter_w = lv_font_get_glyph_width(font, letter, letter_next); - - /*Always set the bg_coordinates for placeholder drawing*/ - bg_coords.x1 = pos.x; - bg_coords.y1 = pos.y; - bg_coords.x2 = pos.x + letter_w - 1; - bg_coords.y2 = pos.y + line_height - 1; - - if(i >= line_end - line_start) { - if(dsc->decor & LV_TEXT_DECOR_UNDERLINE) { - lv_area_t fill_area; - fill_area.x1 = line_start_x; - fill_area.x2 = pos.x + letter_w - 1; - fill_area.y1 = pos.y + font->line_height - font->base_line - font->underline_position; - fill_area.y2 = fill_area.y1 + underline_width - 1; - - fill_dsc.color = dsc->color; - cb(draw_unit, NULL, &fill_dsc, &fill_area); + _lv_txt_encoded_letter_next_2(bidi_txt, &letter, &letter_next, &i); + /*Handle the re-color command*/ + if((dsc->flag & LV_TEXT_FLAG_RECOLOR) != 0) { + if(letter == (uint32_t)LV_TXT_COLOR_CMD[0]) { + if(cmd_state == CMD_STATE_WAIT) { /*Start char*/ + par_start = i; + cmd_state = CMD_STATE_PAR; + continue; + } + else if(cmd_state == CMD_STATE_PAR) { /*Other start char in parameter escaped cmd. char*/ + cmd_state = CMD_STATE_WAIT; + } + else if(cmd_state == CMD_STATE_IN) { /*Command end*/ + cmd_state = CMD_STATE_WAIT; + continue; + } } - if(dsc->decor & LV_TEXT_DECOR_STRIKETHROUGH) { - lv_area_t fill_area; - fill_area.x1 = line_start_x; - fill_area.x2 = pos.x + letter_w - 1; - fill_area.y1 = pos.y + (font->line_height - font->base_line) * 2 / 3 + font->underline_thickness / 2; - fill_area.y2 = fill_area.y1 + underline_width - 1; - - fill_dsc.color = dsc->color; - cb(draw_unit, NULL, &fill_dsc, &fill_area); + + /*Skip the color parameter and wait the space after it*/ + if(cmd_state == CMD_STATE_PAR) { + if(letter == ' ') { + /*Get the parameter*/ + if(i - par_start == LABEL_RECOLOR_PAR_LENGTH + 1) { + char buf[LABEL_RECOLOR_PAR_LENGTH + 1]; + lv_memcpy_small(buf, &bidi_txt[par_start], LABEL_RECOLOR_PAR_LENGTH); + buf[LABEL_RECOLOR_PAR_LENGTH] = '\0'; + int r, g, b; + r = (hex_char_to_num(buf[0]) << 4) + hex_char_to_num(buf[1]); + g = (hex_char_to_num(buf[2]) << 4) + hex_char_to_num(buf[3]); + b = (hex_char_to_num(buf[4]) << 4) + hex_char_to_num(buf[5]); + recolor = lv_color_make(r, g, b); + } + else { + recolor.full = dsc->color.full; + } + cmd_state = CMD_STATE_IN; /*After the parameter the text is in the command*/ + } + continue; } } - if(sel_start != 0xFFFF && sel_end != 0xFFFF && logical_char_pos >= sel_start && logical_char_pos < sel_end) { - draw_letter_dsc.color = dsc->sel_color; - fill_dsc.color = dsc->sel_bg_color; - cb(draw_unit, NULL, &fill_dsc, &bg_coords); - } - else { - draw_letter_dsc.color = dsc->color; + color = dsc->color; + + if(cmd_state == CMD_STATE_IN) color = recolor; + + letter_w = lv_font_get_glyph_width(font, letter, letter_next); + + if(sel_start != 0xFFFF && sel_end != 0xFFFF) { + if(logical_char_pos >= sel_start && logical_char_pos < sel_end) { + lv_area_t sel_coords; + sel_coords.x1 = pos.x; + sel_coords.y1 = pos.y; + sel_coords.x2 = pos.x + letter_w + dsc->letter_space - 1; + sel_coords.y2 = pos.y + line_height - 1; + lv_draw_rect(draw_ctx, &draw_dsc_sel, &sel_coords); + color = dsc->sel_color; + } } - draw_letter(draw_unit, &draw_letter_dsc, &pos, font, letter, cb); + dsc_mod.color = color; + lv_draw_letter(draw_ctx, &dsc_mod, &pos, letter); if(letter_w > 0) { pos.x += letter_w + dsc->letter_space; } } + if(dsc->decor & LV_TEXT_DECOR_STRIKETHROUGH) { + lv_point_t p1; + lv_point_t p2; + p1.x = pos_x_start; + p1.y = pos.y + (dsc->font->line_height / 2) + line_dsc.width / 2; + p2.x = pos.x; + p2.y = p1.y; + line_dsc.color = color; + lv_draw_line(draw_ctx, &line_dsc, &p1, &p2); + } + + if(dsc->decor & LV_TEXT_DECOR_UNDERLINE) { + lv_point_t p1; + lv_point_t p2; + p1.x = pos_x_start; + p1.y = pos.y + dsc->font->line_height - dsc->font->base_line - font->underline_position; + p2.x = pos.x; + p2.y = p1.y; + line_dsc.color = color; + lv_draw_line(draw_ctx, &line_dsc, &p1, &p2); + } + #if LV_USE_BIDI - lv_free(bidi_txt); + lv_mem_buf_release(bidi_txt); bidi_txt = NULL; #endif /*Go to next line*/ line_start = line_end; - line_end += lv_text_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL, dsc->flag); + line_end += _lv_txt_get_next_line(&txt[line_start], font, dsc->letter_space, w, NULL, dsc->flag); pos.x = coords->x1; /*Align to middle*/ if(align == LV_TEXT_ALIGN_CENTER) { line_width = - lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space); + lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); pos.x += (lv_area_get_width(coords) - line_width) / 2; + } /*Align to the right*/ else if(align == LV_TEXT_ALIGN_RIGHT) { line_width = - lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space); + lv_txt_get_width(&txt[line_start], line_end - line_start, font, dsc->letter_space, dsc->flag); pos.x += lv_area_get_width(coords) - line_width; } /*Go the next line position*/ pos.y += line_height; - if(pos.y > draw_unit->clip_area->y2) break; + if(pos.y > draw_ctx->clip_area->y2) return; } - if(draw_letter_dsc._draw_buf) lv_draw_buf_destroy(draw_letter_dsc._draw_buf); - LV_ASSERT_MEM_INTEGRITY(); } +void lv_draw_letter(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p, + uint32_t letter) +{ + draw_ctx->draw_letter(draw_ctx, dsc, pos_p, letter); +} + + /********************** * STATIC FUNCTIONS **********************/ -static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc, const lv_point_t * pos, - const lv_font_t * font, uint32_t letter, lv_draw_glyph_cb_t cb) +/** + * Convert a hexadecimal characters to a number (0..15) + * @param hex Pointer to a hexadecimal character (0..9, A..F) + * @return the numerical value of `hex` or 0 on error + */ +static uint8_t hex_char_to_num(char hex) { - lv_font_glyph_dsc_t g; - - if(lv_text_is_marker(letter)) /*Markers are valid letters but should not be rendered.*/ - return; - - LV_PROFILER_BEGIN; - bool g_ret = lv_font_get_glyph_dsc(font, &g, letter, '\0'); - if(g_ret == false) { - /*Add warning if the dsc is not found*/ - LV_LOG_WARN("lv_draw_letter: glyph dsc. not found for U+%" LV_PRIX32, letter); - } + uint8_t result = 0; - /*Don't draw anything if the character is empty. E.g. space*/ - if((g.box_h == 0) || (g.box_w == 0)) { - LV_PROFILER_END; - return; - } - - lv_area_t letter_coords; - letter_coords.x1 = pos->x + g.ofs_x; - letter_coords.x2 = letter_coords.x1 + g.box_w - 1; - letter_coords.y1 = pos->y + (font->line_height - font->base_line) - g.box_h - g.ofs_y; - letter_coords.y2 = letter_coords.y1 + g.box_h - 1; - - /*If the letter is completely out of mask don't draw it*/ - if(lv_area_is_out(&letter_coords, draw_unit->clip_area, 0) && - lv_area_is_out(dsc->bg_coords, draw_unit->clip_area, 0)) { - LV_PROFILER_END; - return; - } - - if(g.resolved_font) { - lv_draw_buf_t * draw_buf = NULL; - if(LV_FONT_GLYPH_FORMAT_NONE < g.format && g.format < LV_FONT_GLYPH_FORMAT_IMAGE) { - /*Only check draw buf for bitmap glyph*/ - draw_buf = lv_draw_buf_reshape(dsc->_draw_buf, 0, g.box_w, g.box_h, LV_STRIDE_AUTO); - if(draw_buf == NULL) { - if(dsc->_draw_buf) lv_draw_buf_destroy(dsc->_draw_buf); - - uint32_t h = g.box_h; - if(h * g.box_w < 64) h *= 2; /*Alloc a slightly larger buffer*/ - draw_buf = lv_draw_buf_create_ex(font_draw_buf_handlers, g.box_w, h, LV_COLOR_FORMAT_A8, LV_STRIDE_AUTO); - LV_ASSERT_MALLOC(draw_buf); - draw_buf->header.h = g.box_h; - dsc->_draw_buf = draw_buf; - } - } - - dsc->glyph_data = (void *) lv_font_get_glyph_bitmap(&g, draw_buf); - dsc->format = dsc->glyph_data ? g.format : LV_FONT_GLYPH_FORMAT_NONE; + if(hex >= '0' && hex <= '9') { + result = hex - '0'; } else { - dsc->format = LV_FONT_GLYPH_FORMAT_NONE; + if(hex >= 'a') hex -= 'a' - 'A'; /*Convert to upper case*/ + + switch(hex) { + case 'A': + result = 10; + break; + case 'B': + result = 11; + break; + case 'C': + result = 12; + break; + case 'D': + result = 13; + break; + case 'E': + result = 14; + break; + case 'F': + result = 15; + break; + default: + result = 0; + break; + } } - dsc->letter_coords = &letter_coords; - dsc->g = &g; - cb(draw_unit, dsc, NULL, NULL); - - lv_font_glyph_release_draw_data(&g); - - LV_PROFILER_END; + return result; } + diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_label.h b/L3_Middlewares/LVGL/src/draw/lv_draw_label.h index 67afaf5..b28436a 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_label.h +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_label.h @@ -13,10 +13,8 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "lv_draw.h" -#include "lv_draw_rect.h" #include "../misc/lv_bidi.h" -#include "../misc/lv_text.h" +#include "../misc/lv_txt.h" #include "../misc/lv_color.h" #include "../misc/lv_style.h" @@ -30,100 +28,62 @@ extern "C" { **********************/ typedef struct { - lv_draw_dsc_base_t base; - - const char * text; const lv_font_t * font; uint32_t sel_start; uint32_t sel_end; lv_color_t color; lv_color_t sel_color; lv_color_t sel_bg_color; - int32_t line_space; - int32_t letter_space; - int32_t ofs_x; - int32_t ofs_y; + lv_coord_t line_space; + lv_coord_t letter_space; + lv_coord_t ofs_x; + lv_coord_t ofs_y; lv_opa_t opa; lv_base_dir_t bidi_dir; lv_text_align_t align; lv_text_flag_t flag; lv_text_decor_t decor : 3; - lv_blend_mode_t blend_mode : 3; - /** - * < 1: malloc buffer and copy `text` there. - * 0: `text` is const and it's pointer will be valid during rendering.*/ - uint8_t text_local : 1; - lv_draw_label_hint_t * hint; + lv_blend_mode_t blend_mode: 3; } lv_draw_label_dsc_t; -/** - * Passed as a parameter to `lv_draw_label_iterate_characters` to - * draw the characters one by one - * @param draw_unit pointer to a draw unit - * @param dsc pointer to `lv_draw_glyph_dsc_t` to describe the character to draw - * if NULL don't draw character - * @param fill_dsc pointer to a fill descriptor to draw a background for the character or - * underline or strike through - * if NULL do not fill anything - * @param fill_area the area to fill - * if NULL do not fill anything - */ -typedef void(*lv_draw_glyph_cb_t)(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc, lv_draw_fill_dsc_t * fill_dsc, - const lv_area_t * fill_area); +/** Store some info to speed up drawing of very large texts + * It takes a lot of time to get the first visible character because + * all the previous characters needs to be checked to calculate the positions. + * This structure stores an earlier (e.g. at -1000 px) coordinate and the index of that line. + * Therefore the calculations can start from here.*/ +typedef struct _lv_draw_label_hint_t { + /** Index of the line at `y` coordinate*/ + int32_t line_start; + + /** Give the `y` coordinate of the first letter at `line start` index. Relative to the label's coordinates*/ + int32_t y; + + /** The 'y1' coordinate of the label when the hint was saved. + * Used to invalidate the hint if the label has moved too much.*/ + int32_t coord_y; +} lv_draw_label_hint_t; +struct _lv_draw_ctx_t; /********************** * GLOBAL PROTOTYPES **********************/ -/** - * Initialize a label draw descriptor - * @param dsc pointer to a draw descriptor - */ void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc); /** - * Try to get a label draw descriptor from a draw task. - * @param task draw task - * @return the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_LABEL - */ -lv_draw_label_dsc_t * lv_draw_task_get_label_dsc(lv_draw_task_t * task); - -/** - * Initialize a glyph draw descriptor. - * Used internally. - * @param dsc pointer to a draw descriptor + * Write a text + * @param coords coordinates of the label + * @param mask the label will be drawn only in this area + * @param dsc pointer to draw descriptor + * @param txt `\0` terminated text to write + * @param hint pointer to a `lv_draw_label_hint_t` variable. + * It is managed by the draw to speed up the drawing of very long texts (thousands of lines). */ -void lv_draw_glyph_dsc_init(lv_draw_glyph_dsc_t * dsc); +void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_label(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, + const lv_area_t * coords, const char * txt, lv_draw_label_hint_t * hint); -/** - * Crate a draw task to render a text - * @param layer pointer to a layer - * @param dsc pointer to draw descriptor - * @param coords coordinates of the character - */ -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_label(lv_layer_t * layer, const lv_draw_label_dsc_t * dsc, - const lv_area_t * coords); - -/** - * Crate a draw task to render a single character - * @param layer pointer to a layer - * @param dsc pointer to draw descriptor - * @param point position of the label - * @param unicode_letter the letter to draw - */ -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_character(lv_layer_t * layer, lv_draw_label_dsc_t * dsc, - const lv_point_t * point, uint32_t unicode_letter); - -/** - * Should be used during rendering the characters to get the position and other - * parameters of the characters - * @param draw_unit pointer to a draw unit - * @param dsc pointer to draw descriptor - * @param coords coordinates of the label - * @param cb a callback to call to draw each glyphs one by one - */ -void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc, - const lv_area_t * coords, lv_draw_glyph_cb_t cb); +void lv_draw_letter(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p, + uint32_t letter); /*********************** * GLOBAL VARIABLES diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_label_private.h b/L3_Middlewares/LVGL/src/draw/lv_draw_label_private.h deleted file mode 100644 index 163651d..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_label_private.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file lv_draw_label_private.h - * - */ - -#ifndef LV_DRAW_LABEL_PRIVATE_H -#define LV_DRAW_LABEL_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_label.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Store some info to speed up drawing of very large texts - * It takes a lot of time to get the first visible character because - * all the previous characters needs to be checked to calculate the positions. - * This structure stores an earlier (e.g. at -1000 px) coordinate and the index of that line. - * Therefore the calculations can start from here.*/ -struct lv_draw_label_hint_t { - /** Index of the line at `y` coordinate*/ - int32_t line_start; - - /** Give the `y` coordinate of the first letter at `line start` index. Relative to the label's coordinates*/ - int32_t y; - - /** The 'y1' coordinate of the label when the hint was saved. - * Used to invalidate the hint if the label has moved too much.*/ - int32_t coord_y; -}; - -struct lv_draw_glyph_dsc_t { - void * glyph_data; /**< Depends on `format` field, it could be image source or draw buf of bitmap or vector data. */ - lv_font_glyph_format_t format; - const lv_area_t * letter_coords; - const lv_area_t * bg_coords; - const lv_font_glyph_dsc_t * g; - lv_color_t color; - lv_opa_t opa; - lv_draw_buf_t * _draw_buf; /**< a shared draw buf for get_bitmap, do not use it directly, use glyph_data instead */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_LABEL_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_layer.c b/L3_Middlewares/LVGL/src/draw/lv_draw_layer.c new file mode 100644 index 0000000..da35682 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_layer.c @@ -0,0 +1,93 @@ +/** + * @file lv_draw_layer.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_draw.h" +#include "lv_draw_arc.h" +#include "../core/lv_refr.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_draw_layer_ctx_t * lv_draw_layer_create(lv_draw_ctx_t * draw_ctx, const lv_area_t * layer_area, + lv_draw_layer_flags_t flags) +{ + if(draw_ctx->layer_init == NULL) return NULL; + + lv_draw_layer_ctx_t * layer_ctx = lv_mem_alloc(draw_ctx->layer_instance_size); + LV_ASSERT_MALLOC(layer_ctx); + if(layer_ctx == NULL) { + LV_LOG_WARN("Couldn't allocate a new layer context"); + return NULL; + } + + lv_memset_00(layer_ctx, draw_ctx->layer_instance_size); + + lv_disp_t * disp_refr = _lv_refr_get_disp_refreshing(); + layer_ctx->original.buf = draw_ctx->buf; + layer_ctx->original.buf_area = draw_ctx->buf_area; + layer_ctx->original.clip_area = draw_ctx->clip_area; + layer_ctx->original.screen_transp = disp_refr->driver->screen_transp; + layer_ctx->area_full = *layer_area; + + lv_draw_layer_ctx_t * init_layer_ctx = draw_ctx->layer_init(draw_ctx, layer_ctx, flags); + if(NULL == init_layer_ctx) { + lv_mem_free(layer_ctx); + } + return init_layer_ctx; +} + +void lv_draw_layer_adjust(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx, + lv_draw_layer_flags_t flags) +{ + if(draw_ctx->layer_adjust) draw_ctx->layer_adjust(draw_ctx, layer_ctx, flags); +} + +void lv_draw_layer_blend(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx, + lv_draw_img_dsc_t * draw_dsc) +{ + if(draw_ctx->layer_blend) draw_ctx->layer_blend(draw_ctx, layer_ctx, draw_dsc); +} + +void lv_draw_layer_destroy(lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx) +{ + + lv_draw_wait_for_finish(draw_ctx); + draw_ctx->buf = layer_ctx->original.buf; + draw_ctx->buf_area = layer_ctx->original.buf_area; + draw_ctx->clip_area = layer_ctx->original.clip_area; + lv_disp_t * disp_refr = _lv_refr_get_disp_refreshing(); + disp_refr->driver->screen_transp = layer_ctx->original.screen_transp; + + if(draw_ctx->layer_destroy) draw_ctx->layer_destroy(draw_ctx, layer_ctx); + lv_mem_free(layer_ctx); +} + +/********************** + * STATIC FUNCTIONS + **********************/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_layer.h b/L3_Middlewares/LVGL/src/draw/lv_draw_layer.h new file mode 100644 index 0000000..cd64149 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_layer.h @@ -0,0 +1,83 @@ +/** + * @file lv_draw_layer.h + * + */ + +#ifndef LV_DRAW_LAYER_H +#define LV_DRAW_LAYER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ +struct _lv_draw_ctx_t; +struct _lv_draw_layer_ctx_t; + +typedef enum { + LV_DRAW_LAYER_FLAG_NONE, + LV_DRAW_LAYER_FLAG_HAS_ALPHA, + LV_DRAW_LAYER_FLAG_CAN_SUBDIVIDE, +} lv_draw_layer_flags_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create a new layer context. It is used to start and independent rendering session + * with the current draw_ctx + * @param draw_ctx pointer to the current draw context + * @param layer_area the coordinates of the layer + * @param flags OR-ed flags from @lv_draw_layer_flags_t + * @return pointer to the layer context, or NULL on error + */ +struct _lv_draw_layer_ctx_t * lv_draw_layer_create(struct _lv_draw_ctx_t * draw_ctx, const lv_area_t * layer_area, + lv_draw_layer_flags_t flags); + +/** + * Adjust the layer_ctx and/or draw_ctx based on the `layer_ctx->area_act`. + * It's called only if flags has `LV_DRAW_LAYER_FLAG_CAN_SUBDIVIDE` + * @param draw_ctx pointer to the current draw context + * @param layer_ctx pointer to a layer context + * @param flags OR-ed flags from @lv_draw_layer_flags_t + */ +void lv_draw_layer_adjust(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx, + lv_draw_layer_flags_t flags); + +/** + * Blend a rendered layer to `layer_ctx->area_act` + * @param draw_ctx pointer to the current draw context + * @param layer_ctx pointer to a layer context + * @param draw_dsc pointer to an image draw descriptor + */ +void lv_draw_layer_blend(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx, + lv_draw_img_dsc_t * draw_dsc); + +/** + * Destroy a layer context. + * @param draw_ctx pointer to the current draw context + * @param layer_ctx pointer to a layer context + */ +void lv_draw_layer_destroy(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_LAYER_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_line.c b/L3_Middlewares/LVGL/src/draw/lv_draw_line.c index 00fc203..d0c4327 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_line.c +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_line.c @@ -6,11 +6,9 @@ /********************* * INCLUDES *********************/ -#include "lv_draw_private.h" +#include #include "../core/lv_refr.h" #include "../misc/lv_math.h" -#include "../misc/lv_types.h" -#include "../stdlib/lv_string.h" /********************* * DEFINES @@ -38,38 +36,19 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc) { - lv_memzero(dsc, sizeof(lv_draw_line_dsc_t)); + lv_memset_00(dsc, sizeof(lv_draw_line_dsc_t)); dsc->width = 1; dsc->opa = LV_OPA_COVER; dsc->color = lv_color_black(); - dsc->base.dsc_size = sizeof(lv_draw_line_dsc_t); } -lv_draw_line_dsc_t * lv_draw_task_get_line_dsc(lv_draw_task_t * task) -{ - return task->type == LV_DRAW_TASK_TYPE_LINE ? (lv_draw_line_dsc_t *)task->draw_dsc : NULL; -} - -void LV_ATTRIBUTE_FAST_MEM lv_draw_line(lv_layer_t * layer, const lv_draw_line_dsc_t * dsc) +void LV_ATTRIBUTE_FAST_MEM lv_draw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, + const lv_point_t * point1, const lv_point_t * point2) { if(dsc->width == 0) return; if(dsc->opa <= LV_OPA_MIN) return; - LV_PROFILER_BEGIN; - lv_area_t a; - a.x1 = (int32_t)LV_MIN(dsc->p1.x, dsc->p2.x) - dsc->width; - a.x2 = (int32_t)LV_MAX(dsc->p1.x, dsc->p2.x) + dsc->width; - a.y1 = (int32_t)LV_MIN(dsc->p1.y, dsc->p2.y) - dsc->width; - a.y2 = (int32_t)LV_MAX(dsc->p1.y, dsc->p2.y) + dsc->width; - - lv_draw_task_t * t = lv_draw_add_task(layer, &a); - - t->draw_dsc = lv_malloc(sizeof(*dsc)); - lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc)); - t->type = LV_DRAW_TASK_TYPE_LINE; - - lv_draw_finalize_task_creation(layer, t); - LV_PROFILER_END; + draw_ctx->draw_line(draw_ctx, dsc, point1, point2); } /********************** diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_line.h b/L3_Middlewares/LVGL/src/draw/lv_draw_line.h index 72430fa..b476ce4 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_line.h +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_line.h @@ -26,44 +26,35 @@ extern "C" { * TYPEDEFS **********************/ typedef struct { - lv_draw_dsc_base_t base; - - lv_point_precise_t p1; - lv_point_precise_t p2; lv_color_t color; - int32_t width; - int32_t dash_width; - int32_t dash_gap; + lv_coord_t width; + lv_coord_t dash_width; + lv_coord_t dash_gap; lv_opa_t opa; lv_blend_mode_t blend_mode : 2; uint8_t round_start : 1; uint8_t round_end : 1; - uint8_t raw_end : 1; /**< Do not bother with perpendicular line ending if it's not visible for any reason */ + uint8_t raw_end : 1; /*Do not bother with perpendicular line ending if it's not visible for any reason*/ } lv_draw_line_dsc_t; +struct _lv_draw_ctx_t; + /********************** * GLOBAL PROTOTYPES **********************/ -/** - * Initialize a line draw descriptor - * @param dsc pointer to a draw descriptor - */ -void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc); +void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc); /** - * Try to get a line draw descriptor from a draw task. - * @param task draw task - * @return the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_LINE + * Draw a line + * @param point1 first point of the line + * @param point2 second point of the line + * @param clip the line will be drawn only in this area + * @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable */ -lv_draw_line_dsc_t * lv_draw_task_get_line_dsc(lv_draw_task_t * task); +void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, + const lv_point_t * point1, const lv_point_t * point2); -/** - * Create a line draw task - * @param layer pointer to a layer - * @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable - */ -void lv_draw_line(lv_layer_t * layer, const lv_draw_line_dsc_t * dsc); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_mask.c b/L3_Middlewares/LVGL/src/draw/lv_draw_mask.c index 3ee6b62..872ca9a 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_mask.c +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_mask.c @@ -1,21 +1,23 @@ /** - * @file lv_draw_mask.c + * @file lv_mask.c * */ /********************* * INCLUDES *********************/ -#include "lv_draw_mask_private.h" -#include "lv_draw_private.h" -#include "../core/lv_refr.h" +#include "lv_draw.h" +#if LV_DRAW_COMPLEX #include "../misc/lv_math.h" -#include "../misc/lv_types.h" -#include "../stdlib/lv_string.h" +#include "../misc/lv_log.h" +#include "../misc/lv_assert.h" +#include "../misc/lv_gc.h" /********************* * DEFINES *********************/ +#define CIRCLE_CACHE_LIFE_MAX 1000 +#define CIRCLE_CACHE_AGING(life, r) life = LV_MIN(life + (r < 16 ? 1 : (r >> 4)), 1000) /********************** * TYPEDEFS @@ -24,6 +26,39 @@ /********************** * STATIC PROTOTYPES **********************/ +static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_line(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_line_param_t * param); +static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_radius_param_t * param); +static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_angle_param_t * param); +static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_fade_param_t * param); +static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_map(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_map_param_t * param); +static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_polygon(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_polygon_param_t * param); + +static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ line_mask_flat(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_line_param_t * p); +static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ line_mask_steep(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_line_param_t * p); + +static void circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius); +static bool circ_cont(lv_point_t * c); +static void circ_next(lv_point_t * c, lv_coord_t * tmp); +static void circ_calc_aa4(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_t radius); +static lv_opa_t * get_next_line(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_t y, lv_coord_t * len, + lv_coord_t * x_start); +static inline lv_opa_t /* LV_ATTRIBUTE_FAST_MEM */ mask_mix(lv_opa_t mask_act, lv_opa_t mask_new); /********************** * STATIC VARIABLES @@ -37,45 +72,1460 @@ * GLOBAL FUNCTIONS **********************/ -void LV_ATTRIBUTE_FAST_MEM lv_draw_mask_rect_dsc_init(lv_draw_mask_rect_dsc_t * dsc) +/** + * Add a draw mask. Everything drawn after it (until removing the mask) will be affected by the mask. + * @param param an initialized mask parameter. Only the pointer is saved. + * @param custom_id a custom pointer to identify the mask. Used in `lv_draw_mask_remove_custom`. + * @return the an integer, the ID of the mask. Can be used in `lv_draw_mask_remove_id`. + */ +int16_t lv_draw_mask_add(void * param, void * custom_id) +{ + /*Look for a free entry*/ + uint8_t i; + for(i = 0; i < _LV_MASK_MAX_NUM; i++) { + if(LV_GC_ROOT(_lv_draw_mask_list[i]).param == NULL) break; + } + + if(i >= _LV_MASK_MAX_NUM) { + LV_LOG_WARN("lv_mask_add: no place to add the mask"); + return LV_MASK_ID_INV; + } + + LV_GC_ROOT(_lv_draw_mask_list[i]).param = param; + LV_GC_ROOT(_lv_draw_mask_list[i]).custom_id = custom_id; + + return i; +} + +/** + * Apply the added buffers on a line. Used internally by the library's drawing routines. + * @param mask_buf store the result mask here. Has to be `len` byte long. Should be initialized with `0xFF`. + * @param abs_x absolute X coordinate where the line to calculate start + * @param abs_y absolute Y coordinate where the line to calculate start + * @param len length of the line to calculate (in pixel count) + * @return One of these values: + * - `LV_DRAW_MASK_RES_FULL_TRANSP`: the whole line is transparent. `mask_buf` is not set to zero + * - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged + * - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line + */ +lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len) +{ + bool changed = false; + _lv_draw_mask_common_dsc_t * dsc; + + _lv_draw_mask_saved_t * m = LV_GC_ROOT(_lv_draw_mask_list); + + while(m->param) { + dsc = m->param; + lv_draw_mask_res_t res = LV_DRAW_MASK_RES_FULL_COVER; + res = dsc->cb(mask_buf, abs_x, abs_y, len, (void *)m->param); + if(res == LV_DRAW_MASK_RES_TRANSP) return LV_DRAW_MASK_RES_TRANSP; + else if(res == LV_DRAW_MASK_RES_CHANGED) changed = true; + + m++; + } + + return changed ? LV_DRAW_MASK_RES_CHANGED : LV_DRAW_MASK_RES_FULL_COVER; +} + +/** + * Apply the specified buffers on a line. Used internally by the library's drawing routines. + * @param mask_buf store the result mask here. Has to be `len` byte long. Should be initialized with `0xFF`. + * @param abs_x absolute X coordinate where the line to calculate start + * @param abs_y absolute Y coordinate where the line to calculate start + * @param len length of the line to calculate (in pixel count) + * @param ids ID array of added buffers + * @param ids_count number of ID array + * @return One of these values: + * - `LV_DRAW_MASK_RES_FULL_TRANSP`: the whole line is transparent. `mask_buf` is not set to zero + * - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged + * - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line + */ +lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_apply_ids(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + const int16_t * ids, int16_t ids_count) +{ + bool changed = false; + _lv_draw_mask_common_dsc_t * dsc; + + for(int i = 0; i < ids_count; i++) { + int16_t id = ids[i]; + if(id == LV_MASK_ID_INV) continue; + dsc = LV_GC_ROOT(_lv_draw_mask_list[id]).param; + if(!dsc) continue; + lv_draw_mask_res_t res = LV_DRAW_MASK_RES_FULL_COVER; + res = dsc->cb(mask_buf, abs_x, abs_y, len, dsc); + if(res == LV_DRAW_MASK_RES_TRANSP) return LV_DRAW_MASK_RES_TRANSP; + else if(res == LV_DRAW_MASK_RES_CHANGED) changed = true; + } + + return changed ? LV_DRAW_MASK_RES_CHANGED : LV_DRAW_MASK_RES_FULL_COVER; +} + +/** + * Remove a mask with a given ID + * @param id the ID of the mask. Returned by `lv_draw_mask_add` + * @return the parameter of the removed mask. + * If more masks have `custom_id` ID then the last mask's parameter will be returned + */ +void * lv_draw_mask_remove_id(int16_t id) +{ + _lv_draw_mask_common_dsc_t * p = NULL; + + if(id != LV_MASK_ID_INV) { + p = LV_GC_ROOT(_lv_draw_mask_list[id]).param; + LV_GC_ROOT(_lv_draw_mask_list[id]).param = NULL; + LV_GC_ROOT(_lv_draw_mask_list[id]).custom_id = NULL; + } + + return p; +} + +/** + * Remove all mask with a given custom ID + * @param custom_id a pointer used in `lv_draw_mask_add` + * @return return the parameter of the removed mask. + * If more masks have `custom_id` ID then the last mask's parameter will be returned + */ +void * lv_draw_mask_remove_custom(void * custom_id) +{ + _lv_draw_mask_common_dsc_t * p = NULL; + uint8_t i; + for(i = 0; i < _LV_MASK_MAX_NUM; i++) { + if(LV_GC_ROOT(_lv_draw_mask_list[i]).custom_id == custom_id) { + p = LV_GC_ROOT(_lv_draw_mask_list[i]).param; + lv_draw_mask_remove_id(i); + } + } + return p; +} + +/** + * Free the data from the parameter. + * It's called inside `lv_draw_mask_remove_id` and `lv_draw_mask_remove_custom` + * Needs to be called only in special cases when the mask is not added by `lv_draw_mask_add` + * and not removed by `lv_draw_mask_remove_id` or `lv_draw_mask_remove_custom` + * @param p pointer to a mask parameter + */ +void lv_draw_mask_free_param(void * p) { - lv_memzero(dsc, sizeof(lv_draw_mask_rect_dsc_t)); + _lv_draw_mask_common_dsc_t * pdsc = p; + if(pdsc->type == LV_DRAW_MASK_TYPE_RADIUS) { + lv_draw_mask_radius_param_t * radius_p = (lv_draw_mask_radius_param_t *) p; + if(radius_p->circle) { + if(radius_p->circle->life < 0) { + lv_mem_free(radius_p->circle->cir_opa); + lv_mem_free(radius_p->circle); + } + else { + radius_p->circle->used_cnt--; + } + } + } + else if(pdsc->type == LV_DRAW_MASK_TYPE_POLYGON) { + lv_draw_mask_polygon_param_t * poly_p = (lv_draw_mask_polygon_param_t *) p; + lv_mem_free(poly_p->cfg.points); + } } -lv_draw_mask_rect_dsc_t * lv_draw_task_get_mask_rect_dsc(lv_draw_task_t * task) +void _lv_draw_mask_cleanup(void) { - return task->type == LV_DRAW_TASK_TYPE_MASK_RECTANGLE ? (lv_draw_mask_rect_dsc_t *)task->draw_dsc : NULL; + uint8_t i; + for(i = 0; i < LV_CIRCLE_CACHE_SIZE; i++) { + if(LV_GC_ROOT(_lv_circle_cache[i]).buf) { + lv_mem_free(LV_GC_ROOT(_lv_circle_cache[i]).buf); + } + lv_memset_00(&LV_GC_ROOT(_lv_circle_cache[i]), sizeof(LV_GC_ROOT(_lv_circle_cache[i]))); + } } -void LV_ATTRIBUTE_FAST_MEM lv_draw_mask_rect(lv_layer_t * layer, const lv_draw_mask_rect_dsc_t * dsc) +/** + * Count the currently added masks + * @return number of active masks + */ +uint8_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_get_cnt(void) +{ + uint8_t cnt = 0; + uint8_t i; + for(i = 0; i < _LV_MASK_MAX_NUM; i++) { + if(LV_GC_ROOT(_lv_draw_mask_list[i]).param) cnt++; + } + return cnt; +} + +bool lv_draw_mask_is_any(const lv_area_t * a) +{ + if(a == NULL) return LV_GC_ROOT(_lv_draw_mask_list[0]).param ? true : false; + + uint8_t i; + for(i = 0; i < _LV_MASK_MAX_NUM; i++) { + _lv_draw_mask_common_dsc_t * comm_param = LV_GC_ROOT(_lv_draw_mask_list[i]).param; + if(comm_param == NULL) continue; + if(comm_param->type == LV_DRAW_MASK_TYPE_RADIUS) { + lv_draw_mask_radius_param_t * radius_param = LV_GC_ROOT(_lv_draw_mask_list[i]).param; + if(radius_param->cfg.outer) { + if(!_lv_area_is_out(a, &radius_param->cfg.rect, radius_param->cfg.radius)) return true; + } + else { + if(!_lv_area_is_in(a, &radius_param->cfg.rect, radius_param->cfg.radius)) return true; + } + } + else { + return true; + } + } + + return false; + +} + +/** + *Initialize a line mask from two points. + * @param param pointer to a `lv_draw_mask_param_t` to initialize + * @param p1x X coordinate of the first point of the line + * @param p1y Y coordinate of the first point of the line + * @param p2x X coordinate of the second point of the line + * @param p2y y coordinate of the second point of the line + * @param side and element of `lv_draw_mask_line_side_t` to describe which side to keep. + * With `LV_DRAW_MASK_LINE_SIDE_LEFT/RIGHT` and horizontal line all pixels are kept + * With `LV_DRAW_MASK_LINE_SIDE_TOP/BOTTOM` and vertical line all pixels are kept + */ +void lv_draw_mask_line_points_init(lv_draw_mask_line_param_t * param, lv_coord_t p1x, lv_coord_t p1y, lv_coord_t p2x, + lv_coord_t p2y, lv_draw_mask_line_side_t side) { - if(!lv_color_format_has_alpha(layer->color_format)) { - LV_LOG_WARN("Only layers with alpha channel can be masked"); + lv_memset_00(param, sizeof(lv_draw_mask_line_param_t)); + + if(p1y == p2y && side == LV_DRAW_MASK_LINE_SIDE_BOTTOM) { + p1y--; + p2y--; + } + + if(p1y > p2y) { + lv_coord_t t; + t = p2x; + p2x = p1x; + p1x = t; + + t = p2y; + p2y = p1y; + p1y = t; + } + + param->cfg.p1.x = p1x; + param->cfg.p1.y = p1y; + param->cfg.p2.x = p2x; + param->cfg.p2.y = p2y; + param->cfg.side = side; + + param->origo.x = p1x; + param->origo.y = p1y; + param->flat = (LV_ABS(p2x - p1x) > LV_ABS(p2y - p1y)) ? 1 : 0; + param->yx_steep = 0; + param->xy_steep = 0; + param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_line; + param->dsc.type = LV_DRAW_MASK_TYPE_LINE; + + int32_t dx = p2x - p1x; + int32_t dy = p2y - p1y; + + if(param->flat) { + /*Normalize the steep. Delta x should be relative to delta x = 1024*/ + int32_t m; + + if(dx) { + m = (1L << 20) / dx; /*m is multiplier to normalize y (upscaled by 1024)*/ + param->yx_steep = (m * dy) >> 10; + } + + if(dy) { + m = (1L << 20) / dy; /*m is multiplier to normalize x (upscaled by 1024)*/ + param->xy_steep = (m * dx) >> 10; + } + param->steep = param->yx_steep; + } + else { + /*Normalize the steep. Delta y should be relative to delta x = 1024*/ + int32_t m; + + if(dy) { + m = (1L << 20) / dy; /*m is multiplier to normalize x (upscaled by 1024)*/ + param->xy_steep = (m * dx) >> 10; + } + + if(dx) { + m = (1L << 20) / dx; /*m is multiplier to normalize x (upscaled by 1024)*/ + param->yx_steep = (m * dy) >> 10; + } + param->steep = param->xy_steep; + } + + if(param->cfg.side == LV_DRAW_MASK_LINE_SIDE_LEFT) param->inv = 0; + else if(param->cfg.side == LV_DRAW_MASK_LINE_SIDE_RIGHT) param->inv = 1; + else if(param->cfg.side == LV_DRAW_MASK_LINE_SIDE_TOP) { + if(param->steep > 0) param->inv = 1; + else param->inv = 0; + } + else if(param->cfg.side == LV_DRAW_MASK_LINE_SIDE_BOTTOM) { + if(param->steep > 0) param->inv = 0; + else param->inv = 1; + } + + param->spx = param->steep >> 2; + if(param->steep < 0) param->spx = -param->spx; +} + +/** + *Initialize a line mask from a point and an angle. + * @param param pointer to a `lv_draw_mask_param_t` to initialize + * @param px X coordinate of a point of the line + * @param py X coordinate of a point of the line + * @param angle right 0 deg, bottom: 90 + * @param side and element of `lv_draw_mask_line_side_t` to describe which side to keep. + * With `LV_DRAW_MASK_LINE_SIDE_LEFT/RIGHT` and horizontal line all pixels are kept + * With `LV_DRAW_MASK_LINE_SIDE_TOP/BOTTOM` and vertical line all pixels are kept + */ +void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t p1x, lv_coord_t py, int16_t angle, + lv_draw_mask_line_side_t side) +{ + /*Find an optimal degree. + *lv_mask_line_points_init will swap the points to keep the smaller y in p1 + *Theoretically a line with `angle` or `angle+180` is the same only the points are swapped + *Find the degree which keeps the origo in place*/ + if(angle > 180) angle -= 180; /*> 180 will swap the origo*/ + + int32_t p2x; + int32_t p2y; + + p2x = (lv_trigo_sin(angle + 90) >> 5) + p1x; + p2y = (lv_trigo_sin(angle) >> 5) + py; + + lv_draw_mask_line_points_init(param, p1x, py, p2x, p2y, side); +} + +/** + * Initialize an angle mask. + * @param param pointer to a `lv_draw_mask_param_t` to initialize + * @param vertex_x X coordinate of the angle vertex (absolute coordinates) + * @param vertex_y Y coordinate of the angle vertex (absolute coordinates) + * @param start_angle start angle in degrees. 0 deg on the right, 90 deg, on the bottom + * @param end_angle end angle + */ +void lv_draw_mask_angle_init(lv_draw_mask_angle_param_t * param, lv_coord_t vertex_x, lv_coord_t vertex_y, + lv_coord_t start_angle, lv_coord_t end_angle) +{ + lv_draw_mask_line_side_t start_side; + lv_draw_mask_line_side_t end_side; + + /*Constrain the input angles*/ + if(start_angle < 0) + start_angle = 0; + else if(start_angle > 359) + start_angle = 359; + + if(end_angle < 0) + end_angle = 0; + else if(end_angle > 359) + end_angle = 359; + + if(end_angle < start_angle) { + param->delta_deg = 360 - start_angle + end_angle; + } + else { + param->delta_deg = LV_ABS(end_angle - start_angle); + } + + param->cfg.start_angle = start_angle; + param->cfg.end_angle = end_angle; + param->cfg.vertex_p.x = vertex_x; + param->cfg.vertex_p.y = vertex_y; + param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_angle; + param->dsc.type = LV_DRAW_MASK_TYPE_ANGLE; + + LV_ASSERT_MSG(start_angle >= 0 && start_angle <= 360, "Unexpected start angle"); + + if(start_angle >= 0 && start_angle < 180) { + start_side = LV_DRAW_MASK_LINE_SIDE_LEFT; + } + else + start_side = LV_DRAW_MASK_LINE_SIDE_RIGHT; /*silence compiler*/ + + LV_ASSERT_MSG(end_angle >= 0 && start_angle <= 360, "Unexpected end angle"); + + if(end_angle >= 0 && end_angle < 180) { + end_side = LV_DRAW_MASK_LINE_SIDE_RIGHT; + } + else if(end_angle >= 180 && end_angle < 360) { + end_side = LV_DRAW_MASK_LINE_SIDE_LEFT; + } + else + end_side = LV_DRAW_MASK_LINE_SIDE_RIGHT; /*silence compiler*/ + + lv_draw_mask_line_angle_init(¶m->start_line, vertex_x, vertex_y, start_angle, start_side); + lv_draw_mask_line_angle_init(¶m->end_line, vertex_x, vertex_y, end_angle, end_side); +} + +/** + * Initialize a fade mask. + * @param param pointer to an `lv_draw_mask_radius_param_t` to initialize + * @param rect coordinates of the rectangle to affect (absolute coordinates) + * @param radius radius of the rectangle + * @param inv true: keep the pixels inside the rectangle; keep the pixels outside of the rectangle + */ +void lv_draw_mask_radius_init(lv_draw_mask_radius_param_t * param, const lv_area_t * rect, lv_coord_t radius, bool inv) +{ + lv_coord_t w = lv_area_get_width(rect); + lv_coord_t h = lv_area_get_height(rect); + int32_t short_side = LV_MIN(w, h); + if(radius > short_side >> 1) radius = short_side >> 1; + if(radius < 0) radius = 0; + + lv_area_copy(¶m->cfg.rect, rect); + param->cfg.radius = radius; + param->cfg.outer = inv ? 1 : 0; + param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_radius; + param->dsc.type = LV_DRAW_MASK_TYPE_RADIUS; + + if(radius == 0) { + param->circle = NULL; return; } - LV_PROFILER_BEGIN; - lv_draw_task_t * t = lv_draw_add_task(layer, &layer->buf_area); + uint32_t i; - t->draw_dsc = lv_malloc(sizeof(*dsc)); - lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc)); - t->type = LV_DRAW_TASK_TYPE_MASK_RECTANGLE; + /*Try to reuse a circle cache entry*/ + for(i = 0; i < LV_CIRCLE_CACHE_SIZE; i++) { + if(LV_GC_ROOT(_lv_circle_cache[i]).radius == radius) { + LV_GC_ROOT(_lv_circle_cache[i]).used_cnt++; + CIRCLE_CACHE_AGING(LV_GC_ROOT(_lv_circle_cache[i]).life, radius); + param->circle = &LV_GC_ROOT(_lv_circle_cache[i]); + return; + } + } - lv_draw_dsc_base_t * base_dsc = t->draw_dsc; - base_dsc->layer = layer; + /*If not found find a free entry with lowest life*/ + _lv_draw_mask_radius_circle_dsc_t * entry = NULL; + for(i = 0; i < LV_CIRCLE_CACHE_SIZE; i++) { + if(LV_GC_ROOT(_lv_circle_cache[i]).used_cnt == 0) { + if(!entry) entry = &LV_GC_ROOT(_lv_circle_cache[i]); + else if(LV_GC_ROOT(_lv_circle_cache[i]).life < entry->life) entry = &LV_GC_ROOT(_lv_circle_cache[i]); + } + } - if(base_dsc->obj && lv_obj_has_flag(base_dsc->obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS)) { - /*Disable sending LV_EVENT_DRAW_TASK_ADDED first to avoid triggering recursive - *event calls due draw task adds in the event*/ - lv_obj_remove_flag(base_dsc->obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); - lv_obj_send_event(dsc->base.obj, LV_EVENT_DRAW_TASK_ADDED, t); - lv_obj_add_flag(base_dsc->obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); + if(!entry) { + entry = lv_mem_alloc(sizeof(_lv_draw_mask_radius_circle_dsc_t)); + LV_ASSERT_MALLOC(entry); + lv_memset_00(entry, sizeof(_lv_draw_mask_radius_circle_dsc_t)); + entry->life = -1; } + else { + entry->used_cnt++; + entry->life = 0; + CIRCLE_CACHE_AGING(entry->life, radius); + } + + param->circle = entry; - lv_draw_finalize_task_creation(layer, t); - LV_PROFILER_END; + circ_calc_aa4(param->circle, radius); +} + +/** + * Initialize a fade mask. + * @param param pointer to a `lv_draw_mask_param_t` to initialize + * @param coords coordinates of the area to affect (absolute coordinates) + * @param opa_top opacity on the top + * @param y_top at which coordinate start to change to opacity to `opa_bottom` + * @param opa_bottom opacity at the bottom + * @param y_bottom at which coordinate reach `opa_bottom`. + */ +void lv_draw_mask_fade_init(lv_draw_mask_fade_param_t * param, const lv_area_t * coords, lv_opa_t opa_top, + lv_coord_t y_top, + lv_opa_t opa_bottom, lv_coord_t y_bottom) +{ + lv_area_copy(¶m->cfg.coords, coords); + param->cfg.opa_top = opa_top; + param->cfg.opa_bottom = opa_bottom; + param->cfg.y_top = y_top; + param->cfg.y_bottom = y_bottom; + param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_fade; + param->dsc.type = LV_DRAW_MASK_TYPE_FADE; +} + +/** + * Initialize a map mask. + * @param param pointer to a `lv_draw_mask_param_t` to initialize + * @param coords coordinates of the map (absolute coordinates) + * @param map array of bytes with the mask values + */ +void lv_draw_mask_map_init(lv_draw_mask_map_param_t * param, const lv_area_t * coords, const lv_opa_t * map) +{ + lv_area_copy(¶m->cfg.coords, coords); + param->cfg.map = map; + param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_map; + param->dsc.type = LV_DRAW_MASK_TYPE_MAP; +} + +void lv_draw_mask_polygon_init(lv_draw_mask_polygon_param_t * param, const lv_point_t * points, uint16_t point_cnt) +{ + /*Join adjacent points if they are on the same coordinate*/ + lv_point_t * p = lv_mem_alloc(point_cnt * sizeof(lv_point_t)); + if(p == NULL) return; + uint16_t i; + uint16_t pcnt = 0; + p[0] = points[0]; + for(i = 0; i < point_cnt - 1; i++) { + if(points[i].x != points[i + 1].x || points[i].y != points[i + 1].y) { + p[pcnt] = points[i]; + pcnt++; + } + } + /*The first and the last points are also adjacent*/ + if(points[0].x != points[point_cnt - 1].x || points[0].y != points[point_cnt - 1].y) { + p[pcnt] = points[point_cnt - 1]; + pcnt++; + } + param->cfg.points = p; + param->cfg.point_cnt = pcnt; + param->dsc.cb = (lv_draw_mask_xcb_t)lv_draw_mask_polygon; + param->dsc.type = LV_DRAW_MASK_TYPE_POLYGON; } /********************** * STATIC FUNCTIONS **********************/ + +static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_line(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_line_param_t * p) +{ + /*Make to points relative to the vertex*/ + abs_y -= p->origo.y; + abs_x -= p->origo.x; + + /*Handle special cases*/ + if(p->steep == 0) { + /*Horizontal*/ + if(p->flat) { + /*Non sense: Can't be on the right/left of a horizontal line*/ + if(p->cfg.side == LV_DRAW_MASK_LINE_SIDE_LEFT || + p->cfg.side == LV_DRAW_MASK_LINE_SIDE_RIGHT) return LV_DRAW_MASK_RES_FULL_COVER; + else if(p->cfg.side == LV_DRAW_MASK_LINE_SIDE_TOP && abs_y + 1 < 0) return LV_DRAW_MASK_RES_FULL_COVER; + else if(p->cfg.side == LV_DRAW_MASK_LINE_SIDE_BOTTOM && abs_y > 0) return LV_DRAW_MASK_RES_FULL_COVER; + else { + return LV_DRAW_MASK_RES_TRANSP; + } + } + /*Vertical*/ + else { + /*Non sense: Can't be on the top/bottom of a vertical line*/ + if(p->cfg.side == LV_DRAW_MASK_LINE_SIDE_TOP || + p->cfg.side == LV_DRAW_MASK_LINE_SIDE_BOTTOM) return LV_DRAW_MASK_RES_FULL_COVER; + else if(p->cfg.side == LV_DRAW_MASK_LINE_SIDE_RIGHT && abs_x > 0) return LV_DRAW_MASK_RES_FULL_COVER; + else if(p->cfg.side == LV_DRAW_MASK_LINE_SIDE_LEFT) { + if(abs_x + len < 0) return LV_DRAW_MASK_RES_FULL_COVER; + else { + int32_t k = - abs_x; + if(k < 0) return LV_DRAW_MASK_RES_TRANSP; + if(k >= 0 && k < len) lv_memset_00(&mask_buf[k], len - k); + return LV_DRAW_MASK_RES_CHANGED; + } + } + else { + if(abs_x + len < 0) return LV_DRAW_MASK_RES_TRANSP; + else { + int32_t k = - abs_x; + if(k < 0) k = 0; + if(k >= len) return LV_DRAW_MASK_RES_TRANSP; + else if(k >= 0 && k < len) lv_memset_00(&mask_buf[0], k); + return LV_DRAW_MASK_RES_CHANGED; + } + } + } + } + + lv_draw_mask_res_t res; + if(p->flat) { + res = line_mask_flat(mask_buf, abs_x, abs_y, len, p); + } + else { + res = line_mask_steep(mask_buf, abs_x, abs_y, len, p); + } + + return res; +} + +static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM line_mask_flat(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, + lv_coord_t len, + lv_draw_mask_line_param_t * p) +{ + + int32_t y_at_x; + y_at_x = (int32_t)((int32_t)p->yx_steep * abs_x) >> 10; + + if(p->yx_steep > 0) { + if(y_at_x > abs_y) { + if(p->inv) { + return LV_DRAW_MASK_RES_FULL_COVER; + } + else { + return LV_DRAW_MASK_RES_TRANSP; + } + } + } + else { + if(y_at_x < abs_y) { + if(p->inv) { + return LV_DRAW_MASK_RES_FULL_COVER; + } + else { + return LV_DRAW_MASK_RES_TRANSP; + } + } + } + + /*At the end of the mask if the limit line is smaller than the mask's y. + *Then the mask is in the "good" area*/ + y_at_x = (int32_t)((int32_t)p->yx_steep * (abs_x + len)) >> 10; + if(p->yx_steep > 0) { + if(y_at_x < abs_y) { + if(p->inv) { + return LV_DRAW_MASK_RES_TRANSP; + } + else { + return LV_DRAW_MASK_RES_FULL_COVER; + } + } + } + else { + if(y_at_x > abs_y) { + if(p->inv) { + return LV_DRAW_MASK_RES_TRANSP; + } + else { + return LV_DRAW_MASK_RES_FULL_COVER; + } + } + } + + int32_t xe; + if(p->yx_steep > 0) xe = ((abs_y * 256) * p->xy_steep) >> 10; + else xe = (((abs_y + 1) * 256) * p->xy_steep) >> 10; + + int32_t xei = xe >> 8; + int32_t xef = xe & 0xFF; + + int32_t px_h; + if(xef == 0) px_h = 255; + else px_h = 255 - (((255 - xef) * p->spx) >> 8); + int32_t k = xei - abs_x; + lv_opa_t m; + + if(xef) { + if(k >= 0 && k < len) { + m = 255 - (((255 - xef) * (255 - px_h)) >> 9); + if(p->inv) m = 255 - m; + mask_buf[k] = mask_mix(mask_buf[k], m); + } + k++; + } + + while(px_h > p->spx) { + if(k >= 0 && k < len) { + m = px_h - (p->spx >> 1); + if(p->inv) m = 255 - m; + mask_buf[k] = mask_mix(mask_buf[k], m); + } + px_h -= p->spx; + k++; + if(k >= len) break; + } + + if(k < len && k >= 0) { + int32_t x_inters = (px_h * p->xy_steep) >> 10; + m = (x_inters * px_h) >> 9; + if(p->yx_steep < 0) m = 255 - m; + if(p->inv) m = 255 - m; + mask_buf[k] = mask_mix(mask_buf[k], m); + } + + if(p->inv) { + k = xei - abs_x; + if(k > len) { + return LV_DRAW_MASK_RES_TRANSP; + } + if(k >= 0) { + lv_memset_00(&mask_buf[0], k); + } + } + else { + k++; + if(k < 0) { + return LV_DRAW_MASK_RES_TRANSP; + } + if(k <= len) { + lv_memset_00(&mask_buf[k], len - k); + } + } + + return LV_DRAW_MASK_RES_CHANGED; +} + +static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM line_mask_steep(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, + lv_coord_t len, + lv_draw_mask_line_param_t * p) +{ + int32_t k; + int32_t x_at_y; + /*At the beginning of the mask if the limit line is greater than the mask's y. + *Then the mask is in the "wrong" area*/ + x_at_y = (int32_t)((int32_t)p->xy_steep * abs_y) >> 10; + if(p->xy_steep > 0) x_at_y++; + if(x_at_y < abs_x) { + if(p->inv) { + return LV_DRAW_MASK_RES_FULL_COVER; + } + else { + return LV_DRAW_MASK_RES_TRANSP; + } + } + + /*At the end of the mask if the limit line is smaller than the mask's y. + *Then the mask is in the "good" area*/ + x_at_y = (int32_t)((int32_t)p->xy_steep * (abs_y)) >> 10; + if(x_at_y > abs_x + len) { + if(p->inv) { + return LV_DRAW_MASK_RES_TRANSP; + } + else { + return LV_DRAW_MASK_RES_FULL_COVER; + } + } + + /*X start*/ + int32_t xs = ((abs_y * 256) * p->xy_steep) >> 10; + int32_t xsi = xs >> 8; + int32_t xsf = xs & 0xFF; + + /*X end*/ + int32_t xe = (((abs_y + 1) * 256) * p->xy_steep) >> 10; + int32_t xei = xe >> 8; + int32_t xef = xe & 0xFF; + + lv_opa_t m; + + k = xsi - abs_x; + if(xsi != xei && (p->xy_steep < 0 && xsf == 0)) { + xsf = 0xFF; + xsi = xei; + k--; + } + + if(xsi == xei) { + if(k >= 0 && k < len) { + m = (xsf + xef) >> 1; + if(p->inv) m = 255 - m; + mask_buf[k] = mask_mix(mask_buf[k], m); + } + k++; + + if(p->inv) { + k = xsi - abs_x; + if(k >= len) { + return LV_DRAW_MASK_RES_TRANSP; + } + if(k >= 0) lv_memset_00(&mask_buf[0], k); + + } + else { + if(k > len) k = len; + if(k == 0) return LV_DRAW_MASK_RES_TRANSP; + else if(k > 0) lv_memset_00(&mask_buf[k], len - k); + } + + } + else { + int32_t y_inters; + if(p->xy_steep < 0) { + y_inters = (xsf * (-p->yx_steep)) >> 10; + if(k >= 0 && k < len) { + m = (y_inters * xsf) >> 9; + if(p->inv) m = 255 - m; + mask_buf[k] = mask_mix(mask_buf[k], m); + } + k--; + + int32_t x_inters = ((255 - y_inters) * (-p->xy_steep)) >> 10; + + if(k >= 0 && k < len) { + m = 255 - (((255 - y_inters) * x_inters) >> 9); + if(p->inv) m = 255 - m; + mask_buf[k] = mask_mix(mask_buf[k], m); + } + + k += 2; + + if(p->inv) { + k = xsi - abs_x - 1; + + if(k > len) k = len; + else if(k > 0) lv_memset_00(&mask_buf[0], k); + + } + else { + if(k > len) return LV_DRAW_MASK_RES_FULL_COVER; + if(k >= 0) lv_memset_00(&mask_buf[k], len - k); + } + + } + else { + y_inters = ((255 - xsf) * p->yx_steep) >> 10; + if(k >= 0 && k < len) { + m = 255 - ((y_inters * (255 - xsf)) >> 9); + if(p->inv) m = 255 - m; + mask_buf[k] = mask_mix(mask_buf[k], m); + } + + k++; + + int32_t x_inters = ((255 - y_inters) * p->xy_steep) >> 10; + if(k >= 0 && k < len) { + m = ((255 - y_inters) * x_inters) >> 9; + if(p->inv) m = 255 - m; + mask_buf[k] = mask_mix(mask_buf[k], m); + } + k++; + + if(p->inv) { + k = xsi - abs_x; + if(k > len) return LV_DRAW_MASK_RES_TRANSP; + if(k >= 0) lv_memset_00(&mask_buf[0], k); + + } + else { + if(k > len) k = len; + if(k == 0) return LV_DRAW_MASK_RES_TRANSP; + else if(k > 0) lv_memset_00(&mask_buf[k], len - k); + } + } + } + + return LV_DRAW_MASK_RES_CHANGED; +} + +static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_angle_param_t * p) +{ + int32_t rel_y = abs_y - p->cfg.vertex_p.y; + int32_t rel_x = abs_x - p->cfg.vertex_p.x; + + if(p->cfg.start_angle < 180 && p->cfg.end_angle < 180 && + p->cfg.start_angle != 0 && p->cfg.end_angle != 0 && + p->cfg.start_angle > p->cfg.end_angle) { + + if(abs_y < p->cfg.vertex_p.y) { + return LV_DRAW_MASK_RES_FULL_COVER; + } + + /*Start angle mask can work only from the end of end angle mask*/ + int32_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10; + int32_t start_angle_last = ((rel_y + 1) * p->start_line.xy_steep) >> 10; + + /*Do not let the line end cross the vertex else it will affect the opposite part*/ + if(p->cfg.start_angle > 270 && p->cfg.start_angle <= 359 && start_angle_last < 0) start_angle_last = 0; + else if(p->cfg.start_angle > 0 && p->cfg.start_angle <= 90 && start_angle_last < 0) start_angle_last = 0; + else if(p->cfg.start_angle > 90 && p->cfg.start_angle < 270 && start_angle_last > 0) start_angle_last = 0; + + if(p->cfg.end_angle > 270 && p->cfg.end_angle <= 359 && start_angle_last < 0) start_angle_last = 0; + else if(p->cfg.end_angle > 0 && p->cfg.end_angle <= 90 && start_angle_last < 0) start_angle_last = 0; + else if(p->cfg.end_angle > 90 && p->cfg.end_angle < 270 && start_angle_last > 0) start_angle_last = 0; + + int32_t dist = (end_angle_first - start_angle_last) >> 1; + + lv_draw_mask_res_t res1 = LV_DRAW_MASK_RES_FULL_COVER; + lv_draw_mask_res_t res2 = LV_DRAW_MASK_RES_FULL_COVER; + + int32_t tmp = start_angle_last + dist - rel_x; + if(tmp > len) tmp = len; + if(tmp > 0) { + res1 = lv_draw_mask_line(&mask_buf[0], abs_x, abs_y, tmp, &p->start_line); + if(res1 == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(&mask_buf[0], tmp); + } + } + + if(tmp > len) tmp = len; + if(tmp < 0) tmp = 0; + res2 = lv_draw_mask_line(&mask_buf[tmp], abs_x + tmp, abs_y, len - tmp, &p->end_line); + if(res2 == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(&mask_buf[tmp], len - tmp); + } + if(res1 == res2) return res1; + else return LV_DRAW_MASK_RES_CHANGED; + } + else if(p->cfg.start_angle > 180 && p->cfg.end_angle > 180 && p->cfg.start_angle > p->cfg.end_angle) { + + if(abs_y > p->cfg.vertex_p.y) { + return LV_DRAW_MASK_RES_FULL_COVER; + } + + /*Start angle mask can work only from the end of end angle mask*/ + int32_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10; + int32_t start_angle_last = ((rel_y + 1) * p->start_line.xy_steep) >> 10; + + /*Do not let the line end cross the vertex else it will affect the opposite part*/ + if(p->cfg.start_angle > 270 && p->cfg.start_angle <= 359 && start_angle_last < 0) start_angle_last = 0; + else if(p->cfg.start_angle > 0 && p->cfg.start_angle <= 90 && start_angle_last < 0) start_angle_last = 0; + else if(p->cfg.start_angle > 90 && p->cfg.start_angle < 270 && start_angle_last > 0) start_angle_last = 0; + + if(p->cfg.end_angle > 270 && p->cfg.end_angle <= 359 && start_angle_last < 0) start_angle_last = 0; + else if(p->cfg.end_angle > 0 && p->cfg.end_angle <= 90 && start_angle_last < 0) start_angle_last = 0; + else if(p->cfg.end_angle > 90 && p->cfg.end_angle < 270 && start_angle_last > 0) start_angle_last = 0; + + int32_t dist = (end_angle_first - start_angle_last) >> 1; + + lv_draw_mask_res_t res1 = LV_DRAW_MASK_RES_FULL_COVER; + lv_draw_mask_res_t res2 = LV_DRAW_MASK_RES_FULL_COVER; + + int32_t tmp = start_angle_last + dist - rel_x; + if(tmp > len) tmp = len; + if(tmp > 0) { + res1 = lv_draw_mask_line(&mask_buf[0], abs_x, abs_y, tmp, (lv_draw_mask_line_param_t *)&p->end_line); + if(res1 == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(&mask_buf[0], tmp); + } + } + + if(tmp > len) tmp = len; + if(tmp < 0) tmp = 0; + res2 = lv_draw_mask_line(&mask_buf[tmp], abs_x + tmp, abs_y, len - tmp, (lv_draw_mask_line_param_t *)&p->start_line); + if(res2 == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(&mask_buf[tmp], len - tmp); + } + if(res1 == res2) return res1; + else return LV_DRAW_MASK_RES_CHANGED; + } + else { + + lv_draw_mask_res_t res1 = LV_DRAW_MASK_RES_FULL_COVER; + lv_draw_mask_res_t res2 = LV_DRAW_MASK_RES_FULL_COVER; + + if(p->cfg.start_angle == 180) { + if(abs_y < p->cfg.vertex_p.y) res1 = LV_DRAW_MASK_RES_FULL_COVER; + else res1 = LV_DRAW_MASK_RES_UNKNOWN; + } + else if(p->cfg.start_angle == 0) { + if(abs_y < p->cfg.vertex_p.y) res1 = LV_DRAW_MASK_RES_UNKNOWN; + else res1 = LV_DRAW_MASK_RES_FULL_COVER; + } + else if((p->cfg.start_angle < 180 && abs_y < p->cfg.vertex_p.y) || + (p->cfg.start_angle > 180 && abs_y >= p->cfg.vertex_p.y)) { + res1 = LV_DRAW_MASK_RES_UNKNOWN; + } + else { + res1 = lv_draw_mask_line(mask_buf, abs_x, abs_y, len, &p->start_line); + } + + if(p->cfg.end_angle == 180) { + if(abs_y < p->cfg.vertex_p.y) res2 = LV_DRAW_MASK_RES_UNKNOWN; + else res2 = LV_DRAW_MASK_RES_FULL_COVER; + } + else if(p->cfg.end_angle == 0) { + if(abs_y < p->cfg.vertex_p.y) res2 = LV_DRAW_MASK_RES_FULL_COVER; + else res2 = LV_DRAW_MASK_RES_UNKNOWN; + } + else if((p->cfg.end_angle < 180 && abs_y < p->cfg.vertex_p.y) || + (p->cfg.end_angle > 180 && abs_y >= p->cfg.vertex_p.y)) { + res2 = LV_DRAW_MASK_RES_UNKNOWN; + } + else { + res2 = lv_draw_mask_line(mask_buf, abs_x, abs_y, len, &p->end_line); + } + + if(res1 == LV_DRAW_MASK_RES_TRANSP || res2 == LV_DRAW_MASK_RES_TRANSP) return LV_DRAW_MASK_RES_TRANSP; + else if(res1 == LV_DRAW_MASK_RES_UNKNOWN && res2 == LV_DRAW_MASK_RES_UNKNOWN) return LV_DRAW_MASK_RES_TRANSP; + else if(res1 == LV_DRAW_MASK_RES_FULL_COVER && res2 == LV_DRAW_MASK_RES_FULL_COVER) return LV_DRAW_MASK_RES_FULL_COVER; + else return LV_DRAW_MASK_RES_CHANGED; + } +} + + + +static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_radius_param_t * p) +{ + bool outer = p->cfg.outer; + int32_t radius = p->cfg.radius; + lv_area_t rect; + lv_area_copy(&rect, &p->cfg.rect); + + if(outer == false) { + if((abs_y < rect.y1 || abs_y > rect.y2)) { + return LV_DRAW_MASK_RES_TRANSP; + } + } + else { + if(abs_y < rect.y1 || abs_y > rect.y2) { + return LV_DRAW_MASK_RES_FULL_COVER; + } + } + + if((abs_x >= rect.x1 + radius && abs_x + len <= rect.x2 - radius) || + (abs_y >= rect.y1 + radius && abs_y <= rect.y2 - radius)) { + if(outer == false) { + /*Remove the edges*/ + int32_t last = rect.x1 - abs_x; + if(last > len) return LV_DRAW_MASK_RES_TRANSP; + if(last >= 0) { + lv_memset_00(&mask_buf[0], last); + } + + int32_t first = rect.x2 - abs_x + 1; + if(first <= 0) return LV_DRAW_MASK_RES_TRANSP; + else if(first < len) { + lv_memset_00(&mask_buf[first], len - first); + } + if(last == 0 && first == len) return LV_DRAW_MASK_RES_FULL_COVER; + else return LV_DRAW_MASK_RES_CHANGED; + } + else { + int32_t first = rect.x1 - abs_x; + if(first < 0) first = 0; + if(first <= len) { + int32_t last = rect.x2 - abs_x - first + 1; + if(first + last > len) last = len - first; + if(last >= 0) { + lv_memset_00(&mask_buf[first], last); + } + } + } + return LV_DRAW_MASK_RES_CHANGED; + } + // printf("exec: x:%d.. %d, y:%d: r:%d, %s\n", abs_x, abs_x + len - 1, abs_y, p->cfg.radius, p->cfg.outer ? "inv" : "norm"); + + + // if( abs_x == 276 && abs_x + len - 1 == 479 && abs_y == 63 && p->cfg.radius == 5 && p->cfg.outer == 1) { + // char x = 0; + // } + //exec: x:276.. 479, y:63: r:5, inv) + + int32_t k = rect.x1 - abs_x; /*First relevant coordinate on the of the mask*/ + int32_t w = lv_area_get_width(&rect); + int32_t h = lv_area_get_height(&rect); + abs_x -= rect.x1; + abs_y -= rect.y1; + + lv_coord_t aa_len; + lv_coord_t x_start; + lv_coord_t cir_y; + if(abs_y < radius) { + cir_y = radius - abs_y - 1; + } + else { + cir_y = abs_y - (h - radius); + } + lv_opa_t * aa_opa = get_next_line(p->circle, cir_y, &aa_len, &x_start); + lv_coord_t cir_x_right = k + w - radius + x_start; + lv_coord_t cir_x_left = k + radius - x_start - 1; + lv_coord_t i; + + if(outer == false) { + for(i = 0; i < aa_len; i++) { + lv_opa_t opa = aa_opa[aa_len - i - 1]; + if(cir_x_right + i >= 0 && cir_x_right + i < len) { + mask_buf[cir_x_right + i] = mask_mix(opa, mask_buf[cir_x_right + i]); + } + if(cir_x_left - i >= 0 && cir_x_left - i < len) { + mask_buf[cir_x_left - i] = mask_mix(opa, mask_buf[cir_x_left - i]); + } + } + + /*Clean the right side*/ + cir_x_right = LV_CLAMP(0, cir_x_right + i, len); + lv_memset_00(&mask_buf[cir_x_right], len - cir_x_right); + + /*Clean the left side*/ + cir_x_left = LV_CLAMP(0, cir_x_left - aa_len + 1, len); + lv_memset_00(&mask_buf[0], cir_x_left); + } + else { + for(i = 0; i < aa_len; i++) { + lv_opa_t opa = 255 - (aa_opa[aa_len - 1 - i]); + if(cir_x_right + i >= 0 && cir_x_right + i < len) { + mask_buf[cir_x_right + i] = mask_mix(opa, mask_buf[cir_x_right + i]); + } + if(cir_x_left - i >= 0 && cir_x_left - i < len) { + mask_buf[cir_x_left - i] = mask_mix(opa, mask_buf[cir_x_left - i]); + } + } + + lv_coord_t clr_start = LV_CLAMP(0, cir_x_left + 1, len); + lv_coord_t clr_len = LV_CLAMP(0, cir_x_right - clr_start, len - clr_start); + lv_memset_00(&mask_buf[clr_start], clr_len); + } + + return LV_DRAW_MASK_RES_CHANGED; +} + +static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_fade_param_t * p) +{ + if(abs_y < p->cfg.coords.y1) return LV_DRAW_MASK_RES_FULL_COVER; + if(abs_y > p->cfg.coords.y2) return LV_DRAW_MASK_RES_FULL_COVER; + if(abs_x + len < p->cfg.coords.x1) return LV_DRAW_MASK_RES_FULL_COVER; + if(abs_x > p->cfg.coords.x2) return LV_DRAW_MASK_RES_FULL_COVER; + + if(abs_x + len > p->cfg.coords.x2) len -= abs_x + len - p->cfg.coords.x2 - 1; + + if(abs_x < p->cfg.coords.x1) { + int32_t x_ofs = 0; + x_ofs = p->cfg.coords.x1 - abs_x; + len -= x_ofs; + mask_buf += x_ofs; + } + + int32_t i; + + if(abs_y <= p->cfg.y_top) { + for(i = 0; i < len; i++) { + mask_buf[i] = mask_mix(mask_buf[i], p->cfg.opa_top); + } + return LV_DRAW_MASK_RES_CHANGED; + } + else if(abs_y >= p->cfg.y_bottom) { + for(i = 0; i < len; i++) { + mask_buf[i] = mask_mix(mask_buf[i], p->cfg.opa_bottom); + } + return LV_DRAW_MASK_RES_CHANGED; + } + else { + /*Calculate the opa proportionally*/ + int16_t opa_diff = p->cfg.opa_bottom - p->cfg.opa_top; + int32_t y_diff = p->cfg.y_bottom - p->cfg.y_top + 1; + lv_opa_t opa_act = (int32_t)((int32_t)(abs_y - p->cfg.y_top) * opa_diff) / y_diff; + opa_act += p->cfg.opa_top; + + for(i = 0; i < len; i++) { + mask_buf[i] = mask_mix(mask_buf[i], opa_act); + } + return LV_DRAW_MASK_RES_CHANGED; + } +} + +static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_map(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_map_param_t * p) +{ + /*Handle out of the mask cases*/ + if(abs_y < p->cfg.coords.y1) return LV_DRAW_MASK_RES_FULL_COVER; + if(abs_y > p->cfg.coords.y2) return LV_DRAW_MASK_RES_FULL_COVER; + if(abs_x + len < p->cfg.coords.x1) return LV_DRAW_MASK_RES_FULL_COVER; + if(abs_x > p->cfg.coords.x2) return LV_DRAW_MASK_RES_FULL_COVER; + + /*Got to the current row in the map*/ + const lv_opa_t * map_tmp = p->cfg.map; + map_tmp += (abs_y - p->cfg.coords.y1) * lv_area_get_width(&p->cfg.coords); + + if(abs_x + len > p->cfg.coords.x2) len -= abs_x + len - p->cfg.coords.x2 - 1; + + if(abs_x < p->cfg.coords.x1) { + int32_t x_ofs = 0; + x_ofs = p->cfg.coords.x1 - abs_x; + len -= x_ofs; + mask_buf += x_ofs; + } + else { + map_tmp += (abs_x - p->cfg.coords.x1); + } + + int32_t i; + for(i = 0; i < len; i++) { + mask_buf[i] = mask_mix(mask_buf[i], map_tmp[i]); + } + + return LV_DRAW_MASK_RES_CHANGED; +} + +static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_polygon(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + lv_draw_mask_polygon_param_t * param) +{ + uint16_t i; + struct { + lv_point_t p1; + lv_point_t p2; + } lines[2], tmp; + uint16_t line_cnt = 0; + lv_memset_00(&lines, sizeof(lines)); + int psign_prev = 0; + for(i = 0; i < param->cfg.point_cnt; i++) { + lv_point_t p1 = param->cfg.points[i]; + lv_point_t p2 = param->cfg.points[i + 1 < param->cfg.point_cnt ? i + 1 : 0]; + int pdiff = p1.y - p2.y, psign = pdiff / LV_ABS(pdiff); + if(pdiff > 0) { + if(abs_y > p1.y || abs_y < p2.y) continue; + lines[line_cnt].p1 = p2; + lines[line_cnt].p2 = p1; + } + else { + if(abs_y < p1.y || abs_y > p2.y) continue; + lines[line_cnt].p1 = p1; + lines[line_cnt].p2 = p2; + } + if(psign_prev && psign_prev == psign) continue; + psign_prev = psign; + line_cnt++; + if(line_cnt == 2) break; + } + if(line_cnt != 2) return LV_DRAW_MASK_RES_TRANSP; + if(lines[0].p1.x > lines[1].p1.x || lines[0].p2.x > lines[1].p2.x) { + tmp = lines[0]; + lines[0] = lines[1]; + lines[1] = tmp; + } + lv_draw_mask_line_param_t line_p; + lv_draw_mask_line_points_init(&line_p, lines[0].p1.x, lines[0].p1.y, lines[0].p2.x, lines[0].p2.y, + LV_DRAW_MASK_LINE_SIDE_RIGHT); + if(line_p.steep == 0 && line_p.flat) { + lv_coord_t x1 = LV_MIN(lines[0].p1.x, lines[0].p2.x); + lv_coord_t x2 = LV_MAX(lines[0].p1.x, lines[0].p2.x); + for(i = 0; i < len; i++) { + mask_buf[i] = mask_mix(mask_buf[i], (abs_x + i >= x1 && abs_x + i <= x2) * 0xFF); + } + lv_draw_mask_free_param(&line_p); + return LV_DRAW_MASK_RES_CHANGED; + } + lv_draw_mask_res_t res1 = lv_draw_mask_line(mask_buf, abs_x, abs_y, len, &line_p); + lv_draw_mask_free_param(&line_p); + if(res1 == LV_DRAW_MASK_RES_TRANSP) { + return LV_DRAW_MASK_RES_TRANSP; + } + lv_draw_mask_line_points_init(&line_p, lines[1].p1.x, lines[1].p1.y, lines[1].p2.x, lines[1].p2.y, + LV_DRAW_MASK_LINE_SIDE_LEFT); + if(line_p.steep == 0 && line_p.flat) { + lv_coord_t x1 = LV_MIN(lines[1].p1.x, lines[1].p2.x); + lv_coord_t x2 = LV_MAX(lines[1].p1.x, lines[1].p2.x); + for(i = 0; i < len; i++) { + mask_buf[i] = mask_mix(mask_buf[i], (abs_x + i >= x1 && abs_x + i <= x2) * 0xFF); + } + lv_draw_mask_free_param(&line_p); + return LV_DRAW_MASK_RES_CHANGED; + } + lv_draw_mask_res_t res2 = lv_draw_mask_line(mask_buf, abs_x, abs_y, len, &line_p); + lv_draw_mask_free_param(&line_p); + if(res2 == LV_DRAW_MASK_RES_TRANSP) { + return LV_DRAW_MASK_RES_TRANSP; + } + if(res1 == LV_DRAW_MASK_RES_CHANGED || res2 == LV_DRAW_MASK_RES_CHANGED) return LV_DRAW_MASK_RES_CHANGED; + return res1; +} +/** + * Initialize the circle drawing + * @param c pointer to a point. The coordinates will be calculated here + * @param tmp point to a variable. It will store temporary data + * @param radius radius of the circle + */ +static void circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius) +{ + c->x = radius; + c->y = 0; + *tmp = 1 - radius; +} + +/** + * Test the circle drawing is ready or not + * @param c same as in circ_init + * @return true if the circle is not ready yet + */ +static bool circ_cont(lv_point_t * c) +{ + return c->y <= c->x ? true : false; +} + +/** + * Get the next point from the circle + * @param c same as in circ_init. The next point stored here. + * @param tmp same as in circ_init. + */ +static void circ_next(lv_point_t * c, lv_coord_t * tmp) +{ + + if(*tmp <= 0) { + (*tmp) += 2 * c->y + 3; /*Change in decision criterion for y -> y+1*/ + } + else { + (*tmp) += 2 * (c->y - c->x) + 5; /*Change for y -> y+1, x -> x-1*/ + c->x--; + } + c->y++; +} + +static void circ_calc_aa4(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_t radius) +{ + if(radius == 0) return; + c->radius = radius; + + /*Allocate buffers*/ + if(c->buf) lv_mem_free(c->buf); + + c->buf = lv_mem_alloc(radius * 6 + 6); /*Use uint16_t for opa_start_on_y and x_start_on_y*/ + LV_ASSERT_MALLOC(c->buf); + c->cir_opa = c->buf; + c->opa_start_on_y = (uint16_t *)(c->buf + 2 * radius + 2); + c->x_start_on_y = (uint16_t *)(c->buf + 4 * radius + 4); + + /*Special case, handle manually*/ + if(radius == 1) { + c->cir_opa[0] = 180; + c->opa_start_on_y[0] = 0; + c->opa_start_on_y[1] = 1; + c->x_start_on_y[0] = 0; + return; + } + + lv_coord_t * cir_x = lv_mem_buf_get((radius + 1) * 2 * 2 * sizeof(lv_coord_t)); + lv_coord_t * cir_y = &cir_x[(radius + 1) * 2]; + + uint32_t y_8th_cnt = 0; + lv_point_t cp; + lv_coord_t tmp; + circ_init(&cp, &tmp, radius * 4); /*Upscale by 4*/ + int32_t i; + + uint32_t x_int[4]; + uint32_t x_fract[4]; + lv_coord_t cir_size = 0; + x_int[0] = cp.x >> 2; + x_fract[0] = 0; + + /*Calculate an 1/8 circle*/ + while(circ_cont(&cp)) { + /*Calculate 4 point of the circle */ + for(i = 0; i < 4; i++) { + circ_next(&cp, &tmp); + if(circ_cont(&cp) == false) break; + x_int[i] = cp.x >> 2; + x_fract[i] = cp.x & 0x3; + } + if(i != 4) break; + + /*All lines on the same x when downscaled*/ + if(x_int[0] == x_int[3]) { + cir_x[cir_size] = x_int[0]; + cir_y[cir_size] = y_8th_cnt; + c->cir_opa[cir_size] = x_fract[0] + x_fract[1] + x_fract[2] + x_fract[3]; + c->cir_opa[cir_size] *= 16; + cir_size++; + } + /*Second line on new x when downscaled*/ + else if(x_int[0] != x_int[1]) { + cir_x[cir_size] = x_int[0]; + cir_y[cir_size] = y_8th_cnt; + c->cir_opa[cir_size] = x_fract[0]; + c->cir_opa[cir_size] *= 16; + cir_size++; + + cir_x[cir_size] = x_int[0] - 1; + cir_y[cir_size] = y_8th_cnt; + c->cir_opa[cir_size] = 1 * 4 + x_fract[1] + x_fract[2] + x_fract[3];; + c->cir_opa[cir_size] *= 16; + cir_size++; + } + /*Third line on new x when downscaled*/ + else if(x_int[0] != x_int[2]) { + cir_x[cir_size] = x_int[0]; + cir_y[cir_size] = y_8th_cnt; + c->cir_opa[cir_size] = x_fract[0] + x_fract[1]; + c->cir_opa[cir_size] *= 16; + cir_size++; + + cir_x[cir_size] = x_int[0] - 1; + cir_y[cir_size] = y_8th_cnt; + c->cir_opa[cir_size] = 2 * 4 + x_fract[2] + x_fract[3];; + c->cir_opa[cir_size] *= 16; + cir_size++; + } + /*Forth line on new x when downscaled*/ + else { + cir_x[cir_size] = x_int[0]; + cir_y[cir_size] = y_8th_cnt; + c->cir_opa[cir_size] = x_fract[0] + x_fract[1] + x_fract[2]; + c->cir_opa[cir_size] *= 16; + cir_size++; + + cir_x[cir_size] = x_int[0] - 1; + cir_y[cir_size] = y_8th_cnt; + c->cir_opa[cir_size] = 3 * 4 + x_fract[3];; + c->cir_opa[cir_size] *= 16; + cir_size++; + } + + y_8th_cnt++; + } + + /*The point on the 1/8 circle is special, calculate it manually*/ + int32_t mid = radius * 723; + int32_t mid_int = mid >> 10; + if(cir_x[cir_size - 1] != mid_int || cir_y[cir_size - 1] != mid_int) { + int32_t tmp_val = mid - (mid_int << 10); + if(tmp_val <= 512) { + tmp_val = tmp_val * tmp_val * 2; + tmp_val = tmp_val >> (10 + 6); + } + else { + tmp_val = 1024 - tmp_val; + tmp_val = tmp_val * tmp_val * 2; + tmp_val = tmp_val >> (10 + 6); + tmp_val = 15 - tmp_val; + } + + cir_x[cir_size] = mid_int; + cir_y[cir_size] = mid_int; + c->cir_opa[cir_size] = tmp_val; + c->cir_opa[cir_size] *= 16; + cir_size++; + } + + /*Build the second octet by mirroring the first*/ + for(i = cir_size - 2; i >= 0; i--, cir_size++) { + cir_x[cir_size] = cir_y[i]; + cir_y[cir_size] = cir_x[i]; + c->cir_opa[cir_size] = c->cir_opa[i]; + } + + lv_coord_t y = 0; + i = 0; + c->opa_start_on_y[0] = 0; + while(i < cir_size) { + c->opa_start_on_y[y] = i; + c->x_start_on_y[y] = cir_x[i]; + for(; cir_y[i] == y && i < (int32_t)cir_size; i++) { + c->x_start_on_y[y] = LV_MIN(c->x_start_on_y[y], cir_x[i]); + } + y++; + } + + lv_mem_buf_release(cir_x); +} + +static lv_opa_t * get_next_line(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_t y, lv_coord_t * len, + lv_coord_t * x_start) +{ + *len = c->opa_start_on_y[y + 1] - c->opa_start_on_y[y]; + *x_start = c->x_start_on_y[y]; + return &c->cir_opa[c->opa_start_on_y[y]]; +} + + +static inline lv_opa_t LV_ATTRIBUTE_FAST_MEM mask_mix(lv_opa_t mask_act, lv_opa_t mask_new) +{ + if(mask_new >= LV_OPA_MAX) return mask_act; + if(mask_new <= LV_OPA_MIN) return 0; + + return LV_UDIV255(mask_act * mask_new);// >> 8); +} + + +#endif /*LV_DRAW_COMPLEX*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_mask.h b/L3_Middlewares/LVGL/src/draw/lv_draw_mask.h index 6dfed79..908be6b 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_mask.h +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_mask.h @@ -10,40 +10,379 @@ extern "C" { #endif + /********************* * INCLUDES *********************/ -#include "../misc/lv_color.h" +#include #include "../misc/lv_area.h" -#include "../misc/lv_style.h" +#include "../misc/lv_color.h" +#include "../misc/lv_math.h" /********************* * DEFINES *********************/ +#define LV_MASK_ID_INV (-1) +#if LV_DRAW_COMPLEX +# define _LV_MASK_MAX_NUM 16 +#else +# define _LV_MASK_MAX_NUM 1 +#endif + +/********************** + * TYPEDEFS + **********************/ + +enum { + LV_DRAW_MASK_RES_TRANSP, + LV_DRAW_MASK_RES_FULL_COVER, + LV_DRAW_MASK_RES_CHANGED, + LV_DRAW_MASK_RES_UNKNOWN +}; + +typedef uint8_t lv_draw_mask_res_t; + +typedef struct { + void * param; + void * custom_id; +} _lv_draw_mask_saved_t; + +typedef _lv_draw_mask_saved_t _lv_draw_mask_saved_arr_t[_LV_MASK_MAX_NUM]; + + + +#if LV_DRAW_COMPLEX == 0 +static inline uint8_t lv_draw_mask_get_cnt(void) +{ + return 0; +} + +static inline bool lv_draw_mask_is_any(const lv_area_t * a) +{ + LV_UNUSED(a); + return false; +} + +#endif + +#if LV_DRAW_COMPLEX + +enum { + LV_DRAW_MASK_TYPE_LINE, + LV_DRAW_MASK_TYPE_ANGLE, + LV_DRAW_MASK_TYPE_RADIUS, + LV_DRAW_MASK_TYPE_FADE, + LV_DRAW_MASK_TYPE_MAP, + LV_DRAW_MASK_TYPE_POLYGON, +}; + +typedef uint8_t lv_draw_mask_type_t; + +enum { + LV_DRAW_MASK_LINE_SIDE_LEFT = 0, + LV_DRAW_MASK_LINE_SIDE_RIGHT, + LV_DRAW_MASK_LINE_SIDE_TOP, + LV_DRAW_MASK_LINE_SIDE_BOTTOM, +}; + +/** + * A common callback type for every mask type. + * Used internally by the library. + */ +typedef lv_draw_mask_res_t (*lv_draw_mask_xcb_t)(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, + lv_coord_t len, + void * p); + +typedef uint8_t lv_draw_mask_line_side_t; + +typedef struct { + lv_draw_mask_xcb_t cb; + lv_draw_mask_type_t type; +} _lv_draw_mask_common_dsc_t; + +typedef struct { + /*The first element must be the common descriptor*/ + _lv_draw_mask_common_dsc_t dsc; + + struct { + /*First point*/ + lv_point_t p1; + + /*Second point*/ + lv_point_t p2; + + /*Which side to keep?*/ + lv_draw_mask_line_side_t side : 2; + } cfg; + + /*A point of the line*/ + lv_point_t origo; + + /*X / (1024*Y) steepness (X is 0..1023 range). What is the change of X in 1024 Y?*/ + int32_t xy_steep; + + /*Y / (1024*X) steepness (Y is 0..1023 range). What is the change of Y in 1024 X?*/ + int32_t yx_steep; + + /*Helper which stores yx_steep for flat lines and xy_steep for steep (non flat) lines*/ + int32_t steep; + + /*Steepness in 1 px in 0..255 range. Used only by flat lines.*/ + int32_t spx; + + /*1: It's a flat line? (Near to horizontal)*/ + uint8_t flat : 1; + + /*Invert the mask. The default is: Keep the left part. + *It is used to select left/right/top/bottom*/ + uint8_t inv: 1; +} lv_draw_mask_line_param_t; + +typedef struct { + /*The first element must be the common descriptor*/ + _lv_draw_mask_common_dsc_t dsc; + + struct { + lv_point_t vertex_p; + lv_coord_t start_angle; + lv_coord_t end_angle; + } cfg; + + lv_draw_mask_line_param_t start_line; + lv_draw_mask_line_param_t end_line; + uint16_t delta_deg; +} lv_draw_mask_angle_param_t; + +typedef struct { + uint8_t * buf; + lv_opa_t * cir_opa; /*Opacity of values on the circumference of an 1/4 circle*/ + uint16_t * x_start_on_y; /*The x coordinate of the circle for each y value*/ + uint16_t * opa_start_on_y; /*The index of `cir_opa` for each y value*/ + int32_t life; /*How many times the entry way used*/ + uint32_t used_cnt; /*Like a semaphore to count the referencing masks*/ + lv_coord_t radius; /*The radius of the entry*/ +} _lv_draw_mask_radius_circle_dsc_t; + +typedef _lv_draw_mask_radius_circle_dsc_t _lv_draw_mask_radius_circle_dsc_arr_t[LV_CIRCLE_CACHE_SIZE]; + +typedef struct { + /*The first element must be the common descriptor*/ + _lv_draw_mask_common_dsc_t dsc; + + struct { + lv_area_t rect; + lv_coord_t radius; + /*Invert the mask. 0: Keep the pixels inside.*/ + uint8_t outer: 1; + } cfg; + + _lv_draw_mask_radius_circle_dsc_t * circle; +} lv_draw_mask_radius_param_t; + + +typedef struct { + /*The first element must be the common descriptor*/ + _lv_draw_mask_common_dsc_t dsc; + + struct { + lv_area_t coords; + lv_coord_t y_top; + lv_coord_t y_bottom; + lv_opa_t opa_top; + lv_opa_t opa_bottom; + } cfg; + +} lv_draw_mask_fade_param_t; + + +typedef struct _lv_draw_mask_map_param_t { + /*The first element must be the common descriptor*/ + _lv_draw_mask_common_dsc_t dsc; + + struct { + lv_area_t coords; + const lv_opa_t * map; + } cfg; +} lv_draw_mask_map_param_t; + +typedef struct { + /*The first element must be the common descriptor*/ + _lv_draw_mask_common_dsc_t dsc; + + struct { + lv_point_t * points; + uint16_t point_cnt; + } cfg; +} lv_draw_mask_polygon_param_t; + /********************** * GLOBAL PROTOTYPES **********************/ /** - * Initialize a rectangle mask draw descriptor. - * @param dsc pointer to a draw descriptor + * Add a draw mask. Everything drawn after it (until removing the mask) will be affected by the mask. + * @param param an initialized mask parameter. Only the pointer is saved. + * @param custom_id a custom pointer to identify the mask. Used in `lv_draw_mask_remove_custom`. + * @return the an integer, the ID of the mask. Can be used in `lv_draw_mask_remove_id`. */ -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_rect_dsc_init(lv_draw_mask_rect_dsc_t * dsc); +int16_t lv_draw_mask_add(void * param, void * custom_id); + +//! @cond Doxygen_Suppress /** - * Try to get a rectangle mask draw descriptor from a draw task. - * @param task draw task - * @return the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_MASK_RECTANGLE + * Apply the added buffers on a line. Used internally by the library's drawing routines. + * @param mask_buf store the result mask here. Has to be `len` byte long. Should be initialized with `0xFF`. + * @param abs_x absolute X coordinate where the line to calculate start + * @param abs_y absolute Y coordinate where the line to calculate start + * @param len length of the line to calculate (in pixel count) + * @return One of these values: + * - `LV_DRAW_MASK_RES_FULL_TRANSP`: the whole line is transparent. `mask_buf` is not set to zero + * - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged + * - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line */ -lv_draw_mask_rect_dsc_t * lv_draw_task_get_mask_rect_dsc(lv_draw_task_t * task); +lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len); /** - * Create a draw task to mask a rectangle from the buffer - * @param layer pointer to a layer - * @param dsc pointer to a draw descriptor + * Apply the specified buffers on a line. Used internally by the library's drawing routines. + * @param mask_buf store the result mask here. Has to be `len` byte long. Should be initialized with `0xFF`. + * @param abs_x absolute X coordinate where the line to calculate start + * @param abs_y absolute Y coordinate where the line to calculate start + * @param len length of the line to calculate (in pixel count) + * @param ids ID array of added buffers + * @param ids_count number of ID array + * @return One of these values: + * - `LV_DRAW_MASK_RES_FULL_TRANSP`: the whole line is transparent. `mask_buf` is not set to zero + * - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged + * - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line */ -void lv_draw_mask_rect(lv_layer_t * layer, const lv_draw_mask_rect_dsc_t * dsc); +lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_apply_ids(lv_opa_t * mask_buf, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t len, + const int16_t * ids, int16_t ids_count); + +//! @endcond + +/** + * Remove a mask with a given ID + * @param id the ID of the mask. Returned by `lv_draw_mask_add` + * @return the parameter of the removed mask. + * If more masks have `custom_id` ID then the last mask's parameter will be returned + */ +void * lv_draw_mask_remove_id(int16_t id); + +/** + * Remove all mask with a given custom ID + * @param custom_id a pointer used in `lv_draw_mask_add` + * @return return the parameter of the removed mask. + * If more masks have `custom_id` ID then the last mask's parameter will be returned + */ +void * lv_draw_mask_remove_custom(void * custom_id); + +/** + * Free the data from the parameter. + * It's called inside `lv_draw_mask_remove_id` and `lv_draw_mask_remove_custom` + * Needs to be called only in special cases when the mask is not added by `lv_draw_mask_add` + * and not removed by `lv_draw_mask_remove_id` or `lv_draw_mask_remove_custom` + * @param p pointer to a mask parameter + */ +void lv_draw_mask_free_param(void * p); + +/** + * Called by LVGL the rendering of a screen is ready to clean up + * the temporal (cache) data of the masks + */ +void _lv_draw_mask_cleanup(void); + +//! @cond Doxygen_Suppress + +/** + * Count the currently added masks + * @return number of active masks + */ +uint8_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_get_cnt(void); + + +/** + * Check if there is any added draw mask + * @param a an area to test for affecting masks. + * @return true: there is t least 1 draw mask; false: there are no draw masks + */ +bool lv_draw_mask_is_any(const lv_area_t * a); + +//! @endcond + +/** + *Initialize a line mask from two points. + * @param param pointer to a `lv_draw_mask_param_t` to initialize + * @param p1x X coordinate of the first point of the line + * @param p1y Y coordinate of the first point of the line + * @param p2x X coordinate of the second point of the line + * @param p2y y coordinate of the second point of the line + * @param side and element of `lv_draw_mask_line_side_t` to describe which side to keep. + * With `LV_DRAW_MASK_LINE_SIDE_LEFT/RIGHT` and horizontal line all pixels are kept + * With `LV_DRAW_MASK_LINE_SIDE_TOP/BOTTOM` and vertical line all pixels are kept + */ +void lv_draw_mask_line_points_init(lv_draw_mask_line_param_t * param, lv_coord_t p1x, lv_coord_t p1y, lv_coord_t p2x, + lv_coord_t p2y, lv_draw_mask_line_side_t side); + +/** + *Initialize a line mask from a point and an angle. + * @param param pointer to a `lv_draw_mask_param_t` to initialize + * @param px X coordinate of a point of the line + * @param py X coordinate of a point of the line + * @param angle right 0 deg, bottom: 90 + * @param side and element of `lv_draw_mask_line_side_t` to describe which side to keep. + * With `LV_DRAW_MASK_LINE_SIDE_LEFT/RIGHT` and horizontal line all pixels are kept + * With `LV_DRAW_MASK_LINE_SIDE_TOP/BOTTOM` and vertical line all pixels are kept + */ +void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t p1x, lv_coord_t py, int16_t angle, + lv_draw_mask_line_side_t side); + +/** + * Initialize an angle mask. + * @param param pointer to a `lv_draw_mask_param_t` to initialize + * @param vertex_x X coordinate of the angle vertex (absolute coordinates) + * @param vertex_y Y coordinate of the angle vertex (absolute coordinates) + * @param start_angle start angle in degrees. 0 deg on the right, 90 deg, on the bottom + * @param end_angle end angle + */ +void lv_draw_mask_angle_init(lv_draw_mask_angle_param_t * param, lv_coord_t vertex_x, lv_coord_t vertex_y, + lv_coord_t start_angle, lv_coord_t end_angle); + +/** + * Initialize a fade mask. + * @param param pointer to an `lv_draw_mask_radius_param_t` to initialize + * @param rect coordinates of the rectangle to affect (absolute coordinates) + * @param radius radius of the rectangle + * @param inv true: keep the pixels inside the rectangle; keep the pixels outside of the rectangle + */ +void lv_draw_mask_radius_init(lv_draw_mask_radius_param_t * param, const lv_area_t * rect, lv_coord_t radius, bool inv); + +/** + * Initialize a fade mask. + * @param param pointer to a `lv_draw_mask_param_t` to initialize + * @param coords coordinates of the area to affect (absolute coordinates) + * @param opa_top opacity on the top + * @param y_top at which coordinate start to change to opacity to `opa_bottom` + * @param opa_bottom opacity at the bottom + * @param y_bottom at which coordinate reach `opa_bottom`. + */ +void lv_draw_mask_fade_init(lv_draw_mask_fade_param_t * param, const lv_area_t * coords, lv_opa_t opa_top, + lv_coord_t y_top, + lv_opa_t opa_bottom, lv_coord_t y_bottom); + +/** + * Initialize a map mask. + * @param param pointer to a `lv_draw_mask_param_t` to initialize + * @param coords coordinates of the map (absolute coordinates) + * @param map array of bytes with the mask values + */ +void lv_draw_mask_map_init(lv_draw_mask_map_param_t * param, const lv_area_t * coords, const lv_opa_t * map); + +void lv_draw_mask_polygon_init(lv_draw_mask_polygon_param_t * param, const lv_point_t * points, uint16_t point_cnt); + +#endif /*LV_DRAW_COMPLEX*/ /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_mask_private.h b/L3_Middlewares/LVGL/src/draw/lv_draw_mask_private.h deleted file mode 100644 index 040df7e..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_mask_private.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file lv_draw_mask_private.h - * - */ - -#ifndef LV_DRAW_MASK_PRIVATE_H -#define LV_DRAW_MASK_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_mask.h" -#include "lv_draw.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ -struct lv_draw_mask_rect_dsc_t { - lv_draw_dsc_base_t base; - - lv_area_t area; - int32_t radius; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_MASK_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_private.h b/L3_Middlewares/LVGL/src/draw/lv_draw_private.h deleted file mode 100644 index d8244f7..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_private.h +++ /dev/null @@ -1,196 +0,0 @@ -/** - * @file lv_draw_private.h - * - */ - -/** - * Modified by NXP in 2024 - */ - -#ifndef LV_DRAW_PRIVATE_H -#define LV_DRAW_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_draw_task_t { - lv_draw_task_t * next; - - lv_draw_task_type_t type; - - /** - * The area where to draw - */ - lv_area_t area; - - /** - * The real draw area. E.g. for shadow, outline, or transformed images it's different from `area` - */ - lv_area_t _real_area; - - /** The original area which is updated*/ - lv_area_t clip_area_original; - - /** - * The clip area of the layer is saved here when the draw task is created. - * As the clip area of the layer can be changed as new draw tasks are added its current value needs to be saved. - * Therefore during drawing the layer's clip area shouldn't be used as it might be already changed for other draw tasks. - */ - lv_area_t clip_area; - -#if LV_DRAW_TRANSFORM_USE_MATRIX - /** Transform matrix to be applied when rendering the layer */ - lv_matrix_t matrix; -#endif - - volatile int state; /** int instead of lv_draw_task_state_t to be sure its atomic */ - - void * draw_dsc; - - /** - * The ID of the draw_unit which should take this task - */ - uint8_t preferred_draw_unit_id; - - /** - * Set to which extent `preferred_draw_unit_id` is good at this task. - * 80: means 20% better (faster) than software rendering - * 100: the default value - * 110: means 10% worse (slower) than software rendering - */ - uint8_t preference_score; - -}; - -struct lv_draw_mask_t { - void * user_data; -}; - -struct lv_draw_unit_t { - lv_draw_unit_t * next; - - /** - * The target_layer on which drawing should happen - */ - lv_layer_t * target_layer; - - const lv_area_t * clip_area; - - /** - * Called to try to assign a draw task to itself. - * `lv_draw_get_next_available_task` can be used to get an independent draw task. - * A draw task should be assign only if the draw unit can draw it too - * @param draw_unit pointer to the draw unit - * @param layer pointer to a layer on which the draw task should be drawn - * @return >=0: The number of taken draw task: - * 0 means the task has not yet been completed. - * 1 means a new task has been accepted. - * -1: The draw unit wanted to work on a task but couldn't do that - * due to some errors (e.g. out of memory). - * It signals that LVGL should call the dispatcher later again - * to let draw unit try to start the rendering again. - */ - int32_t (*dispatch_cb)(lv_draw_unit_t * draw_unit, lv_layer_t * layer); - - /** - * - * @param draw_unit - * @param task - * @return - */ - int32_t (*evaluate_cb)(lv_draw_unit_t * draw_unit, lv_draw_task_t * task); - - /** - * Called to signal the unit to complete all tasks in order to return their ready status. - * This callback can be implemented in case of asynchronous task processing. - * Below is an example to show the difference between synchronous and asynchronous: - * - * Synchronous: - * LVGL thread DRAW thread HW - * - * task1 --> submit --> Receive task1 - * wait_for_finish() - * <-- task1->state = READY <-- Complete task1 - * task2 --> submit --> Receive task2 - * wait_for_finish() - * task2->state = READY <-- Complete task2 - * task3 --> submit --> Receive task3 - * wait_for_finish() - * <-- task3->state = READY <-- Complete task3 - * task4 --> submit --> Receive task4 - * wait_for_finish() - * <-- task4->state = READY <-- Complete task4 - * NO MORE TASKS - * - * - * Asynchronous: - * LVGL thread DRAW thread HW - * is IDLE - * task1 --> queue task1 - * submit --> Receive task1 - * task2 --> queue task2 is BUSY (with task1) - * task3 --> queue task3 still BUSY (with task1) - * task4 --> queue task4 becomes IDLE - * <-- task1->state = READY <-- Complete task1 - * submit --> Receive task2, task3, task4 - * NO MORE TASKS - * wait_for_finish_cb() wait_for_finish() - * <-- Complete task2, task3, task4 - * <-- task2->state = READY <-- - * <-- task3->state = READY <-- - * <-- task4->state = READY <-- - * - * @param draw_unit - * @return - */ - int32_t (*wait_for_finish_cb)(lv_draw_unit_t * draw_unit); - - /** - * Called to delete draw unit. - * @param draw_unit - * @return - */ - int32_t (*delete_cb)(lv_draw_unit_t * draw_unit); -}; - -typedef struct { - lv_draw_unit_t * unit_head; - uint32_t unit_cnt; - uint32_t used_memory_for_layers_kb; -#if LV_USE_OS - lv_thread_sync_t sync; -#else - int dispatch_req; -#endif - lv_mutex_t circle_cache_mutex; - bool task_running; -} lv_draw_global_info_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_rect.c b/L3_Middlewares/LVGL/src/draw/lv_draw_rect.c index ec2acc5..ae81f38 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_rect.c +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_rect.c @@ -6,12 +6,9 @@ /********************* * INCLUDES *********************/ -#include "lv_draw_rect_private.h" -#include "lv_draw_private.h" -#include "../core/lv_obj.h" +#include "lv_draw.h" +#include "lv_draw_rect.h" #include "../misc/lv_assert.h" -#include "../core/lv_obj_event.h" -#include "../stdlib/lv_string.h" /********************* * DEFINES @@ -39,7 +36,7 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc) { - lv_memzero(dsc, sizeof(lv_draw_rect_dsc_t)); + lv_memset_00(dsc, sizeof(lv_draw_rect_dsc_t)); dsc->bg_color = lv_color_white(); dsc->bg_grad.stops[0].color = lv_color_white(); dsc->bg_grad.stops[1].color = lv_color_black(); @@ -47,254 +44,28 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc) dsc->bg_grad.stops_count = 2; dsc->border_color = lv_color_black(); dsc->shadow_color = lv_color_black(); - dsc->bg_image_symbol_font = LV_FONT_DEFAULT; + dsc->bg_img_symbol_font = LV_FONT_DEFAULT; dsc->bg_opa = LV_OPA_COVER; - dsc->bg_image_opa = LV_OPA_COVER; + dsc->bg_img_opa = LV_OPA_COVER; dsc->outline_opa = LV_OPA_COVER; dsc->border_opa = LV_OPA_COVER; dsc->shadow_opa = LV_OPA_COVER; dsc->border_side = LV_BORDER_SIDE_FULL; } -void lv_draw_fill_dsc_init(lv_draw_fill_dsc_t * dsc) -{ - lv_memzero(dsc, sizeof(*dsc)); - dsc->opa = LV_OPA_COVER; - dsc->base.dsc_size = sizeof(lv_draw_fill_dsc_t); -} - -lv_draw_fill_dsc_t * lv_draw_task_get_fill_dsc(lv_draw_task_t * task) -{ - return task->type == LV_DRAW_TASK_TYPE_FILL ? (lv_draw_fill_dsc_t *)task->draw_dsc : NULL; -} - -void lv_draw_border_dsc_init(lv_draw_border_dsc_t * dsc) -{ - lv_memzero(dsc, sizeof(*dsc)); - dsc->opa = LV_OPA_COVER; - dsc->side = LV_BORDER_SIDE_FULL; - dsc->base.dsc_size = sizeof(lv_draw_border_dsc_t); -} - -lv_draw_border_dsc_t * lv_draw_task_get_border_dsc(lv_draw_task_t * task) -{ - return task->type == LV_DRAW_TASK_TYPE_BORDER ? (lv_draw_border_dsc_t *)task->draw_dsc : NULL; -} - -void lv_draw_box_shadow_dsc_init(lv_draw_box_shadow_dsc_t * dsc) -{ - lv_memzero(dsc, sizeof(*dsc)); - dsc->opa = LV_OPA_COVER; - dsc->base.dsc_size = sizeof(lv_draw_box_shadow_dsc_t); -} - -lv_draw_box_shadow_dsc_t * lv_draw_task_get_box_shadow_dsc(lv_draw_task_t * task) -{ - return task->type == LV_DRAW_TASK_TYPE_BOX_SHADOW ? (lv_draw_box_shadow_dsc_t *)task->draw_dsc : NULL; -} - -void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) +/** + * Draw a rectangle + * @param coords the coordinates of the rectangle + * @param mask the rectangle will be drawn only in this mask + * @param dsc pointer to an initialized `lv_draw_rect_dsc_t` variable + */ +void lv_draw_rect(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) { + if(lv_area_get_height(coords) < 1 || lv_area_get_width(coords) < 1) return; - LV_PROFILER_BEGIN; - bool has_shadow; - bool has_fill; - bool has_border; - bool has_outline; - bool has_bg_img; - - if(dsc->shadow_width == 0 || - dsc->shadow_opa <= LV_OPA_MIN || - (dsc->shadow_width == 1 && dsc->shadow_spread <= 0 && - dsc->shadow_offset_x == 0 && dsc->shadow_offset_y == 0)) { - has_shadow = false; - } - else { - has_shadow = true; - } - - if(dsc->bg_opa <= LV_OPA_MIN) has_fill = false; - else has_fill = true; - - if(dsc->bg_image_opa <= LV_OPA_MIN || dsc->bg_image_src == NULL) has_bg_img = false; - else has_bg_img = true; - - if(dsc->border_opa <= LV_OPA_MIN - || dsc->border_width == 0 - || dsc->border_post == true - || dsc->border_side == LV_BORDER_SIDE_NONE) has_border = false; - else has_border = true; - - if(dsc->outline_opa <= LV_OPA_MIN || dsc->outline_width == 0) has_outline = false; - else has_outline = true; - - bool bg_cover = true; - if(dsc->bg_opa < LV_OPA_COVER) bg_cover = false; - else if(dsc->bg_grad.dir != LV_GRAD_DIR_NONE) { - uint32_t s; - for(s = 0; s < dsc->bg_grad.stops_count; s++) { - if(dsc->bg_grad.stops[s].opa != LV_OPA_COVER) { - bg_cover = false; - break; - } - } - } - - lv_draw_task_t * t; - - /*Shadow*/ - if(has_shadow) { - /*Check whether the shadow is visible*/ - t = lv_draw_add_task(layer, coords); - lv_draw_box_shadow_dsc_t * shadow_dsc = lv_malloc(sizeof(lv_draw_box_shadow_dsc_t)); - t->draw_dsc = shadow_dsc; - lv_area_increase(&t->_real_area, dsc->shadow_spread, dsc->shadow_spread); - lv_area_increase(&t->_real_area, dsc->shadow_width, dsc->shadow_width); - lv_area_move(&t->_real_area, dsc->shadow_offset_x, dsc->shadow_offset_y); - shadow_dsc->base = dsc->base; - shadow_dsc->base.dsc_size = sizeof(lv_draw_box_shadow_dsc_t); - shadow_dsc->radius = dsc->radius; - shadow_dsc->color = dsc->shadow_color; - shadow_dsc->width = dsc->shadow_width; - shadow_dsc->spread = dsc->shadow_spread; - shadow_dsc->opa = dsc->shadow_opa; - shadow_dsc->ofs_x = dsc->shadow_offset_x; - shadow_dsc->ofs_y = dsc->shadow_offset_y; - shadow_dsc->bg_cover = bg_cover; - t->type = LV_DRAW_TASK_TYPE_BOX_SHADOW; - lv_draw_finalize_task_creation(layer, t); - } - - /*Background*/ - if(has_fill) { - lv_area_t bg_coords = *coords; - /*If the border fully covers make the bg area 1px smaller to avoid artifacts on the corners*/ - if(dsc->border_width > 1 && dsc->border_opa >= LV_OPA_MAX && dsc->radius != 0) { - bg_coords.x1 += (dsc->border_side & LV_BORDER_SIDE_LEFT) ? 1 : 0; - bg_coords.y1 += (dsc->border_side & LV_BORDER_SIDE_TOP) ? 1 : 0; - bg_coords.x2 -= (dsc->border_side & LV_BORDER_SIDE_RIGHT) ? 1 : 0; - bg_coords.y2 -= (dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? 1 : 0; - } - - t = lv_draw_add_task(layer, &bg_coords); - lv_draw_fill_dsc_t * bg_dsc = lv_malloc(sizeof(lv_draw_fill_dsc_t)); - lv_draw_fill_dsc_init(bg_dsc); - t->draw_dsc = bg_dsc; - bg_dsc->base = dsc->base; - bg_dsc->base.dsc_size = sizeof(lv_draw_fill_dsc_t); - bg_dsc->radius = dsc->radius; - bg_dsc->color = dsc->bg_color; - bg_dsc->grad = dsc->bg_grad; - bg_dsc->opa = dsc->bg_opa; - t->type = LV_DRAW_TASK_TYPE_FILL; - - lv_draw_finalize_task_creation(layer, t); - } - - /*Background image*/ - if(has_bg_img) { - lv_image_src_t src_type = lv_image_src_get_type(dsc->bg_image_src); - lv_result_t res = LV_RESULT_OK; - lv_image_header_t header; - if(src_type == LV_IMAGE_SRC_VARIABLE || src_type == LV_IMAGE_SRC_FILE) { - res = lv_image_decoder_get_info(dsc->bg_image_src, &header); - } - else if(src_type == LV_IMAGE_SRC_UNKNOWN) { - res = LV_RESULT_INVALID; - } - else { - lv_memzero(&header, sizeof(header)); - } - - if(res == LV_RESULT_OK) { - if(src_type == LV_IMAGE_SRC_VARIABLE || src_type == LV_IMAGE_SRC_FILE) { - - if(dsc->bg_image_tiled) { - t = lv_draw_add_task(layer, coords); - } - else { - lv_area_t a = {0, 0, header.w - 1, header.h - 1}; - lv_area_align(coords, &a, LV_ALIGN_CENTER, 0, 0); - t = lv_draw_add_task(layer, &a); - } - - lv_draw_image_dsc_t * bg_image_dsc = lv_malloc(sizeof(lv_draw_image_dsc_t)); - lv_draw_image_dsc_init(bg_image_dsc); - t->draw_dsc = bg_image_dsc; - bg_image_dsc->base = dsc->base; - bg_image_dsc->base.dsc_size = sizeof(lv_draw_image_dsc_t); - bg_image_dsc->src = dsc->bg_image_src; - bg_image_dsc->opa = dsc->bg_image_opa; - bg_image_dsc->recolor = dsc->bg_image_recolor; - bg_image_dsc->recolor_opa = dsc->bg_image_recolor_opa; - bg_image_dsc->tile = dsc->bg_image_tiled; - bg_image_dsc->header = header; - bg_image_dsc->clip_radius = dsc->radius; - t->type = LV_DRAW_TASK_TYPE_IMAGE; - lv_draw_finalize_task_creation(layer, t); - } - else { - lv_point_t s; - lv_text_get_size(&s, dsc->bg_image_src, dsc->bg_image_symbol_font, 0, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE); - - lv_area_t a = {0, 0, s.x - 1, s.y - 1}; - lv_area_align(coords, &a, LV_ALIGN_CENTER, 0, 0); - t = lv_draw_add_task(layer, &a); - - lv_draw_label_dsc_t * bg_label_dsc = lv_malloc(sizeof(lv_draw_label_dsc_t)); - lv_draw_label_dsc_init(bg_label_dsc); - t->draw_dsc = bg_label_dsc; - bg_label_dsc->base = dsc->base; - bg_label_dsc->base.dsc_size = sizeof(lv_draw_label_dsc_t); - bg_label_dsc->color = dsc->bg_image_recolor; - bg_label_dsc->font = dsc->bg_image_symbol_font; - bg_label_dsc->text = dsc->bg_image_src; - t->type = LV_DRAW_TASK_TYPE_LABEL; - lv_draw_finalize_task_creation(layer, t); - } - } - } - - /*Border*/ - if(has_border) { - t = lv_draw_add_task(layer, coords); - lv_draw_border_dsc_t * border_dsc = lv_malloc(sizeof(lv_draw_border_dsc_t)); - t->draw_dsc = border_dsc; - border_dsc->base = dsc->base; - border_dsc->base.dsc_size = sizeof(lv_draw_border_dsc_t); - border_dsc->radius = dsc->radius; - border_dsc->color = dsc->border_color; - border_dsc->opa = dsc->border_opa; - border_dsc->width = dsc->border_width; - border_dsc->side = dsc->border_side; - t->type = LV_DRAW_TASK_TYPE_BORDER; - lv_draw_finalize_task_creation(layer, t); - } - - /*Outline*/ - if(has_outline) { - lv_area_t outline_coords = *coords; - lv_area_increase(&outline_coords, dsc->outline_width + dsc->outline_pad, dsc->outline_width + dsc->outline_pad); - t = lv_draw_add_task(layer, &outline_coords); - lv_draw_border_dsc_t * outline_dsc = lv_malloc(sizeof(lv_draw_border_dsc_t)); - t->draw_dsc = outline_dsc; - lv_area_increase(&t->_real_area, dsc->outline_width, dsc->outline_width); - lv_area_increase(&t->_real_area, dsc->outline_pad, dsc->outline_pad); - outline_dsc->base = dsc->base; - outline_dsc->base.dsc_size = sizeof(lv_draw_border_dsc_t); - outline_dsc->radius = dsc->radius == LV_RADIUS_CIRCLE ? LV_RADIUS_CIRCLE : dsc->radius + dsc->outline_width + - dsc->outline_pad; - outline_dsc->color = dsc->outline_color; - outline_dsc->opa = dsc->outline_opa; - outline_dsc->width = dsc->outline_width; - outline_dsc->side = LV_BORDER_SIDE_FULL; - t->type = LV_DRAW_TASK_TYPE_BORDER; - lv_draw_finalize_task_creation(layer, t); - } + draw_ctx->draw_rect(draw_ctx, dsc, coords); LV_ASSERT_MEM_INTEGRITY(); - - LV_PROFILER_END; } /********************** diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_rect.h b/L3_Middlewares/LVGL/src/draw/lv_draw_rect.h index 6fe3a82..46a58a4 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_rect.h +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_rect.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "lv_draw.h" +#include "../lv_conf_internal.h" #include "../misc/lv_color.h" #include "../misc/lv_area.h" #include "../misc/lv_style.h" @@ -30,9 +30,8 @@ LV_EXPORT_CONST_INT(LV_RADIUS_CIRCLE); **********************/ typedef struct { - lv_draw_dsc_base_t base; - - int32_t radius; + lv_coord_t radius; + lv_blend_mode_t blend_mode; /*Background*/ lv_opa_t bg_opa; @@ -40,128 +39,51 @@ typedef struct { lv_grad_dsc_t bg_grad; /*Background img*/ - const void * bg_image_src; - const void * bg_image_symbol_font; - lv_color_t bg_image_recolor; - lv_opa_t bg_image_opa; - lv_opa_t bg_image_recolor_opa; - uint8_t bg_image_tiled; + const void * bg_img_src; + const void * bg_img_symbol_font; + lv_color_t bg_img_recolor; + lv_opa_t bg_img_opa; + lv_opa_t bg_img_recolor_opa; + uint8_t bg_img_tiled; /*Border*/ lv_color_t border_color; - int32_t border_width; + lv_coord_t border_width; lv_opa_t border_opa; + uint8_t border_post : 1; /*There is a border it will be drawn later.*/ lv_border_side_t border_side : 5; - uint8_t border_post : 1; /*The border will be drawn later*/ /*Outline*/ lv_color_t outline_color; - int32_t outline_width; - int32_t outline_pad; + lv_coord_t outline_width; + lv_coord_t outline_pad; lv_opa_t outline_opa; /*Shadow*/ lv_color_t shadow_color; - int32_t shadow_width; - int32_t shadow_offset_x; - int32_t shadow_offset_y; - int32_t shadow_spread; + lv_coord_t shadow_width; + lv_coord_t shadow_ofs_x; + lv_coord_t shadow_ofs_y; + lv_coord_t shadow_spread; lv_opa_t shadow_opa; } lv_draw_rect_dsc_t; -typedef struct { - lv_draw_dsc_base_t base; - - int32_t radius; - - lv_opa_t opa; - lv_color_t color; - lv_grad_dsc_t grad; -} lv_draw_fill_dsc_t; - -typedef struct { - lv_draw_dsc_base_t base; - - int32_t radius; - - lv_color_t color; - int32_t width; - lv_opa_t opa; - lv_border_side_t side : 5; - -} lv_draw_border_dsc_t; - -typedef struct { - lv_draw_dsc_base_t base; - - int32_t radius; - - lv_color_t color; - int32_t width; - int32_t spread; - int32_t ofs_x; - int32_t ofs_y; - lv_opa_t opa; - uint8_t bg_cover : 1; -} lv_draw_box_shadow_dsc_t; +struct _lv_draw_ctx_t; /********************** * GLOBAL PROTOTYPES **********************/ -/** - * Initialize a rectangle draw descriptor. - * @param dsc pointer to a draw descriptor - */ void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc); -/** - * Initialize a fill draw descriptor. - * @param dsc pointer to a draw descriptor - */ -void lv_draw_fill_dsc_init(lv_draw_fill_dsc_t * dsc); - -/** - * Try to get a fill draw descriptor from a draw task. - * @param task draw task - * @return the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_FILL - */ -lv_draw_fill_dsc_t * lv_draw_task_get_fill_dsc(lv_draw_task_t * task); - -/** - * Initialize a border draw descriptor. - * @param dsc pointer to a draw descriptor - */ -void lv_draw_border_dsc_init(lv_draw_border_dsc_t * dsc); - -/** - * Try to get a border draw descriptor from a draw task. - * @param task draw task - * @return the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_BORDER - */ -lv_draw_border_dsc_t * lv_draw_task_get_border_dsc(lv_draw_task_t * task); - -/** - * Initialize a box shadow draw descriptor. - * @param dsc pointer to a draw descriptor - */ -void lv_draw_box_shadow_dsc_init(lv_draw_box_shadow_dsc_t * dsc); - -/** - * Try to get a box shadow draw descriptor from a draw task. - * @param task draw task - * @return the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_BOX_SHADOW - */ -lv_draw_box_shadow_dsc_t * lv_draw_task_get_box_shadow_dsc(lv_draw_task_t * task); /** - * The rectangle is a wrapper for fill, border, bg. image and box shadow. - * Internally fill, border, image and box shadow draw tasks will be created. - * @param layer pointer to a layer - * @param dsc pointer to an initialized draw descriptor variable - * @param coords the coordinates of the rectangle + * Draw a rectangle + * @param coords the coordinates of the rectangle + * @param clip the rectangle will be drawn only in this area + * @param dsc pointer to an initialized `lv_draw_rect_dsc_t` variable */ -void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); +void lv_draw_rect(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_transform.c b/L3_Middlewares/LVGL/src/draw/lv_draw_transform.c new file mode 100644 index 0000000..580351d --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_transform.c @@ -0,0 +1,54 @@ +/** + * @file lv_draw_transform.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_draw.h" +#include "lv_draw_transform.h" +#include "../misc/lv_assert.h" +#include "../misc/lv_area.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ +void lv_draw_transform(lv_draw_ctx_t * draw_ctx, const lv_area_t * dest_area, const void * src_buf, lv_coord_t src_w, + lv_coord_t src_h, + lv_coord_t src_stride, const lv_draw_img_dsc_t * draw_dsc, lv_img_cf_t cf, lv_color_t * cbuf, lv_opa_t * abuf) +{ + LV_ASSERT_NULL(draw_ctx); + if(draw_ctx->draw_transform == NULL) { + LV_LOG_WARN("draw_ctx->draw_transform == NULL"); + return; + } + + draw_ctx->draw_transform(draw_ctx, dest_area, src_buf, src_w, src_h, src_stride, draw_dsc, cf, cbuf, abuf); + +} + + +/********************** + * STATIC FUNCTIONS + **********************/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_transform.h b/L3_Middlewares/LVGL/src/draw/lv_draw_transform.h new file mode 100644 index 0000000..1926c2f --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_transform.h @@ -0,0 +1,44 @@ +/** + * @file lv_draw_transform.h + * + */ + +#ifndef LV_DRAW_TRANSFORM_H +#define LV_DRAW_TRANSFORM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" +#include "../misc/lv_area.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ +struct _lv_draw_ctx_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +void lv_draw_transform(struct _lv_draw_ctx_t * draw_ctx, const lv_area_t * dest_area, const void * src_buf, + lv_coord_t src_w, lv_coord_t src_h, + lv_coord_t src_stride, const lv_draw_img_dsc_t * draw_dsc, lv_img_cf_t cf, lv_color_t * cbuf, lv_opa_t * abuf); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_TRANSFORM_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_triangle.c b/L3_Middlewares/LVGL/src/draw/lv_draw_triangle.c index 6bf1c7c..42b4d77 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_triangle.c +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_triangle.c @@ -6,13 +6,10 @@ /********************* * INCLUDES *********************/ - -#include "lv_draw_triangle_private.h" -#include "lv_draw_private.h" -#include "../core/lv_obj.h" +#include "lv_draw.h" +#include "lv_draw_triangle.h" #include "../misc/lv_math.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_string.h" +#include "../misc/lv_mem.h" /********************* * DEFINES @@ -38,44 +35,16 @@ * GLOBAL FUNCTIONS **********************/ -void lv_draw_triangle_dsc_init(lv_draw_triangle_dsc_t * dsc) -{ - LV_PROFILER_BEGIN; - lv_memzero(dsc, sizeof(lv_draw_triangle_dsc_t)); - dsc->bg_color = lv_color_white(); - dsc->bg_grad.stops[0].color = lv_color_white(); - dsc->bg_grad.stops[1].color = lv_color_black(); - dsc->bg_grad.stops[1].frac = 0xFF; - dsc->bg_grad.stops_count = 2; - dsc->bg_opa = LV_OPA_COVER; - dsc->base.dsc_size = sizeof(lv_draw_triangle_dsc_t); - LV_PROFILER_END; -} - -lv_draw_triangle_dsc_t * lv_draw_task_get_triangle_dsc(lv_draw_task_t * task) +void lv_draw_polygon(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc, const lv_point_t points[], + uint16_t point_cnt) { - return task->type == LV_DRAW_TASK_TYPE_TRIANGLE ? (lv_draw_triangle_dsc_t *)task->draw_dsc : NULL; + draw_ctx->draw_polygon(draw_ctx, draw_dsc, points, point_cnt); } -void lv_draw_triangle(lv_layer_t * layer, const lv_draw_triangle_dsc_t * dsc) +void lv_draw_triangle(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc, const lv_point_t points[]) { - if(dsc->bg_opa <= LV_OPA_MIN) return; - - LV_PROFILER_BEGIN; - lv_area_t a; - a.x1 = (int32_t)LV_MIN3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - a.y1 = (int32_t)LV_MIN3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - a.x2 = (int32_t)LV_MAX3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - a.y2 = (int32_t)LV_MAX3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - - lv_draw_task_t * t = lv_draw_add_task(layer, &a); - - t->draw_dsc = lv_malloc(sizeof(*dsc)); - lv_memcpy(t->draw_dsc, dsc, sizeof(*dsc)); - t->type = LV_DRAW_TASK_TYPE_TRIANGLE; - lv_draw_finalize_task_creation(layer, t); - LV_PROFILER_END; + draw_ctx->draw_polygon(draw_ctx, draw_dsc, points, 3); } /********************** diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_triangle.h b/L3_Middlewares/LVGL/src/draw/lv_draw_triangle.h index b1ad8e5..e8d8575 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_triangle.h +++ b/L3_Middlewares/LVGL/src/draw/lv_draw_triangle.h @@ -22,40 +22,15 @@ extern "C" { /********************** * TYPEDEFS **********************/ -typedef struct { - lv_draw_dsc_base_t base; - - lv_opa_t bg_opa; - lv_color_t bg_color; - lv_grad_dsc_t bg_grad; - - lv_point_precise_t p[3]; -} lv_draw_triangle_dsc_t; /********************** * GLOBAL PROTOTYPES **********************/ -/** - * Initialize a triangle draw descriptor - * @param draw_dsc pointer to a draw descriptor - */ -void lv_draw_triangle_dsc_init(lv_draw_triangle_dsc_t * draw_dsc); - -/** - * Try to get a triangle draw descriptor from a draw task. - * @param task draw task - * @return the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_TRIANGLE - */ -lv_draw_triangle_dsc_t * lv_draw_task_get_triangle_dsc(lv_draw_task_t * task); - -/** - * Create a triangle draw task - * @param layer pointer to a layer - * @param draw_dsc pointer to an initialized `lv_draw_triangle_dsc_t` object - */ -void lv_draw_triangle(lv_layer_t * layer, const lv_draw_triangle_dsc_t * draw_dsc); +void lv_draw_polygon(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc, const lv_point_t points[], + uint16_t point_cnt); +void lv_draw_triangle(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc, const lv_point_t points[]); /********************** * MACROS **********************/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_vector.c b/L3_Middlewares/LVGL/src/draw/lv_draw_vector.c deleted file mode 100644 index 28a08f2..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_vector.c +++ /dev/null @@ -1,804 +0,0 @@ -/** -* @file lv_draw_vector.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_vector_private.h" -#include "../misc/lv_area_private.h" -#include "lv_draw_private.h" - -#if LV_USE_VECTOR_GRAPHIC - -#include "../misc/lv_ll.h" -#include "../misc/lv_types.h" -#include "../stdlib/lv_string.h" -#include -#include - -#define MATH_PI 3.14159265358979323846f -#define MATH_HALF_PI 1.57079632679489661923f - -#define DEG_TO_RAD 0.017453292519943295769236907684886f -#define RAD_TO_DEG 57.295779513082320876798154814105f - -#define MATH_RADIANS(deg) ((deg) * DEG_TO_RAD) -#define MATH_DEGREES(rad) ((rad) * RAD_TO_DEG) - -/********************* - * DEFINES - *********************/ - -#ifndef M_PI - #define M_PI 3.1415926f -#endif - -#define CHECK_AND_RESIZE_PATH_CONTAINER(P, N) \ - do { \ - if ((lv_array_size(&(P)->ops) + (N)) > lv_array_capacity(&(P)->ops)) { \ - lv_array_resize(&(P)->ops, ((P)->ops.capacity << 1)); \ - } \ - if ((lv_array_size(&(P)->points) + (N)) > lv_array_capacity(&(P)->points)) { \ - lv_array_resize(&(P)->points, ((P)->points.capacity << 1)); \ - } \ - } while(0) - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - lv_vector_path_t * path; - lv_vector_draw_dsc_t dsc; -} lv_vector_draw_task; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void _copy_draw_dsc(lv_vector_draw_dsc_t * dst, const lv_vector_draw_dsc_t * src) -{ - lv_memcpy(&(dst->fill_dsc), &(src->fill_dsc), sizeof(lv_vector_fill_dsc_t)); - - dst->stroke_dsc.style = src->stroke_dsc.style; - dst->stroke_dsc.color = src->stroke_dsc.color; - dst->stroke_dsc.opa = src->stroke_dsc.opa; - dst->stroke_dsc.width = src->stroke_dsc.width; - dst->stroke_dsc.cap = src->stroke_dsc.cap; - dst->stroke_dsc.join = src->stroke_dsc.join; - dst->stroke_dsc.miter_limit = src->stroke_dsc.miter_limit; - lv_array_copy(&(dst->stroke_dsc.dash_pattern), &(src->stroke_dsc.dash_pattern)); - dst->stroke_dsc.gradient.style = src->stroke_dsc.gradient.style; - dst->stroke_dsc.gradient.cx = src->stroke_dsc.gradient.cx; - dst->stroke_dsc.gradient.cy = src->stroke_dsc.gradient.cy; - dst->stroke_dsc.gradient.cr = src->stroke_dsc.gradient.cr; - dst->stroke_dsc.gradient.spread = src->fill_dsc.gradient.spread; - lv_memcpy(&(dst->stroke_dsc.gradient), &(src->stroke_dsc.gradient), sizeof(lv_vector_gradient_t)); - lv_memcpy(&(dst->stroke_dsc.matrix), &(src->stroke_dsc.matrix), sizeof(lv_matrix_t)); - - dst->blend_mode = src->blend_mode; - lv_memcpy(&(dst->matrix), &(src->matrix), sizeof(lv_matrix_t)); - lv_area_copy(&(dst->scissor_area), &(src->scissor_area)); -} -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_matrix_transform_point(const lv_matrix_t * matrix, lv_fpoint_t * point) -{ - float x = point->x; - float y = point->y; - - point->x = x * matrix->m[0][0] + y * matrix->m[1][0] + matrix->m[0][2]; - point->y = x * matrix->m[0][1] + y * matrix->m[1][1] + matrix->m[1][2]; -} - -void lv_matrix_transform_path(const lv_matrix_t * matrix, lv_vector_path_t * path) -{ - lv_fpoint_t * pt = lv_array_front(&path->points); - uint32_t size = lv_array_size(&path->points); - for(uint32_t i = 0; i < size; i++) { - lv_matrix_transform_point(matrix, &pt[i]); - } -} - -/* path functions */ -lv_vector_path_t * lv_vector_path_create(lv_vector_path_quality_t quality) -{ - lv_vector_path_t * path = lv_malloc(sizeof(lv_vector_path_t)); - LV_ASSERT_MALLOC(path); - lv_memzero(path, sizeof(lv_vector_path_t)); - path->quality = quality; - lv_array_init(&path->ops, 8, sizeof(lv_vector_path_op_t)); - lv_array_init(&path->points, 8, sizeof(lv_fpoint_t)); - return path; -} - -void lv_vector_path_copy(lv_vector_path_t * target_path, const lv_vector_path_t * path) -{ - target_path->quality = path->quality; - lv_array_copy(&target_path->ops, &path->ops); - lv_array_copy(&target_path->points, &path->points); -} - -void lv_vector_path_clear(lv_vector_path_t * path) -{ - lv_array_clear(&path->ops); - lv_array_clear(&path->points); -} - -void lv_vector_path_delete(lv_vector_path_t * path) -{ - lv_array_deinit(&path->ops); - lv_array_deinit(&path->points); - lv_free(path); -} - -void lv_vector_path_move_to(lv_vector_path_t * path, const lv_fpoint_t * p) -{ - CHECK_AND_RESIZE_PATH_CONTAINER(path, 1); - - lv_vector_path_op_t op = LV_VECTOR_PATH_OP_MOVE_TO; - lv_array_push_back(&path->ops, &op); - lv_array_push_back(&path->points, p); -} - -void lv_vector_path_line_to(lv_vector_path_t * path, const lv_fpoint_t * p) -{ - if(lv_array_is_empty(&path->ops)) { - /*first op must be move_to*/ - return; - } - - CHECK_AND_RESIZE_PATH_CONTAINER(path, 1); - - lv_vector_path_op_t op = LV_VECTOR_PATH_OP_LINE_TO; - lv_array_push_back(&path->ops, &op); - lv_array_push_back(&path->points, p); -} - -void lv_vector_path_quad_to(lv_vector_path_t * path, const lv_fpoint_t * p1, const lv_fpoint_t * p2) -{ - if(lv_array_is_empty(&path->ops)) { - /*first op must be move_to*/ - return; - } - - CHECK_AND_RESIZE_PATH_CONTAINER(path, 2); - - lv_vector_path_op_t op = LV_VECTOR_PATH_OP_QUAD_TO; - lv_array_push_back(&path->ops, &op); - lv_array_push_back(&path->points, p1); - lv_array_push_back(&path->points, p2); -} - -void lv_vector_path_cubic_to(lv_vector_path_t * path, const lv_fpoint_t * p1, const lv_fpoint_t * p2, - const lv_fpoint_t * p3) -{ - if(lv_array_is_empty(&path->ops)) { - /*first op must be move_to*/ - return; - } - - CHECK_AND_RESIZE_PATH_CONTAINER(path, 3); - - lv_vector_path_op_t op = LV_VECTOR_PATH_OP_CUBIC_TO; - lv_array_push_back(&path->ops, &op); - lv_array_push_back(&path->points, p1); - lv_array_push_back(&path->points, p2); - lv_array_push_back(&path->points, p3); -} - -void lv_vector_path_close(lv_vector_path_t * path) -{ - if(lv_array_is_empty(&path->ops)) { - /*first op must be move_to*/ - return; - } - - CHECK_AND_RESIZE_PATH_CONTAINER(path, 1); - - lv_vector_path_op_t op = LV_VECTOR_PATH_OP_CLOSE; - lv_array_push_back(&path->ops, &op); -} - -void lv_vector_path_get_bounding(const lv_vector_path_t * path, lv_area_t * area) -{ - LV_ASSERT_NULL(path); - LV_ASSERT_NULL(area); - - uint32_t len = lv_array_size(&path->points); - if(len == 0) { - lv_memzero(area, sizeof(lv_area_t)); - return; - } - - lv_fpoint_t * p = lv_array_front(&path->points); - float x1 = p[0].x; - float x2 = p[0].x; - float y1 = p[0].y; - float y2 = p[0].y; - - for(uint32_t i = 1; i < len; i++) { - if(p[i].x < x1) x1 = p[i].x; - if(p[i].y < y1) y1 = p[i].y; - if(p[i].x > x2) x2 = p[i].x; - if(p[i].y > y2) y2 = p[i].y; - } - - area->x1 = (int32_t)x1; - area->y1 = (int32_t)y1; - area->x2 = (int32_t)x2; - area->y2 = (int32_t)y2; -} - -void lv_vector_path_append_rect(lv_vector_path_t * path, const lv_area_t * rect, float rx, float ry) -{ - float x = rect->x1; - float y = rect->y1; - float w = (float)lv_area_get_width(rect); - float h = (float)lv_area_get_height(rect); - - float hw = w * 0.5f; - float hh = h * 0.5f; - - if(rx > hw) rx = hw; - if(ry > hh) ry = hh; - - if(rx == 0 && ry == 0) { - lv_fpoint_t pt = {x, y}; - lv_vector_path_move_to(path, &pt); - pt.x += w; - lv_vector_path_line_to(path, &pt); - pt.y += h; - lv_vector_path_line_to(path, &pt); - pt.x -= w; - lv_vector_path_line_to(path, &pt); - lv_vector_path_close(path); - } - else if(rx == hw && ry == hh) { - lv_fpoint_t pt = {x + w * 0.5f, y + h * 0.5f}; - lv_vector_path_append_circle(path, &pt, rx, ry); - } - else { - float hrx = rx * 0.5f; - float hry = ry * 0.5f; - lv_fpoint_t pt, pt2, pt3; - - pt.x = x + rx; - pt.y = y; - lv_vector_path_move_to(path, &pt); - - pt.x = x + w - rx; - pt.y = y; - lv_vector_path_line_to(path, &pt); - - pt.x = x + w - rx + hrx; - pt.y = y; - pt2.x = x + w; - pt2.y = y + ry - hry; - pt3.x = x + w; - pt3.y = y + ry; - lv_vector_path_cubic_to(path, &pt, &pt2, &pt3); - - pt.x = x + w; - pt.y = y + h - ry; - lv_vector_path_line_to(path, &pt); - - pt.x = x + w; - pt.y = y + h - ry + hry; - pt2.x = x + w - rx + hrx; - pt2.y = y + h; - pt3.x = x + w - rx; - pt3.y = y + h; - lv_vector_path_cubic_to(path, &pt, &pt2, &pt3); - - pt.x = x + rx; - pt.y = y + h; - lv_vector_path_line_to(path, &pt); - - pt.x = x + rx - hrx; - pt.y = y + h; - pt2.x = x; - pt2.y = y + h - ry + hry; - pt3.x = x; - pt3.y = y + h - ry; - lv_vector_path_cubic_to(path, &pt, &pt2, &pt3); - - pt.x = x; - pt.y = y + ry; - lv_vector_path_line_to(path, &pt); - - pt.x = x; - pt.y = y + ry - hry; - pt2.x = x + rx - hrx; - pt2.y = y; - pt3.x = x + rx; - pt3.y = y; - lv_vector_path_cubic_to(path, &pt, &pt2, &pt3); - lv_vector_path_close(path); - } -} - -void lv_vector_path_append_circle(lv_vector_path_t * path, const lv_fpoint_t * c, float rx, float ry) -{ - float krx = rx * 0.552284f; - float kry = ry * 0.552284f; - float cx = c->x; - float cy = c->y; - - lv_fpoint_t pt, pt2, pt3; - pt.x = cx; - pt.y = cy - ry; - lv_vector_path_move_to(path, &pt); - - pt.x = cx + krx; - pt.y = cy - ry; - pt2.x = cx + rx; - pt2.y = cy - kry; - pt3.x = cx + rx; - pt3.y = cy; - lv_vector_path_cubic_to(path, &pt, &pt2, &pt3); - - pt.x = cx + rx; - pt.y = cy + kry; - pt2.x = cx + krx; - pt2.y = cy + ry; - pt3.x = cx; - pt3.y = cy + ry; - lv_vector_path_cubic_to(path, &pt, &pt2, &pt3); - - pt.x = cx - krx; - pt.y = cy + ry; - pt2.x = cx - rx; - pt2.y = cy + kry; - pt3.x = cx - rx; - pt3.y = cy; - lv_vector_path_cubic_to(path, &pt, &pt2, &pt3); - - pt.x = cx - rx; - pt.y = cy - kry; - pt2.x = cx - krx; - pt2.y = cy - ry; - pt3.x = cx; - pt3.y = cy - ry; - lv_vector_path_cubic_to(path, &pt, &pt2, &pt3); - - lv_vector_path_close(path); -} - -/** - * Add a arc to the path - * @param path pointer to a path - * @param c pointer to a `lv_fpoint_t` variable for center of the circle - * @param radius the radius for arc - * @param start_angle the start angle for arc - * @param sweep the sweep angle for arc, could be negative - * @param pie true: draw a pie, false: draw a arc - */ -void lv_vector_path_append_arc(lv_vector_path_t * path, const lv_fpoint_t * c, float radius, float start_angle, - float sweep, bool pie) -{ - float cx = c->x; - float cy = c->y; - - /* just circle */ - if(sweep >= 360.0f || sweep <= -360.0f) { - lv_vector_path_append_circle(path, c, radius, radius); - return; - } - - start_angle = MATH_RADIANS(start_angle); - sweep = MATH_RADIANS(sweep); - - int n_curves = (int)ceil(fabsf(sweep / MATH_HALF_PI)); - float sweep_sign = sweep < 0 ? -1.f : 1.f; - float fract = fmodf(sweep, MATH_HALF_PI); - fract = (fabsf(fract) < FLT_EPSILON) ? MATH_HALF_PI * sweep_sign : fract; - - /* Start from here */ - lv_fpoint_t start = { - .x = radius * cosf(start_angle), - .y = radius * sinf(start_angle), - }; - - if(pie) { - lv_vector_path_move_to(path, &(lv_fpoint_t) { - cx, cy - }); - lv_vector_path_line_to(path, &(lv_fpoint_t) { - start.x + cx, start.y + cy - }); - } - - for(int i = 0; i < n_curves; ++i) { - float end_angle = start_angle + ((i != n_curves - 1) ? MATH_HALF_PI * sweep_sign : fract); - float end_x = radius * cosf(end_angle); - float end_y = radius * sinf(end_angle); - - /* variables needed to calculate bezier control points */ - - /** get bezier control points using article: - * (http://itc.ktu.lt/index.php/ITC/article/view/11812/6479) - */ - float ax = start.x; - float ay = start.y; - float bx = end_x; - float by = end_y; - float q1 = ax * ax + ay * ay; - float q2 = ax * bx + ay * by + q1; - float k2 = (4.0f / 3.0f) * ((sqrtf(2 * q1 * q2) - q2) / (ax * by - ay * bx)); - - /* Next start point is the current end point */ - start.x = end_x; - start.y = end_y; - - end_x += cx; - end_y += cy; - - lv_fpoint_t ctrl1 = {ax - k2 * ay + cx, ay + k2 * ax + cy}; - lv_fpoint_t ctrl2 = {bx + k2 * by + cx, by - k2 * bx + cy}; - lv_fpoint_t end = {end_x, end_y}; - lv_vector_path_cubic_to(path, &ctrl1, &ctrl2, &end); - start_angle = end_angle; - } - - if(pie) { - lv_vector_path_close(path); - } -} - -void lv_vector_path_append_path(lv_vector_path_t * path, const lv_vector_path_t * subpath) -{ - uint32_t ops_size = lv_array_size(&path->ops); - uint32_t nops_size = lv_array_size(&subpath->ops); - uint32_t point_size = lv_array_size(&path->points); - uint32_t npoint_size = lv_array_size(&subpath->points); - - lv_array_concat(&path->ops, &subpath->ops); - path->ops.size = ops_size + nops_size; - - lv_array_concat(&path->points, &subpath->points); - path->points.size = point_size + npoint_size; -} - -/* draw dsc functions */ - -lv_vector_dsc_t * lv_vector_dsc_create(lv_layer_t * layer) -{ - lv_vector_dsc_t * dsc = lv_malloc(sizeof(lv_vector_dsc_t)); - LV_ASSERT_MALLOC(dsc); - lv_memzero(dsc, sizeof(lv_vector_dsc_t)); - - dsc->layer = layer; - - lv_vector_fill_dsc_t * fill_dsc = &(dsc->current_dsc.fill_dsc); - fill_dsc->style = LV_VECTOR_DRAW_STYLE_SOLID; - fill_dsc->color = lv_color_to_32(lv_color_black(), 0xFF); - fill_dsc->opa = LV_OPA_COVER; - fill_dsc->fill_rule = LV_VECTOR_FILL_NONZERO; - lv_matrix_identity(&(fill_dsc->matrix)); /*identity matrix*/ - - lv_vector_stroke_dsc_t * stroke_dsc = &(dsc->current_dsc.stroke_dsc); - stroke_dsc->style = LV_VECTOR_DRAW_STYLE_SOLID; - stroke_dsc->color = lv_color_to_32(lv_color_black(), 0xFF); - stroke_dsc->opa = LV_OPA_0; /*default no stroke*/ - stroke_dsc->width = 1.0f; - stroke_dsc->cap = LV_VECTOR_STROKE_CAP_BUTT; - stroke_dsc->join = LV_VECTOR_STROKE_JOIN_MITER; - stroke_dsc->miter_limit = 4.0f; - lv_matrix_identity(&(stroke_dsc->matrix)); /*identity matrix*/ - - dsc->current_dsc.blend_mode = LV_VECTOR_BLEND_SRC_OVER; - dsc->current_dsc.scissor_area = layer->_clip_area; - lv_matrix_identity(&(dsc->current_dsc.matrix)); /*identity matrix*/ - dsc->tasks.task_list = NULL; - return dsc; -} - -void lv_vector_dsc_delete(lv_vector_dsc_t * dsc) -{ - if(dsc->tasks.task_list) { - lv_ll_t * task_list = dsc->tasks.task_list; - lv_vector_for_each_destroy_tasks(task_list, NULL, NULL); - dsc->tasks.task_list = NULL; - } - lv_array_deinit(&(dsc->current_dsc.stroke_dsc.dash_pattern)); - lv_free(dsc); -} - -void lv_vector_dsc_set_blend_mode(lv_vector_dsc_t * dsc, lv_vector_blend_t blend) -{ - dsc->current_dsc.blend_mode = blend; -} - -void lv_vector_dsc_set_transform(lv_vector_dsc_t * dsc, const lv_matrix_t * matrix) -{ - lv_memcpy(&(dsc->current_dsc.matrix), matrix, sizeof(lv_matrix_t)); -} - -void lv_vector_dsc_set_fill_color(lv_vector_dsc_t * dsc, lv_color_t color) -{ - dsc->current_dsc.fill_dsc.style = LV_VECTOR_DRAW_STYLE_SOLID; - dsc->current_dsc.fill_dsc.color = lv_color_to_32(color, 0xFF); -} - -void lv_vector_dsc_set_fill_color32(lv_vector_dsc_t * dsc, lv_color32_t color) -{ - dsc->current_dsc.fill_dsc.style = LV_VECTOR_DRAW_STYLE_SOLID; - dsc->current_dsc.fill_dsc.color = color; -} - -void lv_vector_dsc_set_fill_opa(lv_vector_dsc_t * dsc, lv_opa_t opa) -{ - dsc->current_dsc.fill_dsc.opa = opa; -} - -void lv_vector_dsc_set_fill_rule(lv_vector_dsc_t * dsc, lv_vector_fill_t rule) -{ - dsc->current_dsc.fill_dsc.fill_rule = rule; -} - -void lv_vector_dsc_set_fill_image(lv_vector_dsc_t * dsc, const lv_draw_image_dsc_t * img_dsc) -{ - dsc->current_dsc.fill_dsc.style = LV_VECTOR_DRAW_STYLE_PATTERN; - lv_memcpy(&(dsc->current_dsc.fill_dsc.img_dsc), img_dsc, sizeof(lv_draw_image_dsc_t)); -} - -void lv_vector_dsc_set_fill_linear_gradient(lv_vector_dsc_t * dsc, float x1, float y1, float x2, float y2) -{ - dsc->current_dsc.fill_dsc.style = LV_VECTOR_DRAW_STYLE_GRADIENT; - dsc->current_dsc.fill_dsc.gradient.style = LV_VECTOR_GRADIENT_STYLE_LINEAR; - dsc->current_dsc.fill_dsc.gradient.x1 = x1; - dsc->current_dsc.fill_dsc.gradient.y1 = y1; - dsc->current_dsc.fill_dsc.gradient.x2 = x2; - dsc->current_dsc.fill_dsc.gradient.y2 = y2; -} - -void lv_vector_dsc_set_fill_radial_gradient(lv_vector_dsc_t * dsc, float cx, float cy, float radius) -{ - dsc->current_dsc.fill_dsc.style = LV_VECTOR_DRAW_STYLE_GRADIENT; - dsc->current_dsc.fill_dsc.gradient.style = LV_VECTOR_GRADIENT_STYLE_RADIAL; - dsc->current_dsc.fill_dsc.gradient.cx = cx; - dsc->current_dsc.fill_dsc.gradient.cy = cy; - dsc->current_dsc.fill_dsc.gradient.cr = radius; -} - -void lv_vector_dsc_set_fill_gradient_spread(lv_vector_dsc_t * dsc, lv_vector_gradient_spread_t spread) -{ - dsc->current_dsc.fill_dsc.gradient.spread = spread; -} - -void lv_vector_dsc_set_fill_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_gradient_stop_t * stops, - uint16_t count) -{ - if(count > LV_GRADIENT_MAX_STOPS) { - LV_LOG_WARN("Gradient stops limited: %d, max: %d", count, LV_GRADIENT_MAX_STOPS); - count = LV_GRADIENT_MAX_STOPS; - } - - lv_memcpy(&(dsc->current_dsc.fill_dsc.gradient.stops), stops, sizeof(lv_gradient_stop_t) * count); - dsc->current_dsc.fill_dsc.gradient.stops_count = count; -} - -void lv_vector_dsc_set_fill_transform(lv_vector_dsc_t * dsc, const lv_matrix_t * matrix) -{ - lv_memcpy(&(dsc->current_dsc.fill_dsc.matrix), matrix, sizeof(lv_matrix_t)); -} - -void lv_vector_dsc_set_stroke_transform(lv_vector_dsc_t * dsc, const lv_matrix_t * matrix) -{ - lv_memcpy(&(dsc->current_dsc.stroke_dsc.matrix), matrix, sizeof(lv_matrix_t)); -} - -void lv_vector_dsc_set_stroke_color32(lv_vector_dsc_t * dsc, lv_color32_t color) -{ - dsc->current_dsc.stroke_dsc.style = LV_VECTOR_DRAW_STYLE_SOLID; - dsc->current_dsc.stroke_dsc.color = color; -} - -void lv_vector_dsc_set_stroke_color(lv_vector_dsc_t * dsc, lv_color_t color) -{ - dsc->current_dsc.stroke_dsc.style = LV_VECTOR_DRAW_STYLE_SOLID; - dsc->current_dsc.stroke_dsc.color = lv_color_to_32(color, 0xFF); -} - -void lv_vector_dsc_set_stroke_opa(lv_vector_dsc_t * dsc, lv_opa_t opa) -{ - dsc->current_dsc.stroke_dsc.opa = opa; -} - -void lv_vector_dsc_set_stroke_width(lv_vector_dsc_t * dsc, float width) -{ - dsc->current_dsc.stroke_dsc.width = width; -} - -void lv_vector_dsc_set_stroke_dash(lv_vector_dsc_t * dsc, float * dash_pattern, uint16_t dash_count) -{ - lv_array_t * dash_array = &(dsc->current_dsc.stroke_dsc.dash_pattern); - if(dash_pattern) { - lv_array_clear(dash_array); - if(lv_array_capacity(dash_array) == 0) { - lv_array_init(dash_array, dash_count, sizeof(float)); - } - else { - lv_array_resize(dash_array, dash_count); - } - for(uint16_t i = 0; i < dash_count; i++) { - lv_array_push_back(dash_array, &dash_pattern[i]); - } - } - else { /*clear dash*/ - lv_array_clear(dash_array); - } -} - -void lv_vector_dsc_set_stroke_cap(lv_vector_dsc_t * dsc, lv_vector_stroke_cap_t cap) -{ - dsc->current_dsc.stroke_dsc.cap = cap; -} - -void lv_vector_dsc_set_stroke_join(lv_vector_dsc_t * dsc, lv_vector_stroke_join_t join) -{ - dsc->current_dsc.stroke_dsc.join = join; -} - -void lv_vector_dsc_set_stroke_miter_limit(lv_vector_dsc_t * dsc, uint16_t miter_limit) -{ - dsc->current_dsc.stroke_dsc.miter_limit = miter_limit; -} - -void lv_vector_dsc_set_stroke_linear_gradient(lv_vector_dsc_t * dsc, float x1, float y1, float x2, float y2) -{ - dsc->current_dsc.stroke_dsc.style = LV_VECTOR_DRAW_STYLE_GRADIENT; - dsc->current_dsc.stroke_dsc.gradient.style = LV_VECTOR_GRADIENT_STYLE_LINEAR; - dsc->current_dsc.stroke_dsc.gradient.x1 = x1; - dsc->current_dsc.stroke_dsc.gradient.y1 = y1; - dsc->current_dsc.stroke_dsc.gradient.x2 = x2; - dsc->current_dsc.stroke_dsc.gradient.y2 = y2; -} - -void lv_vector_dsc_set_stroke_radial_gradient(lv_vector_dsc_t * dsc, float cx, float cy, float radius) -{ - dsc->current_dsc.stroke_dsc.style = LV_VECTOR_DRAW_STYLE_GRADIENT; - dsc->current_dsc.stroke_dsc.gradient.style = LV_VECTOR_GRADIENT_STYLE_RADIAL; - dsc->current_dsc.stroke_dsc.gradient.cx = cx; - dsc->current_dsc.stroke_dsc.gradient.cy = cy; - dsc->current_dsc.stroke_dsc.gradient.cr = radius; -} - -void lv_vector_dsc_set_stroke_gradient_spread(lv_vector_dsc_t * dsc, lv_vector_gradient_spread_t spread) -{ - dsc->current_dsc.stroke_dsc.gradient.spread = spread; -} - -void lv_vector_dsc_set_stroke_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_gradient_stop_t * stops, - uint16_t count) -{ - if(count > LV_GRADIENT_MAX_STOPS) { - LV_LOG_WARN("Gradient stops limited: %d, max: %d", count, LV_GRADIENT_MAX_STOPS); - count = LV_GRADIENT_MAX_STOPS; - } - - lv_memcpy(&(dsc->current_dsc.stroke_dsc.gradient.stops), stops, sizeof(lv_gradient_stop_t) * count); - dsc->current_dsc.stroke_dsc.gradient.stops_count = count; -} - -/* draw functions */ -void lv_vector_dsc_add_path(lv_vector_dsc_t * dsc, const lv_vector_path_t * path) -{ - lv_area_t rect; - if(!lv_area_intersect(&rect, &(dsc->layer->_clip_area), &(dsc->current_dsc.scissor_area))) { - return; - } - - if(dsc->current_dsc.fill_dsc.opa == 0 - && dsc->current_dsc.stroke_dsc.opa == 0) { - return; - } - - if(!dsc->tasks.task_list) { - dsc->tasks.task_list = lv_malloc(sizeof(lv_ll_t)); - LV_ASSERT_MALLOC(dsc->tasks.task_list); - lv_ll_init(dsc->tasks.task_list, sizeof(lv_vector_draw_task)); - } - - lv_vector_draw_task * new_task = (lv_vector_draw_task *)lv_ll_ins_tail(dsc->tasks.task_list); - lv_memset(new_task, 0, sizeof(lv_vector_draw_task)); - - new_task->path = lv_vector_path_create(0); - - _copy_draw_dsc(&(new_task->dsc), &(dsc->current_dsc)); - lv_vector_path_copy(new_task->path, path); - new_task->dsc.scissor_area = rect; -} - -void lv_vector_clear_area(lv_vector_dsc_t * dsc, const lv_area_t * rect) -{ - lv_area_t r; - if(!lv_area_intersect(&r, &(dsc->layer->_clip_area), &(dsc->current_dsc.scissor_area))) { - return; - } - - if(!dsc->tasks.task_list) { - dsc->tasks.task_list = lv_malloc(sizeof(lv_ll_t)); - LV_ASSERT_MALLOC(dsc->tasks.task_list); - lv_ll_init(dsc->tasks.task_list, sizeof(lv_vector_draw_task)); - } - - lv_vector_draw_task * new_task = (lv_vector_draw_task *)lv_ll_ins_tail(dsc->tasks.task_list); - lv_memset(new_task, 0, sizeof(lv_vector_draw_task)); - - new_task->dsc.fill_dsc.color = dsc->current_dsc.fill_dsc.color; - new_task->dsc.fill_dsc.opa = dsc->current_dsc.fill_dsc.opa; - lv_area_copy(&(new_task->dsc.scissor_area), rect); -} - -void lv_draw_vector(lv_vector_dsc_t * dsc) -{ - if(!dsc->tasks.task_list) { - return; - } - - lv_layer_t * layer = dsc->layer; - - lv_draw_task_t * t = lv_draw_add_task(layer, &(layer->_clip_area)); - t->type = LV_DRAW_TASK_TYPE_VECTOR; - t->draw_dsc = lv_malloc(sizeof(lv_draw_vector_task_dsc_t)); - lv_memcpy(t->draw_dsc, &(dsc->tasks), sizeof(lv_draw_vector_task_dsc_t)); - lv_draw_finalize_task_creation(layer, t); - dsc->tasks.task_list = NULL; -} - -/* draw dsc transform */ -void lv_vector_dsc_identity(lv_vector_dsc_t * dsc) -{ - lv_matrix_identity(&(dsc->current_dsc.matrix)); /*identity matrix*/ -} - -void lv_vector_dsc_scale(lv_vector_dsc_t * dsc, float scale_x, float scale_y) -{ - lv_matrix_scale(&(dsc->current_dsc.matrix), scale_x, scale_y); -} - -void lv_vector_dsc_rotate(lv_vector_dsc_t * dsc, float degree) -{ - lv_matrix_rotate(&(dsc->current_dsc.matrix), degree); -} - -void lv_vector_dsc_translate(lv_vector_dsc_t * dsc, float tx, float ty) -{ - lv_matrix_translate(&(dsc->current_dsc.matrix), tx, ty); -} - -void lv_vector_dsc_skew(lv_vector_dsc_t * dsc, float skew_x, float skew_y) -{ - lv_matrix_skew(&(dsc->current_dsc.matrix), skew_x, skew_y); -} - -void lv_vector_for_each_destroy_tasks(lv_ll_t * task_list, vector_draw_task_cb cb, void * data) -{ - lv_vector_draw_task * task = lv_ll_get_head(task_list); - lv_vector_draw_task * next_task = NULL; - - while(task != NULL) { - next_task = lv_ll_get_next(task_list, task); - lv_ll_remove(task_list, task); - - if(cb) { - cb(data, task->path, &(task->dsc)); - } - - if(task->path) { - lv_vector_path_delete(task->path); - } - lv_array_deinit(&(task->dsc.stroke_dsc.dash_pattern)); - - lv_free(task); - task = next_task; - } - lv_free(task_list); -} -#endif /* LV_USE_VECTOR_GRAPHIC */ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_vector.h b/L3_Middlewares/LVGL/src/draw/lv_draw_vector.h deleted file mode 100644 index 38ce78a..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_vector.h +++ /dev/null @@ -1,489 +0,0 @@ -/** - * @file lv_draw_vector.h - * - */ - -#ifndef LV_DRAW_VECTOR_H -#define LV_DRAW_VECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../misc/lv_array.h" -#include "../misc/lv_matrix.h" -#include "lv_draw_image.h" - -#if LV_USE_VECTOR_GRAPHIC - -#if !LV_USE_MATRIX -#error "lv_draw_vector needs LV_USE_MATRIX = 1" -#endif - -/********************** - * TYPEDEFS - **********************/ -typedef enum { - LV_VECTOR_FILL_NONZERO = 0, - LV_VECTOR_FILL_EVENODD, -} lv_vector_fill_t; - -typedef enum { - LV_VECTOR_STROKE_CAP_BUTT = 0, - LV_VECTOR_STROKE_CAP_SQUARE, - LV_VECTOR_STROKE_CAP_ROUND, -} lv_vector_stroke_cap_t; - -typedef enum { - LV_VECTOR_STROKE_JOIN_MITER = 0, - LV_VECTOR_STROKE_JOIN_BEVEL, - LV_VECTOR_STROKE_JOIN_ROUND, -} lv_vector_stroke_join_t; - -typedef enum { - LV_VECTOR_PATH_QUALITY_MEDIUM = 0, /* default*/ - LV_VECTOR_PATH_QUALITY_HIGH, - LV_VECTOR_PATH_QUALITY_LOW, -} lv_vector_path_quality_t; - -typedef enum { - LV_VECTOR_BLEND_SRC_OVER = 0, - LV_VECTOR_BLEND_SRC_IN, - LV_VECTOR_BLEND_DST_OVER, - LV_VECTOR_BLEND_DST_IN, - LV_VECTOR_BLEND_SCREEN, - LV_VECTOR_BLEND_MULTIPLY, - LV_VECTOR_BLEND_NONE, - LV_VECTOR_BLEND_ADDITIVE, - LV_VECTOR_BLEND_SUBTRACTIVE, -} lv_vector_blend_t; - -typedef enum { - LV_VECTOR_PATH_OP_MOVE_TO = 0, - LV_VECTOR_PATH_OP_LINE_TO, - LV_VECTOR_PATH_OP_QUAD_TO, - LV_VECTOR_PATH_OP_CUBIC_TO, - LV_VECTOR_PATH_OP_CLOSE, -} lv_vector_path_op_t; - -typedef enum { - LV_VECTOR_DRAW_STYLE_SOLID = 0, - LV_VECTOR_DRAW_STYLE_PATTERN, - LV_VECTOR_DRAW_STYLE_GRADIENT, -} lv_vector_draw_style_t; - -typedef enum { - LV_VECTOR_GRADIENT_SPREAD_PAD = 0, - LV_VECTOR_GRADIENT_SPREAD_REPEAT, - LV_VECTOR_GRADIENT_SPREAD_REFLECT, -} lv_vector_gradient_spread_t; - -typedef enum { - LV_VECTOR_GRADIENT_STYLE_LINEAR = 0, - LV_VECTOR_GRADIENT_STYLE_RADIAL, -} lv_vector_gradient_style_t; - -struct lv_fpoint_t { - float x; - float y; -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Transform the coordinates of a point using given matrix - * @param matrix pointer to a matrix - * @param point pointer to a point - */ -void lv_matrix_transform_point(const lv_matrix_t * matrix, lv_fpoint_t * point); - -/** - * Transform all the coordinates of a path using given matrix - * @param matrix pointer to a matrix - * @param path pointer to a path - */ -void lv_matrix_transform_path(const lv_matrix_t * matrix, lv_vector_path_t * path); - -/** - * Create a vector graphic path object - * @param quality the quality hint of path - * @return pointer to the created path object - */ -lv_vector_path_t * lv_vector_path_create(lv_vector_path_quality_t quality); - -/** - * Copy a path data to another - * @param target_path pointer to a path - * @param path pointer to source path - */ -void lv_vector_path_copy(lv_vector_path_t * target_path, const lv_vector_path_t * path); - -/** - * Clear path data - * @param path pointer to a path - */ -void lv_vector_path_clear(lv_vector_path_t * path); - -/** - * Delete the graphic path object - * @param path pointer to a path - */ -void lv_vector_path_delete(lv_vector_path_t * path); - -/** - * Begin a new sub path and set a point to path - * @param path pointer to a path - * @param p pointer to a `lv_fpoint_t` variable - */ -void lv_vector_path_move_to(lv_vector_path_t * path, const lv_fpoint_t * p); - -/** - * Add a line to the path from last point to the point - * @param path pointer to a path - * @param p pointer to a `lv_fpoint_t` variable - */ -void lv_vector_path_line_to(lv_vector_path_t * path, const lv_fpoint_t * p); - -/** - * Add a quadratic bezier line to the path from last point to the point - * @param path pointer to a path - * @param p1 pointer to a `lv_fpoint_t` variable for control point - * @param p2 pointer to a `lv_fpoint_t` variable for end point - */ -void lv_vector_path_quad_to(lv_vector_path_t * path, const lv_fpoint_t * p1, const lv_fpoint_t * p2); - -/** - * Add a cubic bezier line to the path from last point to the point - * @param path pointer to a path - * @param p1 pointer to a `lv_fpoint_t` variable for first control point - * @param p2 pointer to a `lv_fpoint_t` variable for second control point - * @param p3 pointer to a `lv_fpoint_t` variable for end point - */ -void lv_vector_path_cubic_to(lv_vector_path_t * path, const lv_fpoint_t * p1, const lv_fpoint_t * p2, - const lv_fpoint_t * p3); - -/** - * Close the sub path - * @param path pointer to a path - */ -void lv_vector_path_close(lv_vector_path_t * path); - -/** - * Get the bounding box of a path - * @param path pointer to a path - * @param area pointer to a `lv_area_t` variable for bounding box - */ -void lv_vector_path_get_bounding(const lv_vector_path_t * path, lv_area_t * area); - -/** - * Add a rectangle to the path - * @param path pointer to a path - * @param rect pointer to a `lv_area_t` variable - * @param rx the horizontal radius for rounded rectangle - * @param ry the vertical radius for rounded rectangle - */ -void lv_vector_path_append_rect(lv_vector_path_t * path, const lv_area_t * rect, float rx, float ry); - -/** - * Add a circle to the path - * @param path pointer to a path - * @param c pointer to a `lv_fpoint_t` variable for center of the circle - * @param rx the horizontal radius for circle - * @param ry the vertical radius for circle - */ -void lv_vector_path_append_circle(lv_vector_path_t * path, const lv_fpoint_t * c, float rx, float ry); - -/** - * Add a arc to the path - * @param path pointer to a path - * @param c pointer to a `lv_fpoint_t` variable for center of the circle - * @param radius the radius for arc - * @param start_angle the start angle for arc - * @param sweep the sweep angle for arc, could be negative - * @param pie true: draw a pie, false: draw a arc - */ -void lv_vector_path_append_arc(lv_vector_path_t * path, const lv_fpoint_t * c, float radius, float start_angle, - float sweep, bool pie); - -/** - * Add an sub path to the path - * @param path pointer to a path - * @param subpath pointer to another path which will be added - */ -void lv_vector_path_append_path(lv_vector_path_t * path, const lv_vector_path_t * subpath); - -/** - * Create a vector graphic descriptor - * @param layer pointer to a layer - * @return pointer to the created descriptor - */ -lv_vector_dsc_t * lv_vector_dsc_create(lv_layer_t * layer); - -/** - * Delete the vector graphic descriptor - * @param dsc pointer to a vector graphic descriptor - */ -void lv_vector_dsc_delete(lv_vector_dsc_t * dsc); - -/** - * Set a matrix to current transformation matrix - * @param dsc pointer to a vector graphic descriptor - * @param matrix pointer to a matrix - */ -void lv_vector_dsc_set_transform(lv_vector_dsc_t * dsc, const lv_matrix_t * matrix); - -/** - * Set blend mode for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param blend the blend mode to be set in `lv_vector_blend_t` - */ -void lv_vector_dsc_set_blend_mode(lv_vector_dsc_t * dsc, lv_vector_blend_t blend); - -/** - * Set fill color for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param color the color to be set in lv_color32_t format - */ -void lv_vector_dsc_set_fill_color32(lv_vector_dsc_t * dsc, lv_color32_t color); - -/** - * Set fill color for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param color the color to be set in lv_color_t format - */ -void lv_vector_dsc_set_fill_color(lv_vector_dsc_t * dsc, lv_color_t color); - -/** - * Set fill opacity for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param opa the opacity to be set in lv_opa_t format - */ -void lv_vector_dsc_set_fill_opa(lv_vector_dsc_t * dsc, lv_opa_t opa); - -/** - * Set fill rule for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param rule the fill rule to be set in lv_vector_fill_t format - */ -void lv_vector_dsc_set_fill_rule(lv_vector_dsc_t * dsc, lv_vector_fill_t rule); - -/** - * Set fill image for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param img_dsc pointer to a `lv_draw_image_dsc_t` variable - */ -void lv_vector_dsc_set_fill_image(lv_vector_dsc_t * dsc, const lv_draw_image_dsc_t * img_dsc); - -/** - * Set fill linear gradient for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param x1 the x for start point - * @param y1 the y for start point - * @param x2 the x for end point - * @param y2 the y for end point - */ -void lv_vector_dsc_set_fill_linear_gradient(lv_vector_dsc_t * dsc, float x1, float y1, float x2, float y2); - -/** - - * Set fill radial gradient radius for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param cx the x for center of the circle - * @param cy the y for center of the circle - * @param radius the radius for circle - */ -void lv_vector_dsc_set_fill_radial_gradient(lv_vector_dsc_t * dsc, float cx, float cy, float radius); - -/** - * Set fill radial gradient spread for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param spread the gradient spread to be set in lv_vector_gradient_spread_t format - */ -void lv_vector_dsc_set_fill_gradient_spread(lv_vector_dsc_t * dsc, lv_vector_gradient_spread_t spread); - -/** - * Set fill gradient color stops for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param stops an array of `lv_gradient_stop_t` variables - * @param count the number of stops in the array, range: 0..LV_GRADIENT_MAX_STOPS - */ -void lv_vector_dsc_set_fill_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_gradient_stop_t * stops, - uint16_t count); - -/** - * Set a matrix to current fill transformation matrix - * @param dsc pointer to a vector graphic descriptor - * @param matrix pointer to a matrix - */ -void lv_vector_dsc_set_fill_transform(lv_vector_dsc_t * dsc, const lv_matrix_t * matrix); - -/** - * Set stroke color for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param color the color to be set in lv_color32_t format - */ -void lv_vector_dsc_set_stroke_color32(lv_vector_dsc_t * dsc, lv_color32_t color); - -/** - * Set stroke color for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param color the color to be set in lv_color_t format - */ -void lv_vector_dsc_set_stroke_color(lv_vector_dsc_t * dsc, lv_color_t color); - -/** - * Set stroke opacity for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param opa the opacity to be set in lv_opa_t format - */ -void lv_vector_dsc_set_stroke_opa(lv_vector_dsc_t * dsc, lv_opa_t opa); - -/** - * Set stroke line width for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param width the stroke line width - */ -void lv_vector_dsc_set_stroke_width(lv_vector_dsc_t * dsc, float width); - -/** - * Set stroke line dash pattern for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param dash_pattern an array of values that specify the segments of dash line - * @param dash_count the length of dash pattern array - */ -void lv_vector_dsc_set_stroke_dash(lv_vector_dsc_t * dsc, float * dash_pattern, uint16_t dash_count); - -/** - * Set stroke line cap style for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param cap the line cap to be set in lv_vector_stroke_cap_t format - */ -void lv_vector_dsc_set_stroke_cap(lv_vector_dsc_t * dsc, lv_vector_stroke_cap_t cap); - -/** - * Set stroke line join style for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param join the line join to be set in lv_vector_stroke_join_t format - */ -void lv_vector_dsc_set_stroke_join(lv_vector_dsc_t * dsc, lv_vector_stroke_join_t join); - -/** - * Set stroke miter limit for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param miter_limit the stroke miter_limit - */ -void lv_vector_dsc_set_stroke_miter_limit(lv_vector_dsc_t * dsc, uint16_t miter_limit); - -/** - * Set stroke linear gradient for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param x1 the x for start point - * @param y1 the y for start point - * @param x2 the x for end point - * @param y2 the y for end point - */ -void lv_vector_dsc_set_stroke_linear_gradient(lv_vector_dsc_t * dsc, float x1, float y1, float x2, float y2); -/** - * Set stroke radial gradient for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param cx the x for center of the circle - * @param cy the y for center of the circle - * @param radius the radius for circle - */ -void lv_vector_dsc_set_stroke_radial_gradient(lv_vector_dsc_t * dsc, float cx, float cy, float radius); - -/** - * Set stroke color stops for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param spread the gradient spread to be set in lv_vector_gradient_spread_t format - */ -void lv_vector_dsc_set_stroke_gradient_spread(lv_vector_dsc_t * dsc, lv_vector_gradient_spread_t spread); - -/** - * Set stroke color stops for descriptor - * @param dsc pointer to a vector graphic descriptor - * @param stops an array of `lv_gradient_stop_t` variables - * @param count the number of stops in the array - */ -void lv_vector_dsc_set_stroke_gradient_color_stops(lv_vector_dsc_t * dsc, const lv_gradient_stop_t * stops, - uint16_t count); - -/** - * Set a matrix to current stroke transformation matrix - * @param dsc pointer to a vector graphic descriptor - * @param matrix pointer to a matrix - */ -void lv_vector_dsc_set_stroke_transform(lv_vector_dsc_t * dsc, const lv_matrix_t * matrix); - -/** - * Set current transformation matrix to identity matrix - * @param dsc pointer to a vector graphic descriptor - */ -void lv_vector_dsc_identity(lv_vector_dsc_t * dsc); - -/** - * Change the scale factor of current transformation matrix - * @param dsc pointer to a vector graphic descriptor - * @param scale_x the scale factor for the X direction - * @param scale_y the scale factor for the Y direction - */ -void lv_vector_dsc_scale(lv_vector_dsc_t * dsc, float scale_x, float scale_y); - -/** - * Rotate current transformation matrix with origin - * @param dsc pointer to a vector graphic descriptor - * @param degree angle to rotate - */ -void lv_vector_dsc_rotate(lv_vector_dsc_t * dsc, float degree); - -/** - * Translate current transformation matrix to new position - * @param dsc pointer to a vector graphic descriptor - * @param tx the amount of translate in x direction - * @param tx the amount of translate in y direction - */ -void lv_vector_dsc_translate(lv_vector_dsc_t * dsc, float tx, float ty); - -/** - * Change the skew factor of current transformation matrix - * @param dsc pointer to a vector graphic descriptor - * @param skew_x the skew factor for x direction - * @param skew_y the skew factor for y direction - */ -void lv_vector_dsc_skew(lv_vector_dsc_t * dsc, float skew_x, float skew_y); - -/** - * Add a graphic path to the draw list - * @param dsc pointer to a vector graphic descriptor - * @param path pointer to a path - */ -void lv_vector_dsc_add_path(lv_vector_dsc_t * dsc, const lv_vector_path_t * path); - -/** - * Clear a rectangle area use current fill color - * @param dsc pointer to a vector graphic descriptor - * @param rect the area to clear in the buffer - */ -void lv_vector_clear_area(lv_vector_dsc_t * dsc, const lv_area_t * rect); - -/** - * Draw all the vector graphic paths - * @param dsc pointer to a vector graphic descriptor - */ -void lv_draw_vector(lv_vector_dsc_t * dsc); - -/* Traverser for task list */ -typedef void (*vector_draw_task_cb)(void * ctx, const lv_vector_path_t * path, const lv_vector_draw_dsc_t * dsc); - -#endif /* LV_USE_VECTOR_GRAPHIC */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_DRAW_VECTOR_H */ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_vector_private.h b/L3_Middlewares/LVGL/src/draw/lv_draw_vector_private.h deleted file mode 100644 index 5257a30..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_vector_private.h +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @file lv_draw_vector_private.h - * - */ - -#ifndef LV_DRAW_VECTOR_PRIVATE_H -#define LV_DRAW_VECTOR_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_vector.h" - -#if LV_USE_VECTOR_GRAPHIC - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_vector_path_t { - lv_vector_path_quality_t quality; - lv_array_t ops; - lv_array_t points; -}; - -struct lv_vector_gradient_t { - lv_vector_gradient_style_t style; - lv_gradient_stop_t stops[LV_GRADIENT_MAX_STOPS]; /**< A gradient stop array */ - uint16_t stops_count; /**< The number of used stops in the array */ - float x1; - float y1; - float x2; - float y2; - float cx; - float cy; - float cr; - lv_vector_gradient_spread_t spread; -}; - -struct lv_vector_fill_dsc_t { - lv_vector_draw_style_t style; - lv_color32_t color; - lv_opa_t opa; - lv_vector_fill_t fill_rule; - lv_draw_image_dsc_t img_dsc; - lv_vector_gradient_t gradient; - lv_matrix_t matrix; -}; - -struct lv_vector_stroke_dsc_t { - lv_vector_draw_style_t style; - lv_color32_t color; - lv_opa_t opa; - float width; - lv_array_t dash_pattern; - lv_vector_stroke_cap_t cap; - lv_vector_stroke_join_t join; - uint16_t miter_limit; - lv_vector_gradient_t gradient; - lv_matrix_t matrix; -}; - -struct lv_vector_draw_dsc_t { - lv_vector_fill_dsc_t fill_dsc; - lv_vector_stroke_dsc_t stroke_dsc; - lv_matrix_t matrix; - lv_vector_blend_t blend_mode; - lv_area_t scissor_area; -}; - -struct lv_draw_vector_task_dsc_t { - lv_draw_dsc_base_t base; - lv_ll_t * task_list; /*draw task list.*/ -}; - -struct lv_vector_dsc_t { - lv_layer_t * layer; - lv_vector_draw_dsc_t current_dsc; - /* private data */ - lv_draw_vector_task_dsc_t tasks; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_vector_for_each_destroy_tasks(lv_ll_t * task_list, vector_draw_task_cb cb, void * data); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_VECTOR_GRAPHIC */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_VECTOR_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_image_decoder.c b/L3_Middlewares/LVGL/src/draw/lv_image_decoder.c deleted file mode 100644 index 90934c1..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_image_decoder.c +++ /dev/null @@ -1,415 +0,0 @@ -/** - * @file lv_image_decoder.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_image_decoder_private.h" -#include "../misc/lv_assert.h" -#include "../draw/lv_draw_image.h" -#include "../misc/lv_ll.h" -#include "../stdlib/lv_string.h" -#include "../core/lv_global.h" - -/********************* - * DEFINES - *********************/ -#define img_decoder_ll_p &(LV_GLOBAL_DEFAULT()->img_decoder_ll) -#define img_cache_p (LV_GLOBAL_DEFAULT()->img_cache) -#define img_header_cache_p (LV_GLOBAL_DEFAULT()->img_header_cache) -#define image_cache_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->image_cache_draw_buf_handlers) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static uint32_t img_width_to_stride(lv_image_header_t * header); - -/** - * Get the header info of an image source, and return the a pointer to the decoder that can open it. - * @param dsc Image descriptor containing the source and type of the image and other info. - * @param header The header of the image - * @return The decoder that can open the image source or NULL if not found (or can't open it). - */ -static lv_image_decoder_t * image_decoder_get_info(lv_image_decoder_dsc_t * dsc, lv_image_header_t * header); - -static lv_result_t try_cache(lv_image_decoder_dsc_t * dsc); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Initialize the image decoder module - */ -void lv_image_decoder_init(uint32_t image_cache_size, uint32_t image_header_count) -{ - lv_ll_init(img_decoder_ll_p, sizeof(lv_image_decoder_t)); - - /*Initialize the cache*/ - lv_image_cache_init(image_cache_size); - lv_image_header_cache_init(image_header_count); -} - -/** - * Deinitialize the image decoder module - */ -void lv_image_decoder_deinit(void) -{ - lv_cache_destroy(img_cache_p, NULL); - lv_cache_destroy(img_header_cache_p, NULL); - - lv_ll_clear(img_decoder_ll_p); -} - -lv_result_t lv_image_decoder_get_info(const void * src, lv_image_header_t * header) -{ - lv_image_decoder_dsc_t dsc; - lv_memzero(&dsc, sizeof(lv_image_decoder_dsc_t)); - dsc.src = src; - dsc.src_type = lv_image_src_get_type(src); - - lv_image_decoder_t * decoder = image_decoder_get_info(&dsc, header); - if(decoder == NULL) return LV_RESULT_INVALID; - - return LV_RESULT_OK; -} - -lv_result_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, const lv_image_decoder_args_t * args) -{ - lv_memzero(dsc, sizeof(lv_image_decoder_dsc_t)); - - if(src == NULL) return LV_RESULT_INVALID; - dsc->src = src; - dsc->src_type = lv_image_src_get_type(src); - - if(lv_image_cache_is_enabled()) { - dsc->cache = img_cache_p; - /*Try cache first, unless we are told to ignore cache.*/ - if(!(args && args->no_cache)) { - /* - * Check the cache first - * If the image is found in the cache, just return it.*/ - if(try_cache(dsc) == LV_RESULT_OK) return LV_RESULT_OK; - } - } - - /*Find the decoder that can open the image source, and get the header info in the same time.*/ - dsc->decoder = image_decoder_get_info(dsc, &dsc->header); - if(dsc->decoder == NULL) return LV_RESULT_INVALID; - - /*Make a copy of args*/ - dsc->args = args ? *args : (lv_image_decoder_args_t) { - .stride_align = LV_DRAW_BUF_STRIDE_ALIGN != 1, - .premultiply = false, - .no_cache = false, - .use_indexed = false, - .flush_cache = false, - }; - - /* - * We assume that if a decoder can get the info, it can open the image. - * If decoder open failed, free the source and return error. - * If decoder open succeed, add the image to cache if enabled. - * */ - lv_result_t res = dsc->decoder->open_cb(dsc->decoder, dsc); - - /* Flush the D-Cache if enabled and the image was successfully opened */ - if(dsc->args.flush_cache && res == LV_RESULT_OK && dsc->decoded != NULL) { - lv_draw_buf_flush_cache(dsc->decoded, NULL); - LV_LOG_INFO("Flushed D-cache: src %p (%s) (W%d x H%d, data: %p cf: %d)", - src, - dsc->src_type == LV_IMAGE_SRC_FILE ? (const char *)src : "c-array", - dsc->decoded->header.w, - dsc->decoded->header.h, - (void *)dsc->decoded->data, - dsc->decoded->header.cf); - } - - return res; -} - -lv_result_t lv_image_decoder_get_area(lv_image_decoder_dsc_t * dsc, const lv_area_t * full_area, - lv_area_t * decoded_area) -{ - lv_result_t res = LV_RESULT_INVALID; - if(dsc->decoder->get_area_cb) res = dsc->decoder->get_area_cb(dsc->decoder, dsc, full_area, decoded_area); - - return res; -} - -void lv_image_decoder_close(lv_image_decoder_dsc_t * dsc) -{ - if(dsc->decoder) { - if(dsc->decoder->close_cb) dsc->decoder->close_cb(dsc->decoder, dsc); - - if(lv_image_cache_is_enabled() && dsc->cache && dsc->cache_entry) { - /*Decoded data is in cache, release it from cache's callback*/ - lv_cache_release(dsc->cache, dsc->cache_entry, NULL); - } - } -} - -/** - * Create a new image decoder - * @return pointer to the new image decoder - */ -lv_image_decoder_t * lv_image_decoder_create(void) -{ - lv_image_decoder_t * decoder; - decoder = lv_ll_ins_head(img_decoder_ll_p); - LV_ASSERT_MALLOC(decoder); - if(decoder == NULL) return NULL; - - lv_memzero(decoder, sizeof(lv_image_decoder_t)); - - return decoder; -} - -void lv_image_decoder_delete(lv_image_decoder_t * decoder) -{ - lv_ll_remove(img_decoder_ll_p, decoder); - lv_free(decoder); -} - -lv_image_decoder_t * lv_image_decoder_get_next(lv_image_decoder_t * decoder) -{ - if(decoder == NULL) - return lv_ll_get_head(img_decoder_ll_p); - else - return lv_ll_get_next(img_decoder_ll_p, decoder); -} - -void lv_image_decoder_set_info_cb(lv_image_decoder_t * decoder, lv_image_decoder_info_f_t info_cb) -{ - decoder->info_cb = info_cb; -} - -void lv_image_decoder_set_open_cb(lv_image_decoder_t * decoder, lv_image_decoder_open_f_t open_cb) -{ - decoder->open_cb = open_cb; -} - -void lv_image_decoder_set_get_area_cb(lv_image_decoder_t * decoder, lv_image_decoder_get_area_cb_t get_area_cb) -{ - decoder->get_area_cb = get_area_cb; -} - -void lv_image_decoder_set_close_cb(lv_image_decoder_t * decoder, lv_image_decoder_close_f_t close_cb) -{ - decoder->close_cb = close_cb; -} - -lv_cache_entry_t * lv_image_decoder_add_to_cache(lv_image_decoder_t * decoder, - lv_image_cache_data_t * search_key, - const lv_draw_buf_t * decoded, void * user_data) -{ - lv_cache_entry_t * cache_entry = lv_cache_add(img_cache_p, search_key, NULL); - if(cache_entry == NULL) { - return NULL; - } - - lv_image_cache_data_t * cached_data; - cached_data = lv_cache_entry_get_data(cache_entry); - - /*Set the cache entry to decoder data*/ - cached_data->decoded = decoded; - if(cached_data->src_type == LV_IMAGE_SRC_FILE) { - cached_data->src = lv_strdup(cached_data->src); - } - cached_data->user_data = user_data; /*Need to free data on cache invalidate instead of decoder_close*/ - cached_data->decoder = decoder; - - return cache_entry; -} - -lv_draw_buf_t * lv_image_decoder_post_process(lv_image_decoder_dsc_t * dsc, lv_draw_buf_t * decoded) -{ - if(decoded == NULL) return NULL; /*No need to adjust*/ - - lv_image_decoder_args_t * args = &dsc->args; - if(args->stride_align && decoded->header.cf != LV_COLOR_FORMAT_RGB565A8) { - uint32_t stride_expect = lv_draw_buf_width_to_stride(decoded->header.w, decoded->header.cf); - if(decoded->header.stride != stride_expect) { - LV_LOG_TRACE("Stride mismatch"); - lv_result_t res = lv_draw_buf_adjust_stride(decoded, stride_expect); - if(res != LV_RESULT_OK) { - lv_draw_buf_t * aligned = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, decoded->header.w, decoded->header.h, - decoded->header.cf, stride_expect); - if(aligned == NULL) { - LV_LOG_ERROR("No memory for Stride adjust."); - return NULL; - } - - lv_draw_buf_copy(aligned, NULL, decoded, NULL); - decoded = aligned; - } - } - } - - /*Premultiply alpha channel*/ - if(args->premultiply - && !LV_COLOR_FORMAT_IS_ALPHA_ONLY(decoded->header.cf) - && lv_color_format_has_alpha(decoded->header.cf) - && !lv_draw_buf_has_flag(decoded, LV_IMAGE_FLAGS_PREMULTIPLIED) /*Hasn't done yet*/ - ) { - LV_LOG_TRACE("Alpha premultiply."); - if(lv_draw_buf_has_flag(decoded, LV_IMAGE_FLAGS_MODIFIABLE)) { - /*Do it directly*/ - lv_draw_buf_premultiply(decoded); - } - else { - decoded = lv_draw_buf_dup_ex(image_cache_draw_buf_handlers, decoded); - if(decoded == NULL) { - LV_LOG_ERROR("No memory for premultiplying."); - return NULL; - } - - lv_draw_buf_premultiply(decoded); - } - } - - return decoded; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static lv_image_decoder_t * image_decoder_get_info(lv_image_decoder_dsc_t * dsc, lv_image_header_t * header) -{ - lv_memzero(header, sizeof(lv_image_header_t)); - - const void * src = dsc->src; - lv_image_src_t src_type = dsc->src_type; - - if(src_type == LV_IMAGE_SRC_VARIABLE) { - const lv_image_dsc_t * img_dsc = src; - if(img_dsc->data == NULL) return NULL; - } - - if(src_type == LV_IMAGE_SRC_FILE) LV_LOG_TRACE("Try to find decoder for %s", (const char *)src); - else LV_LOG_TRACE("Try to find decoder for %p", src); - - lv_image_decoder_t * decoder; - bool is_header_cache_enabled = lv_image_header_cache_is_enabled(); - - if(is_header_cache_enabled && src_type == LV_IMAGE_SRC_FILE) { - lv_image_header_cache_data_t search_key; - search_key.src_type = src_type; - search_key.src = src; - - lv_cache_entry_t * entry = lv_cache_acquire(img_header_cache_p, &search_key, NULL); - - if(entry) { - lv_image_header_cache_data_t * cached_data = lv_cache_entry_get_data(entry); - *header = cached_data->header; - decoder = cached_data->decoder; - lv_cache_release(img_header_cache_p, entry, NULL); - - LV_LOG_TRACE("Found decoder %s in header cache", decoder->name); - return decoder; - } - } - - if(src_type == LV_IMAGE_SRC_FILE) { - lv_fs_res_t fs_res = lv_fs_open(&dsc->file, src, LV_FS_MODE_RD); - if(fs_res != LV_FS_RES_OK) { - LV_LOG_ERROR("File open failed: %" LV_PRIu32, (uint32_t)fs_res); - return NULL; - } - } - - /*Search the decoders*/ - lv_image_decoder_t * decoder_prev = NULL; - LV_LL_READ(img_decoder_ll_p, decoder) { - /*Info and Open callbacks are required*/ - if(decoder->info_cb && decoder->open_cb) { - lv_fs_seek(&dsc->file, 0, LV_FS_SEEK_SET); - lv_result_t res = decoder->info_cb(decoder, dsc, header); - - if(decoder_prev) LV_LOG_TRACE("Can't open image with decoder %s. Trying next decoder.", decoder_prev->name); - - if(res == LV_RESULT_OK) { - if(header->stride == 0) { - LV_LOG_INFO("Image decoder didn't set stride. Calculate it from width."); - header->stride = img_width_to_stride(header); - } - break; - } - - decoder_prev = decoder; - } - } - - if(decoder == NULL) LV_LOG_TRACE("No decoder found"); - else LV_LOG_TRACE("Found decoder %s", decoder->name); - - if(src_type == LV_IMAGE_SRC_FILE) { - lv_fs_close(&dsc->file); - } - - if(is_header_cache_enabled && src_type == LV_IMAGE_SRC_FILE && decoder) { - lv_cache_entry_t * entry; - lv_image_header_cache_data_t search_key; - search_key.src_type = src_type; - search_key.src = lv_strdup(src); - search_key.decoder = decoder; - search_key.header = *header; - entry = lv_cache_add(img_header_cache_p, &search_key, NULL); - - if(entry == NULL) { - if(src_type == LV_IMAGE_SRC_FILE) lv_free((void *)search_key.src); - return NULL; - } - - lv_cache_release(img_header_cache_p, entry, NULL); - } - - return decoder; -} - -static uint32_t img_width_to_stride(lv_image_header_t * header) -{ - if(header->cf == LV_COLOR_FORMAT_RGB565A8) { - return header->w * 2; - } - else { - return ((uint32_t)header->w * lv_color_format_get_bpp(header->cf) + 7) >> 3; - } -} - -static lv_result_t try_cache(lv_image_decoder_dsc_t * dsc) -{ - lv_cache_t * cache = dsc->cache; - - lv_image_cache_data_t search_key; - search_key.src_type = dsc->src_type; - search_key.src = dsc->src; - - lv_cache_entry_t * entry = lv_cache_acquire(cache, &search_key, NULL); - - if(entry) { - lv_image_cache_data_t * cached_data = lv_cache_entry_get_data(entry); - dsc->decoded = cached_data->decoded; - dsc->decoder = (lv_image_decoder_t *)cached_data->decoder; - dsc->cache_entry = entry; /*Save the cache to release it in decoder_close*/ - return LV_RESULT_OK; - } - - return LV_RESULT_INVALID; -} diff --git a/L3_Middlewares/LVGL/src/draw/lv_image_decoder.h b/L3_Middlewares/LVGL/src/draw/lv_image_decoder.h deleted file mode 100644 index e898edc..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_image_decoder.h +++ /dev/null @@ -1,194 +0,0 @@ -/** - * @file lv_image_decoder.h - * - */ - -#ifndef LV_IMAGE_DECODER_H -#define LV_IMAGE_DECODER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_conf_internal.h" - -#include "lv_draw_buf.h" -#include "../misc/lv_fs.h" -#include "../misc/lv_types.h" -#include "../misc/lv_area.h" -#include "../misc/cache/lv_cache.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * Source of image.*/ -typedef enum { - LV_IMAGE_SRC_VARIABLE, /** Binary/C variable*/ - LV_IMAGE_SRC_FILE, /** File in filesystem*/ - LV_IMAGE_SRC_SYMBOL, /** Symbol (@ref lv_symbol_def.h)*/ - LV_IMAGE_SRC_UNKNOWN, /** Unknown source*/ -} lv_image_src_t; - -/** - * Get info from an image and store in the `header` - * @param decoder pointer to decoder object - * @param dsc pointer to decoder descriptor - * @param header store the info here - * @return LV_RESULT_OK: info written correctly; LV_RESULT_INVALID: failed - */ -typedef lv_result_t (*lv_image_decoder_info_f_t)(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, - lv_image_header_t * header); - -/** - * Open an image for decoding. Prepare it as it is required to read it later - * @param decoder pointer to the decoder the function associated with - * @param dsc pointer to decoder descriptor. `src`, `color` are already initialized in it. - */ -typedef lv_result_t (*lv_image_decoder_open_f_t)(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); - -/** - * Decode `full_area` pixels incrementally by calling in a loop. Set `decoded_area` values to `LV_COORD_MIN` on first call. - * Required only if the "open" function can't return with the whole decoded pixel array. - * @param decoder pointer to the decoder the function associated with - * @param dsc pointer to decoder descriptor - * @param full_area input parameter. the full area to decode after enough subsequent calls - * @param decoded_area input+output parameter. set the values to `LV_COORD_MIN` for the first call and to reset decoding. - * the decoded area is stored here after each call. - * @return LV_RESULT_OK: ok; LV_RESULT_INVALID: failed or there is nothing left to decode - */ -typedef lv_result_t (*lv_image_decoder_get_area_cb_t)(lv_image_decoder_t * decoder, - lv_image_decoder_dsc_t * dsc, - const lv_area_t * full_area, lv_area_t * decoded_area); - -/** - * Close the pending decoding. Free resources etc. - * @param decoder pointer to the decoder the function associated with - * @param dsc pointer to decoder descriptor - */ -typedef void (*lv_image_decoder_close_f_t)(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Get information about an image. - * Try the created image decoder one by one. Once one is able to get info that info will be used. - * @param src the image source. Can be - * 1) File name: E.g. "S:folder/img1.png" (The drivers needs to registered via `lv_fs_drv_register()`) - * 2) Variable: Pointer to an `lv_image_dsc_t` variable - * 3) Symbol: E.g. `LV_SYMBOL_OK` - * @param header the image info will be stored here - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: wasn't able to get info about the image - */ -lv_result_t lv_image_decoder_get_info(const void * src, lv_image_header_t * header); - -/** - * Open an image. - * Try the created image decoders one by one. Once one is able to open the image that decoder is saved in `dsc` - * @param dsc describes a decoding session. Simply a pointer to an `lv_image_decoder_dsc_t` variable. - * @param src the image source. Can be - * 1) File name: E.g. "S:folder/img1.png" (The drivers needs to registered via `lv_fs_drv_register())`) - * 2) Variable: Pointer to an `lv_image_dsc_t` variable - * 3) Symbol: E.g. `LV_SYMBOL_OK` - * @param args args about how the image should be opened. - * @return LV_RESULT_OK: opened the image. `dsc->decoded` and `dsc->header` are set. - * LV_RESULT_INVALID: none of the registered image decoders were able to open the image. - */ -lv_result_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, const lv_image_decoder_args_t * args); - -/** - * Decode `full_area` pixels incrementally by calling in a loop. Set `decoded_area` to `LV_COORD_MIN` on first call. - * @param dsc image decoder descriptor - * @param full_area input parameter. the full area to decode after enough subsequent calls - * @param decoded_area input+output parameter. set the values to `LV_COORD_MIN` for the first call and to reset decoding. - * the decoded area is stored here after each call. - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: an error occurred or there is nothing left to decode - */ -lv_result_t lv_image_decoder_get_area(lv_image_decoder_dsc_t * dsc, const lv_area_t * full_area, - lv_area_t * decoded_area); - -/** - * Close a decoding session - * @param dsc pointer to `lv_image_decoder_dsc_t` used in `lv_image_decoder_open` - */ -void lv_image_decoder_close(lv_image_decoder_dsc_t * dsc); - -/** - * Create a new image decoder - * @return pointer to the new image decoder - */ -lv_image_decoder_t * lv_image_decoder_create(void); - -/** - * Delete an image decoder - * @param decoder pointer to an image decoder - */ -void lv_image_decoder_delete(lv_image_decoder_t * decoder); - -/** - * Get the next image decoder in the linked list of image decoders - * @param decoder pointer to an image decoder or NULL to get the first one - * @return the next image decoder or NULL if no more image decoder exists - */ -lv_image_decoder_t * lv_image_decoder_get_next(lv_image_decoder_t * decoder); - -/** - * Set a callback to get information about the image - * @param decoder pointer to an image decoder - * @param info_cb a function to collect info about an image (fill an `lv_image_header_t` struct) - */ -void lv_image_decoder_set_info_cb(lv_image_decoder_t * decoder, lv_image_decoder_info_f_t info_cb); - -/** - * Set a callback to open an image - * @param decoder pointer to an image decoder - * @param open_cb a function to open an image - */ -void lv_image_decoder_set_open_cb(lv_image_decoder_t * decoder, lv_image_decoder_open_f_t open_cb); - -/** - * Set a callback to a decoded line of an image - * @param decoder pointer to an image decoder - * @param read_line_cb a function to read a line of an image - */ -void lv_image_decoder_set_get_area_cb(lv_image_decoder_t * decoder, lv_image_decoder_get_area_cb_t read_line_cb); - -/** - * Set a callback to close a decoding session. E.g. close files and free other resources. - * @param decoder pointer to an image decoder - * @param close_cb a function to close a decoding session - */ -void lv_image_decoder_set_close_cb(lv_image_decoder_t * decoder, lv_image_decoder_close_f_t close_cb); - -lv_cache_entry_t * lv_image_decoder_add_to_cache(lv_image_decoder_t * decoder, - lv_image_cache_data_t * search_key, - const lv_draw_buf_t * decoded, void * user_data); - -/** - * Check the decoded image, make any modification if decoder `args` requires. - * @note A new draw buf will be allocated if provided `decoded` is not modifiable or stride mismatch etc. - * @param dsc pointer to a decoder descriptor - * @param decoded pointer to a decoded image to post process to meet dsc->args requirement. - * @return post processed draw buffer, when it differs with `decoded`, it's newly allocated. - */ -lv_draw_buf_t * lv_image_decoder_post_process(lv_image_decoder_dsc_t * dsc, lv_draw_buf_t * decoded); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_IMAGE_DECODER_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_image_decoder_private.h b/L3_Middlewares/LVGL/src/draw/lv_image_decoder_private.h deleted file mode 100644 index 27ef261..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_image_decoder_private.h +++ /dev/null @@ -1,142 +0,0 @@ -/** - * @file lv_image_decoder_private.h - * - */ - -#ifndef LV_IMAGE_DECODER_PRIVATE_H -#define LV_IMAGE_DECODER_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_image_decoder.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * Image decoder args. - * It determines how to decoder an image, e.g. whether to premultiply the alpha or not. - * It should be passed to lv_img_decoder_open() function. If NULL is provided, default - * args are used. - * - * Default args: - * all field are zero or false. - */ -struct lv_image_decoder_args_t { - bool stride_align; /**< Whether stride should be aligned */ - bool premultiply; /**< Whether image should be premultiplied or not after decoding */ - bool no_cache; /**< When set, decoded image won't be put to cache, and decoder open will also ignore cache. */ - bool use_indexed; /**< Decoded indexed image as is. Convert to ARGB8888 if false. */ - bool flush_cache; /**< Whether to flush the data cache after decoding */ -}; - -struct lv_image_decoder_t { - lv_image_decoder_info_f_t info_cb; - lv_image_decoder_open_f_t open_cb; - lv_image_decoder_get_area_cb_t get_area_cb; - lv_image_decoder_close_f_t close_cb; - - const char * name; - - void * user_data; -}; - -struct lv_image_cache_data_t { - lv_cache_slot_size_t slot; - - const void * src; - lv_image_src_t src_type; - - const lv_draw_buf_t * decoded; - const lv_image_decoder_t * decoder; - void * user_data; -}; - -struct lv_image_header_cache_data_t { - const void * src; - lv_image_src_t src_type; - - lv_image_header_t header; - lv_image_decoder_t * decoder; -}; - -/**Describe an image decoding session. Stores data about the decoding*/ -struct lv_image_decoder_dsc_t { - /**The decoder which was able to open the image source*/ - lv_image_decoder_t * decoder; - - /**A copy of parameters of how this image is decoded*/ - lv_image_decoder_args_t args; - - /**The image source. A file path like "S:my_img.png" or pointer to an `lv_image_dsc_t` variable*/ - const void * src; - - /**Type of the source: file or variable. Can be set in `open` function if required*/ - lv_image_src_t src_type; - - lv_fs_file_t file; - - /**Info about the opened image: color format, size, etc. MUST be set in `open` function*/ - lv_image_header_t header; - - /** Pointer to a draw buffer where the image's data (pixels) are stored in a decoded, plain format. - * MUST be set in `open` or `get_area_cb`function*/ - const lv_draw_buf_t * decoded; - - const lv_color32_t * palette; - uint32_t palette_size; - - /** How much time did it take to open the image. [ms] - * If not set `lv_image_cache` will measure and set the time to open*/ - uint32_t time_to_open; - - /**A text to display instead of the image when the image can't be opened. - * Can be set in `open` function or set NULL.*/ - const char * error_msg; - - lv_cache_t * cache; - - /**Point to cache entry information*/ - lv_cache_entry_t * cache_entry; - - /**Store any custom data here is required*/ - void * user_data; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize the image decoder module - * @param image_cache_size Image cache size in bytes. 0 to disable cache. - * @param image_header_count Number of header cache entries. 0 to disable header cache. - */ -void lv_image_decoder_init(uint32_t image_cache_size, uint32_t image_header_count); - -/** - * Deinitialize the image decoder module - */ -void lv_image_decoder_deinit(void); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_IMAGE_DECODER_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_image_dsc.h b/L3_Middlewares/LVGL/src/draw/lv_image_dsc.h deleted file mode 100644 index ecd5088..0000000 --- a/L3_Middlewares/LVGL/src/draw/lv_image_dsc.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - * @file lv_image_dsc.h - * - */ - -#ifndef LV_IMAGE_DSC_H -#define LV_IMAGE_DSC_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_conf_internal.h" - -/********************* - * DEFINES - *********************/ - -/** Magic number for lvgl image, 9 means lvgl version 9 - * It must be neither a valid ASCII character nor larger than 0x80. See `lv_image_src_get_type`. - */ -#define LV_IMAGE_HEADER_MAGIC (0x19) -LV_EXPORT_CONST_INT(LV_IMAGE_HEADER_MAGIC); - -/********************** - * TYPEDEFS - **********************/ - -typedef enum lv_image_flags_t { - /** - * For RGB map of the image data, mark if it's pre-multiplied with alpha. - * For indexed image, this bit indicated palette data is pre-multiplied with alpha. - */ - LV_IMAGE_FLAGS_PREMULTIPLIED = 0x0001, - /** - * The image data is compressed, so decoder needs to decode image firstly. - * If this flag is set, the whole image will be decompressed upon decode, and - * `get_area_cb` won't be necessary. - */ - LV_IMAGE_FLAGS_COMPRESSED = 0x0008, - - /*Below flags are applicable only for draw buffer header.*/ - - /** - * The image is allocated from heap, thus should be freed after use. - */ - LV_IMAGE_FLAGS_ALLOCATED = 0x0010, - - /** - * If the image data is malloced and can be processed in place. - * In image decoder post processing, this flag means we modify it in-place. - */ - LV_IMAGE_FLAGS_MODIFIABLE = 0x0020, - - /** - * Flags reserved for user, lvgl won't use these bits. - */ - LV_IMAGE_FLAGS_USER1 = 0x0100, - LV_IMAGE_FLAGS_USER2 = 0x0200, - LV_IMAGE_FLAGS_USER3 = 0x0400, - LV_IMAGE_FLAGS_USER4 = 0x0800, - LV_IMAGE_FLAGS_USER5 = 0x1000, - LV_IMAGE_FLAGS_USER6 = 0x2000, - LV_IMAGE_FLAGS_USER7 = 0x4000, - LV_IMAGE_FLAGS_USER8 = 0x8000, -} lv_image_flags_t; - -typedef enum { - LV_IMAGE_COMPRESS_NONE = 0, - LV_IMAGE_COMPRESS_RLE, /**< LVGL custom RLE compression */ - LV_IMAGE_COMPRESS_LZ4, -} lv_image_compress_t; - -#if LV_BIG_ENDIAN_SYSTEM -typedef struct { - uint32_t reserved_2: 16; /**< Reserved to be used later*/ - uint32_t stride: 16; /**< Number of bytes in a row*/ - uint32_t h: 16; - uint32_t w: 16; - uint32_t flags: 16; /**< Image flags, see `lv_image_flags_t`*/ - uint32_t cf : 8; /**< Color format: See `lv_color_format_t`*/ - uint32_t magic: 8; /**< Magic number. Must be LV_IMAGE_HEADER_MAGIC*/ -} lv_image_header_t; -#else -typedef struct { - uint32_t magic: 8; /**< Magic number. Must be LV_IMAGE_HEADER_MAGIC*/ - uint32_t cf : 8; /**< Color format: See `lv_color_format_t`*/ - uint32_t flags: 16; /**< Image flags, see `lv_image_flags_t`*/ - - uint32_t w: 16; - uint32_t h: 16; - uint32_t stride: 16; /**< Number of bytes in a row*/ - uint32_t reserved_2: 16; /**< Reserved to be used later*/ -} lv_image_header_t; -#endif - -typedef struct { - void * buf; - uint32_t stride; /**< Number of bytes in a row*/ -} lv_yuv_plane_t; - -typedef union { - lv_yuv_plane_t yuv; /**< packed format*/ - struct { - lv_yuv_plane_t y; - lv_yuv_plane_t u; - lv_yuv_plane_t v; - } planar; /**< planar format with 3 plane*/ - struct { - lv_yuv_plane_t y; - lv_yuv_plane_t uv; - } semi_planar; /**< planar format with 2 plane*/ -} lv_yuv_buf_t; - -/** - * Struct to describe a constant image resource. - * It's similar to lv_draw_buf_t, but the data is constant. - */ -typedef struct { - lv_image_header_t header; /**< A header describing the basics of the image*/ - uint32_t data_size; /**< Size of the image in bytes*/ - const uint8_t * data; /**< Pointer to the data of the image*/ - const void * reserved; /**< A reserved field to make it has same size as lv_draw_buf_t*/ -} lv_image_dsc_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_IMAGE_DSC_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_img_buf.c b/L3_Middlewares/LVGL/src/draw/lv_img_buf.c new file mode 100644 index 0000000..5ac1ead --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_img_buf.c @@ -0,0 +1,392 @@ +/** + * @file lv_img_buf.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include +#include +#include "lv_img_buf.h" +#include "lv_draw_img.h" +#include "../misc/lv_math.h" +#include "../misc/lv_log.h" +#include "../misc/lv_mem.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_color_t lv_img_buf_get_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t color) +{ + lv_color_t p_color = lv_color_black(); + uint8_t * buf_u8 = (uint8_t *)dsc->data; + + if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR || dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED || + dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA || dsc->header.cf == LV_IMG_CF_RGB565A8) { + uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3; + uint32_t px = dsc->header.w * y * px_size + x * px_size; + lv_memcpy_small(&p_color, &buf_u8[px], sizeof(lv_color_t)); +#if LV_COLOR_SIZE == 32 + p_color.ch.alpha = 0xFF; /*Only the color should be get so use a default alpha value*/ +#endif + } + else if(dsc->header.cf == LV_IMG_CF_INDEXED_1BIT) { + buf_u8 += 4 * 2; + uint8_t bit = x & 0x7; + x = x >> 3; + + /*Get the current pixel. + *dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 8, 16, 24 ...*/ + uint32_t px = ((dsc->header.w + 7) >> 3) * y + x; + p_color.full = (buf_u8[px] & (1 << (7 - bit))) >> (7 - bit); + } + else if(dsc->header.cf == LV_IMG_CF_INDEXED_2BIT) { + buf_u8 += 4 * 4; + uint8_t bit = (x & 0x3) * 2; + x = x >> 2; + + /*Get the current pixel. + *dsc->header.w + 3 means rounding up to 4 because the lines are byte aligned + *so the possible real width are 4, 8, 12 ...*/ + uint32_t px = ((dsc->header.w + 3) >> 2) * y + x; + p_color.full = (buf_u8[px] & (3 << (6 - bit))) >> (6 - bit); + } + else if(dsc->header.cf == LV_IMG_CF_INDEXED_4BIT) { + buf_u8 += 4 * 16; + uint8_t bit = (x & 0x1) * 4; + x = x >> 1; + + /*Get the current pixel. + *dsc->header.w + 1 means rounding up to 2 because the lines are byte aligned + *so the possible real width are 2, 4, 6 ...*/ + uint32_t px = ((dsc->header.w + 1) >> 1) * y + x; + p_color.full = (buf_u8[px] & (0xF << (4 - bit))) >> (4 - bit); + } + else if(dsc->header.cf == LV_IMG_CF_INDEXED_8BIT) { + buf_u8 += 4 * 256; + uint32_t px = dsc->header.w * y + x; + p_color.full = buf_u8[px]; + } + else if(dsc->header.cf == LV_IMG_CF_ALPHA_1BIT || dsc->header.cf == LV_IMG_CF_ALPHA_2BIT || + dsc->header.cf == LV_IMG_CF_ALPHA_4BIT || dsc->header.cf == LV_IMG_CF_ALPHA_8BIT) { + p_color = color; + } + return p_color; +} + +lv_opa_t lv_img_buf_get_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y) +{ + uint8_t * buf_u8 = (uint8_t *)dsc->data; + + if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA) { + uint32_t px = dsc->header.w * y * LV_IMG_PX_SIZE_ALPHA_BYTE + x * LV_IMG_PX_SIZE_ALPHA_BYTE; + return buf_u8[px + LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; + } + else if(dsc->header.cf == LV_IMG_CF_ALPHA_1BIT) { + uint8_t bit = x & 0x7; + x = x >> 3; + + /*Get the current pixel. + *dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 8 ,16, 24 ...*/ + uint32_t px = ((dsc->header.w + 7) >> 3) * y + x; + uint8_t px_opa = (buf_u8[px] & (1 << (7 - bit))) >> (7 - bit); + return px_opa ? LV_OPA_TRANSP : LV_OPA_COVER; + } + else if(dsc->header.cf == LV_IMG_CF_ALPHA_2BIT) { + const uint8_t opa_table[4] = {0, 85, 170, 255}; /*Opacity mapping with bpp = 2*/ + + uint8_t bit = (x & 0x3) * 2; + x = x >> 2; + + /*Get the current pixel. + *dsc->header.w + 4 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 4 ,8, 12 ...*/ + uint32_t px = ((dsc->header.w + 3) >> 2) * y + x; + uint8_t px_opa = (buf_u8[px] & (3 << (6 - bit))) >> (6 - bit); + return opa_table[px_opa]; + } + else if(dsc->header.cf == LV_IMG_CF_ALPHA_4BIT) { + const uint8_t opa_table[16] = {0, 17, 34, 51, /*Opacity mapping with bpp = 4*/ + 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255 + }; + + uint8_t bit = (x & 0x1) * 4; + x = x >> 1; + + /*Get the current pixel. + *dsc->header.w + 1 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 2 ,4, 6 ...*/ + uint32_t px = ((dsc->header.w + 1) >> 1) * y + x; + uint8_t px_opa = (buf_u8[px] & (0xF << (4 - bit))) >> (4 - bit); + return opa_table[px_opa]; + } + else if(dsc->header.cf == LV_IMG_CF_ALPHA_8BIT) { + uint32_t px = dsc->header.w * y + x; + return buf_u8[px]; + } + + return LV_OPA_COVER; +} + +void lv_img_buf_set_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa) +{ + uint8_t * buf_u8 = (uint8_t *)dsc->data; + + if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA) { + uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3; + uint32_t px = dsc->header.w * y * px_size + x * px_size; + buf_u8[px + px_size - 1] = opa; + } + else if(dsc->header.cf == LV_IMG_CF_ALPHA_1BIT) { + opa = opa >> 7; /*opa -> [0,1]*/ + uint8_t bit = x & 0x7; + x = x >> 3; + + /*Get the current pixel. + *dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 8 ,16, 24 ...*/ + uint32_t px = ((dsc->header.w + 7) >> 3) * y + x; + buf_u8[px] = buf_u8[px] & ~(1 << (7 - bit)); + buf_u8[px] = buf_u8[px] | ((opa & 0x1) << (7 - bit)); + } + else if(dsc->header.cf == LV_IMG_CF_ALPHA_2BIT) { + opa = opa >> 6; /*opa -> [0,3]*/ + uint8_t bit = (x & 0x3) * 2; + x = x >> 2; + + /*Get the current pixel. + *dsc->header.w + 4 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 4 ,8, 12 ...*/ + uint32_t px = ((dsc->header.w + 3) >> 2) * y + x; + buf_u8[px] = buf_u8[px] & ~(3 << (6 - bit)); + buf_u8[px] = buf_u8[px] | ((opa & 0x3) << (6 - bit)); + } + else if(dsc->header.cf == LV_IMG_CF_ALPHA_4BIT) { + opa = opa >> 4; /*opa -> [0,15]*/ + uint8_t bit = (x & 0x1) * 4; + x = x >> 1; + + /*Get the current pixel. + *dsc->header.w + 1 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 2 ,4, 6 ...*/ + uint32_t px = ((dsc->header.w + 1) >> 1) * y + x; + buf_u8[px] = buf_u8[px] & ~(0xF << (4 - bit)); + buf_u8[px] = buf_u8[px] | ((opa & 0xF) << (4 - bit)); + } + else if(dsc->header.cf == LV_IMG_CF_ALPHA_8BIT) { + uint32_t px = dsc->header.w * y + x; + buf_u8[px] = opa; + } +} + +void lv_img_buf_set_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t c) +{ + uint8_t * buf_u8 = (uint8_t *)dsc->data; + + if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR || dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { + uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3; + uint32_t px = dsc->header.w * y * px_size + x * px_size; + lv_memcpy_small(&buf_u8[px], &c, px_size); + } + else if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA) { + uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3; + uint32_t px = dsc->header.w * y * px_size + x * px_size; + lv_memcpy_small(&buf_u8[px], &c, px_size - 1); /*-1 to not overwrite the alpha value*/ + } + else if(dsc->header.cf == LV_IMG_CF_INDEXED_1BIT) { + buf_u8 += sizeof(lv_color32_t) * 2; /*Skip the palette*/ + + uint8_t bit = x & 0x7; + x = x >> 3; + + /*Get the current pixel. + *dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 8 ,16, 24 ...*/ + uint32_t px = ((dsc->header.w + 7) >> 3) * y + x; + buf_u8[px] = buf_u8[px] & ~(1 << (7 - bit)); + buf_u8[px] = buf_u8[px] | ((c.full & 0x1) << (7 - bit)); + } + else if(dsc->header.cf == LV_IMG_CF_INDEXED_2BIT) { + buf_u8 += sizeof(lv_color32_t) * 4; /*Skip the palette*/ + uint8_t bit = (x & 0x3) * 2; + x = x >> 2; + + /*Get the current pixel. + *dsc->header.w + 3 means rounding up to 4 because the lines are byte aligned + *so the possible real width are 4, 8 ,12 ...*/ + uint32_t px = ((dsc->header.w + 3) >> 2) * y + x; + + buf_u8[px] = buf_u8[px] & ~(3 << (6 - bit)); + buf_u8[px] = buf_u8[px] | ((c.full & 0x3) << (6 - bit)); + } + else if(dsc->header.cf == LV_IMG_CF_INDEXED_4BIT) { + buf_u8 += sizeof(lv_color32_t) * 16; /*Skip the palette*/ + uint8_t bit = (x & 0x1) * 4; + x = x >> 1; + + /*Get the current pixel. + *dsc->header.w + 1 means rounding up to 2 because the lines are byte aligned + *so the possible real width are 2 ,4, 6 ...*/ + uint32_t px = ((dsc->header.w + 1) >> 1) * y + x; + buf_u8[px] = buf_u8[px] & ~(0xF << (4 - bit)); + buf_u8[px] = buf_u8[px] | ((c.full & 0xF) << (4 - bit)); + } + else if(dsc->header.cf == LV_IMG_CF_INDEXED_8BIT) { + buf_u8 += sizeof(lv_color32_t) * 256; /*Skip the palette*/ + uint32_t px = dsc->header.w * y + x; + buf_u8[px] = c.full; + } +} + +void lv_img_buf_set_palette(const lv_img_dsc_t * dsc, uint8_t id, lv_color_t c) +{ + if((dsc->header.cf == LV_IMG_CF_ALPHA_1BIT && id > 1) || (dsc->header.cf == LV_IMG_CF_ALPHA_2BIT && id > 3) || + (dsc->header.cf == LV_IMG_CF_ALPHA_4BIT && id > 15) || (dsc->header.cf == LV_IMG_CF_ALPHA_8BIT)) { + LV_LOG_WARN("lv_img_buf_set_px_alpha: invalid 'id'"); + return; + } + + lv_color32_t c32; + c32.full = lv_color_to32(c); + uint8_t * buf = (uint8_t *)dsc->data; + lv_memcpy_small(&buf[id * sizeof(c32)], &c32, sizeof(c32)); +} + +lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) +{ + /*Allocate image descriptor*/ + lv_img_dsc_t * dsc = lv_mem_alloc(sizeof(lv_img_dsc_t)); + if(dsc == NULL) + return NULL; + + lv_memset_00(dsc, sizeof(lv_img_dsc_t)); + + /*Get image data size*/ + dsc->data_size = lv_img_buf_get_img_size(w, h, cf); + if(dsc->data_size == 0) { + lv_mem_free(dsc); + return NULL; + } + + /*Allocate raw buffer*/ + dsc->data = lv_mem_alloc(dsc->data_size); + if(dsc->data == NULL) { + lv_mem_free(dsc); + return NULL; + } + lv_memset_00((uint8_t *)dsc->data, dsc->data_size); + + /*Fill in header*/ + dsc->header.always_zero = 0; + dsc->header.w = w; + dsc->header.h = h; + dsc->header.cf = cf; + return dsc; +} + +void lv_img_buf_free(lv_img_dsc_t * dsc) +{ + if(dsc != NULL) { + if(dsc->data != NULL) + lv_mem_free((void *)dsc->data); + + lv_mem_free(dsc); + } +} + +uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) +{ + switch(cf) { + case LV_IMG_CF_TRUE_COLOR: + return LV_IMG_BUF_SIZE_TRUE_COLOR(w, h); + case LV_IMG_CF_TRUE_COLOR_ALPHA: + case LV_IMG_CF_RGB565A8: + return LV_IMG_BUF_SIZE_TRUE_COLOR_ALPHA(w, h); + case LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED: + return LV_IMG_BUF_SIZE_TRUE_COLOR_CHROMA_KEYED(w, h); + case LV_IMG_CF_ALPHA_1BIT: + return LV_IMG_BUF_SIZE_ALPHA_1BIT(w, h); + case LV_IMG_CF_ALPHA_2BIT: + return LV_IMG_BUF_SIZE_ALPHA_2BIT(w, h); + case LV_IMG_CF_ALPHA_4BIT: + return LV_IMG_BUF_SIZE_ALPHA_4BIT(w, h); + case LV_IMG_CF_ALPHA_8BIT: + return LV_IMG_BUF_SIZE_ALPHA_8BIT(w, h); + case LV_IMG_CF_INDEXED_1BIT: + return LV_IMG_BUF_SIZE_INDEXED_1BIT(w, h); + case LV_IMG_CF_INDEXED_2BIT: + return LV_IMG_BUF_SIZE_INDEXED_2BIT(w, h); + case LV_IMG_CF_INDEXED_4BIT: + return LV_IMG_BUF_SIZE_INDEXED_4BIT(w, h); + case LV_IMG_CF_INDEXED_8BIT: + return LV_IMG_BUF_SIZE_INDEXED_8BIT(w, h); + default: + return 0; + } +} + +void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, + const lv_point_t * pivot) +{ +#if LV_DRAW_COMPLEX + if(angle == 0 && zoom == LV_IMG_ZOOM_NONE) { + res->x1 = 0; + res->y1 = 0; + res->x2 = w - 1; + res->y2 = h - 1; + return; + } + + lv_point_t p[4] = { + {0, 0}, + {w, 0}, + {0, h}, + {w, h}, + }; + lv_point_transform(&p[0], angle, zoom, pivot); + lv_point_transform(&p[1], angle, zoom, pivot); + lv_point_transform(&p[2], angle, zoom, pivot); + lv_point_transform(&p[3], angle, zoom, pivot); + res->x1 = LV_MIN4(p[0].x, p[1].x, p[2].x, p[3].x) - 2; + res->x2 = LV_MAX4(p[0].x, p[1].x, p[2].x, p[3].x) + 2; + res->y1 = LV_MIN4(p[0].y, p[1].y, p[2].y, p[3].y) - 2; + res->y2 = LV_MAX4(p[0].y, p[1].y, p[2].y, p[3].y) + 2; + +#else + LV_UNUSED(angle); + LV_UNUSED(zoom); + LV_UNUSED(pivot); + res->x1 = 0; + res->y1 = 0; + res->x2 = w - 1; + res->y2 = h - 1; +#endif +} + +/********************** + * STATIC FUNCTIONS + **********************/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_img_buf.h b/L3_Middlewares/LVGL/src/draw/lv_img_buf.h new file mode 100644 index 0000000..71c3bd0 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_img_buf.h @@ -0,0 +1,249 @@ +/** + * @file lv_img_buf.h + * + */ + +#ifndef LV_IMG_BUF_H +#define LV_IMG_BUF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include +#include "../misc/lv_color.h" +#include "../misc/lv_area.h" + +/********************* + * DEFINES + *********************/ +/*If image pixels contains alpha we need to know how much byte is a pixel*/ +#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 +#define LV_IMG_PX_SIZE_ALPHA_BYTE 2 +#elif LV_COLOR_DEPTH == 16 +#define LV_IMG_PX_SIZE_ALPHA_BYTE 3 +#elif LV_COLOR_DEPTH == 32 +#define LV_IMG_PX_SIZE_ALPHA_BYTE 4 +#endif + +#define LV_IMG_BUF_SIZE_TRUE_COLOR(w, h) ((LV_COLOR_SIZE / 8) * w * h) +#define LV_IMG_BUF_SIZE_TRUE_COLOR_CHROMA_KEYED(w, h) ((LV_COLOR_SIZE / 8) * w * h) +#define LV_IMG_BUF_SIZE_TRUE_COLOR_ALPHA(w, h) (LV_IMG_PX_SIZE_ALPHA_BYTE * w * h) + +/*+ 1: to be sure no fractional row*/ +#define LV_IMG_BUF_SIZE_ALPHA_1BIT(w, h) ((((w / 8) + 1) * h)) +#define LV_IMG_BUF_SIZE_ALPHA_2BIT(w, h) ((((w / 4) + 1) * h)) +#define LV_IMG_BUF_SIZE_ALPHA_4BIT(w, h) ((((w / 2) + 1) * h)) +#define LV_IMG_BUF_SIZE_ALPHA_8BIT(w, h) ((w * h)) + +/*4 * X: for palette*/ +#define LV_IMG_BUF_SIZE_INDEXED_1BIT(w, h) (LV_IMG_BUF_SIZE_ALPHA_1BIT(w, h) + 4 * 2) +#define LV_IMG_BUF_SIZE_INDEXED_2BIT(w, h) (LV_IMG_BUF_SIZE_ALPHA_2BIT(w, h) + 4 * 4) +#define LV_IMG_BUF_SIZE_INDEXED_4BIT(w, h) (LV_IMG_BUF_SIZE_ALPHA_4BIT(w, h) + 4 * 16) +#define LV_IMG_BUF_SIZE_INDEXED_8BIT(w, h) (LV_IMG_BUF_SIZE_ALPHA_8BIT(w, h) + 4 * 256) + +#define _LV_ZOOM_INV_UPSCALE 5 + +/********************** + * TYPEDEFS + **********************/ + +/*Image color format*/ +enum { + LV_IMG_CF_UNKNOWN = 0, + + LV_IMG_CF_RAW, /**< Contains the file as it is. Needs custom decoder function*/ + LV_IMG_CF_RAW_ALPHA, /**< Contains the file as it is. The image has alpha. Needs custom decoder + function*/ + LV_IMG_CF_RAW_CHROMA_KEYED, /**< Contains the file as it is. The image is chroma keyed. Needs + custom decoder function*/ + + LV_IMG_CF_TRUE_COLOR, /**< Color format and depth should match with LV_COLOR settings*/ + LV_IMG_CF_TRUE_COLOR_ALPHA, /**< Same as `LV_IMG_CF_TRUE_COLOR` but every pixel has an alpha byte*/ + LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED, /**< Same as `LV_IMG_CF_TRUE_COLOR` but LV_COLOR_TRANSP pixels + will be transparent*/ + + LV_IMG_CF_INDEXED_1BIT, /**< Can have 2 different colors in a palette (can't be chroma keyed)*/ + LV_IMG_CF_INDEXED_2BIT, /**< Can have 4 different colors in a palette (can't be chroma keyed)*/ + LV_IMG_CF_INDEXED_4BIT, /**< Can have 16 different colors in a palette (can't be chroma keyed)*/ + LV_IMG_CF_INDEXED_8BIT, /**< Can have 256 different colors in a palette (can't be chroma keyed)*/ + + LV_IMG_CF_ALPHA_1BIT, /**< Can have one color and it can be drawn or not*/ + LV_IMG_CF_ALPHA_2BIT, /**< Can have one color but 4 different alpha value*/ + LV_IMG_CF_ALPHA_4BIT, /**< Can have one color but 16 different alpha value*/ + LV_IMG_CF_ALPHA_8BIT, /**< Can have one color but 256 different alpha value*/ + + LV_IMG_CF_RGB888, + LV_IMG_CF_RGBA8888, + LV_IMG_CF_RGBX8888, + LV_IMG_CF_RGB565, + LV_IMG_CF_RGBA5658, + LV_IMG_CF_RGB565A8, + + LV_IMG_CF_RESERVED_15, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_16, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_17, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_18, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_19, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_20, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_21, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_22, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_23, /**< Reserved for further use.*/ + + LV_IMG_CF_USER_ENCODED_0, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_1, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_2, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_3, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_4, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_5, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_6, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_7, /**< User holder encoding format.*/ +}; +typedef uint8_t lv_img_cf_t; + + +/** + * The first 8 bit is very important to distinguish the different source types. + * For more info see `lv_img_get_src_type()` in lv_img.c + * On big endian systems the order is reversed so cf and always_zero must be at + * the end of the struct. + */ +#if LV_BIG_ENDIAN_SYSTEM +typedef struct { + + uint32_t h : 11; /*Height of the image map*/ + uint32_t w : 11; /*Width of the image map*/ + uint32_t reserved : 2; /*Reserved to be used later*/ + uint32_t always_zero : 3; /*It the upper bits of the first byte. Always zero to look like a + non-printable character*/ + uint32_t cf : 5; /*Color format: See `lv_img_color_format_t`*/ + +} lv_img_header_t; +#else +typedef struct { + + uint32_t cf : 5; /*Color format: See `lv_img_color_format_t`*/ + uint32_t always_zero : 3; /*It the upper bits of the first byte. Always zero to look like a + non-printable character*/ + + uint32_t reserved : 2; /*Reserved to be used later*/ + + uint32_t w : 11; /*Width of the image map*/ + uint32_t h : 11; /*Height of the image map*/ +} lv_img_header_t; +#endif + +/** Image header it is compatible with + * the result from image converter utility*/ +typedef struct { + lv_img_header_t header; /**< A header describing the basics of the image*/ + uint32_t data_size; /**< Size of the image in bytes*/ + const uint8_t * data; /**< Pointer to the data of the image*/ +} lv_img_dsc_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Allocate an image buffer in RAM + * @param w width of image + * @param h height of image + * @param cf a color format (`LV_IMG_CF_...`) + * @return an allocated image, or NULL on failure + */ +lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf); + +/** + * Get the color of an image's pixel + * @param dsc an image descriptor + * @param x x coordinate of the point to get + * @param y x coordinate of the point to get + * @param color the color of the image. In case of `LV_IMG_CF_ALPHA_1/2/4/8` this color is used. + * Not used in other cases. + * @param safe true: check out of bounds + * @return color of the point + */ +lv_color_t lv_img_buf_get_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t color); + +/** + * Get the alpha value of an image's pixel + * @param dsc pointer to an image descriptor + * @param x x coordinate of the point to set + * @param y x coordinate of the point to set + * @param safe true: check out of bounds + * @return alpha value of the point + */ +lv_opa_t lv_img_buf_get_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y); + +/** + * Set the color of a pixel of an image. The alpha channel won't be affected. + * @param dsc pointer to an image descriptor + * @param x x coordinate of the point to set + * @param y x coordinate of the point to set + * @param c color of the point + * @param safe true: check out of bounds + */ +void lv_img_buf_set_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t c); + +/** + * Set the alpha value of a pixel of an image. The color won't be affected + * @param dsc pointer to an image descriptor + * @param x x coordinate of the point to set + * @param y x coordinate of the point to set + * @param opa the desired opacity + * @param safe true: check out of bounds + */ +void lv_img_buf_set_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa); + +/** + * Set the palette color of an indexed image. Valid only for `LV_IMG_CF_INDEXED1/2/4/8` + * @param dsc pointer to an image descriptor + * @param id the palette color to set: + * - for `LV_IMG_CF_INDEXED1`: 0..1 + * - for `LV_IMG_CF_INDEXED2`: 0..3 + * - for `LV_IMG_CF_INDEXED4`: 0..15 + * - for `LV_IMG_CF_INDEXED8`: 0..255 + * @param c the color to set + */ +void lv_img_buf_set_palette(const lv_img_dsc_t * dsc, uint8_t id, lv_color_t c); + +/** + * Free an allocated image buffer + * @param dsc image buffer to free + */ +void lv_img_buf_free(lv_img_dsc_t * dsc); + +/** + * Get the memory consumption of a raw bitmap, given color format and dimensions. + * @param w width + * @param h height + * @param cf color format + * @return size in bytes + */ +uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf); + +/** + * Get the area of a rectangle if its rotated and scaled + * @param res store the coordinates here + * @param w width of the rectangle to transform + * @param h height of the rectangle to transform + * @param angle angle of rotation + * @param zoom zoom, (256 no zoom) + * @param pivot x,y pivot coordinates of rotation + */ +void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, + const lv_point_t * pivot); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_IMG_BUF_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_img_cache.c b/L3_Middlewares/LVGL/src/draw/lv_img_cache.c new file mode 100644 index 0000000..2caf512 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_img_cache.c @@ -0,0 +1,215 @@ +/** + * @file lv_img_cache.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../misc/lv_assert.h" +#include "lv_img_cache.h" +#include "lv_img_decoder.h" +#include "lv_draw_img.h" +#include "../hal/lv_hal_tick.h" +#include "../misc/lv_gc.h" + +/********************* + * DEFINES + *********************/ +/*Decrement life with this value on every open*/ +#define LV_IMG_CACHE_AGING 1 + +/*Boost life by this factor (multiply time_to_open with this value)*/ +#define LV_IMG_CACHE_LIFE_GAIN 1 + +/*Don't let life to be greater than this limit because it would require a lot of time to + * "die" from very high values*/ +#define LV_IMG_CACHE_LIFE_LIMIT 1000 + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +#if LV_IMG_CACHE_DEF_SIZE + static bool lv_img_cache_match(const void * src1, const void * src2); +#endif + +/********************** + * STATIC VARIABLES + **********************/ +#if LV_IMG_CACHE_DEF_SIZE + static uint16_t entry_cnt; +#endif + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Open an image using the image decoder interface and cache it. + * The image will be left open meaning if the image decoder open callback allocated memory then it will remain. + * The image is closed if a new image is opened and the new image takes its place in the cache. + * @param src source of the image. Path to file or pointer to an `lv_img_dsc_t` variable + * @param color color The color of the image with `LV_IMG_CF_ALPHA_...` + * @return pointer to the cache entry or NULL if can open the image + */ +_lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color, int32_t frame_id) +{ + /*Is the image cached?*/ + _lv_img_cache_entry_t * cached_src = NULL; + +#if LV_IMG_CACHE_DEF_SIZE + if(entry_cnt == 0) { + LV_LOG_WARN("lv_img_cache_open: the cache size is 0"); + return NULL; + } + + _lv_img_cache_entry_t * cache = LV_GC_ROOT(_lv_img_cache_array); + + /*Decrement all lifes. Make the entries older*/ + uint16_t i; + for(i = 0; i < entry_cnt; i++) { + if(cache[i].life > INT32_MIN + LV_IMG_CACHE_AGING) { + cache[i].life -= LV_IMG_CACHE_AGING; + } + } + + for(i = 0; i < entry_cnt; i++) { + if(color.full == cache[i].dec_dsc.color.full && + frame_id == cache[i].dec_dsc.frame_id && + lv_img_cache_match(src, cache[i].dec_dsc.src)) { + /*If opened increment its life. + *Image difficult to open should live longer to keep avoid frequent their recaching. + *Therefore increase `life` with `time_to_open`*/ + cached_src = &cache[i]; + cached_src->life += cached_src->dec_dsc.time_to_open * LV_IMG_CACHE_LIFE_GAIN; + if(cached_src->life > LV_IMG_CACHE_LIFE_LIMIT) cached_src->life = LV_IMG_CACHE_LIFE_LIMIT; + LV_LOG_TRACE("image source found in the cache"); + break; + } + } + + /*The image is not cached then cache it now*/ + if(cached_src) return cached_src; + + /*Find an entry to reuse. Select the entry with the least life*/ + cached_src = &cache[0]; + for(i = 1; i < entry_cnt; i++) { + if(cache[i].life < cached_src->life) { + cached_src = &cache[i]; + } + } + + /*Close the decoder to reuse if it was opened (has a valid source)*/ + if(cached_src->dec_dsc.src) { + lv_img_decoder_close(&cached_src->dec_dsc); + LV_LOG_INFO("image draw: cache miss, close and reuse an entry"); + } + else { + LV_LOG_INFO("image draw: cache miss, cached to an empty entry"); + } +#else + cached_src = &LV_GC_ROOT(_lv_img_cache_single); +#endif + /*Open the image and measure the time to open*/ + uint32_t t_start = lv_tick_get(); + lv_res_t open_res = lv_img_decoder_open(&cached_src->dec_dsc, src, color, frame_id); + if(open_res == LV_RES_INV) { + LV_LOG_WARN("Image draw cannot open the image resource"); + lv_memset_00(cached_src, sizeof(_lv_img_cache_entry_t)); + cached_src->life = INT32_MIN; /*Make the empty entry very "weak" to force its us*/ + return NULL; + } + + cached_src->life = 0; + + /*If `time_to_open` was not set in the open function set it here*/ + if(cached_src->dec_dsc.time_to_open == 0) { + cached_src->dec_dsc.time_to_open = lv_tick_elaps(t_start); + } + + if(cached_src->dec_dsc.time_to_open == 0) cached_src->dec_dsc.time_to_open = 1; + + return cached_src; +} + +/** + * Set the number of images to be cached. + * More cached images mean more opened image at same time which might mean more memory usage. + * E.g. if 20 PNG or JPG images are open in the RAM they consume memory while opened in the cache. + * @param new_entry_cnt number of image to cache + */ +void lv_img_cache_set_size(uint16_t new_entry_cnt) +{ +#if LV_IMG_CACHE_DEF_SIZE == 0 + LV_UNUSED(new_entry_cnt); + LV_LOG_WARN("Can't change cache size because it's disabled by LV_IMG_CACHE_DEF_SIZE = 0"); +#else + if(LV_GC_ROOT(_lv_img_cache_array) != NULL) { + /*Clean the cache before free it*/ + lv_img_cache_invalidate_src(NULL); + lv_mem_free(LV_GC_ROOT(_lv_img_cache_array)); + } + + /*Reallocate the cache*/ + LV_GC_ROOT(_lv_img_cache_array) = lv_mem_alloc(sizeof(_lv_img_cache_entry_t) * new_entry_cnt); + LV_ASSERT_MALLOC(LV_GC_ROOT(_lv_img_cache_array)); + if(LV_GC_ROOT(_lv_img_cache_array) == NULL) { + entry_cnt = 0; + return; + } + entry_cnt = new_entry_cnt; + + /*Clean the cache*/ + lv_memset_00(LV_GC_ROOT(_lv_img_cache_array), entry_cnt * sizeof(_lv_img_cache_entry_t)); +#endif +} + +/** + * Invalidate an image source in the cache. + * Useful if the image source is updated therefore it needs to be cached again. + * @param src an image source path to a file or pointer to an `lv_img_dsc_t` variable. + */ +void lv_img_cache_invalidate_src(const void * src) +{ + LV_UNUSED(src); +#if LV_IMG_CACHE_DEF_SIZE + _lv_img_cache_entry_t * cache = LV_GC_ROOT(_lv_img_cache_array); + + uint16_t i; + for(i = 0; i < entry_cnt; i++) { + if(src == NULL || lv_img_cache_match(src, cache[i].dec_dsc.src)) { + if(cache[i].dec_dsc.src != NULL) { + lv_img_decoder_close(&cache[i].dec_dsc); + } + + lv_memset_00(&cache[i], sizeof(_lv_img_cache_entry_t)); + } + } +#endif +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +#if LV_IMG_CACHE_DEF_SIZE +static bool lv_img_cache_match(const void * src1, const void * src2) +{ + lv_img_src_t src_type = lv_img_src_get_type(src1); + if(src_type == LV_IMG_SRC_VARIABLE) + return src1 == src2; + if(src_type != LV_IMG_SRC_FILE) + return false; + if(lv_img_src_get_type(src2) != LV_IMG_SRC_FILE) + return false; + return strcmp(src1, src2) == 0; +} +#endif diff --git a/L3_Middlewares/LVGL/src/draw/lv_img_cache.h b/L3_Middlewares/LVGL/src/draw/lv_img_cache.h new file mode 100644 index 0000000..dc0c5d9 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_img_cache.h @@ -0,0 +1,78 @@ +/** + * @file lv_img_cache.h + * + */ + +#ifndef LV_IMG_CACHE_H +#define LV_IMG_CACHE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "lv_img_decoder.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/** + * When loading images from the network it can take a long time to download and decode the image. + * + * To avoid repeating this heavy load images can be cached. + */ +typedef struct { + lv_img_decoder_dsc_t dec_dsc; /**< Image information*/ + + /** Count the cache entries's life. Add `time_to_open` to `life` when the entry is used. + * Decrement all lifes by one every in every ::lv_img_cache_open. + * If life == 0 the entry can be reused*/ + int32_t life; +} _lv_img_cache_entry_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Open an image using the image decoder interface and cache it. + * The image will be left open meaning if the image decoder open callback allocated memory then it will remain. + * The image is closed if a new image is opened and the new image takes its place in the cache. + * @param src source of the image. Path to file or pointer to an `lv_img_dsc_t` variable + * @param color The color of the image with `LV_IMG_CF_ALPHA_...` + * @param frame_id the index of the frame. Used only with animated images, set 0 for normal images + * @return pointer to the cache entry or NULL if can open the image + */ +_lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color, int32_t frame_id); + +/** + * Set the number of images to be cached. + * More cached images mean more opened image at same time which might mean more memory usage. + * E.g. if 20 PNG or JPG images are open in the RAM they consume memory while opened in the cache. + * @param new_entry_cnt number of image to cache + */ +void lv_img_cache_set_size(uint16_t new_slot_num); + +/** + * Invalidate an image source in the cache. + * Useful if the image source is updated therefore it needs to be cached again. + * @param src an image source path to a file or pointer to an `lv_img_dsc_t` variable. + */ +void lv_img_cache_invalidate_src(const void * src); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_IMG_CACHE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_img_decoder.c b/L3_Middlewares/LVGL/src/draw/lv_img_decoder.c new file mode 100644 index 0000000..76aff5e --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_img_decoder.c @@ -0,0 +1,730 @@ +/** + * @file lv_img_decoder.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_img_decoder.h" +#include "../misc/lv_assert.h" +#include "../draw/lv_draw_img.h" +#include "../misc/lv_ll.h" +#include "../misc/lv_gc.h" + +/********************* + * DEFINES + *********************/ +#define CF_BUILT_IN_FIRST LV_IMG_CF_TRUE_COLOR +#define CF_BUILT_IN_LAST LV_IMG_CF_RGB565A8 + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_fs_file_t f; + lv_color_t * palette; + lv_opa_t * opa; +} lv_img_decoder_built_in_data_t; + +/********************** + * STATIC PROTOTYPES + **********************/ +static lv_res_t lv_img_decoder_built_in_line_true_color(lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, + lv_coord_t len, uint8_t * buf); +static lv_res_t lv_img_decoder_built_in_line_alpha(lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, + lv_coord_t len, uint8_t * buf); +static lv_res_t lv_img_decoder_built_in_line_indexed(lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, + lv_coord_t len, uint8_t * buf); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Initialize the image decoder module + */ +void _lv_img_decoder_init(void) +{ + _lv_ll_init(&LV_GC_ROOT(_lv_img_decoder_ll), sizeof(lv_img_decoder_t)); + + lv_img_decoder_t * decoder; + + /*Create a decoder for the built in color format*/ + decoder = lv_img_decoder_create(); + LV_ASSERT_MALLOC(decoder); + if(decoder == NULL) { + LV_LOG_WARN("lv_img_decoder_init: out of memory"); + return; + } + + lv_img_decoder_set_info_cb(decoder, lv_img_decoder_built_in_info); + lv_img_decoder_set_open_cb(decoder, lv_img_decoder_built_in_open); + lv_img_decoder_set_read_line_cb(decoder, lv_img_decoder_built_in_read_line); + lv_img_decoder_set_close_cb(decoder, lv_img_decoder_built_in_close); +} + +/** + * Get information about an image. + * Try the created image decoder one by one. Once one is able to get info that info will be used. + * @param src the image source. E.g. file name or variable. + * @param header the image info will be stored here + * @return LV_RES_OK: success; LV_RES_INV: wasn't able to get info about the image + */ +lv_res_t lv_img_decoder_get_info(const void * src, lv_img_header_t * header) +{ + lv_memset_00(header, sizeof(lv_img_header_t)); + + if(src == NULL) return LV_RES_INV; + + lv_img_src_t src_type = lv_img_src_get_type(src); + if(src_type == LV_IMG_SRC_VARIABLE) { + const lv_img_dsc_t * img_dsc = src; + if(img_dsc->data == NULL) return LV_RES_INV; + } + + lv_res_t res = LV_RES_INV; + lv_img_decoder_t * d; + _LV_LL_READ(&LV_GC_ROOT(_lv_img_decoder_ll), d) { + if(d->info_cb) { + res = d->info_cb(d, src, header); + if(res == LV_RES_OK) break; + } + } + + return res; +} + +lv_res_t lv_img_decoder_open(lv_img_decoder_dsc_t * dsc, const void * src, lv_color_t color, int32_t frame_id) +{ + lv_memset_00(dsc, sizeof(lv_img_decoder_dsc_t)); + + if(src == NULL) return LV_RES_INV; + lv_img_src_t src_type = lv_img_src_get_type(src); + if(src_type == LV_IMG_SRC_VARIABLE) { + const lv_img_dsc_t * img_dsc = src; + if(img_dsc->data == NULL) return LV_RES_INV; + } + + dsc->color = color; + dsc->src_type = src_type; + dsc->frame_id = frame_id; + + if(dsc->src_type == LV_IMG_SRC_FILE) { + size_t fnlen = strlen(src); + dsc->src = lv_mem_alloc(fnlen + 1); + LV_ASSERT_MALLOC(dsc->src); + if(dsc->src == NULL) { + LV_LOG_WARN("lv_img_decoder_open: out of memory"); + return LV_RES_INV; + } + strcpy((char *)dsc->src, src); + } + else { + dsc->src = src; + } + + lv_res_t res = LV_RES_INV; + + lv_img_decoder_t * decoder; + _LV_LL_READ(&LV_GC_ROOT(_lv_img_decoder_ll), decoder) { + /*Info and Open callbacks are required*/ + if(decoder->info_cb == NULL || decoder->open_cb == NULL) continue; + + res = decoder->info_cb(decoder, src, &dsc->header); + if(res != LV_RES_OK) continue; + + dsc->decoder = decoder; + res = decoder->open_cb(decoder, dsc); + + /*Opened successfully. It is a good decoder for this image source*/ + if(res == LV_RES_OK) return res; + + /*Prepare for the next loop*/ + lv_memset_00(&dsc->header, sizeof(lv_img_header_t)); + + dsc->error_msg = NULL; + dsc->img_data = NULL; + dsc->user_data = NULL; + dsc->time_to_open = 0; + } + + if(dsc->src_type == LV_IMG_SRC_FILE) + lv_mem_free((void *)dsc->src); + + return res; +} + +/** + * Read a line from an opened image + * @param dsc pointer to `lv_img_decoder_dsc_t` used in `lv_img_decoder_open` + * @param x start X coordinate (from left) + * @param y start Y coordinate (from top) + * @param len number of pixels to read + * @param buf store the data here + * @return LV_RES_OK: success; LV_RES_INV: an error occurred + */ +lv_res_t lv_img_decoder_read_line(lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_coord_t len, uint8_t * buf) +{ + lv_res_t res = LV_RES_INV; + if(dsc->decoder->read_line_cb) res = dsc->decoder->read_line_cb(dsc->decoder, dsc, x, y, len, buf); + + return res; +} + +/** + * Close a decoding session + * @param dsc pointer to `lv_img_decoder_dsc_t` used in `lv_img_decoder_open` + */ +void lv_img_decoder_close(lv_img_decoder_dsc_t * dsc) +{ + if(dsc->decoder) { + if(dsc->decoder->close_cb) dsc->decoder->close_cb(dsc->decoder, dsc); + + if(dsc->src_type == LV_IMG_SRC_FILE) { + lv_mem_free((void *)dsc->src); + dsc->src = NULL; + } + } +} + +/** + * Create a new image decoder + * @return pointer to the new image decoder + */ +lv_img_decoder_t * lv_img_decoder_create(void) +{ + lv_img_decoder_t * decoder; + decoder = _lv_ll_ins_head(&LV_GC_ROOT(_lv_img_decoder_ll)); + LV_ASSERT_MALLOC(decoder); + if(decoder == NULL) return NULL; + + lv_memset_00(decoder, sizeof(lv_img_decoder_t)); + + return decoder; +} + +/** + * Delete an image decoder + * @param decoder pointer to an image decoder + */ +void lv_img_decoder_delete(lv_img_decoder_t * decoder) +{ + _lv_ll_remove(&LV_GC_ROOT(_lv_img_decoder_ll), decoder); + lv_mem_free(decoder); +} + +/** + * Set a callback to get information about the image + * @param decoder pointer to an image decoder + * @param info_cb a function to collect info about an image (fill an `lv_img_header_t` struct) + */ +void lv_img_decoder_set_info_cb(lv_img_decoder_t * decoder, lv_img_decoder_info_f_t info_cb) +{ + decoder->info_cb = info_cb; +} + +/** + * Set a callback to open an image + * @param decoder pointer to an image decoder + * @param open_cb a function to open an image + */ +void lv_img_decoder_set_open_cb(lv_img_decoder_t * decoder, lv_img_decoder_open_f_t open_cb) +{ + decoder->open_cb = open_cb; +} + +/** + * Set a callback to a decoded line of an image + * @param decoder pointer to an image decoder + * @param read_line_cb a function to read a line of an image + */ +void lv_img_decoder_set_read_line_cb(lv_img_decoder_t * decoder, lv_img_decoder_read_line_f_t read_line_cb) +{ + decoder->read_line_cb = read_line_cb; +} + +/** + * Set a callback to close a decoding session. E.g. close files and free other resources. + * @param decoder pointer to an image decoder + * @param close_cb a function to close a decoding session + */ +void lv_img_decoder_set_close_cb(lv_img_decoder_t * decoder, lv_img_decoder_close_f_t close_cb) +{ + decoder->close_cb = close_cb; +} + +/** + * Get info about a built-in image + * @param decoder the decoder where this function belongs + * @param src the image source: pointer to an `lv_img_dsc_t` variable, a file path or a symbol + * @param header store the image data here + * @return LV_RES_OK: the info is successfully stored in `header`; LV_RES_INV: unknown format or other error. + */ +lv_res_t lv_img_decoder_built_in_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header) +{ + LV_UNUSED(decoder); /*Unused*/ + + lv_img_src_t src_type = lv_img_src_get_type(src); + if(src_type == LV_IMG_SRC_VARIABLE) { + lv_img_cf_t cf = ((lv_img_dsc_t *)src)->header.cf; + if(cf < CF_BUILT_IN_FIRST || cf > CF_BUILT_IN_LAST) return LV_RES_INV; + + header->w = ((lv_img_dsc_t *)src)->header.w; + header->h = ((lv_img_dsc_t *)src)->header.h; + header->cf = ((lv_img_dsc_t *)src)->header.cf; + } + else if(src_type == LV_IMG_SRC_FILE) { + /*Support only "*.bin" files*/ + if(strcmp(lv_fs_get_ext(src), "bin")) return LV_RES_INV; + + lv_fs_file_t f; + lv_fs_res_t res = lv_fs_open(&f, src, LV_FS_MODE_RD); + if(res == LV_FS_RES_OK) { + uint32_t rn; + res = lv_fs_read(&f, header, sizeof(lv_img_header_t), &rn); + lv_fs_close(&f); + if(res != LV_FS_RES_OK || rn != sizeof(lv_img_header_t)) { + LV_LOG_WARN("Image get info get read file header"); + return LV_RES_INV; + } + } + + if(header->cf < CF_BUILT_IN_FIRST || header->cf > CF_BUILT_IN_LAST) return LV_RES_INV; + } + else if(src_type == LV_IMG_SRC_SYMBOL) { + /*The size depend on the font but it is unknown here. It should be handled outside of the + *function*/ + header->w = 1; + header->h = 1; + /*Symbols always have transparent parts. Important because of cover check in the draw + *function. The actual value doesn't matter because lv_draw_label will draw it*/ + header->cf = LV_IMG_CF_ALPHA_1BIT; + } + else { + LV_LOG_WARN("Image get info found unknown src type"); + return LV_RES_INV; + } + return LV_RES_OK; +} + +/** + * Open a built in image + * @param decoder the decoder where this function belongs + * @param dsc pointer to decoder descriptor. `src`, `color` are already initialized in it. + * @return LV_RES_OK: the info is successfully stored in `header`; LV_RES_INV: unknown format or other error. + */ +lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc) +{ + /*Open the file if it's a file*/ + if(dsc->src_type == LV_IMG_SRC_FILE) { + /*Support only "*.bin" files*/ + if(strcmp(lv_fs_get_ext(dsc->src), "bin")) return LV_RES_INV; + + lv_fs_file_t f; + lv_fs_res_t res = lv_fs_open(&f, dsc->src, LV_FS_MODE_RD); + if(res != LV_FS_RES_OK) { + LV_LOG_WARN("Built-in image decoder can't open the file"); + return LV_RES_INV; + } + + /*If the file was open successfully save the file descriptor*/ + if(dsc->user_data == NULL) { + dsc->user_data = lv_mem_alloc(sizeof(lv_img_decoder_built_in_data_t)); + LV_ASSERT_MALLOC(dsc->user_data); + if(dsc->user_data == NULL) { + LV_LOG_ERROR("img_decoder_built_in_open: out of memory"); + lv_fs_close(&f); + return LV_RES_INV; + } + lv_memset_00(dsc->user_data, sizeof(lv_img_decoder_built_in_data_t)); + } + + lv_img_decoder_built_in_data_t * user_data = dsc->user_data; + lv_memcpy_small(&user_data->f, &f, sizeof(f)); + } + else if(dsc->src_type == LV_IMG_SRC_VARIABLE) { + /*The variables should have valid data*/ + if(((lv_img_dsc_t *)dsc->src)->data == NULL) { + return LV_RES_INV; + } + } + + lv_img_cf_t cf = dsc->header.cf; + /*Process A8, RGB565A8, need load file to ram after https://github.com/lvgl/lvgl/pull/3337*/ + if(cf == LV_IMG_CF_ALPHA_8BIT || cf == LV_IMG_CF_RGB565A8) { + if(dsc->src_type == LV_IMG_SRC_VARIABLE) { + /*In case of uncompressed formats the image stored in the ROM/RAM. + *So simply give its pointer*/ + dsc->img_data = ((lv_img_dsc_t *)dsc->src)->data; + return LV_RES_OK; + } + else { + /*If it's a file, read all to memory*/ + uint32_t len = dsc->header.w * dsc->header.h; + len *= cf == LV_IMG_CF_RGB565A8 ? 3 : 1; + uint8_t * fs_buf = lv_mem_alloc(len); + if(fs_buf == NULL) return LV_RES_INV; + + lv_img_decoder_built_in_data_t * user_data = dsc->user_data; + lv_fs_seek(&user_data->f, 4, LV_FS_SEEK_SET); /*+4 to skip the header*/ + lv_fs_res_t res = lv_fs_read(&user_data->f, fs_buf, len, NULL); + if(res != LV_FS_RES_OK) { + lv_mem_free(fs_buf); + return LV_RES_INV; + } + dsc->img_data = fs_buf; + return LV_RES_OK; + } + } + /*Process true color formats*/ + else if(cf == LV_IMG_CF_TRUE_COLOR || cf == LV_IMG_CF_TRUE_COLOR_ALPHA || + cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { + if(dsc->src_type == LV_IMG_SRC_VARIABLE) { + /*In case of uncompressed formats the image stored in the ROM/RAM. + *So simply give its pointer*/ + dsc->img_data = ((lv_img_dsc_t *)dsc->src)->data; + return LV_RES_OK; + } + else { + /*If it's a file it need to be read line by line later*/ + return LV_RES_OK; + } + } + /*Process indexed images. Build a palette*/ + else if(cf == LV_IMG_CF_INDEXED_1BIT || cf == LV_IMG_CF_INDEXED_2BIT || cf == LV_IMG_CF_INDEXED_4BIT || + cf == LV_IMG_CF_INDEXED_8BIT) { + uint8_t px_size = lv_img_cf_get_px_size(cf); + uint32_t palette_size = 1 << px_size; + + /*Allocate the palette*/ + if(dsc->user_data == NULL) { + dsc->user_data = lv_mem_alloc(sizeof(lv_img_decoder_built_in_data_t)); + LV_ASSERT_MALLOC(dsc->user_data); + if(dsc->user_data == NULL) { + LV_LOG_ERROR("img_decoder_built_in_open: out of memory"); + return LV_RES_INV; + } + lv_memset_00(dsc->user_data, sizeof(lv_img_decoder_built_in_data_t)); + } + + lv_img_decoder_built_in_data_t * user_data = dsc->user_data; + user_data->palette = lv_mem_alloc(palette_size * sizeof(lv_color_t)); + LV_ASSERT_MALLOC(user_data->palette); + user_data->opa = lv_mem_alloc(palette_size * sizeof(lv_opa_t)); + LV_ASSERT_MALLOC(user_data->opa); + if(user_data->palette == NULL || user_data->opa == NULL) { + LV_LOG_ERROR("img_decoder_built_in_open: out of memory"); + lv_img_decoder_built_in_close(decoder, dsc); + return LV_RES_INV; + } + + if(dsc->src_type == LV_IMG_SRC_FILE) { + /*Read the palette from file*/ + lv_fs_seek(&user_data->f, 4, LV_FS_SEEK_SET); /*Skip the header*/ + lv_color32_t cur_color; + uint32_t i; + for(i = 0; i < palette_size; i++) { + lv_fs_read(&user_data->f, &cur_color, sizeof(lv_color32_t), NULL); + user_data->palette[i] = lv_color_make(cur_color.ch.red, cur_color.ch.green, cur_color.ch.blue); + user_data->opa[i] = cur_color.ch.alpha; + } + } + else { + /*The palette begins in the beginning of the image data. Just point to it.*/ + lv_color32_t * palette_p = (lv_color32_t *)((lv_img_dsc_t *)dsc->src)->data; + + uint32_t i; + for(i = 0; i < palette_size; i++) { + user_data->palette[i] = lv_color_make(palette_p[i].ch.red, palette_p[i].ch.green, palette_p[i].ch.blue); + user_data->opa[i] = palette_p[i].ch.alpha; + } + } + + return LV_RES_OK; + } + /*Alpha indexed images.*/ + else if(cf == LV_IMG_CF_ALPHA_1BIT || cf == LV_IMG_CF_ALPHA_2BIT || cf == LV_IMG_CF_ALPHA_4BIT) { + return LV_RES_OK; /*Nothing to process*/ + } + /*Unknown format. Can't decode it.*/ + else { + /*Free the potentially allocated memories*/ + lv_img_decoder_built_in_close(decoder, dsc); + + LV_LOG_WARN("Image decoder open: unknown color format"); + return LV_RES_INV; + } +} + +/** + * Decode `len` pixels starting from the given `x`, `y` coordinates and store them in `buf`. + * Required only if the "open" function can't return with the whole decoded pixel array. + * @param decoder pointer to the decoder the function associated with + * @param dsc pointer to decoder descriptor + * @param x start x coordinate + * @param y start y coordinate + * @param len number of pixels to decode + * @param buf a buffer to store the decoded pixels + * @return LV_RES_OK: ok; LV_RES_INV: failed + */ +lv_res_t lv_img_decoder_built_in_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, lv_coord_t x, + lv_coord_t y, lv_coord_t len, uint8_t * buf) +{ + LV_UNUSED(decoder); /*Unused*/ + + lv_res_t res = LV_RES_INV; + + if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR || dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA || + dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { + /*For TRUE_COLOR images read line required only for files. + *For variables the image data was returned in `open`*/ + if(dsc->src_type == LV_IMG_SRC_FILE) { + res = lv_img_decoder_built_in_line_true_color(dsc, x, y, len, buf); + } + } + else if(dsc->header.cf == LV_IMG_CF_ALPHA_1BIT || dsc->header.cf == LV_IMG_CF_ALPHA_2BIT || + dsc->header.cf == LV_IMG_CF_ALPHA_4BIT || dsc->header.cf == LV_IMG_CF_ALPHA_8BIT) { + res = lv_img_decoder_built_in_line_alpha(dsc, x, y, len, buf); + } + else if(dsc->header.cf == LV_IMG_CF_INDEXED_1BIT || dsc->header.cf == LV_IMG_CF_INDEXED_2BIT || + dsc->header.cf == LV_IMG_CF_INDEXED_4BIT || dsc->header.cf == LV_IMG_CF_INDEXED_8BIT) { + res = lv_img_decoder_built_in_line_indexed(dsc, x, y, len, buf); + } + else { + LV_LOG_WARN("Built-in image decoder read not supports the color format"); + return LV_RES_INV; + } + + return res; +} + +/** + * Close the pending decoding. Free resources etc. + * @param decoder pointer to the decoder the function associated with + * @param dsc pointer to decoder descriptor + */ +void lv_img_decoder_built_in_close(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc) +{ + LV_UNUSED(decoder); /*Unused*/ + + lv_img_decoder_built_in_data_t * user_data = dsc->user_data; + if(user_data) { + if(dsc->src_type == LV_IMG_SRC_FILE) { + lv_fs_close(&user_data->f); + } + if(user_data->palette) lv_mem_free(user_data->palette); + if(user_data->opa) lv_mem_free(user_data->opa); + + lv_mem_free(user_data); + dsc->user_data = NULL; + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static lv_res_t lv_img_decoder_built_in_line_true_color(lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, + lv_coord_t len, uint8_t * buf) +{ + lv_img_decoder_built_in_data_t * user_data = dsc->user_data; + lv_fs_res_t res; + uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf); + + uint32_t pos = ((y * dsc->header.w + x) * px_size) >> 3; + pos += 4; /*Skip the header*/ + res = lv_fs_seek(&user_data->f, pos, LV_FS_SEEK_SET); + if(res != LV_FS_RES_OK) { + LV_LOG_WARN("Built-in image decoder seek failed"); + return LV_RES_INV; + } + uint32_t btr = len * (px_size >> 3); + uint32_t br = 0; + res = lv_fs_read(&user_data->f, buf, btr, &br); + if(res != LV_FS_RES_OK || btr != br) { + LV_LOG_WARN("Built-in image decoder read failed"); + return LV_RES_INV; + } + + return LV_RES_OK; +} + +static lv_res_t lv_img_decoder_built_in_line_alpha(lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, + lv_coord_t len, uint8_t * buf) +{ + const lv_opa_t alpha1_opa_table[2] = {0, 255}; /*Opacity mapping with bpp = 1 (Just for compatibility)*/ + const lv_opa_t alpha2_opa_table[4] = {0, 85, 170, 255}; /*Opacity mapping with bpp = 2*/ + const lv_opa_t alpha4_opa_table[16] = {0, 17, 34, 51, /*Opacity mapping with bpp = 4*/ + 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255 + }; + + /*Simply fill the buffer with the color. Later only the alpha value will be modified.*/ + lv_color_t bg_color = dsc->color; + lv_coord_t i; + for(i = 0; i < len; i++) { +#if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1 + buf[i * LV_IMG_PX_SIZE_ALPHA_BYTE] = bg_color.full; +#elif LV_COLOR_DEPTH == 16 + /*Because of Alpha byte 16 bit color can start on odd address which can cause crash*/ + buf[i * LV_IMG_PX_SIZE_ALPHA_BYTE] = bg_color.full & 0xFF; + buf[i * LV_IMG_PX_SIZE_ALPHA_BYTE + 1] = (bg_color.full >> 8) & 0xFF; +#elif LV_COLOR_DEPTH == 32 + *((uint32_t *)&buf[i * LV_IMG_PX_SIZE_ALPHA_BYTE]) = bg_color.full; +#else +#error "Invalid LV_COLOR_DEPTH. Check it in lv_conf.h" +#endif + } + + const lv_opa_t * opa_table = NULL; + uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf); + uint16_t mask = (1 << px_size) - 1; /*E.g. px_size = 2; mask = 0x03*/ + + lv_coord_t w = 0; + uint32_t ofs = 0; + int8_t pos = 0; + switch(dsc->header.cf) { + case LV_IMG_CF_ALPHA_1BIT: + w = (dsc->header.w + 7) >> 3; /*E.g. w = 20 -> w = 2 + 1*/ + ofs += w * y + (x >> 3); /*First pixel*/ + pos = 7 - (x & 0x7); + opa_table = alpha1_opa_table; + break; + case LV_IMG_CF_ALPHA_2BIT: + w = (dsc->header.w + 3) >> 2; /*E.g. w = 13 -> w = 3 + 1 (bytes)*/ + ofs += w * y + (x >> 2); /*First pixel*/ + pos = 6 - (x & 0x3) * 2; + opa_table = alpha2_opa_table; + break; + case LV_IMG_CF_ALPHA_4BIT: + w = (dsc->header.w + 1) >> 1; /*E.g. w = 13 -> w = 6 + 1 (bytes)*/ + ofs += w * y + (x >> 1); /*First pixel*/ + pos = 4 - (x & 0x1) * 4; + opa_table = alpha4_opa_table; + break; + case LV_IMG_CF_ALPHA_8BIT: + w = dsc->header.w; /*E.g. x = 7 -> w = 7 (bytes)*/ + ofs += w * y + x; /*First pixel*/ + pos = 0; + break; + } + + lv_img_decoder_built_in_data_t * user_data = dsc->user_data; + uint8_t * fs_buf = lv_mem_buf_get(w); + if(fs_buf == NULL) return LV_RES_INV; + + const uint8_t * data_tmp = NULL; + if(dsc->src_type == LV_IMG_SRC_VARIABLE) { + const lv_img_dsc_t * img_dsc = dsc->src; + + data_tmp = img_dsc->data + ofs; + } + else { + lv_fs_seek(&user_data->f, ofs + 4, LV_FS_SEEK_SET); /*+4 to skip the header*/ + lv_fs_read(&user_data->f, fs_buf, w, NULL); + data_tmp = fs_buf; + } + + for(i = 0; i < len; i++) { + uint8_t val_act = (*data_tmp >> pos) & mask; + + buf[i * LV_IMG_PX_SIZE_ALPHA_BYTE + LV_IMG_PX_SIZE_ALPHA_BYTE - 1] = + dsc->header.cf == LV_IMG_CF_ALPHA_8BIT ? val_act : opa_table[val_act]; + + pos -= px_size; + if(pos < 0) { + pos = 8 - px_size; + data_tmp++; + } + } + lv_mem_buf_release(fs_buf); + return LV_RES_OK; +} + +static lv_res_t lv_img_decoder_built_in_line_indexed(lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, + lv_coord_t len, uint8_t * buf) +{ + uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf); + uint16_t mask = (1 << px_size) - 1; /*E.g. px_size = 2; mask = 0x03*/ + + lv_coord_t w = 0; + int8_t pos = 0; + uint32_t ofs = 0; + switch(dsc->header.cf) { + case LV_IMG_CF_INDEXED_1BIT: + w = (dsc->header.w + 7) >> 3; /*E.g. w = 20 -> w = 2 + 1*/ + ofs += w * y + (x >> 3); /*First pixel*/ + ofs += 8; /*Skip the palette*/ + pos = 7 - (x & 0x7); + break; + case LV_IMG_CF_INDEXED_2BIT: + w = (dsc->header.w + 3) >> 2; /*E.g. w = 13 -> w = 3 + 1 (bytes)*/ + ofs += w * y + (x >> 2); /*First pixel*/ + ofs += 16; /*Skip the palette*/ + pos = 6 - (x & 0x3) * 2; + break; + case LV_IMG_CF_INDEXED_4BIT: + w = (dsc->header.w + 1) >> 1; /*E.g. w = 13 -> w = 6 + 1 (bytes)*/ + ofs += w * y + (x >> 1); /*First pixel*/ + ofs += 64; /*Skip the palette*/ + pos = 4 - (x & 0x1) * 4; + break; + case LV_IMG_CF_INDEXED_8BIT: + w = dsc->header.w; /*E.g. x = 7 -> w = 7 (bytes)*/ + ofs += w * y + x; /*First pixel*/ + ofs += 1024; /*Skip the palette*/ + pos = 0; + break; + } + + lv_img_decoder_built_in_data_t * user_data = dsc->user_data; + + uint8_t * fs_buf = lv_mem_buf_get(w); + if(fs_buf == NULL) return LV_RES_INV; + const uint8_t * data_tmp = NULL; + if(dsc->src_type == LV_IMG_SRC_VARIABLE) { + const lv_img_dsc_t * img_dsc = dsc->src; + data_tmp = img_dsc->data + ofs; + } + else { + lv_fs_seek(&user_data->f, ofs + 4, LV_FS_SEEK_SET); /*+4 to skip the header*/ + lv_fs_read(&user_data->f, fs_buf, w, NULL); + data_tmp = fs_buf; + } + + lv_coord_t i; + for(i = 0; i < len; i++) { + uint8_t val_act = (*data_tmp >> pos) & mask; + + lv_color_t color = user_data->palette[val_act]; +#if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1 + buf[i * LV_IMG_PX_SIZE_ALPHA_BYTE] = color.full; +#elif LV_COLOR_DEPTH == 16 + /*Because of Alpha byte 16 bit color can start on odd address which can cause crash*/ + buf[i * LV_IMG_PX_SIZE_ALPHA_BYTE] = color.full & 0xFF; + buf[i * LV_IMG_PX_SIZE_ALPHA_BYTE + 1] = (color.full >> 8) & 0xFF; +#elif LV_COLOR_DEPTH == 32 + *((uint32_t *)&buf[i * LV_IMG_PX_SIZE_ALPHA_BYTE]) = color.full; +#else +#error "Invalid LV_COLOR_DEPTH. Check it in lv_conf.h" +#endif + buf[i * LV_IMG_PX_SIZE_ALPHA_BYTE + LV_IMG_PX_SIZE_ALPHA_BYTE - 1] = user_data->opa[val_act]; + + pos -= px_size; + if(pos < 0) { + pos = 8 - px_size; + data_tmp++; + } + } + lv_mem_buf_release(fs_buf); + return LV_RES_OK; +} diff --git a/L3_Middlewares/LVGL/src/draw/lv_img_decoder.h b/L3_Middlewares/LVGL/src/draw/lv_img_decoder.h new file mode 100644 index 0000000..9dc84dd --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/lv_img_decoder.h @@ -0,0 +1,274 @@ +/** + * @file lv_img_decoder.h + * + */ + +#ifndef LV_IMG_DECODER_H +#define LV_IMG_DECODER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" + +#include +#include "lv_img_buf.h" +#include "../misc/lv_fs.h" +#include "../misc/lv_types.h" +#include "../misc/lv_area.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/** + * Source of image.*/ +enum { + LV_IMG_SRC_VARIABLE, /** Binary/C variable*/ + LV_IMG_SRC_FILE, /** File in filesystem*/ + LV_IMG_SRC_SYMBOL, /** Symbol (@ref lv_symbol_def.h)*/ + LV_IMG_SRC_UNKNOWN, /** Unknown source*/ +}; + +typedef uint8_t lv_img_src_t; + +/*Decoder function definitions*/ +struct _lv_img_decoder_dsc_t; +struct _lv_img_decoder_t; + +/** + * Get info from an image and store in the `header` + * @param src the image source. Can be a pointer to a C array or a file name (Use + * `lv_img_src_get_type` to determine the type) + * @param header store the info here + * @return LV_RES_OK: info written correctly; LV_RES_INV: failed + */ +typedef lv_res_t (*lv_img_decoder_info_f_t)(struct _lv_img_decoder_t * decoder, const void * src, + lv_img_header_t * header); + +/** + * Open an image for decoding. Prepare it as it is required to read it later + * @param decoder pointer to the decoder the function associated with + * @param dsc pointer to decoder descriptor. `src`, `color` are already initialized in it. + */ +typedef lv_res_t (*lv_img_decoder_open_f_t)(struct _lv_img_decoder_t * decoder, struct _lv_img_decoder_dsc_t * dsc); + +/** + * Decode `len` pixels starting from the given `x`, `y` coordinates and store them in `buf`. + * Required only if the "open" function can't return with the whole decoded pixel array. + * @param decoder pointer to the decoder the function associated with + * @param dsc pointer to decoder descriptor + * @param x start x coordinate + * @param y start y coordinate + * @param len number of pixels to decode + * @param buf a buffer to store the decoded pixels + * @return LV_RES_OK: ok; LV_RES_INV: failed + */ +typedef lv_res_t (*lv_img_decoder_read_line_f_t)(struct _lv_img_decoder_t * decoder, struct _lv_img_decoder_dsc_t * dsc, + lv_coord_t x, lv_coord_t y, lv_coord_t len, uint8_t * buf); + +/** + * Close the pending decoding. Free resources etc. + * @param decoder pointer to the decoder the function associated with + * @param dsc pointer to decoder descriptor + */ +typedef void (*lv_img_decoder_close_f_t)(struct _lv_img_decoder_t * decoder, struct _lv_img_decoder_dsc_t * dsc); + + +typedef struct _lv_img_decoder_t { + lv_img_decoder_info_f_t info_cb; + lv_img_decoder_open_f_t open_cb; + lv_img_decoder_read_line_f_t read_line_cb; + lv_img_decoder_close_f_t close_cb; + +#if LV_USE_USER_DATA + void * user_data; +#endif +} lv_img_decoder_t; + + +/**Describe an image decoding session. Stores data about the decoding*/ +typedef struct _lv_img_decoder_dsc_t { + /**The decoder which was able to open the image source*/ + lv_img_decoder_t * decoder; + + /**The image source. A file path like "S:my_img.png" or pointer to an `lv_img_dsc_t` variable*/ + const void * src; + + /**Color to draw the image. USed when the image has alpha channel only*/ + lv_color_t color; + + /**Frame of the image, using with animated images*/ + int32_t frame_id; + + /**Type of the source: file or variable. Can be set in `open` function if required*/ + lv_img_src_t src_type; + + /**Info about the opened image: color format, size, etc. MUST be set in `open` function*/ + lv_img_header_t header; + + /** Pointer to a buffer where the image's data (pixels) are stored in a decoded, plain format. + * MUST be set in `open` function*/ + const uint8_t * img_data; + + /** How much time did it take to open the image. [ms] + * If not set `lv_img_cache` will measure and set the time to open*/ + uint32_t time_to_open; + + /**A text to display instead of the image when the image can't be opened. + * Can be set in `open` function or set NULL.*/ + const char * error_msg; + + /**Store any custom data here is required*/ + void * user_data; +} lv_img_decoder_dsc_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Initialize the image decoder module + */ +void _lv_img_decoder_init(void); + +/** + * Get information about an image. + * Try the created image decoder one by one. Once one is able to get info that info will be used. + * @param src the image source. Can be + * 1) File name: E.g. "S:folder/img1.png" (The drivers needs to registered via `lv_fs_drv_register()`) + * 2) Variable: Pointer to an `lv_img_dsc_t` variable + * 3) Symbol: E.g. `LV_SYMBOL_OK` + * @param header the image info will be stored here + * @return LV_RES_OK: success; LV_RES_INV: wasn't able to get info about the image + */ +lv_res_t lv_img_decoder_get_info(const void * src, lv_img_header_t * header); + +/** + * Open an image. + * Try the created image decoders one by one. Once one is able to open the image that decoder is saved in `dsc` + * @param dsc describes a decoding session. Simply a pointer to an `lv_img_decoder_dsc_t` variable. + * @param src the image source. Can be + * 1) File name: E.g. "S:folder/img1.png" (The drivers needs to registered via `lv_fs_drv_register())`) + * 2) Variable: Pointer to an `lv_img_dsc_t` variable + * 3) Symbol: E.g. `LV_SYMBOL_OK` + * @param color The color of the image with `LV_IMG_CF_ALPHA_...` + * @param frame_id the index of the frame. Used only with animated images, set 0 for normal images + * @return LV_RES_OK: opened the image. `dsc->img_data` and `dsc->header` are set. + * LV_RES_INV: none of the registered image decoders were able to open the image. + */ +lv_res_t lv_img_decoder_open(lv_img_decoder_dsc_t * dsc, const void * src, lv_color_t color, int32_t frame_id); + +/** + * Read a line from an opened image + * @param dsc pointer to `lv_img_decoder_dsc_t` used in `lv_img_decoder_open` + * @param x start X coordinate (from left) + * @param y start Y coordinate (from top) + * @param len number of pixels to read + * @param buf store the data here + * @return LV_RES_OK: success; LV_RES_INV: an error occurred + */ +lv_res_t lv_img_decoder_read_line(lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_coord_t len, + uint8_t * buf); + +/** + * Close a decoding session + * @param dsc pointer to `lv_img_decoder_dsc_t` used in `lv_img_decoder_open` + */ +void lv_img_decoder_close(lv_img_decoder_dsc_t * dsc); + +/** + * Create a new image decoder + * @return pointer to the new image decoder + */ +lv_img_decoder_t * lv_img_decoder_create(void); + +/** + * Delete an image decoder + * @param decoder pointer to an image decoder + */ +void lv_img_decoder_delete(lv_img_decoder_t * decoder); + +/** + * Set a callback to get information about the image + * @param decoder pointer to an image decoder + * @param info_cb a function to collect info about an image (fill an `lv_img_header_t` struct) + */ +void lv_img_decoder_set_info_cb(lv_img_decoder_t * decoder, lv_img_decoder_info_f_t info_cb); + +/** + * Set a callback to open an image + * @param decoder pointer to an image decoder + * @param open_cb a function to open an image + */ +void lv_img_decoder_set_open_cb(lv_img_decoder_t * decoder, lv_img_decoder_open_f_t open_cb); + +/** + * Set a callback to a decoded line of an image + * @param decoder pointer to an image decoder + * @param read_line_cb a function to read a line of an image + */ +void lv_img_decoder_set_read_line_cb(lv_img_decoder_t * decoder, lv_img_decoder_read_line_f_t read_line_cb); + +/** + * Set a callback to close a decoding session. E.g. close files and free other resources. + * @param decoder pointer to an image decoder + * @param close_cb a function to close a decoding session + */ +void lv_img_decoder_set_close_cb(lv_img_decoder_t * decoder, lv_img_decoder_close_f_t close_cb); + +/** + * Get info about a built-in image + * @param decoder the decoder where this function belongs + * @param src the image source: pointer to an `lv_img_dsc_t` variable, a file path or a symbol + * @param header store the image data here + * @return LV_RES_OK: the info is successfully stored in `header`; LV_RES_INV: unknown format or other error. + */ +lv_res_t lv_img_decoder_built_in_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header); + +/** + * Open a built in image + * @param decoder the decoder where this function belongs + * @param dsc pointer to decoder descriptor. `src`, `style` are already initialized in it. + * @return LV_RES_OK: the info is successfully stored in `header`; LV_RES_INV: unknown format or other error. + */ +lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc); + +/** + * Decode `len` pixels starting from the given `x`, `y` coordinates and store them in `buf`. + * Required only if the "open" function can't return with the whole decoded pixel array. + * @param decoder pointer to the decoder the function associated with + * @param dsc pointer to decoder descriptor + * @param x start x coordinate + * @param y start y coordinate + * @param len number of pixels to decode + * @param buf a buffer to store the decoded pixels + * @return LV_RES_OK: ok; LV_RES_INV: failed + */ +lv_res_t lv_img_decoder_built_in_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, lv_coord_t x, + lv_coord_t y, lv_coord_t len, uint8_t * buf); + +/** + * Close the pending decoding. Free resources etc. + * @param decoder pointer to the decoder the function associated with + * @param dsc pointer to decoder descriptor + */ +void lv_img_decoder_built_in_close(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_IMG_DECODER_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/lv_draw_nxp.mk b/L3_Middlewares/LVGL/src/draw/nxp/lv_draw_nxp.mk new file mode 100644 index 0000000..18a751e --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/lv_draw_nxp.mk @@ -0,0 +1,7 @@ +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp" + +include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp/pxp/lv_draw_nxp_pxp.mk +include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp/vglite/lv_draw_nxp_vglite.mk diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_buf_pxp.c b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_buf_pxp.c deleted file mode 100644 index 9819cfc..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_buf_pxp.c +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @file lv_draw_buf_pxp.c - * - */ - -/** - * Copyright 2023-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_pxp.h" - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP -#include "../../lv_draw_buf_private.h" -#include "lv_pxp_cfg.h" -#include "lv_pxp_utils.h" - -#include "lvgl_support.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void _invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_buf_pxp_init_handlers(void) -{ - lv_draw_buf_handlers_t * handlers = lv_draw_buf_get_handlers(); - lv_draw_buf_handlers_t * font_handlers = lv_draw_buf_get_font_handlers(); - lv_draw_buf_handlers_t * image_handlers = lv_draw_buf_get_image_handlers(); - - handlers->invalidate_cache_cb = _invalidate_cache; - font_handlers->invalidate_cache_cb = _invalidate_cache; - image_handlers->invalidate_cache_cb = _invalidate_cache; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void _invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area) -{ - const lv_image_header_t * header = &draw_buf->header; - uint32_t stride = header->stride; - lv_color_format_t cf = header->cf; - - if(area->y1 == 0) { - uint32_t size = stride * lv_area_get_height(area); - - /* Invalidate full buffer. */ - DEMO_CleanInvalidateCacheByAddr((void *)draw_buf->data, size); - return; - } - - const uint8_t * buf_u8 = draw_buf->data; - /* ARM require a 32 byte aligned address. */ - uint8_t align_bytes = 32; - uint8_t bits_per_pixel = lv_color_format_get_bpp(cf); - - uint16_t align_pixels = align_bytes * 8 / bits_per_pixel; - uint16_t offset_x = 0; - - if(area->x1 >= (int32_t)(area->x1 % align_pixels)) { - uint16_t shift_x = area->x1 - (area->x1 % align_pixels); - - offset_x = area->x1 - shift_x; - buf_u8 += (shift_x * bits_per_pixel) / 8; - } - - if(area->y1) { - uint16_t shift_y = area->y1; - - buf_u8 += shift_y * stride; - } - - /* Area to clear can start from a different offset in buffer. - * Invalidate the area line by line. - */ - uint16_t line_pixels = offset_x + lv_area_get_width(area); - uint16_t line_size = (line_pixels * bits_per_pixel) / 8; - uint16_t area_height = lv_area_get_height(area); - - for(uint16_t y = 0; y < area_height; y++) { - const void * line_addr = buf_u8 + y * stride; - - DEMO_CleanInvalidateCacheByAddr((void *)line_addr, line_size); - } -} - -#endif /*LV_USE_DRAW_PXP*/ -#endif /*LV_USE_PXP*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_nxp_pxp.mk b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_nxp_pxp.mk new file mode 100644 index 0000000..5c684bc --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_nxp_pxp.mk @@ -0,0 +1,9 @@ +CSRCS += lv_draw_pxp.c +CSRCS += lv_draw_pxp_blend.c +CSRCS += lv_gpu_nxp_pxp_osa.c +CSRCS += lv_gpu_nxp_pxp.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp/pxp +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp/pxp + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp/pxp" diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp.c b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp.c index 636fe43..cd70f48 100644 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp.c +++ b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp.c @@ -4,9 +4,27 @@ */ /** - * Copyright 2022-2024 NXP + * MIT License + * + * Copyright 2022, 2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * SPDX-License-Identifier: MIT */ /********************* @@ -15,20 +33,21 @@ #include "lv_draw_pxp.h" -#if LV_USE_PXP -#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP -#include "lv_pxp_cfg.h" -#include "lv_pxp_utils.h" +#if LV_USE_GPU_NXP_PXP +#include "lv_draw_pxp_blend.h" -#if LV_USE_PARALLEL_DRAW_DEBUG - #include "../../../core/lv_global.h" +#if LV_COLOR_DEPTH != 32 + #include "../../../core/lv_refr.h" #endif /********************* * DEFINES *********************/ -#define DRAW_UNIT_ID_PXP 3 +/* Minimum area (in pixels) for PXP blit/fill processing. */ +#ifndef LV_GPU_NXP_PXP_SIZE_LIMIT + #define LV_GPU_NXP_PXP_SIZE_LIMIT 5000 +#endif /********************** * TYPEDEFS @@ -38,41 +57,21 @@ * STATIC PROTOTYPES **********************/ -/* - * Evaluate a task and set the score and preferred PXP unit. - * Return 1 if task is preferred, 0 otherwise (task is not supported). - */ -static int32_t _pxp_evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task); +static void lv_draw_pxp_wait_for_finish(lv_draw_ctx_t * draw_ctx); -/* - * Dispatch a task to the PXP unit. - * Return 1 if task was dispatched, 0 otherwise (task not supported). - */ -static int32_t _pxp_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer); +static void lv_draw_pxp_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc); -/* - * Delete the PXP draw unit. - */ -static int32_t _pxp_delete(lv_draw_unit_t * draw_unit); +static void lv_draw_pxp_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, + const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t cf); -#if LV_USE_PXP_DRAW_THREAD - static void _pxp_render_thread_cb(void * ptr); -#endif - -static void _pxp_execute_drawing(lv_draw_pxp_unit_t * u); - -/********************** - * STATIC PROTOTYPES - **********************/ +static void lv_draw_pxp_buffer_copy(lv_draw_ctx_t * draw_ctx, + void * dest_buf, lv_coord_t dest_stride, const lv_area_t * dest_area, + void * src_buf, lv_coord_t src_stride, const lv_area_t * src_area); /********************** * STATIC VARIABLES **********************/ -#if LV_USE_PARALLEL_DRAW_DEBUG - #define _draw_info LV_GLOBAL_DEFAULT()->draw_info -#endif - /********************** * MACROS **********************/ @@ -81,418 +80,196 @@ static void _pxp_execute_drawing(lv_draw_pxp_unit_t * u); * GLOBAL FUNCTIONS **********************/ -void lv_draw_pxp_init(void) +void lv_draw_pxp_ctx_init(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) { - lv_pxp_init(); - -#if LV_USE_DRAW_PXP - lv_draw_buf_pxp_init_handlers(); + lv_draw_sw_init_ctx(drv, draw_ctx); - lv_draw_pxp_unit_t * draw_pxp_unit = lv_draw_create_unit(sizeof(lv_draw_pxp_unit_t)); - draw_pxp_unit->base_unit.evaluate_cb = _pxp_evaluate; - draw_pxp_unit->base_unit.dispatch_cb = _pxp_dispatch; - draw_pxp_unit->base_unit.delete_cb = _pxp_delete; - -#if LV_USE_PXP_DRAW_THREAD - lv_thread_init(&draw_pxp_unit->thread, LV_THREAD_PRIO_HIGH, _pxp_render_thread_cb, 2 * 1024, draw_pxp_unit); -#endif -#endif /*LV_USE_DRAW_PXP*/ -} - -void lv_draw_pxp_deinit(void) -{ - lv_pxp_deinit(); + lv_draw_pxp_ctx_t * pxp_draw_ctx = (lv_draw_sw_ctx_t *)draw_ctx; + pxp_draw_ctx->base_draw.draw_img_decoded = lv_draw_pxp_img_decoded; + pxp_draw_ctx->blend = lv_draw_pxp_blend; + pxp_draw_ctx->base_draw.wait_for_finish = lv_draw_pxp_wait_for_finish; + pxp_draw_ctx->base_draw.buffer_copy = lv_draw_pxp_buffer_copy; } -void lv_draw_pxp_rotate(const void * src_buf, void * dest_buf, int32_t src_width, int32_t src_height, - int32_t src_stride, int32_t dest_stride, lv_display_rotation_t rotation, - lv_color_format_t cf) +void lv_draw_pxp_ctx_deinit(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) { - lv_pxp_reset(); - - /* Convert rotation angle - * To be in sync with CPU, the received angle is counterclockwise - * and the PXP constants are for clockwise rotation - * - * counterclockwise clockwise - * LV_DISPLAY_ROTATION_90 -> kPXP_Rotate270 - * LV_DISPLAY_ROTATION_270 -> kPXP_Rotate90 - */ - pxp_rotate_degree_t pxp_rotation; - switch(rotation) { - case LV_DISPLAY_ROTATION_0: - pxp_rotation = kPXP_Rotate0; - break; - case LV_DISPLAY_ROTATION_270: - pxp_rotation = kPXP_Rotate90; - break; - case LV_DISPLAY_ROTATION_180: - pxp_rotation = kPXP_Rotate180; - break; - case LV_DISPLAY_ROTATION_90: - pxp_rotation = kPXP_Rotate270; - break; - default: - pxp_rotation = kPXP_Rotate0; - break; - } - PXP_SetRotateConfig(PXP_ID, kPXP_RotateOutputBuffer, pxp_rotation, kPXP_FlipDisable); - - /*Simple blit, no effect - Disable PS buffer*/ - PXP_SetProcessSurfacePosition(PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); - - /*AS buffer - source image*/ - pxp_as_buffer_config_t asBufferConfig = { - .pixelFormat = pxp_get_as_px_format(cf), - .bufferAddr = (uint32_t)src_buf, - .pitchBytes = src_stride - }; - PXP_SetAlphaSurfaceBufferConfig(PXP_ID, &asBufferConfig); - PXP_SetAlphaSurfacePosition(PXP_ID, 0U, 0U, src_width - 1U, src_height - 1U); - PXP_EnableAlphaSurfaceOverlayColorKey(PXP_ID, false); - - /*Output buffer.*/ - pxp_output_buffer_config_t outputBufferConfig = { - .pixelFormat = pxp_get_out_px_format(cf), - .interlacedMode = kPXP_OutputProgressive, - .buffer0Addr = (uint32_t)dest_buf, - .buffer1Addr = (uint32_t)0U, - .pitchBytes = dest_stride, - .width = src_width, - .height = src_height - }; - PXP_SetOutputBufferConfig(PXP_ID, &outputBufferConfig); - - lv_pxp_run(); + lv_draw_sw_deinit_ctx(drv, draw_ctx); } /********************** * STATIC FUNCTIONS **********************/ -#if LV_USE_DRAW_PXP -static inline bool _pxp_src_cf_supported(lv_color_format_t cf) -{ - bool is_cf_supported = false; - - switch(cf) { - case LV_COLOR_FORMAT_RGB565: - case LV_COLOR_FORMAT_ARGB8888: - case LV_COLOR_FORMAT_XRGB8888: - is_cf_supported = true; - break; - default: - break; - } - return is_cf_supported; -} - -static inline bool _pxp_dest_cf_supported(lv_color_format_t cf) +/** + * During rendering, LVGL might initializes new draw_ctxs and start drawing into + * a separate buffer (called layer). If the content to be rendered has "holes", + * e.g. rounded corner, LVGL temporarily sets the disp_drv.screen_transp flag. + * It means the renderers should draw into an ARGB buffer. + * With 32 bit color depth it's not a big problem but with 16 bit color depth + * the target pixel format is ARGB8565 which is not supported by the GPU. + * In this case, the PXP callbacks should fallback to SW rendering. + */ +static inline bool need_argb8565_support() { - bool is_cf_supported = false; - - switch(cf) { - case LV_COLOR_FORMAT_RGB565: - case LV_COLOR_FORMAT_RGB888: - case LV_COLOR_FORMAT_ARGB8888: - case LV_COLOR_FORMAT_XRGB8888: - is_cf_supported = true; - break; - default: - break; - } +#if LV_COLOR_DEPTH != 32 + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); - return is_cf_supported; -} + if(disp->driver->screen_transp == 1) + return true; +#endif -static bool _pxp_draw_img_supported(const lv_draw_image_dsc_t * draw_dsc) -{ - const lv_image_dsc_t * img_dsc = draw_dsc->src; - - bool has_recolor = (draw_dsc->recolor_opa > LV_OPA_MIN); - bool has_transform = (draw_dsc->rotation != 0 || draw_dsc->scale_x != LV_SCALE_NONE || - draw_dsc->scale_y != LV_SCALE_NONE); - - /* Recolor and transformation are not supported at the same time. */ - if(has_recolor && has_transform) - return false; - - bool has_opa = (draw_dsc->opa < (lv_opa_t)LV_OPA_MAX); - bool src_has_alpha = (img_dsc->header.cf == LV_COLOR_FORMAT_ARGB8888); - - /* - * Recolor or transformation for images w/ opa or alpha channel can't - * be obtained in a single PXP configuration. Two steps are required. - */ - if((has_recolor || has_transform) && (has_opa || src_has_alpha)) - return false; - - /* PXP can only rotate at 90x angles. */ - if(draw_dsc->rotation % 900) - return false; - - /* - * PXP is set to process 16x16 blocks to optimize the system for memory - * bandwidth and image processing time. - * The output engine essentially truncates any output pixels after the - * desired number of pixels has been written. - * When rotating a source image and the output is not divisible by the block - * size, the incorrect pixels could be truncated and the final output image - * can look shifted. - * - * No combination of rotate with flip, scaling or decimation is possible - * if buffer is unaligned. - */ - if(has_transform && (img_dsc->header.w % 16 || img_dsc->header.h % 16)) - return false; - - return true; + return false; } -static int32_t _pxp_evaluate(lv_draw_unit_t * u, lv_draw_task_t * t) +static void lv_draw_pxp_wait_for_finish(lv_draw_ctx_t * draw_ctx) { - LV_UNUSED(u); - - const lv_draw_dsc_base_t * draw_dsc_base = (lv_draw_dsc_base_t *) t->draw_dsc; - - if(!_pxp_dest_cf_supported(draw_dsc_base->layer->color_format)) - return 0; - - switch(t->type) { - case LV_DRAW_TASK_TYPE_FILL: { - const lv_draw_fill_dsc_t * draw_dsc = (lv_draw_fill_dsc_t *) t->draw_dsc; - - /* Most simple case: just a plain rectangle (no radius, no gradient). */ - if((draw_dsc->radius != 0) || (draw_dsc->grad.dir != (lv_grad_dir_t)LV_GRAD_DIR_NONE)) - return 0; - - if(t->preference_score > 70) { - t->preference_score = 70; - t->preferred_draw_unit_id = DRAW_UNIT_ID_PXP; - } - return 1; - } - - case LV_DRAW_TASK_TYPE_LAYER: { - const lv_draw_image_dsc_t * draw_dsc = (lv_draw_image_dsc_t *) t->draw_dsc; - lv_layer_t * layer_to_draw = (lv_layer_t *)draw_dsc->src; - - if(!_pxp_src_cf_supported(layer_to_draw->color_format)) - return 0; - - if(!_pxp_draw_img_supported(draw_dsc)) - return 0; - - if(t->preference_score > 70) { - t->preference_score = 70; - t->preferred_draw_unit_id = DRAW_UNIT_ID_PXP; - } - return 1; - } - - case LV_DRAW_TASK_TYPE_IMAGE: { - lv_draw_image_dsc_t * draw_dsc = (lv_draw_image_dsc_t *) t->draw_dsc; - const lv_image_dsc_t * img_dsc = draw_dsc->src; - - if(draw_dsc->tile) - return 0; - - if((!_pxp_src_cf_supported(img_dsc->header.cf)) || - (!pxp_buf_aligned(img_dsc->data, img_dsc->header.stride))) - return 0; - - if(!_pxp_draw_img_supported(draw_dsc)) - return 0; - - if(t->preference_score > 70) { - t->preference_score = 70; - t->preferred_draw_unit_id = DRAW_UNIT_ID_PXP; - } - return 1; - } - default: - return 0; - } + lv_gpu_nxp_pxp_wait(); - return 0; + lv_draw_sw_wait_for_finish(draw_ctx); } -static int32_t _pxp_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer) +static void lv_draw_pxp_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc) { - lv_draw_pxp_unit_t * draw_pxp_unit = (lv_draw_pxp_unit_t *) draw_unit; - - /* Return immediately if it's busy with draw task. */ - if(draw_pxp_unit->task_act) - return 0; - - /* Try to get an ready to draw. */ - lv_draw_task_t * t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_PXP); - - if(t == NULL || t->preferred_draw_unit_id != DRAW_UNIT_ID_PXP) - return LV_DRAW_UNIT_IDLE; - - if(lv_draw_layer_alloc_buf(layer) == NULL) - return LV_DRAW_UNIT_IDLE; + if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) + return; - t->state = LV_DRAW_TASK_STATE_IN_PROGRESS; - draw_pxp_unit->base_unit.target_layer = layer; - draw_pxp_unit->base_unit.clip_area = &t->clip_area; - draw_pxp_unit->task_act = t; + if(need_argb8565_support()) { + lv_draw_sw_blend_basic(draw_ctx, dsc); + return; + } -#if LV_USE_PXP_DRAW_THREAD - /* Let the render thread work. */ - if(draw_pxp_unit->inited) - lv_thread_sync_signal(&draw_pxp_unit->sync); -#else - _pxp_execute_drawing(draw_pxp_unit); + lv_area_t blend_area; + /*Let's get the blend area which is the intersection of the area to draw and the clip area*/ + if(!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area)) + return; /*Fully clipped, nothing to do*/ - draw_pxp_unit->task_act->state = LV_DRAW_TASK_STATE_READY; - draw_pxp_unit->task_act = NULL; + /*Make the blend area relative to the buffer*/ + lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + if(dsc->mask_buf != NULL || dsc->blend_mode != LV_BLEND_MODE_NORMAL || + lv_area_get_size(&blend_area) < LV_GPU_NXP_PXP_SIZE_LIMIT) { + lv_draw_sw_blend_basic(draw_ctx, dsc); + return; + } - /* The draw unit is free now. Request a new dispatching as it can get a new task. */ - lv_draw_dispatch_request(); -#endif + /*Fill/Blend only non masked, normal blended*/ + lv_color_t * dest_buf = draw_ctx->buf; + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); + const lv_color_t * src_buf = dsc->src_buf; - return 1; + if(src_buf == NULL) { + lv_gpu_nxp_pxp_fill(dest_buf, &blend_area, dest_stride, dsc->color, dsc->opa); + } + else { + lv_area_t src_area; + src_area.x1 = blend_area.x1 - (dsc->blend_area->x1 - draw_ctx->buf_area->x1); + src_area.y1 = blend_area.y1 - (dsc->blend_area->y1 - draw_ctx->buf_area->y1); + src_area.x2 = src_area.x1 + lv_area_get_width(dsc->blend_area) - 1; + src_area.y2 = src_area.y1 + lv_area_get_height(dsc->blend_area) - 1; + lv_coord_t src_stride = lv_area_get_width(dsc->blend_area); + + lv_gpu_nxp_pxp_blit(dest_buf, &blend_area, dest_stride, src_buf, &src_area, src_stride, + dsc->opa, LV_DISP_ROT_NONE); + } } -static int32_t _pxp_delete(lv_draw_unit_t * draw_unit) +static void lv_draw_pxp_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, + const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t cf) { -#if LV_USE_PXP_DRAW_THREAD - lv_draw_pxp_unit_t * draw_pxp_unit = (lv_draw_pxp_unit_t *) draw_unit; + if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) + return; - LV_LOG_INFO("Cancel PXP draw thread."); - draw_pxp_unit->exit_status = true; - - if(draw_pxp_unit->inited) - lv_thread_sync_signal(&draw_pxp_unit->sync); + if(need_argb8565_support()) { + lv_draw_sw_img_decoded(draw_ctx, dsc, coords, map_p, cf); + return; + } - lv_result_t res = lv_thread_delete(&draw_pxp_unit->thread); + const lv_color_t * src_buf = (const lv_color_t *)map_p; + if(!src_buf) { + lv_draw_sw_img_decoded(draw_ctx, dsc, coords, map_p, cf); + return; + } - return res; -#else - LV_UNUSED(draw_unit); + lv_area_t rel_coords; + lv_area_copy(&rel_coords, coords); + lv_area_move(&rel_coords, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); - return 0; -#endif -} + lv_area_t rel_clip_area; + lv_area_copy(&rel_clip_area, draw_ctx->clip_area); + lv_area_move(&rel_clip_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); -static void _pxp_execute_drawing(lv_draw_pxp_unit_t * u) -{ - lv_draw_task_t * t = u->task_act; - lv_draw_unit_t * draw_unit = (lv_draw_unit_t *)u; - lv_layer_t * layer = draw_unit->target_layer; - lv_draw_buf_t * draw_buf = layer->draw_buf; + bool has_scale = (dsc->zoom != LV_IMG_ZOOM_NONE); + bool has_rotation = (dsc->angle != 0); + bool unsup_rotation = false; - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, &t->area, draw_unit->clip_area)) + lv_area_t blend_area; + if(has_rotation) + lv_area_copy(&blend_area, &rel_coords); + else if(!_lv_area_intersect(&blend_area, &rel_coords, &rel_clip_area)) return; /*Fully clipped, nothing to do*/ - /* Make area relative to the buffer */ - lv_area_move(&draw_area, -layer->buf_area.x1, -layer->buf_area.y1); - - /* Invalidate only the drawing area */ - lv_draw_buf_invalidate_cache(draw_buf, &draw_area); - - switch(t->type) { - case LV_DRAW_TASK_TYPE_FILL: - lv_draw_pxp_fill(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_IMAGE: - lv_draw_pxp_img(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_LAYER: - lv_draw_pxp_layer(draw_unit, t->draw_dsc, &t->area); - break; - default: - break; - } + bool has_mask = lv_draw_mask_is_any(&blend_area); + lv_coord_t src_width = lv_area_get_width(coords); + lv_coord_t src_height = lv_area_get_height(coords); + + if(has_rotation) { + /* + * PXP can only rotate at 90x angles. + */ + if(dsc->angle % 900) { + PXP_LOG_TRACE("Rotation angle %d is not supported. PXP can rotate only 90x angle.", dsc->angle); + unsup_rotation = true; + } -#if LV_USE_PARALLEL_DRAW_DEBUG - /*Layers manage it for themselves*/ - if(t->type != LV_DRAW_TASK_TYPE_LAYER) { - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, &t->area, u->base_unit.clip_area)) - return; - - int32_t idx = 0; - lv_draw_unit_t * draw_unit_tmp = _draw_info.unit_head; - while(draw_unit_tmp != (lv_draw_unit_t *)u) { - draw_unit_tmp = draw_unit_tmp->next; - idx++; + /* + * PXP is set to process 16x16 blocks to optimize the system for memory + * bandwidth and image processing time. + * The output engine essentially truncates any output pixels after the + * desired number of pixels has been written. + * When rotating a source image and the output is not divisible by the block + * size, the incorrect pixels could be truncated and the final output image + * can look shifted. + */ + if(src_width % 16 || src_height % 16) { + PXP_LOG_TRACE("Rotation is not supported for image w/o alignment to block size 16x16."); + unsup_rotation = true; } - lv_draw_rect_dsc_t rect_dsc; - lv_draw_rect_dsc_init(&rect_dsc); - rect_dsc.bg_color = lv_palette_main(idx % LV_PALETTE_LAST); - rect_dsc.border_color = rect_dsc.bg_color; - rect_dsc.bg_opa = LV_OPA_10; - rect_dsc.border_opa = LV_OPA_80; - rect_dsc.border_width = 1; - lv_draw_sw_fill((lv_draw_unit_t *)u, &rect_dsc, &draw_area); - - lv_point_t txt_size; - lv_text_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE); - - lv_area_t txt_area; - txt_area.x1 = draw_area.x1; - txt_area.y1 = draw_area.y1; - txt_area.x2 = draw_area.x1 + txt_size.x - 1; - txt_area.y2 = draw_area.y1 + txt_size.y - 1; - - lv_draw_rect_dsc_init(&rect_dsc); - rect_dsc.bg_color = lv_color_white(); - lv_draw_sw_fill((lv_draw_unit_t *)u, &rect_dsc, &txt_area); - - char buf[8]; - lv_snprintf(buf, sizeof(buf), "%d", idx); - lv_draw_label_dsc_t label_dsc; - lv_draw_label_dsc_init(&label_dsc); - label_dsc.color = lv_color_black(); - label_dsc.text = buf; - lv_draw_sw_label((lv_draw_unit_t *)u, &label_dsc, &txt_area); } -#endif -} - -#if LV_USE_PXP_DRAW_THREAD -static void _pxp_render_thread_cb(void * ptr) -{ - lv_draw_pxp_unit_t * u = ptr; - - lv_thread_sync_init(&u->sync); - u->inited = true; - - while(1) { - /* Wait for sync if there is no task set. */ - while(u->task_act == NULL) { - if(u->exit_status) - break; - lv_thread_sync_wait(&u->sync); - } + if(has_mask || has_scale || unsup_rotation || lv_area_get_size(&blend_area) < LV_GPU_NXP_PXP_SIZE_LIMIT +#if LV_COLOR_DEPTH != 32 + || lv_img_cf_has_alpha(cf) +#endif + ) { + lv_draw_sw_img_decoded(draw_ctx, dsc, coords, map_p, cf); + return; + } - if(u->exit_status) { - LV_LOG_INFO("Ready to exit PXP draw thread."); - break; - } + lv_color_t * dest_buf = draw_ctx->buf; + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); - _pxp_execute_drawing(u); + lv_area_t src_area; + src_area.x1 = blend_area.x1 - (coords->x1 - draw_ctx->buf_area->x1); + src_area.y1 = blend_area.y1 - (coords->y1 - draw_ctx->buf_area->y1); + src_area.x2 = src_area.x1 + src_width - 1; + src_area.y2 = src_area.y1 + src_height - 1; + lv_coord_t src_stride = lv_area_get_width(coords); - /* Signal the ready state to dispatcher. */ - u->task_act->state = LV_DRAW_TASK_STATE_READY; + lv_gpu_nxp_pxp_blit_transform(dest_buf, &blend_area, dest_stride, src_buf, &src_area, src_stride, + dsc, cf); +} - /* Cleanup. */ - u->task_act = NULL; +static void lv_draw_pxp_buffer_copy(lv_draw_ctx_t * draw_ctx, + void * dest_buf, lv_coord_t dest_stride, const lv_area_t * dest_area, + void * src_buf, lv_coord_t src_stride, const lv_area_t * src_area) +{ + LV_UNUSED(draw_ctx); - /* The draw unit is free now. Request a new dispatching as it can get a new task. */ - lv_draw_dispatch_request(); + if(lv_area_get_size(dest_area) < LV_GPU_NXP_PXP_SIZE_LIMIT) { + lv_draw_sw_buffer_copy(draw_ctx, dest_buf, dest_stride, dest_area, src_buf, src_stride, src_area); + return; } - u->inited = false; - lv_thread_sync_delete(&u->sync); - LV_LOG_INFO("Exit PXP draw thread."); + lv_gpu_nxp_pxp_buffer_copy(dest_buf, dest_area, dest_stride, src_buf, src_area, src_stride); } -#endif -#endif /*LV_USE_DRAW_PXP*/ -#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/ -#endif /*LV_USE_PXP*/ + +#endif /*LV_USE_GPU_NXP_PXP*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp.h b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp.h index d34ad3f..1ace3bc 100644 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp.h +++ b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp.h @@ -4,9 +4,27 @@ */ /** - * Copyright 2022-2024 NXP + * MIT License + * + * Copyright 2022, 2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * SPDX-License-Identifier: MIT */ #ifndef LV_DRAW_PXP_H @@ -22,10 +40,8 @@ extern "C" { #include "../../../lv_conf_internal.h" -#if LV_USE_PXP -#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP -#include "../../sw/lv_draw_sw_private.h" -#include "../../../misc/lv_area_private.h" +#if LV_USE_GPU_NXP_PXP +#include "../../sw/lv_draw_sw.h" /********************* * DEFINES @@ -34,39 +50,20 @@ extern "C" { /********************** * TYPEDEFS **********************/ - -typedef lv_draw_sw_unit_t lv_draw_pxp_unit_t; +typedef lv_draw_sw_ctx_t lv_draw_pxp_ctx_t; /********************** * GLOBAL PROTOTYPES **********************/ -void lv_draw_pxp_init(void); - -void lv_draw_pxp_deinit(void); - -void lv_draw_pxp_rotate(const void * src_buf, void * dest_buf, int32_t src_width, int32_t src_height, - int32_t src_stride, int32_t dest_stride, lv_display_rotation_t rotation, - lv_color_format_t cf); - -#if LV_USE_DRAW_PXP -void lv_draw_buf_pxp_init_handlers(void); - -void lv_draw_pxp_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_pxp_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dsc, - const lv_area_t * coords); +void lv_draw_pxp_ctx_init(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); -void lv_draw_pxp_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords); +void lv_draw_pxp_ctx_deinit(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); /********************** * MACROS **********************/ -#endif /*LV_USE_DRAW_PXP*/ -#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/ -#endif /*LV_USE_PXP*/ +#endif /*LV_USE_GPU_NXP_PXP*/ #ifdef __cplusplus } /*extern "C"*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_blend.c b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_blend.c new file mode 100644 index 0000000..8292576 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_blend.c @@ -0,0 +1,573 @@ +/** + * @file lv_draw_pxp_blend.c + * + */ + +/** + * MIT License + * + * Copyright 2020-2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "lv_draw_pxp_blend.h" + +#if LV_USE_GPU_NXP_PXP +#include "lvgl_support.h" + +/********************* + * DEFINES + *********************/ + +#if LV_COLOR_16_SWAP + #error Color swap not implemented. Disable LV_COLOR_16_SWAP feature. +#endif + +#if LV_COLOR_DEPTH == 16 + #define PXP_OUT_PIXEL_FORMAT kPXP_OutputPixelFormatRGB565 + #define PXP_AS_PIXEL_FORMAT kPXP_AsPixelFormatRGB565 + #define PXP_PS_PIXEL_FORMAT kPXP_PsPixelFormatRGB565 + #define PXP_TEMP_BUF_SIZE LCD_WIDTH * LCD_HEIGHT * 2U +#elif LV_COLOR_DEPTH == 32 + #define PXP_OUT_PIXEL_FORMAT kPXP_OutputPixelFormatARGB8888 + #define PXP_AS_PIXEL_FORMAT kPXP_AsPixelFormatARGB8888 + #if (!(defined(FSL_FEATURE_PXP_HAS_NO_EXTEND_PIXEL_FORMAT) && FSL_FEATURE_PXP_HAS_NO_EXTEND_PIXEL_FORMAT)) && \ + (!(defined(FSL_FEATURE_PXP_V3) && FSL_FEATURE_PXP_V3)) + #define PXP_PS_PIXEL_FORMAT kPXP_PsPixelFormatARGB8888 + #else + #define PXP_PS_PIXEL_FORMAT kPXP_PsPixelFormatRGB888 + #endif + #define PXP_TEMP_BUF_SIZE LCD_WIDTH * LCD_HEIGHT * 4U +#elif + #error Only 16bit and 32bit color depth are supported. Set LV_COLOR_DEPTH to 16 or 32. +#endif + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +static LV_ATTRIBUTE_MEM_ALIGN uint8_t temp_buf[PXP_TEMP_BUF_SIZE]; + +/** + * BLock Image Transfer - copy rectangular image from src buffer to dst buffer + * with combination of transformation (rotation, scale, recolor) and opacity, alpha channel + * or color keying. This requires two steps. First step is used for transformation into + * a temporary buffer and the second one will handle the color format or opacity. + * + * @param[in/out] dest_buf Destination buffer + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] dest_stride Stride of destination buffer in pixels + * @param[in] src_buf Source buffer + * @param[in] src_area Area with relative coordinates of source buffer + * @param[in] src_stride Stride of source buffer in pixels + * @param[in] dsc Image descriptor + * @param[in] cf Color format + */ +static void lv_pxp_blit_opa(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + const lv_draw_img_dsc_t * dsc, lv_img_cf_t cf); + +/** + * BLock Image Transfer - copy rectangular image from src buffer to dst buffer + * with transformation and full opacity. + * + * @param[in/out] dest_buf Destination buffer + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] dest_stride Stride of destination buffer in pixels + * @param[in] src_buf Source buffer + * @param[in] src_area Area with relative coordinates of source buffer + * @param[in] src_stride Stride of source buffer in pixels + * @param[in] dsc Image descriptor + * @param[in] cf Color format + */ +static void lv_pxp_blit_cover(lv_color_t * dest_buf, lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + const lv_draw_img_dsc_t * dsc, lv_img_cf_t cf); + +/** + * BLock Image Transfer - copy rectangular image from src buffer to dst buffer + * without transformation but handling color format or opacity. + * + * @param[in/out] dest_buf Destination buffer + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] dest_stride Stride of destination buffer in pixels + * @param[in] src_buf Source buffer + * @param[in] src_area Area with relative coordinates of source buffer + * @param[in] src_stride Stride of source buffer in pixels + * @param[in] dsc Image descriptor + * @param[in] cf Color format + */ +static void lv_pxp_blit_cf(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + const lv_draw_img_dsc_t * dsc, lv_img_cf_t cf); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + lv_color_t color, lv_opa_t opa) +{ + lv_coord_t dest_w = lv_area_get_width(dest_area); + lv_coord_t dest_h = lv_area_get_height(dest_area); + + lv_gpu_nxp_pxp_reset(); + + /*OUT buffer configure*/ + pxp_output_buffer_config_t outputConfig = { + .pixelFormat = PXP_OUT_PIXEL_FORMAT, + .interlacedMode = kPXP_OutputProgressive, + .buffer0Addr = (uint32_t)(dest_buf + dest_stride * dest_area->y1 + dest_area->x1), + .buffer1Addr = (uint32_t)NULL, + .pitchBytes = dest_stride * sizeof(lv_color_t), + .width = dest_w, + .height = dest_h + }; + + PXP_SetOutputBufferConfig(LV_GPU_NXP_PXP_ID, &outputConfig); + + if(opa >= (lv_opa_t)LV_OPA_MAX) { + /*Simple color fill without opacity - AS disabled*/ + PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); + + } + else { + /*Fill with opacity - AS used as source (same as OUT)*/ + pxp_as_buffer_config_t asBufferConfig = { + .pixelFormat = PXP_AS_PIXEL_FORMAT, + .bufferAddr = (uint32_t)outputConfig.buffer0Addr, + .pitchBytes = outputConfig.pitchBytes + }; + + PXP_SetAlphaSurfaceBufferConfig(LV_GPU_NXP_PXP_ID, &asBufferConfig); + PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, dest_w - 1U, dest_h - 1U); + } + + /*Disable PS, use as color generator*/ + PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); + PXP_SetProcessSurfaceBackGroundColor(LV_GPU_NXP_PXP_ID, lv_color_to32(color)); + + /** + * Configure Porter-Duff blending - src settings are unused for fill without opacity (opa = 0xff). + * + * Note: srcFactorMode and dstFactorMode are inverted in fsl_pxp.h: + * srcFactorMode is actually applied on PS alpha value + * dstFactorMode is actually applied on AS alpha value + */ + pxp_porter_duff_config_t pdConfig = { + .enable = 1, + .dstColorMode = kPXP_PorterDuffColorNoAlpha, + .srcColorMode = kPXP_PorterDuffColorNoAlpha, + .dstGlobalAlphaMode = kPXP_PorterDuffGlobalAlpha, + .srcGlobalAlphaMode = kPXP_PorterDuffGlobalAlpha, + .dstFactorMode = kPXP_PorterDuffFactorStraight, + .srcFactorMode = (opa >= (lv_opa_t)LV_OPA_MAX) ? kPXP_PorterDuffFactorStraight : kPXP_PorterDuffFactorInversed, + .dstGlobalAlpha = opa, + .srcGlobalAlpha = opa, + .dstAlphaMode = kPXP_PorterDuffAlphaStraight, /*don't care*/ + .srcAlphaMode = kPXP_PorterDuffAlphaStraight /*don't care*/ + }; + + PXP_SetPorterDuffConfig(LV_GPU_NXP_PXP_ID, &pdConfig); + + lv_gpu_nxp_pxp_run(); +} + +void lv_gpu_nxp_pxp_blit(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + lv_opa_t opa, lv_disp_rot_t angle) +{ + lv_coord_t dest_w = lv_area_get_width(dest_area); + lv_coord_t dest_h = lv_area_get_height(dest_area); + lv_coord_t src_w = lv_area_get_width(src_area); + lv_coord_t src_h = lv_area_get_height(src_area); + + lv_gpu_nxp_pxp_reset(); + + /* convert rotation angle */ + pxp_rotate_degree_t pxp_rot; + switch(angle) { + case LV_DISP_ROT_NONE: + pxp_rot = kPXP_Rotate0; + break; + case LV_DISP_ROT_90: + pxp_rot = kPXP_Rotate90; + break; + case LV_DISP_ROT_180: + pxp_rot = kPXP_Rotate180; + break; + case LV_DISP_ROT_270: + pxp_rot = kPXP_Rotate270; + break; + default: + pxp_rot = kPXP_Rotate0; + break; + } + PXP_SetRotateConfig(LV_GPU_NXP_PXP_ID, kPXP_RotateOutputBuffer, pxp_rot, kPXP_FlipDisable); + + pxp_as_blend_config_t asBlendConfig = { + .alpha = opa, + .invertAlpha = false, + .alphaMode = kPXP_AlphaRop, + .ropMode = kPXP_RopMergeAs + }; + + if(opa >= (lv_opa_t)LV_OPA_MAX) { + /*Simple blit, no effect - Disable PS buffer*/ + PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); + } + else { + pxp_ps_buffer_config_t psBufferConfig = { + .pixelFormat = PXP_PS_PIXEL_FORMAT, + .swapByte = false, + .bufferAddr = (uint32_t)(dest_buf + dest_stride * dest_area->y1 + dest_area->x1), + .bufferAddrU = 0U, + .bufferAddrV = 0U, + .pitchBytes = dest_stride * sizeof(lv_color_t) + }; + + asBlendConfig.alphaMode = kPXP_AlphaOverride; + + PXP_SetProcessSurfaceBufferConfig(LV_GPU_NXP_PXP_ID, &psBufferConfig); + PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, dest_w - 1U, dest_h - 1U); + } + + /*AS buffer - source image*/ + pxp_as_buffer_config_t asBufferConfig = { + .pixelFormat = PXP_AS_PIXEL_FORMAT, + .bufferAddr = (uint32_t)(src_buf + src_stride * src_area->y1 + src_area->x1), + .pitchBytes = src_stride * sizeof(lv_color_t) + }; + PXP_SetAlphaSurfaceBufferConfig(LV_GPU_NXP_PXP_ID, &asBufferConfig); + PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, src_w - 1U, src_h - 1U); + PXP_SetAlphaSurfaceBlendConfig(LV_GPU_NXP_PXP_ID, &asBlendConfig); + PXP_EnableAlphaSurfaceOverlayColorKey(LV_GPU_NXP_PXP_ID, false); + + /*Output buffer.*/ + pxp_output_buffer_config_t outputBufferConfig = { + .pixelFormat = (pxp_output_pixel_format_t)PXP_OUT_PIXEL_FORMAT, + .interlacedMode = kPXP_OutputProgressive, + .buffer0Addr = (uint32_t)(dest_buf + dest_stride * dest_area->y1 + dest_area->x1), + .buffer1Addr = (uint32_t)0U, + .pitchBytes = dest_stride * sizeof(lv_color_t), + .width = dest_w, + .height = dest_h + }; + PXP_SetOutputBufferConfig(LV_GPU_NXP_PXP_ID, &outputBufferConfig); + + lv_gpu_nxp_pxp_run(); +} + +void lv_gpu_nxp_pxp_blit_transform(lv_color_t * dest_buf, lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + const lv_draw_img_dsc_t * dsc, lv_img_cf_t cf) +{ + bool has_recolor = (dsc->recolor_opa != LV_OPA_TRANSP); + bool has_rotation = (dsc->angle != 0); + + if(has_recolor || has_rotation) { + if(dsc->opa >= (lv_opa_t)LV_OPA_MAX && !lv_img_cf_has_alpha(cf) && !lv_img_cf_is_chroma_keyed(cf)) { + lv_pxp_blit_cover(dest_buf, dest_area, dest_stride, src_buf, src_area, src_stride, dsc, cf); + return; + } + else { + /*Recolor and/or rotation with alpha or opacity is done in two steps.*/ + lv_pxp_blit_opa(dest_buf, dest_area, dest_stride, src_buf, src_area, src_stride, dsc, cf); + return; + } + } + + lv_pxp_blit_cf(dest_buf, dest_area, dest_stride, src_buf, src_area, src_stride, dsc, cf); +} + +void lv_gpu_nxp_pxp_buffer_copy(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride) +{ + lv_coord_t src_width = lv_area_get_width(src_area); + lv_coord_t src_height = lv_area_get_height(src_area); + + lv_gpu_nxp_pxp_reset(); + + const pxp_pic_copy_config_t picCopyConfig = { + .srcPicBaseAddr = (uint32_t)src_buf, + .srcPitchBytes = src_stride * sizeof(lv_color_t), + .srcOffsetX = src_area->x1, + .srcOffsetY = src_area->y1, + .destPicBaseAddr = (uint32_t)dest_buf, + .destPitchBytes = dest_stride * sizeof(lv_color_t), + .destOffsetX = dest_area->x1, + .destOffsetY = dest_area->y1, + .width = src_width, + .height = src_height, + .pixelFormat = PXP_AS_PIXEL_FORMAT + }; + + PXP_StartPictureCopy(LV_GPU_NXP_PXP_ID, &picCopyConfig); + + lv_gpu_nxp_pxp_wait(); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_pxp_blit_opa(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + const lv_draw_img_dsc_t * dsc, lv_img_cf_t cf) +{ + lv_area_t temp_area; + lv_area_copy(&temp_area, dest_area); + lv_coord_t temp_stride = dest_stride; + lv_coord_t temp_w = lv_area_get_width(&temp_area); + lv_coord_t temp_h = lv_area_get_height(&temp_area); + + /*Step 1: Transform with full opacity to temporary buffer*/ + lv_pxp_blit_cover((lv_color_t *)temp_buf, &temp_area, temp_stride, src_buf, src_area, src_stride, dsc, cf); + + /*Switch width and height if angle requires it*/ + if(dsc->angle == 900 || dsc->angle == 2700) { + temp_area.x2 = temp_area.x1 + temp_h - 1; + temp_area.y2 = temp_area.y1 + temp_w - 1; + } + + /*Step 2: Blit temporary result with required opacity to output*/ + lv_pxp_blit_cf(dest_buf, &temp_area, dest_stride, (lv_color_t *)temp_buf, &temp_area, temp_stride, dsc, cf); +} +static void lv_pxp_blit_cover(lv_color_t * dest_buf, lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + const lv_draw_img_dsc_t * dsc, lv_img_cf_t cf) +{ + lv_coord_t dest_w = lv_area_get_width(dest_area); + lv_coord_t dest_h = lv_area_get_height(dest_area); + lv_coord_t src_w = lv_area_get_width(src_area); + lv_coord_t src_h = lv_area_get_height(src_area); + + bool has_recolor = (dsc->recolor_opa != LV_OPA_TRANSP); + bool has_rotation = (dsc->angle != 0); + + lv_point_t pivot = dsc->pivot; + lv_coord_t piv_offset_x; + lv_coord_t piv_offset_y; + + lv_gpu_nxp_pxp_reset(); + + if(has_rotation) { + /*Convert rotation angle and calculate offsets caused by pivot*/ + pxp_rotate_degree_t pxp_angle; + switch(dsc->angle) { + case 0: + pxp_angle = kPXP_Rotate0; + piv_offset_x = 0; + piv_offset_y = 0; + break; + case 900: + piv_offset_x = pivot.x + pivot.y - dest_h; + piv_offset_y = pivot.y - pivot.x; + pxp_angle = kPXP_Rotate90; + break; + case 1800: + piv_offset_x = 2 * pivot.x - dest_w; + piv_offset_y = 2 * pivot.y - dest_h; + pxp_angle = kPXP_Rotate180; + break; + case 2700: + piv_offset_x = pivot.x - pivot.y; + piv_offset_y = pivot.x + pivot.y - dest_w; + pxp_angle = kPXP_Rotate270; + break; + default: + piv_offset_x = 0; + piv_offset_y = 0; + pxp_angle = kPXP_Rotate0; + } + PXP_SetRotateConfig(LV_GPU_NXP_PXP_ID, kPXP_RotateOutputBuffer, pxp_angle, kPXP_FlipDisable); + lv_area_move(dest_area, piv_offset_x, piv_offset_y); + } + + /*AS buffer - source image*/ + pxp_as_buffer_config_t asBufferConfig = { + .pixelFormat = PXP_AS_PIXEL_FORMAT, + .bufferAddr = (uint32_t)(src_buf + src_stride * src_area->y1 + src_area->x1), + .pitchBytes = src_stride * sizeof(lv_color_t) + }; + PXP_SetAlphaSurfaceBufferConfig(LV_GPU_NXP_PXP_ID, &asBufferConfig); + PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, src_w - 1U, src_h - 1U); + + /*Disable PS buffer*/ + PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); + if(has_recolor) + /*Use as color generator*/ + PXP_SetProcessSurfaceBackGroundColor(LV_GPU_NXP_PXP_ID, lv_color_to32(dsc->recolor)); + + /*Output buffer*/ + pxp_output_buffer_config_t outputBufferConfig = { + .pixelFormat = (pxp_output_pixel_format_t)PXP_OUT_PIXEL_FORMAT, + .interlacedMode = kPXP_OutputProgressive, + .buffer0Addr = (uint32_t)(dest_buf + dest_stride * dest_area->y1 + dest_area->x1), + .buffer1Addr = (uint32_t)0U, + .pitchBytes = dest_stride * sizeof(lv_color_t), + .width = dest_w, + .height = dest_h + }; + PXP_SetOutputBufferConfig(LV_GPU_NXP_PXP_ID, &outputBufferConfig); + + if(has_recolor || lv_img_cf_has_alpha(cf)) { + /** + * Configure Porter-Duff blending. + * + * Note: srcFactorMode and dstFactorMode are inverted in fsl_pxp.h: + * srcFactorMode is actually applied on PS alpha value + * dstFactorMode is actually applied on AS alpha value + */ + pxp_porter_duff_config_t pdConfig = { + .enable = 1, + .dstColorMode = kPXP_PorterDuffColorWithAlpha, + .srcColorMode = kPXP_PorterDuffColorNoAlpha, + .dstGlobalAlphaMode = kPXP_PorterDuffGlobalAlpha, + .srcGlobalAlphaMode = lv_img_cf_has_alpha(cf) ? kPXP_PorterDuffLocalAlpha : kPXP_PorterDuffGlobalAlpha, + .dstFactorMode = kPXP_PorterDuffFactorStraight, + .srcFactorMode = kPXP_PorterDuffFactorInversed, + .dstGlobalAlpha = has_recolor ? dsc->recolor_opa : 0x00, + .srcGlobalAlpha = 0xff, + .dstAlphaMode = kPXP_PorterDuffAlphaStraight, /*don't care*/ + .srcAlphaMode = kPXP_PorterDuffAlphaStraight + }; + PXP_SetPorterDuffConfig(LV_GPU_NXP_PXP_ID, &pdConfig); + } + + lv_gpu_nxp_pxp_run(); +} + +static void lv_pxp_blit_cf(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + const lv_draw_img_dsc_t * dsc, lv_img_cf_t cf) +{ + lv_coord_t dest_w = lv_area_get_width(dest_area); + lv_coord_t dest_h = lv_area_get_height(dest_area); + lv_coord_t src_w = lv_area_get_width(src_area); + lv_coord_t src_h = lv_area_get_height(src_area); + + lv_gpu_nxp_pxp_reset(); + + pxp_as_blend_config_t asBlendConfig = { + .alpha = dsc->opa, + .invertAlpha = false, + .alphaMode = kPXP_AlphaRop, + .ropMode = kPXP_RopMergeAs + }; + + if(dsc->opa >= (lv_opa_t)LV_OPA_MAX && !lv_img_cf_is_chroma_keyed(cf) && !lv_img_cf_has_alpha(cf)) { + /*Simple blit, no effect - Disable PS buffer*/ + PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); + } + else { + /*PS must be enabled to fetch background pixels. + PS and OUT buffers are the same, blend will be done in-place*/ + pxp_ps_buffer_config_t psBufferConfig = { + .pixelFormat = PXP_PS_PIXEL_FORMAT, + .swapByte = false, + .bufferAddr = (uint32_t)(dest_buf + dest_stride * dest_area->y1 + dest_area->x1), + .bufferAddrU = 0U, + .bufferAddrV = 0U, + .pitchBytes = dest_stride * sizeof(lv_color_t) + }; + if(dsc->opa >= (lv_opa_t)LV_OPA_MAX) { + asBlendConfig.alphaMode = lv_img_cf_has_alpha(cf) ? kPXP_AlphaEmbedded : kPXP_AlphaOverride; + } + else { + asBlendConfig.alphaMode = lv_img_cf_has_alpha(cf) ? kPXP_AlphaMultiply : kPXP_AlphaOverride; + } + PXP_SetProcessSurfaceBufferConfig(LV_GPU_NXP_PXP_ID, &psBufferConfig); + PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, dest_w - 1U, dest_h - 1U); + } + + /*AS buffer - source image*/ + pxp_as_buffer_config_t asBufferConfig = { + .pixelFormat = PXP_AS_PIXEL_FORMAT, + .bufferAddr = (uint32_t)(src_buf + src_stride * src_area->y1 + src_area->x1), + .pitchBytes = src_stride * sizeof(lv_color_t) + }; + PXP_SetAlphaSurfaceBufferConfig(LV_GPU_NXP_PXP_ID, &asBufferConfig); + PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, src_w - 1U, src_h - 1U); + PXP_SetAlphaSurfaceBlendConfig(LV_GPU_NXP_PXP_ID, &asBlendConfig); + + if(lv_img_cf_is_chroma_keyed(cf)) { + lv_color_t colorKeyLow = LV_COLOR_CHROMA_KEY; + lv_color_t colorKeyHigh = LV_COLOR_CHROMA_KEY; + + bool has_recolor = (dsc->recolor_opa != LV_OPA_TRANSP); + + if(has_recolor) { + /* New color key after recoloring */ + lv_color_t colorKey = lv_color_mix(dsc->recolor, LV_COLOR_CHROMA_KEY, dsc->recolor_opa); + + LV_COLOR_SET_R(colorKeyLow, colorKey.ch.red != 0 ? colorKey.ch.red - 1 : 0); + LV_COLOR_SET_G(colorKeyLow, colorKey.ch.green != 0 ? colorKey.ch.green - 1 : 0); + LV_COLOR_SET_B(colorKeyLow, colorKey.ch.blue != 0 ? colorKey.ch.blue - 1 : 0); + +#if LV_COLOR_DEPTH == 16 + LV_COLOR_SET_R(colorKeyHigh, colorKey.ch.red != 0x1f ? colorKey.ch.red + 1 : 0x1f); + LV_COLOR_SET_G(colorKeyHigh, colorKey.ch.green != 0x3f ? colorKey.ch.green + 1 : 0x3f); + LV_COLOR_SET_B(colorKeyHigh, colorKey.ch.blue != 0x1f ? colorKey.ch.blue + 1 : 0x1f); +#else /*LV_COLOR_DEPTH == 32*/ + LV_COLOR_SET_R(colorKeyHigh, colorKey.ch.red != 0xff ? colorKey.ch.red + 1 : 0xff); + LV_COLOR_SET_G(colorKeyHigh, colorKey.ch.green != 0xff ? colorKey.ch.green + 1 : 0xff); + LV_COLOR_SET_B(colorKeyHigh, colorKey.ch.blue != 0xff ? colorKey.ch.blue + 1 : 0xff); +#endif + } + + PXP_SetAlphaSurfaceOverlayColorKey(LV_GPU_NXP_PXP_ID, lv_color_to32(colorKeyLow), + lv_color_to32(colorKeyHigh)); + } + + PXP_EnableAlphaSurfaceOverlayColorKey(LV_GPU_NXP_PXP_ID, lv_img_cf_is_chroma_keyed(cf)); + + /*Output buffer.*/ + pxp_output_buffer_config_t outputBufferConfig = { + .pixelFormat = (pxp_output_pixel_format_t)PXP_OUT_PIXEL_FORMAT, + .interlacedMode = kPXP_OutputProgressive, + .buffer0Addr = (uint32_t)(dest_buf + dest_stride * dest_area->y1 + dest_area->x1), + .buffer1Addr = (uint32_t)0U, + .pitchBytes = dest_stride * sizeof(lv_color_t), + .width = dest_w, + .height = dest_h + }; + PXP_SetOutputBufferConfig(LV_GPU_NXP_PXP_ID, &outputBufferConfig); + + lv_gpu_nxp_pxp_run(); +} + +#endif /*LV_USE_GPU_NXP_PXP*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_blend.h b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_blend.h new file mode 100644 index 0000000..9615667 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_blend.h @@ -0,0 +1,130 @@ +/** + * @file lv_draw_pxp_blend.h + * + */ + +/** + * MIT License + * + * Copyright 2020-2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef LV_DRAW_PXP_BLEND_H +#define LV_DRAW_PXP_BLEND_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +#include "../../../lv_conf_internal.h" + +#if LV_USE_GPU_NXP_PXP +#include "lv_gpu_nxp_pxp.h" +#include "../../sw/lv_draw_sw.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Fill area, with optional opacity. + * + * @param[in/out] dest_buf Destination buffer + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] dest_stride Stride of destination buffer in pixels + * @param[in] color Color + * @param[in] opa Opacity + */ +void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + lv_color_t color, lv_opa_t opa); + +/** + * BLock Image Transfer - copy rectangular image from src_buf to dst_buf with effects. + * By default, image is copied directly, with optional opacity. This function can also + * rotate the display output buffer to a specified angle (90x step). + * + * @param[in/out] dest_buf Destination buffer + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] dest_stride Stride of destination buffer in pixels + * @param[in] src_buf Source buffer + * @param[in] src_area Source area with relative coordinates of source buffer + * @param[in] src_stride Stride of source buffer in pixels + * @param[in] opa Opacity + * @param[in] angle Display rotation angle (90x) + */ +void lv_gpu_nxp_pxp_blit(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + lv_opa_t opa, lv_disp_rot_t angle); + +/** + * BLock Image Transfer - copy rectangular image from src_buf to dst_buf with transformation. + * + * + * @param[in/out] dest_buf Destination buffer + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] dest_stride Stride of destination buffer in pixels + * @param[in] src_buf Source buffer + * @param[in] src_area Area with relative coordinates of source buffer + * @param[in] src_stride Stride of source buffer in pixels + * @param[in] dsc Image descriptor + * @param[in] cf Color format + */ +void lv_gpu_nxp_pxp_blit_transform(lv_color_t * dest_buf, lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + const lv_draw_img_dsc_t * dsc, lv_img_cf_t cf); + +/** + * BLock Image Transfer - copy rectangular image from src_buf to dst_buf, no transformation or blending. + * + * + * @param[in/out] dest_buf Destination buffer + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] dest_stride Stride of destination buffer in pixels + * @param[in] src_buf Source buffer + * @param[in] src_area Area with relative coordinates of source buffer + * @param[in] src_stride Stride of source buffer in pixels + */ +void lv_gpu_nxp_pxp_buffer_copy(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_NXP_PXP*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_PXP_BLEND_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_fill.c b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_fill.c deleted file mode 100644 index 33b8047..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_fill.c +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @file lv_draw_pxp_fill.c - * - */ - -/** - * Copyright 2020-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_pxp.h" - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP -#include "lv_pxp_cfg.h" -#include "lv_pxp_utils.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void _pxp_fill(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride, - lv_color_format_t dest_cf, const lv_draw_fill_dsc_t * dsc); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_pxp_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc, - const lv_area_t * coords) -{ - if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) - return; - - lv_layer_t * layer = draw_unit->target_layer; - lv_draw_buf_t * draw_buf = layer->draw_buf; - - lv_area_t rel_coords; - lv_area_copy(&rel_coords, coords); - lv_area_move(&rel_coords, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t rel_clip_area; - lv_area_copy(&rel_clip_area, draw_unit->clip_area); - lv_area_move(&rel_clip_area, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t blend_area; - if(!lv_area_intersect(&blend_area, &rel_coords, &rel_clip_area)) - return; /*Fully clipped, nothing to do*/ - - _pxp_fill(draw_buf->data, &blend_area, draw_buf->header.stride, draw_buf->header.cf, dsc); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void _pxp_fill(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride, - lv_color_format_t dest_cf, const lv_draw_fill_dsc_t * dsc) -{ - int32_t dest_w = lv_area_get_width(dest_area); - int32_t dest_h = lv_area_get_height(dest_area); - - lv_pxp_reset(); - - uint8_t px_size = lv_color_format_get_size(dest_cf); - - /*OUT buffer configure*/ - pxp_output_buffer_config_t outputConfig = { - .pixelFormat = pxp_get_out_px_format(dest_cf), - .interlacedMode = kPXP_OutputProgressive, - .buffer0Addr = (uint32_t)(dest_buf + dest_stride * dest_area->y1 + px_size * dest_area->x1), - .buffer1Addr = (uint32_t)NULL, - .pitchBytes = dest_stride, - .width = dest_w, - .height = dest_h - }; - - PXP_SetOutputBufferConfig(PXP_ID, &outputConfig); - - if(dsc->opa >= (lv_opa_t)LV_OPA_MAX) { - /*Simple color fill without opacity - AS disabled*/ - PXP_SetAlphaSurfacePosition(PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); - - } - else { - /*Fill with opacity - AS used as source (same as OUT)*/ - pxp_as_buffer_config_t asBufferConfig = { - .pixelFormat = pxp_get_as_px_format(dest_cf), - .bufferAddr = outputConfig.buffer0Addr, - .pitchBytes = outputConfig.pitchBytes - }; - - PXP_SetAlphaSurfaceBufferConfig(PXP_ID, &asBufferConfig); - PXP_SetAlphaSurfacePosition(PXP_ID, 0U, 0U, dest_w - 1U, dest_h - 1U); - } - - /*Disable PS, use as color generator*/ - PXP_SetProcessSurfacePosition(PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); - PXP_SetProcessSurfaceBackGroundColor(PXP_ID, lv_color_to_u32(dsc->color)); - - /** - * Configure Porter-Duff blending - src settings are unused for fill without opacity (opa = 0xff). - * - * Note: srcFactorMode and dstFactorMode are inverted in fsl_pxp.h: - * srcFactorMode is actually applied on PS alpha value - * dstFactorMode is actually applied on AS alpha value - */ - pxp_porter_duff_config_t pdConfig = { - .enable = 1, - .dstColorMode = kPXP_PorterDuffColorNoAlpha, - .srcColorMode = kPXP_PorterDuffColorNoAlpha, - .dstGlobalAlphaMode = kPXP_PorterDuffGlobalAlpha, - .srcGlobalAlphaMode = kPXP_PorterDuffGlobalAlpha, - .dstFactorMode = kPXP_PorterDuffFactorStraight, - .srcFactorMode = (dsc->opa >= (lv_opa_t)LV_OPA_MAX) ? kPXP_PorterDuffFactorStraight : kPXP_PorterDuffFactorInversed, - .dstGlobalAlpha = dsc->opa, - .srcGlobalAlpha = dsc->opa, - .dstAlphaMode = kPXP_PorterDuffAlphaStraight, /*don't care*/ - .srcAlphaMode = kPXP_PorterDuffAlphaStraight /*don't care*/ - }; - - PXP_SetPorterDuffConfig(PXP_ID, &pdConfig); - - lv_pxp_run(); -} - -#endif /*LV_USE_DRAW_PXP*/ -#endif /*LV_USE_PXP*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_img.c b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_img.c deleted file mode 100644 index 79f3790..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_img.c +++ /dev/null @@ -1,367 +0,0 @@ -/** - * @file lv_draw_pxp_img.c - * - */ - -/** - * Copyright 2020-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_pxp.h" - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP -#include "lv_pxp_cfg.h" -#include "lv_pxp_utils.h" - -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/* Blit w/ recolor for images w/o opa and alpha channel */ -static void _pxp_blit_recolor(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride, - lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area, - int32_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc); - -/* Blit w/ transformation for images w/o opa and alpha channel */ -static void _pxp_blit_transform(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride, - lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area, - int32_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc); - -/* Blit simple w/ opa and alpha channel */ -static void _pxp_blit(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride, - lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area, - int32_t src_stride, lv_color_format_t src_cf, lv_opa_t opa); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_pxp_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dsc, - const lv_area_t * coords) -{ - if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) - return; - - lv_layer_t * layer = draw_unit->target_layer; - lv_draw_buf_t * draw_buf = layer->draw_buf; - const lv_image_dsc_t * img_dsc = dsc->src; - - lv_area_t rel_coords; - lv_area_copy(&rel_coords, coords); - lv_area_move(&rel_coords, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t rel_clip_area; - lv_area_copy(&rel_clip_area, draw_unit->clip_area); - lv_area_move(&rel_clip_area, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t blend_area; - bool has_transform = (dsc->rotation != 0 || dsc->scale_x != LV_SCALE_NONE || dsc->scale_y != LV_SCALE_NONE); - if(has_transform) - lv_area_copy(&blend_area, &rel_coords); - else if(!lv_area_intersect(&blend_area, &rel_coords, &rel_clip_area)) - return; /*Fully clipped, nothing to do*/ - - const uint8_t * src_buf = img_dsc->data; - - lv_area_t src_area; - src_area.x1 = blend_area.x1 - (coords->x1 - layer->buf_area.x1); - src_area.y1 = blend_area.y1 - (coords->y1 - layer->buf_area.y1); - src_area.x2 = src_area.x1 + lv_area_get_width(coords) - 1; - src_area.y2 = src_area.y1 + lv_area_get_height(coords) - 1; - int32_t src_stride = img_dsc->header.stride; - lv_color_format_t src_cf = img_dsc->header.cf; - - uint8_t * dest_buf = draw_buf->data; - int32_t dest_stride = draw_buf->header.stride; - lv_color_format_t dest_cf = draw_buf->header.cf; - bool has_recolor = (dsc->recolor_opa > LV_OPA_MIN); - - if(has_recolor && !has_transform) - _pxp_blit_recolor(dest_buf, &blend_area, dest_stride, dest_cf, - src_buf, &src_area, src_stride, src_cf, dsc); - else if(has_transform) - _pxp_blit_transform(dest_buf, &blend_area, dest_stride, dest_cf, - src_buf, &src_area, src_stride, src_cf, dsc); - else - _pxp_blit(dest_buf, &blend_area, dest_stride, dest_cf, - src_buf, &src_area, src_stride, src_cf, dsc->opa); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void _pxp_blit_recolor(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride, - lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area, - int32_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc) -{ - - int32_t dest_w = lv_area_get_width(dest_area); - int32_t dest_h = lv_area_get_height(dest_area); - int32_t src_w = lv_area_get_width(src_area); - int32_t src_h = lv_area_get_height(src_area); - - bool src_has_alpha = (src_cf == LV_COLOR_FORMAT_ARGB8888); - uint8_t src_px_size = lv_color_format_get_size(src_cf); - uint8_t dest_px_size = lv_color_format_get_size(dest_cf); - - lv_pxp_reset(); - - /*AS buffer - source image*/ - pxp_as_buffer_config_t asBufferConfig = { - .pixelFormat = pxp_get_as_px_format(src_cf), - .bufferAddr = (uint32_t)(src_buf + src_stride * src_area->y1 + src_px_size * src_area->x1), - .pitchBytes = src_stride - }; - PXP_SetAlphaSurfaceBufferConfig(PXP_ID, &asBufferConfig); - PXP_SetAlphaSurfacePosition(PXP_ID, 0U, 0U, src_w - 1U, src_h - 1U); - - /*Disable PS, use as color generator*/ - PXP_SetProcessSurfacePosition(PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); - PXP_SetProcessSurfaceBackGroundColor(PXP_ID, lv_color_to_u32(dsc->recolor)); - - /*Output buffer*/ - pxp_output_buffer_config_t outputBufferConfig = { - .pixelFormat = pxp_get_out_px_format(dest_cf), - .interlacedMode = kPXP_OutputProgressive, - .buffer0Addr = (uint32_t)(dest_buf + dest_stride * dest_area->y1 + dest_px_size * dest_area->x1), - .buffer1Addr = (uint32_t)0U, - .pitchBytes = dest_stride, - .width = dest_w, - .height = dest_h - }; - PXP_SetOutputBufferConfig(PXP_ID, &outputBufferConfig); - - /** - * Configure Porter-Duff blending. - * - * Note: srcFactorMode and dstFactorMode are inverted in fsl_pxp.h: - * srcFactorMode is actually applied on PS alpha value - * dstFactorMode is actually applied on AS alpha value - */ - pxp_porter_duff_config_t pdConfig = { - .enable = 1, - .dstColorMode = kPXP_PorterDuffColorWithAlpha, - .srcColorMode = kPXP_PorterDuffColorWithAlpha, - .dstGlobalAlphaMode = kPXP_PorterDuffGlobalAlpha, - .srcGlobalAlphaMode = src_has_alpha ? kPXP_PorterDuffLocalAlpha : kPXP_PorterDuffGlobalAlpha, - .dstFactorMode = kPXP_PorterDuffFactorStraight, - .srcFactorMode = kPXP_PorterDuffFactorInversed, - .dstGlobalAlpha = dsc->recolor_opa, - .srcGlobalAlpha = 0xff, - .dstAlphaMode = kPXP_PorterDuffAlphaStraight, /*don't care*/ - .srcAlphaMode = kPXP_PorterDuffAlphaStraight - }; - PXP_SetPorterDuffConfig(PXP_ID, &pdConfig); - - lv_pxp_run(); -} - -static void _pxp_blit_transform(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride, - lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area, - int32_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc) -{ - int32_t src_w = lv_area_get_width(src_area); - int32_t src_h = lv_area_get_height(src_area); - int32_t dest_w = lv_area_get_width(dest_area); - int32_t dest_h = lv_area_get_height(dest_area); - - lv_point_t pivot = dsc->pivot; - /*The offsets are now relative to the transformation result with pivot ULC*/ - int32_t piv_offset_x = 0; - int32_t piv_offset_y = 0; - - int32_t trim_x = 0; - int32_t trim_y = 0; - - bool has_rotation = (dsc->rotation != 0); - bool has_scale = (dsc->scale_x != LV_SCALE_NONE || dsc->scale_y != LV_SCALE_NONE); - uint8_t src_px_size = lv_color_format_get_size(src_cf); - uint8_t dest_px_size = lv_color_format_get_size(dest_cf); - - lv_pxp_reset(); - - if(has_rotation) { - /*Convert rotation angle and calculate offsets caused by pivot*/ - pxp_rotate_degree_t pxp_angle; - switch(dsc->rotation) { - case 0: - pxp_angle = kPXP_Rotate0; - piv_offset_x = 0; - piv_offset_y = 0; - break; - case 900: - pxp_angle = kPXP_Rotate90; - piv_offset_x = pivot.x + pivot.y - src_h; - piv_offset_y = pivot.y - pivot.x; - break; - case 1800: - pxp_angle = kPXP_Rotate180; - piv_offset_x = 2 * pivot.x - src_w; - piv_offset_y = 2 * pivot.y - src_h; - break; - case 2700: - pxp_angle = kPXP_Rotate270; - piv_offset_x = pivot.x - pivot.y; - piv_offset_y = pivot.x + pivot.y - src_w; - break; - default: - pxp_angle = kPXP_Rotate0; - piv_offset_x = 0; - piv_offset_y = 0; - } - /*PS buffer rotation and decimation does not function at the same time*/ - PXP_SetRotateConfig(PXP_ID, kPXP_RotateOutputBuffer, pxp_angle, kPXP_FlipDisable); - } - - if(has_scale) { - float fp_scale_x = (float)dsc->scale_x / LV_SCALE_NONE; - float fp_scale_y = (float)dsc->scale_y / LV_SCALE_NONE; - int32_t int_scale_x = (int32_t)fp_scale_x; - int32_t int_scale_y = (int32_t)fp_scale_y; - - /*Any scale_factor in (k, k + 1] will result in a trim equal to k*/ - trim_x = (fp_scale_x == int_scale_x) ? int_scale_x - 1 : int_scale_x; - trim_y = (fp_scale_y == int_scale_y) ? int_scale_y - 1 : int_scale_y; - - dest_w = src_w * fp_scale_x + trim_x; - dest_h = src_h * fp_scale_y + trim_y; - - /*Final pivot offset = scale_factor * rotation_pivot_offset + scaling_pivot_offset*/ - piv_offset_x = floorf(fp_scale_x * piv_offset_x) - floorf((fp_scale_x - 1) * pivot.x); - piv_offset_y = floorf(fp_scale_y * piv_offset_y) - floorf((fp_scale_y - 1) * pivot.y); - } - - /*PS buffer - source image*/ - pxp_ps_buffer_config_t psBufferConfig = { - .pixelFormat = pxp_get_ps_px_format(src_cf), - .swapByte = false, - .bufferAddr = (uint32_t)(src_buf + src_stride * src_area->y1 + src_px_size * src_area->x1), - .bufferAddrU = 0, - .bufferAddrV = 0, - .pitchBytes = src_stride - }; - PXP_SetProcessSurfaceBufferConfig(PXP_ID, &psBufferConfig); - PXP_SetProcessSurfacePosition(PXP_ID, 0U, 0U, dest_w - trim_x - 1U, dest_h - trim_y - 1U); - - if(has_scale) - PXP_SetProcessSurfaceScaler(PXP_ID, src_w, src_h, dest_w, dest_h); - - /*AS disabled */ - PXP_SetAlphaSurfacePosition(PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); - - /*Output buffer*/ - pxp_output_buffer_config_t outputBufferConfig = { - .pixelFormat = pxp_get_out_px_format(dest_cf), - .interlacedMode = kPXP_OutputProgressive, - .buffer0Addr = (uint32_t)(dest_buf + dest_stride * (dest_area->y1 + piv_offset_y) + dest_px_size * (dest_area->x1 + piv_offset_x)), - .buffer1Addr = (uint32_t)0U, - .pitchBytes = dest_stride, - .width = dest_w - trim_x, - .height = dest_h - trim_y - }; - PXP_SetOutputBufferConfig(PXP_ID, &outputBufferConfig); - - lv_pxp_run(); -} - -static void _pxp_blit(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride, - lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area, - int32_t src_stride, lv_color_format_t src_cf, lv_opa_t opa) -{ - int32_t dest_w = lv_area_get_width(dest_area); - int32_t dest_h = lv_area_get_height(dest_area); - int32_t src_w = lv_area_get_width(src_area); - int32_t src_h = lv_area_get_height(src_area); - - bool src_has_alpha = (src_cf == LV_COLOR_FORMAT_ARGB8888); - uint8_t src_px_size = lv_color_format_get_size(src_cf); - uint8_t dest_px_size = lv_color_format_get_size(dest_cf); - - lv_pxp_reset(); - - pxp_as_blend_config_t asBlendConfig = { - .alpha = opa, - .invertAlpha = false, - .alphaMode = kPXP_AlphaRop, - .ropMode = kPXP_RopMergeAs - }; - - if(opa >= (lv_opa_t)LV_OPA_MAX && !src_has_alpha) { - /*Simple blit, no effect - Disable PS buffer*/ - PXP_SetProcessSurfacePosition(PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); - } - else { - /*PS must be enabled to fetch background pixels. - PS and OUT buffers are the same, blend will be done in-place*/ - pxp_ps_buffer_config_t psBufferConfig = { - .pixelFormat = pxp_get_ps_px_format(dest_cf), - .swapByte = false, - .bufferAddr = (uint32_t)(dest_buf + dest_stride * dest_area->y1 + dest_px_size * dest_area->x1), - .bufferAddrU = 0U, - .bufferAddrV = 0U, - .pitchBytes = dest_stride - }; - - if(opa >= (lv_opa_t)LV_OPA_MAX) - asBlendConfig.alphaMode = src_has_alpha ? kPXP_AlphaEmbedded : kPXP_AlphaOverride; - else - asBlendConfig.alphaMode = src_has_alpha ? kPXP_AlphaMultiply : kPXP_AlphaOverride; - - PXP_SetProcessSurfaceBufferConfig(PXP_ID, &psBufferConfig); - PXP_SetProcessSurfacePosition(PXP_ID, 0U, 0U, dest_w - 1U, dest_h - 1U); - } - - /*AS buffer - source image*/ - pxp_as_buffer_config_t asBufferConfig = { - .pixelFormat = pxp_get_as_px_format(src_cf), - .bufferAddr = (uint32_t)(src_buf + src_stride * src_area->y1 + src_px_size * src_area->x1), - .pitchBytes = src_stride - }; - PXP_SetAlphaSurfaceBufferConfig(PXP_ID, &asBufferConfig); - PXP_SetAlphaSurfacePosition(PXP_ID, 0U, 0U, src_w - 1U, src_h - 1U); - PXP_SetAlphaSurfaceBlendConfig(PXP_ID, &asBlendConfig); - PXP_EnableAlphaSurfaceOverlayColorKey(PXP_ID, false); - - /*Output buffer.*/ - pxp_output_buffer_config_t outputBufferConfig = { - .pixelFormat = pxp_get_out_px_format(dest_cf), - .interlacedMode = kPXP_OutputProgressive, - .buffer0Addr = (uint32_t)(dest_buf + dest_stride * dest_area->y1 + dest_px_size * dest_area->x1), - .buffer1Addr = (uint32_t)0U, - .pitchBytes = dest_stride, - .width = dest_w, - .height = dest_h - }; - PXP_SetOutputBufferConfig(PXP_ID, &outputBufferConfig); - - lv_pxp_run(); -} - -#endif /*LV_USE_DRAW_PXP*/ -#endif /*LV_USE_PXP*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_layer.c b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_layer.c deleted file mode 100644 index 34cb285..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_draw_pxp_layer.c +++ /dev/null @@ -1,158 +0,0 @@ -/** - * @file lv_draw_pxp_layer.c - * - */ - -/** - * Copyright 2023-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_pxp.h" - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP - -#include "../../../stdlib/lv_string.h" -#if LV_USE_PARALLEL_DRAW_DEBUG - #include "../../../core/lv_global.h" -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -#if LV_USE_PARALLEL_DRAW_DEBUG - #define _draw_info LV_GLOBAL_DEFAULT()->draw_info -#endif - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_pxp_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords) -{ - lv_layer_t * layer_to_draw = (lv_layer_t *)draw_dsc->src; - const lv_draw_buf_t * draw_buf = layer_to_draw->draw_buf; - - /* It can happen that nothing was draw on a layer and therefore its buffer is not allocated. - * In this case just return. - */ - if(draw_buf == NULL) - return; - - const lv_area_t area_to_draw = { - .x1 = 0, - .y1 = 0, - .x2 = draw_buf->header.w - 1, - .y2 = draw_buf->header.h - 1 - }; - lv_draw_buf_invalidate_cache(draw_buf, &area_to_draw); - - lv_draw_image_dsc_t new_draw_dsc = *draw_dsc; - new_draw_dsc.src = draw_buf; - lv_draw_pxp_img(draw_unit, &new_draw_dsc, coords); - -#if LV_USE_LAYER_DEBUG || LV_USE_PARALLEL_DRAW_DEBUG - lv_area_t area_rot; - lv_area_copy(&area_rot, coords); - if(draw_dsc->rotation || draw_dsc->scale_x != LV_SCALE_NONE || draw_dsc->scale_y != LV_SCALE_NONE) { - int32_t w = lv_area_get_width(coords); - int32_t h = lv_area_get_height(coords); - - lv_image_buf_get_transformed_area(&area_rot, w, h, draw_dsc->rotation, draw_dsc->scale_x, draw_dsc->scale_y, - &draw_dsc->pivot); - - area_rot.x1 += coords->x1; - area_rot.y1 += coords->y1; - area_rot.x2 += coords->x1; - area_rot.y2 += coords->y1; - } - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, &area_rot, draw_unit->clip_area)) return; -#endif - -#if LV_USE_LAYER_DEBUG - lv_draw_fill_dsc_t fill_dsc; - lv_draw_fill_dsc_init(&fill_dsc); - fill_dsc.color = lv_color_hex(layer_to_draw->color_format == LV_COLOR_FORMAT_ARGB8888 ? 0xff0000 : 0x00ff00); - fill_dsc.opa = LV_OPA_20; - lv_draw_sw_fill(draw_unit, &fill_dsc, &area_rot); - - lv_draw_border_dsc_t border_dsc; - lv_draw_border_dsc_init(&border_dsc); - border_dsc.color = fill_dsc.color; - border_dsc.opa = LV_OPA_60; - border_dsc.width = 2; - lv_draw_sw_border(draw_unit, &border_dsc, &area_rot); - -#endif - -#if LV_USE_PARALLEL_DRAW_DEBUG - uint32_t idx = 0; - lv_draw_unit_t * draw_unit_tmp = _draw_info.unit_head; - while(draw_unit_tmp != draw_unit) { - draw_unit_tmp = draw_unit_tmp->next; - idx++; - } - - lv_draw_fill_dsc_t fill_dsc; - lv_draw_rect_dsc_init(&fill_dsc); - fill_dsc.color = lv_palette_main(idx % LV_PALETTE_LAST); - fill_dsc.opa = LV_OPA_10; - lv_draw_sw_fill(draw_unit, &fill_dsc, &area_rot); - - lv_draw_border_dsc_t border_dsc; - lv_draw_border_dsc_init(&border_dsc); - border_dsc.color = lv_palette_main(idx % LV_PALETTE_LAST); - border_dsc.opa = LV_OPA_100; - border_dsc.width = 2; - lv_draw_sw_border(draw_unit, &border_dsc, &area_rot); - - lv_point_t txt_size; - lv_text_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE); - - lv_area_t txt_area; - txt_area.x1 = draw_area.x1; - txt_area.x2 = draw_area.x1 + txt_size.x - 1; - txt_area.y2 = draw_area.y2; - txt_area.y1 = draw_area.y2 - txt_size.y + 1; - - lv_draw_fill_dsc_init(&fill_dsc); - fill_dsc.color = lv_color_black(); - lv_draw_sw_fill(draw_unit, &fill_dsc, &txt_area); - - char buf[8]; - lv_snprintf(buf, sizeof(buf), "%d", idx); - lv_draw_label_dsc_t label_dsc; - lv_draw_label_dsc_init(&label_dsc); - label_dsc.color = lv_color_white(); - label_dsc.text = buf; - lv_draw_sw_label(draw_unit, &label_dsc, &txt_area); -#endif -} - -#endif /*LV_USE_DRAW_PXP*/ -#endif /*LV_USE_PXP*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp.c b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp.c new file mode 100644 index 0000000..164216f --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp.c @@ -0,0 +1,138 @@ +/** + * @file lv_gpu_nxp_pxp.c + * + */ + +/** + * MIT License + * + * Copyright 2020-2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "lv_gpu_nxp_pxp.h" + +#if LV_USE_GPU_NXP_PXP +#include "lv_gpu_nxp_pxp_osa.h" +#include "../../../core/lv_refr.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/** + * Clean and invalidate cache. + */ +static inline void invalidate_cache(void); + +/********************** + * STATIC VARIABLES + **********************/ + +static lv_nxp_pxp_cfg_t * pxp_cfg; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_res_t lv_gpu_nxp_pxp_init(void) +{ +#if LV_USE_GPU_NXP_PXP_AUTO_INIT + pxp_cfg = lv_gpu_nxp_pxp_get_cfg(); +#endif + + if(!pxp_cfg || !pxp_cfg->pxp_interrupt_deinit || !pxp_cfg->pxp_interrupt_init || + !pxp_cfg->pxp_run || !pxp_cfg->pxp_wait) + PXP_RETURN_INV("PXP configuration error."); + + PXP_Init(LV_GPU_NXP_PXP_ID); + + PXP_EnableCsc1(LV_GPU_NXP_PXP_ID, false); /*Disable CSC1, it is enabled by default.*/ + PXP_SetProcessBlockSize(LV_GPU_NXP_PXP_ID, kPXP_BlockSize16); /*Block size 16x16 for higher performance*/ + + PXP_EnableInterrupts(LV_GPU_NXP_PXP_ID, kPXP_CompleteInterruptEnable); + + if(pxp_cfg->pxp_interrupt_init() != LV_RES_OK) { + PXP_DisableInterrupts(LV_GPU_NXP_PXP_ID, kPXP_CompleteInterruptEnable); + PXP_Deinit(LV_GPU_NXP_PXP_ID); + PXP_RETURN_INV("PXP interrupt init failed."); + } + + return LV_RES_OK; +} + +void lv_gpu_nxp_pxp_deinit(void) +{ + pxp_cfg->pxp_interrupt_deinit(); + PXP_DisableInterrupts(LV_GPU_NXP_PXP_ID, kPXP_CompleteInterruptEnable); + PXP_Deinit(LV_GPU_NXP_PXP_ID); +} + +void lv_gpu_nxp_pxp_reset(void) +{ + /* Wait for previous command to complete before resetting the registers. */ + lv_gpu_nxp_pxp_wait(); + + PXP_ResetControl(LV_GPU_NXP_PXP_ID); + + PXP_EnableCsc1(LV_GPU_NXP_PXP_ID, false); /*Disable CSC1, it is enabled by default.*/ + PXP_SetProcessBlockSize(LV_GPU_NXP_PXP_ID, kPXP_BlockSize16); /*Block size 16x16 for higher performance*/ +} + +void lv_gpu_nxp_pxp_run(void) +{ + invalidate_cache(); + + pxp_cfg->pxp_run(); +} + +void lv_gpu_nxp_pxp_wait(void) +{ + pxp_cfg->pxp_wait(); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static inline void invalidate_cache(void) +{ + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + if(disp->driver->clean_dcache_cb) + disp->driver->clean_dcache_cb(disp->driver); +} + +#endif /*LV_USE_GPU_NXP_PXP*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp.h b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp.h new file mode 100644 index 0000000..46f4a0b --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp.h @@ -0,0 +1,166 @@ +/** + * @file lv_gpu_nxp_pxp.h + * + */ + +/** + * MIT License + * + * Copyright 2020-2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef LV_GPU_NXP_PXP_H +#define LV_GPU_NXP_PXP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +#include "../../../lv_conf_internal.h" + +#if LV_USE_GPU_NXP_PXP +#include "fsl_cache.h" +#include "fsl_pxp.h" + +#include "../../../misc/lv_log.h" + +/********************* + * DEFINES + *********************/ + +/** PXP module instance to use*/ +#define LV_GPU_NXP_PXP_ID PXP + +/** PXP interrupt line ID*/ +#define LV_GPU_NXP_PXP_IRQ_ID PXP_IRQn + +#ifndef LV_GPU_NXP_PXP_LOG_ERRORS +/** Enable logging of PXP errors (\see LV_LOG_ERROR)*/ +#define LV_GPU_NXP_PXP_LOG_ERRORS 1 +#endif + +#ifndef LV_GPU_NXP_PXP_LOG_TRACES +/** Enable logging of PXP errors (\see LV_LOG_ERROR)*/ +#define LV_GPU_NXP_PXP_LOG_TRACES 0 +#endif + +/********************** + * TYPEDEFS + **********************/ + +/** + * NXP PXP device configuration - call-backs used for + * interrupt init/wait/deinit. + */ +typedef struct { + /** Callback for PXP interrupt initialization*/ + lv_res_t (*pxp_interrupt_init)(void); + + /** Callback for PXP interrupt de-initialization*/ + void (*pxp_interrupt_deinit)(void); + + /** Callback for PXP start*/ + void (*pxp_run)(void); + + /** Callback for waiting of PXP completion*/ + void (*pxp_wait)(void); +} lv_nxp_pxp_cfg_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Reset and initialize PXP device. This function should be called as a part + * of display init sequence. + * + * @retval LV_RES_OK PXP init completed + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_PXP_LOG_ERRORS) + */ +lv_res_t lv_gpu_nxp_pxp_init(void); + +/** + * Disable PXP device. Should be called during display deinit sequence. + */ +void lv_gpu_nxp_pxp_deinit(void); + +/** + * Reset PXP device. + */ +void lv_gpu_nxp_pxp_reset(void); + +/** + * Clear cache and start PXP. + */ +void lv_gpu_nxp_pxp_run(void); + +/** + * Wait for PXP completion. + */ +void lv_gpu_nxp_pxp_wait(void); + +/********************** + * MACROS + **********************/ + +#define PXP_COND_STOP(cond, txt) \ + do { \ + if (cond) { \ + LV_LOG_ERROR("%s. STOP!", txt); \ + for ( ; ; ); \ + } \ + } while(0) + +#if LV_GPU_NXP_PXP_LOG_ERRORS +#define PXP_RETURN_INV(fmt, ...) \ + do { \ + LV_LOG_ERROR(fmt, ##__VA_ARGS__); \ + return LV_RES_INV; \ + } while (0) +#else +#define PXP_RETURN_INV(fmt, ...) \ + do { \ + return LV_RES_INV; \ + }while(0) +#endif /*LV_GPU_NXP_PXP_LOG_ERRORS*/ + +#if LV_GPU_NXP_PXP_LOG_TRACES +#define PXP_LOG_TRACE(fmt, ...) \ + do { \ + LV_LOG(fmt, ##__VA_ARGS__); \ + } while (0) +#else +#define PXP_LOG_TRACE(fmt, ...) \ + do { \ + } while (0) +#endif /*LV_GPU_NXP_PXP_LOG_TRACES*/ + +#endif /*LV_USE_GPU_NXP_PXP*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_GPU_NXP_PXP_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c new file mode 100644 index 0000000..8e18840 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c @@ -0,0 +1,180 @@ +/** + * @file lv_gpu_nxp_pxp_osa.c + * + */ + +/** + * MIT License + * + * Copyright 2020, 2022, 2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "lv_gpu_nxp_pxp_osa.h" + +#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT +#include "../../../misc/lv_log.h" +#include "fsl_pxp.h" + +#if defined(SDK_OS_FREE_RTOS) + #include "FreeRTOS.h" + #include "semphr.h" +#endif + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/** + * PXP interrupt initialization. + */ +static lv_res_t _lv_gpu_nxp_pxp_interrupt_init(void); + +/** + * PXP interrupt de-initialization. + */ +static void _lv_gpu_nxp_pxp_interrupt_deinit(void); + +/** + * Start the PXP job. + */ +static void _lv_gpu_nxp_pxp_run(void); + +/** + * Wait for PXP completion. + */ +static void _lv_gpu_nxp_pxp_wait(void); + +/********************** + * STATIC VARIABLES + **********************/ + +#if defined(SDK_OS_FREE_RTOS) + static SemaphoreHandle_t s_pxpIdleSem; +#endif +static volatile bool s_pxpIdle; + +static lv_nxp_pxp_cfg_t pxp_default_cfg = { + .pxp_interrupt_init = _lv_gpu_nxp_pxp_interrupt_init, + .pxp_interrupt_deinit = _lv_gpu_nxp_pxp_interrupt_deinit, + .pxp_run = _lv_gpu_nxp_pxp_run, + .pxp_wait = _lv_gpu_nxp_pxp_wait, +}; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void PXP_IRQHandler(void) +{ +#if defined(SDK_OS_FREE_RTOS) + BaseType_t taskAwake = pdFALSE; +#endif + + if(kPXP_CompleteFlag & PXP_GetStatusFlags(LV_GPU_NXP_PXP_ID)) { + PXP_ClearStatusFlags(LV_GPU_NXP_PXP_ID, kPXP_CompleteFlag); +#if defined(SDK_OS_FREE_RTOS) + xSemaphoreGiveFromISR(s_pxpIdleSem, &taskAwake); + portYIELD_FROM_ISR(taskAwake); +#else + s_pxpIdle = true; +#endif + } +} + +lv_nxp_pxp_cfg_t * lv_gpu_nxp_pxp_get_cfg(void) +{ + return &pxp_default_cfg; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static lv_res_t _lv_gpu_nxp_pxp_interrupt_init(void) +{ +#if defined(SDK_OS_FREE_RTOS) + s_pxpIdleSem = xSemaphoreCreateBinary(); + if(s_pxpIdleSem == NULL) + return LV_RES_INV; + + NVIC_SetPriority(LV_GPU_NXP_PXP_IRQ_ID, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY + 1); +#endif + s_pxpIdle = true; + + NVIC_EnableIRQ(LV_GPU_NXP_PXP_IRQ_ID); + + return LV_RES_OK; +} + +static void _lv_gpu_nxp_pxp_interrupt_deinit(void) +{ + NVIC_DisableIRQ(LV_GPU_NXP_PXP_IRQ_ID); +#if defined(SDK_OS_FREE_RTOS) + vSemaphoreDelete(s_pxpIdleSem); +#endif +} + +/** + * Function to start PXP job. + */ +static void _lv_gpu_nxp_pxp_run(void) +{ + s_pxpIdle = false; + + PXP_EnableInterrupts(LV_GPU_NXP_PXP_ID, kPXP_CompleteInterruptEnable); + PXP_Start(LV_GPU_NXP_PXP_ID); +} + +/** + * Function to wait for PXP completion. + */ +static void _lv_gpu_nxp_pxp_wait(void) +{ +#if defined(SDK_OS_FREE_RTOS) + /* Return if PXP was never started, otherwise the semaphore will lock forever. */ + if(s_pxpIdle == true) + return; + + if(xSemaphoreTake(s_pxpIdleSem, portMAX_DELAY) == pdTRUE) + s_pxpIdle = true; +#else + while(s_pxpIdle == false) { + } +#endif +} + +#endif /*LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.h b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.h new file mode 100644 index 0000000..5c87824 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.h @@ -0,0 +1,78 @@ +/** + * @file lv_gpu_nxp_pxp_osa.h + * + */ + +/** + * MIT License + * + * Copyright 2020, 2022 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef LV_GPU_NXP_PXP_OSA_H +#define LV_GPU_NXP_PXP_OSA_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +#include "../../../lv_conf_internal.h" + +#if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT +#include "lv_gpu_nxp_pxp.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * PXP device interrupt handler. Used to check PXP task completion status. + */ +void PXP_IRQHandler(void); + +/** + * Helper function to get the PXP default configuration. + */ +lv_nxp_pxp_cfg_t * lv_gpu_nxp_pxp_get_cfg(void); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_GPU_NXP_PXP_OSA_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_cfg.c b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_cfg.c deleted file mode 100644 index 675c1d0..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_cfg.c +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @file lv_pxp_cfg.c - * - */ - -/** - * Copyright 2020-2023 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_pxp_cfg.h" - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP -#include "lv_pxp_osa.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -static pxp_cfg_t * _pxp_cfg; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_pxp_init(void) -{ - _pxp_cfg = pxp_get_default_cfg(); - - PXP_Init(PXP_ID); - - PXP_EnableCsc1(PXP_ID, false); /*Disable CSC1, it is enabled by default.*/ - PXP_SetProcessBlockSize(PXP_ID, kPXP_BlockSize16); /*Block size 16x16 for higher performance*/ - - PXP_EnableInterrupts(PXP_ID, kPXP_CompleteInterruptEnable); - - _pxp_cfg->pxp_interrupt_init(); -} - -void lv_pxp_deinit(void) -{ - _pxp_cfg->pxp_interrupt_deinit(); - PXP_DisableInterrupts(PXP_ID, kPXP_CompleteInterruptEnable); - PXP_Deinit(PXP_ID); -} - -void lv_pxp_reset(void) -{ - PXP_ResetControl(PXP_ID); - - PXP_EnableCsc1(PXP_ID, false); /*Disable CSC1, it is enabled by default.*/ - PXP_SetProcessBlockSize(PXP_ID, kPXP_BlockSize16); /*Block size 16x16 for higher performance*/ -} - -void lv_pxp_run(void) -{ - _pxp_cfg->pxp_run(); - _pxp_cfg->pxp_wait(); -} - -void lv_pxp_wait(void) -{ - _pxp_cfg->pxp_wait(); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/ -#endif /*LV_USE_PXP*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_cfg.h b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_cfg.h deleted file mode 100644 index 67d1358..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_cfg.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @file lv_pxp_cfg.h - * - */ - -/** - * Copyright 2020-2023 NXP - * - * SPDX-License-Identifier: MIT - */ - -#ifndef LV_PXP_CFG_H -#define LV_PXP_CFG_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../../lv_conf_internal.h" - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP -#include "fsl_cache.h" -#include "fsl_pxp.h" - -#include "../../../misc/lv_log.h" - -/********************* - * DEFINES - *********************/ - -/** PXP module instance to use*/ -#define PXP_ID PXP - -/** PXP interrupt line ID*/ -#define PXP_IRQ_ID PXP_IRQn - -/********************** - * TYPEDEFS - **********************/ - -/** - * NXP PXP device configuration. - */ -typedef struct { - /** Callback for PXP interrupt initialization*/ - void (*pxp_interrupt_init)(void); - - /** Callback for PXP interrupt de-initialization*/ - void (*pxp_interrupt_deinit)(void); - - /** Callback for PXP start*/ - void (*pxp_run)(void); - - /** Callback for waiting of PXP completion*/ - void (*pxp_wait)(void); -} pxp_cfg_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Reset and initialize PXP device. This function should be called as a part - * of display init sequence. - */ -void lv_pxp_init(void); - -/** - * Disable PXP device. Should be called during display deinit sequence. - */ -void lv_pxp_deinit(void); - -/** - * Reset PXP device. - */ -void lv_pxp_reset(void); - -/** - * Clear cache and start PXP. - */ -void lv_pxp_run(void); - -/** - * Wait for PXP completion. - */ -void lv_pxp_wait(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/ -#endif /*LV_USE_PXP*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_PXP_CFG_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_osa.c b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_osa.c deleted file mode 100644 index 43dd815..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_osa.c +++ /dev/null @@ -1,188 +0,0 @@ -/** - * @file lv_pxp_osa.c - * - */ - -/** - * Copyright 2020, 2022-2023 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_pxp_osa.h" - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP -#include "lv_pxp_utils.h" -#include "../../../misc/lv_log.h" -#include "../../../osal/lv_os.h" -#include "fsl_pxp.h" - -#if defined(SDK_OS_FREE_RTOS) - #include "FreeRTOS.h" -#endif - -#if defined(__ZEPHYR__) - #include - #include -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/** - * PXP interrupt initialization. - */ -static void _pxp_interrupt_init(void); - -/** - * PXP interrupt de-initialization. - */ -static void _pxp_interrupt_deinit(void); - -/** - * Start the PXP job. - */ -static void _pxp_run(void); - -/** - * Wait for PXP completion. - */ -static void _pxp_wait(void); - -#if defined(__ZEPHYR__) - /** - * Interrupt handler for Zephyr IRQ - */ - static void _pxp_zephyr_irq_handler(void *); -#endif - -/********************** - * STATIC VARIABLES - **********************/ - -#if LV_USE_OS - static lv_thread_sync_t pxp_sync; -#endif -static volatile bool ucPXPIdle; - -static pxp_cfg_t _pxp_default_cfg = { - .pxp_interrupt_init = _pxp_interrupt_init, - .pxp_interrupt_deinit = _pxp_interrupt_deinit, - .pxp_run = _pxp_run, - .pxp_wait = _pxp_wait, -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void PXP_IRQHandler(void) -{ - if(kPXP_CompleteFlag & PXP_GetStatusFlags(PXP_ID)) { - PXP_ClearStatusFlags(PXP_ID, kPXP_CompleteFlag); -#if LV_USE_OS - lv_thread_sync_signal_isr(&pxp_sync); -#else - ucPXPIdle = true; -#endif - } -} - -pxp_cfg_t * pxp_get_default_cfg(void) -{ - return &_pxp_default_cfg; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#if defined(__ZEPHYR__) -static void _pxp_zephyr_irq_handler(void *) -{ - PXP_IRQHandler(); -} -#endif - -static void _pxp_interrupt_init(void) -{ -#if LV_USE_OS - if(lv_thread_sync_init(&pxp_sync) != LV_RESULT_OK) { - PXP_ASSERT_MSG(false, "Failed to init thread_sync."); - } -#endif - -#if defined(__ZEPHYR__) - IRQ_CONNECT(DT_IRQN(DT_NODELABEL(pxp)), CONFIG_LV_Z_PXP_INTERRUPT_PRIORITY, _pxp_zephyr_irq_handler, NULL, 0); - irq_enable(DT_IRQN(DT_NODELABEL(pxp))); -#elif defined(SDK_OS_FREE_RTOS) - NVIC_SetPriority(PXP_IRQ_ID, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY + 1); -#endif - -#if !defined(__ZEPHYR__) - NVIC_EnableIRQ(PXP_IRQ_ID); -#endif - - ucPXPIdle = true; -} - -static void _pxp_interrupt_deinit(void) -{ -#if defined(__ZEPHYR__) - irq_disable(DT_IRQN(DT_NODELABEL(pxp))); -#else - NVIC_DisableIRQ(PXP_IRQ_ID); -#endif - -#if LV_USE_OS - lv_thread_sync_delete(&pxp_sync); -#endif -} - -/** - * Function to start PXP job. - */ -static void _pxp_run(void) -{ - ucPXPIdle = false; - - PXP_EnableInterrupts(PXP_ID, kPXP_CompleteInterruptEnable); - PXP_Start(PXP_ID); -} - -/** - * Function to wait for PXP completion. - */ -static void _pxp_wait(void) -{ - if(ucPXPIdle == true) - return; -#if LV_USE_OS - if(lv_thread_sync_wait(&pxp_sync) == LV_RESULT_OK) - ucPXPIdle = true; -#else - while(ucPXPIdle == false) { - } -#endif -} - -#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/ -#endif /*LV_USE_PXP*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_osa.h b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_osa.h deleted file mode 100644 index 5e3d666..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_osa.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file lv_pxp_osa.h - * - */ - -/** - * Copyright 2020, 2022-2023 NXP - * - * SPDX-License-Identifier: MIT - */ - -#ifndef LV_PXP_OSA_H -#define LV_PXP_OSA_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../../lv_conf_internal.h" - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP -#include "lv_pxp_cfg.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * PXP device interrupt handler. Used to check PXP task completion status. - */ -void PXP_IRQHandler(void); - -/** - * Get the PXP default configuration. - */ -pxp_cfg_t * pxp_get_default_cfg(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/ -#endif /*LV_USE_PXP*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_PXP_OSA_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_utils.c b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_utils.c deleted file mode 100644 index 26acf6c..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_utils.c +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @file lv_pxp_utils.c - * - */ - -/** - * Copyright 2023-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_pxp_utils.h" - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -pxp_output_pixel_format_t pxp_get_out_px_format(lv_color_format_t cf) -{ - pxp_output_pixel_format_t out_px_format = kPXP_OutputPixelFormatRGB565; - - switch(cf) { - case LV_COLOR_FORMAT_RGB565: - out_px_format = kPXP_OutputPixelFormatRGB565; - break; - case LV_COLOR_FORMAT_RGB888: - out_px_format = kPXP_OutputPixelFormatRGB888P; - break; - case LV_COLOR_FORMAT_ARGB8888: - out_px_format = kPXP_OutputPixelFormatARGB8888; - break; - case LV_COLOR_FORMAT_XRGB8888: - out_px_format = kPXP_OutputPixelFormatRGB888; - break; - - default: - PXP_ASSERT_MSG(false, "Unsupported color format."); - break; - } - - return out_px_format; -} - -pxp_as_pixel_format_t pxp_get_as_px_format(lv_color_format_t cf) -{ - pxp_as_pixel_format_t as_px_format = kPXP_AsPixelFormatRGB565; - - switch(cf) { - case LV_COLOR_FORMAT_RGB565: - as_px_format = kPXP_AsPixelFormatRGB565; - break; - case LV_COLOR_FORMAT_RGB888: - PXP_ASSERT_MSG(false, "Unsupported color format."); - break; - case LV_COLOR_FORMAT_ARGB8888: - as_px_format = kPXP_AsPixelFormatARGB8888; - break; - case LV_COLOR_FORMAT_XRGB8888: - as_px_format = kPXP_AsPixelFormatRGB888; - break; - - default: - PXP_ASSERT_MSG(false, "Unsupported color format."); - break; - } - - return as_px_format; -} - -#if LV_USE_DRAW_PXP -pxp_ps_pixel_format_t pxp_get_ps_px_format(lv_color_format_t cf) -{ - pxp_ps_pixel_format_t ps_px_format = kPXP_PsPixelFormatRGB565; - - switch(cf) { - case LV_COLOR_FORMAT_RGB565: - ps_px_format = kPXP_PsPixelFormatRGB565; - break; - case LV_COLOR_FORMAT_RGB888: - PXP_ASSERT_MSG(false, "Unsupported color format."); - break; - case LV_COLOR_FORMAT_ARGB8888: -#if (!(defined(FSL_FEATURE_PXP_HAS_NO_EXTEND_PIXEL_FORMAT) && FSL_FEATURE_PXP_HAS_NO_EXTEND_PIXEL_FORMAT)) && \ - (!(defined(FSL_FEATURE_PXP_V3) && FSL_FEATURE_PXP_V3)) - ps_px_format = kPXP_PsPixelFormatARGB8888; -#else - PXP_ASSERT_MSG(false, "Unsupported color format."); -#endif - break; - case LV_COLOR_FORMAT_XRGB8888: -#if (!(defined(FSL_FEATURE_PXP_HAS_NO_EXTEND_PIXEL_FORMAT) && FSL_FEATURE_PXP_HAS_NO_EXTEND_PIXEL_FORMAT)) && \ - (!(defined(FSL_FEATURE_PXP_V3) && FSL_FEATURE_PXP_V3)) - ps_px_format = kPXP_PsPixelFormatARGB8888; -#else - ps_px_format = kPXP_PsPixelFormatRGB888; -#endif - break; - - default: - PXP_ASSERT_MSG(false, "Unsupported color format."); - break; - } - - return ps_px_format; -} - -bool pxp_buf_aligned(const void * buf, uint32_t stride) -{ - /* Test for pointer alignment */ - if((uintptr_t)buf % 64) - return false; - - /* Test for invalid stride (no stride alignment required) */ - if(stride == 0) - return false; - - return true; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_PXP*/ -#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/ -#endif /*LV_USE_PXP*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_utils.h b/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_utils.h deleted file mode 100644 index c9ba7ba..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/pxp/lv_pxp_utils.h +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file lv_pxp_utils.h - * - */ - -/** - * Copyright 2023-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -#ifndef LV_PXP_UTILS_H -#define LV_PXP_UTILS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../../lv_conf_internal.h" - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP -#include "fsl_pxp.h" -#include "../../../misc/lv_color.h" - -/********************* - * DEFINES - *********************/ - -#if LV_USE_PXP_ASSERT -#define PXP_ASSERT(expr) LV_ASSERT(expr) -#else -#define PXP_ASSERT(expr) -#endif - -#define PXP_ASSERT_MSG(expr, msg) \ - do { \ - if(!(expr)) { \ - LV_LOG_ERROR(msg); \ - PXP_ASSERT(false); \ - } \ - } while(0) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -pxp_output_pixel_format_t pxp_get_out_px_format(lv_color_format_t cf); - -pxp_as_pixel_format_t pxp_get_as_px_format(lv_color_format_t cf); - -#if LV_USE_DRAW_PXP -pxp_ps_pixel_format_t pxp_get_ps_px_format(lv_color_format_t cf); - -bool pxp_buf_aligned(const void * buf, uint32_t stride); - -/********************** - * MACROS - **********************/ - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_PXP*/ -#endif /*LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP*/ -#endif /*LV_USE_PXP*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_PXP_UTILS_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_buf_vglite.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_buf_vglite.c deleted file mode 100644 index 8540395..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_buf_vglite.c +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @file lv_draw_buf_vglite.c - * - */ - -/** - * Copyright 2023-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_vglite.h" - -#if LV_USE_DRAW_VGLITE -#include "../../lv_draw_buf_private.h" -#include "lv_vglite_buf.h" -#include "lv_vglite_utils.h" - -#include "lvgl_support.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void _invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area); -static uint32_t _width_to_stride(uint32_t w, lv_color_format_t cf); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_buf_vglite_init_handlers(void) -{ - lv_draw_buf_handlers_t * handlers = lv_draw_buf_get_handlers(); - lv_draw_buf_handlers_t * font_handlers = lv_draw_buf_get_font_handlers(); - lv_draw_buf_handlers_t * image_handlers = lv_draw_buf_get_image_handlers(); - - handlers->invalidate_cache_cb = _invalidate_cache; - font_handlers->invalidate_cache_cb = _invalidate_cache; - image_handlers->invalidate_cache_cb = _invalidate_cache; - - handlers->width_to_stride_cb = _width_to_stride; - font_handlers->width_to_stride_cb = _width_to_stride; - image_handlers->width_to_stride_cb = _width_to_stride; - -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void _invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area) -{ - const lv_image_header_t * header = &draw_buf->header; - uint32_t stride = header->stride; - lv_color_format_t cf = header->cf; - - if(area->y1 == 0) { - uint32_t size = stride * lv_area_get_height(area); - - /* Invalidate full buffer. */ - DEMO_CleanInvalidateCacheByAddr((void *)draw_buf->data, size); - return; - } - - const uint8_t * buf_u8 = draw_buf->data; - /* ARM require a 32 byte aligned address. */ - uint8_t align_bytes = 32; - uint8_t bits_per_pixel = lv_color_format_get_bpp(cf); - - uint16_t align_pixels = align_bytes * 8 / bits_per_pixel; - uint16_t offset_x = 0; - - if(area->x1 >= (int32_t)(area->x1 % align_pixels)) { - uint16_t shift_x = area->x1 - (area->x1 % align_pixels); - - offset_x = area->x1 - shift_x; - buf_u8 += (shift_x * bits_per_pixel) / 8; - } - - if(area->y1) { - uint16_t shift_y = area->y1; - - buf_u8 += shift_y * stride; - } - - /* Area to clear can start from a different offset in buffer. - * Invalidate the area line by line. - */ - uint16_t line_pixels = offset_x + lv_area_get_width(area); - uint16_t line_size = (line_pixels * bits_per_pixel) / 8; - uint16_t area_height = lv_area_get_height(area); - - for(uint16_t y = 0; y < area_height; y++) { - const void * line_addr = buf_u8 + y * stride; - - DEMO_CleanInvalidateCacheByAddr((void *)line_addr, line_size); - } -} - -static uint32_t _width_to_stride(uint32_t w, lv_color_format_t cf) -{ - uint8_t bits_per_pixel = lv_color_format_get_bpp(cf); - uint32_t width_bits = (w * bits_per_pixel + 7) & ~7; - uint32_t width_bytes = width_bits / 8; - uint8_t align_bytes = vglite_get_stride_alignment(cf); - - return (width_bytes + align_bytes - 1) & ~(align_bytes - 1); -} - -#endif /*LV_USE_DRAW_VGLITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_nxp_vglite.mk b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_nxp_vglite.mk new file mode 100644 index 0000000..c9473cc --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_nxp_vglite.mk @@ -0,0 +1,12 @@ +CSRCS += lv_draw_vglite.c +CSRCS += lv_draw_vglite_arc.c +CSRCS += lv_draw_vglite_blend.c +CSRCS += lv_draw_vglite_line.c +CSRCS += lv_draw_vglite_rect.c +CSRCS += lv_vglite_buf.c +CSRCS += lv_vglite_utils.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp/vglite +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp/vglite + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp/vglite" diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite.c index c6fc016..031f57e 100644 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite.c +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite.c @@ -4,9 +4,27 @@ */ /** - * Copyright 2023-2024 NXP + * MIT License + * + * Copyright 2022, 2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * SPDX-License-Identifier: MIT */ /********************* @@ -15,87 +33,68 @@ #include "lv_draw_vglite.h" -#if LV_USE_DRAW_VGLITE +#if LV_USE_GPU_NXP_VG_LITE +#include +#include "lv_draw_vglite_blend.h" +#include "lv_draw_vglite_line.h" +#include "lv_draw_vglite_rect.h" +#include "lv_draw_vglite_arc.h" #include "lv_vglite_buf.h" -#include "lv_vglite_utils.h" -#include "../../../core/lv_global.h" +#if LV_COLOR_DEPTH != 32 + #include "../../../core/lv_refr.h" +#endif /********************* * DEFINES *********************/ -#define DRAW_UNIT_ID_VGLITE 2 - -#if LV_USE_VGLITE_DRAW_ASYNC - #define VGLITE_TASK_BUF_SIZE 100 +/* Minimum area (in pixels) for VG-Lite blit/fill processing. */ +#ifndef LV_GPU_NXP_VG_LITE_SIZE_LIMIT + #define LV_GPU_NXP_VG_LITE_SIZE_LIMIT 5000 #endif /********************** * TYPEDEFS **********************/ -#if LV_USE_VGLITE_DRAW_ASYNC -/** - * Structure of pending vglite draw task - */ -typedef struct _vglite_draw_task_t { - lv_draw_task_t * task; - bool flushed; -} vglite_draw_tasks_t; -#endif - /********************** * STATIC PROTOTYPES **********************/ -/* - * Evaluate a task and set the score and preferred VGLite draw unit. - * Return 1 if task is preferred, 0 otherwise (task is not supported). - */ -static int32_t _vglite_evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task); +static void lv_draw_vglite_init_buf(lv_draw_ctx_t * draw_ctx); -/* - * Dispatch (assign) a task to VGLite draw unit (itself). - * Return 1 if task was dispatched, 0 otherwise (task not supported). - */ -static int32_t _vglite_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer); +static void lv_draw_vglite_wait_for_finish(lv_draw_ctx_t * draw_ctx); -/* - * Wait for VG-Lite draw unit to finish. - */ -#if LV_USE_VGLITE_DRAW_ASYNC - static int32_t _vglite_wait_for_finish(lv_draw_unit_t * draw_unit); -#endif +static void lv_draw_vglite_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, + const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t cf); -/* - * Delete the VGLite draw unit. - */ -static int32_t _vglite_delete(lv_draw_unit_t * draw_unit); +static void lv_draw_vglite_buffer_copy(lv_draw_ctx_t * draw_ctx, + void * dest_buf, lv_coord_t dest_stride, const lv_area_t * dest_area, + void * src_buf, lv_coord_t src_stride, const lv_area_t * src_area); -#if LV_USE_VGLITE_DRAW_THREAD - static void _vglite_render_thread_cb(void * ptr); -#endif +static void lv_draw_vglite_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc); + +static void lv_draw_vglite_line(lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, const lv_point_t * point1, + const lv_point_t * point2); + +static void lv_draw_vglite_rect(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); + +static lv_res_t lv_draw_vglite_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); + +static lv_res_t lv_draw_vglite_border(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, + const lv_area_t * coords); + +static lv_res_t lv_draw_vglite_outline(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, + const lv_area_t * coords); -static void _vglite_execute_drawing(lv_draw_vglite_unit_t * u); +static void lv_draw_vglite_arc(lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center, + uint16_t radius, uint16_t start_angle, uint16_t end_angle); /********************** * STATIC VARIABLES **********************/ -#define _draw_info LV_GLOBAL_DEFAULT()->draw_info - -#if LV_USE_VGLITE_DRAW_ASYNC - /* - * Circular buffer to hold the queued and the flushed tasks. - * Two indexes, _head and _tail, are used to signal the beginning - * and the end of the valid tasks that are pending. - */ - static vglite_draw_tasks_t _draw_task_buf[VGLITE_TASK_BUF_SIZE]; - static volatile int _head = 0; - static volatile int _tail = 0; -#endif - /********************** * MACROS **********************/ @@ -104,491 +103,455 @@ static void _vglite_execute_drawing(lv_draw_vglite_unit_t * u); * GLOBAL FUNCTIONS **********************/ -void lv_draw_vglite_init(void) +void lv_draw_vglite_ctx_init(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) { - lv_draw_buf_vglite_init_handlers(); - - lv_draw_vglite_unit_t * draw_vglite_unit = lv_draw_create_unit(sizeof(lv_draw_vglite_unit_t)); - draw_vglite_unit->base_unit.evaluate_cb = _vglite_evaluate; - draw_vglite_unit->base_unit.dispatch_cb = _vglite_dispatch; -#if LV_USE_VGLITE_DRAW_ASYNC - draw_vglite_unit->base_unit.wait_for_finish_cb = _vglite_wait_for_finish; -#endif - draw_vglite_unit->base_unit.delete_cb = _vglite_delete; - -#if LV_USE_VGLITE_DRAW_THREAD - lv_thread_init(&draw_vglite_unit->thread, LV_THREAD_PRIO_HIGH, _vglite_render_thread_cb, 2 * 1024, draw_vglite_unit); -#endif + lv_draw_sw_init_ctx(drv, draw_ctx); + + lv_draw_vglite_ctx_t * vglite_draw_ctx = (lv_draw_sw_ctx_t *)draw_ctx; + vglite_draw_ctx->base_draw.init_buf = lv_draw_vglite_init_buf; + vglite_draw_ctx->base_draw.draw_line = lv_draw_vglite_line; + vglite_draw_ctx->base_draw.draw_arc = lv_draw_vglite_arc; + vglite_draw_ctx->base_draw.draw_rect = lv_draw_vglite_rect; + vglite_draw_ctx->base_draw.draw_img_decoded = lv_draw_vglite_img_decoded; + vglite_draw_ctx->blend = lv_draw_vglite_blend; + vglite_draw_ctx->base_draw.wait_for_finish = lv_draw_vglite_wait_for_finish; + vglite_draw_ctx->base_draw.buffer_copy = lv_draw_vglite_buffer_copy; } -void lv_draw_vglite_deinit(void) +void lv_draw_vglite_ctx_deinit(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) { + lv_draw_sw_deinit_ctx(drv, draw_ctx); } /********************** * STATIC FUNCTIONS **********************/ -static inline bool _vglite_src_cf_supported(lv_color_format_t cf) +/** + * During rendering, LVGL might initializes new draw_ctxs and start drawing into + * a separate buffer (called layer). If the content to be rendered has "holes", + * e.g. rounded corner, LVGL temporarily sets the disp_drv.screen_transp flag. + * It means the renderers should draw into an ARGB buffer. + * With 32 bit color depth it's not a big problem but with 16 bit color depth + * the target pixel format is ARGB8565 which is not supported by the GPU. + * In this case, the VG-Lite callbacks should fallback to SW rendering. + */ +static inline bool need_argb8565_support() { - bool is_cf_supported = false; - - switch(cf) { -#if CHIPID == 0x255 || CHIPID == 0x555 - case LV_COLOR_FORMAT_I1: - case LV_COLOR_FORMAT_I2: - case LV_COLOR_FORMAT_I4: - case LV_COLOR_FORMAT_I8: -#endif - case LV_COLOR_FORMAT_A4: - case LV_COLOR_FORMAT_A8: - case LV_COLOR_FORMAT_L8: - case LV_COLOR_FORMAT_RGB565: -#if CHIPID == 0x555 - case LV_COLOR_FORMAT_RGB565A8: - case LV_COLOR_FORMAT_RGB888: +#if LV_COLOR_DEPTH != 32 + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + + if(disp->driver->screen_transp == 1) + return true; #endif - case LV_COLOR_FORMAT_ARGB8888: - case LV_COLOR_FORMAT_XRGB8888: - is_cf_supported = true; - break; - default: - break; - } - return is_cf_supported; + return false; } -static inline bool _vglite_dest_cf_supported(lv_color_format_t cf) +static void lv_draw_vglite_init_buf(lv_draw_ctx_t * draw_ctx) { - bool is_cf_supported = false; - - switch(cf) { - case LV_COLOR_FORMAT_A8: -#if CHIPID == 0x255 || CHIPID == 0x555 - case LV_COLOR_FORMAT_L8: -#endif - case LV_COLOR_FORMAT_RGB565: -#if CHIPID == 0x555 - case LV_COLOR_FORMAT_RGB565A8: - case LV_COLOR_FORMAT_RGB888: -#endif - case LV_COLOR_FORMAT_ARGB8888: - case LV_COLOR_FORMAT_XRGB8888: - is_cf_supported = true; - break; - default: - break; - } - - return is_cf_supported; + lv_gpu_nxp_vglite_init_buf(draw_ctx->buf, draw_ctx->buf_area, lv_area_get_width(draw_ctx->buf_area)); } -static int32_t _vglite_evaluate(lv_draw_unit_t * u, lv_draw_task_t * t) +static void lv_draw_vglite_wait_for_finish(lv_draw_ctx_t * draw_ctx) { - LV_UNUSED(u); - - const lv_draw_dsc_base_t * draw_dsc_base = (lv_draw_dsc_base_t *) t->draw_dsc; - - if(!_vglite_dest_cf_supported(draw_dsc_base->layer->color_format)) - return 0; - - switch(t->type) { - case LV_DRAW_TASK_TYPE_FILL: - if(t->preference_score > 80) { - t->preference_score = 80; - t->preferred_draw_unit_id = DRAW_UNIT_ID_VGLITE; - } - return 1; - - case LV_DRAW_TASK_TYPE_LINE: - case LV_DRAW_TASK_TYPE_ARC: - case LV_DRAW_TASK_TYPE_TRIANGLE: - if(t->preference_score > 90) { - t->preference_score = 90; - t->preferred_draw_unit_id = DRAW_UNIT_ID_VGLITE; - } - return 1; - - case LV_DRAW_TASK_TYPE_LABEL: - if(t->preference_score > 95) { - t->preference_score = 95; - t->preferred_draw_unit_id = DRAW_UNIT_ID_VGLITE; - } - return 1; - - case LV_DRAW_TASK_TYPE_BORDER: { - if(t->preference_score > 90) { - t->preference_score = 90; - t->preferred_draw_unit_id = DRAW_UNIT_ID_VGLITE; - } - return 1; - } - - case LV_DRAW_TASK_TYPE_LAYER: { - const lv_draw_image_dsc_t * draw_dsc = (lv_draw_image_dsc_t *) t->draw_dsc; - lv_layer_t * layer_to_draw = (lv_layer_t *)draw_dsc->src; - -#if LV_USE_VGLITE_BLIT_SPLIT - bool has_transform = (draw_dsc->rotation != 0 || draw_dsc->scale_x != LV_SCALE_NONE || - draw_dsc->scale_y != LV_SCALE_NONE); -#endif - if(!_vglite_src_cf_supported(layer_to_draw->color_format) -#if LV_USE_VGLITE_BLIT_SPLIT - || has_transform -#endif - ) - return 0; - - if(t->preference_score > 80) { - t->preference_score = 80; - t->preferred_draw_unit_id = DRAW_UNIT_ID_VGLITE; - } - return 1; - } - - case LV_DRAW_TASK_TYPE_IMAGE: { - lv_draw_image_dsc_t * draw_dsc = (lv_draw_image_dsc_t *) t->draw_dsc; - const lv_image_dsc_t * img_dsc = draw_dsc->src; - -#if LV_USE_VGLITE_BLIT_SPLIT - bool has_transform = (draw_dsc->rotation != 0 || draw_dsc->scale_x != LV_SCALE_NONE || - draw_dsc->scale_y != LV_SCALE_NONE); -#endif - - if((!_vglite_src_cf_supported(img_dsc->header.cf)) -#if LV_USE_VGLITE_BLIT_SPLIT - || has_transform -#endif - || (!vglite_src_buf_aligned(img_dsc->data, img_dsc->header.stride, img_dsc->header.cf)) - ) - return 0; - - if(t->preference_score > 80) { - t->preference_score = 80; - t->preferred_draw_unit_id = DRAW_UNIT_ID_VGLITE; - } - return 1; - } - default: - return 0; - } + vg_lite_finish(); - return 0; + lv_draw_sw_wait_for_finish(draw_ctx); } -static int32_t _vglite_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer) +static void lv_draw_vglite_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc) { - lv_draw_vglite_unit_t * draw_vglite_unit = (lv_draw_vglite_unit_t *) draw_unit; + if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) + return; - /* Return immediately if it's busy with draw task. */ - if(draw_vglite_unit->task_act) - return 0; + if(need_argb8565_support()) { + lv_draw_sw_blend_basic(draw_ctx, dsc); + return; + } + + lv_area_t blend_area; + if(!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area)) + return; /*Fully clipped, nothing to do*/ - /* Try to get an ready to draw. */ - lv_draw_task_t * t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_VGLITE); + lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); - if(t == NULL) - return LV_DRAW_UNIT_IDLE; + bool done = false; + /*Fill/Blend only non masked, normal blended*/ + if(dsc->mask_buf == NULL && dsc->blend_mode == LV_BLEND_MODE_NORMAL && + lv_area_get_size(&blend_area) >= LV_GPU_NXP_VG_LITE_SIZE_LIMIT) { + const lv_color_t * src_buf = dsc->src_buf; - if(t->preferred_draw_unit_id != DRAW_UNIT_ID_VGLITE) { - /* Let the preferred known unit to draw this task. */ - if(t->preferred_draw_unit_id != LV_DRAW_UNIT_NONE) { - return LV_DRAW_UNIT_IDLE; + if(src_buf == NULL) { + done = (lv_gpu_nxp_vglite_fill(&blend_area, dsc->color, dsc->opa) == LV_RES_OK); + if(!done) + VG_LITE_LOG_TRACE("VG-Lite fill failed. Fallback."); } else { - /* Fake unsupported tasks as ready. */ - t->state = LV_DRAW_TASK_STATE_READY; - /* Request a new dispatching as it can get a new task. */ - lv_draw_dispatch_request(); + lv_area_t src_area; + src_area.x1 = blend_area.x1 - (dsc->blend_area->x1 - draw_ctx->buf_area->x1); + src_area.y1 = blend_area.y1 - (dsc->blend_area->y1 - draw_ctx->buf_area->y1); + src_area.x2 = src_area.x1 + lv_area_get_width(dsc->blend_area) - 1; + src_area.y2 = src_area.y1 + lv_area_get_height(dsc->blend_area) - 1; + lv_coord_t src_stride = lv_area_get_width(dsc->blend_area); + +#if VG_LITE_BLIT_SPLIT_ENABLED + lv_color_t * dest_buf = draw_ctx->buf; + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); + + done = (lv_gpu_nxp_vglite_blit_split(dest_buf, &blend_area, dest_stride, + src_buf, &src_area, src_stride, dsc->opa) == LV_RES_OK); +#else + done = (lv_gpu_nxp_vglite_blit(&blend_area, src_buf, &src_area, src_stride, dsc->opa) == LV_RES_OK); +#endif - return 1; + if(!done) + VG_LITE_LOG_TRACE("VG-Lite blit failed. Fallback."); } } - if(lv_draw_layer_alloc_buf(layer) == NULL) - return LV_DRAW_UNIT_IDLE; + if(!done) + lv_draw_sw_blend_basic(draw_ctx, dsc); +} - t->state = LV_DRAW_TASK_STATE_IN_PROGRESS; - draw_vglite_unit->base_unit.target_layer = layer; - draw_vglite_unit->base_unit.clip_area = &t->clip_area; - draw_vglite_unit->task_act = t; +static void lv_draw_vglite_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, + const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t cf) +{ + if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) + return; -#if LV_USE_VGLITE_DRAW_THREAD - /* Let the render thread work. */ - if(draw_vglite_unit->inited) - lv_thread_sync_signal(&draw_vglite_unit->sync); -#else - _vglite_execute_drawing(draw_vglite_unit); + if(need_argb8565_support()) { + lv_draw_sw_img_decoded(draw_ctx, dsc, coords, map_p, cf); + return; + } - draw_vglite_unit->task_act->state = LV_DRAW_TASK_STATE_READY; - draw_vglite_unit->task_act = NULL; + const lv_color_t * src_buf = (const lv_color_t *)map_p; + if(!src_buf) { + lv_draw_sw_img_decoded(draw_ctx, dsc, coords, map_p, cf); + return; + } - /* The draw unit is free now. Request a new dispatching as it can get a new task. */ - lv_draw_dispatch_request(); -#endif + lv_area_t rel_coords; + lv_area_copy(&rel_coords, coords); + lv_area_move(&rel_coords, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); - return 1; -} + lv_area_t rel_clip_area; + lv_area_copy(&rel_clip_area, draw_ctx->clip_area); + lv_area_move(&rel_clip_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); -#if LV_USE_VGLITE_DRAW_ASYNC -static int32_t _vglite_wait_for_finish(lv_draw_unit_t * draw_unit) -{ - lv_draw_vglite_unit_t * draw_vglite_unit = (lv_draw_vglite_unit_t *) draw_unit; - draw_vglite_unit->wait_for_finish = true; + lv_area_t blend_area; + bool has_transform = dsc->angle != 0 || dsc->zoom != LV_IMG_ZOOM_NONE; - /* Signal draw unit to finish its tasks and return READY state after completion. */ - if(draw_vglite_unit->inited) - lv_thread_sync_signal(&draw_vglite_unit->sync); + if(has_transform) + lv_area_copy(&blend_area, &rel_coords); + else if(!_lv_area_intersect(&blend_area, &rel_coords, &rel_clip_area)) + return; /*Fully clipped, nothing to do*/ - /* Wait for finish now. */ - lv_draw_dispatch_wait_for_request(); + bool has_mask = lv_draw_mask_is_any(&blend_area); + bool has_recolor = (dsc->recolor_opa != LV_OPA_TRANSP); - return 1; -} + bool done = false; + if(!has_mask && !has_recolor && !lv_img_cf_is_chroma_keyed(cf) && + lv_area_get_size(&blend_area) >= LV_GPU_NXP_VG_LITE_SIZE_LIMIT +#if LV_COLOR_DEPTH != 32 + && !lv_img_cf_has_alpha(cf) +#endif + ) { + lv_area_t src_area; + src_area.x1 = blend_area.x1 - (coords->x1 - draw_ctx->buf_area->x1); + src_area.y1 = blend_area.y1 - (coords->y1 - draw_ctx->buf_area->y1); + src_area.x2 = src_area.x1 + lv_area_get_width(coords) - 1; + src_area.y2 = src_area.y1 + lv_area_get_height(coords) - 1; + lv_coord_t src_stride = lv_area_get_width(coords); + +#if VG_LITE_BLIT_SPLIT_ENABLED + lv_color_t * dest_buf = draw_ctx->buf; + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); + + if(has_transform) + /* VG-Lite blit split with transformation is not supported! */ + done = false; + else + done = (lv_gpu_nxp_vglite_blit_split(dest_buf, &blend_area, dest_stride, + src_buf, &src_area, src_stride, dsc->opa) == LV_RES_OK); +#else + if(has_transform) + done = (lv_gpu_nxp_vglite_blit_transform(&blend_area, &rel_clip_area, + src_buf, &src_area, src_stride, dsc) == LV_RES_OK); + else + done = (lv_gpu_nxp_vglite_blit(&blend_area, src_buf, &src_area, src_stride, dsc->opa) == LV_RES_OK); #endif -static int32_t _vglite_delete(lv_draw_unit_t * draw_unit) -{ -#if LV_USE_VGLITE_DRAW_THREAD - lv_draw_vglite_unit_t * draw_vglite_unit = (lv_draw_vglite_unit_t *) draw_unit; - - LV_LOG_INFO("Cancel VGLite draw thread."); - draw_vglite_unit->exit_status = true; + if(!done) + VG_LITE_LOG_TRACE("VG-Lite blit %sfailed. Fallback.", has_transform ? "transform " : ""); + } - if(draw_vglite_unit->inited) - lv_thread_sync_signal(&draw_vglite_unit->sync); + if(!done) + lv_draw_sw_img_decoded(draw_ctx, dsc, coords, map_p, cf); +} - lv_result_t res = lv_thread_delete(&draw_vglite_unit->thread); +static void lv_draw_vglite_buffer_copy(lv_draw_ctx_t * draw_ctx, + void * dest_buf, lv_coord_t dest_stride, const lv_area_t * dest_area, + void * src_buf, lv_coord_t src_stride, const lv_area_t * src_area) +{ + bool done = false; - return res; -#else - LV_UNUSED(draw_unit); + if(lv_area_get_size(dest_area) >= LV_GPU_NXP_VG_LITE_SIZE_LIMIT) { + done = lv_gpu_nxp_vglite_buffer_copy(dest_buf, dest_area, dest_stride, src_buf, src_area, src_stride); + if(!done) + VG_LITE_LOG_TRACE("VG-Lite buffer copy failed. Fallback."); + } - return 1; -#endif + if(!done) + lv_draw_sw_buffer_copy(draw_ctx, dest_buf, dest_stride, dest_area, src_buf, src_stride, src_area); } -static void _vglite_execute_drawing(lv_draw_vglite_unit_t * u) +static void lv_draw_vglite_line(lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, const lv_point_t * point1, + const lv_point_t * point2) { - lv_draw_task_t * t = u->task_act; - lv_draw_unit_t * draw_unit = (lv_draw_unit_t *)u; - lv_layer_t * layer = draw_unit->target_layer; - lv_draw_buf_t * draw_buf = layer->draw_buf; + if(dsc->width == 0) + return; + if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) + return; + if(point1->x == point2->x && point1->y == point2->y) + return; + + if(need_argb8565_support()) { + lv_draw_sw_line(draw_ctx, dsc, point1, point2); + return; + } - /* Set target buffer */ - vglite_set_dest_buf(draw_buf->data, draw_buf->header.w, draw_buf->header.h, draw_buf->header.stride, - draw_buf->header.cf); + lv_area_t rel_clip_area; + rel_clip_area.x1 = LV_MIN(point1->x, point2->x) - dsc->width / 2; + rel_clip_area.x2 = LV_MAX(point1->x, point2->x) + dsc->width / 2; + rel_clip_area.y1 = LV_MIN(point1->y, point2->y) - dsc->width / 2; + rel_clip_area.y2 = LV_MAX(point1->y, point2->y) + dsc->width / 2; - lv_area_t clip_area; - lv_area_copy(&clip_area, draw_unit->clip_area); - lv_area_move(&clip_area, -layer->buf_area.x1, -layer->buf_area.y1); + lv_area_t clipped_coords; + if(!_lv_area_intersect(&clipped_coords, &rel_clip_area, draw_ctx->clip_area)) + return; /*Fully clipped, nothing to do*/ - lv_area_t draw_area; - lv_area_copy(&draw_area, &t->area); - lv_area_move(&draw_area, -layer->buf_area.x1, -layer->buf_area.y1); + lv_area_move(&rel_clip_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); - if(!lv_area_intersect(&draw_area, &draw_area, &clip_area)) - return; /*Fully clipped, nothing to do*/ + lv_point_t rel_point1 = { point1->x - draw_ctx->buf_area->x1, point1->y - draw_ctx->buf_area->y1 }; + lv_point_t rel_point2 = { point2->x - draw_ctx->buf_area->x1, point2->y - draw_ctx->buf_area->y1 }; - if(_draw_info.unit_cnt > 1) - lv_draw_buf_invalidate_cache(draw_buf, &draw_area); + bool done = false; + bool has_mask = lv_draw_mask_is_any(&rel_clip_area); - /* Set scissor area, excluding the split blit case */ -#if LV_USE_VGLITE_BLIT_SPLIT - if(t->type != LV_DRAW_TASK_TYPE_IMAGE || t->type != LV_DRAW_TASK_TYPE_LAYER) -#endif - vglite_set_scissor(&clip_area); - - switch(t->type) { - case LV_DRAW_TASK_TYPE_LABEL: - lv_draw_vglite_label(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_FILL: - lv_draw_vglite_fill(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_BORDER: - lv_draw_vglite_border(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_IMAGE: - lv_draw_vglite_img(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_ARC: - lv_draw_vglite_arc(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_LINE: - lv_draw_vglite_line(draw_unit, t->draw_dsc); - break; - case LV_DRAW_TASK_TYPE_LAYER: - lv_draw_vglite_layer(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_TRIANGLE: - lv_draw_vglite_triangle(draw_unit, t->draw_dsc); - break; - default: - break; + if(!has_mask) { + done = (lv_gpu_nxp_vglite_draw_line(&rel_point1, &rel_point2, &rel_clip_area, dsc) == LV_RES_OK); + if(!done) + VG_LITE_LOG_TRACE("VG-Lite draw line failed. Fallback."); } - /* Disable scissor */ - vglite_set_scissor(&layer->buf_area); - -#if LV_USE_PARALLEL_DRAW_DEBUG - /*Layers manage it for themselves*/ - if(t->type != LV_DRAW_TASK_TYPE_LAYER) { - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, &t->area, u->base_unit.clip_area)) - return; - - int32_t idx = 0; - lv_draw_unit_t * draw_unit_tmp = _draw_info.unit_head; - while(draw_unit_tmp != (lv_draw_unit_t *)u) { - draw_unit_tmp = draw_unit_tmp->next; - idx++; - } - lv_draw_rect_dsc_t rect_dsc; - lv_draw_rect_dsc_init(&rect_dsc); - rect_dsc.bg_color = lv_palette_main(idx % LV_PALETTE_LAST); - rect_dsc.border_color = rect_dsc.bg_color; - rect_dsc.bg_opa = LV_OPA_10; - rect_dsc.border_opa = LV_OPA_80; - rect_dsc.border_width = 1; - lv_draw_sw_fill((lv_draw_unit_t *)u, &rect_dsc, &draw_area); - - lv_point_t txt_size; - lv_text_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE); - - lv_area_t txt_area; - txt_area.x1 = draw_area.x1; - txt_area.y1 = draw_area.y1; - txt_area.x2 = draw_area.x1 + txt_size.x - 1; - txt_area.y2 = draw_area.y1 + txt_size.y - 1; - - lv_draw_rect_dsc_init(&rect_dsc); - rect_dsc.bg_color = lv_color_white(); - lv_draw_sw_fill((lv_draw_unit_t *)u, &rect_dsc, &txt_area); - - char buf[8]; - lv_snprintf(buf, sizeof(buf), "%d", idx); - lv_draw_label_dsc_t label_dsc; - lv_draw_label_dsc_init(&label_dsc); - label_dsc.color = lv_color_black(); - label_dsc.text = buf; - lv_draw_sw_label((lv_draw_unit_t *)u, &label_dsc, &txt_area); - } -#endif + if(!done) + lv_draw_sw_line(draw_ctx, dsc, point1, point2); } -#if LV_USE_VGLITE_DRAW_ASYNC -static inline void _vglite_queue_task(lv_draw_task_t * task) +static void lv_draw_vglite_rect(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) { - VGLITE_ASSERT_MSG(((_tail + 1) % VGLITE_TASK_BUF_SIZE) != _head, "VGLite task buffer full."); + if(need_argb8565_support()) { + lv_draw_sw_rect(draw_ctx, dsc, coords); + return; + } - _draw_task_buf[_tail].task = task; - _draw_task_buf[_tail].flushed = false; - _tail = (_tail + 1) % VGLITE_TASK_BUF_SIZE; + lv_draw_rect_dsc_t vglite_dsc; + + lv_memcpy(&vglite_dsc, dsc, sizeof(vglite_dsc)); + vglite_dsc.bg_opa = 0; + vglite_dsc.bg_img_opa = 0; + vglite_dsc.border_opa = 0; + vglite_dsc.outline_opa = 0; +#if LV_DRAW_COMPLEX + /* Draw the shadow with CPU */ + lv_draw_sw_rect(draw_ctx, &vglite_dsc, coords); + vglite_dsc.shadow_opa = 0; +#endif /*LV_DRAW_COMPLEX*/ + + /* Draw the background */ + vglite_dsc.bg_opa = dsc->bg_opa; + if(lv_draw_vglite_bg(draw_ctx, &vglite_dsc, coords) != LV_RES_OK) + lv_draw_sw_rect(draw_ctx, &vglite_dsc, coords); + vglite_dsc.bg_opa = 0; + + /* Draw the background image + * It will be done once draw_ctx->draw_img_decoded() + * callback gets called from lv_draw_sw_rect(). + */ + vglite_dsc.bg_img_opa = dsc->bg_img_opa; + lv_draw_sw_rect(draw_ctx, &vglite_dsc, coords); + vglite_dsc.bg_img_opa = 0; + + /* Draw the border */ + vglite_dsc.border_opa = dsc->border_opa; + if(lv_draw_vglite_border(draw_ctx, &vglite_dsc, coords) != LV_RES_OK) + lv_draw_sw_rect(draw_ctx, &vglite_dsc, coords); + vglite_dsc.border_opa = 0; + + /* Draw the outline */ + vglite_dsc.outline_opa = dsc->outline_opa; + if(lv_draw_vglite_outline(draw_ctx, &vglite_dsc, coords) != LV_RES_OK) + lv_draw_sw_rect(draw_ctx, &vglite_dsc, coords); } -static inline void _vglite_signal_task_ready(lv_draw_task_t * task) +static lv_res_t lv_draw_vglite_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) { - /* Signal the ready state to dispatcher. */ - task->state = LV_DRAW_TASK_STATE_READY; - _head = (_head + 1) % VGLITE_TASK_BUF_SIZE; + if(dsc->bg_opa <= (lv_opa_t)LV_OPA_MIN) + return LV_RES_INV; + + lv_area_t rel_coords; + lv_area_copy(&rel_coords, coords); + + /*If the border fully covers make the bg area 1px smaller to avoid artifacts on the corners*/ + if(dsc->border_width > 1 && dsc->border_opa >= (lv_opa_t)LV_OPA_MAX && dsc->radius != 0) { + rel_coords.x1 += (dsc->border_side & LV_BORDER_SIDE_LEFT) ? 1 : 0; + rel_coords.y1 += (dsc->border_side & LV_BORDER_SIDE_TOP) ? 1 : 0; + rel_coords.x2 -= (dsc->border_side & LV_BORDER_SIDE_RIGHT) ? 1 : 0; + rel_coords.y2 -= (dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? 1 : 0; + } + lv_area_move(&rel_coords, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); - /* No need to cleanup the tasks in buffer as we advance with the _head. */ -} + lv_area_t rel_clip_area; + lv_area_copy(&rel_clip_area, draw_ctx->clip_area); + lv_area_move(&rel_clip_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); -static inline void _vglite_signal_all_task_ready(void) -{ - int end = (_head <= _tail) ? _tail : _tail + VGLITE_TASK_BUF_SIZE; + lv_area_t clipped_coords; + if(!_lv_area_intersect(&clipped_coords, &rel_coords, &rel_clip_area)) + return LV_RES_OK; /*Fully clipped, nothing to do*/ - for(int i = _head; i < end; i++) { - lv_draw_task_t * task = _draw_task_buf[i % VGLITE_TASK_BUF_SIZE].task; + bool has_mask = lv_draw_mask_is_any(&rel_coords); + lv_grad_dir_t grad_dir = dsc->bg_grad.dir; + lv_color_t bg_color = (grad_dir == (lv_grad_dir_t)LV_GRAD_DIR_NONE) ? + dsc->bg_color : dsc->bg_grad.stops[0].color; + if(bg_color.full == dsc->bg_grad.stops[1].color.full) + grad_dir = LV_GRAD_DIR_NONE; - _vglite_signal_task_ready(task); + /* + * Most simple case: just a plain rectangle (no mask, no radius, no gradient) + * shall be handled by draw_ctx->blend(). + * + * Complex case: gradient or radius but no mask. + */ + if(!has_mask && ((dsc->radius != 0) || (grad_dir != (lv_grad_dir_t)LV_GRAD_DIR_NONE))) { + lv_res_t res = lv_gpu_nxp_vglite_draw_bg(&rel_coords, &rel_clip_area, dsc); + if(res != LV_RES_OK) + VG_LITE_LOG_TRACE("VG-Lite draw bg failed. Fallback."); + + return res; } + + return LV_RES_INV; } -static inline void _vglite_signal_flushed_task_ready(void) +static lv_res_t lv_draw_vglite_border(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, + const lv_area_t * coords) { - if(vglite_cmd_buf_is_flushed()) { - int end = (_head <= _tail) ? _tail : _tail + VGLITE_TASK_BUF_SIZE; + if(dsc->border_opa <= (lv_opa_t)LV_OPA_MIN) + return LV_RES_INV; + if(dsc->border_width == 0) + return LV_RES_INV; + if(dsc->border_post) + return LV_RES_INV; + if(dsc->border_side != (lv_border_side_t)LV_BORDER_SIDE_FULL) + return LV_RES_INV; + + lv_area_t rel_coords; + lv_coord_t border_width = dsc->border_width; + + /* Move border inwards to align with software rendered border */ + rel_coords.x1 = coords->x1 + ceil(border_width / 2.0f); + rel_coords.x2 = coords->x2 - floor(border_width / 2.0f); + rel_coords.y1 = coords->y1 + ceil(border_width / 2.0f); + rel_coords.y2 = coords->y2 - floor(border_width / 2.0f); + + lv_area_move(&rel_coords, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + + lv_area_t rel_clip_area; + lv_area_copy(&rel_clip_area, draw_ctx->clip_area); + lv_area_move(&rel_clip_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + + lv_area_t clipped_coords; + if(!_lv_area_intersect(&clipped_coords, &rel_coords, &rel_clip_area)) + return LV_RES_OK; /*Fully clipped, nothing to do*/ + + lv_res_t res = lv_gpu_nxp_vglite_draw_border_generic(&rel_coords, &rel_clip_area, dsc, true); + if(res != LV_RES_OK) + VG_LITE_LOG_TRACE("VG-Lite draw border failed. Fallback."); - for(int i = _head; i < end; i++) { - if(_draw_task_buf[i % VGLITE_TASK_BUF_SIZE].flushed) { - lv_draw_task_t * task = _draw_task_buf[i % VGLITE_TASK_BUF_SIZE].task; + return res; +} - _vglite_signal_task_ready(task); +static lv_res_t lv_draw_vglite_outline(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, + const lv_area_t * coords) +{ + if(dsc->outline_opa <= (lv_opa_t)LV_OPA_MIN) + return LV_RES_INV; + if(dsc->outline_width == 0) + return LV_RES_INV; - } - else { - /* Those tasks have been flushed now. */ - _draw_task_buf[i % VGLITE_TASK_BUF_SIZE].flushed = true; - } - } - } + /* Move outline outwards to align with software rendered outline */ + lv_coord_t outline_pad = dsc->outline_pad - 1; + lv_area_t rel_coords; + rel_coords.x1 = coords->x1 - outline_pad - floor(dsc->outline_width / 2.0f); + rel_coords.x2 = coords->x2 + outline_pad + ceil(dsc->outline_width / 2.0f); + rel_coords.y1 = coords->y1 - outline_pad - floor(dsc->outline_width / 2.0f); + rel_coords.y2 = coords->y2 + outline_pad + ceil(dsc->outline_width / 2.0f); + + lv_area_move(&rel_coords, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + + lv_area_t rel_clip_area; + lv_area_copy(&rel_clip_area, draw_ctx->clip_area); + lv_area_move(&rel_clip_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + + lv_area_t clipped_coords; + if(!_lv_area_intersect(&clipped_coords, &rel_coords, &rel_clip_area)) + return LV_RES_OK; /*Fully clipped, nothing to do*/ + + lv_res_t res = lv_gpu_nxp_vglite_draw_border_generic(&rel_coords, &rel_clip_area, dsc, false); + if(res != LV_RES_OK) + VG_LITE_LOG_TRACE("VG-Lite draw outline failed. Fallback."); + + return res; } -#endif -#if LV_USE_VGLITE_DRAW_THREAD -static void _vglite_render_thread_cb(void * ptr) +static void lv_draw_vglite_arc(lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center, + uint16_t radius, uint16_t start_angle, uint16_t end_angle) { - lv_draw_vglite_unit_t * u = ptr; - - lv_thread_sync_init(&u->sync); - u->inited = true; - - while(1) { - /* Wait for sync if there is no task set. */ - while(u->task_act == NULL -#if LV_USE_VGLITE_DRAW_ASYNC - /* - * Wait for sync if _draw_task_buf is empty. - * The thread will have to run to complete any pending tasks. - */ - && !u->wait_for_finish -#endif - ) { - if(u->exit_status) - break; + bool done = false; + +#if LV_DRAW_COMPLEX + if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) + return; + if(dsc->width == 0) + return; + if(start_angle == end_angle) + return; + + if(need_argb8565_support()) { + lv_draw_sw_arc(draw_ctx, dsc, center, radius, start_angle, end_angle); + return; + } - lv_thread_sync_wait(&u->sync); - } + lv_point_t rel_center = {center->x - draw_ctx->buf_area->x1, center->y - draw_ctx->buf_area->y1}; - if(u->exit_status) { - LV_LOG_INFO("Ready to exit VGLite draw thread."); - break; - } + lv_area_t rel_clip_area; + lv_area_copy(&rel_clip_area, draw_ctx->clip_area); + lv_area_move(&rel_clip_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); - if(u->task_act) { -#if LV_USE_VGLITE_DRAW_ASYNC - _vglite_queue_task((void *)u->task_act); -#endif - _vglite_execute_drawing(u); - } -#if LV_USE_VGLITE_DRAW_ASYNC - if(u->wait_for_finish) { - u->wait_for_finish = false; - vglite_wait_for_finish(); - _vglite_signal_all_task_ready(); - } - else { /* u->task_act */ - _vglite_signal_flushed_task_ready(); - } -#else - /* Signal the ready state to dispatcher. */ - u->task_act->state = LV_DRAW_TASK_STATE_READY; -#endif - /* Cleanup. */ - u->task_act = NULL; + bool has_mask = lv_draw_mask_is_any(&rel_clip_area); - /* The draw unit is free now. Request a new dispatching as it can get a new task. */ - lv_draw_dispatch_request(); + if(!has_mask) { + done = (lv_gpu_nxp_vglite_draw_arc(&rel_center, (int32_t)radius, (int32_t)start_angle, (int32_t)end_angle, + &rel_clip_area, dsc) == LV_RES_OK); + if(!done) + VG_LITE_LOG_TRACE("VG-Lite draw arc failed. Fallback."); } - u->inited = false; - lv_thread_sync_delete(&u->sync); - LV_LOG_INFO("Exit VGLite draw thread."); +#endif/*LV_DRAW_COMPLEX*/ + + if(!done) + lv_draw_sw_arc(draw_ctx, dsc, center, radius, start_angle, end_angle); } -#endif -#endif /*LV_USE_DRAW_VGLITE*/ +#endif /*LV_USE_GPU_NXP_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite.h b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite.h index 93b18cd..c44cb8f 100644 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite.h +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite.h @@ -4,9 +4,27 @@ */ /** - * Copyright 2023-2024 NXP + * MIT License + * + * Copyright 2022, 2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * SPDX-License-Identifier: MIT */ #ifndef LV_DRAW_VGLITE_H @@ -22,10 +40,8 @@ extern "C" { #include "../../../lv_conf_internal.h" -#if LV_USE_DRAW_VGLITE -#include "../../lv_draw_private.h" -#include "../../sw/lv_draw_sw_private.h" -#include "../../../misc/lv_area_private.h" +#if LV_USE_GPU_NXP_VG_LITE +#include "../../sw/lv_draw_sw.h" /********************* * DEFINES @@ -34,50 +50,20 @@ extern "C" { /********************** * TYPEDEFS **********************/ - -typedef struct lv_draw_vglite_unit { - lv_draw_sw_unit_t; -#if LV_USE_VGLITE_DRAW_ASYNC - volatile bool wait_for_finish; -#endif -} lv_draw_vglite_unit_t; +typedef lv_draw_sw_ctx_t lv_draw_vglite_ctx_t; /********************** * GLOBAL PROTOTYPES **********************/ -void lv_draw_buf_vglite_init_handlers(void); - -void lv_draw_vglite_init(void); - -void lv_draw_vglite_deinit(void); - -void lv_draw_vglite_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_vglite_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_vglite_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_vglite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_vglite_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_vglite_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords); - -void lv_draw_vglite_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc); +void lv_draw_vglite_ctx_init(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); -void lv_draw_vglite_triangle(lv_draw_unit_t * draw_unit, const lv_draw_triangle_dsc_t * dsc); +void lv_draw_vglite_ctx_deinit(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); /********************** * MACROS **********************/ -#endif /*LV_USE_DRAW_VGLITE*/ +#endif /*LV_USE_GPU_NXP_VG_LITE*/ #ifdef __cplusplus } /*extern "C"*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_arc.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_arc.c index 6b0d4fe..ef6d25a 100644 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_arc.c +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_arc.c @@ -4,23 +4,37 @@ */ /** - * Copyright 2021-2024 NXP + * MIT License + * + * Copyright 2021-2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * SPDX-License-Identifier: MIT */ /********************* * INCLUDES *********************/ -#include "lv_draw_vglite.h" +#include "lv_draw_vglite_arc.h" -#if LV_USE_DRAW_VGLITE +#if LV_USE_GPU_NXP_VG_LITE #include "lv_vglite_buf.h" -#include "lv_vglite_path.h" -#include "lv_vglite_utils.h" - -#include "../../../stdlib/lv_string.h" #include /********************* @@ -73,16 +87,9 @@ typedef struct _cubic_cont_pt { * STATIC PROTOTYPES **********************/ -/** - * Draw arc shape with effects - * - * @param[in] center Arc center with relative coordinates - * @param[in] clip_area Clip area with relative coordinates to dest buff - * @param[in] dsc Arc description structure (width, rounded ending, opacity) - * - */ -static void _vglite_draw_arc(const lv_point_t * center, const lv_area_t * clip_area, - const lv_draw_arc_dsc_t * dsc); +static void rotate_point(int32_t angle, int32_t * x, int32_t * y); +static void add_arc_path(int32_t * arc_path, int * pidx, int32_t radius, + int32_t start_angle, int32_t end_angle, const lv_point_t * center, bool cw); /********************** * STATIC VARIABLES @@ -96,33 +103,141 @@ static void _vglite_draw_arc(const lv_point_t * center, const lv_area_t * clip_a * GLOBAL FUNCTIONS **********************/ -void lv_draw_vglite_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, - const lv_area_t * coords) +lv_res_t lv_gpu_nxp_vglite_draw_arc(const lv_point_t * center, int32_t radius, int32_t start_angle, int32_t end_angle, + const lv_area_t * clip_area, const lv_draw_arc_dsc_t * dsc) { - LV_UNUSED(coords); + vg_lite_error_t err = VG_LITE_SUCCESS; + lv_color32_t col32 = {.full = lv_color_to32(dsc->color)}; /*Convert color to RGBA8888*/ + vg_lite_path_t path; + vg_lite_color_t vgcol; /* vglite takes ABGR */ + bool donut = ((end_angle - start_angle) % 360 == 0) ? true : false; + vg_lite_buffer_t * vgbuf = lv_vglite_get_dest_buf(); - if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) - return; - if(dsc->width == 0) - return; - if(dsc->start_angle == dsc->end_angle) - return; + /* path: max size = 16 cubic bezier (7 words each) */ + int32_t arc_path[16 * 7]; + lv_memset_00(arc_path, sizeof(arc_path)); + + /*** Init path ***/ + lv_coord_t width = dsc->width; /* inner arc radius = outer arc radius - width */ + if(width > (lv_coord_t)radius) + width = radius; + + int pidx = 0; + int32_t cp_x, cp_y; /* control point coords */ + + /* first control point of curve */ + cp_x = radius; + cp_y = 0; + rotate_point(start_angle, &cp_x, &cp_y); + arc_path[pidx++] = VLC_OP_MOVE; + arc_path[pidx++] = center->x + cp_x; + arc_path[pidx++] = center->y + cp_y; + + /* draw 1-5 outer quarters */ + add_arc_path(arc_path, &pidx, radius, start_angle, end_angle, center, true); + + if(donut) { + /* close outer circle */ + cp_x = radius; + cp_y = 0; + rotate_point(start_angle, &cp_x, &cp_y); + arc_path[pidx++] = VLC_OP_LINE; + arc_path[pidx++] = center->x + cp_x; + arc_path[pidx++] = center->y + cp_y; + /* start inner circle */ + cp_x = radius - width; + cp_y = 0; + rotate_point(start_angle, &cp_x, &cp_y); + arc_path[pidx++] = VLC_OP_MOVE; + arc_path[pidx++] = center->x + cp_x; + arc_path[pidx++] = center->y + cp_y; + + } + else if(dsc->rounded != 0U) { /* 1st rounded arc ending */ + cp_x = radius - width / 2; + cp_y = 0; + rotate_point(end_angle, &cp_x, &cp_y); + lv_point_t round_center = {center->x + cp_x, center->y + cp_y}; + add_arc_path(arc_path, &pidx, width / 2, end_angle, (end_angle + 180), + &round_center, true); + + } + else { /* 1st flat ending */ + cp_x = radius - width; + cp_y = 0; + rotate_point(end_angle, &cp_x, &cp_y); + arc_path[pidx++] = VLC_OP_LINE; + arc_path[pidx++] = center->x + cp_x; + arc_path[pidx++] = center->y + cp_y; + } + + /* draw 1-5 inner quarters */ + add_arc_path(arc_path, &pidx, radius - width, start_angle, end_angle, center, false); + + /* last control point of curve */ + if(donut) { /* close the loop */ + cp_x = radius - width; + cp_y = 0; + rotate_point(start_angle, &cp_x, &cp_y); + arc_path[pidx++] = VLC_OP_LINE; + arc_path[pidx++] = center->x + cp_x; + arc_path[pidx++] = center->y + cp_y; + + } + else if(dsc->rounded != 0U) { /* 2nd rounded arc ending */ + cp_x = radius - width / 2; + cp_y = 0; + rotate_point(start_angle, &cp_x, &cp_y); + lv_point_t round_center = {center->x + cp_x, center->y + cp_y}; + add_arc_path(arc_path, &pidx, width / 2, (start_angle + 180), (start_angle + 360), + &round_center, true); + + } + else { /* 2nd flat ending */ + cp_x = radius; + cp_y = 0; + rotate_point(start_angle, &cp_x, &cp_y); + arc_path[pidx++] = VLC_OP_LINE; + arc_path[pidx++] = center->x + cp_x; + arc_path[pidx++] = center->y + cp_y; + } + + arc_path[pidx++] = VLC_OP_END; + + err = vg_lite_init_path(&path, VG_LITE_S32, VG_LITE_HIGH, (uint32_t)pidx * sizeof(int32_t), arc_path, + (vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1, + ((vg_lite_float_t)clip_area->x2) + 1.0f, ((vg_lite_float_t)clip_area->y2) + 1.0f); + VG_LITE_ERR_RETURN_INV(err, "Init path failed."); + + vg_lite_buffer_format_t color_format = LV_COLOR_DEPTH == 16 ? VG_LITE_BGRA8888 : VG_LITE_ABGR8888; + if(lv_vglite_premult_and_swizzle(&vgcol, col32, dsc->opa, color_format) != LV_RES_OK) + VG_LITE_RETURN_INV("Premultiplication and swizzle failed."); + + vg_lite_matrix_t matrix; + vg_lite_identity(&matrix); + + lv_vglite_set_scissor(clip_area); + + /*** Draw arc ***/ + err = vg_lite_draw(vgbuf, &path, VG_LITE_FILL_NON_ZERO, &matrix, VG_LITE_BLEND_SRC_OVER, vgcol); + VG_LITE_ERR_RETURN_INV(err, "Draw arc failed."); + + if(lv_vglite_run() != LV_RES_OK) + VG_LITE_RETURN_INV("Run failed."); - lv_layer_t * layer = draw_unit->target_layer; - lv_point_t center = {dsc->center.x - layer->buf_area.x1, dsc->center.y - layer->buf_area.y1}; + lv_vglite_disable_scissor(); - lv_area_t clip_area; - lv_area_copy(&clip_area, draw_unit->clip_area); - lv_area_move(&clip_area, -layer->buf_area.x1, -layer->buf_area.y1); + err = vg_lite_clear_path(&path); + VG_LITE_ERR_RETURN_INV(err, "Clear path failed."); - _vglite_draw_arc(¢er, &clip_area, dsc); + return LV_RES_OK; } /********************** * STATIC FUNCTIONS **********************/ -static void _copy_arc(vg_arc * dst, vg_arc * src) +static void copy_arc(vg_arc * dst, vg_arc * src) { dst->quarter = src->quarter; dst->rad = src->rad; @@ -140,7 +255,7 @@ static void _copy_arc(vg_arc * dst, vg_arc * src) /** * Rotate the point according given rotation angle rotation center is 0,0 */ -static void _rotate_point(int32_t angle, int32_t * x, int32_t * y) +static void rotate_point(int32_t angle, int32_t * x, int32_t * y) { int32_t ori_x = *x; int32_t ori_y = *y; @@ -157,9 +272,9 @@ static void _rotate_point(int32_t angle, int32_t * x, int32_t * y) * ---+--- * Q1 | Q0 */ -static void _set_full_arc(vg_arc * fullarc) +static void set_full_arc(vg_arc * fullarc) { - /* the tangent length for the bezier circle approx */ + /* the tangent lenght for the bezier circle approx */ float tang = ((float)fullarc->rad) * BEZIER_OPTIM_CIRCLE; switch(fullarc->quarter) { case 0: @@ -207,7 +322,7 @@ static void _set_full_arc(vg_arc * fullarc) fullarc->p3y = 0; break; default: - VGLITE_ASSERT_MSG(false, "Invalid arc quarter."); + LV_LOG_ERROR("Invalid arc quarter value."); break; } } @@ -216,7 +331,7 @@ static void _set_full_arc(vg_arc * fullarc) * Linear interpolation between two points 'a' and 'b' * 't' parameter is the proportion ratio expressed in range [0 ; T_FRACTION ] */ -static inline float _lerp(float coord_a, float coord_b, uint16_t t) +static inline float lerp(float coord_a, float coord_b, uint16_t t) { float tf = (float)t; return ((T_FRACTION - tf) * coord_a + tf * coord_b) / T_FRACTION; @@ -225,7 +340,7 @@ static inline float _lerp(float coord_a, float coord_b, uint16_t t) /** * Computes a point of bezier curve given 't' param */ -static inline float _comp_bezier_point(float t, cubic_cont_pt cp) +static inline float comp_bezier_point(float t, cubic_cont_pt cp) { float t_sq = t * t; float inv_t_sq = (1.0f - t) * (1.0f - t); @@ -241,7 +356,7 @@ static inline float _comp_bezier_point(float t, cubic_cont_pt cp) * bezier curve is defined by control points [p0 p1 p2 p3] * 'dec' tells if curve is decreasing (true) or increasing (false) */ -static uint16_t _get_bez_t_from_pos(float pt, cubic_cont_pt cp, bool dec) +static uint16_t get_bez_t_from_pos(float pt, cubic_cont_pt cp, bool dec) { /* initialize dichotomy with boundary 't' values */ float t_low = 0.0f; @@ -250,7 +365,7 @@ static uint16_t _get_bez_t_from_pos(float pt, cubic_cont_pt cp, bool dec) float a_pt; /* dichotomy loop */ for(int i = 0; i < DICHOTO_ITER; i++) { - a_pt = _comp_bezier_point(t_mid, cp); + a_pt = comp_bezier_point(t_mid, cp); /* check mid-point position on bezier curve versus targeted point */ if((a_pt > pt) != dec) { t_hig = t_mid; @@ -269,17 +384,17 @@ static uint16_t _get_bez_t_from_pos(float pt, cubic_cont_pt cp, bool dec) * Gives relative coords of the control points * for the sub-arc starting at angle with given angle span */ -static void _get_subarc_control_points(vg_arc * arc, int32_t span) +static void get_subarc_control_points(vg_arc * arc, int32_t span) { - vg_arc fullarc = {0}; + vg_arc fullarc; fullarc.angle = arc->angle; fullarc.quarter = arc->quarter; fullarc.rad = arc->rad; - _set_full_arc(&fullarc); + set_full_arc(&fullarc); /* special case of full arc */ if(arc->angle == 90) { - _copy_arc(arc, &fullarc); + copy_arc(arc, &fullarc); return; } @@ -287,67 +402,67 @@ static void _get_subarc_control_points(vg_arc * arc, int32_t span) uint16_t t2 = TperDegree[arc->angle + span]; /* lerp for A */ - float a2x = _lerp((float)fullarc.p0x, (float)fullarc.p1x, t2); - float a2y = _lerp((float)fullarc.p0y, (float)fullarc.p1y, t2); + float a2x = lerp((float)fullarc.p0x, (float)fullarc.p1x, t2); + float a2y = lerp((float)fullarc.p0y, (float)fullarc.p1y, t2); /* lerp for B */ - float b2x = _lerp((float)fullarc.p1x, (float)fullarc.p2x, t2); - float b2y = _lerp((float)fullarc.p1y, (float)fullarc.p2y, t2); + float b2x = lerp((float)fullarc.p1x, (float)fullarc.p2x, t2); + float b2y = lerp((float)fullarc.p1y, (float)fullarc.p2y, t2); /* lerp for C */ - float c2x = _lerp((float)fullarc.p2x, (float)fullarc.p3x, t2); - float c2y = _lerp((float)fullarc.p2y, (float)fullarc.p3y, t2); + float c2x = lerp((float)fullarc.p2x, (float)fullarc.p3x, t2); + float c2y = lerp((float)fullarc.p2y, (float)fullarc.p3y, t2); /* lerp for D */ - float d2x = _lerp(a2x, b2x, t2); - float d2y = _lerp(a2y, b2y, t2); + float d2x = lerp(a2x, b2x, t2); + float d2y = lerp(a2y, b2y, t2); /* lerp for E */ - float e2x = _lerp(b2x, c2x, t2); - float e2y = _lerp(b2y, c2y, t2); + float e2x = lerp(b2x, c2x, t2); + float e2y = lerp(b2y, c2y, t2); - float pt2x = _lerp(d2x, e2x, t2); - float pt2y = _lerp(d2y, e2y, t2); + float pt2x = lerp(d2x, e2x, t2); + float pt2y = lerp(d2y, e2y, t2); /* compute sub-arc using the geometric construction of curve */ uint16_t t1 = TperDegree[arc->angle]; /* lerp for A */ - float a1x = _lerp((float)fullarc.p0x, (float)fullarc.p1x, t1); - float a1y = _lerp((float)fullarc.p0y, (float)fullarc.p1y, t1); + float a1x = lerp((float)fullarc.p0x, (float)fullarc.p1x, t1); + float a1y = lerp((float)fullarc.p0y, (float)fullarc.p1y, t1); /* lerp for B */ - float b1x = _lerp((float)fullarc.p1x, (float)fullarc.p2x, t1); - float b1y = _lerp((float)fullarc.p1y, (float)fullarc.p2y, t1); + float b1x = lerp((float)fullarc.p1x, (float)fullarc.p2x, t1); + float b1y = lerp((float)fullarc.p1y, (float)fullarc.p2y, t1); /* lerp for C */ - float c1x = _lerp((float)fullarc.p2x, (float)fullarc.p3x, t1); - float c1y = _lerp((float)fullarc.p2y, (float)fullarc.p3y, t1); + float c1x = lerp((float)fullarc.p2x, (float)fullarc.p3x, t1); + float c1y = lerp((float)fullarc.p2y, (float)fullarc.p3y, t1); /* lerp for D */ - float d1x = _lerp(a1x, b1x, t1); - float d1y = _lerp(a1y, b1y, t1); + float d1x = lerp(a1x, b1x, t1); + float d1y = lerp(a1y, b1y, t1); /* lerp for E */ - float e1x = _lerp(b1x, c1x, t1); - float e1y = _lerp(b1y, c1y, t1); + float e1x = lerp(b1x, c1x, t1); + float e1y = lerp(b1y, c1y, t1); - float pt1x = _lerp(d1x, e1x, t1); - float pt1y = _lerp(d1y, e1y, t1); + float pt1x = lerp(d1x, e1x, t1); + float pt1y = lerp(d1y, e1y, t1); /* find the 't3' parameter for point P(t1) on the sub-arc [P0 A2 D2 P(t2)] using dichotomy * use position of x axis only */ uint16_t t3; - t3 = _get_bez_t_from_pos(pt1x, + t3 = get_bez_t_from_pos(pt1x, (cubic_cont_pt) { .p0 = ((float)fullarc.p0x), .p1 = a2x, .p2 = d2x, .p3 = pt2x }, (bool)(pt2x < (float)fullarc.p0x)); /* lerp for B */ - float b3x = _lerp(a2x, d2x, t3); - float b3y = _lerp(a2y, d2y, t3); + float b3x = lerp(a2x, d2x, t3); + float b3y = lerp(a2y, d2y, t3); /* lerp for C */ - float c3x = _lerp(d2x, pt2x, t3); - float c3y = _lerp(d2y, pt2y, t3); + float c3x = lerp(d2x, pt2x, t3); + float c3y = lerp(d2y, pt2y, t3); /* lerp for E */ - float e3x = _lerp(b3x, c3x, t3); - float e3y = _lerp(b3y, c3y, t3); + float e3x = lerp(b3x, c3x, t3); + float e3y = lerp(b3y, c3y, t3); arc->p0x = (int32_t)floorf(0.5f + pt1x); arc->p0y = (int32_t)floorf(0.5f + pt1y); @@ -362,43 +477,43 @@ static void _get_subarc_control_points(vg_arc * arc, int32_t span) /** * Gives relative coords of the control points */ -static void _get_arc_control_points(vg_arc * arc, bool start) +static void get_arc_control_points(vg_arc * arc, bool start) { - vg_arc fullarc = {0}; + vg_arc fullarc; fullarc.angle = arc->angle; fullarc.quarter = arc->quarter; fullarc.rad = arc->rad; - _set_full_arc(&fullarc); + set_full_arc(&fullarc); /* special case of full arc */ if(arc->angle == 90) { - _copy_arc(arc, &fullarc); + copy_arc(arc, &fullarc); return; } /* compute sub-arc using the geometric construction of curve */ uint16_t t = TperDegree[arc->angle]; /* lerp for A */ - float ax = _lerp((float)fullarc.p0x, (float)fullarc.p1x, t); - float ay = _lerp((float)fullarc.p0y, (float)fullarc.p1y, t); + float ax = lerp((float)fullarc.p0x, (float)fullarc.p1x, t); + float ay = lerp((float)fullarc.p0y, (float)fullarc.p1y, t); /* lerp for B */ - float bx = _lerp((float)fullarc.p1x, (float)fullarc.p2x, t); - float by = _lerp((float)fullarc.p1y, (float)fullarc.p2y, t); + float bx = lerp((float)fullarc.p1x, (float)fullarc.p2x, t); + float by = lerp((float)fullarc.p1y, (float)fullarc.p2y, t); /* lerp for C */ - float cx = _lerp((float)fullarc.p2x, (float)fullarc.p3x, t); - float cy = _lerp((float)fullarc.p2y, (float)fullarc.p3y, t); + float cx = lerp((float)fullarc.p2x, (float)fullarc.p3x, t); + float cy = lerp((float)fullarc.p2y, (float)fullarc.p3y, t); /* lerp for D */ - float dx = _lerp(ax, bx, t); - float dy = _lerp(ay, by, t); + float dx = lerp(ax, bx, t); + float dy = lerp(ay, by, t); /* lerp for E */ - float ex = _lerp(bx, cx, t); - float ey = _lerp(by, cy, t); + float ex = lerp(bx, cx, t); + float ey = lerp(by, cy, t); /* sub-arc's control points are tangents of DeCasteljau's algorithm */ if(start) { - arc->p0x = (int32_t)floorf(0.5f + _lerp(dx, ex, t)); - arc->p0y = (int32_t)floorf(0.5f + _lerp(dy, ey, t)); + arc->p0x = (int32_t)floorf(0.5f + lerp(dx, ex, t)); + arc->p0y = (int32_t)floorf(0.5f + lerp(dy, ey, t)); arc->p1x = (int32_t)floorf(0.5f + ex); arc->p1y = (int32_t)floorf(0.5f + ey); arc->p2x = (int32_t)floorf(0.5f + cx); @@ -413,8 +528,8 @@ static void _get_arc_control_points(vg_arc * arc, bool start) arc->p1y = (int32_t)floorf(0.5f + ay); arc->p2x = (int32_t)floorf(0.5f + dx); arc->p2y = (int32_t)floorf(0.5f + dy); - arc->p3x = (int32_t)floorf(0.5f + _lerp(dx, ex, t)); - arc->p3y = (int32_t)floorf(0.5f + _lerp(dy, ey, t)); + arc->p3x = (int32_t)floorf(0.5f + lerp(dx, ex, t)); + arc->p3y = (int32_t)floorf(0.5f + lerp(dy, ey, t)); } } @@ -427,7 +542,7 @@ static void _get_arc_control_points(vg_arc * arc, bool start) * center: (in) the center of the circle in draw coordinates * cw: (in) true if arc is clockwise */ -static void _add_split_arc_path(int32_t * arc_path, int * pidx, vg_arc * q_arc, const lv_point_t * center, bool cw) +static void add_split_arc_path(int32_t * arc_path, int * pidx, vg_arc * q_arc, const lv_point_t * center, bool cw) { /* assumes first control point already in array arc_path[] */ int idx = *pidx; @@ -477,9 +592,11 @@ static void _add_split_arc_path(int32_t * arc_path, int * pidx, vg_arc * q_arc, *pidx = idx; } -static void _add_arc_path(int32_t * arc_path, int * pidx, int32_t radius, - int32_t start_angle, int32_t end_angle, const lv_point_t * center, bool cw) +static void add_arc_path(int32_t * arc_path, int * pidx, int32_t radius, + int32_t start_angle, int32_t end_angle, const lv_point_t * center, bool cw) { + if(end_angle < start_angle) end_angle += 360; + /* set number of arcs to draw */ vg_arc q_arc; int32_t start_arc_angle = start_angle % 90; @@ -492,8 +609,8 @@ static void _add_arc_path(int32_t * arc_path, int * pidx, int32_t radius, if(((start_angle / 90) == (end_angle / 90)) && (nbarc <= 0)) { q_arc.quarter = (start_angle / 90) % 4; q_arc.angle = start_arc_angle; - _get_subarc_control_points(&q_arc, end_arc_angle - start_arc_angle); - _add_split_arc_path(arc_path, pidx, &q_arc, center, cw); + get_subarc_control_points(&q_arc, end_arc_angle - start_arc_angle); + add_split_arc_path(arc_path, pidx, &q_arc, center, cw); return; } @@ -503,27 +620,27 @@ static void _add_arc_path(int32_t * arc_path, int * pidx, int32_t radius, q_arc.quarter = (start_angle / 90) % 4; q_arc.angle = start_arc_angle; /* get cubic points relative to center */ - _get_arc_control_points(&q_arc, true); + get_arc_control_points(&q_arc, true); /* put cubic points in arc_path */ - _add_split_arc_path(arc_path, pidx, &q_arc, center, cw); + add_split_arc_path(arc_path, pidx, &q_arc, center, cw); } /* full arcs */ for(int32_t q = 0; q < nbarc ; q++) { q_arc.quarter = (q + ((start_angle + 89) / 90)) % 4; q_arc.angle = 90; /* get cubic points relative to center */ - _get_arc_control_points(&q_arc, true); /* 2nd parameter 'start' ignored */ + get_arc_control_points(&q_arc, true); /* 2nd parameter 'start' ignored */ /* put cubic points in arc_path */ - _add_split_arc_path(arc_path, pidx, &q_arc, center, cw); + add_split_arc_path(arc_path, pidx, &q_arc, center, cw); } /* partial ending arc */ if(end_arc_angle > 0) { q_arc.quarter = (end_angle / 90) % 4; q_arc.angle = end_arc_angle; /* get cubic points relative to center */ - _get_arc_control_points(&q_arc, false); + get_arc_control_points(&q_arc, false); /* put cubic points in arc_path */ - _add_split_arc_path(arc_path, pidx, &q_arc, center, cw); + add_split_arc_path(arc_path, pidx, &q_arc, center, cw); } } @@ -534,153 +651,29 @@ static void _add_arc_path(int32_t * arc_path, int * pidx, int32_t radius, q_arc.quarter = (end_angle / 90) % 4; q_arc.angle = end_arc_angle; /* get cubic points relative to center */ - _get_arc_control_points(&q_arc, false); + get_arc_control_points(&q_arc, false); /* put cubic points in arc_path */ - _add_split_arc_path(arc_path, pidx, &q_arc, center, cw); + add_split_arc_path(arc_path, pidx, &q_arc, center, cw); } /* full arcs */ for(int32_t q = nbarc - 1; q >= 0; q--) { q_arc.quarter = (q + ((start_angle + 89) / 90)) % 4; q_arc.angle = 90; /* get cubic points relative to center */ - _get_arc_control_points(&q_arc, true); /* 2nd parameter 'start' ignored */ + get_arc_control_points(&q_arc, true); /* 2nd parameter 'start' ignored */ /* put cubic points in arc_path */ - _add_split_arc_path(arc_path, pidx, &q_arc, center, cw); + add_split_arc_path(arc_path, pidx, &q_arc, center, cw); } /* partial starting arc */ if(start_arc_angle > 0) { q_arc.quarter = (start_angle / 90) % 4; q_arc.angle = start_arc_angle; /* get cubic points relative to center */ - _get_arc_control_points(&q_arc, true); + get_arc_control_points(&q_arc, true); /* put cubic points in arc_path */ - _add_split_arc_path(arc_path, pidx, &q_arc, center, cw); + add_split_arc_path(arc_path, pidx, &q_arc, center, cw); } } } -static void _vglite_draw_arc(const lv_point_t * center, const lv_area_t * clip_area, - const lv_draw_arc_dsc_t * dsc) -{ - vg_lite_path_t path; - uint16_t start_angle = dsc->start_angle; - uint16_t end_angle = dsc->end_angle; - - /* be sure end_angle > start_angle */ - if(end_angle < start_angle) - end_angle += 360; - - bool donut = ((end_angle - start_angle) % 360 == 0) ? true : false; - vg_lite_buffer_t * vgbuf = vglite_get_dest_buf(); - - int32_t arc_path[ARC_PATH_DATA_MAX_SIZE]; - lv_memzero(arc_path, sizeof(arc_path)); - - /*** Init path ***/ - int32_t width = dsc->width; /* inner arc radius = outer arc radius - width */ - uint16_t radius = dsc->radius; - - if(width > radius) - width = radius; - - int pidx = 0; - int32_t cp_x, cp_y; /* control point coords */ - - /* first control point of curve */ - cp_x = radius; - cp_y = 0; - _rotate_point(start_angle, &cp_x, &cp_y); - arc_path[pidx++] = VLC_OP_MOVE; - arc_path[pidx++] = center->x + cp_x; - arc_path[pidx++] = center->y + cp_y; - - /* draw 1-5 outer quarters */ - _add_arc_path(arc_path, &pidx, radius, start_angle, end_angle, center, true); - - if(donut) { - /* close outer circle */ - cp_x = radius; - cp_y = 0; - _rotate_point(start_angle, &cp_x, &cp_y); - arc_path[pidx++] = VLC_OP_LINE; - arc_path[pidx++] = center->x + cp_x; - arc_path[pidx++] = center->y + cp_y; - /* start inner circle */ - cp_x = radius - width; - cp_y = 0; - _rotate_point(start_angle, &cp_x, &cp_y); - arc_path[pidx++] = VLC_OP_MOVE; - arc_path[pidx++] = center->x + cp_x; - arc_path[pidx++] = center->y + cp_y; - - } - else if(dsc->rounded != 0U) { /* 1st rounded arc ending */ - cp_x = radius - width / 2; - cp_y = 0; - _rotate_point(end_angle, &cp_x, &cp_y); - lv_point_t round_center = {center->x + cp_x, center->y + cp_y}; - _add_arc_path(arc_path, &pidx, width / 2, end_angle, (end_angle + 180), - &round_center, true); - - } - else { /* 1st flat ending */ - cp_x = radius - width; - cp_y = 0; - _rotate_point(end_angle, &cp_x, &cp_y); - arc_path[pidx++] = VLC_OP_LINE; - arc_path[pidx++] = center->x + cp_x; - arc_path[pidx++] = center->y + cp_y; - } - - /* draw 1-5 inner quarters */ - _add_arc_path(arc_path, &pidx, radius - width, start_angle, end_angle, center, false); - - /* last control point of curve */ - if(donut) { /* close the loop */ - cp_x = radius - width; - cp_y = 0; - _rotate_point(start_angle, &cp_x, &cp_y); - arc_path[pidx++] = VLC_OP_LINE; - arc_path[pidx++] = center->x + cp_x; - arc_path[pidx++] = center->y + cp_y; - - } - else if(dsc->rounded != 0U) { /* 2nd rounded arc ending */ - cp_x = radius - width / 2; - cp_y = 0; - _rotate_point(start_angle, &cp_x, &cp_y); - lv_point_t round_center = {center->x + cp_x, center->y + cp_y}; - _add_arc_path(arc_path, &pidx, width / 2, (start_angle + 180), (start_angle + 360), - &round_center, true); - - } - else { /* 2nd flat ending */ - cp_x = radius; - cp_y = 0; - _rotate_point(start_angle, &cp_x, &cp_y); - arc_path[pidx++] = VLC_OP_LINE; - arc_path[pidx++] = center->x + cp_x; - arc_path[pidx++] = center->y + cp_y; - } - - arc_path[pidx++] = VLC_OP_END; - - VGLITE_CHECK_ERROR(vg_lite_init_path(&path, VG_LITE_S32, VG_LITE_HIGH, (uint32_t)pidx * sizeof(int32_t), arc_path, - (vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1, - ((vg_lite_float_t)clip_area->x2) + 1.0f, ((vg_lite_float_t)clip_area->y2) + 1.0f)); - - lv_color32_t col32 = lv_color_to_32(dsc->color, dsc->opa); - vg_lite_color_t vgcol = vglite_get_color(col32, false); - - vg_lite_matrix_t matrix; - vg_lite_identity(&matrix); - - /*** Draw arc ***/ - VGLITE_CHECK_ERROR(vg_lite_draw(vgbuf, &path, VG_LITE_FILL_NON_ZERO, &matrix, VG_LITE_BLEND_SRC_OVER, vgcol)); - - vglite_run(); - - VGLITE_CHECK_ERROR(vg_lite_clear_path(&path)); -} - -#endif /*LV_USE_DRAW_VGLITE*/ +#endif /*LV_USE_GPU_NXP_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_arc.h b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_arc.h new file mode 100644 index 0000000..0fbff3d --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_arc.h @@ -0,0 +1,83 @@ +/** + * @file lv_draw_vglite_arc.h + * + */ + +/** + * MIT License + * + * Copyright 2021-2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef LV_DRAW_VGLITE_ARC_H +#define LV_DRAW_VGLITE_ARC_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lv_conf_internal.h" + +#if LV_USE_GPU_NXP_VG_LITE +#include "lv_vglite_utils.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Draw arc shape with effects + * + * @param[in] center Arc center with relative coordinates + * @param[in] radius Radius of external arc + * @param[in] start_angle Starting angle in degrees + * @param[in] end_angle Ending angle in degrees + * @param[in] clip_area Clipping area with relative coordinates to dest buff + * @param[in] dsc Arc description structure (width, rounded ending, opacity) + * + * @retval LV_RES_OK Draw completed + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + */ +lv_res_t lv_gpu_nxp_vglite_draw_arc(const lv_point_t * center, int32_t radius, int32_t start_angle, int32_t end_angle, + const lv_area_t * clip_area, const lv_draw_arc_dsc_t * dsc); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_NXP_VG_LITE*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_VGLITE_ARC_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_blend.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_blend.c new file mode 100644 index 0000000..4a15fd5 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_blend.c @@ -0,0 +1,635 @@ +/** + * @file lv_draw_vglite_blend.c + * + */ + +/** + * MIT License + * + * Copyright 2020-2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "lv_draw_vglite_blend.h" + +#if LV_USE_GPU_NXP_VG_LITE +#include "lv_vglite_buf.h" +#include "lv_vglite_utils.h" + +/********************* + * DEFINES + *********************/ + +/** Stride in px required by VG-Lite HW*/ +#define LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX 16U + +#if VG_LITE_BLIT_SPLIT_ENABLED + /** + * BLIT split threshold - BLITs with width or height higher than this value will be done + * in multiple steps. Value must be 16-aligned. Don't change. + */ + #define LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR 352 +#endif + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/** + * Blit image, with optional opacity. + * + * @param[in] src_area Source area with relative coordinates of source buffer + * @param[in] opa Opacity + * + * @retval LV_RES_OK Transfer complete + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + */ +static lv_res_t lv_vglite_blit(const lv_area_t * src_area, lv_opa_t opa); + +/** + * Check source memory and stride alignment. + * + * @param[in] src_buf Source buffer + * @param[in] src_stride Stride of source buffer in pixels + * + * @retval LV_RES_OK Alignment OK + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + */ +static lv_res_t check_src_alignment(const lv_color_t * src_buf, lv_coord_t src_stride); + +/** + * Creates matrix that translates to origin of given destination area. + * + * @param[in] dest_area Area with relative coordinates of destination buffer + */ +static inline void lv_vglite_set_translation_matrix(const lv_area_t * dest_area); + +/** + * Creates matrix that translates to origin of given destination area with transformation (scale or rotate). + * + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] dsc Image descriptor + */ +static inline void lv_vglite_set_transformation_matrix(const lv_area_t * dest_area, const lv_draw_img_dsc_t * dsc); + +#if VG_LITE_BLIT_SPLIT_ENABLED +/** + * Move buffer pointer as close as possible to area, but with respect to alignment requirements. X-axis only. + * + * @param[in/out] area Area to be updated + * @param[in/out] buf Pointer to be updated + */ +static void align_x(lv_area_t * area, lv_color_t ** buf); + +/** + * Move buffer pointer to the area start and update variables, Y-axis only. + * + * @param[in/out] area Area to be updated + * @param[in/out] buf Pointer to be updated + * @param[in] stride Buffer stride in pixels + */ +static void align_y(lv_area_t * area, lv_color_t ** buf, lv_coord_t stride); + +/** + * Blit image split in tiles, with optional opacity. + * + * @param[in/out] dest_buf Destination buffer + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] dest_stride Stride of destination buffer in pixels + * @param[in] src_buf Source buffer + * @param[in] src_area Source area with relative coordinates of source buffer + * @param[in] src_stride Stride of source buffer in pixels + * @param[in] opa Opacity + * + * @retval LV_RES_OK Transfer complete + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + */ +static lv_res_t lv_vglite_blit_split(lv_color_t * dest_buf, lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, lv_area_t * src_area, lv_coord_t src_stride, + lv_opa_t opa); +#endif /*VG_LITE_BLIT_SPLIT_ENABLED*/ + +/********************** + * STATIC VARIABLES + **********************/ + +static vg_lite_matrix_t vgmatrix; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_res_t lv_gpu_nxp_vglite_fill(const lv_area_t * dest_area, lv_color_t color, lv_opa_t opa) +{ + vg_lite_error_t err = VG_LITE_SUCCESS; + lv_color32_t col32 = {.full = lv_color_to32(color)}; /*Convert color to RGBA8888*/ + vg_lite_color_t vgcol; /* vglite takes ABGR */ + vg_lite_buffer_t * vgbuf = lv_vglite_get_dest_buf(); + + vg_lite_buffer_format_t color_format = LV_COLOR_DEPTH == 16 ? VG_LITE_BGRA8888 : VG_LITE_ABGR8888; + if(lv_vglite_premult_and_swizzle(&vgcol, col32, opa, color_format) != LV_RES_OK) + VG_LITE_RETURN_INV("Premultiplication and swizzle failed."); + + if(opa >= (lv_opa_t)LV_OPA_MAX) { /*Opaque fill*/ + vg_lite_rectangle_t rect = { + .x = dest_area->x1, + .y = dest_area->y1, + .width = lv_area_get_width(dest_area), + .height = lv_area_get_height(dest_area) + }; + + err = vg_lite_clear(vgbuf, &rect, vgcol); + VG_LITE_ERR_RETURN_INV(err, "Clear failed."); + + if(lv_vglite_run() != LV_RES_OK) + VG_LITE_RETURN_INV("Run failed."); + } + else { /*fill with transparency*/ + + vg_lite_path_t path; + int32_t path_data[] = { /*VG rectangular path*/ + VLC_OP_MOVE, dest_area->x1, dest_area->y1, + VLC_OP_LINE, dest_area->x2 + 1, dest_area->y1, + VLC_OP_LINE, dest_area->x2 + 1, dest_area->y2 + 1, + VLC_OP_LINE, dest_area->x1, dest_area->y2 + 1, + VLC_OP_LINE, dest_area->x1, dest_area->y1, + VLC_OP_END + }; + + err = vg_lite_init_path(&path, VG_LITE_S32, VG_LITE_LOW, sizeof(path_data), path_data, + (vg_lite_float_t) dest_area->x1, (vg_lite_float_t) dest_area->y1, + ((vg_lite_float_t) dest_area->x2) + 1.0f, ((vg_lite_float_t) dest_area->y2) + 1.0f); + VG_LITE_ERR_RETURN_INV(err, "Init path failed."); + + vg_lite_matrix_t matrix; + vg_lite_identity(&matrix); + + /*Draw rectangle*/ + err = vg_lite_draw(vgbuf, &path, VG_LITE_FILL_EVEN_ODD, &matrix, VG_LITE_BLEND_SRC_OVER, vgcol); + VG_LITE_ERR_RETURN_INV(err, "Draw rectangle failed."); + + if(lv_vglite_run() != LV_RES_OK) + VG_LITE_RETURN_INV("Run failed."); + + err = vg_lite_clear_path(&path); + VG_LITE_ERR_RETURN_INV(err, "Clear path failed."); + } + + return LV_RES_OK; +} + +#if VG_LITE_BLIT_SPLIT_ENABLED +lv_res_t lv_gpu_nxp_vglite_blit_split(lv_color_t * dest_buf, lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, lv_area_t * src_area, lv_coord_t src_stride, + lv_opa_t opa) +{ + /* Set src_vgbuf structure. */ + lv_vglite_set_src_buf(src_buf, src_area, src_stride); + + lv_color_t * orig_dest_buf = dest_buf; + + lv_res_t rv = lv_vglite_blit_split(dest_buf, dest_area, dest_stride, src_buf, src_area, src_stride, opa); + + /* Restore the original dest_vgbuf memory address. */ + lv_vglite_set_dest_buf_ptr(orig_dest_buf); + + return rv; +} +#else +lv_res_t lv_gpu_nxp_vglite_blit(const lv_area_t * dest_area, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + lv_opa_t opa) +{ + if(check_src_alignment(src_buf, src_stride) != LV_RES_OK) + VG_LITE_RETURN_INV("Check src alignment failed."); + + /* Set src_vgbuf structure. */ + lv_vglite_set_src_buf(src_buf, src_area, src_stride); + + /* Set scissor. */ + lv_vglite_set_scissor(dest_area); + + /* Set vgmatrix. */ + lv_vglite_set_translation_matrix(dest_area); + + /* Start blit. */ + lv_res_t rv = lv_vglite_blit(src_area, opa); + + /* Disable scissor. */ + lv_vglite_disable_scissor(); + + return rv; +} + +lv_res_t lv_gpu_nxp_vglite_blit_transform(const lv_area_t * dest_area, const lv_area_t * clip_area, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + const lv_draw_img_dsc_t * dsc) +{ + lv_res_t rv = LV_RES_INV; + + if(check_src_alignment(src_buf, src_stride) != LV_RES_OK) + VG_LITE_RETURN_INV("Check src alignment failed."); + + /* Set src_vgbuf structure. */ + lv_vglite_set_src_buf(src_buf, src_area, src_stride); + + /* Set scissor */ + lv_vglite_set_scissor(clip_area); + + /* Set vgmatrix. */ + lv_vglite_set_transformation_matrix(dest_area, dsc); + + /* Start blit. */ + rv = lv_vglite_blit(src_area, dsc->opa); + + /* Disable scissor. */ + lv_vglite_disable_scissor(); + + return rv; +} +#endif /*VG_LITE_BLIT_SPLIT_ENABLED*/ + +lv_res_t lv_gpu_nxp_vglite_buffer_copy(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride) +{ + vg_lite_error_t err = VG_LITE_SUCCESS; + + if(check_src_alignment(src_buf, src_stride) != LV_RES_OK) + VG_LITE_RETURN_INV("Check src alignment failed."); + + vg_lite_buffer_t src_vgbuf; + /* Set src_vgbuf structure. */ + lv_vglite_set_buf(&src_vgbuf, src_buf, src_area, src_stride); + + vg_lite_buffer_t dest_vgbuf; + /* Set dest_vgbuf structure. */ + lv_vglite_set_buf(&dest_vgbuf, dest_buf, dest_area, dest_stride); + + uint32_t rect[] = { + (uint32_t)src_area->x1, /* start x */ + (uint32_t)src_area->y1, /* start y */ + (uint32_t)lv_area_get_width(src_area), /* width */ + (uint32_t)lv_area_get_height(src_area) /* height */ + }; + + /* Set scissor. */ + lv_vglite_set_scissor(dest_area); + + /* Set vgmatrix. */ + lv_vglite_set_translation_matrix(dest_area); + + err = vg_lite_blit_rect(&dest_vgbuf, &src_vgbuf, rect, &vgmatrix, + VG_LITE_BLEND_NONE, 0xFFFFFFFFU, VG_LITE_FILTER_POINT); + if(err != VG_LITE_SUCCESS) { + LV_LOG_ERROR("Blit rectangle failed."); + /* Disable scissor. */ + lv_vglite_disable_scissor(); + + return LV_RES_INV; + } + + if(lv_vglite_run() != LV_RES_OK) { + LV_LOG_ERROR("Run failed."); + /* Disable scissor. */ + lv_vglite_disable_scissor(); + + return LV_RES_INV; + } + + /* Disable scissor. */ + lv_vglite_disable_scissor(); + + return LV_RES_OK; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +#if VG_LITE_BLIT_SPLIT_ENABLED +static lv_res_t lv_vglite_blit_split(lv_color_t * dest_buf, lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, lv_area_t * src_area, lv_coord_t src_stride, + lv_opa_t opa) +{ + lv_res_t rv = LV_RES_INV; + + VG_LITE_LOG_TRACE("Blit " + "Area: ([%d,%d], [%d,%d]) -> ([%d,%d], [%d,%d]) | " + "Size: ([%dx%d] -> [%dx%d]) | " + "Addr: (0x%x -> 0x%x)", + src_area->x1, src_area->y1, src_area->x2, src_area->y2, + dest_area->x1, dest_area->y1, dest_area->x2, dest_area->y2, + lv_area_get_width(src_area), lv_area_get_height(src_area), + lv_area_get_width(dest_area), lv_area_get_height(dest_area), + (uintptr_t)src_buf, (uintptr_t)dest_buf); + + /* Stage 1: Move starting pointers as close as possible to [x1, y1], so coordinates are as small as possible. */ + align_x(src_area, (lv_color_t **)&src_buf); + align_y(src_area, (lv_color_t **)&src_buf, src_stride); + align_x(dest_area, (lv_color_t **)&dest_buf); + align_y(dest_area, (lv_color_t **)&dest_buf, dest_stride); + + /* Stage 2: If we're in limit, do a single BLIT */ + if((src_area->x2 < LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR) && + (src_area->y2 < LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR)) { + if(check_src_alignment(src_buf, src_stride) != LV_RES_OK) + VG_LITE_RETURN_INV("Check src alignment failed."); + + /* Set new dest_vgbuf and src_vgbuf memory addresses. */ + lv_vglite_set_dest_buf_ptr(dest_buf); + lv_vglite_set_src_buf_ptr(src_buf); + + /* Set scissor */ + lv_vglite_set_scissor(dest_area); + + /* Set vgmatrix. */ + lv_vglite_set_translation_matrix(dest_area); + + /* Start blit. */ + rv = lv_vglite_blit(src_area, opa); + + /* Disable scissor. */ + lv_vglite_disable_scissor(); + + VG_LITE_LOG_TRACE("Single " + "Area: ([%d,%d], [%d,%d]) -> ([%d,%d], [%d,%d]) | " + "Size: ([%dx%d] -> [%dx%d]) | " + "Addr: (0x%x -> 0x%x) %s", + src_area->x1, src_area->y1, src_area->x2, src_area->y2, + dest_area->x1, dest_area->y1, dest_area->x2, dest_area->y2, + lv_area_get_width(src_area), lv_area_get_height(src_area), + lv_area_get_width(dest_area), lv_area_get_height(dest_area), + (uintptr_t)src_buf, (uintptr_t)dest_buf, + rv == LV_RES_OK ? "OK!" : "FAILED!"); + + return rv; + }; + + /* Stage 3: Split the BLIT into multiple tiles */ + VG_LITE_LOG_TRACE("Split " + "Area: ([%d,%d], [%d,%d]) -> ([%d,%d], [%d,%d]) | " + "Size: ([%dx%d] -> [%dx%d]) | " + "Addr: (0x%x -> 0x%x)", + src_area->x1, src_area->y1, src_area->x2, src_area->y2, + dest_area->x1, dest_area->y1, dest_area->x2, dest_area->y2, + lv_area_get_width(src_area), lv_area_get_height(src_area), + lv_area_get_width(dest_area), lv_area_get_height(dest_area), + (uintptr_t)src_buf, (uintptr_t)dest_buf); + + + lv_coord_t width = lv_area_get_width(src_area); + lv_coord_t height = lv_area_get_height(src_area); + + /* Number of tiles needed */ + int total_tiles_x = (src_area->x1 + width + LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR - 1) / + LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR; + int total_tiles_y = (src_area->y1 + height + LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR - 1) / + LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR; + + /* src and dst buffer shift against each other. Src buffer real data [0,0] may start actually at [3,0] in buffer, as + * the buffer pointer has to be aligned, while dst buffer real data [0,0] may start at [1,0] in buffer. alignment may be + * different */ + int shift_src_x = (src_area->x1 > dest_area->x1) ? (src_area->x1 - dest_area->x1) : 0; + int shift_dest_x = (src_area->x1 < dest_area->x1) ? (dest_area->x1 - src_area->x1) : 0; + + VG_LITE_LOG_TRACE("X shift: src: %d, dst: %d", shift_src_x, shift_dest_x); + + lv_color_t * tile_dest_buf; + lv_area_t tile_dest_area; + const lv_color_t * tile_src_buf; + lv_area_t tile_src_area; + + for(int y = 0; y < total_tiles_y; y++) { + + tile_src_area.y1 = 0; /* no vertical alignment, always start from 0 */ + tile_src_area.y2 = height - y * LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR - 1; + if(tile_src_area.y2 >= LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR) { + tile_src_area.y2 = LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR - 1; /* Should never happen */ + } + tile_src_buf = src_buf + y * LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR * src_stride; + + tile_dest_area.y1 = tile_src_area.y1; /* y has no alignment, always in sync with src */ + tile_dest_area.y2 = tile_src_area.y2; + + tile_dest_buf = dest_buf + y * LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR * dest_stride; + + for(int x = 0; x < total_tiles_x; x++) { + + if(x == 0) { + /* 1st tile is special - there may be a gap between buffer start pointer + * and area.x1 value, as the pointer has to be aligned. + * tile_src_buf pointer - keep init value from Y-loop. + * Also, 1st tile start is not shifted! shift is applied from 2nd tile */ + tile_src_area.x1 = src_area->x1; + tile_dest_area.x1 = dest_area->x1; + } + else { + /* subsequent tiles always starts from 0, but shifted*/ + tile_src_area.x1 = 0 + shift_src_x; + tile_dest_area.x1 = 0 + shift_dest_x; + /* and advance start pointer + 1 tile size */ + tile_src_buf += LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR; + tile_dest_buf += LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR; + } + + /* Clip tile end coordinates */ + tile_src_area.x2 = width + src_area->x1 - x * LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR - 1; + if(tile_src_area.x2 >= LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR) { + tile_src_area.x2 = LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR - 1; + } + + tile_dest_area.x2 = width + dest_area->x1 - x * LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR - 1; + if(tile_dest_area.x2 >= LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR) { + tile_dest_area.x2 = LV_GPU_NXP_VG_LITE_BLIT_SPLIT_THR - 1; + } + + if(x < (total_tiles_x - 1)) { + /* And adjust end coords if shifted, but not for last tile! */ + tile_src_area.x2 += shift_src_x; + tile_dest_area.x2 += shift_dest_x; + } + + if(check_src_alignment(tile_src_buf, src_stride) != LV_RES_OK) + VG_LITE_RETURN_INV("Check src alignment failed."); + + /* Set new dest_vgbuf and src_vgbuf memory addresses. */ + lv_vglite_set_dest_buf_ptr(tile_dest_buf); + lv_vglite_set_src_buf_ptr(tile_src_buf); + + /* Set scissor */ + lv_vglite_set_scissor(&tile_dest_area); + + /* Set vgmatrix. */ + lv_vglite_set_translation_matrix(&tile_dest_area); + + /* Start blit. */ + rv = lv_vglite_blit(&tile_src_area, opa); + + /* Disable scissor. */ + lv_vglite_disable_scissor(); + + VG_LITE_LOG_TRACE("Tile [%d, %d] " + "Area: ([%d,%d], [%d,%d]) -> ([%d,%d], [%d,%d]) | " + "Size: ([%dx%d] -> [%dx%d]) | " + "Addr: (0x%x -> 0x%x) %s", + x, y, + tile_src_area.x1, tile_src_area.y1, tile_src_area.x2, tile_src_area.y2, + tile_dest_area.x1, tile_dest_area.y1, tile_dest_area.x2, tile_dest_area.y2, + lv_area_get_width(&tile_src_area), lv_area_get_height(&tile_src_area), + lv_area_get_width(&tile_dest_area), lv_area_get_height(&tile_dest_area), + (uintptr_t)tile_src_buf, (uintptr_t)tile_dest_buf, + rv == LV_RES_OK ? "OK!" : "FAILED!"); + + if(rv != LV_RES_OK) { + return rv; + } + } + } + + return rv; +} +#endif /*VG_LITE_BLIT_SPLIT_ENABLED*/ + +static lv_res_t lv_vglite_blit(const lv_area_t * src_area, lv_opa_t opa) +{ + vg_lite_error_t err = VG_LITE_SUCCESS; + vg_lite_buffer_t * dst_vgbuf = lv_vglite_get_dest_buf(); + vg_lite_buffer_t * src_vgbuf = lv_vglite_get_src_buf(); + + uint32_t rect[] = { + (uint32_t)src_area->x1, /* start x */ + (uint32_t)src_area->y1, /* start y */ + (uint32_t)lv_area_get_width(src_area), /* width */ + (uint32_t)lv_area_get_height(src_area) /* height */ + }; + + uint32_t color; + vg_lite_blend_t blend; + if(opa >= (lv_opa_t)LV_OPA_MAX) { + color = 0xFFFFFFFFU; + blend = VG_LITE_BLEND_SRC_OVER; + src_vgbuf->transparency_mode = VG_LITE_IMAGE_TRANSPARENT; + } + else { + if(vg_lite_query_feature(gcFEATURE_BIT_VG_PE_PREMULTIPLY)) { + color = (opa << 24) | 0x00FFFFFFU; + } + else { + color = (opa << 24) | (opa << 16) | (opa << 8) | opa; + } + blend = VG_LITE_BLEND_SRC_OVER; + src_vgbuf->image_mode = VG_LITE_MULTIPLY_IMAGE_MODE; + src_vgbuf->transparency_mode = VG_LITE_IMAGE_TRANSPARENT; + } + + err = vg_lite_blit_rect(dst_vgbuf, src_vgbuf, rect, &vgmatrix, blend, color, VG_LITE_FILTER_POINT); + VG_LITE_ERR_RETURN_INV(err, "Blit rectangle failed."); + + if(lv_vglite_run() != LV_RES_OK) + VG_LITE_RETURN_INV("Run failed."); + + return LV_RES_OK; +} + +static lv_res_t check_src_alignment(const lv_color_t * src_buf, lv_coord_t src_stride) +{ + /* No alignment requirement for destination pixel buffer when using mode VG_LITE_LINEAR */ + + /* Test for pointer alignment */ + if((((uintptr_t)src_buf) % (uintptr_t)LV_ATTRIBUTE_MEM_ALIGN_SIZE) != (uintptr_t)0x0U) + VG_LITE_RETURN_INV("Src buffer ptr (0x%x) not aligned to 0x%x bytes.", + (size_t)src_buf, LV_ATTRIBUTE_MEM_ALIGN_SIZE); + + /* Test for stride alignment */ + if((src_stride % (lv_coord_t)LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX) != 0x0U) + VG_LITE_RETURN_INV("Src buffer stride (%d px) not aligned to %d px.", + src_stride, LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX); + return LV_RES_OK; +} + +static inline void lv_vglite_set_translation_matrix(const lv_area_t * dest_area) +{ + vg_lite_identity(&vgmatrix); + vg_lite_translate((vg_lite_float_t)dest_area->x1, (vg_lite_float_t)dest_area->y1, &vgmatrix); +} + +static inline void lv_vglite_set_transformation_matrix(const lv_area_t * dest_area, const lv_draw_img_dsc_t * dsc) +{ + lv_vglite_set_translation_matrix(dest_area); + + bool has_scale = (dsc->zoom != LV_IMG_ZOOM_NONE); + bool has_rotation = (dsc->angle != 0); + + vg_lite_translate(dsc->pivot.x, dsc->pivot.y, &vgmatrix); + if(has_rotation) + vg_lite_rotate(dsc->angle / 10.0f, &vgmatrix); /* angle is 1/10 degree */ + if(has_scale) { + vg_lite_float_t scale = 1.0f * dsc->zoom / LV_IMG_ZOOM_NONE; + vg_lite_scale(scale, scale, &vgmatrix); + } + vg_lite_translate(0.0f - dsc->pivot.x, 0.0f - dsc->pivot.y, &vgmatrix); +} + +#if VG_LITE_BLIT_SPLIT_ENABLED +static void align_x(lv_area_t * area, lv_color_t ** buf) +{ + int alignedAreaStartPx = area->x1 - (area->x1 % (LV_ATTRIBUTE_MEM_ALIGN_SIZE / sizeof(lv_color_t))); + VG_LITE_COND_STOP(alignedAreaStartPx < 0, "Negative X alignment."); + + area->x1 -= alignedAreaStartPx; + area->x2 -= alignedAreaStartPx; + *buf += alignedAreaStartPx; +} + +static void align_y(lv_area_t * area, lv_color_t ** buf, lv_coord_t stride) +{ + int LineToAlignMem; + int alignedAreaStartPy; + /* find how many lines of pixels will respect memory alignment requirement */ + if((stride % (lv_coord_t)LV_ATTRIBUTE_MEM_ALIGN_SIZE) == 0x0U) { + alignedAreaStartPy = area->y1; + } + else { + LineToAlignMem = LV_ATTRIBUTE_MEM_ALIGN_SIZE / (LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX * sizeof(lv_color_t)); + VG_LITE_COND_STOP(LV_ATTRIBUTE_MEM_ALIGN_SIZE % (LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX * sizeof(lv_color_t)), + "Complex case: need gcd function."); + alignedAreaStartPy = area->y1 - (area->y1 % LineToAlignMem); + VG_LITE_COND_STOP(alignedAreaStartPy < 0, "Negative Y alignment."); + } + + area->y1 -= alignedAreaStartPy; + area->y2 -= alignedAreaStartPy; + *buf += (uint32_t)(alignedAreaStartPy * stride); +} +#endif /*VG_LITE_BLIT_SPLIT_ENABLED*/ + +#endif /*LV_USE_GPU_NXP_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_blend.h b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_blend.h new file mode 100644 index 0000000..1aae34b --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_blend.h @@ -0,0 +1,168 @@ +/** + * @file lv_draw_vglite_blend.h + * + */ + +/** + * MIT License + * + * Copyright 2020-2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef LV_DRAW_VGLITE_BLEND_H +#define LV_DRAW_VGLITE_BLEND_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +#include "../../../lv_conf_internal.h" + +#if LV_USE_GPU_NXP_VG_LITE +#include "lv_vglite_utils.h" + +/********************* + * DEFINES + *********************/ + +/** + * Enable BLIT quality degradation workaround for RT595, + * recommended for screen's dimension > 352 pixels. + */ +#define RT595_BLIT_WRKRND_ENABLED 1 + +/* Internal compound symbol */ +#if (defined(CPU_MIMXRT595SFFOB) || defined(CPU_MIMXRT595SFFOB_cm33) || \ + defined(CPU_MIMXRT595SFFOC) || defined(CPU_MIMXRT595SFFOC_cm33)) && \ + RT595_BLIT_WRKRND_ENABLED +#define VG_LITE_BLIT_SPLIT_ENABLED 1 +#else +#define VG_LITE_BLIT_SPLIT_ENABLED 0 +#endif + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Fill area, with optional opacity. + * + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] color Color + * @param[in] opa Opacity (255 = full, 128 = 50% background/50% color, 0 = no fill) + * + * @retval LV_RES_OK Fill completed + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + */ +lv_res_t lv_gpu_nxp_vglite_fill(const lv_area_t * dest_area, lv_color_t color, lv_opa_t opa); + +#if VG_LITE_BLIT_SPLIT_ENABLED +/** + * BLock Image Transfer - copy rectangular image from src_buf to dst_buf with effects. + * By default, image is copied directly, with optional opacity. + * + * @param[in/out] dest_buf Destination buffer + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] dest_stride Stride of destination buffer in pixels + * @param[in] src_buf Source buffer + * @param[in] src_area Source area with relative coordinates of source buffer + * @param[in] src_stride Stride of source buffer in pixels + * @param[in] opa Opacity + * + * @retval LV_RES_OK Transfer complete + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + */ +lv_res_t lv_gpu_nxp_vglite_blit_split(lv_color_t * dest_buf, lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, lv_area_t * src_area, lv_coord_t src_stride, + lv_opa_t opa); +#else +/** + * BLock Image Transfer - copy rectangular image from src_buf to dst_buf with effects. + * By default, image is copied directly, with optional opacity. + * + * @param[in] dest_stride Stride of destination buffer in pixels + * @param[in] src_buf Source buffer + * @param[in] src_area Source area with relative coordinates of source buffer + * @param[in] src_stride Stride of source buffer in pixels + * @param[in] opa Opacity + * + * @retval LV_RES_OK Transfer complete + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + */ +lv_res_t lv_gpu_nxp_vglite_blit(const lv_area_t * dest_area, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + lv_opa_t opa); + +/** + * BLock Image Transfer - copy rectangular image from src_buf to dst_buf with transformation. + * By default, image is copied directly, with optional opacity. + * + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] clip_area Clip area with relative coordinates of destination buffer + * @param[in] src_buf Source buffer + * @param[in] src_area Source area with relative coordinates of source buffer + * @param[in] src_stride Stride of source buffer in pixels + * @param[in] dsc Image descriptor + * + * @retval LV_RES_OK Transfer complete + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + */ +lv_res_t lv_gpu_nxp_vglite_blit_transform(const lv_area_t * dest_area, const lv_area_t * clip_area, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride, + const lv_draw_img_dsc_t * dsc); + +#endif /*VG_LITE_BLIT_SPLIT_ENABLED*/ + +/** + * BLock Image Transfer - simple copy of rectangular image from source to destination. + * + * @param[in] dest_buf Destination buffer + * @param[in] dest_area Area with relative coordinates of destination buffer + * @param[in] dest_stride Stride of destination buffer in pixels + * @param[in] src_buf Source buffer + * @param[in] src_area Source area with relative coordinates of source buffer + * @param[in] src_stride Stride of source buffer in pixels + * + * @retval LV_RES_OK Transfer complete + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + */ +lv_res_t lv_gpu_nxp_vglite_buffer_copy(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, const lv_area_t * src_area, lv_coord_t src_stride); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_NXP_VG_LITE*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_VGLITE_BLEND_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_border.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_border.c deleted file mode 100644 index db762fb..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_border.c +++ /dev/null @@ -1,203 +0,0 @@ -/** - * @file lv_draw_vglite_border.c - * - */ - -/** - * Copyright 2022-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_vglite.h" - -#if LV_USE_DRAW_VGLITE -#include "lv_vglite_buf.h" -#include "lv_vglite_path.h" -#include "lv_vglite_utils.h" - -#include - -/********************* - * DEFINES - *********************/ - -/********************* - * DEFINES - *********************/ - -/*** Define maximum numbers of rectangles needed to clip partial borders ***/ -#define MAX_NUM_RECTANGLES 4 - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/** - * Draw rectangle border/outline shape with effects (rounded corners, opacity) - * - * @param[in] coords Coordinates of the rectangle border/outline (relative to dest buff) - * @param[in] clip_area Clip area with relative coordinates to dest buff - * @param[in] dsc Description of the rectangle border/outline - * - */ -static void _vglite_draw_border(const lv_area_t * coords, const lv_area_t * clip_area, - const lv_draw_border_dsc_t * dsc); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vglite_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc_t * dsc, - const lv_area_t * coords) -{ - if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) - return; - if(dsc->width == 0) - return; - if(dsc->side == (lv_border_side_t)LV_BORDER_SIDE_NONE) - return; - - lv_layer_t * layer = draw_unit->target_layer; - lv_area_t inward_coords; - int32_t width = dsc->width; - - /* Move border inwards to align with software rendered border */ - inward_coords.x1 = coords->x1 + ceil(width / 2.0f); - inward_coords.x2 = coords->x2 - floor(width / 2.0f); - inward_coords.y1 = coords->y1 + ceil(width / 2.0f); - inward_coords.y2 = coords->y2 - floor(width / 2.0f); - - lv_area_move(&inward_coords, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t clip_area; - lv_area_copy(&clip_area, draw_unit->clip_area); - lv_area_move(&clip_area, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t clipped_coords; - if(!lv_area_intersect(&clipped_coords, &inward_coords, &clip_area)) - return; /*Fully clipped, nothing to do*/ - - _vglite_draw_border(&inward_coords, &clip_area, dsc); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void _vglite_draw_border(const lv_area_t * coords, const lv_area_t * clip_area, - const lv_draw_border_dsc_t * dsc) -{ - int32_t radius = dsc->radius; - vg_lite_buffer_t * vgbuf = vglite_get_dest_buf(); - - if(radius < 0) - return; - - int32_t border_half = (int32_t)floor(dsc->width / 2.0f); - if(radius > border_half) - radius = radius - border_half; - - vg_lite_cap_style_t cap_style = (radius) ? VG_LITE_CAP_ROUND : VG_LITE_CAP_BUTT; - vg_lite_join_style_t join_style = (radius) ? VG_LITE_JOIN_ROUND : VG_LITE_JOIN_MITER; - - /*** Init path ***/ - int32_t path_data[RECT_PATH_DATA_MAX_SIZE]; - uint32_t path_data_size; - vglite_create_rect_path_data(path_data, &path_data_size, radius, coords); - vg_lite_quality_t path_quality = radius > 0 ? VG_LITE_HIGH : VG_LITE_MEDIUM; - - vg_lite_path_t path; - VGLITE_CHECK_ERROR(vg_lite_init_path(&path, VG_LITE_S32, path_quality, path_data_size, path_data, - (vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1, - ((vg_lite_float_t)clip_area->x2) + 1.0f, ((vg_lite_float_t)clip_area->y2) + 1.0f)); - - lv_color32_t col32 = lv_color_to_32(dsc->color, dsc->opa); - vg_lite_color_t vgcol = vglite_get_color(col32, false); - - vg_lite_matrix_t matrix; - vg_lite_identity(&matrix); - - int32_t line_width = dsc->width; - lv_border_side_t border_side = dsc->side; - - if(border_side == LV_BORDER_SIDE_FULL) - border_side = LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_LEFT | LV_BORDER_SIDE_RIGHT; - - uint32_t num_rect = 0; - vg_lite_rectangle_t rect[MAX_NUM_RECTANGLES]; - int32_t rect_width = coords->x2 - coords->x1; - int32_t rect_height = coords->y2 - coords->y1; - int32_t shortest_side = LV_MIN(rect_width, rect_height); - int32_t final_radius = LV_MIN(radius, shortest_side / 2); - - if(border_side & LV_BORDER_SIDE_TOP) { - rect[num_rect].x = coords->x1 - ceil(line_width / 2.0f); - rect[num_rect].y = coords->y1 - ceil(line_width / 2.0f); - rect[num_rect].width = coords->x2 - coords->x1 + line_width; - rect[num_rect].height = final_radius + ceil(line_width / 2.0f); - num_rect++; - } - - if(border_side & LV_BORDER_SIDE_LEFT) { - rect[num_rect].x = coords->x1 - ceil(line_width / 2.0f); - rect[num_rect].y = coords->y1 - ceil(line_width / 2.0f); - rect[num_rect].width = final_radius + ceil(line_width / 2.0f); - rect[num_rect].height = coords->y2 - coords->y1 + line_width + 1; - num_rect++; - } - - if(border_side & LV_BORDER_SIDE_RIGHT) { - rect[num_rect].x = coords->x2 - final_radius + 1; - rect[num_rect].y = coords->y1 - ceil(line_width / 2.0f); - rect[num_rect].width = final_radius + ceil(line_width / 2.0f); - rect[num_rect].height = coords->y2 - coords->y1 + line_width + 1; - num_rect++; - } - - if(border_side & LV_BORDER_SIDE_BOTTOM) { - rect[num_rect].x = coords->x1 - ceil(line_width / 2.0f); - rect[num_rect].y = coords->y2 - final_radius + 1; - rect[num_rect].width = coords->x2 - coords->x1 + line_width; - rect[num_rect].height = final_radius + ceil(line_width / 2.0f); - num_rect++; - } - - /*** Enable scissor and apply scissor rects ***/ - VGLITE_CHECK_ERROR(vg_lite_enable_scissor()); - VGLITE_CHECK_ERROR(vg_lite_scissor_rects(vgbuf, num_rect, rect)); - - /*** Draw border ***/ - VGLITE_CHECK_ERROR(vg_lite_set_draw_path_type(&path, VG_LITE_DRAW_STROKE_PATH)); - - VGLITE_CHECK_ERROR(vg_lite_set_stroke(&path, cap_style, join_style, line_width, 8, NULL, 0, 0, vgcol)); - - VGLITE_CHECK_ERROR(vg_lite_update_stroke(&path)); - - VGLITE_CHECK_ERROR(vg_lite_draw(vgbuf, &path, VG_LITE_FILL_NON_ZERO, &matrix, VG_LITE_BLEND_SRC_OVER, vgcol)); - - vglite_run(); - - VGLITE_CHECK_ERROR(vg_lite_clear_path(&path)); - - /*** Disable scissor ***/ - VGLITE_CHECK_ERROR(vg_lite_disable_scissor()); -} - -#endif /*LV_USE_DRAW_VGLITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_fill.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_fill.c deleted file mode 100644 index 97089ce..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_fill.c +++ /dev/null @@ -1,237 +0,0 @@ -/** - * @file lv_draw_vglite_fill.c - * - */ - -/** - * Copyright 2020-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_vglite.h" - -#if LV_USE_DRAW_VGLITE -#include "lv_vglite_buf.h" -#include "lv_vglite_path.h" -#include "lv_vglite_utils.h" - -#include "../../../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/** - * Fill area, with optional opacity. - * - * @param[in] dest_area Area with relative coordinates of destination buffer - * @param[in] dsc Description of the area to fill (color, opa) - * - */ -static void _vglite_fill(const lv_area_t * dest_area, const lv_draw_fill_dsc_t * dsc); - -/** - * Draw rectangle background with effects (rounded corners, gradient) - * - * @param[in] coords Coordinates of the rectangle background (relative to dest buff) - * @param[in] clip_area Clip area with relative coordinates to dest buff - * @param[in] dsc Description of the rectangle background - * - */ -static void _vglite_draw_rect(const lv_area_t * coords, const lv_area_t * clip_area, - const lv_draw_fill_dsc_t * dsc); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vglite_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc, - const lv_area_t * coords) -{ - if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) - return; - - lv_layer_t * layer = draw_unit->target_layer; - lv_area_t relative_coords; - lv_area_copy(&relative_coords, coords); - lv_area_move(&relative_coords, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t clip_area; - lv_area_copy(&clip_area, draw_unit->clip_area); - lv_area_move(&clip_area, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t clipped_coords; - if(!lv_area_intersect(&clipped_coords, &relative_coords, &clip_area)) - return; /*Fully clipped, nothing to do*/ - - /* - * Most simple case: just a plain rectangle (no radius, no gradient) - */ - if((dsc->radius == 0) && (dsc->grad.dir == (lv_grad_dir_t)LV_GRAD_DIR_NONE)) - _vglite_fill(&clipped_coords, dsc); - else - _vglite_draw_rect(&relative_coords, &clip_area, dsc); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void _vglite_fill(const lv_area_t * dest_area, const lv_draw_fill_dsc_t * dsc) -{ - vg_lite_buffer_t * vgbuf = vglite_get_dest_buf(); - - lv_color32_t col32 = lv_color_to_32(dsc->color, dsc->opa); - vg_lite_color_t vgcol = vglite_get_color(col32, false); - - if(dsc->opa >= (lv_opa_t)LV_OPA_MAX) { /*Opaque fill*/ - vg_lite_rectangle_t rect = { - .x = dest_area->x1, - .y = dest_area->y1, - .width = lv_area_get_width(dest_area), - .height = lv_area_get_height(dest_area) - }; - - VGLITE_CHECK_ERROR(vg_lite_clear(vgbuf, &rect, vgcol)); - - vglite_run(); - } - else { /*fill with transparency*/ - - vg_lite_path_t path; - int32_t path_data[] = { /*VG rectangular path*/ - VLC_OP_MOVE, dest_area->x1, dest_area->y1, - VLC_OP_LINE, dest_area->x2 + 1, dest_area->y1, - VLC_OP_LINE, dest_area->x2 + 1, dest_area->y2 + 1, - VLC_OP_LINE, dest_area->x1, dest_area->y2 + 1, - VLC_OP_LINE, dest_area->x1, dest_area->y1, - VLC_OP_END - }; - - VGLITE_CHECK_ERROR(vg_lite_init_path(&path, VG_LITE_S32, VG_LITE_MEDIUM, sizeof(path_data), path_data, - (vg_lite_float_t) dest_area->x1, (vg_lite_float_t) dest_area->y1, - ((vg_lite_float_t) dest_area->x2) + 1.0f, ((vg_lite_float_t) dest_area->y2) + 1.0f)); - - vg_lite_matrix_t matrix; - vg_lite_identity(&matrix); - - /*Draw rectangle*/ - VGLITE_CHECK_ERROR(vg_lite_draw(vgbuf, &path, VG_LITE_FILL_EVEN_ODD, &matrix, VG_LITE_BLEND_SRC_OVER, vgcol)); - - vglite_run(); - - VGLITE_CHECK_ERROR(vg_lite_clear_path(&path)); - } -} - -static void _vglite_draw_rect(const lv_area_t * coords, const lv_area_t * clip_area, - const lv_draw_fill_dsc_t * dsc) -{ - int32_t width = lv_area_get_width(coords); - int32_t height = lv_area_get_height(coords); - int32_t radius = dsc->radius; - lv_opa_t opa = dsc->opa; - vg_lite_buffer_t * vgbuf = vglite_get_dest_buf(); - - if(dsc->radius < 0) - return; - - /*** Init path ***/ - int32_t path_data[RECT_PATH_DATA_MAX_SIZE]; - uint32_t path_data_size; - vglite_create_rect_path_data(path_data, &path_data_size, radius, coords); - vg_lite_quality_t path_quality = dsc->radius > 0 ? VG_LITE_HIGH : VG_LITE_MEDIUM; - - vg_lite_path_t path; - VGLITE_CHECK_ERROR(vg_lite_init_path(&path, VG_LITE_S32, path_quality, path_data_size, path_data, - (vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1, - ((vg_lite_float_t)clip_area->x2) + 1.0f, ((vg_lite_float_t)clip_area->y2) + 1.0f)); - - vg_lite_matrix_t matrix; - vg_lite_identity(&matrix); - - /*** Init Color ***/ - lv_color32_t col32 = lv_color_to_32(dsc->color, opa); - vg_lite_color_t vgcol = vglite_get_color(col32, false); - - vg_lite_linear_gradient_t gradient; - bool has_gradient = (dsc->grad.dir != (lv_grad_dir_t)LV_GRAD_DIR_NONE); - - /*** Init Gradient ***/ - if(has_gradient) { - vg_lite_matrix_t * grad_matrix; - - vg_lite_uint32_t colors[LV_GRADIENT_MAX_STOPS]; - vg_lite_uint32_t stops[LV_GRADIENT_MAX_STOPS]; - lv_color32_t col32[LV_GRADIENT_MAX_STOPS]; - - /* Gradient setup */ - vg_lite_uint32_t cnt = LV_MAX(dsc->grad.stops_count, LV_GRADIENT_MAX_STOPS); - lv_opa_t opa; - - for(uint8_t i = 0; i < cnt; i++) { - stops[i] = dsc->grad.stops[i].frac; - - opa = LV_OPA_MIX2(dsc->grad.stops[i].opa, dsc->opa); - - col32[i] = lv_color_to_32(dsc->grad.stops[i].color, opa); - colors[i] = vglite_get_color(col32[i], true); - } - - lv_memzero(&gradient, sizeof(vg_lite_linear_gradient_t)); - - VGLITE_CHECK_ERROR(vg_lite_init_grad(&gradient)); - - VGLITE_CHECK_ERROR(vg_lite_set_grad(&gradient, cnt, colors, stops)); - - VGLITE_CHECK_ERROR(vg_lite_update_grad(&gradient)); - - grad_matrix = vg_lite_get_grad_matrix(&gradient); - vg_lite_identity(grad_matrix); - vg_lite_translate((float)coords->x1, (float)coords->y1, grad_matrix); - - if(dsc->grad.dir == (lv_grad_dir_t)LV_GRAD_DIR_VER) { - vg_lite_scale(1.0f, (float)height / 256.0f, grad_matrix); - vg_lite_rotate(90.0f, grad_matrix); - } - else { /*LV_GRAD_DIR_HOR*/ - vg_lite_scale((float)width / 256.0f, 1.0f, grad_matrix); - } - - VGLITE_CHECK_ERROR(vg_lite_draw_gradient(vgbuf, &path, VG_LITE_FILL_EVEN_ODD, &matrix, &gradient, - VG_LITE_BLEND_SRC_OVER)); - } - else { - VGLITE_CHECK_ERROR(vg_lite_draw(vgbuf, &path, VG_LITE_FILL_EVEN_ODD, &matrix, VG_LITE_BLEND_SRC_OVER, vgcol)); - } - - vglite_run(); - - VGLITE_CHECK_ERROR(vg_lite_clear_path(&path)); - - if(has_gradient) - VGLITE_CHECK_ERROR(vg_lite_clear_grad(&gradient)); -} - -#endif /*LV_USE_DRAW_VGLITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_img.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_img.c deleted file mode 100644 index 49fdffa..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_img.c +++ /dev/null @@ -1,443 +0,0 @@ -/** - * @file lv_draw_vglite_blend.c - * - */ - -/** - * Copyright 2020-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_vglite.h" - -#if LV_USE_DRAW_VGLITE -#include "lv_vglite_buf.h" -#include "lv_vglite_matrix.h" -#include "lv_vglite_utils.h" -#include "lv_vglite_path.h" - -#include "../../../misc/lv_log.h" - -/********************* - * DEFINES - *********************/ - -#if LV_USE_VGLITE_BLIT_SPLIT -/** -* BLIT split threshold - BLITs with width or height higher than this value will -* be done in multiple steps. Value must be multiple of stride alignment in px. -* For most color formats the alignment is 16px (except the index formats). -*/ -#define VGLITE_BLIT_SPLIT_THR 352 - -/* Enable for logging debug traces. */ -#define VGLITE_LOG_TRACE 0 - -#if VGLITE_LOG_TRACE -#define VGLITE_TRACE(fmt, ...) \ - do { \ - LV_LOG(fmt, ##__VA_ARGS__); \ - } while (0) -#else -#define VGLITE_TRACE(fmt, ...) \ - do { \ - } while (0) -#endif -#endif /*LV_USE_VGLITE_BLIT_SPLIT*/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -#if LV_USE_VGLITE_BLIT_SPLIT -/** - * Move buffer pointer as close as possible to area, but with respect to alignment requirements. - * - * @param[in] buf Buffer address pointer - * @param[in] area Area with relative coordinates to the buffer - * @param[in] stride Stride of buffer in bytes - * @param[in] cf Color format of buffer - */ -static void _move_buf_close_to_area(void ** buf, lv_area_t * area, uint32_t stride, lv_color_format_t cf); - -/** - * BLock Image Transfer - copy rectangular image from src_buf to dst_buf with effects. - * By default, image is copied directly, with optional opacity. - * - * @param dest_buf Destination buffer - * @param[in] dest_area Destination area with relative coordinates to dest buffer - * @param[in] dest_stride Stride of destination buffer in bytes - * @param[in] dest_cf Color format of destination buffer - * @param[in] src_buf Source buffer - * @param[in] src_area Source area with relative coordinates to src buffer - * @param[in] src_stride Stride of source buffer in bytes - * @param[in] src_cf Color format of source buffer - * @param[in] dsc Image descriptor - * - */ -static void _vglite_blit_split(void * dest_buf, lv_area_t * dest_area, uint32_t dest_stride, lv_color_format_t dest_cf, - const void * src_buf, lv_area_t * src_area, uint32_t src_stride, lv_color_format_t src_cf, - const lv_draw_image_dsc_t * dsc); -#endif /*LV_USE_VGLITE_BLIT_SPLIT*/ - -/** - * VGlite blit - fill a path with an image pattern - * - * - * @param[in] dest_area Destination area with relative coordinates to dest buffer - * @param[in] clip_area Clip area with relative coordinates to dest buff - * @param[in] coords Coordinates of the image (relative to dest buff) - * @param[in] dsc Image descriptor - * - */ -static void _vglite_draw_pattern(const lv_area_t * clip_area, const lv_area_t * coords, - const lv_draw_image_dsc_t * dsc); - -/** - * BLock Image Transfer - copy rectangular image from src_buf to dst_buf with or without effects. - * - * @param[in] src_area Source area with relative coordinates to src buffer - * @param[in] dsc Image descriptor - * - */ -static void _vglite_blit(const lv_area_t * src_area, const lv_draw_image_dsc_t * dsc); - -static vg_lite_color_t _vglite_recolor(const lv_draw_image_dsc_t * dsc); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vglite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dsc, - const lv_area_t * coords) -{ - if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) - return; - - lv_layer_t * layer = draw_unit->target_layer; - const lv_image_dsc_t * img_dsc = dsc->src; - - lv_area_t relative_coords; - lv_area_copy(&relative_coords, coords); - lv_area_move(&relative_coords, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t clip_area; - lv_area_copy(&clip_area, draw_unit->clip_area); - lv_area_move(&clip_area, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t blend_area; - bool has_transform = (dsc->rotation != 0 || dsc->scale_x != LV_SCALE_NONE || dsc->scale_y != LV_SCALE_NONE); - if(has_transform) - lv_area_copy(&blend_area, &relative_coords); - else if(!lv_area_intersect(&blend_area, &relative_coords, &clip_area)) - return; /*Fully clipped, nothing to do*/ - - const void * src_buf = img_dsc->data; - - lv_area_t src_area; - src_area.x1 = blend_area.x1 - (coords->x1 - layer->buf_area.x1); - src_area.y1 = blend_area.y1 - (coords->y1 - layer->buf_area.y1); - src_area.x2 = img_dsc->header.w - 1; - src_area.y2 = img_dsc->header.h - 1; - - lv_color_format_t src_cf = img_dsc->header.cf; - uint32_t src_stride = img_dsc->header.stride; - - /* Set src_vgbuf structure. */ - vglite_set_src_buf(src_buf, img_dsc->header.w, img_dsc->header.h, src_stride, src_cf); - -#if LV_USE_VGLITE_BLIT_SPLIT - void * dest_buf = layer->draw_buf->data; - uint32_t dest_stride = layer->draw_buf->header.stride; - lv_color_format_t dest_cf = layer->draw_buf->header.cf; - - if(!has_transform) - _vglite_blit_split(dest_buf, &blend_area, dest_stride, dest_cf, - src_buf, &src_area, src_stride, src_cf, dsc); -#else - vglite_set_transformation_matrix(&blend_area, dsc); - bool is_tiled = dsc->tile; - if(is_tiled) - _vglite_draw_pattern(&clip_area, &relative_coords, dsc); - else - _vglite_blit(&src_area, dsc); -#endif /*LV_USE_VGLITE_BLIT_SPLIT*/ -} - -/********************** - * STATIC FUNCTIONS - **********************/ -static void _vglite_blit(const lv_area_t * src_area, const lv_draw_image_dsc_t * dsc) -{ - vg_lite_buffer_t * dst_vgbuf = vglite_get_dest_buf(); - vg_lite_buffer_t * src_vgbuf = vglite_get_src_buf(); - - vg_lite_rectangle_t rect = { - .x = (vg_lite_int32_t)src_area->x1, - .y = (vg_lite_int32_t)src_area->y1, - .width = (vg_lite_int32_t)lv_area_get_width(src_area), - .height = (vg_lite_int32_t)lv_area_get_height(src_area) - }; - - src_vgbuf->image_mode = VG_LITE_MULTIPLY_IMAGE_MODE; - src_vgbuf->transparency_mode = VG_LITE_IMAGE_TRANSPARENT; - - vg_lite_color_t vgcol = _vglite_recolor(dsc); - - vg_lite_matrix_t * vgmatrix = vglite_get_matrix(); - vg_lite_blend_t vgblend = vglite_get_blend_mode(dsc->blend_mode); - - VGLITE_CHECK_ERROR(vg_lite_blit_rect(dst_vgbuf, src_vgbuf, &rect, vgmatrix, vgblend, vgcol, VG_LITE_FILTER_POINT)); - - vglite_run(); -} - -#if LV_USE_VGLITE_BLIT_SPLIT -static void _move_buf_close_to_area(void ** buf, lv_area_t * area, uint32_t stride, lv_color_format_t cf) -{ - uint8_t ** buf_u8 = (uint8_t **)buf; - uint8_t align_bytes = vglite_get_stride_alignment(cf); - uint8_t bits_per_pixel = lv_color_format_get_bpp(cf); - - uint16_t align_pixels = align_bytes * 8 / bits_per_pixel; - - if(area->x1 >= (int32_t)(area->x1 % align_pixels)) { - uint16_t shift_x = area->x1 - (area->x1 % align_pixels); - - area->x1 -= shift_x; - area->x2 -= shift_x; - *buf_u8 += (shift_x * bits_per_pixel) / 8; - } - - if(area->y1) { - uint16_t shift_y = area->y1; - - area->y1 -= shift_y; - area->y2 -= shift_y; - *buf_u8 += shift_y * stride; - } -} - -static void _vglite_blit_split(void * dest_buf, lv_area_t * dest_area, uint32_t dest_stride, lv_color_format_t dest_cf, - const void * src_buf, lv_area_t * src_area, uint32_t src_stride, lv_color_format_t src_cf, - const lv_draw_image_dsc_t * dsc) -{ - VGLITE_TRACE("Blit " - "Area: ([%d,%d], [%d,%d]) -> ([%d,%d], [%d,%d]) | " - "Size: ([%dx%d] -> [%dx%d]) | " - "Addr: (0x%x -> 0x%x)", - src_area->x1, src_area->y1, src_area->x2, src_area->y2, - dest_area->x1, dest_area->y1, dest_area->x2, dest_area->y2, - lv_area_get_width(src_area), lv_area_get_height(src_area), - lv_area_get_width(dest_area), lv_area_get_height(dest_area), - (uintptr_t)src_buf, (uintptr_t)dest_buf); - - /* Move starting pointers as close as possible to [x1, y1], so coordinates are as small as possible */ - _move_buf_close_to_area((void **)&src_buf, src_area, src_stride, src_cf); - _move_buf_close_to_area(&dest_buf, dest_area, dest_stride, dest_cf); - - /* Set clip area */ - vglite_set_scissor(dest_area); - - /* If we're in limit, do a single BLIT */ - if((src_area->x2 < VGLITE_BLIT_SPLIT_THR) && - (src_area->y2 < VGLITE_BLIT_SPLIT_THR)) { - - /* Set new dest_vgbuf and src_vgbuf memory addresses */ - vglite_set_dest_buf_ptr(dest_buf); - vglite_set_src_buf_ptr(src_buf); - - vglite_set_transformation_matrix(dest_area, dsc); - _vglite_blit(src_area, dsc); - - VGLITE_TRACE("Single " - "Area: ([%d,%d], [%d,%d]) -> ([%d,%d], [%d,%d]) | " - "Size: ([%dx%d] -> [%dx%d]) | " - "Addr: (0x%x -> 0x%x)", - src_area->x1, src_area->y1, src_area->x2, src_area->y2, - dest_area->x1, dest_area->y1, dest_area->x2, dest_area->y2, - lv_area_get_width(src_area), lv_area_get_height(src_area), - lv_area_get_width(dest_area), lv_area_get_height(dest_area), - (uintptr_t)src_buf, (uintptr_t)dest_buf); - - return; - }; - - /* Split the BLIT into multiple tiles */ - VGLITE_TRACE("Split " - "Area: ([%d,%d], [%d,%d]) -> ([%d,%d], [%d,%d]) | " - "Size: ([%dx%d] -> [%dx%d]) | " - "Addr: (0x%x -> 0x%x)", - src_area->x1, src_area->y1, src_area->x2, src_area->y2, - dest_area->x1, dest_area->y1, dest_area->x2, dest_area->y2, - lv_area_get_width(src_area), lv_area_get_height(src_area), - lv_area_get_width(dest_area), lv_area_get_height(dest_area), - (uintptr_t)src_buf, (uintptr_t)dest_buf); - - int32_t width = LV_MIN(lv_area_get_width(src_area), lv_area_get_width(dest_area)); - int32_t height = LV_MIN(lv_area_get_height(src_area), lv_area_get_height(dest_area)); - - /* Number of tiles needed */ - uint8_t total_tiles_x = (src_area->x1 + width + VGLITE_BLIT_SPLIT_THR - 1) / - VGLITE_BLIT_SPLIT_THR; - uint8_t total_tiles_y = (src_area->y1 + height + VGLITE_BLIT_SPLIT_THR - 1) / - VGLITE_BLIT_SPLIT_THR; - - uint16_t shift_src_x = src_area->x1; - uint16_t shift_dest_x = dest_area->x1; - - VGLITE_TRACE("X shift: src: %d, dst: %d", shift_src_x, shift_dest_x); - - uint8_t * tile_dest_buf; - lv_area_t tile_dest_area; - const uint8_t * tile_src_buf; - lv_area_t tile_src_area; - - for(uint8_t y = 0; y < total_tiles_y; y++) { - /* y1 always start from 0 */ - tile_src_area.y1 = 0; - - /* Calculate y2 coordinates */ - if(y < total_tiles_y - 1) - tile_src_area.y2 = VGLITE_BLIT_SPLIT_THR - 1; - else - tile_src_area.y2 = height - y * VGLITE_BLIT_SPLIT_THR - 1; - - /* No vertical shift, dest y is always in sync with src y */ - tile_dest_area.y1 = tile_src_area.y1; - tile_dest_area.y2 = tile_src_area.y2; - - /* Advance start pointer for every tile, except the first column (y = 0) */ - tile_src_buf = (uint8_t *)src_buf + y * VGLITE_BLIT_SPLIT_THR * src_stride; - tile_dest_buf = (uint8_t *)dest_buf + y * VGLITE_BLIT_SPLIT_THR * dest_stride; - - for(uint8_t x = 0; x < total_tiles_x; x++) { - /* x1 always start from the same shift */ - tile_src_area.x1 = shift_src_x; - tile_dest_area.x1 = shift_dest_x; - if(x > 0) { - /* Advance start pointer for every tile, except the first raw (x = 0) */ - tile_src_buf += VGLITE_BLIT_SPLIT_THR * lv_color_format_get_bpp(src_cf) / 8; - tile_dest_buf += VGLITE_BLIT_SPLIT_THR * lv_color_format_get_bpp(dest_cf) / 8; - } - - /* Calculate x2 coordinates */ - if(x < total_tiles_x - 1) - tile_src_area.x2 = VGLITE_BLIT_SPLIT_THR - 1; - else - tile_src_area.x2 = width - x * VGLITE_BLIT_SPLIT_THR - 1; - - tile_dest_area.x2 = tile_src_area.x2; - - /* Shift x2 coordinates */ - tile_src_area.x2 += shift_src_x; - tile_dest_area.x2 += shift_dest_x; - - /* Set new dest_vgbuf and src_vgbuf memory addresses */ - vglite_set_dest_buf_ptr(tile_dest_buf); - vglite_set_src_buf_ptr(tile_src_buf); - - vglite_set_transformation_matrix(&tile_dest_area, dsc); - _vglite_blit(&tile_src_area, dsc); - - VGLITE_TRACE("Tile [%d, %d] " - "Area: ([%d,%d], [%d,%d]) -> ([%d,%d], [%d,%d]) | " - "Size: ([%dx%d] -> [%dx%d]) | " - "Addr: (0x%x -> 0x%x)", - x, y, - tile_src_area.x1, tile_src_area.y1, tile_src_area.x2, tile_src_area.y2, - tile_dest_area.x1, tile_dest_area.y1, tile_dest_area.x2, tile_dest_area.y2, - lv_area_get_width(&tile_src_area), lv_area_get_height(&tile_src_area), - lv_area_get_width(&tile_dest_area), lv_area_get_height(&tile_dest_area), - (uintptr_t)tile_src_buf, (uintptr_t)tile_dest_buf); - } - } -} -#endif /*LV_USE_VGLITE_BLIT_SPLIT*/ - -static void _vglite_draw_pattern(const lv_area_t * clip_area, const lv_area_t * coords, - const lv_draw_image_dsc_t * dsc) -{ - /* Target buffer */ - vg_lite_buffer_t * dst_vgbuf = vglite_get_dest_buf(); - - /* Path to draw */ - int32_t path_data[RECT_PATH_DATA_MAX_SIZE]; - uint32_t path_data_size; - vglite_create_rect_path_data(path_data, &path_data_size, dsc->clip_radius, coords); - vg_lite_quality_t path_quality = VG_LITE_MEDIUM; - - vg_lite_path_t path; - VGLITE_CHECK_ERROR(vg_lite_init_path(&path, VG_LITE_S32, path_quality, path_data_size, path_data, - (vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1, - ((vg_lite_float_t)clip_area->x2) + 1.0f, ((vg_lite_float_t)clip_area->y2) + 1.0f)); - - /* Path Matrix */ - vg_lite_matrix_t path_matrix; - vg_lite_identity(&path_matrix); - - /* Pattern Image */ - vg_lite_buffer_t * src_vgbuf = vglite_get_src_buf(); - src_vgbuf->image_mode = VG_LITE_MULTIPLY_IMAGE_MODE; - src_vgbuf->transparency_mode = VG_LITE_IMAGE_TRANSPARENT; - - /* Pattern matrix */ - vg_lite_matrix_t vgmatrix; - vg_lite_identity(&vgmatrix); - vg_lite_translate((vg_lite_float_t)dsc->image_area.x1, (vg_lite_float_t)dsc->image_area.y1, &vgmatrix); - - /* Blend mode */ - vg_lite_blend_t vgblend = vglite_get_blend_mode(dsc->blend_mode); - - vg_lite_color_t vgcol = _vglite_recolor(dsc); - - /* Filter */ - bool has_transform = (dsc->rotation != 0 || dsc->scale_x != LV_SCALE_NONE || dsc->scale_y != LV_SCALE_NONE); - vg_lite_filter_t filter = has_transform ? VG_LITE_FILTER_BI_LINEAR : VG_LITE_FILTER_POINT; - - /* Draw Pattern */ - VGLITE_CHECK_ERROR(vg_lite_draw_pattern(dst_vgbuf, &path, VG_LITE_FILL_NON_ZERO, &path_matrix, - src_vgbuf, &vgmatrix, vgblend, VG_LITE_PATTERN_REPEAT, - 0, vgcol, filter)); -} - -static vg_lite_color_t _vglite_recolor(const lv_draw_image_dsc_t * dsc) -{ - lv_color_t color; - lv_opa_t opa; - - bool has_recolor = (dsc->recolor_opa > LV_OPA_MIN); - if(has_recolor) { - color = dsc->recolor; - opa = LV_OPA_MIX2(dsc->recolor_opa, dsc->opa); - } - else { - color.red = 0xFF; - color.green = 0xFF; - color.blue = 0xFF; - opa = dsc->opa; - } - - lv_color32_t col32 = lv_color_to_32(color, opa); - - return vglite_get_color(col32, false); -} - -#endif /*LV_USE_DRAW_VGLITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_label.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_label.c deleted file mode 100644 index 9af7c68..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_label.c +++ /dev/null @@ -1,180 +0,0 @@ -/** - * @file lv_draw_vglite_label.c - * - */ - -/** - * Copyright 2023-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_vglite.h" - -#if LV_USE_DRAW_VGLITE -#include "lv_vglite_buf.h" -#include "lv_vglite_matrix.h" -#include "lv_vglite_utils.h" - -#include "../../lv_draw_label_private.h" -#include "../../../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void _draw_vglite_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * glyph_draw_dsc, - lv_draw_fill_dsc_t * fill_draw_dsc, const lv_area_t * fill_area); - -/** - * Draw letter (character bitmap blend) with optional color and opacity - * - * @param[in] mask_area Mask area with relative coordinates of source buffer - * @param[in] color Color - * @param[in] opa Opacity - * - */ -static void _vglite_draw_letter(const lv_area_t * mask_area, lv_color_t color, lv_opa_t opa); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vglite_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc, - const lv_area_t * coords) -{ - if(dsc->opa <= LV_OPA_MIN) return; - - lv_draw_label_iterate_characters(draw_unit, dsc, coords, _draw_vglite_letter); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void _draw_vglite_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * glyph_draw_dsc, - lv_draw_fill_dsc_t * fill_draw_dsc, const lv_area_t * fill_area) -{ - if(glyph_draw_dsc) { - switch(glyph_draw_dsc->format) { - - case LV_FONT_GLYPH_FORMAT_NONE: { -#if LV_USE_FONT_PLACEHOLDER - /* Draw a placeholder rectangle*/ - lv_draw_border_dsc_t border_draw_dsc; - lv_draw_border_dsc_init(&border_draw_dsc); - border_draw_dsc.opa = glyph_draw_dsc->opa; - border_draw_dsc.color = glyph_draw_dsc->color; - border_draw_dsc.width = 1; - lv_draw_vglite_border(draw_unit, &border_draw_dsc, glyph_draw_dsc->bg_coords); -#endif - } - break; - case LV_FONT_GLYPH_FORMAT_A1 ... LV_FONT_GLYPH_FORMAT_A8: { - /*Do not draw transparent things*/ - if(glyph_draw_dsc->opa <= LV_OPA_MIN) - return; - - lv_layer_t * layer = draw_unit->target_layer; - - lv_area_t blend_area; - if(!lv_area_intersect(&blend_area, glyph_draw_dsc->letter_coords, draw_unit->clip_area)) - return; - lv_area_move(&blend_area, -layer->buf_area.x1, -layer->buf_area.y1); - - const lv_draw_buf_t * draw_buf = glyph_draw_dsc->glyph_data; - const void * mask_buf = draw_buf->data; - - uint32_t mask_width = lv_area_get_width(glyph_draw_dsc->letter_coords); - uint32_t mask_height = lv_area_get_height(glyph_draw_dsc->letter_coords); - uint32_t mask_stride = draw_buf->header.stride; - - lv_area_t mask_area; - mask_area.x1 = blend_area.x1 - (glyph_draw_dsc->letter_coords->x1 - layer->buf_area.x1); - mask_area.y1 = blend_area.y1 - (glyph_draw_dsc->letter_coords->y1 - layer->buf_area.y1); - mask_area.x2 = mask_width - 1; - mask_area.y2 = mask_height - 1; - - /* Set src_vgbuf structure. */ - vglite_set_src_buf(mask_buf, mask_width, mask_height, mask_stride, LV_COLOR_FORMAT_A8); - - /* Set vgmatrix. */ - vglite_set_translation_matrix(&blend_area); - - lv_draw_buf_invalidate_cache(draw_buf, &mask_area); - - _vglite_draw_letter(&mask_area, glyph_draw_dsc->color, glyph_draw_dsc->opa); - } - break; - case LV_FONT_GLYPH_FORMAT_IMAGE: { -#if LV_USE_IMGFONT - lv_draw_image_dsc_t img_dsc; - lv_draw_image_dsc_init(&img_dsc); - img_dsc.opa = glyph_draw_dsc->opa; - img_dsc.src = glyph_draw_dsc->glyph_data; - lv_draw_vglite_img(draw_unit, &img_dsc, glyph_draw_dsc->letter_coords); -#endif - } - break; - default: - break; - } - } - - if(fill_draw_dsc && fill_area) { - lv_draw_vglite_fill(draw_unit, fill_draw_dsc, fill_area); - } -} - -static void _vglite_draw_letter(const lv_area_t * mask_area, lv_color_t color, lv_opa_t opa) -{ - vg_lite_buffer_t * dst_vgbuf = vglite_get_dest_buf(); - vg_lite_buffer_t * mask_vgbuf = vglite_get_src_buf(); - - mask_vgbuf->image_mode = VG_LITE_MULTIPLY_IMAGE_MODE; - mask_vgbuf->transparency_mode = VG_LITE_IMAGE_TRANSPARENT; - - vg_lite_rectangle_t rect = { - .x = (vg_lite_int32_t)mask_area->x1, - .y = (vg_lite_int32_t)mask_area->y1, - .width = (vg_lite_int32_t)lv_area_get_width(mask_area), - .height = (vg_lite_int32_t)lv_area_get_height(mask_area) - }; - - lv_color32_t col32 = lv_color_to_32(color, opa); - vg_lite_color_t vgcol = vglite_get_color(col32, false); - - vg_lite_matrix_t * vgmatrix = vglite_get_matrix(); - - /*Blit with font color as paint color*/ - VGLITE_CHECK_ERROR(vg_lite_blit_rect(dst_vgbuf, mask_vgbuf, &rect, vgmatrix, VG_LITE_BLEND_SRC_OVER, vgcol, - VG_LITE_FILTER_POINT)); - - vglite_run(); -} - -#endif /*LV_USE_DRAW_VGLITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_layer.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_layer.c deleted file mode 100644 index ce3f59e..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_layer.c +++ /dev/null @@ -1,157 +0,0 @@ -/** - * @file lv_draw_vglite_layer.c - * - */ - -/** - * Copyright 2023-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_vglite.h" - -#if LV_USE_DRAW_VGLITE - -#include "../../../stdlib/lv_string.h" -#include "../../../core/lv_global.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -#define _draw_info LV_GLOBAL_DEFAULT()->draw_info - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vglite_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords) -{ - lv_layer_t * layer_to_draw = (lv_layer_t *)draw_dsc->src; - const lv_draw_buf_t * draw_buf = layer_to_draw->draw_buf; - - /* It can happen that nothing was draw on a layer and therefore its buffer is not allocated. - * In this case just return. - */ - if(draw_buf == NULL) - return; - - if(_draw_info.unit_cnt > 1) { - const lv_area_t area_to_draw = { - .x1 = 0, - .y1 = 0, - .x2 = draw_buf->header.w - 1, - .y2 = draw_buf->header.h - 1 - }; - lv_draw_buf_invalidate_cache(draw_buf, &area_to_draw); - } - - lv_draw_image_dsc_t new_draw_dsc = *draw_dsc; - new_draw_dsc.src = draw_buf; - lv_draw_vglite_img(draw_unit, &new_draw_dsc, coords); - -#if LV_USE_LAYER_DEBUG || LV_USE_PARALLEL_DRAW_DEBUG - lv_area_t area_rot; - lv_area_copy(&area_rot, coords); - bool has_transform = (draw_dsc->rotation != 0 || draw_dsc->scale_x != LV_SCALE_NONE || - draw_dsc->scale_y != LV_SCALE_NONE); - - if(has_transform) { - int32_t w = lv_area_get_width(coords); - int32_t h = lv_area_get_height(coords); - - lv_image_buf_get_transformed_area(&area_rot, w, h, draw_dsc->rotation, draw_dsc->scale_x, draw_dsc->scale_y, - &draw_dsc->pivot); - - area_rot.x1 += coords->x1; - area_rot.y1 += coords->y1; - area_rot.x2 += coords->x1; - area_rot.y2 += coords->y1; - } - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, &area_rot, draw_unit->clip_area)) return; -#endif - -#if LV_USE_LAYER_DEBUG - lv_draw_fill_dsc_t fill_dsc; - lv_draw_fill_dsc_init(&fill_dsc); - fill_dsc.color = lv_color_hex(layer_to_draw->color_format == LV_COLOR_FORMAT_ARGB8888 ? 0xff0000 : 0x00ff00); - fill_dsc.opa = LV_OPA_20; - lv_draw_sw_fill(draw_unit, &fill_dsc, &area_rot); - - lv_draw_border_dsc_t border_dsc; - lv_draw_border_dsc_init(&border_dsc); - border_dsc.color = fill_dsc.color; - border_dsc.opa = LV_OPA_60; - border_dsc.width = 2; - lv_draw_sw_border(draw_unit, &border_dsc, &area_rot); - -#endif - -#if LV_USE_PARALLEL_DRAW_DEBUG - uint32_t idx = 0; - lv_draw_unit_t * draw_unit_tmp = _draw_info.unit_head; - while(draw_unit_tmp != draw_unit) { - draw_unit_tmp = draw_unit_tmp->next; - idx++; - } - - lv_draw_fill_dsc_t fill_dsc; - lv_draw_rect_dsc_init(&fill_dsc); - fill_dsc.color = lv_palette_main(idx % LV_PALETTE_LAST); - fill_dsc.opa = LV_OPA_10; - lv_draw_sw_fill(draw_unit, &fill_dsc, &area_rot); - - lv_draw_border_dsc_t border_dsc; - lv_draw_border_dsc_init(&border_dsc); - border_dsc.color = lv_palette_main(idx % LV_PALETTE_LAST); - border_dsc.opa = LV_OPA_100; - border_dsc.width = 2; - lv_draw_sw_border(draw_unit, &border_dsc, &area_rot); - - lv_point_t txt_size; - lv_text_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE); - - lv_area_t txt_area; - txt_area.x1 = draw_area.x1; - txt_area.x2 = draw_area.x1 + txt_size.x - 1; - txt_area.y2 = draw_area.y2; - txt_area.y1 = draw_area.y2 - txt_size.y + 1; - - lv_draw_fill_dsc_init(&fill_dsc); - fill_dsc.color = lv_color_black(); - lv_draw_sw_fill(draw_unit, &fill_dsc, &txt_area); - - char buf[8]; - lv_snprintf(buf, sizeof(buf), "%d", idx); - lv_draw_label_dsc_t label_dsc; - lv_draw_label_dsc_init(&label_dsc); - label_dsc.color = lv_color_white(); - label_dsc.text = buf; - lv_draw_sw_label(draw_unit, &label_dsc, &txt_area); -#endif -} - -#endif /*LV_USE_DRAW_VGLITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_line.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_line.c index f70c02b..bf7bee1 100644 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_line.c +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_line.c @@ -4,20 +4,38 @@ */ /** - * Copyright 2022-2024 NXP + * MIT License + * + * Copyright 2022, 2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * SPDX-License-Identifier: MIT */ /********************* * INCLUDES *********************/ -#include "lv_draw_vglite.h" +#include "lv_draw_vglite_line.h" -#if LV_USE_DRAW_VGLITE +#if LV_USE_GPU_NXP_VG_LITE #include "lv_vglite_buf.h" -#include "lv_vglite_utils.h" +#include /********************* * DEFINES @@ -31,18 +49,6 @@ * STATIC PROTOTYPES **********************/ -/** - * Draw line shape with effects - * - * @param[in] point1 Starting point with relative coordinates - * @param[in] point2 Ending point with relative coordinates - * @param[in] clip_area Clip area with relative coordinates to dest buff - * @param[in] dsc Line description structure (width, rounded ending, opacity, ...) - * - */ -static void _vglite_draw_line(const lv_point_t * point1, const lv_point_t * point2, - const lv_area_t * clip_area, const lv_draw_line_dsc_t * dsc); - /********************** * STATIC VARIABLES **********************/ @@ -55,42 +61,13 @@ static void _vglite_draw_line(const lv_point_t * point1, const lv_point_t * poin * GLOBAL FUNCTIONS **********************/ -void lv_draw_vglite_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc) -{ - if(dsc->width == 0) - return; - if(dsc->opa <= (lv_opa_t)LV_OPA_MIN) - return; - if(dsc->p1.x == dsc->p2.x && dsc->p1.y == dsc->p2.y) - return; - - lv_layer_t * layer = draw_unit->target_layer; - lv_area_t clip_area; - clip_area.x1 = LV_MIN(dsc->p1.x, dsc->p2.x) - dsc->width / 2; - clip_area.x2 = LV_MAX(dsc->p1.x, dsc->p2.x) + dsc->width / 2; - clip_area.y1 = LV_MIN(dsc->p1.y, dsc->p2.y) - dsc->width / 2; - clip_area.y2 = LV_MAX(dsc->p1.y, dsc->p2.y) + dsc->width / 2; - - if(!lv_area_intersect(&clip_area, &clip_area, draw_unit->clip_area)) - return; /*Fully clipped, nothing to do*/ - - lv_area_move(&clip_area, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_point_t point1 = {dsc->p1.x - layer->buf_area.x1, dsc->p1.y - layer->buf_area.y1}; - lv_point_t point2 = {dsc->p2.x - layer->buf_area.x1, dsc->p2.y - layer->buf_area.y1}; - - _vglite_draw_line(&point1, &point2, &clip_area, dsc); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void _vglite_draw_line(const lv_point_t * point1, const lv_point_t * point2, - const lv_area_t * clip_area, const lv_draw_line_dsc_t * dsc) +lv_res_t lv_gpu_nxp_vglite_draw_line(const lv_point_t * point1, const lv_point_t * point2, + const lv_area_t * clip_area, const lv_draw_line_dsc_t * dsc) { + vg_lite_error_t err = VG_LITE_SUCCESS; vg_lite_path_t path; - vg_lite_buffer_t * vgbuf = vglite_get_dest_buf(); + vg_lite_color_t vgcol; /* vglite takes ABGR */ + vg_lite_buffer_t * vgbuf = lv_vglite_get_dest_buf(); vg_lite_cap_style_t cap_style = (dsc->round_start || dsc->round_end) ? VG_LITE_CAP_ROUND : VG_LITE_CAP_BUTT; vg_lite_join_style_t join_style = (dsc->round_start || dsc->round_end) ? VG_LITE_JOIN_ROUND : VG_LITE_JOIN_MITER; @@ -106,10 +83,11 @@ static void _vglite_draw_line(const lv_point_t * point1, const lv_point_t * poin stroke_dash_phase = (vg_lite_float_t)dsc->dash_width / 2; } - vg_lite_blend_t vgblend = vglite_get_blend_mode(dsc->blend_mode); + /* Choose vglite blend mode based on given lvgl blend mode */ + vg_lite_blend_t vglite_blend_mode = lv_vglite_get_blend_mode(dsc->blend_mode); /*** Init path ***/ - int32_t width = dsc->width; + lv_coord_t width = dsc->width; int32_t line_path[] = { /*VG line path*/ VLC_OP_MOVE, point1->x, point1->y, @@ -117,29 +95,48 @@ static void _vglite_draw_line(const lv_point_t * point1, const lv_point_t * poin VLC_OP_END }; - VGLITE_CHECK_ERROR(vg_lite_init_path(&path, VG_LITE_S32, VG_LITE_HIGH, sizeof(line_path), line_path, - (vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1, - ((vg_lite_float_t)clip_area->x2) + 1.0f, ((vg_lite_float_t)clip_area->y2) + 1.0f)); - - lv_color32_t col32 = lv_color_to_32(dsc->color, dsc->opa); - vg_lite_color_t vgcol = vglite_get_color(col32, false); + err = vg_lite_init_path(&path, VG_LITE_S32, VG_LITE_HIGH, sizeof(line_path), line_path, + (vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1, + ((vg_lite_float_t)clip_area->x2) + 1.0f, ((vg_lite_float_t)clip_area->y2) + 1.0f); + VG_LITE_ERR_RETURN_INV(err, "Init path failed."); vg_lite_matrix_t matrix; vg_lite_identity(&matrix); + lv_color32_t col32 = { .full = lv_color_to32(dsc->color) }; /*Convert color to RGBA8888*/ + vg_lite_buffer_format_t color_format = LV_COLOR_DEPTH == 16 ? VG_LITE_BGRA8888 : VG_LITE_ABGR8888; + if(lv_vglite_premult_and_swizzle(&vgcol, col32, dsc->opa, color_format) != LV_RES_OK) + VG_LITE_RETURN_INV("Premultiplication and swizzle failed."); + /*** Draw line ***/ - VGLITE_CHECK_ERROR(vg_lite_set_draw_path_type(&path, VG_LITE_DRAW_STROKE_PATH)); + err = vg_lite_set_draw_path_type(&path, VG_LITE_DRAW_STROKE_PATH); + VG_LITE_ERR_RETURN_INV(err, "Set draw path type failed."); - VGLITE_CHECK_ERROR(vg_lite_set_stroke(&path, cap_style, join_style, width, 8, stroke_dash_pattern, stroke_dash_count, - stroke_dash_phase, vgcol)); + err = vg_lite_set_stroke(&path, cap_style, join_style, width, 8, stroke_dash_pattern, stroke_dash_count, + stroke_dash_phase, vgcol); + VG_LITE_ERR_RETURN_INV(err, "Set stroke failed."); - VGLITE_CHECK_ERROR(vg_lite_update_stroke(&path)); + err = vg_lite_update_stroke(&path); + VG_LITE_ERR_RETURN_INV(err, "Update stroke failed."); - VGLITE_CHECK_ERROR(vg_lite_draw(vgbuf, &path, VG_LITE_FILL_NON_ZERO, &matrix, vgblend, vgcol)); + lv_vglite_set_scissor(clip_area); - vglite_run(); + err = vg_lite_draw(vgbuf, &path, VG_LITE_FILL_NON_ZERO, &matrix, vglite_blend_mode, vgcol); + VG_LITE_ERR_RETURN_INV(err, "Draw line failed."); - VGLITE_CHECK_ERROR(vg_lite_clear_path(&path)); + if(lv_vglite_run() != LV_RES_OK) + VG_LITE_RETURN_INV("Run failed."); + + lv_vglite_disable_scissor(); + + err = vg_lite_clear_path(&path); + VG_LITE_ERR_RETURN_INV(err, "Clear path failed."); + + return LV_RES_OK; } -#endif /*LV_USE_DRAW_VGLITE*/ +/********************** + * STATIC FUNCTIONS + **********************/ + +#endif /*LV_USE_GPU_NXP_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_line.h b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_line.h new file mode 100644 index 0000000..cbd4b95 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_line.h @@ -0,0 +1,83 @@ +/** + * @file lv_draw_vglite_line.h + * + */ + +/** + * MIT License + * + * Copyright 2022, 2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef LV_DRAW_VGLITE_LINE_H +#define LV_DRAW_VGLITE_LINE_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lv_conf_internal.h" + +#if LV_USE_GPU_NXP_VG_LITE +#include "lv_vglite_utils.h" +#include "../../lv_draw_line.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Draw line shape with effects + * + * @param[in] point1 Starting point with relative coordinates + * @param[in] point2 Ending point with relative coordinates + * @param[in] clip_area Clipping area with relative coordinates to dest buff + * @param[in] dsc Line description structure (width, rounded ending, opacity, ...) + * + * @retval LV_RES_OK Draw completed + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + */ +lv_res_t lv_gpu_nxp_vglite_draw_line(const lv_point_t * point1, const lv_point_t * point2, + const lv_area_t * clip_area, const lv_draw_line_dsc_t * dsc); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_NXP_VG_LITE*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_VGLITE_RECT_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_rect.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_rect.c new file mode 100644 index 0000000..e9db57d --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_rect.c @@ -0,0 +1,459 @@ +/** + * @file lv_draw_vglite_rect.c + * + */ + +/** + * MIT License + * + * Copyright 2021-2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "lv_draw_vglite_rect.h" + +#if LV_USE_GPU_NXP_VG_LITE +#include "lv_vglite_buf.h" +#include + +/********************* + * DEFINES + *********************/ +/********************* + * DEFINES + *********************/ + +/* Path data sizes for different elements */ +#define CUBIC_PATH_DATA_SIZE 7 /* 1 opcode, 6 arguments */ +#define LINE_PATH_DATA_SIZE 3 /* 1 opcode, 2 arguments */ +#define MOVE_PATH_DATA_SIZE 3 /* 1 opcode, 2 arguments */ +#define END_PATH_DATA_SIZE 1 /* 1 opcode, 0 arguments */ +/* Maximum possible rectangle path size + * is in the rounded rectangle case: + * - 1 move for the path start + * - 4 cubics for the corners + * - 4 lines for the sides + * - 1 end for the path end */ +#define RECT_PATH_DATA_MAX_SIZE 1 * MOVE_PATH_DATA_SIZE + 4 * CUBIC_PATH_DATA_SIZE + 4 * LINE_PATH_DATA_SIZE + 1 * END_PATH_DATA_SIZE + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/** + * Generates path data for rectangle drawing. + * + * @param[in/out] path The path data to initialize + * @param[in/out] path_size The resulting size of the created path data + * @param[in] dsc The style descriptor for the rectangle to be drawn + * @param[in] coords The coordinates of the rectangle to be drawn + */ +static void lv_vglite_create_rect_path_data(int32_t * path_data, uint32_t * path_data_size, + lv_coord_t radius, + const lv_area_t * coords); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_res_t lv_gpu_nxp_vglite_draw_bg(const lv_area_t * coords, const lv_area_t * clip_area, + const lv_draw_rect_dsc_t * dsc) +{ + vg_lite_error_t err = VG_LITE_SUCCESS; + lv_coord_t width = lv_area_get_width(coords); + lv_coord_t height = lv_area_get_height(coords); + vg_lite_color_t vgcol; + lv_coord_t radius = dsc->radius; + vg_lite_buffer_t * vgbuf = lv_vglite_get_dest_buf(); + + if(dsc->radius < 0) + return LV_RES_INV; + + /*** Init path ***/ + int32_t path_data[RECT_PATH_DATA_MAX_SIZE]; + uint32_t path_data_size; + lv_vglite_create_rect_path_data(path_data, &path_data_size, radius, coords); + vg_lite_quality_t path_quality = dsc->radius > 0 ? VG_LITE_HIGH : VG_LITE_LOW; + + vg_lite_path_t path; + err = vg_lite_init_path(&path, VG_LITE_S32, path_quality, path_data_size, path_data, + (vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1, + ((vg_lite_float_t)clip_area->x2) + 1.0f, ((vg_lite_float_t)clip_area->y2) + 1.0f); + VG_LITE_ERR_RETURN_INV(err, "Init path failed."); + + vg_lite_matrix_t matrix; + vg_lite_identity(&matrix); + + vg_lite_matrix_t * grad_matrix; + vg_lite_linear_gradient_t gradient; + + /*** Init Color/Gradient ***/ + if(dsc->bg_grad.dir != (lv_grad_dir_t)LV_GRAD_DIR_NONE) { + uint32_t colors[2]; + uint32_t stops[2]; + lv_color32_t col32[2]; + + /* Gradient setup */ + uint8_t cnt = LV_MAX(dsc->bg_grad.stops_count, 2); + for(uint8_t i = 0; i < cnt; i++) { + col32[i].full = lv_color_to32(dsc->bg_grad.stops[i].color); /*Convert color to RGBA8888*/ + stops[i] = dsc->bg_grad.stops[i].frac; + + vg_lite_buffer_format_t color_format = LV_COLOR_DEPTH == 16 ? VG_LITE_ABGR8888 : VG_LITE_ARGB8888; + if(lv_vglite_premult_and_swizzle(&colors[i], col32[i], dsc->bg_opa, color_format) != LV_RES_OK) + VG_LITE_RETURN_INV("Premultiplication and swizzle failed."); + } + + lv_memset_00(&gradient, sizeof(vg_lite_linear_gradient_t)); + + err = vg_lite_init_grad(&gradient); + VG_LITE_ERR_RETURN_INV(err, "Init gradient failed"); + + err = vg_lite_set_grad(&gradient, cnt, colors, stops); + VG_LITE_ERR_RETURN_INV(err, "Set gradient failed."); + + err = vg_lite_update_grad(&gradient); + VG_LITE_ERR_RETURN_INV(err, "Update gradient failed."); + + grad_matrix = vg_lite_get_grad_matrix(&gradient); + vg_lite_identity(grad_matrix); + vg_lite_translate((float)coords->x1, (float)coords->y1, grad_matrix); + + if(dsc->bg_grad.dir == (lv_grad_dir_t)LV_GRAD_DIR_VER) { + vg_lite_scale(1.0f, (float)height / 256.0f, grad_matrix); + vg_lite_rotate(90.0f, grad_matrix); + } + else { /*LV_GRAD_DIR_HOR*/ + vg_lite_scale((float)width / 256.0f, 1.0f, grad_matrix); + } + } + + lv_color32_t bg_col32 = {.full = lv_color_to32(dsc->bg_color)}; /*Convert color to RGBA8888*/ + vg_lite_buffer_format_t color_format = LV_COLOR_DEPTH == 16 ? VG_LITE_BGRA8888 : VG_LITE_ABGR8888; + if(lv_vglite_premult_and_swizzle(&vgcol, bg_col32, dsc->bg_opa, color_format) != LV_RES_OK) + VG_LITE_RETURN_INV("Premultiplication and swizzle failed."); + + lv_vglite_set_scissor(clip_area); + + /*** Draw rectangle ***/ + if(dsc->bg_grad.dir == (lv_grad_dir_t)LV_GRAD_DIR_NONE) { + err = vg_lite_draw(vgbuf, &path, VG_LITE_FILL_EVEN_ODD, &matrix, VG_LITE_BLEND_SRC_OVER, vgcol); + } + else { + err = vg_lite_draw_gradient(vgbuf, &path, VG_LITE_FILL_EVEN_ODD, &matrix, &gradient, VG_LITE_BLEND_SRC_OVER); + } + VG_LITE_ERR_RETURN_INV(err, "Draw gradient failed."); + + if(lv_vglite_run() != LV_RES_OK) + VG_LITE_RETURN_INV("Run failed."); + + lv_vglite_disable_scissor(); + + err = vg_lite_clear_path(&path); + VG_LITE_ERR_RETURN_INV(err, "Clear path failed."); + + if(dsc->bg_grad.dir != (lv_grad_dir_t)LV_GRAD_DIR_NONE) { + err = vg_lite_clear_grad(&gradient); + VG_LITE_ERR_RETURN_INV(err, "Clear gradient failed."); + } + + return LV_RES_OK; +} + +lv_res_t lv_gpu_nxp_vglite_draw_border_generic(const lv_area_t * coords, const lv_area_t * clip_area, + const lv_draw_rect_dsc_t * dsc, bool border) +{ + vg_lite_error_t err = VG_LITE_SUCCESS; + vg_lite_color_t vgcol; /* vglite takes ABGR */ + lv_coord_t radius = dsc->radius; + vg_lite_buffer_t * vgbuf = lv_vglite_get_dest_buf(); + + if(radius < 0) + return LV_RES_INV; + + if(border) { + /* Draw border - only has radius if object has radius*/ + lv_coord_t border_half = (lv_coord_t)floor(dsc->border_width / 2.0f); + if(radius > border_half) + radius = radius - border_half; + } + else { + /* Draw outline - always has radius, leave the same radius in the circle case */ + lv_coord_t outline_half = (lv_coord_t)ceil(dsc->outline_width / 2.0f); + if(radius < (lv_coord_t)LV_RADIUS_CIRCLE - outline_half) + radius = radius + outline_half; + } + + vg_lite_cap_style_t cap_style = (radius) ? VG_LITE_CAP_ROUND : VG_LITE_CAP_BUTT; + vg_lite_join_style_t join_style = (radius) ? VG_LITE_JOIN_ROUND : VG_LITE_JOIN_MITER; + + /* Choose vglite blend mode based on given lvgl blend mode */ + vg_lite_blend_t vglite_blend_mode = lv_vglite_get_blend_mode(dsc->blend_mode); + + /*** Init path ***/ + int32_t path_data[RECT_PATH_DATA_MAX_SIZE]; + uint32_t path_data_size; + lv_vglite_create_rect_path_data(path_data, &path_data_size, radius, coords); + vg_lite_quality_t path_quality = dsc->radius > 0 ? VG_LITE_HIGH : VG_LITE_LOW; + + vg_lite_path_t path; + err = vg_lite_init_path(&path, VG_LITE_S32, path_quality, path_data_size, path_data, + (vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1, + ((vg_lite_float_t)clip_area->x2) + 1.0f, ((vg_lite_float_t)clip_area->y2) + 1.0f); + VG_LITE_ERR_RETURN_INV(err, "Init path failed."); + + vg_lite_matrix_t matrix; + vg_lite_identity(&matrix); + + lv_opa_t opa; + lv_color32_t col32; + lv_coord_t line_width; + + if(border) { + opa = dsc->border_opa; + col32.full = lv_color_to32(dsc->border_color); /*Convert color to RGBA8888*/ + line_width = dsc->border_width; + } + else { + opa = dsc->outline_opa; + col32.full = lv_color_to32(dsc->outline_color); /*Convert color to RGBA8888*/ + line_width = dsc->outline_width; + } + + vg_lite_buffer_format_t color_format = LV_COLOR_DEPTH == 16 ? VG_LITE_BGRA8888 : VG_LITE_ABGR8888; + if(lv_vglite_premult_and_swizzle(&vgcol, col32, opa, color_format) != LV_RES_OK) + VG_LITE_RETURN_INV("Premultiplication and swizzle failed."); + + /*** Draw border ***/ + err = vg_lite_set_draw_path_type(&path, VG_LITE_DRAW_STROKE_PATH); + VG_LITE_ERR_RETURN_INV(err, "Set draw path type failed."); + + err = vg_lite_set_stroke(&path, cap_style, join_style, line_width, 8, NULL, 0, 0, vgcol); + VG_LITE_ERR_RETURN_INV(err, "Set stroke failed."); + + err = vg_lite_update_stroke(&path); + VG_LITE_ERR_RETURN_INV(err, "Update stroke failed."); + + lv_vglite_set_scissor(clip_area); + + err = vg_lite_draw(vgbuf, &path, VG_LITE_FILL_NON_ZERO, &matrix, vglite_blend_mode, vgcol); + VG_LITE_ERR_RETURN_INV(err, "Draw border failed."); + + if(lv_vglite_run() != LV_RES_OK) + VG_LITE_RETURN_INV("Run failed."); + + lv_vglite_disable_scissor(); + + err = vg_lite_clear_path(&path); + VG_LITE_ERR_RETURN_INV(err, "Clear path failed."); + + return LV_RES_OK; + +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_vglite_create_rect_path_data(int32_t * path_data, uint32_t * path_data_size, + lv_coord_t radius, + const lv_area_t * coords) +{ + lv_coord_t rect_width = lv_area_get_width(coords); + lv_coord_t rect_height = lv_area_get_height(coords); + + /* Get the final radius. Can't be larger than the half of the shortest side */ + int32_t shortest_side = LV_MIN(rect_width, rect_height); + int32_t final_radius = LV_MIN(radius, shortest_side / 2); + + /* Path data element index */ + uint8_t pidx = 0; + + if((radius == (lv_coord_t)LV_RADIUS_CIRCLE) && (rect_width == rect_height)) { + + /* Get the control point offset for rounded cases */ + int32_t cpoff = (int32_t)((float)final_radius * BEZIER_OPTIM_CIRCLE); + + /* Circle case */ + /* Starting point */ + path_data[pidx++] = VLC_OP_MOVE; + path_data[pidx++] = coords->x1 + final_radius; + path_data[pidx++] = coords->y1; + + /* Top-right arc */ + path_data[pidx++] = VLC_OP_CUBIC_REL; + path_data[pidx++] = cpoff; + path_data[pidx++] = 0; + path_data[pidx++] = final_radius; + path_data[pidx++] = final_radius - cpoff; + path_data[pidx++] = final_radius; + path_data[pidx++] = final_radius; + + /* Bottom-right arc*/ + path_data[pidx++] = VLC_OP_CUBIC_REL; + path_data[pidx++] = 0; + path_data[pidx++] = cpoff; + path_data[pidx++] = cpoff - final_radius; + path_data[pidx++] = final_radius; + path_data[pidx++] = 0 - final_radius; + path_data[pidx++] = final_radius; + + /* Bottom-left arc */ + path_data[pidx++] = VLC_OP_CUBIC_REL; + path_data[pidx++] = 0 - cpoff; + path_data[pidx++] = 0; + path_data[pidx++] = 0 - final_radius; + path_data[pidx++] = cpoff - final_radius; + path_data[pidx++] = 0 - final_radius; + path_data[pidx++] = 0 - final_radius; + + /* Top-left arc*/ + path_data[pidx++] = VLC_OP_CUBIC_REL; + path_data[pidx++] = 0; + path_data[pidx++] = 0 - cpoff; + path_data[pidx++] = final_radius - cpoff; + path_data[pidx++] = 0 - final_radius; + path_data[pidx++] = final_radius; + path_data[pidx++] = 0 - final_radius; + + /* Ending point */ + path_data[pidx++] = VLC_OP_END; + } + else if(radius > 0) { + /* Get the control point offset for rounded cases */ + int32_t cpoff = (int32_t)((float)final_radius * BEZIER_OPTIM_CIRCLE); + + /* Rounded rectangle case */ + /* Starting point */ + path_data[pidx++] = VLC_OP_MOVE; + path_data[pidx++] = coords->x1 + final_radius; + path_data[pidx++] = coords->y1; + + /* Top side */ + path_data[pidx++] = VLC_OP_LINE; + path_data[pidx++] = coords->x2 - final_radius + 1; // Extended for VGLite + path_data[pidx++] = coords->y1; + + /* Top-right corner */ + path_data[pidx++] = VLC_OP_CUBIC_REL; + path_data[pidx++] = cpoff; + path_data[pidx++] = 0; + path_data[pidx++] = final_radius; + path_data[pidx++] = final_radius - cpoff; + path_data[pidx++] = final_radius; + path_data[pidx++] = final_radius; + + /* Right side */ + path_data[pidx++] = VLC_OP_LINE; + path_data[pidx++] = coords->x2 + 1; // Extended for VGLite + path_data[pidx++] = coords->y2 - final_radius + 1; // Extended for VGLite + + /* Bottom-right corner*/ + path_data[pidx++] = VLC_OP_CUBIC_REL; + path_data[pidx++] = 0; + path_data[pidx++] = cpoff; + path_data[pidx++] = cpoff - final_radius; + path_data[pidx++] = final_radius; + path_data[pidx++] = 0 - final_radius; + path_data[pidx++] = final_radius; + + /* Bottom side */ + path_data[pidx++] = VLC_OP_LINE; + path_data[pidx++] = coords->x1 + final_radius; + path_data[pidx++] = coords->y2 + 1; // Extended for VGLite + + /* Bottom-left corner */ + path_data[pidx++] = VLC_OP_CUBIC_REL; + path_data[pidx++] = 0 - cpoff; + path_data[pidx++] = 0; + path_data[pidx++] = 0 - final_radius; + path_data[pidx++] = cpoff - final_radius; + path_data[pidx++] = 0 - final_radius; + path_data[pidx++] = 0 - final_radius; + + /* Left side*/ + path_data[pidx++] = VLC_OP_LINE; + path_data[pidx++] = coords->x1; + path_data[pidx++] = coords->y1 + final_radius; + + /* Top-left corner */ + path_data[pidx++] = VLC_OP_CUBIC_REL; + path_data[pidx++] = 0; + path_data[pidx++] = 0 - cpoff; + path_data[pidx++] = final_radius - cpoff; + path_data[pidx++] = 0 - final_radius; + path_data[pidx++] = final_radius; + path_data[pidx++] = 0 - final_radius; + + /* Ending point */ + path_data[pidx++] = VLC_OP_END; + } + else { + /* Non-rounded rectangle case */ + /* Starting point */ + path_data[pidx++] = VLC_OP_MOVE; + path_data[pidx++] = coords->x1; + path_data[pidx++] = coords->y1; + + /* Top side */ + path_data[pidx++] = VLC_OP_LINE; + path_data[pidx++] = coords->x2 + 1; // Extended for VGLite + path_data[pidx++] = coords->y1; + + /* Right side */ + path_data[pidx++] = VLC_OP_LINE; + path_data[pidx++] = coords->x2 + 1; // Extended for VGLite + path_data[pidx++] = coords->y2 + 1; // Extended for VGLite + + /* Bottom side */ + path_data[pidx++] = VLC_OP_LINE; + path_data[pidx++] = coords->x1; + path_data[pidx++] = coords->y2 + 1; // Extended for VGLite + + /* Left side*/ + path_data[pidx++] = VLC_OP_LINE; + path_data[pidx++] = coords->x1; + path_data[pidx++] = coords->y1; + + /* Ending point */ + path_data[pidx++] = VLC_OP_END; + } + + /* Resulting path size */ + *path_data_size = pidx * sizeof(int32_t); +} + +#endif /*LV_USE_GPU_NXP_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_rect.h b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_rect.h new file mode 100644 index 0000000..7958227 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_rect.h @@ -0,0 +1,97 @@ +/** + * @file lv_draw_vglite_rect.h + * + */ + +/** + * MIT License + * + * Copyright 2021-2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef LV_DRAW_VGLITE_RECT_H +#define LV_DRAW_VGLITE_RECT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lv_conf_internal.h" + +#if LV_USE_GPU_NXP_VG_LITE +#include "lv_vglite_utils.h" +#include "../../lv_draw_rect.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Draw rectangle background with effects (rounded corners, gradient) + * + * @param[in] coords Coordinates of the rectangle background (relative to dest buff) + * @param[in] clip_area Clipping area with relative coordinates to dest buff + * @param[in] dsc Description of the rectangle background + * + * @retval LV_RES_OK Draw completed + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + * + */ +lv_res_t lv_gpu_nxp_vglite_draw_bg(const lv_area_t * coords, const lv_area_t * clip_area, + const lv_draw_rect_dsc_t * dsc); + +/** + * Draw rectangle border/outline shape with effects (rounded corners, opacity) + * + * @param[in] coords Coordinates of the rectangle border/outline (relative to dest buff) + * @param[in] clip_area Clipping area with relative coordinates to dest buff + * @param[in] dsc Description of the rectangle border/outline + * @param[in] border True for border, False for outline + * + * @retval LV_RES_OK Draw completed + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) + * + */ +lv_res_t lv_gpu_nxp_vglite_draw_border_generic(const lv_area_t * coords, const lv_area_t * clip_area, + const lv_draw_rect_dsc_t * dsc, bool border); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_NXP_VG_LITE*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_VGLITE_RECT_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_triangle.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_triangle.c deleted file mode 100644 index 8556fdf..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_draw_vglite_triangle.c +++ /dev/null @@ -1,182 +0,0 @@ -/** - * @file lv_draw_vglite_triangle.c - * - */ - -/** - * Copyright 2023-2024 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_vglite.h" - -#if LV_USE_DRAW_VGLITE -#include "lv_vglite_buf.h" -#include "lv_vglite_path.h" -#include "lv_vglite_utils.h" - -#include "../../../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/** - * Draw triangle shape with effects (opacity, gradient) - * - * @param[in] coords Coordinates of the triangle (relative to dest buff) - * @param[in] clip_area Clipping area with relative coordinates to dest buff - * @param[in] dsc Description of the triangle - * - */ -static void _vglite_draw_triangle(const lv_area_t * coords, const lv_area_t * clip_area, - const lv_draw_triangle_dsc_t * dsc); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vglite_triangle(lv_draw_unit_t * draw_unit, const lv_draw_triangle_dsc_t * dsc) -{ - if(dsc->bg_opa <= (lv_opa_t)LV_OPA_MIN) - return; - - lv_layer_t * layer = draw_unit->target_layer; - lv_area_t clip_area; - lv_area_copy(&clip_area, draw_unit->clip_area); - lv_area_move(&clip_area, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t coords; - coords.x1 = (int32_t)LV_MIN3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - coords.y1 = (int32_t)LV_MIN3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - coords.x2 = (int32_t)LV_MAX3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - coords.y2 = (int32_t)LV_MAX3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - - lv_area_move(&coords, -layer->buf_area.x1, -layer->buf_area.y1); - - lv_area_t clipped_coords; - if(!lv_area_intersect(&clipped_coords, &coords, &clip_area)) - return; /* Fully clipped, nothing to do */ - - _vglite_draw_triangle(&coords, &clip_area, dsc); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void _vglite_draw_triangle(const lv_area_t * coords, const lv_area_t * clip_area, - const lv_draw_triangle_dsc_t * dsc) -{ - vg_lite_buffer_t * vgbuf = vglite_get_dest_buf(); - - lv_area_t tri_area; - tri_area.x1 = (int32_t)LV_MIN3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - tri_area.y1 = (int32_t)LV_MIN3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - tri_area.x2 = (int32_t)LV_MAX3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - tri_area.y2 = (int32_t)LV_MAX3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - - uint32_t width = lv_area_get_width(&tri_area); - uint32_t height = lv_area_get_height(&tri_area); - - /* Init path */ - int32_t triangle_path[] = { /*VG line path*/ - VLC_OP_MOVE, dsc->p[0].x, dsc->p[0].y, - VLC_OP_LINE, dsc->p[1].x, dsc->p[1].y, - VLC_OP_LINE, dsc->p[2].x, dsc->p[2].y, - VLC_OP_LINE, dsc->p[0].x, dsc->p[0].y, - VLC_OP_END - }; - - vg_lite_path_t path; - VGLITE_CHECK_ERROR(vg_lite_init_path(&path, VG_LITE_S32, VG_LITE_HIGH, sizeof(triangle_path), triangle_path, - (vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1, - ((vg_lite_float_t)clip_area->x2) + 1.0f, ((vg_lite_float_t)clip_area->y2) + 1.0f)); - - vg_lite_matrix_t matrix; - vg_lite_identity(&matrix); - - /* Init Color */ - lv_color32_t col32 = lv_color_to_32(dsc->bg_color, dsc->bg_opa); - vg_lite_color_t vgcol = vglite_get_color(col32, false); - - vg_lite_linear_gradient_t gradient; - bool has_gradient = (dsc->bg_grad.dir != (lv_grad_dir_t)LV_GRAD_DIR_NONE); - - /* Init Gradient*/ - if(has_gradient) { - vg_lite_matrix_t * grad_matrix; - - vg_lite_uint32_t colors[LV_GRADIENT_MAX_STOPS]; - vg_lite_uint32_t stops[LV_GRADIENT_MAX_STOPS]; - lv_color32_t col32[LV_GRADIENT_MAX_STOPS]; - - /* Gradient Setup */ - vg_lite_uint32_t cnt = LV_MAX(dsc->bg_grad.stops_count, LV_GRADIENT_MAX_STOPS); - lv_opa_t bg_opa; - - for(uint8_t i = 0; i < cnt; i++) { - stops[i] = dsc->bg_grad.stops[i].frac; - bg_opa = LV_OPA_MIX2(dsc->bg_grad.stops[i].opa, dsc->bg_opa); - - col32[i] = lv_color_to_32(dsc->bg_grad.stops[i].color, bg_opa); - colors[i] = vglite_get_color(col32[i], true); - } - - lv_memzero(&gradient, sizeof(vg_lite_linear_gradient_t)); - - VGLITE_CHECK_ERROR(vg_lite_init_grad(&gradient)); - - VGLITE_CHECK_ERROR(vg_lite_set_grad(&gradient, cnt, colors, stops)); - - VGLITE_CHECK_ERROR(vg_lite_update_grad(&gradient)); - - grad_matrix = vg_lite_get_grad_matrix(&gradient); - vg_lite_identity(grad_matrix); - vg_lite_translate((float)coords->x1, (float)coords->y1, grad_matrix); - - if(dsc->bg_grad.dir == (lv_grad_dir_t)LV_GRAD_DIR_VER) { - vg_lite_scale(1.0f, (float)height / 256.0f, grad_matrix); - vg_lite_rotate(90.0f, grad_matrix); - } - else { /*LV_GRAD_DIR_HOR*/ - vg_lite_scale((float)width / 256.0f, 1.0f, grad_matrix); - } - - VGLITE_CHECK_ERROR(vg_lite_draw_gradient(vgbuf, &path, VG_LITE_FILL_EVEN_ODD, &matrix, &gradient, - VG_LITE_BLEND_SRC_OVER)); - } - else { - VGLITE_CHECK_ERROR(vg_lite_draw(vgbuf, &path, VG_LITE_FILL_EVEN_ODD, &matrix, VG_LITE_BLEND_SRC_OVER, vgcol)); - } - - vglite_run(); - - VGLITE_CHECK_ERROR(vg_lite_clear_path(&path)); - - if(has_gradient) - VGLITE_CHECK_ERROR(vg_lite_clear_grad(&gradient)); -} - -#endif /*LV_USE_DRAW_VGLITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_buf.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_buf.c index a72c8e5..e1ff6a2 100644 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_buf.c +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_buf.c @@ -4,9 +4,27 @@ */ /** + * MIT License + * * Copyright 2023 NXP * - * SPDX-License-Identifier: MIT + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * */ /********************* @@ -15,15 +33,20 @@ #include "lv_vglite_buf.h" -#if LV_USE_DRAW_VGLITE -#include "lv_vglite_utils.h" - -#include "../../../stdlib/lv_string.h" +#if LV_USE_GPU_NXP_VG_LITE /********************* * DEFINES *********************/ +#if LV_COLOR_DEPTH == 16 + #define VG_LITE_PX_FMT VG_LITE_RGB565 +#elif LV_COLOR_DEPTH == 32 + #define VG_LITE_PX_FMT VG_LITE_BGRA8888 +#else + #error Only 16bit and 32bit color depth are supported. Set LV_COLOR_DEPTH to 16 or 32. +#endif + /********************** * TYPEDEFS **********************/ @@ -32,14 +55,15 @@ * STATIC PROTOTYPES **********************/ -static inline void _set_vgbuf_ptr(vg_lite_buffer_t * vgbuf, void * buf); +static inline void lv_vglite_set_dest_buf(const lv_color_t * buf, const lv_area_t * area, lv_coord_t stride); +static inline void lv_vglite_set_buf_ptr(vg_lite_buffer_t * vgbuf, const lv_color_t * buf); /********************** * STATIC VARIABLES **********************/ -static vg_lite_buffer_t _dest_vgbuf; -static vg_lite_buffer_t _src_vgbuf; +static vg_lite_buffer_t dest_vgbuf; +static vg_lite_buffer_t src_vgbuf; /********************** * MACROS @@ -49,56 +73,52 @@ static vg_lite_buffer_t _src_vgbuf; * GLOBAL FUNCTIONS **********************/ -vg_lite_buffer_t * vglite_get_dest_buf(void) +void lv_gpu_nxp_vglite_init_buf(const lv_color_t * buf, const lv_area_t * area, lv_coord_t stride) { - return &_dest_vgbuf; + lv_vglite_set_dest_buf(buf, area, stride); } -vg_lite_buffer_t * vglite_get_src_buf(void) +vg_lite_buffer_t * lv_vglite_get_dest_buf(void) { - return &_src_vgbuf; + return &dest_vgbuf; } -void vglite_set_dest_buf_ptr(void * buf) +vg_lite_buffer_t * lv_vglite_get_src_buf(void) { - _set_vgbuf_ptr(&_dest_vgbuf, buf); + return &src_vgbuf; } -void vglite_set_src_buf_ptr(const void * buf) +void lv_vglite_set_dest_buf_ptr(const lv_color_t * buf) { - _set_vgbuf_ptr(&_src_vgbuf, (void *)buf); + lv_vglite_set_buf_ptr(&dest_vgbuf, buf); } -void vglite_set_dest_buf(const void * buf, uint32_t width, uint32_t height, uint32_t stride, - lv_color_format_t cf) +void lv_vglite_set_src_buf_ptr(const lv_color_t * buf) { - vglite_set_buf(&_dest_vgbuf, (void *)buf, width, height, stride, cf); + lv_vglite_set_buf_ptr(&src_vgbuf, buf); } -void vglite_set_src_buf(const void * buf, uint32_t width, uint32_t height, uint32_t stride, - lv_color_format_t cf) +void lv_vglite_set_src_buf(const lv_color_t * buf, const lv_area_t * area, lv_coord_t stride) { - vglite_set_buf(&_src_vgbuf, (void *)buf, width, height, stride, cf); + if(src_vgbuf.memory != (void *)buf) + lv_vglite_set_buf(&src_vgbuf, buf, area, stride); } -void vglite_set_buf(vg_lite_buffer_t * vgbuf, void * buf, - uint32_t width, uint32_t height, uint32_t stride, - lv_color_format_t cf) +void lv_vglite_set_buf(vg_lite_buffer_t * vgbuf, const lv_color_t * buf, + const lv_area_t * area, lv_coord_t stride) { - vg_lite_buffer_format_t vgformat = vglite_get_buf_format(cf); - - vgbuf->format = vgformat; + vgbuf->format = VG_LITE_PX_FMT; vgbuf->tiled = VG_LITE_LINEAR; vgbuf->image_mode = VG_LITE_NORMAL_IMAGE_MODE; vgbuf->transparency_mode = VG_LITE_IMAGE_OPAQUE; - vgbuf->width = (int32_t)width; - vgbuf->height = (int32_t)height; - vgbuf->stride = (int32_t)stride; + vgbuf->width = (int32_t)lv_area_get_width(area); + vgbuf->height = (int32_t)lv_area_get_height(area); + vgbuf->stride = (int32_t)(stride) * sizeof(lv_color_t); - lv_memzero(&vgbuf->yuv, sizeof(vgbuf->yuv)); + lv_memset_00(&vgbuf->yuv, sizeof(vgbuf->yuv)); - vgbuf->memory = buf; + vgbuf->memory = (void *)buf; vgbuf->address = (uint32_t)vgbuf->memory; vgbuf->handle = NULL; } @@ -107,10 +127,15 @@ void vglite_set_buf(vg_lite_buffer_t * vgbuf, void * buf, * STATIC FUNCTIONS **********************/ -static inline void _set_vgbuf_ptr(vg_lite_buffer_t * vgbuf, void * buf) +static inline void lv_vglite_set_dest_buf(const lv_color_t * buf, const lv_area_t * area, lv_coord_t stride) +{ + lv_vglite_set_buf(&dest_vgbuf, buf, area, stride); +} + +static inline void lv_vglite_set_buf_ptr(vg_lite_buffer_t * vgbuf, const lv_color_t * buf) { - vgbuf->memory = buf; + vgbuf->memory = (void *)buf; vgbuf->address = (uint32_t)vgbuf->memory; } -#endif /*LV_USE_DRAW_VGLITE*/ +#endif /*LV_USE_GPU_NXP_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_buf.h b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_buf.h index 3ef4347..e89af1c 100644 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_buf.h +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_buf.h @@ -4,9 +4,27 @@ */ /** + * MIT License + * * Copyright 2023 NXP * - * SPDX-License-Identifier: MIT + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * */ #ifndef LV_VGLITE_BUF_H @@ -21,10 +39,9 @@ extern "C" { *********************/ #include "../../../lv_conf_internal.h" -#if LV_USE_DRAW_VGLITE -#include "../../sw/lv_draw_sw.h" - +#if LV_USE_GPU_NXP_VG_LITE #include "vg_lite.h" +#include "../../sw/lv_draw_sw.h" /********************* * DEFINES @@ -37,85 +54,68 @@ extern "C" { /********************** * GLOBAL PROTOTYPES **********************/ +/** + * Init vglite destination buffer. It will be done once per frame. + * + * @param[in] buf Destination buffer address (does not require alignment for VG_LITE_LINEAR mode) + * @param[in] area Destination buffer area (for width and height) + * @param[in] stride Stride of destination buffer + */ +void lv_gpu_nxp_vglite_init_buf(const lv_color_t * buf, const lv_area_t * area, lv_coord_t stride); /** * Get vglite destination buffer pointer. * * @retval The vglite destination buffer - * */ -vg_lite_buffer_t * vglite_get_dest_buf(void); +vg_lite_buffer_t * lv_vglite_get_dest_buf(void); /** * Get vglite source buffer pointer. * * @retval The vglite source buffer - * */ -vg_lite_buffer_t * vglite_get_src_buf(void); +vg_lite_buffer_t * lv_vglite_get_src_buf(void); /** * Set vglite destination buffer address only. * * @param[in] buf Destination buffer address (does not require alignment for VG_LITE_LINEAR mode) - * */ -void vglite_set_dest_buf_ptr(void * buf); +void lv_vglite_set_dest_buf_ptr(const lv_color_t * buf); /** * Set vglite source buffer address only. * * @param[in] buf Source buffer address - * */ -void vglite_set_src_buf_ptr(const void * buf); +void lv_vglite_set_src_buf_ptr(const lv_color_t * buf); /** - * Set vglite destination buffer. - * - * @param[in] buf Destination buffer address - * @param[in] width Destination buffer width - * @param[in] height Destination buffer height - * @param[in] stride Destination buffer stride in bytes - * @param[in] cf Destination buffer color format - * - */ -void vglite_set_dest_buf(const void * buf, uint32_t width, uint32_t height, uint32_t stride, - lv_color_format_t cf); - -/** - * Set vglite source buffer. + * Set vglite source buffer. It will be done only if buffer addreess is different. * * @param[in] buf Source buffer address - * @param[in] width Source buffer width - * @param[in] height Source buffer height - * @param[in] stride Source buffer stride in bytes - * @param[in] cf Source buffer color format - * + * @param[in] area Source buffer area (for width and height) + * @param[in] stride Stride of source buffer */ -void vglite_set_src_buf(const void * buf, uint32_t width, uint32_t height, uint32_t stride, - lv_color_format_t cf); +void lv_vglite_set_src_buf(const lv_color_t * buf, const lv_area_t * area, lv_coord_t stride); /** * Set vglite buffer. * * @param[in] vgbuf Address of the VGLite buffer object * @param[in] buf Address of the memory for the VGLite buffer - * @param[in] width Buffer width - * @param[in] height Buffer height - * @param[in] stride Buffer stride in bytes - * @param[in] cf Buffer color format - * + * @param[in] area buffer area (for width and height) + * @param[in] stride buffer stride */ -void vglite_set_buf(vg_lite_buffer_t * vgbuf, void * buf, - uint32_t width, uint32_t height, uint32_t stride, - lv_color_format_t cf); +void lv_vglite_set_buf(vg_lite_buffer_t * vgbuf, const lv_color_t * buf, + const lv_area_t * area, lv_coord_t stride); /********************** * MACROS **********************/ -#endif /*LV_USE_DRAW_VGLITE*/ +#endif /*LV_USE_GPU_NXP_VG_LITE*/ #ifdef __cplusplus } /*extern "C"*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_matrix.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_matrix.c deleted file mode 100644 index 0594b53..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_matrix.c +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @file lv_vglite_matrix.c - * - */ - -/** - * Copyright 2023 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_vglite_matrix.h" - -#if LV_USE_DRAW_VGLITE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -static vg_lite_matrix_t _vgmatrix; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -vg_lite_matrix_t * vglite_get_matrix(void) -{ - return &_vgmatrix; -} - -void vglite_set_translation_matrix(const lv_area_t * dest_area) -{ - vg_lite_identity(&_vgmatrix); - vg_lite_translate((vg_lite_float_t)dest_area->x1, (vg_lite_float_t)dest_area->y1, &_vgmatrix); -} - -void vglite_set_transformation_matrix(const lv_area_t * dest_area, const lv_draw_image_dsc_t * dsc) -{ - vglite_set_translation_matrix(dest_area); - - bool has_scale = (dsc->scale_x != LV_SCALE_NONE || dsc->scale_y != LV_SCALE_NONE); - bool has_rotation = (dsc->rotation != 0); - - if(has_scale || has_rotation) { - vg_lite_translate(dsc->pivot.x, dsc->pivot.y, &_vgmatrix); - if(has_rotation) - vg_lite_rotate(dsc->rotation / 10.0f, &_vgmatrix); /* angle is 1/10 degree */ - if(has_scale) { - vg_lite_float_t scale_x = 1.0f * dsc->scale_x / LV_SCALE_NONE; - vg_lite_float_t scale_y = 1.0f * dsc->scale_y / LV_SCALE_NONE; - vg_lite_scale(scale_x, scale_y, &_vgmatrix); - } - vg_lite_translate(0.0f - dsc->pivot.x, 0.0f - dsc->pivot.y, &_vgmatrix); - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VGLITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_matrix.h b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_matrix.h deleted file mode 100644 index 832cd86..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_matrix.h +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @file lv_vglite_matrix.h - * - */ - -/** - * Copyright 2023 NXP - * - * SPDX-License-Identifier: MIT - */ - -#ifndef LV_VGLITE_MATRIX_H -#define LV_VGLITE_MATRIX_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../../lv_conf_internal.h" - -#if LV_USE_DRAW_VGLITE -#include "../../sw/lv_draw_sw.h" - -#include "vg_lite.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -vg_lite_matrix_t * vglite_get_matrix(void); - -/** - * Creates matrix that translates to origin of given destination area. - * - * @param[in] dest_area Area with relative coordinates of destination buffer - * - */ -void vglite_set_translation_matrix(const lv_area_t * dest_area); - -/** - * Creates matrix that translates to origin of given destination area with transformation (scale or rotate). - * - * @param[in] dest_area Area with relative coordinates of destination buffer - * @param[in] dsc Image descriptor - * - */ -void vglite_set_transformation_matrix(const lv_area_t * dest_area, const lv_draw_image_dsc_t * dsc); - -/********************** - * MACROS - **********************/ - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VGLITE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_VGLITE_MATRIX_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_path.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_path.c deleted file mode 100644 index 6f8b759..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_path.c +++ /dev/null @@ -1,217 +0,0 @@ -/** - * @file lv_vglite_path.c - * - */ - -/** - * Copyright 2023 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_vglite_path.h" - -#if LV_USE_DRAW_VGLITE -#include "vg_lite.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void vglite_create_rect_path_data(int32_t * path_data, uint32_t * path_data_size, - int32_t radius, - const lv_area_t * coords) -{ - int32_t rect_width = lv_area_get_width(coords); - int32_t rect_height = lv_area_get_height(coords); - - /* Get the final radius. Can't be larger than the half of the shortest side */ - int32_t shortest_side = LV_MIN(rect_width, rect_height); - int32_t final_radius = LV_MIN(radius, shortest_side / 2); - - /* Path data element index */ - uint8_t pidx = 0; - - if((radius == (int32_t)LV_RADIUS_CIRCLE) && (rect_width == rect_height)) { - - /* Get the control point offset for rounded cases */ - int32_t cpoff = (int32_t)((float)final_radius * BEZIER_OPTIM_CIRCLE); - - /* Circle case */ - /* Starting point */ - path_data[pidx++] = VLC_OP_MOVE; - path_data[pidx++] = coords->x1 + final_radius; - path_data[pidx++] = coords->y1; - - /* Top-right arc */ - path_data[pidx++] = VLC_OP_CUBIC_REL; - path_data[pidx++] = cpoff; - path_data[pidx++] = 0; - path_data[pidx++] = final_radius; - path_data[pidx++] = final_radius - cpoff; - path_data[pidx++] = final_radius; - path_data[pidx++] = final_radius; - - /* Bottom-right arc*/ - path_data[pidx++] = VLC_OP_CUBIC_REL; - path_data[pidx++] = 0; - path_data[pidx++] = cpoff; - path_data[pidx++] = cpoff - final_radius; - path_data[pidx++] = final_radius; - path_data[pidx++] = 0 - final_radius; - path_data[pidx++] = final_radius; - - /* Bottom-left arc */ - path_data[pidx++] = VLC_OP_CUBIC_REL; - path_data[pidx++] = 0 - cpoff; - path_data[pidx++] = 0; - path_data[pidx++] = 0 - final_radius; - path_data[pidx++] = cpoff - final_radius; - path_data[pidx++] = 0 - final_radius; - path_data[pidx++] = 0 - final_radius; - - /* Top-left arc*/ - path_data[pidx++] = VLC_OP_CUBIC_REL; - path_data[pidx++] = 0; - path_data[pidx++] = 0 - cpoff; - path_data[pidx++] = final_radius - cpoff; - path_data[pidx++] = 0 - final_radius; - path_data[pidx++] = final_radius; - path_data[pidx++] = 0 - final_radius; - - /* Ending point */ - path_data[pidx++] = VLC_OP_END; - } - else if(radius > 0) { - /* Get the control point offset for rounded cases */ - int32_t cpoff = (int32_t)((float)final_radius * BEZIER_OPTIM_CIRCLE); - - /* Rounded rectangle case */ - /* Starting point */ - path_data[pidx++] = VLC_OP_MOVE; - path_data[pidx++] = coords->x1 + final_radius; - path_data[pidx++] = coords->y1; - - /* Top side */ - path_data[pidx++] = VLC_OP_LINE; - path_data[pidx++] = coords->x2 - final_radius + 1; /*Extended for VGLite*/ - path_data[pidx++] = coords->y1; - - /* Top-right corner */ - path_data[pidx++] = VLC_OP_CUBIC_REL; - path_data[pidx++] = cpoff; - path_data[pidx++] = 0; - path_data[pidx++] = final_radius; - path_data[pidx++] = final_radius - cpoff; - path_data[pidx++] = final_radius; - path_data[pidx++] = final_radius; - - /* Right side */ - path_data[pidx++] = VLC_OP_LINE; - path_data[pidx++] = coords->x2 + 1; /*Extended for VGLite*/ - path_data[pidx++] = coords->y2 - final_radius + 1; /*Extended for VGLite*/ - - /* Bottom-right corner*/ - path_data[pidx++] = VLC_OP_CUBIC_REL; - path_data[pidx++] = 0; - path_data[pidx++] = cpoff; - path_data[pidx++] = cpoff - final_radius; - path_data[pidx++] = final_radius; - path_data[pidx++] = 0 - final_radius; - path_data[pidx++] = final_radius; - - /* Bottom side */ - path_data[pidx++] = VLC_OP_LINE; - path_data[pidx++] = coords->x1 + final_radius; - path_data[pidx++] = coords->y2 + 1; /*Extended for VGLite*/ - - /* Bottom-left corner */ - path_data[pidx++] = VLC_OP_CUBIC_REL; - path_data[pidx++] = 0 - cpoff; - path_data[pidx++] = 0; - path_data[pidx++] = 0 - final_radius; - path_data[pidx++] = cpoff - final_radius; - path_data[pidx++] = 0 - final_radius; - path_data[pidx++] = 0 - final_radius; - - /* Left side*/ - path_data[pidx++] = VLC_OP_LINE; - path_data[pidx++] = coords->x1; - path_data[pidx++] = coords->y1 + final_radius; - - /* Top-left corner */ - path_data[pidx++] = VLC_OP_CUBIC_REL; - path_data[pidx++] = 0; - path_data[pidx++] = 0 - cpoff; - path_data[pidx++] = final_radius - cpoff; - path_data[pidx++] = 0 - final_radius; - path_data[pidx++] = final_radius; - path_data[pidx++] = 0 - final_radius; - - /* Ending point */ - path_data[pidx++] = VLC_OP_END; - } - else { - /* Non-rounded rectangle case */ - /* Starting point */ - path_data[pidx++] = VLC_OP_MOVE; - path_data[pidx++] = coords->x1; - path_data[pidx++] = coords->y1; - - /* Top side */ - path_data[pidx++] = VLC_OP_LINE; - path_data[pidx++] = coords->x2 + 1; /*Extended for VGLite*/ - path_data[pidx++] = coords->y1; - - /* Right side */ - path_data[pidx++] = VLC_OP_LINE; - path_data[pidx++] = coords->x2 + 1; /*Extended for VGLite*/ - path_data[pidx++] = coords->y2 + 1; /*Extended for VGLite*/ - - /* Bottom side */ - path_data[pidx++] = VLC_OP_LINE; - path_data[pidx++] = coords->x1; - path_data[pidx++] = coords->y2 + 1; /*Extended for VGLite*/ - - /* Left side*/ - path_data[pidx++] = VLC_OP_LINE; - path_data[pidx++] = coords->x1; - path_data[pidx++] = coords->y1; - - /* Ending point */ - path_data[pidx++] = VLC_OP_END; - } - - /* Resulting path size */ - *path_data_size = pidx * sizeof(int32_t); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VGLITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_path.h b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_path.h deleted file mode 100644 index f38593a..0000000 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_path.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @file lv_vglite_path.h - * - */ - -/** - * Copyright 2023 NXP - * - * SPDX-License-Identifier: MIT - */ - -#ifndef LV_VGLITE_PATH_H -#define LV_VGLITE_PATH_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../../lv_conf_internal.h" - -#if LV_USE_DRAW_VGLITE -#include "../../sw/lv_draw_sw.h" - -/********************* - * DEFINES - *********************/ - -/* The optimal Bezier control point offset for radial unit - * see: https://spencermortensen.com/articles/bezier-circle/ - **/ -#define BEZIER_OPTIM_CIRCLE 0.551915024494f - -/* Draw lines for control points of Bezier curves */ -#define BEZIER_DBG_CONTROL_POINTS 0 - -/* Path data sizes for different elements */ -#define CUBIC_PATH_DATA_SIZE 7 /* 1 opcode, 6 arguments */ -#define LINE_PATH_DATA_SIZE 3 /* 1 opcode, 2 arguments */ -#define MOVE_PATH_DATA_SIZE 3 /* 1 opcode, 2 arguments */ -#define END_PATH_DATA_SIZE 1 /* 1 opcode, 0 arguments */ -/* Maximum possible rectangle path size - * is in the rounded rectangle case: - * - 1 move for the path start - * - 4 cubics for the corners - * - 4 lines for the sides - * - 1 end for the path end */ -#define RECT_PATH_DATA_MAX_SIZE (1 * MOVE_PATH_DATA_SIZE + 4 * CUBIC_PATH_DATA_SIZE + 4 * LINE_PATH_DATA_SIZE + 1 * END_PATH_DATA_SIZE) - -/* Maximum possible arc path size - * is in the rounded arc case: - * - 1 move for the path start - * - 16 cubics for the arc (5 inner, 5 outer) and corners (3 per corner) - * - 1 end for the path end */ -#define ARC_PATH_DATA_MAX_SIZE (1 * MOVE_PATH_DATA_SIZE + 16 * CUBIC_PATH_DATA_SIZE + 1 * END_PATH_DATA_SIZE) -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Generates path data for rectangle drawing. - * - * @param[in/out] path The path data to initialize - * @param[in/out] path_size The resulting size of the created path data - * @param[in] dsc The style descriptor for the rectangle to be drawn - * @param[in] coords The coordinates of the rectangle to be drawn - * - */ -void vglite_create_rect_path_data(int32_t * path_data, uint32_t * path_data_size, - int32_t radius, - const lv_area_t * coords); - -/********************** - * MACROS - **********************/ - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VGLITE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_VGLITE_PATH_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_utils.c b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_utils.c index b3afa5a..adc9f77 100644 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_utils.c +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_utils.c @@ -4,9 +4,27 @@ */ /** - * Copyright 2022-2024 NXP + * MIT License + * + * Copyright 2022, 2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * SPDX-License-Identifier: MIT */ /********************* @@ -15,9 +33,7 @@ #include "lv_vglite_utils.h" -#if LV_USE_DRAW_VGLITE -#include "lv_vglite_buf.h" - +#if LV_USE_GPU_NXP_VG_LITE #include "../../../core/lv_refr.h" /********************* @@ -32,14 +48,15 @@ * STATIC PROTOTYPES **********************/ +/** + * Clean and invalidate cache. + */ +static inline void invalidate_cache(void); + /********************** * STATIC VARIABLES **********************/ -#if LV_USE_VGLITE_DRAW_ASYNC - static volatile bool _cmd_buf_flushed = false; -#endif - /********************** * MACROS **********************/ @@ -48,235 +65,85 @@ * GLOBAL FUNCTIONS **********************/ -const char * vglite_error_to_string(vg_lite_error_t error) -{ - switch(error) { - ENUM_TO_STRING(VG_LITE_SUCCESS); - ENUM_TO_STRING(VG_LITE_INVALID_ARGUMENT); - ENUM_TO_STRING(VG_LITE_OUT_OF_MEMORY); - ENUM_TO_STRING(VG_LITE_NO_CONTEXT); - ENUM_TO_STRING(VG_LITE_TIMEOUT); - ENUM_TO_STRING(VG_LITE_OUT_OF_RESOURCES); - ENUM_TO_STRING(VG_LITE_GENERIC_IO); - ENUM_TO_STRING(VG_LITE_NOT_SUPPORT); - ENUM_TO_STRING(VG_LITE_ALREADY_EXISTS); - ENUM_TO_STRING(VG_LITE_NOT_ALIGNED); - ENUM_TO_STRING(VG_LITE_FLEXA_TIME_OUT); - ENUM_TO_STRING(VG_LITE_FLEXA_HANDSHAKE_FAIL); - default: - break; - } - - return "VG_LITE_UKNOWN_ERROR"; -} - -#if LV_USE_VGLITE_DRAW_ASYNC -bool vglite_cmd_buf_is_flushed(void) +lv_res_t lv_vglite_run(void) { - return _cmd_buf_flushed; -} -#endif - -void vglite_run(void) -{ -#if LV_USE_VGLITE_DRAW_ASYNC - vg_lite_uint32_t gpu_idle = 0; - - VGLITE_CHECK_ERROR(vg_lite_get_parameter(VG_LITE_GPU_IDLE_STATE, 1, (vg_lite_pointer)&gpu_idle)); - - if(!gpu_idle) { - _cmd_buf_flushed = false; - - return; - } -#endif - - /* - * If LV_USE_VGLITE_DRAW_ASYNC is enabled, simply flush the command buffer and the - * vglite draw thread will signal asynchronous the dispatcher for completed tasks. - * Without draw async, process the tasks and signal them as complete one by one. - */ -#if LV_USE_VGLITE_DRAW_ASYNC - VGLITE_CHECK_ERROR(vg_lite_flush()); - _cmd_buf_flushed = true; -#else - VGLITE_CHECK_ERROR(vg_lite_finish()); -#endif -} - -#if LV_USE_VGLITE_DRAW_ASYNC -void vglite_wait_for_finish(void) -{ - VGLITE_CHECK_ERROR(vg_lite_finish()); -} -#endif - -vg_lite_color_t vglite_get_color(lv_color32_t lv_col32, bool gradient) -{ - vg_lite_color_t vg_col32; - - /* Pre-multiply alpha */ - lv_col32.red = LV_UDIV255(lv_col32.red * lv_col32.alpha); - lv_col32.green = LV_UDIV255(lv_col32.green * lv_col32.alpha); - lv_col32.blue = LV_UDIV255(lv_col32.blue * lv_col32.alpha); + invalidate_cache(); - if(!gradient) - /* The color is in ABGR8888 format with red channel in the lower 8 bits. */ - vg_col32 = ((vg_lite_color_t)lv_col32.alpha << 24) | ((vg_lite_color_t)lv_col32.blue << 16) | - ((vg_lite_color_t)lv_col32.green << 8) | (vg_lite_color_t)lv_col32.red; - else - /* The gradient color is in ARGB8888 format with blue channel in the lower 8 bits. */ - vg_col32 = ((vg_lite_color_t)lv_col32.alpha << 24) | ((vg_lite_color_t)lv_col32.red << 16) | - ((vg_lite_color_t)lv_col32.green << 8) | (vg_lite_color_t)lv_col32.blue; + VG_LITE_ERR_RETURN_INV(vg_lite_flush(), "Flush failed."); - return vg_col32; + return LV_RES_OK; } -vg_lite_blend_t vglite_get_blend_mode(lv_blend_mode_t lv_blend_mode) +lv_res_t lv_vglite_premult_and_swizzle(vg_lite_color_t * vg_col32, lv_color32_t lv_col32, lv_opa_t opa, + vg_lite_buffer_format_t vg_col_format) { - vg_lite_blend_t vg_blend_mode = VG_LITE_BLEND_NONE; - if(vg_lite_query_feature(gcFEATURE_BIT_VG_LVGL_SUPPORT)) { - switch(lv_blend_mode) { - case LV_BLEND_MODE_NORMAL: - vg_blend_mode = VG_LITE_BLEND_NORMAL_LVGL; - break; - case LV_BLEND_MODE_ADDITIVE: - vg_blend_mode = VG_LITE_BLEND_ADDITIVE_LVGL; - break; - case LV_BLEND_MODE_SUBTRACTIVE: - vg_blend_mode = VG_LITE_BLEND_SUBTRACT_LVGL; - break; - case LV_BLEND_MODE_MULTIPLY: - vg_blend_mode = VG_LITE_BLEND_MULTIPLY_LVGL; - break; - default: - VGLITE_ASSERT_MSG(false, "Unsupported blend mode."); - break; + lv_color32_t lv_col32_premul = lv_col32; + if(opa <= (lv_opa_t)LV_OPA_MAX) { + /* Only pre-multiply color if hardware pre-multiplication is not present */ + if(!vg_lite_query_feature(gcFEATURE_BIT_VG_PE_PREMULTIPLY)) { + lv_col32_premul.ch.red = (uint8_t)(((uint16_t)lv_col32.ch.red * opa) >> 8); + lv_col32_premul.ch.green = (uint8_t)(((uint16_t)lv_col32.ch.green * opa) >> 8); + lv_col32_premul.ch.blue = (uint8_t)(((uint16_t)lv_col32.ch.blue * opa) >> 8); } + lv_col32_premul.ch.alpha = opa; } - else { - switch(lv_blend_mode) { - case LV_BLEND_MODE_NORMAL: - vg_blend_mode = VG_LITE_BLEND_SRC_OVER; - break; - case LV_BLEND_MODE_ADDITIVE: - vg_blend_mode = VG_LITE_BLEND_ADDITIVE; - break; - case LV_BLEND_MODE_SUBTRACTIVE: - vg_blend_mode = VG_LITE_BLEND_SUBTRACT; - break; - case LV_BLEND_MODE_MULTIPLY: - vg_blend_mode = VG_LITE_BLEND_MULTIPLY; - break; - default: - VGLITE_ASSERT_MSG(false, "Unsupported blend mode."); - break; - } - } - - return vg_blend_mode; -} - -vg_lite_buffer_format_t vglite_get_buf_format(lv_color_format_t cf) -{ - vg_lite_buffer_format_t vg_buffer_format = VG_LITE_BGR565; - switch(cf) { - case LV_COLOR_FORMAT_L8: - vg_buffer_format = VG_LITE_L8; - break; - case LV_COLOR_FORMAT_A8: - vg_buffer_format = VG_LITE_A8; + switch(vg_col_format) { + case VG_LITE_BGRA8888: + *vg_col32 = lv_col32_premul.full; break; - case LV_COLOR_FORMAT_I1: - vg_buffer_format = VG_LITE_INDEX_1; + case VG_LITE_RGBA8888: + *vg_col32 = ((uint32_t)lv_col32_premul.ch.red << 24) | ((uint32_t)lv_col32_premul.ch.green << 16) | + ((uint32_t)lv_col32_premul.ch.blue << 8) | (uint32_t)lv_col32_premul.ch.alpha; break; - case LV_COLOR_FORMAT_I2: - vg_buffer_format = VG_LITE_INDEX_2; + case VG_LITE_ABGR8888: + *vg_col32 = ((uint32_t)lv_col32_premul.ch.alpha << 24) | ((uint32_t)lv_col32_premul.ch.blue << 16) | + ((uint32_t)lv_col32_premul.ch.green << 8) | (uint32_t)lv_col32_premul.ch.red; break; - case LV_COLOR_FORMAT_I4: - vg_buffer_format = VG_LITE_INDEX_4; + case VG_LITE_ARGB8888: + *vg_col32 = ((uint32_t)lv_col32_premul.ch.alpha << 24) | ((uint32_t)lv_col32_premul.ch.red << 16) | + ((uint32_t)lv_col32_premul.ch.green << 8) | (uint32_t)lv_col32_premul.ch.blue; break; - case LV_COLOR_FORMAT_I8: - vg_buffer_format = VG_LITE_INDEX_8; - break; - case LV_COLOR_FORMAT_RGB565: - vg_buffer_format = VG_LITE_BGR565; - break; - case LV_COLOR_FORMAT_RGB565A8: - vg_buffer_format = VG_LITE_ABGR8565; - break; - case LV_COLOR_FORMAT_RGB888: - vg_buffer_format = VG_LITE_BGR888; - break; - case LV_COLOR_FORMAT_ARGB8888: - vg_buffer_format = VG_LITE_BGRA8888; - break; - case LV_COLOR_FORMAT_XRGB8888: - vg_buffer_format = VG_LITE_BGRX8888; - break; - default: - VGLITE_ASSERT_MSG(false, "Unsupported color format."); - break; + return LV_RES_INV; } - return vg_buffer_format; + return LV_RES_OK; } -uint8_t vglite_get_stride_alignment(lv_color_format_t cf) +vg_lite_blend_t lv_vglite_get_blend_mode(lv_blend_mode_t lv_blend_mode) { - uint8_t align_bytes = LV_COLOR_DEPTH / 8 * 16; /*16 pixels*/ - - switch(cf) { - case LV_COLOR_FORMAT_I1: - case LV_COLOR_FORMAT_I2: - case LV_COLOR_FORMAT_I4: - align_bytes = 8; + vg_lite_blend_t vg_blend_mode; + switch(lv_blend_mode) { + case LV_BLEND_MODE_ADDITIVE: + vg_blend_mode = VG_LITE_BLEND_ADDITIVE; break; - case LV_COLOR_FORMAT_I8: - case LV_COLOR_FORMAT_A8: - case LV_COLOR_FORMAT_L8: - align_bytes = 16; + case LV_BLEND_MODE_SUBTRACTIVE: + vg_blend_mode = VG_LITE_BLEND_SUBTRACT; break; - case LV_COLOR_FORMAT_RGB565: - align_bytes = 32; + case LV_BLEND_MODE_MULTIPLY: + vg_blend_mode = VG_LITE_BLEND_MULTIPLY; break; - case LV_COLOR_FORMAT_RGB565A8: - case LV_COLOR_FORMAT_RGB888: - align_bytes = 48; + case LV_BLEND_MODE_REPLACE: + vg_blend_mode = VG_LITE_BLEND_NONE; break; - case LV_COLOR_FORMAT_ARGB8888: - case LV_COLOR_FORMAT_XRGB8888: - align_bytes = 64; - break; - default: - VGLITE_ASSERT_MSG(false, "Unsupported buffer format."); + vg_blend_mode = VG_LITE_BLEND_SRC_OVER; break; } - - return align_bytes; -} - -bool vglite_src_buf_aligned(const void * buf, uint32_t stride, lv_color_format_t cf) -{ - /* No alignment requirement for destination buffer when using mode VG_LITE_LINEAR */ - - /* Test for pointer alignment */ - if((uintptr_t)buf % LV_ATTRIBUTE_MEM_ALIGN_SIZE) - return false; - - /* Test for stride alignment */ - if(stride == 0 || stride % vglite_get_stride_alignment(cf)) - return false; - - return true; + return vg_blend_mode; } /********************** * STATIC FUNCTIONS **********************/ -#endif /*LV_USE_DRAW_VGLITE*/ +static inline void invalidate_cache(void) +{ + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + if(disp->driver->clean_dcache_cb) + disp->driver->clean_dcache_cb(disp->driver); +} + +#endif /*LV_USE_GPU_NXP_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_utils.h b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_utils.h index 6615c4c..219396b 100644 --- a/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_utils.h +++ b/L3_Middlewares/LVGL/src/draw/nxp/vglite/lv_vglite_utils.h @@ -4,9 +4,27 @@ */ /** - * Copyright 2022-2024 NXP + * MIT License + * + * Copyright 2022, 2023 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next paragraph) + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * SPDX-License-Identifier: MIT */ #ifndef LV_VGLITE_UTILS_H @@ -21,43 +39,33 @@ extern "C" { *********************/ #include "../../../lv_conf_internal.h" -#if LV_USE_DRAW_VGLITE -#include "../../sw/lv_draw_sw.h" - +#if LV_USE_GPU_NXP_VG_LITE #include "vg_lite.h" -#include "vg_lite_options.h" +#include "../../sw/lv_draw_sw.h" +#include "../../../misc/lv_log.h" /********************* * DEFINES *********************/ -#define ENUM_TO_STRING(e) \ - case (e): \ - return #e +#ifndef LV_GPU_NXP_VG_LITE_LOG_ERRORS +/** Enable logging of VG-Lite errors (\see LV_LOG_ERROR)*/ +#define LV_GPU_NXP_VG_LITE_LOG_ERRORS 1 +#endif -#if LV_USE_VGLITE_ASSERT -#define VGLITE_ASSERT(expr) LV_ASSERT(expr) -#else -#define VGLITE_ASSERT(expr) +#ifndef LV_GPU_NXP_VG_LITE_LOG_TRACES +/** Enable logging of VG-Lite traces (\see LV_LOG_ERROR)*/ +#define LV_GPU_NXP_VG_LITE_LOG_TRACES 0 #endif -#define VGLITE_ASSERT_MSG(expr, msg) \ - do { \ - if(!(expr)) { \ - LV_LOG_ERROR(msg); \ - VGLITE_ASSERT(false); \ - } \ - } while(0) -#define VGLITE_CHECK_ERROR(function) \ - do { \ - vg_lite_error_t error = function; \ - if(error != VG_LITE_SUCCESS) { \ - LV_LOG_ERROR("Execute '" #function "' error(%d): %s", \ - (int)error, vglite_error_to_string(error)); \ - VGLITE_ASSERT(false); \ - } \ - } while (0) +/* The optimal Bezier control point offset for radial unit + * see: https://spencermortensen.com/articles/bezier-circle/ + **/ +#define BEZIER_OPTIM_CIRCLE 0.551915024494f + +/* Draw lines for control points of Bezier curves */ +#define BEZIER_DBG_CONTROL_POINTS 0 /********************** * TYPEDEFS @@ -68,52 +76,35 @@ extern "C" { **********************/ /** - * Set the clipping box. + * Enable scissor and set the clipping box. * * @param[in] clip_area Clip area with relative coordinates of destination buffer - * */ -static inline void vglite_set_scissor(const lv_area_t * clip_area); - -/********************** - * GLOBAL PROTOTYPES - **********************/ +static inline void lv_vglite_set_scissor(const lv_area_t * clip_area); -const char * vglite_error_to_string(vg_lite_error_t error); - -#if LV_USE_VGLITE_DRAW_ASYNC /** - * Get VG-Lite command buffer flushed status. - * + * Disable scissor. */ -bool vglite_cmd_buf_is_flushed(void); -#endif +static inline void lv_vglite_disable_scissor(void); -/** - * Flush command to VG-Lite. - * - */ -void vglite_run(void); -/** - * Wait for VG-Lite finish. - * - */ -#if LV_USE_VGLITE_DRAW_ASYNC -void vglite_wait_for_finish(void); -#endif +/********************** + * GLOBAL PROTOTYPES + **********************/ /** - * Get vglite color. Premultiplies (if not hw already) and swizzles the given - * LVGL 32bit color to obtain vglite color. + * Premultiplies and swizzles given LVGL 32bit color to obtain vglite color. * + * @param[in/out] vg_col32 The obtained vglite color * @param[in] lv_col32 The initial LVGL 32bit color - * @param[in] gradient True for gradient color - * - * @retval The vglite 32-bit color value: + * @param[in] opa The opacity to premultiply with + * @param[in] vg_col_format The format of the resulting vglite color * + * @retval LV_RES_OK Operation completed + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) */ -vg_lite_color_t vglite_get_color(lv_color32_t lv_col32, bool gradient); +lv_res_t lv_vglite_premult_and_swizzle(vg_lite_color_t * vg_col32, lv_color32_t lv_col32, lv_opa_t opa, + vg_lite_buffer_format_t vg_col_format); /** * Get vglite blend mode. @@ -121,56 +112,86 @@ vg_lite_color_t vglite_get_color(lv_color32_t lv_col32, bool gradient); * @param[in] lv_blend_mode The LVGL blend mode * * @retval The vglite blend mode - * */ -vg_lite_blend_t vglite_get_blend_mode(lv_blend_mode_t lv_blend_mode); +vg_lite_blend_t lv_vglite_get_blend_mode(lv_blend_mode_t lv_blend_mode); /** - * Get vglite buffer format. - * - * @param[in] cf Color format - * - * @retval The vglite buffer format + * Clear cache and flush command to VG-Lite. * + * @retval LV_RES_OK Run completed + * @retval LV_RES_INV Error occurred (\see LV_GPU_NXP_VG_LITE_LOG_ERRORS) */ -vg_lite_buffer_format_t vglite_get_buf_format(lv_color_format_t cf); - -/** - * Get vglite stride alignment. - * - * @param[in] cf Color format - * - * @retval Alignment requirement in bytes - * - */ -uint8_t vglite_get_stride_alignment(lv_color_format_t cf); - -/** - * Check source start address and stride alignment. - * - * @param[in] buf Buffer address - * @param[in] stride Stride of buffer in bytes - * @param[in] cf Color format - to calculate the expected alignment - * - * @retval true Alignment OK - * - */ -bool vglite_src_buf_aligned(const void * buf, uint32_t stride, lv_color_format_t cf); +lv_res_t lv_vglite_run(void); /********************** * MACROS **********************/ +#define VG_LITE_COND_STOP(cond, txt) \ + do { \ + if (cond) { \ + LV_LOG_ERROR("%s. STOP!", txt); \ + for ( ; ; ); \ + } \ + } while(0) + +#if LV_GPU_NXP_VG_LITE_LOG_ERRORS +#define VG_LITE_ERR_RETURN_INV(err, fmt, ...) \ + do { \ + if(err != VG_LITE_SUCCESS) { \ + LV_LOG_ERROR(fmt" (err = %d)", \ + err, ##__VA_ARGS__); \ + return LV_RES_INV; \ + } \ + } while (0) +#else +#define VG_LITE_ERR_RETURN_INV(err, fmt, ...) \ + do { \ + if(err != VG_LITE_SUCCESS) { \ + return LV_RES_INV; \ + } \ + }while(0) +#endif /*LV_GPU_NXP_VG_LITE_LOG_ERRORS*/ + +#if LV_GPU_NXP_VG_LITE_LOG_TRACES +#define VG_LITE_LOG_TRACE(fmt, ...) \ + do { \ + LV_LOG(fmt, ##__VA_ARGS__); \ + } while (0) + +#define VG_LITE_RETURN_INV(fmt, ...) \ + do { \ + LV_LOG_ERROR(fmt, ##__VA_ARGS__); \ + return LV_RES_INV; \ + } while (0) +#else +#define VG_LITE_LOG_TRACE(fmt, ...) \ + do { \ + } while (0) +#define VG_LITE_RETURN_INV(fmt, ...) \ + do { \ + return LV_RES_INV; \ + }while(0) +#endif /*LV_GPU_NXP_VG_LITE_LOG_TRACES*/ + /********************** * STATIC FUNCTIONS **********************/ -static inline void vglite_set_scissor(const lv_area_t * clip_area) +static inline void lv_vglite_set_scissor(const lv_area_t * clip_area) +{ + vg_lite_enable_scissor(); + vg_lite_set_scissor((int32_t)clip_area->x1, (int32_t)clip_area->y1, + (int32_t)lv_area_get_width(clip_area), + (int32_t)lv_area_get_height(clip_area)); +} + +static inline void lv_vglite_disable_scissor(void) { - vg_lite_set_scissor(clip_area->x1, clip_area->y1, clip_area->x2 + 1, clip_area->y2 + 1); + vg_lite_disable_scissor(); } -#endif /*LV_USE_DRAW_VGLITE*/ +#endif /*LV_USE_GPU_NXP_VG_LITE*/ #ifdef __cplusplus } /*extern "C"*/ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d.c b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d.c deleted file mode 100644 index 08a814c..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d.c +++ /dev/null @@ -1,597 +0,0 @@ -/** - * @file lv_draw_dave2d.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_dave2d.h" -#if LV_USE_DRAW_DAVE2D -#include "../../lv_draw_buf_private.h" -#include "../../../misc/lv_area_private.h" - -/********************* - * DEFINES - *********************/ -#define DRAW_UNIT_ID_DAVE2D 4 - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -#if LV_USE_OS - static void _dave2d_render_thread_cb(void * ptr); -#endif - -static void execute_drawing(lv_draw_dave2d_unit_t * u); - -#if defined(RENESAS_CORTEX_M85) - #if (BSP_CFG_DCACHE_ENABLED) - static void _dave2d_buf_invalidate_cache_cb(const lv_draw_buf_t * draw_buf, const lv_area_t * area); - #endif -#endif - -static int32_t _dave2d_evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task); - -static int32_t lv_draw_dave2d_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer); - -static d2_s32 lv_dave2d_init(void); - -static void lv_draw_buf_dave2d_init_handlers(void); - -void dave2d_execute_dlist_and_flush(void); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -d2_device * _d2_handle; -d2_renderbuffer * _renderbuffer; -d2_renderbuffer * _blit_renderbuffer; - -lv_ll_t _ll_Dave2D_Tasks; - -#if LV_USE_OS - lv_mutex_t xd2Semaphore; -#endif - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_dave2d_init(void) -{ - d2_s32 result = D2_OK; - - lv_draw_buf_dave2d_init_handlers(); - - lv_draw_dave2d_unit_t * draw_dave2d_unit = lv_draw_create_unit(sizeof(lv_draw_dave2d_unit_t)); - draw_dave2d_unit->base_unit.dispatch_cb = lv_draw_dave2d_dispatch; - draw_dave2d_unit->base_unit.evaluate_cb = _dave2d_evaluate; - draw_dave2d_unit->idx = DRAW_UNIT_ID_DAVE2D; - - result = lv_dave2d_init(); - LV_ASSERT(D2_OK == result); - -#if LV_USE_OS - lv_result_t res; - res = lv_mutex_init(&xd2Semaphore); - LV_ASSERT(LV_RESULT_OK == res); - - draw_dave2d_unit->pd2Mutex = &xd2Semaphore; -#endif - - draw_dave2d_unit->d2_handle = _d2_handle; - draw_dave2d_unit->renderbuffer = _renderbuffer; - lv_ll_init(&_ll_Dave2D_Tasks, 4); - -#if LV_USE_OS - lv_thread_init(&draw_dave2d_unit->thread, LV_THREAD_PRIO_HIGH, _dave2d_render_thread_cb, 8 * 1024, draw_dave2d_unit); -#endif - -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_draw_buf_dave2d_init_handlers(void) -{ - -#if defined(RENESAS_CORTEX_M85) -#if (BSP_CFG_DCACHE_ENABLED) - lv_draw_buf_handlers_t * handlers = lv_draw_buf_get_handlers(); - handlers->invalidate_cache_cb = _dave2d_buf_invalidate_cache_cb; -#endif -#endif -} - -#if defined(RENESAS_CORTEX_M85) -#if (BSP_CFG_DCACHE_ENABLED) -static void _dave2d_buf_invalidate_cache_cb(const lv_draw_buf_t * draw_buf, const lv_area_t * area) -{ - const lv_image_header_t * header = &draw_buf->header; - uint32_t stride = header->stride; - lv_color_format_t cf = header->cf; - - uint8_t * address = draw_buf->data; - int32_t i = 0; - uint32_t bytes_per_pixel = lv_color_format_get_size(cf); - int32_t width = lv_area_get_width(area); - int32_t lines = lv_area_get_height(area); - int32_t bytes_to_flush_per_line = (int32_t)width * (int32_t)bytes_per_pixel; - - /* Stride is in bytes, not pixels */ - address = address + (area->x1 * (int32_t)bytes_per_pixel) + (stride * (uint32_t)area->y1); - - for(i = 0; i < lines; i++) { - SCB_CleanInvalidateDCache_by_Addr(address, bytes_to_flush_per_line); - address += stride; - } -} -#endif -#endif - -/** - * @todo - * LVGL needs to use hardware acceleration for buf_copy and do not affect GPU rendering. - */ -#if 0 -static void _dave2d_buf_copy(void * dest_buf, uint32_t dest_w, uint32_t dest_h, const lv_area_t * dest_area, - void * src_buf, uint32_t src_w, uint32_t src_h, const lv_area_t * src_area, lv_color_format_t color_format) -{ - d2_s32 result; - -#if LV_USE_OS - lv_result_t status; - - status = lv_mutex_lock(&xd2Semaphore); - LV_ASSERT(LV_RESULT_OK == status); -#endif - - d2_u32 src_blend_mode = d2_getblendmodesrc(_d2_handle); - d2_u32 dst_blend_mode = d2_getblendmodedst(_d2_handle); - - result = d2_selectrenderbuffer(_d2_handle, _blit_renderbuffer); - LV_ASSERT(D2_OK == result); - - result = d2_setblendmode(_d2_handle, d2_bm_one, d2_bm_zero); - LV_ASSERT(D2_OK == result); - - // Generate render operations - result = d2_framebuffer(_d2_handle, (uint16_t *)dest_buf, DISPLAY_HSIZE_INPUT0, DISPLAY_BUFFER_STRIDE_PIXELS_INPUT0, - DISPLAY_VSIZE_INPUT0, lv_draw_dave2d_cf_fb_get()); - LV_ASSERT(D2_OK == result); - - result = d2_cliprect(_d2_handle, (d2_border)dest_area->x1, (d2_border)dest_area->y1, (d2_border)dest_area->x2, - (d2_border)dest_area->y2); - LV_ASSERT(D2_OK == result); - - result = d2_setblitsrc(_d2_handle, (void *) src_buf, (d2_s32)src_w, (d2_s32)src_w, (d2_s32)src_h, - lv_draw_dave2d_lv_colour_fmt_to_d2_fmt(color_format)); - LV_ASSERT(D2_OK == result); - - result = d2_blitcopy(_d2_handle, (d2_s32)src_w, (d2_s32)src_h, (d2_blitpos)src_area->x1, (d2_blitpos)src_area->y1, - D2_FIX4(dest_w), D2_FIX4(dest_h), - D2_FIX4(dest_area->x1), D2_FIX4(dest_area->y1), 0); - LV_ASSERT(D2_OK == result); - - // Execute render operations - result = d2_executerenderbuffer(_d2_handle, _blit_renderbuffer, 0); - LV_ASSERT(D2_OK == result) ; - - result = d2_flushframe(_d2_handle); - LV_ASSERT(D2_OK == result); - - result = d2_selectrenderbuffer(_d2_handle, _renderbuffer); - LV_ASSERT(D2_OK == result); - - result = d2_setblendmode(_d2_handle, src_blend_mode, dst_blend_mode); - LV_ASSERT(D2_OK != result); - -#if LV_USE_OS - status = lv_mutex_unlock(&xd2Semaphore); - LV_ASSERT(LV_RESULT_OK == status); -#endif - -} -#endif - -#define USE_D2 (1) - -static int32_t _dave2d_evaluate(lv_draw_unit_t * u, lv_draw_task_t * t) -{ - LV_UNUSED(u); - int32_t ret = 0; - - switch(t->type) { - case LV_DRAW_TASK_TYPE_FILL: { -#if USE_D2 - lv_draw_fill_dsc_t * dsc = t->draw_dsc; - if(dsc->grad.dir == LV_GRAD_DIR_NONE - || ((dsc->grad.dir != LV_GRAD_DIR_NONE) - && ((dsc->grad.stops[0].color.blue == dsc->grad.stops[dsc->grad.stops_count - 1].color.blue) - && (dsc->grad.stops[0].color.red == dsc->grad.stops[dsc->grad.stops_count - 1].color.red) - && (dsc->grad.stops[0].color.green == dsc->grad.stops[dsc->grad.stops_count - 1].color.green)))) { - - t->preferred_draw_unit_id = DRAW_UNIT_ID_DAVE2D; - t->preference_score = 0; - - } - else -#endif - { - } - ret = 0; - break; - } - case LV_DRAW_TASK_TYPE_LAYER: { - ret = 0; - break; - } - - case LV_DRAW_TASK_TYPE_IMAGE: { -#if USE_D2 - t->preferred_draw_unit_id = DRAW_UNIT_ID_DAVE2D; - t->preference_score = 0; -#endif - ret = 0; - break; - } - - case LV_DRAW_TASK_TYPE_BORDER: { -#if USE_D2 - t->preferred_draw_unit_id = DRAW_UNIT_ID_DAVE2D; - t->preference_score = 0; -#endif - ret = 0; - break; - } - - case LV_DRAW_TASK_TYPE_BOX_SHADOW: { - ret = 0; - break; - } - - case LV_DRAW_TASK_TYPE_LABEL: { -#if USE_D2 - t->preferred_draw_unit_id = DRAW_UNIT_ID_DAVE2D; - t->preference_score = 0; -#endif - ret = 0; - break; - } - - case LV_DRAW_TASK_TYPE_LINE: { -#if USE_D2 - t->preferred_draw_unit_id = DRAW_UNIT_ID_DAVE2D; - t->preference_score = 0; -#endif - ret = 0; - break; - } - - case LV_DRAW_TASK_TYPE_ARC: { -#if USE_D2 - t->preferred_draw_unit_id = DRAW_UNIT_ID_DAVE2D; - t->preference_score = 0; -#endif - ret = 0; - break; - } - - case LV_DRAW_TASK_TYPE_TRIANGLE: { -#if USE_D2 - lv_draw_fill_dsc_t * dsc = t->draw_dsc; - if(dsc->grad.dir == LV_GRAD_DIR_NONE - || ((dsc->grad.dir != LV_GRAD_DIR_NONE) - && ((dsc->grad.stops[0].color.blue == dsc->grad.stops[dsc->grad.stops_count - 1].color.blue) - && (dsc->grad.stops[0].color.red == dsc->grad.stops[dsc->grad.stops_count - 1].color.red) - && (dsc->grad.stops[0].color.green == dsc->grad.stops[dsc->grad.stops_count - 1].color.green)))) { - t->preferred_draw_unit_id = DRAW_UNIT_ID_DAVE2D; - t->preference_score = 0; - } - else { - } -#endif - ret = 0; - break; - } - - case LV_DRAW_TASK_TYPE_MASK_RECTANGLE: { -#if 0//USE_D2 - t->preferred_draw_unit_id = DRAW_UNIT_ID_DAVE2D; - t->preference_score = 0; -#endif - ret = 0; - break; - } - - case LV_DRAW_TASK_TYPE_MASK_BITMAP: { - ret = 0; - break; - } - - default: - ret = 0; - break; - } - - return ret; -} - -#define DAVE2D_REFERRING_WATERMARK 10 - -static int32_t lv_draw_dave2d_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer) -{ - lv_draw_dave2d_unit_t * draw_dave2d_unit = (lv_draw_dave2d_unit_t *) draw_unit; -#if (0 == D2_RENDER_EACH_OPERATION) - static uint32_t ref_count = 0; -#endif - - /*Return immediately if it's busy with draw task*/ - if(draw_dave2d_unit->task_act) return 0; - - lv_draw_task_t * t = NULL; - t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_DAVE2D); - while(t && t->preferred_draw_unit_id != DRAW_UNIT_ID_DAVE2D) { - t->state = LV_DRAW_TASK_STATE_READY; - t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_DAVE2D); - } - - if(t == NULL) { -#if (0 == D2_RENDER_EACH_OPERATION) - if(false == lv_ll_is_empty(&_ll_Dave2D_Tasks)) { - ref_count = 0; - dave2d_execute_dlist_and_flush(); - } -#endif - return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/ - } - - void * buf = lv_draw_layer_alloc_buf(layer); - if(buf == NULL) { - return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/ - } - -#if (0 == D2_RENDER_EACH_OPERATION) - ref_count += lv_draw_get_dependent_count(t); - - if(DAVE2D_REFERRING_WATERMARK < ref_count) { - ref_count = 0; - dave2d_execute_dlist_and_flush(); - } - - lv_draw_task_t ** p_new_list_entry; - p_new_list_entry = lv_ll_ins_tail(&_ll_Dave2D_Tasks); - *p_new_list_entry = t; -#endif - - t->state = LV_DRAW_TASK_STATE_IN_PROGRESS; - draw_dave2d_unit->base_unit.target_layer = layer; - draw_dave2d_unit->base_unit.clip_area = &t->clip_area; - draw_dave2d_unit->task_act = t; - -#if LV_USE_OS - /*Let the render thread work*/ - lv_thread_sync_signal(&draw_dave2d_unit->sync); -#else - execute_drawing(draw_dave2d_unit); -#if (D2_RENDER_EACH_OPERATION) - draw_dave2d_unit->task_act->state = LV_DRAW_TASK_STATE_READY; -#endif - draw_dave2d_unit->task_act = NULL; - - /*The draw unit is free now. Request a new dispatching as it can get a new task*/ - lv_draw_dispatch_request(); - -#endif - return 1; -} - -#if LV_USE_OS -static void _dave2d_render_thread_cb(void * ptr) -{ - lv_draw_dave2d_unit_t * u = ptr; - - lv_thread_sync_init(&u->sync); - - while(1) { - while(u->task_act == NULL) { - lv_thread_sync_wait(&u->sync); - } - - execute_drawing(u); - - /*Cleanup*/ -#if (D2_RENDER_EACH_OPERATION) - u->task_act->state = LV_DRAW_TASK_STATE_READY; -#endif - u->task_act = NULL; - - /*The draw unit is free now. Request a new dispatching as it can get a new task*/ - lv_draw_dispatch_request(); - } -} -#endif - -static void execute_drawing(lv_draw_dave2d_unit_t * u) -{ - /*Render the draw task*/ - lv_draw_task_t * t = u->task_act; - -#if defined(RENESAS_CORTEX_M85) -#if (BSP_CFG_DCACHE_ENABLED) - lv_layer_t * layer = u->base_unit.target_layer; - lv_area_t clipped_area; - int32_t x; - int32_t y; - - lv_area_intersect(&clipped_area, &t->area, u->base_unit.clip_area); - - x = 0 - u->base_unit.target_layer->buf_area.x1; - y = 0 - u->base_unit.target_layer->buf_area.y1; - - lv_area_move(&clipped_area, x, y); - - /* Invalidate cache */ - lv_draw_buf_invalidate_cache(layer->draw_buf, &clipped_area); -#endif -#endif - - switch(t->type) { - case LV_DRAW_TASK_TYPE_FILL: - lv_draw_dave2d_fill(u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_BORDER: - lv_draw_dave2d_border(u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_BOX_SHADOW: - //lv_draw_dave2d_box_shadow(u, t->draw_dsc, &t->area); - break; -#if 0 - case LV_DRAW_TASK_TYPE_BG_IMG: - //lv_draw_dave2d_bg_image(u, t->draw_dsc, &t->area); - break; -#endif - case LV_DRAW_TASK_TYPE_LABEL: - lv_draw_dave2d_label(u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_IMAGE: - lv_draw_dave2d_image(u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_LINE: - lv_draw_dave2d_line(u, t->draw_dsc); - break; - case LV_DRAW_TASK_TYPE_ARC: - lv_draw_dave2d_arc(u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_TRIANGLE: - lv_draw_dave2d_triangle(u, t->draw_dsc); - break; - case LV_DRAW_TASK_TYPE_LAYER: - //lv_draw_dave2d_layer(u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_MASK_RECTANGLE: - //lv_draw_dave2d_mask_rect(u, t->draw_dsc, &t->area); - break; - default: - break; - } - -} - -static d2_s32 lv_dave2d_init(void) -{ - d2_s32 result = D2_OK; - - if(_d2_handle != NULL) { - return D2_NOMEMORY; - } - - _d2_handle = d2_opendevice(0); - if(_d2_handle == NULL) { - return D2_NOMEMORY; - } - - /* bind the hardware */ - result = d2_inithw(_d2_handle, 0); - if(result != D2_OK) { - LV_LOG_ERROR("Could NOT d2_inithw"); - d2_closedevice(_d2_handle); - return result; - } - - // - // Set various D2 parameters - // - result = d2_setblendmode(_d2_handle, d2_bm_alpha, d2_bm_one_minus_alpha); - result = d2_setalphamode(_d2_handle, d2_am_constant); - result = d2_setalpha(_d2_handle, UINT8_MAX); - result = d2_setantialiasing(_d2_handle, 1); - result = d2_setlinecap(_d2_handle, d2_lc_butt); - result = d2_setlinejoin(_d2_handle, d2_lj_miter); - - /* set blocksize for default displaylist */ - result = d2_setdlistblocksize(_d2_handle, 25); - if(D2_OK != result) { - LV_LOG_ERROR("Could NOT d2_setdlistblocksize"); - d2_closedevice(_d2_handle); - return result; - } - - _blit_renderbuffer = d2_newrenderbuffer(_d2_handle, 20, 20); - if(!_blit_renderbuffer) { - LV_LOG_ERROR("NO renderbuffer"); - d2_closedevice(_d2_handle); - - return D2_NOMEMORY; - } - - _renderbuffer = d2_newrenderbuffer(_d2_handle, 20, 20); - if(!_renderbuffer) { - LV_LOG_ERROR("NO renderbuffer"); - d2_closedevice(_d2_handle); - - return D2_NOMEMORY; - } - - result = d2_selectrenderbuffer(_d2_handle, _renderbuffer); - if(D2_OK != result) { - LV_LOG_ERROR("Could NOT d2_selectrenderbuffer"); - d2_closedevice(_d2_handle); - } - - return result; -} - -void dave2d_execute_dlist_and_flush(void) -{ -#if LV_USE_OS - lv_result_t status; - - status = lv_mutex_lock(&xd2Semaphore); - LV_ASSERT(LV_RESULT_OK == status); -#endif - - d2_s32 result; - lv_draw_task_t ** p_list_entry; - lv_draw_task_t * p_list_entry1; - - // Execute render operations - result = d2_executerenderbuffer(_d2_handle, _renderbuffer, 0); - LV_ASSERT(D2_OK == result); - - result = d2_flushframe(_d2_handle); - LV_ASSERT(D2_OK == result); - - result = d2_selectrenderbuffer(_d2_handle, _renderbuffer); - LV_ASSERT(D2_OK == result); - - while(false == lv_ll_is_empty(&_ll_Dave2D_Tasks)) { - p_list_entry = lv_ll_get_tail(&_ll_Dave2D_Tasks); - p_list_entry1 = *p_list_entry; - p_list_entry1->state = LV_DRAW_TASK_STATE_READY; - lv_ll_remove(&_ll_Dave2D_Tasks, p_list_entry); - lv_free(p_list_entry); - } - -#if LV_USE_OS - status = lv_mutex_unlock(&xd2Semaphore); - LV_ASSERT(LV_RESULT_OK == status); -#endif -} - -#endif /*LV_USE_DRAW_DAVE2D*/ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d.h b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d.h deleted file mode 100644 index 2deaeb4..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @file lv_draw_dave2d.h - * - */ - -#ifndef LV_DRAW_DAVE2D_H -#define LV_DRAW_DAVE2D_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../../lv_conf_internal.h" -#if LV_USE_DRAW_DAVE2D -#include "../../lv_draw.h" -#include "../../lv_draw_private.h" -#include "hal_data.h" -#include "lv_draw_dave2d_utils.h" -#include "../../lv_draw_rect.h" -#include "../../lv_draw_line.h" -#include "../../lv_draw_arc.h" -#include "../../lv_draw_label.h" -#include "../../lv_draw_image.h" -#include "../../lv_draw_triangle.h" -#include "../../lv_draw_buf.h" - -/********************* - * DEFINES - *********************/ - -#define D2_RENDER_EACH_OPERATION (1) - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - lv_draw_unit_t base_unit; - lv_draw_task_t * task_act; -#if LV_USE_OS - lv_thread_sync_t sync; - lv_thread_t thread; -#endif - uint32_t idx; - d2_device * d2_handle; - d2_renderbuffer * renderbuffer; -#if LV_USE_OS - lv_mutex_t * pd2Mutex; -#endif -} lv_draw_dave2d_unit_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_draw_dave2d_init(void); - -void lv_draw_dave2d_image(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords); - -void lv_draw_dave2d_fill(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc, const lv_area_t * coords); - -void lv_draw_dave2d_border(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_border_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_dave2d_box_shadow(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_box_shadow_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_dave2d_label(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc, const lv_area_t * coords); - -void lv_draw_dave2d_arc(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, const lv_area_t * coords); - -void lv_draw_dave2d_line(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc); - -void lv_draw_dave2d_layer(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords); - -void lv_draw_dave2d_triangle(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_triangle_dsc_t * dsc); - -void lv_draw_dave2d_mask_rect(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_mask_rect_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_dave2d_transform(lv_draw_dave2d_unit_t * draw_unit, const lv_area_t * dest_area, const void * src_buf, - int32_t src_w, int32_t src_h, int32_t src_stride, - const lv_draw_image_dsc_t * draw_dsc, const lv_draw_image_sup_t * sup, lv_color_format_t cf, void * dest_buf); - -/*********************** - * GLOBAL VARIABLES - ***********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_DAVE2D*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_USE_DRAW_DAVE2D*/ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_arc.c b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_arc.c deleted file mode 100644 index 71e03af..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_arc.c +++ /dev/null @@ -1,188 +0,0 @@ -#include "lv_draw_dave2d.h" -#if LV_USE_DRAW_DAVE2D - -#include "../../../misc/lv_area_private.h" - -void lv_draw_dave2d_arc(lv_draw_dave2d_unit_t * u, const lv_draw_arc_dsc_t * dsc, const lv_area_t * coords) -{ - - uint32_t flags = 0; - int32_t sin_start; - int32_t cos_start; - int32_t sin_end; - int32_t cos_end; - d2_s32 result; - lv_area_t clipped_area; - lv_area_t buffer_area; - lv_point_t arc_centre; - int32_t x; - int32_t y; - - if(!lv_area_intersect(&clipped_area, coords, u->base_unit.clip_area)) return; - - x = 0 - u->base_unit.target_layer->buf_area.x1; - y = 0 - u->base_unit.target_layer->buf_area.y1; - - buffer_area = u->base_unit.target_layer->buf_area; - - arc_centre = dsc->center; - arc_centre.x = arc_centre.x - buffer_area.x1; - arc_centre.y = arc_centre.y - buffer_area.y1; - - lv_area_move(&clipped_area, x, y); - lv_area_move(&buffer_area, x, y); - - // - // If both angles are equal (e.g. 0 and 0 or 180 and 180) nothing has to be done - // - if(dsc->start_angle == dsc->end_angle) { - return; // Nothing to do, no angle - no arc - } - -#if LV_USE_OS - lv_result_t status; - status = lv_mutex_lock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - -#if D2_RENDER_EACH_OPERATION - d2_selectrenderbuffer(u->d2_handle, u->renderbuffer); -#endif - - // - // Generate render operations - // - d2_framebuffer_from_layer(u->d2_handle, u->base_unit.target_layer); - - d2_setalpha(u->d2_handle, dsc->opa); - - d2_setcolor(u->d2_handle, 0, lv_draw_dave2d_lv_colour_to_d2_colour(dsc->color)); - - result = d2_cliprect(u->d2_handle, (d2_border)clipped_area.x1, (d2_border)clipped_area.y1, (d2_border)clipped_area.x2, - (d2_border)clipped_area.y2); - LV_ASSERT(D2_OK == result); - - if(360 <= LV_ABS(dsc->start_angle - dsc->end_angle)) { - d2_rendercircle(u->d2_handle, - (d2_point)D2_FIX4(arc_centre.x), - (d2_point) D2_FIX4(arc_centre.y), - (d2_width) D2_FIX4(dsc->radius - dsc->width / 2), - (d2_width) D2_FIX4(dsc->width)); - } - else { //An ARC, not a full circle - // - // If the difference between both is larger than 180 degrees we must use the concave flag - // - /** Set d2_wf_concave flag if the pie object to draw is concave shape. */ - if((LV_ABS(dsc->start_angle - dsc->end_angle) > 180) || ((dsc->end_angle < dsc->start_angle) && - (LV_ABS(dsc->start_angle - (dsc->end_angle + 360)) > 180))) { - flags = d2_wf_concave; - } - else { - flags = 0; - } - - sin_start = lv_trigo_sin((int16_t)dsc->start_angle); - cos_start = lv_trigo_cos((int16_t)dsc->start_angle); - - sin_end = lv_trigo_sin((int16_t)dsc->end_angle); - cos_end = lv_trigo_cos((int16_t)dsc->end_angle); - - bool draw_arc; - lv_area_t arc_area; - lv_area_t clip_arc; - lv_point_t start_point; - lv_point_t end_point; - - start_point.x = arc_centre.x + (int16_t)(((dsc->radius) * cos_start) >> LV_TRIGO_SHIFT); - start_point.y = arc_centre.y + (int16_t)(((dsc->radius) * sin_start) >> LV_TRIGO_SHIFT); - - end_point.x = arc_centre.x + (int16_t)(((dsc->radius) * cos_end) >> LV_TRIGO_SHIFT); - end_point.y = arc_centre.y + (int16_t)(((dsc->radius) * sin_end) >> LV_TRIGO_SHIFT); - - arc_area.x1 = LV_MIN3(start_point.x, end_point.x, arc_centre.x); - arc_area.y1 = LV_MIN3(start_point.y, end_point.y, arc_centre.y); - - arc_area.x2 = LV_MAX3(start_point.x, end_point.x, arc_centre.x); - arc_area.y2 = LV_MAX3(start_point.y, end_point.y, arc_centre.y); - - /* 0 degrees */ - if((dsc->end_angle < dsc->start_angle) || ((dsc->start_angle < 360) && (dsc->end_angle > 360))) { - arc_area.x2 = arc_centre.x + dsc->radius; - } - - /* 90 degrees */ - if(((dsc->end_angle > 90) && (dsc->start_angle < 90)) || ((dsc->start_angle < 90) && - (dsc->end_angle < dsc->start_angle))) { - arc_area.y2 = arc_centre.y + dsc->radius; - } - - /* 180 degrees */ - if(((dsc->end_angle > 180) && (dsc->start_angle < 180)) || ((dsc->start_angle < 180) && - (dsc->end_angle < dsc->start_angle))) { - arc_area.x1 = arc_centre.x - dsc->radius; - } - - /* 270 degrees */ - if(((dsc->end_angle > 270) && (dsc->start_angle < 270)) || ((dsc->start_angle < 270) && - (dsc->end_angle < dsc->start_angle))) { - arc_area.y1 = arc_centre.y - dsc->radius; - } - - draw_arc = lv_area_intersect(&clip_arc, &arc_area, &clipped_area); - - if(draw_arc) { - - result = d2_renderwedge(u->d2_handle, - (d2_point)D2_FIX4(arc_centre.x), - (d2_point) D2_FIX4(arc_centre.y), - (d2_width) D2_FIX4(dsc->radius - dsc->width / 2), - (d2_width) D2_FIX4(dsc->width), - -(d2_s32)(sin_start << 1), - (d2_s32)(cos_start << 1), - (d2_s32)(sin_end << 1), - -(d2_s32)(cos_end << 1), - flags); - LV_ASSERT(D2_OK == result); - - if(dsc->rounded) { - lv_point_t start_coord; - lv_point_t end_coord; - - start_coord.x = arc_centre.x + (int16_t)(((dsc->radius - dsc->width / 2) * cos_start) >> LV_TRIGO_SHIFT); - start_coord.y = arc_centre.y + (int16_t)(((dsc->radius - dsc->width / 2) * sin_start) >> LV_TRIGO_SHIFT); - - /** Render a circle. */ - d2_rendercircle(u->d2_handle, - (d2_point) D2_FIX4((uint16_t)(start_coord.x)), - (d2_point) D2_FIX4((uint16_t)(start_coord.y)), - (d2_width) D2_FIX4(dsc->width / 2), 0); - - end_coord.x = arc_centre.x + (int16_t)(((dsc->radius - dsc->width / 2) * cos_end) >> LV_TRIGO_SHIFT); - end_coord.y = arc_centre.y + (int16_t)(((dsc->radius - dsc->width / 2) * sin_end) >> LV_TRIGO_SHIFT); - - /** Render a circle. */ - d2_rendercircle(u->d2_handle, - (d2_point) D2_FIX4((uint16_t)(end_coord.x)), - (d2_point) D2_FIX4((uint16_t)(end_coord.y)), - (d2_width) D2_FIX4(dsc->width / 2), 0); - } - } - } - - // - // Execute render operations - // - -#if D2_RENDER_EACH_OPERATION - d2_executerenderbuffer(u->d2_handle, u->renderbuffer, 0); - d2_flushframe(u->d2_handle); -#endif - -#if LV_USE_OS - status = lv_mutex_unlock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif -} - -#endif /*LV_USE_DRAW_DAVE2D*/ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_border.c b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_border.c deleted file mode 100644 index e402e7f..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_border.c +++ /dev/null @@ -1,417 +0,0 @@ -#include "lv_draw_dave2d.h" -#if LV_USE_DRAW_DAVE2D - -#include "../../../misc/lv_area_private.h" - -static void dave2d_draw_border_complex(lv_draw_dave2d_unit_t * draw_unit, const lv_area_t * outer_area, - const lv_area_t * inner_area, - int32_t rout, int32_t rin, lv_color_t color, lv_opa_t opa); - -static void dave2d_draw_border_simple(lv_draw_dave2d_unit_t * draw_unit, const lv_area_t * outer_area, - const lv_area_t * inner_area, - lv_color_t color, lv_opa_t opa); - -void lv_draw_dave2d_border(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_border_dsc_t * dsc, - const lv_area_t * coords) -{ - if(dsc->opa <= LV_OPA_MIN) return; - if(dsc->width == 0) return; - if(dsc->side == LV_BORDER_SIDE_NONE) return; - - int32_t coords_w = lv_area_get_width(coords); - int32_t coords_h = lv_area_get_height(coords); - int32_t rout = dsc->radius; - int32_t short_side = LV_MIN(coords_w, coords_h); - if(rout > short_side >> 1) rout = short_side >> 1; - - /*Get the inner area*/ - lv_area_t area_inner; - lv_area_copy(&area_inner, coords); - area_inner.x1 += ((dsc->side & LV_BORDER_SIDE_LEFT) ? dsc->width : - (dsc->width + rout)); - area_inner.x2 -= ((dsc->side & LV_BORDER_SIDE_RIGHT) ? dsc->width : - (dsc->width + rout)); - area_inner.y1 += ((dsc->side & LV_BORDER_SIDE_TOP) ? dsc->width : - (dsc->width + rout)); - area_inner.y2 -= ((dsc->side & LV_BORDER_SIDE_BOTTOM) ? dsc->width : - (dsc->width + rout)); - - int32_t rin = rout - dsc->width; - if(rin < 0) rin = 0; - - if(rout == 0 && rin == 0) { - dave2d_draw_border_simple(draw_unit, coords, &area_inner, dsc->color, dsc->opa); - } - else { - dave2d_draw_border_complex(draw_unit, coords, &area_inner, rout, rin, dsc->color, dsc->opa); - } - -} - -static void dave2d_draw_border_simple(lv_draw_dave2d_unit_t * u, const lv_area_t * outer_area, - const lv_area_t * inner_area, - lv_color_t color, lv_opa_t opa) - -{ - - lv_area_t clip_area; - lv_area_t local_outer_area; - lv_area_t local_inner_area; - int32_t x; - int32_t y; - bool is_common; - - is_common = lv_area_intersect(&clip_area, outer_area, u->base_unit.clip_area); - if(!is_common) return; - -#if LV_USE_OS - lv_result_t status; - status = lv_mutex_lock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - - local_outer_area = *outer_area; - local_inner_area = *inner_area; - - x = 0 - u->base_unit.target_layer->buf_area.x1; - y = 0 - u->base_unit.target_layer->buf_area.y1; - - lv_area_move(&clip_area, x, y); - lv_area_move(&local_outer_area, x, y); - lv_area_move(&local_inner_area, x, y); - -#if D2_RENDER_EACH_OPERATION - d2_selectrenderbuffer(u->d2_handle, u->renderbuffer); -#endif - // - // Generate render operations - // - - d2_framebuffer_from_layer(u->d2_handle, u->base_unit.target_layer); - - d2_setcolor(u->d2_handle, 0, lv_draw_dave2d_lv_colour_to_d2_colour(color)); - d2_setalpha(u->d2_handle, opa); - d2_cliprect(u->d2_handle, (d2_border)clip_area.x1, (d2_border)clip_area.y1, (d2_border)clip_area.x2, - (d2_border)clip_area.y2); - - lv_area_t a; - - bool top_side = local_outer_area.y1 <= local_inner_area.y1; - bool bottom_side = local_outer_area.y2 >= local_inner_area.y2; - bool left_side = local_outer_area.x1 <= local_inner_area.x1; - bool right_side = local_outer_area.x2 >= local_inner_area.x2; - - /*Top*/ - a.x1 = local_outer_area.x1; - a.x2 = local_outer_area.x2; - a.y1 = local_outer_area.y1; - a.y2 = local_inner_area.y1 - 1; - if(top_side) { - d2_renderbox(u->d2_handle, (d2_point)D2_FIX4(a.x1), - (d2_point)D2_FIX4(a.y1), - (d2_point)D2_FIX4(lv_area_get_width(&a)), - (d2_point)D2_FIX4(lv_area_get_height(&a))); - } - - /*Bottom*/ - a.y1 = local_inner_area.y2 + 1; - a.y2 = local_outer_area.y2; - if(bottom_side) { - d2_renderbox(u->d2_handle, (d2_point)D2_FIX4(a.x1), - (d2_point)D2_FIX4(a.y1), - (d2_point)D2_FIX4(lv_area_get_width(&a)), - (d2_point)D2_FIX4(lv_area_get_height(&a))); - } - - /*Left*/ - a.x1 = local_outer_area.x1; - a.x2 = local_inner_area.x1 - 1; - a.y1 = (top_side) ? local_inner_area.y1 : local_outer_area.y1; - a.y2 = (bottom_side) ? local_inner_area.y2 : local_outer_area.y2; - if(left_side) { - d2_renderbox(u->d2_handle, (d2_point)D2_FIX4(a.x1), - (d2_point)D2_FIX4(a.y1), - (d2_point)D2_FIX4(lv_area_get_width(&a)), - (d2_point)D2_FIX4(lv_area_get_height(&a))); - } - - /*Right*/ - a.x1 = local_inner_area.x2 + 1; - a.x2 = local_outer_area.x2; - if(right_side) { - d2_renderbox(u->d2_handle, (d2_point)D2_FIX4(a.x1), - (d2_point)D2_FIX4(a.y1), - (d2_point)D2_FIX4(lv_area_get_width(&a)), - (d2_point)D2_FIX4(lv_area_get_height(&a))); - } - - // - // Execute render operations - // -#if D2_RENDER_EACH_OPERATION - d2_executerenderbuffer(u->d2_handle, u->renderbuffer, 0); - d2_flushframe(u->d2_handle); -#endif - -#if LV_USE_OS - status = lv_mutex_unlock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif -} - -static void dave2d_draw_border_complex(lv_draw_dave2d_unit_t * u, const lv_area_t * orig_outer_area, - const lv_area_t * orig_inner_area, - int32_t rout, int32_t rin, lv_color_t color, lv_opa_t opa) -{ - /*Get clipped draw area which is the real draw area. - *It is always the same or inside `coords`*/ - lv_area_t draw_area; - lv_area_t outer_area; - lv_area_t inner_area; - int32_t x; - int32_t y; - d2_s32 result; - d2_u32 flags = 0; - - outer_area = *orig_outer_area; - inner_area = *orig_inner_area; - - if(!lv_area_intersect(&draw_area, &outer_area, u->base_unit.clip_area)) return; - -#if LV_USE_OS - lv_result_t status; - status = lv_mutex_lock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - - x = 0 - u->base_unit.target_layer->buf_area.x1; - y = 0 - u->base_unit.target_layer->buf_area.y1; - - lv_area_move(&draw_area, x, y); - lv_area_move(&outer_area, x, y); - lv_area_move(&inner_area, x, y); - -#if D2_RENDER_EACH_OPERATION - d2_selectrenderbuffer(u->d2_handle, u->renderbuffer); -#endif - // - // Generate render operations - // - - d2_framebuffer_from_layer(u->d2_handle, u->base_unit.target_layer); - - d2_setcolor(u->d2_handle, 0, lv_draw_dave2d_lv_colour_to_d2_colour(color)); - d2_setalpha(u->d2_handle, opa); - d2_cliprect(u->d2_handle, (d2_border)draw_area.x1, (d2_border)draw_area.y1, (d2_border)draw_area.x2, - (d2_border)draw_area.y2); - - lv_area_t blend_area; - /*Calculate the x and y coordinates where the straight parts area are */ - lv_area_t core_area; - core_area.x1 = LV_MAX(outer_area.x1 + rout, inner_area.x1); - core_area.x2 = LV_MIN(outer_area.x2 - rout, inner_area.x2); - core_area.y1 = LV_MAX(outer_area.y1 + rout, inner_area.y1); - core_area.y2 = LV_MIN(outer_area.y2 - rout, inner_area.y2); - - bool top_side = outer_area.y1 <= inner_area.y1; - bool bottom_side = outer_area.y2 >= inner_area.y2; - - /*No masks*/ - bool left_side = outer_area.x1 <= inner_area.x1; - bool right_side = outer_area.x2 >= inner_area.x2; - - /*Draw the straight lines first */ - if(top_side) { - blend_area.x1 = core_area.x1; - blend_area.x2 = core_area.x2; - blend_area.y1 = outer_area.y1; - blend_area.y2 = inner_area.y1 - 1; - d2_renderbox(u->d2_handle, - (d2_point)D2_FIX4(blend_area.x1), - (d2_point)D2_FIX4(blend_area.y1), - (d2_point)D2_FIX4(lv_area_get_width(&blend_area)), - (d2_point)D2_FIX4(lv_area_get_height(&blend_area))); - } - - if(bottom_side) { - blend_area.x1 = core_area.x1; - blend_area.x2 = core_area.x2; - blend_area.y1 = inner_area.y2 + 1; - blend_area.y2 = outer_area.y2; - d2_renderbox(u->d2_handle, - (d2_point)D2_FIX4(blend_area.x1), - (d2_point)D2_FIX4(blend_area.y1), - (d2_point)D2_FIX4(lv_area_get_width(&blend_area)), - (d2_point)D2_FIX4(lv_area_get_height(&blend_area))); - } - - if(left_side) { - blend_area.x1 = outer_area.x1; - blend_area.x2 = inner_area.x1 - 1; - blend_area.y1 = core_area.y1; - blend_area.y2 = core_area.y2; - d2_renderbox(u->d2_handle, - (d2_point)D2_FIX4(blend_area.x1), - (d2_point)D2_FIX4(blend_area.y1), - (d2_point)D2_FIX4(lv_area_get_width(&blend_area)), - (d2_point)D2_FIX4(lv_area_get_height(&blend_area))); - } - - if(right_side) { - blend_area.x1 = inner_area.x2 + 1; - blend_area.x2 = outer_area.x2; - blend_area.y1 = core_area.y1; - blend_area.y2 = core_area.y2; - d2_renderbox(u->d2_handle, - (d2_point)D2_FIX4(blend_area.x1), - (d2_point)D2_FIX4(blend_area.y1), - (d2_point)D2_FIX4(lv_area_get_width(&blend_area)), - (d2_point)D2_FIX4(lv_area_get_height(&blend_area))); - } - - /*Draw the corners*/ - int32_t blend_w; - /*Left corners*/ - blend_area.x1 = draw_area.x1; - blend_area.x2 = LV_MIN(draw_area.x2, core_area.x1 - 1); - - blend_w = lv_area_get_width(&blend_area); - - if(blend_w > 0) { - d2_s32 aa; - aa = d2_getantialiasing(u->d2_handle); - d2_setantialiasing(u->d2_handle, 0); //Don't blend with the background according to coverage value - - if(left_side || top_side) { - lv_area_t arc_area; - lv_area_t clip_arc; - - arc_area.x1 = core_area.x1 - rout; - arc_area.y1 = core_area.y1 - rout; - arc_area.x2 = core_area.x1; - arc_area.y2 = core_area.y1; - - if(lv_area_intersect(&clip_arc, &arc_area, &draw_area)) { - d2_cliprect(u->d2_handle, (d2_border)clip_arc.x1, (d2_border)clip_arc.y1, (d2_border)clip_arc.x2, - (d2_border)clip_arc.y2); - result = d2_renderwedge(u->d2_handle, - (d2_point)D2_FIX4(core_area.x1), - (d2_point) D2_FIX4(core_area.y1), - (d2_width) D2_FIX4(rout), - (d2_width) D2_FIX4((rout - rin)), - (d2_s32) D2_FIX16(0), // 180 Degrees - (d2_s32) D2_FIX16((int16_t) -1), - (d2_s32) D2_FIX16((int16_t) -1),//( 270 Degrees - (d2_s32) D2_FIX16(0), - flags); - LV_ASSERT(D2_OK == result); - } - - } - - if(left_side || bottom_side) { - lv_area_t arc_area; - lv_area_t clip_arc; - - arc_area.x1 = core_area.x1 - rout; - arc_area.y1 = core_area.y2; - arc_area.x2 = core_area.x1; - arc_area.y2 = core_area.y2 + rout; - - if(lv_area_intersect(&clip_arc, &arc_area, &draw_area)) { - - d2_cliprect(u->d2_handle, (d2_border)clip_arc.x1, (d2_border)clip_arc.y1, (d2_border)clip_arc.x2, - (d2_border)clip_arc.y2); - result = d2_renderwedge(u->d2_handle, - (d2_point)D2_FIX4(core_area.x1), - (d2_point) D2_FIX4(core_area.y2), - (d2_width) D2_FIX4(rout), - (d2_width) D2_FIX4((rout - rin)), - (d2_s32) D2_FIX16((int16_t) -1), //90 degrees - (d2_s32) D2_FIX16(0), - (d2_s32) D2_FIX16(0), //180 degrees - (d2_s32) D2_FIX16(1), - flags); - LV_ASSERT(D2_OK == result); - } - } - - /*Right corners*/ - blend_area.x1 = LV_MAX(draw_area.x1, blend_area.x2 + 1); /*To not overlap with the left side*/ - blend_area.x1 = LV_MAX(draw_area.x1, core_area.x2 + 1); - - blend_area.x2 = draw_area.x2; - blend_w = lv_area_get_width(&blend_area); - - if(blend_w > 0) { - if(right_side || top_side) { - - lv_area_t arc_area; - lv_area_t clip_arc; - - arc_area.x1 = core_area.x2; - arc_area.y1 = core_area.y1 - rout; - arc_area.x2 = core_area.x2 + rout; - arc_area.y2 = core_area.y1; - - if(lv_area_intersect(&clip_arc, &arc_area, &draw_area)) { - - d2_cliprect(u->d2_handle, (d2_border)clip_arc.x1, (d2_border)clip_arc.y1, (d2_border)clip_arc.x2, - (d2_border)clip_arc.y2); - result = d2_renderwedge(u->d2_handle, - (d2_point)D2_FIX4(core_area.x2), - (d2_point) D2_FIX4(core_area.y1), - (d2_width) D2_FIX4(rout), - (d2_width) D2_FIX4((rout - rin)), - (d2_s32) D2_FIX16((int16_t)1), // 270 Degrees - (d2_s32) D2_FIX16(0), - (d2_s32) D2_FIX16(0),// 0 degrees - (d2_s32) D2_FIX16(-1), - flags); - LV_ASSERT(D2_OK == result); - } - - } - - if(right_side || bottom_side) { - lv_area_t arc_area; - lv_area_t clip_arc; - - arc_area.x1 = core_area.x2; - arc_area.y1 = core_area.y2; - arc_area.x2 = core_area.x2 + rout; - arc_area.y2 = core_area.y2 + rout; - - if(lv_area_intersect(&clip_arc, &arc_area, &draw_area)) { - - d2_cliprect(u->d2_handle, (d2_border)clip_arc.x1, (d2_border)clip_arc.y1, (d2_border)clip_arc.x2, - (d2_border)clip_arc.y2); - result = d2_renderwedge(u->d2_handle, - (d2_point)D2_FIX4(core_area.x2), - (d2_point) D2_FIX4(core_area.y2), - (d2_width) D2_FIX4(rout), - (d2_width) D2_FIX4((rout - rin)), - (d2_s32) D2_FIX16(0),// 0 degrees - (d2_s32) D2_FIX16(1), - (d2_s32) D2_FIX16(1),// 90 degrees - (d2_s32) D2_FIX16(0), - flags); - LV_ASSERT(D2_OK == result); - } - } - } - d2_setantialiasing(u->d2_handle, aa); //restore original setting - } - - // - // Execute render operations - // -#if D2_RENDER_EACH_OPERATION - d2_executerenderbuffer(u->d2_handle, u->renderbuffer, 0); - d2_flushframe(u->d2_handle); -#endif - -#if LV_USE_OS - status = lv_mutex_unlock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - -} - -#endif /*LV_USE_DRAW_DAVE2D*/ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_fill.c b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_fill.c deleted file mode 100644 index 546dac3..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_fill.c +++ /dev/null @@ -1,310 +0,0 @@ -#include "lv_draw_dave2d.h" -#if LV_USE_DRAW_DAVE2D - -#include "../../../misc/lv_area_private.h" - -void lv_draw_dave2d_fill(lv_draw_dave2d_unit_t * u, const lv_draw_fill_dsc_t * dsc, const lv_area_t * coords) -{ - lv_area_t draw_area; - lv_area_t coordinates; - bool is_common; - int32_t x; - int32_t y; - d2_u8 current_alpha_mode = 0; - d2_s32 result; - d2_u32 flags = 0; - - lv_point_t arc_centre; - - is_common = lv_area_intersect(&draw_area, coords, u->base_unit.clip_area); - if(!is_common) return; - -#if LV_USE_OS - lv_result_t status; - status = lv_mutex_lock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - - lv_area_copy(&coordinates, coords); - - x = 0 - u->base_unit.target_layer->buf_area.x1; - y = 0 - u->base_unit.target_layer->buf_area.y1; - - lv_area_move(&draw_area, x, y); - lv_area_move(&coordinates, x, y); - - // - // Generate render operations - // -#if D2_RENDER_EACH_OPERATION - d2_selectrenderbuffer(u->d2_handle, u->renderbuffer); -#endif - - d2_framebuffer_from_layer(u->d2_handle, u->base_unit.target_layer); - - if(LV_GRAD_DIR_NONE != dsc->grad.dir) { - float a1; - float a2; - - float y1; - float y2; - - float y3; - float y0; - int16_t y0_i ; - int16_t y3_i ; - - if(LV_GRAD_DIR_VER == dsc->grad.dir) { - a1 = dsc->grad.stops[0].opa; - a2 = dsc->grad.stops[dsc->grad.stops_count - 1].opa; - - y1 = (float)LV_MIN(coordinates.y1, coordinates.y2); - y2 = (float)LV_MAX(coordinates.y1, coordinates.y2); - - if(a1 < a2) { - /* TODO */ - LV_ASSERT(0); - y0 = 0.0f;//silence the compiler warning - y3 = 0.0f; - - } - else { - y0 = y2 - ((y2 - y1) / (a2 - a1) * (a2)); //point where alpha is 0 - y3 = y1 + ((y2 - y1) / (a2 - a1) * (255 - a1)); //point where alpha is 255 - } - - y0_i = (int16_t)y0; - y3_i = (int16_t)y3; - - d2_setalphagradient(u->d2_handle, 0, (d2_point)D2_FIX4(0), (d2_point)D2_FIX4(y0_i), (d2_point)D2_FIX4(0), - (d2_point)D2_FIX4((y3_i - y0_i))); - } - else if(LV_GRAD_DIR_HOR == dsc->grad.dir) { - /* TODO */ - LV_ASSERT(0); - - float x1; - float x2; - - float x3; - float x0; - int16_t x0_i ; - int16_t x3_i ; - - a1 = dsc->grad.stops[0].opa; - a2 = dsc->grad.stops[dsc->grad.stops_count - 1].opa; - - x1 = (float)LV_MIN(coordinates.x1, coordinates.x2); - x2 = (float)LV_MAX(coordinates.x1, coordinates.x2); - - if(a1 < a2) { - /* TODO */ - LV_ASSERT(0); - x0 = 0.0f;//silence the compiler warning - x3 = 0.0f; - - } - else { - x0 = x2 - ((x2 - x1) / (a2 - a1) * (a2)); //point where alpha is 0 - x3 = x1 + ((x2 - x1) / (a2 - a1) * (255 - a1)); //point where alpha is 255 - } - - x0_i = (int16_t)x0; - x3_i = (int16_t)x3; - - d2_setalphagradient(u->d2_handle, 0, (d2_point)D2_FIX4(x0_i), (d2_point)D2_FIX4(0), (d2_point)D2_FIX4(x3_i - x0_i), - (d2_point)D2_FIX4((0))); - } - - current_alpha_mode = d2_getalphamode(u->d2_handle); - d2_setfillmode(u->d2_handle, d2_fm_color); - d2_setcolor(u->d2_handle, 0, lv_draw_dave2d_lv_colour_to_d2_colour(dsc->grad.stops[0].color)); - d2_setalphamode(u->d2_handle, d2_am_gradient1); - } - else { - d2_setfillmode(u->d2_handle, d2_fm_color); //default - d2_setcolor(u->d2_handle, 0, lv_draw_dave2d_lv_colour_to_d2_colour(dsc->color)); - d2_setalpha(u->d2_handle, dsc->opa); - } - - d2_cliprect(u->d2_handle, (d2_border)draw_area.x1, (d2_border)draw_area.y1, (d2_border)draw_area.x2, - (d2_border)draw_area.y2); - - if(dsc->radius == 0) { - - d2_renderbox(u->d2_handle, (d2_point)D2_FIX4(coordinates.x1), - (d2_point)D2_FIX4(coordinates.y1), - (d2_point)D2_FIX4(lv_area_get_width(&coordinates)), - (d2_point)D2_FIX4(lv_area_get_height(&coordinates))); - } - else { - /*Get the real radius. Can't be larger than the half of the shortest side */ - int32_t coords_bg_w = lv_area_get_width(&coordinates); - int32_t coords_bg_h = lv_area_get_height(&coordinates); - int32_t short_side = LV_MIN(coords_bg_w, coords_bg_h); - int32_t radius = LV_MIN(dsc->radius, short_side >> 1); - - arc_centre.x = coordinates.x1 + radius; - arc_centre.y = coordinates.y1 + radius; - - if(((2 * radius) == coords_bg_w) && ((2 * radius) == coords_bg_h)) { - result = d2_rendercircle(u->d2_handle, - (d2_point)D2_FIX4(arc_centre.x), - (d2_point) D2_FIX4(arc_centre.y), - (d2_width) D2_FIX4(radius), - (d2_width) D2_FIX4(0)); - LV_ASSERT(D2_OK == result); - } - else { - - lv_area_t arc_area; - lv_area_t clip_arc; - arc_centre.x = coordinates.x1 + radius; - arc_centre.y = coordinates.y1 + radius; - - arc_area.x1 = coordinates.x1; - arc_area.y1 = coordinates.y1; - arc_area.x2 = coordinates.x1 + radius; - arc_area.y2 = coordinates.y1 + radius; - - if(lv_area_intersect(&clip_arc, &arc_area, &draw_area)) { - - d2_cliprect(u->d2_handle, (d2_border)clip_arc.x1, (d2_border)clip_arc.y1, (d2_border)clip_arc.x2, - (d2_border)clip_arc.y2); - - // d2_renderwedge internally changes the clip rectangle, only draw it if it is in side the current clip rectangle - result = d2_renderwedge(u->d2_handle, - (d2_point)D2_FIX4(arc_centre.x), - (d2_point) D2_FIX4(arc_centre.y), - (d2_width) D2_FIX4(radius), - (d2_width) D2_FIX4(0), - (d2_s32) D2_FIX16(0), // 180 Degrees - (d2_s32) D2_FIX16((int16_t) -1), - (d2_s32) D2_FIX16((int16_t) -1),//( 270 Degrees - (d2_s32) D2_FIX16(0), - flags); - LV_ASSERT(D2_OK == result); - } - - arc_centre.x = coordinates.x2 - radius; - arc_centre.y = coordinates.y1 + radius; - - arc_area.x1 = coordinates.x2 - radius; - arc_area.y1 = coordinates.y1; - arc_area.x2 = coordinates.x2; - arc_area.y2 = coordinates.y1 + radius; - - if(lv_area_intersect(&clip_arc, &arc_area, &draw_area)) { - d2_cliprect(u->d2_handle, (d2_border)clip_arc.x1, (d2_border)clip_arc.y1, (d2_border)clip_arc.x2, - (d2_border)clip_arc.y2); - - result = d2_renderwedge(u->d2_handle, - (d2_point)D2_FIX4(arc_centre.x), - (d2_point) D2_FIX4(arc_centre.y), - (d2_width) D2_FIX4(radius), - (d2_width) D2_FIX4(0), - (d2_s32) D2_FIX16((int16_t)1), // 270 Degrees - (d2_s32) D2_FIX16(0), - (d2_s32) D2_FIX16(0),// 0 degrees - (d2_s32) D2_FIX16(-1), - flags); - LV_ASSERT(D2_OK == result); - } - - arc_centre.x = coordinates.x2 - radius; - arc_centre.y = coordinates.y2 - radius; - - arc_area.x1 = coordinates.x2 - radius; - arc_area.y1 = coordinates.y2 - radius; - arc_area.x2 = coordinates.x2; - arc_area.y2 = coordinates.y2; - - if(lv_area_intersect(&clip_arc, &arc_area, &draw_area)) { - d2_cliprect(u->d2_handle, (d2_border)clip_arc.x1, (d2_border)clip_arc.y1, (d2_border)clip_arc.x2, - (d2_border)clip_arc.y2); - - result = d2_renderwedge(u->d2_handle, - (d2_point)D2_FIX4(arc_centre.x), - (d2_point) D2_FIX4(arc_centre.y), - (d2_width) D2_FIX4(radius), - (d2_width) D2_FIX4(0), - (d2_s32) D2_FIX16(0),// 0 degrees - (d2_s32) D2_FIX16(1), - (d2_s32) D2_FIX16(1),// 90 degrees - (d2_s32) D2_FIX16(0), - flags); - LV_ASSERT(D2_OK == result); - } - - arc_centre.x = coordinates.x1 + radius; - arc_centre.y = coordinates.y2 - radius; - - arc_area.x1 = coordinates.x1; - arc_area.y1 = coordinates.y2 - radius; - arc_area.x2 = coordinates.x1 + radius; - arc_area.y2 = coordinates.y2; - - if(lv_area_intersect(&clip_arc, &arc_area, &draw_area)) { - d2_cliprect(u->d2_handle, (d2_border)clip_arc.x1, (d2_border)clip_arc.y1, (d2_border)clip_arc.x2, - (d2_border)clip_arc.y2); - - result = d2_renderwedge(u->d2_handle, - (d2_point)D2_FIX4(arc_centre.x), - (d2_point) D2_FIX4(arc_centre.y), - (d2_width) D2_FIX4(radius), - (d2_width) D2_FIX4(0), - (d2_s32) D2_FIX16((int16_t) -1), //90 degrees - (d2_s32) D2_FIX16(0), - (d2_s32) D2_FIX16(0), //180 degrees - (d2_s32) D2_FIX16(1), - flags); - LV_ASSERT(D2_OK == result); - } - - /* reset the clip rectangle */ - d2_cliprect(u->d2_handle, (d2_border)draw_area.x1, (d2_border)draw_area.y1, (d2_border)draw_area.x2, - (d2_border)draw_area.y2); - - result = d2_renderbox(u->d2_handle, - (d2_width)D2_FIX4(coordinates.x1 + radius), - (d2_width)D2_FIX4(coordinates.y1), - (d2_width)D2_FIX4(lv_area_get_width(&coordinates) - (2 * radius)), - (d2_width)D2_FIX4(lv_area_get_height(&coordinates))); - LV_ASSERT(D2_OK == result); - - result = d2_renderbox(u->d2_handle, - (d2_width)D2_FIX4(coordinates.x1), - (d2_width)D2_FIX4(coordinates.y1 + radius), - (d2_width)D2_FIX4(radius), - (d2_width)D2_FIX4(lv_area_get_height(&coordinates) - (2 * radius))); - LV_ASSERT(D2_OK == result); - - result = d2_renderbox(u->d2_handle, - (d2_width)D2_FIX4(coordinates.x2 - radius), - (d2_width)D2_FIX4(coordinates.y1 + radius), - (d2_width)D2_FIX4(radius), - (d2_width)D2_FIX4(lv_area_get_height(&coordinates) - (2 * radius))); - LV_ASSERT(D2_OK == result); - } - } - - // - // Execute render operations - // -#if D2_RENDER_EACH_OPERATION - d2_executerenderbuffer(u->d2_handle, u->renderbuffer, 0); - d2_flushframe(u->d2_handle); -#endif - - if(LV_GRAD_DIR_NONE != dsc->grad.dir) { - d2_setalphamode(u->d2_handle, current_alpha_mode); - d2_setfillmode(u->d2_handle, d2_fm_color); //default - } - -#if LV_USE_OS - status = lv_mutex_unlock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif -} - -#endif /*LV_USE_DRAW_DAVE2D*/ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_image.c b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_image.c deleted file mode 100644 index ee24380..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_image.c +++ /dev/null @@ -1,328 +0,0 @@ -/** - * @file lv_draw_dave2d_image.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_dave2d.h" -#if LV_USE_DRAW_DAVE2D - -#include "../../lv_image_decoder_private.h" -#include "../../lv_draw_image_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void img_draw_core(lv_draw_unit_t * u_base, const lv_draw_image_dsc_t * draw_dsc, - const lv_image_decoder_dsc_t * decoder_dsc, lv_draw_image_sup_t * sup, - const lv_area_t * img_coords, const lv_area_t * clipped_img_area); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_dave2d_image(lv_draw_dave2d_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords) -{ - if(!draw_dsc->tile) { - lv_draw_image_normal_helper((lv_draw_unit_t *)draw_unit, draw_dsc, coords, img_draw_core); - } - else { - lv_draw_image_tiled_helper((lv_draw_unit_t *)draw_unit, draw_dsc, coords, img_draw_core); - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void img_draw_core(lv_draw_unit_t * u_base, const lv_draw_image_dsc_t * draw_dsc, - const lv_image_decoder_dsc_t * decoder_dsc, lv_draw_image_sup_t * sup, - const lv_area_t * img_coords, const lv_area_t * clipped_img_area) -{ - - lv_draw_dave2d_unit_t * u = (lv_draw_dave2d_unit_t *)u_base; - - (void)sup; //remove warning about unused parameter - - bool transformed = draw_dsc->rotation != 0 || draw_dsc->scale_x != LV_SCALE_NONE || - draw_dsc->scale_y != LV_SCALE_NONE ? true : false; - - const lv_draw_buf_t * decoded = decoder_dsc->decoded; - const uint8_t * src_buf = decoded->data; - const lv_image_header_t * header = &decoded->header; - uint32_t img_stride = decoded->header.stride; - lv_color_format_t cf = decoded->header.cf; - lv_area_t buffer_area; - lv_area_t draw_area; - lv_area_t clipped_area; - int32_t x; - int32_t y; - d2_u8 a_texture_op = d2_to_one; - d2_u8 r_texture_op = d2_to_copy; - d2_u8 g_texture_op = d2_to_copy; - d2_u8 b_texture_op = d2_to_copy; - d2_u8 current_fill_mode; - d2_u32 src_blend_mode; - d2_u32 dst_blend_mode; - void * p_intermediate_buf = NULL; - -#if LV_USE_OS - lv_result_t status; - status = lv_mutex_lock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - - buffer_area = u->base_unit.target_layer->buf_area; - draw_area = *img_coords; - clipped_area = *clipped_img_area; - - x = 0 - u->base_unit.target_layer->buf_area.x1; - y = 0 - u->base_unit.target_layer->buf_area.y1; - - lv_area_move(&draw_area, x, y); - lv_area_move(&buffer_area, x, y); - lv_area_move(&clipped_area, x, y); - - /* Generate render operations*/ -#if D2_RENDER_EACH_OPERATION - d2_selectrenderbuffer(u->d2_handle, u->renderbuffer); -#endif - - current_fill_mode = d2_getfillmode(u->d2_handle); - a_texture_op = d2_gettextureoperationa(u->d2_handle); - r_texture_op = d2_gettextureoperationr(u->d2_handle); - g_texture_op = d2_gettextureoperationg(u->d2_handle); - b_texture_op = d2_gettextureoperationb(u->d2_handle); - src_blend_mode = d2_getblendmodesrc(u->d2_handle); - dst_blend_mode = d2_getblendmodedst(u->d2_handle); - -#if defined(RENESAS_CORTEX_M85) -#if (BSP_CFG_DCACHE_ENABLED) - d1_cacheblockflush(u->d2_handle, 0, src_buf, - img_stride * header->h); //Stride is in bytes, not pixels/texels -#endif -#endif - - if(LV_COLOR_FORMAT_RGB565A8 == cf) { - - lv_point_t p1[4] = { //Points in clockwise order - {0, 0}, - {header->w - 1, 0}, - {header->w - 1, header->h - 1}, - {0, header->h - 1}, - }; - - d2_s32 dxu1 = D2_FIX16(1); - d2_s32 dxv1 = D2_FIX16(0); - d2_s32 dyu1 = D2_FIX16(0); - d2_s32 dyv1 = D2_FIX16(1); - - uint32_t size = header->h * (header->w * lv_color_format_get_size(LV_COLOR_FORMAT_ARGB8888)); - p_intermediate_buf = lv_malloc(size); - - d2_framebuffer(u->d2_handle, - p_intermediate_buf, - (d2_s32)header->w, - (d2_u32)header->w, - (d2_u32)header->h, - lv_draw_dave2d_lv_colour_fmt_to_d2_fmt(LV_COLOR_FORMAT_ARGB8888)); - - d2_cliprect(u->d2_handle, (d2_border)0, (d2_border)0, (d2_border)header->w - 1, - (d2_border)header->h - 1); - - d2_settexopparam(u->d2_handle, d2_cc_alpha, draw_dsc->opa, 0); - - d2_settextureoperation(u->d2_handle, d2_to_replace, d2_to_copy, d2_to_copy, d2_to_copy); - - d2_settexturemapping(u->d2_handle, D2_FIX4(p1[0].x), D2_FIX4(p1[0].y), D2_FIX16(0), D2_FIX16(0), dxu1, dxv1, dyu1, - dyv1); - d2_settexturemode(u->d2_handle, d2_tm_filter); - d2_setfillmode(u->d2_handle, d2_fm_texture); - - d2_settexture(u->d2_handle, (void *)src_buf, - (d2_s32)(img_stride / lv_color_format_get_size(LV_COLOR_FORMAT_RGB565)), - header->w, header->h, lv_draw_dave2d_lv_colour_fmt_to_d2_fmt(LV_COLOR_FORMAT_RGB565)); - - d2_setblendmode(u->d2_handle, d2_bm_one, d2_bm_zero); - - d2_renderquad(u->d2_handle, - (d2_point)D2_FIX4(p1[0].x), - (d2_point)D2_FIX4(p1[0].y), - (d2_point)D2_FIX4(p1[1].x), - (d2_point)D2_FIX4(p1[1].y), - (d2_point)D2_FIX4(p1[2].x), - (d2_point)D2_FIX4(p1[2].y), - (d2_point)D2_FIX4(p1[3].x), - (d2_point)D2_FIX4(p1[3].y), - 0); - - d2_setblendmode(u->d2_handle, d2_bm_zero, d2_bm_one); //Keep the RGB data in the intermediate buffer - - d2_setalphablendmode(u->d2_handle, d2_bm_one, d2_bm_zero); //Write SRC alpha, i.e. A8 data - - d2_settextureoperation(u->d2_handle, d2_to_copy, d2_to_copy, d2_to_copy, d2_to_copy); - - d2_settexture(u->d2_handle, (void *)(src_buf + header->h * (header->w * lv_color_format_get_size( - LV_COLOR_FORMAT_RGB565))), - (d2_s32)(img_stride / lv_color_format_get_size(LV_COLOR_FORMAT_RGB565)), - header->w, header->h, lv_draw_dave2d_lv_colour_fmt_to_d2_fmt(LV_COLOR_FORMAT_A8)); - - d2_renderquad(u->d2_handle, - (d2_point)D2_FIX4(p1[0].x), - (d2_point)D2_FIX4(p1[0].y), - (d2_point)D2_FIX4(p1[1].x), - (d2_point)D2_FIX4(p1[1].y), - (d2_point)D2_FIX4(p1[2].x), - (d2_point)D2_FIX4(p1[2].y), - (d2_point)D2_FIX4(p1[3].x), - (d2_point)D2_FIX4(p1[3].y), - 0); - - cf = LV_COLOR_FORMAT_ARGB8888; - src_buf = p_intermediate_buf; - img_stride = header->w * lv_color_format_get_size(cf); - - } - - d2_framebuffer_from_layer(u->d2_handle, u->base_unit.target_layer); - - d2_cliprect(u->d2_handle, (d2_border)clipped_area.x1, (d2_border)clipped_area.y1, (d2_border)clipped_area.x2, - (d2_border)clipped_area.y2); - - d2_settexopparam(u->d2_handle, d2_cc_alpha, draw_dsc->opa, 0); - - if(LV_COLOR_FORMAT_RGB565 == cf) { - d2_settextureoperation(u->d2_handle, d2_to_replace, d2_to_copy, d2_to_copy, d2_to_copy); - } - else { //Formats with an alpha channel, - d2_settextureoperation(u->d2_handle, d2_to_copy, d2_to_copy, d2_to_copy, d2_to_copy); - } - - if(LV_BLEND_MODE_NORMAL == draw_dsc->blend_mode) { /**< Simply mix according to the opacity value*/ - d2_setblendmode(u->d2_handle, d2_bm_alpha, d2_bm_one_minus_alpha); //direct linear blend - } - else if(LV_BLEND_MODE_ADDITIVE == draw_dsc->blend_mode) { /**< Add the respective color channels*/ - /* TODO */ - d2_setblendmode(u->d2_handle, d2_bm_alpha, d2_bm_one); //Additive blending - } - else if(LV_BLEND_MODE_SUBTRACTIVE == draw_dsc->blend_mode) { /**< Subtract the foreground from the background*/ - /* TODO */ - } - else { //LV_BLEND_MODE_MULTIPLY, /**< Multiply the foreground and background*/ - /* TODO */ - } - - lv_point_t p[4] = { //Points in clockwise order - {0, 0}, - {header->w - 1, 0}, - {header->w - 1, header->h - 1}, - {0, header->h - 1}, - }; - - d2_settexture(u->d2_handle, (void *)src_buf, - (d2_s32)(img_stride / lv_color_format_get_size(cf)), - header->w, header->h, lv_draw_dave2d_lv_colour_fmt_to_d2_fmt(cf)); - - d2_settexturemode(u->d2_handle, d2_tm_filter); - d2_setfillmode(u->d2_handle, d2_fm_texture); - - d2_s32 dxu = D2_FIX16(1); - d2_s32 dxv = D2_FIX16(0); - d2_s32 dyu = D2_FIX16(0); - d2_s32 dyv = D2_FIX16(1); - - if(transformed) { - lv_point_transform(&p[0], draw_dsc->rotation, draw_dsc->scale_x, draw_dsc->scale_y, &draw_dsc->pivot, true); - lv_point_transform(&p[1], draw_dsc->rotation, draw_dsc->scale_x, draw_dsc->scale_y, &draw_dsc->pivot, true); - lv_point_transform(&p[2], draw_dsc->rotation, draw_dsc->scale_x, draw_dsc->scale_y, &draw_dsc->pivot, true); - lv_point_transform(&p[3], draw_dsc->rotation, draw_dsc->scale_x, draw_dsc->scale_y, &draw_dsc->pivot, true); - - int32_t angle_limited = draw_dsc->rotation; - if(angle_limited > 3600) angle_limited -= 3600; - if(angle_limited < 0) angle_limited += 3600; - - int32_t angle_low = angle_limited / 10; - - if(0 != angle_low) { - /* LV_TRIGO_SHIFT is 15, so only need to shift by 1 to get 16:16 fixed point */ - dxv = (d2_s32)((1 << 1) * lv_trigo_sin((int16_t)angle_low)); - dxu = (d2_s32)((1 << 1) * lv_trigo_cos((int16_t)angle_low)); - dyv = (d2_s32)((1 << 1) * lv_trigo_sin((int16_t)angle_low + 90)); - dyu = (d2_s32)((1 << 1) * lv_trigo_cos((int16_t)angle_low + 90)); - } - - if(LV_SCALE_NONE != draw_dsc->scale_x) { - dxu = (dxu * LV_SCALE_NONE) / draw_dsc->scale_x; - dxv = (dxv * LV_SCALE_NONE) / draw_dsc->scale_x; - } - if(LV_SCALE_NONE != draw_dsc->scale_y) { - dyu = (dyu * LV_SCALE_NONE) / draw_dsc->scale_y; - dyv = (dyv * LV_SCALE_NONE) / draw_dsc->scale_y; - } - } - - p[0].x += draw_area.x1; - p[0].y += draw_area.y1; - p[1].x += draw_area.x1; - p[1].y += draw_area.y1; - p[2].x += draw_area.x1; - p[2].y += draw_area.y1; - p[3].x += draw_area.x1; - p[3].y += draw_area.y1; - - d2_settexturemapping(u->d2_handle, D2_FIX4(p[0].x), D2_FIX4(p[0].y), D2_FIX16(0), D2_FIX16(0), dxu, dxv, dyu, dyv); - - d2_renderquad(u->d2_handle, - (d2_point)D2_FIX4(p[0].x), - (d2_point)D2_FIX4(p[0].y), - (d2_point)D2_FIX4(p[1].x), - (d2_point)D2_FIX4(p[1].y), - (d2_point)D2_FIX4(p[2].x), - (d2_point)D2_FIX4(p[2].y), - (d2_point)D2_FIX4(p[3].x), - (d2_point)D2_FIX4(p[3].y), - 0); - - // - // Execute render operations - // -#if D2_RENDER_EACH_OPERATION - d2_executerenderbuffer(u->d2_handle, u->renderbuffer, 0); - d2_flushframe(u->d2_handle); -#endif - - d2_setfillmode(u->d2_handle, current_fill_mode); - d2_settextureoperation(u->d2_handle, a_texture_op, r_texture_op, g_texture_op, b_texture_op); - d2_setblendmode(u->d2_handle, src_blend_mode, dst_blend_mode); - - if(NULL != p_intermediate_buf) { - lv_free(p_intermediate_buf); - } - -#if LV_USE_OS - status = lv_mutex_unlock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - -} - -#endif //LV_USE_DRAW_DAVE2D diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_label.c b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_label.c deleted file mode 100644 index abc4173..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_label.c +++ /dev/null @@ -1,163 +0,0 @@ -#include "lv_draw_dave2d.h" -#if LV_USE_DRAW_DAVE2D - -#include "../../lv_draw_label_private.h" -#include "../../../misc/lv_area_private.h" - -static void lv_draw_dave2d_draw_letter_cb(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * glyph_draw_dsc, - lv_draw_fill_dsc_t * fill_draw_dsc, const lv_area_t * fill_area); - -static lv_draw_dave2d_unit_t * unit = NULL; - -void lv_draw_dave2d_label(lv_draw_dave2d_unit_t * u, const lv_draw_label_dsc_t * dsc, const lv_area_t * coords) -{ - if(dsc->opa <= LV_OPA_MIN) return; - - unit = u; - - lv_draw_label_iterate_characters(&u->base_unit, dsc, coords, lv_draw_dave2d_draw_letter_cb); - -} - -static void lv_draw_dave2d_draw_letter_cb(lv_draw_unit_t * u, lv_draw_glyph_dsc_t * glyph_draw_dsc, - lv_draw_fill_dsc_t * fill_draw_dsc, const lv_area_t * fill_area) -{ - - d2_u8 current_fillmode; - lv_area_t clip_area; - lv_area_t letter_coords; - - int32_t x; - int32_t y; - - letter_coords = *glyph_draw_dsc->letter_coords; - - bool is_common; - is_common = lv_area_intersect(&clip_area, glyph_draw_dsc->letter_coords, u->clip_area); - if(!is_common) return; - - x = 0 - unit->base_unit.target_layer->buf_area.x1; - y = 0 - unit->base_unit.target_layer->buf_area.y1; - - lv_area_move(&clip_area, x, y); - lv_area_move(&letter_coords, x, y); - -#if LV_USE_OS - lv_result_t status; - status = lv_mutex_lock(unit->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - -#if D2_RENDER_EACH_OPERATION - d2_selectrenderbuffer(unit->d2_handle, unit->renderbuffer); -#endif - - // - // Generate render operations - // - - d2_framebuffer_from_layer(unit->d2_handle, unit->base_unit.target_layer); - - current_fillmode = d2_getfillmode(unit->d2_handle); - - d2_cliprect(unit->d2_handle, (d2_border)clip_area.x1, (d2_border)clip_area.y1, (d2_border)clip_area.x2, - (d2_border)clip_area.y2); - - if(glyph_draw_dsc) { - switch(glyph_draw_dsc->format) { - case LV_FONT_GLYPH_FORMAT_NONE: { -#if LV_USE_FONT_PLACEHOLDER - /* Draw a placeholder rectangle*/ - lv_draw_border_dsc_t border_draw_dsc; - lv_draw_border_dsc_init(&border_draw_dsc); - border_draw_dsc.opa = glyph_draw_dsc->opa; - border_draw_dsc.color = glyph_draw_dsc->color; - border_draw_dsc.width = 1; - //lv_draw_sw_border(u, &border_draw_dsc, glyph_draw_dsc->bg_coords); - lv_draw_dave2d_border(unit, &border_draw_dsc, glyph_draw_dsc->bg_coords); -#endif - } - break; - case LV_FONT_GLYPH_FORMAT_A1 ... LV_FONT_GLYPH_FORMAT_A8: { - lv_area_t mask_area = letter_coords; - mask_area.x2 = mask_area.x1 + lv_draw_buf_width_to_stride(lv_area_get_width(&mask_area), LV_COLOR_FORMAT_A8) - 1; - // lv_draw_sw_blend_dsc_t blend_dsc; - // lv_memzero(&blend_dsc, sizeof(blend_dsc)); - // blend_dsc.color = glyph_draw_dsc->color; - // blend_dsc.opa = glyph_draw_dsc->opa; - // blend_dsc.mask_buf = glyph_draw_dsc->glyph_data; - // blend_dsc.mask_area = &mask_area; - // blend_dsc.blend_area = glyph_draw_dsc->letter_coords; - // blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - //lv_draw_sw_blend(u, &blend_dsc); - - lv_draw_buf_t * draw_buf = glyph_draw_dsc->glyph_data; - -#if defined(RENESAS_CORTEX_M85) -#if (BSP_CFG_DCACHE_ENABLED) - d1_cacheblockflush(unit->d2_handle, 0, draw_buf->data, draw_buf->data_size); -#endif -#endif - d2_settexture(unit->d2_handle, (void *)draw_buf->data, - (d2_s32)lv_draw_buf_width_to_stride((uint32_t)lv_area_get_width(&letter_coords), LV_COLOR_FORMAT_A8), - lv_area_get_width(&letter_coords), lv_area_get_height(&letter_coords), d2_mode_alpha8); - d2_settexopparam(unit->d2_handle, d2_cc_red, glyph_draw_dsc->color.red, 0); - d2_settexopparam(unit->d2_handle, d2_cc_green, glyph_draw_dsc->color.green, 0); - d2_settexopparam(unit->d2_handle, d2_cc_blue, glyph_draw_dsc->color.blue, 0); - d2_settexopparam(unit->d2_handle, d2_cc_alpha, glyph_draw_dsc->opa, 0); - - d2_settextureoperation(unit->d2_handle, d2_to_multiply, d2_to_multiply, d2_to_multiply, d2_to_multiply); - - d2_settexturemapping(unit->d2_handle, D2_FIX4(letter_coords.x1), D2_FIX4(letter_coords.y1), D2_FIX16(0), D2_FIX16(0), - D2_FIX16(1), D2_FIX16(0), D2_FIX16(0), D2_FIX16(1)); - - d2_settexturemode(unit->d2_handle, d2_tm_filter); - - d2_setfillmode(unit->d2_handle, d2_fm_texture); - - d2_renderbox(unit->d2_handle, (d2_point)D2_FIX4(letter_coords.x1), - (d2_point)D2_FIX4(letter_coords.y1), - (d2_point)D2_FIX4(lv_area_get_width(&letter_coords)), - (d2_point)D2_FIX4(lv_area_get_height(&letter_coords))); - - d2_setfillmode(unit->d2_handle, current_fillmode); - } - break; - case LV_FONT_GLYPH_FORMAT_IMAGE: { -#if LV_USE_IMGFONT - lv_draw_image_dsc_t img_dsc; - lv_draw_image_dsc_init(&img_dsc); - img_dsc.rotation = 0; - img_dsc.scale_x = LV_SCALE_NONE; - img_dsc.scale_y = LV_SCALE_NONE; - img_dsc.opa = glyph_draw_dsc->opa; - img_dsc.src = glyph_draw_dsc->glyph_data; - //lv_draw_sw_image(draw_unit, &img_dsc, glyph_draw_dsc->letter_coords); -#endif - } - break; - default: - break; - } - } - - // - // Execute render operations - // -#if D2_RENDER_EACH_OPERATION - d2_executerenderbuffer(unit->d2_handle, unit->renderbuffer, 0); - d2_flushframe(unit->d2_handle); -#endif - - if(fill_draw_dsc && fill_area) { - //lv_draw_sw_fill(u, fill_draw_dsc, fill_area); - lv_draw_dave2d_fill(unit, fill_draw_dsc, fill_area); - } - -#if LV_USE_OS - status = lv_mutex_unlock(unit->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif -} - -#endif /*LV_USE_DRAW_DAVE2D*/ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_line.c b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_line.c deleted file mode 100644 index 3771926..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_line.c +++ /dev/null @@ -1,93 +0,0 @@ -#include "lv_draw_dave2d.h" -#if LV_USE_DRAW_DAVE2D - -#include "../../../misc/lv_area_private.h" - -void lv_draw_dave2d_line(lv_draw_dave2d_unit_t * u, const lv_draw_line_dsc_t * dsc) -{ - - lv_area_t clip_line; - d2_u32 mode; - lv_area_t buffer_area; - lv_value_precise_t p1_x; - lv_value_precise_t p1_y; - lv_value_precise_t p2_x; - lv_value_precise_t p2_y; - int32_t x; - int32_t y; - - clip_line.x1 = LV_MIN(dsc->p1.x, dsc->p2.x) - dsc->width / 2; - clip_line.x2 = LV_MAX(dsc->p1.x, dsc->p2.x) + dsc->width / 2; - clip_line.y1 = LV_MIN(dsc->p1.y, dsc->p2.y) - dsc->width / 2; - clip_line.y2 = LV_MAX(dsc->p1.y, dsc->p2.y) + dsc->width / 2; - - bool is_common; - is_common = lv_area_intersect(&clip_line, &clip_line, u->base_unit.clip_area); - if(!is_common) return; - -#if LV_USE_OS - lv_result_t status; - status = lv_mutex_lock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - - buffer_area = u->base_unit.target_layer->buf_area; - p1_x = dsc->p1.x - buffer_area.x1; - p1_y = dsc->p1.y - buffer_area.y1; - p2_x = dsc->p2.x - buffer_area.x1; - p2_y = dsc->p2.y - buffer_area.y1; - - x = 0 - u->base_unit.target_layer->buf_area.x1; - y = 0 - u->base_unit.target_layer->buf_area.y1; - - lv_area_move(&clip_line, x, y); - lv_area_move(&buffer_area, x, y); - - bool dashed = dsc->dash_gap && dsc->dash_width; - - if(dashed) { - /* TODO */ - LV_ASSERT(0); - } - -#if D2_RENDER_EACH_OPERATION - d2_selectrenderbuffer(u->d2_handle, u->renderbuffer); -#endif - // - // Generate render operations - // - d2_framebuffer_from_layer(u->d2_handle, u->base_unit.target_layer); - - d2_setcolor(u->d2_handle, 0, lv_draw_dave2d_lv_colour_to_d2_colour(dsc->color)); - - d2_setalpha(u->d2_handle, dsc->opa); - - d2_cliprect(u->d2_handle, clip_line.x1, clip_line.y1, clip_line.x2, clip_line.y2); - - if((dsc->round_end == 1) || (dsc->round_start == 1)) { - mode = d2_lc_round; - } - else { - mode = d2_lc_butt; // lines end directly at endpoints - } - - d2_setlinecap(u->d2_handle, mode); - - d2_renderline(u->d2_handle, D2_FIX4(p1_x), D2_FIX4(p1_y), D2_FIX4(p2_x), - D2_FIX4(p2_y), D2_FIX4(dsc->width), d2_le_exclude_none); - - // - // Execute render operations - // -#if D2_RENDER_EACH_OPERATION - d2_executerenderbuffer(u->d2_handle, u->renderbuffer, 0); - d2_flushframe(u->d2_handle); -#endif - -#if LV_USE_OS - status = lv_mutex_unlock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif -} - -#endif /*LV_USE_DRAW_DAVE2D*/ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_mask_rectangle.c b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_mask_rectangle.c deleted file mode 100644 index 57dbce8..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_mask_rectangle.c +++ /dev/null @@ -1,57 +0,0 @@ -#include "lv_draw_dave2d.h" -#if LV_USE_DRAW_DAVE2D - -#include "../../../misc/lv_area_private.h" - -void lv_draw_dave2d_mask_rect(lv_draw_dave2d_unit_t * u, const lv_draw_mask_rect_dsc_t * dsc, const lv_area_t * coords) -{ - lv_area_t clipped_area; - lv_area_t coordinates; - int32_t x; - int32_t y; - - if(!lv_area_intersect(&clipped_area, coords, u->base_unit.clip_area)) return; - - x = 0 - u->base_unit.target_layer->buf_area.x1; - y = 0 - u->base_unit.target_layer->buf_area.y1; - - coordinates = *coords; - - lv_area_move(&clipped_area, x, y); - lv_area_move(&coordinates, x, y); - -#if LV_USE_OS - lv_result_t status; - status = lv_mutex_lock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - -#ifdef D2_RENDER_EACH_OPERATION - d2_selectrenderbuffer(u->d2_handle, u->renderbuffer); -#endif - - d2_framebuffer_from_layer(u->d2_handle, u->base_unit.target_layer); - - d2_cliprect(u->d2_handle, (d2_border)clipped_area.x1, (d2_border)clipped_area.y1, (d2_border)clipped_area.x2, - (d2_border)clipped_area.y2); - - d2_renderbox(u->d2_handle, - (d2_point) D2_FIX4(coordinates.x1), - (d2_point) D2_FIX4(coordinates.y1), - (d2_width) D2_FIX4(lv_area_get_width(&coordinates)), - (d2_width) D2_FIX4(lv_area_get_height(&coordinates))); - - // - // Execute render operations - // -#ifdef D2_RENDER_EACH_OPERATION - d2_executerenderbuffer(u->d2_handle, u->renderbuffer, 0); - d2_flushframe(u->d2_handle); -#endif - -#if LV_USE_OS - status = lv_mutex_unlock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif -} -#endif //LV_USE_DRAW_DAVE2D diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_triangle.c b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_triangle.c deleted file mode 100644 index c6f3bac..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_triangle.c +++ /dev/null @@ -1,176 +0,0 @@ -#include "lv_draw_dave2d.h" -#if LV_USE_DRAW_DAVE2D - -#include "../../../misc/lv_area_private.h" - -void lv_draw_dave2d_triangle(lv_draw_dave2d_unit_t * u, const lv_draw_triangle_dsc_t * dsc) -{ - lv_area_t clipped_area; - d2_u32 flags = 0; - d2_u8 current_alpha_mode = 0; - int32_t x; - int32_t y; - - lv_area_t tri_area; - tri_area.x1 = LV_MIN3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - tri_area.y1 = LV_MIN3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - tri_area.x2 = LV_MAX3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - tri_area.y2 = LV_MAX3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - - if(!lv_area_intersect(&clipped_area, &tri_area, u->base_unit.clip_area)) return; - -#if LV_USE_OS - lv_result_t status; - status = lv_mutex_lock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - - x = 0 - u->base_unit.target_layer->buf_area.x1; - y = 0 - u->base_unit.target_layer->buf_area.y1; - - lv_area_move(&clipped_area, x, y); - -#if D2_RENDER_EACH_OPERATION - d2_selectrenderbuffer(u->d2_handle, u->renderbuffer); -#endif - - lv_point_precise_t p[3]; - p[0] = dsc->p[0]; - p[1] = dsc->p[1]; - p[2] = dsc->p[2]; - - /*Order the points like this: - * [0]: top - * [1]: right bottom - * [2]: left bottom */ - - if(dsc->p[0].y <= dsc->p[1].y && dsc->p[0].y <= dsc->p[2].y) { - p[0] = dsc->p[0]; - if(dsc->p[1].x < dsc->p[2].x) { - p[2] = dsc->p[1]; - p[1] = dsc->p[2]; - } - else { - p[2] = dsc->p[2]; - p[1] = dsc->p[1]; - } - } - else if(dsc->p[1].y <= dsc->p[0].y && dsc->p[1].y <= dsc->p[2].y) { - p[0] = dsc->p[1]; - if(dsc->p[0].x < dsc->p[2].x) { - p[2] = dsc->p[0]; - p[1] = dsc->p[2]; - } - else { - p[2] = dsc->p[2]; - p[1] = dsc->p[0]; - } - } - else { - p[0] = dsc->p[2]; - if(dsc->p[0].x < dsc->p[1].x) { - p[2] = dsc->p[0]; - p[1] = dsc->p[1]; - } - else { - p[2] = dsc->p[1]; - p[1] = dsc->p[0]; - } - } - - p[0].x -= u->base_unit.target_layer->buf_area.x1; - p[1].x -= u->base_unit.target_layer->buf_area.x1; - p[2].x -= u->base_unit.target_layer->buf_area.x1; - - p[0].y -= u->base_unit.target_layer->buf_area.y1; - p[1].y -= u->base_unit.target_layer->buf_area.y1; - p[2].y -= u->base_unit.target_layer->buf_area.y1; - - p[1].y -= 1; - p[2].y -= 1; - - current_alpha_mode = d2_getalphamode(u->d2_handle); - - if(LV_GRAD_DIR_NONE != dsc->bg_grad.dir) { - float a1; - float a2; - - float y1; - float y2; - - float y3; - float y0; - int32_t y0_i ; - int32_t y3_i ; - - if(LV_GRAD_DIR_VER == dsc->bg_grad.dir) { - a1 = dsc->bg_grad.stops[0].opa; - a2 = dsc->bg_grad.stops[dsc->bg_grad.stops_count - 1].opa; - - y1 = LV_MIN3(p[0].y, p[1].y, p[2].y); - y2 = LV_MAX3(p[0].y, p[1].y, p[2].y); - - if(a1 < a2) { - /* TODO */ - LV_ASSERT(0); - y0 = 0.0f;//silence the compiler warning - y3 = 0.0f; - - } - else { - y0 = y2 - ((y2 - y1) / (a2 - a1) * (a2)); //point where alpha is 0 - y3 = y1 + ((y2 - y1) / (a2 - a1) * (255 - a1)); //point where alpha is 255 - } - - y0_i = (int16_t)y0; - y3_i = (int16_t)y3; - - d2_setalphagradient(u->d2_handle, 0, D2_FIX4(0), D2_FIX4(y0_i), D2_FIX4(0), D2_FIX4((y3_i - y0_i))); - } - else if(LV_GRAD_DIR_HOR == dsc->bg_grad.dir) { - /* TODO */ - LV_ASSERT(0); - } - - d2_setcolor(u->d2_handle, 0, lv_draw_dave2d_lv_colour_to_d2_colour(dsc->bg_grad.stops[0].color)); - d2_setalphamode(u->d2_handle, d2_am_gradient1); - } - else { - d2_setalpha(u->d2_handle, dsc->bg_opa); - d2_setalphamode(u->d2_handle, d2_am_constant); - d2_setcolor(u->d2_handle, 0, lv_draw_dave2d_lv_colour_to_d2_colour(dsc->bg_color)); - - } - - d2_framebuffer_from_layer(u->d2_handle, u->base_unit.target_layer); - - d2_cliprect(u->d2_handle, (d2_border)clipped_area.x1, (d2_border)clipped_area.y1, (d2_border)clipped_area.x2, - (d2_border)clipped_area.y2); - - d2_rendertri(u->d2_handle, - (d2_point) D2_FIX4(p[0].x), - (d2_point) D2_FIX4(p[0].y), - (d2_point) D2_FIX4(p[1].x), - (d2_point) D2_FIX4(p[1].y), - (d2_point) D2_FIX4(p[2].x), - (d2_point) D2_FIX4(p[2].y), - flags); - - // - // Execute render operations - // -#if D2_RENDER_EACH_OPERATION - d2_executerenderbuffer(u->d2_handle, u->renderbuffer, 0); - d2_flushframe(u->d2_handle); -#endif - - d2_setalphamode(u->d2_handle, current_alpha_mode); - -#if LV_USE_OS - status = lv_mutex_unlock(u->pd2Mutex); - LV_ASSERT(LV_RESULT_OK == status); -#endif - -} - -#endif /*LV_USE_DRAW_DAVE2D*/ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_utils.c b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_utils.c deleted file mode 100644 index 98fb806..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_utils.c +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @file lv_draw_dave2d_utils.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_dave2d.h" - -#if LV_USE_DRAW_DAVE2D - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -d2_color lv_draw_dave2d_lv_colour_to_d2_colour(lv_color_t color) -{ - uint8_t alpha, red, green, blue; - - alpha = 0x00; - red = color.red ; - green = color.green ; - blue = color.blue; - /*Color depth: 8 (A8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/ - switch(LV_COLOR_DEPTH) { - case(8): - LV_ASSERT(0); - break; - case(16): - break; - case(24): - break; - case(32): - break; - - default: - break; - } - - return (alpha) << 24UL - | (red) << 16UL - | (green) << 8UL - | (blue) << 0UL; -} - -d2_s32 lv_draw_dave2d_cf_fb_get(void) -{ - d2_s32 d2_fb_mode = 0; - switch(g_display0_cfg.input->format) { - case DISPLAY_IN_FORMAT_16BITS_RGB565: ///< RGB565, 16 bits - d2_fb_mode = d2_mode_rgb565; - break; - case DISPLAY_IN_FORMAT_32BITS_ARGB8888: ///< ARGB8888, 32 bits - d2_fb_mode = d2_mode_argb8888; - break; - case DISPLAY_IN_FORMAT_32BITS_RGB888: ///< RGB888, 32 bits - d2_fb_mode = d2_mode_rgb888; - break; - case DISPLAY_IN_FORMAT_16BITS_ARGB4444: ///< ARGB4444, 16 bits - d2_fb_mode = d2_mode_argb4444; - break; - case DISPLAY_IN_FORMAT_16BITS_ARGB1555: ///< ARGB1555, 16 bits - case DISPLAY_IN_FORMAT_CLUT8 : ///< CLUT8 - case DISPLAY_IN_FORMAT_CLUT4 : ///< CLUT4 - case DISPLAY_IN_FORMAT_CLUT1 : ///< CLUT1 - //Not supported as a FB format by Dave2D - break; - - default: - break; - } - - return d2_fb_mode; -} - -d2_u32 lv_draw_dave2d_lv_colour_fmt_to_d2_fmt(lv_color_format_t colour_format) -{ - d2_u32 d2_lvgl_mode = 0; - - switch(colour_format) { - case(LV_COLOR_FORMAT_A8): - d2_lvgl_mode = d2_mode_alpha8; //? - break; - case(LV_COLOR_FORMAT_RGB565): - d2_lvgl_mode = d2_mode_rgb565; - break; - case(LV_COLOR_FORMAT_RGB888): - d2_lvgl_mode = d2_mode_argb8888; //? - break; - case(LV_COLOR_FORMAT_ARGB8888): - d2_lvgl_mode = d2_mode_argb8888; - break; - - default: - LV_ASSERT(0); - break; - - } - return d2_lvgl_mode; -} - -void d2_framebuffer_from_layer(d2_device * handle, lv_layer_t * layer) -{ - lv_draw_buf_t * draw_buf = layer->draw_buf; - lv_area_t buffer_area = layer->buf_area; - lv_area_move(&buffer_area, -layer->buf_area.x1, -layer->buf_area.y1); - - d2_framebuffer(handle, draw_buf->data, - (d2_s32) draw_buf->header.stride / lv_color_format_get_size(layer->color_format), - (d2_u32)lv_area_get_width(&buffer_area), - (d2_u32)lv_area_get_height(&buffer_area), - lv_draw_dave2d_lv_colour_fmt_to_d2_fmt(layer->color_format)); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_DAVE2D*/ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_utils.h b/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_utils.h deleted file mode 100644 index 67c5102..0000000 --- a/L3_Middlewares/LVGL/src/draw/renesas/dave2d/lv_draw_dave2d_utils.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @file lv_draw_dave2d_utils.h - * - */ - -#ifndef LV_DRAW_DAVE2D_UTILS_H -#define LV_DRAW_DAVE2D_UTILS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -d2_color lv_draw_dave2d_lv_colour_to_d2_colour(lv_color_t color); - -d2_s32 lv_draw_dave2d_cf_fb_get(void); - -d2_u32 lv_draw_dave2d_lv_colour_fmt_to_d2_fmt(lv_color_format_t colour_format); - -void d2_framebuffer_from_layer(d2_device * handle, lv_layer_t * layer); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_DAVE2D_UTILS_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/lv_draw_renesas.mk b/L3_Middlewares/LVGL/src/draw/renesas/lv_draw_renesas.mk new file mode 100644 index 0000000..b5e3ad1 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/renesas/lv_draw_renesas.mk @@ -0,0 +1,7 @@ +CSRCS += lv_gpu_d2_ra6m3.c +CSRCS += lv_gpu_d2_draw_label.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/renesas +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/renesas + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/renesas" diff --git a/L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_draw_label.c b/L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_draw_label.c new file mode 100644 index 0000000..e92ebf1 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_draw_label.c @@ -0,0 +1,292 @@ +/** + * @file lv_gpu_d2_draw_label.c + * + * @description HAL layer for display driver + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../draw/lv_draw_label.h" +#include "../../misc/lv_assert.h" +#include "../../core/lv_refr.h" +#include "lv_gpu_d2_ra6m3.h" + +#if LV_USE_GPU_RA6M3_G2D +#include LV_GPU_RA6M3_G2D_INCLUDE + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * GLOBAL VARIABLES + **********************/ +extern const uint8_t _lv_bpp1_opa_table[2]; +extern const uint8_t _lv_bpp2_opa_table[4]; +extern const uint8_t _lv_bpp4_opa_table[16]; +extern const uint8_t _lv_bpp8_opa_table[256]; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void LV_ATTRIBUTE_FAST_MEM draw_letter_normal(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, + const lv_point_t * pos, lv_font_glyph_dsc_t * g, const uint8_t * map_p) +{ + + const uint8_t * bpp_opa_table_p; + uint32_t bitmask_init; + uint32_t bitmask; + uint32_t bpp = g->bpp; + lv_opa_t opa = dsc->opa; + uint32_t shades; + if(bpp == 3) bpp = 4; + +#if LV_USE_IMGFONT + if(bpp == LV_IMGFONT_BPP) { //is imgfont + lv_area_t fill_area; + fill_area.x1 = pos->x; + fill_area.y1 = pos->y; + fill_area.x2 = pos->x + g->box_w - 1; + fill_area.y2 = pos->y + g->box_h - 1; + lv_draw_img_dsc_t img_dsc; + lv_draw_img_dsc_init(&img_dsc); + img_dsc.angle = 0; + img_dsc.zoom = LV_IMG_ZOOM_NONE; + img_dsc.opa = dsc->opa; + img_dsc.blend_mode = dsc->blend_mode; + lv_draw_img(draw_ctx, &img_dsc, &fill_area, map_p); + return; + } +#endif + + switch(bpp) { + case 1: + bpp_opa_table_p = _lv_bpp1_opa_table; + bitmask_init = 0x80; + shades = 2; + break; + case 2: + bpp_opa_table_p = _lv_bpp2_opa_table; + bitmask_init = 0xC0; + shades = 4; + break; + case 4: + bpp_opa_table_p = _lv_bpp4_opa_table; + bitmask_init = 0xF0; + shades = 16; + break; + case 8: + bpp_opa_table_p = _lv_bpp8_opa_table; + bitmask_init = 0xFF; + shades = 256; + break; /*No opa table, pixel value will be used directly*/ + default: + LV_LOG_WARN("lv_draw_letter: invalid bpp"); + return; /*Invalid bpp. Can't render the letter*/ + } + + static lv_opa_t opa_table[256]; + static lv_opa_t prev_opa = LV_OPA_TRANSP; + static uint32_t prev_bpp = 0; + if(opa < LV_OPA_MAX) { + if(prev_opa != opa || prev_bpp != bpp) { + uint32_t i; + for(i = 0; i < shades; i++) { + opa_table[i] = bpp_opa_table_p[i] == LV_OPA_COVER ? opa : ((bpp_opa_table_p[i] * opa) >> 8); + } + } + bpp_opa_table_p = opa_table; + prev_opa = opa; + prev_bpp = bpp; + } + + int32_t col, row; + int32_t box_w = g->box_w; + int32_t box_h = g->box_h; + int32_t width_bit = box_w * bpp; /*Letter width in bits*/ + + /*Calculate the col/row start/end on the map*/ + int32_t col_start = pos->x >= draw_ctx->clip_area->x1 ? 0 : draw_ctx->clip_area->x1 - pos->x; + int32_t col_end = pos->x + box_w <= draw_ctx->clip_area->x2 ? box_w : draw_ctx->clip_area->x2 - pos->x + 1; + int32_t row_start = pos->y >= draw_ctx->clip_area->y1 ? 0 : draw_ctx->clip_area->y1 - pos->y; + int32_t row_end = pos->y + box_h <= draw_ctx->clip_area->y2 ? box_h : draw_ctx->clip_area->y2 - pos->y + 1; + + /*Move on the map too*/ + uint32_t bit_ofs = (row_start * width_bit) + (col_start * bpp); + map_p += bit_ofs >> 3; + + uint8_t letter_px; + uint32_t col_bit; + col_bit = bit_ofs & 0x7; /*"& 0x7" equals to "% 8" just faster*/ + + lv_draw_sw_blend_dsc_t blend_dsc; + lv_memset_00(&blend_dsc, sizeof(blend_dsc)); + blend_dsc.color = dsc->color; + blend_dsc.opa = LV_OPA_COVER; + blend_dsc.blend_mode = dsc->blend_mode; + + lv_coord_t hor_res = lv_disp_get_hor_res(_lv_refr_get_disp_refreshing()); + uint32_t mask_buf_size = box_w * box_h > hor_res ? hor_res : box_w * box_h; + lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size); + blend_dsc.mask_buf = mask_buf; + int32_t mask_p = 0; + + lv_area_t fill_area; + fill_area.x1 = col_start + pos->x; + fill_area.x2 = col_end + pos->x - 1; + fill_area.y1 = row_start + pos->y; + fill_area.y2 = fill_area.y1; +#if LV_DRAW_COMPLEX + lv_coord_t fill_w = lv_area_get_width(&fill_area); + lv_area_t mask_area; + lv_area_copy(&mask_area, &fill_area); + mask_area.y2 = mask_area.y1 + row_end; + bool mask_any = lv_draw_mask_is_any(&mask_area); +#endif + blend_dsc.blend_area = &fill_area; + blend_dsc.mask_area = &fill_area; + + uint32_t col_bit_max = 8 - bpp; + uint32_t col_bit_row_ofs = (box_w + col_start - col_end) * bpp; + + for(row = row_start ; row < row_end; row++) { +#if LV_DRAW_COMPLEX + int32_t mask_p_start = mask_p; +#endif + bitmask = bitmask_init >> col_bit; + for(col = col_start; col < col_end; col++) { + /*Load the pixel's opacity into the mask*/ + letter_px = (*map_p & bitmask) >> (col_bit_max - col_bit); + if(letter_px) { + mask_buf[mask_p] = bpp_opa_table_p[letter_px]; + } + else { + mask_buf[mask_p] = 0; + } + + /*Go to the next column*/ + if(col_bit < col_bit_max) { + col_bit += bpp; + bitmask = bitmask >> bpp; + } + else { + col_bit = 0; + bitmask = bitmask_init; + map_p++; + } + + /*Next mask byte*/ + mask_p++; + } + +#if LV_DRAW_COMPLEX + /*Apply masks if any*/ + if(mask_any) { + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf + mask_p_start, fill_area.x1, fill_area.y2, + fill_w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(mask_buf + mask_p_start, fill_w); + } + } +#endif + + if((uint32_t) mask_p + (col_end - col_start) < mask_buf_size) { + fill_area.y2 ++; + } + else { + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_ra6m3_2d_blend(draw_ctx, &blend_dsc); + + fill_area.y1 = fill_area.y2 + 1; + fill_area.y2 = fill_area.y1; + mask_p = 0; + } + + col_bit += col_bit_row_ofs; + map_p += (col_bit >> 3); + col_bit = col_bit & 0x7; + } + + /*Flush the last part*/ + if(fill_area.y1 != fill_area.y2) { + fill_area.y2--; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_ra6m3_2d_blend(draw_ctx, &blend_dsc); + mask_p = 0; + } + + lv_mem_buf_release(mask_buf); +} + +void lv_draw_gpu_letter(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p, + uint32_t letter) +{ + const lv_font_t * font_p = dsc->font; + + lv_opa_t opa = dsc->opa; + if(opa < LV_OPA_MIN) return; + if(opa > LV_OPA_MAX) opa = LV_OPA_COVER; + + if(font_p == NULL) { + LV_LOG_WARN("lv_draw_letter: font is NULL"); + return; + } + + lv_font_glyph_dsc_t g; + bool g_ret = lv_font_get_glyph_dsc(font_p, &g, letter, '\0'); + if(g_ret == false) { + /*Add warning if the dsc is not found + *but do not print warning for non printable ASCII chars (e.g. '\n')*/ + if(letter >= 0x20 && + letter != 0xf8ff && /*LV_SYMBOL_DUMMY*/ + letter != 0x200c) { /*ZERO WIDTH NON-JOINER*/ + LV_LOG_WARN("lv_draw_letter: glyph dsc. not found for U+%X", letter); + } + return; + } + + /*Don't draw anything if the character is empty. E.g. space*/ + if((g.box_h == 0) || (g.box_w == 0)) return; + + lv_point_t gpos; + gpos.x = pos_p->x + g.ofs_x; + gpos.y = pos_p->y + (dsc->font->line_height - dsc->font->base_line) - g.box_h - g.ofs_y; + + /*If the letter is completely out of mask don't draw it*/ + if(gpos.x + g.box_w < draw_ctx->clip_area->x1 || + gpos.x > draw_ctx->clip_area->x2 || + gpos.y + g.box_h < draw_ctx->clip_area->y1 || + gpos.y > draw_ctx->clip_area->y2) { + return; + } + + const uint8_t * map_p = lv_font_get_glyph_bitmap(font_p, letter); + if(map_p == NULL) { + LV_LOG_WARN("lv_draw_letter: character's bitmap not found"); + return; + } + + if(font_p->subpx) { +#if LV_DRAW_COMPLEX && LV_USE_FONT_SUBPX + draw_letter_subpx(pos_x, pos_y, &g, clip_area, map_p, color, opa, blend_mode); +#else + LV_LOG_WARN("Can't draw sub-pixel rendered letter because LV_USE_FONT_SUBPX == 0 in lv_conf.h"); +#endif + } + else { + draw_letter_normal(draw_ctx, dsc, &gpos, &g, map_p); + } +} + +#endif diff --git a/L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_ra6m3.c b/L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_ra6m3.c new file mode 100644 index 0000000..ba4c084 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_ra6m3.c @@ -0,0 +1,742 @@ +/** + * @file lv_gpu_d2_ra6m3.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_gpu_d2_ra6m3.h" +#include "../../core/lv_refr.h" +#include + +#if LV_USE_GPU_RA6M3_G2D + +#include LV_GPU_RA6M3_G2D_INCLUDE + +/********************* + * DEFINES + *********************/ +#define LOG_ERRORS +#ifdef LOG_ERRORS + #define STRINGIFY(x) #x + #define TOSTRING(x) STRINGIFY(x) + + #define ERROR_LIST_SIZE (4) + #define D2_EXEC(a) lv_port_gpu_log_error(a, __func__, __LINE__) +#else + /* here is error logging not enabled */ + #define D2_EXEC(a) a; +#endif + +/********************** + * TYPEDEFS + **********************/ +typedef struct { + d2_s32 error; + const char * func; + int line; +} log_error_entry; + +/********************** + * STATIC PROTOTYPES + **********************/ +#ifdef LOG_ERRORS + static void lv_port_gpu_log_error(d2_s32 status, const char * func, int line); +#endif +static void invalidate_cache(void); + +void lv_draw_gpu_letter(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p, + uint32_t letter); + +/********************** + * STATIC VARIABLES + **********************/ +#ifdef LOG_ERRORS + static log_error_entry log_error_list[ERROR_LIST_SIZE]; + static int error_list_index; + static int error_count; +#endif + +static d2_device * _d2_handle; +static d2_renderbuffer * renderbuffer; + +static d2_s32 src_cf_val, dst_cf_val; +static lv_draw_img_dsc_t img_dsc; +static bool color_key_enabled, alpha_enabled, blend_enabled, colorize_enabled; + +/********************** + * STATIC FUNCTIONS + **********************/ +static d2_s32 lv_port_gpu_cf_lv_to_d2(lv_img_cf_t cf) +{ + d2_s32 d2_cf; + +#if (DLG_LVGL_CF == 1) + switch(cf & ~(1 << 5)) { +#else + switch(cf) { +#endif /* (DLG_LVGL_CF == 1) */ + case LV_IMG_CF_TRUE_COLOR: + d2_cf = d2_mode_rgb565; + break; + case LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED: + d2_cf = d2_mode_rgb565; + break; + case LV_IMG_CF_ALPHA_1BIT: + d2_cf = d2_mode_alpha1; + break; + case LV_IMG_CF_ALPHA_2BIT: + d2_cf = d2_mode_alpha2; + break; + case LV_IMG_CF_ALPHA_4BIT: + d2_cf = d2_mode_alpha4; + break; + case LV_IMG_CF_ALPHA_8BIT: + d2_cf = d2_mode_alpha8; + break; + case LV_IMG_CF_INDEXED_1BIT: + d2_cf = d2_mode_i1 | d2_mode_clut; + break; + case LV_IMG_CF_INDEXED_2BIT: + d2_cf = d2_mode_i2 | d2_mode_clut; + break; + case LV_IMG_CF_INDEXED_4BIT: + d2_cf = d2_mode_i4 | d2_mode_clut; + break; + case LV_IMG_CF_INDEXED_8BIT: + d2_cf = d2_mode_i8 | d2_mode_clut; + break; +#if (DLG_LVGL_CF == 1) + case LV_IMG_CF_RGB565: + d2_cf = d2_mode_rgb565; + break; + case LV_IMG_CF_RGB888: + d2_cf = d2_mode_rgb888; + break; + case LV_IMG_CF_RGBA8888: + d2_cf = d2_mode_rgba8888; + break; +#endif /* DLG_LVGL_CF */ + default: + return -1; + } + +#if (DLG_LVGL_CF == 1) + return d2_cf | (cf & (1 << 5) ? d2_mode_rle : 0); +#else + return d2_cf; +#endif /* (DLG_LVGL_CF == 1) */ +} + +static bool lv_port_gpu_cf_fb_valid(d2_s32 cf) +{ + if((cf & (d2_mode_rle | d2_mode_clut)) || cf < 0) { + return false; + } + + switch(cf) { + case d2_mode_alpha8: + case d2_mode_rgb565: + case d2_mode_argb8888: + case d2_mode_argb4444: + case d2_mode_rgba8888: + case d2_mode_rgba4444: + return true; + default: + return false; + } +} + +static bool lv_port_gpu_cf_has_alpha(d2_s32 cf) +{ + switch(cf & ~(d2_mode_clut | d2_mode_rle)) { + case d2_mode_argb8888: + case d2_mode_rgba8888: + case d2_mode_argb4444: + case d2_mode_rgba4444: + case d2_mode_argb1555: + case d2_mode_rgba5551: + case d2_mode_ai44: + case d2_mode_i8: + case d2_mode_i4: + case d2_mode_i2: + case d2_mode_i1: + case d2_mode_alpha8: + case d2_mode_alpha4: + case d2_mode_alpha2: + case d2_mode_alpha1: + return true; + default: + return false; + } +} + +static bool lv_port_gpu_cf_is_alpha(d2_s32 cf) +{ + switch(cf & ~d2_mode_rle) { + case d2_mode_alpha8: + case d2_mode_alpha4: + case d2_mode_alpha2: + case d2_mode_alpha1: + return true; + default: + return false; + } +} + +static d2_color lv_port_gpu_color_lv_to_d2(lv_color_t color) +{ + uint8_t alpha, red, green, blue; + + alpha = 0xFF; + red = color.ch.red << 3 | color.ch.red >> 2; + green = color.ch.green << 2 | color.ch.green >> 4; + blue = color.ch.blue << 3 | color.ch.blue >> 2; + + return (alpha) << 24UL + | (red) << 16UL + | (green) << 8UL + | (blue) << 0UL; +} + +static void lv_port_gpu_get_recolor_consts(d2_color * cl, d2_color * ch) +{ + d2_color c = lv_port_gpu_color_lv_to_d2(img_dsc.recolor); + d2_alpha r, g, b, opa = img_dsc.recolor_opa > LV_OPA_MAX ? LV_OPA_COVER : img_dsc.recolor_opa; + + r = ((uint32_t)((uint8_t)(c >> 16UL)) * opa) / 255; + g = ((uint32_t)((uint8_t)(c >> 8UL)) * opa) / 255; + b = ((uint32_t)((uint8_t)(c >> 0UL)) * opa) / 255; + *cl = r << 16UL | g << 8UL | b << 0UL; + + r += 255 - opa; + g += 255 - opa; + b += 255 - opa; + *ch = r << 16UL | g << 8UL | b << 0UL; +} + +static int lv_port_gpu_handle_indexed_color(const lv_color_t ** src, const d2_color ** clut, d2_s32 cf) +{ + int clut_len = 0; + + if(cf & d2_mode_clut) { + /* Calculate CLUT length in entries */ + switch(cf & ~(d2_mode_clut | d2_mode_rle)) { + case d2_mode_i1: + clut_len = 2; + break; + case d2_mode_i2: + clut_len = 4; + break; + case d2_mode_i4: + clut_len = 16; + break; + case d2_mode_i8: + clut_len = 256; + break; + case d2_mode_ai44: + clut_len = 16; + break; + default: + return 0; + } + + *clut = (const d2_color *)*src; + *src = (const lv_color_t *)((const uint32_t *)*src + clut_len); + } + return clut_len; +} + +static int lv_port_gpu_cf_bpp(d2_s32 cf) +{ + switch(cf & ~(d2_mode_clut | d2_mode_rle)) { + case d2_mode_argb8888: + return 32; + case d2_mode_rgba8888: + return 32; + case d2_mode_rgb888: + return 32; + case d2_mode_argb4444: + return 16; + case d2_mode_rgba4444: + return 16; + case d2_mode_argb1555: + return 16; + case d2_mode_rgba5551: + return 16; + case d2_mode_rgb565: + return 16; + case d2_mode_ai44: + return 8; + case d2_mode_i8: + return 8; + case d2_mode_i4: + return 4; + case d2_mode_i2: + return 2; + case d2_mode_i1: + return 1; + case d2_mode_alpha8: + return 8; + case d2_mode_alpha4: + return 4; + case d2_mode_alpha2: + return 2; + case d2_mode_alpha1: + return 1; + default: + return 0; + } +} + +static d2_s32 lv_port_gpu_cf_get_default(void) +{ + return d2_mode_rgb565; +} + +static void lv_port_gpu_config_blit_clear(void) +{ + alpha_enabled = false; + color_key_enabled = false; + blend_enabled = true; + colorize_enabled = false; + + lv_draw_img_dsc_init(&img_dsc); + + src_cf_val = lv_port_gpu_cf_get_default(); + dst_cf_val = lv_port_gpu_cf_get_default(); +} + +void lv_port_gpu_init(void) +{ + lv_port_gpu_config_blit_clear(); +} + +static void lv_port_gpu_rotate_point(int * x, int * y, float cos_angle, float sin_angle, int pivot_x, int pivot_y) +{ + float fx, fy; + + *x -= pivot_x; + *y -= pivot_y; + + fx = ((float) * x) / 16.0f; + fy = ((float) * y) / 16.0f; + + *x = (int)(((fx * cos_angle) - (fy * sin_angle)) * 16.0f); + *y = (int)(((fx * sin_angle) + (fy * cos_angle)) * 16.0f); + + *x += pivot_x; + *y += pivot_y; +} + +void lv_draw_ra6m3_g2d_init(void) +{ + if(_d2_handle != NULL) { + return; + } + + _d2_handle = d2_opendevice(0); + + if(_d2_handle == NULL) + return; + + /* set blocksize for default displaylist */ + if(d2_setdlistblocksize(_d2_handle, 25) != D2_OK) { + LV_LOG_ERROR("Could NOT d2_setdlistblocksize\n"); + d2_closedevice(_d2_handle); + + return; + } + + /* bind the hardware */ + if(d2_inithw(_d2_handle, 0) != D2_OK) { + LV_LOG_ERROR("Could NOT d2_inithw\n"); + d2_closedevice(_d2_handle); + + return; + } + + renderbuffer = d2_newrenderbuffer(_d2_handle, 20, 20); + if(!renderbuffer) { + LV_LOG_ERROR("NO renderbuffer\n"); + d2_closedevice(_d2_handle); + + return; + } +} + +static void lv_port_gpu_hw_deinit(void) +{ + if(_d2_handle == NULL) + return; + + D2_EXEC(d2_freerenderbuffer(_d2_handle, renderbuffer)); + D2_EXEC(d2_closedevice(_d2_handle)); + + renderbuffer = NULL; + _d2_handle = NULL; +} + +void lv_port_gpu_flush(void) +{ + lv_port_gpu_hw_deinit(); +} + +static void lv_port_gpu_start_render(void) +{ + D2_EXEC(d2_selectrenderbuffer(_d2_handle, renderbuffer)); +} + +static void lv_port_gpu_complete_render(void) +{ + D2_EXEC(d2_flushframe(_d2_handle)); +} + +void lv_port_gpu_wait(lv_draw_ctx_t * draw_ctx) +{ + lv_port_gpu_complete_render(); + + lv_draw_sw_wait_for_finish(draw_ctx); +} + +static void lv_port_gpu_execute_render(void) +{ + if(_d2_handle) { + D2_EXEC(d2_executerenderbuffer(_d2_handle, renderbuffer, 0)); + } +} + +void lv_port_gpu_blit(int32_t x, int32_t y, lv_color_t * dst, const lv_area_t * fill_area) +{ + uint32_t ModeSrc; + + ModeSrc = d2_mode_rgb565; + + lv_coord_t dst_width, dst_hight; + dst_width = lv_area_get_width(fill_area); + dst_hight = lv_area_get_height(fill_area); + + d2_selectrenderbuffer(_d2_handle, renderbuffer); + + // Generate render operations + d2_framebuffer(_d2_handle, (uint16_t *)&fb_background[0], LV_HOR_RES_MAX, LV_HOR_RES_MAX, + MAX(fill_area->y2 + 1, 2), lv_port_gpu_cf_get_default()); + + d2_cliprect(_d2_handle, 0, 0, LV_HOR_RES_MAX - 1, fill_area->y2); + d2_setblitsrc(_d2_handle, (void *) dst, dst_width, dst_width, dst_hight, ModeSrc); + d2_blitcopy(_d2_handle, dst_width, dst_hight, 0, 0, D2_FIX4(dst_width), D2_FIX4(dst_hight), + D2_FIX4(fill_area->x1), D2_FIX4(fill_area->y1), 0); + + // Execute render operations + d2_executerenderbuffer(_d2_handle, renderbuffer, 0); +} + +void lv_port_gpu_fill(lv_color_t * dest_buf, const lv_area_t * fill_area, lv_coord_t dst_width, + lv_color_t color, lv_opa_t opa) +{ + invalidate_cache(); + + lv_port_gpu_start_render(); + + D2_EXEC(d2_framebuffer(_d2_handle, d1_maptovidmem(_d2_handle, dest_buf), MAX(dst_width, 2), MAX(dst_width, 2), + MAX(fill_area->y2 + 1, 2), lv_port_gpu_cf_get_default())); + + D2_EXEC(d2_cliprect(_d2_handle, 0, 0, dst_width - 1, fill_area->y2)); + D2_EXEC(d2_setalpha(_d2_handle, opa > LV_OPA_MAX ? 0xFF : opa)); + D2_EXEC(d2_setcolor(_d2_handle, 0, lv_port_gpu_color_lv_to_d2(color))); + D2_EXEC(d2_renderbox(_d2_handle, D2_FIX4(fill_area->x1), D2_FIX4(fill_area->y1), + D2_FIX4(lv_area_get_width(fill_area)), D2_FIX4(lv_area_get_height(fill_area)))); + + lv_port_gpu_execute_render(); +} + +bool lv_port_gpu_config_blit(const lv_draw_img_dsc_t * draw_dsc, lv_img_cf_t dst_cf, + lv_img_cf_t src_cf, bool alpha_en, bool color_key_en, bool blend_en, bool colorize_en) +{ + d2_s32 d2_src_cf, d2_dst_cf; + + if(blend_en && draw_dsc->blend_mode != LV_BLEND_MODE_NORMAL + && draw_dsc->blend_mode != LV_BLEND_MODE_ADDITIVE) { + return false; + } + + d2_src_cf = lv_port_gpu_cf_lv_to_d2(src_cf); + d2_dst_cf = lv_port_gpu_cf_lv_to_d2(dst_cf); + if(d2_src_cf < 0 || !lv_port_gpu_cf_fb_valid(d2_dst_cf)) { + return false; + } + src_cf_val = d2_src_cf; + dst_cf_val = d2_dst_cf; + + img_dsc = *draw_dsc; + + /* Disable alpha if alpha channel does not exist */ + alpha_enabled = lv_port_gpu_cf_has_alpha(src_cf_val) ? alpha_en : 0; + color_key_enabled = color_key_en; + blend_enabled = blend_en; + colorize_enabled = colorize_en | lv_port_gpu_cf_is_alpha(src_cf_val); + + return true; +} + +static void lv_port_gpu_blit_internal(const lv_area_t * dest_area, const lv_color_t * src_buf, + const lv_area_t * src_area, d2_u32 flags) +{ + const lv_area_t * img_area = src_area; + lv_area_t img_area_scaled; + lv_coord_t w, h, img_w, img_h; + d2_s32 pitch; + int bpp = lv_port_gpu_cf_bpp(src_cf_val); + + D2_EXEC(d2_cliprect(_d2_handle, dest_area->x1, dest_area->y1, dest_area->x2, dest_area->y2)); + + pitch = w = lv_area_get_width(src_area); + h = lv_area_get_height(src_area); + + if(img_dsc.zoom != LV_IMG_ZOOM_NONE) { + img_area_scaled.x1 = src_area->x1 + ((((int32_t)0 - img_dsc.pivot.x) * img_dsc.zoom) >> 8) + img_dsc.pivot.x; + img_area_scaled.x2 = src_area->x1 + ((((int32_t)w - img_dsc.pivot.x) * img_dsc.zoom) >> 8) + img_dsc.pivot.x; + img_area_scaled.y1 = src_area->y1 + ((((int32_t)0 - img_dsc.pivot.y) * img_dsc.zoom) >> 8) + img_dsc.pivot.y; + img_area_scaled.y2 = src_area->y1 + ((((int32_t)h - img_dsc.pivot.y) * img_dsc.zoom) >> 8) + img_dsc.pivot.y; + img_area = &img_area_scaled; + } + + img_w = lv_area_get_width(img_area); + img_h = lv_area_get_height(img_area); + + if(0 < bpp && bpp < 8) { + pitch = (w + (8 - bpp)) & (~(8 - bpp)); + } + + if(img_dsc.angle == 0) { + D2_EXEC(d2_setblitsrc(_d2_handle, (void *) src_buf, pitch, w, h, src_cf_val)); + + D2_EXEC(d2_blitcopy(_d2_handle, w, h, 0, 0, + D2_FIX4(img_w), D2_FIX4(img_h), D2_FIX4(img_area->x1), D2_FIX4(img_area->y1), flags)); + } + else { + int x, y, x1, y1, x2, y2, x3, y3, x4, y4, dxu, dxv, dyu, dyv, xx, xy, yx, yy; + int pivot_scaled_x, pivot_scaled_y; + int tex_offset = (flags & d2_bf_filter) ? -32767 : 0; + d2_u8 amode, cmode = d2_to_copy; + float angle = ((float)img_dsc.angle / 10) * M_PI / 180; + float cos_angle = cosf(angle); + float sin_angle = sinf(angle); + d2_u8 fillmode_backup; + + /* setup texture params */ + fillmode_backup = d2_getfillmode(_d2_handle); + D2_EXEC(d2_setfillmode(_d2_handle, d2_fm_texture)); + D2_EXEC(d2_settexture(_d2_handle, (void *) src_buf, pitch, w, h, src_cf_val)); + D2_EXEC(d2_settexturemode(_d2_handle, flags & (d2_bf_filter | d2_bf_wrap))); + amode = flags & d2_bf_usealpha ? d2_to_copy : d2_to_one; + cmode = flags & d2_bf_colorize2 ? d2_to_blend : d2_to_copy; + D2_EXEC(d2_settextureoperation(_d2_handle, amode, cmode, cmode, cmode)); + if(flags & d2_bf_colorize2) { + d2_color cl = d2_getcolor(_d2_handle, 0), ch = d2_getcolor(_d2_handle, 1); + D2_EXEC(d2_settexopparam(_d2_handle, d2_cc_red, (uint8_t)(cl >> 16UL), + (uint8_t)(ch >> 16UL))); + D2_EXEC(d2_settexopparam(_d2_handle, d2_cc_green, (uint8_t)(cl >> 8UL), + (uint8_t)(ch >> 8UL))); + D2_EXEC(d2_settexopparam(_d2_handle, d2_cc_blue, (uint8_t)(cl >> 0UL), + (uint8_t)(ch >> 0UL))); + } + + x = D2_FIX4(img_area->x1); + y = D2_FIX4(img_area->y1); + + /* define quad points */ + x1 = D2_FIX4(0); + y1 = D2_FIX4(0); + x2 = D2_FIX4(img_w); + y2 = D2_FIX4(0); + x3 = D2_FIX4(img_w); + y3 = D2_FIX4(img_h); + x4 = D2_FIX4(0); + y4 = D2_FIX4(img_h); + + /* rotate points for quad */ + pivot_scaled_x = (img_dsc.pivot.x * img_dsc.zoom) >> 4; + pivot_scaled_y = (img_dsc.pivot.y * img_dsc.zoom) >> 4; + + lv_port_gpu_rotate_point(&x1, &y1, cos_angle, sin_angle, pivot_scaled_x, pivot_scaled_y); + lv_port_gpu_rotate_point(&x2, &y2, cos_angle, sin_angle, pivot_scaled_x, pivot_scaled_y); + lv_port_gpu_rotate_point(&x3, &y3, cos_angle, sin_angle, pivot_scaled_x, pivot_scaled_y); + lv_port_gpu_rotate_point(&x4, &y4, cos_angle, sin_angle, pivot_scaled_x, pivot_scaled_y); + + /* compute texture increments */ + xx = (int)(cos_angle * 65536.0f); + xy = (int)(sin_angle * 65536.0f); + yx = (int)(-sin_angle * 65536.0f); + yy = (int)(cos_angle * 65536.0f); + dxu = ((D2_FIX16(w) / D2_FIX4(img_w)) * xx) >> 12; + dxv = ((D2_FIX16(w) / D2_FIX4(img_w)) * xy) >> 12; + dyu = ((D2_FIX16(h) / D2_FIX4(img_h)) * yx) >> 12; + dyv = ((D2_FIX16(h) / D2_FIX4(img_h)) * yy) >> 12; + + /* map texture exactly to rotated quad, so texel center is always (0/0) top-left */ + D2_EXEC(d2_settexelcenter(_d2_handle, 0, 0)); + D2_EXEC(d2_settexturemapping(_d2_handle, (d2_point)(x + x1), (d2_point)(y + y1), + tex_offset, tex_offset, dxu, dxv, dyu, dyv)); + + int minx = MAX(dest_area->x1, D2_INT4(x + MIN(x1, MIN(x2, MIN(x3, x4))))); + int maxx = MIN(dest_area->x2, D2_INT4(x + MAX(x1, MAX(x2, MAX(x3, x4))))); + int slice = (flags & d2_bf_filter) ? 6 : 8; + + /* Perform render operation in slices to acheive better performance */ + for(int posx = minx; posx < maxx; posx += slice) { + D2_EXEC(d2_cliprect(_d2_handle, posx, dest_area->y1, MIN(posx + slice - 1, maxx), dest_area->y2)); + D2_EXEC(d2_renderquad(_d2_handle, (d2_point)(x + x1), (d2_point)(y + y1), + (d2_point)(x + x2), (d2_point)(y + y2), + (d2_point)(x + x3), (d2_point)(y + y3), + (d2_point)(x + x4), (d2_point)(y + y4), 0)); + } + D2_EXEC(d2_setfillmode(_d2_handle, fillmode_backup)); + } +} + +void lv_port_ra_gpu_blit(lv_color_t * dst, const lv_area_t * dst_area, lv_coord_t dest_stride, + const lv_color_t * src, const lv_area_t * src_area, lv_opa_t opa) +{ + d2_u32 flags = 0; + const d2_color * clut = NULL; + int clut_len = 0; + + invalidate_cache(); + + clut_len = lv_port_gpu_handle_indexed_color(&src, &clut, src_cf_val); + + lv_port_gpu_start_render(); + + D2_EXEC(d2_framebuffer(_d2_handle, d1_maptovidmem(_d2_handle, dst), MAX(dest_stride, 2), + MAX(dst_area->x2 + 1, 2), MAX(dst_area->y2 + 1, 2), dst_cf_val)); + + flags |= alpha_enabled ? d2_bf_usealpha : 0; + + D2_EXEC(d2_setalpha(_d2_handle, opa > LV_OPA_MAX ? LV_OPA_COVER : opa)); + + if(clut) { + D2_EXEC(d2_writetexclut_direct(_d2_handle, clut, 0, clut_len)); + } + + flags |= color_key_enabled ? d2_bf_usealpha : 0; + flags |= (colorize_enabled || img_dsc.recolor_opa != LV_OPA_TRANSP) ? d2_bf_colorize2 : 0; + if(colorize_enabled) { + D2_EXEC(d2_setcolor(_d2_handle, 0, lv_port_gpu_color_lv_to_d2(img_dsc.recolor))); + D2_EXEC(d2_setcolor(_d2_handle, 1, lv_port_gpu_color_lv_to_d2(img_dsc.recolor))); + } + else if(img_dsc.recolor_opa != LV_OPA_TRANSP) { + d2_color cl = 0, ch = 0; + lv_port_gpu_get_recolor_consts(&cl, &ch); + D2_EXEC(d2_setcolor(_d2_handle, 0, cl)); + D2_EXEC(d2_setcolor(_d2_handle, 1, ch)); + } + + flags |= ((img_dsc.angle || img_dsc.zoom != LV_IMG_ZOOM_NONE) && img_dsc.antialias) ? d2_bf_filter : 0; + + if(blend_enabled) { + D2_EXEC(d2_setblendmode(_d2_handle, d2_bm_alpha, + img_dsc.blend_mode != LV_BLEND_MODE_NORMAL ? d2_bm_one : d2_bm_one_minus_alpha)); + D2_EXEC(d2_setalphablendmode(_d2_handle, d2_bm_one, d2_bm_one_minus_alpha)); + } + else { + D2_EXEC(d2_setblendmode(_d2_handle, d2_bm_one, d2_bm_zero)); + D2_EXEC(d2_setalphablendmode(_d2_handle, d2_bm_one, d2_bm_zero)); + } + + lv_port_gpu_blit_internal(dst_area, src, src_area, flags); + + lv_port_gpu_execute_render(); +} + +void lv_draw_ra6m3_2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc) +{ + lv_area_t blend_area; + if(!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area)) return; + + bool done = false; + + if(dsc->mask_buf == NULL && dsc->blend_mode == LV_BLEND_MODE_NORMAL && lv_area_get_size(&blend_area) > 100) { + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); + + lv_color_t * dest_buf = draw_ctx->buf; + + const lv_color_t * src_buf = dsc->src_buf; + if(src_buf) { + lv_draw_sw_blend_basic(draw_ctx, dsc); + + lv_area_t src_area; + src_area.x1 = blend_area.x1 - (dsc->blend_area->x1 - draw_ctx->buf_area->x1); + src_area.y1 = blend_area.y1 - (dsc->blend_area->y1 - draw_ctx->buf_area->y1); + src_area.x2 = src_area.x1 + lv_area_get_width(dsc->blend_area) - 1; + src_area.y2 = src_area.y1 + lv_area_get_height(dsc->blend_area) - 1; + + lv_port_ra_gpu_blit(dest_buf, &blend_area, dest_stride, src_buf, &src_area, dsc->opa); + done = true; + } + else if(dsc->opa >= LV_OPA_MAX) { + lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + lv_port_gpu_fill(dest_buf, &blend_area, dest_stride, dsc->color, dsc->opa); + done = true; + } + } + + if(!done) lv_draw_sw_blend_basic(draw_ctx, dsc); +} + +static void lv_port_gpu_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, + const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t color_format) +{ + /*TODO basic ARGB8888 image can be handles here*/ + + lv_draw_sw_img_decoded(draw_ctx, dsc, coords, map_p, color_format); +} + +void lv_draw_ra6m3_2d_ctx_init(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) +{ + lv_draw_sw_init_ctx(drv, draw_ctx); + + lv_draw_ra6m3_dma2d_ctx_t * ra_2d_draw_ctx = (lv_draw_sw_ctx_t *)draw_ctx; + + ra_2d_draw_ctx->blend = lv_draw_ra6m3_2d_blend; + ra_2d_draw_ctx->base_draw.draw_img_decoded = lv_port_gpu_img_decoded; + ra_2d_draw_ctx->base_draw.wait_for_finish = lv_port_gpu_wait; + ra_2d_draw_ctx->base_draw.draw_letter = lv_draw_gpu_letter; + //ra_2d_draw_ctx->base_draw.buffer_copy = lv_draw_ra6m3_2d_buffer_copy; +} + +void lv_draw_stm32_dma2d_ctx_deinit(lv_disp_t * disp, lv_draw_ctx_t * draw_ctx) +{ + LV_UNUSED(disp); + LV_UNUSED(draw_ctx); +} + +static void invalidate_cache(void) +{ + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + if(disp->driver->clean_dcache_cb) disp->driver->clean_dcache_cb(disp->driver); +} + +#ifdef LOG_ERRORS +static void lv_port_gpu_log_error(d2_s32 status, const char * func, int line) +{ + if(status) { + log_error_list[error_list_index].error = status; + log_error_list[error_list_index].func = func; + log_error_list[error_list_index].line = line; + LV_LOG_ERROR("%s\r\n", d2_geterrorstring(_d2_handle)); + LV_LOG_ERROR("%d:\t%d - %s : %d\r\n", error_count, + log_error_list[error_list_index].error, + log_error_list[error_list_index].func, + log_error_list[error_list_index].line); + + error_count++; + error_list_index++; + if(error_list_index >= ERROR_LIST_SIZE) { + error_list_index = 0; + } + } +} +#endif +#endif /* LV_USE_GPU_RA6M3_G2D */ diff --git a/L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_ra6m3.h b/L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_ra6m3.h new file mode 100644 index 0000000..5d37ce4 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/renesas/lv_gpu_d2_ra6m3.h @@ -0,0 +1,56 @@ +/** + * @file lv_gpu_d2_ra6m3.h + * + */ +#ifndef LV_GPU_D2_RA6M3_H +#define LV_GPU_D2_RA6M3_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../misc/lv_color.h" + +#if LV_USE_GPU_RA6M3_G2D +#include "../../core/lv_disp.h" +#include "../sw/lv_draw_sw.h" + +/********************** + * DEFINE + **********************/ +#define MIN(A, B) ((A) < (B) ? (A) : (B)) +#define MAX(A, B) ((A) > (B) ? (A) : (B)) +#define M_PI 3.1415926 + +/********************** + * TYPEDEFS + **********************/ +typedef lv_draw_sw_ctx_t lv_draw_ra6m3_dma2d_ctx_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ +void lv_draw_ra6m3_g2d_init(void); + +void lv_port_gpu_init(void); + +void lv_port_gpu_flush(void); + +void lv_port_gpu_blit(int32_t x, int32_t y, lv_color_t * dst, const lv_area_t * fill_area); + +void lv_draw_ra6m3_2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc); + +void lv_draw_ra6m3_2d_ctx_init(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); + +void lv_draw_ra6m3_2d_ctx_deinit(lv_disp_drv_t * disp, lv_draw_ctx_t * draw_ctx); + +#endif /*LV_USE_GPU_GD32_IPA*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/L3_Middlewares/LVGL/src/draw/sdl/README.md b/L3_Middlewares/LVGL/src/draw/sdl/README.md new file mode 100644 index 0000000..4415ffa --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/README.md @@ -0,0 +1,28 @@ +# SDL_Renderer Based Drawing Functions + +In LVGL, drawing was performed by CPU. To improve drawing performance on platforms with GPU, +we should perform drawing operations on GPU if possible. + +This implementation has moved most bitmap blending and drawing procedures to utilize SDL_Renderer, +which takes advantages of hardware acceleration APIs like DirectX or OpenGL. + +This implementation can be also considered as a reference implementation, for contributors wants to +develop accelerated drawing functions with other APIs such as OpenGL/OpenGL ES. + +## Caveats +`lv_draw_arc`, `lv_draw_line` is not enabled, due to incomplete implementation. So lines and arcs will +have significant impact to drawing performances. + +Performance of this implementation still has room to improve. Or we should use more powerful APIs +such as OpenGL. + +## Notices for files + +### `lv_draw_sdl_stack_blur.c` + +Contains modified code from [android-stackblur](https://github.com/kikoso/android-stackblur) project. +Apache License 2.0 + +### `lv_draw_sdl_lru.c`/`lv_draw_sdl_lru.h` + +Contains modified code from [C-LRU-Cache](https://github.com/willcannings/C-LRU-Cache) project. No license defined. \ No newline at end of file diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.c index c155ac1..e3cdf57 100644 --- a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.c +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.c @@ -6,51 +6,50 @@ /********************* * INCLUDES *********************/ -#include "../lv_draw_private.h" -#if LV_USE_DRAW_SDL -#include LV_SDL_INCLUDE_PATH + + +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + #include "lv_draw_sdl.h" -#include "../../core/lv_refr_private.h" -#include "../../display/lv_display_private.h" -#include "../../stdlib/lv_string.h" -#include "../../drivers/sdl/lv_sdl_window.h" -#include "../../misc/cache/lv_cache_entry_private.h" -#include "../../misc/lv_area_private.h" +#include "lv_draw_sdl_utils.h" +#include "lv_draw_sdl_texture_cache.h" +#include "lv_draw_sdl_layer.h" /********************* * DEFINES *********************/ -#define DRAW_UNIT_ID_SDL 100 +void lv_draw_sdl_draw_rect(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); + +lv_res_t lv_draw_sdl_img_core(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * draw_dsc, + const lv_area_t * coords, const void * src); + +void lv_draw_sdl_draw_letter(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p, + uint32_t letter); + +void lv_draw_sdl_draw_line(lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, const lv_point_t * point1, + const lv_point_t * point2); + +void lv_draw_sdl_draw_arc(lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center, + uint16_t radius, uint16_t start_angle, uint16_t end_angle); + +void lv_draw_sdl_polygon(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc, const lv_point_t * points, + uint16_t point_cnt); + +void lv_draw_sdl_draw_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); /********************** * TYPEDEFS **********************/ -typedef struct { - lv_draw_dsc_base_t * draw_dsc; - int32_t w; - int32_t h; - SDL_Texture * texture; -} cache_data_t; /********************** * STATIC PROTOTYPES **********************/ -static void execute_drawing(lv_draw_sdl_unit_t * u); - -static int32_t dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer); - -static int32_t evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task); -static bool draw_to_texture(lv_draw_sdl_unit_t * u, cache_data_t * cache_data); - -/********************** - * GLOBAL PROTOTYPES - **********************/ -static uint8_t sdl_render_buf[2048 * 1024 * 4]; /********************** * STATIC VARIABLES **********************/ -static SDL_Texture * layer_get_texture(lv_layer_t * layer); /********************** * MACROS @@ -59,411 +58,46 @@ static SDL_Texture * layer_get_texture(lv_layer_t * layer); /********************** * GLOBAL FUNCTIONS **********************/ -static bool sdl_texture_cache_create_cb(cache_data_t * cached_data, void * user_data) -{ - return draw_to_texture((lv_draw_sdl_unit_t *)user_data, cached_data); -} -static void sdl_texture_cache_free_cb(cache_data_t * cached_data, void * user_data) +void lv_draw_sdl_init_ctx(lv_disp_drv_t * disp_drv, lv_draw_ctx_t * draw_ctx) { - LV_UNUSED(user_data); - - lv_free(cached_data->draw_dsc); - SDL_DestroyTexture(cached_data->texture); - cached_data->draw_dsc = NULL; - cached_data->texture = NULL; + _lv_draw_sdl_utils_init(); + lv_memset_00(draw_ctx, sizeof(lv_draw_sdl_ctx_t)); + draw_ctx->draw_rect = lv_draw_sdl_draw_rect; + draw_ctx->draw_img = lv_draw_sdl_img_core; + draw_ctx->draw_letter = lv_draw_sdl_draw_letter; + draw_ctx->draw_line = lv_draw_sdl_draw_line; + draw_ctx->draw_arc = lv_draw_sdl_draw_arc; + draw_ctx->draw_polygon = lv_draw_sdl_polygon; + draw_ctx->draw_bg = lv_draw_sdl_draw_bg; + draw_ctx->layer_init = lv_draw_sdl_layer_init; + draw_ctx->layer_blend = lv_draw_sdl_layer_blend; + draw_ctx->layer_destroy = lv_draw_sdl_layer_destroy; + draw_ctx->layer_instance_size = sizeof(lv_draw_sdl_layer_ctx_t); + lv_draw_sdl_ctx_t * draw_ctx_sdl = (lv_draw_sdl_ctx_t *) draw_ctx; + draw_ctx_sdl->renderer = ((lv_draw_sdl_drv_param_t *) disp_drv->user_data)->renderer; + draw_ctx_sdl->internals = lv_mem_alloc(sizeof(lv_draw_sdl_context_internals_t)); + lv_memset_00(draw_ctx_sdl->internals, sizeof(lv_draw_sdl_context_internals_t)); + lv_draw_sdl_texture_cache_init(draw_ctx_sdl); } -static lv_cache_compare_res_t sdl_texture_cache_compare_cb(const cache_data_t * lhs, const cache_data_t * rhs) +void lv_draw_sdl_deinit_ctx(lv_disp_drv_t * disp_drv, lv_draw_ctx_t * draw_ctx) { - if(lhs == rhs) return 0; - - if(lhs->w != rhs->w) { - return lhs->w > rhs->w ? 1 : -1; - } - if(lhs->h != rhs->h) { - return lhs->h > rhs->h ? 1 : -1; - } - - uint32_t lhs_dsc_size = lhs->draw_dsc->dsc_size; - uint32_t rhs_dsc_size = rhs->draw_dsc->dsc_size; - - if(lhs_dsc_size != rhs_dsc_size) { - return lhs_dsc_size > rhs_dsc_size ? 1 : -1; - } - - const uint8_t * left_draw_dsc = (const uint8_t *)lhs->draw_dsc; - const uint8_t * right_draw_dsc = (const uint8_t *)rhs->draw_dsc; - left_draw_dsc += sizeof(lv_draw_dsc_base_t); - right_draw_dsc += sizeof(lv_draw_dsc_base_t); - - int cmp_res = lv_memcmp(left_draw_dsc, right_draw_dsc, lhs->draw_dsc->dsc_size - sizeof(lv_draw_dsc_base_t)); - - if(cmp_res != 0) { - return cmp_res > 0 ? 1 : -1; - } - - return 0; + lv_draw_sdl_ctx_t * draw_ctx_sdl = (lv_draw_sdl_ctx_t *) draw_ctx; + lv_draw_sdl_texture_cache_deinit(draw_ctx_sdl); + lv_mem_free(draw_ctx_sdl->internals); + _lv_draw_sdl_utils_deinit(); } -void lv_draw_sdl_init(void) +SDL_Texture * lv_draw_sdl_create_screen_texture(SDL_Renderer * renderer, lv_coord_t hor, lv_coord_t ver) { - lv_draw_sdl_unit_t * draw_sdl_unit = lv_draw_create_unit(sizeof(lv_draw_sdl_unit_t)); - draw_sdl_unit->base_unit.dispatch_cb = dispatch; - draw_sdl_unit->base_unit.evaluate_cb = evaluate; - draw_sdl_unit->texture_cache = lv_cache_create(&lv_cache_class_lru_rb_count, - sizeof(cache_data_t), 128, (lv_cache_ops_t) { - .compare_cb = (lv_cache_compare_cb_t)sdl_texture_cache_compare_cb, - .create_cb = (lv_cache_create_cb_t)sdl_texture_cache_create_cb, - .free_cb = (lv_cache_free_cb_t)sdl_texture_cache_free_cb, - }); - lv_cache_set_name(draw_sdl_unit->texture_cache, "SDL_TEXTURE"); + SDL_Texture * texture = SDL_CreateTexture(renderer, LV_DRAW_SDL_TEXTURE_FORMAT, SDL_TEXTUREACCESS_TARGET, hor, ver); + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + return texture; } /********************** * STATIC FUNCTIONS **********************/ -static int32_t dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer) -{ - lv_draw_sdl_unit_t * draw_sdl_unit = (lv_draw_sdl_unit_t *) draw_unit; - - /*Return immediately if it's busy with a draw task*/ - if(draw_sdl_unit->task_act) return 0; - - lv_draw_task_t * t = NULL; - t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_SDL); - if(t == NULL) return -1; - - lv_display_t * disp = lv_refr_get_disp_refreshing(); - SDL_Texture * texture = layer_get_texture(layer); - if(layer != disp->layer_head && texture == NULL) { - void * buf = lv_draw_layer_alloc_buf(layer); - if(buf == NULL) return -1; - - SDL_Renderer * renderer = lv_sdl_window_get_renderer(disp); - int32_t w = lv_area_get_width(&layer->buf_area); - int32_t h = lv_area_get_height(&layer->buf_area); - layer->user_data = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, - SDL_TEXTUREACCESS_TARGET, w, h); - } - - t->state = LV_DRAW_TASK_STATE_IN_PROGRESS; - draw_sdl_unit->base_unit.target_layer = layer; - draw_sdl_unit->base_unit.clip_area = &t->clip_area; - draw_sdl_unit->task_act = t; - - execute_drawing(draw_sdl_unit); - - draw_sdl_unit->task_act->state = LV_DRAW_TASK_STATE_READY; - draw_sdl_unit->task_act = NULL; - - /*The draw unit is free now. Request a new dispatching as it can get a new task*/ - lv_draw_dispatch_request(); - return 1; -} - -static int32_t evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task) -{ - LV_UNUSED(draw_unit); - - if(((lv_draw_dsc_base_t *)task->draw_dsc)->user_data == NULL) { - task->preference_score = 0; - task->preferred_draw_unit_id = DRAW_UNIT_ID_SDL; - } - return 0; -} - -static bool draw_to_texture(lv_draw_sdl_unit_t * u, cache_data_t * cache_data) -{ - lv_draw_task_t * task = u->task_act; - - lv_layer_t dest_layer; - lv_memzero(&dest_layer, sizeof(dest_layer)); - - int32_t texture_w = lv_area_get_width(&task->_real_area); - int32_t texture_h = lv_area_get_height(&task->_real_area); - - lv_draw_buf_t draw_buf; - dest_layer.draw_buf = &draw_buf; - lv_draw_buf_init(dest_layer.draw_buf, texture_w, texture_h, - LV_COLOR_FORMAT_ARGB8888, LV_STRIDE_AUTO, sdl_render_buf, sizeof(sdl_render_buf)); - dest_layer.color_format = LV_COLOR_FORMAT_ARGB8888; - - dest_layer.buf_area = task->_real_area; - dest_layer._clip_area = task->_real_area; - dest_layer.phy_clip_area = task->_real_area; - lv_memzero(sdl_render_buf, lv_area_get_size(&dest_layer.buf_area) * 4 + 100); - - lv_display_t * disp = lv_refr_get_disp_refreshing(); - - lv_obj_t * obj = ((lv_draw_dsc_base_t *)task->draw_dsc)->obj; - bool original_send_draw_task_event = false; - if(obj) { - original_send_draw_task_event = lv_obj_has_flag(obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); - } - - switch(task->type) { - case LV_DRAW_TASK_TYPE_FILL: { - lv_draw_fill_dsc_t * fill_dsc = task->draw_dsc; - lv_draw_rect_dsc_t rect_dsc; - lv_draw_rect_dsc_init(&rect_dsc); - rect_dsc.base.user_data = lv_sdl_window_get_renderer(disp); - rect_dsc.bg_color = fill_dsc->color; - rect_dsc.bg_grad = fill_dsc->grad; - rect_dsc.radius = fill_dsc->radius; - rect_dsc.bg_opa = fill_dsc->opa; - - lv_draw_rect(&dest_layer, &rect_dsc, &task->area); - } - break; - case LV_DRAW_TASK_TYPE_BORDER: { - lv_draw_border_dsc_t * border_dsc = task->draw_dsc; - lv_draw_rect_dsc_t rect_dsc; - lv_draw_rect_dsc_init(&rect_dsc); - rect_dsc.base.user_data = lv_sdl_window_get_renderer(disp); - rect_dsc.bg_opa = LV_OPA_TRANSP; - rect_dsc.radius = border_dsc->radius; - rect_dsc.border_color = border_dsc->color; - rect_dsc.border_opa = border_dsc->opa; - rect_dsc.border_side = border_dsc->side; - rect_dsc.border_width = border_dsc->width; - lv_draw_rect(&dest_layer, &rect_dsc, &task->area); - break; - } - case LV_DRAW_TASK_TYPE_BOX_SHADOW: { - lv_draw_box_shadow_dsc_t * box_shadow_dsc = task->draw_dsc; - lv_draw_rect_dsc_t rect_dsc; - lv_draw_rect_dsc_init(&rect_dsc); - rect_dsc.base.user_data = lv_sdl_window_get_renderer(disp); - rect_dsc.bg_opa = LV_OPA_0; - rect_dsc.radius = box_shadow_dsc->radius; - rect_dsc.bg_color = box_shadow_dsc->color; - rect_dsc.shadow_opa = box_shadow_dsc->opa; - rect_dsc.shadow_width = box_shadow_dsc->width; - rect_dsc.shadow_spread = box_shadow_dsc->spread; - rect_dsc.shadow_offset_x = box_shadow_dsc->ofs_x; - rect_dsc.shadow_offset_y = box_shadow_dsc->ofs_y; - lv_draw_rect(&dest_layer, &rect_dsc, &task->area); - break; - } - case LV_DRAW_TASK_TYPE_LABEL: { - lv_draw_label_dsc_t label_dsc; - lv_memcpy(&label_dsc, task->draw_dsc, sizeof(label_dsc)); - label_dsc.base.user_data = lv_sdl_window_get_renderer(disp); - lv_draw_label(&dest_layer, &label_dsc, &task->area); - } - break; - case LV_DRAW_TASK_TYPE_ARC: { - lv_draw_arc_dsc_t arc_dsc; - lv_memcpy(&arc_dsc, task->draw_dsc, sizeof(arc_dsc)); - arc_dsc.base.user_data = lv_sdl_window_get_renderer(disp); - lv_draw_arc(&dest_layer, &arc_dsc); - } - break; - case LV_DRAW_TASK_TYPE_LINE: { - lv_draw_line_dsc_t line_dsc; - lv_memcpy(&line_dsc, task->draw_dsc, sizeof(line_dsc)); - line_dsc.base.user_data = lv_sdl_window_get_renderer(disp); - lv_draw_line(&dest_layer, &line_dsc); - } - break; - case LV_DRAW_TASK_TYPE_TRIANGLE: { - lv_draw_triangle_dsc_t triangle_dsc; - lv_memcpy(&triangle_dsc, task->draw_dsc, sizeof(triangle_dsc)); - triangle_dsc.base.user_data = lv_sdl_window_get_renderer(disp); - lv_draw_triangle(&dest_layer, &triangle_dsc); - } - break; - case LV_DRAW_TASK_TYPE_IMAGE: { - lv_draw_image_dsc_t image_dsc; - lv_memcpy(&image_dsc, task->draw_dsc, sizeof(image_dsc)); - image_dsc.base.user_data = lv_sdl_window_get_renderer(disp); - lv_draw_image(&dest_layer, &image_dsc, &task->area); - break; - } - default: - return false; - } - - while(dest_layer.draw_task_head) { - lv_draw_dispatch_layer(disp, &dest_layer); - if(dest_layer.draw_task_head) { - lv_draw_dispatch_wait_for_request(); - } - } - - SDL_Texture * texture = SDL_CreateTexture(lv_sdl_window_get_renderer(disp), SDL_PIXELFORMAT_ARGB8888, - SDL_TEXTUREACCESS_STATIC, texture_w, texture_h); - SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); - SDL_UpdateTexture(texture, NULL, sdl_render_buf, texture_w * 4); - - lv_draw_dsc_base_t * base_dsc = task->draw_dsc; - - cache_data->draw_dsc = lv_malloc(base_dsc->dsc_size); - lv_memcpy((void *)cache_data->draw_dsc, base_dsc, base_dsc->dsc_size); - cache_data->w = texture_w; - cache_data->h = texture_h; - cache_data->texture = texture; - - if(obj) { - lv_obj_update_flag(obj, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS, original_send_draw_task_event); - } - - return true; -} - -static void blend_texture_layer(lv_draw_sdl_unit_t * u) -{ - lv_display_t * disp = lv_refr_get_disp_refreshing(); - SDL_Renderer * renderer = lv_sdl_window_get_renderer(disp); - - SDL_Rect clip_rect; - clip_rect.x = u->base_unit.clip_area->x1; - clip_rect.y = u->base_unit.clip_area->y1; - clip_rect.w = lv_area_get_width(u->base_unit.clip_area); - clip_rect.h = lv_area_get_height(u->base_unit.clip_area); - - lv_draw_task_t * t = u->task_act; - lv_draw_image_dsc_t * draw_dsc = t->draw_dsc; - SDL_Rect rect; - rect.w = (lv_area_get_width(&t->area) * draw_dsc->scale_x) / 256; - rect.h = (lv_area_get_height(&t->area) * draw_dsc->scale_y) / 256; - - rect.x = -draw_dsc->pivot.x; - rect.y = -draw_dsc->pivot.y; - rect.x = (rect.x * draw_dsc->scale_x) / 256; - rect.y = (rect.y * draw_dsc->scale_y) / 256; - rect.x += t->area.x1 + draw_dsc->pivot.x; - rect.y += t->area.y1 + draw_dsc->pivot.y; - - lv_layer_t * src_layer = (lv_layer_t *)draw_dsc->src; - SDL_Texture * src_texture = layer_get_texture(src_layer); - - SDL_SetTextureAlphaMod(src_texture, draw_dsc->opa); - SDL_SetTextureBlendMode(src_texture, SDL_BLENDMODE_BLEND); - SDL_SetRenderTarget(renderer, layer_get_texture(u->base_unit.target_layer)); - SDL_RenderSetClipRect(renderer, &clip_rect); - - SDL_Point center = {draw_dsc->pivot.x, draw_dsc->pivot.y}; - SDL_RenderCopyEx(renderer, src_texture, NULL, &rect, draw_dsc->rotation / 10, ¢er, SDL_FLIP_NONE); - // SDL_RenderCopy(renderer, src_texture, NULL, &rect); - - SDL_DestroyTexture(src_texture); - SDL_RenderSetClipRect(renderer, NULL); -} - -static void draw_from_cached_texture(lv_draw_sdl_unit_t * u) -{ - lv_draw_task_t * t = u->task_act; - - cache_data_t data_to_find; - data_to_find.draw_dsc = (lv_draw_dsc_base_t *)t->draw_dsc; - - data_to_find.w = lv_area_get_width(&t->_real_area); - data_to_find.h = lv_area_get_height(&t->_real_area); - data_to_find.texture = NULL; - - /*user_data stores the renderer to differentiate it from SW rendered tasks. - *However the cached texture is independent from the renderer so use NULL user_data*/ - void * user_data_saved = data_to_find.draw_dsc->user_data; - data_to_find.draw_dsc->user_data = NULL; - - /*img_dsc->image_area is an absolute coordinate so it's different - *for the same image on a different position. So make it relative before using for cache. */ - if(t->type == LV_DRAW_TASK_TYPE_IMAGE) { - lv_draw_image_dsc_t * img_dsc = (lv_draw_image_dsc_t *)data_to_find.draw_dsc; - lv_area_move(&img_dsc->image_area, -t->area.x1, -t->area.y1); - } - - lv_cache_entry_t * entry_cached = lv_cache_acquire_or_create(u->texture_cache, &data_to_find, u); - if(t->type == LV_DRAW_TASK_TYPE_IMAGE) { - lv_draw_image_dsc_t * img_dsc = (lv_draw_image_dsc_t *)data_to_find.draw_dsc; - lv_area_move(&img_dsc->image_area, t->area.x1, t->area.y1); - } - - if(!entry_cached) { - return; - } - - - data_to_find.draw_dsc->user_data = user_data_saved; - - cache_data_t * data_cached = lv_cache_entry_get_data(entry_cached); - SDL_Texture * texture = data_cached->texture; - lv_display_t * disp = lv_refr_get_disp_refreshing(); - SDL_Renderer * renderer = lv_sdl_window_get_renderer(disp); - - lv_layer_t * dest_layer = u->base_unit.target_layer; - SDL_Rect clip_rect; - clip_rect.x = u->base_unit.clip_area->x1 - dest_layer->buf_area.x1; - clip_rect.y = u->base_unit.clip_area->y1 - dest_layer->buf_area.y1; - clip_rect.w = lv_area_get_width(u->base_unit.clip_area); - clip_rect.h = lv_area_get_height(u->base_unit.clip_area); - - SDL_Rect rect; - - SDL_SetRenderTarget(renderer, layer_get_texture(dest_layer)); - - rect.x = t->_real_area.x1 - dest_layer->buf_area.x1; - rect.y = t->_real_area.y1 - dest_layer->buf_area.y1; - rect.w = data_cached->w; - rect.h = data_cached->h; - - SDL_RenderSetClipRect(renderer, &clip_rect); - SDL_RenderCopy(renderer, texture, NULL, &rect); - - SDL_RenderSetClipRect(renderer, NULL); - - lv_cache_release(u->texture_cache, entry_cached, u); - - /*Do not cache label's with local text as the text will be freed*/ - if(t->type == LV_DRAW_TASK_TYPE_LABEL) { - lv_draw_label_dsc_t * label_dsc = t->draw_dsc; - if(label_dsc->text_local) { - lv_cache_drop(u->texture_cache, &data_to_find, NULL); - } - } -} - -static void execute_drawing(lv_draw_sdl_unit_t * u) -{ - lv_draw_task_t * t = u->task_act; - - if(t->type == LV_DRAW_TASK_TYPE_FILL) { - lv_draw_fill_dsc_t * fill_dsc = t->draw_dsc; - if(fill_dsc->radius == 0 && fill_dsc->grad.dir == LV_GRAD_DIR_NONE) { - SDL_Rect rect; - lv_layer_t * layer = u->base_unit.target_layer; - lv_area_t fill_area = t->area; - lv_area_intersect(&fill_area, &fill_area, u->base_unit.clip_area); - - rect.x = fill_area.x1 - layer->buf_area.x1; - rect.y = fill_area.y1 - layer->buf_area.y1; - rect.w = lv_area_get_width(&fill_area); - rect.h = lv_area_get_height(&fill_area); - lv_display_t * disp = lv_refr_get_disp_refreshing(); - SDL_Renderer * renderer = lv_sdl_window_get_renderer(disp); - SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND); - SDL_SetRenderDrawColor(renderer, fill_dsc->color.red, fill_dsc->color.green, fill_dsc->color.blue, fill_dsc->opa); - SDL_RenderSetClipRect(renderer, NULL); - SDL_RenderFillRect(renderer, &rect); - return; - } - } - - if(t->type == LV_DRAW_TASK_TYPE_LAYER) { - blend_texture_layer(u); - return; - } - - draw_from_cached_texture(u); -} - -static SDL_Texture * layer_get_texture(lv_layer_t * layer) -{ - return layer->user_data; -} - -#endif /*LV_USE_DRAW_SDL*/ +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.h b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.h index d9b061d..9b44a7b 100644 --- a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.h +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.h @@ -6,6 +6,7 @@ #ifndef LV_DRAW_SDL_H #define LV_DRAW_SDL_H + #ifdef __cplusplus extern "C" { #endif @@ -13,73 +14,80 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../lv_draw.h" +#include "../../lv_conf_internal.h" -#if LV_USE_DRAW_SDL +#if LV_USE_GPU_SDL -#include "../../misc/cache/lv_cache.h" -#include "../../misc/lv_area.h" -#include "../../misc/lv_color.h" -#include "../../display/lv_display.h" -#include "../../osal/lv_os.h" -#include "../../draw/lv_draw_label.h" -#include "../../draw/lv_draw_rect.h" -#include "../../draw/lv_draw_arc.h" -#include "../../draw/lv_draw_image.h" -#include "../../draw/lv_draw_triangle.h" -#include "../../draw/lv_draw_line.h" +#include LV_GPU_SDL_INCLUDE_PATH + +#include "../lv_draw.h" +#include "../../core/lv_disp.h" /********************* * DEFINES *********************/ +#if SDL_BYTEORDER == SDL_BIG_ENDIAN +#define LV_DRAW_SDL_TEXTURE_FORMAT SDL_PIXELFORMAT_ARGB8888 +#else +#define LV_DRAW_SDL_TEXTURE_FORMAT SDL_PIXELFORMAT_RGBA8888 +#endif + /********************** * TYPEDEFS **********************/ +struct lv_draw_sdl_context_internals_t; + +typedef struct { + /** + * Render for display driver + */ + SDL_Renderer * renderer; + void * user_data; +} lv_draw_sdl_drv_param_t; + typedef struct { - lv_draw_unit_t base_unit; - lv_draw_task_t * task_act; - uint32_t texture_cache_data_type; - lv_cache_t * texture_cache; -} lv_draw_sdl_unit_t; + lv_draw_ctx_t base_draw; + SDL_Renderer * renderer; + struct lv_draw_sdl_context_internals_t * internals; +} lv_draw_sdl_ctx_t; /********************** * GLOBAL PROTOTYPES **********************/ -void lv_draw_sdl_init(void); +void lv_draw_sdl_init_ctx(lv_disp_drv_t * disp_drv, lv_draw_ctx_t * draw_ctx); -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sdl_image(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords); - -void lv_draw_sdl_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc, const lv_area_t * coords); - -void lv_draw_sdl_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc_t * dsc, const lv_area_t * coords); - -void lv_draw_sdl_box_shadow(lv_draw_unit_t * draw_unit, const lv_draw_box_shadow_dsc_t * dsc, const lv_area_t * coords); - -void lv_draw_sdl_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc, const lv_area_t * coords); - -void lv_draw_sdl_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, const lv_area_t * coords); +/** + * @brief Free caches + * + */ +void lv_draw_sdl_deinit_ctx(lv_disp_drv_t * disp_drv, lv_draw_ctx_t * draw_ctx); -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sdl_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc); +SDL_Texture * lv_draw_sdl_create_screen_texture(SDL_Renderer * renderer, lv_coord_t hor, lv_coord_t ver); -void lv_draw_sdl_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, const lv_area_t * coords); +/*====================== + * Add/remove functions + *=====================*/ -void lv_draw_sdl_triangle(lv_draw_unit_t * draw_unit, const lv_draw_triangle_dsc_t * dsc); +/*===================== + * Setter functions + *====================*/ -void lv_draw_sdl_mask_rect(lv_draw_unit_t * draw_unit, const lv_draw_mask_rect_dsc_t * dsc, const lv_area_t * coords); +/*===================== + * Getter functions + *====================*/ -/*********************** - * GLOBAL VARIABLES - ***********************/ +/*===================== + * Other functions + *====================*/ /********************** * MACROS **********************/ -#endif /*LV_USE_DRAW_SDL*/ +#endif /*LV_USE_GPU_SDL*/ #ifdef __cplusplus } /*extern "C"*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.mk b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.mk new file mode 100644 index 0000000..c5c28b6 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl.mk @@ -0,0 +1,19 @@ +CSRCS += lv_draw_sdl.c +CSRCS += lv_draw_sdl_arc.c +CSRCS += lv_draw_sdl_bg.c +CSRCS += lv_draw_sdl_composite.c +CSRCS += lv_draw_sdl_img.c +CSRCS += lv_draw_sdl_label.c +CSRCS += lv_draw_sdl_line.c +CSRCS += lv_draw_sdl_mask.c +CSRCS += lv_draw_sdl_polygon.c +CSRCS += lv_draw_sdl_rect.c +CSRCS += lv_draw_sdl_stack_blur.c +CSRCS += lv_draw_sdl_texture_cache.c +CSRCS += lv_draw_sdl_utils.c +CSRCS += lv_draw_sdl_layer.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sdl +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sdl + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sdl" diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_arc.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_arc.c new file mode 100644 index 0000000..f43fef6 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_arc.c @@ -0,0 +1,245 @@ +/** + * @file lv_draw_sdl_arc.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include "lv_draw_sdl.h" +#include "lv_draw_sdl_utils.h" +#include "lv_draw_sdl_texture_cache.h" +#include "lv_draw_sdl_composite.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +static void dump_masks(SDL_Texture * texture, const lv_area_t * coords, const int16_t * ids, int16_t ids_count, + const int16_t * caps); + +static void get_cap_area(int16_t angle, lv_coord_t thickness, uint16_t radius, const lv_point_t * center, + lv_area_t * out); + +/********************** + * GLOBAL FUNCTIONS + **********************/ +void lv_draw_sdl_draw_arc(lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center, + uint16_t radius, uint16_t start_angle, uint16_t end_angle) +{ + lv_draw_sdl_ctx_t * ctx = (lv_draw_sdl_ctx_t *) draw_ctx; + + lv_area_t area_out; + area_out.x1 = center->x - radius; + area_out.y1 = center->y - radius; + area_out.x2 = center->x + radius - 1; /*-1 because the center already belongs to the left/bottom part*/ + area_out.y2 = center->y + radius - 1; + + lv_area_t draw_area; + if(!_lv_area_intersect(&draw_area, &area_out, draw_ctx->clip_area)) { + return; + } + + lv_area_t area_in; + lv_area_copy(&area_in, &area_out); + area_in.x1 += dsc->width; + area_in.y1 += dsc->width; + area_in.x2 -= dsc->width; + area_in.y2 -= dsc->width; + + + while(start_angle >= 360) start_angle -= 360; + while(end_angle >= 360) end_angle -= 360; + + int16_t mask_ids[3] = {LV_MASK_ID_INV, LV_MASK_ID_INV, LV_MASK_ID_INV}, mask_ids_count = 1; + int16_t cap_ids[2] = {LV_MASK_ID_INV, LV_MASK_ID_INV}; + + lv_draw_mask_radius_param_t mask_out_param; + lv_draw_mask_radius_init(&mask_out_param, &area_out, LV_RADIUS_CIRCLE, false); + mask_ids[0] = lv_draw_mask_add(&mask_out_param, NULL); + + lv_draw_mask_radius_param_t mask_in_param; + if(lv_area_get_width(&area_in) > 0 && lv_area_get_height(&area_in) > 0) { + lv_draw_mask_radius_init(&mask_in_param, &area_in, LV_RADIUS_CIRCLE, true); + mask_ids[1] = lv_draw_mask_add(&mask_in_param, NULL); + mask_ids_count++; + } + + lv_draw_mask_angle_param_t mask_angle_param; + if((start_angle - end_angle) % 360) { + lv_draw_mask_angle_init(&mask_angle_param, center->x, center->y, start_angle, end_angle); + mask_ids[2] = lv_draw_mask_add(&mask_angle_param, NULL); + mask_ids_count++; + } + + lv_draw_mask_radius_param_t cap_start_param, cap_end_param; + if(mask_ids_count == 3 && dsc->rounded) { + lv_area_t start_area, end_area; + get_cap_area((int16_t) start_angle, dsc->width, radius, center, &start_area); + get_cap_area((int16_t) end_angle, dsc->width, radius, center, &end_area); + lv_draw_mask_radius_init(&cap_start_param, &start_area, dsc->width / 2, false); + cap_ids[0] = lv_draw_mask_add(&cap_start_param, NULL); + lv_draw_mask_radius_init(&cap_end_param, &end_area, dsc->width / 2, false); + cap_ids[1] = lv_draw_mask_add(&cap_end_param, NULL); + } + + lv_coord_t w = lv_area_get_width(&draw_area), h = lv_area_get_height(&draw_area); + bool texture_cached = false; + SDL_Texture * texture = lv_draw_sdl_composite_texture_obtain(ctx, LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_STREAM1, w, h, + &texture_cached); + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + dump_masks(texture, &draw_area, mask_ids, mask_ids_count, cap_ids[0] != LV_MASK_ID_INV ? cap_ids : NULL); + + lv_draw_mask_remove_id(mask_ids[0]); + lv_draw_mask_free_param(&mask_out_param); + + if(mask_ids_count > 1) { + lv_draw_mask_remove_id(mask_ids[1]); + lv_draw_mask_free_param(&mask_in_param); + } + + if(mask_ids_count > 2) { + lv_draw_mask_remove_id(mask_ids[2]); + lv_draw_mask_free_param(&mask_angle_param); + } + + if(cap_ids[0] != LV_MASK_ID_INV) { + lv_draw_mask_remove_id(cap_ids[0]); + lv_draw_mask_remove_id(cap_ids[1]); + lv_draw_mask_free_param(&cap_start_param); + lv_draw_mask_free_param(&cap_end_param); + } + + SDL_Rect srcrect = {0, 0, w, h}, dstrect; + lv_area_to_sdl_rect(&draw_area, &dstrect); + SDL_Color color; + lv_color_to_sdl_color(&dsc->color, &color); + SDL_SetTextureColorMod(texture, color.r, color.g, color.b); + SDL_SetTextureAlphaMod(texture, dsc->opa); + SDL_RenderCopy(ctx->renderer, texture, &srcrect, &dstrect); + + if(!texture_cached) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(texture); + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void dump_masks(SDL_Texture * texture, const lv_area_t * coords, const int16_t * ids, int16_t ids_count, + const int16_t * caps) +{ + lv_coord_t w = lv_area_get_width(coords), h = lv_area_get_height(coords); + SDL_assert(w > 0 && h > 0); + SDL_Rect rect = {0, 0, w, h}; + uint8_t * pixels; + int pitch; + if(SDL_LockTexture(texture, &rect, (void **) &pixels, &pitch) != 0) return; + + lv_opa_t * line_buf = lv_mem_buf_get(rect.w); + for(lv_coord_t y = 0; y < rect.h; y++) { + lv_memset_ff(line_buf, rect.w); + lv_coord_t abs_x = (lv_coord_t) coords->x1, abs_y = (lv_coord_t)(y + coords->y1), len = (lv_coord_t) rect.w; + lv_draw_mask_res_t res; + res = lv_draw_mask_apply_ids(line_buf, abs_x, abs_y, len, ids, ids_count); + if(res == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(&pixels[y * pitch], 4 * rect.w); + } + else if(res == LV_DRAW_MASK_RES_FULL_COVER) { + lv_memset_ff(&pixels[y * pitch], 4 * rect.w); + } + else { + for(int x = 0; x < rect.w; x++) { + uint8_t * pixel = &pixels[y * pitch + x * 4]; + *pixel = line_buf[x]; + pixel[1] = pixel[2] = pixel[3] = 0xFF; + } + } + if(caps) { + for(int i = 0; i < 2; i++) { + lv_memset_ff(line_buf, rect.w); + res = lv_draw_mask_apply_ids(line_buf, abs_x, abs_y, len, &caps[i], 1); + if(res == LV_DRAW_MASK_RES_TRANSP) { + /* Ignore */ + } + else if(res == LV_DRAW_MASK_RES_FULL_COVER) { + lv_memset_ff(&pixels[y * pitch], 4 * rect.w); + } + else { + for(int x = 0; x < rect.w; x++) { + uint8_t * pixel = &pixels[y * pitch + x * 4]; + uint16_t old_opa = line_buf[x] + *pixel; + *pixel = LV_MIN(old_opa, 0xFF); + pixel[1] = pixel[2] = pixel[3] = 0xFF; + } + } + } + } + } + lv_mem_buf_release(line_buf); + SDL_UnlockTexture(texture); +} + +static void get_cap_area(int16_t angle, lv_coord_t thickness, uint16_t radius, const lv_point_t * center, + lv_area_t * out) +{ + const uint8_t ps = 8; + const uint8_t pa = 127; + + int32_t thick_half = thickness / 2; + uint8_t thick_corr = (thickness & 0x01) ? 0 : 1; + + int32_t cir_x; + int32_t cir_y; + + cir_x = ((radius - thick_half) * lv_trigo_sin((int16_t)(90 - angle))) >> (LV_TRIGO_SHIFT - ps); + cir_y = ((radius - thick_half) * lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps); + + /*Actually the center of the pixel need to be calculated so apply 1/2 px offset*/ + if(cir_x > 0) { + cir_x = (cir_x - pa) >> ps; + out->x1 = cir_x - thick_half + thick_corr; + out->x2 = cir_x + thick_half; + } + else { + cir_x = (cir_x + pa) >> ps; + out->x1 = cir_x - thick_half; + out->x2 = cir_x + thick_half - thick_corr; + } + + if(cir_y > 0) { + cir_y = (cir_y - pa) >> ps; + out->y1 = cir_y - thick_half + thick_corr; + out->y2 = cir_y + thick_half; + } + else { + cir_y = (cir_y + pa) >> ps; + out->y1 = cir_y - thick_half; + out->y2 = cir_y + thick_half - thick_corr; + } + lv_area_move(out, center->x, center->y); +} + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_bg.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_bg.c new file mode 100644 index 0000000..48e0f6b --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_bg.c @@ -0,0 +1,106 @@ +/** + * @file lv_draw_sdl_bg.c + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include "../lv_draw_rect.h" +#include "../lv_draw_img.h" +#include "../lv_draw_label.h" +#include "../lv_draw_mask.h" +#include "../../core/lv_refr.h" +#include "lv_draw_sdl_utils.h" +#include "lv_draw_sdl_texture_cache.h" +#include "lv_draw_sdl_composite.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +static void draw_bg_color(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc); + +static void draw_bg_img(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_draw_sdl_draw_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) +{ + const lv_area_t * clip = draw_ctx->clip_area; + lv_draw_sdl_ctx_t * ctx = (lv_draw_sdl_ctx_t *) draw_ctx; + /* Coords will be translated so coords will start at (0,0) */ + lv_area_t t_area; + bool has_content = _lv_area_intersect(&t_area, coords, clip); + + /* Shadows and outlines will also draw in extended area */ + if(has_content) { + if(dsc->bg_img_src) { + draw_bg_img(ctx, coords, &t_area, dsc); + } + else { + draw_bg_color(ctx, coords, &t_area, dsc); + } + } + +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void draw_bg_color(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc) +{ + SDL_Color bg_color; + lv_color_to_sdl_color(&dsc->bg_color, &bg_color); + SDL_SetRenderDrawBlendMode(ctx->renderer, SDL_BLENDMODE_NONE); + SDL_SetRenderDrawColor(ctx->renderer, bg_color.r, bg_color.g, bg_color.b, dsc->bg_opa); + + SDL_Rect rect; + lv_area_to_sdl_rect(draw_area, &rect); + SDL_RenderFillRect(ctx->renderer, &rect); + + SDL_SetRenderDrawBlendMode(ctx->renderer, SDL_BLENDMODE_BLEND); +} + +static void draw_bg_img(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc) +{ + SDL_SetRenderDrawBlendMode(ctx->renderer, SDL_BLENDMODE_NONE); + SDL_SetRenderDrawColor(ctx->renderer, 0, 0, 0, 0); + + SDL_Rect rect; + lv_area_to_sdl_rect(draw_area, &rect); + SDL_RenderFillRect(ctx->renderer, &rect); + + SDL_SetRenderDrawBlendMode(ctx->renderer, SDL_BLENDMODE_BLEND); + lv_draw_rect((lv_draw_ctx_t *) ctx, dsc, coords); +} + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_composite.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_composite.c new file mode 100644 index 0000000..9bf6385 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_composite.c @@ -0,0 +1,279 @@ +/** + * @file lv_draw_sdl_composite.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include "../../misc/lv_gc.h" +#include "../../core/lv_refr.h" +#include "lv_draw_sdl_composite.h" +#include "lv_draw_sdl_utils.h" +#include "lv_draw_sdl_priv.h" +#include "lv_draw_sdl_texture_cache.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_sdl_cache_key_magic_t magic; + lv_draw_sdl_composite_texture_id_t type; +} composite_key_t; + +/********************** + * STATIC PROTOTYPES + **********************/ + +static composite_key_t mask_key_create(lv_draw_sdl_composite_texture_id_t type); + +static lv_coord_t next_pow_of_2(lv_coord_t num); + +static void dump_masks(SDL_Texture * texture, const lv_area_t * coords); +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +bool lv_draw_sdl_composite_begin(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords_in, const lv_area_t * clip_in, + const lv_area_t * extension, lv_blend_mode_t blend_mode, lv_area_t * coords_out, + lv_area_t * clip_out, lv_area_t * apply_area) +{ + lv_area_t full_coords = *coords_in; + + /* Normalize full_coords */ + if(full_coords.x1 > full_coords.x2) { + lv_coord_t x2 = full_coords.x2; + full_coords.x2 = full_coords.x1; + full_coords.x1 = x2; + } + if(full_coords.y1 > full_coords.y2) { + lv_coord_t y2 = full_coords.y2; + full_coords.y2 = full_coords.y1; + full_coords.y1 = y2; + } + + if(extension) { + full_coords.x1 -= extension->x1; + full_coords.x2 += extension->x2; + full_coords.y1 -= extension->y1; + full_coords.y2 += extension->y2; + } + + if(!_lv_area_intersect(apply_area, &full_coords, clip_in)) return false; + bool has_mask = lv_draw_mask_is_any(apply_area); + + const bool draw_mask = has_mask && LV_GPU_SDL_CUSTOM_BLEND_MODE; + const bool draw_blend = blend_mode != LV_BLEND_MODE_NORMAL; + if(draw_mask || draw_blend) { + lv_draw_sdl_context_internals_t * internals = ctx->internals; + LV_ASSERT(internals->mask == NULL && internals->composition == NULL && internals->target_backup == NULL); + + lv_coord_t w = lv_area_get_width(apply_area), h = lv_area_get_height(apply_area); + internals->composition = lv_draw_sdl_composite_texture_obtain(ctx, LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_TARGET0, w, h, + &internals->composition_cached); + /* Don't need to worry about integral overflow */ + lv_coord_t ofs_x = (lv_coord_t) - apply_area->x1, ofs_y = (lv_coord_t) - apply_area->y1; + /* Offset draw area to start with (0,0) of coords */ + lv_area_move(coords_out, ofs_x, ofs_y); + lv_area_move(clip_out, ofs_x, ofs_y); + internals->target_backup = SDL_GetRenderTarget(ctx->renderer); + SDL_SetRenderTarget(ctx->renderer, internals->composition); + SDL_SetRenderDrawColor(ctx->renderer, 255, 255, 255, 0); + /* SDL_RenderClear is not working properly, so we overwrite the target with solid color */ + SDL_SetRenderDrawBlendMode(ctx->renderer, SDL_BLENDMODE_NONE); + SDL_RenderFillRect(ctx->renderer, NULL); + SDL_SetRenderDrawBlendMode(ctx->renderer, SDL_BLENDMODE_BLEND); +#if LV_GPU_SDL_CUSTOM_BLEND_MODE + internals->mask = lv_draw_sdl_composite_texture_obtain(ctx, LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_STREAM0, w, h, + &internals->composition_cached); + dump_masks(internals->mask, apply_area); +#endif + } + else if(has_mask) { + /* Fallback mask handling. This will at least make bars looks less bad */ + for(uint8_t i = 0; i < _LV_MASK_MAX_NUM; i++) { + _lv_draw_mask_common_dsc_t * comm_param = LV_GC_ROOT(_lv_draw_mask_list[i]).param; + if(comm_param == NULL) continue; + switch(comm_param->type) { + case LV_DRAW_MASK_TYPE_RADIUS: { + const lv_draw_mask_radius_param_t * param = (const lv_draw_mask_radius_param_t *) comm_param; + if(param->cfg.outer) break; + _lv_area_intersect(clip_out, apply_area, ¶m->cfg.rect); + break; + } + default: + break; + } + } + } + return has_mask; +} + +void lv_draw_sdl_composite_end(lv_draw_sdl_ctx_t * ctx, const lv_area_t * apply_area, lv_blend_mode_t blend_mode) +{ + lv_draw_sdl_context_internals_t * internals = ctx->internals; + SDL_Rect src_rect = {0, 0, lv_area_get_width(apply_area), lv_area_get_height(apply_area)}; +#if LV_GPU_SDL_CUSTOM_BLEND_MODE + if(internals->mask) { + SDL_BlendMode mode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, + SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ZERO, + SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDOPERATION_ADD); + SDL_SetTextureBlendMode(internals->mask, mode); + SDL_RenderCopy(ctx->renderer, internals->mask, &src_rect, &src_rect); + } +#endif + + /* Shapes are drawn on composite layer when mask or blend mode is present */ + if(internals->composition) { + SDL_Rect dst_rect; + lv_area_to_sdl_rect(apply_area, &dst_rect); + + SDL_SetRenderTarget(ctx->renderer, internals->target_backup); + switch(blend_mode) { + case LV_BLEND_MODE_NORMAL: + SDL_SetTextureBlendMode(internals->composition, SDL_BLENDMODE_BLEND); + break; + case LV_BLEND_MODE_ADDITIVE: + SDL_SetTextureBlendMode(internals->composition, SDL_BLENDMODE_ADD); + break; +#if LV_GPU_SDL_CUSTOM_BLEND_MODE + case LV_BLEND_MODE_SUBTRACTIVE: { + SDL_BlendMode mode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, + SDL_BLENDOPERATION_SUBTRACT, SDL_BLENDFACTOR_ONE, + SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_SUBTRACT); + SDL_SetTextureBlendMode(internals->composition, mode); + break; + } + case LV_BLEND_MODE_MULTIPLY: { + SDL_BlendMode mode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_SRC_COLOR, + SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ZERO, + SDL_BLENDFACTOR_DST_ALPHA, SDL_BLENDOPERATION_ADD); + SDL_SetTextureBlendMode(internals->composition, mode); + break; + } +#endif + default: + LV_LOG_WARN("Doesn't support blend mode %d", blend_mode); + SDL_SetTextureBlendMode(internals->composition, SDL_BLENDMODE_BLEND); + /* Unsupported yet */ + break; + } + SDL_RenderCopy(ctx->renderer, internals->composition, &src_rect, &dst_rect); + if(!internals->composition_cached) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(internals->composition); + } + } + + internals->mask = internals->composition = internals->target_backup = NULL; +} + +SDL_Texture * lv_draw_sdl_composite_texture_obtain(lv_draw_sdl_ctx_t * ctx, lv_draw_sdl_composite_texture_id_t id, + lv_coord_t w, lv_coord_t h, bool * texture_in_cache) +{ + lv_point_t * tex_size = NULL; + composite_key_t mask_key = mask_key_create(id); + SDL_Texture * result = lv_draw_sdl_texture_cache_get_with_userdata(ctx, &mask_key, sizeof(composite_key_t), NULL, + (void **) &tex_size); + if(result == NULL || tex_size->x < w || tex_size->y < h) { + lv_coord_t size = next_pow_of_2(LV_MAX(w, h)); + int access = SDL_TEXTUREACCESS_STREAMING; + if(id >= LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_TRANSFORM0) { + access = SDL_TEXTUREACCESS_TARGET; + } + else if(id >= LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_TARGET0) { + access = SDL_TEXTUREACCESS_TARGET; + } + result = SDL_CreateTexture(ctx->renderer, LV_DRAW_SDL_TEXTURE_FORMAT, access, size, size); + tex_size = lv_mem_alloc(sizeof(lv_point_t)); + tex_size->x = tex_size->y = size; + bool in_cache = lv_draw_sdl_texture_cache_put_advanced(ctx, &mask_key, sizeof(composite_key_t), result, + tex_size, lv_mem_free, 0); + if(!in_cache) { + lv_mem_free(tex_size); + } + if(texture_in_cache != NULL) { + *texture_in_cache = in_cache; + } + } + else if(texture_in_cache != NULL) { + *texture_in_cache = true; + } + + return result; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static composite_key_t mask_key_create(lv_draw_sdl_composite_texture_id_t type) +{ + composite_key_t key; + /* VERY IMPORTANT! Padding between members is uninitialized, so we have to wipe them manually */ + SDL_memset(&key, 0, sizeof(key)); + key.magic = LV_GPU_CACHE_KEY_MAGIC_MASK; + key.type = type; + return key; +} + +static lv_coord_t next_pow_of_2(lv_coord_t num) +{ + lv_coord_t n = 128; + while(n < num && n < 16384) { + n = n << 1; + } + return n; +} + +static void dump_masks(SDL_Texture * texture, const lv_area_t * coords) +{ + lv_coord_t w = lv_area_get_width(coords), h = lv_area_get_height(coords); + SDL_assert(w > 0 && h > 0); + SDL_Rect rect = {0, 0, w, h}; + uint8_t * pixels; + int pitch; + if(SDL_LockTexture(texture, &rect, (void **) &pixels, &pitch) != 0) return; + + lv_opa_t * line_buf = lv_mem_buf_get(rect.w); + for(lv_coord_t y = 0; y < rect.h; y++) { + lv_memset_ff(line_buf, rect.w); + lv_coord_t abs_x = (lv_coord_t) coords->x1, abs_y = (lv_coord_t)(y + coords->y1), len = (lv_coord_t) rect.w; + lv_draw_mask_res_t res; + res = lv_draw_mask_apply(line_buf, abs_x, abs_y, len); + if(res == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(&pixels[y * pitch], 4 * rect.w); + } + else if(res == LV_DRAW_MASK_RES_FULL_COVER) { + lv_memset_ff(&pixels[y * pitch], 4 * rect.w); + } + else { + for(int x = 0; x < rect.w; x++) { + const size_t idx = y * pitch + x * 4; + pixels[idx] = line_buf[x]; + pixels[idx + 1] = pixels[idx + 2] = pixels[idx + 3] = 0xFF; + } + } + } + lv_mem_buf_release(line_buf); + SDL_UnlockTexture(texture); +} + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_composite.h b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_composite.h new file mode 100644 index 0000000..57191bb --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_composite.h @@ -0,0 +1,84 @@ +/** + * @file lv_draw_sdl_composite.h + * + */ + +#ifndef LV_DRAW_SDL_COMPOSITE_H +#define LV_DRAW_SDL_COMPOSITE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +#include "../../lv_conf_internal.h" + +#include LV_GPU_SDL_INCLUDE_PATH + +#include "lv_draw_sdl.h" +#include "../../misc/lv_area.h" +#include "../../misc/lv_color.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef enum lv_draw_sdl_composite_texture_id_t { + LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_STREAM0, + LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_STREAM1, + LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_TARGET0, + LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_TARGET1, + LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_TRANSFORM0, +} lv_draw_sdl_composite_texture_id_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Begin drawing with mask. Render target will be switched to a temporary texture, + * and drawing coordinates may get clipped or translated + * @param ctx Drawing context + * @param coords_in Original coordinates + * @param clip_in Original clip area + * @param extension Useful for shadows or outlines, can be NULL + * @param coords_out Translated coords + * @param clip_out Translated clip area + * @param apply_area Area of actual composited texture will be drawn + * @return true if there are any mask needs to be drawn, false otherwise + */ +bool lv_draw_sdl_composite_begin(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords_in, const lv_area_t * clip_in, + const lv_area_t * extension, lv_blend_mode_t blend_mode, lv_area_t * coords_out, + lv_area_t * clip_out, lv_area_t * apply_area); + +void lv_draw_sdl_composite_end(lv_draw_sdl_ctx_t * ctx, const lv_area_t * apply_area, lv_blend_mode_t blend_mode); + +/** + * + * @param ctx Drawing context + * @param id Texture ID + * @param w Maximum width needed + * @param h Maximum height needed + * @param texture_in_cache output to query if the texture is in cache. If it's not in cache, you'll need to destroy it + * by yourself + * @return Obtained texture + */ +SDL_Texture * lv_draw_sdl_composite_texture_obtain(lv_draw_sdl_ctx_t * ctx, lv_draw_sdl_composite_texture_id_t id, + lv_coord_t w, lv_coord_t h, bool * texture_in_cache); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_SDL_COMPOSITE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_img.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_img.c new file mode 100644 index 0000000..4dddc8c --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_img.c @@ -0,0 +1,499 @@ +/** + * @file lv_draw_sdl_img.c + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include "../lv_draw_img.h" +#include "../lv_img_cache.h" +#include "../lv_draw_mask.h" +#include "../../misc/lv_lru.h" +#include "../../misc/lv_gc.h" + +#include "lv_draw_sdl_img.h" +#include "lv_draw_sdl_utils.h" +#include "lv_draw_sdl_texture_cache.h" +#include "lv_draw_sdl_composite.h" +#include "lv_draw_sdl_rect.h" +#include "lv_draw_sdl_layer.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_sdl_cache_key_magic_t magic; + const SDL_Texture * texture; + lv_coord_t w, h, radius; +} lv_draw_img_rounded_key_t; + +enum { + ROUNDED_IMG_PART_LEFT = 0, + ROUNDED_IMG_PART_HCENTER = 1, + ROUNDED_IMG_PART_RIGHT = 2, + ROUNDED_IMG_PART_TOP = 3, + ROUNDED_IMG_PART_VCENTER = 4, + ROUNDED_IMG_PART_BOTTOM = 5, +}; + +enum { + ROUNDED_IMG_CORNER_TOP_LEFT = 0, + ROUNDED_IMG_CORNER_TOP_RIGHT = 1, + ROUNDED_IMG_CORNER_BOTTOM_RIGHT = 2, + ROUNDED_IMG_CORNER_BOTTOM_LEFT = 3, +}; + +/********************** + * STATIC PROTOTYPES + **********************/ + +static SDL_Texture * upload_img_texture(SDL_Renderer * renderer, lv_img_decoder_dsc_t * dsc); + +static SDL_Texture * upload_img_texture_fallback(SDL_Renderer * renderer, lv_img_decoder_dsc_t * dsc); + +static bool check_mask_simple_radius(const lv_area_t * coords, lv_coord_t * radius); + +static void draw_img_simple(lv_draw_sdl_ctx_t * ctx, SDL_Texture * texture, const lv_draw_sdl_img_header_t * header, + const lv_draw_img_dsc_t * draw_dsc, const lv_area_t * coords, const lv_area_t * clip); + +static void draw_img_rounded(lv_draw_sdl_ctx_t * ctx, SDL_Texture * texture, const lv_draw_sdl_img_header_t * header, + const lv_draw_img_dsc_t * draw_dsc, const lv_area_t * coords, const lv_area_t * clip, + lv_coord_t radius); + +static SDL_Texture * img_rounded_frag_obtain(lv_draw_sdl_ctx_t * ctx, SDL_Texture * texture, + const lv_draw_sdl_img_header_t * header, int w, int h, lv_coord_t radius, + bool * in_cache); + +static lv_draw_img_rounded_key_t rounded_key_create(const SDL_Texture * texture, lv_coord_t w, lv_coord_t h, + lv_coord_t radius); + +static void calc_draw_part(SDL_Texture * texture, const lv_draw_sdl_img_header_t * header, const lv_area_t * coords, + const lv_area_t * clip, SDL_Rect * clipped_src, SDL_Rect * clipped_dst); +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + + +static void apply_recolor_opa(SDL_Texture * texture, const lv_draw_img_dsc_t * draw_dsc); + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_res_t lv_draw_sdl_img_core(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * draw_dsc, + const lv_area_t * coords, const void * src) +{ + const lv_area_t * clip = draw_ctx->clip_area; + lv_draw_sdl_ctx_t * ctx = (lv_draw_sdl_ctx_t *) draw_ctx; + + size_t key_size; + lv_draw_sdl_cache_key_head_img_t * key = lv_draw_sdl_texture_img_key_create(src, draw_dsc->frame_id, &key_size); + bool texture_found = false; + lv_draw_sdl_img_header_t * header = NULL; + SDL_Texture * texture = lv_draw_sdl_texture_cache_get_with_userdata(ctx, key, key_size, &texture_found, + (void **) &header); + bool texture_in_cache = false; + if(!texture_found) { + lv_draw_sdl_img_load_texture(ctx, key, key_size, src, draw_dsc->frame_id, &texture, &header, + &texture_in_cache); + } + else { + texture_in_cache = true; + } + SDL_free(key); + if(!texture || !header) { + return LV_RES_INV; + } + + lv_area_t zoomed_cords; + _lv_img_buf_get_transformed_area(&zoomed_cords, lv_area_get_width(coords), lv_area_get_height(coords), 0, + draw_dsc->zoom, &draw_dsc->pivot); + lv_area_move(&zoomed_cords, coords->x1, coords->y1); + + /* When in > 0, draw simple radius */ + lv_coord_t radius = 0; + /* Coords will be translated so coords will start at (0,0) */ + lv_area_t t_coords = zoomed_cords, t_clip = *clip, apply_area; + + bool has_composite = false; + + if(!check_mask_simple_radius(&t_coords, &radius)) { + has_composite = lv_draw_sdl_composite_begin(ctx, &zoomed_cords, clip, NULL, draw_dsc->blend_mode, + &t_coords, &t_clip, &apply_area); + } + + lv_draw_sdl_transform_areas_offset(ctx, has_composite, &apply_area, &t_coords, &t_clip); + + SDL_Rect clip_rect, coords_rect; + lv_area_to_sdl_rect(&t_clip, &clip_rect); + lv_area_to_sdl_rect(&t_coords, &coords_rect); + + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + + if(radius > 0) { + draw_img_rounded(ctx, texture, header, draw_dsc, &t_coords, &t_clip, radius); + } + else { + draw_img_simple(ctx, texture, header, draw_dsc, &t_coords, &t_clip); + } + + lv_draw_sdl_composite_end(ctx, &apply_area, draw_dsc->blend_mode); + + if(!texture_in_cache) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + if(!header->managed) { + SDL_DestroyTexture(texture); + } + lv_mem_free(header); + } + + return LV_RES_OK; +} + +static void calc_draw_part(SDL_Texture * texture, const lv_draw_sdl_img_header_t * header, const lv_area_t * coords, + const lv_area_t * clip, SDL_Rect * clipped_src, SDL_Rect * clipped_dst) +{ + double x = 0, y = 0, w, h; + if(SDL_RectEmpty(&header->rect)) { + Uint32 format = 0; + int access = 0, tw, th; + SDL_QueryTexture(texture, &format, &access, &tw, &th); + w = tw; + h = th; + } + else { + x = header->rect.x; + y = header->rect.y; + w = header->rect.w; + h = header->rect.h; + } + if(clip) { + lv_area_t clipped_area; + _lv_area_intersect(&clipped_area, coords, clip); + lv_area_to_sdl_rect(&clipped_area, clipped_dst); + } + else { + lv_area_to_sdl_rect(coords, clipped_dst); + } + lv_coord_t coords_w = lv_area_get_width(coords), coords_h = lv_area_get_height(coords); + clipped_src->x = (int)(x + (clipped_dst->x - coords->x1) * w / coords_w); + clipped_src->y = (int)(y + (clipped_dst->y - coords->y1) * h / coords_h); + clipped_src->w = (int)(w - (coords_w - clipped_dst->w) * w / coords_w); + clipped_src->h = (int)(h - (coords_h - clipped_dst->h) * h / coords_h); +} + +bool lv_draw_sdl_img_load_texture(lv_draw_sdl_ctx_t * ctx, lv_draw_sdl_cache_key_head_img_t * key, size_t key_size, + const void * src, int32_t frame_id, SDL_Texture ** texture, + lv_draw_sdl_img_header_t ** header, bool * texture_in_cache) +{ + _lv_img_cache_entry_t * cdsc = _lv_img_cache_open(src, lv_color_white(), frame_id); + lv_draw_sdl_cache_flag_t tex_flags = 0; + SDL_Rect rect; + SDL_memset(&rect, 0, sizeof(SDL_Rect)); + if(cdsc) { + lv_img_decoder_dsc_t * dsc = &cdsc->dec_dsc; + if(dsc->user_data && SDL_memcmp(dsc->user_data, LV_DRAW_SDL_DEC_DSC_TEXTURE_HEAD, 8) == 0) { + lv_draw_sdl_dec_dsc_userdata_t * ptr = (lv_draw_sdl_dec_dsc_userdata_t *) dsc->user_data; + *texture = ptr->texture; + rect = ptr->rect; + if(ptr->texture_managed) { + tex_flags |= LV_DRAW_SDL_CACHE_FLAG_MANAGED; + } + ptr->texture_referenced = true; + } + else { + *texture = upload_img_texture(ctx->renderer, dsc); + } +#if LV_IMG_CACHE_DEF_SIZE == 0 + lv_img_decoder_close(dsc); +#endif + } + if(texture && cdsc) { + *header = lv_mem_alloc(sizeof(lv_draw_sdl_img_header_t)); + SDL_memcpy(&(*header)->base, &cdsc->dec_dsc.header, sizeof(lv_img_header_t)); + (*header)->rect = rect; + (*header)->managed = (tex_flags & LV_DRAW_SDL_CACHE_FLAG_MANAGED) != 0; + *texture_in_cache = lv_draw_sdl_texture_cache_put_advanced(ctx, key, key_size, *texture, *header, SDL_free, + tex_flags); + return true; + } + else { + *texture_in_cache = lv_draw_sdl_texture_cache_put(ctx, key, key_size, NULL); + return false; + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static SDL_Texture * upload_img_texture(SDL_Renderer * renderer, lv_img_decoder_dsc_t * dsc) +{ + if(!dsc->img_data) { + return upload_img_texture_fallback(renderer, dsc); + } + bool chroma_keyed = dsc->header.cf == (uint32_t) LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED; + int h = (int) dsc->header.h; + int w = (int) dsc->header.w; + void * data = (void *) dsc->img_data; + Uint32 rmask = 0x00FF0000; + Uint32 gmask = 0x0000FF00; + Uint32 bmask = 0x000000FF; + Uint32 amask = 0xFF000000; + if(chroma_keyed) { + amask = 0x00; + } + SDL_Surface * surface = SDL_CreateRGBSurfaceFrom(data, w, h, LV_COLOR_DEPTH, w * LV_COLOR_DEPTH / 8, + rmask, gmask, bmask, amask); + SDL_SetColorKey(surface, chroma_keyed, lv_color_to32(LV_COLOR_CHROMA_KEY)); + SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, surface); + SDL_FreeSurface(surface); + return texture; +} + +static SDL_Texture * upload_img_texture_fallback(SDL_Renderer * renderer, lv_img_decoder_dsc_t * dsc) +{ + lv_coord_t h = (lv_coord_t) dsc->header.h; + lv_coord_t w = (lv_coord_t) dsc->header.w; + uint8_t * data = lv_mem_buf_get(w * h * sizeof(lv_color_t)); + for(lv_coord_t y = 0; y < h; y++) { + lv_img_decoder_read_line(dsc, 0, y, w, &data[y * w * sizeof(lv_color_t)]); + } + Uint32 rmask = 0x00FF0000; + Uint32 gmask = 0x0000FF00; + Uint32 bmask = 0x000000FF; + Uint32 amask = 0xFF000000; + SDL_Surface * surface = SDL_CreateRGBSurfaceFrom(data, w, h, LV_COLOR_DEPTH, w * LV_COLOR_DEPTH / 8, + rmask, gmask, bmask, amask); + SDL_SetColorKey(surface, SDL_TRUE, lv_color_to32(LV_COLOR_CHROMA_KEY)); + SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, surface); + SDL_FreeSurface(surface); + lv_mem_buf_release(data); + return texture; +} + +/** + * Check if there is only one radius mask + * @param radius Set to radius value if the only mask is a radius mask + * @return true if the only mask is a radius mask + */ +static bool check_mask_simple_radius(const lv_area_t * coords, lv_coord_t * radius) +{ + if(lv_draw_mask_get_cnt() != 1) return false; + for(uint8_t i = 0; i < _LV_MASK_MAX_NUM; i++) { + _lv_draw_mask_common_dsc_t * param = LV_GC_ROOT(_lv_draw_mask_list[i]).param; + if(param->type == LV_DRAW_MASK_TYPE_RADIUS) { + lv_draw_mask_radius_param_t * rparam = (lv_draw_mask_radius_param_t *) param; + if(rparam->cfg.outer) return false; + if(!_lv_area_is_equal(&rparam->cfg.rect, coords)) return false; + *radius = rparam->cfg.radius; + return true; + } + } + return false; +} + +static void draw_img_simple(lv_draw_sdl_ctx_t * ctx, SDL_Texture * texture, const lv_draw_sdl_img_header_t * header, + const lv_draw_img_dsc_t * draw_dsc, const lv_area_t * coords, const lv_area_t * clip) +{ + apply_recolor_opa(texture, draw_dsc); + SDL_Point pivot = {.x = draw_dsc->pivot.x, .y = draw_dsc->pivot.y}; + + /*Image needs to be rotated, so we have to use clip rect which is slower*/ + if(draw_dsc->angle != 0) { + /* No radius, set clip here */ + SDL_Rect clip_rect; + lv_area_to_sdl_rect(clip, &clip_rect); + SDL_RenderSetClipRect(ctx->renderer, &clip_rect); + } + SDL_Rect src_rect, dst_rect; + calc_draw_part(texture, header, coords, clip, &src_rect, &dst_rect); + SDL_RenderCopyEx(ctx->renderer, texture, &src_rect, &dst_rect, draw_dsc->angle, &pivot, SDL_FLIP_NONE); + if(draw_dsc->angle != 0) { + SDL_RenderSetClipRect(ctx->renderer, NULL); + } +} + + +static void draw_img_rounded(lv_draw_sdl_ctx_t * ctx, SDL_Texture * texture, const lv_draw_sdl_img_header_t * header, + const lv_draw_img_dsc_t * draw_dsc, const lv_area_t * coords, const lv_area_t * clip, + lv_coord_t radius) +{ + const int w = lv_area_get_width(coords), h = lv_area_get_height(coords); + lv_coord_t real_radius = LV_MIN3(radius, w, h); + bool frag_in_cache = false; + SDL_Texture * frag = img_rounded_frag_obtain(ctx, texture, header, w, h, real_radius, &frag_in_cache); + apply_recolor_opa(frag, draw_dsc); + lv_draw_sdl_rect_bg_frag_draw_corners(ctx, frag, real_radius, coords, clip, true); + + apply_recolor_opa(texture, draw_dsc); + + SDL_Rect src_rect, dst_rect; + /* Draw 3 parts */ + lv_area_t clip_tmp, part; + calc_draw_part(texture, header, coords, NULL, &src_rect, &dst_rect); + for(int i = w > h ? ROUNDED_IMG_PART_LEFT : ROUNDED_IMG_PART_TOP, j = i + 3; i <= j; i++) { + switch(i) { + case ROUNDED_IMG_PART_LEFT: + lv_area_set(&part, coords->x1, coords->y1 + radius, coords->x1 + radius - 1, coords->y2 - radius); + break; + case ROUNDED_IMG_PART_HCENTER: + lv_area_set(&part, coords->x1 + radius, coords->y1, coords->x2 - radius, coords->y2); + break; + case ROUNDED_IMG_PART_RIGHT: + lv_area_set(&part, coords->x2 - radius + 1, coords->y1 + radius, coords->x2, coords->y2 - radius); + break; + case ROUNDED_IMG_PART_TOP: + lv_area_set(&part, coords->x1 + radius, coords->y1, coords->x2 - radius, coords->y1 + radius - 1); + break; + case ROUNDED_IMG_PART_VCENTER: + lv_area_set(&part, coords->x1 + radius, coords->y2 - radius + 1, coords->x2 - radius, coords->y2); + break; + case ROUNDED_IMG_PART_BOTTOM: + lv_area_set(&part, coords->x1, coords->y1 + radius, coords->x2, coords->y2 - radius); + break; + default: + break; + } + if(!_lv_area_intersect(&clip_tmp, &part, clip)) continue; + SDL_Rect clip_rect; + lv_area_to_sdl_rect(&clip_tmp, &clip_rect); + SDL_RenderSetClipRect(ctx->renderer, &clip_rect); + SDL_RenderCopy(ctx->renderer, texture, &src_rect, &dst_rect); + } + SDL_RenderSetClipRect(ctx->renderer, NULL); + + if(!frag_in_cache) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(frag); + } +} + +static void apply_recolor_opa(SDL_Texture * texture, const lv_draw_img_dsc_t * draw_dsc) +{ + if(draw_dsc->recolor_opa > LV_OPA_TRANSP) { + /* Draw with mixed recolor */ + lv_color_t recolor = lv_color_mix(draw_dsc->recolor, lv_color_white(), draw_dsc->recolor_opa); + SDL_SetTextureColorMod(texture, recolor.ch.red, recolor.ch.green, recolor.ch.blue); + } + else { + /* Draw with no recolor */ + SDL_SetTextureColorMod(texture, 0xFF, 0xFF, 0xFF); + } + SDL_SetTextureAlphaMod(texture, draw_dsc->opa); +} + +static SDL_Texture * img_rounded_frag_obtain(lv_draw_sdl_ctx_t * ctx, SDL_Texture * texture, + const lv_draw_sdl_img_header_t * header, int w, int h, lv_coord_t radius, + bool * in_cache) +{ + lv_draw_img_rounded_key_t key = rounded_key_create(texture, w, h, radius); + bool mask_frag_in_cache = false; + SDL_Texture * mask_frag = lv_draw_sdl_rect_bg_frag_obtain(ctx, radius, &mask_frag_in_cache); + SDL_Texture * img_frag = lv_draw_sdl_texture_cache_get(ctx, &key, sizeof(key), NULL); + if(img_frag == NULL) { + const lv_coord_t full_frag_size = radius * 2 + 3; + img_frag = SDL_CreateTexture(ctx->renderer, LV_DRAW_SDL_TEXTURE_FORMAT, SDL_TEXTUREACCESS_TARGET, + full_frag_size, full_frag_size); + SDL_assert(img_frag); + SDL_SetTextureBlendMode(img_frag, SDL_BLENDMODE_BLEND); + SDL_Texture * old_target = SDL_GetRenderTarget(ctx->renderer); + SDL_SetRenderTarget(ctx->renderer, img_frag); + SDL_SetRenderDrawColor(ctx->renderer, 0, 0, 0, 0); + /* SDL_RenderClear is not working properly, so we overwrite the target with solid color */ + SDL_SetRenderDrawBlendMode(ctx->renderer, SDL_BLENDMODE_NONE); + SDL_RenderFillRect(ctx->renderer, NULL); + SDL_SetRenderDrawBlendMode(ctx->renderer, SDL_BLENDMODE_BLEND); + + lv_area_t coords = {0, 0, w - 1, h - 1}; + lv_area_t frag_coords = {0, 0, full_frag_size - 1, full_frag_size - 1}; + lv_draw_sdl_rect_bg_frag_draw_corners(ctx, mask_frag, radius, &frag_coords, NULL, false); + + SDL_SetTextureAlphaMod(texture, 0xFF); + SDL_SetTextureColorMod(texture, 0xFF, 0xFF, 0xFF); +#if LV_GPU_SDL_CUSTOM_BLEND_MODE + SDL_BlendMode blend_mode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ZERO, + SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_DST_ALPHA, + SDL_BLENDFACTOR_ZERO, SDL_BLENDOPERATION_ADD); + SDL_SetTextureBlendMode(texture, blend_mode); +#else + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_MOD); +#endif + SDL_Rect srcrect, cliprect, dstrect = {0, 0, radius, radius}; + + cliprect.w = cliprect.h = radius; + for(int i = 0; i <= ROUNDED_IMG_CORNER_BOTTOM_LEFT; i++) { + switch(i) { + case ROUNDED_IMG_CORNER_TOP_LEFT: + cliprect.x = 0; + cliprect.y = 0; + lv_area_align(&frag_coords, &coords, LV_ALIGN_TOP_LEFT, 0, 0); + break; + case ROUNDED_IMG_CORNER_TOP_RIGHT: + cliprect.x = full_frag_size - radius; + cliprect.y = 0; + lv_area_align(&frag_coords, &coords, LV_ALIGN_TOP_RIGHT, 0, 0); + break; + case ROUNDED_IMG_CORNER_BOTTOM_RIGHT: + cliprect.x = full_frag_size - radius; + cliprect.y = full_frag_size - radius; + lv_area_align(&frag_coords, &coords, LV_ALIGN_BOTTOM_RIGHT, 0, 0); + break; + case ROUNDED_IMG_CORNER_BOTTOM_LEFT: + cliprect.x = 0; + cliprect.y = full_frag_size - radius; + lv_area_align(&frag_coords, &coords, LV_ALIGN_BOTTOM_LEFT, 0, 0); + break; + default: + break; + } + calc_draw_part(texture, header, &coords, NULL, &srcrect, &dstrect); + SDL_RenderSetClipRect(ctx->renderer, &cliprect); + SDL_RenderCopy(ctx->renderer, texture, &srcrect, &dstrect); + } + SDL_RenderSetClipRect(ctx->renderer, NULL); + + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + + SDL_SetRenderTarget(ctx->renderer, old_target); + *in_cache = lv_draw_sdl_texture_cache_put(ctx, &key, sizeof(key), img_frag); + } + else { + *in_cache = true; + } + if(!mask_frag_in_cache) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(mask_frag); + } + return img_frag; +} + +static lv_draw_img_rounded_key_t rounded_key_create(const SDL_Texture * texture, lv_coord_t w, lv_coord_t h, + lv_coord_t radius) +{ + lv_draw_img_rounded_key_t key; + SDL_memset(&key, 0, sizeof(key)); + key.magic = LV_GPU_CACHE_KEY_MAGIC_IMG_ROUNDED_CORNERS; + key.texture = texture; + key.w = w; + key.h = h; + key.radius = radius; + return key; +} + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_img.h b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_img.h new file mode 100644 index 0000000..6233913 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_img.h @@ -0,0 +1,86 @@ +/** + * @file lv_draw_sdl_img.h + * + */ + +#ifndef LV_DRAW_SDL_IMG_H +#define LV_DRAW_SDL_IMG_H + + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include LV_GPU_SDL_INCLUDE_PATH + +#include "../lv_draw.h" + +#include "lv_draw_sdl_texture_cache.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct lv_draw_sdl_img_header_t { + lv_img_header_t base; + SDL_Rect rect; + bool managed; +} lv_draw_sdl_img_header_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/*====================== + * Add/remove functions + *=====================*/ + +/*===================== + * Setter functions + *====================*/ + +/*===================== + * Getter functions + *====================*/ + +/*===================== + * Other functions + *====================*/ +/** + * + * @param ctx Drawing context + * @param key Texture cache key + * @param key_size Size of texture cache key + * @param src Image source pointer + * @param frame_id Frame ID for animated image + * @param texture Texture for render + * @param header Header also holds sdl image info + * @param texture_in_cache Whether the texture has been put in the cache. Please note for managed texture, + * this will be false too. So you'll need to check header.managed too. + * @return Whether the image has been loaded successfully + */ +bool lv_draw_sdl_img_load_texture(lv_draw_sdl_ctx_t * ctx, lv_draw_sdl_cache_key_head_img_t * key, size_t key_size, + const void * src, int32_t frame_id, SDL_Texture ** texture, + lv_draw_sdl_img_header_t ** header, bool * texture_in_cache); +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_SDL*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_SDL_IMG_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_label.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_label.c new file mode 100644 index 0000000..d043c51 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_label.c @@ -0,0 +1,189 @@ +/** + * @file lv_draw_sdl_label.c + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include LV_GPU_SDL_INCLUDE_PATH + +#include "../lv_draw_label.h" +#include "../../misc/lv_utils.h" + +#include "lv_draw_sdl_utils.h" +#include "lv_draw_sdl_texture_cache.h" +#include "lv_draw_sdl_composite.h" +#include "lv_draw_sdl_layer.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_sdl_cache_key_magic_t magic; + const lv_font_t * font_p; + uint32_t letter; +} lv_font_glyph_key_t; + +/********************** + * STATIC PROTOTYPES + **********************/ + +static lv_font_glyph_key_t font_key_glyph_create(const lv_font_t * font_p, uint32_t letter); + + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_draw_sdl_draw_letter(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p, + uint32_t letter) +{ + const lv_area_t * clip_area = draw_ctx->clip_area; + const lv_font_t * font_p = dsc->font; + lv_opa_t opa = dsc->opa; + lv_color_t color = dsc->color; + if(opa < LV_OPA_MIN) return; + if(opa > LV_OPA_MAX) opa = LV_OPA_COVER; + + if(font_p == NULL) { + LV_LOG_WARN("lv_draw_letter: font is NULL"); + return; + } + + lv_font_glyph_dsc_t g; + bool g_ret = lv_font_get_glyph_dsc(font_p, &g, letter, '\0'); + if(g_ret == false) { + /*Add warning if the dsc is not found + *but do not print warning for non printable ASCII chars (e.g. '\n')*/ + if(letter >= 0x20 && + letter != 0xf8ff && /*LV_SYMBOL_DUMMY*/ + letter != 0x200c) { /*ZERO WIDTH NON-JOINER*/ + LV_LOG_WARN("lv_draw_letter: glyph dsc. not found for U+%X", letter); + + /* draw placeholder */ + lv_area_t glyph_coords; + lv_draw_rect_dsc_t glyph_dsc; + lv_coord_t begin_x = pos_p->x + g.ofs_x; + lv_coord_t begin_y = pos_p->y + g.ofs_y; + lv_area_set(&glyph_coords, begin_x, begin_y, begin_x + g.box_w, begin_y + g.box_h); + lv_draw_rect_dsc_init(&glyph_dsc); + glyph_dsc.bg_opa = LV_OPA_MIN; + glyph_dsc.outline_opa = LV_OPA_MIN; + glyph_dsc.shadow_opa = LV_OPA_MIN; + glyph_dsc.bg_img_opa = LV_OPA_MIN; + glyph_dsc.border_color = dsc->color; + glyph_dsc.border_width = 1; + draw_ctx->draw_rect(draw_ctx, &glyph_dsc, &glyph_coords); + } + return; + } + + /*Don't draw anything if the character is empty. E.g. space*/ + if((g.box_h == 0) || (g.box_w == 0)) return; + + int32_t pos_x = pos_p->x + g.ofs_x; + int32_t pos_y = pos_p->y + (font_p->line_height - font_p->base_line) - g.box_h - g.ofs_y; + + const lv_area_t letter_area = {pos_x, pos_y, pos_x + g.box_w - 1, pos_y + g.box_h - 1}; + lv_area_t draw_area; + + /*If the letter is completely out of mask don't draw it*/ + if(!_lv_area_intersect(&draw_area, &letter_area, clip_area)) { + return; + } + + lv_draw_sdl_ctx_t * ctx = (lv_draw_sdl_ctx_t *) draw_ctx; + SDL_Renderer * renderer = ctx->renderer; + + lv_font_glyph_key_t glyph_key = font_key_glyph_create(font_p, letter); + bool glyph_found = false; + SDL_Texture * texture = lv_draw_sdl_texture_cache_get(ctx, &glyph_key, sizeof(glyph_key), &glyph_found); + bool in_cache = false; + if(!glyph_found) { + if(g.resolved_font) { + font_p = g.resolved_font; + } + const uint8_t * bmp = lv_font_get_glyph_bitmap(font_p, letter); + uint8_t * buf = lv_mem_alloc(g.box_w * g.box_h); + lv_sdl_to_8bpp(buf, bmp, g.box_w, g.box_h, g.box_w, g.bpp); + SDL_Surface * mask = lv_sdl_create_opa_surface(buf, g.box_w, g.box_h, g.box_w); + texture = SDL_CreateTextureFromSurface(renderer, mask); + SDL_FreeSurface(mask); + lv_mem_free(buf); + in_cache = lv_draw_sdl_texture_cache_put(ctx, &glyph_key, sizeof(glyph_key), texture); + } + else { + in_cache = true; + } + if(!texture) { + return; + } + + lv_area_t t_letter = letter_area, t_clip = *clip_area, apply_area; + bool has_composite = lv_draw_sdl_composite_begin(ctx, &letter_area, clip_area, NULL, dsc->blend_mode, &t_letter, + &t_clip, &apply_area); + + lv_draw_sdl_transform_areas_offset(ctx, has_composite, &apply_area, &t_letter, &t_clip); + + /*If the letter is completely out of mask don't draw it*/ + if(!_lv_area_intersect(&draw_area, &t_letter, &t_clip)) { + if(!in_cache) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(texture); + } + return; + } + SDL_Rect srcrect, dstrect; + lv_area_to_sdl_rect(&draw_area, &dstrect); + srcrect.x = draw_area.x1 - t_letter.x1; + srcrect.y = draw_area.y1 - t_letter.y1; + srcrect.w = dstrect.w; + srcrect.h = dstrect.h; + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + SDL_SetTextureAlphaMod(texture, opa); + SDL_SetTextureColorMod(texture, color.ch.red, color.ch.green, color.ch.blue); + SDL_RenderCopy(renderer, texture, &srcrect, &dstrect); + + lv_draw_sdl_composite_end(ctx, &apply_area, dsc->blend_mode); + + if(!in_cache) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(texture); + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static lv_font_glyph_key_t font_key_glyph_create(const lv_font_t * font_p, uint32_t letter) +{ + lv_font_glyph_key_t key; + /* VERY IMPORTANT! Padding between members is uninitialized, so we have to wipe them manually */ + SDL_memset(&key, 0, sizeof(key)); + key.magic = LV_GPU_CACHE_KEY_MAGIC_FONT_GLYPH; + key.font_p = font_p; + key.letter = letter; + return key; +} + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_layer.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_layer.c new file mode 100644 index 0000000..d517636 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_layer.c @@ -0,0 +1,147 @@ +/** + * @file lv_draw_sdl_refr.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include "../../core/lv_refr.h" + +#include "lv_draw_sdl.h" +#include "lv_draw_sdl_priv.h" +#include "lv_draw_sdl_composite.h" +#include "lv_draw_sdl_utils.h" +#include "lv_draw_sdl_layer.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_draw_layer_ctx_t * lv_draw_sdl_layer_init(lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx, + lv_draw_layer_flags_t flags) +{ + lv_draw_sdl_ctx_t * ctx = (lv_draw_sdl_ctx_t *) draw_ctx; + SDL_Renderer * renderer = ctx->renderer; + + lv_draw_sdl_layer_ctx_t * transform_ctx = (lv_draw_sdl_layer_ctx_t *) layer_ctx; + + transform_ctx->flags = flags; + transform_ctx->orig_target = SDL_GetRenderTarget(renderer); + + lv_coord_t target_w = lv_area_get_width(&layer_ctx->area_full); + lv_coord_t target_h = lv_area_get_height(&layer_ctx->area_full); + + enum lv_draw_sdl_composite_texture_id_t texture_id = LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_TRANSFORM0 + + ctx->internals->transform_count; + transform_ctx->target = lv_draw_sdl_composite_texture_obtain(ctx, texture_id, target_w, target_h, + &transform_ctx->target_in_cache); + transform_ctx->target_rect.x = 0; + transform_ctx->target_rect.y = 0; + transform_ctx->target_rect.w = target_w; + transform_ctx->target_rect.h = target_h; + + layer_ctx->max_row_with_alpha = target_h; + layer_ctx->max_row_with_no_alpha = target_h; + + SDL_SetTextureBlendMode(transform_ctx->target, SDL_BLENDMODE_BLEND); + SDL_SetRenderTarget(renderer, transform_ctx->target); + + /* SDL_RenderClear is not working properly, so we overwrite the target with solid color */ + SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE); + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0); + SDL_RenderFillRect(renderer, NULL); + SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND); + + /* Set proper drawing context for transform layer */ + ctx->internals->transform_count += 1; + draw_ctx->buf_area = &layer_ctx->area_full; + draw_ctx->clip_area = &layer_ctx->area_full; + + return layer_ctx; +} + +void lv_draw_sdl_layer_blend(lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx, + const lv_draw_img_dsc_t * draw_dsc) +{ + lv_draw_sdl_ctx_t * ctx = (lv_draw_sdl_ctx_t *) draw_ctx; + lv_draw_sdl_layer_ctx_t * transform_ctx = (lv_draw_sdl_layer_ctx_t *) layer_ctx; + + SDL_Renderer * renderer = ctx->renderer; + + SDL_Rect trans_rect; + + if(transform_ctx->flags & LV_DRAW_LAYER_FLAG_CAN_SUBDIVIDE) { + lv_area_zoom_to_sdl_rect(&layer_ctx->area_act, &trans_rect, draw_dsc->zoom, &draw_dsc->pivot); + } + else { + lv_area_zoom_to_sdl_rect(&layer_ctx->area_full, &trans_rect, draw_dsc->zoom, &draw_dsc->pivot); + } + + SDL_SetRenderTarget(renderer, transform_ctx->orig_target); + + /*Render off-screen texture, transformed*/ + SDL_Rect clip_rect; + lv_area_to_sdl_rect(layer_ctx->original.clip_area, &clip_rect); + SDL_Point center = {.x = draw_dsc->pivot.x, .y = draw_dsc->pivot.y}; + SDL_RenderSetClipRect(renderer, &clip_rect); + SDL_SetTextureAlphaMod(transform_ctx->target, draw_dsc->opa); + SDL_RenderCopyEx(renderer, transform_ctx->target, &transform_ctx->target_rect, &trans_rect, + draw_dsc->angle, ¢er, SDL_FLIP_NONE); + SDL_RenderSetClipRect(renderer, NULL); +} + +void lv_draw_sdl_layer_destroy(lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx) +{ + lv_draw_sdl_ctx_t * ctx = (lv_draw_sdl_ctx_t *) draw_ctx; + lv_draw_sdl_layer_ctx_t * transform_ctx = (lv_draw_sdl_layer_ctx_t *) layer_ctx; + if(!transform_ctx->target_in_cache && transform_ctx->target != NULL) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(transform_ctx->target); + } + ctx->internals->transform_count -= 1; +} + +void lv_draw_sdl_transform_areas_offset(lv_draw_sdl_ctx_t * ctx, bool has_composite, lv_area_t * apply_area, + lv_area_t * coords, lv_area_t * clip) +{ + if(ctx->internals->transform_count == 0) { + return; + } + lv_area_t * area = ctx->base_draw.buf_area; + lv_area_move(coords, -area->x1, -area->y1); + lv_area_move(clip, -area->x1, -area->y1); + if(has_composite) { + lv_area_move(apply_area, -area->x1, -area->y1); + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_layer.h b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_layer.h new file mode 100644 index 0000000..f6aa668 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_layer.h @@ -0,0 +1,56 @@ +/** + * @file lv_draw_sdl_refr.h + * + */ + +#ifndef LV_TEMPL_H +#define LV_TEMPL_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "lv_draw_sdl.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ +typedef struct _lv_draw_sdl_layer_ctx_t { + lv_draw_layer_ctx_t base; + + SDL_Texture * orig_target; + SDL_Texture * target; + SDL_Rect target_rect; + bool target_in_cache; + lv_draw_layer_flags_t flags; +} lv_draw_sdl_layer_ctx_t; +/********************** + * GLOBAL PROTOTYPES + **********************/ + +lv_draw_layer_ctx_t * lv_draw_sdl_layer_init(lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx, + lv_draw_layer_flags_t flags); + +void lv_draw_sdl_layer_blend(lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * transform_ctx, + const lv_draw_img_dsc_t * draw_dsc); + +void lv_draw_sdl_layer_destroy(lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx); + +void lv_draw_sdl_transform_areas_offset(lv_draw_sdl_ctx_t * ctx, bool has_composite, lv_area_t * apply_area, + lv_area_t * coords, lv_area_t * clip); +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_TEMPL_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_line.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_line.c new file mode 100644 index 0000000..204e1a3 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_line.c @@ -0,0 +1,157 @@ +/** + * @file lv_draw_sdl_line.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include "lv_draw_sdl.h" +#include "lv_draw_sdl_utils.h" +#include "lv_draw_sdl_texture_cache.h" +#include "lv_draw_sdl_composite.h" +#include "lv_draw_sdl_mask.h" + +/********************* + * DEFINES + *********************/ +#define ROUND_START 0x01 +#define ROUND_END 0x02 +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_sdl_cache_key_magic_t magic; + lv_coord_t length; + lv_coord_t width; + uint8_t round; +} lv_draw_line_key_t; + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +static lv_draw_line_key_t line_key_create(const lv_draw_line_dsc_t * dsc, lv_coord_t length); + +static SDL_Texture * line_texture_create(lv_draw_sdl_ctx_t * sdl_ctx, const lv_draw_line_dsc_t * dsc, + lv_coord_t length); + +/********************** + * GLOBAL FUNCTIONS + **********************/ +void lv_draw_sdl_draw_line(lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, const lv_point_t * point1, + const lv_point_t * point2, bool * in_cache) +{ + lv_draw_sdl_ctx_t * sdl_ctx = (lv_draw_sdl_ctx_t *) draw_ctx; + SDL_Renderer * renderer = sdl_ctx->renderer; + lv_coord_t x1 = point1->x, x2 = point2->x, y1 = point1->y, y2 = point2->y; + double length = SDL_sqrt(SDL_pow(x2 - x1, 2) + SDL_pow(y2 - y1, 2)); + if(length - (long) length > 0.5) { + length = (long) length + 1; + } + + double angle = SDL_atan2(y2 - y1, x2 - x1) * 180 / M_PI; + lv_draw_line_key_t key = line_key_create(dsc, (lv_coord_t) length); + SDL_Texture * texture = lv_draw_sdl_texture_cache_get(sdl_ctx, &key, sizeof(key), NULL); + if(!texture) { + texture = line_texture_create(sdl_ctx, dsc, (lv_coord_t) length); + *in_cache = lv_draw_sdl_texture_cache_put(sdl_ctx, &key, sizeof(key), texture); + } + + lv_area_t coords = {x1, y1, x2, y2}; + const lv_area_t * clip = draw_ctx->clip_area; + + SDL_Rect coords_r, clip_r; + lv_area_to_sdl_rect(&coords, &coords_r); + lv_area_to_sdl_rect(clip, &clip_r); + + lv_area_t t_coords = coords, t_clip = *clip, apply_area; + lv_area_t extension = {dsc->width / 2, dsc->width / 2, dsc->width / 2, dsc->width / 2}; + lv_draw_sdl_composite_begin(sdl_ctx, &coords, clip, &extension, dsc->blend_mode, &t_coords, &t_clip, + &apply_area); + + SDL_Color color; + lv_color_to_sdl_color(&dsc->color, &color); + + SDL_SetTextureColorMod(texture, color.r, color.g, color.b); + SDL_SetTextureAlphaMod(texture, dsc->opa); + SDL_Rect srcrect = {0, 0, (int) length + dsc->width + 2, dsc->width + 2}, + dstrect = {t_coords.x1 - 1 - dsc->width / 2, t_coords.y1 - 1, srcrect.w, srcrect.h}; + SDL_Point center = {1 + dsc->width / 2, 1 + dsc->width / 2}; + + SDL_Rect clip_rect; + lv_area_to_sdl_rect(&t_clip, &clip_rect); + if(!SDL_RectEquals(&clip_rect, &dstrect) || angle != 0) { + SDL_RenderSetClipRect(renderer, &clip_rect); + } + SDL_RenderCopyEx(renderer, texture, &srcrect, &dstrect, angle, ¢er, 0); + SDL_RenderSetClipRect(renderer, NULL); + + lv_draw_sdl_composite_end(sdl_ctx, &apply_area, dsc->blend_mode); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static lv_draw_line_key_t line_key_create(const lv_draw_line_dsc_t * dsc, lv_coord_t length) +{ + lv_draw_line_key_t key; + lv_memset_00(&key, sizeof(lv_draw_line_key_t)); + key.magic = LV_GPU_CACHE_KEY_MAGIC_LINE; + key.length = length; + key.width = dsc->width; + key.round = (dsc->round_start ? ROUND_START : 0) | (dsc->round_end ? ROUND_END : 0); + return key; +} + +static SDL_Texture * line_texture_create(lv_draw_sdl_ctx_t * sdl_ctx, const lv_draw_line_dsc_t * dsc, lv_coord_t length) +{ + SDL_Texture * texture = SDL_CreateTexture(sdl_ctx->renderer, LV_DRAW_SDL_TEXTURE_FORMAT, SDL_TEXTUREACCESS_TARGET, + length + dsc->width + 2, dsc->width + 2); + SDL_Texture * target = SDL_GetRenderTarget(sdl_ctx->renderer); + SDL_SetRenderTarget(sdl_ctx->renderer, texture); + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + SDL_SetRenderDrawColor(sdl_ctx->renderer, 0xFF, 0xFF, 0xFF, 0x0); + /* SDL_RenderClear is not working properly, so we overwrite the target with solid color */ + SDL_SetRenderDrawBlendMode(sdl_ctx->renderer, SDL_BLENDMODE_NONE); + SDL_RenderFillRect(sdl_ctx->renderer, NULL); + SDL_SetRenderDrawBlendMode(sdl_ctx->renderer, SDL_BLENDMODE_BLEND); + SDL_SetRenderDrawColor(sdl_ctx->renderer, 0xFF, 0xFF, 0xFF, 0xFF); + SDL_Rect line_rect = {1 + dsc->width / 2, 1, length, dsc->width}; + SDL_RenderFillRect(sdl_ctx->renderer, &line_rect); + if(dsc->round_start || dsc->round_end) { + lv_draw_mask_radius_param_t param; + lv_area_t round_area = {0, 0, dsc->width - 1, dsc->width - 1}; + lv_draw_mask_radius_init(¶m, &round_area, LV_RADIUS_CIRCLE, false); + + int16_t mask_id = lv_draw_mask_add(¶m, NULL); + SDL_Texture * round_texture = lv_draw_sdl_mask_dump_texture(sdl_ctx->renderer, &round_area, &mask_id, 1); + lv_draw_mask_remove_id(mask_id); + + SDL_Rect round_src = {0, 0, dsc->width, dsc->width}; + SDL_Rect round_dst = {line_rect.x - dsc->width / 2, 1, dsc->width, dsc->width}; + SDL_RenderCopy(sdl_ctx->renderer, round_texture, &round_src, &round_dst); + round_dst.x = line_rect.w + dsc->width / 2; + SDL_RenderCopy(sdl_ctx->renderer, round_texture, &round_src, &round_dst); + SDL_DestroyTexture(round_texture); + } + + SDL_SetRenderTarget(sdl_ctx->renderer, target); + return texture; +} + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_mask.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_mask.c new file mode 100644 index 0000000..7bb5bbb --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_mask.c @@ -0,0 +1,84 @@ +/** + * @file lv_draw_sdl_mask.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include "../../misc/lv_gc.h" +#include "lv_draw_sdl_mask.h" +#include "lv_draw_sdl_utils.h" + +/********************* + * DEFINES + *********************/ +#ifndef HAVE_SDL_CUSTOM_BLEND_MODE + #define HAVE_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6)) +#endif + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_opa_t * lv_draw_sdl_mask_dump_opa(const lv_area_t * coords, const int16_t * ids, int16_t ids_count) +{ + SDL_assert(coords->x2 >= coords->x1); + SDL_assert(coords->y2 >= coords->y1); + lv_coord_t w = lv_area_get_width(coords), h = lv_area_get_height(coords); + lv_opa_t * mask_buf = lv_mem_buf_get(w * h); + for(lv_coord_t y = 0; y < h; y++) { + lv_opa_t * line_buf = &mask_buf[y * w]; + lv_memset_ff(line_buf, w); + lv_coord_t abs_x = (lv_coord_t) coords->x1, abs_y = (lv_coord_t)(y + coords->y1), len = (lv_coord_t) w; + lv_draw_mask_res_t res; + if(ids) { + res = lv_draw_mask_apply_ids(line_buf, abs_x, abs_y, len, ids, ids_count); + } + else { + res = lv_draw_mask_apply(line_buf, abs_x, abs_y, len); + } + if(res == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(line_buf, w); + } + } + return mask_buf; +} + +SDL_Texture * lv_draw_sdl_mask_dump_texture(SDL_Renderer * renderer, const lv_area_t * coords, const int16_t * ids, + int16_t ids_count) +{ + lv_coord_t w = lv_area_get_width(coords), h = lv_area_get_height(coords); + lv_opa_t * mask_buf = lv_draw_sdl_mask_dump_opa(coords, ids, ids_count); + SDL_Surface * surface = lv_sdl_create_opa_surface(mask_buf, w, h, w); + lv_mem_buf_release(mask_buf); + SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, surface); + SDL_FreeSurface(surface); + return texture; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_mask.h b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_mask.h new file mode 100644 index 0000000..a562d73 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_mask.h @@ -0,0 +1,51 @@ +/** + * @file lv_draw_sdl_mask.h + * + */ + +#ifndef LV_DRAW_SDL_MASK_H +#define LV_DRAW_SDL_MASK_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +#include "../../lv_conf_internal.h" + +#include LV_GPU_SDL_INCLUDE_PATH + +#include "lv_draw_sdl.h" +#include "../../misc/lv_area.h" +#include "../../misc/lv_color.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +lv_opa_t * lv_draw_sdl_mask_dump_opa(const lv_area_t * coords, const int16_t * ids, int16_t ids_count); + +SDL_Texture * lv_draw_sdl_mask_dump_texture(SDL_Renderer * renderer, const lv_area_t * coords, const int16_t * ids, + int16_t ids_count); + + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_SDL_MASK_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_polygon.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_polygon.c new file mode 100644 index 0000000..68305c7 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_polygon.c @@ -0,0 +1,139 @@ +/** + * @file lv_draw_sdl_polygon.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include "lv_draw_sdl.h" +#include "lv_draw_sdl_utils.h" +#include "lv_draw_sdl_texture_cache.h" +#include "lv_draw_sdl_composite.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +static void dump_masks(SDL_Texture * texture, const lv_area_t * coords); + +/********************** + * GLOBAL FUNCTIONS + **********************/ +void lv_draw_sdl_polygon(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc, const lv_point_t * points, + uint16_t point_cnt) +{ + if(point_cnt < 3) return; + if(points == NULL) return; + + lv_draw_mask_polygon_param_t polygon_param; + lv_draw_mask_polygon_init(&polygon_param, points, point_cnt); + + if(polygon_param.cfg.point_cnt < 3) { + lv_draw_mask_free_param(&polygon_param); + return; + } + + lv_area_t poly_coords = {.x1 = LV_COORD_MAX, .y1 = LV_COORD_MAX, .x2 = LV_COORD_MIN, .y2 = LV_COORD_MIN}; + + uint16_t i; + for(i = 0; i < point_cnt; i++) { + poly_coords.x1 = LV_MIN(poly_coords.x1, polygon_param.cfg.points[i].x); + poly_coords.y1 = LV_MIN(poly_coords.y1, polygon_param.cfg.points[i].y); + poly_coords.x2 = LV_MAX(poly_coords.x2, polygon_param.cfg.points[i].x); + poly_coords.y2 = LV_MAX(poly_coords.y2, polygon_param.cfg.points[i].y); + } + + bool is_common; + lv_area_t draw_area; + is_common = _lv_area_intersect(&draw_area, &poly_coords, draw_ctx->clip_area); + if(!is_common) { + lv_draw_mask_free_param(&polygon_param); + return; + } + + lv_draw_sdl_ctx_t * ctx = (lv_draw_sdl_ctx_t *) draw_ctx; + + int16_t mask_id = lv_draw_mask_add(&polygon_param, NULL); + + lv_coord_t w = lv_area_get_width(&draw_area), h = lv_area_get_height(&draw_area); + bool texture_in_cache = false; + SDL_Texture * texture = lv_draw_sdl_composite_texture_obtain(ctx, LV_DRAW_SDL_COMPOSITE_TEXTURE_ID_STREAM1, w, h, + &texture_in_cache); + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + dump_masks(texture, &draw_area); + + lv_draw_mask_remove_id(mask_id); + lv_draw_mask_free_param(&polygon_param); + + SDL_Rect srcrect = {0, 0, w, h}, dstrect; + lv_area_to_sdl_rect(&draw_area, &dstrect); + SDL_Color color; + lv_color_to_sdl_color(&draw_dsc->bg_color, &color); + SDL_SetTextureColorMod(texture, color.r, color.g, color.b); + SDL_SetTextureAlphaMod(texture, draw_dsc->bg_opa); + SDL_RenderCopy(ctx->renderer, texture, &srcrect, &dstrect); + if(!texture_in_cache) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(texture); + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void dump_masks(SDL_Texture * texture, const lv_area_t * coords) +{ + lv_coord_t w = lv_area_get_width(coords), h = lv_area_get_height(coords); + SDL_assert(w > 0 && h > 0); + SDL_Rect rect = {0, 0, w, h}; + uint8_t * pixels; + int pitch; + if(SDL_LockTexture(texture, &rect, (void **) &pixels, &pitch) != 0) return; + + lv_opa_t * line_buf = lv_mem_buf_get(rect.w); + for(lv_coord_t y = 0; y < rect.h; y++) { + lv_memset_ff(line_buf, rect.w); + lv_coord_t abs_x = (lv_coord_t) coords->x1, abs_y = (lv_coord_t)(y + coords->y1), len = (lv_coord_t) rect.w; + lv_draw_mask_res_t res; + res = lv_draw_mask_apply(line_buf, abs_x, abs_y, len); + if(res == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(&pixels[y * pitch], 4 * rect.w); + } + else if(res == LV_DRAW_MASK_RES_FULL_COVER) { + lv_memset_ff(&pixels[y * pitch], 4 * rect.w); + } + else { + for(int x = 0; x < rect.w; x++) { + uint8_t * pixel = &pixels[y * pitch + x * 4]; + *pixel = line_buf[x]; + pixel[1] = pixel[2] = pixel[3] = 0xFF; + } + } + } + lv_mem_buf_release(line_buf); + SDL_UnlockTexture(texture); +} + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_priv.h b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_priv.h new file mode 100644 index 0000000..ffc191b --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_priv.h @@ -0,0 +1,73 @@ +/** + * @file lv_draw_sdl_priv.h + * + */ + +#ifndef LV_DRAW_SDL_PRIV_H +#define LV_DRAW_SDL_PRIV_H + + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include LV_GPU_SDL_INCLUDE_PATH + +#include "../lv_draw.h" +#include "../../misc/lv_lru.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct lv_draw_sdl_context_internals_t { + lv_lru_t * texture_cache; + SDL_Texture * mask; + SDL_Texture * composition; + bool composition_cached; + SDL_Texture * target_backup; + uint8_t transform_count; +} lv_draw_sdl_context_internals_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/*====================== + * Add/remove functions + *=====================*/ + +/*===================== + * Setter functions + *====================*/ + +/*===================== + * Getter functions + *====================*/ + +/*===================== + * Other functions + *====================*/ + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_SDL*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_SDL_PRIV_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_rect.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_rect.c new file mode 100644 index 0000000..149dcbf --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_rect.c @@ -0,0 +1,1013 @@ +/** + * @file lv_draw_sdl_rect.c + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include "../lv_draw_rect.h" +#include "../lv_draw_img.h" +#include "../lv_draw_label.h" +#include "../lv_draw_mask.h" +#include "../../core/lv_refr.h" +#include "lv_draw_sdl_utils.h" +#include "lv_draw_sdl_texture_cache.h" +#include "lv_draw_sdl_composite.h" +#include "lv_draw_sdl_mask.h" +#include "lv_draw_sdl_stack_blur.h" +#include "lv_draw_sdl_layer.h" + +/********************* + * DEFINES + *********************/ + +#define FRAG_SPACING 3 + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_sdl_cache_key_magic_t magic; + lv_coord_t radius; + lv_coord_t size; +} lv_draw_rect_bg_key_t; + +typedef struct { + lv_sdl_cache_key_magic_t magic; + lv_gradient_stop_t stops[LV_GRADIENT_MAX_STOPS]; + uint8_t stops_count; + lv_grad_dir_t dir; +} lv_draw_rect_grad_strip_key_t; + +typedef struct { + lv_sdl_cache_key_magic_t magic; + lv_gradient_stop_t stops[LV_GRADIENT_MAX_STOPS]; + uint8_t stops_count; + lv_grad_dir_t dir; + lv_coord_t w; + lv_coord_t h; + lv_coord_t radius; +} lv_draw_rect_grad_frag_key_t; + +typedef struct { + lv_sdl_cache_key_magic_t magic; + lv_coord_t radius; + lv_coord_t size; + lv_coord_t blur; +} lv_draw_rect_shadow_key_t; + +typedef struct { + lv_sdl_cache_key_magic_t magic; + lv_coord_t rout, rin; + lv_area_t offsets; +} lv_draw_rect_border_key_t; + +/********************** + * STATIC PROTOTYPES + **********************/ + +static void draw_bg_color(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc); + +static void draw_bg_grad_simple(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_grad_dsc_t * grad, bool blend_mod); + +static void draw_bg_grad_radius(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc); + +static void draw_bg_img(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc); + +static void draw_border(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc); + +static void draw_shadow(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * clip, + const lv_draw_rect_dsc_t * dsc); + +static void draw_outline(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * clip, + const lv_draw_rect_dsc_t * dsc); + +static void draw_border_generic(lv_draw_sdl_ctx_t * ctx, const lv_area_t * outer_area, const lv_area_t * inner_area, + const lv_area_t * clip, lv_coord_t rout, lv_coord_t rin, lv_color_t color, lv_opa_t opa, + lv_blend_mode_t blend_mode); + +static void frag_render_borders(SDL_Renderer * renderer, SDL_Texture * frag, lv_coord_t frag_size, + const lv_area_t * coords, const lv_area_t * clipped, bool full); + +static void frag_render_center(SDL_Renderer * renderer, SDL_Texture * frag, lv_coord_t frag_size, + const lv_area_t * coords, const lv_area_t * clipped, bool full); + +static lv_draw_rect_bg_key_t rect_bg_key_create(lv_coord_t radius, lv_coord_t size); + +static lv_draw_rect_grad_frag_key_t rect_grad_frag_key_create(const lv_grad_dsc_t * grad, lv_coord_t w, lv_coord_t h, + lv_coord_t radius); + +static lv_draw_rect_grad_strip_key_t rect_grad_strip_key_create(const lv_grad_dsc_t * grad); + +static lv_draw_rect_shadow_key_t rect_shadow_key_create(lv_coord_t radius, lv_coord_t size, lv_coord_t blur); + +static lv_draw_rect_border_key_t rect_border_key_create(lv_coord_t rout, lv_coord_t rin, const lv_area_t * outer_area, + const lv_area_t * inner_area); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ +#define SKIP_BORDER(dsc) ((dsc)->border_opa <= LV_OPA_MIN || (dsc)->border_width == 0 || (dsc)->border_side == LV_BORDER_SIDE_NONE || (dsc)->border_post) +#define SKIP_SHADOW(dsc) ((dsc)->shadow_width == 0 || (dsc)->shadow_opa <= LV_OPA_MIN || ((dsc)->shadow_width == 1 && (dsc)->shadow_spread <= 0 && (dsc)->shadow_ofs_x == 0 && (dsc)->shadow_ofs_y == 0)) +#define SKIP_IMAGE(dsc) ((dsc)->bg_img_src == NULL || (dsc)->bg_img_opa <= LV_OPA_MIN) +#define SKIP_OUTLINE(dsc) ((dsc)->outline_opa <= LV_OPA_MIN || (dsc)->outline_width == 0) + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_draw_sdl_draw_rect(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) +{ + const lv_area_t * clip = draw_ctx->clip_area; + lv_draw_sdl_ctx_t * ctx = (lv_draw_sdl_ctx_t *) draw_ctx; + + lv_area_t extension = {0, 0, 0, 0}; + if(!SKIP_SHADOW(dsc)) { + lv_coord_t ext = (lv_coord_t)(dsc->shadow_spread - dsc->shadow_width / 2 + 1); + extension.x1 = LV_MAX(extension.x1, -dsc->shadow_ofs_x + ext); + extension.x2 = LV_MAX(extension.x2, dsc->shadow_ofs_x + ext); + extension.y1 = LV_MAX(extension.y1, -dsc->shadow_ofs_y + ext); + extension.y2 = LV_MAX(extension.y2, dsc->shadow_ofs_y + ext); + } + if(!SKIP_OUTLINE(dsc)) { + lv_coord_t ext = (lv_coord_t)(dsc->outline_pad - 1 + dsc->outline_width); + extension.x1 = LV_MAX(extension.x1, ext); + extension.x2 = LV_MAX(extension.x2, ext); + extension.y1 = LV_MAX(extension.y1, ext); + extension.y2 = LV_MAX(extension.y2, ext); + } + /* Coords will be translated so coords will start at (0,0) */ + lv_area_t t_coords = *coords, t_clip = *clip, apply_area, t_area; + bool has_composite = lv_draw_sdl_composite_begin(ctx, coords, clip, &extension, dsc->blend_mode, &t_coords, &t_clip, + &apply_area); + + lv_draw_sdl_transform_areas_offset(ctx, has_composite, &apply_area, &t_coords, &t_clip); + + bool has_content = _lv_area_intersect(&t_area, &t_coords, &t_clip); + + SDL_Rect clip_rect; + lv_area_to_sdl_rect(&t_clip, &clip_rect); + draw_shadow(ctx, &t_coords, &t_clip, dsc); + /* Shadows and outlines will also draw in extended area */ + if(has_content) { + draw_bg_color(ctx, &t_coords, &t_area, dsc); + draw_bg_img(ctx, &t_coords, &t_area, dsc); + draw_border(ctx, &t_coords, &t_area, dsc); + } + draw_outline(ctx, &t_coords, &t_clip, dsc); + + lv_draw_sdl_composite_end(ctx, &apply_area, dsc->blend_mode); +} + +SDL_Texture * lv_draw_sdl_rect_bg_frag_obtain(lv_draw_sdl_ctx_t * ctx, lv_coord_t radius, bool * in_cache) +{ + lv_draw_rect_bg_key_t key = rect_bg_key_create(radius, radius); + SDL_Texture * texture = lv_draw_sdl_texture_cache_get(ctx, &key, sizeof(key), NULL); + if(texture == NULL) { + lv_area_t coords = {0, 0, radius * 2 - 1, radius * 2 - 1}; + lv_area_t coords_frag = {0, 0, radius - 1, radius - 1}; + lv_draw_mask_radius_param_t mask_rout_param; + lv_draw_mask_radius_init(&mask_rout_param, &coords, radius, false); + int16_t mask_id = lv_draw_mask_add(&mask_rout_param, NULL); + texture = lv_draw_sdl_mask_dump_texture(ctx->renderer, &coords_frag, &mask_id, 1); + SDL_assert(texture != NULL); + lv_draw_mask_remove_id(mask_id); + *in_cache = lv_draw_sdl_texture_cache_put(ctx, &key, sizeof(key), texture); + } + else { + *in_cache = true; + } + return texture; +} + +SDL_Texture * lv_draw_sdl_rect_grad_frag_obtain(lv_draw_sdl_ctx_t * ctx, const lv_grad_dsc_t * grad, lv_coord_t w, + lv_coord_t h, lv_coord_t radius, bool * in_cache) +{ + lv_draw_rect_grad_frag_key_t key = rect_grad_frag_key_create(grad, w, h, radius); + SDL_Texture * texture = lv_draw_sdl_texture_cache_get(ctx, &key, sizeof(key), NULL); + if(texture == NULL) { + lv_area_t coords = {0, 0, radius * 2 + FRAG_SPACING - 1, radius * 2 + FRAG_SPACING - 1}; + texture = SDL_CreateTexture(ctx->renderer, LV_DRAW_SDL_TEXTURE_FORMAT, SDL_TEXTUREACCESS_TARGET, + lv_area_get_width(&coords), lv_area_get_height(&coords)); + SDL_assert(texture != NULL); + + lv_draw_mask_radius_param_t mask_rout_param; + lv_draw_mask_radius_init(&mask_rout_param, &coords, radius, false); + int16_t mask_id = lv_draw_mask_add(&mask_rout_param, NULL); + SDL_Texture * mask = lv_draw_sdl_mask_dump_texture(ctx->renderer, &coords, &mask_id, 1); + SDL_assert(mask != NULL); + SDL_SetTextureBlendMode(mask, SDL_BLENDMODE_NONE); + lv_draw_mask_remove_id(mask_id); + + SDL_Texture * target_backup = SDL_GetRenderTarget(ctx->renderer); + SDL_SetRenderTarget(ctx->renderer, texture); + SDL_RenderCopy(ctx->renderer, mask, NULL, NULL); + SDL_DestroyTexture(mask); + + lv_area_t blend_coords = {.x1 = 0, .y1 = 0, .x2 = w - 1, .y2 = h - 1}; + lv_area_t draw_area = {.x1 = 0, .y1 = 0, .x2 = radius - 1, .y2 = radius - 1}; + /* Align to top left */ + lv_area_align(&coords, &draw_area, LV_ALIGN_TOP_LEFT, 0, 0); + lv_area_align(&coords, &blend_coords, LV_ALIGN_TOP_LEFT, 0, 0); + draw_bg_grad_simple(ctx, &blend_coords, &draw_area, grad, true); + + /* Align to top right */ + lv_area_align(&coords, &draw_area, LV_ALIGN_TOP_RIGHT, 0, 0); + lv_area_align(&coords, &blend_coords, LV_ALIGN_TOP_RIGHT, 0, 0); + draw_bg_grad_simple(ctx, &blend_coords, &draw_area, grad, true); + + /* Align to bottom right */ + lv_area_align(&coords, &draw_area, LV_ALIGN_BOTTOM_RIGHT, 0, 0); + lv_area_align(&coords, &blend_coords, LV_ALIGN_BOTTOM_RIGHT, 0, 0); + draw_bg_grad_simple(ctx, &blend_coords, &draw_area, grad, true); + + /* Align to bottom left */ + lv_area_align(&coords, &draw_area, LV_ALIGN_BOTTOM_LEFT, 0, 0); + lv_area_align(&coords, &blend_coords, LV_ALIGN_BOTTOM_LEFT, 0, 0); + draw_bg_grad_simple(ctx, &blend_coords, &draw_area, grad, true); + + SDL_SetRenderTarget(ctx->renderer, target_backup); + *in_cache = lv_draw_sdl_texture_cache_put(ctx, &key, sizeof(key), texture); + } + else { + *in_cache = true; + } + return texture; +} + +SDL_Texture * lv_draw_sdl_rect_grad_strip_obtain(lv_draw_sdl_ctx_t * ctx, const lv_grad_dsc_t * grad, bool * in_cache) +{ + lv_draw_rect_grad_strip_key_t key = rect_grad_strip_key_create(grad); + SDL_Texture * texture = lv_draw_sdl_texture_cache_get(ctx, &key, sizeof(key), NULL); + if(texture == NULL) { + Uint32 amask = 0xFF000000; + Uint32 rmask = 0x00FF0000; + Uint32 gmask = 0x0000FF00; + Uint32 bmask = 0x000000FF; + lv_color_t pixels[256]; + for(int i = 0; i < 256; i++) { + pixels[i] = lv_gradient_calculate(grad, 256, i); + } + int width = grad->dir == LV_GRAD_DIR_VER ? 1 : 256; + int height = grad->dir == LV_GRAD_DIR_VER ? 256 : 1; + SDL_Surface * surface = SDL_CreateRGBSurfaceFrom(pixels, width, height, LV_COLOR_DEPTH, width * LV_COLOR_DEPTH / 8, + rmask, gmask, bmask, amask); + texture = SDL_CreateTextureFromSurface(ctx->renderer, surface); + SDL_assert(texture != NULL); + SDL_FreeSurface(surface); + *in_cache = lv_draw_sdl_texture_cache_put(ctx, &key, sizeof(key), texture); + } + else { + *in_cache = true; + } + return texture; +} + +void lv_draw_sdl_rect_bg_frag_draw_corners(lv_draw_sdl_ctx_t * ctx, SDL_Texture * frag, lv_coord_t frag_size, + const lv_area_t * coords, const lv_area_t * clip, bool full) +{ + if(!clip) clip = coords; + lv_area_t corner_area, dst_area; + /* Upper left */ + corner_area.x1 = coords->x1; + corner_area.y1 = coords->y1; + corner_area.x2 = coords->x1 + frag_size - 1; + corner_area.y2 = coords->y1 + frag_size - 1; + if(_lv_area_intersect(&dst_area, &corner_area, clip)) { + SDL_Rect dst_rect; + lv_area_to_sdl_rect(&dst_area, &dst_rect); + + lv_coord_t dw = lv_area_get_width(&dst_area), dh = lv_area_get_height(&dst_area); + lv_coord_t sx = (lv_coord_t)(dst_area.x1 - corner_area.x1), sy = (lv_coord_t)(dst_area.y1 - corner_area.y1); + SDL_Rect src_rect = {sx, sy, dw, dh}; + SDL_RenderCopy(ctx->renderer, frag, &src_rect, &dst_rect); + } + /* Upper right, clip right edge if too big */ + corner_area.x1 = LV_MAX(coords->x2 - frag_size + 1, coords->x1 + frag_size); + corner_area.x2 = coords->x2; + if(_lv_area_intersect(&dst_area, &corner_area, clip)) { + SDL_Rect dst_rect; + lv_area_to_sdl_rect(&dst_area, &dst_rect); + + lv_coord_t dw = lv_area_get_width(&dst_area), dh = lv_area_get_height(&dst_area); + if(full) { + lv_coord_t sx = (lv_coord_t)(dst_area.x1 - corner_area.x1), + sy = (lv_coord_t)(dst_area.y1 - corner_area.y1); + SDL_Rect src_rect = {frag_size + FRAG_SPACING + sx, sy, dw, dh}; + SDL_RenderCopy(ctx->renderer, frag, &src_rect, &dst_rect); + } + else { + SDL_Rect src_rect = {corner_area.x2 - dst_area.x2, dst_area.y1 - corner_area.y1, dw, dh}; + SDL_RenderCopyEx(ctx->renderer, frag, &src_rect, &dst_rect, 0, NULL, SDL_FLIP_HORIZONTAL); + } + } + /* Lower right, clip bottom edge if too big */ + corner_area.y1 = LV_MAX(coords->y2 - frag_size + 1, coords->y1 + frag_size); + corner_area.y2 = coords->y2; + if(_lv_area_intersect(&dst_area, &corner_area, clip)) { + SDL_Rect dst_rect; + lv_area_to_sdl_rect(&dst_area, &dst_rect); + + lv_coord_t dw = lv_area_get_width(&dst_area), dh = lv_area_get_height(&dst_area); + if(full) { + lv_coord_t sx = (lv_coord_t)(dst_area.x1 - corner_area.x1), + sy = (lv_coord_t)(dst_area.y1 - corner_area.y1); + SDL_Rect src_rect = {frag_size + FRAG_SPACING + sx, frag_size + FRAG_SPACING + sy, dw, dh}; + SDL_RenderCopy(ctx->renderer, frag, &src_rect, &dst_rect); + } + else { + SDL_Rect src_rect = {corner_area.x2 - dst_area.x2, corner_area.y2 - dst_area.y2, dw, dh}; + SDL_RenderCopyEx(ctx->renderer, frag, &src_rect, &dst_rect, 0, NULL, SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL); + } + } + /* Lower left, right edge should not be clipped */ + corner_area.x1 = coords->x1; + corner_area.x2 = coords->x1 + frag_size - 1; + if(_lv_area_intersect(&dst_area, &corner_area, clip)) { + SDL_Rect dst_rect; + lv_area_to_sdl_rect(&dst_area, &dst_rect); + + lv_coord_t dw = lv_area_get_width(&dst_area), dh = lv_area_get_height(&dst_area); + if(full) { + lv_coord_t sx = (lv_coord_t)(dst_area.x1 - corner_area.x1), + sy = (lv_coord_t)(dst_area.y1 - corner_area.y1); + SDL_Rect src_rect = {sx, frag_size + FRAG_SPACING + sy, dw, dh}; + SDL_RenderCopy(ctx->renderer, frag, &src_rect, &dst_rect); + } + else { + SDL_Rect src_rect = {dst_area.x1 - corner_area.x1, corner_area.y2 - dst_area.y2, dw, dh}; + SDL_RenderCopyEx(ctx->renderer, frag, &src_rect, &dst_rect, 0, NULL, SDL_FLIP_VERTICAL); + } + } +} + + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void draw_bg_color(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc) +{ + if(dsc->bg_opa == 0) { + return; + } + lv_coord_t radius = dsc->radius; + SDL_Color bg_color; + if(dsc->bg_grad.dir == LV_GRAD_DIR_NONE) { + lv_color_to_sdl_color(&dsc->bg_color, &bg_color); + } + else if(dsc->bg_grad.stops_count == 1) { + lv_color_to_sdl_color(&dsc->bg_grad.stops[0].color, &bg_color); + } + else { + if(radius <= 0) { + draw_bg_grad_simple(ctx, coords, draw_area, &dsc->bg_grad, false); + } + else { + draw_bg_grad_radius(ctx, coords, draw_area, dsc); + } + return; + } + if(radius <= 0) { + SDL_Rect rect; + lv_area_to_sdl_rect(draw_area, &rect); + SDL_SetRenderDrawColor(ctx->renderer, bg_color.r, bg_color.g, bg_color.b, dsc->bg_opa); + SDL_SetRenderDrawBlendMode(ctx->renderer, SDL_BLENDMODE_BLEND); + SDL_RenderFillRect(ctx->renderer, &rect); + return; + } + + /*A small texture with a quarter of the rect is enough*/ + lv_coord_t bg_w = lv_area_get_width(coords), bg_h = lv_area_get_height(coords); + lv_coord_t real_radius = LV_MIN3(bg_w / 2, bg_h / 2, radius); + bool texture_in_cache = false; + SDL_Texture * texture = lv_draw_sdl_rect_bg_frag_obtain(ctx, real_radius, &texture_in_cache); + + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + SDL_SetTextureAlphaMod(texture, dsc->bg_opa); + SDL_SetTextureColorMod(texture, bg_color.r, bg_color.g, bg_color.b); + lv_draw_sdl_rect_bg_frag_draw_corners(ctx, texture, real_radius, coords, draw_area, false); + frag_render_borders(ctx->renderer, texture, real_radius, coords, draw_area, false); + frag_render_center(ctx->renderer, texture, real_radius, coords, draw_area, false); + + if(!texture_in_cache) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(texture); + } +} + +static void draw_bg_grad_simple(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_grad_dsc_t * grad, bool blend_mod) +{ + SDL_Rect dstrect; + lv_area_to_sdl_rect(draw_area, &dstrect); + SDL_Rect srcrect; + if(grad->dir == LV_GRAD_DIR_VER) { + lv_coord_t coords_h = lv_area_get_height(coords); + srcrect.x = 0; + srcrect.y = (draw_area->y1 - coords->y1) * 255 / coords_h; + srcrect.w = 1; + srcrect.h = dstrect.h * 256 / coords_h; + + if(srcrect.y < 0 || srcrect.y > 255) { + return; + } + } + else { + lv_coord_t coords_w = lv_area_get_width(coords); + srcrect.x = (draw_area->x1 - coords->x1) * 255 / coords_w; + srcrect.y = 0; + srcrect.w = dstrect.w * 256 / coords_w; + srcrect.h = 1; + + if(srcrect.x < 0 || srcrect.x > 255) { + return; + } + } + + bool grad_texture_in_cache = false; + SDL_Texture * grad_texture = lv_draw_sdl_rect_grad_strip_obtain(ctx, grad, &grad_texture_in_cache); + if(blend_mod) { + SDL_SetTextureBlendMode(grad_texture, SDL_BLENDMODE_MOD); + } + else { + SDL_SetTextureBlendMode(grad_texture, SDL_BLENDMODE_BLEND); + } + + SDL_RenderCopy(ctx->renderer, grad_texture, &srcrect, &dstrect); + + if(!grad_texture_in_cache) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(grad_texture); + } +} + +static void draw_bg_grad_radius(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc) +{ + lv_coord_t radius = dsc->radius; + /*A small texture with a quarter of the rect is enough*/ + lv_coord_t bg_w = lv_area_get_width(coords), bg_h = lv_area_get_height(coords); + lv_coord_t real_radius = LV_MIN3(bg_w / 2, bg_h / 2, radius); + bool grad_texture_in_cache = false; + SDL_Texture * grad_texture = lv_draw_sdl_rect_grad_frag_obtain(ctx, &dsc->bg_grad, bg_w, bg_h, radius, + &grad_texture_in_cache); + SDL_SetTextureBlendMode(grad_texture, SDL_BLENDMODE_BLEND); + + lv_draw_sdl_rect_bg_frag_draw_corners(ctx, grad_texture, real_radius, coords, draw_area, true); + lv_area_t part_coords; + lv_area_t part_area; + if(bg_w > radius * 2) { + /*Draw left, middle, right*/ + part_coords.x1 = 0; + part_coords.x2 = radius - 1; + part_coords.y1 = radius; + part_coords.y2 = bg_h - radius - 1; + + lv_area_align(coords, &part_coords, LV_ALIGN_LEFT_MID, 0, 0); + _lv_area_intersect(&part_area, &part_coords, draw_area); + draw_bg_grad_simple(ctx, coords, &part_area, &dsc->bg_grad, false); + + lv_area_align(coords, &part_coords, LV_ALIGN_RIGHT_MID, 0, 0); + _lv_area_intersect(&part_area, &part_coords, draw_area); + draw_bg_grad_simple(ctx, coords, &part_area, &dsc->bg_grad, false); + + part_coords.x1 = radius; + part_coords.x2 = bg_w - radius - 1; + part_coords.y1 = 0; + part_coords.y2 = bg_h - 1; + lv_area_align(coords, &part_coords, LV_ALIGN_CENTER, 0, 0); + _lv_area_intersect(&part_area, &part_coords, draw_area); + draw_bg_grad_simple(ctx, coords, &part_area, &dsc->bg_grad, false); + } + else if(bg_h > radius * 2) { + /*Draw top, middle, bottom*/ + part_coords.x1 = radius; + part_coords.x2 = bg_w - radius - 1; + part_coords.y1 = 0; + part_coords.y2 = radius - 1; + + lv_area_align(coords, &part_coords, LV_ALIGN_TOP_MID, 0, 0); + _lv_area_intersect(&part_area, &part_coords, draw_area); + draw_bg_grad_simple(ctx, coords, &part_area, &dsc->bg_grad, false); + + lv_area_align(coords, &part_coords, LV_ALIGN_BOTTOM_MID, 0, 0); + _lv_area_intersect(&part_area, &part_coords, draw_area); + draw_bg_grad_simple(ctx, coords, &part_area, &dsc->bg_grad, false); + + part_coords.x1 = 0; + part_coords.x2 = bg_w - 1; + part_coords.y1 = radius; + part_coords.y2 = bg_h - radius - 1; + lv_area_align(coords, &part_coords, LV_ALIGN_CENTER, 0, 0); + _lv_area_intersect(&part_area, &part_coords, draw_area); + draw_bg_grad_simple(ctx, coords, &part_area, &dsc->bg_grad, false); + } + + if(!grad_texture_in_cache) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(grad_texture); + } +} + +static void draw_bg_img(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc) +{ + LV_UNUSED(draw_area); + if(SKIP_IMAGE(dsc)) return; + + lv_img_src_t src_type = lv_img_src_get_type(dsc->bg_img_src); + if(src_type == LV_IMG_SRC_SYMBOL) { + lv_point_t size; + lv_txt_get_size(&size, dsc->bg_img_src, dsc->bg_img_symbol_font, 0, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE); + lv_area_t a; + a.x1 = coords->x1 + lv_area_get_width(coords) / 2 - size.x / 2; + a.x2 = a.x1 + size.x - 1; + a.y1 = coords->y1 + lv_area_get_height(coords) / 2 - size.y / 2; + a.y2 = a.y1 + size.y - 1; + + lv_draw_label_dsc_t label_draw_dsc; + lv_draw_label_dsc_init(&label_draw_dsc); + label_draw_dsc.font = dsc->bg_img_symbol_font; + label_draw_dsc.color = dsc->bg_img_recolor; + label_draw_dsc.opa = dsc->bg_img_opa; + lv_draw_label((lv_draw_ctx_t *) ctx, &label_draw_dsc, &a, dsc->bg_img_src, NULL); + } + else { + lv_img_header_t header; + size_t key_size; + lv_draw_sdl_cache_key_head_img_t * key = lv_draw_sdl_texture_img_key_create(dsc->bg_img_src, 0, &key_size); + bool key_found; + lv_img_header_t * cache_header = NULL; + SDL_Texture * texture = lv_draw_sdl_texture_cache_get_with_userdata(ctx, key, key_size, &key_found, + (void **) &cache_header); + SDL_free(key); + if(texture) { + header = *cache_header; + } + else if(key_found || lv_img_decoder_get_info(dsc->bg_img_src, &header) != LV_RES_OK) { + /* When cache hit but with negative result, use default decoder. If still fail, return.*/ + LV_LOG_WARN("Couldn't read the background image"); + return; + } + + lv_draw_img_dsc_t img_dsc; + lv_draw_img_dsc_init(&img_dsc); + img_dsc.blend_mode = dsc->blend_mode; + img_dsc.recolor = dsc->bg_img_recolor; + img_dsc.recolor_opa = dsc->bg_img_recolor_opa; + img_dsc.opa = dsc->bg_img_opa; + img_dsc.frame_id = 0; + + int16_t radius_mask_id = LV_MASK_ID_INV; + lv_draw_mask_radius_param_t radius_param; + if(dsc->radius > 0) { + lv_draw_mask_radius_init(&radius_param, coords, dsc->radius, false); + radius_mask_id = lv_draw_mask_add(&radius_param, NULL); + } + + /*Center align*/ + if(dsc->bg_img_tiled == false) { + lv_area_t area; + area.x1 = coords->x1 + lv_area_get_width(coords) / 2 - header.w / 2; + area.y1 = coords->y1 + lv_area_get_height(coords) / 2 - header.h / 2; + area.x2 = area.x1 + header.w - 1; + area.y2 = area.y1 + header.h - 1; + + lv_draw_img((lv_draw_ctx_t *) ctx, &img_dsc, &area, dsc->bg_img_src); + } + else { + lv_area_t area; + area.y1 = coords->y1; + area.y2 = area.y1 + header.h - 1; + + for(; area.y1 <= coords->y2; area.y1 += header.h, area.y2 += header.h) { + + area.x1 = coords->x1; + area.x2 = area.x1 + header.w - 1; + for(; area.x1 <= coords->x2; area.x1 += header.w, area.x2 += header.w) { + lv_draw_img((lv_draw_ctx_t *) ctx, &img_dsc, &area, dsc->bg_img_src); + } + } + } + + if(radius_mask_id != LV_MASK_ID_INV) { + lv_draw_mask_remove_id(radius_mask_id); + lv_draw_mask_free_param(&radius_param); + } + } +} + +static void draw_shadow(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * clip, + const lv_draw_rect_dsc_t * dsc) +{ + /*Check whether the shadow is visible*/ + if(SKIP_SHADOW(dsc)) return; + + lv_coord_t sw = dsc->shadow_width; + + lv_area_t core_area; + core_area.x1 = coords->x1 + dsc->shadow_ofs_x - dsc->shadow_spread; + core_area.x2 = coords->x2 + dsc->shadow_ofs_x + dsc->shadow_spread; + core_area.y1 = coords->y1 + dsc->shadow_ofs_y - dsc->shadow_spread; + core_area.y2 = coords->y2 + dsc->shadow_ofs_y + dsc->shadow_spread; + + lv_area_t shadow_area; + shadow_area.x1 = core_area.x1 - sw / 2 - 1; + shadow_area.x2 = core_area.x2 + sw / 2 + 1; + shadow_area.y1 = core_area.y1 - sw / 2 - 1; + shadow_area.y2 = core_area.y2 + sw / 2 + 1; + + lv_opa_t opa = dsc->shadow_opa; + + if(opa > LV_OPA_MAX) opa = LV_OPA_COVER; + + /*Get clipped draw area which is the real draw area. + *It is always the same or inside `shadow_area`*/ + lv_area_t draw_area; + if(!_lv_area_intersect(&draw_area, &shadow_area, clip)) return; + + SDL_Rect core_area_rect; + lv_area_to_sdl_rect(&shadow_area, &core_area_rect); + + lv_coord_t radius = dsc->radius; + /* No matter how big the shadow is, what we need is just a corner */ + lv_coord_t frag_size = LV_MIN3(lv_area_get_width(&core_area) / 2, lv_area_get_height(&core_area) / 2, + LV_MAX(sw / 2, radius)); + + /* This is how big the corner is after blurring */ + lv_coord_t blur_growth = (lv_coord_t)(sw / 2 + 1); + + lv_coord_t blur_frag_size = (lv_coord_t)(frag_size + blur_growth); + + lv_draw_rect_shadow_key_t key = rect_shadow_key_create(radius, frag_size, sw); + + SDL_Texture * texture = lv_draw_sdl_texture_cache_get(ctx, &key, sizeof(key), NULL); + bool texture_in_cache = false; + if(texture == NULL) { + lv_area_t mask_area = {blur_growth, blur_growth}, mask_area_blurred = {0, 0}; + lv_area_set_width(&mask_area, frag_size * 2); + lv_area_set_height(&mask_area, frag_size * 2); + lv_area_set_width(&mask_area_blurred, blur_frag_size * 2); + lv_area_set_height(&mask_area_blurred, blur_frag_size * 2); + + lv_draw_mask_radius_param_t mask_rout_param; + lv_draw_mask_radius_init(&mask_rout_param, &mask_area, radius, false); + int16_t mask_id = lv_draw_mask_add(&mask_rout_param, NULL); + lv_opa_t * mask_buf = lv_draw_sdl_mask_dump_opa(&mask_area_blurred, &mask_id, 1); + lv_stack_blur_grayscale(mask_buf, lv_area_get_width(&mask_area_blurred), lv_area_get_height(&mask_area_blurred), + sw / 2 + sw % 2); + texture = lv_sdl_create_opa_texture(ctx->renderer, mask_buf, blur_frag_size, blur_frag_size, + lv_area_get_width(&mask_area_blurred)); + lv_mem_buf_release(mask_buf); + lv_draw_mask_remove_id(mask_id); + SDL_assert(texture); + texture_in_cache = lv_draw_sdl_texture_cache_put(ctx, &key, sizeof(key), texture); + } + else { + texture_in_cache = true; + } + + SDL_Color shadow_color; + lv_color_to_sdl_color(&dsc->shadow_color, &shadow_color); + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + SDL_SetTextureAlphaMod(texture, opa); + SDL_SetTextureColorMod(texture, shadow_color.r, shadow_color.g, shadow_color.b); + + lv_draw_sdl_rect_bg_frag_draw_corners(ctx, texture, blur_frag_size, &shadow_area, clip, false); + frag_render_borders(ctx->renderer, texture, blur_frag_size, &shadow_area, clip, false); + frag_render_center(ctx->renderer, texture, blur_frag_size, &shadow_area, clip, false); + + if(!texture_in_cache) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(texture); + } +} + + +static void draw_border(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * draw_area, + const lv_draw_rect_dsc_t * dsc) +{ + if(SKIP_BORDER(dsc)) return; + + SDL_Color border_color; + lv_color_to_sdl_color(&dsc->border_color, &border_color); + + lv_coord_t coords_w = lv_area_get_width(coords), coords_h = lv_area_get_height(coords); + lv_coord_t short_side = LV_MIN(coords_w, coords_h); + lv_coord_t rout = LV_MIN(dsc->radius, short_side / 2);/*Get the inner area*/ + lv_area_t area_inner; + lv_area_copy(&area_inner, coords);// lv_area_increase(&area_inner, 1, 1); + area_inner.x1 += ((dsc->border_side & LV_BORDER_SIDE_LEFT) ? dsc->border_width : -(dsc->border_width + rout)); + area_inner.x2 -= ((dsc->border_side & LV_BORDER_SIDE_RIGHT) ? dsc->border_width : -(dsc->border_width + rout)); + area_inner.y1 += ((dsc->border_side & LV_BORDER_SIDE_TOP) ? dsc->border_width : -(dsc->border_width + rout)); + area_inner.y2 -= ((dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? dsc->border_width : -(dsc->border_width + rout)); + lv_coord_t rin = LV_MAX(rout - dsc->border_width, 0); + draw_border_generic(ctx, coords, &area_inner, draw_area, rout, rin, dsc->border_color, dsc->border_opa, + dsc->blend_mode); +} + +static void draw_outline(lv_draw_sdl_ctx_t * ctx, const lv_area_t * coords, const lv_area_t * clip, + const lv_draw_rect_dsc_t * dsc) +{ + if(SKIP_OUTLINE(dsc)) return; + + lv_opa_t opa = dsc->outline_opa; + + if(opa > LV_OPA_MAX) opa = LV_OPA_COVER; + + /*Get the inner radius*/ + lv_area_t area_inner; + lv_area_copy(&area_inner, coords); + + /*Bring the outline closer to make sure there is no color bleeding with pad=0*/ + lv_coord_t pad = dsc->outline_pad - 1; + area_inner.x1 -= pad; + area_inner.y1 -= pad; + area_inner.x2 += pad; + area_inner.y2 += pad; + + lv_area_t area_outer; + lv_area_copy(&area_outer, &area_inner); + + area_outer.x1 -= dsc->outline_width; + area_outer.x2 += dsc->outline_width; + area_outer.y1 -= dsc->outline_width; + area_outer.y2 += dsc->outline_width; + + lv_area_t draw_area; + if(!_lv_area_intersect(&draw_area, &area_outer, clip)) return; + + int32_t inner_w = lv_area_get_width(&area_inner); + int32_t inner_h = lv_area_get_height(&area_inner); + lv_coord_t rin = dsc->radius; + int32_t short_side = LV_MIN(inner_w, inner_h); + if(rin > short_side >> 1) rin = short_side >> 1; + + lv_coord_t rout = rin + dsc->outline_width; + + draw_border_generic(ctx, &area_outer, &area_inner, clip, rout, rin, dsc->outline_color, dsc->outline_opa, + dsc->blend_mode); +} + +static void draw_border_generic(lv_draw_sdl_ctx_t * ctx, const lv_area_t * outer_area, const lv_area_t * inner_area, + const lv_area_t * clip, lv_coord_t rout, lv_coord_t rin, lv_color_t color, lv_opa_t opa, + lv_blend_mode_t blend_mode) +{ + opa = opa >= LV_OPA_COVER ? LV_OPA_COVER : opa; + + SDL_Renderer * renderer = ctx->renderer; + + lv_draw_rect_border_key_t key = rect_border_key_create(rout, rin, outer_area, inner_area); + lv_coord_t radius = LV_MIN3(rout, lv_area_get_width(outer_area) / 2, lv_area_get_height(outer_area) / 2); + lv_coord_t max_side = LV_MAX4(key.offsets.x1, key.offsets.y1, -key.offsets.x2, -key.offsets.y2); + lv_coord_t frag_size = LV_MAX(radius, max_side); + SDL_Texture * texture = lv_draw_sdl_texture_cache_get(ctx, &key, sizeof(key), NULL); + bool texture_in_cache; + if(texture == NULL) { + /* Create a mask texture with size of (frag_size * 2 + FRAG_SPACING) */ + const lv_area_t frag_area = {0, 0, frag_size * 2 + FRAG_SPACING - 1, frag_size * 2 + FRAG_SPACING - 1}; + + /*Create mask for the outer area*/ + int16_t mask_ids[2] = {LV_MASK_ID_INV, LV_MASK_ID_INV}; + lv_draw_mask_radius_param_t mask_rout_param; + if(rout > 0) { + lv_draw_mask_radius_init(&mask_rout_param, &frag_area, rout, false); + mask_ids[0] = lv_draw_mask_add(&mask_rout_param, NULL); + } + + /*Create mask for the inner mask*/ + if(rin < 0) rin = 0; + const lv_area_t frag_inner_area = {frag_area.x1 + key.offsets.x1, frag_area.y1 + key.offsets.y1, + frag_area.x2 + key.offsets.x2, frag_area.y2 + key.offsets.y2 + }; + lv_draw_mask_radius_param_t mask_rin_param; + lv_draw_mask_radius_init(&mask_rin_param, &frag_inner_area, rin, true); + mask_ids[1] = lv_draw_mask_add(&mask_rin_param, NULL); + + texture = lv_draw_sdl_mask_dump_texture(renderer, &frag_area, mask_ids, 2); + + lv_draw_mask_remove_id(mask_ids[1]); + lv_draw_mask_remove_id(mask_ids[0]); + SDL_assert(texture); + texture_in_cache = lv_draw_sdl_texture_cache_put(ctx, &key, sizeof(key), texture); + } + else { + texture_in_cache = true; + } + + SDL_Rect outer_rect; + lv_area_to_sdl_rect(outer_area, &outer_rect); + SDL_Color color_sdl; + lv_color_to_sdl_color(&color, &color_sdl); + + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + SDL_SetTextureAlphaMod(texture, opa); + SDL_SetTextureColorMod(texture, color_sdl.r, color_sdl.g, color_sdl.b); + + lv_draw_sdl_rect_bg_frag_draw_corners(ctx, texture, frag_size, outer_area, clip, true); + frag_render_borders(renderer, texture, frag_size, outer_area, clip, true); + + if(!texture_in_cache) { + LV_LOG_WARN("Texture is not cached, this will impact performance."); + SDL_DestroyTexture(texture); + } +} + +static void frag_render_borders(SDL_Renderer * renderer, SDL_Texture * frag, lv_coord_t frag_size, + const lv_area_t * coords, const lv_area_t * clipped, bool full) +{ + lv_area_t border_area, dst_area; + /* Top border */ + border_area.x1 = coords->x1 + frag_size; + border_area.y1 = coords->y1; + border_area.x2 = coords->x2 - frag_size; + border_area.y2 = coords->y1 + frag_size - 1; + if(_lv_area_intersect(&dst_area, &border_area, clipped)) { + SDL_Rect dst_rect; + lv_area_to_sdl_rect(&dst_area, &dst_rect); + + lv_coord_t sy = (lv_coord_t)(dst_area.y1 - border_area.y1); + if(full) { + SDL_Rect src_rect = {frag_size + 1, sy, 1, lv_area_get_height(&dst_area)}; + SDL_RenderCopy(renderer, frag, &src_rect, &dst_rect); + } + else { + SDL_Rect src_rect = {frag_size - 1, sy, 1, lv_area_get_height(&dst_area)}; + SDL_RenderCopy(renderer, frag, &src_rect, &dst_rect); + } + } + /* Bottom border */ + border_area.y1 = LV_MAX(coords->y2 - frag_size + 1, coords->y1 + frag_size); + border_area.y2 = coords->y2; + if(_lv_area_intersect(&dst_area, &border_area, clipped)) { + SDL_Rect dst_rect; + lv_area_to_sdl_rect(&dst_area, &dst_rect); + + lv_coord_t dh = lv_area_get_height(&dst_area); + if(full) { + lv_coord_t sy = (lv_coord_t)(dst_area.y1 - border_area.y1); + SDL_Rect src_rect = {frag_size + 1, frag_size + FRAG_SPACING + sy, 1, dh}; + SDL_RenderCopy(renderer, frag, &src_rect, &dst_rect); + } + else { + lv_coord_t sy = (lv_coord_t)(border_area.y2 - dst_area.y2); + SDL_Rect src_rect = {frag_size - 1, sy, 1, dh}; + SDL_RenderCopyEx(renderer, frag, &src_rect, &dst_rect, 0, NULL, SDL_FLIP_VERTICAL); + } + } + /* Left border */ + border_area.x1 = coords->x1; + border_area.y1 = coords->y1 + frag_size; + border_area.x2 = coords->x1 + frag_size - 1; + border_area.y2 = coords->y2 - frag_size; + if(_lv_area_intersect(&dst_area, &border_area, clipped)) { + SDL_Rect dst_rect; + lv_area_to_sdl_rect(&dst_area, &dst_rect); + + lv_coord_t dw = lv_area_get_width(&dst_area); + lv_coord_t sx = (lv_coord_t)(dst_area.x1 - border_area.x1); + if(full) { + SDL_Rect src_rect = {sx, frag_size + 1, dw, 1}; + SDL_RenderCopy(renderer, frag, &src_rect, &dst_rect); + } + else { + SDL_Rect src_rect = {sx, frag_size - 1, dw, 1}; + SDL_RenderCopy(renderer, frag, &src_rect, &dst_rect); + } + } + /* Right border */ + border_area.x1 = LV_MAX(coords->x2 - frag_size + 1, coords->x1 + frag_size); + border_area.x2 = coords->x2; + if(_lv_area_intersect(&dst_area, &border_area, clipped)) { + SDL_Rect dst_rect; + lv_area_to_sdl_rect(&dst_area, &dst_rect); + + lv_coord_t dw = lv_area_get_width(&dst_area); + if(full) { + lv_coord_t sx = (lv_coord_t)(dst_area.x1 - border_area.x1); + SDL_Rect src_rect = {frag_size + FRAG_SPACING + sx, frag_size + 1, dw, 1}; + SDL_RenderCopy(renderer, frag, &src_rect, &dst_rect); + } + else { + lv_coord_t sx = (lv_coord_t)(border_area.x2 - dst_area.x2); + SDL_Rect src_rect = {sx, frag_size - 1, dw, 1}; + SDL_RenderCopyEx(renderer, frag, &src_rect, &dst_rect, 0, NULL, SDL_FLIP_HORIZONTAL); + } + } +} + +static void frag_render_center(SDL_Renderer * renderer, SDL_Texture * frag, lv_coord_t frag_size, + const lv_area_t * coords, + const lv_area_t * clipped, bool full) +{ + lv_area_t center_area = { + coords->x1 + frag_size, + coords->y1 + frag_size, + coords->x2 - frag_size, + coords->y2 - frag_size, + }; + if(center_area.x2 < center_area.x1 || center_area.y2 < center_area.y1) return; + lv_area_t draw_area; + if(!_lv_area_intersect(&draw_area, ¢er_area, clipped)) { + return; + } + SDL_Rect dst_rect; + lv_area_to_sdl_rect(&draw_area, &dst_rect); + if(full) { + SDL_Rect src_rect = {frag_size, frag_size, 1, 1}; + SDL_RenderCopy(renderer, frag, &src_rect, &dst_rect); + } + else { + SDL_Rect src_rect = {frag_size - 1, frag_size - 1, 1, 1}; + SDL_RenderCopy(renderer, frag, &src_rect, &dst_rect); + } +} + +static lv_draw_rect_bg_key_t rect_bg_key_create(lv_coord_t radius, lv_coord_t size) +{ + lv_draw_rect_bg_key_t key; + SDL_memset(&key, 0, sizeof(key)); + key.magic = LV_GPU_CACHE_KEY_MAGIC_RECT_BG; + key.radius = radius; + key.size = size; + return key; +} + +static lv_draw_rect_grad_frag_key_t rect_grad_frag_key_create(const lv_grad_dsc_t * grad, lv_coord_t w, lv_coord_t h, + lv_coord_t radius) +{ + lv_draw_rect_grad_frag_key_t key; + SDL_memset(&key, 0, sizeof(key)); + key.magic = LV_GPU_CACHE_KEY_MAGIC_RECT_GRAD; + key.stops_count = grad->stops_count; + key.dir = grad->dir; + for(uint8_t i = 0; i < grad->stops_count; i++) { + key.stops[i].frac = grad->stops[i].frac; + key.stops[i].color = grad->stops[i].color; + } + key.w = w; + key.h = h; + key.radius = radius; + return key; +} + +static lv_draw_rect_grad_strip_key_t rect_grad_strip_key_create(const lv_grad_dsc_t * grad) +{ + lv_draw_rect_grad_strip_key_t key; + SDL_memset(&key, 0, sizeof(key)); + key.magic = LV_GPU_CACHE_KEY_MAGIC_RECT_GRAD; + key.stops_count = grad->stops_count; + key.dir = grad->dir; + for(uint8_t i = 0; i < grad->stops_count; i++) { + key.stops[i].frac = grad->stops[i].frac; + key.stops[i].color = grad->stops[i].color; + } + return key; +} + +static lv_draw_rect_shadow_key_t rect_shadow_key_create(lv_coord_t radius, lv_coord_t size, lv_coord_t blur) +{ + lv_draw_rect_shadow_key_t key; + SDL_memset(&key, 0, sizeof(key)); + key.magic = LV_GPU_CACHE_KEY_MAGIC_RECT_SHADOW; + key.radius = radius; + key.size = size; + key.blur = blur; + return key; +} + +static lv_draw_rect_border_key_t rect_border_key_create(lv_coord_t rout, lv_coord_t rin, const lv_area_t * outer_area, + const lv_area_t * inner_area) +{ + lv_draw_rect_border_key_t key; + /* VERY IMPORTANT! Padding between members is uninitialized, so we have to wipe them manually */ + SDL_memset(&key, 0, sizeof(key)); + key.magic = LV_GPU_CACHE_KEY_MAGIC_RECT_BORDER; + key.rout = rout; + key.rin = rin; + key.offsets.x1 = inner_area->x1 - outer_area->x1; + key.offsets.x2 = inner_area->x2 - outer_area->x2; + key.offsets.y1 = inner_area->y1 - outer_area->y1; + key.offsets.y2 = inner_area->y2 - outer_area->y2; + return key; +} + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_rect.h b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_rect.h new file mode 100644 index 0000000..c3262d5 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_rect.h @@ -0,0 +1,104 @@ +/** + * @file lv_draw_sdl_rect.h + * + */ + +#ifndef LV_DRAW_SDL_RECT_H +#define LV_DRAW_SDL_RECT_H + + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include LV_GPU_SDL_INCLUDE_PATH + +#include "../lv_draw.h" + +#include "lv_draw_sdl_texture_cache.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct lv_draw_sdl_rect_header_t { + lv_img_header_t base; + SDL_Rect rect; +} lv_draw_sdl_rect_header_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/*====================== + * Add/remove functions + *=====================*/ + +/*===================== + * Setter functions + *====================*/ + +/*===================== + * Getter functions + *====================*/ + +/*===================== + * Other functions + *====================*/ + +/** + * + * @param ctx Drawing context + * @param radius Corner radius of the rectangle + * @param in_cache Whether the texture has been put in the cache + * @return Background fragment texture + */ +SDL_Texture * lv_draw_sdl_rect_bg_frag_obtain(lv_draw_sdl_ctx_t * ctx, lv_coord_t radius, bool * in_cache); + +/** + * + * @param ctx Drawing context + * @param grad Gradient info + * @param w Width of the rectangle + * @param h Height of the rectangle + * @param radius Corner radius of the rectangle + * @param in_cache Whether the texture has been put in the cache + * @return Gradient fragment texture + */ +SDL_Texture * lv_draw_sdl_rect_grad_frag_obtain(lv_draw_sdl_ctx_t * ctx, const lv_grad_dsc_t * grad, lv_coord_t w, + lv_coord_t h, lv_coord_t radius, bool * in_cache); + +/** + * + * @param ctx Drawing context + * @param grad Gradient info + * @param in_cache Whether the texture has been put in the cache + * @return Gradient strip texture + */ +SDL_Texture * lv_draw_sdl_rect_grad_strip_obtain(lv_draw_sdl_ctx_t * ctx, const lv_grad_dsc_t * grad, bool * in_cache); + +void lv_draw_sdl_rect_bg_frag_draw_corners(lv_draw_sdl_ctx_t * ctx, SDL_Texture * frag, lv_coord_t frag_size, + const lv_area_t * coords, const lv_area_t * clip, bool full); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_SDL*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_SDL_RECT_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_stack_blur.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_stack_blur.c new file mode 100644 index 0000000..1c411b0 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_stack_blur.c @@ -0,0 +1,249 @@ +/** + * @file lv_draw_sdl_stack_blur.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_draw_sdl_stack_blur.h" + +#if LV_USE_GPU_SDL +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +static void +stack_blur_job(lv_opa_t * src, unsigned int w, unsigned int h, unsigned int radius, int cores, int core, int step); + +/********************** + * STATIC VARIABLES + **********************/ + +// Based heavily on http://vitiy.info/Code/stackblur.cpp +// See http://vitiy.info/stackblur-algorithm-multi-threaded-blur-for-cpp/ +// Stack Blur Algorithm by Mario Klingemann + +static unsigned short const stackblur_mul[255] = { + 512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, + 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, + 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, + 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, + 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, + 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, + 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, + 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, + 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, + 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, + 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, + 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, + 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, + 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, + 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, + 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259 +}; + +static unsigned char const stackblur_shr[255] = { + 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, + 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 +}; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_stack_blur_grayscale(lv_opa_t * buf, uint16_t w, uint16_t h, uint16_t r) +{ + stack_blur_job(buf, w, h, r, 1, 0, 1); + stack_blur_job(buf, w, h, r, 1, 0, 2); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void stack_blur_job(lv_opa_t * src, unsigned int w, unsigned int h, unsigned int radius, int cores, int core, + int step) +{ + if(radius < 2 || radius > 254) { + /* Silently ignore bad radius */ + return; + } + + unsigned int x, y, xp, yp, i; + unsigned int sp; + unsigned int stack_start; + unsigned char * stack_ptr; + + lv_opa_t * src_ptr; + lv_opa_t * dst_ptr; + + unsigned long sum_r; + unsigned long sum_in_r; + unsigned long sum_out_r; + + unsigned int wm = w - 1; + unsigned int hm = h - 1; + unsigned int stride = w; + unsigned int div = (radius * 2) + 1; + unsigned int mul_sum = stackblur_mul[radius]; + unsigned char shr_sum = stackblur_shr[radius]; + unsigned char stack[254 * 2 + 1]; + + if(step == 1) { + unsigned int minY = core * h / cores; + unsigned int maxY = (core + 1) * h / cores; + + for(y = minY; y < maxY; y++) { + sum_r = + sum_in_r = + sum_out_r = 0; + + src_ptr = src + stride * y; // start of line (0,y) + + for(i = 0; i <= radius; i++) { + stack_ptr = &stack[i]; + stack_ptr[0] = src_ptr[0]; + sum_r += src_ptr[0] * (i + 1); + sum_out_r += src_ptr[0]; + } + + + for(i = 1; i <= radius; i++) { + if(i <= wm) src_ptr += 1; + stack_ptr = &stack[i + radius]; + stack_ptr[0] = src_ptr[0]; + sum_r += src_ptr[0] * (radius + 1 - i); + sum_in_r += src_ptr[0]; + } + + + sp = radius; + xp = radius; + if(xp > wm) xp = wm; + src_ptr = src + (xp + y * w); // img.pix_ptr(xp, y); + dst_ptr = src + y * stride; // img.pix_ptr(0, y); + for(x = 0; x < w; x++) { + dst_ptr[0] = LV_CLAMP((sum_r * mul_sum) >> shr_sum, 0, 255); + dst_ptr += 1; + + sum_r -= sum_out_r; + + stack_start = sp + div - radius; + if(stack_start >= div) stack_start -= div; + stack_ptr = &stack[stack_start]; + + sum_out_r -= stack_ptr[0]; + + if(xp < wm) { + src_ptr += 1; + ++xp; + } + + stack_ptr[0] = src_ptr[0]; + + sum_in_r += src_ptr[0]; + sum_r += sum_in_r; + + ++sp; + if(sp >= div) sp = 0; + stack_ptr = &stack[sp]; + + sum_out_r += stack_ptr[0]; + sum_in_r -= stack_ptr[0]; + } + + } + } + + // step 2 + if(step == 2) { + unsigned int minX = core * w / cores; + unsigned int maxX = (core + 1) * w / cores; + + for(x = minX; x < maxX; x++) { + sum_r = + sum_in_r = + sum_out_r = 0; + + src_ptr = src + x; // x,0 + for(i = 0; i <= radius; i++) { + stack_ptr = &stack[i]; + stack_ptr[0] = src_ptr[0]; + sum_r += src_ptr[0] * (i + 1); + sum_out_r += src_ptr[0]; + } + for(i = 1; i <= radius; i++) { + if(i <= hm) src_ptr += stride; // +stride + + stack_ptr = &stack[i + radius]; + stack_ptr[0] = src_ptr[0]; + sum_r += src_ptr[0] * (radius + 1 - i); + sum_in_r += src_ptr[0]; + } + + sp = radius; + yp = radius; + if(yp > hm) yp = hm; + src_ptr = src + (x + yp * w); // img.pix_ptr(x, yp); + dst_ptr = src + x; // img.pix_ptr(x, 0); + for(y = 0; y < h; y++) { + dst_ptr[0] = LV_CLAMP((sum_r * mul_sum) >> shr_sum, 0, 255); + dst_ptr += stride; + + sum_r -= sum_out_r; + + stack_start = sp + div - radius; + if(stack_start >= div) stack_start -= div; + stack_ptr = &stack[stack_start]; + + sum_out_r -= stack_ptr[0]; + + if(yp < hm) { + src_ptr += stride; // stride + ++yp; + } + + stack_ptr[0] = src_ptr[0]; + + sum_in_r += src_ptr[0]; + sum_r += sum_in_r; + + ++sp; + if(sp >= div) sp = 0; + stack_ptr = &stack[sp]; + + sum_out_r += stack_ptr[0]; + sum_in_r -= stack_ptr[0]; + } + } + } +} + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_image_cache.h b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_stack_blur.h similarity index 61% rename from L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_image_cache.h rename to L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_stack_blur.h index 105779f..413b1c9 100644 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_image_cache.h +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_stack_blur.h @@ -1,10 +1,9 @@ /** - * @file lv_nuttx_image_cache.h + * @file lv_draw_sdl_stack_blur.h * */ - -#ifndef LV_NUTTX_IMAGE_CACHE_H -#define LV_NUTTX_IMAGE_CACHE_H +#ifndef LV_DRAW_SDL_STACK_BLUR_H +#define LV_DRAW_SDL_STACK_BLUR_H #ifdef __cplusplus extern "C" { @@ -16,6 +15,10 @@ extern "C" { #include "../../lv_conf_internal.h" +#if LV_USE_GPU_SDL + +#include "../../misc/lv_color.h" + /********************* * DEFINES *********************/ @@ -28,16 +31,16 @@ extern "C" { * GLOBAL PROTOTYPES **********************/ -void lv_nuttx_image_cache_init(void); - -void lv_nuttx_image_cache_deinit(void); +void lv_stack_blur_grayscale(lv_opa_t * buf, uint16_t w, uint16_t h, uint16_t r); /********************** * MACROS **********************/ +#endif /*LV_USE_GPU_SDL*/ + #ifdef __cplusplus } /*extern "C"*/ #endif -#endif /*LV_NUTTX_IMAGE_CACHE_H*/ +#endif /*LV_DRAW_SDL_STACK_BLUR_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_texture_cache.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_texture_cache.c new file mode 100644 index 0000000..4067417 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_texture_cache.c @@ -0,0 +1,176 @@ +/** + * @file lv_draw_sdl_texture_cache.c + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include "lv_draw_sdl_texture_cache.h" + +#include "lv_draw_sdl_utils.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + SDL_Texture * texture; + void * userdata; + lv_lru_free_t * userdata_free; + lv_draw_sdl_cache_flag_t flags; +} draw_cache_value_t; + +typedef struct { + lv_sdl_cache_key_magic_t magic; +} temp_texture_key_t; + +typedef struct { + lv_coord_t width, height; +} temp_texture_userdata_t; + +static void draw_cache_free_value(draw_cache_value_t *); + +static draw_cache_value_t * draw_cache_get_entry(lv_draw_sdl_ctx_t * ctx, const void * key, size_t key_length, + bool * found); +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_draw_sdl_texture_cache_init(lv_draw_sdl_ctx_t * ctx) +{ + ctx->internals->texture_cache = lv_lru_create(LV_GPU_SDL_LRU_SIZE, 65536, + (lv_lru_free_t *) draw_cache_free_value, NULL); +} + +void lv_draw_sdl_texture_cache_deinit(lv_draw_sdl_ctx_t * ctx) +{ + lv_lru_del(ctx->internals->texture_cache); +} + +SDL_Texture * lv_draw_sdl_texture_cache_get(lv_draw_sdl_ctx_t * ctx, const void * key, size_t key_length, bool * found) +{ + return lv_draw_sdl_texture_cache_get_with_userdata(ctx, key, key_length, found, NULL); +} + +SDL_Texture * lv_draw_sdl_texture_cache_get_with_userdata(lv_draw_sdl_ctx_t * ctx, const void * key, size_t key_length, + bool * found, void ** userdata) +{ + draw_cache_value_t * value = draw_cache_get_entry(ctx, key, key_length, found); + if(!value) return NULL; + if(userdata) { + *userdata = value->userdata; + } + return value->texture; +} + +bool lv_draw_sdl_texture_cache_put(lv_draw_sdl_ctx_t * ctx, const void * key, size_t key_length, SDL_Texture * texture) +{ + return lv_draw_sdl_texture_cache_put_advanced(ctx, key, key_length, texture, NULL, NULL, 0); +} + +bool lv_draw_sdl_texture_cache_put_advanced(lv_draw_sdl_ctx_t * ctx, const void * key, size_t key_length, + SDL_Texture * texture, void * userdata, void userdata_free(void *), + lv_draw_sdl_cache_flag_t flags) +{ + lv_lru_t * lru = ctx->internals->texture_cache; + draw_cache_value_t * value = SDL_malloc(sizeof(draw_cache_value_t)); + value->texture = texture; + value->userdata = userdata; + value->userdata_free = userdata_free; + value->flags = flags; + if(!texture) { + return lv_lru_set(lru, key, key_length, value, 1) == LV_LRU_OK; + } + if(flags & LV_DRAW_SDL_CACHE_FLAG_MANAGED) { + /* Managed texture doesn't count into cache size */ + LV_LOG_INFO("cache texture %p", texture); + return lv_lru_set(lru, key, key_length, value, 1) == LV_LRU_OK; + } + Uint32 format; + int access, width, height; + if(SDL_QueryTexture(texture, &format, &access, &width, &height) != 0) { + return false; + } + LV_LOG_INFO("cache texture %p, %d*%d@%dbpp", texture, width, height, SDL_BITSPERPIXEL(format)); + return lv_lru_set(lru, key, key_length, value, width * height * SDL_BITSPERPIXEL(format) / 8) == LV_LRU_OK; +} + +lv_draw_sdl_cache_key_head_img_t * lv_draw_sdl_texture_img_key_create(const void * src, int32_t frame_id, size_t * size) +{ + lv_draw_sdl_cache_key_head_img_t header; + /* VERY IMPORTANT! Padding between members is uninitialized, so we have to wipe them manually */ + SDL_memset(&header, 0, sizeof(header)); + header.magic = LV_GPU_CACHE_KEY_MAGIC_IMG; + header.type = lv_img_src_get_type(src); + header.frame_id = frame_id; + void * key; + size_t key_size; + if(header.type == LV_IMG_SRC_FILE || header.type == LV_IMG_SRC_SYMBOL) { + size_t srclen = SDL_strlen(src); + key_size = sizeof(header) + srclen; + key = SDL_malloc(key_size); + SDL_memcpy(key, &header, sizeof(header)); + /*Copy string content as key value*/ + SDL_memcpy(key + sizeof(header), src, srclen); + } + else { + key_size = sizeof(header) + sizeof(void *); + key = SDL_malloc(key_size); + SDL_memcpy(key, &header, sizeof(header)); + /*Copy address number as key value*/ + SDL_memcpy(key + sizeof(header), &src, sizeof(void *)); + } + *size = key_size; + return (lv_draw_sdl_cache_key_head_img_t *) key; +} + +static void draw_cache_free_value(draw_cache_value_t * value) +{ + if(value->texture && !(value->flags & LV_DRAW_SDL_CACHE_FLAG_MANAGED)) { + LV_LOG_INFO("destroy texture %p", value->texture); + SDL_DestroyTexture(value->texture); + } + if(value->userdata_free) { + value->userdata_free(value->userdata); + } + SDL_free(value); +} + +static draw_cache_value_t * draw_cache_get_entry(lv_draw_sdl_ctx_t * ctx, const void * key, size_t key_length, + bool * found) +{ + lv_lru_t * lru = ctx->internals->texture_cache; + draw_cache_value_t * value = NULL; + lv_lru_get(lru, key, key_length, (void **) &value); + if(!value) { + if(found) { + *found = false; + } + return NULL; + } + if(found) { + *found = true; + } + return value; +} + +#endif /*LV_USE_GPU_SDL*/ + diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_texture_cache.h b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_texture_cache.h new file mode 100644 index 0000000..3a799f5 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_texture_cache.h @@ -0,0 +1,109 @@ +/** + * @file lv_draw_sdl_texture_cache.h + * + */ + +#ifndef LV_DRAW_SDL_TEXTURE_CACHE_H +#define LV_DRAW_SDL_TEXTURE_CACHE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include LV_GPU_SDL_INCLUDE_PATH +#include "lv_draw_sdl.h" +#include "lv_draw_sdl_priv.h" +#include "../../draw/lv_img_decoder.h" +#include "../../misc/lv_area.h" + +/********************* + * DEFINES + *********************/ + +#define LV_DRAW_SDL_DEC_DSC_TEXTURE_HEAD "@LVSDLTex" + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + char head[8]; + SDL_Texture * texture; + SDL_Rect rect; + bool texture_managed; + bool texture_referenced; +} lv_draw_sdl_dec_dsc_userdata_t; + +typedef enum { + LV_GPU_CACHE_KEY_MAGIC_ARC = 0x01, + LV_GPU_CACHE_KEY_MAGIC_IMG = 0x11, + LV_GPU_CACHE_KEY_MAGIC_IMG_ROUNDED_CORNERS = 0x12, + LV_GPU_CACHE_KEY_MAGIC_LINE = 0x21, + LV_GPU_CACHE_KEY_MAGIC_RECT_BG = 0x31, + LV_GPU_CACHE_KEY_MAGIC_RECT_SHADOW = 0x32, + LV_GPU_CACHE_KEY_MAGIC_RECT_BORDER = 0x33, + LV_GPU_CACHE_KEY_MAGIC_RECT_GRAD = 0x34, + LV_GPU_CACHE_KEY_MAGIC_FONT_GLYPH = 0x41, + LV_GPU_CACHE_KEY_MAGIC_MASK = 0x51, +} lv_sdl_cache_key_magic_t; + +typedef enum { + LV_DRAW_SDL_CACHE_FLAG_NONE = 0, + LV_DRAW_SDL_CACHE_FLAG_MANAGED = 1, +} lv_draw_sdl_cache_flag_t; + +typedef struct { + lv_sdl_cache_key_magic_t magic; + lv_img_src_t type; + int32_t frame_id; +} lv_draw_sdl_cache_key_head_img_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +void lv_draw_sdl_texture_cache_init(lv_draw_sdl_ctx_t * ctx); + +void lv_draw_sdl_texture_cache_deinit(lv_draw_sdl_ctx_t * ctx); + +/** + * Find cached texture by key. The texture can be destroyed during usage. + */ +SDL_Texture * lv_draw_sdl_texture_cache_get(lv_draw_sdl_ctx_t * ctx, const void * key, size_t key_length, bool * found); + +SDL_Texture * lv_draw_sdl_texture_cache_get_with_userdata(lv_draw_sdl_ctx_t * ctx, const void * key, size_t key_length, + bool * found, void ** userdata); + +/** + * @return Whether the texture has been put in the cache + */ +bool lv_draw_sdl_texture_cache_put(lv_draw_sdl_ctx_t * ctx, const void * key, size_t key_length, SDL_Texture * texture); + +/** + * @return Whether the texture has been put in the cache + */ +bool lv_draw_sdl_texture_cache_put_advanced(lv_draw_sdl_ctx_t * ctx, const void * key, size_t key_length, + SDL_Texture * texture, void * userdata, void userdata_free(void *), + lv_draw_sdl_cache_flag_t flags); + +lv_draw_sdl_cache_key_head_img_t * lv_draw_sdl_texture_img_key_create(const void * src, int32_t frame_id, + size_t * size); + +/********************** + * MACROS + **********************/ +#endif /*LV_USE_GPU_SDL*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_SDL_TEXTURE_CACHE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_utils.c b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_utils.c new file mode 100644 index 0000000..3ca0fad --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_utils.c @@ -0,0 +1,183 @@ +/** + * @file lv_draw_sdl_utils.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../lv_conf_internal.h" + +#if LV_USE_GPU_SDL + +#include "lv_draw_sdl_utils.h" + +#include "../lv_draw.h" +#include "../lv_draw_label.h" +#include "../../core/lv_refr.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +/********************** + * STATIC VARIABLES + **********************/ +extern const uint8_t _lv_bpp1_opa_table[2]; +extern const uint8_t _lv_bpp2_opa_table[4]; +extern const uint8_t _lv_bpp4_opa_table[16]; +extern const uint8_t _lv_bpp8_opa_table[256]; + +static int utils_init_count = 0; +static SDL_Palette * lv_sdl_palette_grayscale8 = NULL; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void _lv_draw_sdl_utils_init() +{ + utils_init_count++; + if(utils_init_count > 1) { + return; + } + lv_sdl_palette_grayscale8 = lv_sdl_alloc_palette_for_bpp(_lv_bpp8_opa_table, 8); +} + +void _lv_draw_sdl_utils_deinit() +{ + if(utils_init_count == 0) { + return; + } + utils_init_count--; + if(utils_init_count == 0) { + SDL_FreePalette(lv_sdl_palette_grayscale8); + lv_sdl_palette_grayscale8 = NULL; + } +} + +void lv_area_to_sdl_rect(const lv_area_t * in, SDL_Rect * out) +{ + out->x = in->x1; + out->y = in->y1; + out->w = in->x2 - in->x1 + 1; + out->h = in->y2 - in->y1 + 1; +} + +void lv_color_to_sdl_color(const lv_color_t * in, SDL_Color * out) +{ +#if LV_COLOR_DEPTH == 32 + out->a = in->ch.alpha; + out->r = in->ch.red; + out->g = in->ch.green; + out->b = in->ch.blue; +#else + uint32_t color32 = lv_color_to32(*in); + lv_color32_t * color32_t = (lv_color32_t *) &color32; + out->a = color32_t->ch.alpha; + out->r = color32_t->ch.red; + out->g = color32_t->ch.green; + out->b = color32_t->ch.blue; +#endif +} + +void lv_area_zoom_to_sdl_rect(const lv_area_t * in, SDL_Rect * out, uint16_t zoom, const lv_point_t * pivot) +{ + if(zoom == LV_IMG_ZOOM_NONE) { + lv_area_to_sdl_rect(in, out); + return; + } + lv_area_t tmp; + _lv_img_buf_get_transformed_area(&tmp, lv_area_get_width(in), lv_area_get_height(in), 0, zoom, pivot); + lv_area_move(&tmp, in->x1, in->y1); + lv_area_to_sdl_rect(&tmp, out); +} + +SDL_Palette * lv_sdl_alloc_palette_for_bpp(const uint8_t * mapping, uint8_t bpp) +{ + SDL_assert(bpp >= 1 && bpp <= 8); + int color_cnt = 1 << bpp; + SDL_Palette * result = SDL_AllocPalette(color_cnt); + SDL_Color palette[256]; + for(int i = 0; i < color_cnt; i++) { + palette[i].r = palette[i].g = palette[i].b = 0xFF; + palette[i].a = mapping ? mapping[i] : i; + } + SDL_SetPaletteColors(result, palette, 0, color_cnt); + return result; +} + +SDL_Surface * lv_sdl_create_opa_surface(lv_opa_t * opa, lv_coord_t width, lv_coord_t height, lv_coord_t stride) +{ + SDL_Surface * indexed = SDL_CreateRGBSurfaceFrom(opa, width, height, 8, stride, 0, 0, 0, 0); + SDL_SetSurfacePalette(indexed, lv_sdl_palette_grayscale8); + SDL_Surface * converted = SDL_ConvertSurfaceFormat(indexed, LV_DRAW_SDL_TEXTURE_FORMAT, 0); + SDL_FreeSurface(indexed); + return converted; +} + +SDL_Texture * lv_sdl_create_opa_texture(SDL_Renderer * renderer, lv_opa_t * pixels, lv_coord_t width, + lv_coord_t height, lv_coord_t stride) +{ + SDL_Surface * indexed = lv_sdl_create_opa_surface(pixels, width, height, stride); + SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, indexed); + SDL_FreeSurface(indexed); + return texture; +} + +void lv_sdl_to_8bpp(uint8_t * dest, const uint8_t * src, int width, int height, int stride, uint8_t bpp) +{ + int src_len = width * height; + int cur = 0; + int curbit; + uint8_t opa_mask; + const uint8_t * opa_table; + switch(bpp) { + case 1: + opa_mask = 0x1; + opa_table = _lv_bpp1_opa_table; + break; + case 2: + opa_mask = 0x4; + opa_table = _lv_bpp2_opa_table; + break; + case 4: + opa_mask = 0xF; + opa_table = _lv_bpp4_opa_table; + break; + case 8: + opa_mask = 0xFF; + opa_table = _lv_bpp8_opa_table; + break; + default: + return; + } + /* Does this work well on big endian systems? */ + while(cur < src_len) { + curbit = 8 - bpp; + uint8_t src_byte = src[cur * bpp / 8]; + while(curbit >= 0 && cur < src_len) { + uint8_t src_bits = opa_mask & (src_byte >> curbit); + dest[(cur / width * stride) + (cur % width)] = opa_table[src_bits]; + curbit -= bpp; + cur++; + } + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +#endif /*LV_USE_GPU_SDL*/ diff --git a/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_utils.h b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_utils.h new file mode 100644 index 0000000..9afae68 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sdl/lv_draw_sdl_utils.h @@ -0,0 +1,65 @@ +/** + * @file lv_draw_sdl_utils.h + * + */ +#ifndef LV_DRAW_SDL_UTILS_H +#define LV_DRAW_SDL_UTILS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +#include "../../lv_conf_internal.h" +#if LV_USE_GPU_SDL + +#include "lv_draw_sdl.h" +#include "../../misc/lv_color.h" +#include "../../misc/lv_area.h" + +#include LV_GPU_SDL_INCLUDE_PATH + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +void _lv_draw_sdl_utils_init(); + +void _lv_draw_sdl_utils_deinit(); + +void lv_area_to_sdl_rect(const lv_area_t * in, SDL_Rect * out); + +void lv_color_to_sdl_color(const lv_color_t * in, SDL_Color * out); + +void lv_area_zoom_to_sdl_rect(const lv_area_t * in, SDL_Rect * out, uint16_t zoom, const lv_point_t * pivot); + +SDL_Palette * lv_sdl_alloc_palette_for_bpp(const uint8_t * mapping, uint8_t bpp); + +SDL_Surface * lv_sdl_create_opa_surface(lv_opa_t * opa, lv_coord_t width, lv_coord_t height, lv_coord_t stride); + +SDL_Texture * lv_sdl_create_opa_texture(SDL_Renderer * renderer, lv_opa_t * pixels, lv_coord_t width, + lv_coord_t height, lv_coord_t stride); + +void lv_sdl_to_8bpp(uint8_t * dest, const uint8_t * src, int width, int height, int stride, uint8_t bpp); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_SDL*/ +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_SDL_UTILS_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_draw_stm32_dma2d.mk b/L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_draw_stm32_dma2d.mk new file mode 100644 index 0000000..8ed00b0 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_draw_stm32_dma2d.mk @@ -0,0 +1,6 @@ +CSRCS += lv_gpu_stm32_dma2d.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/stm32_dma2d +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/stm32_dma2d + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/stm32_dma2d" diff --git a/L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.c b/L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.c new file mode 100644 index 0000000..84da4b6 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.c @@ -0,0 +1,796 @@ +/** + * @file lv_gpu_stm32_dma2d.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_gpu_stm32_dma2d.h" +#include "../../core/lv_refr.h" + +#if LV_USE_GPU_STM32_DMA2D + +/********************* + * DEFINES + *********************/ +#if LV_COLOR_16_SWAP + // Note: DMA2D red/blue swap (RBS) works for all color modes + #define RBS_BIT 1U +#else + #define RBS_BIT 0U +#endif + +#define CACHE_ROW_SIZE 32U // cache row size in Bytes + +// For code/implementation discussion refer to https://github.com/lvgl/lvgl/issues/3714#issuecomment-1365187036 +// astyle --options=lvgl/scripts/code-format.cfg --ignore-exclude-errors lvgl/src/draw/stm32_dma2d/*.c lvgl/src/draw/stm32_dma2d/*.h + +#if LV_COLOR_DEPTH == 16 + const dma2d_color_format_t LvglColorFormat = RGB565; +#elif LV_COLOR_DEPTH == 32 + const dma2d_color_format_t LvglColorFormat = ARGB8888; +#else + #error "Cannot use DMA2D with LV_COLOR_DEPTH other than 16 or 32" +#endif + +#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + #define LV_STM32_DMA2D_USE_M7_CACHE +#endif + +#if defined (LV_STM32_DMA2D_USE_M7_CACHE) + // Cortex-M7 DCache present + #define __lv_gpu_stm32_dma2d_clean_cache(address, offset, width, height, pixel_size) _lv_gpu_stm32_dma2d_clean_cache(address, offset, width, height, pixel_size) + #define __lv_gpu_stm32_dma2d_invalidate_cache(address, offset, width, height, pixel_size) _lv_gpu_stm32_dma2d_invalidate_cache(address, offset, width, height, pixel_size) +#else + #define __lv_gpu_stm32_dma2d_clean_cache(address, offset, width, height, pixel_size) + #define __lv_gpu_stm32_dma2d_invalidate_cache(address, offset, width, height, pixel_size) +#endif + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_draw_stm32_dma2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc); +static void lv_draw_stm32_dma2d_buffer_copy(lv_draw_ctx_t * draw_ctx, + void * dest_buf, lv_coord_t dest_stride, const lv_area_t * dest_area, + void * src_buf, lv_coord_t src_stride, const lv_area_t * src_area); +static void lv_draw_stm32_dma2d_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * img_dsc, + const lv_area_t * coords, const uint8_t * src_buf, lv_img_cf_t color_format); +static dma2d_color_format_t lv_color_format_to_dma2d_color_format(lv_img_cf_t color_format); +static lv_point_t lv_area_get_offset(const lv_area_t * area1, const lv_area_t * area2); + +LV_STM32_DMA2D_STATIC void lv_gpu_stm32_dma2d_wait_cb(lv_draw_ctx_t * draw_ctx); +LV_STM32_DMA2D_STATIC lv_res_t lv_draw_stm32_dma2d_img(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * img_dsc, + const lv_area_t * src_area, const void * src); +LV_STM32_DMA2D_STATIC void _lv_draw_stm32_dma2d_blend_fill(const lv_color_t * dst_buf, lv_coord_t dst_stride, + const lv_area_t * draw_area, lv_color_t color, lv_opa_t opa); +LV_STM32_DMA2D_STATIC void _lv_draw_stm32_dma2d_blend_map(const lv_color_t * dest_buf, lv_coord_t dest_stride, + const lv_area_t * draw_area, const void * src_buf, lv_coord_t src_stride, const lv_point_t * src_offset, lv_opa_t opa, + dma2d_color_format_t src_color_format, bool ignore_src_alpha); +LV_STM32_DMA2D_STATIC void _lv_draw_stm32_dma2d_blend_paint(const lv_color_t * dst_buf, lv_coord_t dst_stride, + const lv_area_t * draw_area, const lv_opa_t * mask_buf, lv_coord_t mask_stride, const lv_point_t * mask_offset, + lv_color_t color, lv_opa_t opa); +LV_STM32_DMA2D_STATIC void _lv_draw_stm32_dma2d_copy_buffer(const lv_color_t * dest_buf, lv_coord_t dest_stride, + const lv_area_t * draw_area, const lv_color_t * src_buf, lv_coord_t src_stride, const lv_point_t * src_offset); +LV_STM32_DMA2D_STATIC void _lv_gpu_stm32_dma2d_await_dma_transfer_finish(lv_disp_drv_t * disp_drv); +LV_STM32_DMA2D_STATIC void _lv_gpu_stm32_dma2d_start_dma_transfer(void); + +#if defined (LV_STM32_DMA2D_USE_M7_CACHE) +LV_STM32_DMA2D_STATIC void _lv_gpu_stm32_dma2d_invalidate_cache(uint32_t address, lv_coord_t offset, + lv_coord_t width, lv_coord_t height, uint8_t pixel_size); +LV_STM32_DMA2D_STATIC void _lv_gpu_stm32_dma2d_clean_cache(uint32_t address, lv_coord_t offset, lv_coord_t width, + lv_coord_t height, uint8_t pixel_size); +#endif + +#if defined(LV_STM32_DMA2D_TEST) + LV_STM32_DMA2D_STATIC bool _lv_gpu_stm32_dwt_init(void); + LV_STM32_DMA2D_STATIC void _lv_gpu_stm32_dwt_reset(void); + LV_STM32_DMA2D_STATIC uint32_t _lv_gpu_stm32_dwt_get_us(void); +#endif + +static bool isDma2dInProgess = false; // indicates whether DMA2D transfer *initiated here* is in progress + +/** + * Turn on the peripheral and set output color mode, this only needs to be done once + */ +void lv_draw_stm32_dma2d_init(void) +{ + // Enable DMA2D clock +#if defined(STM32F4) || defined(STM32F7) || defined(STM32U5) + RCC->AHB1ENR |= RCC_AHB1ENR_DMA2DEN; // enable DMA2D + // wait for hardware access to complete + __asm volatile("DSB\n"); + volatile uint32_t temp = RCC->AHB1ENR; + LV_UNUSED(temp); +#elif defined(STM32H7) + RCC->AHB3ENR |= RCC_AHB3ENR_DMA2DEN; + // wait for hardware access to complete + __asm volatile("DSB\n"); + volatile uint32_t temp = RCC->AHB3ENR; + LV_UNUSED(temp); +#else +# warning "LVGL can't enable the clock of DMA2D" +#endif + // AHB master timer configuration + DMA2D->AMTCR = 0; // AHB bus guaranteed dead time disabled +#if defined(LV_STM32_DMA2D_TEST) + _lv_gpu_stm32_dwt_init(); // init µs timer +#endif +} + +void lv_draw_stm32_dma2d_ctx_init(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) +{ + lv_draw_sw_init_ctx(drv, draw_ctx); + + lv_draw_stm32_dma2d_ctx_t * dma2d_draw_ctx = (lv_draw_sw_ctx_t *)draw_ctx; + + dma2d_draw_ctx->blend = lv_draw_stm32_dma2d_blend; + dma2d_draw_ctx->base_draw.draw_img_decoded = lv_draw_stm32_dma2d_img_decoded; + //dma2d_draw_ctx->base_draw.draw_img = lv_draw_stm32_dma2d_img; + // Note: currently it does not make sense use lv_gpu_stm32_dma2d_wait_cb() since waiting starts right after the dma2d transfer + //dma2d_draw_ctx->base_draw.wait_for_finish = lv_gpu_stm32_dma2d_wait_cb; + dma2d_draw_ctx->base_draw.buffer_copy = lv_draw_stm32_dma2d_buffer_copy; +} + +void lv_draw_stm32_dma2d_ctx_deinit(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) +{ + LV_UNUSED(drv); + LV_UNUSED(draw_ctx); +} + +static void lv_draw_stm32_dma2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc) +{ + if(dsc->blend_mode != LV_BLEND_MODE_NORMAL) { + lv_draw_sw_blend_basic(draw_ctx, dsc); + return; + } + // Note: x1 must be zero. Otherwise, there is no way to correctly calculate dest_stride. + //LV_ASSERT_MSG(draw_ctx->buf_area->x1 == 0); // critical? + // Both draw buffer start address and buffer size *must* be 32-byte aligned since draw buffer cache is being invalidated. + //uint32_t drawBufferLength = lv_area_get_size(draw_ctx->buf_area) * sizeof(lv_color_t); + //LV_ASSERT_MSG(drawBufferLength % CACHE_ROW_SIZE == 0); // critical, but this is not the way to test it + //LV_ASSERT_MSG((uint32_t)draw_ctx->buf % CACHE_ROW_SIZE == 0, "draw_ctx.buf is not 32B aligned"); // critical? + + if(dsc->src_buf) { + // For performance reasons, both source buffer start address and buffer size *should* be 32-byte aligned since source buffer cache is being cleaned. + //uint32_t srcBufferLength = lv_area_get_size(dsc->blend_area) * sizeof(lv_color_t); + //LV_ASSERT_MSG(srcBufferLength % CACHE_ROW_SIZE == 0); // FIXME: assert fails (performance, non-critical) + //LV_ASSERT_MSG((uint32_t)dsc->src_buf % CACHE_ROW_SIZE == 0); // FIXME: assert fails (performance, non-critical) + } + + lv_area_t draw_area; + if(!_lv_area_intersect(&draw_area, dsc->blend_area, draw_ctx->clip_area)) return; + // + draw_ctx->buf_area has the entire draw buffer location + // + draw_ctx->clip_area has the current draw buffer location + // + dsc->blend_area has the location of the area intended to be painted - image etc. + // + draw_area has the area actually being painted + // All coordinates are relative to the screen. + + const lv_opa_t * mask = dsc->mask_buf; + + if(dsc->mask_buf && dsc->mask_res == LV_DRAW_MASK_RES_TRANSP) return; + else if(dsc->mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask = NULL; + + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); + if(mask != NULL) { + // For performance reasons, both mask buffer start address and buffer size *should* be 32-byte aligned since mask buffer cache is being cleaned. + //uint32_t srcBufferLength = lv_area_get_size(dsc->mask_area) * sizeof(lv_opa_t); + //LV_ASSERT_MSG(srcBufferLength % CACHE_ROW_SIZE == 0); // FIXME: assert fails (performance, non-critical) + //LV_ASSERT_MSG((uint32_t)mask % CACHE_ROW_SIZE == 0); // FIXME: assert fails (performance, non-critical) + + lv_coord_t mask_stride = lv_area_get_width(dsc->mask_area); + lv_point_t mask_offset = lv_area_get_offset(dsc->mask_area, &draw_area); // mask offset in relation to draw_area + + if(dsc->src_buf == NULL) { // 93.5% + lv_area_move(&draw_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + _lv_draw_stm32_dma2d_blend_paint(draw_ctx->buf, dest_stride, &draw_area, mask, mask_stride, &mask_offset, dsc->color, + dsc->opa); + } + else { // 0.2% + // note: (x)RGB dsc->src_buf does not carry alpha channel bytes, + // alpha channel bytes are carried in dsc->mask_buf +#if LV_COLOR_DEPTH == 32 + lv_coord_t src_stride = lv_area_get_width(dsc->blend_area); + lv_point_t src_offset = lv_area_get_offset(dsc->blend_area, &draw_area); // source image offset in relation to draw_area + lv_coord_t draw_width = lv_area_get_width(&draw_area); + lv_coord_t draw_height = lv_area_get_height(&draw_area); + + // merge mask alpha bytes with src RGB bytes + // TODO: optimize by reading 4 or 8 mask bytes at a time + mask += (mask_stride * mask_offset.y) + mask_offset.x; + lv_color_t * src_buf = (lv_color_t *)dsc->src_buf; + src_buf += (src_stride * src_offset.y) + src_offset.x; + uint16_t mask_buffer_offset = mask_stride - draw_width; + uint16_t src_buffer_offset = src_stride - draw_width; + while(draw_height > 0) { + draw_height--; + for(uint16_t x = 0; x < draw_width; x++) { + (*src_buf).ch.alpha = *mask; + src_buf++; + mask++; + } + mask += mask_buffer_offset; + src_buf += src_buffer_offset; + } + + lv_area_move(&draw_area, -draw_ctx->buf_area->x1, + -draw_ctx->buf_area->y1); // translate the screen draw area to the origin of the buffer area + _lv_draw_stm32_dma2d_blend_map(draw_ctx->buf, dest_stride, &draw_area, dsc->src_buf, src_stride, &src_offset, dsc->opa, + ARGB8888, false); +#else + // Note: 16-bit bitmap hardware blending with mask and background is possible, but requires a temp 24 or 32-bit buffer to combine bitmap with mask first. + + lv_draw_sw_blend_basic(draw_ctx, dsc); // (e.g. Shop Items) + // clean cache after software drawing - this does not help since this is not the only place where buffer is written without dma2d + // lv_coord_t draw_width = lv_area_get_width(&draw_area); + // lv_coord_t draw_height = lv_area_get_height(&draw_area); + // uint32_t dest_address = (uint32_t)(draw_ctx->buf + (dest_stride * draw_area.y1) + draw_area.x1); + // __lv_gpu_stm32_dma2d_clean_cache(dest_address, dest_stride - draw_width, draw_width, draw_height, sizeof(lv_color_t)); +#endif + } + } + else { + if(dsc->src_buf == NULL) { // 6.1% + lv_area_move(&draw_area, -draw_ctx->buf_area->x1, + -draw_ctx->buf_area->y1); // translate the screen draw area to the origin of the buffer area + _lv_draw_stm32_dma2d_blend_fill(draw_ctx->buf, dest_stride, &draw_area, dsc->color, dsc->opa); + } + else { // 0.2% + lv_coord_t src_stride = lv_area_get_width(dsc->blend_area); + lv_point_t src_offset = lv_area_get_offset(dsc->blend_area, &draw_area); // source image offset in relation to draw_area + lv_area_move(&draw_area, -draw_ctx->buf_area->x1, + -draw_ctx->buf_area->y1); // translate the screen draw area to the origin of the buffer area + _lv_draw_stm32_dma2d_blend_map(draw_ctx->buf, dest_stride, &draw_area, dsc->src_buf, src_stride, &src_offset, dsc->opa, + LvglColorFormat, true); + } + } +} + +// Does dest_area = intersect(draw_ctx->clip_area, src_area) ? +// See: https://github.com/lvgl/lvgl/issues/3714#issuecomment-1331710788 +static void lv_draw_stm32_dma2d_buffer_copy(lv_draw_ctx_t * draw_ctx, void * dest_buf, lv_coord_t dest_stride, + const lv_area_t * dest_area, void * src_buf, lv_coord_t src_stride, const lv_area_t * src_area) +{ + // Both draw buffer start address and buffer size *must* be 32-byte aligned since draw buffer cache is being invalidated. + //uint32_t drawBufferLength = lv_area_get_size(draw_ctx->buf_area) * sizeof(lv_color_t); + //LV_ASSERT_MSG(drawBufferLength % CACHE_ROW_SIZE == 0); // critical, but this is not the way to test it + //LV_ASSERT_MSG((uint32_t)draw_ctx->buf % CACHE_ROW_SIZE == 0, "draw_ctx.buf is not 32B aligned"); // critical? + // FIXME: + // 1. Both src_buf and dest_buf pixel size *must* be known to use DMA2D. + // 2. Verify both buffers start addresses and lengths are 32-byte (cache row size) aligned. + LV_UNUSED(draw_ctx); + lv_point_t src_offset = lv_area_get_offset(src_area, dest_area); + // FIXME: use lv_area_move(dest_area, -dest_area->x1, -dest_area->y1) here ? + // TODO: It is assumed that dest_buf and src_buf buffers are of lv_color_t type. Verify it, this assumption may be incorrect. + _lv_draw_stm32_dma2d_blend_map((const lv_color_t *)dest_buf, dest_stride, dest_area, (const lv_color_t *)src_buf, + src_stride, &src_offset, 0xff, LvglColorFormat, true); + // TODO: Investigate if output buffer cache needs to be invalidated. It depends on what the destination buffer is and how it is used next - by dma2d or not. + _lv_gpu_stm32_dma2d_await_dma_transfer_finish(NULL); // TODO: is this line needed here? +} + +static void lv_draw_stm32_dma2d_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * img_dsc, + const lv_area_t * coords, const uint8_t * src_buf, lv_img_cf_t color_format) +{ + if(draw_ctx->draw_img_decoded == NULL) return; + lv_area_t draw_area; + lv_area_copy(&draw_area, draw_ctx->clip_area); + + bool mask_any = lv_draw_mask_is_any(&draw_area); + bool transform = img_dsc->angle != 0 || img_dsc->zoom != LV_IMG_ZOOM_NONE; + const dma2d_color_format_t bitmapColorFormat = lv_color_format_to_dma2d_color_format(color_format); + const bool ignoreBitmapAlpha = (color_format == LV_IMG_CF_RGBX8888); + + if(!mask_any && !transform && bitmapColorFormat != UNSUPPORTED && img_dsc->recolor_opa == LV_OPA_TRANSP) { + // simple bitmap blending, optionally with supported color format conversion - handle directly by dma2d + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); + lv_coord_t src_stride = lv_area_get_width(coords); + lv_point_t src_offset = lv_area_get_offset(coords, &draw_area); // source image offset in relation to draw_area + lv_area_move(&draw_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + _lv_draw_stm32_dma2d_blend_map(draw_ctx->buf, dest_stride, &draw_area, src_buf, src_stride, &src_offset, + img_dsc->opa, bitmapColorFormat, ignoreBitmapAlpha); + } + else { + // all more complex cases which require additional image transformations + lv_draw_sw_img_decoded(draw_ctx, img_dsc, coords, src_buf, color_format); + + } +} + +static lv_point_t lv_area_get_offset(const lv_area_t * area1, const lv_area_t * area2) +{ + lv_point_t offset = {x: area2->x1 - area1->x1, y: area2->y1 - area1->y1}; + return offset; +} + +static dma2d_color_format_t lv_color_format_to_dma2d_color_format(lv_img_cf_t color_format) +{ + switch(color_format) { + case LV_IMG_CF_RGBA8888: + // note: LV_IMG_CF_RGBA8888 is actually ARGB8888 + return ARGB8888; + case LV_IMG_CF_RGBX8888: + // note: LV_IMG_CF_RGBX8888 is actually XRGB8888 + return ARGB8888; + case LV_IMG_CF_RGB565: + return RGB565; + case LV_IMG_CF_TRUE_COLOR: + return LvglColorFormat; + case LV_IMG_CF_TRUE_COLOR_ALPHA: +#if LV_COLOR_DEPTH == 16 + // bitmap color format is 24b ARGB8565 - dma2d unsupported + return UNSUPPORTED; +#elif LV_COLOR_DEPTH == 32 + return ARGB8888; +#else + // unknown bitmap color format + return UNSUPPORTED; +#endif + default: + return UNSUPPORTED; + } +} + +LV_STM32_DMA2D_STATIC lv_res_t lv_draw_stm32_dma2d_img(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * img_dsc, + const lv_area_t * src_area, const void * src) +{ + //if(lv_img_src_get_type(src) != LV_IMG_SRC_VARIABLE) return LV_RES_INV; + return LV_RES_INV; + if(img_dsc->opa <= LV_OPA_MIN) return LV_RES_OK; + const lv_img_dsc_t * img = src; + const dma2d_color_format_t bitmapColorFormat = lv_color_format_to_dma2d_color_format(img->header.cf); + const bool ignoreBitmapAlpha = (img->header.cf == LV_IMG_CF_RGBX8888); + + if(bitmapColorFormat == UNSUPPORTED || img_dsc->angle != 0 || img_dsc->zoom != LV_IMG_ZOOM_NONE) { + return LV_RES_INV; // sorry, dma2d can handle this + } + + // FIXME: handle dsc.pivot, dsc.recolor, dsc.blend_mode + // FIXME: src pixel size *must* be known to use DMA2D + // FIXME: If image is drawn by SW, then output cache needs to be cleaned next. Currently it is not possible. + // Both draw buffer start address and buffer size *must* be 32-byte aligned since draw buffer cache is being invalidated. + //uint32_t drawBufferLength = lv_area_get_size(draw_ctx->buf_area) * sizeof(lv_color_t); + //LV_ASSERT_MSG(drawBufferLength % CACHE_ROW_SIZE == 0); // critical, but this is not the way to test it + //LV_ASSERT_MSG((uint32_t)draw_ctx->buf % CACHE_ROW_SIZE == 0, "draw_ctx.buf is not 32B aligned"); // critical? + + // For performance reasons, both source buffer start address and buffer size *should* be 32-byte aligned since source buffer cache is being cleaned. + //uint32_t srcBufferLength = lv_area_get_size(src_area) * sizeof(lv_color_t); // TODO: verify src pixel size = sizeof(lv_color_t) + //LV_ASSERT_MSG(srcBufferLength % CACHE_ROW_SIZE == 0); // FIXME: assert fails (performance, non-critical) + //LV_ASSERT_MSG((uint32_t)src % CACHE_ROW_SIZE == 0); // FIXME: assert fails (performance, non-critical) + + lv_area_t draw_area; + if(!_lv_area_intersect(&draw_area, src_area, draw_ctx->clip_area)) return LV_RES_OK; + + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); + lv_point_t src_offset = lv_area_get_offset(src_area, &draw_area); // source image offset in relation to draw_area + lv_area_move(&draw_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + _lv_draw_stm32_dma2d_blend_map(draw_ctx->buf, dest_stride, &draw_area, img->data, img->header.w, + &src_offset, img_dsc->opa, bitmapColorFormat, ignoreBitmapAlpha); + return LV_RES_OK; +} + +LV_STM32_DMA2D_STATIC void lv_gpu_stm32_dma2d_wait_cb(lv_draw_ctx_t * draw_ctx) +{ + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + _lv_gpu_stm32_dma2d_await_dma_transfer_finish(disp->driver); + lv_draw_sw_wait_for_finish(draw_ctx); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +/** + * @brief Fills draw_area with specified color. + * @param color color to be painted, note: alpha is ignored + */ +LV_STM32_DMA2D_STATIC void _lv_draw_stm32_dma2d_blend_fill(const lv_color_t * dest_buf, lv_coord_t dest_stride, + const lv_area_t * draw_area, lv_color_t color, lv_opa_t opa) +{ + LV_ASSERT_MSG(!isDma2dInProgess, "dma2d transfer has not finished"); // critical + lv_coord_t draw_width = lv_area_get_width(draw_area); + lv_coord_t draw_height = lv_area_get_height(draw_area); + + _lv_gpu_stm32_dma2d_await_dma_transfer_finish(NULL); + + if(opa >= LV_OPA_MAX) { + DMA2D->CR = 0x3UL << DMA2D_CR_MODE_Pos; // Register-to-memory (no FG nor BG, only output stage active) + + DMA2D->OPFCCR = LvglColorFormat; +#if defined(DMA2D_OPFCCR_RBS_Pos) + DMA2D->OPFCCR |= (RBS_BIT << DMA2D_OPFCCR_RBS_Pos); +#endif + DMA2D->OMAR = (uint32_t)(dest_buf + (dest_stride * draw_area->y1) + draw_area->x1); + DMA2D->OOR = dest_stride - draw_width; // out buffer offset + // Note: unlike FGCOLR and BGCOLR, OCOLR bits must match DMA2D_OUTPUT_COLOR, alpha can be specified +#if RBS_BIT + // swap red/blue bits + DMA2D->OCOLR = (color.ch.blue << 11) | (color.ch.green_l << 5 | color.ch.green_h << 8) | (color.ch.red); +#else + DMA2D->OCOLR = color.full; +#endif + } + else { + DMA2D->CR = 0x2UL << DMA2D_CR_MODE_Pos; // Memory-to-memory with blending (FG and BG fetch with PFC and blending) + + DMA2D->FGPFCCR = A8; + DMA2D->FGPFCCR |= (opa << DMA2D_FGPFCCR_ALPHA_Pos); + // Alpha Mode 1: Replace original foreground image alpha channel value by FGPFCCR.ALPHA + DMA2D->FGPFCCR |= (0x1UL << DMA2D_FGPFCCR_AM_Pos); + //DMA2D->FGPFCCR |= (RBS_BIT << DMA2D_FGPFCCR_RBS_Pos); + + // Note: in Alpha Mode 1 FGMAR and FGOR are not used to supply foreground A8 bytes, + // those bytes are replaced by constant ALPHA defined in FGPFCCR + DMA2D->FGMAR = (uint32_t)dest_buf; + DMA2D->FGOR = dest_stride; + DMA2D->FGCOLR = lv_color_to32(color) & 0x00ffffff; // swap FGCOLR R/B bits if FGPFCCR.RBS (RBS_BIT) bit is set + + DMA2D->BGPFCCR = LvglColorFormat; +#if defined(DMA2D_BGPFCCR_RBS_Pos) + DMA2D->BGPFCCR |= (RBS_BIT << DMA2D_BGPFCCR_RBS_Pos); +#endif + DMA2D->BGMAR = (uint32_t)(dest_buf + (dest_stride * draw_area->y1) + draw_area->x1); + DMA2D->BGOR = dest_stride - draw_width; + DMA2D->BGCOLR = 0; // used in A4 and A8 modes only + __lv_gpu_stm32_dma2d_clean_cache(DMA2D->BGMAR, DMA2D->BGOR, draw_width, draw_height, sizeof(lv_color_t)); + + DMA2D->OPFCCR = LvglColorFormat; +#if defined(DMA2D_OPFCCR_RBS_Pos) + DMA2D->OPFCCR |= (RBS_BIT << DMA2D_OPFCCR_RBS_Pos); +#endif + DMA2D->OMAR = DMA2D->BGMAR; + DMA2D->OOR = DMA2D->BGOR; + DMA2D->OCOLR = 0; + } + // PL - pixel per lines (14 bit), NL - number of lines (16 bit) + DMA2D->NLR = (draw_width << DMA2D_NLR_PL_Pos) | (draw_height << DMA2D_NLR_NL_Pos); + + _lv_gpu_stm32_dma2d_start_dma_transfer(); +} + +/** + * @brief Draws src (foreground) map on dst (background) map. + * @param src_offset src offset in relation to dst, useful when src is larger than draw_area + * @param opa constant opacity to be applied + * @param bitmapColorCode bitmap color type + * @param ignoreAlpha if TRUE, bitmap src alpha channel is ignored + */ +LV_STM32_DMA2D_STATIC void _lv_draw_stm32_dma2d_blend_map(const lv_color_t * dest_buf, lv_coord_t dest_stride, + const lv_area_t * draw_area, const void * src_buf, lv_coord_t src_stride, const lv_point_t * src_offset, lv_opa_t opa, + dma2d_color_format_t src_color_format, bool ignore_src_alpha) +{ + LV_ASSERT_MSG(!isDma2dInProgess, "dma2d transfer has not finished"); // critical + if(opa <= LV_OPA_MIN || src_color_format == UNSUPPORTED) return; + lv_coord_t draw_width = lv_area_get_width(draw_area); + lv_coord_t draw_height = lv_area_get_height(draw_area); + bool bitmapHasOpacity = !ignore_src_alpha && (src_color_format == ARGB8888 || src_color_format == ARGB1555 || + src_color_format == ARGB4444); + + if(opa >= LV_OPA_MAX) opa = 0xff; + + uint8_t srcBpp; // source bytes per pixel + switch(src_color_format) { + case ARGB8888: + srcBpp = 4; + break; + case RGB888: + srcBpp = 3; + break; + case RGB565: + case ARGB1555: + case ARGB4444: + srcBpp = 2; + break; + default: + LV_LOG_ERROR("unsupported color format"); + return; + } + + _lv_gpu_stm32_dma2d_await_dma_transfer_finish(NULL); + + DMA2D->FGPFCCR = src_color_format; + + if(opa == 0xff && !bitmapHasOpacity) { + // no need to blend + if(src_color_format == LvglColorFormat) { + // no need to convert pixel format (PFC) either + DMA2D->CR = 0x0UL; + } + else { + DMA2D->CR = 0x1UL << DMA2D_CR_MODE_Pos; // Memory-to-memory with PFC (FG fetch only with FG PFC active) + } + // Alpha Mode 0: No modification of the foreground image alpha channel value + } + else { + // blend + DMA2D->CR = 0x2UL << DMA2D_CR_MODE_Pos; // Memory-to-memory with blending (FG and BG fetch with PFC and blending) + DMA2D->FGPFCCR |= (opa << DMA2D_FGPFCCR_ALPHA_Pos); + if(bitmapHasOpacity) { + // Alpha Mode 2: Replace original foreground image alpha channel value by FGPFCCR.ALPHA multiplied with original alpha channel value + DMA2D->FGPFCCR |= (0x2UL << DMA2D_FGPFCCR_AM_Pos); + } + else { + // Alpha Mode 1: Replace original foreground image alpha channel value by FGPFCCR.ALPHA + DMA2D->FGPFCCR |= (0x1UL << DMA2D_FGPFCCR_AM_Pos); + } + } +#if defined(DMA2D_FGPFCCR_RBS_Pos) + DMA2D->FGPFCCR |= (RBS_BIT << DMA2D_FGPFCCR_RBS_Pos); +#endif + DMA2D->FGMAR = ((uint32_t)src_buf) + srcBpp * ((src_stride * src_offset->y) + src_offset->x); + DMA2D->FGOR = src_stride - draw_width; + DMA2D->FGCOLR = 0; // used in A4 and A8 modes only + __lv_gpu_stm32_dma2d_clean_cache(DMA2D->FGMAR, DMA2D->FGOR, draw_width, draw_height, srcBpp); + + DMA2D->OPFCCR = LvglColorFormat; +#if defined(DMA2D_OPFCCR_RBS_Pos) + DMA2D->OPFCCR |= (RBS_BIT << DMA2D_OPFCCR_RBS_Pos); +#endif + DMA2D->OMAR = (uint32_t)(dest_buf + (dest_stride * draw_area->y1) + draw_area->x1); + DMA2D->OOR = dest_stride - draw_width; + DMA2D->OCOLR = 0; + + if(opa != 0xff || bitmapHasOpacity) { + // use background (BG*) registers + DMA2D->BGPFCCR = LvglColorFormat; +#if defined(DMA2D_BGPFCCR_RBS_Pos) + DMA2D->BGPFCCR |= (RBS_BIT << DMA2D_BGPFCCR_RBS_Pos); +#endif + DMA2D->BGMAR = DMA2D->OMAR; + DMA2D->BGOR = DMA2D->OOR; + DMA2D->BGCOLR = 0; // used in A4 and A8 modes only + __lv_gpu_stm32_dma2d_clean_cache(DMA2D->BGMAR, DMA2D->BGOR, draw_width, draw_height, sizeof(lv_color_t)); + } + + // PL - pixel per lines (14 bit), NL - number of lines (16 bit) + DMA2D->NLR = (draw_width << DMA2D_NLR_PL_Pos) | (draw_height << DMA2D_NLR_NL_Pos); + + _lv_gpu_stm32_dma2d_start_dma_transfer(); +} + +/** + * @brief Paints solid color with alpha mask with additional constant opacity. Useful e.g. for painting anti-aliased fonts. + * @param src_offset src offset in relation to dst, useful when src (alpha mask) is larger than draw_area + * @param color color to paint, note: alpha is ignored + * @param opa constant opacity to be applied + */ +LV_STM32_DMA2D_STATIC void _lv_draw_stm32_dma2d_blend_paint(const lv_color_t * dest_buf, lv_coord_t dest_stride, + const lv_area_t * draw_area, const lv_opa_t * mask_buf, lv_coord_t mask_stride, const lv_point_t * mask_offset, + lv_color_t color, lv_opa_t opa) +{ + LV_ASSERT_MSG(!isDma2dInProgess, "dma2d transfer has not finished"); // critical + lv_coord_t draw_width = lv_area_get_width(draw_area); + lv_coord_t draw_height = lv_area_get_height(draw_area); + + _lv_gpu_stm32_dma2d_await_dma_transfer_finish(NULL); + + DMA2D->CR = 0x2UL << DMA2D_CR_MODE_Pos; // Memory-to-memory with blending (FG and BG fetch with PFC and blending) + + DMA2D->FGPFCCR = A8; + if(opa < LV_OPA_MAX) { + DMA2D->FGPFCCR |= (opa << DMA2D_FGPFCCR_ALPHA_Pos); + DMA2D->FGPFCCR |= (0x2UL << + DMA2D_FGPFCCR_AM_Pos); // Alpha Mode: Replace original foreground image alpha channel value by FGPFCCR.ALPHA multiplied with original alpha channel value + } + //DMA2D->FGPFCCR |= (RBS_BIT << DMA2D_FGPFCCR_RBS_Pos); + DMA2D->FGMAR = (uint32_t)(mask_buf + (mask_stride * mask_offset->y) + mask_offset->x); + DMA2D->FGOR = mask_stride - draw_width; + DMA2D->FGCOLR = lv_color_to32(color) & 0x00ffffff; // swap FGCOLR R/B bits if FGPFCCR.RBS (RBS_BIT) bit is set + __lv_gpu_stm32_dma2d_clean_cache(DMA2D->FGMAR, DMA2D->FGOR, draw_width, draw_height, sizeof(lv_opa_t)); + + DMA2D->BGPFCCR = LvglColorFormat; +#if defined(DMA2D_BGPFCCR_RBS_Pos) + DMA2D->BGPFCCR |= (RBS_BIT << DMA2D_BGPFCCR_RBS_Pos); +#endif + DMA2D->BGMAR = (uint32_t)(dest_buf + (dest_stride * draw_area->y1) + draw_area->x1); + DMA2D->BGOR = dest_stride - draw_width; + DMA2D->BGCOLR = 0; // used in A4 and A8 modes only + __lv_gpu_stm32_dma2d_clean_cache(DMA2D->BGMAR, DMA2D->BGOR, draw_width, draw_height, sizeof(lv_color_t)); + + DMA2D->OPFCCR = LvglColorFormat; +#if defined(DMA2D_OPFCCR_RBS_Pos) + DMA2D->OPFCCR |= (RBS_BIT << DMA2D_OPFCCR_RBS_Pos); +#endif + DMA2D->OMAR = DMA2D->BGMAR; + DMA2D->OOR = DMA2D->BGOR; + DMA2D->OCOLR = 0; + // PL - pixel per lines (14 bit), NL - number of lines (16 bit) + DMA2D->NLR = (draw_width << DMA2D_NLR_PL_Pos) | (draw_height << DMA2D_NLR_NL_Pos); + + _lv_gpu_stm32_dma2d_start_dma_transfer(); +} + +/** + * @brief Copies src (foreground) map to the dst (background) map. + * @param src_offset src offset in relation to dst, useful when src is larger than draw_area + */ +LV_STM32_DMA2D_STATIC void _lv_draw_stm32_dma2d_copy_buffer(const lv_color_t * dest_buf, lv_coord_t dest_stride, + const lv_area_t * draw_area, const lv_color_t * src_buf, lv_coord_t src_stride, const lv_point_t * src_offset) +{ + LV_ASSERT_MSG(!isDma2dInProgess, "dma2d transfer has not finished"); // critical + lv_coord_t draw_width = lv_area_get_width(draw_area); + lv_coord_t draw_height = lv_area_get_height(draw_area); + + _lv_gpu_stm32_dma2d_await_dma_transfer_finish(NULL); + + DMA2D->CR = 0x0UL; // Memory-to-memory (FG fetch only) + + DMA2D->FGPFCCR = LvglColorFormat; +#if defined(DMA2D_FGPFCCR_RBS_Pos) + DMA2D->FGPFCCR |= (RBS_BIT << DMA2D_FGPFCCR_RBS_Pos); +#endif + DMA2D->FGMAR = (uint32_t)(src_buf + (src_stride * src_offset->y) + src_offset->x); + DMA2D->FGOR = src_stride - draw_width; + DMA2D->FGCOLR = 0; // used in A4 and A8 modes only + __lv_gpu_stm32_dma2d_clean_cache(DMA2D->FGMAR, DMA2D->FGOR, draw_width, draw_height, sizeof(lv_color_t)); + + // Note BG* registers do not need to be set up since BG is not used + + DMA2D->OPFCCR = LvglColorFormat; +#if defined(DMA2D_OPFCCR_RBS_Pos) + DMA2D->OPFCCR |= (RBS_BIT << DMA2D_OPFCCR_RBS_Pos); +#endif + DMA2D->OMAR = (uint32_t)(dest_buf + (dest_stride * draw_area->y1) + draw_area->x1); + DMA2D->OOR = dest_stride - draw_width; + DMA2D->OCOLR = 0; + + // PL - pixel per lines (14 bit), NL - number of lines (16 bit) + DMA2D->NLR = (draw_width << DMA2D_NLR_PL_Pos) | (draw_height << DMA2D_NLR_NL_Pos); + + _lv_gpu_stm32_dma2d_start_dma_transfer(); +} + +LV_STM32_DMA2D_STATIC void _lv_gpu_stm32_dma2d_start_dma_transfer(void) +{ + LV_ASSERT_MSG(!isDma2dInProgess, "dma2d transfer has not finished"); + isDma2dInProgess = true; + DMA2D->IFCR = 0x3FU; // trigger ISR flags reset + // Note: cleaning output buffer cache is needed only when buffer may be misaligned or adjacent area may have been drawn in sw-fashion, e.g. using lv_draw_sw_blend_basic() +#if LV_COLOR_DEPTH == 16 + __lv_gpu_stm32_dma2d_clean_cache(DMA2D->OMAR, DMA2D->OOR, (DMA2D->NLR & DMA2D_NLR_PL_Msk) >> DMA2D_NLR_PL_Pos, + (DMA2D->NLR & DMA2D_NLR_NL_Msk) >> DMA2D_NLR_NL_Pos, sizeof(lv_color_t)); +#endif + DMA2D->CR |= DMA2D_CR_START; + // Note: for some reason mask buffer gets damaged during transfer if waiting is postponed + _lv_gpu_stm32_dma2d_await_dma_transfer_finish(NULL); // FIXME: this line should not be needed here, but it is +} + +LV_STM32_DMA2D_STATIC void _lv_gpu_stm32_dma2d_await_dma_transfer_finish(lv_disp_drv_t * disp_drv) +{ + if(disp_drv && disp_drv->wait_cb) { + while((DMA2D->CR & DMA2D_CR_START) != 0U) { + disp_drv->wait_cb(disp_drv); + } + } + else { + while((DMA2D->CR & DMA2D_CR_START) != 0U); + } + + __IO uint32_t isrFlags = DMA2D->ISR; + + if(isrFlags & DMA2D_ISR_CEIF) { + LV_LOG_ERROR("DMA2D config error"); + } + + if(isrFlags & DMA2D_ISR_TEIF) { + LV_LOG_ERROR("DMA2D transfer error"); + } + + DMA2D->IFCR = 0x3FU; // trigger ISR flags reset + + if(isDma2dInProgess) { + // invalidate output buffer cached memory ONLY after DMA2D transfer + //__lv_gpu_stm32_dma2d_invalidate_cache(DMA2D->OMAR, DMA2D->OOR, (DMA2D->NLR & DMA2D_NLR_PL_Msk) >> DMA2D_NLR_PL_Pos, (DMA2D->NLR & DMA2D_NLR_NL_Msk) >> DMA2D_NLR_NL_Pos, sizeof(lv_color_t)); + isDma2dInProgess = false; + } +} + +#if defined (LV_STM32_DMA2D_USE_M7_CACHE) +// Cortex-M7 DCache present +LV_STM32_DMA2D_STATIC void _lv_gpu_stm32_dma2d_invalidate_cache(uint32_t address, lv_coord_t offset, lv_coord_t width, + lv_coord_t height, uint8_t pixel_size) +{ + if(((SCB->CCR) & SCB_CCR_DC_Msk) == 0) return; // L1 data cache is disabled + uint16_t stride = pixel_size * (width + offset); // in bytes + uint16_t ll = pixel_size * width; // line length in bytes + uint32_t n = 0; // address of the next cache row after the last invalidated row + lv_coord_t h = 0; + + __DSB(); + + while(h < height) { + uint32_t a = address + (h * stride); + uint32_t e = a + ll; // end address, address of the first byte after the current line + a &= ~(CACHE_ROW_SIZE - 1U); + if(a < n) a = n; // prevent the previous last cache row from being invalidated again + + while(a < e) { + SCB->DCIMVAC = a; + a += CACHE_ROW_SIZE; + } + + n = a; + h++; + }; + + __DSB(); + __ISB(); +} + +LV_STM32_DMA2D_STATIC void _lv_gpu_stm32_dma2d_clean_cache(uint32_t address, lv_coord_t offset, lv_coord_t width, + lv_coord_t height, uint8_t pixel_size) +{ + if(((SCB->CCR) & SCB_CCR_DC_Msk) == 0) return; // L1 data cache is disabled + uint16_t stride = pixel_size * (width + offset); // in bytes + uint16_t ll = pixel_size * width; // line length in bytes + uint32_t n = 0; // address of the next cache row after the last cleaned row + lv_coord_t h = 0; + __DSB(); + + while(h < height) { + uint32_t a = address + (h * stride); + uint32_t e = a + ll; // end address, address of the first byte after the current line + a &= ~(CACHE_ROW_SIZE - 1U); + if(a < n) a = n; // prevent the previous last cache row from being cleaned again + + while(a < e) { + SCB->DCCMVAC = a; + a += CACHE_ROW_SIZE; + } + + n = a; + h++; + }; + + __DSB(); + __ISB(); +} +#endif // LV_STM32_DMA2D_USE_M7_CACHE + +#if defined(LV_STM32_DMA2D_TEST) +// initialize µs timer +LV_STM32_DMA2D_STATIC bool _lv_gpu_stm32_dwt_init(void) +{ + // disable TRC + CoreDebug->DEMCR &= ~CoreDebug_DEMCR_TRCENA_Msk; + // enable TRC + CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; + +#if defined(__CORTEX_M) && (__CORTEX_M == 7U) + DWT->LAR = 0xC5ACCE55; +#endif + // disable clock cycle counter + DWT->CTRL &= ~DWT_CTRL_CYCCNTENA_Msk; + // enable clock cycle counter + DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; + + // reset the clock cycle counter value + DWT->CYCCNT = 0; + + // 3 NO OPERATION instructions + __ASM volatile("NOP"); + __ASM volatile("NOP"); + __ASM volatile("NOP"); + + // check if clock cycle counter has started + if(DWT->CYCCNT) { + return true; // clock cycle counter started + } + else { + return false; // clock cycle counter not started + } +} + +// get elapsed µs since reset +LV_STM32_DMA2D_STATIC uint32_t _lv_gpu_stm32_dwt_get_us(void) +{ + uint32_t us = (DWT->CYCCNT * 1000000) / HAL_RCC_GetHCLKFreq(); + return us; +} + +// reset µs timer +LV_STM32_DMA2D_STATIC void _lv_gpu_stm32_dwt_reset(void) +{ + DWT->CYCCNT = 0; +} +#endif // LV_STM32_DMA2D_TEST +#endif // LV_USE_GPU_STM32_DMA2D \ No newline at end of file diff --git a/L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.h b/L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.h new file mode 100644 index 0000000..0a97042 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.h @@ -0,0 +1,67 @@ +/** + * @file lv_gpu_stm32_dma2d.h + * + */ + +#ifndef LV_GPU_STM32_DMA2D_H +#define LV_GPU_STM32_DMA2D_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "../../misc/lv_color.h" +#include "../../hal/lv_hal_disp.h" +#include "../sw/lv_draw_sw.h" + +#if LV_USE_GPU_STM32_DMA2D + +/********************* + * INCLUDES + *********************/ +#include LV_GPU_DMA2D_CMSIS_INCLUDE + +/********************* + * DEFINES + *********************/ +#if defined(LV_STM32_DMA2D_TEST) +// removes "static" modifier for some internal methods in order to test them +#define LV_STM32_DMA2D_STATIC +#else +#define LV_STM32_DMA2D_STATIC static +#endif + +/********************** + * TYPEDEFS + **********************/ +enum dma2d_color_format { + ARGB8888 = 0x0, + RGB888 = 0x01, + RGB565 = 0x02, + ARGB1555 = 0x03, + ARGB4444 = 0x04, + A8 = 0x09, + UNSUPPORTED = 0xff, +}; +typedef enum dma2d_color_format dma2d_color_format_t; +typedef lv_draw_sw_ctx_t lv_draw_stm32_dma2d_ctx_t; +struct _lv_disp_drv_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ +void lv_draw_stm32_dma2d_init(void); +void lv_draw_stm32_dma2d_ctx_init(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); +void lv_draw_stm32_dma2d_ctx_deinit(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_STM32_DMA2D*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_GPU_STM32_DMA2D_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/arm2d/lv_draw_sw_arm2d.h b/L3_Middlewares/LVGL/src/draw/sw/arm2d/lv_draw_sw_arm2d.h deleted file mode 100644 index 77c6cc4..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/arm2d/lv_draw_sw_arm2d.h +++ /dev/null @@ -1,589 +0,0 @@ -/** - * @file lv_draw_sw_arm2d.h - * - */ - -#ifndef LV_DRAW_SW_ARM2D_H -#define LV_DRAW_SW_ARM2D_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* *INDENT-OFF* */ - -/********************* - * INCLUDES - *********************/ - -#include "../../../lv_conf_internal.h" -#include "../../../misc/lv_area_private.h" - -#if LV_USE_DRAW_ARM2D_SYNC - -#define __ARM_2D_IMPL__ -#include "arm_2d.h" -#include "__arm_2d_impl.h" - -#if 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 - -/********************* - * DEFINES - *********************/ -#ifndef LV_DRAW_SW_RGB565_SWAP - #define LV_DRAW_SW_RGB565_SWAP(__buf_ptr, __buf_size_px) \ - lv_draw_sw_rgb565_swap_helium((__buf_ptr), (__buf_size_px)) -#endif - -#ifndef LV_DRAW_SW_IMAGE - #define LV_DRAW_SW_IMAGE(__transformed, \ - __cf, \ - __src_buf, \ - __img_coords, \ - __src_stride, \ - __blend_area, \ - __draw_unit, \ - __draw_dsc) \ - lv_draw_sw_image_helium( (__transformed), \ - (__cf), \ - (uint8_t *)(__src_buf), \ - (__img_coords), \ - (__src_stride), \ - (__blend_area), \ - (__draw_unit), \ - (__draw_dsc)) -#endif - -#ifndef LV_DRAW_SW_RGB565_RECOLOR - #define LV_DRAW_SW_RGB565_RECOLOR(__src_buf, __blend_area, __color, __opa) \ - lv_draw_sw_image_recolor_rgb565( (__src_buf), \ - &(__blend_area), \ - (__color), \ - (__opa)) -#endif - -#ifndef LV_DRAW_SW_RGB888_RECOLOR - #define LV_DRAW_SW_RGB888_RECOLOR( __src_buf, \ - __blend_area, \ - __color, \ - __opa, \ - __cf) \ - lv_draw_sw_image_recolor_rgb888( (__src_buf), \ - &(__blend_area), \ - (__color), \ - (__opa), \ - (__cf)) -#endif - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ -extern void arm_2d_helper_swap_rgb16(uint16_t * phwBuffer, uint32_t wCount); - -/********************** - * MACROS - **********************/ - -#define __RECOLOUR_BEGIN() \ - do { \ - lv_color_t *rgb_tmp_buf = NULL; \ - if(draw_dsc->recolor_opa > LV_OPA_MIN) { \ - if(LV_COLOR_FORMAT_RGB565 == des_cf) { \ - rgb_tmp_buf \ - = lv_malloc(src_w * src_h * sizeof(uint16_t)); \ - if (NULL == rgb_tmp_buf) { \ - LV_LOG_WARN( \ - "Failed to allocate memory for accelerating recolor, " \ - "use normal route instead."); \ - break; \ - } \ - lv_memcpy( rgb_tmp_buf, \ - src_buf, \ - src_w * src_h * sizeof(uint16_t)); \ - arm_2d_size_t copy_size = { \ - .iWidth = src_w, \ - .iHeight = src_h, \ - }; \ - /* apply re-color */ \ - __arm_2d_impl_rgb565_colour_filling_with_opacity( \ - (uint16_t *)rgb_tmp_buf, \ - src_w, \ - ©_size, \ - lv_color_to_u16(draw_dsc->recolor), \ - draw_dsc->recolor_opa); \ - \ - /* replace src_buf for the following operation */ \ - src_buf = (const uint8_t *)rgb_tmp_buf; \ - } \ - else if(LV_COLOR_FORMAT_XRGB8888 == des_cf) { \ - rgb_tmp_buf \ - = lv_malloc(src_w * src_h * sizeof(uint32_t)); \ - if (NULL == rgb_tmp_buf) { \ - LV_LOG_WARN( \ - "Failed to allocate memory for accelerating recolor, " \ - "use normal route instead."); \ - break; \ - } \ - lv_memcpy( rgb_tmp_buf, \ - src_buf, \ - src_w * src_h * sizeof(uint32_t)); \ - arm_2d_size_t copy_size = { \ - .iWidth = src_w, \ - .iHeight = src_h, \ - }; \ - /* apply re-color */ \ - __arm_2d_impl_cccn888_colour_filling_with_opacity( \ - (uint32_t *)rgb_tmp_buf, \ - src_w, \ - ©_size, \ - lv_color_to_u32(draw_dsc->recolor), \ - draw_dsc->recolor_opa); \ - \ - /* replace src_buf for the following operation */ \ - src_buf = (const uint8_t *)rgb_tmp_buf; \ - } \ - } \ - do { - -#define __RECOLOUR_END() \ - } while(0); \ - if (NULL != rgb_tmp_buf) { \ - lv_free(rgb_tmp_buf); \ - } \ - } while(0); - -static inline lv_result_t lv_draw_sw_rgb565_swap_helium(void * buf, uint32_t buf_size_px) -{ - arm_2d_helper_swap_rgb16((uint16_t *)buf, buf_size_px); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_draw_sw_image_helium( - bool is_transform, - lv_color_format_t src_cf, - const uint8_t *src_buf, - const lv_area_t * coords, - int32_t src_stride, - const lv_area_t * des_area, - lv_draw_unit_t * draw_unit, - const lv_draw_image_dsc_t * draw_dsc) -{ - lv_result_t result = LV_RESULT_INVALID; - lv_layer_t * layer = draw_unit->target_layer; - lv_color_format_t des_cf = layer->color_format; - static bool arm_2d_initialized = false; - - if (!arm_2d_initialized) { - arm_2d_initialized = true; - arm_2d_init(); - } - - do { - if (!is_transform) { - break; - } - if(draw_dsc->scale_x != draw_dsc->scale_y) { - break; - } - /* filter the unsupported colour format combination */ - if((LV_COLOR_FORMAT_RGB565 == des_cf) - && !( (LV_COLOR_FORMAT_RGB565 == src_cf) - || (LV_COLOR_FORMAT_RGB565A8 == src_cf))) { - break; - } - #if 0 /* a temporary patch */ - if((LV_COLOR_FORMAT_XRGB8888 == des_cf) - && !( (LV_COLOR_FORMAT_ARGB8888 == src_cf) - || (LV_COLOR_FORMAT_XRGB8888 == src_cf))) { - break; - } - #else - if((LV_COLOR_FORMAT_XRGB8888 == des_cf) - || (LV_COLOR_FORMAT_RGB888 == des_cf) - || (LV_COLOR_FORMAT_ARGB8888 == des_cf)) { - break; - } - #endif - - /* ------------- prepare parameters for arm-2d APIs - BEGIN --------- */ - - lv_area_t blend_area; - if(!lv_area_intersect(&blend_area, des_area, draw_unit->clip_area)) { - break; - } - - int32_t src_w = lv_area_get_width(coords); - int32_t src_h = lv_area_get_height(coords); - - arm_2d_size_t src_size = { - .iWidth = (int16_t)src_w, - .iHeight = (int16_t)src_h, - }; - -// arm_2d_size_t des_size; - -// do{ -// int32_t des_w = lv_area_get_width(&blend_area); -// int32_t des_h = lv_area_get_height(&blend_area); - -// LV_ASSERT(des_w <= INT16_MAX); -// LV_ASSERT(des_h <= INT16_MAX); - -// des_size.iWidth = (int16_t)des_w; -// des_size.iHeight = (int16_t)des_h; -// } while(0); -// -// arm_2d_size_t copy_size = { -// .iWidth = MIN(des_size.iWidth, src_size.iWidth), -// .iHeight = MIN(des_size.iHeight, src_size.iHeight), -// }; -// -// int32_t des_stride = lv_draw_buf_width_to_stride( -// lv_area_get_width(&layer->buf_area), -// des_cf); -// uint8_t *des_buf_moved = (uint8_t *)lv_draw_layer_go_to_xy( -// layer, -// blend_area.x1 - layer->buf_area.x1, -// blend_area.y1 - layer->buf_area.y1); - uint8_t *des_buf = (uint8_t *)lv_draw_layer_go_to_xy(layer, 0, 0); - uint8_t opa = draw_dsc->opa; - - /* ------------- prepare parameters for arm-2d APIs - END ----------- */ - __RECOLOUR_BEGIN() - - static arm_2d_tile_t target_tile_origin; - static arm_2d_tile_t target_tile; - arm_2d_region_t clip_region; - static arm_2d_region_t target_region; - - target_region = (arm_2d_region_t) { - .tLocation = { - .iX = (int16_t)(coords->x1 - draw_unit->clip_area->x1), - .iY = (int16_t)(coords->y1 - draw_unit->clip_area->y1), - }, - .tSize = src_size, - }; - - target_tile_origin = (arm_2d_tile_t) { - .tRegion = { - .tSize = { - .iWidth = (int16_t)lv_area_get_width(&layer->buf_area), - .iHeight = (int16_t)lv_area_get_height(&layer->buf_area), - }, - }, - .tInfo = { - .bIsRoot = true, - }, - .phwBuffer = (uint16_t *)des_buf, - }; - - clip_region = (arm_2d_region_t) { - .tLocation = { - .iX = (int16_t)(draw_unit->clip_area->x1 - layer->buf_area.x1), - .iY = (int16_t)(draw_unit->clip_area->y1 - layer->buf_area.y1), - }, - .tSize = { - .iWidth = (int16_t)lv_area_get_width(draw_unit->clip_area), - .iHeight = (int16_t)lv_area_get_height(draw_unit->clip_area), - }, - }; - - arm_2d_tile_generate_child(&target_tile_origin, - &clip_region, - &target_tile, - false); - - static arm_2d_tile_t source_tile; - - source_tile = (arm_2d_tile_t) { - .tRegion = { - .tSize = { - .iWidth = (int16_t)src_w, - .iHeight = (int16_t)src_h, - }, - }, - .tInfo = { - .bIsRoot = true, - }, - .pchBuffer = (uint8_t *)src_buf, - }; - - static arm_2d_location_t source_center, target_center; - source_center.iX = draw_dsc->pivot.x; - source_center.iY = draw_dsc->pivot.y; - target_center = target_region.tLocation; - target_center.iX += draw_dsc->pivot.x; - target_center.iY += draw_dsc->pivot.y; - - if(LV_COLOR_FORMAT_A8 == src_cf) { - - source_tile.tInfo.bHasEnforcedColour = true; - source_tile.tInfo.tColourInfo.chScheme = ARM_2D_COLOUR_GRAY8; - - if(LV_COLOR_FORMAT_RGB565 == des_cf) { - - arm_2d_rgb565_fill_colour_with_mask_opacity_and_transform( - &source_tile, - &target_tile, - NULL, - source_center, - ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), - draw_dsc->scale_x / 256.0f, - lv_color_to_u16(draw_dsc->recolor), - opa, - &target_center - ); - - } - else if(LV_COLOR_FORMAT_XRGB8888 == des_cf) { - arm_2d_cccn888_fill_colour_with_mask_opacity_and_transform( - &source_tile, - &target_tile, - NULL, - source_center, - ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), - draw_dsc->scale_x / 256.0f, - lv_color_to_int(draw_dsc->recolor), - opa, - &target_center - ); - } - else { - break; - } - - } - else if(LV_COLOR_FORMAT_RGB565A8 == src_cf) { - LV_ASSERT(LV_COLOR_FORMAT_RGB565 == des_cf); - - /* mask_buf = src_buf + src_stride * src_w / header->w * src_h; */ - const uint8_t *mask_buf = src_buf + src_stride * src_h; - int32_t mask_stride = src_stride / 2; - - static arm_2d_tile_t mask_tile; - mask_tile = source_tile; - - mask_tile.tInfo.bHasEnforcedColour = true; - mask_tile.tInfo.tColourInfo.chScheme = ARM_2D_COLOUR_GRAY8; - mask_tile.pchBuffer = (uint8_t *)mask_buf; - - if(opa >= LV_OPA_MAX) { - arm_2d_rgb565_tile_transform_with_src_mask( - &source_tile, - &mask_tile, - &target_tile, - NULL, - source_center, - ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), - draw_dsc->scale_x / 256.0f, - &target_center - ); - } - else { - arm_2d_rgb565_tile_transform_with_src_mask_and_opacity( - &source_tile, - &mask_tile, - &target_tile, - NULL, - source_center, - ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), - draw_dsc->scale_x / 256.0f, - opa, - &target_center - ); - } - - } - else if(LV_COLOR_FORMAT_RGB565 == src_cf) { - LV_ASSERT(LV_COLOR_FORMAT_RGB565 == des_cf); - - if(opa >= LV_OPA_MAX) { - #if ARM_2D_VERSION >= 10106 - arm_2d_rgb565_tile_transform_only( - &source_tile, - &target_tile, - NULL, - source_center, - ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), - draw_dsc->scale_x / 256.0f, - &target_center); - #else - - arm_2dp_rgb565_tile_transform_only_prepare( - NULL, - &source_tile, - source_center, - ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), - (float)(draw_dsc->scale_x / 256.0f)); - - arm_2dp_tile_transform(NULL, - &target_tile, - NULL, - &target_center); - #endif - } - else { - arm_2d_rgb565_tile_transform_only_with_opacity( - &source_tile, - &target_tile, - NULL, - source_center, - ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), - draw_dsc->scale_x / 256.0f, - opa, - &target_center - ); - } - - } - #if 0 /* a temporary patch */ - else if(LV_COLOR_FORMAT_ARGB8888 == src_cf) { - LV_ASSERT(LV_COLOR_FORMAT_XRGB8888 == des_cf); - - static arm_2d_tile_t mask_tile; - mask_tile = source_tile; - - mask_tile.tInfo.bHasEnforcedColour = true; - mask_tile.tInfo.tColourInfo.chScheme = ARM_2D_CHANNEL_8in32; - mask_tile.pchBuffer = (uint8_t *)src_buf + 3; - - if(opa >= LV_OPA_MAX) { - arm_2d_cccn888_tile_transform_with_src_mask( - &source_tile, - &mask_tile, - &target_tile, - NULL, - source_center, - ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), - draw_dsc->scale_x / 256.0f, - &target_center - ); - } - else { - arm_2d_cccn888_tile_transform_with_src_mask_and_opacity( - &source_tile, - &mask_tile, - &target_tile, - NULL, - source_center, - ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), - draw_dsc->scale_x / 256.0f, - opa, - &target_center - ); - } - - } - else if(LV_COLOR_FORMAT_XRGB8888 == src_cf) { - LV_ASSERT(LV_COLOR_FORMAT_XRGB8888 == des_cf); - - if(opa >= LV_OPA_MAX) { - arm_2d_cccn888_tile_transform_only( - &source_tile, - &target_tile, - NULL, - source_center, - ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), - draw_dsc->scale_x / 256.0f, - &target_center - ); - } - else { - arm_2d_cccn888_tile_transform_only_with_opacity( - &source_tile, - &target_tile, - NULL, - source_center, - ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), - draw_dsc->scale_x / 256.0f, - opa, - &target_center - ); - } - - } - #endif - else { - break; - } - - result = LV_RESULT_OK; - - __RECOLOUR_END() - } while(0); - - return result; -} - -static inline lv_result_t lv_draw_sw_image_recolor_rgb565( - const uint8_t *src_buf, - const lv_area_t * blend_area, - lv_color_t color, - lv_opa_t opa) -{ - int32_t src_w = lv_area_get_width(blend_area); - int32_t src_h = lv_area_get_height(blend_area); - - arm_2d_size_t copy_size = { - .iWidth = (int16_t)src_w, - .iHeight = (int16_t)src_h, - }; - - __arm_2d_impl_rgb565_colour_filling_with_opacity( - (uint16_t *)src_buf, - src_w, - ©_size, - lv_color_to_u16(color), - opa); - - return LV_RESULT_OK; -} - -static inline lv_result_t lv_draw_sw_image_recolor_rgb888( - const uint8_t *src_buf, - const lv_area_t * blend_area, - lv_color_t color, - lv_opa_t opa, - lv_color_format_t src_cf) -{ - if(LV_COLOR_FORMAT_XRGB8888 != src_cf) { - return LV_RESULT_INVALID; - } - - int32_t src_w = lv_area_get_width(blend_area); - int32_t src_h = lv_area_get_height(blend_area); - - arm_2d_size_t copy_size = { - .iWidth = (int16_t)src_w, - .iHeight = (int16_t)src_h, - }; - - __arm_2d_impl_cccn888_colour_filling_with_opacity( - (uint32_t *)src_buf, - src_w, - ©_size, - lv_color_to_u32(color), - opa); - - return LV_RESULT_OK; -} - -#endif /* LV_USE_DRAW_ARM2D_SYNC */ - -/* *INDENT-ON* */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_ARM2D_H */ diff --git a/L3_Middlewares/LVGL/src/draw/sw/arm2d/lv_draw_sw_helium.h b/L3_Middlewares/LVGL/src/draw/sw/arm2d/lv_draw_sw_helium.h deleted file mode 100644 index c35a06e..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/arm2d/lv_draw_sw_helium.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file lv_draw_sw_helium.h - * - */ - -#ifndef LV_DRAW_SW_HELIUM_H -#define LV_DRAW_SW_HELIUM_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* *INDENT-OFF* */ - -/********************* - * INCLUDES - *********************/ - -#include "../../../lv_conf_internal.h" - -/* detect whether helium is available based on arm compilers' standard */ -#if defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE - -#ifdef LV_DRAW_SW_HELIUM_CUSTOM_INCLUDE -#include LV_DRAW_SW_HELIUM_CUSTOM_INCLUDE -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************* - * POST INCLUDES - *********************/ -/* use arm-2d as the default helium acceleration */ -#include "lv_draw_sw_arm2d.h" - -#endif /* defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_HELIUM_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/arm2d/lv_blend_arm2d.h b/L3_Middlewares/LVGL/src/draw/sw/blend/arm2d/lv_blend_arm2d.h deleted file mode 100644 index 0eb29b8..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/arm2d/lv_blend_arm2d.h +++ /dev/null @@ -1,937 +0,0 @@ -/** - * @file lv_blend_arm2d.h - * - */ - -#ifndef LV_BLEND_ARM2D_H -#define LV_BLEND_ARM2D_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../../../lv_conf_internal.h" - -#if LV_USE_DRAW_ARM2D_SYNC - -#define __ARM_2D_IMPL__ -#include "arm_2d.h" -#include "__arm_2d_impl.h" - -#if 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 - - -#if ARM_2D_VERSION < 10106ul -#error Please upgrade to Arm-2D v1.1.6 or above -#endif - -#ifndef LV_ARM2D_XRGB888_ALPHA_ALWAYS_FF -#define LV_ARM2D_XRGB888_ALPHA_ALWAYS_FF 1 -#endif - -/********************* - * DEFINES - *********************/ - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565 -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565(dsc) \ - lv_color_blend_to_rgb565_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA(dsc) \ - lv_color_blend_to_rgb565_with_opa_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK(dsc) \ - lv_color_blend_to_rgb565_with_mask_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA(dsc) \ - lv_color_blend_to_rgb565_mix_mask_opa_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565 -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565(dsc) \ - lv_rgb565_blend_normal_to_rgb565_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc) \ - lv_rgb565_blend_normal_to_rgb565_with_opa_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc) \ - lv_rgb565_blend_normal_to_rgb565_with_mask_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc) \ - lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565 -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_arm2d(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_with_opa_arm2d(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_with_mask_arm2d(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_arm2d(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565 -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565(dsc) \ - lv_argb8888_blend_normal_to_rgb565_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc) \ - lv_argb8888_blend_normal_to_rgb565_with_opa_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc) \ - lv_argb8888_blend_normal_to_rgb565_with_mask_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc) \ - lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_arm2d(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888 -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_arm2d(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_with_opa_arm2d(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_with_mask_arm2d(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_mix_mask_opa_arm2d(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888 -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_arm2d(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_with_opa_arm2d(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_with_mask_arm2d(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_arm2d(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888 -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_arm2d(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_with_opa_arm2d(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_with_mask_arm2d(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_arm2d(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888 -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_arm2d(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_with_opa_arm2d(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_with_mask_arm2d(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_arm2d(dsc, dst_px_size) -#endif - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -static inline lv_result_t lv_color_blend_to_rgb565_arm2d(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t stride = (dsc->dest_stride) / sizeof(uint16_t); - __arm_2d_impl_rgb16_colour_filling((uint16_t *)dsc->dest_buf, - stride, - &draw_size, - lv_color_to_u16(dsc->color)); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_color_blend_to_rgb565_with_opa_arm2d(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t stride = (dsc->dest_stride) / sizeof(uint16_t); - __arm_2d_impl_rgb565_colour_filling_with_opacity((uint16_t *)dsc->dest_buf, - stride, - &draw_size, - lv_color_to_u16(dsc->color), - dsc->opa); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_color_blend_to_rgb565_with_mask_arm2d(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t stride = (dsc->dest_stride) / sizeof(uint16_t); - __arm_2d_impl_rgb565_colour_filling_mask((uint16_t *)dsc->dest_buf, - stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - lv_color_to_u16(dsc->color)); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_color_blend_to_rgb565_mix_mask_opa_arm2d(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t stride = (dsc->dest_stride) / sizeof(uint16_t); - __arm_2d_impl_rgb565_colour_filling_mask_opacity((uint16_t *)dsc->dest_buf, - stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - lv_color_to_u16(dsc->color), - dsc->opa); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_arm2d(lv_draw_sw_blend_image_dsc_t * dsc) -{ - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint16_t); - __arm_2d_impl_rgb16_copy((uint16_t *)dsc->src_buf, - src_stride, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_with_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc) -{ - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint16_t); - __arm_2d_impl_rgb565_tile_copy_opacity((uint16_t *)dsc->src_buf, - src_stride, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_with_mask_arm2d(lv_draw_sw_blend_image_dsc_t * dsc) -{ - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint16_t); - __arm_2d_impl_rgb565_src_msk_copy((uint16_t *)dsc->src_buf, - src_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc) -{ - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint16_t); - - __arm_2d_impl_rgb565_tile_copy_with_src_mask_and_opacity((uint16_t *)dsc->src_buf, - src_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - if(src_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_cccn888_to_rgb565((uint32_t *)dsc->src_buf, - src_stride, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size); - - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_with_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - if(src_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - uint16_t * tmp_buf = (uint16_t *)lv_malloc(dsc->dest_stride * dsc->dest_h); - if(NULL == tmp_buf) { - return LV_RESULT_INVALID; - } - -#if !LV_ARM2D_XRGB888_ALPHA_ALWAYS_FF - __arm_2d_impl_cccn888_to_rgb565((uint32_t *)dsc->src_buf, - src_stride, - (uint16_t *)tmp_buf, - des_stride, - &draw_size); - - __arm_2d_impl_rgb565_tile_copy_opacity(tmp_buf, - des_stride, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); -#else - __arm_2d_impl_ccca8888_tile_copy_to_rgb565_with_opacity((uint32_t *)dsc->src_buf, - src_stride, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); -#endif - lv_free(tmp_buf); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_with_mask_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - if(src_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - uint16_t * tmp_buf = (uint16_t *)lv_malloc(dsc->dest_stride * dsc->dest_h); - if(NULL == tmp_buf) { - return LV_RESULT_INVALID; - } - -#if !LV_ARM2D_XRGB888_ALPHA_ALWAYS_FF - __arm_2d_impl_cccn888_to_rgb565((uint32_t *)dsc->src_buf, - src_stride, - (uint16_t *)tmp_buf, - des_stride, - &draw_size); - - __arm_2d_impl_rgb565_src_msk_copy(tmp_buf, - des_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size); -#else - __arm_2d_impl_ccca8888_tile_copy_to_rgb565_with_src_mask((uint32_t *)dsc->src_buf, - src_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size); -#endif - - lv_free(tmp_buf); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - if(src_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - uint16_t * tmp_buf = (uint16_t *)lv_malloc(dsc->dest_stride * dsc->dest_h); - if(NULL == tmp_buf) { - return LV_RESULT_INVALID; - } - -#if !LV_ARM2D_XRGB888_ALPHA_ALWAYS_FF - __arm_2d_impl_cccn888_to_rgb565((uint32_t *)dsc->src_buf, - src_stride, - (uint16_t *)tmp_buf, - des_stride, - &draw_size); - - __arm_2d_impl_rgb565_tile_copy_with_src_mask_and_opacity(tmp_buf, - des_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); -#else - __arm_2d_impl_ccca8888_tile_copy_to_rgb565_with_src_mask_and_opacity((uint32_t *)dsc->src_buf, - src_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); -#endif - - lv_free(tmp_buf); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_arm2d(lv_draw_sw_blend_image_dsc_t * dsc) -{ - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_ccca8888_to_rgb565((uint32_t *)dsc->src_buf, - src_stride, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size); - - return LV_RESULT_OK; -} - -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_with_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc) -{ - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_ccca8888_tile_copy_to_rgb565_with_opacity((uint32_t *)dsc->src_buf, - src_stride, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); - - return LV_RESULT_OK; -} - -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_with_mask_arm2d(lv_draw_sw_blend_image_dsc_t * dsc) -{ - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_ccca8888_tile_copy_to_rgb565_with_src_mask((uint32_t *)dsc->src_buf, - src_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size); - - return LV_RESULT_OK; -} - -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc) -{ - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint16_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_ccca8888_tile_copy_to_rgb565_with_src_mask_and_opacity((uint32_t *)dsc->src_buf, - src_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint16_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); - - return LV_RESULT_OK; -} - -static inline lv_result_t lv_color_blend_to_rgb888_arm2d(lv_draw_sw_blend_fill_dsc_t * dsc, uint32_t dst_px_size) -{ - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t stride = (dsc->dest_stride) / sizeof(uint32_t); - __arm_2d_impl_rgb32_colour_filling((uint32_t *)dsc->dest_buf, - stride, - &draw_size, - lv_color_to_u32(dsc->color)); - return LV_RESULT_OK; - -} - -static inline lv_result_t lv_color_blend_to_rgb888_with_opa_arm2d(lv_draw_sw_blend_fill_dsc_t * dsc, - uint32_t dst_px_size) -{ - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t stride = (dsc->dest_stride) / sizeof(uint32_t); - __arm_2d_impl_cccn888_colour_filling_with_opacity((uint32_t *)dsc->dest_buf, - stride, - &draw_size, - lv_color_to_u32(dsc->color), - dsc->opa); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_color_blend_to_rgb888_with_mask_arm2d(lv_draw_sw_blend_fill_dsc_t * dsc, - uint32_t dst_px_size) -{ - - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t stride = (dsc->dest_stride) / sizeof(uint32_t); - __arm_2d_impl_cccn888_colour_filling_mask((uint32_t *)dsc->dest_buf, - stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - lv_color_to_u32(dsc->color)); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_color_blend_to_rgb888_mix_mask_opa_arm2d(lv_draw_sw_blend_fill_dsc_t * dsc, - uint32_t dst_px_size) -{ - - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t stride = (dsc->dest_stride) / sizeof(uint32_t); - __arm_2d_impl_cccn888_colour_filling_mask_opacity((uint32_t *)dsc->dest_buf, - stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - lv_color_to_u32(dsc->color), - dsc->opa); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint16_t); - - __arm_2d_impl_rgb565_to_cccn888((uint16_t *)dsc->src_buf, - src_stride, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size); - - return LV_RESULT_OK; - -} - -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_with_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint16_t); - - uint32_t * tmp_buf = (uint32_t *)lv_malloc(dsc->dest_stride * dsc->dest_h); - if(NULL == tmp_buf) { - return LV_RESULT_INVALID; - } - - /* get rgb565 */ - __arm_2d_impl_rgb565_to_cccn888((uint16_t *)dsc->src_buf, - src_stride, - (uint32_t *)tmp_buf, - des_stride, - &draw_size); - - __arm_2d_impl_cccn888_tile_copy_opacity(tmp_buf, - des_stride, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); - - lv_free(tmp_buf); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_with_mask_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint16_t); - - uint32_t * tmp_buf = (uint32_t *)lv_malloc(dsc->dest_stride * dsc->dest_h); - if(NULL == tmp_buf) { - return LV_RESULT_INVALID; - } - - __arm_2d_impl_rgb565_to_cccn888((uint16_t *)dsc->src_buf, - src_stride, - (uint32_t *)tmp_buf, - des_stride, - &draw_size); - - __arm_2d_impl_cccn888_src_msk_copy(tmp_buf, - des_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size); - - lv_free(tmp_buf); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint16_t); - - uint32_t * tmp_buf = (uint32_t *)lv_malloc(dsc->dest_stride * dsc->dest_h); - if(NULL == tmp_buf) { - return LV_RESULT_INVALID; - } - - __arm_2d_impl_rgb565_to_cccn888((uint16_t *)dsc->src_buf, - src_stride, - (uint32_t *)tmp_buf, - des_stride, - &draw_size); - - __arm_2d_impl_cccn888_tile_copy_with_src_mask_and_opacity(tmp_buf, - des_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); - - lv_free(tmp_buf); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, - uint32_t src_px_size) -{ - if((dst_px_size == 3) || (src_px_size == 3)) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_rgb32_copy((uint32_t *)dsc->src_buf, - src_stride, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size); - - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_with_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, uint32_t src_px_size) -{ - if((dst_px_size == 3) || (src_px_size == 3)) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_cccn888_tile_copy_opacity((uint32_t *)dsc->src_buf, - src_stride, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); - - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_with_mask_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, uint32_t src_px_size) -{ - if((dst_px_size == 3) || (src_px_size == 3)) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_cccn888_src_msk_copy((uint32_t *)dsc->src_buf, - src_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, uint32_t src_px_size) -{ - if((dst_px_size == 3) || (src_px_size == 3)) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_cccn888_tile_copy_with_src_mask_and_opacity((uint32_t *)dsc->src_buf, - src_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); - return LV_RESULT_OK; -} - -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_ccca8888_to_cccn888((uint32_t *)dsc->src_buf, - src_stride, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size); - - return LV_RESULT_OK; -} - -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_with_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_ccca8888_tile_copy_to_cccn888_with_opacity((uint32_t *)dsc->src_buf, - src_stride, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); - - return LV_RESULT_OK; -} - -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_with_mask_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_ccca8888_tile_copy_to_cccn888_with_src_mask((uint32_t *)dsc->src_buf, - src_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size); - - return LV_RESULT_OK; -} - -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_arm2d(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - if(dst_px_size == 3) { - return LV_RESULT_INVALID; - } - - arm_2d_size_t draw_size = {dsc->dest_w, dsc->dest_h}; - int16_t des_stride = dsc->dest_stride / sizeof(uint32_t); - int16_t src_stride = dsc->src_stride / sizeof(uint32_t); - - __arm_2d_impl_ccca8888_tile_copy_to_cccn888_with_src_mask_and_opacity((uint32_t *)dsc->src_buf, - src_stride, - (uint8_t *)dsc->mask_buf, - dsc->mask_stride, - &draw_size, - (uint32_t *)dsc->dest_buf, - des_stride, - &draw_size, - dsc->opa); - - return LV_RESULT_OK; -} - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_DRAW_ARM2D_SYNC */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_BLEND_ARM2D_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/helium/lv_blend_helium.S b/L3_Middlewares/LVGL/src/draw/sw/blend/helium/lv_blend_helium.S deleted file mode 100644 index 4304d74..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/helium/lv_blend_helium.S +++ /dev/null @@ -1,701 +0,0 @@ -/** - * @file lv_blend_helium.S - * - */ - -#ifndef __ASSEMBLY__ -#define __ASSEMBLY__ -#endif - -#include "lv_blend_helium.h" - -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM && defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE && LV_USE_NATIVE_HELIUM_ASM - -.data -reciprocal: -.byte 0xFF, 0xE2, 0xCC, 0xB9, 0xAA, 0x9C, 0x91, 0x88 - -.text -.syntax unified -.p2align 2 - -TMP .req r0 -DST_ADDR .req r1 -DST_W .req r2 -DST_H .req r3 -DST_STRIDE .req r4 -SRC_ADDR .req r5 -SRC_STRIDE .req r6 -MASK_ADDR .req r7 -MASK_STRIDE .req r8 -H .req r9 -OPA .req r10 -RCP .req r11 - -S_B .req q0 -S_G .req q1 -S_R .req q2 -S_A .req q3 -D_B .req q4 -D_G .req q5 -D_R .req q6 -D_A .req q7 -N .req q0 -V .req q1 -R .req q2 -L .req q4 -S_565 .req q0 -D_565 .req q1 -S_L .req q2 -D_L .req q4 -D_T .req q5 -BITMASK .req q6 - -.macro ldst st, op, bpp, mem, reg, areg, cvt, alt_index, wb, aligned -.if \bpp == 0 -.if \cvt - ldr TMP, [\mem\()_ADDR] - bfi TMP, TMP, #2, #8 - bfi TMP, TMP, #3, #16 - lsr TMP, TMP, #8 - vdup.16 \reg\()_565, TMP -.else - ldr TMP, [\mem\()_ADDR] - vdup.8 \reg\()_B, TMP - lsr TMP, #8 - vdup.8 \reg\()_G, TMP - lsr TMP, #8 - vdup.8 \reg\()_R, TMP -.endif -.elseif \bpp == 8 -.if \cvt - v\op\()rb.u16 \reg\()_A, [\mem\()_ADDR], #8 -.else - v\op\()rb.8 \reg\()_A, [\mem\()_ADDR], #16 -.endif -.elseif \bpp == 16 -.if \cvt -.if \st - vsri.8 \reg\()_R, \reg\()_G, #5 - vshr.u8 \reg\()_G, \reg\()_G, #2 - vshr.u8 \reg\()_B, \reg\()_B, #3 - vsli.8 \reg\()_B, \reg\()_G, #5 -.endif -.if \alt_index - v\op\()rb.8 \reg\()_B, [\mem\()_ADDR, S_B] - v\op\()rb.8 \reg\()_R, [\mem\()_ADDR, S_G] -.else - v\op\()rb.8 \reg\()_B, [\mem\()_ADDR, \reg\()_A] - add \mem\()_ADDR, #1 - v\op\()rb.8 \reg\()_R, [\mem\()_ADDR, \reg\()_A] -.endif -.if \st == 0 - vshl.u8 \reg\()_G, \reg\()_R, #5 - vsri.u8 \reg\()_G, \reg\()_B, #3 - vshl.u8 \reg\()_B, \reg\()_B, #3 - vsri.u8 \reg\()_R, \reg\()_R, #5 - vsri.u8 \reg\()_G, \reg\()_G, #6 - vsri.u8 \reg\()_B, \reg\()_B, #5 -.endif -.ifc \wb, ! -.if \alt_index - add \mem\()_ADDR, #32 -.else - add \mem\()_ADDR, #31 -.endif -.elseif \alt_index == 0 - sub \mem\()_ADDR, #1 -.endif -.else @ cvt -.ifc \wb, ! - v\op\()rh.16 \reg\()_565, [\mem\()_ADDR], #16 -.else - v\op\()rh.16 \reg\()_565, [\mem\()_ADDR] -.endif -.endif -.elseif \bpp == 24 -.if \alt_index == 1 - v\op\()rb.8 \reg\()_B, [\mem\()_ADDR, S_B] - v\op\()rb.8 \reg\()_G, [\mem\()_ADDR, S_G] - v\op\()rb.8 \reg\()_R, [\mem\()_ADDR, S_R] -.elseif \alt_index == 2 - v\op\()rb.8 \reg\()_B, [\mem\()_ADDR, S_R] - v\op\()rb.8 \reg\()_G, [\mem\()_ADDR, S_A] - v\op\()rb.8 \reg\()_R, [\mem\()_ADDR, D_A] -.else - v\op\()rb.8 \reg\()_B, [\mem\()_ADDR, \reg\()_A] - add \mem\()_ADDR, #1 - v\op\()rb.8 \reg\()_G, [\mem\()_ADDR, \reg\()_A] - add \mem\()_ADDR, #1 - v\op\()rb.8 \reg\()_R, [\mem\()_ADDR, \reg\()_A] -.endif -.ifc \wb, ! -.if \alt_index - add \mem\()_ADDR, #48 -.else - add \mem\()_ADDR, #46 -.endif -.elseif \alt_index == 0 - sub \mem\()_ADDR, #2 -.endif -.elseif \aligned - v\op\()40.8 {\reg\()_B, \reg\()_G, \reg\()_R, \reg\()_A}, [\mem\()_ADDR] - v\op\()41.8 {\reg\()_B, \reg\()_G, \reg\()_R, \reg\()_A}, [\mem\()_ADDR] - v\op\()42.8 {\reg\()_B, \reg\()_G, \reg\()_R, \reg\()_A}, [\mem\()_ADDR] - v\op\()43.8 {\reg\()_B, \reg\()_G, \reg\()_R, \reg\()_A}, [\mem\()_ADDR]\wb -.else - v\op\()rb.8 \reg\()_B, [\mem\()_ADDR, \areg\()_A] - add \mem\()_ADDR, #1 - v\op\()rb.8 \reg\()_G, [\mem\()_ADDR, \areg\()_A] - add \mem\()_ADDR, #1 - v\op\()rb.8 \reg\()_R, [\mem\()_ADDR, \areg\()_A] -.if (\bpp == 32) || (\bpp == 31) && \st - add \mem\()_ADDR, #1 - v\op\()rb.8 \reg\()_A, [\mem\()_ADDR, \areg\()_A] -.endif -.ifc \wb, ! - .if (\bpp == 32) || (\bpp == 31) && \st - add \mem\()_ADDR, #61 - .else - add \mem\()_ADDR, #62 - .endif -.else - .if (\bpp == 32) || (\bpp == 31) && \st - sub \mem\()_ADDR, #3 - .else - sub \mem\()_ADDR, #2 - .endif -.endif -.endif -.endm - -.macro load_index bpp, reg, areg, aligned -.if (\bpp > 0) && ((\bpp < 31) || (\aligned == 0)) - mov TMP, #0 -.if \bpp == 8 - vidup.u8 \reg\()_A, TMP, #1 -.elseif \bpp == 16 - vidup.u8 \reg\()_A, TMP, #2 -.elseif \bpp == 24 - vidup.u8 \reg\()_A, TMP, #1 - mov TMP, #3 - vmul.u8 \reg\()_A, \reg\()_A, TMP -.else - vidup.u8 \areg\()_A, TMP, #4 -.endif -.endif -.endm - -.macro init src_bpp, dst_bpp, mask, opa - ldr DST_ADDR, [r0, #4] - ldr DST_W, [r0, #8] - ldr DST_H, [r0, #12] - ldr DST_STRIDE, [r0, #16] - ldr SRC_ADDR, [r0, #20] -.if \src_bpp > 0 - ldr SRC_STRIDE, [r0, #24] -.endif -.if \mask - ldr MASK_ADDR, [r0, #28] - ldr MASK_STRIDE, [r0, #32] -.endif -.if \opa - ldr OPA, [r0] -.endif -.if (\src_bpp <= 16) && (\dst_bpp == 16) -.if \opa || \mask - mov TMP, #0xF81F - movt TMP, #0x7E0 - vdup.32 BITMASK, TMP -.endif - add TMP, DST_W, #0x7 - bic TMP, TMP, #0x7 -.else - add TMP, DST_W, #0xF - bic TMP, TMP, #0xF -.endif -.if \dst_bpp == 32 - ldr RCP, =(reciprocal - 8) -.endif - -.if \dst_bpp == 16 - sub DST_STRIDE, DST_STRIDE, TMP, lsl #1 -.elseif \dst_bpp == 24 - sub DST_STRIDE, DST_STRIDE, TMP - sub DST_STRIDE, DST_STRIDE, TMP, lsl #1 -.elseif \dst_bpp >= 31 - sub DST_STRIDE, DST_STRIDE, TMP, lsl #2 -.endif -.if \mask - sub MASK_STRIDE, MASK_STRIDE, TMP -.endif -.if \src_bpp == 0 -.if \mask || \opa - .if \dst_bpp > 16 - ldst 0, ld, \src_bpp, SRC, S, D, 0, 0 - vmov.u8 S_A, #0xFF - .else - ldst 0, ld, \src_bpp, SRC, S, D, 1, 0 - vmovlb.u16 S_L, S_565 - vsli.32 S_L, S_L, #16 - vand S_L, S_L, BITMASK - .endif -.else - .if \dst_bpp > 16 - ldst 0, ld, \src_bpp, SRC, D, S, 0, 0 - .else - ldst 0, ld, \src_bpp, SRC, D, S, 1, 0 - .endif -.endif -.else - .if \src_bpp == 16 - sub SRC_STRIDE, SRC_STRIDE, TMP, lsl #1 - .elseif \src_bpp == 24 - sub SRC_STRIDE, SRC_STRIDE, TMP - sub SRC_STRIDE, SRC_STRIDE, TMP, lsl #1 - .elseif \src_bpp >= 31 - sub SRC_STRIDE, SRC_STRIDE, TMP, lsl #2 - .endif -.endif -.if (\src_bpp < 32) && (\mask == 0) && (\opa == 0) && !((\src_bpp <= 16) && (\dst_bpp == 16)) -@ 16 to 31/32 or reverse: index @ q0, q1 -@ 24 to 31/32 or reverse: index @ q0, q1, q2 -@ 16 to 24 or reverse: 16 index @ q0, q1, 24 index @ q2, q3, q7 -@ 31 to 31/32: index @ q3 (tail only) - mov TMP, #0 -.if (\src_bpp == 16) || (\dst_bpp == 16) - vidup.u8 S_B, TMP, #2 - mov TMP, #1 - vadd.u8 S_G, S_B, TMP -.if (\src_bpp == 24) || (\dst_bpp == 24) - vshl.u8 S_R, S_B, #1 - vadd.u8 S_R, S_R, S_B - vshr.u8 S_R, S_R, #1 - vadd.u8 S_A, S_R, TMP - vadd.u8 D_A, S_A, TMP -.endif -.elseif (\src_bpp == 24) || (\dst_bpp == 24) - vidup.u8 S_B, TMP, #1 - mov TMP, #3 - vmul.u8 S_B, S_B, TMP - mov TMP, #1 - vadd.u8 S_G, S_B, TMP - vadd.u8 S_R, S_G, TMP -.endif -.if \dst_bpp >= 31 - load_index \dst_bpp, D, S, 0 - vmov.u8 D_A, #0xFF -.endif -.endif -.endm - -.macro vqrdmulh_u8 Qd, Qn, Qm @ 1 bit precision loss - vmulh.u8 \Qd, \Qn, \Qm - vqshl.u8 \Qd, \Qd, #1 -.endm - -.macro premult mem, alpha - vrmulh.u8 \mem\()_B, \mem\()_B, \alpha - vrmulh.u8 \mem\()_G, \mem\()_G, \alpha - vrmulh.u8 \mem\()_R, \mem\()_R, \alpha -.endm - -.macro blend_565 p - vmovl\p\().u16 D_L, D_565 - vsli.32 D_L, D_L, #16 - vand D_L, D_L, BITMASK - vsub.u32 D_T, S_L, D_L - vmovl\p\().u16 D_A, S_A - vmul.u32 D_T, D_T, D_A - vshr.u32 D_T, D_T, #5 - vadd.u32 D_L, D_L, D_T - vand D_L, D_L, BITMASK - vshr.u32 D_T, D_L, #16 - vorr D_L, D_L, D_T - vmovn\p\().u32 D_565, D_L -.endm - -.macro late_init src_bpp, dst_bpp, mask, opa, mode -.if (\src_bpp <= 16) && (\dst_bpp == 16) && (\mask == 0) -.if \opa == 2 - mov TMP, #0x7BEF - vdup.16 BITMASK, TMP -.if \src_bpp == 0 - vshr.u16 S_L, S_565, #1 - vand S_L, S_L, BITMASK -.endif -.elseif \opa == 1 - vdup.16 S_A, OPA - mov TMP, #4 - vadd.u16 S_A, S_A, TMP - vshr.u16 S_A, S_A, #3 -.endif -.endif -.endm - -.macro blend src_bpp, dst_bpp, mask, opa, mode -.if (\mask == 0) && (\opa == 2) -.if (\src_bpp <= 16) && (\dst_bpp == 16) -.if \src_bpp > 0 - vshr.u16 S_L, S_565, #1 - vand S_L, S_L, BITMASK -.endif - vshr.u16 D_L, D_565, #1 - vand D_L, D_L, BITMASK - vadd.u16 D_565, S_L, D_L -.else - vhadd.u8 D_B, D_B, S_B - vhadd.u8 D_G, D_G, S_G - vhadd.u8 D_R, D_R, S_R -.endif -.elseif (\src_bpp <= 16) && (\dst_bpp == 16) - lsl lr, #1 -.if \src_bpp > 0 - vmovlb.u16 S_L, S_565 - vsli.32 S_L, S_L, #16 - vand S_L, S_L, BITMASK -.endif - blend_565 b -.if \src_bpp > 0 - vmovlt.u16 S_L, S_565 - vsli.32 S_L, S_L, #16 - vand S_L, S_L, BITMASK -.endif - blend_565 t - lsr lr, #1 -.else -.if \dst_bpp < 32 -.if (\opa == 0) && (\mask == 0) - vmov.u8 D_A, #0xFF - mov TMP, #0 - vabav.u8 TMP, S_A, D_A - cbnz TMP, 91f - vmov D_B, S_B - vmov D_G, S_G - vmov D_R, S_R - b 88f -91: -.endif - vmvn D_A, S_A - premult S, S_A - premult D, D_A -.else - vpush {d0-d5} - vmov.u8 S_B, #0xFF - vmov.u8 S_G, #0 - mov TMP, #0 - vabav.u8 TMP, S_A, S_B - cbz TMP, 91f @ if(fg.alpha == 255 - mov TMP, #0 - vabav.u8 TMP, D_A, S_G - cbnz TMP, 90f @ || bg.alpha == 0) -91: - vpop {d8-d13} @ return fg; - vmov.u8 D_A, #0xFF - b 88f -90: - mov TMP, #0 - vabav.u8 TMP, S_A, S_G - cmp TMP, #2 @ if(fg.alpha <= LV_OPA_MIN) - itt le @ return bg; - vpople {d0-d5} - ble 88f - mov TMP, #0 - vabav.u8 TMP, D_A, S_B @ if (bg.alpha == 255) - cbnz TMP, 89f @ return lv_color_mix32(fg, bg); - vpop {d0-d5} - vmvn D_A, S_A - premult S, S_A - premult D, D_A - vqadd.u8 D_B, D_B, S_B - vqadd.u8 D_G, D_G, S_G - vqadd.u8 D_R, D_R, S_R - vmov.u8 D_A, #0xFF - b 88f -89: - vmvn N, S_A - vmvn D_A, D_A - vrmulh.u8 D_A, N, D_A - vmvn D_A, D_A @ D_A = 255 - LV_OPA_MIX2(255 - fg.alpha, 255 - bg.alpha) - vclz.i8 N, D_A @ n = clz(D_A) - vshl.u8 V, D_A, N @ v = D_A << n - vshl.u8 S_A, S_A, N - vshr.u8 N, V, #4 @ N is used as tmp from now on - vldrb.u8 R, [RCP, N] @ r = reciprocal[(v >> 4) - 8] - vrmulh.u8 N, V, R @ r = newton(v,r) - vmvn N, N @ = vqrdmulh.u8(vmvn(vrmulh(v, r)), r) - vqrdmulh_u8 R, N, R @ but vqrdmulh does not support u8, so we implement one - vrmulh.u8 N, V, R @ and do it twice - vmvn N, N - vqrdmulh_u8 R, N, R - vqrdmulh_u8 S_A, S_A, R @ S_A' = S_A * 255 / D_A = vrdmulh(S_A << n, r) - vpop {d0-d5} - premult S, S_A - vmvn S_A, S_A - premult D, S_A -.endif - vqadd.u8 D_B, D_B, S_B - vqadd.u8 D_G, D_G, S_G - vqadd.u8 D_R, D_R, S_R -.endif -.if \dst_bpp == 31 - vmov.u8 D_A, #0xFF -.endif -88: -.endm - -.macro blend_line src_bpp, dst_bpp, mask, opa, mode -.if (\src_bpp < 31) && (\dst_bpp < 31) - blend_block \src_bpp, \dst_bpp, \mask, \opa, \mode, DST_W, 0 -.else - bics TMP, DST_W, #0xF - beq 87f - blend_block \src_bpp, \dst_bpp, \mask, \opa, \mode, TMP, 1 -87: - ands TMP, DST_W, #0xF - beq 86f - blend_block \src_bpp, \dst_bpp, \mask, \opa, \mode, TMP, 0 -86: -.endif -.endm - -.macro blend_block src_bpp, dst_bpp, mask, opa, mode, w, aligned -.if (\src_bpp <= 16) && (\dst_bpp == 16) - wlstp.16 lr, \w, 1f -.else - wlstp.8 lr, \w, 1f -.endif -2: -.if (\src_bpp < 32) && (\mask == 0) && (\opa == 0) -@ no blend - .if \src_bpp == 0 - ldst 1, st, \dst_bpp, DST, D, S, 0, 1, !, \aligned - .elseif (\src_bpp == \dst_bpp) || (\src_bpp == 31) && (\dst_bpp == 32) - .if \dst_bpp < 31 - .if \src_bpp < 31 - ldst 0, ld, \src_bpp, SRC, D, S, 0, 1, !, \aligned - .else - ldst 0, ld, \src_bpp, SRC, D, S, 0, 1, !, \aligned - .endif - ldst 1, st, \dst_bpp, DST, D, S, 0, 1, !, \aligned - .else - ldst 0, ld, \src_bpp, SRC, D, S, 0, 1, !, \aligned - ldst 1, st, \dst_bpp, DST, D, S, 0, 1, !, \aligned - .endif - .else - .if (\dst_bpp < 31) && (\src_bpp < 31) - ldst 0, ld, \src_bpp, SRC, D, S, 1, 2, !, \aligned - ldst 1, st, \dst_bpp, DST, D, S, 1, 2, !, \aligned - .else - ldst 0, ld, \src_bpp, SRC, D, S, 1, 1, !, \aligned - ldst 1, st, \dst_bpp, DST, D, S, 1, 1, !, \aligned - .endif - .endif -.elseif (\src_bpp <= 16) && (\dst_bpp == 16) - .if \src_bpp > 0 - ldst 0, ld, \src_bpp, SRC, S, D, 0, 0, !, \aligned - .endif - ldst 0, ld, \dst_bpp, DST, D, S, 0, 0, , \aligned - .if \mask - ldst 0, ld, 8, MASK, S, D, 1, 0, ! - .if \opa == 2 - vshr.u16 S_A, S_A, #1 - .elseif \opa == 1 - vmul.u16 S_A, S_A, OPA - vshr.u16 S_A, S_A, #8 - .endif - mov TMP, #4 - vadd.u16 S_A, S_A, TMP - vshr.u16 S_A, S_A, #3 - .endif - blend \src_bpp, \dst_bpp, \mask, \opa, \mode - ldst 1, st, \dst_bpp, DST, D, S, 0, 0, !, \aligned -.elseif \src_bpp < 32 -@ no src_a -.if \src_bpp > 0 - load_index \src_bpp, S, D, \aligned - ldst 0, ld, \src_bpp, SRC, S, D, 1, 0, !, \aligned -.elseif (\opa == 1) || \mask - vpush {d0-d5} -.endif - load_index \dst_bpp, D, S, \aligned - ldst 0, ld, \dst_bpp, DST, D, S, 1, 0, , \aligned - .if \mask - ldst 0, ld, 8, MASK, S, D, 0, 0, !, \aligned - .if \opa == 2 - vshr.u8 S_A, S_A, #1 - .elseif \opa == 1 - .if \dst_bpp == 32 - vpush {d14-d15} - .endif - vdup.8 D_A, OPA - vrmulh.u8 S_A, S_A, D_A - .if \dst_bpp == 32 - vpop {d14-d15} - .endif - .endif - .elseif \opa == 1 - vdup.8 S_A, OPA - .endif - blend \src_bpp, \dst_bpp, \mask, \opa, \mode -.if (\src_bpp == 0) && ((\opa == 1) || \mask) - vpop {d0-d5} -.endif - .if (\dst_bpp == 32) || \mask || (\opa == 1) - load_index \dst_bpp, D, S, \aligned - .endif - ldst 1, st, \dst_bpp, DST, D, S, 1, 0, !, \aligned -.else -@ src_a (+\mask) (+\opa) - load_index \dst_bpp, D, S, \aligned - ldst 0, ld, \dst_bpp, DST, D, S, 1, 0, , \aligned - .if (\dst_bpp == 32) && (\mask || \opa || (\aligned == 0)) - vpush {d14-d15} - .endif - load_index \src_bpp, S, D, \aligned - ldst 0, ld, \src_bpp, SRC, S, D, 1, 0, !, \aligned - .if \mask == 0 - .if \opa - vdup.8 D_A, OPA - vrmulh.u8 S_A, S_A, D_A - .endif - .else - ldst 0, ld, 8, MASK, D, S, 0, 0, !, \aligned - vrmulh.u8 S_A, S_A, D_A - .if \opa - vdup.8 D_A, OPA - vrmulh.u8 S_A, S_A, D_A - .endif - .endif - .if (\dst_bpp == 32) && (\mask || \opa || (\aligned == 0)) - vpop {d14-d15} - .endif - blend \src_bpp, \dst_bpp, \mask, \opa, \mode - load_index \dst_bpp, D, S, \aligned - ldst 1, st, \dst_bpp, DST, D, S, 1, 0, !, \aligned -.endif - letp lr, 2b -1: -.endm - -.macro enter complex - push {r4-r11, lr} -.if \complex - vpush {d8-d15} -.endif -.endm - -.macro exit complex -.if \complex - vpop {d8-d15} -.endif - pop {r4-r11, pc} -.endm - -.macro preload mem, bpp -.if \bpp >= 31 - pld [\mem\()_ADDR, DST_W, lsl #2] -.elseif \bpp == 24 - add TMP, DST_W, DST_W, lsl #1 - pld [\mem\()_ADDR, TMP] -.elseif \bpp == 16 - pld [\mem\()_ADDR, DST_W, lsl #1] -.elseif \bpp == 8 - pld [\mem\()_ADDR, DST_W] -.endif -.endm - -.macro next src_bpp, mask - add DST_ADDR, DST_ADDR, DST_STRIDE -.if \src_bpp > 0 - add SRC_ADDR, SRC_ADDR, SRC_STRIDE -.endif -.if \mask - add MASK_ADDR, MASK_ADDR, MASK_STRIDE -.endif -.endm - -.macro blender src_bpp, dst_bpp, mask, opa, mode -.if (\src_bpp <= 16) && (\dst_bpp == 16) && (\opa == 0) && (\mask == 0) - enter 0 -.else - enter 1 -.endif - init \src_bpp, \dst_bpp, \mask, \opa - movs H, DST_H - beq 0f - preload SRC, \src_bpp -.if \mask || \opa || (\src_bpp == 32) - preload DST, \dst_bpp -.endif -.if \opa && (\src_bpp < 32) && (\dst_bpp < 32) -4: -@ 50% OPA can be accelerated (OPA == 0x7F/0x80) - add TMP, OPA, #1 - tst TMP, #0x7E - bne 3f - late_init \src_bpp, \dst_bpp, \mask, 2, \mode - blend_line \src_bpp, \dst_bpp, \mask, 2, \mode - next \src_bpp, \mask - subs H, #1 - bne 4b - b 0f -.endif -3: - late_init \src_bpp, \dst_bpp, \mask, \opa, \mode - blend_line \src_bpp, \dst_bpp, \mask, \opa, \mode - next \src_bpp, \mask - subs H, #1 - bne 3b -0: -.if (\src_bpp <= 16) && (\dst_bpp == 16) && (\opa == 0) && (\mask == 0) - exit 0 -.else - exit 1 -.endif -.ltorg -.endm - -.macro export name, src_bpp, dst_bpp, mask, opa, mode -.thumb_func -.global \name -\name\(): - blender \src_bpp, \dst_bpp, \mask, \opa, \mode -.endm - -.macro export_set src, dst, src_bpp, dst_bpp, mode -.ifc \src, color - export lv_\src\()_blend_to_\dst\()_helium, \src_bpp, \dst_bpp, 0, 0, \mode - export lv_\src\()_blend_to_\dst\()_with_opa_helium, \src_bpp, \dst_bpp, 0, 1, \mode - export lv_\src\()_blend_to_\dst\()_with_mask_helium, \src_bpp, \dst_bpp, 1, 0, \mode - export lv_\src\()_blend_to_\dst\()_mix_mask_opa_helium, \src_bpp, \dst_bpp, 1, 1, \mode -.else - export lv_\src\()_blend_\mode\()_to_\dst\()_helium, \src_bpp, \dst_bpp, 0, 0, \mode - export lv_\src\()_blend_\mode\()_to_\dst\()_with_opa_helium, \src_bpp, \dst_bpp, 0, 1, \mode - export lv_\src\()_blend_\mode\()_to_\dst\()_with_mask_helium, \src_bpp, \dst_bpp, 1, 0, \mode - export lv_\src\()_blend_\mode\()_to_\dst\()_mix_mask_opa_helium, \src_bpp, \dst_bpp, 1, 1, \mode -.endif -.endm - -export_set color, rgb565, 0, 16, normal -export_set rgb565, rgb565, 16, 16, normal -export_set rgb888, rgb565, 24, 16, normal -export_set xrgb8888, rgb565, 31, 16, normal -export_set argb8888, rgb565, 32, 16, normal -export_set color, rgb888, 0, 24, normal -export_set rgb565, rgb888, 16, 24, normal -export_set rgb888, rgb888, 24, 24, normal -export_set xrgb8888, rgb888, 31, 24, normal -export_set argb8888, rgb888, 32, 24, normal -export_set color, xrgb8888, 0, 31, normal -export_set rgb565, xrgb8888, 16, 31, normal -export_set rgb888, xrgb8888, 24, 31, normal -export_set xrgb8888, xrgb8888, 31, 31, normal -export_set argb8888, xrgb8888, 32, 31, normal -export_set color, argb8888, 0, 32, normal -export_set rgb565, argb8888, 16, 32, normal -export_set rgb888, argb8888, 24, 32, normal -export_set xrgb8888, argb8888, 31, 32, normal -export_set argb8888, argb8888, 32, 32, normal - -#endif /*LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM && defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE && LV_USE_NATIVE_HELIUM_ASM*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/helium/lv_blend_helium.h b/L3_Middlewares/LVGL/src/draw/sw/blend/helium/lv_blend_helium.h deleted file mode 100644 index 69b999e..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/helium/lv_blend_helium.h +++ /dev/null @@ -1,1313 +0,0 @@ -/** - * @file lv_blend_helium.h - * - */ - -#ifndef LV_BLEND_HELIUM_H -#define LV_BLEND_HELIUM_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#if defined(_RTE_) -#include "Pre_Include_Global.h" -#include "lv_conf_cmsis.h" -#endif - -#include "../../../../lv_conf_internal.h" - -/* detect whether helium is available based on arm compilers' standard */ -#if defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE - -#ifdef LV_DRAW_SW_HELIUM_CUSTOM_INCLUDE -#include LV_DRAW_SW_HELIUM_CUSTOM_INCLUDE -#endif - -#if !defined(__ASSEMBLY__) - -/* Use arm2d functions if present */ -#include "../arm2d/lv_blend_arm2d.h" - -/********************* - * DEFINES - *********************/ - -#if LV_USE_NATIVE_HELIUM_ASM - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565 -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565(dsc) \ - lv_color_blend_to_rgb565_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA(dsc) \ - lv_color_blend_to_rgb565_with_opa_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK(dsc) \ - lv_color_blend_to_rgb565_with_mask_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA(dsc) \ - lv_color_blend_to_rgb565_mix_mask_opa_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565 -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565(dsc) \ - lv_rgb565_blend_normal_to_rgb565_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc) \ - lv_rgb565_blend_normal_to_rgb565_with_opa_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc) \ - lv_rgb565_blend_normal_to_rgb565_with_mask_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc) \ - lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565 -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_helium(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_with_opa_helium(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_with_mask_helium(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_helium(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565 -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565(dsc) \ - lv_argb8888_blend_normal_to_rgb565_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc) \ - lv_argb8888_blend_normal_to_rgb565_with_opa_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc) \ - lv_argb8888_blend_normal_to_rgb565_with_mask_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc) \ - lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888 -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_with_opa_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_with_mask_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_mix_mask_opa_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888 -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_with_opa_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_with_mask_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888 -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_helium(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_with_opa_helium(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_with_mask_helium(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_helium(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888 -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_with_opa_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_with_mask_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_helium(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888 -#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888(dsc) \ - lv_color_blend_to_argb8888_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA(dsc) \ - lv_color_blend_to_argb8888_with_opa_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK -#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK(dsc) \ - lv_color_blend_to_argb8888_with_mask_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA(dsc) \ - lv_color_blend_to_argb8888_mix_mask_opa_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888 -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888(dsc) \ - lv_rgb565_blend_normal_to_argb8888_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc) \ - lv_rgb565_blend_normal_to_argb8888_with_opa_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc) \ - lv_rgb565_blend_normal_to_argb8888_with_mask_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc) \ - lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888 -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_argb8888_helium(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_argb8888_with_opa_helium(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_argb8888_with_mask_helium(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_helium(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888 -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888(dsc) \ - lv_argb8888_blend_normal_to_argb8888_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc) \ - lv_argb8888_blend_normal_to_argb8888_with_opa_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc) \ - lv_argb8888_blend_normal_to_argb8888_with_mask_helium(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc) \ - lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_helium(dsc) -#endif - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - uint32_t opa; - void * dst_buf; - uint32_t dst_w; - uint32_t dst_h; - uint32_t dst_stride; - const void * src_buf; - uint32_t src_stride; - const lv_opa_t * mask_buf; - uint32_t mask_stride; -} asm_dsc_t; -/********************** - * GLOBAL PROTOTYPES - **********************/ - -extern void lv_color_blend_to_rgb565_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb565_helium(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - - lv_color_blend_to_rgb565_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_color_blend_to_rgb565_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb565_with_opa_helium(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - lv_color_blend_to_rgb565_with_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_color_blend_to_rgb565_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb565_with_mask_helium(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_color_blend_to_rgb565_with_mask_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_color_blend_to_rgb565_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb565_mix_mask_opa_helium(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_color_blend_to_rgb565_mix_mask_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_rgb565_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - lv_rgb565_blend_normal_to_rgb565_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_rgb565_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_with_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - lv_rgb565_blend_normal_to_rgb565_with_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_rgb565_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_with_mask_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_rgb565_blend_normal_to_rgb565_with_mask_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_rgb565_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_rgb565_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_rgb565_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_rgb565_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_rgb565_with_opa_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_rgb565_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_with_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_rgb565_with_opa_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_rgb565_with_opa_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_rgb565_with_mask_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_rgb565_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_with_mask_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_rgb565_with_mask_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_rgb565_with_mask_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_rgb565_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_rgb565_mix_mask_opa_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_rgb565_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - lv_argb8888_blend_normal_to_rgb565_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_rgb565_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_with_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - lv_argb8888_blend_normal_to_rgb565_with_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_rgb565_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_with_mask_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_argb8888_blend_normal_to_rgb565_with_mask_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_color_blend_to_rgb888_helium(asm_dsc_t * dsc); -extern void lv_color_blend_to_xrgb8888_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb888_helium(lv_draw_sw_blend_fill_dsc_t * dsc, uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - if(dst_px_size == 3) { - lv_color_blend_to_rgb888_helium(&asm_dsc); - } - else { - lv_color_blend_to_xrgb8888_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_color_blend_to_rgb888_with_opa_helium(asm_dsc_t * dsc); -extern void lv_color_blend_to_xrgb8888_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb888_with_opa_helium(lv_draw_sw_blend_fill_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - if(dst_px_size == 3) { - lv_color_blend_to_rgb888_with_opa_helium(&asm_dsc); - } - else { - lv_color_blend_to_xrgb8888_with_opa_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_color_blend_to_rgb888_with_mask_helium(asm_dsc_t * dsc); -extern void lv_color_blend_to_xrgb8888_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb888_with_mask_helium(lv_draw_sw_blend_fill_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - lv_color_blend_to_rgb888_with_mask_helium(&asm_dsc); - } - else { - lv_color_blend_to_xrgb8888_with_mask_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_color_blend_to_rgb888_mix_mask_opa_helium(asm_dsc_t * dsc); -extern void lv_color_blend_to_xrgb8888_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb888_mix_mask_opa_helium(lv_draw_sw_blend_fill_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - lv_color_blend_to_rgb888_mix_mask_opa_helium(&asm_dsc); - } - else { - lv_color_blend_to_xrgb8888_mix_mask_opa_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_rgb888_helium(asm_dsc_t * dsc); -extern void lv_rgb565_blend_normal_to_xrgb8888_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - lv_rgb565_blend_normal_to_rgb888_helium(&asm_dsc); - } - else { - lv_rgb565_blend_normal_to_xrgb8888_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_rgb888_with_opa_helium(asm_dsc_t * dsc); -extern void lv_rgb565_blend_normal_to_xrgb8888_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_with_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - lv_rgb565_blend_normal_to_rgb888_with_opa_helium(&asm_dsc); - } - else { - lv_rgb565_blend_normal_to_xrgb8888_with_opa_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_rgb888_with_mask_helium(asm_dsc_t * dsc); -extern void lv_rgb565_blend_normal_to_xrgb8888_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_with_mask_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - lv_rgb565_blend_normal_to_rgb888_with_mask_helium(&asm_dsc); - } - else { - lv_rgb565_blend_normal_to_xrgb8888_with_mask_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_helium(asm_dsc_t * dsc); -extern void lv_rgb565_blend_normal_to_xrgb8888_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_helium(&asm_dsc); - } - else { - lv_rgb565_blend_normal_to_xrgb8888_mix_mask_opa_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_rgb888_helium(asm_dsc_t * dsc); -extern void lv_rgb888_blend_normal_to_xrgb8888_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_rgb888_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_xrgb8888_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_rgb888_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_rgb888_helium(&asm_dsc); - } - } - else { - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_xrgb8888_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_xrgb8888_helium(&asm_dsc); - } - } - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_rgb888_with_opa_helium(asm_dsc_t * dsc); -extern void lv_rgb888_blend_normal_to_xrgb8888_with_opa_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_rgb888_with_opa_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_xrgb8888_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_with_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_rgb888_with_opa_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_rgb888_with_opa_helium(&asm_dsc); - } - } - else { - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_xrgb8888_with_opa_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_xrgb8888_with_opa_helium(&asm_dsc); - } - } - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_rgb888_with_mask_helium(asm_dsc_t * dsc); -extern void lv_rgb888_blend_normal_to_xrgb8888_with_mask_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_rgb888_with_mask_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_xrgb8888_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_with_mask_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_rgb888_with_mask_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_rgb888_with_mask_helium(&asm_dsc); - } - } - else { - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_xrgb8888_with_mask_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_xrgb8888_with_mask_helium(&asm_dsc); - } - } - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_helium(asm_dsc_t * dsc); -extern void lv_rgb888_blend_normal_to_xrgb8888_mix_mask_opa_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_rgb888_mix_mask_opa_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_xrgb8888_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_rgb888_mix_mask_opa_helium(&asm_dsc); - } - } - else { - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_xrgb8888_mix_mask_opa_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_xrgb8888_mix_mask_opa_helium(&asm_dsc); - } - } - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_rgb888_helium(asm_dsc_t * dsc); -extern void lv_argb8888_blend_normal_to_xrgb8888_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - lv_argb8888_blend_normal_to_rgb888_helium(&asm_dsc); - } - else { - lv_argb8888_blend_normal_to_xrgb8888_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_rgb888_with_opa_helium(asm_dsc_t * dsc); -extern void lv_argb8888_blend_normal_to_xrgb8888_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_with_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - lv_argb8888_blend_normal_to_rgb888_with_opa_helium(&asm_dsc); - } - else { - lv_argb8888_blend_normal_to_xrgb8888_with_opa_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_rgb888_with_mask_helium(asm_dsc_t * dsc); -extern void lv_argb8888_blend_normal_to_xrgb8888_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_with_mask_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - lv_argb8888_blend_normal_to_rgb888_with_mask_helium(&asm_dsc); - } - else { - lv_argb8888_blend_normal_to_xrgb8888_with_mask_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_helium(asm_dsc_t * dsc); -extern void lv_argb8888_blend_normal_to_xrgb8888_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_helium(&asm_dsc); - } - else { - lv_argb8888_blend_normal_to_xrgb8888_mix_mask_opa_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_color_blend_to_argb8888_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_argb8888_helium(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - - lv_color_blend_to_argb8888_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_color_blend_to_argb8888_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_argb8888_with_opa_helium(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - lv_color_blend_to_argb8888_with_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_color_blend_to_argb8888_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_argb8888_with_mask_helium(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_color_blend_to_argb8888_with_mask_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_color_blend_to_argb8888_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_argb8888_mix_mask_opa_helium(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_color_blend_to_argb8888_mix_mask_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_argb8888_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_argb8888_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - lv_rgb565_blend_normal_to_argb8888_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_argb8888_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_argb8888_with_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - lv_rgb565_blend_normal_to_argb8888_with_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_argb8888_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_argb8888_with_mask_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_rgb565_blend_normal_to_argb8888_with_mask_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_argb8888_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_argb8888_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_argb8888_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_argb8888_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_argb8888_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_argb8888_with_opa_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_argb8888_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_argb8888_with_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_argb8888_with_opa_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_argb8888_with_opa_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_argb8888_with_mask_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_argb8888_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_argb8888_with_mask_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_argb8888_with_mask_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_argb8888_with_mask_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_helium(asm_dsc_t * dsc); -extern void lv_xrgb8888_blend_normal_to_argb8888_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(src_px_size == 3) { - lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_helium(&asm_dsc); - } - else { - lv_xrgb8888_blend_normal_to_argb8888_mix_mask_opa_helium(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_argb8888_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_argb8888_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - lv_argb8888_blend_normal_to_argb8888_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_argb8888_with_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_argb8888_with_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - lv_argb8888_blend_normal_to_argb8888_with_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_argb8888_with_mask_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_argb8888_with_mask_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_argb8888_blend_normal_to_argb8888_with_mask_helium(&asm_dsc); - return LV_RESULT_OK; -} - -extern void lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_helium(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_helium(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_helium(&asm_dsc); - return LV_RESULT_OK; -} - -#endif /* LV_USE_NATIVE_HELIUM_ASM */ - -#endif /* !defined(__ASSEMBLY__) */ - -#endif /* defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE */ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_BLEND_HELIUM_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend.c b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend.c deleted file mode 100644 index 6f48eba..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend.c +++ /dev/null @@ -1,228 +0,0 @@ -/** - * @file lv_draw_sw_blend.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../../misc/lv_area_private.h" -#include "lv_draw_sw_blend_private.h" -#include "../../lv_draw_private.h" -#include "../lv_draw_sw.h" -#if LV_DRAW_SW_SUPPORT_L8 - #include "lv_draw_sw_blend_to_l8.h" -#endif -#if LV_DRAW_SW_SUPPORT_AL88 - #include "lv_draw_sw_blend_to_al88.h" -#endif -#if LV_DRAW_SW_SUPPORT_RGB565 - #include "lv_draw_sw_blend_to_rgb565.h" -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 - #include "lv_draw_sw_blend_to_argb8888.h" -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 - #include "lv_draw_sw_blend_to_rgb888.h" -#endif -#if LV_DRAW_SW_SUPPORT_I1 - #include "lv_draw_sw_blend_to_i1.h" -#endif -#if LV_USE_DRAW_SW - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_sw_blend(lv_draw_unit_t * draw_unit, const lv_draw_sw_blend_dsc_t * blend_dsc) -{ - /*Do not draw transparent things*/ - if(blend_dsc->opa <= LV_OPA_MIN) return; - if(blend_dsc->mask_buf && blend_dsc->mask_res == LV_DRAW_SW_MASK_RES_TRANSP) return; - - lv_area_t blend_area; - if(!lv_area_intersect(&blend_area, blend_dsc->blend_area, draw_unit->clip_area)) return; - - LV_PROFILER_BEGIN; - lv_layer_t * layer = draw_unit->target_layer; - uint32_t layer_stride_byte = layer->draw_buf->header.stride; - - if(blend_dsc->src_buf == NULL) { - lv_draw_sw_blend_fill_dsc_t fill_dsc; - fill_dsc.dest_w = lv_area_get_width(&blend_area); - fill_dsc.dest_h = lv_area_get_height(&blend_area); - fill_dsc.dest_stride = layer_stride_byte; - fill_dsc.opa = blend_dsc->opa; - fill_dsc.color = blend_dsc->color; - - if(blend_dsc->mask_buf == NULL) fill_dsc.mask_buf = NULL; - else if(blend_dsc->mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) fill_dsc.mask_buf = NULL; - else fill_dsc.mask_buf = blend_dsc->mask_buf; - - - fill_dsc.relative_area = blend_area; - lv_area_move(&fill_dsc.relative_area, -layer->buf_area.x1, -layer->buf_area.y1); - fill_dsc.dest_buf = lv_draw_layer_go_to_xy(layer, blend_area.x1 - layer->buf_area.x1, - blend_area.y1 - layer->buf_area.y1); - if(fill_dsc.mask_buf) { - fill_dsc.mask_stride = blend_dsc->mask_stride == 0 ? lv_area_get_width(blend_dsc->mask_area) : blend_dsc->mask_stride; - fill_dsc.mask_buf += fill_dsc.mask_stride * (blend_area.y1 - blend_dsc->mask_area->y1) + - (blend_area.x1 - blend_dsc->mask_area->x1); - } - - switch(layer->color_format) { -#if LV_DRAW_SW_SUPPORT_RGB565 - case LV_COLOR_FORMAT_RGB565: - lv_draw_sw_blend_color_to_rgb565(&fill_dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 - case LV_COLOR_FORMAT_ARGB8888: - lv_draw_sw_blend_color_to_argb8888(&fill_dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 - case LV_COLOR_FORMAT_RGB888: - lv_draw_sw_blend_color_to_rgb888(&fill_dsc, 3); - break; -#endif -#if LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - lv_draw_sw_blend_color_to_rgb888(&fill_dsc, 4); - break; -#endif -#if LV_DRAW_SW_SUPPORT_L8 - case LV_COLOR_FORMAT_L8: - lv_draw_sw_blend_color_to_l8(&fill_dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_AL88 - case LV_COLOR_FORMAT_AL88: - lv_draw_sw_blend_color_to_al88(&fill_dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_I1 - case LV_COLOR_FORMAT_I1: - lv_draw_sw_blend_color_to_i1(&fill_dsc); - break; -#endif - default: - break; - } - } - else { - if(!lv_area_intersect(&blend_area, &blend_area, blend_dsc->src_area)) { - LV_PROFILER_END; - return; - } - - if(blend_dsc->mask_area && !lv_area_intersect(&blend_area, &blend_area, blend_dsc->mask_area)) { - LV_PROFILER_END; - return; - } - - lv_draw_sw_blend_image_dsc_t image_dsc; - image_dsc.dest_w = lv_area_get_width(&blend_area); - image_dsc.dest_h = lv_area_get_height(&blend_area); - image_dsc.dest_stride = layer_stride_byte; - - image_dsc.opa = blend_dsc->opa; - image_dsc.blend_mode = blend_dsc->blend_mode; - image_dsc.src_stride = blend_dsc->src_stride; - image_dsc.src_color_format = blend_dsc->src_color_format; - - const uint8_t * src_buf = blend_dsc->src_buf; - uint32_t src_px_size = lv_color_format_get_bpp(blend_dsc->src_color_format); - src_buf += image_dsc.src_stride * (blend_area.y1 - blend_dsc->src_area->y1); - src_buf += ((blend_area.x1 - blend_dsc->src_area->x1) * src_px_size) >> 3; - image_dsc.src_buf = src_buf; - - - if(blend_dsc->mask_buf == NULL) image_dsc.mask_buf = NULL; - else if(blend_dsc->mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) image_dsc.mask_buf = NULL; - else image_dsc.mask_buf = blend_dsc->mask_buf; - - if(image_dsc.mask_buf) { - image_dsc.mask_buf = blend_dsc->mask_buf; - image_dsc.mask_stride = blend_dsc->mask_stride ? blend_dsc->mask_stride : lv_area_get_width(blend_dsc->mask_area); - image_dsc.mask_buf += image_dsc.mask_stride * (blend_area.y1 - blend_dsc->mask_area->y1) + - (blend_area.x1 - blend_dsc->mask_area->x1); - } - - image_dsc.relative_area = blend_area; - lv_area_move(&image_dsc.relative_area, -layer->buf_area.x1, -layer->buf_area.y1); - - image_dsc.src_area = *blend_dsc->src_area; - lv_area_move(&image_dsc.src_area, -layer->buf_area.x1, -layer->buf_area.y1); - - image_dsc.dest_buf = lv_draw_layer_go_to_xy(layer, blend_area.x1 - layer->buf_area.x1, - blend_area.y1 - layer->buf_area.y1); - - switch(layer->color_format) { -#if LV_DRAW_SW_SUPPORT_RGB565 - case LV_COLOR_FORMAT_RGB565: - case LV_COLOR_FORMAT_RGB565A8: - lv_draw_sw_blend_image_to_rgb565(&image_dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 - case LV_COLOR_FORMAT_ARGB8888: - lv_draw_sw_blend_image_to_argb8888(&image_dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 - case LV_COLOR_FORMAT_RGB888: - lv_draw_sw_blend_image_to_rgb888(&image_dsc, 3); - break; -#endif -#if LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - lv_draw_sw_blend_image_to_rgb888(&image_dsc, 4); - break; -#endif -#if LV_DRAW_SW_SUPPORT_L8 - case LV_COLOR_FORMAT_L8: - lv_draw_sw_blend_image_to_l8(&image_dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_AL88 - case LV_COLOR_FORMAT_AL88: - lv_draw_sw_blend_image_to_al88(&image_dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_I1 - case LV_COLOR_FORMAT_I1: - lv_draw_sw_blend_image_to_i1(&image_dsc); - break; -#endif - default: - break; - } - } - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend.h b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend.h deleted file mode 100644 index 1528cac..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file lv_draw_sw_blend.h - * - */ - -#ifndef LV_DRAW_SW_BLEND_H -#define LV_DRAW_SW_BLEND_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_draw_sw_mask.h" -#if LV_USE_DRAW_SW - -#include "../../../misc/lv_color.h" -#include "../../../misc/lv_area.h" -#include "../../../misc/lv_style.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Call the blend function of the `layer`. - * @param draw_unit pointer to a draw unit - * @param dsc pointer to an initialized blend descriptor - */ -void lv_draw_sw_blend(lv_draw_unit_t * draw_unit, const lv_draw_sw_blend_dsc_t * dsc); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_SW*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_BLEND_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_private.h b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_private.h deleted file mode 100644 index 532f4c9..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_private.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @file lv_draw_sw_blend_private.h - * - */ - -#ifndef LV_DRAW_SW_BLEND_PRIVATE_H -#define LV_DRAW_SW_BLEND_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_sw_blend.h" - -#if LV_USE_DRAW_SW - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_draw_sw_blend_dsc_t { - const lv_area_t * blend_area; /**< The area with absolute coordinates to draw on `layer->buf` - * will be clipped to `layer->clip_area` */ - const void * src_buf; /**< Pointer to an image to blend. If set `fill_color` is ignored */ - uint32_t src_stride; - lv_color_format_t src_color_format; - const lv_area_t * src_area; - lv_opa_t opa; /**< The overall opacity*/ - lv_color_t color; /**< Fill color*/ - const lv_opa_t * mask_buf; /**< NULL if ignored, or an alpha mask to apply on `blend_area`*/ - lv_draw_sw_mask_res_t mask_res; /**< The result of the previous mask operation */ - const lv_area_t * mask_area; /**< The area of `mask_buf` with absolute coordinates*/ - int32_t mask_stride; - lv_blend_mode_t blend_mode; /**< E.g. LV_BLEND_MODE_ADDITIVE*/ -}; - -struct lv_draw_sw_blend_fill_dsc_t { - void * dest_buf; - int32_t dest_w; - int32_t dest_h; - int32_t dest_stride; - const lv_opa_t * mask_buf; - int32_t mask_stride; - lv_color_t color; - lv_opa_t opa; - lv_area_t relative_area; -}; - -struct lv_draw_sw_blend_image_dsc_t { - void * dest_buf; - int32_t dest_w; - int32_t dest_h; - int32_t dest_stride; - const lv_opa_t * mask_buf; - int32_t mask_stride; - const void * src_buf; - int32_t src_stride; - lv_color_format_t src_color_format; - lv_opa_t opa; - lv_blend_mode_t blend_mode; - lv_area_t relative_area; /**< The blend area relative to the layer's buffer area. */ - lv_area_t src_area; /**< The original src area. */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_DRAW_SW */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_BLEND_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_al88.c b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_al88.c deleted file mode 100644 index 9c3194c..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_al88.c +++ /dev/null @@ -1,1036 +0,0 @@ -/** - * @file lv_draw_sw_blend_al88.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_sw_blend_to_al88.h" -#if LV_USE_DRAW_SW - -#if LV_DRAW_SW_SUPPORT_AL88 - -#include "lv_draw_sw_blend_private.h" -#include "../../../misc/lv_math.h" -#include "../../../display/lv_display.h" -#include "../../../core/lv_refr.h" -#include "../../../misc/lv_color.h" -#include "../../../stdlib/lv_string.h" - -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON - #include "neon/lv_blend_neon.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM - #include "helium/lv_blend_helium.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM - #include LV_DRAW_SW_ASM_CUSTOM_INCLUDE -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - lv_color16a_t fg_saved; - lv_color16a_t bg_saved; - lv_color16a_t res_saved; - lv_opa_t res_alpha_saved; - lv_opa_t ratio_saved; -} lv_color_mix_alpha_cache_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -#if LV_DRAW_SW_SUPPORT_L8 - static void /* LV_ATTRIBUTE_FAST_MEM */ l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -#if LV_DRAW_SW_SUPPORT_I1 - static void /* LV_ATTRIBUTE_FAST_MEM */ i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); - - static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, int32_t bit_idx); -#endif - -static void /* LV_ATTRIBUTE_FAST_MEM */ al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); - -#if LV_DRAW_SW_SUPPORT_RGB565 - static void /* LV_ATTRIBUTE_FAST_MEM */ rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -#if LV_DRAW_SW_SUPPORT_RGB888 -static void /* LV_ATTRIBUTE_FAST_MEM */ rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, - const uint8_t src_px_size); -#endif - -#if LV_DRAW_SW_SUPPORT_ARGB8888 - static void /* LV_ATTRIBUTE_FAST_MEM */ argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -static void lv_color_mix_with_alpha_cache_init(lv_color_mix_alpha_cache_t * cache); - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ blend_non_normal_pixel(lv_color16a_t * dest, lv_color16a_t src, - lv_blend_mode_t mode, lv_color_mix_alpha_cache_t * cache); - -static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * buf, uint32_t stride); - -static inline bool lv_color16a_eq(lv_color16a_t c1, lv_color16a_t c2); - -static inline lv_color16a_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color_mix16a(lv_color16a_t fg, lv_color16a_t bg); - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ lv_color_16a_16a_mix(lv_color16a_t src, lv_color16a_t * dest, - lv_color_mix_alpha_cache_t * cache); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_AL88 - #define LV_DRAW_SW_COLOR_BLEND_TO_AL88(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_AL88_WITH_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_AL88_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_AL88_WITH_MASK - #define LV_DRAW_SW_COLOR_BLEND_TO_AL88_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_AL88_MIX_MASK_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_AL88_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88 - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88_WITH_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88_WITH_MASK - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88 - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88_WITH_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88_WITH_MASK - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88 - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88_WITH_OPA - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88_WITH_MASK - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88 - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_WITH_OPA - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_WITH_MASK - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88 - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_MASK - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_color_to_al88(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - const lv_opa_t * mask = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - int32_t dest_stride = dsc->dest_stride; - - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - - int32_t x; - int32_t y; - - LV_UNUSED(w); - LV_UNUSED(h); - LV_UNUSED(x); - LV_UNUSED(y); - LV_UNUSED(opa); - LV_UNUSED(mask); - LV_UNUSED(mask_stride); - LV_UNUSED(dest_stride); - - /*Simple fill*/ - if(mask == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_AL88(dsc)) { - lv_color16a_t color16a; - color16a.lumi = lv_color_luminance(dsc->color); - color16a.alpha = 255; - lv_color16a_t * dest_buf = dsc->dest_buf; - for(y = 0; y < h; y++) { - for(x = 0; x < w - 16; x += 16) { - dest_buf[x + 0] = color16a; - dest_buf[x + 1] = color16a; - dest_buf[x + 2] = color16a; - dest_buf[x + 3] = color16a; - - dest_buf[x + 4] = color16a; - dest_buf[x + 5] = color16a; - dest_buf[x + 6] = color16a; - dest_buf[x + 7] = color16a; - - dest_buf[x + 8] = color16a; - dest_buf[x + 9] = color16a; - dest_buf[x + 10] = color16a; - dest_buf[x + 11] = color16a; - - dest_buf[x + 12] = color16a; - dest_buf[x + 13] = color16a; - dest_buf[x + 14] = color16a; - dest_buf[x + 15] = color16a; - } - for(; x < w; x ++) { - dest_buf[x] = color16a; - } - - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - } - } - } - /*Opacity only*/ - else if(mask == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_AL88_WITH_OPA(dsc)) { - lv_color16a_t color16a; - color16a.lumi = lv_color_luminance(dsc->color); - color16a.alpha = opa; - lv_color16a_t * dest_buf = dsc->dest_buf; - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color_16a_16a_mix(color16a, &dest_buf[x], &cache); - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - } - } - - } - /*Masked with full opacity*/ - else if(mask && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_AL88_WITH_MASK(dsc)) { - lv_color16a_t color16a; - color16a.lumi = lv_color_luminance(dsc->color); - lv_color16a_t * dest_buf = (lv_color16a_t *)dsc->dest_buf; - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - color16a.alpha = mask[x]; - lv_color_16a_16a_mix(color16a, &dest_buf[x], &cache); - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - mask += mask_stride; - } - } - - } - /*Masked with opacity*/ - else { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_AL88_MIX_MASK_OPA(dsc)) { - lv_color16a_t color16a; - color16a.lumi = lv_color_luminance(dsc->color); - lv_color16a_t * dest_buf = (lv_color16a_t *)dsc->dest_buf; - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - color16a.alpha = LV_OPA_MIX2(mask[x], opa); - lv_color_16a_16a_mix(color16a, &dest_buf[x], &cache); - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - mask += mask_stride; - } - } - } -} - -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_al88(lv_draw_sw_blend_image_dsc_t * dsc) -{ - switch(dsc->src_color_format) { -#if LV_DRAW_SW_SUPPORT_RGB565 - case LV_COLOR_FORMAT_RGB565: - rgb565_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 - case LV_COLOR_FORMAT_RGB888: - rgb888_image_blend(dsc, 3); - break; -#endif -#if LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - rgb888_image_blend(dsc, 4); - break; -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 - case LV_COLOR_FORMAT_ARGB8888: - argb8888_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_L8 - case LV_COLOR_FORMAT_L8: - l8_image_blend(dsc); - break; -#endif - case LV_COLOR_FORMAT_AL88: - al88_image_blend(dsc); - break; -#if LV_DRAW_SW_SUPPORT_I1 - case LV_COLOR_FORMAT_I1: - i1_image_blend(dsc); - break; -#endif - default: - LV_LOG_WARN("Not supported source color format"); - break; - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ -#if LV_DRAW_SW_SUPPORT_I1 -static void LV_ATTRIBUTE_FAST_MEM i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color16a_t * dest_buf_al88 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_i1 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - - int32_t x, y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - dest_buf_al88[x].lumi = get_bit(src_buf_i1, x) * 255; - dest_buf_al88[x].alpha = 255; - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = get_bit(src_buf_i1, x) * 255; - src_color.alpha = opa; - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = get_bit(src_buf_i1, x) * 255; - src_color.alpha = mask_buf[x]; - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = get_bit(src_buf_i1, x) * 255; - src_color.alpha = LV_OPA_MIX2(mask_buf[x], opa); - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - else { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = get_bit(src_buf_i1, x) * 255; - if(mask_buf == NULL) src_color.alpha = opa; - else src_color.alpha = LV_OPA_MIX2(mask_buf[x], opa); - blend_non_normal_pixel(&dest_buf_al88[x], src_color, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } -} -#endif - -#if LV_DRAW_SW_SUPPORT_L8 -static void LV_ATTRIBUTE_FAST_MEM l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color16a_t * dest_buf_al88 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_l8 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - - int32_t x, y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - dest_buf_al88[x].lumi = src_buf_l8[x]; - dest_buf_al88[x].alpha = 255; - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = src_buf_l8[x]; - src_color.alpha = opa; - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = src_buf_l8[x]; - src_color.alpha = mask_buf[x]; - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = src_buf_l8[x]; - src_color.alpha = LV_OPA_MIX2(mask_buf[x], opa); - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = src_buf_l8[x]; - if(mask_buf == NULL) src_color.alpha = opa; - else src_color.alpha = LV_OPA_MIX2(mask_buf[x], opa); - blend_non_normal_pixel(&dest_buf_al88[x], src_color, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } -} - -#endif - -static void LV_ATTRIBUTE_FAST_MEM al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color16a_t * dest_buf_al88 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color16a_t * src_buf_al88 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - - int32_t x, y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color_16a_16a_mix(src_buf_al88[x], &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color = src_buf_al88[x]; - src_color.alpha = LV_OPA_MIX2(src_color.alpha, opa); - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color = src_buf_al88[x]; - src_color.alpha = LV_OPA_MIX2(src_color.alpha, mask_buf[x]); - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color = src_buf_al88[x]; - src_color.alpha = LV_OPA_MIX3(src_color.alpha, mask_buf[x], opa); - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color = src_buf_al88[x]; - if(mask_buf == NULL) src_color.alpha = LV_OPA_MIX2(src_color.alpha, opa); - else src_color.alpha = LV_OPA_MIX3(src_color.alpha, mask_buf[x], opa); - blend_non_normal_pixel(&dest_buf_al88[x], src_color, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } -} - -#if LV_DRAW_SW_SUPPORT_RGB565 - -static void LV_ATTRIBUTE_FAST_MEM rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color16a_t * dest_buf_al88 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color16_t * src_buf_c16 = (const lv_color16_t *)dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - - int32_t x, y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - dest_buf_al88[x].lumi = lv_color16_luminance(src_buf_c16[x]); - dest_buf_al88[x].alpha = 255; - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88_WITH_OPA(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = lv_color16_luminance(src_buf_c16[x]); - src_color.alpha = opa; - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88_WITH_MASK(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = lv_color16_luminance(src_buf_c16[x]); - src_color.alpha = mask_buf[x]; - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - mask_buf += mask_stride; - } - } - } - else { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = lv_color16_luminance(src_buf_c16[x]); - src_color.alpha = LV_OPA_MIX2(mask_buf[x], opa); - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = lv_color16_luminance(src_buf_c16[x]); - if(mask_buf == NULL) src_color.alpha = opa; - else src_color.alpha = LV_OPA_MIX2(mask_buf[x], opa); - blend_non_normal_pixel(&dest_buf_al88[x], src_color, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_RGB888 - -static void LV_ATTRIBUTE_FAST_MEM rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, - const uint8_t src_px_size) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color16a_t * dest_buf_al88 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_u8 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - /*Special case*/ - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88(dsc, src_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - dest_buf_al88[dest_x].lumi = lv_color24_luminance(&src_buf_u8[src_x]); - dest_buf_al88[dest_x].alpha = 255; - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_u8 += src_stride; - } - } - } - if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88_WITH_OPA(dsc, dest_px_size, src_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - lv_color16a_t src_color; - src_color.lumi = lv_color24_luminance(&src_buf_u8[src_x]); - src_color.alpha = opa; - lv_color_16a_16a_mix(src_color, &dest_buf_al88[dest_x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_u8 += src_stride; - } - } - } - if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88_WITH_MASK(dsc, dest_px_size, src_px_size)) { - uint32_t mask_x; - for(y = 0; y < h; y++) { - for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x++, src_x += src_px_size) { - lv_color16a_t src_color; - src_color.lumi = lv_color24_luminance(&src_buf_u8[src_x]); - src_color.alpha = mask_buf[mask_x]; - lv_color_16a_16a_mix(src_color, &dest_buf_al88[dest_x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_u8 += src_stride; - mask_buf += mask_stride; - } - } - } - if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(dsc, dest_px_size, src_px_size)) { - uint32_t mask_x; - for(y = 0; y < h; y++) { - for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x++, src_x += src_px_size) { - lv_color16a_t src_color; - src_color.lumi = lv_color24_luminance(&src_buf_u8[src_x]); - src_color.alpha = LV_OPA_MIX2(mask_buf[mask_x], opa); - lv_color_16a_16a_mix(src_color, &dest_buf_al88[dest_x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_u8 += src_stride; - mask_buf += mask_stride; - } - } - } - } - else { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - lv_color16a_t src_color; - src_color.lumi = lv_color24_luminance(&src_buf_u8[src_x]); - if(mask_buf == NULL) src_color.alpha = opa; - else src_color.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - - blend_non_normal_pixel(&dest_buf_al88[dest_x], src_color, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_u8 += src_stride; - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_ARGB8888 - -static void LV_ATTRIBUTE_FAST_MEM argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color16a_t * dest_buf_al88 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color32_t * src_buf_c32 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - - int32_t x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = lv_color32_luminance(src_buf_c32[x]); - src_color.alpha = src_buf_c32[x].alpha; - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = lv_color32_luminance(src_buf_c32[x]); - src_color.alpha = LV_OPA_MIX2(src_buf_c32[x].alpha, opa); - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = lv_color32_luminance(src_buf_c32[x]); - src_color.alpha = LV_OPA_MIX2(src_buf_c32[x].alpha, mask_buf[x]); - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_AL88_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = lv_color32_luminance(src_buf_c32[x]); - src_color.alpha = LV_OPA_MIX3(src_buf_c32[x].alpha, mask_buf[x], opa); - lv_color_16a_16a_mix(src_color, &dest_buf_al88[x], &cache); - } - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color16a_t src_color; - src_color.lumi = lv_color32_luminance(src_buf_c32[x]); - src_color.alpha = src_buf_c32[x].alpha; - if(mask_buf == NULL) src_color.alpha = LV_OPA_MIX2(src_color.alpha, opa); - else src_color.alpha = LV_OPA_MIX3(src_color.alpha, mask_buf[x], opa); - blend_non_normal_pixel(&dest_buf_al88[x], src_color, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_al88 = drawbuf_next_row(dest_buf_al88, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } -} - -#endif - -/** - * Check if two AL88 colors are equal - * @param c1 the first color - * @param c2 the second color - * @return true: equal - */ -static inline bool lv_color16a_eq(lv_color16a_t c1, lv_color16a_t c2) -{ - return *((uint16_t *)&c1) == *((uint16_t *)&c2); -} - -static inline lv_color16a_t LV_ATTRIBUTE_FAST_MEM lv_color_mix16a(lv_color16a_t fg, lv_color16a_t bg) -{ -#if 0 - if(fg.alpha >= LV_OPA_MAX) { - fg.alpha = bg.alpha; - return fg; - } - if(fg.alpha <= LV_OPA_MIN) { - return bg; - } -#endif - bg.lumi = (uint32_t)((uint32_t)fg.lumi * fg.alpha + (uint32_t)bg.lumi * (255 - fg.alpha)) >> 8; - return bg; -} - -static inline void LV_ATTRIBUTE_FAST_MEM lv_color_16a_16a_mix(lv_color16a_t fg, lv_color16a_t * bg, - lv_color_mix_alpha_cache_t * cache) -{ - /*Pick the foreground if it's fully opaque or the Background is fully transparent*/ - if(fg.alpha >= LV_OPA_MAX || bg->alpha <= LV_OPA_MIN) { - *bg = fg; - } - /*Transparent foreground: use the Background*/ - else if(fg.alpha <= LV_OPA_MIN) { - /* no need to copy */ - } - /*Opaque background: use simple mix*/ - else if(bg->alpha == 255) { - *bg = lv_color_mix16a(fg, *bg); - } - /*Both colors have alpha. Expensive calculation needs to be applied*/ - else { - /*Save the parameters and the result. If they will be asked again don't compute again*/ - - /*Update the ratio and the result alpha value if the input alpha values change*/ - if(bg->alpha != cache->bg_saved.alpha || fg.alpha != cache->fg_saved.alpha) { - /*Info: - * https://en.wikipedia.org/wiki/Alpha_compositing#Analytical_derivation_of_the_over_operator*/ - cache->res_alpha_saved = 255 - LV_OPA_MIX2(255 - fg.alpha, 255 - bg->alpha); - LV_ASSERT(cache->res_alpha_saved != 0); - cache->ratio_saved = (uint32_t)((uint32_t)fg.alpha * 255) / cache->res_alpha_saved; - } - - if(!lv_color16a_eq(*bg, cache->bg_saved) || !lv_color16a_eq(fg, cache->fg_saved)) { - cache->fg_saved = fg; - cache->bg_saved = *bg; - fg.alpha = cache->ratio_saved; - cache->res_saved = lv_color_mix16a(fg, *bg); - cache->res_saved.alpha = cache->res_alpha_saved; - } - - *bg = cache->res_saved; - } -} - -void lv_color_mix_with_alpha_cache_init(lv_color_mix_alpha_cache_t * cache) -{ - lv_memzero(&cache->fg_saved, sizeof(lv_color16a_t)); - lv_memzero(&cache->bg_saved, sizeof(lv_color16a_t)); - lv_memzero(&cache->res_saved, sizeof(lv_color16a_t)); - cache->res_alpha_saved = 255; - cache->ratio_saved = 255; -} - -#if LV_DRAW_SW_SUPPORT_I1 - -static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t bit_idx) -{ - return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1; -} - -#endif - -static inline void LV_ATTRIBUTE_FAST_MEM blend_non_normal_pixel(lv_color16a_t * dest, lv_color16a_t src, - lv_blend_mode_t mode, lv_color_mix_alpha_cache_t * cache) -{ - lv_color16a_t res; - switch(mode) { - case LV_BLEND_MODE_ADDITIVE: - res.lumi = LV_MIN(dest->lumi + src.lumi, 255); - break; - case LV_BLEND_MODE_SUBTRACTIVE: - res.lumi = LV_MAX(dest->lumi - src.lumi, 0); - break; - case LV_BLEND_MODE_MULTIPLY: - res.lumi = (dest->lumi * src.lumi) >> 8; - break; - default: - LV_LOG_WARN("Not supported blend mode: %d", mode); - return; - } - res.alpha = src.alpha; - lv_color_16a_16a_mix(res, dest, cache); -} - -static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, uint32_t stride) -{ - return (void *)((uint8_t *)buf + stride); -} - -#endif - -#endif diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_al88.h b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_al88.h deleted file mode 100644 index b83523b..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_al88.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @file lv_draw_sw_blend_to_al88.h - * - */ - -#ifndef LV_DRAW_SW_BLEND_TO_AL88_H -#define LV_DRAW_SW_BLEND_TO_AL88_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_draw_sw.h" -#if LV_USE_DRAW_SW - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_color_to_al88(lv_draw_sw_blend_fill_dsc_t * dsc); - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_image_to_al88(lv_draw_sw_blend_image_dsc_t * dsc); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_SW*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_BLEND_TO_AL88_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c deleted file mode 100644 index 4bf3ef4..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c +++ /dev/null @@ -1,1064 +0,0 @@ -/** - * @file lv_draw_sw_blend.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_sw_blend_to_argb8888.h" -#if LV_USE_DRAW_SW - -#if LV_DRAW_SW_SUPPORT_ARGB8888 - -#include "lv_draw_sw_blend_private.h" -#include "../../../misc/lv_math.h" -#include "../../../display/lv_display.h" -#include "../../../core/lv_refr.h" -#include "../../../misc/lv_color.h" -#include "../../../stdlib/lv_string.h" - -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON - #include "neon/lv_blend_neon.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM - #include "helium/lv_blend_helium.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM - #include LV_DRAW_SW_ASM_CUSTOM_INCLUDE -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - lv_color32_t fg_saved; - lv_color32_t bg_saved; - lv_color32_t res_saved; - lv_opa_t res_alpha_saved; - lv_opa_t ratio_saved; -} lv_color_mix_alpha_cache_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -#if LV_DRAW_SW_SUPPORT_AL88 - static void /* LV_ATTRIBUTE_FAST_MEM */ al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -#if LV_DRAW_SW_SUPPORT_I1 - static void /* LV_ATTRIBUTE_FAST_MEM */ i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); - - static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, int32_t bit_idx); -#endif - -#if LV_DRAW_SW_SUPPORT_L8 - static void /* LV_ATTRIBUTE_FAST_MEM */ l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -#if LV_DRAW_SW_SUPPORT_RGB565 - static void /* LV_ATTRIBUTE_FAST_MEM */ rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -#if LV_DRAW_SW_SUPPORT_RGB888 -static void /* LV_ATTRIBUTE_FAST_MEM */ rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, - const uint8_t src_px_size); -#endif - -static void /* LV_ATTRIBUTE_FAST_MEM */ argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ lv_color_8_32_mix(const uint8_t src, lv_color32_t * dest, uint8_t mix); - -static inline lv_color32_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color_32_32_mix(lv_color32_t fg, lv_color32_t bg, - lv_color_mix_alpha_cache_t * cache); - -static void lv_color_mix_with_alpha_cache_init(lv_color_mix_alpha_cache_t * cache); - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ blend_non_normal_pixel(lv_color32_t * dest, lv_color32_t src, - lv_blend_mode_t mode, lv_color_mix_alpha_cache_t * cache); -static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * buf, uint32_t stride); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888 - #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK - #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888 - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888_WITH_OPA - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888_WITH_MASK - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888 - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888_WITH_OPA - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888_WITH_MASK - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888 - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888 - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888 - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888 - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_MASK - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_color_to_argb8888(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - const lv_opa_t * mask = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - int32_t dest_stride = dsc->dest_stride; - - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - - int32_t x; - int32_t y; - - LV_UNUSED(w); - LV_UNUSED(h); - LV_UNUSED(x); - LV_UNUSED(y); - LV_UNUSED(opa); - LV_UNUSED(mask); - LV_UNUSED(mask_stride); - LV_UNUSED(dest_stride); - - /*Simple fill*/ - if(mask == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888(dsc)) { - uint32_t color32 = lv_color_to_u32(dsc->color); - uint32_t * dest_buf = dsc->dest_buf; - for(y = 0; y < h; y++) { - for(x = 0; x < w - 16; x += 16) { - dest_buf[x + 0] = color32; - dest_buf[x + 1] = color32; - dest_buf[x + 2] = color32; - dest_buf[x + 3] = color32; - - dest_buf[x + 4] = color32; - dest_buf[x + 5] = color32; - dest_buf[x + 6] = color32; - dest_buf[x + 7] = color32; - - dest_buf[x + 8] = color32; - dest_buf[x + 9] = color32; - dest_buf[x + 10] = color32; - dest_buf[x + 11] = color32; - - dest_buf[x + 12] = color32; - dest_buf[x + 13] = color32; - dest_buf[x + 14] = color32; - dest_buf[x + 15] = color32; - } - for(; x < w; x ++) { - dest_buf[x] = color32; - } - - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - } - } - - } - /*Opacity only*/ - else if(mask == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA(dsc)) { - lv_color32_t color_argb = lv_color_to_32(dsc->color, opa); - lv_color32_t * dest_buf = dsc->dest_buf; - - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - dest_buf[x] = lv_color_32_32_mix(color_argb, dest_buf[x], &cache); - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - } - } - - } - /*Masked with full opacity*/ - else if(mask && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK(dsc)) { - lv_color32_t color_argb = lv_color_to_32(dsc->color, 0xff); - lv_color32_t * dest_buf = dsc->dest_buf; - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - color_argb.alpha = mask[x]; - dest_buf[x] = lv_color_32_32_mix(color_argb, dest_buf[x], &cache); - } - - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - mask += mask_stride; - } - } - - } - /*Masked with opacity*/ - else { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA(dsc)) { - lv_color32_t color_argb = lv_color_to_32(dsc->color, opa); - lv_color32_t * dest_buf = dsc->dest_buf; - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - color_argb.alpha = LV_OPA_MIX2(mask[x], opa); - dest_buf[x] = lv_color_32_32_mix(color_argb, dest_buf[x], &cache); - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - mask += mask_stride; - } - } - } -} - -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_argb8888(lv_draw_sw_blend_image_dsc_t * dsc) -{ - switch(dsc->src_color_format) { -#if LV_DRAW_SW_SUPPORT_RGB565 - case LV_COLOR_FORMAT_RGB565: - rgb565_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 - case LV_COLOR_FORMAT_RGB888: - rgb888_image_blend(dsc, 3); - break; -#endif -#if LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - rgb888_image_blend(dsc, 4); - break; -#endif - case LV_COLOR_FORMAT_ARGB8888: - argb8888_image_blend(dsc); - break; -#if LV_DRAW_SW_SUPPORT_L8 - case LV_COLOR_FORMAT_L8: - l8_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_AL88 - case LV_COLOR_FORMAT_AL88: - al88_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_I1 - case LV_COLOR_FORMAT_I1: - i1_image_blend(dsc); - break; -#endif - default: - LV_LOG_WARN("Not supported source color format"); - break; - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#if LV_DRAW_SW_SUPPORT_I1 -static void LV_ATTRIBUTE_FAST_MEM i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color32_t * dest_buf_c32 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_i1 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - dest_buf_c32[dest_x].alpha = chan_val; - dest_buf_c32[dest_x].red = chan_val; - dest_buf_c32[dest_x].green = chan_val; - dest_buf_c32[dest_x].blue = chan_val; - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - lv_color_8_32_mix(chan_val, &dest_buf_c32[dest_x], opa); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - lv_color_8_32_mix(chan_val, &dest_buf_c32[dest_x], mask_buf[src_x]); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - lv_color_8_32_mix(chan_val, &dest_buf_c32[dest_x], LV_OPA_MIX2(mask_buf[src_x], opa)); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - src_argb.red = get_bit(src_buf_i1, src_x) * 255; - src_argb.green = src_argb.red; - src_argb.blue = src_argb.red; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - blend_non_normal_pixel(&dest_buf_c32[dest_x], src_argb, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } -} -#endif - -#if LV_DRAW_SW_SUPPORT_AL88 -static void LV_ATTRIBUTE_FAST_MEM al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color32_t * dest_buf_c32 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color16a_t * src_buf_al88 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - /* - dest_buf_c32[dest_x].alpha = src_buf_al88[src_x].alpha; - dest_buf_c32[dest_x].red = src_buf_al88[src_x].lumi; - dest_buf_c32[dest_x].green = src_buf_al88[src_x].lumi; - dest_buf_c32[dest_x].blue = src_buf_al88[src_x].lumi; - */ - lv_color_8_32_mix(src_buf_al88[src_x].lumi, &dest_buf_c32[dest_x], src_buf_al88[src_x].alpha); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_32_mix(src_buf_al88[src_x].lumi, &dest_buf_c32[dest_x], LV_OPA_MIX2(src_buf_al88[src_x].alpha, opa)); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_32_mix(src_buf_al88[src_x].lumi, &dest_buf_c32[dest_x], LV_OPA_MIX2(src_buf_al88[src_x].alpha, - mask_buf[src_x])); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_32_mix(src_buf_al88[src_x].lumi, &dest_buf_c32[dest_x], LV_OPA_MIX3(src_buf_al88[src_x].alpha, - mask_buf[src_x], opa)); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - src_argb.red = src_buf_al88[src_x].lumi; - src_argb.green = src_buf_al88[src_x].lumi; - src_argb.blue = src_buf_al88[src_x].lumi; - if(mask_buf == NULL) src_argb.alpha = LV_OPA_MIX2(src_buf_al88[src_x].alpha, opa); - else src_argb.alpha = LV_OPA_MIX3(src_buf_al88[src_x].alpha, mask_buf[dest_x], opa); - blend_non_normal_pixel(&dest_buf_c32[dest_x], src_argb, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_L8 - -static void LV_ATTRIBUTE_FAST_MEM l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color32_t * dest_buf_c32 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_l8 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - dest_buf_c32[dest_x].alpha = src_buf_l8[src_x]; - dest_buf_c32[dest_x].red = src_buf_l8[src_x]; - dest_buf_c32[dest_x].green = src_buf_l8[src_x]; - dest_buf_c32[dest_x].blue = src_buf_l8[src_x]; - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_32_mix(src_buf_l8[src_x], &dest_buf_c32[dest_x], opa); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_32_mix(src_buf_l8[src_x], &dest_buf_c32[dest_x], mask_buf[src_x]); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_32_mix(src_buf_l8[src_x], &dest_buf_c32[dest_x], LV_OPA_MIX2(mask_buf[src_x], opa)); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - src_argb.red = src_buf_l8[src_x]; - src_argb.green = src_buf_l8[src_x]; - src_argb.blue = src_buf_l8[src_x]; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - blend_non_normal_pixel(&dest_buf_c32[dest_x], src_argb, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_RGB565 - -static void LV_ATTRIBUTE_FAST_MEM rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color32_t * dest_buf_c32 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color16_t * src_buf_c16 = (const lv_color16_t *) dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - lv_color32_t color_argb; - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - - int32_t x; - int32_t y; - - LV_UNUSED(color_argb); - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL) { - lv_result_t accelerated; - if(opa >= LV_OPA_MAX) { - accelerated = LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888(dsc); - } - else { - accelerated = LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc); - } - if(LV_RESULT_INVALID == accelerated) { - color_argb.alpha = opa; - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - color_argb.red = (src_buf_c16[x].red * 2106) >> 8; /*To make it rounded*/ - color_argb.green = (src_buf_c16[x].green * 1037) >> 8; - color_argb.blue = (src_buf_c16[x].blue * 2106) >> 8; - dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - color_argb.alpha = mask_buf[x]; - color_argb.red = (src_buf_c16[x].red * 2106) >> 8; /*To make it rounded*/ - color_argb.green = (src_buf_c16[x].green * 1037) >> 8; - color_argb.blue = (src_buf_c16[x].blue * 2106) >> 8; - dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - mask_buf += mask_stride; - } - } - } - else { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - color_argb.alpha = LV_OPA_MIX2(mask_buf[x], opa); - color_argb.red = (src_buf_c16[x].red * 2106) >> 8; /*To make it rounded*/ - color_argb.green = (src_buf_c16[x].green * 1037) >> 8; - color_argb.blue = (src_buf_c16[x].blue * 2106) >> 8; - dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - src_argb.red = (src_buf_c16[x].red * 2106) >> 8; - src_argb.green = (src_buf_c16[x].green * 1037) >> 8; - src_argb.blue = (src_buf_c16[x].blue * 2106) >> 8; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[x], opa); - blend_non_normal_pixel(&dest_buf_c32[x], src_argb, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_RGB888 - -static void LV_ATTRIBUTE_FAST_MEM rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, const uint8_t src_px_size) -{ - - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color32_t * dest_buf_c32 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - lv_color32_t color_argb; - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - - int32_t dest_x; - int32_t src_x; - int32_t y; - - LV_UNUSED(color_argb); - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - /*Special case*/ - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888(dsc, src_px_size)) { - if(src_px_size == 4) { - uint32_t line_in_bytes = w * 4; - for(y = 0; y < h; y++) { - lv_memcpy(dest_buf_c32, src_buf, line_in_bytes); - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf = drawbuf_next_row(src_buf, src_stride); - } - } - else if(src_px_size == 3) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 3) { - dest_buf_c32[dest_x].red = src_buf[src_x + 2]; - dest_buf_c32[dest_x].green = src_buf[src_x + 1]; - dest_buf_c32[dest_x].blue = src_buf[src_x + 0]; - dest_buf_c32[dest_x].alpha = 0xff; - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf = drawbuf_next_row(src_buf, src_stride); - } - } - } - - } - if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc, src_px_size)) { - color_argb.alpha = opa; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - color_argb.red = src_buf[src_x + 2]; - color_argb.green = src_buf[src_x + 1]; - color_argb.blue = src_buf[src_x + 0]; - dest_buf_c32[dest_x] = lv_color_32_32_mix(color_argb, dest_buf_c32[dest_x], &cache); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf = drawbuf_next_row(src_buf, src_stride); - } - } - - } - if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc, src_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - color_argb.alpha = mask_buf[dest_x]; - color_argb.red = src_buf[src_x + 2]; - color_argb.green = src_buf[src_x + 1]; - color_argb.blue = src_buf[src_x + 0]; - dest_buf_c32[dest_x] = lv_color_32_32_mix(color_argb, dest_buf_c32[dest_x], &cache); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf = drawbuf_next_row(src_buf, src_stride); - mask_buf += mask_stride; - } - } - } - if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc, src_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - color_argb.alpha = (opa * mask_buf[dest_x]) >> 8; - color_argb.red = src_buf[src_x + 2]; - color_argb.green = src_buf[src_x + 1]; - color_argb.blue = src_buf[src_x + 0]; - dest_buf_c32[dest_x] = lv_color_32_32_mix(color_argb, dest_buf_c32[dest_x], &cache); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf = drawbuf_next_row(src_buf, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - src_argb.red = src_buf[src_x + 2]; - src_argb.green = src_buf[src_x + 1]; - src_argb.blue = src_buf[src_x + 0]; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - - blend_non_normal_pixel(&dest_buf_c32[dest_x], src_argb, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf = drawbuf_next_row(src_buf, src_stride); - } - } -} - -#endif - -static void LV_ATTRIBUTE_FAST_MEM argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - lv_color32_t * dest_buf_c32 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color32_t * src_buf_c32 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - lv_color32_t color_argb; - lv_color_mix_alpha_cache_t cache; - lv_color_mix_with_alpha_cache_init(&cache); - - int32_t x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - dest_buf_c32[x] = lv_color_32_32_mix(src_buf_c32[x], dest_buf_c32[x], &cache); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - color_argb = src_buf_c32[x]; - color_argb.alpha = LV_OPA_MIX2(color_argb.alpha, opa); - dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - color_argb = src_buf_c32[x]; - color_argb.alpha = LV_OPA_MIX2(color_argb.alpha, mask_buf[x]); - dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - color_argb = src_buf_c32[x]; - color_argb.alpha = LV_OPA_MIX3(color_argb.alpha, opa, mask_buf[x]); - dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache); - } - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - color_argb = src_buf_c32[x]; - if(mask_buf == NULL) color_argb.alpha = LV_OPA_MIX2(color_argb.alpha, opa); - else color_argb.alpha = LV_OPA_MIX3(color_argb.alpha, mask_buf[x], opa); - blend_non_normal_pixel(&dest_buf_c32[x], color_argb, dsc->blend_mode, &cache); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } -} - -static inline void LV_ATTRIBUTE_FAST_MEM lv_color_8_32_mix(const uint8_t src, lv_color32_t * dest, uint8_t mix) -{ - - if(mix == 0) return; - - dest->alpha = 255; - if(mix >= LV_OPA_MAX) { - dest->red = src; - dest->green = src; - dest->blue = src; - } - else { - lv_opa_t mix_inv = 255 - mix; - dest->red = (uint32_t)((uint32_t)src * mix + dest->red * mix_inv) >> 8; - dest->green = (uint32_t)((uint32_t)src * mix + dest->green * mix_inv) >> 8; - dest->blue = (uint32_t)((uint32_t)src * mix + dest->blue * mix_inv) >> 8; - } -} - -static inline lv_color32_t LV_ATTRIBUTE_FAST_MEM lv_color_32_32_mix(lv_color32_t fg, lv_color32_t bg, - lv_color_mix_alpha_cache_t * cache) -{ - /*Pick the foreground if it's fully opaque or the Background is fully transparent*/ - if(fg.alpha >= LV_OPA_MAX || bg.alpha <= LV_OPA_MIN) { - return fg; - } - /*Transparent foreground: use the Background*/ - else if(fg.alpha <= LV_OPA_MIN) { - return bg; - } - /*Opaque background: use simple mix*/ - else if(bg.alpha == 255) { - return lv_color_mix32(fg, bg); - } - /*Both colors have alpha. Expensive calculation need to be applied*/ - else { - /*Save the parameters and the result. If they will be asked again don't compute again*/ - - /*Update the ratio and the result alpha value if the input alpha values change*/ - if(bg.alpha != cache->bg_saved.alpha || fg.alpha != cache->fg_saved.alpha) { - /*Info: - * https://en.wikipedia.org/wiki/Alpha_compositing#Analytical_derivation_of_the_over_operator*/ - cache->res_alpha_saved = 255 - LV_OPA_MIX2(255 - fg.alpha, 255 - bg.alpha); - LV_ASSERT(cache->res_alpha_saved != 0); - cache->ratio_saved = (uint32_t)((uint32_t)fg.alpha * 255) / cache->res_alpha_saved; - } - - if(!lv_color32_eq(bg, cache->bg_saved) || !lv_color32_eq(fg, cache->fg_saved)) { - cache->fg_saved = fg; - cache->bg_saved = bg; - fg.alpha = cache->ratio_saved; - cache->res_saved = lv_color_mix32(fg, bg); - cache->res_saved.alpha = cache->res_alpha_saved; - } - - return cache->res_saved; - } -} - -void lv_color_mix_with_alpha_cache_init(lv_color_mix_alpha_cache_t * cache) -{ - lv_memzero(&cache->fg_saved, sizeof(lv_color32_t)); - lv_memzero(&cache->bg_saved, sizeof(lv_color32_t)); - lv_memzero(&cache->res_saved, sizeof(lv_color32_t)); - cache->res_alpha_saved = 255; - cache->ratio_saved = 255; -} - -#if LV_DRAW_SW_SUPPORT_I1 - -static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t bit_idx) -{ - return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1; -} - -#endif - -static inline void LV_ATTRIBUTE_FAST_MEM blend_non_normal_pixel(lv_color32_t * dest, lv_color32_t src, - lv_blend_mode_t mode, lv_color_mix_alpha_cache_t * cache) -{ - lv_color32_t res; - switch(mode) { - case LV_BLEND_MODE_ADDITIVE: - res.red = LV_MIN(dest->red + src.red, 255); - res.green = LV_MIN(dest->green + src.green, 255); - res.blue = LV_MIN(dest->blue + src.blue, 255); - break; - case LV_BLEND_MODE_SUBTRACTIVE: - res.red = LV_MAX(dest->red - src.red, 0); - res.green = LV_MAX(dest->green - src.green, 0); - res.blue = LV_MAX(dest->blue - src.blue, 0); - break; - case LV_BLEND_MODE_MULTIPLY: - res.red = (dest->red * src.red) >> 8; - res.green = (dest->green * src.green) >> 8; - res.blue = (dest->blue * src.blue) >> 8; - break; - default: - LV_LOG_WARN("Not supported blend mode: %d", mode); - return; - } - res.alpha = src.alpha; - *dest = lv_color_32_32_mix(res, *dest, cache); -} - -static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, uint32_t stride) -{ - return (void *)((uint8_t *)buf + stride); -} - -#endif - -#endif diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.h b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.h deleted file mode 100644 index 2046c23..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @file lv_draw_sw_blend_to_argb8888.h - * - */ - -#ifndef LV_DRAW_SW_BLEND_TO_ARGB8888_H -#define LV_DRAW_SW_BLEND_TO_ARGB8888_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_draw_sw.h" -#if LV_USE_DRAW_SW - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_color_to_argb8888(lv_draw_sw_blend_fill_dsc_t * dsc); - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_image_to_argb8888(lv_draw_sw_blend_image_dsc_t * dsc); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_SW*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_BLEND_TO_ARGB8888_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_i1.c b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_i1.c deleted file mode 100644 index 1e056ee..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_i1.c +++ /dev/null @@ -1,1117 +0,0 @@ -/** - * @file lv_draw_sw_blend_to_i1.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_sw_blend_to_i1.h" -#if LV_USE_DRAW_SW - -#include "lv_draw_sw_blend_private.h" -#include "../../../misc/lv_math.h" -#include "../../../display/lv_display.h" -#include "../../../core/lv_refr.h" -#include "../../../misc/lv_color.h" -#include "../../../stdlib/lv_string.h" - -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON - #include "neon/lv_blend_neon.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM - #include "helium/lv_blend_helium.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM - #include LV_DRAW_SW_ASM_CUSTOM_INCLUDE -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void /* LV_ATTRIBUTE_FAST_MEM */ i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); - -#if LV_DRAW_SW_SUPPORT_L8 - static void /* LV_ATTRIBUTE_FAST_MEM */ l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -#if LV_DRAW_SW_SUPPORT_AL88 - static void /* LV_ATTRIBUTE_FAST_MEM */ al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -#if LV_DRAW_SW_SUPPORT_RGB565 - static void /* LV_ATTRIBUTE_FAST_MEM */ rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -#if LV_DRAW_SW_SUPPORT_RGB888 -static void /* LV_ATTRIBUTE_FAST_MEM */ rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, - const uint8_t src_px_size); -#endif - -#if LV_DRAW_SW_SUPPORT_ARGB8888 - static void /* LV_ATTRIBUTE_FAST_MEM */ argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ lv_color_8_8_mix(const uint8_t src, uint8_t * dest, uint8_t mix); - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ blend_non_normal_pixel(uint8_t * dest_buf, int32_t dest_x, - lv_color32_t src, - lv_blend_mode_t mode); - - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ set_bit(uint8_t * buf, int32_t bit_idx); - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ clear_bit(uint8_t * buf, int32_t bit_idx); - -static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, int32_t bit_idx); - -static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * buf, uint32_t stride); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -#define I1_LUM_THRESHOLD 127 - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1 - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1_WITH_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1_WITH_MASK - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1_MIX_MASK_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_I1 - #define LV_DRAW_SW_COLOR_BLEND_TO_I1(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_I1_WITH_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_I1_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_I1_WITH_MASK - #define LV_DRAW_SW_COLOR_BLEND_TO_I1_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_I1_MIX_MASK_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_I1_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1 - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1_WITH_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1_WITH_MASK - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1_MIX_MASK_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1 - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1_WITH_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1_WITH_MASK - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1_MIX_MASK_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1 - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1_WITH_OPA - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1_WITH_MASK - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1_MIX_MASK_OPA - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1 - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1_WITH_OPA - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1_WITH_MASK - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1_MIX_MASK_OPA - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1 - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1_WITH_OPA - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1_WITH_MASK - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1_MIX_MASK_OPA - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_color_to_i1(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - const lv_opa_t * mask = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - int32_t dest_stride = dsc->dest_stride; - - uint8_t src_color = lv_color_luminance(dsc->color) / (I1_LUM_THRESHOLD + 1); - uint8_t * dest_buf = dsc->dest_buf; - - int32_t bit_ofs = dsc->relative_area.x1 % 8; - - /* Simple fill */ - if(mask == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_I1(dsc)) { - for(int32_t y = 0; y < h; y++) { - for(int32_t x = 0; x < w; x++) { - if(src_color) { - set_bit(dest_buf, x + bit_ofs); - } - else { - clear_bit(dest_buf, x + bit_ofs); - } - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - } - } - } - /* Opacity only */ - else if(mask == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_I1_WITH_OPA(dsc)) { - for(int32_t y = 0; y < h; y++) { - for(int32_t x = 0; x < w; x++) { - uint8_t * dest_bit = &dest_buf[(x + bit_ofs) / 8]; - uint8_t current_bit = (*dest_bit >> (7 - ((x + bit_ofs) % 8))) & 0x01; - uint8_t new_bit = (opa * src_color + (255 - opa) * current_bit) / 255; - if(new_bit) { - set_bit(dest_buf, x + bit_ofs); - } - else { - clear_bit(dest_buf, x + bit_ofs); - } - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - } - } - } - /* Masked with full opacity */ - else if(mask && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_I1_WITH_MASK(dsc)) { - for(int32_t y = 0; y < h; y++) { - for(int32_t x = 0; x < w; x++) { - uint8_t mask_val = mask[x]; - if(mask_val == LV_OPA_TRANSP) continue; - if(mask_val == LV_OPA_COVER) { - if(src_color) { - set_bit(dest_buf, x + bit_ofs); - } - else { - clear_bit(dest_buf, x + bit_ofs); - } - } - else { - uint8_t * dest_bit = &dest_buf[(x + bit_ofs) / 8]; - uint8_t current_bit = (*dest_bit >> (7 - ((x + bit_ofs) % 8))) & 0x01; - uint8_t new_bit = (mask_val * src_color + (255 - mask_val) * current_bit) / 255; - if(new_bit) { - set_bit(dest_buf, x + bit_ofs); - } - else { - clear_bit(dest_buf, x + bit_ofs); - } - } - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - mask += mask_stride; - } - } - } - /* Masked with opacity */ - else { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_I1_MIX_MASK_OPA(dsc)) { - for(int32_t y = 0; y < h; y++) { - for(int32_t x = 0; x < w; x++) { - uint8_t mask_val = mask[x]; - if(mask_val == LV_OPA_TRANSP) continue; - uint8_t * dest_bit = &dest_buf[(x + bit_ofs) / 8]; - uint8_t current_bit = (*dest_bit >> (7 - ((x + bit_ofs) % 8))) & 0x01; - uint8_t blended_opa = (mask_val * opa) / 255; - uint8_t new_bit = (blended_opa * src_color + (255 - blended_opa) * current_bit) / 255; - if(new_bit) { - set_bit(dest_buf, x + bit_ofs); - } - else { - clear_bit(dest_buf, x + bit_ofs); - } - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - mask += mask_stride; - } - } - } -} - -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_i1(lv_draw_sw_blend_image_dsc_t * dsc) -{ - switch(dsc->src_color_format) { -#if LV_DRAW_SW_SUPPORT_RGB565 - case LV_COLOR_FORMAT_RGB565: - rgb565_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 - case LV_COLOR_FORMAT_RGB888: - rgb888_image_blend(dsc, 3); - break; -#endif -#if LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - rgb888_image_blend(dsc, 4); - break; -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 - case LV_COLOR_FORMAT_ARGB8888: - argb8888_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_L8 - case LV_COLOR_FORMAT_L8: - l8_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_AL88 - case LV_COLOR_FORMAT_AL88: - al88_image_blend(dsc); - break; -#endif - case LV_COLOR_FORMAT_I1: - i1_image_blend(dsc); - break; - default: - LV_LOG_WARN("Not supported source color format"); - break; - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void LV_ATTRIBUTE_FAST_MEM i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_i1 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_i1 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - int32_t bit_ofs = dsc->relative_area.x1 % 8; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - if(get_bit(src_buf_i1, src_x)) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t src = get_bit(src_buf_i1, src_x); - uint8_t dest = get_bit(dest_buf_i1, dest_x + bit_ofs); - uint8_t blended = (src * opa + dest * (255 - opa)); - if(blended > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t mask_val = mask_buf[src_x]; - uint8_t src = get_bit(src_buf_i1, src_x); - uint8_t dest = get_bit(dest_buf_i1, dest_x + bit_ofs); - uint8_t blended = (src * mask_val + dest * (255 - mask_val)); - if(blended > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t mask_val = mask_buf[src_x]; - if(mask_val == LV_OPA_TRANSP) continue; - uint8_t src = get_bit(src_buf_i1, src_x); - uint8_t dest = get_bit(dest_buf_i1, dest_x + bit_ofs); - uint8_t blend_opa = LV_OPA_MIX2(mask_val, opa); - uint8_t blended = (src * blend_opa + dest * (255 - blend_opa)); - if(blended > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - src_argb.red = get_bit(src_buf_i1, src_x) * 255; - src_argb.green = src_argb.red; - src_argb.blue = src_argb.red; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - blend_non_normal_pixel(dest_buf_i1, dest_x + bit_ofs, src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } -} - -#if LV_DRAW_SW_SUPPORT_L8 -static void LV_ATTRIBUTE_FAST_MEM l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_i1 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_l8 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t src_x, dest_x; - int32_t y; - - int32_t bit_ofs = dsc->relative_area.x1 % 8; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - if(src_buf_l8[src_x] > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t dest_val = get_bit(dest_buf_i1, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src_buf_l8[src_x], &dest_val, opa); - if(dest_val > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t src_luminance = src_buf_l8[src_x]; - uint8_t dest_val = get_bit(dest_buf_i1, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src_luminance, &dest_val, mask_buf[src_x]); - if(dest_val > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t src_luminance = src_buf_l8[src_x]; - uint8_t dest_val = get_bit(dest_buf_i1, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src_luminance, &dest_val, LV_OPA_MIX2(mask_buf[src_x], opa)); - if(dest_val > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(src_x = 0; src_x < w; src_x++) { - src_argb.red = src_buf_l8[src_x]; - src_argb.green = src_buf_l8[src_x]; - src_argb.blue = src_buf_l8[src_x]; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[src_x], opa); - blend_non_normal_pixel(dest_buf_i1, src_x + bit_ofs, src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } -} -#endif - -#if LV_DRAW_SW_SUPPORT_AL88 -static void LV_ATTRIBUTE_FAST_MEM al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_i1 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color16a_t * src_buf_al88 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - int32_t bit_ofs = dsc->relative_area.x1 % 8; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t dest_val = get_bit(dest_buf_i1, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src_buf_al88[src_x].lumi, &dest_val, src_buf_al88[src_x].alpha); - if(dest_val > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t dest_val = get_bit(dest_buf_i1, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src_buf_al88[src_x].lumi, &dest_val, LV_OPA_MIX2(src_buf_al88[src_x].alpha, opa)); - if(dest_val > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t dest_val = get_bit(dest_buf_i1, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src_buf_al88[src_x].lumi, &dest_val, LV_OPA_MIX2(src_buf_al88[src_x].alpha, mask_buf[src_x])); - if(dest_val > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t dest_val = get_bit(dest_buf_i1, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src_buf_al88[src_x].lumi, &dest_val, LV_OPA_MIX3(src_buf_al88[src_x].alpha, mask_buf[src_x], opa)); - if(dest_val > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - src_argb.red = src_buf_al88[src_x].lumi; - src_argb.green = src_buf_al88[src_x].lumi; - src_argb.blue = src_buf_al88[src_x].lumi; - if(mask_buf == NULL) src_argb.alpha = LV_OPA_MIX2(src_buf_al88[src_x].alpha, opa); - else src_argb.alpha = LV_OPA_MIX3(src_buf_al88[src_x].alpha, mask_buf[src_x], opa); - blend_non_normal_pixel(dest_buf_i1, dest_x + bit_ofs, src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } -} -#endif - -#if LV_DRAW_SW_SUPPORT_ARGB8888 -static void LV_ATTRIBUTE_FAST_MEM argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_i1 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color32_t * src_buf_c32 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t x; - int32_t y; - - int32_t bit_ofs = dsc->relative_area.x1 % 8; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - uint8_t src = lv_color32_luminance(src_buf_c32[x]); - uint8_t dest = get_bit(dest_buf_i1, x + bit_ofs) * 255; - lv_color_8_8_mix(src, &dest, src_buf_c32[x].alpha); - if(dest > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - uint8_t src = lv_color32_luminance(src_buf_c32[x]); - uint8_t dest = get_bit(dest_buf_i1, x + bit_ofs) * 255; - lv_color_8_8_mix(src, &dest, LV_OPA_MIX2(opa, src_buf_c32[x].alpha)); - if(dest > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - uint8_t src = lv_color32_luminance(src_buf_c32[x]); - uint8_t dest = get_bit(dest_buf_i1, x + bit_ofs) * 255; - lv_color_8_8_mix(src, &dest, LV_OPA_MIX2(mask_buf[x], src_buf_c32[x].alpha)); - if(dest > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - uint8_t src = lv_color32_luminance(src_buf_c32[x]); - uint8_t dest = get_bit(dest_buf_i1, x + bit_ofs) * 255; - lv_color_8_8_mix(src, &dest, LV_OPA_MIX3(opa, mask_buf[x], src_buf_c32[x].alpha)); - if(dest > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color32_t color_argb = src_buf_c32[x]; - if(mask_buf == NULL) color_argb.alpha = LV_OPA_MIX2(color_argb.alpha, opa); - else color_argb.alpha = LV_OPA_MIX3(color_argb.alpha, mask_buf[x], opa); - blend_non_normal_pixel(dest_buf_i1, x + bit_ofs, color_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } -} -#endif - -#if LV_DRAW_SW_SUPPORT_RGB888 -static void LV_ATTRIBUTE_FAST_MEM rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, - const uint8_t src_px_size) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_i1 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_rgb888 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - - int32_t bit_ofs = dsc->relative_area.x1 % 8; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - /*Special case*/ - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - uint8_t src = lv_color24_luminance(&src_buf_rgb888[src_x]); - if(src > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_rgb888 = drawbuf_next_row(src_buf_rgb888, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - uint8_t src = lv_color24_luminance(&src_buf_rgb888[src_x]); - uint8_t dest = get_bit(dest_buf_i1, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src, &dest, opa); - if(dest > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_rgb888 = drawbuf_next_row(src_buf_rgb888, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1_WITH_MASK(dsc)) { - uint32_t mask_x; - for(y = 0; y < h; y++) { - for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x++, src_x += src_px_size) { - uint8_t src = lv_color24_luminance(&src_buf_rgb888[src_x]); - uint8_t dest = get_bit(dest_buf_i1, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src, &dest, mask_buf[mask_x]); - if(dest > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_rgb888 = drawbuf_next_row(src_buf_rgb888, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(dsc)) { - uint32_t mask_x; - for(y = 0; y < h; y++) { - for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x++, src_x += src_px_size) { - uint8_t src = lv_color24_luminance(&src_buf_rgb888[src_x]); - uint8_t dest = get_bit(dest_buf_i1, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src, &dest, LV_OPA_MIX2(mask_buf[mask_x], opa)); - if(dest > I1_LUM_THRESHOLD) { - set_bit(dest_buf_i1, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_i1, dest_x + bit_ofs); - } - } - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_rgb888 = drawbuf_next_row(src_buf_rgb888, src_stride); - mask_buf += mask_stride; - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - src_argb.red = src_buf_rgb888[src_x + 2]; - src_argb.green = src_buf_rgb888[src_x + 1]; - src_argb.blue = src_buf_rgb888[src_x + 0]; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - - blend_non_normal_pixel(dest_buf_i1, dest_x + bit_ofs, src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_i1 = drawbuf_next_row(dest_buf_i1, dest_stride); - src_buf_rgb888 = drawbuf_next_row(src_buf_rgb888, src_stride); - } - } - } -} -#endif - -#if LV_DRAW_SW_SUPPORT_RGB565 -static void LV_ATTRIBUTE_FAST_MEM rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_u8 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color16_t * src_buf_c16 = (const lv_color16_t *)dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - int32_t bit_ofs = dsc->relative_area.x1 % 8; - - int32_t src_x; - int32_t dest_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1(dsc)) { - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t src = lv_color16_luminance(src_buf_c16[src_x]); - if(src > I1_LUM_THRESHOLD) { - set_bit(dest_buf_u8, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_u8, dest_x + bit_ofs); - } - } - dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t src = lv_color16_luminance(src_buf_c16[src_x]); - uint8_t dest = get_bit(dest_buf_u8, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src, &dest, opa); - if(dest > I1_LUM_THRESHOLD) { - set_bit(dest_buf_u8, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_u8, dest_x + bit_ofs); - } - } - dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1_WITH_MASK(dsc)) { - uint32_t mask_x; - for(y = 0; y < h; y++) { - for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x++, src_x++) { - uint8_t src = lv_color16_luminance(src_buf_c16[src_x]); - uint8_t dest = get_bit(dest_buf_u8, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src, &dest, mask_buf[mask_x]); - if(dest > I1_LUM_THRESHOLD) { - set_bit(dest_buf_u8, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_u8, dest_x + bit_ofs); - } - } - dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_I1_MIX_MASK_OPA(dsc)) { - uint32_t mask_x; - for(y = 0; y < h; y++) { - for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x++, src_x++) { - uint8_t src = lv_color16_luminance(src_buf_c16[src_x]); - uint8_t dest = get_bit(dest_buf_u8, dest_x + bit_ofs) * 255; - lv_color_8_8_mix(src, &dest, LV_OPA_MIX2(mask_buf[mask_x], opa)); - if(dest > I1_LUM_THRESHOLD) { - set_bit(dest_buf_u8, dest_x + bit_ofs); - } - else { - clear_bit(dest_buf_u8, dest_x + bit_ofs); - } - } - dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; src_x++, dest_x++) { - src_argb.red = (src_buf_c16[src_x].red * 2106) >> 8; - src_argb.green = (src_buf_c16[src_x].green * 1037) >> 8; - src_argb.blue = (src_buf_c16[src_x].blue * 2106) >> 8; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[src_x], opa); - - blend_non_normal_pixel(dest_buf_u8, dest_x + bit_ofs, src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride); - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } -} -#endif - -static inline void LV_ATTRIBUTE_FAST_MEM blend_non_normal_pixel(uint8_t * dest_buf, int32_t dest_x, lv_color32_t src, - lv_blend_mode_t mode) -{ - uint8_t res; - int32_t src_lumi = lv_color32_luminance(src); - uint8_t dest_lumi = get_bit(dest_buf, dest_x) * 255; - switch(mode) { - case LV_BLEND_MODE_ADDITIVE: - res = LV_MIN(dest_lumi + src_lumi, 255); - break; - case LV_BLEND_MODE_SUBTRACTIVE: - res = LV_MAX(dest_lumi - src_lumi, 0); - break; - case LV_BLEND_MODE_MULTIPLY: - res = (dest_lumi * src_lumi) >> 8; - break; - default: - LV_LOG_WARN("Not supported blend mode: %d", mode); - return; - } - - lv_color_8_8_mix(res, &dest_lumi, src.alpha); - if(dest_lumi > I1_LUM_THRESHOLD) { - set_bit(dest_buf, dest_x); - } - else { - clear_bit(dest_buf, dest_x); - } -} - -static inline void LV_ATTRIBUTE_FAST_MEM lv_color_8_8_mix(const uint8_t src, uint8_t * dest, uint8_t mix) -{ - - if(mix == 0) return; - - if(mix >= LV_OPA_MAX) { - *dest = src; - } - else { - lv_opa_t mix_inv = 255 - mix; - *dest = (uint32_t)((uint32_t)src * mix + dest[0] * mix_inv) >> 8; - } -} - -static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, uint32_t stride) -{ - return (void *)((uint8_t *)buf + stride); -} - -static inline void LV_ATTRIBUTE_FAST_MEM set_bit(uint8_t * buf, int32_t bit_idx) -{ - buf[bit_idx / 8] |= (1 << (7 - (bit_idx % 8))); -} - -static inline void LV_ATTRIBUTE_FAST_MEM clear_bit(uint8_t * buf, int32_t bit_idx) -{ - buf[bit_idx / 8] &= ~(1 << (7 - (bit_idx % 8))); -} - -static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t bit_idx) -{ - return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1; -} - -#endif diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_i1.h b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_i1.h deleted file mode 100644 index 5d72523..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_i1.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @file lv_draw_sw_blend_to_i1.h - * - */ - -#ifndef LV_DRAW_SW_BLEND_TO_I1_H -#define LV_DRAW_SW_BLEND_TO_I1_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_draw_sw.h" -#if LV_USE_DRAW_SW - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_color_to_i1(lv_draw_sw_blend_fill_dsc_t * dsc); - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_image_to_i1(lv_draw_sw_blend_image_dsc_t * dsc); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_SW*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_BLEND_TO_I1_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_l8.c b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_l8.c deleted file mode 100644 index fa9c025..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_l8.c +++ /dev/null @@ -1,897 +0,0 @@ -/** - * @file lv_draw_sw_blend_l8.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_sw_blend_to_l8.h" -#if LV_USE_DRAW_SW - -#if LV_DRAW_SW_SUPPORT_L8 - -#include "lv_draw_sw_blend_private.h" -#include "../../../misc/lv_math.h" -#include "../../../display/lv_display.h" -#include "../../../core/lv_refr.h" -#include "../../../misc/lv_color.h" -#include "../../../stdlib/lv_string.h" - -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON - #include "neon/lv_blend_neon.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM - #include "helium/lv_blend_helium.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM - #include LV_DRAW_SW_ASM_CUSTOM_INCLUDE -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -#if LV_DRAW_SW_SUPPORT_I1 - static void /* LV_ATTRIBUTE_FAST_MEM */ i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); - - static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, int32_t bit_idx); -#endif - -static void /* LV_ATTRIBUTE_FAST_MEM */ l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); - -#if LV_DRAW_SW_SUPPORT_AL88 - static void /* LV_ATTRIBUTE_FAST_MEM */ al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -#if LV_DRAW_SW_SUPPORT_RGB565 - static void /* LV_ATTRIBUTE_FAST_MEM */ rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -#if LV_DRAW_SW_SUPPORT_RGB888 -static void /* LV_ATTRIBUTE_FAST_MEM */ rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, - const uint8_t src_px_size); -#endif - -#if LV_DRAW_SW_SUPPORT_ARGB8888 - static void /* LV_ATTRIBUTE_FAST_MEM */ argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ lv_color_8_8_mix(const uint8_t src, uint8_t * dest, uint8_t mix); - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ blend_non_normal_pixel(uint8_t * dest, lv_color32_t src, - lv_blend_mode_t mode); - -static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * buf, uint32_t stride); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_L8 - #define LV_DRAW_SW_COLOR_BLEND_TO_L8(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_L8_WITH_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_L8_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_L8_WITH_MASK - #define LV_DRAW_SW_COLOR_BLEND_TO_L8_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_L8_MIX_MASK_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_L8_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8 - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8_WITH_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8_WITH_MASK - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8_MIX_MASK_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8 - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8_WITH_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8_WITH_MASK - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8_MIX_MASK_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8 - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_WITH_OPA - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_WITH_MASK - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_MIX_MASK_OPA - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8 - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8_WITH_OPA - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8_WITH_MASK - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8_MIX_MASK_OPA - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8 - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_MASK - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_MIX_MASK_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_color_to_l8(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - const lv_opa_t * mask = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - int32_t dest_stride = dsc->dest_stride; - - int32_t x; - int32_t y; - - LV_UNUSED(w); - LV_UNUSED(h); - LV_UNUSED(x); - LV_UNUSED(y); - LV_UNUSED(opa); - LV_UNUSED(mask); - LV_UNUSED(mask_stride); - LV_UNUSED(dest_stride); - - /*Simple fill*/ - if(mask == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_L8(dsc)) { - uint8_t color8 = lv_color_luminance(dsc->color); - uint8_t * dest_buf = dsc->dest_buf; - for(y = 0; y < h; y++) { - for(x = 0; x < w - 16; x += 16) { - dest_buf[x + 0] = color8; - dest_buf[x + 1] = color8; - dest_buf[x + 2] = color8; - dest_buf[x + 3] = color8; - - dest_buf[x + 4] = color8; - dest_buf[x + 5] = color8; - dest_buf[x + 6] = color8; - dest_buf[x + 7] = color8; - - dest_buf[x + 8] = color8; - dest_buf[x + 9] = color8; - dest_buf[x + 10] = color8; - dest_buf[x + 11] = color8; - - dest_buf[x + 12] = color8; - dest_buf[x + 13] = color8; - dest_buf[x + 14] = color8; - dest_buf[x + 15] = color8; - } - for(; x < w; x ++) { - dest_buf[x] = color8; - } - - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - } - } - } - /*Opacity only*/ - else if(mask == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_L8_WITH_OPA(dsc)) { - uint8_t color8 = lv_color_luminance(dsc->color); - uint8_t * dest_buf = dsc->dest_buf; - - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color_8_8_mix(color8, &dest_buf[x], opa); - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - } - } - - } - /*Masked with full opacity*/ - else if(mask && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_L8_WITH_MASK(dsc)) { - uint8_t color8 = lv_color_luminance(dsc->color); - uint8_t * dest_buf = dsc->dest_buf; - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color_8_8_mix(color8, &dest_buf[x], mask[x]); - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - mask += mask_stride; - } - } - - } - /*Masked with opacity*/ - else { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_L8_MIX_MASK_OPA(dsc)) { - uint8_t color8 = lv_color_luminance(dsc->color); - uint8_t * dest_buf = dsc->dest_buf; - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color_8_8_mix(color8, &dest_buf[x], LV_OPA_MIX2(mask[x], opa)); - } - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - mask += mask_stride; - } - } - } -} - -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_l8(lv_draw_sw_blend_image_dsc_t * dsc) -{ - switch(dsc->src_color_format) { -#if LV_DRAW_SW_SUPPORT_RGB565 - case LV_COLOR_FORMAT_RGB565: - rgb565_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 - case LV_COLOR_FORMAT_RGB888: - rgb888_image_blend(dsc, 3); - break; -#endif -#if LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - rgb888_image_blend(dsc, 4); - break; -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 - case LV_COLOR_FORMAT_ARGB8888: - argb8888_image_blend(dsc); - break; -#endif - case LV_COLOR_FORMAT_L8: - l8_image_blend(dsc); - break; -#if LV_DRAW_SW_SUPPORT_AL88 - case LV_COLOR_FORMAT_AL88: - al88_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_I1 - case LV_COLOR_FORMAT_I1: - i1_image_blend(dsc); - break; -#endif - default: - LV_LOG_WARN("Not supported source color format"); - break; - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#if LV_DRAW_SW_SUPPORT_I1 -static void LV_ATTRIBUTE_FAST_MEM i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_l8 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_i1 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - lv_color_8_8_mix(chan_val, &dest_buf_l8[dest_x], opa); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - lv_color_8_8_mix(chan_val, &dest_buf_l8[dest_x], opa); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - lv_color_8_8_mix(chan_val, &dest_buf_l8[dest_x], mask_buf[src_x]); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - lv_color_8_8_mix(chan_val, &dest_buf_l8[dest_x], LV_OPA_MIX2(mask_buf[src_x], opa)); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - src_argb.red = get_bit(src_buf_i1, src_x) * 255; - src_argb.green = src_argb.red; - src_argb.blue = src_argb.red; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - blend_non_normal_pixel(&dest_buf_l8[dest_x], src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } -} -#endif - -static void LV_ATTRIBUTE_FAST_MEM l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_l8 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_l8 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8(dsc)) { - for(y = 0; y < h; y++) { - lv_memcpy(dest_buf_l8, src_buf_l8, w); - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_8_mix(src_buf_l8[src_x], &dest_buf_l8[dest_x], opa); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_8_mix(src_buf_l8[src_x], &dest_buf_l8[dest_x], mask_buf[src_x]); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_8_mix(src_buf_l8[src_x], &dest_buf_l8[dest_x], LV_OPA_MIX2(mask_buf[src_x], opa)); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - src_argb.red = src_buf_l8[src_x]; - src_argb.green = src_buf_l8[src_x]; - src_argb.blue = src_buf_l8[src_x]; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - blend_non_normal_pixel(&dest_buf_l8[dest_x], src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } -} - -#if LV_DRAW_SW_SUPPORT_AL88 - -static void LV_ATTRIBUTE_FAST_MEM al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_l8 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color16a_t * src_buf_al88 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_8_mix(src_buf_al88[src_x].lumi, &dest_buf_l8[dest_x], src_buf_al88[src_x].alpha); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_8_mix(src_buf_al88[src_x].lumi, &dest_buf_l8[dest_x], LV_OPA_MIX2(src_buf_al88[src_x].alpha, opa)); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_8_mix(src_buf_al88[src_x].lumi, &dest_buf_l8[dest_x], LV_OPA_MIX2(src_buf_al88[src_x].alpha, - mask_buf[src_x])); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_8_mix(src_buf_al88[src_x].lumi, &dest_buf_l8[dest_x], LV_OPA_MIX3(src_buf_al88[src_x].alpha, mask_buf[src_x], - opa)); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x++, src_x++) { - src_argb.red = src_buf_al88[src_x].lumi; - src_argb.green = src_buf_al88[src_x].lumi; - src_argb.blue = src_buf_al88[src_x].lumi; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - blend_non_normal_pixel(&dest_buf_l8[dest_x], src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_RGB565 - -static void LV_ATTRIBUTE_FAST_MEM rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_u8 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color16_t * src_buf_c16 = (const lv_color16_t *)dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t src_x; - int32_t dest_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8(dsc)) { - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; dest_x++, src_x++) { - dest_buf_u8[dest_x] = lv_color16_luminance(src_buf_c16[src_x]); - } - dest_buf_u8 += dest_stride; - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8_WITH_OPA(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_8_mix(lv_color16_luminance(src_buf_c16[src_x]), &dest_buf_u8[dest_x], opa); - } - dest_buf_u8 += dest_stride; - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8_WITH_MASK(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_8_mix(lv_color16_luminance(src_buf_c16[src_x]), &dest_buf_u8[dest_x], mask_buf[src_x]); - } - dest_buf_u8 += dest_stride; - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - mask_buf += mask_stride; - } - } - } - else { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; dest_x++, src_x++) { - lv_color_8_8_mix(lv_color16_luminance(src_buf_c16[src_x]), &dest_buf_u8[dest_x], LV_OPA_MIX2(opa, mask_buf[src_x])); - } - dest_buf_u8 += dest_stride; - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; src_x++, dest_x++) { - src_argb.red = (src_buf_c16[src_x].red * 2106) >> 8; - src_argb.green = (src_buf_c16[src_x].green * 1037) >> 8; - src_argb.blue = (src_buf_c16[src_x].blue * 2106) >> 8; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[src_x], opa); - blend_non_normal_pixel(&dest_buf_u8[dest_x], src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_u8 += dest_stride; - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_RGB888 - -static void LV_ATTRIBUTE_FAST_MEM rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, - const uint8_t src_px_size) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_l8 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_u8 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - /*Special case*/ - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8(dsc, src_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - dest_buf_l8[dest_x] = lv_color24_luminance(&src_buf_u8[src_x]); - } - dest_buf_l8 += dest_stride; - src_buf_u8 += src_stride; - } - } - } - if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8_WITH_OPA(dsc, dest_px_size, src_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - lv_color_8_8_mix(lv_color24_luminance(&src_buf_u8[src_x]), &dest_buf_l8[dest_x], opa); - } - dest_buf_l8 += dest_stride; - src_buf_u8 += src_stride; - } - } - } - if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8_WITH_MASK(dsc, dest_px_size, src_px_size)) { - uint32_t mask_x; - for(y = 0; y < h; y++) { - for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x++, src_x += src_px_size) { - lv_color_8_8_mix(lv_color24_luminance(&src_buf_u8[src_x]), &dest_buf_l8[dest_x], mask_buf[mask_x]); - } - dest_buf_l8 += dest_stride; - src_buf_u8 += src_stride; - mask_buf += mask_stride; - } - } - } - if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(dsc, dest_px_size, src_px_size)) { - uint32_t mask_x; - for(y = 0; y < h; y++) { - for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x++, src_x += src_px_size) { - lv_color_8_8_mix(lv_color24_luminance(&src_buf_u8[src_x]), &dest_buf_l8[dest_x], LV_OPA_MIX2(opa, mask_buf[mask_x])); - } - dest_buf_l8 += dest_stride; - src_buf_u8 += src_stride; - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - src_argb.red = src_buf_u8[src_x + 2]; - src_argb.green = src_buf_u8[src_x + 1]; - src_argb.blue = src_buf_u8[src_x + 0]; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - - blend_non_normal_pixel(&dest_buf_l8[dest_x], src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_l8 += dest_stride; - src_buf_u8 += src_stride; - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_ARGB8888 - -static void LV_ATTRIBUTE_FAST_MEM argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_l8 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color32_t * src_buf_c32 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color_8_8_mix(lv_color32_luminance(src_buf_c32[x]), &dest_buf_l8[x], src_buf_c32[x].alpha); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color_8_8_mix(lv_color32_luminance(src_buf_c32[x]), &dest_buf_l8[x], LV_OPA_MIX2(src_buf_c32[x].alpha, opa)); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color_8_8_mix(lv_color32_luminance(src_buf_c32[x]), &dest_buf_l8[x], LV_OPA_MIX2(src_buf_c32[x].alpha, mask_buf[x])); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_L8_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color_8_8_mix(lv_color32_luminance(src_buf_c32[x]), &dest_buf_l8[x], LV_OPA_MIX3(src_buf_c32[x].alpha, opa, - mask_buf[x])); - } - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - lv_color32_t color_argb = src_buf_c32[x]; - if(mask_buf == NULL) color_argb.alpha = LV_OPA_MIX2(color_argb.alpha, opa); - else color_argb.alpha = LV_OPA_MIX3(color_argb.alpha, mask_buf[x], opa); - blend_non_normal_pixel(&dest_buf_l8[x], color_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_l8 = drawbuf_next_row(dest_buf_l8, dest_stride); - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } -} - -#endif - -static inline void LV_ATTRIBUTE_FAST_MEM lv_color_8_8_mix(const uint8_t src, uint8_t * dest, uint8_t mix) -{ - - if(mix == 0) return; - - if(mix >= LV_OPA_MAX) { - *dest = src; - } - else { - lv_opa_t mix_inv = 255 - mix; - *dest = (uint32_t)((uint32_t)src * mix + dest[0] * mix_inv) >> 8; - } -} - - -#if LV_DRAW_SW_SUPPORT_I1 - -static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t bit_idx) -{ - return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1; -} - -#endif - -static inline void LV_ATTRIBUTE_FAST_MEM blend_non_normal_pixel(uint8_t * dest, lv_color32_t src, lv_blend_mode_t mode) -{ - uint8_t res; - int32_t src_lumi = lv_color32_luminance(src); - switch(mode) { - case LV_BLEND_MODE_ADDITIVE: - res = LV_MIN(*dest + src_lumi, 255); - break; - case LV_BLEND_MODE_SUBTRACTIVE: - res = LV_MAX(*dest - src_lumi, 0); - break; - case LV_BLEND_MODE_MULTIPLY: - res = (*dest * src_lumi) >> 8; - break; - default: - LV_LOG_WARN("Not supported blend mode: %d", mode); - return; - } - lv_color_8_8_mix(res, dest, src.alpha); -} - -static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, uint32_t stride) -{ - return (void *)((uint8_t *)buf + stride); -} - -#endif - -#endif diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_l8.h b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_l8.h deleted file mode 100644 index 079218e..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_l8.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @file lv_draw_sw_blend_to_l8.h - * - */ - -#ifndef LV_DRAW_SW_BLEND_TO_L8_H -#define LV_DRAW_SW_BLEND_TO_L8_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_draw_sw.h" -#if LV_USE_DRAW_SW - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_color_to_l8(lv_draw_sw_blend_fill_dsc_t * dsc); - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_image_to_l8(lv_draw_sw_blend_image_dsc_t * dsc); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_SW*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_BLEND_TO_L8_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c deleted file mode 100644 index 1fa8c06..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c +++ /dev/null @@ -1,1150 +0,0 @@ -/** - * @file lv_draw_sw_blend_to_rgb565.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_sw_blend_to_rgb565.h" -#if LV_USE_DRAW_SW - -#if LV_DRAW_SW_SUPPORT_RGB565 - -#include "lv_draw_sw_blend_private.h" -#include "../../../misc/lv_math.h" -#include "../../../display/lv_display.h" -#include "../../../core/lv_refr.h" -#include "../../../misc/lv_color.h" -#include "../../../stdlib/lv_string.h" - -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON - #include "neon/lv_blend_neon.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM - #include "helium/lv_blend_helium.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM - #include LV_DRAW_SW_ASM_CUSTOM_INCLUDE -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -#if LV_DRAW_SW_SUPPORT_AL88 - static void /* LV_ATTRIBUTE_FAST_MEM */ al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -#if LV_DRAW_SW_SUPPORT_I1 - static void /* LV_ATTRIBUTE_FAST_MEM */ i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); - - static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, int32_t bit_idx); -#endif - -#if LV_DRAW_SW_SUPPORT_L8 - static void /* LV_ATTRIBUTE_FAST_MEM */ l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -static void /* LV_ATTRIBUTE_FAST_MEM */ rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); - -#if LV_DRAW_SW_SUPPORT_RGB888 -static void /* LV_ATTRIBUTE_FAST_MEM */ rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, - const uint8_t src_px_size); -#endif - -#if LV_DRAW_SW_SUPPORT_ARGB8888 - static void /* LV_ATTRIBUTE_FAST_MEM */ argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc); -#endif - -static inline uint16_t /* LV_ATTRIBUTE_FAST_MEM */ l8_to_rgb565(const uint8_t c1); - -static inline uint16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color_8_16_mix(const uint8_t c1, uint16_t c2, uint8_t mix); - -static inline uint16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color_24_16_mix(const uint8_t * c1, uint16_t c2, uint8_t mix); - -static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * buf, uint32_t stride); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565 - #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK - #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565 - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565_WITH_OPA - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565_WITH_MASK - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565 - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565_WITH_OPA - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565_WITH_MASK - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA - #define LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565 - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565 - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565 - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565 - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_MASK - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Fill an area with a color. - * Supports normal fill, fill with opacity, fill with mask, and fill with mask and opacity. - * dest_buf and color have native color depth. (RGB565, RGB888, XRGB8888) - * The background (dest_buf) cannot have alpha channel - * @param dest_buf - * @param dest_area - * @param dest_stride - * @param color - * @param opa - * @param mask - * @param mask_stride - */ -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_color_to_rgb565(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - uint16_t color16 = lv_color_to_u16(dsc->color); - lv_opa_t opa = dsc->opa; - const lv_opa_t * mask = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - uint16_t * dest_buf_u16 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - - int32_t x; - int32_t y; - - LV_UNUSED(w); - LV_UNUSED(h); - LV_UNUSED(x); - LV_UNUSED(y); - LV_UNUSED(opa); - LV_UNUSED(mask); - LV_UNUSED(color16); - LV_UNUSED(mask_stride); - LV_UNUSED(dest_stride); - LV_UNUSED(dest_buf_u16); - - /*Simple fill*/ - if(mask == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB565(dsc)) { - for(y = 0; y < h; y++) { - uint16_t * dest_end_final = dest_buf_u16 + w; - uint32_t * dest_end_mid = (uint32_t *)((uint16_t *) dest_buf_u16 + ((w - 1) & ~(0xF))); - if((lv_uintptr_t)&dest_buf_u16[0] & 0x3) { - dest_buf_u16[0] = color16; - dest_buf_u16++; - } - - uint32_t c32 = (uint32_t)color16 + ((uint32_t)color16 << 16); - uint32_t * dest32 = (uint32_t *)dest_buf_u16; - while(dest32 < dest_end_mid) { - dest32[0] = c32; - dest32[1] = c32; - dest32[2] = c32; - dest32[3] = c32; - dest32[4] = c32; - dest32[5] = c32; - dest32[6] = c32; - dest32[7] = c32; - dest32 += 8; - } - - dest_buf_u16 = (uint16_t *)dest32; - - while(dest_buf_u16 < dest_end_final) { - *dest_buf_u16 = color16; - dest_buf_u16++; - } - - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - dest_buf_u16 -= w; - } - } - - } - /*Opacity only*/ - else if(mask == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA(dsc)) { - uint32_t last_dest32_color = dest_buf_u16[0] + 1; /*Set to value which is not equal to the first pixel*/ - uint32_t last_res32_color = 0; - - for(y = 0; y < h; y++) { - x = 0; - if((lv_uintptr_t)&dest_buf_u16[0] & 0x3) { - dest_buf_u16[0] = lv_color_16_16_mix(color16, dest_buf_u16[0], opa); - x = 1; - } - - for(; x < w - 2; x += 2) { - if(dest_buf_u16[x] != dest_buf_u16[x + 1]) { - dest_buf_u16[x + 0] = lv_color_16_16_mix(color16, dest_buf_u16[x + 0], opa); - dest_buf_u16[x + 1] = lv_color_16_16_mix(color16, dest_buf_u16[x + 1], opa); - } - else { - volatile uint32_t * dest32 = (uint32_t *)&dest_buf_u16[x]; - if(last_dest32_color == *dest32) { - *dest32 = last_res32_color; - } - else { - last_dest32_color = *dest32; - - dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x + 0], opa); - dest_buf_u16[x + 1] = dest_buf_u16[x]; - - last_res32_color = *dest32; - } - } - } - - for(; x < w ; x++) { - dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], opa); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - } - } - - } - - /*Masked with full opacity*/ - else if(mask && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - x = 0; - if((lv_uintptr_t)(mask) & 0x1) { - dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], mask[x]); - x++; - } - - for(; x <= w - 2; x += 2) { - uint16_t mask16 = *((uint16_t *)&mask[x]); - if(mask16 == 0xFFFF) { - dest_buf_u16[x + 0] = color16; - dest_buf_u16[x + 1] = color16; - } - else if(mask16 != 0) { - dest_buf_u16[x + 0] = lv_color_16_16_mix(color16, dest_buf_u16[x + 0], mask[x + 0]); - dest_buf_u16[x + 1] = lv_color_16_16_mix(color16, dest_buf_u16[x + 1], mask[x + 1]); - } - } - - for(; x < w ; x++) { - dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], mask[x]); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - mask += mask_stride; - } - } - - } - /*Masked with opacity*/ - else if(mask && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], LV_OPA_MIX2(mask[x], opa)); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - mask += mask_stride; - } - } - } -} - -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_rgb565(lv_draw_sw_blend_image_dsc_t * dsc) -{ - switch(dsc->src_color_format) { - case LV_COLOR_FORMAT_RGB565: - rgb565_image_blend(dsc); - break; -#if LV_DRAW_SW_SUPPORT_RGB888 - case LV_COLOR_FORMAT_RGB888: - rgb888_image_blend(dsc, 3); - break; -#endif -#if LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - rgb888_image_blend(dsc, 4); - break; -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 - case LV_COLOR_FORMAT_ARGB8888: - argb8888_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_L8 - case LV_COLOR_FORMAT_L8: - l8_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_AL88 - case LV_COLOR_FORMAT_AL88: - al88_image_blend(dsc); - break; -#endif -#if LV_DRAW_SW_SUPPORT_I1 - case LV_COLOR_FORMAT_I1: - i1_image_blend(dsc); - break; -#endif - default: - LV_LOG_WARN("Not supported source color format"); - break; - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#if LV_DRAW_SW_SUPPORT_I1 -static void LV_ATTRIBUTE_FAST_MEM i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint16_t * dest_buf_u16 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_i1 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - dest_buf_u16[dest_x] = l8_to_rgb565(chan_val); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - dest_buf_u16[dest_x] = lv_color_8_16_mix(chan_val, dest_buf_u16[dest_x], opa); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc)) { - - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - dest_buf_u16[dest_x] = lv_color_8_16_mix(chan_val, dest_buf_u16[dest_x], mask_buf[dest_x]); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - dest_buf_u16[dest_x] = lv_color_8_16_mix(chan_val, dest_buf_u16[dest_x], LV_OPA_MIX2(mask_buf[dest_x], opa)); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) { - uint16_t res = 0; - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - switch(dsc->blend_mode) { - case LV_BLEND_MODE_ADDITIVE: - // Additive blending mode - res = (LV_MIN(dest_buf_u16[dest_x] + l8_to_rgb565(chan_val), 0xFFFF)); - break; - case LV_BLEND_MODE_SUBTRACTIVE: - // Subtractive blending mode - res = (LV_MAX(dest_buf_u16[dest_x] - l8_to_rgb565(chan_val), 0)); - break; - case LV_BLEND_MODE_MULTIPLY: - // Multiply blending mode - res = ((((dest_buf_u16[dest_x] >> 11) * (l8_to_rgb565(chan_val) >> 3)) & 0x1F) << 11) | - ((((dest_buf_u16[dest_x] >> 5) & 0x3F) * ((l8_to_rgb565(chan_val) >> 2) & 0x3F) >> 6) << 5) | - (((dest_buf_u16[dest_x] & 0x1F) * (l8_to_rgb565(chan_val) & 0x1F)) >> 5); - break; - default: - LV_LOG_WARN("Not supported blend mode: %d", dsc->blend_mode); - return; - } - - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - dest_buf_u16[dest_x] = res; - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], opa); - } - else { - if(opa >= LV_OPA_MAX) - dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], mask_buf[dest_x]); - else - dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], LV_OPA_MIX2(mask_buf[dest_x], opa)); - } - } - - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - if(mask_buf) mask_buf += mask_stride; - } - } -} -#endif - -#if LV_DRAW_SW_SUPPORT_AL88 -static void LV_ATTRIBUTE_FAST_MEM al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint16_t * dest_buf_u16 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color16a_t * src_buf_al88 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - dest_buf_u16[dest_x] = lv_color_8_16_mix(src_buf_al88[src_x].lumi, dest_buf_u16[dest_x], src_buf_al88[src_x].alpha); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - dest_buf_u16[dest_x] = lv_color_8_16_mix(src_buf_al88[src_x].lumi, dest_buf_u16[dest_x], - LV_OPA_MIX2(src_buf_al88[src_x].alpha, opa)); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - dest_buf_u16[dest_x] = lv_color_8_16_mix(src_buf_al88[src_x].lumi, dest_buf_u16[dest_x], - LV_OPA_MIX2(src_buf_al88[src_x].alpha, mask_buf[dest_x])); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_AL88_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - dest_buf_u16[dest_x] = lv_color_8_16_mix(src_buf_al88[src_x].lumi, dest_buf_u16[dest_x], - LV_OPA_MIX3(src_buf_al88[src_x].alpha, mask_buf[dest_x], opa)); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - uint16_t res = 0; - for(y = 0; y < h; y++) { - lv_color16_t * dest_buf_c16 = (lv_color16_t *)dest_buf_u16; - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) { - uint8_t rb = src_buf_al88[src_x].lumi >> 3; - uint8_t g = src_buf_al88[src_x].lumi >> 2; - switch(dsc->blend_mode) { - case LV_BLEND_MODE_ADDITIVE: - res = (LV_MIN(dest_buf_c16[dest_x].red + rb, 31)) << 11; - res += (LV_MIN(dest_buf_c16[dest_x].green + g, 63)) << 5; - res += LV_MIN(dest_buf_c16[dest_x].blue + rb, 31); - break; - case LV_BLEND_MODE_SUBTRACTIVE: - res = (LV_MAX(dest_buf_c16[dest_x].red - rb, 0)) << 11; - res += (LV_MAX(dest_buf_c16[dest_x].green - g, 0)) << 5; - res += LV_MAX(dest_buf_c16[dest_x].blue - rb, 0); - break; - case LV_BLEND_MODE_MULTIPLY: - res = ((dest_buf_c16[dest_x].red * rb) >> 5) << 11; - res += ((dest_buf_c16[dest_x].green * g) >> 6) << 5; - res += (dest_buf_c16[dest_x].blue * rb) >> 5; - break; - default: - LV_LOG_WARN("Not supported blend mode: %d", dsc->blend_mode); - return; - } - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], src_buf_al88[src_x].alpha); - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], LV_OPA_MIX2(opa, src_buf_al88[src_x].alpha)); - } - else { - if(opa >= LV_OPA_MAX) dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], mask_buf[dest_x]); - else dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], LV_OPA_MIX3(mask_buf[dest_x], opa, - src_buf_al88[src_x].alpha)); - } - } - - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - if(mask_buf) mask_buf += mask_stride; - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_L8 - -static void LV_ATTRIBUTE_FAST_MEM l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint16_t * dest_buf_u16 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_l8 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - dest_buf_u16[dest_x] = l8_to_rgb565(src_buf_l8[src_x]); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_l8 += src_stride; - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - dest_buf_u16[dest_x] = lv_color_8_16_mix(src_buf_l8[src_x], dest_buf_u16[dest_x], opa); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_l8 += src_stride; - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - dest_buf_u16[dest_x] = lv_color_8_16_mix(src_buf_l8[src_x], dest_buf_u16[dest_x], mask_buf[dest_x]); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_l8 += src_stride; - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x++) { - dest_buf_u16[dest_x] = lv_color_8_16_mix(src_buf_l8[src_x], dest_buf_u16[dest_x], LV_OPA_MIX2(mask_buf[dest_x], opa)); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_l8 += src_stride; - mask_buf += mask_stride; - } - } - } - } - else { - uint16_t res = 0; - for(y = 0; y < h; y++) { - lv_color16_t * dest_buf_c16 = (lv_color16_t *)dest_buf_u16; - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) { - uint8_t rb = src_buf_l8[src_x] >> 3; - uint8_t g = src_buf_l8[src_x] >> 2; - switch(dsc->blend_mode) { - case LV_BLEND_MODE_ADDITIVE: - res = (LV_MIN(dest_buf_c16[dest_x].red + rb, 31)) << 11; - res += (LV_MIN(dest_buf_c16[dest_x].green + g, 63)) << 5; - res += LV_MIN(dest_buf_c16[dest_x].blue + rb, 31); - break; - case LV_BLEND_MODE_SUBTRACTIVE: - res = (LV_MAX(dest_buf_c16[dest_x].red - rb, 0)) << 11; - res += (LV_MAX(dest_buf_c16[dest_x].green - g, 0)) << 5; - res += LV_MAX(dest_buf_c16[dest_x].blue - rb, 0); - break; - case LV_BLEND_MODE_MULTIPLY: - res = ((dest_buf_c16[dest_x].red * rb) >> 5) << 11; - res += ((dest_buf_c16[dest_x].green * g) >> 6) << 5; - res += (dest_buf_c16[dest_x].blue * rb) >> 5; - break; - default: - LV_LOG_WARN("Not supported blend mode: %d", dsc->blend_mode); - return; - } - - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - dest_buf_u16[dest_x] = res; - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], opa); - } - else { - if(opa >= LV_OPA_MAX) dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], mask_buf[dest_x]); - else dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], LV_OPA_MIX2(mask_buf[dest_x], opa)); - } - } - - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_l8 += src_stride; - if(mask_buf) mask_buf += mask_stride; - } - } -} - -#endif - -static void LV_ATTRIBUTE_FAST_MEM rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint16_t * dest_buf_u16 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint16_t * src_buf_u16 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565(dsc)) { - uint32_t line_in_bytes = w * 2; - for(y = 0; y < h; y++) { - lv_memcpy(dest_buf_u16, src_buf_u16, line_in_bytes); - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - dest_buf_u16[x] = lv_color_16_16_mix(src_buf_u16[x], dest_buf_u16[x], opa); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - dest_buf_u16[x] = lv_color_16_16_mix(src_buf_u16[x], dest_buf_u16[x], mask_buf[x]); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride); - mask_buf += mask_stride; - } - } - } - else { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(x = 0; x < w; x++) { - dest_buf_u16[x] = lv_color_16_16_mix(src_buf_u16[x], dest_buf_u16[x], LV_OPA_MIX2(mask_buf[x], opa)); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - uint16_t res = 0; - for(y = 0; y < h; y++) { - lv_color16_t * dest_buf_c16 = (lv_color16_t *) dest_buf_u16; - lv_color16_t * src_buf_c16 = (lv_color16_t *) src_buf_u16; - for(x = 0; x < w; x++) { - switch(dsc->blend_mode) { - case LV_BLEND_MODE_ADDITIVE: - if(src_buf_u16[x] == 0x0000) continue; /*Do not add pure black*/ - res = (LV_MIN(dest_buf_c16[x].red + src_buf_c16[x].red, 31)) << 11; - res += (LV_MIN(dest_buf_c16[x].green + src_buf_c16[x].green, 63)) << 5; - res += LV_MIN(dest_buf_c16[x].blue + src_buf_c16[x].blue, 31); - break; - case LV_BLEND_MODE_SUBTRACTIVE: - if(src_buf_u16[x] == 0x0000) continue; /*Do not subtract pure black*/ - res = (LV_MAX(dest_buf_c16[x].red - src_buf_c16[x].red, 0)) << 11; - res += (LV_MAX(dest_buf_c16[x].green - src_buf_c16[x].green, 0)) << 5; - res += LV_MAX(dest_buf_c16[x].blue - src_buf_c16[x].blue, 0); - break; - case LV_BLEND_MODE_MULTIPLY: - if(src_buf_u16[x] == 0xffff) continue; /*Do not multiply with pure white (considered as 1)*/ - res = ((dest_buf_c16[x].red * src_buf_c16[x].red) >> 5) << 11; - res += ((dest_buf_c16[x].green * src_buf_c16[x].green) >> 6) << 5; - res += (dest_buf_c16[x].blue * src_buf_c16[x].blue) >> 5; - break; - default: - LV_LOG_WARN("Not supported blend mode: %d", dsc->blend_mode); - return; - } - - if(mask_buf == NULL) { - dest_buf_u16[x] = lv_color_16_16_mix(res, dest_buf_u16[x], opa); - } - else { - if(opa >= LV_OPA_MAX) dest_buf_u16[x] = lv_color_16_16_mix(res, dest_buf_u16[x], mask_buf[x]); - else dest_buf_u16[x] = lv_color_16_16_mix(res, dest_buf_u16[x], LV_OPA_MIX2(mask_buf[x], opa)); - } - } - - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride); - if(mask_buf) mask_buf += mask_stride; - } - } -} - -#if LV_DRAW_SW_SUPPORT_RGB888 - -static void LV_ATTRIBUTE_FAST_MEM rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, const uint8_t src_px_size) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint16_t * dest_buf_u16 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_u8 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565(dsc, src_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - dest_buf_u16[dest_x] = ((src_buf_u8[src_x + 2] & 0xF8) << 8) + - ((src_buf_u8[src_x + 1] & 0xFC) << 3) + - ((src_buf_u8[src_x + 0] & 0xF8) >> 3); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u8 += src_stride; - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc, src_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], opa); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u8 += src_stride; - } - } - } - if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc, src_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], mask_buf[dest_x]); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u8 += src_stride; - mask_buf += mask_stride; - } - } - } - if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc, src_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], LV_OPA_MIX2(mask_buf[dest_x], opa)); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u8 += src_stride; - mask_buf += mask_stride; - } - } - } - } - else { - uint16_t res = 0; - for(y = 0; y < h; y++) { - lv_color16_t * dest_buf_c16 = (lv_color16_t *) dest_buf_u16; - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) { - switch(dsc->blend_mode) { - case LV_BLEND_MODE_ADDITIVE: - res = (LV_MIN(dest_buf_c16[dest_x].red + (src_buf_u8[src_x + 2] >> 3), 31)) << 11; - res += (LV_MIN(dest_buf_c16[dest_x].green + (src_buf_u8[src_x + 1] >> 2), 63)) << 5; - res += LV_MIN(dest_buf_c16[dest_x].blue + (src_buf_u8[src_x + 0] >> 3), 31); - break; - case LV_BLEND_MODE_SUBTRACTIVE: - res = (LV_MAX(dest_buf_c16[dest_x].red - (src_buf_u8[src_x + 2] >> 3), 0)) << 11; - res += (LV_MAX(dest_buf_c16[dest_x].green - (src_buf_u8[src_x + 1] >> 2), 0)) << 5; - res += LV_MAX(dest_buf_c16[dest_x].blue - (src_buf_u8[src_x + 0] >> 3), 0); - break; - case LV_BLEND_MODE_MULTIPLY: - res = ((dest_buf_c16[dest_x].red * (src_buf_u8[src_x + 2] >> 3)) >> 5) << 11; - res += ((dest_buf_c16[dest_x].green * (src_buf_u8[src_x + 1] >> 2)) >> 6) << 5; - res += (dest_buf_c16[dest_x].blue * (src_buf_u8[src_x + 0] >> 3)) >> 5; - break; - default: - LV_LOG_WARN("Not supported blend mode: %d", dsc->blend_mode); - return; - } - - if(mask_buf == NULL) { - dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], opa); - } - else { - if(opa >= LV_OPA_MAX) dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], mask_buf[dest_x]); - else dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], LV_OPA_MIX2(mask_buf[dest_x], opa)); - } - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u8 += src_stride; - if(mask_buf) mask_buf += mask_stride; - } - - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_ARGB8888 - -static void LV_ATTRIBUTE_FAST_MEM argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint16_t * dest_buf_u16 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_u8 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) { - dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], src_buf_u8[src_x + 3]); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u8 += src_stride; - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) { - dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], LV_OPA_MIX2(src_buf_u8[src_x + 3], - opa)); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u8 += src_stride; - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) { - dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], - LV_OPA_MIX2(src_buf_u8[src_x + 3], mask_buf[dest_x])); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u8 += src_stride; - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) { - dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], - LV_OPA_MIX3(src_buf_u8[src_x + 3], mask_buf[dest_x], opa)); - } - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u8 += src_stride; - mask_buf += mask_stride; - } - } - } - } - else { - uint16_t res = 0; - for(y = 0; y < h; y++) { - lv_color16_t * dest_buf_c16 = (lv_color16_t *) dest_buf_u16; - for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) { - switch(dsc->blend_mode) { - case LV_BLEND_MODE_ADDITIVE: - res = (LV_MIN(dest_buf_c16[dest_x].red + (src_buf_u8[src_x + 2] >> 3), 31)) << 11; - res += (LV_MIN(dest_buf_c16[dest_x].green + (src_buf_u8[src_x + 1] >> 2), 63)) << 5; - res += LV_MIN(dest_buf_c16[dest_x].blue + (src_buf_u8[src_x + 0] >> 3), 31); - break; - case LV_BLEND_MODE_SUBTRACTIVE: - res = (LV_MAX(dest_buf_c16[dest_x].red - (src_buf_u8[src_x + 2] >> 3), 0)) << 11; - res += (LV_MAX(dest_buf_c16[dest_x].green - (src_buf_u8[src_x + 1] >> 2), 0)) << 5; - res += LV_MAX(dest_buf_c16[dest_x].blue - (src_buf_u8[src_x + 0] >> 3), 0); - break; - case LV_BLEND_MODE_MULTIPLY: - res = ((dest_buf_c16[dest_x].red * (src_buf_u8[src_x + 2] >> 3)) >> 5) << 11; - res += ((dest_buf_c16[dest_x].green * (src_buf_u8[src_x + 1] >> 2)) >> 6) << 5; - res += (dest_buf_c16[dest_x].blue * (src_buf_u8[src_x + 0] >> 3)) >> 5; - break; - default: - LV_LOG_WARN("Not supported blend mode: %d", dsc->blend_mode); - return; - } - - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], src_buf_u8[src_x + 3]); - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], LV_OPA_MIX2(opa, src_buf_u8[src_x + 3])); - } - else { - if(opa >= LV_OPA_MAX) dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], mask_buf[dest_x]); - else dest_buf_u16[dest_x] = lv_color_16_16_mix(res, dest_buf_u16[dest_x], LV_OPA_MIX3(mask_buf[dest_x], opa, - src_buf_u8[src_x + 3])); - } - } - - dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride); - src_buf_u8 += src_stride; - if(mask_buf) mask_buf += mask_stride; - } - } -} - -#endif - -static inline uint16_t LV_ATTRIBUTE_FAST_MEM l8_to_rgb565(const uint8_t c1) -{ - return ((c1 & 0xF8) << 8) + ((c1 & 0xFC) << 3) + ((c1 & 0xF8) >> 3); -} - -static inline uint16_t LV_ATTRIBUTE_FAST_MEM lv_color_8_16_mix(const uint8_t c1, uint16_t c2, uint8_t mix) -{ - - if(mix == 0) { - return c2; - } - else if(mix == 255) { - return ((c1 & 0xF8) << 8) + ((c1 & 0xFC) << 3) + ((c1 & 0xF8) >> 3); - } - else { - lv_opa_t mix_inv = 255 - mix; - - return ((((c1 >> 3) * mix + ((c2 >> 11) & 0x1F) * mix_inv) << 3) & 0xF800) + - ((((c1 >> 2) * mix + ((c2 >> 5) & 0x3F) * mix_inv) >> 3) & 0x07E0) + - (((c1 >> 3) * mix + (c2 & 0x1F) * mix_inv) >> 8); - } -} - -static inline uint16_t LV_ATTRIBUTE_FAST_MEM lv_color_24_16_mix(const uint8_t * c1, uint16_t c2, uint8_t mix) -{ - if(mix == 0) { - return c2; - } - else if(mix == 255) { - return ((c1[2] & 0xF8) << 8) + ((c1[1] & 0xFC) << 3) + ((c1[0] & 0xF8) >> 3); - } - else { - lv_opa_t mix_inv = 255 - mix; - - return ((((c1[2] >> 3) * mix + ((c2 >> 11) & 0x1F) * mix_inv) << 3) & 0xF800) + - ((((c1[1] >> 2) * mix + ((c2 >> 5) & 0x3F) * mix_inv) >> 3) & 0x07E0) + - (((c1[0] >> 3) * mix + (c2 & 0x1F) * mix_inv) >> 8); - } -} - -#if LV_DRAW_SW_SUPPORT_I1 - -static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t bit_idx) -{ - return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1; -} - -#endif - -static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, uint32_t stride) -{ - return (void *)((uint8_t *)buf + stride); -} - -#endif - -#endif diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.h b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.h deleted file mode 100644 index d14bfd9..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @file lv_draw_sw_blend_to_rgb565.h - * - */ - -#ifndef LV_DRAW_SW_BLEND_TO_RGB565_H -#define LV_DRAW_SW_BLEND_TO_RGB565_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_draw_sw.h" -#if LV_USE_DRAW_SW - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_color_to_rgb565(lv_draw_sw_blend_fill_dsc_t * dsc); - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_image_to_rgb565(lv_draw_sw_blend_image_dsc_t * dsc); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_SW*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_BLEND_TO_RGB565_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c deleted file mode 100644 index e29e934..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c +++ /dev/null @@ -1,985 +0,0 @@ -/** - * @file lv_draw_sw_blend_to_rgb888.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_sw_blend_to_rgb888.h" -#if LV_USE_DRAW_SW - -#if LV_DRAW_SW_SUPPORT_RGB888 - -#include "lv_draw_sw_blend_private.h" -#include "../../../misc/lv_math.h" -#include "../../../display/lv_display.h" -#include "../../../core/lv_refr.h" -#include "../../../misc/lv_color.h" -#include "../../../stdlib/lv_string.h" - -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON - #include "neon/lv_blend_neon.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM - #include "helium/lv_blend_helium.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM - #include LV_DRAW_SW_ASM_CUSTOM_INCLUDE -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -#if LV_DRAW_SW_SUPPORT_AL88 - static void /* LV_ATTRIBUTE_FAST_MEM */ al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size); -#endif - -#if LV_DRAW_SW_SUPPORT_I1 - static void /* LV_ATTRIBUTE_FAST_MEM */ i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size); - - static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, int32_t bit_idx); -#endif - -#if LV_DRAW_SW_SUPPORT_L8 - static void /* LV_ATTRIBUTE_FAST_MEM */ l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size); -#endif - -#if LV_DRAW_SW_SUPPORT_RGB565 - static void /* LV_ATTRIBUTE_FAST_MEM */ rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size); -#endif - -static void /* LV_ATTRIBUTE_FAST_MEM */ rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, - const uint8_t dest_px_size, - uint32_t src_px_size); - -#if LV_DRAW_SW_SUPPORT_ARGB8888 -static void /* LV_ATTRIBUTE_FAST_MEM */ argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dest_px_size); -#endif - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ lv_color_8_24_mix(const uint8_t src, uint8_t * dest, uint8_t mix); - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ lv_color_24_24_mix(const uint8_t * src, uint8_t * dest, uint8_t mix); - -static inline void /* LV_ATTRIBUTE_FAST_MEM */ blend_non_normal_pixel(uint8_t * dest, lv_color32_t src, - lv_blend_mode_t mode); -static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * buf, uint32_t stride); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888 - #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK - #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA - #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888 - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_WITH_OPA - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_WITH_MASK - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA - #define LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888 - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA - #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888 - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA - #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888 - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA - #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_888 - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_OPA(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_MASK - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_MASK(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_MIX_MASK_OPA - #define LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_MIX_MASK_OPA(...) LV_RESULT_INVALID -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_color_to_rgb888(lv_draw_sw_blend_fill_dsc_t * dsc, uint32_t dest_px_size) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - const lv_opa_t * mask = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - int32_t dest_stride = dsc->dest_stride; - - int32_t x; - int32_t y; - - LV_UNUSED(w); - LV_UNUSED(h); - LV_UNUSED(x); - LV_UNUSED(y); - LV_UNUSED(opa); - LV_UNUSED(mask); - LV_UNUSED(mask_stride); - LV_UNUSED(dest_stride); - - /*Simple fill*/ - if(mask == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB888(dsc, dest_px_size)) { - if(dest_px_size == 3) { - uint8_t * dest_buf_u8 = dsc->dest_buf; - uint8_t * dest_buf_ori = dsc->dest_buf; - w *= dest_px_size; - - for(x = 0; x < w; x += 3) { - dest_buf_u8[x + 0] = dsc->color.blue; - dest_buf_u8[x + 1] = dsc->color.green; - dest_buf_u8[x + 2] = dsc->color.red; - } - - dest_buf_u8 += dest_stride; - - for(y = 1; y < h; y++) { - lv_memcpy(dest_buf_u8, dest_buf_ori, w); - dest_buf_u8 += dest_stride; - } - } - if(dest_px_size == 4) { - uint32_t color32 = lv_color_to_u32(dsc->color); - uint32_t * dest_buf_u32 = dsc->dest_buf; - for(y = 0; y < h; y++) { - for(x = 0; x <= w - 16; x += 16) { - dest_buf_u32[x + 0] = color32; - dest_buf_u32[x + 1] = color32; - dest_buf_u32[x + 2] = color32; - dest_buf_u32[x + 3] = color32; - - dest_buf_u32[x + 4] = color32; - dest_buf_u32[x + 5] = color32; - dest_buf_u32[x + 6] = color32; - dest_buf_u32[x + 7] = color32; - - dest_buf_u32[x + 8] = color32; - dest_buf_u32[x + 9] = color32; - dest_buf_u32[x + 10] = color32; - dest_buf_u32[x + 11] = color32; - - dest_buf_u32[x + 12] = color32; - dest_buf_u32[x + 13] = color32; - dest_buf_u32[x + 14] = color32; - dest_buf_u32[x + 15] = color32; - } - for(; x < w; x ++) { - dest_buf_u32[x] = color32; - } - - dest_buf_u32 = drawbuf_next_row(dest_buf_u32, dest_stride); - } - } - } - } - /*Opacity only*/ - else if(mask == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA(dsc, dest_px_size)) { - uint32_t color32 = lv_color_to_u32(dsc->color); - uint8_t * dest_buf = dsc->dest_buf; - w *= dest_px_size; - for(y = 0; y < h; y++) { - for(x = 0; x < w; x += dest_px_size) { - lv_color_24_24_mix((const uint8_t *)&color32, &dest_buf[x], opa); - } - - dest_buf = drawbuf_next_row(dest_buf, dest_stride); - } - } - } - /*Masked with full opacity*/ - else if(mask && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK(dsc, dest_px_size)) { - uint32_t color32 = lv_color_to_u32(dsc->color); - uint8_t * dest_buf = dsc->dest_buf; - w *= dest_px_size; - - for(y = 0; y < h; y++) { - uint32_t mask_x; - for(x = 0, mask_x = 0; x < w; x += dest_px_size, mask_x++) { - lv_color_24_24_mix((const uint8_t *)&color32, &dest_buf[x], mask[mask_x]); - } - dest_buf += dest_stride; - mask += mask_stride; - } - } - } - /*Masked with opacity*/ - else { - if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size)) { - uint32_t color32 = lv_color_to_u32(dsc->color); - uint8_t * dest_buf = dsc->dest_buf; - w *= dest_px_size; - - for(y = 0; y < h; y++) { - uint32_t mask_x; - for(x = 0, mask_x = 0; x < w; x += dest_px_size, mask_x++) { - lv_color_24_24_mix((const uint8_t *) &color32, &dest_buf[x], LV_OPA_MIX2(opa, mask[mask_x])); - } - dest_buf += dest_stride; - mask += mask_stride; - } - } - } -} - -void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_image_to_rgb888(lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size) -{ - - switch(dsc->src_color_format) { -#if LV_DRAW_SW_SUPPORT_RGB565 - case LV_COLOR_FORMAT_RGB565: - rgb565_image_blend(dsc, dest_px_size); - break; -#endif - case LV_COLOR_FORMAT_RGB888: - rgb888_image_blend(dsc, dest_px_size, 3); - break; -#if LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - rgb888_image_blend(dsc, dest_px_size, 4); - break; -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 - case LV_COLOR_FORMAT_ARGB8888: - argb8888_image_blend(dsc, dest_px_size); - break; -#endif -#if LV_DRAW_SW_SUPPORT_L8 - case LV_COLOR_FORMAT_L8: - l8_image_blend(dsc, dest_px_size); - break; -#endif -#if LV_DRAW_SW_SUPPORT_AL88 - case LV_COLOR_FORMAT_AL88: - al88_image_blend(dsc, dest_px_size); - break; -#endif -#if LV_DRAW_SW_SUPPORT_I1 - case LV_COLOR_FORMAT_I1: - i1_image_blend(dsc, dest_px_size); - break; -#endif - default: - LV_LOG_WARN("Not supported source color format"); - break; - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#if LV_DRAW_SW_SUPPORT_I1 -static void LV_ATTRIBUTE_FAST_MEM i1_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_u8 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_i1 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_888(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - dest_buf_u8[dest_x + 2] = chan_val; - dest_buf_u8[dest_x + 1] = chan_val; - dest_buf_u8[dest_x + 0] = chan_val; - } - dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - lv_color_8_24_mix(chan_val, &dest_buf_u8[dest_x], opa); - } - dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_WITH_MASK(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - lv_color_8_24_mix(chan_val, &dest_buf_u8[dest_x], mask_buf[src_x]); - } - dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_I1_BLEND_NORMAL_TO_888_MIX_MASK_OPA(dsc)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - uint8_t chan_val = get_bit(src_buf_i1, src_x) * 255; - lv_color_8_24_mix(chan_val, &dest_buf_u8[dest_x], LV_OPA_MIX2(opa, mask_buf[src_x])); - } - dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color32_t src_argb; - src_argb.red = get_bit(src_buf_i1, src_x) * 255; - src_argb.green = src_argb.red; - src_argb.blue = src_argb.red; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[src_x], opa); - blend_non_normal_pixel(&dest_buf_u8[dest_x], src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_u8 = drawbuf_next_row(dest_buf_u8, dest_stride); - src_buf_i1 = drawbuf_next_row(src_buf_i1, src_stride); - } - } -} -#endif - -#if LV_DRAW_SW_SUPPORT_AL88 -static void LV_ATTRIBUTE_FAST_MEM al88_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_u8 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color16a_t * src_buf_al88 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color_8_24_mix(src_buf_al88[src_x].lumi, &dest_buf_u8[dest_x], src_buf_al88[src_x].alpha); - } - dest_buf_u8 += dest_stride; - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color_8_24_mix(src_buf_al88[src_x].lumi, &dest_buf_u8[dest_x], LV_OPA_MIX2(src_buf_al88[src_x].alpha, opa)); - } - dest_buf_u8 += dest_stride; - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color_8_24_mix(src_buf_al88[src_x].lumi, &dest_buf_u8[dest_x], LV_OPA_MIX2(src_buf_al88[src_x].alpha, - mask_buf[src_x])); - } - dest_buf_u8 += dest_stride; - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color_8_24_mix(src_buf_al88[src_x].lumi, &dest_buf_u8[dest_x], LV_OPA_MIX3(src_buf_al88[src_x].alpha, - mask_buf[src_x], opa)); - } - dest_buf_u8 += dest_stride; - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color32_t src_argb; - src_argb.red = src_argb.green = src_argb.blue = src_buf_al88[src_x].lumi; - if(mask_buf == NULL) src_argb.alpha = LV_OPA_MIX2(src_buf_al88[src_x].alpha, opa); - else src_argb.alpha = LV_OPA_MIX3(src_buf_al88[src_x].alpha, mask_buf[dest_x], opa); - blend_non_normal_pixel(&dest_buf_u8[dest_x], src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_u8 += dest_stride; - src_buf_al88 = drawbuf_next_row(src_buf_al88, src_stride); - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_L8 - -static void LV_ATTRIBUTE_FAST_MEM l8_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_u8 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf_l8 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - dest_buf_u8[dest_x + 2] = src_buf_l8[src_x]; - dest_buf_u8[dest_x + 1] = src_buf_l8[src_x]; - dest_buf_u8[dest_x + 0] = src_buf_l8[src_x]; - } - dest_buf_u8 += dest_stride; - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color_8_24_mix(src_buf_l8[src_x], &dest_buf_u8[dest_x], opa); - } - dest_buf_u8 += dest_stride; - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color_8_24_mix(src_buf_l8[src_x], &dest_buf_u8[dest_x], mask_buf[src_x]); - } - dest_buf_u8 += dest_stride; - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_L8_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color_8_24_mix(src_buf_l8[src_x], &dest_buf_u8[dest_x], LV_OPA_MIX2(opa, mask_buf[src_x])); - } - dest_buf_u8 += dest_stride; - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - src_argb.red = src_buf_l8[src_x]; - src_argb.green = src_buf_l8[src_x]; - src_argb.blue = src_buf_l8[src_x]; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - blend_non_normal_pixel(&dest_buf_u8[dest_x], src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_u8 += dest_stride; - src_buf_l8 = drawbuf_next_row(src_buf_l8, src_stride); - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_RGB565 - -static void LV_ATTRIBUTE_FAST_MEM rgb565_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf_u8 = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color16_t * src_buf_c16 = (const lv_color16_t *) dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t src_x; - int32_t dest_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - dest_buf_u8[dest_x + 2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/ - dest_buf_u8[dest_x + 1] = (src_buf_c16[src_x].green * 1037) >> 8; - dest_buf_u8[dest_x + 0] = (src_buf_c16[src_x].blue * 2106) >> 8; - } - dest_buf_u8 += dest_stride; - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dest_px_size)) { - uint8_t res[3]; - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - res[2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/ - res[1] = (src_buf_c16[src_x].green * 1037) >> 8; - res[0] = (src_buf_c16[src_x].blue * 2106) >> 8; - lv_color_24_24_mix(res, &dest_buf_u8[dest_x], opa); - } - dest_buf_u8 += dest_stride; - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dest_px_size)) { - uint8_t res[3]; - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - res[2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/ - res[1] = (src_buf_c16[src_x].green * 1037) >> 8; - res[0] = (src_buf_c16[src_x].blue * 2106) >> 8; - lv_color_24_24_mix(res, &dest_buf_u8[dest_x], mask_buf[src_x]); - } - dest_buf_u8 += dest_stride; - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - mask_buf += mask_stride; - } - } - } - else { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size)) { - uint8_t res[3]; - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - res[2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/ - res[1] = (src_buf_c16[src_x].green * 1037) >> 8; - res[0] = (src_buf_c16[src_x].blue * 2106) >> 8; - lv_color_24_24_mix(res, &dest_buf_u8[dest_x], LV_OPA_MIX2(opa, mask_buf[src_x])); - } - dest_buf_u8 += dest_stride; - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(src_x = 0, dest_x = 0; src_x < w; src_x++, dest_x += dest_px_size) { - src_argb.red = (src_buf_c16[src_x].red * 2106) >> 8; - src_argb.green = (src_buf_c16[src_x].green * 1037) >> 8; - src_argb.blue = (src_buf_c16[src_x].blue * 2106) >> 8; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[src_x], opa); - blend_non_normal_pixel(&dest_buf_u8[dest_x], src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf_u8 += dest_stride; - src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride); - } - } -} - -#endif - -static void LV_ATTRIBUTE_FAST_MEM rgb888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, const uint8_t dest_px_size, - uint32_t src_px_size) -{ - int32_t w = dsc->dest_w * dest_px_size; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const uint8_t * src_buf = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - /*Special case*/ - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888(dsc, dest_px_size, src_px_size)) { - if(src_px_size == dest_px_size) { - for(y = 0; y < h; y++) { - lv_memcpy(dest_buf, src_buf, w); - dest_buf += dest_stride; - src_buf += src_stride; - } - } - else { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x += dest_px_size, src_x += src_px_size) { - dest_buf[dest_x + 0] = src_buf[src_x + 0]; - dest_buf[dest_x + 1] = src_buf[src_x + 1]; - dest_buf[dest_x + 2] = src_buf[src_x + 2]; - } - dest_buf += dest_stride; - src_buf += src_stride; - } - } - } - } - if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dest_px_size, src_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x += dest_px_size, src_x += src_px_size) { - lv_color_24_24_mix(&src_buf[src_x], &dest_buf[dest_x], opa); - } - dest_buf += dest_stride; - src_buf += src_stride; - } - } - } - if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dest_px_size, src_px_size)) { - uint32_t mask_x; - for(y = 0; y < h; y++) { - for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x += dest_px_size, src_x += src_px_size) { - lv_color_24_24_mix(&src_buf[src_x], &dest_buf[dest_x], mask_buf[mask_x]); - } - dest_buf += dest_stride; - src_buf += src_stride; - mask_buf += mask_stride; - } - } - } - if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size, src_px_size)) { - uint32_t mask_x; - for(y = 0; y < h; y++) { - for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x += dest_px_size, src_x += src_px_size) { - lv_color_24_24_mix(&src_buf[src_x], &dest_buf[dest_x], LV_OPA_MIX2(opa, mask_buf[mask_x])); - } - dest_buf += dest_stride; - src_buf += src_stride; - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; dest_x < w; dest_x += dest_px_size, src_x += src_px_size) { - src_argb.red = src_buf[src_x + 2]; - src_argb.green = src_buf[src_x + 1]; - src_argb.blue = src_buf[src_x + 0]; - if(mask_buf == NULL) src_argb.alpha = opa; - else src_argb.alpha = LV_OPA_MIX2(mask_buf[dest_x], opa); - - blend_non_normal_pixel(&dest_buf[dest_x], src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf += dest_stride; - src_buf += src_stride; - } - } -} - -#if LV_DRAW_SW_SUPPORT_ARGB8888 - -static void LV_ATTRIBUTE_FAST_MEM argb8888_image_blend(lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dest_px_size) -{ - int32_t w = dsc->dest_w; - int32_t h = dsc->dest_h; - lv_opa_t opa = dsc->opa; - uint8_t * dest_buf = dsc->dest_buf; - int32_t dest_stride = dsc->dest_stride; - const lv_color32_t * src_buf_c32 = dsc->src_buf; - int32_t src_stride = dsc->src_stride; - const lv_opa_t * mask_buf = dsc->mask_buf; - int32_t mask_stride = dsc->mask_stride; - - int32_t dest_x; - int32_t src_x; - int32_t y; - - if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { - if(mask_buf == NULL && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x], src_buf_c32[src_x].alpha); - } - dest_buf += dest_stride; - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } - } - else if(mask_buf == NULL && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x], LV_OPA_MIX2(src_buf_c32[src_x].alpha, opa)); - } - dest_buf += dest_stride; - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } - } - else if(mask_buf && opa >= LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x], - LV_OPA_MIX2(src_buf_c32[src_x].alpha, mask_buf[src_x])); - } - dest_buf += dest_stride; - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - mask_buf += mask_stride; - } - } - } - else if(mask_buf && opa < LV_OPA_MAX) { - if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size)) { - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) { - lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x], - LV_OPA_MIX3(src_buf_c32[src_x].alpha, mask_buf[src_x], opa)); - } - dest_buf += dest_stride; - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - mask_buf += mask_stride; - } - } - } - } - else { - lv_color32_t src_argb; - for(y = 0; y < h; y++) { - for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x ++) { - src_argb = src_buf_c32[src_x]; - if(mask_buf == NULL) src_argb.alpha = LV_OPA_MIX2(src_argb.alpha, opa); - else src_argb.alpha = LV_OPA_MIX3(src_argb.alpha, mask_buf[dest_x], opa); - - blend_non_normal_pixel(&dest_buf[dest_x], src_argb, dsc->blend_mode); - } - if(mask_buf) mask_buf += mask_stride; - dest_buf += dest_stride; - src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride); - } - } -} - -#endif - -static inline void LV_ATTRIBUTE_FAST_MEM blend_non_normal_pixel(uint8_t * dest, lv_color32_t src, lv_blend_mode_t mode) -{ - uint8_t res[3] = {0, 0, 0}; - switch(mode) { - case LV_BLEND_MODE_ADDITIVE: - res[0] = LV_MIN(dest[0] + src.blue, 255); - res[1] = LV_MIN(dest[1] + src.green, 255); - res[2] = LV_MIN(dest[2] + src.red, 255); - break; - case LV_BLEND_MODE_SUBTRACTIVE: - res[0] = LV_MAX(dest[0] - src.blue, 0); - res[1] = LV_MAX(dest[1] - src.green, 0); - res[2] = LV_MAX(dest[2] - src.red, 0); - break; - case LV_BLEND_MODE_MULTIPLY: - res[0] = (dest[0] * src.blue) >> 8; - res[1] = (dest[1] * src.green) >> 8; - res[2] = (dest[2] * src.red) >> 8; - break; - default: - LV_LOG_WARN("Not supported blend mode: %d", mode); - return; - } - lv_color_24_24_mix(res, dest, src.alpha); -} - -static inline void LV_ATTRIBUTE_FAST_MEM lv_color_8_24_mix(const uint8_t src, uint8_t * dest, uint8_t mix) -{ - - if(mix == 0) return; - - if(mix >= LV_OPA_MAX) { - dest[0] = src; - dest[1] = src; - dest[2] = src; - } - else { - lv_opa_t mix_inv = 255 - mix; - dest[0] = (uint32_t)((uint32_t)src * mix + dest[0] * mix_inv) >> 8; - dest[1] = (uint32_t)((uint32_t)src * mix + dest[1] * mix_inv) >> 8; - dest[2] = (uint32_t)((uint32_t)src * mix + dest[2] * mix_inv) >> 8; - } -} - -static inline void LV_ATTRIBUTE_FAST_MEM lv_color_24_24_mix(const uint8_t * src, uint8_t * dest, uint8_t mix) -{ - - if(mix == 0) return; - - if(mix >= LV_OPA_MAX) { - dest[0] = src[0]; - dest[1] = src[1]; - dest[2] = src[2]; - } - else { - lv_opa_t mix_inv = 255 - mix; - dest[0] = (uint32_t)((uint32_t)src[0] * mix + dest[0] * mix_inv) >> 8; - dest[1] = (uint32_t)((uint32_t)src[1] * mix + dest[1] * mix_inv) >> 8; - dest[2] = (uint32_t)((uint32_t)src[2] * mix + dest[2] * mix_inv) >> 8; - } -} - -#if LV_DRAW_SW_SUPPORT_I1 - -static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t bit_idx) -{ - return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1; -} - -#endif - - -static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, uint32_t stride) -{ - return (void *)((uint8_t *)buf + stride); -} - -#endif - -#endif diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.h b/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.h deleted file mode 100644 index 441c0d3..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @file lv_draw_sw_blend_to_rgb888.h - * - */ - -#ifndef LV_DRAW_SW_BLEND_TO_RGB888_H -#define LV_DRAW_SW_BLEND_TO_RGB888_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_draw_sw.h" -#if LV_USE_DRAW_SW - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_color_to_rgb888(lv_draw_sw_blend_fill_dsc_t * dsc, - uint32_t dest_px_size); - -void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_image_to_rgb888(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dest_px_size); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_SW*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_BLEND_TO_RGB888_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/neon/lv_blend_neon.S b/L3_Middlewares/LVGL/src/draw/sw/blend/neon/lv_blend_neon.S deleted file mode 100644 index e821204..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/neon/lv_blend_neon.S +++ /dev/null @@ -1,685 +0,0 @@ -/** - * @file lv_blend_neon.S - * - */ - -#ifndef __ASSEMBLY__ -#define __ASSEMBLY__ -#endif - -#include "lv_blend_neon.h" - -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON - -.text -.fpu neon -.arch armv7a -.syntax unified -.altmacro -.p2align 2 - -@ d0 ~ d3 : src B,G,R,A -@ d4 ~ d7 : dst B,G,R,A -@ q8 : src RGB565 raw -@ q9 : dst RGB565 raw -@ q10 ~ q12: pre-multiplied src -@ d26~29 : temp -@ d30 : mask -@ d31 : opa - -FG_MASK .req r0 -BG_MASK .req r1 -DST_ADDR .req r2 -DST_W .req r3 -DST_H .req r4 -DST_STRIDE .req r5 -SRC_ADDR .req r6 -SRC_STRIDE .req r7 -MASK_ADDR .req r8 -MASK_STRIDE .req r9 -W .req r10 -H .req r11 -S_8888_L .qn q0 -S_8888_H .qn q1 -D_8888_L .qn q2 -D_8888_H .qn q3 - S_B .dn d0 - S_G .dn d1 - S_R .dn d2 - S_A .dn d3 - D_B .dn d4 - D_G .dn d5 - D_R .dn d6 - D_A .dn d7 -S_565 .qn q8 -D_565 .qn q9 - S_565_L .dn d16 - S_565_H .dn d17 - D_565_L .dn d18 - D_565_H .dn d19 -PREMULT_B .qn q10 -PREMULT_G .qn q11 -PREMULT_R .qn q12 -TMP_Q0 .qn q13 - TMP_D0 .dn d26 - TMP_D1 .dn d27 -TMP_Q1 .qn q14 - TMP_D2 .dn d28 - TMP_D3 .dn d29 - M_A .dn d30 - OPA .dn d31 - -.macro convert reg, bpp, intlv -.if bpp >= 31 - .if intlv - vzip.8 reg&_B, reg&_R @ BRBRBRBR GGGGGGGG BRBRBRBR AAAAAAAA - vzip.8 reg&_G, reg&_A @ BRBRBRBR GAGAGAGA BRBRBRBR GAGAGAGA - vzip.8 reg&_R, reg&_A @ BRBRBRBR GAGAGAGA BGRABGRA BGRABGRA - vzip.8 reg&_B, reg&_G @ BGRABGRA BGRABGRA BGRABGRA BGRABGRA - .else - vuzp.8 reg&_B, reg&_G @ BRBRBRBR GAGAGAGA BGRABGRA BGRABGRA - vuzp.8 reg&_R, reg&_A @ BRBRBRBR GAGAGAGA BRBRBRBR GAGAGAGA - vuzp.8 reg&_G, reg&_A @ BRBRBRBR GGGGGGGG BRBRBRBR AAAAAAAA - vuzp.8 reg&_B, reg&_R @ BBBBBBBB GGGGGGGG RRRRRRRR AAAAAAAA - .endif -.elseif bpp == 24 - .if intlv @ for init only (same B,G,R for all channel) - vzip.8 reg&_B, reg&_G @ BGBGBGBG BGBGBGBG RRRRRRRR - vzip.16 reg&_B, reg&_R @ BGRRBGRR BGBGBGBG BGRRBGRR - vsli.64 reg&_8888_L, reg&_8888_L, #24 @ BGRBGRRB BGBBGBGB - vsli.64 reg&_B, reg&_G, #48 @ BGRBGRBG - vsri.64 reg&_R, reg&_B, #8 @ GRBGRBGR - vsri.64 reg&_G, reg&_R, #8 @ RBGRBGRB - .endif -.elseif bpp == 16 - .if intlv - vshll.u8 reg&_565, reg&_R, #8 @ RRRrrRRR 00000000 - vshll.u8 TMP_Q0, reg&_G, #8 @ GGGgggGG 00000000 - vshll.u8 TMP_Q1, reg&_B, #8 @ BBBbbBBB 00000000 - vsri.16 reg&_565, TMP_Q0, #5 @ RRRrrGGG gggGG000 - vsri.16 reg&_565, TMP_Q1, #11 @ RRRrrGGG gggBBBbb - .else - vshr.u8 TMP_Q0, reg&_565, #3 @ 000RRRrr 000gggBB - vshrn.i16 reg&_G, reg&_565, #5 @ rrGGGggg - vshrn.i16 reg&_R, TMP_Q0, #5 @ RRRrr000 - vshl.i8 reg&_G, reg&_G, #2 @ GGGggg00 - vshl.i16 TMP_Q1, reg&_565, #3 @ rrGGGggg BBBbb000 - vsri.8 reg&_R, reg&_R, #5 @ RRRrrRRR - vmovn.i16 reg&_B, TMP_Q1 @ BBBbb000 - vsri.8 reg&_G, reg&_G, #6 @ GGGgggGG - vsri.8 reg&_B, reg&_B, #5 @ BBBbbBBB - .endif -.endif -.endm - -.macro ldst op, bpp, len, mem, reg, cvt, wb -.if bpp >= 31 - .if len == 8 - .if cvt - v&op&4.8 {reg&_B, reg&_G, reg&_R, reg&_A}, [mem&_ADDR]&wb - .else - v&op&1.32 {reg&_8888_L, reg&_8888_H}, [mem&_ADDR]&wb - .endif - .else - .if (op == st) && cvt - convert reg, bpp, 1 - .endif - .if len == 7 - v&op&1.32 {reg&_8888_L}, [mem&_ADDR]! - v&op&1.32 {reg&_R}, [mem&_ADDR]! - v&op&1.32 {reg&_A[0]}, [mem&_ADDR]! - .elseif len == 6 - v&op&1.32 {reg&_8888_L}, [mem&_ADDR]! - v&op&1.32 {reg&_R}, [mem&_ADDR]! - .elseif len == 5 - v&op&1.32 {reg&_8888_L}, [mem&_ADDR]! - v&op&1.32 {reg&_R[0]}, [mem&_ADDR]! - .elseif len == 4 - v&op&1.32 {reg&_8888_L}, [mem&_ADDR]&wb - .elseif len == 3 - v&op&1.32 {reg&_B}, [mem&_ADDR]! - v&op&1.32 {reg&_G[0]}, [mem&_ADDR]! - .elseif len == 2 - v&op&1.32 {reg&_B}, [mem&_ADDR]&wb - .elseif len == 1 - v&op&1.32 {reg&_B[0]}, [mem&_ADDR]&wb - .else - .error "[32bpp]len should be 1~8" - .endif - .if (op == ld) && cvt - convert reg, bpp, 0 - .endif - .if (wb&1) && (len != 4) && (len != 2) && (len != 1) - sub mem&_ADDR, #4*len - .endif - .endif -.elseif bpp == 24 - .if len == 8 - .if cvt - v&op&3.8 {reg&_B, reg&_G, reg&_R}, [mem&_ADDR]&wb - .else - v&op&1.8 {reg&_B, reg&_G, reg&_R}, [mem&_ADDR]&wb - .endif - .elseif (len < 8) && (len > 0) - .if cvt - v&op&3.8 {reg&_B[0], reg&_G[0], reg&_R[0]}, [mem&_ADDR]! - .if len > 1 - v&op&3.8 {reg&_B[1], reg&_G[1], reg&_R[1]}, [mem&_ADDR]! - .endif - .if len > 2 - v&op&3.8 {reg&_B[2], reg&_G[2], reg&_R[2]}, [mem&_ADDR]! - .endif - .if len > 3 - v&op&3.8 {reg&_B[3], reg&_G[3], reg&_R[3]}, [mem&_ADDR]! - .endif - .if len > 4 - v&op&3.8 {reg&_B[4], reg&_G[4], reg&_R[4]}, [mem&_ADDR]! - .endif - .if len > 5 - v&op&3.8 {reg&_B[5], reg&_G[5], reg&_R[5]}, [mem&_ADDR]! - .endif - .if len > 6 - v&op&3.8 {reg&_B[6], reg&_G[6], reg&_R[6]}, [mem&_ADDR]! - .endif - .if wb&1 - sub mem&_ADDR, #3*len - .endif - .else - .if len == 7 - v&op&1.32 {reg&_8888_L}, [mem&_ADDR]! - v&op&1.32 {reg&_R[0]}, [mem&_ADDR]! - v&op&1.8 {reg&_R[4]}, [mem&_ADDR]! - .elseif len == 6 - v&op&1.32 {reg&_8888_L}, [mem&_ADDR]! - v&op&1.16 {reg&_R[0]}, [mem&_ADDR]! - .elseif len == 5 - v&op&1.32 {reg&_B}, [mem&_ADDR]! - v&op&1.32 {reg&_G[0]}, [mem&_ADDR]! - v&op&1.16 {reg&_G[2]}, [mem&_ADDR]! - v&op&1.8 {reg&_G[6]}, [mem&_ADDR]! - .elseif len == 4 - v&op&1.32 {reg&_B}, [mem&_ADDR]! - v&op&1.32 {reg&_G[0]}, [mem&_ADDR]! - .elseif len == 3 - v&op&1.32 {reg&_B}, [mem&_ADDR]! - v&op&1.8 {reg&_G[0]}, [mem&_ADDR]! - .elseif len == 2 - v&op&1.32 {reg&_B[0]}, [mem&_ADDR]! - v&op&1.16 {reg&_B[2]}, [mem&_ADDR]! - .elseif len == 1 - v&op&1.16 {reg&_B[0]}, [mem&_ADDR]! - v&op&1.8 {reg&_B[2]}, [mem&_ADDR]! - .endif - .if wb&1 - sub mem&_ADDR, #3*len - .endif - .endif - .else - .error "[24bpp]len should be 1~8" - .endif -.elseif bpp == 16 - .if (op == st) && cvt - convert reg, bpp, 1 - .endif - .if len == 8 - v&op&1.16 {reg&_565}, [mem&_ADDR]&wb - .elseif len == 7 - v&op&1.16 {reg&_565_L}, [mem&_ADDR]! - v&op&1.32 {reg&_565_H[0]}, [mem&_ADDR]! - v&op&1.16 {reg&_565_H[2]}, [mem&_ADDR]! - .if wb&1 - sub mem&_ADDR, #14 - .endif - .elseif len == 6 - v&op&1.16 {reg&_565_L}, [mem&_ADDR]! - v&op&1.32 {reg&_565_H[0]}, [mem&_ADDR]! - .if wb&1 - sub mem&_ADDR, #12 - .endif - .elseif len == 5 - v&op&1.16 {reg&_565_L}, [mem&_ADDR]! - v&op&1.16 {reg&_565_H[0]}, [mem&_ADDR]! - .if wb&1 - sub mem&_ADDR, #10 - .endif - .elseif len == 4 - v&op&1.16 {reg&_565_L}, [mem&_ADDR]&wb - .elseif len == 3 - v&op&1.32 {reg&_565_L[0]}, [mem&_ADDR]! - v&op&1.16 {reg&_565_L[2]}, [mem&_ADDR]! - .if wb&1 - sub mem&_ADDR, #6 - .endif - .elseif len == 2 - v&op&1.32 {reg&_565_L[0]}, [mem&_ADDR]&wb - .elseif len == 1 - v&op&1.16 {reg&_565_L[0]}, [mem&_ADDR]&wb - .else - .error "[16bpp]len should be 1~8" - .endif - .if (op == ld) && cvt - convert reg, bpp, 0 - .endif -.elseif bpp == 8 - .if len == 8 - v&op&1.8 {reg&_A}, [mem&_ADDR]&wb - .elseif len == 7 - v&op&1.32 {reg&_A[0]}, [mem&_ADDR]! - v&op&1.16 {reg&_A[2]}, [mem&_ADDR]! - v&op&1.8 {reg&_A[6]}, [mem&_ADDR]! - .if wb&1 - sub mem&_ADDR, #7 - .endif - .elseif len == 6 - v&op&1.32 {reg&_A[0]}, [mem&_ADDR]! - v&op&1.16 {reg&_A[2]}, [mem&_ADDR]! - .if wb&1 - sub mem&_ADDR, #6 - .endif - .elseif len == 5 - v&op&1.32 {reg&_A[0]}, [mem&_ADDR]! - v&op&1.8 {reg&_A[4]}, [mem&_ADDR]! - .if wb&1 - sub mem&_ADDR, #5 - .endif - .elseif len == 4 - v&op&1.32 {reg&_A[0]}, [mem&_ADDR]&wb - .elseif len == 3 - v&op&1.16 {reg&_A[0]}, [mem&_ADDR]! - v&op&1.8 {reg&_A[2]}, [mem&_ADDR]! - .if wb&1 - sub mem&_ADDR, #3 - .endif - .elseif len == 2 - v&op&1.16 {reg&_A[0]}, [mem&_ADDR]&wb - .elseif len == 1 - v&op&1.8 {reg&_A[0]}, [mem&_ADDR]&wb - .else - .error "[8bpp]len should be 1~8" - .endif -.elseif (bpp == 0) && wb&1 - .if len == 8 - v&op&3.8 {reg&_B[], reg&_G[], reg&_R[]}, [mem&_ADDR] - .else - .error "[color]len should be 8" - .endif -.endif -.if (op == ld) && cvt && (bpp > 8) && (bpp < 32) - vmov.u8 reg&_A, #0xFF -.endif -.endm - -.macro premult alpha - vmull.u8 PREMULT_B, S_B, alpha - vmull.u8 PREMULT_G, S_G, alpha - vmull.u8 PREMULT_R, S_R, alpha -.endm - -.macro init src_bpp, dst_bpp, mask, opa - ldr DST_ADDR, [r0, #4] - ldr DST_W, [r0, #8] - ldr DST_H, [r0, #12] - ldr DST_STRIDE, [r0, #16] - ldr SRC_ADDR, [r0, #20] -.if src_bpp > 0 - ldr SRC_STRIDE, [r0, #24] -.endif -.if mask - ldr MASK_ADDR, [r0, #28] - ldr MASK_STRIDE, [r0, #32] - sub MASK_STRIDE, MASK_STRIDE, DST_W -.endif -.if opa - vld1.8 {OPA[]}, [r0] -.else - vmov.u8 OPA, #0xFF -.endif - - vmvn D_A, OPA -.if dst_bpp == 16 - sub DST_STRIDE, DST_STRIDE, DST_W, lsl #1 -.elseif dst_bpp == 24 - sub DST_STRIDE, DST_STRIDE, DST_W - sub DST_STRIDE, DST_STRIDE, DST_W, lsl #1 -.elseif dst_bpp >= 31 - sub DST_STRIDE, DST_STRIDE, DST_W, lsl #2 -.endif -.if src_bpp == 0 - .if mask || opa - ldst ld, src_bpp, 8, SRC, S, 1 - vmov.u8 S_A, #0xFF - premult OPA - .else - ldst ld, src_bpp, 8, SRC, D, 1 - vmov.u8 D_A, #0xFF - convert D, dst_bpp, 1 - .endif -.else -.if src_bpp == 16 - sub SRC_STRIDE, SRC_STRIDE, DST_W, lsl #1 -.elseif src_bpp == 24 - sub SRC_STRIDE, SRC_STRIDE, DST_W - sub SRC_STRIDE, SRC_STRIDE, DST_W, lsl #1 -.elseif src_bpp >= 31 - sub SRC_STRIDE, SRC_STRIDE, DST_W, lsl #2 -.endif -.endif - mvn FG_MASK, #0 - mvn BG_MASK, #0 -.endm - -@ input: M_A = 255 - fg.alpha -.macro calc_alpha len - vmov.u8 TMP_D0, #0xFD - vmvn D_A, D_A - vcge.u8 TMP_D1, S_A, TMP_D0 @ if (fg.alpha >= LV_OPA_MAX - vcge.u8 TMP_D2, D_A, TMP_D0 @ || bg.alpha <= LV_OPA_MIN) - vorr TMP_D2, TMP_D1 - vcge.u8 TMP_D3, M_A, TMP_D0 @ elseif (fg.alpha <= LV_OPA_MIN) - vmvn TMP_Q1, TMP_Q1 - vshrn.i16 TMP_D0, TMP_Q1, #4 - vmov FG_MASK, BG_MASK, TMP_D0 - cbz FG_MASK, 99f @ return fg; - vmull.u8 TMP_Q0, M_A, D_A @ D_A = 255 - LV_OPA_MIX2(255 - fg.alpha, 255 - bg.alpha) - vqrshrn.u16 M_A, TMP_Q0, #8 - vbif M_A, D_A, TMP_D3 @ insert original D_A when fg.alpha <= LV_OPA_MIN - vmvn D_A, M_A - cbz BG_MASK, 99f @ return bg; - vmov.u8 TMP_D2, #0xFF - vmovl.u8 TMP_Q0, D_A - .if len > 4 - vmovl.u16 S_565, TMP_D1 - .endif - vmovl.u16 TMP_Q0, TMP_D0 - vmull.u8 TMP_Q1, S_A, TMP_D2 - vcvt.f32.u32 TMP_Q0, TMP_Q0 - .if len > 4 - vmovl.u16 D_565, TMP_D3 - vcvt.f32.u32 S_565, S_565 - .endif - vmovl.u16 TMP_Q1, TMP_D2 - vrecpe.f32 TMP_Q0, TMP_Q0 - vcvt.f32.u32 TMP_Q1, TMP_Q1 - .if len > 4 - vcvt.f32.u32 D_565, D_565 - vrecpe.f32 S_565, S_565 - .endif - vmul.f32 TMP_Q0, TMP_Q0, TMP_Q1 - .if len > 4 - vmul.f32 S_565, S_565, D_565 - .endif - vcvt.u32.f32 TMP_Q0, TMP_Q0 - .if len > 4 - vcvt.u32.f32 S_565, S_565 - .endif - vmovn.u32 TMP_D0, TMP_Q0 - .if len > 4 - vmovn.u32 TMP_D1, S_565 - .endif - vmovn.u16 TMP_D0, TMP_Q0 - premult TMP_D0 - vmvn M_A, TMP_D0 -99: -.endm - -.macro blend mode, dst_bpp -.if dst_bpp == 32 - vmov TMP_D0, FG_MASK, BG_MASK - vmovl.s8 TMP_Q0, TMP_D0 - vsli.8 TMP_Q0, TMP_Q0, #4 - cbz FG_MASK, 98f -.endif -.if mode == normal -.if dst_bpp == 32 - cbz BG_MASK, 97f - mvns BG_MASK, BG_MASK - beq 96f - vmov S_565_L, D_B - vmov S_565_H, D_G - vmov D_565_L, D_R -.endif -96: - vmlal.u8 PREMULT_B, D_B, M_A - vmlal.u8 PREMULT_G, D_G, M_A - vmlal.u8 PREMULT_R, D_R, M_A - vqrshrn.u16 D_B, PREMULT_B, #8 - vqrshrn.u16 D_G, PREMULT_G, #8 - vqrshrn.u16 D_R, PREMULT_R, #8 -.if dst_bpp == 32 - beq 97f - vbif D_B, S_565_L, TMP_D1 - vbif D_G, S_565_H, TMP_D1 - vbif D_R, D_565_L, TMP_D1 -97: - mvns FG_MASK, FG_MASK - beq 99f -.endif -.else - .error "blend mode is unsupported" -.endif -.if dst_bpp == 32 -98: - vbif D_B, S_B, TMP_D0 - vbif D_G, S_G, TMP_D0 - vbif D_R, S_R, TMP_D0 - vbif D_A, S_A, TMP_D0 -99: -.endif -.endm - -.macro process len, src_bpp, dst_bpp, mask, opa, mode -.if (src_bpp < 32) && (mask == 0) && (opa == 0) -@ no blend - .if src_bpp == 0 || src_bpp == dst_bpp - ldst ld, src_bpp, len, SRC, D, 0, ! - ldst st, dst_bpp, len, DST, D, 0, ! - .else - ldst ld, src_bpp, len, SRC, D, 1, ! - ldst st, dst_bpp, len, DST, D, 1, ! - .endif -.elseif src_bpp < 32 -@ no src_a - .if src_bpp > 0 - ldst ld, src_bpp, len, SRC, S, 1, ! - .endif - ldst ld, dst_bpp, len, DST, D, 1 - .if mask - ldst ld, 8, len, MASK, S, 1, ! - .if opa - vmull.u8 TMP_Q0, S_A, OPA - vqrshrn.u16 S_A, TMP_Q0, #8 - .endif - vmvn M_A, S_A - .if dst_bpp < 32 - premult S_A - .else - calc_alpha len - .endif - .else - vmvn M_A, OPA - .if dst_bpp < 32 - premult OPA - .else - vmov S_A, OPA - calc_alpha len - .endif - .endif - blend mode, dst_bpp - ldst st, dst_bpp, len, DST, D, 1, ! -.else -@ src_a (+mask) (+opa) - ldst ld, src_bpp, len, SRC, S, 1, ! - ldst ld, dst_bpp, len, DST, D, 1 - .if mask == 0 - .if opa - vmull.u8 TMP_Q0, S_A, OPA - vqrshrn.u16 S_A, TMP_Q0, #8 - .endif - .else - ldst ld, 8, len, MASK, M, 1, ! - vmull.u8 TMP_Q0, S_A, M_A - vqrshrn.u16 S_A, TMP_Q0, #8 - .if opa - vmull.u8 TMP_Q0, S_A, OPA - vqrshrn.u16 S_A, TMP_Q0, #8 - .endif - .endif - vmvn M_A, S_A - .if dst_bpp < 32 - premult S_A - .else - calc_alpha len - .endif - blend mode, dst_bpp - ldst st, dst_bpp, len, DST, D, 1, ! -.endif -.endm - -.macro tail src_bpp, dst_bpp, mask, opa, mode - tst DST_W, #4 - beq 3f - tst DST_W, #2 - beq 5f - tst DST_W, #1 - beq 6f - process 7, src_bpp, dst_bpp, mask, opa, mode - b 0f -6: - process 6, src_bpp, dst_bpp, mask, opa, mode - b 0f -5: - tst DST_W, #1 - beq 4f - process 5, src_bpp, dst_bpp, mask, opa, mode - b 0f -4: - process 4, src_bpp, dst_bpp, mask, opa, mode - b 0f -3: - tst DST_W, #2 - beq 1f - tst DST_W, #1 - beq 2f - process 3, src_bpp, dst_bpp, mask, opa, mode - b 0f -2: - process 2, src_bpp, dst_bpp, mask, opa, mode - b 0f -1: - process 1, src_bpp, dst_bpp, mask, opa, mode -0: -.endm - -.macro next src_bpp, mask - add DST_ADDR, DST_ADDR, DST_STRIDE -.if src_bpp - add SRC_ADDR, SRC_ADDR, SRC_STRIDE -.endif -.if mask - add MASK_ADDR, MASK_ADDR, MASK_STRIDE -.endif -.endm - -.macro enter - push {r4-r11, lr} -.endm - -.macro exit - pop {r4-r11, pc} -.endm - -.macro preload mem, bpp -.if bpp >= 31 - pld [mem&_ADDR, DST_W, lsl #2] -.elseif bpp == 24 - add W, DST_W, DST_W, lsl #1 - pld [mem&_ADDR, W] -.elseif bpp == 16 - pld [mem&_ADDR, DST_W, lsl #1] -.elseif bpp == 8 - pld [mem&_ADDR, DST_W] -.endif -.endm - -.macro blender src_bpp, dst_bpp, mask, opa, mode - enter - init src_bpp, dst_bpp, mask, opa - movs H, DST_H - beq 0f - preload SRC, src_bpp -.if mask || opa || (src_bpp == 32) - preload DST, dst_bpp -.endif - subs W, DST_W, #8 - blt 7f -9: - process 8, src_bpp, dst_bpp, mask, opa, mode - subs W, W, #8 - bge 9b - tst DST_W, #7 - beq 8f - tail src_bpp, dst_bpp, mask, opa, mode -8: - next src_bpp, mask - preload SRC, src_bpp -.if mask || opa || (src_bpp == 32) - preload DST, dst_bpp -.endif - sub W, DST_W, #8 - subs H, H, #1 - bgt 9b - exit -7: - tail src_bpp, dst_bpp, mask, opa, mode - next src_bpp, mask - subs H, H, #1 - bgt 7b - exit -.endm - -.macro export name, src_bpp, dst_bpp, mask, opa, mode -.thumb_func -.func name -.global name -.hidden name -name&: - blender src_bpp, dst_bpp, mask, opa, mode -.endfunc -.endm - -.macro export_set src, dst, src_bpp, dst_bpp, mode -.if src == color - export _lv_&src&_blend_to_&dst&_neon, src_bpp, dst_bpp, 0, 0, mode - export _lv_&src&_blend_to_&dst&_with_opa_neon, src_bpp, dst_bpp, 0, 1, mode - export _lv_&src&_blend_to_&dst&_with_mask_neon, src_bpp, dst_bpp, 1, 0, mode - export _lv_&src&_blend_to_&dst&_mix_mask_opa_neon, src_bpp, dst_bpp, 1, 1, mode -.else - export _lv_&src&_blend_&mode&_to_&dst&_neon, src_bpp, dst_bpp, 0, 0, mode - export _lv_&src&_blend_&mode&_to_&dst&_with_opa_neon, src_bpp, dst_bpp, 0, 1, mode - export _lv_&src&_blend_&mode&_to_&dst&_with_mask_neon, src_bpp, dst_bpp, 1, 0, mode - export _lv_&src&_blend_&mode&_to_&dst&_mix_mask_opa_neon, src_bpp, dst_bpp, 1, 1, mode -.endif -.endm - -export_set color, rgb565, 0, 16, normal -export_set rgb565, rgb565, 16, 16, normal -export_set rgb888, rgb565, 24, 16, normal -export_set xrgb8888, rgb565, 31, 16, normal -export_set argb8888, rgb565, 32, 16, normal -export_set color, rgb888, 0, 24, normal -export_set rgb565, rgb888, 16, 24, normal -export_set rgb888, rgb888, 24, 24, normal -export_set xrgb8888, rgb888, 31, 24, normal -export_set argb8888, rgb888, 32, 24, normal -export_set color, xrgb8888, 0, 31, normal -export_set rgb565, xrgb8888, 16, 31, normal -export_set rgb888, xrgb8888, 24, 31, normal -export_set xrgb8888, xrgb8888, 31, 31, normal -export_set argb8888, xrgb8888, 32, 31, normal -export_set color, argb8888, 0, 32, normal -export_set rgb565, argb8888, 16, 32, normal -export_set rgb888, argb8888, 24, 32, normal -export_set xrgb8888, argb8888, 31, 32, normal -export_set argb8888, argb8888, 32, 32, normal - -#endif /*LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/blend/neon/lv_blend_neon.h b/L3_Middlewares/LVGL/src/draw/sw/blend/neon/lv_blend_neon.h deleted file mode 100644 index fd52647..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/blend/neon/lv_blend_neon.h +++ /dev/null @@ -1,1301 +0,0 @@ -/** - * @file lv_blend_neon.h - * - */ - -#ifndef LV_BLEND_NEON_H -#define LV_BLEND_NEON_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../../../lv_conf_internal.h" - -#ifdef LV_DRAW_SW_NEON_CUSTOM_INCLUDE -#include LV_DRAW_SW_NEON_CUSTOM_INCLUDE -#endif - -/********************* - * DEFINES - *********************/ -#if !defined(__ASSEMBLY__) - -#if __GNUC__ >= 4 -#define LVGL_HIDDEN __attribute__((visibility("hidden"))) -#else -#define LVGL_HIDDEN -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565 -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565(dsc) \ - lv_color_blend_to_rgb565_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA(dsc) \ - lv_color_blend_to_rgb565_with_opa_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK(dsc) \ - lv_color_blend_to_rgb565_with_mask_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA(dsc) \ - lv_color_blend_to_rgb565_mix_mask_opa_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565 -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565(dsc) \ - lv_rgb565_blend_normal_to_rgb565_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc) \ - lv_rgb565_blend_normal_to_rgb565_with_opa_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc) \ - lv_rgb565_blend_normal_to_rgb565_with_mask_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc) \ - lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565 -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_neon(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_with_opa_neon(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_with_mask_neon(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_neon(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565 -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565(dsc) \ - lv_argb8888_blend_normal_to_rgb565_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc) \ - lv_argb8888_blend_normal_to_rgb565_with_opa_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc) \ - lv_argb8888_blend_normal_to_rgb565_with_mask_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc) \ - lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888 -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_with_opa_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_with_mask_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ - lv_color_blend_to_rgb888_mix_mask_opa_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888 -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_with_opa_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_with_mask_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ - lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888 -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_neon(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_with_opa_neon(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_with_mask_neon(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size, src_px_size) \ - lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_neon(dsc, dst_px_size, src_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888 -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_with_opa_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_with_mask_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ - lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_neon(dsc, dst_px_size) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888 -#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888(dsc) \ - lv_color_blend_to_argb8888_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA(dsc) \ - lv_color_blend_to_argb8888_with_opa_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK -#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK(dsc) \ - lv_color_blend_to_argb8888_with_mask_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA -#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA(dsc) \ - lv_color_blend_to_argb8888_mix_mask_opa_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888 -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888(dsc) \ - lv_rgb565_blend_normal_to_argb8888_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc) \ - lv_rgb565_blend_normal_to_argb8888_with_opa_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc) \ - lv_rgb565_blend_normal_to_argb8888_with_mask_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA -#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc) \ - lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888 -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_argb8888_neon(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_argb8888_with_opa_neon(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_argb8888_with_mask_neon(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA -#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc, src_px_size) \ - lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_neon(dsc, src_px_size) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888 -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888(dsc) \ - lv_argb8888_blend_normal_to_argb8888_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc) \ - lv_argb8888_blend_normal_to_argb8888_with_opa_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc) \ - lv_argb8888_blend_normal_to_argb8888_with_mask_neon(dsc) -#endif - -#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA -#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc) \ - lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_neon(dsc) -#endif - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - uint32_t opa; - void * dst_buf; - uint32_t dst_w; - uint32_t dst_h; - uint32_t dst_stride; - const void * src_buf; - uint32_t src_stride; - const lv_opa_t * mask_buf; - uint32_t mask_stride; -} asm_dsc_t; -/********************** - * GLOBAL PROTOTYPES - **********************/ - -extern LVGL_HIDDEN void _lv_color_blend_to_rgb565_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb565_neon(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - - _lv_color_blend_to_rgb565_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_color_blend_to_rgb565_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb565_with_opa_neon(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - _lv_color_blend_to_rgb565_with_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_color_blend_to_rgb565_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb565_with_mask_neon(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_color_blend_to_rgb565_with_mask_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_color_blend_to_rgb565_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb565_mix_mask_opa_neon(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_color_blend_to_rgb565_mix_mask_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_rgb565_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - _lv_rgb565_blend_normal_to_rgb565_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_rgb565_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_with_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - _lv_rgb565_blend_normal_to_rgb565_with_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_rgb565_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_with_mask_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_rgb565_blend_normal_to_rgb565_with_mask_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_rgb565_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_rgb565_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_rgb565_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_rgb565_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_rgb565_with_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_rgb565_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_with_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_rgb565_with_opa_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_rgb565_with_opa_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_rgb565_with_mask_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_rgb565_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_with_mask_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_rgb565_with_mask_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_rgb565_with_mask_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_rgb565_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_rgb565_mix_mask_opa_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_rgb565_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - _lv_argb8888_blend_normal_to_rgb565_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_rgb565_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_with_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - _lv_argb8888_blend_normal_to_rgb565_with_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_rgb565_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_with_mask_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_argb8888_blend_normal_to_rgb565_with_mask_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_color_blend_to_rgb888_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_color_blend_to_xrgb8888_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb888_neon(lv_draw_sw_blend_fill_dsc_t * dsc, uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - if(dst_px_size == 3) { - _lv_color_blend_to_rgb888_neon(&asm_dsc); - } - else { - _lv_color_blend_to_xrgb8888_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_color_blend_to_rgb888_with_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_color_blend_to_xrgb8888_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb888_with_opa_neon(lv_draw_sw_blend_fill_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - if(dst_px_size == 3) { - _lv_color_blend_to_rgb888_with_opa_neon(&asm_dsc); - } - else { - _lv_color_blend_to_xrgb8888_with_opa_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_color_blend_to_rgb888_with_mask_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_color_blend_to_xrgb8888_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb888_with_mask_neon(lv_draw_sw_blend_fill_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - _lv_color_blend_to_rgb888_with_mask_neon(&asm_dsc); - } - else { - _lv_color_blend_to_xrgb8888_with_mask_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_color_blend_to_rgb888_mix_mask_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_color_blend_to_xrgb8888_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_rgb888_mix_mask_opa_neon(lv_draw_sw_blend_fill_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - _lv_color_blend_to_rgb888_mix_mask_opa_neon(&asm_dsc); - } - else { - _lv_color_blend_to_xrgb8888_mix_mask_opa_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_rgb888_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_xrgb8888_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - _lv_rgb565_blend_normal_to_rgb888_neon(&asm_dsc); - } - else { - _lv_rgb565_blend_normal_to_xrgb8888_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_rgb888_with_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_xrgb8888_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_with_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - _lv_rgb565_blend_normal_to_rgb888_with_opa_neon(&asm_dsc); - } - else { - _lv_rgb565_blend_normal_to_xrgb8888_with_opa_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_rgb888_with_mask_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_xrgb8888_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_with_mask_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - _lv_rgb565_blend_normal_to_rgb888_with_mask_neon(&asm_dsc); - } - else { - _lv_rgb565_blend_normal_to_xrgb8888_with_mask_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_xrgb8888_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - _lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_neon(&asm_dsc); - } - else { - _lv_rgb565_blend_normal_to_xrgb8888_mix_mask_opa_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_rgb888_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_xrgb8888_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_rgb888_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_xrgb8888_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_rgb888_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_rgb888_neon(&asm_dsc); - } - } - else { - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_xrgb8888_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_xrgb8888_neon(&asm_dsc); - } - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_rgb888_with_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_xrgb8888_with_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_rgb888_with_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_xrgb8888_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_with_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_rgb888_with_opa_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_rgb888_with_opa_neon(&asm_dsc); - } - } - else { - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_xrgb8888_with_opa_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_xrgb8888_with_opa_neon(&asm_dsc); - } - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_rgb888_with_mask_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_xrgb8888_with_mask_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_rgb888_with_mask_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_xrgb8888_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_with_mask_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_rgb888_with_mask_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_rgb888_with_mask_neon(&asm_dsc); - } - } - else { - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_xrgb8888_with_mask_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_xrgb8888_with_mask_neon(&asm_dsc); - } - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_xrgb8888_mix_mask_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_rgb888_mix_mask_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_xrgb8888_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size, uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_rgb888_mix_mask_opa_neon(&asm_dsc); - } - } - else { - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_xrgb8888_mix_mask_opa_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_xrgb8888_mix_mask_opa_neon(&asm_dsc); - } - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_rgb888_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_xrgb8888_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - _lv_argb8888_blend_normal_to_rgb888_neon(&asm_dsc); - } - else { - _lv_argb8888_blend_normal_to_xrgb8888_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_rgb888_with_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_xrgb8888_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_with_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(dst_px_size == 3) { - _lv_argb8888_blend_normal_to_rgb888_with_opa_neon(&asm_dsc); - } - else { - _lv_argb8888_blend_normal_to_xrgb8888_with_opa_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_rgb888_with_mask_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_xrgb8888_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_with_mask_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - _lv_argb8888_blend_normal_to_rgb888_with_mask_neon(&asm_dsc); - } - else { - _lv_argb8888_blend_normal_to_xrgb8888_with_mask_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_xrgb8888_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t dst_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(dst_px_size == 3) { - _lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_neon(&asm_dsc); - } - else { - _lv_argb8888_blend_normal_to_xrgb8888_mix_mask_opa_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_color_blend_to_argb8888_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_argb8888_neon(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - - _lv_color_blend_to_argb8888_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_color_blend_to_argb8888_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_argb8888_with_opa_neon(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color - }; - _lv_color_blend_to_argb8888_with_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_color_blend_to_argb8888_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_argb8888_with_mask_neon(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_color_blend_to_argb8888_with_mask_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_color_blend_to_argb8888_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_color_blend_to_argb8888_mix_mask_opa_neon(lv_draw_sw_blend_fill_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = &dsc->color, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_color_blend_to_argb8888_mix_mask_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_argb8888_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_argb8888_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - _lv_rgb565_blend_normal_to_argb8888_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_argb8888_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_argb8888_with_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - _lv_rgb565_blend_normal_to_argb8888_with_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_argb8888_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_argb8888_with_mask_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_rgb565_blend_normal_to_argb8888_with_mask_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_argb8888_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_argb8888_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_argb8888_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_argb8888_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_argb8888_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_argb8888_with_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_argb8888_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_argb8888_with_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_argb8888_with_opa_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_argb8888_with_opa_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_argb8888_with_mask_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_argb8888_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_argb8888_with_mask_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_argb8888_with_mask_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_argb8888_with_mask_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_neon(asm_dsc_t * dsc); -extern LVGL_HIDDEN void _lv_xrgb8888_blend_normal_to_argb8888_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc, - uint32_t src_px_size) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - if(src_px_size == 3) { - _lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_neon(&asm_dsc); - } - else { - _lv_xrgb8888_blend_normal_to_argb8888_mix_mask_opa_neon(&asm_dsc); - } - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_argb8888_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_argb8888_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - _lv_argb8888_blend_normal_to_argb8888_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_argb8888_with_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_argb8888_with_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride - }; - _lv_argb8888_blend_normal_to_argb8888_with_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_argb8888_with_mask_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_argb8888_with_mask_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_argb8888_blend_normal_to_argb8888_with_mask_neon(&asm_dsc); - return LV_RESULT_OK; -} - -extern LVGL_HIDDEN void _lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_neon(asm_dsc_t * dsc); -static inline lv_result_t lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_neon(lv_draw_sw_blend_image_dsc_t * dsc) -{ - asm_dsc_t asm_dsc = { - .opa = dsc->opa, - .dst_buf = dsc->dest_buf, - .dst_w = dsc->dest_w, - .dst_h = dsc->dest_h, - .dst_stride = dsc->dest_stride, - .src_buf = dsc->src_buf, - .src_stride = dsc->src_stride, - .mask_buf = dsc->mask_buf, - .mask_stride = dsc->mask_stride - }; - _lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_neon(&asm_dsc); - return LV_RESULT_OK; -} - -#endif /* !defined(__ASSEMBLY__) */ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_BLEND_NEON_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.c index 4e144b1..1c0c6d4 100644 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.c +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.c @@ -6,90 +6,12 @@ /********************* * INCLUDES *********************/ -#include "lv_draw_sw_private.h" -#include "../lv_draw_private.h" -#if LV_USE_DRAW_SW - -#include "../../core/lv_refr.h" -#include "../../display/lv_display_private.h" -#include "../../stdlib/lv_string.h" -#include "../../core/lv_global.h" -#include "../../misc/lv_area_private.h" - -#if LV_USE_VECTOR_GRAPHIC && LV_USE_THORVG - #if LV_USE_THORVG_EXTERNAL - #include - #else - #include "../../libs/thorvg/thorvg_capi.h" - #endif -#endif - -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM - #include "arm2d/lv_draw_sw_helium.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM - #include LV_DRAW_SW_ASM_CUSTOM_INCLUDE -#endif - -#if LV_DRAW_SW_DRAW_UNIT_CNT > 1 && LV_USE_OS == LV_OS_NONE - #error "OS support is required when more than one SW rendering units are enabled" -#endif +#include "../lv_draw.h" +#include "lv_draw_sw.h" /********************* * DEFINES *********************/ -#define DRAW_UNIT_ID_SW 1 - -#ifndef LV_DRAW_SW_RGB565_SWAP - #define LV_DRAW_SW_RGB565_SWAP(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE90_ARGB8888 - #define LV_DRAW_SW_ROTATE90_ARGB8888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE180_ARGB8888 - #define LV_DRAW_SW_ROTATE180_ARGB8888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE270_ARGB8888 - #define LV_DRAW_SW_ROTATE270_ARGB8888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE90_RGB888 - #define LV_DRAW_SW_ROTATE90_RGB888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE180_RGB888 - #define LV_DRAW_SW_ROTATE180_RGB888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE270_RGB888 - #define LV_DRAW_SW_ROTATE270_RGB888(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE90_RGB565 - #define LV_DRAW_SW_ROTATE90_RGB565(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE180_RGB565 - #define LV_DRAW_SW_ROTATE180_RGB565(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE270_RGB565 - #define LV_DRAW_SW_ROTATE270_RGB565(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE90_L8 - #define LV_DRAW_SW_ROTATE90_L8(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE180_L8 - #define LV_DRAW_SW_ROTATE180_L8(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_ROTATE270_L8 - #define LV_DRAW_SW_ROTATE270_L8(...) LV_RESULT_INVALID -#endif /********************** * TYPEDEFS @@ -98,61 +20,14 @@ /********************** * STATIC PROTOTYPES **********************/ -#if LV_USE_OS - static void render_thread_cb(void * ptr); -#endif -static void execute_drawing(lv_draw_sw_unit_t * u); - -static int32_t dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer); -static int32_t evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task); -static int32_t lv_draw_sw_delete(lv_draw_unit_t * draw_unit); - -#if LV_DRAW_SW_SUPPORT_ARGB8888 -static void rotate90_argb8888(const uint32_t * src, uint32_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride); -static void rotate180_argb8888(const uint32_t * src, uint32_t * dst, int32_t width, int32_t height, int32_t src_stride, - int32_t dest_stride); -static void rotate270_argb8888(const uint32_t * src, uint32_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride); -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 -static void rotate90_rgb888(const uint8_t * src, uint8_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride); -static void rotate180_rgb888(const uint8_t * src, uint8_t * dst, int32_t width, int32_t height, int32_t src_stride, - int32_t dest_stride); -static void rotate270_rgb888(const uint8_t * src, uint8_t * dst, int32_t width, int32_t height, int32_t src_stride, - int32_t dst_stride); -#endif -#if LV_DRAW_SW_SUPPORT_RGB565 -static void rotate90_rgb565(const uint16_t * src, uint16_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride); -static void rotate180_rgb565(const uint16_t * src, uint16_t * dst, int32_t width, int32_t height, int32_t src_stride, - int32_t dest_stride); -static void rotate270_rgb565(const uint16_t * src, uint16_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride); -#endif - -#if LV_DRAW_SW_SUPPORT_L8 +/********************** + * GLOBAL PROTOTYPES + **********************/ -static void rotate90_l8(const uint8_t * src, uint8_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride); -static void rotate180_l8(const uint8_t * src, uint8_t * dst, int32_t width, int32_t height, int32_t src_stride, - int32_t dest_stride); -static void rotate270_l8(const uint8_t * src, uint8_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride); -#endif /********************** * STATIC VARIABLES **********************/ -#define _draw_info LV_GLOBAL_DEFAULT()->draw_info /********************** * MACROS @@ -162,673 +37,72 @@ static void rotate270_l8(const uint8_t * src, uint8_t * dst, int32_t src_width, * GLOBAL FUNCTIONS **********************/ -void lv_draw_sw_init(void) +void lv_draw_sw_init_ctx(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) { + LV_UNUSED(drv); -#if LV_DRAW_SW_COMPLEX == 1 - lv_draw_sw_mask_init(); -#endif - - uint32_t i; - for(i = 0; i < LV_DRAW_SW_DRAW_UNIT_CNT; i++) { - lv_draw_sw_unit_t * draw_sw_unit = lv_draw_create_unit(sizeof(lv_draw_sw_unit_t)); - draw_sw_unit->base_unit.dispatch_cb = dispatch; - draw_sw_unit->base_unit.evaluate_cb = evaluate; - draw_sw_unit->idx = i; - draw_sw_unit->base_unit.delete_cb = LV_USE_OS ? lv_draw_sw_delete : NULL; + lv_draw_sw_ctx_t * draw_sw_ctx = (lv_draw_sw_ctx_t *) draw_ctx; + lv_memset_00(draw_sw_ctx, sizeof(lv_draw_sw_ctx_t)); -#if LV_USE_OS - lv_thread_init(&draw_sw_unit->thread, LV_THREAD_PRIO_HIGH, render_thread_cb, LV_DRAW_THREAD_STACK_SIZE, draw_sw_unit); -#endif - } - -#if LV_USE_VECTOR_GRAPHIC && LV_USE_THORVG - tvg_engine_init(TVG_ENGINE_SW, 0); + draw_sw_ctx->base_draw.draw_arc = lv_draw_sw_arc; + draw_sw_ctx->base_draw.draw_rect = lv_draw_sw_rect; + draw_sw_ctx->base_draw.draw_bg = lv_draw_sw_bg; + draw_sw_ctx->base_draw.draw_letter = lv_draw_sw_letter; + draw_sw_ctx->base_draw.draw_img_decoded = lv_draw_sw_img_decoded; + draw_sw_ctx->base_draw.draw_line = lv_draw_sw_line; + draw_sw_ctx->base_draw.draw_polygon = lv_draw_sw_polygon; +#if LV_DRAW_COMPLEX + draw_sw_ctx->base_draw.draw_transform = lv_draw_sw_transform; #endif + draw_sw_ctx->base_draw.wait_for_finish = lv_draw_sw_wait_for_finish; + draw_sw_ctx->base_draw.buffer_copy = lv_draw_sw_buffer_copy; + draw_sw_ctx->base_draw.layer_init = lv_draw_sw_layer_create; + draw_sw_ctx->base_draw.layer_adjust = lv_draw_sw_layer_adjust; + draw_sw_ctx->base_draw.layer_blend = lv_draw_sw_layer_blend; + draw_sw_ctx->base_draw.layer_destroy = lv_draw_sw_layer_destroy; + draw_sw_ctx->blend = lv_draw_sw_blend_basic; + draw_ctx->layer_instance_size = sizeof(lv_draw_sw_layer_ctx_t); } -void lv_draw_sw_deinit(void) +void lv_draw_sw_deinit_ctx(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) { -#if LV_USE_VECTOR_GRAPHIC && LV_USE_THORVG - tvg_engine_term(TVG_ENGINE_SW); -#endif + LV_UNUSED(drv); -#if LV_DRAW_SW_COMPLEX == 1 - lv_draw_sw_mask_deinit(); -#endif + lv_draw_sw_ctx_t * draw_sw_ctx = (lv_draw_sw_ctx_t *) draw_ctx; + lv_memset_00(draw_sw_ctx, sizeof(lv_draw_sw_ctx_t)); } -static int32_t lv_draw_sw_delete(lv_draw_unit_t * draw_unit) +void lv_draw_sw_wait_for_finish(lv_draw_ctx_t * draw_ctx) { -#if LV_USE_OS - lv_draw_sw_unit_t * draw_sw_unit = (lv_draw_sw_unit_t *) draw_unit; - - LV_LOG_INFO("cancel software rendering thread"); - draw_sw_unit->exit_status = true; - - if(draw_sw_unit->inited) { - lv_thread_sync_signal(&draw_sw_unit->sync); - } - - return lv_thread_delete(&draw_sw_unit->thread); -#else - LV_UNUSED(draw_unit); - return 0; -#endif + LV_UNUSED(draw_ctx); + /*Nothing to wait for*/ } -void lv_draw_sw_rgb565_swap(void * buf, uint32_t buf_size_px) +void lv_draw_sw_buffer_copy(lv_draw_ctx_t * draw_ctx, + void * dest_buf, lv_coord_t dest_stride, const lv_area_t * dest_area, + void * src_buf, lv_coord_t src_stride, const lv_area_t * src_area) { - if(LV_DRAW_SW_RGB565_SWAP(buf, buf_size_px) == LV_RESULT_OK) return; + LV_UNUSED(draw_ctx); - uint32_t u32_cnt = buf_size_px / 2; - uint16_t * buf16 = buf; - uint32_t * buf32 = buf; + lv_color_t * dest_bufc = dest_buf; + lv_color_t * src_bufc = src_buf; - while(u32_cnt >= 8) { - buf32[0] = ((buf32[0] & 0xff00ff00) >> 8) | ((buf32[0] & 0x00ff00ff) << 8); - buf32[1] = ((buf32[1] & 0xff00ff00) >> 8) | ((buf32[1] & 0x00ff00ff) << 8); - buf32[2] = ((buf32[2] & 0xff00ff00) >> 8) | ((buf32[2] & 0x00ff00ff) << 8); - buf32[3] = ((buf32[3] & 0xff00ff00) >> 8) | ((buf32[3] & 0x00ff00ff) << 8); - buf32[4] = ((buf32[4] & 0xff00ff00) >> 8) | ((buf32[4] & 0x00ff00ff) << 8); - buf32[5] = ((buf32[5] & 0xff00ff00) >> 8) | ((buf32[5] & 0x00ff00ff) << 8); - buf32[6] = ((buf32[6] & 0xff00ff00) >> 8) | ((buf32[6] & 0x00ff00ff) << 8); - buf32[7] = ((buf32[7] & 0xff00ff00) >> 8) | ((buf32[7] & 0x00ff00ff) << 8); - buf32 += 8; - u32_cnt -= 8; - } + /*Got the first pixel of each buffer*/ + dest_bufc += dest_stride * dest_area->y1; + dest_bufc += dest_area->x1; - while(u32_cnt) { - *buf32 = ((*buf32 & 0xff00ff00) >> 8) | ((*buf32 & 0x00ff00ff) << 8); - buf32++; - u32_cnt--; - } + src_bufc += src_stride * src_area->y1; + src_bufc += src_area->x1; - if(buf_size_px & 0x1) { - uint32_t e = buf_size_px - 1; - buf16[e] = ((buf16[e] & 0xff00) >> 8) | ((buf16[e] & 0x00ff) << 8); - } - -} - -void lv_draw_sw_i1_invert(void * buf, uint32_t buf_size) -{ - if(buf == NULL) return; - - uint8_t * byte_buf = (uint8_t *)buf; - uint32_t i; - - /*Make the buffer aligned*/ - while(((uintptr_t)(byte_buf) & (sizeof(int) - 1)) && buf_size > 0) { - *byte_buf = ~(*byte_buf); - byte_buf++; - buf_size--; - } - - if(buf_size >= sizeof(uint32_t)) { - uint32_t * aligned_addr = (uint32_t *)byte_buf; - uint32_t word_count = buf_size / 4; - - for(i = 0; i < word_count; ++i) { - aligned_addr[i] = ~aligned_addr[i]; - } - - byte_buf = (uint8_t *)(aligned_addr + word_count); - buf_size = buf_size % sizeof(uint32_t); - } - - for(i = 0; i < buf_size; ++i) { - byte_buf[i] = ~byte_buf[i]; - } -} - -void lv_draw_sw_rotate(const void * src, void * dest, int32_t src_width, int32_t src_height, int32_t src_stride, - int32_t dest_stride, lv_display_rotation_t rotation, lv_color_format_t color_format) -{ - if(rotation == LV_DISPLAY_ROTATION_90) { - switch(color_format) { -#if LV_DRAW_SW_SUPPORT_L8 - case LV_COLOR_FORMAT_L8: - rotate90_l8(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB565 - case LV_COLOR_FORMAT_RGB565: - rotate90_rgb565(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 - case LV_COLOR_FORMAT_RGB888: - rotate90_rgb888(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 || LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - case LV_COLOR_FORMAT_ARGB8888: - rotate90_argb8888(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif - default: - break; - } - - return; - } - - if(rotation == LV_DISPLAY_ROTATION_180) { - switch(color_format) { -#if LV_DRAW_SW_SUPPORT_L8 - case LV_COLOR_FORMAT_L8: - rotate180_l8(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB565 - case LV_COLOR_FORMAT_RGB565: - rotate180_rgb565(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 - case LV_COLOR_FORMAT_RGB888: - rotate180_rgb888(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 || LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - case LV_COLOR_FORMAT_ARGB8888: - rotate180_argb8888(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif - default: - break; - } - - return; - } - - if(rotation == LV_DISPLAY_ROTATION_270) { - switch(color_format) { -#if LV_DRAW_SW_SUPPORT_L8 - case LV_COLOR_FORMAT_L8: - rotate270_l8(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB565 - case LV_COLOR_FORMAT_RGB565: - rotate270_rgb565(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 - case LV_COLOR_FORMAT_RGB888: - rotate270_rgb888(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 || LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - case LV_COLOR_FORMAT_ARGB8888: - rotate270_argb8888(src, dest, src_width, src_height, src_stride, dest_stride); - break; -#endif - default: - break; - } - - return; + uint32_t line_length = lv_area_get_width(dest_area) * sizeof(lv_color_t); + lv_coord_t y; + for(y = dest_area->y1; y <= dest_area->y2; y++) { + lv_memcpy(dest_bufc, src_bufc, line_length); + dest_bufc += dest_stride; + src_bufc += src_stride; } } /********************** * STATIC FUNCTIONS **********************/ -static inline void execute_drawing_unit(lv_draw_sw_unit_t * u) -{ - execute_drawing(u); - - u->task_act->state = LV_DRAW_TASK_STATE_READY; - u->task_act = NULL; - - /*The draw unit is free now. Request a new dispatching as it can get a new task*/ - lv_draw_dispatch_request(); -} - -static int32_t evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task) -{ - LV_UNUSED(draw_unit); - - switch(task->type) { - case LV_DRAW_TASK_TYPE_IMAGE: - case LV_DRAW_TASK_TYPE_LAYER: { - lv_draw_image_dsc_t * draw_dsc = task->draw_dsc; - - /* not support skew */ - if(draw_dsc->skew_x != 0 || draw_dsc->skew_y != 0) { - return 0; - } - - bool transformed = draw_dsc->rotation != 0 || draw_dsc->scale_x != LV_SCALE_NONE || - draw_dsc->scale_y != LV_SCALE_NONE ? true : false; - - bool masked = draw_dsc->bitmap_mask_src != NULL; - if(masked && transformed) return 0; - - lv_color_format_t cf = draw_dsc->header.cf; - if(masked && (cf == LV_COLOR_FORMAT_A8 || cf == LV_COLOR_FORMAT_RGB565A8)) { - return 0; - } - } - break; - default: - break; - } - - if(task->preference_score >= 100) { - task->preference_score = 100; - task->preferred_draw_unit_id = DRAW_UNIT_ID_SW; - } - - return 0; -} - -static int32_t dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer) -{ - LV_PROFILER_BEGIN; - lv_draw_sw_unit_t * draw_sw_unit = (lv_draw_sw_unit_t *) draw_unit; - - /*Return immediately if it's busy with draw task*/ - if(draw_sw_unit->task_act) { - LV_PROFILER_END; - return 0; - } - - lv_draw_task_t * t = NULL; - t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_SW); - if(t == NULL) { - LV_PROFILER_END; - return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/ - } - - void * buf = lv_draw_layer_alloc_buf(layer); - if(buf == NULL) { - LV_PROFILER_END; - return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/ - } - - t->state = LV_DRAW_TASK_STATE_IN_PROGRESS; - draw_sw_unit->base_unit.target_layer = layer; - draw_sw_unit->base_unit.clip_area = &t->clip_area; - draw_sw_unit->task_act = t; - -#if LV_USE_OS - /*Let the render thread work*/ - if(draw_sw_unit->inited) lv_thread_sync_signal(&draw_sw_unit->sync); -#else - execute_drawing_unit(draw_sw_unit); -#endif - LV_PROFILER_END; - return 1; -} - -#if LV_USE_OS -static void render_thread_cb(void * ptr) -{ - lv_draw_sw_unit_t * u = ptr; - - lv_thread_sync_init(&u->sync); - u->inited = true; - - while(1) { - while(u->task_act == NULL) { - if(u->exit_status) { - break; - } - lv_thread_sync_wait(&u->sync); - } - - if(u->exit_status) { - LV_LOG_INFO("ready to exit software rendering thread"); - break; - } - - execute_drawing_unit(u); - } - - u->inited = false; - lv_thread_sync_delete(&u->sync); - LV_LOG_INFO("exit software rendering thread"); -} -#endif - -static void execute_drawing(lv_draw_sw_unit_t * u) -{ - LV_PROFILER_BEGIN; - /*Render the draw task*/ - lv_draw_task_t * t = u->task_act; - switch(t->type) { - case LV_DRAW_TASK_TYPE_FILL: - lv_draw_sw_fill((lv_draw_unit_t *)u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_BORDER: - lv_draw_sw_border((lv_draw_unit_t *)u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_BOX_SHADOW: - lv_draw_sw_box_shadow((lv_draw_unit_t *)u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_LABEL: - lv_draw_sw_label((lv_draw_unit_t *)u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_IMAGE: - lv_draw_sw_image((lv_draw_unit_t *)u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_ARC: - lv_draw_sw_arc((lv_draw_unit_t *)u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_LINE: - lv_draw_sw_line((lv_draw_unit_t *)u, t->draw_dsc); - break; - case LV_DRAW_TASK_TYPE_TRIANGLE: - lv_draw_sw_triangle((lv_draw_unit_t *)u, t->draw_dsc); - break; - case LV_DRAW_TASK_TYPE_LAYER: - lv_draw_sw_layer((lv_draw_unit_t *)u, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_MASK_RECTANGLE: - lv_draw_sw_mask_rect((lv_draw_unit_t *)u, t->draw_dsc, &t->area); - break; -#if LV_USE_VECTOR_GRAPHIC && LV_USE_THORVG - case LV_DRAW_TASK_TYPE_VECTOR: - lv_draw_sw_vector((lv_draw_unit_t *)u, t->draw_dsc); - break; -#endif - default: - break; - } - -#if LV_USE_PARALLEL_DRAW_DEBUG - /*Layers manage it for themselves*/ - if(t->type != LV_DRAW_TASK_TYPE_LAYER) { - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, &t->area, u->base_unit.clip_area)) return; - - int32_t idx = 0; - lv_draw_unit_t * draw_unit_tmp = _draw_info.unit_head; - while(draw_unit_tmp != (lv_draw_unit_t *)u) { - draw_unit_tmp = draw_unit_tmp->next; - idx++; - } - - lv_draw_fill_dsc_t fill_dsc; - lv_draw_fill_dsc_init(&fill_dsc); - fill_dsc.color = lv_palette_main(idx % LV_PALETTE_LAST); - fill_dsc.opa = LV_OPA_10; - lv_draw_sw_fill((lv_draw_unit_t *)u, &fill_dsc, &draw_area); - - lv_point_t txt_size; - lv_text_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE); - - lv_area_t txt_area; - txt_area.x1 = draw_area.x1; - txt_area.y1 = draw_area.y1; - txt_area.x2 = draw_area.x1 + txt_size.x - 1; - txt_area.y2 = draw_area.y1 + txt_size.y - 1; - - lv_draw_fill_dsc_init(&fill_dsc); - fill_dsc.color = lv_color_white(); - lv_draw_sw_fill((lv_draw_unit_t *)u, &fill_dsc, &txt_area); - - char buf[8]; - lv_snprintf(buf, sizeof(buf), "%d", idx); - lv_draw_label_dsc_t label_dsc; - lv_draw_label_dsc_init(&label_dsc); - label_dsc.color = lv_color_black(); - label_dsc.text = buf; - lv_draw_sw_label((lv_draw_unit_t *)u, &label_dsc, &txt_area); - } -#endif - LV_PROFILER_END; -} - -#if LV_DRAW_SW_SUPPORT_ARGB8888 - -static void rotate270_argb8888(const uint32_t * src, uint32_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride) -{ - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE90_ARGB8888(src, dst, src_width, src_height, src_stride, dst_stride)) { - return ; - } - - src_stride /= sizeof(uint32_t); - dst_stride /= sizeof(uint32_t); - - for(int32_t x = 0; x < src_width; ++x) { - int32_t dstIndex = x * dst_stride; - int32_t srcIndex = x; - for(int32_t y = 0; y < src_height; ++y) { - dst[dstIndex + (src_height - y - 1)] = src[srcIndex]; - srcIndex += src_stride; - } - } -} - -static void rotate180_argb8888(const uint32_t * src, uint32_t * dst, int32_t width, int32_t height, int32_t src_stride, - int32_t dest_stride) -{ - LV_UNUSED(dest_stride); - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE180_ARGB8888(src, dst, src_width, src_height, src_stride, dst_stride)) { - return ; - } - - src_stride /= sizeof(uint32_t); - - for(int32_t y = 0; y < height; ++y) { - int32_t dstIndex = (height - y - 1) * src_stride; - int32_t srcIndex = y * src_stride; - for(int32_t x = 0; x < width; ++x) { - dst[dstIndex + width - x - 1] = src[srcIndex + x]; - } - } -} - -static void rotate90_argb8888(const uint32_t * src, uint32_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, int32_t dst_stride) -{ - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE270_ARGB8888(src, dst, src_width, src_height, src_stride, dst_stride)) { - return ; - } - - src_stride /= sizeof(uint32_t); - dst_stride /= sizeof(uint32_t); - - for(int32_t x = 0; x < src_width; ++x) { - int32_t dstIndex = (src_width - x - 1); - int32_t srcIndex = x; - for(int32_t y = 0; y < src_height; ++y) { - dst[dstIndex * dst_stride + y] = src[srcIndex]; - srcIndex += src_stride; - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_RGB888 - -static void rotate90_rgb888(const uint8_t * src, uint8_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride) -{ - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE90_RGB888(src, dst, src_width, src_height, src_stride, dst_stride)) { - return ; - } - - for(int32_t x = 0; x < src_width; ++x) { - for(int32_t y = 0; y < src_height; ++y) { - int32_t srcIndex = y * src_stride + x * 3; - int32_t dstIndex = (src_width - x - 1) * dst_stride + y * 3; - dst[dstIndex] = src[srcIndex]; /*Red*/ - dst[dstIndex + 1] = src[srcIndex + 1]; /*Green*/ - dst[dstIndex + 2] = src[srcIndex + 2]; /*Blue*/ - } - } -} - -static void rotate180_rgb888(const uint8_t * src, uint8_t * dst, int32_t width, int32_t height, int32_t src_stride, - int32_t dest_stride) -{ - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE180_RGB888(src, dst, src_width, src_height, src_stride, dst_stride)) { - return ; - } - - for(int32_t y = 0; y < height; ++y) { - for(int32_t x = 0; x < width; ++x) { - int32_t srcIndex = y * src_stride + x * 3; - int32_t dstIndex = (height - y - 1) * dest_stride + (width - x - 1) * 3; - dst[dstIndex] = src[srcIndex]; - dst[dstIndex + 1] = src[srcIndex + 1]; - dst[dstIndex + 2] = src[srcIndex + 2]; - } - } -} - -static void rotate270_rgb888(const uint8_t * src, uint8_t * dst, int32_t width, int32_t height, int32_t src_stride, - int32_t dst_stride) -{ - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE270_RGB888(src, dst, src_width, src_height, src_stride, dst_stride)) { - return ; - } - - for(int32_t x = 0; x < width; ++x) { - for(int32_t y = 0; y < height; ++y) { - int32_t srcIndex = y * src_stride + x * 3; - int32_t dstIndex = x * dst_stride + (height - y - 1) * 3; - dst[dstIndex] = src[srcIndex]; /*Red*/ - dst[dstIndex + 1] = src[srcIndex + 1]; /*Green*/ - dst[dstIndex + 2] = src[srcIndex + 2]; /*Blue*/ - } - } -} - -#endif - -#if LV_DRAW_SW_SUPPORT_RGB565 - -static void rotate270_rgb565(const uint16_t * src, uint16_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride) -{ - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE90_RGB565(src, dst, src_width, src_height, src_stride, dst_stride)) { - return ; - } - - src_stride /= sizeof(uint16_t); - dst_stride /= sizeof(uint16_t); - - for(int32_t x = 0; x < src_width; ++x) { - int32_t dstIndex = x * dst_stride; - int32_t srcIndex = x; - for(int32_t y = 0; y < src_height; ++y) { - dst[dstIndex + (src_height - y - 1)] = src[srcIndex]; - srcIndex += src_stride; - } - } -} - -static void rotate180_rgb565(const uint16_t * src, uint16_t * dst, int32_t width, int32_t height, int32_t src_stride, - int32_t dest_stride) -{ - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE180_RGB565(src, dst, width, height, src_stride)) { - return ; - } - - src_stride /= sizeof(uint16_t); - dest_stride /= sizeof(uint16_t); - - for(int32_t y = 0; y < height; ++y) { - int32_t dstIndex = (height - y - 1) * dest_stride; - int32_t srcIndex = y * src_stride; - for(int32_t x = 0; x < width; ++x) { - dst[dstIndex + width - x - 1] = src[srcIndex + x]; - } - } -} - -static void rotate90_rgb565(const uint16_t * src, uint16_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride) -{ - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE270_RGB565(src, dst, src_width, src_height, src_stride, dst_stride)) { - return ; - } - - src_stride /= sizeof(uint16_t); - dst_stride /= sizeof(uint16_t); - - for(int32_t x = 0; x < src_width; ++x) { - int32_t dstIndex = (src_width - x - 1); - int32_t srcIndex = x; - for(int32_t y = 0; y < src_height; ++y) { - dst[dstIndex * dst_stride + y] = src[srcIndex]; - srcIndex += src_stride; - } - } -} - -#endif - - -#if LV_DRAW_SW_SUPPORT_L8 - -static void rotate90_l8(const uint8_t * src, uint8_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride) -{ - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE270_L8(src, dst, src_width, src_height, src_stride, dst_stride)) { - return ; - } - - for(int32_t x = 0; x < src_width; ++x) { - int32_t dstIndex = (src_width - x - 1); - int32_t srcIndex = x; - for(int32_t y = 0; y < src_height; ++y) { - dst[dstIndex * dst_stride + y] = src[srcIndex]; - srcIndex += src_stride; - } - } -} - -static void rotate180_l8(const uint8_t * src, uint8_t * dst, int32_t width, int32_t height, int32_t src_stride, - int32_t dest_stride) -{ - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE180_L8(src, dst, width, height, src_stride)) { - return ; - } - - for(int32_t y = 0; y < height; ++y) { - int32_t dstIndex = (height - y - 1) * dest_stride; - int32_t srcIndex = y * src_stride; - for(int32_t x = 0; x < width; ++x) { - dst[dstIndex + width - x - 1] = src[srcIndex + x]; - } - } -} - -static void rotate270_l8(const uint8_t * src, uint8_t * dst, int32_t src_width, int32_t src_height, - int32_t src_stride, - int32_t dst_stride) -{ - if(LV_RESULT_OK == LV_DRAW_SW_ROTATE90_L8(src, dst, src_width, src_height, src_stride, dst_stride)) { - return ; - } - - for(int32_t x = 0; x < src_width; ++x) { - int32_t dstIndex = x * dst_stride; - int32_t srcIndex = x; - for(int32_t y = 0; y < src_height; ++y) { - dst[dstIndex + (src_height - y - 1)] = src[srcIndex]; - srcIndex += src_stride; - } - } -} - -#endif - -#endif /*LV_USE_DRAW_SW*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.h b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.h index 6463afd..0f6d46b 100644 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.h +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.h @@ -1,4 +1,4 @@ -/** +/** * @file lv_draw_sw.h * */ @@ -13,177 +13,83 @@ extern "C" { /********************* * INCLUDES *********************/ +#include "lv_draw_sw_blend.h" #include "../lv_draw.h" -#if LV_USE_DRAW_SW - #include "../../misc/lv_area.h" #include "../../misc/lv_color.h" -#include "../../display/lv_display.h" -#include "../../osal/lv_os.h" - -#include "../lv_draw_vector.h" -#include "../lv_draw_triangle.h" -#include "../lv_draw_label.h" -#include "../lv_draw_image.h" -#include "../lv_draw_line.h" -#include "../lv_draw_arc.h" +#include "../../hal/lv_hal_disp.h" /********************* * DEFINES *********************/ /********************** - * GLOBAL PROTOTYPES + * TYPEDEFS **********************/ -/** - * Initialize the SW renderer. Called in internally. - * It creates as many SW renderers as defined in LV_DRAW_SW_DRAW_UNIT_CNT - */ -void lv_draw_sw_init(void); +struct _lv_disp_drv_t; -/** - * Deinitialize the SW renderers - */ -void lv_draw_sw_deinit(void); +typedef struct { + lv_draw_ctx_t base_draw; -/** - * Fill an area using SW render. Handle gradient and radius. - * @param draw_unit pointer to a draw unit - * @param dsc the draw descriptor - * @param coords the coordinates of the rectangle - */ -void lv_draw_sw_fill(lv_draw_unit_t * draw_unit, lv_draw_fill_dsc_t * dsc, const lv_area_t * coords); + /** Fill an area of the destination buffer with a color*/ + void (*blend)(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc); +} lv_draw_sw_ctx_t; -/** - * Draw border with SW render. - * @param draw_unit pointer to a draw unit - * @param dsc the draw descriptor - * @param coords the coordinates of the rectangle - */ -void lv_draw_sw_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc_t * dsc, const lv_area_t * coords); +typedef struct { + lv_draw_layer_ctx_t base_draw; -/** - * Draw box shadow with SW render. - * @param draw_unit pointer to a draw unit - * @param dsc the draw descriptor - * @param coords the coordinates of the rectangle for which the box shadow should be drawn - */ -void lv_draw_sw_box_shadow(lv_draw_unit_t * draw_unit, const lv_draw_box_shadow_dsc_t * dsc, const lv_area_t * coords); + uint32_t buf_size_bytes: 31; + uint32_t has_alpha : 1; +} lv_draw_sw_layer_ctx_t; -/** - * Draw an image with SW render. It handles image decoding, tiling, transformations, and recoloring. - * @param draw_unit pointer to a draw unit - * @param draw_dsc the draw descriptor - * @param coords the coordinates of the image - */ -void lv_draw_sw_image(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords); +/********************** + * GLOBAL PROTOTYPES + **********************/ -/** - * Draw a label with SW render. - * @param draw_unit pointer to a draw unit - * @param dsc the draw descriptor - * @param coords the coordinates of the label - */ -void lv_draw_sw_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc, const lv_area_t * coords); +void lv_draw_sw_init_ctx(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); +void lv_draw_sw_deinit_ctx(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); -/** - * Draw an arc with SW render. - * @param draw_unit pointer to a draw unit - * @param dsc the draw descriptor - * @param coords the coordinates of the arc - */ -void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, const lv_area_t * coords); +void lv_draw_sw_wait_for_finish(lv_draw_ctx_t * draw_ctx); -/** - * Draw a line with SW render. - * @param draw_unit pointer to a draw unit - * @param dsc the draw descriptor - */ -void lv_draw_sw_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc); +void lv_draw_sw_arc(lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center, uint16_t radius, + uint16_t start_angle, uint16_t end_angle); -/** - * Blend a layer with SW render - * @param draw_unit pointer to a draw unit - * @param draw_dsc the draw descriptor - * @param coords the coordinates of the layer - */ -void lv_draw_sw_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, const lv_area_t * coords); +void lv_draw_sw_rect(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); -/** - * Draw a triangle with SW render. - * @param draw_unit pointer to a draw unit - * @param dsc the draw descriptor - */ -void lv_draw_sw_triangle(lv_draw_unit_t * draw_unit, const lv_draw_triangle_dsc_t * dsc); +void lv_draw_sw_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); +void lv_draw_sw_letter(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p, + uint32_t letter); -/** - * Mask out a rectangle with radius from a current layer - * @param draw_unit pointer to a draw unit - * @param dsc the draw descriptor - * @param coords the coordinates of the mask - */ -void lv_draw_sw_mask_rect(lv_draw_unit_t * draw_unit, const lv_draw_mask_rect_dsc_t * dsc, const lv_area_t * coords); +void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_img_decoded(struct _lv_draw_ctx_t * draw_ctx, + const lv_draw_img_dsc_t * draw_dsc, + const lv_area_t * coords, const uint8_t * src_buf, + lv_img_cf_t cf); -/** - * Used internally to get a transformed are of an image - * @param draw_unit pointer to a draw unit - * @param dest_area area to calculate, i.e. get this area from the transformed image - * @param src_buf source buffer - * @param src_w source buffer width in pixels - * @param src_h source buffer height in pixels - * @param src_stride source buffer stride in bytes - * @param draw_dsc draw descriptor - * @param sup supplementary data - * @param cf color format of the source buffer - * @param dest_buf the destination buffer - */ -void lv_draw_sw_transform(lv_draw_unit_t * draw_unit, const lv_area_t * dest_area, const void * src_buf, - int32_t src_w, int32_t src_h, int32_t src_stride, - const lv_draw_image_dsc_t * draw_dsc, const lv_draw_image_sup_t * sup, lv_color_format_t cf, void * dest_buf); +void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, + const lv_point_t * point1, const lv_point_t * point2); -#if LV_USE_VECTOR_GRAPHIC && LV_USE_THORVG -/** - * Draw vector graphics with SW render. - * @param draw_unit pointer to a draw unit - * @param dsc the draw descriptor - */ -void lv_draw_sw_vector(lv_draw_unit_t * draw_unit, const lv_draw_vector_task_dsc_t * dsc); -#endif +void lv_draw_sw_polygon(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc, + const lv_point_t * points, uint16_t point_cnt); -/** - * Swap the upper and lower byte of an RGB565 buffer. - * Might be required if a 8bit parallel port or an SPI port send the bytes in the wrong order. - * The bytes will be swapped in place. - * @param buf pointer to buffer - * @param buf_size_px number of pixels in the buffer - */ -void lv_draw_sw_rgb565_swap(void * buf, uint32_t buf_size_px); +void lv_draw_sw_buffer_copy(lv_draw_ctx_t * draw_ctx, + void * dest_buf, lv_coord_t dest_stride, const lv_area_t * dest_area, + void * src_buf, lv_coord_t src_stride, const lv_area_t * src_area); -/** - * Invert a draw buffer in the I1 color format. - * Conventionally, a bit is set to 1 during blending if the luminance is greater than 127. - * Depending on the display controller used, you might want to have different behavior. - * The inversion will be performed in place. - * @param buf pointer to the buffer to be inverted - * @param buf_size size of the buffer in bytes - */ -void lv_draw_sw_i1_invert(void * buf, uint32_t buf_size); +void lv_draw_sw_transform(lv_draw_ctx_t * draw_ctx, const lv_area_t * dest_area, const void * src_buf, + lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, + const lv_draw_img_dsc_t * draw_dsc, lv_img_cf_t cf, lv_color_t * cbuf, lv_opa_t * abuf); -/** - * Rotate a buffer into another buffer - * @param src the source buffer - * @param dest the destination buffer - * @param src_width source width in pixels - * @param src_height source height in pixels - * @param src_stride source stride in bytes (number of bytes in a row) - * @param dest_stride destination stride in bytes (number of bytes in a row) - * @param rotation LV_DISPLAY_ROTATION_0/90/180/270 - * @param color_format LV_COLOR_FORMAT_RGB565/RGB888/XRGB8888/ARGB8888 - */ -void lv_draw_sw_rotate(const void * src, void * dest, int32_t src_width, int32_t src_height, int32_t src_stride, - int32_t dest_stride, lv_display_rotation_t rotation, lv_color_format_t color_format); +struct _lv_draw_layer_ctx_t * lv_draw_sw_layer_create(struct _lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx, + lv_draw_layer_flags_t flags); + +void lv_draw_sw_layer_adjust(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx, + lv_draw_layer_flags_t flags); + +void lv_draw_sw_layer_blend(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx, + const lv_draw_img_dsc_t * draw_dsc); + +void lv_draw_sw_layer_destroy(lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx); /*********************** * GLOBAL VARIABLES @@ -193,10 +99,6 @@ void lv_draw_sw_rotate(const void * src, void * dest, int32_t src_width, int32_t * MACROS **********************/ -#include "blend/lv_draw_sw_blend.h" - -#endif /*LV_USE_DRAW_SW*/ - #ifdef __cplusplus } /*extern "C"*/ #endif diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.mk b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.mk new file mode 100644 index 0000000..4625cbc --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw.mk @@ -0,0 +1,17 @@ +CSRCS += lv_draw_sw.c +CSRCS += lv_draw_sw_arc.c +CSRCS += lv_draw_sw_blend.c +CSRCS += lv_draw_sw_dither.c +CSRCS += lv_draw_sw_gradient.c +CSRCS += lv_draw_sw_img.c +CSRCS += lv_draw_sw_letter.c +CSRCS += lv_draw_sw_line.c +CSRCS += lv_draw_sw_polygon.c +CSRCS += lv_draw_sw_rect.c +CSRCS += lv_draw_sw_transform.c +CSRCS += lv_draw_sw_layer.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sw +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sw + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/sw" diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_arc.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_arc.c index ec2fb2f..3ed62b6 100644 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_arc.c +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_arc.c @@ -1,28 +1,16 @@ /** - * @file lv_draw_sw_arc.c + * @file lv_draw_arc.c * */ /********************* * INCLUDES *********************/ -#include "../../misc/lv_area_private.h" -#include "lv_draw_sw_mask_private.h" -#include "blend/lv_draw_sw_blend_private.h" -#include "../lv_image_decoder_private.h" #include "lv_draw_sw.h" -#if LV_USE_DRAW_SW -#if LV_DRAW_SW_COMPLEX - #include "../../misc/lv_math.h" #include "../../misc/lv_log.h" -#include "../../stdlib/lv_mem.h" -#include "../../stdlib/lv_string.h" -#include "../lv_draw_private.h" - -static void add_circle(const lv_opa_t * circle_mask, const lv_area_t * blend_area, const lv_area_t * circle_area, - lv_opa_t * mask_buf, int32_t width); -static void get_rounded_area(int16_t angle, int32_t radius, uint8_t thickness, lv_area_t * res_area); +#include "../../misc/lv_mem.h" +#include "../lv_draw.h" /********************* * DEFINES @@ -33,10 +21,29 @@ static void get_rounded_area(int16_t angle, int32_t radius, uint8_t thickness, l /********************** * TYPEDEFS **********************/ +typedef struct { + const lv_point_t * center; + lv_coord_t radius; + uint16_t start_angle; + uint16_t end_angle; + uint16_t start_quarter; + uint16_t end_quarter; + lv_coord_t width; + lv_draw_rect_dsc_t * draw_dsc; + const lv_area_t * draw_area; + lv_draw_ctx_t * draw_ctx; +} quarter_draw_dsc_t; /********************** * STATIC PROTOTYPES **********************/ +#if LV_DRAW_COMPLEX + static void draw_quarter_0(quarter_draw_dsc_t * q); + static void draw_quarter_1(quarter_draw_dsc_t * q); + static void draw_quarter_2(quarter_draw_dsc_t * q); + static void draw_quarter_3(quarter_draw_dsc_t * q); + static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area); +#endif /*LV_DRAW_COMPLEX*/ /********************** * STATIC VARIABLES @@ -50,34 +57,36 @@ static void get_rounded_area(int16_t angle, int32_t radius, uint8_t thickness, l * GLOBAL FUNCTIONS **********************/ -void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, const lv_area_t * coords) +void lv_draw_sw_arc(lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center, uint16_t radius, + uint16_t start_angle, uint16_t end_angle) { -#if LV_DRAW_SW_COMPLEX +#if LV_DRAW_COMPLEX if(dsc->opa <= LV_OPA_MIN) return; if(dsc->width == 0) return; - if(dsc->start_angle == dsc->end_angle) return; - - int32_t width = dsc->width; - if(width > dsc->radius) width = dsc->radius; - - lv_area_t area_out = *coords; - lv_area_t clipped_area; - if(!lv_area_intersect(&clipped_area, &area_out, draw_unit->clip_area)) return; - - /*Draw a full ring*/ - if(dsc->img_src == NULL && - (dsc->start_angle + 360 == dsc->end_angle || dsc->start_angle == dsc->end_angle + 360)) { - lv_draw_border_dsc_t cir_dsc; - lv_draw_border_dsc_init(&cir_dsc); - cir_dsc.opa = dsc->opa; - cir_dsc.color = dsc->color; - cir_dsc.width = width; - cir_dsc.radius = LV_RADIUS_CIRCLE; - cir_dsc.side = LV_BORDER_SIDE_FULL; - lv_draw_sw_border(draw_unit, &cir_dsc, &area_out); - return; + if(start_angle == end_angle) return; + + lv_coord_t width = dsc->width; + if(width > radius) width = radius; + + lv_draw_rect_dsc_t cir_dsc; + lv_draw_rect_dsc_init(&cir_dsc); + cir_dsc.blend_mode = dsc->blend_mode; + if(dsc->img_src) { + cir_dsc.bg_opa = LV_OPA_TRANSP; + cir_dsc.bg_img_src = dsc->img_src; + cir_dsc.bg_img_opa = dsc->opa; + } + else { + cir_dsc.bg_opa = dsc->opa; + cir_dsc.bg_color = dsc->color; } + lv_area_t area_out; + area_out.x1 = center->x - radius; + area_out.y1 = center->y - radius; + area_out.x2 = center->x + radius - 1; /*-1 because the center already belongs to the left/bottom part*/ + area_out.y2 = center->y + radius - 1; + lv_area_t area_in; lv_area_copy(&area_in, &area_out); area_in.x1 += dsc->width; @@ -85,232 +94,444 @@ void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, c area_in.x2 -= dsc->width; area_in.y2 -= dsc->width; - int32_t start_angle = (int32_t)dsc->start_angle; - int32_t end_angle = (int32_t)dsc->end_angle; - while(start_angle >= 360) start_angle -= 360; - while(end_angle >= 360) end_angle -= 360; - - void * mask_list[4] = {0}; - /*Create an angle mask*/ - lv_draw_sw_mask_angle_param_t mask_angle_param; - lv_draw_sw_mask_angle_init(&mask_angle_param, dsc->center.x, dsc->center.y, start_angle, end_angle); - mask_list[0] = &mask_angle_param; - - /*Create an outer mask*/ - lv_draw_sw_mask_radius_param_t mask_out_param; - lv_draw_sw_mask_radius_init(&mask_out_param, &area_out, LV_RADIUS_CIRCLE, false); - mask_list[1] = &mask_out_param; - /*Create inner the mask*/ - lv_draw_sw_mask_radius_param_t mask_in_param; + int16_t mask_in_id = LV_MASK_ID_INV; + lv_draw_mask_radius_param_t mask_in_param; bool mask_in_param_valid = false; if(lv_area_get_width(&area_in) > 0 && lv_area_get_height(&area_in) > 0) { - lv_draw_sw_mask_radius_init(&mask_in_param, &area_in, LV_RADIUS_CIRCLE, true); - mask_list[2] = &mask_in_param; + lv_draw_mask_radius_init(&mask_in_param, &area_in, LV_RADIUS_CIRCLE, true); mask_in_param_valid = true; + mask_in_id = lv_draw_mask_add(&mask_in_param, NULL); } - int32_t blend_h = lv_area_get_height(&clipped_area); - int32_t blend_w = lv_area_get_width(&clipped_area); - int32_t h; - lv_opa_t * mask_buf = lv_malloc(blend_w); - - lv_area_t blend_area = clipped_area; - lv_area_t img_area; - lv_draw_sw_blend_dsc_t blend_dsc = {0}; - blend_dsc.mask_buf = mask_buf; - blend_dsc.opa = dsc->opa; - blend_dsc.blend_area = &blend_area; - blend_dsc.mask_area = &blend_area; - - const uint8_t * img_mask = NULL; - lv_image_decoder_dsc_t decoder_dsc; - if(dsc->img_src == NULL) { - blend_dsc.color = dsc->color; - } - else { - lv_result_t res = lv_image_decoder_open(&decoder_dsc, dsc->img_src, NULL); - if(res == LV_RESULT_INVALID || decoder_dsc.decoded == NULL) { - LV_LOG_WARN("Can't decode the background image"); - blend_dsc.color = dsc->color; - } - else { - img_area.x1 = 0; - img_area.y1 = 0; - img_area.x2 = decoder_dsc.decoded->header.w - 1; - img_area.y2 = decoder_dsc.decoded->header.h - 1; - int32_t ofs = decoder_dsc.decoded->header.w / 2; - lv_area_move(&img_area, dsc->center.x - ofs, dsc->center.y - ofs); - blend_dsc.src_area = &img_area; - blend_dsc.src_buf = decoder_dsc.decoded->data; - blend_dsc.src_stride = decoder_dsc.decoded->header.stride; - blend_dsc.src_color_format = decoder_dsc.decoded->header.cf; - if(blend_dsc.src_color_format == LV_COLOR_FORMAT_RGB565A8) { - blend_dsc.src_color_format = LV_COLOR_FORMAT_RGB565; - img_mask = (uint8_t *)blend_dsc.src_buf + blend_dsc.src_stride * lv_area_get_height(blend_dsc.src_area); - } - } - } + lv_draw_mask_radius_param_t mask_out_param; + lv_draw_mask_radius_init(&mask_out_param, &area_out, LV_RADIUS_CIRCLE, false); + int16_t mask_out_id = lv_draw_mask_add(&mask_out_param, NULL); - lv_opa_t * circle_mask = NULL; - lv_area_t round_area_1; - lv_area_t round_area_2; - if(dsc->rounded) { - circle_mask = lv_malloc(width * width); - lv_memset(circle_mask, 0xff, width * width); - lv_area_t circle_area = {0, 0, width - 1, width - 1}; - lv_draw_sw_mask_radius_param_t circle_mask_param; - lv_draw_sw_mask_radius_init(&circle_mask_param, &circle_area, width / 2, false); - void * circle_mask_list[2] = {&circle_mask_param, NULL}; - - lv_opa_t * circle_mask_tmp = circle_mask; - for(h = 0; h < width; h++) { - lv_draw_sw_mask_res_t res = lv_draw_sw_mask_apply(circle_mask_list, circle_mask_tmp, 0, h, width); - if(res == LV_DRAW_SW_MASK_RES_TRANSP) { - lv_memzero(circle_mask_tmp, width); - } + /*Draw a full ring*/ + if(start_angle + 360 == end_angle || start_angle == end_angle + 360) { + cir_dsc.radius = LV_RADIUS_CIRCLE; + lv_draw_rect(draw_ctx, &cir_dsc, &area_out); + + lv_draw_mask_remove_id(mask_out_id); + if(mask_in_id != LV_MASK_ID_INV) lv_draw_mask_remove_id(mask_in_id); - circle_mask_tmp += width; + lv_draw_mask_free_param(&mask_out_param); + if(mask_in_param_valid) { + lv_draw_mask_free_param(&mask_in_param); } - get_rounded_area(start_angle, dsc->radius, width, &round_area_1); - lv_area_move(&round_area_1, dsc->center.x, dsc->center.y); - get_rounded_area(end_angle, dsc->radius, width, &round_area_2); - lv_area_move(&round_area_2, dsc->center.x, dsc->center.y); + return; } - blend_area.y2 = blend_area.y1; - for(h = 0; h < blend_h; h++) { - lv_memset(mask_buf, 0xff, blend_w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(mask_list, mask_buf, blend_area.x1, blend_area.y1, blend_w); - - if(dsc->rounded) { - if(blend_area.y1 >= round_area_1.y1 && blend_area.y1 <= round_area_1.y2) { - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_TRANSP) { - lv_memzero(mask_buf, blend_w); - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - add_circle(circle_mask, &blend_area, &round_area_1, mask_buf, width); - } - if(blend_area.y1 >= round_area_2.y1 && blend_area.y1 <= round_area_2.y2) { - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_TRANSP) { - lv_memzero(mask_buf, blend_w); - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - add_circle(circle_mask, &blend_area, &round_area_2, mask_buf, width); - } - } - - /*If it was an RGB565A8 image use consider its A8 part on the mask*/ - if(img_mask && blend_dsc.mask_res != LV_DRAW_SW_MASK_RES_TRANSP) { - const uint8_t * img_mask_tmp = img_mask; - img_mask_tmp += blend_dsc.src_stride / 2 * (blend_area.y1 - blend_dsc.src_area->y1); - img_mask_tmp += blend_area.x1 - blend_dsc.src_area->x1; + while(start_angle >= 360) start_angle -= 360; + while(end_angle >= 360) end_angle -= 360; - int32_t i; - for(i = 0; i < blend_w; i++) { - mask_buf[i] = LV_OPA_MIX2(mask_buf[i], img_mask_tmp[i]); - } - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) { - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - } + lv_draw_mask_angle_param_t mask_angle_param; + lv_draw_mask_angle_init(&mask_angle_param, center->x, center->y, start_angle, end_angle); + int16_t mask_angle_id = lv_draw_mask_add(&mask_angle_param, NULL); - lv_draw_sw_blend(draw_unit, &blend_dsc); + int32_t angle_gap; + if(end_angle > start_angle) { + angle_gap = 360 - (end_angle - start_angle); + } + else { + angle_gap = start_angle - end_angle; + } - blend_area.y1 ++; - blend_area.y2 ++; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + + if(angle_gap > SPLIT_ANGLE_GAP_LIMIT && radius > SPLIT_RADIUS_LIMIT) { + /*Handle each quarter individually and skip which is empty*/ + quarter_draw_dsc_t q_dsc; + q_dsc.center = center; + q_dsc.radius = radius; + q_dsc.start_angle = start_angle; + q_dsc.end_angle = end_angle; + q_dsc.start_quarter = (start_angle / 90) & 0x3; + q_dsc.end_quarter = (end_angle / 90) & 0x3; + q_dsc.width = width; + q_dsc.draw_dsc = &cir_dsc; + q_dsc.draw_area = &area_out; + q_dsc.draw_ctx = draw_ctx; + + draw_quarter_0(&q_dsc); + draw_quarter_1(&q_dsc); + draw_quarter_2(&q_dsc); + draw_quarter_3(&q_dsc); + } + else { + lv_draw_rect(draw_ctx, &cir_dsc, &area_out); } - lv_draw_sw_mask_free_param(&mask_angle_param); - lv_draw_sw_mask_free_param(&mask_out_param); + lv_draw_mask_free_param(&mask_angle_param); + lv_draw_mask_free_param(&mask_out_param); if(mask_in_param_valid) { - lv_draw_sw_mask_free_param(&mask_in_param); + lv_draw_mask_free_param(&mask_in_param); } - lv_free(mask_buf); - if(dsc->img_src) lv_image_decoder_close(&decoder_dsc); - if(circle_mask) lv_free(circle_mask); + lv_draw_mask_remove_id(mask_angle_id); + lv_draw_mask_remove_id(mask_out_id); + if(mask_in_id != LV_MASK_ID_INV) lv_draw_mask_remove_id(mask_in_id); + + if(dsc->rounded) { + + lv_draw_mask_radius_param_t mask_end_param; + + lv_area_t round_area; + get_rounded_area(start_angle, radius, width, &round_area); + round_area.x1 += center->x; + round_area.x2 += center->x; + round_area.y1 += center->y; + round_area.y2 += center->y; + lv_area_t clip_area2; + if(_lv_area_intersect(&clip_area2, clip_area_ori, &round_area)) { + lv_draw_mask_radius_init(&mask_end_param, &round_area, LV_RADIUS_CIRCLE, false); + int16_t mask_end_id = lv_draw_mask_add(&mask_end_param, NULL); + + draw_ctx->clip_area = &clip_area2; + lv_draw_rect(draw_ctx, &cir_dsc, &area_out); + lv_draw_mask_remove_id(mask_end_id); + lv_draw_mask_free_param(&mask_end_param); + } + + get_rounded_area(end_angle, radius, width, &round_area); + round_area.x1 += center->x; + round_area.x2 += center->x; + round_area.y1 += center->y; + round_area.y2 += center->y; + if(_lv_area_intersect(&clip_area2, clip_area_ori, &round_area)) { + lv_draw_mask_radius_init(&mask_end_param, &round_area, LV_RADIUS_CIRCLE, false); + int16_t mask_end_id = lv_draw_mask_add(&mask_end_param, NULL); + + draw_ctx->clip_area = &clip_area2; + lv_draw_rect(draw_ctx, &cir_dsc, &area_out); + lv_draw_mask_remove_id(mask_end_id); + lv_draw_mask_free_param(&mask_end_param); + } + draw_ctx->clip_area = clip_area_ori; + } #else - LV_LOG_WARN("Can't draw arc with LV_DRAW_SW_COMPLEX == 0"); + LV_LOG_WARN("Can't draw arc with LV_DRAW_COMPLEX == 0"); LV_UNUSED(center); LV_UNUSED(radius); LV_UNUSED(start_angle); LV_UNUSED(end_angle); - LV_UNUSED(layer); + LV_UNUSED(draw_ctx); LV_UNUSED(dsc); -#endif /*LV_DRAW_SW_COMPLEX*/ +#endif /*LV_DRAW_COMPLEX*/ } /********************** * STATIC FUNCTIONS **********************/ -static void add_circle(const lv_opa_t * circle_mask, const lv_area_t * blend_area, const lv_area_t * circle_area, - lv_opa_t * mask_buf, int32_t width) +#if LV_DRAW_COMPLEX +static void draw_quarter_0(quarter_draw_dsc_t * q) { - lv_area_t circle_common_area; - if(lv_area_intersect(&circle_common_area, circle_area, blend_area)) { - const lv_opa_t * circle_mask_tmp = circle_mask + width * (circle_common_area.y1 - circle_area->y1); - circle_mask_tmp += circle_common_area.x1 - circle_area->x1; - - lv_opa_t * mask_buf_tmp = mask_buf + circle_common_area.x1 - blend_area->x1; - - uint32_t x; - uint32_t w = lv_area_get_width(&circle_common_area); - for(x = 0; x < w; x++) { - uint32_t res = mask_buf_tmp[x] + circle_mask_tmp[x]; - mask_buf_tmp[x] = res > 255 ? 255 : res; + const lv_area_t * clip_area_ori = q->draw_ctx->clip_area; + lv_area_t quarter_area; + + if(q->start_quarter == 0 && q->end_quarter == 0 && q->start_angle < q->end_angle) { + /*Small arc here*/ + quarter_area.y1 = q->center->y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center->x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + + quarter_area.y2 = q->center->y + ((lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center->x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); } } + else if(q->start_quarter == 0 || q->end_quarter == 0) { + /*Start and/or end arcs here*/ + if(q->start_quarter == 0) { + quarter_area.x1 = q->center->x; + quarter_area.y2 = q->center->y + q->radius; + + quarter_area.y1 = q->center->y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center->x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + if(q->end_quarter == 0) { + quarter_area.x2 = q->center->x + q->radius; + quarter_area.y1 = q->center->y; + + quarter_area.y2 = q->center->y + ((lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center->x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + } + else if((q->start_quarter == q->end_quarter && q->start_quarter != 0 && q->end_angle < q->start_angle) || + (q->start_quarter == 2 && q->end_quarter == 1) || + (q->start_quarter == 3 && q->end_quarter == 2) || + (q->start_quarter == 3 && q->end_quarter == 1)) { + /*Arc crosses here*/ + quarter_area.x1 = q->center->x; + quarter_area.y1 = q->center->y; + quarter_area.x2 = q->center->x + q->radius; + quarter_area.y2 = q->center->y + q->radius; + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + q->draw_ctx->clip_area = clip_area_ori; } -static void get_rounded_area(int16_t angle, int32_t radius, uint8_t thickness, lv_area_t * res_area) +static void draw_quarter_1(quarter_draw_dsc_t * q) { + const lv_area_t * clip_area_ori = q->draw_ctx->clip_area; + lv_area_t quarter_area; + + if(q->start_quarter == 1 && q->end_quarter == 1 && q->start_angle < q->end_angle) { + /*Small arc here*/ + quarter_area.y2 = q->center->y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center->x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + + quarter_area.y1 = q->center->y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center->x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + else if(q->start_quarter == 1 || q->end_quarter == 1) { + /*Start and/or end arcs here*/ + if(q->start_quarter == 1) { + quarter_area.x1 = q->center->x - q->radius; + quarter_area.y1 = q->center->y; + + quarter_area.y2 = q->center->y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center->x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + if(q->end_quarter == 1) { + quarter_area.x2 = q->center->x - 1; + quarter_area.y2 = q->center->y + q->radius; + + quarter_area.y1 = q->center->y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.x1 = q->center->x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + } + else if((q->start_quarter == q->end_quarter && q->start_quarter != 1 && q->end_angle < q->start_angle) || + (q->start_quarter == 0 && q->end_quarter == 2) || + (q->start_quarter == 0 && q->end_quarter == 3) || + (q->start_quarter == 3 && q->end_quarter == 2)) { + /*Arc crosses here*/ + quarter_area.x1 = q->center->x - q->radius; + quarter_area.y1 = q->center->y; + quarter_area.x2 = q->center->x - 1; + quarter_area.y2 = q->center->y + q->radius; + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + q->draw_ctx->clip_area = clip_area_ori; +} + +static void draw_quarter_2(quarter_draw_dsc_t * q) +{ + const lv_area_t * clip_area_ori = q->draw_ctx->clip_area; + lv_area_t quarter_area; + + if(q->start_quarter == 2 && q->end_quarter == 2 && q->start_angle < q->end_angle) { + /*Small arc here*/ + quarter_area.x1 = q->center->x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center->y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + + quarter_area.y1 = q->center->y + ((lv_trigo_sin(q->end_angle) * q->radius) >> LV_TRIGO_SHIFT); + quarter_area.x2 = q->center->x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + else if(q->start_quarter == 2 || q->end_quarter == 2) { + /*Start and/or end arcs here*/ + if(q->start_quarter == 2) { + quarter_area.x2 = q->center->x - 1; + quarter_area.y1 = q->center->y - q->radius; + + quarter_area.x1 = q->center->x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center->y + ((lv_trigo_sin(q->start_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + if(q->end_quarter == 2) { + quarter_area.x1 = q->center->x - q->radius; + quarter_area.y2 = q->center->y - 1; + + quarter_area.x2 = q->center->x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.y1 = q->center->y + ((lv_trigo_sin(q->end_angle) * (q->radius)) >> LV_TRIGO_SHIFT); + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + } + else if((q->start_quarter == q->end_quarter && q->start_quarter != 2 && q->end_angle < q->start_angle) || + (q->start_quarter == 0 && q->end_quarter == 3) || + (q->start_quarter == 1 && q->end_quarter == 3) || + (q->start_quarter == 1 && q->end_quarter == 0)) { + /*Arc crosses here*/ + quarter_area.x1 = q->center->x - q->radius; + quarter_area.y1 = q->center->y - q->radius; + quarter_area.x2 = q->center->x - 1; + quarter_area.y2 = q->center->y - 1; + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + q->draw_ctx->clip_area = clip_area_ori; +} + +static void draw_quarter_3(quarter_draw_dsc_t * q) +{ + const lv_area_t * clip_area_ori = q->draw_ctx->clip_area; + lv_area_t quarter_area; + + if(q->start_quarter == 3 && q->end_quarter == 3 && q->start_angle < q->end_angle) { + /*Small arc here*/ + quarter_area.x1 = q->center->x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.y1 = q->center->y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); + + quarter_area.x2 = q->center->x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center->y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + else if(q->start_quarter == 3 || q->end_quarter == 3) { + /*Start and/or end arcs here*/ + if(q->start_quarter == 3) { + quarter_area.x2 = q->center->x + q->radius; + quarter_area.y2 = q->center->y - 1; + + quarter_area.x1 = q->center->x + ((lv_trigo_sin(q->start_angle + 90) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + quarter_area.y1 = q->center->y + ((lv_trigo_sin(q->start_angle) * (q->radius)) >> LV_TRIGO_SHIFT); + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + if(q->end_quarter == 3) { + quarter_area.x1 = q->center->x; + quarter_area.y1 = q->center->y - q->radius; + + quarter_area.x2 = q->center->x + ((lv_trigo_sin(q->end_angle + 90) * (q->radius)) >> LV_TRIGO_SHIFT); + quarter_area.y2 = q->center->y + ((lv_trigo_sin(q->end_angle) * (q->radius - q->width)) >> LV_TRIGO_SHIFT); + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + } + else if((q->start_quarter == q->end_quarter && q->start_quarter != 3 && q->end_angle < q->start_angle) || + (q->start_quarter == 2 && q->end_quarter == 0) || + (q->start_quarter == 1 && q->end_quarter == 0) || + (q->start_quarter == 2 && q->end_quarter == 1)) { + /*Arc crosses here*/ + quarter_area.x1 = q->center->x; + quarter_area.y1 = q->center->y - q->radius; + quarter_area.x2 = q->center->x + q->radius; + quarter_area.y2 = q->center->y - 1; + + bool ok = _lv_area_intersect(&quarter_area, &quarter_area, clip_area_ori); + if(ok) { + q->draw_ctx->clip_area = &quarter_area; + lv_draw_rect(q->draw_ctx, q->draw_dsc, q->draw_area); + } + } + + q->draw_ctx->clip_area = clip_area_ori; +} + +static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area) +{ + const uint8_t ps = 8; + const uint8_t pa = 127; + int32_t thick_half = thickness / 2; uint8_t thick_corr = (thickness & 0x01) ? 0 : 1; int32_t cir_x; int32_t cir_y; - cir_x = ((radius - thick_half) * lv_trigo_cos(angle)) >> (LV_TRIGO_SHIFT - 8); - cir_y = ((radius - thick_half) * lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - 8); + cir_x = ((radius - thick_half) * lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps); + cir_y = ((radius - thick_half) * lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps); - /*The center of the pixel need to be calculated so apply 1/2 px offset*/ + /*Actually the center of the pixel need to be calculated so apply 1/2 px offset*/ if(cir_x > 0) { - cir_x = (cir_x - 128) >> 8; + cir_x = (cir_x - pa) >> ps; res_area->x1 = cir_x - thick_half + thick_corr; res_area->x2 = cir_x + thick_half; } else { - cir_x = (cir_x + 128) >> 8; + cir_x = (cir_x + pa) >> ps; res_area->x1 = cir_x - thick_half; res_area->x2 = cir_x + thick_half - thick_corr; } if(cir_y > 0) { - cir_y = (cir_y - 128) >> 8; + cir_y = (cir_y - pa) >> ps; res_area->y1 = cir_y - thick_half + thick_corr; res_area->y2 = cir_y + thick_half; } else { - cir_y = (cir_y + 128) >> 8; + cir_y = (cir_y + pa) >> ps; res_area->y1 = cir_y - thick_half; res_area->y2 = cir_y + thick_half - thick_corr; } } -#else /*LV_DRAW_SW_COMPLEX*/ - -void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, const lv_area_t * coords) -{ - LV_UNUSED(draw_unit); - LV_UNUSED(dsc); - LV_UNUSED(coords); - - LV_LOG_WARN("LV_DRAW_SW_COMPLEX needs to be enabled"); -} - -#endif /*LV_DRAW_SW_COMPLEX*/ -#endif /*LV_USE_DRAW_SW*/ +#endif /*LV_DRAW_COMPLEX*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_blend.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_blend.c new file mode 100644 index 0000000..a7c4313 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_blend.c @@ -0,0 +1,1061 @@ +/** + * @file lv_draw_sw_blend.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_draw_sw.h" +#include "../../misc/lv_math.h" +#include "../../hal/lv_hal_disp.h" +#include "../../core/lv_refr.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +static void fill_set_px(lv_color_t * dest_buf, const lv_area_t * blend_area, lv_coord_t dest_stride, + lv_color_t color, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stide); + +static void /* LV_ATTRIBUTE_FAST_MEM */ fill_normal(lv_color_t * dest_buf, const lv_area_t * dest_area, + lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa, + const lv_opa_t * mask, lv_coord_t mask_stride); + + +#if LV_COLOR_SCREEN_TRANSP +static void /* LV_ATTRIBUTE_FAST_MEM */ fill_argb(lv_color_t * dest_buf, const lv_area_t * dest_area, + lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa, + const lv_opa_t * mask, lv_coord_t mask_stride); +#endif /*LV_COLOR_SCREEN_TRANSP*/ + +#if LV_DRAW_COMPLEX +static void fill_blended(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, lv_color_t color, + lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stride, lv_blend_mode_t blend_mode); +#endif /*LV_DRAW_COMPLEX*/ + +static void map_set_px(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa, + const lv_opa_t * mask, lv_coord_t mask_stride); + +static void /* LV_ATTRIBUTE_FAST_MEM */ map_normal(lv_color_t * dest_buf, const lv_area_t * dest_area, + lv_coord_t dest_stride, const lv_color_t * src_buf, + lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask, + lv_coord_t mask_stride); + +#if LV_COLOR_SCREEN_TRANSP +static void /* LV_ATTRIBUTE_FAST_MEM */ map_argb(lv_color_t * dest_buf, const lv_area_t * dest_area, + lv_coord_t dest_stride, const lv_color_t * src_buf, + lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask, + lv_coord_t mask_stride, lv_blend_mode_t blend_mode); + +#endif /*LV_COLOR_SCREEN_TRANSP*/ + +#if LV_DRAW_COMPLEX +static void map_blended(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa, + const lv_opa_t * mask, lv_coord_t mask_stride, lv_blend_mode_t blend_mode); + +static inline lv_color_t color_blend_true_color_additive(lv_color_t fg, lv_color_t bg, lv_opa_t opa); +static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_color_t bg, lv_opa_t opa); +static inline lv_color_t color_blend_true_color_multiply(lv_color_t fg, lv_color_t bg, lv_opa_t opa); +#endif /*LV_DRAW_COMPLEX*/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ +#define FILL_NORMAL_MASK_PX(color) \ + if(*mask == LV_OPA_COVER) *dest_buf = color; \ + else *dest_buf = lv_color_mix(color, *dest_buf, *mask); \ + mask++; \ + dest_buf++; + +#define MAP_NORMAL_MASK_PX(x) \ + if(*mask_tmp_x) { \ + if(*mask_tmp_x == LV_OPA_COVER) dest_buf[x] = src_buf[x]; \ + else dest_buf[x] = lv_color_mix(src_buf[x], dest_buf[x], *mask_tmp_x); \ + } \ + mask_tmp_x++; + + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_draw_sw_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc) +{ + /*Do not draw transparent things*/ + if(dsc->opa <= LV_OPA_MIN) return; + + lv_area_t blend_area; + if(!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area)) return; + + if(draw_ctx->wait_for_finish) draw_ctx->wait_for_finish(draw_ctx); + + ((lv_draw_sw_ctx_t *)draw_ctx)->blend(draw_ctx, dsc); +} + +void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_basic(lv_draw_ctx_t * draw_ctx, + const lv_draw_sw_blend_dsc_t * dsc) +{ + lv_opa_t * mask; + if(dsc->mask_buf == NULL) mask = NULL; + if(dsc->mask_buf && dsc->mask_res == LV_DRAW_MASK_RES_TRANSP) return; + else if(dsc->mask_res == LV_DRAW_MASK_RES_FULL_COVER) mask = NULL; + else mask = dsc->mask_buf; + + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); + + lv_area_t blend_area; + if(!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area)) return; + + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + lv_color_t * dest_buf = draw_ctx->buf; + if(disp->driver->set_px_cb == NULL) { + if(disp->driver->screen_transp == 0) { + dest_buf += dest_stride * (blend_area.y1 - draw_ctx->buf_area->y1) + (blend_area.x1 - draw_ctx->buf_area->x1); + } + else { + /*With LV_COLOR_DEPTH 16 it means ARGB8565 (3 bytes format)*/ + uint8_t * dest_buf8 = (uint8_t *) dest_buf; + dest_buf8 += dest_stride * (blend_area.y1 - draw_ctx->buf_area->y1) * LV_IMG_PX_SIZE_ALPHA_BYTE; + dest_buf8 += (blend_area.x1 - draw_ctx->buf_area->x1) * LV_IMG_PX_SIZE_ALPHA_BYTE; + dest_buf = (lv_color_t *)dest_buf8; + } + } + + const lv_color_t * src_buf = dsc->src_buf; + lv_coord_t src_stride; + if(src_buf) { + src_stride = lv_area_get_width(dsc->blend_area); + src_buf += src_stride * (blend_area.y1 - dsc->blend_area->y1) + (blend_area.x1 - dsc->blend_area->x1); + } + else { + src_stride = 0; + } + + lv_coord_t mask_stride; + if(mask) { + /*Round the values in the mask if anti-aliasing is disabled*/ + if(disp->driver->antialiasing == 0) { + int32_t mask_size = lv_area_get_size(dsc->mask_area); + int32_t i; + for(i = 0; i < mask_size; i++) { + mask[i] = mask[i] > 128 ? LV_OPA_COVER : LV_OPA_TRANSP; + } + } + + mask_stride = lv_area_get_width(dsc->mask_area); + mask += mask_stride * (blend_area.y1 - dsc->mask_area->y1) + (blend_area.x1 - dsc->mask_area->x1); + + } + else { + mask_stride = 0; + } + + lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + + + if(disp->driver->set_px_cb) { + if(dsc->src_buf == NULL) { + fill_set_px(dest_buf, &blend_area, dest_stride, dsc->color, dsc->opa, mask, mask_stride); + } + else { + map_set_px(dest_buf, &blend_area, dest_stride, src_buf, src_stride, dsc->opa, mask, mask_stride); + } + } +#if LV_COLOR_SCREEN_TRANSP + else if(disp->driver->screen_transp) { + if(dsc->src_buf == NULL) { + fill_argb(dest_buf, &blend_area, dest_stride, dsc->color, dsc->opa, mask, mask_stride); + } + else { + map_argb(dest_buf, &blend_area, dest_stride, src_buf, src_stride, dsc->opa, mask, mask_stride, dsc->blend_mode); + } + } +#endif + else if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { + if(dsc->src_buf == NULL) { + fill_normal(dest_buf, &blend_area, dest_stride, dsc->color, dsc->opa, mask, mask_stride); + } + else { + map_normal(dest_buf, &blend_area, dest_stride, src_buf, src_stride, dsc->opa, mask, mask_stride); + } + } + else { +#if LV_DRAW_COMPLEX + if(dsc->src_buf == NULL) { + fill_blended(dest_buf, &blend_area, dest_stride, dsc->color, dsc->opa, mask, mask_stride, dsc->blend_mode); + } + else { + map_blended(dest_buf, &blend_area, dest_stride, src_buf, src_stride, dsc->opa, mask, mask_stride, dsc->blend_mode); + } +#endif + } +} + + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void fill_set_px(lv_color_t * dest_buf, const lv_area_t * blend_area, lv_coord_t dest_stride, + lv_color_t color, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stide) +{ + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + + int32_t x; + int32_t y; + + if(mask == NULL) { + for(y = blend_area->y1; y <= blend_area->y2; y++) { + for(x = blend_area->x1; x <= blend_area->x2; x++) { + disp->driver->set_px_cb(disp->driver, (void *)dest_buf, dest_stride, x, y, color, opa); + } + } + } + else { + int32_t w = lv_area_get_width(blend_area); + int32_t h = lv_area_get_height(blend_area); + + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + if(mask[x]) { + + + disp->driver->set_px_cb(disp->driver, (void *)dest_buf, dest_stride, blend_area->x1 + x, blend_area->y1 + y, color, + (uint32_t)((uint32_t)opa * mask[x]) >> 8); + } + } + mask += mask_stide; + } + } +} + +static LV_ATTRIBUTE_FAST_MEM void fill_normal(lv_color_t * dest_buf, const lv_area_t * dest_area, + lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa, + const lv_opa_t * mask, lv_coord_t mask_stride) +{ + int32_t w = lv_area_get_width(dest_area); + int32_t h = lv_area_get_height(dest_area); + + int32_t x; + int32_t y; + + /*No mask*/ + if(mask == NULL) { + if(opa >= LV_OPA_MAX) { + for(y = 0; y < h; y++) { + lv_color_fill(dest_buf, color, w); + dest_buf += dest_stride; + } + } + /*Has opacity*/ + else { + lv_color_t last_dest_color = lv_color_black(); + lv_color_t last_res_color = lv_color_mix(color, last_dest_color, opa); + +#if LV_COLOR_MIX_ROUND_OFS == 0 && LV_COLOR_DEPTH == 16 + /*lv_color_mix work with an optimized algorithm with 16 bit color depth. + *However, it introduces some rounded error on opa. + *Introduce the same error here too to make lv_color_premult produces the same result */ + opa = (uint32_t)((uint32_t)opa + 4) >> 3; + opa = opa << 3; +#endif + + uint16_t color_premult[3]; + lv_color_premult(color, opa, color_premult); + lv_opa_t opa_inv = 255 - opa; + + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + if(last_dest_color.full != dest_buf[x].full) { + last_dest_color = dest_buf[x]; + last_res_color = lv_color_mix_premult(color_premult, dest_buf[x], opa_inv); + } + dest_buf[x] = last_res_color; + } + dest_buf += dest_stride; + } + } + } + /*Masked*/ + else { +#if LV_COLOR_DEPTH == 16 + uint32_t c32 = color.full + ((uint32_t)color.full << 16); +#endif + /*Only the mask matters*/ + if(opa >= LV_OPA_MAX) { + int32_t x_end4 = w - 4; + for(y = 0; y < h; y++) { + for(x = 0; x < w && ((lv_uintptr_t)(mask) & 0x3); x++) { + FILL_NORMAL_MASK_PX(color) + } + + for(; x <= x_end4; x += 4) { + uint32_t mask32 = *((uint32_t *)mask); + if(mask32 == 0xFFFFFFFF) { +#if LV_COLOR_DEPTH == 16 + if((lv_uintptr_t)dest_buf & 0x3) { + *(dest_buf + 0) = color; + uint32_t * d = (uint32_t *)(dest_buf + 1); + *d = c32; + *(dest_buf + 3) = color; + } + else { + uint32_t * d = (uint32_t *)dest_buf; + *d = c32; + *(d + 1) = c32; + } +#else + dest_buf[0] = color; + dest_buf[1] = color; + dest_buf[2] = color; + dest_buf[3] = color; +#endif + dest_buf += 4; + mask += 4; + } + else if(mask32) { + FILL_NORMAL_MASK_PX(color) + FILL_NORMAL_MASK_PX(color) + FILL_NORMAL_MASK_PX(color) + FILL_NORMAL_MASK_PX(color) + } + else { + mask += 4; + dest_buf += 4; + } + } + + for(; x < w ; x++) { + FILL_NORMAL_MASK_PX(color) + } + dest_buf += (dest_stride - w); + mask += (mask_stride - w); + } + } + /*With opacity*/ + else { + /*Buffer the result color to avoid recalculating the same color*/ + lv_color_t last_dest_color; + lv_color_t last_res_color; + lv_opa_t last_mask = LV_OPA_TRANSP; + last_dest_color.full = dest_buf[0].full; + last_res_color.full = dest_buf[0].full; + lv_opa_t opa_tmp = LV_OPA_TRANSP; + + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + if(*mask) { + if(*mask != last_mask) opa_tmp = *mask == LV_OPA_COVER ? opa : + (uint32_t)((uint32_t)(*mask) * opa) >> 8; + if(*mask != last_mask || last_dest_color.full != dest_buf[x].full) { + if(opa_tmp == LV_OPA_COVER) last_res_color = color; + else last_res_color = lv_color_mix(color, dest_buf[x], opa_tmp); + last_mask = *mask; + last_dest_color.full = dest_buf[x].full; + } + dest_buf[x] = last_res_color; + } + mask++; + } + dest_buf += dest_stride; + mask += (mask_stride - w); + } + } + } +} + +#if LV_COLOR_SCREEN_TRANSP +static inline void set_px_argb(uint8_t * buf, lv_color_t color, lv_opa_t opa) +{ + lv_color_t bg_color; + lv_color_t res_color; + lv_opa_t bg_opa = buf[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; +#if LV_COLOR_DEPTH == 8 + bg_color.full = buf[0]; + lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf[1]); + if(buf[1] <= LV_OPA_MIN) return; + buf[0] = res_color.full; +#elif LV_COLOR_DEPTH == 16 + bg_color.full = buf[0] + (buf[1] << 8); + lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf[2]); + if(buf[2] <= LV_OPA_MIN) return; + buf[0] = res_color.full & 0xff; + buf[1] = res_color.full >> 8; +#elif LV_COLOR_DEPTH == 32 + bg_color = *((lv_color_t *)buf); + lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf[3]); + if(buf[3] <= LV_OPA_MIN) return; + buf[0] = res_color.ch.blue; + buf[1] = res_color.ch.green; + buf[2] = res_color.ch.red; +#endif +} + +static inline void set_px_argb_blend(uint8_t * buf, lv_color_t color, lv_opa_t opa, lv_color_t (*blend_fp)(lv_color_t, + lv_color_t, lv_opa_t)) +{ + static lv_color_t last_dest_color; + static lv_color_t last_src_color; + static lv_color_t last_res_color; + static uint32_t last_opa = 0xffff; /*Set to an invalid value for first*/ + + lv_color_t bg_color; + + /*Get the BG color*/ +#if LV_COLOR_DEPTH == 8 + if(buf[1] <= LV_OPA_MIN) return; + bg_color.full = buf[0]; +#elif LV_COLOR_DEPTH == 16 + if(buf[2] <= LV_OPA_MIN) return; + bg_color.full = buf[0] + (buf[1] << 8); +#elif LV_COLOR_DEPTH == 32 + if(buf[3] <= LV_OPA_MIN) return; + bg_color = *((lv_color_t *)buf); +#endif + + /*Get the result color*/ + if(last_dest_color.full != bg_color.full || last_src_color.full != color.full || last_opa != opa) { + last_dest_color = bg_color; + last_src_color = color; + last_opa = opa; + last_res_color = blend_fp(last_src_color, last_dest_color, last_opa); + } + + /*Set the result color*/ +#if LV_COLOR_DEPTH == 8 + buf[0] = last_res_color.full; +#elif LV_COLOR_DEPTH == 16 + buf[0] = last_res_color.full & 0xff; + buf[1] = last_res_color.full >> 8; +#elif LV_COLOR_DEPTH == 32 + buf[0] = last_res_color.ch.blue; + buf[1] = last_res_color.ch.green; + buf[2] = last_res_color.ch.red; +#endif + +} + +static void LV_ATTRIBUTE_FAST_MEM fill_argb(lv_color_t * dest_buf, const lv_area_t * dest_area, + lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa, + const lv_opa_t * mask, lv_coord_t mask_stride) +{ + uint8_t * dest_buf8 = (uint8_t *) dest_buf; + int32_t w = lv_area_get_width(dest_area); + int32_t h = lv_area_get_height(dest_area); + + int32_t x; + int32_t y; + + uint8_t ctmp[LV_IMG_PX_SIZE_ALPHA_BYTE]; + lv_memcpy(ctmp, &color, sizeof(lv_color_t)); + ctmp[LV_IMG_PX_SIZE_ALPHA_BYTE - 1] = opa; + + /*No mask*/ + if(mask == NULL) { + if(opa >= LV_OPA_MAX) { + for(x = 0; x < w; x++) { + lv_memcpy(dest_buf8, ctmp, LV_IMG_PX_SIZE_ALPHA_BYTE); + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + + dest_buf8 += (dest_stride - w) * LV_IMG_PX_SIZE_ALPHA_BYTE; + + for(y = 1; y < h; y++) { + lv_memcpy(dest_buf8, (uint8_t *) dest_buf, w * LV_IMG_PX_SIZE_ALPHA_BYTE); + dest_buf8 += dest_stride * LV_IMG_PX_SIZE_ALPHA_BYTE; + } + } + /*Has opacity*/ + else { + uint8_t * dest_buf8_row = dest_buf8; + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + set_px_argb(dest_buf8, color, opa); + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + dest_buf8_row += dest_stride * LV_IMG_PX_SIZE_ALPHA_BYTE; + dest_buf8 = dest_buf8_row; + } + } + } + /*Masked*/ + else { + /*Only the mask matters*/ + if(opa >= LV_OPA_MAX) { + uint8_t * dest_buf8_row = dest_buf8; + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + set_px_argb(dest_buf8, color, *mask); + mask++; + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + dest_buf8_row += dest_stride * LV_IMG_PX_SIZE_ALPHA_BYTE; + dest_buf8 = dest_buf8_row; + } + } + /*With opacity*/ + else { + /*Buffer the result color to avoid recalculating the same color*/ + lv_opa_t last_mask = LV_OPA_TRANSP; + lv_opa_t opa_tmp = LV_OPA_TRANSP; + + uint8_t * dest_buf8_row = dest_buf8; + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + if(*mask) { + if(*mask != last_mask) opa_tmp = *mask == LV_OPA_COVER ? opa : + (uint32_t)((uint32_t)(*mask) * opa) >> 8; + + set_px_argb(dest_buf8, color, opa_tmp); + } + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + mask++; + } + dest_buf8_row += dest_stride * LV_IMG_PX_SIZE_ALPHA_BYTE; + dest_buf8 = dest_buf8_row; + mask += (mask_stride - w); + } + } + } +} +#endif + +#if LV_DRAW_COMPLEX +static void fill_blended(lv_color_t * dest_buf, const lv_area_t * dest_area, + lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stride, + lv_blend_mode_t blend_mode) +{ + + int32_t w = lv_area_get_width(dest_area); + int32_t h = lv_area_get_height(dest_area); + + int32_t x; + int32_t y; + + lv_color_t (*blend_fp)(lv_color_t, lv_color_t, lv_opa_t); + switch(blend_mode) { + case LV_BLEND_MODE_ADDITIVE: + blend_fp = color_blend_true_color_additive; + break; + case LV_BLEND_MODE_SUBTRACTIVE: + blend_fp = color_blend_true_color_subtractive; + break; + case LV_BLEND_MODE_MULTIPLY: + blend_fp = color_blend_true_color_multiply; + break; + default: + LV_LOG_WARN("fill_blended: unsupported blend mode"); + return; + } + + /*Simple fill (maybe with opacity), no masking*/ + if(mask == NULL) { + lv_color_t last_dest_color = dest_buf[0]; + lv_color_t last_res_color = blend_fp(color, dest_buf[0], opa); + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + if(last_dest_color.full != dest_buf[x].full) { + last_dest_color = dest_buf[x]; + last_res_color = blend_fp(color, dest_buf[x], opa); + } + dest_buf[x] = last_res_color; + } + dest_buf += dest_stride; + } + } + /*Masked*/ + else { + /*Buffer the result color to avoid recalculating the same color*/ + lv_color_t last_dest_color; + lv_color_t last_res_color; + lv_opa_t last_mask = LV_OPA_TRANSP; + last_dest_color = dest_buf[0]; + lv_opa_t opa_tmp = mask[0] >= LV_OPA_MAX ? opa : (uint32_t)((uint32_t)mask[0] * opa) >> 8; + last_res_color = blend_fp(color, last_dest_color, opa_tmp); + + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + if(mask[x] == 0) continue; + if(mask[x] != last_mask || last_dest_color.full != dest_buf[x].full) { + opa_tmp = mask[x] >= LV_OPA_MAX ? opa : (uint32_t)((uint32_t)mask[x] * opa) >> 8; + + last_res_color = blend_fp(color, dest_buf[x], opa_tmp); + last_mask = mask[x]; + last_dest_color.full = dest_buf[x].full; + } + dest_buf[x] = last_res_color; + } + dest_buf += dest_stride; + mask += mask_stride; + } + } +} +#endif + +static void map_set_px(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa, + const lv_opa_t * mask, lv_coord_t mask_stride) + +{ + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + + int32_t w = lv_area_get_width(dest_area); + int32_t h = lv_area_get_height(dest_area); + + int32_t x; + int32_t y; + + if(mask == NULL) { + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + disp->driver->set_px_cb(disp->driver, (void *)dest_buf, dest_stride, dest_area->x1 + x, dest_area->y1 + y, src_buf[x], + opa); + } + src_buf += src_stride; + } + } + else { + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + if(mask[x]) { + disp->driver->set_px_cb(disp->driver, (void *)dest_buf, dest_stride, dest_area->x1 + x, dest_area->y1 + y, src_buf[x], + (uint32_t)((uint32_t)opa * mask[x]) >> 8); + } + } + mask += mask_stride; + src_buf += src_stride; + } + } +} + +static void LV_ATTRIBUTE_FAST_MEM map_normal(lv_color_t * dest_buf, const lv_area_t * dest_area, + lv_coord_t dest_stride, const lv_color_t * src_buf, + lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask, + lv_coord_t mask_stride) + +{ + int32_t w = lv_area_get_width(dest_area); + int32_t h = lv_area_get_height(dest_area); + + int32_t x; + int32_t y; + + /*Simple fill (maybe with opacity), no masking*/ + if(mask == NULL) { + if(opa >= LV_OPA_MAX) { + for(y = 0; y < h; y++) { + lv_memcpy(dest_buf, src_buf, w * sizeof(lv_color_t)); + dest_buf += dest_stride; + src_buf += src_stride; + } + } + else { + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + dest_buf[x] = lv_color_mix(src_buf[x], dest_buf[x], opa); + } + dest_buf += dest_stride; + src_buf += src_stride; + } + } + } + /*Masked*/ + else { + /*Only the mask matters*/ + if(opa > LV_OPA_MAX) { + int32_t x_end4 = w - 4; + + for(y = 0; y < h; y++) { + const lv_opa_t * mask_tmp_x = mask; +#if 0 + for(x = 0; x < w; x++) { + MAP_NORMAL_MASK_PX(x); + } +#else + for(x = 0; x < w && ((lv_uintptr_t)mask_tmp_x & 0x3); x++) { + MAP_NORMAL_MASK_PX(x) + } + + uint32_t * mask32 = (uint32_t *)mask_tmp_x; + for(; x < x_end4; x += 4) { + if(*mask32) { + if((*mask32) == 0xFFFFFFFF) { + dest_buf[x] = src_buf[x]; + dest_buf[x + 1] = src_buf[x + 1]; + dest_buf[x + 2] = src_buf[x + 2]; + dest_buf[x + 3] = src_buf[x + 3]; + } + else { + mask_tmp_x = (const lv_opa_t *)mask32; + MAP_NORMAL_MASK_PX(x) + MAP_NORMAL_MASK_PX(x + 1) + MAP_NORMAL_MASK_PX(x + 2) + MAP_NORMAL_MASK_PX(x + 3) + } + } + mask32++; + } + + mask_tmp_x = (const lv_opa_t *)mask32; + for(; x < w ; x++) { + MAP_NORMAL_MASK_PX(x) + } +#endif + dest_buf += dest_stride; + src_buf += src_stride; + mask += mask_stride; + } + } + /*Handle opa and mask values too*/ + else { + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + if(mask[x]) { + lv_opa_t opa_tmp = mask[x] >= LV_OPA_MAX ? opa : ((opa * mask[x]) >> 8); + dest_buf[x] = lv_color_mix(src_buf[x], dest_buf[x], opa_tmp); + } + } + dest_buf += dest_stride; + src_buf += src_stride; + mask += mask_stride; + } + } + } +} + + + +#if LV_COLOR_SCREEN_TRANSP +static void LV_ATTRIBUTE_FAST_MEM map_argb(lv_color_t * dest_buf, const lv_area_t * dest_area, + lv_coord_t dest_stride, const lv_color_t * src_buf, + lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask, + lv_coord_t mask_stride, lv_blend_mode_t blend_mode) + +{ + uint8_t * dest_buf8 = (uint8_t *) dest_buf; + + int32_t w = lv_area_get_width(dest_area); + int32_t h = lv_area_get_height(dest_area); + + int32_t x; + int32_t y; + + lv_color_t (*blend_fp)(lv_color_t, lv_color_t, lv_opa_t); + switch(blend_mode) { + case LV_BLEND_MODE_ADDITIVE: + blend_fp = color_blend_true_color_additive; + break; + case LV_BLEND_MODE_SUBTRACTIVE: + blend_fp = color_blend_true_color_subtractive; + break; + case LV_BLEND_MODE_MULTIPLY: + blend_fp = color_blend_true_color_multiply; + break; + default: + blend_fp = NULL; + } + + /*Simple fill (maybe with opacity), no masking*/ + if(mask == NULL) { + if(opa >= LV_OPA_MAX) { + if(blend_fp == NULL && LV_COLOR_DEPTH == 32) { + for(y = 0; y < h; y++) { + lv_memcpy(dest_buf, src_buf, w * sizeof(lv_color_t)); + dest_buf += dest_stride; + src_buf += src_stride; + } + } + else { + uint8_t * dest_buf8_row = dest_buf8; + for(y = 0; y < h; y++) { + if(blend_fp == NULL) { + for(x = 0; x < w; x++) { + set_px_argb(dest_buf8, src_buf[x], LV_OPA_COVER); + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + } + else { + for(x = 0; x < w; x++) { + set_px_argb_blend(dest_buf8, src_buf[x], LV_OPA_COVER, blend_fp); + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + } + + dest_buf8_row += dest_stride * LV_IMG_PX_SIZE_ALPHA_BYTE; + dest_buf8 = dest_buf8_row; + src_buf += src_stride; + } + } + } + /*No mask but opacity*/ + else { + uint8_t * dest_buf8_row = dest_buf8; + for(y = 0; y < h; y++) { + if(blend_fp == NULL) { + for(x = 0; x < w; x++) { + set_px_argb(dest_buf8, src_buf[x], opa); + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + } + else { + for(x = 0; x < w; x++) { + set_px_argb_blend(dest_buf8, src_buf[x], opa, blend_fp); + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + } + + dest_buf8_row += dest_stride * LV_IMG_PX_SIZE_ALPHA_BYTE; + dest_buf8 = dest_buf8_row; + src_buf += src_stride; + } + } + } + /*Masked*/ + else { + /*Only the mask matters*/ + if(opa > LV_OPA_MAX) { + uint8_t * dest_buf8_row = dest_buf8; + for(y = 0; y < h; y++) { + if(blend_fp == NULL) { + for(x = 0; x < w; x++) { + set_px_argb(dest_buf8, src_buf[x], mask[x]); + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + } + else { + for(x = 0; x < w; x++) { + set_px_argb_blend(dest_buf8, src_buf[x], mask[x], blend_fp); + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + } + dest_buf8_row += dest_stride * LV_IMG_PX_SIZE_ALPHA_BYTE; + dest_buf8 = dest_buf8_row; + src_buf += src_stride; + mask += mask_stride; + } + } + /*Handle opa and mask values too*/ + else { + uint8_t * dest_buf8_row = dest_buf8; + for(y = 0; y < h; y++) { + if(blend_fp == NULL) { + for(x = 0; x < w; x++) { + if(mask[x]) { + lv_opa_t opa_tmp = mask[x] >= LV_OPA_MAX ? opa : ((opa * mask[x]) >> 8); + set_px_argb(dest_buf8, src_buf[x], opa_tmp); + } + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + } + else { + for(x = 0; x < w; x++) { + if(mask[x]) { + lv_opa_t opa_tmp = mask[x] >= LV_OPA_MAX ? opa : ((opa * mask[x]) >> 8); + set_px_argb_blend(dest_buf8, src_buf[x], opa_tmp, blend_fp); + } + dest_buf8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + } + dest_buf8_row += dest_stride * LV_IMG_PX_SIZE_ALPHA_BYTE; + dest_buf8 = dest_buf8_row; + src_buf += src_stride; + mask += mask_stride; + } + } + } +} +#endif + + +#if LV_DRAW_COMPLEX +static void map_blended(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa, + const lv_opa_t * mask, lv_coord_t mask_stride, lv_blend_mode_t blend_mode) +{ + + int32_t w = lv_area_get_width(dest_area); + int32_t h = lv_area_get_height(dest_area); + + int32_t x; + int32_t y; + + lv_color_t (*blend_fp)(lv_color_t, lv_color_t, lv_opa_t); + switch(blend_mode) { + case LV_BLEND_MODE_ADDITIVE: + blend_fp = color_blend_true_color_additive; + break; + case LV_BLEND_MODE_SUBTRACTIVE: + blend_fp = color_blend_true_color_subtractive; + break; + case LV_BLEND_MODE_MULTIPLY: + blend_fp = color_blend_true_color_multiply; + break; + default: + LV_LOG_WARN("fill_blended: unsupported blend mode"); + return; + } + + lv_color_t last_dest_color; + lv_color_t last_src_color; + /*Simple fill (maybe with opacity), no masking*/ + if(mask == NULL) { + last_dest_color = dest_buf[0]; + last_src_color = src_buf[0]; + lv_color_t last_res_color = blend_fp(last_src_color, last_dest_color, opa); + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + if(last_src_color.full != src_buf[x].full || last_dest_color.full != dest_buf[x].full) { + last_dest_color = dest_buf[x]; + last_src_color = src_buf[x]; + last_res_color = blend_fp(last_src_color, last_dest_color, opa); + } + dest_buf[x] = last_res_color; + } + dest_buf += dest_stride; + src_buf += src_stride; + } + } + /*Masked*/ + else { + last_dest_color = dest_buf[0]; + last_src_color = src_buf[0]; + lv_opa_t last_opa = mask[0] >= LV_OPA_MAX ? opa : ((opa * mask[0]) >> 8); + lv_color_t last_res_color = blend_fp(last_src_color, last_dest_color, last_opa); + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + if(mask[x] == 0) continue; + lv_opa_t opa_tmp = mask[x] >= LV_OPA_MAX ? opa : ((opa * mask[x]) >> 8); + if(last_src_color.full != src_buf[x].full || last_dest_color.full != dest_buf[x].full || last_opa != opa_tmp) { + last_dest_color = dest_buf[x]; + last_src_color = src_buf[x]; + last_opa = opa_tmp; + last_res_color = blend_fp(last_src_color, last_dest_color, last_opa); + } + dest_buf[x] = last_res_color; + } + dest_buf += dest_stride; + src_buf += src_stride; + mask += mask_stride; + } + } +} + +static inline lv_color_t color_blend_true_color_additive(lv_color_t fg, lv_color_t bg, lv_opa_t opa) +{ + + if(opa <= LV_OPA_MIN) return bg; + + uint32_t tmp; +#if LV_COLOR_DEPTH == 1 + tmp = bg.full + fg.full; + fg.full = LV_MIN(tmp, 1); +#else + tmp = bg.ch.red + fg.ch.red; +#if LV_COLOR_DEPTH == 8 + fg.ch.red = LV_MIN(tmp, 7); +#elif LV_COLOR_DEPTH == 16 + fg.ch.red = LV_MIN(tmp, 31); +#elif LV_COLOR_DEPTH == 32 + fg.ch.red = LV_MIN(tmp, 255); +#endif + +#if LV_COLOR_DEPTH == 8 + tmp = bg.ch.green + fg.ch.green; + fg.ch.green = LV_MIN(tmp, 7); +#elif LV_COLOR_DEPTH == 16 +#if LV_COLOR_16_SWAP == 0 + tmp = bg.ch.green + fg.ch.green; + fg.ch.green = LV_MIN(tmp, 63); +#else + tmp = (bg.ch.green_h << 3) + bg.ch.green_l + (fg.ch.green_h << 3) + fg.ch.green_l; + tmp = LV_MIN(tmp, 63); + fg.ch.green_h = tmp >> 3; + fg.ch.green_l = tmp & 0x7; +#endif + +#elif LV_COLOR_DEPTH == 32 + tmp = bg.ch.green + fg.ch.green; + fg.ch.green = LV_MIN(tmp, 255); +#endif + + tmp = bg.ch.blue + fg.ch.blue; +#if LV_COLOR_DEPTH == 8 + fg.ch.blue = LV_MIN(tmp, 4); +#elif LV_COLOR_DEPTH == 16 + fg.ch.blue = LV_MIN(tmp, 31); +#elif LV_COLOR_DEPTH == 32 + fg.ch.blue = LV_MIN(tmp, 255); +#endif +#endif + + if(opa == LV_OPA_COVER) return fg; + + return lv_color_mix(fg, bg, opa); +} + +static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_color_t bg, lv_opa_t opa) +{ + if(opa <= LV_OPA_MIN) return bg; + + int32_t tmp; + tmp = bg.ch.red - fg.ch.red; + fg.ch.red = LV_MAX(tmp, 0); + +#if LV_COLOR_16_SWAP == 0 + tmp = bg.ch.green - fg.ch.green; + fg.ch.green = LV_MAX(tmp, 0); +#else + tmp = (bg.ch.green_h << 3) + bg.ch.green_l + (fg.ch.green_h << 3) + fg.ch.green_l; + tmp = LV_MAX(tmp, 0); + fg.ch.green_h = tmp >> 3; + fg.ch.green_l = tmp & 0x7; +#endif + + tmp = bg.ch.blue - fg.ch.blue; + fg.ch.blue = LV_MAX(tmp, 0); + + if(opa == LV_OPA_COVER) return fg; + + return lv_color_mix(fg, bg, opa); +} + +static inline lv_color_t color_blend_true_color_multiply(lv_color_t fg, lv_color_t bg, lv_opa_t opa) +{ + if(opa <= LV_OPA_MIN) return bg; + +#if LV_COLOR_DEPTH == 32 + fg.ch.red = (fg.ch.red * bg.ch.red) >> 8; + fg.ch.green = (fg.ch.green * bg.ch.green) >> 8; + fg.ch.blue = (fg.ch.blue * bg.ch.blue) >> 8; +#elif LV_COLOR_DEPTH == 16 + fg.ch.red = (fg.ch.red * bg.ch.red) >> 5; + fg.ch.blue = (fg.ch.blue * bg.ch.blue) >> 5; + LV_COLOR_SET_G(fg, (LV_COLOR_GET_G(fg) * LV_COLOR_GET_G(bg)) >> 6); +#elif LV_COLOR_DEPTH == 8 + fg.ch.red = (fg.ch.red * bg.ch.red) >> 3; + fg.ch.green = (fg.ch.green * bg.ch.green) >> 3; + fg.ch.blue = (fg.ch.blue * bg.ch.blue) >> 2; +#endif + + if(opa == LV_OPA_COVER) return fg; + + return lv_color_mix(fg, bg, opa); +} + +#endif + diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_blend.h b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_blend.h new file mode 100644 index 0000000..3158d98 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_blend.h @@ -0,0 +1,70 @@ +/** + * @file lv_draw_sw_blend.h + * + */ + +#ifndef LV_DRAW_SW_BLEND_H +#define LV_DRAW_SW_BLEND_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../misc/lv_color.h" +#include "../../misc/lv_area.h" +#include "../../misc/lv_style.h" +#include "../lv_draw_mask.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + const lv_area_t * blend_area; /**< The area with absolute coordinates to draw on `draw_ctx->buf` + * will be clipped to `draw_ctx->clip_area` */ + const lv_color_t * src_buf; /**< Pointer to an image to blend. If set `fill_color` is ignored */ + lv_color_t color; /**< Fill color*/ + lv_opa_t * mask_buf; /**< NULL if ignored, or an alpha mask to apply on `blend_area`*/ + lv_draw_mask_res_t mask_res; /**< The result of the previous mask operation */ + const lv_area_t * mask_area; /**< The area of `mask_buf` with absolute coordinates*/ + lv_opa_t opa; /**< The overall opacity*/ + lv_blend_mode_t blend_mode; /**< E.g. LV_BLEND_MODE_ADDITIVE*/ +} lv_draw_sw_blend_dsc_t; + +struct _lv_draw_ctx_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Call the blend function of the `draw_ctx`. + * @param draw_ctx pointer to a draw context + * @param dsc pointer to an initialized blend descriptor + */ +void lv_draw_sw_blend(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc); + +/** + * The basic blend function used with software rendering. + * @param draw_ctx pointer to a draw context + * @param dsc pointer to an initialized blend descriptor + */ +void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_basic(struct _lv_draw_ctx_t * draw_ctx, + const lv_draw_sw_blend_dsc_t * dsc); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_SW_BLEND_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_border.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_border.c deleted file mode 100644 index 07eb18c..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_border.c +++ /dev/null @@ -1,336 +0,0 @@ -/** - * @file lv_draw_sw_border.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../misc/lv_area_private.h" -#include "lv_draw_sw_mask_private.h" -#include "../lv_draw_private.h" -#include "../lv_draw_private.h" -#include "lv_draw_sw.h" -#if LV_USE_DRAW_SW - -#include "blend/lv_draw_sw_blend_private.h" -#include "../../misc/lv_math.h" -#include "../../misc/lv_text_ap.h" -#include "../../core/lv_refr.h" -#include "../../misc/lv_assert.h" -#include "../../stdlib/lv_string.h" -#include "../lv_draw_mask.h" - -/********************* - * DEFINES - *********************/ -#define SPLIT_LIMIT 50 - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void draw_border_complex(lv_draw_unit_t * draw_unit, const lv_area_t * outer_area, const lv_area_t * inner_area, - int32_t rout, int32_t rin, lv_color_t color, lv_opa_t opa); - -static void draw_border_simple(lv_draw_unit_t * draw_unit, const lv_area_t * outer_area, const lv_area_t * inner_area, - lv_color_t color, lv_opa_t opa); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_sw_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc_t * dsc, const lv_area_t * coords) -{ - if(dsc->opa <= LV_OPA_MIN) return; - if(dsc->width == 0) return; - if(dsc->side == LV_BORDER_SIDE_NONE) return; - - int32_t coords_w = lv_area_get_width(coords); - int32_t coords_h = lv_area_get_height(coords); - int32_t rout = dsc->radius; - int32_t short_side = LV_MIN(coords_w, coords_h); - if(rout > short_side >> 1) rout = short_side >> 1; - - /*Get the inner area*/ - lv_area_t area_inner; - lv_area_copy(&area_inner, coords); - area_inner.x1 += ((dsc->side & LV_BORDER_SIDE_LEFT) ? dsc->width : - (dsc->width + rout)); - area_inner.x2 -= ((dsc->side & LV_BORDER_SIDE_RIGHT) ? dsc->width : - (dsc->width + rout)); - area_inner.y1 += ((dsc->side & LV_BORDER_SIDE_TOP) ? dsc->width : - (dsc->width + rout)); - area_inner.y2 -= ((dsc->side & LV_BORDER_SIDE_BOTTOM) ? dsc->width : - (dsc->width + rout)); - - int32_t rin = rout - dsc->width; - if(rin < 0) rin = 0; - - if(rout == 0 && rin == 0) { - draw_border_simple(draw_unit, coords, &area_inner, dsc->color, dsc->opa); - } - else { - draw_border_complex(draw_unit, coords, &area_inner, rout, rin, dsc->color, dsc->opa); - } - -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -void draw_border_complex(lv_draw_unit_t * draw_unit, const lv_area_t * outer_area, const lv_area_t * inner_area, - int32_t rout, int32_t rin, lv_color_t color, lv_opa_t opa) -{ -#if LV_DRAW_SW_COMPLEX - /*Get clipped draw area which is the real draw area. - *It is always the same or inside `coords`*/ - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, outer_area, draw_unit->clip_area)) return; - int32_t draw_area_w = lv_area_get_width(&draw_area); - - lv_draw_sw_blend_dsc_t blend_dsc; - lv_memzero(&blend_dsc, sizeof(blend_dsc)); - lv_opa_t * mask_buf = lv_malloc(draw_area_w); - blend_dsc.mask_buf = mask_buf; - - void * mask_list[3] = {0}; - - /*Create mask for the inner mask*/ - lv_draw_sw_mask_radius_param_t mask_rin_param; - lv_draw_sw_mask_radius_init(&mask_rin_param, inner_area, rin, true); - mask_list[0] = &mask_rin_param; - - /*Create mask for the outer area*/ - lv_draw_sw_mask_radius_param_t mask_rout_param; - if(rout > 0) { - lv_draw_sw_mask_radius_init(&mask_rout_param, outer_area, rout, false); - mask_list[1] = &mask_rout_param; - } - - int32_t h; - lv_area_t blend_area; - blend_dsc.blend_area = &blend_area; - blend_dsc.mask_area = &blend_area; - blend_dsc.color = color; - blend_dsc.opa = opa; - - /*Calculate the x and y coordinates where the straight parts area is*/ - lv_area_t core_area; - core_area.x1 = LV_MAX(outer_area->x1 + rout, inner_area->x1); - core_area.x2 = LV_MIN(outer_area->x2 - rout, inner_area->x2); - core_area.y1 = LV_MAX(outer_area->y1 + rout, inner_area->y1); - core_area.y2 = LV_MIN(outer_area->y2 - rout, inner_area->y2); - int32_t core_w = lv_area_get_width(&core_area); - - bool top_side = outer_area->y1 <= inner_area->y1; - bool bottom_side = outer_area->y2 >= inner_area->y2; - - /*No masks*/ - bool left_side = outer_area->x1 <= inner_area->x1; - bool right_side = outer_area->x2 >= inner_area->x2; - - bool split_hor = true; - if(left_side && right_side && top_side && bottom_side && - core_w < SPLIT_LIMIT) { - split_hor = false; - } - - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_FULL_COVER; - /*Draw the straight lines first if they are long enough*/ - if(top_side && split_hor) { - blend_area.x1 = core_area.x1; - blend_area.x2 = core_area.x2; - blend_area.y1 = outer_area->y1; - blend_area.y2 = inner_area->y1 - 1; - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - - if(bottom_side && split_hor) { - blend_area.x1 = core_area.x1; - blend_area.x2 = core_area.x2; - blend_area.y1 = inner_area->y2 + 1; - blend_area.y2 = outer_area->y2; - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - - /*If the border is very thick and the vertical sides overlap horizontally draw a single rectangle*/ - if(inner_area->x1 >= inner_area->x2 && left_side && right_side) { - blend_area.x1 = outer_area->x1; - blend_area.x2 = outer_area->x2; - blend_area.y1 = core_area.y1; - blend_area.y2 = core_area.y2; - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - else { - if(left_side) { - blend_area.x1 = outer_area->x1; - blend_area.x2 = inner_area->x1 - 1; - blend_area.y1 = core_area.y1; - blend_area.y2 = core_area.y2; - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - - if(right_side) { - blend_area.x1 = inner_area->x2 + 1; - blend_area.x2 = outer_area->x2; - blend_area.y1 = core_area.y1; - blend_area.y2 = core_area.y2; - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - } - - /*Draw the corners*/ - int32_t blend_w; - - /*Left and right corner together if they are close to each other*/ - if(!split_hor) { - /*Calculate the top corner and mirror it to the bottom*/ - blend_area.x1 = draw_area.x1; - blend_area.x2 = draw_area.x2; - int32_t max_h = LV_MAX(rout, inner_area->y1 - outer_area->y1); - for(h = 0; h < max_h; h++) { - int32_t top_y = outer_area->y1 + h; - int32_t bottom_y = outer_area->y2 - h; - if(top_y < draw_area.y1 && bottom_y > draw_area.y2) continue; /*This line is clipped now*/ - - lv_memset(mask_buf, 0xff, draw_area_w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(mask_list, mask_buf, blend_area.x1, top_y, draw_area_w); - - if(top_y >= draw_area.y1) { - blend_area.y1 = top_y; - blend_area.y2 = top_y; - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - - if(bottom_y <= draw_area.y2) { - blend_area.y1 = bottom_y; - blend_area.y2 = bottom_y; - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - } - } - else { - /*Left corners*/ - blend_area.x1 = draw_area.x1; - blend_area.x2 = LV_MIN(draw_area.x2, core_area.x1 - 1); - blend_w = lv_area_get_width(&blend_area); - if(blend_w > 0) { - if(left_side || top_side) { - for(h = draw_area.y1; h < core_area.y1; h++) { - blend_area.y1 = h; - blend_area.y2 = h; - - lv_memset(mask_buf, 0xff, blend_w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(mask_list, mask_buf, blend_area.x1, h, blend_w); - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - } - - if(left_side || bottom_side) { - for(h = core_area.y2 + 1; h <= draw_area.y2; h++) { - blend_area.y1 = h; - blend_area.y2 = h; - - lv_memset(mask_buf, 0xff, blend_w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(mask_list, mask_buf, blend_area.x1, h, blend_w); - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - } - } - - /*Right corners*/ - blend_area.x1 = LV_MAX(draw_area.x1, blend_area.x2 + 1); /*To not overlap with the left side*/ - blend_area.x1 = LV_MAX(draw_area.x1, core_area.x2 + 1); - - blend_area.x2 = draw_area.x2; - blend_w = lv_area_get_width(&blend_area); - - if(blend_w > 0) { - if(right_side || top_side) { - for(h = draw_area.y1; h < core_area.y1; h++) { - blend_area.y1 = h; - blend_area.y2 = h; - - lv_memset(mask_buf, 0xff, blend_w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(mask_list, mask_buf, blend_area.x1, h, blend_w); - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - } - - if(right_side || bottom_side) { - for(h = core_area.y2 + 1; h <= draw_area.y2; h++) { - blend_area.y1 = h; - blend_area.y2 = h; - - lv_memset(mask_buf, 0xff, blend_w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(mask_list, mask_buf, blend_area.x1, h, blend_w); - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - } - } - } - - lv_draw_sw_mask_free_param(&mask_rin_param); - if(rout > 0) lv_draw_sw_mask_free_param(&mask_rout_param); - lv_free(mask_buf); - -#endif /*LV_DRAW_SW_COMPLEX*/ -} -static void draw_border_simple(lv_draw_unit_t * draw_unit, const lv_area_t * outer_area, const lv_area_t * inner_area, - lv_color_t color, lv_opa_t opa) -{ - lv_area_t a; - lv_draw_sw_blend_dsc_t blend_dsc; - lv_memzero(&blend_dsc, sizeof(lv_draw_sw_blend_dsc_t)); - blend_dsc.blend_area = &a; - blend_dsc.color = color; - blend_dsc.opa = opa; - - bool top_side = outer_area->y1 <= inner_area->y1; - bool bottom_side = outer_area->y2 >= inner_area->y2; - bool left_side = outer_area->x1 <= inner_area->x1; - bool right_side = outer_area->x2 >= inner_area->x2; - - /*Top*/ - a.x1 = outer_area->x1; - a.x2 = outer_area->x2; - a.y1 = outer_area->y1; - a.y2 = inner_area->y1 - 1; - if(top_side) { - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - - /*Bottom*/ - a.y1 = inner_area->y2 + 1; - a.y2 = outer_area->y2; - if(bottom_side) { - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - - /*Left*/ - a.x1 = outer_area->x1; - a.x2 = inner_area->x1 - 1; - a.y1 = (top_side) ? inner_area->y1 : outer_area->y1; - a.y2 = (bottom_side) ? inner_area->y2 : outer_area->y2; - if(left_side) { - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - - /*Right*/ - a.x1 = inner_area->x2 + 1; - a.x2 = outer_area->x2; - if(right_side) { - lv_draw_sw_blend(draw_unit, &blend_dsc); - } -} - -#endif /*LV_USE_DRAW_SW*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_box_shadow.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_box_shadow.c deleted file mode 100644 index f802875..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_box_shadow.c +++ /dev/null @@ -1,743 +0,0 @@ -/** - * @file lv_draw_sw_box_shadow.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../misc/lv_area_private.h" -#include "lv_draw_sw_mask_private.h" -#include "../lv_draw_private.h" -#include "lv_draw_sw.h" -#if LV_USE_DRAW_SW - -#if LV_DRAW_SW_COMPLEX - -#include "blend/lv_draw_sw_blend_private.h" -#include "../../core/lv_global.h" -#include "../../misc/lv_math.h" -#include "../../core/lv_refr.h" -#include "../../misc/lv_assert.h" -#include "../../stdlib/lv_string.h" -#include "../lv_draw_mask.h" - -/********************* - * DEFINES - *********************/ -#define SHADOW_UPSCALE_SHIFT 6 -#define SHADOW_ENHANCE 1 - -#if defined(LV_DRAW_SW_SHADOW_CACHE_SIZE) && LV_DRAW_SW_SHADOW_CACHE_SIZE > 0 - #define shadow_cache LV_GLOBAL_DEFAULT()->sw_shadow_cache -#endif - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void /* LV_ATTRIBUTE_FAST_MEM */ shadow_draw_corner_buf(const lv_area_t * coords, uint16_t * sh_buf, int32_t s, - int32_t r); -static void /* LV_ATTRIBUTE_FAST_MEM */ shadow_blur_corner(int32_t size, int32_t sw, uint16_t * sh_ups_buf); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_sw_box_shadow(lv_draw_unit_t * draw_unit, const lv_draw_box_shadow_dsc_t * dsc, const lv_area_t * coords) -{ - /*Calculate the rectangle which is blurred to get the shadow in `shadow_area`*/ - lv_area_t core_area; - core_area.x1 = coords->x1 + dsc->ofs_x - dsc->spread; - core_area.x2 = coords->x2 + dsc->ofs_x + dsc->spread; - core_area.y1 = coords->y1 + dsc->ofs_y - dsc->spread; - core_area.y2 = coords->y2 + dsc->ofs_y + dsc->spread; - - /*Calculate the bounding box of the shadow*/ - lv_area_t shadow_area; - shadow_area.x1 = core_area.x1 - dsc->width / 2 - 1; - shadow_area.x2 = core_area.x2 + dsc->width / 2 + 1; - shadow_area.y1 = core_area.y1 - dsc->width / 2 - 1; - shadow_area.y2 = core_area.y2 + dsc->width / 2 + 1; - - lv_opa_t opa = dsc->opa; - if(opa > LV_OPA_MAX) opa = LV_OPA_COVER; - - /*Get clipped draw area which is the real draw area. - *It is always the same or inside `shadow_area`*/ - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, &shadow_area, draw_unit->clip_area)) return; - - /*Consider 1 px smaller bg to be sure the edge will be covered by the shadow*/ - lv_area_t bg_area; - lv_area_copy(&bg_area, coords); - lv_area_increase(&bg_area, -1, -1); - - /*Get the clamped radius*/ - int32_t r_bg = dsc->radius; - int32_t short_side = LV_MIN(lv_area_get_width(&bg_area), lv_area_get_height(&bg_area)); - if(r_bg > short_side >> 1) r_bg = short_side >> 1; - - /*Get the clamped radius*/ - int32_t r_sh = dsc->radius; - short_side = LV_MIN(lv_area_get_width(&core_area), lv_area_get_height(&core_area)); - if(r_sh > short_side >> 1) r_sh = short_side >> 1; - - /*Get how many pixels are affected by the blur on the corners*/ - int32_t corner_size = dsc->width + r_sh; - - lv_opa_t * sh_buf; - -#if LV_DRAW_SW_SHADOW_CACHE_SIZE - lv_draw_sw_shadow_cache_t * cache = &shadow_cache; - if(cache->cache_size == corner_size && cache->cache_r == r_sh) { - /*Use the cache if available*/ - sh_buf = lv_malloc(corner_size * corner_size); - lv_memcpy(sh_buf, cache->cache, corner_size * corner_size); - } - else { - /*A larger buffer is required for calculation*/ - sh_buf = lv_malloc(corner_size * corner_size * sizeof(uint16_t)); - shadow_draw_corner_buf(&core_area, (uint16_t *)sh_buf, dsc->width, r_sh); - - /*Cache the corner if it fits into the cache size*/ - if((uint32_t)corner_size * corner_size < sizeof(cache->cache)) { - lv_memcpy(cache->cache, sh_buf, corner_size * corner_size); - cache->cache_size = corner_size; - cache->cache_r = r_sh; - } - } -#else - sh_buf = lv_malloc(corner_size * corner_size * sizeof(uint16_t)); - shadow_draw_corner_buf(&core_area, (uint16_t *)sh_buf, dsc->width, r_sh); -#endif /*LV_DRAW_SW_SHADOW_CACHE_SIZE*/ - - /*Skip a lot of masking if the background will cover the shadow that would be masked out*/ - bool simple = dsc->bg_cover; - - /*Create a radius mask to clip remove shadow on the bg area*/ - - lv_draw_sw_mask_radius_param_t mask_rout_param; - void * masks[2] = {0}; - if(!simple) { - lv_draw_sw_mask_radius_init(&mask_rout_param, &bg_area, r_bg, true); - masks[0] = &mask_rout_param; - } - - lv_opa_t * mask_buf = lv_malloc(lv_area_get_width(&shadow_area)); - lv_area_t blend_area; - lv_area_t clip_area_sub; - lv_opa_t * sh_buf_tmp; - int32_t y; - bool simple_sub; - - lv_draw_sw_blend_dsc_t blend_dsc; - lv_memzero(&blend_dsc, sizeof(blend_dsc)); - blend_dsc.blend_area = &blend_area; - blend_dsc.mask_area = &blend_area; - blend_dsc.mask_buf = mask_buf; - blend_dsc.color = dsc->color; - blend_dsc.opa = dsc->opa; - - int32_t w_half = shadow_area.x1 + lv_area_get_width(&shadow_area) / 2; - int32_t h_half = shadow_area.y1 + lv_area_get_height(&shadow_area) / 2; - - /*Draw the corners if they are on the current clip area and not fully covered by the bg*/ - - /*Top right corner*/ - blend_area.x2 = shadow_area.x2; - blend_area.x1 = shadow_area.x2 - corner_size + 1; - blend_area.y1 = shadow_area.y1; - blend_area.y2 = shadow_area.y1 + corner_size - 1; - /*Do not overdraw the other top corners*/ - blend_area.x1 = LV_MAX(blend_area.x1, w_half); - blend_area.y2 = LV_MIN(blend_area.y2, h_half); - - if(lv_area_intersect(&clip_area_sub, &blend_area, draw_unit->clip_area) && - !lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { - int32_t w = lv_area_get_width(&clip_area_sub); - sh_buf_tmp = sh_buf; - sh_buf_tmp += (clip_area_sub.y1 - shadow_area.y1) * corner_size; - sh_buf_tmp += clip_area_sub.x1 - (shadow_area.x2 - corner_size + 1); - - /*Do not mask if out of the bg*/ - if(simple && lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; - else simple_sub = simple; - if(w > 0) { - blend_dsc.mask_buf = mask_buf; - blend_area.x1 = clip_area_sub.x1; - blend_area.x2 = clip_area_sub.x2; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ - for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { - blend_area.y1 = y; - blend_area.y2 = y; - - if(!simple_sub) { - lv_memcpy(mask_buf, sh_buf_tmp, corner_size); - blend_dsc.mask_res = lv_draw_sw_mask_apply(masks, mask_buf, clip_area_sub.x1, y, w); - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - else { - blend_dsc.mask_buf = sh_buf_tmp; - } - lv_draw_sw_blend(draw_unit, &blend_dsc); - sh_buf_tmp += corner_size; - } - } - } - - /*Bottom right corner. - *Almost the same as top right just read the lines of `sh_buf` from then end*/ - blend_area.x2 = shadow_area.x2; - blend_area.x1 = shadow_area.x2 - corner_size + 1; - blend_area.y1 = shadow_area.y2 - corner_size + 1; - blend_area.y2 = shadow_area.y2; - /*Do not overdraw the other corners*/ - blend_area.x1 = LV_MAX(blend_area.x1, w_half); - blend_area.y1 = LV_MAX(blend_area.y1, h_half + 1); - - if(lv_area_intersect(&clip_area_sub, &blend_area, draw_unit->clip_area) && - !lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { - int32_t w = lv_area_get_width(&clip_area_sub); - sh_buf_tmp = sh_buf; - sh_buf_tmp += (blend_area.y2 - clip_area_sub.y2) * corner_size; - sh_buf_tmp += clip_area_sub.x1 - (shadow_area.x2 - corner_size + 1); - /*Do not mask if out of the bg*/ - if(simple && lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; - else simple_sub = simple; - - if(w > 0) { - blend_dsc.mask_buf = mask_buf; - blend_area.x1 = clip_area_sub.x1; - blend_area.x2 = clip_area_sub.x2; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ - for(y = clip_area_sub.y2; y >= clip_area_sub.y1; y--) { - blend_area.y1 = y; - blend_area.y2 = y; - - if(!simple_sub) { - lv_memcpy(mask_buf, sh_buf_tmp, corner_size); - blend_dsc.mask_res = lv_draw_sw_mask_apply(masks, mask_buf, clip_area_sub.x1, y, w); - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - else { - blend_dsc.mask_buf = sh_buf_tmp; - } - lv_draw_sw_blend(draw_unit, &blend_dsc); - sh_buf_tmp += corner_size; - } - } - } - - /*Top side*/ - blend_area.x1 = shadow_area.x1 + corner_size; - blend_area.x2 = shadow_area.x2 - corner_size; - blend_area.y1 = shadow_area.y1; - blend_area.y2 = shadow_area.y1 + corner_size - 1; - blend_area.y2 = LV_MIN(blend_area.y2, h_half); - - if(lv_area_intersect(&clip_area_sub, &blend_area, draw_unit->clip_area) && - !lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { - int32_t w = lv_area_get_width(&clip_area_sub); - sh_buf_tmp = sh_buf; - sh_buf_tmp += (clip_area_sub.y1 - blend_area.y1) * corner_size; - - /*Do not mask if out of the bg*/ - if(simple && lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; - else simple_sub = simple; - - if(w > 0) { - if(!simple_sub) { - blend_dsc.mask_buf = mask_buf; - } - else { - blend_dsc.mask_buf = NULL; - } - blend_area.x1 = clip_area_sub.x1; - blend_area.x2 = clip_area_sub.x2; - - for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { - blend_area.y1 = y; - blend_area.y2 = y; - - if(!simple_sub) { - lv_memset(mask_buf, sh_buf_tmp[0], w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(masks, mask_buf, clip_area_sub.x1, y, w); - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - else { - blend_dsc.opa = opa == LV_OPA_COVER ? sh_buf_tmp[0] : LV_OPA_MIX2(sh_buf_tmp[0], dsc->opa); - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - sh_buf_tmp += corner_size; - } - } - } - blend_dsc.opa = dsc->opa; /*Restore*/ - - /*Bottom side*/ - blend_area.x1 = shadow_area.x1 + corner_size; - blend_area.x2 = shadow_area.x2 - corner_size; - blend_area.y1 = shadow_area.y2 - corner_size + 1; - blend_area.y2 = shadow_area.y2; - blend_area.y1 = LV_MAX(blend_area.y1, h_half + 1); - - if(lv_area_intersect(&clip_area_sub, &blend_area, draw_unit->clip_area) && - !lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { - int32_t w = lv_area_get_width(&clip_area_sub); - sh_buf_tmp = sh_buf; - sh_buf_tmp += (blend_area.y2 - clip_area_sub.y2) * corner_size; - if(w > 0) { - /*Do not mask if out of the bg*/ - if(simple && lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; - else simple_sub = simple; - - if(!simple_sub) { - blend_dsc.mask_buf = mask_buf; - } - else { - blend_dsc.mask_buf = NULL; - } - blend_area.x1 = clip_area_sub.x1; - blend_area.x2 = clip_area_sub.x2; - - for(y = clip_area_sub.y2; y >= clip_area_sub.y1; y--) { - blend_area.y1 = y; - blend_area.y2 = y; - - /*Do not mask if out of the bg*/ - if(simple && lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; - else simple_sub = simple; - - if(!simple_sub) { - lv_memset(mask_buf, sh_buf_tmp[0], w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(masks, mask_buf, clip_area_sub.x1, y, w); - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - else { - blend_dsc.opa = opa == LV_OPA_COVER ? sh_buf_tmp[0] : (sh_buf_tmp[0] * dsc->opa) >> 8; - lv_draw_sw_blend(draw_unit, &blend_dsc); - - } - sh_buf_tmp += corner_size; - } - } - } - - blend_dsc.opa = dsc->opa; /*Restore*/ - - /*Right side*/ - blend_area.x1 = shadow_area.x2 - corner_size + 1; - blend_area.x2 = shadow_area.x2; - blend_area.y1 = shadow_area.y1 + corner_size; - blend_area.y2 = shadow_area.y2 - corner_size; - /*Do not overdraw the other corners*/ - blend_area.y1 = LV_MIN(blend_area.y1, h_half + 1); - blend_area.y2 = LV_MAX(blend_area.y2, h_half); - blend_area.x1 = LV_MAX(blend_area.x1, w_half); - - if(lv_area_intersect(&clip_area_sub, &blend_area, draw_unit->clip_area) && - !lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { - int32_t w = lv_area_get_width(&clip_area_sub); - sh_buf_tmp = sh_buf; - sh_buf_tmp += (corner_size - 1) * corner_size; - sh_buf_tmp += clip_area_sub.x1 - (shadow_area.x2 - corner_size + 1); - - /*Do not mask if out of the bg*/ - if(simple && lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; - else simple_sub = simple; - blend_dsc.mask_buf = simple_sub ? sh_buf_tmp : mask_buf; - - if(w > 0) { - blend_area.x1 = clip_area_sub.x1; - blend_area.x2 = clip_area_sub.x2; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ - for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { - blend_area.y1 = y; - blend_area.y2 = y; - - if(!simple_sub) { - lv_memcpy(mask_buf, sh_buf_tmp, w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(masks, mask_buf, clip_area_sub.x1, y, w); - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - } - } - - /*Mirror the shadow corner buffer horizontally*/ - sh_buf_tmp = sh_buf ; - for(y = 0; y < corner_size; y++) { - int32_t x; - lv_opa_t * start = sh_buf_tmp; - lv_opa_t * end = sh_buf_tmp + corner_size - 1; - for(x = 0; x < corner_size / 2; x++) { - lv_opa_t tmp = *start; - *start = *end; - *end = tmp; - - start++; - end--; - } - sh_buf_tmp += corner_size; - } - - /*Left side*/ - blend_area.x1 = shadow_area.x1; - blend_area.x2 = shadow_area.x1 + corner_size - 1; - blend_area.y1 = shadow_area.y1 + corner_size; - blend_area.y2 = shadow_area.y2 - corner_size; - /*Do not overdraw the other corners*/ - blend_area.y1 = LV_MIN(blend_area.y1, h_half + 1); - blend_area.y2 = LV_MAX(blend_area.y2, h_half); - blend_area.x2 = LV_MIN(blend_area.x2, w_half - 1); - - if(lv_area_intersect(&clip_area_sub, &blend_area, draw_unit->clip_area) && - !lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { - int32_t w = lv_area_get_width(&clip_area_sub); - sh_buf_tmp = sh_buf; - sh_buf_tmp += (corner_size - 1) * corner_size; - sh_buf_tmp += clip_area_sub.x1 - blend_area.x1; - - /*Do not mask if out of the bg*/ - if(simple && lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; - else simple_sub = simple; - blend_dsc.mask_buf = simple_sub ? sh_buf_tmp : mask_buf; - if(w > 0) { - blend_area.x1 = clip_area_sub.x1; - blend_area.x2 = clip_area_sub.x2; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ - for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { - blend_area.y1 = y; - blend_area.y2 = y; - - if(!simple_sub) { - lv_memcpy(mask_buf, sh_buf_tmp, w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(masks, mask_buf, clip_area_sub.x1, y, w); - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - } - } - - /*Top left corner*/ - blend_area.x1 = shadow_area.x1; - blend_area.x2 = shadow_area.x1 + corner_size - 1; - blend_area.y1 = shadow_area.y1; - blend_area.y2 = shadow_area.y1 + corner_size - 1; - /*Do not overdraw the other corners*/ - blend_area.x2 = LV_MIN(blend_area.x2, w_half - 1); - blend_area.y2 = LV_MIN(blend_area.y2, h_half); - - if(lv_area_intersect(&clip_area_sub, &blend_area, draw_unit->clip_area) && - !lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { - int32_t w = lv_area_get_width(&clip_area_sub); - sh_buf_tmp = sh_buf; - sh_buf_tmp += (clip_area_sub.y1 - blend_area.y1) * corner_size; - sh_buf_tmp += clip_area_sub.x1 - blend_area.x1; - - /*Do not mask if out of the bg*/ - if(simple && lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; - else simple_sub = simple; - blend_dsc.mask_buf = mask_buf; - - if(w > 0) { - blend_area.x1 = clip_area_sub.x1; - blend_area.x2 = clip_area_sub.x2; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ - for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { - blend_area.y1 = y; - blend_area.y2 = y; - - if(!simple_sub) { - lv_memcpy(mask_buf, sh_buf_tmp, corner_size); - blend_dsc.mask_res = lv_draw_sw_mask_apply(masks, mask_buf, clip_area_sub.x1, y, w); - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - else { - blend_dsc.mask_buf = sh_buf_tmp; - } - - lv_draw_sw_blend(draw_unit, &blend_dsc); - sh_buf_tmp += corner_size; - } - } - } - - /*Bottom left corner. - *Almost the same as bottom right just read the lines of `sh_buf` from then end*/ - blend_area.x1 = shadow_area.x1 ; - blend_area.x2 = shadow_area.x1 + corner_size - 1; - blend_area.y1 = shadow_area.y2 - corner_size + 1; - blend_area.y2 = shadow_area.y2; - /*Do not overdraw the other corners*/ - blend_area.y1 = LV_MAX(blend_area.y1, h_half + 1); - blend_area.x2 = LV_MIN(blend_area.x2, w_half - 1); - - if(lv_area_intersect(&clip_area_sub, &blend_area, draw_unit->clip_area) && - !lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { - int32_t w = lv_area_get_width(&clip_area_sub); - sh_buf_tmp = sh_buf; - sh_buf_tmp += (blend_area.y2 - clip_area_sub.y2) * corner_size; - sh_buf_tmp += clip_area_sub.x1 - blend_area.x1; - - /*Do not mask if out of the bg*/ - if(simple && lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; - else simple_sub = simple; - blend_dsc.mask_buf = mask_buf; - if(w > 0) { - blend_area.x1 = clip_area_sub.x1; - blend_area.x2 = clip_area_sub.x2; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ - for(y = clip_area_sub.y2; y >= clip_area_sub.y1; y--) { - blend_area.y1 = y; - blend_area.y2 = y; - - if(!simple_sub) { - lv_memcpy(mask_buf, sh_buf_tmp, corner_size); - blend_dsc.mask_res = lv_draw_sw_mask_apply(masks, mask_buf, clip_area_sub.x1, y, w); - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - else { - blend_dsc.mask_buf = sh_buf_tmp; - } - lv_draw_sw_blend(draw_unit, &blend_dsc); - sh_buf_tmp += corner_size; - } - } - } - - /*Draw the center rectangle.*/ - blend_area.x1 = shadow_area.x1 + corner_size ; - blend_area.x2 = shadow_area.x2 - corner_size; - blend_area.y1 = shadow_area.y1 + corner_size; - blend_area.y2 = shadow_area.y2 - corner_size; - blend_area.y1 = LV_MIN(blend_area.y1, h_half + 1); - blend_area.y2 = LV_MAX(blend_area.y2, h_half); - blend_dsc.mask_buf = mask_buf; - - if(lv_area_intersect(&clip_area_sub, &blend_area, draw_unit->clip_area) && - !lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { - int32_t w = lv_area_get_width(&clip_area_sub); - if(w > 0) { - blend_area.x1 = clip_area_sub.x1; - blend_area.x2 = clip_area_sub.x2; - for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { - blend_area.y1 = y; - blend_area.y2 = y; - - lv_memset(mask_buf, 0xff, w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(masks, mask_buf, clip_area_sub.x1, y, w); - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - } - } - - if(!simple) { - lv_draw_sw_mask_free_param(&mask_rout_param); - } - lv_free(sh_buf); - lv_free(mask_buf); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Calculate a blurred corner - * @param coords Coordinates of the shadow - * @param sh_buf a buffer to store the result. Its size should be `(sw + r)^2 * 2` - * @param sw shadow width - * @param r radius - */ -static void LV_ATTRIBUTE_FAST_MEM shadow_draw_corner_buf(const lv_area_t * coords, uint16_t * sh_buf, int32_t sw, - int32_t r) -{ - int32_t sw_ori = sw; - int32_t size = sw_ori + r; - - lv_area_t sh_area; - lv_area_copy(&sh_area, coords); - sh_area.x2 = sw / 2 + r - 1 - ((sw & 1) ? 0 : 1); - sh_area.y1 = sw / 2 + 1; - - sh_area.x1 = sh_area.x2 - lv_area_get_width(coords); - sh_area.y2 = sh_area.y1 + lv_area_get_height(coords); - - lv_draw_sw_mask_radius_param_t mask_param; - lv_draw_sw_mask_radius_init(&mask_param, &sh_area, r, false); - -#if SHADOW_ENHANCE - /*Set half shadow width because blur will be repeated*/ - if(sw_ori == 1) sw = 1; - else sw = sw_ori >> 1; -#endif /*SHADOW_ENHANCE*/ - - int32_t y; - lv_opa_t * mask_line = lv_malloc(size); - uint16_t * sh_ups_tmp_buf = (uint16_t *)sh_buf; - for(y = 0; y < size; y++) { - lv_memset(mask_line, 0xff, size); - lv_draw_sw_mask_res_t mask_res = mask_param.dsc.cb(mask_line, 0, y, size, &mask_param); - if(mask_res == LV_DRAW_SW_MASK_RES_TRANSP) { - lv_memzero(sh_ups_tmp_buf, size * sizeof(sh_ups_tmp_buf[0])); - } - else { - int32_t i; - sh_ups_tmp_buf[0] = (mask_line[0] << SHADOW_UPSCALE_SHIFT) / sw; - for(i = 1; i < size; i++) { - if(mask_line[i] == mask_line[i - 1]) sh_ups_tmp_buf[i] = sh_ups_tmp_buf[i - 1]; - else sh_ups_tmp_buf[i] = (mask_line[i] << SHADOW_UPSCALE_SHIFT) / sw; - } - } - - sh_ups_tmp_buf += size; - } - lv_free(mask_line); - - lv_draw_sw_mask_free_param(&mask_param); - - if(sw == 1) { - int32_t i; - lv_opa_t * res_buf = (lv_opa_t *)sh_buf; - for(i = 0; i < size * size; i++) { - res_buf[i] = (sh_buf[i] >> SHADOW_UPSCALE_SHIFT); - } - return; - } - - shadow_blur_corner(size, sw, sh_buf); - -#if SHADOW_ENHANCE == 0 - /*The result is required in lv_opa_t not uint16_t*/ - uint32_t x; - lv_opa_t * res_buf = (lv_opa_t *)sh_buf; - for(x = 0; x < size * size; x++) { - res_buf[x] = sh_buf[x]; - } -#else - sw += sw_ori & 1; - if(sw > 1) { - uint32_t i; - uint32_t max_v_div = (LV_OPA_COVER << SHADOW_UPSCALE_SHIFT) / sw; - for(i = 0; i < (uint32_t)size * size; i++) { - if(sh_buf[i] == 0) continue; - else if(sh_buf[i] == LV_OPA_COVER) sh_buf[i] = max_v_div; - else sh_buf[i] = (sh_buf[i] << SHADOW_UPSCALE_SHIFT) / sw; - } - - shadow_blur_corner(size, sw, sh_buf); - } - int32_t x; - lv_opa_t * res_buf = (lv_opa_t *)sh_buf; - for(x = 0; x < size * size; x++) { - res_buf[x] = (lv_opa_t) sh_buf[x]; - } -#endif - -} - -static void LV_ATTRIBUTE_FAST_MEM shadow_blur_corner(int32_t size, int32_t sw, uint16_t * sh_ups_buf) -{ - int32_t s_left = sw >> 1; - int32_t s_right = (sw >> 1); - if((sw & 1) == 0) s_left--; - - /*Horizontal blur*/ - uint16_t * sh_ups_blur_buf = lv_malloc(size * sizeof(uint16_t)); - - int32_t x; - int32_t y; - - uint16_t * sh_ups_tmp_buf = sh_ups_buf; - - for(y = 0; y < size; y++) { - int32_t v = sh_ups_tmp_buf[size - 1] * sw; - for(x = size - 1; x >= 0; x--) { - sh_ups_blur_buf[x] = v; - - /*Forget the right pixel*/ - uint32_t right_val = 0; - if(x + s_right < size) right_val = sh_ups_tmp_buf[x + s_right]; - v -= right_val; - - /*Add the left pixel*/ - uint32_t left_val; - if(x - s_left - 1 < 0) left_val = sh_ups_tmp_buf[0]; - else left_val = sh_ups_tmp_buf[x - s_left - 1]; - v += left_val; - } - lv_memcpy(sh_ups_tmp_buf, sh_ups_blur_buf, size * sizeof(uint16_t)); - sh_ups_tmp_buf += size; - } - - /*Vertical blur*/ - uint32_t i; - uint32_t max_v = LV_OPA_COVER << SHADOW_UPSCALE_SHIFT; - uint32_t max_v_div = max_v / sw; - for(i = 0; i < (uint32_t)size * size; i++) { - if(sh_ups_buf[i] == 0) continue; - else if(sh_ups_buf[i] == max_v) sh_ups_buf[i] = max_v_div; - else sh_ups_buf[i] = sh_ups_buf[i] / sw; - } - - for(x = 0; x < size; x++) { - sh_ups_tmp_buf = &sh_ups_buf[x]; - int32_t v = sh_ups_tmp_buf[0] * sw; - for(y = 0; y < size ; y++, sh_ups_tmp_buf += size) { - sh_ups_blur_buf[y] = v < 0 ? 0 : (v >> SHADOW_UPSCALE_SHIFT); - - /*Forget the top pixel*/ - uint32_t top_val; - if(y - s_right <= 0) top_val = sh_ups_tmp_buf[0]; - else top_val = sh_ups_buf[(y - s_right) * size + x]; - v -= top_val; - - /*Add the bottom pixel*/ - uint32_t bottom_val; - if(y + s_left + 1 < size) bottom_val = sh_ups_buf[(y + s_left + 1) * size + x]; - else bottom_val = sh_ups_buf[(size - 1) * size + x]; - v += bottom_val; - } - - /*Write back the result into `sh_ups_buf`*/ - sh_ups_tmp_buf = &sh_ups_buf[x]; - for(y = 0; y < size; y++, sh_ups_tmp_buf += size) { - (*sh_ups_tmp_buf) = sh_ups_blur_buf[y]; - } - } - - lv_free(sh_ups_blur_buf); -} - -#else /*LV_DRAW_SW_COMPLEX*/ - -void lv_draw_sw_box_shadow(lv_draw_unit_t * draw_unit, const lv_draw_box_shadow_dsc_t * dsc, const lv_area_t * coords) -{ - LV_UNUSED(draw_unit); - LV_UNUSED(dsc); - LV_UNUSED(coords); - - LV_LOG_WARN("LV_DRAW_SW_COMPLEX needs to be enabled"); -} - -#endif /*LV_DRAW_SW_COMPLEX*/ - -#endif /*LV_DRAW_USE_SW*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_dither.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_dither.c new file mode 100644 index 0000000..68fd2db --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_dither.c @@ -0,0 +1,213 @@ +/** + * @file lv_draw_sw_dither.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_draw_sw_dither.h" +#include "lv_draw_sw_gradient.h" +#include "../../misc/lv_color.h" + +/********************** + * STATIC FUNCTIONS + **********************/ + + +#if _DITHER_GRADIENT + +void LV_ATTRIBUTE_FAST_MEM lv_dither_none(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w) +{ + LV_UNUSED(x); + LV_UNUSED(y); + if(grad == NULL || grad->filled) return; + for(lv_coord_t i = 0; i < w; i++) { + grad->map[i] = lv_color_hex(grad->hmap[i].full); + } + grad->filled = 1; +} + +static const uint8_t dither_ordered_threshold_matrix[8 * 8] = { + 0, 48, 12, 60, 3, 51, 15, 63, + 32, 16, 44, 28, 35, 19, 47, 31, + 8, 56, 4, 52, 11, 59, 7, 55, + 40, 24, 36, 20, 43, 27, 39, 23, + 2, 50, 14, 62, 1, 49, 13, 61, + 34, 18, 46, 30, 33, 17, 45, 29, + 10, 58, 6, 54, 9, 57, 5, 53, + 42, 26, 38, 22, 41, 25, 37, 21 +}; /* Shift by 6 to normalize */ + + +void LV_ATTRIBUTE_FAST_MEM lv_dither_ordered_hor(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w) +{ + LV_UNUSED(x); + /* For vertical dithering, the error is spread on the next column (and not next line). + Since the renderer is scanline based, it's not obvious what could be used to perform the rendering efficiently. + The algorithm below is based on few assumptions: + 1. An error diffusion algorithm (like Floyd Steinberg) here would be hard to implement since it means that a pixel on column n depends on the pixel on row n + 2. Instead an ordered dithering algorithm shift the value a bit, but the influence only spread from the matrix size (used 8x8 here) + 3. It means that a pixel i,j only depends on the value of a pixel i-7, j-7 to i,j and no other one. + Then we compute a complete row of ordered dither and store it in out. */ + + /*The apply the algorithm for this patch*/ + for(lv_coord_t j = 0; j < w; j++) { + int8_t factor = dither_ordered_threshold_matrix[(y & 7) * 8 + ((j) & 7)] - 32; + lv_color32_t tmp = grad->hmap[LV_CLAMP(0, j - 4, grad->size)]; + lv_color32_t t; + t.ch.red = LV_CLAMP(0, tmp.ch.red + factor, 255); + t.ch.green = LV_CLAMP(0, tmp.ch.green + factor, 255); + t.ch.blue = LV_CLAMP(0, tmp.ch.blue + factor, 255); + + grad->map[j] = lv_color_hex(t.full); + } +} + +void LV_ATTRIBUTE_FAST_MEM lv_dither_ordered_ver(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w) +{ + /* For vertical dithering, the error is spread on the next column (and not next line). + Since the renderer is scanline based, it's not obvious what could be used to perform the rendering efficiently. + The algorithm below is based on few assumptions: + 1. An error diffusion algorithm (like Floyd Steinberg) here would be hard to implement since it means that a pixel on column n depends on the pixel on row n + 2. Instead an ordered dithering algorithm shift the value a bit, but the influence only spread from the matrix size (used 8x8 here) + 3. It means that a pixel i,j only depends on the value of a pixel i-7, j-7 to i,j and no other one. + Then we compute a complete row of ordered dither and store it in out. */ + + /*Extract patch for working with, selected pseudo randomly*/ + lv_color32_t tmp = grad->hmap[LV_CLAMP(0, y - 4, grad->size)]; + + /*The apply the algorithm for this patch*/ + for(lv_coord_t j = 0; j < 8; j++) { + int8_t factor = dither_ordered_threshold_matrix[(y & 7) * 8 + ((j + x) & 7)] - 32; + lv_color32_t t; + t.ch.red = LV_CLAMP(0, tmp.ch.red + factor, 255); + t.ch.green = LV_CLAMP(0, tmp.ch.green + factor, 255); + t.ch.blue = LV_CLAMP(0, tmp.ch.blue + factor, 255); + + grad->map[j] = lv_color_hex(t.full); + } + /*Finally fill the line*/ + lv_coord_t j = 8; + for(; j < w - 8; j += 8) { + lv_memcpy(grad->map + j, grad->map, 8 * sizeof(*grad->map)); + } + /* Prevent overwriting */ + for(; j < w; j++) { + grad->map[j] = grad->map[j & 7]; + } +} + +#if LV_DITHER_ERROR_DIFFUSION == 1 +void LV_ATTRIBUTE_FAST_MEM lv_dither_err_diff_hor(lv_grad_t * grad, lv_coord_t xs, lv_coord_t y, lv_coord_t w) +{ + LV_UNUSED(xs); + LV_UNUSED(y); + LV_UNUSED(w); + + /* Implement Floyd Steinberg algorithm, see https://surma.dev/things/ditherpunk/ + Coefs are: x 7 + 3 5 1 + / 16 + Can be implemented as: x (x<<3 - x) + (x<<2 - x) (x<<2+x) x + */ + int coef[4] = {0, 0, 0, 0}; +#define FS_COMPUTE_ERROR(e) { coef[0] = (e<<3) - e; coef[1] = (e<<2) - e; coef[2] = (e<<2) + e; coef[3] = e; } +#define FS_COMPONENTS(A, OP, B, C) A.ch.red = LV_CLAMP(0, A.ch.red OP B.r OP C.r, 255); A.ch.green = LV_CLAMP(0, A.ch.green OP B.g OP C.g, 255); A.ch.blue = LV_CLAMP(0, A.ch.blue OP B.b OP C.b, 255); +#define FS_QUANT_ERROR(e, t, q) { lv_color32_t u; u.full = lv_color_to32(q); e.r = (int8_t)(t.ch.red - u.ch.red); e.g = (int8_t)(t.ch.green - u.ch.green); e.b = (int8_t)(t.ch.blue - u.ch.blue); } + lv_scolor24_t next_px_err = {0}, next_l = {0}, error; + /*First last pixel are not dithered */ + grad->map[0] = lv_color_hex(grad->hmap[0].full); + for(lv_coord_t x = 1; x < grad->size - 1; x++) { + lv_color32_t t = grad->hmap[x]; + lv_color_t q; + /*Add error term*/ + FS_COMPONENTS(t, +, next_px_err, next_l); + next_l = grad->error_acc[x + 1]; + /*Quantify*/ + q = lv_color_hex(t.full); + /*Then compute error*/ + FS_QUANT_ERROR(error, t, q); + /*Dither the error*/ + FS_COMPUTE_ERROR(error.r); + next_px_err.r = coef[0] >> 4; + grad->error_acc[x - 1].r += coef[1] >> 4; + grad->error_acc[x].r += coef[2] >> 4; + grad->error_acc[x + 1].r = coef[3] >> 4; + + FS_COMPUTE_ERROR(error.g); + next_px_err.g = coef[0] >> 4; + grad->error_acc[x - 1].g += coef[1] >> 4; + grad->error_acc[x].g += coef[2] >> 4; + grad->error_acc[x + 1].g = coef[3] >> 4; + + FS_COMPUTE_ERROR(error.b); + next_px_err.b = coef[0] >> 4; + grad->error_acc[x - 1].b += coef[1] >> 4; + grad->error_acc[x].b += coef[2] >> 4; + grad->error_acc[x + 1].b = coef[3] >> 4; + + grad->map[x] = q; + } + grad->map[grad->size - 1] = lv_color_hex(grad->hmap[grad->size - 1].full); +} + +void LV_ATTRIBUTE_FAST_MEM lv_dither_err_diff_ver(lv_grad_t * grad, lv_coord_t xs, lv_coord_t y, lv_coord_t w) +{ + /* Try to implement error diffusion on a vertical gradient and an horizontal map using those tricks: + Since the given hi-resolution gradient (in src) is vertical, the Floyd Steinberg algorithm pass need to be rotated, + so we'll get this instead (from top to bottom): + + A B C + 1 [ ][ ][ ] + 2 [ ][ ][ ] Pixel A2 will spread its error on pixel A3 with coefficient 7, + 3 [ ][ ][ ] Pixel A2 will spread its error on pixel B1 with coefficient 3, B2 with coef 5 and B3 with coef 1 + + When taking into account an arbitrary pixel P(i,j), its added error diffusion term is: + e(i,j) = 1/16 * [ e(i-1,j) * 5 + e(i-1,j+1) * 3 + e(i-1,j-1) * 1 + e(i,j-1) * 7] + + This means that the error term depends on pixel W, NW, N and SW. + If we consider that we are generating the error diffused gradient map from top to bottom, we can remember the previous + line (N, NW) in the term above. Also, we remember the (W) term too since we are computing the gradient map from left to right. + However, the SW term is painful for us, we can't support it (since to get it, we need its own SW term and so on). + Let's remove it and re-dispatch the error factor accordingly so they stays normalized: + e(i,j) ~= 1/16 * [ e(i-1,j) * 6 + e(i-1,j-1) * 1 + e(i,j-1) * 9] + + That's the idea of this pseudo Floyd Steinberg dithering */ +#define FS_APPLY(d, s, c) d.r = (int8_t)(s.r * c) >> 4; d.g = (int8_t)(s.g * c) >> 4; d.b = (int8_t)(s.b * c) >> 4; +#define FS_COMPONENTS3(A, OP, B, b, C, c, D, d) \ + A.ch.red = LV_CLAMP(0, A.ch.red OP ((B.r * b OP C.r * c OP D.r * d) >> 4), 255); \ + A.ch.green = LV_CLAMP(0, A.ch.green OP ((B.r * b OP C.r * c OP D.r * d) >> 4), 255); \ + A.ch.blue = LV_CLAMP(0, A.ch.blue OP ((B.r * b OP C.r * c OP D.r * d) >> 4), 255); + + lv_scolor24_t next_px_err, prev_l = grad->error_acc[0]; + /*Compute the error term for the current pixel (first pixel is never dithered)*/ + if(xs == 0) { + grad->map[0] = lv_color_hex(grad->hmap[y].full); + FS_QUANT_ERROR(next_px_err, grad->hmap[y], grad->map[0]); + } + else { + lv_color_t tmp = lv_color_hex(grad->hmap[y].full); + lv_color32_t t = grad->hmap[y]; + FS_QUANT_ERROR(next_px_err, grad->hmap[y], tmp); + FS_COMPONENTS3(t, +, next_px_err, 6, prev_l, 1, grad->error_acc[0], 9); + grad->map[0] = lv_color_hex(t.full); + } + + for(lv_coord_t x = 1; x < w; x++) { + lv_color32_t t = grad->hmap[y]; + lv_color_t q; + /*Add the current error term*/ + FS_COMPONENTS3(t, +, next_px_err, 6, prev_l, 1, grad->error_acc[x], 9); + prev_l = grad->error_acc[x]; + /*Quantize and compute error term*/ + q = lv_color_hex(t.full); + FS_QUANT_ERROR(next_px_err, t, q); + /*Store error for next line computation*/ + grad->error_acc[x] = next_px_err; + grad->map[x] = q; + } +} +#endif +#endif diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_dither.h b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_dither.h new file mode 100644 index 0000000..17f98f9 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_dither.h @@ -0,0 +1,71 @@ +/** + * @file lv_draw_sw_dither.h + * + */ + +#ifndef LV_DRAW_SW_DITHER_H +#define LV_DRAW_SW_DITHER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../core/lv_obj_pos.h" + + +/********************* + * DEFINES + *********************/ +#if LV_COLOR_DEPTH < 32 && LV_DITHER_GRADIENT == 1 +#define _DITHER_GRADIENT 1 +#else +#define _DITHER_GRADIENT 0 +#endif + +/********************** + * TYPEDEFS + **********************/ +#if _DITHER_GRADIENT +/*A signed error color component*/ +typedef struct { + int8_t r, g, b; +} lv_scolor24_t; + +struct _lv_gradient_cache_t; +typedef void (*lv_dither_func_t)(struct _lv_gradient_cache_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w); + +#endif + + +/********************** + * PROTOTYPES + **********************/ +#if LV_DRAW_COMPLEX +#if _DITHER_GRADIENT +void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_none(struct _lv_gradient_cache_t * grad, lv_coord_t x, lv_coord_t y, + lv_coord_t w); + +void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_ordered_hor(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, + const lv_coord_t y, const lv_coord_t w); +void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_ordered_ver(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, + const lv_coord_t y, const lv_coord_t w); + +#if LV_DITHER_ERROR_DIFFUSION == 1 +void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_err_diff_hor(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, + const lv_coord_t y, const lv_coord_t w); +void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_err_diff_ver(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, + const lv_coord_t y, const lv_coord_t w); +#endif /* LV_DITHER_ERROR_DIFFUSION */ + +#endif /* _DITHER_GRADIENT */ +#endif + + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_fill.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_fill.c deleted file mode 100644 index 0aeb559..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_fill.c +++ /dev/null @@ -1,342 +0,0 @@ -/** - * @file lv_draw_sw_fill.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../misc/lv_area_private.h" -#include "lv_draw_sw_mask_private.h" -#include "../lv_draw_private.h" -#include "lv_draw_sw.h" -#if LV_USE_DRAW_SW - -#include "blend/lv_draw_sw_blend_private.h" -#include "lv_draw_sw_gradient_private.h" -#include "../../misc/lv_math.h" -#include "../../misc/lv_text_ap.h" -#include "../../core/lv_refr.h" -#include "../../misc/lv_assert.h" -#include "../../stdlib/lv_string.h" -#include "../lv_draw_mask.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_sw_fill(lv_draw_unit_t * draw_unit, lv_draw_fill_dsc_t * dsc, const lv_area_t * coords) -{ - if(dsc->opa <= LV_OPA_MIN) return; - - lv_area_t bg_coords; - lv_area_copy(&bg_coords, coords); - - lv_area_t clipped_coords; - if(!lv_area_intersect(&clipped_coords, &bg_coords, draw_unit->clip_area)) return; - - lv_grad_dir_t grad_dir = dsc->grad.dir; - lv_color_t bg_color = grad_dir == LV_GRAD_DIR_NONE ? dsc->color : dsc->grad.stops[0].color; - - lv_draw_sw_blend_dsc_t blend_dsc = {0}; - blend_dsc.color = bg_color; - - /*Most simple case: just a plain rectangle*/ - if(dsc->radius == 0 && (grad_dir == LV_GRAD_DIR_NONE)) { - blend_dsc.blend_area = &bg_coords; - blend_dsc.opa = dsc->opa; - lv_draw_sw_blend(draw_unit, &blend_dsc); - return; - } - - /*Complex case: there is gradient, mask, or radius*/ -#if LV_DRAW_SW_COMPLEX == 0 - LV_LOG_WARN("Can't draw complex rectangle because LV_DRAW_SW_COMPLEX = 0"); -#else - lv_opa_t opa = dsc->opa >= LV_OPA_MAX ? LV_OPA_COVER : dsc->opa; - - /*Get the real radius. Can't be larger than the half of the shortest side */ - int32_t coords_bg_w = lv_area_get_width(&bg_coords); - int32_t coords_bg_h = lv_area_get_height(&bg_coords); - int32_t short_side = LV_MIN(coords_bg_w, coords_bg_h); - int32_t rout = LV_MIN(dsc->radius, short_side >> 1); - - /*Add a radius mask if there is a radius*/ - int32_t clipped_w = lv_area_get_width(&clipped_coords); - lv_opa_t * mask_buf = NULL; - lv_draw_sw_mask_radius_param_t mask_rout_param; - void * mask_list[2] = {NULL, NULL}; - if(rout > 0) { - mask_buf = lv_malloc(clipped_w); - lv_draw_sw_mask_radius_init(&mask_rout_param, &bg_coords, rout, false); - mask_list[0] = &mask_rout_param; - } - - int32_t h; - - lv_area_t blend_area; - blend_area.x1 = clipped_coords.x1; - blend_area.x2 = clipped_coords.x2; - - blend_dsc.mask_buf = mask_buf; - blend_dsc.blend_area = &blend_area; - blend_dsc.mask_area = &blend_area; - blend_dsc.opa = LV_OPA_COVER; - - /*Get gradient if appropriate*/ - lv_grad_t * grad = lv_gradient_get(&dsc->grad, coords_bg_w, coords_bg_h); - lv_opa_t * grad_opa_map = NULL; - bool transp = false; - if(grad && grad_dir >= LV_GRAD_DIR_HOR) { - blend_dsc.src_area = &blend_area; - blend_dsc.src_buf = grad->color_map + clipped_coords.x1 - bg_coords.x1; - uint32_t s; - for(s = 0; s < dsc->grad.stops_count; s++) { - if(dsc->grad.stops[s].opa != LV_OPA_COVER) { - transp = true; - break; - } - } - if(grad_dir == LV_GRAD_DIR_HOR) { - if(transp) grad_opa_map = grad->opa_map + clipped_coords.x1 - bg_coords.x1; - } - blend_dsc.src_color_format = LV_COLOR_FORMAT_RGB888; - } - -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - - /*Prepare complex gradient*/ - if(grad_dir >= LV_GRAD_DIR_LINEAR) { - switch(grad_dir) { - case LV_GRAD_DIR_LINEAR: - lv_gradient_linear_setup(&dsc->grad, coords); - break; - case LV_GRAD_DIR_RADIAL: - lv_gradient_radial_setup(&dsc->grad, coords); - break; - case LV_GRAD_DIR_CONICAL: - lv_gradient_conical_setup(&dsc->grad, coords); - break; - default: - LV_LOG_WARN("Gradient type is not supported"); - return; - } - blend_dsc.src_area = &blend_area; - /* For complex gradients we reuse the color map buffer for the pixel data */ - blend_dsc.src_buf = grad->color_map; - grad_opa_map = grad->opa_map; - } -#endif - - /* Draw the top of the rectangle line by line and mirror it to the bottom. */ - for(h = 0; h < rout; h++) { - int32_t top_y = bg_coords.y1 + h; - int32_t bottom_y = bg_coords.y2 - h; - if(top_y < clipped_coords.y1 && bottom_y > clipped_coords.y2) continue; /*This line is clipped now*/ - - bool preblend = false; - - /* Initialize the mask to opa instead of 0xFF and blend with LV_OPA_COVER. - * It saves calculating the final opa in lv_draw_sw_blend*/ - lv_memset(mask_buf, opa, clipped_w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(mask_list, mask_buf, blend_area.x1, top_y, clipped_w); - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - - bool hor_grad_processed = false; - if(top_y >= clipped_coords.y1) { - blend_area.y1 = top_y; - blend_area.y2 = top_y; - - switch(grad_dir) { - case LV_GRAD_DIR_VER: - blend_dsc.color = grad->color_map[top_y - bg_coords.y1]; - blend_dsc.opa = grad->opa_map[top_y - bg_coords.y1]; - break; - case LV_GRAD_DIR_HOR: - hor_grad_processed = true; - preblend = grad_opa_map != NULL; - break; -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - case LV_GRAD_DIR_LINEAR: - lv_gradient_linear_get_line(&dsc->grad, clipped_coords.x1 - bg_coords.x1, top_y - bg_coords.y1, coords_bg_w, grad); - preblend = true; - break; - case LV_GRAD_DIR_RADIAL: - lv_gradient_radial_get_line(&dsc->grad, clipped_coords.x1 - bg_coords.x1, top_y - bg_coords.y1, coords_bg_w, grad); - preblend = true; - break; - case LV_GRAD_DIR_CONICAL: - lv_gradient_conical_get_line(&dsc->grad, clipped_coords.x1 - bg_coords.x1, top_y - bg_coords.y1, coords_bg_w, grad); - preblend = true; - break; -#endif - default: - break; - } - /* pre-blend the mask */ - if(preblend) { - int32_t i; - for(i = 0; i < clipped_w; i++) { - if(grad_opa_map[i] < LV_OPA_MAX) mask_buf[i] = (mask_buf[i] * grad_opa_map[i]) >> 8; - } - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - - if(bottom_y <= clipped_coords.y2) { - blend_area.y1 = bottom_y; - blend_area.y2 = bottom_y; - - switch(grad_dir) { - case LV_GRAD_DIR_VER: - blend_dsc.color = grad->color_map[bottom_y - bg_coords.y1]; - blend_dsc.opa = grad->opa_map[bottom_y - bg_coords.y1]; - break; - case LV_GRAD_DIR_HOR: - preblend = !hor_grad_processed && (grad_opa_map != NULL); - break; -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - case LV_GRAD_DIR_LINEAR: - lv_gradient_linear_get_line(&dsc->grad, clipped_coords.x1 - bg_coords.x1, bottom_y - bg_coords.y1, coords_bg_w, grad); - preblend = true; - break; - case LV_GRAD_DIR_RADIAL: - lv_gradient_radial_get_line(&dsc->grad, clipped_coords.x1 - bg_coords.x1, bottom_y - bg_coords.y1, coords_bg_w, grad); - preblend = true; - break; - case LV_GRAD_DIR_CONICAL: - lv_gradient_conical_get_line(&dsc->grad, clipped_coords.x1 - bg_coords.x1, bottom_y - bg_coords.y1, coords_bg_w, grad); - preblend = true; - break; -#endif - default: - break; - } - /* pre-blend the mask */ - if(preblend) { - int32_t i; - if(grad_dir >= LV_GRAD_DIR_LINEAR) { - /*Need to generate the mask again, because we have mixed in the upper part of the gradient*/ - lv_memset(mask_buf, opa, clipped_w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(mask_list, mask_buf, blend_area.x1, top_y, clipped_w); - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - for(i = 0; i < clipped_w; i++) { - if(grad_opa_map[i] < LV_OPA_MAX) mask_buf[i] = (mask_buf[i] * grad_opa_map[i]) >> 8; - } - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - } - - /* Draw the center of the rectangle.*/ - - /*If no gradient, the center is a simple rectangle*/ - if(grad_dir == LV_GRAD_DIR_NONE) { - blend_area.y1 = bg_coords.y1 + rout; - blend_area.y2 = bg_coords.y2 - rout; - blend_dsc.opa = opa; - blend_dsc.mask_buf = NULL; - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - /*With gradient draw line by line*/ - else { - blend_dsc.opa = opa; - switch(grad_dir) { - case LV_GRAD_DIR_VER: - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_FULL_COVER; - break; - case LV_GRAD_DIR_HOR: - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - blend_dsc.mask_buf = grad_opa_map; - break; - case LV_GRAD_DIR_LINEAR: - case LV_GRAD_DIR_RADIAL: - case LV_GRAD_DIR_CONICAL: - blend_dsc.mask_res = transp ? LV_DRAW_SW_MASK_RES_CHANGED : LV_DRAW_SW_MASK_RES_FULL_COVER; - blend_dsc.mask_buf = grad_opa_map; - default: - break; - } - - int32_t h_start = LV_MAX(bg_coords.y1 + rout, clipped_coords.y1); - int32_t h_end = LV_MIN(bg_coords.y2 - rout, clipped_coords.y2); - for(h = h_start; h <= h_end; h++) { - blend_area.y1 = h; - blend_area.y2 = h; - - switch(grad_dir) { - case LV_GRAD_DIR_VER: - blend_dsc.color = grad->color_map[h - bg_coords.y1]; - if(opa >= LV_OPA_MAX) blend_dsc.opa = grad->opa_map[h - bg_coords.y1]; - else blend_dsc.opa = LV_OPA_MIX2(grad->opa_map[h - bg_coords.y1], opa); - break; -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - case LV_GRAD_DIR_LINEAR: - lv_gradient_linear_get_line(&dsc->grad, clipped_coords.x1 - bg_coords.x1, h - bg_coords.y1, coords_bg_w, grad); - break; - case LV_GRAD_DIR_RADIAL: - lv_gradient_radial_get_line(&dsc->grad, clipped_coords.x1 - bg_coords.x1, h - bg_coords.y1, coords_bg_w, grad); - break; - case LV_GRAD_DIR_CONICAL: - lv_gradient_conical_get_line(&dsc->grad, clipped_coords.x1 - bg_coords.x1, h - bg_coords.y1, coords_bg_w, grad); - break; -#endif - default: - break; - } - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - } - - if(mask_buf) { - lv_free(mask_buf); - lv_draw_sw_mask_free_param(&mask_rout_param); - } - if(grad) { - lv_gradient_cleanup(grad); - } -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - if(grad_dir >= LV_GRAD_DIR_LINEAR) { - switch(grad_dir) { - case LV_GRAD_DIR_LINEAR: - lv_gradient_linear_cleanup(&dsc->grad); - break; - case LV_GRAD_DIR_RADIAL: - lv_gradient_radial_cleanup(&dsc->grad); - break; - case LV_GRAD_DIR_CONICAL: - lv_gradient_conical_cleanup(&dsc->grad); - break; - default: - break; - } - } -#endif - -#endif -} - -#endif /*LV_USE_DRAW_SW*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_gradient.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_gradient.c index 9262710..efa158c 100644 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_gradient.c +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_gradient.c @@ -1,4 +1,4 @@ -/** +/** * @file lv_draw_sw_gradient.c * */ @@ -6,18 +6,20 @@ /********************* * INCLUDES *********************/ -#include "lv_draw_sw_gradient_private.h" -#if LV_USE_DRAW_SW - +#include "lv_draw_sw_gradient.h" +#include "../../misc/lv_gc.h" #include "../../misc/lv_types.h" -#include "../../osal/lv_os.h" -#include "../../misc/lv_math.h" /********************* * DEFINES *********************/ -#define GRAD_CM(r,g,b) lv_color_make(r,g,b) -#define GRAD_CONV(t, x) t = x +#if _DITHER_GRADIENT + #define GRAD_CM(r,g,b) LV_COLOR_MAKE32(r,g,b) + #define GRAD_CONV(t, x) t.full = lv_color_to32(x) +#else + #define GRAD_CM(r,g,b) LV_COLOR_MAKE(r,g,b) + #define GRAD_CONV(t, x) t = x +#endif #undef ALIGN #if defined(LV_ARCH_64) @@ -26,643 +28,319 @@ #define ALIGN(X) (((X) + 3) & ~3) #endif -/********************** - * TYPEDEFS - **********************/ - -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - -typedef struct { - /* w = (-b(xp, yp) + sqrt(sqr(b(xp, yp)) - 4 * a * c(xp, yp))) / (2 * a) */ - int32_t x0; /* center of the start circle */ - int32_t y0; /* center of the start circle */ - int32_t r0; /* radius of the start circle */ - int32_t inv_dr; /* 1 / (r1 - r0) */ - int32_t a4; /* 4 * a */ - int32_t inv_a4; /* 1 / (4 * a) */ - int32_t dx; - /* b(xp, yp) = xp * bpx + yp * bpy + bc */ - int32_t bpx; - int32_t bpy; - int32_t bc; - lv_area_t clip_area; - lv_grad_t * cgrad; /*256 element cache buffer containing the gradient color map*/ -} lv_grad_radial_state_t; - -typedef struct { - /* w = a * xp + b * yp + c */ - int32_t a; - int32_t b; - int32_t c; - lv_grad_t * cgrad; /*256 element cache buffer containing the gradient color map*/ -} lv_grad_linear_state_t; - -typedef struct { - /* w = a * xp + b * yp + c */ - int32_t x0; - int32_t y0; - int32_t a; - int32_t da; - int32_t inv_da; - lv_grad_t * cgrad; /*256 element cache buffer containing the gradient color map*/ -} lv_grad_conical_state_t; - +#if LV_GRAD_CACHE_DEF_SIZE != 0 && LV_GRAD_CACHE_DEF_SIZE < 256 + #error "LV_GRAD_CACHE_DEF_SIZE is too small" #endif /********************** * STATIC PROTOTYPES **********************/ -typedef lv_result_t (*op_cache_t)(lv_grad_t * c, void * ctx); -static lv_grad_t * allocate_item(const lv_grad_dsc_t * g, int32_t w, int32_t h); - -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS +static lv_grad_t * next_in_cache(lv_grad_t * item); - static inline int32_t extend_w(int32_t w, lv_grad_extend_t extend); +typedef lv_res_t (*op_cache_t)(lv_grad_t * c, void * ctx); +static lv_res_t iterate_cache(op_cache_t func, void * ctx, lv_grad_t ** out); +static size_t get_cache_item_size(lv_grad_t * c); +static lv_grad_t * allocate_item(const lv_grad_dsc_t * g, lv_coord_t w, lv_coord_t h); +static lv_res_t find_oldest_item_life(lv_grad_t * c, void * ctx); +static lv_res_t kill_oldest_item(lv_grad_t * c, void * ctx); +static lv_res_t find_item(lv_grad_t * c, void * ctx); +static void free_item(lv_grad_t * c); +static uint32_t compute_key(const lv_grad_dsc_t * g, lv_coord_t w, lv_coord_t h); -#endif /********************** * STATIC VARIABLE **********************/ +static size_t grad_cache_size = 0; +static uint8_t * grad_cache_end = 0; /********************** * STATIC FUNCTIONS **********************/ +union void_cast { + const void * ptr; + const uint32_t value; +}; -static lv_grad_t * allocate_item(const lv_grad_dsc_t * g, int32_t w, int32_t h) +static uint32_t compute_key(const lv_grad_dsc_t * g, lv_coord_t size, lv_coord_t w) { - int32_t size; - switch(g->dir) { - case LV_GRAD_DIR_HOR: - case LV_GRAD_DIR_LINEAR: - case LV_GRAD_DIR_RADIAL: - case LV_GRAD_DIR_CONICAL: - size = w; - break; - case LV_GRAD_DIR_VER: - size = h; - break; - default: - size = 64; - } - - size_t req_size = ALIGN(sizeof(lv_grad_t)) + ALIGN(size * sizeof(lv_color_t)) + ALIGN(size * sizeof(lv_opa_t)); - lv_grad_t * item = lv_malloc(req_size); - LV_ASSERT_MALLOC(item); - if(item == NULL) return NULL; - - uint8_t * p = (uint8_t *)item; - item->color_map = (lv_color_t *)(p + ALIGN(sizeof(*item))); - item->opa_map = (lv_opa_t *)(p + ALIGN(sizeof(*item)) + ALIGN(size * sizeof(lv_color_t))); - item->size = size; - return item; + union void_cast v; + v.ptr = g; + return (v.value ^ size ^ (w >> 1)); /*Yes, this is correct, it's like a hash that changes if the width changes*/ } -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - -static inline int32_t extend_w(int32_t w, lv_grad_extend_t extend) +static size_t get_cache_item_size(lv_grad_t * c) { - if(extend == LV_GRAD_EXTEND_PAD) { /**< Repeat the same color*/ - return w < 0 ? 0 : LV_MIN(w, 255); - } - if(extend == LV_GRAD_EXTEND_REPEAT) { /**< Repeat the pattern*/ - return w & 255; - } - /*LV_GRAD_EXTEND_REFLECT*/ - w &= 511; - if(w > 255) - w ^= 511; /* 511 - w */ - return w; -} - + size_t s = ALIGN(sizeof(*c)) + ALIGN(c->alloc_size * sizeof(lv_color_t)); +#if _DITHER_GRADIENT + s += ALIGN(c->size * sizeof(lv_color32_t)); +#if LV_DITHER_ERROR_DIFFUSION == 1 + s += ALIGN(c->w * sizeof(lv_scolor24_t)); #endif +#endif + return s; +} -/********************** - * FUNCTIONS - **********************/ - -lv_grad_t * lv_gradient_get(const lv_grad_dsc_t * g, int32_t w, int32_t h) +static lv_grad_t * next_in_cache(lv_grad_t * item) { - /* No gradient, no cache */ - if(g->dir == LV_GRAD_DIR_NONE) return NULL; + if(grad_cache_size == 0) return NULL; - /* Step 1: Search cache for the given key */ - lv_grad_t * item = allocate_item(g, w, h); - if(item == NULL) { - LV_LOG_WARN("Failed to allocate item for the gradient"); - return item; - } + if(item == NULL) + return (lv_grad_t *)LV_GC_ROOT(_lv_grad_cache_mem); - /* Step 3: Fill it with the gradient, as expected */ - uint32_t i; - for(i = 0; i < item->size; i++) { - lv_gradient_color_calculate(g, item->size, i, &item->color_map[i], &item->opa_map[i]); - } - return item; + size_t s = get_cache_item_size(item); + /*Compute the size for this cache item*/ + if((uint8_t *)item + s >= grad_cache_end) return NULL; + else return (lv_grad_t *)((uint8_t *)item + s); } -void LV_ATTRIBUTE_FAST_MEM lv_gradient_color_calculate(const lv_grad_dsc_t * dsc, int32_t range, - int32_t frac, lv_grad_color_t * color_out, lv_opa_t * opa_out) +static lv_res_t iterate_cache(op_cache_t func, void * ctx, lv_grad_t ** out) { - lv_grad_color_t tmp; - /*Clip out-of-bounds first*/ - int32_t min = (dsc->stops[0].frac * range) >> 8; - if(frac <= min) { - GRAD_CONV(tmp, dsc->stops[0].color); - *color_out = tmp; - *opa_out = dsc->stops[0].opa; - return; - } - - int32_t max = (dsc->stops[dsc->stops_count - 1].frac * range) >> 8; - if(frac >= max) { - GRAD_CONV(tmp, dsc->stops[dsc->stops_count - 1].color); - *color_out = tmp; - *opa_out = dsc->stops[dsc->stops_count - 1].opa; - return; - } - - /*Find the 2 closest stop now*/ - int32_t d = 0; - int32_t found_i = 0; - for(uint8_t i = 1; i < dsc->stops_count; i++) { - int32_t cur = (dsc->stops[i].frac * range) >> 8; - if(frac <= cur) { - found_i = i; - break; + lv_grad_t * first = next_in_cache(NULL); + while(first != NULL && first->life) { + if((*func)(first, ctx) == LV_RES_OK) { + if(out != NULL) *out = first; + return LV_RES_OK; } + first = next_in_cache(first); } - - LV_ASSERT(found_i != 0); - - lv_color_t one, two; - one = dsc->stops[found_i - 1].color; - two = dsc->stops[found_i].color; - min = (dsc->stops[found_i - 1].frac * range) >> 8; - max = (dsc->stops[found_i].frac * range) >> 8; - d = max - min; - - /*Then interpolate*/ - frac -= min; - lv_opa_t mix = (frac * 255) / d; - lv_opa_t imix = 255 - mix; - - *color_out = GRAD_CM(LV_UDIV255(two.red * mix + one.red * imix), - LV_UDIV255(two.green * mix + one.green * imix), - LV_UDIV255(two.blue * mix + one.blue * imix)); - - *opa_out = LV_UDIV255(dsc->stops[found_i].opa * mix + dsc->stops[found_i - 1].opa * imix); + return LV_RES_INV; } -void lv_gradient_cleanup(lv_grad_t * grad) +static lv_res_t find_oldest_item_life(lv_grad_t * c, void * ctx) { - lv_free(grad); + uint32_t * min_life = (uint32_t *)ctx; + if(c->life < *min_life) *min_life = c->life; + return LV_RES_INV; } -void lv_gradient_init_stops(lv_grad_dsc_t * grad, const lv_color_t colors[], const lv_opa_t opa[], - const uint8_t fracs[], int num_stops) +static void free_item(lv_grad_t * c) { - LV_ASSERT(num_stops <= LV_GRADIENT_MAX_STOPS); - grad->stops_count = num_stops; - for(int i = 0; i < num_stops; i++) { - grad->stops[i].color = colors[i]; - grad->stops[i].opa = opa != NULL ? opa[i] : LV_OPA_COVER; - grad->stops[i].frac = fracs != NULL ? fracs[i] : 255 * i / (num_stops - 1); + size_t size = get_cache_item_size(c); + size_t next_items_size = (size_t)(grad_cache_end - (uint8_t *)c) - size; + grad_cache_end -= size; + if(next_items_size) { + uint8_t * old = (uint8_t *)c; + lv_memcpy(c, ((uint8_t *)c) + size, next_items_size); + /* Then need to fix all internal pointers too */ + while((uint8_t *)c != grad_cache_end) { + c->map = (lv_color_t *)(((uint8_t *)c->map) - size); +#if _DITHER_GRADIENT + c->hmap = (lv_color32_t *)(((uint8_t *)c->hmap) - size); +#if LV_DITHER_ERROR_DIFFUSION == 1 + c->error_acc = (lv_scolor24_t *)(((uint8_t *)c->error_acc) - size); +#endif +#endif + c = (lv_grad_t *)(((uint8_t *)c) + get_cache_item_size(c)); + } + lv_memset_00(old + next_items_size, size); } } -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - -/* - Calculate radial gradient based on the following equation: - - | P - (C1 - C0)w - C0 | = (r1 - r0)w + r0, where - - P: {xp, yp} is the point of interest - C0: {x0, y0} is the center of the start circle - C1: {x1, y1} is the center of the end circle - r0 is the radius of the start circle - r1 is the radius of the end circle - w is the unknown variable - || is the length of the vector - - The above equation can be rewritten as: - - ((r1-r0)^2 - (x1-x0)^2 - (y1-y0)^2) * w^2 + 2*((xp-x0)*(x1-x0) + (yp-y0)*(y1-y0)) * w + (-(xp-x0)^2 - (yp-y0)^) = 0 - - The roots of the quadratical equation can be obtained using the well-known formula (-b +- sqrt(b^2 - 4ac)) / 2a - We only need the more positive root. - - Let's denote - dx = x1 - x0 - dy = y1 - y0 - dr = r1 - r0 - - Thus: - - w = (-b(xp, yp) + sqrt(sqr(b(xp, yp)) - 4 * a * c(xp, yp))) / (2 * a), where - - b(xp, yp) = 2dx * xp + 2dy * yp + 2(r0 * dr - x0 * dx - y0 * dy) - c(xp, yp) = r0^2 - (xp - x0)^2 - (yp - y0)^2 - - Rewrite b(xp, yp) as: - - b(xp, yp) = xp * bpx + yp * bpy + bc, where - - bpx = 2dx - bpy = 2dy - bc = 2(r0 * dr - x0 * dx - y0 * dy) - - We can pre-calculate the constants, because they do not depend on the pixel coordinates. - -*/ - -void lv_gradient_radial_setup(lv_grad_dsc_t * dsc, const lv_area_t * coords) +static lv_res_t kill_oldest_item(lv_grad_t * c, void * ctx) { - lv_point_t start = dsc->params.radial.focal; - lv_point_t end = dsc->params.radial.end; - lv_point_t start_extent = dsc->params.radial.focal_extent; - lv_point_t end_extent = dsc->params.radial.end_extent; - lv_grad_radial_state_t * state = lv_malloc(sizeof(lv_grad_radial_state_t)); - dsc->state = state; - - /* Convert from percentage coordinates */ - int32_t wdt = lv_area_get_width(coords); - int32_t hgt = lv_area_get_height(coords); - - start.x = lv_pct_to_px(start.x, wdt); - end.x = lv_pct_to_px(end.x, wdt); - start_extent.x = lv_pct_to_px(start_extent.x, wdt); - end_extent.x = lv_pct_to_px(end_extent.x, wdt); - start.y = lv_pct_to_px(start.y, hgt); - end.y = lv_pct_to_px(end.y, hgt); - start_extent.y = lv_pct_to_px(start_extent.y, hgt); - end_extent.y = lv_pct_to_px(end_extent.y, hgt); - - /* Calculate radii */ - int16_t r_start = lv_sqrt32(lv_sqr(start_extent.x - start.x) + lv_sqr(start_extent.y - start.y)); - int16_t r_end = lv_sqrt32(lv_sqr(end_extent.x - end.x) + lv_sqr(end_extent.y - end.y)); - LV_ASSERT(r_end != 0); - - /* Create gradient color map */ - state->cgrad = lv_gradient_get(dsc, 256, 0); - - state->x0 = start.x; - state->y0 = start.y; - state->r0 = r_start; - int32_t dr = r_end - r_start; - if(end.x == start.x && end.y == start.y) { - LV_ASSERT(dr != 0); - state->a4 = lv_sqr(dr) << 2; - state->bpx = 0; - state->bpy = 0; - state->bc = (state->r0 * dr) << 1; - state->dx = 0; - state->inv_dr = (1 << (8 + 16)) / dr; - } - else { - int32_t dx = end.x - start.x; - int32_t dy = end.y - start.y; - state->dx = dx; /* needed for incremental calculation */ - state->a4 = (lv_sqr(dr) - lv_sqr(dx) - lv_sqr(dy)) << 2; - /* b(xp, yp) = xp * bpx + yp * bpy + bc */ - state->bpx = dx << 1; - state->bpy = dy << 1; - state->bc = (state->r0 * dr - state->x0 * dx - state->y0 * dy) << 1; - } - state->inv_a4 = state->a4 != 0 ? (1 << (13 + 16)) / state->a4 : 0; - /* check for possible clipping */ - if(dsc->extend == LV_GRAD_EXTEND_PAD && - /* if extend mode is 'pad', then we can clip to the end circle's bounding box, if the start circle is entirely within the end circle */ - (lv_sqr(start.x - end.x) + lv_sqr(start.y - end.y) < lv_sqr(r_end - r_start))) { - if(r_end > r_start) { - lv_area_set(&state->clip_area, end.x - r_end, end.y - r_end, end.x + r_end, end.y + r_end); - } - else { - lv_area_set(&state->clip_area, start.x - r_start, start.y - r_start, start.x + r_start, start.y + r_start); - } - } - else { - state->clip_area.x1 = -0x7fffffff; + uint32_t * min_life = (uint32_t *)ctx; + if(c->life == *min_life) { + /*Found, let's kill it*/ + free_item(c); + return LV_RES_OK; } + return LV_RES_INV; } -void lv_gradient_radial_cleanup(lv_grad_dsc_t * dsc) +static lv_res_t find_item(lv_grad_t * c, void * ctx) { - lv_grad_radial_state_t * state = dsc->state; - if(state == NULL) - return; - if(state->cgrad) - lv_gradient_cleanup(state->cgrad); - lv_free(state); + uint32_t * k = (uint32_t *)ctx; + if(c->key == *k) return LV_RES_OK; + return LV_RES_INV; } -void LV_ATTRIBUTE_FAST_MEM lv_gradient_radial_get_line(lv_grad_dsc_t * dsc, int32_t xp, int32_t yp, - int32_t width, lv_grad_t * result) +static lv_grad_t * allocate_item(const lv_grad_dsc_t * g, lv_coord_t w, lv_coord_t h) { - lv_grad_radial_state_t * state = (lv_grad_radial_state_t *)dsc->state; - lv_color_t * buf = result->color_map; - lv_opa_t * opa = result->opa_map; - lv_grad_t * grad = state->cgrad; - - int32_t w; /* the result: this is an offset into the 256 element gradient color table */ - int32_t b, db, c, dc; - - /* check for possible clipping */ - if(state->clip_area.x1 != -0x7fffffff) { - /* fill line with end color for pixels outside the clipped region */ - lv_color_t * _buf = buf; - lv_opa_t * _opa = opa; - lv_color_t _c = grad->color_map[255]; - lv_opa_t _o = grad->opa_map[255]; - int32_t _w = width; - for(; _w > 0; _w--) { - *_buf++ = _c; - *_opa++ = _o; - } - /* is this line fully outside the clip area? */ - if(yp < state->clip_area.y1 || - yp >= state->clip_area.y2 || - xp >= state->clip_area.x2 || - xp + width < state->clip_area.x1) { - return; - } - else { /* not fully outside: clip line to the bounding box */ - int32_t _x1 = LV_MAX(xp, state->clip_area.x1); - int32_t _x2 = LV_MIN(xp + width, state->clip_area.x2); - buf += _x1 - xp; - opa += _x1 - xp; - xp = _x1; - width = _x2 - _x1; - } - } + lv_coord_t size = g->dir == LV_GRAD_DIR_HOR ? w : h; + lv_coord_t map_size = LV_MAX(w, h); /* The map is being used horizontally (width) unless + no dithering is selected where it's used vertically */ + + size_t req_size = ALIGN(sizeof(lv_grad_t)) + ALIGN(map_size * sizeof(lv_color_t)); +#if _DITHER_GRADIENT + req_size += ALIGN(size * sizeof(lv_color32_t)); +#if LV_DITHER_ERROR_DIFFUSION == 1 + req_size += ALIGN(w * sizeof(lv_scolor24_t)); +#endif +#endif - b = xp * state->bpx + yp * state->bpy + state->bc; - c = lv_sqr(state->r0) - lv_sqr(xp - state->x0) - lv_sqr(yp - state->y0); - /* We can save some calculations by using the previous values of b and c */ - db = state->dx << 1; - dc = ((xp - state->x0) << 1) + 1; - - if(state->a4 == 0) { /* not a quadratic equation: solve linear equation: w = -c/b */ - for(; width > 0; width--) { - w = extend_w(b == 0 ? 0 : -(c << 8) / b, dsc->extend); - *buf++ = grad->color_map[w]; - *opa++ = grad->opa_map[w]; - b += db; - c -= dc; - dc += 2; - } + size_t act_size = (size_t)(grad_cache_end - LV_GC_ROOT(_lv_grad_cache_mem)); + lv_grad_t * item = NULL; + if(req_size + act_size < grad_cache_size) { + item = (lv_grad_t *)grad_cache_end; + item->not_cached = 0; } - else { /* solve quadratical equation */ - if(state->bpx || - state->bpy) { /* general case (circles are not concentric): w = (-b + sqrt(b^2 - 4ac))/2a (we only need the more positive root)*/ - int32_t a4 = state->a4 >> 4; - for(; width > 0; width--) { - int32_t det = lv_sqr(b >> 4) - (a4 * (c >> 4)); /* b^2 shifted down by 2*4=8, 4ac shifted down by 8 */ - /* check determinant: if negative, then there is no solution: use starting color */ - w = det < 0 ? 0 : extend_w(((lv_sqrt32(det) - (b >> 4)) * state->inv_a4) >> 16, - dsc->extend); /* square root shifted down by 4 (includes *256 to set output range) */ - *buf++ = grad->color_map[w]; - *opa++ = grad->opa_map[w]; - b += db; - c -= dc; - dc += 2; + else { + /*Need to evict items from cache until we find enough space to allocate this one */ + if(req_size <= grad_cache_size) { + while(act_size + req_size > grad_cache_size) { + uint32_t oldest_life = UINT32_MAX; + iterate_cache(&find_oldest_item_life, &oldest_life, NULL); + iterate_cache(&kill_oldest_item, &oldest_life, NULL); + act_size = (size_t)(grad_cache_end - LV_GC_ROOT(_lv_grad_cache_mem)); } + item = (lv_grad_t *)grad_cache_end; + item->not_cached = 0; } - else { /* special case: concentric circles: w = (sqrt((xp-x0)^2 + (yx-y0)^2)-r0)/(r1-r0) */ - c = lv_sqr(xp - state->x0) + lv_sqr(yp - state->y0); - for(; width > 0; width--) { - w = extend_w((((lv_sqrt32(c) - state->r0)) * state->inv_dr) >> 16, dsc->extend); - *buf++ = grad->color_map[w]; - *opa++ = grad->opa_map[w]; - c += dc; - dc += 2; - } + else { + /*The cache is too small. Allocate the item manually and free it later.*/ + item = lv_mem_alloc(req_size); + LV_ASSERT_MALLOC(item); + if(item == NULL) return NULL; + item->not_cached = 1; } } -} - -/* - Calculate linear gradient based on the following equation: - - w = ((P - C0) x (C1 - C0)) / | C1 - C0 |^2, where - - P: {xp, yp} is the point of interest - C0: {x0, y0} is the start point of the gradient vector - C1: {x1, y1} is the end point of the gradient vector - w is the unknown variable - || is the length of the vector - x is a dot product - - The above equation can be rewritten as: - - w = xp * (dx / (dx^2 + dy^2)) + yp * (dy / (dx^2 + dy^2)) - (x0 * dx + y0 * dy) / (dx^2 + dy^2), where - - dx = x1 - x0 - dy = y1 - y0 - - We can pre-calculate the constants, because they do not depend on the pixel coordinates. + item->key = compute_key(g, size, w); + item->life = 1; + item->filled = 0; + item->alloc_size = map_size; + item->size = size; + if(item->not_cached) { + uint8_t * p = (uint8_t *)item; + item->map = (lv_color_t *)(p + ALIGN(sizeof(*item))); +#if _DITHER_GRADIENT + item->hmap = (lv_color32_t *)(p + ALIGN(sizeof(*item)) + ALIGN(map_size * sizeof(lv_color_t))); +#if LV_DITHER_ERROR_DIFFUSION == 1 + item->error_acc = (lv_scolor24_t *)(p + ALIGN(sizeof(*item)) + ALIGN(size * sizeof(lv_grad_color_t)) + + ALIGN(map_size * sizeof(lv_color_t))); + item->w = w; +#endif +#endif + } + else { + item->map = (lv_color_t *)(grad_cache_end + ALIGN(sizeof(*item))); +#if _DITHER_GRADIENT + item->hmap = (lv_color32_t *)(grad_cache_end + ALIGN(sizeof(*item)) + ALIGN(map_size * sizeof(lv_color_t))); +#if LV_DITHER_ERROR_DIFFUSION == 1 + item->error_acc = (lv_scolor24_t *)(grad_cache_end + ALIGN(sizeof(*item)) + ALIGN(size * sizeof(lv_grad_color_t)) + + ALIGN(map_size * sizeof(lv_color_t))); + item->w = w; +#endif +#endif + grad_cache_end += req_size; + } + return item; +} -*/ -void lv_gradient_linear_setup(lv_grad_dsc_t * dsc, const lv_area_t * coords) +/********************** + * FUNCTIONS + **********************/ +void lv_gradient_free_cache(void) { - lv_point_t start = dsc->params.linear.start; - lv_point_t end = dsc->params.linear.end; - lv_grad_linear_state_t * state = lv_malloc(sizeof(lv_grad_linear_state_t)); - dsc->state = state; - - /* Create gradient color map */ - state->cgrad = lv_gradient_get(dsc, 256, 0); - - /* Convert from percentage coordinates */ - int32_t wdt = lv_area_get_width(coords); - int32_t hgt = lv_area_get_height(coords); - - start.x = lv_pct_to_px(start.x, wdt); - end.x = lv_pct_to_px(end.x, wdt); - start.y = lv_pct_to_px(start.y, hgt); - end.y = lv_pct_to_px(end.y, hgt); - - /* Precalculate constants */ - int32_t dx = end.x - start.x; - int32_t dy = end.y - start.y; - - int32_t l2 = lv_sqr(dx) + lv_sqr(dy); - state->a = (dx << 16) / l2; - state->b = (dy << 16) / l2; - state->c = ((start.x * dx + start.y * dy) << 16) / l2; + lv_mem_free(LV_GC_ROOT(_lv_grad_cache_mem)); + LV_GC_ROOT(_lv_grad_cache_mem) = grad_cache_end = NULL; + grad_cache_size = 0; } -void lv_gradient_linear_cleanup(lv_grad_dsc_t * dsc) +void lv_gradient_set_cache_size(size_t max_bytes) { - lv_grad_linear_state_t * state = dsc->state; - if(state == NULL) - return; - if(state->cgrad) - lv_free(state->cgrad); - lv_free(state); + lv_mem_free(LV_GC_ROOT(_lv_grad_cache_mem)); + grad_cache_end = LV_GC_ROOT(_lv_grad_cache_mem) = lv_mem_alloc(max_bytes); + LV_ASSERT_MALLOC(LV_GC_ROOT(_lv_grad_cache_mem)); + lv_memset_00(LV_GC_ROOT(_lv_grad_cache_mem), max_bytes); + grad_cache_size = max_bytes; } -void LV_ATTRIBUTE_FAST_MEM lv_gradient_linear_get_line(lv_grad_dsc_t * dsc, int32_t xp, int32_t yp, - int32_t width, lv_grad_t * result) +lv_grad_t * lv_gradient_get(const lv_grad_dsc_t * g, lv_coord_t w, lv_coord_t h) { - lv_grad_linear_state_t * state = (lv_grad_linear_state_t *)dsc->state; - lv_color_t * buf = result->color_map; - lv_opa_t * opa = result->opa_map; - lv_grad_t * grad = state->cgrad; - - int32_t w; /* the result: this is an offset into the 256 element gradient color table */ - int32_t x, d; - - x = xp * state->a + yp * state->b - state->c; - d = state->a; - - for(; width > 0; width--) { - w = extend_w(x >> 8, dsc->extend); - *buf++ = grad->color_map[w]; - *opa++ = grad->opa_map[w]; - x += d; + /* No gradient, no cache */ + if(g->dir == LV_GRAD_DIR_NONE) return NULL; + + /* Step 0: Check if the cache exist (else create it) */ + static bool inited = false; + if(!inited) { + lv_gradient_set_cache_size(LV_GRAD_CACHE_DEF_SIZE); + inited = true; } -} -/* - Calculate conical gradient based on the following equation: + /* Step 1: Search cache for the given key */ + lv_coord_t size = g->dir == LV_GRAD_DIR_HOR ? w : h; + uint32_t key = compute_key(g, size, w); + lv_grad_t * item = NULL; + if(iterate_cache(&find_item, &key, &item) == LV_RES_OK) { + item->life++; /* Don't forget to bump the counter */ + return item; + } - w = (atan((yp - y0)/(xp - x0)) - alpha) / (beta - alpha), where + /* Step 2: Need to allocate an item for it */ + item = allocate_item(g, w, h); + if(item == NULL) { + LV_LOG_WARN("Faild to allcoate item for teh gradient"); + return item; + } - P: {xp, yp} is the point of interest - C0: {x0, y0} is the center of the gradient - alpha is the start angle - beta is the end angle - w is the unknown variable -*/ + /* Step 3: Fill it with the gradient, as expected */ +#if _DITHER_GRADIENT + for(lv_coord_t i = 0; i < item->size; i++) { + item->hmap[i] = lv_gradient_calculate(g, item->size, i); + } +#if LV_DITHER_ERROR_DIFFUSION == 1 + lv_memset_00(item->error_acc, w * sizeof(lv_scolor24_t)); +#endif +#else + for(lv_coord_t i = 0; i < item->size; i++) { + item->map[i] = lv_gradient_calculate(g, item->size, i); + } +#endif -void lv_gradient_conical_setup(lv_grad_dsc_t * dsc, const lv_area_t * coords) -{ - lv_point_t c0 = dsc->params.conical.center; - int32_t alpha = dsc->params.conical.start_angle % 360; - int32_t beta = dsc->params.conical.end_angle % 360; - lv_grad_conical_state_t * state = lv_malloc(sizeof(lv_grad_conical_state_t)); - dsc->state = state; - - /* Create gradient color map */ - state->cgrad = lv_gradient_get(dsc, 256, 0); - - /* Convert from percentage coordinates */ - int32_t wdt = lv_area_get_width(coords); - int32_t hgt = lv_area_get_height(coords); - - c0.x = lv_pct_to_px(c0.x, wdt); - c0.y = lv_pct_to_px(c0.y, hgt); - - /* Precalculate constants */ - if(beta <= alpha) - beta += 360; - state->x0 = c0.x; - state->y0 = c0.y; - state->a = alpha; - state->da = beta - alpha; - state->inv_da = (1 << 16) / (beta - alpha); + return item; } -void lv_gradient_conical_cleanup(lv_grad_dsc_t * dsc) +lv_grad_color_t LV_ATTRIBUTE_FAST_MEM lv_gradient_calculate(const lv_grad_dsc_t * dsc, lv_coord_t range, + lv_coord_t frac) { - lv_grad_conical_state_t * state = dsc->state; - if(state == NULL) - return; - if(state->cgrad) - lv_free(state->cgrad); - lv_free(state); -} + lv_grad_color_t tmp; + lv_color32_t one, two; + /*Clip out-of-bounds first*/ + int32_t min = (dsc->stops[0].frac * range) >> 8; + if(frac <= min) { + GRAD_CONV(tmp, dsc->stops[0].color); + return tmp; + } -void LV_ATTRIBUTE_FAST_MEM lv_gradient_conical_get_line(lv_grad_dsc_t * dsc, int32_t xp, int32_t yp, - int32_t width, lv_grad_t * result) -{ - lv_grad_conical_state_t * state = (lv_grad_conical_state_t *)dsc->state; - lv_color_t * buf = result->color_map; - lv_opa_t * opa = result->opa_map; - lv_grad_t * grad = state->cgrad; - - int32_t w; /* the result: this is an offset into the 256 element gradient color table */ - int32_t dx = xp - state->x0; - int32_t dy = yp - state->y0; - - if(dy == 0) { /* we will eventually go through the center of the conical: need an extra test in the loop to avoid both dx and dy being zero in atan2 */ - for(; width > 0; width--) { - if(dx == 0) { - w = 0; - } - else { - int32_t d = lv_atan2(dy, dx) - state->a; - if(d < 0) - d += 360; - w = extend_w((d * state->inv_da) >> 8, dsc->extend); - } - *buf++ = grad->color_map[w]; - *opa++ = grad->opa_map[w]; - dx++; - } + int32_t max = (dsc->stops[dsc->stops_count - 1].frac * range) >> 8; + if(frac >= max) { + GRAD_CONV(tmp, dsc->stops[dsc->stops_count - 1].color); + return tmp; } - else { - for(; width > 0; width--) { - int32_t d = lv_atan2(dy, dx) - state->a; - if(d < 0) - d += 360; - w = extend_w((d * state->inv_da) >> 8, dsc->extend); - *buf++ = grad->color_map[w]; - *opa++ = grad->opa_map[w]; - dx++; + + /*Find the 2 closest stop now*/ + int32_t d = 0; + for(uint8_t i = 1; i < dsc->stops_count; i++) { + int32_t cur = (dsc->stops[i].frac * range) >> 8; + if(frac <= cur) { + one.full = lv_color_to32(dsc->stops[i - 1].color); + two.full = lv_color_to32(dsc->stops[i].color); + min = (dsc->stops[i - 1].frac * range) >> 8; + max = (dsc->stops[i].frac * range) >> 8; + d = max - min; + break; } } -} -void lv_grad_linear_init(lv_grad_dsc_t * dsc, int32_t from_x, int32_t from_y, int32_t to_x, int32_t to_y, - lv_grad_extend_t extend) -{ - dsc->dir = LV_GRAD_DIR_LINEAR; - dsc->params.linear.start.x = from_x; - dsc->params.linear.start.y = from_y; - dsc->params.linear.end.x = to_x; - dsc->params.linear.end.y = to_y; - dsc->extend = extend; -} + LV_ASSERT(d != 0); -void lv_grad_radial_init(lv_grad_dsc_t * dsc, int32_t center_x, int32_t center_y, int32_t to_x, int32_t to_y, - lv_grad_extend_t extend) -{ - dsc->dir = LV_GRAD_DIR_RADIAL; - dsc->params.radial.focal.x = center_x; - dsc->params.radial.focal.y = center_y; - dsc->params.radial.focal_extent.x = center_x; - dsc->params.radial.focal_extent.y = center_y; - dsc->params.radial.end.x = center_x; - dsc->params.radial.end.y = center_y; - dsc->params.radial.end_extent.x = to_x; - dsc->params.radial.end_extent.y = to_y; - dsc->extend = extend; -} + /*Then interpolate*/ + frac -= min; + lv_opa_t mix = (frac * 255) / d; + lv_opa_t imix = 255 - mix; -void lv_grad_conical_init(lv_grad_dsc_t * dsc, int32_t center_x, int32_t center_y, int32_t start_angle, - int32_t end_angle, lv_grad_extend_t extend) -{ - dsc->dir = LV_GRAD_DIR_CONICAL; - dsc->params.conical.center.x = center_x; - dsc->params.conical.center.y = center_y; - dsc->params.conical.start_angle = start_angle; - dsc->params.conical.end_angle = end_angle; - dsc->extend = extend; + lv_grad_color_t r = GRAD_CM(LV_UDIV255(two.ch.red * mix + one.ch.red * imix), + LV_UDIV255(two.ch.green * mix + one.ch.green * imix), + LV_UDIV255(two.ch.blue * mix + one.ch.blue * imix)); + return r; } -void lv_grad_radial_set_focal(lv_grad_dsc_t * dsc, int32_t center_x, int32_t center_y, int32_t radius) +void lv_gradient_cleanup(lv_grad_t * grad) { - dsc->params.radial.focal.x = center_x; - dsc->params.radial.focal.y = center_y; - dsc->params.radial.focal_extent.x = center_x + radius; - dsc->params.radial.focal_extent.y = center_y; + if(grad->not_cached) { + lv_mem_free(grad); + } } - -#endif /* LV_USE_DRAW_SW_COMPLEX_GRADIENTS */ - -#endif /*LV_USE_DRAW_SW*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_gradient.h b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_gradient.h index 01029cb..95a3c4e 100644 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_gradient.h +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_gradient.h @@ -1,4 +1,4 @@ -/** +/** * @file lv_draw_sw_gradient.h * */ @@ -15,8 +15,7 @@ extern "C" { *********************/ #include "../../misc/lv_color.h" #include "../../misc/lv_style.h" - -#if LV_USE_DRAW_SW +#include "lv_draw_sw_dither.h" /********************* * DEFINES @@ -25,16 +24,41 @@ extern "C" { #error LVGL needs at least 2 stops for gradients. Please increase the LV_GRADIENT_MAX_STOPS #endif -#define LV_GRAD_LEFT LV_PCT(0) -#define LV_GRAD_RIGHT LV_PCT(100) -#define LV_GRAD_TOP LV_PCT(0) -#define LV_GRAD_BOTTOM LV_PCT(100) -#define LV_GRAD_CENTER LV_PCT(50) /********************** * TYPEDEFS **********************/ +#if _DITHER_GRADIENT +typedef lv_color32_t lv_grad_color_t; +#else typedef lv_color_t lv_grad_color_t; +#endif + +/** To avoid recomputing gradient for each draw operation, + * it's possible to cache the computation in this structure instance. + * Whenever possible, this structure is reused instead of recomputing the gradient map */ +typedef struct _lv_gradient_cache_t { + uint32_t key; /**< A discriminating key that's built from the drawing operation. + * If the key does not match, the cache item is not used */ + uint32_t life : 30; /**< A life counter that's incremented on usage. Higher counter is + * less likely to be evicted from the cache */ + uint32_t filled : 1; /**< Used to skip dithering in it if already done */ + uint32_t not_cached: 1; /**< The cache was too small so this item is not managed by the cache*/ + lv_color_t * map; /**< The computed gradient low bitdepth color map, points into the + * cache's buffer, no free needed */ + lv_coord_t alloc_size; /**< The map allocated size in colors */ + lv_coord_t size; /**< The computed gradient color map size, in colors */ +#if _DITHER_GRADIENT + lv_color32_t * hmap; /**< If dithering, we need to store the current, high bitdepth gradient + * map too, points to the cache's buffer, no free needed */ +#if LV_DITHER_ERROR_DIFFUSION == 1 + lv_scolor24_t * error_acc; /**< Error diffusion dithering algorithm requires storing the last error + * drawn, points to the cache's buffer, no free needed */ + lv_coord_t w; /**< The error array width in pixels */ +#endif +#endif +} lv_grad_t; + /********************** * PROTOTYPES @@ -44,15 +68,21 @@ typedef lv_color_t lv_grad_color_t; * @param dsc The gradient descriptor to use * @param range The range to use in computation. * @param frac The current part used in the range. frac is in [0; range] - * @param color_out Calculated gradient color - * @param opa_out Calculated opacity */ +lv_grad_color_t /* LV_ATTRIBUTE_FAST_MEM */ lv_gradient_calculate(const lv_grad_dsc_t * dsc, lv_coord_t range, + lv_coord_t frac); -void /* LV_ATTRIBUTE_FAST_MEM */ lv_gradient_color_calculate(const lv_grad_dsc_t * dsc, int32_t range, - int32_t frac, lv_grad_color_t * color_out, lv_opa_t * opa_out); +/** + * Set the gradient cache size + * @param max_bytes Max cahce size + */ +void lv_gradient_set_cache_size(size_t max_bytes); + +/** Free the gradient cache */ +void lv_gradient_free_cache(void); /** Get a gradient cache from the given parameters */ -lv_grad_t * lv_gradient_get(const lv_grad_dsc_t * gradient, int32_t w, int32_t h); +lv_grad_t * lv_gradient_get(const lv_grad_dsc_t * gradient, lv_coord_t w, lv_coord_t h); /** * Clean up the gradient item after it was get with `lv_grad_get_from_cache`. @@ -60,142 +90,6 @@ lv_grad_t * lv_gradient_get(const lv_grad_dsc_t * gradient, int32_t w, int32_t h */ void lv_gradient_cleanup(lv_grad_t * grad); -/** - * Initialize gradient color map from a table - * @param grad pointer to a gradient descriptor - * @param colors color array - * @param fracs position array (0..255): if NULL, then colors are distributed evenly - * @param opa opacity array: if NULL, then LV_OPA_COVER is assumed - * @param num_stops number of gradient stops (1..LV_GRADIENT_MAX_STOPS) - */ -void lv_gradient_init_stops(lv_grad_dsc_t * grad, const lv_color_t colors[], const lv_opa_t opa[], - const uint8_t fracs[], int num_stops); - -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - -/** - * Helper function to initialize linear gradient - * @param dsc gradient descriptor - * @param from_x start x position: can be a coordinate or an lv_pct() value - * predefined constants LV_GRAD_LEFT, LV_GRAD_RIGHT, LV_GRAD_TOP, LV_GRAD_BOTTOM, LV_GRAD_CENTER can be used as well - * @param from_y start y position - * @param to_x end x position - * @param to_y end y position - * @param extend one of LV_GRAD_EXTEND_PAD, LV_GRAD_EXTEND_REPEAT or LV_GRAD_EXTEND_REFLECT - */ -void lv_grad_linear_init(lv_grad_dsc_t * dsc, int32_t from_x, int32_t from_y, int32_t to_x, int32_t to_y, - lv_grad_extend_t extend); - -/** - * Helper function to initialize radial gradient - * @param dsc gradient descriptor - * @param center_x center x position: can be a coordinate or an lv_pct() value - * predefined constants LV_GRAD_LEFT, LV_GRAD_RIGHT, LV_GRAD_TOP, LV_GRAD_BOTTOM, LV_GRAD_CENTER can be used as well - * @param center_y center y position - * @param to_x point on the end circle x position - * @param to_y point on the end circle y position - * @param extend one of LV_GRAD_EXTEND_PAD, LV_GRAD_EXTEND_REPEAT or LV_GRAD_EXTEND_REFLECT - */ -void lv_grad_radial_init(lv_grad_dsc_t * dsc, int32_t center_x, int32_t center_y, int32_t to_x, int32_t to_y, - lv_grad_extend_t extend); - -/** - * Set focal (starting) circle of a radial gradient - * @param dsc gradient descriptor - * @param center_x center x position: can be a coordinate or an lv_pct() value - * predefined constants LV_GRAD_LEFT, LV_GRAD_RIGHT, LV_GRAD_TOP, LV_GRAD_BOTTOM, LV_GRAD_CENTER can be used as well - * @param center_y center y position - * @param radius radius of the starting circle (NOTE: this must be a scalar number, not percentage) - */ -void lv_grad_radial_set_focal(lv_grad_dsc_t * dsc, int32_t center_x, int32_t center_y, int32_t radius); - -/** - * Helper function to initialize conical gradient - * @param dsc gradient descriptor - * @param center_x center x position: can be a coordinate or an lv_pct() value - * predefined constants LV_GRAD_LEFT, LV_GRAD_RIGHT, LV_GRAD_TOP, LV_GRAD_BOTTOM, LV_GRAD_CENTER can be used as well - * @param center_y center y position - * @param start_angle start angle in degrees - * @param end_angle end angle in degrees - * @param extend one of LV_GRAD_EXTEND_PAD, LV_GRAD_EXTEND_REPEAT or LV_GRAD_EXTEND_REFLECT - */ -void lv_grad_conical_init(lv_grad_dsc_t * dsc, int32_t center_x, int32_t center_y, int32_t start_angle, - int32_t end_angle, lv_grad_extend_t extend); - -/** - * Calculate constants from the given parameters that are used during rendering - * @param dsc gradient descriptor - */ -void lv_gradient_linear_setup(lv_grad_dsc_t * dsc, const lv_area_t * coords); - -/** - * Free up the allocated memory for the gradient calculation - * @param dsc gradient descriptor - */ -void lv_gradient_linear_cleanup(lv_grad_dsc_t * dsc); - -/** - * Calculate a line segment of a linear gradient - * @param dsc gradient descriptor - * @param xp starting point x coordinate in gradient space - * @param yp starting point y coordinate in gradient space - * @param width width of the line segment in pixels - * @param result color buffer for the resulting line segment - */ -void /* LV_ATTRIBUTE_FAST_MEM */ lv_gradient_linear_get_line(lv_grad_dsc_t * dsc, int32_t xp, int32_t yp, int32_t width, - lv_grad_t * result); - -/** - * Calculate constants from the given parameters that are used during rendering - * @param dsc gradient descriptor - */ -void lv_gradient_radial_setup(lv_grad_dsc_t * dsc, const lv_area_t * coords); - -/** - * Free up the allocated memory for the gradient calculation - * @param dsc gradient descriptor - */ -void lv_gradient_radial_cleanup(lv_grad_dsc_t * dsc); - -/** - * Calculate a line segment of a radial gradient - * @param dsc gradient descriptor - * @param xp starting point x coordinate in gradient space - * @param yp starting point y coordinate in gradient space - * @param width width of the line segment in pixels - * @param result color buffer for the resulting line segment - */ -void /* LV_ATTRIBUTE_FAST_MEM */ lv_gradient_radial_get_line(lv_grad_dsc_t * dsc, int32_t xp, int32_t yp, int32_t width, - lv_grad_t * result); - -/** - * Calculate constants from the given parameters that are used during rendering - * @param dsc gradient descriptor - */ -void lv_gradient_conical_setup(lv_grad_dsc_t * dsc, const lv_area_t * coords); - -/** - * Free up the allocated memory for the gradient calculation - * @param dsc gradient descriptor - */ -void lv_gradient_conical_cleanup(lv_grad_dsc_t * dsc); - -/** - * Calculate a line segment of a conical gradient - * @param dsc gradient descriptor - * @param xp starting point x coordinate in gradient space - * @param yp starting point y coordinate in gradient space - * @param width width of the line segment in pixels - * @param result color buffer for the resulting line segment - */ -void /* LV_ATTRIBUTE_FAST_MEM */ lv_gradient_conical_get_line(lv_grad_dsc_t * dsc, int32_t xp, int32_t yp, - int32_t width, - lv_grad_t * result); - -#endif /*LV_USE_DRAW_SW_COMPLEX_GRADIENTS*/ - -#endif /*LV_USE_DRAW_SW*/ - #ifdef __cplusplus } /*extern "C"*/ #endif diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_img.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_img.c index b7341cc..7181c15 100644 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_img.c +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_img.c @@ -1,51 +1,23 @@ -/** - * @file lv_draw_sw_img.c +/** + * @file lv_draw_img.c * */ /********************* * INCLUDES *********************/ -#include "../../misc/lv_area_private.h" -#include "blend/lv_draw_sw_blend_private.h" -#include "../lv_image_decoder_private.h" -#include "../lv_draw_image_private.h" -#include "../lv_draw_private.h" #include "lv_draw_sw.h" -#if LV_USE_DRAW_SW - -#include "../../display/lv_display.h" -#include "../../display/lv_display_private.h" +#include "../lv_img_cache.h" +#include "../../hal/lv_hal_disp.h" #include "../../misc/lv_log.h" -#include "../../core/lv_refr_private.h" -#include "../../stdlib/lv_mem.h" +#include "../../core/lv_refr.h" +#include "../../misc/lv_mem.h" #include "../../misc/lv_math.h" -#include "../../misc/lv_color.h" -#include "../../stdlib/lv_string.h" -#include "../../core/lv_global.h" - -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM - #include "arm2d/lv_draw_sw_helium.h" -#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM - #include LV_DRAW_SW_ASM_CUSTOM_INCLUDE -#endif /********************* * DEFINES *********************/ -#define MAX_BUF_SIZE (uint32_t) (4 * lv_display_get_horizontal_resolution(lv_refr_get_disp_refreshing()) * lv_color_format_get_size(lv_display_get_color_format(lv_refr_get_disp_refreshing()))) - -#ifndef LV_DRAW_SW_IMAGE - #define LV_DRAW_SW_IMAGE(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB565_RECOLOR - #define LV_DRAW_SW_RGB565_RECOLOR(...) LV_RESULT_INVALID -#endif - -#ifndef LV_DRAW_SW_RGB888_RECOLOR - #define LV_DRAW_SW_RGB888_RECOLOR(...) LV_RESULT_INVALID -#endif +#define MAX_BUF_SIZE (uint32_t) lv_disp_get_hor_res(_lv_refr_get_disp_refreshing()) /********************** * TYPEDEFS @@ -54,15 +26,12 @@ /********************** * STATIC PROTOTYPES **********************/ - -static void img_draw_core(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_image_decoder_dsc_t * decoder_dsc, lv_draw_image_sup_t * sup, - const lv_area_t * img_coords, const lv_area_t * clipped_img_area); +static void convert_cb(const lv_area_t * dest_area, const void * src_buf, lv_coord_t src_w, lv_coord_t src_h, + lv_coord_t src_stride, const lv_draw_img_dsc_t * draw_dsc, lv_img_cf_t cf, lv_color_t * cbuf, lv_opa_t * abuf); /********************** * STATIC VARIABLES **********************/ -#define _draw_info LV_GLOBAL_DEFAULT()->draw_info /********************** * MACROS @@ -72,396 +41,259 @@ static void img_draw_core(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * GLOBAL FUNCTIONS **********************/ -void lv_draw_sw_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, const lv_area_t * coords) -{ - lv_layer_t * layer_to_draw = (lv_layer_t *)draw_dsc->src; - - /*It can happen that nothing was draw on a layer and therefore its buffer is not allocated. - *In this case just return. */ - if(layer_to_draw->draw_buf == NULL) return; - - lv_draw_image_dsc_t new_draw_dsc = *draw_dsc; - new_draw_dsc.src = layer_to_draw->draw_buf; - lv_draw_sw_image(draw_unit, &new_draw_dsc, coords); -#if LV_USE_LAYER_DEBUG || LV_USE_PARALLEL_DRAW_DEBUG - lv_area_t area_rot; - lv_area_copy(&area_rot, coords); - if(draw_dsc->rotation || draw_dsc->scale_x != LV_SCALE_NONE || draw_dsc->scale_y != LV_SCALE_NONE) { - int32_t w = lv_area_get_width(coords); - int32_t h = lv_area_get_height(coords); - - lv_image_buf_get_transformed_area(&area_rot, w, h, draw_dsc->rotation, draw_dsc->scale_x, draw_dsc->scale_y, - &draw_dsc->pivot); - - area_rot.x1 += coords->x1; - area_rot.y1 += coords->y1; - area_rot.x2 += coords->x1; - area_rot.y2 += coords->y1; - } - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, &area_rot, draw_unit->clip_area)) return; -#endif - -#if LV_USE_LAYER_DEBUG - { - lv_draw_fill_dsc_t fill_dsc; - lv_draw_fill_dsc_init(&fill_dsc); - fill_dsc.color = lv_color_hex(layer_to_draw->color_format == LV_COLOR_FORMAT_ARGB8888 ? 0xff0000 : 0x00ff00); - fill_dsc.opa = LV_OPA_20; - lv_draw_sw_fill(draw_unit, &fill_dsc, &area_rot); - - lv_draw_border_dsc_t border_dsc; - lv_draw_border_dsc_init(&border_dsc); - border_dsc.color = fill_dsc.color; - border_dsc.opa = LV_OPA_60; - border_dsc.width = 2; - lv_draw_sw_border(draw_unit, &border_dsc, &area_rot); - } -#endif - -#if LV_USE_PARALLEL_DRAW_DEBUG - { - uint32_t idx = 0; - lv_draw_unit_t * draw_unit_tmp = _draw_info.unit_head; - while(draw_unit_tmp != draw_unit) { - draw_unit_tmp = draw_unit_tmp->next; - idx++; - } - lv_draw_fill_dsc_t fill_dsc; - lv_draw_fill_dsc_init(&fill_dsc); - fill_dsc.color = lv_palette_main(idx % LV_PALETTE_LAST); - fill_dsc.opa = LV_OPA_10; - lv_draw_sw_fill(draw_unit, &fill_dsc, &area_rot); - - lv_draw_border_dsc_t border_dsc; - lv_draw_border_dsc_init(&border_dsc); - border_dsc.color = lv_palette_main(idx % LV_PALETTE_LAST); - border_dsc.opa = LV_OPA_100; - border_dsc.width = 2; - lv_draw_sw_border(draw_unit, &border_dsc, &area_rot); - - lv_point_t txt_size; - lv_text_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE); - - lv_area_t txt_area; - txt_area.x1 = draw_area.x1; - txt_area.x2 = draw_area.x1 + txt_size.x - 1; - txt_area.y2 = draw_area.y2; - txt_area.y1 = draw_area.y2 - txt_size.y + 1; - - lv_draw_fill_dsc_init(&fill_dsc); - fill_dsc.color = lv_color_black(); - lv_draw_sw_fill(draw_unit, &fill_dsc, &txt_area); - - char buf[8]; - lv_snprintf(buf, sizeof(buf), "%d", idx); - lv_draw_label_dsc_t label_dsc; - lv_draw_label_dsc_init(&label_dsc); - label_dsc.color = lv_color_white(); - label_dsc.text = buf; - lv_draw_sw_label(draw_unit, &label_dsc, &txt_area); - } -#endif -} - -void lv_draw_sw_image(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords) -{ - if(!draw_dsc->tile) { - lv_draw_image_normal_helper(draw_unit, draw_dsc, coords, img_draw_core); - } - else { - lv_draw_image_tiled_helper(draw_unit, draw_dsc, coords, img_draw_core); - } -} -/********************** - * STATIC FUNCTIONS - **********************/ - -static void img_draw_core(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_image_decoder_dsc_t * decoder_dsc, lv_draw_image_sup_t * sup, - const lv_area_t * img_coords, const lv_area_t * clipped_img_area) +void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_img_decoded(struct _lv_draw_ctx_t * draw_ctx, + const lv_draw_img_dsc_t * draw_dsc, + const lv_area_t * coords, const uint8_t * src_buf, + lv_img_cf_t cf) { - bool transformed = draw_dsc->rotation != 0 || draw_dsc->scale_x != LV_SCALE_NONE || - draw_dsc->scale_y != LV_SCALE_NONE ? true : false; + /*Use the clip area as draw area*/ + lv_area_t draw_area; + lv_area_copy(&draw_area, draw_ctx->clip_area); - bool masked = draw_dsc->bitmap_mask_src != NULL; + bool mask_any = lv_draw_mask_is_any(&draw_area); + bool transform = draw_dsc->angle != 0 || draw_dsc->zoom != LV_IMG_ZOOM_NONE ? true : false; + lv_area_t blend_area; lv_draw_sw_blend_dsc_t blend_dsc; - const lv_draw_buf_t * decoded = decoder_dsc->decoded; - const uint8_t * src_buf = decoded->data; - const lv_image_header_t * header = &decoded->header; - uint32_t img_stride = decoded->header.stride; - lv_color_format_t cf = decoded->header.cf; - lv_memzero(&blend_dsc, sizeof(lv_draw_sw_blend_dsc_t)); + lv_memset_00(&blend_dsc, sizeof(lv_draw_sw_blend_dsc_t)); blend_dsc.opa = draw_dsc->opa; blend_dsc.blend_mode = draw_dsc->blend_mode; - blend_dsc.src_stride = img_stride; + blend_dsc.blend_area = &blend_area; + + /*The simplest case just copy the pixels into the draw_buf*/ + if(!mask_any && !transform && cf == LV_IMG_CF_TRUE_COLOR && draw_dsc->recolor_opa == LV_OPA_TRANSP) { + blend_dsc.src_buf = (const lv_color_t *)src_buf; - if(!transformed && !masked && cf == LV_COLOR_FORMAT_A8) { + blend_dsc.blend_area = coords; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + else if(!mask_any && !transform && cf == LV_IMG_CF_ALPHA_8BIT) { lv_area_t clipped_coords; - if(!lv_area_intersect(&clipped_coords, img_coords, draw_unit->clip_area)) return; + if(!_lv_area_intersect(&clipped_coords, coords, draw_ctx->clip_area)) return; blend_dsc.mask_buf = (lv_opa_t *)src_buf; - blend_dsc.mask_area = img_coords; - blend_dsc.mask_stride = img_stride; + blend_dsc.mask_area = coords; blend_dsc.src_buf = NULL; blend_dsc.color = draw_dsc->recolor; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; - blend_dsc.blend_area = img_coords; - lv_draw_sw_blend(draw_unit, &blend_dsc); + blend_dsc.blend_area = coords; + lv_draw_sw_blend(draw_ctx, &blend_dsc); } - else if(!transformed && !masked && cf == LV_COLOR_FORMAT_RGB565A8 && draw_dsc->recolor_opa <= LV_OPA_MIN) { - int32_t src_h = lv_area_get_height(img_coords); - int32_t src_w = lv_area_get_width(img_coords); - blend_dsc.src_area = img_coords; - blend_dsc.src_buf = src_buf; +#if LV_COLOR_DEPTH == 16 + else if(!mask_any && !transform && cf == LV_IMG_CF_RGB565A8 && draw_dsc->recolor_opa == LV_OPA_TRANSP) { + lv_coord_t src_w = lv_area_get_width(coords); + lv_coord_t src_h = lv_area_get_height(coords); + blend_dsc.src_buf = (const lv_color_t *)src_buf; blend_dsc.mask_buf = (lv_opa_t *)src_buf; - blend_dsc.mask_buf += img_stride * src_w / header->w * src_h; - /** - * Note, for RGB565A8, lacking of stride parameter, we always use - * always half of RGB map stride as alpha map stride. The image should - * be generated in this way too. - */ - blend_dsc.mask_stride = img_stride / 2; - blend_dsc.blend_area = img_coords; - blend_dsc.mask_area = img_coords; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - blend_dsc.src_color_format = LV_COLOR_FORMAT_RGB565; - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - /*The simplest case just copy the pixels into the draw_buf. Blending will convert the colors if needed*/ - else if(!transformed && !masked && draw_dsc->recolor_opa <= LV_OPA_MIN) { - blend_dsc.src_area = img_coords; - blend_dsc.src_buf = src_buf; - blend_dsc.blend_area = img_coords; - blend_dsc.src_color_format = cf; - lv_draw_sw_blend(draw_unit, &blend_dsc); + blend_dsc.mask_buf += sizeof(lv_color_t) * src_w * src_h; + blend_dsc.blend_area = coords; + blend_dsc.mask_area = coords; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_sw_blend(draw_ctx, &blend_dsc); } - /*Handle masked RGB565, RGB888, XRGB888, or ARGB8888 images*/ - else if(!transformed && masked && draw_dsc->recolor_opa <= LV_OPA_MIN) { - lv_image_decoder_dsc_t mask_decoder_dsc; - lv_area_t mask_area; - lv_result_t decoder_res = lv_image_decoder_open(&mask_decoder_dsc, draw_dsc->bitmap_mask_src, NULL); - if(decoder_res == LV_RESULT_OK && mask_decoder_dsc.decoded) { - if(mask_decoder_dsc.decoded->header.cf == LV_COLOR_FORMAT_A8 || - mask_decoder_dsc.decoded->header.cf == LV_COLOR_FORMAT_L8) { - const lv_draw_buf_t * mask_img = mask_decoder_dsc.decoded; - blend_dsc.mask_buf = mask_img->data; - blend_dsc.mask_stride = mask_img->header.stride; - - const lv_area_t * image_area; - if(lv_area_get_width(&draw_dsc->image_area) < 0) image_area = img_coords; - else image_area = &draw_dsc->image_area; - lv_area_set(&mask_area, 0, 0, mask_img->header.w - 1, mask_img->header.h - 1); - lv_area_align(image_area, &mask_area, LV_ALIGN_CENTER, 0, 0); - blend_dsc.mask_area = &mask_area; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - else { - LV_LOG_WARN("The mask image is not A8/L8 format. Drawing the image without mask."); - } +#endif + /*In the other cases every pixel need to be checked one-by-one*/ + else { + blend_area.x1 = draw_ctx->clip_area->x1; + blend_area.x2 = draw_ctx->clip_area->x2; + blend_area.y1 = draw_ctx->clip_area->y1; + blend_area.y2 = draw_ctx->clip_area->y2; + + lv_coord_t src_w = lv_area_get_width(coords); + lv_coord_t src_h = lv_area_get_height(coords); + lv_coord_t blend_h = lv_area_get_height(&blend_area); + lv_coord_t blend_w = lv_area_get_width(&blend_area); + + uint32_t max_buf_size = MAX_BUF_SIZE; + uint32_t blend_size = lv_area_get_size(&blend_area); + uint32_t buf_h; + uint32_t buf_w = blend_w; + if(blend_size <= max_buf_size) { + buf_h = blend_h; } else { - LV_LOG_WARN("Couldn't decode the mask image. Drawing the image without mask."); - } - - blend_dsc.src_area = img_coords; - blend_dsc.src_buf = src_buf; - blend_dsc.blend_area = img_coords; - blend_dsc.src_color_format = cf; - lv_draw_sw_blend(draw_unit, &blend_dsc); - - if(decoder_res == LV_RESULT_OK) lv_image_decoder_close(&mask_decoder_dsc); - } - /* check whether it is possible to accelerate the operation in synchronous mode */ - else if(LV_RESULT_INVALID == LV_DRAW_SW_IMAGE(transformed, /* whether require transform */ - cf, /* image format */ - src_buf, /* image buffer */ - img_coords, /* src_h, src_w, src_x1, src_y1 */ - img_stride, /* image stride */ - clipped_img_area, /* blend area */ - draw_unit, /* target buffer, buffer width, buffer height, buffer stride */ - draw_dsc)) { /* opa, recolour_opa and colour */ - /*In the other cases every pixel need to be checked one-by-one*/ - - lv_area_t blend_area = *clipped_img_area; - blend_dsc.blend_area = &blend_area; - - int32_t src_w = lv_area_get_width(img_coords); - int32_t src_h = lv_area_get_height(img_coords); - int32_t blend_w = lv_area_get_width(&blend_area); - int32_t blend_h = lv_area_get_height(&blend_area); - - lv_color_format_t cf_final = cf; - if((cf == LV_COLOR_FORMAT_L8) && (draw_dsc->recolor_opa > LV_OPA_MIN)) { - cf_final = LV_COLOR_FORMAT_ARGB8888; - } - if(transformed) { - if(cf_final == LV_COLOR_FORMAT_RGB888 || cf_final == LV_COLOR_FORMAT_XRGB8888) cf_final = LV_COLOR_FORMAT_ARGB8888; - else if(cf_final == LV_COLOR_FORMAT_RGB565) cf_final = LV_COLOR_FORMAT_RGB565A8; - else if(cf_final == LV_COLOR_FORMAT_L8) cf_final = LV_COLOR_FORMAT_AL88; + /*Round to full lines*/ + buf_h = max_buf_size / blend_w; } - uint8_t * tmp_buf; - uint32_t px_size = lv_color_format_get_size(cf_final); - int32_t buf_h; - if(cf_final == LV_COLOR_FORMAT_RGB565A8) { - uint32_t buf_stride = blend_w * 3; - buf_h = MAX_BUF_SIZE / buf_stride; - if(buf_h > blend_h) buf_h = blend_h; - tmp_buf = lv_malloc(buf_stride * buf_h); - } - else { - uint32_t buf_stride = blend_w * lv_color_format_get_size(cf_final); - buf_h = MAX_BUF_SIZE / buf_stride; - if(buf_h > blend_h) buf_h = blend_h; - tmp_buf = lv_malloc(buf_stride * buf_h); - } - LV_ASSERT_MALLOC(tmp_buf); + /*Create buffers and masks*/ + uint32_t buf_size = buf_w * buf_h; - blend_dsc.src_buf = tmp_buf; - blend_dsc.src_color_format = cf_final; - int32_t y_last = blend_area.y2; + lv_color_t * rgb_buf = lv_mem_buf_get(buf_size * sizeof(lv_color_t)); + lv_opa_t * mask_buf = lv_mem_buf_get(buf_size); + blend_dsc.mask_buf = mask_buf; + blend_dsc.mask_area = &blend_area; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + blend_dsc.src_buf = rgb_buf; + lv_coord_t y_last = blend_area.y2; blend_area.y2 = blend_area.y1 + buf_h - 1; - blend_dsc.src_area = &blend_area; - if(cf_final == LV_COLOR_FORMAT_RGB565A8) { - /*RGB565A8 images will blended as RGB565 + mask - *Therefore the stride can be different. */ - blend_dsc.src_stride = blend_w * 2; - blend_dsc.mask_buf = tmp_buf + blend_w * 2 * buf_h; - blend_dsc.mask_stride = blend_w; - blend_dsc.mask_area = &blend_area; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - blend_dsc.src_color_format = LV_COLOR_FORMAT_RGB565; - } - else if(cf_final == LV_COLOR_FORMAT_A8) { - blend_dsc.mask_buf = blend_dsc.src_buf; - blend_dsc.mask_stride = blend_w; - blend_dsc.mask_area = &blend_area; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - blend_dsc.color = draw_dsc->recolor; - blend_dsc.src_buf = NULL; - } - else { - blend_dsc.src_stride = blend_w * lv_color_format_get_size(cf_final); - } + lv_draw_mask_res_t mask_res_def = (cf != LV_IMG_CF_TRUE_COLOR || draw_dsc->angle || + draw_dsc->zoom != LV_IMG_ZOOM_NONE) ? + LV_DRAW_MASK_RES_CHANGED : LV_DRAW_MASK_RES_FULL_COVER; + blend_dsc.mask_res = mask_res_def; while(blend_area.y1 <= y_last) { /*Apply transformations if any or separate the channels*/ - lv_area_t relative_area; - lv_area_copy(&relative_area, &blend_area); - lv_area_move(&relative_area, -img_coords->x1, -img_coords->y1); - if(transformed) { - lv_draw_sw_transform(draw_unit, &relative_area, src_buf, src_w, src_h, img_stride, - draw_dsc, sup, cf, tmp_buf); + lv_area_t transform_area; + lv_area_copy(&transform_area, &blend_area); + lv_area_move(&transform_area, -coords->x1, -coords->y1); + if(transform) { + lv_draw_transform(draw_ctx, &transform_area, src_buf, src_w, src_h, src_w, + draw_dsc, cf, rgb_buf, mask_buf); } - else if(draw_dsc->recolor_opa >= LV_OPA_MIN) { - int32_t h = lv_area_get_height(&relative_area); - if(cf == LV_COLOR_FORMAT_L8) { - /* L8 is recolored, but not transformed: copy L8 image into ARGB8888 temporary buffer */ - const uint8_t * src_buf_tmp = src_buf + img_stride * relative_area.y1 + relative_area.x1 * 1; - lv_color32_t * dest_buf_tmp = (lv_color32_t *)tmp_buf; - int32_t i, x; - for(i = 0; i < h; i++) { - for(x = 0; x < blend_w; x++) { - dest_buf_tmp[x].red = src_buf_tmp[x]; - dest_buf_tmp[x].green = src_buf_tmp[x]; - dest_buf_tmp[x].blue = src_buf_tmp[x]; - dest_buf_tmp[x].alpha = 255; - } - dest_buf_tmp += blend_w; - src_buf_tmp += img_stride; - } - } - else if(cf_final == LV_COLOR_FORMAT_RGB565A8) { - uint32_t stride_px = img_stride / 2; - const uint8_t * rgb_src_buf = src_buf + stride_px * 2 * relative_area.y1 + relative_area.x1 * 2; - const uint8_t * a_src_buf = src_buf + stride_px * 2 * src_h + stride_px * relative_area.y1 + - relative_area.x1; - uint8_t * rgb_dest_buf = tmp_buf; - uint8_t * a_dest_buf = (uint8_t *)blend_dsc.mask_buf; - int32_t i; - for(i = 0; i < h; i++) { - lv_memcpy(rgb_dest_buf, rgb_src_buf, blend_w * 2); - lv_memcpy(a_dest_buf, a_src_buf, blend_w); - rgb_src_buf += stride_px * 2; - a_src_buf += stride_px; - rgb_dest_buf += blend_w * 2; - a_dest_buf += blend_w; - } - } - else if(cf_final != LV_COLOR_FORMAT_A8) { - const uint8_t * src_buf_tmp = src_buf + img_stride * relative_area.y1 + relative_area.x1 * px_size; - uint8_t * dest_buf_tmp = tmp_buf; - int32_t i; - for(i = 0; i < h; i++) { - lv_memcpy(dest_buf_tmp, src_buf_tmp, blend_w * px_size); - dest_buf_tmp += blend_w * px_size; - src_buf_tmp += img_stride; - } - } + else { + convert_cb(&transform_area, src_buf, src_w, src_h, src_w, draw_dsc, cf, rgb_buf, mask_buf); } /*Apply recolor*/ if(draw_dsc->recolor_opa > LV_OPA_MIN) { - lv_color_t color = draw_dsc->recolor; - lv_opa_t mix = draw_dsc->recolor_opa; - lv_opa_t mix_inv = 255 - mix; - if(cf_final == LV_COLOR_FORMAT_RGB565A8 || cf_final == LV_COLOR_FORMAT_RGB565) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_RECOLOR(tmp_buf, blend_area, color, mix)) { - uint16_t c_mult[3]; - c_mult[0] = (color.blue >> 3) * mix; - c_mult[1] = (color.green >> 2) * mix; - c_mult[2] = (color.red >> 3) * mix; - uint16_t * buf16 = (uint16_t *)tmp_buf; - int32_t i; - int32_t size = lv_area_get_size(&blend_area); - for(i = 0; i < size; i++) { - buf16[i] = (((c_mult[2] + ((buf16[i] >> 11) & 0x1F) * mix_inv) << 3) & 0xF800) + - (((c_mult[1] + ((buf16[i] >> 5) & 0x3F) * mix_inv) >> 3) & 0x07E0) + - ((c_mult[0] + (buf16[i] & 0x1F) * mix_inv) >> 8); - } - } + uint16_t premult_v[3]; + lv_opa_t recolor_opa = draw_dsc->recolor_opa; + lv_color_t recolor = draw_dsc->recolor; + lv_color_premult(recolor, recolor_opa, premult_v); + recolor_opa = 255 - recolor_opa; + uint32_t i; + for(i = 0; i < buf_size; i++) { + rgb_buf[i] = lv_color_mix_premult(premult_v, rgb_buf[i], recolor_opa); } - else if(cf_final != LV_COLOR_FORMAT_A8) { - if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_RECOLOR(tmp_buf, blend_area, color, mix, cf_final)) { - uint32_t size = lv_area_get_size(&blend_area); - uint32_t i; - uint16_t c_mult[3]; - c_mult[0] = color.blue * mix; - c_mult[1] = color.green * mix; - c_mult[2] = color.red * mix; - uint8_t * tmp_buf_2 = tmp_buf; - for(i = 0; i < (uint32_t)(size * px_size); i += px_size) { - tmp_buf_2[i + 0] = (c_mult[0] + (tmp_buf_2[i + 0] * mix_inv)) >> 8; - tmp_buf_2[i + 1] = (c_mult[1] + (tmp_buf_2[i + 1] * mix_inv)) >> 8; - tmp_buf_2[i + 2] = (c_mult[2] + (tmp_buf_2[i + 2] * mix_inv)) >> 8; - } + } +#if LV_DRAW_COMPLEX + /*Apply the masks if any*/ + if(mask_any) { + lv_coord_t y; + lv_opa_t * mask_buf_tmp = mask_buf; + for(y = blend_area.y1; y <= blend_area.y2; y++) { + lv_draw_mask_res_t mask_res_line; + mask_res_line = lv_draw_mask_apply(mask_buf_tmp, blend_area.x1, y, blend_w); + + if(mask_res_line == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(mask_buf_tmp, blend_w); + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; } + else if(mask_res_line == LV_DRAW_MASK_RES_CHANGED) { + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + } + mask_buf_tmp += blend_w; } } +#endif /*Blend*/ - lv_draw_sw_blend(draw_unit, &blend_dsc); + lv_draw_sw_blend(draw_ctx, &blend_dsc); - /*Go to the next area*/ + /*Go the the next lines*/ blend_area.y1 = blend_area.y2 + 1; blend_area.y2 = blend_area.y1 + buf_h - 1; - if(blend_area.y2 > y_last) { - blend_area.y2 = y_last; - if(cf_final == LV_COLOR_FORMAT_RGB565A8) { - blend_dsc.mask_buf = tmp_buf + blend_w * 2 * lv_area_get_height(&blend_area); - } - } + if(blend_area.y2 > y_last) blend_area.y2 = y_last; } - lv_free(tmp_buf); + lv_mem_buf_release(mask_buf); + lv_mem_buf_release(rgb_buf); } } -#endif /*LV_USE_DRAW_SW*/ +/********************** + * STATIC FUNCTIONS + **********************/ + +/* Separate the image channels to RGB and Alpha to match LV_COLOR_DEPTH settings*/ +static void convert_cb(const lv_area_t * dest_area, const void * src_buf, lv_coord_t src_w, lv_coord_t src_h, + lv_coord_t src_stride, const lv_draw_img_dsc_t * draw_dsc, lv_img_cf_t cf, lv_color_t * cbuf, lv_opa_t * abuf) +{ + LV_UNUSED(draw_dsc); + LV_UNUSED(src_h); + LV_UNUSED(src_w); + + const uint8_t * src_tmp8 = (const uint8_t *)src_buf; + lv_coord_t y; + lv_coord_t x; + + if(cf == LV_IMG_CF_TRUE_COLOR || cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { + uint32_t px_cnt = lv_area_get_size(dest_area); + lv_memset_ff(abuf, px_cnt); + + src_tmp8 += (src_stride * dest_area->y1 * sizeof(lv_color_t)) + dest_area->x1 * sizeof(lv_color_t); + uint32_t dest_w = lv_area_get_width(dest_area); + uint32_t dest_w_byte = dest_w * sizeof(lv_color_t); + + lv_coord_t src_stride_byte = src_stride * sizeof(lv_color_t); + lv_color_t * cbuf_tmp = cbuf; + for(y = dest_area->y1; y <= dest_area->y2; y++) { + lv_memcpy(cbuf_tmp, src_tmp8, dest_w_byte); + src_tmp8 += src_stride_byte; + cbuf_tmp += dest_w; + } + + /*Make "holes" for with Chroma keying*/ + if(cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { + uint32_t i; + lv_color_t chk = LV_COLOR_CHROMA_KEY; +#if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1 + uint8_t * cbuf_uint = (uint8_t *)cbuf; + uint8_t chk_v = chk.full; +#elif LV_COLOR_DEPTH == 16 + uint16_t * cbuf_uint = (uint16_t *)cbuf; + uint16_t chk_v = chk.full; +#elif LV_COLOR_DEPTH == 32 + uint32_t * cbuf_uint = (uint32_t *)cbuf; + uint32_t chk_v = chk.full; +#endif + for(i = 0; i < px_cnt; i++) { + if(chk_v == cbuf_uint[i]) abuf[i] = 0x00; + } + } + } + else if(cf == LV_IMG_CF_TRUE_COLOR_ALPHA) { + src_tmp8 += (src_stride * dest_area->y1 * LV_IMG_PX_SIZE_ALPHA_BYTE) + dest_area->x1 * LV_IMG_PX_SIZE_ALPHA_BYTE; + + lv_coord_t src_new_line_step_px = (src_stride - lv_area_get_width(dest_area)); + lv_coord_t src_new_line_step_byte = src_new_line_step_px * LV_IMG_PX_SIZE_ALPHA_BYTE; + + lv_coord_t dest_h = lv_area_get_height(dest_area); + lv_coord_t dest_w = lv_area_get_width(dest_area); + for(y = 0; y < dest_h; y++) { + for(x = 0; x < dest_w; x++) { + abuf[x] = src_tmp8[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; +#if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1 + cbuf[x].full = *src_tmp8; +#elif LV_COLOR_DEPTH == 16 + cbuf[x].full = *src_tmp8 + ((*(src_tmp8 + 1)) << 8); +#elif LV_COLOR_DEPTH == 32 + cbuf[x] = *((lv_color_t *) src_tmp8); + cbuf[x].ch.alpha = 0xff; +#endif + src_tmp8 += LV_IMG_PX_SIZE_ALPHA_BYTE; + + } + cbuf += dest_w; + abuf += dest_w; + src_tmp8 += src_new_line_step_byte; + } + } + else if(cf == LV_IMG_CF_RGB565A8) { + src_tmp8 += (src_stride * dest_area->y1 * sizeof(lv_color_t)) + dest_area->x1 * sizeof(lv_color_t); + + lv_coord_t src_stride_byte = src_stride * sizeof(lv_color_t); + + lv_coord_t dest_h = lv_area_get_height(dest_area); + lv_coord_t dest_w = lv_area_get_width(dest_area); + for(y = 0; y < dest_h; y++) { + lv_memcpy(cbuf, src_tmp8, dest_w * sizeof(lv_color_t)); + cbuf += dest_w; + src_tmp8 += src_stride_byte; + } + + src_tmp8 = (const uint8_t *)src_buf; + src_tmp8 += sizeof(lv_color_t) * src_w * src_h; + src_tmp8 += src_stride * dest_area->y1 + dest_area->x1; + for(y = 0; y < dest_h; y++) { + lv_memcpy(abuf, src_tmp8, dest_w); + abuf += dest_w; + src_tmp8 += src_stride; + } + } +} diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_layer.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_layer.c new file mode 100644 index 0000000..b53c662 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_layer.c @@ -0,0 +1,150 @@ +/** + * @file lv_draw_sw_layer.h + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_draw_sw.h" +#include "../../hal/lv_hal_disp.h" +#include "../../misc/lv_area.h" +#include "../../core/lv_refr.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * GLOBAL VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + + +struct _lv_draw_layer_ctx_t * lv_draw_sw_layer_create(struct _lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx, + lv_draw_layer_flags_t flags) +{ + if(LV_COLOR_SCREEN_TRANSP == 0 && (flags & LV_DRAW_LAYER_FLAG_HAS_ALPHA)) { + LV_LOG_WARN("Rendering this widget needs LV_COLOR_SCREEN_TRANSP 1"); + return NULL; + } + + lv_draw_sw_layer_ctx_t * layer_sw_ctx = (lv_draw_sw_layer_ctx_t *) layer_ctx; + uint32_t px_size = flags & LV_DRAW_LAYER_FLAG_HAS_ALPHA ? LV_IMG_PX_SIZE_ALPHA_BYTE : sizeof(lv_color_t); + if(flags & LV_DRAW_LAYER_FLAG_CAN_SUBDIVIDE) { + layer_sw_ctx->buf_size_bytes = LV_LAYER_SIMPLE_BUF_SIZE; + uint32_t full_size = lv_area_get_size(&layer_sw_ctx->base_draw.area_full) * px_size; + if(layer_sw_ctx->buf_size_bytes > full_size) layer_sw_ctx->buf_size_bytes = full_size; + layer_sw_ctx->base_draw.buf = lv_mem_alloc(layer_sw_ctx->buf_size_bytes); + if(layer_sw_ctx->base_draw.buf == NULL) { + LV_LOG_WARN("Cannot allocate %"LV_PRIu32" bytes for layer buffer. Allocating %"LV_PRIu32" bytes instead. (Reduced performance)", + (uint32_t)layer_sw_ctx->buf_size_bytes, (uint32_t)LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE * px_size); + layer_sw_ctx->buf_size_bytes = LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE; + layer_sw_ctx->base_draw.buf = lv_mem_alloc(layer_sw_ctx->buf_size_bytes); + if(layer_sw_ctx->base_draw.buf == NULL) { + return NULL; + } + } + layer_sw_ctx->base_draw.area_act = layer_sw_ctx->base_draw.area_full; + layer_sw_ctx->base_draw.area_act.y2 = layer_sw_ctx->base_draw.area_full.y1; + lv_coord_t w = lv_area_get_width(&layer_sw_ctx->base_draw.area_act); + layer_sw_ctx->base_draw.max_row_with_alpha = layer_sw_ctx->buf_size_bytes / w / LV_IMG_PX_SIZE_ALPHA_BYTE; + layer_sw_ctx->base_draw.max_row_with_no_alpha = layer_sw_ctx->buf_size_bytes / w / sizeof(lv_color_t); + } + else { + layer_sw_ctx->base_draw.area_act = layer_sw_ctx->base_draw.area_full; + layer_sw_ctx->buf_size_bytes = lv_area_get_size(&layer_sw_ctx->base_draw.area_full) * px_size; + layer_sw_ctx->base_draw.buf = lv_mem_alloc(layer_sw_ctx->buf_size_bytes); + lv_memset_00(layer_sw_ctx->base_draw.buf, layer_sw_ctx->buf_size_bytes); + layer_sw_ctx->has_alpha = flags & LV_DRAW_LAYER_FLAG_HAS_ALPHA ? 1 : 0; + if(layer_sw_ctx->base_draw.buf == NULL) { + return NULL; + } + + draw_ctx->buf = layer_sw_ctx->base_draw.buf; + draw_ctx->buf_area = &layer_sw_ctx->base_draw.area_act; + draw_ctx->clip_area = &layer_sw_ctx->base_draw.area_act; + + lv_disp_t * disp_refr = _lv_refr_get_disp_refreshing(); + disp_refr->driver->screen_transp = flags & LV_DRAW_LAYER_FLAG_HAS_ALPHA ? 1 : 0; + } + + return layer_ctx; +} + +void lv_draw_sw_layer_adjust(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx, + lv_draw_layer_flags_t flags) +{ + + lv_draw_sw_layer_ctx_t * layer_sw_ctx = (lv_draw_sw_layer_ctx_t *) layer_ctx; + lv_disp_t * disp_refr = _lv_refr_get_disp_refreshing(); + if(flags & LV_DRAW_LAYER_FLAG_HAS_ALPHA) { + lv_memset_00(layer_ctx->buf, layer_sw_ctx->buf_size_bytes); + layer_sw_ctx->has_alpha = 1; + disp_refr->driver->screen_transp = 1; + } + else { + layer_sw_ctx->has_alpha = 0; + disp_refr->driver->screen_transp = 0; + } + + draw_ctx->buf = layer_ctx->buf; + draw_ctx->buf_area = &layer_ctx->area_act; + draw_ctx->clip_area = &layer_ctx->area_act; +} + +void lv_draw_sw_layer_blend(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx, + const lv_draw_img_dsc_t * draw_dsc) +{ + lv_draw_sw_layer_ctx_t * layer_sw_ctx = (lv_draw_sw_layer_ctx_t *) layer_ctx; + + lv_img_dsc_t img; + img.data = draw_ctx->buf; + img.header.always_zero = 0; + img.header.w = lv_area_get_width(draw_ctx->buf_area); + img.header.h = lv_area_get_height(draw_ctx->buf_area); + img.header.cf = layer_sw_ctx->has_alpha ? LV_IMG_CF_TRUE_COLOR_ALPHA : LV_IMG_CF_TRUE_COLOR; + + /*Restore the original draw_ctx*/ + draw_ctx->buf = layer_ctx->original.buf; + draw_ctx->buf_area = layer_ctx->original.buf_area; + draw_ctx->clip_area = layer_ctx->original.clip_area; + lv_disp_t * disp_refr = _lv_refr_get_disp_refreshing(); + disp_refr->driver->screen_transp = layer_ctx->original.screen_transp; + + /*Blend the layer*/ + lv_draw_img(draw_ctx, draw_dsc, &layer_ctx->area_act, &img); + lv_draw_wait_for_finish(draw_ctx); + lv_img_cache_invalidate_src(&img); +} + +void lv_draw_sw_layer_destroy(lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx) +{ + LV_UNUSED(draw_ctx); + + lv_mem_free(layer_ctx->buf); +} + + +/********************** + * STATIC FUNCTIONS + **********************/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_letter.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_letter.c index 3dec220..ee27bc6 100644 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_letter.c +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_letter.c @@ -6,19 +6,14 @@ /********************* * INCLUDES *********************/ -#include "blend/lv_draw_sw_blend_private.h" -#include "../lv_draw_label_private.h" #include "lv_draw_sw.h" -#if LV_USE_DRAW_SW - -#include "../../display/lv_display.h" +#include "../../hal/lv_hal_disp.h" #include "../../misc/lv_math.h" #include "../../misc/lv_assert.h" #include "../../misc/lv_area.h" #include "../../misc/lv_style.h" #include "../../font/lv_font.h" -#include "../../core/lv_refr_private.h" -#include "../../stdlib/lv_string.h" +#include "../../core/lv_refr.h" /********************* * DEFINES @@ -32,8 +27,14 @@ * STATIC PROTOTYPES **********************/ -static void /* LV_ATTRIBUTE_FAST_MEM */ draw_letter_cb(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * glyph_draw_dsc, - lv_draw_fill_dsc_t * fill_draw_dsc, const lv_area_t * fill_area); +static void /* LV_ATTRIBUTE_FAST_MEM */ draw_letter_normal(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, + const lv_point_t * pos, lv_font_glyph_dsc_t * g, const uint8_t * map_p); + + +#if LV_DRAW_COMPLEX && LV_USE_FONT_SUBPX +static void draw_letter_subpx(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos, + lv_font_glyph_dsc_t * g, const uint8_t * map_p); +#endif /*LV_DRAW_COMPLEX && LV_USE_FONT_SUBPX*/ /********************** * STATIC VARIABLES @@ -43,6 +44,37 @@ static void /* LV_ATTRIBUTE_FAST_MEM */ draw_letter_cb(lv_draw_unit_t * draw_uni * GLOBAL VARIABLES **********************/ +const uint8_t _lv_bpp1_opa_table[2] = {0, 255}; /*Opacity mapping with bpp = 1 (Just for compatibility)*/ +const uint8_t _lv_bpp2_opa_table[4] = {0, 85, 170, 255}; /*Opacity mapping with bpp = 2*/ + +const uint8_t _lv_bpp3_opa_table[8] = {0, 36, 73, 109, /*Opacity mapping with bpp = 3*/ + 146, 182, 219, 255 + }; + +const uint8_t _lv_bpp4_opa_table[16] = {0, 17, 34, 51, /*Opacity mapping with bpp = 4*/ + 68, 85, 102, 119, + 136, 153, 170, 187, + 204, 221, 238, 255 + }; + +const uint8_t _lv_bpp8_opa_table[256] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 + }; + /********************** * MACROS **********************/ @@ -51,78 +83,491 @@ static void /* LV_ATTRIBUTE_FAST_MEM */ draw_letter_cb(lv_draw_unit_t * draw_uni * GLOBAL FUNCTIONS **********************/ -void lv_draw_sw_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc, const lv_area_t * coords) +/** + * Draw a letter in the Virtual Display Buffer + * @param pos_p left-top coordinate of the latter + * @param mask_p the letter will be drawn only on this area (truncated to draw_buf area) + * @param font_p pointer to font + * @param letter a letter to draw + * @param color color of letter + * @param opa opacity of letter (0..255) + */ +void lv_draw_sw_letter(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p, + uint32_t letter) { - if(dsc->opa <= LV_OPA_MIN) return; + lv_font_glyph_dsc_t g; + bool g_ret = lv_font_get_glyph_dsc(dsc->font, &g, letter, '\0'); + if(g_ret == false) { + /*Add warning if the dsc is not found + *but do not print warning for non printable ASCII chars (e.g. '\n')*/ + if(letter >= 0x20 && + letter != 0xf8ff && /*LV_SYMBOL_DUMMY*/ + letter != 0x200c) { /*ZERO WIDTH NON-JOINER*/ + LV_LOG_WARN("lv_draw_letter: glyph dsc. not found for U+%" LV_PRIX32, letter); + +#if LV_USE_FONT_PLACEHOLDER + /* draw placeholder */ + lv_area_t glyph_coords; + lv_draw_rect_dsc_t glyph_dsc; + lv_coord_t begin_x = pos_p->x + g.ofs_x; + lv_coord_t begin_y = pos_p->y + g.ofs_y; + lv_area_set(&glyph_coords, begin_x, begin_y, begin_x + g.box_w, begin_y + g.box_h); + lv_draw_rect_dsc_init(&glyph_dsc); + glyph_dsc.bg_opa = LV_OPA_MIN; + glyph_dsc.outline_opa = LV_OPA_MIN; + glyph_dsc.shadow_opa = LV_OPA_MIN; + glyph_dsc.bg_img_opa = LV_OPA_MIN; + glyph_dsc.border_color = dsc->color; + glyph_dsc.border_width = 1; + draw_ctx->draw_rect(draw_ctx, &glyph_dsc, &glyph_coords); +#endif + } + return; + } - LV_PROFILER_BEGIN; - lv_draw_label_iterate_characters(draw_unit, dsc, coords, draw_letter_cb); - LV_PROFILER_END; + /*Don't draw anything if the character is empty. E.g. space*/ + if((g.box_h == 0) || (g.box_w == 0)) return; + + lv_point_t gpos; + gpos.x = pos_p->x + g.ofs_x; + gpos.y = pos_p->y + (dsc->font->line_height - dsc->font->base_line) - g.box_h - g.ofs_y; + + /*If the letter is completely out of mask don't draw it*/ + if(gpos.x + g.box_w < draw_ctx->clip_area->x1 || + gpos.x > draw_ctx->clip_area->x2 || + gpos.y + g.box_h < draw_ctx->clip_area->y1 || + gpos.y > draw_ctx->clip_area->y2) { + return; + } + + const uint8_t * map_p = lv_font_get_glyph_bitmap(g.resolved_font, letter); + if(map_p == NULL) { + LV_LOG_WARN("lv_draw_letter: character's bitmap not found"); + return; + } + + if(g.resolved_font->subpx) { +#if LV_DRAW_COMPLEX && LV_USE_FONT_SUBPX + draw_letter_subpx(draw_ctx, dsc, &gpos, &g, map_p); +#else + LV_LOG_WARN("Can't draw sub-pixel rendered letter because LV_USE_FONT_SUBPX == 0 in lv_conf.h"); +#endif + } + else { + draw_letter_normal(draw_ctx, dsc, &gpos, &g, map_p); + } } /********************** * STATIC FUNCTIONS **********************/ -static void LV_ATTRIBUTE_FAST_MEM draw_letter_cb(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * glyph_draw_dsc, - lv_draw_fill_dsc_t * fill_draw_dsc, const lv_area_t * fill_area) +static void LV_ATTRIBUTE_FAST_MEM draw_letter_normal(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, + const lv_point_t * pos, lv_font_glyph_dsc_t * g, const uint8_t * map_p) { - if(glyph_draw_dsc) { - switch(glyph_draw_dsc->format) { - case LV_FONT_GLYPH_FORMAT_NONE: { -#if LV_USE_FONT_PLACEHOLDER - /* Draw a placeholder rectangle*/ - lv_draw_border_dsc_t border_draw_dsc; - lv_draw_border_dsc_init(&border_draw_dsc); - border_draw_dsc.opa = glyph_draw_dsc->opa; - border_draw_dsc.color = glyph_draw_dsc->color; - border_draw_dsc.width = 1; - lv_draw_sw_border(draw_unit, &border_draw_dsc, glyph_draw_dsc->bg_coords); + + const uint8_t * bpp_opa_table_p; + uint32_t bitmask_init; + uint32_t bitmask; + uint32_t bpp = g->bpp; + lv_opa_t opa = dsc->opa; + uint32_t shades; + if(bpp == 3) bpp = 4; + +#if LV_USE_IMGFONT + if(bpp == LV_IMGFONT_BPP) { //is imgfont + lv_area_t fill_area; + fill_area.x1 = pos->x; + fill_area.y1 = pos->y; + fill_area.x2 = pos->x + g->box_w - 1; + fill_area.y2 = pos->y + g->box_h - 1; + lv_draw_img_dsc_t img_dsc; + lv_draw_img_dsc_init(&img_dsc); + img_dsc.angle = 0; + img_dsc.zoom = LV_IMG_ZOOM_NONE; + img_dsc.opa = dsc->opa; + img_dsc.blend_mode = dsc->blend_mode; + lv_draw_img(draw_ctx, &img_dsc, &fill_area, map_p); + return; + } +#endif + + switch(bpp) { + case 1: + bpp_opa_table_p = _lv_bpp1_opa_table; + bitmask_init = 0x80; + shades = 2; + break; + case 2: + bpp_opa_table_p = _lv_bpp2_opa_table; + bitmask_init = 0xC0; + shades = 4; + break; + case 4: + bpp_opa_table_p = _lv_bpp4_opa_table; + bitmask_init = 0xF0; + shades = 16; + break; + case 8: + bpp_opa_table_p = _lv_bpp8_opa_table; + bitmask_init = 0xFF; + shades = 256; + break; /*No opa table, pixel value will be used directly*/ + default: + LV_LOG_WARN("lv_draw_letter: invalid bpp"); + return; /*Invalid bpp. Can't render the letter*/ + } + + static lv_opa_t opa_table[256]; + static lv_opa_t prev_opa = LV_OPA_TRANSP; + static uint32_t prev_bpp = 0; + if(opa < LV_OPA_MAX) { + if(prev_opa != opa || prev_bpp != bpp) { + uint32_t i; + for(i = 0; i < shades; i++) { + opa_table[i] = bpp_opa_table_p[i] == LV_OPA_COVER ? opa : ((bpp_opa_table_p[i] * opa) >> 8); + } + } + bpp_opa_table_p = opa_table; + prev_opa = opa; + prev_bpp = bpp; + } + + int32_t col, row; + int32_t box_w = g->box_w; + int32_t box_h = g->box_h; + int32_t width_bit = box_w * bpp; /*Letter width in bits*/ + + /*Calculate the col/row start/end on the map*/ + int32_t col_start = pos->x >= draw_ctx->clip_area->x1 ? 0 : draw_ctx->clip_area->x1 - pos->x; + int32_t col_end = pos->x + box_w <= draw_ctx->clip_area->x2 ? box_w : draw_ctx->clip_area->x2 - pos->x + 1; + int32_t row_start = pos->y >= draw_ctx->clip_area->y1 ? 0 : draw_ctx->clip_area->y1 - pos->y; + int32_t row_end = pos->y + box_h <= draw_ctx->clip_area->y2 ? box_h : draw_ctx->clip_area->y2 - pos->y + 1; + + /*Move on the map too*/ + uint32_t bit_ofs = (row_start * width_bit) + (col_start * bpp); + map_p += bit_ofs >> 3; + + uint8_t letter_px; + uint32_t col_bit; + col_bit = bit_ofs & 0x7; /*"& 0x7" equals to "% 8" just faster*/ + + lv_draw_sw_blend_dsc_t blend_dsc; + lv_memset_00(&blend_dsc, sizeof(blend_dsc)); + blend_dsc.color = dsc->color; + blend_dsc.opa = dsc->opa; + blend_dsc.blend_mode = dsc->blend_mode; + + lv_coord_t hor_res = lv_disp_get_hor_res(_lv_refr_get_disp_refreshing()); + uint32_t mask_buf_size = box_w * box_h > hor_res ? hor_res : box_w * box_h; + lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size); + blend_dsc.mask_buf = mask_buf; + int32_t mask_p = 0; + + lv_area_t fill_area; + fill_area.x1 = col_start + pos->x; + fill_area.x2 = col_end + pos->x - 1; + fill_area.y1 = row_start + pos->y; + fill_area.y2 = fill_area.y1; +#if LV_DRAW_COMPLEX + lv_coord_t fill_w = lv_area_get_width(&fill_area); + lv_area_t mask_area; + lv_area_copy(&mask_area, &fill_area); + mask_area.y2 = mask_area.y1 + row_end; + bool mask_any = lv_draw_mask_is_any(&mask_area); +#endif + blend_dsc.blend_area = &fill_area; + blend_dsc.mask_area = &fill_area; + + uint32_t col_bit_max = 8 - bpp; + uint32_t col_bit_row_ofs = (box_w + col_start - col_end) * bpp; + + for(row = row_start ; row < row_end; row++) { +#if LV_DRAW_COMPLEX + int32_t mask_p_start = mask_p; #endif + bitmask = bitmask_init >> col_bit; + for(col = col_start; col < col_end; col++) { + /*Load the pixel's opacity into the mask*/ + letter_px = (*map_p & bitmask) >> (col_bit_max - col_bit); + if(letter_px) { + mask_buf[mask_p] = bpp_opa_table_p[letter_px]; + } + else { + mask_buf[mask_p] = 0; + } + + /*Go to the next column*/ + if(col_bit < col_bit_max) { + col_bit += bpp; + bitmask = bitmask >> bpp; + } + else { + col_bit = 0; + bitmask = bitmask_init; + map_p++; + } + + /*Next mask byte*/ + mask_p++; + } + +#if LV_DRAW_COMPLEX + /*Apply masks if any*/ + if(mask_any) { + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf + mask_p_start, fill_area.x1, fill_area.y2, + fill_w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(mask_buf + mask_p_start, fill_w); + } + } +#endif + + if((uint32_t) mask_p + (col_end - col_start) < mask_buf_size) { + fill_area.y2 ++; + } + else { + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + + fill_area.y1 = fill_area.y2 + 1; + fill_area.y2 = fill_area.y1; + mask_p = 0; + } + + col_bit += col_bit_row_ofs; + map_p += (col_bit >> 3); + col_bit = col_bit & 0x7; + } + + /*Flush the last part*/ + if(fill_area.y1 != fill_area.y2) { + fill_area.y2--; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + mask_p = 0; + } + + lv_mem_buf_release(mask_buf); +} + +#if LV_DRAW_COMPLEX && LV_USE_FONT_SUBPX +static void draw_letter_subpx(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos, + lv_font_glyph_dsc_t * g, const uint8_t * map_p) +{ + const uint8_t * bpp_opa_table; + uint32_t bitmask_init; + uint32_t bitmask; + uint32_t bpp = g->bpp; + lv_opa_t opa = dsc->opa; + if(bpp == 3) bpp = 4; + + switch(bpp) { + case 1: + bpp_opa_table = _lv_bpp1_opa_table; + bitmask_init = 0x80; + break; + case 2: + bpp_opa_table = _lv_bpp2_opa_table; + bitmask_init = 0xC0; + break; + case 4: + bpp_opa_table = _lv_bpp4_opa_table; + bitmask_init = 0xF0; + break; + case 8: + bpp_opa_table = _lv_bpp8_opa_table; + bitmask_init = 0xFF; + break; /*No opa table, pixel value will be used directly*/ + default: + LV_LOG_WARN("lv_draw_letter: invalid bpp not found"); + return; /*Invalid bpp. Can't render the letter*/ + } + + int32_t col, row; + + int32_t box_w = g->box_w; + int32_t box_h = g->box_h; + int32_t width_bit = box_w * bpp; /*Letter width in bits*/ + + /*Calculate the col/row start/end on the map*/ + int32_t col_start = pos->x >= draw_ctx->clip_area->x1 ? 0 : (draw_ctx->clip_area->x1 - pos->x) * 3; + int32_t col_end = pos->x + box_w / 3 <= draw_ctx->clip_area->x2 ? box_w : (draw_ctx->clip_area->x2 - pos->x + 1) * 3; + int32_t row_start = pos->y >= draw_ctx->clip_area->y1 ? 0 : draw_ctx->clip_area->y1 - pos->y; + int32_t row_end = pos->y + box_h <= draw_ctx->clip_area->y2 ? box_h : draw_ctx->clip_area->y2 - pos->y + 1; + + /*Move on the map too*/ + int32_t bit_ofs = (row_start * width_bit) + (col_start * bpp); + map_p += bit_ofs >> 3; + + uint8_t letter_px; + lv_opa_t px_opa; + int32_t col_bit; + col_bit = bit_ofs & 0x7; /*"& 0x7" equals to "% 8" just faster*/ + + lv_area_t map_area; + map_area.x1 = col_start / 3 + pos->x; + map_area.x2 = col_end / 3 + pos->x - 1; + map_area.y1 = row_start + pos->y; + map_area.y2 = map_area.y1; + + if(map_area.x2 <= map_area.x1) return; + + lv_coord_t hor_res = lv_disp_get_hor_res(_lv_refr_get_disp_refreshing()); + int32_t mask_buf_size = box_w * box_h > hor_res ? hor_res : g->box_w * g->box_h; + lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size); + int32_t mask_p = 0; + + lv_color_t * color_buf = lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t)); + + int32_t dest_buf_stride = lv_area_get_width(draw_ctx->buf_area); + lv_color_t * dest_buf_tmp = draw_ctx->buf; + + /*Set a pointer on draw_buf to the first pixel of the letter*/ + dest_buf_tmp += ((pos->y - draw_ctx->buf_area->y1) * dest_buf_stride) + pos->x - draw_ctx->buf_area->x1; + + /*If the letter is partially out of mask the move there on draw_buf*/ + dest_buf_tmp += (row_start * dest_buf_stride) + col_start / 3; + + lv_area_t mask_area; + lv_area_copy(&mask_area, &map_area); + mask_area.y2 = mask_area.y1 + row_end; + bool mask_any = lv_draw_mask_is_any(&map_area); + uint8_t font_rgb[3]; + + lv_color_t color = dsc->color; +#if LV_COLOR_16_SWAP == 0 + uint8_t txt_rgb[3] = {color.ch.red, color.ch.green, color.ch.blue}; +#else + uint8_t txt_rgb[3] = {color.ch.red, (color.ch.green_h << 3) + color.ch.green_l, color.ch.blue}; +#endif + + lv_draw_sw_blend_dsc_t blend_dsc; + lv_memset_00(&blend_dsc, sizeof(blend_dsc)); + blend_dsc.blend_area = &map_area; + blend_dsc.mask_area = &map_area; + blend_dsc.src_buf = color_buf; + blend_dsc.mask_buf = mask_buf; + blend_dsc.opa = opa; + blend_dsc.blend_mode = dsc->blend_mode; + + for(row = row_start ; row < row_end; row++) { + uint32_t subpx_cnt = 0; + bitmask = bitmask_init >> col_bit; + int32_t mask_p_start = mask_p; + + for(col = col_start; col < col_end; col++) { + /*Load the pixel's opacity into the mask*/ + letter_px = (*map_p & bitmask) >> (8 - col_bit - bpp); + if(letter_px != 0) { + if(opa >= LV_OPA_MAX) { + px_opa = bpp == 8 ? letter_px : bpp_opa_table[letter_px]; } - break; - case LV_FONT_GLYPH_FORMAT_A1: - case LV_FONT_GLYPH_FORMAT_A2: - case LV_FONT_GLYPH_FORMAT_A4: - case LV_FONT_GLYPH_FORMAT_A8: { - lv_area_t mask_area = *glyph_draw_dsc->letter_coords; - mask_area.x2 = mask_area.x1 + lv_draw_buf_width_to_stride(lv_area_get_width(&mask_area), LV_COLOR_FORMAT_A8) - 1; - lv_draw_sw_blend_dsc_t blend_dsc; - lv_memzero(&blend_dsc, sizeof(blend_dsc)); - blend_dsc.color = glyph_draw_dsc->color; - blend_dsc.opa = glyph_draw_dsc->opa; - lv_draw_buf_t * draw_buf = glyph_draw_dsc->glyph_data; - blend_dsc.mask_buf = draw_buf->data; - blend_dsc.mask_area = &mask_area; - blend_dsc.mask_stride = draw_buf->header.stride; - blend_dsc.blend_area = glyph_draw_dsc->letter_coords; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - - lv_draw_sw_blend(draw_unit, &blend_dsc); + else { + px_opa = bpp == 8 ? (uint32_t)((uint32_t)letter_px * opa) >> 8 + : (uint32_t)((uint32_t)bpp_opa_table[letter_px] * opa) >> 8; } - break; - case LV_FONT_GLYPH_FORMAT_IMAGE: { -#if LV_USE_IMGFONT - lv_draw_image_dsc_t img_dsc; - lv_draw_image_dsc_init(&img_dsc); - img_dsc.rotation = 0; - img_dsc.scale_x = LV_SCALE_NONE; - img_dsc.scale_y = LV_SCALE_NONE; - img_dsc.opa = glyph_draw_dsc->opa; - img_dsc.src = glyph_draw_dsc->glyph_data; - lv_draw_sw_image(draw_unit, &img_dsc, glyph_draw_dsc->letter_coords); + } + else { + px_opa = 0; + } + + font_rgb[subpx_cnt] = px_opa; + + subpx_cnt ++; + if(subpx_cnt == 3) { + subpx_cnt = 0; + + lv_color_t res_color; +#if LV_COLOR_16_SWAP == 0 + uint8_t bg_rgb[3] = {dest_buf_tmp->ch.red, dest_buf_tmp->ch.green, dest_buf_tmp->ch.blue}; +#else + uint8_t bg_rgb[3] = {dest_buf_tmp->ch.red, + (dest_buf_tmp->ch.green_h << 3) + dest_buf_tmp->ch.green_l, + dest_buf_tmp->ch.blue + }; #endif - } - break; - default: - break; + +#if LV_FONT_SUBPX_BGR + res_color.ch.red = (uint32_t)((uint16_t)txt_rgb[0] * font_rgb[2] + (bg_rgb[0] * (255 - font_rgb[2]))) >> 8; + res_color.ch.blue = (uint32_t)((uint16_t)txt_rgb[2] * font_rgb[0] + (bg_rgb[2] * (255 - font_rgb[0]))) >> 8; +#else + res_color.ch.red = (uint32_t)((uint16_t)txt_rgb[0] * font_rgb[0] + (bg_rgb[0] * (255 - font_rgb[0]))) >> 8; + res_color.ch.blue = (uint32_t)((uint16_t)txt_rgb[2] * font_rgb[2] + (bg_rgb[2] * (255 - font_rgb[2]))) >> 8; +#endif + +#if LV_COLOR_16_SWAP == 0 + res_color.ch.green = (uint32_t)((uint32_t)txt_rgb[1] * font_rgb[1] + (bg_rgb[1] * (255 - font_rgb[1]))) >> 8; +#else + uint8_t green = (uint32_t)((uint32_t)txt_rgb[1] * font_rgb[1] + (bg_rgb[1] * (255 - font_rgb[1]))) >> 8; + res_color.ch.green_h = green >> 3; + res_color.ch.green_l = green & 0x7; +#endif + +#if LV_COLOR_DEPTH == 32 + res_color.ch.alpha = 0xff; +#endif + + if(font_rgb[0] == 0 && font_rgb[1] == 0 && font_rgb[2] == 0) mask_buf[mask_p] = LV_OPA_TRANSP; + else mask_buf[mask_p] = LV_OPA_COVER; + color_buf[mask_p] = res_color; + + /*Next mask byte*/ + mask_p++; + dest_buf_tmp++; + } + + /*Go to the next column*/ + if(col_bit < (int32_t)(8 - bpp)) { + col_bit += bpp; + bitmask = bitmask >> bpp; + } + else { + col_bit = 0; + bitmask = bitmask_init; + map_p++; + } } + /*Apply masks if any*/ + if(mask_any) { + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf + mask_p_start, map_area.x1, map_area.y2, + lv_area_get_width(&map_area)); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(mask_buf + mask_p_start, lv_area_get_width(&map_area)); + } + } + + if((int32_t) mask_p + (col_end - col_start) < mask_buf_size) { + map_area.y2 ++; + } + else { + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + + map_area.y1 = map_area.y2 + 1; + map_area.y2 = map_area.y1; + mask_p = 0; + } + + col_bit += ((box_w - col_end) + col_start) * bpp; + + map_p += (col_bit >> 3); + col_bit = col_bit & 0x7; + + /*Next row in draw_buf*/ + dest_buf_tmp += dest_buf_stride - (col_end - col_start) / 3; } - if(fill_draw_dsc && fill_area) { - lv_draw_sw_fill(draw_unit, fill_draw_dsc, fill_area); + /*Flush the last part*/ + if(map_area.y1 != map_area.y2) { + map_area.y2--; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_sw_blend(draw_ctx, &blend_dsc); } + + lv_mem_buf_release(mask_buf); + lv_mem_buf_release(color_buf); } +#endif /*LV_DRAW_COMPLEX && LV_USE_FONT_SUBPX*/ -#endif /*LV_USE_DRAW_SW*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_line.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_line.c index be3b191..c666891 100644 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_line.c +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_line.c @@ -1,23 +1,15 @@ /** - * @file lv_draw_sw_line.c + * @file lv_draw_line.c * */ /********************* * INCLUDES *********************/ -#include "../../misc/lv_area_private.h" -#include "lv_draw_sw_mask_private.h" -#include "blend/lv_draw_sw_blend_private.h" -#include "../lv_draw_private.h" +#include #include "lv_draw_sw.h" - -#if LV_USE_DRAW_SW - #include "../../misc/lv_math.h" -#include "../../misc/lv_types.h" -#include "../../core/lv_refr_private.h" -#include "../../stdlib/lv_string.h" +#include "../../core/lv_refr.h" /********************* * DEFINES @@ -31,9 +23,12 @@ * STATIC PROTOTYPES **********************/ -static void /* LV_ATTRIBUTE_FAST_MEM */ draw_line_skew(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc); -static void /* LV_ATTRIBUTE_FAST_MEM */ draw_line_hor(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc); -static void /* LV_ATTRIBUTE_FAST_MEM */ draw_line_ver(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc); +static void /* LV_ATTRIBUTE_FAST_MEM */ draw_line_skew(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, + const lv_point_t * point1, const lv_point_t * point2); +static void /* LV_ATTRIBUTE_FAST_MEM */ draw_line_hor(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, + const lv_point_t * point1, const lv_point_t * point2); +static void /* LV_ATTRIBUTE_FAST_MEM */ draw_line_ver(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, + const lv_point_t * point1, const lv_point_t * point2); /********************** * STATIC VARIABLES @@ -47,225 +42,262 @@ static void /* LV_ATTRIBUTE_FAST_MEM */ draw_line_ver(lv_draw_unit_t * draw_unit * GLOBAL FUNCTIONS **********************/ -void lv_draw_sw_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc) +/** + * Draw a line + * @param point1 first point of the line + * @param point2 second point of the line + * @param clip the line will be drawn only in this area + * @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable + */ +void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, + const lv_point_t * point1, const lv_point_t * point2) { if(dsc->width == 0) return; if(dsc->opa <= LV_OPA_MIN) return; - if(dsc->p1.x == dsc->p2.x && dsc->p1.y == dsc->p2.y) return; + if(point1->x == point2->x && point1->y == point2->y) return; lv_area_t clip_line; - clip_line.x1 = (int32_t)LV_MIN(dsc->p1.x, dsc->p2.x) - dsc->width / 2; - clip_line.x2 = (int32_t)LV_MAX(dsc->p1.x, dsc->p2.x) + dsc->width / 2; - clip_line.y1 = (int32_t)LV_MIN(dsc->p1.y, dsc->p2.y) - dsc->width / 2; - clip_line.y2 = (int32_t)LV_MAX(dsc->p1.y, dsc->p2.y) + dsc->width / 2; + clip_line.x1 = LV_MIN(point1->x, point2->x) - dsc->width / 2; + clip_line.x2 = LV_MAX(point1->x, point2->x) + dsc->width / 2; + clip_line.y1 = LV_MIN(point1->y, point2->y) - dsc->width / 2; + clip_line.y2 = LV_MAX(point1->y, point2->y) + dsc->width / 2; bool is_common; - is_common = lv_area_intersect(&clip_line, &clip_line, draw_unit->clip_area); + is_common = _lv_area_intersect(&clip_line, &clip_line, draw_ctx->clip_area); if(!is_common) return; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_line; - LV_PROFILER_BEGIN; - if(dsc->p1.y == dsc->p2.y) draw_line_hor(draw_unit, dsc); - else if(dsc->p1.x == dsc->p2.x) draw_line_ver(draw_unit, dsc); - else draw_line_skew(draw_unit, dsc); + if(point1->y == point2->y) draw_line_hor(draw_ctx, dsc, point1, point2); + else if(point1->x == point2->x) draw_line_ver(draw_ctx, dsc, point1, point2); + else draw_line_skew(draw_ctx, dsc, point1, point2); if(dsc->round_end || dsc->round_start) { - lv_draw_fill_dsc_t cir_dsc; - lv_draw_fill_dsc_init(&cir_dsc); - cir_dsc.color = dsc->color; + lv_draw_rect_dsc_t cir_dsc; + lv_draw_rect_dsc_init(&cir_dsc); + cir_dsc.bg_color = dsc->color; cir_dsc.radius = LV_RADIUS_CIRCLE; - cir_dsc.opa = dsc->opa; + cir_dsc.bg_opa = dsc->opa; int32_t r = (dsc->width >> 1); int32_t r_corr = (dsc->width & 1) ? 0 : 1; lv_area_t cir_area; if(dsc->round_start) { - cir_area.x1 = (int32_t)dsc->p1.x - r; - cir_area.y1 = (int32_t)dsc->p1.y - r; - cir_area.x2 = (int32_t)dsc->p1.x + r - r_corr; - cir_area.y2 = (int32_t)dsc->p1.y + r - r_corr ; - lv_draw_sw_fill(draw_unit, &cir_dsc, &cir_area); + cir_area.x1 = point1->x - r; + cir_area.y1 = point1->y - r; + cir_area.x2 = point1->x + r - r_corr; + cir_area.y2 = point1->y + r - r_corr ; + lv_draw_rect(draw_ctx, &cir_dsc, &cir_area); } if(dsc->round_end) { - cir_area.x1 = (int32_t)dsc->p2.x - r; - cir_area.y1 = (int32_t)dsc->p2.y - r; - cir_area.x2 = (int32_t)dsc->p2.x + r - r_corr; - cir_area.y2 = (int32_t)dsc->p2.y + r - r_corr ; - lv_draw_sw_fill(draw_unit, &cir_dsc, &cir_area); + cir_area.x1 = point2->x - r; + cir_area.y1 = point2->y - r; + cir_area.x2 = point2->x + r - r_corr; + cir_area.y2 = point2->y + r - r_corr ; + lv_draw_rect(draw_ctx, &cir_dsc, &cir_area); } } - LV_PROFILER_END; + + draw_ctx->clip_area = clip_area_ori; } /********************** * STATIC FUNCTIONS **********************/ -static void LV_ATTRIBUTE_FAST_MEM draw_line_hor(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc) + + +static void LV_ATTRIBUTE_FAST_MEM draw_line_hor(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, + const lv_point_t * point1, const lv_point_t * point2) { int32_t w = dsc->width - 1; int32_t w_half0 = w >> 1; int32_t w_half1 = w_half0 + (w & 0x1); /*Compensate rounding error*/ lv_area_t blend_area; - blend_area.x1 = (int32_t)LV_MIN(dsc->p1.x, dsc->p2.x); - blend_area.x2 = (int32_t)LV_MAX(dsc->p1.x, dsc->p2.x) - 1; - blend_area.y1 = (int32_t)dsc->p1.y - w_half1; - blend_area.y2 = (int32_t)dsc->p1.y + w_half0; + blend_area.x1 = LV_MIN(point1->x, point2->x); + blend_area.x2 = LV_MAX(point1->x, point2->x) - 1; + blend_area.y1 = point1->y - w_half1; + blend_area.y2 = point1->y + w_half0; bool is_common; - is_common = lv_area_intersect(&blend_area, &blend_area, draw_unit->clip_area); + is_common = _lv_area_intersect(&blend_area, &blend_area, draw_ctx->clip_area); if(!is_common) return; - bool dashed = dsc->dash_gap && dsc->dash_width; + bool dashed = dsc->dash_gap && dsc->dash_width ? true : false; + bool simple_mode = true; + if(lv_draw_mask_is_any(&blend_area)) simple_mode = false; + else if(dashed) simple_mode = false; lv_draw_sw_blend_dsc_t blend_dsc; - lv_memzero(&blend_dsc, sizeof(blend_dsc)); + lv_memset_00(&blend_dsc, sizeof(blend_dsc)); blend_dsc.blend_area = &blend_area; blend_dsc.color = dsc->color; blend_dsc.opa = dsc->opa; /*If there is no mask then simply draw a rectangle*/ - if(!dashed) { - lv_draw_sw_blend(draw_unit, &blend_dsc); + if(simple_mode) { + lv_draw_sw_blend(draw_ctx, &blend_dsc); } -#if LV_DRAW_SW_COMPLEX +#if LV_DRAW_COMPLEX /*If there other mask apply it*/ else { int32_t blend_area_w = lv_area_get_width(&blend_area); - int32_t y2 = blend_area.y2; + lv_coord_t y2 = blend_area.y2; blend_area.y2 = blend_area.y1; - int32_t dash_start = blend_area.x1 % (dsc->dash_gap + dsc->dash_width); + lv_coord_t dash_start = 0; + if(dashed) { + dash_start = (blend_area.x1) % (dsc->dash_gap + dsc->dash_width); + } - lv_opa_t * mask_buf = lv_malloc(blend_area_w); + lv_opa_t * mask_buf = lv_mem_buf_get(blend_area_w); blend_dsc.mask_buf = mask_buf; blend_dsc.mask_area = &blend_area; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; int32_t h; for(h = blend_area.y1; h <= y2; h++) { - lv_memset(mask_buf, 0xff, blend_area_w); - - int32_t dash_cnt = dash_start; - int32_t i; - for(i = 0; i < blend_area_w; i++, dash_cnt++) { - if(dash_cnt <= dsc->dash_width) { - int16_t diff = dsc->dash_width - dash_cnt; - i += diff; - dash_cnt += diff; - } - else if(dash_cnt > dsc->dash_gap + dsc->dash_width) { - dash_cnt = 0; + lv_memset_ff(mask_buf, blend_area_w); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, blend_area.x1, h, blend_area_w); + + if(dashed) { + if(blend_dsc.mask_res != LV_DRAW_MASK_RES_TRANSP) { + lv_coord_t dash_cnt = dash_start; + lv_coord_t i; + for(i = 0; i < blend_area_w; i++, dash_cnt++) { + if(dash_cnt <= dsc->dash_width) { + int16_t diff = dsc->dash_width - dash_cnt; + i += diff; + dash_cnt += diff; + } + else if(dash_cnt >= dsc->dash_gap + dsc->dash_width) { + dash_cnt = 0; + } + else { + mask_buf[i] = 0x00; + } + } + + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; } - else { - mask_buf[i] = 0x00; - } - - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; } - lv_draw_sw_blend(draw_unit, &blend_dsc); + lv_draw_sw_blend(draw_ctx, &blend_dsc); blend_area.y1++; blend_area.y2++; } - lv_free(mask_buf); + lv_mem_buf_release(mask_buf); } -#endif /*LV_DRAW_SW_COMPLEX*/ +#endif /*LV_DRAW_COMPLEX*/ } -static void LV_ATTRIBUTE_FAST_MEM draw_line_ver(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc) +static void LV_ATTRIBUTE_FAST_MEM draw_line_ver(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, + const lv_point_t * point1, const lv_point_t * point2) { int32_t w = dsc->width - 1; int32_t w_half0 = w >> 1; int32_t w_half1 = w_half0 + (w & 0x1); /*Compensate rounding error*/ lv_area_t blend_area; - blend_area.x1 = (int32_t)dsc->p1.x - w_half1; - blend_area.x2 = (int32_t)dsc->p1.x + w_half0; - blend_area.y1 = (int32_t)LV_MIN(dsc->p1.y, dsc->p2.y); - blend_area.y2 = (int32_t)LV_MAX(dsc->p1.y, dsc->p2.y) - 1; + blend_area.x1 = point1->x - w_half1; + blend_area.x2 = point1->x + w_half0; + blend_area.y1 = LV_MIN(point1->y, point2->y); + blend_area.y2 = LV_MAX(point1->y, point2->y) - 1; bool is_common; - is_common = lv_area_intersect(&blend_area, &blend_area, draw_unit->clip_area); + is_common = _lv_area_intersect(&blend_area, &blend_area, draw_ctx->clip_area); if(!is_common) return; - bool dashed = dsc->dash_gap && dsc->dash_width; + bool dashed = dsc->dash_gap && dsc->dash_width ? true : false; + bool simple_mode = true; + if(lv_draw_mask_is_any(&blend_area)) simple_mode = false; + else if(dashed) simple_mode = false; lv_draw_sw_blend_dsc_t blend_dsc; - lv_memzero(&blend_dsc, sizeof(blend_dsc)); + lv_memset_00(&blend_dsc, sizeof(blend_dsc)); blend_dsc.blend_area = &blend_area; blend_dsc.color = dsc->color; blend_dsc.opa = dsc->opa; /*If there is no mask then simply draw a rectangle*/ - if(!dashed) { - lv_draw_sw_blend(draw_unit, &blend_dsc); + if(simple_mode) { + lv_draw_sw_blend(draw_ctx, &blend_dsc); } -#if LV_DRAW_SW_COMPLEX +#if LV_DRAW_COMPLEX /*If there other mask apply it*/ else { int32_t draw_area_w = lv_area_get_width(&blend_area); - int32_t y2 = blend_area.y2; + lv_coord_t y2 = blend_area.y2; blend_area.y2 = blend_area.y1; - lv_opa_t * mask_buf = lv_malloc(draw_area_w); + lv_opa_t * mask_buf = lv_mem_buf_get(draw_area_w); blend_dsc.mask_buf = mask_buf; blend_dsc.mask_area = &blend_area; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - int32_t dash_start = (blend_area.y1) % (dsc->dash_gap + dsc->dash_width); - int32_t dash_cnt = dash_start; + lv_coord_t dash_start = 0; + if(dashed) { + dash_start = (blend_area.y1) % (dsc->dash_gap + dsc->dash_width); + } + + lv_coord_t dash_cnt = dash_start; int32_t h; for(h = blend_area.y1; h <= y2; h++) { - lv_memset(mask_buf, 0xff, draw_area_w); - - if(dash_cnt > dsc->dash_width) { - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_TRANSP; - } - else { - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_FULL_COVER; - } - - if(dash_cnt >= dsc->dash_gap + dsc->dash_width) { - dash_cnt = 0; + lv_memset_ff(mask_buf, draw_area_w); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, blend_area.x1, h, draw_area_w); + + if(dashed) { + if(blend_dsc.mask_res != LV_DRAW_MASK_RES_TRANSP) { + if(dash_cnt > dsc->dash_width) { + blend_dsc.mask_res = LV_DRAW_MASK_RES_TRANSP; + } + + if(dash_cnt >= dsc->dash_gap + dsc->dash_width) { + dash_cnt = 0; + } + } + dash_cnt ++; } - dash_cnt ++; - lv_draw_sw_blend(draw_unit, &blend_dsc); + lv_draw_sw_blend(draw_ctx, &blend_dsc); blend_area.y1++; blend_area.y2++; } - lv_free(mask_buf); + lv_mem_buf_release(mask_buf); } -#endif /*LV_DRAW_SW_COMPLEX*/ +#endif /*LV_DRAW_COMPLEX*/ } -static void LV_ATTRIBUTE_FAST_MEM draw_line_skew(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc) +static void LV_ATTRIBUTE_FAST_MEM draw_line_skew(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, + const lv_point_t * point1, const lv_point_t * point2) { -#if LV_DRAW_SW_COMPLEX +#if LV_DRAW_COMPLEX /*Keep the great y in p1*/ lv_point_t p1; lv_point_t p2; - if(dsc->p1.y < dsc->p2.y) { - p1 = lv_point_from_precise(&dsc->p1); - p2 = lv_point_from_precise(&dsc->p2); + if(point1->y < point2->y) { + p1.y = point1->y; + p2.y = point2->y; + p1.x = point1->x; + p2.x = point2->x; } else { - p1 = lv_point_from_precise(&dsc->p2); - p2 = lv_point_from_precise(&dsc->p1); + p1.y = point2->y; + p2.y = point1->y; + p1.x = point2->x; + p2.x = point1->x; } int32_t xdiff = p2.x - p1.x; int32_t ydiff = p2.y - p1.y; - bool flat = LV_ABS(xdiff) > LV_ABS(ydiff); + bool flat = LV_ABS(xdiff) > LV_ABS(ydiff) ? true : false; static const uint8_t wcorr[] = { 128, 128, 128, 129, 129, 130, 130, 131, @@ -293,47 +325,47 @@ static void LV_ATTRIBUTE_FAST_MEM draw_line_skew(lv_draw_unit_t * draw_unit, con /*Get the union of `coords` and `clip`*/ /*`clip` is already truncated to the `draw_buf` size *in 'lv_refr_area' function*/ - bool is_common = lv_area_intersect(&blend_area, &blend_area, draw_unit->clip_area); + bool is_common = _lv_area_intersect(&blend_area, &blend_area, draw_ctx->clip_area); if(is_common == false) return; - lv_draw_sw_mask_line_param_t mask_left_param; - lv_draw_sw_mask_line_param_t mask_right_param; - lv_draw_sw_mask_line_param_t mask_top_param; - lv_draw_sw_mask_line_param_t mask_bottom_param; - - void * masks[5] = {&mask_left_param, & mask_right_param, NULL, NULL, NULL}; + lv_draw_mask_line_param_t mask_left_param; + lv_draw_mask_line_param_t mask_right_param; + lv_draw_mask_line_param_t mask_top_param; + lv_draw_mask_line_param_t mask_bottom_param; if(flat) { if(xdiff > 0) { - lv_draw_sw_mask_line_points_init(&mask_left_param, p1.x, p1.y - w_half0, p2.x, p2.y - w_half0, - LV_DRAW_SW_MASK_LINE_SIDE_LEFT); - lv_draw_sw_mask_line_points_init(&mask_right_param, p1.x, p1.y + w_half1, p2.x, p2.y + w_half1, - LV_DRAW_SW_MASK_LINE_SIDE_RIGHT); + lv_draw_mask_line_points_init(&mask_left_param, p1.x, p1.y - w_half0, p2.x, p2.y - w_half0, + LV_DRAW_MASK_LINE_SIDE_LEFT); + lv_draw_mask_line_points_init(&mask_right_param, p1.x, p1.y + w_half1, p2.x, p2.y + w_half1, + LV_DRAW_MASK_LINE_SIDE_RIGHT); } else { - lv_draw_sw_mask_line_points_init(&mask_left_param, p1.x, p1.y + w_half1, p2.x, p2.y + w_half1, - LV_DRAW_SW_MASK_LINE_SIDE_LEFT); - lv_draw_sw_mask_line_points_init(&mask_right_param, p1.x, p1.y - w_half0, p2.x, p2.y - w_half0, - LV_DRAW_SW_MASK_LINE_SIDE_RIGHT); + lv_draw_mask_line_points_init(&mask_left_param, p1.x, p1.y + w_half1, p2.x, p2.y + w_half1, + LV_DRAW_MASK_LINE_SIDE_LEFT); + lv_draw_mask_line_points_init(&mask_right_param, p1.x, p1.y - w_half0, p2.x, p2.y - w_half0, + LV_DRAW_MASK_LINE_SIDE_RIGHT); } } else { - lv_draw_sw_mask_line_points_init(&mask_left_param, p1.x + w_half1, p1.y, p2.x + w_half1, p2.y, - LV_DRAW_SW_MASK_LINE_SIDE_LEFT); - lv_draw_sw_mask_line_points_init(&mask_right_param, p1.x - w_half0, p1.y, p2.x - w_half0, p2.y, - LV_DRAW_SW_MASK_LINE_SIDE_RIGHT); - + lv_draw_mask_line_points_init(&mask_left_param, p1.x + w_half1, p1.y, p2.x + w_half1, p2.y, + LV_DRAW_MASK_LINE_SIDE_LEFT); + lv_draw_mask_line_points_init(&mask_right_param, p1.x - w_half0, p1.y, p2.x - w_half0, p2.y, + LV_DRAW_MASK_LINE_SIDE_RIGHT); } /*Use the normal vector for the endings*/ + int16_t mask_left_id = lv_draw_mask_add(&mask_left_param, NULL); + int16_t mask_right_id = lv_draw_mask_add(&mask_right_param, NULL); + int16_t mask_top_id = LV_MASK_ID_INV; + int16_t mask_bottom_id = LV_MASK_ID_INV; + if(!dsc->raw_end) { - lv_draw_sw_mask_line_points_init(&mask_top_param, p1.x, p1.y, p1.x - ydiff, p1.y + xdiff, - LV_DRAW_SW_MASK_LINE_SIDE_BOTTOM); - lv_draw_sw_mask_line_points_init(&mask_bottom_param, p2.x, p2.y, p2.x - ydiff, p2.y + xdiff, - LV_DRAW_SW_MASK_LINE_SIDE_TOP); - masks[2] = &mask_top_param; - masks[3] = &mask_bottom_param; + lv_draw_mask_line_points_init(&mask_top_param, p1.x, p1.y, p1.x - ydiff, p1.y + xdiff, LV_DRAW_MASK_LINE_SIDE_BOTTOM); + lv_draw_mask_line_points_init(&mask_bottom_param, p2.x, p2.y, p2.x - ydiff, p2.y + xdiff, LV_DRAW_MASK_LINE_SIDE_TOP); + mask_top_id = lv_draw_mask_add(&mask_top_param, NULL); + mask_bottom_id = lv_draw_mask_add(&mask_bottom_param, NULL); } /*The real draw area is around the line. @@ -343,18 +375,18 @@ static void LV_ATTRIBUTE_FAST_MEM draw_line_skew(lv_draw_unit_t * draw_unit, con /*Draw the background line by line*/ int32_t h; - uint32_t hor_res = (uint32_t)lv_display_get_horizontal_resolution(lv_refr_get_disp_refreshing()); + uint32_t hor_res = (uint32_t)lv_disp_get_hor_res(_lv_refr_get_disp_refreshing()); size_t mask_buf_size = LV_MIN(lv_area_get_size(&blend_area), hor_res); - lv_opa_t * mask_buf = lv_malloc(mask_buf_size); + lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size); - int32_t y2 = blend_area.y2; + lv_coord_t y2 = blend_area.y2; blend_area.y2 = blend_area.y1; uint32_t mask_p = 0; - lv_memset(mask_buf, 0xff, mask_buf_size); + lv_memset_ff(mask_buf, mask_buf_size); lv_draw_sw_blend_dsc_t blend_dsc; - lv_memzero(&blend_dsc, sizeof(blend_dsc)); + lv_memset_00(&blend_dsc, sizeof(blend_dsc)); blend_dsc.blend_area = &blend_area; blend_dsc.color = dsc->color; blend_dsc.opa = dsc->opa; @@ -363,9 +395,9 @@ static void LV_ATTRIBUTE_FAST_MEM draw_line_skew(lv_draw_unit_t * draw_unit, con /*Fill the first row with 'color'*/ for(h = blend_area.y1; h <= y2; h++) { - blend_dsc.mask_res = lv_draw_sw_mask_apply(masks, &mask_buf[mask_p], blend_area.x1, h, draw_area_w); - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_TRANSP) { - lv_memzero(&mask_buf[mask_p], draw_area_w); + blend_dsc.mask_res = lv_draw_mask_apply(&mask_buf[mask_p], blend_area.x1, h, draw_area_w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(&mask_buf[mask_p], draw_area_w); } mask_p += draw_area_w; @@ -373,36 +405,39 @@ static void LV_ATTRIBUTE_FAST_MEM draw_line_skew(lv_draw_unit_t * draw_unit, con blend_area.y2 ++; } else { - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - lv_draw_sw_blend(draw_unit, &blend_dsc); + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_sw_blend(draw_ctx, &blend_dsc); blend_area.y1 = blend_area.y2 + 1; blend_area.y2 = blend_area.y1; mask_p = 0; - lv_memset(mask_buf, 0xff, mask_buf_size); + lv_memset_ff(mask_buf, mask_buf_size); } } /*Flush the last part*/ if(blend_area.y1 != blend_area.y2) { blend_area.y2--; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - lv_draw_sw_blend(draw_unit, &blend_dsc); + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_sw_blend(draw_ctx, &blend_dsc); } - lv_free(mask_buf); + lv_mem_buf_release(mask_buf); - lv_draw_sw_mask_free_param(&mask_left_param); - lv_draw_sw_mask_free_param(&mask_right_param); - if(!dsc->raw_end) { - lv_draw_sw_mask_free_param(&mask_top_param); - lv_draw_sw_mask_free_param(&mask_bottom_param); - } + lv_draw_mask_free_param(&mask_left_param); + lv_draw_mask_free_param(&mask_right_param); + if(mask_top_id != LV_MASK_ID_INV) lv_draw_mask_free_param(&mask_top_param); + if(mask_bottom_id != LV_MASK_ID_INV) lv_draw_mask_free_param(&mask_bottom_param); + lv_draw_mask_remove_id(mask_left_id); + lv_draw_mask_remove_id(mask_right_id); + lv_draw_mask_remove_id(mask_top_id); + lv_draw_mask_remove_id(mask_bottom_id); #else - LV_UNUSED(draw_unit); + LV_UNUSED(point1); + LV_UNUSED(point2); + LV_UNUSED(draw_ctx); LV_UNUSED(dsc); - LV_LOG_WARN("Can't draw skewed line with LV_DRAW_SW_COMPLEX == 0"); -#endif /*LV_DRAW_SW_COMPLEX*/ + LV_LOG_WARN("Can't draw skewed line with LV_DRAW_COMPLEX == 0"); +#endif /*LV_DRAW_COMPLEX*/ } -#endif /*LV_USE_DRAW_SW*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask.c deleted file mode 100644 index c4fd792..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask.c +++ /dev/null @@ -1,1236 +0,0 @@ -/** - * @file lv_draw_sw_mask.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_sw_mask_private.h" -#include "../lv_draw_mask_private.h" -#include "../lv_draw.h" - -#if LV_DRAW_SW_COMPLEX -#include "../../core/lv_global.h" -#include "../../misc/lv_math.h" -#include "../../misc/lv_log.h" -#include "../../misc/lv_assert.h" -#include "../../osal/lv_os.h" -#include "../../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ -#define CIRCLE_CACHE_LIFE_MAX 1000 -#define CIRCLE_CACHE_AGING(life, r) life = LV_MIN(life + (r < 16 ? 1 : (r >> 4)), 1000) -#define circle_cache_mutex LV_GLOBAL_DEFAULT()->draw_info.circle_cache_mutex -#define _circle_cache LV_GLOBAL_DEFAULT()->sw_circle_cache - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static lv_draw_sw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_line(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, int32_t len, - lv_draw_sw_mask_line_param_t * param); -static lv_draw_sw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_radius(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, int32_t len, - lv_draw_sw_mask_radius_param_t * param); -static lv_draw_sw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_angle(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, int32_t len, - lv_draw_sw_mask_angle_param_t * param); -static lv_draw_sw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_fade(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, int32_t len, - lv_draw_sw_mask_fade_param_t * param); -static lv_draw_sw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_map(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, int32_t len, - lv_draw_sw_mask_map_param_t * param); - -static lv_draw_sw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ line_mask_flat(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, - int32_t len, - lv_draw_sw_mask_line_param_t * p); -static lv_draw_sw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ line_mask_steep(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, - int32_t len, - lv_draw_sw_mask_line_param_t * p); - -static void circ_init(lv_point_t * c, int32_t * tmp, int32_t radius); -static bool circ_cont(lv_point_t * c); -static void circ_next(lv_point_t * c, int32_t * tmp); -static void circ_calc_aa4(lv_draw_sw_mask_radius_circle_dsc_t * c, int32_t radius); -static lv_opa_t * get_next_line(lv_draw_sw_mask_radius_circle_dsc_t * c, int32_t y, int32_t * len, - int32_t * x_start); -static inline lv_opa_t /* LV_ATTRIBUTE_FAST_MEM */ mask_mix(lv_opa_t mask_act, lv_opa_t mask_new); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_sw_mask_init(void) -{ - lv_mutex_init(&circle_cache_mutex); -} - -void lv_draw_sw_mask_deinit(void) -{ - lv_mutex_delete(&circle_cache_mutex); -} - -lv_draw_sw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_sw_mask_apply(void * masks[], lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, - int32_t len) -{ - bool changed = false; - lv_draw_sw_mask_common_dsc_t * dsc; - - uint32_t i; - for(i = 0; masks[i]; i++) { - dsc = masks[i]; - lv_draw_sw_mask_res_t res = LV_DRAW_SW_MASK_RES_FULL_COVER; - res = dsc->cb(mask_buf, abs_x, abs_y, len, masks[i]); - if(res == LV_DRAW_SW_MASK_RES_TRANSP) return LV_DRAW_SW_MASK_RES_TRANSP; - else if(res == LV_DRAW_SW_MASK_RES_CHANGED) changed = true; - } - - return changed ? LV_DRAW_SW_MASK_RES_CHANGED : LV_DRAW_SW_MASK_RES_FULL_COVER; -} - -void lv_draw_sw_mask_free_param(void * p) -{ - lv_mutex_lock(&circle_cache_mutex); - lv_draw_sw_mask_common_dsc_t * pdsc = p; - if(pdsc->type == LV_DRAW_SW_MASK_TYPE_RADIUS) { - lv_draw_sw_mask_radius_param_t * radius_p = (lv_draw_sw_mask_radius_param_t *) p; - if(radius_p->circle) { - if(radius_p->circle->life < 0) { - lv_free(radius_p->circle->cir_opa); - lv_free(radius_p->circle); - } - else { - radius_p->circle->used_cnt--; - } - } - } - - lv_mutex_unlock(&circle_cache_mutex); -} - -void lv_draw_sw_mask_cleanup(void) -{ - uint8_t i; - for(i = 0; i < LV_DRAW_SW_CIRCLE_CACHE_SIZE; i++) { - if(_circle_cache[i].buf) { - lv_free(_circle_cache[i].buf); - } - lv_memzero(&(_circle_cache[i]), sizeof(_circle_cache[i])); - } -} - -void lv_draw_sw_mask_line_points_init(lv_draw_sw_mask_line_param_t * param, int32_t p1x, int32_t p1y, - int32_t p2x, - int32_t p2y, lv_draw_sw_mask_line_side_t side) -{ - lv_memzero(param, sizeof(lv_draw_sw_mask_line_param_t)); - - if(p1y == p2y && side == LV_DRAW_SW_MASK_LINE_SIDE_BOTTOM) { - p1y--; - p2y--; - } - - if(p1y > p2y) { - int32_t t; - t = p2x; - p2x = p1x; - p1x = t; - - t = p2y; - p2y = p1y; - p1y = t; - } - - lv_point_set(¶m->cfg.p1, p1x, p1y); - lv_point_set(¶m->cfg.p2, p2x, p2y); - param->cfg.side = side; - - lv_point_set(¶m->origo, p1x, p1y); - param->flat = (LV_ABS(p2x - p1x) > LV_ABS(p2y - p1y)) ? 1 : 0; - param->yx_steep = 0; - param->xy_steep = 0; - param->dsc.cb = (lv_draw_sw_mask_xcb_t)lv_draw_mask_line; - param->dsc.type = LV_DRAW_SW_MASK_TYPE_LINE; - - int32_t dx = p2x - p1x; - int32_t dy = p2y - p1y; - - if(param->flat) { - /*Normalize the steep. Delta x should be relative to delta x = 1024*/ - int32_t m; - - if(dx) { - m = (1L << 20) / dx; /*m is multiplier to normalize y (upscaled by 1024)*/ - param->yx_steep = (m * dy) >> 10; - } - - if(dy) { - m = (1L << 20) / dy; /*m is multiplier to normalize x (upscaled by 1024)*/ - param->xy_steep = (m * dx) >> 10; - } - param->steep = param->yx_steep; - } - else { - /*Normalize the steep. Delta y should be relative to delta x = 1024*/ - int32_t m; - - if(dy) { - m = (1L << 20) / dy; /*m is multiplier to normalize x (upscaled by 1024)*/ - param->xy_steep = (m * dx) >> 10; - } - - if(dx) { - m = (1L << 20) / dx; /*m is multiplier to normalize x (upscaled by 1024)*/ - param->yx_steep = (m * dy) >> 10; - } - param->steep = param->xy_steep; - } - - if(param->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_LEFT) param->inv = 0; - else if(param->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_RIGHT) param->inv = 1; - else if(param->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_TOP) { - if(param->steep > 0) param->inv = 1; - else param->inv = 0; - } - else if(param->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_BOTTOM) { - if(param->steep > 0) param->inv = 0; - else param->inv = 1; - } - - param->spx = param->steep >> 2; - if(param->steep < 0) param->spx = -param->spx; -} - -void lv_draw_sw_mask_line_angle_init(lv_draw_sw_mask_line_param_t * param, int32_t p1x, int32_t py, int16_t angle, - lv_draw_sw_mask_line_side_t side) -{ - /*Find an optimal degree. - *lv_mask_line_points_init will swap the points to keep the smaller y in p1 - *Theoretically a line with `angle` or `angle+180` is the same only the points are swapped - *Find the degree which keeps the origo in place*/ - if(angle > 180) angle -= 180; /*> 180 will swap the origo*/ - - int32_t p2x; - int32_t p2y; - - p2x = (lv_trigo_sin(angle + 90) >> 5) + p1x; - p2y = (lv_trigo_sin(angle) >> 5) + py; - - lv_draw_sw_mask_line_points_init(param, p1x, py, p2x, p2y, side); -} - -void lv_draw_sw_mask_angle_init(lv_draw_sw_mask_angle_param_t * param, int32_t vertex_x, int32_t vertex_y, - int32_t start_angle, int32_t end_angle) -{ - lv_draw_sw_mask_line_side_t start_side; - lv_draw_sw_mask_line_side_t end_side; - - /*Constrain the input angles*/ - if(start_angle < 0) - start_angle = 0; - else if(start_angle > 359) - start_angle = 359; - - if(end_angle < 0) - end_angle = 0; - else if(end_angle > 359) - end_angle = 359; - - if(end_angle < start_angle) { - param->delta_deg = 360 - start_angle + end_angle; - } - else { - param->delta_deg = LV_ABS(end_angle - start_angle); - } - - param->cfg.start_angle = start_angle; - param->cfg.end_angle = end_angle; - lv_point_set(¶m->cfg.vertex_p, vertex_x, vertex_y); - param->dsc.cb = (lv_draw_sw_mask_xcb_t)lv_draw_mask_angle; - param->dsc.type = LV_DRAW_SW_MASK_TYPE_ANGLE; - - LV_ASSERT_MSG(start_angle >= 0 && start_angle <= 360, "Unexpected start angle"); - - if(start_angle >= 0 && start_angle < 180) { - start_side = LV_DRAW_SW_MASK_LINE_SIDE_LEFT; - } - else - start_side = LV_DRAW_SW_MASK_LINE_SIDE_RIGHT; /*silence compiler*/ - - LV_ASSERT_MSG(end_angle >= 0 && start_angle <= 360, "Unexpected end angle"); - - if(end_angle >= 0 && end_angle < 180) { - end_side = LV_DRAW_SW_MASK_LINE_SIDE_RIGHT; - } - else if(end_angle >= 180 && end_angle < 360) { - end_side = LV_DRAW_SW_MASK_LINE_SIDE_LEFT; - } - else - end_side = LV_DRAW_SW_MASK_LINE_SIDE_RIGHT; /*silence compiler*/ - - lv_draw_sw_mask_line_angle_init(¶m->start_line, vertex_x, vertex_y, start_angle, start_side); - lv_draw_sw_mask_line_angle_init(¶m->end_line, vertex_x, vertex_y, end_angle, end_side); -} - -void lv_draw_sw_mask_radius_init(lv_draw_sw_mask_radius_param_t * param, const lv_area_t * rect, int32_t radius, - bool inv) -{ - int32_t w = lv_area_get_width(rect); - int32_t h = lv_area_get_height(rect); - int32_t short_side = LV_MIN(w, h); - if(radius > short_side >> 1) radius = short_side >> 1; - if(radius < 0) radius = 0; - - lv_area_copy(¶m->cfg.rect, rect); - param->cfg.radius = radius; - param->cfg.outer = inv ? 1 : 0; - param->dsc.cb = (lv_draw_sw_mask_xcb_t)lv_draw_mask_radius; - param->dsc.type = LV_DRAW_SW_MASK_TYPE_RADIUS; - - if(radius == 0) { - param->circle = NULL; - return; - } - - lv_mutex_lock(&circle_cache_mutex); - - uint32_t i; - - /*Try to reuse a circle cache entry*/ - for(i = 0; i < LV_DRAW_SW_CIRCLE_CACHE_SIZE; i++) { - if(_circle_cache[i].radius == radius) { - _circle_cache[i].used_cnt++; - CIRCLE_CACHE_AGING(_circle_cache[i].life, radius); - param->circle = &(_circle_cache[i]); - lv_mutex_unlock(&circle_cache_mutex); - return; - } - } - - /*If not cached use the free entry with lowest life*/ - lv_draw_sw_mask_radius_circle_dsc_t * entry = NULL; - for(i = 0; i < LV_DRAW_SW_CIRCLE_CACHE_SIZE; i++) { - if(_circle_cache[i].used_cnt == 0) { - if(!entry) entry = &(_circle_cache[i]); - else if(_circle_cache[i].life < entry->life) entry = &(_circle_cache[i]); - } - } - - /*There is no unused entry. Allocate one temporarily*/ - if(!entry) { - entry = lv_malloc_zeroed(sizeof(lv_draw_sw_mask_radius_circle_dsc_t)); - LV_ASSERT_MALLOC(entry); - entry->life = -1; - } - else { - entry->used_cnt++; - entry->life = 0; - CIRCLE_CACHE_AGING(entry->life, radius); - } - - param->circle = entry; - - circ_calc_aa4(param->circle, radius); - lv_mutex_unlock(&circle_cache_mutex); - -} - -void lv_draw_sw_mask_fade_init(lv_draw_sw_mask_fade_param_t * param, const lv_area_t * coords, lv_opa_t opa_top, - int32_t y_top, - lv_opa_t opa_bottom, int32_t y_bottom) -{ - lv_area_copy(¶m->cfg.coords, coords); - param->cfg.opa_top = opa_top; - param->cfg.opa_bottom = opa_bottom; - param->cfg.y_top = y_top; - param->cfg.y_bottom = y_bottom; - param->dsc.cb = (lv_draw_sw_mask_xcb_t)lv_draw_mask_fade; - param->dsc.type = LV_DRAW_SW_MASK_TYPE_FADE; -} - -void lv_draw_sw_mask_map_init(lv_draw_sw_mask_map_param_t * param, const lv_area_t * coords, const lv_opa_t * map) -{ - lv_area_copy(¶m->cfg.coords, coords); - param->cfg.map = map; - param->dsc.cb = (lv_draw_sw_mask_xcb_t)lv_draw_mask_map; - param->dsc.type = LV_DRAW_SW_MASK_TYPE_MAP; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static lv_draw_sw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_line(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, int32_t len, - lv_draw_sw_mask_line_param_t * p) -{ - /*Make to points relative to the vertex*/ - abs_y -= p->origo.y; - abs_x -= p->origo.x; - - /*Handle special cases*/ - if(p->steep == 0) { - /*Horizontal*/ - if(p->flat) { - /*Non sense: Can't be on the right/left of a horizontal line*/ - if(p->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_LEFT || - p->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_RIGHT) return LV_DRAW_SW_MASK_RES_FULL_COVER; - else if(p->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_TOP && abs_y < 0) return LV_DRAW_SW_MASK_RES_FULL_COVER; - else if(p->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_BOTTOM && abs_y > 0) return LV_DRAW_SW_MASK_RES_FULL_COVER; - else { - return LV_DRAW_SW_MASK_RES_TRANSP; - } - } - /*Vertical*/ - else { - /*Non sense: Can't be on the top/bottom of a vertical line*/ - if(p->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_TOP || - p->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_BOTTOM) return LV_DRAW_SW_MASK_RES_FULL_COVER; - else if(p->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_RIGHT && abs_x > 0) return LV_DRAW_SW_MASK_RES_FULL_COVER; - else if(p->cfg.side == LV_DRAW_SW_MASK_LINE_SIDE_LEFT) { - if(abs_x + len < 0) return LV_DRAW_SW_MASK_RES_FULL_COVER; - else { - int32_t k = - abs_x; - if(k < 0) return LV_DRAW_SW_MASK_RES_TRANSP; - if(k >= 0 && k < len) lv_memzero(&mask_buf[k], len - k); - return LV_DRAW_SW_MASK_RES_CHANGED; - } - } - else { - if(abs_x + len < 0) return LV_DRAW_SW_MASK_RES_TRANSP; - else { - int32_t k = - abs_x; - if(k < 0) k = 0; - if(k >= len) return LV_DRAW_SW_MASK_RES_TRANSP; - else if(k >= 0 && k < len) lv_memzero(&mask_buf[0], k); - return LV_DRAW_SW_MASK_RES_CHANGED; - } - } - } - } - - lv_draw_sw_mask_res_t res; - if(p->flat) { - res = line_mask_flat(mask_buf, abs_x, abs_y, len, p); - } - else { - res = line_mask_steep(mask_buf, abs_x, abs_y, len, p); - } - - return res; -} - -static lv_draw_sw_mask_res_t LV_ATTRIBUTE_FAST_MEM line_mask_flat(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, - int32_t len, - lv_draw_sw_mask_line_param_t * p) -{ - - int32_t y_at_x; - y_at_x = (int32_t)((int32_t)p->yx_steep * abs_x) >> 10; - - if(p->yx_steep > 0) { - if(y_at_x > abs_y) { - if(p->inv) { - return LV_DRAW_SW_MASK_RES_FULL_COVER; - } - else { - return LV_DRAW_SW_MASK_RES_TRANSP; - } - } - } - else { - if(y_at_x < abs_y) { - if(p->inv) { - return LV_DRAW_SW_MASK_RES_FULL_COVER; - } - else { - return LV_DRAW_SW_MASK_RES_TRANSP; - } - } - } - - /*At the end of the mask if the limit line is smaller than the mask's y. - *Then the mask is in the "good" area*/ - y_at_x = (int32_t)((int32_t)p->yx_steep * (abs_x + len)) >> 10; - if(p->yx_steep > 0) { - if(y_at_x < abs_y) { - if(p->inv) { - return LV_DRAW_SW_MASK_RES_TRANSP; - } - else { - return LV_DRAW_SW_MASK_RES_FULL_COVER; - } - } - } - else { - if(y_at_x > abs_y) { - if(p->inv) { - return LV_DRAW_SW_MASK_RES_TRANSP; - } - else { - return LV_DRAW_SW_MASK_RES_FULL_COVER; - } - } - } - - int32_t xe; - if(p->yx_steep > 0) xe = ((abs_y * 256) * p->xy_steep) >> 10; - else xe = (((abs_y + 1) * 256) * p->xy_steep) >> 10; - - int32_t xei = xe >> 8; - int32_t xef = xe & 0xFF; - - int32_t px_h; - if(xef == 0) px_h = 255; - else px_h = 255 - (((255 - xef) * p->spx) >> 8); - int32_t k = xei - abs_x; - lv_opa_t m; - - if(xef) { - if(k >= 0 && k < len) { - m = 255 - (((255 - xef) * (255 - px_h)) >> 9); - if(p->inv) m = 255 - m; - mask_buf[k] = mask_mix(mask_buf[k], m); - } - k++; - } - - while(px_h > p->spx) { - if(k >= 0 && k < len) { - m = px_h - (p->spx >> 1); - if(p->inv) m = 255 - m; - mask_buf[k] = mask_mix(mask_buf[k], m); - } - px_h -= p->spx; - k++; - if(k >= len) break; - } - - if(k < len && k >= 0) { - int32_t x_inters = (px_h * p->xy_steep) >> 10; - m = (x_inters * px_h) >> 9; - if(p->yx_steep < 0) m = 255 - m; - if(p->inv) m = 255 - m; - mask_buf[k] = mask_mix(mask_buf[k], m); - } - - if(p->inv) { - k = xei - abs_x; - if(k > len) { - return LV_DRAW_SW_MASK_RES_TRANSP; - } - if(k >= 0) { - lv_memzero(&mask_buf[0], k); - } - } - else { - k++; - if(k < 0) { - return LV_DRAW_SW_MASK_RES_TRANSP; - } - if(k <= len) { - lv_memzero(&mask_buf[k], len - k); - } - } - - return LV_DRAW_SW_MASK_RES_CHANGED; -} - -static lv_draw_sw_mask_res_t LV_ATTRIBUTE_FAST_MEM line_mask_steep(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, - int32_t len, - lv_draw_sw_mask_line_param_t * p) -{ - int32_t k; - int32_t x_at_y; - /*At the beginning of the mask if the limit line is greater than the mask's y. - *Then the mask is in the "wrong" area*/ - x_at_y = (int32_t)((int32_t)p->xy_steep * abs_y) >> 10; - if(p->xy_steep > 0) x_at_y++; - if(x_at_y < abs_x) { - if(p->inv) { - return LV_DRAW_SW_MASK_RES_FULL_COVER; - } - else { - return LV_DRAW_SW_MASK_RES_TRANSP; - } - } - - /*At the end of the mask if the limit line is smaller than the mask's y. - *Then the mask is in the "good" area*/ - x_at_y = (int32_t)((int32_t)p->xy_steep * (abs_y)) >> 10; - if(x_at_y > abs_x + len) { - if(p->inv) { - return LV_DRAW_SW_MASK_RES_TRANSP; - } - else { - return LV_DRAW_SW_MASK_RES_FULL_COVER; - } - } - - /*X start*/ - int32_t xs = ((abs_y * 256) * p->xy_steep) >> 10; - int32_t xsi = xs >> 8; - int32_t xsf = xs & 0xFF; - - /*X end*/ - int32_t xe = (((abs_y + 1) * 256) * p->xy_steep) >> 10; - int32_t xei = xe >> 8; - int32_t xef = xe & 0xFF; - - lv_opa_t m; - - k = xsi - abs_x; - if(xsi != xei && (p->xy_steep < 0 && xsf == 0)) { - xsf = 0xFF; - xsi = xei; - k--; - } - - if(xsi == xei) { - if(k >= 0 && k < len) { - m = (xsf + xef) >> 1; - if(p->inv) m = 255 - m; - mask_buf[k] = mask_mix(mask_buf[k], m); - } - k++; - - if(p->inv) { - k = xsi - abs_x; - if(k >= len) { - return LV_DRAW_SW_MASK_RES_TRANSP; - } - if(k >= 0) lv_memzero(&mask_buf[0], k); - - } - else { - if(k > len) k = len; - if(k == 0) return LV_DRAW_SW_MASK_RES_TRANSP; - else if(k > 0) lv_memzero(&mask_buf[k], len - k); - } - - } - else { - int32_t y_inters; - if(p->xy_steep < 0) { - y_inters = (xsf * (-p->yx_steep)) >> 10; - if(k >= 0 && k < len) { - m = (y_inters * xsf) >> 9; - if(p->inv) m = 255 - m; - mask_buf[k] = mask_mix(mask_buf[k], m); - } - k--; - - int32_t x_inters = ((255 - y_inters) * (-p->xy_steep)) >> 10; - - if(k >= 0 && k < len) { - m = 255 - (((255 - y_inters) * x_inters) >> 9); - if(p->inv) m = 255 - m; - mask_buf[k] = mask_mix(mask_buf[k], m); - } - - k += 2; - - if(p->inv) { - k = xsi - abs_x - 1; - - if(k > len) k = len; - else if(k > 0) lv_memzero(&mask_buf[0], k); - - } - else { - if(k > len) return LV_DRAW_SW_MASK_RES_FULL_COVER; - if(k >= 0) lv_memzero(&mask_buf[k], len - k); - } - - } - else { - y_inters = ((255 - xsf) * p->yx_steep) >> 10; - if(k >= 0 && k < len) { - m = 255 - ((y_inters * (255 - xsf)) >> 9); - if(p->inv) m = 255 - m; - mask_buf[k] = mask_mix(mask_buf[k], m); - } - - k++; - - int32_t x_inters = ((255 - y_inters) * p->xy_steep) >> 10; - if(k >= 0 && k < len) { - m = ((255 - y_inters) * x_inters) >> 9; - if(p->inv) m = 255 - m; - mask_buf[k] = mask_mix(mask_buf[k], m); - } - k++; - - if(p->inv) { - k = xsi - abs_x; - if(k > len) return LV_DRAW_SW_MASK_RES_TRANSP; - if(k >= 0) lv_memzero(&mask_buf[0], k); - - } - else { - if(k > len) k = len; - if(k == 0) return LV_DRAW_SW_MASK_RES_TRANSP; - else if(k > 0) lv_memzero(&mask_buf[k], len - k); - } - } - } - - return LV_DRAW_SW_MASK_RES_CHANGED; -} - -static lv_draw_sw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_angle(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, int32_t len, - lv_draw_sw_mask_angle_param_t * p) -{ - int32_t rel_y = abs_y - p->cfg.vertex_p.y; - int32_t rel_x = abs_x - p->cfg.vertex_p.x; - - if(p->cfg.start_angle < 180 && p->cfg.end_angle < 180 && - p->cfg.start_angle != 0 && p->cfg.end_angle != 0 && - p->cfg.start_angle > p->cfg.end_angle) { - - if(abs_y < p->cfg.vertex_p.y) { - return LV_DRAW_SW_MASK_RES_FULL_COVER; - } - - /*Start angle mask can work only from the end of end angle mask*/ - int32_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10; - int32_t start_angle_last = ((rel_y + 1) * p->start_line.xy_steep) >> 10; - - /*Do not let the line end cross the vertex else it will affect the opposite part*/ - if(p->cfg.start_angle > 270 && p->cfg.start_angle <= 359 && start_angle_last < 0) start_angle_last = 0; - else if(p->cfg.start_angle > 0 && p->cfg.start_angle <= 90 && start_angle_last < 0) start_angle_last = 0; - else if(p->cfg.start_angle > 90 && p->cfg.start_angle < 270 && start_angle_last > 0) start_angle_last = 0; - - if(p->cfg.end_angle > 270 && p->cfg.end_angle <= 359 && start_angle_last < 0) start_angle_last = 0; - else if(p->cfg.end_angle > 0 && p->cfg.end_angle <= 90 && start_angle_last < 0) start_angle_last = 0; - else if(p->cfg.end_angle > 90 && p->cfg.end_angle < 270 && start_angle_last > 0) start_angle_last = 0; - - int32_t dist = (end_angle_first - start_angle_last) >> 1; - - lv_draw_sw_mask_res_t res1 = LV_DRAW_SW_MASK_RES_FULL_COVER; - lv_draw_sw_mask_res_t res2 = LV_DRAW_SW_MASK_RES_FULL_COVER; - - int32_t tmp = start_angle_last + dist - rel_x; - if(tmp > len) tmp = len; - if(tmp > 0) { - res1 = lv_draw_mask_line(&mask_buf[0], abs_x, abs_y, tmp, &p->start_line); - if(res1 == LV_DRAW_SW_MASK_RES_TRANSP) { - lv_memzero(&mask_buf[0], tmp); - } - } - - if(tmp > len) tmp = len; - if(tmp < 0) tmp = 0; - res2 = lv_draw_mask_line(&mask_buf[tmp], abs_x + tmp, abs_y, len - tmp, &p->end_line); - if(res2 == LV_DRAW_SW_MASK_RES_TRANSP) { - lv_memzero(&mask_buf[tmp], len - tmp); - } - if(res1 == res2) return res1; - else return LV_DRAW_SW_MASK_RES_CHANGED; - } - else if(p->cfg.start_angle > 180 && p->cfg.end_angle > 180 && p->cfg.start_angle > p->cfg.end_angle) { - - if(abs_y > p->cfg.vertex_p.y) { - return LV_DRAW_SW_MASK_RES_FULL_COVER; - } - - /*Start angle mask can work only from the end of end angle mask*/ - int32_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10; - int32_t start_angle_last = ((rel_y + 1) * p->start_line.xy_steep) >> 10; - - /*Do not let the line end cross the vertex else it will affect the opposite part*/ - if(p->cfg.start_angle > 270 && p->cfg.start_angle <= 359 && start_angle_last < 0) start_angle_last = 0; - else if(p->cfg.start_angle > 0 && p->cfg.start_angle <= 90 && start_angle_last < 0) start_angle_last = 0; - else if(p->cfg.start_angle > 90 && p->cfg.start_angle < 270 && start_angle_last > 0) start_angle_last = 0; - - if(p->cfg.end_angle > 270 && p->cfg.end_angle <= 359 && start_angle_last < 0) start_angle_last = 0; - else if(p->cfg.end_angle > 0 && p->cfg.end_angle <= 90 && start_angle_last < 0) start_angle_last = 0; - else if(p->cfg.end_angle > 90 && p->cfg.end_angle < 270 && start_angle_last > 0) start_angle_last = 0; - - int32_t dist = (end_angle_first - start_angle_last) >> 1; - - lv_draw_sw_mask_res_t res1 = LV_DRAW_SW_MASK_RES_FULL_COVER; - lv_draw_sw_mask_res_t res2 = LV_DRAW_SW_MASK_RES_FULL_COVER; - - int32_t tmp = start_angle_last + dist - rel_x; - if(tmp > len) tmp = len; - if(tmp > 0) { - res1 = lv_draw_mask_line(&mask_buf[0], abs_x, abs_y, tmp, (lv_draw_sw_mask_line_param_t *)&p->end_line); - if(res1 == LV_DRAW_SW_MASK_RES_TRANSP) { - lv_memzero(&mask_buf[0], tmp); - } - } - - if(tmp > len) tmp = len; - if(tmp < 0) tmp = 0; - res2 = lv_draw_mask_line(&mask_buf[tmp], abs_x + tmp, abs_y, len - tmp, (lv_draw_sw_mask_line_param_t *)&p->start_line); - if(res2 == LV_DRAW_SW_MASK_RES_TRANSP) { - lv_memzero(&mask_buf[tmp], len - tmp); - } - if(res1 == res2) return res1; - else return LV_DRAW_SW_MASK_RES_CHANGED; - } - else { - - lv_draw_sw_mask_res_t res1 = LV_DRAW_SW_MASK_RES_FULL_COVER; - lv_draw_sw_mask_res_t res2 = LV_DRAW_SW_MASK_RES_FULL_COVER; - - if(p->cfg.start_angle == 180) { - if(abs_y < p->cfg.vertex_p.y) res1 = LV_DRAW_SW_MASK_RES_FULL_COVER; - else res1 = LV_DRAW_SW_MASK_RES_UNKNOWN; - } - else if(p->cfg.start_angle == 0) { - if(abs_y < p->cfg.vertex_p.y) res1 = LV_DRAW_SW_MASK_RES_UNKNOWN; - else res1 = LV_DRAW_SW_MASK_RES_FULL_COVER; - } - else if((p->cfg.start_angle < 180 && abs_y < p->cfg.vertex_p.y) || - (p->cfg.start_angle > 180 && abs_y >= p->cfg.vertex_p.y)) { - res1 = LV_DRAW_SW_MASK_RES_UNKNOWN; - } - else { - res1 = lv_draw_mask_line(mask_buf, abs_x, abs_y, len, &p->start_line); - } - - if(p->cfg.end_angle == 180) { - if(abs_y < p->cfg.vertex_p.y) res2 = LV_DRAW_SW_MASK_RES_UNKNOWN; - else res2 = LV_DRAW_SW_MASK_RES_FULL_COVER; - } - else if(p->cfg.end_angle == 0) { - if(abs_y < p->cfg.vertex_p.y) res2 = LV_DRAW_SW_MASK_RES_FULL_COVER; - else res2 = LV_DRAW_SW_MASK_RES_UNKNOWN; - } - else if((p->cfg.end_angle < 180 && abs_y < p->cfg.vertex_p.y) || - (p->cfg.end_angle > 180 && abs_y >= p->cfg.vertex_p.y)) { - res2 = LV_DRAW_SW_MASK_RES_UNKNOWN; - } - else { - res2 = lv_draw_mask_line(mask_buf, abs_x, abs_y, len, &p->end_line); - } - - if(res1 == LV_DRAW_SW_MASK_RES_TRANSP || res2 == LV_DRAW_SW_MASK_RES_TRANSP) return LV_DRAW_SW_MASK_RES_TRANSP; - else if(res1 == LV_DRAW_SW_MASK_RES_UNKNOWN && res2 == LV_DRAW_SW_MASK_RES_UNKNOWN) return LV_DRAW_SW_MASK_RES_TRANSP; - else if(res1 == LV_DRAW_SW_MASK_RES_FULL_COVER && - res2 == LV_DRAW_SW_MASK_RES_FULL_COVER) return LV_DRAW_SW_MASK_RES_FULL_COVER; - else return LV_DRAW_SW_MASK_RES_CHANGED; - } -} - -static lv_draw_sw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_radius(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, int32_t len, - lv_draw_sw_mask_radius_param_t * p) -{ - bool outer = p->cfg.outer; - int32_t radius = p->cfg.radius; - lv_area_t rect; - lv_area_copy(&rect, &p->cfg.rect); - - if(outer == false) { - if((abs_y < rect.y1 || abs_y > rect.y2)) { - return LV_DRAW_SW_MASK_RES_TRANSP; - } - } - else { - if(abs_y < rect.y1 || abs_y > rect.y2) { - return LV_DRAW_SW_MASK_RES_FULL_COVER; - } - } - - if((abs_x >= rect.x1 + radius && abs_x + len <= rect.x2 - radius) || - (abs_y >= rect.y1 + radius && abs_y <= rect.y2 - radius)) { - if(outer == false) { - /*Remove the edges*/ - int32_t last = rect.x1 - abs_x; - if(last > len) return LV_DRAW_SW_MASK_RES_TRANSP; - if(last >= 0) { - lv_memzero(&mask_buf[0], last); - } - - int32_t first = rect.x2 - abs_x + 1; - if(first <= 0) return LV_DRAW_SW_MASK_RES_TRANSP; - else if(first < len) { - lv_memzero(&mask_buf[first], len - first); - } - if(last == 0 && first == len) return LV_DRAW_SW_MASK_RES_FULL_COVER; - else return LV_DRAW_SW_MASK_RES_CHANGED; - } - else { - int32_t first = rect.x1 - abs_x; - if(first < 0) first = 0; - if(first <= len) { - int32_t last = rect.x2 - abs_x - first + 1; - if(first + last > len) last = len - first; - if(last >= 0) { - lv_memzero(&mask_buf[first], last); - } - } - } - return LV_DRAW_SW_MASK_RES_CHANGED; - } - - int32_t k = rect.x1 - abs_x; /*First relevant coordinate on the of the mask*/ - int32_t w = lv_area_get_width(&rect); - int32_t h = lv_area_get_height(&rect); - abs_x -= rect.x1; - abs_y -= rect.y1; - - int32_t aa_len; - int32_t x_start; - int32_t cir_y; - if(abs_y < radius) { - cir_y = radius - abs_y - 1; - } - else { - cir_y = abs_y - (h - radius); - } - lv_opa_t * aa_opa = get_next_line(p->circle, cir_y, &aa_len, &x_start); - int32_t cir_x_right = k + w - radius + x_start; - int32_t cir_x_left = k + radius - x_start - 1; - int32_t i; - - if(outer == false) { - for(i = 0; i < aa_len; i++) { - lv_opa_t opa = aa_opa[aa_len - i - 1]; - if(cir_x_right + i >= 0 && cir_x_right + i < len) { - mask_buf[cir_x_right + i] = mask_mix(opa, mask_buf[cir_x_right + i]); - } - if(cir_x_left - i >= 0 && cir_x_left - i < len) { - mask_buf[cir_x_left - i] = mask_mix(opa, mask_buf[cir_x_left - i]); - } - } - - /*Clean the right side*/ - cir_x_right = LV_CLAMP(0, cir_x_right + i, len); - lv_memzero(&mask_buf[cir_x_right], len - cir_x_right); - - /*Clean the left side*/ - cir_x_left = LV_CLAMP(0, cir_x_left - aa_len + 1, len); - lv_memzero(&mask_buf[0], cir_x_left); - } - else { - for(i = 0; i < aa_len; i++) { - lv_opa_t opa = 255 - (aa_opa[aa_len - 1 - i]); - if(cir_x_right + i >= 0 && cir_x_right + i < len) { - mask_buf[cir_x_right + i] = mask_mix(opa, mask_buf[cir_x_right + i]); - } - if(cir_x_left - i >= 0 && cir_x_left - i < len) { - mask_buf[cir_x_left - i] = mask_mix(opa, mask_buf[cir_x_left - i]); - } - } - - int32_t clr_start = LV_CLAMP(0, cir_x_left + 1, len); - int32_t clr_len = LV_CLAMP(0, cir_x_right - clr_start, len - clr_start); - lv_memzero(&mask_buf[clr_start], clr_len); - } - - return LV_DRAW_SW_MASK_RES_CHANGED; -} - -static lv_draw_sw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_fade(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, int32_t len, - lv_draw_sw_mask_fade_param_t * p) -{ - if(abs_y < p->cfg.coords.y1) return LV_DRAW_SW_MASK_RES_FULL_COVER; - if(abs_y > p->cfg.coords.y2) return LV_DRAW_SW_MASK_RES_FULL_COVER; - if(abs_x + len < p->cfg.coords.x1) return LV_DRAW_SW_MASK_RES_FULL_COVER; - if(abs_x > p->cfg.coords.x2) return LV_DRAW_SW_MASK_RES_FULL_COVER; - - if(abs_x + len > p->cfg.coords.x2) len -= abs_x + len - p->cfg.coords.x2 - 1; - - if(abs_x < p->cfg.coords.x1) { - int32_t x_ofs = 0; - x_ofs = p->cfg.coords.x1 - abs_x; - len -= x_ofs; - mask_buf += x_ofs; - } - - int32_t i; - - if(abs_y <= p->cfg.y_top) { - for(i = 0; i < len; i++) { - mask_buf[i] = mask_mix(mask_buf[i], p->cfg.opa_top); - } - return LV_DRAW_SW_MASK_RES_CHANGED; - } - else if(abs_y >= p->cfg.y_bottom) { - for(i = 0; i < len; i++) { - mask_buf[i] = mask_mix(mask_buf[i], p->cfg.opa_bottom); - } - return LV_DRAW_SW_MASK_RES_CHANGED; - } - else { - /*Calculate the opa proportionally*/ - int16_t opa_diff = p->cfg.opa_bottom - p->cfg.opa_top; - int32_t y_diff = p->cfg.y_bottom - p->cfg.y_top + 1; - lv_opa_t opa_act = LV_OPA_MIX2(abs_y - p->cfg.y_top, opa_diff) / y_diff; - opa_act += p->cfg.opa_top; - - for(i = 0; i < len; i++) { - mask_buf[i] = mask_mix(mask_buf[i], opa_act); - } - return LV_DRAW_SW_MASK_RES_CHANGED; - } -} - -static lv_draw_sw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_map(lv_opa_t * mask_buf, int32_t abs_x, - int32_t abs_y, int32_t len, - lv_draw_sw_mask_map_param_t * p) -{ - /*Handle out of the mask cases*/ - if(abs_y < p->cfg.coords.y1) return LV_DRAW_SW_MASK_RES_FULL_COVER; - if(abs_y > p->cfg.coords.y2) return LV_DRAW_SW_MASK_RES_FULL_COVER; - if(abs_x + len < p->cfg.coords.x1) return LV_DRAW_SW_MASK_RES_FULL_COVER; - if(abs_x > p->cfg.coords.x2) return LV_DRAW_SW_MASK_RES_FULL_COVER; - - /*Got to the current row in the map*/ - const lv_opa_t * map_tmp = p->cfg.map; - map_tmp += (abs_y - p->cfg.coords.y1) * lv_area_get_width(&p->cfg.coords); - - if(abs_x + len > p->cfg.coords.x2) len -= abs_x + len - p->cfg.coords.x2 - 1; - - if(abs_x < p->cfg.coords.x1) { - int32_t x_ofs = 0; - x_ofs = p->cfg.coords.x1 - abs_x; - len -= x_ofs; - mask_buf += x_ofs; - } - else { - map_tmp += (abs_x - p->cfg.coords.x1); - } - - int32_t i; - for(i = 0; i < len; i++) { - mask_buf[i] = mask_mix(mask_buf[i], map_tmp[i]); - } - - return LV_DRAW_SW_MASK_RES_CHANGED; -} - -/** - * Initialize the circle drawing - * @param c pointer to a point. The coordinates will be calculated here - * @param tmp point to a variable. It will store temporary data - * @param radius radius of the circle - */ -static void circ_init(lv_point_t * c, int32_t * tmp, int32_t radius) -{ - c->x = radius; - c->y = 0; - *tmp = 1 - radius; -} - -/** - * Test the circle drawing is ready or not - * @param c same as in circ_init - * @return true if the circle is not ready yet - */ -static bool circ_cont(lv_point_t * c) -{ - return c->y <= c->x; -} - -/** - * Get the next point from the circle - * @param c same as in circ_init. The next point stored here. - * @param tmp same as in circ_init. - */ -static void circ_next(lv_point_t * c, int32_t * tmp) -{ - - if(*tmp <= 0) { - (*tmp) += 2 * c->y + 3; /*Change in decision criterion for y -> y+1*/ - } - else { - (*tmp) += 2 * (c->y - c->x) + 5; /*Change for y -> y+1, x -> x-1*/ - c->x--; - } - c->y++; -} - -static void circ_calc_aa4(lv_draw_sw_mask_radius_circle_dsc_t * c, int32_t radius) -{ - if(radius == 0) return; - c->radius = radius; - - /*Allocate buffers*/ - if(c->buf) lv_free(c->buf); - - c->buf = lv_malloc(radius * 6 + 6); /*Use uint16_t for opa_start_on_y and x_start_on_y*/ - LV_ASSERT_MALLOC(c->buf); - c->cir_opa = c->buf; - c->opa_start_on_y = (uint16_t *)(c->buf + 2 * radius + 2); - c->x_start_on_y = (uint16_t *)(c->buf + 4 * radius + 4); - - /*Special case, handle manually*/ - if(radius == 1) { - c->cir_opa[0] = 180; - c->opa_start_on_y[0] = 0; - c->opa_start_on_y[1] = 1; - c->x_start_on_y[0] = 0; - return; - } - - const size_t cir_xy_size = (radius + 1) * 2 * 2 * sizeof(int32_t); - int32_t * cir_x = lv_malloc_zeroed(cir_xy_size); - int32_t * cir_y = &cir_x[(radius + 1) * 2]; - - uint32_t y_8th_cnt = 0; - lv_point_t cp; - int32_t tmp; - circ_init(&cp, &tmp, radius * 4); /*Upscale by 4*/ - int32_t i; - - uint32_t x_int[4]; - uint32_t x_fract[4]; - int32_t cir_size = 0; - x_int[0] = cp.x >> 2; - x_fract[0] = 0; - - /*Calculate an 1/8 circle*/ - while(circ_cont(&cp)) { - /*Calculate 4 point of the circle */ - for(i = 0; i < 4; i++) { - circ_next(&cp, &tmp); - if(circ_cont(&cp) == false) break; - x_int[i] = cp.x >> 2; - x_fract[i] = cp.x & 0x3; - } - if(i != 4) break; - - /*All lines on the same x when downscaled*/ - if(x_int[0] == x_int[3]) { - cir_x[cir_size] = x_int[0]; - cir_y[cir_size] = y_8th_cnt; - c->cir_opa[cir_size] = x_fract[0] + x_fract[1] + x_fract[2] + x_fract[3]; - c->cir_opa[cir_size] *= 16; - cir_size++; - } - /*Second line on new x when downscaled*/ - else if(x_int[0] != x_int[1]) { - cir_x[cir_size] = x_int[0]; - cir_y[cir_size] = y_8th_cnt; - c->cir_opa[cir_size] = x_fract[0]; - c->cir_opa[cir_size] *= 16; - cir_size++; - - cir_x[cir_size] = x_int[0] - 1; - cir_y[cir_size] = y_8th_cnt; - c->cir_opa[cir_size] = 1 * 4 + x_fract[1] + x_fract[2] + x_fract[3];; - c->cir_opa[cir_size] *= 16; - cir_size++; - } - /*Third line on new x when downscaled*/ - else if(x_int[0] != x_int[2]) { - cir_x[cir_size] = x_int[0]; - cir_y[cir_size] = y_8th_cnt; - c->cir_opa[cir_size] = x_fract[0] + x_fract[1]; - c->cir_opa[cir_size] *= 16; - cir_size++; - - cir_x[cir_size] = x_int[0] - 1; - cir_y[cir_size] = y_8th_cnt; - c->cir_opa[cir_size] = 2 * 4 + x_fract[2] + x_fract[3];; - c->cir_opa[cir_size] *= 16; - cir_size++; - } - /*Forth line on new x when downscaled*/ - else { - cir_x[cir_size] = x_int[0]; - cir_y[cir_size] = y_8th_cnt; - c->cir_opa[cir_size] = x_fract[0] + x_fract[1] + x_fract[2]; - c->cir_opa[cir_size] *= 16; - cir_size++; - - cir_x[cir_size] = x_int[0] - 1; - cir_y[cir_size] = y_8th_cnt; - c->cir_opa[cir_size] = 3 * 4 + x_fract[3];; - c->cir_opa[cir_size] *= 16; - cir_size++; - } - - y_8th_cnt++; - } - - /*The point on the 1/8 circle is special, calculate it manually*/ - int32_t mid = radius * 723; - int32_t mid_int = mid >> 10; - if(cir_x[cir_size - 1] != mid_int || cir_y[cir_size - 1] != mid_int) { - int32_t tmp_val = mid - (mid_int << 10); - if(tmp_val <= 512) { - tmp_val = tmp_val * tmp_val * 2; - tmp_val = tmp_val >> (10 + 6); - } - else { - tmp_val = 1024 - tmp_val; - tmp_val = tmp_val * tmp_val * 2; - tmp_val = tmp_val >> (10 + 6); - tmp_val = 15 - tmp_val; - } - - cir_x[cir_size] = mid_int; - cir_y[cir_size] = mid_int; - c->cir_opa[cir_size] = tmp_val; - c->cir_opa[cir_size] *= 16; - cir_size++; - } - - /*Build the second octet by mirroring the first*/ - for(i = cir_size - 2; i >= 0; i--, cir_size++) { - cir_x[cir_size] = cir_y[i]; - cir_y[cir_size] = cir_x[i]; - c->cir_opa[cir_size] = c->cir_opa[i]; - } - - int32_t y = 0; - i = 0; - c->opa_start_on_y[0] = 0; - while(i < cir_size) { - c->opa_start_on_y[y] = i; - c->x_start_on_y[y] = cir_x[i]; - for(; cir_y[i] == y && i < (int32_t)cir_size; i++) { - c->x_start_on_y[y] = LV_MIN(c->x_start_on_y[y], cir_x[i]); - } - y++; - } - - lv_free(cir_x); -} - -static lv_opa_t * get_next_line(lv_draw_sw_mask_radius_circle_dsc_t * c, int32_t y, int32_t * len, - int32_t * x_start) -{ - *len = c->opa_start_on_y[y + 1] - c->opa_start_on_y[y]; - *x_start = c->x_start_on_y[y]; - return &c->cir_opa[c->opa_start_on_y[y]]; -} - -static inline lv_opa_t LV_ATTRIBUTE_FAST_MEM mask_mix(lv_opa_t mask_act, lv_opa_t mask_new) -{ - if(mask_new >= LV_OPA_MAX) return mask_act; - if(mask_new <= LV_OPA_MIN) return 0; - - return LV_UDIV255(mask_act * mask_new); -} - -#endif /*LV_DRAW_SW_COMPLEX*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask.h b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask.h deleted file mode 100644 index 3f7b306..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask.h +++ /dev/null @@ -1,185 +0,0 @@ -/** - * @file lv_draw_sw_mask.h - * - */ - -#ifndef LV_DRAW_SW_MASK_H -#define LV_DRAW_SW_MASK_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../misc/lv_area.h" -#include "../../misc/lv_color.h" -#include "../../misc/lv_math.h" -#include "../../misc/lv_types.h" - -/********************* - * DEFINES - *********************/ -#define LV_MASK_ID_INV (-1) -#if LV_DRAW_SW_COMPLEX -# define LV_MASK_MAX_NUM 16 -#else -# define LV_MASK_MAX_NUM 1 -#endif - -/********************** - * TYPEDEFS - **********************/ - -typedef enum { - LV_DRAW_SW_MASK_RES_TRANSP, - LV_DRAW_SW_MASK_RES_FULL_COVER, - LV_DRAW_SW_MASK_RES_CHANGED, - LV_DRAW_SW_MASK_RES_UNKNOWN -} lv_draw_sw_mask_res_t; - -#if LV_DRAW_SW_COMPLEX - -typedef enum { - LV_DRAW_SW_MASK_TYPE_LINE, - LV_DRAW_SW_MASK_TYPE_ANGLE, - LV_DRAW_SW_MASK_TYPE_RADIUS, - LV_DRAW_SW_MASK_TYPE_FADE, - LV_DRAW_SW_MASK_TYPE_MAP, -} lv_draw_sw_mask_type_t; - -typedef enum { - LV_DRAW_SW_MASK_LINE_SIDE_LEFT = 0, - LV_DRAW_SW_MASK_LINE_SIDE_RIGHT, - LV_DRAW_SW_MASK_LINE_SIDE_TOP, - LV_DRAW_SW_MASK_LINE_SIDE_BOTTOM, -} lv_draw_sw_mask_line_side_t; - -/** - * A common callback type for every mask type. - * Used internally by the library. - */ -typedef lv_draw_sw_mask_res_t (*lv_draw_sw_mask_xcb_t)(lv_opa_t * mask_buf, int32_t abs_x, int32_t abs_y, - int32_t len, - void * p); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_draw_sw_mask_init(void); - -void lv_draw_sw_mask_deinit(void); - -//! @cond Doxygen_Suppress - -/** - * Apply the added buffers on a line. Used internally by the library's drawing routines. - * @param masks the masks list to apply, must be ended with NULL pointer in array. - * @param mask_buf store the result mask here. Has to be `len` byte long. Should be initialized with `0xFF`. - * @param abs_x absolute X coordinate where the line to calculate start - * @param abs_y absolute Y coordinate where the line to calculate start - * @param len length of the line to calculate (in pixel count) - * @return One of these values: - * - `LV_DRAW_MASK_RES_FULL_TRANSP`: the whole line is transparent. `mask_buf` is not set to zero - * - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged - * - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line - */ -lv_draw_sw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_mask_apply(void * masks[], lv_opa_t * mask_buf, - int32_t abs_x, - int32_t abs_y, - int32_t len); - -//! @endcond - -/** - * Free the data from the parameter. - * It's called inside `lv_draw_sw_mask_remove_id` and `lv_draw_sw_mask_remove_custom` - * Needs to be called only in special cases when the mask is not added by `lv_draw_mask_add` - * and not removed by `lv_draw_mask_remove_id` or `lv_draw_mask_remove_custom` - * @param p pointer to a mask parameter - */ -void lv_draw_sw_mask_free_param(void * p); - -/** - *Initialize a line mask from two points. - * @param param pointer to a `lv_draw_mask_param_t` to initialize - * @param p1x X coordinate of the first point of the line - * @param p1y Y coordinate of the first point of the line - * @param p2x X coordinate of the second point of the line - * @param p2y y coordinate of the second point of the line - * @param side and element of `lv_draw_mask_line_side_t` to describe which side to keep. - * With `LV_DRAW_MASK_LINE_SIDE_LEFT/RIGHT` and horizontal line all pixels are kept - * With `LV_DRAW_MASK_LINE_SIDE_TOP/BOTTOM` and vertical line all pixels are kept - */ -void lv_draw_sw_mask_line_points_init(lv_draw_sw_mask_line_param_t * param, int32_t p1x, int32_t p1y, - int32_t p2x, - int32_t p2y, lv_draw_sw_mask_line_side_t side); - -/** - *Initialize a line mask from a point and an angle. - * @param param pointer to a `lv_draw_mask_param_t` to initialize - * @param px X coordinate of a point of the line - * @param py X coordinate of a point of the line - * @param angle right 0 deg, bottom: 90 - * @param side an element of `lv_draw_mask_line_side_t` to describe which side to keep. - * With `LV_DRAW_MASK_LINE_SIDE_LEFT/RIGHT` and horizontal line all pixels are kept - * With `LV_DRAW_MASK_LINE_SIDE_TOP/BOTTOM` and vertical line all pixels are kept - */ -void lv_draw_sw_mask_line_angle_init(lv_draw_sw_mask_line_param_t * param, int32_t px, int32_t py, int16_t angle, - lv_draw_sw_mask_line_side_t side); - -/** - * Initialize an angle mask. - * @param param pointer to a `lv_draw_mask_param_t` to initialize - * @param vertex_x X coordinate of the angle vertex (absolute coordinates) - * @param vertex_y Y coordinate of the angle vertex (absolute coordinates) - * @param start_angle start angle in degrees. 0 deg on the right, 90 deg, on the bottom - * @param end_angle end angle - */ -void lv_draw_sw_mask_angle_init(lv_draw_sw_mask_angle_param_t * param, int32_t vertex_x, int32_t vertex_y, - int32_t start_angle, int32_t end_angle); - -/** - * Initialize a fade mask. - * @param param pointer to an `lv_draw_mask_radius_param_t` to initialize - * @param rect coordinates of the rectangle to affect (absolute coordinates) - * @param radius radius of the rectangle - * @param inv true: keep the pixels inside the rectangle; keep the pixels outside of the rectangle - */ -void lv_draw_sw_mask_radius_init(lv_draw_sw_mask_radius_param_t * param, const lv_area_t * rect, int32_t radius, - bool inv); - -/** - * Initialize a fade mask. - * @param param pointer to a `lv_draw_mask_param_t` to initialize - * @param coords coordinates of the area to affect (absolute coordinates) - * @param opa_top opacity on the top - * @param y_top at which coordinate start to change to opacity to `opa_bottom` - * @param opa_bottom opacity at the bottom - * @param y_bottom at which coordinate reach `opa_bottom`. - */ -void lv_draw_sw_mask_fade_init(lv_draw_sw_mask_fade_param_t * param, const lv_area_t * coords, lv_opa_t opa_top, - int32_t y_top, - lv_opa_t opa_bottom, int32_t y_bottom); - -/** - * Initialize a map mask. - * @param param pointer to a `lv_draw_mask_param_t` to initialize - * @param coords coordinates of the map (absolute coordinates) - * @param map array of bytes with the mask values - */ -void lv_draw_sw_mask_map_init(lv_draw_sw_mask_map_param_t * param, const lv_area_t * coords, const lv_opa_t * map); - -#endif /*LV_DRAW_SW_COMPLEX*/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_MASK_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask_private.h b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask_private.h deleted file mode 100644 index aeae9b8..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask_private.h +++ /dev/null @@ -1,157 +0,0 @@ -/** - * @file lv_draw_sw_mask_private.h - * - */ - -#ifndef LV_DRAW_SW_MASK_PRIVATE_H -#define LV_DRAW_SW_MASK_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_sw_mask.h" - -#if LV_DRAW_SW_COMPLEX - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - uint8_t * buf; - lv_opa_t * cir_opa; /**< Opacity of values on the circumference of an 1/4 circle */ - uint16_t * x_start_on_y; /**< The x coordinate of the circle for each y value */ - uint16_t * opa_start_on_y; /**< The index of `cir_opa` for each y value */ - int32_t life; /**< How many times the entry way used */ - uint32_t used_cnt; /**< Like a semaphore to count the referencing masks */ - int32_t radius; /**< The radius of the entry */ -} lv_draw_sw_mask_radius_circle_dsc_t; - -struct lv_draw_sw_mask_common_dsc_t { - lv_draw_sw_mask_xcb_t cb; - lv_draw_sw_mask_type_t type; -}; - -struct lv_draw_sw_mask_line_param_t { - /** The first element must be the common descriptor */ - lv_draw_sw_mask_common_dsc_t dsc; - - struct { - /*First point*/ - lv_point_t p1; - - /*Second point*/ - lv_point_t p2; - - /*Which side to keep?*/ - lv_draw_sw_mask_line_side_t side : 2; - } cfg; - - /** A point of the line */ - lv_point_t origo; - - /** X / (1024*Y) steepness (X is 0..1023 range). What is the change of X in 1024 Y? */ - int32_t xy_steep; - - /** Y / (1024*X) steepness (Y is 0..1023 range). What is the change of Y in 1024 X? */ - int32_t yx_steep; - - /** Helper which stores yx_steep for flat lines and xy_steep for steep (non flat) lines */ - int32_t steep; - - /** Steepness in 1 px in 0..255 range. Used only by flat lines. */ - int32_t spx; - - /** 1: It's a flat line? (Near to horizontal) */ - uint8_t flat : 1; - - /** Invert the mask. The default is: Keep the left part. - *It is used to select left/right/top/bottom */ - uint8_t inv: 1; -}; - -struct lv_draw_sw_mask_angle_param_t { - /** The first element must be the common descriptor */ - lv_draw_sw_mask_common_dsc_t dsc; - - struct { - lv_point_t vertex_p; - int32_t start_angle; - int32_t end_angle; - } cfg; - - lv_draw_sw_mask_line_param_t start_line; - lv_draw_sw_mask_line_param_t end_line; - uint16_t delta_deg; -}; - -struct lv_draw_sw_mask_radius_param_t { - /** The first element must be the common descriptor */ - lv_draw_sw_mask_common_dsc_t dsc; - - struct { - lv_area_t rect; - int32_t radius; - /** Invert the mask. 0: Keep the pixels inside. */ - uint8_t outer: 1; - } cfg; - - lv_draw_sw_mask_radius_circle_dsc_t * circle; -}; - -struct lv_draw_sw_mask_fade_param_t { - /** The first element must be the common descriptor */ - lv_draw_sw_mask_common_dsc_t dsc; - - struct { - lv_area_t coords; - int32_t y_top; - int32_t y_bottom; - lv_opa_t opa_top; - lv_opa_t opa_bottom; - } cfg; - -}; - -struct lv_draw_sw_mask_map_param_t { - /** The first element must be the common descriptor */ - lv_draw_sw_mask_common_dsc_t dsc; - - struct { - lv_area_t coords; - const lv_opa_t * map; - } cfg; -}; - -typedef lv_draw_sw_mask_radius_circle_dsc_t lv_draw_sw_mask_radius_circle_dsc_arr_t[LV_DRAW_SW_CIRCLE_CACHE_SIZE]; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Called by LVGL the rendering of a screen is ready to clean up - * the temporal (cache) data of the masks - */ -void lv_draw_sw_mask_cleanup(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_DRAW_SW_COMPLEX*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_MASK_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask_rect.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask_rect.c deleted file mode 100644 index bd28d0d..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_mask_rect.c +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @file lv_draw_sw_mask_rect.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../misc/lv_area_private.h" -#include "../lv_draw_mask_private.h" -#include "../lv_draw_private.h" -#if LV_USE_DRAW_SW -#if LV_DRAW_SW_COMPLEX - -#include "../../misc/lv_math.h" -#include "../../misc/lv_log.h" -#include "../../stdlib/lv_mem.h" -#include "../../stdlib/lv_string.h" -#include "lv_draw_sw.h" -#include "lv_draw_sw_mask_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_sw_mask_rect(lv_draw_unit_t * draw_unit, const lv_draw_mask_rect_dsc_t * dsc, const lv_area_t * coords) -{ - LV_UNUSED(coords); - - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, &dsc->area, draw_unit->clip_area)) { - return; - } - - lv_layer_t * target_layer = draw_unit->target_layer; - lv_area_t * buf_area = &target_layer->buf_area; - lv_area_t clear_area; - - void * draw_buf = target_layer->draw_buf; - - /*Clear the top part*/ - lv_area_set(&clear_area, draw_unit->clip_area->x1, draw_unit->clip_area->y1, draw_unit->clip_area->x2, - dsc->area.y1 - 1); - lv_area_move(&clear_area, -buf_area->x1, -buf_area->y1); - lv_draw_buf_clear(draw_buf, &clear_area); - - /*Clear the bottom part*/ - lv_area_set(&clear_area, draw_unit->clip_area->x1, dsc->area.y2 + 1, draw_unit->clip_area->x2, - draw_unit->clip_area->y2); - lv_area_move(&clear_area, -buf_area->x1, -buf_area->y1); - lv_draw_buf_clear(draw_buf, &clear_area); - - /*Clear the left part*/ - lv_area_set(&clear_area, draw_unit->clip_area->x1, dsc->area.y1, dsc->area.x1 - 1, dsc->area.y2); - lv_area_move(&clear_area, -buf_area->x1, -buf_area->y1); - lv_draw_buf_clear(draw_buf, &clear_area); - - /*Clear the right part*/ - lv_area_set(&clear_area, dsc->area.x2 + 1, dsc->area.y1, draw_unit->clip_area->x2, dsc->area.y2); - lv_area_move(&clear_area, -buf_area->x1, -buf_area->y1); - lv_draw_buf_clear(draw_buf, &clear_area); - - lv_draw_sw_mask_radius_param_t param; - lv_draw_sw_mask_radius_init(¶m, &dsc->area, dsc->radius, false); - - void * masks[2] = {0}; - masks[0] = ¶m; - - uint32_t area_w = lv_area_get_width(&draw_area); - lv_opa_t * mask_buf = lv_malloc(area_w); - - int32_t y; - for(y = draw_area.y1; y <= draw_area.y2; y++) { - lv_memset(mask_buf, 0xff, area_w); - lv_draw_sw_mask_res_t res = lv_draw_sw_mask_apply(masks, mask_buf, draw_area.x1, y, area_w); - if(res == LV_DRAW_SW_MASK_RES_FULL_COVER) continue; - - lv_color32_t * c32_buf = lv_draw_layer_go_to_xy(target_layer, draw_area.x1 - buf_area->x1, - y - buf_area->y1); - - if(res == LV_DRAW_SW_MASK_RES_TRANSP) { - lv_memzero(c32_buf, area_w * sizeof(lv_color32_t)); - } - else { - uint32_t i; - for(i = 0; i < area_w; i++) { - if(mask_buf[i] != LV_OPA_COVER) { - c32_buf[i].alpha = LV_OPA_MIX2(c32_buf[i].alpha, mask_buf[i]); - } - } - } - } - - lv_free(mask_buf); - lv_draw_sw_mask_free_param(¶m); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#else /*LV_DRAW_SW_COMPLEX*/ - -void lv_draw_sw_mask_rect(lv_draw_unit_t * draw_unit, const lv_draw_mask_rect_dsc_t * dsc, const lv_area_t * coords) -{ - LV_UNUSED(draw_unit); - LV_UNUSED(dsc); - LV_UNUSED(coords); - - LV_LOG_WARN("LV_DRAW_SW_COMPLEX needs to be enabled"); -} - -#endif /*LV_DRAW_SW_COMPLEX*/ -#endif /*LV_USE_DRAW_SW*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_polygon.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_polygon.c new file mode 100644 index 0000000..a05b471 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_polygon.c @@ -0,0 +1,207 @@ +/** + * @file lv_draw_sw_polygon.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_draw_sw.h" +#include "../../misc/lv_math.h" +#include "../../misc/lv_mem.h" +#include "../../misc/lv_area.h" +#include "../../misc/lv_color.h" +#include "../lv_draw_rect.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Draw a polygon. Only convex polygons are supported + * @param points an array of points + * @param point_cnt number of points + * @param clip_area polygon will be drawn only in this area + * @param draw_dsc pointer to an initialized `lv_draw_rect_dsc_t` variable + */ +void lv_draw_sw_polygon(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc, const lv_point_t * points, + uint16_t point_cnt) +{ +#if LV_DRAW_COMPLEX + if(point_cnt < 3) return; + if(points == NULL) return; + + /*Join adjacent points if they are on the same coordinate*/ + lv_point_t * p = lv_mem_buf_get(point_cnt * sizeof(lv_point_t)); + if(p == NULL) return; + uint16_t i; + uint16_t pcnt = 0; + p[0] = points[0]; + for(i = 0; i < point_cnt - 1; i++) { + if(points[i].x != points[i + 1].x || points[i].y != points[i + 1].y) { + p[pcnt] = points[i]; + pcnt++; + } + } + /*The first and the last points are also adjacent*/ + if(points[0].x != points[point_cnt - 1].x || points[0].y != points[point_cnt - 1].y) { + p[pcnt] = points[point_cnt - 1]; + pcnt++; + } + + point_cnt = pcnt; + if(point_cnt < 3) { + lv_mem_buf_release(p); + return; + } + + lv_area_t poly_coords = {.x1 = LV_COORD_MAX, .y1 = LV_COORD_MAX, .x2 = LV_COORD_MIN, .y2 = LV_COORD_MIN}; + + for(i = 0; i < point_cnt; i++) { + poly_coords.x1 = LV_MIN(poly_coords.x1, p[i].x); + poly_coords.y1 = LV_MIN(poly_coords.y1, p[i].y); + poly_coords.x2 = LV_MAX(poly_coords.x2, p[i].x); + poly_coords.y2 = LV_MAX(poly_coords.y2, p[i].y); + } + + bool is_common; + lv_area_t clip_area; + is_common = _lv_area_intersect(&clip_area, &poly_coords, draw_ctx->clip_area); + if(!is_common) { + lv_mem_buf_release(p); + return; + } + + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_area; + + /*Find the lowest point*/ + lv_coord_t y_min = p[0].y; + int16_t y_min_i = 0; + + for(i = 1; i < point_cnt; i++) { + if(p[i].y < y_min) { + y_min = p[i].y; + y_min_i = i; + } + } + + lv_draw_mask_line_param_t * mp = lv_mem_buf_get(sizeof(lv_draw_mask_line_param_t) * point_cnt); + lv_draw_mask_line_param_t * mp_next = mp; + + int32_t i_prev_left = y_min_i; + int32_t i_prev_right = y_min_i; + int32_t i_next_left; + int32_t i_next_right; + uint32_t mask_cnt = 0; + + /*Get the index of the left and right points*/ + i_next_left = y_min_i - 1; + if(i_next_left < 0) i_next_left = point_cnt + i_next_left; + + i_next_right = y_min_i + 1; + if(i_next_right > point_cnt - 1) i_next_right = 0; + + /** + * Check if the order of points is inverted or not. + * The normal case is when the left point is on `y_min_i - 1` + * Explanation: + * if angle(p_left) < angle(p_right) -> inverted + * dy_left/dx_left < dy_right/dx_right + * dy_left * dx_right < dy_right * dx_left + */ + lv_coord_t dxl = p[i_next_left].x - p[y_min_i].x; + lv_coord_t dxr = p[i_next_right].x - p[y_min_i].x; + lv_coord_t dyl = p[i_next_left].y - p[y_min_i].y; + lv_coord_t dyr = p[i_next_right].y - p[y_min_i].y; + + bool inv = false; + if(dyl * dxr < dyr * dxl) inv = true; + + do { + if(!inv) { + i_next_left = i_prev_left - 1; + if(i_next_left < 0) i_next_left = point_cnt + i_next_left; + + i_next_right = i_prev_right + 1; + if(i_next_right > point_cnt - 1) i_next_right = 0; + } + else { + i_next_left = i_prev_left + 1; + if(i_next_left > point_cnt - 1) i_next_left = 0; + + i_next_right = i_prev_right - 1; + if(i_next_right < 0) i_next_right = point_cnt + i_next_right; + } + + if(p[i_next_left].y >= p[i_prev_left].y) { + if(p[i_next_left].y != p[i_prev_left].y && + p[i_next_left].x != p[i_prev_left].x) { + lv_draw_mask_line_points_init(mp_next, p[i_prev_left].x, p[i_prev_left].y, + p[i_next_left].x, p[i_next_left].y, + LV_DRAW_MASK_LINE_SIDE_RIGHT); + lv_draw_mask_add(mp_next, mp); + mp_next++; + } + mask_cnt++; + i_prev_left = i_next_left; + } + + if(mask_cnt == point_cnt) break; + + if(p[i_next_right].y >= p[i_prev_right].y) { + if(p[i_next_right].y != p[i_prev_right].y && + p[i_next_right].x != p[i_prev_right].x) { + + lv_draw_mask_line_points_init(mp_next, p[i_prev_right].x, p[i_prev_right].y, + p[i_next_right].x, p[i_next_right].y, + LV_DRAW_MASK_LINE_SIDE_LEFT); + lv_draw_mask_add(mp_next, mp); + mp_next++; + } + mask_cnt++; + i_prev_right = i_next_right; + } + + } while(mask_cnt < point_cnt); + + lv_draw_rect(draw_ctx, draw_dsc, &poly_coords); + + lv_draw_mask_remove_custom(mp); + + lv_mem_buf_release(mp); + lv_mem_buf_release(p); + + draw_ctx->clip_area = clip_area_ori; +#else + LV_UNUSED(points); + LV_UNUSED(point_cnt); + LV_UNUSED(draw_ctx); + LV_UNUSED(draw_dsc); + LV_LOG_WARN("Can't draw polygon with LV_DRAW_COMPLEX == 0"); +#endif /*LV_DRAW_COMPLEX*/ +} + +/********************** + * STATIC FUNCTIONS + **********************/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_private.h b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_private.h deleted file mode 100644 index 38ba3b4..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_private.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file lv_draw_sw_private.h - * - */ - -#ifndef LV_DRAW_SW_PRIVATE_H -#define LV_DRAW_SW_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_sw.h" -#include "../lv_draw_private.h" - -#if LV_USE_DRAW_SW - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_draw_sw_unit_t { - lv_draw_unit_t base_unit; - lv_draw_task_t * task_act; -#if LV_USE_OS - lv_thread_sync_t sync; - lv_thread_t thread; - volatile bool inited; - volatile bool exit_status; -#endif - uint32_t idx; -}; - -#if LV_DRAW_SW_SHADOW_CACHE_SIZE -typedef struct { - uint8_t cache[LV_DRAW_SW_SHADOW_CACHE_SIZE * LV_DRAW_SW_SHADOW_CACHE_SIZE]; - int32_t cache_size; - int32_t cache_r; -} lv_draw_sw_shadow_cache_t; -#endif - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_DRAW_SW */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_SW_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_rect.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_rect.c new file mode 100644 index 0000000..a1e620b --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_rect.c @@ -0,0 +1,1436 @@ +/** + * @file lv_draw_rect.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_draw_sw.h" +#include "../../misc/lv_math.h" +#include "../../misc/lv_txt_ap.h" +#include "../../core/lv_refr.h" +#include "../../misc/lv_assert.h" +#include "lv_draw_sw_dither.h" + +/********************* + * DEFINES + *********************/ +#define SHADOW_UPSCALE_SHIFT 6 +#define SHADOW_ENHANCE 1 +#define SPLIT_LIMIT 50 + + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void draw_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); +static void draw_bg_img(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); +static void draw_border(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); + +static void draw_outline(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); + +#if LV_DRAW_COMPLEX +static void /* LV_ATTRIBUTE_FAST_MEM */ draw_shadow(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, + const lv_area_t * coords); +static void /* LV_ATTRIBUTE_FAST_MEM */ shadow_draw_corner_buf(const lv_area_t * coords, uint16_t * sh_buf, + lv_coord_t s, lv_coord_t r); +static void /* LV_ATTRIBUTE_FAST_MEM */ shadow_blur_corner(lv_coord_t size, lv_coord_t sw, uint16_t * sh_ups_buf); +#endif + +void draw_border_generic(lv_draw_ctx_t * draw_ctx, const lv_area_t * outer_area, const lv_area_t * inner_area, + lv_coord_t rout, lv_coord_t rin, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode); + +static void draw_border_simple(lv_draw_ctx_t * draw_ctx, const lv_area_t * outer_area, const lv_area_t * inner_area, + lv_color_t color, lv_opa_t opa); + + +/********************** + * STATIC VARIABLES + **********************/ +#if defined(LV_SHADOW_CACHE_SIZE) && LV_SHADOW_CACHE_SIZE > 0 + static uint8_t sh_cache[LV_SHADOW_CACHE_SIZE * LV_SHADOW_CACHE_SIZE]; + static int32_t sh_cache_size = -1; + static int32_t sh_cache_r = -1; +#endif + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_draw_sw_rect(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) +{ +#if LV_DRAW_COMPLEX + draw_shadow(draw_ctx, dsc, coords); +#endif + + draw_bg(draw_ctx, dsc, coords); + draw_bg_img(draw_ctx, dsc, coords); + + draw_border(draw_ctx, dsc, coords); + + draw_outline(draw_ctx, dsc, coords); + + LV_ASSERT_MEM_INTEGRITY(); +} + +void lv_draw_sw_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) +{ +#if LV_COLOR_SCREEN_TRANSP && LV_COLOR_DEPTH == 32 + lv_memset_00(draw_ctx->buf, lv_area_get_size(draw_ctx->buf_area) * sizeof(lv_color_t)); +#endif + + draw_bg(draw_ctx, dsc, coords); + draw_bg_img(draw_ctx, dsc, coords); +} + + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void draw_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) +{ + if(dsc->bg_opa <= LV_OPA_MIN) return; + + lv_area_t bg_coords; + lv_area_copy(&bg_coords, coords); + + /*If the border fully covers make the bg area 1px smaller to avoid artifacts on the corners*/ + if(dsc->border_width > 1 && dsc->border_opa >= LV_OPA_MAX && dsc->radius != 0) { + bg_coords.x1 += (dsc->border_side & LV_BORDER_SIDE_LEFT) ? 1 : 0; + bg_coords.y1 += (dsc->border_side & LV_BORDER_SIDE_TOP) ? 1 : 0; + bg_coords.x2 -= (dsc->border_side & LV_BORDER_SIDE_RIGHT) ? 1 : 0; + bg_coords.y2 -= (dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? 1 : 0; + } + + lv_area_t clipped_coords; + if(!_lv_area_intersect(&clipped_coords, &bg_coords, draw_ctx->clip_area)) return; + + lv_grad_dir_t grad_dir = dsc->bg_grad.dir; + lv_color_t bg_color = grad_dir == LV_GRAD_DIR_NONE ? dsc->bg_color : dsc->bg_grad.stops[0].color; + if(bg_color.full == dsc->bg_grad.stops[1].color.full) grad_dir = LV_GRAD_DIR_NONE; + + bool mask_any = lv_draw_mask_is_any(&bg_coords); + lv_draw_sw_blend_dsc_t blend_dsc = {0}; + blend_dsc.blend_mode = dsc->blend_mode; + blend_dsc.color = bg_color; + + /*Most simple case: just a plain rectangle*/ + if(!mask_any && dsc->radius == 0 && (grad_dir == LV_GRAD_DIR_NONE)) { + blend_dsc.blend_area = &bg_coords; + blend_dsc.opa = dsc->bg_opa; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + return; + } + + /*Complex case: there is gradient, mask, or radius*/ +#if LV_DRAW_COMPLEX == 0 + LV_LOG_WARN("Can't draw complex rectangle because LV_DRAW_COMPLEX = 0"); +#else + lv_opa_t opa = dsc->bg_opa >= LV_OPA_MAX ? LV_OPA_COVER : dsc->bg_opa; + + /*Get the real radius. Can't be larger than the half of the shortest side */ + lv_coord_t coords_bg_w = lv_area_get_width(&bg_coords); + lv_coord_t coords_bg_h = lv_area_get_height(&bg_coords); + int32_t short_side = LV_MIN(coords_bg_w, coords_bg_h); + int32_t rout = LV_MIN(dsc->radius, short_side >> 1); + + /*Add a radius mask if there is radius*/ + int32_t clipped_w = lv_area_get_width(&clipped_coords); + int16_t mask_rout_id = LV_MASK_ID_INV; + lv_opa_t * mask_buf = NULL; + lv_draw_mask_radius_param_t mask_rout_param; + if(rout > 0 || mask_any) { + mask_buf = lv_mem_buf_get(clipped_w); + lv_draw_mask_radius_init(&mask_rout_param, &bg_coords, rout, false); + mask_rout_id = lv_draw_mask_add(&mask_rout_param, NULL); + } + + int32_t h; + + lv_area_t blend_area; + blend_area.x1 = clipped_coords.x1; + blend_area.x2 = clipped_coords.x2; + + blend_dsc.mask_buf = mask_buf; + blend_dsc.blend_area = &blend_area; + blend_dsc.mask_area = &blend_area; + blend_dsc.opa = LV_OPA_COVER; + + + /*Get gradient if appropriate*/ + lv_grad_t * grad = lv_gradient_get(&dsc->bg_grad, coords_bg_w, coords_bg_h); + if(grad && grad_dir == LV_GRAD_DIR_HOR) { + blend_dsc.src_buf = grad->map + clipped_coords.x1 - bg_coords.x1; + } + +#if _DITHER_GRADIENT + lv_dither_mode_t dither_mode = dsc->bg_grad.dither; + lv_dither_func_t dither_func = &lv_dither_none; + lv_coord_t grad_size = coords_bg_w; + if(grad_dir == LV_GRAD_DIR_VER && dither_mode != LV_DITHER_NONE) { + /* When dithering, we are still using a map that's changing from line to line*/ + blend_dsc.src_buf = grad->map; + } + + if(grad && dither_mode == LV_DITHER_NONE) { + grad->filled = 0; /*Should we force refilling it each draw call ?*/ + if(grad_dir == LV_GRAD_DIR_VER) + grad_size = coords_bg_h; + } + else +#if LV_DITHER_ERROR_DIFFUSION + if(dither_mode == LV_DITHER_ORDERED) +#endif + switch(grad_dir) { + case LV_GRAD_DIR_HOR: + dither_func = lv_dither_ordered_hor; + break; + case LV_GRAD_DIR_VER: + dither_func = lv_dither_ordered_ver; + break; + default: + dither_func = NULL; + } + +#if LV_DITHER_ERROR_DIFFUSION + else if(dither_mode == LV_DITHER_ERR_DIFF) + switch(grad_dir) { + case LV_GRAD_DIR_HOR: + dither_func = lv_dither_err_diff_hor; + break; + case LV_GRAD_DIR_VER: + dither_func = lv_dither_err_diff_ver; + break; + default: + dither_func = NULL; + } +#endif +#endif + + /*There is another mask too. Draw line by line. */ + if(mask_any) { + for(h = clipped_coords.y1; h <= clipped_coords.y2; h++) { + blend_area.y1 = h; + blend_area.y2 = h; + + /* Initialize the mask to opa instead of 0xFF and blend with LV_OPA_COVER. + * It saves calculating the final opa in lv_draw_sw_blend*/ + lv_memset(mask_buf, opa, clipped_w); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, clipped_coords.x1, h, clipped_w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + +#if _DITHER_GRADIENT + if(dither_func) dither_func(grad, blend_area.x1, h - bg_coords.y1, grad_size); +#endif + if(grad_dir == LV_GRAD_DIR_VER) blend_dsc.color = grad->map[h - bg_coords.y1]; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + goto bg_clean_up; + } + + + /* Draw the top of the rectangle line by line and mirror it to the bottom. */ + for(h = 0; h < rout; h++) { + lv_coord_t top_y = bg_coords.y1 + h; + lv_coord_t bottom_y = bg_coords.y2 - h; + if(top_y < clipped_coords.y1 && bottom_y > clipped_coords.y2) continue; /*This line is clipped now*/ + + /* Initialize the mask to opa instead of 0xFF and blend with LV_OPA_COVER. + * It saves calculating the final opa in lv_draw_sw_blend*/ + lv_memset(mask_buf, opa, clipped_w); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, blend_area.x1, top_y, clipped_w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + + if(top_y >= clipped_coords.y1) { + blend_area.y1 = top_y; + blend_area.y2 = top_y; + +#if _DITHER_GRADIENT + if(dither_func) dither_func(grad, blend_area.x1, top_y - bg_coords.y1, grad_size); +#endif + if(grad_dir == LV_GRAD_DIR_VER) blend_dsc.color = grad->map[top_y - bg_coords.y1]; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + + if(bottom_y <= clipped_coords.y2) { + blend_area.y1 = bottom_y; + blend_area.y2 = bottom_y; + +#if _DITHER_GRADIENT + if(dither_func) dither_func(grad, blend_area.x1, bottom_y - bg_coords.y1, grad_size); +#endif + if(grad_dir == LV_GRAD_DIR_VER) blend_dsc.color = grad->map[bottom_y - bg_coords.y1]; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + } + + /* Draw the center of the rectangle.*/ + + /*If no other masks and no gradient, the center is a simple rectangle*/ + lv_area_t center_coords; + center_coords.x1 = bg_coords.x1; + center_coords.x2 = bg_coords.x2; + center_coords.y1 = bg_coords.y1 + rout; + center_coords.y2 = bg_coords.y2 - rout; + bool mask_any_center = lv_draw_mask_is_any(¢er_coords); + if(!mask_any_center && grad_dir == LV_GRAD_DIR_NONE) { + blend_area.y1 = bg_coords.y1 + rout; + blend_area.y2 = bg_coords.y2 - rout; + blend_dsc.opa = opa; + blend_dsc.mask_buf = NULL; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + /*With gradient and/or mask draw line by line*/ + else { + blend_dsc.opa = opa; + blend_dsc.mask_res = LV_DRAW_MASK_RES_FULL_COVER; + int32_t h_end = bg_coords.y2 - rout; + for(h = bg_coords.y1 + rout; h <= h_end; h++) { + /*If there is no other mask do not apply mask as in the center there is no radius to mask*/ + if(mask_any_center) { + lv_memset(mask_buf, opa, clipped_w); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, clipped_coords.x1, h, clipped_w); + } + + blend_area.y1 = h; + blend_area.y2 = h; + +#if _DITHER_GRADIENT + if(dither_func) dither_func(grad, blend_area.x1, h - bg_coords.y1, grad_size); +#endif + if(grad_dir == LV_GRAD_DIR_VER) blend_dsc.color = grad->map[h - bg_coords.y1]; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + } + + +bg_clean_up: + if(mask_buf) lv_mem_buf_release(mask_buf); + if(mask_rout_id != LV_MASK_ID_INV) { + lv_draw_mask_remove_id(mask_rout_id); + lv_draw_mask_free_param(&mask_rout_param); + } + if(grad) { + lv_gradient_cleanup(grad); + } + +#endif +} + +static void draw_bg_img(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) +{ + if(dsc->bg_img_src == NULL) return; + if(dsc->bg_img_opa <= LV_OPA_MIN) return; + + lv_area_t clip_area; + if(!_lv_area_intersect(&clip_area, coords, draw_ctx->clip_area)) { + return; + } + + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_area; + + lv_img_src_t src_type = lv_img_src_get_type(dsc->bg_img_src); + if(src_type == LV_IMG_SRC_SYMBOL) { + lv_point_t size; + lv_txt_get_size(&size, dsc->bg_img_src, dsc->bg_img_symbol_font, 0, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE); + lv_area_t a; + a.x1 = coords->x1 + lv_area_get_width(coords) / 2 - size.x / 2; + a.x2 = a.x1 + size.x - 1; + a.y1 = coords->y1 + lv_area_get_height(coords) / 2 - size.y / 2; + a.y2 = a.y1 + size.y - 1; + + lv_draw_label_dsc_t label_draw_dsc; + lv_draw_label_dsc_init(&label_draw_dsc); + label_draw_dsc.font = dsc->bg_img_symbol_font; + label_draw_dsc.color = dsc->bg_img_recolor; + label_draw_dsc.opa = dsc->bg_img_opa; + lv_draw_label(draw_ctx, &label_draw_dsc, &a, dsc->bg_img_src, NULL); + } + else { + lv_img_header_t header; + lv_res_t res = lv_img_decoder_get_info(dsc->bg_img_src, &header); + if(res == LV_RES_OK) { + lv_draw_img_dsc_t img_dsc; + lv_draw_img_dsc_init(&img_dsc); + img_dsc.blend_mode = dsc->blend_mode; + img_dsc.recolor = dsc->bg_img_recolor; + img_dsc.recolor_opa = dsc->bg_img_recolor_opa; + img_dsc.opa = dsc->bg_img_opa; + + /*Center align*/ + if(dsc->bg_img_tiled == false) { + lv_area_t area; + area.x1 = coords->x1 + lv_area_get_width(coords) / 2 - header.w / 2; + area.y1 = coords->y1 + lv_area_get_height(coords) / 2 - header.h / 2; + area.x2 = area.x1 + header.w - 1; + area.y2 = area.y1 + header.h - 1; + + lv_draw_img(draw_ctx, &img_dsc, &area, dsc->bg_img_src); + } + else { + lv_area_t area; + area.y1 = coords->y1; + area.y2 = area.y1 + header.h - 1; + + for(; area.y1 <= coords->y2; area.y1 += header.h, area.y2 += header.h) { + + area.x1 = coords->x1; + area.x2 = area.x1 + header.w - 1; + for(; area.x1 <= coords->x2; area.x1 += header.w, area.x2 += header.w) { + lv_draw_img(draw_ctx, &img_dsc, &area, dsc->bg_img_src); + } + } + } + } + else { + LV_LOG_WARN("Couldn't read the background image"); + } + } + + draw_ctx->clip_area = clip_area_ori; +} + +static void draw_border(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) +{ + if(dsc->border_opa <= LV_OPA_MIN) return; + if(dsc->border_width == 0) return; + if(dsc->border_side == LV_BORDER_SIDE_NONE) return; + if(dsc->border_post) return; + + int32_t coords_w = lv_area_get_width(coords); + int32_t coords_h = lv_area_get_height(coords); + int32_t rout = dsc->radius; + int32_t short_side = LV_MIN(coords_w, coords_h); + if(rout > short_side >> 1) rout = short_side >> 1; + + /*Get the inner area*/ + lv_area_t area_inner; + lv_area_copy(&area_inner, coords); + area_inner.x1 += ((dsc->border_side & LV_BORDER_SIDE_LEFT) ? dsc->border_width : - (dsc->border_width + rout)); + area_inner.x2 -= ((dsc->border_side & LV_BORDER_SIDE_RIGHT) ? dsc->border_width : - (dsc->border_width + rout)); + area_inner.y1 += ((dsc->border_side & LV_BORDER_SIDE_TOP) ? dsc->border_width : - (dsc->border_width + rout)); + area_inner.y2 -= ((dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? dsc->border_width : - (dsc->border_width + rout)); + + lv_coord_t rin = rout - dsc->border_width; + if(rin < 0) rin = 0; + + draw_border_generic(draw_ctx, coords, &area_inner, rout, rin, dsc->border_color, dsc->border_opa, dsc->blend_mode); + +} + +#if LV_DRAW_COMPLEX +static void LV_ATTRIBUTE_FAST_MEM draw_shadow(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, + const lv_area_t * coords) +{ + /*Check whether the shadow is visible*/ + if(dsc->shadow_width == 0) return; + if(dsc->shadow_opa <= LV_OPA_MIN) return; + + if(dsc->shadow_width == 1 && dsc->shadow_spread <= 0 && + dsc->shadow_ofs_x == 0 && dsc->shadow_ofs_y == 0) { + return; + } + + /*Calculate the rectangle which is blurred to get the shadow in `shadow_area`*/ + lv_area_t core_area; + core_area.x1 = coords->x1 + dsc->shadow_ofs_x - dsc->shadow_spread; + core_area.x2 = coords->x2 + dsc->shadow_ofs_x + dsc->shadow_spread; + core_area.y1 = coords->y1 + dsc->shadow_ofs_y - dsc->shadow_spread; + core_area.y2 = coords->y2 + dsc->shadow_ofs_y + dsc->shadow_spread; + + /*Calculate the bounding box of the shadow*/ + lv_area_t shadow_area; + shadow_area.x1 = core_area.x1 - dsc->shadow_width / 2 - 1; + shadow_area.x2 = core_area.x2 + dsc->shadow_width / 2 + 1; + shadow_area.y1 = core_area.y1 - dsc->shadow_width / 2 - 1; + shadow_area.y2 = core_area.y2 + dsc->shadow_width / 2 + 1; + + lv_opa_t opa = dsc->shadow_opa; + if(opa > LV_OPA_MAX) opa = LV_OPA_COVER; + + /*Get clipped draw area which is the real draw area. + *It is always the same or inside `shadow_area`*/ + lv_area_t draw_area; + if(!_lv_area_intersect(&draw_area, &shadow_area, draw_ctx->clip_area)) return; + + /*Consider 1 px smaller bg to be sure the edge will be covered by the shadow*/ + lv_area_t bg_area; + lv_area_copy(&bg_area, coords); + lv_area_increase(&bg_area, -1, -1); + + /*Get the clamped radius*/ + int32_t r_bg = dsc->radius; + lv_coord_t short_side = LV_MIN(lv_area_get_width(&bg_area), lv_area_get_height(&bg_area)); + if(r_bg > short_side >> 1) r_bg = short_side >> 1; + + /*Get the clamped radius*/ + int32_t r_sh = dsc->radius; + short_side = LV_MIN(lv_area_get_width(&core_area), lv_area_get_height(&core_area)); + if(r_sh > short_side >> 1) r_sh = short_side >> 1; + + + /*Get how many pixels are affected by the blur on the corners*/ + int32_t corner_size = dsc->shadow_width + r_sh; + + lv_opa_t * sh_buf; + +#if LV_SHADOW_CACHE_SIZE + if(sh_cache_size == corner_size && sh_cache_r == r_sh) { + /*Use the cache if available*/ + sh_buf = lv_mem_buf_get(corner_size * corner_size); + lv_memcpy(sh_buf, sh_cache, corner_size * corner_size); + } + else { + /*A larger buffer is required for calculation*/ + sh_buf = lv_mem_buf_get(corner_size * corner_size * sizeof(uint16_t)); + shadow_draw_corner_buf(&core_area, (uint16_t *)sh_buf, dsc->shadow_width, r_sh); + + /*Cache the corner if it fits into the cache size*/ + if((uint32_t)corner_size * corner_size < sizeof(sh_cache)) { + lv_memcpy(sh_cache, sh_buf, corner_size * corner_size); + sh_cache_size = corner_size; + sh_cache_r = r_sh; + } + } +#else + sh_buf = lv_mem_buf_get(corner_size * corner_size * sizeof(uint16_t)); + shadow_draw_corner_buf(&core_area, (uint16_t *)sh_buf, dsc->shadow_width, r_sh); +#endif + + /*Skip a lot of masking if the background will cover the shadow that would be masked out*/ + bool mask_any = lv_draw_mask_is_any(&shadow_area); + bool simple = true; + if(mask_any || dsc->bg_opa < LV_OPA_COVER || dsc->blend_mode != LV_BLEND_MODE_NORMAL) simple = false; + + /*Create a radius mask to clip remove shadow on the bg area*/ + + lv_draw_mask_radius_param_t mask_rout_param; + int16_t mask_rout_id = LV_MASK_ID_INV; + if(!simple) { + lv_draw_mask_radius_init(&mask_rout_param, &bg_area, r_bg, true); + mask_rout_id = lv_draw_mask_add(&mask_rout_param, NULL); + } + lv_opa_t * mask_buf = lv_mem_buf_get(lv_area_get_width(&shadow_area)); + lv_area_t blend_area; + lv_area_t clip_area_sub; + lv_opa_t * sh_buf_tmp; + lv_coord_t y; + bool simple_sub; + + lv_draw_sw_blend_dsc_t blend_dsc; + lv_memset_00(&blend_dsc, sizeof(blend_dsc)); + blend_dsc.blend_area = &blend_area; + blend_dsc.mask_area = &blend_area; + blend_dsc.mask_buf = mask_buf; + blend_dsc.color = dsc->shadow_color; + blend_dsc.opa = dsc->shadow_opa; + blend_dsc.blend_mode = dsc->blend_mode; + + lv_coord_t w_half = shadow_area.x1 + lv_area_get_width(&shadow_area) / 2; + lv_coord_t h_half = shadow_area.y1 + lv_area_get_height(&shadow_area) / 2; + + /*Draw the corners if they are on the current clip area and not fully covered by the bg*/ + + /*Top right corner*/ + blend_area.x2 = shadow_area.x2; + blend_area.x1 = shadow_area.x2 - corner_size + 1; + blend_area.y1 = shadow_area.y1; + blend_area.y2 = shadow_area.y1 + corner_size - 1; + /*Do not overdraw the other top corners*/ + blend_area.x1 = LV_MAX(blend_area.x1, w_half); + blend_area.y2 = LV_MIN(blend_area.y2, h_half); + + if(_lv_area_intersect(&clip_area_sub, &blend_area, draw_ctx->clip_area) && + !_lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { + lv_coord_t w = lv_area_get_width(&clip_area_sub); + sh_buf_tmp = sh_buf; + sh_buf_tmp += (clip_area_sub.y1 - shadow_area.y1) * corner_size; + sh_buf_tmp += clip_area_sub.x1 - (shadow_area.x2 - corner_size + 1); + + /*Do not mask if out of the bg*/ + if(simple && _lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; + else simple_sub = simple; + if(w > 0) { + blend_dsc.mask_buf = mask_buf; + blend_area.x1 = clip_area_sub.x1; + blend_area.x2 = clip_area_sub.x2; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ + for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { + blend_area.y1 = y; + blend_area.y2 = y; + + if(!simple_sub) { + lv_memcpy(mask_buf, sh_buf_tmp, corner_size); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, clip_area_sub.x1, y, w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + } + else { + blend_dsc.mask_buf = sh_buf_tmp; + } + lv_draw_sw_blend(draw_ctx, &blend_dsc); + sh_buf_tmp += corner_size; + } + } + } + + /*Bottom right corner. + *Almost the same as top right just read the lines of `sh_buf` from then end*/ + blend_area.x2 = shadow_area.x2; + blend_area.x1 = shadow_area.x2 - corner_size + 1; + blend_area.y1 = shadow_area.y2 - corner_size + 1; + blend_area.y2 = shadow_area.y2; + /*Do not overdraw the other corners*/ + blend_area.x1 = LV_MAX(blend_area.x1, w_half); + blend_area.y1 = LV_MAX(blend_area.y1, h_half + 1); + + if(_lv_area_intersect(&clip_area_sub, &blend_area, draw_ctx->clip_area) && + !_lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { + lv_coord_t w = lv_area_get_width(&clip_area_sub); + sh_buf_tmp = sh_buf; + sh_buf_tmp += (blend_area.y2 - clip_area_sub.y2) * corner_size; + sh_buf_tmp += clip_area_sub.x1 - (shadow_area.x2 - corner_size + 1); + /*Do not mask if out of the bg*/ + if(simple && _lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; + else simple_sub = simple; + + if(w > 0) { + blend_dsc.mask_buf = mask_buf; + blend_area.x1 = clip_area_sub.x1; + blend_area.x2 = clip_area_sub.x2; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ + for(y = clip_area_sub.y2; y >= clip_area_sub.y1; y--) { + blend_area.y1 = y; + blend_area.y2 = y; + + if(!simple_sub) { + lv_memcpy(mask_buf, sh_buf_tmp, corner_size); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, clip_area_sub.x1, y, w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + } + else { + blend_dsc.mask_buf = sh_buf_tmp; + } + lv_draw_sw_blend(draw_ctx, &blend_dsc); + sh_buf_tmp += corner_size; + } + } + } + + /*Top side*/ + blend_area.x1 = shadow_area.x1 + corner_size; + blend_area.x2 = shadow_area.x2 - corner_size; + blend_area.y1 = shadow_area.y1; + blend_area.y2 = shadow_area.y1 + corner_size - 1; + blend_area.y2 = LV_MIN(blend_area.y2, h_half); + + if(_lv_area_intersect(&clip_area_sub, &blend_area, draw_ctx->clip_area) && + !_lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { + lv_coord_t w = lv_area_get_width(&clip_area_sub); + sh_buf_tmp = sh_buf; + sh_buf_tmp += (clip_area_sub.y1 - blend_area.y1) * corner_size; + + /*Do not mask if out of the bg*/ + if(simple && _lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; + else simple_sub = simple; + + if(w > 0) { + if(!simple_sub) { + blend_dsc.mask_buf = mask_buf; + } + else { + blend_dsc.mask_buf = NULL; + } + blend_area.x1 = clip_area_sub.x1; + blend_area.x2 = clip_area_sub.x2; + + for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { + blend_area.y1 = y; + blend_area.y2 = y; + + if(!simple_sub) { + lv_memset(mask_buf, sh_buf_tmp[0], w); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, clip_area_sub.x1, y, w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + else { + blend_dsc.opa = opa == LV_OPA_COVER ? sh_buf_tmp[0] : (sh_buf_tmp[0] * dsc->shadow_opa) >> 8; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + sh_buf_tmp += corner_size; + } + } + } + blend_dsc.opa = dsc->shadow_opa; /*Restore*/ + + /*Bottom side*/ + blend_area.x1 = shadow_area.x1 + corner_size; + blend_area.x2 = shadow_area.x2 - corner_size; + blend_area.y1 = shadow_area.y2 - corner_size + 1; + blend_area.y2 = shadow_area.y2; + blend_area.y1 = LV_MAX(blend_area.y1, h_half + 1); + + + if(_lv_area_intersect(&clip_area_sub, &blend_area, draw_ctx->clip_area) && + !_lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { + lv_coord_t w = lv_area_get_width(&clip_area_sub); + sh_buf_tmp = sh_buf; + sh_buf_tmp += (blend_area.y2 - clip_area_sub.y2) * corner_size; + if(w > 0) { + /*Do not mask if out of the bg*/ + if(simple && _lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; + else simple_sub = simple; + + if(!simple_sub) { + blend_dsc.mask_buf = mask_buf; + } + else { + blend_dsc.mask_buf = NULL; + } + blend_area.x1 = clip_area_sub.x1; + blend_area.x2 = clip_area_sub.x2; + + for(y = clip_area_sub.y2; y >= clip_area_sub.y1; y--) { + blend_area.y1 = y; + blend_area.y2 = y; + + /*Do not mask if out of the bg*/ + if(simple && _lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; + else simple_sub = simple; + + if(!simple_sub) { + lv_memset(mask_buf, sh_buf_tmp[0], w); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, clip_area_sub.x1, y, w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + else { + blend_dsc.opa = opa == LV_OPA_COVER ? sh_buf_tmp[0] : (sh_buf_tmp[0] * dsc->shadow_opa) >> 8; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + + } + sh_buf_tmp += corner_size; + } + } + } + + blend_dsc.opa = dsc->shadow_opa; /*Restore*/ + + /*Right side*/ + blend_area.x1 = shadow_area.x2 - corner_size + 1; + blend_area.x2 = shadow_area.x2; + blend_area.y1 = shadow_area.y1 + corner_size; + blend_area.y2 = shadow_area.y2 - corner_size; + /*Do not overdraw the other corners*/ + blend_area.y1 = LV_MIN(blend_area.y1, h_half + 1); + blend_area.y2 = LV_MAX(blend_area.y2, h_half); + blend_area.x1 = LV_MAX(blend_area.x1, w_half); + + if(_lv_area_intersect(&clip_area_sub, &blend_area, draw_ctx->clip_area) && + !_lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { + lv_coord_t w = lv_area_get_width(&clip_area_sub); + sh_buf_tmp = sh_buf; + sh_buf_tmp += (corner_size - 1) * corner_size; + sh_buf_tmp += clip_area_sub.x1 - (shadow_area.x2 - corner_size + 1); + + /*Do not mask if out of the bg*/ + if(simple && _lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; + else simple_sub = simple; + blend_dsc.mask_buf = simple_sub ? sh_buf_tmp : mask_buf; + + if(w > 0) { + blend_area.x1 = clip_area_sub.x1; + blend_area.x2 = clip_area_sub.x2; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ + for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { + blend_area.y1 = y; + blend_area.y2 = y; + + if(!simple_sub) { + lv_memcpy(mask_buf, sh_buf_tmp, w); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, clip_area_sub.x1, y, w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + } + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + } + } + + /*Mirror the shadow corner buffer horizontally*/ + sh_buf_tmp = sh_buf ; + for(y = 0; y < corner_size; y++) { + int32_t x; + lv_opa_t * start = sh_buf_tmp; + lv_opa_t * end = sh_buf_tmp + corner_size - 1; + for(x = 0; x < corner_size / 2; x++) { + lv_opa_t tmp = *start; + *start = *end; + *end = tmp; + + start++; + end--; + } + sh_buf_tmp += corner_size; + } + + /*Left side*/ + blend_area.x1 = shadow_area.x1; + blend_area.x2 = shadow_area.x1 + corner_size - 1; + blend_area.y1 = shadow_area.y1 + corner_size; + blend_area.y2 = shadow_area.y2 - corner_size; + /*Do not overdraw the other corners*/ + blend_area.y1 = LV_MIN(blend_area.y1, h_half + 1); + blend_area.y2 = LV_MAX(blend_area.y2, h_half); + blend_area.x2 = LV_MIN(blend_area.x2, w_half - 1); + + if(_lv_area_intersect(&clip_area_sub, &blend_area, draw_ctx->clip_area) && + !_lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { + lv_coord_t w = lv_area_get_width(&clip_area_sub); + sh_buf_tmp = sh_buf; + sh_buf_tmp += (corner_size - 1) * corner_size; + sh_buf_tmp += clip_area_sub.x1 - blend_area.x1; + + /*Do not mask if out of the bg*/ + if(simple && _lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; + else simple_sub = simple; + blend_dsc.mask_buf = simple_sub ? sh_buf_tmp : mask_buf; + if(w > 0) { + blend_area.x1 = clip_area_sub.x1; + blend_area.x2 = clip_area_sub.x2; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ + for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { + blend_area.y1 = y; + blend_area.y2 = y; + + if(!simple_sub) { + lv_memcpy(mask_buf, sh_buf_tmp, w); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, clip_area_sub.x1, y, w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + } + + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + } + } + + /*Top left corner*/ + blend_area.x1 = shadow_area.x1; + blend_area.x2 = shadow_area.x1 + corner_size - 1; + blend_area.y1 = shadow_area.y1; + blend_area.y2 = shadow_area.y1 + corner_size - 1; + /*Do not overdraw the other corners*/ + blend_area.x2 = LV_MIN(blend_area.x2, w_half - 1); + blend_area.y2 = LV_MIN(blend_area.y2, h_half); + + if(_lv_area_intersect(&clip_area_sub, &blend_area, draw_ctx->clip_area) && + !_lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { + lv_coord_t w = lv_area_get_width(&clip_area_sub); + sh_buf_tmp = sh_buf; + sh_buf_tmp += (clip_area_sub.y1 - blend_area.y1) * corner_size; + sh_buf_tmp += clip_area_sub.x1 - blend_area.x1; + + /*Do not mask if out of the bg*/ + if(simple && _lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; + else simple_sub = simple; + blend_dsc.mask_buf = mask_buf; + + if(w > 0) { + blend_area.x1 = clip_area_sub.x1; + blend_area.x2 = clip_area_sub.x2; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ + for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { + blend_area.y1 = y; + blend_area.y2 = y; + + if(!simple_sub) { + lv_memcpy(mask_buf, sh_buf_tmp, corner_size); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, clip_area_sub.x1, y, w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + } + else { + blend_dsc.mask_buf = sh_buf_tmp; + } + + lv_draw_sw_blend(draw_ctx, &blend_dsc); + sh_buf_tmp += corner_size; + } + } + } + + /*Bottom left corner. + *Almost the same as bottom right just read the lines of `sh_buf` from then end*/ + blend_area.x1 = shadow_area.x1 ; + blend_area.x2 = shadow_area.x1 + corner_size - 1; + blend_area.y1 = shadow_area.y2 - corner_size + 1; + blend_area.y2 = shadow_area.y2; + /*Do not overdraw the other corners*/ + blend_area.y1 = LV_MAX(blend_area.y1, h_half + 1); + blend_area.x2 = LV_MIN(blend_area.x2, w_half - 1); + + if(_lv_area_intersect(&clip_area_sub, &blend_area, draw_ctx->clip_area) && + !_lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { + lv_coord_t w = lv_area_get_width(&clip_area_sub); + sh_buf_tmp = sh_buf; + sh_buf_tmp += (blend_area.y2 - clip_area_sub.y2) * corner_size; + sh_buf_tmp += clip_area_sub.x1 - blend_area.x1; + + /*Do not mask if out of the bg*/ + if(simple && _lv_area_is_out(&clip_area_sub, &bg_area, r_bg)) simple_sub = true; + else simple_sub = simple; + blend_dsc.mask_buf = mask_buf; + if(w > 0) { + blend_area.x1 = clip_area_sub.x1; + blend_area.x2 = clip_area_sub.x2; + blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; /*In simple mode it won't be overwritten*/ + for(y = clip_area_sub.y2; y >= clip_area_sub.y1; y--) { + blend_area.y1 = y; + blend_area.y2 = y; + + if(!simple_sub) { + lv_memcpy(mask_buf, sh_buf_tmp, corner_size); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, clip_area_sub.x1, y, w); + if(blend_dsc.mask_res == LV_DRAW_MASK_RES_FULL_COVER) blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED; + } + else { + blend_dsc.mask_buf = sh_buf_tmp; + } + lv_draw_sw_blend(draw_ctx, &blend_dsc); + sh_buf_tmp += corner_size; + } + } + } + + /*Draw the center rectangle.*/ + blend_area.x1 = shadow_area.x1 + corner_size ; + blend_area.x2 = shadow_area.x2 - corner_size; + blend_area.y1 = shadow_area.y1 + corner_size; + blend_area.y2 = shadow_area.y2 - corner_size; + blend_dsc.mask_buf = mask_buf; + + if(_lv_area_intersect(&clip_area_sub, &blend_area, draw_ctx->clip_area) && + !_lv_area_is_in(&clip_area_sub, &bg_area, r_bg)) { + lv_coord_t w = lv_area_get_width(&clip_area_sub); + if(w > 0) { + blend_area.x1 = clip_area_sub.x1; + blend_area.x2 = clip_area_sub.x2; + for(y = clip_area_sub.y1; y <= clip_area_sub.y2; y++) { + blend_area.y1 = y; + blend_area.y2 = y; + + lv_memset_ff(mask_buf, w); + blend_dsc.mask_res = lv_draw_mask_apply(mask_buf, clip_area_sub.x1, y, w); + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + } + } + + if(!simple) { + lv_draw_mask_free_param(&mask_rout_param); + lv_draw_mask_remove_id(mask_rout_id); + } + lv_mem_buf_release(sh_buf); + lv_mem_buf_release(mask_buf); +} + +/** + * Calculate a blurred corner + * @param coords Coordinates of the shadow + * @param sh_buf a buffer to store the result. Its size should be `(sw + r)^2 * 2` + * @param sw shadow width + * @param r radius + */ +static void LV_ATTRIBUTE_FAST_MEM shadow_draw_corner_buf(const lv_area_t * coords, uint16_t * sh_buf, + lv_coord_t sw, lv_coord_t r) +{ + int32_t sw_ori = sw; + int32_t size = sw_ori + r; + + lv_area_t sh_area; + lv_area_copy(&sh_area, coords); + sh_area.x2 = sw / 2 + r - 1 - ((sw & 1) ? 0 : 1); + sh_area.y1 = sw / 2 + 1; + + sh_area.x1 = sh_area.x2 - lv_area_get_width(coords); + sh_area.y2 = sh_area.y1 + lv_area_get_height(coords); + + lv_draw_mask_radius_param_t mask_param; + lv_draw_mask_radius_init(&mask_param, &sh_area, r, false); + +#if SHADOW_ENHANCE + /*Set half shadow width width because blur will be repeated*/ + if(sw_ori == 1) sw = 1; + else sw = sw_ori >> 1; +#endif + + int32_t y; + lv_opa_t * mask_line = lv_mem_buf_get(size); + uint16_t * sh_ups_tmp_buf = (uint16_t *)sh_buf; + for(y = 0; y < size; y++) { + lv_memset_ff(mask_line, size); + lv_draw_mask_res_t mask_res = mask_param.dsc.cb(mask_line, 0, y, size, &mask_param); + if(mask_res == LV_DRAW_MASK_RES_TRANSP) { + lv_memset_00(sh_ups_tmp_buf, size * sizeof(sh_ups_tmp_buf[0])); + } + else { + int32_t i; + sh_ups_tmp_buf[0] = (mask_line[0] << SHADOW_UPSCALE_SHIFT) / sw; + for(i = 1; i < size; i++) { + if(mask_line[i] == mask_line[i - 1]) sh_ups_tmp_buf[i] = sh_ups_tmp_buf[i - 1]; + else sh_ups_tmp_buf[i] = (mask_line[i] << SHADOW_UPSCALE_SHIFT) / sw; + } + } + + sh_ups_tmp_buf += size; + } + lv_mem_buf_release(mask_line); + + lv_draw_mask_free_param(&mask_param); + + if(sw == 1) { + int32_t i; + lv_opa_t * res_buf = (lv_opa_t *)sh_buf; + for(i = 0; i < size * size; i++) { + res_buf[i] = (sh_buf[i] >> SHADOW_UPSCALE_SHIFT); + } + return; + } + + shadow_blur_corner(size, sw, sh_buf); + +#if SHADOW_ENHANCE == 0 + /*The result is required in lv_opa_t not uint16_t*/ + uint32_t x; + lv_opa_t * res_buf = (lv_opa_t *)sh_buf; + for(x = 0; x < size * size; x++) { + res_buf[x] = sh_buf[x]; + } +#else + sw += sw_ori & 1; + if(sw > 1) { + uint32_t i; + uint32_t max_v_div = (LV_OPA_COVER << SHADOW_UPSCALE_SHIFT) / sw; + for(i = 0; i < (uint32_t)size * size; i++) { + if(sh_buf[i] == 0) continue; + else if(sh_buf[i] == LV_OPA_COVER) sh_buf[i] = max_v_div; + else sh_buf[i] = (sh_buf[i] << SHADOW_UPSCALE_SHIFT) / sw; + } + + shadow_blur_corner(size, sw, sh_buf); + } + int32_t x; + lv_opa_t * res_buf = (lv_opa_t *)sh_buf; + for(x = 0; x < size * size; x++) { + res_buf[x] = sh_buf[x]; + } +#endif + +} + +static void LV_ATTRIBUTE_FAST_MEM shadow_blur_corner(lv_coord_t size, lv_coord_t sw, uint16_t * sh_ups_buf) +{ + int32_t s_left = sw >> 1; + int32_t s_right = (sw >> 1); + if((sw & 1) == 0) s_left--; + + /*Horizontal blur*/ + uint16_t * sh_ups_blur_buf = lv_mem_buf_get(size * sizeof(uint16_t)); + + int32_t x; + int32_t y; + + uint16_t * sh_ups_tmp_buf = sh_ups_buf; + + for(y = 0; y < size; y++) { + int32_t v = sh_ups_tmp_buf[size - 1] * sw; + for(x = size - 1; x >= 0; x--) { + sh_ups_blur_buf[x] = v; + + /*Forget the right pixel*/ + uint32_t right_val = 0; + if(x + s_right < size) right_val = sh_ups_tmp_buf[x + s_right]; + v -= right_val; + + /*Add the left pixel*/ + uint32_t left_val; + if(x - s_left - 1 < 0) left_val = sh_ups_tmp_buf[0]; + else left_val = sh_ups_tmp_buf[x - s_left - 1]; + v += left_val; + } + lv_memcpy(sh_ups_tmp_buf, sh_ups_blur_buf, size * sizeof(uint16_t)); + sh_ups_tmp_buf += size; + } + + /*Vertical blur*/ + uint32_t i; + uint32_t max_v = LV_OPA_COVER << SHADOW_UPSCALE_SHIFT; + uint32_t max_v_div = max_v / sw; + for(i = 0; i < (uint32_t)size * size; i++) { + if(sh_ups_buf[i] == 0) continue; + else if(sh_ups_buf[i] == max_v) sh_ups_buf[i] = max_v_div; + else sh_ups_buf[i] = sh_ups_buf[i] / sw; + } + + for(x = 0; x < size; x++) { + sh_ups_tmp_buf = &sh_ups_buf[x]; + int32_t v = sh_ups_tmp_buf[0] * sw; + for(y = 0; y < size ; y++, sh_ups_tmp_buf += size) { + sh_ups_blur_buf[y] = v < 0 ? 0 : (v >> SHADOW_UPSCALE_SHIFT); + + /*Forget the top pixel*/ + uint32_t top_val; + if(y - s_right <= 0) top_val = sh_ups_tmp_buf[0]; + else top_val = sh_ups_buf[(y - s_right) * size + x]; + v -= top_val; + + /*Add the bottom pixel*/ + uint32_t bottom_val; + if(y + s_left + 1 < size) bottom_val = sh_ups_buf[(y + s_left + 1) * size + x]; + else bottom_val = sh_ups_buf[(size - 1) * size + x]; + v += bottom_val; + } + + /*Write back the result into `sh_ups_buf`*/ + sh_ups_tmp_buf = &sh_ups_buf[x]; + for(y = 0; y < size; y++, sh_ups_tmp_buf += size) { + (*sh_ups_tmp_buf) = sh_ups_blur_buf[y]; + } + } + + lv_mem_buf_release(sh_ups_blur_buf); +} +#endif + +static void draw_outline(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords) +{ + if(dsc->outline_opa <= LV_OPA_MIN) return; + if(dsc->outline_width == 0) return; + + lv_opa_t opa = dsc->outline_opa; + + if(opa > LV_OPA_MAX) opa = LV_OPA_COVER; + + /*Get the inner radius*/ + lv_area_t area_inner; + lv_area_copy(&area_inner, coords); + + /*Bring the outline closer to make sure there is no color bleeding with pad=0*/ + lv_coord_t pad = dsc->outline_pad - 1; + area_inner.x1 -= pad; + area_inner.y1 -= pad; + area_inner.x2 += pad; + area_inner.y2 += pad; + + lv_area_t area_outer; + lv_area_copy(&area_outer, &area_inner); + + area_outer.x1 -= dsc->outline_width; + area_outer.x2 += dsc->outline_width; + area_outer.y1 -= dsc->outline_width; + area_outer.y2 += dsc->outline_width; + + + int32_t inner_w = lv_area_get_width(&area_inner); + int32_t inner_h = lv_area_get_height(&area_inner); + int32_t rin = dsc->radius; + int32_t short_side = LV_MIN(inner_w, inner_h); + if(rin > short_side >> 1) rin = short_side >> 1; + + lv_coord_t rout = rin + dsc->outline_width; + + draw_border_generic(draw_ctx, &area_outer, &area_inner, rout, rin, dsc->outline_color, dsc->outline_opa, + dsc->blend_mode); +} + +void draw_border_generic(lv_draw_ctx_t * draw_ctx, const lv_area_t * outer_area, const lv_area_t * inner_area, + lv_coord_t rout, lv_coord_t rin, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode) +{ + opa = opa >= LV_OPA_COVER ? LV_OPA_COVER : opa; + + bool mask_any = lv_draw_mask_is_any(outer_area); + +#if LV_DRAW_COMPLEX + + if(!mask_any && rout == 0 && rin == 0) { + draw_border_simple(draw_ctx, outer_area, inner_area, color, opa); + return; + } + + /*Get clipped draw area which is the real draw area. + *It is always the same or inside `coords`*/ + lv_area_t draw_area; + if(!_lv_area_intersect(&draw_area, outer_area, draw_ctx->clip_area)) return; + int32_t draw_area_w = lv_area_get_width(&draw_area); + + lv_draw_sw_blend_dsc_t blend_dsc; + lv_memset_00(&blend_dsc, sizeof(blend_dsc)); + blend_dsc.mask_buf = lv_mem_buf_get(draw_area_w);; + + + /*Create mask for the outer area*/ + int16_t mask_rout_id = LV_MASK_ID_INV; + lv_draw_mask_radius_param_t mask_rout_param; + if(rout > 0) { + lv_draw_mask_radius_init(&mask_rout_param, outer_area, rout, false); + mask_rout_id = lv_draw_mask_add(&mask_rout_param, NULL); + } + + /*Create mask for the inner mask*/ + lv_draw_mask_radius_param_t mask_rin_param; + lv_draw_mask_radius_init(&mask_rin_param, inner_area, rin, true); + int16_t mask_rin_id = lv_draw_mask_add(&mask_rin_param, NULL); + + int32_t h; + lv_area_t blend_area; + blend_dsc.blend_area = &blend_area; + blend_dsc.mask_area = &blend_area; + blend_dsc.color = color; + blend_dsc.opa = opa; + blend_dsc.blend_mode = blend_mode; + + /*Calculate the x and y coordinates where the straight parts area*/ + lv_area_t core_area; + core_area.x1 = LV_MAX(outer_area->x1 + rout, inner_area->x1); + core_area.x2 = LV_MIN(outer_area->x2 - rout, inner_area->x2); + core_area.y1 = LV_MAX(outer_area->y1 + rout, inner_area->y1); + core_area.y2 = LV_MIN(outer_area->y2 - rout, inner_area->y2); + lv_coord_t core_w = lv_area_get_width(&core_area); + + bool top_side = outer_area->y1 <= inner_area->y1 ? true : false; + bool bottom_side = outer_area->y2 >= inner_area->y2 ? true : false; + + /*If there is other masks, need to draw line by line*/ + if(mask_any) { + blend_area.x1 = draw_area.x1; + blend_area.x2 = draw_area.x2; + for(h = draw_area.y1; h <= draw_area.y2; h++) { + if(!top_side && h < core_area.y1) continue; + if(!bottom_side && h > core_area.y2) break; + + blend_area.y1 = h; + blend_area.y2 = h; + + lv_memset_ff(blend_dsc.mask_buf, draw_area_w); + blend_dsc.mask_res = lv_draw_mask_apply(blend_dsc.mask_buf, draw_area.x1, h, draw_area_w); + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + + lv_draw_mask_free_param(&mask_rin_param); + lv_draw_mask_remove_id(mask_rin_id); + if(mask_rout_id != LV_MASK_ID_INV) { + lv_draw_mask_free_param(&mask_rout_param); + lv_draw_mask_remove_id(mask_rout_id); + } + lv_mem_buf_release(blend_dsc.mask_buf); + return; + } + + /*No masks*/ + bool left_side = outer_area->x1 <= inner_area->x1 ? true : false; + bool right_side = outer_area->x2 >= inner_area->x2 ? true : false; + + bool split_hor = true; + if(left_side && right_side && top_side && bottom_side && + core_w < SPLIT_LIMIT) { + split_hor = false; + } + + blend_dsc.mask_res = LV_DRAW_MASK_RES_FULL_COVER; + /*Draw the straight lines first if they are long enough*/ + if(top_side && split_hor) { + blend_area.x1 = core_area.x1; + blend_area.x2 = core_area.x2; + blend_area.y1 = outer_area->y1; + blend_area.y2 = inner_area->y1 - 1; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + + if(bottom_side && split_hor) { + blend_area.x1 = core_area.x1; + blend_area.x2 = core_area.x2; + blend_area.y1 = inner_area->y2 + 1; + blend_area.y2 = outer_area->y2; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + + if(left_side) { + blend_area.x1 = outer_area->x1; + blend_area.x2 = inner_area->x1 - 1; + blend_area.y1 = core_area.y1; + blend_area.y2 = core_area.y2; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + + if(right_side) { + blend_area.x1 = inner_area->x2 + 1; + blend_area.x2 = outer_area->x2; + blend_area.y1 = core_area.y1; + blend_area.y2 = core_area.y2; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + + /*Draw the corners*/ + lv_coord_t blend_w; + + /*Left and right corner together if they are close to each other*/ + if(!split_hor) { + /*Calculate the top corner and mirror it to the bottom*/ + blend_area.x1 = draw_area.x1; + blend_area.x2 = draw_area.x2; + lv_coord_t max_h = LV_MAX(rout, inner_area->y1 - outer_area->y1); + for(h = 0; h < max_h; h++) { + lv_coord_t top_y = outer_area->y1 + h; + lv_coord_t bottom_y = outer_area->y2 - h; + if(top_y < draw_area.y1 && bottom_y > draw_area.y2) continue; /*This line is clipped now*/ + + lv_memset_ff(blend_dsc.mask_buf, draw_area_w); + blend_dsc.mask_res = lv_draw_mask_apply(blend_dsc.mask_buf, blend_area.x1, top_y, draw_area_w); + + if(top_y >= draw_area.y1) { + blend_area.y1 = top_y; + blend_area.y2 = top_y; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + + if(bottom_y <= draw_area.y2) { + blend_area.y1 = bottom_y; + blend_area.y2 = bottom_y; + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + } + } + else { + /*Left corners*/ + blend_area.x1 = draw_area.x1; + blend_area.x2 = LV_MIN(draw_area.x2, core_area.x1 - 1); + blend_w = lv_area_get_width(&blend_area); + if(blend_w > 0) { + if(left_side || top_side) { + for(h = draw_area.y1; h < core_area.y1; h++) { + blend_area.y1 = h; + blend_area.y2 = h; + + lv_memset_ff(blend_dsc.mask_buf, blend_w); + blend_dsc.mask_res = lv_draw_mask_apply(blend_dsc.mask_buf, blend_area.x1, h, blend_w); + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + } + + if(left_side || bottom_side) { + for(h = core_area.y2 + 1; h <= draw_area.y2; h++) { + blend_area.y1 = h; + blend_area.y2 = h; + + lv_memset_ff(blend_dsc.mask_buf, blend_w); + blend_dsc.mask_res = lv_draw_mask_apply(blend_dsc.mask_buf, blend_area.x1, h, blend_w); + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + } + } + + /*Right corners*/ + blend_area.x1 = LV_MAX(draw_area.x1, core_area.x2 + 1); + blend_area.x2 = draw_area.x2; + blend_w = lv_area_get_width(&blend_area); + + if(blend_w > 0) { + if(right_side || top_side) { + for(h = draw_area.y1; h < core_area.y1; h++) { + blend_area.y1 = h; + blend_area.y2 = h; + + lv_memset_ff(blend_dsc.mask_buf, blend_w); + blend_dsc.mask_res = lv_draw_mask_apply(blend_dsc.mask_buf, blend_area.x1, h, blend_w); + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + } + + if(right_side || bottom_side) { + for(h = core_area.y2 + 1; h <= draw_area.y2; h++) { + blend_area.y1 = h; + blend_area.y2 = h; + + lv_memset_ff(blend_dsc.mask_buf, blend_w); + blend_dsc.mask_res = lv_draw_mask_apply(blend_dsc.mask_buf, blend_area.x1, h, blend_w); + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + } + } + } + + lv_draw_mask_free_param(&mask_rin_param); + lv_draw_mask_remove_id(mask_rin_id); + lv_draw_mask_free_param(&mask_rout_param); + lv_draw_mask_remove_id(mask_rout_id); + lv_mem_buf_release(blend_dsc.mask_buf); + +#else /*LV_DRAW_COMPLEX*/ + LV_UNUSED(blend_mode); + LV_UNUSED(rout); + LV_UNUSED(rin); + if(!mask_any) { + draw_border_simple(draw_ctx, outer_area, inner_area, color, opa); + return; + } + +#endif /*LV_DRAW_COMPLEX*/ +} +static void draw_border_simple(lv_draw_ctx_t * draw_ctx, const lv_area_t * outer_area, const lv_area_t * inner_area, + lv_color_t color, lv_opa_t opa) +{ + lv_area_t a; + lv_draw_sw_blend_dsc_t blend_dsc; + lv_memset_00(&blend_dsc, sizeof(lv_draw_sw_blend_dsc_t)); + blend_dsc.blend_area = &a; + blend_dsc.color = color; + blend_dsc.opa = opa; + + bool top_side = outer_area->y1 <= inner_area->y1 ? true : false; + bool bottom_side = outer_area->y2 >= inner_area->y2 ? true : false; + bool left_side = outer_area->x1 <= inner_area->x1 ? true : false; + bool right_side = outer_area->x2 >= inner_area->x2 ? true : false; + + + /*Top*/ + a.x1 = outer_area->x1; + a.x2 = outer_area->x2; + a.y1 = outer_area->y1; + a.y2 = inner_area->y1 - 1; + if(top_side) { + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + + /*Bottom*/ + a.y1 = inner_area->y2 + 1; + a.y2 = outer_area->y2; + if(bottom_side) { + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + + /*Left*/ + a.x1 = outer_area->x1; + a.x2 = inner_area->x1 - 1; + a.y1 = (top_side) ? inner_area->y1 : outer_area->y1; + a.y2 = (bottom_side) ? inner_area->y2 : outer_area->y2; + if(left_side) { + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } + + /*Right*/ + a.x1 = inner_area->x2 + 1; + a.x2 = outer_area->x2; + if(right_side) { + lv_draw_sw_blend(draw_ctx, &blend_dsc); + } +} + diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_transform.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_transform.c index 41036d4..9ead7b9 100644 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_transform.c +++ b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_transform.c @@ -1,5 +1,5 @@ -/** - * @file lv_draw_sw_transform.c +/** + * @file lv_draw_sw_tranform.c * */ @@ -7,14 +7,11 @@ * INCLUDES *********************/ #include "lv_draw_sw.h" -#if LV_USE_DRAW_SW - #include "../../misc/lv_assert.h" #include "../../misc/lv_area.h" #include "../../core/lv_refr.h" -#include "../../misc/lv_color.h" -#include "../../stdlib/lv_string.h" +#if LV_DRAW_COMPLEX /********************* * DEFINES *********************/ @@ -29,8 +26,7 @@ typedef struct { int32_t y_out; int32_t sinma; int32_t cosma; - int32_t scale_x; - int32_t scale_y; + int32_t zoom; int32_t angle; int32_t pivot_x_256; int32_t pivot_y_256; @@ -51,39 +47,23 @@ typedef struct { static void transform_point_upscaled(point_transform_dsc_t * t, int32_t xin, int32_t yin, int32_t * xout, int32_t * yout); -#if LV_DRAW_SW_SUPPORT_RGB888 -static void transform_rgb888(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint8_t * dest_buf, bool aa, uint32_t px_size); -#endif - -#if LV_DRAW_SW_SUPPORT_ARGB8888 -static void transform_argb8888(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint8_t * dest_buf, bool aa); -#endif +static void argb_no_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, + int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, + int32_t x_end, lv_color_t * cbuf, uint8_t * abuf); -#if LV_DRAW_SW_SUPPORT_RGB565A8 -static void transform_rgb565a8(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint16_t * cbuf, uint8_t * abuf, bool src_has_a8, bool aa); -#endif +static void rgb_no_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, + int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, + int32_t x_end, lv_color_t * cbuf, uint8_t * abuf, lv_img_cf_t cf); -#if LV_DRAW_SW_SUPPORT_A8 -static void transform_a8(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint8_t * abuf, bool aa); +#if LV_COLOR_DEPTH == 16 +static void rgb565a8_no_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, + int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, + int32_t x_end, lv_color_t * cbuf, uint8_t * abuf); #endif -#if LV_DRAW_SW_SUPPORT_L8 -static void transform_l8_to_al88(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint8_t * abuf, bool aa); - -static void transform_l8_to_argb8888(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint8_t * abuf, bool aa); -#endif +static void argb_and_rgb_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, + int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, + int32_t x_end, lv_color_t * cbuf, uint8_t * abuf, lv_img_cf_t cf); /********************** * STATIC VARIABLES @@ -97,17 +77,15 @@ static void transform_l8_to_argb8888(const uint8_t * src, int32_t src_w, int32_t * GLOBAL FUNCTIONS **********************/ -void lv_draw_sw_transform(lv_draw_unit_t * draw_unit, const lv_area_t * dest_area, const void * src_buf, - int32_t src_w, int32_t src_h, int32_t src_stride, - const lv_draw_image_dsc_t * draw_dsc, const lv_draw_image_sup_t * sup, lv_color_format_t src_cf, void * dest_buf) +void lv_draw_sw_transform(lv_draw_ctx_t * draw_ctx, const lv_area_t * dest_area, const void * src_buf, + lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, + const lv_draw_img_dsc_t * draw_dsc, lv_img_cf_t cf, lv_color_t * cbuf, lv_opa_t * abuf) { - LV_UNUSED(draw_unit); - LV_UNUSED(sup); + LV_UNUSED(draw_ctx); point_transform_dsc_t tr_dsc; - tr_dsc.angle = -draw_dsc->rotation; - tr_dsc.scale_x = draw_dsc->scale_x; - tr_dsc.scale_y = draw_dsc->scale_y; + tr_dsc.angle = -draw_dsc->angle; + tr_dsc.zoom = (256 * 256) / draw_dsc->zoom; tr_dsc.pivot = draw_dsc->pivot; int32_t angle_low = tr_dsc.angle / 10; @@ -127,162 +105,51 @@ void lv_draw_sw_transform(lv_draw_unit_t * draw_unit, const lv_area_t * dest_are tr_dsc.pivot_x_256 = tr_dsc.pivot.x * 256; tr_dsc.pivot_y_256 = tr_dsc.pivot.y * 256; - int32_t dest_w = lv_area_get_width(dest_area); - int32_t dest_h = lv_area_get_height(dest_area); - - int32_t dest_stride_a8 = dest_w; - int32_t dest_stride; - if(src_cf == LV_COLOR_FORMAT_L8) { - dest_stride = dest_w * ((draw_dsc->recolor_opa >= LV_OPA_MIN) ? 4 : 2); - } - else if(src_cf == LV_COLOR_FORMAT_RGB888) { - dest_stride = dest_w * lv_color_format_get_size(LV_COLOR_FORMAT_ARGB8888); - } - else if((src_cf == LV_COLOR_FORMAT_RGB565A8) || (src_cf == LV_COLOR_FORMAT_L8)) { - dest_stride = dest_w * 2; - } - else { - dest_stride = dest_w * lv_color_format_get_size(src_cf); - } - - uint8_t * alpha_buf; - if(src_cf == LV_COLOR_FORMAT_RGB565 || src_cf == LV_COLOR_FORMAT_RGB565A8) { - alpha_buf = dest_buf; - alpha_buf += dest_stride * dest_h; - } - else { - alpha_buf = NULL; - } - - bool aa = (bool) draw_dsc->antialias; - bool is_rotated = draw_dsc->rotation; - - int32_t xs_ups = 0, ys_ups = 0, ys_ups_start = 0, ys_step_256_original = 0; - int32_t xs_step_256 = 0, ys_step_256 = 0; - - /*When some of the color formats are disabled, these variables could be unused, avoid warning here*/ - LV_UNUSED(aa); - LV_UNUSED(xs_ups); - LV_UNUSED(ys_ups); - LV_UNUSED(xs_step_256); - LV_UNUSED(ys_step_256); - - /*If scaled only make some simplification to avoid rounding errors. - *For example if there is a 100x100 image zoomed to 300% - *The destination area in X will be x1=0; x2=299 - *When the step is calculated below it will think that stepping - *1/3 pixels on the original image will result in 300% zoom. - *However this way the last pixel will be on the 99.67 coordinate. - *As it's larger than 99.5 LVGL will start to mix the next coordinate - *which is out of the image, so will make the pixel more transparent. - *To avoid it in case of scale only limit the coordinates to the 0..297 range, - *that is to 0..(src_w-1)*zoom */ - if(is_rotated == false) { + lv_coord_t dest_w = lv_area_get_width(dest_area); + lv_coord_t dest_h = lv_area_get_height(dest_area); + lv_coord_t y; + for(y = 0; y < dest_h; y++) { int32_t xs1_ups, ys1_ups, xs2_ups, ys2_ups; - int32_t x_max = (((src_w - 1 - draw_dsc->pivot.x) * draw_dsc->scale_x) >> 8) + draw_dsc->pivot.x; - int32_t y_max = (((src_h - 1 - draw_dsc->pivot.y) * draw_dsc->scale_y) >> 8) + draw_dsc->pivot.y; - - lv_area_t dest_area_limited; - dest_area_limited.x1 = dest_area->x1 > x_max ? x_max : dest_area->x1; - dest_area_limited.x2 = dest_area->x2 > x_max ? x_max : dest_area->x2; - dest_area_limited.y1 = dest_area->y1 > y_max ? y_max : dest_area->y1; - dest_area_limited.y2 = dest_area->y2 > y_max ? y_max : dest_area->y2; - - transform_point_upscaled(&tr_dsc, dest_area_limited.x1, dest_area_limited.y1, &xs1_ups, &ys1_ups); - transform_point_upscaled(&tr_dsc, dest_area_limited.x2, dest_area_limited.y2, &xs2_ups, &ys2_ups); + transform_point_upscaled(&tr_dsc, dest_area->x1, dest_area->y1 + y, &xs1_ups, &ys1_ups); + transform_point_upscaled(&tr_dsc, dest_area->x2, dest_area->y1 + y, &xs2_ups, &ys2_ups); int32_t xs_diff = xs2_ups - xs1_ups; int32_t ys_diff = ys2_ups - ys1_ups; - xs_step_256 = 0; - ys_step_256_original = 0; + int32_t xs_step_256 = 0; + int32_t ys_step_256 = 0; if(dest_w > 1) { xs_step_256 = (256 * xs_diff) / (dest_w - 1); - } - if(dest_h > 1) { - ys_step_256_original = (256 * ys_diff) / (dest_h - 1); - } - - xs_ups = xs1_ups + 0x80; - ys_ups_start = ys1_ups + 0x80; - } - - int32_t y; - for(y = 0; y < dest_h; y++) { - if(is_rotated == false) { - ys_ups = ys_ups_start + ((ys_step_256_original * y) >> 8); - ys_step_256 = 0; - } - else { - int32_t xs1_ups, ys1_ups, xs2_ups, ys2_ups; - transform_point_upscaled(&tr_dsc, dest_area->x1, dest_area->y1 + y, &xs1_ups, &ys1_ups); - transform_point_upscaled(&tr_dsc, dest_area->x2, dest_area->y1 + y, &xs2_ups, &ys2_ups); - - int32_t xs_diff = xs2_ups - xs1_ups; - int32_t ys_diff = ys2_ups - ys1_ups; - xs_step_256 = 0; - ys_step_256 = 0; - if(dest_w > 1) { - xs_step_256 = (256 * xs_diff) / (dest_w - 1); - ys_step_256 = (256 * ys_diff) / (dest_w - 1); + ys_step_256 = (256 * ys_diff) / (dest_w - 1); + } + int32_t xs_ups = xs1_ups + 0x80; + int32_t ys_ups = ys1_ups + 0x80; + + if(draw_dsc->antialias == 0) { + switch(cf) { + case LV_IMG_CF_TRUE_COLOR_ALPHA: + argb_no_aa(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, cbuf, abuf); + break; + case LV_IMG_CF_TRUE_COLOR: + case LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED: + rgb_no_aa(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, cbuf, abuf, cf); + break; + +#if LV_COLOR_DEPTH == 16 + case LV_IMG_CF_RGB565A8: + rgb565a8_no_aa(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, cbuf, abuf); + break; +#endif + default: + break; } - - xs_ups = xs1_ups + 0x80; - ys_ups = ys1_ups + 0x80; } - - switch(src_cf) { -#if LV_DRAW_SW_SUPPORT_XRGB8888 - case LV_COLOR_FORMAT_XRGB8888: - transform_rgb888(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf, aa, - 4); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB888 - case LV_COLOR_FORMAT_RGB888: - transform_rgb888(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf, aa, - 3); - break; -#endif -#if LV_DRAW_SW_SUPPORT_A8 - case LV_COLOR_FORMAT_A8: - transform_a8(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf, aa); - break; -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 - case LV_COLOR_FORMAT_ARGB8888: - transform_argb8888(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf, - aa); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB565 && LV_DRAW_SW_SUPPORT_RGB565A8 - case LV_COLOR_FORMAT_RGB565: - transform_rgb565a8(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf, - alpha_buf, false, aa); - break; -#endif -#if LV_DRAW_SW_SUPPORT_RGB565A8 - case LV_COLOR_FORMAT_RGB565A8: - transform_rgb565a8(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, - (uint16_t *)dest_buf, - alpha_buf, true, aa); - break; -#endif -#if LV_DRAW_SW_SUPPORT_L8 - case LV_COLOR_FORMAT_L8: - if(draw_dsc->recolor_opa >= LV_OPA_MIN) - transform_l8_to_argb8888(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf, - aa); - else - transform_l8_to_al88(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, dest_buf, aa); - break; -#endif - default: - break; + else { + argb_and_rgb_aa(src_buf, src_w, src_h, src_stride, xs_ups, ys_ups, xs_step_256, ys_step_256, dest_w, cbuf, abuf, cf); } - dest_buf = (uint8_t *)dest_buf + dest_stride; - if(alpha_buf) alpha_buf += dest_stride_a8; + cbuf += dest_w; + abuf += dest_w; } } @@ -290,324 +157,150 @@ void lv_draw_sw_transform(lv_draw_unit_t * draw_unit, const lv_area_t * dest_are * STATIC FUNCTIONS **********************/ -#if LV_DRAW_SW_SUPPORT_RGB888 - -static void transform_rgb888(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint8_t * dest_buf, bool aa, uint32_t px_size) +static void rgb_no_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, + int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, + int32_t x_end, lv_color_t * cbuf, uint8_t * abuf, lv_img_cf_t cf) { int32_t xs_ups_start = xs_ups; int32_t ys_ups_start = ys_ups; - lv_color32_t * dest_c32 = (lv_color32_t *) dest_buf; + lv_disp_t * d = _lv_refr_get_disp_refreshing(); + lv_color_t ck = d->driver->color_chroma_key; + + lv_memset_ff(abuf, x_end); - int32_t x; + lv_coord_t x; for(x = 0; x < x_end; x++) { xs_ups = xs_ups_start + ((xs_step * x) >> 8); ys_ups = ys_ups_start + ((ys_step * x) >> 8); int32_t xs_int = xs_ups >> 8; int32_t ys_int = ys_ups >> 8; - - /*Fully out of the image*/ if(xs_int < 0 || xs_int >= src_w || ys_int < 0 || ys_int >= src_h) { - dest_c32[x].alpha = 0x00; - continue; - } - - /*Get the direction the hor and ver neighbor - *`fract` will be in range of 0x00..0xFF and `next` (+/-1) indicates the direction*/ - int32_t xs_fract = xs_ups & 0xFF; - int32_t ys_fract = ys_ups & 0xFF; - - int32_t x_next; - int32_t y_next; - if(xs_fract < 0x80) { - x_next = -1; - xs_fract = 0x7F - xs_fract; - } - else { - x_next = 1; - xs_fract = xs_fract - 0x80; - } - if(ys_fract < 0x80) { - y_next = -1; - ys_fract = 0x7F - ys_fract; + abuf[x] = 0x00; } else { - y_next = 1; - ys_fract = ys_fract - 0x80; - } - - const uint8_t * src_u8 = &src[ys_int * src_stride + xs_int * px_size]; - - dest_c32[x].red = src_u8[2]; - dest_c32[x].green = src_u8[1]; - dest_c32[x].blue = src_u8[0]; - dest_c32[x].alpha = 0xff; - if(aa && - xs_int + x_next >= 0 && - xs_int + x_next <= src_w - 1 && - ys_int + y_next >= 0 && - ys_int + y_next <= src_h - 1) { - const uint8_t * px_hor_u8 = src_u8 + (int32_t)(x_next * px_size); - lv_color32_t px_hor; - px_hor.red = px_hor_u8[2]; - px_hor.green = px_hor_u8[1]; - px_hor.blue = px_hor_u8[0]; - px_hor.alpha = 0xff; - - const uint8_t * px_ver_u8 = src_u8 + (int32_t)(y_next * src_stride); - lv_color32_t px_ver; - px_ver.red = px_ver_u8[2]; - px_ver.green = px_ver_u8[1]; - px_ver.blue = px_ver_u8[0]; - px_ver.alpha = 0xff; - - if(!lv_color32_eq(dest_c32[x], px_ver)) { - px_ver.alpha = ys_fract; - dest_c32[x] = lv_color_mix32(px_ver, dest_c32[x]); - } - - if(!lv_color32_eq(dest_c32[x], px_hor)) { - px_hor.alpha = xs_fract; - dest_c32[x] = lv_color_mix32(px_hor, dest_c32[x]); - } +#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 + const uint8_t * src_tmp = src; + src_tmp += ys_int * src_stride + xs_int; + cbuf[x].full = src_tmp[0]; +#elif LV_COLOR_DEPTH == 16 + const lv_color_t * src_tmp = (const lv_color_t *)src; + src_tmp += ys_int * src_stride + xs_int; + cbuf[x] = *src_tmp; +#elif LV_COLOR_DEPTH == 32 + const uint8_t * src_tmp = src; + src_tmp += (ys_int * src_stride * sizeof(lv_color_t)) + xs_int * sizeof(lv_color_t); + cbuf[x].full = *((uint32_t *)src_tmp); +#endif } - /*Partially out of the image*/ - else { - lv_opa_t a = 0xff; - - if((xs_int == 0 && x_next < 0) || (xs_int == src_w - 1 && x_next > 0)) { - dest_c32[x].alpha = (a * (0xFF - xs_fract)) >> 8; - } - else if((ys_int == 0 && y_next < 0) || (ys_int == src_h - 1 && y_next > 0)) { - dest_c32[x].alpha = (a * (0xFF - ys_fract)) >> 8; - } + if(cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED && cbuf[x].full == ck.full) { + abuf[x] = 0x00; } } } -#endif - -#if LV_DRAW_SW_SUPPORT_ARGB8888 - -static void transform_argb8888(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint8_t * dest_buf, bool aa) +static void argb_no_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, + int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, + int32_t x_end, lv_color_t * cbuf, uint8_t * abuf) { int32_t xs_ups_start = xs_ups; int32_t ys_ups_start = ys_ups; - lv_color32_t * dest_c32 = (lv_color32_t *) dest_buf; - int32_t x; + lv_coord_t x; for(x = 0; x < x_end; x++) { xs_ups = xs_ups_start + ((xs_step * x) >> 8); ys_ups = ys_ups_start + ((ys_step * x) >> 8); int32_t xs_int = xs_ups >> 8; int32_t ys_int = ys_ups >> 8; - - /*Fully out of the image*/ if(xs_int < 0 || xs_int >= src_w || ys_int < 0 || ys_int >= src_h) { - ((uint32_t *)dest_buf)[x] = 0x00000000; - continue; - } - - /*Get the direction the hor and ver neighbor - *`fract` will be in range of 0x00..0xFF and `next` (+/-1) indicates the direction*/ - int32_t xs_fract = xs_ups & 0xFF; - int32_t ys_fract = ys_ups & 0xFF; - - int32_t x_next; - int32_t y_next; - if(xs_fract < 0x80) { - x_next = -1; - xs_fract = 0x7F - xs_fract; - } - else { - x_next = 1; - xs_fract = xs_fract - 0x80; - } - if(ys_fract < 0x80) { - y_next = -1; - ys_fract = 0x7F - ys_fract; - } - else { - y_next = 1; - ys_fract = ys_fract - 0x80; - } - - const lv_color32_t * src_c32 = (const lv_color32_t *)(src + ys_int * src_stride + xs_int * 4); - - dest_c32[x] = src_c32[0]; - - if(aa && - xs_int + x_next >= 0 && - xs_int + x_next <= src_w - 1 && - ys_int + y_next >= 0 && - ys_int + y_next <= src_h - 1) { - - lv_color32_t px_hor = src_c32[x_next]; - lv_color32_t px_ver = *(const lv_color32_t *)((uint8_t *)src_c32 + y_next * src_stride); - - if(px_ver.alpha == 0) { - dest_c32[x].alpha = (dest_c32[x].alpha * (0xFF - ys_fract)) >> 8; - } - else if(!lv_color32_eq(dest_c32[x], px_ver)) { - if(dest_c32[x].alpha) dest_c32[x].alpha = ((px_ver.alpha * ys_fract) + (dest_c32[x].alpha * (0xFF - ys_fract))) >> 8; - px_ver.alpha = ys_fract; - dest_c32[x] = lv_color_mix32(px_ver, dest_c32[x]); - } - - if(px_hor.alpha == 0) { - dest_c32[x].alpha = (dest_c32[x].alpha * (0xFF - xs_fract)) >> 8; - } - else if(!lv_color32_eq(dest_c32[x], px_hor)) { - if(dest_c32[x].alpha) dest_c32[x].alpha = ((px_hor.alpha * xs_fract) + (dest_c32[x].alpha * (0xFF - xs_fract))) >> 8; - px_hor.alpha = xs_fract; - dest_c32[x] = lv_color_mix32(px_hor, dest_c32[x]); - } + abuf[x] = 0; } - /*Partially out of the image*/ else { - if((xs_int == 0 && x_next < 0) || (xs_int == src_w - 1 && x_next > 0)) { - dest_c32[x].alpha = (dest_c32[x].alpha * (0x7F - xs_fract)) >> 7; - } - else if((ys_int == 0 && y_next < 0) || (ys_int == src_h - 1 && y_next > 0)) { - dest_c32[x].alpha = (dest_c32[x].alpha * (0x7F - ys_fract)) >> 7; - } + const uint8_t * src_tmp = src; + src_tmp += (ys_int * src_stride * LV_IMG_PX_SIZE_ALPHA_BYTE) + xs_int * LV_IMG_PX_SIZE_ALPHA_BYTE; + +#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 + cbuf[x].full = src_tmp[0]; +#elif LV_COLOR_DEPTH == 16 + cbuf[x].full = src_tmp[0] + (src_tmp[1] << 8); +#elif LV_COLOR_DEPTH == 32 + cbuf[x].full = *((uint32_t *)src_tmp); +#endif + abuf[x] = src_tmp[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; } } } -#endif - -#if LV_DRAW_SW_SUPPORT_RGB565A8 - -static void transform_rgb565a8(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint16_t * cbuf, uint8_t * abuf, bool src_has_a8, bool aa) +#if LV_COLOR_DEPTH == 16 +static void rgb565a8_no_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, + int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, + int32_t x_end, lv_color_t * cbuf, uint8_t * abuf) { int32_t xs_ups_start = xs_ups; int32_t ys_ups_start = ys_ups; - const lv_opa_t * src_alpha = src + src_stride * src_h; - - /*Must be signed type, because we would use negative array index calculated from stride*/ - int32_t alpha_stride = src_stride / 2; /*alpha map stride is always half of RGB map stride*/ - - int32_t x; + lv_coord_t x; for(x = 0; x < x_end; x++) { xs_ups = xs_ups_start + ((xs_step * x) >> 8); ys_ups = ys_ups_start + ((ys_step * x) >> 8); int32_t xs_int = xs_ups >> 8; int32_t ys_int = ys_ups >> 8; - - /*Fully out of the image*/ if(xs_int < 0 || xs_int >= src_w || ys_int < 0 || ys_int >= src_h) { - abuf[x] = 0x00; - continue; - } - - /*Get the direction the hor and ver neighbor - *`fract` will be in range of 0x00..0xFF and `next` (+/-1) indicates the direction*/ - int32_t xs_fract = xs_ups & 0xFF; - int32_t ys_fract = ys_ups & 0xFF; - - int32_t x_next; - int32_t y_next; - if(xs_fract < 0x80) { - x_next = -1; - xs_fract = (0x7F - xs_fract) * 2; - } - else { - x_next = 1; - xs_fract = (xs_fract - 0x80) * 2; - } - if(ys_fract < 0x80) { - y_next = -1; - ys_fract = (0x7F - ys_fract) * 2; - } - else { - y_next = 1; - ys_fract = (ys_fract - 0x80) * 2; - } - - const uint16_t * src_tmp_u16 = (const uint16_t *)(src + (ys_int * src_stride) + xs_int * 2); - cbuf[x] = src_tmp_u16[0]; - - if(aa && - xs_int + x_next >= 0 && - xs_int + x_next <= src_w - 1 && - ys_int + y_next >= 0 && - ys_int + y_next <= src_h - 1) { - - uint16_t px_hor = src_tmp_u16[x_next]; - uint16_t px_ver = *(const uint16_t *)((uint8_t *)src_tmp_u16 + (y_next * src_stride)); - - if(src_has_a8) { - const lv_opa_t * src_alpha_tmp = src_alpha; - src_alpha_tmp += (ys_int * alpha_stride) + xs_int; - abuf[x] = src_alpha_tmp[0]; - - lv_opa_t a_hor = src_alpha_tmp[x_next]; - lv_opa_t a_ver = src_alpha_tmp[y_next * alpha_stride]; - - if(a_ver != abuf[x]) a_ver = ((a_ver * ys_fract) + (abuf[x] * (0x100 - ys_fract))) >> 8; - if(a_hor != abuf[x]) a_hor = ((a_hor * xs_fract) + (abuf[x] * (0x100 - xs_fract))) >> 8; - abuf[x] = (a_ver + a_hor) >> 1; - - if(abuf[x] == 0x00) continue; - } - else { - abuf[x] = 0xff; - } - - if(cbuf[x] != px_ver || cbuf[x] != px_hor) { - uint16_t v = lv_color_16_16_mix(px_ver, cbuf[x], ys_fract); - uint16_t h = lv_color_16_16_mix(px_hor, cbuf[x], xs_fract); - cbuf[x] = lv_color_16_16_mix(h, v, LV_OPA_50); - } + abuf[x] = 0; } - /*Partially out of the image*/ else { - lv_opa_t a; - if(src_has_a8) { - const lv_opa_t * src_alpha_tmp = src_alpha; - src_alpha_tmp += (ys_int * alpha_stride) + xs_int; - a = src_alpha_tmp[0]; - } - else { - a = 0xff; - } + const lv_color_t * src_tmp = (const lv_color_t *)src; + src_tmp += ys_int * src_stride + xs_int; + cbuf[x] = *src_tmp; - if((xs_int == 0 && x_next < 0) || (xs_int == src_w - 1 && x_next > 0)) { - abuf[x] = (a * (0xFF - xs_fract)) >> 8; - } - else if((ys_int == 0 && y_next < 0) || (ys_int == src_h - 1 && y_next > 0)) { - abuf[x] = (a * (0xFF - ys_fract)) >> 8; - } - else { - abuf[x] = a; - } + const lv_opa_t * a_tmp = src + src_stride * src_h * sizeof(lv_color_t); + a_tmp += ys_int * src_stride + xs_int; + abuf[x] = *a_tmp; } } } - #endif -#if LV_DRAW_SW_SUPPORT_A8 -static void transform_a8(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint8_t * abuf, bool aa) +static void argb_and_rgb_aa(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, + int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, + int32_t x_end, lv_color_t * cbuf, uint8_t * abuf, lv_img_cf_t cf) { int32_t xs_ups_start = xs_ups; int32_t ys_ups_start = ys_ups; + bool has_alpha; + int32_t px_size; + lv_color_t ck = _LV_COLOR_ZERO_INITIALIZER; + switch(cf) { + case LV_IMG_CF_TRUE_COLOR: + has_alpha = false; + px_size = sizeof(lv_color_t); + break; + case LV_IMG_CF_TRUE_COLOR_ALPHA: + has_alpha = true; + px_size = LV_IMG_PX_SIZE_ALPHA_BYTE; + break; + case LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED: { + has_alpha = true; + px_size = sizeof(lv_color_t); + lv_disp_t * d = _lv_refr_get_disp_refreshing(); + ck = d->driver->color_chroma_key; + break; + } +#if LV_COLOR_DEPTH == 16 + case LV_IMG_CF_RGB565A8: + has_alpha = true; + px_size = sizeof(lv_color_t); + break; +#endif + default: + return; + } - int32_t x; + lv_coord_t x; for(x = 0; x < x_end; x++) { xs_ups = xs_ups_start + ((xs_step * x) >> 8); ys_ups = ys_ups_start + ((ys_step * x) >> 8); @@ -646,205 +339,137 @@ static void transform_a8(const uint8_t * src, int32_t src_w, int32_t src_h, int3 } const uint8_t * src_tmp = src; - src_tmp += ys_int * src_stride + xs_int; - abuf[x] = src_tmp[0]; + src_tmp += (ys_int * src_stride * px_size) + xs_int * px_size; + - if(aa && - xs_int + x_next >= 0 && + if(xs_int + x_next >= 0 && xs_int + x_next <= src_w - 1 && ys_int + y_next >= 0 && ys_int + y_next <= src_h - 1) { - lv_opa_t a_ver = src_tmp[x_next]; - lv_opa_t a_hor = src_tmp[y_next * src_stride]; - - if(a_ver != abuf[x]) a_ver = ((a_ver * ys_fract) + (abuf[x] * (0x100 - ys_fract))) >> 8; - if(a_hor != abuf[x]) a_hor = ((a_hor * xs_fract) + (abuf[x] * (0x100 - xs_fract))) >> 8; - abuf[x] = (a_ver + a_hor) >> 1; - } - else { - /*Partially out of the image*/ - if((xs_int == 0 && x_next < 0) || (xs_int == src_w - 1 && x_next > 0)) { - abuf[x] = (src_tmp[0] * (0xFF - xs_fract)) >> 8; - } - else if((ys_int == 0 && y_next < 0) || (ys_int == src_h - 1 && y_next > 0)) { - abuf[x] = (src_tmp[0] * (0xFF - ys_fract)) >> 8; - } - } - } -} - + const uint8_t * px_base = src_tmp; + const uint8_t * px_hor = src_tmp + x_next * px_size; + const uint8_t * px_ver = src_tmp + y_next * src_stride * px_size; + lv_color_t c_base; + lv_color_t c_ver; + lv_color_t c_hor; + + if(has_alpha) { + lv_opa_t a_base; + lv_opa_t a_ver; + lv_opa_t a_hor; + if(cf == LV_IMG_CF_TRUE_COLOR_ALPHA) { + a_base = px_base[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; + a_ver = px_ver[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; + a_hor = px_hor[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; + } +#if LV_COLOR_DEPTH == 16 + else if(cf == LV_IMG_CF_RGB565A8) { + const lv_opa_t * a_tmp = src + src_stride * src_h * sizeof(lv_color_t); + a_base = *(a_tmp + (ys_int * src_stride) + xs_int); + a_hor = *(a_tmp + (ys_int * src_stride) + xs_int + x_next); + a_ver = *(a_tmp + ((ys_int + y_next) * src_stride) + xs_int); + } #endif + else if(cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { + if(((lv_color_t *)px_base)->full == ck.full || + ((lv_color_t *)px_ver)->full == ck.full || + ((lv_color_t *)px_hor)->full == ck.full) { + abuf[x] = 0x00; + continue; + } + else { + a_base = 0xff; + a_ver = 0xff; + a_hor = 0xff; + } + } + else { + a_base = 0xff; + a_ver = 0xff; + a_hor = 0xff; + } + + if(a_ver != a_base) a_ver = ((a_ver * ys_fract) + (a_base * (0x100 - ys_fract))) >> 8; + if(a_hor != a_base) a_hor = ((a_hor * xs_fract) + (a_base * (0x100 - xs_fract))) >> 8; + abuf[x] = (a_ver + a_hor) >> 1; -#if LV_DRAW_SW_SUPPORT_L8 - -#if LV_DRAW_SW_SUPPORT_AL88 - -/* L8 will be transformed into an AL88 buffer, because it will not be recolored */ -static void transform_l8_to_al88(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint8_t * dest_buf, bool aa) -{ - int32_t xs_ups_start = xs_ups; - int32_t ys_ups_start = ys_ups; - lv_color16a_t * dest_al88 = (lv_color16a_t *)dest_buf; - - int32_t x; - for(x = 0; x < x_end; x++) { - xs_ups = xs_ups_start + ((xs_step * x) >> 8); - ys_ups = ys_ups_start + ((ys_step * x) >> 8); - - int32_t xs_int = xs_ups >> 8; - int32_t ys_int = ys_ups >> 8; - - /*Fully out of the image*/ - if(xs_int < 0 || xs_int >= src_w || ys_int < 0 || ys_int >= src_h) { - dest_al88[x].lumi = 0x00; - dest_al88[x].alpha = 0x00; - continue; - } - - /*Get the direction the hor and ver neighbor - *`fract` will be in range of 0x00..0xFF and `next` (+/-1) indicates the direction*/ - int32_t xs_fract = xs_ups & 0xFF; - int32_t ys_fract = ys_ups & 0xFF; - - int32_t x_next; - int32_t y_next; - if(xs_fract < 0x80) { - x_next = -1; - xs_fract = (0x7F - xs_fract) * 2; - } - else { - x_next = 1; - xs_fract = (xs_fract - 0x80) * 2; - } - if(ys_fract < 0x80) { - y_next = -1; - ys_fract = (0x7F - ys_fract) * 2; - } - else { - y_next = 1; - ys_fract = (ys_fract - 0x80) * 2; - } - - const uint8_t * src_tmp = src; - src_tmp += ys_int * src_stride + xs_int; - dest_al88[x].lumi = src_tmp[0]; - dest_al88[x].alpha = 255; - if(aa && - xs_int + x_next >= 0 && - xs_int + x_next <= src_w - 1 && - ys_int + y_next >= 0 && - ys_int + y_next <= src_h - 1) { - - lv_opa_t a_ver = src_tmp[x_next]; - lv_opa_t a_hor = src_tmp[y_next * src_stride]; + if(abuf[x] == 0x00) continue; - if(a_ver != dest_al88[x].lumi) a_ver = ((a_ver * ys_fract) + (dest_al88[x].lumi * (0x100 - ys_fract))) >> 8; - if(a_hor != dest_al88[x].lumi) a_hor = ((a_hor * xs_fract) + (dest_al88[x].lumi * (0x100 - xs_fract))) >> 8; - dest_al88[x].lumi = (a_ver + a_hor) >> 1; - } - else { - /*Partially out of the image*/ - if((xs_int == 0 && x_next < 0) || (xs_int == src_w - 1 && x_next > 0)) { - dest_al88[x].alpha = (src_tmp[0] * (0xFF - xs_fract)) >> 8; +#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 + c_base.full = px_base[0]; + c_ver.full = px_ver[0]; + c_hor.full = px_hor[0]; +#elif LV_COLOR_DEPTH == 16 + c_base.full = px_base[0] + (px_base[1] << 8); + c_ver.full = px_ver[0] + (px_ver[1] << 8); + c_hor.full = px_hor[0] + (px_hor[1] << 8); +#elif LV_COLOR_DEPTH == 32 + c_base.full = *((uint32_t *)px_base); + c_ver.full = *((uint32_t *)px_ver); + c_hor.full = *((uint32_t *)px_hor); +#endif } - else if((ys_int == 0 && y_next < 0) || (ys_int == src_h - 1 && y_next > 0)) { - dest_al88[x].alpha = (src_tmp[0] * (0xFF - ys_fract)) >> 8; + /*No alpha channel -> RGB*/ + else { + c_base = *((const lv_color_t *) px_base); + c_hor = *((const lv_color_t *) px_hor); + c_ver = *((const lv_color_t *) px_ver); + abuf[x] = 0xff; } - } - } -} - -#endif -#if LV_DRAW_SW_SUPPORT_ARGB8888 - -/* L8 has to be transformed into an ARGB8888 buffer, because it will be recolored as well */ -static void transform_l8_to_argb8888(const uint8_t * src, int32_t src_w, int32_t src_h, int32_t src_stride, - int32_t xs_ups, int32_t ys_ups, int32_t xs_step, int32_t ys_step, - int32_t x_end, uint8_t * dest_buf, bool aa) -{ - int32_t xs_ups_start = xs_ups; - int32_t ys_ups_start = ys_ups; - lv_color32_t * dest_c32 = (lv_color32_t *)dest_buf; - - int32_t x; - for(x = 0; x < x_end; x++) { - xs_ups = xs_ups_start + ((xs_step * x) >> 8); - ys_ups = ys_ups_start + ((ys_step * x) >> 8); - - int32_t xs_int = xs_ups >> 8; - int32_t ys_int = ys_ups >> 8; - - /*Fully out of the image*/ - if(xs_int < 0 || xs_int >= src_w || ys_int < 0 || ys_int >= src_h) { - *((uint32_t *)&dest_c32[x]) = 0L; - continue; - } - - /*Get the direction the hor and ver neighbor - *`fract` will be in range of 0x00..0xFF and `next` (+/-1) indicates the direction*/ - int32_t xs_fract = xs_ups & 0xFF; - int32_t ys_fract = ys_ups & 0xFF; - - int32_t x_next; - int32_t y_next; - if(xs_fract < 0x80) { - x_next = -1; - xs_fract = (0x7F - xs_fract) * 2; - } - else { - x_next = 1; - xs_fract = (xs_fract - 0x80) * 2; - } - if(ys_fract < 0x80) { - y_next = -1; - ys_fract = (0x7F - ys_fract) * 2; + if(c_base.full == c_ver.full && c_base.full == c_hor.full) { + cbuf[x] = c_base; + } + else { + c_ver = lv_color_mix(c_ver, c_base, ys_fract); + c_hor = lv_color_mix(c_hor, c_base, xs_fract); + cbuf[x] = lv_color_mix(c_hor, c_ver, LV_OPA_50); + } } + /*Partially out of the image*/ else { - y_next = 1; - ys_fract = (ys_fract - 0x80) * 2; - } - - const uint8_t * src_tmp = src; - src_tmp += ys_int * src_stride + xs_int; - dest_c32[x].red = dest_c32[x].green = dest_c32[x].blue = src_tmp[0]; - dest_c32[x].alpha = 255; - if(aa && - xs_int + x_next >= 0 && - xs_int + x_next <= src_w - 1 && - ys_int + y_next >= 0 && - ys_int + y_next <= src_h - 1) { - - lv_opa_t a_ver = src_tmp[x_next]; - lv_opa_t a_hor = src_tmp[y_next * src_stride]; +#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 + cbuf[x].full = src_tmp[0]; +#elif LV_COLOR_DEPTH == 16 + cbuf[x].full = src_tmp[0] + (src_tmp[1] << 8); +#elif LV_COLOR_DEPTH == 32 + cbuf[x].full = *((uint32_t *)src_tmp); +#endif + lv_opa_t a; + switch(cf) { + case LV_IMG_CF_TRUE_COLOR_ALPHA: + a = src_tmp[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; + break; + case LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED: + a = cbuf[x].full == ck.full ? 0x00 : 0xff; + break; +#if LV_COLOR_DEPTH == 16 + case LV_IMG_CF_RGB565A8: + a = *(src + src_stride * src_h * sizeof(lv_color_t) + (ys_int * src_stride) + xs_int); + break; +#endif + default: + a = 0xff; + } - if(a_ver != src_tmp[0]) a_ver = ((a_ver * ys_fract) + (src_tmp[0] * (0x100 - ys_fract))) >> 8; - if(a_hor != src_tmp[0]) a_hor = ((a_hor * xs_fract) + (src_tmp[0] * (0x100 - xs_fract))) >> 8; - dest_c32[x].red = dest_c32[x].green = dest_c32[x].blue = (a_ver + a_hor) >> 1; - } - else { - /*Partially out of the image*/ - if((xs_int == 0 && x_next < 0) || (xs_int == src_w - 1 && x_next > 0)) { - dest_c32[x].alpha = (src_tmp[0] * (0xFF - xs_fract)) >> 8; + if((xs_int == 0 && x_next < 0) || (xs_int == src_w - 1 && x_next > 0)) { + abuf[x] = (a * (0xFF - xs_fract)) >> 8; } - else if((ys_int == 0 && y_next < 0) || (ys_int == src_h - 1 && y_next > 0)) { - dest_c32[x].alpha = (src_tmp[0] * (0xFF - ys_fract)) >> 8; + else if((ys_int == 0 && y_next < 0) || (ys_int == src_h - 1 && y_next > 0)) { + abuf[x] = (a * (0xFF - ys_fract)) >> 8; + } + else { + abuf[x] = 0x00; } } } } -#endif - -#endif - static void transform_point_upscaled(point_transform_dsc_t * t, int32_t xin, int32_t yin, int32_t * xout, int32_t * yout) { - if(t->angle == 0 && t->scale_x == LV_SCALE_NONE && t->scale_y == LV_SCALE_NONE) { + if(t->angle == 0 && t->zoom == LV_IMG_ZOOM_NONE) { *xout = xin * 256; *yout = yin * 256; return; @@ -854,17 +479,18 @@ static void transform_point_upscaled(point_transform_dsc_t * t, int32_t xin, int yin -= t->pivot.y; if(t->angle == 0) { - *xout = ((int32_t)(xin * 256 * 256 / t->scale_x)) + (t->pivot_x_256); - *yout = ((int32_t)(yin * 256 * 256 / t->scale_y)) + (t->pivot_y_256); + *xout = ((int32_t)(xin * t->zoom)) + (t->pivot_x_256); + *yout = ((int32_t)(yin * t->zoom)) + (t->pivot_y_256); } - else if(t->scale_x == LV_SCALE_NONE && t->scale_y == LV_SCALE_NONE) { + else if(t->zoom == LV_IMG_ZOOM_NONE) { *xout = ((t->cosma * xin - t->sinma * yin) >> 2) + (t->pivot_x_256); *yout = ((t->sinma * xin + t->cosma * yin) >> 2) + (t->pivot_y_256); } else { - *xout = (((t->cosma * xin - t->sinma * yin) * 256 / t->scale_x) >> 2) + (t->pivot_x_256); - *yout = (((t->sinma * xin + t->cosma * yin) * 256 / t->scale_y) >> 2) + (t->pivot_y_256); + *xout = (((t->cosma * xin - t->sinma * yin) * t->zoom) >> 10) + (t->pivot_x_256); + *yout = (((t->sinma * xin + t->cosma * yin) * t->zoom) >> 10) + (t->pivot_y_256); } } -#endif /*LV_USE_DRAW_SW*/ +#endif + diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_triangle.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_triangle.c deleted file mode 100644 index 4d42c4e..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_triangle.c +++ /dev/null @@ -1,200 +0,0 @@ -/** - * @file lv_draw_sw_triangle.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_draw_sw_mask_private.h" -#include "blend/lv_draw_sw_blend_private.h" -#include "../lv_draw_private.h" -#include "lv_draw_sw.h" -#if LV_USE_DRAW_SW - -#include "../../misc/lv_math.h" -#include "../../stdlib/lv_mem.h" -#include "../../misc/lv_area_private.h" -#include "../../misc/lv_color.h" -#include "../../stdlib/lv_string.h" -#include "../lv_draw_triangle_private.h" -#include "lv_draw_sw_gradient_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_sw_triangle(lv_draw_unit_t * draw_unit, const lv_draw_triangle_dsc_t * dsc) -{ -#if LV_DRAW_SW_COMPLEX - lv_area_t tri_area; - tri_area.x1 = (int32_t)LV_MIN3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - tri_area.y1 = (int32_t)LV_MIN3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - tri_area.x2 = (int32_t)LV_MAX3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - tri_area.y2 = (int32_t)LV_MAX3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - - bool is_common; - lv_area_t draw_area; - is_common = lv_area_intersect(&draw_area, &tri_area, draw_unit->clip_area); - if(!is_common) return; - - lv_point_t p[3]; - /*If there is a vertical side use it as p[0] and p[1]*/ - if(dsc->p[0].x == dsc->p[1].x) { - p[0] = lv_point_from_precise(&dsc->p[0]); - p[1] = lv_point_from_precise(&dsc->p[1]); - p[2] = lv_point_from_precise(&dsc->p[2]); - } - else if(dsc->p[0].x == dsc->p[2].x) { - p[0] = lv_point_from_precise(&dsc->p[0]); - p[1] = lv_point_from_precise(&dsc->p[2]); - p[2] = lv_point_from_precise(&dsc->p[1]); - } - else if(dsc->p[1].x == dsc->p[2].x) { - p[0] = lv_point_from_precise(&dsc->p[1]); - p[1] = lv_point_from_precise(&dsc->p[2]); - p[2] = lv_point_from_precise(&dsc->p[0]); - } - else { - p[0] = lv_point_from_precise(&dsc->p[0]); - p[1] = lv_point_from_precise(&dsc->p[1]); - p[2] = lv_point_from_precise(&dsc->p[2]); - - /*Set the smallest y as p[0]*/ - if(p[0].y > p[1].y) lv_point_swap(&p[0], &p[1]); - if(p[0].y > p[2].y) lv_point_swap(&p[0], &p[2]); - - /*Set the greatest y as p[1]*/ - if(p[1].y < p[2].y) lv_point_swap(&p[1], &p[2]); - } - - /*Be sure p[0] is on the top*/ - if(p[0].y > p[1].y) lv_point_swap(&p[0], &p[1]); - - /*If right == true p[2] is on the right side of the p[0] p[1] line*/ - bool right = ((p[1].x - p[0].x) * (p[2].y - p[0].y) - (p[1].y - p[0].y) * (p[2].x - p[0].x)) < 0; - - void * masks[4] = {0}; - lv_draw_sw_mask_line_param_t mask_left; - lv_draw_sw_mask_line_param_t mask_right; - lv_draw_sw_mask_line_param_t mask_bottom; - - lv_draw_sw_mask_line_points_init(&mask_left, p[0].x, p[0].y, - p[1].x, p[1].y, - right ? LV_DRAW_SW_MASK_LINE_SIDE_RIGHT : LV_DRAW_SW_MASK_LINE_SIDE_LEFT); - - lv_draw_sw_mask_line_points_init(&mask_right, p[0].x, p[0].y, - p[2].x, p[2].y, - right ? LV_DRAW_SW_MASK_LINE_SIDE_LEFT : LV_DRAW_SW_MASK_LINE_SIDE_RIGHT); - - if(p[1].y == p[2].y) { - lv_draw_sw_mask_line_points_init(&mask_bottom, p[1].x, p[1].y, - p[2].x, p[2].y, LV_DRAW_SW_MASK_LINE_SIDE_TOP); - } - else { - lv_draw_sw_mask_line_points_init(&mask_bottom, p[1].x, p[1].y, - p[2].x, p[2].y, - right ? LV_DRAW_SW_MASK_LINE_SIDE_LEFT : LV_DRAW_SW_MASK_LINE_SIDE_RIGHT); - } - - masks[0] = &mask_left; - masks[1] = &mask_right; - masks[2] = &mask_bottom; - int32_t area_w = lv_area_get_width(&draw_area); - lv_opa_t * mask_buf = lv_malloc(area_w); - - lv_area_t blend_area = draw_area; - blend_area.y2 = blend_area.y1; - lv_draw_sw_blend_dsc_t blend_dsc; - blend_dsc.color = dsc->bg_color; - blend_dsc.opa = dsc->bg_opa; - blend_dsc.mask_buf = mask_buf; - blend_dsc.blend_area = &blend_area; - blend_dsc.mask_area = &blend_area; - blend_dsc.blend_mode = LV_BLEND_MODE_NORMAL; - blend_dsc.src_buf = NULL; - - lv_grad_dir_t grad_dir = dsc->bg_grad.dir; - - lv_grad_t * grad = lv_gradient_get(&dsc->bg_grad, lv_area_get_width(&tri_area), lv_area_get_height(&tri_area)); - lv_opa_t * grad_opa_map = NULL; - if(grad && grad_dir == LV_GRAD_DIR_HOR) { - blend_dsc.src_area = &blend_area; - blend_dsc.src_buf = grad->color_map + draw_area.x1 - tri_area.x1; - grad_opa_map = grad->opa_map + draw_area.x1 - tri_area.x1; - blend_dsc.src_color_format = LV_COLOR_FORMAT_RGB888; - } - - int32_t y; - for(y = draw_area.y1; y <= draw_area.y2; y++) { - blend_area.y1 = y; - blend_area.y2 = y; - lv_memset(mask_buf, 0xff, area_w); - blend_dsc.mask_res = lv_draw_sw_mask_apply(masks, mask_buf, draw_area.x1, y, area_w); - if(grad_dir == LV_GRAD_DIR_VER) { - blend_dsc.color = grad->color_map[y - tri_area.y1]; - blend_dsc.opa = grad->opa_map[y - tri_area.y1]; - if(dsc->bg_opa < LV_OPA_MAX) blend_dsc.opa = LV_OPA_MIX2(blend_dsc.opa, dsc->bg_opa); - } - else if(grad_dir == LV_GRAD_DIR_HOR) { - if(grad_opa_map) { - int32_t i; - if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_CHANGED) { - blend_dsc.mask_buf = mask_buf; - for(i = 0; i < area_w; i++) { - if(grad_opa_map[i] < LV_OPA_MAX) mask_buf[i] = LV_OPA_MIX2(mask_buf[i], grad_opa_map[i]); - } - } - else if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_FULL_COVER) { - blend_dsc.mask_buf = grad_opa_map; - blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED; - } - else if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_TRANSP) { - continue; - } - } - } - lv_draw_sw_blend(draw_unit, &blend_dsc); - } - - lv_free(mask_buf); - lv_draw_sw_mask_free_param(&mask_bottom); - lv_draw_sw_mask_free_param(&mask_left); - lv_draw_sw_mask_free_param(&mask_right); - - if(grad) { - lv_gradient_cleanup(grad); - } - -#else - LV_UNUSED(draw_unit); - LV_UNUSED(dsc); - LV_LOG_WARN("Can't draw triangles with LV_DRAW_SW_COMPLEX == 0"); -#endif /*LV_DRAW_SW_COMPLEX*/ -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_SW*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_vector.c b/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_vector.c deleted file mode 100644 index 4b99a47..0000000 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_vector.c +++ /dev/null @@ -1,453 +0,0 @@ -/** - * @file lv_draw_img.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../lv_image_decoder_private.h" -#include "../lv_draw_vector_private.h" -#include "../lv_draw_private.h" -#include "lv_draw_sw.h" - -#if LV_USE_VECTOR_GRAPHIC && LV_USE_THORVG -#if LV_USE_THORVG_EXTERNAL - #include -#else - #include "../../libs/thorvg/thorvg_capi.h" -#endif -#include "../../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - float x; - float y; - float w; - float h; -} _tvg_rect; - -typedef struct { - uint8_t r; - uint8_t g; - uint8_t b; - uint8_t a; -} _tvg_color; - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -static void lv_area_to_tvg(_tvg_rect * rect, const lv_area_t * area) -{ - rect->x = area->x1; - rect->y = area->y1; - rect->w = lv_area_get_width(area) - 1; - rect->h = lv_area_get_height(area) - 1; -} - -static void lv_color_to_tvg(_tvg_color * color, const lv_color32_t * c, lv_opa_t opa) -{ - color->r = c->red; - color->g = c->green; - color->b = c->blue; - color->a = LV_OPA_MIX2(c->alpha, opa); -} - -static void lv_matrix_to_tvg(Tvg_Matrix * tm, const lv_matrix_t * m) -{ - tm->e11 = m->m[0][0]; - tm->e12 = m->m[0][1]; - tm->e13 = m->m[0][2]; - tm->e21 = m->m[1][0]; - tm->e22 = m->m[1][1]; - tm->e23 = m->m[1][2]; - tm->e31 = m->m[2][0]; - tm->e32 = m->m[2][1]; - tm->e33 = m->m[2][2]; -} - -static void _set_paint_matrix(Tvg_Paint * obj, const Tvg_Matrix * m) -{ - tvg_paint_set_transform(obj, m); -} - -static void _set_paint_shape(Tvg_Paint * obj, const lv_vector_path_t * p) -{ - uint32_t pidx = 0; - lv_vector_path_op_t * op = lv_array_front(&p->ops); - uint32_t size = lv_array_size(&p->ops); - for(uint32_t i = 0; i < size; i++) { - switch(op[i]) { - case LV_VECTOR_PATH_OP_MOVE_TO: { - lv_fpoint_t * pt = lv_array_at(&p->points, pidx); - tvg_shape_move_to(obj, pt->x, pt->y); - pidx += 1; - } - break; - case LV_VECTOR_PATH_OP_LINE_TO: { - lv_fpoint_t * pt = lv_array_at(&p->points, pidx); - tvg_shape_line_to(obj, pt->x, pt->y); - pidx += 1; - } - break; - case LV_VECTOR_PATH_OP_QUAD_TO: { - lv_fpoint_t * pt1 = lv_array_at(&p->points, pidx); - lv_fpoint_t * pt2 = lv_array_at(&p->points, pidx + 1); - - lv_fpoint_t * last_pt = lv_array_at(&p->points, pidx - 1); - - lv_fpoint_t cp[2]; - cp[0].x = (last_pt->x + 2 * pt1->x) * (1.0f / 3.0f); - cp[0].y = (last_pt->y + 2 * pt1->y) * (1.0f / 3.0f); - cp[1].x = (pt2->x + 2 * pt1->x) * (1.0f / 3.0f); - cp[1].y = (pt2->y + 2 * pt1->y) * (1.0f / 3.0f); - - tvg_shape_cubic_to(obj, cp[0].x, cp[0].y, cp[1].x, cp[1].y, pt2->x, pt2->y); - pidx += 2; - } - break; - case LV_VECTOR_PATH_OP_CUBIC_TO: { - lv_fpoint_t * pt1 = lv_array_at(&p->points, pidx); - lv_fpoint_t * pt2 = lv_array_at(&p->points, pidx + 1); - lv_fpoint_t * pt3 = lv_array_at(&p->points, pidx + 2); - - tvg_shape_cubic_to(obj, pt1->x, pt1->y, pt2->x, pt2->y, pt3->x, pt3->y); - pidx += 3; - } - break; - case LV_VECTOR_PATH_OP_CLOSE: { - tvg_shape_close(obj); - } - break; - } - } -} - -static Tvg_Stroke_Cap lv_stroke_cap_to_tvg(lv_vector_stroke_cap_t cap) -{ - switch(cap) { - case LV_VECTOR_STROKE_CAP_SQUARE: - return TVG_STROKE_CAP_SQUARE; - case LV_VECTOR_STROKE_CAP_ROUND: - return TVG_STROKE_CAP_ROUND; - case LV_VECTOR_STROKE_CAP_BUTT: - return TVG_STROKE_CAP_BUTT; - default: - return TVG_STROKE_CAP_SQUARE; - } -} - -static Tvg_Stroke_Join lv_stroke_join_to_tvg(lv_vector_stroke_join_t join) -{ - switch(join) { - case LV_VECTOR_STROKE_JOIN_BEVEL: - return TVG_STROKE_JOIN_BEVEL; - case LV_VECTOR_STROKE_JOIN_ROUND: - return TVG_STROKE_JOIN_ROUND; - case LV_VECTOR_STROKE_JOIN_MITER: - return TVG_STROKE_JOIN_MITER; - default: - return TVG_STROKE_JOIN_BEVEL; - } -} - -static Tvg_Stroke_Fill lv_spread_to_tvg(lv_vector_gradient_spread_t sp) -{ - switch(sp) { - case LV_VECTOR_GRADIENT_SPREAD_PAD: - return TVG_STROKE_FILL_PAD; - case LV_VECTOR_GRADIENT_SPREAD_REPEAT: - return TVG_STROKE_FILL_REPEAT; - case LV_VECTOR_GRADIENT_SPREAD_REFLECT: - return TVG_STROKE_FILL_REFLECT; - default: - return TVG_STROKE_FILL_PAD; - } -} - -static void _setup_gradient(Tvg_Gradient * gradient, const lv_vector_gradient_t * grad, - const lv_matrix_t * matrix) -{ - Tvg_Color_Stop * stops = (Tvg_Color_Stop *)lv_malloc(sizeof(Tvg_Color_Stop) * grad->stops_count); - LV_ASSERT_MALLOC(stops); - for(uint16_t i = 0; i < grad->stops_count; i++) { - const lv_gradient_stop_t * s = &(grad->stops[i]); - - stops[i].offset = s->frac / 255.0f; - stops[i].r = s->color.red; - stops[i].g = s->color.green; - stops[i].b = s->color.blue; - stops[i].a = s->opa; - } - - tvg_gradient_set_color_stops(gradient, stops, grad->stops_count); - tvg_gradient_set_spread(gradient, lv_spread_to_tvg(grad->spread)); - Tvg_Matrix mtx; - lv_matrix_to_tvg(&mtx, matrix); - tvg_gradient_set_transform(gradient, &mtx); - lv_free(stops); -} - -static void _set_paint_stroke_gradient(Tvg_Paint * obj, const lv_vector_gradient_t * g, const lv_matrix_t * m) -{ - Tvg_Gradient * grad = NULL; - if(g->style == LV_VECTOR_GRADIENT_STYLE_RADIAL) { - grad = tvg_radial_gradient_new(); - tvg_radial_gradient_set(grad, g->cx, g->cy, g->cr); - _setup_gradient(grad, g, m); - tvg_shape_set_stroke_radial_gradient(obj, grad); - } - else { - grad = tvg_linear_gradient_new(); - tvg_linear_gradient_set(grad, g->x1, g->y1, g->x2, g->y2); - _setup_gradient(grad, g, m); - tvg_shape_set_stroke_linear_gradient(obj, grad); - } -} - -static void _set_paint_stroke(Tvg_Paint * obj, const lv_vector_stroke_dsc_t * dsc) -{ - if(dsc->style == LV_VECTOR_DRAW_STYLE_SOLID) { - _tvg_color c; - lv_color_to_tvg(&c, &dsc->color, dsc->opa); - tvg_shape_set_stroke_color(obj, c.r, c.g, c.b, c.a); - } - else { /*gradient*/ - _set_paint_stroke_gradient(obj, &dsc->gradient, &dsc->matrix); - } - - tvg_shape_set_stroke_width(obj, dsc->width); - tvg_shape_set_stroke_miterlimit(obj, dsc->miter_limit); - tvg_shape_set_stroke_cap(obj, lv_stroke_cap_to_tvg(dsc->cap)); - tvg_shape_set_stroke_join(obj, lv_stroke_join_to_tvg(dsc->join)); - - if(!lv_array_is_empty(&dsc->dash_pattern)) { - float * dash_array = lv_array_front(&dsc->dash_pattern); - tvg_shape_set_stroke_dash(obj, dash_array, dsc->dash_pattern.size); - } -} - -static Tvg_Fill_Rule lv_fill_rule_to_tvg(lv_vector_fill_t rule) -{ - switch(rule) { - case LV_VECTOR_FILL_NONZERO: - return TVG_FILL_RULE_WINDING; - case LV_VECTOR_FILL_EVENODD: - return TVG_FILL_RULE_EVEN_ODD; - default: - return TVG_FILL_RULE_WINDING; - } -} - -static void _set_paint_fill_gradient(Tvg_Paint * obj, const lv_vector_gradient_t * g, const lv_matrix_t * m) -{ - Tvg_Gradient * grad = NULL; - if(g->style == LV_VECTOR_GRADIENT_STYLE_RADIAL) { - grad = tvg_radial_gradient_new(); - tvg_radial_gradient_set(grad, g->cx, g->cy, g->cr); - _setup_gradient(grad, g, m); - tvg_shape_set_radial_gradient(obj, grad); - } - else { - grad = tvg_linear_gradient_new(); - tvg_linear_gradient_set(grad, g->x1, g->y1, g->x2, g->y2); - _setup_gradient(grad, g, m); - tvg_shape_set_linear_gradient(obj, grad); - } -} - -static void _set_paint_fill_pattern(Tvg_Paint * obj, Tvg_Canvas * canvas, const lv_draw_image_dsc_t * p, - const lv_matrix_t * m) -{ - lv_image_decoder_dsc_t decoder_dsc; - lv_image_decoder_args_t args = { 0 }; - args.premultiply = 1; - lv_result_t res = lv_image_decoder_open(&decoder_dsc, p->src, &args); - if(res != LV_RESULT_OK) { - LV_LOG_ERROR("Failed to open image"); - return; - } - - if(!decoder_dsc.decoded) { - lv_image_decoder_close(&decoder_dsc); - LV_LOG_ERROR("Image not ready"); - return; - } - - const uint8_t * src_buf = decoder_dsc.decoded->data; - const lv_image_header_t * header = &decoder_dsc.decoded->header; - lv_color_format_t cf = header->cf; - - if(cf != LV_COLOR_FORMAT_ARGB8888) { - lv_image_decoder_close(&decoder_dsc); - LV_LOG_ERROR("Not support image format"); - return; - } - - Tvg_Paint * img = tvg_picture_new(); - tvg_picture_load_raw(img, (uint32_t *)src_buf, header->w, header->h, true); - Tvg_Paint * clip_path = tvg_paint_duplicate(obj); - tvg_paint_set_composite_method(img, clip_path, TVG_COMPOSITE_METHOD_CLIP_PATH); - tvg_paint_set_opacity(img, p->opa); - - Tvg_Matrix mtx; - lv_matrix_to_tvg(&mtx, m); - tvg_paint_set_transform(img, &mtx); - tvg_canvas_push(canvas, img); - lv_image_decoder_close(&decoder_dsc); -} - -static void _set_paint_fill(Tvg_Paint * obj, Tvg_Canvas * canvas, const lv_vector_fill_dsc_t * dsc, - const lv_matrix_t * matrix) -{ - tvg_shape_set_fill_rule(obj, lv_fill_rule_to_tvg(dsc->fill_rule)); - - if(dsc->style == LV_VECTOR_DRAW_STYLE_SOLID) { - _tvg_color c; - lv_color_to_tvg(&c, &dsc->color, dsc->opa); - tvg_shape_set_fill_color(obj, c.r, c.g, c.b, c.a); - } - else if(dsc->style == LV_VECTOR_DRAW_STYLE_PATTERN) { - float x, y, w, h; - tvg_paint_get_bounds(obj, &x, &y, &w, &h, false); - - lv_matrix_t imx; - lv_memcpy(&imx, matrix, sizeof(lv_matrix_t)); - lv_matrix_translate(&imx, x, y); - lv_matrix_multiply(&imx, &dsc->matrix); - _set_paint_fill_pattern(obj, canvas, &dsc->img_dsc, &imx); - } - else if(dsc->style == LV_VECTOR_DRAW_STYLE_GRADIENT) { - _set_paint_fill_gradient(obj, &dsc->gradient, &dsc->matrix); - } -} - -static Tvg_Blend_Method lv_blend_to_tvg(lv_vector_blend_t blend) -{ - switch(blend) { - case LV_VECTOR_BLEND_SRC_OVER: - return TVG_BLEND_METHOD_NORMAL; - case LV_VECTOR_BLEND_SCREEN: - return TVG_BLEND_METHOD_SCREEN; - case LV_VECTOR_BLEND_MULTIPLY: - return TVG_BLEND_METHOD_MULTIPLY; - case LV_VECTOR_BLEND_NONE: - return TVG_BLEND_METHOD_SRCOVER; - case LV_VECTOR_BLEND_ADDITIVE: - return TVG_BLEND_METHOD_ADD; - case LV_VECTOR_BLEND_SRC_IN: - case LV_VECTOR_BLEND_DST_OVER: - case LV_VECTOR_BLEND_DST_IN: - case LV_VECTOR_BLEND_SUBTRACTIVE: - /*not support yet.*/ - default: - return TVG_BLEND_METHOD_NORMAL; - } -} - -static void _set_paint_blend_mode(Tvg_Paint * obj, lv_vector_blend_t blend) -{ - tvg_paint_set_blend_method(obj, lv_blend_to_tvg(blend)); -} - -static void _task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vector_draw_dsc_t * dsc) -{ - Tvg_Canvas * canvas = (Tvg_Canvas *)ctx; - - Tvg_Paint * obj = tvg_shape_new(); - - if(!path) { /*clear*/ - _tvg_rect rc; - lv_area_to_tvg(&rc, &dsc->scissor_area); - - _tvg_color c; - lv_color_to_tvg(&c, &dsc->fill_dsc.color, dsc->fill_dsc.opa); - - Tvg_Matrix mtx = { - 1.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 1.0f, - }; - _set_paint_matrix(obj, &mtx); - tvg_shape_append_rect(obj, rc.x, rc.y, rc.w, rc.h, 0, 0); - tvg_shape_set_fill_color(obj, c.r, c.g, c.b, c.a); - } - else { - Tvg_Matrix mtx; - lv_matrix_to_tvg(&mtx, &dsc->matrix); - _set_paint_matrix(obj, &mtx); - - _set_paint_shape(obj, path); - - _set_paint_fill(obj, canvas, &dsc->fill_dsc, &dsc->matrix); - _set_paint_stroke(obj, &dsc->stroke_dsc); - _set_paint_blend_mode(obj, dsc->blend_mode); - } - - tvg_canvas_push(canvas, obj); -} - -/********************** - * GLOBAL FUNCTIONS - **********************/ -void lv_draw_sw_vector(lv_draw_unit_t * draw_unit, const lv_draw_vector_task_dsc_t * dsc) -{ - LV_UNUSED(draw_unit); - - if(dsc->task_list == NULL) - return; - - lv_layer_t * layer = dsc->base.layer; - lv_draw_buf_t * draw_buf = layer->draw_buf; - if(draw_buf == NULL) - return; - - lv_color_format_t cf = draw_buf->header.cf; - - if(cf != LV_COLOR_FORMAT_ARGB8888 && \ - cf != LV_COLOR_FORMAT_XRGB8888) { - LV_LOG_ERROR("unsupported layer color: %d", cf); - return; - } - - void * buf = draw_buf->data; - int32_t width = lv_area_get_width(&layer->buf_area) - 1; - int32_t height = lv_area_get_height(&layer->buf_area) - 1; - uint32_t stride = draw_buf->header.stride; - Tvg_Canvas * canvas = tvg_swcanvas_create(); - tvg_swcanvas_set_target(canvas, buf, stride / 4, width, height, TVG_COLORSPACE_ARGB8888); - - _tvg_rect rc; - lv_area_to_tvg(&rc, draw_unit->clip_area); - tvg_canvas_set_viewport(canvas, (int32_t)rc.x, (int32_t)rc.y, (int32_t)rc.w, (int32_t)rc.h); - - lv_ll_t * task_list = dsc->task_list; - lv_vector_for_each_destroy_tasks(task_list, _task_draw_cb, canvas); - - if(tvg_canvas_draw(canvas) == TVG_RESULT_SUCCESS) { - tvg_canvas_sync(canvas); - } - - tvg_canvas_destroy(canvas); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_SW*/ diff --git a/L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_draw_swm341_dma2d.mk b/L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_draw_swm341_dma2d.mk new file mode 100644 index 0000000..bc19e38 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_draw_swm341_dma2d.mk @@ -0,0 +1,6 @@ +CSRCS += lv_gpu_swm341_dma2d.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/swm341_dma2d +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/swm341_dma2d + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/swm341_dma2d" diff --git a/L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_gpu_swm341_dma2d.c b/L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_gpu_swm341_dma2d.c new file mode 100644 index 0000000..74a5394 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_gpu_swm341_dma2d.c @@ -0,0 +1,241 @@ +/** + * @file lv_gpu_swm341_dma2d.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_gpu_swm341_dma2d.h" +#include "../../core/lv_refr.h" + +#if LV_USE_GPU_SWM341_DMA2D + +#include LV_GPU_SWM341_DMA2D_INCLUDE + +/********************* + * DEFINES + *********************/ + +#if LV_COLOR_16_SWAP + #error "Can't use DMA2D with LV_COLOR_16_SWAP 1" +#endif + +#if LV_COLOR_DEPTH == 8 + #error "Can't use DMA2D with LV_COLOR_DEPTH == 8" +#endif + +#if LV_COLOR_DEPTH == 16 + #define LV_DMA2D_COLOR_FORMAT LV_SWM341_DMA2D_RGB565 +#elif LV_COLOR_DEPTH == 32 + #define LV_DMA2D_COLOR_FORMAT LV_SWM341_DMA2D_ARGB8888 +#else + /*Can't use GPU with other formats*/ +#endif + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +static void lv_draw_swm341_dma2d_blend_fill(lv_color_t * dest_buf, lv_coord_t dest_stride, const lv_area_t * fill_area, + lv_color_t color); + +static void lv_draw_swm341_dma2d_blend_map(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa); + +static void lv_draw_swm341_dma2d_img_decoded(lv_draw_ctx_t * draw, const lv_draw_img_dsc_t * dsc, + const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t color_format); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Turn on the peripheral and set output color mode, this only needs to be done once + */ +void lv_draw_swm341_dma2d_init(void) +{ + /*Enable DMA2D clock*/ + SYS->CLKEN0 |= (1 << SYS_CLKEN0_DMA2D_Pos); + + DMA2D->CR &= ~DMA2D_CR_WAIT_Msk; + DMA2D->CR |= (CyclesPerUs << DMA2D_CR_WAIT_Pos); + + DMA2D->IF = 0xFF; + DMA2D->IE = (0 << DMA2D_IE_DONE_Pos); + + /*set output colour mode*/ + DMA2D->L[DMA2D_LAYER_OUT].PFCCR = (LV_DMA2D_COLOR_FORMAT << DMA2D_PFCCR_CFMT_Pos); +} + +void lv_draw_swm341_dma2d_ctx_init(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) +{ + + lv_draw_sw_init_ctx(drv, draw_ctx); + + lv_draw_swm341_dma2d_ctx_t * dma2d_draw_ctx = (lv_draw_sw_ctx_t *)draw_ctx; + + dma2d_draw_ctx->blend = lv_draw_swm341_dma2d_blend; + // dma2d_draw_ctx->base_draw.draw_img_decoded = lv_draw_swm341_dma2d_img_decoded; + dma2d_draw_ctx->base_draw.wait_for_finish = lv_gpu_swm341_dma2d_wait_cb; +} + +void lv_draw_swm341_dma2d_ctx_deinit(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx) +{ + LV_UNUSED(drv); + LV_UNUSED(draw_ctx); +} + +void lv_draw_swm341_dma2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc) +{ + lv_area_t blend_area; + if(!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area)) + return; + + bool done = false; + + if(dsc->mask_buf == NULL && dsc->blend_mode == LV_BLEND_MODE_NORMAL && lv_area_get_size(&blend_area) > 100) { + lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); + + lv_color_t * dest_buf = draw_ctx->buf; + dest_buf += dest_stride * (blend_area.y1 - draw_ctx->buf_area->y1) + (blend_area.x1 - draw_ctx->buf_area->x1); + + const lv_color_t * src_buf = dsc->src_buf; + if(src_buf) { + lv_draw_sw_blend_basic(draw_ctx, dsc); + lv_coord_t src_stride; + src_stride = lv_area_get_width(dsc->blend_area); + src_buf += src_stride * (blend_area.y1 - dsc->blend_area->y1) + (blend_area.x1 - dsc->blend_area->x1); + lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + lv_draw_swm341_dma2d_blend_map(dest_buf, &blend_area, dest_stride, src_buf, src_stride, dsc->opa); + done = true; + } + else if(dsc->opa >= LV_OPA_MAX) { + lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); + lv_draw_swm341_dma2d_blend_fill(dest_buf, dest_stride, &blend_area, dsc->color); + done = true; + } + } + + if(!done) lv_draw_sw_blend_basic(draw_ctx, dsc); +} + +static void lv_draw_swm341_dma2d_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, + const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t color_format) +{ + /*TODO basic ARGB8888 image can be handles here*/ + + lv_draw_sw_img_decoded(draw_ctx, dsc, coords, map_p, color_format); +} + +static void lv_draw_swm341_dma2d_blend_fill(lv_color_t * dest_buf, lv_coord_t dest_stride, const lv_area_t * fill_area, + lv_color_t color) +{ + /*Simply fill an area*/ + int32_t area_w = lv_area_get_width(fill_area); + int32_t area_h = lv_area_get_height(fill_area); + +#if 1 + DMA2D->L[DMA2D_LAYER_OUT].COLOR = color.full; + + DMA2D->L[DMA2D_LAYER_OUT].MAR = (uint32_t)dest_buf; + DMA2D->L[DMA2D_LAYER_OUT].OR = dest_stride - area_w; + DMA2D->NLR = ((area_w - 1) << DMA2D_NLR_NPIXEL_Pos) | ((area_h - 1) << DMA2D_NLR_NLINE_Pos); + + /*start transfer*/ + DMA2D->CR &= ~DMA2D_CR_MODE_Msk; + DMA2D->CR |= (3 << DMA2D_CR_MODE_Pos) | + (1 << DMA2D_CR_START_Pos); +#else + for(uint32_t y = 0; y < area_h; y++) { + for(uint32_t x = 0; x < area_w; x++) { + dest_buf[y * dest_stride + x] = color; + } + } +#endif +} + +static void lv_draw_swm341_dma2d_blend_map(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride, + const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa) +{ + + /*Simple copy*/ + int32_t dest_w = lv_area_get_width(dest_area); + int32_t dest_h = lv_area_get_height(dest_area); + + if(opa >= LV_OPA_MAX) { +#if 1 + /*copy output colour mode, this register controls both input and output colour format*/ + DMA2D->L[DMA2D_LAYER_FG].MAR = (uint32_t)src_buf; + DMA2D->L[DMA2D_LAYER_FG].OR = src_stride - dest_w; + DMA2D->L[DMA2D_LAYER_FG].PFCCR = (LV_DMA2D_COLOR_FORMAT << DMA2D_PFCCR_CFMT_Pos); + + DMA2D->L[DMA2D_LAYER_OUT].MAR = (uint32_t)dest_buf; + DMA2D->L[DMA2D_LAYER_OUT].OR = dest_stride - dest_w; + + DMA2D->NLR = ((dest_w - 1) << DMA2D_NLR_NPIXEL_Pos) | ((dest_h - 1) << DMA2D_NLR_NLINE_Pos); + + /*start transfer*/ + DMA2D->CR &= ~DMA2D_CR_MODE_Msk; + DMA2D->CR |= (0 << DMA2D_CR_MODE_Pos) | + (1 << DMA2D_CR_START_Pos); +#else + lv_color_t temp_buf[1024]; + for(uint32_t y = 0; y < dest_h; y++) { + memcpy(temp_buf, &src_buf[y * src_stride], dest_w * sizeof(lv_color_t)); + memcpy(&dest_buf[y * dest_stride], temp_buf, dest_w * sizeof(lv_color_t)); + } +#endif + } + else { + DMA2D->L[DMA2D_LAYER_FG].MAR = (uint32_t)src_buf; + DMA2D->L[DMA2D_LAYER_FG].OR = src_stride - dest_w; + DMA2D->L[DMA2D_LAYER_FG].PFCCR = (LV_DMA2D_COLOR_FORMAT << DMA2D_PFCCR_CFMT_Pos) + /*alpha mode 2, replace with foreground * alpha value*/ + | (2 << DAM2D_PFCCR_AMODE_Pos) + /*alpha value*/ + | (opa << DMA2D_PFCCR_ALPHA_Pos); + + DMA2D->L[DMA2D_LAYER_BG].MAR = (uint32_t)dest_buf; + DMA2D->L[DMA2D_LAYER_BG].OR = dest_stride - dest_w; + DMA2D->L[DMA2D_LAYER_BG].PFCCR = (LV_DMA2D_COLOR_FORMAT << DMA2D_PFCCR_CFMT_Pos); + + DMA2D->L[DMA2D_LAYER_OUT].MAR = (uint32_t)dest_buf; + DMA2D->L[DMA2D_LAYER_OUT].OR = dest_stride - dest_w; + + DMA2D->NLR = ((dest_w - 1) << DMA2D_NLR_NPIXEL_Pos) | ((dest_h - 1) << DMA2D_NLR_NLINE_Pos); + + /*start transfer*/ + DMA2D->CR &= ~DMA2D_CR_MODE_Msk; + DMA2D->CR |= (2 << DMA2D_CR_MODE_Pos) | + (1 << DMA2D_CR_START_Pos); + } +} + +void lv_gpu_swm341_dma2d_wait_cb(lv_draw_ctx_t * draw_ctx) +{ + lv_disp_t * disp = _lv_refr_get_disp_refreshing(); + if(disp->driver && disp->driver->wait_cb) { + while(DMA2D->CR & DMA2D_CR_START_Msk) { + disp->driver->wait_cb(disp->driver); + } + } + else { + while(DMA2D->CR & DMA2D_CR_START_Msk); + } + lv_draw_sw_wait_for_finish(draw_ctx); +} + +#endif diff --git a/L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_gpu_swm341_dma2d.h b/L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_gpu_swm341_dma2d.h new file mode 100644 index 0000000..20b8922 --- /dev/null +++ b/L3_Middlewares/LVGL/src/draw/swm341_dma2d/lv_gpu_swm341_dma2d.h @@ -0,0 +1,64 @@ +/** + * @file lv_gpu_swm341_dma2d.h + * + */ + +#ifndef LV_GPU_SWM341_DMA2D_H +#define LV_GPU_SWM341_DMA2D_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../misc/lv_color.h" +#include "../../hal/lv_hal_disp.h" +#include "../sw/lv_draw_sw.h" + +#if LV_USE_GPU_SWM341_DMA2D + +/********************* + * DEFINES + *********************/ + +#define LV_SWM341_DMA2D_ARGB8888 0 +#define LV_SWM341_DMA2D_RGB888 1 +#define LV_SWM341_DMA2D_RGB565 2 + +/********************** + * TYPEDEFS + **********************/ +typedef lv_draw_sw_ctx_t lv_draw_swm341_dma2d_ctx_t; + +struct _lv_disp_drv_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Turn on the peripheral and set output color mode, this only needs to be done once + */ +void lv_draw_swm341_dma2d_init(void); + +void lv_draw_swm341_dma2d_ctx_init(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); + +void lv_draw_swm341_dma2d_ctx_deinit(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); + +void lv_draw_swm341_dma2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc); + +void lv_gpu_swm341_dma2d_wait_cb(lv_draw_ctx_t * draw_ctx); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_GPU_SWM341_DMA2D*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_GPU_SWM341_DMA2D_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_buf_vg_lite.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_buf_vg_lite.c deleted file mode 100644 index de0b4b9..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_buf_vg_lite.c +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @file lv_draw_buf_vg_lite.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE - -#include "../lv_draw_buf_private.h" -#include "lv_vg_lite_utils.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static uint32_t width_to_stride(uint32_t w, lv_color_format_t color_format); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_buf_vg_lite_init_handlers(void) -{ - lv_draw_buf_handlers_t * handlers = lv_draw_buf_get_handlers(); - handlers->width_to_stride_cb = width_to_stride; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static uint32_t width_to_stride(uint32_t w, lv_color_format_t color_format) -{ - return lv_vg_lite_width_to_stride(w, lv_vg_lite_vg_fmt(color_format)); -} - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite.c deleted file mode 100644 index 1a991ce..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite.c +++ /dev/null @@ -1,281 +0,0 @@ -/** - * @file lv_vg_lite_draw.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE - -#include "../lv_draw_private.h" -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_path.h" -#include "lv_vg_lite_utils.h" -#include "lv_vg_lite_decoder.h" -#include "lv_vg_lite_grad.h" -#include "lv_vg_lite_pending.h" -#include "lv_vg_lite_stroke.h" - -/********************* - * DEFINES - *********************/ - -#define VG_LITE_DRAW_UNIT_ID 2 - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static int32_t draw_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer); - -static int32_t draw_evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task); - -static int32_t draw_delete(lv_draw_unit_t * draw_unit); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_init(void) -{ -#if LV_VG_LITE_USE_GPU_INIT - extern void gpu_init(void); - static bool inited = false; - if(!inited) { - gpu_init(); - inited = true; - } -#endif - - lv_vg_lite_dump_info(); - - lv_draw_buf_vg_lite_init_handlers(); - - lv_draw_vg_lite_unit_t * unit = lv_draw_create_unit(sizeof(lv_draw_vg_lite_unit_t)); - unit->base_unit.dispatch_cb = draw_dispatch; - unit->base_unit.evaluate_cb = draw_evaluate; - unit->base_unit.delete_cb = draw_delete; - - lv_vg_lite_image_dsc_init(unit); -#if LV_USE_VECTOR_GRAPHIC - lv_vg_lite_grad_init(unit, LV_VG_LITE_GRAD_CACHE_CNT); - lv_vg_lite_stroke_init(unit, LV_VG_LITE_STROKE_CACHE_CNT); -#endif - lv_vg_lite_path_init(unit); - lv_vg_lite_decoder_init(); -} - -void lv_draw_vg_lite_deinit(void) -{ -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static bool check_image_is_supported(const lv_draw_image_dsc_t * dsc) -{ - lv_image_header_t header; - lv_result_t res = lv_image_decoder_get_info(dsc->src, &header); - if(res != LV_RESULT_OK) { - LV_LOG_TRACE("get image info failed"); - return false; - } - - return lv_vg_lite_is_src_cf_supported(header.cf); -} - -static void draw_execute(lv_draw_vg_lite_unit_t * u) -{ - lv_draw_task_t * t = u->task_act; - lv_draw_unit_t * draw_unit = (lv_draw_unit_t *)u; - - lv_layer_t * layer = u->base_unit.target_layer; - - lv_vg_lite_buffer_from_draw_buf(&u->target_buffer, layer->draw_buf); - - /* VG-Lite will output premultiplied image, set the flag correspondingly. */ - lv_draw_buf_set_flag(layer->draw_buf, LV_IMAGE_FLAGS_PREMULTIPLIED); - - vg_lite_identity(&u->global_matrix); - if(layer->buf_area.x1 || layer->buf_area.y1) { - vg_lite_translate(-layer->buf_area.x1, -layer->buf_area.y1, &u->global_matrix); - } - -#if LV_DRAW_TRANSFORM_USE_MATRIX - vg_lite_matrix_t layer_matrix; - lv_vg_lite_matrix(&layer_matrix, &t->matrix); - lv_vg_lite_matrix_multiply(&u->global_matrix, &layer_matrix); - - /* Crop out extra pixels drawn due to scaling accuracy issues */ - if(vg_lite_query_feature(gcFEATURE_BIT_VG_SCISSOR)) { - lv_area_t scissor_area = layer->phy_clip_area; - lv_area_move(&scissor_area, -layer->buf_area.x1, -layer->buf_area.y1); - lv_vg_lite_set_scissor_area(&scissor_area); - } -#endif - - switch(t->type) { - case LV_DRAW_TASK_TYPE_LABEL: - lv_draw_vg_lite_label(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_FILL: - lv_draw_vg_lite_fill(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_BORDER: - lv_draw_vg_lite_border(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_BOX_SHADOW: - lv_draw_vg_lite_box_shadow(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_IMAGE: - lv_draw_vg_lite_img(draw_unit, t->draw_dsc, &t->area, false); - break; - case LV_DRAW_TASK_TYPE_ARC: - lv_draw_vg_lite_arc(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_LINE: - lv_draw_vg_lite_line(draw_unit, t->draw_dsc); - break; - case LV_DRAW_TASK_TYPE_LAYER: - lv_draw_vg_lite_layer(draw_unit, t->draw_dsc, &t->area); - break; - case LV_DRAW_TASK_TYPE_TRIANGLE: - lv_draw_vg_lite_triangle(draw_unit, t->draw_dsc); - break; - case LV_DRAW_TASK_TYPE_MASK_RECTANGLE: - lv_draw_vg_lite_mask_rect(draw_unit, t->draw_dsc, &t->area); - break; -#if LV_USE_VECTOR_GRAPHIC - case LV_DRAW_TASK_TYPE_VECTOR: - lv_draw_vg_lite_vector(draw_unit, t->draw_dsc); - break; -#endif - default: - break; - } - - lv_vg_lite_flush(u); -} - -static int32_t draw_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer) -{ - lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit; - - /* Return immediately if it's busy with draw task. */ - if(u->task_act) { - return 0; - } - - /* Try to get an ready to draw. */ - lv_draw_task_t * t = lv_draw_get_next_available_task(layer, NULL, VG_LITE_DRAW_UNIT_ID); - - /* Return 0 is no selection, some tasks can be supported by other units. */ - if(!t || t->preferred_draw_unit_id != VG_LITE_DRAW_UNIT_ID) { - lv_vg_lite_finish(u); - return LV_DRAW_UNIT_IDLE; - } - - /* Return if target buffer format is not supported. */ - if(!lv_vg_lite_is_dest_cf_supported(layer->color_format)) { - return LV_DRAW_UNIT_IDLE; - } - - void * buf = lv_draw_layer_alloc_buf(layer); - if(!buf) { - return LV_DRAW_UNIT_IDLE; - } - - t->state = LV_DRAW_TASK_STATE_IN_PROGRESS; - u->base_unit.target_layer = layer; - u->base_unit.clip_area = &t->clip_area; - u->task_act = t; - - draw_execute(u); - - u->task_act->state = LV_DRAW_TASK_STATE_READY; - u->task_act = NULL; - - /*The draw unit is free now. Request a new dispatching as it can get a new task*/ - lv_draw_dispatch_request(); - - return 1; -} - -static int32_t draw_evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task) -{ - LV_UNUSED(draw_unit); - - /* Return if target buffer format is not supported. */ - const lv_draw_dsc_base_t * base_dsc = task->draw_dsc; - if(!lv_vg_lite_is_dest_cf_supported(base_dsc->layer->color_format)) { - return -1; - } - - switch(task->type) { - case LV_DRAW_TASK_TYPE_LABEL: - case LV_DRAW_TASK_TYPE_FILL: - case LV_DRAW_TASK_TYPE_BORDER: -#if LV_VG_LITE_USE_BOX_SHADOW - case LV_DRAW_TASK_TYPE_BOX_SHADOW: -#endif - case LV_DRAW_TASK_TYPE_LAYER: - case LV_DRAW_TASK_TYPE_LINE: - case LV_DRAW_TASK_TYPE_ARC: - case LV_DRAW_TASK_TYPE_TRIANGLE: - case LV_DRAW_TASK_TYPE_MASK_RECTANGLE: - -#if LV_USE_VECTOR_GRAPHIC - case LV_DRAW_TASK_TYPE_VECTOR: -#endif - break; - - case LV_DRAW_TASK_TYPE_IMAGE: { - if(!check_image_is_supported(task->draw_dsc)) { - return 0; - } - } - break; - - default: - /*The draw unit is not able to draw this task. */ - return 0; - } - - /* The draw unit is able to draw this task. */ - task->preference_score = 80; - task->preferred_draw_unit_id = VG_LITE_DRAW_UNIT_ID; - return 1; -} - -static int32_t draw_delete(lv_draw_unit_t * draw_unit) -{ - lv_draw_vg_lite_unit_t * unit = (lv_draw_vg_lite_unit_t *)draw_unit; - - lv_vg_lite_image_dsc_deinit(unit); -#if LV_USE_VECTOR_GRAPHIC - lv_vg_lite_grad_deinit(unit); - lv_vg_lite_stroke_deinit(unit); -#endif - lv_vg_lite_path_deinit(unit); - lv_vg_lite_decoder_deinit(); - return 1; -} - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite.h b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite.h deleted file mode 100644 index 63ff7f5..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @file lv_draw_vg_lite.h - * - */ - -#ifndef LV_DRAW_VG_LITE_H -#define LV_DRAW_VG_LITE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" - -#if LV_USE_DRAW_VG_LITE - -#include "../lv_draw.h" -#include "../../draw/lv_draw_vector.h" -#include "../../draw/lv_draw_arc.h" -#include "../../draw/lv_draw_rect.h" -#include "../../draw/lv_draw_image.h" -#include "../../draw/lv_draw_label.h" -#include "../../draw/lv_draw_line.h" -#include "../../draw/lv_draw_triangle.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_draw_buf_vg_lite_init_handlers(void); - -void lv_draw_vg_lite_init(void); - -void lv_draw_vg_lite_deinit(void); - -void lv_draw_vg_lite_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_vg_lite_box_shadow(lv_draw_unit_t * draw_unit, const lv_draw_box_shadow_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_vg_lite_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_vg_lite_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_vg_lite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dsc, - const lv_area_t * coords, bool no_cache); - -void lv_draw_vg_lite_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc, - const lv_area_t * coords); - -void lv_draw_vg_lite_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords); - -void lv_draw_vg_lite_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc); - -void lv_draw_vg_lite_triangle(lv_draw_unit_t * draw_unit, const lv_draw_triangle_dsc_t * dsc); - -void lv_draw_vg_lite_mask_rect(lv_draw_unit_t * draw_unit, const lv_draw_mask_rect_dsc_t * dsc, - const lv_area_t * coords); - -#if LV_USE_VECTOR_GRAPHIC -void lv_draw_vg_lite_vector(lv_draw_unit_t * draw_unit, const lv_draw_vector_task_dsc_t * dsc); -#endif - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_VG_LITE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_arc.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_arc.c deleted file mode 100644 index be995ce..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_arc.c +++ /dev/null @@ -1,209 +0,0 @@ -/** - * @file lv_draw_vg_lite_arc.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../misc/lv_area_private.h" -#include "../lv_image_decoder_private.h" -#include "../lv_draw_private.h" -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_math.h" -#include "lv_vg_lite_path.h" -#include "lv_vg_lite_pending.h" -#include "lv_vg_lite_utils.h" -#include - -/********************* - * DEFINES - *********************/ - -#define PI 3.1415926535897932384626433832795f -#define TWO_PI 6.283185307179586476925286766559f -#define DEG_TO_RAD 0.017453292519943295769236907684886f -#define RAD_TO_DEG 57.295779513082320876798154814105f -#define radians(deg) ((deg) * DEG_TO_RAD) -#define degrees(rad) ((rad) * RAD_TO_DEG) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, - const lv_area_t * coords) -{ - lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit; - - lv_area_t clip_area; - if(!lv_area_intersect(&clip_area, coords, draw_unit->clip_area)) { - /*Fully clipped, nothing to do*/ - return; - } - - float start_angle = dsc->start_angle; - float end_angle = dsc->end_angle; - float sweep_angle = end_angle - start_angle; - - while(sweep_angle < 0) { - sweep_angle += 360; - } - - while(sweep_angle > 360) { - sweep_angle -= 360; - } - - /*If the angles are the same then there is nothing to draw*/ - if(math_zero(sweep_angle)) { - return; - } - - LV_PROFILER_BEGIN; - - lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_FP32); - lv_vg_lite_path_set_quality(path, VG_LITE_HIGH); - lv_vg_lite_path_set_bonding_box_area(path, &clip_area); - - float radius_out = dsc->radius; - float radius_in = dsc->radius - dsc->width; - float half_width = dsc->width * 0.5f; - float radius_center = radius_out - half_width; - float cx = dsc->center.x; - float cy = dsc->center.y; - - vg_lite_fill_t fill = VG_LITE_FILL_NON_ZERO; - - if(math_equal(sweep_angle, 360)) { - lv_vg_lite_path_append_circle(path, cx, cy, radius_out, radius_out); - lv_vg_lite_path_append_circle(path, cx, cy, radius_in, radius_in); - fill = VG_LITE_FILL_EVEN_ODD; - } - else { - /* radius_out start point */ - float start_angle_rad = MATH_RADIANS(start_angle); - float start_x = radius_out * MATH_COSF(start_angle_rad) + cx; - float start_y = radius_out * MATH_SINF(start_angle_rad) + cy; - - /* radius_in start point */ - float end_angle_rad = MATH_RADIANS(end_angle); - float end_x = radius_in * MATH_COSF(end_angle_rad) + cx; - float end_y = radius_in * MATH_SINF(end_angle_rad) + cy; - - lv_vg_lite_path_move_to(path, start_x, start_y); - - /* radius_out arc */ - lv_vg_lite_path_append_arc(path, - cx, cy, - radius_out, - start_angle, - sweep_angle, - false); - - /* line to radius_in */ - lv_vg_lite_path_line_to(path, end_x, end_y); - - /* radius_in arc */ - lv_vg_lite_path_append_arc(path, - cx, cy, - radius_in, - end_angle, - -sweep_angle, - false); - - /* close arc */ - lv_vg_lite_path_close(path); - - /* draw round */ - if(dsc->rounded && half_width > 0) { - float rcx1 = cx + radius_center * MATH_COSF(end_angle_rad); - float rcy1 = cy + radius_center * MATH_SINF(end_angle_rad); - lv_vg_lite_path_append_circle(path, rcx1, rcy1, half_width, half_width); - - float rcx2 = cx + radius_center * MATH_COSF(start_angle_rad); - float rcy2 = cy + radius_center * MATH_SINF(start_angle_rad); - lv_vg_lite_path_append_circle(path, rcx2, rcy2, half_width, half_width); - } - } - - lv_vg_lite_path_end(path); - - vg_lite_matrix_t matrix = u->global_matrix; - - vg_lite_color_t color = lv_vg_lite_color(dsc->color, dsc->opa, true); - - vg_lite_path_t * vg_lite_path = lv_vg_lite_path_get_path(path); - - LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer); - LV_VG_LITE_ASSERT_PATH(vg_lite_path); - LV_VG_LITE_ASSERT_MATRIX(&matrix); - - LV_PROFILER_BEGIN_TAG("vg_lite_draw"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw( - &u->target_buffer, - vg_lite_path, - fill, - &matrix, - VG_LITE_BLEND_SRC_OVER, - color)); - LV_PROFILER_END_TAG("vg_lite_draw"); - - if(dsc->img_src) { - vg_lite_buffer_t src_buf; - lv_image_decoder_dsc_t decoder_dsc; - if(lv_vg_lite_buffer_open_image(&src_buf, &decoder_dsc, dsc->img_src, false, true)) { - vg_lite_matrix_t path_matrix = u->global_matrix; - - /* move image to center */ - vg_lite_translate(cx - radius_out, cy - radius_out, &matrix); - - LV_VG_LITE_ASSERT_MATRIX(&path_matrix); - - LV_PROFILER_BEGIN_TAG("vg_lite_draw_pattern"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern( - &u->target_buffer, - vg_lite_path, - fill, - &path_matrix, - &src_buf, - &matrix, - VG_LITE_BLEND_SRC_OVER, - VG_LITE_PATTERN_COLOR, - 0, - color, - VG_LITE_FILTER_BI_LINEAR)); - LV_PROFILER_END_TAG("vg_lite_draw_pattern"); - lv_vg_lite_pending_add(u->image_dsc_pending, &decoder_dsc); - } - } - - lv_vg_lite_path_drop(u, path); - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_border.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_border.c deleted file mode 100644 index 5860baa..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_border.c +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @file lv_draw_vg_lite_border.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../misc/lv_area_private.h" -#include "../lv_draw_private.h" -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_utils.h" -#include "lv_vg_lite_path.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc_t * dsc, - const lv_area_t * coords) -{ - lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit; - - lv_area_t clip_area; - if(!lv_area_intersect(&clip_area, coords, draw_unit->clip_area)) { - /*Fully clipped, nothing to do*/ - return; - } - - LV_PROFILER_BEGIN; - - int32_t w = lv_area_get_width(coords); - int32_t h = lv_area_get_height(coords); - float r_out = dsc->radius; - if(dsc->radius) { - float r_short = LV_MIN(w, h) / 2.0f; - r_out = LV_MIN(r_out, r_short); - } - - int32_t border_w = dsc->width; - float r_in = LV_MAX(0, r_out - border_w); - - lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_FP32); - lv_vg_lite_path_set_quality(path, dsc->radius == 0 ? VG_LITE_LOW : VG_LITE_HIGH); - lv_vg_lite_path_set_bonding_box_area(path, &clip_area); - - /* outer rect */ - lv_vg_lite_path_append_rect(path, - coords->x1, coords->y1, - w, h, - r_out); - - /* inner rect */ - lv_vg_lite_path_append_rect(path, - coords->x1 + border_w, coords->y1 + border_w, - w - border_w * 2, h - border_w * 2, - r_in); - - lv_vg_lite_path_end(path); - - vg_lite_matrix_t matrix = u->global_matrix; - - vg_lite_color_t color = lv_vg_lite_color(dsc->color, dsc->opa, true); - - vg_lite_path_t * vg_lite_path = lv_vg_lite_path_get_path(path); - - LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer); - LV_VG_LITE_ASSERT_PATH(vg_lite_path); - LV_VG_LITE_ASSERT_MATRIX(&matrix); - - LV_PROFILER_BEGIN_TAG("vg_lite_draw"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw( - &u->target_buffer, - vg_lite_path, - VG_LITE_FILL_EVEN_ODD, - &matrix, - VG_LITE_BLEND_SRC_OVER, - color)); - LV_PROFILER_END_TAG("vg_lite_draw"); - - lv_vg_lite_path_drop(u, path); - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_box_shadow.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_box_shadow.c deleted file mode 100644 index cad9500..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_box_shadow.c +++ /dev/null @@ -1,98 +0,0 @@ -/** - * @file lv_draw_vg_lite_box_shadow.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../misc/lv_area_private.h" -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_draw_vg_lite_type.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_box_shadow(lv_draw_unit_t * draw_unit, const lv_draw_box_shadow_dsc_t * dsc, - const lv_area_t * coords) -{ - /*Calculate the rectangle which is blurred to get the shadow in `shadow_area`*/ - lv_area_t core_area; - core_area.x1 = coords->x1 + dsc->ofs_x - dsc->spread; - core_area.x2 = coords->x2 + dsc->ofs_x + dsc->spread; - core_area.y1 = coords->y1 + dsc->ofs_y - dsc->spread; - core_area.y2 = coords->y2 + dsc->ofs_y + dsc->spread; - - /*Calculate the bounding box of the shadow*/ - lv_area_t shadow_area; - shadow_area.x1 = core_area.x1 - dsc->width / 2 - 1; - shadow_area.x2 = core_area.x2 + dsc->width / 2 + 1; - shadow_area.y1 = core_area.y1 - dsc->width / 2 - 1; - shadow_area.y2 = core_area.y2 + dsc->width / 2 + 1; - - /*Get clipped draw area which is the real draw area. - *It is always the same or inside `shadow_area`*/ - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, &shadow_area, draw_unit->clip_area)) return; - - LV_PROFILER_BEGIN; - - lv_draw_border_dsc_t border_dsc; - lv_draw_border_dsc_init(&border_dsc); - border_dsc.width = 3; - border_dsc.color = dsc->color; - border_dsc.radius = dsc->radius; - - lv_area_move(&draw_area, dsc->ofs_x, dsc->ofs_y); - draw_area = core_area; - int32_t half_w = dsc->width / 2; - - for(int32_t w = 0; w < half_w; w++) { - border_dsc.opa = lv_map(w, 0, half_w, dsc->opa / 4, LV_OPA_0); - border_dsc.radius++; - lv_area_increase(&draw_area, 1, 1); - lv_draw_vg_lite_border(draw_unit, &border_dsc, &draw_area); - - /* fill center */ - if(dsc->ofs_x || dsc->ofs_y) { - lv_draw_fill_dsc_t fill_dsc; - lv_draw_fill_dsc_init(&fill_dsc); - fill_dsc.radius = dsc->radius; - fill_dsc.opa = dsc->opa; - fill_dsc.color = dsc->color; - lv_draw_vg_lite_fill(draw_unit, &fill_dsc, &core_area); - } - } - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_fill.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_fill.c deleted file mode 100644 index dbfd63d..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_fill.c +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @file lv_draw_vg_lite_fill.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../misc/lv_area_private.h" -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_path.h" -#include "lv_vg_lite_utils.h" -#include "lv_vg_lite_grad.h" - -/********************* - * DEFINES - *********************/ - -#if LV_GRADIENT_MAX_STOPS > VLC_MAX_GRADIENT_STOPS - #error "LV_GRADIENT_MAX_STOPS must be equal or less than VLC_MAX_GRADIENT_STOPS" -#endif - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc, const lv_area_t * coords) -{ - lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit; - - lv_area_t clip_area; - if(!lv_area_intersect(&clip_area, coords, draw_unit->clip_area)) { - /*Fully clipped, nothing to do*/ - return; - } - - LV_PROFILER_BEGIN; - - vg_lite_matrix_t matrix = u->global_matrix; - - lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_FP32); - lv_vg_lite_path_set_quality(path, dsc->radius == 0 ? VG_LITE_LOW : VG_LITE_HIGH); - lv_vg_lite_path_set_bonding_box_area(path, &clip_area); - lv_vg_lite_path_append_rect(path, - coords->x1, coords->y1, - lv_area_get_width(coords), lv_area_get_height(coords), - dsc->radius); - lv_vg_lite_path_end(path); - - vg_lite_path_t * vg_lite_path = lv_vg_lite_path_get_path(path); - - LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer); - LV_VG_LITE_ASSERT_PATH(vg_lite_path); - LV_VG_LITE_ASSERT_MATRIX(&matrix); - - if(dsc->grad.dir != LV_GRAD_DIR_NONE) { -#if LV_USE_VECTOR_GRAPHIC - lv_vg_lite_draw_grad_helper( - u, - &u->target_buffer, - vg_lite_path, - coords, - &dsc->grad, - &matrix, - VG_LITE_FILL_EVEN_ODD, - VG_LITE_BLEND_SRC_OVER); -#else - LV_LOG_WARN("Gradient fill is not supported without VECTOR_GRAPHIC"); -#endif - } - else { /* normal fill */ - vg_lite_color_t color = lv_vg_lite_color(dsc->color, dsc->opa, true); - LV_PROFILER_BEGIN_TAG("vg_lite_draw"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw( - &u->target_buffer, - vg_lite_path, - VG_LITE_FILL_EVEN_ODD, - &matrix, - VG_LITE_BLEND_SRC_OVER, - color)); - LV_PROFILER_END_TAG("vg_lite_draw"); - } - - lv_vg_lite_path_drop(u, path); - - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_img.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_img.c deleted file mode 100644 index 86e4337..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_img.c +++ /dev/null @@ -1,199 +0,0 @@ -/** - * @file lv_draw_vg_lite_img.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../misc/lv_area_private.h" -#include "../lv_image_decoder_private.h" -#include "../lv_draw_image_private.h" -#include "../lv_draw_private.h" -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_decoder.h" -#include "lv_vg_lite_path.h" -#include "lv_vg_lite_pending.h" -#include "lv_vg_lite_utils.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dsc, - const lv_area_t * coords, bool no_cache) -{ - lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit; - - /* The coordinates passed in by coords are not transformed, - * so the transformed area needs to be calculated once. - */ - lv_area_t image_tf_area; - lv_image_buf_get_transformed_area( - &image_tf_area, - lv_area_get_width(coords), - lv_area_get_height(coords), - dsc->rotation, - dsc->scale_x, - dsc->scale_y, - &dsc->pivot); - lv_area_move(&image_tf_area, coords->x1, coords->y1); - - lv_area_t clip_area; - if(!lv_area_intersect(&clip_area, &image_tf_area, draw_unit->clip_area)) { - /*Fully clipped, nothing to do*/ - return; - } - - LV_PROFILER_BEGIN; - - vg_lite_buffer_t src_buf; - lv_image_decoder_dsc_t decoder_dsc; - - /* if not support blend normal, premultiply alpha */ - bool premultiply = !lv_vg_lite_support_blend_normal(); - if(!lv_vg_lite_buffer_open_image(&src_buf, &decoder_dsc, dsc->src, no_cache, premultiply)) { - LV_PROFILER_END; - return; - } - - vg_lite_color_t color = 0; - if(LV_COLOR_FORMAT_IS_ALPHA_ONLY(decoder_dsc.decoded->header.cf) || dsc->recolor_opa > LV_OPA_TRANSP) { - /* alpha image and image recolor */ - src_buf.image_mode = VG_LITE_MULTIPLY_IMAGE_MODE; - color = lv_vg_lite_color(dsc->recolor, LV_OPA_MIX2(dsc->opa, dsc->recolor_opa), true); - } - else if(dsc->opa < LV_OPA_COVER) { - /* normal image opa */ - src_buf.image_mode = VG_LITE_MULTIPLY_IMAGE_MODE; - lv_memset(&color, dsc->opa, sizeof(color)); - } - - /* convert the blend mode to vg-lite blend mode, considering the premultiplied alpha */ - bool has_pre_mul = lv_draw_buf_has_flag(decoder_dsc.decoded, LV_IMAGE_FLAGS_PREMULTIPLIED); - vg_lite_blend_t blend = lv_vg_lite_blend_mode(dsc->blend_mode, has_pre_mul); - - /* original image matrix */ - vg_lite_matrix_t image_matrix; - vg_lite_identity(&image_matrix); - lv_vg_lite_image_matrix(&image_matrix, coords->x1, coords->y1, dsc); - - /* image drawing matrix */ - vg_lite_matrix_t matrix = u->global_matrix; - lv_vg_lite_matrix_multiply(&matrix, &image_matrix); - - LV_VG_LITE_ASSERT_SRC_BUFFER(&src_buf); - LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer); - LV_VG_LITE_ASSERT_MATRIX(&matrix); - - bool no_transform = lv_matrix_is_identity_or_translation((const lv_matrix_t *)&matrix); - vg_lite_filter_t filter = no_transform ? VG_LITE_FILTER_POINT : VG_LITE_FILTER_BI_LINEAR; - - /* If clipping is not required, blit directly */ - if(lv_area_is_in(&image_tf_area, draw_unit->clip_area, false) && dsc->clip_radius <= 0) { - /* The image area is the coordinates relative to the image itself */ - lv_area_t src_area = *coords; - lv_area_move(&src_area, -coords->x1, -coords->y1); - - /* rect is used to crop the pixel-aligned padding area */ - vg_lite_rectangle_t rect; - lv_vg_lite_rect(&rect, &src_area); - - LV_PROFILER_BEGIN_TAG("vg_lite_blit_rect"); - LV_VG_LITE_CHECK_ERROR(vg_lite_blit_rect( - &u->target_buffer, - &src_buf, - &rect, - &matrix, - blend, - color, - filter)); - LV_PROFILER_END_TAG("vg_lite_blit_rect"); - } - else { - lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_FP32); - - /** - * When the image is transformed or rounded, create a path around - * the image and follow the image_matrix for coordinate transformation - */ - if(!no_transform || dsc->clip_radius) { - /* apply the image transform to the path */ - lv_vg_lite_path_set_transform(path, &image_matrix); - lv_vg_lite_path_append_rect( - path, - 0, 0, - lv_area_get_width(coords), lv_area_get_height(coords), - dsc->clip_radius); - lv_vg_lite_path_set_transform(path, NULL); - } - else { - /* append normal rect to the path */ - lv_vg_lite_path_append_rect( - path, - clip_area.x1, clip_area.y1, - lv_area_get_width(&clip_area), lv_area_get_height(&clip_area), - 0); - } - - lv_vg_lite_path_set_bonding_box_area(path, &clip_area); - lv_vg_lite_path_end(path); - - vg_lite_path_t * vg_lite_path = lv_vg_lite_path_get_path(path); - LV_VG_LITE_ASSERT_PATH(vg_lite_path); - - vg_lite_matrix_t path_matrix = u->global_matrix; - LV_VG_LITE_ASSERT_MATRIX(&path_matrix); - - LV_PROFILER_BEGIN_TAG("vg_lite_draw_pattern"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern( - &u->target_buffer, - vg_lite_path, - VG_LITE_FILL_EVEN_ODD, - &path_matrix, - &src_buf, - &matrix, - blend, - VG_LITE_PATTERN_COLOR, - 0, - color, - filter)); - LV_PROFILER_END_TAG("vg_lite_draw_pattern"); - - lv_vg_lite_path_drop(u, path); - } - - lv_vg_lite_pending_add(u->image_dsc_pending, &decoder_dsc); - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_label.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_label.c deleted file mode 100644 index 6c4c365..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_label.c +++ /dev/null @@ -1,362 +0,0 @@ -/** - * @file lv_draw_vg_lite_label.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../misc/lv_area_private.h" -#include "../../libs/freetype/lv_freetype_private.h" -#include "../lv_draw_label_private.h" -#include "lv_draw_vg_lite.h" - -#include "../../lvgl.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_vg_lite_utils.h" -#include "lv_vg_lite_path.h" -#include "lv_draw_vg_lite_type.h" - -/********************* - * DEFINES - *********************/ - -#define PATH_QUALITY VG_LITE_HIGH -#define PATH_DATA_COORD_FORMAT VG_LITE_S16 -#define FT_F26DOT6_SHIFT 6 - -/** After converting the font reference size, it is also necessary to scale the 26dot6 data - * in the path to the real physical size - */ -#define FT_F26DOT6_TO_PATH_SCALE(x) (LV_FREETYPE_F26DOT6_TO_FLOAT(x) / (1 << FT_F26DOT6_SHIFT)) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void draw_letter_cb(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * glyph_draw_dsc, - lv_draw_fill_dsc_t * fill_draw_dsc, const lv_area_t * fill_area); - -static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_dsc_t * dsc); - -#if LV_USE_FREETYPE - static void freetype_outline_event_cb(lv_event_t * e); - static void draw_letter_outline(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_dsc_t * dsc); -#endif /* LV_USE_FREETYPE */ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc, - const lv_area_t * coords) -{ - LV_PROFILER_BEGIN; - -#if LV_USE_FREETYPE - static bool is_init = false; - if(!is_init) { - lv_freetype_outline_add_event(freetype_outline_event_cb, LV_EVENT_ALL, draw_unit); - is_init = true; - } -#endif /* LV_USE_FREETYPE */ - - lv_draw_label_iterate_characters(draw_unit, dsc, coords, draw_letter_cb); - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void draw_letter_cb(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * glyph_draw_dsc, - lv_draw_fill_dsc_t * fill_draw_dsc, const lv_area_t * fill_area) -{ - lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit; - if(glyph_draw_dsc) { - switch(glyph_draw_dsc->format) { - case LV_FONT_GLYPH_FORMAT_A1: - case LV_FONT_GLYPH_FORMAT_A2: - case LV_FONT_GLYPH_FORMAT_A4: - case LV_FONT_GLYPH_FORMAT_A8: { - draw_letter_bitmap(u, glyph_draw_dsc); - } - break; - -#if LV_USE_FREETYPE - case LV_FONT_GLYPH_FORMAT_VECTOR: { - if(lv_freetype_is_outline_font(glyph_draw_dsc->g->resolved_font)) { - draw_letter_outline(u, glyph_draw_dsc); - } - } - break; -#endif /* LV_USE_FREETYPE */ - - case LV_FONT_GLYPH_FORMAT_IMAGE: { - lv_draw_image_dsc_t image_dsc; - lv_draw_image_dsc_init(&image_dsc); - image_dsc.opa = glyph_draw_dsc->opa; - image_dsc.src = glyph_draw_dsc->glyph_data; - lv_draw_vg_lite_img(draw_unit, &image_dsc, glyph_draw_dsc->letter_coords, false); - } - break; - -#if LV_USE_FONT_PLACEHOLDER - case LV_FONT_GLYPH_FORMAT_NONE: { - /* Draw a placeholder rectangle*/ - lv_draw_border_dsc_t border_draw_dsc; - lv_draw_border_dsc_init(&border_draw_dsc); - border_draw_dsc.opa = glyph_draw_dsc->opa; - border_draw_dsc.color = glyph_draw_dsc->color; - border_draw_dsc.width = 1; - lv_draw_vg_lite_border(draw_unit, &border_draw_dsc, glyph_draw_dsc->bg_coords); - } - break; -#endif /* LV_USE_FONT_PLACEHOLDER */ - - default: - break; - } - } - - if(fill_draw_dsc && fill_area) { - lv_draw_vg_lite_fill(draw_unit, fill_draw_dsc, fill_area); - } -} - -static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_dsc_t * dsc) -{ - lv_area_t clip_area; - if(!lv_area_intersect(&clip_area, u->base_unit.clip_area, dsc->letter_coords)) { - return; - } - - LV_PROFILER_BEGIN; - - lv_area_t image_area = *dsc->letter_coords; - - vg_lite_matrix_t matrix = u->global_matrix; - vg_lite_translate(image_area.x1, image_area.y1, &matrix); - - vg_lite_buffer_t src_buf; - lv_draw_buf_t * draw_buf = dsc->glyph_data; - lv_vg_lite_buffer_from_draw_buf(&src_buf, draw_buf); - - vg_lite_color_t color; - color = lv_vg_lite_color(dsc->color, dsc->opa, true); - - LV_VG_LITE_ASSERT_SRC_BUFFER(&src_buf); - LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer); - - /* If clipping is not required, blit directly */ - if(lv_area_is_in(&image_area, u->base_unit.clip_area, false)) { - /* The image area is the coordinates relative to the image itself */ - lv_area_t src_area = image_area; - lv_area_move(&src_area, -image_area.x1, -image_area.y1); - - /* rect is used to crop the pixel-aligned padding area */ - vg_lite_rectangle_t rect; - lv_vg_lite_rect(&rect, &src_area); - LV_PROFILER_BEGIN_TAG("vg_lite_blit_rect"); - LV_VG_LITE_CHECK_ERROR(vg_lite_blit_rect( - &u->target_buffer, - &src_buf, - &rect, - &matrix, - VG_LITE_BLEND_SRC_OVER, - color, - VG_LITE_FILTER_LINEAR)); - LV_PROFILER_END_TAG("vg_lite_blit_rect"); - } - else { - lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_S16); - lv_vg_lite_path_append_rect( - path, - clip_area.x1, clip_area.y1, - lv_area_get_width(&clip_area), lv_area_get_height(&clip_area), - 0); - lv_vg_lite_path_set_bonding_box_area(path, &clip_area); - lv_vg_lite_path_end(path); - - vg_lite_path_t * vg_lite_path = lv_vg_lite_path_get_path(path); - LV_VG_LITE_ASSERT_PATH(vg_lite_path); - - vg_lite_matrix_t path_matrix = u->global_matrix; - LV_VG_LITE_ASSERT_MATRIX(&path_matrix); - - LV_PROFILER_BEGIN_TAG("vg_lite_draw_pattern"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern( - &u->target_buffer, - vg_lite_path, - VG_LITE_FILL_EVEN_ODD, - &path_matrix, - &src_buf, - &matrix, - VG_LITE_BLEND_SRC_OVER, - VG_LITE_PATTERN_COLOR, - 0, - color, - VG_LITE_FILTER_LINEAR)); - LV_PROFILER_END_TAG("vg_lite_draw_pattern"); - - lv_vg_lite_path_drop(u, path); - } - - /* TODO: The temporary buffer of the built-in font is reused. - * You need to wait for the GPU to finish using the buffer before releasing it. - * Later, use the font cache for management to improve efficiency. - */ - lv_vg_lite_finish(u); - LV_PROFILER_END; -} - -#if LV_USE_FREETYPE - -static void draw_letter_outline(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_dsc_t * dsc) -{ - /* get clip area */ - lv_area_t path_clip_area; - if(!lv_area_intersect(&path_clip_area, u->base_unit.clip_area, dsc->letter_coords)) { - return; - } - - LV_PROFILER_BEGIN; - - /* vg-lite bounding_box will crop the pixels on the edge, so +1px is needed here */ - path_clip_area.x2++; - path_clip_area.y2++; - - lv_vg_lite_path_t * outline = (lv_vg_lite_path_t *)dsc->glyph_data; - lv_point_t pos = {dsc->letter_coords->x1, dsc->letter_coords->y1}; - /* scale size */ - float scale = FT_F26DOT6_TO_PATH_SCALE(lv_freetype_outline_get_scale(dsc->g->resolved_font)); - - /* calc convert matrix */ - vg_lite_matrix_t matrix; - vg_lite_identity(&matrix); - - /* matrix for drawing, different from matrix for calculating the bonding box */ - vg_lite_matrix_t draw_matrix = u->global_matrix; - - /* convert to vg-lite coordinate */ - vg_lite_translate(pos.x - dsc->g->ofs_x, pos.y + dsc->g->box_h + dsc->g->ofs_y, &draw_matrix); - vg_lite_translate(pos.x - dsc->g->ofs_x, pos.y + dsc->g->box_h + dsc->g->ofs_y, &matrix); - - vg_lite_scale(scale, scale, &draw_matrix); - vg_lite_scale(scale, scale, &matrix); - - /* calc inverse matrix */ - vg_lite_matrix_t result; - if(!lv_vg_lite_matrix_inverse(&result, &matrix)) { - LV_LOG_ERROR("no inverse matrix"); - LV_PROFILER_END; - return; - } - - lv_point_precise_t p1 = { path_clip_area.x1, path_clip_area.y1 }; - lv_point_precise_t p1_res = lv_vg_lite_matrix_transform_point(&result, &p1); - - lv_point_precise_t p2 = { path_clip_area.x2, path_clip_area.y2 }; - lv_point_precise_t p2_res = lv_vg_lite_matrix_transform_point(&result, &p2); - - /* Since the font uses Cartesian coordinates, the y coordinates need to be reversed */ - lv_vg_lite_path_set_bonding_box(outline, p1_res.x, p2_res.y, p2_res.x, p1_res.y); - - vg_lite_path_t * vg_lite_path = lv_vg_lite_path_get_path(outline); - - LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer); - LV_VG_LITE_ASSERT_PATH(vg_lite_path); - LV_VG_LITE_ASSERT_MATRIX(&draw_matrix); - - LV_PROFILER_BEGIN_TAG("vg_lite_draw"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw( - &u->target_buffer, vg_lite_path, VG_LITE_FILL_NON_ZERO, - &draw_matrix, VG_LITE_BLEND_SRC_OVER, lv_vg_lite_color(dsc->color, dsc->opa, true))); - LV_PROFILER_END_TAG("vg_lite_draw"); - - /* Flush in time to avoid accumulation of drawing commands */ - lv_vg_lite_flush(u); - - LV_PROFILER_END; -} - -static void vg_lite_outline_push(const lv_freetype_outline_event_param_t * param) -{ - LV_PROFILER_BEGIN; - lv_vg_lite_path_t * outline = param->outline; - LV_ASSERT_NULL(outline); - - lv_freetype_outline_type_t type = param->type; - switch(type) { - - /** - * Reverse the Y-axis coordinate direction to achieve - * the conversion from Cartesian coordinate system to LCD coordinate system - */ - case LV_FREETYPE_OUTLINE_END: - lv_vg_lite_path_end(outline); - break; - case LV_FREETYPE_OUTLINE_MOVE_TO: - lv_vg_lite_path_move_to(outline, param->to.x, -param->to.y); - break; - case LV_FREETYPE_OUTLINE_LINE_TO: - lv_vg_lite_path_line_to(outline, param->to.x, -param->to.y); - break; - case LV_FREETYPE_OUTLINE_CUBIC_TO: - lv_vg_lite_path_cubic_to(outline, param->control1.x, -param->control1.y, - param->control2.x, -param->control2.y, - param->to.x, -param->to.y); - break; - case LV_FREETYPE_OUTLINE_CONIC_TO: - lv_vg_lite_path_quad_to(outline, param->control1.x, -param->control1.y, - param->to.x, -param->to.y); - break; - default: - LV_LOG_ERROR("unknown point type: %d", type); - LV_ASSERT(false); - break; - } - LV_PROFILER_END; -} - -static void freetype_outline_event_cb(lv_event_t * e) -{ - LV_PROFILER_BEGIN; - lv_event_code_t code = lv_event_get_code(e); - lv_freetype_outline_event_param_t * param = lv_event_get_param(e); - switch(code) { - case LV_EVENT_CREATE: - param->outline = lv_vg_lite_path_create(PATH_DATA_COORD_FORMAT); - lv_vg_lite_path_set_quality(param->outline, PATH_QUALITY); - break; - case LV_EVENT_DELETE: - lv_vg_lite_path_destroy(param->outline); - break; - case LV_EVENT_INSERT: - vg_lite_outline_push(param); - break; - default: - LV_LOG_WARN("unknown event code: %d", code); - break; - } - LV_PROFILER_END; -} - -#endif /* LV_USE_FREETYPE */ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_layer.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_layer.c deleted file mode 100644 index 8f2a17e..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_layer.c +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file lv_draw_vg_lite_layer.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_vg_lite_utils.h" -#include "lv_draw_vg_lite_type.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, - const lv_area_t * coords) -{ - lv_layer_t * layer = (lv_layer_t *)draw_dsc->src; - struct lv_draw_vg_lite_unit_t * u = (struct lv_draw_vg_lite_unit_t *)draw_unit; - - /*It can happen that nothing was draw on a layer and therefore its buffer is not allocated. - *In this case just return. */ - if(layer->draw_buf == NULL) - return; - - LV_PROFILER_BEGIN; - - /* The GPU output should already be premultiplied RGB */ - if(!lv_draw_buf_has_flag(layer->draw_buf, LV_IMAGE_FLAGS_PREMULTIPLIED)) { - LV_LOG_WARN("Non-premultiplied layer buffer for GPU to draw."); - } - - lv_draw_image_dsc_t new_draw_dsc = *draw_dsc; - new_draw_dsc.src = layer->draw_buf; - lv_draw_vg_lite_img(draw_unit, &new_draw_dsc, coords, true); - - /* Wait for the GPU drawing to complete here, - * otherwise it may cause the drawing to fail. */ - lv_vg_lite_finish(u); - - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_line.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_line.c deleted file mode 100644 index e1ba695..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_line.c +++ /dev/null @@ -1,212 +0,0 @@ -/** - * @file lv_draw_vg_lite_line.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../misc/lv_area_private.h" -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_math.h" -#include "lv_vg_lite_path.h" -#include "lv_vg_lite_utils.h" - -/********************* - * DEFINES - *********************/ - -#define SQ(x) ((x) * (x)) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc) -{ - float p1_x = dsc->p1.x; - float p1_y = dsc->p1.y; - float p2_x = dsc->p2.x; - float p2_y = dsc->p2.y; - - if(p1_x == p2_x && p1_y == p2_y) - return; - - float half_w = dsc->width * 0.5f; - - lv_area_t rel_clip_area; - rel_clip_area.x1 = (int32_t)(LV_MIN(p1_x, p2_x) - half_w); - rel_clip_area.x2 = (int32_t)(LV_MAX(p1_x, p2_x) + half_w); - rel_clip_area.y1 = (int32_t)(LV_MIN(p1_y, p2_y) - half_w); - rel_clip_area.y2 = (int32_t)(LV_MAX(p1_y, p2_y) + half_w); - - if(!lv_area_intersect(&rel_clip_area, &rel_clip_area, draw_unit->clip_area)) { - return; /*Fully clipped, nothing to do*/ - } - - LV_PROFILER_BEGIN; - - lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit; - - int32_t dash_width = dsc->dash_width; - int32_t dash_gap = dsc->dash_gap; - int32_t dash_l = dash_width + dash_gap; - - float dx = p2_x - p1_x; - float dy = p2_y - p1_y; - float inv_dl = math_fast_inv_sqrtf(SQ(dx) + SQ(dy)); - float w_dx = dsc->width * dy * inv_dl; - float w_dy = dsc->width * dx * inv_dl; - float w2_dx = w_dx / 2; - float w2_dy = w_dy / 2; - - int32_t ndash = 0; - if(dash_width && dash_l * inv_dl < 1.0f) { - ndash = (int32_t)((1.0f / inv_dl + dash_l - 1) / dash_l); - } - - lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_FP32); - lv_vg_lite_path_set_quality(path, VG_LITE_MEDIUM); - lv_vg_lite_path_set_bonding_box_area(path, &rel_clip_area); - - /* head point */ - float head_start_x = p1_x + w2_dx; - float head_start_y = p1_y - w2_dy; - float head_end_x = p1_x - w2_dx; - float head_end_y = p1_y + w2_dy; - - /* tail point */ - float tail_start_x = p2_x - w2_dx; - float tail_start_y = p2_y + w2_dy; - float tail_end_x = p2_x + w2_dx; - float tail_end_y = p2_y - w2_dy; - - /* - head_start tail_end - *-----------------* - /| |\ - / | | \ - arc_c *( *p1 p2* )* arc_c - \ | | / - \| |/ - *-----------------* - head_end tail_start - */ - - /* move to start point */ - lv_vg_lite_path_move_to(path, head_start_x, head_start_y); - - /* draw line head */ - if(dsc->round_start) { - float arc_cx = p1_x - w2_dy; - float arc_cy = p1_y - w2_dx; - - /* start 90deg arc */ - lv_vg_lite_path_append_arc_right_angle(path, - head_start_x, head_start_y, - p1_x, p1_y, - arc_cx, arc_cy); - - /* end 90deg arc */ - lv_vg_lite_path_append_arc_right_angle(path, - arc_cx, arc_cy, - p1_x, p1_y, - head_end_x, head_end_y); - } - else { - lv_vg_lite_path_line_to(path, head_end_x, head_end_y); - } - - /* draw line body */ - lv_vg_lite_path_line_to(path, tail_start_x, tail_start_y); - - /* draw line tail */ - if(dsc->round_end) { - float arc_cx = p2_x + w2_dy; - float arc_cy = p2_y + w2_dx; - lv_vg_lite_path_append_arc_right_angle(path, - tail_start_x, tail_start_y, - p2_x, p2_y, - arc_cx, arc_cy); - lv_vg_lite_path_append_arc_right_angle(path, - arc_cx, arc_cy, - p2_x, p2_y, - tail_end_x, tail_end_y); - } - else { - lv_vg_lite_path_line_to(path, tail_end_x, tail_end_y); - } - - /* close draw line body */ - lv_vg_lite_path_line_to(path, head_start_x, head_start_y); - - for(int32_t i = 0; i < ndash; i++) { - float start_x = p1_x - w2_dx + dx * (i * dash_l + dash_width) * inv_dl; - float start_y = p1_y + w2_dy + dy * (i * dash_l + dash_width) * inv_dl; - - lv_vg_lite_path_move_to(path, start_x, start_y); - lv_vg_lite_path_line_to(path, - p1_x + w2_dx + dx * (i * dash_l + dash_width) * inv_dl, - p1_y - w2_dy + dy * (i * dash_l + dash_width) * inv_dl); - lv_vg_lite_path_line_to(path, - p1_x + w2_dx + dx * (i + 1) * dash_l * inv_dl, - p1_y - w2_dy + dy * (i + 1) * dash_l * inv_dl); - lv_vg_lite_path_line_to(path, - p1_x - w2_dx + dx * (i + 1) * dash_l * inv_dl, - p1_y + w2_dy + dy * (i + 1) * dash_l * inv_dl); - lv_vg_lite_path_line_to(path, start_x, start_y); - } - - lv_vg_lite_path_end(path); - - vg_lite_matrix_t matrix = u->global_matrix; - - vg_lite_color_t color = lv_vg_lite_color(dsc->color, dsc->opa, true); - - vg_lite_path_t * vg_lite_path = lv_vg_lite_path_get_path(path); - - LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer); - LV_VG_LITE_ASSERT_PATH(vg_lite_path); - LV_VG_LITE_ASSERT_MATRIX(&matrix); - - LV_PROFILER_BEGIN_TAG("vg_lite_draw"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw( - &u->target_buffer, - vg_lite_path, - VG_LITE_FILL_EVEN_ODD, - &matrix, - VG_LITE_BLEND_SRC_OVER, - color)); - LV_PROFILER_END_TAG("vg_lite_draw"); - - lv_vg_lite_path_drop(u, path); - - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_mask_rect.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_mask_rect.c deleted file mode 100644 index 3d24b23..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_mask_rect.c +++ /dev/null @@ -1,144 +0,0 @@ -/** - * @file lv_draw_vg_lite_rect.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../misc/lv_area_private.h" -#include "../sw/lv_draw_sw_mask_private.h" -#include "../lv_draw_mask_private.h" -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_vg_lite_utils.h" -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_path.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_mask_rect(lv_draw_unit_t * draw_unit, const lv_draw_mask_rect_dsc_t * dsc, - const lv_area_t * coords) -{ - LV_UNUSED(coords); - - lv_area_t draw_area; - if(!lv_area_intersect(&draw_area, &dsc->area, draw_unit->clip_area)) { - return; - } - - LV_PROFILER_BEGIN; - -#if LV_USE_VG_LITE_THORVG - /** - * ThorVG does not yet support simulating the VG_LITE_BLEND_DST_IN blend mode, - * and uses software rendering to achieve this - */ - lv_draw_sw_mask_radius_param_t param; - lv_draw_sw_mask_radius_init(¶m, &dsc->area, dsc->radius, false); - - void * masks[2] = {0}; - masks[0] = ¶m; - - uint32_t area_w = lv_area_get_width(&draw_area); - lv_opa_t * mask_buf = lv_malloc(area_w); - - int32_t y; - for(y = draw_area.y1; y <= draw_area.y2; y++) { - lv_memset(mask_buf, 0xff, area_w); - lv_draw_sw_mask_res_t res = lv_draw_sw_mask_apply(masks, mask_buf, draw_area.x1, y, area_w); - if(res == LV_DRAW_SW_MASK_RES_FULL_COVER) continue; - - lv_layer_t * target_layer = draw_unit->target_layer; - lv_color32_t * c32_buf = lv_draw_layer_go_to_xy(target_layer, draw_area.x1 - target_layer->buf_area.x1, - y - target_layer->buf_area.y1); - - if(res == LV_DRAW_SW_MASK_RES_TRANSP) { - lv_memzero(c32_buf, area_w * sizeof(lv_color32_t)); - } - else { - uint32_t i; - for(i = 0; i < area_w; i++) { - if(mask_buf[i] != LV_OPA_COVER) { - c32_buf[i].alpha = LV_OPA_MIX2(c32_buf[i].alpha, mask_buf[i]); - } - - /*Pre-multiply the alpha*/ - lv_color_premultiply(&c32_buf[i]); - } - } - } - - lv_free(mask_buf); - lv_draw_sw_mask_free_param(¶m); -#else - /* Using hardware rendering masks */ - lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit; - - int32_t w = lv_area_get_width(&dsc->area); - int32_t h = lv_area_get_height(&dsc->area); - - lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_FP32); - lv_vg_lite_path_set_quality(path, VG_LITE_HIGH); - lv_vg_lite_path_set_bonding_box_area(path, &draw_area); - - /* Use rounded rectangles and normal rectangles of the same size to nest the cropped area */ - lv_vg_lite_path_append_rect(path, dsc->area.x1, dsc->area.y1, w, h, dsc->radius); - lv_vg_lite_path_append_rect(path, dsc->area.x1, dsc->area.y1, w, h, 0); - lv_vg_lite_path_end(path); - - vg_lite_path_t * vg_lite_path = lv_vg_lite_path_get_path(path); - - vg_lite_matrix_t matrix = u->global_matrix; - - LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer); - LV_VG_LITE_ASSERT_PATH(vg_lite_path); - LV_VG_LITE_ASSERT_MATRIX(&matrix); - - /* Use VG_LITE_BLEND_DST_IN (Sa * D) blending mode to make the corners transparent */ - LV_PROFILER_BEGIN_TAG("vg_lite_draw"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw( - &u->target_buffer, - vg_lite_path, - VG_LITE_FILL_EVEN_ODD, - &matrix, - VG_LITE_BLEND_DST_IN, - 0)); - LV_PROFILER_END_TAG("vg_lite_draw"); - - lv_vg_lite_path_drop(u, path); -#endif /*LV_USE_VG_LITE_THORVG*/ - - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_triangle.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_triangle.c deleted file mode 100644 index 6360913..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_triangle.c +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @file lv_draw_vg_lite_triangle.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../misc/lv_area_private.h" -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_vg_lite_utils.h" -#include "lv_vg_lite_path.h" -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_grad.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_triangle(lv_draw_unit_t * draw_unit, const lv_draw_triangle_dsc_t * dsc) -{ - lv_area_t tri_area; - tri_area.x1 = (int32_t)LV_MIN3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - tri_area.y1 = (int32_t)LV_MIN3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - tri_area.x2 = (int32_t)LV_MAX3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x); - tri_area.y2 = (int32_t)LV_MAX3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y); - - bool is_common; - lv_area_t clip_area; - is_common = lv_area_intersect(&clip_area, &tri_area, draw_unit->clip_area); - if(!is_common) return; - - LV_PROFILER_BEGIN; - - lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit; - - lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_FP32); - lv_vg_lite_path_set_bonding_box_area(path, &clip_area); - lv_vg_lite_path_move_to(path, dsc->p[0].x, dsc->p[0].y); - lv_vg_lite_path_line_to(path, dsc->p[1].x, dsc->p[1].y); - lv_vg_lite_path_line_to(path, dsc->p[2].x, dsc->p[2].y); - lv_vg_lite_path_close(path); - lv_vg_lite_path_end(path); - - vg_lite_path_t * vg_lite_path = lv_vg_lite_path_get_path(path); - - LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer); - LV_VG_LITE_ASSERT_PATH(vg_lite_path); - - vg_lite_matrix_t matrix = u->global_matrix; - LV_VG_LITE_ASSERT_MATRIX(&matrix); - - if(dsc->bg_grad.dir != LV_GRAD_DIR_NONE) { -#if LV_USE_VECTOR_GRAPHIC - lv_vg_lite_draw_grad_helper( - u, - &u->target_buffer, - vg_lite_path, - &tri_area, - &dsc->bg_grad, - &matrix, - VG_LITE_FILL_EVEN_ODD, - VG_LITE_BLEND_SRC_OVER); -#else - LV_LOG_WARN("Gradient fill is not supported without VECTOR_GRAPHIC"); -#endif - } - else { /* normal fill */ - vg_lite_color_t color = lv_vg_lite_color(dsc->bg_color, dsc->bg_opa, true); - LV_PROFILER_BEGIN_TAG("vg_lite_draw"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw( - &u->target_buffer, - vg_lite_path, - VG_LITE_FILL_EVEN_ODD, - &matrix, - VG_LITE_BLEND_SRC_OVER, - color)); - LV_PROFILER_END_TAG("vg_lite_draw"); - } - - lv_vg_lite_path_drop(u, path); - - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_type.h b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_type.h deleted file mode 100644 index d325be5..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_type.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @file lv_draw_vg_lite_type.h - * - */ - -#ifndef LV_DRAW_VG_LITE_TYPE_H -#define LV_DRAW_VG_LITE_TYPE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" - -#if LV_USE_DRAW_VG_LITE - -#include "../lv_draw_private.h" -#include "../../misc/lv_array.h" - -#if LV_USE_VG_LITE_THORVG -#include "../../others/vg_lite_tvg/vg_lite.h" -#else -#include -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_vg_lite_pending_t; - -struct lv_draw_vg_lite_unit_t { - lv_draw_unit_t base_unit; - lv_draw_task_t * task_act; - - struct lv_vg_lite_pending_t * image_dsc_pending; - - lv_cache_t * grad_cache; - struct lv_vg_lite_pending_t * grad_pending; - - lv_cache_t * stroke_cache; - - uint16_t flush_count; - vg_lite_buffer_t target_buffer; - vg_lite_matrix_t global_matrix; - struct lv_vg_lite_path_t * global_path; - bool path_in_use; -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRAW_VG_LITE_TYPE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_vector.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_vector.c deleted file mode 100644 index 481be5c..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_draw_vg_lite_vector.c +++ /dev/null @@ -1,435 +0,0 @@ -/** - * @file lv_draw_vg_lite_vector.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../lv_image_decoder_private.h" -#include "../lv_draw_vector_private.h" -#include "lv_draw_vg_lite.h" - -#if LV_USE_DRAW_VG_LITE && LV_USE_VECTOR_GRAPHIC - -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_path.h" -#include "lv_vg_lite_pending.h" -#include "lv_vg_lite_utils.h" -#include "lv_vg_lite_grad.h" -#include "lv_vg_lite_stroke.h" -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef void * path_drop_data_t; -typedef void (*path_drop_func_t)(struct lv_draw_vg_lite_unit_t *, path_drop_data_t); - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vector_draw_dsc_t * dsc); -static void lv_path_to_vg(lv_vg_lite_path_t * dest, const lv_vector_path_t * src); -static vg_lite_path_type_t lv_path_opa_to_path_type(const lv_vector_draw_dsc_t * dsc); -static vg_lite_blend_t lv_blend_to_vg(lv_vector_blend_t blend); -static vg_lite_fill_t lv_fill_to_vg(lv_vector_fill_t fill_rule); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_draw_vg_lite_vector(lv_draw_unit_t * draw_unit, const lv_draw_vector_task_dsc_t * dsc) -{ - if(dsc->task_list == NULL) - return; - - lv_layer_t * layer = dsc->base.layer; - if(layer->draw_buf == NULL) - return; - - LV_PROFILER_BEGIN; - lv_vector_for_each_destroy_tasks(dsc->task_list, task_draw_cb, draw_unit); - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static vg_lite_color_t lv_color32_to_vg(lv_color32_t color, lv_opa_t opa) -{ - uint8_t a = LV_OPA_MIX2(color.alpha, opa); - if(a < LV_OPA_COVER) { - color.red = LV_UDIV255(color.red * a); - color.green = LV_UDIV255(color.green * a); - color.blue = LV_UDIV255(color.blue * a); - } - return (uint32_t)a << 24 | (uint32_t)color.blue << 16 | (uint32_t)color.green << 8 | color.red; -} - -static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vector_draw_dsc_t * dsc) -{ - LV_PROFILER_BEGIN; - lv_draw_vg_lite_unit_t * u = ctx; - LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer); - - /* clear area */ - if(!path) { - /* clear color needs to ignore fill_dsc.opa */ - vg_lite_color_t c = lv_color32_to_vg(dsc->fill_dsc.color, LV_OPA_COVER); - vg_lite_rectangle_t rect; - lv_vg_lite_rect(&rect, &dsc->scissor_area); - LV_PROFILER_BEGIN_TAG("vg_lite_clear"); - LV_VG_LITE_CHECK_ERROR(vg_lite_clear(&u->target_buffer, &rect, c)); - LV_PROFILER_END_TAG("vg_lite_clear"); - LV_PROFILER_END; - return; - } - - /* convert color */ - vg_lite_color_t vg_color = lv_color32_to_vg(dsc->fill_dsc.color, dsc->fill_dsc.opa); - - /* transform matrix */ - vg_lite_matrix_t matrix; - lv_vg_lite_matrix(&matrix, &dsc->matrix); - LV_VG_LITE_ASSERT_MATRIX(&matrix); - - /* convert path */ - lv_vg_lite_path_t * lv_vg_path = lv_vg_lite_path_get(u, VG_LITE_FP32); - lv_path_to_vg(lv_vg_path, path); - - /* get path bounds */ - float min_x, min_y, max_x, max_y; - lv_vg_lite_path_get_bonding_box(lv_vg_path, &min_x, &min_y, &max_x, &max_y); - - /* convert path type */ - vg_lite_path_type_t path_type = lv_path_opa_to_path_type(dsc); - - /* convert blend mode and fill rule */ - vg_lite_blend_t blend = lv_blend_to_vg(dsc->blend_mode); - vg_lite_fill_t fill = lv_fill_to_vg(dsc->fill_dsc.fill_rule); - - /* set default path drop function and data */ - path_drop_func_t path_drop_func = (path_drop_func_t)lv_vg_lite_path_drop; - path_drop_data_t path_drop_data = lv_vg_path; - - /* If it is fill mode, the end op code should be added */ - if(path_type == VG_LITE_DRAW_ZERO - || path_type == VG_LITE_DRAW_FILL_PATH - || path_type == VG_LITE_DRAW_FILL_STROKE_PATH) { - lv_vg_lite_path_end(lv_vg_path); - } - - /* convert stroke style */ - if(path_type == VG_LITE_DRAW_STROKE_PATH - || path_type == VG_LITE_DRAW_FILL_STROKE_PATH) { - lv_cache_entry_t * stroke_cache_entey = lv_vg_lite_stroke_get(u, lv_vg_path, &dsc->stroke_dsc); - - if(!stroke_cache_entey) { - LV_LOG_ERROR("convert stroke failed"); - - /* drop original path */ - lv_vg_lite_path_drop(u, lv_vg_path); - return; - } - - lv_vg_lite_path_t * ori_path = lv_vg_path; - const vg_lite_path_t * ori_vg_path = lv_vg_lite_path_get_path(ori_path); - - lv_vg_lite_path_t * stroke_path = lv_vg_lite_stroke_get_path(stroke_cache_entey); - vg_lite_path_t * vg_path = lv_vg_lite_path_get_path(stroke_path); - - /* set stroke params */ - LV_VG_LITE_CHECK_ERROR(vg_lite_set_path_type(vg_path, path_type)); - vg_path->stroke_color = lv_color32_to_vg(dsc->stroke_dsc.color, dsc->stroke_dsc.opa); - vg_path->quality = ori_vg_path->quality; - lv_memcpy(vg_path->bounding_box, ori_vg_path->bounding_box, sizeof(ori_vg_path->bounding_box)); - - /* change path to stroke path */ - LV_LOG_TRACE("change path to stroke path: %p -> %p", (void *)lv_vg_path, (void *)stroke_path); - lv_vg_path = stroke_path; - path_drop_func = (path_drop_func_t)lv_vg_lite_stroke_drop; - path_drop_data = stroke_cache_entey; - - /* drop original path */ - lv_vg_lite_path_drop(u, ori_path); - } - - vg_lite_path_t * vg_path = lv_vg_lite_path_get_path(lv_vg_path); - LV_VG_LITE_ASSERT_PATH(vg_path); - - if(vg_lite_query_feature(gcFEATURE_BIT_VG_SCISSOR)) { - /* set scissor area */ - lv_vg_lite_set_scissor_area(&dsc->scissor_area); - } - else { - /* calc inverse matrix */ - vg_lite_matrix_t result; - if(!lv_vg_lite_matrix_inverse(&result, &matrix)) { - LV_LOG_ERROR("no inverse matrix"); - path_drop_func(u, path_drop_data); - LV_PROFILER_END; - return; - } - - /* Reverse the clip area on the source */ - lv_point_precise_t p1 = { dsc->scissor_area.x1, dsc->scissor_area.y1 }; - lv_point_precise_t p1_res = lv_vg_lite_matrix_transform_point(&result, &p1); - - /* vg-lite bounding_box will crop the pixels on the edge, so +1px is needed here */ - lv_point_precise_t p2 = { dsc->scissor_area.x2 + 1, dsc->scissor_area.y2 + 1 }; - lv_point_precise_t p2_res = lv_vg_lite_matrix_transform_point(&result, &p2); - - lv_vg_lite_path_set_bonding_box(lv_vg_path, p1_res.x, p1_res.y, p2_res.x, p2_res.y); - } - - switch(dsc->fill_dsc.style) { - case LV_VECTOR_DRAW_STYLE_SOLID: { - /* normal draw shape */ - LV_PROFILER_BEGIN_TAG("vg_lite_draw"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw( - &u->target_buffer, - vg_path, - fill, - &matrix, - blend, - vg_color)); - LV_PROFILER_END_TAG("vg_lite_draw"); - } - break; - case LV_VECTOR_DRAW_STYLE_PATTERN: { - /* draw image */ - vg_lite_buffer_t image_buffer; - lv_image_decoder_dsc_t decoder_dsc; - if(lv_vg_lite_buffer_open_image(&image_buffer, &decoder_dsc, dsc->fill_dsc.img_dsc.src, false, true)) { - /* Calculate pattern matrix. Should start from path bond box, and also apply fill matrix. */ - lv_matrix_t m = dsc->matrix; - lv_matrix_translate(&m, min_x, min_y); - lv_matrix_multiply(&m, &dsc->fill_dsc.matrix); - - vg_lite_matrix_t pattern_matrix; - lv_vg_lite_matrix(&pattern_matrix, &m); - - vg_lite_color_t recolor = lv_vg_lite_color(dsc->fill_dsc.img_dsc.recolor, dsc->fill_dsc.img_dsc.recolor_opa, true); - - LV_VG_LITE_ASSERT_MATRIX(&pattern_matrix); - - LV_PROFILER_BEGIN_TAG("vg_lite_draw_pattern"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern( - &u->target_buffer, - vg_path, - fill, - &matrix, - &image_buffer, - &pattern_matrix, - blend, - VG_LITE_PATTERN_COLOR, - vg_color, - recolor, - VG_LITE_FILTER_BI_LINEAR)); - LV_PROFILER_END_TAG("vg_lite_draw_pattern"); - - lv_vg_lite_pending_add(u->image_dsc_pending, &decoder_dsc); - } - } - break; - case LV_VECTOR_DRAW_STYLE_GRADIENT: { - vg_lite_matrix_t grad_matrix; - vg_lite_identity(&grad_matrix); - -#if !LV_USE_VG_LITE_THORVG - /* Workaround inconsistent matrix behavior between device and ThorVG */ - lv_vg_lite_matrix_multiply(&grad_matrix, &matrix); -#endif - vg_lite_matrix_t fill_matrix; - lv_vg_lite_matrix(&fill_matrix, &dsc->fill_dsc.matrix); - lv_vg_lite_matrix_multiply(&grad_matrix, &fill_matrix); - - lv_vg_lite_draw_grad( - u, - &u->target_buffer, - vg_path, - &dsc->fill_dsc.gradient, - &grad_matrix, - &matrix, - fill, - blend); - } - break; - default: - LV_LOG_WARN("unknown style: %d", dsc->fill_dsc.style); - break; - } - - /* Flush in time to avoid accumulation of drawing commands */ - lv_vg_lite_flush(u); - - /* drop path */ - path_drop_func(u, path_drop_data); - - if(vg_lite_query_feature(gcFEATURE_BIT_VG_SCISSOR)) { - /* disable scissor */ - lv_vg_lite_disable_scissor(); - } - - LV_PROFILER_END; -} - -static vg_lite_quality_t lv_quality_to_vg(lv_vector_path_quality_t quality) -{ - switch(quality) { - case LV_VECTOR_PATH_QUALITY_LOW: - return VG_LITE_LOW; - case LV_VECTOR_PATH_QUALITY_MEDIUM: - return VG_LITE_MEDIUM; - case LV_VECTOR_PATH_QUALITY_HIGH: - return VG_LITE_HIGH; - default: - return VG_LITE_MEDIUM; - } -} - -static void lv_path_to_vg(lv_vg_lite_path_t * dest, const lv_vector_path_t * src) -{ - LV_PROFILER_BEGIN; - lv_vg_lite_path_set_quality(dest, lv_quality_to_vg(src->quality)); - - /* init bounds */ - float min_x = FLT_MAX; - float min_y = FLT_MAX; - float max_x = FLT_MIN; - float max_y = FLT_MIN; - -#define CMP_BOUNDS(point) \ - do { \ - if((point)->x < min_x) min_x = (point)->x; \ - if((point)->y < min_y) min_y = (point)->y; \ - if((point)->x > max_x) max_x = (point)->x; \ - if((point)->y > max_y) max_y = (point)->y; \ - } while(0) - - uint32_t pidx = 0; - lv_vector_path_op_t * op = lv_array_front(&src->ops); - uint32_t size = lv_array_size(&src->ops); - for(uint32_t i = 0; i < size; i++) { - switch(op[i]) { - case LV_VECTOR_PATH_OP_MOVE_TO: { - const lv_fpoint_t * pt = lv_array_at(&src->points, pidx); - CMP_BOUNDS(pt); - lv_vg_lite_path_move_to(dest, pt->x, pt->y); - pidx += 1; - } - break; - case LV_VECTOR_PATH_OP_LINE_TO: { - const lv_fpoint_t * pt = lv_array_at(&src->points, pidx); - CMP_BOUNDS(pt); - lv_vg_lite_path_line_to(dest, pt->x, pt->y); - pidx += 1; - } - break; - case LV_VECTOR_PATH_OP_QUAD_TO: { - const lv_fpoint_t * pt1 = lv_array_at(&src->points, pidx); - const lv_fpoint_t * pt2 = lv_array_at(&src->points, pidx + 1); - CMP_BOUNDS(pt1); - CMP_BOUNDS(pt2); - lv_vg_lite_path_quad_to(dest, pt1->x, pt1->y, pt2->x, pt2->y); - pidx += 2; - } - break; - case LV_VECTOR_PATH_OP_CUBIC_TO: { - const lv_fpoint_t * pt1 = lv_array_at(&src->points, pidx); - const lv_fpoint_t * pt2 = lv_array_at(&src->points, pidx + 1); - const lv_fpoint_t * pt3 = lv_array_at(&src->points, pidx + 2); - CMP_BOUNDS(pt1); - CMP_BOUNDS(pt2); - CMP_BOUNDS(pt3); - lv_vg_lite_path_cubic_to(dest, pt1->x, pt1->y, pt2->x, pt2->y, pt3->x, pt3->y); - pidx += 3; - } - break; - case LV_VECTOR_PATH_OP_CLOSE: { - lv_vg_lite_path_close(dest); - } - break; - } - } - - lv_vg_lite_path_set_bonding_box(dest, min_x, min_y, max_x, max_y); - LV_PROFILER_END; -} - -static vg_lite_path_type_t lv_path_opa_to_path_type(const lv_vector_draw_dsc_t * dsc) -{ - lv_opa_t fill_opa = dsc->fill_dsc.opa; - lv_opa_t stroke_opa = dsc->stroke_dsc.opa; - - if(fill_opa > LV_OPA_0 && stroke_opa > LV_OPA_0) { - return VG_LITE_DRAW_FILL_STROKE_PATH; - } - - if(fill_opa == LV_OPA_0 && stroke_opa > LV_OPA_0) { - return VG_LITE_DRAW_STROKE_PATH; - } - - if(fill_opa > LV_OPA_0) { - return VG_LITE_DRAW_FILL_PATH; - } - - return VG_LITE_DRAW_ZERO; -} - -static vg_lite_blend_t lv_blend_to_vg(lv_vector_blend_t blend) -{ - switch(blend) { - case LV_VECTOR_BLEND_SRC_OVER: - return VG_LITE_BLEND_SRC_OVER; - case LV_VECTOR_BLEND_SCREEN: - return VG_LITE_BLEND_SCREEN; - case LV_VECTOR_BLEND_MULTIPLY: - return VG_LITE_BLEND_MULTIPLY; - case LV_VECTOR_BLEND_NONE: - return VG_LITE_BLEND_NONE; - case LV_VECTOR_BLEND_ADDITIVE: - return VG_LITE_BLEND_ADDITIVE; - case LV_VECTOR_BLEND_SRC_IN: - return VG_LITE_BLEND_SRC_IN; - case LV_VECTOR_BLEND_DST_OVER: - return VG_LITE_BLEND_DST_OVER; - case LV_VECTOR_BLEND_DST_IN: - return VG_LITE_BLEND_DST_IN; - case LV_VECTOR_BLEND_SUBTRACTIVE: - return VG_LITE_BLEND_SUBTRACT; - default: - return VG_LITE_BLEND_SRC_OVER; - } -} - -static vg_lite_fill_t lv_fill_to_vg(lv_vector_fill_t fill_rule) -{ - switch(fill_rule) { - case LV_VECTOR_FILL_NONZERO: - return VG_LITE_FILL_NON_ZERO; - case LV_VECTOR_FILL_EVENODD: - return VG_LITE_FILL_EVEN_ODD; - default: - return VG_LITE_FILL_NON_ZERO; - } -} - -#endif /*LV_USE_DRAW_VG_LITE && LV_USE_VECTOR_GRAPHIC*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_decoder.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_decoder.c deleted file mode 100644 index bb7a784..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_decoder.c +++ /dev/null @@ -1,393 +0,0 @@ -/** - * @file lv_vg_lite_decoder.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../lv_image_decoder_private.h" -#include "lv_vg_lite_decoder.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_vg_lite_utils.h" -#include -#include -#include "../../core/lv_global.h" - -/********************* - * DEFINES - *********************/ - -#define DECODER_NAME "VG_LITE" - -#define image_cache_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->image_cache_draw_buf_handlers) - -/* VG_LITE_INDEX1, 2, and 4 require endian flipping + bit flipping, - * so for simplicity, they are uniformly converted to I8 for display. - */ -#define DEST_IMG_FORMAT LV_COLOR_FORMAT_I8 -#define IS_CONV_INDEX_FORMAT(cf) (cf == LV_COLOR_FORMAT_I1 || cf == LV_COLOR_FORMAT_I2 || cf == LV_COLOR_FORMAT_I4) - -/* Since the palette and index image are next to each other, - * the palette size needs to be aligned to ensure that the image is aligned. - */ -#define DEST_IMG_OFFSET \ - LV_VG_LITE_ALIGN(LV_COLOR_INDEXED_PALETTE_SIZE(DEST_IMG_FORMAT) * sizeof(lv_color32_t), LV_DRAW_BUF_ALIGN) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * src, lv_image_header_t * header); -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -static void image_color32_pre_mul(lv_color32_t * img_data, uint32_t px_size); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_vg_lite_decoder_init(void) -{ - lv_image_decoder_t * decoder = lv_image_decoder_create(); - lv_image_decoder_set_info_cb(decoder, decoder_info); - lv_image_decoder_set_open_cb(decoder, decoder_open); - lv_image_decoder_set_close_cb(decoder, decoder_close); - - decoder->name = DECODER_NAME; -} - -void lv_vg_lite_decoder_deinit(void) -{ - lv_image_decoder_t * dec = NULL; - while((dec = lv_image_decoder_get_next(dec)) != NULL) { - if(dec->info_cb == decoder_info) { - lv_image_decoder_delete(dec); - break; - } - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void image_color32_pre_mul(lv_color32_t * img_data, uint32_t px_size) -{ - while(px_size--) { - lv_color_premultiply(img_data); - img_data++; - } -} - -static uint32_t image_stride(const lv_image_header_t * header) -{ - /* use stride in header */ - if(header->stride) { - return header->stride; - } - - /* guess stride */ - uint32_t ori_stride = header->w * lv_color_format_get_bpp(header->cf); - ori_stride = (ori_stride + 7) >> 3; /*Round up*/ - return ori_stride; -} - -static void image_decode_to_index8_line(uint8_t * dest, const uint8_t * src, int32_t w_px, - lv_color_format_t color_format) -{ - uint8_t px_size; - uint16_t mask; - - int8_t shift = 0; - switch(color_format) { - case LV_COLOR_FORMAT_I1: - px_size = 1; - shift = 7; - break; - case LV_COLOR_FORMAT_I2: - px_size = 2; - shift = 6; - break; - case LV_COLOR_FORMAT_I4: - px_size = 4; - shift = 4; - break; - case LV_COLOR_FORMAT_I8: - lv_memcpy(dest, src, w_px); - return; - default: - LV_ASSERT_FORMAT_MSG(false, "Unsupported color format: %d", color_format); - return; - } - - mask = (1 << px_size) - 1; /*E.g. px_size = 2; mask = 0x03*/ - - for(int32_t i = 0; i < w_px; i++) { - uint8_t val_act = (*src >> shift) & mask; - dest[i] = val_act; - - shift -= px_size; - if(shift < 0) { - shift = 8 - px_size; - src++; - } - } -} - -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header) -{ - lv_result_t res = lv_bin_decoder_info(decoder, dsc, header); - if(res != LV_RESULT_OK) { - return res; - } - - if(!IS_CONV_INDEX_FORMAT(header->cf)) { - return LV_RESULT_INVALID; - } - - if(header->flags & LV_IMAGE_FLAGS_COMPRESSED) { - LV_LOG_WARN("NOT Supported compressed index format: %d", header->cf); - return LV_RESULT_INVALID; - } - - header->cf = DEST_IMG_FORMAT; - return LV_RESULT_OK; -} - -static lv_result_t decoder_open_variable(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); /*Unused*/ - - lv_draw_buf_t src_img_buf; - lv_draw_buf_from_image(&src_img_buf, dsc->src); - - /* Since dsc->header.cf is uniformly set to I8, - * the original format is obtained from src for conversion. - */ - lv_color_format_t src_cf = src_img_buf.header.cf; - - int32_t width = dsc->header.w; - int32_t height = dsc->header.h; - - /* create draw buf */ - lv_draw_buf_t * draw_buf = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, width, height, DEST_IMG_FORMAT, - LV_STRIDE_AUTO); - if(draw_buf == NULL) { - return LV_RESULT_INVALID; - } - - lv_draw_buf_clear(draw_buf, NULL); - dsc->decoded = draw_buf; - - uint32_t src_stride = image_stride(&src_img_buf.header); - uint32_t dest_stride = draw_buf->header.stride; - - /*In case of uncompressed formats the image stored in the ROM/RAM. - *So simply give its pointer*/ - const uint8_t * src = ((lv_image_dsc_t *)dsc->src)->data; - uint8_t * dest = draw_buf->data; - - /* index format only */ - uint32_t palette_size = LV_COLOR_INDEXED_PALETTE_SIZE(src_cf); - LV_ASSERT(palette_size > 0); - - uint32_t palette_size_bytes = palette_size * sizeof(lv_color32_t); - - /* copy palette */ - lv_memcpy(dest, src, palette_size_bytes); - - if(dsc->args.premultiply) { - /* pre-multiply palette */ - image_color32_pre_mul((lv_color32_t *)dest, palette_size); - draw_buf->header.flags |= LV_IMAGE_FLAGS_PREMULTIPLIED; - } - - /* move to index image map */ - src += palette_size_bytes; - dest += DEST_IMG_OFFSET; - - /* copy index image */ - for(int32_t y = 0; y < height; y++) { - image_decode_to_index8_line(dest, src, width, src_cf); - src += src_stride; - dest += dest_stride; - } - - return LV_RESULT_OK; -} - -static lv_result_t decoder_open_file(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); /*Unused*/ - - uint32_t width = dsc->header.w; - uint32_t height = dsc->header.h; - const char * path = dsc->src; - uint8_t * src_temp = NULL; - - lv_fs_file_t file; - lv_fs_res_t res = lv_fs_open(&file, path, LV_FS_MODE_RD); - if(res != LV_FS_RES_OK) { - LV_LOG_ERROR("open %s failed", path); - return LV_RESULT_INVALID; - } - - /* get real src header */ - lv_image_header_t src_header; - uint32_t header_br = 0; - res = lv_fs_read(&file, &src_header, sizeof(src_header), &header_br); - if(res != LV_FS_RES_OK || header_br != sizeof(src_header)) { - LV_LOG_ERROR("read %s lv_image_header_t failed", path); - lv_fs_close(&file); - return LV_RESULT_INVALID; - } - - lv_draw_buf_t * draw_buf = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, width, height, DEST_IMG_FORMAT, - LV_STRIDE_AUTO); - if(draw_buf == NULL) { - lv_fs_close(&file); - return LV_RESULT_INVALID; - } - - lv_draw_buf_clear(draw_buf, NULL); - - /* get stride */ - uint32_t src_stride = image_stride(&src_header); - uint32_t dest_stride = draw_buf->header.stride; - - dsc->decoded = draw_buf; - uint8_t * dest = draw_buf->data; - - /* index format only */ - uint32_t palette_size = LV_COLOR_INDEXED_PALETTE_SIZE(src_header.cf); - if(palette_size == 0) { - LV_LOG_ERROR("file %s invalid palette size: %" LV_PRIu32, path, palette_size); - goto failed; - } - - uint32_t palette_size_bytes = palette_size * sizeof(lv_color32_t); - - /* read palette */ - uint32_t palette_br = 0; - res = lv_fs_read(&file, dest, palette_size_bytes, &palette_br); - if(res != LV_FS_RES_OK || palette_br != palette_size_bytes) { - LV_LOG_ERROR("read %s (palette: %" LV_PRIu32 ", br: %" LV_PRIu32 ") failed", - path, palette_size_bytes, palette_br); - goto failed; - } - - if(dsc->args.premultiply) { - /* pre-multiply palette */ - image_color32_pre_mul((lv_color32_t *)dest, palette_size); - draw_buf->header.flags |= LV_IMAGE_FLAGS_PREMULTIPLIED; - } - - src_temp = lv_malloc(src_stride); - if(src_temp == NULL) { - LV_LOG_ERROR("malloc src_temp failed"); - goto failed; - } - - /* move to index image map */ - dest += DEST_IMG_OFFSET; - - for(uint32_t y = 0; y < height; y++) { - uint32_t br = 0; - res = lv_fs_read(&file, src_temp, src_stride, &br); - if(res != LV_FS_RES_OK || br != src_stride) { - LV_LOG_ERROR("read %s (y: %" LV_PRIu32 ", src_stride: %" LV_PRIu32 ", br: %" LV_PRIu32 ") failed", - path, y, src_stride, br); - goto failed; - } - - /* convert to index8 */ - image_decode_to_index8_line(dest, src_temp, width, src_header.cf); - dest += dest_stride; - } - - lv_free(src_temp); - - lv_fs_close(&file); - return LV_RESULT_OK; - -failed: - if(src_temp) { - lv_free(src_temp); - } - lv_fs_close(&file); - lv_draw_buf_destroy(draw_buf); - dsc->decoded = NULL; - - return LV_RESULT_INVALID; -} - -/** - * Decode an image using the vg_lite gpu. - * @param decoder pointer to the decoder - * @param dsc pointer to the decoder descriptor - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't open the image - */ -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - lv_result_t res = LV_RESULT_INVALID; - - switch(dsc->src_type) { - case LV_IMAGE_SRC_VARIABLE: - res = decoder_open_variable(decoder, dsc); - break; - case LV_IMAGE_SRC_FILE: - res = decoder_open_file(decoder, dsc); - break; - default: - break; - } - - if(dsc->args.no_cache) return res; - - /*If the image cache is disabled, just return the decoded image*/ - if(!lv_image_cache_is_enabled()) return res; - - /*Add the decoded image to the cache*/ - if(res == LV_RESULT_OK) { - lv_image_cache_data_t search_key; - search_key.src_type = dsc->src_type; - search_key.src = dsc->src; - search_key.slot.size = dsc->decoded->data_size; - - lv_cache_entry_t * entry = lv_image_decoder_add_to_cache(decoder, &search_key, dsc->decoded, NULL); - - if(entry == NULL) { - lv_draw_buf_destroy((lv_draw_buf_t *)dsc->decoded); - dsc->decoded = NULL; - return LV_RESULT_INVALID; - } - dsc->cache_entry = entry; - } - - return res; -} - -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); /*Unused*/ - - if(dsc->args.no_cache || !lv_image_cache_is_enabled()) lv_draw_buf_destroy((lv_draw_buf_t *)dsc->decoded); -} - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_decoder.h b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_decoder.h deleted file mode 100644 index 9bab540..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_decoder.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @file lv_vg_lite_decoder.h - * - */ - -#ifndef LV_VG_LITE_DECODER_H -#define LV_VG_LITE_DECODER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../lv_image_decoder.h" - -#if LV_USE_DRAW_VG_LITE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_vg_lite_decoder_init(void); - -void lv_vg_lite_decoder_deinit(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_VG_LITE_DECODER_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_grad.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_grad.c deleted file mode 100644 index 5158d05..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_grad.c +++ /dev/null @@ -1,687 +0,0 @@ -/** - * @file lv_vg_lite_grad.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../lv_draw_vector_private.h" -#include "lv_vg_lite_grad.h" - -#if LV_USE_DRAW_VG_LITE && LV_USE_VECTOR_GRAPHIC - -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_pending.h" -#include "lv_vg_lite_math.h" -#include "../../misc/lv_types.h" -#include "../../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ - -#define SQUARE(x) ((x)*(x)) - -#ifndef M_PI - #define M_PI 3.1415926f -#endif - -/********************** - * TYPEDEFS - **********************/ - -typedef enum { - GRAD_TYPE_UNKNOWN, - GRAD_TYPE_LINEAR, - GRAD_TYPE_LINEAR_EXT, - GRAD_TYPE_RADIAL, -} grad_type_t; - -typedef struct { - grad_type_t type; - lv_vector_gradient_t lv; - union { - vg_lite_linear_gradient_t linear; - vg_lite_ext_linear_gradient_t linear_ext; - vg_lite_radial_gradient_t radial; - } vg; -} grad_item_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static grad_item_t * grad_get(struct lv_draw_vg_lite_unit_t * u, const lv_vector_gradient_t * grad); -static void grad_cache_release_cb(void * entry, void * user_data); -static bool grad_create_cb(grad_item_t * item, void * user_data); -static void grad_free_cb(grad_item_t * item, void * user_data); -static lv_cache_compare_res_t grad_compare_cb(const grad_item_t * lhs, const grad_item_t * rhs); - -static grad_type_t lv_grad_style_to_type(lv_vector_gradient_style_t style); -static void grad_point_to_matrix(vg_lite_matrix_t * grad_matrix, float x1, float y1, float x2, float y2); -static vg_lite_gradient_spreadmode_t lv_spread_to_vg(lv_vector_gradient_spread_t spread); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_vg_lite_grad_init(struct lv_draw_vg_lite_unit_t * u, uint32_t cache_cnt) -{ - LV_ASSERT_NULL(u); - - lv_cache_ops_t ops = { - .compare_cb = (lv_cache_compare_cb_t)grad_compare_cb, - .create_cb = (lv_cache_create_cb_t)grad_create_cb, - .free_cb = (lv_cache_free_cb_t)grad_free_cb, - }; - - u->grad_cache = lv_cache_create(&lv_cache_class_lru_rb_count, sizeof(grad_item_t), cache_cnt, ops); - lv_cache_set_name(u->grad_cache, "VG_GRAD"); - u->grad_pending = lv_vg_lite_pending_create(sizeof(lv_cache_entry_t *), 4); - lv_vg_lite_pending_set_free_cb(u->grad_pending, grad_cache_release_cb, u->grad_cache); -} - -void lv_vg_lite_grad_deinit(struct lv_draw_vg_lite_unit_t * u) -{ - LV_ASSERT_NULL(u); - LV_ASSERT_NULL(u->grad_pending) - lv_vg_lite_pending_destroy(u->grad_pending); - u->grad_pending = NULL; - lv_cache_destroy(u->grad_cache, NULL); - u->grad_cache = NULL; -} - -bool lv_vg_lite_draw_grad( - struct lv_draw_vg_lite_unit_t * u, - vg_lite_buffer_t * buffer, - vg_lite_path_t * path, - const lv_vector_gradient_t * grad, - const vg_lite_matrix_t * grad_matrix, - const vg_lite_matrix_t * matrix, - vg_lite_fill_t fill, - vg_lite_blend_t blend) -{ - LV_ASSERT_NULL(u); - LV_VG_LITE_ASSERT_DEST_BUFFER(buffer); - LV_VG_LITE_ASSERT_PATH(path); - LV_ASSERT_NULL(grad); - LV_VG_LITE_ASSERT_MATRIX(grad_matrix); - LV_VG_LITE_ASSERT_MATRIX(matrix); - - /* check radial gradient is supported */ - if(grad->style == LV_VECTOR_GRADIENT_STYLE_RADIAL) { - if(!vg_lite_query_feature(gcFEATURE_BIT_VG_RADIAL_GRADIENT)) { - LV_LOG_INFO("radial gradient is not supported"); - return false; - } - - /* check if the radius is valid */ - if(grad->cr <= 0) { - LV_LOG_INFO("radius: %f is not valid", grad->cr); - return false; - } - } - - /* check spread mode is supported */ - if(grad->spread == LV_VECTOR_GRADIENT_SPREAD_REPEAT || grad->spread == LV_VECTOR_GRADIENT_SPREAD_REFLECT) { - if(!vg_lite_query_feature(gcFEATURE_BIT_VG_IM_REPEAT_REFLECT)) { - LV_LOG_INFO("repeat/reflect spread(%d) is not supported", grad->spread); - return false; - } - } - - LV_PROFILER_BEGIN_TAG("grad_get"); - grad_item_t * grad_item = grad_get(u, grad); - LV_PROFILER_END_TAG("grad_get"); - if(!grad_item) { - LV_LOG_WARN("Failed to get gradient, style: %d", grad->style); - return false; - } - LV_ASSERT(grad_item->lv.style == grad->style); - - switch(grad_item->type) { - case GRAD_TYPE_LINEAR: { - vg_lite_linear_gradient_t * linear_grad = &grad_item->vg.linear; - vg_lite_matrix_t * grad_mat_p = vg_lite_get_grad_matrix(linear_grad); - LV_ASSERT_NULL(grad_mat_p); - vg_lite_identity(grad_mat_p); - lv_vg_lite_matrix_multiply(grad_mat_p, grad_matrix); - grad_point_to_matrix(grad_mat_p, grad->x1, grad->y1, grad->x2, grad->y2); - - LV_VG_LITE_ASSERT_SRC_BUFFER(&linear_grad->image); - - LV_PROFILER_BEGIN_TAG("vg_lite_draw_grad"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw_grad( - buffer, - path, - fill, - (vg_lite_matrix_t *)matrix, - linear_grad, - blend)); - LV_PROFILER_END_TAG("vg_lite_draw_grad"); - } - break; - case GRAD_TYPE_LINEAR_EXT: { - vg_lite_ext_linear_gradient_t * linear_grad = &grad_item->vg.linear_ext; - vg_lite_matrix_t * grad_mat_p = vg_lite_get_linear_grad_matrix(linear_grad); - LV_ASSERT_NULL(grad_mat_p); - *grad_mat_p = *grad_matrix; - - LV_VG_LITE_ASSERT_SRC_BUFFER(&linear_grad->image); - - LV_PROFILER_BEGIN_TAG("vg_lite_draw_linear_grad"); - LV_VG_LITE_CHECK_ERROR(vg_lite_draw_linear_grad( - buffer, - path, - fill, - (vg_lite_matrix_t *)matrix, - linear_grad, - 0, - blend, - VG_LITE_FILTER_LINEAR)); - LV_PROFILER_END_TAG("vg_lite_draw_linear_grad"); - } - break; - - case GRAD_TYPE_RADIAL: { - vg_lite_radial_gradient_t * radial = &grad_item->vg.radial; - vg_lite_matrix_t * grad_mat_p = vg_lite_get_radial_grad_matrix(radial); - LV_ASSERT_NULL(grad_mat_p); - *grad_mat_p = *grad_matrix; - - LV_VG_LITE_ASSERT_SRC_BUFFER(&grad_item->vg.radial.image); - - LV_PROFILER_BEGIN_TAG("vg_lite_draw_radial_grad"); - LV_VG_LITE_CHECK_ERROR( - vg_lite_draw_radial_grad( - buffer, - path, - fill, - (vg_lite_matrix_t *)matrix, - &grad_item->vg.radial, - 0, - blend, - VG_LITE_FILTER_LINEAR)); - LV_PROFILER_END_TAG("vg_lite_draw_radial_grad"); - } - break; - - default: - LV_LOG_ERROR("Unsupported gradient type: %d", grad_item->type); - return false; - } - - return true; -} - -bool lv_vg_lite_draw_grad_helper( - struct lv_draw_vg_lite_unit_t * u, - vg_lite_buffer_t * buffer, - vg_lite_path_t * path, - const lv_area_t * area, - const lv_grad_dsc_t * grad_dsc, - const vg_lite_matrix_t * matrix, - vg_lite_fill_t fill, - vg_lite_blend_t blend) -{ - LV_ASSERT_NULL(u); - LV_VG_LITE_ASSERT_DEST_BUFFER(buffer); - LV_VG_LITE_ASSERT_PATH(path); - LV_ASSERT_NULL(area); - LV_ASSERT_NULL(grad_dsc); - LV_VG_LITE_ASSERT_MATRIX(matrix); - - lv_vector_gradient_t grad; - lv_memzero(&grad, sizeof(grad)); - - grad.style = LV_VECTOR_GRADIENT_STYLE_LINEAR; - grad.stops_count = grad_dsc->stops_count; - lv_memcpy(grad.stops, grad_dsc->stops, sizeof(lv_gradient_stop_t) * grad_dsc->stops_count); - - /*convert to spread mode*/ -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - switch(grad_dsc->extend) { - case LV_GRAD_EXTEND_PAD: - grad.spread = LV_VECTOR_GRADIENT_SPREAD_PAD; - break; - case LV_GRAD_EXTEND_REPEAT: - grad.spread = LV_VECTOR_GRADIENT_SPREAD_REPEAT; - break; - case LV_GRAD_EXTEND_REFLECT: - grad.spread = LV_VECTOR_GRADIENT_SPREAD_REFLECT; - break; - default: - LV_LOG_WARN("Unsupported gradient extend mode: %d", grad_dsc->extend); - grad.spread = LV_VECTOR_GRADIENT_SPREAD_PAD; - break; - } -#else - grad.spread = LV_VECTOR_GRADIENT_SPREAD_PAD; -#endif - - switch(grad_dsc->dir) { - case LV_GRAD_DIR_VER: - grad.x1 = area->x1; - grad.y1 = area->y1; - grad.x2 = area->x1; - grad.y2 = area->y2 + 1; - break; - - case LV_GRAD_DIR_HOR: - grad.x1 = area->x1; - grad.y1 = area->y1; - grad.x2 = area->x2 + 1; - grad.y2 = area->y1; - break; - -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - case LV_GRAD_DIR_LINEAR: { - int32_t w = lv_area_get_width(area); - int32_t h = lv_area_get_height(area); - - grad.x1 = lv_pct_to_px(grad_dsc->params.linear.start.x, w) + area->x1; - grad.y1 = lv_pct_to_px(grad_dsc->params.linear.start.y, h) + area->y1; - grad.x2 = lv_pct_to_px(grad_dsc->params.linear.end.x, w) + area->x1; - grad.y2 = lv_pct_to_px(grad_dsc->params.linear.end.y, h) + area->y1; - } - break; - - case LV_GRAD_DIR_RADIAL: { - grad.style = LV_VECTOR_GRADIENT_STYLE_RADIAL; - int32_t w = lv_area_get_width(area); - int32_t h = lv_area_get_height(area); - - grad.cx = lv_pct_to_px(grad_dsc->params.radial.focal.x, w) + area->x1; - grad.cy = lv_pct_to_px(grad_dsc->params.radial.focal.y, h) + area->y1; - int32_t end_extent_x = lv_pct_to_px(grad_dsc->params.radial.end_extent.x, w) + area->x1; - int32_t end_extent_y = lv_pct_to_px(grad_dsc->params.radial.end_extent.y, h) + area->y1; - grad.cr = LV_MAX(end_extent_x - grad.cx, end_extent_y - grad.cy); - } - break; -#endif - - default: - LV_LOG_WARN("Unsupported gradient direction: %d", grad_dsc->dir); - return false; - } - - return lv_vg_lite_draw_grad(u, buffer, path, &grad, matrix, matrix, fill, blend); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static grad_item_t * grad_get(struct lv_draw_vg_lite_unit_t * u, const lv_vector_gradient_t * grad) -{ - LV_ASSERT_NULL(u); - LV_ASSERT_NULL(grad); - - grad_item_t search_key; - lv_memzero(&search_key, sizeof(search_key)); - search_key.type = lv_grad_style_to_type(grad->style); - search_key.lv = *grad; - - lv_cache_entry_t * cache_node_entry = lv_cache_acquire(u->grad_cache, &search_key, NULL); - if(cache_node_entry == NULL) { - /* check if the cache is full */ - size_t free_size = lv_cache_get_free_size(u->grad_cache, NULL); - if(free_size == 0) { - LV_LOG_INFO("grad cache is full, release all pending cache entries"); - lv_vg_lite_finish(u); - } - - cache_node_entry = lv_cache_acquire_or_create(u->grad_cache, &search_key, NULL); - if(cache_node_entry == NULL) { - LV_LOG_ERROR("grad cache creating failed"); - return NULL; - } - } - - /* Add the new entry to the pending list */ - lv_vg_lite_pending_add(u->grad_pending, &cache_node_entry); - - return lv_cache_entry_get_data(cache_node_entry); -} - -static void grad_cache_release_cb(void * entry, void * user_data) -{ - lv_cache_entry_t ** entry_p = entry; - lv_cache_t * cache = user_data; - lv_cache_release(cache, * entry_p, NULL); -} - -static vg_lite_color_ramp_t * grad_create_color_ramp(const lv_vector_gradient_t * grad) -{ - LV_ASSERT_NULL(grad); - - vg_lite_color_ramp_t * color_ramp = lv_malloc(sizeof(vg_lite_color_ramp_t) * grad->stops_count); - LV_ASSERT_MALLOC(color_ramp); - if(!color_ramp) { - LV_LOG_ERROR("malloc failed for color_ramp"); - return NULL; - } - - for(uint16_t i = 0; i < grad->stops_count; i++) { - color_ramp[i].stop = grad->stops[i].frac / 255.0f; - lv_color_t c = grad->stops[i].color; - - color_ramp[i].red = c.red / 255.0f; - color_ramp[i].green = c.green / 255.0f; - color_ramp[i].blue = c.blue / 255.0f; - color_ramp[i].alpha = grad->stops[i].opa / 255.0f; - } - - return color_ramp; -} - -static bool linear_grad_create(grad_item_t * item) -{ - LV_PROFILER_BEGIN; - - vg_lite_error_t err = vg_lite_init_grad(&item->vg.linear); - if(err != VG_LITE_SUCCESS) { - LV_PROFILER_END; - LV_LOG_ERROR("init grad error(%d): %s", (int)err, lv_vg_lite_error_string(err)); - return false; - } - - vg_lite_uint32_t colors[VLC_MAX_GRADIENT_STOPS]; - vg_lite_uint32_t stops[VLC_MAX_GRADIENT_STOPS]; - - /* Gradient setup */ - if(item->lv.stops_count > VLC_MAX_GRADIENT_STOPS) { - LV_LOG_WARN("Gradient stops limited: %d, max: %d", item->lv.stops_count, VLC_MAX_GRADIENT_STOPS); - item->lv.stops_count = VLC_MAX_GRADIENT_STOPS; - } - - for(uint16_t i = 0; i < item->lv.stops_count; i++) { - stops[i] = item->lv.stops[i].frac; - const lv_color_t * c = &item->lv.stops[i].color; - lv_opa_t opa = item->lv.stops[i].opa; - - /* lvgl color -> gradient color */ - lv_color_t grad_color = lv_color_make(c->blue, c->green, c->red); - colors[i] = lv_vg_lite_color(grad_color, opa, true); - } - - LV_VG_LITE_CHECK_ERROR(vg_lite_set_grad(&item->vg.linear, item->lv.stops_count, colors, stops)); - - LV_PROFILER_BEGIN_TAG("vg_lite_update_grad"); - LV_VG_LITE_CHECK_ERROR(vg_lite_update_grad(&item->vg.linear)); - LV_PROFILER_END_TAG("vg_lite_update_grad"); - - LV_PROFILER_END; - return true; -} - -static bool linear_ext_grad_create(grad_item_t * item) -{ - LV_PROFILER_BEGIN; - - if(item->lv.stops_count > VLC_MAX_COLOR_RAMP_STOPS) { - LV_LOG_WARN("Gradient stops limited: %d, max: %d", item->lv.stops_count, VLC_MAX_GRADIENT_STOPS); - item->lv.stops_count = VLC_MAX_COLOR_RAMP_STOPS; - } - - vg_lite_color_ramp_t * color_ramp = grad_create_color_ramp(&item->lv); - if(!color_ramp) { - LV_PROFILER_END; - return false; - } - - const vg_lite_linear_gradient_parameter_t grad_param = { - .X0 = item->lv.x1, - .Y0 = item->lv.y1, - .X1 = item->lv.x2, - .Y1 = item->lv.y2, - }; - - vg_lite_ext_linear_gradient_t linear_grad; - lv_memzero(&linear_grad, sizeof(linear_grad)); - - LV_PROFILER_BEGIN_TAG("vg_lite_set_linear_grad"); - LV_VG_LITE_CHECK_ERROR( - vg_lite_set_linear_grad( - &linear_grad, - item->lv.stops_count, - color_ramp, - grad_param, - lv_spread_to_vg(item->lv.spread), - 1)); - LV_PROFILER_END_TAG("vg_lite_set_linear_grad"); - - LV_PROFILER_BEGIN_TAG("vg_lite_update_linear_grad"); - vg_lite_error_t err = vg_lite_update_linear_grad(&linear_grad); - LV_PROFILER_END_TAG("vg_lite_update_linear_grad"); - if(err == VG_LITE_SUCCESS) { - item->vg.linear_ext = linear_grad; - } - else { - LV_LOG_ERROR("update grad error(%d): %s", (int)err, lv_vg_lite_error_string(err)); - } - - lv_free(color_ramp); - - LV_PROFILER_END; - return err == VG_LITE_SUCCESS; -} - -static bool radial_grad_create(grad_item_t * item) -{ - LV_PROFILER_BEGIN; - - if(item->lv.stops_count > VLC_MAX_COLOR_RAMP_STOPS) { - LV_LOG_WARN("Gradient stops limited: %d, max: %d", item->lv.stops_count, VLC_MAX_GRADIENT_STOPS); - item->lv.stops_count = VLC_MAX_COLOR_RAMP_STOPS; - } - - vg_lite_color_ramp_t * color_ramp = grad_create_color_ramp(&item->lv); - if(!color_ramp) { - LV_PROFILER_END; - return false; - } - - const vg_lite_radial_gradient_parameter_t grad_param = { - .cx = item->lv.cx, - .cy = item->lv.cy, - .r = item->lv.cr, - .fx = item->lv.cx, - .fy = item->lv.cy, - }; - - vg_lite_radial_gradient_t radial_grad; - lv_memzero(&radial_grad, sizeof(radial_grad)); - - LV_PROFILER_BEGIN_TAG("vg_lite_set_radial_grad"); - LV_VG_LITE_CHECK_ERROR( - vg_lite_set_radial_grad( - &radial_grad, - item->lv.stops_count, - color_ramp, - grad_param, - lv_spread_to_vg(item->lv.spread), - 1)); - LV_PROFILER_END_TAG("vg_lite_set_radial_grad"); - - LV_PROFILER_BEGIN_TAG("vg_lite_update_radial_grad"); - vg_lite_error_t err = vg_lite_update_radial_grad(&radial_grad); - LV_PROFILER_END_TAG("vg_lite_update_radial_grad"); - if(err == VG_LITE_SUCCESS) { - item->vg.radial = radial_grad; - } - else { - LV_LOG_ERROR("update radial grad error(%d): %s", (int)err, lv_vg_lite_error_string(err)); - } - - lv_free(color_ramp); - - LV_PROFILER_END; - return err == VG_LITE_SUCCESS; -} - -static grad_type_t lv_grad_style_to_type(lv_vector_gradient_style_t style) -{ - if(style == LV_VECTOR_GRADIENT_STYLE_LINEAR) { - return vg_lite_query_feature(gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT) ? GRAD_TYPE_LINEAR_EXT : GRAD_TYPE_LINEAR; - } - - if(style == LV_VECTOR_GRADIENT_STYLE_RADIAL) { - return GRAD_TYPE_RADIAL; - } - - LV_LOG_WARN("unknown gradient style: %d", style); - return GRAD_TYPE_UNKNOWN; -} - -static void grad_point_to_matrix(vg_lite_matrix_t * grad_matrix, float x1, float y1, float x2, float y2) -{ - vg_lite_translate(x1, y1, grad_matrix); - - float angle = atan2f(y2 - y1, x2 - x1) * 180.0f / (float)M_PI; - vg_lite_rotate(angle, grad_matrix); - float length = sqrtf(SQUARE(x2 - x1) + SQUARE(y2 - y1)); - vg_lite_scale(length / 256.0f, 1, grad_matrix); -} - -static vg_lite_gradient_spreadmode_t lv_spread_to_vg(lv_vector_gradient_spread_t spread) -{ - switch(spread) { - case LV_VECTOR_GRADIENT_SPREAD_PAD: - return VG_LITE_GRADIENT_SPREAD_PAD; - case LV_VECTOR_GRADIENT_SPREAD_REPEAT: - return VG_LITE_GRADIENT_SPREAD_REPEAT; - case LV_VECTOR_GRADIENT_SPREAD_REFLECT: - return VG_LITE_GRADIENT_SPREAD_REFLECT; - default: - LV_LOG_WARN("unknown spread mode: %d", spread); - break; - } - - return VG_LITE_GRADIENT_SPREAD_FILL; -} - -static bool grad_create_cb(grad_item_t * item, void * user_data) -{ - LV_UNUSED(user_data); - item->type = lv_grad_style_to_type(item->lv.style); - switch(item->type) { - case GRAD_TYPE_LINEAR: - return linear_grad_create(item); - - case GRAD_TYPE_LINEAR_EXT: - return linear_ext_grad_create(item); - - case GRAD_TYPE_RADIAL: - return radial_grad_create(item); - - default: - LV_LOG_ERROR("unknown gradient type: %d", item->type); - break; - } - - return false; -} - -static void grad_free_cb(grad_item_t * item, void * user_data) -{ - LV_UNUSED(user_data); - switch(item->type) { - case GRAD_TYPE_LINEAR: - LV_VG_LITE_CHECK_ERROR(vg_lite_clear_grad(&item->vg.linear)); - break; - - case GRAD_TYPE_LINEAR_EXT: - LV_VG_LITE_CHECK_ERROR(vg_lite_clear_linear_grad(&item->vg.linear_ext)); - break; - - case GRAD_TYPE_RADIAL: - LV_VG_LITE_CHECK_ERROR(vg_lite_clear_radial_grad(&item->vg.radial)); - break; - - default: - LV_LOG_ERROR("unknown gradient type: %d", item->type); - break; - } -} - -static lv_cache_compare_res_t grad_compare_cb(const grad_item_t * lhs, const grad_item_t * rhs) -{ - /* compare type first */ - if(lhs->type != rhs->type) { - return lhs->type > rhs->type ? 1 : -1; - } - - /* compare spread mode */ - if(lhs->lv.spread != rhs->lv.spread) { - return lhs->lv.spread > rhs->lv.spread ? 1 : -1; - } - - /* compare gradient parameters */ - switch(lhs->type) { - case GRAD_TYPE_LINEAR: - /* no extra compare needed */ - break; - - case GRAD_TYPE_LINEAR_EXT: - if(!math_equal(lhs->lv.x1, rhs->lv.x1)) { - return lhs->lv.x1 > rhs->lv.x1 ? 1 : -1; - } - - if(!math_equal(lhs->lv.y1, rhs->lv.y1)) { - return lhs->lv.y1 > rhs->lv.y1 ? 1 : -1; - } - - if(!math_equal(lhs->lv.x2, rhs->lv.x2)) { - return lhs->lv.x2 > rhs->lv.x2 ? 1 : -1; - } - - if(!math_equal(lhs->lv.y2, rhs->lv.y2)) { - return lhs->lv.y2 > rhs->lv.y2 ? 1 : -1; - } - break; - - case GRAD_TYPE_RADIAL: - if(!math_equal(lhs->lv.cx, rhs->lv.cx)) { - return lhs->lv.cx > rhs->lv.cx ? 1 : -1; - } - - if(!math_equal(lhs->lv.cy, rhs->lv.cy)) { - return lhs->lv.cy > rhs->lv.cy ? 1 : -1; - } - - if(!math_equal(lhs->lv.cr, rhs->lv.cr)) { - return lhs->lv.cr > rhs->lv.cr ? 1 : -1; - } - break; - - default: - LV_LOG_ERROR("unknown gradient type: %d", lhs->type); - break; - } - - /* compare stops count and stops */ - if(lhs->lv.stops_count != rhs->lv.stops_count) { - return lhs->lv.stops_count > rhs->lv.stops_count ? 1 : -1; - } - - int cmp_res = lv_memcmp(lhs->lv.stops, rhs->lv.stops, - sizeof(lv_gradient_stop_t) * lhs->lv.stops_count); - if(cmp_res != 0) { - return cmp_res > 0 ? 1 : -1; - } - - return 0; -} - -#endif /*LV_USE_DRAW_VG_LITE && LV_USE_VECTOR_GRAPHIC*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_grad.h b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_grad.h deleted file mode 100644 index d8b9d1f..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_grad.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file lv_vg_lite_grad.h - * - */ - -#ifndef LV_VG_LITE_GRAD_H -#define LV_VG_LITE_GRAD_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lvgl.h" - -#if LV_USE_DRAW_VG_LITE && LV_USE_VECTOR_GRAPHIC - -#include "lv_vg_lite_utils.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_vg_lite_grad_init(struct lv_draw_vg_lite_unit_t * u, uint32_t cache_cnt); - -void lv_vg_lite_grad_deinit(struct lv_draw_vg_lite_unit_t * u); - -bool lv_vg_lite_draw_grad( - struct lv_draw_vg_lite_unit_t * u, - vg_lite_buffer_t * buffer, - vg_lite_path_t * path, - const lv_vector_gradient_t * grad, - const vg_lite_matrix_t * grad_matrix, - const vg_lite_matrix_t * matrix, - vg_lite_fill_t fill, - vg_lite_blend_t blend); - -bool lv_vg_lite_draw_grad_helper( - struct lv_draw_vg_lite_unit_t * u, - vg_lite_buffer_t * buffer, - vg_lite_path_t * path, - const lv_area_t * area, - const lv_grad_dsc_t * grad_dsc, - const vg_lite_matrix_t * matrix, - vg_lite_fill_t fill, - vg_lite_blend_t blend); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE && LV_USE_VECTOR_GRAPHIC*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_VG_LITE_GRAD_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_math.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_math.c deleted file mode 100644 index 52b4bb9..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_math.c +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file lv_vg_lite_math.h - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_vg_lite_math.h" - -#if LV_USE_DRAW_VG_LITE - -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -float math_fast_inv_sqrtf(float number) -{ - int32_t i; - float x2, y; - const float threehalfs = 1.5f; - - x2 = number * 0.5f; - y = number; - i = *(int32_t *)&y; /* evil floating point bit level hacking */ - i = 0x5f3759df /* floating-point representation of an approximation of {\sqrt {2^{127}}}} see https://en.wikipedia.org/wiki/Fast_inverse_square_root. */ - - (i >> - 1); - y = *(float *)&i; - y = y * (threehalfs - (x2 * y * y)); /* 1st iteration */ - - return y; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_math.h b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_math.h deleted file mode 100644 index 3b4b45d..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_math.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file lv_vg_lite_math.h - * - */ - -#ifndef LV_VG_LITE_MATH_H -#define LV_VG_LITE_MATH_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" - -#if LV_USE_DRAW_VG_LITE - -#include -#include -#include - -/********************* - * DEFINES - *********************/ - -#define MATH_PI 3.14159265358979323846f -#define MATH_HALF_PI 1.57079632679489661923f -#define MATH_TWO_PI 6.28318530717958647692f -#define DEG_TO_RAD 0.017453292519943295769236907684886f -#define RAD_TO_DEG 57.295779513082320876798154814105f - -#define MATH_TANF(x) tanf(x) -#define MATH_SINF(x) sinf(x) -#define MATH_COSF(x) cosf(x) -#define MATH_ASINF(x) asinf(x) -#define MATH_FABSF(x) fabsf(x) -#define MATH_SQRTF(x) sqrtf(x) - -#define MATH_RADIANS(deg) ((deg) * DEG_TO_RAD) -#define MATH_DEGREES(rad) ((rad) * RAD_TO_DEG) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -static inline bool math_zero(float a) -{ - return (MATH_FABSF(a) < FLT_EPSILON); -} - -static inline bool math_equal(float a, float b) -{ - return math_zero(a - b); -} - -float math_fast_inv_sqrtf(float number); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_VG_LITE_MATH_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_path.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_path.c deleted file mode 100644 index 9a9346b..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_path.c +++ /dev/null @@ -1,647 +0,0 @@ -/** - * @file lv_vg_lite_path.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_vg_lite_path.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_math.h" -#include - -/********************* - * DEFINES - *********************/ - -#define PATH_KAPPA 0.552284f - -/* Magic number from https://spencermortensen.com/articles/bezier-circle/ */ -#define PATH_ARC_MAGIC 0.55191502449351f - -#define SIGN(x) (math_zero(x) ? 0 : ((x) > 0 ? 1 : -1)) - -#define VLC_OP_ARG_LEN(OP, LEN) \ - case VLC_OP_##OP: \ - return (LEN) - -/********************** - * TYPEDEFS - **********************/ - -struct lv_vg_lite_path_t { - vg_lite_path_t base; - vg_lite_matrix_t matrix; - size_t mem_size; - uint8_t format_len; - bool has_transform; -}; - -typedef struct { - float min_x; - float min_y; - float max_x; - float max_y; -} lv_vg_lite_path_bounds_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_vg_lite_path_init(struct lv_draw_vg_lite_unit_t * unit) -{ - LV_ASSERT_NULL(unit); - unit->global_path = lv_vg_lite_path_create(VG_LITE_FP32); - unit->path_in_use = false; -} - -void lv_vg_lite_path_deinit(struct lv_draw_vg_lite_unit_t * unit) -{ - LV_ASSERT_NULL(unit); - LV_ASSERT(!unit->path_in_use); - lv_vg_lite_path_destroy(unit->global_path); - unit->global_path = NULL; -} - -lv_vg_lite_path_t * lv_vg_lite_path_create(vg_lite_format_t data_format) -{ - LV_PROFILER_BEGIN; - lv_vg_lite_path_t * path = lv_malloc_zeroed(sizeof(lv_vg_lite_path_t)); - LV_ASSERT_MALLOC(path); - path->format_len = lv_vg_lite_path_format_len(data_format); - LV_ASSERT(vg_lite_init_path( - &path->base, - data_format, - VG_LITE_MEDIUM, - 0, - NULL, - 0, 0, 0, 0) - == VG_LITE_SUCCESS); - LV_PROFILER_END; - return path; -} - -void lv_vg_lite_path_destroy(lv_vg_lite_path_t * path) -{ - LV_PROFILER_BEGIN; - LV_ASSERT_NULL(path); - if(path->base.path != NULL) { - lv_free(path->base.path); - path->base.path = NULL; - - /* clear remaining path data */ - LV_VG_LITE_CHECK_ERROR(vg_lite_clear_path(&path->base)); - } - lv_free(path); - LV_PROFILER_END; -} - -lv_vg_lite_path_t * lv_vg_lite_path_get(struct lv_draw_vg_lite_unit_t * unit, vg_lite_format_t data_format) -{ - LV_ASSERT_NULL(unit); - LV_ASSERT_NULL(unit->global_path); - LV_ASSERT(!unit->path_in_use); - lv_vg_lite_path_reset(unit->global_path, data_format); - unit->path_in_use = true; - return unit->global_path; -} - -void lv_vg_lite_path_drop(struct lv_draw_vg_lite_unit_t * unit, lv_vg_lite_path_t * path) -{ - LV_ASSERT_NULL(unit); - LV_ASSERT_NULL(path); - LV_ASSERT(unit->global_path == path); - LV_ASSERT(unit->path_in_use); - unit->path_in_use = false; -} - -void lv_vg_lite_path_reset(lv_vg_lite_path_t * path, vg_lite_format_t data_format) -{ - LV_ASSERT_NULL(path); - path->base.path_length = 0; - path->base.format = data_format; - path->base.quality = VG_LITE_MEDIUM; - path->base.path_type = VG_LITE_DRAW_ZERO; - path->format_len = lv_vg_lite_path_format_len(data_format); - path->has_transform = false; -} - -vg_lite_path_t * lv_vg_lite_path_get_path(lv_vg_lite_path_t * path) -{ - LV_ASSERT_NULL(path); - return &path->base; -} - -void lv_vg_lite_path_set_bonding_box(lv_vg_lite_path_t * path, - float min_x, float min_y, - float max_x, float max_y) -{ - LV_ASSERT_NULL(path); - path->base.bounding_box[0] = min_x; - path->base.bounding_box[1] = min_y; - path->base.bounding_box[2] = max_x; - path->base.bounding_box[3] = max_y; -} - -void lv_vg_lite_path_set_bonding_box_area(lv_vg_lite_path_t * path, const lv_area_t * area) -{ - LV_ASSERT_NULL(path); - LV_ASSERT_NULL(area); - lv_vg_lite_path_set_bonding_box(path, area->x1, area->y1, area->x2 + 1, area->y2 + 1); -} - -void lv_vg_lite_path_get_bonding_box(lv_vg_lite_path_t * path, - float * min_x, float * min_y, - float * max_x, float * max_y) -{ - LV_ASSERT_NULL(path); - if(min_x) *min_x = path->base.bounding_box[0]; - if(min_y) *min_y = path->base.bounding_box[1]; - if(max_x) *max_x = path->base.bounding_box[2]; - if(max_y) *max_y = path->base.bounding_box[3]; -} - -static void path_bounds_iter_cb(void * user_data, uint8_t op_code, const float * data, uint32_t len) -{ - LV_UNUSED(op_code); - - if(len == 0) { - return; - } - - typedef struct { - float x; - float y; - } point_t; - - const int pt_len = sizeof(point_t) / sizeof(float); - - LV_ASSERT(len % pt_len == 0); - - const point_t * pt = (point_t *)data; - len /= pt_len; - - lv_vg_lite_path_bounds_t * bounds = user_data; - - for(uint32_t i = 0; i < len; i++) { - if(pt[i].x < bounds->min_x) bounds->min_x = pt[i].x; - if(pt[i].y < bounds->min_y) bounds->min_y = pt[i].y; - if(pt[i].x > bounds->max_x) bounds->max_x = pt[i].x; - if(pt[i].y > bounds->max_y) bounds->max_y = pt[i].y; - } -} - -bool lv_vg_lite_path_update_bonding_box(lv_vg_lite_path_t * path) -{ - LV_ASSERT_NULL(path); - - if(!path->format_len) { - return false; - } - - LV_PROFILER_BEGIN; - - lv_vg_lite_path_bounds_t bounds; - - /* init bounds */ - bounds.min_x = FLT_MAX; - bounds.min_y = FLT_MAX; - bounds.max_x = FLT_MIN; - bounds.max_y = FLT_MIN; - - /* calc bounds */ - lv_vg_lite_path_for_each_data(lv_vg_lite_path_get_path(path), path_bounds_iter_cb, &bounds); - - /* set bounds */ - lv_vg_lite_path_set_bonding_box(path, bounds.min_x, bounds.min_y, bounds.max_x, bounds.max_y); - - LV_PROFILER_END; - - return true; -} - -void lv_vg_lite_path_set_transform(lv_vg_lite_path_t * path, const vg_lite_matrix_t * matrix) -{ - LV_ASSERT_NULL(path); - if(matrix) { - path->matrix = *matrix; - } - - path->has_transform = matrix ? true : false; -} - -void lv_vg_lite_path_set_quality(lv_vg_lite_path_t * path, vg_lite_quality_t quality) -{ - LV_ASSERT_NULL(path); - path->base.quality = quality; -} - -static void lv_vg_lite_path_append_data(lv_vg_lite_path_t * path, const void * data, size_t len) -{ - LV_ASSERT_NULL(path); - LV_ASSERT_NULL(data); - - if(path->base.path_length + len > path->mem_size) { - if(path->mem_size == 0) { - path->mem_size = len; - } - else { - path->mem_size *= 2; - } - path->base.path = lv_realloc(path->base.path, path->mem_size); - LV_ASSERT_MALLOC(path->base.path); - } - - lv_memcpy((uint8_t *)path->base.path + path->base.path_length, data, len); - path->base.path_length += len; -} - -static void lv_vg_lite_path_append_op(lv_vg_lite_path_t * path, uint32_t op) -{ - lv_vg_lite_path_append_data(path, &op, path->format_len); -} - -static void lv_vg_lite_path_append_point(lv_vg_lite_path_t * path, float x, float y) -{ - if(path->has_transform) { - LV_VG_LITE_ASSERT_MATRIX(&path->matrix); - /* transform point */ - float ori_x = x; - float ori_y = y; - x = ori_x * path->matrix.m[0][0] + ori_y * path->matrix.m[0][1] + path->matrix.m[0][2]; - y = ori_x * path->matrix.m[1][0] + ori_y * path->matrix.m[1][1] + path->matrix.m[1][2]; - } - - if(path->base.format == VG_LITE_FP32) { - lv_vg_lite_path_append_data(path, &x, sizeof(x)); - lv_vg_lite_path_append_data(path, &y, sizeof(y)); - return; - } - - int32_t ix = (int32_t)(x); - int32_t iy = (int32_t)(y); - lv_vg_lite_path_append_data(path, &ix, path->format_len); - lv_vg_lite_path_append_data(path, &iy, path->format_len); -} - -void lv_vg_lite_path_move_to(lv_vg_lite_path_t * path, - float x, float y) -{ - LV_ASSERT_NULL(path); - lv_vg_lite_path_append_op(path, VLC_OP_MOVE); - lv_vg_lite_path_append_point(path, x, y); -} - -void lv_vg_lite_path_line_to(lv_vg_lite_path_t * path, - float x, float y) -{ - LV_ASSERT_NULL(path); - lv_vg_lite_path_append_op(path, VLC_OP_LINE); - lv_vg_lite_path_append_point(path, x, y); -} - -void lv_vg_lite_path_quad_to(lv_vg_lite_path_t * path, - float cx, float cy, - float x, float y) -{ - LV_ASSERT_NULL(path); - lv_vg_lite_path_append_op(path, VLC_OP_QUAD); - lv_vg_lite_path_append_point(path, cx, cy); - lv_vg_lite_path_append_point(path, x, y); -} - -void lv_vg_lite_path_cubic_to(lv_vg_lite_path_t * path, - float cx1, float cy1, - float cx2, float cy2, - float x, float y) -{ - LV_ASSERT_NULL(path); - lv_vg_lite_path_append_op(path, VLC_OP_CUBIC); - lv_vg_lite_path_append_point(path, cx1, cy1); - lv_vg_lite_path_append_point(path, cx2, cy2); - lv_vg_lite_path_append_point(path, x, y); -} - -void lv_vg_lite_path_close(lv_vg_lite_path_t * path) -{ - LV_ASSERT_NULL(path); - lv_vg_lite_path_append_op(path, VLC_OP_CLOSE); -} - -void lv_vg_lite_path_end(lv_vg_lite_path_t * path) -{ - LV_ASSERT_NULL(path); - lv_vg_lite_path_append_op(path, VLC_OP_END); - path->base.add_end = 1; -} - -void lv_vg_lite_path_append_rect( - lv_vg_lite_path_t * path, - float x, float y, - float w, float h, - float r) -{ - LV_PROFILER_BEGIN; - const float half_w = w / 2.0f; - const float half_h = h / 2.0f; - - /*clamping cornerRadius by minimum size*/ - const float r_max = LV_MIN(half_w, half_h); - if(r > r_max) - r = r_max; - - /*rectangle*/ - if(r <= 0) { - lv_vg_lite_path_move_to(path, x, y); - lv_vg_lite_path_line_to(path, x + w, y); - lv_vg_lite_path_line_to(path, x + w, y + h); - lv_vg_lite_path_line_to(path, x, y + h); - lv_vg_lite_path_close(path); - LV_PROFILER_END; - return; - } - - /*circle*/ - if(math_equal(r, half_w) && math_equal(r, half_h)) { - lv_vg_lite_path_append_circle(path, x + half_w, y + half_h, r, r); - LV_PROFILER_END; - return; - } - - /* Get the control point offset for rounded cases */ - const float offset = r * PATH_ARC_MAGIC; - - /* Rounded rectangle case */ - /* Starting point */ - lv_vg_lite_path_move_to(path, x + r, y); - - /* Top side */ - lv_vg_lite_path_line_to(path, x + w - r, y); - - /* Top-right corner */ - lv_vg_lite_path_cubic_to(path, x + w - r + offset, y, x + w, y + r - offset, x + w, y + r); - - /* Right side */ - lv_vg_lite_path_line_to(path, x + w, y + h - r); - - /* Bottom-right corner*/ - lv_vg_lite_path_cubic_to(path, x + w, y + h - r + offset, x + w - r + offset, y + h, x + w - r, y + h); - - /* Bottom side */ - lv_vg_lite_path_line_to(path, x + r, y + h); - - /* Bottom-left corner */ - lv_vg_lite_path_cubic_to(path, x + r - offset, y + h, x, y + h - r + offset, x, y + h - r); - - /* Left side*/ - lv_vg_lite_path_line_to(path, x, y + r); - - /* Top-left corner */ - lv_vg_lite_path_cubic_to(path, x, y + r - offset, x + r - offset, y, x + r, y); - - /* Ending point */ - lv_vg_lite_path_close(path); - LV_PROFILER_END; -} - -void lv_vg_lite_path_append_circle( - lv_vg_lite_path_t * path, - float cx, float cy, - float rx, float ry) -{ - LV_PROFILER_BEGIN; - /* https://learn.microsoft.com/zh-cn/xamarin/xamarin-forms/user-interface/graphics/skiasharp/curves/beziers */ - float rx_kappa = rx * PATH_KAPPA; - float ry_kappa = ry * PATH_KAPPA; - - lv_vg_lite_path_move_to(path, cx, cy - ry); - lv_vg_lite_path_cubic_to(path, cx + rx_kappa, cy - ry, cx + rx, cy - ry_kappa, cx + rx, cy); - lv_vg_lite_path_cubic_to(path, cx + rx, cy + ry_kappa, cx + rx_kappa, cy + ry, cx, cy + ry); - lv_vg_lite_path_cubic_to(path, cx - rx_kappa, cy + ry, cx - rx, cy + ry_kappa, cx - rx, cy); - lv_vg_lite_path_cubic_to(path, cx - rx, cy - ry_kappa, cx - rx_kappa, cy - ry, cx, cy - ry); - lv_vg_lite_path_close(path); - LV_PROFILER_END; -} - -void lv_vg_lite_path_append_arc_right_angle(lv_vg_lite_path_t * path, - float start_x, float start_y, - float center_x, float center_y, - float end_x, float end_y) -{ - LV_PROFILER_BEGIN; - float dx1 = center_x - start_x; - float dy1 = center_y - start_y; - float dx2 = end_x - center_x; - float dy2 = end_y - center_y; - - float c = SIGN(dx1 * dy2 - dx2 * dy1) * PATH_ARC_MAGIC; - - lv_vg_lite_path_cubic_to(path, - start_x - c * dy1, start_y + c * dx1, - end_x - c * dy2, end_y + c * dx2, - end_x, end_y); - LV_PROFILER_END; -} - -void lv_vg_lite_path_append_arc(lv_vg_lite_path_t * path, - float cx, float cy, - float radius, - float start_angle, - float sweep, - bool pie) -{ - LV_PROFILER_BEGIN; - /* just circle */ - if(sweep >= 360.0f || sweep <= -360.0f) { - lv_vg_lite_path_append_circle(path, cx, cy, radius, radius); - LV_PROFILER_END; - return; - } - - start_angle = MATH_RADIANS(start_angle); - sweep = MATH_RADIANS(sweep); - - int n_curves = (int)ceil(MATH_FABSF(sweep / MATH_HALF_PI)); - float sweep_sign = sweep < 0 ? -1.f : 1.f; - float fract = fmodf(sweep, MATH_HALF_PI); - fract = (math_zero(fract)) ? MATH_HALF_PI * sweep_sign : fract; - - /* Start from here */ - float start_x = radius * MATH_COSF(start_angle); - float start_y = radius * MATH_SINF(start_angle); - - if(pie) { - lv_vg_lite_path_move_to(path, cx, cy); - lv_vg_lite_path_line_to(path, start_x + cx, start_y + cy); - } - - for(int i = 0; i < n_curves; ++i) { - float end_angle = start_angle + ((i != n_curves - 1) ? MATH_HALF_PI * sweep_sign : fract); - float end_x = radius * MATH_COSF(end_angle); - float end_y = radius * MATH_SINF(end_angle); - - /* variables needed to calculate bezier control points */ - - /** get bezier control points using article: - * (http://itc.ktu.lt/index.php/ITC/article/view/11812/6479) - */ - float ax = start_x; - float ay = start_y; - float bx = end_x; - float by = end_y; - float q1 = ax * ax + ay * ay; - float q2 = ax * bx + ay * by + q1; - float k2 = (4.0f / 3.0f) * ((MATH_SQRTF(2 * q1 * q2) - q2) / (ax * by - ay * bx)); - - /* Next start point is the current end point */ - start_x = end_x; - start_y = end_y; - - end_x += cx; - end_y += cy; - - float ctrl1_x = ax - k2 * ay + cx; - float ctrl1_y = ay + k2 * ax + cy; - float ctrl2_x = bx + k2 * by + cx; - float ctrl2_y = by - k2 * bx + cy; - - lv_vg_lite_path_cubic_to(path, ctrl1_x, ctrl1_y, ctrl2_x, ctrl2_y, end_x, end_y); - start_angle = end_angle; - } - - if(pie) { - lv_vg_lite_path_close(path); - } - - LV_PROFILER_END; -} - -uint8_t lv_vg_lite_vlc_op_arg_len(uint8_t vlc_op) -{ - switch(vlc_op) { - VLC_OP_ARG_LEN(END, 0); - VLC_OP_ARG_LEN(CLOSE, 0); - VLC_OP_ARG_LEN(MOVE, 2); - VLC_OP_ARG_LEN(MOVE_REL, 2); - VLC_OP_ARG_LEN(LINE, 2); - VLC_OP_ARG_LEN(LINE_REL, 2); - VLC_OP_ARG_LEN(QUAD, 4); - VLC_OP_ARG_LEN(QUAD_REL, 4); - VLC_OP_ARG_LEN(CUBIC, 6); - VLC_OP_ARG_LEN(CUBIC_REL, 6); - VLC_OP_ARG_LEN(SCCWARC, 5); - VLC_OP_ARG_LEN(SCCWARC_REL, 5); - VLC_OP_ARG_LEN(SCWARC, 5); - VLC_OP_ARG_LEN(SCWARC_REL, 5); - VLC_OP_ARG_LEN(LCCWARC, 5); - VLC_OP_ARG_LEN(LCCWARC_REL, 5); - VLC_OP_ARG_LEN(LCWARC, 5); - VLC_OP_ARG_LEN(LCWARC_REL, 5); - default: - break; - } - - LV_LOG_ERROR("UNKNOW_VLC_OP: 0x%x", vlc_op); - LV_ASSERT(false); - return 0; -} - -uint8_t lv_vg_lite_path_format_len(vg_lite_format_t format) -{ - switch(format) { - case VG_LITE_S8: - return 1; - case VG_LITE_S16: - return 2; - case VG_LITE_S32: - return 4; - case VG_LITE_FP32: - return 4; - default: - break; - } - - LV_LOG_ERROR("UNKNOW_FORMAT: %d", format); - LV_ASSERT(false); - return 0; -} - -void lv_vg_lite_path_for_each_data(const vg_lite_path_t * path, lv_vg_lite_path_iter_cb_t cb, void * user_data) -{ - LV_ASSERT_NULL(path); - LV_ASSERT_NULL(cb); - - uint8_t fmt_len = lv_vg_lite_path_format_len(path->format); - uint8_t * cur = path->path; - uint8_t * end = cur + path->path_length; - float tmp_data[8]; - - while(cur < end) { - /* get op code */ - uint8_t op_code = VLC_GET_OP_CODE(cur); - - /* get arguments length */ - uint8_t arg_len = lv_vg_lite_vlc_op_arg_len(op_code); - - /* skip op code */ - cur += fmt_len; - - /* print arguments */ - for(uint8_t i = 0; i < arg_len; i++) { - switch(path->format) { - case VG_LITE_S8: - tmp_data[i] = *((int8_t *)cur); - break; - case VG_LITE_S16: - tmp_data[i] = *((int16_t *)cur); - break; - case VG_LITE_S32: - tmp_data[i] = *((int32_t *)cur); - break; - case VG_LITE_FP32: - tmp_data[i] = *((float *)cur); - break; - default: - LV_LOG_ERROR("UNKNOW_FORMAT(%d)", path->format); - LV_ASSERT(false); - break; - } - - cur += fmt_len; - } - - cb(user_data, op_code, tmp_data, arg_len); - } -} - -void lv_vg_lite_path_append_path(lv_vg_lite_path_t * dest, const lv_vg_lite_path_t * src) -{ - LV_ASSERT_NULL(dest); - LV_ASSERT_NULL(src); - - LV_ASSERT(dest->base.format == dest->base.format); - lv_vg_lite_path_append_data(dest, src->base.path, src->base.path_length); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_path.h b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_path.h deleted file mode 100644 index b1ef3f8..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_path.h +++ /dev/null @@ -1,128 +0,0 @@ -/** - * @file lv_vg_lite_path.h - * - */ - -#ifndef LV_VG_LITE_PATH_H -#define LV_VG_LITE_PATH_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_vg_lite_utils.h" - -#if LV_USE_DRAW_VG_LITE - -/********************* - * DEFINES - *********************/ - -typedef struct lv_vg_lite_path_t lv_vg_lite_path_t; -typedef struct lv_draw_vg_lite_unit_t lv_draw_vg_lite_unit_t; - -typedef void (*lv_vg_lite_path_iter_cb_t)(void * user_data, uint8_t op_code, const float * data, uint32_t len); - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_vg_lite_path_init(lv_draw_vg_lite_unit_t * unit); - -void lv_vg_lite_path_deinit(lv_draw_vg_lite_unit_t * unit); - -lv_vg_lite_path_t * lv_vg_lite_path_create(vg_lite_format_t data_format); - -void lv_vg_lite_path_destroy(lv_vg_lite_path_t * path); - -lv_vg_lite_path_t * lv_vg_lite_path_get(lv_draw_vg_lite_unit_t * unit, vg_lite_format_t data_format); - -void lv_vg_lite_path_drop(lv_draw_vg_lite_unit_t * unit, lv_vg_lite_path_t * path); - -void lv_vg_lite_path_reset(lv_vg_lite_path_t * path, vg_lite_format_t data_format); - -void lv_vg_lite_path_set_bonding_box_area(lv_vg_lite_path_t * path, const lv_area_t * area); - -void lv_vg_lite_path_set_bonding_box(lv_vg_lite_path_t * path, - float min_x, float min_y, - float max_x, float max_y); - -void lv_vg_lite_path_get_bonding_box(lv_vg_lite_path_t * path, - float * min_x, float * min_y, - float * max_x, float * max_y); - -bool lv_vg_lite_path_update_bonding_box(lv_vg_lite_path_t * path); - -void lv_vg_lite_path_set_transform(lv_vg_lite_path_t * path, const vg_lite_matrix_t * matrix); - -void lv_vg_lite_path_set_quality(lv_vg_lite_path_t * path, vg_lite_quality_t quality); - -vg_lite_path_t * lv_vg_lite_path_get_path(lv_vg_lite_path_t * path); - -void lv_vg_lite_path_move_to(lv_vg_lite_path_t * path, - float x, float y); - -void lv_vg_lite_path_line_to(lv_vg_lite_path_t * path, - float x, float y); - -void lv_vg_lite_path_quad_to(lv_vg_lite_path_t * path, - float cx, float cy, - float x, float y); - -void lv_vg_lite_path_cubic_to(lv_vg_lite_path_t * path, - float cx1, float cy1, - float cx2, float cy2, - float x, float y); - -void lv_vg_lite_path_close(lv_vg_lite_path_t * path); - -void lv_vg_lite_path_end(lv_vg_lite_path_t * path); - -void lv_vg_lite_path_append_rect(lv_vg_lite_path_t * path, - float x, float y, - float w, float h, - float r); - -void lv_vg_lite_path_append_circle(lv_vg_lite_path_t * path, - float cx, float cy, - float rx, float ry); - -void lv_vg_lite_path_append_arc_right_angle(lv_vg_lite_path_t * path, - float start_x, float start_y, - float center_x, float center_y, - float end_x, float end_y); - -void lv_vg_lite_path_append_arc(lv_vg_lite_path_t * path, - float cx, float cy, - float radius, - float start_angle, - float sweep, - bool pie); - -void lv_vg_lite_path_append_path(lv_vg_lite_path_t * dest, const lv_vg_lite_path_t * src); - -uint8_t lv_vg_lite_vlc_op_arg_len(uint8_t vlc_op); - -uint8_t lv_vg_lite_path_format_len(vg_lite_format_t format); - -void lv_vg_lite_path_for_each_data(const vg_lite_path_t * path, lv_vg_lite_path_iter_cb_t cb, void * user_data); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_VG_LITE_PATH_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_pending.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_pending.c deleted file mode 100644 index b8429f0..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_pending.c +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @file lv_vg_lite_pending.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_vg_lite_pending.h" - -#if LV_USE_DRAW_VG_LITE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_vg_lite_pending_t { - lv_array_t objs; - lv_vg_lite_pending_free_cb_t free_cb; - void * user_data; -}; - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_vg_lite_pending_t * lv_vg_lite_pending_create(size_t obj_size, uint32_t capacity_default) -{ - lv_vg_lite_pending_t * pending = lv_malloc_zeroed(sizeof(lv_vg_lite_pending_t)); - LV_ASSERT_MALLOC(pending); - lv_array_init(&pending->objs, capacity_default, obj_size); - return pending; -} - -void lv_vg_lite_pending_destroy(lv_vg_lite_pending_t * pending) -{ - LV_ASSERT_NULL(pending); - lv_vg_lite_pending_remove_all(pending); - lv_array_deinit(&pending->objs); - lv_memzero(pending, sizeof(lv_vg_lite_pending_t)); - lv_free(pending); -} - -void lv_vg_lite_pending_set_free_cb(lv_vg_lite_pending_t * pending, lv_vg_lite_pending_free_cb_t free_cb, - void * user_data) -{ - LV_ASSERT_NULL(pending); - LV_ASSERT_NULL(free_cb); - pending->free_cb = free_cb; - pending->user_data = user_data; -} - -void lv_vg_lite_pending_add(lv_vg_lite_pending_t * pending, void * obj) -{ - LV_ASSERT_NULL(pending); - LV_ASSERT_NULL(obj); - lv_array_push_back(&pending->objs, obj); -} - -void lv_vg_lite_pending_remove_all(lv_vg_lite_pending_t * pending) -{ - LV_ASSERT_NULL(pending); - LV_ASSERT_NULL(pending->free_cb); - - uint32_t size = lv_array_size(&pending->objs); - if(size == 0) { - return; - } - - /* remove all the pending objects */ - for(uint32_t i = 0; i < size; i++) { - pending->free_cb(lv_array_at(&pending->objs, i), pending->user_data); - } - - lv_array_clear(&pending->objs); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_pending.h b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_pending.h deleted file mode 100644 index bf439b7..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_pending.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file lv_vg_lite_pending.h - * - */ - -#ifndef LV_VG_LITE_PENDING_H -#define LV_VG_LITE_PENDING_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lvgl.h" - -#if LV_USE_DRAW_VG_LITE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct lv_vg_lite_pending_t lv_vg_lite_pending_t; - -typedef void (*lv_vg_lite_pending_free_cb_t)(void * obj, void * user_data); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a pending list - * @param obj_size the size of the objects in the list - * @param capacity_default the default capacity of the list - * @return a pointer to the pending list - */ -lv_vg_lite_pending_t * lv_vg_lite_pending_create(size_t obj_size, uint32_t capacity_default); - -/** - * Destroy a pending list - * @param pending pointer to the pending list - */ -void lv_vg_lite_pending_destroy(lv_vg_lite_pending_t * pending); - -/** - * Set a free callback for the pending list - * @param pending pointer to the pending list - * @param free_cb the free callback - * @param user_data user data to pass to the free callback - */ -void lv_vg_lite_pending_set_free_cb(lv_vg_lite_pending_t * pending, lv_vg_lite_pending_free_cb_t free_cb, - void * user_data); - -/** - * Add an object to the pending list - * @param pending pointer to the pending list - * @param obj pointer to the object to add - */ -void lv_vg_lite_pending_add(lv_vg_lite_pending_t * pending, void * obj); - -/** - * Remove all objects from the pending list - * @param pending pointer to the pending list - */ -void lv_vg_lite_pending_remove_all(lv_vg_lite_pending_t * pending); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_VG_LITE_PENDING_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_stroke.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_stroke.c deleted file mode 100644 index 1b8a202..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_stroke.c +++ /dev/null @@ -1,310 +0,0 @@ -/** - * @file lv_vg_lite_stroke.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_vg_lite_stroke.h" - -#if LV_USE_DRAW_VG_LITE && LV_USE_VECTOR_GRAPHIC - -#include "lv_vg_lite_path.h" -#include "lv_draw_vg_lite_type.h" -#include "lv_vg_lite_math.h" -#include "../lv_draw_vector_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - /* stroke path */ - lv_vg_lite_path_t * path; - - /* stroke parameters */ - float width; - lv_vector_stroke_cap_t cap; - lv_vector_stroke_join_t join; - uint16_t miter_limit; - lv_array_t dash_pattern; -} stroke_item_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static bool stroke_create_cb(stroke_item_t * item, void * user_data); -static void stroke_free_cb(stroke_item_t * item, void * user_data); -static lv_cache_compare_res_t stroke_compare_cb(const stroke_item_t * lhs, const stroke_item_t * rhs); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_vg_lite_stroke_init(struct lv_draw_vg_lite_unit_t * unit, uint32_t cache_cnt) -{ - LV_ASSERT_NULL(unit); - - const lv_cache_ops_t ops = { - .compare_cb = (lv_cache_compare_cb_t)stroke_compare_cb, - .create_cb = (lv_cache_create_cb_t)stroke_create_cb, - .free_cb = (lv_cache_free_cb_t)stroke_free_cb, - }; - - unit->stroke_cache = lv_cache_create(&lv_cache_class_lru_rb_count, sizeof(stroke_item_t), cache_cnt, ops); - lv_cache_set_name(unit->stroke_cache, "VG_STROKE"); -} - -void lv_vg_lite_stroke_deinit(struct lv_draw_vg_lite_unit_t * unit) -{ - LV_ASSERT_NULL(unit); - LV_ASSERT_NULL(unit->stroke_cache); - lv_cache_destroy(unit->stroke_cache, NULL); - unit->stroke_cache = NULL; -} - -static vg_lite_cap_style_t lv_stroke_cap_to_vg(lv_vector_stroke_cap_t cap) -{ - switch(cap) { - case LV_VECTOR_STROKE_CAP_SQUARE: - return VG_LITE_CAP_SQUARE; - case LV_VECTOR_STROKE_CAP_ROUND: - return VG_LITE_CAP_ROUND; - case LV_VECTOR_STROKE_CAP_BUTT: - return VG_LITE_CAP_BUTT; - default: - return VG_LITE_CAP_SQUARE; - } -} - -static vg_lite_join_style_t lv_stroke_join_to_vg(lv_vector_stroke_join_t join) -{ - switch(join) { - case LV_VECTOR_STROKE_JOIN_BEVEL: - return VG_LITE_JOIN_BEVEL; - case LV_VECTOR_STROKE_JOIN_ROUND: - return VG_LITE_JOIN_ROUND; - case LV_VECTOR_STROKE_JOIN_MITER: - return VG_LITE_JOIN_MITER; - default: - return VG_LITE_JOIN_BEVEL; - } -} - -lv_cache_entry_t * lv_vg_lite_stroke_get(struct lv_draw_vg_lite_unit_t * unit, - struct lv_vg_lite_path_t * path, - const lv_vector_stroke_dsc_t * dsc) -{ - LV_ASSERT_NULL(unit); - LV_ASSERT_NULL(path); - LV_ASSERT_NULL(dsc); - - vg_lite_path_t * vg_path = lv_vg_lite_path_get_path(path); - - if(vg_path->format != VG_LITE_FP32) { - LV_LOG_ERROR("only support VG_LITE_FP32 format"); - return NULL; - } - - /* prepare search key */ - stroke_item_t search_key; - lv_memzero(&search_key, sizeof(search_key)); - search_key.cap = dsc->cap; - search_key.join = dsc->join; - search_key.width = dsc->width; - search_key.miter_limit = dsc->miter_limit; - - /* A one-time read-only array that only copies the pointer but not the content */ - search_key.dash_pattern = dsc->dash_pattern; - search_key.path = path; - - lv_cache_entry_t * cache_node_entry = lv_cache_acquire(unit->stroke_cache, &search_key, &search_key); - if(cache_node_entry) { - return cache_node_entry; - } - - cache_node_entry = lv_cache_acquire_or_create(unit->stroke_cache, &search_key, &search_key); - if(cache_node_entry == NULL) { - LV_LOG_ERROR("stroke cache creating failed"); - return NULL; - } - - return cache_node_entry; -} - -struct lv_vg_lite_path_t * lv_vg_lite_stroke_get_path(lv_cache_entry_t * cache_entry) -{ - LV_ASSERT_NULL(cache_entry); - - stroke_item_t * stroke_item = lv_cache_entry_get_data(cache_entry); - LV_ASSERT_NULL(stroke_item); - return stroke_item->path; -} - -void lv_vg_lite_stroke_drop(struct lv_draw_vg_lite_unit_t * unit, - lv_cache_entry_t * cache_entry) -{ - LV_ASSERT_NULL(unit); - LV_ASSERT_NULL(cache_entry); - lv_cache_release(unit->stroke_cache, cache_entry, NULL); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static bool stroke_create_cb(stroke_item_t * item, void * user_data) -{ - LV_ASSERT_NULL(item); - - stroke_item_t * src = user_data; - LV_ASSERT_NULL(src); - - lv_memzero(item, sizeof(stroke_item_t)); - - /* copy path */ - item->path = lv_vg_lite_path_create(VG_LITE_FP32); - lv_vg_lite_path_append_path(item->path, src->path); - - /* copy parameters */ - item->cap = src->cap; - item->join = src->join; - item->width = src->width; - item->miter_limit = src->miter_limit; - - /* copy dash pattern */ - uint32_t size = lv_array_size(&src->dash_pattern); - if(size) { - lv_array_init(&item->dash_pattern, size, sizeof(float)); - lv_array_copy(&item->dash_pattern, &src->dash_pattern); - } - - /* update parameters */ - vg_lite_path_t * vg_path = lv_vg_lite_path_get_path(item->path); - LV_VG_LITE_CHECK_ERROR(vg_lite_set_path_type(vg_path, VG_LITE_DRAW_STROKE_PATH)); - - vg_lite_error_t error = vg_lite_set_stroke( - vg_path, - lv_stroke_cap_to_vg(item->cap), - lv_stroke_join_to_vg(item->join), - item->width, - item->miter_limit, - lv_array_front(&item->dash_pattern), - size, - item->width / 2, - 0); - - if(error != VG_LITE_SUCCESS) { - LV_LOG_ERROR("vg_lite_set_stroke failed: %d(%s)", (int)error, lv_vg_lite_error_string(error)); - stroke_free_cb(item, NULL); - return false; - } - - const vg_lite_pointer * ori_path = vg_path->path; - const vg_lite_uint32_t ori_path_length = vg_path->path_length; - - LV_PROFILER_BEGIN_TAG("vg_lite_update_stroke"); - error = vg_lite_update_stroke(vg_path); - LV_PROFILER_END_TAG("vg_lite_update_stroke"); - - /* check if path is changed */ - LV_ASSERT_MSG(vg_path->path_length == ori_path_length, "vg_path->path_length should not change"); - LV_ASSERT_MSG(vg_path->path == ori_path, "vg_path->path should not change"); - - if(error != VG_LITE_SUCCESS) { - LV_LOG_ERROR("vg_lite_update_stroke failed: %d(%s)", (int)error, lv_vg_lite_error_string(error)); - stroke_free_cb(item, NULL); - return false; - } - - return true; -} - -static void stroke_free_cb(stroke_item_t * item, void * user_data) -{ - LV_UNUSED(user_data); - LV_ASSERT_NULL(item); - - lv_array_deinit(&item->dash_pattern); - lv_vg_lite_path_destroy(item->path); - lv_memzero(item, sizeof(stroke_item_t)); -} - -static lv_cache_compare_res_t path_compare(const vg_lite_path_t * lhs, const vg_lite_path_t * rhs) -{ - LV_VG_LITE_ASSERT_PATH(lhs); - LV_VG_LITE_ASSERT_PATH(rhs); - - LV_ASSERT(lhs->format == VG_LITE_FP32); - LV_ASSERT(rhs->format == VG_LITE_FP32); - - if(lhs->path_length != rhs->path_length) { - return lhs->path_length > rhs->path_length ? 1 : -1; - } - - int cmp_res = lv_memcmp(lhs->path, rhs->path, lhs->path_length); - if(cmp_res != 0) { - return cmp_res > 0 ? 1 : -1; - } - - return 0; -} - -static lv_cache_compare_res_t stroke_compare_cb(const stroke_item_t * lhs, const stroke_item_t * rhs) -{ - if(lhs->width != lhs->width) { - return lhs->width > lhs->width ? 1 : -1; - } - - if(lhs->cap != rhs->cap) { - return lhs->cap > rhs->cap ? 1 : -1; - } - - if(lhs->join != rhs->join) { - return lhs->join > rhs->join ? 1 : -1; - } - - if(lhs->miter_limit != rhs->miter_limit) { - return lhs->miter_limit > rhs->miter_limit ? 1 : -1; - } - - uint32_t lhs_dash_pattern_size = lv_array_size(&lhs->dash_pattern); - uint32_t rhs_dash_pattern_size = lv_array_size(&rhs->dash_pattern); - - if(lhs_dash_pattern_size != rhs_dash_pattern_size) { - return lhs_dash_pattern_size > rhs_dash_pattern_size ? 1 : -1; - } - - if(lhs_dash_pattern_size > 0 && rhs_dash_pattern_size > 0) { - LV_ASSERT(lhs->dash_pattern.element_size == sizeof(float)); - LV_ASSERT(rhs->dash_pattern.element_size == sizeof(float)); - - const float * lhs_dash_pattern = lv_array_front(&lhs->dash_pattern); - const float * rhs_dash_pattern = lv_array_front(&rhs->dash_pattern); - - /* compare dash pattern */ - int cmp_res = lv_memcmp(lhs_dash_pattern, rhs_dash_pattern, lhs_dash_pattern_size * sizeof(float)); - if(cmp_res != 0) { - return cmp_res > 0 ? 1 : -1; - } - } - - return path_compare(lv_vg_lite_path_get_path(lhs->path), lv_vg_lite_path_get_path(rhs->path)); -} - -#endif /*LV_USE_DRAW_VG_LITE && LV_USE_VECTOR_GRAPHIC*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_stroke.h b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_stroke.h deleted file mode 100644 index 4a0602d..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_stroke.h +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file lv_vg_lite_stroke.h - * - */ - -#ifndef LV_VG_LITE_STROKE_H -#define LV_VG_LITE_STROKE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_vg_lite_utils.h" - -#if LV_USE_DRAW_VG_LITE && LV_USE_VECTOR_GRAPHIC - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_vg_lite_path_t; - -struct lv_draw_vg_lite_unit_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize the stroke module - * @param unit pointer to the unit - */ -void lv_vg_lite_stroke_init(struct lv_draw_vg_lite_unit_t * unit, uint32_t cache_cnt); - -/** - * Deinitialize the stroke module - * @param unit pointer to the unit - */ -void lv_vg_lite_stroke_deinit(struct lv_draw_vg_lite_unit_t * unit); - -/** - * Get the stroke cache entry - * @param unit pointer to the unit - * @param path pointer to the path - * @param dsc pointer to the stroke descriptor - * @return pointer to the stroke cache entry - */ -lv_cache_entry_t * lv_vg_lite_stroke_get(struct lv_draw_vg_lite_unit_t * unit, - struct lv_vg_lite_path_t * path, - const lv_vector_stroke_dsc_t * dsc); - -/** - * Get the path of a stroke - * @param cache_entry pointer to the stroke cache entry - * @return pointer to the path - */ -struct lv_vg_lite_path_t * lv_vg_lite_stroke_get_path(lv_cache_entry_t * cache_entry); - -/** - * Drop the stroke cache entry - * @param unit pointer to the unit - * @param stroke pointer to the stroke - */ -void lv_vg_lite_stroke_drop(struct lv_draw_vg_lite_unit_t * unit, lv_cache_entry_t * cache_entry); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE && LV_USE_VECTOR_GRAPHIC*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_VG_LITE_STROKE_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_utils.c b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_utils.c deleted file mode 100644 index 116cbde..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_utils.c +++ /dev/null @@ -1,1217 +0,0 @@ -/** - * @file vg_lite_utils.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../lv_image_decoder_private.h" -#include "lv_vg_lite_utils.h" - -#if LV_USE_DRAW_VG_LITE - -#include "lv_vg_lite_decoder.h" -#include "lv_vg_lite_path.h" -#include "lv_vg_lite_pending.h" -#include "lv_vg_lite_grad.h" -#include "lv_draw_vg_lite_type.h" -#include -#include - -/********************* - * DEFINES - *********************/ - -#define ENUM_TO_STRING(e) \ - case (e): \ - return #e - -#define VG_LITE_ENUM_TO_STRING(e) \ - case (VG_LITE_##e): \ - return #e - -#define VLC_OP_ENUM_TO_STRING(e) \ - case (VLC_OP_##e): \ - return #e - -#define FEATURE_ENUM_TO_STRING(e) \ - case (gcFEATURE_BIT_VG_##e): \ - return #e - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void image_dsc_free_cb(void * dsc, void * user_data); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_vg_lite_dump_info(void) -{ - char name[64]; - vg_lite_uint32_t chip_id; - vg_lite_uint32_t chip_rev; - vg_lite_uint32_t cid; - vg_lite_get_product_info(name, &chip_id, &chip_rev); - vg_lite_get_register(0x30, &cid); - LV_LOG_USER("Product Info: %s" - " | Chip ID: 0x%" LV_PRIx32 - " | Revision: 0x%" LV_PRIx32 - " | CID: 0x%" LV_PRIx32, - name, (uint32_t)chip_id, (uint32_t)chip_rev, (uint32_t)cid); - - vg_lite_info_t info; - vg_lite_get_info(&info); - LV_LOG_USER("VGLite API version: 0x%" LV_PRIx32, (uint32_t)info.api_version); - LV_LOG_USER("VGLite API header version: 0x%" LV_PRIx32, (uint32_t)info.header_version); - LV_LOG_USER("VGLite release version: 0x%" LV_PRIx32, (uint32_t)info.release_version); - - for(int feature = 0; feature < gcFEATURE_COUNT; feature++) { - vg_lite_uint32_t ret = vg_lite_query_feature((vg_lite_feature_t)feature); - LV_UNUSED(ret); - LV_LOG_USER("Feature-%d: %s\t - %s", - feature, lv_vg_lite_feature_string((vg_lite_feature_t)feature), - ret ? "YES" : "NO"); - } - - vg_lite_uint32_t mem_avail = 0; - vg_lite_get_mem_size(&mem_avail); - LV_LOG_USER("Memory Available: %" LV_PRId32 " Bytes", (uint32_t)mem_avail); -} - -const char * lv_vg_lite_error_string(vg_lite_error_t error) -{ - switch(error) { - VG_LITE_ENUM_TO_STRING(SUCCESS); - VG_LITE_ENUM_TO_STRING(INVALID_ARGUMENT); - VG_LITE_ENUM_TO_STRING(OUT_OF_MEMORY); - VG_LITE_ENUM_TO_STRING(NO_CONTEXT); - VG_LITE_ENUM_TO_STRING(TIMEOUT); - VG_LITE_ENUM_TO_STRING(OUT_OF_RESOURCES); - VG_LITE_ENUM_TO_STRING(GENERIC_IO); - VG_LITE_ENUM_TO_STRING(NOT_SUPPORT); - VG_LITE_ENUM_TO_STRING(ALREADY_EXISTS); - VG_LITE_ENUM_TO_STRING(NOT_ALIGNED); - VG_LITE_ENUM_TO_STRING(FLEXA_TIME_OUT); - VG_LITE_ENUM_TO_STRING(FLEXA_HANDSHAKE_FAIL); - default: - break; - } - return "UNKNOW_ERROR"; -} - -const char * lv_vg_lite_feature_string(vg_lite_feature_t feature) -{ - switch(feature) { - FEATURE_ENUM_TO_STRING(IM_INDEX_FORMAT); - FEATURE_ENUM_TO_STRING(SCISSOR); - FEATURE_ENUM_TO_STRING(BORDER_CULLING); - FEATURE_ENUM_TO_STRING(RGBA2_FORMAT); - FEATURE_ENUM_TO_STRING(QUALITY_8X); - FEATURE_ENUM_TO_STRING(IM_FASTCLAER); - FEATURE_ENUM_TO_STRING(RADIAL_GRADIENT); - FEATURE_ENUM_TO_STRING(GLOBAL_ALPHA); - FEATURE_ENUM_TO_STRING(RGBA8_ETC2_EAC); - FEATURE_ENUM_TO_STRING(COLOR_KEY); - FEATURE_ENUM_TO_STRING(DOUBLE_IMAGE); - FEATURE_ENUM_TO_STRING(YUV_OUTPUT); - FEATURE_ENUM_TO_STRING(FLEXA); - FEATURE_ENUM_TO_STRING(24BIT); - FEATURE_ENUM_TO_STRING(DITHER); - FEATURE_ENUM_TO_STRING(USE_DST); - FEATURE_ENUM_TO_STRING(PE_CLEAR); - FEATURE_ENUM_TO_STRING(IM_INPUT); - FEATURE_ENUM_TO_STRING(DEC_COMPRESS); - FEATURE_ENUM_TO_STRING(LINEAR_GRADIENT_EXT); - FEATURE_ENUM_TO_STRING(MASK); - FEATURE_ENUM_TO_STRING(MIRROR); - FEATURE_ENUM_TO_STRING(GAMMA); - FEATURE_ENUM_TO_STRING(NEW_BLEND_MODE); - FEATURE_ENUM_TO_STRING(STENCIL); - FEATURE_ENUM_TO_STRING(SRC_PREMULTIPLIED); /*! Valid only if FEATURE_ENUM_TO_STRING(HW_PREMULTIPLY is 0 */ - FEATURE_ENUM_TO_STRING(HW_PREMULTIPLY); /*! HW multiplier can accept either premultiplied or not */ - FEATURE_ENUM_TO_STRING(COLOR_TRANSFORMATION); - FEATURE_ENUM_TO_STRING(LVGL_SUPPORT); - FEATURE_ENUM_TO_STRING(INDEX_ENDIAN); - FEATURE_ENUM_TO_STRING(24BIT_PLANAR); - FEATURE_ENUM_TO_STRING(PIXEL_MATRIX); - FEATURE_ENUM_TO_STRING(NEW_IMAGE_INDEX); - FEATURE_ENUM_TO_STRING(PARALLEL_PATHS); - FEATURE_ENUM_TO_STRING(STRIPE_MODE); - FEATURE_ENUM_TO_STRING(IM_DEC_INPUT); - FEATURE_ENUM_TO_STRING(GAUSSIAN_BLUR); - FEATURE_ENUM_TO_STRING(RECTANGLE_TILED_OUT); - FEATURE_ENUM_TO_STRING(TESSELLATION_TILED_OUT); - FEATURE_ENUM_TO_STRING(IM_REPEAT_REFLECT); - FEATURE_ENUM_TO_STRING(YUY2_INPUT); - FEATURE_ENUM_TO_STRING(YUV_INPUT); - FEATURE_ENUM_TO_STRING(YUV_TILED_INPUT); - FEATURE_ENUM_TO_STRING(AYUV_INPUT); - FEATURE_ENUM_TO_STRING(16PIXELS_ALIGN); - FEATURE_ENUM_TO_STRING(DEC_COMPRESS_2_0); - default: - break; - } - return "UNKNOW_FEATURE"; -} - -const char * lv_vg_lite_buffer_format_string(vg_lite_buffer_format_t format) -{ - switch(format) { - VG_LITE_ENUM_TO_STRING(RGBA8888); - VG_LITE_ENUM_TO_STRING(BGRA8888); - VG_LITE_ENUM_TO_STRING(RGBX8888); - VG_LITE_ENUM_TO_STRING(BGRX8888); - VG_LITE_ENUM_TO_STRING(RGB565); - VG_LITE_ENUM_TO_STRING(BGR565); - VG_LITE_ENUM_TO_STRING(RGBA4444); - VG_LITE_ENUM_TO_STRING(BGRA4444); - VG_LITE_ENUM_TO_STRING(BGRA5551); - VG_LITE_ENUM_TO_STRING(A4); - VG_LITE_ENUM_TO_STRING(A8); - VG_LITE_ENUM_TO_STRING(L8); - VG_LITE_ENUM_TO_STRING(YUYV); - VG_LITE_ENUM_TO_STRING(YUY2); - VG_LITE_ENUM_TO_STRING(NV12); - VG_LITE_ENUM_TO_STRING(ANV12); - VG_LITE_ENUM_TO_STRING(AYUY2); - VG_LITE_ENUM_TO_STRING(YV12); - VG_LITE_ENUM_TO_STRING(YV24); - VG_LITE_ENUM_TO_STRING(YV16); - VG_LITE_ENUM_TO_STRING(NV16); - VG_LITE_ENUM_TO_STRING(YUY2_TILED); - VG_LITE_ENUM_TO_STRING(NV12_TILED); - VG_LITE_ENUM_TO_STRING(ANV12_TILED); - VG_LITE_ENUM_TO_STRING(AYUY2_TILED); - VG_LITE_ENUM_TO_STRING(INDEX_1); - VG_LITE_ENUM_TO_STRING(INDEX_2); - VG_LITE_ENUM_TO_STRING(INDEX_4); - VG_LITE_ENUM_TO_STRING(INDEX_8); - VG_LITE_ENUM_TO_STRING(RGBA2222); - VG_LITE_ENUM_TO_STRING(BGRA2222); - VG_LITE_ENUM_TO_STRING(ABGR2222); - VG_LITE_ENUM_TO_STRING(ARGB2222); - VG_LITE_ENUM_TO_STRING(ABGR4444); - VG_LITE_ENUM_TO_STRING(ARGB4444); - VG_LITE_ENUM_TO_STRING(ABGR8888); - VG_LITE_ENUM_TO_STRING(ARGB8888); - VG_LITE_ENUM_TO_STRING(ABGR1555); - VG_LITE_ENUM_TO_STRING(RGBA5551); - VG_LITE_ENUM_TO_STRING(ARGB1555); - VG_LITE_ENUM_TO_STRING(XBGR8888); - VG_LITE_ENUM_TO_STRING(XRGB8888); - VG_LITE_ENUM_TO_STRING(RGBA8888_ETC2_EAC); - VG_LITE_ENUM_TO_STRING(RGB888); - VG_LITE_ENUM_TO_STRING(BGR888); - VG_LITE_ENUM_TO_STRING(ABGR8565); - VG_LITE_ENUM_TO_STRING(BGRA5658); - VG_LITE_ENUM_TO_STRING(ARGB8565); - VG_LITE_ENUM_TO_STRING(RGBA5658); - default: - break; - } - return "UNKNOW_BUFFER_FORMAT"; -} - -const char * lv_vg_lite_vlc_op_string(uint8_t vlc_op) -{ - switch(vlc_op) { - VLC_OP_ENUM_TO_STRING(END); - VLC_OP_ENUM_TO_STRING(CLOSE); - VLC_OP_ENUM_TO_STRING(MOVE); - VLC_OP_ENUM_TO_STRING(MOVE_REL); - VLC_OP_ENUM_TO_STRING(LINE); - VLC_OP_ENUM_TO_STRING(LINE_REL); - VLC_OP_ENUM_TO_STRING(QUAD); - VLC_OP_ENUM_TO_STRING(QUAD_REL); - VLC_OP_ENUM_TO_STRING(CUBIC); - VLC_OP_ENUM_TO_STRING(CUBIC_REL); - - VLC_OP_ENUM_TO_STRING(SCCWARC); - VLC_OP_ENUM_TO_STRING(SCCWARC_REL); - VLC_OP_ENUM_TO_STRING(SCWARC); - VLC_OP_ENUM_TO_STRING(SCWARC_REL); - VLC_OP_ENUM_TO_STRING(LCCWARC); - VLC_OP_ENUM_TO_STRING(LCCWARC_REL); - VLC_OP_ENUM_TO_STRING(LCWARC); - VLC_OP_ENUM_TO_STRING(LCWARC_REL); - default: - break; - } - return "UNKNOW_VLC_OP"; -} - -static void path_data_print_cb(void * user_data, uint8_t op_code, const float * data, uint32_t len) -{ - LV_UNUSED(user_data); - - LV_LOG("%s, ", lv_vg_lite_vlc_op_string(op_code)); - for(uint32_t i = 0; i < len; i++) { - LV_LOG("%0.2f, ", data[i]); - } - LV_LOG("\n"); -} - -void lv_vg_lite_path_dump_info(const vg_lite_path_t * path) -{ - LV_ASSERT(path != NULL); - LV_ASSERT(path->path != NULL); - uint8_t fmt_len = lv_vg_lite_path_format_len(path->format); - size_t len = path->path_length / fmt_len; - - LV_ASSERT(len > 0); - - LV_LOG_USER("address: %p", (void *)path->path); - LV_LOG_USER("length: %d", (int)len); - LV_LOG_USER("bonding box: (%0.2f, %0.2f) - (%0.2f, %0.2f)", - path->bounding_box[0], path->bounding_box[1], - path->bounding_box[2], path->bounding_box[3]); - LV_LOG_USER("format: %d", (int)path->format); - LV_LOG_USER("quality: %d", (int)path->quality); - LV_LOG_USER("path_changed: %d", (int)path->path_changed); - LV_LOG_USER("pdata_internal: %d", (int)path->pdata_internal); - LV_LOG_USER("type: %d", (int)path->path_type); - LV_LOG_USER("add_end: %d", (int)path->add_end); - - lv_vg_lite_path_for_each_data(path, path_data_print_cb, NULL); - - if(path->stroke) { - LV_LOG_USER("stroke_path: %p", (void *)path->stroke_path); - LV_LOG_USER("stroke_size: %d", (int)path->stroke_size); - LV_LOG_USER("stroke_color: 0x%X", (int)path->stroke_color); - lv_vg_lite_stroke_dump_info(path->stroke); - } -} - -void lv_vg_lite_stroke_dump_info(const vg_lite_stroke_t * stroke) -{ - LV_ASSERT(stroke != NULL); - LV_LOG_USER("stroke: %p", (void *)stroke); - - /* Stroke parameters */ - LV_LOG_USER("cap_style: 0x%X", (int)stroke->cap_style); - LV_LOG_USER("join_style: 0x%X", (int)stroke->join_style); - LV_LOG_USER("line_width: %f", stroke->line_width); - LV_LOG_USER("miter_limit: %f", stroke->miter_limit); - - LV_LOG_USER("dash_pattern: %p", (void *)stroke->dash_pattern); - LV_LOG_USER("pattern_count: %d", (int)stroke->pattern_count); - if(stroke->dash_pattern) { - for(int i = 0; i < (int)stroke->pattern_count; i++) { - LV_LOG_USER("dash_pattern[%d]: %f", i, stroke->dash_pattern[i]); - } - } - - LV_LOG_USER("dash_phase: %f", stroke->dash_phase); - LV_LOG_USER("dash_length: %f", stroke->dash_length); - LV_LOG_USER("dash_index: %d", (int)stroke->dash_index); - LV_LOG_USER("half_width: %f", stroke->half_width); - - /* Total length of stroke dash patterns. */ - LV_LOG_USER("pattern_length: %f", stroke->pattern_length); - - /* For fast checking. */ - LV_LOG_USER("miter_square: %f", stroke->miter_square); - - /* Temp storage of stroke subPath. */ - LV_LOG_USER("path_points: %p", (void *)stroke->path_points); - LV_LOG_USER("path_end: %p", (void *)stroke->path_end); - LV_LOG_USER("point_count: %d", (int)stroke->point_count); - - LV_LOG_USER("left_point: %p", (void *)stroke->left_point); - LV_LOG_USER("right_point: %p", (void *)stroke->right_point); - LV_LOG_USER("stroke_points: %p", (void *)stroke->stroke_points); - LV_LOG_USER("stroke_end: %p", (void *)stroke->stroke_end); - LV_LOG_USER("stroke_count: %d", (int)stroke->stroke_count); - - /* Divide stroke path according to move or move_rel for avoiding implicit closure. */ - LV_LOG_USER("path_list_divide: %p", (void *)stroke->path_list_divide); - - /* pointer to current divided path data. */ - LV_LOG_USER("cur_list: %p", (void *)stroke->cur_list); - - /* Flag that add end_path in driver. */ - LV_LOG_USER("add_end: %d", (int)stroke->add_end); - LV_LOG_USER("dash_reset: %d", (int)stroke->dash_reset); - - /* Sub path list. */ - LV_LOG_USER("stroke_paths: %p", (void *)stroke->stroke_paths); - - /* Last sub path. */ - LV_LOG_USER("last_stroke: %p", (void *)stroke->last_stroke); - - /* Swing area handling. */ - LV_LOG_USER("swing_handling: %d", (int)stroke->swing_handling); - LV_LOG_USER("swing_deltax: %f", stroke->swing_deltax); - LV_LOG_USER("swing_deltay: %f", stroke->swing_deltay); - LV_LOG_USER("swing_start: %p", (void *)stroke->swing_start); - LV_LOG_USER("swing_stroke: %p", (void *)stroke->swing_stroke); - LV_LOG_USER("swing_length: %f", stroke->swing_length); - LV_LOG_USER("swing_centlen: %f", stroke->swing_centlen); - LV_LOG_USER("swing_count: %d", (int)stroke->swing_count); - LV_LOG_USER("need_swing: %d", (int)stroke->need_swing); - LV_LOG_USER("swing_ccw: %d", (int)stroke->swing_ccw); - - LV_LOG_USER("stroke_length: %f", stroke->stroke_length); - LV_LOG_USER("stroke_size: %d", (int)stroke->stroke_size); - - LV_LOG_USER("fattened: %d", (int)stroke->fattened); - LV_LOG_USER("closed: %d", (int)stroke->closed); -} - -void lv_vg_lite_buffer_dump_info(const vg_lite_buffer_t * buffer) -{ - LV_LOG_USER("memory: %p", (buffer)->memory); - LV_LOG_USER("address: 0x%08x", (int)(buffer)->address); - LV_LOG_USER("size: W%d x H%d", (int)((buffer)->width), (int)((buffer)->height)); - LV_LOG_USER("stride: %d", (int)((buffer)->stride)); - LV_LOG_USER("format: %d (%s)", - (int)((buffer)->format), - lv_vg_lite_buffer_format_string((buffer)->format)); - LV_LOG_USER("tiled: %d", (int)((buffer)->tiled)); -} - -void lv_vg_lite_matrix_dump_info(const vg_lite_matrix_t * matrix) -{ - for(int i = 0; i < 3; i++) { - LV_LOG_USER("| %f, %f, %f |", - (matrix)->m[i][0], (matrix)->m[i][1], (matrix)->m[i][2]); - } -} - -bool lv_vg_lite_is_dest_cf_supported(lv_color_format_t cf) -{ - switch(cf) { - case LV_COLOR_FORMAT_RGB565: - case LV_COLOR_FORMAT_ARGB8888: - case LV_COLOR_FORMAT_XRGB8888: - return true; - - case LV_COLOR_FORMAT_ARGB8565: - case LV_COLOR_FORMAT_RGB888: - return vg_lite_query_feature(gcFEATURE_BIT_VG_24BIT) ? true : false; - - default: - break; - } - - return false; -} - -bool lv_vg_lite_is_src_cf_supported(lv_color_format_t cf) -{ - switch(cf) { - case LV_COLOR_FORMAT_A4: - case LV_COLOR_FORMAT_A8: - case LV_COLOR_FORMAT_RGB565: - case LV_COLOR_FORMAT_ARGB8888: - case LV_COLOR_FORMAT_XRGB8888: - return true; - - case LV_COLOR_FORMAT_I1: - case LV_COLOR_FORMAT_I2: - case LV_COLOR_FORMAT_I4: - case LV_COLOR_FORMAT_I8: - return vg_lite_query_feature(gcFEATURE_BIT_VG_IM_INDEX_FORMAT) ? true : false; - - case LV_COLOR_FORMAT_ARGB8565: - case LV_COLOR_FORMAT_RGB888: - return vg_lite_query_feature(gcFEATURE_BIT_VG_24BIT) ? true : false; - - case LV_COLOR_FORMAT_NV12: - return vg_lite_query_feature(gcFEATURE_BIT_VG_YUV_INPUT) ? true : false; - - default: - break; - } - - return false; -} - -vg_lite_buffer_format_t lv_vg_lite_vg_fmt(lv_color_format_t cf) -{ - switch(cf) { - case LV_COLOR_FORMAT_A4: - return VG_LITE_A4; - - case LV_COLOR_FORMAT_A8: - return VG_LITE_A8; - - case LV_COLOR_FORMAT_L8: - return VG_LITE_L8; - - case LV_COLOR_FORMAT_I1: - return VG_LITE_INDEX_1; - - case LV_COLOR_FORMAT_I2: - return VG_LITE_INDEX_2; - - case LV_COLOR_FORMAT_I4: - return VG_LITE_INDEX_4; - - case LV_COLOR_FORMAT_I8: - return VG_LITE_INDEX_8; - - case LV_COLOR_FORMAT_RGB565: - return VG_LITE_BGR565; - - case LV_COLOR_FORMAT_ARGB8565: - return VG_LITE_BGRA5658; - - case LV_COLOR_FORMAT_RGB888: - return VG_LITE_BGR888; - - case LV_COLOR_FORMAT_ARGB8888: - return VG_LITE_BGRA8888; - - case LV_COLOR_FORMAT_XRGB8888: - return VG_LITE_BGRX8888; - - case LV_COLOR_FORMAT_NV12: - return VG_LITE_NV12; - - default: - LV_LOG_ERROR("unsupported color format: %d", cf); - break; - } - - LV_ASSERT(false); - return 0; -} - -void lv_vg_lite_buffer_format_bytes( - vg_lite_buffer_format_t format, - uint32_t * mul, - uint32_t * div, - uint32_t * bytes_align) -{ - /* Get the bpp information of a color format. */ - *mul = *div = 1; - *bytes_align = 4; - switch(format) { - case VG_LITE_L8: - case VG_LITE_A8: - case VG_LITE_RGBA8888_ETC2_EAC: - break; - case VG_LITE_A4: - *div = 2; - break; - case VG_LITE_ABGR1555: - case VG_LITE_ARGB1555: - case VG_LITE_BGRA5551: - case VG_LITE_RGBA5551: - case VG_LITE_RGBA4444: - case VG_LITE_BGRA4444: - case VG_LITE_ABGR4444: - case VG_LITE_ARGB4444: - case VG_LITE_RGB565: - case VG_LITE_BGR565: - case VG_LITE_YUYV: - case VG_LITE_YUY2: - case VG_LITE_YUY2_TILED: - /* AYUY2 buffer memory = YUY2 + alpha. */ - case VG_LITE_AYUY2: - case VG_LITE_AYUY2_TILED: - *mul = 2; - break; - case VG_LITE_RGBA8888: - case VG_LITE_BGRA8888: - case VG_LITE_ABGR8888: - case VG_LITE_ARGB8888: - case VG_LITE_RGBX8888: - case VG_LITE_BGRX8888: - case VG_LITE_XBGR8888: - case VG_LITE_XRGB8888: - *mul = 4; - break; - case VG_LITE_NV12: - case VG_LITE_NV12_TILED: - *mul = 1; - break; - case VG_LITE_ANV12: - case VG_LITE_ANV12_TILED: - *mul = 4; - break; - case VG_LITE_INDEX_1: - *div = 8; - *bytes_align = 8; - break; - case VG_LITE_INDEX_2: - *div = 4; - *bytes_align = 8; - break; - case VG_LITE_INDEX_4: - *div = 2; - *bytes_align = 8; - break; - case VG_LITE_INDEX_8: - *bytes_align = 1; - break; - case VG_LITE_RGBA2222: - case VG_LITE_BGRA2222: - case VG_LITE_ABGR2222: - case VG_LITE_ARGB2222: - *mul = 1; - break; - case VG_LITE_RGB888: - case VG_LITE_BGR888: - case VG_LITE_ABGR8565: - case VG_LITE_BGRA5658: - case VG_LITE_ARGB8565: - case VG_LITE_RGBA5658: - *mul = 3; - break; - default: - LV_LOG_ERROR("unsupported color format: 0x%" PRIx32, (uint32_t)format); - LV_ASSERT(false); - break; - } -} - -uint32_t lv_vg_lite_width_to_stride(uint32_t w, vg_lite_buffer_format_t color_format) -{ - w = lv_vg_lite_width_align(w); - - uint32_t mul, div, align; - lv_vg_lite_buffer_format_bytes(color_format, &mul, &div, &align); - return LV_VG_LITE_ALIGN(((w * mul + div - 1) / div), align); -} - -uint32_t lv_vg_lite_width_align(uint32_t w) -{ - if(lv_vg_lite_16px_align()) { - w = LV_VG_LITE_ALIGN(w, 16); - } - - return w; -} - -void lv_vg_lite_buffer_init( - vg_lite_buffer_t * buffer, - const void * ptr, - int32_t width, - int32_t height, - uint32_t stride, - vg_lite_buffer_format_t format, - bool tiled) -{ - uint32_t mul; - uint32_t div; - uint32_t align; - LV_ASSERT_NULL(buffer); - LV_ASSERT_NULL(ptr); - - lv_memzero(buffer, sizeof(vg_lite_buffer_t)); - - buffer->format = format; - if(tiled || format == VG_LITE_RGBA8888_ETC2_EAC) { - buffer->tiled = VG_LITE_TILED; - } - else { - buffer->tiled = VG_LITE_LINEAR; - } - buffer->image_mode = VG_LITE_NORMAL_IMAGE_MODE; - buffer->transparency_mode = VG_LITE_IMAGE_OPAQUE; - buffer->width = width; - buffer->height = height; - if(stride == LV_STRIDE_AUTO) { - lv_vg_lite_buffer_format_bytes(buffer->format, &mul, &div, &align); - buffer->stride = LV_VG_LITE_ALIGN((buffer->width * mul / div), align); - } - else { - buffer->stride = stride; - } - - if(format == VG_LITE_NV12) { - lv_yuv_buf_t * frame_p = (lv_yuv_buf_t *)ptr; - buffer->memory = (void *)frame_p->semi_planar.y.buf; - buffer->address = (uintptr_t)frame_p->semi_planar.y.buf; - buffer->yuv.swizzle = VG_LITE_SWIZZLE_UV; - buffer->yuv.alpha_stride = buffer->stride; - buffer->yuv.uv_height = buffer->height / 2; - buffer->yuv.uv_memory = (void *)frame_p->semi_planar.uv.buf; - buffer->yuv.uv_planar = (uint32_t)(uintptr_t)frame_p->semi_planar.uv.buf; - buffer->yuv.uv_stride = frame_p->semi_planar.uv.stride; - } - else { - buffer->memory = (void *)ptr; - buffer->address = (uintptr_t)ptr; - } -} - -void lv_vg_lite_buffer_from_draw_buf(vg_lite_buffer_t * buffer, const lv_draw_buf_t * draw_buf) -{ - LV_ASSERT_NULL(buffer); - LV_ASSERT_NULL(draw_buf); - - const uint8_t * ptr = draw_buf->data; - int32_t width = draw_buf->header.w; - int32_t height = draw_buf->header.h; - uint32_t stride = draw_buf->header.stride; - vg_lite_buffer_format_t format = lv_vg_lite_vg_fmt(draw_buf->header.cf); - - if(LV_COLOR_FORMAT_IS_INDEXED(draw_buf->header.cf)) { - uint32_t palette_size_bytes = LV_COLOR_INDEXED_PALETTE_SIZE(draw_buf->header.cf) * sizeof(uint32_t); - - /* Skip palette */ - ptr += LV_VG_LITE_ALIGN(palette_size_bytes, LV_DRAW_BUF_ALIGN); - } - - width = lv_vg_lite_width_align(width); - - lv_vg_lite_buffer_init(buffer, ptr, width, height, stride, format, false); - - /* Alpha image need to be multiplied by color */ - if(LV_COLOR_FORMAT_IS_ALPHA_ONLY(draw_buf->header.cf)) { - buffer->image_mode = VG_LITE_MULTIPLY_IMAGE_MODE; - } -} - -void lv_vg_lite_image_matrix(vg_lite_matrix_t * matrix, int32_t x, int32_t y, const lv_draw_image_dsc_t * dsc) -{ - LV_ASSERT_NULL(matrix); - LV_ASSERT_NULL(dsc); - - int32_t rotation = dsc->rotation; - int32_t scale_x = dsc->scale_x; - int32_t scale_y = dsc->scale_y; - - vg_lite_translate(x, y, matrix); - - if(rotation != 0 || scale_x != LV_SCALE_NONE || scale_y != LV_SCALE_NONE) { - lv_point_t pivot = dsc->pivot; - vg_lite_translate(pivot.x, pivot.y, matrix); - - if(rotation != 0) { - vg_lite_rotate(rotation * 0.1f, matrix); - } - - if(scale_x != LV_SCALE_NONE || scale_y != LV_SCALE_NONE) { - vg_lite_scale( - (vg_lite_float_t)scale_x / LV_SCALE_NONE, - (vg_lite_float_t)scale_y / LV_SCALE_NONE, - matrix); - } - - vg_lite_translate(-pivot.x, -pivot.y, matrix); - } -} - -bool lv_vg_lite_buffer_open_image(vg_lite_buffer_t * buffer, lv_image_decoder_dsc_t * decoder_dsc, const void * src, - bool no_cache, bool premultiply) -{ - LV_ASSERT_NULL(buffer); - LV_ASSERT_NULL(decoder_dsc); - LV_ASSERT_NULL(src); - - lv_image_decoder_args_t args; - lv_memzero(&args, sizeof(lv_image_decoder_args_t)); - args.premultiply = premultiply; - args.stride_align = true; - args.use_indexed = true; - args.no_cache = no_cache; - args.flush_cache = true; - - lv_result_t res = lv_image_decoder_open(decoder_dsc, src, &args); - if(res != LV_RESULT_OK) { - LV_LOG_ERROR("Failed to open image"); - return false; - } - - const lv_draw_buf_t * decoded = decoder_dsc->decoded; - if(decoded == NULL || decoded->data == NULL) { - lv_image_decoder_close(decoder_dsc); - LV_LOG_ERROR("image data is NULL"); - return false; - } - - if(!lv_vg_lite_is_src_cf_supported(decoded->header.cf)) { - LV_LOG_ERROR("unsupported color format: %d", decoded->header.cf); - lv_image_decoder_close(decoder_dsc); - return false; - } - - if(LV_COLOR_FORMAT_IS_INDEXED(decoded->header.cf)) { - uint32_t palette_size = LV_COLOR_INDEXED_PALETTE_SIZE(decoded->header.cf); - LV_PROFILER_BEGIN_TAG("vg_lite_set_CLUT"); - LV_VG_LITE_CHECK_ERROR(vg_lite_set_CLUT(palette_size, (vg_lite_uint32_t *)decoded->data)); - LV_PROFILER_END_TAG("vg_lite_set_CLUT"); - } - - lv_vg_lite_buffer_from_draw_buf(buffer, decoded); - return true; -} - -void lv_vg_lite_image_dsc_init(struct lv_draw_vg_lite_unit_t * unit) -{ - unit->image_dsc_pending = lv_vg_lite_pending_create(sizeof(lv_image_decoder_dsc_t), 4); - lv_vg_lite_pending_set_free_cb(unit->image_dsc_pending, image_dsc_free_cb, NULL); -} - -void lv_vg_lite_image_dsc_deinit(struct lv_draw_vg_lite_unit_t * unit) -{ - lv_vg_lite_pending_destroy(unit->image_dsc_pending); - unit->image_dsc_pending = NULL; -} - -void lv_vg_lite_rect(vg_lite_rectangle_t * rect, const lv_area_t * area) -{ - rect->x = area->x1; - rect->y = area->y1; - rect->width = lv_area_get_width(area); - rect->height = lv_area_get_height(area); -} - -void lv_vg_lite_matrix(vg_lite_matrix_t * dest, const lv_matrix_t * src) -{ - lv_memcpy(dest, src, sizeof(lv_matrix_t)); -} - -uint32_t lv_vg_lite_get_palette_size(vg_lite_buffer_format_t format) -{ - uint32_t size = 0; - switch(format) { - case VG_LITE_INDEX_1: - size = 1 << 1; - break; - case VG_LITE_INDEX_2: - size = 1 << 2; - break; - case VG_LITE_INDEX_4: - size = 1 << 4; - break; - case VG_LITE_INDEX_8: - size = 1 << 8; - break; - default: - break; - } - return size; -} - -vg_lite_color_t lv_vg_lite_color(lv_color_t color, lv_opa_t opa, bool pre_mul) -{ - if(pre_mul && opa < LV_OPA_COVER) { - color.red = LV_UDIV255(color.red * opa); - color.green = LV_UDIV255(color.green * opa); - color.blue = LV_UDIV255(color.blue * opa); - } - return (uint32_t)opa << 24 | (uint32_t)color.blue << 16 | (uint32_t)color.green << 8 | color.red; -} - -vg_lite_blend_t lv_vg_lite_blend_mode(lv_blend_mode_t blend_mode, bool has_pre_mul) -{ - if(!has_pre_mul && vg_lite_query_feature(gcFEATURE_BIT_VG_LVGL_SUPPORT)) { - switch(blend_mode) { - case LV_BLEND_MODE_NORMAL: /**< Simply mix according to the opacity value*/ - return VG_LITE_BLEND_NORMAL_LVGL; - - case LV_BLEND_MODE_ADDITIVE: /**< Add the respective color channels*/ - return VG_LITE_BLEND_ADDITIVE_LVGL; - - case LV_BLEND_MODE_SUBTRACTIVE: /**< Subtract the foreground from the background*/ - return VG_LITE_BLEND_SUBTRACT_LVGL; - - case LV_BLEND_MODE_MULTIPLY: /**< Multiply the foreground and background*/ - return VG_LITE_BLEND_MULTIPLY_LVGL; - - default: - return VG_LITE_BLEND_NONE; - } - } - - switch(blend_mode) { - case LV_BLEND_MODE_NORMAL: /**< Simply mix according to the opacity value*/ - if(!has_pre_mul && vg_lite_query_feature(gcFEATURE_BIT_VG_HW_PREMULTIPLY)) { - return VG_LITE_BLEND_PREMULTIPLY_SRC_OVER; - } - return VG_LITE_BLEND_SRC_OVER; - - case LV_BLEND_MODE_ADDITIVE: /**< Add the respective color channels*/ - return VG_LITE_BLEND_ADDITIVE; - - case LV_BLEND_MODE_SUBTRACTIVE: /**< Subtract the foreground from the background*/ - return VG_LITE_BLEND_SUBTRACT; - - case LV_BLEND_MODE_MULTIPLY: /**< Multiply the foreground and background*/ - return VG_LITE_BLEND_MULTIPLY; - - default: - return VG_LITE_BLEND_NONE; - } -} - -bool lv_vg_lite_buffer_check(const vg_lite_buffer_t * buffer, bool is_src) -{ - uint32_t mul; - uint32_t div; - uint32_t align; - int32_t stride; - - if(!buffer) { - LV_LOG_ERROR("buffer is NULL"); - return false; - } - - if(buffer->width < 1) { - LV_LOG_ERROR("buffer width(%d) < 1", (int)buffer->width); - return false; - } - - if(buffer->height < 1) { - LV_LOG_ERROR("buffer height(%d) < 1", (int)buffer->height); - return false; - } - - if(!(buffer->tiled == VG_LITE_LINEAR || buffer->tiled == VG_LITE_TILED)) { - LV_LOG_ERROR("buffer tiled(%d) is invalid", (int)buffer->tiled); - return false; - } - - if(buffer->memory == NULL) { - LV_LOG_ERROR("buffer memory is NULL"); - return false; - } - - if(is_src && buffer->width != (vg_lite_int32_t)lv_vg_lite_width_align(buffer->width)) { - LV_LOG_ERROR("buffer width(%d) is not aligned", (int)buffer->width); - return false; - } - - if(!LV_VG_LITE_IS_ALIGNED(buffer->memory, LV_DRAW_BUF_ALIGN)) { - LV_LOG_ERROR("buffer address(%p) is not aligned to %d", buffer->memory, LV_DRAW_BUF_ALIGN); - return false; - } - - lv_vg_lite_buffer_format_bytes(buffer->format, &mul, &div, &align); - stride = LV_VG_LITE_ALIGN((buffer->width * mul / div), align); - - if(buffer->stride != stride) { - LV_LOG_ERROR("buffer stride(%d) != %d", (int)buffer->stride, (int)stride); - return false; - } - - switch(buffer->image_mode) { - case VG_LITE_ZERO: - case VG_LITE_NORMAL_IMAGE_MODE: - case VG_LITE_MULTIPLY_IMAGE_MODE: - case VG_LITE_STENCIL_MODE: - case VG_LITE_NONE_IMAGE_MODE: - case VG_LITE_RECOLOR_MODE: - break; - default: - LV_LOG_ERROR("buffer image_mode(%d) is invalid", (int)buffer->image_mode); - return false; - } - - switch(buffer->transparency_mode) { - case VG_LITE_IMAGE_OPAQUE: - case VG_LITE_IMAGE_TRANSPARENT: - break; - default: - LV_LOG_ERROR("buffer transparency_mode(%d) is invalid", - (int)buffer->transparency_mode); - return false; - } - - return true; -} - -bool lv_vg_lite_path_check(const vg_lite_path_t * path) -{ - if(path == NULL) { - LV_LOG_ERROR("path is NULL"); - return false; - } - - if(path->path == NULL) { - LV_LOG_ERROR("path->path is NULL"); - return false; - } - - uint8_t fmt_len = lv_vg_lite_path_format_len(path->format); - if(!fmt_len) { - LV_LOG_ERROR("path format(%d) is invalid", (int)path->format); - return false; - } - - size_t len = path->path_length / fmt_len; - - if(len < 1) { - LV_LOG_ERROR("path length(%d) error", (int)path->path_length); - return false; - } - - const uint8_t * cur = path->path; - const uint8_t * end = cur + path->path_length; - - while(cur < end) { - /* get op code */ - uint8_t op_code = VLC_GET_OP_CODE(cur); - - /* get arguments length */ - uint8_t arg_len = lv_vg_lite_vlc_op_arg_len(op_code); - - /* get next op code */ - cur += (fmt_len * (1 + arg_len)) ; - - /* break if end */ - if(op_code == VLC_OP_END) { - break; - } - } - - if(cur != end) { - LV_LOG_ERROR("path length(%d) error", (int)path->path_length); - return false; - } - - switch(path->path_type) { - case VG_LITE_DRAW_ZERO: - case VG_LITE_DRAW_FILL_PATH: - case VG_LITE_DRAW_FILL_STROKE_PATH: { - /* Check end op code */ - uint8_t end_op_code = VLC_GET_OP_CODE(end - fmt_len); - if(end_op_code != VLC_OP_END) { - LV_LOG_ERROR("%d (%s) -> is NOT VLC_OP_END", end_op_code, lv_vg_lite_vlc_op_string(end_op_code)); - return false; - } - } - break; - - case VG_LITE_DRAW_STROKE_PATH: - /* No need to check stroke path end */ - break; - - default: - LV_LOG_ERROR("path type(%d) is invalid", (int)path->path_type); - return false; - } - - return true; -} - -bool lv_vg_lite_matrix_check(const vg_lite_matrix_t * matrix) -{ - if(matrix == NULL) { - LV_LOG_ERROR("matrix is NULL"); - return false; - } - - vg_lite_matrix_t result; - if(!lv_vg_lite_matrix_inverse(&result, matrix)) { - LV_LOG_ERROR("matrix is not invertible"); - lv_vg_lite_matrix_dump_info(matrix); - return false; - } - - return true; -} - -bool lv_vg_lite_support_blend_normal(void) -{ - if(vg_lite_query_feature(gcFEATURE_BIT_VG_HW_PREMULTIPLY)) { - return true; - } - - if(vg_lite_query_feature(gcFEATURE_BIT_VG_LVGL_SUPPORT)) { - return true; - } - - return false; -} - -bool lv_vg_lite_16px_align(void) -{ - return vg_lite_query_feature(gcFEATURE_BIT_VG_16PIXELS_ALIGN); -} - -void lv_vg_lite_matrix_multiply(vg_lite_matrix_t * matrix, const vg_lite_matrix_t * mult) -{ - vg_lite_matrix_t temp; - int row, column; - vg_lite_float_t (*m)[3] = matrix->m; - - /* Process all rows. */ - for(row = 0; row < 3; row++) { - /* Process all columns. */ - for(column = 0; column < 3; column++) { - /* Compute matrix entry. */ - temp.m[row][column] = (m[row][0] * mult->m[0][column]) - + (m[row][1] * mult->m[1][column]) - + (m[row][2] * mult->m[2][column]); - } - } - - /* Copy temporary matrix into result. */ - lv_memcpy(matrix, &temp, sizeof(temp)); -} - -bool lv_vg_lite_matrix_inverse(vg_lite_matrix_t * result, const vg_lite_matrix_t * matrix) -{ - vg_lite_float_t det00, det01, det02; - vg_lite_float_t d; - bool is_affine; - - /* Test for identity matrix. */ - if(matrix == NULL) { - result->m[0][0] = 1.0f; - result->m[0][1] = 0.0f; - result->m[0][2] = 0.0f; - result->m[1][0] = 0.0f; - result->m[1][1] = 1.0f; - result->m[1][2] = 0.0f; - result->m[2][0] = 0.0f; - result->m[2][1] = 0.0f; - result->m[2][2] = 1.0f; - - /* Success. */ - return true; - } - - const vg_lite_float_t (*m)[3] = matrix->m; - - det00 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - det01 = m[2][0] * m[1][2] - m[1][0] * m[2][2]; - det02 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - /* Compute determinant. */ - d = m[0][0] * det00 + m[0][1] * det01 + m[0][2] * det02; - - /* Return 0 if there is no inverse matrix. */ - if(d == 0.0f) - return false; - - /* Compute reciprocal. */ - d = 1.0f / d; - - /* Determine if the matrix is affine. */ - is_affine = (m[2][0] == 0.0f) && (m[2][1] == 0.0f) && (m[2][2] == 1.0f); - - result->m[0][0] = d * det00; - result->m[0][1] = d * ((m[2][1] * m[0][2]) - (m[0][1] * m[2][2])); - result->m[0][2] = d * ((m[0][1] * m[1][2]) - (m[1][1] * m[0][2])); - result->m[1][0] = d * det01; - result->m[1][1] = d * ((m[0][0] * m[2][2]) - (m[2][0] * m[0][2])); - result->m[1][2] = d * ((m[1][0] * m[0][2]) - (m[0][0] * m[1][2])); - result->m[2][0] = is_affine ? 0.0f : d * det02; - result->m[2][1] = is_affine ? 0.0f : d * ((m[2][0] * m[0][1]) - (m[0][0] * m[2][1])); - result->m[2][2] = is_affine ? 1.0f : d * ((m[0][0] * m[1][1]) - (m[1][0] * m[0][1])); - - /* Success. */ - return true; -} - -lv_point_precise_t lv_vg_lite_matrix_transform_point(const vg_lite_matrix_t * matrix, const lv_point_precise_t * point) -{ - lv_point_precise_t p; - const vg_lite_float_t (*m)[3] = matrix->m; - p.x = (lv_value_precise_t)roundf(point->x * m[0][0] + point->y * m[0][1] + m[0][2]); - p.y = (lv_value_precise_t)roundf(point->x * m[1][0] + point->y * m[1][1] + m[1][2]); - return p; -} - -void lv_vg_lite_set_scissor_area(const lv_area_t * area) -{ -#if VGLITE_RELEASE_VERSION <= VGLITE_MAKE_VERSION(4,0,57) - /** - * In the new version of VG-Lite, vg_lite_set_scissor no longer needs to call vg_lite_enable_scissor and - * vg_lite_disable_scissor APIs. - * - * Original description in the manual: - * Description: This is a legacy scissor API function that can be used to set and enable a single scissor rectangle - * for the render target. This scissor API is supported by a different hardware mechanism other than the mask layer, - * and it is not enabled/disabled by vg_lite_enable_scissor and vg_lite_disable_scissor APIs. - */ - LV_VG_LITE_CHECK_ERROR(vg_lite_enable_scissor()); -#endif - LV_VG_LITE_CHECK_ERROR(vg_lite_set_scissor( - area->x1, - area->y1, - area->x2 + 1, - area->y2 + 1)); -} - -void lv_vg_lite_disable_scissor(void) -{ - /* Restore full screen scissor */ - LV_VG_LITE_CHECK_ERROR(vg_lite_set_scissor( - 0, - 0, - LV_HOR_RES, - LV_VER_RES)); -} - -void lv_vg_lite_flush(struct lv_draw_vg_lite_unit_t * u) -{ - LV_ASSERT_NULL(u); - LV_PROFILER_BEGIN; - - u->flush_count++; - -#if LV_VG_LITE_FLUSH_MAX_COUNT - if(u->flush_count < LV_VG_LITE_FLUSH_MAX_COUNT) { - /* Do not flush too often */ - LV_PROFILER_END; - return; - } -#else - vg_lite_uint32_t is_gpu_idle = 0; - LV_VG_LITE_CHECK_ERROR(vg_lite_get_parameter(VG_LITE_GPU_IDLE_STATE, 1, (vg_lite_pointer)&is_gpu_idle)); - if(!is_gpu_idle) { - /* Do not flush if GPU is busy */ - LV_PROFILER_END; - return; - } -#endif - - LV_VG_LITE_CHECK_ERROR(vg_lite_flush()); - u->flush_count = 0; - LV_PROFILER_END; -} - -void lv_vg_lite_finish(struct lv_draw_vg_lite_unit_t * u) -{ - LV_ASSERT_NULL(u); - LV_PROFILER_BEGIN; - - LV_VG_LITE_CHECK_ERROR(vg_lite_finish()); - - /* Clear all gradient caches reference */ - if(u->grad_pending) { - lv_vg_lite_pending_remove_all(u->grad_pending); - } - - /* Clear image decoder dsc reference */ - lv_vg_lite_pending_remove_all(u->image_dsc_pending); - u->flush_count = 0; - LV_PROFILER_END; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void image_dsc_free_cb(void * dsc, void * user_data) -{ - LV_UNUSED(user_data); - lv_image_decoder_close(dsc); -} - -#endif /*LV_USE_DRAW_VG_LITE*/ diff --git a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_utils.h b/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_utils.h deleted file mode 100644 index becbce8..0000000 --- a/L3_Middlewares/LVGL/src/draw/vg_lite/lv_vg_lite_utils.h +++ /dev/null @@ -1,188 +0,0 @@ -/** - * @file lv_vg_lite_utils.h - * - */ - -#ifndef LV_VG_LITE_UTILS_H -#define LV_VG_LITE_UTILS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lvgl.h" - -#if LV_USE_DRAW_VG_LITE - -#include "../../misc/lv_profiler.h" - -#include -#if LV_USE_VG_LITE_THORVG -#include "../../others/vg_lite_tvg/vg_lite.h" -#else -#include -#endif - -/********************* - * DEFINES - *********************/ - -#define LV_VG_LITE_IS_ERROR(err) (err > 0) - -#define VLC_GET_OP_CODE(ptr) (*((uint8_t*)ptr)) - -#if LV_VG_LITE_USE_ASSERT -#define LV_VG_LITE_ASSERT(expr) LV_ASSERT(expr) -#else -#define LV_VG_LITE_ASSERT(expr) -#endif - -#define LV_VG_LITE_CHECK_ERROR(expr) \ - do { \ - vg_lite_error_t error = expr; \ - if (LV_VG_LITE_IS_ERROR(error)) { \ - LV_LOG_ERROR("Execute '" #expr "' error(%d): %s", \ - (int)error, lv_vg_lite_error_string(error)); \ - LV_VG_LITE_ASSERT(false); \ - } \ - } while (0) - -#define LV_VG_LITE_ASSERT_PATH(path) LV_VG_LITE_ASSERT(lv_vg_lite_path_check(path)) -#define LV_VG_LITE_ASSERT_SRC_BUFFER(buffer) LV_VG_LITE_ASSERT(lv_vg_lite_buffer_check(buffer, true)) -#define LV_VG_LITE_ASSERT_DEST_BUFFER(buffer) LV_VG_LITE_ASSERT(lv_vg_lite_buffer_check(buffer, false)) -#define LV_VG_LITE_ASSERT_MATRIX(matrix) LV_VG_LITE_ASSERT(lv_vg_lite_matrix_check(matrix)) - -#define LV_VG_LITE_ALIGN(number, align_bytes) \ - (((number) + ((align_bytes)-1)) & ~((align_bytes)-1)) - -#define LV_VG_LITE_IS_ALIGNED(num, align) (((uintptr_t)(num) & ((align)-1)) == 0) - -#define LV_VG_LITE_IS_INDEX_FMT(fmt) \ - ((fmt) == VG_LITE_INDEX_1 \ - || (fmt) == VG_LITE_INDEX_2 \ - || (fmt) == VG_LITE_INDEX_4 \ - || (fmt) == VG_LITE_INDEX_8) - -/********************** - * TYPEDEFS - **********************/ - -struct lv_draw_vg_lite_unit_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/* Print info */ - -void lv_vg_lite_dump_info(void); - -const char * lv_vg_lite_error_string(vg_lite_error_t error); - -const char * lv_vg_lite_feature_string(vg_lite_feature_t feature); - -const char * lv_vg_lite_buffer_format_string(vg_lite_buffer_format_t format); - -const char * lv_vg_lite_vlc_op_string(uint8_t vlc_op); - -void lv_vg_lite_path_dump_info(const vg_lite_path_t * path); - -void lv_vg_lite_stroke_dump_info(const vg_lite_stroke_t * stroke); - -void lv_vg_lite_buffer_dump_info(const vg_lite_buffer_t * buffer); - -void lv_vg_lite_matrix_dump_info(const vg_lite_matrix_t * matrix); - -bool lv_vg_lite_is_dest_cf_supported(lv_color_format_t cf); - -bool lv_vg_lite_is_src_cf_supported(lv_color_format_t cf); - -/* Converter */ - -vg_lite_buffer_format_t lv_vg_lite_vg_fmt(lv_color_format_t cf); - -void lv_vg_lite_buffer_format_bytes( - vg_lite_buffer_format_t format, - uint32_t * mul, - uint32_t * div, - uint32_t * bytes_align); - -uint32_t lv_vg_lite_width_to_stride(uint32_t w, vg_lite_buffer_format_t color_format); - -uint32_t lv_vg_lite_width_align(uint32_t w); - -void lv_vg_lite_buffer_init( - vg_lite_buffer_t * buffer, - const void * ptr, - int32_t width, - int32_t height, - uint32_t stride, - vg_lite_buffer_format_t format, - bool tiled); - -void lv_vg_lite_buffer_from_draw_buf(vg_lite_buffer_t * buffer, const lv_draw_buf_t * draw_buf); - -void lv_vg_lite_image_matrix(vg_lite_matrix_t * matrix, int32_t x, int32_t y, const lv_draw_image_dsc_t * dsc); - -void lv_vg_lite_image_dec_init(vg_lite_matrix_t * matrix, int32_t x, int32_t y, const lv_draw_image_dsc_t * dsc); - -bool lv_vg_lite_buffer_open_image(vg_lite_buffer_t * buffer, lv_image_decoder_dsc_t * decoder_dsc, const void * src, - bool no_cache, bool premultiply); - -void lv_vg_lite_image_dsc_init(struct lv_draw_vg_lite_unit_t * unit); - -void lv_vg_lite_image_dsc_deinit(struct lv_draw_vg_lite_unit_t * unit); - -vg_lite_blend_t lv_vg_lite_blend_mode(lv_blend_mode_t blend_mode, bool has_pre_mul); - -uint32_t lv_vg_lite_get_palette_size(vg_lite_buffer_format_t format); - -vg_lite_color_t lv_vg_lite_color(lv_color_t color, lv_opa_t opa, bool pre_mul); - -void lv_vg_lite_rect(vg_lite_rectangle_t * rect, const lv_area_t * area); - -void lv_vg_lite_matrix(vg_lite_matrix_t * dest, const lv_matrix_t * src); - -/* Param checker */ - -bool lv_vg_lite_buffer_check(const vg_lite_buffer_t * buffer, bool is_src); - -bool lv_vg_lite_path_check(const vg_lite_path_t * path); - -bool lv_vg_lite_matrix_check(const vg_lite_matrix_t * matrix); - -/* Wrapper */ - -bool lv_vg_lite_support_blend_normal(void); - -bool lv_vg_lite_16px_align(void); - -void lv_vg_lite_matrix_multiply(vg_lite_matrix_t * matrix, const vg_lite_matrix_t * mult); - -bool lv_vg_lite_matrix_inverse(vg_lite_matrix_t * result, const vg_lite_matrix_t * matrix); - -lv_point_precise_t lv_vg_lite_matrix_transform_point(const vg_lite_matrix_t * matrix, const lv_point_precise_t * point); - -void lv_vg_lite_set_scissor_area(const lv_area_t * area); - -void lv_vg_lite_disable_scissor(void); - -void lv_vg_lite_flush(struct lv_draw_vg_lite_unit_t * u); - -void lv_vg_lite_finish(struct lv_draw_vg_lite_unit_t * u); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_DRAW_VG_LITE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*VG_LITE_UTILS_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/README.md b/L3_Middlewares/LVGL/src/drivers/README.md deleted file mode 100644 index f755a3a..0000000 --- a/L3_Middlewares/LVGL/src/drivers/README.md +++ /dev/null @@ -1 +0,0 @@ -High level drivers for display controllers, frame buffers, etc \ No newline at end of file diff --git a/L3_Middlewares/LVGL/src/drivers/display/drm/lv_linux_drm.c b/L3_Middlewares/LVGL/src/drivers/display/drm/lv_linux_drm.c deleted file mode 100644 index 29e0168..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/drm/lv_linux_drm.c +++ /dev/null @@ -1,852 +0,0 @@ -/** - * @file lv_linux_drm.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_linux_drm.h" -#if LV_USE_LINUX_DRM - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/********************* - * DEFINES - *********************/ -#if LV_COLOR_DEPTH == 32 - #define DRM_FOURCC DRM_FORMAT_XRGB8888 -#elif LV_COLOR_DEPTH == 16 - #define DRM_FOURCC DRM_FORMAT_RGB565 -#else - #error LV_COLOR_DEPTH not supported -#endif - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - uint32_t handle; - uint32_t pitch; - uint32_t offset; - unsigned long int size; - uint8_t * map; - uint32_t fb_handle; -} drm_buffer_t; - -typedef struct { - int fd; - uint32_t conn_id, enc_id, crtc_id, plane_id, crtc_idx; - uint32_t width, height; - uint32_t mmWidth, mmHeight; - uint32_t fourcc; - drmModeModeInfo mode; - uint32_t blob_id; - drmModeCrtc * saved_crtc; - drmModeAtomicReq * req; - drmEventContext drm_event_ctx; - drmModePlane * plane; - drmModeCrtc * crtc; - drmModeConnector * conn; - uint32_t count_plane_props; - uint32_t count_crtc_props; - uint32_t count_conn_props; - drmModePropertyPtr plane_props[128]; - drmModePropertyPtr crtc_props[128]; - drmModePropertyPtr conn_props[128]; - drm_buffer_t drm_bufs[2]; /*DUMB buffers*/ -} drm_dev_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static uint32_t get_plane_property_id(drm_dev_t * drm_dev, const char * name); -static uint32_t get_crtc_property_id(drm_dev_t * drm_dev, const char * name); -static uint32_t get_conn_property_id(drm_dev_t * drm_dev, const char * name); -static void page_flip_handler(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, - void * user_data); -static int drm_get_plane_props(drm_dev_t * drm_dev); -static int drm_get_crtc_props(drm_dev_t * drm_dev); -static int drm_get_conn_props(drm_dev_t * drm_dev); -static int drm_add_plane_property(drm_dev_t * drm_dev, const char * name, uint64_t value); -static int drm_add_crtc_property(drm_dev_t * drm_dev, const char * name, uint64_t value); -static int drm_add_conn_property(drm_dev_t * drm_dev, const char * name, uint64_t value); -static int drm_dmabuf_set_plane(drm_dev_t * drm_dev, drm_buffer_t * buf); -static int find_plane(drm_dev_t * drm_dev, unsigned int fourcc, uint32_t * plane_id, uint32_t crtc_id, - uint32_t crtc_idx); -static int drm_find_connector(drm_dev_t * drm_dev, int64_t connector_id); -static int drm_open(const char * path); -static int drm_setup(drm_dev_t * drm_dev, const char * device_path, int64_t connector_id, unsigned int fourcc); -static int drm_allocate_dumb(drm_dev_t * drm_dev, drm_buffer_t * buf); -static int drm_setup_buffers(drm_dev_t * drm_dev); -static void drm_flush_wait(lv_display_t * drm_dev); -static void drm_flush(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map); - -static uint32_t tick_get_cb(void); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ -#ifndef DIV_ROUND_UP - #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_linux_drm_create(void) -{ - lv_tick_set_cb(tick_get_cb); - - drm_dev_t * drm_dev = lv_malloc_zeroed(sizeof(drm_dev_t)); - LV_ASSERT_MALLOC(drm_dev); - if(drm_dev == NULL) return NULL; - - lv_display_t * disp = lv_display_create(800, 480); - if(disp == NULL) { - lv_free(drm_dev); - return NULL; - } - drm_dev->fd = -1; - lv_display_set_driver_data(disp, drm_dev); - lv_display_set_flush_wait_cb(disp, drm_flush_wait); - lv_display_set_flush_cb(disp, drm_flush); - - return disp; -} - -void lv_linux_drm_set_file(lv_display_t * disp, const char * file, int64_t connector_id) -{ - drm_dev_t * drm_dev = lv_display_get_driver_data(disp); - int ret; - - ret = drm_setup(drm_dev, file, connector_id, DRM_FOURCC); - if(ret) { - close(drm_dev->fd); - drm_dev->fd = -1; - return; - } - - ret = drm_setup_buffers(drm_dev); - if(ret) { - LV_LOG_ERROR("DRM buffer allocation failed"); - close(drm_dev->fd); - drm_dev->fd = -1; - return; - } - - LV_LOG_INFO("DRM subsystem and buffer mapped successfully"); - - int32_t hor_res = drm_dev->width; - int32_t ver_res = drm_dev->height; - int32_t width = drm_dev->mmWidth; - - size_t buf_size = LV_MIN(drm_dev->drm_bufs[1].size, drm_dev->drm_bufs[0].size); - /* Resolution must be set first because if the screen is smaller than the size passed - * to lv_display_create then the buffers aren't big enough for LV_DISPLAY_RENDER_MODE_DIRECT. - */ - lv_display_set_resolution(disp, hor_res, ver_res); - lv_display_set_buffers(disp, drm_dev->drm_bufs[1].map, drm_dev->drm_bufs[0].map, buf_size, - LV_DISPLAY_RENDER_MODE_DIRECT); - - if(width) { - lv_display_set_dpi(disp, DIV_ROUND_UP(hor_res * 25400, width * 1000)); - } - - LV_LOG_INFO("Resolution is set to %" LV_PRId32 "x%" LV_PRId32 " at %" LV_PRId32 "dpi", - hor_res, ver_res, lv_display_get_dpi(disp)); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static uint32_t get_plane_property_id(drm_dev_t * drm_dev, const char * name) -{ - uint32_t i; - - LV_LOG_TRACE("Find plane property: %s", name); - - for(i = 0; i < drm_dev->count_plane_props; ++i) - if(!lv_strcmp(drm_dev->plane_props[i]->name, name)) - return drm_dev->plane_props[i]->prop_id; - - LV_LOG_TRACE("Unknown plane property: %s", name); - - return 0; -} - -static uint32_t get_crtc_property_id(drm_dev_t * drm_dev, const char * name) -{ - uint32_t i; - - LV_LOG_TRACE("Find crtc property: %s", name); - - for(i = 0; i < drm_dev->count_crtc_props; ++i) - if(!lv_strcmp(drm_dev->crtc_props[i]->name, name)) - return drm_dev->crtc_props[i]->prop_id; - - LV_LOG_TRACE("Unknown crtc property: %s", name); - - return 0; -} - -static uint32_t get_conn_property_id(drm_dev_t * drm_dev, const char * name) -{ - uint32_t i; - - LV_LOG_TRACE("Find conn property: %s", name); - - for(i = 0; i < drm_dev->count_conn_props; ++i) - if(!lv_strcmp(drm_dev->conn_props[i]->name, name)) - return drm_dev->conn_props[i]->prop_id; - - LV_LOG_TRACE("Unknown conn property: %s", name); - - return 0; -} - -static void page_flip_handler(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, - void * user_data) -{ - LV_UNUSED(fd); - LV_UNUSED(sequence); - LV_UNUSED(tv_sec); - LV_UNUSED(tv_usec); - LV_LOG_TRACE("flip"); - drm_dev_t * drm_dev = user_data; - if(drm_dev->req) { - drmModeAtomicFree(drm_dev->req); - drm_dev->req = NULL; - } -} - -static int drm_get_plane_props(drm_dev_t * drm_dev) -{ - uint32_t i; - - drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(drm_dev->fd, drm_dev->plane_id, - DRM_MODE_OBJECT_PLANE); - if(!props) { - LV_LOG_ERROR("drmModeObjectGetProperties failed"); - return -1; - } - LV_LOG_TRACE("Found %u plane props", props->count_props); - drm_dev->count_plane_props = props->count_props; - for(i = 0; i < props->count_props; i++) { - drm_dev->plane_props[i] = drmModeGetProperty(drm_dev->fd, props->props[i]); - LV_LOG_TRACE("Added plane prop %u:%s", drm_dev->plane_props[i]->prop_id, drm_dev->plane_props[i]->name); - } - drmModeFreeObjectProperties(props); - - return 0; -} - -static int drm_get_crtc_props(drm_dev_t * drm_dev) -{ - uint32_t i; - - drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(drm_dev->fd, drm_dev->crtc_id, - DRM_MODE_OBJECT_CRTC); - if(!props) { - LV_LOG_ERROR("drmModeObjectGetProperties failed"); - return -1; - } - LV_LOG_TRACE("Found %u crtc props", props->count_props); - drm_dev->count_crtc_props = props->count_props; - for(i = 0; i < props->count_props; i++) { - drm_dev->crtc_props[i] = drmModeGetProperty(drm_dev->fd, props->props[i]); - LV_LOG_TRACE("Added crtc prop %u:%s", drm_dev->crtc_props[i]->prop_id, drm_dev->crtc_props[i]->name); - } - drmModeFreeObjectProperties(props); - - return 0; -} - -static int drm_get_conn_props(drm_dev_t * drm_dev) -{ - uint32_t i; - - drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(drm_dev->fd, drm_dev->conn_id, - DRM_MODE_OBJECT_CONNECTOR); - if(!props) { - LV_LOG_ERROR("drmModeObjectGetProperties failed"); - return -1; - } - LV_LOG_TRACE("Found %u connector props", props->count_props); - drm_dev->count_conn_props = props->count_props; - for(i = 0; i < props->count_props; i++) { - drm_dev->conn_props[i] = drmModeGetProperty(drm_dev->fd, props->props[i]); - LV_LOG_TRACE("Added connector prop %u:%s", drm_dev->conn_props[i]->prop_id, drm_dev->conn_props[i]->name); - } - drmModeFreeObjectProperties(props); - - return 0; -} - -static int drm_add_plane_property(drm_dev_t * drm_dev, const char * name, uint64_t value) -{ - int ret; - uint32_t prop_id = get_plane_property_id(drm_dev, name); - - if(!prop_id) { - LV_LOG_ERROR("Couldn't find plane prop %s", name); - return -1; - } - - ret = drmModeAtomicAddProperty(drm_dev->req, drm_dev->plane_id, get_plane_property_id(drm_dev, name), value); - if(ret < 0) { - LV_LOG_ERROR("drmModeAtomicAddProperty (%s:%" PRIu64 ") failed: %d", name, value, ret); - return ret; - } - - return 0; -} - -static int drm_add_crtc_property(drm_dev_t * drm_dev, const char * name, uint64_t value) -{ - int ret; - uint32_t prop_id = get_crtc_property_id(drm_dev, name); - - if(!prop_id) { - LV_LOG_ERROR("Couldn't find crtc prop %s", name); - return -1; - } - - ret = drmModeAtomicAddProperty(drm_dev->req, drm_dev->crtc_id, get_crtc_property_id(drm_dev, name), value); - if(ret < 0) { - LV_LOG_ERROR("drmModeAtomicAddProperty (%s:%" PRIu64 ") failed: %d", name, value, ret); - return ret; - } - - return 0; -} - -static int drm_add_conn_property(drm_dev_t * drm_dev, const char * name, uint64_t value) -{ - int ret; - uint32_t prop_id = get_conn_property_id(drm_dev, name); - - if(!prop_id) { - LV_LOG_ERROR("Couldn't find conn prop %s", name); - return -1; - } - - ret = drmModeAtomicAddProperty(drm_dev->req, drm_dev->conn_id, get_conn_property_id(drm_dev, name), value); - if(ret < 0) { - LV_LOG_ERROR("drmModeAtomicAddProperty (%s:%" PRIu64 ") failed: %d", name, value, ret); - return ret; - } - - return 0; -} - -static int drm_dmabuf_set_plane(drm_dev_t * drm_dev, drm_buffer_t * buf) -{ - int ret; - static int first = 1; - uint32_t flags = DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK; - - drm_dev->req = drmModeAtomicAlloc(); - - /* On first Atomic commit, do a modeset */ - if(first) { - drm_add_conn_property(drm_dev, "CRTC_ID", drm_dev->crtc_id); - - drm_add_crtc_property(drm_dev, "MODE_ID", drm_dev->blob_id); - drm_add_crtc_property(drm_dev, "ACTIVE", 1); - - flags |= DRM_MODE_ATOMIC_ALLOW_MODESET; - - first = 0; - } - - drm_add_plane_property(drm_dev, "FB_ID", buf->fb_handle); - drm_add_plane_property(drm_dev, "CRTC_ID", drm_dev->crtc_id); - drm_add_plane_property(drm_dev, "SRC_X", 0); - drm_add_plane_property(drm_dev, "SRC_Y", 0); - drm_add_plane_property(drm_dev, "SRC_W", drm_dev->width << 16); - drm_add_plane_property(drm_dev, "SRC_H", drm_dev->height << 16); - drm_add_plane_property(drm_dev, "CRTC_X", 0); - drm_add_plane_property(drm_dev, "CRTC_Y", 0); - drm_add_plane_property(drm_dev, "CRTC_W", drm_dev->width); - drm_add_plane_property(drm_dev, "CRTC_H", drm_dev->height); - - ret = drmModeAtomicCommit(drm_dev->fd, drm_dev->req, flags, drm_dev); - if(ret) { - LV_LOG_ERROR("drmModeAtomicCommit failed: %s (%d)", strerror(errno), errno); - drmModeAtomicFree(drm_dev->req); - return ret; - } - - return 0; -} - -static int find_plane(drm_dev_t * drm_dev, unsigned int fourcc, uint32_t * plane_id, uint32_t crtc_id, - uint32_t crtc_idx) -{ - LV_UNUSED(crtc_id); - drmModePlaneResPtr planes; - drmModePlanePtr plane; - unsigned int i; - unsigned int j; - int ret = 0; - unsigned int format = fourcc; - - planes = drmModeGetPlaneResources(drm_dev->fd); - if(!planes) { - LV_LOG_ERROR("drmModeGetPlaneResources failed"); - return -1; - } - - LV_LOG_TRACE("drm: found planes %u", planes->count_planes); - - for(i = 0; i < planes->count_planes; ++i) { - plane = drmModeGetPlane(drm_dev->fd, planes->planes[i]); - if(!plane) { - LV_LOG_ERROR("drmModeGetPlane failed: %s", strerror(errno)); - break; - } - - if(!(plane->possible_crtcs & (1 << crtc_idx))) { - drmModeFreePlane(plane); - continue; - } - - for(j = 0; j < plane->count_formats; ++j) { - if(plane->formats[j] == format) - break; - } - - if(j == plane->count_formats) { - drmModeFreePlane(plane); - continue; - } - - *plane_id = plane->plane_id; - drmModeFreePlane(plane); - - LV_LOG_TRACE("found plane %d", *plane_id); - - break; - } - - if(i == planes->count_planes) - ret = -1; - - drmModeFreePlaneResources(planes); - - return ret; -} - -static int drm_find_connector(drm_dev_t * drm_dev, int64_t connector_id) -{ - drmModeConnector * conn = NULL; - drmModeEncoder * enc = NULL; - drmModeRes * res; - int i; - - if((res = drmModeGetResources(drm_dev->fd)) == NULL) { - LV_LOG_ERROR("drmModeGetResources() failed"); - return -1; - } - - if(res->count_crtcs <= 0) { - LV_LOG_ERROR("no Crtcs"); - goto free_res; - } - - /* find all available connectors */ - for(i = 0; i < res->count_connectors; i++) { - conn = drmModeGetConnector(drm_dev->fd, res->connectors[i]); - if(!conn) - continue; - - if(connector_id >= 0 && conn->connector_id != connector_id) { - drmModeFreeConnector(conn); - continue; - } - - if(conn->connection == DRM_MODE_CONNECTED) { - LV_LOG_TRACE("drm: connector %d: connected", conn->connector_id); - } - else if(conn->connection == DRM_MODE_DISCONNECTED) { - LV_LOG_TRACE("drm: connector %d: disconnected", conn->connector_id); - } - else if(conn->connection == DRM_MODE_UNKNOWNCONNECTION) { - LV_LOG_TRACE("drm: connector %d: unknownconnection", conn->connector_id); - } - else { - LV_LOG_TRACE("drm: connector %d: unknown", conn->connector_id); - } - - if(conn->connection == DRM_MODE_CONNECTED && conn->count_modes > 0) - break; - - drmModeFreeConnector(conn); - conn = NULL; - }; - - if(!conn) { - LV_LOG_ERROR("suitable connector not found"); - goto free_res; - } - - drm_dev->conn_id = conn->connector_id; - LV_LOG_TRACE("conn_id: %d", drm_dev->conn_id); - drm_dev->mmWidth = conn->mmWidth; - drm_dev->mmHeight = conn->mmHeight; - - lv_memcpy(&drm_dev->mode, &conn->modes[0], sizeof(drmModeModeInfo)); - - if(drmModeCreatePropertyBlob(drm_dev->fd, &drm_dev->mode, sizeof(drm_dev->mode), - &drm_dev->blob_id)) { - LV_LOG_ERROR("error creating mode blob"); - goto free_res; - } - - drm_dev->width = conn->modes[0].hdisplay; - drm_dev->height = conn->modes[0].vdisplay; - - for(i = 0 ; i < res->count_encoders; i++) { - enc = drmModeGetEncoder(drm_dev->fd, res->encoders[i]); - if(!enc) - continue; - - LV_LOG_TRACE("enc%d enc_id %d conn enc_id %d", i, enc->encoder_id, conn->encoder_id); - - if(enc->encoder_id == conn->encoder_id) - break; - - drmModeFreeEncoder(enc); - enc = NULL; - } - - if(enc) { - drm_dev->enc_id = enc->encoder_id; - LV_LOG_TRACE("enc_id: %d", drm_dev->enc_id); - drm_dev->crtc_id = enc->crtc_id; - LV_LOG_TRACE("crtc_id: %d", drm_dev->crtc_id); - drmModeFreeEncoder(enc); - } - else { - /* Encoder hasn't been associated yet, look it up */ - for(i = 0; i < conn->count_encoders; i++) { - int crtc, crtc_id = -1; - - enc = drmModeGetEncoder(drm_dev->fd, conn->encoders[i]); - if(!enc) - continue; - - for(crtc = 0 ; crtc < res->count_crtcs; crtc++) { - uint32_t crtc_mask = 1 << crtc; - - crtc_id = res->crtcs[crtc]; - - LV_LOG_TRACE("enc_id %d crtc%d id %d mask %x possible %x", enc->encoder_id, crtc, crtc_id, crtc_mask, - enc->possible_crtcs); - - if(enc->possible_crtcs & crtc_mask) - break; - } - - if(crtc_id > 0) { - drm_dev->enc_id = enc->encoder_id; - LV_LOG_TRACE("enc_id: %d", drm_dev->enc_id); - drm_dev->crtc_id = crtc_id; - LV_LOG_TRACE("crtc_id: %d", drm_dev->crtc_id); - break; - } - - drmModeFreeEncoder(enc); - enc = NULL; - } - - if(!enc) { - LV_LOG_ERROR("suitable encoder not found"); - goto free_res; - } - - drmModeFreeEncoder(enc); - } - - drm_dev->crtc_idx = UINT32_MAX; - - for(i = 0; i < res->count_crtcs; ++i) { - if(drm_dev->crtc_id == res->crtcs[i]) { - drm_dev->crtc_idx = i; - break; - } - } - - if(drm_dev->crtc_idx == UINT32_MAX) { - LV_LOG_ERROR("drm: CRTC not found"); - goto free_res; - } - - LV_LOG_TRACE("crtc_idx: %d", drm_dev->crtc_idx); - - return 0; - -free_res: - drmModeFreeResources(res); - - return -1; -} - -static int drm_open(const char * path) -{ - int fd, flags; - uint64_t has_dumb; - int ret; - - fd = open(path, O_RDWR); - if(fd < 0) { - LV_LOG_ERROR("cannot open \"%s\"", path); - return -1; - } - - /* set FD_CLOEXEC flag */ - if((flags = fcntl(fd, F_GETFD)) < 0 || - fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) { - LV_LOG_ERROR("fcntl FD_CLOEXEC failed"); - goto err; - } - - /* check capability */ - ret = drmGetCap(fd, DRM_CAP_DUMB_BUFFER, &has_dumb); - if(ret < 0 || has_dumb == 0) { - LV_LOG_ERROR("drmGetCap DRM_CAP_DUMB_BUFFER failed or \"%s\" doesn't have dumb " - "buffer", path); - goto err; - } - - return fd; -err: - close(fd); - return -1; -} - -static int drm_setup(drm_dev_t * drm_dev, const char * device_path, int64_t connector_id, unsigned int fourcc) -{ - int ret; - - drm_dev->fd = drm_open(device_path); - if(drm_dev->fd < 0) - return -1; - - ret = drmSetClientCap(drm_dev->fd, DRM_CLIENT_CAP_ATOMIC, 1); - if(ret) { - LV_LOG_ERROR("No atomic modesetting support: %s", strerror(errno)); - goto err; - } - - ret = drm_find_connector(drm_dev, connector_id); - if(ret) { - LV_LOG_ERROR("available drm devices not found"); - goto err; - } - - ret = find_plane(drm_dev, fourcc, &drm_dev->plane_id, drm_dev->crtc_id, drm_dev->crtc_idx); - if(ret) { - LV_LOG_ERROR("Cannot find plane"); - goto err; - } - - drm_dev->plane = drmModeGetPlane(drm_dev->fd, drm_dev->plane_id); - if(!drm_dev->plane) { - LV_LOG_ERROR("Cannot get plane"); - goto err; - } - - drm_dev->crtc = drmModeGetCrtc(drm_dev->fd, drm_dev->crtc_id); - if(!drm_dev->crtc) { - LV_LOG_ERROR("Cannot get crtc"); - goto err; - } - - drm_dev->conn = drmModeGetConnector(drm_dev->fd, drm_dev->conn_id); - if(!drm_dev->conn) { - LV_LOG_ERROR("Cannot get connector"); - goto err; - } - - ret = drm_get_plane_props(drm_dev); - if(ret) { - LV_LOG_ERROR("Cannot get plane props"); - goto err; - } - - ret = drm_get_crtc_props(drm_dev); - if(ret) { - LV_LOG_ERROR("Cannot get crtc props"); - goto err; - } - - ret = drm_get_conn_props(drm_dev); - if(ret) { - LV_LOG_ERROR("Cannot get connector props"); - goto err; - } - - drm_dev->drm_event_ctx.version = DRM_EVENT_CONTEXT_VERSION; - drm_dev->drm_event_ctx.page_flip_handler = page_flip_handler; - drm_dev->fourcc = fourcc; - - LV_LOG_INFO("drm: Found plane_id: %u connector_id: %d crtc_id: %d", - drm_dev->plane_id, drm_dev->conn_id, drm_dev->crtc_id); - - LV_LOG_INFO("drm: %dx%d (%dmm X% dmm) pixel format %c%c%c%c", - drm_dev->width, drm_dev->height, drm_dev->mmWidth, drm_dev->mmHeight, - (fourcc >> 0) & 0xff, (fourcc >> 8) & 0xff, (fourcc >> 16) & 0xff, (fourcc >> 24) & 0xff); - - return 0; - -err: - close(drm_dev->fd); - return -1; -} - -static int drm_allocate_dumb(drm_dev_t * drm_dev, drm_buffer_t * buf) -{ - struct drm_mode_create_dumb creq; - struct drm_mode_map_dumb mreq; - uint32_t handles[4] = {0}, pitches[4] = {0}, offsets[4] = {0}; - int ret; - - /* create dumb buffer */ - lv_memzero(&creq, sizeof(creq)); - creq.width = drm_dev->width; - creq.height = drm_dev->height; - creq.bpp = LV_COLOR_DEPTH; - ret = drmIoctl(drm_dev->fd, DRM_IOCTL_MODE_CREATE_DUMB, &creq); - if(ret < 0) { - LV_LOG_ERROR("DRM_IOCTL_MODE_CREATE_DUMB fail"); - return -1; - } - - buf->handle = creq.handle; - buf->pitch = creq.pitch; - buf->size = creq.size; - - /* prepare buffer for memory mapping */ - lv_memzero(&mreq, sizeof(mreq)); - mreq.handle = creq.handle; - ret = drmIoctl(drm_dev->fd, DRM_IOCTL_MODE_MAP_DUMB, &mreq); - if(ret) { - LV_LOG_ERROR("DRM_IOCTL_MODE_MAP_DUMB fail"); - return -1; - } - - buf->offset = mreq.offset; - LV_LOG_INFO("size %lu pitch %u offset %u", buf->size, buf->pitch, buf->offset); - - /* perform actual memory mapping */ - buf->map = mmap(0, creq.size, PROT_READ | PROT_WRITE, MAP_SHARED, drm_dev->fd, mreq.offset); - if(buf->map == MAP_FAILED) { - LV_LOG_ERROR("mmap fail"); - return -1; - } - - /* clear the framebuffer to 0 (= full transparency in ARGB8888) */ - lv_memzero(buf->map, creq.size); - - /* create framebuffer object for the dumb-buffer */ - handles[0] = creq.handle; - pitches[0] = creq.pitch; - offsets[0] = 0; - ret = drmModeAddFB2(drm_dev->fd, drm_dev->width, drm_dev->height, drm_dev->fourcc, - handles, pitches, offsets, &buf->fb_handle, 0); - if(ret) { - LV_LOG_ERROR("drmModeAddFB fail"); - return -1; - } - - return 0; -} - -static int drm_setup_buffers(drm_dev_t * drm_dev) -{ - int ret; - - /*Allocate DUMB buffers*/ - ret = drm_allocate_dumb(drm_dev, &drm_dev->drm_bufs[0]); - if(ret) - return ret; - - ret = drm_allocate_dumb(drm_dev, &drm_dev->drm_bufs[1]); - if(ret) - return ret; - - return 0; -} - -static void drm_flush_wait(lv_display_t * disp) -{ - drm_dev_t * drm_dev = lv_display_get_driver_data(disp); - - struct pollfd pfd; - pfd.fd = drm_dev->fd; - pfd.events = POLLIN; - - while(drm_dev->req) { - int ret; - do { - ret = poll(&pfd, 1, -1); - } while(ret == -1 && errno == EINTR); - - if(ret > 0) - drmHandleEvent(drm_dev->fd, &drm_dev->drm_event_ctx); - else { - LV_LOG_ERROR("poll failed: %s", strerror(errno)); - return; - } - } -} - -static void drm_flush(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map) -{ - if(!lv_display_flush_is_last(disp)) return; - - LV_UNUSED(area); - LV_UNUSED(px_map); - drm_dev_t * drm_dev = lv_display_get_driver_data(disp); - - for(int idx = 0; idx < 2; idx++) { - if(drm_dev->drm_bufs[idx].map == px_map) { - /*Request buffer swap*/ - if(drm_dmabuf_set_plane(drm_dev, &drm_dev->drm_bufs[idx])) { - LV_LOG_ERROR("Flush fail"); - return; - } - else - LV_LOG_TRACE("Flush done"); - } - } -} - -static uint32_t tick_get_cb(void) -{ - struct timespec t; - clock_gettime(CLOCK_MONOTONIC, &t); - uint64_t time_ms = t.tv_sec * 1000 + (t.tv_nsec / 1000000); - return time_ms; -} - -#endif /*LV_USE_LINUX_DRM*/ diff --git a/L3_Middlewares/LVGL/src/drivers/display/drm/lv_linux_drm.h b/L3_Middlewares/LVGL/src/drivers/display/drm/lv_linux_drm.h deleted file mode 100644 index ee32466..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/drm/lv_linux_drm.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file lv_linux_drm.h - * - */ - -#ifndef LV_LINUX_DRM_H -#define LV_LINUX_DRM_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../../display/lv_display.h" - -#if LV_USE_LINUX_DRM - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ -lv_display_t * lv_linux_drm_create(void); - -void lv_linux_drm_set_file(lv_display_t * disp, const char * file, int64_t connector_id); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_LINUX_DRM */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_LINUX_DRM_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/display/fb/lv_linux_fbdev.c b/L3_Middlewares/LVGL/src/drivers/display/fb/lv_linux_fbdev.c deleted file mode 100644 index 076ada4..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/fb/lv_linux_fbdev.c +++ /dev/null @@ -1,359 +0,0 @@ -/** - * @file lv_linux_fbdev.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_linux_fbdev.h" -#if LV_USE_LINUX_FBDEV - -#include -#include -#include -#include -#include -#include -#include -#include - -#if LV_LINUX_FBDEV_BSD - #include - #include - #include -#else - #include -#endif /* LV_LINUX_FBDEV_BSD */ - -#include "../../../display/lv_display_private.h" -#include "../../../draw/sw/lv_draw_sw.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -struct bsd_fb_var_info { - uint32_t xoffset; - uint32_t yoffset; - uint32_t xres; - uint32_t yres; - int bits_per_pixel; -}; - -struct bsd_fb_fix_info { - long int line_length; - long int smem_len; -}; - -typedef struct { - const char * devname; - lv_color_format_t color_format; -#if LV_LINUX_FBDEV_BSD - struct bsd_fb_var_info vinfo; - struct bsd_fb_fix_info finfo; -#else - struct fb_var_screeninfo vinfo; - struct fb_fix_screeninfo finfo; -#endif /* LV_LINUX_FBDEV_BSD */ - char * fbp; - uint8_t * rotated_buf; - size_t rotated_buf_size; - long int screensize; - int fbfd; - bool force_refresh; -} lv_linux_fb_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p); -static uint32_t tick_get_cb(void); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -#if LV_LINUX_FBDEV_BSD - #define FBIOBLANK FBIO_BLANK -#endif /* LV_LINUX_FBDEV_BSD */ - -#ifndef DIV_ROUND_UP - #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_linux_fbdev_create(void) -{ - lv_tick_set_cb(tick_get_cb); - - lv_linux_fb_t * dsc = lv_malloc_zeroed(sizeof(lv_linux_fb_t)); - LV_ASSERT_MALLOC(dsc); - if(dsc == NULL) return NULL; - - lv_display_t * disp = lv_display_create(800, 480); - if(disp == NULL) { - lv_free(dsc); - return NULL; - } - dsc->fbfd = -1; - lv_display_set_driver_data(disp, dsc); - lv_display_set_flush_cb(disp, flush_cb); - - return disp; -} - -void lv_linux_fbdev_set_file(lv_display_t * disp, const char * file) -{ - char * devname = lv_malloc(lv_strlen(file) + 1); - LV_ASSERT_MALLOC(devname); - if(devname == NULL) return; - lv_strcpy(devname, file); - - lv_linux_fb_t * dsc = lv_display_get_driver_data(disp); - dsc->devname = devname; - - if(dsc->fbfd > 0) close(dsc->fbfd); - - /* Open the file for reading and writing*/ - dsc->fbfd = open(dsc->devname, O_RDWR); - if(dsc->fbfd == -1) { - perror("Error: cannot open framebuffer device"); - return; - } - LV_LOG_INFO("The framebuffer device was opened successfully"); - - /* Make sure that the display is on.*/ - if(ioctl(dsc->fbfd, FBIOBLANK, FB_BLANK_UNBLANK) != 0) { - perror("ioctl(FBIOBLANK)"); - /* Don't return. Some framebuffer drivers like efifb or simplefb don't implement FBIOBLANK.*/ - } - -#if LV_LINUX_FBDEV_BSD - struct fbtype fb; - unsigned line_length; - - /*Get fb type*/ - if(ioctl(dsc->fbfd, FBIOGTYPE, &fb) != 0) { - perror("ioctl(FBIOGTYPE)"); - return; - } - - /*Get screen width*/ - if(ioctl(dsc->fbfd, FBIO_GETLINEWIDTH, &line_length) != 0) { - perror("ioctl(FBIO_GETLINEWIDTH)"); - return; - } - - dsc->vinfo.xres = (unsigned) fb.fb_width; - dsc->vinfo.yres = (unsigned) fb.fb_height; - dsc->vinfo.bits_per_pixel = fb.fb_depth; - dsc->vinfo.xoffset = 0; - dsc->vinfo.yoffset = 0; - dsc->finfo.line_length = line_length; - dsc->finfo.smem_len = dsc->finfo.line_length * dsc->vinfo.yres; -#else /* LV_LINUX_FBDEV_BSD */ - - /* Get fixed screen information*/ - if(ioctl(dsc->fbfd, FBIOGET_FSCREENINFO, &dsc->finfo) == -1) { - perror("Error reading fixed information"); - return; - } - - /* Get variable screen information*/ - if(ioctl(dsc->fbfd, FBIOGET_VSCREENINFO, &dsc->vinfo) == -1) { - perror("Error reading variable information"); - return; - } -#endif /* LV_LINUX_FBDEV_BSD */ - - LV_LOG_INFO("%dx%d, %dbpp", dsc->vinfo.xres, dsc->vinfo.yres, dsc->vinfo.bits_per_pixel); - - /* Figure out the size of the screen in bytes*/ - dsc->screensize = dsc->finfo.smem_len;/*finfo.line_length * vinfo.yres;*/ - - /* Map the device to memory*/ - dsc->fbp = (char *)mmap(0, dsc->screensize, PROT_READ | PROT_WRITE, MAP_SHARED, dsc->fbfd, 0); - if((intptr_t)dsc->fbp == -1) { - perror("Error: failed to map framebuffer device to memory"); - return; - } - - /* Don't initialise the memory to retain what's currently displayed / avoid clearing the screen. - * This is important for applications that only draw to a subsection of the full framebuffer.*/ - - LV_LOG_INFO("The framebuffer device was mapped to memory successfully"); - - switch(dsc->vinfo.bits_per_pixel) { - case 16: - lv_display_set_color_format(disp, LV_COLOR_FORMAT_RGB565); - break; - case 24: - lv_display_set_color_format(disp, LV_COLOR_FORMAT_RGB888); - break; - case 32: - lv_display_set_color_format(disp, LV_COLOR_FORMAT_XRGB8888); - break; - default: - LV_LOG_WARN("Not supported color format (%d bits)", dsc->vinfo.bits_per_pixel); - return; - } - - int32_t hor_res = dsc->vinfo.xres; - int32_t ver_res = dsc->vinfo.yres; - int32_t width = dsc->vinfo.width; - uint32_t draw_buf_size = hor_res * (dsc->vinfo.bits_per_pixel >> 3); - if(LV_LINUX_FBDEV_RENDER_MODE == LV_DISPLAY_RENDER_MODE_PARTIAL) { - draw_buf_size *= LV_LINUX_FBDEV_BUFFER_SIZE; - } - else { - draw_buf_size *= ver_res; - } - - uint8_t * draw_buf = NULL; - uint8_t * draw_buf_2 = NULL; - draw_buf = malloc(draw_buf_size); - - if(LV_LINUX_FBDEV_BUFFER_COUNT == 2) { - draw_buf_2 = malloc(draw_buf_size); - } - - lv_display_set_resolution(disp, hor_res, ver_res); - lv_display_set_buffers(disp, draw_buf, draw_buf_2, draw_buf_size, LV_LINUX_FBDEV_RENDER_MODE); - - if(width > 0) { - lv_display_set_dpi(disp, DIV_ROUND_UP(hor_res * 254, width * 10)); - } - - LV_LOG_INFO("Resolution is set to %" LV_PRId32 "x%" LV_PRId32 " at %" LV_PRId32 "dpi", - hor_res, ver_res, lv_display_get_dpi(disp)); -} - -void lv_linux_fbdev_set_force_refresh(lv_display_t * disp, bool enabled) -{ - lv_linux_fb_t * dsc = lv_display_get_driver_data(disp); - dsc->force_refresh = enabled; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p) -{ - lv_linux_fb_t * dsc = lv_display_get_driver_data(disp); - - if(dsc->fbp == NULL) { - lv_display_flush_ready(disp); - return; - } - - int32_t w = lv_area_get_width(area); - int32_t h = lv_area_get_height(area); - lv_color_format_t cf = lv_display_get_color_format(disp); - uint32_t px_size = lv_color_format_get_size(cf); - - lv_area_t rotated_area; - lv_display_rotation_t rotation = lv_display_get_rotation(disp); - - /* Not all framebuffer kernel drivers support hardware rotation, so we need to handle it in software here */ - if(rotation != LV_DISPLAY_ROTATION_0 && LV_LINUX_FBDEV_RENDER_MODE == LV_DISPLAY_RENDER_MODE_PARTIAL) { - /* (Re)allocate temporary buffer if needed */ - size_t buf_size = w * h * px_size; - if(!dsc->rotated_buf || dsc->rotated_buf_size != buf_size) { - dsc->rotated_buf = realloc(dsc->rotated_buf, buf_size); - dsc->rotated_buf_size = buf_size; - } - - /* Rotate the pixel buffer */ - uint32_t w_stride = lv_draw_buf_width_to_stride(w, cf); - uint32_t h_stride = lv_draw_buf_width_to_stride(h, cf); - - switch(rotation) { - case LV_DISPLAY_ROTATION_0: - break; - case LV_DISPLAY_ROTATION_90: - lv_draw_sw_rotate(color_p, dsc->rotated_buf, w, h, w_stride, h_stride, rotation, cf); - break; - case LV_DISPLAY_ROTATION_180: - lv_draw_sw_rotate(color_p, dsc->rotated_buf, w, h, w_stride, w_stride, rotation, cf); - break; - case LV_DISPLAY_ROTATION_270: - lv_draw_sw_rotate(color_p, dsc->rotated_buf, w, h, w_stride, h_stride, rotation, cf); - break; - } - color_p = dsc->rotated_buf; - - /* Rotate the area */ - rotated_area = *area; - lv_display_rotate_area(disp, &rotated_area); - area = &rotated_area; - - if(rotation != LV_DISPLAY_ROTATION_180) { - w = lv_area_get_width(area); - h = lv_area_get_height(area); - } - } - - /* Ensure that we're within the framebuffer's bounds */ - if(area->x2 < 0 || area->y2 < 0 || area->x1 > (int32_t)dsc->vinfo.xres - 1 || area->y1 > (int32_t)dsc->vinfo.yres - 1) { - lv_display_flush_ready(disp); - return; - } - - uint32_t fb_pos = - (area->x1 + dsc->vinfo.xoffset) * px_size + - (area->y1 + dsc->vinfo.yoffset) * dsc->finfo.line_length; - - uint8_t * fbp = (uint8_t *)dsc->fbp; - int32_t y; - if(LV_LINUX_FBDEV_RENDER_MODE == LV_DISPLAY_RENDER_MODE_DIRECT) { - uint32_t color_pos = - area->x1 * px_size + - area->y1 * disp->hor_res * px_size; - - for(y = area->y1; y <= area->y2; y++) { - lv_memcpy(&fbp[fb_pos], &color_p[color_pos], w * px_size); - fb_pos += dsc->finfo.line_length; - color_pos += disp->hor_res * px_size; - } - } - else { - w = lv_area_get_width(area); - for(y = area->y1; y <= area->y2; y++) { - lv_memcpy(&fbp[fb_pos], color_p, w * px_size); - fb_pos += dsc->finfo.line_length; - color_p += w * px_size; - } - } - - if(dsc->force_refresh) { - dsc->vinfo.activate |= FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE; - if(ioctl(dsc->fbfd, FBIOPUT_VSCREENINFO, &(dsc->vinfo)) == -1) { - perror("Error setting var screen info"); - } - } - - lv_display_flush_ready(disp); -} - -static uint32_t tick_get_cb(void) -{ - struct timespec t; - clock_gettime(CLOCK_MONOTONIC, &t); - uint64_t time_ms = t.tv_sec * 1000 + (t.tv_nsec / 1000000); - return time_ms; -} - -#endif /*LV_USE_LINUX_FBDEV*/ diff --git a/L3_Middlewares/LVGL/src/drivers/display/fb/lv_linux_fbdev.h b/L3_Middlewares/LVGL/src/drivers/display/fb/lv_linux_fbdev.h deleted file mode 100644 index 2c41aec..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/fb/lv_linux_fbdev.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file lv_linux_fbdev.h - * - */ - -#ifndef LV_LINUX_FBDEV_H -#define LV_LINUX_FBDEV_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../../display/lv_display.h" - -#if LV_USE_LINUX_FBDEV - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ -lv_display_t * lv_linux_fbdev_create(void); - -void lv_linux_fbdev_set_file(lv_display_t * disp, const char * file); - -/** - * Force the display to be refreshed on every change. - * Expected to be used with LV_DISPLAY_RENDER_MODE_DIRECT or LV_DISPLAY_RENDER_MODE_FULL. - */ -void lv_linux_fbdev_set_force_refresh(lv_display_t * disp, bool enabled); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_LINUX_FBDEV */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_LINUX_FBDEV_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/display/ili9341/lv_ili9341.c b/L3_Middlewares/LVGL/src/drivers/display/ili9341/lv_ili9341.c deleted file mode 100644 index a6b2acf..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/ili9341/lv_ili9341.c +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @file lv_ili9341.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_ili9341.h" - -#if LV_USE_ILI9341 - -/********************* - * DEFINES - *********************/ - -#define CMD_FRMCTR1 0xB1 /* Frame Rate Control (In Normal Mode/Full Colors) */ -#define CMD_FRMCTR2 0xB2 /* Frame Rate Control (In Idle Mode/8 colors) */ -#define CMD_FRMCTR3 0xB3 /* Frame Rate control (In Partial Mode/Full Colors) */ -#define CMD_INVCTR 0xB4 /* Display Inversion Control */ -#define CMD_DFUNCTR 0xB6 /* Display Function Control */ -#define CMD_PWCTR1 0xC0 /* Power Control 1 */ -#define CMD_PWCTR2 0xC1 /* Power Control 2 */ -#define CMD_VMCTR1 0xC5 /* VCOM Control 1 */ -#define CMD_VMCTR2 0xC7 /* VCOM Control 2 */ -#define CMD_PWCTRA 0xCB /* Power Control A */ -#define CMD_PWCTRB 0xCF /* Power Control B */ -#define CMD_GMCTRP1 0xE0 /* Positive Gamma Correction */ -#define CMD_GMCTRN1 0xE1 /* Negative Gamma Correction */ -#define CMD_DTCTRA 0xE8 /* Driver timing control A */ -#define CMD_DTCTRB 0xEA /* Driver timing control B */ -#define CMD_PONSEQ 0xED /* Power On Sequence */ -#define CMD_RDINDEX 0xD9 /* ili9341 */ -#define CMD_IDXRD 0xDD /* ILI9341 only, indexed control register read */ -#define CMD_ENA3G 0xF2 /* Enable 3 Gamma control */ -#define CMD_IFCTR 0xF6 /* Interface Control */ -#define CMD_PRCTR 0xF7 /* Pump ratio control */ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC CONSTANTS - **********************/ - -/* init commands based on LovyanGFX ILI9341 driver */ -static const uint8_t init_cmd_list[] = { - CMD_PWCTRB, 3, 0x00, 0xC1, 0x30, - CMD_PONSEQ, 4, 0x64, 0x03, 0x12, 0x81, - CMD_DTCTRA, 3, 0x85, 0x00, 0x78, - CMD_PWCTRA, 5, 0x39, 0x2C, 0x00, 0x34, 0x02, - CMD_PRCTR, 1, 0x20, - CMD_DTCTRB, 2, 0x00, 0x00, - CMD_PWCTR1, 1, 0x23, - CMD_PWCTR2, 1, 0x10, - CMD_VMCTR1, 2, 0x3e, 0x28, - CMD_VMCTR2, 1, 0x86, - CMD_FRMCTR1, 2, 0x00, 0x13, - CMD_DFUNCTR, 2, 0x0A, 0xA2, - CMD_IFCTR, 3, 0x09, 0x30, 0x00, - CMD_ENA3G, 1, 0x00, - LV_LCD_CMD_SET_GAMMA_CURVE, 1, 0x01, - CMD_GMCTRP1, 15, 0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, 0x4E, 0xF1, 0x37, 0x07, 0x10, 0x03, 0x0E, 0x09, 0x00, - CMD_GMCTRN1, 15, 0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F, - LV_LCD_CMD_DELAY_MS, LV_LCD_CMD_EOF -}; - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_ili9341_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags, - lv_ili9341_send_cmd_cb_t send_cmd_cb, lv_ili9341_send_color_cb_t send_color_cb) -{ - lv_display_t * disp = lv_lcd_generic_mipi_create(hor_res, ver_res, flags, send_cmd_cb, send_color_cb); - lv_lcd_generic_mipi_send_cmd_list(disp, init_cmd_list); - return disp; -} - -void lv_ili9341_set_gap(lv_display_t * disp, uint16_t x, uint16_t y) -{ - lv_lcd_generic_mipi_set_gap(disp, x, y); -} - -void lv_ili9341_set_invert(lv_display_t * disp, bool invert) -{ - lv_lcd_generic_mipi_set_invert(disp, invert); -} - -void lv_ili9341_set_gamma_curve(lv_display_t * disp, uint8_t gamma) -{ - lv_lcd_generic_mipi_set_gamma_curve(disp, gamma); -} - -void lv_ili9341_send_cmd_list(lv_display_t * disp, const uint8_t * cmd_list) -{ - lv_lcd_generic_mipi_send_cmd_list(disp, cmd_list); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_ILI9341*/ diff --git a/L3_Middlewares/LVGL/src/drivers/display/ili9341/lv_ili9341.h b/L3_Middlewares/LVGL/src/drivers/display/ili9341/lv_ili9341.h deleted file mode 100644 index 78e9030..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/ili9341/lv_ili9341.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @file lv_ili9341.h - * - * This driver is just a wrapper around the generic MIPI compatible LCD controller driver - * - */ - -#ifndef LV_ILI9341_H -#define LV_ILI9341_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../lcd/lv_lcd_generic_mipi.h" - -#if LV_USE_ILI9341 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef lv_lcd_send_cmd_cb_t lv_ili9341_send_cmd_cb_t; -typedef lv_lcd_send_color_cb_t lv_ili9341_send_color_cb_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an LCD display with ILI9341 driver - * @param hor_res horizontal resolution - * @param ver_res vertical resolution - * @param flags default configuration settings (mirror, RGB ordering, etc.) - * @param send_cmd platform-dependent function to send a command to the LCD controller (usually uses polling transfer) - * @param send_color platform-dependent function to send pixel data to the LCD controller (usually uses DMA transfer: must implement a 'ready' callback) - * @return pointer to the created display - */ -lv_display_t * lv_ili9341_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags, - lv_ili9341_send_cmd_cb_t send_cmd_cb, lv_ili9341_send_color_cb_t send_color_cb); - -/** - * Set gap, i.e., the offset of the (0,0) pixel in the VRAM - * @param disp display object - * @param x x offset - * @param y y offset - */ -void lv_ili9341_set_gap(lv_display_t * disp, uint16_t x, uint16_t y); - -/** - * Set color inversion - * @param disp display object - * @param invert false: normal, true: invert - */ -void lv_ili9341_set_invert(lv_display_t * disp, bool invert); - -/** - * Set gamma curve - * @param disp display object - * @param gamma gamma curve - */ -void lv_ili9341_set_gamma_curve(lv_display_t * disp, uint8_t gamma); - -/** - * Send list of commands. - * @param disp display object - * @param cmd_list controller and panel-specific commands - */ -void lv_ili9341_send_cmd_list(lv_display_t * disp, const uint8_t * cmd_list); - -/********************** - * OTHERS - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_USE_ILI9341*/ - -#endif /* LV_ILI9341_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/display/lcd/lv_lcd_generic_mipi.c b/L3_Middlewares/LVGL/src/drivers/display/lcd/lv_lcd_generic_mipi.c deleted file mode 100644 index e27e4c8..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/lcd/lv_lcd_generic_mipi.c +++ /dev/null @@ -1,340 +0,0 @@ -/** - * @file lv_lcd_generic_mipi.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_lcd_generic_mipi.h" - -#if LV_USE_GENERIC_MIPI - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void send_cmd(lv_lcd_generic_mipi_driver_t * drv, uint8_t cmd, uint8_t * param, size_t param_size); -static void send_color(lv_lcd_generic_mipi_driver_t * drv, uint8_t cmd, uint8_t * param, size_t param_size); -static void init(lv_lcd_generic_mipi_driver_t * drv, lv_lcd_flag_t flags); -static void set_mirror(lv_lcd_generic_mipi_driver_t * drv, bool mirror_x, bool mirror_y); -static void set_swap_xy(lv_lcd_generic_mipi_driver_t * drv, bool swap); -static void set_rotation(lv_lcd_generic_mipi_driver_t * drv, lv_display_rotation_t rot); -static void res_chg_event_cb(lv_event_t * e); -static lv_lcd_generic_mipi_driver_t * get_driver(lv_display_t * disp); -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_lcd_generic_mipi_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags, - lv_lcd_send_cmd_cb_t send_cmd_cb, lv_lcd_send_color_cb_t send_color_cb) -{ - lv_display_t * disp = lv_display_create(hor_res, ver_res); - if(disp == NULL) { - return NULL; - } - - lv_lcd_generic_mipi_driver_t * drv = (lv_lcd_generic_mipi_driver_t *)lv_malloc(sizeof(lv_lcd_generic_mipi_driver_t)); - if(drv == NULL) { - lv_display_delete(disp); - return NULL; - } - - /* init driver struct */ - drv->disp = disp; - drv->send_cmd = send_cmd_cb; - drv->send_color = send_color_cb; - lv_display_set_driver_data(disp, (void *)drv); - - /* init controller */ - init(drv, flags); - - /* register resolution change callback (NOTE: this handles screen rotation as well) */ - lv_display_add_event_cb(disp, res_chg_event_cb, LV_EVENT_RESOLUTION_CHANGED, NULL); - - /* register flush callback */ - lv_display_set_flush_cb(disp, flush_cb); - - return disp; -} - -void lv_lcd_generic_mipi_set_gap(lv_display_t * disp, uint16_t x, uint16_t y) -{ - lv_lcd_generic_mipi_driver_t * drv = get_driver(disp); - drv->x_gap = x; - drv->y_gap = y; -} - -void lv_lcd_generic_mipi_set_invert(lv_display_t * disp, bool invert) -{ - lv_lcd_generic_mipi_driver_t * drv = get_driver(disp); - send_cmd(drv, invert ? LV_LCD_CMD_ENTER_INVERT_MODE : LV_LCD_CMD_EXIT_INVERT_MODE, NULL, 0); -} - -void lv_lcd_generic_mipi_set_address_mode(lv_display_t * disp, bool mirror_x, bool mirror_y, bool swap_xy, bool bgr) -{ - lv_lcd_generic_mipi_driver_t * drv = get_driver(disp); - uint8_t mad = drv->madctl_reg & ~(LV_LCD_MASK_RGB_ORDER); - if(bgr) { - mad |= LV_LCD_BIT_RGB_ORDER__BGR; - } - drv->madctl_reg = mad; - drv->mirror_x = mirror_x; - drv->mirror_y = mirror_y; - drv->swap_xy = swap_xy; - set_rotation(drv, lv_display_get_rotation(disp)); /* update screen */ -} - -void lv_lcd_generic_mipi_set_gamma_curve(lv_display_t * disp, uint8_t gamma) -{ - lv_lcd_generic_mipi_driver_t * drv = get_driver(disp); - send_cmd(drv, LV_LCD_CMD_SET_GAMMA_CURVE, (uint8_t[]) { - gamma, - }, 1); -} - -void lv_lcd_generic_mipi_send_cmd_list(lv_display_t * disp, const uint8_t * cmd_list) -{ - lv_lcd_generic_mipi_driver_t * drv = get_driver(disp); - while(1) { - uint8_t cmd = *cmd_list++; - uint8_t num = *cmd_list++; - if(cmd == LV_LCD_CMD_DELAY_MS) { - if(num == LV_LCD_CMD_EOF) /* end of list */ - break; - else { /* delay in 10 ms units*/ - lv_delay_ms((uint32_t)(num) * 10); - } - } - else { - drv->send_cmd(drv->disp, &cmd, 1, cmd_list, num); - cmd_list += num; - } - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Helper function to call the user-supplied 'send_cmd' function - * @param drv LCD driver object - * @param cmd command byte - * @param param parameter buffer - * @param param_size number of bytes of the parameters - */ -static void send_cmd(lv_lcd_generic_mipi_driver_t * drv, uint8_t cmd, uint8_t * param, size_t param_size) -{ - uint8_t cmdbuf = cmd; /* MIPI uses 8 bit commands */ - drv->send_cmd(drv->disp, &cmdbuf, 1, param, param_size); -} - -/** - * Helper function to call the user-supplied 'send_color' function - * @param drv LCD driver object - * @param cmd command byte - * @param param parameter buffer - * @param param_size number of bytes of the parameters - */ -static void send_color(lv_lcd_generic_mipi_driver_t * drv, uint8_t cmd, uint8_t * param, size_t param_size) -{ - uint8_t cmdbuf = cmd; /* MIPI uses 8 bit commands */ - drv->send_color(drv->disp, &cmdbuf, 1, param, param_size); -} - -/** - * Initialize LCD driver after a hard reset - * @param drv LCD driver object - */ -static void init(lv_lcd_generic_mipi_driver_t * drv, lv_lcd_flag_t flags) -{ - drv->x_gap = 0; - drv->y_gap = 0; - - /* init color mode and RGB order */ - drv->madctl_reg = flags & LV_LCD_FLAG_BGR ? LV_LCD_BIT_RGB_ORDER__BGR : LV_LCD_BIT_RGB_ORDER__RGB; - drv->colmod_reg = flags & LV_LCD_FLAG_RGB666 ? LV_LCD_PIXEL_FORMAT_RGB666 : LV_LCD_PIXEL_FORMAT_RGB565; - - /* init orientation */ - drv->mirror_x = flags & LV_LCD_FLAG_MIRROR_X; - drv->mirror_y = flags & LV_LCD_FLAG_MIRROR_Y; - drv->swap_xy = false; - /* update madctl_reg */ - set_swap_xy(drv, drv->swap_xy); - set_mirror(drv, drv->mirror_x, drv->mirror_y); - - /* enter sleep mode first */ - send_cmd(drv, LV_LCD_CMD_ENTER_SLEEP_MODE, NULL, 0); - lv_delay_ms(10); - - /* perform software reset */ - send_cmd(drv, LV_LCD_CMD_SOFT_RESET, NULL, 0); - lv_delay_ms(200); - - /* LCD goes into sleep mode and display will be turned off after power on reset, exit sleep mode first */ - send_cmd(drv, LV_LCD_CMD_EXIT_SLEEP_MODE, NULL, 0); - lv_delay_ms(300); - - send_cmd(drv, LV_LCD_CMD_ENTER_NORMAL_MODE, NULL, 0); - - send_cmd(drv, LV_LCD_CMD_SET_ADDRESS_MODE, (uint8_t[]) { - drv->madctl_reg, - }, 1); - send_cmd(drv, LV_LCD_CMD_SET_PIXEL_FORMAT, (uint8_t[]) { - drv->colmod_reg, - }, 1); - send_cmd(drv, LV_LCD_CMD_SET_DISPLAY_ON, NULL, 0); -} - -/** - * Set readout directions (used for rotating the display) - * @param drv LCD driver object - * @param mirror_x false: normal, true: mirrored - * @param mirror_y false: normal, true: mirrored - */ -static void set_mirror(lv_lcd_generic_mipi_driver_t * drv, bool mirror_x, bool mirror_y) -{ - uint8_t mad = drv->madctl_reg & ~(LV_LCD_MASK_COLUMN_ADDRESS_ORDER | LV_LCD_MASK_PAGE_ADDRESS_ORDER); - if(mirror_x) { - mad |= LV_LCD_BIT_COLUMN_ADDRESS_ORDER__RTOL; - } - if(mirror_y) { - mad |= LV_LCD_BIT_PAGE_ADDRESS_ORDER__BTOT; - } - drv->madctl_reg = mad; -} - -/** - * Swap horizontal and vertical readout (used for rotating the display) - * @param drv LCD driver object - * @param swap false: normal, true: swapped - */ -static void set_swap_xy(lv_lcd_generic_mipi_driver_t * drv, bool swap) -{ - uint8_t mad = drv->madctl_reg & ~(LV_LCD_MASK_PAGE_COLUMN_ORDER); - if(swap) { - mad |= LV_LCD_BIT_PAGE_COLUMN_ORDER__REVERSE; - } - drv->madctl_reg = mad; -} - -/** - * Flush display buffer to the LCD - * @param disp display object - * @param hor_res horizontal resolution - * @param area area stored in the buffer - * @param px_map buffer containing pixel data - * @note transfers pixel data to the LCD controller using the callbacks 'send_cmd' and 'send_color', which were - * passed to the 'lv_st7789_create()' function - */ -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map) -{ - lv_lcd_generic_mipi_driver_t * drv = get_driver(disp); - - int32_t x_start = area->x1; - int32_t x_end = area->x2 + 1; - int32_t y_start = area->y1; - int32_t y_end = area->y2 + 1; - - LV_ASSERT((x_start < x_end) && (y_start < y_end) && "start position must be smaller than end position"); - - x_start += drv->x_gap; - x_end += drv->x_gap; - y_start += drv->y_gap; - y_end += drv->y_gap; - - /* define an area of frame memory where MCU can access */ - send_cmd(drv, LV_LCD_CMD_SET_COLUMN_ADDRESS, (uint8_t[]) { - (x_start >> 8) & 0xFF, - x_start & 0xFF, - ((x_end - 1) >> 8) & 0xFF, - (x_end - 1) & 0xFF, - }, 4); - send_cmd(drv, LV_LCD_CMD_SET_PAGE_ADDRESS, (uint8_t[]) { - (y_start >> 8) & 0xFF, - y_start & 0xFF, - ((y_end - 1) >> 8) & 0xFF, - (y_end - 1) & 0xFF, - }, 4); - /* transfer frame buffer */ - size_t len = (x_end - x_start) * (y_end - y_start) * lv_color_format_get_size(lv_display_get_color_format(disp)); - send_color(drv, LV_LCD_CMD_WRITE_MEMORY_START, px_map, len); -} - -/** - * Set rotation taking into account the current mirror and swap settings - * @param drv LCD driver object - * @param rot rotation - */ -static void set_rotation(lv_lcd_generic_mipi_driver_t * drv, lv_display_rotation_t rot) -{ - switch(rot) { - case LV_DISPLAY_ROTATION_0: - set_swap_xy(drv, drv->swap_xy); - set_mirror(drv, drv->mirror_x, drv->mirror_y); - break; - case LV_DISPLAY_ROTATION_90: - set_swap_xy(drv, !drv->swap_xy); - set_mirror(drv, drv->mirror_x, !drv->mirror_y); - break; - case LV_DISPLAY_ROTATION_180: - set_swap_xy(drv, drv->swap_xy); - set_mirror(drv, !drv->mirror_x, !drv->mirror_y); - break; - case LV_DISPLAY_ROTATION_270: - set_swap_xy(drv, !drv->swap_xy); - set_mirror(drv, !drv->mirror_x, drv->mirror_y); - break; - } - send_cmd(drv, LV_LCD_CMD_SET_ADDRESS_MODE, (uint8_t[]) { - drv->madctl_reg - }, 1); -} - -/** - * Handle LV_EVENT_RESOLUTION_CHANGED event (handles both resolution and rotation change) - * @param e LV_EVENT_RESOLUTION_CHANGED event - */ -static void res_chg_event_cb(lv_event_t * e) -{ - lv_display_t * disp = lv_event_get_current_target(e); - lv_lcd_generic_mipi_driver_t * drv = get_driver(disp); - - uint16_t hor_res = lv_display_get_horizontal_resolution(disp); - uint16_t ver_res = lv_display_get_vertical_resolution(disp); - lv_display_rotation_t rot = lv_display_get_rotation(disp); - - /* TODO: implement resolution change */ - LV_UNUSED(hor_res); - LV_UNUSED(ver_res); - - /* handle rotation */ - set_rotation(drv, rot); -} - -static lv_lcd_generic_mipi_driver_t * get_driver(lv_display_t * disp) -{ - return (lv_lcd_generic_mipi_driver_t *)lv_display_get_driver_data(disp); -} - -#endif /*LV_USE_GENERIC_MIPI*/ diff --git a/L3_Middlewares/LVGL/src/drivers/display/lcd/lv_lcd_generic_mipi.h b/L3_Middlewares/LVGL/src/drivers/display/lcd/lv_lcd_generic_mipi.h deleted file mode 100644 index 8daa5e0..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/lcd/lv_lcd_generic_mipi.h +++ /dev/null @@ -1,241 +0,0 @@ -/** - * @file lv_lcd_generic_mipi.h - * - * Generic driver for controllers adhering to the MIPI DBI/DCS specification - * - * Works with: - * - * ST7735 - * ST7789 - * ST7796 - * ILI9341 - * ILI9488 (NOTE: in SPI mode ILI9488 only supports RGB666 mode, which is currently not supported) - * - * any probably many more - * - */ - -#ifndef LV_LCD_GENERIC_MIPI_H -#define LV_LCD_GENERIC_MIPI_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../../display/lv_display.h" - -#if LV_USE_GENERIC_MIPI - -/********************* - * DEFINES - *********************/ - -/* MIPI DCS (Display Command Set) v1.02.00 User Command Set */ -#define LV_LCD_CMD_NOP 0x00 /* No Operation */ -#define LV_LCD_CMD_SOFT_RESET 0x01 /* Software Reset */ -#define LV_LCD_CMD_GET_POWER_MODE 0x0A /* Get the current power mode */ -#define LV_LCD_CMD_GET_ADDRESS_MODE 0x0B /* Get the data order for transfers from the Host to the display module and from the frame memory to the display device */ -#define LV_LCD_CMD_GET_PIXEL_FORMAT 0x0C /* Get the current pixel format */ -#define LV_LCD_CMD_GET_DISPLAY_MODE 0x0D /* Get the current display mode from the peripheral */ -#define LV_LCD_CMD_GET_SIGNAL_MODE 0x0E /* Get display module signaling mode */ -#define LV_LCD_CMD_GET_DIAGNOSTIC_RESULT 0x0F /* Get Peripheral Self-Diagnostic Result */ -#define LV_LCD_CMD_ENTER_SLEEP_MODE 0x10 /* Power for the display panel is off */ -#define LV_LCD_CMD_EXIT_SLEEP_MODE 0x11 /* Power for the display panel is on */ -#define LV_LCD_CMD_ENTER_PARTIAL_MODE 0x12 /* Part of the display area is used for image display */ -#define LV_LCD_CMD_ENTER_NORMAL_MODE 0x13 /* The whole display area is used for image display */ -#define LV_LCD_CMD_EXIT_INVERT_MODE 0x20 /* Displayed image colors are not inverted */ -#define LV_LCD_CMD_ENTER_INVERT_MODE 0x21 /* Displayed image colors are inverted */ -#define LV_LCD_CMD_SET_GAMMA_CURVE 0x26 /* Selects the gamma curve used by the display device */ -#define LV_LCD_CMD_SET_DISPLAY_OFF 0x28 /* Blanks the display device */ -#define LV_LCD_CMD_SET_DISPLAY_ON 0x29 /* Show the image on the display device */ -#define LV_LCD_CMD_SET_COLUMN_ADDRESS 0x2A /* Set the column extent */ -#define LV_LCD_CMD_SET_PAGE_ADDRESS 0x2B /* Set the page extent */ -#define LV_LCD_CMD_WRITE_MEMORY_START 0x2C /* Transfer image data from the Host Processor to the peripheral starting at the location provided by set_column_address and set_page_address */ -#define LV_LCD_CMD_READ_MEMORY_START 0x2E /* Transfer image data from the peripheral to the Host Processor interface starting at the location provided by set_column_address and set_page_address */ -#define LV_LCD_CMD_SET_PARTIAL_ROWS 0x30 /* Defines the number of rows in the partial display area on the display device */ -#define LV_LCD_CMD_SET_PARTIAL_COLUMNS 0x31 /* Defines the number of columns in the partial display area on the display device */ -#define LV_LCD_CMD_SET_SCROLL_AREA 0x33 /* Defines the vertical scrolling and fixed area on display device */ -#define LV_LCD_CMD_SET_TEAR_OFF 0x34 /* Synchronization information is not sent from the display module to the host processor */ -#define LV_LCD_CMD_SET_TEAR_ON 0x35 /* Synchronization information is sent from the display module to the host processor at the start of VFP */ -#define LV_LCD_CMD_SET_ADDRESS_MODE 0x36 /* Set the data order for transfers from the Host to the display module and from the frame memory to the display device */ -#define LV_LCD_CMD_SET_SCROLL_START 0x37 /* Defines the vertical scrolling starting point */ -#define LV_LCD_CMD_EXIT_IDLE_MODE 0x38 /* Full color depth is used on the display panel */ -#define LV_LCD_CMD_ENTER_IDLE_MODE 0x39 /* Reduced color depth is used on the display panel */ -#define LV_LCD_CMD_SET_PIXEL_FORMAT 0x3A /* Defines how many bits per pixel are used in the interface */ -#define LV_LCD_CMD_WRITE_MEMORY_CONTINUE 0x3C /* Transfer image information from the Host Processor interface to the peripheral from the last written location */ -#define LV_LCD_CMD_READ_MEMORY_CONTINUE 0x3E /* Read image data from the peripheral continuing after the last read_memory_continue or read_memory_start */ -#define LV_LCD_CMD_SET_TEAR_SCANLINE 0x44 /* Synchronization information is sent from the display module to the host processor when the display device refresh reaches the provided scanline */ -#define LV_LCD_CMD_GET_SCANLINE 0x45 /* Get the current scanline */ -#define LV_LCD_CMD_READ_DDB_CONTINUE 0xA8 /* Continue reading the DDB from the last read location */ -#define LV_LCD_CMD_READ_DDB_START 0xA1 /* Read the DDB from the provided location */ - -/* address mode flag masks */ -#define LV_LCD_MASK_FLIP_VERTICAL (1 << 0) /* This bit flips the image shown on the display device top to bottom. No change is made to the frame memory */ -#define LV_LCD_MASK_FLIP_HORIZONTAL (1 << 1) /* This bit flips the image shown on the display device left to right. No change is made to the frame memory */ -#define LV_LCD_MASK_DATA_LATCH_DATA_ORDER (1 << 2) /* Display Data Latch Order */ -#define LV_LCD_MASK_RGB_ORDER (1 << 3) /* RGB/BGR Order */ -#define LV_LCD_MASK_LINE_ADDRESS_ORDER (1 << 4) /* Line Address Order */ -#define LV_LCD_MASK_PAGE_COLUMN_ORDER (1 << 5) /* Page/Column Order */ -#define LV_LCD_MASK_COLUMN_ADDRESS_ORDER (1 << 6) /* Column Address Order */ -#define LV_LCD_MASK_PAGE_ADDRESS_ORDER (1 << 7) /* Page Address Order */ - -#define LV_LCD_BIT_FLIP_VERTICAL__NOT_FLIPPED 0 -#define LV_LCD_BIT_FLIP_VERTICAL__FLIPPED LV_LCD_MASK_FLIP_VERTICAL /* This bit flips the image shown on the display device top to bottom. No change is made to the frame memory */ -#define LV_LCD_BIT_FLIP_HORIZONTAL__NOT_FLIPPED 0 -#define LV_LCD_BIT_FLIP_HORIZONTAL__FLIPPED LV_LCD_MASK_FLIP_HORIZONTAL /* This bit flips the image shown on the display device left to right. No change is made to the frame memory */ -#define LV_LCD_BIT_DATA_LATCH_DATA_ORDER__LTOR 0 /* Display Data Latch Order: LCD Refresh Left to Right */ -#define LV_LCD_BIT_DATA_LATCH_DATA_ORDER__RTOL LV_LCD_MASK_DATA_LATCH_DATA_ORDER /* Display Data Latch Order: LCD Refresh Right to Left */ -#define LV_LCD_BIT_RGB_ORDER__RGB 0 /* RGB/BGR Order: RGB */ -#define LV_LCD_BIT_RGB_ORDER__BGR LV_LCD_MASK_RGB_ORDER /* RGB/BGR Order: BGR */ -#define LV_LCD_BIT_LINE_ADDRESS_ORDER__TTOB 0 /* Line Address Order: LCD Refresh Top to Bottom */ -#define LV_LCD_BIT_LINE_ADDRESS_ORDER__BTOT LV_LCD_MASK_LINE_ADDRESS_ORDER /* Line Address Order: LCD Refresh Bottom to Top */ -#define LV_LCD_BIT_PAGE_COLUMN_ORDER__NORMAL 0 /* Page/Column Order: Normal Mode */ -#define LV_LCD_BIT_PAGE_COLUMN_ORDER__REVERSE LV_LCD_MASK_PAGE_COLUMN_ORDER /* Page/Column Order: Reverse Mode */ -#define LV_LCD_BIT_COLUMN_ADDRESS_ORDER__LTOR 0 /* Column Address Order: Left to Right */ -#define LV_LCD_BIT_COLUMN_ADDRESS_ORDER__RTOL LV_LCD_MASK_COLUMN_ADDRESS_ORDER /* Column Address Order: Right to Left */ -#define LV_LCD_BIT_PAGE_ADDRESS_ORDER__TTOB 0 /* Page Address Order: Top to Bottom */ -#define LV_LCD_BIT_PAGE_ADDRESS_ORDER__BTOT LV_LCD_MASK_PAGE_ADDRESS_ORDER /* Page Address Order: Bottom to Top */ - -/* predefined gamma curves */ -#define LV_LCD_GAMMA_2_2 0x01 /* 2.2 */ -#define LV_LCD_GAMMA_1_8 0x02 /* 1.8 */ -#define LV_LCD_GAMMA_2_5 0x04 /* 2.5 */ -#define LV_LCD_GAMMA_1_0 0x08 /* 1.0 */ - -/* common pixel formats */ -#define LV_LCD_PIXEL_FORMAT_RGB565 0x55 /* bus: 16 bits, pixel: 16 bits */ -#define LV_LCD_PIXEL_FORMAT_RGB666 0x66 /* bus: 18 bits, pixel: 18 bits */ - -/* flags for lv_lcd_xxx_create() */ -#define LV_LCD_FLAG_NONE 0x00000000UL -#define LV_LCD_FLAG_MIRROR_X 0x00000001UL -#define LV_LCD_FLAG_MIRROR_Y 0x00000002UL -#define LV_LCD_FLAG_BGR 0x00000008UL -#define LV_LCD_FLAG_RGB666 0x00000010UL - -/* command list */ -#define LV_LCD_CMD_DELAY_MS 0xff -#define LV_LCD_CMD_EOF 0xff - -/********************** - * TYPEDEFS - **********************/ - -/** - * Configuration flags for lv_lcd_xxx_create() - * - */ -typedef uint32_t lv_lcd_flag_t; - -/** - * Prototype of a platform-dependent callback to transfer commands and data to the LCD controller. - * @param disp display object - * @param cmd command buffer (can handle 16 bit commands as well) - * @param cmd_size number of bytes of the command - * @param param parameter buffer - * @param param_size number of bytes of the parameters - */ -typedef void (*lv_lcd_send_cmd_cb_t)(lv_display_t * disp, const uint8_t * cmd, size_t cmd_size, const uint8_t * param, - size_t param_size); - -/** - * Prototype of a platform-dependent callback to transfer pixel data to the LCD controller. - * @param disp display object - * @param cmd command buffer (can handle 16 bit commands as well) - * @param cmd_size number of bytes of the command - * @param param parameter buffer - * @param param_size number of bytes of the parameters - */ -typedef void (*lv_lcd_send_color_cb_t)(lv_display_t * disp, const uint8_t * cmd, size_t cmd_size, uint8_t * param, - size_t param_size); - -/** - * Generic MIPI compatible LCD driver - */ -typedef struct { - lv_display_t * disp; /* the associated LVGL display object */ - lv_lcd_send_cmd_cb_t send_cmd; /* platform-specific implementation to send a command to the LCD controller */ - lv_lcd_send_color_cb_t send_color; /* platform-specific implementation to send pixel data to the LCD controller */ - uint16_t x_gap; /* x offset of the (0,0) pixel in VRAM */ - uint16_t y_gap; /* y offset of the (0,0) pixel in VRAM */ - uint8_t madctl_reg; /* current value of MADCTL register */ - uint8_t colmod_reg; /* current value of COLMOD register */ - bool mirror_x; - bool mirror_y; - bool swap_xy; -} lv_lcd_generic_mipi_driver_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a MIPI DCS compatible LCD display - * @param hor_res horizontal resolution - * @param ver_res vertical resolution - * @param flags default configuration settings (mirror, RGB ordering, etc.) - * @param send_cmd platform-dependent function to send a command to the LCD controller (usually uses polling transfer) - * @param send_color platform-dependent function to send pixel data to the LCD controller (usually uses DMA transfer: must implement a 'ready' callback) - * @return pointer to the created display - */ -lv_display_t * lv_lcd_generic_mipi_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags, - lv_lcd_send_cmd_cb_t send_cmd_cb, lv_lcd_send_color_cb_t send_color_cb); - -/** - * Set gap, i.e., the offset of the (0,0) pixel in the VRAM - * @param disp display object - * @param x x offset - * @param y y offset - */ -void lv_lcd_generic_mipi_set_gap(lv_display_t * disp, uint16_t x, uint16_t y); - -/** - * Set color inversion - * @param disp display object - * @param invert false: normal, true: invert - */ -void lv_lcd_generic_mipi_set_invert(lv_display_t * disp, bool invert); - -/** - * Set address mode - * @param disp display object - * @param mirror_x horizontal mirror (false: normal, true: mirrored) - * @param mirror_y vertical mirror (false: normal, true: mirrored) - * @param swap_xy swap axes (false: normal, true: swap) - * @param bgr RGB/BGR order (false: RGB, true: BGR) - */ -void lv_lcd_generic_mipi_set_address_mode(lv_display_t * disp, bool mirror_x, bool mirror_y, bool swap_xy, bool bgr); - -/** - * Set gamma curve - * @param disp display object - * @param gamma gamma curve - */ -void lv_lcd_generic_mipi_set_gamma_curve(lv_display_t * disp, uint8_t gamma); - -/** - * Send list of commands. - * @param disp display object - * @param cmd_list controller and panel-specific commands - */ -void lv_lcd_generic_mipi_send_cmd_list(lv_display_t * disp, const uint8_t * cmd_list); - -/********************** - * OTHERS - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_USE_GENERIC_MIPI*/ - -#endif /* LV_LCD_GENERIC_MIPI_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/display/renesas_glcdc/lv_renesas_glcdc.c b/L3_Middlewares/LVGL/src/drivers/display/renesas_glcdc/lv_renesas_glcdc.c deleted file mode 100644 index 15b6784..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/renesas_glcdc/lv_renesas_glcdc.c +++ /dev/null @@ -1,360 +0,0 @@ -/** - * @file lv_renesas_glcdc.c - * - */ - -/********************* - *PLATFORM ABSTRACTION - *********************/ - -#ifdef _RENESAS_RA_ - #define USE_FREE_RTOS (BSP_CFG_RTOS == 2) -#else // RX with SMC code generation - #ifndef _RENESAS_RX_ - #define _RENESAS_RX_ 1 - #endif - #define USE_FREE_RTOS 1 - #define DISPLAY_HSIZE_INPUT0 LCD_CH0_IN_GR2_HSIZE - #define DISPLAY_VSIZE_INPUT0 LCD_CH0_IN_GR2_VSIZE -#endif /*_RENESAS_RA_*/ - -/********************* - * INCLUDES - *********************/ -#include "lv_renesas_glcdc.h" - -#if LV_USE_RENESAS_GLCDC - -#ifdef _RENESAS_RA_ - #include "LVGL_thread.h" -#else /* RX */ - #include "hal_data.h" - #include "platform.h" - #include "r_glcdc_rx_if.h" - #include "r_glcdc_rx_pinset.h" -#endif /*_RENESAS_RA_*/ - -#include -#include "../../../display/lv_display_private.h" -#include "../../../draw/sw/lv_draw_sw.h" - -/********************* - * DEFINES - *********************/ -#define BYTES_PER_PIXEL 2 - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static lv_display_t * glcdc_create(void * buf1, void * buf2, uint32_t buf_size, lv_display_render_mode_t render_mode); -static void glcdc_init(void); -static void give_vsync_sem_and_yield(void); -static void flush_direct(lv_display_t * display, const lv_area_t * area, uint8_t * px_map); -static void flush_partial(lv_display_t * display, const lv_area_t * area, uint8_t * px_map); -static void flush_wait_direct(lv_display_t * display); -static void flush_wait_partial(lv_display_t * display); - -#ifdef _RENESAS_RX_ - static void enable_dave2d_drw_interrupt(void); -#endif /*_RENESAS_RX_*/ - -/********************** - * STATIC VARIABLES - **********************/ - -#ifdef _RENESAS_RX_ -static uint8_t fb_background[2][LCD_CH0_IN_GR2_HSIZE * LCD_CH0_IN_GR2_VSIZE * BYTES_PER_PIXEL]__attribute__(( - section(".framebuffer"), aligned(64), used)); -static SemaphoreHandle_t _SemaphoreVsync = NULL; -static glcdc_cfg_t g_config; -static glcdc_runtime_cfg_t g_layer_change; - -/* A global variable that Dave 2D driver relies on. (Being auto generated on RA platforms)*/ -display_t g_display0_cfg; -#endif /*_RENESAS_RX_*/ - -static void * rotation_buffer = NULL; -static uint32_t partial_buffer_size = 0; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_renesas_glcdc_direct_create(void) -{ - return glcdc_create(&fb_background[0][0], &fb_background[1][0], sizeof(fb_background[0]), - LV_DISPLAY_RENDER_MODE_DIRECT); -} - -lv_display_t * lv_renesas_glcdc_partial_create(void * buf1, void * buf2, size_t buf_size) -{ - partial_buffer_size = buf_size; - return glcdc_create(buf1, buf2, buf_size, LV_DISPLAY_RENDER_MODE_PARTIAL); -} - -/*This function is declared in and being used by FSP generated code modules*/ -#ifdef _RENESAS_RA_ -void glcdc_callback(display_callback_args_t * p_args) -{ - if(DISPLAY_EVENT_LINE_DETECTION == p_args->event) { - give_vsync_sem_and_yield(); - } - else if(DISPLAY_EVENT_GR1_UNDERFLOW == p_args->event) { - __BKPT(0); /*Layer 1 Underrun*/ - } - else if(DISPLAY_EVENT_GR2_UNDERFLOW == p_args->event) { - __BKPT(0); /*Layer 2 Underrun*/ - } - else { /*DISPLAY_EVENT_FRAME_END*/ - __BKPT(0); - } -} -#else /* RX */ -void glcdc_callback(glcdc_callback_args_t * p_args) -{ - if(GLCDC_EVENT_LINE_DETECTION == p_args->event) { - give_vsync_sem_and_yield(); - } - else if(GLCDC_EVENT_GR1_UNDERFLOW == p_args->event) { - while(1); /*Layer 1 Underrun*/ - } - else if(GLCDC_EVENT_GR2_UNDERFLOW == p_args->event) { - while(1); /*Layer 2 Underrun*/ - } - else {/*DISPLAY_EVENT_FRAME_END*/ - while(1); - } -} -#endif /*_RENESAS_RA_*/ - -/********************** - * STATIC FUNCTIONS - **********************/ - -static lv_display_t * glcdc_create(void * buf1, void * buf2, uint32_t buf_size, lv_display_render_mode_t render_mode) -{ -#ifdef _RENESAS_RA_ - glcdc_init(); -#else - g_display0_cfg.input->format = LCD_CH0_IN_GR2_FORMAT; - _SemaphoreVsync = xSemaphoreCreateBinary(); - - glcdc_init(); - enable_dave2d_drw_interrupt(); -#endif /*_RENESAS_RA_*/ - - lv_display_t * display = lv_display_create(DISPLAY_HSIZE_INPUT0, DISPLAY_VSIZE_INPUT0); - - if(render_mode == LV_DISPLAY_RENDER_MODE_DIRECT) { - lv_display_set_flush_cb(display, flush_direct); - lv_display_set_flush_wait_cb(display, flush_wait_direct); - } - else if(render_mode == LV_DISPLAY_RENDER_MODE_PARTIAL) { - lv_display_set_flush_cb(display, flush_partial); - lv_display_set_flush_wait_cb(display, flush_wait_partial); - } - else { - LV_ASSERT(0); - } - - lv_display_set_buffers(display, buf1, buf2, buf_size, render_mode); - - return display; -} - -static void give_vsync_sem_and_yield(void) -{ -#if USE_FREE_RTOS - BaseType_t context_switch; - - /*Set Vsync semaphore*/ - xSemaphoreGiveFromISR(_SemaphoreVsync, &context_switch); - - /*Return to the highest priority available task*/ - portYIELD_FROM_ISR(context_switch); -#else -#endif /*USE_FREE_RTOS*/ -} - -static void glcdc_init(void) -{ - /* Fill the Frame buffer with black colour (0x0000 in RGB565), for a clean start after previous runs */ - lv_memzero(fb_background, sizeof(fb_background)); - -#ifdef _RENESAS_RA_ - /* Initialize GLCDC driver */ - uint8_t * p_fb = &fb_background[1][0]; - fsp_err_t err; - - err = R_GLCDC_Open(&g_display0_ctrl, &g_display0_cfg); - if(FSP_SUCCESS != err) { - __BKPT(0); - } - - err = R_GLCDC_Start(&g_display0_ctrl); - if(FSP_SUCCESS != err) { - __BKPT(0); - } - - do { - err = - R_GLCDC_BufferChange(&g_display0_ctrl, - (uint8_t *) p_fb, - (display_frame_layer_t) 0); - } while(FSP_ERR_INVALID_UPDATE_TIMING == err); -#else /* RX */ - glcdc_err_t err; - glcdc_runtime_cfg_t layer_change; - - R_GLCDC_PinSet(); - - err = R_GLCDC_Open(&g_config); - if(GLCDC_SUCCESS != err) { - while(1); - } - - err = R_GLCDC_Control(GLCDC_CMD_START_DISPLAY, &g_config); - if(GLCDC_SUCCESS != err) { - while(1); - } - - g_layer_change.input = g_config.input[GLCDC_FRAME_LAYER_2]; - g_layer_change.chromakey = g_config.chromakey[GLCDC_FRAME_LAYER_2]; - g_layer_change.blend = g_config.blend[GLCDC_FRAME_LAYER_2]; - - layer_change.input.p_base = (uint32_t *)&fb_background[1][0]; - - do { - err = R_GLCDC_LayerChange(GLCDC_FRAME_LAYER_2, &g_layer_change); - } while(GLCDC_ERR_INVALID_UPDATE_TIMING == err); -#endif /*_RENESAS_RA_*/ -} - -static void flush_direct(lv_display_t * display, const lv_area_t * area, uint8_t * px_map) -{ - FSP_PARAMETER_NOT_USED(area); - /*Display the frame buffer pointed by px_map*/ - - if(!lv_display_flush_is_last(display)) return; - -#if defined(RENESAS_CORTEX_M85) && (BSP_CFG_DCACHE_ENABLED) - /* Invalidate cache - so the HW can access any data written by the CPU */ - SCB_CleanInvalidateDCache_by_Addr(px_map, sizeof(fb_background[0])); -#endif - -#ifdef _RENESAS_RA_ - R_GLCDC_BufferChange(&g_display0_ctrl, - (uint8_t *) px_map, - (display_frame_layer_t) 0); -#else /* RX */ - glcdc_err_t err; - - g_layer_change.input.p_base = (uint32_t *)px_map; - - do { - err = R_GLCDC_LayerChange(GLCDC_FRAME_LAYER_2, &g_layer_change); - } while(GLCDC_ERR_INVALID_UPDATE_TIMING == err); -#endif /*_RENESAS_RA_*/ -} - -static void flush_wait_direct(lv_display_t * display) -{ - if(!lv_display_flush_is_last(display)) return; - -#if USE_FREE_RTOS - /*If Vsync semaphore has already been set, clear it then wait to avoid tearing*/ - if(uxSemaphoreGetCount(_SemaphoreVsync)) { - xSemaphoreTake(_SemaphoreVsync, 10); - } - - xSemaphoreTake(_SemaphoreVsync, portMAX_DELAY); -#endif /*USE_FREE_RTOS*/ - -} - -static void flush_partial(lv_display_t * display, const lv_area_t * area, uint8_t * px_map) -{ - uint16_t * img = (uint16_t *)px_map; - - lv_area_t rotated_area; - lv_color_format_t cf = lv_display_get_color_format(display); - lv_display_rotation_t rotation = lv_display_get_rotation(display); - - if(rotation != LV_DISPLAY_ROTATION_0) { - int32_t w = lv_area_get_width(area); - int32_t h = lv_area_get_height(area); - uint32_t w_stride = lv_draw_buf_width_to_stride(w, cf); - uint32_t h_stride = lv_draw_buf_width_to_stride(h, cf); - - // only allocate if rotation is actually being used - if(!rotation_buffer) { - rotation_buffer = lv_malloc(partial_buffer_size); - LV_ASSERT_MALLOC(rotation_buffer); - } - - if(rotation == LV_DISPLAY_ROTATION_180) - lv_draw_sw_rotate(img, rotation_buffer, w, h, w_stride, w_stride, rotation, cf); - else /* 90 or 270 */ - lv_draw_sw_rotate(img, rotation_buffer, w, h, w_stride, h_stride, rotation, cf); - - img = rotation_buffer; - - rotated_area = *area; - lv_display_rotate_area(display, &rotated_area); - area = &rotated_area; - } - - int32_t w = lv_area_get_width(area); - int32_t h = lv_area_get_height(area); - - uint16_t * fb = (uint16_t *)fb_background[1]; - - fb = fb + area->y1 * DISPLAY_HSIZE_INPUT0; - fb = fb + area->x1; - - int32_t i; - for(i = 0; i < h; i++) { - lv_memcpy(fb, img, w * BYTES_PER_PIXEL); - -#if defined(RENESAS_CORTEX_M85) && (BSP_CFG_DCACHE_ENABLED) - SCB_CleanInvalidateDCache_by_Addr(fb, w * BYTES_PER_PIXEL); -#endif - fb += DISPLAY_HSIZE_INPUT0; - img += w; - } -} - -static void flush_wait_partial(lv_display_t * display) -{ - LV_UNUSED(display); - - return; -} - -#ifdef _RENESAS_RX_ -extern void drw_int_isr(void); - -static void enable_dave2d_drw_interrupt(void) -{ - bsp_int_ctrl_t grpal1; - - /* Specify the priority of the group interrupt. */ - grpal1.ipl = 5; - - /* Use the BSP API to register the interrupt handler for DRW2D. */ - R_BSP_InterruptWrite(BSP_INT_SRC_AL1_DRW2D_DRW_IRQ, (bsp_int_cb_t)drw_int_isr); - - /* Use the BSP API to enable the group interrupt. */ - R_BSP_InterruptControl(BSP_INT_SRC_AL1_DRW2D_DRW_IRQ, BSP_INT_CMD_GROUP_INTERRUPT_ENABLE, (void *)&grpal1); -} -#endif /*_RENESAS_RX_*/ - -#endif /*LV_USE_RENESAS_GLCDC*/ diff --git a/L3_Middlewares/LVGL/src/drivers/display/renesas_glcdc/lv_renesas_glcdc.h b/L3_Middlewares/LVGL/src/drivers/display/renesas_glcdc/lv_renesas_glcdc.h deleted file mode 100644 index 0558614..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/renesas_glcdc/lv_renesas_glcdc.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file lv_renesas_glcdc.h - * - */ - -#ifndef LV_RENESAS_GLCDC_H -#define LV_RENESAS_GLCDC_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../../display/lv_display.h" - -#if LV_USE_RENESAS_GLCDC - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a display using Renesas' GLCDC peripherial in DIRECT render mode - * @return pointer to the created display - */ -lv_display_t * lv_renesas_glcdc_direct_create(void); - -/** - * Create a display using Renesas' GLCDC peripherial in PARTIAL render mode - * @param buf1 first buffer - * @param buf2 second buffer (can be `NULL`) - * @param buf_size buffer size in byte - * @return pointer to the created display - */ -lv_display_t * lv_renesas_glcdc_partial_create(void * buf1, void * buf2, size_t buf_size); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_RENESAS_GLCDC */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_RENESAS_GLCDC_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/display/st7735/lv_st7735.c b/L3_Middlewares/LVGL/src/drivers/display/st7735/lv_st7735.c deleted file mode 100644 index 6b5e62d..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/st7735/lv_st7735.c +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @file lv_st7735.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_st7735.h" - -#if LV_USE_ST7735 - -/********************* - * DEFINES - *********************/ - -#define CMD_GAMSET 0x26 - -#define CMD_FRMCTR1 0xB1 -#define CMD_FRMCTR2 0xB2 -#define CMD_FRMCTR3 0xB3 -#define CMD_INVCTR 0xB4 -#define CMD_DISSET5 0xB6 - -#define CMD_PWCTR1 0xC0 -#define CMD_PWCTR2 0xC1 -#define CMD_PWCTR3 0xC2 -#define CMD_PWCTR4 0xC3 -#define CMD_PWCTR5 0xC4 -#define CMD_VMCTR1 0xC5 -#define CMD_VMOFCTR 0xC7 - -#define CMD_NVFCTR1 0xD9 - -#define CMD_GMCTRP1 0xE0 -#define CMD_GMCTRN1 0xE1 - -#define CMD_PWCTR6 0xFC - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC CONSTANTS - **********************/ - -/* init commands for buydisplay.com ER-TFTM018-3 */ -static const uint8_t init_cmd_list[] = { - 0xB1, 3, 0x05, 0x3C, 0x3C, - 0xB2, 3, 0x05, 0x3C, 0x3C, - 0xB3, 6, 0x05, 0x3C, 0x3C, 0x05, 0x3C, 0x3C, - 0xB4, 1, 0x03, - 0xC0, 3, 0x28, 0x08, 0x04, - 0xC1, 1, 0XC0, - 0xC2, 2, 0x0D, 0x00, - 0xC3, 2, 0x8D, 0x2A, - 0xC4, 2, 0x8D, 0xEE, - 0xC5, 1, 0x10, - 0xE0, 16, 0x04, 0x22, 0x07, 0x0A, 0x2E, 0x30, 0x25, 0x2A, 0x28, 0x26, 0x2E, 0x3A, 0x00, 0x01, 0x03, 0x13, - 0xE1, 16, 0x04, 0x16, 0x06, 0x0D, 0x2D, 0x26, 0x23, 0x27, 0x27, 0x25, 0x2D, 0x3B, 0x00, 0x01, 0x04, 0x13, - LV_LCD_CMD_DELAY_MS, LV_LCD_CMD_EOF -}; - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_st7735_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags, - lv_st7735_send_cmd_cb_t send_cmd_cb, lv_st7735_send_color_cb_t send_color_cb) -{ - lv_display_t * disp = lv_lcd_generic_mipi_create(hor_res, ver_res, flags, send_cmd_cb, send_color_cb); - lv_lcd_generic_mipi_send_cmd_list(disp, init_cmd_list); - return disp; -} - -void lv_st7735_set_gap(lv_display_t * disp, uint16_t x, uint16_t y) -{ - lv_lcd_generic_mipi_set_gap(disp, x, y); -} - -void lv_st7735_set_invert(lv_display_t * disp, bool invert) -{ - lv_lcd_generic_mipi_set_invert(disp, invert); -} - -void lv_st7735_set_gamma_curve(lv_display_t * disp, uint8_t gamma) -{ - lv_lcd_generic_mipi_set_gamma_curve(disp, gamma); -} - -void lv_st7735_send_cmd_list(lv_display_t * disp, const uint8_t * cmd_list) -{ - lv_lcd_generic_mipi_send_cmd_list(disp, cmd_list); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_ST7735*/ diff --git a/L3_Middlewares/LVGL/src/drivers/display/st7735/lv_st7735.h b/L3_Middlewares/LVGL/src/drivers/display/st7735/lv_st7735.h deleted file mode 100644 index 72dd1a9..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/st7735/lv_st7735.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @file lv_st7735.h - * - * This driver is just a wrapper around the generic MIPI compatible LCD controller driver - * - */ - -#ifndef LV_ST7735_H -#define LV_ST7735_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../lcd/lv_lcd_generic_mipi.h" - -#if LV_USE_ST7735 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef lv_lcd_send_cmd_cb_t lv_st7735_send_cmd_cb_t; -typedef lv_lcd_send_color_cb_t lv_st7735_send_color_cb_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an LCD display with ST7735 driver - * @param hor_res horizontal resolution - * @param ver_res vertical resolution - * @param flags default configuration settings (mirror, RGB ordering, etc.) - * @param send_cmd platform-dependent function to send a command to the LCD controller (usually uses polling transfer) - * @param send_color platform-dependent function to send pixel data to the LCD controller (usually uses DMA transfer: must implement a 'ready' callback) - * @return pointer to the created display - */ -lv_display_t * lv_st7735_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags, - lv_st7735_send_cmd_cb_t send_cmd_cb, lv_st7735_send_color_cb_t send_color_cb); - -/** - * Set gap, i.e., the offset of the (0,0) pixel in the VRAM - * @param disp display object - * @param x x offset - * @param y y offset - */ -void lv_st7735_set_gap(lv_display_t * disp, uint16_t x, uint16_t y); - -/** - * Set color inversion - * @param disp display object - * @param invert false: normal, true: invert - */ -void lv_st7735_set_invert(lv_display_t * disp, bool invert); - -/** - * Set gamma curve - * @param disp display object - * @param gamma gamma curve - */ -void lv_st7735_set_gamma_curve(lv_display_t * disp, uint8_t gamma); - -/** - * Send list of commands. - * @param disp display object - * @param cmd_list controller and panel-specific commands - */ -void lv_st7735_send_cmd_list(lv_display_t * disp, const uint8_t * cmd_list); - -/********************** - * OTHERS - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_ST7735*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /* LV_ST7735_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/display/st7789/lv_st7789.c b/L3_Middlewares/LVGL/src/drivers/display/st7789/lv_st7789.c deleted file mode 100644 index 76d08bf..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/st7789/lv_st7789.c +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @file lv_st7789.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_st7789.h" - -#if LV_USE_ST7789 - -/********************* - * DEFINES - *********************/ - -#define CMD_FRMCTR1 0xB1 -#define CMD_FRMCTR2 0xB2 -#define CMD_FRMCTR3 0xB3 -#define CMD_INVCTR 0xB4 -#define CMD_DFUNCTR 0xB6 -#define CMD_ETMOD 0xB7 -#define CMD_PWCTR1 0xC0 -#define CMD_PWCTR2 0xC1 -#define CMD_PWCTR3 0xC2 -#define CMD_PWCTR4 0xC3 -#define CMD_PWCTR5 0xC4 -#define CMD_VMCTR 0xC5 -#define CMD_GMCTRP1 0xE0 -#define CMD_GMCTRN1 0xE1 -#define CMD_DOCA 0xE8 -#define CMD_CSCON 0xF0 - -#define CMD_RAMCTRL 0xB0 -#define CMD_PORCTRL 0xB2 /* Porch control */ -#define CMD_GCTRL 0xB7 /* Gate control */ -#define CMD_VCOMS 0xBB /* VCOMS setting */ -#define CMD_LCMCTRL 0xC0 /* LCM control */ -#define CMD_VDVVRHEN 0xC2 /* VDV and VRH command enable */ -#define CMD_VRHS 0xC3 /* VRH set */ -#define CMD_VDVSET 0xC4 /* VDV setting */ -#define CMD_FRCTR2 0xC6 /* FR Control 2 */ -#define CMD_PWCTRL1 0xD0 /* Power control 1 */ -#define CMD_PVGAMCTRL 0xE0 /* Positive Gamma Correction */ -#define CMD_NVGAMCTRL 0xE1 /* Negative Gamma Correction */ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC CONSTANTS - **********************/ - -/* init commands based on LovyanGFX ST7789 driver */ -static const uint8_t init_cmd_list[] = { - CMD_GCTRL, 1, 0x44, /* GCTRL -- panel dependent */ - CMD_VCOMS, 1, 0x24, /* VCOMS -- panel dependent */ - CMD_VRHS, 1, 0x13, /* VRHS - panel dependent */ - CMD_PWCTRL1, 2, 0xa4, 0xa1, - CMD_RAMCTRL, 2, 0x00, 0xC0, /* controls mapping of RGB565 to RGB666 */ - CMD_PVGAMCTRL, 14, 0xd0, 0x00, 0x02, 0x07, 0x0a, 0x28, 0x32, 0x44, 0x42, 0x06, 0x0e, 0x12, 0x14, 0x17, - CMD_NVGAMCTRL, 14, 0xd0, 0x00, 0x02, 0x07, 0x0a, 0x28, 0x31, 0x54, 0x47, 0x0e, 0x1c, 0x17, 0x1b, 0x1e, - LV_LCD_CMD_SET_GAMMA_CURVE, 1, 0x01, - LV_LCD_CMD_DELAY_MS, LV_LCD_CMD_EOF -}; - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_st7789_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags, - lv_st7789_send_cmd_cb_t send_cmd_cb, lv_st7789_send_color_cb_t send_color_cb) -{ - lv_display_t * disp = lv_lcd_generic_mipi_create(hor_res, ver_res, flags, send_cmd_cb, send_color_cb); - lv_lcd_generic_mipi_send_cmd_list(disp, init_cmd_list); - return disp; -} - -void lv_st7789_set_gap(lv_display_t * disp, uint16_t x, uint16_t y) -{ - lv_lcd_generic_mipi_set_gap(disp, x, y); -} - -void lv_st7789_set_invert(lv_display_t * disp, bool invert) -{ - lv_lcd_generic_mipi_set_invert(disp, invert); -} - -void lv_st7789_set_gamma_curve(lv_display_t * disp, uint8_t gamma) -{ - lv_lcd_generic_mipi_set_gamma_curve(disp, gamma); -} - -void lv_st7789_send_cmd_list(lv_display_t * disp, const uint8_t * cmd_list) -{ - lv_lcd_generic_mipi_send_cmd_list(disp, cmd_list); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_ST7789*/ diff --git a/L3_Middlewares/LVGL/src/drivers/display/st7789/lv_st7789.h b/L3_Middlewares/LVGL/src/drivers/display/st7789/lv_st7789.h deleted file mode 100644 index 5f1acad..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/st7789/lv_st7789.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @file lv_st7789.h - * - * This driver is just a wrapper around the generic MIPI compatible LCD controller driver - * - */ - -#ifndef LV_ST7789_H -#define LV_ST7789_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../lcd/lv_lcd_generic_mipi.h" - -#if LV_USE_ST7789 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef lv_lcd_send_cmd_cb_t lv_st7789_send_cmd_cb_t; -typedef lv_lcd_send_color_cb_t lv_st7789_send_color_cb_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an LCD display with ST7789 driver - * @param hor_res horizontal resolution - * @param ver_res vertical resolution - * @param flags default configuration settings (mirror, RGB ordering, etc.) - * @param send_cmd platform-dependent function to send a command to the LCD controller (usually uses polling transfer) - * @param send_color platform-dependent function to send pixel data to the LCD controller (usually uses DMA transfer: must implement a 'ready' callback) - * @return pointer to the created display - */ -lv_display_t * lv_st7789_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags, - lv_st7789_send_cmd_cb_t send_cmd_cb, lv_st7789_send_color_cb_t send_color_cb); - -/** - * Set gap, i.e., the offset of the (0,0) pixel in the VRAM - * @param disp display object - * @param x x offset - * @param y y offset - */ -void lv_st7789_set_gap(lv_display_t * disp, uint16_t x, uint16_t y); - -/** - * Set color inversion - * @param disp display object - * @param invert false: normal, true: invert - */ -void lv_st7789_set_invert(lv_display_t * disp, bool invert); - -/** - * Set gamma curve - * @param disp display object - * @param gamma gamma curve - */ -void lv_st7789_set_gamma_curve(lv_display_t * disp, uint8_t gamma); - -/** - * Send list of commands. - * @param disp display object - * @param cmd_list controller and panel-specific commands - */ -void lv_st7789_send_cmd_list(lv_display_t * disp, const uint8_t * cmd_list); - -/********************** - * OTHERS - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_USE_ST7789*/ - -#endif //LV_ST7789_H diff --git a/L3_Middlewares/LVGL/src/drivers/display/st7796/lv_st7796.c b/L3_Middlewares/LVGL/src/drivers/display/st7796/lv_st7796.c deleted file mode 100644 index 985b39f..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/st7796/lv_st7796.c +++ /dev/null @@ -1,121 +0,0 @@ -/** - * @file lv_st7796.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_st7796.h" - -#if LV_USE_ST7796 - -/********************* - * DEFINES - *********************/ - -#define CMD_FRMCTR1 0xB1 -#define CMD_FRMCTR2 0xB2 -#define CMD_FRMCTR3 0xB3 -#define CMD_INVCTR 0xB4 -#define CMD_DFUNCTR 0xB6 -#define CMD_ETMOD 0xB7 -#define CMD_PWCTR1 0xC0 -#define CMD_PWCTR2 0xC1 -#define CMD_PWCTR3 0xC2 -#define CMD_PWCTR4 0xC3 -#define CMD_PWCTR5 0xC4 -#define CMD_VMCTR 0xC5 -#define CMD_GMCTRP1 0xE0 -#define CMD_GMCTRN1 0xE1 -#define CMD_DOCA 0xE8 -#define CMD_CSCON 0xF0 - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC CONSTANTS - **********************/ - -/* init commands based on LovyanGFX */ -static const uint8_t init_cmd_list[] = { - CMD_CSCON, 1, 0xC3, /* Enable extension command 2 partI */ - CMD_CSCON, 1, 0x96, /* Enable extension command 2 partII */ - CMD_INVCTR, 1, 0x01, /* 1-dot inversion */ - CMD_DFUNCTR, 3, 0x80, /* Display Function Control: Bypass */ - 0x22, /* Source Output Scan from S1 to S960, Gate Output scan from G1 to G480, scan cycle = 2 */ - 0x3B, /* LCD Drive Line = 8 * (59 + 1) */ - CMD_DOCA, 8, 0x40, 0x8A, 0x00, 0x00, - 0x29, /* Source equalizing period time = 22.5 us */ - 0x19, /* Timing for "Gate start" = 25 (Tclk) */ - 0xA5, /* Timing for "Gate End" = 37 (Tclk), Gate driver EQ function ON */ - 0x33, - CMD_PWCTR2, 1, 0x06, /* Power control2: VAP(GVDD) = 3.85 + (vcom + vcom offset), VAN(GVCL) = -3.85 + (vcom + vcom offset) */ - CMD_PWCTR3, 1, 0xA7, /* Power control 3: Source driving current level = low, Gamma driving current level = High */ - CMD_VMCTR, 1, 0x18, /* VCOM Control: VCOM = 0.9 */ - LV_LCD_CMD_DELAY_MS, 12, /* delay 120 ms */ - CMD_GMCTRP1, 14, /* Gamma */ - 0xF0, 0x09, 0x0B, 0x06, 0x04, 0x15, 0x2F, - 0x54, 0x42, 0x3C, 0x17, 0x14, 0x18, 0x1B, - CMD_GMCTRN1, 14, - 0xE0, 0x09, 0x0B, 0x06, 0x04, 0x03, 0x2B, - 0x43, 0x42, 0x3B, 0x16, 0x14, 0x17, 0x1B, - LV_LCD_CMD_DELAY_MS, 12, /* delay 120 ms */ - CMD_CSCON, 1, 0x3C, /* Disable extension command 2 partI */ - CMD_CSCON, 1, 0x69, /* Disable extension command 2 partII */ - LV_LCD_CMD_DELAY_MS, LV_LCD_CMD_EOF -}; - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_st7796_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags, - lv_st7796_send_cmd_cb_t send_cmd_cb, lv_st7796_send_color_cb_t send_color_cb) -{ - lv_display_t * disp = lv_lcd_generic_mipi_create(hor_res, ver_res, flags, send_cmd_cb, send_color_cb); - lv_lcd_generic_mipi_send_cmd_list(disp, init_cmd_list); - return disp; -} - -void lv_st7796_set_gap(lv_display_t * disp, uint16_t x, uint16_t y) -{ - lv_lcd_generic_mipi_set_gap(disp, x, y); -} - -void lv_st7796_set_invert(lv_display_t * disp, bool invert) -{ - lv_lcd_generic_mipi_set_invert(disp, invert); -} - -void lv_st7796_set_gamma_curve(lv_display_t * disp, uint8_t gamma) -{ - /* NOTE: the generic method is not supported on ST7796, TODO: implement gamma tables */ - LV_UNUSED(disp); - LV_UNUSED(gamma); -} - -void lv_st7796_send_cmd_list(lv_display_t * disp, const uint8_t * cmd_list) -{ - lv_lcd_generic_mipi_send_cmd_list(disp, cmd_list); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_ST7796*/ diff --git a/L3_Middlewares/LVGL/src/drivers/display/st7796/lv_st7796.h b/L3_Middlewares/LVGL/src/drivers/display/st7796/lv_st7796.h deleted file mode 100644 index 924eecb..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/st7796/lv_st7796.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @file lv_st7796.h - * - * This driver is just a wrapper around the generic MIPI compatible LCD controller driver - * - */ - -#ifndef LV_ST7796_H -#define LV_ST7796_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../lcd/lv_lcd_generic_mipi.h" - -#if LV_USE_ST7796 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef lv_lcd_send_cmd_cb_t lv_st7796_send_cmd_cb_t; -typedef lv_lcd_send_color_cb_t lv_st7796_send_color_cb_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an LCD display with ST7796 driver - * @param hor_res horizontal resolution - * @param ver_res vertical resolution - * @param flags default configuration settings (mirror, RGB ordering, etc.) - * @param send_cmd platform-dependent function to send a command to the LCD controller (usually uses polling transfer) - * @param send_color platform-dependent function to send pixel data to the LCD controller (usually uses DMA transfer: must implement a 'ready' callback) - * @return pointer to the created display - */ -lv_display_t * lv_st7796_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags, - lv_st7796_send_cmd_cb_t send_cmd_cb, lv_st7796_send_color_cb_t send_color_cb); - -/** - * Set gap, i.e., the offset of the (0,0) pixel in the VRAM - * @param disp display object - * @param x x offset - * @param y y offset - */ -void lv_st7796_set_gap(lv_display_t * disp, uint16_t x, uint16_t y); - -/** - * Set color inversion - * @param disp display object - * @param invert false: normal, true: invert - */ -void lv_st7796_set_invert(lv_display_t * disp, bool invert); - -/** - * Set gamma curve - * @param disp display object - * @param gamma gamma curve - */ -void lv_st7796_set_gamma_curve(lv_display_t * disp, uint8_t gamma); - -/** - * Send list of commands. - * @param disp display object - * @param cmd_list controller and panel-specific commands - */ -void lv_st7796_send_cmd_list(lv_display_t * disp, const uint8_t * cmd_list); - -/********************** - * OTHERS - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_USE_ST7796*/ - -#endif /* LV_ST7796_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/display/tft_espi/lv_tft_espi.cpp b/L3_Middlewares/LVGL/src/drivers/display/tft_espi/lv_tft_espi.cpp deleted file mode 100644 index 1cb7b45..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/tft_espi/lv_tft_espi.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @file lv_tft_espi.cpp - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_tft_espi.h" -#if LV_USE_TFT_ESPI - -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - TFT_eSPI * tft; -} lv_tft_espi_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map); -static void resolution_changed_event_cb(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_tft_espi_create(uint32_t hor_res, uint32_t ver_res, void * buf, uint32_t buf_size_bytes) -{ - lv_tft_espi_t * dsc = (lv_tft_espi_t *)lv_malloc_zeroed(sizeof(lv_tft_espi_t)); - LV_ASSERT_MALLOC(dsc); - if(dsc == NULL) return NULL; - - lv_display_t * disp = lv_display_create(hor_res, ver_res); - if(disp == NULL) { - lv_free(dsc); - return NULL; - } - - dsc->tft = new TFT_eSPI(hor_res, ver_res); - dsc->tft->begin(); /* TFT init */ - dsc->tft->setRotation(0); - lv_display_set_driver_data(disp, (void *)dsc); - lv_display_set_flush_cb(disp, flush_cb); - lv_display_add_event_cb(disp, resolution_changed_event_cb, LV_EVENT_RESOLUTION_CHANGED, NULL); - lv_display_set_buffers(disp, (void *)buf, NULL, buf_size_bytes, LV_DISPLAY_RENDER_MODE_PARTIAL); - return disp; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map) -{ - lv_tft_espi_t * dsc = (lv_tft_espi_t *)lv_display_get_driver_data(disp); - - uint32_t w = (area->x2 - area->x1 + 1); - uint32_t h = (area->y2 - area->y1 + 1); - - dsc->tft->startWrite(); - dsc->tft->setAddrWindow(area->x1, area->y1, w, h); - dsc->tft->pushColors((uint16_t *)px_map, w * h, true); - dsc->tft->endWrite(); - - lv_display_flush_ready(disp); - -} - -static void resolution_changed_event_cb(lv_event_t * e) -{ - lv_display_t * disp = (lv_display_t *)lv_event_get_target(e); - lv_tft_espi_t * dsc = (lv_tft_espi_t *)lv_display_get_driver_data(disp); - int32_t hor_res = lv_display_get_horizontal_resolution(disp); - int32_t ver_res = lv_display_get_vertical_resolution(disp); - lv_display_rotation_t rot = lv_display_get_rotation(disp); - - /* handle rotation */ - switch(rot) { - case LV_DISPLAY_ROTATION_0: - dsc->tft->setRotation(0); /* Portrait orientation */ - break; - case LV_DISPLAY_ROTATION_90: - dsc->tft->setRotation(1); /* Landscape orientation */ - break; - case LV_DISPLAY_ROTATION_180: - dsc->tft->setRotation(2); /* Portrait orientation, flipped */ - break; - case LV_DISPLAY_ROTATION_270: - dsc->tft->setRotation(3); /* Landscape orientation, flipped */ - break; - } -} - -#endif /*LV_USE_TFT_ESPI*/ diff --git a/L3_Middlewares/LVGL/src/drivers/display/tft_espi/lv_tft_espi.h b/L3_Middlewares/LVGL/src/drivers/display/tft_espi/lv_tft_espi.h deleted file mode 100644 index a8f49f8..0000000 --- a/L3_Middlewares/LVGL/src/drivers/display/tft_espi/lv_tft_espi.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file lv_tft_espi.h - * - */ - -#ifndef LV_TFT_ESPI_H -#define LV_TFT_ESPI_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../../display/lv_display.h" - -#if LV_USE_TFT_ESPI - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ -lv_display_t * lv_tft_espi_create(uint32_t hor_res, uint32_t ver_res, void * buf, uint32_t buf_size_bytes); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_TFT_ESPI */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_TFT_ESPI_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/evdev/lv_evdev.c b/L3_Middlewares/LVGL/src/drivers/evdev/lv_evdev.c deleted file mode 100644 index e7d31ec..0000000 --- a/L3_Middlewares/LVGL/src/drivers/evdev/lv_evdev.c +++ /dev/null @@ -1,244 +0,0 @@ -/** - * @file lv_evdev.c - * - */ - -/********************** - * INCLUDES - **********************/ -#include "lv_evdev.h" -#if LV_USE_EVDEV - -#include -#include -#include -#include -#include /*To detect BSD*/ -#ifdef BSD - #include -#else - #include -#endif /*BSD*/ -#include "../../misc/lv_assert.h" -#include "../../misc/lv_math.h" -#include "../../stdlib/lv_mem.h" -#include "../../stdlib/lv_string.h" -#include "../../display/lv_display.h" - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - /*Device*/ - int fd; - /*Config*/ - bool swap_axes; - int min_x; - int min_y; - int max_x; - int max_y; - /*State*/ - int root_x; - int root_y; - int key; - lv_indev_state_t state; -} lv_evdev_t; - -/********************** - * STATIC FUNCTIONS - **********************/ - -static int _evdev_process_key(uint16_t code) -{ - switch(code) { - case KEY_UP: - return LV_KEY_UP; - case KEY_DOWN: - return LV_KEY_DOWN; - case KEY_RIGHT: - return LV_KEY_RIGHT; - case KEY_LEFT: - return LV_KEY_LEFT; - case KEY_ESC: - return LV_KEY_ESC; - case KEY_DELETE: - return LV_KEY_DEL; - case KEY_BACKSPACE: - return LV_KEY_BACKSPACE; - case KEY_ENTER: - return LV_KEY_ENTER; - case KEY_NEXT: - case KEY_TAB: - return LV_KEY_NEXT; - case KEY_PREVIOUS: - return LV_KEY_PREV; - case KEY_HOME: - return LV_KEY_HOME; - case KEY_END: - return LV_KEY_END; - default: - return 0; - } -} - -static int _evdev_calibrate(int v, int in_min, int in_max, int out_min, int out_max) -{ - if(in_min != in_max) v = (v - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; - return LV_CLAMP(out_min, v, out_max); -} - -static lv_point_t _evdev_process_pointer(lv_indev_t * indev, int x, int y) -{ - lv_display_t * disp = lv_indev_get_display(indev); - lv_evdev_t * dsc = lv_indev_get_driver_data(indev); - LV_ASSERT_NULL(dsc); - - int swapped_x = dsc->swap_axes ? y : x; - int swapped_y = dsc->swap_axes ? x : y; - - int offset_x = lv_display_get_offset_x(disp); - int offset_y = lv_display_get_offset_y(disp); - int width = lv_display_get_horizontal_resolution(disp); - int height = lv_display_get_vertical_resolution(disp); - - lv_point_t p; - p.x = _evdev_calibrate(swapped_x, dsc->min_x, dsc->max_x, offset_x, offset_x + width - 1); - p.y = _evdev_calibrate(swapped_y, dsc->min_y, dsc->max_y, offset_y, offset_y + height - 1); - return p; -} - -static void _evdev_read(lv_indev_t * indev, lv_indev_data_t * data) -{ - lv_evdev_t * dsc = lv_indev_get_driver_data(indev); - LV_ASSERT_NULL(dsc); - - /*Update dsc with buffered events*/ - struct input_event in = { 0 }; - while(read(dsc->fd, &in, sizeof(in)) > 0) { - if(in.type == EV_REL) { - if(in.code == REL_X) dsc->root_x += in.value; - else if(in.code == REL_Y) dsc->root_y += in.value; - } - else if(in.type == EV_ABS) { - if(in.code == ABS_X || in.code == ABS_MT_POSITION_X) dsc->root_x = in.value; - else if(in.code == ABS_Y || in.code == ABS_MT_POSITION_Y) dsc->root_y = in.value; - else if(in.code == ABS_MT_TRACKING_ID) { - if(in.value == -1) dsc->state = LV_INDEV_STATE_RELEASED; - else if(in.value == 0) dsc->state = LV_INDEV_STATE_PRESSED; - } - } - else if(in.type == EV_KEY) { - if(in.code == BTN_MOUSE || in.code == BTN_TOUCH) { - if(in.value == 0) dsc->state = LV_INDEV_STATE_RELEASED; - else if(in.value == 1) dsc->state = LV_INDEV_STATE_PRESSED; - } - else { - dsc->key = _evdev_process_key(in.code); - if(dsc->key) { - dsc->state = in.value ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; - data->continue_reading = true; /*Keep following events in buffer for now*/ - break; - } - } - } - } - - /*Process and store in data*/ - switch(lv_indev_get_type(indev)) { - case LV_INDEV_TYPE_KEYPAD: - data->state = dsc->state; - data->key = dsc->key; - break; - case LV_INDEV_TYPE_POINTER: - data->state = dsc->state; - data->point = _evdev_process_pointer(indev, dsc->root_x, dsc->root_y); - break; - default: - break; - } -} - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_indev_t * lv_evdev_create(lv_indev_type_t indev_type, const char * dev_path) -{ - lv_evdev_t * dsc = lv_malloc_zeroed(sizeof(lv_evdev_t)); - LV_ASSERT_MALLOC(dsc); - if(dsc == NULL) return NULL; - - dsc->fd = open(dev_path, O_RDONLY | O_NOCTTY | O_CLOEXEC); - if(dsc->fd < 0) { - LV_LOG_ERROR("open failed: %s", strerror(errno)); - goto err_after_malloc; - } - - if(fcntl(dsc->fd, F_SETFL, O_NONBLOCK) < 0) { - LV_LOG_ERROR("fcntl failed: %s", strerror(errno)); - goto err_after_open; - } - - /* Detect the minimum and maximum values of the input device for calibration. */ - - if(indev_type == LV_INDEV_TYPE_POINTER) { - struct input_absinfo absinfo; - if(ioctl(dsc->fd, EVIOCGABS(ABS_X), &absinfo) == 0) { - dsc->min_x = absinfo.minimum; - dsc->max_x = absinfo.maximum; - } - else { - LV_LOG_ERROR("ioctl EVIOCGABS(ABS_X) failed: %s", strerror(errno)); - } - if(ioctl(dsc->fd, EVIOCGABS(ABS_Y), &absinfo) == 0) { - dsc->min_y = absinfo.minimum; - dsc->max_y = absinfo.maximum; - } - else { - LV_LOG_ERROR("ioctl EVIOCGABS(ABS_Y) failed: %s", strerror(errno)); - } - } - - lv_indev_t * indev = lv_indev_create(); - if(indev == NULL) goto err_after_open; - lv_indev_set_type(indev, indev_type); - lv_indev_set_read_cb(indev, _evdev_read); - lv_indev_set_driver_data(indev, dsc); - return indev; - -err_after_open: - close(dsc->fd); -err_after_malloc: - lv_free(dsc); - return NULL; -} - -void lv_evdev_set_swap_axes(lv_indev_t * indev, bool swap_axes) -{ - lv_evdev_t * dsc = lv_indev_get_driver_data(indev); - LV_ASSERT_NULL(dsc); - dsc->swap_axes = swap_axes; -} - -void lv_evdev_set_calibration(lv_indev_t * indev, int min_x, int min_y, int max_x, int max_y) -{ - lv_evdev_t * dsc = lv_indev_get_driver_data(indev); - LV_ASSERT_NULL(dsc); - dsc->min_x = min_x; - dsc->min_y = min_y; - dsc->max_x = max_x; - dsc->max_y = max_y; -} - -void lv_evdev_delete(lv_indev_t * indev) -{ - lv_evdev_t * dsc = lv_indev_get_driver_data(indev); - LV_ASSERT_NULL(dsc); - close(dsc->fd); - lv_free(dsc); - - lv_indev_delete(indev); -} - -#endif /*LV_USE_EVDEV*/ diff --git a/L3_Middlewares/LVGL/src/drivers/evdev/lv_evdev.h b/L3_Middlewares/LVGL/src/drivers/evdev/lv_evdev.h deleted file mode 100644 index 95ab154..0000000 --- a/L3_Middlewares/LVGL/src/drivers/evdev/lv_evdev.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file lv_evdev.h - * - */ - -#ifndef LV_EVDEV_H -#define LV_EVDEV_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../indev/lv_indev.h" - -#if LV_USE_EVDEV - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create evdev input device. - * @param type LV_INDEV_TYPE_POINTER or LV_INDEV_TYPE_KEYPAD - * @param dev_path device path, e.g., /dev/input/event0 - * @return pointer to input device or NULL if opening failed - */ -lv_indev_t * lv_evdev_create(lv_indev_type_t indev_type, const char * dev_path); - -/** - * Set whether coordinates of pointer device should be swapped. Defaults to - * false. - * @param indev evdev input device - * @param swap_axes whether to swap x and y axes - */ -void lv_evdev_set_swap_axes(lv_indev_t * indev, bool swap_axes); - -/** - * Configure a coordinate transformation for pointer devices. Applied after - * axis swap, if any. Defaults to apply no transformation. - * @param indev evdev input device - * @param min_x pointer coordinate mapped to min x of display - * @param min_y pointer coordinate mapped to min y of display - * @param max_x pointer coordinate mapped to max x of display - * @param max_y pointer coordinate mapped to max y of display - */ -void lv_evdev_set_calibration(lv_indev_t * indev, int min_x, int min_y, int max_x, int max_y); - -/** - * Remove evdev input device. - * @param indev evdev input device to close and free - */ -void lv_evdev_delete(lv_indev_t * indev); - -#endif /*LV_USE_EVDEV*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_EVDEV_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window.c b/L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window.c deleted file mode 100644 index 849cbf5..0000000 --- a/L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window.c +++ /dev/null @@ -1,391 +0,0 @@ -/** - * @file lv_glfw_window.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_glfw_window_private.h" -#if LV_USE_OPENGLES -#include -#include "../../core/lv_refr.h" -#include "../../stdlib/lv_string.h" -#include "../../core/lv_global.h" -#include "../../display/lv_display_private.h" -#include "../../indev/lv_indev.h" -#include "../../lv_init.h" -#include "../../misc/lv_area_private.h" - -#include -#include - -#include "lv_opengles_driver.h" -#include "lv_opengles_texture.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void window_update_handler(lv_timer_t * t); -static uint32_t lv_glfw_tick_count_callback(void); -static lv_glfw_window_t * lv_glfw_get_lv_window_from_window(GLFWwindow * window); -static void glfw_error_cb(int error, const char * description); -static int lv_glfw_init(void); -static int lv_glew_init(void); -static void lv_glfw_timer_init(void); -static void lv_glfw_window_config(GLFWwindow * window, bool use_mouse_indev); -static void lv_glfw_window_quit(void); -static void window_close_callback(GLFWwindow * window); -static void key_callback(GLFWwindow * window, int key, int scancode, int action, int mods); -static void mouse_button_callback(GLFWwindow * window, int button, int action, int mods); -static void mouse_move_callback(GLFWwindow * window, double xpos, double ypos); -static void proc_mouse(lv_glfw_window_t * window); -static void indev_read_cb(lv_indev_t * indev, lv_indev_data_t * data); -static void framebuffer_size_callback(GLFWwindow * window, int width, int height); - -/********************** - * STATIC VARIABLES - **********************/ -static bool glfw_inited; -static bool glew_inited; -static lv_timer_t * update_handler_timer; -static lv_ll_t glfw_window_ll; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_glfw_window_t * lv_glfw_window_create(int32_t hor_res, int32_t ver_res, bool use_mouse_indev) -{ - if(lv_glfw_init() != 0) { - return NULL; - } - - lv_glfw_window_t * window = lv_ll_ins_tail(&glfw_window_ll); - LV_ASSERT_MALLOC(window); - if(window == NULL) return NULL; - lv_memzero(window, sizeof(*window)); - - /* Create window with graphics context */ - lv_glfw_window_t * existing_window = lv_ll_get_head(&glfw_window_ll); - window->window = glfwCreateWindow(hor_res, ver_res, "LVGL Simulator", NULL, - existing_window ? existing_window->window : NULL); - if(window->window == NULL) { - LV_LOG_ERROR("glfwCreateWindow fail."); - lv_ll_remove(&glfw_window_ll, window); - lv_free(window); - return NULL; - } - - window->hor_res = hor_res; - window->ver_res = ver_res; - lv_ll_init(&window->textures, sizeof(lv_glfw_texture_t)); - window->use_indev = use_mouse_indev; - - glfwSetWindowUserPointer(window->window, window); - lv_glfw_timer_init(); - lv_glfw_window_config(window->window, use_mouse_indev); - lv_glew_init(); - glfwMakeContextCurrent(window->window); - lv_opengles_init(); - - return window; -} - -void lv_glfw_window_delete(lv_glfw_window_t * window) -{ - glfwDestroyWindow(window->window); - if(window->use_indev) { - lv_glfw_texture_t * texture; - LV_LL_READ(&window->textures, texture) { - lv_indev_delete(texture->indev); - } - } - lv_ll_clear(&window->textures); - lv_ll_remove(&glfw_window_ll, window); - lv_free(window); - - if(lv_ll_is_empty(&glfw_window_ll)) { - lv_glfw_window_quit(); - } -} - -lv_glfw_texture_t * lv_glfw_window_add_texture(lv_glfw_window_t * window, unsigned int texture_id, int32_t w, int32_t h) -{ - lv_glfw_texture_t * texture = lv_ll_ins_tail(&window->textures); - LV_ASSERT_MALLOC(texture); - if(texture == NULL) return NULL; - lv_memzero(texture, sizeof(*texture)); - texture->window = window; - texture->texture_id = texture_id; - lv_area_set(&texture->area, 0, 0, w - 1, h - 1); - texture->opa = LV_OPA_COVER; - - if(window->use_indev) { - lv_display_t * texture_disp = lv_opengles_texture_get_from_texture_id(texture_id); - if(texture_disp != NULL) { - lv_indev_t * indev = lv_indev_create(); - if(indev == NULL) { - lv_ll_remove(&window->textures, texture); - lv_free(texture); - return NULL; - } - texture->indev = indev; - lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER); - lv_indev_set_read_cb(indev, indev_read_cb); - lv_indev_set_driver_data(indev, texture); - lv_indev_set_mode(indev, LV_INDEV_MODE_EVENT); - lv_indev_set_display(indev, texture_disp); - } - } - - return texture; -} - -void lv_glfw_texture_remove(lv_glfw_texture_t * texture) -{ - if(texture->indev != NULL) { - lv_indev_delete(texture->indev); - } - lv_ll_remove(&texture->window->textures, texture); - lv_free(texture); -} - -void lv_glfw_texture_set_x(lv_glfw_texture_t * texture, int32_t x) -{ - lv_area_set_pos(&texture->area, x, texture->area.y1); -} - -void lv_glfw_texture_set_y(lv_glfw_texture_t * texture, int32_t y) -{ - lv_area_set_pos(&texture->area, texture->area.x1, y); -} - -void lv_glfw_texture_set_opa(lv_glfw_texture_t * texture, lv_opa_t opa) -{ - texture->opa = opa; -} - -lv_indev_t * lv_glfw_texture_get_mouse_indev(lv_glfw_texture_t * texture) -{ - return texture->indev; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static int lv_glfw_init(void) -{ - if(glfw_inited) { - return 0; - } - - glfwSetErrorCallback(glfw_error_cb); - - int ret = glfwInit(); - if(ret == 0) { - LV_LOG_ERROR("glfwInit fail."); - return 1; - } - - lv_ll_init(&glfw_window_ll, sizeof(lv_glfw_window_t)); - - glfw_inited = true; - return 0; -} - -static int lv_glew_init(void) -{ - if(glew_inited) { - return 0; - } - - GLenum ret = glewInit(); - if(ret != GLEW_OK) { - LV_LOG_ERROR("glewInit fail: %d.", ret); - return ret; - } - - LV_LOG_INFO("GL version: %s", glGetString(GL_VERSION)); - LV_LOG_INFO("GLSL version: %s", glGetString(GL_SHADING_LANGUAGE_VERSION)); - - glew_inited = true; - - return 0; -} - -static void lv_glfw_timer_init(void) -{ - if(update_handler_timer == NULL) { - update_handler_timer = lv_timer_create(window_update_handler, LV_DEF_REFR_PERIOD, NULL); - lv_tick_set_cb(lv_glfw_tick_count_callback); - } -} - -static void lv_glfw_window_config(GLFWwindow * window, bool use_mouse_indev) -{ - glfwMakeContextCurrent(window); - - glfwSwapInterval(1); - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - - if(use_mouse_indev) { - glfwSetMouseButtonCallback(window, mouse_button_callback); - glfwSetCursorPosCallback(window, mouse_move_callback); - } - - glfwSetKeyCallback(window, key_callback); - - glfwSetWindowCloseCallback(window, window_close_callback); -} - -static void lv_glfw_window_quit(void) -{ - lv_timer_delete(update_handler_timer); - update_handler_timer = NULL; - - glfwTerminate(); - glfw_inited = false; - - lv_deinit(); - - exit(0); -} - -static void window_update_handler(lv_timer_t * t) -{ - LV_UNUSED(t); - - lv_glfw_window_t * window; - - glfwPollEvents(); - - /* delete windows that are ready to close */ - window = lv_ll_get_head(&glfw_window_ll); - while(window) { - lv_glfw_window_t * window_to_delete = window->closing ? window : NULL; - window = lv_ll_get_next(&glfw_window_ll, window); - if(window_to_delete) { - glfwSetWindowShouldClose(window_to_delete->window, GLFW_TRUE); - lv_glfw_window_delete(window_to_delete); - } - } - - /* render each window */ - LV_LL_READ(&glfw_window_ll, window) { - glfwMakeContextCurrent(window->window); - lv_opengles_viewport(0, 0, window->hor_res, window->ver_res); - lv_opengles_render_clear(); - - /* render each texture in the window */ - lv_glfw_texture_t * texture; - LV_LL_READ(&window->textures, texture) { - /* if the added texture is an LVGL opengles texture display, refresh it before rendering it */ - lv_display_t * texture_disp = lv_opengles_texture_get_from_texture_id(texture->texture_id); - if(texture_disp != NULL) { - lv_refr_now(texture_disp); - } - - lv_opengles_render_texture(texture->texture_id, &texture->area, texture->opa, window->hor_res, window->ver_res); - } - - /* Swap front and back buffers */ - glfwSwapBuffers(window->window); - } -} - -static void glfw_error_cb(int error, const char * description) -{ - LV_LOG_ERROR("GLFW Error %d: %s", error, description); -} - -static lv_glfw_window_t * lv_glfw_get_lv_window_from_window(GLFWwindow * window) -{ - return glfwGetWindowUserPointer(window); -} - -static void window_close_callback(GLFWwindow * window) -{ - lv_glfw_window_t * lv_window = lv_glfw_get_lv_window_from_window(window); - lv_window->closing = 1; -} - -static void key_callback(GLFWwindow * window, int key, int scancode, int action, int mods) -{ - LV_UNUSED(scancode); - LV_UNUSED(mods); - if(key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) { - lv_glfw_window_t * lv_window = lv_glfw_get_lv_window_from_window(window); - lv_window->closing = 1; - } -} - -static void mouse_button_callback(GLFWwindow * window, int button, int action, int mods) -{ - LV_UNUSED(mods); - if(button == GLFW_MOUSE_BUTTON_LEFT) { - lv_glfw_window_t * lv_window = lv_glfw_get_lv_window_from_window(window); - lv_window->mouse_last_state = action == GLFW_PRESS ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; - proc_mouse(lv_window); - } -} - -static void mouse_move_callback(GLFWwindow * window, double xpos, double ypos) -{ - lv_glfw_window_t * lv_window = lv_glfw_get_lv_window_from_window(window); - lv_window->mouse_last_point.x = (int32_t)xpos; - lv_window->mouse_last_point.y = (int32_t)ypos; - proc_mouse(lv_window); -} - -static void proc_mouse(lv_glfw_window_t * window) -{ - /* mouse activity will affect the topmost LVGL display texture */ - lv_glfw_texture_t * texture; - LV_LL_READ_BACK(&window->textures, texture) { - if(lv_area_is_point_on(&texture->area, &window->mouse_last_point, 0)) { - /* adjust the mouse pointer coordinates so that they are relative to the texture */ - texture->indev_last_point.x = window->mouse_last_point.x - texture->area.x1; - texture->indev_last_point.y = window->mouse_last_point.y - texture->area.y1; - texture->indev_last_state = window->mouse_last_state; - lv_indev_read(texture->indev); - break; - } - } -} - -static void indev_read_cb(lv_indev_t * indev, lv_indev_data_t * data) -{ - lv_glfw_texture_t * texture = lv_indev_get_driver_data(indev); - data->point = texture->indev_last_point; - data->state = texture->indev_last_state; -} - -static void framebuffer_size_callback(GLFWwindow * window, int width, int height) -{ - lv_glfw_window_t * lv_window = lv_glfw_get_lv_window_from_window(window); - lv_window->hor_res = width; - lv_window->ver_res = height; -} - -static uint32_t lv_glfw_tick_count_callback(void) -{ - double tick = glfwGetTime() * 1000.0; - return (uint32_t)tick; -} - -#endif /*LV_USE_OPENGLES*/ diff --git a/L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window.h b/L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window.h deleted file mode 100644 index e8e5161..0000000 --- a/L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - * @file lv_glfw_window.h - * - */ - -#ifndef LV_GLFW_WINDOW_H -#define LV_GLFW_WINDOW_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" -#if LV_USE_OPENGLES - -#include "../../misc/lv_types.h" -#include "../../display/lv_display.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a GLFW window with no textures and initialize OpenGL - * @param hor_res width in pixels of the window - * @param ver_res height in pixels of the window - * @param use_mouse_indev send pointer indev input to LVGL display textures - * @return the new GLFW window handle - */ -lv_glfw_window_t * lv_glfw_window_create(int32_t hor_res, int32_t ver_res, bool use_mouse_indev); - -/** - * Delete a GLFW window. If it is the last one, the process will exit - * @param window GLFW window to delete - */ -void lv_glfw_window_delete(lv_glfw_window_t * window); - -/** - * Add a texture to the GLFW window. It can be an LVGL display texture, or any OpenGL texture - * @param window GLFW window - * @param texture_id OpenGL texture ID - * @param w width in pixels of the texture - * @param h height in pixels of the texture - * @return the new texture handle - */ -lv_glfw_texture_t * lv_glfw_window_add_texture(lv_glfw_window_t * window, unsigned int texture_id, int32_t w, - int32_t h); - -/** - * Remove a texture from its GLFW window and delete it - * @param texture handle of a GLFW window texture - */ -void lv_glfw_texture_remove(lv_glfw_texture_t * texture); - -/** - * Set the x position of a texture within its GLFW window - * @param texture handle of a GLFW window texture - * @param x new x position of the texture - */ -void lv_glfw_texture_set_x(lv_glfw_texture_t * texture, int32_t x); - -/** - * Set the y position of a texture within its GLFW window - * @param texture handle of a GLFW window texture - * @param y new y position of the texture - */ -void lv_glfw_texture_set_y(lv_glfw_texture_t * texture, int32_t y); - -/** - * Set the opacity of a texture in a GLFW window - * @param texture handle of a GLFW window texture - * @param opa new opacity of the texture - */ -void lv_glfw_texture_set_opa(lv_glfw_texture_t * texture, lv_opa_t opa); - -/** - * Get the mouse indev associated with a texture in a GLFW window, if it exists - * @param texture handle of a GLFW window texture - * @return the indev or `NULL` - * @note there will only be an indev if the texture is based on an - * LVGL display texture and the window was created with - * `use_mouse_indev` as `true` - */ -lv_indev_t * lv_glfw_texture_get_mouse_indev(lv_glfw_texture_t * texture); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_OPENGLES */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_GLFW_WINDOW_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window_private.h b/L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window_private.h deleted file mode 100644 index a8149c2..0000000 --- a/L3_Middlewares/LVGL/src/drivers/glfw/lv_glfw_window_private.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file lv_glfw_window_private.h - * - */ - -#ifndef LV_GLFW_WINDOW_PRIVATE_H -#define LV_GLFW_WINDOW_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_glfw_window.h" -#if LV_USE_OPENGLES - -#include -#include - -#include "../../misc/lv_area.h" -#include "../../display/lv_display.h" -#include "../../indev/lv_indev.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_glfw_window_t { - GLFWwindow * window; - int32_t hor_res; - int32_t ver_res; - lv_ll_t textures; - lv_point_t mouse_last_point; - lv_indev_state_t mouse_last_state; - uint8_t use_indev : 1; - uint8_t closing : 1; -}; - -struct lv_glfw_texture_t { - lv_glfw_window_t * window; - unsigned int texture_id; - lv_area_t area; - lv_opa_t opa; - lv_indev_t * indev; - lv_point_t indev_last_point; - lv_indev_state_t indev_last_state; -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_OPENGLES*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_GLFW_WINDOW_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_debug.h b/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_debug.h deleted file mode 100644 index ddde0eb..0000000 --- a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_debug.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @file lv_opengles_debug.h - * - */ - -#ifndef LV_OPENGLES_DEBUG_H -#define LV_OPENGLES_DEBUG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "../../lv_conf_internal.h" -#if LV_USE_OPENGLES - -#include -#include -#include - -void GLClearError(void); - -bool GLLogCall(const char * function, const char * file, int line); - -#if LV_USE_OPENGLES_DEBUG -#define GL_CALL(x) GLClearError();\ - x;\ - GLLogCall(#x, __FILE__, __LINE__) -#else -#define GL_CALL(x) x -#endif - -#endif /* LV_USE_OPENGLES */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_OPENGLES_DEBUG_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_driver.c b/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_driver.c deleted file mode 100644 index 110e714..0000000 --- a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_driver.c +++ /dev/null @@ -1,409 +0,0 @@ -/** - * @file lv_opengles_driver.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../display/lv_display.h" - -#if LV_USE_OPENGLES - -#include "lv_opengles_debug.h" -#include "lv_opengles_driver.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_opengles_enable_blending(void); -static void lv_opengles_vertex_buffer_init(const void * data, unsigned int size); -static void lv_opengles_vertex_buffer_deinit(void); -static void lv_opengles_vertex_buffer_bind(void); -static void lv_opengles_vertex_buffer_unbind(void); -static void lv_opengles_vertex_array_init(void); -static void lv_opengles_vertex_array_deinit(void); -static void lv_opengles_vertex_array_bind(void); -static void lv_opengles_vertex_array_unbind(void); -static void lv_opengles_vertex_array_add_buffer(void); -static void lv_opengles_index_buffer_init(const unsigned int * data, unsigned int count); -static void lv_opengles_index_buffer_deinit(void); -static unsigned int lv_opengles_index_buffer_get_count(void); -static void lv_opengles_index_buffer_bind(void); -static void lv_opengles_index_buffer_unbind(void); -static unsigned int lv_opengles_shader_compile(unsigned int type, const char * source); -static unsigned int lv_opengles_shader_create(const char * vertexShader, const char * fragmentShader); -static void lv_opengles_shader_init(void); -static void lv_opengles_shader_deinit(void); -static void lv_opengles_shader_bind(void); -static void lv_opengles_shader_unbind(void); -static int lv_opengles_shader_get_uniform_location(const char * name); -static void lv_opengles_shader_set_uniform1i(const char * name, int value); -static void lv_opengles_shader_set_uniformmatrix3fv(const char * name, int count, bool transpose, const float * values); -static void lv_opengles_shader_set_uniform1f(const char * name, float value); -static void lv_opengles_render_draw(void); - -/*********************** - * GLOBAL PROTOTYPES - ***********************/ - -/********************** - * STATIC VARIABLES - **********************/ -static bool is_init; - -static unsigned int vertex_buffer_id = 0; - -static unsigned int vertex_array_id = 0; - -static unsigned int index_buffer_id = 0; -static unsigned int index_buffer_count = 0; - -static unsigned int shader_id; - -static const char * shader_names[] = { "u_Texture", "u_ColorDepth", "u_VertexTransform", "u_Opa" }; -static int shader_location[] = { 0, 0, 0, 0 }; - -static const char * vertex_shader = - "#version 300 es\n" - "\n" - "in vec4 position;\n" - "in vec2 texCoord;\n" - "\n" - "out vec2 v_TexCoord;\n" - "\n" - "uniform mat3 u_VertexTransform;\n" - "\n" - "void main()\n" - "{\n" - " gl_Position = vec4((u_VertexTransform * vec3(position.xy, 1)).xy, position.zw);\n" - " v_TexCoord = texCoord;\n" - "};\n"; - -static const char * fragment_shader = - "#version 300 es\n" - "\n" - "precision mediump float;\n" - "\n" - "layout(location = 0) out vec4 color;\n" - "\n" - "in vec2 v_TexCoord;\n" - "\n" - "uniform sampler2D u_Texture;\n" - "uniform int u_ColorDepth;\n" - "uniform float u_Opa;\n" - "\n" - "void main()\n" - "{\n" - " vec4 texColor = texture(u_Texture, v_TexCoord);\n" - " if (u_ColorDepth == 8) {\n" - " float gray = texColor.r;\n" - " color = vec4(gray, gray, gray, u_Opa);\n" - " } else {\n" - " color = vec4(texColor.rgb, texColor.a * u_Opa);\n" - " }\n" - "};\n"; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_opengles_init(void) -{ - if(is_init) return; - - lv_opengles_enable_blending(); - - float positions[] = { - -1.0f, 1.0f, 0.0f, 0.0f, - 1.0f, 1.0f, 1.0f, 0.0f, - 1.0f, -1.0f, 1.0f, 1.0f, - -1.0f, -1.0f, 0.0f, 1.0f - }; - - unsigned int indices[] = { - 0, 1, 2, - 2, 3, 0 - }; - - lv_opengles_vertex_buffer_init(positions, sizeof(positions)); - - lv_opengles_vertex_array_init(); - lv_opengles_vertex_array_add_buffer(); - - lv_opengles_index_buffer_init(indices, 6); - - lv_opengles_shader_init(); - lv_opengles_shader_bind(); - - /* unbind everything */ - lv_opengles_vertex_array_unbind(); - lv_opengles_vertex_buffer_unbind(); - lv_opengles_index_buffer_unbind(); - lv_opengles_shader_unbind(); - - is_init = true; -} - -void lv_opengles_deinit(void) -{ - if(!is_init) return; - - lv_opengles_shader_deinit(); - lv_opengles_index_buffer_deinit(); - lv_opengles_vertex_buffer_deinit(); - lv_opengles_vertex_array_deinit(); - - is_init = false; -} - -void lv_opengles_render_texture(unsigned int texture, const lv_area_t * texture_area, lv_opa_t opa, int32_t disp_w, - int32_t disp_h) -{ - GL_CALL(glActiveTexture(GL_TEXTURE0)); - GL_CALL(glBindTexture(GL_TEXTURE_2D, texture)); - - float hor_scale = (float)lv_area_get_width(texture_area) / (float)disp_w; - float ver_scale = (float)lv_area_get_height(texture_area) / (float)disp_h; - float hor_translate = (float)texture_area->x1 / (float)disp_w * 2.0f - (1.0f - hor_scale); - float ver_translate = -((float)texture_area->y1 / (float)disp_h * 2.0f - (1.0f - ver_scale)); - float matrix[9] = { - hor_scale, 0.0f, hor_translate, - 0.0f, ver_scale, ver_translate, - 0.0f, 0.0f, 1.0f - }; - - lv_opengles_shader_bind(); - lv_opengles_shader_set_uniform1i("u_ColorDepth", LV_COLOR_DEPTH); - lv_opengles_shader_set_uniform1i("u_Texture", 0); - lv_opengles_shader_set_uniformmatrix3fv("u_VertexTransform", 1, true, matrix); - lv_opengles_shader_set_uniform1f("u_Opa", (float)opa / (float)LV_OPA_100); - lv_opengles_render_draw(); -} - -void lv_opengles_render_clear(void) -{ - GL_CALL(glClear(GL_COLOR_BUFFER_BIT)); -} - -void lv_opengles_viewport(int32_t x, int32_t y, int32_t w, int32_t h) -{ - glViewport(x, y, w, h); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_opengles_enable_blending(void) -{ - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -} - -static void lv_opengles_vertex_buffer_init(const void * data, unsigned int size) -{ - GL_CALL(glGenBuffers(1, &vertex_buffer_id)); - GL_CALL(glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_id)); - GL_CALL(glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW)); -} - -static void lv_opengles_vertex_buffer_deinit(void) -{ - GL_CALL(glDeleteBuffers(1, &vertex_buffer_id)); -} - -static void lv_opengles_vertex_buffer_bind(void) -{ - GL_CALL(glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_id)); -} - -static void lv_opengles_vertex_buffer_unbind(void) -{ - GL_CALL(glBindBuffer(GL_ARRAY_BUFFER, 0)); -} - -static void lv_opengles_vertex_array_init(void) -{ - GL_CALL(glGenVertexArrays(1, &vertex_array_id)); -} - -static void lv_opengles_vertex_array_deinit(void) -{ - GL_CALL(glDeleteVertexArrays(1, &vertex_array_id)); -} - -static void lv_opengles_vertex_array_bind(void) -{ - GL_CALL(glBindVertexArray(vertex_array_id)); -} - -static void lv_opengles_vertex_array_unbind(void) -{ - GL_CALL(glBindVertexArray(0)); -} - -static void lv_opengles_vertex_array_add_buffer(void) -{ - lv_opengles_vertex_buffer_bind(); - intptr_t offset = 0; - - for(unsigned int i = 0; i < 2; i++) { - lv_opengles_vertex_array_bind(); - GL_CALL(glEnableVertexAttribArray(i)); - GL_CALL(glVertexAttribPointer(i, 2, GL_FLOAT, GL_FALSE, 16, (const void *)offset)); - offset += 2 * 4; - } -} - -static void lv_opengles_index_buffer_init(const unsigned int * data, unsigned int count) -{ - index_buffer_count = count; - GL_CALL(glGenBuffers(1, &index_buffer_id)); - - GL_CALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_buffer_id)); - - GL_CALL(glBufferData(GL_ELEMENT_ARRAY_BUFFER, count * sizeof(GLuint), data, GL_STATIC_DRAW)); -} - -static void lv_opengles_index_buffer_deinit(void) -{ - GL_CALL(glDeleteBuffers(1, &index_buffer_id)); -} - -static unsigned int lv_opengles_index_buffer_get_count(void) -{ - return index_buffer_count; -} - -static void lv_opengles_index_buffer_bind(void) -{ - GL_CALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_buffer_id)); -} - -static void lv_opengles_index_buffer_unbind(void) -{ - GL_CALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)); -} - -static unsigned int lv_opengles_shader_compile(unsigned int type, const char * source) -{ - GL_CALL(unsigned int id = glCreateShader(type)); - const char * src = source; - GL_CALL(glShaderSource(id, 1, &src, NULL)); - GL_CALL(glCompileShader(id)); - - int result; - GL_CALL(glGetShaderiv(id, GL_COMPILE_STATUS, &result)); - if(result == GL_FALSE) { - int length; - GL_CALL(glGetShaderiv(id, GL_INFO_LOG_LENGTH, &length)); - char * message = lv_malloc_zeroed(length * sizeof(char)); - GL_CALL(glGetShaderInfoLog(id, length, &length, message)); - LV_LOG_ERROR("Failed to compile %s shader!", type == GL_VERTEX_SHADER ? "vertex" : "fragment"); - LV_LOG_ERROR("%s", message); - GL_CALL(glDeleteShader(id)); - return 0; - } - - return id; -} - -static unsigned int lv_opengles_shader_create(const char * vertexShader, const char * fragmentShader) -{ - GL_CALL(unsigned int program = glCreateProgram()); - unsigned int vs = lv_opengles_shader_compile(GL_VERTEX_SHADER, vertexShader); - unsigned int fs = lv_opengles_shader_compile(GL_FRAGMENT_SHADER, fragmentShader); - - GL_CALL(glAttachShader(program, vs)); - GL_CALL(glAttachShader(program, fs)); - GL_CALL(glLinkProgram(program)); - GL_CALL(glValidateProgram(program)); - - GL_CALL(glDeleteShader(vs)); - GL_CALL(glDeleteShader(fs)); - - return program; -} - -static void lv_opengles_shader_init(void) -{ - shader_id = lv_opengles_shader_create(vertex_shader, fragment_shader); -} - -static void lv_opengles_shader_deinit(void) -{ - GL_CALL(glDeleteProgram(shader_id)); -} - -static void lv_opengles_shader_bind(void) -{ - GL_CALL(glUseProgram(shader_id)); -} - -static void lv_opengles_shader_unbind(void) -{ - GL_CALL(glUseProgram(0)); -} - -static int lv_opengles_shader_get_uniform_location(const char * name) -{ - int id = -1; - for(size_t i = 0; i < sizeof(shader_location) / sizeof(int); i++) { - if(lv_strcmp(shader_names[i], name) == 0) { - id = i; - } - } - if(id == -1) { - return -1; - } - - if(shader_location[id] != 0) { - return shader_location[id]; - } - - GL_CALL(int location = glGetUniformLocation(shader_id, name)); - if(location == -1) - LV_LOG_WARN("Warning: uniform '%s' doesn't exist!", name); - - shader_location[id] = location; - return location; -} - -static void lv_opengles_shader_set_uniform1i(const char * name, int value) -{ - GL_CALL(glUniform1i(lv_opengles_shader_get_uniform_location(name), value)); -} - -static void lv_opengles_shader_set_uniformmatrix3fv(const char * name, int count, bool transpose, const float * values) -{ - GL_CALL(glUniformMatrix3fv(lv_opengles_shader_get_uniform_location(name), count, transpose, values)); -} - -static void lv_opengles_shader_set_uniform1f(const char * name, float value) -{ - GL_CALL(glUniform1f(lv_opengles_shader_get_uniform_location(name), value)); -} - -static void lv_opengles_render_draw(void) -{ - lv_opengles_shader_bind(); - lv_opengles_vertex_array_bind(); - lv_opengles_index_buffer_bind(); - unsigned int count = lv_opengles_index_buffer_get_count(); - GL_CALL(glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_INT, NULL)); -} - -#endif /* LV_USE_OPENGLES */ diff --git a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_driver.h b/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_driver.h deleted file mode 100644 index e539feb..0000000 --- a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_driver.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file lv_opengles_driver.h - * - */ - -#ifndef LV_OPENGLES_DRIVER_H -#define LV_OPENGLES_DRIVER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" -#if LV_USE_OPENGLES - -#include "../../misc/lv_area.h" -#include "../../misc/lv_color.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize OpenGL - * @note it is not necessary to call this if you use `lv_glfw_window_create` - */ -void lv_opengles_init(void); - -/** - * Deinitialize OpenGL - * @note it is not necessary to call this if you use `lv_glfw_window_create` - */ -void lv_opengles_deinit(void); - -/** - * Render a texture - * @param texture OpenGL texture ID - * @param texture_area the area in the window to render the texture in - * @param opa opacity to blend the texture with existing contents - * @param disp_w width of the window being rendered to - * @param disp_h height of the window being rendered to - */ -void lv_opengles_render_texture(unsigned int texture, const lv_area_t * texture_area, lv_opa_t opa, int32_t disp_w, - int32_t disp_h); - -/** - * Clear the window/display - */ -void lv_opengles_render_clear(void); - -/** - * Set the OpenGL viewport - * @param x x position of the viewport - * @param y y position of the viewport - * @param w width of the viewport - * @param h height of the viewport - */ -void lv_opengles_viewport(int32_t x, int32_t y, int32_t w, int32_t h); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_OPENGLES */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_OPENGLES_DRIVER_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_texture.c b/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_texture.c deleted file mode 100644 index 02c9dfa..0000000 --- a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_texture.c +++ /dev/null @@ -1,151 +0,0 @@ -/** - * @file lv_opengles_texture.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_opengles_texture.h" -#if LV_USE_OPENGLES - -#include "lv_opengles_debug.h" -#include "../../display/lv_display_private.h" -#include -#include -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - unsigned int texture_id; - uint8_t * fb1; -} lv_opengles_texture_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map); -static void release_disp_cb(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_opengles_texture_create(int32_t w, int32_t h) -{ - lv_display_t * disp = lv_display_create(w, h); - if(disp == NULL) { - return NULL; - } - lv_opengles_texture_t * dsc = lv_malloc_zeroed(sizeof(lv_opengles_texture_t)); - LV_ASSERT_MALLOC(dsc); - if(dsc == NULL) { - lv_display_delete(disp); - return NULL; - } - uint32_t stride = lv_draw_buf_width_to_stride(w, lv_display_get_color_format(disp)); - uint32_t buf_size = stride * h; - dsc->fb1 = malloc(buf_size); - if(dsc->fb1 == NULL) { - lv_free(dsc); - lv_display_delete(disp); - return NULL; - } - - GL_CALL(glGenTextures(1, &dsc->texture_id)); - GL_CALL(glBindTexture(GL_TEXTURE_2D, dsc->texture_id)); - GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); - GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); - GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); - GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); - GL_CALL(glPixelStorei(GL_UNPACK_ALIGNMENT, 1)); - - lv_display_set_buffers(disp, dsc->fb1, NULL, buf_size, LV_DISPLAY_RENDER_MODE_DIRECT); - lv_display_set_flush_cb(disp, flush_cb); - lv_display_set_driver_data(disp, dsc); - lv_display_add_event_cb(disp, release_disp_cb, LV_EVENT_DELETE, disp); - - return disp; -} - -unsigned int lv_opengles_texture_get_texture_id(lv_display_t * disp) -{ - if(disp->flush_cb != flush_cb) { - return 0; - } - lv_opengles_texture_t * dsc = lv_display_get_driver_data(disp); - return dsc->texture_id; -} - -lv_display_t * lv_opengles_texture_get_from_texture_id(unsigned int texture_id) -{ - lv_display_t * disp = NULL; - while(NULL != (disp = lv_display_get_next(disp))) { - unsigned int disp_texture_id = lv_opengles_texture_get_texture_id(disp); - if(disp_texture_id == texture_id) { - return disp; - } - } - return NULL; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map) -{ - LV_UNUSED(area); - LV_UNUSED(px_map); - - if(lv_display_flush_is_last(disp)) { - - lv_opengles_texture_t * dsc = lv_display_get_driver_data(disp); - - GL_CALL(glBindTexture(GL_TEXTURE_2D, dsc->texture_id)); - - GL_CALL(glPixelStorei(GL_UNPACK_ALIGNMENT, 1)); - /*Color depth: 8 (A8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/ -#if LV_COLOR_DEPTH == 8 - GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, disp->hor_res, disp->ver_res, 0, GL_RED, GL_UNSIGNED_BYTE, dsc->fb1)); -#elif LV_COLOR_DEPTH == 16 - GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB565, disp->hor_res, disp->ver_res, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, - dsc->fb1)); -#elif LV_COLOR_DEPTH == 24 - GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, disp->hor_res, disp->ver_res, 0, GL_BGR, GL_UNSIGNED_BYTE, dsc->fb1)); -#elif LV_COLOR_DEPTH == 32 - GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, disp->hor_res, disp->ver_res, 0, GL_BGRA, GL_UNSIGNED_BYTE, dsc->fb1)); -#else -#error("Unsupported color format") -#endif - } - - lv_display_flush_ready(disp); -} - -static void release_disp_cb(lv_event_t * e) -{ - lv_display_t * disp = lv_event_get_user_data(e); - lv_opengles_texture_t * dsc = lv_display_get_driver_data(disp); - free(dsc->fb1); - lv_free(dsc); -} - -#endif /*LV_USE_OPENGLES*/ diff --git a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_texture.h b/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_texture.h deleted file mode 100644 index 0d53b2b..0000000 --- a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_texture.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file lv_opengles_texture.h - * - */ - -#ifndef LV_OPENGLES_TEXTURE_H -#define LV_OPENGLES_TEXTURE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" -#if LV_USE_OPENGLES - -#include "../../display/lv_display.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a display that flushes to an OpenGL texture - * @param w width in pixels of the texture - * @param h height in pixels of the texture - * @return the new display - */ -lv_display_t * lv_opengles_texture_create(int32_t w, int32_t h); - -/** - * Get the OpenGL texture ID of the display - * @param disp display - * @return texture ID - */ -unsigned int lv_opengles_texture_get_texture_id(lv_display_t * disp); - -/** - * Get the display of an OpenGL texture if it is associated with one - * @param texture_id OpenGL texture ID - * @return display or `NULL` if there no display with that texture ID - */ -lv_display_t * lv_opengles_texture_get_from_texture_id(unsigned int texture_id); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_OPENGLES */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OPENGLES_TEXTURE_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput.c b/L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput.c deleted file mode 100644 index 7410f40..0000000 --- a/L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput.c +++ /dev/null @@ -1,672 +0,0 @@ -/** - * @file lv_libinput.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../indev/lv_indev_private.h" -#include "lv_libinput_private.h" - -#if LV_USE_LIBINPUT - -#include "../../display/lv_display_private.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if LV_LIBINPUT_BSD - #include -#else - #include -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_libinput_device { - lv_libinput_capability capabilities; - char * path; -}; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static bool _rescan_devices(void); -static bool _add_scanned_device(char * path, lv_libinput_capability capabilities); -static void _reset_scanned_devices(void); - -static void * _poll_thread(void * data); - -lv_libinput_event_t * _get_event(lv_libinput_t * state); -bool _event_pending(lv_libinput_t * state); -lv_libinput_event_t * _create_event(lv_libinput_t * state); - -static void _read(lv_indev_t * indev, lv_indev_data_t * data); -static void _read_pointer(lv_libinput_t * state, struct libinput_event * event); -static void _read_keypad(lv_libinput_t * state, struct libinput_event * event); - -static int _open_restricted(const char * path, int flags, void * user_data); -static void _close_restricted(int fd, void * user_data); - -static void _delete(lv_libinput_t * dsc); - -/********************** - * STATIC VARIABLES - **********************/ - -static struct lv_libinput_device * devices = NULL; -static size_t num_devices = 0; - -static const int timeout = 100; // ms -static const nfds_t nfds = 1; - -static const struct libinput_interface interface = { - .open_restricted = _open_restricted, - .close_restricted = _close_restricted, -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_libinput_capability lv_libinput_query_capability(struct libinput_device * device) -{ - lv_libinput_capability capability = LV_LIBINPUT_CAPABILITY_NONE; - if(libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD) - && (libinput_device_keyboard_has_key(device, KEY_ENTER) || libinput_device_keyboard_has_key(device, KEY_KPENTER))) { - capability |= LV_LIBINPUT_CAPABILITY_KEYBOARD; - } - if(libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER)) { - capability |= LV_LIBINPUT_CAPABILITY_POINTER; - } - if(libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH)) { - capability |= LV_LIBINPUT_CAPABILITY_TOUCH; - } - return capability; -} - -char * lv_libinput_find_dev(lv_libinput_capability capabilities, bool force_rescan) -{ - char * path = NULL; - lv_libinput_find_devs(capabilities, &path, 1, force_rescan); - return path; -} - -size_t lv_libinput_find_devs(lv_libinput_capability capabilities, char ** found, size_t count, bool force_rescan) -{ - if((!devices || force_rescan) && !_rescan_devices()) { - return 0; - } - - size_t num_found = 0; - - for(size_t i = 0; i < num_devices && num_found < count; ++i) { - if(devices[i].capabilities & capabilities) { - found[num_found] = devices[i].path; - num_found++; - } - } - - return num_found; -} - -lv_indev_t * lv_libinput_create(lv_indev_type_t indev_type, const char * dev_path) -{ - lv_libinput_t * dsc = lv_malloc_zeroed(sizeof(lv_libinput_t)); - LV_ASSERT_MALLOC(dsc); - if(dsc == NULL) return NULL; - - dsc->libinput_context = libinput_path_create_context(&interface, NULL); - if(!dsc->libinput_context) { - LV_LOG_ERROR("libinput_path_create_context failed: %s", strerror(errno)); - _delete(dsc); - return NULL; - } - - dsc->libinput_device = libinput_path_add_device(dsc->libinput_context, dev_path); - if(!dsc->libinput_device) { - _delete(dsc); - return NULL; - } - - dsc->libinput_device = libinput_device_ref(dsc->libinput_device); - if(!dsc->libinput_device) { - _delete(dsc); - return NULL; - } - - dsc->fd = libinput_get_fd(dsc->libinput_context); - - /* Prepare poll */ - dsc->fds[0].fd = dsc->fd; - dsc->fds[0].events = POLLIN; - dsc->fds[0].revents = 0; - -#if LV_LIBINPUT_XKB - struct xkb_rule_names names = LV_LIBINPUT_XKB_KEY_MAP; - lv_xkb_init(&(dsc->xkb), names); -#endif /* LV_LIBINPUT_XKB */ - - /* Create indev */ - lv_indev_t * indev = lv_indev_create(); - if(!indev) { - _delete(dsc); - return NULL; - } - lv_indev_set_type(indev, indev_type); - lv_indev_set_read_cb(indev, _read); - lv_indev_set_driver_data(indev, dsc); - - /* Set up thread & lock */ - pthread_mutex_init(&dsc->event_lock, NULL); - pthread_create(&dsc->worker_thread, NULL, _poll_thread, dsc); - - return indev; -} - -void lv_libinput_delete(lv_indev_t * indev) -{ - _delete(lv_indev_get_driver_data(indev)); - lv_indev_delete(indev); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * rescan all attached evdev devices and store capable ones into the static devices array for quick later filtering - * @return true if the operation succeeded - */ -static bool _rescan_devices(void) -{ - _reset_scanned_devices(); - - DIR * dir; - struct dirent * ent; - if(!(dir = opendir("/dev/input"))) { - perror("unable to open directory /dev/input"); - return false; - } - - struct libinput * context = libinput_path_create_context(&interface, NULL); - - while((ent = readdir(dir))) { - if(strncmp(ent->d_name, "event", 5) != 0) { - continue; - } - - /* 11 characters for /dev/input/ + length of name + 1 NUL terminator */ - char * path = malloc((11 + strlen(ent->d_name) + 1) * sizeof(char)); - if(!path) { - perror("could not allocate memory for device node path"); - libinput_unref(context); - _reset_scanned_devices(); - return false; - } - strcpy(path, "/dev/input/"); - strcat(path, ent->d_name); - - struct libinput_device * device = libinput_path_add_device(context, path); - if(!device) { - perror("unable to add device to libinput context"); - free(path); - continue; - } - - /* The device pointer is guaranteed to be valid until the next libinput_dispatch. Since we're not dispatching events - * as part of this function, we don't have to increase its reference count to keep it alive. - * https://wayland.freedesktop.org/libinput/doc/latest/api/group__base.html#gaa797496f0150b482a4e01376bd33a47b */ - - lv_libinput_capability capabilities = lv_libinput_query_capability(device); - - libinput_path_remove_device(device); - - if(capabilities == LV_LIBINPUT_CAPABILITY_NONE) { - free(path); - continue; - } - - if(!_add_scanned_device(path, capabilities)) { - free(path); - libinput_unref(context); - _reset_scanned_devices(); - return false; - } - } - - libinput_unref(context); - return true; -} - -/** - * add a new scanned device to the static devices array, growing its size when necessary - * @param path device file path - * @param capabilities device input capabilities - * @return true if the operation succeeded - */ -static bool _add_scanned_device(char * path, lv_libinput_capability capabilities) -{ - /* Double array size every 2^n elements */ - if((num_devices & (num_devices + 1)) == 0) { - struct lv_libinput_device * tmp = realloc(devices, (2 * num_devices + 1) * sizeof(struct lv_libinput_device)); - if(!tmp) { - perror("could not reallocate memory for devices array"); - return false; - } - devices = tmp; - } - - devices[num_devices].path = path; - devices[num_devices].capabilities = capabilities; - num_devices++; - - return true; -} - -/** - * reset the array of scanned devices and free any dynamically allocated memory - */ -static void _reset_scanned_devices(void) -{ - if(!devices) { - return; - } - - for(size_t i = 0; i < num_devices; ++i) { - free(devices[i].path); - } - free(devices); - - devices = NULL; - num_devices = 0; -} - -static void * _poll_thread(void * data) -{ - lv_libinput_t * dsc = (lv_libinput_t *)data; - struct libinput_event * event; - int rc = 0; - - LV_LOG_INFO("libinput: poll worker started"); - - while(true) { - rc = poll(dsc->fds, nfds, timeout); - switch(rc) { - case -1: - perror(NULL); - __attribute__((fallthrough)); - case 0: - if(dsc->deinit) { - dsc->deinit = false; /* Signal that we're done */ - return NULL; - } - continue; - default: - break; - } - libinput_dispatch(dsc->libinput_context); - pthread_mutex_lock(&dsc->event_lock); - while((event = libinput_get_event(dsc->libinput_context)) != NULL) { - _read_pointer(dsc, event); - _read_keypad(dsc, event); - libinput_event_destroy(event); - } - pthread_mutex_unlock(&dsc->event_lock); - LV_LOG_INFO("libinput: event read"); - } - - return NULL; -} - -lv_libinput_event_t * _get_event(lv_libinput_t * dsc) -{ - if(dsc->start == dsc->end) { - return NULL; - } - - lv_libinput_event_t * evt = &dsc->points[dsc->start]; - - if(++dsc->start == LV_LIBINPUT_MAX_EVENTS) - dsc->start = 0; - - return evt; -} - -bool _event_pending(lv_libinput_t * dsc) -{ - return dsc->start != dsc->end; -} - -lv_libinput_event_t * _create_event(lv_libinput_t * dsc) -{ - lv_libinput_event_t * evt = &dsc->points[dsc->end]; - - if(++dsc->end == LV_LIBINPUT_MAX_EVENTS) - dsc->end = 0; - - /* We have overflowed the buffer, start overwriting - * old events. - */ - if(dsc->end == dsc->start) { - LV_LOG_INFO("libinput: overflowed event buffer!"); - if(++dsc->start == LV_LIBINPUT_MAX_EVENTS) - dsc->start = 0; - } - - memset(evt, 0, sizeof(lv_libinput_event_t)); - - return evt; -} - -static void _read(lv_indev_t * indev, lv_indev_data_t * data) -{ - lv_libinput_t * dsc = lv_indev_get_driver_data(indev); - LV_ASSERT_NULL(dsc); - - pthread_mutex_lock(&dsc->event_lock); - - lv_libinput_event_t * evt = _get_event(dsc); - - if(!evt) - evt = &dsc->last_event; /* indev expects us to report the most recent state */ - - data->point = evt->point; - data->state = evt->pressed; - data->key = evt->key_val; - data->continue_reading = _event_pending(dsc); - - dsc->last_event = *evt; /* Remember the last event for the next call */ - - pthread_mutex_unlock(&dsc->event_lock); - - if(evt) - LV_LOG_TRACE("libinput_read: (%04d, %04d): %d continue_reading? %d", data->point.x, data->point.y, data->state, - data->continue_reading); -} - -static void _read_pointer(lv_libinput_t * dsc, struct libinput_event * event) -{ - struct libinput_event_touch * touch_event = NULL; - struct libinput_event_pointer * pointer_event = NULL; - lv_libinput_event_t * evt = NULL; - enum libinput_event_type type = libinput_event_get_type(event); - int slot = 0; - - switch(type) { - case LIBINPUT_EVENT_TOUCH_MOTION: - case LIBINPUT_EVENT_TOUCH_DOWN: - case LIBINPUT_EVENT_TOUCH_UP: - touch_event = libinput_event_get_touch_event(event); - break; - case LIBINPUT_EVENT_POINTER_MOTION: - case LIBINPUT_EVENT_POINTER_BUTTON: - case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE: - pointer_event = libinput_event_get_pointer_event(event); - break; - default: - return; /* We don't care about this events */ - } - - /* We need to read unrotated display dimensions directly from the driver because libinput won't account - * for any rotation inside of LVGL */ - lv_display_t * disp = lv_display_get_default(); - - /* ignore more than 2 fingers as it will only confuse LVGL */ - if(touch_event && (slot = libinput_event_touch_get_slot(touch_event)) > 1) - return; - - evt = _create_event(dsc); - - const int32_t hor_res = disp->physical_hor_res > 0 ? disp->physical_hor_res : disp->hor_res; - const int32_t ver_res = disp->physical_ver_res > 0 ? disp->physical_ver_res : disp->ver_res; - - switch(type) { - case LIBINPUT_EVENT_TOUCH_MOTION: - case LIBINPUT_EVENT_TOUCH_DOWN: { - lv_point_t point; - point.x = (int32_t)LV_CLAMP(INT32_MIN, libinput_event_touch_get_x_transformed(touch_event, hor_res) - disp->offset_x, - INT32_MAX); - point.y = (int32_t)LV_CLAMP(INT32_MIN, libinput_event_touch_get_y_transformed(touch_event, ver_res) - disp->offset_y, - INT32_MAX); - if(point.x < 0 || point.x > disp->hor_res || point.y < 0 || point.y > disp->ver_res) { - break; /* ignore touches that are out of bounds */ - } - evt->point = point; - evt->pressed = LV_INDEV_STATE_PRESSED; - dsc->slots[slot].point = evt->point; - dsc->slots[slot].pressed = evt->pressed; - break; - } - case LIBINPUT_EVENT_TOUCH_UP: - /* - * We don't support "multitouch", but libinput does. To make fast typing with two thumbs - * on a keyboard feel good, it's necessary to handle two fingers individually. The edge - * case here is if you press a key with one finger and then press a second key with another - * finger. No matter which finger you release, it will count as the second finger releasing - * and ignore the first because LVGL only stores a single (the latest) pressed state. - * - * To work around this, we detect the case where one finger is released while the other is - * still pressed and insert dummy events so that both release events trigger at the correct - * position. - */ - if(slot == 0 && dsc->slots[1].pressed == LV_INDEV_STATE_PRESSED) { - /* The first finger is released while the second finger is still pressed. - * We turn P1 > P2 > R1 > R2 into P1 > P2 > (P1) > R1 > (P2) > R2. - */ - - /* Inject the dummy press event for the first finger */ - lv_libinput_event_t * synth_evt = evt; - synth_evt->pressed = LV_INDEV_STATE_PRESSED; - synth_evt->point = dsc->slots[0].point; - - /* Append the real release event for the first finger */ - evt = _create_event(dsc); - evt->pressed = LV_INDEV_STATE_RELEASED; - evt->point = dsc->slots[0].point; - - /* Inject the dummy press event for the second finger */ - synth_evt = _create_event(dsc); - synth_evt->pressed = LV_INDEV_STATE_PRESSED; - synth_evt->point = dsc->slots[1].point; - } - else if(slot == 1 && dsc->slots[0].pressed == LV_INDEV_STATE_PRESSED) { - /* The second finger is released while the first finger is still pressed. - * We turn P1 > P2 > R2 > R1 into P1 > P2 > R2 > (P1) > R1. - */ - - /* Append the real release event for the second finger */ - evt->pressed = LV_INDEV_STATE_RELEASED; - evt->point = dsc->slots[1].point; - - /* Inject the dummy press event for the first finger */ - lv_libinput_event_t * synth_evt = _create_event(dsc); - synth_evt->pressed = LV_INDEV_STATE_PRESSED; - synth_evt->point = dsc->slots[0].point; - } - else { - evt->pressed = LV_INDEV_STATE_RELEASED; - evt->point = dsc->slots[slot].point; - } - - dsc->slots[slot].pressed = evt->pressed; - break; - case LIBINPUT_EVENT_POINTER_MOTION: - dsc->pointer_position.x = (int32_t)LV_CLAMP(0, dsc->pointer_position.x + libinput_event_pointer_get_dx(pointer_event), - disp->hor_res - 1); - dsc->pointer_position.y = (int32_t)LV_CLAMP(0, dsc->pointer_position.y + libinput_event_pointer_get_dy(pointer_event), - disp->ver_res - 1); - evt->point.x = dsc->pointer_position.x; - evt->point.y = dsc->pointer_position.y; - evt->pressed = dsc->pointer_button_down; - break; - case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE: { - lv_point_t point; - point.x = (int32_t)LV_CLAMP(INT32_MIN, libinput_event_pointer_get_absolute_x_transformed(pointer_event, - hor_res) - disp->offset_x, INT32_MAX); - point.y = (int32_t)LV_CLAMP(INT32_MIN, libinput_event_pointer_get_absolute_y_transformed(pointer_event, - ver_res) - disp->offset_y, INT32_MAX); - if(point.x < 0 || point.x > disp->hor_res || point.y < 0 || point.y > disp->ver_res) { - break; /* ignore pointer events that are out of bounds */ - } - evt->point = point; - evt->pressed = dsc->pointer_button_down; - break; - } - case LIBINPUT_EVENT_POINTER_BUTTON: { - enum libinput_button_state button_state = libinput_event_pointer_get_button_state(pointer_event); - dsc->pointer_button_down = button_state == LIBINPUT_BUTTON_STATE_RELEASED ? LV_INDEV_STATE_RELEASED : - LV_INDEV_STATE_PRESSED; - evt->point.x = dsc->pointer_position.x; - evt->point.y = dsc->pointer_position.y; - evt->pressed = dsc->pointer_button_down; - } - default: - break; - } -} - -static void _read_keypad(lv_libinput_t * dsc, struct libinput_event * event) -{ - struct libinput_event_keyboard * keyboard_event = NULL; - enum libinput_event_type type = libinput_event_get_type(event); - lv_libinput_event_t * evt = NULL; - switch(type) { - case LIBINPUT_EVENT_KEYBOARD_KEY: - evt = _create_event(dsc); - keyboard_event = libinput_event_get_keyboard_event(event); - enum libinput_key_state key_state = libinput_event_keyboard_get_key_state(keyboard_event); - uint32_t code = libinput_event_keyboard_get_key(keyboard_event); -#if LV_LIBINPUT_XKB - evt->key_val = lv_xkb_process_key(&(dsc->xkb), code, key_state == LIBINPUT_KEY_STATE_PRESSED); -#else - switch(code) { - case KEY_BACKSPACE: - evt->key_val = LV_KEY_BACKSPACE; - break; - case KEY_ENTER: - evt->key_val = LV_KEY_ENTER; - break; - case KEY_PREVIOUS: - evt->key_val = LV_KEY_PREV; - break; - case KEY_NEXT: - evt->key_val = LV_KEY_NEXT; - break; - case KEY_UP: - evt->key_val = LV_KEY_UP; - break; - case KEY_LEFT: - evt->key_val = LV_KEY_LEFT; - break; - case KEY_RIGHT: - evt->key_val = LV_KEY_RIGHT; - break; - case KEY_DOWN: - evt->key_val = LV_KEY_DOWN; - break; - case KEY_TAB: - evt->key_val = LV_KEY_NEXT; - break; - case KEY_HOME: - evt->key_val = LV_KEY_HOME; - break; - case KEY_END: - evt->key_val = LV_KEY_END; - break; - default: - evt->key_val = 0; - break; - } -#endif /* LV_LIBINPUT_XKB */ - if(evt->key_val != 0) { - /* Only record button state when actual output is produced to prevent widgets from refreshing */ - evt->pressed = (key_state == LIBINPUT_KEY_STATE_RELEASED) ? LV_INDEV_STATE_RELEASED : LV_INDEV_STATE_PRESSED; - - // just release the key immediately after it got pressed. - // but don't handle special keys where holding a key makes sense - if(evt->key_val != LV_KEY_BACKSPACE && - evt->key_val != LV_KEY_UP && - evt->key_val != LV_KEY_LEFT && - evt->key_val != LV_KEY_RIGHT && - evt->key_val != LV_KEY_DOWN && - key_state == LIBINPUT_KEY_STATE_PRESSED) { - lv_libinput_event_t * release_evt = _create_event(dsc); - release_evt->pressed = LV_INDEV_STATE_RELEASED; - release_evt->key_val = evt->key_val; - } - } - break; - default: - break; - } -} - -static int _open_restricted(const char * path, int flags, void * user_data) -{ - LV_UNUSED(user_data); - int fd = open(path, flags); - return fd < 0 ? -errno : fd; -} - -static void _close_restricted(int fd, void * user_data) -{ - LV_UNUSED(user_data); - close(fd); -} - -static void _delete(lv_libinput_t * dsc) -{ - if(dsc->fd) - dsc->deinit = true; - - /* Give worker thread a whole second to quit */ - for(int i = 0; i < 100; i++) { - if(!dsc->deinit) - break; - usleep(10000); - } - - if(dsc->deinit) { - LV_LOG_ERROR("libinput worker thread did not quit in time, cancelling it"); - pthread_cancel(dsc->worker_thread); - } - - if(dsc->libinput_device) { - libinput_path_remove_device(dsc->libinput_device); - libinput_device_unref(dsc->libinput_device); - } - - if(dsc->libinput_context) { - libinput_unref(dsc->libinput_context); - } - -#if LV_LIBINPUT_XKB - lv_xkb_deinit(&(dsc->xkb)); -#endif /* LV_LIBINPUT_XKB */ - - lv_free(dsc); -} - -#endif /* LV_USE_LIBINPUT */ diff --git a/L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput.h b/L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput.h deleted file mode 100644 index ce19a33..0000000 --- a/L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput.h +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @file lv_libinput.h - * - */ - -#ifndef LV_LIBINPUT_H -#define LV_LIBINPUT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../indev/lv_indev.h" - -#if LV_USE_LIBINPUT - -#include -#include - -#if LV_LIBINPUT_XKB -#include "lv_xkb.h" -#endif /* LV_LIBINPUT_XKB */ - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef enum { - LV_LIBINPUT_CAPABILITY_NONE = 0, - LV_LIBINPUT_CAPABILITY_KEYBOARD = 1U << 0, - LV_LIBINPUT_CAPABILITY_POINTER = 1U << 1, - LV_LIBINPUT_CAPABILITY_TOUCH = 1U << 2 -} lv_libinput_capability; - -struct libinput_device; - -#define LV_LIBINPUT_MAX_EVENTS 32 - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Determine the capabilities of a specific libinput device. - * @param device the libinput device to query - * @return the supported input capabilities - */ -lv_libinput_capability lv_libinput_query_capability(struct libinput_device * device); - -/** - * Find connected input device with specific capabilities - * @param capabilities required device capabilities - * @param force_rescan erase the device cache (if any) and rescan the file system for available devices - * @return device node path (e.g. /dev/input/event0) for the first matching device or NULL if no device was found. - * The pointer is safe to use until the next forceful device search. - */ -char * lv_libinput_find_dev(lv_libinput_capability capabilities, bool force_rescan); - -/** - * Find connected input devices with specific capabilities - * @param capabilities required device capabilities - * @param devices pre-allocated array to store the found device node paths (e.g. /dev/input/event0). The pointers are - * safe to use until the next forceful device search. - * @param count maximum number of devices to find (the devices array should be at least this long) - * @param force_rescan erase the device cache (if any) and rescan the file system for available devices - * @return number of devices that were found - */ -size_t lv_libinput_find_devs(lv_libinput_capability capabilities, char ** found, size_t count, bool force_rescan); - -/** - * Create a new libinput input device - * @param type LV_INDEV_TYPE_POINTER or LV_INDEV_TYPE_KEYPAD - * @param dev_path device path, e.g. /dev/input/event0 - * @return pointer to input device or NULL if opening failed - */ -lv_indev_t * lv_libinput_create(lv_indev_type_t indev_type, const char * dev_path); - -/** - * Delete a libinput input device - * @param indev pointer to input device - */ -void lv_libinput_delete(lv_indev_t * indev); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_LIBINPUT */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_LIBINPUT_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput_private.h b/L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput_private.h deleted file mode 100644 index bced3e2..0000000 --- a/L3_Middlewares/LVGL/src/drivers/libinput/lv_libinput_private.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file lv_libinput_private.h - * - */ - -#ifndef LV_LIBINPUT_PRIVATE_H -#define LV_LIBINPUT_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_libinput.h" - -#if LV_USE_LIBINPUT - -#if LV_LIBINPUT_XKB -#include "lv_xkb_private.h" -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_libinput_event_t { - lv_indev_state_t pressed; - int key_val; - lv_point_t point; -}; - -struct lv_libinput_t { - int fd; - struct pollfd fds[1]; - - /* The points array is implemented as a circular LIFO queue */ - lv_libinput_event_t points[LV_LIBINPUT_MAX_EVENTS]; /* Event buffer */ - lv_libinput_event_t slots[2]; /* Realtime state of up to 2 fingers to handle multitouch */ - - /* Pointer devices work a bit differently in libinput which requires us to store their last known state */ - lv_point_t pointer_position; - bool pointer_button_down; - - int start; /* Index of start of event queue */ - int end; /* Index of end of queue*/ - lv_libinput_event_t last_event; /* Report when no new events - * to keep indev state consistent - */ - bool deinit; /* Tell worker thread to quit */ - pthread_mutex_t event_lock; - pthread_t worker_thread; - - struct libinput * libinput_context; - struct libinput_device * libinput_device; - -#if LV_LIBINPUT_XKB - lv_xkb_t xkb; -#endif /* LV_LIBINPUT_XKB */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_LIBINPUT */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_LIBINPUT_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb.c b/L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb.c deleted file mode 100644 index 1e8ddb1..0000000 --- a/L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb.c +++ /dev/null @@ -1,180 +0,0 @@ -/** - * @file lv_xkb.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_xkb_private.h" - -#if defined(LV_LIBINPUT_XKB) && LV_LIBINPUT_XKB - -#include "../../core/lv_group.h" -#include "../../misc/lv_log.h" - -#include -#include -#include -#include -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static bool _set_keymap(lv_xkb_t * dsc, struct xkb_rule_names names); - -/********************** - * STATIC VARIABLES - **********************/ - -static struct xkb_context * context = NULL; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -bool lv_xkb_init(lv_xkb_t * dsc, struct xkb_rule_names names) -{ - if(!context) { - context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); - if(!context) { - LV_LOG_ERROR("xkb_context_new failed: %s", strerror(errno)); - return false; - } - } - - return _set_keymap(dsc, names); -} - -void lv_xkb_deinit(lv_xkb_t * dsc) -{ - if(dsc->state) { - xkb_state_unref(dsc->state); - dsc->state = NULL; - } - - if(dsc->keymap) { - xkb_keymap_unref(dsc->keymap); - dsc->keymap = NULL; - } -} - -uint32_t lv_xkb_process_key(lv_xkb_t * dsc, uint32_t scancode, bool down) -{ - /* Offset the evdev scancode by 8, see https://xkbcommon.org/doc/current/xkbcommon_8h.html#ac29aee92124c08d1953910ab28ee1997 */ - xkb_keycode_t keycode = scancode + 8; - - uint32_t result = 0; - - switch(xkb_state_key_get_one_sym(dsc->state, keycode)) { - case XKB_KEY_BackSpace: - result = LV_KEY_BACKSPACE; - break; - case XKB_KEY_Return: - case XKB_KEY_KP_Enter: - result = LV_KEY_ENTER; - break; - case XKB_KEY_Prior: - case XKB_KEY_KP_Prior: - result = LV_KEY_PREV; - break; - case XKB_KEY_Next: - case XKB_KEY_KP_Next: - result = LV_KEY_NEXT; - break; - case XKB_KEY_Up: - case XKB_KEY_KP_Up: - result = LV_KEY_UP; - break; - case XKB_KEY_Left: - case XKB_KEY_KP_Left: - result = LV_KEY_LEFT; - break; - case XKB_KEY_Right: - case XKB_KEY_KP_Right: - result = LV_KEY_RIGHT; - break; - case XKB_KEY_Down: - case XKB_KEY_KP_Down: - result = LV_KEY_DOWN; - break; - case XKB_KEY_Tab: - case XKB_KEY_KP_Tab: - result = LV_KEY_NEXT; - break; - case XKB_KEY_ISO_Left_Tab: /* Sent on SHIFT + TAB */ - result = LV_KEY_PREV; - break; - case XKB_KEY_Home: - case XKB_KEY_KP_Home: - result = LV_KEY_HOME; - break; - case XKB_KEY_End: - case XKB_KEY_KP_End: - result = LV_KEY_END; - break; - default: - break; - } - - if(result == 0) { - char buffer[4] = { 0, 0, 0, 0 }; - int size = xkb_state_key_get_utf8(dsc->state, keycode, NULL, 0) + 1; - if(size > 1) { - xkb_state_key_get_utf8(dsc->state, keycode, buffer, size); - memcpy(&result, buffer, 4); - } - } - - xkb_state_update_key(dsc->state, keycode, down ? XKB_KEY_DOWN : XKB_KEY_UP); - - return result; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static bool _set_keymap(lv_xkb_t * dsc, struct xkb_rule_names names) -{ - if(dsc->keymap) { - xkb_keymap_unref(dsc->keymap); - dsc->keymap = NULL; - } - - dsc->keymap = xkb_keymap_new_from_names(context, &names, XKB_KEYMAP_COMPILE_NO_FLAGS); - if(!dsc->keymap) { - LV_LOG_ERROR("xkb_keymap_new_from_names failed: %s", strerror(errno)); - return false; - } - - if(dsc->state) { - xkb_state_unref(dsc->state); - dsc->state = NULL; - } - - dsc->state = xkb_state_new(dsc->keymap); - if(!dsc->state) { - LV_LOG_ERROR("xkb_state_new failed: %s", strerror(errno)); - return false; - } - - return true; -} - -#endif /* defined(LV_LIBINPUT_XKB) && LV_LIBINPUT_XKB */ diff --git a/L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb.h b/L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb.h deleted file mode 100644 index 3f9fd86..0000000 --- a/L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file lv_xkb.h - * - */ - -#ifndef LV_XKB_H -#define LV_XKB_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" - -#if defined(LV_LIBINPUT_XKB) && LV_LIBINPUT_XKB - -#include "../../misc/lv_types.h" -#include -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialise an XKB descriptor. - * @return true if the initialisation was successful - */ -bool lv_xkb_init(lv_xkb_t * dsc, struct xkb_rule_names names); - -/** - * De-initialise an XKB descriptor. - * @param dsc Pointer to descriptor - */ -void lv_xkb_deinit(lv_xkb_t * dsc); - -/** - * Process an evdev scancode using a specific XKB descriptor. - * @param state XKB descriptor to use - * @param scancode evdev scancode to process - * @param down true if the key was pressed, false if it was releases - * @return the (first) UTF-8 character produced by the event or 0 if no output was produced - */ -uint32_t lv_xkb_process_key(lv_xkb_t * dsc, uint32_t scancode, bool down); - -/********************** - * MACROS - **********************/ - -#endif /* LV_LIBINPUT_XKB */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* defined(LV_LIBINPUT_XKB) && LV_LIBINPUT_XKB */ diff --git a/L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb_private.h b/L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb_private.h deleted file mode 100644 index 3157625..0000000 --- a/L3_Middlewares/LVGL/src/drivers/libinput/lv_xkb_private.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file lv_xkb_private.h - * - */ - -#ifndef LV_XKB_PRIVATE_H -#define LV_XKB_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_xkb.h" - -#if defined(LV_LIBINPUT_XKB) && LV_LIBINPUT_XKB - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_xkb_t { - struct xkb_keymap * keymap; - struct xkb_state * state; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* defined(LV_LIBINPUT_XKB) && LV_LIBINPUT_XKB */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_XKB_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/lv_drivers.h b/L3_Middlewares/LVGL/src/drivers/lv_drivers.h deleted file mode 100644 index 08c76e7..0000000 --- a/L3_Middlewares/LVGL/src/drivers/lv_drivers.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file lv_drivers.h - * - */ - -#ifndef LV_DRIVERS_H -#define LV_DRIVERS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "sdl/lv_sdl_window.h" -#include "sdl/lv_sdl_mouse.h" -#include "sdl/lv_sdl_mousewheel.h" -#include "sdl/lv_sdl_keyboard.h" - -#include "x11/lv_x11.h" - -#include "display/drm/lv_linux_drm.h" -#include "display/fb/lv_linux_fbdev.h" - -#include "display/tft_espi/lv_tft_espi.h" - -#include "nuttx/lv_nuttx_entry.h" -#include "nuttx/lv_nuttx_fbdev.h" -#include "nuttx/lv_nuttx_touchscreen.h" -#include "nuttx/lv_nuttx_lcd.h" -#include "nuttx/lv_nuttx_libuv.h" - -#include "evdev/lv_evdev.h" -#include "libinput/lv_libinput.h" - -#include "windows/lv_windows_input.h" -#include "windows/lv_windows_display.h" - -#include "glfw/lv_glfw_window.h" -#include "glfw/lv_opengles_texture.h" -#include "glfw/lv_opengles_driver.h" - -#include "qnx/lv_qnx.h" - -#include "wayland/lv_wayland.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DRIVERS_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_cache.c b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_cache.c deleted file mode 100644 index 273f49e..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_cache.c +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @file lv_nuttx_cache.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_nuttx_cache.h" -#include "../../../lvgl.h" - -#if LV_USE_NUTTX - -#include "../../draw/lv_draw_buf_private.h" -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area); -static void flush_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_nuttx_cache_init(void) -{ - lv_draw_buf_handlers_t * handlers = lv_draw_buf_get_handlers(); - handlers->invalidate_cache_cb = invalidate_cache; - handlers->flush_cache_cb = flush_cache; -} - -void lv_nuttx_cache_deinit(void) -{ - lv_draw_buf_handlers_t * handlers = lv_draw_buf_get_handlers(); - handlers->invalidate_cache_cb = NULL; - handlers->flush_cache_cb = NULL; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void draw_buf_to_region( - const lv_draw_buf_t * draw_buf, const lv_area_t * area, - lv_uintptr_t * start, lv_uintptr_t * end) -{ - LV_ASSERT_NULL(draw_buf); - LV_ASSERT_NULL(area); - LV_ASSERT_NULL(start); - LV_ASSERT_NULL(end); - - void * buf = draw_buf->data; - uint32_t stride = draw_buf->header.stride; - - int32_t h = lv_area_get_height(area); - *start = (lv_uintptr_t)buf + area->y1 * stride; - *end = *start + h * stride; -} - -static void invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area) -{ - lv_uintptr_t start; - lv_uintptr_t end; - draw_buf_to_region(draw_buf, area, &start, &end); - up_invalidate_dcache(start, end); -} - -static void flush_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area) -{ - lv_uintptr_t start; - lv_uintptr_t end; - draw_buf_to_region(draw_buf, area, &start, &end); - up_flush_dcache(start, end); -} - -#endif /* LV_USE_NUTTX */ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_entry.c b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_entry.c deleted file mode 100644 index 57a4d28..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_entry.c +++ /dev/null @@ -1,306 +0,0 @@ -/** - * @file lv_nuttx_entry.h - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_nuttx_entry.h" - -#if LV_USE_NUTTX - -#include -#include -#include -#include -#include -#include "lv_nuttx_cache.h" -#include "lv_nuttx_image_cache.h" -#include "../../core/lv_global.h" -#include "lv_nuttx_profiler.h" - -#include "../../../lvgl.h" - -/********************* - * DEFINES - *********************/ - -#define nuttx_ctx_p (LV_GLOBAL_DEFAULT()->nuttx_ctx) - -#if (LV_USE_FREETYPE || LV_USE_THORVG) - #define LV_NUTTX_MIN_STACK_SIZE (32 * 1024) -#else - #define LV_NUTTX_MIN_STACK_SIZE (8 * 1024) -#endif - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static uint32_t millis(void); -#if LV_USE_LOG - static void syslog_print(lv_log_level_t level, const char * buf); -#endif -static void check_stack_size(void); - -#ifdef CONFIG_LV_USE_NUTTX_LIBUV - static void lv_nuttx_uv_loop(lv_nuttx_result_t * result); -#endif - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -#if LV_ENABLE_GLOBAL_CUSTOM - -static void lv_global_free(void * data) -{ - if(data) { - free(data); - } -} - -lv_global_t * lv_global_default(void) -{ - static int index = -1; - lv_global_t * data = NULL; - - if(index < 0) { - index = task_tls_alloc(lv_global_free); - } - - if(index >= 0) { - data = (lv_global_t *)task_tls_get_value(index); - if(data == NULL) { - data = (lv_global_t *)calloc(1, sizeof(lv_global_t)); - task_tls_set_value(index, (uintptr_t)data); - } - } - return data; -} -#endif - -void lv_nuttx_dsc_init(lv_nuttx_dsc_t * dsc) -{ - if(dsc == NULL) - return; - - lv_memzero(dsc, sizeof(lv_nuttx_dsc_t)); - dsc->fb_path = "/dev/fb0"; - dsc->input_path = "/dev/input0"; - -#ifdef CONFIG_UINPUT_TOUCH - dsc->utouch_path = "/dev/utouch"; -#endif -} - -void lv_nuttx_init(const lv_nuttx_dsc_t * dsc, lv_nuttx_result_t * result) -{ - nuttx_ctx_p = lv_malloc_zeroed(sizeof(lv_nuttx_ctx_t)); - LV_ASSERT_MALLOC(nuttx_ctx_p); - -#if LV_USE_LOG - lv_log_register_print_cb(syslog_print); -#endif - lv_tick_set_cb(millis); - - check_stack_size(); - - lv_nuttx_cache_init(); - - lv_nuttx_image_cache_init(); - -#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN - lv_nuttx_profiler_init(); -#endif - - if(result) { - lv_memzero(result, sizeof(lv_nuttx_result_t)); - } - -#if !LV_USE_NUTTX_CUSTOM_INIT - - if(dsc && dsc->fb_path) { - lv_display_t * disp = NULL; - -#if LV_USE_NUTTX_LCD - disp = lv_nuttx_lcd_create(dsc->fb_path); -#else - disp = lv_nuttx_fbdev_create(); - if(lv_nuttx_fbdev_set_file(disp, dsc->fb_path) != 0) { - lv_display_delete(disp); - disp = NULL; - } -#endif - if(result) { - result->disp = disp; - } - } - - if(dsc) { -#if LV_USE_NUTTX_TOUCHSCREEN - if(dsc->input_path) { - lv_indev_t * indev = lv_nuttx_touchscreen_create(dsc->input_path); - if(result) { - result->indev = indev; - } - } - - if(dsc->utouch_path) { - lv_indev_t * indev = lv_nuttx_touchscreen_create(dsc->utouch_path); - if(result) { - result->utouch_indev = indev; - } - } -#endif - } - -#else - - lv_nuttx_init_custom(dsc, result); -#endif -} - -void lv_nuttx_run(lv_nuttx_result_t * result) -{ -#ifdef CONFIG_LV_USE_NUTTX_LIBUV - lv_nuttx_uv_loop(&ui_loop, result); -#else - while(1) { - uint32_t idle; - idle = lv_timer_handler(); - - /* Minimum sleep of 1ms */ - idle = idle ? idle : 1; - usleep(idle * 1000); - } -#endif -} - -#ifdef CONFIG_SCHED_CPULOAD - -uint32_t lv_nuttx_get_idle(void) -{ - struct cpuload_s cpuload; - int ret = clock_cpuload(0, &cpuload); - if(ret < 0) { - LV_LOG_WARN("clock_cpuload failed: %d", ret); - return 0; - } - - uint32_t idle = cpuload.active * 100 / cpuload.total; - LV_LOG_TRACE("active = %" LV_PRIu32 ", total = %" LV_PRIu32, - cpuload.active, cpuload.total); - - return idle; -} - -#endif - -void lv_nuttx_deinit(lv_nuttx_result_t * result) -{ -#if !LV_USE_NUTTX_CUSTOM_INIT - if(result) { - if(result->disp) { - lv_display_delete(result->disp); - result->disp = NULL; - } - - if(result->indev) { - lv_indev_delete(result->indev); - result->indev = NULL; - } - - if(result->utouch_indev) { - lv_indev_delete(result->utouch_indev); - result->utouch_indev = NULL; - } - } -#else - lv_nuttx_deinit_custom(result); -#endif - - if(nuttx_ctx_p) { - lv_nuttx_cache_deinit(); - lv_nuttx_image_cache_deinit(); - - lv_free(nuttx_ctx_p); - nuttx_ctx_p = NULL; - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static uint32_t millis(void) -{ - struct timespec ts; - - clock_gettime(CLOCK_MONOTONIC, &ts); - uint32_t tick = ts.tv_sec * 1000 + ts.tv_nsec / 1000000; - - return tick; -} - -#if LV_USE_LOG -static void syslog_print(lv_log_level_t level, const char * buf) -{ - static const int priority[LV_LOG_LEVEL_NUM] = { - LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERR, LOG_CRIT - }; - - syslog(priority[level], "[LVGL] %s", buf); -} -#endif - -#ifdef CONFIG_LV_USE_NUTTX_LIBUV -static void lv_nuttx_uv_loop(lv_nuttx_result_t * result) -{ - uv_loop_t loop; - lv_nuttx_uv_t uv_info; - void * data; - - uv_loop_init(&loop); - - lv_memzero(&uv_info, sizeof(uv_info)); - uv_info.loop = &loop; - uv_info.disp = result->disp; - uv_info.indev = result->indev; -#ifdef CONFIG_UINPUT_TOUCH - uv_info.uindev = result->utouch_indev; -#endif - - data = lv_nuttx_uv_init(&uv_info); - uv_run(loop, UV_RUN_DEFAULT); - lv_nuttx_uv_deinit(&data); -} -#endif - -static void check_stack_size(void) -{ - pthread_t tid = pthread_self(); - ssize_t stack_size = pthread_get_stacksize_np(tid); - LV_LOG_USER("tid: %d, Stack size : %zd", (int)tid, stack_size); - - if(stack_size < LV_NUTTX_MIN_STACK_SIZE) { - LV_LOG_ERROR("Stack size is too small. Please increase it to %d bytes or more.", - LV_NUTTX_MIN_STACK_SIZE); - } -} - -#endif /*LV_USE_NUTTX*/ - diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_entry.h b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_entry.h deleted file mode 100644 index 64ece99..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_entry.h +++ /dev/null @@ -1,112 +0,0 @@ -/** - * @file lv_nuttx_entry.h - * - */ - -/********************* - * INCLUDES - *********************/ - -#ifndef LV_NUTTX_ENTRY_H -#define LV_NUTTX_ENTRY_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" -#include "../../display/lv_display.h" -#include "../../indev/lv_indev.h" - -#if LV_USE_NUTTX - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - const char * fb_path; - const char * input_path; - const char * utouch_path; -} lv_nuttx_dsc_t; - -typedef struct { - lv_display_t * disp; - lv_indev_t * indev; - lv_indev_t * utouch_indev; -} lv_nuttx_result_t; - -typedef struct lv_nuttx_ctx_t { - void * image_cache; -} lv_nuttx_ctx_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize the lv_nuttx_dsc_t structure with default values for the NuttX port of LVGL. - * @param dsc Pointer to the lv_nuttx_dsc_t structure to be initialized. - */ -void lv_nuttx_dsc_init(lv_nuttx_dsc_t * dsc); - -/** - * Initialize the LVGL display driver for NuttX using the provided configuration information. - * @param dsc Pointer to the lv_nuttx_dsc_t structure containing the configuration information for the display driver. - * @param result Pointer to the lv_nuttx_result_t structure containing display and input device handler. - */ -void lv_nuttx_init(const lv_nuttx_dsc_t * dsc, lv_nuttx_result_t * result); - -/** - * Deinitialize the LVGL display driver for NuttX. - * @param result Pointer to the lv_nuttx_result_t structure containing display and input device handler. - */ -void lv_nuttx_deinit(lv_nuttx_result_t * result); - -#if LV_USE_NUTTX_CUSTOM_INIT -/** - * Initialize the LVGL display driver for NuttX using the provided custom configuration information. - * @param dsc Pointer to the lv_nuttx_dsc_t structure containing the custom configuration for the display driver. - * @param result Pointer to the lv_nuttx_result_t structure containing display and input device handler. - */ -void lv_nuttx_init_custom(const lv_nuttx_dsc_t * dsc, lv_nuttx_result_t * result); - -/** - * Deinitialize the LVGL display driver for NuttX using the provided custom configuration information. - * @param result Pointer to the lv_nuttx_result_t structure containing display and input device handler. - */ -void lv_nuttx_deinit_custom(lv_nuttx_result_t * result); -#endif /* LV_USE_NUTTX_CUSTOM_INIT */ - -/** - * Call `lv_timer_handler()` (LVGL's super loop) in an endless loop. - * If LV_USE_NUTTX_LIBUV is enabled an UV timer will be created, - * else `lv_timer_handler()` will be called in a loop with some sleep. - * @param result pointer to a variable initialized by `lv_nuttx_init()` or `lv_nuttx_init_custom()` - */ -void lv_nuttx_run(lv_nuttx_result_t * result); - -/** - * Get the idle percentage of the system. - * @return The idle percentage of the system. - */ -uint32_t lv_nuttx_get_idle(void); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_NUTTX*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_NUTTX_ENTRY_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_fbdev.c b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_fbdev.c deleted file mode 100644 index 5ff500e..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_fbdev.c +++ /dev/null @@ -1,407 +0,0 @@ -/** - * @file lv_nuttx_fbdev.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_nuttx_fbdev.h" -#if LV_USE_NUTTX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../../../lvgl.h" -#include "../../lvgl_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - /* fd should be defined at the beginning */ - int fd; - struct fb_videoinfo_s vinfo; - struct fb_planeinfo_s pinfo; - - void * mem; - void * mem2; - void * mem_off_screen; - uint32_t mem2_yoffset; - - lv_draw_buf_t buf1; - lv_draw_buf_t buf2; -} lv_nuttx_fb_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p); -static lv_color_format_t fb_fmt_to_color_format(int fmt); -static int fbdev_get_pinfo(int fd, struct fb_planeinfo_s * pinfo); -static int fbdev_init_mem2(lv_nuttx_fb_t * dsc); -static void display_refr_timer_cb(lv_timer_t * tmr); -static void display_release_cb(lv_event_t * e); -#if defined(CONFIG_FB_UPDATE) - static void fbdev_join_inv_areas(lv_display_t * disp, lv_area_t * final_inv_area); -#endif - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_nuttx_fbdev_create(void) -{ - lv_nuttx_fb_t * dsc = lv_malloc_zeroed(sizeof(lv_nuttx_fb_t)); - LV_ASSERT_MALLOC(dsc); - if(dsc == NULL) return NULL; - - lv_display_t * disp = lv_display_create(800, 480); - if(disp == NULL) { - lv_free(dsc); - return NULL; - } - dsc->fd = -1; - lv_display_set_driver_data(disp, dsc); - lv_display_add_event_cb(disp, display_release_cb, LV_EVENT_DELETE, disp); - lv_display_set_flush_cb(disp, flush_cb); - return disp; -} - -int lv_nuttx_fbdev_set_file(lv_display_t * disp, const char * file) -{ - int ret; - LV_ASSERT(disp && file); - lv_nuttx_fb_t * dsc = lv_display_get_driver_data(disp); - - if(dsc->fd >= 0) close(dsc->fd); - - /* Open the file for reading and writing*/ - - dsc->fd = open(file, O_RDWR); - if(dsc->fd < 0) { - LV_LOG_ERROR("Error: cannot open framebuffer device"); - return -errno; - } - LV_LOG_USER("The framebuffer device was opened successfully"); - - if(ioctl(dsc->fd, FBIOGET_VIDEOINFO, (unsigned long)((uintptr_t)&dsc->vinfo)) < 0) { - LV_LOG_ERROR("ioctl(FBIOGET_VIDEOINFO) failed: %d", errno); - ret = -errno; - goto errout; - } - - LV_LOG_USER("VideoInfo:"); - LV_LOG_USER(" fmt: %u", dsc->vinfo.fmt); - LV_LOG_USER(" xres: %u", dsc->vinfo.xres); - LV_LOG_USER(" yres: %u", dsc->vinfo.yres); - LV_LOG_USER(" nplanes: %u", dsc->vinfo.nplanes); - - if((ret = fbdev_get_pinfo(dsc->fd, &dsc->pinfo)) < 0) { - goto errout; - } - - lv_color_format_t color_format = fb_fmt_to_color_format(dsc->vinfo.fmt); - if(color_format == LV_COLOR_FORMAT_UNKNOWN) { - goto errout; - } - - dsc->mem = mmap(NULL, dsc->pinfo.fblen, PROT_READ | PROT_WRITE, - MAP_SHARED | MAP_FILE, dsc->fd, 0); - if(dsc->mem == MAP_FAILED) { - LV_LOG_ERROR("ioctl(FBIOGET_PLANEINFO) failed: %d", errno); - ret = -errno; - goto errout; - } - - uint32_t w = dsc->vinfo.xres; - uint32_t h = dsc->vinfo.yres; - uint32_t stride = dsc->pinfo.stride; - uint32_t data_size = h * stride; - lv_draw_buf_init(&dsc->buf1, w, h, color_format, stride, dsc->mem, data_size); - - /* Check buffer mode */ - bool double_buffer = dsc->pinfo.yres_virtual == (dsc->vinfo.yres * 2); - if(double_buffer) { - if((ret = fbdev_init_mem2(dsc)) < 0) { - goto errout; - } - - lv_draw_buf_init(&dsc->buf2, w, h, color_format, stride, dsc->mem2, data_size); - lv_display_set_draw_buffers(disp, &dsc->buf1, &dsc->buf2); - } - else { - dsc->mem_off_screen = malloc(data_size); - LV_ASSERT_MALLOC(dsc->mem_off_screen); - if(!dsc->mem_off_screen) { - ret = -ENOMEM; - LV_LOG_ERROR("Failed to allocate memory for off-screen buffer"); - goto errout; - } - - LV_LOG_USER("Use off-screen mode, memory: %p, size: %" LV_PRIu32, dsc->mem_off_screen, data_size); - lv_draw_buf_init(&dsc->buf2, w, h, color_format, stride, dsc->mem_off_screen, data_size); - lv_display_set_draw_buffers(disp, &dsc->buf2, NULL); - } - - lv_display_set_color_format(disp, color_format); - lv_display_set_render_mode(disp, LV_DISPLAY_RENDER_MODE_DIRECT); - lv_display_set_resolution(disp, dsc->vinfo.xres, dsc->vinfo.yres); - lv_timer_set_cb(disp->refr_timer, display_refr_timer_cb); - - LV_LOG_USER("Resolution is set to %dx%d at %" LV_PRId32 "dpi", - dsc->vinfo.xres, dsc->vinfo.yres, lv_display_get_dpi(disp)); - return 0; - -errout: - close(dsc->fd); - dsc->fd = -1; - return ret; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#if defined(CONFIG_FB_UPDATE) -static void fbdev_join_inv_areas(lv_display_t * disp, lv_area_t * final_inv_area) -{ - uint16_t inv_index; - - bool area_joined = false; - - for(inv_index = 0; inv_index < disp->inv_p; inv_index++) { - if(disp->inv_area_joined[inv_index] == 0) { - const lv_area_t * area_p = &disp->inv_areas[inv_index]; - - /* Join to final_area */ - - if(!area_joined) { - /* copy first area */ - lv_area_copy(final_inv_area, area_p); - area_joined = true; - } - else { - lv_area_join(final_inv_area, - final_inv_area, - area_p); - } - } - } -} -#endif - -static void display_refr_timer_cb(lv_timer_t * tmr) -{ - lv_display_t * disp = lv_timer_get_user_data(tmr); - lv_nuttx_fb_t * dsc = lv_display_get_driver_data(disp); - struct pollfd pfds[1]; - - lv_memzero(pfds, sizeof(pfds)); - pfds[0].fd = dsc->fd; - pfds[0].events = POLLOUT; - - /* Query free fb to draw */ - - if(poll(pfds, 1, 0) < 0) { - return; - } - - if(pfds[0].revents & POLLOUT) { - lv_display_refr_timer(tmr); - } -} - -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p) -{ - LV_UNUSED(color_p); - lv_nuttx_fb_t * dsc = lv_display_get_driver_data(disp); - - if(dsc->mem_off_screen) { - /* When rendering in off-screen mode, copy the drawing buffer to fb */ - /* buf2(off-screen buffer) -> buf1(fbmem)*/ - lv_draw_buf_copy(&dsc->buf1, area, &dsc->buf2, area); - } - - /* Skip the non-last flush */ - - if(!lv_display_flush_is_last(disp)) { - lv_display_flush_ready(disp); - return; - } - -#if defined(CONFIG_FB_UPDATE) - /*May be some direct update command is required*/ - int yoffset = disp->buf_act == disp->buf_1 ? - 0 : dsc->mem2_yoffset; - - /* Join the areas to update */ - lv_area_t final_inv_area; - lv_memzero(&final_inv_area, sizeof(final_inv_area)); - fbdev_join_inv_areas(disp, &final_inv_area); - - struct fb_area_s fb_area; - fb_area.x = final_inv_area.x1; - fb_area.y = final_inv_area.y1 + yoffset; - fb_area.w = lv_area_get_width(&final_inv_area); - fb_area.h = lv_area_get_height(&final_inv_area); - if(ioctl(dsc->fd, FBIO_UPDATE, (unsigned long)((uintptr_t)&fb_area)) < 0) { - LV_LOG_ERROR("ioctl(FBIO_UPDATE) failed: %d", errno); - } -#endif - - /* double framebuffer */ - - if(dsc->mem2 != NULL) { - if(disp->buf_act == disp->buf_1) { - dsc->pinfo.yoffset = 0; - } - else { - dsc->pinfo.yoffset = dsc->mem2_yoffset; - } - - if(ioctl(dsc->fd, FBIOPAN_DISPLAY, (unsigned long)((uintptr_t) & (dsc->pinfo))) < 0) { - LV_LOG_ERROR("ioctl(FBIOPAN_DISPLAY) failed: %d", errno); - } - } - lv_display_flush_ready(disp); -} - -static lv_color_format_t fb_fmt_to_color_format(int fmt) -{ - switch(fmt) { - case FB_FMT_RGB16_565: - return LV_COLOR_FORMAT_RGB565; - case FB_FMT_RGB24: - return LV_COLOR_FORMAT_RGB888; - case FB_FMT_RGB32: - return LV_COLOR_FORMAT_XRGB8888; - case FB_FMT_RGBA32: - return LV_COLOR_FORMAT_ARGB8888; - default: - break; - } - - LV_LOG_ERROR("Unsupported color format: %d", fmt); - - return LV_COLOR_FORMAT_UNKNOWN; -} - -static int fbdev_get_pinfo(int fd, FAR struct fb_planeinfo_s * pinfo) -{ - if(ioctl(fd, FBIOGET_PLANEINFO, (unsigned long)((uintptr_t)pinfo)) < 0) { - LV_LOG_ERROR("ERROR: ioctl(FBIOGET_PLANEINFO) failed: %d", errno); - return -errno; - } - - LV_LOG_USER("PlaneInfo (plane %d):", pinfo->display); - LV_LOG_USER(" mem: %p", pinfo->fbmem); - LV_LOG_USER(" fblen: %zu", pinfo->fblen); - LV_LOG_USER(" stride: %u", pinfo->stride); - LV_LOG_USER(" display: %u", pinfo->display); - LV_LOG_USER(" bpp: %u", pinfo->bpp); - - return 0; -} - -static int fbdev_init_mem2(lv_nuttx_fb_t * dsc) -{ - uintptr_t buf_offset; - struct fb_planeinfo_s pinfo; - int ret; - - lv_memzero(&pinfo, sizeof(pinfo)); - - /* Get display[1] planeinfo */ - - pinfo.display = dsc->pinfo.display + 1; - - if((ret = fbdev_get_pinfo(dsc->fd, &pinfo)) < 0) { - return ret; - } - - /* Check bpp */ - - if(pinfo.bpp != dsc->pinfo.bpp) { - LV_LOG_WARN("mem2 is incorrect"); - return -EINVAL; - } - - /* Check the buffer address offset, - * It needs to be divisible by pinfo.stride - */ - - buf_offset = pinfo.fbmem - dsc->mem; - - if((buf_offset % dsc->pinfo.stride) != 0) { - LV_LOG_WARN("It is detected that buf_offset(%" PRIuPTR ") " - "and stride(%d) are not divisible, please ensure " - "that the driver handles the address offset by itself.", - buf_offset, dsc->pinfo.stride); - } - - /* Calculate the address and yoffset of mem2 */ - - if(buf_offset == 0) { - dsc->mem2_yoffset = dsc->vinfo.yres; - dsc->mem2 = pinfo.fbmem + dsc->mem2_yoffset * pinfo.stride; - LV_LOG_USER("Use consecutive mem2 = %p, yoffset = %" LV_PRIu32, - dsc->mem2, dsc->mem2_yoffset); - } - else { - dsc->mem2_yoffset = buf_offset / dsc->pinfo.stride; - dsc->mem2 = pinfo.fbmem; - LV_LOG_USER("Use non-consecutive mem2 = %p, yoffset = %" LV_PRIu32, - dsc->mem2, dsc->mem2_yoffset); - } - - return 0; -} - -static void display_release_cb(lv_event_t * e) -{ - lv_display_t * disp = (lv_display_t *) lv_event_get_user_data(e); - lv_nuttx_fb_t * dsc = lv_display_get_driver_data(disp); - if(dsc) { - lv_display_set_driver_data(disp, NULL); - lv_display_set_flush_cb(disp, NULL); - - if(dsc->fd >= 0) { - close(dsc->fd); - dsc->fd = -1; - } - - if(dsc->mem_off_screen) { - /* Free the off-screen buffer */ - free(dsc->mem_off_screen); - dsc->mem_off_screen = NULL; - } - - lv_free(dsc); - } - LV_LOG_USER("Done"); -} - -#endif /*LV_USE_NUTTX*/ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_fbdev.h b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_fbdev.h deleted file mode 100644 index 4310aa9..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_fbdev.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file lv_nuttx_fbdev.h - * - */ - -#ifndef LV_NUTTX_FBDEV_H -#define LV_NUTTX_FBDEV_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../display/lv_display.h" - -#if LV_USE_NUTTX - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a new display with NuttX backend. - */ -lv_display_t * lv_nuttx_fbdev_create(void); - -/** - * Initialize display with specified framebuffer device - * @param disp pointer to display with NuttX backend - * @param file the name of framebuffer device - */ -int lv_nuttx_fbdev_set_file(lv_display_t * disp, const char * file); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_NUTTX */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_NUTTX_FBDEV_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_image_cache.c b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_image_cache.c deleted file mode 100644 index 93f59ed..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_image_cache.c +++ /dev/null @@ -1,176 +0,0 @@ -/** - * @file lv_nuttx_image_cache.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_nuttx_image_cache.h" -#include "../../core/lv_global.h" -#include "../../../lvgl.h" - -#if LV_USE_NUTTX - -#include "../../draw/lv_draw_buf_private.h" -#include - -/********************* - * DEFINES - *********************/ - -#define HEAP_NAME "GImageCache" - -#define img_cache_p (LV_GLOBAL_DEFAULT()->img_cache) -#define img_header_cache_p (LV_GLOBAL_DEFAULT()->img_header_cache) -#define ctx (*(lv_nuttx_ctx_image_cache_t **)&LV_GLOBAL_DEFAULT()->nuttx_ctx->image_cache) -#define image_cache_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->image_cache_draw_buf_handlers) - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - uint8_t * mem; - uint32_t mem_size; - - char name[sizeof(HEAP_NAME) + 10]; /**< +10 characters to store task pid. */ - - struct mm_heap_s * heap; - uint32_t heap_size; - - bool initialized; -} lv_nuttx_ctx_image_cache_t; -/********************** - * STATIC PROTOTYPES - **********************/ - -static void * malloc_cb(size_t size_bytes, lv_color_format_t color_format); -static void free_cb(void * draw_buf); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_nuttx_image_cache_init(void) -{ - lv_draw_buf_handlers_t * handlers = image_cache_draw_buf_handlers; - handlers->buf_malloc_cb = malloc_cb; - handlers->buf_free_cb = free_cb; - - ctx = lv_malloc_zeroed(sizeof(lv_nuttx_ctx_image_cache_t)); - LV_ASSERT_MALLOC(ctx); - - ctx->initialized = false; -} - -void lv_nuttx_image_cache_deinit(void) -{ - if(ctx->initialized == false) goto FREE_CONTEXT; - - mm_uninitialize(ctx->heap); - free(ctx->mem); - -FREE_CONTEXT: - lv_free(ctx); - - ctx = NULL; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static bool defer_init(void) -{ - if(ctx->mem != NULL && ctx->heap != NULL) { - return true; - } - - if(lv_image_cache_is_enabled() == false) { - LV_LOG_INFO("Image cache is not initialized yet. Skipping deferred initialization. Because max_size is 0."); - return false; - } - - ctx->mem_size = img_cache_p->max_size; - ctx->mem = malloc(ctx->mem_size); - LV_ASSERT_MALLOC(ctx->mem); - - if(ctx->mem == NULL) { - LV_LOG_ERROR("Failed to allocate memory for image cache"); - ctx->initialized = false; - return false; - } - - lv_snprintf(ctx->name, sizeof(ctx->name), HEAP_NAME "[%-4" LV_PRIu32 "]", (uint32_t)gettid()); - - ctx->heap = mm_initialize( - ctx->name, - ctx->mem, - ctx->mem_size - ); - - struct mallinfo info = mm_mallinfo(ctx->heap); - ctx->heap_size = info.arena; - - LV_LOG_USER("heap info:"); - LV_LOG_USER(" heap: %p", ctx->heap); - LV_LOG_USER(" mem: %p", ctx->mem); - LV_LOG_USER(" mem_size: %" LV_PRIu32, ctx->mem_size); - LV_LOG_USER(" arena: %d", info.arena); - LV_LOG_USER(" ordblks: %d", info.ordblks); - LV_LOG_USER(" aordblks: %d", info.aordblks); - LV_LOG_USER(" mxordblk: %d", info.mxordblk); - LV_LOG_USER(" uordblks: %d", info.uordblks); - LV_LOG_USER(" fordblks: %d", info.fordblks); - - ctx->initialized = true; - return true; -} - -static void * malloc_cb(size_t size_bytes, lv_color_format_t color_format) -{ - LV_UNUSED(color_format); - - if(ctx->initialized == false) { - if(defer_init() == false) return NULL; - } - - /*Allocate larger memory to be sure it can be aligned as needed*/ - size_bytes += LV_DRAW_BUF_ALIGN - 1; - uint32_t cache_max_size = lv_cache_get_max_size(img_cache_p, NULL); - - if(size_bytes > cache_max_size) { - LV_LOG_ERROR("data size (%" LV_PRIu32 ") is larger than max size (%" LV_PRIu32 ")", - (uint32_t)size_bytes, - cache_max_size); - return NULL; - } - - while(1) { - void * mem = mm_malloc(ctx->heap, size_bytes); - if(mem) return mem; - LV_LOG_INFO("appears to be out of memory. attempting to evict one cache entry. with allocated size %" LV_PRIu32, - (uint32_t)size_bytes); - bool evict_res = lv_cache_evict_one(img_cache_p, NULL); - if(evict_res == false) { - LV_LOG_ERROR("failed to evict one cache entry"); - return NULL; - } - } -} - -static void free_cb(void * draw_buf) -{ - mm_free(ctx->heap, draw_buf); -} - -#endif /* LV_USE_NUTTX */ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_lcd.c b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_lcd.c deleted file mode 100644 index af49cd4..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_lcd.c +++ /dev/null @@ -1,238 +0,0 @@ -/** - * @file lv_nuttx_lcd.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_nuttx_lcd.h" - -#if LV_USE_NUTTX - -#if LV_USE_NUTTX_LCD - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../../../lvgl.h" -#include "../../lvgl_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - /* fd should be defined at the beginning */ - int fd; - lv_display_t * disp; - struct lcddev_area_s area; - struct lcddev_area_align_s align_info; -} lv_nuttx_lcd_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static int32_t align_round_up(int32_t v, uint16_t align); -static void rounder_cb(lv_event_t * e); -static void flush_cb(lv_display_t * disp, const lv_area_t * area_p, - uint8_t * color_p); -static lv_display_t * lcd_init(int fd, int hor_res, int ver_res); -static void display_release_cb(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_nuttx_lcd_create(const char * dev_path) -{ - struct fb_videoinfo_s vinfo; - struct lcd_planeinfo_s pinfo; - lv_display_t * disp; - int fd; - int ret; - - LV_ASSERT_NULL(dev_path); - - LV_LOG_USER("lcd %s opening", dev_path); - fd = open(dev_path, 0); - if(fd < 0) { - perror("Error: cannot open lcd device"); - return NULL; - } - - LV_LOG_USER("lcd %s open success", dev_path); - - ret = ioctl(fd, LCDDEVIO_GETVIDEOINFO, - (unsigned long)((uintptr_t)&vinfo)); - if(ret < 0) { - perror("Error: ioctl(LCDDEVIO_GETVIDEOINFO) failed"); - close(fd); - return NULL; - } - - ret = ioctl(fd, LCDDEVIO_GETPLANEINFO, - (unsigned long)((uintptr_t)&pinfo)); - if(ret < 0) { - perror("ERROR: ioctl(LCDDEVIO_GETPLANEINFO) failed"); - close(fd); - return NULL; - } - - disp = lcd_init(fd, vinfo.xres, vinfo.yres); - if(disp == NULL) { - close(fd); - } - - return disp; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static int32_t align_round_up(int32_t v, uint16_t align) -{ - return (v + align - 1) & ~(align - 1); -} - -static void rounder_cb(lv_event_t * e) -{ - lv_nuttx_lcd_t * lcd = lv_event_get_user_data(e); - lv_area_t * area = lv_event_get_param(e); - struct lcddev_area_align_s * align_info = &lcd->align_info; - int32_t w; - int32_t h; - - area->x1 &= ~(align_info->col_start_align - 1); - area->y1 &= ~(align_info->row_start_align - 1); - - w = align_round_up(lv_area_get_width(area), align_info->width_align); - h = align_round_up(lv_area_get_height(area), align_info->height_align); - - area->x2 = area->x1 + w - 1; - area->y2 = area->y1 + h - 1; -} - -static void flush_cb(lv_display_t * disp, const lv_area_t * area_p, - uint8_t * color_p) -{ - lv_nuttx_lcd_t * lcd = disp->driver_data; - - lcd->area.row_start = area_p->y1; - lcd->area.row_end = area_p->y2; - lcd->area.col_start = area_p->x1; - lcd->area.col_end = area_p->x2; - lcd->area.data = (uint8_t *)color_p; - ioctl(lcd->fd, LCDDEVIO_PUTAREA, (unsigned long) & (lcd->area)); - lv_display_flush_ready(disp); -} - -static lv_display_t * lcd_init(int fd, int hor_res, int ver_res) -{ - uint8_t * draw_buf = NULL; - uint8_t * draw_buf_2 = NULL; - lv_nuttx_lcd_t * lcd = lv_malloc_zeroed(sizeof(lv_nuttx_lcd_t)); - LV_ASSERT_MALLOC(lcd); - if(lcd == NULL) { - LV_LOG_ERROR("lv_nuttx_lcd_t malloc failed"); - return NULL; - } - - lv_display_t * disp = lv_display_create(hor_res, ver_res); - if(disp == NULL) { - lv_free(lcd); - return NULL; - } - - uint32_t px_size = lv_color_format_get_size(lv_display_get_color_format(disp)); -#if LV_NUTTX_LCD_BUFFER_COUNT > 0 - uint32_t buf_size = hor_res * ver_res * px_size; - lv_display_render_mode_t render_mode = LV_DISPLAY_RENDER_MODE_FULL; -#else - uint32_t buf_size = hor_res * LV_NUTTX_LCD_BUFFER_SIZE * px_size; - lv_display_render_mode_t render_mode = LV_DISPLAY_RENDER_MODE_PARTIAL; -#endif - - draw_buf = lv_malloc(buf_size); - if(draw_buf == NULL) { - LV_LOG_ERROR("display draw_buf malloc failed"); - lv_free(lcd); - return NULL; - } - -#if LV_NUTTX_LCD_BUFFER_COUNT == 2 - draw_buf_2 = lv_malloc(buf_size); - if(draw_buf_2 == NULL) { - LV_LOG_ERROR("display draw_buf_2 malloc failed"); - lv_free(lcd); - lv_free(draw_buf); - return NULL; - } -#endif - - lcd->fd = fd; - if(ioctl(fd, LCDDEVIO_GETAREAALIGN, &lcd->align_info) < 0) { - perror("Error: ioctl(LCDDEVIO_GETAREAALIGN) failed"); - } - - lcd->disp = disp; - lv_display_set_buffers(lcd->disp, draw_buf, draw_buf_2, buf_size, render_mode); - lv_display_set_flush_cb(lcd->disp, flush_cb); - lv_display_add_event_cb(lcd->disp, rounder_cb, LV_EVENT_INVALIDATE_AREA, lcd); - lv_display_add_event_cb(lcd->disp, display_release_cb, LV_EVENT_DELETE, lcd->disp); - lv_display_set_driver_data(lcd->disp, lcd); - - return lcd->disp; -} - -static void display_release_cb(lv_event_t * e) -{ - lv_display_t * disp = (lv_display_t *) lv_event_get_user_data(e); - lv_nuttx_lcd_t * dsc = lv_display_get_driver_data(disp); - if(dsc) { - lv_display_set_driver_data(disp, NULL); - lv_display_set_flush_cb(disp, NULL); - - /* clear display buffer */ - if(disp->buf_1) { - lv_free(disp->buf_1->data); - disp->buf_1 = NULL; - } - if(disp->buf_2) { - lv_free(disp->buf_2->data); - disp->buf_2 = NULL; - } - - /* close device fb */ - if(dsc->fd >= 0) { - close(dsc->fd); - dsc->fd = -1; - } - lv_free(dsc); - LV_LOG_USER("Done"); - } -} -#endif /*LV_USE_NUTTX_LCD*/ - -#endif /* LV_USE_NUTTX*/ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_lcd.h b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_lcd.h deleted file mode 100644 index 16e24ff..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_lcd.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @file lv_nuttx_lcd.h - * - */ - -#ifndef LV_NUTTX_LCD_H -#define LV_NUTTX_LCD_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../display/lv_display.h" - -#if LV_USE_NUTTX - -#if LV_USE_NUTTX_LCD - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -lv_display_t * lv_nuttx_lcd_create(const char * dev_path); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_NUTTX_LCD */ - -#endif /* LV_USE_NUTTX*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_NUTTX_LCD_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_libuv.c b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_libuv.c deleted file mode 100644 index 12b8c43..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_libuv.c +++ /dev/null @@ -1,340 +0,0 @@ -/** - * @file lv_nuttx_libuv.c - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_nuttx_libuv.h" - -#include "../../../lvgl.h" -#include "../../lvgl_private.h" - -#if LV_USE_NUTTX -#include - -#if LV_USE_NUTTX_LIBUV -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - int fd; - bool polling; - uv_poll_t fb_poll; - uv_poll_t vsync_poll; -} lv_nuttx_uv_fb_ctx_t; - -typedef struct { - int fd; - uv_poll_t input_poll; - lv_indev_t * indev; -} lv_nuttx_uv_input_ctx_t; - -typedef struct { - uv_timer_t uv_timer; - lv_nuttx_uv_fb_ctx_t fb_ctx; - lv_nuttx_uv_input_ctx_t input_ctx; - int32_t ref_count; -} lv_nuttx_uv_ctx_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void lv_nuttx_uv_timer_cb(uv_timer_t * handle); -static int lv_nuttx_uv_timer_init(lv_nuttx_uv_t * uv_info, lv_nuttx_uv_ctx_t * uv_ctx); -static void lv_nuttx_uv_timer_deinit(lv_nuttx_uv_ctx_t * uv_ctx); - -static void lv_nuttx_uv_vsync_poll_cb(uv_poll_t * handle, int status, int events); -static void lv_nuttx_uv_disp_poll_cb(uv_poll_t * handle, int status, int events); -static void lv_nuttx_uv_disp_refr_req_cb(lv_event_t * e); -static int lv_nuttx_uv_fb_init(lv_nuttx_uv_t * uv_info, lv_nuttx_uv_ctx_t * uv_ctx); -static void lv_nuttx_uv_fb_deinit(lv_nuttx_uv_ctx_t * uv_ctx); - -static void lv_nuttx_uv_input_poll_cb(uv_poll_t * handle, int status, int events); -static int lv_nuttx_uv_input_init(lv_nuttx_uv_t * uv_info, lv_nuttx_uv_ctx_t * uv_ctx); -static void lv_nuttx_uv_input_deinit(lv_nuttx_uv_ctx_t * uv_ctx); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void * lv_nuttx_uv_init(lv_nuttx_uv_t * uv_info) -{ - lv_nuttx_uv_ctx_t * uv_ctx; - int ret; - - uv_ctx = lv_malloc_zeroed(sizeof(lv_nuttx_uv_ctx_t)); - LV_ASSERT_MALLOC(uv_ctx); - if(uv_ctx == NULL) return NULL; - - if((ret = lv_nuttx_uv_timer_init(uv_info, uv_ctx)) < 0) { - LV_LOG_ERROR("lv_nuttx_uv_timer_init fail : %d", ret); - goto err_out; - } - - if((ret = lv_nuttx_uv_fb_init(uv_info, uv_ctx)) < 0) { - LV_LOG_ERROR("lv_nuttx_uv_fb_init fail : %d", ret); - goto err_out; - } - - if((ret = lv_nuttx_uv_input_init(uv_info, uv_ctx)) < 0) { - LV_LOG_ERROR("lv_nuttx_uv_input_init fail : %d", ret); - goto err_out; - } - - return uv_ctx; - -err_out: - lv_free(uv_ctx); - return NULL; -} - -void lv_nuttx_uv_deinit(void ** data) -{ - lv_nuttx_uv_ctx_t * uv_ctx = *data; - - if(uv_ctx == NULL) return; - lv_nuttx_uv_input_deinit(uv_ctx); - lv_nuttx_uv_fb_deinit(uv_ctx); - lv_nuttx_uv_timer_deinit(uv_ctx); - *data = NULL; - LV_LOG_USER("Done"); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_nuttx_uv_timer_cb(uv_timer_t * handle) -{ - uint32_t sleep_ms; - - sleep_ms = lv_timer_handler(); - - if(sleep_ms == LV_NO_TIMER_READY) { - uv_timer_stop(handle); - return; - } - - /* Prevent busy loops. */ - - if(sleep_ms == 0) { - sleep_ms = 1; - } - - LV_LOG_TRACE("sleep_ms = %" LV_PRIu32, sleep_ms); - uv_timer_start(handle, lv_nuttx_uv_timer_cb, sleep_ms, 0); -} - -static void lv_nuttx_uv_timer_resume(void * data) -{ - uv_timer_t * timer = (uv_timer_t *)data; - if(timer) - uv_timer_start(timer, lv_nuttx_uv_timer_cb, 0, 0); -} - -static int lv_nuttx_uv_timer_init(lv_nuttx_uv_t * uv_info, lv_nuttx_uv_ctx_t * uv_ctx) -{ - uv_loop_t * loop = uv_info->loop; - - LV_ASSERT_NULL(uv_ctx); - LV_ASSERT_NULL(loop); - - uv_ctx->uv_timer.data = uv_ctx; - uv_timer_init(loop, &uv_ctx->uv_timer); - uv_ctx->ref_count++; - uv_timer_start(&uv_ctx->uv_timer, lv_nuttx_uv_timer_cb, 1, 1); - - lv_timer_handler_set_resume_cb(lv_nuttx_uv_timer_resume, &uv_ctx->uv_timer); - return 0; -} - -static void lv_nuttx_uv_deinit_cb(uv_handle_t * handle) -{ - lv_nuttx_uv_ctx_t * uv_ctx = handle->data; - if(--uv_ctx->ref_count <= 0) { - LV_LOG_USER("Done"); - lv_free(uv_ctx); - } -} - -static void lv_nuttx_uv_timer_deinit(lv_nuttx_uv_ctx_t * uv_ctx) -{ - lv_timer_handler_set_resume_cb(NULL, NULL); - uv_close((uv_handle_t *)&uv_ctx->uv_timer, lv_nuttx_uv_deinit_cb); - LV_LOG_USER("Done"); -} - -static void lv_nuttx_uv_vsync_poll_cb(uv_poll_t * handle, int status, int events) -{ - LV_UNUSED(handle); - LV_UNUSED(status); - LV_UNUSED(events); - - lv_display_t * d; - d = lv_display_get_next(NULL); - while(d) { - lv_display_send_event(d, LV_EVENT_VSYNC, NULL); - d = lv_display_get_next(d); - } -} - -static void lv_nuttx_uv_disp_poll_cb(uv_poll_t * handle, int status, int events) -{ - lv_nuttx_uv_fb_ctx_t * fb_ctx = &((lv_nuttx_uv_ctx_t *)(handle->data))->fb_ctx; - - LV_UNUSED(status); - LV_UNUSED(events); - uv_poll_stop(handle); - lv_display_refr_timer(NULL); - fb_ctx->polling = false; -} - -static void lv_nuttx_uv_disp_refr_req_cb(lv_event_t * e) -{ - lv_nuttx_uv_fb_ctx_t * fb_ctx = lv_event_get_user_data(e); - - if(fb_ctx->polling) { - return; - } - fb_ctx->polling = true; - uv_poll_start(&fb_ctx->fb_poll, UV_WRITABLE, lv_nuttx_uv_disp_poll_cb); -} - -static int lv_nuttx_uv_fb_init(lv_nuttx_uv_t * uv_info, lv_nuttx_uv_ctx_t * uv_ctx) -{ - uv_loop_t * loop = uv_info->loop; - lv_display_t * disp = uv_info->disp; - - LV_ASSERT_NULL(uv_ctx); - LV_ASSERT_NULL(disp); - LV_ASSERT_NULL(loop); - - lv_nuttx_uv_fb_ctx_t * fb_ctx = &uv_ctx->fb_ctx; - fb_ctx->fd = *(int *)lv_display_get_driver_data(disp); - - if(fb_ctx->fd <= 0) { - LV_LOG_USER("skip uv fb init."); - return 0; - } - - if(!disp->refr_timer) { - LV_LOG_ERROR("disp->refr_timer is NULL"); - return -EINVAL; - } - - /* Remove default refr timer. */ - - lv_timer_delete(disp->refr_timer); - disp->refr_timer = NULL; - - fb_ctx->fb_poll.data = uv_ctx; - uv_poll_init(loop, &fb_ctx->fb_poll, fb_ctx->fd); - uv_ctx->ref_count++; - uv_poll_start(&fb_ctx->fb_poll, UV_WRITABLE, lv_nuttx_uv_disp_poll_cb); - - fb_ctx->vsync_poll.data = uv_ctx; - uv_poll_init(loop, &fb_ctx->vsync_poll, fb_ctx->fd); - uv_ctx->ref_count++; - uv_poll_start(&fb_ctx->vsync_poll, UV_PRIORITIZED, lv_nuttx_uv_vsync_poll_cb); - - LV_LOG_USER("lvgl fb loop start OK"); - - /* Register for the invalidate area event */ - - lv_event_add(&disp->event_list, lv_nuttx_uv_disp_refr_req_cb, LV_EVENT_REFR_REQUEST, fb_ctx); - - return 0; -} - -static void lv_nuttx_uv_fb_deinit(lv_nuttx_uv_ctx_t * uv_ctx) -{ - /* should remove event */ - lv_nuttx_uv_fb_ctx_t * fb_ctx = &uv_ctx->fb_ctx; - if(fb_ctx->fd > 0) { - uv_close((uv_handle_t *)&fb_ctx->fb_poll, lv_nuttx_uv_deinit_cb); - uv_close((uv_handle_t *)&fb_ctx->vsync_poll, lv_nuttx_uv_deinit_cb); - } - LV_LOG_USER("Done"); -} - -static void lv_nuttx_uv_input_poll_cb(uv_poll_t * handle, int status, int events) -{ - lv_indev_t * indev = ((lv_nuttx_uv_ctx_t *)(handle->data))->input_ctx.indev; - - if(status < 0) { - LV_LOG_WARN("input poll error: %s ", uv_strerror(status)); - return; - } - - if(events & UV_READABLE) { - lv_indev_read(indev); - } -} - -static int lv_nuttx_uv_input_init(lv_nuttx_uv_t * uv_info, lv_nuttx_uv_ctx_t * uv_ctx) -{ - uv_loop_t * loop = uv_info->loop; - lv_indev_t * indev = uv_info->indev; - - if(indev == NULL) { - LV_LOG_USER("skip uv input init."); - return 0; - } - - LV_ASSERT_NULL(uv_ctx); - LV_ASSERT_NULL(loop); - - if(lv_indev_get_mode(indev) == LV_INDEV_MODE_EVENT) { - LV_LOG_ERROR("input device has been running in event-driven mode"); - return -EINVAL; - } - - lv_nuttx_uv_input_ctx_t * input_ctx = &uv_ctx->input_ctx; - input_ctx->fd = *(int *)lv_indev_get_driver_data(indev); - if(input_ctx->fd <= 0) { - LV_LOG_ERROR("can't get valid input fd"); - return 0; - } - - input_ctx->indev = indev; - lv_indev_set_mode(indev, LV_INDEV_MODE_EVENT); - - input_ctx->input_poll.data = uv_ctx; - uv_poll_init(loop, &input_ctx->input_poll, input_ctx->fd); - uv_ctx->ref_count++; - uv_poll_start(&input_ctx->input_poll, UV_READABLE, lv_nuttx_uv_input_poll_cb); - - LV_LOG_USER("lvgl input loop start OK"); - - return 0; -} - -static void lv_nuttx_uv_input_deinit(lv_nuttx_uv_ctx_t * uv_ctx) -{ - lv_nuttx_uv_input_ctx_t * input_ctx = &uv_ctx->input_ctx; - if(input_ctx->fd > 0) { - uv_close((uv_handle_t *)&input_ctx->input_poll, lv_nuttx_uv_deinit_cb); - } - LV_LOG_USER("Done"); -} - -#endif /*LV_USE_NUTTX_LIBUV*/ - -#endif /*LV_USE_NUTTX*/ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_libuv.h b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_libuv.h deleted file mode 100644 index 0799e67..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_libuv.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file lv_nuttx_libuv.h - * - */ - -#ifndef LV_NUTTX_LIBUV_H -#define LV_NUTTX_LIBUV_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../display/lv_display.h" -#include "../../indev/lv_indev.h" - -#if LV_USE_NUTTX - -#if LV_USE_NUTTX_LIBUV - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - void * loop; - lv_display_t * disp; - lv_indev_t * indev; -} lv_nuttx_uv_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize the uv_loop using the provided configuration information. - * @param uv_info Pointer to the lv_nuttx_uv_t structure to be initialized. - */ -void * lv_nuttx_uv_init(lv_nuttx_uv_t * uv_info); - -/** - * Deinitialize the uv_loop configuration for NuttX porting layer. - * @param data Pointer to user data. - */ -void lv_nuttx_uv_deinit(void ** data); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_NUTTX_LIBUV*/ - -#endif /*LV_USE_NUTTX*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*LV_NUTTX_LIBUV_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_profiler.c b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_profiler.c deleted file mode 100644 index a17c3a5..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_profiler.c +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @file lv_nuttx_profiler.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_nuttx_profiler.h" -#include "../../../lvgl.h" - -#if LV_USE_NUTTX && LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN - -#include -#include - -/********************* - * DEFINES - *********************/ - -#define TICK_TO_USEC(tick) ((tick) / cpu_freq) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static uint32_t cpu_freq = 0; /* MHz */ - -/********************** - * STATIC VARIABLES - **********************/ - -static uint32_t tick_get_cb(void); -static void flush_cb(const char * buf); - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_nuttx_profiler_init(void) -{ - cpu_freq = (uint32_t)up_perf_getfreq() / 1000000; - if(cpu_freq == 0) { - LV_LOG_ERROR("Failed to get CPU frequency"); - return; - } - LV_LOG_USER("CPU frequency: %" LV_PRIu32 " MHz", cpu_freq); - - lv_profiler_builtin_config_t config; - lv_profiler_builtin_config_init(&config); - config.tick_per_sec = 1000000; /* 1 sec = 1000000 usec */ - config.tick_get_cb = tick_get_cb; - config.flush_cb = flush_cb; - lv_profiler_builtin_init(&config); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static uint32_t tick_get_cb(void) -{ - static uint32_t prev_tick = 0; - static uint32_t cur_tick_us = 0; - uint32_t act_time = up_perf_gettime(); - uint32_t elaps; - - /*If there is no overflow in sys_time simple subtract*/ - if(act_time >= prev_tick) { - elaps = act_time - prev_tick; - } - else { - elaps = UINT32_MAX - prev_tick + 1; - elaps += act_time; - } - - cur_tick_us += TICK_TO_USEC(elaps); - prev_tick = act_time; - return cur_tick_us; -} - -static void flush_cb(const char * buf) -{ - printf("%s", buf); -} - -#endif diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_profiler.h b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_profiler.h deleted file mode 100644 index 8b8cf65..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_profiler.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @file lv_nuttx_profiler.h - * - */ - -#ifndef LV_NUTTX_PROFILER_H -#define LV_NUTTX_PROFILER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_nuttx_profiler_init(void); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_NUTTX_PROFILER_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_touchscreen.c b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_touchscreen.c deleted file mode 100644 index d49f765..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_touchscreen.c +++ /dev/null @@ -1,200 +0,0 @@ -/** - * @file lv_nuttx_touchscreen.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_nuttx_touchscreen.h" - -#if LV_USE_NUTTX - -#if LV_USE_NUTTX_TOUCHSCREEN - -#include -#include -#include -#include -#include -#include -#include -#include -#include "../../lvgl_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - /* fd should be defined at the beginning */ - int fd; - struct touch_sample_s last_sample; - bool has_last_sample; - lv_indev_state_t last_state; - lv_indev_t * indev_drv; -} lv_nuttx_touchscreen_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static void touchscreen_read(lv_indev_t * drv, lv_indev_data_t * data); -static void touchscreen_delete_cb(lv_event_t * e); -static lv_indev_t * touchscreen_init(int fd); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_indev_t * lv_nuttx_touchscreen_create(const char * dev_path) -{ - lv_indev_t * indev; - int fd; - - LV_ASSERT_NULL(dev_path); - LV_LOG_USER("touchscreen %s opening", dev_path); - fd = open(dev_path, O_RDONLY | O_NONBLOCK); - if(fd < 0) { - perror("Error: cannot open touchscreen device"); - return NULL; - } - - LV_LOG_USER("touchscreen %s open success", dev_path); - - indev = touchscreen_init(fd); - - if(indev == NULL) { - close(fd); - } - - return indev; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void conv_touch_sample(lv_indev_t * drv, - lv_indev_data_t * data, - struct touch_sample_s * sample) -{ - lv_nuttx_touchscreen_t * touchscreen = drv->driver_data; - uint8_t touch_flags = sample->point[0].flags; - - if(touch_flags & (TOUCH_DOWN | TOUCH_MOVE)) { - lv_display_t * disp = lv_indev_get_display(drv); - int32_t hor_max = lv_display_get_horizontal_resolution(disp) - 1; - int32_t ver_max = lv_display_get_vertical_resolution(disp) - 1; - - data->point.x = LV_CLAMP(0, sample->point[0].x, hor_max); - data->point.y = LV_CLAMP(0, sample->point[0].y, ver_max); - touchscreen->last_state = LV_INDEV_STATE_PRESSED; - } - else if(touch_flags & TOUCH_UP) { - touchscreen->last_state = LV_INDEV_STATE_RELEASED; - } -} - -static bool touchscreen_read_sample(int fd, struct touch_sample_s * sample) -{ - int nbytes = read(fd, sample, sizeof(struct touch_sample_s)); - return nbytes == sizeof(struct touch_sample_s); -} - -static void touchscreen_read(lv_indev_t * drv, lv_indev_data_t * data) -{ - lv_nuttx_touchscreen_t * touchscreen = drv->driver_data; - struct touch_sample_s sample; - - /* - * Note: Since it is necessary to avoid multi-processing click events - * caused by redundant continue_reading, a two-unit sample sliding window - * algorithm is used here. continue_reading is only activated when there - * are two points in the window. - */ - - /* If has last sample, use it first */ - if(touchscreen->has_last_sample) { - conv_touch_sample(drv, data, &touchscreen->last_sample); - } - else { - /* Read first sample */ - if(!touchscreen_read_sample(touchscreen->fd, &sample)) { - /* No sample available, return last state */ - data->state = touchscreen->last_state; - return; - } - - conv_touch_sample(drv, data, &sample); - } - - /* Try to read next sample */ - if(touchscreen_read_sample(touchscreen->fd, &sample)) { - /* Save last sample and let lvgl continue reading */ - touchscreen->last_sample = sample; - touchscreen->has_last_sample = true; - data->continue_reading = true; - } - else { - /* No more sample available, clear last sample flag */ - touchscreen->has_last_sample = false; - } - - data->state = touchscreen->last_state; -} - -static void touchscreen_delete_cb(lv_event_t * e) -{ - lv_indev_t * indev = (lv_indev_t *) lv_event_get_user_data(e); - lv_nuttx_touchscreen_t * touchscreen = lv_indev_get_driver_data(indev); - if(touchscreen) { - lv_indev_set_driver_data(indev, NULL); - lv_indev_set_read_cb(indev, NULL); - - if(touchscreen->fd >= 0) { - close(touchscreen->fd); - touchscreen->fd = -1; - } - lv_free(touchscreen); - LV_LOG_USER("done"); - } -} - -static lv_indev_t * touchscreen_init(int fd) -{ - lv_nuttx_touchscreen_t * touchscreen; - lv_indev_t * indev = NULL; - - touchscreen = lv_malloc_zeroed(sizeof(lv_nuttx_touchscreen_t)); - if(touchscreen == NULL) { - LV_LOG_ERROR("touchscreen_s malloc failed"); - return NULL; - } - - touchscreen->fd = fd; - touchscreen->last_state = LV_INDEV_STATE_RELEASED; - touchscreen->indev_drv = indev = lv_indev_create(); - - lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER); - lv_indev_set_read_cb(indev, touchscreen_read); - lv_indev_set_driver_data(indev, touchscreen); - lv_indev_add_event_cb(indev, touchscreen_delete_cb, LV_EVENT_DELETE, indev); - return indev; -} - -#endif /*LV_USE_NUTTX_TOUCHSCREEN*/ - -#endif /* LV_USE_NUTTX*/ diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_touchscreen.h b/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_touchscreen.h deleted file mode 100644 index e0dd1f1..0000000 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_touchscreen.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file lv_nuttx_touchscreen.h - * - */ - -/********************* - * INCLUDES - *********************/ - -#ifndef LV_NUTTX_TOUCHSCREEN_H -#define LV_NUTTX_TOUCHSCREEN_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../indev/lv_indev.h" - -#if LV_USE_NUTTX - -#if LV_USE_NUTTX_TOUCHSCREEN - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize indev with specified input device. - * @param dev_path path of input device - */ -lv_indev_t * lv_nuttx_touchscreen_create(const char * dev_path); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_NUTTX_TOUCHSCREEN */ - -#endif /* LV_USE_NUTTX*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_NUTTX_TOUCHSCREEN_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/qnx/lv_qnx.c b/L3_Middlewares/LVGL/src/drivers/qnx/lv_qnx.c deleted file mode 100644 index f31e727..0000000 --- a/L3_Middlewares/LVGL/src/drivers/qnx/lv_qnx.c +++ /dev/null @@ -1,542 +0,0 @@ -/** - * @file lv_qnx.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_qnx.h" -#if LV_USE_QNX -#include -#include "../../core/lv_refr.h" -#include "../../stdlib/lv_string.h" -#include "../../core/lv_global.h" -#include "../../display/lv_display_private.h" -#include "../../lv_init.h" -#include -#include -#include -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - screen_window_t window; - screen_buffer_t buffers[LV_QNX_BUF_COUNT]; - int bufidx; - bool managed; - lv_indev_t * pointer; - lv_indev_t * keyboard; -} lv_qnx_window_t; - -typedef struct { - int pos[2]; - int buttons; -} lv_qnx_pointer_t; - -typedef struct { - int key; - int flags; -} lv_qnx_keyboard_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static uint32_t get_ticks(void); -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p); -static bool window_create(lv_display_t * disp); -static bool init_display_from_window(lv_display_t * disp); -static void get_pointer(lv_indev_t * indev, lv_indev_data_t * data); -static void get_key(lv_indev_t * indev, lv_indev_data_t * data); -static bool handle_pointer_event(lv_display_t * disp, screen_event_t event); -static bool handle_keyboard_event(lv_display_t * disp, screen_event_t event); -static void release_disp_cb(lv_event_t * e); -static void refresh_cb(lv_timer_t * timer); - -/*********************** - * GLOBAL PROTOTYPES - ***********************/ - -static screen_context_t context; - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_qnx_window_create(int32_t hor_res, int32_t ver_res) -{ - static bool inited = false; - - if(!inited) { - if(screen_create_context(&context, - SCREEN_APPLICATION_CONTEXT) != 0) { - LV_LOG_ERROR("screen_create_context: %s", strerror(errno)); - return NULL; - } - - lv_tick_set_cb(get_ticks); - inited = true; - } - - lv_qnx_window_t * dsc = lv_malloc_zeroed(sizeof(lv_qnx_window_t)); - LV_ASSERT_MALLOC(dsc); - if(dsc == NULL) return NULL; - - lv_display_t * disp = lv_display_create(hor_res, ver_res); - if(disp == NULL) { - lv_free(dsc); - return NULL; - } - lv_display_add_event_cb(disp, release_disp_cb, LV_EVENT_DELETE, disp); - lv_display_set_driver_data(disp, dsc); - if(!window_create(disp)) { - lv_free(dsc); - return NULL; - } - - lv_display_set_flush_cb(disp, flush_cb); - - if(!init_display_from_window(disp)) { - screen_destroy_window(dsc->window); - lv_free(dsc); - return NULL; - } - - /*Replace the default refresh timer handler, so that we can run it on - *demand instead of constantly.*/ - lv_timer_t * refr_timer = lv_display_get_refr_timer(disp); - lv_timer_set_cb(refr_timer, refresh_cb); - - return disp; -} - -void lv_qnx_window_set_title(lv_display_t * disp, const char * title) -{ - lv_qnx_window_t * dsc = lv_display_get_driver_data(disp); - if(!dsc->managed) { - /*Can't set title if there is no window manager*/ - return; - } - - screen_event_t event; - screen_create_event(&event); - - char title_buf[64]; - lv_snprintf(title_buf, sizeof(title_buf), "Title=%s", title); - - int type = SCREEN_EVENT_MANAGER; - screen_set_event_property_iv(event, SCREEN_PROPERTY_TYPE, &type); - screen_set_event_property_cv(event, SCREEN_PROPERTY_USER_DATA, - sizeof(title_buf), title_buf); - screen_set_event_property_pv(event, SCREEN_PROPERTY_WINDOW, - (void **)&dsc->window); - screen_set_event_property_pv(event, SCREEN_PROPERTY_CONTEXT, - (void **)&context); - - screen_inject_event(NULL, event); -} - -bool lv_qnx_add_pointer_device(lv_display_t * disp) -{ - lv_qnx_window_t * dsc = lv_display_get_driver_data(disp); - if(dsc->pointer != NULL) { - /*Only one pointer device per display*/ - return false; - } - - lv_qnx_pointer_t * ptr_dsc = lv_malloc_zeroed(sizeof(lv_qnx_pointer_t)); - LV_ASSERT_MALLOC(ptr_dsc); - if(ptr_dsc == NULL) { - return false; - } - - dsc->pointer = lv_indev_create(); - if(dsc->pointer == NULL) { - lv_free(ptr_dsc); - return false; - } - - lv_indev_set_type(dsc->pointer, LV_INDEV_TYPE_POINTER); - lv_indev_set_read_cb(dsc->pointer, get_pointer); - lv_indev_set_driver_data(dsc->pointer, ptr_dsc); - lv_indev_set_mode(dsc->pointer, LV_INDEV_MODE_EVENT); - return true; -} - -bool lv_qnx_add_keyboard_device(lv_display_t * disp) -{ - lv_qnx_window_t * dsc = lv_display_get_driver_data(disp); - if(dsc->keyboard != NULL) { - /*Only one keyboard device per display*/ - return false; - } - - lv_qnx_keyboard_t * kbd_dsc = lv_malloc_zeroed(sizeof(lv_qnx_keyboard_t)); - LV_ASSERT_MALLOC(kbd_dsc); - if(dsc == NULL) { - return false; - } - - dsc->keyboard = lv_indev_create(); - if(dsc->keyboard == NULL) { - lv_free(kbd_dsc); - return false; - } - - lv_indev_set_type(dsc->keyboard, LV_INDEV_TYPE_KEYPAD); - lv_indev_set_read_cb(dsc->keyboard, get_key); - lv_indev_set_driver_data(dsc->keyboard, kbd_dsc); - lv_indev_set_mode(dsc->keyboard, LV_INDEV_MODE_EVENT); - return true; -} - -int lv_qnx_event_loop(lv_display_t * disp) -{ - lv_refr_now(disp); - - /*Run the event loop*/ - screen_event_t event; - if(screen_create_event(&event) != 0) { - LV_LOG_ERROR("screen_create_event: %s", strerror(errno)); - return EXIT_FAILURE; - } - - uint64_t timeout_ns = 0; - for(;;) { - /*Wait for an event, timing out after 16ms if animations are running*/ - if(screen_get_event(context, event, timeout_ns) != 0) { - LV_LOG_ERROR("screen_get_event: %s", strerror(errno)); - return EXIT_FAILURE; - } - - /*Get the event's type*/ - int type; - if(screen_get_event_property_iv(event, SCREEN_PROPERTY_TYPE, &type) - != 0) { - LV_LOG_ERROR("screen_get_event_property_iv(TYPE): %s", strerror(errno)); - return EXIT_FAILURE; - } - - if(type == SCREEN_EVENT_POINTER) { - if(!handle_pointer_event(disp, event)) { - return EXIT_FAILURE; - } - } - else if(type == SCREEN_EVENT_KEYBOARD) { - if(!handle_keyboard_event(disp, event)) { - return EXIT_FAILURE; - } - } - else if(type == SCREEN_EVENT_MANAGER) { - /*Only sub-type supported is closing the window*/ - break; - } - - /*Calculate the next timeout*/ - uint32_t timeout_ms = lv_timer_handler(); - if(timeout_ms == LV_NO_TIMER_READY) { - timeout_ns = -1ULL; - } - else { - timeout_ns = (uint64_t)timeout_ms * 1000000UL; - } - } - - return EXIT_SUCCESS; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static uint32_t get_ticks(void) -{ - uint64_t const ns = clock_gettime_mon_ns(); - return (uint32_t)(ns / 1000000UL); -} - -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map) -{ - lv_qnx_window_t * dsc = lv_display_get_driver_data(disp); - if(screen_post_window(dsc->window, dsc->buffers[dsc->bufidx], 0, NULL, 0) - != 0) { - LV_LOG_ERROR("screen_post_window: %s", strerror(errno)); - } - -#if (LV_QNX_BUF_COUNT > 1) - dsc->bufidx = 1 - dsc->bufidx; -#endif - - lv_display_flush_ready(disp); -} - -static bool window_create(lv_display_t * disp) -{ - /*Create a window*/ - lv_qnx_window_t * dsc = lv_display_get_driver_data(disp); - if(screen_create_window(&dsc->window, context) != 0) { - LV_LOG_ERROR("screen_create_window: %s", strerror(errno)); - return false; - } - - /*Set window properties*/ - int rect[] = { 0, 0, disp->hor_res, disp->ver_res }; - if(screen_set_window_property_iv(dsc->window, SCREEN_PROPERTY_POSITION, - &rect[0]) != 0) { - LV_LOG_ERROR("screen_window_set_property_iv(POSITION): %s", strerror(errno)); - return false; - } - - if(screen_set_window_property_iv(dsc->window, SCREEN_PROPERTY_SIZE, - &rect[2]) != 0) { - LV_LOG_ERROR("screen_window_set_property_iv(SIZE): %s", strerror(errno)); - return false; - } - - if(screen_set_window_property_iv(dsc->window, SCREEN_PROPERTY_SOURCE_SIZE, - &rect[2]) != 0) { - LV_LOG_ERROR("screen_window_set_property_iv(SOURCE_SIZE): %s", strerror(errno)); - return NULL; - } - - int usage = SCREEN_USAGE_WRITE; - if(screen_set_window_property_iv(dsc->window, SCREEN_PROPERTY_USAGE, - &usage) != 0) { - LV_LOG_ERROR("screen_window_set_property_iv(USAGE): %s", strerror(errno)); - return NULL; - } - - int format = SCREEN_FORMAT_RGBA8888; - if(screen_set_window_property_iv(dsc->window, SCREEN_PROPERTY_FORMAT, - &format) != 0) { - LV_LOG_ERROR("screen_window_set_property_iv(USAGE): %s", strerror(errno)); - return NULL; - } - - /*Initialize window buffers*/ - if(screen_create_window_buffers(dsc->window, LV_QNX_BUF_COUNT) != 0) { - LV_LOG_ERROR("screen_create_window_buffers: %s", strerror(errno)); - return false; - } - - if(screen_get_window_property_pv(dsc->window, SCREEN_PROPERTY_BUFFERS, - (void **)&dsc->buffers) != 0) { - LV_LOG_ERROR("screen_get_window_property_pv(BUFFERS): %s", strerror(errno)); - return false; - } - - /*Connect to the window manager. Can legitimately fail if one is not running*/ - if(screen_manage_window(dsc->window, "Frame=Y") == 0) { - dsc->managed = true; - } - else { - dsc->managed = false; - } - - int visible = 1; - if(screen_set_window_property_iv(dsc->window, SCREEN_PROPERTY_VISIBLE, - &visible) != 0) { - LV_LOG_ERROR("screen_set_window_property_iv(VISIBLE): %s", strerror(errno)); - return false; - } - - return true; -} - -static bool init_display_from_window(lv_display_t * disp) -{ - lv_qnx_window_t * dsc = lv_display_get_driver_data(disp); - - int bufsize; - if(screen_get_buffer_property_iv(dsc->buffers[0], SCREEN_PROPERTY_SIZE, - &bufsize) == -1) { - LV_LOG_ERROR("screen_get_buffer_property_iv(SIZE): %s", strerror(errno)); - return false; - } - - void * ptr1 = NULL; - if(screen_get_buffer_property_pv(dsc->buffers[0], SCREEN_PROPERTY_POINTER, - &ptr1) == -1) { - LV_LOG_ERROR("screen_get_buffer_property_pv(POINTER): %s", strerror(errno)); - return false; - } - - void * ptr2 = NULL; -#if (LV_QNX_BUF_COUNT > 1) - if(screen_get_buffer_property_pv(dsc->buffers[1], SCREEN_PROPERTY_POINTER, - &ptr2) == -1) { - LV_LOG_ERROR("screen_get_buffer_property_pv(POINTER): %s", strerror(errno)); - return false; - } -#endif - - lv_display_set_buffers(disp, ptr1, ptr2, bufsize, LV_DISPLAY_RENDER_MODE_FULL); - return true; -} - -static void release_disp_cb(lv_event_t * e) -{ - lv_display_t * disp = (lv_display_t *) lv_event_get_user_data(e); - lv_qnx_window_t * dsc = lv_display_get_driver_data(disp); - - if(dsc->window != NULL) { - screen_destroy_window(dsc->window); - } - - if(dsc->pointer != NULL) { - lv_free(dsc->pointer); - } - - if(dsc->keyboard != NULL) { - lv_free(dsc->keyboard); - } - - lv_free(dsc); - lv_display_set_driver_data(disp, NULL); -} - -static void get_pointer(lv_indev_t * indev, lv_indev_data_t * data) -{ - lv_qnx_pointer_t * dsc = lv_indev_get_driver_data(indev); - - data->point.x = dsc->pos[0]; - data->point.y = dsc->pos[1]; - if((dsc->buttons & SCREEN_LEFT_MOUSE_BUTTON) != 0) { - data->state = LV_INDEV_STATE_PRESSED; - } - else { - data->state = LV_INDEV_STATE_RELEASED; - } -} - -static bool handle_pointer_event(lv_display_t * disp, screen_event_t event) -{ - lv_qnx_window_t * dsc = lv_display_get_driver_data(disp); - if(dsc->pointer == NULL) return true; - - lv_qnx_pointer_t * ptr_dsc = lv_indev_get_driver_data(dsc->pointer); - - if(screen_get_event_property_iv(event, SCREEN_PROPERTY_SOURCE_POSITION, - ptr_dsc->pos) - != 0) { - LV_LOG_ERROR("screen_get_event_property_iv(SOURCE_POSITION): %s", strerror(errno)); - return false; - } - - if(screen_get_event_property_iv(event, SCREEN_PROPERTY_BUTTONS, - &ptr_dsc->buttons) - != 0) { - LV_LOG_ERROR("screen_get_event_property_iv(BUTTONS): %s", strerror(errno)); - return false; - } - - lv_indev_read(dsc->pointer); - return true; -} - -static void get_key(lv_indev_t * indev, lv_indev_data_t * data) -{ - lv_qnx_keyboard_t * dsc = lv_indev_get_driver_data(indev); - - if((dsc->flags & KEY_DOWN) != 0) { - data->state = LV_INDEV_STATE_PRESSED; - data->key = dsc->key; - } - else { - data->state = LV_INDEV_STATE_RELEASED; - } -} - -static bool handle_keyboard_event(lv_display_t * disp, screen_event_t event) -{ - lv_qnx_window_t * dsc = lv_display_get_driver_data(disp); - if(dsc->keyboard == NULL) return true; - - lv_qnx_keyboard_t * kbd_dsc = lv_indev_get_driver_data(dsc->keyboard); - - /*Get event data*/ - if(screen_get_event_property_iv(event, SCREEN_PROPERTY_FLAGS, - &kbd_dsc->flags) - != 0) { - LV_LOG_ERROR("screen_get_event_property_iv(FLAGS): %s", strerror(errno)); - return false; - } - - if(screen_get_event_property_iv(event, SCREEN_PROPERTY_SYM, - &kbd_dsc->key) - != 0) { - LV_LOG_ERROR("screen_get_event_property_iv(SYM): %s", strerror(errno)); - return false; - } - - /*Translate special keys*/ - switch(kbd_dsc->key) { - case KEYCODE_UP: - kbd_dsc->key = LV_KEY_UP; - break; - - case KEYCODE_DOWN: - kbd_dsc->key = LV_KEY_DOWN; - break; - - case KEYCODE_LEFT: - kbd_dsc->key = LV_KEY_LEFT; - break; - - case KEYCODE_RIGHT: - kbd_dsc->key = LV_KEY_RIGHT; - break; - - case KEYCODE_RETURN: - kbd_dsc->key = LV_KEY_ENTER; - break; - - case KEYCODE_BACKSPACE: - kbd_dsc->key = LV_KEY_BACKSPACE; - break; - - case KEYCODE_HOME: - kbd_dsc->key = LV_KEY_HOME; - break; - - case KEYCODE_END: - kbd_dsc->key = LV_KEY_END; - break; - - case KEYCODE_DELETE: - kbd_dsc->key = LV_KEY_DEL; - break; - - default: - /*Ignore other non-ASCII keys, including modifiers*/ - if(kbd_dsc->key > 0xff) return true; - } - - lv_indev_read(dsc->keyboard); - return true; -} - -static void refresh_cb(lv_timer_t * timer) -{ - /*Refresh the window on timeout, but disable the timer. Any callback can - *re-enable it.*/ - lv_display_t * disp = timer->user_data; - lv_refr_now(disp); - lv_timer_pause(timer); -} - -#endif /*LV_USE_QNX*/ diff --git a/L3_Middlewares/LVGL/src/drivers/qnx/lv_qnx.h b/L3_Middlewares/LVGL/src/drivers/qnx/lv_qnx.h deleted file mode 100644 index bb8f940..0000000 --- a/L3_Middlewares/LVGL/src/drivers/qnx/lv_qnx.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @file lv_qnx.h - * @brief LVGL driver for the QNX Screen compositing window manager - */ - -#ifndef LV_QNX_H -#define LV_QNX_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../display/lv_display.h" -#include "../../indev/lv_indev.h" - -#if LV_USE_QNX - -#include -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a window to use as a display for LVGL. - * @param hor_res The horizontal resolution (size) of the window - * @param ver_res The vertical resolution (size) of the window - * @return A pointer to a new display object if successful, NULL otherwise - */ -lv_display_t * lv_qnx_window_create(int32_t hor_res, int32_t ver_res); - -/** - * Set the title of the window identified by the given display. - * @param disp The display object for the window - * @param title The new title to set - */ -void lv_qnx_window_set_title(lv_display_t * disp, const char * title); - -/** - * Create a pointer input device for the display. - * Only one pointer object is currently supported. - * @param disp The display object associated with the device - * @return true if successful, false otherwise - */ -bool lv_qnx_add_pointer_device(lv_display_t * disp); - -/** - * Create a keyboard input device for the display. - * Only one keyboard object is currently supported. - * @param disp The display object associated with the device - * @return true if successful, false otherwise - */ -bool lv_qnx_add_keyboard_device(lv_display_t * disp); - -/** - * Runs the event loop for the display. - * The function only returns in response to a close event. - * @param disp The display for the event loop - * @return Exit code - */ -int lv_qnx_event_loop(lv_display_t * disp); - -/********************** - * MACROS - **********************/ - -#endif /* LV_DRV_QNX */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_QNX_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_keyboard.c b/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_keyboard.c deleted file mode 100644 index 0bb94d6..0000000 --- a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_keyboard.c +++ /dev/null @@ -1,218 +0,0 @@ -/** - * @file lv_sdl_keyboard.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_sdl_keyboard.h" -#if LV_USE_SDL - -#include "../../core/lv_group.h" -#include "../../stdlib/lv_string.h" -#include "lv_sdl_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - char buf[KEYBOARD_BUFFER_SIZE]; - bool dummy_read; -} lv_sdl_keyboard_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static void sdl_keyboard_read(lv_indev_t * indev, lv_indev_data_t * data); -static uint32_t keycode_to_ctrl_key(SDL_Keycode sdl_key); -static void release_indev_cb(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_indev_t * lv_sdl_keyboard_create(void) -{ - lv_sdl_keyboard_t * dsc = lv_malloc_zeroed(sizeof(lv_sdl_keyboard_t)); - LV_ASSERT_MALLOC(dsc); - if(dsc == NULL) return NULL; - - lv_indev_t * indev = lv_indev_create(); - LV_ASSERT_MALLOC(indev); - if(indev == NULL) { - lv_free(dsc); - return NULL; - } - - lv_indev_set_type(indev, LV_INDEV_TYPE_KEYPAD); - lv_indev_set_read_cb(indev, sdl_keyboard_read); - lv_indev_set_driver_data(indev, dsc); - lv_indev_set_mode(indev, LV_INDEV_MODE_EVENT); - lv_indev_add_event_cb(indev, release_indev_cb, LV_EVENT_DELETE, indev); - - return indev; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void sdl_keyboard_read(lv_indev_t * indev, lv_indev_data_t * data) -{ - lv_sdl_keyboard_t * dev = lv_indev_get_driver_data(indev); - - const size_t len = lv_strlen(dev->buf); - - /*Send a release manually*/ - if(dev->dummy_read) { - dev->dummy_read = false; - data->state = LV_INDEV_STATE_RELEASED; - } - /*Send the pressed character*/ - else if(len > 0) { - dev->dummy_read = true; - data->state = LV_INDEV_STATE_PRESSED; - data->key = dev->buf[0]; - lv_memmove(dev->buf, dev->buf + 1, len); - } -} - -static void release_indev_cb(lv_event_t * e) -{ - lv_indev_t * indev = (lv_indev_t *) lv_event_get_user_data(e); - lv_sdl_keyboard_t * dev = lv_indev_get_driver_data(indev); - if(dev) { - lv_indev_set_driver_data(indev, NULL); - lv_indev_set_read_cb(indev, NULL); - lv_free(dev); - LV_LOG_INFO("done"); - } -} - -void lv_sdl_keyboard_handler(SDL_Event * event) -{ - uint32_t win_id = UINT32_MAX; - switch(event->type) { - case SDL_KEYDOWN: - win_id = event->key.windowID; - break; - case SDL_TEXTINPUT: - win_id = event->text.windowID; - break; - default: - return; - } - - lv_display_t * disp = lv_sdl_get_disp_from_win_id(win_id); - - - /*Find a suitable indev*/ - lv_indev_t * indev = lv_indev_get_next(NULL); - while(indev) { - if(lv_indev_get_type(indev) == LV_INDEV_TYPE_KEYPAD) { - /*If disp is NULL for any reason use the first indev with the correct type*/ - if(disp == NULL || lv_indev_get_display(indev) == disp) break; - } - indev = lv_indev_get_next(indev); - } - if(indev == NULL) return; - lv_sdl_keyboard_t * dsc = lv_indev_get_driver_data(indev); - - /* We only care about SDL_KEYDOWN and SDL_TEXTINPUT events */ - switch(event->type) { - case SDL_KEYDOWN: { /*Button press*/ - const uint32_t ctrl_key = keycode_to_ctrl_key(event->key.keysym.sym); - if(ctrl_key == '\0') - return; - const size_t len = lv_strlen(dsc->buf); - if(len < KEYBOARD_BUFFER_SIZE - 1) { - dsc->buf[len] = ctrl_key; - dsc->buf[len + 1] = '\0'; - } - break; - } - case SDL_TEXTINPUT: { /*Text input*/ - const size_t len = lv_strlen(dsc->buf) + lv_strlen(event->text.text); - if(len < KEYBOARD_BUFFER_SIZE - 1) - strcat(dsc->buf, event->text.text); - } - break; - default: - break; - - } - - size_t len = lv_strlen(dsc->buf); - while(len) { - lv_indev_read(indev); - - /*Call again to handle dummy read in `sdl_keyboard_read`*/ - lv_indev_read(indev); - len--; - } -} - -/** - * Convert a SDL key code to it's LV_KEY_* counterpart or return '\0' if it's not a control character. - * @param sdl_key the key code - * @return LV_KEY_* control character or '\0' - */ -static uint32_t keycode_to_ctrl_key(SDL_Keycode sdl_key) -{ - /*Remap some key to LV_KEY_... to manage groups*/ - switch(sdl_key) { - case SDLK_RIGHT: - case SDLK_KP_PLUS: - return LV_KEY_RIGHT; - - case SDLK_LEFT: - case SDLK_KP_MINUS: - return LV_KEY_LEFT; - - case SDLK_UP: - return LV_KEY_UP; - - case SDLK_DOWN: - return LV_KEY_DOWN; - - case SDLK_ESCAPE: - return LV_KEY_ESC; - - case SDLK_BACKSPACE: - return LV_KEY_BACKSPACE; - - case SDLK_DELETE: - return LV_KEY_DEL; - - case SDLK_KP_ENTER: - case '\r': - return LV_KEY_ENTER; - - case SDLK_TAB: - case SDLK_PAGEDOWN: - return LV_KEY_NEXT; - - case SDLK_PAGEUP: - return LV_KEY_PREV; - - case SDLK_HOME: - return LV_KEY_HOME; - - case SDLK_END: - return LV_KEY_END; - - default: - return '\0'; - } -} - -#endif /*LV_USE_SDL*/ diff --git a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_keyboard.h b/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_keyboard.h deleted file mode 100644 index a18b09d..0000000 --- a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_keyboard.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file lv_sdl_keyboard.h - * - */ - -#ifndef LV_SDL_KEYBOARD_H -#define LV_SDL_KEYBOARD_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_sdl_window.h" -#if LV_USE_SDL - -/********************* - * DEFINES - *********************/ -#ifndef KEYBOARD_BUFFER_SIZE -#define KEYBOARD_BUFFER_SIZE 32 -#endif - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -lv_indev_t * lv_sdl_keyboard_create(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_SDL*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_SDL_KEYBOARD_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mouse.c b/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mouse.c deleted file mode 100644 index 98b4f69..0000000 --- a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mouse.c +++ /dev/null @@ -1,204 +0,0 @@ -/** - * @file lv_sdl_mouse.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_sdl_mouse.h" -#if LV_USE_SDL - -#include "../../core/lv_group.h" -#include "../../stdlib/lv_string.h" -#include "lv_sdl_private.h" - -/********************* - * DEFINES - *********************/ - -#ifndef KEYBOARD_BUFFER_SIZE - #define KEYBOARD_BUFFER_SIZE 32 -#endif - -/********************** - * STATIC PROTOTYPES - **********************/ -static void sdl_mouse_read(lv_indev_t * indev, lv_indev_data_t * data); -static void release_indev_cb(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ - -typedef struct { - int16_t last_x; - int16_t last_y; - bool left_button_down; -#if LV_SDL_MOUSEWHEEL_MODE == LV_SDL_MOUSEWHEEL_MODE_CROWN - int32_t diff; -#endif -} lv_sdl_mouse_t; - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_indev_t * lv_sdl_mouse_create(void) -{ - lv_sdl_mouse_t * dsc = lv_malloc_zeroed(sizeof(lv_sdl_mouse_t)); - LV_ASSERT_MALLOC(dsc); - if(dsc == NULL) return NULL; - - lv_indev_t * indev = lv_indev_create(); - LV_ASSERT_MALLOC(indev); - if(indev == NULL) { - lv_free(dsc); - return NULL; - } - - lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER); - lv_indev_set_read_cb(indev, sdl_mouse_read); - lv_indev_set_driver_data(indev, dsc); - - lv_indev_set_mode(indev, LV_INDEV_MODE_EVENT); - lv_indev_add_event_cb(indev, release_indev_cb, LV_EVENT_DELETE, indev); - - return indev; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void sdl_mouse_read(lv_indev_t * indev, lv_indev_data_t * data) -{ - lv_sdl_mouse_t * dsc = lv_indev_get_driver_data(indev); - - /*Store the collected data*/ - data->point.x = dsc->last_x; - data->point.y = dsc->last_y; - data->state = dsc->left_button_down ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; -#if LV_SDL_MOUSEWHEEL_MODE == LV_SDL_MOUSEWHEEL_MODE_CROWN - data->enc_diff = dsc->diff; - dsc->diff = 0; -#endif -} - -static void release_indev_cb(lv_event_t * e) -{ - lv_indev_t * indev = (lv_indev_t *) lv_event_get_user_data(e); - lv_sdl_mouse_t * dsc = lv_indev_get_driver_data(indev); - if(dsc) { - lv_indev_set_driver_data(indev, NULL); - lv_indev_set_read_cb(indev, NULL); - lv_free(dsc); - LV_LOG_INFO("done"); - } -} - -void lv_sdl_mouse_handler(SDL_Event * event) -{ - uint32_t win_id = UINT32_MAX; - switch(event->type) { - case SDL_MOUSEBUTTONUP: - case SDL_MOUSEBUTTONDOWN: - win_id = event->button.windowID; - break; - case SDL_MOUSEMOTION: - win_id = event->motion.windowID; - break; -#if LV_SDL_MOUSEWHEEL_MODE == LV_SDL_MOUSEWHEEL_MODE_CROWN - case SDL_MOUSEWHEEL: - win_id = event->wheel.windowID; - break; -#endif - case SDL_FINGERUP: - case SDL_FINGERDOWN: - case SDL_FINGERMOTION: -#if SDL_VERSION_ATLEAST(2,0,12) - win_id = event->tfinger.windowID; -#endif - break; - case SDL_WINDOWEVENT: - win_id = event->window.windowID; - break; - default: - return; - } - - lv_display_t * disp = lv_sdl_get_disp_from_win_id(win_id); - - /*Find a suitable indev*/ - lv_indev_t * indev = lv_indev_get_next(NULL); - while(indev) { - if(lv_indev_get_type(indev) == LV_INDEV_TYPE_POINTER) { - /*If disp is NULL for any reason use the first indev with the correct type*/ - if(disp == NULL || lv_indev_get_display(indev) == disp) break; - } - indev = lv_indev_get_next(indev); - } - - if(indev == NULL) return; - lv_sdl_mouse_t * indev_dev = lv_indev_get_driver_data(indev); - if(indev_dev == NULL) return; - - int32_t hor_res = lv_display_get_horizontal_resolution(disp); - int32_t ver_res = lv_display_get_vertical_resolution(disp); - uint8_t zoom = lv_sdl_window_get_zoom(disp); - - switch(event->type) { - case SDL_WINDOWEVENT: - if(event->window.event == SDL_WINDOWEVENT_LEAVE) { - indev_dev->left_button_down = false; - } - break; - case SDL_MOUSEBUTTONUP: - if(event->button.button == SDL_BUTTON_LEFT) - indev_dev->left_button_down = false; - break; - case SDL_WINDOWEVENT_LEAVE: - indev_dev->left_button_down = false; - break; - case SDL_MOUSEBUTTONDOWN: - if(event->button.button == SDL_BUTTON_LEFT) { - indev_dev->left_button_down = true; - indev_dev->last_x = event->motion.x / zoom; - indev_dev->last_y = event->motion.y / zoom; - } - break; - case SDL_MOUSEMOTION: - indev_dev->last_x = event->motion.x / zoom; - indev_dev->last_y = event->motion.y / zoom; - break; - - case SDL_FINGERUP: - indev_dev->left_button_down = false; - indev_dev->last_x = (int16_t)((float)hor_res * event->tfinger.x / zoom); - indev_dev->last_y = (int16_t)((float)ver_res * event->tfinger.y / zoom); - break; - case SDL_FINGERDOWN: - indev_dev->left_button_down = true; - indev_dev->last_x = (int16_t)((float)hor_res * event->tfinger.x / zoom); - indev_dev->last_y = (int16_t)((float)ver_res * event->tfinger.y / zoom); - break; - case SDL_FINGERMOTION: - indev_dev->last_x = (int16_t)((float)hor_res * event->tfinger.x / zoom); - indev_dev->last_y = (int16_t)((float)ver_res * event->tfinger.y / zoom); - break; - case SDL_MOUSEWHEEL: -#if LV_SDL_MOUSEWHEEL_MODE == LV_SDL_MOUSEWHEEL_MODE_CROWN -#ifdef __EMSCRIPTEN__ - /*Emscripten scales it wrong*/ - if(event->wheel.y < 0) dsc->diff++; - if(event->wheel.y > 0) dsc->diff--; -#else - indev_dev->diff = -event->wheel.y; -#endif /*__EMSCRIPTEN__*/ -#endif /*LV_SDL_MOUSEWHEEL_MODE == LV_SDL_MOUSEWHEEL_MODE_CROWN*/ - break; - } - lv_indev_read(indev); -} - -#endif /*LV_USE_SDL*/ diff --git a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mouse.h b/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mouse.h deleted file mode 100644 index ef60685..0000000 --- a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mouse.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file lv_sdl_mouse.h - * - */ - -#ifndef LV_SDL_MOUSE_H -#define LV_SDL_MOUSE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_sdl_window.h" -#if LV_USE_SDL - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -lv_indev_t * lv_sdl_mouse_create(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_SDL*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_SDL_MOUSE_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mousewheel.c b/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mousewheel.c deleted file mode 100644 index b31a723..0000000 --- a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mousewheel.c +++ /dev/null @@ -1,142 +0,0 @@ -/** - * @file lv_sdl_mousewheel.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_sdl_mousewheel.h" -#if LV_USE_SDL && LV_SDL_MOUSEWHEEL_MODE == LV_SDL_MOUSEWHEEL_MODE_ENCODER - -#include "../../core/lv_group.h" -#include "../../stdlib/lv_string.h" -#include "lv_sdl_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void sdl_mousewheel_read(lv_indev_t * indev, lv_indev_data_t * data); -static void release_indev_cb(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ - -typedef struct { - int16_t diff; - lv_indev_state_t state; -} lv_sdl_mousewheel_t; - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_indev_t * lv_sdl_mousewheel_create(void) -{ - lv_sdl_mousewheel_t * dsc = lv_malloc_zeroed(sizeof(lv_sdl_mousewheel_t)); - LV_ASSERT_MALLOC(dsc); - if(dsc == NULL) return NULL; - - lv_indev_t * indev = lv_indev_create(); - if(indev == NULL) { - lv_free(dsc); - return NULL; - } - - lv_indev_set_type(indev, LV_INDEV_TYPE_ENCODER); - lv_indev_set_read_cb(indev, sdl_mousewheel_read); - lv_indev_set_driver_data(indev, dsc); - - lv_indev_set_mode(indev, LV_INDEV_MODE_EVENT); - lv_indev_add_event_cb(indev, release_indev_cb, LV_EVENT_DELETE, indev); - - return indev; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void sdl_mousewheel_read(lv_indev_t * indev, lv_indev_data_t * data) -{ - lv_sdl_mousewheel_t * dsc = lv_indev_get_driver_data(indev); - - data->state = dsc->state; - data->enc_diff = dsc->diff; - dsc->diff = 0; -} - -static void release_indev_cb(lv_event_t * e) -{ - lv_indev_t * indev = (lv_indev_t *) lv_event_get_user_data(e); - lv_sdl_mousewheel_t * dsc = lv_indev_get_driver_data(indev); - if(dsc) { - lv_indev_set_driver_data(indev, NULL); - lv_indev_set_read_cb(indev, NULL); - lv_free(dsc); - LV_LOG_INFO("done"); - } -} - -void lv_sdl_mousewheel_handler(SDL_Event * event) -{ - uint32_t win_id = UINT32_MAX; - switch(event->type) { - case SDL_MOUSEWHEEL: - win_id = event->wheel.windowID; - break; - case SDL_MOUSEBUTTONDOWN: - case SDL_MOUSEBUTTONUP: - win_id = event->button.windowID; - break; - default: - return; - } - - lv_display_t * disp = lv_sdl_get_disp_from_win_id(win_id); - - /*Find a suitable indev*/ - lv_indev_t * indev = lv_indev_get_next(NULL); - while(indev) { - if(lv_indev_get_type(indev) == LV_INDEV_TYPE_ENCODER) { - /*If disp is NULL for any reason use the first indev with the correct type*/ - if(disp == NULL || lv_indev_get_display(indev) == disp) break; - } - indev = lv_indev_get_next(indev); - } - - if(indev == NULL) return; - lv_sdl_mousewheel_t * dsc = lv_indev_get_driver_data(indev); - - switch(event->type) { - case SDL_MOUSEWHEEL: -#ifdef __EMSCRIPTEN__ - /*Emscripten scales it wrong*/ - if(event->wheel.y < 0) dsc->diff++; - if(event->wheel.y > 0) dsc->diff--; -#else - dsc->diff = -event->wheel.y; -#endif - break; - case SDL_MOUSEBUTTONDOWN: - if(event->button.button == SDL_BUTTON_MIDDLE) { - dsc->state = LV_INDEV_STATE_PRESSED; - } - break; - case SDL_MOUSEBUTTONUP: - if(event->button.button == SDL_BUTTON_MIDDLE) { - dsc->state = LV_INDEV_STATE_RELEASED; - } - break; - default: - break; - } - lv_indev_read(indev); -} - -#endif /*LV_USE_SDL*/ diff --git a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mousewheel.h b/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mousewheel.h deleted file mode 100644 index 7ca34bd..0000000 --- a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_mousewheel.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file lv_sdl_mousewheel.h - * - */ - -#ifndef LV_SDL_MOUSEWHEEL_H -#define LV_SDL_MOUSEWHEEL_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_sdl_window.h" -#if LV_USE_SDL && LV_SDL_MOUSEWHEEL_MODE == LV_SDL_MOUSEWHEEL_MODE_ENCODER - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -lv_indev_t * lv_sdl_mousewheel_create(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_SDL*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_DEV_SDL_MOUSEWHEEL_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_private.h b/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_private.h deleted file mode 100644 index 1fd519b..0000000 --- a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_private.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @file lv_sdl_private.h - * - */ - -#ifndef LV_SDL_PRIVATE_H -#define LV_SDL_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../misc/lv_types.h" - -#if LV_USE_SDL - -#include LV_SDL_INCLUDE_PATH - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_sdl_keyboard_handler(SDL_Event * event); -void lv_sdl_mouse_handler(SDL_Event * event); -void lv_sdl_mousewheel_handler(SDL_Event * event); -lv_display_t * lv_sdl_get_disp_from_win_id(uint32_t win_id); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_SDL*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_SDL_PRIVATE_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_window.c b/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_window.c deleted file mode 100644 index df8a28e..0000000 --- a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_window.c +++ /dev/null @@ -1,495 +0,0 @@ -/** - * @file lv_sdl_window.h - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_sdl_window.h" -#if LV_USE_SDL -#include -#include "../../core/lv_refr.h" -#include "../../stdlib/lv_string.h" -#include "../../core/lv_global.h" -#include "../../display/lv_display_private.h" -#include "../../lv_init.h" -#include "../../draw/lv_draw_buf.h" - -/* for aligned_alloc */ -#ifndef __USE_ISOC11 - #define __USE_ISOC11 -#endif -#include - -#define SDL_MAIN_HANDLED /*To fix SDL's "undefined reference to WinMain" issue*/ -#include "lv_sdl_private.h" - -/********************* - * DEFINES - *********************/ -#define lv_deinit_in_progress LV_GLOBAL_DEFAULT()->deinit_in_progress - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - SDL_Window * window; - SDL_Renderer * renderer; -#if LV_USE_DRAW_SDL == 0 - SDL_Texture * texture; - uint8_t * fb1; - uint8_t * fb2; - uint8_t * fb_act; - uint8_t * buf1; - uint8_t * buf2; - uint8_t * rotated_buf; - size_t rotated_buf_size; -#endif - uint8_t zoom; - uint8_t ignore_size_chg; -} lv_sdl_window_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static inline int sdl_render_mode(void); -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p); -static void window_create(lv_display_t * disp); -static void window_update(lv_display_t * disp); -#if LV_USE_DRAW_SDL == 0 - static void texture_resize(lv_display_t * disp); - static void * sdl_draw_buf_realloc_aligned(void * ptr, size_t new_size); - static void sdl_draw_buf_free(void * ptr); -#endif -static void sdl_event_handler(lv_timer_t * t); -static void release_disp_cb(lv_event_t * e); -static void res_chg_event_cb(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ -static bool inited = false; -static lv_timer_t * event_handler_timer; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_sdl_window_create(int32_t hor_res, int32_t ver_res) -{ - if(!inited) { - SDL_Init(SDL_INIT_VIDEO); - SDL_StartTextInput(); - event_handler_timer = lv_timer_create(sdl_event_handler, 5, NULL); - lv_tick_set_cb(SDL_GetTicks); - - inited = true; - } - - lv_sdl_window_t * dsc = lv_malloc_zeroed(sizeof(lv_sdl_window_t)); - LV_ASSERT_MALLOC(dsc); - if(dsc == NULL) return NULL; - - lv_display_t * disp = lv_display_create(hor_res, ver_res); - if(disp == NULL) { - lv_free(dsc); - return NULL; - } - lv_display_add_event_cb(disp, release_disp_cb, LV_EVENT_DELETE, disp); - lv_display_set_driver_data(disp, dsc); - window_create(disp); - - lv_display_set_flush_cb(disp, flush_cb); - -#if LV_USE_DRAW_SDL == 0 - if(sdl_render_mode() == LV_DISPLAY_RENDER_MODE_PARTIAL) { - dsc->buf1 = sdl_draw_buf_realloc_aligned(NULL, 32 * 1024); -#if LV_SDL_BUF_COUNT == 2 - dsc->buf2 = sdl_draw_buf_realloc_aligned(NULL, 32 * 1024); -#endif - lv_display_set_buffers(disp, dsc->buf1, dsc->buf2, - 32 * 1024, LV_DISPLAY_RENDER_MODE_PARTIAL); - } - /*LV_DISPLAY_RENDER_MODE_DIRECT or FULL */ - else { - uint32_t stride = lv_draw_buf_width_to_stride(disp->hor_res, - lv_display_get_color_format(disp)); - lv_display_set_buffers(disp, dsc->fb1, dsc->fb2, stride * disp->ver_res, - LV_SDL_RENDER_MODE); - } -#else /*LV_USE_DRAW_SDL == 1*/ - /*It will render directly to default Texture, so the buffer is not used, so just set something*/ - static lv_draw_buf_t draw_buf; - static uint8_t dummy_buf; /*It won't be used as it will render to the SDL textures directly*/ - lv_draw_buf_init(&draw_buf, 4096, 4096, LV_COLOR_FORMAT_ARGB8888, 4096 * 4, &dummy_buf, 4096 * 4096 * 4); - - lv_display_set_draw_buffers(disp, &draw_buf, NULL); - lv_display_set_render_mode(disp, LV_DISPLAY_RENDER_MODE_DIRECT); -#endif /*LV_USE_DRAW_SDL == 0*/ - lv_display_add_event_cb(disp, res_chg_event_cb, LV_EVENT_RESOLUTION_CHANGED, NULL); - - /*Process the initial events*/ - sdl_event_handler(NULL); - - return disp; -} - -void lv_sdl_window_set_resizeable(lv_display_t * disp, bool value) -{ - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - SDL_SetWindowResizable(dsc->window, value); -} - -void lv_sdl_window_set_zoom(lv_display_t * disp, uint8_t zoom) -{ - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - dsc->zoom = zoom; - lv_display_send_event(disp, LV_EVENT_RESOLUTION_CHANGED, NULL); - lv_refr_now(disp); -} - -uint8_t lv_sdl_window_get_zoom(lv_display_t * disp) -{ - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - return dsc->zoom; -} - -lv_display_t * lv_sdl_get_disp_from_win_id(uint32_t win_id) -{ - lv_display_t * disp = lv_display_get_next(NULL); - if(win_id == UINT32_MAX) return disp; - - while(disp) { - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - if(dsc != NULL && SDL_GetWindowID(dsc->window) == win_id) { - return disp; - } - disp = lv_display_get_next(disp); - } - return NULL; -} - -void lv_sdl_window_set_title(lv_display_t * disp, const char * title) -{ - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - SDL_SetWindowTitle(dsc->window, title); -} - -void * lv_sdl_window_get_renderer(lv_display_t * disp) -{ - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - return dsc->renderer; -} - -void lv_sdl_quit(void) -{ - if(inited) { - SDL_Quit(); - lv_timer_delete(event_handler_timer); - event_handler_timer = NULL; - inited = false; - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static inline int sdl_render_mode(void) -{ - return LV_SDL_RENDER_MODE; -} - -static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map) -{ -#if LV_USE_DRAW_SDL == 0 - lv_area_t rotated_area; - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - lv_color_format_t cf = lv_display_get_color_format(disp); - - if(sdl_render_mode() == LV_DISPLAY_RENDER_MODE_PARTIAL) { - lv_display_rotation_t rotation = lv_display_get_rotation(disp); - uint32_t px_size = lv_color_format_get_size(cf); - - if(rotation != LV_DISPLAY_ROTATION_0) { - int32_t w = lv_area_get_width(area); - int32_t h = lv_area_get_height(area); - uint32_t w_stride = lv_draw_buf_width_to_stride(w, cf); - uint32_t h_stride = lv_draw_buf_width_to_stride(h, cf); - size_t buf_size = w * h * px_size; - - /* (Re)allocate temporary buffer if needed */ - if(!dsc->rotated_buf || dsc->rotated_buf_size != buf_size) { - dsc->rotated_buf = sdl_draw_buf_realloc_aligned(dsc->rotated_buf, buf_size); - dsc->rotated_buf_size = buf_size; - } - - switch(rotation) { - case LV_DISPLAY_ROTATION_0: - break; - case LV_DISPLAY_ROTATION_90: - lv_draw_sw_rotate(px_map, dsc->rotated_buf, w, h, w_stride, h_stride, rotation, cf); - break; - case LV_DISPLAY_ROTATION_180: - lv_draw_sw_rotate(px_map, dsc->rotated_buf, w, h, w_stride, w_stride, rotation, cf); - break; - case LV_DISPLAY_ROTATION_270: - lv_draw_sw_rotate(px_map, dsc->rotated_buf, w, h, w_stride, h_stride, rotation, cf); - break; - } - - px_map = dsc->rotated_buf; - - rotated_area = *area; - lv_display_rotate_area(disp, &rotated_area); - area = &rotated_area; - } - - uint32_t px_map_stride = lv_draw_buf_width_to_stride(lv_area_get_width(area), cf); - uint32_t px_map_line_bytes = lv_area_get_width(area) * px_size; - - uint8_t * fb_tmp = dsc->fb_act; - uint32_t fb_stride = disp->hor_res * px_size; - fb_tmp += area->y1 * fb_stride; - fb_tmp += area->x1 * px_size; - - int32_t y; - for(y = area->y1; y <= area->y2; y++) { - lv_memcpy(fb_tmp, px_map, px_map_line_bytes); - px_map += px_map_stride; - fb_tmp += fb_stride; - } - } - - /* TYPICALLY YOU DO NOT NEED THIS - * If it was the last part to refresh update the texture of the window.*/ - if(lv_display_flush_is_last(disp)) { - if(sdl_render_mode() != LV_DISPLAY_RENDER_MODE_PARTIAL) { - dsc->fb_act = px_map; - } - window_update(disp); - } -#else - LV_UNUSED(area); - LV_UNUSED(px_map); - if(lv_display_flush_is_last(disp)) { - window_update(disp); - } -#endif /*LV_USE_DRAW_SDL == 0*/ - - /*IMPORTANT! It must be called to tell the system the flush is ready*/ - lv_display_flush_ready(disp); -} - -/** - * SDL main thread. All SDL related task have to be handled here! - * It initializes SDL, handles drawing and the mouse. - */ -static void sdl_event_handler(lv_timer_t * t) -{ - LV_UNUSED(t); - - /*Refresh handling*/ - SDL_Event event; - while(SDL_PollEvent(&event)) { - lv_sdl_mouse_handler(&event); -#if LV_SDL_MOUSEWHEEL_MODE == LV_SDL_MOUSEWHEEL_MODE_ENCODER - lv_sdl_mousewheel_handler(&event); -#endif - lv_sdl_keyboard_handler(&event); - - if(event.type == SDL_WINDOWEVENT) { - lv_display_t * disp = lv_sdl_get_disp_from_win_id(event.window.windowID); - if(disp == NULL) continue; - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - switch(event.window.event) { -#if SDL_VERSION_ATLEAST(2, 0, 5) - case SDL_WINDOWEVENT_TAKE_FOCUS: -#endif - case SDL_WINDOWEVENT_EXPOSED: - window_update(disp); - break; - case SDL_WINDOWEVENT_RESIZED: - dsc->ignore_size_chg = 1; - lv_display_set_resolution(disp, event.window.data1 / dsc->zoom, event.window.data2 / dsc->zoom); - dsc->ignore_size_chg = 0; - lv_refr_now(disp); - break; - case SDL_WINDOWEVENT_CLOSE: - lv_display_delete(disp); - break; - default: - break; - } - } - if(event.type == SDL_QUIT) { - SDL_Quit(); - lv_deinit(); - inited = false; -#if LV_SDL_DIRECT_EXIT - exit(0); -#endif - } - } -} - -static void window_create(lv_display_t * disp) -{ - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - dsc->zoom = 1; - - int flag = SDL_WINDOW_RESIZABLE; -#if LV_SDL_FULLSCREEN - flag |= SDL_WINDOW_FULLSCREEN; -#endif - - int32_t hor_res = disp->hor_res; - int32_t ver_res = disp->ver_res; - dsc->window = SDL_CreateWindow("LVGL Simulator", - SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, - hor_res * dsc->zoom, ver_res * dsc->zoom, flag); /*last param. SDL_WINDOW_BORDERLESS to hide borders*/ - - dsc->renderer = SDL_CreateRenderer(dsc->window, -1, - LV_SDL_ACCELERATED ? SDL_RENDERER_ACCELERATED : SDL_RENDERER_SOFTWARE); -#if LV_USE_DRAW_SDL == 0 - texture_resize(disp); - - uint32_t px_size = lv_color_format_get_size(lv_display_get_color_format(disp)); - lv_memset(dsc->fb1, 0xff, hor_res * ver_res * px_size); -#if LV_SDL_BUF_COUNT == 2 - lv_memset(dsc->fb2, 0xff, hor_res * ver_res * px_size); -#endif -#endif /*LV_USE_DRAW_SDL == 0*/ - /*Some platforms (e.g. Emscripten) seem to require setting the size again */ - SDL_SetWindowSize(dsc->window, hor_res * dsc->zoom, ver_res * dsc->zoom); -#if LV_USE_DRAW_SDL == 0 - texture_resize(disp); -#endif /*LV_USE_DRAW_SDL == 0*/ -} - -static void window_update(lv_display_t * disp) -{ - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); -#if LV_USE_DRAW_SDL == 0 - int32_t hor_res = disp->hor_res; - uint32_t stride = lv_draw_buf_width_to_stride(hor_res, lv_display_get_color_format(disp)); - SDL_UpdateTexture(dsc->texture, NULL, dsc->fb_act, stride); - - SDL_RenderClear(dsc->renderer); - - /*Update the renderer with the texture containing the rendered image*/ - SDL_RenderCopy(dsc->renderer, dsc->texture, NULL, NULL); -#endif - SDL_RenderPresent(dsc->renderer); -} - -#if LV_USE_DRAW_SDL == 0 -static void texture_resize(lv_display_t * disp) -{ - uint32_t stride = lv_draw_buf_width_to_stride(disp->hor_res, lv_display_get_color_format(disp)); - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - - dsc->fb1 = sdl_draw_buf_realloc_aligned(dsc->fb1, stride * disp->ver_res); - lv_memzero(dsc->fb1, stride * disp->ver_res); - - if(sdl_render_mode() == LV_DISPLAY_RENDER_MODE_PARTIAL) { - dsc->fb_act = dsc->fb1; - } - else { -#if LV_SDL_BUF_COUNT == 2 - dsc->fb2 = sdl_draw_buf_realloc_aligned(dsc->fb2, stride * disp->ver_res); - memset(dsc->fb2, 0x00, stride * disp->ver_res); -#endif - lv_display_set_buffers(disp, dsc->fb1, dsc->fb2, stride * disp->ver_res, LV_SDL_RENDER_MODE); - } - if(dsc->texture) SDL_DestroyTexture(dsc->texture); - -#if LV_COLOR_DEPTH == 32 - SDL_PixelFormatEnum px_format = - SDL_PIXELFORMAT_RGB888; /*same as SDL_PIXELFORMAT_RGB888, but it's not supported in older versions*/ -#elif LV_COLOR_DEPTH == 24 - SDL_PixelFormatEnum px_format = SDL_PIXELFORMAT_BGR24; -#elif LV_COLOR_DEPTH == 16 - SDL_PixelFormatEnum px_format = SDL_PIXELFORMAT_RGB565; -#else -#error("Unsupported color format") -#endif - // px_format = SDL_PIXELFORMAT_BGR24; - - dsc->texture = SDL_CreateTexture(dsc->renderer, px_format, - SDL_TEXTUREACCESS_STATIC, disp->hor_res, disp->ver_res); - SDL_SetTextureBlendMode(dsc->texture, SDL_BLENDMODE_BLEND); -} - -static void * sdl_draw_buf_realloc_aligned(void * ptr, size_t new_size) -{ - if(ptr) { - sdl_draw_buf_free(ptr); - } - - /* No need copy for drawing buffer */ - -#ifndef _WIN32 - /* Size must be multiple of align, See: https://en.cppreference.com/w/c/memory/aligned_alloc */ - -#define BUF_ALIGN (LV_DRAW_BUF_ALIGN < sizeof(void *) ? sizeof(void *) : LV_DRAW_BUF_ALIGN) - return aligned_alloc(BUF_ALIGN, LV_ALIGN_UP(new_size, BUF_ALIGN)); -#else - return _aligned_malloc(LV_ALIGN_UP(new_size, LV_DRAW_BUF_ALIGN), LV_DRAW_BUF_ALIGN); -#endif /* _WIN32 */ -} - -static void sdl_draw_buf_free(void * ptr) -{ -#ifndef _WIN32 - free(ptr); -#else - _aligned_free(ptr); -#endif /* _WIN32 */ -} -#endif - -static void res_chg_event_cb(lv_event_t * e) -{ - lv_display_t * disp = lv_event_get_current_target(e); - - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - if(dsc->ignore_size_chg == false) { - SDL_SetWindowSize(dsc->window, disp->hor_res * dsc->zoom, disp->ver_res * dsc->zoom); - } - -#if LV_USE_DRAW_SDL == 0 - texture_resize(disp); -#endif -} - -static void release_disp_cb(lv_event_t * e) -{ - if(lv_deinit_in_progress) { - lv_sdl_quit(); - } - - lv_display_t * disp = (lv_display_t *) lv_event_get_user_data(e); - - lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); -#if LV_USE_DRAW_SDL == 0 - SDL_DestroyTexture(dsc->texture); -#endif - SDL_DestroyRenderer(dsc->renderer); - SDL_DestroyWindow(dsc->window); -#if LV_USE_DRAW_SDL == 0 - if(dsc->fb1) sdl_draw_buf_free(dsc->fb1); - if(dsc->fb2) sdl_draw_buf_free(dsc->fb2); - if(dsc->buf1) sdl_draw_buf_free(dsc->buf1); - if(dsc->buf2) sdl_draw_buf_free(dsc->buf2); -#endif - lv_free(dsc); - lv_display_set_driver_data(disp, NULL); -} - -#endif /*LV_USE_SDL*/ diff --git a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_window.h b/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_window.h deleted file mode 100644 index f2e243c..0000000 --- a/L3_Middlewares/LVGL/src/drivers/sdl/lv_sdl_window.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file lv_sdl_window.h - * - */ - -#ifndef LV_SDL_WINDOW_H -#define LV_SDL_WINDOW_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../display/lv_display.h" -#include "../../indev/lv_indev.h" - -#if LV_USE_SDL - -/********************* - * DEFINES - *********************/ - -/* Possible values of LV_SDL_MOUSEWHEEL_MODE */ -#define LV_SDL_MOUSEWHEEL_MODE_ENCODER 0 /* The mousewheel emulates an encoder input device*/ -#define LV_SDL_MOUSEWHEEL_MODE_CROWN 1 /* The mousewheel emulates a smart watch crown*/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -lv_display_t * lv_sdl_window_create(int32_t hor_res, int32_t ver_res); - -void lv_sdl_window_set_resizeable(lv_display_t * disp, bool value); - -void lv_sdl_window_set_zoom(lv_display_t * disp, uint8_t zoom); - -uint8_t lv_sdl_window_get_zoom(lv_display_t * disp); - -void lv_sdl_window_set_title(lv_display_t * disp, const char * title); - -void * lv_sdl_window_get_renderer(lv_display_t * disp); - -void lv_sdl_quit(void); - -/********************** - * MACROS - **********************/ - -#endif /* LV_DRV_SDL */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_SDL_WINDOW_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland.c b/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland.c deleted file mode 100644 index dc71f66..0000000 --- a/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland.c +++ /dev/null @@ -1,2860 +0,0 @@ -/******************************************************************* - * - * @file lv_wayland.c - The Wayland client for LVGL applications - * - * Based on the original file from the repository. - * - * Porting to LVGL 9.1 - * EDGEMTech Ltd. by Erik Tagirov (erik.tagirov@edgemtech.ch) - * - * See LICENCE.txt for details - * - ******************************************************************/ - -typedef int dummy_t; /* Make GCC on windows happy, avoid empty translation unit */ - -#ifndef _WIN32 - -/********************* - * INCLUDES - *********************/ -#include "lv_wayland.h" -#include "lv_wayland_smm.h" - -#if LV_USE_WAYLAND - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "lvgl.h" - - -#if !LV_WAYLAND_WL_SHELL - #include "wayland_xdg_shell.h" - #define LV_WAYLAND_XDG_SHELL 1 -#else - #define LV_WAYLAND_XDG_SHELL 0 -#endif - - -/********************* - * DEFINES - *********************/ - -#define LVGL_DRAW_BUFFER_DIV (8) -#define DMG_CACHE_CAPACITY (32) -#define TAG_LOCAL (0) -#define TAG_BUFFER_DAMAGE (1) - -#if LV_WAYLAND_WINDOW_DECORATIONS - #define TITLE_BAR_HEIGHT 24 - #define BORDER_SIZE 2 - #define BUTTON_MARGIN LV_MAX((TITLE_BAR_HEIGHT / 6), BORDER_SIZE) - #define BUTTON_PADDING LV_MAX((TITLE_BAR_HEIGHT / 8), BORDER_SIZE) - #define BUTTON_SIZE (TITLE_BAR_HEIGHT - (2 * BUTTON_MARGIN)) -#endif - -#ifndef LV_WAYLAND_CYCLE_PERIOD - #define LV_WAYLAND_CYCLE_PERIOD LV_MIN(LV_DEF_REFR_PERIOD,1) -#endif - -#define SHM_FORMAT_UNKNOWN 0xFFFFFF - -#if (LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1) - #error [wayland] Unsupported LV_COLOR_DEPTH -#endif - -/********************** - * TYPEDEFS - **********************/ - -enum object_type { - OBJECT_TITLEBAR = 0, - OBJECT_BUTTON_CLOSE, -#if LV_WAYLAND_XDG_SHELL - OBJECT_BUTTON_MAXIMIZE, - OBJECT_BUTTON_MINIMIZE, -#endif - OBJECT_BORDER_TOP, - OBJECT_BORDER_BOTTOM, - OBJECT_BORDER_LEFT, - OBJECT_BORDER_RIGHT, - OBJECT_WINDOW, -}; - -#define FIRST_DECORATION (OBJECT_TITLEBAR) -#define LAST_DECORATION (OBJECT_BORDER_RIGHT) -#define NUM_DECORATIONS (LAST_DECORATION-FIRST_DECORATION+1) - -struct window; -struct input { - struct { - uint32_t x; - uint32_t y; - lv_indev_state_t left_button; - lv_indev_state_t right_button; - lv_indev_state_t wheel_button; - int16_t wheel_diff; - } pointer; - - struct { - lv_key_t key; - lv_indev_state_t state; - } keyboard; - - struct { - uint32_t x; - uint32_t y; - lv_indev_state_t state; - } touch; -}; - -struct seat { - struct wl_touch * wl_touch; - struct wl_pointer * wl_pointer; - struct wl_keyboard * wl_keyboard; - - struct { - struct xkb_keymap * keymap; - struct xkb_state * state; - } xkb; -}; - -struct graphic_object { - struct window * window; - - struct wl_surface * surface; - bool surface_configured; - smm_buffer_t * pending_buffer; - smm_group_t * buffer_group; - struct wl_subsurface * subsurface; - - enum object_type type; - int width; - int height; - - struct input input; -}; - -struct application { - struct wl_display * display; - struct wl_registry * registry; - struct wl_compositor * compositor; - struct wl_subcompositor * subcompositor; - struct wl_shm * shm; - struct wl_seat * wl_seat; - - struct wl_cursor_theme * cursor_theme; - struct wl_surface * cursor_surface; - -#if LV_WAYLAND_WL_SHELL - struct wl_shell * wl_shell; -#endif - -#if LV_WAYLAND_XDG_SHELL - struct xdg_wm_base * xdg_wm; -#endif - - const char * xdg_runtime_dir; - -#ifdef LV_WAYLAND_WINDOW_DECORATIONS - bool opt_disable_decorations; -#endif - - uint32_t shm_format; - - struct xkb_context * xkb_context; - - struct seat seat; - - struct graphic_object * touch_obj; - struct graphic_object * pointer_obj; - struct graphic_object * keyboard_obj; - - lv_ll_t window_ll; - lv_timer_t * cycle_timer; - - bool cursor_flush_pending; - struct pollfd wayland_pfd; -}; - -struct window { - lv_display_t * lv_disp; - lv_draw_buf_t * lv_disp_draw_buf; - - lv_indev_t * lv_indev_pointer; - lv_indev_t * lv_indev_pointeraxis; - lv_indev_t * lv_indev_touch; - lv_indev_t * lv_indev_keyboard; - - lv_wayland_display_close_f_t close_cb; - - struct application * application; - -#if LV_WAYLAND_WL_SHELL - struct wl_shell_surface * wl_shell_surface; -#endif - -#if LV_WAYLAND_XDG_SHELL - struct xdg_surface * xdg_surface; - struct xdg_toplevel * xdg_toplevel; - uint32_t wm_capabilities; -#endif - - struct graphic_object * body; - struct { - lv_area_t cache[DMG_CACHE_CAPACITY]; - unsigned char start; - unsigned char end; - unsigned size; - } dmg_cache; - -#if LV_WAYLAND_WINDOW_DECORATIONS - struct graphic_object * decoration[NUM_DECORATIONS]; -#endif - - int width; - int height; - - bool resize_pending; - int resize_width; - int resize_height; - - bool flush_pending; - bool shall_close; - bool closed; - bool maximized; - bool fullscreen; - uint32_t frame_counter; - bool frame_done; -}; - -/********************************* - * STATIC VARIABLES and FUNTIONS - *********************************/ - -static struct application application; - -static void color_fill(void * pixels, lv_color_t color, uint32_t width, uint32_t height); -static void color_fill_XRGB8888(void * pixels, lv_color_t color, uint32_t width, uint32_t height); -static void color_fill_RGB565(void * pixels, lv_color_t color, uint32_t width, uint32_t height); - -static const struct wl_callback_listener wl_surface_frame_listener; -static bool resize_window(struct window * window, int width, int height); -static struct graphic_object * create_graphic_obj(struct application * app, struct window * window, - enum object_type type, - struct graphic_object * parent); - -static uint32_t tick_get_cb(void); - -static void wayland_init(void); -static void wayland_deinit(void); - -/** - * The frame callback called when the compositor has finished rendering - * a frame.It increments the frame counter and sets up the callback - * for the next frame the frame counter is used to avoid needlessly - * committing frames too fast on a slow system - * - * NOTE: this function is invoked by the wayland-server library within the compositor - * the event is added to the queue, and then upon the next timer call it's - * called indirectly from _lv_wayland_handle_input (via wl_display_dispatch_queue) - * @param void data the user object defined that was tied to this event during - * the configuration of the callback - * @param struct wl_callback The callback that needs to be destroyed and re-created - * @param time Timestamp of the event (unused) - */ -static void graphic_obj_frame_done(void * data, struct wl_callback * cb, uint32_t time) -{ - struct graphic_object * obj; - struct window * window; - - LV_UNUSED(time); - - wl_callback_destroy(cb); - - obj = (struct graphic_object *)data; - window = obj->window; - window->frame_counter++; - - LV_LOG_TRACE("frame: %d done, new frame: %d", - window->frame_counter - 1, window->frame_counter); - - window->frame_done = true; - -} - -static const struct wl_callback_listener wl_surface_frame_listener = { - .done = graphic_obj_frame_done, -}; - -static inline bool _is_digit(char ch) -{ - return (ch >= '0') && (ch <= '9'); -} - -/* - * shm_format - * @description called by the compositor to advertise the supported - * color formats for SHM buffers, there is a call per supported format - */ -static void shm_format(void * data, struct wl_shm * wl_shm, uint32_t format) -{ - struct application * app = data; - - LV_UNUSED(wl_shm); - - LV_LOG_TRACE("Supported color space fourcc.h code: %08X", format); - - if(LV_COLOR_DEPTH == 32 && format == WL_SHM_FORMAT_ARGB8888) { - - /* Wayland compositors MUST support ARGB8888 */ - app->shm_format = format; - - } - else if(LV_COLOR_DEPTH == 32 && - format == WL_SHM_FORMAT_XRGB8888 && - app->shm_format != WL_SHM_FORMAT_ARGB8888) { - - /* Select XRGB only if the compositor doesn't support transprancy */ - app->shm_format = format; - - } - else if(LV_COLOR_DEPTH == 16 && format == WL_SHM_FORMAT_RGB565) { - - app->shm_format = format; - - } -} - -static const struct wl_shm_listener shm_listener = { - shm_format -}; - -static void pointer_handle_enter(void * data, struct wl_pointer * pointer, - uint32_t serial, struct wl_surface * surface, - wl_fixed_t sx, wl_fixed_t sy) -{ - struct application * app = data; - const char * cursor = "left_ptr"; - int pos_x = wl_fixed_to_int(sx); - int pos_y = wl_fixed_to_int(sy); - - if(!surface) { - app->pointer_obj = NULL; - return; - } - - app->pointer_obj = wl_surface_get_user_data(surface); - - app->pointer_obj->input.pointer.x = pos_x; - app->pointer_obj->input.pointer.y = pos_y; - -#if (LV_WAYLAND_WINDOW_DECORATIONS && LV_WAYLAND_XDG_SHELL) - if(!app->pointer_obj->window->xdg_toplevel || app->opt_disable_decorations) { - return; - } - - struct window * window = app->pointer_obj->window; - - switch(app->pointer_obj->type) { - case OBJECT_BORDER_TOP: - if(window->maximized) { - // do nothing - } - else if(pos_x < (BORDER_SIZE * 5)) { - cursor = "top_left_corner"; - } - else if(pos_x >= (window->width + BORDER_SIZE - (BORDER_SIZE * 5))) { - cursor = "top_right_corner"; - } - else { - cursor = "top_side"; - } - break; - case OBJECT_BORDER_BOTTOM: - if(window->maximized) { - // do nothing - } - else if(pos_x < (BORDER_SIZE * 5)) { - cursor = "bottom_left_corner"; - } - else if(pos_x >= (window->width + BORDER_SIZE - (BORDER_SIZE * 5))) { - cursor = "bottom_right_corner"; - } - else { - cursor = "bottom_side"; - } - break; - case OBJECT_BORDER_LEFT: - if(window->maximized) { - // do nothing - } - else if(pos_y < (BORDER_SIZE * 5)) { - cursor = "top_left_corner"; - } - else if(pos_y >= (window->height + BORDER_SIZE - (BORDER_SIZE * 5))) { - cursor = "bottom_left_corner"; - } - else { - cursor = "left_side"; - } - break; - case OBJECT_BORDER_RIGHT: - if(window->maximized) { - // do nothing - } - else if(pos_y < (BORDER_SIZE * 5)) { - cursor = "top_right_corner"; - } - else if(pos_y >= (window->height + BORDER_SIZE - (BORDER_SIZE * 5))) { - cursor = "bottom_right_corner"; - } - else { - cursor = "right_side"; - } - break; - default: - break; - } -#endif - - if(app->cursor_surface) { - struct wl_cursor_image * cursor_image = wl_cursor_theme_get_cursor(app->cursor_theme, cursor)->images[0]; - wl_pointer_set_cursor(pointer, serial, app->cursor_surface, cursor_image->hotspot_x, cursor_image->hotspot_y); - wl_surface_attach(app->cursor_surface, wl_cursor_image_get_buffer(cursor_image), 0, 0); - wl_surface_damage(app->cursor_surface, 0, 0, cursor_image->width, cursor_image->height); - wl_surface_commit(app->cursor_surface); - app->cursor_flush_pending = true; - } -} - -static void pointer_handle_leave(void * data, struct wl_pointer * pointer, - uint32_t serial, struct wl_surface * surface) -{ - struct application * app = data; - - LV_UNUSED(pointer); - LV_UNUSED(serial); - - if(!surface || (app->pointer_obj == wl_surface_get_user_data(surface))) { - app->pointer_obj = NULL; - } -} - -static void pointer_handle_motion(void * data, struct wl_pointer * pointer, - uint32_t time, wl_fixed_t sx, wl_fixed_t sy) -{ - struct application * app = data; - - LV_UNUSED(pointer); - LV_UNUSED(time); - - if(!app->pointer_obj) { - return; - } - - app->pointer_obj->input.pointer.x = LV_MAX(0, LV_MIN(wl_fixed_to_int(sx), app->pointer_obj->width - 1)); - app->pointer_obj->input.pointer.y = LV_MAX(0, LV_MIN(wl_fixed_to_int(sy), app->pointer_obj->height - 1)); -} - -static void pointer_handle_button(void * data, struct wl_pointer * wl_pointer, - uint32_t serial, uint32_t time, uint32_t button, - uint32_t state) -{ - struct application * app = data; - - LV_UNUSED(serial); - LV_UNUSED(wl_pointer); - LV_UNUSED(time); - - const lv_indev_state_t lv_state = - (state == WL_POINTER_BUTTON_STATE_PRESSED) ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; - - if(!app->pointer_obj) { - return; - } - - -#if LV_WAYLAND_WINDOW_DECORATIONS - struct window * window; - window = app->pointer_obj->window; - int pos_x = app->pointer_obj->input.pointer.x; - int pos_y = app->pointer_obj->input.pointer.y; -#endif - - switch(app->pointer_obj->type) { - case OBJECT_WINDOW: - switch(button) { - case BTN_LEFT: - app->pointer_obj->input.pointer.left_button = lv_state; - break; - case BTN_RIGHT: - app->pointer_obj->input.pointer.right_button = lv_state; - break; - case BTN_MIDDLE: - app->pointer_obj->input.pointer.wheel_button = lv_state; - break; - default: - break; - } - - break; -#if LV_WAYLAND_WINDOW_DECORATIONS - case OBJECT_TITLEBAR: - if((button == BTN_LEFT) && (state == WL_POINTER_BUTTON_STATE_PRESSED)) { -#if LV_WAYLAND_XDG_SHELL - if(window->xdg_toplevel) { - xdg_toplevel_move(window->xdg_toplevel, app->wl_seat, serial); - window->flush_pending = true; - } -#endif -#if LV_WAYLAND_WL_SHELL - if(window->wl_shell_surface) { - wl_shell_surface_move(window->wl_shell_surface, app->wl_seat, serial); - window->flush_pending = true; - } -#endif - } - break; - case OBJECT_BUTTON_CLOSE: - if((button == BTN_LEFT) && (state == WL_POINTER_BUTTON_STATE_RELEASED)) { - window->shall_close = true; - } - break; -#if LV_WAYLAND_XDG_SHELL - case OBJECT_BUTTON_MAXIMIZE: - if((button == BTN_LEFT) && (state == WL_POINTER_BUTTON_STATE_RELEASED)) { - if(window->xdg_toplevel) { - if(window->maximized) { - xdg_toplevel_unset_maximized(window->xdg_toplevel); - } - else { - xdg_toplevel_set_maximized(window->xdg_toplevel); - } - window->maximized ^= true; - window->flush_pending = true; - } - } - break; - case OBJECT_BUTTON_MINIMIZE: - if((button == BTN_LEFT) && (state == WL_POINTER_BUTTON_STATE_RELEASED)) { - if(window->xdg_toplevel) { - xdg_toplevel_set_minimized(window->xdg_toplevel); - window->flush_pending = true; - } - } - break; - case OBJECT_BORDER_TOP: - if((button == BTN_LEFT) && (state == WL_POINTER_BUTTON_STATE_PRESSED)) { - if(window->xdg_toplevel && !window->maximized) { - uint32_t edge; - if(pos_x < (BORDER_SIZE * 5)) { - edge = XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT; - } - else if(pos_x >= (window->width + BORDER_SIZE - (BORDER_SIZE * 5))) { - edge = XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT; - } - else { - edge = XDG_TOPLEVEL_RESIZE_EDGE_TOP; - } - xdg_toplevel_resize(window->xdg_toplevel, - window->application->wl_seat, serial, edge); - window->flush_pending = true; - } - } - break; - case OBJECT_BORDER_BOTTOM: - if((button == BTN_LEFT) && (state == WL_POINTER_BUTTON_STATE_PRESSED)) { - if(window->xdg_toplevel && !window->maximized) { - uint32_t edge; - if(pos_x < (BORDER_SIZE * 5)) { - edge = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT; - } - else if(pos_x >= (window->width + BORDER_SIZE - (BORDER_SIZE * 5))) { - edge = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT; - } - else { - edge = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM; - } - xdg_toplevel_resize(window->xdg_toplevel, - window->application->wl_seat, serial, edge); - window->flush_pending = true; - } - } - break; - case OBJECT_BORDER_LEFT: - if((button == BTN_LEFT) && (state == WL_POINTER_BUTTON_STATE_PRESSED)) { - if(window->xdg_toplevel && !window->maximized) { - uint32_t edge; - if(pos_y < (BORDER_SIZE * 5)) { - edge = XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT; - } - else if(pos_y >= (window->height + BORDER_SIZE - (BORDER_SIZE * 5))) { - edge = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT; - } - else { - edge = XDG_TOPLEVEL_RESIZE_EDGE_LEFT; - } - xdg_toplevel_resize(window->xdg_toplevel, - window->application->wl_seat, serial, edge); - window->flush_pending = true; - } - } - break; - case OBJECT_BORDER_RIGHT: - if((button == BTN_LEFT) && (state == WL_POINTER_BUTTON_STATE_PRESSED)) { - if(window->xdg_toplevel && !window->maximized) { - uint32_t edge; - if(pos_y < (BORDER_SIZE * 5)) { - edge = XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT; - } - else if(pos_y >= (window->height + BORDER_SIZE - (BORDER_SIZE * 5))) { - edge = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT; - } - else { - edge = XDG_TOPLEVEL_RESIZE_EDGE_RIGHT; - } - xdg_toplevel_resize(window->xdg_toplevel, - window->application->wl_seat, serial, edge); - window->flush_pending = true; - } - } - break; -#endif // LV_WAYLAND_XDG_SHELL -#endif // LV_WAYLAND_WINDOW_DECORATIONS - default: - break; - } -} - -static void pointer_handle_axis(void * data, struct wl_pointer * wl_pointer, - uint32_t time, uint32_t axis, wl_fixed_t value) -{ - struct application * app = data; - const int diff = wl_fixed_to_int(value); - - LV_UNUSED(time); - LV_UNUSED(wl_pointer); - - if(!app->pointer_obj) { - return; - } - - if(axis == 0) { - if(diff > 0) { - app->pointer_obj->input.pointer.wheel_diff++; - } - else if(diff < 0) { - app->pointer_obj->input.pointer.wheel_diff--; - } - } -} - -static const struct wl_pointer_listener pointer_listener = { - .enter = pointer_handle_enter, - .leave = pointer_handle_leave, - .motion = pointer_handle_motion, - .button = pointer_handle_button, - .axis = pointer_handle_axis, -}; - -static lv_key_t keycode_xkb_to_lv(xkb_keysym_t xkb_key) -{ - lv_key_t key = 0; - - if(((xkb_key >= XKB_KEY_space) && (xkb_key <= XKB_KEY_asciitilde))) { - key = xkb_key; - } - else if(((xkb_key >= XKB_KEY_KP_0) && (xkb_key <= XKB_KEY_KP_9))) { - key = (xkb_key & 0x003f); - } - else { - switch(xkb_key) { - case XKB_KEY_BackSpace: - key = LV_KEY_BACKSPACE; - break; - case XKB_KEY_Return: - case XKB_KEY_KP_Enter: - key = LV_KEY_ENTER; - break; - case XKB_KEY_Escape: - key = LV_KEY_ESC; - break; - case XKB_KEY_Delete: - case XKB_KEY_KP_Delete: - key = LV_KEY_DEL; - break; - case XKB_KEY_Home: - case XKB_KEY_KP_Home: - key = LV_KEY_HOME; - break; - case XKB_KEY_Left: - case XKB_KEY_KP_Left: - key = LV_KEY_LEFT; - break; - case XKB_KEY_Up: - case XKB_KEY_KP_Up: - key = LV_KEY_UP; - break; - case XKB_KEY_Right: - case XKB_KEY_KP_Right: - key = LV_KEY_RIGHT; - break; - case XKB_KEY_Down: - case XKB_KEY_KP_Down: - key = LV_KEY_DOWN; - break; - case XKB_KEY_Prior: - case XKB_KEY_KP_Prior: - key = LV_KEY_PREV; - break; - case XKB_KEY_Next: - case XKB_KEY_KP_Next: - case XKB_KEY_Tab: - case XKB_KEY_KP_Tab: - key = LV_KEY_NEXT; - break; - case XKB_KEY_End: - case XKB_KEY_KP_End: - key = LV_KEY_END; - break; - default: - break; - } - } - - return key; -} - -static void keyboard_handle_keymap(void * data, struct wl_keyboard * keyboard, - uint32_t format, int fd, uint32_t size) -{ - struct application * app = data; - - struct xkb_keymap * keymap; - struct xkb_state * state; - char * map_str; - - LV_UNUSED(keyboard); - - if(format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { - close(fd); - return; - } - - map_str = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); - if(map_str == MAP_FAILED) { - close(fd); - return; - } - - /* Set up XKB keymap */ - keymap = xkb_keymap_new_from_string(app->xkb_context, map_str, - XKB_KEYMAP_FORMAT_TEXT_V1, 0); - munmap(map_str, size); - close(fd); - - if(!keymap) { - LV_LOG_ERROR("failed to compile keymap"); - return; - } - - /* Set up XKB state */ - state = xkb_state_new(keymap); - if(!state) { - LV_LOG_ERROR("failed to create XKB state"); - xkb_keymap_unref(keymap); - return; - } - - xkb_keymap_unref(app->seat.xkb.keymap); - xkb_state_unref(app->seat.xkb.state); - app->seat.xkb.keymap = keymap; - app->seat.xkb.state = state; -} - -static void keyboard_handle_enter(void * data, struct wl_keyboard * keyboard, - uint32_t serial, struct wl_surface * surface, - struct wl_array * keys) -{ - struct application * app = data; - - LV_UNUSED(keyboard); - LV_UNUSED(serial); - LV_UNUSED(keys); - - if(!surface) { - app->keyboard_obj = NULL; - } - else { - app->keyboard_obj = wl_surface_get_user_data(surface); - } -} - -static void keyboard_handle_leave(void * data, struct wl_keyboard * keyboard, - uint32_t serial, struct wl_surface * surface) -{ - struct application * app = data; - - LV_UNUSED(serial); - LV_UNUSED(keyboard); - - if(!surface || (app->keyboard_obj == wl_surface_get_user_data(surface))) { - app->keyboard_obj = NULL; - } -} - -static void keyboard_handle_key(void * data, struct wl_keyboard * keyboard, - uint32_t serial, uint32_t time, uint32_t key, - uint32_t state) -{ - struct application * app = data; - const uint32_t code = (key + 8); - const xkb_keysym_t * syms; - xkb_keysym_t sym = XKB_KEY_NoSymbol; - - LV_UNUSED(serial); - LV_UNUSED(time); - LV_UNUSED(keyboard); - - if(!app->keyboard_obj || !app->seat.xkb.state) { - return; - } - - if(xkb_state_key_get_syms(app->seat.xkb.state, code, &syms) == 1) { - sym = syms[0]; - } - - const lv_key_t lv_key = keycode_xkb_to_lv(sym); - const lv_indev_state_t lv_state = - (state == WL_KEYBOARD_KEY_STATE_PRESSED) ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; - - if(lv_key != 0) { - app->keyboard_obj->input.keyboard.key = lv_key; - app->keyboard_obj->input.keyboard.state = lv_state; - } -} - -static void keyboard_handle_modifiers(void * data, struct wl_keyboard * keyboard, - uint32_t serial, uint32_t mods_depressed, - uint32_t mods_latched, uint32_t mods_locked, - uint32_t group) -{ - struct application * app = data; - - LV_UNUSED(serial); - LV_UNUSED(keyboard); - - /* If we're not using a keymap, then we don't handle PC-style modifiers */ - if(!app->seat.xkb.keymap) { - return; - } - - xkb_state_update_mask(app->seat.xkb.state, - mods_depressed, mods_latched, mods_locked, 0, 0, group); -} - -static const struct wl_keyboard_listener keyboard_listener = { - .keymap = keyboard_handle_keymap, - .enter = keyboard_handle_enter, - .leave = keyboard_handle_leave, - .key = keyboard_handle_key, - .modifiers = keyboard_handle_modifiers, -}; - -static void touch_handle_down(void * data, struct wl_touch * wl_touch, - uint32_t serial, uint32_t time, struct wl_surface * surface, - int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) -{ - struct application * app = data; - - LV_UNUSED(id); - LV_UNUSED(time); - LV_UNUSED(serial); - LV_UNUSED(wl_touch); - - if(!surface) { - app->touch_obj = NULL; - return; - } - - app->touch_obj = wl_surface_get_user_data(surface); - - app->touch_obj->input.touch.x = wl_fixed_to_int(x_w); - app->touch_obj->input.touch.y = wl_fixed_to_int(y_w); - app->touch_obj->input.touch.state = LV_INDEV_STATE_PRESSED; - -#if LV_WAYLAND_WINDOW_DECORATIONS - struct window * window = app->touch_obj->window; - switch(app->touch_obj->type) { - case OBJECT_TITLEBAR: -#if LV_WAYLAND_XDG_SHELL - if(window->xdg_toplevel) { - xdg_toplevel_move(window->xdg_toplevel, app->wl_seat, serial); - window->flush_pending = true; - } -#endif -#if LV_WAYLAND_WL_SHELL - if(window->wl_shell_surface) { - wl_shell_surface_move(window->wl_shell_surface, app->wl_seat, serial); - window->flush_pending = true; - } -#endif - break; - default: - break; - } -#endif -} - -static void touch_handle_up(void * data, struct wl_touch * wl_touch, - uint32_t serial, uint32_t time, int32_t id) -{ - struct application * app = data; - - LV_UNUSED(serial); - LV_UNUSED(time); - LV_UNUSED(id); - LV_UNUSED(wl_touch); - - if(!app->touch_obj) { - return; - } - - app->touch_obj->input.touch.state = LV_INDEV_STATE_RELEASED; - -#if LV_WAYLAND_WINDOW_DECORATIONS - struct window * window = app->touch_obj->window; - switch(app->touch_obj->type) { - case OBJECT_BUTTON_CLOSE: - window->shall_close = true; - break; -#if LV_WAYLAND_XDG_SHELL - case OBJECT_BUTTON_MAXIMIZE: - if(window->xdg_toplevel) { - if(window->maximized) { - xdg_toplevel_unset_maximized(window->xdg_toplevel); - } - else { - xdg_toplevel_set_maximized(window->xdg_toplevel); - } - window->maximized ^= true; - } - break; - case OBJECT_BUTTON_MINIMIZE: - if(window->xdg_toplevel) { - xdg_toplevel_set_minimized(window->xdg_toplevel); - window->flush_pending = true; - } -#endif // LV_WAYLAND_XDG_SHELL - default: - break; - } -#endif // LV_WAYLAND_WINDOW_DECORATIONS - - app->touch_obj = NULL; -} - -static void touch_handle_motion(void * data, struct wl_touch * wl_touch, - uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) -{ - struct application * app = data; - - LV_UNUSED(time); - LV_UNUSED(id); - LV_UNUSED(wl_touch); - - if(!app->touch_obj) { - return; - } - - app->touch_obj->input.touch.x = wl_fixed_to_int(x_w); - app->touch_obj->input.touch.y = wl_fixed_to_int(y_w); -} - -static void touch_handle_frame(void * data, struct wl_touch * wl_touch) -{ - LV_UNUSED(wl_touch); - LV_UNUSED(data); - -} - -static void touch_handle_cancel(void * data, struct wl_touch * wl_touch) -{ - LV_UNUSED(wl_touch); - LV_UNUSED(data); -} - -static const struct wl_touch_listener touch_listener = { - .down = touch_handle_down, - .up = touch_handle_up, - .motion = touch_handle_motion, - .frame = touch_handle_frame, - .cancel = touch_handle_cancel, -}; - -static void seat_handle_capabilities(void * data, struct wl_seat * wl_seat, enum wl_seat_capability caps) -{ - struct application * app = data; - struct seat * seat = &app->seat; - - if((caps & WL_SEAT_CAPABILITY_POINTER) && !seat->wl_pointer) { - seat->wl_pointer = wl_seat_get_pointer(wl_seat); - wl_pointer_add_listener(seat->wl_pointer, &pointer_listener, app); - app->cursor_surface = wl_compositor_create_surface(app->compositor); - if(!app->cursor_surface) { - LV_LOG_WARN("failed to create cursor surface"); - } - } - else if(!(caps & WL_SEAT_CAPABILITY_POINTER) && seat->wl_pointer) { - wl_pointer_destroy(seat->wl_pointer); - if(app->cursor_surface) { - wl_surface_destroy(app->cursor_surface); - } - seat->wl_pointer = NULL; - } - - if((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !seat->wl_keyboard) { - seat->wl_keyboard = wl_seat_get_keyboard(wl_seat); - wl_keyboard_add_listener(seat->wl_keyboard, &keyboard_listener, app); - } - else if(!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && seat->wl_keyboard) { - wl_keyboard_destroy(seat->wl_keyboard); - seat->wl_keyboard = NULL; - } - - if((caps & WL_SEAT_CAPABILITY_TOUCH) && !seat->wl_touch) { - seat->wl_touch = wl_seat_get_touch(wl_seat); - wl_touch_add_listener(seat->wl_touch, &touch_listener, app); - } - else if(!(caps & WL_SEAT_CAPABILITY_TOUCH) && seat->wl_touch) { - wl_touch_destroy(seat->wl_touch); - seat->wl_touch = NULL; - } -} - -static const struct wl_seat_listener seat_listener = { - .capabilities = seat_handle_capabilities, -}; - -static void draw_window(struct window * window, uint32_t width, uint32_t height) -{ - -#if LV_WAYLAND_WINDOW_DECORATIONS - if(application.opt_disable_decorations == false) { - int d; - for(d = 0; d < NUM_DECORATIONS; d++) { - window->decoration[d] = create_graphic_obj(&application, window, (FIRST_DECORATION + d), window->body); - if(!window->decoration[d]) { - LV_LOG_ERROR("Failed to create decoration %d", d); - } - } - } -#endif - - /* First resize */ - if(!resize_window(window, width, height)) { - LV_LOG_ERROR("Failed to resize window"); -#if LV_WAYLAND_XDG_SHELL - if(window->xdg_toplevel) { - xdg_toplevel_destroy(window->xdg_toplevel); - } -#endif - } - - lv_refr_now(window->lv_disp); - -} - -#if LV_WAYLAND_WL_SHELL -static void wl_shell_handle_ping(void * data, struct wl_shell_surface * shell_surface, uint32_t serial) -{ - return wl_shell_surface_pong(shell_surface, serial); -} - -static void wl_shell_handle_configure(void * data, struct wl_shell_surface * shell_surface, - uint32_t edges, int32_t width, int32_t height) -{ - struct window * window = (struct window *)data; - - LV_UNUSED(edges); - - if((width <= 0) || (height <= 0)) { - return; - } - else if((width != window->width) || (height != window->height)) { - window->resize_width = width; - window->resize_height = height; - window->resize_pending = true; - } -} - -static const struct wl_shell_surface_listener shell_surface_listener = { - .ping = wl_shell_handle_ping, - .configure = wl_shell_handle_configure, -}; -#endif - -#if LV_WAYLAND_XDG_SHELL -static void xdg_surface_handle_configure(void * data, struct xdg_surface * xdg_surface, uint32_t serial) -{ - struct window * window = (struct window *)data; - - xdg_surface_ack_configure(xdg_surface, serial); - - if(window->body->surface_configured == false) { - /* This branch is executed at launch */ - if(window->resize_pending == false) { - /* Use the size passed to the create_window function */ - draw_window(window, window->width, window->height); - } - else { - - /* Handle early maximization or fullscreen, */ - /* by using the size communicated by the compositor */ - /* when the initial xdg configure event arrives */ - draw_window(window, window->resize_width, window->resize_height); - window->width = window->resize_width; - window->height = window->resize_height; - window->resize_pending = false; - } - } - window->body->surface_configured = true; -} - -static const struct xdg_surface_listener xdg_surface_listener = { - .configure = xdg_surface_handle_configure, -}; - -static void xdg_toplevel_handle_configure(void * data, struct xdg_toplevel * xdg_toplevel, - int32_t width, int32_t height, struct wl_array * states) -{ - struct window * window = (struct window *)data; - - LV_UNUSED(xdg_toplevel); - LV_UNUSED(states); - LV_UNUSED(width); - LV_UNUSED(height); - - LV_LOG_TRACE("w:%d h:%d", width, height); - LV_LOG_TRACE("current body w:%d h:%d", window->body->width, window->body->height); - LV_LOG_TRACE("window w:%d h:%d", window->width, window->height); - - - if((width <= 0) || (height <= 0)) { - LV_LOG_TRACE("will not resize to w:%d h:%d", width, height); - return; - } - - if((width != window->width) || (height != window->height)) { - window->resize_width = width; - window->resize_height = height; - window->resize_pending = true; - LV_LOG_TRACE("resize_pending is set, will resize to w:%d h:%d", width, height); - } - else { - LV_LOG_TRACE("resize_pending not set w:%d h:%d", width, height); - } -} - -static void xdg_toplevel_handle_close(void * data, struct xdg_toplevel * xdg_toplevel) -{ - struct window * window = (struct window *)data; - window->shall_close = true; - - LV_UNUSED(xdg_toplevel); -} - -static void xdg_toplevel_handle_configure_bounds(void * data, struct xdg_toplevel * xdg_toplevel, - int32_t width, int32_t height) -{ - - LV_UNUSED(width); - LV_UNUSED(height); - LV_UNUSED(data); - LV_UNUSED(xdg_toplevel); - - /* Optional: Could set window width/height upper bounds, however, currently - * we'll honor the set width/height. - */ -} - -static const struct xdg_toplevel_listener xdg_toplevel_listener = { - .configure = xdg_toplevel_handle_configure, - .close = xdg_toplevel_handle_close, - .configure_bounds = xdg_toplevel_handle_configure_bounds -}; - -static void xdg_wm_base_ping(void * data, struct xdg_wm_base * xdg_wm_base, uint32_t serial) -{ - LV_UNUSED(data); - - xdg_wm_base_pong(xdg_wm_base, serial); - - return; -} - -static const struct xdg_wm_base_listener xdg_wm_base_listener = { - .ping = xdg_wm_base_ping -}; -#endif - - -static void handle_global(void * data, struct wl_registry * registry, - uint32_t name, const char * interface, uint32_t version) -{ - struct application * app = data; - - LV_UNUSED(version); - LV_UNUSED(data); - - if(strcmp(interface, wl_compositor_interface.name) == 0) { - app->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); - } - else if(strcmp(interface, wl_subcompositor_interface.name) == 0) { - app->subcompositor = wl_registry_bind(registry, name, &wl_subcompositor_interface, 1); - } - else if(strcmp(interface, wl_shm_interface.name) == 0) { - app->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); - wl_shm_add_listener(app->shm, &shm_listener, app); - app->cursor_theme = wl_cursor_theme_load(NULL, 32, app->shm); - } - else if(strcmp(interface, wl_seat_interface.name) == 0) { - app->wl_seat = wl_registry_bind(app->registry, name, &wl_seat_interface, 1); - wl_seat_add_listener(app->wl_seat, &seat_listener, app); - } -#if LV_WAYLAND_WL_SHELL - else if(strcmp(interface, wl_shell_interface.name) == 0) { - app->wl_shell = wl_registry_bind(registry, name, &wl_shell_interface, 1); - } -#endif -#if LV_WAYLAND_XDG_SHELL - else if(strcmp(interface, xdg_wm_base_interface.name) == 0) { - /* Explicitly support version 4 of the xdg protocol */ - app->xdg_wm = wl_registry_bind(app->registry, name, &xdg_wm_base_interface, 4); - xdg_wm_base_add_listener(app->xdg_wm, &xdg_wm_base_listener, app); - } -#endif -} - -static void handle_global_remove(void * data, struct wl_registry * registry, uint32_t name) -{ - - LV_UNUSED(data); - LV_UNUSED(registry); - LV_UNUSED(name); - -} - -static const struct wl_registry_listener registry_listener = { - .global = handle_global, - .global_remove = handle_global_remove -}; - -static void handle_wl_buffer_release(void * data, struct wl_buffer * wl_buffer) -{ - const struct smm_buffer_properties * props; - struct graphic_object * obj; - struct window * window; - smm_buffer_t * buf; - - buf = (smm_buffer_t *)data; - props = SMM_BUFFER_PROPERTIES(buf); - obj = SMM_GROUP_PROPERTIES(props->group)->tag[TAG_LOCAL]; - window = obj->window; - - LV_LOG_TRACE("releasing buffer %p wl_buffer %p w:%d h:%d frame: %d", (smm_buffer_t *)data, (void *)wl_buffer, - obj->width, - obj->height, window->frame_counter); - smm_release((smm_buffer_t *)data); -} - -static const struct wl_buffer_listener wl_buffer_listener = { - .release = handle_wl_buffer_release, -}; - -static void cache_clear(struct window * window) -{ - window->dmg_cache.start = window->dmg_cache.end; - window->dmg_cache.size = 0; -} - -static void cache_purge(struct window * window, smm_buffer_t * buf) -{ - lv_area_t * next_dmg; - smm_buffer_t * next_buf = smm_next(buf); - - /* Remove all damage areas up until start of next buffers damage */ - if(next_buf == NULL) { - cache_clear(window); - } - else { - next_dmg = SMM_BUFFER_PROPERTIES(next_buf)->tag[TAG_BUFFER_DAMAGE]; - while((window->dmg_cache.cache + window->dmg_cache.start) != next_dmg) { - window->dmg_cache.start++; - window->dmg_cache.start %= DMG_CACHE_CAPACITY; - window->dmg_cache.size--; - } - } -} - -static void cache_add_area(struct window * window, smm_buffer_t * buf, const lv_area_t * area) -{ - if(SMM_BUFFER_PROPERTIES(buf)->tag[TAG_BUFFER_DAMAGE] == NULL) { - /* Buffer damage beyond cache capacity */ - goto done; - } - - if((window->dmg_cache.start == window->dmg_cache.end) && - (window->dmg_cache.size)) { - /* This buffer has more damage then the cache's capacity, so - * clear cache and leave buffer damage unrecorded - */ - cache_clear(window); - SMM_TAG(buf, TAG_BUFFER_DAMAGE, NULL); - goto done; - } - - /* Add damage area to cache */ - memcpy(window->dmg_cache.cache + window->dmg_cache.end, - area, - sizeof(lv_area_t)); - window->dmg_cache.end++; - window->dmg_cache.end %= DMG_CACHE_CAPACITY; - window->dmg_cache.size++; - -done: - return; -} - -static void cache_apply_areas(struct window * window, void * dest, void * src, smm_buffer_t * src_buf) -{ - unsigned long offset; - unsigned char start; - int32_t y; - lv_area_t * dmg; - lv_area_t * next_dmg; - smm_buffer_t * next_buf = smm_next(src_buf); - const struct smm_buffer_properties * props = SMM_BUFFER_PROPERTIES(src_buf); - struct graphic_object * obj = SMM_GROUP_PROPERTIES(props->group)->tag[TAG_LOCAL]; - uint8_t bpp; - - if(next_buf == NULL) { - next_dmg = (window->dmg_cache.cache + window->dmg_cache.end); - } - else { - next_dmg = SMM_BUFFER_PROPERTIES(next_buf)->tag[TAG_BUFFER_DAMAGE]; - } - - bpp = lv_color_format_get_size(LV_COLOR_FORMAT_NATIVE); - - /* Apply all buffer damage areas */ - start = ((lv_area_t *)SMM_BUFFER_PROPERTIES(src_buf)->tag[TAG_BUFFER_DAMAGE] - window->dmg_cache.cache); - while((window->dmg_cache.cache + start) != next_dmg) { - /* Copy an area from source to destination (line-by-line) */ - dmg = (window->dmg_cache.cache + start); - for(y = dmg->y1; y <= dmg->y2; y++) { - offset = (dmg->x1 + (y * obj->width)) * bpp; - - memcpy(((char *)dest) + offset, - ((char *)src) + offset, - ((dmg->x2 - dmg->x1 + 1) * bpp)); - } - - - start++; - start %= DMG_CACHE_CAPACITY; - } - -} - -static bool sme_new_pool(void * ctx, smm_pool_t * pool) -{ - struct wl_shm_pool * wl_pool; - struct application * app = ctx; - const struct smm_pool_properties * props = SMM_POOL_PROPERTIES(pool); - - LV_UNUSED(ctx); - - wl_pool = wl_shm_create_pool(app->shm, - props->fd, - props->size); - - SMM_TAG(pool, TAG_LOCAL, wl_pool); - return (wl_pool == NULL); -} - -static void sme_expand_pool(void * ctx, smm_pool_t * pool) -{ - const struct smm_pool_properties * props = SMM_POOL_PROPERTIES(pool); - - LV_UNUSED(ctx); - - wl_shm_pool_resize(props->tag[TAG_LOCAL], props->size); -} - -static void sme_free_pool(void * ctx, smm_pool_t * pool) -{ - struct wl_shm_pool * wl_pool = SMM_POOL_PROPERTIES(pool)->tag[TAG_LOCAL]; - - LV_UNUSED(ctx); - - wl_shm_pool_destroy(wl_pool); -} - -static bool sme_new_buffer(void * ctx, smm_buffer_t * buf) -{ - struct wl_buffer * wl_buf; - bool fail_alloc = true; - const struct smm_buffer_properties * props = SMM_BUFFER_PROPERTIES(buf); - struct wl_shm_pool * wl_pool = SMM_POOL_PROPERTIES(props->pool)->tag[TAG_LOCAL]; - struct application * app = ctx; - struct graphic_object * obj = SMM_GROUP_PROPERTIES(props->group)->tag[TAG_LOCAL]; - uint8_t bpp; - - LV_LOG_TRACE("create new buffer of width %d height %d", obj->width, obj->height); - - bpp = lv_color_format_get_size(LV_COLOR_FORMAT_NATIVE); - wl_buf = wl_shm_pool_create_buffer(wl_pool, - props->offset, - obj->width, - obj->height, - obj->width * bpp, - app->shm_format); - - if(wl_buf != NULL) { - wl_buffer_add_listener(wl_buf, &wl_buffer_listener, buf); - SMM_TAG(buf, TAG_LOCAL, wl_buf); - SMM_TAG(buf, TAG_BUFFER_DAMAGE, NULL); - fail_alloc = false; - } - - return fail_alloc; -} - -static bool sme_init_buffer(void * ctx, smm_buffer_t * buf) -{ - smm_buffer_t * src; - void * src_base; - bool fail_init = true; - bool dmg_missing = false; - void * buf_base = smm_map(buf); - const struct smm_buffer_properties * props = SMM_BUFFER_PROPERTIES(buf); - struct graphic_object * obj = SMM_GROUP_PROPERTIES(props->group)->tag[TAG_LOCAL]; - uint8_t bpp; - - LV_UNUSED(ctx); - - if(buf_base == NULL) { - LV_LOG_ERROR("cannot map in buffer to initialize"); - goto done; - } - - /* Determine if all subsequent buffers damage is recorded */ - for(src = smm_next(buf); src != NULL; src = smm_next(src)) { - if(SMM_BUFFER_PROPERTIES(src)->tag[TAG_BUFFER_DAMAGE] == NULL) { - dmg_missing = true; - break; - } - } - - bpp = lv_color_format_get_size(LV_COLOR_FORMAT_NATIVE); - - if((smm_next(buf) == NULL) || dmg_missing) { - /* Missing subsequent buffer damage, initialize by copying the most - * recently acquired buffers data - */ - src = smm_latest(props->group); - if((src != NULL) && - (src != buf)) { - /* Map and copy latest buffer data */ - src_base = smm_map(src); - if(src_base == NULL) { - LV_LOG_ERROR("cannot map most recent buffer to copy"); - goto done; - } - - memcpy(buf_base, - src_base, - (obj->width * bpp) * obj->height); - } - } - else { - /* All subsequent buffers damage is recorded, initialize by applying - * their damage to this buffer - */ - for(src = smm_next(buf); src != NULL; src = smm_next(src)) { - src_base = smm_map(src); - if(src_base == NULL) { - LV_LOG_ERROR("cannot map source buffer to copy from"); - goto done; - } - - cache_apply_areas(obj->window, buf_base, src_base, src); - } - - /* Purge out-of-date cached damage (up to and including next buffer) */ - src = smm_next(buf); - if(src == NULL) { - cache_purge(obj->window, src); - } - } - - fail_init = false; -done: - return fail_init; -} - -static void sme_free_buffer(void * ctx, smm_buffer_t * buf) -{ - struct wl_buffer * wl_buf = SMM_BUFFER_PROPERTIES(buf)->tag[TAG_LOCAL]; - - LV_UNUSED(ctx); - - wl_buffer_destroy(wl_buf); -} - -static struct graphic_object * create_graphic_obj(struct application * app, struct window * window, - enum object_type type, - struct graphic_object * parent) -{ - struct graphic_object * obj; - - LV_UNUSED(parent); - - obj = lv_malloc(sizeof(*obj)); - LV_ASSERT_MALLOC(obj); - if(!obj) { - goto err_out; - } - - lv_memset(obj, 0x00, sizeof(struct graphic_object)); - - obj->surface = wl_compositor_create_surface(app->compositor); - if(!obj->surface) { - LV_LOG_ERROR("cannot create surface for graphic object"); - goto err_free; - } - - obj->buffer_group = smm_create(); - if(obj->buffer_group == NULL) { - LV_LOG_ERROR("cannot create buffer group for graphic object"); - goto err_destroy_surface; - } - - obj->window = window; - obj->type = type; - obj->surface_configured = true; - obj->pending_buffer = NULL; - wl_surface_set_user_data(obj->surface, obj); - SMM_TAG(obj->buffer_group, TAG_LOCAL, obj); - - return obj; - -err_destroy_surface: - wl_surface_destroy(obj->surface); - -err_free: - lv_free(obj); - -err_out: - return NULL; -} - -static void destroy_graphic_obj(struct graphic_object * obj) -{ - if(obj->subsurface) { - wl_subsurface_destroy(obj->subsurface); - } - - wl_surface_destroy(obj->surface); - smm_destroy(obj->buffer_group); - lv_free(obj); -} - -#if LV_WAYLAND_WINDOW_DECORATIONS -static bool attach_decoration(struct window * window, struct graphic_object * decoration, - smm_buffer_t * decoration_buffer, struct graphic_object * parent) -{ - struct wl_buffer * wl_buf = SMM_BUFFER_PROPERTIES(decoration_buffer)->tag[TAG_LOCAL]; - - int pos_x, pos_y; - - switch(decoration->type) { - case OBJECT_TITLEBAR: - pos_x = 0; - pos_y = -TITLE_BAR_HEIGHT; - break; - case OBJECT_BUTTON_CLOSE: - pos_x = parent->width - 1 * (BUTTON_MARGIN + BUTTON_SIZE); - pos_y = -1 * (BUTTON_MARGIN + BUTTON_SIZE + (BORDER_SIZE / 2)); - break; -#if LV_WAYLAND_XDG_SHELL - case OBJECT_BUTTON_MAXIMIZE: - pos_x = parent->width - 2 * (BUTTON_MARGIN + BUTTON_SIZE); - pos_y = -1 * (BUTTON_MARGIN + BUTTON_SIZE + (BORDER_SIZE / 2)); - break; - case OBJECT_BUTTON_MINIMIZE: - pos_x = parent->width - 3 * (BUTTON_MARGIN + BUTTON_SIZE); - pos_y = -1 * (BUTTON_MARGIN + BUTTON_SIZE + (BORDER_SIZE / 2)); - break; -#endif - case OBJECT_BORDER_TOP: - pos_x = -BORDER_SIZE; - pos_y = -(BORDER_SIZE + TITLE_BAR_HEIGHT); - break; - case OBJECT_BORDER_BOTTOM: - pos_x = -BORDER_SIZE; - pos_y = parent->height; - break; - case OBJECT_BORDER_LEFT: - pos_x = -BORDER_SIZE; - pos_y = -TITLE_BAR_HEIGHT; - break; - case OBJECT_BORDER_RIGHT: - pos_x = parent->width; - pos_y = -TITLE_BAR_HEIGHT; - break; - default: - LV_ASSERT_MSG(0, "Invalid object type"); - return false; - } - - /* Enable this, to make it function on weston 10.0.2 */ - /* It's not elegant but it forces weston to size the surfaces before */ - /* the conversion to a subsurface takes place */ - - /* Likely related to this issue, some patches were merged into 10.0.0 */ - /* https://gitlab.freedesktop.org/wayland/weston/-/issues/446 */ - /* Moreover, it crashes on GNOME */ - -#if 0 - wl_surface_attach(decoration->surface, wl_buf, 0, 0); - wl_surface_commit(decoration->surface); -#endif - - if(decoration->subsurface == NULL) { - /* Create the subsurface only once */ - - decoration->subsurface = wl_subcompositor_get_subsurface(window->application->subcompositor, - decoration->surface, - parent->surface); - if(!decoration->subsurface) { - LV_LOG_ERROR("cannot get subsurface for decoration"); - goto err_destroy_surface; - } - } - - wl_subsurface_set_position(decoration->subsurface, pos_x, pos_y); - wl_surface_attach(decoration->surface, wl_buf, 0, 0); - wl_surface_commit(decoration->surface); - - return true; - -err_destroy_surface: - wl_surface_destroy(decoration->surface); - decoration->surface = NULL; - - return false; -} - -/* - * Fills a buffer with a color - * @description Used to draw the decorations, by writing directly to the SHM buffer, - * most wayland compositors support the ARGB8888, XRGB8888, RGB565 formats - * - * For color depths usually not natively supported by wayland i.e RGB332, Grayscale - * A conversion is performed to match the format of the SHM buffer read by the compositor. - * - * This function can also be used as a visual debugging aid to see how damage is applied - * - * @param pixels pointer to the buffer to fill - * @param lv_color_t color the color that will be used for the fill - * @param width width of the filled area - * @param height height of the filled area - * - */ -static void color_fill(void * pixels, lv_color_t color, uint32_t width, uint32_t height) -{ - - switch(application.shm_format) { - case WL_SHM_FORMAT_ARGB8888: - color_fill_XRGB8888(pixels, color, width, height); - break; - case WL_SHM_FORMAT_RGB565: - color_fill_RGB565(pixels, color, width, height); - break; - default: - LV_ASSERT_MSG(0, "Unsupported WL_SHM_FORMAT"); - break; - } -} - -static void color_fill_XRGB8888(void * pixels, lv_color_t color, uint32_t width, uint32_t height) -{ - unsigned char * buf = pixels; - unsigned char * buf_end; - - buf_end = (unsigned char *)((uint32_t *)buf + width * height); - - while(buf < buf_end) { - *(buf++) = color.blue; - *(buf++) = color.green; - *(buf++) = color.red; - *(buf++) = 0xFF; - } - -} - -static void color_fill_RGB565(void * pixels, lv_color_t color, uint32_t width, uint32_t height) -{ - uint16_t * buf = pixels; - uint16_t * buf_end; - - buf_end = (uint16_t *)buf + width * height; - - while(buf < buf_end) { - *(buf++) = lv_color_to_u16(color); - } -} - -static bool create_decoration(struct window * window, - struct graphic_object * decoration, - int window_width, int window_height) -{ - smm_buffer_t * buf; - void * buf_base; - int x, y; - lv_color_t * pixel; - uint8_t bpp; - - switch(decoration->type) { - case OBJECT_TITLEBAR: - decoration->width = window_width; - decoration->height = TITLE_BAR_HEIGHT; - break; - case OBJECT_BUTTON_CLOSE: - decoration->width = BUTTON_SIZE; - decoration->height = BUTTON_SIZE; - break; -#if LV_WAYLAND_XDG_SHELL - case OBJECT_BUTTON_MAXIMIZE: - decoration->width = BUTTON_SIZE; - decoration->height = BUTTON_SIZE; - break; - case OBJECT_BUTTON_MINIMIZE: - decoration->width = BUTTON_SIZE; - decoration->height = BUTTON_SIZE; - break; -#endif - case OBJECT_BORDER_TOP: - decoration->width = window_width + 2 * (BORDER_SIZE); - decoration->height = BORDER_SIZE; - break; - case OBJECT_BORDER_BOTTOM: - decoration->width = window_width + 2 * (BORDER_SIZE); - decoration->height = BORDER_SIZE; - break; - case OBJECT_BORDER_LEFT: - decoration->width = BORDER_SIZE; - decoration->height = window_height + TITLE_BAR_HEIGHT; - break; - case OBJECT_BORDER_RIGHT: - decoration->width = BORDER_SIZE; - decoration->height = window_height + TITLE_BAR_HEIGHT; - break; - default: - LV_ASSERT_MSG(0, "Invalid object type"); - return false; - } - - bpp = lv_color_format_get_size(LV_COLOR_FORMAT_NATIVE); - - LV_LOG_TRACE("decoration window %dx%d", decoration->width, decoration->height); - - smm_resize(decoration->buffer_group, - (decoration->width * bpp) * decoration->height); - - buf = smm_acquire(decoration->buffer_group); - - if(buf == NULL) { - LV_LOG_ERROR("cannot allocate buffer for decoration"); - return false; - } - - buf_base = smm_map(buf); - if(buf_base == NULL) { - LV_LOG_ERROR("cannot map in allocated decoration buffer"); - smm_release(buf); - return false; - } - - switch(decoration->type) { - case OBJECT_TITLEBAR: - color_fill(buf_base, lv_color_make(0x66, 0x66, 0x66), decoration->width, decoration->height); - break; - case OBJECT_BUTTON_CLOSE: - color_fill(buf_base, lv_color_make(0xCC, 0xCC, 0xCC), decoration->width, decoration->height); - for(y = 0; y < decoration->height; y++) { - for(x = 0; x < decoration->width; x++) { - pixel = (lv_color_t *)((unsigned char *)buf_base + (y * (decoration->width * bpp)) + x * bpp); - if((x >= BUTTON_PADDING) && (x < decoration->width - BUTTON_PADDING)) { - if((x == y) || (x == decoration->width - 1 - y)) { - color_fill(pixel, lv_color_make(0x33, 0x33, 0x33), 1, 1); - } - else if((x == y - 1) || (x == decoration->width - y)) { - color_fill(pixel, lv_color_make(0x66, 0x66, 0x66), 1, 1); - } - } - } - } - break; -#if LV_WAYLAND_XDG_SHELL - case OBJECT_BUTTON_MAXIMIZE: - color_fill(buf_base, lv_color_make(0xCC, 0xCC, 0xCC), decoration->width, decoration->height); - for(y = 0; y < decoration->height; y++) { - for(x = 0; x < decoration->width; x++) { - pixel = (lv_color_t *)((unsigned char *)buf_base + (y * (decoration->width * bpp)) + x * bpp); - if(((x == BUTTON_PADDING) && (y >= BUTTON_PADDING) && (y < decoration->height - BUTTON_PADDING)) || - ((x == (decoration->width - BUTTON_PADDING)) && (y >= BUTTON_PADDING) && (y <= decoration->height - BUTTON_PADDING)) || - ((y == BUTTON_PADDING) && (x >= BUTTON_PADDING) && (x < decoration->width - BUTTON_PADDING)) || - ((y == (BUTTON_PADDING + 1)) && (x >= BUTTON_PADDING) && (x < decoration->width - BUTTON_PADDING)) || - ((y == (decoration->height - BUTTON_PADDING)) && (x >= BUTTON_PADDING) && (x < decoration->width - BUTTON_PADDING))) { - color_fill(pixel, lv_color_make(0x33, 0x33, 0x33), 1, 1); - } - } - } - break; - case OBJECT_BUTTON_MINIMIZE: - color_fill(buf_base, lv_color_make(0xCC, 0xCC, 0xCC), decoration->width, decoration->height); - for(y = 0; y < decoration->height; y++) { - for(x = 0; x < decoration->width; x++) { - pixel = (lv_color_t *)((unsigned char *)buf_base + (y * (decoration->width * bpp)) + x * bpp); - if((x >= BUTTON_PADDING) && (x < decoration->width - BUTTON_PADDING) && - (y > decoration->height - (2 * BUTTON_PADDING)) && (y < decoration->height - BUTTON_PADDING)) { - color_fill(pixel, lv_color_make(0x33, 0x33, 0x33), 1, 1); - } - } - } - break; -#endif - case OBJECT_BORDER_TOP: - /* fallthrough */ - case OBJECT_BORDER_BOTTOM: - /* fallthrough */ - case OBJECT_BORDER_LEFT: - /* fallthrough */ - case OBJECT_BORDER_RIGHT: - color_fill(buf_base, lv_color_make(0x66, 0x66, 0x66), decoration->width, decoration->height); - break; - default: - LV_ASSERT_MSG(0, "Invalid object type"); - return false; - } - - return attach_decoration(window, decoration, buf, window->body); -} - -static void detach_decoration(struct window * window, - struct graphic_object * decoration) -{ - - LV_UNUSED(window); - - if(decoration->subsurface) { - wl_subsurface_destroy(decoration->subsurface); - decoration->subsurface = NULL; - } -} -#endif - -static bool resize_window(struct window * window, int width, int height) -{ - struct smm_buffer_t * body_buf1; - struct smm_buffer_t * body_buf2; - uint32_t stride; - uint8_t bpp; -#if LV_WAYLAND_WINDOW_DECORATIONS - int b; -#endif - - - window->width = width; - window->height = height; - -#if LV_WAYLAND_WINDOW_DECORATIONS - if(!window->application->opt_disable_decorations && !window->fullscreen) { - width -= (2 * BORDER_SIZE); - height -= (TITLE_BAR_HEIGHT + (2 * BORDER_SIZE)); - } -#endif - - bpp = lv_color_format_get_size(LV_COLOR_FORMAT_NATIVE); - - /* Update size for newly allocated buffers */ - smm_resize(window->body->buffer_group, ((width * bpp) * height) * 2); - - window->body->width = width; - window->body->height = height; - - /* Pre-allocate two buffers for the window body here */ - body_buf1 = smm_acquire(window->body->buffer_group); - body_buf2 = smm_acquire(window->body->buffer_group); - - if(smm_map(body_buf2) == NULL) { - LV_LOG_ERROR("Cannot pre-allocate backing buffers for window body"); - wl_surface_destroy(window->body->surface); - return false; - } - - /* Moves the buffers to the the unused list of the group */ - smm_release(body_buf1); - smm_release(body_buf2); - - -#if LV_WAYLAND_WINDOW_DECORATIONS - if(!window->application->opt_disable_decorations && !window->fullscreen) { - for(b = 0; b < NUM_DECORATIONS; b++) { - if(!create_decoration(window, window->decoration[b], - window->body->width, window->body->height)) { - LV_LOG_ERROR("failed to create decoration %d", b); - } - } - - } - else if(!window->application->opt_disable_decorations) { - /* Entering fullscreen, detach decorations to prevent xdg_wm_base error 4 */ - /* requested geometry larger than the configured fullscreen state */ - for(b = 0; b < NUM_DECORATIONS; b++) { - detach_decoration(window, window->decoration[b]); - } - - } -#endif - - LV_LOG_TRACE("resize window:%dx%d body:%dx%d frame: %d rendered: %d", - window->width, window->height, - window->body->width, window->body->height, - window->frame_counter, window->frame_done); - - width = window->body->width; - height = window->body->height; - - if(window->lv_disp != NULL) { - /* Resize draw buffer */ - stride = lv_draw_buf_width_to_stride(width, - lv_display_get_color_format(window->lv_disp)); - - window->lv_disp_draw_buf = lv_draw_buf_reshape( - window->lv_disp_draw_buf, - lv_display_get_color_format(window->lv_disp), - width, height / LVGL_DRAW_BUFFER_DIV, stride); - - lv_display_set_resolution(window->lv_disp, width, height); - - window->body->input.pointer.x = LV_MIN((int32_t)window->body->input.pointer.x, (width - 1)); - window->body->input.pointer.y = LV_MIN((int32_t)window->body->input.pointer.y, (height - 1)); - } - - return true; -} - -/* Create a window - * @description Creates the graphical context for the window body, and then create a toplevel - * wayland surface and commit it to obtain an XDG configuration event - * @param width the height of the window w/decorations - * @param height the width of the window w/decorations -*/ -static struct window * create_window(struct application * app, int width, int height, const char * title) -{ - struct window * window; - - window = lv_ll_ins_tail(&app->window_ll); - LV_ASSERT_MALLOC(window); - if(!window) { - return NULL; - } - - lv_memset(window, 0x00, sizeof(struct window)); - - window->application = app; - - // Create wayland buffer and surface - window->body = create_graphic_obj(app, window, OBJECT_WINDOW, NULL); - window->width = width; - window->height = height; - - if(!window->body) { - LV_LOG_ERROR("cannot create window body"); - goto err_free_window; - } - - // Create shell surface - if(0) { - // Needed for #if madness below - } -#if LV_WAYLAND_XDG_SHELL - else if(app->xdg_wm) { - window->xdg_surface = xdg_wm_base_get_xdg_surface(app->xdg_wm, window->body->surface); - if(!window->xdg_surface) { - LV_LOG_ERROR("cannot create XDG surface"); - goto err_destroy_surface; - } - - xdg_surface_add_listener(window->xdg_surface, &xdg_surface_listener, window); - - window->xdg_toplevel = xdg_surface_get_toplevel(window->xdg_surface); - if(!window->xdg_toplevel) { - LV_LOG_ERROR("cannot get XDG toplevel surface"); - goto err_destroy_shell_surface; - } - - xdg_toplevel_add_listener(window->xdg_toplevel, &xdg_toplevel_listener, window); - xdg_toplevel_set_title(window->xdg_toplevel, title); - xdg_toplevel_set_app_id(window->xdg_toplevel, title); - - // XDG surfaces need to be configured before a buffer can be attached. - // An (XDG) surface commit (without an attached buffer) triggers this - // configure event - window->body->surface_configured = false; - } -#endif -#if LV_WAYLAND_WL_SHELL - else if(app->wl_shell) { - window->wl_shell_surface = wl_shell_get_shell_surface(app->wl_shell, window->body->surface); - if(!window->wl_shell_surface) { - LV_LOG_ERROR("cannot create WL shell surface"); - goto err_destroy_surface; - } - - wl_shell_surface_add_listener(window->wl_shell_surface, &shell_surface_listener, window); - wl_shell_surface_set_toplevel(window->wl_shell_surface); - wl_shell_surface_set_title(window->wl_shell_surface, title); - - /* For wl_shell, just draw the window, weston doesn't send it */ - draw_window(window, window->width, window->height); - } -#endif - else { - LV_LOG_ERROR("No shell available"); - goto err_destroy_surface; - } - - - return window; - -err_destroy_shell_surface: -#if LV_WAYLAND_WL_SHELL - if(window->wl_shell_surface) { - wl_shell_surface_destroy(window->wl_shell_surface); - } -#endif -#if LV_WAYLAND_XDG_SHELL - if(window->xdg_surface) { - xdg_surface_destroy(window->xdg_surface); - } -#endif - -err_destroy_surface: - wl_surface_destroy(window->body->surface); - -err_free_window: - lv_ll_remove(&app->window_ll, window); - lv_free(window); - return NULL; -} - -static void destroy_window(struct window * window) -{ - if(!window) { - return; - } - -#if LV_WAYLAND_WL_SHELL - if(window->wl_shell_surface) { - wl_shell_surface_destroy(window->wl_shell_surface); - } -#endif -#if LV_WAYLAND_XDG_SHELL - if(window->xdg_toplevel) { - xdg_toplevel_destroy(window->xdg_toplevel); - xdg_surface_destroy(window->xdg_surface); - } -#endif - -#if LV_WAYLAND_WINDOW_DECORATIONS - int b; - for(b = 0; b < NUM_DECORATIONS; b++) { - if(window->decoration[b]) { - destroy_graphic_obj(window->decoration[b]); - window->decoration[b] = NULL; - } - } -#endif - - destroy_graphic_obj(window->body); -} - -static void _lv_wayland_flush(lv_display_t * disp, const lv_area_t * area, unsigned char * color_p) -{ - unsigned long offset; - void * buf_base; - struct wl_buffer * wl_buf; - uint32_t src_width; - uint32_t src_height; - struct window * window; - smm_buffer_t * buf; - struct wl_callback * cb; - lv_display_rotation_t rot; - uint8_t bpp; - int32_t y; - int32_t w; - int32_t h; - int32_t hres; - int32_t vres; - - window = lv_display_get_user_data(disp); - buf = window->body->pending_buffer; - src_width = (area->x2 - area->x1 + 1); - src_height = (area->y2 - area->y1 + 1); - bpp = lv_color_format_get_size(LV_COLOR_FORMAT_NATIVE); - - rot = lv_display_get_rotation(disp); - w = lv_display_get_horizontal_resolution(disp); - h = lv_display_get_vertical_resolution(disp); - - /* TODO actually test what happens if the rotation is 90 or 270 or 180 ? */ - hres = (rot == LV_DISPLAY_ROTATION_0) ? w : h; - vres = (rot == LV_DISPLAY_ROTATION_0) ? h : w; - - /* If window has been / is being closed, or is not visible, skip flush */ - if(window->closed || window->shall_close) { - goto skip; - } - /* Skip if the area is out the screen */ - else if((area->x2 < 0) || (area->y2 < 0) || (area->x1 > hres - 1) || (area->y1 > vres - 1)) { - goto skip; - } - - /* Acquire and map a buffer to attach/commit to surface */ - if(buf == NULL) { - buf = smm_acquire(window->body->buffer_group); - if(buf == NULL) { - LV_LOG_ERROR("cannot acquire a window body buffer"); - goto skip; - } - - window->body->pending_buffer = buf; - SMM_TAG(buf, - TAG_BUFFER_DAMAGE, - window->dmg_cache.cache + window->dmg_cache.end); - } - - buf_base = smm_map(buf); - if(buf_base == NULL) { - LV_LOG_ERROR("cannot map in window body buffer"); - goto skip; - } - - /* Modify specified area in buffer */ - for(y = area->y1; y <= area->y2; y++) { - offset = ((area->x1 + (y * hres)) * bpp); - memcpy(((char *)buf_base) + offset, - color_p, - src_width * bpp); - color_p += src_width * bpp; - } - - /* Mark surface damage */ - wl_surface_damage(window->body->surface, - area->x1, - area->y1, - src_width, - src_height); - - cache_add_area(window, buf, area); - - - if(lv_display_flush_is_last(disp)) { - /* Finally, attach buffer and commit to surface */ - wl_buf = SMM_BUFFER_PROPERTIES(buf)->tag[TAG_LOCAL]; - wl_surface_attach(window->body->surface, wl_buf, 0, 0); - wl_surface_commit(window->body->surface); - window->body->pending_buffer = NULL; - window->frame_done = false; - - cb = wl_surface_frame(window->body->surface); - wl_callback_add_listener(cb, &wl_surface_frame_listener, window->body); - LV_LOG_TRACE("last flush frame: %d", window->frame_counter); - - window->flush_pending = true; - } - - lv_display_flush_ready(disp); - return; -skip: - if(buf != NULL) { - /* Cleanup any intermediate state (in the event that this flush being - * skipped is in the middle of a flush sequence) - */ - cache_clear(window); - SMM_TAG(buf, TAG_BUFFER_DAMAGE, NULL); - smm_release(buf); - window->body->pending_buffer = NULL; - } -} - -static void _lv_wayland_handle_input(void) -{ - int prepare_read = wl_display_prepare_read(application.display); - while(prepare_read != 0) { - wl_display_dispatch_pending(application.display); - } - - wl_display_read_events(application.display); - wl_display_dispatch_pending(application.display); -} - -static void _lv_wayland_handle_output(void) -{ - struct window * window; - bool shall_flush = application.cursor_flush_pending; - - LV_LL_READ(&application.window_ll, window) { - if((window->shall_close) && (window->close_cb != NULL)) { - window->shall_close = window->close_cb(window->lv_disp); - } - - if(window->closed) { - continue; - } - else if(window->shall_close) { - window->closed = true; - window->shall_close = false; - shall_flush = true; - - window->body->input.touch.x = 0; - window->body->input.touch.y = 0; - window->body->input.touch.state = LV_INDEV_STATE_RELEASED; - if(window->application->touch_obj == window->body) { - window->application->touch_obj = NULL; - } - - window->body->input.pointer.x = 0; - window->body->input.pointer.y = 0; - window->body->input.pointer.left_button = LV_INDEV_STATE_RELEASED; - window->body->input.pointer.right_button = LV_INDEV_STATE_RELEASED; - window->body->input.pointer.wheel_button = LV_INDEV_STATE_RELEASED; - window->body->input.pointer.wheel_diff = 0; - if(window->application->pointer_obj == window->body) { - window->application->pointer_obj = NULL; - } - - window->body->input.keyboard.key = 0; - window->body->input.keyboard.state = LV_INDEV_STATE_RELEASED; - if(window->application->keyboard_obj == window->body) { - window->application->keyboard_obj = NULL; - } - destroy_window(window); - } - - shall_flush |= window->flush_pending; - } - - if(shall_flush) { - if(wl_display_flush(application.display) == -1) { - if(errno != EAGAIN) { - LV_LOG_ERROR("failed to flush wayland display"); - } - } - else { - /* All data flushed */ - application.cursor_flush_pending = false; - LV_LL_READ(&application.window_ll, window) { - window->flush_pending = false; - } - } - } -} - -static void _lv_wayland_pointer_read(lv_indev_t * drv, lv_indev_data_t * data) -{ - struct window * window = lv_display_get_user_data(lv_indev_get_display(drv)); - - if(!window || window->closed) { - return; - } - - data->point.x = window->body->input.pointer.x; - data->point.y = window->body->input.pointer.y; - data->state = window->body->input.pointer.left_button; -} - -static void _lv_wayland_pointeraxis_read(lv_indev_t * drv, lv_indev_data_t * data) -{ - struct window * window = lv_display_get_user_data(lv_indev_get_display(drv)); - - if(!window || window->closed) { - return; - } - - data->state = window->body->input.pointer.wheel_button; - data->enc_diff = window->body->input.pointer.wheel_diff; - - window->body->input.pointer.wheel_diff = 0; -} - -static void _lv_wayland_keyboard_read(lv_indev_t * drv, lv_indev_data_t * data) -{ - struct window * window = lv_display_get_user_data(lv_indev_get_display(drv)); - if(!window || window->closed) { - return; - } - - data->key = window->body->input.keyboard.key; - data->state = window->body->input.keyboard.state; -} - -static void _lv_wayland_touch_read(lv_indev_t * drv, lv_indev_data_t * data) -{ - struct window * window = lv_display_get_user_data(lv_indev_get_display(drv)); - if(!window || window->closed) { - return; - } - - data->point.x = window->body->input.touch.x; - data->point.y = window->body->input.touch.y; - data->state = window->body->input.touch.state; -} - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Initialize Wayland driver - */ -static void wayland_init(void) -{ - struct smm_events evs = { - NULL, - sme_new_pool, - sme_expand_pool, - sme_free_pool, - sme_new_buffer, - sme_init_buffer, - sme_free_buffer - }; - - application.xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"); - LV_ASSERT_MSG(application.xdg_runtime_dir, "cannot get XDG_RUNTIME_DIR"); - - // Create XKB context - application.xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); - LV_ASSERT_MSG(application.xkb_context, "failed to create XKB context"); - if(application.xkb_context == NULL) { - return; - } - - // Connect to Wayland display - application.display = wl_display_connect(NULL); - LV_ASSERT_MSG(application.display, "failed to connect to Wayland server"); - if(application.display == NULL) { - return; - } - - /* Add registry listener and wait for registry reception */ - application.shm_format = SHM_FORMAT_UNKNOWN; - application.registry = wl_display_get_registry(application.display); - wl_registry_add_listener(application.registry, ®istry_listener, &application); - wl_display_dispatch(application.display); - wl_display_roundtrip(application.display); - - LV_ASSERT_MSG(application.compositor, "Wayland compositor not available"); - if(application.compositor == NULL) { - return; - } - - LV_ASSERT_MSG(application.shm, "Wayland SHM not available"); - if(application.shm == NULL) { - return; - } - - LV_ASSERT_MSG((application.shm_format != SHM_FORMAT_UNKNOWN), "WL_SHM_FORMAT not available"); - if(application.shm_format == SHM_FORMAT_UNKNOWN) { - LV_LOG_TRACE("Unable to match a suitable SHM format for selected LVGL color depth"); - return; - } - - smm_init(&evs); - smm_setctx(&application); - -#ifdef LV_WAYLAND_WINDOW_DECORATIONS - const char * env_disable_decorations = getenv("LV_WAYLAND_DISABLE_WINDOWDECORATION"); - application.opt_disable_decorations = ((env_disable_decorations != NULL) && - (env_disable_decorations[0] != '0')); -#endif - - lv_ll_init(&application.window_ll, sizeof(struct window)); - - lv_tick_set_cb(tick_get_cb); - - /* Used to wait for events when the window is minimized or hidden */ - application.wayland_pfd.fd = wl_display_get_fd(application.display); - application.wayland_pfd.events = POLLIN; - -} - -/** - * De-initialize Wayland driver - */ -static void wayland_deinit(void) -{ - struct window * window = NULL; - - LV_LL_READ(&application.window_ll, window) { - if(!window->closed) { - destroy_window(window); - } - } - - smm_deinit(); - - if(application.shm) { - wl_shm_destroy(application.shm); - } - -#if LV_WAYLAND_XDG_SHELL - if(application.xdg_wm) { - xdg_wm_base_destroy(application.xdg_wm); - } -#endif - -#if LV_WAYLAND_WL_SHELL - if(application.wl_shell) { - wl_shell_destroy(application.wl_shell); - } -#endif - - if(application.wl_seat) { - wl_seat_destroy(application.wl_seat); - } - - if(application.subcompositor) { - wl_subcompositor_destroy(application.subcompositor); - } - - if(application.compositor) { - wl_compositor_destroy(application.compositor); - } - - wl_registry_destroy(application.registry); - wl_display_flush(application.display); - wl_display_disconnect(application.display); - - lv_ll_clear(&application.window_ll); - -} - -static uint32_t tick_get_cb(void) -{ - struct timespec t; - clock_gettime(CLOCK_MONOTONIC, &t); - uint64_t time_ms = t.tv_sec * 1000 + (t.tv_nsec / 1000000); - return time_ms; -} - -/** - * Get Wayland display file descriptor - * @return Wayland display file descriptor - */ -int lv_wayland_get_fd(void) -{ - return wl_display_get_fd(application.display); -} - -/** - * Create wayland window - * @param hor_res initial horizontal window body size in pixels - * @param ver_res initial vertical window body size in pixels - * @param title window title - * @param close_cb function to be called when the window gets closed by the user (optional) - * @return new display backed by a Wayland window, or NULL on error - */ -lv_display_t * lv_wayland_window_create(uint32_t hor_res, uint32_t ver_res, char * title, - lv_wayland_display_close_f_t close_cb) -{ - struct window * window; - int32_t window_width; - int32_t window_height; - int32_t stride; - - wayland_init(); - - window_width = hor_res; - window_height = ver_res; - -#if LV_WAYLAND_WINDOW_DECORATIONS - - /* Decorations are enabled, caculate the body size */ - if(!application.opt_disable_decorations) { - window_width = hor_res + (2 * BORDER_SIZE); - window_height = ver_res + (TITLE_BAR_HEIGHT + (2 * BORDER_SIZE)); - } - -#endif - - window = create_window(&application, window_width, window_height, title); - if(!window) { - LV_LOG_ERROR("failed to create wayland window"); - return NULL; - } - - window->close_cb = close_cb; - - /* Initialize display driver */ - window->lv_disp = lv_display_create(hor_res, ver_res); - if(window->lv_disp == NULL) { - LV_LOG_ERROR("failed to create lvgl display"); - return NULL; - } - - stride = lv_draw_buf_width_to_stride(hor_res, - lv_display_get_color_format(window->lv_disp)); - - window->lv_disp_draw_buf = lv_draw_buf_create( - hor_res, - ver_res / LVGL_DRAW_BUFFER_DIV, - lv_display_get_color_format(window->lv_disp), - stride); - - - lv_display_set_draw_buffers(window->lv_disp, window->lv_disp_draw_buf, NULL); - lv_display_set_render_mode(window->lv_disp, LV_DISPLAY_RENDER_MODE_PARTIAL); - lv_display_set_flush_cb(window->lv_disp, _lv_wayland_flush); - lv_display_set_user_data(window->lv_disp, window); - - /* Register input */ - window->lv_indev_pointer = lv_indev_create(); - lv_indev_set_type(window->lv_indev_pointer, LV_INDEV_TYPE_POINTER); - lv_indev_set_read_cb(window->lv_indev_pointer, _lv_wayland_pointer_read); - lv_indev_set_display(window->lv_indev_pointer, window->lv_disp); - - if(!window->lv_indev_pointer) { - LV_LOG_ERROR("failed to register pointer indev"); - } - - window->lv_indev_pointeraxis = lv_indev_create(); - lv_indev_set_type(window->lv_indev_pointeraxis, LV_INDEV_TYPE_ENCODER); - lv_indev_set_read_cb(window->lv_indev_pointeraxis, _lv_wayland_pointeraxis_read); - lv_indev_set_display(window->lv_indev_pointeraxis, window->lv_disp); - - if(!window->lv_indev_pointeraxis) { - LV_LOG_ERROR("failed to register pointeraxis indev"); - } - - window->lv_indev_touch = lv_indev_create(); - lv_indev_set_type(window->lv_indev_touch, LV_INDEV_TYPE_POINTER); - lv_indev_set_read_cb(window->lv_indev_touch, _lv_wayland_touch_read); - lv_indev_set_display(window->lv_indev_touch, window->lv_disp); - - if(!window->lv_indev_touch) { - LV_LOG_ERROR("failed to register touch indev"); - } - - window->lv_indev_keyboard = lv_indev_create(); - lv_indev_set_type(window->lv_indev_keyboard, LV_INDEV_TYPE_KEYPAD); - lv_indev_set_read_cb(window->lv_indev_keyboard, _lv_wayland_keyboard_read); - lv_indev_set_display(window->lv_indev_keyboard, window->lv_disp); - - if(!window->lv_indev_keyboard) { - LV_LOG_ERROR("failed to register keyboard indev"); - } - - return window->lv_disp; -} - -/** - * Close wayland window - * @param disp LVGL display using window to be closed - */ -void lv_wayland_window_close(lv_display_t * disp) -{ - struct window * window = lv_display_get_user_data(disp); - if(!window || window->closed) { - return; - } - window->shall_close = true; - window->close_cb = NULL; - wayland_deinit(); -} - -/** - * Check if a Wayland window is open on the specified display. Otherwise (if - * argument is NULL), check if any Wayland window is open. - * @return true if window open, false otherwise - */ -bool lv_wayland_window_is_open(lv_display_t * disp) -{ - struct window * window; - bool open = false; - - if(disp == NULL) { - LV_LL_READ(&application.window_ll, window) { - if(!window->closed) { - open = true; - break; - } - } - } - else { - window = lv_display_get_user_data(disp); - open = (!window->closed); - } - - return open; -} -/** - * Set/unset window maximization mode - * @description Maximization is nearly the same as fullscreen, except - * window decorations and the compositor's panels must remain visible - * @param disp LVGL display using window to be set/unset maximization - * @param Maximization requested status (true = maximized) - */ -void lv_wayland_window_set_maximized(lv_display_t * disp, bool maximized) -{ - struct window * window = lv_display_get_user_data(disp); - if(!window || window->closed) { - return; - } - - if(window->maximized != maximized) { - -#if LV_WAYLAND_WL_SHELL - if(window->wl_shell_surface) { - if(maximized) { - /* Maximizing the wl_shell is possible, but requires binding to wl_output */ - /* The wl_shell has been deperacted */ - //wl_shell_surface_set_maximized(window->wl_shell_surface); - } - else { - wl_shell_surface_set_toplevel(window->wl_shell_surface); - } - window->maximized = maximized; - window->flush_pending = true; - } -#endif - -#if LV_WAYLAND_XDG_SHELL - if(window->xdg_toplevel) { - if(maximized) { - xdg_toplevel_set_maximized(window->xdg_toplevel); - } - else { - xdg_toplevel_unset_maximized(window->xdg_toplevel); - } - - window->maximized = maximized; - window->flush_pending = true; - } -#endif - } -} - -/** - * Set/unset window fullscreen mode - * @param disp LVGL display using window to be set/unset fullscreen - * @param fullscreen requested status (true = fullscreen) - */ -void lv_wayland_window_set_fullscreen(lv_display_t * disp, bool fullscreen) -{ - struct window * window = lv_display_get_user_data(disp); - if(!window || window->closed) { - return; - } - - if(window->fullscreen != fullscreen) { - if(0) { - // Needed for #if madness below - } -#if LV_WAYLAND_XDG_SHELL - else if(window->xdg_toplevel) { - if(fullscreen) { - xdg_toplevel_set_fullscreen(window->xdg_toplevel, NULL); - } - else { - xdg_toplevel_unset_fullscreen(window->xdg_toplevel); - } - window->fullscreen = fullscreen; - window->flush_pending = true; - } -#endif -#if LV_WAYLAND_WL_SHELL - else if(window->wl_shell_surface) { - if(fullscreen) { - wl_shell_surface_set_fullscreen(window->wl_shell_surface, - WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE, - 0, NULL); - } - else { - wl_shell_surface_set_toplevel(window->wl_shell_surface); - } - window->fullscreen = fullscreen; - window->flush_pending = true; - } -#endif - else { - LV_LOG_WARN("Wayland fullscreen mode not supported"); - } - } -} - -/** - * Get pointer input device for given LVGL display - * @param disp LVGL display - * @return input device connected to pointer events, or NULL on error - */ -lv_indev_t * lv_wayland_get_pointer(lv_display_t * disp) -{ - struct window * window = lv_display_get_user_data(disp); - if(!window) { - return NULL; - } - return window->lv_indev_pointer; -} - -/** - * Get pointer axis input device for given LVGL display - * @param disp LVGL display - * @return input device connected to pointer axis events, or NULL on error - */ -lv_indev_t * lv_wayland_get_pointeraxis(lv_display_t * disp) -{ - struct window * window = lv_display_get_user_data(disp); - if(!window) { - return NULL; - } - return window->lv_indev_pointeraxis; -} - -/** - * Get keyboard input device for given LVGL display - * @param disp LVGL display - * @return input device connected to keyboard, or NULL on error - */ -lv_indev_t * lv_wayland_get_keyboard(lv_display_t * disp) -{ - struct window * window = lv_display_get_user_data(disp); - if(!window) { - return NULL; - } - return window->lv_indev_keyboard; -} - -/** - * Get touchscreen input device for given LVGL display - * @param disp LVGL display - * @return input device connected to touchscreen, or NULL on error - */ -lv_indev_t * lv_wayland_get_touchscreen(lv_display_t * disp) -{ - struct window * window = lv_display_get_user_data(disp); - if(!window) { - return NULL; - } - return window->lv_indev_touch; -} - -/** - * Wayland specific timer handler (use in place of LVGL lv_timer_handler) - */ -bool lv_wayland_timer_handler(void) -{ - struct window * window; - - /* Wayland input handling - it will also trigger the frame done handler */ - _lv_wayland_handle_input(); - - /* Ready input timers (to probe for any input received) */ - LV_LL_READ(&application.window_ll, window) { - LV_LOG_TRACE("handle timer frame: %d", window->frame_counter); - - if(window != NULL && window->frame_done == false - && window->frame_counter > 0) { - /* The last frame was not rendered */ - LV_LOG_TRACE("The window is hidden or minimized"); - - /* Simply blocks until a frame done message arrives */ - poll(&application.wayland_pfd, 1, -1); - - /* Resume lvgl on the next cycle */ - return false; - - } - else if(window != NULL && window->body->surface_configured == false) { - /* Initial commit to trigger the configure event */ - /* Manually dispatching the queue is necessary, */ - /* to emit the configure event straight away */ - wl_surface_commit(window->body->surface); - wl_display_dispatch(application.display); - } - else if(window != NULL && window->resize_pending) { - if(resize_window(window, window->resize_width, window->resize_height)) { - window->resize_width = window->width; - window->resize_height = window->height; - window->resize_pending = false; - - } - else { - - LV_LOG_TRACE("Failed to resize window frame: %d", - window->frame_counter); - } - } - else if(window->shall_close == true) { - - /* Destroy graphical context and execute close_cb */ - _lv_wayland_handle_output(); - wayland_deinit(); - return false; - } - } - - /* LVGL handling */ - lv_timer_handler(); - - /* Wayland output handling */ - _lv_wayland_handle_output(); - - /* Set 'errno' if a Wayland flush is outstanding (i.e. data still needs to - * be sent to the compositor, but the compositor pipe/connection is unable - * to take more data at this time). - */ - LV_LL_READ(&application.window_ll, window) { - if(window->flush_pending) { - errno = EAGAIN; - break; - } - } - - return true; -} - -#endif /* LV_USE_WAYLAND */ -#endif /* _WIN32 */ diff --git a/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland.h b/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland.h deleted file mode 100644 index f3d340b..0000000 --- a/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland.h +++ /dev/null @@ -1,142 +0,0 @@ -/******************************************************************* - * - * @file lv_wayland.h - Public functions of the LVGL Wayland client - * - * Based on the original file from the repository. - * - * Porting to LVGL 9.1 - * 2024 EDGEMTech Ltd. - * - * See LICENCE.txt for details - * - * Author(s): EDGEMTech Ltd, Erik Tagirov (erik.tagirov@edgemtech.ch) - * - ******************************************************************/ -#ifndef LV_WAYLAND_H -#define LV_WAYLAND_H - -#ifndef _WIN32 - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../display/lv_display.h" -#include "../../indev/lv_indev.h" - -#if LV_USE_WAYLAND - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef bool (*lv_wayland_display_close_f_t)(lv_display_t * disp); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Retrieves the file descriptor of the wayland socket - */ -int lv_wayland_get_fd(void); - -/** - * Creates a window - * @param hor_res The width of the window in pixels - * @param ver_res The height of the window in pixels - * @param title The title of the window - * @param close_cb The callback that will be execute when the user closes the window - * @return The LVGL display associated to the window - */ -lv_display_t * lv_wayland_window_create(uint32_t hor_res, uint32_t ver_res, char * title, - lv_wayland_display_close_f_t close_cb); - -/** - * Closes the window programmatically - * @param disp Reference to the LVGL display associated to the window - */ -void lv_wayland_window_close(lv_display_t * disp); - -/** - * Check if the window is open - * @param disp Reference to the LVGL display associated to the window - * @return true: The window is open - */ -bool lv_wayland_window_is_open(lv_display_t * disp); - -/** - * Sets the fullscreen state of the window - * @param disp Reference to the LVGL display associated to the window - * @param fullscreen If true the window enters fullscreen - */ -void lv_wayland_window_set_fullscreen(lv_display_t * disp, bool fullscreen); - -/** - * Sets the maximized state of the window - * @param disp Reference to the LVGL display associated to the window - * @param fullscreen If true the window is maximized - */ -void lv_wayland_window_set_maximized(lv_display_t * disp, bool maximize); - -/** - * Obtains the input device of the mouse pointer - * @note It is used to create an input group on application start - * @param disp Reference to the LVGL display associated to the window - * @return The input device - */ -lv_indev_t * lv_wayland_get_pointer(lv_display_t * disp); - -/** - * Obtains the input device of the encoder - * @note It is used to create an input group on application start - * @param disp Reference to the LVGL display associated to the window - * @return The input device - */ -lv_indev_t * lv_wayland_get_pointeraxis(lv_display_t * disp); - -/** - * Obtains the input device of the keyboard - * @note It is used to create an input group on application start - * @param disp Reference to the LVGL display associated to the window - * @return The input device - */ -lv_indev_t * lv_wayland_get_keyboard(lv_display_t * disp); - -/** - * Obtains the input device of the touch screen - * @note It is used to create an input group on application start - * @param disp Reference to the LVGL display associated to the window - * @return The input device - */ -lv_indev_t * lv_wayland_get_touchscreen(lv_display_t * disp); - -/** - * Wrapper around lv_timer_handler - * @note Must be called in the application run loop instead of the - * regular lv_timer_handler provided by LVGL - * @return true: if the cycle was completed, false if the application - * went to sleep because the last frame wasn't completed - */ -bool lv_wayland_timer_handler(void); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_WAYLAND */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* _WIN32 */ -#endif /* WAYLAND_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland_smm.c b/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland_smm.c deleted file mode 100644 index 7cb982a..0000000 --- a/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland_smm.c +++ /dev/null @@ -1,675 +0,0 @@ -/** - * @file lv_wayland_smm.c - * - */ - -typedef int dummy_t; /* Make GCC on windows happy, avoid empty translation unit */ - -#ifndef _WIN32 - -#include "lv_wayland_smm.h" -#include "../../display/lv_display.h" - -#if LV_USE_WAYLAND - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAX_NAME_ATTEMPTS (5) -#define PREFER_NUM_BUFFERS (3) - -#define ROUND_UP(n, b) (((((n) ? (n) : 1) + (b) - 1) / (b)) * (b)) -#define LLHEAD(type) \ - struct { \ - struct type *first; \ - struct type *last; \ - } - -#define LLLINK(type) \ - struct { \ - struct type *next; \ - struct type *prev; \ - } - -#define LL_FIRST(head) ((head)->first) -#define LL_LAST(head) ((head)->last) -#define LL_IS_EMPTY(head) (LL_FIRST(head) == NULL) -#define LL_NEXT(src, member) ((src)->member.next) -#define LL_PREV(src, member) ((src)->member.prev) - -#define LL_INIT(head) do { \ - (head)->first = NULL; \ - (head)->last = NULL; \ - } while (0) - -#define LL_ENQUEUE(head, src, member) do { \ - (src)->member.next = NULL; \ - (src)->member.prev = (head)->last; \ - if ((head)->last == NULL) { \ - (head)->first = (src); \ - } else { \ - (head)->last->member.next = (src); \ - } \ - (head)->last = (src); \ - } while (0) - -#define LL_DEQUEUE(entry, head, member) do { \ - (entry) = LL_FIRST(head); \ - LL_REMOVE(head, entry, member); \ - } while (0) - -#define LL_INSERT_AFTER(head, dest, src, member) do { \ - (src)->member.prev = (dest); \ - (src)->member.next = (dest)->member.next; \ - if ((dest)->member.next != NULL) { \ - (dest)->member.next->member.prev = (src); \ - } else { \ - (head)->last = (src); \ - } \ - (dest)->member.next = (src); \ - } while (0) - -#define LL_REMOVE(head, src, member) do { \ - if ((src)->member.prev != NULL) { \ - (src)->member.prev->member.next = (src)->member.next; \ - } else { \ - (head)->first = (src)->member.next; \ - } \ - if ((src)->member.next != NULL) { \ - (src)->member.next->member.prev = (src)->member.prev; \ - } else { \ - (head)->last = (src)->member.prev; \ - } \ - } while (0) - -#define LL_FOREACH(entry, head, member) \ - for ((entry) = LL_FIRST(head); \ - (entry) != NULL; \ - (entry) = LL_NEXT(entry, member)) - -#define WAYLAND_FD_NAME "/" SMM_FD_NAME "-XXXXX" - -struct smm_pool { - struct smm_pool_properties props; - LLHEAD(smm_buffer) allocd; - void * map; - size_t map_size; - bool map_outdated; -}; - -struct smm_buffer { - struct smm_buffer_properties props; - bool group_resized; - LLLINK(smm_buffer) pool; - LLLINK(smm_buffer) use; - LLLINK(smm_buffer) age; -}; - -struct smm_group { - struct smm_group_properties props; - size_t size; - unsigned char num_buffers; - LLHEAD(smm_buffer) unused; - LLHEAD(smm_buffer) inuse; - LLHEAD(smm_buffer) history; - LLLINK(smm_group) link; -}; - -static size_t calc_buffer_size(struct smm_buffer * buf); -static void purge_history(struct smm_buffer * buf); -static struct smm_buffer * get_from_pool(struct smm_group * grp); -static void return_to_pool(struct smm_buffer * buf); -static struct smm_pool * alloc_pool(void); -static void free_pool(struct smm_pool * pool); -static struct smm_buffer * alloc_buffer(struct smm_buffer * last, size_t offset); -static void free_buffer(struct smm_buffer * buf); - -static struct { - unsigned long page_sz; - struct smm_events cbs; - struct smm_pool * active; - LLHEAD(smm_group) groups; - struct { - size_t active_used; - } statistics; -} smm_instance; - - -void smm_init(struct smm_events * evs) -{ - memcpy(&smm_instance.cbs, evs, sizeof(struct smm_events)); - srand((unsigned int)clock()); - smm_instance.page_sz = (unsigned long)sysconf(_SC_PAGESIZE); - LL_INIT(&smm_instance.groups); -} - - -void smm_deinit(void) -{ - struct smm_group * grp; - - /* Destroy all buffer groups */ - while(!LL_IS_EMPTY(&smm_instance.groups)) { - LL_DEQUEUE(grp, &smm_instance.groups, link); - smm_destroy(grp); - } -} - - -void smm_setctx(void * ctx) -{ - smm_instance.cbs.ctx = ctx; -} - - -smm_group_t * smm_create(void) -{ - struct smm_group * grp; - - /* Allocate and intialize a new buffer group */ - grp = malloc(sizeof(struct smm_group)); - if(grp != NULL) { - grp->size = smm_instance.page_sz; - grp->num_buffers = 0; - LL_INIT(&grp->unused); - LL_INIT(&grp->inuse); - LL_INIT(&grp->history); - - /* Add to instance groups queue */ - LL_ENQUEUE(&smm_instance.groups, grp, link); - } - - return grp; -} - - -void smm_resize(smm_group_t * grp, size_t sz) -{ - struct smm_buffer * buf; - struct smm_group * rgrp = grp; - - /* Round allocation size up to a sysconf(_SC_PAGE_SIZE) boundary */ - rgrp->size = ROUND_UP(sz, smm_instance.page_sz); - - /* Return all unused buffers to pool (to be re-allocated at the new size) */ - while(!LL_IS_EMPTY(&rgrp->unused)) { - LL_DEQUEUE(buf, &rgrp->unused, use); - return_to_pool(buf); - } - - /* Mark all buffers in use to be freed to pool when possible */ - LL_FOREACH(buf, &rgrp->inuse, use) { - buf->group_resized = true; - purge_history(buf); - } -} - - -void smm_destroy(smm_group_t * grp) -{ - struct smm_buffer * buf; - struct smm_group * dgrp = grp; - - /* Return unused buffers */ - while(!LL_IS_EMPTY(&dgrp->unused)) { - LL_DEQUEUE(buf, &dgrp->unused, use); - return_to_pool(buf); - } - - /* Return buffers that are still in use (ideally this queue should be empty - * at this time) - */ - while(!LL_IS_EMPTY(&dgrp->inuse)) { - LL_DEQUEUE(buf, &dgrp->inuse, use); - return_to_pool(buf); - } - - /* Remove from instance groups queue */ - LL_REMOVE(&smm_instance.groups, dgrp, link); - free(dgrp); -} - - -smm_buffer_t * smm_acquire(smm_group_t * grp) -{ - struct smm_buffer * buf; - struct smm_group * agrp = grp; - - if(LL_IS_EMPTY(&agrp->unused)) { - /* No unused buffer available, so get a new one from pool */ - buf = get_from_pool(agrp); - } - else { - /* Otherwise, reuse an unused buffer */ - LL_DEQUEUE(buf, &agrp->unused, use); - } - - if(buf != NULL) { - /* Add buffer to in-use queue */ - LL_ENQUEUE(&agrp->inuse, buf, use); - - /* Emit 'init buffer' event */ - if(smm_instance.cbs.init_buffer != NULL) { - if(smm_instance.cbs.init_buffer(smm_instance.cbs.ctx, &buf->props)) { - smm_release(buf); - buf = NULL; - } - } - - if(buf != NULL) { - /* Remove from history */ - purge_history(buf); - - /* Add to history a-new */ - LL_ENQUEUE(&agrp->history, buf, age); - } - } - - return buf; -} - - -void * smm_map(smm_buffer_t * buf) -{ - struct smm_buffer * mbuf = buf; - struct smm_pool * pool = mbuf->props.pool; - void * map = pool->map; - - if(pool->map_outdated) { - /* Update mapping to current pool size */ - if(pool->map != NULL) { - munmap(pool->map, pool->map_size); - } - - map = mmap(NULL, - pool->props.size, - PROT_READ | PROT_WRITE, - MAP_SHARED, - pool->props.fd, - 0); - - if(map == MAP_FAILED) { - map = NULL; - pool->map = NULL; - } - else { - pool->map = map; - pool->map_size = pool->props.size; - pool->map_outdated = false; - } - } - - /* Calculate buffer mapping (from offset in pool) */ - if(map != NULL) { - map = (((char *)map) + mbuf->props.offset); - } - - return map; -} - - -void smm_release(smm_buffer_t * buf) -{ - struct smm_buffer * rbuf = buf; - struct smm_group * grp = rbuf->props.group; - - /* Remove from in-use queue */ - LL_REMOVE(&grp->inuse, rbuf, use); - - if(rbuf->group_resized) { - /* Buffer group was resized while this buffer was in-use, thus it must be - * returned to it's pool - */ - rbuf->group_resized = false; - return_to_pool(rbuf); - } - else { - /* Move to unused queue */ - LL_ENQUEUE(&grp->unused, rbuf, use); - - /* Try to limit total number of buffers to preferred number */ - while((grp->num_buffers > PREFER_NUM_BUFFERS) && - (!LL_IS_EMPTY(&grp->unused))) { - LL_DEQUEUE(rbuf, &grp->unused, use); - return_to_pool(rbuf); - } - } -} - - -smm_buffer_t * smm_latest(smm_group_t * grp) -{ - struct smm_group * lgrp = grp; - - return LL_LAST(&lgrp->history); -} - - -smm_buffer_t * smm_next(smm_buffer_t * buf) -{ - struct smm_buffer * ibuf; - struct smm_buffer * nbuf = buf; - struct smm_group * grp = nbuf->props.group; - - LL_FOREACH(ibuf, &grp->history, age) { - if(ibuf == nbuf) { - ibuf = LL_NEXT(ibuf, age); - break; - } - } - - return ibuf; -} - -void purge_history(struct smm_buffer * buf) -{ - struct smm_buffer * ibuf; - struct smm_group * grp = buf->props.group; - - /* Remove from history (and any older) */ - LL_FOREACH(ibuf, &grp->history, age) { - if(ibuf == buf) { - do { - LL_DEQUEUE(ibuf, &grp->history, age); - } while(ibuf != buf); - break; - } - } -} - - -size_t calc_buffer_size(struct smm_buffer * buf) -{ - size_t buf_sz; - struct smm_pool * buf_pool = buf->props.pool; - - if(buf == LL_LAST(&buf_pool->allocd)) { - buf_sz = (buf_pool->props.size - buf->props.offset); - } - else { - buf_sz = (LL_NEXT(buf, pool)->props.offset - buf->props.offset); - } - - return buf_sz; -} - - -struct smm_buffer * get_from_pool(struct smm_group * grp) -{ - int ret; - size_t buf_sz; - struct smm_buffer * buf; - struct smm_buffer * last = NULL; - - /* TODO: Determine when to allocate a new active pool (i.e. memory shrink) */ - - if(smm_instance.active == NULL) { - /* Allocate a new active pool */ - smm_instance.active = alloc_pool(); - smm_instance.statistics.active_used = 0; - } - - if(smm_instance.active == NULL) { - buf = NULL; - } - else { - /* Search for a free buffer large enough for allocation */ - LL_FOREACH(buf, &smm_instance.active->allocd, pool) { - last = buf; - if(buf->props.group == NULL) { - buf_sz = calc_buffer_size(buf); - if(buf_sz == grp->size) { - break; - } - else if(buf_sz > grp->size) { - if((buf != LL_LAST(&smm_instance.active->allocd)) && - (LL_NEXT(buf, pool)->props.group == NULL)) { - /* Pull back next buffer to use unallocated size */ - LL_NEXT(buf, pool)->props.offset -= (buf_sz - grp->size); - } - else { - /* Allocate another buffer to hold unallocated size */ - alloc_buffer(buf, buf->props.offset + grp->size); - } - - break; - } - } - } - - if(buf == NULL) { - /* No buffer found to meet allocation size, expand pool */ - if((last != NULL) && - (last->props.group == NULL)) { - /* Use last free buffer */ - buf_sz = (grp->size - buf_sz); - } - else { - /* Allocate new buffer */ - buf_sz = grp->size; - if(last == NULL) { - buf = alloc_buffer(NULL, 0); - } - else { - buf = alloc_buffer(last, smm_instance.active->props.size); - } - last = buf; - } - - if(last != NULL) { - /* Expand pool backing memory */ - ret = ftruncate(smm_instance.active->props.fd, - smm_instance.active->props.size + buf_sz); - if(ret) { - if(buf != NULL) { - free_buffer(buf); - buf = NULL; - } - } - else { - smm_instance.active->props.size += buf_sz; - smm_instance.active->map_outdated = true; - buf = last; - - if(!(smm_instance.active->props.size - buf_sz)) { - /* Emit 'new pool' event */ - if((smm_instance.cbs.new_pool != NULL) && - (smm_instance.cbs.new_pool(smm_instance.cbs.ctx, - &smm_instance.active->props))) { - free_buffer(buf); - free_pool(smm_instance.active); - smm_instance.active = NULL; - buf = NULL; - } - } - else { - /* Emit 'expand pool' event */ - if(smm_instance.cbs.expand_pool != NULL) { - smm_instance.cbs.expand_pool(smm_instance.cbs.ctx, - &smm_instance.active->props); - } - } - } - } - } - } - - if(buf != NULL) { - /* Set buffer group */ - memcpy((void *)&buf->props.group, &grp, sizeof(struct smm_group *)); - - /* Emit 'new buffer' event */ - if(smm_instance.cbs.new_buffer != NULL) { - if(smm_instance.cbs.new_buffer(smm_instance.cbs.ctx, &buf->props)) { - grp = NULL; - memcpy((void *)&buf->props.group, &grp, sizeof(struct smm_group *)); - buf = NULL; - } - } - - if(buf != NULL) { - /* Update active pool usage statistic */ - smm_instance.statistics.active_used += grp->size; - grp->num_buffers++; - } - } - - return buf; -} - - -void return_to_pool(struct smm_buffer * buf) -{ - struct smm_group * grp = buf->props.group; - struct smm_pool * pool = buf->props.pool; - - /* Emit 'free buffer' event */ - if(smm_instance.cbs.free_buffer != NULL) { - smm_instance.cbs.free_buffer(smm_instance.cbs.ctx, &buf->props); - } - - /* Buffer is no longer part of history */ - purge_history(buf); - - /* Buffer is no longer part of group */ - grp->num_buffers--; - grp = NULL; - memcpy((void *)&buf->props.group, &grp, sizeof(struct smm_group *)); - - /* Update active pool usage statistic */ - if(smm_instance.active == pool) { - smm_instance.statistics.active_used -= calc_buffer_size(buf); - } - - /* Coalesce with ungrouped buffers beside this one */ - if((buf != LL_LAST(&pool->allocd)) && - (LL_NEXT(buf, pool)->props.group == NULL)) { - free_buffer(LL_NEXT(buf, pool)); - } - if((buf != LL_FIRST(&pool->allocd)) && - (LL_PREV(buf, pool)->props.group == NULL)) { - buf = LL_PREV(buf, pool); - pool = buf->props.pool; - free_buffer(LL_NEXT(buf, pool)); - } - - /* Free buffer (and pool), if only remaining buffer in pool */ - if((buf == LL_FIRST(&pool->allocd)) && - (buf == LL_LAST(&pool->allocd))) { - free_buffer(buf); - - /* Emit 'free pool' event */ - if(smm_instance.cbs.free_pool != NULL) { - smm_instance.cbs.free_pool(smm_instance.cbs.ctx, &pool->props); - } - - free_pool(pool); - if(smm_instance.active == pool) { - smm_instance.active = NULL; - } - } -} - - -struct smm_pool * alloc_pool(void) -{ - struct smm_pool * pool; - char name[] = WAYLAND_FD_NAME; - unsigned char attempts = 0; - bool opened = false; - - pool = malloc(sizeof(struct smm_pool)); - if(pool != NULL) { - do { - /* A randomized pool name should help reduce collisions */ - sprintf(name + sizeof(SMM_FD_NAME) + 1, "%05X", rand() & 0xFFFF); - pool->props.fd = shm_open(name, - O_RDWR | O_CREAT | O_EXCL, - S_IRUSR | S_IWUSR); - if(pool->props.fd >= 0) { - shm_unlink(name); - pool->props.size = 0; - pool->map = NULL; - pool->map_size = 0; - pool->map_outdated = false; - LL_INIT(&pool->allocd); - opened = true; - break; - } - else { - if(errno != EEXIST) { - break; - } - attempts++; - } - } while(attempts < MAX_NAME_ATTEMPTS); - - if(!opened) { - free(pool); - pool = NULL; - } - } - - return pool; -} - - -void free_pool(struct smm_pool * pool) -{ - if(pool->map != NULL) { - munmap(pool->map, pool->map_size); - } - - close(pool->props.fd); - free(pool); -} - - -struct smm_buffer * alloc_buffer(struct smm_buffer * last, size_t offset) -{ - struct smm_buffer * buf; - struct smm_buffer_properties initial_props = { - {NULL}, - NULL, - smm_instance.active, - offset - }; - - /* Allocate and intialize a new buffer (including linking in to pool) */ - buf = malloc(sizeof(struct smm_buffer)); - if(buf != NULL) { - memcpy(&buf->props, &initial_props, sizeof(struct smm_buffer_properties)); - buf->group_resized = false; - - if(last == NULL) { - LL_ENQUEUE(&smm_instance.active->allocd, buf, pool); - } - else { - LL_INSERT_AFTER(&smm_instance.active->allocd, last, buf, pool); - } - } - - return buf; -} - - -void free_buffer(struct smm_buffer * buf) -{ - struct smm_pool * buf_pool = buf->props.pool; - - /* Remove from pool */ - LL_REMOVE(&buf_pool->allocd, buf, pool); - free(buf); -} - -#endif /* LV_USE_WAYLAND */ -#endif /* _WIN32 */ diff --git a/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland_smm.h b/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland_smm.h deleted file mode 100644 index 617244f..0000000 --- a/L3_Middlewares/LVGL/src/drivers/wayland/lv_wayland_smm.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @file lv_wayland_smm.h - * - */ -#ifndef LV_WAYLAND_SMM_H -#define LV_WAYLAND_SMM_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _WIN32 - -/********************* - * INCLUDES - *********************/ - -#include "../../display/lv_display.h" -#include LV_STDDEF_INCLUDE -#include LV_STDBOOL_INCLUDE - -#if LV_USE_WAYLAND - -/********************* - * DEFINES - *********************/ - -#define SMM_FD_NAME "lvgl-wayland" -#define SMM_POOL_TAGS (1) -#define SMM_BUFFER_TAGS (2) -#define SMM_GROUP_TAGS (1) - -/********************** - * TYPEDEFS - **********************/ - -typedef void smm_pool_t; -typedef void smm_buffer_t; -typedef void smm_group_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -struct smm_events { - void * ctx; - bool (*new_pool)(void * ctx, smm_pool_t * pool); - void (*expand_pool)(void * ctx, smm_pool_t * pool); - void (*free_pool)(void * ctx, smm_pool_t * pool); - bool (*new_buffer)(void * ctx, smm_buffer_t * buf); - bool (*init_buffer)(void * ctx, smm_buffer_t * buf); - void (*free_buffer)(void * ctx, smm_buffer_t * buf); -}; - -struct smm_pool_properties { - void * tag[SMM_POOL_TAGS]; - size_t size; - int fd; -}; - -struct smm_buffer_properties { - void * tag[SMM_BUFFER_TAGS]; - smm_group_t * const group; - smm_pool_t * const pool; - size_t offset; -}; - -struct smm_group_properties { - void * tag[SMM_GROUP_TAGS]; -}; - -void smm_init(struct smm_events * evs); -void smm_setctx(void * ctx); -void smm_deinit(void); -smm_group_t * smm_create(void); -void smm_resize(smm_group_t * grp, size_t sz); -void smm_destroy(smm_group_t * grp); -smm_buffer_t * smm_acquire(smm_group_t * grp); -void * smm_map(smm_buffer_t * buf); -void smm_release(smm_buffer_t * buf); -smm_buffer_t * smm_latest(smm_group_t * grp); -smm_buffer_t * smm_next(smm_buffer_t * buf); - -/********************** - * MACROS - **********************/ - -#define SMM_POOL_PROPERTIES(p) ((const struct smm_pool_properties *)(p)) -#define SMM_BUFFER_PROPERTIES(b) ((const struct smm_buffer_properties *)(b)) -#define SMM_GROUP_PROPERTIES(g) ((const struct smm_group_properties *)(g)) -#define SMM_TAG(o, n, v) \ - do { \ - void **smm_tag = (void **)((char *)o + (n * sizeof(void *))); \ - *smm_tag = (v); \ - } while(0) - - -#endif /* LV_USE_WAYLAND */ -#endif /* _WIN32 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /* LV_WAYLAND_SMM_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_context.c b/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_context.c deleted file mode 100644 index 7bf2038..0000000 --- a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_context.c +++ /dev/null @@ -1,720 +0,0 @@ -/** - * @file lv_windows_context.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_windows_context.h" -#if LV_USE_WINDOWS - -#ifdef __GNUC__ - #pragma GCC diagnostic ignored "-Wcast-function-type" -#endif - -#include "lv_windows_display.h" -#include "lv_windows_input_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static uint32_t lv_windows_tick_count_callback(void); - -static void lv_windows_delay_callback(uint32_t ms); - -static void lv_windows_check_display_existence_timer_callback( - lv_timer_t * timer); - -static bool lv_windows_window_message_callback_nolock( - HWND hWnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam, - LRESULT * plResult); - -static LRESULT CALLBACK lv_windows_window_message_callback( - HWND hWnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_windows_platform_init(void) -{ - lv_tick_set_cb(lv_windows_tick_count_callback); - - lv_delay_set_cb(lv_windows_delay_callback); - - lv_timer_create( - lv_windows_check_display_existence_timer_callback, - 200, - NULL); - - // Try to ensure the default group exists. - { - lv_group_t * default_group = lv_group_get_default(); - if(!default_group) { - default_group = lv_group_create(); - if(default_group) { - lv_group_set_default(default_group); - } - } - } - - WNDCLASSEXW window_class; - lv_memzero(&window_class, sizeof(WNDCLASSEXW)); - window_class.cbSize = sizeof(WNDCLASSEXW); - window_class.style = 0; - window_class.lpfnWndProc = lv_windows_window_message_callback; - window_class.cbClsExtra = 0; - window_class.cbWndExtra = 0; - window_class.hInstance = NULL; - window_class.hIcon = NULL; - window_class.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); - window_class.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); - window_class.lpszMenuName = NULL; - window_class.lpszClassName = L"LVGL.Window"; - window_class.hIconSm = NULL; - LV_ASSERT(RegisterClassExW(&window_class)); -} - -lv_windows_window_context_t * lv_windows_get_window_context( - HWND window_handle) -{ - return (lv_windows_window_context_t *)( - GetPropW(window_handle, L"LVGL.Window.Context")); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static uint32_t lv_windows_tick_count_callback(void) -{ - LARGE_INTEGER Frequency; - if(QueryPerformanceFrequency(&Frequency)) { - LARGE_INTEGER PerformanceCount; - if(QueryPerformanceCounter(&PerformanceCount)) { - return (uint32_t)(PerformanceCount.QuadPart * 1000 / Frequency.QuadPart); - } - } - - return (uint32_t)GetTickCount64(); -} - -static void lv_windows_delay_callback(uint32_t ms) -{ - HANDLE timer_handle = CreateWaitableTimerExW( - NULL, - NULL, - CREATE_WAITABLE_TIMER_MANUAL_RESET | - CREATE_WAITABLE_TIMER_HIGH_RESOLUTION, - TIMER_ALL_ACCESS); - if(timer_handle) { - LARGE_INTEGER due_time; - due_time.QuadPart = -((int64_t)ms) * 1000 * 10; - SetWaitableTimer(timer_handle, &due_time, 0, NULL, NULL, FALSE); - WaitForSingleObject(timer_handle, INFINITE); - - CloseHandle(timer_handle); - } -} - -static void lv_windows_check_display_existence_timer_callback( - lv_timer_t * timer) -{ - LV_UNUSED(timer); - if(!lv_display_get_next(NULL)) { - // Don't use lv_deinit() due to it will cause exception when parallel - // rendering is enabled. - exit(0); - } -} - -static HDC lv_windows_create_frame_buffer( - HWND window_handle, - LONG width, - LONG height, - UINT32 ** pixel_buffer, - SIZE_T * pixel_buffer_size) -{ - HDC frame_buffer_dc_handle = NULL; - - LV_ASSERT_NULL(pixel_buffer); - LV_ASSERT_NULL(pixel_buffer_size); - - HDC window_dc_handle = GetDC(window_handle); - if(window_dc_handle) { - frame_buffer_dc_handle = CreateCompatibleDC(window_dc_handle); - ReleaseDC(window_handle, window_dc_handle); - } - - if(frame_buffer_dc_handle) { -#if (LV_COLOR_DEPTH == 32) || (LV_COLOR_DEPTH == 24) - BITMAPINFO bitmap_info = { 0 }; -#elif (LV_COLOR_DEPTH == 16) - typedef struct _BITMAPINFO_16BPP { - BITMAPINFOHEADER bmiHeader; - DWORD bmiColorMask[3]; - } BITMAPINFO_16BPP; - - BITMAPINFO_16BPP bitmap_info = { 0 }; -#else -#error [lv_windows] Unsupported LV_COLOR_DEPTH. -#endif - - bitmap_info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bitmap_info.bmiHeader.biWidth = width; - bitmap_info.bmiHeader.biHeight = -height; - bitmap_info.bmiHeader.biPlanes = 1; - bitmap_info.bmiHeader.biBitCount = lv_color_format_get_bpp( - LV_COLOR_FORMAT_NATIVE); -#if (LV_COLOR_DEPTH == 32) || (LV_COLOR_DEPTH == 24) - bitmap_info.bmiHeader.biCompression = BI_RGB; -#elif (LV_COLOR_DEPTH == 16) - bitmap_info.bmiHeader.biCompression = BI_BITFIELDS; - bitmap_info.bmiColorMask[0] = 0xF800; - bitmap_info.bmiColorMask[1] = 0x07E0; - bitmap_info.bmiColorMask[2] = 0x001F; -#else -#error [lv_windows] Unsupported LV_COLOR_DEPTH. -#endif - - HBITMAP hBitmap = CreateDIBSection( - frame_buffer_dc_handle, - (PBITMAPINFO)(&bitmap_info), - DIB_RGB_COLORS, - (void **)pixel_buffer, - NULL, - 0); - if(hBitmap) { - *pixel_buffer_size = width * height; - *pixel_buffer_size *= lv_color_format_get_size( - LV_COLOR_FORMAT_NATIVE); - - DeleteObject(SelectObject(frame_buffer_dc_handle, hBitmap)); - DeleteObject(hBitmap); - } - else { - DeleteDC(frame_buffer_dc_handle); - frame_buffer_dc_handle = NULL; - } - } - - return frame_buffer_dc_handle; -} - -static void lv_windows_display_timer_callback(lv_timer_t * timer) -{ - lv_windows_window_context_t * context = lv_timer_get_user_data(timer); - LV_ASSERT_NULL(context); - - if(!context->display_resolution_changed) { - return; - } - - lv_display_set_resolution( - context->display_device_object, - context->requested_display_resolution.x, - context->requested_display_resolution.y); - - int32_t hor_res = lv_display_get_horizontal_resolution( - context->display_device_object); - int32_t ver_res = lv_display_get_vertical_resolution( - context->display_device_object); - - HWND window_handle = lv_windows_get_display_window_handle( - context->display_device_object); - if(window_handle) { - if(context->display_framebuffer_context_handle) { - context->display_framebuffer_base = NULL; - context->display_framebuffer_size = 0; - DeleteDC(context->display_framebuffer_context_handle); - context->display_framebuffer_context_handle = NULL; - } - - context->display_framebuffer_context_handle = - lv_windows_create_frame_buffer( - window_handle, - hor_res, - ver_res, - &context->display_framebuffer_base, - &context->display_framebuffer_size); - if(context->display_framebuffer_context_handle) { - lv_display_set_buffers( - context->display_device_object, - context->display_framebuffer_base, - NULL, - (uint32_t)context->display_framebuffer_size, - LV_DISPLAY_RENDER_MODE_DIRECT); - } - } - - context->display_resolution_changed = false; - context->requested_display_resolution.x = 0; - context->requested_display_resolution.y = 0; -} - -static void lv_windows_display_driver_flush_callback( - lv_display_t * display, - const lv_area_t * area, - uint8_t * px_map) -{ - LV_UNUSED(area); - - HWND window_handle = lv_windows_get_display_window_handle(display); - if(!window_handle) { - lv_display_flush_ready(display); - return; - } - - lv_windows_window_context_t * context = lv_windows_get_window_context( - window_handle); - if(!context) { - lv_display_flush_ready(display); - return; - } - - if(lv_display_flush_is_last(display)) { -#if (LV_COLOR_DEPTH == 32) || \ - (LV_COLOR_DEPTH == 24) || \ - (LV_COLOR_DEPTH == 16) - UNREFERENCED_PARAMETER(px_map); -#else -#error [lv_windows] Unsupported LV_COLOR_DEPTH. -#endif - - HDC hdc = GetDC(window_handle); - if(hdc) { - SetStretchBltMode(hdc, HALFTONE); - - RECT client_rect; - GetClientRect(window_handle, &client_rect); - - int32_t width = lv_windows_zoom_to_logical( - client_rect.right - client_rect.left, - context->zoom_level); - int32_t height = lv_windows_zoom_to_logical( - client_rect.bottom - client_rect.top, - context->zoom_level); - if(context->simulator_mode) { - width = lv_windows_dpi_to_logical(width, context->window_dpi); - height = lv_windows_dpi_to_logical(height, context->window_dpi); - } - - StretchBlt( - hdc, - client_rect.left, - client_rect.top, - client_rect.right - client_rect.left, - client_rect.bottom - client_rect.top, - context->display_framebuffer_context_handle, - 0, - 0, - width, - height, - SRCCOPY); - - ReleaseDC(window_handle, hdc); - } - } - - lv_display_flush_ready(display); -} - -static UINT lv_windows_get_dpi_for_window(HWND window_handle) -{ - UINT result = (UINT)(-1); - - HMODULE module_handle = LoadLibraryW(L"SHCore.dll"); - if(module_handle) { - typedef enum MONITOR_DPI_TYPE_PRIVATE { - MDT_EFFECTIVE_DPI = 0, - MDT_ANGULAR_DPI = 1, - MDT_RAW_DPI = 2, - MDT_DEFAULT = MDT_EFFECTIVE_DPI - } MONITOR_DPI_TYPE_PRIVATE; - - typedef HRESULT(WINAPI * function_type)( - HMONITOR, MONITOR_DPI_TYPE_PRIVATE, UINT *, UINT *); - - function_type function = (function_type)( - GetProcAddress(module_handle, "GetDpiForMonitor")); - if(function) { - HMONITOR MonitorHandle = MonitorFromWindow( - window_handle, - MONITOR_DEFAULTTONEAREST); - - UINT dpiX = 0; - UINT dpiY = 0; - if(SUCCEEDED(function( - MonitorHandle, - MDT_EFFECTIVE_DPI, - &dpiX, - &dpiY))) { - result = dpiX; - } - } - - FreeLibrary(module_handle); - } - - if(result == (UINT)(-1)) { - HDC hWindowDC = GetDC(window_handle); - if(hWindowDC) { - result = GetDeviceCaps(hWindowDC, LOGPIXELSX); - ReleaseDC(window_handle, hWindowDC); - } - } - - if(result == (UINT)(-1)) { - result = USER_DEFAULT_SCREEN_DPI; - } - - return result; -} - -static BOOL lv_windows_register_touch_window( - HWND window_handle, - ULONG flags) -{ - HMODULE module_handle = GetModuleHandleW(L"user32.dll"); - if(!module_handle) { - return FALSE; - } - - typedef BOOL(WINAPI * function_type)(HWND, ULONG); - - function_type function = (function_type)( - GetProcAddress(module_handle, "RegisterTouchWindow")); - if(!function) { - return FALSE; - } - - return function(window_handle, flags); -} - -static BOOL lv_windows_enable_child_window_dpi_message( - HWND WindowHandle) -{ - // The private Per-Monitor DPI Awareness support extension is Windows 10 - // only. We don't need the private Per-Monitor DPI Awareness support - // extension if the Per-Monitor (V2) DPI Awareness exists. - OSVERSIONINFOEXW os_version_info_ex = { 0 }; - os_version_info_ex.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW); - os_version_info_ex.dwMajorVersion = 10; - os_version_info_ex.dwMinorVersion = 0; - os_version_info_ex.dwBuildNumber = 14986; - if(!VerifyVersionInfoW( - &os_version_info_ex, - VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER, - VerSetConditionMask( - VerSetConditionMask( - VerSetConditionMask( - 0, - VER_MAJORVERSION, - VER_GREATER_EQUAL), - VER_MINORVERSION, - VER_GREATER_EQUAL), - VER_BUILDNUMBER, - VER_LESS))) { - return FALSE; - } - - HMODULE module_handle = GetModuleHandleW(L"user32.dll"); - if(!module_handle) { - return FALSE; - } - - typedef BOOL(WINAPI * function_type)(HWND, BOOL); - - function_type function = (function_type)( - GetProcAddress(module_handle, "EnableChildWindowDpiMessage")); - if(!function) { - return FALSE; - } - - return function(WindowHandle, TRUE); -} - -static bool lv_windows_window_message_callback_nolock( - HWND hWnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam, - LRESULT * plResult) -{ - switch(uMsg) { - case WM_CREATE: { - // Note: Return -1 directly because WM_DESTROY message will be sent - // when destroy the window automatically. We free the resource when - // processing the WM_DESTROY message of this window. - - lv_windows_create_display_data_t * data = - (lv_windows_create_display_data_t *)( - ((LPCREATESTRUCTW)(lParam))->lpCreateParams); - if(!data) { - return -1; - } - - lv_windows_window_context_t * context = - (lv_windows_window_context_t *)(HeapAlloc( - GetProcessHeap(), - HEAP_ZERO_MEMORY, - sizeof(lv_windows_window_context_t))); - if(!context) { - return -1; - } - - if(!SetPropW(hWnd, L"LVGL.Window.Context", (HANDLE)(context))) { - return -1; - } - - context->window_dpi = lv_windows_get_dpi_for_window(hWnd); - context->zoom_level = data->zoom_level; - context->allow_dpi_override = data->allow_dpi_override; - context->simulator_mode = data->simulator_mode; - - context->display_timer_object = lv_timer_create( - lv_windows_display_timer_callback, - LV_DEF_REFR_PERIOD, - context); - - context->display_resolution_changed = false; - context->requested_display_resolution.x = 0; - context->requested_display_resolution.y = 0; - - context->display_device_object = lv_display_create(0, 0); - if(!context->display_device_object) { - return -1; - } - RECT request_content_size; - GetWindowRect(hWnd, &request_content_size); - lv_display_set_resolution( - context->display_device_object, - request_content_size.right - request_content_size.left, - request_content_size.bottom - request_content_size.top); - lv_display_set_flush_cb( - context->display_device_object, - lv_windows_display_driver_flush_callback); - lv_display_set_driver_data( - context->display_device_object, - hWnd); - if(!context->allow_dpi_override) { - lv_display_set_dpi( - context->display_device_object, - context->window_dpi); - } - - if(context->simulator_mode) { - context->display_resolution_changed = true; - context->requested_display_resolution.x = - lv_display_get_horizontal_resolution( - context->display_device_object); - context->requested_display_resolution.y = - lv_display_get_vertical_resolution( - context->display_device_object); - } - - lv_windows_register_touch_window(hWnd, 0); - - lv_windows_enable_child_window_dpi_message(hWnd); - - break; - } - case WM_SIZE: { - if(wParam != SIZE_MINIMIZED) { - lv_windows_window_context_t * context = (lv_windows_window_context_t *)( - lv_windows_get_window_context(hWnd)); - if(context) { - if(!context->simulator_mode) { - context->display_resolution_changed = true; - context->requested_display_resolution.x = LOWORD(lParam); - context->requested_display_resolution.y = HIWORD(lParam); - } - else { - int32_t window_width = lv_windows_dpi_to_physical( - lv_windows_zoom_to_physical( - lv_display_get_horizontal_resolution( - context->display_device_object), - context->zoom_level), - context->window_dpi); - int32_t window_height = lv_windows_dpi_to_physical( - lv_windows_zoom_to_physical( - lv_display_get_vertical_resolution( - context->display_device_object), - context->zoom_level), - context->window_dpi); - - RECT window_rect; - GetWindowRect(hWnd, &window_rect); - - RECT client_rect; - GetClientRect(hWnd, &client_rect); - - int32_t original_window_width = - window_rect.right - window_rect.left; - int32_t original_window_height = - window_rect.bottom - window_rect.top; - - int32_t original_client_width = - client_rect.right - client_rect.left; - int32_t original_client_height = - client_rect.bottom - client_rect.top; - - int32_t reserved_width = - original_window_width - original_client_width; - int32_t reserved_height = - original_window_height - original_client_height; - - SetWindowPos( - hWnd, - NULL, - 0, - 0, - reserved_width + window_width, - reserved_height + window_height, - SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE); - } - } - } - break; - } - case WM_DPICHANGED: { - lv_windows_window_context_t * context = (lv_windows_window_context_t *)( - lv_windows_get_window_context(hWnd)); - if(context) { - context->window_dpi = HIWORD(wParam); - - if(!context->allow_dpi_override) { - lv_display_set_dpi( - context->display_device_object, - context->window_dpi); - } - - LPRECT suggested_rect = (LPRECT)lParam; - - SetWindowPos( - hWnd, - NULL, - suggested_rect->left, - suggested_rect->top, - suggested_rect->right, - suggested_rect->bottom, - SWP_NOZORDER | SWP_NOACTIVATE); - } - - break; - } - case WM_ERASEBKGND: { - return TRUE; - } - case WM_DESTROY: { - lv_windows_window_context_t * context = (lv_windows_window_context_t *)( - RemovePropW(hWnd, L"LVGL.Window.Context")); - if(context) { - lv_display_t * display_device_object = - context->display_device_object; - context->display_device_object = NULL; - lv_display_delete(display_device_object); - DeleteDC(context->display_framebuffer_context_handle); - - lv_timer_delete(context->display_timer_object); - - HeapFree(GetProcessHeap(), 0, context); - } - - PostQuitMessage(0); - - break; - } - default: { - lv_windows_window_context_t * context = (lv_windows_window_context_t *)( - lv_windows_get_window_context(hWnd)); - if(context) { - if(context->pointer.indev && - lv_windows_pointer_device_window_message_handler( - hWnd, - uMsg, - wParam, - lParam, - plResult)) { - // Handled - return true; - } - else if(context->keypad.indev && - lv_windows_keypad_device_window_message_handler( - hWnd, - uMsg, - wParam, - lParam, - plResult)) { - // Handled - return true; - } - else if(context->encoder.indev && - lv_windows_encoder_device_window_message_handler( - hWnd, - uMsg, - wParam, - lParam, - plResult)) { - // Handled - return true; - } - } - - // Not Handled - return false; - } - } - - // Handled - *plResult = 0; - return true; -} - -static LRESULT CALLBACK lv_windows_window_message_callback( - HWND hWnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - lv_lock(); - - LRESULT lResult = 0; - bool Handled = lv_windows_window_message_callback_nolock( - hWnd, - uMsg, - wParam, - lParam, - &lResult); - - lv_unlock(); - - return Handled ? lResult : DefWindowProcW(hWnd, uMsg, wParam, lParam); -} - -#endif // LV_USE_WINDOWS diff --git a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_context.h b/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_context.h deleted file mode 100644 index c4fc941..0000000 --- a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_context.h +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @file lv_windows_context.h - * - */ - -#ifndef LV_WINDOWS_CONTEXT_H -#define LV_WINDOWS_CONTEXT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../display/lv_display.h" -#include "../../indev/lv_indev.h" - -#if LV_USE_WINDOWS - -#if LV_USE_OS != LV_OS_WINDOWS -#error [lv_windows] LV_OS_WINDOWS is required. Enable it in lv_conf.h (LV_USE_OS LV_OS_WINDOWS) -#endif - -#include - -#ifndef CREATE_WAITABLE_TIMER_MANUAL_RESET -#define CREATE_WAITABLE_TIMER_MANUAL_RESET 0x00000001 -#endif - -#ifndef CREATE_WAITABLE_TIMER_HIGH_RESOLUTION -#define CREATE_WAITABLE_TIMER_HIGH_RESOLUTION 0x00000002 -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct lv_windows_pointer_context_t { - lv_indev_state_t state; - lv_point_t point; - lv_indev_t * indev; -} lv_windows_pointer_context_t; - -typedef struct lv_windows_keypad_queue_item_t { - uint32_t key; - lv_indev_state_t state; -} lv_windows_keypad_queue_item_t; - -typedef struct lv_windows_keypad_context_t { - lv_ll_t queue; - uint16_t utf16_high_surrogate; - uint16_t utf16_low_surrogate; - lv_indev_t * indev; -} lv_windows_keypad_context_t; - -typedef struct lv_windows_encoder_context_t { - lv_indev_state_t state; - int16_t enc_diff; - lv_indev_t * indev; -} lv_windows_encoder_context_t; - -typedef struct lv_windows_window_context_t { - lv_display_t * display_device_object; - lv_timer_t * display_timer_object; - - int32_t window_dpi; - int32_t zoom_level; - bool allow_dpi_override; - bool simulator_mode; - bool display_resolution_changed; - lv_point_t requested_display_resolution; - - HDC display_framebuffer_context_handle; - uint32_t * display_framebuffer_base; - size_t display_framebuffer_size; - - lv_windows_pointer_context_t pointer; - lv_windows_keypad_context_t keypad; - lv_windows_encoder_context_t encoder; - -} lv_windows_window_context_t; - -typedef struct lv_windows_create_display_data_t { - const wchar_t * title; - int32_t hor_res; - int32_t ver_res; - int32_t zoom_level; - bool allow_dpi_override; - bool simulator_mode; - HANDLE mutex; - lv_display_t * display; -} lv_windows_create_display_data_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * @brief Initialize the LVGL Windows backend. - * @remark This is a private API which is used for LVGL Windows backend - * implementation. LVGL users shouldn't use that because the - * LVGL has already used it in lv_init. -*/ -void lv_windows_platform_init(void); - -/** - * @brief Get the window context from specific LVGL display window. - * @param window_handle The window handle of specific LVGL display window. - * @return The window context from specific LVGL display window. - * @remark This is a private API which is used for LVGL Windows backend - * implementation. LVGL users shouldn't use that because the - * maintainer doesn't promise the application binary interface - * compatibility for this API. -*/ -lv_windows_window_context_t * lv_windows_get_window_context( - HWND window_handle); - -/********************** - * MACROS - **********************/ - -#endif // LV_USE_WINDOWS - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_WINDOWS_CONTEXT_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_display.c b/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_display.c deleted file mode 100644 index 958338e..0000000 --- a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_display.c +++ /dev/null @@ -1,170 +0,0 @@ -/** - * @file lv_windows_display.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_windows_display.h" -#if LV_USE_WINDOWS - -#include "lv_windows_context.h" - -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static unsigned int __stdcall lv_windows_display_thread_entrypoint( - void * parameter); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_windows_create_display( - const wchar_t * title, - int32_t hor_res, - int32_t ver_res, - int32_t zoom_level, - bool allow_dpi_override, - bool simulator_mode) -{ - lv_windows_create_display_data_t data; - - lv_memzero(&data, sizeof(lv_windows_create_display_data_t)); - data.title = title; - data.hor_res = hor_res; - data.ver_res = ver_res; - data.zoom_level = zoom_level; - data.allow_dpi_override = allow_dpi_override; - data.simulator_mode = simulator_mode; - data.mutex = CreateEventExW(NULL, NULL, 0, EVENT_ALL_ACCESS); - data.display = NULL; - if(!data.mutex) { - return NULL; - } - - HANDLE thread = (HANDLE)_beginthreadex( - NULL, - 0, - lv_windows_display_thread_entrypoint, - &data, - 0, - NULL); - LV_ASSERT(thread); - - WaitForSingleObjectEx(data.mutex, INFINITE, FALSE); - - if(thread) { - CloseHandle(thread); - } - - if(data.mutex) { - CloseHandle(data.mutex); - } - - return data.display; -} - -HWND lv_windows_get_display_window_handle(lv_display_t * display) -{ - return (HWND)lv_display_get_driver_data(display); -} - -int32_t lv_windows_zoom_to_logical(int32_t physical, int32_t zoom_level) -{ - return MulDiv(physical, LV_WINDOWS_ZOOM_BASE_LEVEL, zoom_level); -} - -int32_t lv_windows_zoom_to_physical(int32_t logical, int32_t zoom_level) -{ - return MulDiv(logical, zoom_level, LV_WINDOWS_ZOOM_BASE_LEVEL); -} - -int32_t lv_windows_dpi_to_logical(int32_t physical, int32_t dpi) -{ - return MulDiv(physical, USER_DEFAULT_SCREEN_DPI, dpi); -} - -int32_t lv_windows_dpi_to_physical(int32_t logical, int32_t dpi) -{ - return MulDiv(logical, dpi, USER_DEFAULT_SCREEN_DPI); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static unsigned int __stdcall lv_windows_display_thread_entrypoint( - void * parameter) -{ - lv_windows_create_display_data_t * data = parameter; - LV_ASSERT_NULL(data); - - DWORD window_style = WS_OVERLAPPEDWINDOW; - if(data->simulator_mode) { - window_style &= ~(WS_SIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME); - } - - HWND window_handle = CreateWindowExW( - WS_EX_CLIENTEDGE, - L"LVGL.Window", - data->title, - window_style, - CW_USEDEFAULT, - 0, - data->hor_res, - data->ver_res, - NULL, - NULL, - NULL, - data); - if(!window_handle) { - return 0; - } - - lv_windows_window_context_t * context = lv_windows_get_window_context( - window_handle); - if(!context) { - return 0; - } - - data->display = context->display_device_object; - - ShowWindow(window_handle, SW_SHOW); - UpdateWindow(window_handle); - - LV_ASSERT(SetEvent(data->mutex)); - - data = NULL; - - MSG message; - while(GetMessageW(&message, NULL, 0, 0)) { - TranslateMessage(&message); - DispatchMessageW(&message); - } - - return 0; -} - -#endif // LV_USE_WINDOWS diff --git a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_display.h b/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_display.h deleted file mode 100644 index b9c6f8e..0000000 --- a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_display.h +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @file lv_windows_display.h - * - */ - -#ifndef LV_WINDOWS_DISPLAY_H -#define LV_WINDOWS_DISPLAY_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../display/lv_display.h" -#include "../../indev/lv_indev.h" - -#if LV_USE_WINDOWS - -#include - -/********************* - * DEFINES - *********************/ - -#define LV_WINDOWS_ZOOM_BASE_LEVEL 100 - -#ifndef USER_DEFAULT_SCREEN_DPI -#define USER_DEFAULT_SCREEN_DPI 96 -#endif - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * @brief Create a LVGL display object. - * @param title The window title of LVGL display. - * @param hor_res The horizontal resolution value of LVGL display. - * @param ver_res The vertical resolution value of LVGL display. - * @param zoom_level The zoom level value. Base value is 100 a.k.a 100%. - * @param allow_dpi_override Allow DPI override if true, or follow the - * Windows DPI scaling setting dynamically. - * @param simulator_mode Create simulator mode display if true, or create - * application mode display. - * @return The created LVGL display object. -*/ -lv_display_t * lv_windows_create_display( - const wchar_t * title, - int32_t hor_res, - int32_t ver_res, - int32_t zoom_level, - bool allow_dpi_override, - bool simulator_mode); - -/** - * @brief Get the window handle from specific LVGL display object. - * @param display The specific LVGL display object. - * @return The window handle from specific LVGL display object. -*/ -HWND lv_windows_get_display_window_handle(lv_display_t * display); - -/** - * @brief Get logical pixel value from physical pixel value taken account - * with zoom level. - * @param physical The physical pixel value taken account with zoom level. - * @param zoom_level The zoom level value. Base value is 100 a.k.a 100%. - * @return The logical pixel value. - * @remark It uses the same calculation style as Windows OS implementation. - * It will be useful for integrate LVGL Windows backend to other - * Windows applications. -*/ -int32_t lv_windows_zoom_to_logical(int32_t physical, int32_t zoom_level); - -/** - * @brief Get physical pixel value taken account with zoom level from - * logical pixel value. - * @param logical The logical pixel value. - * @param zoom_level The zoom level value. Base value is 100 a.k.a 100%. - * @return The physical pixel value taken account with zoom level. - * @remark It uses the same calculation style as Windows OS implementation. - * It will be useful for integrate LVGL Windows backend to other - * Windows applications. -*/ -int32_t lv_windows_zoom_to_physical(int32_t logical, int32_t zoom_level); - -/** - * @brief Get logical pixel value from physical pixel value taken account - * with DPI scaling. - * @param physical The physical pixel value taken account with DPI scaling. - * @param dpi The DPI scaling value. Base value is USER_DEFAULT_SCREEN_DPI. - * @return The logical pixel value. - * @remark It uses the same calculation style as Windows OS implementation. - * It will be useful for integrate LVGL Windows backend to other - * Windows applications. -*/ -int32_t lv_windows_dpi_to_logical(int32_t physical, int32_t dpi); - -/** - * @brief Get physical pixel value taken account with DPI scaling from - * logical pixel value. - * @param logical The logical pixel value. - * @param dpi The DPI scaling value. Base value is USER_DEFAULT_SCREEN_DPI. - * @return The physical pixel value taken account with DPI scaling. - * @remark It uses the same calculation style as Windows OS implementation. - * It will be useful for integrate LVGL Windows backend to other - * Windows applications. -*/ -int32_t lv_windows_dpi_to_physical(int32_t logical, int32_t dpi); - -/********************** - * MACROS - **********************/ - -#endif // LV_USE_WINDOWS - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_WINDOWS_DISPLAY_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input.c b/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input.c deleted file mode 100644 index d3b7816..0000000 --- a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input.c +++ /dev/null @@ -1,825 +0,0 @@ -/** - * @file lv_windows_input.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_windows_input.h" -#if LV_USE_WINDOWS - -#ifdef __GNUC__ - #pragma GCC diagnostic ignored "-Wcast-function-type" -#endif - -#include "lv_windows_context.h" -#include "lv_windows_display.h" -#include "lv_windows_input_private.h" -#include "../../misc/lv_text_private.h" -#include "../../core/lv_obj_private.h" - -#include - -#include "../../widgets/textarea/lv_textarea_private.h" -#include "../../widgets/keyboard/lv_keyboard.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void lv_windows_pointer_driver_read_callback( - lv_indev_t * indev, - lv_indev_data_t * data); - -static void lv_windows_release_pointer_device_event_callback(lv_event_t * e); - -static void lv_windows_keypad_driver_read_callback( - lv_indev_t * indev, - lv_indev_data_t * data); - -static void lv_windows_release_keypad_device_event_callback(lv_event_t * e); - -static void lv_windows_encoder_driver_read_callback( - lv_indev_t * indev, - lv_indev_data_t * data); - -static void lv_windows_release_encoder_device_event_callback(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -HWND lv_windows_get_indev_window_handle(lv_indev_t * indev) -{ - return lv_windows_get_display_window_handle(lv_indev_get_display(indev)); -} - -lv_indev_t * lv_windows_acquire_pointer_indev(lv_display_t * display) -{ - HWND window_handle = lv_windows_get_display_window_handle(display); - if(!window_handle) { - return NULL; - } - - lv_windows_window_context_t * context = lv_windows_get_window_context( - window_handle); - if(!context) { - return NULL; - } - - if(!context->pointer.indev) { - context->pointer.state = LV_INDEV_STATE_RELEASED; - context->pointer.point.x = 0; - context->pointer.point.y = 0; - - context->pointer.indev = lv_indev_create(); - if(context->pointer.indev) { - lv_indev_set_type( - context->pointer.indev, - LV_INDEV_TYPE_POINTER); - lv_indev_set_read_cb( - context->pointer.indev, - lv_windows_pointer_driver_read_callback); - lv_indev_set_display( - context->pointer.indev, - context->display_device_object); - lv_indev_add_event_cb( - context->pointer.indev, - lv_windows_release_pointer_device_event_callback, - LV_EVENT_DELETE, - context->pointer.indev); - lv_indev_set_group( - context->pointer.indev, - lv_group_get_default()); - } - } - - return context->pointer.indev; -} - -lv_indev_t * lv_windows_acquire_keypad_indev(lv_display_t * display) -{ - HWND window_handle = lv_windows_get_display_window_handle(display); - if(!window_handle) { - return NULL; - } - - lv_windows_window_context_t * context = lv_windows_get_window_context( - window_handle); - if(!context) { - return NULL; - } - - if(!context->keypad.indev) { - lv_ll_init( - &context->keypad.queue, - sizeof(lv_windows_keypad_queue_item_t)); - context->keypad.utf16_high_surrogate = 0; - context->keypad.utf16_low_surrogate = 0; - - context->keypad.indev = lv_indev_create(); - if(context->keypad.indev) { - lv_indev_set_type( - context->keypad.indev, - LV_INDEV_TYPE_KEYPAD); - lv_indev_set_read_cb( - context->keypad.indev, - lv_windows_keypad_driver_read_callback); - lv_indev_set_display( - context->keypad.indev, - context->display_device_object); - lv_indev_add_event_cb( - context->keypad.indev, - lv_windows_release_keypad_device_event_callback, - LV_EVENT_DELETE, - context->keypad.indev); - lv_indev_set_group( - context->keypad.indev, - lv_group_get_default()); - } - } - - return context->keypad.indev; -} - -lv_indev_t * lv_windows_acquire_encoder_indev(lv_display_t * display) -{ - HWND window_handle = lv_windows_get_display_window_handle(display); - if(!window_handle) { - return NULL; - } - - lv_windows_window_context_t * context = lv_windows_get_window_context( - window_handle); - if(!context) { - return NULL; - } - - if(!context->encoder.indev) { - context->encoder.state = LV_INDEV_STATE_RELEASED; - context->encoder.enc_diff = 0; - - context->encoder.indev = lv_indev_create(); - if(context->encoder.indev) { - lv_indev_set_type( - context->encoder.indev, - LV_INDEV_TYPE_ENCODER); - lv_indev_set_read_cb( - context->encoder.indev, - lv_windows_encoder_driver_read_callback); - lv_indev_set_display( - context->encoder.indev, - context->display_device_object); - lv_indev_add_event_cb( - context->encoder.indev, - lv_windows_release_encoder_device_event_callback, - LV_EVENT_DELETE, - context->encoder.indev); - lv_indev_set_group( - context->encoder.indev, - lv_group_get_default()); - } - } - - return context->encoder.indev; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_windows_pointer_driver_read_callback( - lv_indev_t * indev, - lv_indev_data_t * data) -{ - lv_windows_window_context_t * context = lv_windows_get_window_context( - lv_windows_get_indev_window_handle(indev)); - if(!context) { - return; - } - - data->state = context->pointer.state; - data->point = context->pointer.point; -} - -static void lv_windows_release_pointer_device_event_callback(lv_event_t * e) -{ - lv_indev_t * indev = (lv_indev_t *)lv_event_get_user_data(e); - if(!indev) { - return; - } - - HWND window_handle = lv_windows_get_indev_window_handle(indev); - if(!window_handle) { - return; - } - - lv_windows_window_context_t * context = lv_windows_get_window_context( - window_handle); - if(!context) { - return; - } - - context->pointer.state = LV_INDEV_STATE_RELEASED; - context->pointer.point.x = 0; - context->pointer.point.y = 0; - - context->pointer.indev = NULL; -} - -static BOOL lv_windows_get_touch_input_info( - HTOUCHINPUT touch_input_handle, - UINT input_count, - PTOUCHINPUT inputs, - int item_size) -{ - HMODULE module_handle = GetModuleHandleW(L"user32.dll"); - if(!module_handle) { - return FALSE; - } - - typedef BOOL(WINAPI * function_type)(HTOUCHINPUT, UINT, PTOUCHINPUT, int); - - function_type function = (function_type)( - GetProcAddress(module_handle, "GetTouchInputInfo")); - if(!function) { - return FALSE; - } - - return function(touch_input_handle, input_count, inputs, item_size); -} - -static BOOL lv_windows_close_touch_input_handle( - HTOUCHINPUT touch_input_handle) -{ - HMODULE module_handle = GetModuleHandleW(L"user32.dll"); - if(!module_handle) { - return FALSE; - } - - typedef BOOL(WINAPI * function_type)(HTOUCHINPUT); - - function_type function = (function_type)( - GetProcAddress(module_handle, "CloseTouchInputHandle")); - if(!function) { - return FALSE; - } - - return function(touch_input_handle); -} - -bool lv_windows_pointer_device_window_message_handler( - HWND hWnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam, - LRESULT * plResult) -{ - switch(uMsg) { - case WM_MOUSEMOVE: { - lv_windows_window_context_t * context = (lv_windows_window_context_t *)( - lv_windows_get_window_context(hWnd)); - if(context) { - int32_t hor_res = lv_display_get_horizontal_resolution( - context->display_device_object); - int32_t ver_res = lv_display_get_vertical_resolution( - context->display_device_object); - - context->pointer.point.x = lv_windows_zoom_to_logical( - GET_X_LPARAM(lParam), - context->zoom_level); - context->pointer.point.y = lv_windows_zoom_to_logical( - GET_Y_LPARAM(lParam), - context->zoom_level); - if(context->simulator_mode) { - context->pointer.point.x = lv_windows_dpi_to_logical( - context->pointer.point.x, - context->window_dpi); - context->pointer.point.y = lv_windows_dpi_to_logical( - context->pointer.point.y, - context->window_dpi); - } - if(context->pointer.point.x < 0) { - context->pointer.point.x = 0; - } - if(context->pointer.point.x > hor_res - 1) { - context->pointer.point.x = hor_res - 1; - } - if(context->pointer.point.y < 0) { - context->pointer.point.y = 0; - } - if(context->pointer.point.y > ver_res - 1) { - context->pointer.point.y = ver_res - 1; - } - } - - break; - } - case WM_LBUTTONDOWN: - case WM_LBUTTONUP: { - lv_windows_window_context_t * context = (lv_windows_window_context_t *)( - lv_windows_get_window_context(hWnd)); - if(context) { - context->pointer.state = ( - uMsg == WM_LBUTTONDOWN - ? LV_INDEV_STATE_PRESSED - : LV_INDEV_STATE_RELEASED); - } - - break; - } - case WM_TOUCH: { - lv_windows_window_context_t * context = (lv_windows_window_context_t *)( - lv_windows_get_window_context(hWnd)); - if(context) { - UINT input_count = LOWORD(wParam); - HTOUCHINPUT touch_input_handle = (HTOUCHINPUT)(lParam); - - PTOUCHINPUT inputs = malloc(input_count * sizeof(TOUCHINPUT)); - if(inputs) { - if(lv_windows_get_touch_input_info( - touch_input_handle, - input_count, - inputs, - sizeof(TOUCHINPUT))) { - for(UINT i = 0; i < input_count; ++i) { - POINT Point; - Point.x = TOUCH_COORD_TO_PIXEL(inputs[i].x); - Point.y = TOUCH_COORD_TO_PIXEL(inputs[i].y); - if(!ScreenToClient(hWnd, &Point)) { - continue; - } - - context->pointer.point.x = lv_windows_zoom_to_logical( - Point.x, - context->zoom_level); - context->pointer.point.y = lv_windows_zoom_to_logical( - Point.y, - context->zoom_level); - if(context->simulator_mode) { - context->pointer.point.x = lv_windows_dpi_to_logical( - context->pointer.point.x, - context->window_dpi); - context->pointer.point.y = lv_windows_dpi_to_logical( - context->pointer.point.y, - context->window_dpi); - } - - DWORD MousePressedMask = - TOUCHEVENTF_MOVE | TOUCHEVENTF_DOWN; - - context->pointer.state = ( - inputs[i].dwFlags & MousePressedMask - ? LV_INDEV_STATE_PRESSED - : LV_INDEV_STATE_RELEASED); - } - } - - free(inputs); - } - - lv_windows_close_touch_input_handle(touch_input_handle); - } - - break; - } - default: - // Not Handled - return false; - } - - // Handled - *plResult = 0; - return true; -} - -static void lv_windows_keypad_driver_read_callback( - lv_indev_t * indev, - lv_indev_data_t * data) -{ - lv_windows_window_context_t * context = lv_windows_get_window_context( - lv_windows_get_indev_window_handle(indev)); - if(!context) { - return; - } - - lv_windows_keypad_queue_item_t * current = (lv_windows_keypad_queue_item_t *)( - lv_ll_get_head(&context->keypad.queue)); - if(current) { - data->key = current->key; - data->state = current->state; - - lv_ll_remove(&context->keypad.queue, current); - lv_free(current); - - data->continue_reading = true; - } -} - -static void lv_windows_release_keypad_device_event_callback(lv_event_t * e) -{ - lv_indev_t * indev = (lv_indev_t *)lv_event_get_user_data(e); - if(!indev) { - return; - } - - HWND window_handle = lv_windows_get_indev_window_handle(indev); - if(!window_handle) { - return; - } - - lv_windows_window_context_t * context = lv_windows_get_window_context( - window_handle); - if(!context) { - return; - } - - lv_ll_clear(&context->keypad.queue); - context->keypad.utf16_high_surrogate = 0; - context->keypad.utf16_low_surrogate = 0; - - context->keypad.indev = NULL; -} - -static void lv_windows_push_key_to_keyboard_queue( - lv_windows_window_context_t * context, - uint32_t key, - lv_indev_state_t state) -{ - lv_windows_keypad_queue_item_t * current = (lv_windows_keypad_queue_item_t *)( - lv_ll_ins_tail(&context->keypad.queue)); - if(current) { - current->key = key; - current->state = state; - } -} - -static HIMC lv_windows_imm_get_context( - HWND window_handle) -{ - HMODULE module_handle = GetModuleHandleW(L"imm32.dll"); - if(!module_handle) { - return FALSE; - } - - typedef HIMC(WINAPI * function_type)(HWND); - - function_type function = (function_type)( - GetProcAddress(module_handle, "ImmGetContext")); - if(!function) { - return FALSE; - } - - return function(window_handle); -} - -static BOOL lv_windows_imm_release_context( - HWND window_handle, - HIMC imm_context_handle) -{ - HMODULE module_handle = GetModuleHandleW(L"imm32.dll"); - if(!module_handle) { - return FALSE; - } - - typedef BOOL(WINAPI * function_type)(HWND, HIMC); - - function_type function = (function_type)( - GetProcAddress(module_handle, "ImmReleaseContext")); - if(!function) { - return FALSE; - } - - return function(window_handle, imm_context_handle); -} - -static HIMC lv_windows_imm_associate_context( - HWND window_handle, - HIMC imm_context_handle) -{ - HMODULE module_handle = GetModuleHandleW(L"imm32.dll"); - if(!module_handle) { - return FALSE; - } - - typedef HIMC(WINAPI * function_type)(HWND, HIMC); - - function_type function = (function_type)( - GetProcAddress(module_handle, "ImmAssociateContext")); - if(!function) { - return FALSE; - } - - return function(window_handle, imm_context_handle); -} - -static BOOL lv_windows_imm_set_composition_window( - HIMC imm_context_handle, - LPCOMPOSITIONFORM composition_form) -{ - HMODULE module_handle = GetModuleHandleW(L"imm32.dll"); - if(!module_handle) { - return FALSE; - } - - typedef BOOL(WINAPI * function_type)(HIMC, LPCOMPOSITIONFORM); - - function_type function = (function_type)( - GetProcAddress(module_handle, "ImmSetCompositionWindow")); - if(!function) { - return FALSE; - } - - return function(imm_context_handle, composition_form); -} - -bool lv_windows_keypad_device_window_message_handler( - HWND hWnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam, - LRESULT * plResult) -{ - LV_UNUSED(lParam); - - switch(uMsg) { - case WM_KEYDOWN: - case WM_KEYUP: { - lv_windows_window_context_t * context = (lv_windows_window_context_t *)( - lv_windows_get_window_context(hWnd)); - if(context) { - bool skip_translation = false; - uint32_t translated_key = 0; - - switch(wParam) { - case VK_UP: - translated_key = LV_KEY_UP; - break; - case VK_DOWN: - translated_key = LV_KEY_DOWN; - break; - case VK_LEFT: - translated_key = LV_KEY_LEFT; - break; - case VK_RIGHT: - translated_key = LV_KEY_RIGHT; - break; - case VK_ESCAPE: - translated_key = LV_KEY_ESC; - break; - case VK_DELETE: - translated_key = LV_KEY_DEL; - break; - case VK_BACK: - translated_key = LV_KEY_BACKSPACE; - break; - case VK_RETURN: - translated_key = LV_KEY_ENTER; - break; - case VK_TAB: - case VK_NEXT: - translated_key = LV_KEY_NEXT; - break; - case VK_PRIOR: - translated_key = LV_KEY_PREV; - break; - case VK_HOME: - translated_key = LV_KEY_HOME; - break; - case VK_END: - translated_key = LV_KEY_END; - break; - default: - skip_translation = true; - break; - } - - if(!skip_translation) { - lv_windows_push_key_to_keyboard_queue( - context, - translated_key, - ((uMsg == WM_KEYUP) - ? LV_INDEV_STATE_RELEASED - : LV_INDEV_STATE_PRESSED)); - } - } - - break; - } - case WM_CHAR: { - lv_windows_window_context_t * context = (lv_windows_window_context_t *)( - lv_windows_get_window_context(hWnd)); - if(context) { - uint16_t raw_code_point = (uint16_t)(wParam); - - if(raw_code_point >= 0x20 && raw_code_point != 0x7F) { - if(IS_HIGH_SURROGATE(raw_code_point)) { - context->keypad.utf16_high_surrogate = raw_code_point; - } - else if(IS_LOW_SURROGATE(raw_code_point)) { - context->keypad.utf16_low_surrogate = raw_code_point; - } - - uint32_t code_point = raw_code_point; - - if(context->keypad.utf16_high_surrogate && - context->keypad.utf16_low_surrogate) { - uint16_t high_surrogate = - context->keypad.utf16_high_surrogate; - uint16_t low_surrogate = - context->keypad.utf16_low_surrogate; - - code_point = (low_surrogate & 0x03FF); - code_point += (((high_surrogate & 0x03FF) + 0x40) << 10); - - context->keypad.utf16_high_surrogate = 0; - context->keypad.utf16_low_surrogate = 0; - } - - uint32_t lvgl_code_point = - lv_text_unicode_to_encoded(code_point); - - lv_windows_push_key_to_keyboard_queue( - context, - lvgl_code_point, - LV_INDEV_STATE_PRESSED); - lv_windows_push_key_to_keyboard_queue( - context, - lvgl_code_point, - LV_INDEV_STATE_RELEASED); - } - } - - break; - } - case WM_IME_SETCONTEXT: { - if(wParam == TRUE) { - HIMC imm_context_handle = lv_windows_imm_get_context(hWnd); - if(imm_context_handle) { - lv_windows_imm_associate_context( - hWnd, - imm_context_handle); - lv_windows_imm_release_context( - hWnd, - imm_context_handle); - } - } - - *plResult = DefWindowProcW(hWnd, uMsg, wParam, wParam); - break; - } - case WM_IME_STARTCOMPOSITION: { - HIMC imm_context_handle = lv_windows_imm_get_context(hWnd); - if(imm_context_handle) { - lv_obj_t * textarea_object = NULL; - lv_obj_t * focused_object = lv_group_get_focused( - lv_group_get_default()); - if(focused_object) { - const lv_obj_class_t * object_class = lv_obj_get_class( - focused_object); - - if(object_class == &lv_textarea_class) { - textarea_object = focused_object; - } - else if(object_class == &lv_keyboard_class) { - textarea_object = lv_keyboard_get_textarea(focused_object); - } - } - - COMPOSITIONFORM composition_form; - composition_form.dwStyle = CFS_POINT; - composition_form.ptCurrentPos.x = 0; - composition_form.ptCurrentPos.y = 0; - - if(textarea_object) { - lv_textarea_t * textarea = (lv_textarea_t *)(textarea_object); - lv_obj_t * label_object = lv_textarea_get_label(textarea_object); - - composition_form.ptCurrentPos.x = - label_object->coords.x1 + textarea->cursor.area.x1; - composition_form.ptCurrentPos.y = - label_object->coords.y1 + textarea->cursor.area.y1; - } - - lv_windows_imm_set_composition_window( - imm_context_handle, - &composition_form); - lv_windows_imm_release_context( - hWnd, - imm_context_handle); - } - - *plResult = DefWindowProcW(hWnd, uMsg, wParam, wParam); - break; - } - default: - // Not Handled - return false; - } - - // Handled - *plResult = 0; - return true; -} - -static void lv_windows_encoder_driver_read_callback( - lv_indev_t * indev, - lv_indev_data_t * data) -{ - lv_windows_window_context_t * context = lv_windows_get_window_context( - lv_windows_get_indev_window_handle(indev)); - if(!context) { - return; - } - - data->state = context->encoder.state; - data->enc_diff = context->encoder.enc_diff; - context->encoder.enc_diff = 0; -} - -static void lv_windows_release_encoder_device_event_callback(lv_event_t * e) -{ - lv_indev_t * indev = (lv_indev_t *)lv_event_get_user_data(e); - if(!indev) { - return; - } - - HWND window_handle = lv_windows_get_indev_window_handle(indev); - if(!window_handle) { - return; - } - - lv_windows_window_context_t * context = lv_windows_get_window_context( - window_handle); - if(!context) { - return; - } - - context->encoder.state = LV_INDEV_STATE_RELEASED; - context->encoder.enc_diff = 0; - - context->encoder.indev = NULL; -} - -bool lv_windows_encoder_device_window_message_handler( - HWND hWnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam, - LRESULT * plResult) -{ - LV_UNUSED(lParam); - - switch(uMsg) { - case WM_MBUTTONDOWN: - case WM_MBUTTONUP: { - lv_windows_window_context_t * context = (lv_windows_window_context_t *)( - lv_windows_get_window_context(hWnd)); - if(context) { - context->encoder.state = ( - uMsg == WM_MBUTTONDOWN - ? LV_INDEV_STATE_PRESSED - : LV_INDEV_STATE_RELEASED); - } - - break; - } - case WM_MOUSEWHEEL: { - lv_windows_window_context_t * context = (lv_windows_window_context_t *)( - lv_windows_get_window_context(hWnd)); - if(context) { - context->encoder.enc_diff = - -(GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA); - } - - break; - } - default: - // Not Handled - return false; - } - - // Handled - *plResult = 0; - return true; -} - -#endif // LV_USE_WINDOWS diff --git a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input.h b/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input.h deleted file mode 100644 index 892014e..0000000 --- a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file lv_windows_input.h - * - */ - -#ifndef LV_WINDOWS_INPUT_H -#define LV_WINDOWS_INPUT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../display/lv_display.h" -#include "../../indev/lv_indev.h" - -#if LV_USE_WINDOWS - -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * @brief Get the window handle from specific LVGL input device object. - * @param indev The specific LVGL input device object. - * @return The window handle from specific LVGL input device object. -*/ -HWND lv_windows_get_indev_window_handle(lv_indev_t * indev); - -/** - * @brief Open a LVGL pointer input device object for the specific LVGL - * display object, or create it if the LVGL pointer input device - * object is not created or removed before. - * @param display The specific LVGL display object. - * @return The LVGL pointer input device object for the specific LVGL - * display object. -*/ -lv_indev_t * lv_windows_acquire_pointer_indev(lv_display_t * display); - -/** - * @brief Open a LVGL keypad input device object for the specific LVGL - * display object, or create it if the LVGL keypad input device - * object is not created or removed before. - * @param display The specific LVGL display object. - * @return The LVGL keypad input device object for the specific LVGL - * display object. -*/ -lv_indev_t * lv_windows_acquire_keypad_indev(lv_display_t * display); - -/** - * @brief Open a LVGL encoder input device object for the specific LVGL - * display object, or create it if the LVGL encoder input device - * object is not created or removed before. - * @param display The specific LVGL display object. - * @return The LVGL encoder input device object for the specific LVGL - * display object. -*/ -lv_indev_t * lv_windows_acquire_encoder_indev(lv_display_t * display); - -/********************** - * MACROS - **********************/ - -#endif // LV_USE_WINDOWS - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_WINDOWS_INPUT_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input_private.h b/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input_private.h deleted file mode 100644 index 7d1096e..0000000 --- a/L3_Middlewares/LVGL/src/drivers/windows/lv_windows_input_private.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @file lv_windows_input_private.h - * - */ - -#ifndef LV_WINDOWS_INPUT_PRIVATE_H -#define LV_WINDOWS_INPUT_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#if LV_USE_WINDOWS - -#include -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -bool lv_windows_pointer_device_window_message_handler( - HWND hWnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam, - LRESULT * plResult); - -bool lv_windows_keypad_device_window_message_handler( - HWND hWnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam, - LRESULT * plResult); - -bool lv_windows_encoder_device_window_message_handler( - HWND hWnd, - UINT uMsg, - WPARAM wParam, - LPARAM lParam, - LRESULT * plResult); - -/********************** - * MACROS - **********************/ - -#endif // LV_USE_WINDOWS - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_WINDOWS_INPUT_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/x11/lv_x11.h b/L3_Middlewares/LVGL/src/drivers/x11/lv_x11.h deleted file mode 100644 index 7daabe3..0000000 --- a/L3_Middlewares/LVGL/src/drivers/x11/lv_x11.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @file lv_x11.h - * - */ - -#ifndef LV_X11_H -#define LV_X11_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../display/lv_display.h" -#include "../../indev/lv_indev.h" - -#if LV_USE_X11 - -/********************* - * DEFINES - *********************/ - -/** Header of private display driver user data - for internal use only */ -typedef struct { - struct _XDisplay * display; /**< X11 display object */ - struct _x11_inp_data * inp_data; /**< input user data object */ -} _x11_user_hdr_t; - -/** optional window close callback function type - * @see lv_x11_window_set_close_cb -*/ -typedef void(*lv_x11_close_cb)(void * user_data); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * create and add keyboard, mouse and scrollwheel objects and connect them to x11 display. - * - * This is a convenience method handling the typical input initialisation of an X11 window: - * - create keyboard (lv_x11_keyboard_create) - * - create mouse (with scrollwheel, lv_x11_mouse_create lv_x11_mousewheel_create) - * - * @param[in] disp the created X11 display object from @ref lv_x11_window_create - * @param[in] mouse_img optional image description for the mouse cursor (NULL for no/invisible mouse cursor) - */ -void lv_x11_inputs_create(lv_display_t * disp, lv_image_dsc_t const * mouse_img); - -/** - * create the X11 display - * - * The minimal initialisation for initializing the X11 display driver with keyboard/mouse support: - * @code - * lv_display_t* disp = lv_x11_window_create("My Window Title", window_width, window_width); - * lv_x11_inputs_create(disp, NULL); - * @endcode - * or with mouse cursor icon: - * @code - * lv_image_dsc_t mouse_symbol = {.....}; - * lv_display_t* disp = lv_x11_window_create("My Window Title", window_width, window_width); - * lv_x11_inputs_create(disp, &mouse_symbol); - * @endcode - * - * @param[in] title title of the created X11 window - * @param[in] hor_res horizontal resolution (=width) of the X11 window - * @param[in] ver_res vertical resolution (=height) of the X11 window - * @return pointer to the display object - */ -lv_display_t * lv_x11_window_create(char const * title, int32_t hor_res, int32_t ver_res); - -#endif /* LV_USE_X11 */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_X11_H */ diff --git a/L3_Middlewares/LVGL/src/drivers/x11/lv_x11_display.c b/L3_Middlewares/LVGL/src/drivers/x11/lv_x11_display.c deleted file mode 100644 index 1a2b83c..0000000 --- a/L3_Middlewares/LVGL/src/drivers/x11/lv_x11_display.c +++ /dev/null @@ -1,394 +0,0 @@ -/** - * @file lv_x11_display.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_x11.h" - -#if LV_USE_X11 - -#include -#include -#include -#include -#include -#include -#include "../../core/lv_obj_pos.h" - -/********************* - * DEFINES - *********************/ -#define MIN(A, B) ((A) < (B) ? (A) : (B)) -#define MAX(A, B) ((A) > (B) ? (A) : (B)) - -#if LV_X11_RENDER_MODE_PARTIAL - #define LV_X11_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL -#elif defined LV_X11_RENDER_MODE_DIRECT - #define LV_X11_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT -#elif defined LV_X11_RENDER_MODE_FULL - #define LV_X11_RENDER_MODE LV_DISPLAY_RENDER_MODE_FULL -#endif - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - /* header (containing X Display + input user data pointer - keep aligned with x11_input module!) */ - _x11_user_hdr_t hdr; - /* X11 related information */ - Window window; /**< X11 window object */ - GC gc; /**< X11 graphics context object */ - Visual * visual; /**< X11 visual */ - int dplanes; /**< X11 display depth */ - XImage * ximage; /**< X11 XImage cache object for updating window content */ - Atom wmDeleteMessage; /**< X11 atom to window object */ - void * xdata; /**< allocated data for XImage */ - /* LVGL related information */ - lv_timer_t * timer; /**< timer object for @ref x11_event_handler */ - uint8_t * buffer[2]; /**< (double) lv display buffers, depending on @ref LV_X11_RENDER_MODE */ - lv_area_t flush_area; /**< integrated area for a display update */ - /* systemtick by thread related information */ - pthread_t thr_tick; /**< pthread for SysTick simulation */ - bool terminated; /**< flag to germinate SysTick simulation thread */ -} x11_disp_data_t; - -/********************** - * STATIC VARIABLES - **********************/ -#if LV_X11_DIRECT_EXIT - static unsigned int count_windows = 0; -#endif - -/********************** - * MACROS - **********************/ - -/********************** - * STATIC FUNCTIONS - **********************/ - -#if LV_COLOR_DEPTH == 32 -typedef lv_color32_t color_t; -static inline lv_color32_t get_px(color_t p) -{ - return (lv_color32_t)p; -} -#elif LV_COLOR_DEPTH == 24 -typedef lv_color_t color_t; -static inline lv_color32_t get_px(color_t p) -{ - lv_color32_t out = { .red = p.red, .green = p.green, .blue = p.blue }; - return out; -} -#elif LV_COLOR_DEPTH == 16 -typedef lv_color16_t color_t; -static inline lv_color32_t get_px(color_t p) -{ - lv_color32_t out = { .red = p.red << 3, .green = p.green << 2, .blue = p.blue << 3 }; - return out; -} -#elif LV_COLOR_DEPTH == 8 -typedef uint8_t color_t; -static inline lv_color32_t get_px(color_t p) -{ - lv_color32_t out = { .red = p, .green = p, .blue = p }; - return out; -} -#warning ("LV_COLOR_DEPTH=8 delivers black data only - open issue in lvgl?") -#else -#error ("Unsupported LV_COLOR_DEPTH") -#endif - -/** - * Flush the content of the internal buffer the specific area on the display. - * @param[in] disp the created X11 display object from @lv_x11_window_create - * @param[in] area area to be updated - * @param[in] px_map contains the rendered image as raw pixel map and it should be copied to `area` on the display. - * @note @ref lv_display_flush_ready has to be called when it's finished. - */ -static void x11_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map) -{ - x11_disp_data_t * xd = lv_display_get_driver_data(disp); - LV_ASSERT_NULL(xd); - - static const lv_area_t inv_area = { .x1 = 0xFFFF, - .x2 = 0, - .y1 = 0xFFFF, - .y2 = 0 - }; - - /* build display update area until lv_display_flush_is_last */ - xd->flush_area.x1 = MIN(xd->flush_area.x1, area->x1); - xd->flush_area.x2 = MAX(xd->flush_area.x2, area->x2); - xd->flush_area.y1 = MIN(xd->flush_area.y1, area->y1); - xd->flush_area.y2 = MAX(xd->flush_area.y2, area->y2); - - int32_t hor_res = lv_display_get_horizontal_resolution(disp); - - uint32_t dst_offs; - lv_color32_t * dst_data; - color_t * src_data = (color_t *)px_map + (LV_X11_RENDER_MODE == LV_DISPLAY_RENDER_MODE_PARTIAL ? 0 : hor_res * - area->y1 + area->x1); - for(int16_t y = area->y1; y <= area->y2; y++) { - dst_offs = area->x1 + y * hor_res; - dst_data = &((lv_color32_t *)(xd->xdata))[dst_offs]; - for(int16_t x = area->x1; x <= area->x2; x++, src_data++, dst_data++) { - *dst_data = get_px(*src_data); - } - src_data += (LV_X11_RENDER_MODE == LV_DISPLAY_RENDER_MODE_PARTIAL ? 0 : hor_res - (area->x2 - area->x1 + 1)); - } - - if(lv_display_flush_is_last(disp)) { - LV_LOG_TRACE("(%d/%d), %dx%d)", xd->flush_area.x1, xd->flush_area.y1, xd->flush_area.x2 + 1 - xd->flush_area.x1, - xd->flush_area.y2 + 1 - xd->flush_area.y1); - - /* refresh collected display update area only */ - int16_t upd_w = xd->flush_area.x2 - xd->flush_area.x1 + 1; - int16_t upd_h = xd->flush_area.y2 - xd->flush_area.y1 + 1; - XPutImage(xd->hdr.display, xd->window, xd->gc, xd->ximage, xd->flush_area.x1, xd->flush_area.y1, xd->flush_area.x1, - xd->flush_area.y1, upd_w, upd_h); - - /* invalidate collected area */ - xd->flush_area = inv_area; - } - /* Inform the graphics library that you are ready with the flushing */ - lv_display_flush_ready(disp); -} - -/** - * event called by lvgl display if resolution has been changed (@ref lv_display_set_resolution has been called) - * @param[in] e event data, containing lv_display_t object - */ -static void x11_resolution_evt_cb(lv_event_t * e) -{ - lv_display_t * disp = lv_event_get_user_data(e); - x11_disp_data_t * xd = lv_display_get_driver_data(disp); - LV_ASSERT_NULL(xd); - - int32_t hor_res = lv_display_get_horizontal_resolution(disp); - int32_t ver_res = lv_display_get_vertical_resolution(disp); - - if(LV_X11_RENDER_MODE != LV_DISPLAY_RENDER_MODE_PARTIAL) { - /* update lvgl full-screen display draw buffers for new display size */ - int sz_buffers = (hor_res * ver_res * (LV_COLOR_DEPTH + 7) / 8); - xd->buffer[0] = realloc(xd->buffer[0], sz_buffers); - xd->buffer[1] = (LV_X11_DOUBLE_BUFFER ? realloc(xd->buffer[1], sz_buffers) : NULL); - lv_display_set_buffers(disp, xd->buffer[0], xd->buffer[1], sz_buffers, LV_X11_RENDER_MODE); - } - - /* re-create cache image with new size */ - XDestroyImage(xd->ximage); - size_t sz_buffers = hor_res * ver_res * sizeof(lv_color32_t); - xd->xdata = malloc(sz_buffers); /* use clib method here, x11 memory not part of device footprint */ - xd->ximage = XCreateImage(xd->hdr.display, xd->visual, xd->dplanes, ZPixmap, 0, xd->xdata, - hor_res, ver_res, lv_color_format_get_bpp(LV_COLOR_FORMAT_ARGB8888), 0); -} - -/** - * event called by lvgl display if display has been closed (@ref lv_display_delete has been called) - * @param[in] e event data, containing lv_display_t object - */ -static void x11_disp_delete_evt_cb(lv_event_t * e) -{ - lv_display_t * disp = lv_event_get_user_data(e); - x11_disp_data_t * xd = lv_display_get_driver_data(disp); - - lv_timer_delete(xd->timer); - - free(xd->buffer[0]); - if(LV_X11_DOUBLE_BUFFER) { - free(xd->buffer[1]); - } - - XDestroyImage(xd->ximage); - XFreeGC(xd->hdr.display, xd->gc); - XUnmapWindow(xd->hdr.display, xd->window); - XDestroyWindow(xd->hdr.display, xd->window); - XFlush(xd->hdr.display); - - lv_free(xd); -#if LV_X11_DIRECT_EXIT - if(0 == --count_windows) { - exit(0); - } -#endif -} - -static void x11_hide_cursor(lv_display_t * disp) -{ - x11_disp_data_t * xd = lv_display_get_driver_data(disp); - LV_ASSERT_NULL(xd); - - XColor black = { .red = 0, .green = 0, .blue = 0 }; - char empty_data[] = { 0 }; - - Pixmap empty_bitmap = XCreateBitmapFromData(xd->hdr.display, xd->window, empty_data, 1, 1); - Cursor inv_cursor = XCreatePixmapCursor(xd->hdr.display, empty_bitmap, empty_bitmap, &black, &black, 0, 0); - XDefineCursor(xd->hdr.display, xd->window, inv_cursor); - XFreeCursor(xd->hdr.display, inv_cursor); - XFreePixmap(xd->hdr.display, empty_bitmap); -} - -/** - * X11 input event handler, predicated to fetch and handle only display related events - * (Window changes) - */ -static int is_disp_event(Display * disp, XEvent * event, XPointer arg) -{ - LV_UNUSED(disp); - LV_UNUSED(arg); - return (event->type == Expose - || (event->type >= DestroyNotify && event->type <= CirculateNotify) /* events from StructureNotifyMask */ - || event->type == ClientMessage); -} -static void x11_event_handler(lv_timer_t * t) -{ - lv_display_t * disp = lv_timer_get_user_data(t); - x11_disp_data_t * xd = lv_display_get_driver_data(disp); - LV_ASSERT_NULL(xd); - - /* handle all outstanding X events */ - XEvent event; - while(XCheckIfEvent(xd->hdr.display, &event, is_disp_event, NULL)) { - LV_LOG_TRACE("Display Event %d", event.type); - switch(event.type) { - case Expose: - if(event.xexpose.count == 0) { - XPutImage(xd->hdr.display, xd->window, xd->gc, xd->ximage, 0, 0, 0, 0, event.xexpose.width, event.xexpose.height); - } - break; - case ConfigureNotify: - if(event.xconfigure.width != lv_display_get_horizontal_resolution(disp) - || event.xconfigure.height != lv_display_get_vertical_resolution(disp)) { - lv_display_set_resolution(disp, event.xconfigure.width, event.xconfigure.height); - } - break; - case ClientMessage: - if(event.xclient.data.l[0] == (long)xd->wmDeleteMessage) { - xd->terminated = true; - void * ret = NULL; - pthread_join(xd->thr_tick, &ret); - lv_display_delete(disp); - return; - } - break; - case MapNotify: - case ReparentNotify: - /*suppress unhandled warning*/ - break; - default: - LV_LOG_WARN("unhandled x11 event: %d", event.type); - } - } -} - -static void * x11_tick_thread(void * data) -{ - x11_disp_data_t * xd = data; - LV_ASSERT_NULL(xd); - - while(!xd->terminated) { - usleep(5000); - lv_tick_inc(5); - } - return NULL; -} - -static void x11_window_create(lv_display_t * disp, char const * title) -{ - x11_disp_data_t * xd = lv_display_get_driver_data(disp); - LV_ASSERT_NULL(xd); - - /* setup display/screen */ - xd->hdr.display = XOpenDisplay(NULL); - int screen = XDefaultScreen(xd->hdr.display); - xd->visual = XDefaultVisual(xd->hdr.display, screen); - - /* create window */ - int32_t hor_res = lv_display_get_horizontal_resolution(disp); - int32_t ver_res = lv_display_get_vertical_resolution(disp); -#if 0 - /* drawing contexts for an window */ - unsigned long col_fg = BlackPixel(xd->hdr.display, screen); - unsigned long col_bg = WhitePixel(xd->hdr.display, screen); - - xd->window = XCreateSimpleWindow(xd->hdr.display, DefaultRootWindow(xd->hdr.display), - 0, 0, hor_res, ver_res, 0, col_fg, col_bg); -#else - xd->window = XCreateWindow(xd->hdr.display, XDefaultRootWindow(xd->hdr.display), - 0, 0, hor_res, ver_res, 0, - XDefaultDepth(xd->hdr.display, screen), InputOutput, - xd->visual, 0, NULL); -#endif - /* window manager properties (yes, use of StdProp is obsolete) */ - XSetStandardProperties(xd->hdr.display, xd->window, title, NULL, None, NULL, 0, NULL); - xd->gc = XCreateGC(xd->hdr.display, xd->window, 0, 0); - - /* allow receiving mouse, keyboard and window change/close events */ - XSelectInput(xd->hdr.display, xd->window, - PointerMotionMask | ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask | ExposureMask | - StructureNotifyMask); - xd->wmDeleteMessage = XInternAtom(xd->hdr.display, "WM_DELETE_WINDOW", False); - XSetWMProtocols(xd->hdr.display, xd->window, &xd->wmDeleteMessage, 1); - - x11_hide_cursor(disp); - - /* create cache XImage */ - size_t sz_buffers = hor_res * ver_res * sizeof(lv_color32_t); - xd->dplanes = XDisplayPlanes(xd->hdr.display, screen); - xd->xdata = malloc(sz_buffers); /* use clib method here, x11 memory not part of device footprint */ - xd->ximage = XCreateImage(xd->hdr.display, xd->visual, xd->dplanes, ZPixmap, 0, xd->xdata, - hor_res, ver_res, lv_color_format_get_bpp(LV_COLOR_FORMAT_ARGB8888), 0); - - /* finally bring window on top of the other windows */ - XMapRaised(xd->hdr.display, xd->window); - -#if LV_X11_DIRECT_EXIT - count_windows++; -#endif -} - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_display_t * lv_x11_window_create(char const * title, int32_t hor_res, int32_t ver_res) -{ - x11_disp_data_t * xd = lv_malloc_zeroed(sizeof(x11_disp_data_t)); - LV_ASSERT_MALLOC(xd); - if(NULL == xd) return NULL; - - lv_display_t * disp = lv_display_create(hor_res, ver_res); - if(NULL == disp) { - lv_free(xd); - return NULL; - } - lv_display_set_driver_data(disp, xd); - lv_display_set_flush_cb(disp, x11_flush_cb); - lv_display_add_event_cb(disp, x11_resolution_evt_cb, LV_EVENT_RESOLUTION_CHANGED, disp); - lv_display_add_event_cb(disp, x11_disp_delete_evt_cb, LV_EVENT_DELETE, disp); - - x11_window_create(disp, title); - - int sz_buffers = (hor_res * ver_res * (LV_COLOR_DEPTH + 7) / 8); - if(LV_X11_RENDER_MODE == LV_DISPLAY_RENDER_MODE_PARTIAL) { - sz_buffers /= 10; - } - xd->buffer[0] = malloc(sz_buffers); - xd->buffer[1] = (LV_X11_DOUBLE_BUFFER ? malloc(sz_buffers) : NULL); - lv_display_set_buffers(disp, xd->buffer[0], xd->buffer[1], sz_buffers, LV_X11_RENDER_MODE); - - xd->timer = lv_timer_create(x11_event_handler, 5, disp); - - /* initialize Tick simulation */ - xd->terminated = false; - pthread_create(&xd->thr_tick, NULL, x11_tick_thread, xd); - - return disp; -} - -#endif /*LV_USE_X11*/ diff --git a/L3_Middlewares/LVGL/src/drivers/x11/lv_x11_input.c b/L3_Middlewares/LVGL/src/drivers/x11/lv_x11_input.c deleted file mode 100644 index ecbd8d4..0000000 --- a/L3_Middlewares/LVGL/src/drivers/x11/lv_x11_input.c +++ /dev/null @@ -1,324 +0,0 @@ -/** - * @file lv_x11_input.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_x11.h" - -#if LV_USE_X11 - -#include -#include -#include -#include -#include "../../widgets/image/lv_image.h" - -/********************* - * DEFINES - *********************/ -#define MIN(A, B) ((A) < (B) ? (A) : (B)) - -/********************** - * TYPEDEFS - **********************/ - -typedef struct _x11_inp_data { - /* LVGL related information */ - lv_group_t * inp_group; /**< input group for X input elements */ - lv_indev_t * keyboard; /**< keyboard input device object */ - lv_indev_t * mousepointer; /**< mouse input device object */ - lv_indev_t * mousewheel; /**< encoder input device object */ - lv_timer_t * timer; /**< timer object for @ref x11_event_handler */ - /* user input related information */ - char kb_buffer[32]; /**< keyboard buffer for X keyboard inputs */ - lv_point_t mouse_pos; /**< current reported mouse position */ - bool left_mouse_btn; /**< current state of left mouse button */ - bool right_mouse_btn; /**< current state of right mouse button */ - bool wheel_mouse_btn; /**< current state of wheel (=middle) mouse button */ - int16_t wheel_cnt; /**< mouse wheel increments */ -} x11_inp_data_t; - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * X11 input event handler, predicated to fetch and handle only input related events - * (MotionNotify, ButtonPress/Release, KeyPress/Release) - */ -static int is_inp_event(Display * disp, XEvent * event, XPointer arg) -{ - LV_UNUSED(disp); - LV_UNUSED(arg); - return !(event->type == Expose - || (event->type >= DestroyNotify && event->type <= CirculateNotify) /* events from StructureNotifyMask */ - || event->type == ClientMessage); -} -static void x11_inp_event_handler(lv_timer_t * t) -{ - lv_display_t * disp = lv_timer_get_user_data(t); - _x11_user_hdr_t * disp_hdr = lv_display_get_driver_data(disp); - x11_inp_data_t * xd = disp_hdr->inp_data; - - /* handle all outstanding X events */ - XEvent event; - while(XCheckIfEvent(disp_hdr->display, &event, is_inp_event, NULL)) { - LV_LOG_TRACE("Input Event %d", event.type); - switch(event.type) { - case MotionNotify: - xd->mouse_pos.x = event.xmotion.x; - xd->mouse_pos.y = event.xmotion.y; - break; - case ButtonPress: - switch(event.xbutton.button) { - case Button1: - xd->left_mouse_btn = true; - break; - case Button2: - xd->wheel_mouse_btn = true; - break; - case Button3: - xd->right_mouse_btn = true; - break; - case Button4: /* Scrolled up */ - xd->wheel_cnt--; - break; - case Button5: /* Scrolled down */ - xd->wheel_cnt++; - break; - default: - LV_LOG_WARN("unhandled button press : %d", event.xbutton.button); - } - break; - case ButtonRelease: - switch(event.xbutton.button) { - case Button1: - xd->left_mouse_btn = false; - break; - case Button2: - xd->wheel_mouse_btn = false; - break; - case Button3: - xd->right_mouse_btn = false; - break; - } - break; - case KeyPress: { - size_t len = strlen(xd->kb_buffer); - if(len < (sizeof(xd->kb_buffer) - 2 /* space for 1 char + '\0' */)) { - KeySym key; - int n = XLookupString(&event.xkey, &xd->kb_buffer[len], sizeof(xd->kb_buffer) - (len + 1), &key, NULL); - n += !!key; - switch(key) { - case XK_Home: - case XK_KP_Home: - xd->kb_buffer[len] = LV_KEY_HOME; - break; - case XK_Left: - case XK_KP_Left: - xd->kb_buffer[len] = LV_KEY_LEFT; - break; - case XK_Up: - case XK_KP_Up: - xd->kb_buffer[len] = LV_KEY_UP; - break; - case XK_Right: - case XK_KP_Right: - xd->kb_buffer[len] = LV_KEY_RIGHT; - break; - case XK_Down: - case XK_KP_Down: - xd->kb_buffer[len] = LV_KEY_DOWN; - break; - case XK_Prior: - case XK_KP_Prior: - xd->kb_buffer[len] = LV_KEY_PREV; - break; - case XK_Next: - case XK_KP_Next: - xd->kb_buffer[len] = LV_KEY_NEXT; - break; - case XK_End: - case XK_KP_End: - xd->kb_buffer[len] = LV_KEY_END; - break; - case XK_BackSpace: - xd->kb_buffer[len] = LV_KEY_BACKSPACE; - break; - case XK_Escape: - xd->kb_buffer[len] = LV_KEY_ESC; - break; - case XK_Delete: - case XK_KP_Delete: - xd->kb_buffer[len] = LV_KEY_DEL; - break; - case XK_KP_Enter: - xd->kb_buffer[len] = LV_KEY_ENTER; - break; - } - xd->kb_buffer[len + n] = '\0'; - } - } - break; - case KeyRelease: - break; - default: - LV_LOG_WARN("unhandled x11 event: %d", event.type); - } - } -} - -/** - * event called by lvgl display if display has been closed (@ref lv_display_delete has been called) - * @param[in] e event data, containing lv_display_t object - */ -static void x11_inp_delete_evt_cb(lv_event_t * e) -{ - x11_inp_data_t * xd = (x11_inp_data_t *)lv_event_get_user_data(e); - - lv_timer_delete(xd->timer); - lv_free(xd); -} - -/** - * create the local data/timers for the X11 input functionality. - * extracts the user data information from lv_display_t object and initializes the input user object on 1st use. - * @param[in] disp the created X11 display object from @lv_x11_window_create - * @return pointer to the local user data object @x11_inp_data_t - */ -static x11_inp_data_t * x11_input_get_user_data(lv_display_t * disp) -{ - _x11_user_hdr_t * disp_hdr = lv_display_get_driver_data(disp); - LV_ASSERT_NULL(disp_hdr); - x11_inp_data_t ** inp_data = &disp_hdr->inp_data; - - /* create input data set if initial call */ - if(NULL == *inp_data) { - *inp_data = lv_malloc_zeroed(sizeof(x11_inp_data_t)); - LV_ASSERT_MALLOC(*inp_data); - if(NULL != *inp_data) { - /* initialize timer callback for X11 kb/mouse input event reading */ - (*inp_data)->timer = lv_timer_create(x11_inp_event_handler, 1, disp); - lv_display_add_event_cb(disp, x11_inp_delete_evt_cb, LV_EVENT_DELETE, *inp_data); - } - } - return *inp_data; -} - -static void x11_keyboard_read_cb(lv_indev_t * indev, lv_indev_data_t * data) -{ - lv_display_t * disp = lv_indev_get_driver_data(indev); - x11_inp_data_t * xd = x11_input_get_user_data(disp); - - size_t len = strlen(xd->kb_buffer); - if(len > 0) { - data->state = LV_INDEV_STATE_PRESSED; - data->key = xd->kb_buffer[0]; - memmove(xd->kb_buffer, xd->kb_buffer + 1, len); - data->continue_reading = (len > 0); - } - else { - data->state = LV_INDEV_STATE_RELEASED; - } -} - -static void x11_mouse_read_cb(lv_indev_t * indev, lv_indev_data_t * data) -{ - lv_display_t * disp = lv_indev_get_driver_data(indev); - x11_inp_data_t * xd = x11_input_get_user_data(disp); - - int32_t hor_res = lv_display_get_horizontal_resolution(disp); - int32_t ver_res = lv_display_get_vertical_resolution(disp); - - xd->mouse_pos.x = MIN(xd->mouse_pos.x, hor_res - 1); - xd->mouse_pos.y = MIN(xd->mouse_pos.y, ver_res - 1); - - data->point = xd->mouse_pos; - data->state = xd->left_mouse_btn ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; -} - -static void x11_mousewheel_read_cb(lv_indev_t * indev, lv_indev_data_t * data) -{ - lv_display_t * disp = lv_indev_get_driver_data(indev); - x11_inp_data_t * xd = x11_input_get_user_data(disp); - - data->state = xd->wheel_mouse_btn ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; - data->enc_diff = xd->wheel_cnt; - xd->wheel_cnt = 0; -} - -static lv_indev_t * lv_x11_keyboard_create(lv_display_t * disp) -{ - lv_indev_t * indev = lv_indev_create(); - LV_ASSERT_NULL(indev); - if(NULL != indev) { - lv_indev_set_type(indev, LV_INDEV_TYPE_KEYPAD); - lv_indev_set_read_cb(indev, x11_keyboard_read_cb); - lv_indev_set_driver_data(indev, disp); - } - return indev; -} - -static lv_indev_t * lv_x11_mouse_create(lv_display_t * disp, lv_image_dsc_t const * symb) -{ - lv_indev_t * indev = lv_indev_create(); - if(NULL != indev) { - lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER); - lv_indev_set_read_cb(indev, x11_mouse_read_cb); - lv_indev_set_driver_data(indev, disp); - - /* optional mouse cursor symbol */ - if(NULL != symb) { - lv_obj_t * mouse_cursor = lv_image_create(lv_screen_active()); - lv_image_set_src(mouse_cursor, symb); - lv_indev_set_cursor(indev, mouse_cursor); - } - } - return indev; -} - -static lv_indev_t * lv_x11_mousewheel_create(lv_display_t * disp) -{ - lv_indev_t * indev = lv_indev_create(); - if(NULL != indev) { - lv_indev_set_type(indev, LV_INDEV_TYPE_ENCODER); - lv_indev_set_read_cb(indev, x11_mousewheel_read_cb); - lv_indev_set_driver_data(indev, disp); - } - return indev; -} - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_x11_inputs_create(lv_display_t * disp, lv_image_dsc_t const * mouse_img) -{ - x11_inp_data_t * xd = x11_input_get_user_data(disp); - LV_ASSERT_NULL(xd); - - xd->inp_group = lv_group_create(); - lv_group_set_default(xd->inp_group); - - xd->mousepointer = lv_x11_mouse_create(disp, mouse_img); - lv_indev_set_group(xd->mousepointer, xd->inp_group); - - xd->mousewheel = lv_x11_mousewheel_create(disp); - lv_indev_set_group(xd->mousewheel, xd->inp_group); - - xd->keyboard = lv_x11_keyboard_create(disp); - lv_indev_set_group(xd->keyboard, xd->inp_group); -} - -#endif /*LV_USE_X11*/ diff --git a/L3_Middlewares/LVGL/src/extra/README.md b/L3_Middlewares/LVGL/src/extra/README.md new file mode 100644 index 0000000..80bb49d --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/README.md @@ -0,0 +1,31 @@ +# Extra components + +This directory contains extra (optional) components to lvgl. +It's a good place for contributions as there are less strict expectations about the completeness and flexibility of the components here. + +In other words, if you have created a complex widget from other widgets, or modified an existing widget with special events, styles or animations, or have a new feature that could work as a plugin to lvgl feel free to the share it here. + +## How to contribute +- Create a [Pull request](https://docs.lvgl.io/8.0/CONTRIBUTING.html#pull-request) with your new content +- Please and follow the [Coding style](https://github.com/lvgl/lvgl/blob/master/docs/CODING_STYLE.md) of LVGL +- Add setter/getter functions in pair +- Update [lv_conf_template.h](https://github.com/lvgl/lvgl/blob/master/lv_conf_template.h) +- Add description in the [docs](https://github.com/lvgl/lvgl/tree/master/docs) +- Add [examples](https://github.com/lvgl/lvgl/tree/master/examples) +- Update the [changelog](https://github.com/lvgl/lvgl/tree/master/docs/CHANGELOG.md) +- Add yourself to the [Contributors](#contributors) section below. + +## Ideas +Here some ideas as inspiration feel free to contribute with ideas too. +- New [Calendar headers](https://github.com/lvgl/lvgl/tree/master/src/extra/widgets/calendar) +- Color picker with RGB and or HSV bars +- Ruler, horizontal or vertical with major and minor ticks and labels +- New [List items types](https://github.com/lvgl/lvgl/tree/master/src/extra/widgets/list) +- [Preloaders](https://www.google.com/search?q=preloader&sxsrf=ALeKk01ddA4YB0WEgLLN1bZNSm8YER7pkg:1623080551559&source=lnms&tbm=isch&sa=X&ved=2ahUKEwiwoN6d7oXxAhVuw4sKHVedBB4Q_AUoAXoECAEQAw&biw=952&bih=940) +- Drop-down list with a container to which content can be added +- 9 patch button: Similar to [lv_imgbtn](https://docs.lvgl.io/8.0/widgets/extra/imgbtn.html) but 9 images for 4 corner, 4 sides and the center + +## Contributors +- lv_animimg: @ZhaoQiang-b45475 +- lv_span: @guoweilkd +- lv_menu: @HX2003 \ No newline at end of file diff --git a/L3_Middlewares/LVGL/src/layouts/flex/lv_flex.c b/L3_Middlewares/LVGL/src/extra/layouts/flex/lv_flex.c similarity index 60% rename from L3_Middlewares/LVGL/src/layouts/flex/lv_flex.c rename to L3_Middlewares/LVGL/src/extra/layouts/flex/lv_flex.c index 2af3bf3..8f0b4d2 100644 --- a/L3_Middlewares/LVGL/src/layouts/flex/lv_flex.c +++ b/L3_Middlewares/LVGL/src/extra/layouts/flex/lv_flex.c @@ -6,17 +6,13 @@ /********************* * INCLUDES *********************/ -#include "lv_flex.h" -#include "../lv_layout.h" -#include "../../core/lv_obj_private.h" +#include "../lv_layouts.h" #if LV_USE_FLEX -#include "../../core/lv_global.h" /********************* * DEFINES *********************/ -#define layout_list_def LV_GLOBAL_DEFAULT()->layout_list /********************** * TYPEDEFS @@ -32,23 +28,24 @@ typedef struct { typedef struct { lv_obj_t * item; - int32_t min_size; - int32_t max_size; - int32_t final_size; + lv_coord_t min_size; + lv_coord_t max_size; + lv_coord_t final_size; uint32_t grow_value; uint32_t clamped : 1; } grow_dsc_t; typedef struct { - int32_t track_cross_size; - int32_t track_main_size; /*For all items*/ - int32_t track_fix_main_size; /*For non grow items*/ + lv_coord_t track_cross_size; + lv_coord_t track_main_size; /*For all items*/ + lv_coord_t track_fix_main_size; /*For non grow items*/ uint32_t item_cnt; grow_dsc_t * grow_dsc; uint32_t grow_item_cnt; uint32_t grow_dsc_calc : 1; } track_t; + /********************** * GLOBAL PROTOTYPES **********************/ @@ -57,19 +54,24 @@ typedef struct { * STATIC PROTOTYPES **********************/ static void flex_update(lv_obj_t * cont, void * user_data); -static int32_t find_track_end(lv_obj_t * cont, flex_t * f, int32_t item_start_id, int32_t max_main_size, - int32_t item_gap, track_t * t); -static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, int32_t item_last_id, int32_t abs_x, - int32_t abs_y, int32_t max_main_size, int32_t item_gap, track_t * t); -static void place_content(lv_flex_align_t place, int32_t max_size, int32_t content_size, int32_t item_cnt, - int32_t * start_pos, int32_t * gap); +static int32_t find_track_end(lv_obj_t * cont, flex_t * f, int32_t item_start_id, lv_coord_t max_main_size, + lv_coord_t item_gap, track_t * t); +static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, int32_t item_last_id, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t max_main_size, lv_coord_t item_gap, track_t * t); +static void place_content(lv_flex_align_t place, lv_coord_t max_size, lv_coord_t content_size, lv_coord_t item_cnt, + lv_coord_t * start_pos, lv_coord_t * gap); static lv_obj_t * get_next_item(lv_obj_t * cont, bool rev, int32_t * item_id); -static int32_t lv_obj_get_width_with_margin(const lv_obj_t * obj); -static int32_t lv_obj_get_height_with_margin(const lv_obj_t * obj); /********************** * GLOBAL VARIABLES **********************/ +uint16_t LV_LAYOUT_FLEX; +lv_style_prop_t LV_STYLE_FLEX_FLOW; +lv_style_prop_t LV_STYLE_FLEX_MAIN_PLACE; +lv_style_prop_t LV_STYLE_FLEX_CROSS_PLACE; +lv_style_prop_t LV_STYLE_FLEX_TRACK_PLACE; +lv_style_prop_t LV_STYLE_FLEX_GROW; + /********************** * STATIC VARIABLES @@ -78,11 +80,6 @@ static int32_t lv_obj_get_height_with_margin(const lv_obj_t * obj); /********************** * MACROS **********************/ -#if LV_USE_LOG && LV_LOG_TRACE_LAYOUT - #define LV_TRACE_LAYOUT(...) LV_LOG_TRACE(__VA_ARGS__) -#else - #define LV_TRACE_LAYOUT(...) -#endif /********************** * GLOBAL FUNCTIONS @@ -94,8 +91,13 @@ static int32_t lv_obj_get_height_with_margin(const lv_obj_t * obj); void lv_flex_init(void) { - layout_list_def[LV_LAYOUT_FLEX].cb = flex_update; - layout_list_def[LV_LAYOUT_FLEX].user_data = NULL; + LV_LAYOUT_FLEX = lv_layout_register(flex_update, NULL); + + LV_STYLE_FLEX_FLOW = lv_style_register_prop(LV_STYLE_PROP_FLAG_NONE); + LV_STYLE_FLEX_MAIN_PLACE = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + LV_STYLE_FLEX_CROSS_PLACE = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + LV_STYLE_FLEX_TRACK_PLACE = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + LV_STYLE_FLEX_GROW = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); } void lv_obj_set_flex_flow(lv_obj_t * obj, lv_flex_flow_t flow) @@ -119,6 +121,88 @@ void lv_obj_set_flex_grow(lv_obj_t * obj, uint8_t grow) lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj)); } + +void lv_style_set_flex_flow(lv_style_t * style, lv_flex_flow_t value) +{ + lv_style_value_t v = { + .num = (int32_t)value + }; + lv_style_set_prop(style, LV_STYLE_FLEX_FLOW, v); +} + +void lv_style_set_flex_main_place(lv_style_t * style, lv_flex_align_t value) +{ + lv_style_value_t v = { + .num = (int32_t)value + }; + lv_style_set_prop(style, LV_STYLE_FLEX_MAIN_PLACE, v); +} + +void lv_style_set_flex_cross_place(lv_style_t * style, lv_flex_align_t value) +{ + lv_style_value_t v = { + .num = (int32_t)value + }; + lv_style_set_prop(style, LV_STYLE_FLEX_CROSS_PLACE, v); +} + +void lv_style_set_flex_track_place(lv_style_t * style, lv_flex_align_t value) +{ + lv_style_value_t v = { + .num = (int32_t)value + }; + lv_style_set_prop(style, LV_STYLE_FLEX_TRACK_PLACE, v); +} + +void lv_style_set_flex_grow(lv_style_t * style, uint8_t value) +{ + lv_style_value_t v = { + .num = (int32_t)value + }; + lv_style_set_prop(style, LV_STYLE_FLEX_GROW, v); +} + + +void lv_obj_set_style_flex_flow(lv_obj_t * obj, lv_flex_flow_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = (int32_t) value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_FLOW, v, selector); +} + +void lv_obj_set_style_flex_main_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = (int32_t) value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_MAIN_PLACE, v, selector); +} + +void lv_obj_set_style_flex_cross_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = (int32_t) value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_CROSS_PLACE, v, selector); +} + +void lv_obj_set_style_flex_track_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = (int32_t) value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_TRACK_PLACE, v, selector); +} + +void lv_obj_set_style_flex_grow(lv_obj_t * obj, uint8_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = (int32_t) value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_GROW, v, selector); +} + /********************** * STATIC FUNCTIONS **********************/ @@ -130,31 +214,32 @@ static void flex_update(lv_obj_t * cont, void * user_data) flex_t f; lv_flex_flow_t flow = lv_obj_get_style_flex_flow(cont, LV_PART_MAIN); - f.row = flow & LV_FLEX_COLUMN ? 0 : 1; - f.wrap = flow & LV_FLEX_WRAP ? 1 : 0; - f.rev = flow & LV_FLEX_REVERSE ? 1 : 0; + f.row = flow & _LV_FLEX_COLUMN ? 0 : 1; + f.wrap = flow & _LV_FLEX_WRAP ? 1 : 0; + f.rev = flow & _LV_FLEX_REVERSE ? 1 : 0; f.main_place = lv_obj_get_style_flex_main_place(cont, LV_PART_MAIN); f.cross_place = lv_obj_get_style_flex_cross_place(cont, LV_PART_MAIN); f.track_place = lv_obj_get_style_flex_track_place(cont, LV_PART_MAIN); - bool rtl = lv_obj_get_style_base_dir(cont, LV_PART_MAIN) == LV_BASE_DIR_RTL; - int32_t track_gap = !f.row ? lv_obj_get_style_pad_column(cont, LV_PART_MAIN) : lv_obj_get_style_pad_row(cont, - LV_PART_MAIN); - int32_t item_gap = f.row ? lv_obj_get_style_pad_column(cont, LV_PART_MAIN) : lv_obj_get_style_pad_row(cont, - LV_PART_MAIN); - int32_t max_main_size = (f.row ? lv_obj_get_content_width(cont) : lv_obj_get_content_height(cont)); - int32_t abs_y = cont->coords.y1 + lv_obj_get_style_space_top(cont, - LV_PART_MAIN) - lv_obj_get_scroll_y(cont); - int32_t abs_x = cont->coords.x1 + lv_obj_get_style_space_left(cont, - LV_PART_MAIN) - lv_obj_get_scroll_x(cont); + bool rtl = lv_obj_get_style_base_dir(cont, LV_PART_MAIN) == LV_BASE_DIR_RTL ? true : false; + lv_coord_t track_gap = !f.row ? lv_obj_get_style_pad_column(cont, LV_PART_MAIN) : lv_obj_get_style_pad_row(cont, + LV_PART_MAIN); + lv_coord_t item_gap = f.row ? lv_obj_get_style_pad_column(cont, LV_PART_MAIN) : lv_obj_get_style_pad_row(cont, + LV_PART_MAIN); + lv_coord_t max_main_size = (f.row ? lv_obj_get_content_width(cont) : lv_obj_get_content_height(cont)); + lv_coord_t border_width = lv_obj_get_style_border_width(cont, LV_PART_MAIN); + lv_coord_t abs_y = cont->coords.y1 + lv_obj_get_style_pad_top(cont, + LV_PART_MAIN) + border_width - lv_obj_get_scroll_y(cont); + lv_coord_t abs_x = cont->coords.x1 + lv_obj_get_style_pad_left(cont, + LV_PART_MAIN) + border_width - lv_obj_get_scroll_x(cont); lv_flex_align_t track_cross_place = f.track_place; - int32_t * cross_pos = (f.row ? &abs_y : &abs_x); + lv_coord_t * cross_pos = (f.row ? &abs_y : &abs_x); - int32_t w_set = lv_obj_get_style_width(cont, LV_PART_MAIN); - int32_t h_set = lv_obj_get_style_height(cont, LV_PART_MAIN); + lv_coord_t w_set = lv_obj_get_style_width(cont, LV_PART_MAIN); + lv_coord_t h_set = lv_obj_get_style_height(cont, LV_PART_MAIN); - /*Content sized objects should squeeze the gap between the children, therefore any alignment will look like `START`*/ + /*Content sized objects should squeezed the gap between the children, therefore any alignment will look like `START`*/ if((f.row && h_set == LV_SIZE_CONTENT && cont->h_layout == 0) || (!f.row && w_set == LV_SIZE_CONTENT && cont->w_layout == 0)) { track_cross_place = LV_FLEX_ALIGN_START; @@ -165,8 +250,8 @@ static void flex_update(lv_obj_t * cont, void * user_data) else if(track_cross_place == LV_FLEX_ALIGN_END) track_cross_place = LV_FLEX_ALIGN_START; } - int32_t total_track_cross_size = 0; - int32_t gap = 0; + lv_coord_t total_track_cross_size = 0; + lv_coord_t gap = 0; uint32_t track_cnt = 0; int32_t track_first_item; int32_t next_track_first_item; @@ -186,7 +271,7 @@ static void flex_update(lv_obj_t * cont, void * user_data) if(track_cnt) total_track_cross_size -= track_gap; /*No gap after the last track*/ /*Place the tracks to get the start position*/ - int32_t max_cross_size = (f.row ? lv_obj_get_content_height(cont) : lv_obj_get_content_width(cont)); + lv_coord_t max_cross_size = (f.row ? lv_obj_get_content_height(cont) : lv_obj_get_content_width(cont)); place_content(track_cross_place, max_cross_size, total_track_cross_size, track_cnt, cross_pos, &gap); } @@ -207,7 +292,7 @@ static void flex_update(lv_obj_t * cont, void * user_data) } children_repos(cont, &f, track_first_item, next_track_first_item, abs_x, abs_y, max_main_size, item_gap, &t); track_first_item = next_track_first_item; - lv_free(t.grow_dsc); + lv_mem_buf_release(t.grow_dsc); t.grow_dsc = NULL; if(rtl && !f.row) { *cross_pos -= gap + track_gap; @@ -222,7 +307,7 @@ static void flex_update(lv_obj_t * cont, void * user_data) lv_obj_refr_size(cont); } - lv_obj_send_event(cont, LV_EVENT_LAYOUT_CHANGED, NULL); + lv_event_send(cont, LV_EVENT_LAYOUT_CHANGED, NULL); LV_TRACE_LAYOUT("finished"); } @@ -230,19 +315,18 @@ static void flex_update(lv_obj_t * cont, void * user_data) /** * Find the last item of a track */ -static int32_t find_track_end(lv_obj_t * cont, flex_t * f, int32_t item_start_id, int32_t max_main_size, - int32_t item_gap, track_t * t) +static int32_t find_track_end(lv_obj_t * cont, flex_t * f, int32_t item_start_id, lv_coord_t max_main_size, + lv_coord_t item_gap, track_t * t) { - int32_t w_set = lv_obj_get_style_width(cont, LV_PART_MAIN); - int32_t h_set = lv_obj_get_style_height(cont, LV_PART_MAIN); + lv_coord_t w_set = lv_obj_get_style_width(cont, LV_PART_MAIN); + lv_coord_t h_set = lv_obj_get_style_height(cont, LV_PART_MAIN); - /*Can't wrap if the size is auto (i.e. the size depends on the children)*/ + /*Can't wrap if the size if auto (i.e. the size depends on the children)*/ if(f->wrap && ((f->row && w_set == LV_SIZE_CONTENT) || (!f->row && h_set == LV_SIZE_CONTENT))) { f->wrap = false; } - int32_t(*get_main_size)(const lv_obj_t *) = (f->row ? lv_obj_get_width_with_margin : lv_obj_get_height_with_margin); - int32_t(*get_cross_size)(const lv_obj_t *) = (!f->row ? lv_obj_get_width_with_margin : - lv_obj_get_height_with_margin); + lv_coord_t(*get_main_size)(const lv_obj_t *) = (f->row ? lv_obj_get_width : lv_obj_get_height); + lv_coord_t(*get_cross_size)(const lv_obj_t *) = (!f->row ? lv_obj_get_width : lv_obj_get_height); t->track_main_size = 0; t->track_fix_main_size = 0; @@ -263,26 +347,31 @@ static int32_t find_track_end(lv_obj_t * cont, flex_t * f, int32_t item_start_id t->grow_item_cnt++; t->track_fix_main_size += item_gap; if(t->grow_dsc_calc) { - grow_dsc_t * new_dsc = lv_realloc(t->grow_dsc, sizeof(grow_dsc_t) * (t->grow_item_cnt)); + grow_dsc_t * new_dsc = lv_mem_buf_get(sizeof(grow_dsc_t) * (t->grow_item_cnt)); LV_ASSERT_MALLOC(new_dsc); if(new_dsc == NULL) return item_id; + if(t->grow_dsc) { + lv_memcpy(new_dsc, t->grow_dsc, sizeof(grow_dsc_t) * (t->grow_item_cnt - 1)); + lv_mem_buf_release(t->grow_dsc); + } new_dsc[t->grow_item_cnt - 1].item = item; - new_dsc[t->grow_item_cnt - 1].min_size = f->row ? lv_obj_get_style_min_width(item, LV_PART_MAIN) - : lv_obj_get_style_min_height(item, LV_PART_MAIN); - new_dsc[t->grow_item_cnt - 1].max_size = f->row ? lv_obj_get_style_max_width(item, LV_PART_MAIN) - : lv_obj_get_style_max_height(item, LV_PART_MAIN); + new_dsc[t->grow_item_cnt - 1].min_size = f->row ? lv_obj_get_style_min_width(item, + LV_PART_MAIN) : lv_obj_get_style_min_height(item, LV_PART_MAIN); + new_dsc[t->grow_item_cnt - 1].max_size = f->row ? lv_obj_get_style_max_width(item, + LV_PART_MAIN) : lv_obj_get_style_max_height(item, LV_PART_MAIN); new_dsc[t->grow_item_cnt - 1].grow_value = grow_value; new_dsc[t->grow_item_cnt - 1].clamped = 0; t->grow_dsc = new_dsc; } } else { - int32_t item_size = get_main_size(item); + lv_coord_t item_size = get_main_size(item); if(f->wrap && t->track_fix_main_size + item_size > max_main_size) break; t->track_fix_main_size += item_size + item_gap; } + t->track_cross_size = LV_MAX(get_cross_size(item), t->track_cross_size); t->item_cnt++; } @@ -314,26 +403,20 @@ static int32_t find_track_end(lv_obj_t * cont, flex_t * f, int32_t item_start_id /** * Position the children in the same track */ -static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, int32_t item_last_id, int32_t abs_x, - int32_t abs_y, int32_t max_main_size, int32_t item_gap, track_t * t) +static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, int32_t item_last_id, lv_coord_t abs_x, + lv_coord_t abs_y, lv_coord_t max_main_size, lv_coord_t item_gap, track_t * t) { - void (*area_set_main_size)(lv_area_t *, int32_t) = (f->row ? lv_area_set_width : lv_area_set_height); - int32_t (*area_get_main_size)(const lv_area_t *) = (f->row ? lv_area_get_width : lv_area_get_height); - int32_t (*area_get_cross_size)(const lv_area_t *) = (!f->row ? lv_area_get_width : lv_area_get_height); - - typedef int32_t (*margin_func_t)(const lv_obj_t *, uint32_t); - margin_func_t get_margin_main_start = (f->row ? lv_obj_get_style_margin_left : lv_obj_get_style_margin_top); - margin_func_t get_margin_main_end = (f->row ? lv_obj_get_style_margin_right : lv_obj_get_style_margin_bottom); - margin_func_t get_margin_cross_start = (!f->row ? lv_obj_get_style_margin_left : lv_obj_get_style_margin_top); - margin_func_t get_margin_cross_end = (!f->row ? lv_obj_get_style_margin_right : lv_obj_get_style_margin_bottom); + void (*area_set_main_size)(lv_area_t *, lv_coord_t) = (f->row ? lv_area_set_width : lv_area_set_height); + lv_coord_t (*area_get_main_size)(const lv_area_t *) = (f->row ? lv_area_get_width : lv_area_get_height); + lv_coord_t (*area_get_cross_size)(const lv_area_t *) = (!f->row ? lv_area_get_width : lv_area_get_height); /*Calculate the size of grow items first*/ uint32_t i; bool grow_reiterate = true; - while(grow_reiterate && t->grow_item_cnt) { + while(grow_reiterate) { grow_reiterate = false; - int32_t grow_value_sum = 0; - int32_t grow_max_size = t->track_main_size - t->track_fix_main_size; + lv_coord_t grow_value_sum = 0; + lv_coord_t grow_max_size = t->track_main_size - t->track_fix_main_size; for(i = 0; i < t->grow_item_cnt; i++) { if(t->grow_dsc[i].clamped == 0) { grow_value_sum += t->grow_dsc[i].grow_value; @@ -342,14 +425,14 @@ static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, i grow_max_size -= t->grow_dsc[i].final_size; } } - int32_t grow_unit; + lv_coord_t grow_unit; for(i = 0; i < t->grow_item_cnt; i++) { if(t->grow_dsc[i].clamped == 0) { LV_ASSERT(grow_value_sum != 0); grow_unit = grow_max_size / grow_value_sum; - int32_t size = grow_unit * t->grow_dsc[i].grow_value; - int32_t size_clamp = LV_CLAMP(t->grow_dsc[i].min_size, size, t->grow_dsc[i].max_size); + lv_coord_t size = grow_unit * t->grow_dsc[i].grow_value; + lv_coord_t size_clamp = LV_CLAMP(t->grow_dsc[i].min_size, size, t->grow_dsc[i].max_size); if(size_clamp != size) { t->grow_dsc[i].clamped = 1; @@ -362,11 +445,12 @@ static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, i } } - bool rtl = lv_obj_get_style_base_dir(cont, LV_PART_MAIN) == LV_BASE_DIR_RTL; - int32_t main_pos = 0; + bool rtl = lv_obj_get_style_base_dir(cont, LV_PART_MAIN) == LV_BASE_DIR_RTL ? true : false; - int32_t place_gap = 0; + lv_coord_t main_pos = 0; + + lv_coord_t place_gap = 0; place_content(f->main_place, max_main_size, t->track_main_size, t->item_cnt, &main_pos, &place_gap); if(f->row && rtl) main_pos += lv_obj_get_content_width(cont); @@ -377,9 +461,9 @@ static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, i item = get_next_item(cont, f->rev, &item_first_id); continue; } - int32_t grow_size = lv_obj_get_style_flex_grow(item, LV_PART_MAIN); + lv_coord_t grow_size = lv_obj_get_style_flex_grow(item, LV_PART_MAIN); if(grow_size) { - int32_t s = 0; + lv_coord_t s = 0; for(i = 0; i < t->grow_item_cnt; i++) { if(t->grow_dsc[i].item == item) { s = t->grow_dsc[i].final_size; @@ -402,8 +486,8 @@ static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, i lv_area_t old_coords; lv_area_copy(&old_coords, &item->coords); area_set_main_size(&item->coords, s); - lv_obj_send_event(item, LV_EVENT_SIZE_CHANGED, &old_coords); - lv_obj_send_event(lv_obj_get_parent(item), LV_EVENT_CHILD_CHANGED, item); + lv_event_send(item, LV_EVENT_SIZE_CHANGED, &old_coords); + lv_event_send(lv_obj_get_parent(item), LV_EVENT_CHILD_CHANGED, item); lv_obj_invalidate(item); } } @@ -412,37 +496,35 @@ static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, i item->h_layout = 0; } - int32_t cross_pos = 0; + lv_coord_t cross_pos = 0; switch(f->cross_place) { case LV_FLEX_ALIGN_CENTER: /*Round up the cross size to avoid rounding error when dividing by 2 *The issue comes up e,g, with column direction with center cross direction if an element's width changes*/ cross_pos = (((t->track_cross_size + 1) & (~1)) - area_get_cross_size(&item->coords)) / 2; - cross_pos += (get_margin_cross_start(item, LV_PART_MAIN) - get_margin_cross_end(item, LV_PART_MAIN)) / 2; break; case LV_FLEX_ALIGN_END: cross_pos = t->track_cross_size - area_get_cross_size(&item->coords); - cross_pos -= get_margin_cross_end(item, LV_PART_MAIN); break; default: - cross_pos += get_margin_cross_start(item, LV_PART_MAIN); break; } if(f->row && rtl) main_pos -= area_get_main_size(&item->coords); + /*Handle percentage value of translate*/ - int32_t tr_x = lv_obj_get_style_translate_x(item, LV_PART_MAIN); - int32_t tr_y = lv_obj_get_style_translate_y(item, LV_PART_MAIN); - int32_t w = lv_obj_get_width(item); - int32_t h = lv_obj_get_height(item); + lv_coord_t tr_x = lv_obj_get_style_translate_x(item, LV_PART_MAIN); + lv_coord_t tr_y = lv_obj_get_style_translate_y(item, LV_PART_MAIN); + lv_coord_t w = lv_obj_get_width(item); + lv_coord_t h = lv_obj_get_height(item); if(LV_COORD_IS_PCT(tr_x)) tr_x = (w * LV_COORD_GET_PCT(tr_x)) / 100; if(LV_COORD_IS_PCT(tr_y)) tr_y = (h * LV_COORD_GET_PCT(tr_y)) / 100; - int32_t diff_x = abs_x - item->coords.x1 + tr_x; - int32_t diff_y = abs_y - item->coords.y1 + tr_y; - diff_x += f->row ? main_pos + get_margin_main_start(item, LV_PART_MAIN) : cross_pos; - diff_y += f->row ? cross_pos : main_pos + get_margin_main_start(item, LV_PART_MAIN); + lv_coord_t diff_x = abs_x - item->coords.x1 + tr_x; + lv_coord_t diff_y = abs_y - item->coords.y1 + tr_y; + diff_x += f->row ? main_pos : cross_pos; + diff_y += f->row ? cross_pos : main_pos; if(diff_x || diff_y) { lv_obj_invalidate(item); @@ -454,9 +536,7 @@ static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, i lv_obj_move_children_by(item, diff_x, diff_y, false); } - if(!(f->row && rtl)) main_pos += area_get_main_size(&item->coords) + item_gap + place_gap - + get_margin_main_start(item, LV_PART_MAIN) - + get_margin_main_end(item, LV_PART_MAIN); + if(!(f->row && rtl)) main_pos += area_get_main_size(&item->coords) + item_gap + place_gap; else main_pos -= item_gap + place_gap; item = get_next_item(cont, f->rev, &item_first_id); @@ -466,11 +546,12 @@ static void children_repos(lv_obj_t * cont, flex_t * f, int32_t item_first_id, i /** * Tell a start coordinate and gap for a placement type. */ -static void place_content(lv_flex_align_t place, int32_t max_size, int32_t content_size, int32_t item_cnt, - int32_t * start_pos, int32_t * gap) +static void place_content(lv_flex_align_t place, lv_coord_t max_size, lv_coord_t content_size, lv_coord_t item_cnt, + lv_coord_t * start_pos, lv_coord_t * gap) { if(item_cnt <= 1) { switch(place) { + case LV_FLEX_ALIGN_SPACE_BETWEEN: case LV_FLEX_ALIGN_SPACE_AROUND: case LV_FLEX_ALIGN_SPACE_EVENLY: place = LV_FLEX_ALIGN_CENTER; @@ -490,14 +571,14 @@ static void place_content(lv_flex_align_t place, int32_t max_size, int32_t conte *start_pos += max_size - content_size; break; case LV_FLEX_ALIGN_SPACE_BETWEEN: - if(item_cnt > 1) *gap = (int32_t)(max_size - content_size) / (int32_t)(item_cnt - 1); + *gap = (lv_coord_t)(max_size - content_size) / (lv_coord_t)(item_cnt - 1); break; case LV_FLEX_ALIGN_SPACE_AROUND: - *gap += (int32_t)(max_size - content_size) / (int32_t)(item_cnt); + *gap += (lv_coord_t)(max_size - content_size) / (lv_coord_t)(item_cnt); *start_pos += *gap / 2; break; case LV_FLEX_ALIGN_SPACE_EVENLY: - *gap = (int32_t)(max_size - content_size) / (int32_t)(item_cnt + 1); + *gap = (lv_coord_t)(max_size - content_size) / (lv_coord_t)(item_cnt + 1); *start_pos += *gap; break; default: @@ -519,18 +600,4 @@ static lv_obj_t * get_next_item(lv_obj_t * cont, bool rev, int32_t * item_id) } } -static int32_t lv_obj_get_width_with_margin(const lv_obj_t * obj) -{ - return lv_obj_get_style_margin_left(obj, LV_PART_MAIN) - + lv_obj_get_width(obj) - + lv_obj_get_style_margin_right(obj, LV_PART_MAIN); -} - -static int32_t lv_obj_get_height_with_margin(const lv_obj_t * obj) -{ - return lv_obj_get_style_margin_top(obj, LV_PART_MAIN) - + lv_obj_get_height(obj) - + lv_obj_get_style_margin_bottom(obj, LV_PART_MAIN); -} - #endif /*LV_USE_FLEX*/ diff --git a/L3_Middlewares/LVGL/src/extra/layouts/flex/lv_flex.h b/L3_Middlewares/LVGL/src/extra/layouts/flex/lv_flex.h new file mode 100644 index 0000000..58c3221 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/layouts/flex/lv_flex.h @@ -0,0 +1,152 @@ +/** + * @file lv_flex.h + * + */ + +#ifndef LV_FLEX_H +#define LV_FLEX_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../core/lv_obj.h" +#if LV_USE_FLEX + +/********************* + * DEFINES + *********************/ + +#define LV_OBJ_FLAG_FLEX_IN_NEW_TRACK LV_OBJ_FLAG_LAYOUT_1 +LV_EXPORT_CONST_INT(LV_OBJ_FLAG_FLEX_IN_NEW_TRACK); + +#define _LV_FLEX_COLUMN (1 << 0) +#define _LV_FLEX_WRAP (1 << 2) +#define _LV_FLEX_REVERSE (1 << 3) + +/********************** + * TYPEDEFS + **********************/ + +/*Can't include lv_obj.h because it includes this header file*/ +struct _lv_obj_t; + +typedef enum { + LV_FLEX_ALIGN_START, + LV_FLEX_ALIGN_END, + LV_FLEX_ALIGN_CENTER, + LV_FLEX_ALIGN_SPACE_EVENLY, + LV_FLEX_ALIGN_SPACE_AROUND, + LV_FLEX_ALIGN_SPACE_BETWEEN, +} lv_flex_align_t; + +typedef enum { + LV_FLEX_FLOW_ROW = 0x00, + LV_FLEX_FLOW_COLUMN = _LV_FLEX_COLUMN, + LV_FLEX_FLOW_ROW_WRAP = LV_FLEX_FLOW_ROW | _LV_FLEX_WRAP, + LV_FLEX_FLOW_ROW_REVERSE = LV_FLEX_FLOW_ROW | _LV_FLEX_REVERSE, + LV_FLEX_FLOW_ROW_WRAP_REVERSE = LV_FLEX_FLOW_ROW | _LV_FLEX_WRAP | _LV_FLEX_REVERSE, + LV_FLEX_FLOW_COLUMN_WRAP = LV_FLEX_FLOW_COLUMN | _LV_FLEX_WRAP, + LV_FLEX_FLOW_COLUMN_REVERSE = LV_FLEX_FLOW_COLUMN | _LV_FLEX_REVERSE, + LV_FLEX_FLOW_COLUMN_WRAP_REVERSE = LV_FLEX_FLOW_COLUMN | _LV_FLEX_WRAP | _LV_FLEX_REVERSE, +} lv_flex_flow_t; + +/********************** + * GLOBAL VARIABLES + **********************/ +extern uint16_t LV_LAYOUT_FLEX; +extern lv_style_prop_t LV_STYLE_FLEX_FLOW; +extern lv_style_prop_t LV_STYLE_FLEX_MAIN_PLACE; +extern lv_style_prop_t LV_STYLE_FLEX_CROSS_PLACE; +extern lv_style_prop_t LV_STYLE_FLEX_TRACK_PLACE; +extern lv_style_prop_t LV_STYLE_FLEX_GROW; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Initialize a flex layout the default values + * @param flex pointer to a flex layout descriptor + */ +void lv_flex_init(void); + +/** + * Set hot the item should flow + * @param flex pointer to a flex layout descriptor + * @param flow an element of `lv_flex_flow_t`. + */ +void lv_obj_set_flex_flow(lv_obj_t * obj, lv_flex_flow_t flow); + +/** + * Set how to place (where to align) the items and tracks + * @param flex pointer: to a flex layout descriptor + * @param main_place where to place the items on main axis (in their track). Any value of `lv_flex_align_t`. + * @param cross_place where to place the item in their track on the cross axis. `LV_FLEX_ALIGN_START/END/CENTER` + * @param track_place where to place the tracks in the cross direction. Any value of `lv_flex_align_t`. + */ +void lv_obj_set_flex_align(lv_obj_t * obj, lv_flex_align_t main_place, lv_flex_align_t cross_place, + lv_flex_align_t track_cross_place); + +/** + * Sets the width or height (on main axis) to grow the object in order fill the free space + * @param obj pointer to an object. The parent must have flex layout else nothing will happen. + * @param grow a value to set how much free space to take proportionally to other growing items. + */ +void lv_obj_set_flex_grow(lv_obj_t * obj, uint8_t grow); + +void lv_style_set_flex_flow(lv_style_t * style, lv_flex_flow_t value); +void lv_style_set_flex_main_place(lv_style_t * style, lv_flex_align_t value); +void lv_style_set_flex_cross_place(lv_style_t * style, lv_flex_align_t value); +void lv_style_set_flex_track_place(lv_style_t * style, lv_flex_align_t value); +void lv_style_set_flex_grow(lv_style_t * style, uint8_t value); +void lv_obj_set_style_flex_flow(lv_obj_t * obj, lv_flex_flow_t value, lv_style_selector_t selector); +void lv_obj_set_style_flex_main_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector); +void lv_obj_set_style_flex_cross_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector); +void lv_obj_set_style_flex_track_place(lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector); +void lv_obj_set_style_flex_grow(lv_obj_t * obj, uint8_t value, lv_style_selector_t selector); + +static inline lv_flex_flow_t lv_obj_get_style_flex_flow(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_FLEX_FLOW); + return (lv_flex_flow_t)v.num; +} + +static inline lv_flex_align_t lv_obj_get_style_flex_main_place(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_FLEX_MAIN_PLACE); + return (lv_flex_align_t)v.num; +} + +static inline lv_flex_align_t lv_obj_get_style_flex_cross_place(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_FLEX_CROSS_PLACE); + return (lv_flex_align_t)v.num; +} + +static inline lv_flex_align_t lv_obj_get_style_flex_track_place(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_FLEX_TRACK_PLACE); + return (lv_flex_align_t)v.num; +} + +static inline uint8_t lv_obj_get_style_flex_grow(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_FLEX_GROW); + return (uint8_t)v.num; +} + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_FLEX*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_FLEX_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/layouts/grid/lv_grid.c b/L3_Middlewares/LVGL/src/extra/layouts/grid/lv_grid.c new file mode 100644 index 0000000..74f8e95 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/layouts/grid/lv_grid.c @@ -0,0 +1,782 @@ +/** + * @file lv_grid.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../lv_layouts.h" + +#if LV_USE_GRID + +/********************* + * DEFINES + *********************/ +/** + * Some helper defines + */ +#define IS_FR(x) (x >= LV_COORD_MAX - 100) +#define IS_CONTENT(x) (x == LV_COORD_MAX - 101) +#define GET_FR(x) (x - (LV_COORD_MAX - 100)) + +/********************** + * TYPEDEFS + **********************/ +typedef struct { + uint32_t col; + uint32_t row; + lv_point_t grid_abs; +} item_repos_hint_t; + +typedef struct { + lv_coord_t * x; + lv_coord_t * y; + lv_coord_t * w; + lv_coord_t * h; + uint32_t col_num; + uint32_t row_num; + lv_coord_t grid_w; + lv_coord_t grid_h; +} _lv_grid_calc_t; + + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void grid_update(lv_obj_t * cont, void * user_data); +static void calc(lv_obj_t * obj, _lv_grid_calc_t * calc); +static void calc_free(_lv_grid_calc_t * calc); +static void calc_cols(lv_obj_t * cont, _lv_grid_calc_t * c); +static void calc_rows(lv_obj_t * cont, _lv_grid_calc_t * c); +static void item_repos(lv_obj_t * item, _lv_grid_calc_t * c, item_repos_hint_t * hint); +static lv_coord_t grid_align(lv_coord_t cont_size, bool auto_size, uint8_t align, lv_coord_t gap, uint32_t track_num, + lv_coord_t * size_array, lv_coord_t * pos_array, bool reverse); +static uint32_t count_tracks(const lv_coord_t * templ); + +static inline const lv_coord_t * get_col_dsc(lv_obj_t * obj) +{ + return lv_obj_get_style_grid_column_dsc_array(obj, 0); +} +static inline const lv_coord_t * get_row_dsc(lv_obj_t * obj) +{ + return lv_obj_get_style_grid_row_dsc_array(obj, 0); +} +static inline uint8_t get_col_pos(lv_obj_t * obj) +{ + return lv_obj_get_style_grid_cell_column_pos(obj, 0); +} +static inline uint8_t get_row_pos(lv_obj_t * obj) +{ + return lv_obj_get_style_grid_cell_row_pos(obj, 0); +} +static inline uint8_t get_col_span(lv_obj_t * obj) +{ + return lv_obj_get_style_grid_cell_column_span(obj, 0); +} +static inline uint8_t get_row_span(lv_obj_t * obj) +{ + return lv_obj_get_style_grid_cell_row_span(obj, 0); +} +static inline uint8_t get_cell_col_align(lv_obj_t * obj) +{ + return lv_obj_get_style_grid_cell_x_align(obj, 0); +} +static inline uint8_t get_cell_row_align(lv_obj_t * obj) +{ + return lv_obj_get_style_grid_cell_y_align(obj, 0); +} +static inline uint8_t get_grid_col_align(lv_obj_t * obj) +{ + return lv_obj_get_style_grid_column_align(obj, 0); +} +static inline uint8_t get_grid_row_align(lv_obj_t * obj) +{ + return lv_obj_get_style_grid_row_align(obj, 0); +} + +/********************** + * GLOBAL VARIABLES + **********************/ +uint16_t LV_LAYOUT_GRID; +lv_style_prop_t LV_STYLE_GRID_COLUMN_DSC_ARRAY; +lv_style_prop_t LV_STYLE_GRID_COLUMN_ALIGN; +lv_style_prop_t LV_STYLE_GRID_ROW_DSC_ARRAY; +lv_style_prop_t LV_STYLE_GRID_ROW_ALIGN; +lv_style_prop_t LV_STYLE_GRID_CELL_COLUMN_POS; +lv_style_prop_t LV_STYLE_GRID_CELL_COLUMN_SPAN; +lv_style_prop_t LV_STYLE_GRID_CELL_X_ALIGN; +lv_style_prop_t LV_STYLE_GRID_CELL_ROW_POS; +lv_style_prop_t LV_STYLE_GRID_CELL_ROW_SPAN; +lv_style_prop_t LV_STYLE_GRID_CELL_Y_ALIGN; + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + + +void lv_grid_init(void) +{ + LV_LAYOUT_GRID = lv_layout_register(grid_update, NULL); + + LV_STYLE_GRID_COLUMN_DSC_ARRAY = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + LV_STYLE_GRID_ROW_DSC_ARRAY = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + LV_STYLE_GRID_COLUMN_ALIGN = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + LV_STYLE_GRID_ROW_ALIGN = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + + LV_STYLE_GRID_CELL_ROW_SPAN = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + LV_STYLE_GRID_CELL_ROW_POS = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + LV_STYLE_GRID_CELL_COLUMN_SPAN = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + LV_STYLE_GRID_CELL_COLUMN_POS = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + LV_STYLE_GRID_CELL_X_ALIGN = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); + LV_STYLE_GRID_CELL_Y_ALIGN = lv_style_register_prop(LV_STYLE_PROP_LAYOUT_REFR); +} + +void lv_obj_set_grid_dsc_array(lv_obj_t * obj, const lv_coord_t col_dsc[], const lv_coord_t row_dsc[]) +{ + lv_obj_set_style_grid_column_dsc_array(obj, col_dsc, 0); + lv_obj_set_style_grid_row_dsc_array(obj, row_dsc, 0); + lv_obj_set_style_layout(obj, LV_LAYOUT_GRID, 0); +} + +void lv_obj_set_grid_align(lv_obj_t * obj, lv_grid_align_t column_align, lv_grid_align_t row_align) +{ + lv_obj_set_style_grid_column_align(obj, column_align, 0); + lv_obj_set_style_grid_row_align(obj, row_align, 0); + +} + +void lv_obj_set_grid_cell(lv_obj_t * obj, lv_grid_align_t x_align, uint8_t col_pos, uint8_t col_span, + lv_grid_align_t y_align, uint8_t row_pos, uint8_t row_span) + +{ + lv_obj_set_style_grid_cell_column_pos(obj, col_pos, 0); + lv_obj_set_style_grid_cell_row_pos(obj, row_pos, 0); + lv_obj_set_style_grid_cell_x_align(obj, x_align, 0); + lv_obj_set_style_grid_cell_column_span(obj, col_span, 0); + lv_obj_set_style_grid_cell_row_span(obj, row_span, 0); + lv_obj_set_style_grid_cell_y_align(obj, y_align, 0); + + lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj)); +} + + +void lv_style_set_grid_row_dsc_array(lv_style_t * style, const lv_coord_t value[]) +{ + lv_style_value_t v = { + .ptr = (const void *)value + }; + lv_style_set_prop(style, LV_STYLE_GRID_ROW_DSC_ARRAY, v); +} + +void lv_style_set_grid_column_dsc_array(lv_style_t * style, const lv_coord_t value[]) +{ + lv_style_value_t v = { + .ptr = (const void *)value + }; + lv_style_set_prop(style, LV_STYLE_GRID_COLUMN_DSC_ARRAY, v); +} + +void lv_style_set_grid_row_align(lv_style_t * style, lv_grid_align_t value) +{ + lv_style_value_t v = { + .num = (lv_grid_align_t)value + }; + lv_style_set_prop(style, LV_STYLE_GRID_ROW_ALIGN, v); +} + +void lv_style_set_grid_column_align(lv_style_t * style, lv_grid_align_t value) +{ + lv_style_value_t v = { + .num = (lv_grid_align_t)value + }; + lv_style_set_prop(style, LV_STYLE_GRID_COLUMN_ALIGN, v); +} + + +void lv_style_set_grid_cell_column_pos(lv_style_t * style, lv_coord_t value) +{ + lv_style_value_t v = { + .num = value + }; + lv_style_set_prop(style, LV_STYLE_GRID_CELL_COLUMN_POS, v); +} + +void lv_style_set_grid_cell_column_span(lv_style_t * style, lv_coord_t value) +{ + lv_style_value_t v = { + .num = value + }; + lv_style_set_prop(style, LV_STYLE_GRID_CELL_COLUMN_SPAN, v); +} + +void lv_style_set_grid_cell_row_pos(lv_style_t * style, lv_coord_t value) +{ + lv_style_value_t v = { + .num = value + }; + lv_style_set_prop(style, LV_STYLE_GRID_CELL_ROW_POS, v); +} + +void lv_style_set_grid_cell_row_span(lv_style_t * style, lv_coord_t value) +{ + lv_style_value_t v = { + .num = value + }; + lv_style_set_prop(style, LV_STYLE_GRID_CELL_ROW_SPAN, v); +} + +void lv_style_set_grid_cell_x_align(lv_style_t * style, lv_coord_t value) +{ + lv_style_value_t v = { + .num = value + }; + lv_style_set_prop(style, LV_STYLE_GRID_CELL_X_ALIGN, v); +} + +void lv_style_set_grid_cell_y_align(lv_style_t * style, lv_coord_t value) +{ + lv_style_value_t v = { + .num = value + }; + lv_style_set_prop(style, LV_STYLE_GRID_CELL_Y_ALIGN, v); +} + +void lv_obj_set_style_grid_row_dsc_array(lv_obj_t * obj, const lv_coord_t value[], lv_style_selector_t selector) +{ + lv_style_value_t v = { + .ptr = (const void *)value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_ROW_DSC_ARRAY, v, selector); +} + +void lv_obj_set_style_grid_column_dsc_array(lv_obj_t * obj, const lv_coord_t value[], lv_style_selector_t selector) +{ + lv_style_value_t v = { + .ptr = (const void *)value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_COLUMN_DSC_ARRAY, v, selector); +} + + +void lv_obj_set_style_grid_row_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = (int32_t) value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_ROW_ALIGN, v, selector); +} + +void lv_obj_set_style_grid_column_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = (int32_t) value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_COLUMN_ALIGN, v, selector); +} + + +void lv_obj_set_style_grid_cell_column_pos(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_COLUMN_POS, v, selector); +} + +void lv_obj_set_style_grid_cell_column_span(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_COLUMN_SPAN, v, selector); +} + +void lv_obj_set_style_grid_cell_row_pos(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_ROW_POS, v, selector); +} + +void lv_obj_set_style_grid_cell_row_span(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_ROW_SPAN, v, selector); +} + +void lv_obj_set_style_grid_cell_x_align(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_X_ALIGN, v, selector); +} + +void lv_obj_set_style_grid_cell_y_align(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector) +{ + lv_style_value_t v = { + .num = value + }; + lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_Y_ALIGN, v, selector); +} + + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void grid_update(lv_obj_t * cont, void * user_data) +{ + LV_LOG_INFO("update %p container", (void *)cont); + LV_UNUSED(user_data); + + const lv_coord_t * col_templ = get_col_dsc(cont); + const lv_coord_t * row_templ = get_row_dsc(cont); + if(col_templ == NULL || row_templ == NULL) return; + + _lv_grid_calc_t c; + calc(cont, &c); + + item_repos_hint_t hint; + lv_memset_00(&hint, sizeof(hint)); + + /*Calculate the grids absolute x and y coordinates. + *It will be used as helper during item repositioning to avoid calculating this value for every children*/ + lv_coord_t border_widt = lv_obj_get_style_border_width(cont, LV_PART_MAIN); + lv_coord_t pad_left = lv_obj_get_style_pad_left(cont, LV_PART_MAIN) + border_widt; + lv_coord_t pad_top = lv_obj_get_style_pad_top(cont, LV_PART_MAIN) + border_widt; + hint.grid_abs.x = pad_left + cont->coords.x1 - lv_obj_get_scroll_x(cont); + hint.grid_abs.y = pad_top + cont->coords.y1 - lv_obj_get_scroll_y(cont); + + uint32_t i; + for(i = 0; i < cont->spec_attr->child_cnt; i++) { + lv_obj_t * item = cont->spec_attr->children[i]; + item_repos(item, &c, &hint); + } + calc_free(&c); + + lv_coord_t w_set = lv_obj_get_style_width(cont, LV_PART_MAIN); + lv_coord_t h_set = lv_obj_get_style_height(cont, LV_PART_MAIN); + if(w_set == LV_SIZE_CONTENT || h_set == LV_SIZE_CONTENT) { + lv_obj_refr_size(cont); + } + + lv_event_send(cont, LV_EVENT_LAYOUT_CHANGED, NULL); + + LV_TRACE_LAYOUT("finished"); +} + +/** + * Calculate the grid cells coordinates + * @param cont an object that has a grid + * @param calc store the calculated cells sizes here + * @note `_lv_grid_calc_free(calc_out)` needs to be called when `calc_out` is not needed anymore + */ +static void calc(lv_obj_t * cont, _lv_grid_calc_t * calc_out) +{ + if(lv_obj_get_child(cont, 0) == NULL) { + lv_memset_00(calc_out, sizeof(_lv_grid_calc_t)); + return; + } + + calc_rows(cont, calc_out); + calc_cols(cont, calc_out); + + lv_coord_t col_gap = lv_obj_get_style_pad_column(cont, LV_PART_MAIN); + lv_coord_t row_gap = lv_obj_get_style_pad_row(cont, LV_PART_MAIN); + + bool rev = lv_obj_get_style_base_dir(cont, LV_PART_MAIN) == LV_BASE_DIR_RTL ? true : false; + + lv_coord_t w_set = lv_obj_get_style_width(cont, LV_PART_MAIN); + lv_coord_t h_set = lv_obj_get_style_height(cont, LV_PART_MAIN); + bool auto_w = (w_set == LV_SIZE_CONTENT && !cont->w_layout) ? true : false; + lv_coord_t cont_w = lv_obj_get_content_width(cont); + calc_out->grid_w = grid_align(cont_w, auto_w, get_grid_col_align(cont), col_gap, calc_out->col_num, calc_out->w, + calc_out->x, rev); + + bool auto_h = (h_set == LV_SIZE_CONTENT && !cont->h_layout) ? true : false; + lv_coord_t cont_h = lv_obj_get_content_height(cont); + calc_out->grid_h = grid_align(cont_h, auto_h, get_grid_row_align(cont), row_gap, calc_out->row_num, calc_out->h, + calc_out->y, false); + + LV_ASSERT_MEM_INTEGRITY(); +} + +/** + * Free the a grid calculation's data + * @param calc pointer to the calculated grid cell coordinates + */ +static void calc_free(_lv_grid_calc_t * calc) +{ + lv_mem_buf_release(calc->x); + lv_mem_buf_release(calc->y); + lv_mem_buf_release(calc->w); + lv_mem_buf_release(calc->h); +} + +static void calc_cols(lv_obj_t * cont, _lv_grid_calc_t * c) +{ + const lv_coord_t * col_templ = get_col_dsc(cont); + lv_coord_t cont_w = lv_obj_get_content_width(cont); + + c->col_num = count_tracks(col_templ); + c->x = lv_mem_buf_get(sizeof(lv_coord_t) * c->col_num); + c->w = lv_mem_buf_get(sizeof(lv_coord_t) * c->col_num); + + /*Set sizes for CONTENT cells*/ + uint32_t i; + for(i = 0; i < c->col_num; i++) { + lv_coord_t size = LV_COORD_MIN; + if(IS_CONTENT(col_templ[i])) { + /*Check the size of children of this cell*/ + uint32_t ci; + for(ci = 0; ci < lv_obj_get_child_cnt(cont); ci++) { + lv_obj_t * item = lv_obj_get_child(cont, ci); + if(lv_obj_has_flag_any(item, LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; + uint32_t col_span = get_col_span(item); + if(col_span != 1) continue; + + uint32_t col_pos = get_col_pos(item); + if(col_pos != i) continue; + + size = LV_MAX(size, lv_obj_get_width(item)); + } + if(size >= 0) c->w[i] = size; + else c->w[i] = 0; + } + } + + uint32_t col_fr_cnt = 0; + lv_coord_t grid_w = 0; + + for(i = 0; i < c->col_num; i++) { + lv_coord_t x = col_templ[i]; + if(IS_FR(x)) { + col_fr_cnt += GET_FR(x); + } + else if(IS_CONTENT(x)) { + grid_w += c->w[i]; + } + else { + c->w[i] = x; + grid_w += x; + } + } + + lv_coord_t col_gap = lv_obj_get_style_pad_column(cont, LV_PART_MAIN); + cont_w -= col_gap * (c->col_num - 1); + lv_coord_t free_w = cont_w - grid_w; + if(free_w < 0) free_w = 0; + + int32_t last_fr_i = -1; + int32_t last_fr_x = 0; + for(i = 0; i < c->col_num; i++) { + lv_coord_t x = col_templ[i]; + if(IS_FR(x)) { + lv_coord_t f = GET_FR(x); + c->w[i] = (free_w * f) / col_fr_cnt; + last_fr_i = i; + last_fr_x = f; + } + } + + /*To avoid rounding errors set the last FR track to the remaining size */ + if(last_fr_i >= 0) { + c->w[last_fr_i] = free_w - ((free_w * (col_fr_cnt - last_fr_x)) / col_fr_cnt); + } +} + +static void calc_rows(lv_obj_t * cont, _lv_grid_calc_t * c) +{ + uint32_t i; + const lv_coord_t * row_templ = get_row_dsc(cont); + c->row_num = count_tracks(row_templ); + c->y = lv_mem_buf_get(sizeof(lv_coord_t) * c->row_num); + c->h = lv_mem_buf_get(sizeof(lv_coord_t) * c->row_num); + /*Set sizes for CONTENT cells*/ + for(i = 0; i < c->row_num; i++) { + lv_coord_t size = LV_COORD_MIN; + if(IS_CONTENT(row_templ[i])) { + /*Check the size of children of this cell*/ + uint32_t ci; + for(ci = 0; ci < lv_obj_get_child_cnt(cont); ci++) { + lv_obj_t * item = lv_obj_get_child(cont, ci); + if(lv_obj_has_flag_any(item, LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; + uint32_t row_span = get_row_span(item); + if(row_span != 1) continue; + + uint32_t row_pos = get_row_pos(item); + if(row_pos != i) continue; + + size = LV_MAX(size, lv_obj_get_height(item)); + } + if(size >= 0) c->h[i] = size; + else c->h[i] = 0; + } + } + + uint32_t row_fr_cnt = 0; + lv_coord_t grid_h = 0; + + for(i = 0; i < c->row_num; i++) { + lv_coord_t x = row_templ[i]; + if(IS_FR(x)) { + row_fr_cnt += GET_FR(x); + } + else if(IS_CONTENT(x)) { + grid_h += c->h[i]; + } + else { + c->h[i] = x; + grid_h += x; + } + } + + + lv_coord_t row_gap = lv_obj_get_style_pad_row(cont, LV_PART_MAIN); + lv_coord_t cont_h = lv_obj_get_content_height(cont) - row_gap * (c->row_num - 1); + lv_coord_t free_h = cont_h - grid_h; + if(free_h < 0) free_h = 0; + + int32_t last_fr_i = -1; + int32_t last_fr_x = 0; + for(i = 0; i < c->row_num; i++) { + lv_coord_t x = row_templ[i]; + if(IS_FR(x)) { + lv_coord_t f = GET_FR(x); + c->h[i] = (free_h * f) / row_fr_cnt; + last_fr_i = i; + last_fr_x = f; + } + } + + /*To avoid rounding errors set the last FR track to the remaining size */ + if(last_fr_i >= 0) { + c->h[last_fr_i] = free_h - ((free_h * (row_fr_cnt - last_fr_x)) / row_fr_cnt); + } +} + +/** + * Reposition a grid item in its cell + * @param item a grid item to reposition + * @param calc the calculated grid of `cont` + * @param child_id_ext helper value if the ID of the child is know (order from the oldest) else -1 + * @param grid_abs helper value, the absolute position of the grid, NULL if unknown + */ +static void item_repos(lv_obj_t * item, _lv_grid_calc_t * c, item_repos_hint_t * hint) +{ + if(lv_obj_has_flag_any(item, LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) return; + uint32_t col_span = get_col_span(item); + uint32_t row_span = get_row_span(item); + if(row_span == 0 || col_span == 0) return; + + uint32_t col_pos = get_col_pos(item); + uint32_t row_pos = get_row_pos(item); + lv_grid_align_t col_align = get_cell_col_align(item); + lv_grid_align_t row_align = get_cell_row_align(item); + + + lv_coord_t col_x1 = c->x[col_pos]; + lv_coord_t col_x2 = c->x[col_pos + col_span - 1] + c->w[col_pos + col_span - 1]; + lv_coord_t col_w = col_x2 - col_x1; + + lv_coord_t row_y1 = c->y[row_pos]; + lv_coord_t row_y2 = c->y[row_pos + row_span - 1] + c->h[row_pos + row_span - 1]; + lv_coord_t row_h = row_y2 - row_y1; + + + /*If the item has RTL base dir switch start and end*/ + if(lv_obj_get_style_base_dir(item, LV_PART_MAIN) == LV_BASE_DIR_RTL) { + if(col_align == LV_GRID_ALIGN_START) col_align = LV_GRID_ALIGN_END; + else if(col_align == LV_GRID_ALIGN_END) col_align = LV_GRID_ALIGN_START; + } + + lv_coord_t x; + lv_coord_t y; + lv_coord_t item_w = lv_area_get_width(&item->coords); + lv_coord_t item_h = lv_area_get_height(&item->coords); + + switch(col_align) { + default: + case LV_GRID_ALIGN_START: + x = c->x[col_pos]; + item->w_layout = 0; + break; + case LV_GRID_ALIGN_STRETCH: + x = c->x[col_pos]; + item_w = col_w; + item->w_layout = 1; + break; + case LV_GRID_ALIGN_CENTER: + x = c->x[col_pos] + (col_w - item_w) / 2; + item->w_layout = 0; + break; + case LV_GRID_ALIGN_END: + x = c->x[col_pos] + col_w - lv_obj_get_width(item); + item->w_layout = 0; + break; + } + + switch(row_align) { + default: + case LV_GRID_ALIGN_START: + y = c->y[row_pos]; + item->h_layout = 0; + break; + case LV_GRID_ALIGN_STRETCH: + y = c->y[row_pos]; + item_h = row_h; + item->h_layout = 1; + break; + case LV_GRID_ALIGN_CENTER: + y = c->y[row_pos] + (row_h - item_h) / 2; + item->h_layout = 0; + break; + case LV_GRID_ALIGN_END: + y = c->y[row_pos] + row_h - lv_obj_get_height(item); + item->h_layout = 0; + break; + } + + /*Set a new size if required*/ + if(lv_obj_get_width(item) != item_w || lv_obj_get_height(item) != item_h) { + lv_area_t old_coords; + lv_area_copy(&old_coords, &item->coords); + lv_obj_invalidate(item); + lv_area_set_width(&item->coords, item_w); + lv_area_set_height(&item->coords, item_h); + lv_obj_invalidate(item); + lv_event_send(item, LV_EVENT_SIZE_CHANGED, &old_coords); + lv_event_send(lv_obj_get_parent(item), LV_EVENT_CHILD_CHANGED, item); + + } + + /*Handle percentage value of translate*/ + lv_coord_t tr_x = lv_obj_get_style_translate_x(item, LV_PART_MAIN); + lv_coord_t tr_y = lv_obj_get_style_translate_y(item, LV_PART_MAIN); + lv_coord_t w = lv_obj_get_width(item); + lv_coord_t h = lv_obj_get_height(item); + if(LV_COORD_IS_PCT(tr_x)) tr_x = (w * LV_COORD_GET_PCT(tr_x)) / 100; + if(LV_COORD_IS_PCT(tr_y)) tr_y = (h * LV_COORD_GET_PCT(tr_y)) / 100; + + x += tr_x; + y += tr_y; + + lv_coord_t diff_x = hint->grid_abs.x + x - item->coords.x1; + lv_coord_t diff_y = hint->grid_abs.y + y - item->coords.y1; + if(diff_x || diff_y) { + lv_obj_invalidate(item); + item->coords.x1 += diff_x; + item->coords.x2 += diff_x; + item->coords.y1 += diff_y; + item->coords.y2 += diff_y; + lv_obj_invalidate(item); + lv_obj_move_children_by(item, diff_x, diff_y, false); + } +} + +/** + * Place the grid track according to align methods. It keeps the track sizes but sets their position. + * It can process both columns or rows according to the passed parameters. + * @param cont_size size of the containers content area (width/height) + * @param auto_size true: the container has auto size in the current direction + * @param align align method + * @param gap grid gap + * @param track_num number of tracks + * @param size_array array with the track sizes + * @param pos_array write the positions of the tracks here + * @return the total size of the grid + */ +static lv_coord_t grid_align(lv_coord_t cont_size, bool auto_size, uint8_t align, lv_coord_t gap, uint32_t track_num, + lv_coord_t * size_array, lv_coord_t * pos_array, bool reverse) +{ + lv_coord_t grid_size = 0; + uint32_t i; + + if(auto_size) { + pos_array[0] = 0; + } + else { + /*With spaced alignment gap will be calculated from the remaining space*/ + if(align == LV_GRID_ALIGN_SPACE_AROUND || align == LV_GRID_ALIGN_SPACE_BETWEEN || align == LV_GRID_ALIGN_SPACE_EVENLY) { + gap = 0; + if(track_num == 1) align = LV_GRID_ALIGN_CENTER; + } + + /*Get the full grid size with gap*/ + for(i = 0; i < track_num; i++) { + grid_size += size_array[i] + gap; + } + grid_size -= gap; + + /*Calculate the position of the first item and set gap is necessary*/ + switch(align) { + case LV_GRID_ALIGN_START: + pos_array[0] = 0; + break; + case LV_GRID_ALIGN_CENTER: + pos_array[0] = (cont_size - grid_size) / 2; + break; + case LV_GRID_ALIGN_END: + pos_array[0] = cont_size - grid_size; + break; + case LV_GRID_ALIGN_SPACE_BETWEEN: + pos_array[0] = 0; + gap = (lv_coord_t)(cont_size - grid_size) / (lv_coord_t)(track_num - 1); + break; + case LV_GRID_ALIGN_SPACE_AROUND: + gap = (lv_coord_t)(cont_size - grid_size) / (lv_coord_t)(track_num); + pos_array[0] = gap / 2; + break; + case LV_GRID_ALIGN_SPACE_EVENLY: + gap = (lv_coord_t)(cont_size - grid_size) / (lv_coord_t)(track_num + 1); + pos_array[0] = gap; + break; + + } + } + + /*Set the position of all tracks from the start position, gaps and track sizes*/ + for(i = 0; i < track_num - 1; i++) { + pos_array[i + 1] = pos_array[i] + size_array[i] + gap; + } + + lv_coord_t total_gird_size = pos_array[track_num - 1] + size_array[track_num - 1] - pos_array[0]; + + if(reverse) { + for(i = 0; i < track_num; i++) { + pos_array[i] = cont_size - pos_array[i] - size_array[i]; + } + + } + + /*Return the full size of the grid*/ + return total_gird_size; +} + +static uint32_t count_tracks(const lv_coord_t * templ) +{ + uint32_t i; + for(i = 0; templ[i] != LV_GRID_TEMPLATE_LAST; i++); + + return i; +} + + +#endif /*LV_USE_GRID*/ diff --git a/L3_Middlewares/LVGL/src/extra/layouts/grid/lv_grid.h b/L3_Middlewares/LVGL/src/extra/layouts/grid/lv_grid.h new file mode 100644 index 0000000..5c4f767 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/layouts/grid/lv_grid.h @@ -0,0 +1,194 @@ +/** + * @file lv_grid.h + * + */ + +#ifndef LV_GRID_H +#define LV_GRID_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../core/lv_obj.h" +#if LV_USE_GRID + +/********************* + * DEFINES + *********************/ +/** + * Can be used track size to make the track fill the free space. + * @param x how much space to take proportionally to other FR tracks + * @return a special track size + */ +#define LV_GRID_FR(x) (LV_COORD_MAX - 100 + x) + +#define LV_GRID_CONTENT (LV_COORD_MAX - 101) +LV_EXPORT_CONST_INT(LV_GRID_CONTENT); + +#define LV_GRID_TEMPLATE_LAST (LV_COORD_MAX) +LV_EXPORT_CONST_INT(LV_GRID_TEMPLATE_LAST); + +/********************** + * TYPEDEFS + **********************/ + +/*Can't include lv_obj.h because it includes this header file*/ +struct _lv_obj_t; + +typedef enum { + LV_GRID_ALIGN_START, + LV_GRID_ALIGN_CENTER, + LV_GRID_ALIGN_END, + LV_GRID_ALIGN_STRETCH, + LV_GRID_ALIGN_SPACE_EVENLY, + LV_GRID_ALIGN_SPACE_AROUND, + LV_GRID_ALIGN_SPACE_BETWEEN, +} lv_grid_align_t; + +/********************** + * GLOBAL VARIABLES + **********************/ + +extern uint16_t LV_LAYOUT_GRID; +extern lv_style_prop_t LV_STYLE_GRID_COLUMN_DSC_ARRAY; +extern lv_style_prop_t LV_STYLE_GRID_COLUMN_ALIGN; +extern lv_style_prop_t LV_STYLE_GRID_ROW_DSC_ARRAY; +extern lv_style_prop_t LV_STYLE_GRID_ROW_ALIGN; +extern lv_style_prop_t LV_STYLE_GRID_CELL_COLUMN_POS; +extern lv_style_prop_t LV_STYLE_GRID_CELL_COLUMN_SPAN; +extern lv_style_prop_t LV_STYLE_GRID_CELL_X_ALIGN; +extern lv_style_prop_t LV_STYLE_GRID_CELL_ROW_POS; +extern lv_style_prop_t LV_STYLE_GRID_CELL_ROW_SPAN; +extern lv_style_prop_t LV_STYLE_GRID_CELL_Y_ALIGN; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +void lv_grid_init(void); + +void lv_obj_set_grid_dsc_array(lv_obj_t * obj, const lv_coord_t col_dsc[], const lv_coord_t row_dsc[]); + +void lv_obj_set_grid_align(lv_obj_t * obj, lv_grid_align_t column_align, lv_grid_align_t row_align); + +/** + * Set the cell of an object. The object's parent needs to have grid layout, else nothing will happen + * @param obj pointer to an object + * @param column_align the vertical alignment in the cell. `LV_GRID_START/END/CENTER/STRETCH` + * @param col_pos column ID + * @param col_span number of columns to take (>= 1) + * @param row_align the horizontal alignment in the cell. `LV_GRID_START/END/CENTER/STRETCH` + * @param row_pos row ID + * @param row_span number of rows to take (>= 1) + */ +void lv_obj_set_grid_cell(lv_obj_t * obj, lv_grid_align_t column_align, uint8_t col_pos, uint8_t col_span, + lv_grid_align_t row_align, uint8_t row_pos, uint8_t row_span); + +/** + * Just a wrapper to `LV_GRID_FR` for bindings. + */ +static inline lv_coord_t lv_grid_fr(uint8_t x) +{ + return LV_GRID_FR(x); +} + +void lv_style_set_grid_row_dsc_array(lv_style_t * style, const lv_coord_t value[]); +void lv_style_set_grid_column_dsc_array(lv_style_t * style, const lv_coord_t value[]); +void lv_style_set_grid_row_align(lv_style_t * style, lv_grid_align_t value); +void lv_style_set_grid_column_align(lv_style_t * style, lv_grid_align_t value); +void lv_style_set_grid_cell_column_pos(lv_style_t * style, lv_coord_t value); +void lv_style_set_grid_cell_column_span(lv_style_t * style, lv_coord_t value); +void lv_style_set_grid_cell_row_pos(lv_style_t * style, lv_coord_t value); +void lv_style_set_grid_cell_row_span(lv_style_t * style, lv_coord_t value); +void lv_style_set_grid_cell_x_align(lv_style_t * style, lv_coord_t value); +void lv_style_set_grid_cell_y_align(lv_style_t * style, lv_coord_t value); + +void lv_obj_set_style_grid_row_dsc_array(lv_obj_t * obj, const lv_coord_t value[], lv_style_selector_t selector); +void lv_obj_set_style_grid_column_dsc_array(lv_obj_t * obj, const lv_coord_t value[], lv_style_selector_t selector); +void lv_obj_set_style_grid_row_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector); +void lv_obj_set_style_grid_column_align(lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector); +void lv_obj_set_style_grid_cell_column_pos(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_grid_cell_column_span(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_grid_cell_row_pos(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_grid_cell_row_span(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_grid_cell_x_align(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); +void lv_obj_set_style_grid_cell_y_align(lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); + +static inline const lv_coord_t * lv_obj_get_style_grid_row_dsc_array(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_ROW_DSC_ARRAY); + return (const lv_coord_t *)v.ptr; +} + +static inline const lv_coord_t * lv_obj_get_style_grid_column_dsc_array(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_COLUMN_DSC_ARRAY); + return (const lv_coord_t *)v.ptr; +} + +static inline lv_grid_align_t lv_obj_get_style_grid_row_align(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_ROW_ALIGN); + return (lv_grid_align_t)v.num; +} + +static inline lv_grid_align_t lv_obj_get_style_grid_column_align(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_COLUMN_ALIGN); + return (lv_grid_align_t)v.num; +} + +static inline lv_coord_t lv_obj_get_style_grid_cell_column_pos(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_COLUMN_POS); + return (lv_coord_t)v.num; +} + +static inline lv_coord_t lv_obj_get_style_grid_cell_column_span(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_COLUMN_SPAN); + return (lv_coord_t)v.num; +} + +static inline lv_coord_t lv_obj_get_style_grid_cell_row_pos(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_ROW_POS); + return (lv_coord_t)v.num; +} + +static inline lv_coord_t lv_obj_get_style_grid_cell_row_span(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_ROW_SPAN); + return (lv_coord_t)v.num; +} + +static inline lv_coord_t lv_obj_get_style_grid_cell_x_align(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_X_ALIGN); + return (lv_coord_t)v.num; +} + +static inline lv_coord_t lv_obj_get_style_grid_cell_y_align(const lv_obj_t * obj, uint32_t part) +{ + lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_Y_ALIGN); + return (lv_coord_t)v.num; +} + +/********************** + * GLOBAL VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ +#endif /*LV_USE_GRID*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_GRID_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_rect_private.h b/L3_Middlewares/LVGL/src/extra/layouts/lv_layouts.h similarity index 60% rename from L3_Middlewares/LVGL/src/draw/lv_draw_rect_private.h rename to L3_Middlewares/LVGL/src/extra/layouts/lv_layouts.h index ad75b53..9c1e958 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_rect_private.h +++ b/L3_Middlewares/LVGL/src/extra/layouts/lv_layouts.h @@ -1,10 +1,10 @@ /** - * @file lv_draw_rect_private.h + * @file lv_layouts.h * */ -#ifndef LV_DRAW_RECT_PRIVATE_H -#define LV_DRAW_RECT_PRIVATE_H +#ifndef LV_LAYOUTS_H +#define LV_LAYOUTS_H #ifdef __cplusplus extern "C" { @@ -13,8 +13,8 @@ extern "C" { /********************* * INCLUDES *********************/ - -#include "lv_draw_rect.h" +#include "flex/lv_flex.h" +#include "grid/lv_grid.h" /********************* * DEFINES @@ -31,9 +31,14 @@ extern "C" { /********************** * MACROS **********************/ +#if LV_USE_LOG && LV_LOG_TRACE_LAYOUT +# define LV_TRACE_LAYOUT(...) LV_LOG_TRACE(__VA_ARGS__) +#else +# define LV_TRACE_LAYOUT(...) +#endif #ifdef __cplusplus } /*extern "C"*/ #endif -#endif /*LV_DRAW_RECT_PRIVATE_H*/ +#endif /*LV_LAYOUTS_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/libs/bmp/lv_bmp.c b/L3_Middlewares/LVGL/src/extra/libs/bmp/lv_bmp.c new file mode 100644 index 0000000..f89a0a8 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/bmp/lv_bmp.c @@ -0,0 +1,258 @@ +/** + * @file lv_bmp.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" +#if LV_USE_BMP + +#include + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_fs_file_t f; + unsigned int px_offset; + int px_width; + int px_height; + unsigned int bpp; + int row_size_bytes; +} bmp_dsc_t; + +/********************** + * STATIC PROTOTYPES + **********************/ +static lv_res_t decoder_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header); +static lv_res_t decoder_open(lv_img_decoder_t * dec, lv_img_decoder_dsc_t * dsc); + + +static lv_res_t decoder_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, + lv_coord_t x, lv_coord_t y, lv_coord_t len, uint8_t * buf); + +static void decoder_close(lv_img_decoder_t * dec, lv_img_decoder_dsc_t * dsc); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ +void lv_bmp_init(void) +{ + lv_img_decoder_t * dec = lv_img_decoder_create(); + lv_img_decoder_set_info_cb(dec, decoder_info); + lv_img_decoder_set_open_cb(dec, decoder_open); + lv_img_decoder_set_read_line_cb(dec, decoder_read_line); + lv_img_decoder_set_close_cb(dec, decoder_close); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +/** + * Get info about a PNG image + * @param src can be file name or pointer to a C array + * @param header store the info here + * @return LV_RES_OK: no error; LV_RES_INV: can't get the info + */ +static lv_res_t decoder_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header) +{ + LV_UNUSED(decoder); + + lv_img_src_t src_type = lv_img_src_get_type(src); /*Get the source type*/ + + /*If it's a BMP file...*/ + if(src_type == LV_IMG_SRC_FILE) { + const char * fn = src; + if(strcmp(lv_fs_get_ext(fn), "bmp") == 0) { /*Check the extension*/ + /*Save the data in the header*/ + lv_fs_file_t f; + lv_fs_res_t res = lv_fs_open(&f, src, LV_FS_MODE_RD); + if(res != LV_FS_RES_OK) return LV_RES_INV; + uint8_t headers[54]; + + lv_fs_read(&f, headers, 54, NULL); + uint32_t w; + uint32_t h; + memcpy(&w, headers + 18, 4); + memcpy(&h, headers + 22, 4); + header->w = w; + header->h = h; + header->always_zero = 0; + lv_fs_close(&f); +#if LV_COLOR_DEPTH == 32 + uint16_t bpp; + memcpy(&bpp, headers + 28, 2); + header->cf = bpp == 32 ? LV_IMG_CF_TRUE_COLOR_ALPHA : LV_IMG_CF_TRUE_COLOR; +#else + header->cf = LV_IMG_CF_TRUE_COLOR; +#endif + return LV_RES_OK; + } + } + /* BMP file as data not supported for simplicity. + * Convert them to LVGL compatible C arrays directly. */ + else if(src_type == LV_IMG_SRC_VARIABLE) { + return LV_RES_INV; + } + + return LV_RES_INV; /*If didn't succeeded earlier then it's an error*/ +} + + +/** + * Open a PNG image and return the decided image + * @param src can be file name or pointer to a C array + * @param style style of the image object (unused now but certain formats might use it) + * @return pointer to the decoded image or `LV_IMG_DECODER_OPEN_FAIL` if failed + */ +static lv_res_t decoder_open(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc) +{ + LV_UNUSED(decoder); + + /*If it's a PNG file...*/ + if(dsc->src_type == LV_IMG_SRC_FILE) { + const char * fn = dsc->src; + + if(strcmp(lv_fs_get_ext(fn), "bmp") != 0) { + return LV_RES_INV; /*Check the extension*/ + } + + bmp_dsc_t b; + memset(&b, 0x00, sizeof(b)); + + lv_fs_res_t res = lv_fs_open(&b.f, dsc->src, LV_FS_MODE_RD); + if(res == LV_RES_OK) return LV_RES_INV; + + uint8_t header[54]; + lv_fs_read(&b.f, header, 54, NULL); + + if(0x42 != header[0] || 0x4d != header[1]) { + lv_fs_close(&b.f); + return LV_RES_INV; + } + + memcpy(&b.px_offset, header + 10, 4); + memcpy(&b.px_width, header + 18, 4); + memcpy(&b.px_height, header + 22, 4); + memcpy(&b.bpp, header + 28, 2); + b.row_size_bytes = ((b.bpp * b.px_width + 31) / 32) * 4; + + bool color_depth_error = false; + if(LV_COLOR_DEPTH == 32 && (b.bpp != 32 && b.bpp != 24)) { + LV_LOG_WARN("LV_COLOR_DEPTH == 32 but bpp is %d (should be 32 or 24)", b.bpp); + color_depth_error = true; + } + else if(LV_COLOR_DEPTH == 16 && b.bpp != 16) { + LV_LOG_WARN("LV_COLOR_DEPTH == 16 but bpp is %d (should be 16)", b.bpp); + color_depth_error = true; + } + else if(LV_COLOR_DEPTH == 8 && b.bpp != 8) { + LV_LOG_WARN("LV_COLOR_DEPTH == 8 but bpp is %d (should be 8)", b.bpp); + color_depth_error = true; + } + + if(color_depth_error) { + dsc->error_msg = "Color depth mismatch"; + lv_fs_close(&b.f); + return LV_RES_INV; + } + + dsc->user_data = lv_mem_alloc(sizeof(bmp_dsc_t)); + LV_ASSERT_MALLOC(dsc->user_data); + if(dsc->user_data == NULL) return LV_RES_INV; + memcpy(dsc->user_data, &b, sizeof(b)); + + dsc->img_data = NULL; + return LV_RES_OK; + } + /* BMP file as data not supported for simplicity. + * Convert them to LVGL compatible C arrays directly. */ + else if(dsc->src_type == LV_IMG_SRC_VARIABLE) { + return LV_RES_INV; + } + + return LV_RES_INV; /*If not returned earlier then it failed*/ +} + + +static lv_res_t decoder_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, + lv_coord_t x, lv_coord_t y, lv_coord_t len, uint8_t * buf) +{ + LV_UNUSED(decoder); + + bmp_dsc_t * b = dsc->user_data; + y = (b->px_height - 1) - y; /*BMP images are stored upside down*/ + uint32_t p = b->px_offset + b->row_size_bytes * y; + p += x * (b->bpp / 8); + lv_fs_seek(&b->f, p, LV_FS_SEEK_SET); + lv_fs_read(&b->f, buf, len * (b->bpp / 8), NULL); + +#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 1 + for(unsigned int i = 0; i < len * (b->bpp / 8); i += 2) { + buf[i] = buf[i] ^ buf[i + 1]; + buf[i + 1] = buf[i] ^ buf[i + 1]; + buf[i] = buf[i] ^ buf[i + 1]; + } + +#elif LV_COLOR_DEPTH == 32 + if(b->bpp == 32) { + lv_coord_t i; + for(i = 0; i < len; i++) { + uint8_t b0 = buf[i * 4]; + uint8_t b1 = buf[i * 4 + 1]; + uint8_t b2 = buf[i * 4 + 2]; + uint8_t b3 = buf[i * 4 + 3]; + lv_color32_t * c = (lv_color32_t *)&buf[i * 4]; + c->ch.red = b2; + c->ch.green = b1; + c->ch.blue = b0; + c->ch.alpha = b3; + } + } + if(b->bpp == 24) { + lv_coord_t i; + + for(i = len - 1; i >= 0; i--) { + uint8_t * t = &buf[i * 3]; + lv_color32_t * c = (lv_color32_t *)&buf[i * 4]; + c->ch.red = t[2]; + c->ch.green = t[1]; + c->ch.blue = t[0]; + c->ch.alpha = 0xff; + } + } +#endif + + return LV_RES_OK; +} + + +/** + * Free the allocated resources + */ +static void decoder_close(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc) +{ + LV_UNUSED(decoder); + bmp_dsc_t * b = dsc->user_data; + lv_fs_close(&b->f); + lv_mem_free(dsc->user_data); + +} + +#endif /*LV_USE_BMP*/ diff --git a/L3_Middlewares/LVGL/src/libs/bmp/lv_bmp.h b/L3_Middlewares/LVGL/src/extra/libs/bmp/lv_bmp.h similarity index 90% rename from L3_Middlewares/LVGL/src/libs/bmp/lv_bmp.h rename to L3_Middlewares/LVGL/src/extra/libs/bmp/lv_bmp.h index a7dbe27..db1e540 100644 --- a/L3_Middlewares/LVGL/src/libs/bmp/lv_bmp.h +++ b/L3_Middlewares/LVGL/src/extra/libs/bmp/lv_bmp.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" +#include "../../../lv_conf_internal.h" #if LV_USE_BMP /********************* @@ -28,7 +28,6 @@ extern "C" { * GLOBAL PROTOTYPES **********************/ void lv_bmp_init(void); -void lv_bmp_deinit(void); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/libs/ffmpeg/lv_ffmpeg.c b/L3_Middlewares/LVGL/src/extra/libs/ffmpeg/lv_ffmpeg.c similarity index 82% rename from L3_Middlewares/LVGL/src/libs/ffmpeg/lv_ffmpeg.c rename to L3_Middlewares/LVGL/src/extra/libs/ffmpeg/lv_ffmpeg.c index 839ab2a..efaa692 100644 --- a/L3_Middlewares/LVGL/src/libs/ffmpeg/lv_ffmpeg.c +++ b/L3_Middlewares/LVGL/src/extra/libs/ffmpeg/lv_ffmpeg.c @@ -6,10 +6,8 @@ /********************* * INCLUDES *********************/ -#include "lv_ffmpeg_private.h" +#include "lv_ffmpeg.h" #if LV_USE_FFMPEG != 0 -#include "../../draw/lv_image_decoder_private.h" -#include "../../core/lv_obj_class_private.h" #include #include @@ -21,20 +19,21 @@ /********************* * DEFINES *********************/ - -#define DECODER_NAME "FFMPEG" - -#if LV_COLOR_DEPTH == 8 +#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 #define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_RGB8 #elif LV_COLOR_DEPTH == 16 - #define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_RGB565LE + #if LV_COLOR_16_SWAP == 0 + #define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_RGB565LE + #else + #define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_RGB565BE + #endif #elif LV_COLOR_DEPTH == 32 #define AV_PIX_FMT_TRUE_COLOR AV_PIX_FMT_BGR0 #else #error Unsupported LV_COLOR_DEPTH #endif -#define MY_CLASS (&lv_ffmpeg_player_class) +#define MY_CLASS &lv_ffmpeg_player_class #define FRAME_DEF_REFR_PERIOD 33 /*[ms]*/ @@ -49,18 +48,17 @@ struct ffmpeg_context_s { uint8_t * video_dst_data[4]; struct SwsContext * sws_ctx; AVFrame * frame; - AVPacket * pkt; + AVPacket pkt; int video_stream_idx; int video_src_linesize[4]; int video_dst_linesize[4]; enum AVPixelFormat video_dst_pix_fmt; bool has_alpha; - lv_draw_buf_t draw_buf; }; #pragma pack(1) -struct lv_image_pixel_color_s { +struct lv_img_pixel_color_s { lv_color_t c; uint8_t alpha; }; @@ -71,18 +69,18 @@ struct lv_image_pixel_color_s { * STATIC PROTOTYPES **********************/ -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * src, lv_image_header_t * header); -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -static void decoder_close(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc); +static lv_res_t decoder_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header); +static lv_res_t decoder_open(lv_img_decoder_t * dec, lv_img_decoder_dsc_t * dsc); +static void decoder_close(lv_img_decoder_t * dec, lv_img_decoder_dsc_t * dsc); static struct ffmpeg_context_s * ffmpeg_open_file(const char * path); static void ffmpeg_close(struct ffmpeg_context_s * ffmpeg_ctx); static void ffmpeg_close_src_ctx(struct ffmpeg_context_s * ffmpeg_ctx); static void ffmpeg_close_dst_ctx(struct ffmpeg_context_s * ffmpeg_ctx); static int ffmpeg_image_allocate(struct ffmpeg_context_s * ffmpeg_ctx); -static int ffmpeg_get_image_header(const char * path, lv_image_header_t * header); +static int ffmpeg_get_img_header(const char * path, lv_img_header_t * header); static int ffmpeg_get_frame_refr_period(struct ffmpeg_context_s * ffmpeg_ctx); -static uint8_t * ffmpeg_get_image_data(struct ffmpeg_context_s * ffmpeg_ctx); +static uint8_t * ffmpeg_get_img_data(struct ffmpeg_context_s * ffmpeg_ctx); static int ffmpeg_update_next_frame(struct ffmpeg_context_s * ffmpeg_ctx); static int ffmpeg_output_video_frame(struct ffmpeg_context_s * ffmpeg_ctx); static bool ffmpeg_pix_fmt_has_alpha(enum AVPixelFormat pix_fmt); @@ -91,16 +89,18 @@ static bool ffmpeg_pix_fmt_is_yuv(enum AVPixelFormat pix_fmt); static void lv_ffmpeg_player_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); static void lv_ffmpeg_player_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +#if LV_COLOR_DEPTH != 32 + static void convert_color_depth(uint8_t * img, uint32_t px_cnt); +#endif + /********************** * STATIC VARIABLES **********************/ - const lv_obj_class_t lv_ffmpeg_player_class = { .constructor_cb = lv_ffmpeg_player_constructor, .destructor_cb = lv_ffmpeg_player_destructor, .instance_size = sizeof(lv_ffmpeg_player_t), - .base_class = &lv_image_class, - .name = "ffmpeg-player", + .base_class = &lv_img_class }; /********************** @@ -113,12 +113,10 @@ const lv_obj_class_t lv_ffmpeg_player_class = { void lv_ffmpeg_init(void) { - lv_image_decoder_t * dec = lv_image_decoder_create(); - lv_image_decoder_set_info_cb(dec, decoder_info); - lv_image_decoder_set_open_cb(dec, decoder_open); - lv_image_decoder_set_close_cb(dec, decoder_close); - - dec->name = DECODER_NAME; + lv_img_decoder_t * dec = lv_img_decoder_create(); + lv_img_decoder_set_info_cb(dec, decoder_info); + lv_img_decoder_set_open_cb(dec, decoder_open); + lv_img_decoder_set_close_cb(dec, decoder_close); #if LV_FFMPEG_AV_DUMP_FORMAT == 0 av_log_set_level(AV_LOG_QUIET); @@ -145,10 +143,10 @@ lv_obj_t * lv_ffmpeg_player_create(lv_obj_t * parent) return obj; } -lv_result_t lv_ffmpeg_player_set_src(lv_obj_t * obj, const char * path) +lv_res_t lv_ffmpeg_player_set_src(lv_obj_t * obj, const char * path) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_result_t res = LV_RESULT_INVALID; + lv_res_t res = LV_RES_INV; lv_ffmpeg_player_t * player = (lv_ffmpeg_player_t *)obj; @@ -177,20 +175,21 @@ lv_result_t lv_ffmpeg_player_set_src(lv_obj_t * obj, const char * path) int height = player->ffmpeg_ctx->video_dec_ctx->height; uint32_t data_size = 0; - data_size = width * height * 4; - uint8_t * data = ffmpeg_get_image_data(player->ffmpeg_ctx); - lv_color_format_t cf = has_alpha ? LV_COLOR_FORMAT_ARGB8888 : LV_COLOR_FORMAT_NATIVE; - uint32_t stride = width * lv_color_format_get_size(cf); - lv_memzero(data, stride * height); + if(has_alpha) { + data_size = width * height * LV_IMG_PX_SIZE_ALPHA_BYTE; + } + else { + data_size = width * height * LV_COLOR_SIZE / 8; + } + player->imgdsc.header.always_zero = 0; player->imgdsc.header.w = width; player->imgdsc.header.h = height; player->imgdsc.data_size = data_size; - player->imgdsc.header.cf = cf; - player->imgdsc.header.stride = stride; - player->imgdsc.data = data; + player->imgdsc.header.cf = has_alpha ? LV_IMG_CF_TRUE_COLOR_ALPHA : LV_IMG_CF_TRUE_COLOR; + player->imgdsc.data = ffmpeg_get_img_data(player->ffmpeg_ctx); - lv_image_set_src(&player->img.obj, &(player->imgdsc)); + lv_img_set_src(&player->img.obj, &(player->imgdsc)); int period = ffmpeg_get_frame_refr_period(player->ffmpeg_ctx); @@ -203,7 +202,7 @@ lv_result_t lv_ffmpeg_player_set_src(lv_obj_t * obj, const char * path) LV_LOG_WARN("unable to get frame refresh period"); } - res = LV_RESULT_OK; + res = LV_RES_OK; failed: return res; @@ -259,88 +258,95 @@ void lv_ffmpeg_player_set_auto_restart(lv_obj_t * obj, bool en) * STATIC FUNCTIONS **********************/ -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header) +static lv_res_t decoder_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header) { - LV_UNUSED(decoder); - /* Get the source type */ - const void * src = dsc->src; - lv_image_src_t src_type = dsc->src_type; + lv_img_src_t src_type = lv_img_src_get_type(src); - if(src_type == LV_IMAGE_SRC_FILE) { + if(src_type == LV_IMG_SRC_FILE) { const char * fn = src; - if(ffmpeg_get_image_header(fn, header) < 0) { + if(ffmpeg_get_img_header(fn, header) < 0) { LV_LOG_ERROR("ffmpeg can't get image header"); - return LV_RESULT_INVALID; + return LV_RES_INV; } - return LV_RESULT_OK; + return LV_RES_OK; } /* If didn't succeeded earlier then it's an error */ - return LV_RESULT_INVALID; + return LV_RES_INV; } -/** - * Decode an image using ffmpeg library - * @param decoder pointer to the decoder - * @param dsc pointer to the decoder descriptor - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't open the image - */ -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) +static lv_res_t decoder_open(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc) { - LV_UNUSED(decoder); - - if(dsc->src_type == LV_IMAGE_SRC_FILE) { + if(dsc->src_type == LV_IMG_SRC_FILE) { const char * path = dsc->src; struct ffmpeg_context_s * ffmpeg_ctx = ffmpeg_open_file(path); if(ffmpeg_ctx == NULL) { - return LV_RESULT_INVALID; + return LV_RES_INV; } if(ffmpeg_image_allocate(ffmpeg_ctx) < 0) { LV_LOG_ERROR("ffmpeg image allocate failed"); ffmpeg_close(ffmpeg_ctx); - return LV_RESULT_INVALID; + return LV_RES_INV; } if(ffmpeg_update_next_frame(ffmpeg_ctx) < 0) { ffmpeg_close(ffmpeg_ctx); LV_LOG_ERROR("ffmpeg update frame failed"); - return LV_RESULT_INVALID; + return LV_RES_INV; } ffmpeg_close_src_ctx(ffmpeg_ctx); - uint8_t * img_data = ffmpeg_get_image_data(ffmpeg_ctx); + uint8_t * img_data = ffmpeg_get_img_data(ffmpeg_ctx); + +#if LV_COLOR_DEPTH != 32 + if(ffmpeg_ctx->has_alpha) { + convert_color_depth(img_data, dsc->header.w * dsc->header.h); + } +#endif dsc->user_data = ffmpeg_ctx; - lv_draw_buf_t * decoded = &ffmpeg_ctx->draw_buf; - decoded->header = dsc->header; - decoded->header.flags |= LV_IMAGE_FLAGS_MODIFIABLE; - decoded->data = img_data; - decoded->data_size = (uint32_t)dsc->header.stride * dsc->header.h; - decoded->unaligned_data = NULL; - dsc->decoded = decoded; + dsc->img_data = img_data; /* The image is fully decoded. Return with its pointer */ - return LV_RESULT_OK; + return LV_RES_OK; } /* If not returned earlier then it failed */ - return LV_RESULT_INVALID; + return LV_RES_INV; } -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) +static void decoder_close(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc) { - LV_UNUSED(decoder); struct ffmpeg_context_s * ffmpeg_ctx = dsc->user_data; ffmpeg_close(ffmpeg_ctx); } -static uint8_t * ffmpeg_get_image_data(struct ffmpeg_context_s * ffmpeg_ctx) +#if LV_COLOR_DEPTH != 32 + +static void convert_color_depth(uint8_t * img, uint32_t px_cnt) +{ + lv_color32_t * img_src_p = (lv_color32_t *)img; + struct lv_img_pixel_color_s * img_dst_p = (struct lv_img_pixel_color_s *)img; + + for(uint32_t i = 0; i < px_cnt; i++) { + lv_color32_t temp = *img_src_p; + img_dst_p->c = lv_color_hex(temp.full); + img_dst_p->alpha = temp.ch.alpha; + + img_src_p++; + img_dst_p++; + } +} + +#endif + +static uint8_t * ffmpeg_get_img_data(struct ffmpeg_context_s * ffmpeg_ctx) { uint8_t * img_data = ffmpeg_ctx->video_dst_data[0]; @@ -363,7 +369,7 @@ static bool ffmpeg_pix_fmt_has_alpha(enum AVPixelFormat pix_fmt) return true; } - return desc->flags & AV_PIX_FMT_FLAG_ALPHA; + return (desc->flags & AV_PIX_FMT_FLAG_ALPHA) ? true : false; } static bool ffmpeg_pix_fmt_is_yuv(enum AVPixelFormat pix_fmt) @@ -443,7 +449,7 @@ static int ffmpeg_output_video_frame(struct ffmpeg_context_s * ffmpeg_ctx) } if(!ffmpeg_ctx->has_alpha) { - int lv_linesize = lv_color_format_get_size(LV_COLOR_FORMAT_NATIVE) * width; + int lv_linesize = sizeof(lv_color_t) * width; int dst_linesize = ffmpeg_ctx->video_dst_linesize[0]; if(dst_linesize != lv_linesize) { LV_LOG_WARN("ffmpeg linesize = %d, but lvgl image require %d", @@ -518,7 +524,7 @@ static int ffmpeg_open_codec_context(int * stream_idx, int ret; int stream_index; AVStream * st; - const AVCodec * dec = NULL; + AVCodec * dec = NULL; AVDictionary * opts = NULL; ret = av_find_best_stream(fmt_ctx, type, -1, -1, NULL, 0); @@ -568,8 +574,8 @@ static int ffmpeg_open_codec_context(int * stream_idx, return 0; } -static int ffmpeg_get_image_header(const char * filepath, - lv_image_header_t * header) +static int ffmpeg_get_img_header(const char * filepath, + lv_img_header_t * header) { int ret = -1; @@ -597,8 +603,8 @@ static int ffmpeg_get_image_header(const char * filepath, /* allocate image where the decoded image will be put */ header->w = video_dec_ctx->width; header->h = video_dec_ctx->height; - header->cf = has_alpha ? LV_COLOR_FORMAT_ARGB8888 : LV_COLOR_FORMAT_NATIVE; - header->stride = header->w * lv_color_format_get_size(header->cf); + header->always_zero = 0; + header->cf = (has_alpha ? LV_IMG_CF_TRUE_COLOR_ALPHA : LV_IMG_CF_TRUE_COLOR); ret = 0; } @@ -629,19 +635,19 @@ static int ffmpeg_update_next_frame(struct ffmpeg_context_s * ffmpeg_ctx) while(1) { /* read frames from the file */ - if(av_read_frame(ffmpeg_ctx->fmt_ctx, ffmpeg_ctx->pkt) >= 0) { + if(av_read_frame(ffmpeg_ctx->fmt_ctx, &(ffmpeg_ctx->pkt)) >= 0) { bool is_image = false; /* check if the packet belongs to a stream we are interested in, * otherwise skip it */ - if(ffmpeg_ctx->pkt->stream_index == ffmpeg_ctx->video_stream_idx) { + if(ffmpeg_ctx->pkt.stream_index == ffmpeg_ctx->video_stream_idx) { ret = ffmpeg_decode_packet(ffmpeg_ctx->video_dec_ctx, - ffmpeg_ctx->pkt, ffmpeg_ctx); + &(ffmpeg_ctx->pkt), ffmpeg_ctx); is_image = true; } - av_packet_unref(ffmpeg_ctx->pkt); + av_packet_unref(&(ffmpeg_ctx->pkt)); if(ret < 0) { LV_LOG_WARN("video frame is empty %d", ret); @@ -664,7 +670,7 @@ static int ffmpeg_update_next_frame(struct ffmpeg_context_s * ffmpeg_ctx) struct ffmpeg_context_s * ffmpeg_open_file(const char * path) { - if(path == NULL || lv_strlen(path) == 0) { + if(path == NULL || strlen(path) == 0) { LV_LOG_ERROR("file path is empty"); return NULL; } @@ -761,15 +767,10 @@ static int ffmpeg_image_allocate(struct ffmpeg_context_s * ffmpeg_ctx) return -1; } - /* allocate packet, set data to NULL, let the demuxer fill it */ - - ffmpeg_ctx->pkt = av_packet_alloc(); - if(ffmpeg_ctx->pkt == NULL) { - LV_LOG_ERROR("av_packet_alloc failed"); - return -1; - } - ffmpeg_ctx->pkt->data = NULL; - ffmpeg_ctx->pkt->size = 0; + /* initialize packet, set data to NULL, let the demuxer fill it */ + av_init_packet(&ffmpeg_ctx->pkt); + ffmpeg_ctx->pkt.data = NULL; + ffmpeg_ctx->pkt.size = 0; return 0; } @@ -778,7 +779,6 @@ static void ffmpeg_close_src_ctx(struct ffmpeg_context_s * ffmpeg_ctx) { avcodec_free_context(&(ffmpeg_ctx->video_dec_ctx)); avformat_close_input(&(ffmpeg_ctx->fmt_ctx)); - av_packet_free(&ffmpeg_ctx->pkt); av_frame_free(&(ffmpeg_ctx->frame)); if(ffmpeg_ctx->video_src_data[0] != NULL) { av_free(ffmpeg_ctx->video_src_data[0]); @@ -811,7 +811,7 @@ static void ffmpeg_close(struct ffmpeg_context_s * ffmpeg_ctx) static void lv_ffmpeg_player_frame_update_cb(lv_timer_t * timer) { - lv_obj_t * obj = (lv_obj_t *)lv_timer_get_user_data(timer); + lv_obj_t * obj = (lv_obj_t *)timer->user_data; lv_ffmpeg_player_t * player = (lv_ffmpeg_player_t *)obj; if(!player->ffmpeg_ctx) { @@ -825,16 +825,20 @@ static void lv_ffmpeg_player_frame_update_cb(lv_timer_t * timer) return; } - lv_image_cache_drop(lv_image_get_src(obj)); +#if LV_COLOR_DEPTH != 32 + if(player->ffmpeg_ctx->has_alpha) { + convert_color_depth((uint8_t *)(player->imgdsc.data), + player->imgdsc.header.w * player->imgdsc.header.h); + } +#endif + lv_img_cache_invalidate_src(lv_img_get_src(obj)); lv_obj_invalidate(obj); } static void lv_ffmpeg_player_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { - - LV_UNUSED(class_p); LV_TRACE_OBJ_CREATE("begin"); lv_ffmpeg_player_t * player = (lv_ffmpeg_player_t *)obj; @@ -851,18 +855,16 @@ static void lv_ffmpeg_player_constructor(const lv_obj_class_t * class_p, static void lv_ffmpeg_player_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { - LV_UNUSED(class_p); - LV_TRACE_OBJ_CREATE("begin"); lv_ffmpeg_player_t * player = (lv_ffmpeg_player_t *)obj; if(player->timer) { - lv_timer_delete(player->timer); + lv_timer_del(player->timer); player->timer = NULL; } - lv_image_cache_drop(lv_image_get_src(obj)); + lv_img_cache_invalidate_src(lv_img_get_src(obj)); ffmpeg_close(player->ffmpeg_ctx); player->ffmpeg_ctx = NULL; diff --git a/L3_Middlewares/LVGL/src/libs/ffmpeg/lv_ffmpeg.h b/L3_Middlewares/LVGL/src/extra/libs/ffmpeg/lv_ffmpeg.h similarity index 81% rename from L3_Middlewares/LVGL/src/libs/ffmpeg/lv_ffmpeg.h rename to L3_Middlewares/LVGL/src/extra/libs/ffmpeg/lv_ffmpeg.h index 1cb86b9..8c7fc26 100644 --- a/L3_Middlewares/LVGL/src/libs/ffmpeg/lv_ffmpeg.h +++ b/L3_Middlewares/LVGL/src/extra/libs/ffmpeg/lv_ffmpeg.h @@ -12,9 +12,8 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" +#include "../../../lvgl.h" #if LV_USE_FFMPEG != 0 -#include "../../misc/lv_types.h" /********************* * DEFINES @@ -25,14 +24,22 @@ extern "C" { **********************/ struct ffmpeg_context_s; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_ffmpeg_player_class; +extern const lv_obj_class_t lv_ffmpeg_player_class; + +typedef struct { + lv_img_t img; + lv_timer_t * timer; + lv_img_dsc_t imgdsc; + bool auto_restart; + struct ffmpeg_context_s * ffmpeg_ctx; +} lv_ffmpeg_player_t; typedef enum { LV_FFMPEG_PLAYER_CMD_START, LV_FFMPEG_PLAYER_CMD_STOP, LV_FFMPEG_PLAYER_CMD_PAUSE, LV_FFMPEG_PLAYER_CMD_RESUME, - LV_FFMPEG_PLAYER_CMD_LAST + _LV_FFMPEG_PLAYER_CMD_LAST } lv_ffmpeg_player_cmd_t; /********************** @@ -62,9 +69,9 @@ lv_obj_t * lv_ffmpeg_player_create(lv_obj_t * parent); * Set the path of the file to be played * @param obj pointer to a ffmpeg_player object * @param path video file path - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't get the info. + * @return LV_RES_OK: no error; LV_RES_INV: can't get the info. */ -lv_result_t lv_ffmpeg_player_set_src(lv_obj_t * obj, const char * path); +lv_res_t lv_ffmpeg_player_set_src(lv_obj_t * obj, const char * path); /** * Set command control video player diff --git a/L3_Middlewares/LVGL/src/libs/freetype/arial.ttf b/L3_Middlewares/LVGL/src/extra/libs/freetype/arial.ttf similarity index 100% rename from L3_Middlewares/LVGL/src/libs/freetype/arial.ttf rename to L3_Middlewares/LVGL/src/extra/libs/freetype/arial.ttf diff --git a/L3_Middlewares/LVGL/src/extra/libs/freetype/lv_freetype.c b/L3_Middlewares/LVGL/src/extra/libs/freetype/lv_freetype.c new file mode 100644 index 0000000..4bf6602 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/freetype/lv_freetype.c @@ -0,0 +1,687 @@ +/** + * @file lv_freetype.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_freetype.h" +#if LV_USE_FREETYPE + +#include "ft2build.h" +#include FT_FREETYPE_H +#include FT_GLYPH_H +#include FT_CACHE_H +#include FT_SIZES_H +#include FT_IMAGE_H +#include FT_OUTLINE_H + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ +typedef struct { + lv_ll_t face_ll; +} lv_faces_control_t; + +typedef struct name_refer_t { + const char * name; /* point to font name string */ + int32_t cnt; /* reference count */ +} name_refer_t; + +typedef struct { + const void * mem; + const char * name; + size_t mem_size; +#if LV_FREETYPE_CACHE_SIZE < 0 + FT_Size size; +#endif + lv_font_t * font; + uint16_t style; + uint16_t height; +} lv_font_fmt_ft_dsc_t; + +/********************** + * STATIC PROTOTYPES + **********************/ +#if LV_FREETYPE_CACHE_SIZE >= 0 +static FT_Error font_face_requester(FTC_FaceID face_id, + FT_Library library_is, FT_Pointer req_data, FT_Face * aface); +static bool lv_ft_font_init_cache(lv_ft_info_t * info); +static void lv_ft_font_destroy_cache(lv_font_t * font); +#else +static FT_Face face_find_in_list(lv_ft_info_t * info); +static void face_add_to_list(FT_Face face); +static void face_remove_from_list(FT_Face face); +static void face_generic_finalizer(void * object); +static bool lv_ft_font_init_nocache(lv_ft_info_t * info); +static void lv_ft_font_destroy_nocache(lv_font_t * font); +#endif + +static const char * name_refer_save(const char * name); +static void name_refer_del(const char * name); +static const char * name_refer_find(const char * name); + +/********************** +* STATIC VARIABLES +**********************/ +static FT_Library library; +static lv_ll_t names_ll; + +#if LV_FREETYPE_CACHE_SIZE >= 0 + static FTC_Manager cache_manager; + static FTC_CMapCache cmap_cache; + static FT_Face current_face = NULL; + + #if LV_FREETYPE_SBIT_CACHE + static FTC_SBitCache sbit_cache; + static FTC_SBit sbit; + #else + static FTC_ImageCache image_cache; + static FT_Glyph image_glyph; + #endif + +#else + static lv_faces_control_t face_control; +#endif + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +bool lv_freetype_init(uint16_t max_faces, uint16_t max_sizes, uint32_t max_bytes) +{ + FT_Error error = FT_Init_FreeType(&library); + if(error) { + LV_LOG_ERROR("init freeType error(%d)", error); + return false; + } + + _lv_ll_init(&names_ll, sizeof(name_refer_t)); + +#if LV_FREETYPE_CACHE_SIZE >= 0 + error = FTC_Manager_New(library, max_faces, max_sizes, + max_bytes, font_face_requester, NULL, &cache_manager); + if(error) { + FT_Done_FreeType(library); + LV_LOG_ERROR("Failed to open cache manager"); + return false; + } + + error = FTC_CMapCache_New(cache_manager, &cmap_cache); + if(error) { + LV_LOG_ERROR("Failed to open Cmap Cache"); + goto Fail; + } + +#if LV_FREETYPE_SBIT_CACHE + error = FTC_SBitCache_New(cache_manager, &sbit_cache); + if(error) { + LV_LOG_ERROR("Failed to open sbit cache"); + goto Fail; + } +#else + error = FTC_ImageCache_New(cache_manager, &image_cache); + if(error) { + LV_LOG_ERROR("Failed to open image cache"); + goto Fail; + } +#endif + + return true; +Fail: + FTC_Manager_Done(cache_manager); + FT_Done_FreeType(library); + return false; +#else + LV_UNUSED(max_faces); + LV_UNUSED(max_sizes); + LV_UNUSED(max_bytes); + _lv_ll_init(&face_control.face_ll, sizeof(FT_Face *)); + return true; +#endif/* LV_FREETYPE_CACHE_SIZE */ +} + +void lv_freetype_destroy(void) +{ +#if LV_FREETYPE_CACHE_SIZE >= 0 + FTC_Manager_Done(cache_manager); +#endif + FT_Done_FreeType(library); +} + +bool lv_ft_font_init(lv_ft_info_t * info) +{ +#if LV_FREETYPE_CACHE_SIZE >= 0 + return lv_ft_font_init_cache(info); +#else + return lv_ft_font_init_nocache(info); +#endif +} + +void lv_ft_font_destroy(lv_font_t * font) +{ +#if LV_FREETYPE_CACHE_SIZE >= 0 + lv_ft_font_destroy_cache(font); +#else + lv_ft_font_destroy_nocache(font); +#endif +} + +/********************** + * STATIC FUNCTIONS + **********************/ +#if LV_FREETYPE_CACHE_SIZE >= 0 + +static FT_Error font_face_requester(FTC_FaceID face_id, + FT_Library library_is, FT_Pointer req_data, FT_Face * aface) +{ + LV_UNUSED(library_is); + LV_UNUSED(req_data); + + lv_font_fmt_ft_dsc_t * dsc = (lv_font_fmt_ft_dsc_t *)face_id; + FT_Error error; + if(dsc->mem) { + error = FT_New_Memory_Face(library, dsc->mem, dsc->mem_size, 0, aface); + } + else { + error = FT_New_Face(library, dsc->name, 0, aface); + } + if(error) { + LV_LOG_ERROR("FT_New_Face error:%d\n", error); + return error; + } + return FT_Err_Ok; +} + +static bool get_bold_glyph(const lv_font_t * font, FT_Face face, + FT_UInt glyph_index, lv_font_glyph_dsc_t * dsc_out) +{ + if(FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT)) { + return false; + } + + lv_font_fmt_ft_dsc_t * dsc = (lv_font_fmt_ft_dsc_t *)(font->dsc); + if(face->glyph->format == FT_GLYPH_FORMAT_OUTLINE) { + if(dsc->style & FT_FONT_STYLE_BOLD) { + int strength = 1 << 6; + FT_Outline_Embolden(&face->glyph->outline, strength); + } + } + + if(FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL)) { + return false; + } + + dsc_out->adv_w = (face->glyph->metrics.horiAdvance >> 6); + dsc_out->box_h = face->glyph->bitmap.rows; /*Height of the bitmap in [px]*/ + dsc_out->box_w = face->glyph->bitmap.width; /*Width of the bitmap in [px]*/ + dsc_out->ofs_x = face->glyph->bitmap_left; /*X offset of the bitmap in [pf]*/ + dsc_out->ofs_y = face->glyph->bitmap_top - + face->glyph->bitmap.rows; /*Y offset of the bitmap measured from the as line*/ + dsc_out->bpp = 8; /*Bit per pixel: 1/2/4/8*/ + + return true; +} + +static bool get_glyph_dsc_cb_cache(const lv_font_t * font, + lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) +{ + LV_UNUSED(unicode_letter_next); + if(unicode_letter < 0x20) { + dsc_out->adv_w = 0; + dsc_out->box_h = 0; + dsc_out->box_w = 0; + dsc_out->ofs_x = 0; + dsc_out->ofs_y = 0; + dsc_out->bpp = 0; + return true; + } + + lv_font_fmt_ft_dsc_t * dsc = (lv_font_fmt_ft_dsc_t *)(font->dsc); + + FTC_FaceID face_id = (FTC_FaceID)dsc; + FT_Size face_size; + struct FTC_ScalerRec_ scaler; + scaler.face_id = face_id; + scaler.width = dsc->height; + scaler.height = dsc->height; + scaler.pixel = 1; + if(FTC_Manager_LookupSize(cache_manager, &scaler, &face_size) != 0) { + return false; + } + + FT_Face face = face_size->face; + FT_UInt charmap_index = FT_Get_Charmap_Index(face->charmap); + FT_UInt glyph_index = FTC_CMapCache_Lookup(cmap_cache, face_id, charmap_index, unicode_letter); + dsc_out->is_placeholder = glyph_index == 0; + + if(dsc->style & FT_FONT_STYLE_ITALIC) { + FT_Matrix italic_matrix; + italic_matrix.xx = 1 << 16; + italic_matrix.xy = 0x5800; + italic_matrix.yx = 0; + italic_matrix.yy = 1 << 16; + FT_Set_Transform(face, &italic_matrix, NULL); + } + + if(dsc->style & FT_FONT_STYLE_BOLD) { + current_face = face; + if(!get_bold_glyph(font, face, glyph_index, dsc_out)) { + current_face = NULL; + return false; + } + goto end; + } + + FTC_ImageTypeRec desc_type; + desc_type.face_id = face_id; + desc_type.flags = FT_LOAD_RENDER | FT_LOAD_TARGET_NORMAL; + desc_type.height = dsc->height; + desc_type.width = dsc->height; + +#if LV_FREETYPE_SBIT_CACHE + FT_Error error = FTC_SBitCache_Lookup(sbit_cache, &desc_type, glyph_index, &sbit, NULL); + if(error) { + LV_LOG_ERROR("SBitCache_Lookup error"); + return false; + } + + dsc_out->adv_w = sbit->xadvance; + dsc_out->box_h = sbit->height; /*Height of the bitmap in [px]*/ + dsc_out->box_w = sbit->width; /*Width of the bitmap in [px]*/ + dsc_out->ofs_x = sbit->left; /*X offset of the bitmap in [pf]*/ + dsc_out->ofs_y = sbit->top - sbit->height; /*Y offset of the bitmap measured from the as line*/ + dsc_out->bpp = 8; /*Bit per pixel: 1/2/4/8*/ +#else + FT_Error error = FTC_ImageCache_Lookup(image_cache, &desc_type, glyph_index, &image_glyph, NULL); + if(error) { + LV_LOG_ERROR("ImageCache_Lookup error"); + return false; + } + if(image_glyph->format != FT_GLYPH_FORMAT_BITMAP) { + LV_LOG_ERROR("Glyph_To_Bitmap error"); + return false; + } + + FT_BitmapGlyph glyph_bitmap = (FT_BitmapGlyph)image_glyph; + dsc_out->adv_w = (glyph_bitmap->root.advance.x >> 16); + dsc_out->box_h = glyph_bitmap->bitmap.rows; /*Height of the bitmap in [px]*/ + dsc_out->box_w = glyph_bitmap->bitmap.width; /*Width of the bitmap in [px]*/ + dsc_out->ofs_x = glyph_bitmap->left; /*X offset of the bitmap in [pf]*/ + dsc_out->ofs_y = glyph_bitmap->top - + glyph_bitmap->bitmap.rows; /*Y offset of the bitmap measured from the as line*/ + dsc_out->bpp = 8; /*Bit per pixel: 1/2/4/8*/ +#endif + +end: + if((dsc->style & FT_FONT_STYLE_ITALIC) && (unicode_letter_next == '\0')) { + dsc_out->adv_w = dsc_out->box_w + dsc_out->ofs_x; + } + + return true; +} + +static const uint8_t * get_glyph_bitmap_cb_cache(const lv_font_t * font, uint32_t unicode_letter) +{ + LV_UNUSED(unicode_letter); + + lv_font_fmt_ft_dsc_t * dsc = (lv_font_fmt_ft_dsc_t *)(font->dsc); + if(dsc->style & FT_FONT_STYLE_BOLD) { + if(current_face && current_face->glyph->format == FT_GLYPH_FORMAT_BITMAP) { + return (const uint8_t *)(current_face->glyph->bitmap.buffer); + } + return NULL; + } + +#if LV_FREETYPE_SBIT_CACHE + return (const uint8_t *)sbit->buffer; +#else + FT_BitmapGlyph glyph_bitmap = (FT_BitmapGlyph)image_glyph; + return (const uint8_t *)glyph_bitmap->bitmap.buffer; +#endif +} + +static bool lv_ft_font_init_cache(lv_ft_info_t * info) +{ + size_t need_size = sizeof(lv_font_fmt_ft_dsc_t) + sizeof(lv_font_t); + lv_font_fmt_ft_dsc_t * dsc = lv_mem_alloc(need_size); + if(dsc == NULL) return false; + lv_memset_00(dsc, need_size); + + dsc->font = (lv_font_t *)(((char *)dsc) + sizeof(lv_font_fmt_ft_dsc_t)); + dsc->mem = info->mem; + dsc->mem_size = info->mem_size; + dsc->name = name_refer_save(info->name); + dsc->height = info->weight; + dsc->style = info->style; + + /* use to get font info */ + FT_Size face_size; + struct FTC_ScalerRec_ scaler; + scaler.face_id = (FTC_FaceID)dsc; + scaler.width = info->weight; + scaler.height = info->weight; + scaler.pixel = 1; + FT_Error error = FTC_Manager_LookupSize(cache_manager, &scaler, &face_size); + if(error) { + LV_LOG_ERROR("Failed to LookupSize"); + goto Fail; + } + + lv_font_t * font = dsc->font; + font->dsc = dsc; + font->get_glyph_dsc = get_glyph_dsc_cb_cache; + font->get_glyph_bitmap = get_glyph_bitmap_cb_cache; + font->subpx = LV_FONT_SUBPX_NONE; + font->line_height = (face_size->face->size->metrics.height >> 6); + font->base_line = -(face_size->face->size->metrics.descender >> 6); + + FT_Fixed scale = face_size->face->size->metrics.y_scale; + int8_t thickness = FT_MulFix(scale, face_size->face->underline_thickness) >> 6; + font->underline_position = FT_MulFix(scale, face_size->face->underline_position) >> 6; + font->underline_thickness = thickness < 1 ? 1 : thickness; + + /* return to user */ + info->font = font; + + return true; + +Fail: + lv_mem_free(dsc); + return false; +} + +void lv_ft_font_destroy_cache(lv_font_t * font) +{ + if(font == NULL) { + return; + } + + lv_font_fmt_ft_dsc_t * dsc = (lv_font_fmt_ft_dsc_t *)(font->dsc); + if(dsc) { + FTC_Manager_RemoveFaceID(cache_manager, (FTC_FaceID)dsc); + name_refer_del(dsc->name); + lv_mem_free(dsc); + } +} +#else/* LV_FREETYPE_CACHE_SIZE */ + +static FT_Face face_find_in_list(lv_ft_info_t * info) +{ + lv_font_fmt_ft_dsc_t * dsc; + FT_Face * pface = _lv_ll_get_head(&face_control.face_ll); + while(pface) { + dsc = (lv_font_fmt_ft_dsc_t *)(*pface)->generic.data; + if(strcmp(dsc->name, info->name) == 0) { + return *pface; + } + pface = _lv_ll_get_next(&face_control.face_ll, pface); + } + + return NULL; +} + +static void face_add_to_list(FT_Face face) +{ + FT_Face * pface; + pface = (FT_Face *)_lv_ll_ins_tail(&face_control.face_ll); + *pface = face; +} + +static void face_remove_from_list(FT_Face face) +{ + FT_Face * pface = _lv_ll_get_head(&face_control.face_ll); + while(pface) { + if(*pface == face) { + _lv_ll_remove(&face_control.face_ll, pface); + lv_mem_free(pface); + break; + } + pface = _lv_ll_get_next(&face_control.face_ll, pface); + } +} + +static void face_generic_finalizer(void * object) +{ + FT_Face face = (FT_Face)object; + face_remove_from_list(face); + LV_LOG_INFO("face finalizer(%p)\n", face); +} + +static bool get_glyph_dsc_cb_nocache(const lv_font_t * font, + lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) +{ + LV_UNUSED(unicode_letter_next); + if(unicode_letter < 0x20) { + dsc_out->adv_w = 0; + dsc_out->box_h = 0; + dsc_out->box_w = 0; + dsc_out->ofs_x = 0; + dsc_out->ofs_y = 0; + dsc_out->bpp = 0; + return true; + } + + FT_Error error; + lv_font_fmt_ft_dsc_t * dsc = (lv_font_fmt_ft_dsc_t *)(font->dsc); + FT_Face face = dsc->size->face; + + FT_UInt glyph_index = FT_Get_Char_Index(face, unicode_letter); + + if(face->size != dsc->size) { + FT_Activate_Size(dsc->size); + } + dsc_out->is_placeholder = glyph_index == 0; + + error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT); + if(error) { + return false; + } + + if(face->glyph->format == FT_GLYPH_FORMAT_OUTLINE) { + if(dsc->style & FT_FONT_STYLE_BOLD) { + int strength = 1 << 6; + FT_Outline_Embolden(&face->glyph->outline, strength); + } + + if(dsc->style & FT_FONT_STYLE_ITALIC) { + FT_Matrix italic_matrix; + italic_matrix.xx = 1 << 16; + italic_matrix.xy = 0x5800; + italic_matrix.yx = 0; + italic_matrix.yy = 1 << 16; + FT_Outline_Transform(&face->glyph->outline, &italic_matrix); + } + } + + error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL); + if(error) { + return false; + } + + dsc_out->adv_w = (face->glyph->metrics.horiAdvance >> 6); + dsc_out->box_h = face->glyph->bitmap.rows; /*Height of the bitmap in [px]*/ + dsc_out->box_w = face->glyph->bitmap.width; /*Width of the bitmap in [px]*/ + dsc_out->ofs_x = face->glyph->bitmap_left; /*X offset of the bitmap in [pf]*/ + dsc_out->ofs_y = face->glyph->bitmap_top - + face->glyph->bitmap.rows; /*Y offset of the bitmap measured from the as line*/ + dsc_out->bpp = 8; /*Bit per pixel: 1/2/4/8*/ + + if((dsc->style & FT_FONT_STYLE_ITALIC) && (unicode_letter_next == '\0')) { + dsc_out->adv_w = dsc_out->box_w + dsc_out->ofs_x; + } + + return true; +} + +static const uint8_t * get_glyph_bitmap_cb_nocache(const lv_font_t * font, uint32_t unicode_letter) +{ + LV_UNUSED(unicode_letter); + lv_font_fmt_ft_dsc_t * dsc = (lv_font_fmt_ft_dsc_t *)(font->dsc); + FT_Face face = dsc->size->face; + return (const uint8_t *)(face->glyph->bitmap.buffer); +} + +static bool lv_ft_font_init_nocache(lv_ft_info_t * info) +{ + size_t need_size = sizeof(lv_font_fmt_ft_dsc_t) + sizeof(lv_font_t); + lv_font_fmt_ft_dsc_t * dsc = lv_mem_alloc(need_size); + if(dsc == NULL) return false; + lv_memset_00(dsc, need_size); + + dsc->font = (lv_font_t *)(((char *)dsc) + sizeof(lv_font_fmt_ft_dsc_t)); + dsc->mem = info->mem; + dsc->mem_size = info->mem_size; + dsc->name = name_refer_save(info->name); + dsc->height = info->weight; + dsc->style = info->style; + + FT_Face face = face_find_in_list(info); + if(face == NULL) { + FT_Error error; + if(dsc->mem) { + error = FT_New_Memory_Face(library, dsc->mem, (FT_Long) dsc->mem_size, 0, &face); + } + else { + error = FT_New_Face(library, dsc->name, 0, &face); + } + if(error) { + LV_LOG_WARN("create face error(%d)", error); + goto Fail; + } + + /* link face and face info */ + face->generic.data = dsc; + face->generic.finalizer = face_generic_finalizer; + face_add_to_list(face); + } + else { + FT_Size size; + FT_Error error = FT_New_Size(face, &size); + if(error) { + goto Fail; + } + FT_Activate_Size(size); + FT_Reference_Face(face); + } + + FT_Set_Pixel_Sizes(face, 0, info->weight); + dsc->size = face->size; + + lv_font_t * font = dsc->font; + font->dsc = dsc; + font->get_glyph_dsc = get_glyph_dsc_cb_nocache; + font->get_glyph_bitmap = get_glyph_bitmap_cb_nocache; + font->line_height = (face->size->metrics.height >> 6); + font->base_line = -(face->size->metrics.descender >> 6); + font->subpx = LV_FONT_SUBPX_NONE; + + FT_Fixed scale = face->size->metrics.y_scale; + int8_t thickness = FT_MulFix(scale, face->underline_thickness) >> 6; + font->underline_position = FT_MulFix(scale, face->underline_position) >> 6; + font->underline_thickness = thickness < 1 ? 1 : thickness; + + info->font = font; + return true; + +Fail: + lv_mem_free(dsc); + return false; +} + +static void lv_ft_font_destroy_nocache(lv_font_t * font) +{ + if(font == NULL) { + return; + } + + lv_font_fmt_ft_dsc_t * dsc = (lv_font_fmt_ft_dsc_t *)(font->dsc); + if(dsc) { + FT_Face face = dsc->size->face; + FT_Done_Size(dsc->size); + FT_Done_Face(face); + name_refer_del(dsc->name); + lv_mem_free(dsc); + } +} + +#endif/* LV_FREETYPE_CACHE_SIZE */ + +/** + * find name string in names list.name string cnt += 1 if find. + * @param name name string + * @return the string pointer of name. + */ +static const char * name_refer_find(const char * name) +{ + name_refer_t * refer = _lv_ll_get_head(&names_ll); + while(refer) { + if(strcmp(refer->name, name) == 0) { + refer->cnt += 1; + return refer->name; + } + refer = _lv_ll_get_next(&names_ll, refer); + } + return NULL; +} + +/** + * del name string from list. + */ +static void name_refer_del(const char * name) +{ + name_refer_t * refer = _lv_ll_get_head(&names_ll); + while(refer) { + if(strcmp(refer->name, name) == 0) { + refer->cnt -= 1; + if(refer->cnt <= 0) { + _lv_ll_remove(&names_ll, refer); + lv_mem_free((void *)refer->name); + lv_mem_free(refer); + } + return; + } + refer = _lv_ll_get_next(&names_ll, refer); + } + + LV_LOG_WARN("name_in_names_del error(not find:%p).", name); +} + +/** + * save name string to list. + * @param name name string + * @return Saved string pointer + */ +static const char * name_refer_save(const char * name) +{ + const char * pos = name_refer_find(name); + if(pos) { + return pos; + } + + name_refer_t * refer = _lv_ll_ins_tail(&names_ll); + if(refer) { + uint32_t len = strlen(name) + 1; + refer->name = lv_mem_alloc(len); + if(refer->name) { + lv_memcpy((void *)refer->name, name, len); + refer->cnt = 1; + return refer->name; + } + _lv_ll_remove(&names_ll, refer); + lv_mem_free(refer); + } + LV_LOG_WARN("save_name_to_names error(not memory)."); + return ""; +} + +#endif /*LV_USE_FREETYPE*/ diff --git a/L3_Middlewares/LVGL/src/extra/libs/freetype/lv_freetype.h b/L3_Middlewares/LVGL/src/extra/libs/freetype/lv_freetype.h new file mode 100644 index 0000000..247a7fb --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/freetype/lv_freetype.h @@ -0,0 +1,83 @@ +/** + * @file lv_freetype.h + * + */ +#ifndef LV_FREETYPE_H +#define LV_FREETYPE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" +#if LV_USE_FREETYPE + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ +typedef enum { + FT_FONT_STYLE_NORMAL = 0, + FT_FONT_STYLE_ITALIC = 1 << 0, + FT_FONT_STYLE_BOLD = 1 << 1 +} LV_FT_FONT_STYLE; + +typedef struct { + const char * name; /* The name of the font file */ + const void * mem; /* The pointer of the font file */ + size_t mem_size; /* The size of the memory */ + lv_font_t * font; /* point to lvgl font */ + uint16_t weight; /* font size */ + uint16_t style; /* font style */ +} lv_ft_info_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * init freetype library + * @param max_faces Maximum number of opened FT_Face objects managed by this cache instance. Use 0 for defaults. + * @param max_sizes Maximum number of opened FT_Size objects managed by this cache instance. Use 0 for defaults. + * @param max_bytes Maximum number of bytes to use for cached data nodes. Use 0 for defaults. + * Note that this value does not account for managed FT_Face and FT_Size objects. + * @return true on success, otherwise false. + */ +bool lv_freetype_init(uint16_t max_faces, uint16_t max_sizes, uint32_t max_bytes); + +/** + * Destroy freetype library + */ +void lv_freetype_destroy(void); + +/** + * Creates a font with info parameter specified. + * @param info See lv_ft_info_t for details. + * when success, lv_ft_info_t->font point to the font you created. + * @return true on success, otherwise false. + */ +bool lv_ft_font_init(lv_ft_info_t * info); + +/** + * Destroy a font that has been created. + * @param font pointer to font. + */ +void lv_ft_font_destroy(lv_font_t * font); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_FREETYPE*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* LV_FREETYPE_H */ diff --git a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_fatfs.c b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_fatfs.c similarity index 62% rename from L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_fatfs.c rename to L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_fatfs.c index 79c62a3..cc1d2e6 100644 --- a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_fatfs.c +++ b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_fatfs.c @@ -11,26 +11,12 @@ #if LV_USE_FS_FATFS #include "ff.h" -#include "../../core/lv_global.h" /********************* * DEFINES *********************/ -#ifdef ESP_PLATFORM - #define DIR FF_DIR /* ESP IDF typedefs `DIR` as `FF_DIR` in its version of ff.h. Use `FF_DIR` in LVGL too */ -#endif - #if LV_FS_FATFS_LETTER == '\0' - #error "LV_FS_FATFS_LETTER must be set to a valid value" -#else - #if (LV_FS_FATFS_LETTER < 'A') || (LV_FS_FATFS_LETTER > 'Z') - #if LV_FS_DEFAULT_DRIVE_LETTER != '\0' /*When using default drive letter, strict format (X:) is mandatory*/ - #error "LV_FS_FATFS_LETTER must be an upper case ASCII letter" - #else /*Lean rules for backward compatibility*/ - #warning LV_FS_FATFS_LETTER should be an upper case ASCII letter. \ - Using a slash symbol as drive letter should be replaced with LV_FS_DEFAULT_DRIVE_LETTER mechanism - #endif - #endif + #error "LV_FS_FATFS_LETTER must be an upper case ASCII letter" #endif /********************** @@ -49,7 +35,7 @@ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); static void * fs_dir_open(lv_fs_drv_t * drv, const char * path); -static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint32_t fn_len); +static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn); static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p); /********************** @@ -75,25 +61,26 @@ void lv_fs_fatfs_init(void) * Register the file system interface in LVGL *--------------------------------------------------*/ - lv_fs_drv_t * fs_drv_p = &(LV_GLOBAL_DEFAULT()->fatfs_fs_drv); - lv_fs_drv_init(fs_drv_p); + /*Add a simple drive to open images*/ + static lv_fs_drv_t fs_drv; /*A driver descriptor*/ + lv_fs_drv_init(&fs_drv); /*Set up fields...*/ - fs_drv_p->letter = LV_FS_FATFS_LETTER; - fs_drv_p->cache_size = LV_FS_FATFS_CACHE_SIZE; + fs_drv.letter = LV_FS_FATFS_LETTER; + fs_drv.cache_size = LV_FS_FATFS_CACHE_SIZE; - fs_drv_p->open_cb = fs_open; - fs_drv_p->close_cb = fs_close; - fs_drv_p->read_cb = fs_read; - fs_drv_p->write_cb = fs_write; - fs_drv_p->seek_cb = fs_seek; - fs_drv_p->tell_cb = fs_tell; + fs_drv.open_cb = fs_open; + fs_drv.close_cb = fs_close; + fs_drv.read_cb = fs_read; + fs_drv.write_cb = fs_write; + fs_drv.seek_cb = fs_seek; + fs_drv.tell_cb = fs_tell; - fs_drv_p->dir_close_cb = fs_dir_close; - fs_drv_p->dir_open_cb = fs_dir_open; - fs_drv_p->dir_read_cb = fs_dir_read; + fs_drv.dir_close_cb = fs_dir_close; + fs_drv.dir_open_cb = fs_dir_open; + fs_drv.dir_read_cb = fs_dir_read; - lv_fs_drv_register(fs_drv_p); + lv_fs_drv_register(&fs_drv); } /********************** @@ -109,9 +96,9 @@ static void fs_init(void) /** * Open a file - * @param drv pointer to a driver where this function belongs - * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) - * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR + * @param drv pointer to a driver where this function belongs + * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) + * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR * @return pointer to FIL struct or NULL in case of fail */ static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) @@ -123,7 +110,7 @@ static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) else if(mode == LV_FS_MODE_RD) flags = FA_READ; else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD)) flags = FA_READ | FA_WRITE | FA_OPEN_ALWAYS; - FIL * f = lv_malloc(sizeof(FIL)); + FIL * f = lv_mem_alloc(sizeof(FIL)); if(f == NULL) return NULL; FRESULT res = f_open(f, path, flags); @@ -131,15 +118,15 @@ static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) return f; } else { - lv_free(f); + lv_mem_free(f); return NULL; } } /** * Close an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FIL variable. (opened with fs_open) + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FIL variable. (opened with fs_open) * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ @@ -147,17 +134,17 @@ static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p) { LV_UNUSED(drv); f_close(file_p); - lv_free(file_p); + lv_mem_free(file_p); return LV_FS_RES_OK; } /** * Read data from an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FIL variable. - * @param buf pointer to a memory block where to store the read data - * @param btr number of Bytes To Read - * @param br the real number of read bytes (Byte Read) + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FIL variable. + * @param buf pointer to a memory block where to store the read data + * @param btr number of Bytes To Read + * @param br the real number of read bytes (Byte Read) * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ @@ -171,11 +158,11 @@ static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_ /** * Write into a file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FIL variable - * @param buf pointer to a buffer with the bytes to write - * @param btw Bytes To Write - * @param bw the number of real written bytes (Bytes Written). NULL if unused. + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FIL variable + * @param buf pointer to a buffer with the bytes to write + * @param btw Bytes To Write + * @param bw the number of real written bytes (Bytes Written). NULL if unused. * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw) @@ -188,10 +175,10 @@ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, /** * Set the read write pointer. Also expand the file size if necessary. - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FIL variable. (opened with fs_open ) - * @param pos the new position of read write pointer - * @param whence only LV_SEEK_SET is supported + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FIL variable. (opened with fs_open ) + * @param pos the new position of read write pointer + * @param whence only LV_SEEK_SET is supported * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ @@ -216,9 +203,9 @@ static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs /** * Give the position of the read write pointer - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FIL variable - * @param pos_p pointer to store the result + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FIL variable. + * @param pos_p pointer to to store the result * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ @@ -231,19 +218,19 @@ static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) /** * Initialize a 'DIR' variable for directory reading - * @param drv pointer to a driver where this function belongs - * @param path path to a directory + * @param drv pointer to a driver where this function belongs + * @param path path to a directory * @return pointer to an initialized 'DIR' variable */ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) { LV_UNUSED(drv); - DIR * d = lv_malloc(sizeof(DIR)); + DIR * d = lv_mem_alloc(sizeof(DIR)); if(d == NULL) return NULL; FRESULT res = f_opendir(d, path); if(res != FR_OK) { - lv_free(d); + lv_mem_free(d); d = NULL; } return d; @@ -252,17 +239,14 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) /** * Read the next filename from a directory. * The name of the directories will begin with '/' - * @param drv pointer to a driver where this function belongs - * @param dir_p pointer to an initialized 'DIR' variable - * @param fn pointer to a buffer to store the filename - * @param fn_len length of the buffer to store the filename + * @param drv pointer to a driver where this function belongs + * @param dir_p pointer to an initialized 'DIR' variable + * @param fn pointer to a buffer to store the filename * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ -static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint32_t fn_len) +static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn) { LV_UNUSED(drv); - if(fn_len == 0) return LV_FS_RES_INV_PARAM; - FRESULT res; FILINFO fno; fn[0] = '\0'; @@ -271,21 +255,20 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint3 res = f_readdir(dir_p, &fno); if(res != FR_OK) return LV_FS_RES_UNKNOWN; - if(fno.fname[0] == 0) break; /* End of the directory */ - if(fno.fattrib & AM_DIR) { - lv_snprintf(fn, fn_len, "/%s", fno.fname); + fn[0] = '/'; + strcpy(&fn[1], fno.fname); } - else lv_strlcpy(fn, fno.fname, fn_len); + else strcpy(fn, fno.fname); - } while(lv_strcmp(fn, "/.") == 0 || lv_strcmp(fn, "/..") == 0); + } while(strcmp(fn, "/.") == 0 || strcmp(fn, "/..") == 0); return LV_FS_RES_OK; } /** * Close the directory reading - * @param drv pointer to a driver where this function belongs + * @param drv pointer to a driver where this function belongs * @param dir_p pointer to an initialized 'DIR' variable * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ @@ -293,7 +276,7 @@ static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p) { LV_UNUSED(drv); f_closedir(dir_p); - lv_free(dir_p); + lv_mem_free(dir_p); return LV_FS_RES_OK; } @@ -303,4 +286,5 @@ static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p) #warning "LV_USE_FS_FATFS is not enabled but LV_FS_FATFS_LETTER is set" #endif -#endif /*LV_USE_FS_FATFS*/ +#endif /*LV_USE_FS_POSIX*/ + diff --git a/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_littlefs.c b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_littlefs.c new file mode 100644 index 0000000..44261c3 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_littlefs.c @@ -0,0 +1,332 @@ +/** + * @file lv_fs_littlefs.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" + +#if LV_USE_FS_LITTLEFS +#include "lfs.h" + +/********************* + * DEFINES + *********************/ + +#if LV_FS_LITTLEFS_LETTER == '\0' + #error "LV_FS_LITTLEFS_LETTER must be an upper case ASCII letter" +#endif + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +static void fs_init(void); + +static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode); +static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p); + +static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br); +static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw); + +static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); +static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); + +static void * fs_dir_open(lv_fs_drv_t * drv, const char * path); +static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn); +static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_fs_littlefs_init(void) +{ + /*---------------------------------------------------- + * Initialize your storage device and File System + * -------------------------------------------------*/ + fs_init(); + + /*--------------------------------------------------- + * Register the file system interface in LVGL + *--------------------------------------------------*/ + + /*Add a simple drive to open images*/ + static lv_fs_drv_t fs_drv; /*A driver descriptor*/ + lv_fs_drv_init(&fs_drv); + + /*Set up fields...*/ + fs_drv.letter = LV_FS_LITTLEFS_LETTER; + fs_drv.cache_size = LV_FS_LITTLEFS_CACHE_SIZE; + + fs_drv.open_cb = fs_open; + fs_drv.close_cb = fs_close; + fs_drv.read_cb = fs_read; + fs_drv.write_cb = fs_write; + fs_drv.seek_cb = fs_seek; + fs_drv.tell_cb = fs_tell; + + fs_drv.dir_open_cb = fs_dir_open; + fs_drv.dir_close_cb = fs_dir_close; + fs_drv.dir_read_cb = fs_dir_read; + + /*#if LV_USE_USER_DATA*/ + fs_drv.user_data = NULL; + /*#endif*/ + + lv_fs_drv_register(&fs_drv); +} + +/** + * Convenience function to attach registered driver to lfs_t structure by driver-label + * @param label the label assigned to the driver when it was registered + * @param lfs_p the pointer to the lfs_t structure initialized by external code/library + * @return pointer to a driver descriptor or NULL on error + */ +lv_fs_drv_t * lv_fs_littlefs_set_driver(char label, void * lfs_p) +{ + lv_fs_drv_t * drv_p = lv_fs_get_drv(label); + if(drv_p != NULL) drv_p->user_data = (lfs_t *) lfs_p; + return drv_p; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +/*Initialize your Storage device and File system.*/ +static void fs_init(void) +{ + /* Initialize the internal flash or SD-card and LittleFS itself. + * Better to do it in your code to keep this library untouched for easy updating */ +} + +/** + * Open a file + * @param drv pointer to a driver where this function belongs + * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) + * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR + * @return pointer to a file descriptor or NULL on error + */ +static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) +{ + lfs_t * lfs_p = drv->user_data; + uint32_t flags = 0; + + flags = mode == LV_FS_MODE_RD ? LFS_O_RDONLY + : mode == LV_FS_MODE_WR ? LFS_O_WRONLY + : mode == (LV_FS_MODE_WR | LV_FS_MODE_RD) ? LFS_O_RDWR : 0; + + lfs_file_t * file_p = lv_mem_alloc(sizeof(lfs_file_t)); + if(file_p == NULL) return NULL; + + int result = lfs_file_open(lfs_p, file_p, path, flags); + + if(result != LFS_ERR_OK) { + lv_mem_free(file_p); + return NULL; + } + + return file_p; +} + +/** + * Close an opened file + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a file_t variable. (opened with fs_open) + * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum + */ +static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p) +{ + lfs_t * lfs_p = drv->user_data; + + int result = lfs_file_close(lfs_p, file_p); + lv_mem_free(file_p); + /*lv_mem_free( lfs_p );*/ /*allocated and freed by outside-code*/ + + if(result != LFS_ERR_OK) return LV_FS_RES_UNKNOWN; + return LV_FS_RES_OK; +} + +/** + * Read data from an opened file + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a file_t variable. + * @param buf pointer to a memory block where to store the read data + * @param btr number of Bytes To Read + * @param br the real number of read bytes (Byte Read) + * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum + */ +static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br) +{ + lfs_t * lfs_p = drv->user_data; + + lfs_ssize_t result = lfs_file_read(lfs_p, file_p, buf, btr); + if(result < 0) return LV_FS_RES_UNKNOWN; + + *br = (uint32_t) result; + return LV_FS_RES_OK; +} + +/** + * Write into a file + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a file_t variable + * @param buf pointer to a buffer with the bytes to write + * @param btw Bytes To Write + * @param bw the number of real written bytes (Bytes Written). NULL if unused. + * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum + */ +static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw) +{ +#ifndef LFS_READONLY + lfs_t * lfs_p = drv->user_data; + + lfs_ssize_t result = lfs_file_write(lfs_p, file_p, buf, btw); + if(result < 0 || lfs_file_sync(lfs_p, file_p) < 0) return LV_FS_RES_UNKNOWN; + + *bw = (uint32_t) result; + return LV_FS_RES_OK; +#else + return LV_FS_RES_NOT_IMP; +#endif +} + +/** + * Set the read write pointer. Also expand the file size if necessary. + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a file_t variable. (opened with fs_open ) + * @param pos the new position of read write pointer + * @param whence tells from where to interpret the `pos`. See @lv_fs_whence_t + * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum + */ +static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence) +{ + lfs_t * lfs_p = drv->user_data; + + int lfs_whence = whence == LV_FS_SEEK_SET ? LFS_SEEK_SET + : whence == LV_FS_SEEK_CUR ? LFS_SEEK_CUR + : whence == LV_FS_SEEK_END ? LFS_SEEK_END : 0; + + lfs_soff_t result = lfs_file_seek(lfs_p, file_p, pos, lfs_whence); + if(result < 0) return LV_FS_RES_UNKNOWN; + + /*pos = result;*/ /*not supported by lv_fs*/ + return LV_FS_RES_OK; +} + +/** + * Give the position of the read write pointer + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a file_t variable. + * @param pos_p pointer to where to store the result + * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum + */ +static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) +{ + lfs_t * lfs_p = drv->user_data; + + lfs_soff_t result = lfs_file_tell(lfs_p, file_p); + if(result < 0) return LV_FS_RES_UNKNOWN; + + *pos_p = (uint32_t) result; + return LV_FS_RES_OK; +} + +/** + * Initialize a 'lv_fs_dir_t' variable for directory reading + * @param drv pointer to a driver where this function belongs + * @param path path to a directory + * @return pointer to the directory read descriptor or NULL on error + */ +static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) +{ + lfs_t * lfs_p = drv->user_data; + + lfs_dir_t * dir_p = lv_mem_alloc(sizeof(lfs_dir_t)); + if(dir_p == NULL) return NULL; + + int result = lfs_dir_open(lfs_p, dir_p, path); + if(result != LFS_ERR_OK) { + lv_mem_free(dir_p); + return NULL; + } + + return dir_p; +} + +/** + * Read the next filename form a directory. + * The name of the directories will begin with '/' + * @param drv pointer to a driver where this function belongs + * @param rddir_p pointer to an initialized 'lv_fs_dir_t' variable + * @param fn pointer to a buffer to store the filename + * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum + */ +static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * rddir_p, char * fn) +{ + lfs_t * lfs_p = drv->user_data; + struct lfs_info info; + int result; + + info.name[0] = '\0'; + + do { + result = lfs_dir_read(lfs_p, rddir_p, &info); + if(result > 0) { + if(info.type == LFS_TYPE_DIR) { + fn[0] = '/'; + strcpy(&fn[1], info.name); + } + else strcpy(fn, info.name); + } + else if(result == 0) fn[0] = '\0'; /*dir-scan ended*/ + else return LV_FS_RES_UNKNOWN; + + } while(!strcmp(fn, "/.") || !strcmp(fn, "/..")); + + return LV_FS_RES_OK; +} + +/** + * Close the directory reading + * @param drv pointer to a driver where this function belongs + * @param rddir_p pointer to an initialized 'lv_fs_dir_t' variable + * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum + */ +static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * rddir_p) +{ + lfs_t * lfs_p = drv->user_data; + + int result = lfs_dir_close(lfs_p, rddir_p); + lv_mem_free(rddir_p); + + if(result != LFS_ERR_OK) return LV_FS_RES_UNKNOWN; + return LV_FS_RES_OK; +} + +#else /*LV_USE_FS_LITTLEFS == 0*/ + +#if defined(LV_FS_LITTLEFS_LETTER) && LV_FS_LITTLEFS_LETTER != '\0' + #warning "LV_USE_FS_LITTLEFS is not enabled but LV_FS_LITTLEFS_LETTER is set" +#endif + +#endif /*LV_USE_FS_POSIX*/ diff --git a/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_posix.c b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_posix.c new file mode 100644 index 0000000..e656288 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_posix.c @@ -0,0 +1,319 @@ +/** + * @file lv_fs_posix.c + * + */ + + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" + +#if LV_USE_FS_POSIX + +#include +#include +#ifndef WIN32 + #include + #include +#else + #include +#endif + +/********************* + * DEFINES + *********************/ + +#if LV_FS_POSIX_LETTER == '\0' + #error "LV_FS_POSIX_LETTER must be an upper case ASCII letter" +#endif + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode); +static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p); +static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br); +static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw); +static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); +static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); +static void * fs_dir_open(lv_fs_drv_t * drv, const char * path); +static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn); +static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Register a driver for the File system interface + */ +void lv_fs_posix_init(void) +{ + /*--------------------------------------------------- + * Register the file system interface in LVGL + *--------------------------------------------------*/ + + /*Add a simple drive to open images*/ + static lv_fs_drv_t fs_drv; /*A driver descriptor*/ + lv_fs_drv_init(&fs_drv); + + /*Set up fields...*/ + fs_drv.letter = LV_FS_POSIX_LETTER; + fs_drv.cache_size = LV_FS_POSIX_CACHE_SIZE; + + fs_drv.open_cb = fs_open; + fs_drv.close_cb = fs_close; + fs_drv.read_cb = fs_read; + fs_drv.write_cb = fs_write; + fs_drv.seek_cb = fs_seek; + fs_drv.tell_cb = fs_tell; + + fs_drv.dir_close_cb = fs_dir_close; + fs_drv.dir_open_cb = fs_dir_open; + fs_drv.dir_read_cb = fs_dir_read; + + lv_fs_drv_register(&fs_drv); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +/** + * Open a file + * @param drv pointer to a driver where this function belongs + * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) + * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR + * @return a file handle or -1 in case of fail + */ +static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) +{ + LV_UNUSED(drv); + + uint32_t flags = 0; + if(mode == LV_FS_MODE_WR) flags = O_WRONLY | O_CREAT; + else if(mode == LV_FS_MODE_RD) flags = O_RDONLY; + else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD)) flags = O_RDWR | O_CREAT; + + /*Make the path relative to the current directory (the projects root folder)*/ + char buf[256]; + lv_snprintf(buf, sizeof(buf), LV_FS_POSIX_PATH "%s", path); + + int f = open(buf, flags, 0666); + if(f < 0) return NULL; + + return (void *)(lv_uintptr_t)f; +} + +/** + * Close an opened file + * @param drv pointer to a driver where this function belongs + * @param file_p a file handle. (opened with fs_open) + * @return LV_FS_RES_OK: no error, the file is read + * any error from lv_fs_res_t enum + */ +static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p) +{ + LV_UNUSED(drv); + close((lv_uintptr_t)file_p); + return LV_FS_RES_OK; +} + +/** + * Read data from an opened file + * @param drv pointer to a driver where this function belongs + * @param file_p a file handle variable. + * @param buf pointer to a memory block where to store the read data + * @param btr number of Bytes To Read + * @param br the real number of read bytes (Byte Read) + * @return LV_FS_RES_OK: no error, the file is read + * any error from lv_fs_res_t enum + */ +static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br) +{ + LV_UNUSED(drv); + *br = read((lv_uintptr_t)file_p, buf, btr); + return (int32_t)(*br) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; +} + +/** + * Write into a file + * @param drv pointer to a driver where this function belongs + * @param file_p a file handle variable + * @param buf pointer to a buffer with the bytes to write + * @param btw Bytes To Write + * @param bw the number of real written bytes (Bytes Written). NULL if unused. + * @return LV_FS_RES_OK or any error from lv_fs_res_t enum + */ +static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw) +{ + LV_UNUSED(drv); + *bw = write((lv_uintptr_t)file_p, buf, btw); + return (int32_t)(*bw) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; +} + +/** + * Set the read write pointer. Also expand the file size if necessary. + * @param drv pointer to a driver where this function belongs + * @param file_p a file handle variable. (opened with fs_open ) + * @param pos the new position of read write pointer + * @return LV_FS_RES_OK: no error, the file is read + * any error from lv_fs_res_t enum + */ +static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence) +{ + LV_UNUSED(drv); + off_t offset = lseek((lv_uintptr_t)file_p, pos, whence); + return offset < 0 ? LV_FS_RES_FS_ERR : LV_FS_RES_OK; +} + +/** + * Give the position of the read write pointer + * @param drv pointer to a driver where this function belongs + * @param file_p a file handle variable. + * @param pos_p pointer to to store the result + * @return LV_FS_RES_OK: no error, the file is read + * any error from lv_fs_res_t enum + */ +static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) +{ + LV_UNUSED(drv); + off_t offset = lseek((lv_uintptr_t)file_p, 0, SEEK_CUR); + *pos_p = offset; + return offset < 0 ? LV_FS_RES_FS_ERR : LV_FS_RES_OK; +} + +#ifdef WIN32 + static char next_fn[256]; +#endif + +/** + * Initialize a 'fs_read_dir_t' variable for directory reading + * @param drv pointer to a driver where this function belongs + * @param path path to a directory + * @return pointer to an initialized 'DIR' or 'HANDLE' variable + */ +static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) +{ + LV_UNUSED(drv); + +#ifndef WIN32 + /*Make the path relative to the current directory (the projects root folder)*/ + char buf[256]; + lv_snprintf(buf, sizeof(buf), LV_FS_POSIX_PATH "%s", path); + return opendir(buf); +#else + HANDLE d = INVALID_HANDLE_VALUE; + WIN32_FIND_DATA fdata; + + /*Make the path relative to the current directory (the projects root folder)*/ + char buf[256]; + lv_snprintf(buf, sizeof(buf), LV_FS_POSIX_PATH "%s\\*", path); + + strcpy(next_fn, ""); + d = FindFirstFile(buf, &fdata); + do { + if(strcmp(fdata.cFileName, ".") == 0 || strcmp(fdata.cFileName, "..") == 0) { + continue; + } + else { + if(fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + sprintf(next_fn, "/%s", fdata.cFileName); + } + else { + sprintf(next_fn, "%s", fdata.cFileName); + } + break; + } + } while(FindNextFileA(d, &fdata)); + + return d; +#endif +} + +/** + * Read the next filename from a directory. + * The name of the directories will begin with '/' + * @param drv pointer to a driver where this function belongs + * @param dir_p pointer to an initialized 'DIR' or 'HANDLE' variable + * @param fn pointer to a buffer to store the filename + * @return LV_FS_RES_OK or any error from lv_fs_res_t enum + */ +static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn) +{ + LV_UNUSED(drv); + +#ifndef WIN32 + struct dirent * entry; + do { + entry = readdir(dir_p); + if(entry) { + if(entry->d_type == DT_DIR) sprintf(fn, "/%s", entry->d_name); + else strcpy(fn, entry->d_name); + } + else { + strcpy(fn, ""); + } + } while(strcmp(fn, "/.") == 0 || strcmp(fn, "/..") == 0); +#else + strcpy(fn, next_fn); + + strcpy(next_fn, ""); + WIN32_FIND_DATA fdata; + + if(FindNextFile(dir_p, &fdata) == false) return LV_FS_RES_OK; + do { + if(strcmp(fdata.cFileName, ".") == 0 || strcmp(fdata.cFileName, "..") == 0) { + continue; + } + else { + if(fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + sprintf(next_fn, "/%s", fdata.cFileName); + } + else { + sprintf(next_fn, "%s", fdata.cFileName); + } + break; + } + } while(FindNextFile(dir_p, &fdata)); + +#endif + return LV_FS_RES_OK; +} + +/** + * Close the directory reading + * @param drv pointer to a driver where this function belongs + * @param dir_p pointer to an initialized 'DIR' or 'HANDLE' variable + * @return LV_FS_RES_OK or any error from lv_fs_res_t enum + */ +static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p) +{ + LV_UNUSED(drv); +#ifndef WIN32 + closedir(dir_p); +#else + FindClose(dir_p); +#endif + return LV_FS_RES_OK; +} +#else /*LV_USE_FS_POSIX == 0*/ + +#if defined(LV_FS_POSIX_LETTER) && LV_FS_POSIX_LETTER != '\0' + #warning "LV_USE_FS_POSIX is not enabled but LV_FS_POSIX_LETTER is set" +#endif + +#endif /*LV_USE_FS_POSIX*/ diff --git a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_stdio.c b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_stdio.c similarity index 62% rename from L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_stdio.c rename to L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_stdio.c index a6c901e..c2de688 100644 --- a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_stdio.c +++ b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_stdio.c @@ -3,6 +3,7 @@ * */ + /********************* * INCLUDES *********************/ @@ -17,30 +18,16 @@ #include #endif -#include "../../core/lv_global.h" /********************* * DEFINES *********************/ -#if LV_FS_STDIO_LETTER == '\0' - #error "LV_FS_STDIO_LETTER must be set to a valid value" -#else - #if (LV_FS_STDIO_LETTER < 'A') || (LV_FS_STDIO_LETTER > 'Z') - #if LV_FS_DEFAULT_DRIVE_LETTER != '\0' /*When using default drive letter, strict format (X:) is mandatory*/ - #error "LV_FS_STDIO_LETTER must be an upper case ASCII letter" - #else /*Lean rules for backward compatibility*/ - #warning LV_FS_STDIO_LETTER should be an upper case ASCII letter. \ - Using a slash symbol as drive letter should be replaced with LV_FS_DEFAULT_DRIVE_LETTER mechanism - #endif - #endif -#endif - #define MAX_PATH_LEN 256 /********************** * TYPEDEFS **********************/ typedef struct { -#ifdef _WIN32 +#ifdef WIN32 HANDLE dir_p; char next_fn[MAX_PATH_LEN]; #else @@ -58,7 +45,7 @@ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); static void * fs_dir_open(lv_fs_drv_t * drv, const char * path); -static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint32_t fn_len); +static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn); static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p); /********************** @@ -82,25 +69,26 @@ void lv_fs_stdio_init(void) * Register the file system interface in LVGL *--------------------------------------------------*/ - lv_fs_drv_t * fs_drv_p = &(LV_GLOBAL_DEFAULT()->stdio_fs_drv); - lv_fs_drv_init(fs_drv_p); + /*Add a simple drive to open images*/ + static lv_fs_drv_t fs_drv; /*A driver descriptor*/ + lv_fs_drv_init(&fs_drv); /*Set up fields...*/ - fs_drv_p->letter = LV_FS_STDIO_LETTER; - fs_drv_p->cache_size = LV_FS_STDIO_CACHE_SIZE; + fs_drv.letter = LV_FS_STDIO_LETTER; + fs_drv.cache_size = LV_FS_STDIO_CACHE_SIZE; - fs_drv_p->open_cb = fs_open; - fs_drv_p->close_cb = fs_close; - fs_drv_p->read_cb = fs_read; - fs_drv_p->write_cb = fs_write; - fs_drv_p->seek_cb = fs_seek; - fs_drv_p->tell_cb = fs_tell; + fs_drv.open_cb = fs_open; + fs_drv.close_cb = fs_close; + fs_drv.read_cb = fs_read; + fs_drv.write_cb = fs_write; + fs_drv.seek_cb = fs_seek; + fs_drv.tell_cb = fs_tell; - fs_drv_p->dir_close_cb = fs_dir_close; - fs_drv_p->dir_open_cb = fs_dir_open; - fs_drv_p->dir_read_cb = fs_dir_read; + fs_drv.dir_close_cb = fs_dir_close; + fs_drv.dir_open_cb = fs_dir_open; + fs_drv.dir_read_cb = fs_dir_read; - lv_fs_drv_register(fs_drv_p); + lv_fs_drv_register(&fs_drv); } /********************** @@ -109,9 +97,9 @@ void lv_fs_stdio_init(void) /** * Open a file - * @param drv pointer to a driver where this function belongs - * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) - * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR + * @param drv pointer to a driver where this function belongs + * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) + * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR * @return pointer to FIL struct or NULL in case of fail */ static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) @@ -134,8 +122,8 @@ static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) /** * Close an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable. (opened with fs_open) + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FILE variable. (opened with fs_open) * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ @@ -148,11 +136,11 @@ static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p) /** * Read data from an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable. - * @param buf pointer to a memory block where to store the read data - * @param btr number of Bytes To Read - * @param br the real number of read bytes (Byte Read) + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FILE variable. + * @param buf pointer to a memory block where to store the read data + * @param btr number of Bytes To Read + * @param br the real number of read bytes (Byte Read) * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ @@ -165,11 +153,11 @@ static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_ /** * Write into a file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable - * @param buf pointer to a buffer with the bytes to write - * @param btw Bytes To Write - * @param bw the number of real written bytes (Bytes Written). NULL if unused. + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FILE variable + * @param buf pointer to a buffer with the bytes to write + * @param btw Bytes To Write + * @param bw the number of real written bytes (Bytes Written). NULL if unused. * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw) @@ -181,39 +169,24 @@ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, /** * Set the read write pointer. Also expand the file size if necessary. - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable. (opened with fs_open ) - * @param pos the new position of read write pointer + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FILE variable. (opened with fs_open ) + * @param pos the new position of read write pointer * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence) { LV_UNUSED(drv); - int w; - switch(whence) { - case LV_FS_SEEK_SET: - w = SEEK_SET; - break; - case LV_FS_SEEK_CUR: - w = SEEK_CUR; - break; - case LV_FS_SEEK_END: - w = SEEK_END; - break; - default: - return LV_FS_RES_INV_PARAM; - } - - fseek(file_p, pos, w); + fseek(file_p, pos, whence); return LV_FS_RES_OK; } /** * Give the position of the read write pointer - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable - * @param pos_p pointer to store the result + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FILE variable. + * @param pos_p pointer to to store the result * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ @@ -226,21 +199,21 @@ static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) /** * Initialize a 'DIR' or 'HANDLE' variable for directory reading - * @param drv pointer to a driver where this function belongs - * @param path path to a directory + * @param drv pointer to a driver where this function belongs + * @param path path to a directory * @return pointer to an initialized 'DIR' or 'HANDLE' variable */ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) { LV_UNUSED(drv); - dir_handle_t * handle = (dir_handle_t *)lv_malloc(sizeof(dir_handle_t)); + dir_handle_t * handle = (dir_handle_t *)lv_mem_alloc(sizeof(dir_handle_t)); #ifndef WIN32 /*Make the path relative to the current directory (the projects root folder)*/ char buf[MAX_PATH_LEN]; lv_snprintf(buf, sizeof(buf), LV_FS_STDIO_PATH "%s", path); handle->dir_p = opendir(buf); if(handle->dir_p == NULL) { - lv_free(handle); + lv_mem_free(handle); return NULL; } return handle; @@ -252,10 +225,10 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) char buf[MAX_PATH_LEN]; lv_snprintf(buf, sizeof(buf), LV_FS_STDIO_PATH "%s\\*", path); - lv_strcpy(handle->next_fn, ""); + strcpy(handle->next_fn, ""); handle->dir_p = FindFirstFileA(buf, &fdata); do { - if(lv_strcmp(fdata.cFileName, ".") == 0 || lv_strcmp(fdata.cFileName, "..") == 0) { + if(strcmp(fdata.cFileName, ".") == 0 || strcmp(fdata.cFileName, "..") == 0) { continue; } else { @@ -270,7 +243,7 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) } while(FindNextFileA(handle->dir_p, &fdata)); if(handle->dir_p == INVALID_HANDLE_VALUE) { - lv_free(handle); + lv_mem_free(handle); return INVALID_HANDLE_VALUE; } return handle; @@ -280,40 +253,36 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) /** * Read the next filename form a directory. * The name of the directories will begin with '/' - * @param drv pointer to a driver where this function belongs - * @param dir_p pointer to an initialized 'DIR' or 'HANDLE' variable - * @param fn pointer to a buffer to store the filename - * @param fn_len length of the buffer to store the filename + * @param drv pointer to a driver where this function belongs + * @param dir_p pointer to an initialized 'DIR' or 'HANDLE' variable + * @param fn pointer to a buffer to store the filename * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ -static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint32_t fn_len) +static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn) { LV_UNUSED(drv); - if(fn_len == 0) return LV_FS_RES_INV_PARAM; - dir_handle_t * handle = (dir_handle_t *)dir_p; #ifndef WIN32 struct dirent * entry; do { entry = readdir(handle->dir_p); if(entry) { - /*Note, DT_DIR is not defined in C99*/ - if(entry->d_type == DT_DIR) lv_snprintf(fn, fn_len, "/%s", entry->d_name); - else lv_strlcpy(fn, entry->d_name, fn_len); + if(entry->d_type == DT_DIR) lv_snprintf(fn, MAX_PATH_LEN, "/%s", entry->d_name); + else strcpy(fn, entry->d_name); } else { - lv_strlcpy(fn, "", fn_len); + strcpy(fn, ""); } - } while(lv_strcmp(fn, "/.") == 0 || lv_strcmp(fn, "/..") == 0); + } while(strcmp(fn, "/.") == 0 || strcmp(fn, "/..") == 0); #else - lv_strlcpy(fn, handle->next_fn, fn_len); + strcpy(fn, handle->next_fn); - lv_strcpy(handle->next_fn, ""); + strcpy(handle->next_fn, ""); WIN32_FIND_DATAA fdata; if(FindNextFileA(handle->dir_p, &fdata) == false) return LV_FS_RES_OK; do { - if(lv_strcmp(fdata.cFileName, ".") == 0 || lv_strcmp(fdata.cFileName, "..") == 0) { + if(strcmp(fdata.cFileName, ".") == 0 || strcmp(fdata.cFileName, "..") == 0) { continue; } else { @@ -333,7 +302,7 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint3 /** * Close the directory reading - * @param drv pointer to a driver where this function belongs + * @param drv pointer to a driver where this function belongs * @param dir_p pointer to an initialized 'DIR' or 'HANDLE' variable * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ @@ -346,7 +315,7 @@ static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p) #else FindClose(handle->dir_p); #endif - lv_free(handle); + lv_mem_free(handle); return LV_FS_RES_OK; } @@ -357,3 +326,4 @@ static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p) #endif #endif /*LV_USE_FS_POSIX*/ + diff --git a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_win32.c b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_win32.c similarity index 77% rename from L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_win32.c rename to L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_win32.c index d5fb364..1a59aa4 100644 --- a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_win32.c +++ b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fs_win32.c @@ -3,6 +3,7 @@ * */ + /********************* * INCLUDES *********************/ @@ -11,25 +12,10 @@ #include #include -#include -#include "../../core/lv_global.h" /********************* * DEFINES *********************/ -#if LV_FS_WIN32_LETTER == '\0' - #error "LV_FS_WIN32_LETTER must be set to a valid value" -#else - #if (LV_FS_WIN32_LETTER < 'A') || (LV_FS_WIN32_LETTER > 'Z') - #if LV_FS_DEFAULT_DRIVE_LETTER != '\0' /*When using default drive letter, strict format (X:) is mandatory*/ - #error "LV_FS_WIN32_LETTER must be an upper case ASCII letter" - #else /*Lean rules for backward compatibility*/ - #warning LV_FS_WIN32_LETTER should be an upper case ASCII letter. \ - Using a slash symbol as drive letter should be replaced with LV_FS_DEFAULT_DRIVE_LETTER mechanism - #endif - #endif -#endif - #define MAX_PATH_LEN 256 /********************** @@ -54,7 +40,7 @@ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); static void * fs_dir_open(lv_fs_drv_t * drv, const char * path); -static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint32_t fn_len); +static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn); static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p); /********************** @@ -79,25 +65,25 @@ void lv_fs_win32_init(void) *--------------------------------------------------*/ /*Add a simple driver to open images*/ - lv_fs_drv_t * fs_drv_p = &(LV_GLOBAL_DEFAULT()->win32_fs_drv); - lv_fs_drv_init(fs_drv_p); + static lv_fs_drv_t fs_drv; /*A driver descriptor*/ + lv_fs_drv_init(&fs_drv); /*Set up fields...*/ - fs_drv_p->letter = LV_FS_WIN32_LETTER; - fs_drv_p->cache_size = LV_FS_WIN32_CACHE_SIZE; + fs_drv.letter = LV_FS_WIN32_LETTER; + fs_drv.cache_size = LV_FS_WIN32_CACHE_SIZE; - fs_drv_p->open_cb = fs_open; - fs_drv_p->close_cb = fs_close; - fs_drv_p->read_cb = fs_read; - fs_drv_p->write_cb = fs_write; - fs_drv_p->seek_cb = fs_seek; - fs_drv_p->tell_cb = fs_tell; + fs_drv.open_cb = fs_open; + fs_drv.close_cb = fs_close; + fs_drv.read_cb = fs_read; + fs_drv.write_cb = fs_write; + fs_drv.seek_cb = fs_seek; + fs_drv.tell_cb = fs_tell; - fs_drv_p->dir_close_cb = fs_dir_close; - fs_drv_p->dir_open_cb = fs_dir_open; - fs_drv_p->dir_read_cb = fs_dir_read; + fs_drv.dir_close_cb = fs_dir_close; + fs_drv.dir_open_cb = fs_dir_open; + fs_drv.dir_read_cb = fs_dir_read; - lv_fs_drv_register(fs_drv_p); + lv_fs_drv_register(&fs_drv); } /********************** @@ -211,9 +197,9 @@ static lv_fs_res_t fs_error_from_win32(DWORD error) /** * Open a file - * @param drv pointer to a driver where this function belongs - * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) - * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR + * @param drv pointer to a driver where this function belongs + * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) + * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR * @return pointer to FIL struct or NULL in case of fail */ static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) @@ -247,8 +233,8 @@ static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) /** * Close an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable. (opened with fs_open) + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FILE variable. (opened with fs_open) * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ @@ -262,11 +248,11 @@ static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p) /** * Read data from an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable. - * @param buf pointer to a memory block where to store the read data - * @param btr number of Bytes To Read - * @param br the real number of read bytes (Byte Read) + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FILE variable. + * @param buf pointer to a memory block where to store the read data + * @param btr number of Bytes To Read + * @param br the real number of read bytes (Byte Read) * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ @@ -280,11 +266,11 @@ static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_ /** * Write into a file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable - * @param buf pointer to a buffer with the bytes to write - * @param btw Bytes To Write - * @param bw the number of real written bytes (Bytes Written). NULL if unused. + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FILE variable + * @param buf pointer to a buffer with the bytes to write + * @param btw Bytes To Write + * @param bw the number of real written bytes (Bytes Written). NULL if unused. * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw) @@ -297,9 +283,9 @@ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, /** * Set the read write pointer. Also expand the file size if necessary. - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable. (opened with fs_open ) - * @param pos the new position of read write pointer + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FILE variable. (opened with fs_open ) + * @param pos the new position of read write pointer * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ @@ -327,9 +313,9 @@ static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs /** * Give the position of the read write pointer - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable - * @param pos_p pointer to store the result + * @param drv pointer to a driver where this function belongs + * @param file_p pointer to a FILE variable. + * @param pos_p pointer to to store the result * @return LV_FS_RES_OK: no error, the file is read * any error from lv_fs_res_t enum */ @@ -366,14 +352,14 @@ static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) /** * Initialize a 'DIR' or 'HANDLE' variable for directory reading - * @param drv pointer to a driver where this function belongs - * @param path path to a directory + * @param drv pointer to a driver where this function belongs + * @param path path to a directory * @return pointer to an initialized 'DIR' or 'HANDLE' variable */ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) { LV_UNUSED(drv); - dir_handle_t * handle = (dir_handle_t *)lv_malloc(sizeof(dir_handle_t)); + dir_handle_t * handle = (dir_handle_t *)lv_mem_alloc(sizeof(dir_handle_t)); handle->dir_p = INVALID_HANDLE_VALUE; handle->next_error = LV_FS_RES_OK; WIN32_FIND_DATAA fdata; @@ -386,7 +372,7 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) lv_snprintf(buf, sizeof(buf), "%s\\*", path); #endif - lv_strcpy(handle->next_fn, ""); + strcpy(handle->next_fn, ""); handle->dir_p = FindFirstFileA(buf, &fdata); do { if(is_dots_name(fdata.cFileName)) { @@ -404,7 +390,7 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) } while(FindNextFileA(handle->dir_p, &fdata)); if(handle->dir_p == INVALID_HANDLE_VALUE) { - lv_free(handle); + lv_mem_free(handle); handle->next_error = fs_error_from_win32(GetLastError()); return INVALID_HANDLE_VALUE; } @@ -417,21 +403,18 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) /** * Read the next filename from a directory. * The name of the directories will begin with '/' - * @param drv pointer to a driver where this function belongs - * @param dir_p pointer to an initialized 'DIR' or 'HANDLE' variable - * @param fn pointer to a buffer to store the filename - * @param fn_len length of the buffer to store the filename + * @param drv pointer to a driver where this function belongs + * @param dir_p pointer to an initialized 'DIR' or 'HANDLE' variable + * @param fn pointer to a buffer to store the filename * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ -static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint32_t fn_len) +static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn) { LV_UNUSED(drv); - if(fn_len == 0) return LV_FS_RES_INV_PARAM; - dir_handle_t * handle = (dir_handle_t *)dir_p; - lv_strlcpy(fn, handle->next_fn, fn_len); + strcpy(fn, handle->next_fn); lv_fs_res_t current_error = handle->next_error; - lv_strcpy(handle->next_fn, ""); + strcpy(handle->next_fn, ""); WIN32_FIND_DATAA fdata; @@ -459,7 +442,7 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint3 /** * Close the directory reading - * @param drv pointer to a driver where this function belongs + * @param drv pointer to a driver where this function belongs * @param dir_p pointer to an initialized 'DIR' or 'HANDLE' variable * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ @@ -470,7 +453,7 @@ static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p) lv_fs_res_t res = FindClose(handle->dir_p) ? LV_FS_RES_OK : fs_error_from_win32(GetLastError()); - lv_free(handle); + lv_mem_free(handle); return res; } diff --git a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fsdrv.h b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fsdrv.h similarity index 63% rename from L3_Middlewares/LVGL/src/libs/fsdrv/lv_fsdrv.h rename to L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fsdrv.h index f830c3a..b864ad6 100644 --- a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fsdrv.h +++ b/L3_Middlewares/LVGL/src/extra/libs/fsdrv/lv_fsdrv.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" +#include "../../../lv_conf_internal.h" /********************* * DEFINES @@ -27,40 +27,27 @@ extern "C" { * GLOBAL PROTOTYPES **********************/ -#if LV_USE_FS_FATFS +#if LV_USE_FS_FATFS != '\0' void lv_fs_fatfs_init(void); #endif -#if LV_USE_FS_STDIO +#if LV_USE_FS_LITTLEFS != '\0' +void lv_fs_littlefs_init(void); +lv_fs_drv_t * lv_fs_littlefs_set_driver(char label, void * lfs_p); +#endif + +#if LV_USE_FS_STDIO != '\0' void lv_fs_stdio_init(void); #endif -#if LV_USE_FS_POSIX +#if LV_USE_FS_POSIX != '\0' void lv_fs_posix_init(void); #endif -#if LV_USE_FS_WIN32 +#if LV_USE_FS_WIN32 != '\0' void lv_fs_win32_init(void); #endif -#if LV_USE_FS_MEMFS -void lv_fs_memfs_init(void); -#endif - -#if LV_USE_FS_LITTLEFS -struct lfs; -void lv_littlefs_set_handler(struct lfs *); -void lv_fs_littlefs_init(void); -#endif - -#if LV_USE_FS_ARDUINO_ESP_LITTLEFS -void lv_fs_arduino_esp_littlefs_init(void); -#endif - -#if LV_USE_FS_ARDUINO_SD -void lv_fs_arduino_sd_init(void); -#endif - /********************** * MACROS **********************/ @@ -70,3 +57,4 @@ void lv_fs_arduino_sd_init(void); #endif #endif /*LV_FSDRV_H*/ + diff --git a/L3_Middlewares/LVGL/src/libs/gif/gifdec.c b/L3_Middlewares/LVGL/src/extra/libs/gif/gifdec.c similarity index 50% rename from L3_Middlewares/LVGL/src/libs/gif/gifdec.c rename to L3_Middlewares/LVGL/src/extra/libs/gif/gifdec.c index 3057e03..3ee9b71 100644 --- a/L3_Middlewares/LVGL/src/libs/gif/gifdec.c +++ b/L3_Middlewares/LVGL/src/extra/libs/gif/gifdec.c @@ -1,7 +1,7 @@ #include "gifdec.h" -#include "../../misc/lv_log.h" -#include "../../stdlib/lv_mem.h" -#include "../../misc/lv_color.h" +#include "../../../misc/lv_log.h" +#include "../../../misc/lv_mem.h" +#include "../../../misc/lv_color.h" #if LV_USE_GIF #include @@ -20,25 +20,15 @@ typedef struct Entry { typedef struct Table { int bulk; int nentries; - Entry * entries; + Entry *entries; } Table; -#if LV_GIF_CACHE_DECODE_DATA -#define LZW_MAXBITS 12 -#define LZW_TABLE_SIZE (1 << LZW_MAXBITS) -#define LZW_CACHE_SIZE (LZW_TABLE_SIZE * 4) -#endif - -static gd_GIF * gif_open(gd_GIF * gif); +static gd_GIF * gif_open(gd_GIF * gif); static bool f_gif_open(gd_GIF * gif, const void * path, bool is_file); static void f_gif_read(gd_GIF * gif, void * buf, size_t len); static int f_gif_seek(gd_GIF * gif, size_t pos, int k); static void f_gif_close(gd_GIF * gif); -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM - #include "gifdec_mve.h" -#endif - static uint16_t read_num(gd_GIF * gif) { @@ -48,8 +38,10 @@ read_num(gd_GIF * gif) return bytes[0] + (((uint16_t) bytes[1]) << 8); } + + gd_GIF * -gd_open_gif_file(const char * fname) +gd_open_gif_file(const char *fname) { gd_GIF gif_base; memset(&gif_base, 0, sizeof(gif_base)); @@ -60,8 +52,9 @@ gd_open_gif_file(const char * fname) return gif_open(&gif_base); } + gd_GIF * -gd_open_gif_data(const void * data) +gd_open_gif_data(const void *data) { gd_GIF gif_base; memset(&gif_base, 0, sizeof(gif_base)); @@ -77,20 +70,21 @@ static gd_GIF * gif_open(gd_GIF * gif_base) uint8_t sigver[3]; uint16_t width, height, depth; uint8_t fdsz, bgidx, aspect; - uint8_t * bgcolor; + int i; + uint8_t *bgcolor; int gct_sz; - gd_GIF * gif = NULL; + gd_GIF *gif = NULL; /* Header */ f_gif_read(gif_base, sigver, 3); - if(memcmp(sigver, "GIF", 3) != 0) { - LV_LOG_WARN("invalid signature"); + if (memcmp(sigver, "GIF", 3) != 0) { + LV_LOG_WARN("invalid signature\n"); goto fail; } /* Version */ f_gif_read(gif_base, sigver, 3); - if(memcmp(sigver, "89a", 3) != 0) { - LV_LOG_WARN("invalid version"); + if (memcmp(sigver, "89a", 3) != 0) { + LV_LOG_WARN("invalid version\n"); goto fail; } /* Width x Height */ @@ -99,8 +93,8 @@ static gd_GIF * gif_open(gd_GIF * gif_base) /* FDSZ */ f_gif_read(gif_base, &fdsz, 1); /* Presence of GCT */ - if(!(fdsz & 0x80)) { - LV_LOG_WARN("no global color table"); + if (!(fdsz & 0x80)) { + LV_LOG_WARN("no global color table\n"); goto fail; } /* Color Space's Depth */ @@ -113,24 +107,15 @@ static gd_GIF * gif_open(gd_GIF * gif_base) /* Aspect Ratio */ f_gif_read(gif_base, &aspect, 1); /* Create gd_GIF Structure. */ - if(0 == width || 0 == height){ - LV_LOG_WARN("Zero size image"); - goto fail; - } -#if LV_GIF_CACHE_DECODE_DATA - if(0 == (INT_MAX - sizeof(gd_GIF) - LZW_CACHE_SIZE) / width / height / 5){ - LV_LOG_WARN("Image dimensions are too large"); - goto fail; - } - gif = lv_malloc(sizeof(gd_GIF) + 5 * width * height + LZW_CACHE_SIZE); - #else - if(0 == (INT_MAX - sizeof(gd_GIF)) / width / height / 5){ - LV_LOG_WARN("Image dimensions are too large"); - goto fail; - } - gif = lv_malloc(sizeof(gd_GIF) + 5 * width * height); - #endif - if(!gif) goto fail; +#if LV_COLOR_DEPTH == 32 + gif = lv_mem_alloc(sizeof(gd_GIF) + 5 * width * height); +#elif LV_COLOR_DEPTH == 16 + gif = lv_mem_alloc(sizeof(gd_GIF) + 4 * width * height); +#elif LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1 + gif = lv_mem_alloc(sizeof(gd_GIF) + 3 * width * height); +#endif + + if (!gif) goto fail; memcpy(gif, gif_base, sizeof(gd_GIF)); gif->width = width; gif->height = height; @@ -141,25 +126,39 @@ static gd_GIF * gif_open(gd_GIF * gif_base) gif->palette = &gif->gct; gif->bgindex = bgidx; gif->canvas = (uint8_t *) &gif[1]; +#if LV_COLOR_DEPTH == 32 gif->frame = &gif->canvas[4 * width * height]; - if(gif->bgindex) { +#elif LV_COLOR_DEPTH == 16 + gif->frame = &gif->canvas[3 * width * height]; +#elif LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1 + gif->frame = &gif->canvas[2 * width * height]; +#endif + if (gif->bgindex) { memset(gif->frame, gif->bgindex, gif->width * gif->height); } - bgcolor = &gif->palette->colors[gif->bgindex * 3]; - #if LV_GIF_CACHE_DECODE_DATA - gif->lzw_cache = gif->frame + width * height; - #endif - -#ifdef GIFDEC_FILL_BG - GIFDEC_FILL_BG(gif->canvas, gif->width * gif->height, 1, gif->width * gif->height, bgcolor, 0xff); -#else - for(int i = 0; i < gif->width * gif->height; i++) { - gif->canvas[i * 4 + 0] = *(bgcolor + 2); - gif->canvas[i * 4 + 1] = *(bgcolor + 1); - gif->canvas[i * 4 + 2] = *(bgcolor + 0); - gif->canvas[i * 4 + 3] = 0xff; - } + bgcolor = &gif->palette->colors[gif->bgindex*3]; + + for (i = 0; i < gif->width * gif->height; i++) { +#if LV_COLOR_DEPTH == 32 + gif->canvas[i*4 + 0] = *(bgcolor + 2); + gif->canvas[i*4 + 1] = *(bgcolor + 1); + gif->canvas[i*4 + 2] = *(bgcolor + 0); + gif->canvas[i*4 + 3] = 0xff; +#elif LV_COLOR_DEPTH == 16 + lv_color_t c = lv_color_make(*(bgcolor + 0), *(bgcolor + 1), *(bgcolor + 2)); + gif->canvas[i*3 + 0] = c.full & 0xff; + gif->canvas[i*3 + 1] = (c.full >> 8) & 0xff; + gif->canvas[i*3 + 2] = 0xff; +#elif LV_COLOR_DEPTH == 8 + lv_color_t c = lv_color_make(*(bgcolor + 0), *(bgcolor + 1), *(bgcolor + 2)); + gif->canvas[i*2 + 0] = c.full; + gif->canvas[i*2 + 1] = 0xff; +#elif LV_COLOR_DEPTH == 1 + lv_color_t c = lv_color_make(*(bgcolor + 0), *(bgcolor + 1), *(bgcolor + 2)); + gif->canvas[i*2 + 0] = c.ch.red > 128 ? 1 : 0; + gif->canvas[i*2 + 1] = 0xff; #endif + } gif->anim_start = f_gif_seek(gif, 0, LV_FS_SEEK_CUR); gif->loop_count = -1; goto ok; @@ -170,20 +169,20 @@ static gd_GIF * gif_open(gd_GIF * gif_base) } static void -discard_sub_blocks(gd_GIF * gif) +discard_sub_blocks(gd_GIF *gif) { uint8_t size; do { f_gif_read(gif, &size, 1); f_gif_seek(gif, size, LV_FS_SEEK_CUR); - } while(size); + } while (size); } static void -read_plain_text_ext(gd_GIF * gif) +read_plain_text_ext(gd_GIF *gif) { - if(gif->plain_text) { + if (gif->plain_text) { uint16_t tx, ty, tw, th; uint8_t cw, ch, fg, bg; size_t sub_block; @@ -199,8 +198,7 @@ read_plain_text_ext(gd_GIF * gif) sub_block = f_gif_seek(gif, 0, LV_FS_SEEK_CUR); gif->plain_text(gif, tx, ty, tw, th, cw, ch, fg, bg); f_gif_seek(gif, sub_block, LV_FS_SEEK_SET); - } - else { + } else { /* Discard plain text metadata. */ f_gif_seek(gif, 13, LV_FS_SEEK_CUR); } @@ -209,7 +207,7 @@ read_plain_text_ext(gd_GIF * gif) } static void -read_graphic_control_ext(gd_GIF * gif) +read_graphic_control_ext(gd_GIF *gif) { uint8_t rdit; @@ -226,9 +224,9 @@ read_graphic_control_ext(gd_GIF * gif) } static void -read_comment_ext(gd_GIF * gif) +read_comment_ext(gd_GIF *gif) { - if(gif->comment) { + if (gif->comment) { size_t sub_block = f_gif_seek(gif, 0, LV_FS_SEEK_CUR); gif->comment(gif); f_gif_seek(gif, sub_block, LV_FS_SEEK_SET); @@ -238,7 +236,7 @@ read_comment_ext(gd_GIF * gif) } static void -read_application_ext(gd_GIF * gif) +read_application_ext(gd_GIF *gif) { char app_id[8]; char app_auth_code[3]; @@ -250,7 +248,7 @@ read_application_ext(gd_GIF * gif) f_gif_read(gif, app_id, 8); /* Application Authentication Code. */ f_gif_read(gif, app_auth_code, 3); - if(!strncmp(app_id, "NETSCAPE", sizeof(app_id))) { + if (!strncmp(app_id, "NETSCAPE", sizeof(app_id))) { /* Discard block size (0x03) and constant byte (0x01). */ f_gif_seek(gif, 2, LV_FS_SEEK_CUR); loop_count = read_num(gif); @@ -258,46 +256,82 @@ read_application_ext(gd_GIF * gif) if(loop_count == 0) { gif->loop_count = 0; } - else { + else{ gif->loop_count = loop_count + 1; } } /* Skip block terminator. */ f_gif_seek(gif, 1, LV_FS_SEEK_CUR); - } - else if(gif->application) { + } else if (gif->application) { size_t sub_block = f_gif_seek(gif, 0, LV_FS_SEEK_CUR); gif->application(gif, app_id, app_auth_code); f_gif_seek(gif, sub_block, LV_FS_SEEK_SET); discard_sub_blocks(gif); - } - else { + } else { discard_sub_blocks(gif); } } static void -read_ext(gd_GIF * gif) +read_ext(gd_GIF *gif) { uint8_t label; f_gif_read(gif, &label, 1); - switch(label) { - case 0x01: - read_plain_text_ext(gif); - break; - case 0xF9: - read_graphic_control_ext(gif); - break; - case 0xFE: - read_comment_ext(gif); - break; - case 0xFF: - read_application_ext(gif); - break; - default: - LV_LOG_WARN("unknown extension: %02X\n", label); + switch (label) { + case 0x01: + read_plain_text_ext(gif); + break; + case 0xF9: + read_graphic_control_ext(gif); + break; + case 0xFE: + read_comment_ext(gif); + break; + case 0xFF: + read_application_ext(gif); + break; + default: + LV_LOG_WARN("unknown extension: %02X\n", label); + } +} + +static Table * +new_table(int key_size) +{ + int key; + int init_bulk = MAX(1 << (key_size + 1), 0x100); + Table *table = lv_mem_alloc(sizeof(*table) + sizeof(Entry) * init_bulk); + if (table) { + table->bulk = init_bulk; + table->nentries = (1 << key_size) + 2; + table->entries = (Entry *) &table[1]; + for (key = 0; key < (1 << key_size); key++) + table->entries[key] = (Entry) {1, 0xFFF, key}; + } + return table; +} + +/* Add table entry. Return value: + * 0 on success + * +1 if key size must be incremented after this addition + * -1 if could not realloc table */ +static int +add_entry(Table **tablep, uint16_t length, uint16_t prefix, uint8_t suffix) +{ + Table *table = *tablep; + if (table->nentries == table->bulk) { + table->bulk *= 2; + table = lv_mem_realloc(table, sizeof(*table) + sizeof(Entry) * table->bulk); + if (!table) return -1; + table->entries = (Entry *) &table[1]; + *tablep = table; } + table->entries[table->nentries] = (Entry) {length, prefix, suffix}; + table->nentries++; + if ((table->nentries & (table->nentries - 1)) == 0) + return 1; + return 0; } static uint16_t @@ -329,198 +363,6 @@ get_key(gd_GIF *gif, int key_size, uint8_t *sub_len, uint8_t *shift, uint8_t *by return key; } -#if LV_GIF_CACHE_DECODE_DATA -/* Decompress image pixels. - * Return 0 on success or -1 on out-of-memory (w.r.t. LZW code table) or parse error. */ -static int -read_image_data(gd_GIF *gif, int interlace) -{ - uint8_t sub_len, shift, byte; - int ret = 0; - int key_size; - int y, pass, linesize; - uint8_t *ptr = NULL; - uint8_t *ptr_row_start = NULL; - uint8_t *ptr_base = NULL; - size_t start, end; - uint16_t key, clear_code, stop_code, curr_code; - int frm_off, frm_size,curr_size,top_slot,new_codes,slot; - /* The first value of the value sequence corresponding to key */ - int first_value; - int last_key; - uint8_t *sp = NULL; - uint8_t *p_stack = NULL; - uint8_t *p_suffix = NULL; - uint16_t *p_prefix = NULL; - - /* get initial key size and clear code, stop code */ - f_gif_read(gif, &byte, 1); - key_size = (int) byte; - clear_code = 1 << key_size; - stop_code = clear_code + 1; - key = 0; - - start = f_gif_seek(gif, 0, LV_FS_SEEK_CUR); - discard_sub_blocks(gif); - end = f_gif_seek(gif, 0, LV_FS_SEEK_CUR); - f_gif_seek(gif, start, LV_FS_SEEK_SET); - - linesize = gif->width; - ptr_base = &gif->frame[gif->fy * linesize + gif->fx]; - ptr_row_start = ptr_base; - ptr = ptr_row_start; - sub_len = shift = 0; - /* decoder */ - pass = 0; - y = 0; - p_stack = gif->lzw_cache; - p_suffix = gif->lzw_cache + LZW_TABLE_SIZE; - p_prefix = (uint16_t*)(gif->lzw_cache + LZW_TABLE_SIZE * 2); - frm_off = 0; - frm_size = gif->fw * gif->fh; - curr_size = key_size + 1; - top_slot = 1 << curr_size; - new_codes = clear_code + 2; - slot = new_codes; - first_value = -1; - last_key = -1; - sp = p_stack; - - while (frm_off < frm_size) { - /* copy data to frame buffer */ - while (sp > p_stack) { - if(frm_off >= frm_size){ - LV_LOG_WARN("LZW table token overflows the frame buffer"); - return -1; - } - *ptr++ = *(--sp); - frm_off += 1; - /* read one line */ - if ((ptr - ptr_row_start) == gif->fw) { - if (interlace) { - switch(pass) { - case 0: - case 1: - y += 8; - ptr_row_start += linesize * 8; - break; - case 2: - y += 4; - ptr_row_start += linesize * 4; - break; - case 3: - y += 2; - ptr_row_start += linesize * 2; - break; - default: - break; - } - while (y >= gif->fh) { - y = 4 >> pass; - ptr_row_start = ptr_base + linesize * y; - pass++; - } - } else { - ptr_row_start += linesize; - } - ptr = ptr_row_start; - } - } - - key = get_key(gif, curr_size, &sub_len, &shift, &byte); - - if (key == stop_code || key >= LZW_TABLE_SIZE) - break; - - if (key == clear_code) { - curr_size = key_size + 1; - slot = new_codes; - top_slot = 1 << curr_size; - first_value = last_key = -1; - sp = p_stack; - continue; - } - - curr_code = key; - /* - * If the current code is a code that will be added to the decoding - * dictionary, it is composed of the data list corresponding to the - * previous key and its first data. - * */ - if (curr_code == slot && first_value >= 0) { - *sp++ = first_value; - curr_code = last_key; - }else if(curr_code >= slot) - break; - - while (curr_code >= new_codes) { - *sp++ = p_suffix[curr_code]; - curr_code = p_prefix[curr_code]; - } - *sp++ = curr_code; - - /* Add code to decoding dictionary */ - if (slot < top_slot && last_key >= 0) { - p_suffix[slot] = curr_code; - p_prefix[slot++] = last_key; - } - first_value = curr_code; - last_key = key; - if (slot >= top_slot) { - if (curr_size < LZW_MAXBITS) { - top_slot <<= 1; - curr_size += 1; - } - } - } - - if (key == stop_code) f_gif_read(gif, &sub_len, 1); /* Must be zero! */ - f_gif_seek(gif, end, LV_FS_SEEK_SET); - return ret; -} -#else -static Table * -new_table(int key_size) -{ - int key; - int init_bulk = MAX(1 << (key_size + 1), 0x100); - Table * table = lv_malloc(sizeof(*table) + sizeof(Entry) * init_bulk); - if(table) { - table->bulk = init_bulk; - table->nentries = (1 << key_size) + 2; - table->entries = (Entry *) &table[1]; - for(key = 0; key < (1 << key_size); key++) - table->entries[key] = (Entry) { - 1, 0xFFF, key - }; - } - return table; -} - -/* Add table entry. Return value: - * 0 on success - * +1 if key size must be incremented after this addition - * -1 if could not realloc table */ -static int -add_entry(Table ** tablep, uint16_t length, uint16_t prefix, uint8_t suffix) -{ - Table * table = *tablep; - if(table->nentries == table->bulk) { - table->bulk *= 2; - table = lv_realloc(table, sizeof(*table) + sizeof(Entry) * table->bulk); - if(!table) return -1; - table->entries = (Entry *) &table[1]; - *tablep = table; - } - table->entries[table->nentries] = (Entry) { - length, prefix, suffix - }; - table->nentries++; - if((table->nentries & (table->nentries - 1)) == 0) - return 1; - return 0; -} - /* Compute output index of y-th input line, in frame of height h. */ static int interlaced_line_index(int h, int y) @@ -528,15 +370,15 @@ interlaced_line_index(int h, int y) int p; /* number of lines in current pass */ p = (h - 1) / 8 + 1; - if(y < p) /* pass 1 */ + if (y < p) /* pass 1 */ return y * 8; y -= p; p = (h - 5) / 8 + 1; - if(y < p) /* pass 2 */ + if (y < p) /* pass 2 */ return y * 8 + 4; y -= p; p = (h - 3) / 4 + 1; - if(y < p) /* pass 3 */ + if (y < p) /* pass 3 */ return y * 4 + 2; y -= p; /* pass 4 */ @@ -544,16 +386,16 @@ interlaced_line_index(int h, int y) } /* Decompress image pixels. - * Return 0 on success or -1 on out-of-memory (w.r.t. LZW code table) or parse error. */ + * Return 0 on success or -1 on out-of-memory (w.r.t. LZW code table). */ static int -read_image_data(gd_GIF * gif, int interlace) +read_image_data(gd_GIF *gif, int interlace) { uint8_t sub_len, shift, byte; - int init_key_size, key_size, table_is_full = 0; - int frm_off, frm_size, str_len = 0, i, p, x, y; + int init_key_size, key_size, table_is_full=0; + int frm_off, frm_size, str_len=0, i, p, x, y; uint16_t key, clear, stop; int ret; - Table * table; + Table *table; Entry entry = {0}; size_t start, end; @@ -572,62 +414,55 @@ read_image_data(gd_GIF * gif, int interlace) key = get_key(gif, key_size, &sub_len, &shift, &byte); /* clear code */ frm_off = 0; ret = 0; - frm_size = gif->fw * gif->fh; - while(frm_off < frm_size) { - if(key == clear) { + frm_size = gif->fw*gif->fh; + while (frm_off < frm_size) { + if (key == clear) { key_size = init_key_size; table->nentries = (1 << (key_size - 1)) + 2; table_is_full = 0; - } - else if(!table_is_full) { + } else if (!table_is_full) { ret = add_entry(&table, str_len + 1, key, entry.suffix); - if(ret == -1) { - lv_free(table); + if (ret == -1) { + lv_mem_free(table); return -1; } - if(table->nentries == 0x1000) { + if (table->nentries == 0x1000) { ret = 0; table_is_full = 1; } } key = get_key(gif, key_size, &sub_len, &shift, &byte); - if(key == clear) continue; - if(key == stop || key == 0x1000) break; - if(ret == 1) key_size++; + if (key == clear) continue; + if (key == stop || key == 0x1000) break; + if (ret == 1) key_size++; entry = table->entries[key]; str_len = entry.length; - if(frm_off + str_len > frm_size){ - LV_LOG_WARN("LZW table token overflows the frame buffer"); - return -1; - } - for(i = 0; i < str_len; i++) { + for (i = 0; i < str_len; i++) { p = frm_off + entry.length - 1; x = p % gif->fw; y = p / gif->fw; - if(interlace) + if (interlace) y = interlaced_line_index((int) gif->fh, y); gif->frame[(gif->fy + y) * gif->width + gif->fx + x] = entry.suffix; - if(entry.prefix == 0xFFF) + if (entry.prefix == 0xFFF) break; else entry = table->entries[entry.prefix]; } frm_off += str_len; - if(key < table->nentries - 1 && !table_is_full) + if (key < table->nentries - 1 && !table_is_full) table->entries[table->nentries - 1].suffix = entry.suffix; } - lv_free(table); - if(key == stop) f_gif_read(gif, &sub_len, 1); /* Must be zero! */ + lv_mem_free(table); + if (key == stop) f_gif_read(gif, &sub_len, 1); /* Must be zero! */ f_gif_seek(gif, end, LV_FS_SEEK_SET); return 0; } -#endif - /* Read image. - * Return 0 on success or -1 on out-of-memory (w.r.t. LZW code table) or parse error. */ + * Return 0 on success or -1 on out-of-memory (w.r.t. LZW code table). */ static int -read_image(gd_GIF * gif) +read_image(gd_GIF *gif) { uint8_t fisrz; int interlace; @@ -637,100 +472,113 @@ read_image(gd_GIF * gif) gif->fy = read_num(gif); gif->fw = read_num(gif); gif->fh = read_num(gif); - if(gif->fx + (uint32_t)gif->fw > gif->width || gif->fy + (uint32_t)gif->fh > gif->height){ - LV_LOG_WARN("Frame coordinates out of image bounds"); - return -1; - } f_gif_read(gif, &fisrz, 1); interlace = fisrz & 0x40; /* Ignore Sort Flag. */ /* Local Color Table? */ - if(fisrz & 0x80) { + if (fisrz & 0x80) { /* Read LCT */ gif->lct.size = 1 << ((fisrz & 0x07) + 1); f_gif_read(gif, gif->lct.colors, 3 * gif->lct.size); gif->palette = &gif->lct; - } - else + } else gif->palette = &gif->gct; /* Image Data. */ return read_image_data(gif, interlace); } static void -render_frame_rect(gd_GIF * gif, uint8_t * buffer) +render_frame_rect(gd_GIF *gif, uint8_t *buffer) { - int i = gif->fy * gif->width + gif->fx; -#ifdef GIFDEC_RENDER_FRAME - GIFDEC_RENDER_FRAME(&buffer[i * 4], gif->fw, gif->fh, gif->width, - &gif->frame[i], gif->palette->colors, - gif->gce.transparency ? gif->gce.tindex : 0x100); -#else - int j, k; - uint8_t index, * color; - - for(j = 0; j < gif->fh; j++) { - for(k = 0; k < gif->fw; k++) { + int i, j, k; + uint8_t index, *color; + i = gif->fy * gif->width + gif->fx; + for (j = 0; j < gif->fh; j++) { + for (k = 0; k < gif->fw; k++) { index = gif->frame[(gif->fy + j) * gif->width + gif->fx + k]; - color = &gif->palette->colors[index * 3]; - if(!gif->gce.transparency || index != gif->gce.tindex) { - buffer[(i + k) * 4 + 0] = *(color + 2); - buffer[(i + k) * 4 + 1] = *(color + 1); - buffer[(i + k) * 4 + 2] = *(color + 0); - buffer[(i + k) * 4 + 3] = 0xFF; + color = &gif->palette->colors[index*3]; + if (!gif->gce.transparency || index != gif->gce.tindex) { +#if LV_COLOR_DEPTH == 32 + buffer[(i+k)*4 + 0] = *(color + 2); + buffer[(i+k)*4 + 1] = *(color + 1); + buffer[(i+k)*4 + 2] = *(color + 0); + buffer[(i+k)*4 + 3] = 0xFF; +#elif LV_COLOR_DEPTH == 16 + lv_color_t c = lv_color_make(*(color + 0), *(color + 1), *(color + 2)); + buffer[(i+k)*3 + 0] = c.full & 0xff; + buffer[(i+k)*3 + 1] = (c.full >> 8) & 0xff; + buffer[(i+k)*3 + 2] = 0xff; +#elif LV_COLOR_DEPTH == 8 + lv_color_t c = lv_color_make(*(color + 0), *(color + 1), *(color + 2)); + buffer[(i+k)*2 + 0] = c.full; + buffer[(i+k)*2 + 1] = 0xff; +#elif LV_COLOR_DEPTH == 1 + uint8_t b = (*(color + 0)) | (*(color + 1)) | (*(color + 2)); + buffer[(i+k)*2 + 0] = b > 128 ? 1 : 0; + buffer[(i+k)*2 + 1] = 0xff; +#endif } } i += gif->width; } -#endif } static void -dispose(gd_GIF * gif) +dispose(gd_GIF *gif) { - int i; - uint8_t * bgcolor; - switch(gif->gce.disposal) { - case 2: /* Restore to background color. */ - bgcolor = &gif->palette->colors[gif->bgindex * 3]; - - uint8_t opa = 0xff; - if(gif->gce.transparency) opa = 0x00; - - i = gif->fy * gif->width + gif->fx; -#ifdef GIFDEC_FILL_BG - GIFDEC_FILL_BG(&(gif->canvas[i * 4]), gif->fw, gif->fh, gif->width, bgcolor, opa); -#else - int j, k; - for(j = 0; j < gif->fh; j++) { - for(k = 0; k < gif->fw; k++) { - gif->canvas[(i + k) * 4 + 0] = *(bgcolor + 2); - gif->canvas[(i + k) * 4 + 1] = *(bgcolor + 1); - gif->canvas[(i + k) * 4 + 2] = *(bgcolor + 0); - gif->canvas[(i + k) * 4 + 3] = opa; - } - i += gif->width; - } + int i, j, k; + uint8_t *bgcolor; + switch (gif->gce.disposal) { + case 2: /* Restore to background color. */ + bgcolor = &gif->palette->colors[gif->bgindex*3]; + + uint8_t opa = 0xff; + if(gif->gce.transparency) opa = 0x00; + + i = gif->fy * gif->width + gif->fx; + for (j = 0; j < gif->fh; j++) { + for (k = 0; k < gif->fw; k++) { +#if LV_COLOR_DEPTH == 32 + gif->canvas[(i+k)*4 + 0] = *(bgcolor + 2); + gif->canvas[(i+k)*4 + 1] = *(bgcolor + 1); + gif->canvas[(i+k)*4 + 2] = *(bgcolor + 0); + gif->canvas[(i+k)*4 + 3] = opa; +#elif LV_COLOR_DEPTH == 16 + lv_color_t c = lv_color_make(*(bgcolor + 0), *(bgcolor + 1), *(bgcolor + 2)); + gif->canvas[(i+k)*3 + 0] = c.full & 0xff; + gif->canvas[(i+k)*3 + 1] = (c.full >> 8) & 0xff; + gif->canvas[(i+k)*3 + 2] = opa; +#elif LV_COLOR_DEPTH == 8 + lv_color_t c = lv_color_make(*(bgcolor + 0), *(bgcolor + 1), *(bgcolor + 2)); + gif->canvas[(i+k)*2 + 0] = c.full; + gif->canvas[(i+k)*2 + 1] = opa; +#elif LV_COLOR_DEPTH == 1 + uint8_t b = (*(bgcolor + 0)) | (*(bgcolor + 1)) | (*(bgcolor + 2)); + gif->canvas[(i+k)*2 + 0] = b > 128 ? 1 : 0; + gif->canvas[(i+k)*2 + 1] = opa; #endif - break; - case 3: /* Restore to previous, i.e., don't update canvas.*/ - break; - default: - /* Add frame non-transparent pixels to canvas. */ - render_frame_rect(gif, gif->canvas); + } + i += gif->width; + } + break; + case 3: /* Restore to previous, i.e., don't update canvas.*/ + break; + default: + /* Add frame non-transparent pixels to canvas. */ + render_frame_rect(gif, gif->canvas); } } /* Return 1 if got a frame; 0 if got GIF trailer; -1 if error. */ int -gd_get_frame(gd_GIF * gif) +gd_get_frame(gd_GIF *gif) { char sep; dispose(gif); f_gif_read(gif, &sep, 1); - while(sep != ',') { - if(sep == ';') { + while (sep != ',') { + if (sep == ';') { f_gif_seek(gif, gif->anim_start, LV_FS_SEEK_SET); if(gif->loop_count == 1 || gif->loop_count < 0) { return 0; @@ -739,34 +587,43 @@ gd_get_frame(gd_GIF * gif) gif->loop_count--; } } - else if(sep == '!') + else if (sep == '!') read_ext(gif); else return -1; f_gif_read(gif, &sep, 1); } - if(read_image(gif) == -1) + if (read_image(gif) == -1) return -1; return 1; } void -gd_render_frame(gd_GIF * gif, uint8_t * buffer) +gd_render_frame(gd_GIF *gif, uint8_t *buffer) { +// uint32_t i; +// uint32_t j; +// for(i = 0, j = 0; i < gif->width * gif->height * 3; i+= 3, j+=4) { +// buffer[j + 0] = gif->canvas[i + 2]; +// buffer[j + 1] = gif->canvas[i + 1]; +// buffer[j + 2] = gif->canvas[i + 0]; +// buffer[j + 3] = 0xFF; +// } +// memcpy(buffer, gif->canvas, gif->width * gif->height * 3); render_frame_rect(gif, buffer); } void -gd_rewind(gd_GIF * gif) +gd_rewind(gd_GIF *gif) { gif->loop_count = -1; f_gif_seek(gif, gif->anim_start, LV_FS_SEEK_SET); } void -gd_close_gif(gd_GIF * gif) +gd_close_gif(gd_GIF *gif) { f_gif_close(gif); - lv_free(gif); + lv_mem_free(gif); } static bool f_gif_open(gd_GIF * gif, const void * path, bool is_file) @@ -779,8 +636,7 @@ static bool f_gif_open(gd_GIF * gif, const void * path, bool is_file) lv_fs_res_t res = lv_fs_open(&gif->fd, path, LV_FS_MODE_RD); if(res != LV_FS_RES_OK) return false; else return true; - } - else { + } else { gif->data = path; return true; } @@ -790,8 +646,8 @@ static void f_gif_read(gd_GIF * gif, void * buf, size_t len) { if(gif->is_file) { lv_fs_read(&gif->fd, buf, len, NULL); - } - else { + } else + { memcpy(buf, &gif->data[gif->f_rw_p], len); gif->f_rw_p += len; } @@ -804,8 +660,7 @@ static int f_gif_seek(gd_GIF * gif, size_t pos, int k) uint32_t x; lv_fs_tell(&gif->fd, &x); return x; - } - else { + } else { if(k == LV_FS_SEEK_CUR) gif->f_rw_p += pos; else if(k == LV_FS_SEEK_SET) gif->f_rw_p = pos; return gif->f_rw_p; diff --git a/L3_Middlewares/LVGL/src/extra/libs/gif/gifdec.h b/L3_Middlewares/LVGL/src/extra/libs/gif/gifdec.h new file mode 100644 index 0000000..b68fab5 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/gif/gifdec.h @@ -0,0 +1,60 @@ +#ifndef GIFDEC_H +#define GIFDEC_H + +#include +#include "../../../misc/lv_fs.h" + +#if LV_USE_GIF + +typedef struct gd_Palette { + int size; + uint8_t colors[0x100 * 3]; +} gd_Palette; + +typedef struct gd_GCE { + uint16_t delay; + uint8_t tindex; + uint8_t disposal; + int input; + int transparency; +} gd_GCE; + + + +typedef struct gd_GIF { + lv_fs_file_t fd; + const char * data; + uint8_t is_file; + uint32_t f_rw_p; + int32_t anim_start; + uint16_t width, height; + uint16_t depth; + int32_t loop_count; + gd_GCE gce; + gd_Palette *palette; + gd_Palette lct, gct; + void (*plain_text)( + struct gd_GIF *gif, uint16_t tx, uint16_t ty, + uint16_t tw, uint16_t th, uint8_t cw, uint8_t ch, + uint8_t fg, uint8_t bg + ); + void (*comment)(struct gd_GIF *gif); + void (*application)(struct gd_GIF *gif, char id[8], char auth[3]); + uint16_t fx, fy, fw, fh; + uint8_t bgindex; + uint8_t *canvas, *frame; +} gd_GIF; + +gd_GIF * gd_open_gif_file(const char *fname); + +gd_GIF * gd_open_gif_data(const void *data); + +void gd_render_frame(gd_GIF *gif, uint8_t *buffer); + +int gd_get_frame(gd_GIF *gif); +void gd_rewind(gd_GIF *gif); +void gd_close_gif(gd_GIF *gif); + +#endif /*LV_USE_GIF*/ + +#endif /* GIFDEC_H */ diff --git a/L3_Middlewares/LVGL/src/libs/gif/lv_gif.c b/L3_Middlewares/LVGL/src/extra/libs/gif/lv_gif.c similarity index 54% rename from L3_Middlewares/LVGL/src/libs/gif/lv_gif.c rename to L3_Middlewares/LVGL/src/extra/libs/gif/lv_gif.c index 920f776..2bd9e01 100644 --- a/L3_Middlewares/LVGL/src/libs/gif/lv_gif.c +++ b/L3_Middlewares/LVGL/src/extra/libs/gif/lv_gif.c @@ -6,9 +6,7 @@ /********************* * INCLUDES *********************/ -#include "../../misc/lv_timer_private.h" -#include "../../core/lv_obj_class_private.h" -#include "lv_gif_private.h" +#include "lv_gif.h" #if LV_USE_GIF #include "gifdec.h" @@ -16,12 +14,13 @@ /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_gif_class) +#define MY_CLASS &lv_gif_class /********************** * TYPEDEFS **********************/ + /********************** * STATIC PROTOTYPES **********************/ @@ -32,13 +31,11 @@ static void next_frame_task_cb(lv_timer_t * t); /********************** * STATIC VARIABLES **********************/ - const lv_obj_class_t lv_gif_class = { .constructor_cb = lv_gif_constructor, .destructor_cb = lv_gif_destructor, .instance_size = sizeof(lv_gif_t), - .base_class = &lv_image_class, - .name = "gif", + .base_class = &lv_img_class }; /********************** @@ -61,42 +58,35 @@ lv_obj_t * lv_gif_create(lv_obj_t * parent) void lv_gif_set_src(lv_obj_t * obj, const void * src) { lv_gif_t * gifobj = (lv_gif_t *) obj; - gd_GIF * gif = gifobj->gif; /*Close previous gif if any*/ - if(gif != NULL) { - lv_image_cache_drop(lv_image_get_src(obj)); - - gd_close_gif(gif); + if(gifobj->gif) { + lv_img_cache_invalidate_src(&gifobj->imgdsc); + gd_close_gif(gifobj->gif); gifobj->gif = NULL; gifobj->imgdsc.data = NULL; } - if(lv_image_src_get_type(src) == LV_IMAGE_SRC_VARIABLE) { - const lv_image_dsc_t * img_dsc = src; - gif = gd_open_gif_data(img_dsc->data); + if(lv_img_src_get_type(src) == LV_IMG_SRC_VARIABLE) { + const lv_img_dsc_t * img_dsc = src; + gifobj->gif = gd_open_gif_data(img_dsc->data); } - else if(lv_image_src_get_type(src) == LV_IMAGE_SRC_FILE) { - gif = gd_open_gif_file(src); + else if(lv_img_src_get_type(src) == LV_IMG_SRC_FILE) { + gifobj->gif = gd_open_gif_file(src); } - if(gif == NULL) { - LV_LOG_WARN("Couldn't load the source"); + if(gifobj->gif == NULL) { + LV_LOG_WARN("Could't load the source"); return; } - gifobj->gif = gif; - gifobj->imgdsc.data = gif->canvas; - gifobj->imgdsc.header.magic = LV_IMAGE_HEADER_MAGIC; - gifobj->imgdsc.header.flags = LV_IMAGE_FLAGS_MODIFIABLE; - gifobj->imgdsc.header.cf = LV_COLOR_FORMAT_ARGB8888; - gifobj->imgdsc.header.h = gif->height; - gifobj->imgdsc.header.w = gif->width; - gifobj->imgdsc.header.stride = gif->width * 4; - gifobj->imgdsc.data_size = gif->width * gif->height * 4; - + gifobj->imgdsc.data = gifobj->gif->canvas; + gifobj->imgdsc.header.always_zero = 0; + gifobj->imgdsc.header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA; + gifobj->imgdsc.header.h = gifobj->gif->height; + gifobj->imgdsc.header.w = gifobj->gif->width; gifobj->last_call = lv_tick_get(); - lv_image_set_src(obj, &gifobj->imgdsc); + lv_img_set_src(obj, &gifobj->imgdsc); lv_timer_resume(gifobj->timer); lv_timer_reset(gifobj->timer); @@ -108,65 +98,11 @@ void lv_gif_set_src(lv_obj_t * obj, const void * src) void lv_gif_restart(lv_obj_t * obj) { lv_gif_t * gifobj = (lv_gif_t *) obj; - - if(gifobj->gif == NULL) { - LV_LOG_WARN("Gif resource not loaded correctly"); - return; - } - gd_rewind(gifobj->gif); lv_timer_resume(gifobj->timer); lv_timer_reset(gifobj->timer); } -void lv_gif_pause(lv_obj_t * obj) -{ - lv_gif_t * gifobj = (lv_gif_t *) obj; - lv_timer_pause(gifobj->timer); -} - -void lv_gif_resume(lv_obj_t * obj) -{ - lv_gif_t * gifobj = (lv_gif_t *) obj; - - if(gifobj->gif == NULL) { - LV_LOG_WARN("Gif resource not loaded correctly"); - return; - } - - lv_timer_resume(gifobj->timer); -} - -bool lv_gif_is_loaded(lv_obj_t * obj) -{ - lv_gif_t * gifobj = (lv_gif_t *) obj; - - return (gifobj->gif != NULL); -} - -int32_t lv_gif_get_loop_count(lv_obj_t * obj) -{ - lv_gif_t * gifobj = (lv_gif_t *) obj; - - if(gifobj->gif == NULL) { - return -1; - } - - return gifobj->gif->loop_count; -} - -void lv_gif_set_loop_count(lv_obj_t * obj, int32_t count) -{ - lv_gif_t * gifobj = (lv_gif_t *) obj; - - if(gifobj->gif == NULL) { - LV_LOG_WARN("Gif resource not loaded correctly"); - return; - } - - gifobj->gif->loop_count = count; -} - /********************** * STATIC FUNCTIONS **********************/ @@ -186,12 +122,10 @@ static void lv_gif_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { LV_UNUSED(class_p); lv_gif_t * gifobj = (lv_gif_t *) obj; - - lv_image_cache_drop(lv_image_get_src(obj)); - + lv_img_cache_invalidate_src(&gifobj->imgdsc); if(gifobj->gif) gd_close_gif(gifobj->gif); - lv_timer_delete(gifobj->timer); + lv_timer_del(gifobj->timer); } static void next_frame_task_cb(lv_timer_t * t) @@ -206,14 +140,14 @@ static void next_frame_task_cb(lv_timer_t * t) int has_next = gd_get_frame(gifobj->gif); if(has_next == 0) { /*It was the last repeat*/ - lv_result_t res = lv_obj_send_event(obj, LV_EVENT_READY, NULL); + lv_res_t res = lv_event_send(obj, LV_EVENT_READY, NULL); lv_timer_pause(t); - if(res != LV_RESULT_OK) return; + if(res != LV_FS_RES_OK) return; } gd_render_frame(gifobj->gif, (uint8_t *)gifobj->imgdsc.data); - lv_image_cache_drop(lv_image_get_src(obj)); + lv_img_cache_invalidate_src(lv_img_get_src(obj)); lv_obj_invalidate(obj); } diff --git a/L3_Middlewares/LVGL/src/libs/gif/lv_gif_private.h b/L3_Middlewares/LVGL/src/extra/libs/gif/lv_gif.h similarity index 54% rename from L3_Middlewares/LVGL/src/libs/gif/lv_gif_private.h rename to L3_Middlewares/LVGL/src/extra/libs/gif/lv_gif.h index c4ea17a..d8c93db 100644 --- a/L3_Middlewares/LVGL/src/libs/gif/lv_gif_private.h +++ b/L3_Middlewares/LVGL/src/extra/libs/gif/lv_gif.h @@ -1,10 +1,10 @@ /** - * @file lv_gif_private.h + * @file lv_gif.h * */ -#ifndef LV_GIF_PRIVATE_H -#define LV_GIF_PRIVATE_H +#ifndef LV_GIF_H +#define LV_GIF_H #ifdef __cplusplus extern "C" { @@ -14,11 +14,11 @@ extern "C" { * INCLUDES *********************/ -#include "../../widgets/image/lv_image_private.h" -#include "lv_gif.h" - +#include "../../../lvgl.h" #if LV_USE_GIF +#include "gifdec.h" + /********************* * DEFINES *********************/ @@ -27,31 +27,32 @@ extern "C" { * TYPEDEFS **********************/ -/********************** - * TYPEDEFS - **********************/ - -struct lv_gif_t { - lv_image_t img; +typedef struct { + lv_img_t img; gd_GIF * gif; lv_timer_t * timer; - lv_image_dsc_t imgdsc; + lv_img_dsc_t imgdsc; uint32_t last_call; -}; +} lv_gif_t; +extern const lv_obj_class_t lv_gif_class; /********************** * GLOBAL PROTOTYPES **********************/ +lv_obj_t * lv_gif_create(lv_obj_t * parent); +void lv_gif_set_src(lv_obj_t * obj, const void * src); +void lv_gif_restart(lv_obj_t * gif); + /********************** * MACROS **********************/ -#endif /* LV_USE_GIF */ +#endif /*LV_USE_GIF*/ #ifdef __cplusplus -} /*extern "C"*/ +} /* extern "C" */ #endif -#endif /*LV_GIF_PRIVATE_H*/ +#endif /*LV_GIF_H*/ diff --git a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_gradient_private.h b/L3_Middlewares/LVGL/src/extra/libs/lv_libs.h similarity index 54% rename from L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_gradient_private.h rename to L3_Middlewares/LVGL/src/extra/libs/lv_libs.h index 7e2f2ab..1fefe6c 100644 --- a/L3_Middlewares/LVGL/src/draw/sw/lv_draw_sw_gradient_private.h +++ b/L3_Middlewares/LVGL/src/extra/libs/lv_libs.h @@ -1,10 +1,10 @@ /** - * @file lv_draw_sw_gradient_private.h + * @file lv_libs.h * */ -#ifndef LV_DRAW_SW_GRADIENT_PRIVATE_H -#define LV_DRAW_SW_GRADIENT_PRIVATE_H +#ifndef LV_LIBS_H +#define LV_LIBS_H #ifdef __cplusplus extern "C" { @@ -13,10 +13,16 @@ extern "C" { /********************* * INCLUDES *********************/ - -#include "lv_draw_sw_gradient.h" - -#if LV_USE_DRAW_SW +#include "bmp/lv_bmp.h" +#include "fsdrv/lv_fsdrv.h" +#include "png/lv_png.h" +#include "gif/lv_gif.h" +#include "qrcode/lv_qrcode.h" +#include "sjpg/lv_sjpg.h" +#include "freetype/lv_freetype.h" +#include "rlottie/lv_rlottie.h" +#include "ffmpeg/lv_ffmpeg.h" +#include "tiny_ttf/lv_tiny_ttf.h" /********************* * DEFINES @@ -26,13 +32,6 @@ extern "C" { * TYPEDEFS **********************/ -struct lv_grad_t { - lv_color_t * color_map; - lv_opa_t * opa_map; - uint32_t size; -}; - - /********************** * GLOBAL PROTOTYPES **********************/ @@ -41,10 +40,8 @@ struct lv_grad_t { * MACROS **********************/ -#endif /* LV_USE_DRAW_SW */ - #ifdef __cplusplus } /*extern "C"*/ #endif -#endif /*LV_DRAW_SW_GRADIENT_PRIVATE_H*/ +#endif /*LV_LIBS_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/libs/png/lodepng.c b/L3_Middlewares/LVGL/src/extra/libs/png/lodepng.c new file mode 100644 index 0000000..82e18e1 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/png/lodepng.c @@ -0,0 +1,6469 @@ +/* +LodePNG version 20201017 + +Copyright (c) 2005-2020 Lode Vandevenne + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ + +/* +The manual and changelog are in the header file "lodepng.h" +Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for C. +*/ + +#include "lodepng.h" +#if LV_USE_PNG + +#ifdef LODEPNG_COMPILE_DISK +#include /* LONG_MAX */ +#endif /* LODEPNG_COMPILE_DISK */ + +#ifdef LODEPNG_COMPILE_ALLOCATORS +#include /* allocations */ +#endif /* LODEPNG_COMPILE_ALLOCATORS */ + +#if defined(_MSC_VER) && (_MSC_VER >= 1310) /*Visual Studio: A few warning types are not desired here.*/ +#pragma warning( disable : 4244 ) /*implicit conversions: not warned by gcc -Wall -Wextra and requires too much casts*/ +#pragma warning( disable : 4996 ) /*VS does not like fopen, but fopen_s is not standard C so unusable here*/ +#endif /*_MSC_VER */ + +const char* LODEPNG_VERSION_STRING = "20201017"; + +/* +This source file is built up in the following large parts. The code sections +with the "LODEPNG_COMPILE_" #defines divide this up further in an intermixed way. +-Tools for C and common code for PNG and Zlib +-C Code for Zlib (huffman, deflate, ...) +-C Code for PNG (file format chunks, adam7, PNG filters, color conversions, ...) +-The C++ wrapper around all of the above +*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* // Tools for C, and common code for PNG and Zlib. // */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +/*The malloc, realloc and free functions defined here with "lodepng_" in front +of the name, so that you can easily change them to others related to your +platform if needed. Everything else in the code calls these. Pass +-DLODEPNG_NO_COMPILE_ALLOCATORS to the compiler, or comment out +#define LODEPNG_COMPILE_ALLOCATORS in the header, to disable the ones here and +define them in your own project's source files without needing to change +lodepng source code. Don't forget to remove "static" if you copypaste them +from here.*/ + +#ifdef LODEPNG_COMPILE_ALLOCATORS +static void* lodepng_malloc(size_t size) { +#ifdef LODEPNG_MAX_ALLOC + if(size > LODEPNG_MAX_ALLOC) return 0; +#endif + return lv_mem_alloc(size); +} + +/* NOTE: when realloc returns NULL, it leaves the original memory untouched */ +static void* lodepng_realloc(void* ptr, size_t new_size) { +#ifdef LODEPNG_MAX_ALLOC + if(new_size > LODEPNG_MAX_ALLOC) return 0; +#endif + return lv_mem_realloc(ptr, new_size); +} + +static void lodepng_free(void* ptr) { + lv_mem_free(ptr); +} +#else /*LODEPNG_COMPILE_ALLOCATORS*/ +/* TODO: support giving additional void* payload to the custom allocators */ +void* lodepng_malloc(size_t size); +void* lodepng_realloc(void* ptr, size_t new_size); +void lodepng_free(void* ptr); +#endif /*LODEPNG_COMPILE_ALLOCATORS*/ + +/* convince the compiler to inline a function, for use when this measurably improves performance */ +/* inline is not available in C90, but use it when supported by the compiler */ +#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || (defined(__cplusplus) && (__cplusplus >= 199711L)) +#define LODEPNG_INLINE inline +#else +#define LODEPNG_INLINE /* not available */ +#endif + +/* restrict is not available in C90, but use it when supported by the compiler */ +#if (defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) ||\ + (defined(_MSC_VER) && (_MSC_VER >= 1400)) || \ + (defined(__WATCOMC__) && (__WATCOMC__ >= 1250) && !defined(__cplusplus)) +#define LODEPNG_RESTRICT __restrict +#else +#define LODEPNG_RESTRICT /* not available */ +#endif + +/* Replacements for C library functions such as memcpy and strlen, to support platforms +where a full C library is not available. The compiler can recognize them and compile +to something as fast. */ + +static void lodepng_memcpy(void* LODEPNG_RESTRICT dst, + const void* LODEPNG_RESTRICT src, size_t size) { + lv_memcpy(dst, src, size); +} + +static void lodepng_memset(void* LODEPNG_RESTRICT dst, + int value, size_t num) { + lv_memset(dst, value, num); +} + +/* does not check memory out of bounds, do not use on untrusted data */ +static size_t lodepng_strlen(const char* a) { + const char* orig = a; + /* avoid warning about unused function in case of disabled COMPILE... macros */ + (void)(&lodepng_strlen); + while(*a) a++; + return (size_t)(a - orig); +} + +#define LODEPNG_MAX(a, b) (((a) > (b)) ? (a) : (b)) +#define LODEPNG_MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define LODEPNG_ABS(x) ((x) < 0 ? -(x) : (x)) + +#if defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_DECODER) +/* Safely check if adding two integers will overflow (no undefined +behavior, compiler removing the code, etc...) and output result. */ +static int lodepng_addofl(size_t a, size_t b, size_t* result) { + *result = a + b; /* Unsigned addition is well defined and safe in C90 */ + return *result < a; +} +#endif /*defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_DECODER)*/ + +#ifdef LODEPNG_COMPILE_DECODER +/* Safely check if multiplying two integers will overflow (no undefined +behavior, compiler removing the code, etc...) and output result. */ +static int lodepng_mulofl(size_t a, size_t b, size_t* result) { + *result = a * b; /* Unsigned multiplication is well defined and safe in C90 */ + return (a != 0 && *result / a != b); +} + +#ifdef LODEPNG_COMPILE_ZLIB +/* Safely check if a + b > c, even if overflow could happen. */ +static int lodepng_gtofl(size_t a, size_t b, size_t c) { + size_t d; + if(lodepng_addofl(a, b, &d)) return 1; + return d > c; +} +#endif /*LODEPNG_COMPILE_ZLIB*/ +#endif /*LODEPNG_COMPILE_DECODER*/ + + +/* +Often in case of an error a value is assigned to a variable and then it breaks +out of a loop (to go to the cleanup phase of a function). This macro does that. +It makes the error handling code shorter and more readable. + +Example: if(!uivector_resize(&lz77_encoded, datasize)) ERROR_BREAK(83); +*/ +#define CERROR_BREAK(errorvar, code){\ + errorvar = code;\ + break;\ +} + +/*version of CERROR_BREAK that assumes the common case where the error variable is named "error"*/ +#define ERROR_BREAK(code) CERROR_BREAK(error, code) + +/*Set error var to the error code, and return it.*/ +#define CERROR_RETURN_ERROR(errorvar, code){\ + errorvar = code;\ + return code;\ +} + +/*Try the code, if it returns error, also return the error.*/ +#define CERROR_TRY_RETURN(call){\ + unsigned error = call;\ + if(error) return error;\ +} + +/*Set error var to the error code, and return from the void function.*/ +#define CERROR_RETURN(errorvar, code){\ + errorvar = code;\ + return;\ +} + +/* +About uivector, ucvector and string: +-All of them wrap dynamic arrays or text strings in a similar way. +-LodePNG was originally written in C++. The vectors replace the std::vectors that were used in the C++ version. +-The string tools are made to avoid problems with compilers that declare things like strncat as deprecated. +-They're not used in the interface, only internally in this file as static functions. +-As with many other structs in this file, the init and cleanup functions serve as ctor and dtor. +*/ + +#ifdef LODEPNG_COMPILE_ZLIB +#ifdef LODEPNG_COMPILE_ENCODER +/*dynamic vector of unsigned ints*/ +typedef struct uivector { + unsigned* data; + size_t size; /*size in number of unsigned longs*/ + size_t allocsize; /*allocated size in bytes*/ +} uivector; + +static void uivector_cleanup(void* p) { + ((uivector*)p)->size = ((uivector*)p)->allocsize = 0; + lodepng_free(((uivector*)p)->data); + ((uivector*)p)->data = NULL; +} + +/*returns 1 if success, 0 if failure ==> nothing done*/ +static unsigned uivector_resize(uivector* p, size_t size) { + size_t allocsize = size * sizeof(unsigned); + if(allocsize > p->allocsize) { + size_t newsize = allocsize + (p->allocsize >> 1u); + void* data = lodepng_realloc(p->data, newsize); + if(data) { + p->allocsize = newsize; + p->data = (unsigned*)data; + } + else return 0; /*error: not enough memory*/ + } + p->size = size; + return 1; /*success*/ +} + +static void uivector_init(uivector* p) { + p->data = NULL; + p->size = p->allocsize = 0; +} + +/*returns 1 if success, 0 if failure ==> nothing done*/ +static unsigned uivector_push_back(uivector* p, unsigned c) { + if(!uivector_resize(p, p->size + 1)) return 0; + p->data[p->size - 1] = c; + return 1; +} +#endif /*LODEPNG_COMPILE_ENCODER*/ +#endif /*LODEPNG_COMPILE_ZLIB*/ + +/* /////////////////////////////////////////////////////////////////////////// */ + +/*dynamic vector of unsigned chars*/ +typedef struct ucvector { + unsigned char* data; + size_t size; /*used size*/ + size_t allocsize; /*allocated size*/ +} ucvector; + +/*returns 1 if success, 0 if failure ==> nothing done*/ +static unsigned ucvector_resize(ucvector* p, size_t size) { + if(size > p->allocsize) { + size_t newsize = size + (p->allocsize >> 1u); + void* data = lodepng_realloc(p->data, newsize); + if(data) { + p->allocsize = newsize; + p->data = (unsigned char*)data; + } + else return 0; /*error: not enough memory*/ + } + p->size = size; + return 1; /*success*/ +} + +static ucvector ucvector_init(unsigned char* buffer, size_t size) { + ucvector v; + v.data = buffer; + v.allocsize = v.size = size; + return v; +} + +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_PNG +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + +/*free string pointer and set it to NULL*/ +static void string_cleanup(char** out) { + lodepng_free(*out); + *out = NULL; +} + +/*also appends null termination character*/ +static char* alloc_string_sized(const char* in, size_t insize) { + char* out = (char*)lodepng_malloc(insize + 1); + if(out) { + lodepng_memcpy(out, in, insize); + out[insize] = 0; + } + return out; +} + +/* dynamically allocates a new string with a copy of the null terminated input text */ +static char* alloc_string(const char* in) { + return alloc_string_sized(in, lodepng_strlen(in)); +} +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ +#endif /*LODEPNG_COMPILE_PNG*/ + +/* ////////////////////////////////////////////////////////////////////////// */ + +#if defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_PNG) +static unsigned lodepng_read32bitInt(const unsigned char* buffer) { + return (((unsigned)buffer[0] << 24u) | ((unsigned)buffer[1] << 16u) | + ((unsigned)buffer[2] << 8u) | (unsigned)buffer[3]); +} +#endif /*defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_PNG)*/ + +#if defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER) +/*buffer must have at least 4 allocated bytes available*/ +static void lodepng_set32bitInt(unsigned char* buffer, unsigned value) { + buffer[0] = (unsigned char)((value >> 24) & 0xff); + buffer[1] = (unsigned char)((value >> 16) & 0xff); + buffer[2] = (unsigned char)((value >> 8) & 0xff); + buffer[3] = (unsigned char)((value ) & 0xff); +} +#endif /*defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER)*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / File IO / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_DISK + +/* returns negative value on error. This should be pure C compatible, so no fstat. */ +static long lodepng_filesize(const char* filename) { + lv_fs_file_t f; + lv_fs_res_t res = lv_fs_open(&f, filename, LV_FS_MODE_RD); + if(res != LV_FS_RES_OK) return -1; + uint32_t size = 0; + if(lv_fs_seek(&f, 0, LV_FS_SEEK_END) != 0) { + lv_fs_close(&f); + return -1; + } + + lv_fs_tell(&f, &size); + lv_fs_close(&f); + return size; +} + +/* load file into buffer that already has the correct allocated size. Returns error code.*/ +static unsigned lodepng_buffer_file(unsigned char* out, size_t size, const char* filename) { + lv_fs_file_t f; + lv_fs_res_t res = lv_fs_open(&f, filename, LV_FS_MODE_RD); + if(res != LV_FS_RES_OK) return 78; + + uint32_t br; + res = lv_fs_read(&f, out, size, &br); + if(res != LV_FS_RES_OK) return 78; + if (br != size) return 78; + lv_fs_close(&f); + return 0; +} + +unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename) { + long size = lodepng_filesize(filename); + if(size < 0) return 78; + *outsize = (size_t)size; + + *out = (unsigned char*)lodepng_malloc((size_t)size); + if(!(*out) && size > 0) return 83; /*the above malloc failed*/ + + return lodepng_buffer_file(*out, (size_t)size, filename); +} + +/*write given buffer to the file, overwriting the file, it doesn't append to it.*/ +unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const char* filename) { + lv_fs_file_t f; + lv_fs_res_t res = lv_fs_open(&f, filename, LV_FS_MODE_WR); + if(res != LV_FS_RES_OK) return 79; + + uint32_t bw; + res = lv_fs_write(&f, buffer, buffersize, &bw); + lv_fs_close(&f); + return 0; +} + +#endif /*LODEPNG_COMPILE_DISK*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* // End of common code and tools. Begin of Zlib related code. // */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_ZLIB +#ifdef LODEPNG_COMPILE_ENCODER + +typedef struct { + ucvector* data; + unsigned char bp; /*ok to overflow, indicates bit pos inside byte*/ +} LodePNGBitWriter; + +static void LodePNGBitWriter_init(LodePNGBitWriter* writer, ucvector* data) { + writer->data = data; + writer->bp = 0; +} + +/*TODO: this ignores potential out of memory errors*/ +#define WRITEBIT(writer, bit){\ + /* append new byte */\ + if(((writer->bp) & 7u) == 0) {\ + if(!ucvector_resize(writer->data, writer->data->size + 1)) return;\ + writer->data->data[writer->data->size - 1] = 0;\ + }\ + (writer->data->data[writer->data->size - 1]) |= (bit << ((writer->bp) & 7u));\ + ++writer->bp;\ +} + +/* LSB of value is written first, and LSB of bytes is used first */ +static void writeBits(LodePNGBitWriter* writer, unsigned value, size_t nbits) { + if(nbits == 1) { /* compiler should statically compile this case if nbits == 1 */ + WRITEBIT(writer, value); + } else { + /* TODO: increase output size only once here rather than in each WRITEBIT */ + size_t i; + for(i = 0; i != nbits; ++i) { + WRITEBIT(writer, (unsigned char)((value >> i) & 1)); + } + } +} + +/* This one is to use for adding huffman symbol, the value bits are written MSB first */ +static void writeBitsReversed(LodePNGBitWriter* writer, unsigned value, size_t nbits) { + size_t i; + for(i = 0; i != nbits; ++i) { + /* TODO: increase output size only once here rather than in each WRITEBIT */ + WRITEBIT(writer, (unsigned char)((value >> (nbits - 1u - i)) & 1u)); + } +} +#endif /*LODEPNG_COMPILE_ENCODER*/ + +#ifdef LODEPNG_COMPILE_DECODER + +typedef struct { + const unsigned char* data; + size_t size; /*size of data in bytes*/ + size_t bitsize; /*size of data in bits, end of valid bp values, should be 8*size*/ + size_t bp; + unsigned buffer; /*buffer for reading bits. NOTE: 'unsigned' must support at least 32 bits*/ +} LodePNGBitReader; + +/* data size argument is in bytes. Returns error if size too large causing overflow */ +static unsigned LodePNGBitReader_init(LodePNGBitReader* reader, const unsigned char* data, size_t size) { + size_t temp; + reader->data = data; + reader->size = size; + /* size in bits, return error if overflow (if size_t is 32 bit this supports up to 500MB) */ + if(lodepng_mulofl(size, 8u, &reader->bitsize)) return 105; + /*ensure incremented bp can be compared to bitsize without overflow even when it would be incremented 32 too much and + trying to ensure 32 more bits*/ + if(lodepng_addofl(reader->bitsize, 64u, &temp)) return 105; + reader->bp = 0; + reader->buffer = 0; + return 0; /*ok*/ +} + +/* +ensureBits functions: +Ensures the reader can at least read nbits bits in one or more readBits calls, +safely even if not enough bits are available. +Returns 1 if there are enough bits available, 0 if not. +*/ + +/*See ensureBits documentation above. This one ensures exactly 1 bit */ +/*static unsigned ensureBits1(LodePNGBitReader* reader) { + if(reader->bp >= reader->bitsize) return 0; + reader->buffer = (unsigned)reader->data[reader->bp >> 3u] >> (reader->bp & 7u); + return 1; +}*/ + +/*See ensureBits documentation above. This one ensures up to 9 bits */ +static unsigned ensureBits9(LodePNGBitReader* reader, size_t nbits) { + size_t start = reader->bp >> 3u; + size_t size = reader->size; + if(start + 1u < size) { + reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u); + reader->buffer >>= (reader->bp & 7u); + return 1; + } else { + reader->buffer = 0; + if(start + 0u < size) reader->buffer |= reader->data[start + 0]; + reader->buffer >>= (reader->bp & 7u); + return reader->bp + nbits <= reader->bitsize; + } +} + +/*See ensureBits documentation above. This one ensures up to 17 bits */ +static unsigned ensureBits17(LodePNGBitReader* reader, size_t nbits) { + size_t start = reader->bp >> 3u; + size_t size = reader->size; + if(start + 2u < size) { + reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u) | + ((unsigned)reader->data[start + 2] << 16u); + reader->buffer >>= (reader->bp & 7u); + return 1; + } else { + reader->buffer = 0; + if(start + 0u < size) reader->buffer |= reader->data[start + 0]; + if(start + 1u < size) reader->buffer |= ((unsigned)reader->data[start + 1] << 8u); + reader->buffer >>= (reader->bp & 7u); + return reader->bp + nbits <= reader->bitsize; + } +} + +/*See ensureBits documentation above. This one ensures up to 25 bits */ +static LODEPNG_INLINE unsigned ensureBits25(LodePNGBitReader* reader, size_t nbits) { + size_t start = reader->bp >> 3u; + size_t size = reader->size; + if(start + 3u < size) { + reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u) | + ((unsigned)reader->data[start + 2] << 16u) | ((unsigned)reader->data[start + 3] << 24u); + reader->buffer >>= (reader->bp & 7u); + return 1; + } else { + reader->buffer = 0; + if(start + 0u < size) reader->buffer |= reader->data[start + 0]; + if(start + 1u < size) reader->buffer |= ((unsigned)reader->data[start + 1] << 8u); + if(start + 2u < size) reader->buffer |= ((unsigned)reader->data[start + 2] << 16u); + reader->buffer >>= (reader->bp & 7u); + return reader->bp + nbits <= reader->bitsize; + } +} + +/*See ensureBits documentation above. This one ensures up to 32 bits */ +static LODEPNG_INLINE unsigned ensureBits32(LodePNGBitReader* reader, size_t nbits) { + size_t start = reader->bp >> 3u; + size_t size = reader->size; + if(start + 4u < size) { + reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u) | + ((unsigned)reader->data[start + 2] << 16u) | ((unsigned)reader->data[start + 3] << 24u); + reader->buffer >>= (reader->bp & 7u); + reader->buffer |= (((unsigned)reader->data[start + 4] << 24u) << (8u - (reader->bp & 7u))); + return 1; + } else { + reader->buffer = 0; + if(start + 0u < size) reader->buffer |= reader->data[start + 0]; + if(start + 1u < size) reader->buffer |= ((unsigned)reader->data[start + 1] << 8u); + if(start + 2u < size) reader->buffer |= ((unsigned)reader->data[start + 2] << 16u); + if(start + 3u < size) reader->buffer |= ((unsigned)reader->data[start + 3] << 24u); + reader->buffer >>= (reader->bp & 7u); + return reader->bp + nbits <= reader->bitsize; + } +} + +/* Get bits without advancing the bit pointer. Must have enough bits available with ensureBits. Max nbits is 31. */ +static unsigned peekBits(LodePNGBitReader* reader, size_t nbits) { + /* The shift allows nbits to be only up to 31. */ + return reader->buffer & ((1u << nbits) - 1u); +} + +/* Must have enough bits available with ensureBits */ +static void advanceBits(LodePNGBitReader* reader, size_t nbits) { + reader->buffer >>= nbits; + reader->bp += nbits; +} + +/* Must have enough bits available with ensureBits */ +static unsigned readBits(LodePNGBitReader* reader, size_t nbits) { + unsigned result = peekBits(reader, nbits); + advanceBits(reader, nbits); + return result; +} + +#if 0 /*Disable because tests fail due to unused declaration*/ +/* Public for testing only. steps and result must have numsteps values. */ +static unsigned lode_png_test_bitreader(const unsigned char* data, size_t size, + size_t numsteps, const size_t* steps, unsigned* result) { + size_t i; + LodePNGBitReader reader; + unsigned error = LodePNGBitReader_init(&reader, data, size); + if(error) return 0; + for(i = 0; i < numsteps; i++) { + size_t step = steps[i]; + unsigned ok; + if(step > 25) ok = ensureBits32(&reader, step); + else if(step > 17) ok = ensureBits25(&reader, step); + else if(step > 9) ok = ensureBits17(&reader, step); + else ok = ensureBits9(&reader, step); + if(!ok) return 0; + result[i] = readBits(&reader, step); + } + return 1; +} +#endif + +#endif /*LODEPNG_COMPILE_DECODER*/ + +static unsigned reverseBits(unsigned bits, unsigned num) { + /*TODO: implement faster lookup table based version when needed*/ + unsigned i, result = 0; + for(i = 0; i < num; i++) result |= ((bits >> (num - i - 1u)) & 1u) << i; + return result; +} + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Deflate - Huffman / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#define FIRST_LENGTH_CODE_INDEX 257 +#define LAST_LENGTH_CODE_INDEX 285 +/*256 literals, the end code, some length codes, and 2 unused codes*/ +#define NUM_DEFLATE_CODE_SYMBOLS 288 +/*the distance codes have their own symbols, 30 used, 2 unused*/ +#define NUM_DISTANCE_SYMBOLS 32 +/*the code length codes. 0-15: code lengths, 16: copy previous 3-6 times, 17: 3-10 zeros, 18: 11-138 zeros*/ +#define NUM_CODE_LENGTH_CODES 19 + +/*the base lengths represented by codes 257-285*/ +static const unsigned LENGTHBASE[29] + = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, + 67, 83, 99, 115, 131, 163, 195, 227, 258}; + +/*the extra bits used by codes 257-285 (added to base length)*/ +static const unsigned LENGTHEXTRA[29] + = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, + 4, 4, 4, 4, 5, 5, 5, 5, 0}; + +/*the base backwards distances (the bits of distance codes appear after length codes and use their own huffman tree)*/ +static const unsigned DISTANCEBASE[30] + = {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, + 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; + +/*the extra bits of backwards distances (added to base)*/ +static const unsigned DISTANCEEXTRA[30] + = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, + 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; + +/*the order in which "code length alphabet code lengths" are stored as specified by deflate, out of this the huffman +tree of the dynamic huffman tree lengths is generated*/ +static const unsigned CLCL_ORDER[NUM_CODE_LENGTH_CODES] + = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + +/* ////////////////////////////////////////////////////////////////////////// */ + +/* +Huffman tree struct, containing multiple representations of the tree +*/ +typedef struct HuffmanTree { + unsigned* codes; /*the huffman codes (bit patterns representing the symbols)*/ + unsigned* lengths; /*the lengths of the huffman codes*/ + unsigned maxbitlen; /*maximum number of bits a single code can get*/ + unsigned numcodes; /*number of symbols in the alphabet = number of codes*/ + /* for reading only */ + unsigned char* table_len; /*length of symbol from lookup table, or max length if secondary lookup needed*/ + unsigned short* table_value; /*value of symbol from lookup table, or pointer to secondary table if needed*/ +} HuffmanTree; + +static void HuffmanTree_init(HuffmanTree* tree) { + tree->codes = 0; + tree->lengths = 0; + tree->table_len = 0; + tree->table_value = 0; +} + +static void HuffmanTree_cleanup(HuffmanTree* tree) { + lodepng_free(tree->codes); + lodepng_free(tree->lengths); + lodepng_free(tree->table_len); + lodepng_free(tree->table_value); +} + +/* amount of bits for first huffman table lookup (aka root bits), see HuffmanTree_makeTable and huffmanDecodeSymbol.*/ +/* values 8u and 9u work the fastest */ +#define FIRSTBITS 9u + +/* a symbol value too big to represent any valid symbol, to indicate reading disallowed huffman bits combination, +which is possible in case of only 0 or 1 present symbols. */ +#define INVALIDSYMBOL 65535u + +/* make table for huffman decoding */ +static unsigned HuffmanTree_makeTable(HuffmanTree* tree) { + static const unsigned headsize = 1u << FIRSTBITS; /*size of the first table*/ + static const unsigned mask = (1u << FIRSTBITS) /*headsize*/ - 1u; + size_t i, numpresent, pointer, size; /*total table size*/ + unsigned* maxlens = (unsigned*)lodepng_malloc(headsize * sizeof(unsigned)); + if(!maxlens) return 83; /*alloc fail*/ + + /* compute maxlens: max total bit length of symbols sharing prefix in the first table*/ + lodepng_memset(maxlens, 0, headsize * sizeof(*maxlens)); + for(i = 0; i < tree->numcodes; i++) { + unsigned symbol = tree->codes[i]; + unsigned l = tree->lengths[i]; + unsigned index; + if(l <= FIRSTBITS) continue; /*symbols that fit in first table don't increase secondary table size*/ + /*get the FIRSTBITS MSBs, the MSBs of the symbol are encoded first. See later comment about the reversing*/ + index = reverseBits(symbol >> (l - FIRSTBITS), FIRSTBITS); + maxlens[index] = LODEPNG_MAX(maxlens[index], l); + } + /* compute total table size: size of first table plus all secondary tables for symbols longer than FIRSTBITS */ + size = headsize; + for(i = 0; i < headsize; ++i) { + unsigned l = maxlens[i]; + if(l > FIRSTBITS) size += (1u << (l - FIRSTBITS)); + } + tree->table_len = (unsigned char*)lodepng_malloc(size * sizeof(*tree->table_len)); + tree->table_value = (unsigned short*)lodepng_malloc(size * sizeof(*tree->table_value)); + if(!tree->table_len || !tree->table_value) { + lodepng_free(maxlens); + /* freeing tree->table values is done at a higher scope */ + return 83; /*alloc fail*/ + } + /*initialize with an invalid length to indicate unused entries*/ + for(i = 0; i < size; ++i) tree->table_len[i] = 16; + + /*fill in the first table for long symbols: max prefix size and pointer to secondary tables*/ + pointer = headsize; + for(i = 0; i < headsize; ++i) { + unsigned l = maxlens[i]; + if(l <= FIRSTBITS) continue; + tree->table_len[i] = l; + tree->table_value[i] = pointer; + pointer += (1u << (l - FIRSTBITS)); + } + lodepng_free(maxlens); + + /*fill in the first table for short symbols, or secondary table for long symbols*/ + numpresent = 0; + for(i = 0; i < tree->numcodes; ++i) { + unsigned l = tree->lengths[i]; + unsigned symbol = tree->codes[i]; /*the huffman bit pattern. i itself is the value.*/ + /*reverse bits, because the huffman bits are given in MSB first order but the bit reader reads LSB first*/ + unsigned reverse = reverseBits(symbol, l); + if(l == 0) continue; + numpresent++; + + if(l <= FIRSTBITS) { + /*short symbol, fully in first table, replicated num times if l < FIRSTBITS*/ + unsigned num = 1u << (FIRSTBITS - l); + unsigned j; + for(j = 0; j < num; ++j) { + /*bit reader will read the l bits of symbol first, the remaining FIRSTBITS - l bits go to the MSB's*/ + unsigned index = reverse | (j << l); + if(tree->table_len[index] != 16) return 55; /*invalid tree: long symbol shares prefix with short symbol*/ + tree->table_len[index] = l; + tree->table_value[index] = i; + } + } else { + /*long symbol, shares prefix with other long symbols in first lookup table, needs second lookup*/ + /*the FIRSTBITS MSBs of the symbol are the first table index*/ + unsigned index = reverse & mask; + unsigned maxlen = tree->table_len[index]; + /*log2 of secondary table length, should be >= l - FIRSTBITS*/ + unsigned tablelen = maxlen - FIRSTBITS; + unsigned start = tree->table_value[index]; /*starting index in secondary table*/ + unsigned num = 1u << (tablelen - (l - FIRSTBITS)); /*amount of entries of this symbol in secondary table*/ + unsigned j; + if(maxlen < l) return 55; /*invalid tree: long symbol shares prefix with short symbol*/ + for(j = 0; j < num; ++j) { + unsigned reverse2 = reverse >> FIRSTBITS; /* l - FIRSTBITS bits */ + unsigned index2 = start + (reverse2 | (j << (l - FIRSTBITS))); + tree->table_len[index2] = l; + tree->table_value[index2] = i; + } + } + } + + if(numpresent < 2) { + /* In case of exactly 1 symbol, in theory the huffman symbol needs 0 bits, + but deflate uses 1 bit instead. In case of 0 symbols, no symbols can + appear at all, but such huffman tree could still exist (e.g. if distance + codes are never used). In both cases, not all symbols of the table will be + filled in. Fill them in with an invalid symbol value so returning them from + huffmanDecodeSymbol will cause error. */ + for(i = 0; i < size; ++i) { + if(tree->table_len[i] == 16) { + /* As length, use a value smaller than FIRSTBITS for the head table, + and a value larger than FIRSTBITS for the secondary table, to ensure + valid behavior for advanceBits when reading this symbol. */ + tree->table_len[i] = (i < headsize) ? 1 : (FIRSTBITS + 1); + tree->table_value[i] = INVALIDSYMBOL; + } + } + } else { + /* A good huffman tree has N * 2 - 1 nodes, of which N - 1 are internal nodes. + If that is not the case (due to too long length codes), the table will not + have been fully used, and this is an error (not all bit combinations can be + decoded): an oversubscribed huffman tree, indicated by error 55. */ + for(i = 0; i < size; ++i) { + if(tree->table_len[i] == 16) return 55; + } + } + + return 0; +} + +/* +Second step for the ...makeFromLengths and ...makeFromFrequencies functions. +numcodes, lengths and maxbitlen must already be filled in correctly. return +value is error. +*/ +static unsigned HuffmanTree_makeFromLengths2(HuffmanTree* tree) { + unsigned* blcount; + unsigned* nextcode; + unsigned error = 0; + unsigned bits, n; + + tree->codes = (unsigned*)lodepng_malloc(tree->numcodes * sizeof(unsigned)); + blcount = (unsigned*)lodepng_malloc((tree->maxbitlen + 1) * sizeof(unsigned)); + nextcode = (unsigned*)lodepng_malloc((tree->maxbitlen + 1) * sizeof(unsigned)); + if(!tree->codes || !blcount || !nextcode) error = 83; /*alloc fail*/ + + if(!error) { + for(n = 0; n != tree->maxbitlen + 1; n++) blcount[n] = nextcode[n] = 0; + /*step 1: count number of instances of each code length*/ + for(bits = 0; bits != tree->numcodes; ++bits) ++blcount[tree->lengths[bits]]; + /*step 2: generate the nextcode values*/ + for(bits = 1; bits <= tree->maxbitlen; ++bits) { + nextcode[bits] = (nextcode[bits - 1] + blcount[bits - 1]) << 1u; + } + /*step 3: generate all the codes*/ + for(n = 0; n != tree->numcodes; ++n) { + if(tree->lengths[n] != 0) { + tree->codes[n] = nextcode[tree->lengths[n]]++; + /*remove superfluous bits from the code*/ + tree->codes[n] &= ((1u << tree->lengths[n]) - 1u); + } + } + } + + lodepng_free(blcount); + lodepng_free(nextcode); + + if(!error) error = HuffmanTree_makeTable(tree); + return error; +} + +/* +given the code lengths (as stored in the PNG file), generate the tree as defined +by Deflate. maxbitlen is the maximum bits that a code in the tree can have. +return value is error. +*/ +static unsigned HuffmanTree_makeFromLengths(HuffmanTree* tree, const unsigned* bitlen, + size_t numcodes, unsigned maxbitlen) { + unsigned i; + tree->lengths = (unsigned*)lodepng_malloc(numcodes * sizeof(unsigned)); + if(!tree->lengths) return 83; /*alloc fail*/ + for(i = 0; i != numcodes; ++i) tree->lengths[i] = bitlen[i]; + tree->numcodes = (unsigned)numcodes; /*number of symbols*/ + tree->maxbitlen = maxbitlen; + return HuffmanTree_makeFromLengths2(tree); +} + +#ifdef LODEPNG_COMPILE_ENCODER + +/*BPM: Boundary Package Merge, see "A Fast and Space-Economical Algorithm for Length-Limited Coding", +Jyrki Katajainen, Alistair Moffat, Andrew Turpin, 1995.*/ + +/*chain node for boundary package merge*/ +typedef struct BPMNode { + int weight; /*the sum of all weights in this chain*/ + unsigned index; /*index of this leaf node (called "count" in the paper)*/ + struct BPMNode* tail; /*the next nodes in this chain (null if last)*/ + int in_use; +} BPMNode; + +/*lists of chains*/ +typedef struct BPMLists { + /*memory pool*/ + unsigned memsize; + BPMNode* memory; + unsigned numfree; + unsigned nextfree; + BPMNode** freelist; + /*two heads of lookahead chains per list*/ + unsigned listsize; + BPMNode** chains0; + BPMNode** chains1; +} BPMLists; + +/*creates a new chain node with the given parameters, from the memory in the lists */ +static BPMNode* bpmnode_create(BPMLists* lists, int weight, unsigned index, BPMNode* tail) { + unsigned i; + BPMNode* result; + + /*memory full, so garbage collect*/ + if(lists->nextfree >= lists->numfree) { + /*mark only those that are in use*/ + for(i = 0; i != lists->memsize; ++i) lists->memory[i].in_use = 0; + for(i = 0; i != lists->listsize; ++i) { + BPMNode* node; + for(node = lists->chains0[i]; node != 0; node = node->tail) node->in_use = 1; + for(node = lists->chains1[i]; node != 0; node = node->tail) node->in_use = 1; + } + /*collect those that are free*/ + lists->numfree = 0; + for(i = 0; i != lists->memsize; ++i) { + if(!lists->memory[i].in_use) lists->freelist[lists->numfree++] = &lists->memory[i]; + } + lists->nextfree = 0; + } + + result = lists->freelist[lists->nextfree++]; + result->weight = weight; + result->index = index; + result->tail = tail; + return result; +} + +/*sort the leaves with stable mergesort*/ +static void bpmnode_sort(BPMNode* leaves, size_t num) { + BPMNode* mem = (BPMNode*)lodepng_malloc(sizeof(*leaves) * num); + size_t width, counter = 0; + for(width = 1; width < num; width *= 2) { + BPMNode* a = (counter & 1) ? mem : leaves; + BPMNode* b = (counter & 1) ? leaves : mem; + size_t p; + for(p = 0; p < num; p += 2 * width) { + size_t q = (p + width > num) ? num : (p + width); + size_t r = (p + 2 * width > num) ? num : (p + 2 * width); + size_t i = p, j = q, k; + for(k = p; k < r; k++) { + if(i < q && (j >= r || a[i].weight <= a[j].weight)) b[k] = a[i++]; + else b[k] = a[j++]; + } + } + counter++; + } + if(counter & 1) lodepng_memcpy(leaves, mem, sizeof(*leaves) * num); + lodepng_free(mem); +} + +/*Boundary Package Merge step, numpresent is the amount of leaves, and c is the current chain.*/ +static void boundaryPM(BPMLists* lists, BPMNode* leaves, size_t numpresent, int c, int num) { + unsigned lastindex = lists->chains1[c]->index; + + if(c == 0) { + if(lastindex >= numpresent) return; + lists->chains0[c] = lists->chains1[c]; + lists->chains1[c] = bpmnode_create(lists, leaves[lastindex].weight, lastindex + 1, 0); + } else { + /*sum of the weights of the head nodes of the previous lookahead chains.*/ + int sum = lists->chains0[c - 1]->weight + lists->chains1[c - 1]->weight; + lists->chains0[c] = lists->chains1[c]; + if(lastindex < numpresent && sum > leaves[lastindex].weight) { + lists->chains1[c] = bpmnode_create(lists, leaves[lastindex].weight, lastindex + 1, lists->chains1[c]->tail); + return; + } + lists->chains1[c] = bpmnode_create(lists, sum, lastindex, lists->chains1[c - 1]); + /*in the end we are only interested in the chain of the last list, so no + need to recurse if we're at the last one (this gives measurable speedup)*/ + if(num + 1 < (int)(2 * numpresent - 2)) { + boundaryPM(lists, leaves, numpresent, c - 1, num); + boundaryPM(lists, leaves, numpresent, c - 1, num); + } + } +} + +unsigned lodepng_huffman_code_lengths(unsigned* lengths, const unsigned* frequencies, + size_t numcodes, unsigned maxbitlen) { + unsigned error = 0; + unsigned i; + size_t numpresent = 0; /*number of symbols with non-zero frequency*/ + BPMNode* leaves; /*the symbols, only those with > 0 frequency*/ + + if(numcodes == 0) return 80; /*error: a tree of 0 symbols is not supposed to be made*/ + if((1u << maxbitlen) < (unsigned)numcodes) return 80; /*error: represent all symbols*/ + + leaves = (BPMNode*)lodepng_malloc(numcodes * sizeof(*leaves)); + if(!leaves) return 83; /*alloc fail*/ + + for(i = 0; i != numcodes; ++i) { + if(frequencies[i] > 0) { + leaves[numpresent].weight = (int)frequencies[i]; + leaves[numpresent].index = i; + ++numpresent; + } + } + + lodepng_memset(lengths, 0, numcodes * sizeof(*lengths)); + + /*ensure at least two present symbols. There should be at least one symbol + according to RFC 1951 section 3.2.7. Some decoders incorrectly require two. To + make these work as well ensure there are at least two symbols. The + Package-Merge code below also doesn't work correctly if there's only one + symbol, it'd give it the theoretical 0 bits but in practice zlib wants 1 bit*/ + if(numpresent == 0) { + lengths[0] = lengths[1] = 1; /*note that for RFC 1951 section 3.2.7, only lengths[0] = 1 is needed*/ + } else if(numpresent == 1) { + lengths[leaves[0].index] = 1; + lengths[leaves[0].index == 0 ? 1 : 0] = 1; + } else { + BPMLists lists; + BPMNode* node; + + bpmnode_sort(leaves, numpresent); + + lists.listsize = maxbitlen; + lists.memsize = 2 * maxbitlen * (maxbitlen + 1); + lists.nextfree = 0; + lists.numfree = lists.memsize; + lists.memory = (BPMNode*)lodepng_malloc(lists.memsize * sizeof(*lists.memory)); + lists.freelist = (BPMNode**)lodepng_malloc(lists.memsize * sizeof(BPMNode*)); + lists.chains0 = (BPMNode**)lodepng_malloc(lists.listsize * sizeof(BPMNode*)); + lists.chains1 = (BPMNode**)lodepng_malloc(lists.listsize * sizeof(BPMNode*)); + if(!lists.memory || !lists.freelist || !lists.chains0 || !lists.chains1) error = 83; /*alloc fail*/ + + if(!error) { + for(i = 0; i != lists.memsize; ++i) lists.freelist[i] = &lists.memory[i]; + + bpmnode_create(&lists, leaves[0].weight, 1, 0); + bpmnode_create(&lists, leaves[1].weight, 2, 0); + + for(i = 0; i != lists.listsize; ++i) { + lists.chains0[i] = &lists.memory[0]; + lists.chains1[i] = &lists.memory[1]; + } + + /*each boundaryPM call adds one chain to the last list, and we need 2 * numpresent - 2 chains.*/ + for(i = 2; i != 2 * numpresent - 2; ++i) boundaryPM(&lists, leaves, numpresent, (int)maxbitlen - 1, (int)i); + + for(node = lists.chains1[maxbitlen - 1]; node; node = node->tail) { + for(i = 0; i != node->index; ++i) ++lengths[leaves[i].index]; + } + } + + lodepng_free(lists.memory); + lodepng_free(lists.freelist); + lodepng_free(lists.chains0); + lodepng_free(lists.chains1); + } + + lodepng_free(leaves); + return error; +} + +/*Create the Huffman tree given the symbol frequencies*/ +static unsigned HuffmanTree_makeFromFrequencies(HuffmanTree* tree, const unsigned* frequencies, + size_t mincodes, size_t numcodes, unsigned maxbitlen) { + unsigned error = 0; + while(!frequencies[numcodes - 1] && numcodes > mincodes) --numcodes; /*trim zeroes*/ + tree->lengths = (unsigned*)lodepng_malloc(numcodes * sizeof(unsigned)); + if(!tree->lengths) return 83; /*alloc fail*/ + tree->maxbitlen = maxbitlen; + tree->numcodes = (unsigned)numcodes; /*number of symbols*/ + + error = lodepng_huffman_code_lengths(tree->lengths, frequencies, numcodes, maxbitlen); + if(!error) error = HuffmanTree_makeFromLengths2(tree); + return error; +} +#endif /*LODEPNG_COMPILE_ENCODER*/ + +/*get the literal and length code tree of a deflated block with fixed tree, as per the deflate specification*/ +static unsigned generateFixedLitLenTree(HuffmanTree* tree) { + unsigned i, error = 0; + unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DEFLATE_CODE_SYMBOLS * sizeof(unsigned)); + if(!bitlen) return 83; /*alloc fail*/ + + /*288 possible codes: 0-255=literals, 256=endcode, 257-285=lengthcodes, 286-287=unused*/ + for(i = 0; i <= 143; ++i) bitlen[i] = 8; + for(i = 144; i <= 255; ++i) bitlen[i] = 9; + for(i = 256; i <= 279; ++i) bitlen[i] = 7; + for(i = 280; i <= 287; ++i) bitlen[i] = 8; + + error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DEFLATE_CODE_SYMBOLS, 15); + + lodepng_free(bitlen); + return error; +} + +/*get the distance code tree of a deflated block with fixed tree, as specified in the deflate specification*/ +static unsigned generateFixedDistanceTree(HuffmanTree* tree) { + unsigned i, error = 0; + unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); + if(!bitlen) return 83; /*alloc fail*/ + + /*there are 32 distance codes, but 30-31 are unused*/ + for(i = 0; i != NUM_DISTANCE_SYMBOLS; ++i) bitlen[i] = 5; + error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DISTANCE_SYMBOLS, 15); + + lodepng_free(bitlen); + return error; +} + +#ifdef LODEPNG_COMPILE_DECODER + +/* +returns the code. The bit reader must already have been ensured at least 15 bits +*/ +static unsigned huffmanDecodeSymbol(LodePNGBitReader* reader, const HuffmanTree* codetree) { + unsigned short code = peekBits(reader, FIRSTBITS); + unsigned short l = codetree->table_len[code]; + unsigned short value = codetree->table_value[code]; + if(l <= FIRSTBITS) { + advanceBits(reader, l); + return value; + } else { + unsigned index2; + advanceBits(reader, FIRSTBITS); + index2 = value + peekBits(reader, l - FIRSTBITS); + advanceBits(reader, codetree->table_len[index2] - FIRSTBITS); + return codetree->table_value[index2]; + } +} +#endif /*LODEPNG_COMPILE_DECODER*/ + +#ifdef LODEPNG_COMPILE_DECODER + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Inflator (Decompressor) / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +/*get the tree of a deflated block with fixed tree, as specified in the deflate specification +Returns error code.*/ +static unsigned getTreeInflateFixed(HuffmanTree* tree_ll, HuffmanTree* tree_d) { + unsigned error = generateFixedLitLenTree(tree_ll); + if(error) return error; + return generateFixedDistanceTree(tree_d); +} + +/*get the tree of a deflated block with dynamic tree, the tree itself is also Huffman compressed with a known tree*/ +static unsigned getTreeInflateDynamic(HuffmanTree* tree_ll, HuffmanTree* tree_d, + LodePNGBitReader* reader) { + /*make sure that length values that aren't filled in will be 0, or a wrong tree will be generated*/ + unsigned error = 0; + unsigned n, HLIT, HDIST, HCLEN, i; + + /*see comments in deflateDynamic for explanation of the context and these variables, it is analogous*/ + unsigned* bitlen_ll = 0; /*lit,len code lengths*/ + unsigned* bitlen_d = 0; /*dist code lengths*/ + /*code length code lengths ("clcl"), the bit lengths of the huffman tree used to compress bitlen_ll and bitlen_d*/ + unsigned* bitlen_cl = 0; + HuffmanTree tree_cl; /*the code tree for code length codes (the huffman tree for compressed huffman trees)*/ + + if(!ensureBits17(reader, 14)) return 49; /*error: the bit pointer is or will go past the memory*/ + + /*number of literal/length codes + 257. Unlike the spec, the value 257 is added to it here already*/ + HLIT = readBits(reader, 5) + 257; + /*number of distance codes. Unlike the spec, the value 1 is added to it here already*/ + HDIST = readBits(reader, 5) + 1; + /*number of code length codes. Unlike the spec, the value 4 is added to it here already*/ + HCLEN = readBits(reader, 4) + 4; + + bitlen_cl = (unsigned*)lodepng_malloc(NUM_CODE_LENGTH_CODES * sizeof(unsigned)); + if(!bitlen_cl) return 83 /*alloc fail*/; + + HuffmanTree_init(&tree_cl); + + while(!error) { + /*read the code length codes out of 3 * (amount of code length codes) bits*/ + if(lodepng_gtofl(reader->bp, HCLEN * 3, reader->bitsize)) { + ERROR_BREAK(50); /*error: the bit pointer is or will go past the memory*/ + } + for(i = 0; i != HCLEN; ++i) { + ensureBits9(reader, 3); /*out of bounds already checked above */ + bitlen_cl[CLCL_ORDER[i]] = readBits(reader, 3); + } + for(i = HCLEN; i != NUM_CODE_LENGTH_CODES; ++i) { + bitlen_cl[CLCL_ORDER[i]] = 0; + } + + error = HuffmanTree_makeFromLengths(&tree_cl, bitlen_cl, NUM_CODE_LENGTH_CODES, 7); + if(error) break; + + /*now we can use this tree to read the lengths for the tree that this function will return*/ + bitlen_ll = (unsigned*)lodepng_malloc(NUM_DEFLATE_CODE_SYMBOLS * sizeof(unsigned)); + bitlen_d = (unsigned*)lodepng_malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); + if(!bitlen_ll || !bitlen_d) ERROR_BREAK(83 /*alloc fail*/); + lodepng_memset(bitlen_ll, 0, NUM_DEFLATE_CODE_SYMBOLS * sizeof(*bitlen_ll)); + lodepng_memset(bitlen_d, 0, NUM_DISTANCE_SYMBOLS * sizeof(*bitlen_d)); + + /*i is the current symbol we're reading in the part that contains the code lengths of lit/len and dist codes*/ + i = 0; + while(i < HLIT + HDIST) { + unsigned code; + ensureBits25(reader, 22); /* up to 15 bits for huffman code, up to 7 extra bits below*/ + code = huffmanDecodeSymbol(reader, &tree_cl); + if(code <= 15) /*a length code*/ { + if(i < HLIT) bitlen_ll[i] = code; + else bitlen_d[i - HLIT] = code; + ++i; + } else if(code == 16) /*repeat previous*/ { + unsigned replength = 3; /*read in the 2 bits that indicate repeat length (3-6)*/ + unsigned value; /*set value to the previous code*/ + + if(i == 0) ERROR_BREAK(54); /*can't repeat previous if i is 0*/ + + replength += readBits(reader, 2); + + if(i < HLIT + 1) value = bitlen_ll[i - 1]; + else value = bitlen_d[i - HLIT - 1]; + /*repeat this value in the next lengths*/ + for(n = 0; n < replength; ++n) { + if(i >= HLIT + HDIST) ERROR_BREAK(13); /*error: i is larger than the amount of codes*/ + if(i < HLIT) bitlen_ll[i] = value; + else bitlen_d[i - HLIT] = value; + ++i; + } + } else if(code == 17) /*repeat "0" 3-10 times*/ { + unsigned replength = 3; /*read in the bits that indicate repeat length*/ + replength += readBits(reader, 3); + + /*repeat this value in the next lengths*/ + for(n = 0; n < replength; ++n) { + if(i >= HLIT + HDIST) ERROR_BREAK(14); /*error: i is larger than the amount of codes*/ + + if(i < HLIT) bitlen_ll[i] = 0; + else bitlen_d[i - HLIT] = 0; + ++i; + } + } else if(code == 18) /*repeat "0" 11-138 times*/ { + unsigned replength = 11; /*read in the bits that indicate repeat length*/ + replength += readBits(reader, 7); + + /*repeat this value in the next lengths*/ + for(n = 0; n < replength; ++n) { + if(i >= HLIT + HDIST) ERROR_BREAK(15); /*error: i is larger than the amount of codes*/ + + if(i < HLIT) bitlen_ll[i] = 0; + else bitlen_d[i - HLIT] = 0; + ++i; + } + } else /*if(code == INVALIDSYMBOL)*/ { + ERROR_BREAK(16); /*error: tried to read disallowed huffman symbol*/ + } + /*check if any of the ensureBits above went out of bounds*/ + if(reader->bp > reader->bitsize) { + /*return error code 10 or 11 depending on the situation that happened in huffmanDecodeSymbol + (10=no endcode, 11=wrong jump outside of tree)*/ + /* TODO: revise error codes 10,11,50: the above comment is no longer valid */ + ERROR_BREAK(50); /*error, bit pointer jumps past memory*/ + } + } + if(error) break; + + if(bitlen_ll[256] == 0) ERROR_BREAK(64); /*the length of the end code 256 must be larger than 0*/ + + /*now we've finally got HLIT and HDIST, so generate the code trees, and the function is done*/ + error = HuffmanTree_makeFromLengths(tree_ll, bitlen_ll, NUM_DEFLATE_CODE_SYMBOLS, 15); + if(error) break; + error = HuffmanTree_makeFromLengths(tree_d, bitlen_d, NUM_DISTANCE_SYMBOLS, 15); + + break; /*end of error-while*/ + } + + lodepng_free(bitlen_cl); + lodepng_free(bitlen_ll); + lodepng_free(bitlen_d); + HuffmanTree_cleanup(&tree_cl); + + return error; +} + +/*inflate a block with dynamic of fixed Huffman tree. btype must be 1 or 2.*/ +static unsigned inflateHuffmanBlock(ucvector* out, LodePNGBitReader* reader, + unsigned btype, size_t max_output_size) { + unsigned error = 0; + HuffmanTree tree_ll; /*the huffman tree for literal and length codes*/ + HuffmanTree tree_d; /*the huffman tree for distance codes*/ + + HuffmanTree_init(&tree_ll); + HuffmanTree_init(&tree_d); + + if(btype == 1) error = getTreeInflateFixed(&tree_ll, &tree_d); + else /*if(btype == 2)*/ error = getTreeInflateDynamic(&tree_ll, &tree_d, reader); + + while(!error) /*decode all symbols until end reached, breaks at end code*/ { + /*code_ll is literal, length or end code*/ + unsigned code_ll; + ensureBits25(reader, 20); /* up to 15 for the huffman symbol, up to 5 for the length extra bits */ + code_ll = huffmanDecodeSymbol(reader, &tree_ll); + if(code_ll <= 255) /*literal symbol*/ { + if(!ucvector_resize(out, out->size + 1)) ERROR_BREAK(83 /*alloc fail*/); + out->data[out->size - 1] = (unsigned char)code_ll; + } else if(code_ll >= FIRST_LENGTH_CODE_INDEX && code_ll <= LAST_LENGTH_CODE_INDEX) /*length code*/ { + unsigned code_d, distance; + unsigned numextrabits_l, numextrabits_d; /*extra bits for length and distance*/ + size_t start, backward, length; + + /*part 1: get length base*/ + length = LENGTHBASE[code_ll - FIRST_LENGTH_CODE_INDEX]; + + /*part 2: get extra bits and add the value of that to length*/ + numextrabits_l = LENGTHEXTRA[code_ll - FIRST_LENGTH_CODE_INDEX]; + if(numextrabits_l != 0) { + /* bits already ensured above */ + length += readBits(reader, numextrabits_l); + } + + /*part 3: get distance code*/ + ensureBits32(reader, 28); /* up to 15 for the huffman symbol, up to 13 for the extra bits */ + code_d = huffmanDecodeSymbol(reader, &tree_d); + if(code_d > 29) { + if(code_d <= 31) { + ERROR_BREAK(18); /*error: invalid distance code (30-31 are never used)*/ + } else /* if(code_d == INVALIDSYMBOL) */{ + ERROR_BREAK(16); /*error: tried to read disallowed huffman symbol*/ + } + } + distance = DISTANCEBASE[code_d]; + + /*part 4: get extra bits from distance*/ + numextrabits_d = DISTANCEEXTRA[code_d]; + if(numextrabits_d != 0) { + /* bits already ensured above */ + distance += readBits(reader, numextrabits_d); + } + + /*part 5: fill in all the out[n] values based on the length and dist*/ + start = out->size; + if(distance > start) ERROR_BREAK(52); /*too long backward distance*/ + backward = start - distance; + + if(!ucvector_resize(out, out->size + length)) ERROR_BREAK(83 /*alloc fail*/); + if(distance < length) { + size_t forward; + lodepng_memcpy(out->data + start, out->data + backward, distance); + start += distance; + for(forward = distance; forward < length; ++forward) { + out->data[start++] = out->data[backward++]; + } + } else { + lodepng_memcpy(out->data + start, out->data + backward, length); + } + } else if(code_ll == 256) { + break; /*end code, break the loop*/ + } else /*if(code_ll == INVALIDSYMBOL)*/ { + ERROR_BREAK(16); /*error: tried to read disallowed huffman symbol*/ + } + /*check if any of the ensureBits above went out of bounds*/ + if(reader->bp > reader->bitsize) { + /*return error code 10 or 11 depending on the situation that happened in huffmanDecodeSymbol + (10=no endcode, 11=wrong jump outside of tree)*/ + /* TODO: revise error codes 10,11,50: the above comment is no longer valid */ + ERROR_BREAK(51); /*error, bit pointer jumps past memory*/ + } + if(max_output_size && out->size > max_output_size) { + ERROR_BREAK(109); /*error, larger than max size*/ + } + } + + HuffmanTree_cleanup(&tree_ll); + HuffmanTree_cleanup(&tree_d); + + return error; +} + +static unsigned inflateNoCompression(ucvector* out, LodePNGBitReader* reader, + const LodePNGDecompressSettings* settings) { + size_t bytepos; + size_t size = reader->size; + unsigned LEN, NLEN, error = 0; + + /*go to first boundary of byte*/ + bytepos = (reader->bp + 7u) >> 3u; + + /*read LEN (2 bytes) and NLEN (2 bytes)*/ + if(bytepos + 4 >= size) return 52; /*error, bit pointer will jump past memory*/ + LEN = (unsigned)reader->data[bytepos] + ((unsigned)reader->data[bytepos + 1] << 8u); bytepos += 2; + NLEN = (unsigned)reader->data[bytepos] + ((unsigned)reader->data[bytepos + 1] << 8u); bytepos += 2; + + /*check if 16-bit NLEN is really the one's complement of LEN*/ + if(!settings->ignore_nlen && LEN + NLEN != 65535) { + return 21; /*error: NLEN is not one's complement of LEN*/ + } + + if(!ucvector_resize(out, out->size + LEN)) return 83; /*alloc fail*/ + + /*read the literal data: LEN bytes are now stored in the out buffer*/ + if(bytepos + LEN > size) return 23; /*error: reading outside of in buffer*/ + + lodepng_memcpy(out->data + out->size - LEN, reader->data + bytepos, LEN); + bytepos += LEN; + + reader->bp = bytepos << 3u; + + return error; +} + +static unsigned lodepng_inflatev(ucvector* out, + const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings) { + unsigned BFINAL = 0; + LodePNGBitReader reader; + unsigned error = LodePNGBitReader_init(&reader, in, insize); + + if(error) return error; + + while(!BFINAL) { + unsigned BTYPE; + if(!ensureBits9(&reader, 3)) return 52; /*error, bit pointer will jump past memory*/ + BFINAL = readBits(&reader, 1); + BTYPE = readBits(&reader, 2); + + if(BTYPE == 3) return 20; /*error: invalid BTYPE*/ + else if(BTYPE == 0) error = inflateNoCompression(out, &reader, settings); /*no compression*/ + else error = inflateHuffmanBlock(out, &reader, BTYPE, settings->max_output_size); /*compression, BTYPE 01 or 10*/ + if(!error && settings->max_output_size && out->size > settings->max_output_size) error = 109; + if(error) break; + } + + return error; +} + +unsigned lodepng_inflate(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings) { + ucvector v = ucvector_init(*out, *outsize); + unsigned error = lodepng_inflatev(&v, in, insize, settings); + *out = v.data; + *outsize = v.size; + return error; +} + +static unsigned inflatev(ucvector* out, const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings) { + if(settings->custom_inflate) { + unsigned error = settings->custom_inflate(&out->data, &out->size, in, insize, settings); + out->allocsize = out->size; + if(error) { + /*the custom inflate is allowed to have its own error codes, however, we translate it to code 110*/ + error = 110; + /*if there's a max output size, and the custom zlib returned error, then indicate that error instead*/ + if(settings->max_output_size && out->size > settings->max_output_size) error = 109; + } + return error; + } else { + return lodepng_inflatev(out, in, insize, settings); + } +} + +#endif /*LODEPNG_COMPILE_DECODER*/ + +#ifdef LODEPNG_COMPILE_ENCODER + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Deflator (Compressor) / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +static const size_t MAX_SUPPORTED_DEFLATE_LENGTH = 258; + +/*search the index in the array, that has the largest value smaller than or equal to the given value, +given array must be sorted (if no value is smaller, it returns the size of the given array)*/ +static size_t searchCodeIndex(const unsigned* array, size_t array_size, size_t value) { + /*binary search (only small gain over linear). TODO: use CPU log2 instruction for getting symbols instead*/ + size_t left = 1; + size_t right = array_size - 1; + + while(left <= right) { + size_t mid = (left + right) >> 1; + if(array[mid] >= value) right = mid - 1; + else left = mid + 1; + } + if(left >= array_size || array[left] > value) left--; + return left; +} + +static void addLengthDistance(uivector* values, size_t length, size_t distance) { + /*values in encoded vector are those used by deflate: + 0-255: literal bytes + 256: end + 257-285: length/distance pair (length code, followed by extra length bits, distance code, extra distance bits) + 286-287: invalid*/ + + unsigned length_code = (unsigned)searchCodeIndex(LENGTHBASE, 29, length); + unsigned extra_length = (unsigned)(length - LENGTHBASE[length_code]); + unsigned dist_code = (unsigned)searchCodeIndex(DISTANCEBASE, 30, distance); + unsigned extra_distance = (unsigned)(distance - DISTANCEBASE[dist_code]); + + size_t pos = values->size; + /*TODO: return error when this fails (out of memory)*/ + unsigned ok = uivector_resize(values, values->size + 4); + if(ok) { + values->data[pos + 0] = length_code + FIRST_LENGTH_CODE_INDEX; + values->data[pos + 1] = extra_length; + values->data[pos + 2] = dist_code; + values->data[pos + 3] = extra_distance; + } +} + +/*3 bytes of data get encoded into two bytes. The hash cannot use more than 3 +bytes as input because 3 is the minimum match length for deflate*/ +static const unsigned HASH_NUM_VALUES = 65536; +static const unsigned HASH_BIT_MASK = 65535; /*HASH_NUM_VALUES - 1, but C90 does not like that as initializer*/ + +typedef struct Hash { + int* head; /*hash value to head circular pos - can be outdated if went around window*/ + /*circular pos to prev circular pos*/ + unsigned short* chain; + int* val; /*circular pos to hash value*/ + + /*TODO: do this not only for zeros but for any repeated byte. However for PNG + it's always going to be the zeros that dominate, so not important for PNG*/ + int* headz; /*similar to head, but for chainz*/ + unsigned short* chainz; /*those with same amount of zeros*/ + unsigned short* zeros; /*length of zeros streak, used as a second hash chain*/ +} Hash; + +static unsigned hash_init(Hash* hash, unsigned windowsize) { + unsigned i; + hash->head = (int*)lodepng_malloc(sizeof(int) * HASH_NUM_VALUES); + hash->val = (int*)lodepng_malloc(sizeof(int) * windowsize); + hash->chain = (unsigned short*)lodepng_malloc(sizeof(unsigned short) * windowsize); + + hash->zeros = (unsigned short*)lodepng_malloc(sizeof(unsigned short) * windowsize); + hash->headz = (int*)lodepng_malloc(sizeof(int) * (MAX_SUPPORTED_DEFLATE_LENGTH + 1)); + hash->chainz = (unsigned short*)lodepng_malloc(sizeof(unsigned short) * windowsize); + + if(!hash->head || !hash->chain || !hash->val || !hash->headz|| !hash->chainz || !hash->zeros) { + return 83; /*alloc fail*/ + } + + /*initialize hash table*/ + for(i = 0; i != HASH_NUM_VALUES; ++i) hash->head[i] = -1; + for(i = 0; i != windowsize; ++i) hash->val[i] = -1; + for(i = 0; i != windowsize; ++i) hash->chain[i] = i; /*same value as index indicates uninitialized*/ + + for(i = 0; i <= MAX_SUPPORTED_DEFLATE_LENGTH; ++i) hash->headz[i] = -1; + for(i = 0; i != windowsize; ++i) hash->chainz[i] = i; /*same value as index indicates uninitialized*/ + + return 0; +} + +static void hash_cleanup(Hash* hash) { + lodepng_free(hash->head); + lodepng_free(hash->val); + lodepng_free(hash->chain); + + lodepng_free(hash->zeros); + lodepng_free(hash->headz); + lodepng_free(hash->chainz); +} + + + +static unsigned getHash(const unsigned char* data, size_t size, size_t pos) { + unsigned result = 0; + if(pos + 2 < size) { + /*A simple shift and xor hash is used. Since the data of PNGs is dominated + by zeroes due to the filters, a better hash does not have a significant + effect on speed in traversing the chain, and causes more time spend on + calculating the hash.*/ + result ^= ((unsigned)data[pos + 0] << 0u); + result ^= ((unsigned)data[pos + 1] << 4u); + result ^= ((unsigned)data[pos + 2] << 8u); + } else { + size_t amount, i; + if(pos >= size) return 0; + amount = size - pos; + for(i = 0; i != amount; ++i) result ^= ((unsigned)data[pos + i] << (i * 8u)); + } + return result & HASH_BIT_MASK; +} + +static unsigned countZeros(const unsigned char* data, size_t size, size_t pos) { + const unsigned char* start = data + pos; + const unsigned char* end = start + MAX_SUPPORTED_DEFLATE_LENGTH; + if(end > data + size) end = data + size; + data = start; + while(data != end && *data == 0) ++data; + /*subtracting two addresses returned as 32-bit number (max value is MAX_SUPPORTED_DEFLATE_LENGTH)*/ + return (unsigned)(data - start); +} + +/*wpos = pos & (windowsize - 1)*/ +static void updateHashChain(Hash* hash, size_t wpos, unsigned hashval, unsigned short numzeros) { + hash->val[wpos] = (int)hashval; + if(hash->head[hashval] != -1) hash->chain[wpos] = hash->head[hashval]; + hash->head[hashval] = (int)wpos; + + hash->zeros[wpos] = numzeros; + if(hash->headz[numzeros] != -1) hash->chainz[wpos] = hash->headz[numzeros]; + hash->headz[numzeros] = (int)wpos; +} + +/* +LZ77-encode the data. Return value is error code. The input are raw bytes, the output +is in the form of unsigned integers with codes representing for example literal bytes, or +length/distance pairs. +It uses a hash table technique to let it encode faster. When doing LZ77 encoding, a +sliding window (of windowsize) is used, and all past bytes in that window can be used as +the "dictionary". A brute force search through all possible distances would be slow, and +this hash technique is one out of several ways to speed this up. +*/ +static unsigned encodeLZ77(uivector* out, Hash* hash, + const unsigned char* in, size_t inpos, size_t insize, unsigned windowsize, + unsigned minmatch, unsigned nicematch, unsigned lazymatching) { + size_t pos; + unsigned i, error = 0; + /*for large window lengths, assume the user wants no compression loss. Otherwise, max hash chain length speedup.*/ + unsigned maxchainlength = windowsize >= 8192 ? windowsize : windowsize / 8u; + unsigned maxlazymatch = windowsize >= 8192 ? MAX_SUPPORTED_DEFLATE_LENGTH : 64; + + unsigned usezeros = 1; /*not sure if setting it to false for windowsize < 8192 is better or worse*/ + unsigned numzeros = 0; + + unsigned offset; /*the offset represents the distance in LZ77 terminology*/ + unsigned length; + unsigned lazy = 0; + unsigned lazylength = 0, lazyoffset = 0; + unsigned hashval; + unsigned current_offset, current_length; + unsigned prev_offset; + const unsigned char *lastptr, *foreptr, *backptr; + unsigned hashpos; + + if(windowsize == 0 || windowsize > 32768) return 60; /*error: windowsize smaller/larger than allowed*/ + if((windowsize & (windowsize - 1)) != 0) return 90; /*error: must be power of two*/ + + if(nicematch > MAX_SUPPORTED_DEFLATE_LENGTH) nicematch = MAX_SUPPORTED_DEFLATE_LENGTH; + + for(pos = inpos; pos < insize; ++pos) { + size_t wpos = pos & (windowsize - 1); /*position for in 'circular' hash buffers*/ + unsigned chainlength = 0; + + hashval = getHash(in, insize, pos); + + if(usezeros && hashval == 0) { + if(numzeros == 0) numzeros = countZeros(in, insize, pos); + else if(pos + numzeros > insize || in[pos + numzeros - 1] != 0) --numzeros; + } else { + numzeros = 0; + } + + updateHashChain(hash, wpos, hashval, numzeros); + + /*the length and offset found for the current position*/ + length = 0; + offset = 0; + + hashpos = hash->chain[wpos]; + + lastptr = &in[insize < pos + MAX_SUPPORTED_DEFLATE_LENGTH ? insize : pos + MAX_SUPPORTED_DEFLATE_LENGTH]; + + /*search for the longest string*/ + prev_offset = 0; + for(;;) { + if(chainlength++ >= maxchainlength) break; + current_offset = (unsigned)(hashpos <= wpos ? wpos - hashpos : wpos - hashpos + windowsize); + + if(current_offset < prev_offset) break; /*stop when went completely around the circular buffer*/ + prev_offset = current_offset; + if(current_offset > 0) { + /*test the next characters*/ + foreptr = &in[pos]; + backptr = &in[pos - current_offset]; + + /*common case in PNGs is lots of zeros. Quickly skip over them as a speedup*/ + if(numzeros >= 3) { + unsigned skip = hash->zeros[hashpos]; + if(skip > numzeros) skip = numzeros; + backptr += skip; + foreptr += skip; + } + + while(foreptr != lastptr && *backptr == *foreptr) /*maximum supported length by deflate is max length*/ { + ++backptr; + ++foreptr; + } + current_length = (unsigned)(foreptr - &in[pos]); + + if(current_length > length) { + length = current_length; /*the longest length*/ + offset = current_offset; /*the offset that is related to this longest length*/ + /*jump out once a length of max length is found (speed gain). This also jumps + out if length is MAX_SUPPORTED_DEFLATE_LENGTH*/ + if(current_length >= nicematch) break; + } + } + + if(hashpos == hash->chain[hashpos]) break; + + if(numzeros >= 3 && length > numzeros) { + hashpos = hash->chainz[hashpos]; + if(hash->zeros[hashpos] != numzeros) break; + } else { + hashpos = hash->chain[hashpos]; + /*outdated hash value, happens if particular value was not encountered in whole last window*/ + if(hash->val[hashpos] != (int)hashval) break; + } + } + + if(lazymatching) { + if(!lazy && length >= 3 && length <= maxlazymatch && length < MAX_SUPPORTED_DEFLATE_LENGTH) { + lazy = 1; + lazylength = length; + lazyoffset = offset; + continue; /*try the next byte*/ + } + if(lazy) { + lazy = 0; + if(pos == 0) ERROR_BREAK(81); + if(length > lazylength + 1) { + /*push the previous character as literal*/ + if(!uivector_push_back(out, in[pos - 1])) ERROR_BREAK(83 /*alloc fail*/); + } else { + length = lazylength; + offset = lazyoffset; + hash->head[hashval] = -1; /*the same hashchain update will be done, this ensures no wrong alteration*/ + hash->headz[numzeros] = -1; /*idem*/ + --pos; + } + } + } + if(length >= 3 && offset > windowsize) ERROR_BREAK(86 /*too big (or overflown negative) offset*/); + + /*encode it as length/distance pair or literal value*/ + if(length < 3) /*only lengths of 3 or higher are supported as length/distance pair*/ { + if(!uivector_push_back(out, in[pos])) ERROR_BREAK(83 /*alloc fail*/); + } else if(length < minmatch || (length == 3 && offset > 4096)) { + /*compensate for the fact that longer offsets have more extra bits, a + length of only 3 may be not worth it then*/ + if(!uivector_push_back(out, in[pos])) ERROR_BREAK(83 /*alloc fail*/); + } else { + addLengthDistance(out, length, offset); + for(i = 1; i < length; ++i) { + ++pos; + wpos = pos & (windowsize - 1); + hashval = getHash(in, insize, pos); + if(usezeros && hashval == 0) { + if(numzeros == 0) numzeros = countZeros(in, insize, pos); + else if(pos + numzeros > insize || in[pos + numzeros - 1] != 0) --numzeros; + } else { + numzeros = 0; + } + updateHashChain(hash, wpos, hashval, numzeros); + } + } + } /*end of the loop through each character of input*/ + + return error; +} + +/* /////////////////////////////////////////////////////////////////////////// */ + +static unsigned deflateNoCompression(ucvector* out, const unsigned char* data, size_t datasize) { + /*non compressed deflate block data: 1 bit BFINAL,2 bits BTYPE,(5 bits): it jumps to start of next byte, + 2 bytes LEN, 2 bytes NLEN, LEN bytes literal DATA*/ + + size_t i, numdeflateblocks = (datasize + 65534u) / 65535u; + unsigned datapos = 0; + for(i = 0; i != numdeflateblocks; ++i) { + unsigned BFINAL, BTYPE, LEN, NLEN; + unsigned char firstbyte; + size_t pos = out->size; + + BFINAL = (i == numdeflateblocks - 1); + BTYPE = 0; + + LEN = 65535; + if(datasize - datapos < 65535u) LEN = (unsigned)datasize - datapos; + NLEN = 65535 - LEN; + + if(!ucvector_resize(out, out->size + LEN + 5)) return 83; /*alloc fail*/ + + firstbyte = (unsigned char)(BFINAL + ((BTYPE & 1u) << 1u) + ((BTYPE & 2u) << 1u)); + out->data[pos + 0] = firstbyte; + out->data[pos + 1] = (unsigned char)(LEN & 255); + out->data[pos + 2] = (unsigned char)(LEN >> 8u); + out->data[pos + 3] = (unsigned char)(NLEN & 255); + out->data[pos + 4] = (unsigned char)(NLEN >> 8u); + lodepng_memcpy(out->data + pos + 5, data + datapos, LEN); + datapos += LEN; + } + + return 0; +} + +/* +write the lz77-encoded data, which has lit, len and dist codes, to compressed stream using huffman trees. +tree_ll: the tree for lit and len codes. +tree_d: the tree for distance codes. +*/ +static void writeLZ77data(LodePNGBitWriter* writer, const uivector* lz77_encoded, + const HuffmanTree* tree_ll, const HuffmanTree* tree_d) { + size_t i = 0; + for(i = 0; i != lz77_encoded->size; ++i) { + unsigned val = lz77_encoded->data[i]; + writeBitsReversed(writer, tree_ll->codes[val], tree_ll->lengths[val]); + if(val > 256) /*for a length code, 3 more things have to be added*/ { + unsigned length_index = val - FIRST_LENGTH_CODE_INDEX; + unsigned n_length_extra_bits = LENGTHEXTRA[length_index]; + unsigned length_extra_bits = lz77_encoded->data[++i]; + + unsigned distance_code = lz77_encoded->data[++i]; + + unsigned distance_index = distance_code; + unsigned n_distance_extra_bits = DISTANCEEXTRA[distance_index]; + unsigned distance_extra_bits = lz77_encoded->data[++i]; + + writeBits(writer, length_extra_bits, n_length_extra_bits); + writeBitsReversed(writer, tree_d->codes[distance_code], tree_d->lengths[distance_code]); + writeBits(writer, distance_extra_bits, n_distance_extra_bits); + } + } +} + +/*Deflate for a block of type "dynamic", that is, with freely, optimally, created huffman trees*/ +static unsigned deflateDynamic(LodePNGBitWriter* writer, Hash* hash, + const unsigned char* data, size_t datapos, size_t dataend, + const LodePNGCompressSettings* settings, unsigned final) { + unsigned error = 0; + + /* + A block is compressed as follows: The PNG data is lz77 encoded, resulting in + literal bytes and length/distance pairs. This is then huffman compressed with + two huffman trees. One huffman tree is used for the lit and len values ("ll"), + another huffman tree is used for the dist values ("d"). These two trees are + stored using their code lengths, and to compress even more these code lengths + are also run-length encoded and huffman compressed. This gives a huffman tree + of code lengths "cl". The code lengths used to describe this third tree are + the code length code lengths ("clcl"). + */ + + /*The lz77 encoded data, represented with integers since there will also be length and distance codes in it*/ + uivector lz77_encoded; + HuffmanTree tree_ll; /*tree for lit,len values*/ + HuffmanTree tree_d; /*tree for distance codes*/ + HuffmanTree tree_cl; /*tree for encoding the code lengths representing tree_ll and tree_d*/ + unsigned* frequencies_ll = 0; /*frequency of lit,len codes*/ + unsigned* frequencies_d = 0; /*frequency of dist codes*/ + unsigned* frequencies_cl = 0; /*frequency of code length codes*/ + unsigned* bitlen_lld = 0; /*lit,len,dist code lengths (int bits), literally (without repeat codes).*/ + unsigned* bitlen_lld_e = 0; /*bitlen_lld encoded with repeat codes (this is a rudimentary run length compression)*/ + size_t datasize = dataend - datapos; + + /* + If we could call "bitlen_cl" the the code length code lengths ("clcl"), that is the bit lengths of codes to represent + tree_cl in CLCL_ORDER, then due to the huffman compression of huffman tree representations ("two levels"), there are + some analogies: + bitlen_lld is to tree_cl what data is to tree_ll and tree_d. + bitlen_lld_e is to bitlen_lld what lz77_encoded is to data. + bitlen_cl is to bitlen_lld_e what bitlen_lld is to lz77_encoded. + */ + + unsigned BFINAL = final; + size_t i; + size_t numcodes_ll, numcodes_d, numcodes_lld, numcodes_lld_e, numcodes_cl; + unsigned HLIT, HDIST, HCLEN; + + uivector_init(&lz77_encoded); + HuffmanTree_init(&tree_ll); + HuffmanTree_init(&tree_d); + HuffmanTree_init(&tree_cl); + /* could fit on stack, but >1KB is on the larger side so allocate instead */ + frequencies_ll = (unsigned*)lodepng_malloc(286 * sizeof(*frequencies_ll)); + frequencies_d = (unsigned*)lodepng_malloc(30 * sizeof(*frequencies_d)); + frequencies_cl = (unsigned*)lodepng_malloc(NUM_CODE_LENGTH_CODES * sizeof(*frequencies_cl)); + + if(!frequencies_ll || !frequencies_d || !frequencies_cl) error = 83; /*alloc fail*/ + + /*This while loop never loops due to a break at the end, it is here to + allow breaking out of it to the cleanup phase on error conditions.*/ + while(!error) { + lodepng_memset(frequencies_ll, 0, 286 * sizeof(*frequencies_ll)); + lodepng_memset(frequencies_d, 0, 30 * sizeof(*frequencies_d)); + lodepng_memset(frequencies_cl, 0, NUM_CODE_LENGTH_CODES * sizeof(*frequencies_cl)); + + if(settings->use_lz77) { + error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize, + settings->minmatch, settings->nicematch, settings->lazymatching); + if(error) break; + } else { + if(!uivector_resize(&lz77_encoded, datasize)) ERROR_BREAK(83 /*alloc fail*/); + for(i = datapos; i < dataend; ++i) lz77_encoded.data[i - datapos] = data[i]; /*no LZ77, but still will be Huffman compressed*/ + } + + /*Count the frequencies of lit, len and dist codes*/ + for(i = 0; i != lz77_encoded.size; ++i) { + unsigned symbol = lz77_encoded.data[i]; + ++frequencies_ll[symbol]; + if(symbol > 256) { + unsigned dist = lz77_encoded.data[i + 2]; + ++frequencies_d[dist]; + i += 3; + } + } + frequencies_ll[256] = 1; /*there will be exactly 1 end code, at the end of the block*/ + + /*Make both huffman trees, one for the lit and len codes, one for the dist codes*/ + error = HuffmanTree_makeFromFrequencies(&tree_ll, frequencies_ll, 257, 286, 15); + if(error) break; + /*2, not 1, is chosen for mincodes: some buggy PNG decoders require at least 2 symbols in the dist tree*/ + error = HuffmanTree_makeFromFrequencies(&tree_d, frequencies_d, 2, 30, 15); + if(error) break; + + numcodes_ll = LODEPNG_MIN(tree_ll.numcodes, 286); + numcodes_d = LODEPNG_MIN(tree_d.numcodes, 30); + /*store the code lengths of both generated trees in bitlen_lld*/ + numcodes_lld = numcodes_ll + numcodes_d; + bitlen_lld = (unsigned*)lodepng_malloc(numcodes_lld * sizeof(*bitlen_lld)); + /*numcodes_lld_e never needs more size than bitlen_lld*/ + bitlen_lld_e = (unsigned*)lodepng_malloc(numcodes_lld * sizeof(*bitlen_lld_e)); + if(!bitlen_lld || !bitlen_lld_e) ERROR_BREAK(83); /*alloc fail*/ + numcodes_lld_e = 0; + + for(i = 0; i != numcodes_ll; ++i) bitlen_lld[i] = tree_ll.lengths[i]; + for(i = 0; i != numcodes_d; ++i) bitlen_lld[numcodes_ll + i] = tree_d.lengths[i]; + + /*run-length compress bitlen_ldd into bitlen_lld_e by using repeat codes 16 (copy length 3-6 times), + 17 (3-10 zeroes), 18 (11-138 zeroes)*/ + for(i = 0; i != numcodes_lld; ++i) { + unsigned j = 0; /*amount of repetitions*/ + while(i + j + 1 < numcodes_lld && bitlen_lld[i + j + 1] == bitlen_lld[i]) ++j; + + if(bitlen_lld[i] == 0 && j >= 2) /*repeat code for zeroes*/ { + ++j; /*include the first zero*/ + if(j <= 10) /*repeat code 17 supports max 10 zeroes*/ { + bitlen_lld_e[numcodes_lld_e++] = 17; + bitlen_lld_e[numcodes_lld_e++] = j - 3; + } else /*repeat code 18 supports max 138 zeroes*/ { + if(j > 138) j = 138; + bitlen_lld_e[numcodes_lld_e++] = 18; + bitlen_lld_e[numcodes_lld_e++] = j - 11; + } + i += (j - 1); + } else if(j >= 3) /*repeat code for value other than zero*/ { + size_t k; + unsigned num = j / 6u, rest = j % 6u; + bitlen_lld_e[numcodes_lld_e++] = bitlen_lld[i]; + for(k = 0; k < num; ++k) { + bitlen_lld_e[numcodes_lld_e++] = 16; + bitlen_lld_e[numcodes_lld_e++] = 6 - 3; + } + if(rest >= 3) { + bitlen_lld_e[numcodes_lld_e++] = 16; + bitlen_lld_e[numcodes_lld_e++] = rest - 3; + } + else j -= rest; + i += j; + } else /*too short to benefit from repeat code*/ { + bitlen_lld_e[numcodes_lld_e++] = bitlen_lld[i]; + } + } + + /*generate tree_cl, the huffmantree of huffmantrees*/ + for(i = 0; i != numcodes_lld_e; ++i) { + ++frequencies_cl[bitlen_lld_e[i]]; + /*after a repeat code come the bits that specify the number of repetitions, + those don't need to be in the frequencies_cl calculation*/ + if(bitlen_lld_e[i] >= 16) ++i; + } + + error = HuffmanTree_makeFromFrequencies(&tree_cl, frequencies_cl, + NUM_CODE_LENGTH_CODES, NUM_CODE_LENGTH_CODES, 7); + if(error) break; + + /*compute amount of code-length-code-lengths to output*/ + numcodes_cl = NUM_CODE_LENGTH_CODES; + /*trim zeros at the end (using CLCL_ORDER), but minimum size must be 4 (see HCLEN below)*/ + while(numcodes_cl > 4u && tree_cl.lengths[CLCL_ORDER[numcodes_cl - 1u]] == 0) { + numcodes_cl--; + } + + /* + Write everything into the output + + After the BFINAL and BTYPE, the dynamic block consists out of the following: + - 5 bits HLIT, 5 bits HDIST, 4 bits HCLEN + - (HCLEN+4)*3 bits code lengths of code length alphabet + - HLIT + 257 code lengths of lit/length alphabet (encoded using the code length + alphabet, + possible repetition codes 16, 17, 18) + - HDIST + 1 code lengths of distance alphabet (encoded using the code length + alphabet, + possible repetition codes 16, 17, 18) + - compressed data + - 256 (end code) + */ + + /*Write block type*/ + writeBits(writer, BFINAL, 1); + writeBits(writer, 0, 1); /*first bit of BTYPE "dynamic"*/ + writeBits(writer, 1, 1); /*second bit of BTYPE "dynamic"*/ + + /*write the HLIT, HDIST and HCLEN values*/ + /*all three sizes take trimmed ending zeroes into account, done either by HuffmanTree_makeFromFrequencies + or in the loop for numcodes_cl above, which saves space. */ + HLIT = (unsigned)(numcodes_ll - 257); + HDIST = (unsigned)(numcodes_d - 1); + HCLEN = (unsigned)(numcodes_cl - 4); + writeBits(writer, HLIT, 5); + writeBits(writer, HDIST, 5); + writeBits(writer, HCLEN, 4); + + /*write the code lengths of the code length alphabet ("bitlen_cl")*/ + for(i = 0; i != numcodes_cl; ++i) writeBits(writer, tree_cl.lengths[CLCL_ORDER[i]], 3); + + /*write the lengths of the lit/len AND the dist alphabet*/ + for(i = 0; i != numcodes_lld_e; ++i) { + writeBitsReversed(writer, tree_cl.codes[bitlen_lld_e[i]], tree_cl.lengths[bitlen_lld_e[i]]); + /*extra bits of repeat codes*/ + if(bitlen_lld_e[i] == 16) writeBits(writer, bitlen_lld_e[++i], 2); + else if(bitlen_lld_e[i] == 17) writeBits(writer, bitlen_lld_e[++i], 3); + else if(bitlen_lld_e[i] == 18) writeBits(writer, bitlen_lld_e[++i], 7); + } + + /*write the compressed data symbols*/ + writeLZ77data(writer, &lz77_encoded, &tree_ll, &tree_d); + /*error: the length of the end code 256 must be larger than 0*/ + if(tree_ll.lengths[256] == 0) ERROR_BREAK(64); + + /*write the end code*/ + writeBitsReversed(writer, tree_ll.codes[256], tree_ll.lengths[256]); + + break; /*end of error-while*/ + } + + /*cleanup*/ + uivector_cleanup(&lz77_encoded); + HuffmanTree_cleanup(&tree_ll); + HuffmanTree_cleanup(&tree_d); + HuffmanTree_cleanup(&tree_cl); + lodepng_free(frequencies_ll); + lodepng_free(frequencies_d); + lodepng_free(frequencies_cl); + lodepng_free(bitlen_lld); + lodepng_free(bitlen_lld_e); + + return error; +} + +static unsigned deflateFixed(LodePNGBitWriter* writer, Hash* hash, + const unsigned char* data, + size_t datapos, size_t dataend, + const LodePNGCompressSettings* settings, unsigned final) { + HuffmanTree tree_ll; /*tree for literal values and length codes*/ + HuffmanTree tree_d; /*tree for distance codes*/ + + unsigned BFINAL = final; + unsigned error = 0; + size_t i; + + HuffmanTree_init(&tree_ll); + HuffmanTree_init(&tree_d); + + error = generateFixedLitLenTree(&tree_ll); + if(!error) error = generateFixedDistanceTree(&tree_d); + + if(!error) { + writeBits(writer, BFINAL, 1); + writeBits(writer, 1, 1); /*first bit of BTYPE*/ + writeBits(writer, 0, 1); /*second bit of BTYPE*/ + + if(settings->use_lz77) /*LZ77 encoded*/ { + uivector lz77_encoded; + uivector_init(&lz77_encoded); + error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize, + settings->minmatch, settings->nicematch, settings->lazymatching); + if(!error) writeLZ77data(writer, &lz77_encoded, &tree_ll, &tree_d); + uivector_cleanup(&lz77_encoded); + } else /*no LZ77, but still will be Huffman compressed*/ { + for(i = datapos; i < dataend; ++i) { + writeBitsReversed(writer, tree_ll.codes[data[i]], tree_ll.lengths[data[i]]); + } + } + /*add END code*/ + if(!error) writeBitsReversed(writer,tree_ll.codes[256], tree_ll.lengths[256]); + } + + /*cleanup*/ + HuffmanTree_cleanup(&tree_ll); + HuffmanTree_cleanup(&tree_d); + + return error; +} + +static unsigned lodepng_deflatev(ucvector* out, const unsigned char* in, size_t insize, + const LodePNGCompressSettings* settings) { + unsigned error = 0; + size_t i, blocksize, numdeflateblocks; + Hash hash; + LodePNGBitWriter writer; + + LodePNGBitWriter_init(&writer, out); + + if(settings->btype > 2) return 61; + else if(settings->btype == 0) return deflateNoCompression(out, in, insize); + else if(settings->btype == 1) blocksize = insize; + else /*if(settings->btype == 2)*/ { + /*on PNGs, deflate blocks of 65-262k seem to give most dense encoding*/ + blocksize = insize / 8u + 8; + if(blocksize < 65536) blocksize = 65536; + if(blocksize > 262144) blocksize = 262144; + } + + numdeflateblocks = (insize + blocksize - 1) / blocksize; + if(numdeflateblocks == 0) numdeflateblocks = 1; + + error = hash_init(&hash, settings->windowsize); + + if(!error) { + for(i = 0; i != numdeflateblocks && !error; ++i) { + unsigned final = (i == numdeflateblocks - 1); + size_t start = i * blocksize; + size_t end = start + blocksize; + if(end > insize) end = insize; + + if(settings->btype == 1) error = deflateFixed(&writer, &hash, in, start, end, settings, final); + else if(settings->btype == 2) error = deflateDynamic(&writer, &hash, in, start, end, settings, final); + } + } + + hash_cleanup(&hash); + + return error; +} + +unsigned lodepng_deflate(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGCompressSettings* settings) { + ucvector v = ucvector_init(*out, *outsize); + unsigned error = lodepng_deflatev(&v, in, insize, settings); + *out = v.data; + *outsize = v.size; + return error; +} + +static unsigned deflate(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGCompressSettings* settings) { + if(settings->custom_deflate) { + unsigned error = settings->custom_deflate(out, outsize, in, insize, settings); + /*the custom deflate is allowed to have its own error codes, however, we translate it to code 111*/ + return error ? 111 : 0; + } else { + return lodepng_deflate(out, outsize, in, insize, settings); + } +} + +#endif /*LODEPNG_COMPILE_DECODER*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Adler32 / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +static unsigned update_adler32(unsigned adler, const unsigned char* data, unsigned len) { + unsigned s1 = adler & 0xffffu; + unsigned s2 = (adler >> 16u) & 0xffffu; + + while(len != 0u) { + unsigned i; + /*at least 5552 sums can be done before the sums overflow, saving a lot of module divisions*/ + unsigned amount = len > 5552u ? 5552u : len; + len -= amount; + for(i = 0; i != amount; ++i) { + s1 += (*data++); + s2 += s1; + } + s1 %= 65521u; + s2 %= 65521u; + } + + return (s2 << 16u) | s1; +} + +/*Return the adler32 of the bytes data[0..len-1]*/ +static unsigned adler32(const unsigned char* data, unsigned len) { + return update_adler32(1u, data, len); +} + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Zlib / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_DECODER + +static unsigned lodepng_zlib_decompressv(ucvector* out, + const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings) { + unsigned error = 0; + unsigned CM, CINFO, FDICT; + + if(insize < 2) return 53; /*error, size of zlib data too small*/ + /*read information from zlib header*/ + if((in[0] * 256 + in[1]) % 31 != 0) { + /*error: 256 * in[0] + in[1] must be a multiple of 31, the FCHECK value is supposed to be made that way*/ + return 24; + } + + CM = in[0] & 15; + CINFO = (in[0] >> 4) & 15; + /*FCHECK = in[1] & 31;*/ /*FCHECK is already tested above*/ + FDICT = (in[1] >> 5) & 1; + /*FLEVEL = (in[1] >> 6) & 3;*/ /*FLEVEL is not used here*/ + + if(CM != 8 || CINFO > 7) { + /*error: only compression method 8: inflate with sliding window of 32k is supported by the PNG spec*/ + return 25; + } + if(FDICT != 0) { + /*error: the specification of PNG says about the zlib stream: + "The additional flags shall not specify a preset dictionary."*/ + return 26; + } + + error = inflatev(out, in + 2, insize - 2, settings); + if(error) return error; + + if(!settings->ignore_adler32) { + unsigned ADLER32 = lodepng_read32bitInt(&in[insize - 4]); + unsigned checksum = adler32(out->data, (unsigned)(out->size)); + if(checksum != ADLER32) return 58; /*error, adler checksum not correct, data must be corrupted*/ + } + + return 0; /*no error*/ +} + + +unsigned lodepng_zlib_decompress(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGDecompressSettings* settings) { + ucvector v = ucvector_init(*out, *outsize); + unsigned error = lodepng_zlib_decompressv(&v, in, insize, settings); + *out = v.data; + *outsize = v.size; + return error; +} + +/*expected_size is expected output size, to avoid intermediate allocations. Set to 0 if not known. */ +static unsigned zlib_decompress(unsigned char** out, size_t* outsize, size_t expected_size, + const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) { + unsigned error; + if(settings->custom_zlib) { + error = settings->custom_zlib(out, outsize, in, insize, settings); + if(error) { + /*the custom zlib is allowed to have its own error codes, however, we translate it to code 110*/ + error = 110; + /*if there's a max output size, and the custom zlib returned error, then indicate that error instead*/ + if(settings->max_output_size && *outsize > settings->max_output_size) error = 109; + } + } else { + ucvector v = ucvector_init(*out, *outsize); + if(expected_size) { + /*reserve the memory to avoid intermediate reallocations*/ + ucvector_resize(&v, *outsize + expected_size); + v.size = *outsize; + } + error = lodepng_zlib_decompressv(&v, in, insize, settings); + *out = v.data; + *outsize = v.size; + } + return error; +} + +#endif /*LODEPNG_COMPILE_DECODER*/ + +#ifdef LODEPNG_COMPILE_ENCODER + +unsigned lodepng_zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGCompressSettings* settings) { + size_t i; + unsigned error; + unsigned char* deflatedata = 0; + size_t deflatesize = 0; + + error = deflate(&deflatedata, &deflatesize, in, insize, settings); + + *out = NULL; + *outsize = 0; + if(!error) { + *outsize = deflatesize + 6; + *out = (unsigned char*)lodepng_malloc(*outsize); + if(!*out) error = 83; /*alloc fail*/ + } + + if(!error) { + unsigned ADLER32 = adler32(in, (unsigned)insize); + /*zlib data: 1 byte CMF (CM+CINFO), 1 byte FLG, deflate data, 4 byte ADLER32 checksum of the Decompressed data*/ + unsigned CMF = 120; /*0b01111000: CM 8, CINFO 7. With CINFO 7, any window size up to 32768 can be used.*/ + unsigned FLEVEL = 0; + unsigned FDICT = 0; + unsigned CMFFLG = 256 * CMF + FDICT * 32 + FLEVEL * 64; + unsigned FCHECK = 31 - CMFFLG % 31; + CMFFLG += FCHECK; + + (*out)[0] = (unsigned char)(CMFFLG >> 8); + (*out)[1] = (unsigned char)(CMFFLG & 255); + for(i = 0; i != deflatesize; ++i) (*out)[i + 2] = deflatedata[i]; + lodepng_set32bitInt(&(*out)[*outsize - 4], ADLER32); + } + + lodepng_free(deflatedata); + return error; +} + +/* compress using the default or custom zlib function */ +static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGCompressSettings* settings) { + if(settings->custom_zlib) { + unsigned error = settings->custom_zlib(out, outsize, in, insize, settings); + /*the custom zlib is allowed to have its own error codes, however, we translate it to code 111*/ + return error ? 111 : 0; + } else { + return lodepng_zlib_compress(out, outsize, in, insize, settings); + } +} + +#endif /*LODEPNG_COMPILE_ENCODER*/ + +#else /*no LODEPNG_COMPILE_ZLIB*/ + +#ifdef LODEPNG_COMPILE_DECODER +static unsigned zlib_decompress(unsigned char** out, size_t* outsize, size_t expected_size, + const unsigned char* in, size_t insize, const LodePNGDecompressSettings* settings) { + if(!settings->custom_zlib) return 87; /*no custom zlib function provided */ + LV_UNUSED(expected_size); + return settings->custom_zlib(out, outsize, in, insize, settings); +} +#endif /*LODEPNG_COMPILE_DECODER*/ +#ifdef LODEPNG_COMPILE_ENCODER +static unsigned zlib_compress(unsigned char** out, size_t* outsize, const unsigned char* in, + size_t insize, const LodePNGCompressSettings* settings) { + if(!settings->custom_zlib) return 87; /*no custom zlib function provided */ + return settings->custom_zlib(out, outsize, in, insize, settings); +} +#endif /*LODEPNG_COMPILE_ENCODER*/ + +#endif /*LODEPNG_COMPILE_ZLIB*/ + +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_ENCODER + +/*this is a good tradeoff between speed and compression ratio*/ +#define DEFAULT_WINDOWSIZE 2048 + +void lodepng_compress_settings_init(LodePNGCompressSettings* settings) { + /*compress with dynamic huffman tree (not in the mathematical sense, just not the predefined one)*/ + settings->btype = 2; + settings->use_lz77 = 1; + settings->windowsize = DEFAULT_WINDOWSIZE; + settings->minmatch = 3; + settings->nicematch = 128; + settings->lazymatching = 1; + + settings->custom_zlib = 0; + settings->custom_deflate = 0; + settings->custom_context = 0; +} + +const LodePNGCompressSettings lodepng_default_compress_settings = {2, 1, DEFAULT_WINDOWSIZE, 3, 128, 1, 0, 0, 0}; + + +#endif /*LODEPNG_COMPILE_ENCODER*/ + +#ifdef LODEPNG_COMPILE_DECODER + +void lodepng_decompress_settings_init(LodePNGDecompressSettings* settings) { + settings->ignore_adler32 = 0; + settings->ignore_nlen = 0; + settings->max_output_size = 0; + + settings->custom_zlib = 0; + settings->custom_inflate = 0; + settings->custom_context = 0; +} + +const LodePNGDecompressSettings lodepng_default_decompress_settings = {0, 0, 0, 0, 0, 0}; + +#endif /*LODEPNG_COMPILE_DECODER*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* // End of Zlib related code. Begin of PNG related code. // */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_PNG + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / CRC32 / */ +/* ////////////////////////////////////////////////////////////////////////// */ + + +#ifndef LODEPNG_NO_COMPILE_CRC +/* CRC polynomial: 0xedb88320 */ +static unsigned lodepng_crc32_table[256] = { + 0u, 1996959894u, 3993919788u, 2567524794u, 124634137u, 1886057615u, 3915621685u, 2657392035u, + 249268274u, 2044508324u, 3772115230u, 2547177864u, 162941995u, 2125561021u, 3887607047u, 2428444049u, + 498536548u, 1789927666u, 4089016648u, 2227061214u, 450548861u, 1843258603u, 4107580753u, 2211677639u, + 325883990u, 1684777152u, 4251122042u, 2321926636u, 335633487u, 1661365465u, 4195302755u, 2366115317u, + 997073096u, 1281953886u, 3579855332u, 2724688242u, 1006888145u, 1258607687u, 3524101629u, 2768942443u, + 901097722u, 1119000684u, 3686517206u, 2898065728u, 853044451u, 1172266101u, 3705015759u, 2882616665u, + 651767980u, 1373503546u, 3369554304u, 3218104598u, 565507253u, 1454621731u, 3485111705u, 3099436303u, + 671266974u, 1594198024u, 3322730930u, 2970347812u, 795835527u, 1483230225u, 3244367275u, 3060149565u, + 1994146192u, 31158534u, 2563907772u, 4023717930u, 1907459465u, 112637215u, 2680153253u, 3904427059u, + 2013776290u, 251722036u, 2517215374u, 3775830040u, 2137656763u, 141376813u, 2439277719u, 3865271297u, + 1802195444u, 476864866u, 2238001368u, 4066508878u, 1812370925u, 453092731u, 2181625025u, 4111451223u, + 1706088902u, 314042704u, 2344532202u, 4240017532u, 1658658271u, 366619977u, 2362670323u, 4224994405u, + 1303535960u, 984961486u, 2747007092u, 3569037538u, 1256170817u, 1037604311u, 2765210733u, 3554079995u, + 1131014506u, 879679996u, 2909243462u, 3663771856u, 1141124467u, 855842277u, 2852801631u, 3708648649u, + 1342533948u, 654459306u, 3188396048u, 3373015174u, 1466479909u, 544179635u, 3110523913u, 3462522015u, + 1591671054u, 702138776u, 2966460450u, 3352799412u, 1504918807u, 783551873u, 3082640443u, 3233442989u, + 3988292384u, 2596254646u, 62317068u, 1957810842u, 3939845945u, 2647816111u, 81470997u, 1943803523u, + 3814918930u, 2489596804u, 225274430u, 2053790376u, 3826175755u, 2466906013u, 167816743u, 2097651377u, + 4027552580u, 2265490386u, 503444072u, 1762050814u, 4150417245u, 2154129355u, 426522225u, 1852507879u, + 4275313526u, 2312317920u, 282753626u, 1742555852u, 4189708143u, 2394877945u, 397917763u, 1622183637u, + 3604390888u, 2714866558u, 953729732u, 1340076626u, 3518719985u, 2797360999u, 1068828381u, 1219638859u, + 3624741850u, 2936675148u, 906185462u, 1090812512u, 3747672003u, 2825379669u, 829329135u, 1181335161u, + 3412177804u, 3160834842u, 628085408u, 1382605366u, 3423369109u, 3138078467u, 570562233u, 1426400815u, + 3317316542u, 2998733608u, 733239954u, 1555261956u, 3268935591u, 3050360625u, 752459403u, 1541320221u, + 2607071920u, 3965973030u, 1969922972u, 40735498u, 2617837225u, 3943577151u, 1913087877u, 83908371u, + 2512341634u, 3803740692u, 2075208622u, 213261112u, 2463272603u, 3855990285u, 2094854071u, 198958881u, + 2262029012u, 4057260610u, 1759359992u, 534414190u, 2176718541u, 4139329115u, 1873836001u, 414664567u, + 2282248934u, 4279200368u, 1711684554u, 285281116u, 2405801727u, 4167216745u, 1634467795u, 376229701u, + 2685067896u, 3608007406u, 1308918612u, 956543938u, 2808555105u, 3495958263u, 1231636301u, 1047427035u, + 2932959818u, 3654703836u, 1088359270u, 936918000u, 2847714899u, 3736837829u, 1202900863u, 817233897u, + 3183342108u, 3401237130u, 1404277552u, 615818150u, 3134207493u, 3453421203u, 1423857449u, 601450431u, + 3009837614u, 3294710456u, 1567103746u, 711928724u, 3020668471u, 3272380065u, 1510334235u, 755167117u +}; + +/*Return the CRC of the bytes buf[0..len-1].*/ +unsigned lodepng_crc32(const unsigned char* data, size_t length) { + unsigned r = 0xffffffffu; + size_t i; + for(i = 0; i < length; ++i) { + r = lodepng_crc32_table[(r ^ data[i]) & 0xffu] ^ (r >> 8u); + } + return r ^ 0xffffffffu; +} +#else /* !LODEPNG_NO_COMPILE_CRC */ +unsigned lodepng_crc32(const unsigned char* data, size_t length); +#endif /* !LODEPNG_NO_COMPILE_CRC */ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Reading and writing PNG color channel bits / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +/* The color channel bits of less-than-8-bit pixels are read with the MSB of bytes first, +so LodePNGBitWriter and LodePNGBitReader can't be used for those. */ + +static unsigned char readBitFromReversedStream(size_t* bitpointer, const unsigned char* bitstream) { + unsigned char result = (unsigned char)((bitstream[(*bitpointer) >> 3] >> (7 - ((*bitpointer) & 0x7))) & 1); + ++(*bitpointer); + return result; +} + +/* TODO: make this faster */ +static unsigned readBitsFromReversedStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits) { + unsigned result = 0; + size_t i; + for(i = 0 ; i < nbits; ++i) { + result <<= 1u; + result |= (unsigned)readBitFromReversedStream(bitpointer, bitstream); + } + return result; +} + +static void setBitOfReversedStream(size_t* bitpointer, unsigned char* bitstream, unsigned char bit) { + /*the current bit in bitstream may be 0 or 1 for this to work*/ + if(bit == 0) bitstream[(*bitpointer) >> 3u] &= (unsigned char)(~(1u << (7u - ((*bitpointer) & 7u)))); + else bitstream[(*bitpointer) >> 3u] |= (1u << (7u - ((*bitpointer) & 7u))); + ++(*bitpointer); +} + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / PNG chunks / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +unsigned lodepng_chunk_length(const unsigned char* chunk) { + return lodepng_read32bitInt(&chunk[0]); +} + +void lodepng_chunk_type(char type[5], const unsigned char* chunk) { + unsigned i; + for(i = 0; i != 4; ++i) type[i] = (char)chunk[4 + i]; + type[4] = 0; /*null termination char*/ +} + +unsigned char lodepng_chunk_type_equals(const unsigned char* chunk, const char* type) { + if(lodepng_strlen(type) != 4) return 0; + return (chunk[4] == type[0] && chunk[5] == type[1] && chunk[6] == type[2] && chunk[7] == type[3]); +} + +unsigned char lodepng_chunk_ancillary(const unsigned char* chunk) { + return((chunk[4] & 32) != 0); +} + +unsigned char lodepng_chunk_private(const unsigned char* chunk) { + return((chunk[6] & 32) != 0); +} + +unsigned char lodepng_chunk_safetocopy(const unsigned char* chunk) { + return((chunk[7] & 32) != 0); +} + +unsigned char* lodepng_chunk_data(unsigned char* chunk) { + return &chunk[8]; +} + +const unsigned char* lodepng_chunk_data_const(const unsigned char* chunk) { + return &chunk[8]; +} + +unsigned lodepng_chunk_check_crc(const unsigned char* chunk) { + unsigned length = lodepng_chunk_length(chunk); + unsigned CRC = lodepng_read32bitInt(&chunk[length + 8]); + /*the CRC is taken of the data and the 4 chunk type letters, not the length*/ + unsigned checksum = lodepng_crc32(&chunk[4], length + 4); + if(CRC != checksum) return 1; + else return 0; +} + +void lodepng_chunk_generate_crc(unsigned char* chunk) { + unsigned length = lodepng_chunk_length(chunk); + unsigned CRC = lodepng_crc32(&chunk[4], length + 4); + lodepng_set32bitInt(chunk + 8 + length, CRC); +} + +unsigned char* lodepng_chunk_next(unsigned char* chunk, unsigned char* end) { + if(chunk >= end || end - chunk < 12) return end; /*too small to contain a chunk*/ + if(chunk[0] == 0x89 && chunk[1] == 0x50 && chunk[2] == 0x4e && chunk[3] == 0x47 + && chunk[4] == 0x0d && chunk[5] == 0x0a && chunk[6] == 0x1a && chunk[7] == 0x0a) { + /* Is PNG magic header at start of PNG file. Jump to first actual chunk. */ + return chunk + 8; + } else { + size_t total_chunk_length; + unsigned char* result; + if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return end; + result = chunk + total_chunk_length; + if(result < chunk) return end; /*pointer overflow*/ + return result; + } +} + +const unsigned char* lodepng_chunk_next_const(const unsigned char* chunk, const unsigned char* end) { + if(chunk >= end || end - chunk < 12) return end; /*too small to contain a chunk*/ + if(chunk[0] == 0x89 && chunk[1] == 0x50 && chunk[2] == 0x4e && chunk[3] == 0x47 + && chunk[4] == 0x0d && chunk[5] == 0x0a && chunk[6] == 0x1a && chunk[7] == 0x0a) { + /* Is PNG magic header at start of PNG file. Jump to first actual chunk. */ + return chunk + 8; + } else { + size_t total_chunk_length; + const unsigned char* result; + if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return end; + result = chunk + total_chunk_length; + if(result < chunk) return end; /*pointer overflow*/ + return result; + } +} + +unsigned char* lodepng_chunk_find(unsigned char* chunk, unsigned char* end, const char type[5]) { + for(;;) { + if(chunk >= end || end - chunk < 12) return 0; /* past file end: chunk + 12 > end */ + if(lodepng_chunk_type_equals(chunk, type)) return chunk; + chunk = lodepng_chunk_next(chunk, end); + } + + return 0; /*Shouldn't reach this*/ +} + +const unsigned char* lodepng_chunk_find_const(const unsigned char* chunk, const unsigned char* end, const char type[5]) { + for(;;) { + if(chunk >= end || end - chunk < 12) return 0; /* past file end: chunk + 12 > end */ + if(lodepng_chunk_type_equals(chunk, type)) return chunk; + chunk = lodepng_chunk_next_const(chunk, end); + } + + return 0; /*Shouldn't reach this*/ +} + +unsigned lodepng_chunk_append(unsigned char** out, size_t* outsize, const unsigned char* chunk) { + unsigned i; + size_t total_chunk_length, new_length; + unsigned char *chunk_start, *new_buffer; + + if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return 77; + if(lodepng_addofl(*outsize, total_chunk_length, &new_length)) return 77; + + new_buffer = (unsigned char*)lodepng_realloc(*out, new_length); + if(!new_buffer) return 83; /*alloc fail*/ + (*out) = new_buffer; + (*outsize) = new_length; + chunk_start = &(*out)[new_length - total_chunk_length]; + + for(i = 0; i != total_chunk_length; ++i) chunk_start[i] = chunk[i]; + + return 0; +} + +/*Sets length and name and allocates the space for data and crc but does not +set data or crc yet. Returns the start of the chunk in chunk. The start of +the data is at chunk + 8. To finalize chunk, add the data, then use +lodepng_chunk_generate_crc */ +static unsigned lodepng_chunk_init(unsigned char** chunk, + ucvector* out, + unsigned length, const char* type) { + size_t new_length = out->size; + if(lodepng_addofl(new_length, length, &new_length)) return 77; + if(lodepng_addofl(new_length, 12, &new_length)) return 77; + if(!ucvector_resize(out, new_length)) return 83; /*alloc fail*/ + *chunk = out->data + new_length - length - 12u; + + /*1: length*/ + lodepng_set32bitInt(*chunk, length); + + /*2: chunk name (4 letters)*/ + lodepng_memcpy(*chunk + 4, type, 4); + + return 0; +} + +/* like lodepng_chunk_create but with custom allocsize */ +static unsigned lodepng_chunk_createv(ucvector* out, + unsigned length, const char* type, const unsigned char* data) { + unsigned char* chunk; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, length, type)); + + /*3: the data*/ + lodepng_memcpy(chunk + 8, data, length); + + /*4: CRC (of the chunkname characters and the data)*/ + lodepng_chunk_generate_crc(chunk); + + return 0; +} + +unsigned lodepng_chunk_create(unsigned char** out, size_t* outsize, + unsigned length, const char* type, const unsigned char* data) { + ucvector v = ucvector_init(*out, *outsize); + unsigned error = lodepng_chunk_createv(&v, length, type, data); + *out = v.data; + *outsize = v.size; + return error; +} + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / Color types, channels, bits / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +/*checks if the colortype is valid and the bitdepth bd is allowed for this colortype. +Return value is a LodePNG error code.*/ +static unsigned checkColorValidity(LodePNGColorType colortype, unsigned bd) { + switch(colortype) { + case LCT_GREY: if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8 || bd == 16)) return 37; break; + case LCT_RGB: if(!( bd == 8 || bd == 16)) return 37; break; + case LCT_PALETTE: if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8 )) return 37; break; + case LCT_GREY_ALPHA: if(!( bd == 8 || bd == 16)) return 37; break; + case LCT_RGBA: if(!( bd == 8 || bd == 16)) return 37; break; + case LCT_MAX_OCTET_VALUE: return 31; /* invalid color type */ + default: return 31; /* invalid color type */ + } + return 0; /*allowed color type / bits combination*/ +} + +static unsigned getNumColorChannels(LodePNGColorType colortype) { + switch(colortype) { + case LCT_GREY: return 1; + case LCT_RGB: return 3; + case LCT_PALETTE: return 1; + case LCT_GREY_ALPHA: return 2; + case LCT_RGBA: return 4; + case LCT_MAX_OCTET_VALUE: return 0; /* invalid color type */ + default: return 0; /*invalid color type*/ + } +} + +static unsigned lodepng_get_bpp_lct(LodePNGColorType colortype, unsigned bitdepth) { + /*bits per pixel is amount of channels * bits per channel*/ + return getNumColorChannels(colortype) * bitdepth; +} + +/* ////////////////////////////////////////////////////////////////////////// */ + +void lodepng_color_mode_init(LodePNGColorMode* info) { + info->key_defined = 0; + info->key_r = info->key_g = info->key_b = 0; + info->colortype = LCT_RGBA; + info->bitdepth = 8; + info->palette = 0; + info->palettesize = 0; +} + +/*allocates palette memory if needed, and initializes all colors to black*/ +static void lodepng_color_mode_alloc_palette(LodePNGColorMode* info) { + size_t i; + /*if the palette is already allocated, it will have size 1024 so no reallocation needed in that case*/ + /*the palette must have room for up to 256 colors with 4 bytes each.*/ + if(!info->palette) info->palette = (unsigned char*)lodepng_malloc(1024); + if(!info->palette) return; /*alloc fail*/ + for(i = 0; i != 256; ++i) { + /*Initialize all unused colors with black, the value used for invalid palette indices. + This is an error according to the PNG spec, but common PNG decoders make it black instead. + That makes color conversion slightly faster due to no error handling needed.*/ + info->palette[i * 4 + 0] = 0; + info->palette[i * 4 + 1] = 0; + info->palette[i * 4 + 2] = 0; + info->palette[i * 4 + 3] = 255; + } +} + +void lodepng_color_mode_cleanup(LodePNGColorMode* info) { + lodepng_palette_clear(info); +} + +unsigned lodepng_color_mode_copy(LodePNGColorMode* dest, const LodePNGColorMode* source) { + lodepng_color_mode_cleanup(dest); + lodepng_memcpy(dest, source, sizeof(LodePNGColorMode)); + if(source->palette) { + dest->palette = (unsigned char*)lodepng_malloc(1024); + if(!dest->palette && source->palettesize) return 83; /*alloc fail*/ + lodepng_memcpy(dest->palette, source->palette, source->palettesize * 4); + } + return 0; +} + +LodePNGColorMode lodepng_color_mode_make(LodePNGColorType colortype, unsigned bitdepth) { + LodePNGColorMode result; + lodepng_color_mode_init(&result); + result.colortype = colortype; + result.bitdepth = bitdepth; + return result; +} + +static int lodepng_color_mode_equal(const LodePNGColorMode* a, const LodePNGColorMode* b) { + size_t i; + if(a->colortype != b->colortype) return 0; + if(a->bitdepth != b->bitdepth) return 0; + if(a->key_defined != b->key_defined) return 0; + if(a->key_defined) { + if(a->key_r != b->key_r) return 0; + if(a->key_g != b->key_g) return 0; + if(a->key_b != b->key_b) return 0; + } + if(a->palettesize != b->palettesize) return 0; + for(i = 0; i != a->palettesize * 4; ++i) { + if(a->palette[i] != b->palette[i]) return 0; + } + return 1; +} + +void lodepng_palette_clear(LodePNGColorMode* info) { + if(info->palette) lodepng_free(info->palette); + info->palette = 0; + info->palettesize = 0; +} + +unsigned lodepng_palette_add(LodePNGColorMode* info, + unsigned char r, unsigned char g, unsigned char b, unsigned char a) { + if(!info->palette) /*allocate palette if empty*/ { + lodepng_color_mode_alloc_palette(info); + if(!info->palette) return 83; /*alloc fail*/ + } + if(info->palettesize >= 256) { + return 108; /*too many palette values*/ + } + info->palette[4 * info->palettesize + 0] = r; + info->palette[4 * info->palettesize + 1] = g; + info->palette[4 * info->palettesize + 2] = b; + info->palette[4 * info->palettesize + 3] = a; + ++info->palettesize; + return 0; +} + +/*calculate bits per pixel out of colortype and bitdepth*/ +unsigned lodepng_get_bpp(const LodePNGColorMode* info) { + return lodepng_get_bpp_lct(info->colortype, info->bitdepth); +} + +unsigned lodepng_get_channels(const LodePNGColorMode* info) { + return getNumColorChannels(info->colortype); +} + +unsigned lodepng_is_greyscale_type(const LodePNGColorMode* info) { + return info->colortype == LCT_GREY || info->colortype == LCT_GREY_ALPHA; +} + +unsigned lodepng_is_alpha_type(const LodePNGColorMode* info) { + return (info->colortype & 4) != 0; /*4 or 6*/ +} + +unsigned lodepng_is_palette_type(const LodePNGColorMode* info) { + return info->colortype == LCT_PALETTE; +} + +unsigned lodepng_has_palette_alpha(const LodePNGColorMode* info) { + size_t i; + for(i = 0; i != info->palettesize; ++i) { + if(info->palette[i * 4 + 3] < 255) return 1; + } + return 0; +} + +unsigned lodepng_can_have_alpha(const LodePNGColorMode* info) { + return info->key_defined + || lodepng_is_alpha_type(info) + || lodepng_has_palette_alpha(info); +} + +static size_t lodepng_get_raw_size_lct(unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) { + size_t bpp = lodepng_get_bpp_lct(colortype, bitdepth); + size_t n = (size_t)w * (size_t)h; + return ((n / 8u) * bpp) + ((n & 7u) * bpp + 7u) / 8u; +} + +size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode* color) { + return lodepng_get_raw_size_lct(w, h, color->colortype, color->bitdepth); +} + + +#ifdef LODEPNG_COMPILE_PNG + +/*in an idat chunk, each scanline is a multiple of 8 bits, unlike the lodepng output buffer, +and in addition has one extra byte per line: the filter byte. So this gives a larger +result than lodepng_get_raw_size. Set h to 1 to get the size of 1 row including filter byte. */ +static size_t lodepng_get_raw_size_idat(unsigned w, unsigned h, unsigned bpp) { + /* + 1 for the filter byte, and possibly plus padding bits per line. */ + /* Ignoring casts, the expression is equal to (w * bpp + 7) / 8 + 1, but avoids overflow of w * bpp */ + size_t line = ((size_t)(w / 8u) * bpp) + 1u + ((w & 7u) * bpp + 7u) / 8u; + return (size_t)h * line; +} + +#ifdef LODEPNG_COMPILE_DECODER +/*Safely checks whether size_t overflow can be caused due to amount of pixels. +This check is overcautious rather than precise. If this check indicates no overflow, +you can safely compute in a size_t (but not an unsigned): +-(size_t)w * (size_t)h * 8 +-amount of bytes in IDAT (including filter, padding and Adam7 bytes) +-amount of bytes in raw color model +Returns 1 if overflow possible, 0 if not. +*/ +static int lodepng_pixel_overflow(unsigned w, unsigned h, + const LodePNGColorMode* pngcolor, const LodePNGColorMode* rawcolor) { + size_t bpp = LODEPNG_MAX(lodepng_get_bpp(pngcolor), lodepng_get_bpp(rawcolor)); + size_t numpixels, total; + size_t line; /* bytes per line in worst case */ + + if(lodepng_mulofl((size_t)w, (size_t)h, &numpixels)) return 1; + if(lodepng_mulofl(numpixels, 8, &total)) return 1; /* bit pointer with 8-bit color, or 8 bytes per channel color */ + + /* Bytes per scanline with the expression "(w / 8u) * bpp) + ((w & 7u) * bpp + 7u) / 8u" */ + if(lodepng_mulofl((size_t)(w / 8u), bpp, &line)) return 1; + if(lodepng_addofl(line, ((w & 7u) * bpp + 7u) / 8u, &line)) return 1; + + if(lodepng_addofl(line, 5, &line)) return 1; /* 5 bytes overhead per line: 1 filterbyte, 4 for Adam7 worst case */ + if(lodepng_mulofl(line, h, &total)) return 1; /* Total bytes in worst case */ + + return 0; /* no overflow */ +} +#endif /*LODEPNG_COMPILE_DECODER*/ +#endif /*LODEPNG_COMPILE_PNG*/ + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + +static void LodePNGUnknownChunks_init(LodePNGInfo* info) { + unsigned i; + for(i = 0; i != 3; ++i) info->unknown_chunks_data[i] = 0; + for(i = 0; i != 3; ++i) info->unknown_chunks_size[i] = 0; +} + +static void LodePNGUnknownChunks_cleanup(LodePNGInfo* info) { + unsigned i; + for(i = 0; i != 3; ++i) lodepng_free(info->unknown_chunks_data[i]); +} + +static unsigned LodePNGUnknownChunks_copy(LodePNGInfo* dest, const LodePNGInfo* src) { + unsigned i; + + LodePNGUnknownChunks_cleanup(dest); + + for(i = 0; i != 3; ++i) { + size_t j; + dest->unknown_chunks_size[i] = src->unknown_chunks_size[i]; + dest->unknown_chunks_data[i] = (unsigned char*)lodepng_malloc(src->unknown_chunks_size[i]); + if(!dest->unknown_chunks_data[i] && dest->unknown_chunks_size[i]) return 83; /*alloc fail*/ + for(j = 0; j < src->unknown_chunks_size[i]; ++j) { + dest->unknown_chunks_data[i][j] = src->unknown_chunks_data[i][j]; + } + } + + return 0; +} + +/******************************************************************************/ + +static void LodePNGText_init(LodePNGInfo* info) { + info->text_num = 0; + info->text_keys = NULL; + info->text_strings = NULL; +} + +static void LodePNGText_cleanup(LodePNGInfo* info) { + size_t i; + for(i = 0; i != info->text_num; ++i) { + string_cleanup(&info->text_keys[i]); + string_cleanup(&info->text_strings[i]); + } + lodepng_free(info->text_keys); + lodepng_free(info->text_strings); +} + +static unsigned LodePNGText_copy(LodePNGInfo* dest, const LodePNGInfo* source) { + size_t i = 0; + dest->text_keys = NULL; + dest->text_strings = NULL; + dest->text_num = 0; + for(i = 0; i != source->text_num; ++i) { + CERROR_TRY_RETURN(lodepng_add_text(dest, source->text_keys[i], source->text_strings[i])); + } + return 0; +} + +static unsigned lodepng_add_text_sized(LodePNGInfo* info, const char* key, const char* str, size_t size) { + char** new_keys = (char**)(lodepng_realloc(info->text_keys, sizeof(char*) * (info->text_num + 1))); + char** new_strings = (char**)(lodepng_realloc(info->text_strings, sizeof(char*) * (info->text_num + 1))); + + if(new_keys) info->text_keys = new_keys; + if(new_strings) info->text_strings = new_strings; + + if(!new_keys || !new_strings) return 83; /*alloc fail*/ + + ++info->text_num; + info->text_keys[info->text_num - 1] = alloc_string(key); + info->text_strings[info->text_num - 1] = alloc_string_sized(str, size); + if(!info->text_keys[info->text_num - 1] || !info->text_strings[info->text_num - 1]) return 83; /*alloc fail*/ + + return 0; +} + +unsigned lodepng_add_text(LodePNGInfo* info, const char* key, const char* str) { + return lodepng_add_text_sized(info, key, str, lodepng_strlen(str)); +} + +void lodepng_clear_text(LodePNGInfo* info) { + LodePNGText_cleanup(info); +} + +/******************************************************************************/ + +static void LodePNGIText_init(LodePNGInfo* info) { + info->itext_num = 0; + info->itext_keys = NULL; + info->itext_langtags = NULL; + info->itext_transkeys = NULL; + info->itext_strings = NULL; +} + +static void LodePNGIText_cleanup(LodePNGInfo* info) { + size_t i; + for(i = 0; i != info->itext_num; ++i) { + string_cleanup(&info->itext_keys[i]); + string_cleanup(&info->itext_langtags[i]); + string_cleanup(&info->itext_transkeys[i]); + string_cleanup(&info->itext_strings[i]); + } + lodepng_free(info->itext_keys); + lodepng_free(info->itext_langtags); + lodepng_free(info->itext_transkeys); + lodepng_free(info->itext_strings); +} + +static unsigned LodePNGIText_copy(LodePNGInfo* dest, const LodePNGInfo* source) { + size_t i = 0; + dest->itext_keys = NULL; + dest->itext_langtags = NULL; + dest->itext_transkeys = NULL; + dest->itext_strings = NULL; + dest->itext_num = 0; + for(i = 0; i != source->itext_num; ++i) { + CERROR_TRY_RETURN(lodepng_add_itext(dest, source->itext_keys[i], source->itext_langtags[i], + source->itext_transkeys[i], source->itext_strings[i])); + } + return 0; +} + +void lodepng_clear_itext(LodePNGInfo* info) { + LodePNGIText_cleanup(info); +} + +static unsigned lodepng_add_itext_sized(LodePNGInfo* info, const char* key, const char* langtag, + const char* transkey, const char* str, size_t size) { + char** new_keys = (char**)(lodepng_realloc(info->itext_keys, sizeof(char*) * (info->itext_num + 1))); + char** new_langtags = (char**)(lodepng_realloc(info->itext_langtags, sizeof(char*) * (info->itext_num + 1))); + char** new_transkeys = (char**)(lodepng_realloc(info->itext_transkeys, sizeof(char*) * (info->itext_num + 1))); + char** new_strings = (char**)(lodepng_realloc(info->itext_strings, sizeof(char*) * (info->itext_num + 1))); + + if(new_keys) info->itext_keys = new_keys; + if(new_langtags) info->itext_langtags = new_langtags; + if(new_transkeys) info->itext_transkeys = new_transkeys; + if(new_strings) info->itext_strings = new_strings; + + if(!new_keys || !new_langtags || !new_transkeys || !new_strings) return 83; /*alloc fail*/ + + ++info->itext_num; + + info->itext_keys[info->itext_num - 1] = alloc_string(key); + info->itext_langtags[info->itext_num - 1] = alloc_string(langtag); + info->itext_transkeys[info->itext_num - 1] = alloc_string(transkey); + info->itext_strings[info->itext_num - 1] = alloc_string_sized(str, size); + + return 0; +} + +unsigned lodepng_add_itext(LodePNGInfo* info, const char* key, const char* langtag, + const char* transkey, const char* str) { + return lodepng_add_itext_sized(info, key, langtag, transkey, str, lodepng_strlen(str)); +} + +/* same as set but does not delete */ +static unsigned lodepng_assign_icc(LodePNGInfo* info, const char* name, const unsigned char* profile, unsigned profile_size) { + if(profile_size == 0) return 100; /*invalid ICC profile size*/ + + info->iccp_name = alloc_string(name); + info->iccp_profile = (unsigned char*)lodepng_malloc(profile_size); + + if(!info->iccp_name || !info->iccp_profile) return 83; /*alloc fail*/ + + lodepng_memcpy(info->iccp_profile, profile, profile_size); + info->iccp_profile_size = profile_size; + + return 0; /*ok*/ +} + +unsigned lodepng_set_icc(LodePNGInfo* info, const char* name, const unsigned char* profile, unsigned profile_size) { + if(info->iccp_name) lodepng_clear_icc(info); + info->iccp_defined = 1; + + return lodepng_assign_icc(info, name, profile, profile_size); +} + +void lodepng_clear_icc(LodePNGInfo* info) { + string_cleanup(&info->iccp_name); + lodepng_free(info->iccp_profile); + info->iccp_profile = NULL; + info->iccp_profile_size = 0; + info->iccp_defined = 0; +} +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +void lodepng_info_init(LodePNGInfo* info) { + lodepng_color_mode_init(&info->color); + info->interlace_method = 0; + info->compression_method = 0; + info->filter_method = 0; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + info->background_defined = 0; + info->background_r = info->background_g = info->background_b = 0; + + LodePNGText_init(info); + LodePNGIText_init(info); + + info->time_defined = 0; + info->phys_defined = 0; + + info->gama_defined = 0; + info->chrm_defined = 0; + info->srgb_defined = 0; + info->iccp_defined = 0; + info->iccp_name = NULL; + info->iccp_profile = NULL; + + LodePNGUnknownChunks_init(info); +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ +} + +void lodepng_info_cleanup(LodePNGInfo* info) { + lodepng_color_mode_cleanup(&info->color); +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + LodePNGText_cleanup(info); + LodePNGIText_cleanup(info); + + lodepng_clear_icc(info); + + LodePNGUnknownChunks_cleanup(info); +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ +} + +unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source) { + lodepng_info_cleanup(dest); + lodepng_memcpy(dest, source, sizeof(LodePNGInfo)); + lodepng_color_mode_init(&dest->color); + CERROR_TRY_RETURN(lodepng_color_mode_copy(&dest->color, &source->color)); + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + CERROR_TRY_RETURN(LodePNGText_copy(dest, source)); + CERROR_TRY_RETURN(LodePNGIText_copy(dest, source)); + if(source->iccp_defined) { + CERROR_TRY_RETURN(lodepng_assign_icc(dest, source->iccp_name, source->iccp_profile, source->iccp_profile_size)); + } + + LodePNGUnknownChunks_init(dest); + CERROR_TRY_RETURN(LodePNGUnknownChunks_copy(dest, source)); +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + return 0; +} + +/* ////////////////////////////////////////////////////////////////////////// */ + +/*index: bitgroup index, bits: bitgroup size(1, 2 or 4), in: bitgroup value, out: octet array to add bits to*/ +static void addColorBits(unsigned char* out, size_t index, unsigned bits, unsigned in) { + unsigned m = bits == 1 ? 7 : bits == 2 ? 3 : 1; /*8 / bits - 1*/ + /*p = the partial index in the byte, e.g. with 4 palettebits it is 0 for first half or 1 for second half*/ + unsigned p = index & m; + in &= (1u << bits) - 1u; /*filter out any other bits of the input value*/ + in = in << (bits * (m - p)); + if(p == 0) out[index * bits / 8u] = in; + else out[index * bits / 8u] |= in; +} + +typedef struct ColorTree ColorTree; + +/* +One node of a color tree +This is the data structure used to count the number of unique colors and to get a palette +index for a color. It's like an octree, but because the alpha channel is used too, each +node has 16 instead of 8 children. +*/ +struct ColorTree { + ColorTree* children[16]; /*up to 16 pointers to ColorTree of next level*/ + int index; /*the payload. Only has a meaningful value if this is in the last level*/ +}; + +static void color_tree_init(ColorTree* tree) { + lodepng_memset(tree->children, 0, 16 * sizeof(*tree->children)); + tree->index = -1; +} + +static void color_tree_cleanup(ColorTree* tree) { + int i; + for(i = 0; i != 16; ++i) { + if(tree->children[i]) { + color_tree_cleanup(tree->children[i]); + lodepng_free(tree->children[i]); + } + } +} + +/*returns -1 if color not present, its index otherwise*/ +static int color_tree_get(ColorTree* tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a) { + int bit = 0; + for(bit = 0; bit < 8; ++bit) { + int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + 1 * ((a >> bit) & 1); + if(!tree->children[i]) return -1; + else tree = tree->children[i]; + } + return tree ? tree->index : -1; +} + +#ifdef LODEPNG_COMPILE_ENCODER +static int color_tree_has(ColorTree* tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a) { + return color_tree_get(tree, r, g, b, a) >= 0; +} +#endif /*LODEPNG_COMPILE_ENCODER*/ + +/*color is not allowed to already exist. +Index should be >= 0 (it's signed to be compatible with using -1 for "doesn't exist") +Returns error code, or 0 if ok*/ +static unsigned color_tree_add(ColorTree* tree, + unsigned char r, unsigned char g, unsigned char b, unsigned char a, unsigned index) { + int bit; + for(bit = 0; bit < 8; ++bit) { + int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + 1 * ((a >> bit) & 1); + if(!tree->children[i]) { + tree->children[i] = (ColorTree*)lodepng_malloc(sizeof(ColorTree)); + if(!tree->children[i]) return 83; /*alloc fail*/ + color_tree_init(tree->children[i]); + } + tree = tree->children[i]; + } + tree->index = (int)index; + return 0; +} + +/*put a pixel, given its RGBA color, into image of any color type*/ +static unsigned rgba8ToPixel(unsigned char* out, size_t i, + const LodePNGColorMode* mode, ColorTree* tree /*for palette*/, + unsigned char r, unsigned char g, unsigned char b, unsigned char a) { + if(mode->colortype == LCT_GREY) { + unsigned char gray = r; /*((unsigned short)r + g + b) / 3u;*/ + if(mode->bitdepth == 8) out[i] = gray; + else if(mode->bitdepth == 16) out[i * 2 + 0] = out[i * 2 + 1] = gray; + else { + /*take the most significant bits of gray*/ + gray = ((unsigned)gray >> (8u - mode->bitdepth)) & ((1u << mode->bitdepth) - 1u); + addColorBits(out, i, mode->bitdepth, gray); + } + } else if(mode->colortype == LCT_RGB) { + if(mode->bitdepth == 8) { + out[i * 3 + 0] = r; + out[i * 3 + 1] = g; + out[i * 3 + 2] = b; + } else { + out[i * 6 + 0] = out[i * 6 + 1] = r; + out[i * 6 + 2] = out[i * 6 + 3] = g; + out[i * 6 + 4] = out[i * 6 + 5] = b; + } + } else if(mode->colortype == LCT_PALETTE) { + int index = color_tree_get(tree, r, g, b, a); + if(index < 0) return 82; /*color not in palette*/ + if(mode->bitdepth == 8) out[i] = index; + else addColorBits(out, i, mode->bitdepth, (unsigned)index); + } else if(mode->colortype == LCT_GREY_ALPHA) { + unsigned char gray = r; /*((unsigned short)r + g + b) / 3u;*/ + if(mode->bitdepth == 8) { + out[i * 2 + 0] = gray; + out[i * 2 + 1] = a; + } else if(mode->bitdepth == 16) { + out[i * 4 + 0] = out[i * 4 + 1] = gray; + out[i * 4 + 2] = out[i * 4 + 3] = a; + } + } else if(mode->colortype == LCT_RGBA) { + if(mode->bitdepth == 8) { + out[i * 4 + 0] = r; + out[i * 4 + 1] = g; + out[i * 4 + 2] = b; + out[i * 4 + 3] = a; + } else { + out[i * 8 + 0] = out[i * 8 + 1] = r; + out[i * 8 + 2] = out[i * 8 + 3] = g; + out[i * 8 + 4] = out[i * 8 + 5] = b; + out[i * 8 + 6] = out[i * 8 + 7] = a; + } + } + + return 0; /*no error*/ +} + +/*put a pixel, given its RGBA16 color, into image of any color 16-bitdepth type*/ +static void rgba16ToPixel(unsigned char* out, size_t i, + const LodePNGColorMode* mode, + unsigned short r, unsigned short g, unsigned short b, unsigned short a) { + if(mode->colortype == LCT_GREY) { + unsigned short gray = r; /*((unsigned)r + g + b) / 3u;*/ + out[i * 2 + 0] = (gray >> 8) & 255; + out[i * 2 + 1] = gray & 255; + } else if(mode->colortype == LCT_RGB) { + out[i * 6 + 0] = (r >> 8) & 255; + out[i * 6 + 1] = r & 255; + out[i * 6 + 2] = (g >> 8) & 255; + out[i * 6 + 3] = g & 255; + out[i * 6 + 4] = (b >> 8) & 255; + out[i * 6 + 5] = b & 255; + } else if(mode->colortype == LCT_GREY_ALPHA) { + unsigned short gray = r; /*((unsigned)r + g + b) / 3u;*/ + out[i * 4 + 0] = (gray >> 8) & 255; + out[i * 4 + 1] = gray & 255; + out[i * 4 + 2] = (a >> 8) & 255; + out[i * 4 + 3] = a & 255; + } else if(mode->colortype == LCT_RGBA) { + out[i * 8 + 0] = (r >> 8) & 255; + out[i * 8 + 1] = r & 255; + out[i * 8 + 2] = (g >> 8) & 255; + out[i * 8 + 3] = g & 255; + out[i * 8 + 4] = (b >> 8) & 255; + out[i * 8 + 5] = b & 255; + out[i * 8 + 6] = (a >> 8) & 255; + out[i * 8 + 7] = a & 255; + } +} + +/*Get RGBA8 color of pixel with index i (y * width + x) from the raw image with given color type.*/ +static void getPixelColorRGBA8(unsigned char* r, unsigned char* g, + unsigned char* b, unsigned char* a, + const unsigned char* in, size_t i, + const LodePNGColorMode* mode) { + if(mode->colortype == LCT_GREY) { + if(mode->bitdepth == 8) { + *r = *g = *b = in[i]; + if(mode->key_defined && *r == mode->key_r) *a = 0; + else *a = 255; + } else if(mode->bitdepth == 16) { + *r = *g = *b = in[i * 2 + 0]; + if(mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r) *a = 0; + else *a = 255; + } else { + unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ + size_t j = i * mode->bitdepth; + unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); + *r = *g = *b = (value * 255) / highest; + if(mode->key_defined && value == mode->key_r) *a = 0; + else *a = 255; + } + } else if(mode->colortype == LCT_RGB) { + if(mode->bitdepth == 8) { + *r = in[i * 3 + 0]; *g = in[i * 3 + 1]; *b = in[i * 3 + 2]; + if(mode->key_defined && *r == mode->key_r && *g == mode->key_g && *b == mode->key_b) *a = 0; + else *a = 255; + } else { + *r = in[i * 6 + 0]; + *g = in[i * 6 + 2]; + *b = in[i * 6 + 4]; + if(mode->key_defined && 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r + && 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g + && 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b) *a = 0; + else *a = 255; + } + } else if(mode->colortype == LCT_PALETTE) { + unsigned index; + if(mode->bitdepth == 8) index = in[i]; + else { + size_t j = i * mode->bitdepth; + index = readBitsFromReversedStream(&j, in, mode->bitdepth); + } + /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ + *r = mode->palette[index * 4 + 0]; + *g = mode->palette[index * 4 + 1]; + *b = mode->palette[index * 4 + 2]; + *a = mode->palette[index * 4 + 3]; + } else if(mode->colortype == LCT_GREY_ALPHA) { + if(mode->bitdepth == 8) { + *r = *g = *b = in[i * 2 + 0]; + *a = in[i * 2 + 1]; + } else { + *r = *g = *b = in[i * 4 + 0]; + *a = in[i * 4 + 2]; + } + } else if(mode->colortype == LCT_RGBA) { + if(mode->bitdepth == 8) { + *r = in[i * 4 + 0]; + *g = in[i * 4 + 1]; + *b = in[i * 4 + 2]; + *a = in[i * 4 + 3]; + } else { + *r = in[i * 8 + 0]; + *g = in[i * 8 + 2]; + *b = in[i * 8 + 4]; + *a = in[i * 8 + 6]; + } + } +} + +/*Similar to getPixelColorRGBA8, but with all the for loops inside of the color +mode test cases, optimized to convert the colors much faster, when converting +to the common case of RGBA with 8 bit per channel. buffer must be RGBA with +enough memory.*/ +static void getPixelColorsRGBA8(unsigned char* LODEPNG_RESTRICT buffer, size_t numpixels, + const unsigned char* LODEPNG_RESTRICT in, + const LodePNGColorMode* mode) { + unsigned num_channels = 4; + size_t i; + if(mode->colortype == LCT_GREY) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i]; + buffer[3] = 255; + } + if(mode->key_defined) { + buffer -= numpixels * num_channels; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + if(buffer[0] == mode->key_r) buffer[3] = 0; + } + } + } else if(mode->bitdepth == 16) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 2]; + buffer[3] = mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r ? 0 : 255; + } + } else { + unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ + size_t j = 0; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); + buffer[0] = buffer[1] = buffer[2] = (value * 255) / highest; + buffer[3] = mode->key_defined && value == mode->key_r ? 0 : 255; + } + } + } else if(mode->colortype == LCT_RGB) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + lodepng_memcpy(buffer, &in[i * 3], 3); + buffer[3] = 255; + } + if(mode->key_defined) { + buffer -= numpixels * num_channels; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + if(buffer[0] == mode->key_r && buffer[1]== mode->key_g && buffer[2] == mode->key_b) buffer[3] = 0; + } + } + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = in[i * 6 + 0]; + buffer[1] = in[i * 6 + 2]; + buffer[2] = in[i * 6 + 4]; + buffer[3] = mode->key_defined + && 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r + && 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g + && 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b ? 0 : 255; + } + } + } else if(mode->colortype == LCT_PALETTE) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned index = in[i]; + /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ + lodepng_memcpy(buffer, &mode->palette[index * 4], 4); + } + } else { + size_t j = 0; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned index = readBitsFromReversedStream(&j, in, mode->bitdepth); + /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ + lodepng_memcpy(buffer, &mode->palette[index * 4], 4); + } + } + } else if(mode->colortype == LCT_GREY_ALPHA) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 2 + 0]; + buffer[3] = in[i * 2 + 1]; + } + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 4 + 0]; + buffer[3] = in[i * 4 + 2]; + } + } + } else if(mode->colortype == LCT_RGBA) { + if(mode->bitdepth == 8) { + lodepng_memcpy(buffer, in, numpixels * 4); + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = in[i * 8 + 0]; + buffer[1] = in[i * 8 + 2]; + buffer[2] = in[i * 8 + 4]; + buffer[3] = in[i * 8 + 6]; + } + } + } +} + +/*Similar to getPixelColorsRGBA8, but with 3-channel RGB output.*/ +static void getPixelColorsRGB8(unsigned char* LODEPNG_RESTRICT buffer, size_t numpixels, + const unsigned char* LODEPNG_RESTRICT in, + const LodePNGColorMode* mode) { + const unsigned num_channels = 3; + size_t i; + if(mode->colortype == LCT_GREY) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i]; + } + } else if(mode->bitdepth == 16) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 2]; + } + } else { + unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ + size_t j = 0; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); + buffer[0] = buffer[1] = buffer[2] = (value * 255) / highest; + } + } + } else if(mode->colortype == LCT_RGB) { + if(mode->bitdepth == 8) { + lodepng_memcpy(buffer, in, numpixels * 3); + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = in[i * 6 + 0]; + buffer[1] = in[i * 6 + 2]; + buffer[2] = in[i * 6 + 4]; + } + } + } else if(mode->colortype == LCT_PALETTE) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned index = in[i]; + /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ + lodepng_memcpy(buffer, &mode->palette[index * 4], 3); + } + } else { + size_t j = 0; + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + unsigned index = readBitsFromReversedStream(&j, in, mode->bitdepth); + /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ + lodepng_memcpy(buffer, &mode->palette[index * 4], 3); + } + } + } else if(mode->colortype == LCT_GREY_ALPHA) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 2 + 0]; + } + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = buffer[1] = buffer[2] = in[i * 4 + 0]; + } + } + } else if(mode->colortype == LCT_RGBA) { + if(mode->bitdepth == 8) { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + lodepng_memcpy(buffer, &in[i * 4], 3); + } + } else { + for(i = 0; i != numpixels; ++i, buffer += num_channels) { + buffer[0] = in[i * 8 + 0]; + buffer[1] = in[i * 8 + 2]; + buffer[2] = in[i * 8 + 4]; + } + } + } +} + +/*Get RGBA16 color of pixel with index i (y * width + x) from the raw image with +given color type, but the given color type must be 16-bit itself.*/ +static void getPixelColorRGBA16(unsigned short* r, unsigned short* g, unsigned short* b, unsigned short* a, + const unsigned char* in, size_t i, const LodePNGColorMode* mode) { + if(mode->colortype == LCT_GREY) { + *r = *g = *b = 256 * in[i * 2 + 0] + in[i * 2 + 1]; + if(mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r) *a = 0; + else *a = 65535; + } else if(mode->colortype == LCT_RGB) { + *r = 256u * in[i * 6 + 0] + in[i * 6 + 1]; + *g = 256u * in[i * 6 + 2] + in[i * 6 + 3]; + *b = 256u * in[i * 6 + 4] + in[i * 6 + 5]; + if(mode->key_defined + && 256u * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r + && 256u * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g + && 256u * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b) *a = 0; + else *a = 65535; + } else if(mode->colortype == LCT_GREY_ALPHA) { + *r = *g = *b = 256u * in[i * 4 + 0] + in[i * 4 + 1]; + *a = 256u * in[i * 4 + 2] + in[i * 4 + 3]; + } else if(mode->colortype == LCT_RGBA) { + *r = 256u * in[i * 8 + 0] + in[i * 8 + 1]; + *g = 256u * in[i * 8 + 2] + in[i * 8 + 3]; + *b = 256u * in[i * 8 + 4] + in[i * 8 + 5]; + *a = 256u * in[i * 8 + 6] + in[i * 8 + 7]; + } +} + +unsigned lodepng_convert(unsigned char* out, const unsigned char* in, + const LodePNGColorMode* mode_out, const LodePNGColorMode* mode_in, + unsigned w, unsigned h) { + size_t i; + ColorTree tree; + size_t numpixels = (size_t)w * (size_t)h; + unsigned error = 0; + + if(mode_in->colortype == LCT_PALETTE && !mode_in->palette) { + return 107; /* error: must provide palette if input mode is palette */ + } + + if(lodepng_color_mode_equal(mode_out, mode_in)) { + size_t numbytes = lodepng_get_raw_size(w, h, mode_in); + lodepng_memcpy(out, in, numbytes); + return 0; + } + + if(mode_out->colortype == LCT_PALETTE) { + size_t palettesize = mode_out->palettesize; + const unsigned char* palette = mode_out->palette; + size_t palsize = (size_t)1u << mode_out->bitdepth; + /*if the user specified output palette but did not give the values, assume + they want the values of the input color type (assuming that one is palette). + Note that we never create a new palette ourselves.*/ + if(palettesize == 0) { + palettesize = mode_in->palettesize; + palette = mode_in->palette; + /*if the input was also palette with same bitdepth, then the color types are also + equal, so copy literally. This to preserve the exact indices that were in the PNG + even in case there are duplicate colors in the palette.*/ + if(mode_in->colortype == LCT_PALETTE && mode_in->bitdepth == mode_out->bitdepth) { + size_t numbytes = lodepng_get_raw_size(w, h, mode_in); + lodepng_memcpy(out, in, numbytes); + return 0; + } + } + if(palettesize < palsize) palsize = palettesize; + color_tree_init(&tree); + for(i = 0; i != palsize; ++i) { + const unsigned char* p = &palette[i * 4]; + error = color_tree_add(&tree, p[0], p[1], p[2], p[3], (unsigned)i); + if(error) break; + } + } + + if(!error) { + if(mode_in->bitdepth == 16 && mode_out->bitdepth == 16) { + for(i = 0; i != numpixels; ++i) { + unsigned short r = 0, g = 0, b = 0, a = 0; + getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); + rgba16ToPixel(out, i, mode_out, r, g, b, a); + } + } else if(mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGBA) { + getPixelColorsRGBA8(out, numpixels, in, mode_in); + } else if(mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGB) { + getPixelColorsRGB8(out, numpixels, in, mode_in); + } else { + unsigned char r = 0, g = 0, b = 0, a = 0; + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); + error = rgba8ToPixel(out, i, mode_out, &tree, r, g, b, a); + if(error) break; + } + } + } + + if(mode_out->colortype == LCT_PALETTE) { + color_tree_cleanup(&tree); + } + + return error; +} + + +/* Converts a single rgb color without alpha from one type to another, color bits truncated to +their bitdepth. In case of single channel (gray or palette), only the r channel is used. Slow +function, do not use to process all pixels of an image. Alpha channel not supported on purpose: +this is for bKGD, supporting alpha may prevent it from finding a color in the palette, from the +specification it looks like bKGD should ignore the alpha values of the palette since it can use +any palette index but doesn't have an alpha channel. Idem with ignoring color key. */ +static unsigned lodepng_convert_rgb( + unsigned* r_out, unsigned* g_out, unsigned* b_out, + unsigned r_in, unsigned g_in, unsigned b_in, + const LodePNGColorMode* mode_out, const LodePNGColorMode* mode_in) { + unsigned r = 0, g = 0, b = 0; + unsigned mul = 65535 / ((1u << mode_in->bitdepth) - 1u); /*65535, 21845, 4369, 257, 1*/ + unsigned shift = 16 - mode_out->bitdepth; + + if(mode_in->colortype == LCT_GREY || mode_in->colortype == LCT_GREY_ALPHA) { + r = g = b = r_in * mul; + } else if(mode_in->colortype == LCT_RGB || mode_in->colortype == LCT_RGBA) { + r = r_in * mul; + g = g_in * mul; + b = b_in * mul; + } else if(mode_in->colortype == LCT_PALETTE) { + if(r_in >= mode_in->palettesize) return 82; + r = mode_in->palette[r_in * 4 + 0] * 257u; + g = mode_in->palette[r_in * 4 + 1] * 257u; + b = mode_in->palette[r_in * 4 + 2] * 257u; + } else { + return 31; + } + + /* now convert to output format */ + if(mode_out->colortype == LCT_GREY || mode_out->colortype == LCT_GREY_ALPHA) { + *r_out = r >> shift ; + } else if(mode_out->colortype == LCT_RGB || mode_out->colortype == LCT_RGBA) { + *r_out = r >> shift ; + *g_out = g >> shift ; + *b_out = b >> shift ; + } else if(mode_out->colortype == LCT_PALETTE) { + unsigned i; + /* a 16-bit color cannot be in the palette */ + if((r >> 8) != (r & 255) || (g >> 8) != (g & 255) || (b >> 8) != (b & 255)) return 82; + for(i = 0; i < mode_out->palettesize; i++) { + unsigned j = i * 4; + if((r >> 8) == mode_out->palette[j + 0] && (g >> 8) == mode_out->palette[j + 1] && + (b >> 8) == mode_out->palette[j + 2]) { + *r_out = i; + return 0; + } + } + return 82; + } else { + return 31; + } + + return 0; +} + +#ifdef LODEPNG_COMPILE_ENCODER + +void lodepng_color_stats_init(LodePNGColorStats* stats) { + /*stats*/ + stats->colored = 0; + stats->key = 0; + stats->key_r = stats->key_g = stats->key_b = 0; + stats->alpha = 0; + stats->numcolors = 0; + stats->bits = 1; + stats->numpixels = 0; + /*settings*/ + stats->allow_palette = 1; + stats->allow_greyscale = 1; +} + +/*function used for debug purposes with C++*/ +/*void printColorStats(LodePNGColorStats* p) { + std::cout << "colored: " << (int)p->colored << ", "; + std::cout << "key: " << (int)p->key << ", "; + std::cout << "key_r: " << (int)p->key_r << ", "; + std::cout << "key_g: " << (int)p->key_g << ", "; + std::cout << "key_b: " << (int)p->key_b << ", "; + std::cout << "alpha: " << (int)p->alpha << ", "; + std::cout << "numcolors: " << (int)p->numcolors << ", "; + std::cout << "bits: " << (int)p->bits << std::endl; +}*/ + +/*Returns how many bits needed to represent given value (max 8 bit)*/ +static unsigned getValueRequiredBits(unsigned char value) { + if(value == 0 || value == 255) return 1; + /*The scaling of 2-bit and 4-bit values uses multiples of 85 and 17*/ + if(value % 17 == 0) return value % 85 == 0 ? 2 : 4; + return 8; +} + +/*stats must already have been inited. */ +unsigned lodepng_compute_color_stats(LodePNGColorStats* stats, + const unsigned char* in, unsigned w, unsigned h, + const LodePNGColorMode* mode_in) { + size_t i; + ColorTree tree; + size_t numpixels = (size_t)w * (size_t)h; + unsigned error = 0; + + /* mark things as done already if it would be impossible to have a more expensive case */ + unsigned colored_done = lodepng_is_greyscale_type(mode_in) ? 1 : 0; + unsigned alpha_done = lodepng_can_have_alpha(mode_in) ? 0 : 1; + unsigned numcolors_done = 0; + unsigned bpp = lodepng_get_bpp(mode_in); + unsigned bits_done = (stats->bits == 1 && bpp == 1) ? 1 : 0; + unsigned sixteen = 0; /* whether the input image is 16 bit */ + unsigned maxnumcolors = 257; + if(bpp <= 8) maxnumcolors = LODEPNG_MIN(257, stats->numcolors + (1u << bpp)); + + stats->numpixels += numpixels; + + /*if palette not allowed, no need to compute numcolors*/ + if(!stats->allow_palette) numcolors_done = 1; + + color_tree_init(&tree); + + /*If the stats was already filled in from previous data, fill its palette in tree + and mark things as done already if we know they are the most expensive case already*/ + if(stats->alpha) alpha_done = 1; + if(stats->colored) colored_done = 1; + if(stats->bits == 16) numcolors_done = 1; + if(stats->bits >= bpp) bits_done = 1; + if(stats->numcolors >= maxnumcolors) numcolors_done = 1; + + if(!numcolors_done) { + for(i = 0; i < stats->numcolors; i++) { + const unsigned char* color = &stats->palette[i * 4]; + error = color_tree_add(&tree, color[0], color[1], color[2], color[3], i); + if(error) goto cleanup; + } + } + + /*Check if the 16-bit input is truly 16-bit*/ + if(mode_in->bitdepth == 16 && !sixteen) { + unsigned short r = 0, g = 0, b = 0, a = 0; + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); + if((r & 255) != ((r >> 8) & 255) || (g & 255) != ((g >> 8) & 255) || + (b & 255) != ((b >> 8) & 255) || (a & 255) != ((a >> 8) & 255)) /*first and second byte differ*/ { + stats->bits = 16; + sixteen = 1; + bits_done = 1; + numcolors_done = 1; /*counting colors no longer useful, palette doesn't support 16-bit*/ + break; + } + } + } + + if(sixteen) { + unsigned short r = 0, g = 0, b = 0, a = 0; + + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); + + if(!colored_done && (r != g || r != b)) { + stats->colored = 1; + colored_done = 1; + } + + if(!alpha_done) { + unsigned matchkey = (r == stats->key_r && g == stats->key_g && b == stats->key_b); + if(a != 65535 && (a != 0 || (stats->key && !matchkey))) { + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + } else if(a == 0 && !stats->alpha && !stats->key) { + stats->key = 1; + stats->key_r = r; + stats->key_g = g; + stats->key_b = b; + } else if(a == 65535 && stats->key && matchkey) { + /* Color key cannot be used if an opaque pixel also has that RGB color. */ + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + } + } + if(alpha_done && numcolors_done && colored_done && bits_done) break; + } + + if(stats->key && !stats->alpha) { + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); + if(a != 0 && r == stats->key_r && g == stats->key_g && b == stats->key_b) { + /* Color key cannot be used if an opaque pixel also has that RGB color. */ + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + } + } + } + } else /* < 16-bit */ { + unsigned char r = 0, g = 0, b = 0, a = 0; + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); + + if(!bits_done && stats->bits < 8) { + /*only r is checked, < 8 bits is only relevant for grayscale*/ + unsigned bits = getValueRequiredBits(r); + if(bits > stats->bits) stats->bits = bits; + } + bits_done = (stats->bits >= bpp); + + if(!colored_done && (r != g || r != b)) { + stats->colored = 1; + colored_done = 1; + if(stats->bits < 8) stats->bits = 8; /*PNG has no colored modes with less than 8-bit per channel*/ + } + + if(!alpha_done) { + unsigned matchkey = (r == stats->key_r && g == stats->key_g && b == stats->key_b); + if(a != 255 && (a != 0 || (stats->key && !matchkey))) { + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ + } else if(a == 0 && !stats->alpha && !stats->key) { + stats->key = 1; + stats->key_r = r; + stats->key_g = g; + stats->key_b = b; + } else if(a == 255 && stats->key && matchkey) { + /* Color key cannot be used if an opaque pixel also has that RGB color. */ + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ + } + } + + if(!numcolors_done) { + if(!color_tree_has(&tree, r, g, b, a)) { + error = color_tree_add(&tree, r, g, b, a, stats->numcolors); + if(error) goto cleanup; + if(stats->numcolors < 256) { + unsigned char* p = stats->palette; + unsigned n = stats->numcolors; + p[n * 4 + 0] = r; + p[n * 4 + 1] = g; + p[n * 4 + 2] = b; + p[n * 4 + 3] = a; + } + ++stats->numcolors; + numcolors_done = stats->numcolors >= maxnumcolors; + } + } + + if(alpha_done && numcolors_done && colored_done && bits_done) break; + } + + if(stats->key && !stats->alpha) { + for(i = 0; i != numpixels; ++i) { + getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); + if(a != 0 && r == stats->key_r && g == stats->key_g && b == stats->key_b) { + /* Color key cannot be used if an opaque pixel also has that RGB color. */ + stats->alpha = 1; + stats->key = 0; + alpha_done = 1; + if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ + } + } + } + + /*make the stats's key always 16-bit for consistency - repeat each byte twice*/ + stats->key_r += (stats->key_r << 8); + stats->key_g += (stats->key_g << 8); + stats->key_b += (stats->key_b << 8); + } + +cleanup: + color_tree_cleanup(&tree); + return error; +} + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS +/*Adds a single color to the color stats. The stats must already have been inited. The color must be given as 16-bit +(with 2 bytes repeating for 8-bit and 65535 for opaque alpha channel). This function is expensive, do not call it for +all pixels of an image but only for a few additional values. */ +static unsigned lodepng_color_stats_add(LodePNGColorStats* stats, + unsigned r, unsigned g, unsigned b, unsigned a) { + unsigned error = 0; + unsigned char image[8]; + LodePNGColorMode mode; + lodepng_color_mode_init(&mode); + image[0] = r >> 8; image[1] = r; image[2] = g >> 8; image[3] = g; + image[4] = b >> 8; image[5] = b; image[6] = a >> 8; image[7] = a; + mode.bitdepth = 16; + mode.colortype = LCT_RGBA; + error = lodepng_compute_color_stats(stats, image, 1, 1, &mode); + lodepng_color_mode_cleanup(&mode); + return error; +} +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +/*Computes a minimal PNG color model that can contain all colors as indicated by the stats. +The stats should be computed with lodepng_compute_color_stats. +mode_in is raw color profile of the image the stats were computed on, to copy palette order from when relevant. +Minimal PNG color model means the color type and bit depth that gives smallest amount of bits in the output image, +e.g. gray if only grayscale pixels, palette if less than 256 colors, color key if only single transparent color, ... +This is used if auto_convert is enabled (it is by default). +*/ +static unsigned auto_choose_color(LodePNGColorMode* mode_out, + const LodePNGColorMode* mode_in, + const LodePNGColorStats* stats) { + unsigned error = 0; + unsigned palettebits; + size_t i, n; + size_t numpixels = stats->numpixels; + unsigned palette_ok, gray_ok; + + unsigned alpha = stats->alpha; + unsigned key = stats->key; + unsigned bits = stats->bits; + + mode_out->key_defined = 0; + + if(key && numpixels <= 16) { + alpha = 1; /*too few pixels to justify tRNS chunk overhead*/ + key = 0; + if(bits < 8) bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ + } + + gray_ok = !stats->colored; + if(!stats->allow_greyscale) gray_ok = 0; + if(!gray_ok && bits < 8) bits = 8; + + n = stats->numcolors; + palettebits = n <= 2 ? 1 : (n <= 4 ? 2 : (n <= 16 ? 4 : 8)); + palette_ok = n <= 256 && bits <= 8 && n != 0; /*n==0 means likely numcolors wasn't computed*/ + if(numpixels < n * 2) palette_ok = 0; /*don't add palette overhead if image has only a few pixels*/ + if(gray_ok && !alpha && bits <= palettebits) palette_ok = 0; /*gray is less overhead*/ + if(!stats->allow_palette) palette_ok = 0; + + if(palette_ok) { + const unsigned char* p = stats->palette; + lodepng_palette_clear(mode_out); /*remove potential earlier palette*/ + for(i = 0; i != stats->numcolors; ++i) { + error = lodepng_palette_add(mode_out, p[i * 4 + 0], p[i * 4 + 1], p[i * 4 + 2], p[i * 4 + 3]); + if(error) break; + } + + mode_out->colortype = LCT_PALETTE; + mode_out->bitdepth = palettebits; + + if(mode_in->colortype == LCT_PALETTE && mode_in->palettesize >= mode_out->palettesize + && mode_in->bitdepth == mode_out->bitdepth) { + /*If input should have same palette colors, keep original to preserve its order and prevent conversion*/ + lodepng_color_mode_cleanup(mode_out); + lodepng_color_mode_copy(mode_out, mode_in); + } + } else /*8-bit or 16-bit per channel*/ { + mode_out->bitdepth = bits; + mode_out->colortype = alpha ? (gray_ok ? LCT_GREY_ALPHA : LCT_RGBA) + : (gray_ok ? LCT_GREY : LCT_RGB); + if(key) { + unsigned mask = (1u << mode_out->bitdepth) - 1u; /*stats always uses 16-bit, mask converts it*/ + mode_out->key_r = stats->key_r & mask; + mode_out->key_g = stats->key_g & mask; + mode_out->key_b = stats->key_b & mask; + mode_out->key_defined = 1; + } + } + + return error; +} + +#endif /* #ifdef LODEPNG_COMPILE_ENCODER */ + +/* +Paeth predictor, used by PNG filter type 4 +The parameters are of type short, but should come from unsigned chars, the shorts +are only needed to make the paeth calculation correct. +*/ +static unsigned char paethPredictor(short a, short b, short c) { + short pa = LODEPNG_ABS(b - c); + short pb = LODEPNG_ABS(a - c); + short pc = LODEPNG_ABS(a + b - c - c); + /* return input value associated with smallest of pa, pb, pc (with certain priority if equal) */ + if(pb < pa) { a = b; pa = pb; } + return (pc < pa) ? c : a; +} + +/*shared values used by multiple Adam7 related functions*/ + +static const unsigned ADAM7_IX[7] = { 0, 4, 0, 2, 0, 1, 0 }; /*x start values*/ +static const unsigned ADAM7_IY[7] = { 0, 0, 4, 0, 2, 0, 1 }; /*y start values*/ +static const unsigned ADAM7_DX[7] = { 8, 8, 4, 4, 2, 2, 1 }; /*x delta values*/ +static const unsigned ADAM7_DY[7] = { 8, 8, 8, 4, 4, 2, 2 }; /*y delta values*/ + +/* +Outputs various dimensions and positions in the image related to the Adam7 reduced images. +passw: output containing the width of the 7 passes +passh: output containing the height of the 7 passes +filter_passstart: output containing the index of the start and end of each + reduced image with filter bytes +padded_passstart output containing the index of the start and end of each + reduced image when without filter bytes but with padded scanlines +passstart: output containing the index of the start and end of each reduced + image without padding between scanlines, but still padding between the images +w, h: width and height of non-interlaced image +bpp: bits per pixel +"padded" is only relevant if bpp is less than 8 and a scanline or image does not + end at a full byte +*/ +static void Adam7_getpassvalues(unsigned passw[7], unsigned passh[7], size_t filter_passstart[8], + size_t padded_passstart[8], size_t passstart[8], unsigned w, unsigned h, unsigned bpp) { + /*the passstart values have 8 values: the 8th one indicates the byte after the end of the 7th (= last) pass*/ + unsigned i; + + /*calculate width and height in pixels of each pass*/ + for(i = 0; i != 7; ++i) { + passw[i] = (w + ADAM7_DX[i] - ADAM7_IX[i] - 1) / ADAM7_DX[i]; + passh[i] = (h + ADAM7_DY[i] - ADAM7_IY[i] - 1) / ADAM7_DY[i]; + if(passw[i] == 0) passh[i] = 0; + if(passh[i] == 0) passw[i] = 0; + } + + filter_passstart[0] = padded_passstart[0] = passstart[0] = 0; + for(i = 0; i != 7; ++i) { + /*if passw[i] is 0, it's 0 bytes, not 1 (no filtertype-byte)*/ + filter_passstart[i + 1] = filter_passstart[i] + + ((passw[i] && passh[i]) ? passh[i] * (1u + (passw[i] * bpp + 7u) / 8u) : 0); + /*bits padded if needed to fill full byte at end of each scanline*/ + padded_passstart[i + 1] = padded_passstart[i] + passh[i] * ((passw[i] * bpp + 7u) / 8u); + /*only padded at end of reduced image*/ + passstart[i + 1] = passstart[i] + (passh[i] * passw[i] * bpp + 7u) / 8u; + } +} + +#ifdef LODEPNG_COMPILE_DECODER + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / PNG Decoder / */ +/* ////////////////////////////////////////////////////////////////////////// */ + +/*read the information from the header and store it in the LodePNGInfo. return value is error*/ +unsigned lodepng_inspect(unsigned* w, unsigned* h, LodePNGState* state, + const unsigned char* in, size_t insize) { + unsigned width, height; + LodePNGInfo* info = &state->info_png; + if(insize == 0 || in == 0) { + CERROR_RETURN_ERROR(state->error, 48); /*error: the given data is empty*/ + } + if(insize < 33) { + CERROR_RETURN_ERROR(state->error, 27); /*error: the data length is smaller than the length of a PNG header*/ + } + + /*when decoding a new PNG image, make sure all parameters created after previous decoding are reset*/ + /* TODO: remove this. One should use a new LodePNGState for new sessions */ + lodepng_info_cleanup(info); + lodepng_info_init(info); + + if(in[0] != 137 || in[1] != 80 || in[2] != 78 || in[3] != 71 + || in[4] != 13 || in[5] != 10 || in[6] != 26 || in[7] != 10) { + CERROR_RETURN_ERROR(state->error, 28); /*error: the first 8 bytes are not the correct PNG signature*/ + } + if(lodepng_chunk_length(in + 8) != 13) { + CERROR_RETURN_ERROR(state->error, 94); /*error: header size must be 13 bytes*/ + } + if(!lodepng_chunk_type_equals(in + 8, "IHDR")) { + CERROR_RETURN_ERROR(state->error, 29); /*error: it doesn't start with a IHDR chunk!*/ + } + + /*read the values given in the header*/ + width = lodepng_read32bitInt(&in[16]); + height = lodepng_read32bitInt(&in[20]); + /*TODO: remove the undocumented feature that allows to give null pointers to width or height*/ + if(w) *w = width; + if(h) *h = height; + info->color.bitdepth = in[24]; + info->color.colortype = (LodePNGColorType)in[25]; + info->compression_method = in[26]; + info->filter_method = in[27]; + info->interlace_method = in[28]; + + /*errors returned only after the parsing so other values are still output*/ + + /*error: invalid image size*/ + if(width == 0 || height == 0) CERROR_RETURN_ERROR(state->error, 93); + /*error: invalid colortype or bitdepth combination*/ + state->error = checkColorValidity(info->color.colortype, info->color.bitdepth); + if(state->error) return state->error; + /*error: only compression method 0 is allowed in the specification*/ + if(info->compression_method != 0) CERROR_RETURN_ERROR(state->error, 32); + /*error: only filter method 0 is allowed in the specification*/ + if(info->filter_method != 0) CERROR_RETURN_ERROR(state->error, 33); + /*error: only interlace methods 0 and 1 exist in the specification*/ + if(info->interlace_method > 1) CERROR_RETURN_ERROR(state->error, 34); + + if(!state->decoder.ignore_crc) { + unsigned CRC = lodepng_read32bitInt(&in[29]); + unsigned checksum = lodepng_crc32(&in[12], 17); + if(CRC != checksum) { + CERROR_RETURN_ERROR(state->error, 57); /*invalid CRC*/ + } + } + + return state->error; +} + +static unsigned unfilterScanline(unsigned char* recon, const unsigned char* scanline, const unsigned char* precon, + size_t bytewidth, unsigned char filterType, size_t length) { + /* + For PNG filter method 0 + unfilter a PNG image scanline by scanline. when the pixels are smaller than 1 byte, + the filter works byte per byte (bytewidth = 1) + precon is the previous unfiltered scanline, recon the result, scanline the current one + the incoming scanlines do NOT include the filtertype byte, that one is given in the parameter filterType instead + recon and scanline MAY be the same memory address! precon must be disjoint. + */ + + size_t i; + switch(filterType) { + case 0: + for(i = 0; i != length; ++i) recon[i] = scanline[i]; + break; + case 1: + for(i = 0; i != bytewidth; ++i) recon[i] = scanline[i]; + for(i = bytewidth; i < length; ++i) recon[i] = scanline[i] + recon[i - bytewidth]; + break; + case 2: + if(precon) { + for(i = 0; i != length; ++i) recon[i] = scanline[i] + precon[i]; + } else { + for(i = 0; i != length; ++i) recon[i] = scanline[i]; + } + break; + case 3: + if(precon) { + for(i = 0; i != bytewidth; ++i) recon[i] = scanline[i] + (precon[i] >> 1u); + for(i = bytewidth; i < length; ++i) recon[i] = scanline[i] + ((recon[i - bytewidth] + precon[i]) >> 1u); + } else { + for(i = 0; i != bytewidth; ++i) recon[i] = scanline[i]; + for(i = bytewidth; i < length; ++i) recon[i] = scanline[i] + (recon[i - bytewidth] >> 1u); + } + break; + case 4: + if(precon) { + for(i = 0; i != bytewidth; ++i) { + recon[i] = (scanline[i] + precon[i]); /*paethPredictor(0, precon[i], 0) is always precon[i]*/ + } + + /* Unroll independent paths of the paeth predictor. A 6x and 8x version would also be possible but that + adds too much code. Whether this actually speeds anything up at all depends on compiler and settings. */ + if(bytewidth >= 4) { + for(; i + 3 < length; i += 4) { + size_t j = i - bytewidth; + unsigned char s0 = scanline[i + 0], s1 = scanline[i + 1], s2 = scanline[i + 2], s3 = scanline[i + 3]; + unsigned char r0 = recon[j + 0], r1 = recon[j + 1], r2 = recon[j + 2], r3 = recon[j + 3]; + unsigned char p0 = precon[i + 0], p1 = precon[i + 1], p2 = precon[i + 2], p3 = precon[i + 3]; + unsigned char q0 = precon[j + 0], q1 = precon[j + 1], q2 = precon[j + 2], q3 = precon[j + 3]; + recon[i + 0] = s0 + paethPredictor(r0, p0, q0); + recon[i + 1] = s1 + paethPredictor(r1, p1, q1); + recon[i + 2] = s2 + paethPredictor(r2, p2, q2); + recon[i + 3] = s3 + paethPredictor(r3, p3, q3); + } + } else if(bytewidth >= 3) { + for(; i + 2 < length; i += 3) { + size_t j = i - bytewidth; + unsigned char s0 = scanline[i + 0], s1 = scanline[i + 1], s2 = scanline[i + 2]; + unsigned char r0 = recon[j + 0], r1 = recon[j + 1], r2 = recon[j + 2]; + unsigned char p0 = precon[i + 0], p1 = precon[i + 1], p2 = precon[i + 2]; + unsigned char q0 = precon[j + 0], q1 = precon[j + 1], q2 = precon[j + 2]; + recon[i + 0] = s0 + paethPredictor(r0, p0, q0); + recon[i + 1] = s1 + paethPredictor(r1, p1, q1); + recon[i + 2] = s2 + paethPredictor(r2, p2, q2); + } + } else if(bytewidth >= 2) { + for(; i + 1 < length; i += 2) { + size_t j = i - bytewidth; + unsigned char s0 = scanline[i + 0], s1 = scanline[i + 1]; + unsigned char r0 = recon[j + 0], r1 = recon[j + 1]; + unsigned char p0 = precon[i + 0], p1 = precon[i + 1]; + unsigned char q0 = precon[j + 0], q1 = precon[j + 1]; + recon[i + 0] = s0 + paethPredictor(r0, p0, q0); + recon[i + 1] = s1 + paethPredictor(r1, p1, q1); + } + } + + for(; i != length; ++i) { + recon[i] = (scanline[i] + paethPredictor(recon[i - bytewidth], precon[i], precon[i - bytewidth])); + } + } else { + for(i = 0; i != bytewidth; ++i) { + recon[i] = scanline[i]; + } + for(i = bytewidth; i < length; ++i) { + /*paethPredictor(recon[i - bytewidth], 0, 0) is always recon[i - bytewidth]*/ + recon[i] = (scanline[i] + recon[i - bytewidth]); + } + } + break; + default: return 36; /*error: invalid filter type given*/ + } + return 0; +} + +static unsigned unfilter(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp) { + /* + For PNG filter method 0 + this function unfilters a single image (e.g. without interlacing this is called once, with Adam7 seven times) + out must have enough bytes allocated already, in must have the scanlines + 1 filtertype byte per scanline + w and h are image dimensions or dimensions of reduced image, bpp is bits per pixel + in and out are allowed to be the same memory address (but aren't the same size since in has the extra filter bytes) + */ + + unsigned y; + unsigned char* prevline = 0; + + /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/ + size_t bytewidth = (bpp + 7u) / 8u; + /*the width of a scanline in bytes, not including the filter type*/ + size_t linebytes = lodepng_get_raw_size_idat(w, 1, bpp) - 1u; + + for(y = 0; y < h; ++y) { + size_t outindex = linebytes * y; + size_t inindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ + unsigned char filterType = in[inindex]; + + CERROR_TRY_RETURN(unfilterScanline(&out[outindex], &in[inindex + 1], prevline, bytewidth, filterType, linebytes)); + + prevline = &out[outindex]; + } + + return 0; +} + +/* +in: Adam7 interlaced image, with no padding bits between scanlines, but between + reduced images so that each reduced image starts at a byte. +out: the same pixels, but re-ordered so that they're now a non-interlaced image with size w*h +bpp: bits per pixel +out has the following size in bits: w * h * bpp. +in is possibly bigger due to padding bits between reduced images. +out must be big enough AND must be 0 everywhere if bpp < 8 in the current implementation +(because that's likely a little bit faster) +NOTE: comments about padding bits are only relevant if bpp < 8 +*/ +static void Adam7_deinterlace(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp) { + unsigned passw[7], passh[7]; + size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned i; + + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + + if(bpp >= 8) { + for(i = 0; i != 7; ++i) { + unsigned x, y, b; + size_t bytewidth = bpp / 8u; + for(y = 0; y < passh[i]; ++y) + for(x = 0; x < passw[i]; ++x) { + size_t pixelinstart = passstart[i] + (y * passw[i] + x) * bytewidth; + size_t pixeloutstart = ((ADAM7_IY[i] + (size_t)y * ADAM7_DY[i]) * (size_t)w + + ADAM7_IX[i] + (size_t)x * ADAM7_DX[i]) * bytewidth; + for(b = 0; b < bytewidth; ++b) { + out[pixeloutstart + b] = in[pixelinstart + b]; + } + } + } + } else /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/ { + for(i = 0; i != 7; ++i) { + unsigned x, y, b; + unsigned ilinebits = bpp * passw[i]; + unsigned olinebits = bpp * w; + size_t obp, ibp; /*bit pointers (for out and in buffer)*/ + for(y = 0; y < passh[i]; ++y) + for(x = 0; x < passw[i]; ++x) { + ibp = (8 * passstart[i]) + (y * ilinebits + x * bpp); + obp = (ADAM7_IY[i] + (size_t)y * ADAM7_DY[i]) * olinebits + (ADAM7_IX[i] + (size_t)x * ADAM7_DX[i]) * bpp; + for(b = 0; b < bpp; ++b) { + unsigned char bit = readBitFromReversedStream(&ibp, in); + setBitOfReversedStream(&obp, out, bit); + } + } + } + } +} + +static void removePaddingBits(unsigned char* out, const unsigned char* in, + size_t olinebits, size_t ilinebits, unsigned h) { + /* + After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts. They need + to be removed (except at last scanline of (Adam7-reduced) image) before working with pure image buffers + for the Adam7 code, the color convert code and the output to the user. + in and out are allowed to be the same buffer, in may also be higher but still overlapping; in must + have >= ilinebits*h bits, out must have >= olinebits*h bits, olinebits must be <= ilinebits + also used to move bits after earlier such operations happened, e.g. in a sequence of reduced images from Adam7 + only useful if (ilinebits - olinebits) is a value in the range 1..7 + */ + unsigned y; + size_t diff = ilinebits - olinebits; + size_t ibp = 0, obp = 0; /*input and output bit pointers*/ + for(y = 0; y < h; ++y) { + size_t x; + for(x = 0; x < olinebits; ++x) { + unsigned char bit = readBitFromReversedStream(&ibp, in); + setBitOfReversedStream(&obp, out, bit); + } + ibp += diff; + } +} + +/*out must be buffer big enough to contain full image, and in must contain the full decompressed data from +the IDAT chunks (with filter index bytes and possible padding bits) +return value is error*/ +static unsigned postProcessScanlines(unsigned char* out, unsigned char* in, + unsigned w, unsigned h, const LodePNGInfo* info_png) { + /* + This function converts the filtered-padded-interlaced data into pure 2D image buffer with the PNG's colortype. + Steps: + *) if no Adam7: 1) unfilter 2) remove padding bits (= possible extra bits per scanline if bpp < 8) + *) if adam7: 1) 7x unfilter 2) 7x remove padding bits 3) Adam7_deinterlace + NOTE: the in buffer will be overwritten with intermediate data! + */ + unsigned bpp = lodepng_get_bpp(&info_png->color); + if(bpp == 0) return 31; /*error: invalid colortype*/ + + if(info_png->interlace_method == 0) { + if(bpp < 8 && w * bpp != ((w * bpp + 7u) / 8u) * 8u) { + CERROR_TRY_RETURN(unfilter(in, in, w, h, bpp)); + removePaddingBits(out, in, w * bpp, ((w * bpp + 7u) / 8u) * 8u, h); + } + /*we can immediately filter into the out buffer, no other steps needed*/ + else CERROR_TRY_RETURN(unfilter(out, in, w, h, bpp)); + } else /*interlace_method is 1 (Adam7)*/ { + unsigned passw[7], passh[7]; size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned i; + + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + + for(i = 0; i != 7; ++i) { + CERROR_TRY_RETURN(unfilter(&in[padded_passstart[i]], &in[filter_passstart[i]], passw[i], passh[i], bpp)); + /*TODO: possible efficiency improvement: if in this reduced image the bits fit nicely in 1 scanline, + move bytes instead of bits or move not at all*/ + if(bpp < 8) { + /*remove padding bits in scanlines; after this there still may be padding + bits between the different reduced images: each reduced image still starts nicely at a byte*/ + removePaddingBits(&in[passstart[i]], &in[padded_passstart[i]], passw[i] * bpp, + ((passw[i] * bpp + 7u) / 8u) * 8u, passh[i]); + } + } + + Adam7_deinterlace(out, in, w, h, bpp); + } + + return 0; +} + +static unsigned readChunk_PLTE(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) { + unsigned pos = 0, i; + color->palettesize = chunkLength / 3u; + if(color->palettesize == 0 || color->palettesize > 256) return 38; /*error: palette too small or big*/ + lodepng_color_mode_alloc_palette(color); + if(!color->palette && color->palettesize) { + color->palettesize = 0; + return 83; /*alloc fail*/ + } + + for(i = 0; i != color->palettesize; ++i) { + color->palette[4 * i + 0] = data[pos++]; /*R*/ + color->palette[4 * i + 1] = data[pos++]; /*G*/ + color->palette[4 * i + 2] = data[pos++]; /*B*/ + color->palette[4 * i + 3] = 255; /*alpha*/ + } + + return 0; /* OK */ +} + +static unsigned readChunk_tRNS(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) { + unsigned i; + if(color->colortype == LCT_PALETTE) { + /*error: more alpha values given than there are palette entries*/ + if(chunkLength > color->palettesize) return 39; + + for(i = 0; i != chunkLength; ++i) color->palette[4 * i + 3] = data[i]; + } else if(color->colortype == LCT_GREY) { + /*error: this chunk must be 2 bytes for grayscale image*/ + if(chunkLength != 2) return 30; + + color->key_defined = 1; + color->key_r = color->key_g = color->key_b = 256u * data[0] + data[1]; + } else if(color->colortype == LCT_RGB) { + /*error: this chunk must be 6 bytes for RGB image*/ + if(chunkLength != 6) return 41; + + color->key_defined = 1; + color->key_r = 256u * data[0] + data[1]; + color->key_g = 256u * data[2] + data[3]; + color->key_b = 256u * data[4] + data[5]; + } + else return 42; /*error: tRNS chunk not allowed for other color models*/ + + return 0; /* OK */ +} + + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS +/*background color chunk (bKGD)*/ +static unsigned readChunk_bKGD(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(info->color.colortype == LCT_PALETTE) { + /*error: this chunk must be 1 byte for indexed color image*/ + if(chunkLength != 1) return 43; + + /*error: invalid palette index, or maybe this chunk appeared before PLTE*/ + if(data[0] >= info->color.palettesize) return 103; + + info->background_defined = 1; + info->background_r = info->background_g = info->background_b = data[0]; + } else if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) { + /*error: this chunk must be 2 bytes for grayscale image*/ + if(chunkLength != 2) return 44; + + /*the values are truncated to bitdepth in the PNG file*/ + info->background_defined = 1; + info->background_r = info->background_g = info->background_b = 256u * data[0] + data[1]; + } else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) { + /*error: this chunk must be 6 bytes for grayscale image*/ + if(chunkLength != 6) return 45; + + /*the values are truncated to bitdepth in the PNG file*/ + info->background_defined = 1; + info->background_r = 256u * data[0] + data[1]; + info->background_g = 256u * data[2] + data[3]; + info->background_b = 256u * data[4] + data[5]; + } + + return 0; /* OK */ +} + +/*text chunk (tEXt)*/ +static unsigned readChunk_tEXt(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + unsigned error = 0; + char *key = 0, *str = 0; + + while(!error) /*not really a while loop, only used to break on error*/ { + unsigned length, string2_begin; + + length = 0; + while(length < chunkLength && data[length] != 0) ++length; + /*even though it's not allowed by the standard, no error is thrown if + there's no null termination char, if the text is empty*/ + if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ + + key = (char*)lodepng_malloc(length + 1); + if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(key, data, length); + key[length] = 0; + + string2_begin = length + 1; /*skip keyword null terminator*/ + + length = (unsigned)(chunkLength < string2_begin ? 0 : chunkLength - string2_begin); + str = (char*)lodepng_malloc(length + 1); + if(!str) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(str, data + string2_begin, length); + str[length] = 0; + + error = lodepng_add_text(info, key, str); + + break; + } + + lodepng_free(key); + lodepng_free(str); + + return error; +} + +/*compressed text chunk (zTXt)*/ +static unsigned readChunk_zTXt(LodePNGInfo* info, const LodePNGDecoderSettings* decoder, + const unsigned char* data, size_t chunkLength) { + unsigned error = 0; + + /*copy the object to change parameters in it*/ + LodePNGDecompressSettings zlibsettings = decoder->zlibsettings; + + unsigned length, string2_begin; + char *key = 0; + unsigned char* str = 0; + size_t size = 0; + + while(!error) /*not really a while loop, only used to break on error*/ { + for(length = 0; length < chunkLength && data[length] != 0; ++length) ; + if(length + 2 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ + if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ + + key = (char*)lodepng_malloc(length + 1); + if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(key, data, length); + key[length] = 0; + + if(data[length + 1] != 0) CERROR_BREAK(error, 72); /*the 0 byte indicating compression must be 0*/ + + string2_begin = length + 2; + if(string2_begin > chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ + + length = (unsigned)chunkLength - string2_begin; + zlibsettings.max_output_size = decoder->max_text_size; + /*will fail if zlib error, e.g. if length is too small*/ + error = zlib_decompress(&str, &size, 0, &data[string2_begin], + length, &zlibsettings); + /*error: compressed text larger than decoder->max_text_size*/ + if(error && size > zlibsettings.max_output_size) error = 112; + if(error) break; + error = lodepng_add_text_sized(info, key, (char*)str, size); + break; + } + + lodepng_free(key); + lodepng_free(str); + + return error; +} + +/*international text chunk (iTXt)*/ +static unsigned readChunk_iTXt(LodePNGInfo* info, const LodePNGDecoderSettings* decoder, + const unsigned char* data, size_t chunkLength) { + unsigned error = 0; + unsigned i; + + /*copy the object to change parameters in it*/ + LodePNGDecompressSettings zlibsettings = decoder->zlibsettings; + + unsigned length, begin, compressed; + char *key = 0, *langtag = 0, *transkey = 0; + + while(!error) /*not really a while loop, only used to break on error*/ { + /*Quick check if the chunk length isn't too small. Even without check + it'd still fail with other error checks below if it's too short. This just gives a different error code.*/ + if(chunkLength < 5) CERROR_BREAK(error, 30); /*iTXt chunk too short*/ + + /*read the key*/ + for(length = 0; length < chunkLength && data[length] != 0; ++length) ; + if(length + 3 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination char, corrupt?*/ + if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ + + key = (char*)lodepng_malloc(length + 1); + if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(key, data, length); + key[length] = 0; + + /*read the compression method*/ + compressed = data[length + 1]; + if(data[length + 2] != 0) CERROR_BREAK(error, 72); /*the 0 byte indicating compression must be 0*/ + + /*even though it's not allowed by the standard, no error is thrown if + there's no null termination char, if the text is empty for the next 3 texts*/ + + /*read the langtag*/ + begin = length + 3; + length = 0; + for(i = begin; i < chunkLength && data[i] != 0; ++i) ++length; + + langtag = (char*)lodepng_malloc(length + 1); + if(!langtag) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(langtag, data + begin, length); + langtag[length] = 0; + + /*read the transkey*/ + begin += length + 1; + length = 0; + for(i = begin; i < chunkLength && data[i] != 0; ++i) ++length; + + transkey = (char*)lodepng_malloc(length + 1); + if(!transkey) CERROR_BREAK(error, 83); /*alloc fail*/ + + lodepng_memcpy(transkey, data + begin, length); + transkey[length] = 0; + + /*read the actual text*/ + begin += length + 1; + + length = (unsigned)chunkLength < begin ? 0 : (unsigned)chunkLength - begin; + + if(compressed) { + unsigned char* str = 0; + size_t size = 0; + zlibsettings.max_output_size = decoder->max_text_size; + /*will fail if zlib error, e.g. if length is too small*/ + error = zlib_decompress(&str, &size, 0, &data[begin], + length, &zlibsettings); + /*error: compressed text larger than decoder->max_text_size*/ + if(error && size > zlibsettings.max_output_size) error = 112; + if(!error) error = lodepng_add_itext_sized(info, key, langtag, transkey, (char*)str, size); + lodepng_free(str); + } else { + error = lodepng_add_itext_sized(info, key, langtag, transkey, (char*)(data + begin), length); + } + + break; + } + + lodepng_free(key); + lodepng_free(langtag); + lodepng_free(transkey); + + return error; +} + +static unsigned readChunk_tIME(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(chunkLength != 7) return 73; /*invalid tIME chunk size*/ + + info->time_defined = 1; + info->time.year = 256u * data[0] + data[1]; + info->time.month = data[2]; + info->time.day = data[3]; + info->time.hour = data[4]; + info->time.minute = data[5]; + info->time.second = data[6]; + + return 0; /* OK */ +} + +static unsigned readChunk_pHYs(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(chunkLength != 9) return 74; /*invalid pHYs chunk size*/ + + info->phys_defined = 1; + info->phys_x = 16777216u * data[0] + 65536u * data[1] + 256u * data[2] + data[3]; + info->phys_y = 16777216u * data[4] + 65536u * data[5] + 256u * data[6] + data[7]; + info->phys_unit = data[8]; + + return 0; /* OK */ +} + +static unsigned readChunk_gAMA(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(chunkLength != 4) return 96; /*invalid gAMA chunk size*/ + + info->gama_defined = 1; + info->gama_gamma = 16777216u * data[0] + 65536u * data[1] + 256u * data[2] + data[3]; + + return 0; /* OK */ +} + +static unsigned readChunk_cHRM(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(chunkLength != 32) return 97; /*invalid cHRM chunk size*/ + + info->chrm_defined = 1; + info->chrm_white_x = 16777216u * data[ 0] + 65536u * data[ 1] + 256u * data[ 2] + data[ 3]; + info->chrm_white_y = 16777216u * data[ 4] + 65536u * data[ 5] + 256u * data[ 6] + data[ 7]; + info->chrm_red_x = 16777216u * data[ 8] + 65536u * data[ 9] + 256u * data[10] + data[11]; + info->chrm_red_y = 16777216u * data[12] + 65536u * data[13] + 256u * data[14] + data[15]; + info->chrm_green_x = 16777216u * data[16] + 65536u * data[17] + 256u * data[18] + data[19]; + info->chrm_green_y = 16777216u * data[20] + 65536u * data[21] + 256u * data[22] + data[23]; + info->chrm_blue_x = 16777216u * data[24] + 65536u * data[25] + 256u * data[26] + data[27]; + info->chrm_blue_y = 16777216u * data[28] + 65536u * data[29] + 256u * data[30] + data[31]; + + return 0; /* OK */ +} + +static unsigned readChunk_sRGB(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) { + if(chunkLength != 1) return 98; /*invalid sRGB chunk size (this one is never ignored)*/ + + info->srgb_defined = 1; + info->srgb_intent = data[0]; + + return 0; /* OK */ +} + +static unsigned readChunk_iCCP(LodePNGInfo* info, const LodePNGDecoderSettings* decoder, + const unsigned char* data, size_t chunkLength) { + unsigned error = 0; + unsigned i; + size_t size = 0; + /*copy the object to change parameters in it*/ + LodePNGDecompressSettings zlibsettings = decoder->zlibsettings; + + unsigned length, string2_begin; + + info->iccp_defined = 1; + if(info->iccp_name) lodepng_clear_icc(info); + + for(length = 0; length < chunkLength && data[length] != 0; ++length) ; + if(length + 2 >= chunkLength) return 75; /*no null termination, corrupt?*/ + if(length < 1 || length > 79) return 89; /*keyword too short or long*/ + + info->iccp_name = (char*)lodepng_malloc(length + 1); + if(!info->iccp_name) return 83; /*alloc fail*/ + + info->iccp_name[length] = 0; + for(i = 0; i != length; ++i) info->iccp_name[i] = (char)data[i]; + + if(data[length + 1] != 0) return 72; /*the 0 byte indicating compression must be 0*/ + + string2_begin = length + 2; + if(string2_begin > chunkLength) return 75; /*no null termination, corrupt?*/ + + length = (unsigned)chunkLength - string2_begin; + zlibsettings.max_output_size = decoder->max_icc_size; + error = zlib_decompress(&info->iccp_profile, &size, 0, + &data[string2_begin], + length, &zlibsettings); + /*error: ICC profile larger than decoder->max_icc_size*/ + if(error && size > zlibsettings.max_output_size) error = 113; + info->iccp_profile_size = size; + if(!error && !info->iccp_profile_size) error = 100; /*invalid ICC profile size*/ + return error; +} +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +unsigned lodepng_inspect_chunk(LodePNGState* state, size_t pos, + const unsigned char* in, size_t insize) { + const unsigned char* chunk = in + pos; + unsigned chunkLength; + const unsigned char* data; + unsigned unhandled = 0; + unsigned error = 0; + + if(pos + 4 > insize) return 30; + chunkLength = lodepng_chunk_length(chunk); + if(chunkLength > 2147483647) return 63; + data = lodepng_chunk_data_const(chunk); + if(data + chunkLength + 4 > in + insize) return 30; + + if(lodepng_chunk_type_equals(chunk, "PLTE")) { + error = readChunk_PLTE(&state->info_png.color, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "tRNS")) { + error = readChunk_tRNS(&state->info_png.color, data, chunkLength); +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + } else if(lodepng_chunk_type_equals(chunk, "bKGD")) { + error = readChunk_bKGD(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "tEXt")) { + error = readChunk_tEXt(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "zTXt")) { + error = readChunk_zTXt(&state->info_png, &state->decoder, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "iTXt")) { + error = readChunk_iTXt(&state->info_png, &state->decoder, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "tIME")) { + error = readChunk_tIME(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "pHYs")) { + error = readChunk_pHYs(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "gAMA")) { + error = readChunk_gAMA(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "cHRM")) { + error = readChunk_cHRM(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "sRGB")) { + error = readChunk_sRGB(&state->info_png, data, chunkLength); + } else if(lodepng_chunk_type_equals(chunk, "iCCP")) { + error = readChunk_iCCP(&state->info_png, &state->decoder, data, chunkLength); +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + } else { + /* unhandled chunk is ok (is not an error) */ + unhandled = 1; + } + + if(!error && !unhandled && !state->decoder.ignore_crc) { + if(lodepng_chunk_check_crc(chunk)) return 57; /*invalid CRC*/ + } + + return error; +} + +/*read a PNG, the result will be in the same color type as the PNG (hence "generic")*/ +static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, + LodePNGState* state, + const unsigned char* in, size_t insize) { + unsigned char IEND = 0; + const unsigned char* chunk; + unsigned char* idat; /*the data from idat chunks, zlib compressed*/ + size_t idatsize = 0; + unsigned char* scanlines = 0; + size_t scanlines_size = 0, expected_size = 0; + size_t outsize = 0; + + /*for unknown chunk order*/ + unsigned unknown = 0; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + unsigned critical_pos = 1; /*1 = after IHDR, 2 = after PLTE, 3 = after IDAT*/ +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + + + /* safe output values in case error happens */ + *out = 0; + *w = *h = 0; + + state->error = lodepng_inspect(w, h, state, in, insize); /*reads header and resets other parameters in state->info_png*/ + if(state->error) return; + + if(lodepng_pixel_overflow(*w, *h, &state->info_png.color, &state->info_raw)) { + CERROR_RETURN(state->error, 92); /*overflow possible due to amount of pixels*/ + } + + /*the input filesize is a safe upper bound for the sum of idat chunks size*/ + idat = (unsigned char*)lodepng_malloc(insize); + if(!idat) CERROR_RETURN(state->error, 83); /*alloc fail*/ + + chunk = &in[33]; /*first byte of the first chunk after the header*/ + + /*loop through the chunks, ignoring unknown chunks and stopping at IEND chunk. + IDAT data is put at the start of the in buffer*/ + while(!IEND && !state->error) { + unsigned chunkLength; + const unsigned char* data; /*the data in the chunk*/ + + /*error: size of the in buffer too small to contain next chunk*/ + if((size_t)((chunk - in) + 12) > insize || chunk < in) { + if(state->decoder.ignore_end) break; /*other errors may still happen though*/ + CERROR_BREAK(state->error, 30); + } + + /*length of the data of the chunk, excluding the length bytes, chunk type and CRC bytes*/ + chunkLength = lodepng_chunk_length(chunk); + /*error: chunk length larger than the max PNG chunk size*/ + if(chunkLength > 2147483647) { + if(state->decoder.ignore_end) break; /*other errors may still happen though*/ + CERROR_BREAK(state->error, 63); + } + + if((size_t)((chunk - in) + chunkLength + 12) > insize || (chunk + chunkLength + 12) < in) { + CERROR_BREAK(state->error, 64); /*error: size of the in buffer too small to contain next chunk*/ + } + + data = lodepng_chunk_data_const(chunk); + + unknown = 0; + + /*IDAT chunk, containing compressed image data*/ + if(lodepng_chunk_type_equals(chunk, "IDAT")) { + size_t newsize; + if(lodepng_addofl(idatsize, chunkLength, &newsize)) CERROR_BREAK(state->error, 95); + if(newsize > insize) CERROR_BREAK(state->error, 95); + lodepng_memcpy(idat + idatsize, data, chunkLength); + idatsize += chunkLength; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + critical_pos = 3; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + } else if(lodepng_chunk_type_equals(chunk, "IEND")) { + /*IEND chunk*/ + IEND = 1; + } else if(lodepng_chunk_type_equals(chunk, "PLTE")) { + /*palette chunk (PLTE)*/ + state->error = readChunk_PLTE(&state->info_png.color, data, chunkLength); + if(state->error) break; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + critical_pos = 2; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + } else if(lodepng_chunk_type_equals(chunk, "tRNS")) { + /*palette transparency chunk (tRNS). Even though this one is an ancillary chunk , it is still compiled + in without 'LODEPNG_COMPILE_ANCILLARY_CHUNKS' because it contains essential color information that + affects the alpha channel of pixels. */ + state->error = readChunk_tRNS(&state->info_png.color, data, chunkLength); + if(state->error) break; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*background color chunk (bKGD)*/ + } else if(lodepng_chunk_type_equals(chunk, "bKGD")) { + state->error = readChunk_bKGD(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "tEXt")) { + /*text chunk (tEXt)*/ + if(state->decoder.read_text_chunks) { + state->error = readChunk_tEXt(&state->info_png, data, chunkLength); + if(state->error) break; + } + } else if(lodepng_chunk_type_equals(chunk, "zTXt")) { + /*compressed text chunk (zTXt)*/ + if(state->decoder.read_text_chunks) { + state->error = readChunk_zTXt(&state->info_png, &state->decoder, data, chunkLength); + if(state->error) break; + } + } else if(lodepng_chunk_type_equals(chunk, "iTXt")) { + /*international text chunk (iTXt)*/ + if(state->decoder.read_text_chunks) { + state->error = readChunk_iTXt(&state->info_png, &state->decoder, data, chunkLength); + if(state->error) break; + } + } else if(lodepng_chunk_type_equals(chunk, "tIME")) { + state->error = readChunk_tIME(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "pHYs")) { + state->error = readChunk_pHYs(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "gAMA")) { + state->error = readChunk_gAMA(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "cHRM")) { + state->error = readChunk_cHRM(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "sRGB")) { + state->error = readChunk_sRGB(&state->info_png, data, chunkLength); + if(state->error) break; + } else if(lodepng_chunk_type_equals(chunk, "iCCP")) { + state->error = readChunk_iCCP(&state->info_png, &state->decoder, data, chunkLength); + if(state->error) break; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + } else /*it's not an implemented chunk type, so ignore it: skip over the data*/ { + /*error: unknown critical chunk (5th bit of first byte of chunk type is 0)*/ + if(!state->decoder.ignore_critical && !lodepng_chunk_ancillary(chunk)) { + CERROR_BREAK(state->error, 69); + } + + unknown = 1; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + if(state->decoder.remember_unknown_chunks) { + state->error = lodepng_chunk_append(&state->info_png.unknown_chunks_data[critical_pos - 1], + &state->info_png.unknown_chunks_size[critical_pos - 1], chunk); + if(state->error) break; + } +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + } + + if(!state->decoder.ignore_crc && !unknown) /*check CRC if wanted, only on known chunk types*/ { + if(lodepng_chunk_check_crc(chunk)) CERROR_BREAK(state->error, 57); /*invalid CRC*/ + } + + if(!IEND) chunk = lodepng_chunk_next_const(chunk, in + insize); + } + + if(!state->error && state->info_png.color.colortype == LCT_PALETTE && !state->info_png.color.palette) { + state->error = 106; /* error: PNG file must have PLTE chunk if color type is palette */ + } + + if(!state->error) { + /*predict output size, to allocate exact size for output buffer to avoid more dynamic allocation. + If the decompressed size does not match the prediction, the image must be corrupt.*/ + if(state->info_png.interlace_method == 0) { + size_t bpp = lodepng_get_bpp(&state->info_png.color); + expected_size = lodepng_get_raw_size_idat(*w, *h, bpp); + } else { + size_t bpp = lodepng_get_bpp(&state->info_png.color); + /*Adam-7 interlaced: expected size is the sum of the 7 sub-images sizes*/ + expected_size = 0; + expected_size += lodepng_get_raw_size_idat((*w + 7) >> 3, (*h + 7) >> 3, bpp); + if(*w > 4) expected_size += lodepng_get_raw_size_idat((*w + 3) >> 3, (*h + 7) >> 3, bpp); + expected_size += lodepng_get_raw_size_idat((*w + 3) >> 2, (*h + 3) >> 3, bpp); + if(*w > 2) expected_size += lodepng_get_raw_size_idat((*w + 1) >> 2, (*h + 3) >> 2, bpp); + expected_size += lodepng_get_raw_size_idat((*w + 1) >> 1, (*h + 1) >> 2, bpp); + if(*w > 1) expected_size += lodepng_get_raw_size_idat((*w + 0) >> 1, (*h + 1) >> 1, bpp); + expected_size += lodepng_get_raw_size_idat((*w + 0), (*h + 0) >> 1, bpp); + } + + state->error = zlib_decompress(&scanlines, &scanlines_size, expected_size, idat, idatsize, &state->decoder.zlibsettings); + } + if(!state->error && scanlines_size != expected_size) state->error = 91; /*decompressed size doesn't match prediction*/ + lodepng_free(idat); + + if(!state->error) { + outsize = lodepng_get_raw_size(*w, *h, &state->info_png.color); + *out = (unsigned char*)lodepng_malloc(outsize); + if(!*out) state->error = 83; /*alloc fail*/ + } + if(!state->error) { + lodepng_memset(*out, 0, outsize); + state->error = postProcessScanlines(*out, scanlines, *w, *h, &state->info_png); + } + lodepng_free(scanlines); +} + +unsigned lodepng_decode(unsigned char** out, unsigned* w, unsigned* h, + LodePNGState* state, + const unsigned char* in, size_t insize) { + *out = 0; + decodeGeneric(out, w, h, state, in, insize); + if(state->error) return state->error; + if(!state->decoder.color_convert || lodepng_color_mode_equal(&state->info_raw, &state->info_png.color)) { + /*same color type, no copying or converting of data needed*/ + /*store the info_png color settings on the info_raw so that the info_raw still reflects what colortype + the raw image has to the end user*/ + if(!state->decoder.color_convert) { + state->error = lodepng_color_mode_copy(&state->info_raw, &state->info_png.color); + if(state->error) return state->error; + } + } else { /*color conversion needed*/ + unsigned char* data = *out; + size_t outsize; + + /*TODO: check if this works according to the statement in the documentation: "The converter can convert + from grayscale input color type, to 8-bit grayscale or grayscale with alpha"*/ + if(!(state->info_raw.colortype == LCT_RGB || state->info_raw.colortype == LCT_RGBA) + && !(state->info_raw.bitdepth == 8)) { + return 56; /*unsupported color mode conversion*/ + } + + outsize = lodepng_get_raw_size(*w, *h, &state->info_raw); + *out = (unsigned char*)lodepng_malloc(outsize); + if(!(*out)) { + state->error = 83; /*alloc fail*/ + } + else state->error = lodepng_convert(*out, data, &state->info_raw, + &state->info_png.color, *w, *h); + lodepng_free(data); + } + return state->error; +} + +unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, + size_t insize, LodePNGColorType colortype, unsigned bitdepth) { + unsigned error; + LodePNGState state; + lodepng_state_init(&state); + state.info_raw.colortype = colortype; + state.info_raw.bitdepth = bitdepth; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*disable reading things that this function doesn't output*/ + state.decoder.read_text_chunks = 0; + state.decoder.remember_unknown_chunks = 0; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + error = lodepng_decode(out, w, h, &state, in, insize); + lodepng_state_cleanup(&state); + return error; +} + +unsigned lodepng_decode32(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, size_t insize) { + return lodepng_decode_memory(out, w, h, in, insize, LCT_RGBA, 8); +} + +unsigned lodepng_decode24(unsigned char** out, unsigned* w, unsigned* h, const unsigned char* in, size_t insize) { + return lodepng_decode_memory(out, w, h, in, insize, LCT_RGB, 8); +} + +#ifdef LODEPNG_COMPILE_DISK +unsigned lodepng_decode_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename, + LodePNGColorType colortype, unsigned bitdepth) { + unsigned char* buffer = 0; + size_t buffersize; + unsigned error; + /* safe output values in case error happens */ + *out = 0; + *w = *h = 0; + error = lodepng_load_file(&buffer, &buffersize, filename); + if(!error) error = lodepng_decode_memory(out, w, h, buffer, buffersize, colortype, bitdepth); + lodepng_free(buffer); + return error; +} + +unsigned lodepng_decode32_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename) { + return lodepng_decode_file(out, w, h, filename, LCT_RGBA, 8); +} + +unsigned lodepng_decode24_file(unsigned char** out, unsigned* w, unsigned* h, const char* filename) { + return lodepng_decode_file(out, w, h, filename, LCT_RGB, 8); +} +#endif /*LODEPNG_COMPILE_DISK*/ + +void lodepng_decoder_settings_init(LodePNGDecoderSettings* settings) { + settings->color_convert = 1; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + settings->read_text_chunks = 1; + settings->remember_unknown_chunks = 0; + settings->max_text_size = 16777216; + settings->max_icc_size = 16777216; /* 16MB is much more than enough for any reasonable ICC profile */ +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + settings->ignore_crc = 0; + settings->ignore_critical = 0; + settings->ignore_end = 0; + lodepng_decompress_settings_init(&settings->zlibsettings); +} + +#endif /*LODEPNG_COMPILE_DECODER*/ + +#if defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) + +void lodepng_state_init(LodePNGState* state) { +#ifdef LODEPNG_COMPILE_DECODER + lodepng_decoder_settings_init(&state->decoder); +#endif /*LODEPNG_COMPILE_DECODER*/ +#ifdef LODEPNG_COMPILE_ENCODER + lodepng_encoder_settings_init(&state->encoder); +#endif /*LODEPNG_COMPILE_ENCODER*/ + lodepng_color_mode_init(&state->info_raw); + lodepng_info_init(&state->info_png); + state->error = 1; +} + +void lodepng_state_cleanup(LodePNGState* state) { + lodepng_color_mode_cleanup(&state->info_raw); + lodepng_info_cleanup(&state->info_png); +} + +void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source) { + lodepng_state_cleanup(dest); + *dest = *source; + lodepng_color_mode_init(&dest->info_raw); + lodepng_info_init(&dest->info_png); + dest->error = lodepng_color_mode_copy(&dest->info_raw, &source->info_raw); if(dest->error) return; + dest->error = lodepng_info_copy(&dest->info_png, &source->info_png); if(dest->error) return; +} + +#endif /* defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) */ + +#ifdef LODEPNG_COMPILE_ENCODER + +/* ////////////////////////////////////////////////////////////////////////// */ +/* / PNG Encoder / */ +/* ////////////////////////////////////////////////////////////////////////// */ + + +static unsigned writeSignature(ucvector* out) { + size_t pos = out->size; + const unsigned char signature[] = {137, 80, 78, 71, 13, 10, 26, 10}; + /*8 bytes PNG signature, aka the magic bytes*/ + if(!ucvector_resize(out, out->size + 8)) return 83; /*alloc fail*/ + lodepng_memcpy(out->data + pos, signature, 8); + return 0; +} + +static unsigned addChunk_IHDR(ucvector* out, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth, unsigned interlace_method) { + unsigned char *chunk, *data; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 13, "IHDR")); + data = chunk + 8; + + lodepng_set32bitInt(data + 0, w); /*width*/ + lodepng_set32bitInt(data + 4, h); /*height*/ + data[8] = (unsigned char)bitdepth; /*bit depth*/ + data[9] = (unsigned char)colortype; /*color type*/ + data[10] = 0; /*compression method*/ + data[11] = 0; /*filter method*/ + data[12] = interlace_method; /*interlace method*/ + + lodepng_chunk_generate_crc(chunk); + return 0; +} + +/* only adds the chunk if needed (there is a key or palette with alpha) */ +static unsigned addChunk_PLTE(ucvector* out, const LodePNGColorMode* info) { + unsigned char* chunk; + size_t i, j = 8; + + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, info->palettesize * 3, "PLTE")); + + for(i = 0; i != info->palettesize; ++i) { + /*add all channels except alpha channel*/ + chunk[j++] = info->palette[i * 4 + 0]; + chunk[j++] = info->palette[i * 4 + 1]; + chunk[j++] = info->palette[i * 4 + 2]; + } + + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_tRNS(ucvector* out, const LodePNGColorMode* info) { + unsigned char* chunk = 0; + + if(info->colortype == LCT_PALETTE) { + size_t i, amount = info->palettesize; + /*the tail of palette values that all have 255 as alpha, does not have to be encoded*/ + for(i = info->palettesize; i != 0; --i) { + if(info->palette[4 * (i - 1) + 3] != 255) break; + --amount; + } + if(amount) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, amount, "tRNS")); + /*add the alpha channel values from the palette*/ + for(i = 0; i != amount; ++i) chunk[8 + i] = info->palette[4 * i + 3]; + } + } else if(info->colortype == LCT_GREY) { + if(info->key_defined) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 2, "tRNS")); + chunk[8] = (unsigned char)(info->key_r >> 8); + chunk[9] = (unsigned char)(info->key_r & 255); + } + } else if(info->colortype == LCT_RGB) { + if(info->key_defined) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 6, "tRNS")); + chunk[8] = (unsigned char)(info->key_r >> 8); + chunk[9] = (unsigned char)(info->key_r & 255); + chunk[10] = (unsigned char)(info->key_g >> 8); + chunk[11] = (unsigned char)(info->key_g & 255); + chunk[12] = (unsigned char)(info->key_b >> 8); + chunk[13] = (unsigned char)(info->key_b & 255); + } + } + + if(chunk) lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_IDAT(ucvector* out, const unsigned char* data, size_t datasize, + LodePNGCompressSettings* zlibsettings) { + unsigned error = 0; + unsigned char* zlib = 0; + size_t zlibsize = 0; + + error = zlib_compress(&zlib, &zlibsize, data, datasize, zlibsettings); + if(!error) { + error = lodepng_chunk_createv(out, zlibsize, "IDAT", zlib); + } + lodepng_free(zlib); + return error; +} + +static unsigned addChunk_IEND(ucvector* out) { + return lodepng_chunk_createv(out, 0, "IEND", 0); +} + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + +static unsigned addChunk_tEXt(ucvector* out, const char* keyword, const char* textstring) { + unsigned char* chunk = 0; + size_t keysize = lodepng_strlen(keyword), textsize = lodepng_strlen(textstring); + size_t size = keysize + 1 + textsize; + if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, size, "tEXt")); + lodepng_memcpy(chunk + 8, keyword, keysize); + chunk[8 + keysize] = 0; /*null termination char*/ + lodepng_memcpy(chunk + 9 + keysize, textstring, textsize); + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_zTXt(ucvector* out, const char* keyword, const char* textstring, + LodePNGCompressSettings* zlibsettings) { + unsigned error = 0; + unsigned char* chunk = 0; + unsigned char* compressed = 0; + size_t compressedsize = 0; + size_t textsize = lodepng_strlen(textstring); + size_t keysize = lodepng_strlen(keyword); + if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ + + error = zlib_compress(&compressed, &compressedsize, + (const unsigned char*)textstring, textsize, zlibsettings); + if(!error) { + size_t size = keysize + 2 + compressedsize; + error = lodepng_chunk_init(&chunk, out, size, "zTXt"); + } + if(!error) { + lodepng_memcpy(chunk + 8, keyword, keysize); + chunk[8 + keysize] = 0; /*null termination char*/ + chunk[9 + keysize] = 0; /*compression method: 0*/ + lodepng_memcpy(chunk + 10 + keysize, compressed, compressedsize); + lodepng_chunk_generate_crc(chunk); + } + + lodepng_free(compressed); + return error; +} + +static unsigned addChunk_iTXt(ucvector* out, unsigned compress, const char* keyword, const char* langtag, + const char* transkey, const char* textstring, LodePNGCompressSettings* zlibsettings) { + unsigned error = 0; + unsigned char* chunk = 0; + unsigned char* compressed = 0; + size_t compressedsize = 0; + size_t textsize = lodepng_strlen(textstring); + size_t keysize = lodepng_strlen(keyword), langsize = lodepng_strlen(langtag), transsize = lodepng_strlen(transkey); + + if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ + + if(compress) { + error = zlib_compress(&compressed, &compressedsize, + (const unsigned char*)textstring, textsize, zlibsettings); + } + if(!error) { + size_t size = keysize + 3 + langsize + 1 + transsize + 1 + (compress ? compressedsize : textsize); + error = lodepng_chunk_init(&chunk, out, size, "iTXt"); + } + if(!error) { + size_t pos = 8; + lodepng_memcpy(chunk + pos, keyword, keysize); + pos += keysize; + chunk[pos++] = 0; /*null termination char*/ + chunk[pos++] = (compress ? 1 : 0); /*compression flag*/ + chunk[pos++] = 0; /*compression method: 0*/ + lodepng_memcpy(chunk + pos, langtag, langsize); + pos += langsize; + chunk[pos++] = 0; /*null termination char*/ + lodepng_memcpy(chunk + pos, transkey, transsize); + pos += transsize; + chunk[pos++] = 0; /*null termination char*/ + if(compress) { + lodepng_memcpy(chunk + pos, compressed, compressedsize); + } else { + lodepng_memcpy(chunk + pos, textstring, textsize); + } + lodepng_chunk_generate_crc(chunk); + } + + lodepng_free(compressed); + return error; +} + +static unsigned addChunk_bKGD(ucvector* out, const LodePNGInfo* info) { + unsigned char* chunk = 0; + if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 2, "bKGD")); + chunk[8] = (unsigned char)(info->background_r >> 8); + chunk[9] = (unsigned char)(info->background_r & 255); + } else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 6, "bKGD")); + chunk[8] = (unsigned char)(info->background_r >> 8); + chunk[9] = (unsigned char)(info->background_r & 255); + chunk[10] = (unsigned char)(info->background_g >> 8); + chunk[11] = (unsigned char)(info->background_g & 255); + chunk[12] = (unsigned char)(info->background_b >> 8); + chunk[13] = (unsigned char)(info->background_b & 255); + } else if(info->color.colortype == LCT_PALETTE) { + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 1, "bKGD")); + chunk[8] = (unsigned char)(info->background_r & 255); /*palette index*/ + } + if(chunk) lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_tIME(ucvector* out, const LodePNGTime* time) { + unsigned char* chunk; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 7, "tIME")); + chunk[8] = (unsigned char)(time->year >> 8); + chunk[9] = (unsigned char)(time->year & 255); + chunk[10] = (unsigned char)time->month; + chunk[11] = (unsigned char)time->day; + chunk[12] = (unsigned char)time->hour; + chunk[13] = (unsigned char)time->minute; + chunk[14] = (unsigned char)time->second; + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_pHYs(ucvector* out, const LodePNGInfo* info) { + unsigned char* chunk; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 9, "pHYs")); + lodepng_set32bitInt(chunk + 8, info->phys_x); + lodepng_set32bitInt(chunk + 12, info->phys_y); + chunk[16] = info->phys_unit; + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_gAMA(ucvector* out, const LodePNGInfo* info) { + unsigned char* chunk; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 4, "gAMA")); + lodepng_set32bitInt(chunk + 8, info->gama_gamma); + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_cHRM(ucvector* out, const LodePNGInfo* info) { + unsigned char* chunk; + CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 32, "cHRM")); + lodepng_set32bitInt(chunk + 8, info->chrm_white_x); + lodepng_set32bitInt(chunk + 12, info->chrm_white_y); + lodepng_set32bitInt(chunk + 16, info->chrm_red_x); + lodepng_set32bitInt(chunk + 20, info->chrm_red_y); + lodepng_set32bitInt(chunk + 24, info->chrm_green_x); + lodepng_set32bitInt(chunk + 28, info->chrm_green_y); + lodepng_set32bitInt(chunk + 32, info->chrm_blue_x); + lodepng_set32bitInt(chunk + 36, info->chrm_blue_y); + lodepng_chunk_generate_crc(chunk); + return 0; +} + +static unsigned addChunk_sRGB(ucvector* out, const LodePNGInfo* info) { + unsigned char data = info->srgb_intent; + return lodepng_chunk_createv(out, 1, "sRGB", &data); +} + +static unsigned addChunk_iCCP(ucvector* out, const LodePNGInfo* info, LodePNGCompressSettings* zlibsettings) { + unsigned error = 0; + unsigned char* chunk = 0; + unsigned char* compressed = 0; + size_t compressedsize = 0; + size_t keysize = lodepng_strlen(info->iccp_name); + + if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ + error = zlib_compress(&compressed, &compressedsize, + info->iccp_profile, info->iccp_profile_size, zlibsettings); + if(!error) { + size_t size = keysize + 2 + compressedsize; + error = lodepng_chunk_init(&chunk, out, size, "iCCP"); + } + if(!error) { + lodepng_memcpy(chunk + 8, info->iccp_name, keysize); + chunk[8 + keysize] = 0; /*null termination char*/ + chunk[9 + keysize] = 0; /*compression method: 0*/ + lodepng_memcpy(chunk + 10 + keysize, compressed, compressedsize); + lodepng_chunk_generate_crc(chunk); + } + + lodepng_free(compressed); + return error; +} + +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +static void filterScanline(unsigned char* out, const unsigned char* scanline, const unsigned char* prevline, + size_t length, size_t bytewidth, unsigned char filterType) { + size_t i; + switch(filterType) { + case 0: /*None*/ + for(i = 0; i != length; ++i) out[i] = scanline[i]; + break; + case 1: /*Sub*/ + for(i = 0; i != bytewidth; ++i) out[i] = scanline[i]; + for(i = bytewidth; i < length; ++i) out[i] = scanline[i] - scanline[i - bytewidth]; + break; + case 2: /*Up*/ + if(prevline) { + for(i = 0; i != length; ++i) out[i] = scanline[i] - prevline[i]; + } else { + for(i = 0; i != length; ++i) out[i] = scanline[i]; + } + break; + case 3: /*Average*/ + if(prevline) { + for(i = 0; i != bytewidth; ++i) out[i] = scanline[i] - (prevline[i] >> 1); + for(i = bytewidth; i < length; ++i) out[i] = scanline[i] - ((scanline[i - bytewidth] + prevline[i]) >> 1); + } else { + for(i = 0; i != bytewidth; ++i) out[i] = scanline[i]; + for(i = bytewidth; i < length; ++i) out[i] = scanline[i] - (scanline[i - bytewidth] >> 1); + } + break; + case 4: /*Paeth*/ + if(prevline) { + /*paethPredictor(0, prevline[i], 0) is always prevline[i]*/ + for(i = 0; i != bytewidth; ++i) out[i] = (scanline[i] - prevline[i]); + for(i = bytewidth; i < length; ++i) { + out[i] = (scanline[i] - paethPredictor(scanline[i - bytewidth], prevline[i], prevline[i - bytewidth])); + } + } else { + for(i = 0; i != bytewidth; ++i) out[i] = scanline[i]; + /*paethPredictor(scanline[i - bytewidth], 0, 0) is always scanline[i - bytewidth]*/ + for(i = bytewidth; i < length; ++i) out[i] = (scanline[i] - scanline[i - bytewidth]); + } + break; + default: return; /*invalid filter type given*/ + } +} + +/* integer binary logarithm, max return value is 31 */ +static size_t ilog2(size_t i) { + size_t result = 0; + if(i >= 65536) { result += 16; i >>= 16; } + if(i >= 256) { result += 8; i >>= 8; } + if(i >= 16) { result += 4; i >>= 4; } + if(i >= 4) { result += 2; i >>= 2; } + if(i >= 2) { result += 1; /*i >>= 1;*/ } + return result; +} + +/* integer approximation for i * log2(i), helper function for LFS_ENTROPY */ +static size_t ilog2i(size_t i) { + size_t l; + if(i == 0) return 0; + l = ilog2(i); + /* approximate i*log2(i): l is integer logarithm, ((i - (1u << l)) << 1u) + linearly approximates the missing fractional part multiplied by i */ + return i * l + ((i - (1u << l)) << 1u); +} + +static unsigned filter(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, + const LodePNGColorMode* color, const LodePNGEncoderSettings* settings) { + /* + For PNG filter method 0 + out must be a buffer with as size: h + (w * h * bpp + 7u) / 8u, because there are + the scanlines with 1 extra byte per scanline + */ + + unsigned bpp = lodepng_get_bpp(color); + /*the width of a scanline in bytes, not including the filter type*/ + size_t linebytes = lodepng_get_raw_size_idat(w, 1, bpp) - 1u; + + /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/ + size_t bytewidth = (bpp + 7u) / 8u; + const unsigned char* prevline = 0; + unsigned x, y; + unsigned error = 0; + LodePNGFilterStrategy strategy = settings->filter_strategy; + + /* + There is a heuristic called the minimum sum of absolute differences heuristic, suggested by the PNG standard: + * If the image type is Palette, or the bit depth is smaller than 8, then do not filter the image (i.e. + use fixed filtering, with the filter None). + * (The other case) If the image type is Grayscale or RGB (with or without Alpha), and the bit depth is + not smaller than 8, then use adaptive filtering heuristic as follows: independently for each row, apply + all five filters and select the filter that produces the smallest sum of absolute values per row. + This heuristic is used if filter strategy is LFS_MINSUM and filter_palette_zero is true. + + If filter_palette_zero is true and filter_strategy is not LFS_MINSUM, the above heuristic is followed, + but for "the other case", whatever strategy filter_strategy is set to instead of the minimum sum + heuristic is used. + */ + if(settings->filter_palette_zero && + (color->colortype == LCT_PALETTE || color->bitdepth < 8)) strategy = LFS_ZERO; + + if(bpp == 0) return 31; /*error: invalid color type*/ + + if(strategy >= LFS_ZERO && strategy <= LFS_FOUR) { + unsigned char type = (unsigned char)strategy; + for(y = 0; y != h; ++y) { + size_t outindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ + size_t inindex = linebytes * y; + out[outindex] = type; /*filter type byte*/ + filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, type); + prevline = &in[inindex]; + } + } else if(strategy == LFS_MINSUM) { + /*adaptive filtering*/ + unsigned char* attempt[5]; /*five filtering attempts, one for each filter type*/ + size_t smallest = 0; + unsigned char type, bestType = 0; + + for(type = 0; type != 5; ++type) { + attempt[type] = (unsigned char*)lodepng_malloc(linebytes); + if(!attempt[type]) error = 83; /*alloc fail*/ + } + + if(!error) { + for(y = 0; y != h; ++y) { + /*try the 5 filter types*/ + for(type = 0; type != 5; ++type) { + size_t sum = 0; + filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type); + + /*calculate the sum of the result*/ + if(type == 0) { + for(x = 0; x != linebytes; ++x) sum += (unsigned char)(attempt[type][x]); + } else { + for(x = 0; x != linebytes; ++x) { + /*For differences, each byte should be treated as signed, values above 127 are negative + (converted to signed char). Filtertype 0 isn't a difference though, so use unsigned there. + This means filtertype 0 is almost never chosen, but that is justified.*/ + unsigned char s = attempt[type][x]; + sum += s < 128 ? s : (255U - s); + } + } + + /*check if this is smallest sum (or if type == 0 it's the first case so always store the values)*/ + if(type == 0 || sum < smallest) { + bestType = type; + smallest = sum; + } + } + + prevline = &in[y * linebytes]; + + /*now fill the out values*/ + out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/ + for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x]; + } + } + + for(type = 0; type != 5; ++type) lodepng_free(attempt[type]); + } else if(strategy == LFS_ENTROPY) { + unsigned char* attempt[5]; /*five filtering attempts, one for each filter type*/ + size_t bestSum = 0; + unsigned type, bestType = 0; + unsigned count[256]; + + for(type = 0; type != 5; ++type) { + attempt[type] = (unsigned char*)lodepng_malloc(linebytes); + if(!attempt[type]) error = 83; /*alloc fail*/ + } + + if(!error) { + for(y = 0; y != h; ++y) { + /*try the 5 filter types*/ + for(type = 0; type != 5; ++type) { + size_t sum = 0; + filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type); + lodepng_memset(count, 0, 256 * sizeof(*count)); + for(x = 0; x != linebytes; ++x) ++count[attempt[type][x]]; + ++count[type]; /*the filter type itself is part of the scanline*/ + for(x = 0; x != 256; ++x) { + sum += ilog2i(count[x]); + } + /*check if this is smallest sum (or if type == 0 it's the first case so always store the values)*/ + if(type == 0 || sum > bestSum) { + bestType = type; + bestSum = sum; + } + } + + prevline = &in[y * linebytes]; + + /*now fill the out values*/ + out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/ + for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x]; + } + } + + for(type = 0; type != 5; ++type) lodepng_free(attempt[type]); + } else if(strategy == LFS_PREDEFINED) { + for(y = 0; y != h; ++y) { + size_t outindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ + size_t inindex = linebytes * y; + unsigned char type = settings->predefined_filters[y]; + out[outindex] = type; /*filter type byte*/ + filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, type); + prevline = &in[inindex]; + } + } else if(strategy == LFS_BRUTE_FORCE) { + /*brute force filter chooser. + deflate the scanline after every filter attempt to see which one deflates best. + This is very slow and gives only slightly smaller, sometimes even larger, result*/ + size_t size[5]; + unsigned char* attempt[5]; /*five filtering attempts, one for each filter type*/ + size_t smallest = 0; + unsigned type = 0, bestType = 0; + unsigned char* dummy; + LodePNGCompressSettings zlibsettings; + lodepng_memcpy(&zlibsettings, &settings->zlibsettings, sizeof(LodePNGCompressSettings)); + /*use fixed tree on the attempts so that the tree is not adapted to the filtertype on purpose, + to simulate the true case where the tree is the same for the whole image. Sometimes it gives + better result with dynamic tree anyway. Using the fixed tree sometimes gives worse, but in rare + cases better compression. It does make this a bit less slow, so it's worth doing this.*/ + zlibsettings.btype = 1; + /*a custom encoder likely doesn't read the btype setting and is optimized for complete PNG + images only, so disable it*/ + zlibsettings.custom_zlib = 0; + zlibsettings.custom_deflate = 0; + for(type = 0; type != 5; ++type) { + attempt[type] = (unsigned char*)lodepng_malloc(linebytes); + if(!attempt[type]) error = 83; /*alloc fail*/ + } + if(!error) { + for(y = 0; y != h; ++y) /*try the 5 filter types*/ { + for(type = 0; type != 5; ++type) { + unsigned testsize = (unsigned)linebytes; + /*if(testsize > 8) testsize /= 8;*/ /*it already works good enough by testing a part of the row*/ + + filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type); + size[type] = 0; + dummy = 0; + zlib_compress(&dummy, &size[type], attempt[type], testsize, &zlibsettings); + lodepng_free(dummy); + /*check if this is smallest size (or if type == 0 it's the first case so always store the values)*/ + if(type == 0 || size[type] < smallest) { + bestType = type; + smallest = size[type]; + } + } + prevline = &in[y * linebytes]; + out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/ + for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x]; + } + } + for(type = 0; type != 5; ++type) lodepng_free(attempt[type]); + } + else return 88; /* unknown filter strategy */ + + return error; +} + +static void addPaddingBits(unsigned char* out, const unsigned char* in, + size_t olinebits, size_t ilinebits, unsigned h) { + /*The opposite of the removePaddingBits function + olinebits must be >= ilinebits*/ + unsigned y; + size_t diff = olinebits - ilinebits; + size_t obp = 0, ibp = 0; /*bit pointers*/ + for(y = 0; y != h; ++y) { + size_t x; + for(x = 0; x < ilinebits; ++x) { + unsigned char bit = readBitFromReversedStream(&ibp, in); + setBitOfReversedStream(&obp, out, bit); + } + /*obp += diff; --> no, fill in some value in the padding bits too, to avoid + "Use of uninitialised value of size ###" warning from valgrind*/ + for(x = 0; x != diff; ++x) setBitOfReversedStream(&obp, out, 0); + } +} + +/* +in: non-interlaced image with size w*h +out: the same pixels, but re-ordered according to PNG's Adam7 interlacing, with + no padding bits between scanlines, but between reduced images so that each + reduced image starts at a byte. +bpp: bits per pixel +there are no padding bits, not between scanlines, not between reduced images +in has the following size in bits: w * h * bpp. +out is possibly bigger due to padding bits between reduced images +NOTE: comments about padding bits are only relevant if bpp < 8 +*/ +static void Adam7_interlace(unsigned char* out, const unsigned char* in, unsigned w, unsigned h, unsigned bpp) { + unsigned passw[7], passh[7]; + size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned i; + + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + + if(bpp >= 8) { + for(i = 0; i != 7; ++i) { + unsigned x, y, b; + size_t bytewidth = bpp / 8u; + for(y = 0; y < passh[i]; ++y) + for(x = 0; x < passw[i]; ++x) { + size_t pixelinstart = ((ADAM7_IY[i] + y * ADAM7_DY[i]) * w + ADAM7_IX[i] + x * ADAM7_DX[i]) * bytewidth; + size_t pixeloutstart = passstart[i] + (y * passw[i] + x) * bytewidth; + for(b = 0; b < bytewidth; ++b) { + out[pixeloutstart + b] = in[pixelinstart + b]; + } + } + } + } else /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/ { + for(i = 0; i != 7; ++i) { + unsigned x, y, b; + unsigned ilinebits = bpp * passw[i]; + unsigned olinebits = bpp * w; + size_t obp, ibp; /*bit pointers (for out and in buffer)*/ + for(y = 0; y < passh[i]; ++y) + for(x = 0; x < passw[i]; ++x) { + ibp = (ADAM7_IY[i] + y * ADAM7_DY[i]) * olinebits + (ADAM7_IX[i] + x * ADAM7_DX[i]) * bpp; + obp = (8 * passstart[i]) + (y * ilinebits + x * bpp); + for(b = 0; b < bpp; ++b) { + unsigned char bit = readBitFromReversedStream(&ibp, in); + setBitOfReversedStream(&obp, out, bit); + } + } + } + } +} + +/*out must be buffer big enough to contain uncompressed IDAT chunk data, and in must contain the full image. +return value is error**/ +static unsigned preProcessScanlines(unsigned char** out, size_t* outsize, const unsigned char* in, + unsigned w, unsigned h, + const LodePNGInfo* info_png, const LodePNGEncoderSettings* settings) { + /* + This function converts the pure 2D image with the PNG's colortype, into filtered-padded-interlaced data. Steps: + *) if no Adam7: 1) add padding bits (= possible extra bits per scanline if bpp < 8) 2) filter + *) if adam7: 1) Adam7_interlace 2) 7x add padding bits 3) 7x filter + */ + unsigned bpp = lodepng_get_bpp(&info_png->color); + unsigned error = 0; + + if(info_png->interlace_method == 0) { + *outsize = h + (h * ((w * bpp + 7u) / 8u)); /*image size plus an extra byte per scanline + possible padding bits*/ + *out = (unsigned char*)lodepng_malloc(*outsize); + if(!(*out) && (*outsize)) error = 83; /*alloc fail*/ + + if(!error) { + /*non multiple of 8 bits per scanline, padding bits needed per scanline*/ + if(bpp < 8 && w * bpp != ((w * bpp + 7u) / 8u) * 8u) { + unsigned char* padded = (unsigned char*)lodepng_malloc(h * ((w * bpp + 7u) / 8u)); + if(!padded) error = 83; /*alloc fail*/ + if(!error) { + addPaddingBits(padded, in, ((w * bpp + 7u) / 8u) * 8u, w * bpp, h); + error = filter(*out, padded, w, h, &info_png->color, settings); + } + lodepng_free(padded); + } else { + /*we can immediately filter into the out buffer, no other steps needed*/ + error = filter(*out, in, w, h, &info_png->color, settings); + } + } + } else /*interlace_method is 1 (Adam7)*/ { + unsigned passw[7], passh[7]; + size_t filter_passstart[8], padded_passstart[8], passstart[8]; + unsigned char* adam7; + + Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); + + *outsize = filter_passstart[7]; /*image size plus an extra byte per scanline + possible padding bits*/ + *out = (unsigned char*)lodepng_malloc(*outsize); + if(!(*out)) error = 83; /*alloc fail*/ + + adam7 = (unsigned char*)lodepng_malloc(passstart[7]); + if(!adam7 && passstart[7]) error = 83; /*alloc fail*/ + + if(!error && adam7) { + unsigned i; + + Adam7_interlace(adam7, in, w, h, bpp); + for(i = 0; i != 7; ++i) { + if(bpp < 8) { + unsigned char* padded = (unsigned char*)lodepng_malloc(padded_passstart[i + 1] - padded_passstart[i]); + if(!padded) ERROR_BREAK(83); /*alloc fail*/ + addPaddingBits(padded, &adam7[passstart[i]], + ((passw[i] * bpp + 7u) / 8u) * 8u, passw[i] * bpp, passh[i]); + error = filter(&(*out)[filter_passstart[i]], padded, + passw[i], passh[i], &info_png->color, settings); + lodepng_free(padded); + } else { + error = filter(&(*out)[filter_passstart[i]], &adam7[padded_passstart[i]], + passw[i], passh[i], &info_png->color, settings); + } + + if(error) break; + } + } + + lodepng_free(adam7); + } + + return error; +} + +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS +static unsigned addUnknownChunks(ucvector* out, unsigned char* data, size_t datasize) { + unsigned char* inchunk = data; + while((size_t)(inchunk - data) < datasize) { + CERROR_TRY_RETURN(lodepng_chunk_append(&out->data, &out->size, inchunk)); + out->allocsize = out->size; /*fix the allocsize again*/ + inchunk = lodepng_chunk_next(inchunk, data + datasize); + } + return 0; +} + +static unsigned isGrayICCProfile(const unsigned char* profile, unsigned size) { + /* + It is a gray profile if bytes 16-19 are "GRAY", rgb profile if bytes 16-19 + are "RGB ". We do not perform any full parsing of the ICC profile here, other + than check those 4 bytes to grayscale profile. Other than that, validity of + the profile is not checked. This is needed only because the PNG specification + requires using a non-gray color model if there is an ICC profile with "RGB " + (sadly limiting compression opportunities if the input data is grayscale RGB + data), and requires using a gray color model if it is "GRAY". + */ + if(size < 20) return 0; + return profile[16] == 'G' && profile[17] == 'R' && profile[18] == 'A' && profile[19] == 'Y'; +} + +static unsigned isRGBICCProfile(const unsigned char* profile, unsigned size) { + /* See comment in isGrayICCProfile*/ + if(size < 20) return 0; + return profile[16] == 'R' && profile[17] == 'G' && profile[18] == 'B' && profile[19] == ' '; +} +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + +unsigned lodepng_encode(unsigned char** out, size_t* outsize, + const unsigned char* image, unsigned w, unsigned h, + LodePNGState* state) { + unsigned char* data = 0; /*uncompressed version of the IDAT chunk data*/ + size_t datasize = 0; + ucvector outv = ucvector_init(NULL, 0); + LodePNGInfo info; + const LodePNGInfo* info_png = &state->info_png; + + lodepng_info_init(&info); + + /*provide some proper output values if error will happen*/ + *out = 0; + *outsize = 0; + state->error = 0; + + /*check input values validity*/ + if((info_png->color.colortype == LCT_PALETTE || state->encoder.force_palette) + && (info_png->color.palettesize == 0 || info_png->color.palettesize > 256)) { + state->error = 68; /*invalid palette size, it is only allowed to be 1-256*/ + goto cleanup; + } + if(state->encoder.zlibsettings.btype > 2) { + state->error = 61; /*error: invalid btype*/ + goto cleanup; + } + if(info_png->interlace_method > 1) { + state->error = 71; /*error: invalid interlace mode*/ + goto cleanup; + } + state->error = checkColorValidity(info_png->color.colortype, info_png->color.bitdepth); + if(state->error) goto cleanup; /*error: invalid color type given*/ + state->error = checkColorValidity(state->info_raw.colortype, state->info_raw.bitdepth); + if(state->error) goto cleanup; /*error: invalid color type given*/ + + /* color convert and compute scanline filter types */ + lodepng_info_copy(&info, &state->info_png); + if(state->encoder.auto_convert) { + LodePNGColorStats stats; + lodepng_color_stats_init(&stats); +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + if(info_png->iccp_defined && + isGrayICCProfile(info_png->iccp_profile, info_png->iccp_profile_size)) { + /*the PNG specification does not allow to use palette with a GRAY ICC profile, even + if the palette has only gray colors, so disallow it.*/ + stats.allow_palette = 0; + } + if(info_png->iccp_defined && + isRGBICCProfile(info_png->iccp_profile, info_png->iccp_profile_size)) { + /*the PNG specification does not allow to use grayscale color with RGB ICC profile, so disallow gray.*/ + stats.allow_greyscale = 0; + } +#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */ + state->error = lodepng_compute_color_stats(&stats, image, w, h, &state->info_raw); + if(state->error) goto cleanup; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + if(info_png->background_defined) { + /*the background chunk's color must be taken into account as well*/ + unsigned r = 0, g = 0, b = 0; + LodePNGColorMode mode16 = lodepng_color_mode_make(LCT_RGB, 16); + lodepng_convert_rgb(&r, &g, &b, info_png->background_r, info_png->background_g, info_png->background_b, &mode16, &info_png->color); + state->error = lodepng_color_stats_add(&stats, r, g, b, 65535); + if(state->error) goto cleanup; + } +#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */ + state->error = auto_choose_color(&info.color, &state->info_raw, &stats); + if(state->error) goto cleanup; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*also convert the background chunk*/ + if(info_png->background_defined) { + if(lodepng_convert_rgb(&info.background_r, &info.background_g, &info.background_b, + info_png->background_r, info_png->background_g, info_png->background_b, &info.color, &info_png->color)) { + state->error = 104; + goto cleanup; + } + } +#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */ + } +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + if(info_png->iccp_defined) { + unsigned gray_icc = isGrayICCProfile(info_png->iccp_profile, info_png->iccp_profile_size); + unsigned rgb_icc = isRGBICCProfile(info_png->iccp_profile, info_png->iccp_profile_size); + unsigned gray_png = info.color.colortype == LCT_GREY || info.color.colortype == LCT_GREY_ALPHA; + if(!gray_icc && !rgb_icc) { + state->error = 100; /* Disallowed profile color type for PNG */ + goto cleanup; + } + if(gray_icc != gray_png) { + /*Not allowed to use RGB/RGBA/palette with GRAY ICC profile or vice versa, + or in case of auto_convert, it wasn't possible to find appropriate model*/ + state->error = state->encoder.auto_convert ? 102 : 101; + goto cleanup; + } + } +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + if(!lodepng_color_mode_equal(&state->info_raw, &info.color)) { + unsigned char* converted; + size_t size = ((size_t)w * (size_t)h * (size_t)lodepng_get_bpp(&info.color) + 7u) / 8u; + + converted = (unsigned char*)lodepng_malloc(size); + if(!converted && size) state->error = 83; /*alloc fail*/ + if(!state->error) { + state->error = lodepng_convert(converted, image, &info.color, &state->info_raw, w, h); + } + if(!state->error) { + state->error = preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder); + } + lodepng_free(converted); + if(state->error) goto cleanup; + } else { + state->error = preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder); + if(state->error) goto cleanup; + } + + /* output all PNG chunks */ { +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + size_t i; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + /*write signature and chunks*/ + state->error = writeSignature(&outv); + if(state->error) goto cleanup; + /*IHDR*/ + state->error = addChunk_IHDR(&outv, w, h, info.color.colortype, info.color.bitdepth, info.interlace_method); + if(state->error) goto cleanup; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*unknown chunks between IHDR and PLTE*/ + if(info.unknown_chunks_data[0]) { + state->error = addUnknownChunks(&outv, info.unknown_chunks_data[0], info.unknown_chunks_size[0]); + if(state->error) goto cleanup; + } + /*color profile chunks must come before PLTE */ + if(info.iccp_defined) { + state->error = addChunk_iCCP(&outv, &info, &state->encoder.zlibsettings); + if(state->error) goto cleanup; + } + if(info.srgb_defined) { + state->error = addChunk_sRGB(&outv, &info); + if(state->error) goto cleanup; + } + if(info.gama_defined) { + state->error = addChunk_gAMA(&outv, &info); + if(state->error) goto cleanup; + } + if(info.chrm_defined) { + state->error = addChunk_cHRM(&outv, &info); + if(state->error) goto cleanup; + } +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + /*PLTE*/ + if(info.color.colortype == LCT_PALETTE) { + state->error = addChunk_PLTE(&outv, &info.color); + if(state->error) goto cleanup; + } + if(state->encoder.force_palette && (info.color.colortype == LCT_RGB || info.color.colortype == LCT_RGBA)) { + /*force_palette means: write suggested palette for truecolor in PLTE chunk*/ + state->error = addChunk_PLTE(&outv, &info.color); + if(state->error) goto cleanup; + } + /*tRNS (this will only add if when necessary) */ + state->error = addChunk_tRNS(&outv, &info.color); + if(state->error) goto cleanup; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*bKGD (must come between PLTE and the IDAt chunks*/ + if(info.background_defined) { + state->error = addChunk_bKGD(&outv, &info); + if(state->error) goto cleanup; + } + /*pHYs (must come before the IDAT chunks)*/ + if(info.phys_defined) { + state->error = addChunk_pHYs(&outv, &info); + if(state->error) goto cleanup; + } + + /*unknown chunks between PLTE and IDAT*/ + if(info.unknown_chunks_data[1]) { + state->error = addUnknownChunks(&outv, info.unknown_chunks_data[1], info.unknown_chunks_size[1]); + if(state->error) goto cleanup; + } +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + /*IDAT (multiple IDAT chunks must be consecutive)*/ + state->error = addChunk_IDAT(&outv, data, datasize, &state->encoder.zlibsettings); + if(state->error) goto cleanup; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + /*tIME*/ + if(info.time_defined) { + state->error = addChunk_tIME(&outv, &info.time); + if(state->error) goto cleanup; + } + /*tEXt and/or zTXt*/ + for(i = 0; i != info.text_num; ++i) { + if(lodepng_strlen(info.text_keys[i]) > 79) { + state->error = 66; /*text chunk too large*/ + goto cleanup; + } + if(lodepng_strlen(info.text_keys[i]) < 1) { + state->error = 67; /*text chunk too small*/ + goto cleanup; + } + if(state->encoder.text_compression) { + state->error = addChunk_zTXt(&outv, info.text_keys[i], info.text_strings[i], &state->encoder.zlibsettings); + if(state->error) goto cleanup; + } else { + state->error = addChunk_tEXt(&outv, info.text_keys[i], info.text_strings[i]); + if(state->error) goto cleanup; + } + } + /*LodePNG version id in text chunk*/ + if(state->encoder.add_id) { + unsigned already_added_id_text = 0; + for(i = 0; i != info.text_num; ++i) { + const char* k = info.text_keys[i]; + /* Could use strcmp, but we're not calling or reimplementing this C library function for this use only */ + if(k[0] == 'L' && k[1] == 'o' && k[2] == 'd' && k[3] == 'e' && + k[4] == 'P' && k[5] == 'N' && k[6] == 'G' && k[7] == '\0') { + already_added_id_text = 1; + break; + } + } + if(already_added_id_text == 0) { + state->error = addChunk_tEXt(&outv, "LodePNG", LODEPNG_VERSION_STRING); /*it's shorter as tEXt than as zTXt chunk*/ + if(state->error) goto cleanup; + } + } + /*iTXt*/ + for(i = 0; i != info.itext_num; ++i) { + if(lodepng_strlen(info.itext_keys[i]) > 79) { + state->error = 66; /*text chunk too large*/ + goto cleanup; + } + if(lodepng_strlen(info.itext_keys[i]) < 1) { + state->error = 67; /*text chunk too small*/ + goto cleanup; + } + state->error = addChunk_iTXt( + &outv, state->encoder.text_compression, + info.itext_keys[i], info.itext_langtags[i], info.itext_transkeys[i], info.itext_strings[i], + &state->encoder.zlibsettings); + if(state->error) goto cleanup; + } + + /*unknown chunks between IDAT and IEND*/ + if(info.unknown_chunks_data[2]) { + state->error = addUnknownChunks(&outv, info.unknown_chunks_data[2], info.unknown_chunks_size[2]); + if(state->error) goto cleanup; + } +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ + state->error = addChunk_IEND(&outv); + if(state->error) goto cleanup; + } + +cleanup: + lodepng_info_cleanup(&info); + lodepng_free(data); + + /*instead of cleaning the vector up, give it to the output*/ + *out = outv.data; + *outsize = outv.size; + + return state->error; +} + +unsigned lodepng_encode_memory(unsigned char** out, size_t* outsize, const unsigned char* image, + unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) { + unsigned error; + LodePNGState state; + lodepng_state_init(&state); + state.info_raw.colortype = colortype; + state.info_raw.bitdepth = bitdepth; + state.info_png.color.colortype = colortype; + state.info_png.color.bitdepth = bitdepth; + lodepng_encode(out, outsize, image, w, h, &state); + error = state.error; + lodepng_state_cleanup(&state); + return error; +} + +unsigned lodepng_encode32(unsigned char** out, size_t* outsize, const unsigned char* image, unsigned w, unsigned h) { + return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGBA, 8); +} + +unsigned lodepng_encode24(unsigned char** out, size_t* outsize, const unsigned char* image, unsigned w, unsigned h) { + return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGB, 8); +} + +#ifdef LODEPNG_COMPILE_DISK +unsigned lodepng_encode_file(const char* filename, const unsigned char* image, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth) { + unsigned char* buffer; + size_t buffersize; + unsigned error = lodepng_encode_memory(&buffer, &buffersize, image, w, h, colortype, bitdepth); + if(!error) error = lodepng_save_file(buffer, buffersize, filename); + lodepng_free(buffer); + return error; +} + +unsigned lodepng_encode32_file(const char* filename, const unsigned char* image, unsigned w, unsigned h) { + return lodepng_encode_file(filename, image, w, h, LCT_RGBA, 8); +} + +unsigned lodepng_encode24_file(const char* filename, const unsigned char* image, unsigned w, unsigned h) { + return lodepng_encode_file(filename, image, w, h, LCT_RGB, 8); +} +#endif /*LODEPNG_COMPILE_DISK*/ + +void lodepng_encoder_settings_init(LodePNGEncoderSettings* settings) { + lodepng_compress_settings_init(&settings->zlibsettings); + settings->filter_palette_zero = 1; + settings->filter_strategy = LFS_MINSUM; + settings->auto_convert = 1; + settings->force_palette = 0; + settings->predefined_filters = 0; +#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS + settings->add_id = 0; + settings->text_compression = 1; +#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ +} + +#endif /*LODEPNG_COMPILE_ENCODER*/ +#endif /*LODEPNG_COMPILE_PNG*/ + +#ifdef LODEPNG_COMPILE_ERROR_TEXT +/* +This returns the description of a numerical error code in English. This is also +the documentation of all the error codes. +*/ +const char* lodepng_error_text(unsigned code) { + switch(code) { + case 0: return "no error, everything went ok"; + case 1: return "nothing done yet"; /*the Encoder/Decoder has done nothing yet, error checking makes no sense yet*/ + case 10: return "end of input memory reached without huffman end code"; /*while huffman decoding*/ + case 11: return "error in code tree made it jump outside of huffman tree"; /*while huffman decoding*/ + case 13: return "problem while processing dynamic deflate block"; + case 14: return "problem while processing dynamic deflate block"; + case 15: return "problem while processing dynamic deflate block"; + /*this error could happen if there are only 0 or 1 symbols present in the huffman code:*/ + case 16: return "invalid code while processing dynamic deflate block"; + case 17: return "end of out buffer memory reached while inflating"; + case 18: return "invalid distance code while inflating"; + case 19: return "end of out buffer memory reached while inflating"; + case 20: return "invalid deflate block BTYPE encountered while decoding"; + case 21: return "NLEN is not ones complement of LEN in a deflate block"; + + /*end of out buffer memory reached while inflating: + This can happen if the inflated deflate data is longer than the amount of bytes required to fill up + all the pixels of the image, given the color depth and image dimensions. Something that doesn't + happen in a normal, well encoded, PNG image.*/ + case 22: return "end of out buffer memory reached while inflating"; + case 23: return "end of in buffer memory reached while inflating"; + case 24: return "invalid FCHECK in zlib header"; + case 25: return "invalid compression method in zlib header"; + case 26: return "FDICT encountered in zlib header while it's not used for PNG"; + case 27: return "PNG file is smaller than a PNG header"; + /*Checks the magic file header, the first 8 bytes of the PNG file*/ + case 28: return "incorrect PNG signature, it's no PNG or corrupted"; + case 29: return "first chunk is not the header chunk"; + case 30: return "chunk length too large, chunk broken off at end of file"; + case 31: return "illegal PNG color type or bpp"; + case 32: return "illegal PNG compression method"; + case 33: return "illegal PNG filter method"; + case 34: return "illegal PNG interlace method"; + case 35: return "chunk length of a chunk is too large or the chunk too small"; + case 36: return "illegal PNG filter type encountered"; + case 37: return "illegal bit depth for this color type given"; + case 38: return "the palette is too small or too big"; /*0, or more than 256 colors*/ + case 39: return "tRNS chunk before PLTE or has more entries than palette size"; + case 40: return "tRNS chunk has wrong size for grayscale image"; + case 41: return "tRNS chunk has wrong size for RGB image"; + case 42: return "tRNS chunk appeared while it was not allowed for this color type"; + case 43: return "bKGD chunk has wrong size for palette image"; + case 44: return "bKGD chunk has wrong size for grayscale image"; + case 45: return "bKGD chunk has wrong size for RGB image"; + case 48: return "empty input buffer given to decoder. Maybe caused by non-existing file?"; + case 49: return "jumped past memory while generating dynamic huffman tree"; + case 50: return "jumped past memory while generating dynamic huffman tree"; + case 51: return "jumped past memory while inflating huffman block"; + case 52: return "jumped past memory while inflating"; + case 53: return "size of zlib data too small"; + case 54: return "repeat symbol in tree while there was no value symbol yet"; + /*jumped past tree while generating huffman tree, this could be when the + tree will have more leaves than symbols after generating it out of the + given lengths. They call this an oversubscribed dynamic bit lengths tree in zlib.*/ + case 55: return "jumped past tree while generating huffman tree"; + case 56: return "given output image colortype or bitdepth not supported for color conversion"; + case 57: return "invalid CRC encountered (checking CRC can be disabled)"; + case 58: return "invalid ADLER32 encountered (checking ADLER32 can be disabled)"; + case 59: return "requested color conversion not supported"; + case 60: return "invalid window size given in the settings of the encoder (must be 0-32768)"; + case 61: return "invalid BTYPE given in the settings of the encoder (only 0, 1 and 2 are allowed)"; + /*LodePNG leaves the choice of RGB to grayscale conversion formula to the user.*/ + case 62: return "conversion from color to grayscale not supported"; + /*(2^31-1)*/ + case 63: return "length of a chunk too long, max allowed for PNG is 2147483647 bytes per chunk"; + /*this would result in the inability of a deflated block to ever contain an end code. It must be at least 1.*/ + case 64: return "the length of the END symbol 256 in the Huffman tree is 0"; + case 66: return "the length of a text chunk keyword given to the encoder is longer than the maximum of 79 bytes"; + case 67: return "the length of a text chunk keyword given to the encoder is smaller than the minimum of 1 byte"; + case 68: return "tried to encode a PLTE chunk with a palette that has less than 1 or more than 256 colors"; + case 69: return "unknown chunk type with 'critical' flag encountered by the decoder"; + case 71: return "invalid interlace mode given to encoder (must be 0 or 1)"; + case 72: return "while decoding, invalid compression method encountering in zTXt or iTXt chunk (it must be 0)"; + case 73: return "invalid tIME chunk size"; + case 74: return "invalid pHYs chunk size"; + /*length could be wrong, or data chopped off*/ + case 75: return "no null termination char found while decoding text chunk"; + case 76: return "iTXt chunk too short to contain required bytes"; + case 77: return "integer overflow in buffer size"; + case 78: return "failed to open file for reading"; /*file doesn't exist or couldn't be opened for reading*/ + case 79: return "failed to open file for writing"; + case 80: return "tried creating a tree of 0 symbols"; + case 81: return "lazy matching at pos 0 is impossible"; + case 82: return "color conversion to palette requested while a color isn't in palette, or index out of bounds"; + case 83: return "memory allocation failed"; + case 84: return "given image too small to contain all pixels to be encoded"; + case 86: return "impossible offset in lz77 encoding (internal bug)"; + case 87: return "must provide custom zlib function pointer if LODEPNG_COMPILE_ZLIB is not defined"; + case 88: return "invalid filter strategy given for LodePNGEncoderSettings.filter_strategy"; + case 89: return "text chunk keyword too short or long: must have size 1-79"; + /*the windowsize in the LodePNGCompressSettings. Requiring POT(==> & instead of %) makes encoding 12% faster.*/ + case 90: return "windowsize must be a power of two"; + case 91: return "invalid decompressed idat size"; + case 92: return "integer overflow due to too many pixels"; + case 93: return "zero width or height is invalid"; + case 94: return "header chunk must have a size of 13 bytes"; + case 95: return "integer overflow with combined idat chunk size"; + case 96: return "invalid gAMA chunk size"; + case 97: return "invalid cHRM chunk size"; + case 98: return "invalid sRGB chunk size"; + case 99: return "invalid sRGB rendering intent"; + case 100: return "invalid ICC profile color type, the PNG specification only allows RGB or GRAY"; + case 101: return "PNG specification does not allow RGB ICC profile on gray color types and vice versa"; + case 102: return "not allowed to set grayscale ICC profile with colored pixels by PNG specification"; + case 103: return "invalid palette index in bKGD chunk. Maybe it came before PLTE chunk?"; + case 104: return "invalid bKGD color while encoding (e.g. palette index out of range)"; + case 105: return "integer overflow of bitsize"; + case 106: return "PNG file must have PLTE chunk if color type is palette"; + case 107: return "color convert from palette mode requested without setting the palette data in it"; + case 108: return "tried to add more than 256 values to a palette"; + /*this limit can be configured in LodePNGDecompressSettings*/ + case 109: return "tried to decompress zlib or deflate data larger than desired max_output_size"; + case 110: return "custom zlib or inflate decompression failed"; + case 111: return "custom zlib or deflate compression failed"; + /*max text size limit can be configured in LodePNGDecoderSettings. This error prevents + unreasonable memory consumption when decoding due to impossibly large text sizes.*/ + case 112: return "compressed text unreasonably large"; + /*max ICC size limit can be configured in LodePNGDecoderSettings. This error prevents + unreasonable memory consumption when decoding due to impossibly large ICC profile*/ + case 113: return "ICC profile unreasonably large"; + } + return "unknown error code"; +} +#endif /*LODEPNG_COMPILE_ERROR_TEXT*/ + +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* // C++ Wrapper // */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +#ifdef LODEPNG_COMPILE_CPP +namespace lodepng { + +#ifdef LODEPNG_COMPILE_DISK +unsigned load_file(std::vector& buffer, const std::string& filename) { + long size = lodepng_filesize(filename.c_str()); + if(size < 0) return 78; + buffer.resize((size_t)size); + return size == 0 ? 0 : lodepng_buffer_file(&buffer[0], (size_t)size, filename.c_str()); +} + +/*write given buffer to the file, overwriting the file, it doesn't append to it.*/ +unsigned save_file(const std::vector& buffer, const std::string& filename) { + return lodepng_save_file(buffer.empty() ? 0 : &buffer[0], buffer.size(), filename.c_str()); +} +#endif /* LODEPNG_COMPILE_DISK */ + +#ifdef LODEPNG_COMPILE_ZLIB +#ifdef LODEPNG_COMPILE_DECODER +unsigned decompress(std::vector& out, const unsigned char* in, size_t insize, + const LodePNGDecompressSettings& settings) { + unsigned char* buffer = 0; + size_t buffersize = 0; + unsigned error = zlib_decompress(&buffer, &buffersize, 0, in, insize, &settings); + if(buffer) { + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + lodepng_free(buffer); + } + return error; +} + +unsigned decompress(std::vector& out, const std::vector& in, + const LodePNGDecompressSettings& settings) { + return decompress(out, in.empty() ? 0 : &in[0], in.size(), settings); +} +#endif /* LODEPNG_COMPILE_DECODER */ + +#ifdef LODEPNG_COMPILE_ENCODER +unsigned compress(std::vector& out, const unsigned char* in, size_t insize, + const LodePNGCompressSettings& settings) { + unsigned char* buffer = 0; + size_t buffersize = 0; + unsigned error = zlib_compress(&buffer, &buffersize, in, insize, &settings); + if(buffer) { + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + lodepng_free(buffer); + } + return error; +} + +unsigned compress(std::vector& out, const std::vector& in, + const LodePNGCompressSettings& settings) { + return compress(out, in.empty() ? 0 : &in[0], in.size(), settings); +} +#endif /* LODEPNG_COMPILE_ENCODER */ +#endif /* LODEPNG_COMPILE_ZLIB */ + + +#ifdef LODEPNG_COMPILE_PNG + +State::State() { + lodepng_state_init(this); +} + +State::State(const State& other) { + lodepng_state_init(this); + lodepng_state_copy(this, &other); +} + +State::~State() { + lodepng_state_cleanup(this); +} + +State& State::operator=(const State& other) { + lodepng_state_copy(this, &other); + return *this; +} + +#ifdef LODEPNG_COMPILE_DECODER + +unsigned decode(std::vector& out, unsigned& w, unsigned& h, const unsigned char* in, + size_t insize, LodePNGColorType colortype, unsigned bitdepth) { + unsigned char* buffer = 0; + unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth); + if(buffer && !error) { + State state; + state.info_raw.colortype = colortype; + state.info_raw.bitdepth = bitdepth; + size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw); + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + } + lodepng_free(buffer); + return error; +} + +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + const std::vector& in, LodePNGColorType colortype, unsigned bitdepth) { + return decode(out, w, h, in.empty() ? 0 : &in[0], (unsigned)in.size(), colortype, bitdepth); +} + +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + State& state, + const unsigned char* in, size_t insize) { + unsigned char* buffer = NULL; + unsigned error = lodepng_decode(&buffer, &w, &h, &state, in, insize); + if(buffer && !error) { + size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw); + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + } + lodepng_free(buffer); + return error; +} + +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + State& state, + const std::vector& in) { + return decode(out, w, h, state, in.empty() ? 0 : &in[0], in.size()); +} + +#ifdef LODEPNG_COMPILE_DISK +unsigned decode(std::vector& out, unsigned& w, unsigned& h, const std::string& filename, + LodePNGColorType colortype, unsigned bitdepth) { + std::vector buffer; + /* safe output values in case error happens */ + w = h = 0; + unsigned error = load_file(buffer, filename); + if(error) return error; + return decode(out, w, h, buffer, colortype, bitdepth); +} +#endif /* LODEPNG_COMPILE_DECODER */ +#endif /* LODEPNG_COMPILE_DISK */ + +#ifdef LODEPNG_COMPILE_ENCODER +unsigned encode(std::vector& out, const unsigned char* in, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth) { + unsigned char* buffer; + size_t buffersize; + unsigned error = lodepng_encode_memory(&buffer, &buffersize, in, w, h, colortype, bitdepth); + if(buffer) { + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + lodepng_free(buffer); + } + return error; +} + +unsigned encode(std::vector& out, + const std::vector& in, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth) { + if(lodepng_get_raw_size_lct(w, h, colortype, bitdepth) > in.size()) return 84; + return encode(out, in.empty() ? 0 : &in[0], w, h, colortype, bitdepth); +} + +unsigned encode(std::vector& out, + const unsigned char* in, unsigned w, unsigned h, + State& state) { + unsigned char* buffer; + size_t buffersize; + unsigned error = lodepng_encode(&buffer, &buffersize, in, w, h, &state); + if(buffer) { + out.insert(out.end(), &buffer[0], &buffer[buffersize]); + lodepng_free(buffer); + } + return error; +} + +unsigned encode(std::vector& out, + const std::vector& in, unsigned w, unsigned h, + State& state) { + if(lodepng_get_raw_size(w, h, &state.info_raw) > in.size()) return 84; + return encode(out, in.empty() ? 0 : &in[0], w, h, state); +} + +#ifdef LODEPNG_COMPILE_DISK +unsigned encode(const std::string& filename, + const unsigned char* in, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth) { + std::vector buffer; + unsigned error = encode(buffer, in, w, h, colortype, bitdepth); + if(!error) error = save_file(buffer, filename); + return error; +} + +unsigned encode(const std::string& filename, + const std::vector& in, unsigned w, unsigned h, + LodePNGColorType colortype, unsigned bitdepth) { + if(lodepng_get_raw_size_lct(w, h, colortype, bitdepth) > in.size()) return 84; + return encode(filename, in.empty() ? 0 : &in[0], w, h, colortype, bitdepth); +} +#endif /* LODEPNG_COMPILE_DISK */ +#endif /* LODEPNG_COMPILE_ENCODER */ +#endif /* LODEPNG_COMPILE_PNG */ +} /* namespace lodepng */ +#endif /*LODEPNG_COMPILE_CPP*/ + +#endif /*LV_USE_PNG*/ diff --git a/L3_Middlewares/LVGL/src/libs/lodepng/lodepng.h b/L3_Middlewares/LVGL/src/extra/libs/png/lodepng.h similarity index 61% rename from L3_Middlewares/LVGL/src/libs/lodepng/lodepng.h rename to L3_Middlewares/LVGL/src/extra/libs/png/lodepng.h index 1ae3496..dbfed72 100644 --- a/L3_Middlewares/LVGL/src/libs/lodepng/lodepng.h +++ b/L3_Middlewares/LVGL/src/extra/libs/png/lodepng.h @@ -1,7 +1,7 @@ /* -LodePNG version 20230410 +LodePNG version 20201017 -Copyright (c) 2005-2023 Lode Vandevenne +Copyright (c) 2005-2020 Lode Vandevenne This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,115 +26,90 @@ freely, subject to the following restrictions: #ifndef LODEPNG_H #define LODEPNG_H -#ifdef __cplusplus -extern "C" { -#endif +#include /*for size_t*/ #include "../../../lvgl.h" -#if LV_USE_LODEPNG -#include LV_STDDEF_INCLUDE /*for size_t*/ -LV_ATTRIBUTE_EXTERN_DATA extern const char * LODEPNG_VERSION_STRING; +#if LV_USE_PNG +extern const char* LODEPNG_VERSION_STRING; /* The following #defines are used to create code sections. They can be disabled to disable code sections, which can give faster compile time and smaller binary. The "NO_COMPILE" defines are designed to be used to pass as defines to the compiler command to disable them without modifying this header, e.g. --DLODEPNG_NO_COMPILE_ZLIB for gcc or clang. +-DLODEPNG_NO_COMPILE_ZLIB for gcc. +In addition to those below, you can also define LODEPNG_NO_COMPILE_CRC to +allow implementing a custom lodepng_crc32. */ /*deflate & zlib. If disabled, you must specify alternative zlib functions in the custom_zlib field of the compress and decompress settings*/ #ifndef LODEPNG_NO_COMPILE_ZLIB - /*pass -DLODEPNG_NO_COMPILE_ZLIB to the compiler to disable this, or comment out LODEPNG_COMPILE_ZLIB below*/ - #define LODEPNG_COMPILE_ZLIB +#define LODEPNG_COMPILE_ZLIB #endif /*png encoder and png decoder*/ #ifndef LODEPNG_NO_COMPILE_PNG - /*pass -DLODEPNG_NO_COMPILE_PNG to the compiler to disable this, or comment out LODEPNG_COMPILE_PNG below*/ - #define LODEPNG_COMPILE_PNG +#define LODEPNG_COMPILE_PNG #endif /*deflate&zlib decoder and png decoder*/ #ifndef LODEPNG_NO_COMPILE_DECODER - /*pass -DLODEPNG_NO_COMPILE_DECODER to the compiler to disable this, or comment out LODEPNG_COMPILE_DECODER below*/ - #define LODEPNG_COMPILE_DECODER +#define LODEPNG_COMPILE_DECODER #endif /*deflate&zlib encoder and png encoder*/ #ifndef LODEPNG_NO_COMPILE_ENCODER - /*pass -DLODEPNG_NO_COMPILE_ENCODER to the compiler to disable this, or comment out LODEPNG_COMPILE_ENCODER below*/ - #define LODEPNG_COMPILE_ENCODER +#define LODEPNG_COMPILE_ENCODER #endif /*the optional built in harddisk file loading and saving functions*/ #ifndef LODEPNG_NO_COMPILE_DISK - /*pass -DLODEPNG_NO_COMPILE_DISK to the compiler to disable this, or comment out LODEPNG_COMPILE_DISK below*/ - #define LODEPNG_COMPILE_DISK +#define LODEPNG_COMPILE_DISK #endif /*support for chunks other than IHDR, IDAT, PLTE, tRNS, IEND: ancillary and unknown chunks*/ #ifndef LODEPNG_NO_COMPILE_ANCILLARY_CHUNKS - /*pass -DLODEPNG_NO_COMPILE_ANCILLARY_CHUNKS to the compiler to disable this, - or comment out LODEPNG_COMPILE_ANCILLARY_CHUNKS below*/ - #define LODEPNG_COMPILE_ANCILLARY_CHUNKS +#define LODEPNG_COMPILE_ANCILLARY_CHUNKS #endif /*ability to convert error numerical codes to English text string*/ #ifndef LODEPNG_NO_COMPILE_ERROR_TEXT - /*pass -DLODEPNG_NO_COMPILE_ERROR_TEXT to the compiler to disable this, - or comment out LODEPNG_COMPILE_ERROR_TEXT below*/ - #define LODEPNG_COMPILE_ERROR_TEXT +#define LODEPNG_COMPILE_ERROR_TEXT #endif /*Compile the default allocators (C's free, malloc and realloc). If you disable this, you can define the functions lodepng_free, lodepng_malloc and lodepng_realloc in your source files with custom allocators.*/ #ifndef LODEPNG_NO_COMPILE_ALLOCATORS - /*pass -DLODEPNG_NO_COMPILE_ALLOCATORS to the compiler to disable the built-in ones, - or comment out LODEPNG_COMPILE_ALLOCATORS below*/ - #define LODEPNG_COMPILE_ALLOCATORS -#endif - -/*Disable built-in CRC function, in that case a custom implementation of -lodepng_crc32 must be defined externally so that it can be linked in. -The default built-in CRC code comes with 8KB of lookup tables, so for memory constrained environment you may want it -disabled and provide a much smaller implementation externally as said above. You can find such an example implementation -in a comment in the lodepng.c(pp) file in the 'else' case of the searchable LODEPNG_COMPILE_CRC section.*/ -#ifndef LODEPNG_NO_COMPILE_CRC - /*pass -DLODEPNG_NO_COMPILE_CRC to the compiler to disable the built-in one, - or comment out LODEPNG_COMPILE_CRC below*/ - #define LODEPNG_COMPILE_CRC +#define LODEPNG_COMPILE_ALLOCATORS #endif /*compile the C++ version (you can disable the C++ wrapper here even when compiling for C++)*/ #ifdef __cplusplus - #ifndef LODEPNG_NO_COMPILE_CPP - /*pass -DLODEPNG_NO_COMPILE_CPP to the compiler to disable C++ (not needed if a C-only compiler), - or comment out LODEPNG_COMPILE_CPP below*/ - #define LODEPNG_COMPILE_CPP - #endif +#ifndef LODEPNG_NO_COMPILE_CPP +#define LODEPNG_COMPILE_CPP +#endif #endif #ifdef LODEPNG_COMPILE_CPP - #include - #include +#include +#include #endif /*LODEPNG_COMPILE_CPP*/ #ifdef LODEPNG_COMPILE_PNG /*The PNG color types (also used for raw image).*/ typedef enum LodePNGColorType { - LCT_GREY = 0, /*grayscale: 1,2,4,8,16 bit*/ - LCT_RGB = 2, /*RGB: 8,16 bit*/ - LCT_PALETTE = 3, /*palette: 1,2,4,8 bit*/ - LCT_GREY_ALPHA = 4, /*grayscale with alpha: 8,16 bit*/ - LCT_RGBA = 6, /*RGB with alpha: 8,16 bit*/ - /*LCT_MAX_OCTET_VALUE lets the compiler allow this enum to represent any invalid - byte value from 0 to 255 that could be present in an invalid PNG file header. Do - not use, compare with or set the name LCT_MAX_OCTET_VALUE, instead either use - the valid color type names above, or numeric values like 1 or 7 when checking for - particular disallowed color type byte values, or cast to integer to print it.*/ - LCT_MAX_OCTET_VALUE = 255 + LCT_GREY = 0, /*grayscale: 1,2,4,8,16 bit*/ + LCT_RGB = 2, /*RGB: 8,16 bit*/ + LCT_PALETTE = 3, /*palette: 1,2,4,8 bit*/ + LCT_GREY_ALPHA = 4, /*grayscale with alpha: 8,16 bit*/ + LCT_RGBA = 6, /*RGB with alpha: 8,16 bit*/ + /*LCT_MAX_OCTET_VALUE lets the compiler allow this enum to represent any invalid + byte value from 0 to 255 that could be present in an invalid PNG file header. Do + not use, compare with or set the name LCT_MAX_OCTET_VALUE, instead either use + the valid color type names above, or numeric values like 1 or 7 when checking for + particular disallowed color type byte values, or cast to integer to print it.*/ + LCT_MAX_OCTET_VALUE = 255 } LodePNGColorType; #ifdef LODEPNG_COMPILE_DECODER @@ -153,42 +128,34 @@ colortype: the desired color type for the raw output image. See explanation on P bitdepth: the desired bit depth for the raw output image. See explanation on PNG color types. Return value: LodePNG error code (0 means no error). */ -unsigned lodepng_decode_memory(unsigned char ** out, unsigned * w, unsigned * h, - const unsigned char * in, size_t insize, +unsigned lodepng_decode_memory(unsigned char** out, unsigned* w, unsigned* h, + const unsigned char* in, size_t insize, LodePNGColorType colortype, unsigned bitdepth); /*Same as lodepng_decode_memory, but always decodes to 32-bit RGBA raw image*/ -unsigned lodepng_decode32(unsigned char ** out, unsigned * w, unsigned * h, - const unsigned char * in, size_t insize); +unsigned lodepng_decode32(unsigned char** out, unsigned* w, unsigned* h, + const unsigned char* in, size_t insize); /*Same as lodepng_decode_memory, but always decodes to 24-bit RGB raw image*/ -unsigned lodepng_decode24(unsigned char ** out, unsigned * w, unsigned * h, - const unsigned char * in, size_t insize); +unsigned lodepng_decode24(unsigned char** out, unsigned* w, unsigned* h, + const unsigned char* in, size_t insize); #ifdef LODEPNG_COMPILE_DISK /* Load PNG from disk, from file with given name. Same as the other decode functions, but instead takes a filename as input. - -NOTE: Wide-character filenames are not supported, you can use an external method -to handle such files and decode in-memory.*/ -unsigned lodepng_decode_file(unsigned char ** out, unsigned * w, unsigned * h, - const char * filename, +*/ +unsigned lodepng_decode_file(unsigned char** out, unsigned* w, unsigned* h, + const char* filename, LodePNGColorType colortype, unsigned bitdepth); -/*Same as lodepng_decode_file, but always decodes to 32-bit RGBA raw image. - -NOTE: Wide-character filenames are not supported, you can use an external method -to handle such files and decode in-memory.*/ -unsigned lodepng_decode32_file(unsigned char ** out, unsigned * w, unsigned * h, - const char * filename); - -/*Same as lodepng_decode_file, but always decodes to 24-bit RGB raw image. +/*Same as lodepng_decode_file, but always decodes to 32-bit RGBA raw image.*/ +unsigned lodepng_decode32_file(unsigned char** out, unsigned* w, unsigned* h, + const char* filename); -NOTE: Wide-character filenames are not supported, you can use an external method -to handle such files and decode in-memory.*/ -unsigned lodepng_decode24_file(unsigned char ** out, unsigned * w, unsigned * h, - const char * filename); +/*Same as lodepng_decode_file, but always decodes to 24-bit RGB raw image.*/ +unsigned lodepng_decode24_file(unsigned char** out, unsigned* w, unsigned* h, + const char* filename); #endif /*LODEPNG_COMPILE_DISK*/ #endif /*LODEPNG_COMPILE_DECODER*/ @@ -210,70 +177,57 @@ colortype: the color type of the raw input image. See explanation on PNG color t bitdepth: the bit depth of the raw input image. See explanation on PNG color types. Return value: LodePNG error code (0 means no error). */ -unsigned lodepng_encode_memory(unsigned char ** out, size_t * outsize, - const unsigned char * image, unsigned w, unsigned h, +unsigned lodepng_encode_memory(unsigned char** out, size_t* outsize, + const unsigned char* image, unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth); /*Same as lodepng_encode_memory, but always encodes from 32-bit RGBA raw image.*/ -unsigned lodepng_encode32(unsigned char ** out, size_t * outsize, - const unsigned char * image, unsigned w, unsigned h); +unsigned lodepng_encode32(unsigned char** out, size_t* outsize, + const unsigned char* image, unsigned w, unsigned h); /*Same as lodepng_encode_memory, but always encodes from 24-bit RGB raw image.*/ -unsigned lodepng_encode24(unsigned char ** out, size_t * outsize, - const unsigned char * image, unsigned w, unsigned h); +unsigned lodepng_encode24(unsigned char** out, size_t* outsize, + const unsigned char* image, unsigned w, unsigned h); #ifdef LODEPNG_COMPILE_DISK /* Converts raw pixel data into a PNG file on disk. Same as the other encode functions, but instead takes a filename as output. - NOTE: This overwrites existing files without warning! - -NOTE: Wide-character filenames are not supported, you can use an external method -to handle such files and encode in-memory.*/ -unsigned lodepng_encode_file(const char * filename, - const unsigned char * image, unsigned w, unsigned h, +*/ +unsigned lodepng_encode_file(const char* filename, + const unsigned char* image, unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth); -/*Same as lodepng_encode_file, but always encodes from 32-bit RGBA raw image. - -NOTE: Wide-character filenames are not supported, you can use an external method -to handle such files and encode in-memory.*/ -unsigned lodepng_encode32_file(const char * filename, - const unsigned char * image, unsigned w, unsigned h); +/*Same as lodepng_encode_file, but always encodes from 32-bit RGBA raw image.*/ +unsigned lodepng_encode32_file(const char* filename, + const unsigned char* image, unsigned w, unsigned h); -/*Same as lodepng_encode_file, but always encodes from 24-bit RGB raw image. - -NOTE: Wide-character filenames are not supported, you can use an external method -to handle such files and encode in-memory.*/ -unsigned lodepng_encode24_file(const char * filename, - const unsigned char * image, unsigned w, unsigned h); +/*Same as lodepng_encode_file, but always encodes from 24-bit RGB raw image.*/ +unsigned lodepng_encode24_file(const char* filename, + const unsigned char* image, unsigned w, unsigned h); #endif /*LODEPNG_COMPILE_DISK*/ #endif /*LODEPNG_COMPILE_ENCODER*/ #ifdef LODEPNG_COMPILE_CPP -namespace lodepng -{ +namespace lodepng { #ifdef LODEPNG_COMPILE_DECODER /*Same as lodepng_decode_memory, but decodes to an std::vector. The colortype is the format to output the pixels to. Default is RGBA 8-bit per channel.*/ -unsigned decode(std::vector & out, unsigned & w, unsigned & h, - const unsigned char * in, size_t insize, +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + const unsigned char* in, size_t insize, LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); -unsigned decode(std::vector & out, unsigned & w, unsigned & h, - const std::vector & in, +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + const std::vector& in, LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); #ifdef LODEPNG_COMPILE_DISK /* Converts PNG file from disk to raw pixel data in memory. Same as the other decode functions, but instead takes a filename as input. - -NOTE: Wide-character filenames are not supported, you can use an external method -to handle such files and decode in-memory. */ -unsigned decode(std::vector & out, unsigned & w, unsigned & h, - const std::string & filename, +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + const std::string& filename, LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); #endif /* LODEPNG_COMPILE_DISK */ #endif /* LODEPNG_COMPILE_DECODER */ @@ -281,27 +235,23 @@ unsigned decode(std::vector & out, unsigned & w, unsigned & h, #ifdef LODEPNG_COMPILE_ENCODER /*Same as lodepng_encode_memory, but encodes to an std::vector. colortype is that of the raw input data. The output PNG color type will be auto chosen.*/ -unsigned encode(std::vector & out, - const unsigned char * in, unsigned w, unsigned h, +unsigned encode(std::vector& out, + const unsigned char* in, unsigned w, unsigned h, LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); -unsigned encode(std::vector & out, - const std::vector & in, unsigned w, unsigned h, +unsigned encode(std::vector& out, + const std::vector& in, unsigned w, unsigned h, LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); #ifdef LODEPNG_COMPILE_DISK /* Converts 32-bit RGBA raw pixel data into a PNG file on disk. Same as the other encode functions, but instead takes a filename as output. - NOTE: This overwrites existing files without warning! - -NOTE: Wide-character filenames are not supported, you can use an external method -to handle such files and decode in-memory. */ -unsigned encode(const std::string & filename, - const unsigned char * in, unsigned w, unsigned h, +unsigned encode(const std::string& filename, + const unsigned char* in, unsigned w, unsigned h, LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); -unsigned encode(const std::string & filename, - const std::vector & in, unsigned w, unsigned h, +unsigned encode(const std::string& filename, + const std::vector& in, unsigned w, unsigned h, LodePNGColorType colortype = LCT_RGBA, unsigned bitdepth = 8); #endif /* LODEPNG_COMPILE_DISK */ #endif /* LODEPNG_COMPILE_ENCODER */ @@ -310,42 +260,42 @@ unsigned encode(const std::string & filename, #endif /*LODEPNG_COMPILE_PNG*/ #ifdef LODEPNG_COMPILE_ERROR_TEXT - /*Returns an English description of the numerical error code.*/ - const char * lodepng_error_text(unsigned code); +/*Returns an English description of the numerical error code.*/ +const char* lodepng_error_text(unsigned code); #endif /*LODEPNG_COMPILE_ERROR_TEXT*/ #ifdef LODEPNG_COMPILE_DECODER /*Settings for zlib decompression*/ typedef struct LodePNGDecompressSettings LodePNGDecompressSettings; struct LodePNGDecompressSettings { - /* Check LodePNGDecoderSettings for more ignorable errors such as ignore_crc */ - unsigned ignore_adler32; /*if 1, continue and don't give an error message if the Adler32 checksum is corrupted*/ - unsigned ignore_nlen; /*ignore complement of len checksum in uncompressed blocks*/ - - /*Maximum decompressed size, beyond this the decoder may (and is encouraged to) stop decoding, - return an error, output a data size > max_output_size and all the data up to that point. This is - neither a hard limit nor a guarantee, but can prevent excessive memory usage. This setting is - ignored by the PNG decoder, but is used by the deflate/zlib decoder and can be used by custom ones. - Set to 0 to impose no limit (the default).*/ - size_t max_output_size; - - /*use custom zlib decoder instead of built in one (default: null). - Should return 0 if success, any non-0 if error (numeric value not exposed).*/ - unsigned(*custom_zlib)(unsigned char **, size_t *, - const unsigned char *, size_t, - const LodePNGDecompressSettings *); - /*use custom deflate decoder instead of built in one (default: null) - if custom_zlib is not null, custom_inflate is ignored (the zlib format uses deflate). - Should return 0 if success, any non-0 if error (numeric value not exposed).*/ - unsigned(*custom_inflate)(unsigned char **, size_t *, - const unsigned char *, size_t, - const LodePNGDecompressSettings *); - - const void * custom_context; /*optional custom settings for custom functions*/ + /* Check LodePNGDecoderSettings for more ignorable errors such as ignore_crc */ + unsigned ignore_adler32; /*if 1, continue and don't give an error message if the Adler32 checksum is corrupted*/ + unsigned ignore_nlen; /*ignore complement of len checksum in uncompressed blocks*/ + + /*Maximum decompressed size, beyond this the decoder may (and is encouraged to) stop decoding, + return an error, output a data size > max_output_size and all the data up to that point. This is + not hard limit nor a guarantee, but can prevent excessive memory usage. This setting is + ignored by the PNG decoder, but is used by the deflate/zlib decoder and can be used by custom ones. + Set to 0 to impose no limit (the default).*/ + size_t max_output_size; + + /*use custom zlib decoder instead of built in one (default: null). + Should return 0 if success, any non-0 if error (numeric value not exposed).*/ + unsigned (*custom_zlib)(unsigned char**, size_t*, + const unsigned char*, size_t, + const LodePNGDecompressSettings*); + /*use custom deflate decoder instead of built in one (default: null) + if custom_zlib is not null, custom_inflate is ignored (the zlib format uses deflate). + Should return 0 if success, any non-0 if error (numeric value not exposed).*/ + unsigned (*custom_inflate)(unsigned char**, size_t*, + const unsigned char*, size_t, + const LodePNGDecompressSettings*); + + const void* custom_context; /*optional custom settings for custom functions*/ }; -LV_ATTRIBUTE_EXTERN_DATA extern const LodePNGDecompressSettings lodepng_default_decompress_settings; -void lodepng_decompress_settings_init(LodePNGDecompressSettings * settings); +extern const LodePNGDecompressSettings lodepng_default_decompress_settings; +void lodepng_decompress_settings_init(LodePNGDecompressSettings* settings); #endif /*LODEPNG_COMPILE_DECODER*/ #ifdef LODEPNG_COMPILE_ENCODER @@ -354,31 +304,31 @@ Settings for zlib compression. Tweaking these settings tweaks the balance between speed and compression ratio. */ typedef struct LodePNGCompressSettings LodePNGCompressSettings; -struct LodePNGCompressSettings { /*deflate = compress*/ - /*LZ77 related settings*/ - unsigned btype; /*the block type for LZ (0, 1, 2 or 3, see zlib standard). Should be 2 for proper compression.*/ - unsigned use_lz77; /*whether or not to use LZ77. Should be 1 for proper compression.*/ - unsigned windowsize; /*must be a power of two <= 32768. higher compresses more but is slower. Default value: 2048.*/ - unsigned minmatch; /*minimum lz77 length. 3 is normally best, 6 can be better for some PNGs. Default: 0*/ - unsigned nicematch; /*stop searching if >= this length found. Set to 258 for best compression. Default: 128*/ - unsigned lazymatching; /*use lazy matching: better compression but a bit slower. Default: true*/ - - /*use custom zlib encoder instead of built in one (default: null)*/ - unsigned(*custom_zlib)(unsigned char **, size_t *, - const unsigned char *, size_t, - const LodePNGCompressSettings *); - /*use custom deflate encoder instead of built in one (default: null) - if custom_zlib is used, custom_deflate is ignored since only the built in - zlib function will call custom_deflate*/ - unsigned(*custom_deflate)(unsigned char **, size_t *, - const unsigned char *, size_t, - const LodePNGCompressSettings *); - - const void * custom_context; /*optional custom settings for custom functions*/ +struct LodePNGCompressSettings /*deflate = compress*/ { + /*LZ77 related settings*/ + unsigned btype; /*the block type for LZ (0, 1, 2 or 3, see zlib standard). Should be 2 for proper compression.*/ + unsigned use_lz77; /*whether or not to use LZ77. Should be 1 for proper compression.*/ + unsigned windowsize; /*must be a power of two <= 32768. higher compresses more but is slower. Default value: 2048.*/ + unsigned minmatch; /*minimum lz77 length. 3 is normally best, 6 can be better for some PNGs. Default: 0*/ + unsigned nicematch; /*stop searching if >= this length found. Set to 258 for best compression. Default: 128*/ + unsigned lazymatching; /*use lazy matching: better compression but a bit slower. Default: true*/ + + /*use custom zlib encoder instead of built in one (default: null)*/ + unsigned (*custom_zlib)(unsigned char**, size_t*, + const unsigned char*, size_t, + const LodePNGCompressSettings*); + /*use custom deflate encoder instead of built in one (default: null) + if custom_zlib is used, custom_deflate is ignored since only the built in + zlib function will call custom_deflate*/ + unsigned (*custom_deflate)(unsigned char**, size_t*, + const unsigned char*, size_t, + const LodePNGCompressSettings*); + + const void* custom_context; /*optional custom settings for custom functions*/ }; -LV_ATTRIBUTE_EXTERN_DATA extern const LodePNGCompressSettings lodepng_default_compress_settings; -void lodepng_compress_settings_init(LodePNGCompressSettings * settings); +extern const LodePNGCompressSettings lodepng_default_compress_settings; +void lodepng_compress_settings_init(LodePNGCompressSettings* settings); #endif /*LODEPNG_COMPILE_ENCODER*/ #ifdef LODEPNG_COMPILE_PNG @@ -388,74 +338,72 @@ bits to RGBA colors. This information is the same as used in the PNG file format, and is used both for PNG and raw image data in LodePNG. */ typedef struct LodePNGColorMode { - /*header (IHDR)*/ - LodePNGColorType colortype; /*color type, see PNG standard or documentation further in this header file*/ - unsigned bitdepth; /*bits per sample, see PNG standard or documentation further in this header file*/ + /*header (IHDR)*/ + LodePNGColorType colortype; /*color type, see PNG standard or documentation further in this header file*/ + unsigned bitdepth; /*bits per sample, see PNG standard or documentation further in this header file*/ - /* - palette (PLTE and tRNS) + /* + palette (PLTE and tRNS) - Dynamically allocated with the colors of the palette, including alpha. - This field may not be allocated directly, use lodepng_color_mode_init first, - then lodepng_palette_add per color to correctly initialize it (to ensure size - of exactly 1024 bytes). + Dynamically allocated with the colors of the palette, including alpha. + This field may not be allocated directly, use lodepng_color_mode_init first, + then lodepng_palette_add per color to correctly initialize it (to ensure size + of exactly 1024 bytes). - The alpha channels must be set as well, set them to 255 for opaque images. + The alpha channels must be set as well, set them to 255 for opaque images. - When decoding, with the default settings you can ignore this palette, since - LodePNG already fills the palette colors in the pixels of the raw RGBA output, - but when decoding to the original PNG color mode it is needed to reconstruct - the colors. + When decoding, by default you can ignore this palette, since LodePNG already + fills the palette colors in the pixels of the raw RGBA output. - The palette is only supported for color type 3. - */ - unsigned char * palette; /*palette in RGBARGBA... order. Must be either 0, or when allocated must have 1024 bytes*/ - size_t palettesize; /*palette size in number of colors (amount of used bytes is 4 * palettesize)*/ + The palette is only supported for color type 3. + */ + unsigned char* palette; /*palette in RGBARGBA... order. Must be either 0, or when allocated must have 1024 bytes*/ + size_t palettesize; /*palette size in number of colors (amount of used bytes is 4 * palettesize)*/ - /* - transparent color key (tRNS) + /* + transparent color key (tRNS) - This color uses the same bit depth as the bitdepth value in this struct, which can be 1-bit to 16-bit. - For grayscale PNGs, r, g and b will all 3 be set to the same. + This color uses the same bit depth as the bitdepth value in this struct, which can be 1-bit to 16-bit. + For grayscale PNGs, r, g and b will all 3 be set to the same. - When decoding, by default you can ignore this information, since LodePNG sets - pixels with this key to transparent already in the raw RGBA output. + When decoding, by default you can ignore this information, since LodePNG sets + pixels with this key to transparent already in the raw RGBA output. - The color key is only supported for color types 0 and 2. - */ - unsigned key_defined; /*is a transparent color key given? 0 = false, 1 = true*/ - unsigned key_r; /*red/grayscale component of color key*/ - unsigned key_g; /*green component of color key*/ - unsigned key_b; /*blue component of color key*/ + The color key is only supported for color types 0 and 2. + */ + unsigned key_defined; /*is a transparent color key given? 0 = false, 1 = true*/ + unsigned key_r; /*red/grayscale component of color key*/ + unsigned key_g; /*green component of color key*/ + unsigned key_b; /*blue component of color key*/ } LodePNGColorMode; /*init, cleanup and copy functions to use with this struct*/ -void lodepng_color_mode_init(LodePNGColorMode * info); -void lodepng_color_mode_cleanup(LodePNGColorMode * info); +void lodepng_color_mode_init(LodePNGColorMode* info); +void lodepng_color_mode_cleanup(LodePNGColorMode* info); /*return value is error code (0 means no error)*/ -unsigned lodepng_color_mode_copy(LodePNGColorMode * dest, const LodePNGColorMode * source); +unsigned lodepng_color_mode_copy(LodePNGColorMode* dest, const LodePNGColorMode* source); /* Makes a temporary LodePNGColorMode that does not need cleanup (no palette) */ LodePNGColorMode lodepng_color_mode_make(LodePNGColorType colortype, unsigned bitdepth); -void lodepng_palette_clear(LodePNGColorMode * info); +void lodepng_palette_clear(LodePNGColorMode* info); /*add 1 color to the palette*/ -unsigned lodepng_palette_add(LodePNGColorMode * info, +unsigned lodepng_palette_add(LodePNGColorMode* info, unsigned char r, unsigned char g, unsigned char b, unsigned char a); /*get the total amount of bits per pixel, based on colortype and bitdepth in the struct*/ -unsigned lodepng_get_bpp(const LodePNGColorMode * info); +unsigned lodepng_get_bpp(const LodePNGColorMode* info); /*get the amount of color channels used, based on colortype in the struct. If a palette is used, it counts as 1 channel.*/ -unsigned lodepng_get_channels(const LodePNGColorMode * info); +unsigned lodepng_get_channels(const LodePNGColorMode* info); /*is it a grayscale type? (only colortype 0 or 4)*/ -unsigned lodepng_is_greyscale_type(const LodePNGColorMode * info); +unsigned lodepng_is_greyscale_type(const LodePNGColorMode* info); /*has it got an alpha channel? (only colortype 2 or 6)*/ -unsigned lodepng_is_alpha_type(const LodePNGColorMode * info); +unsigned lodepng_is_alpha_type(const LodePNGColorMode* info); /*has it got a palette? (only colortype 3)*/ -unsigned lodepng_is_palette_type(const LodePNGColorMode * info); +unsigned lodepng_is_palette_type(const LodePNGColorMode* info); /*only returns true if there is a palette and there is a value in the palette with alpha < 255. Loops through the palette to check this.*/ -unsigned lodepng_has_palette_alpha(const LodePNGColorMode * info); +unsigned lodepng_has_palette_alpha(const LodePNGColorMode* info); /* Check if the given color info indicates the possibility of having non-opaque pixels in the PNG image. Returns true if the image can have translucent or invisible pixels (it still be opaque if it doesn't use such pixels). @@ -463,254 +411,213 @@ Returns false if the image can only have opaque pixels. In detail, it returns true only if it's a color type with alpha, or has a palette with non-opaque values, or if "key_defined" is true. */ -unsigned lodepng_can_have_alpha(const LodePNGColorMode * info); +unsigned lodepng_can_have_alpha(const LodePNGColorMode* info); /*Returns the byte size of a raw image buffer with given width, height and color mode*/ -size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode * color); +size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode* color); #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS /*The information of a Time chunk in PNG.*/ typedef struct LodePNGTime { - unsigned year; /*2 bytes used (0-65535)*/ - unsigned month; /*1-12*/ - unsigned day; /*1-31*/ - unsigned hour; /*0-23*/ - unsigned minute; /*0-59*/ - unsigned second; /*0-60 (to allow for leap seconds)*/ + unsigned year; /*2 bytes used (0-65535)*/ + unsigned month; /*1-12*/ + unsigned day; /*1-31*/ + unsigned hour; /*0-23*/ + unsigned minute; /*0-59*/ + unsigned second; /*0-60 (to allow for leap seconds)*/ } LodePNGTime; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ /*Information about the PNG image, except pixels, width and height.*/ typedef struct LodePNGInfo { - /*header (IHDR), palette (PLTE) and transparency (tRNS) chunks*/ - unsigned compression_method;/*compression method of the original file. Always 0.*/ - unsigned filter_method; /*filter method of the original file*/ - unsigned interlace_method; /*interlace method of the original file: 0=none, 1=Adam7*/ - LodePNGColorMode color; /*color type and bits, palette and transparency of the PNG file*/ + /*header (IHDR), palette (PLTE) and transparency (tRNS) chunks*/ + unsigned compression_method;/*compression method of the original file. Always 0.*/ + unsigned filter_method; /*filter method of the original file*/ + unsigned interlace_method; /*interlace method of the original file: 0=none, 1=Adam7*/ + LodePNGColorMode color; /*color type and bits, palette and transparency of the PNG file*/ #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /* - Suggested background color chunk (bKGD) - - This uses the same color mode and bit depth as the PNG (except no alpha channel), - with values truncated to the bit depth in the unsigned integer. - - For grayscale and palette PNGs, the value is stored in background_r. The values - in background_g and background_b are then unused. The decoder will set them - equal to background_r, the encoder ignores them in this case. - - When decoding, you may get these in a different color mode than the one you requested - for the raw pixels: the colortype and bitdepth defined by info_png.color, that is the - ones defined in the header of the PNG image, are used. - - When encoding with auto_convert, you must use the color model defined in info_png.color for - these values. The encoder normally ignores info_png.color when auto_convert is on, but will - use it to interpret these values (and convert copies of them to its chosen color model). - - When encoding, avoid setting this to an expensive color, such as a non-gray value - when the image is gray, or the compression will be worse since it will be forced to - write the PNG with a more expensive color mode (when auto_convert is on). - - The decoder does not use this background color to edit the color of pixels. This is a - completely optional metadata feature. - */ - unsigned background_defined; /*is a suggested background color given?*/ - unsigned background_r; /*red/gray/palette component of suggested background color*/ - unsigned background_g; /*green component of suggested background color*/ - unsigned background_b; /*blue component of suggested background color*/ - - /* - Non-international text chunks (tEXt and zTXt) - - The char** arrays each contain num strings. The actual messages are in - text_strings, while text_keys are keywords that give a short description what - the actual text represents, e.g. Title, Author, Description, or anything else. - - All the string fields below including strings, keys, names and language tags are null terminated. - The PNG specification uses null characters for the keys, names and tags, and forbids null - characters to appear in the main text which is why we can use null termination everywhere here. - - A keyword is minimum 1 character and maximum 79 characters long (plus the - additional null terminator). It's discouraged to use a single line length - longer than 79 characters for texts. - - Don't allocate these text buffers yourself. Use the init/cleanup functions - correctly and use lodepng_add_text and lodepng_clear_text. - - Standard text chunk keywords and strings are encoded using Latin-1. - */ - size_t text_num; /*the amount of texts in these char** buffers (there may be more texts in itext)*/ - char ** text_keys; /*the keyword of a text chunk (e.g. "Comment")*/ - char ** text_strings; /*the actual text*/ - - /* - International text chunks (iTXt) - Similar to the non-international text chunks, but with additional strings - "langtags" and "transkeys", and the following text encodings are used: - keys: Latin-1, langtags: ASCII, transkeys and strings: UTF-8. - keys must be 1-79 characters (plus the additional null terminator), the other - strings are any length. - */ - size_t itext_num; /*the amount of international texts in this PNG*/ - char ** itext_keys; /*the English keyword of the text chunk (e.g. "Comment")*/ - char ** itext_langtags; /*language tag for this text's language, ISO/IEC 646 string, e.g. ISO 639 language tag*/ - char ** itext_transkeys; /*keyword translated to the international language - UTF-8 string*/ - char ** itext_strings; /*the actual international text - UTF-8 string*/ - - /*time chunk (tIME)*/ - unsigned time_defined; /*set to 1 to make the encoder generate a tIME chunk*/ - LodePNGTime time; - - /*phys chunk (pHYs)*/ - unsigned phys_defined; /*if 0, there is no pHYs chunk and the values below are undefined, if 1 else there is one*/ - unsigned phys_x; /*pixels per unit in x direction*/ - unsigned phys_y; /*pixels per unit in y direction*/ - unsigned phys_unit; /*may be 0 (unknown unit) or 1 (metre)*/ - - /* - Color profile related chunks: gAMA, cHRM, sRGB, iCPP, sBIT - - LodePNG does not apply any color conversions on pixels in the encoder or decoder and does not interpret these color - profile values. It merely passes on the information. If you wish to use color profiles and convert colors, please - use these values with a color management library. - - See the PNG, ICC and sRGB specifications for more information about the meaning of these values. - */ - - /* gAMA chunk: optional, overridden by sRGB or iCCP if those are present. */ - unsigned gama_defined; /* Whether a gAMA chunk is present (0 = not present, 1 = present). */ - unsigned gama_gamma; /* Gamma exponent times 100000 */ - - /* cHRM chunk: optional, overridden by sRGB or iCCP if those are present. */ - unsigned chrm_defined; /* Whether a cHRM chunk is present (0 = not present, 1 = present). */ - unsigned chrm_white_x; /* White Point x times 100000 */ - unsigned chrm_white_y; /* White Point y times 100000 */ - unsigned chrm_red_x; /* Red x times 100000 */ - unsigned chrm_red_y; /* Red y times 100000 */ - unsigned chrm_green_x; /* Green x times 100000 */ - unsigned chrm_green_y; /* Green y times 100000 */ - unsigned chrm_blue_x; /* Blue x times 100000 */ - unsigned chrm_blue_y; /* Blue y times 100000 */ - - /* - sRGB chunk: optional. May not appear at the same time as iCCP. - If gAMA is also present gAMA must contain value 45455. - If cHRM is also present cHRM must contain respectively 31270,32900,64000,33000,30000,60000,15000,6000. - */ - unsigned srgb_defined; /* Whether an sRGB chunk is present (0 = not present, 1 = present). */ - unsigned srgb_intent; /* Rendering intent: 0=perceptual, 1=rel. colorimetric, 2=saturation, 3=abs. colorimetric */ - - /* - iCCP chunk: optional. May not appear at the same time as sRGB. - - LodePNG does not parse or use the ICC profile (except its color space header field for an edge case), a - separate library to handle the ICC data (not included in LodePNG) format is needed to use it for color - management and conversions. - - For encoding, if iCCP is present, gAMA and cHRM are recommended to be added as well with values that match the ICC - profile as closely as possible, if you wish to do this you should provide the correct values for gAMA and cHRM and - enable their '_defined' flags since LodePNG will not automatically compute them from the ICC profile. - - For encoding, the ICC profile is required by the PNG specification to be an "RGB" profile for non-gray - PNG color types and a "GRAY" profile for gray PNG color types. If you disable auto_convert, you must ensure - the ICC profile type matches your requested color type, else the encoder gives an error. If auto_convert is - enabled (the default), and the ICC profile is not a good match for the pixel data, this will result in an encoder - error if the pixel data has non-gray pixels for a GRAY profile, or a silent less-optimal compression of the pixel - data if the pixels could be encoded as grayscale but the ICC profile is RGB. - - To avoid this do not set an ICC profile in the image unless there is a good reason for it, and when doing so - make sure you compute it carefully to avoid the above problems. - */ - unsigned iccp_defined; /* Whether an iCCP chunk is present (0 = not present, 1 = present). */ - char * iccp_name; /* Null terminated string with profile name, 1-79 bytes */ - /* - The ICC profile in iccp_profile_size bytes. - Don't allocate this buffer yourself. Use the init/cleanup functions - correctly and use lodepng_set_icc and lodepng_clear_icc. - */ - unsigned char * iccp_profile; - unsigned iccp_profile_size; /* The size of iccp_profile in bytes */ - - /* - sBIT chunk: significant bits. Optional metadata, only set this if needed. - - If defined, these values give the bit depth of the original data. Since PNG only stores 1, 2, 4, 8 or 16-bit - per channel data, the significant bits value can be used to indicate the original encoded data has another - sample depth, such as 10 or 12. - - Encoders using this value, when storing the pixel data, should use the most significant bits - of the data to store the original bits, and use a good sample depth scaling method such as - "left bit replication" to fill in the least significant bits, rather than fill zeroes. - - Decoders using this value, if able to work with data that's e.g. 10-bit or 12-bit, should right - shift the data to go back to the original bit depth, but decoders are also allowed to ignore - sbit and work e.g. with the 8-bit or 16-bit data from the PNG directly, since thanks - to the encoder contract, the values encoded in PNG are in valid range for the PNG bit depth. - - For grayscale images, sbit_g and sbit_b are not used, and for images that don't use color - type RGBA or grayscale+alpha, sbit_a is not used (it's not used even for palette images with - translucent palette values, or images with color key). The values that are used must be - greater than zero and smaller than or equal to the PNG bit depth. - - The color type from the header in the PNG image defines these used and unused fields: if - decoding with a color mode conversion, such as always decoding to RGBA, this metadata still - only uses the color type of the original PNG, and may e.g. lack the alpha channel info - if the PNG was RGB. When encoding with auto_convert (as well as without), also always the - color model defined in info_png.color determines this. - - NOTE: enabling sbit can hurt compression, because the encoder can then not always use - auto_convert to choose a more optimal color mode for the data, because the PNG format has - strict requirements for the allowed sbit values in combination with color modes. - For example, setting these fields to 10-bit will force the encoder to keep using a 16-bit per channel - color mode, even if the pixel data would in fact fit in a more efficient 8-bit mode. - */ - unsigned sbit_defined; /*is significant bits given? if not, the values below are unused*/ - unsigned sbit_r; /*red or gray component of significant bits*/ - unsigned sbit_g; /*green component of significant bits*/ - unsigned sbit_b; /*blue component of significant bits*/ - unsigned sbit_a; /*alpha component of significant bits*/ - - /* End of color profile related chunks */ - - - /* - unknown chunks: chunks not known by LodePNG, passed on byte for byte. - - There are 3 buffers, one for each position in the PNG where unknown chunks can appear. - Each buffer contains all unknown chunks for that position consecutively. - The 3 positions are: - 0: between IHDR and PLTE, 1: between PLTE and IDAT, 2: between IDAT and IEND. - - For encoding, do not store critical chunks or known chunks that are enabled with a "_defined" flag - above in here, since the encoder will blindly follow this and could then encode an invalid PNG file - (such as one with two IHDR chunks or the disallowed combination of sRGB with iCCP). But do use - this if you wish to store an ancillary chunk that is not supported by LodePNG (such as sPLT or hIST), - or any non-standard PNG chunk. - - Do not allocate or traverse this data yourself. Use the chunk traversing functions declared - later, such as lodepng_chunk_next and lodepng_chunk_append, to read/write this struct. - */ - unsigned char * unknown_chunks_data[3]; - size_t unknown_chunks_size[3]; /*size in bytes of the unknown chunks, given for protection*/ + /* + Suggested background color chunk (bKGD) + + This uses the same color mode and bit depth as the PNG (except no alpha channel), + with values truncated to the bit depth in the unsigned integer. + + For grayscale and palette PNGs, the value is stored in background_r. The values + in background_g and background_b are then unused. + + So when decoding, you may get these in a different color mode than the one you requested + for the raw pixels. + + When encoding with auto_convert, you must use the color model defined in info_png.color for + these values. The encoder normally ignores info_png.color when auto_convert is on, but will + use it to interpret these values (and convert copies of them to its chosen color model). + + When encoding, avoid setting this to an expensive color, such as a non-gray value + when the image is gray, or the compression will be worse since it will be forced to + write the PNG with a more expensive color mode (when auto_convert is on). + + The decoder does not use this background color to edit the color of pixels. This is a + completely optional metadata feature. + */ + unsigned background_defined; /*is a suggested background color given?*/ + unsigned background_r; /*red/gray/palette component of suggested background color*/ + unsigned background_g; /*green component of suggested background color*/ + unsigned background_b; /*blue component of suggested background color*/ + + /* + Non-international text chunks (tEXt and zTXt) + + The char** arrays each contain num strings. The actual messages are in + text_strings, while text_keys are keywords that give a short description what + the actual text represents, e.g. Title, Author, Description, or anything else. + + All the string fields below including strings, keys, names and language tags are null terminated. + The PNG specification uses null characters for the keys, names and tags, and forbids null + characters to appear in the main text which is why we can use null termination everywhere here. + + A keyword is minimum 1 character and maximum 79 characters long (plus the + additional null terminator). It's discouraged to use a single line length + longer than 79 characters for texts. + + Don't allocate these text buffers yourself. Use the init/cleanup functions + correctly and use lodepng_add_text and lodepng_clear_text. + + Standard text chunk keywords and strings are encoded using Latin-1. + */ + size_t text_num; /*the amount of texts in these char** buffers (there may be more texts in itext)*/ + char** text_keys; /*the keyword of a text chunk (e.g. "Comment")*/ + char** text_strings; /*the actual text*/ + + /* + International text chunks (iTXt) + Similar to the non-international text chunks, but with additional strings + "langtags" and "transkeys", and the following text encodings are used: + keys: Latin-1, langtags: ASCII, transkeys and strings: UTF-8. + keys must be 1-79 characters (plus the additional null terminator), the other + strings are any length. + */ + size_t itext_num; /*the amount of international texts in this PNG*/ + char** itext_keys; /*the English keyword of the text chunk (e.g. "Comment")*/ + char** itext_langtags; /*language tag for this text's language, ISO/IEC 646 string, e.g. ISO 639 language tag*/ + char** itext_transkeys; /*keyword translated to the international language - UTF-8 string*/ + char** itext_strings; /*the actual international text - UTF-8 string*/ + + /*time chunk (tIME)*/ + unsigned time_defined; /*set to 1 to make the encoder generate a tIME chunk*/ + LodePNGTime time; + + /*phys chunk (pHYs)*/ + unsigned phys_defined; /*if 0, there is no pHYs chunk and the values below are undefined, if 1 else there is one*/ + unsigned phys_x; /*pixels per unit in x direction*/ + unsigned phys_y; /*pixels per unit in y direction*/ + unsigned phys_unit; /*may be 0 (unknown unit) or 1 (metre)*/ + + /* + Color profile related chunks: gAMA, cHRM, sRGB, iCPP + + LodePNG does not apply any color conversions on pixels in the encoder or decoder and does not interpret these color + profile values. It merely passes on the information. If you wish to use color profiles and convert colors, please + use these values with a color management library. + + See the PNG, ICC and sRGB specifications for more information about the meaning of these values. + */ + + /* gAMA chunk: optional, overridden by sRGB or iCCP if those are present. */ + unsigned gama_defined; /* Whether a gAMA chunk is present (0 = not present, 1 = present). */ + unsigned gama_gamma; /* Gamma exponent times 100000 */ + + /* cHRM chunk: optional, overridden by sRGB or iCCP if those are present. */ + unsigned chrm_defined; /* Whether a cHRM chunk is present (0 = not present, 1 = present). */ + unsigned chrm_white_x; /* White Point x times 100000 */ + unsigned chrm_white_y; /* White Point y times 100000 */ + unsigned chrm_red_x; /* Red x times 100000 */ + unsigned chrm_red_y; /* Red y times 100000 */ + unsigned chrm_green_x; /* Green x times 100000 */ + unsigned chrm_green_y; /* Green y times 100000 */ + unsigned chrm_blue_x; /* Blue x times 100000 */ + unsigned chrm_blue_y; /* Blue y times 100000 */ + + /* + sRGB chunk: optional. May not appear at the same time as iCCP. + If gAMA is also present gAMA must contain value 45455. + If cHRM is also present cHRM must contain respectively 31270,32900,64000,33000,30000,60000,15000,6000. + */ + unsigned srgb_defined; /* Whether an sRGB chunk is present (0 = not present, 1 = present). */ + unsigned srgb_intent; /* Rendering intent: 0=perceptual, 1=rel. colorimetric, 2=saturation, 3=abs. colorimetric */ + + /* + iCCP chunk: optional. May not appear at the same time as sRGB. + + LodePNG does not parse or use the ICC profile (except its color space header field for an edge case), a + separate library to handle the ICC data (not included in LodePNG) format is needed to use it for color + management and conversions. + + For encoding, if iCCP is present, gAMA and cHRM are recommended to be added as well with values that match the ICC + profile as closely as possible, if you wish to do this you should provide the correct values for gAMA and cHRM and + enable their '_defined' flags since LodePNG will not automatically compute them from the ICC profile. + + For encoding, the ICC profile is required by the PNG specification to be an "RGB" profile for non-gray + PNG color types and a "GRAY" profile for gray PNG color types. If you disable auto_convert, you must ensure + the ICC profile type matches your requested color type, else the encoder gives an error. If auto_convert is + enabled (the default), and the ICC profile is not a good match for the pixel data, this will result in an encoder + error if the pixel data has non-gray pixels for a GRAY profile, or a silent less-optimal compression of the pixel + data if the pixels could be encoded as grayscale but the ICC profile is RGB. + + To avoid this do not set an ICC profile in the image unless there is a good reason for it, and when doing so + make sure you compute it carefully to avoid the above problems. + */ + unsigned iccp_defined; /* Whether an iCCP chunk is present (0 = not present, 1 = present). */ + char* iccp_name; /* Null terminated string with profile name, 1-79 bytes */ + /* + The ICC profile in iccp_profile_size bytes. + Don't allocate this buffer yourself. Use the init/cleanup functions + correctly and use lodepng_set_icc and lodepng_clear_icc. + */ + unsigned char* iccp_profile; + unsigned iccp_profile_size; /* The size of iccp_profile in bytes */ + + /* End of color profile related chunks */ + + + /* + unknown chunks: chunks not known by LodePNG, passed on byte for byte. + + There are 3 buffers, one for each position in the PNG where unknown chunks can appear. + Each buffer contains all unknown chunks for that position consecutively. + The 3 positions are: + 0: between IHDR and PLTE, 1: between PLTE and IDAT, 2: between IDAT and IEND. + + For encoding, do not store critical chunks or known chunks that are enabled with a "_defined" flag + above in here, since the encoder will blindly follow this and could then encode an invalid PNG file + (such as one with two IHDR chunks or the disallowed combination of sRGB with iCCP). But do use + this if you wish to store an ancillary chunk that is not supported by LodePNG (such as sPLT or hIST), + or any non-standard PNG chunk. + + Do not allocate or traverse this data yourself. Use the chunk traversing functions declared + later, such as lodepng_chunk_next and lodepng_chunk_append, to read/write this struct. + */ + unsigned char* unknown_chunks_data[3]; + size_t unknown_chunks_size[3]; /*size in bytes of the unknown chunks, given for protection*/ #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ } LodePNGInfo; /*init, cleanup and copy functions to use with this struct*/ -void lodepng_info_init(LodePNGInfo * info); -void lodepng_info_cleanup(LodePNGInfo * info); +void lodepng_info_init(LodePNGInfo* info); +void lodepng_info_cleanup(LodePNGInfo* info); /*return value is error code (0 means no error)*/ -unsigned lodepng_info_copy(LodePNGInfo * dest, const LodePNGInfo * source); +unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source); #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS -unsigned lodepng_add_text(LodePNGInfo * info, const char * key, const char * str); /*push back both texts at once*/ -void lodepng_clear_text(LodePNGInfo * info); /*use this to clear the texts again after you filled them in*/ +unsigned lodepng_add_text(LodePNGInfo* info, const char* key, const char* str); /*push back both texts at once*/ +void lodepng_clear_text(LodePNGInfo* info); /*use this to clear the texts again after you filled them in*/ -unsigned lodepng_add_itext(LodePNGInfo * info, const char * key, const char * langtag, - const char * transkey, const char * str); /*push back the 4 texts of 1 chunk at once*/ -void lodepng_clear_itext(LodePNGInfo * info); /*use this to clear the itexts again after you filled them in*/ +unsigned lodepng_add_itext(LodePNGInfo* info, const char* key, const char* langtag, + const char* transkey, const char* str); /*push back the 4 texts of 1 chunk at once*/ +void lodepng_clear_itext(LodePNGInfo* info); /*use this to clear the itexts again after you filled them in*/ /*replaces if exists*/ -unsigned lodepng_set_icc(LodePNGInfo * info, const char * name, const unsigned char * profile, unsigned profile_size); -void lodepng_clear_icc(LodePNGInfo * info); /*use this to clear the texts again after you filled them in*/ +unsigned lodepng_set_icc(LodePNGInfo* info, const char* name, const unsigned char* profile, unsigned profile_size); +void lodepng_clear_icc(LodePNGInfo* info); /*use this to clear the texts again after you filled them in*/ #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ /* @@ -724,8 +631,8 @@ For < 8 bpp images, there should not be padding bits at the end of scanlines. For 16-bit per channel colors, uses big endian format like PNG does. Return value is LodePNG error code */ -unsigned lodepng_convert(unsigned char * out, const unsigned char * in, - const LodePNGColorMode * mode_out, const LodePNGColorMode * mode_in, +unsigned lodepng_convert(unsigned char* out, const unsigned char* in, + const LodePNGColorMode* mode_out, const LodePNGColorMode* mode_in, unsigned w, unsigned h); #ifdef LODEPNG_COMPILE_DECODER @@ -734,129 +641,124 @@ Settings for the decoder. This contains settings for the PNG and the Zlib decoder, but not the Info settings from the Info structs. */ typedef struct LodePNGDecoderSettings { - LodePNGDecompressSettings zlibsettings; /*in here is the setting to ignore Adler32 checksums*/ + LodePNGDecompressSettings zlibsettings; /*in here is the setting to ignore Adler32 checksums*/ - /* Check LodePNGDecompressSettings for more ignorable errors such as ignore_adler32 */ - unsigned ignore_crc; /*ignore CRC checksums*/ - unsigned ignore_critical; /*ignore unknown critical chunks*/ - unsigned ignore_end; /*ignore issues at end of file if possible (missing IEND chunk, too large chunk, ...)*/ - /* TODO: make a system involving warnings with levels and a strict mode instead. Other potentially recoverable - errors: srgb rendering intent value, size of content of ancillary chunks, more than 79 characters for some - strings, placement/combination rules for ancillary chunks, crc of unknown chunks, allowed characters - in string keys, etc... */ + /* Check LodePNGDecompressSettings for more ignorable errors such as ignore_adler32 */ + unsigned ignore_crc; /*ignore CRC checksums*/ + unsigned ignore_critical; /*ignore unknown critical chunks*/ + unsigned ignore_end; /*ignore issues at end of file if possible (missing IEND chunk, too large chunk, ...)*/ + /* TODO: make a system involving warnings with levels and a strict mode instead. Other potentially recoverable + errors: srgb rendering intent value, size of content of ancillary chunks, more than 79 characters for some + strings, placement/combination rules for ancillary chunks, crc of unknown chunks, allowed characters + in string keys, etc... */ - unsigned color_convert; /*whether to convert the PNG to the color type you want. Default: yes*/ + unsigned color_convert; /*whether to convert the PNG to the color type you want. Default: yes*/ #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - unsigned read_text_chunks; /*if false but remember_unknown_chunks is true, they're stored in the unknown chunks*/ + unsigned read_text_chunks; /*if false but remember_unknown_chunks is true, they're stored in the unknown chunks*/ - /*store all bytes from unknown chunks in the LodePNGInfo (off by default, useful for a png editor)*/ - unsigned remember_unknown_chunks; + /*store all bytes from unknown chunks in the LodePNGInfo (off by default, useful for a png editor)*/ + unsigned remember_unknown_chunks; - /* maximum size for decompressed text chunks. If a text chunk's text is larger than this, an error is returned, - unless reading text chunks is disabled or this limit is set higher or disabled. Set to 0 to allow any size. - By default it is a value that prevents unreasonably large strings from hogging memory. */ - size_t max_text_size; + /* maximum size for decompressed text chunks. If a text chunk's text is larger than this, an error is returned, + unless reading text chunks is disabled or this limit is set higher or disabled. Set to 0 to allow any size. + By default it is a value that prevents unreasonably large strings from hogging memory. */ + size_t max_text_size; - /* maximum size for compressed ICC chunks. If the ICC profile is larger than this, an error will be returned. Set to - 0 to allow any size. By default this is a value that prevents ICC profiles that would be much larger than any - legitimate profile could be to hog memory. */ - size_t max_icc_size; + /* maximum size for compressed ICC chunks. If the ICC profile is larger than this, an error will be returned. Set to + 0 to allow any size. By default this is a value that prevents ICC profiles that would be much larger than any + legitimate profile could be to hog memory. */ + size_t max_icc_size; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ } LodePNGDecoderSettings; -void lodepng_decoder_settings_init(LodePNGDecoderSettings * settings); +void lodepng_decoder_settings_init(LodePNGDecoderSettings* settings); #endif /*LODEPNG_COMPILE_DECODER*/ #ifdef LODEPNG_COMPILE_ENCODER /*automatically use color type with less bits per pixel if losslessly possible. Default: AUTO*/ typedef enum LodePNGFilterStrategy { - /*every filter at zero*/ - LFS_ZERO = 0, - /*every filter at 1, 2, 3 or 4 (paeth), unlike LFS_ZERO not a good choice, but for testing*/ - LFS_ONE = 1, - LFS_TWO = 2, - LFS_THREE = 3, - LFS_FOUR = 4, - /*Use filter that gives minimum sum, as described in the official PNG filter heuristic.*/ - LFS_MINSUM, - /*Use the filter type that gives smallest Shannon entropy for this scanline. Depending - on the image, this is better or worse than minsum.*/ - LFS_ENTROPY, - /* - Brute-force-search PNG filters by compressing each filter for each scanline. - Experimental, very slow, and only rarely gives better compression than MINSUM. - */ - LFS_BRUTE_FORCE, - /*use predefined_filters buffer: you specify the filter type for each scanline*/ - LFS_PREDEFINED + /*every filter at zero*/ + LFS_ZERO = 0, + /*every filter at 1, 2, 3 or 4 (paeth), unlike LFS_ZERO not a good choice, but for testing*/ + LFS_ONE = 1, + LFS_TWO = 2, + LFS_THREE = 3, + LFS_FOUR = 4, + /*Use filter that gives minimum sum, as described in the official PNG filter heuristic.*/ + LFS_MINSUM, + /*Use the filter type that gives smallest Shannon entropy for this scanline. Depending + on the image, this is better or worse than minsum.*/ + LFS_ENTROPY, + /* + Brute-force-search PNG filters by compressing each filter for each scanline. + Experimental, very slow, and only rarely gives better compression than MINSUM. + */ + LFS_BRUTE_FORCE, + /*use predefined_filters buffer: you specify the filter type for each scanline*/ + LFS_PREDEFINED } LodePNGFilterStrategy; /*Gives characteristics about the integer RGBA colors of the image (count, alpha channel usage, bit depth, ...), which helps decide which color model to use for encoding. Used internally by default if "auto_convert" is enabled. Public because it's useful for custom algorithms.*/ typedef struct LodePNGColorStats { - unsigned colored; /*not grayscale*/ - unsigned key; /*image is not opaque and color key is possible instead of full alpha*/ - unsigned short key_r; /*key values, always as 16-bit, in 8-bit case the byte is duplicated, e.g. 65535 means 255*/ - unsigned short key_g; - unsigned short key_b; - unsigned alpha; /*image is not opaque and alpha channel or alpha palette required*/ - unsigned numcolors; /*amount of colors, up to 257. Not valid if bits == 16 or allow_palette is disabled.*/ - unsigned char - palette[1024]; /*Remembers up to the first 256 RGBA colors, in no particular order, only valid when numcolors is valid*/ - unsigned bits; /*bits per channel (not for palette). 1,2 or 4 for grayscale only. 16 if 16-bit per channel required.*/ - size_t numpixels; - - /*user settings for computing/using the stats*/ - unsigned allow_palette; /*default 1. if 0, disallow choosing palette colortype in auto_choose_color, and don't count numcolors*/ - unsigned allow_greyscale; /*default 1. if 0, choose RGB or RGBA even if the image only has gray colors*/ + unsigned colored; /*not grayscale*/ + unsigned key; /*image is not opaque and color key is possible instead of full alpha*/ + unsigned short key_r; /*key values, always as 16-bit, in 8-bit case the byte is duplicated, e.g. 65535 means 255*/ + unsigned short key_g; + unsigned short key_b; + unsigned alpha; /*image is not opaque and alpha channel or alpha palette required*/ + unsigned numcolors; /*amount of colors, up to 257. Not valid if bits == 16 or allow_palette is disabled.*/ + unsigned char palette[1024]; /*Remembers up to the first 256 RGBA colors, in no particular order, only valid when numcolors is valid*/ + unsigned bits; /*bits per channel (not for palette). 1,2 or 4 for grayscale only. 16 if 16-bit per channel required.*/ + size_t numpixels; + + /*user settings for computing/using the stats*/ + unsigned allow_palette; /*default 1. if 0, disallow choosing palette colortype in auto_choose_color, and don't count numcolors*/ + unsigned allow_greyscale; /*default 1. if 0, choose RGB or RGBA even if the image only has gray colors*/ } LodePNGColorStats; -void lodepng_color_stats_init(LodePNGColorStats * stats); +void lodepng_color_stats_init(LodePNGColorStats* stats); /*Get a LodePNGColorStats of the image. The stats must already have been inited. Returns error code (e.g. alloc fail) or 0 if ok.*/ -unsigned lodepng_compute_color_stats(LodePNGColorStats * stats, - const unsigned char * image, unsigned w, unsigned h, - const LodePNGColorMode * mode_in); +unsigned lodepng_compute_color_stats(LodePNGColorStats* stats, + const unsigned char* image, unsigned w, unsigned h, + const LodePNGColorMode* mode_in); /*Settings for the encoder.*/ typedef struct LodePNGEncoderSettings { - LodePNGCompressSettings zlibsettings; /*settings for the zlib encoder, such as window size, ...*/ - - unsigned auto_convert; /*automatically choose output PNG color type. Default: true*/ - - /*If true, follows the official PNG heuristic: if the PNG uses a palette or lower than - 8 bit depth, set all filters to zero. Otherwise use the filter_strategy. Note that to - completely follow the official PNG heuristic, filter_palette_zero must be true and - filter_strategy must be LFS_MINSUM*/ - unsigned filter_palette_zero; - /*Which filter strategy to use when not using zeroes due to filter_palette_zero. - Set filter_palette_zero to 0 to ensure always using your chosen strategy. Default: LFS_MINSUM*/ - LodePNGFilterStrategy filter_strategy; - /*used if filter_strategy is LFS_PREDEFINED. In that case, this must point to a buffer with - the same length as the amount of scanlines in the image, and each value must <= 5. You - have to cleanup this buffer, LodePNG will never free it. Don't forget that filter_palette_zero - must be set to 0 to ensure this is also used on palette or low bitdepth images.*/ - const unsigned char * predefined_filters; - - /*force creating a PLTE chunk if colortype is 2 or 6 (= a suggested palette). - If colortype is 3, PLTE is always created. If color type is explicitely set - to a grayscale type (1 or 4), this is not done and is ignored. If enabling this, - a palette must be present in the info_png. - NOTE: enabling this may worsen compression if auto_convert is used to choose - optimal color mode, because it cannot use grayscale color modes in this case*/ - unsigned force_palette; + LodePNGCompressSettings zlibsettings; /*settings for the zlib encoder, such as window size, ...*/ + + unsigned auto_convert; /*automatically choose output PNG color type. Default: true*/ + + /*If true, follows the official PNG heuristic: if the PNG uses a palette or lower than + 8 bit depth, set all filters to zero. Otherwise use the filter_strategy. Note that to + completely follow the official PNG heuristic, filter_palette_zero must be true and + filter_strategy must be LFS_MINSUM*/ + unsigned filter_palette_zero; + /*Which filter strategy to use when not using zeroes due to filter_palette_zero. + Set filter_palette_zero to 0 to ensure always using your chosen strategy. Default: LFS_MINSUM*/ + LodePNGFilterStrategy filter_strategy; + /*used if filter_strategy is LFS_PREDEFINED. In that case, this must point to a buffer with + the same length as the amount of scanlines in the image, and each value must <= 5. You + have to cleanup this buffer, LodePNG will never free it. Don't forget that filter_palette_zero + must be set to 0 to ensure this is also used on palette or low bitdepth images.*/ + const unsigned char* predefined_filters; + + /*force creating a PLTE chunk if colortype is 2 or 6 (= a suggested palette). + If colortype is 3, PLTE is _always_ created.*/ + unsigned force_palette; #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*add LodePNG identifier and version as a text chunk, for debugging*/ - unsigned add_id; - /*encode text chunks as zTXt chunks instead of tEXt chunks, and use compression in iTXt chunks*/ - unsigned text_compression; + /*add LodePNG identifier and version as a text chunk, for debugging*/ + unsigned add_id; + /*encode text chunks as zTXt chunks instead of tEXt chunks, and use compression in iTXt chunks*/ + unsigned text_compression; #endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ } LodePNGEncoderSettings; -void lodepng_encoder_settings_init(LodePNGEncoderSettings * settings); +void lodepng_encoder_settings_init(LodePNGEncoderSettings* settings); #endif /*LODEPNG_COMPILE_ENCODER*/ @@ -864,20 +766,20 @@ void lodepng_encoder_settings_init(LodePNGEncoderSettings * settings); /*The settings, state and information for extended encoding and decoding.*/ typedef struct LodePNGState { #ifdef LODEPNG_COMPILE_DECODER - LodePNGDecoderSettings decoder; /*the decoding settings*/ + LodePNGDecoderSettings decoder; /*the decoding settings*/ #endif /*LODEPNG_COMPILE_DECODER*/ #ifdef LODEPNG_COMPILE_ENCODER - LodePNGEncoderSettings encoder; /*the encoding settings*/ + LodePNGEncoderSettings encoder; /*the encoding settings*/ #endif /*LODEPNG_COMPILE_ENCODER*/ - LodePNGColorMode info_raw; /*specifies the format in which you would like to get the raw pixel buffer*/ - LodePNGInfo info_png; /*info of the PNG image obtained after decoding*/ - unsigned error; + LodePNGColorMode info_raw; /*specifies the format in which you would like to get the raw pixel buffer*/ + LodePNGInfo info_png; /*info of the PNG image obtained after decoding*/ + unsigned error; } LodePNGState; /*init, cleanup and copy functions to use with this struct*/ -void lodepng_state_init(LodePNGState * state); -void lodepng_state_cleanup(LodePNGState * state); -void lodepng_state_copy(LodePNGState * dest, const LodePNGState * source); +void lodepng_state_init(LodePNGState* state); +void lodepng_state_cleanup(LodePNGState* state); +void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source); #endif /* defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) */ #ifdef LODEPNG_COMPILE_DECODER @@ -885,23 +787,23 @@ void lodepng_state_copy(LodePNGState * dest, const LodePNGState * source); Same as lodepng_decode_memory, but uses a LodePNGState to allow custom settings and getting much more information about the PNG image and color mode. */ -unsigned lodepng_decode(unsigned char ** out, unsigned * w, unsigned * h, - LodePNGState * state, - const unsigned char * in, size_t insize); +unsigned lodepng_decode(unsigned char** out, unsigned* w, unsigned* h, + LodePNGState* state, + const unsigned char* in, size_t insize); /* Read the PNG header, but not the actual data. This returns only the information that is in the IHDR chunk of the PNG, such as width, height and color type. The information is placed in the info_png field of the LodePNGState. */ -unsigned lodepng_inspect(unsigned * w, unsigned * h, - LodePNGState * state, - const unsigned char * in, size_t insize); +unsigned lodepng_inspect(unsigned* w, unsigned* h, + LodePNGState* state, + const unsigned char* in, size_t insize); #endif /*LODEPNG_COMPILE_DECODER*/ /* -Reads one metadata chunk (other than IHDR, which is handled by lodepng_inspect) -of the PNG file and outputs what it read in the state. Returns error code on failure. +Reads one metadata chunk (other than IHDR) of the PNG file and outputs what it +read in the state. Returns error code on failure. Use lodepng_inspect first with a new state, then e.g. lodepng_chunk_find_const to find the desired chunk type, and if non null use lodepng_inspect_chunk (with chunk_pointer - start_of_file as pos). @@ -911,14 +813,14 @@ Requirements: &in[pos] must point to start of a chunk, must use regular lodepng_inspect first since format of most other chunks depends on IHDR, and if there is a PLTE chunk, that one must be inspected before tRNS or bKGD. */ -unsigned lodepng_inspect_chunk(LodePNGState * state, size_t pos, - const unsigned char * in, size_t insize); +unsigned lodepng_inspect_chunk(LodePNGState* state, size_t pos, + const unsigned char* in, size_t insize); #ifdef LODEPNG_COMPILE_ENCODER /*This function allocates the out buffer with standard malloc and stores the size in *outsize.*/ -unsigned lodepng_encode(unsigned char ** out, size_t * outsize, - const unsigned char * image, unsigned w, unsigned h, - LodePNGState * state); +unsigned lodepng_encode(unsigned char** out, size_t* outsize, + const unsigned char* image, unsigned w, unsigned h, + LodePNGState* state); #endif /*LODEPNG_COMPILE_ENCODER*/ /* @@ -950,32 +852,32 @@ Gets the length of the data of the chunk. Total chunk length has 12 bytes more. There must be at least 4 bytes to read from. If the result value is too large, it may be corrupt data. */ -unsigned lodepng_chunk_length(const unsigned char * chunk); +unsigned lodepng_chunk_length(const unsigned char* chunk); /*puts the 4-byte type in null terminated string*/ -void lodepng_chunk_type(char type[5], const unsigned char * chunk); +void lodepng_chunk_type(char type[5], const unsigned char* chunk); /*check if the type is the given type*/ -unsigned char lodepng_chunk_type_equals(const unsigned char * chunk, const char * type); +unsigned char lodepng_chunk_type_equals(const unsigned char* chunk, const char* type); /*0: it's one of the critical chunk types, 1: it's an ancillary chunk (see PNG standard)*/ -unsigned char lodepng_chunk_ancillary(const unsigned char * chunk); +unsigned char lodepng_chunk_ancillary(const unsigned char* chunk); /*0: public, 1: private (see PNG standard)*/ -unsigned char lodepng_chunk_private(const unsigned char * chunk); +unsigned char lodepng_chunk_private(const unsigned char* chunk); /*0: the chunk is unsafe to copy, 1: the chunk is safe to copy (see PNG standard)*/ -unsigned char lodepng_chunk_safetocopy(const unsigned char * chunk); +unsigned char lodepng_chunk_safetocopy(const unsigned char* chunk); /*get pointer to the data of the chunk, where the input points to the header of the chunk*/ -unsigned char * lodepng_chunk_data(unsigned char * chunk); -const unsigned char * lodepng_chunk_data_const(const unsigned char * chunk); +unsigned char* lodepng_chunk_data(unsigned char* chunk); +const unsigned char* lodepng_chunk_data_const(const unsigned char* chunk); /*returns 0 if the crc is correct, 1 if it's incorrect (0 for OK as usual!)*/ -unsigned lodepng_chunk_check_crc(const unsigned char * chunk); +unsigned lodepng_chunk_check_crc(const unsigned char* chunk); /*generates the correct CRC from the data and puts it in the last 4 bytes of the chunk*/ -void lodepng_chunk_generate_crc(unsigned char * chunk); +void lodepng_chunk_generate_crc(unsigned char* chunk); /* Iterate to next chunks, allows iterating through all chunks of the PNG file. @@ -988,20 +890,19 @@ is no more chunk after this or possibly if the chunk is corrupt. Start this process at the 8th byte of the PNG file. In a non-corrupt PNG file, the last chunk should have name "IEND". */ -unsigned char * lodepng_chunk_next(unsigned char * chunk, unsigned char * end); -const unsigned char * lodepng_chunk_next_const(const unsigned char * chunk, const unsigned char * end); +unsigned char* lodepng_chunk_next(unsigned char* chunk, unsigned char* end); +const unsigned char* lodepng_chunk_next_const(const unsigned char* chunk, const unsigned char* end); /*Finds the first chunk with the given type in the range [chunk, end), or returns NULL if not found.*/ -unsigned char * lodepng_chunk_find(unsigned char * chunk, unsigned char * end, const char type[5]); -const unsigned char * lodepng_chunk_find_const(const unsigned char * chunk, const unsigned char * end, - const char type[5]); +unsigned char* lodepng_chunk_find(unsigned char* chunk, unsigned char* end, const char type[5]); +const unsigned char* lodepng_chunk_find_const(const unsigned char* chunk, const unsigned char* end, const char type[5]); /* Appends chunk to the data in out. The given chunk should already have its chunk header. The out variable and outsize are updated to reflect the new reallocated buffer. Returns error code (0 if it went ok) */ -unsigned lodepng_chunk_append(unsigned char ** out, size_t * outsize, const unsigned char * chunk); +unsigned lodepng_chunk_append(unsigned char** out, size_t* outsize, const unsigned char* chunk); /* Appends new chunk to out. The chunk to append is given by giving its length, type @@ -1009,12 +910,12 @@ and data separately. The type is a 4-letter string. The out variable and outsize are updated to reflect the new reallocated buffer. Returne error code (0 if it went ok) */ -unsigned lodepng_chunk_create(unsigned char ** out, size_t * outsize, size_t length, - const char * type, const unsigned char * data); +unsigned lodepng_chunk_create(unsigned char** out, size_t* outsize, unsigned length, + const char* type, const unsigned char* data); /*Calculate CRC32 of buffer*/ -unsigned lodepng_crc32(const unsigned char * buf, size_t len); +unsigned lodepng_crc32(const unsigned char* buf, size_t len); #endif /*LODEPNG_COMPILE_PNG*/ @@ -1027,9 +928,9 @@ part of zlib that is required for PNG, it does not support dictionaries. #ifdef LODEPNG_COMPILE_DECODER /*Inflate a buffer. Inflate is the decompression step of deflate. Out buffer must be freed after use.*/ -unsigned lodepng_inflate(unsigned char ** out, size_t * outsize, - const unsigned char * in, size_t insize, - const LodePNGDecompressSettings * settings); +unsigned lodepng_inflate(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings); /* Decompresses Zlib data. Reallocates the out buffer and appends the data. The @@ -1037,9 +938,9 @@ data must be according to the zlib specification. Either, *out must be NULL and *outsize must be 0, or, *out must be a valid buffer and *outsize its size in bytes. out must be freed by user after usage. */ -unsigned lodepng_zlib_decompress(unsigned char ** out, size_t * outsize, - const unsigned char * in, size_t insize, - const LodePNGDecompressSettings * settings); +unsigned lodepng_zlib_decompress(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGDecompressSettings* settings); #endif /*LODEPNG_COMPILE_DECODER*/ #ifdef LODEPNG_COMPILE_ENCODER @@ -1050,127 +951,113 @@ The data is output in the format of the zlib specification. Either, *out must be NULL and *outsize must be 0, or, *out must be a valid buffer and *outsize its size in bytes. out must be freed by user after usage. */ -unsigned lodepng_zlib_compress(unsigned char ** out, size_t * outsize, - const unsigned char * in, size_t insize, - const LodePNGCompressSettings * settings); +unsigned lodepng_zlib_compress(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGCompressSettings* settings); /* Find length-limited Huffman code for given frequencies. This function is in the public interface only for tests, it's used internally by lodepng_deflate. */ -unsigned lodepng_huffman_code_lengths(unsigned * lengths, const unsigned * frequencies, +unsigned lodepng_huffman_code_lengths(unsigned* lengths, const unsigned* frequencies, size_t numcodes, unsigned maxbitlen); /*Compress a buffer with deflate. See RFC 1951. Out buffer must be freed after use.*/ -unsigned lodepng_deflate(unsigned char ** out, size_t * outsize, - const unsigned char * in, size_t insize, - const LodePNGCompressSettings * settings); +unsigned lodepng_deflate(unsigned char** out, size_t* outsize, + const unsigned char* in, size_t insize, + const LodePNGCompressSettings* settings); #endif /*LODEPNG_COMPILE_ENCODER*/ #endif /*LODEPNG_COMPILE_ZLIB*/ #ifdef LODEPNG_COMPILE_DISK - /* - Load a file from disk into buffer. The function allocates the out buffer, and - after usage you should free it. - out: output parameter, contains pointer to loaded buffer. - outsize: output parameter, size of the allocated out buffer - filename: the path to the file to load - return value: error code (0 means ok) - - NOTE: Wide-character filenames are not supported, you can use an external method - to handle such files and decode in-memory. - */ - unsigned lodepng_load_file(unsigned char ** out, size_t * outsize, const char * filename); - - /* - Save a file from buffer to disk. Warning, if it exists, this function overwrites - the file without warning! - buffer: the buffer to write - buffersize: size of the buffer to write - filename: the path to the file to save to - return value: error code (0 means ok) - - NOTE: Wide-character filenames are not supported, you can use an external method - to handle such files and encode in-memory - */ - unsigned lodepng_save_file(const unsigned char * buffer, size_t buffersize, const char * filename); +/* +Load a file from disk into buffer. The function allocates the out buffer, and +after usage you should free it. +out: output parameter, contains pointer to loaded buffer. +outsize: output parameter, size of the allocated out buffer +filename: the path to the file to load +return value: error code (0 means ok) +*/ +unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename); + +/* +Save a file from buffer to disk. Warning, if it exists, this function overwrites +the file without warning! +buffer: the buffer to write +buffersize: size of the buffer to write +filename: the path to the file to save to +return value: error code (0 means ok) +*/ +unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const char* filename); #endif /*LODEPNG_COMPILE_DISK*/ #ifdef LODEPNG_COMPILE_CPP /* The LodePNG C++ wrapper uses std::vectors instead of manually allocated memory buffers. */ -namespace lodepng -{ +namespace lodepng { #ifdef LODEPNG_COMPILE_PNG -class State : public LodePNGState -{ - public: - State(); - State(const State & other); - ~State(); - State & operator=(const State & other); +class State : public LodePNGState { + public: + State(); + State(const State& other); + ~State(); + State& operator=(const State& other); }; #ifdef LODEPNG_COMPILE_DECODER /* Same as other lodepng::decode, but using a State for more settings and information. */ -unsigned decode(std::vector & out, unsigned & w, unsigned & h, - State & state, - const unsigned char * in, size_t insize); -unsigned decode(std::vector & out, unsigned & w, unsigned & h, - State & state, - const std::vector & in); +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + State& state, + const unsigned char* in, size_t insize); +unsigned decode(std::vector& out, unsigned& w, unsigned& h, + State& state, + const std::vector& in); #endif /*LODEPNG_COMPILE_DECODER*/ #ifdef LODEPNG_COMPILE_ENCODER /* Same as other lodepng::encode, but using a State for more settings and information. */ -unsigned encode(std::vector & out, - const unsigned char * in, unsigned w, unsigned h, - State & state); -unsigned encode(std::vector & out, - const std::vector & in, unsigned w, unsigned h, - State & state); +unsigned encode(std::vector& out, + const unsigned char* in, unsigned w, unsigned h, + State& state); +unsigned encode(std::vector& out, + const std::vector& in, unsigned w, unsigned h, + State& state); #endif /*LODEPNG_COMPILE_ENCODER*/ #ifdef LODEPNG_COMPILE_DISK - /* - Load a file from disk into an std::vector. - return value: error code (0 means ok) - - NOTE: Wide-character filenames are not supported, you can use an external method - to handle such files and decode in-memory - */ - unsigned load_file(std::vector & buffer, const std::string & filename); - - /* - Save the binary data in an std::vector to a file on disk. The file is overwritten - without warning. - - NOTE: Wide-character filenames are not supported, you can use an external method - to handle such files and encode in-memory - */ - unsigned save_file(const std::vector & buffer, const std::string & filename); +/* +Load a file from disk into an std::vector. +return value: error code (0 means ok) +*/ +unsigned load_file(std::vector& buffer, const std::string& filename); + +/* +Save the binary data in an std::vector to a file on disk. The file is overwritten +without warning. +*/ +unsigned save_file(const std::vector& buffer, const std::string& filename); #endif /* LODEPNG_COMPILE_DISK */ #endif /* LODEPNG_COMPILE_PNG */ #ifdef LODEPNG_COMPILE_ZLIB #ifdef LODEPNG_COMPILE_DECODER /* Zlib-decompress an unsigned char buffer */ -unsigned decompress(std::vector & out, const unsigned char * in, size_t insize, - const LodePNGDecompressSettings & settings = lodepng_default_decompress_settings); +unsigned decompress(std::vector& out, const unsigned char* in, size_t insize, + const LodePNGDecompressSettings& settings = lodepng_default_decompress_settings); /* Zlib-decompress an std::vector */ -unsigned decompress(std::vector & out, const std::vector & in, - const LodePNGDecompressSettings & settings = lodepng_default_decompress_settings); +unsigned decompress(std::vector& out, const std::vector& in, + const LodePNGDecompressSettings& settings = lodepng_default_decompress_settings); #endif /* LODEPNG_COMPILE_DECODER */ #ifdef LODEPNG_COMPILE_ENCODER /* Zlib-compress an unsigned char buffer */ -unsigned compress(std::vector & out, const unsigned char * in, size_t insize, - const LodePNGCompressSettings & settings = lodepng_default_compress_settings); +unsigned compress(std::vector& out, const unsigned char* in, size_t insize, + const LodePNGCompressSettings& settings = lodepng_default_compress_settings); /* Zlib-compress an std::vector */ -unsigned compress(std::vector & out, const std::vector & in, - const LodePNGCompressSettings & settings = lodepng_default_compress_settings); +unsigned compress(std::vector& out, const std::vector& in, + const LodePNGCompressSettings& settings = lodepng_default_compress_settings); #endif /* LODEPNG_COMPILE_ENCODER */ #endif /* LODEPNG_COMPILE_ZLIB */ } /* namespace lodepng */ @@ -1182,7 +1069,7 @@ unsigned compress(std::vector & out, const std::vector (2^31)-1 [ ] partial decoding (stream processing) [X] let the "isFullyOpaque" function check color keys and transparent palettes too @@ -1198,11 +1085,7 @@ unsigned compress(std::vector & out, const std::vector + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static lv_res_t decoder_info(struct _lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header); +static lv_res_t decoder_open(lv_img_decoder_t * dec, lv_img_decoder_dsc_t * dsc); +static void decoder_close(lv_img_decoder_t * dec, lv_img_decoder_dsc_t * dsc); +static void convert_color_depth(uint8_t * img, uint32_t px_cnt); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Register the PNG decoder functions in LVGL + */ +void lv_png_init(void) +{ + lv_img_decoder_t * dec = lv_img_decoder_create(); + lv_img_decoder_set_info_cb(dec, decoder_info); + lv_img_decoder_set_open_cb(dec, decoder_open); + lv_img_decoder_set_close_cb(dec, decoder_close); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +/** + * Get info about a PNG image + * @param src can be file name or pointer to a C array + * @param header store the info here + * @return LV_RES_OK: no error; LV_RES_INV: can't get the info + */ +static lv_res_t decoder_info(struct _lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header) +{ + (void) decoder; /*Unused*/ + lv_img_src_t src_type = lv_img_src_get_type(src); /*Get the source type*/ + + /*If it's a PNG file...*/ + if(src_type == LV_IMG_SRC_FILE) { + const char * fn = src; + if(strcmp(lv_fs_get_ext(fn), "png") == 0) { /*Check the extension*/ + + /* Read the width and height from the file. They have a constant location: + * [16..23]: width + * [24..27]: height + */ + uint32_t size[2]; + lv_fs_file_t f; + lv_fs_res_t res = lv_fs_open(&f, fn, LV_FS_MODE_RD); + if(res != LV_FS_RES_OK) return LV_RES_INV; + + lv_fs_seek(&f, 16, LV_FS_SEEK_SET); + + uint32_t rn; + lv_fs_read(&f, &size, 8, &rn); + lv_fs_close(&f); + + if(rn != 8) return LV_RES_INV; + + /*Save the data in the header*/ + header->always_zero = 0; + header->cf = LV_IMG_CF_TRUE_COLOR_ALPHA; + /*The width and height are stored in Big endian format so convert them to little endian*/ + header->w = (lv_coord_t)((size[0] & 0xff000000) >> 24) + ((size[0] & 0x00ff0000) >> 8); + header->h = (lv_coord_t)((size[1] & 0xff000000) >> 24) + ((size[1] & 0x00ff0000) >> 8); + + return LV_RES_OK; + } + } + /*If it's a PNG file in a C array...*/ + else if(src_type == LV_IMG_SRC_VARIABLE) { + const lv_img_dsc_t * img_dsc = src; + const uint32_t data_size = img_dsc->data_size; + const uint32_t * size = ((uint32_t *)img_dsc->data) + 4; + const uint8_t magic[] = {0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a}; + if(data_size < sizeof(magic)) return LV_RES_INV; + if(memcmp(magic, img_dsc->data, sizeof(magic))) return LV_RES_INV; + header->always_zero = 0; + + if(img_dsc->header.cf) { + header->cf = img_dsc->header.cf; /*Save the color format*/ + } + else { + header->cf = LV_IMG_CF_TRUE_COLOR_ALPHA; + } + + if(img_dsc->header.w) { + header->w = img_dsc->header.w; /*Save the image width*/ + } + else { + header->w = (lv_coord_t)((size[0] & 0xff000000) >> 24) + ((size[0] & 0x00ff0000) >> 8); + } + + if(img_dsc->header.h) { + header->h = img_dsc->header.h; /*Save the color height*/ + } + else { + header->h = (lv_coord_t)((size[1] & 0xff000000) >> 24) + ((size[1] & 0x00ff0000) >> 8); + } + + return LV_RES_OK; + } + + return LV_RES_INV; /*If didn't succeeded earlier then it's an error*/ +} + + +/** + * Open a PNG image and return the decided image + * @param src can be file name or pointer to a C array + * @param style style of the image object (unused now but certain formats might use it) + * @return pointer to the decoded image or `LV_IMG_DECODER_OPEN_FAIL` if failed + */ +static lv_res_t decoder_open(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc) +{ + + (void) decoder; /*Unused*/ + uint32_t error; /*For the return values of PNG decoder functions*/ + + uint8_t * img_data = NULL; + + /*If it's a PNG file...*/ + if(dsc->src_type == LV_IMG_SRC_FILE) { + const char * fn = dsc->src; + if(strcmp(lv_fs_get_ext(fn), "png") == 0) { /*Check the extension*/ + + /*Load the PNG file into buffer. It's still compressed (not decoded)*/ + unsigned char * png_data; /*Pointer to the loaded data. Same as the original file just loaded into the RAM*/ + size_t png_data_size; /*Size of `png_data` in bytes*/ + + error = lodepng_load_file(&png_data, &png_data_size, fn); /*Load the file*/ + if(error) { + LV_LOG_WARN("error %" LV_PRIu32 ": %s\n", error, lodepng_error_text(error)); + return LV_RES_INV; + } + + /*Decode the PNG image*/ + unsigned png_width; /*Will be the width of the decoded image*/ + unsigned png_height; /*Will be the width of the decoded image*/ + + /*Decode the loaded image in ARGB8888 */ + error = lodepng_decode32(&img_data, &png_width, &png_height, png_data, png_data_size); + lv_mem_free(png_data); /*Free the loaded file*/ + if(error) { + if(img_data != NULL) { + lv_mem_free(img_data); + } + LV_LOG_WARN("error %" LV_PRIu32 ": %s\n", error, lodepng_error_text(error)); + return LV_RES_INV; + } + + /*Convert the image to the system's color depth*/ + convert_color_depth(img_data, png_width * png_height); + dsc->img_data = img_data; + return LV_RES_OK; /*The image is fully decoded. Return with its pointer*/ + } + } + /*If it's a PNG file in a C array...*/ + else if(dsc->src_type == LV_IMG_SRC_VARIABLE) { + const lv_img_dsc_t * img_dsc = dsc->src; + unsigned png_width; /*No used, just required by he decoder*/ + unsigned png_height; /*No used, just required by he decoder*/ + + /*Decode the image in ARGB8888 */ + error = lodepng_decode32(&img_data, &png_width, &png_height, img_dsc->data, img_dsc->data_size); + + if(error) { + if(img_data != NULL) { + lv_mem_free(img_data); + } + return LV_RES_INV; + } + + /*Convert the image to the system's color depth*/ + convert_color_depth(img_data, png_width * png_height); + + dsc->img_data = img_data; + return LV_RES_OK; /*Return with its pointer*/ + } + + return LV_RES_INV; /*If not returned earlier then it failed*/ +} + +/** + * Free the allocated resources + */ +static void decoder_close(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc) +{ + LV_UNUSED(decoder); /*Unused*/ + if(dsc->img_data) { + lv_mem_free((uint8_t *)dsc->img_data); + dsc->img_data = NULL; + } +} + +/** + * If the display is not in 32 bit format (ARGB888) then covert the image to the current color depth + * @param img the ARGB888 image + * @param px_cnt number of pixels in `img` + */ +static void convert_color_depth(uint8_t * img, uint32_t px_cnt) +{ +#if LV_COLOR_DEPTH == 32 + lv_color32_t * img_argb = (lv_color32_t *)img; + lv_color_t c; + lv_color_t * img_c = (lv_color_t *) img; + uint32_t i; + for(i = 0; i < px_cnt; i++) { + c = lv_color_make(img_argb[i].ch.red, img_argb[i].ch.green, img_argb[i].ch.blue); + img_c[i].ch.red = c.ch.blue; + img_c[i].ch.blue = c.ch.red; + } +#elif LV_COLOR_DEPTH == 16 + lv_color32_t * img_argb = (lv_color32_t *)img; + lv_color_t c; + uint32_t i; + for(i = 0; i < px_cnt; i++) { + c = lv_color_make(img_argb[i].ch.blue, img_argb[i].ch.green, img_argb[i].ch.red); + img[i * 3 + 2] = img_argb[i].ch.alpha; + img[i * 3 + 1] = c.full >> 8; + img[i * 3 + 0] = c.full & 0xFF; + } +#elif LV_COLOR_DEPTH == 8 + lv_color32_t * img_argb = (lv_color32_t *)img; + lv_color_t c; + uint32_t i; + for(i = 0; i < px_cnt; i++) { + c = lv_color_make(img_argb[i].ch.red, img_argb[i].ch.green, img_argb[i].ch.blue); + img[i * 2 + 1] = img_argb[i].ch.alpha; + img[i * 2 + 0] = c.full; + } +#elif LV_COLOR_DEPTH == 1 + lv_color32_t * img_argb = (lv_color32_t *)img; + uint8_t b; + uint32_t i; + for(i = 0; i < px_cnt; i++) { + b = img_argb[i].ch.red | img_argb[i].ch.green | img_argb[i].ch.blue; + img[i * 2 + 1] = img_argb[i].ch.alpha; + img[i * 2 + 0] = b > 128 ? 1 : 0; + } +#endif +} + +#endif /*LV_USE_PNG*/ + + diff --git a/L3_Middlewares/LVGL/src/libs/libpng/lv_libpng.h b/L3_Middlewares/LVGL/src/extra/libs/png/lv_png.h similarity index 68% rename from L3_Middlewares/LVGL/src/libs/libpng/lv_libpng.h rename to L3_Middlewares/LVGL/src/extra/libs/png/lv_png.h index 1279458..4380472 100644 --- a/L3_Middlewares/LVGL/src/libs/libpng/lv_libpng.h +++ b/L3_Middlewares/LVGL/src/extra/libs/png/lv_png.h @@ -1,10 +1,10 @@ /** - * @file lv_libpng.h + * @file lv_png.h * */ -#ifndef LV_LIBPNG_H -#define LV_LIBPNG_H +#ifndef LV_PNG_H +#define LV_PNG_H #ifdef __cplusplus extern "C" { @@ -13,8 +13,8 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" -#if LV_USE_LIBPNG +#include "../../../lv_conf_internal.h" +#if LV_USE_PNG /********************* * DEFINES @@ -31,18 +31,16 @@ extern "C" { /** * Register the PNG decoder functions in LVGL */ -void lv_libpng_init(void); - -void lv_libpng_deinit(void); +void lv_png_init(void); /********************** * MACROS **********************/ -#endif /*LV_USE_LIBPNG*/ +#endif /*LV_USE_PNG*/ #ifdef __cplusplus } /* extern "C" */ #endif -#endif /*LV_LIBPNG_H*/ +#endif /*LV_PNG_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/libs/qrcode/lv_qrcode.c b/L3_Middlewares/LVGL/src/extra/libs/qrcode/lv_qrcode.c new file mode 100644 index 0000000..079873e --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/qrcode/lv_qrcode.c @@ -0,0 +1,215 @@ +/** + * @file lv_qrcode.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_qrcode.h" +#if LV_USE_QRCODE + +#include "qrcodegen.h" + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_qrcode_class + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_qrcode_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_qrcode_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); + +/********************** + * STATIC VARIABLES + **********************/ + +const lv_obj_class_t lv_qrcode_class = { + .constructor_cb = lv_qrcode_constructor, + .destructor_cb = lv_qrcode_destructor, + .base_class = &lv_canvas_class +}; + +static lv_coord_t size_param; +static lv_color_t dark_color_param; +static lv_color_t light_color_param; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Create an empty QR code (an `lv_canvas`) object. + * @param parent point to an object where to create the QR code + * @param size width and height of the QR code + * @param dark_color dark color of the QR code + * @param light_color light color of the QR code + * @return pointer to the created QR code object + */ +lv_obj_t * lv_qrcode_create(lv_obj_t * parent, lv_coord_t size, lv_color_t dark_color, lv_color_t light_color) +{ + LV_LOG_INFO("begin"); + size_param = size; + light_color_param = light_color; + dark_color_param = dark_color; + + lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); + lv_obj_class_init_obj(obj); + return obj; + +} + +/** + * Set the data of a QR code object + * @param qrcode pointer to aQ code object + * @param data data to display + * @param data_len length of data in bytes + * @return LV_RES_OK: if no error; LV_RES_INV: on error + */ +lv_res_t lv_qrcode_update(lv_obj_t * qrcode, const void * data, uint32_t data_len) +{ + lv_color_t c; + c.full = 1; + lv_canvas_fill_bg(qrcode, c, LV_OPA_COVER); + + if(data_len > qrcodegen_BUFFER_LEN_MAX) return LV_RES_INV; + + lv_img_dsc_t * imgdsc = lv_canvas_get_img(qrcode); + + int32_t qr_version = qrcodegen_getMinFitVersion(qrcodegen_Ecc_MEDIUM, data_len); + if(qr_version <= 0) return LV_RES_INV; + int32_t qr_size = qrcodegen_version2size(qr_version); + if(qr_size <= 0) return LV_RES_INV; + int32_t scale = imgdsc->header.w / qr_size; + if(scale <= 0) return LV_RES_INV; + int32_t remain = imgdsc->header.w % qr_size; + + /* The qr version is incremented by four point */ + uint32_t version_extend = remain / (scale << 2); + if(version_extend && qr_version < qrcodegen_VERSION_MAX) { + qr_version = qr_version + version_extend > qrcodegen_VERSION_MAX ? + qrcodegen_VERSION_MAX : qr_version + version_extend; + } + + uint8_t * qr0 = lv_mem_alloc(qrcodegen_BUFFER_LEN_FOR_VERSION(qr_version)); + LV_ASSERT_MALLOC(qr0); + uint8_t * data_tmp = lv_mem_alloc(qrcodegen_BUFFER_LEN_FOR_VERSION(qr_version)); + LV_ASSERT_MALLOC(data_tmp); + lv_memcpy(data_tmp, data, data_len); + + bool ok = qrcodegen_encodeBinary(data_tmp, data_len, + qr0, qrcodegen_Ecc_MEDIUM, + qr_version, qr_version, + qrcodegen_Mask_AUTO, true); + + if(!ok) { + lv_mem_free(qr0); + lv_mem_free(data_tmp); + return LV_RES_INV; + } + + lv_coord_t obj_w = imgdsc->header.w; + qr_size = qrcodegen_getSize(qr0); + scale = obj_w / qr_size; + int scaled = qr_size * scale; + int margin = (obj_w - scaled) / 2; + uint8_t * buf_u8 = (uint8_t *)imgdsc->data + 8; /*+8 skip the palette*/ + + /* Copy the qr code canvas: + * A simple `lv_canvas_set_px` would work but it's slow for so many pixels. + * So buffer 1 byte (8 px) from the qr code and set it in the canvas image */ + uint32_t row_byte_cnt = (imgdsc->header.w + 7) >> 3; + int y; + for(y = margin; y < scaled + margin; y += scale) { + uint8_t b = 0; + uint8_t p = 0; + bool aligned = false; + int x; + for(x = margin; x < scaled + margin; x++) { + bool a = qrcodegen_getModule(qr0, (x - margin) / scale, (y - margin) / scale); + + if(aligned == false && (x & 0x7) == 0) aligned = true; + + if(aligned == false) { + c.full = a ? 0 : 1; + lv_canvas_set_px_color(qrcode, x, y, c); + } + else { + if(!a) b |= (1 << (7 - p)); + p++; + if(p == 8) { + uint32_t px = row_byte_cnt * y + (x >> 3); + buf_u8[px] = b; + b = 0; + p = 0; + } + } + } + + /*Process the last byte of the row*/ + if(p) { + /*Make the rest of the bits white*/ + b |= (1 << (8 - p)) - 1; + + uint32_t px = row_byte_cnt * y + (x >> 3); + buf_u8[px] = b; + } + + /*The Qr is probably scaled so simply to the repeated rows*/ + int s; + const uint8_t * row_ori = buf_u8 + row_byte_cnt * y; + for(s = 1; s < scale; s++) { + lv_memcpy((uint8_t *)buf_u8 + row_byte_cnt * (y + s), row_ori, row_byte_cnt); + } + } + + lv_mem_free(qr0); + lv_mem_free(data_tmp); + return LV_RES_OK; +} + + +void lv_qrcode_delete(lv_obj_t * qrcode) +{ + lv_obj_del(qrcode); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_qrcode_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + + uint32_t buf_size = LV_CANVAS_BUF_SIZE_INDEXED_1BIT(size_param, size_param); + uint8_t * buf = lv_mem_alloc(buf_size); + LV_ASSERT_MALLOC(buf); + if(buf == NULL) return; + + lv_canvas_set_buffer(obj, buf, size_param, size_param, LV_IMG_CF_INDEXED_1BIT); + lv_canvas_set_palette(obj, 0, dark_color_param); + lv_canvas_set_palette(obj, 1, light_color_param); +} + +static void lv_qrcode_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + + lv_img_dsc_t * img = lv_canvas_get_img(obj); + lv_img_cache_invalidate_src(img); + lv_mem_free((void *)img->data); + img->data = NULL; +} + +#endif /*LV_USE_QRCODE*/ diff --git a/L3_Middlewares/LVGL/src/extra/libs/qrcode/lv_qrcode.h b/L3_Middlewares/LVGL/src/extra/libs/qrcode/lv_qrcode.h new file mode 100644 index 0000000..b0752ac --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/qrcode/lv_qrcode.h @@ -0,0 +1,69 @@ +/** + * @file lv_qrcode + * + */ + +#ifndef LV_QRCODE_H +#define LV_QRCODE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" +#if LV_USE_QRCODE + +/********************* + * DEFINES + *********************/ + +extern const lv_obj_class_t lv_qrcode_class; + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create an empty QR code (an `lv_canvas`) object. + * @param parent point to an object where to create the QR code + * @param size width and height of the QR code + * @param dark_color dark color of the QR code + * @param light_color light color of the QR code + * @return pointer to the created QR code object + */ +lv_obj_t * lv_qrcode_create(lv_obj_t * parent, lv_coord_t size, lv_color_t dark_color, lv_color_t light_color); + +/** + * Set the data of a QR code object + * @param qrcode pointer to aQ code object + * @param data data to display + * @param data_len length of data in bytes + * @return LV_RES_OK: if no error; LV_RES_INV: on error + */ +lv_res_t lv_qrcode_update(lv_obj_t * qrcode, const void * data, uint32_t data_len); + +/** + * DEPRECATED: Use normal lv_obj_del instead + * Delete a QR code object + * @param qrcode pointer to a QR code object + */ +void lv_qrcode_delete(lv_obj_t * qrcode); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_QRCODE*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*LV_QRCODE_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/libs/qrcode/qrcodegen.c b/L3_Middlewares/LVGL/src/extra/libs/qrcode/qrcodegen.c new file mode 100644 index 0000000..bd9f08b --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/qrcode/qrcodegen.c @@ -0,0 +1,1035 @@ +/* + * QR Code generator library (C) + * + * Copyright (c) Project Nayuki. (MIT License) + * https://www.nayuki.io/page/qr-code-generator-library + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * - The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * - The Software is provided "as is", without warranty of any kind, express or + * implied, including but not limited to the warranties of merchantability, + * fitness for a particular purpose and noninfringement. In no event shall the + * authors or copyright holders be liable for any claim, damages or other + * liability, whether in an action of contract, tort or otherwise, arising from, + * out of or in connection with the Software or the use or other dealings in the + * Software. + */ + +#include +#include +#include +#include "qrcodegen.h" +#include "../../../misc/lv_assert.h" + +#ifndef QRCODEGEN_TEST + #define testable static // Keep functions private +#else + #define testable // Expose private functions +#endif + + +/*---- Forward declarations for private functions ----*/ + +// Regarding all public and private functions defined in this source file: +// - They require all pointer/array arguments to be not null unless the array length is zero. +// - They only read input scalar/array arguments, write to output pointer/array +// arguments, and return scalar values; they are "pure" functions. +// - They don't read mutable global variables or write to any global variables. +// - They don't perform I/O, read the clock, print to console, etc. +// - They allocate a small and constant amount of stack memory. +// - They don't allocate or free any memory on the heap. +// - They don't recurse or mutually recurse. All the code +// could be inlined into the top-level public functions. +// - They run in at most quadratic time with respect to input arguments. +// Most functions run in linear time, and some in constant time. +// There are no unbounded loops or non-obvious termination conditions. +// - They are completely thread-safe if the caller does not give the +// same writable buffer to concurrent calls to these functions. + +testable void appendBitsToBuffer(unsigned int val, int numBits, uint8_t buffer[], int *bitLen); + +testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]); +testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl); +testable int getNumRawDataModules(int ver); + +testable void calcReedSolomonGenerator(int degree, uint8_t result[]); +testable void calcReedSolomonRemainder(const uint8_t data[], int dataLen, + const uint8_t generator[], int degree, uint8_t result[]); +testable uint8_t finiteFieldMultiply(uint8_t x, uint8_t y); + +testable void initializeFunctionModules(int version, uint8_t qrcode[]); +static void drawWhiteFunctionModules(uint8_t qrcode[], int version); +static void drawFormatBits(enum qrcodegen_Ecc ecl, enum qrcodegen_Mask mask, uint8_t qrcode[]); +testable int getAlignmentPatternPositions(int version, uint8_t result[7]); +static void fillRectangle(int left, int top, int width, int height, uint8_t qrcode[]); + +static void drawCodewords(const uint8_t data[], int dataLen, uint8_t qrcode[]); +static void applyMask(const uint8_t functionModules[], uint8_t qrcode[], enum qrcodegen_Mask mask); +static long getPenaltyScore(const uint8_t qrcode[]); +static void addRunToHistory(unsigned char run, unsigned char history[7]); +static bool hasFinderLikePattern(const unsigned char runHistory[7]); + +testable bool getModule(const uint8_t qrcode[], int x, int y); +testable void setModule(uint8_t qrcode[], int x, int y, bool isBlack); +testable void setModuleBounded(uint8_t qrcode[], int x, int y, bool isBlack); +static bool getBit(int x, int i); + +testable int calcSegmentBitLength(enum qrcodegen_Mode mode, size_t numChars); +testable int getTotalBits(const struct qrcodegen_Segment segs[], size_t len, int version); +static int numCharCountBits(enum qrcodegen_Mode mode, int version); + + + +/*---- Private tables of constants ----*/ + +// The set of all legal characters in alphanumeric mode, where each character +// value maps to the index in the string. For checking text and encoding segments. +static const char *ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"; + +// For generating error correction codes. +testable const int8_t ECC_CODEWORDS_PER_BLOCK[4][41] = { + // Version: (note that index 0 is for padding, and is set to an illegal value) + //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level + {-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // Low + {-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28}, // Medium + {-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // Quartile + {-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // High +}; + +#define qrcodegen_REED_SOLOMON_DEGREE_MAX 30 // Based on the table above + +// For generating error correction codes. +testable const int8_t NUM_ERROR_CORRECTION_BLOCKS[4][41] = { + // Version: (note that index 0 is for padding, and is set to an illegal value) + //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level + {-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25}, // Low + {-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49}, // Medium + {-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68}, // Quartile + {-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81}, // High +}; + +// For automatic mask pattern selection. +static const int PENALTY_N1 = 3; +static const int PENALTY_N2 = 3; +static const int PENALTY_N3 = 40; +static const int PENALTY_N4 = 10; + + + +/*---- High-level QR Code encoding functions ----*/ + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeText(const char *text, uint8_t tempBuffer[], uint8_t qrcode[], + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl) { + + size_t textLen = strlen(text); + if (textLen == 0) + return qrcodegen_encodeSegmentsAdvanced(NULL, 0, ecl, minVersion, maxVersion, mask, boostEcl, tempBuffer, qrcode); + size_t bufLen = qrcodegen_BUFFER_LEN_FOR_VERSION(maxVersion); + + struct qrcodegen_Segment seg; + if (qrcodegen_isNumeric(text)) { + if (qrcodegen_calcSegmentBufferSize(qrcodegen_Mode_NUMERIC, textLen) > bufLen) + goto fail; + seg = qrcodegen_makeNumeric(text, tempBuffer); + } else if (qrcodegen_isAlphanumeric(text)) { + if (qrcodegen_calcSegmentBufferSize(qrcodegen_Mode_ALPHANUMERIC, textLen) > bufLen) + goto fail; + seg = qrcodegen_makeAlphanumeric(text, tempBuffer); + } else { + if (textLen > bufLen) + goto fail; + for (size_t i = 0; i < textLen; i++) + tempBuffer[i] = (uint8_t)text[i]; + seg.mode = qrcodegen_Mode_BYTE; + seg.bitLength = calcSegmentBitLength(seg.mode, textLen); + if (seg.bitLength == -1) + goto fail; + seg.numChars = (int)textLen; + seg.data = tempBuffer; + } + return qrcodegen_encodeSegmentsAdvanced(&seg, 1, ecl, minVersion, maxVersion, mask, boostEcl, tempBuffer, qrcode); + +fail: + qrcode[0] = 0; // Set size to invalid value for safety + return false; +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeBinary(uint8_t dataAndTemp[], size_t dataLen, uint8_t qrcode[], + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl) { + + struct qrcodegen_Segment seg; + seg.mode = qrcodegen_Mode_BYTE; + seg.bitLength = calcSegmentBitLength(seg.mode, dataLen); + if (seg.bitLength == -1) { + qrcode[0] = 0; // Set size to invalid value for safety + return false; + } + seg.numChars = (int)dataLen; + seg.data = dataAndTemp; + return qrcodegen_encodeSegmentsAdvanced(&seg, 1, ecl, minVersion, maxVersion, mask, boostEcl, dataAndTemp, qrcode); +} + + +// Appends the given number of low-order bits of the given value to the given byte-based +// bit buffer, increasing the bit length. Requires 0 <= numBits <= 16 and val < 2^numBits. +testable void appendBitsToBuffer(unsigned int val, int numBits, uint8_t buffer[], int *bitLen) { + LV_ASSERT(0 <= numBits && numBits <= 16 && (unsigned long)val >> numBits == 0); + for (int i = numBits - 1; i >= 0; i--, (*bitLen)++) + buffer[*bitLen >> 3] |= ((val >> i) & 1) << (7 - (*bitLen & 7)); +} + + + +/*---- Low-level QR Code encoding functions ----*/ + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeSegments(const struct qrcodegen_Segment segs[], size_t len, + enum qrcodegen_Ecc ecl, uint8_t tempBuffer[], uint8_t qrcode[]) { + return qrcodegen_encodeSegmentsAdvanced(segs, len, ecl, + qrcodegen_VERSION_MIN, qrcodegen_VERSION_MAX, -1, true, tempBuffer, qrcode); +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeSegmentsAdvanced(const struct qrcodegen_Segment segs[], size_t len, enum qrcodegen_Ecc ecl, + int minVersion, int maxVersion, int mask, bool boostEcl, uint8_t tempBuffer[], uint8_t qrcode[]) { + LV_ASSERT(segs != NULL || len == 0); + LV_ASSERT(qrcodegen_VERSION_MIN <= minVersion && minVersion <= maxVersion && maxVersion <= qrcodegen_VERSION_MAX); + LV_ASSERT(0 <= (int)ecl && (int)ecl <= 3 && -1 <= (int)mask && (int)mask <= 7); + + // Find the minimal version number to use + int version, dataUsedBits; + for (version = minVersion; ; version++) { + int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; // Number of data bits available + dataUsedBits = getTotalBits(segs, len, version); + if (dataUsedBits != -1 && dataUsedBits <= dataCapacityBits) + break; // This version number is found to be suitable + if (version >= maxVersion) { // All versions in the range could not fit the given data + qrcode[0] = 0; // Set size to invalid value for safety + return false; + } + } + LV_ASSERT(dataUsedBits != -1); + + // Increase the error correction level while the data still fits in the current version number + for (int i = (int)qrcodegen_Ecc_MEDIUM; i <= (int)qrcodegen_Ecc_HIGH; i++) { // From low to high + if (boostEcl && dataUsedBits <= getNumDataCodewords(version, (enum qrcodegen_Ecc)i) * 8) + ecl = (enum qrcodegen_Ecc)i; + } + + // Concatenate all segments to create the data bit string + memset(qrcode, 0, qrcodegen_BUFFER_LEN_FOR_VERSION(version) * sizeof(qrcode[0])); + int bitLen = 0; + for (size_t i = 0; i < len; i++) { + const struct qrcodegen_Segment *seg = &segs[i]; + appendBitsToBuffer((int)seg->mode, 4, qrcode, &bitLen); + appendBitsToBuffer(seg->numChars, numCharCountBits(seg->mode, version), qrcode, &bitLen); + for (int j = 0; j < seg->bitLength; j++) + appendBitsToBuffer((seg->data[j >> 3] >> (7 - (j & 7))) & 1, 1, qrcode, &bitLen); + } + LV_ASSERT(bitLen == dataUsedBits); + + // Add terminator and pad up to a byte if applicable + int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; + LV_ASSERT(bitLen <= dataCapacityBits); + int terminatorBits = dataCapacityBits - bitLen; + if (terminatorBits > 4) + terminatorBits = 4; + appendBitsToBuffer(0, terminatorBits, qrcode, &bitLen); + appendBitsToBuffer(0, (8 - bitLen % 8) % 8, qrcode, &bitLen); + LV_ASSERT(bitLen % 8 == 0); + + // Pad with alternating bytes until data capacity is reached + for (uint8_t padByte = 0xEC; bitLen < dataCapacityBits; padByte ^= 0xEC ^ 0x11) + appendBitsToBuffer(padByte, 8, qrcode, &bitLen); + + // Draw function and data codeword modules + addEccAndInterleave(qrcode, version, ecl, tempBuffer); + initializeFunctionModules(version, qrcode); + drawCodewords(tempBuffer, getNumRawDataModules(version) / 8, qrcode); + drawWhiteFunctionModules(qrcode, version); + initializeFunctionModules(version, tempBuffer); + + // Handle masking + if (mask == qrcodegen_Mask_AUTO) { // Automatically choose best mask + long minPenalty = LONG_MAX; + for (int i = 0; i < 8; i++) { + enum qrcodegen_Mask msk = (enum qrcodegen_Mask)i; + applyMask(tempBuffer, qrcode, msk); + drawFormatBits(ecl, msk, qrcode); + long penalty = getPenaltyScore(qrcode); + if (penalty < minPenalty) { + mask = msk; + minPenalty = penalty; + } + applyMask(tempBuffer, qrcode, msk); // Undoes the mask due to XOR + } + } + LV_ASSERT(0 <= (int)mask && (int)mask <= 7); + applyMask(tempBuffer, qrcode, mask); + drawFormatBits(ecl, mask, qrcode); + return true; +} + + + +/*---- Error correction code generation functions ----*/ + +// Appends error correction bytes to each block of the given data array, then interleaves +// bytes from the blocks and stores them in the result array. data[0 : dataLen] contains +// the input data. data[dataLen : rawCodewords] is used as a temporary work area and will +// be clobbered by this function. The final answer is stored in result[0 : rawCodewords]. +testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]) { + // Calculate parameter numbers + LV_ASSERT(0 <= (int)ecl && (int)ecl < 4 && qrcodegen_VERSION_MIN <= version && version <= qrcodegen_VERSION_MAX); + int numBlocks = NUM_ERROR_CORRECTION_BLOCKS[(int)ecl][version]; + int blockEccLen = ECC_CODEWORDS_PER_BLOCK [(int)ecl][version]; + int rawCodewords = getNumRawDataModules(version) / 8; + int dataLen = getNumDataCodewords(version, ecl); + int numShortBlocks = numBlocks - rawCodewords % numBlocks; + int shortBlockDataLen = rawCodewords / numBlocks - blockEccLen; + + // Split data into blocks, calculate ECC, and interleave + // (not concatenate) the bytes into a single sequence + uint8_t generator[qrcodegen_REED_SOLOMON_DEGREE_MAX]; + calcReedSolomonGenerator(blockEccLen, generator); + const uint8_t *dat = data; + for (int i = 0; i < numBlocks; i++) { + int datLen = shortBlockDataLen + (i < numShortBlocks ? 0 : 1); + uint8_t *ecc = &data[dataLen]; // Temporary storage + calcReedSolomonRemainder(dat, datLen, generator, blockEccLen, ecc); + for (int j = 0, k = i; j < datLen; j++, k += numBlocks) { // Copy data + if (j == shortBlockDataLen) + k -= numShortBlocks; + result[k] = dat[j]; + } + for (int j = 0, k = dataLen + i; j < blockEccLen; j++, k += numBlocks) // Copy ECC + result[k] = ecc[j]; + dat += datLen; + } +} + + +// Returns the number of 8-bit codewords that can be used for storing data (not ECC), +// for the given version number and error correction level. The result is in the range [9, 2956]. +testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl) { + int v = version, e = (int)ecl; + LV_ASSERT(0 <= e && e < 4); + return getNumRawDataModules(v) / 8 + - ECC_CODEWORDS_PER_BLOCK [e][v] + * NUM_ERROR_CORRECTION_BLOCKS[e][v]; +} + + +// Returns the number of data bits that can be stored in a QR Code of the given version number, after +// all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. +// The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table. +testable int getNumRawDataModules(int ver) { + LV_ASSERT(qrcodegen_VERSION_MIN <= ver && ver <= qrcodegen_VERSION_MAX); + int result = (16 * ver + 128) * ver + 64; + if (ver >= 2) { + int numAlign = ver / 7 + 2; + result -= (25 * numAlign - 10) * numAlign - 55; + if (ver >= 7) + result -= 36; + } + return result; +} + + + +/*---- Reed-Solomon ECC generator functions ----*/ + +// Calculates the Reed-Solomon generator polynomial of the given degree, storing in result[0 : degree]. +testable void calcReedSolomonGenerator(int degree, uint8_t result[]) { + // Start with the monomial x^0 + LV_ASSERT(1 <= degree && degree <= qrcodegen_REED_SOLOMON_DEGREE_MAX); + memset(result, 0, degree * sizeof(result[0])); + result[degree - 1] = 1; + + // Compute the product polynomial (x - r^0) * (x - r^1) * (x - r^2) * ... * (x - r^{degree-1}), + // drop the highest term, and store the rest of the coefficients in order of descending powers. + // Note that r = 0x02, which is a generator element of this field GF(2^8/0x11D). + uint8_t root = 1; + for (int i = 0; i < degree; i++) { + // Multiply the current product by (x - r^i) + for (int j = 0; j < degree; j++) { + result[j] = finiteFieldMultiply(result[j], root); + if (j + 1 < degree) + result[j] ^= result[j + 1]; + } + root = finiteFieldMultiply(root, 0x02); + } +} + + +// Calculates the remainder of the polynomial data[0 : dataLen] when divided by the generator[0 : degree], where all +// polynomials are in big endian and the generator has an implicit leading 1 term, storing the result in result[0 : degree]. +testable void calcReedSolomonRemainder(const uint8_t data[], int dataLen, + const uint8_t generator[], int degree, uint8_t result[]) { + + // Perform polynomial division + LV_ASSERT(1 <= degree && degree <= qrcodegen_REED_SOLOMON_DEGREE_MAX); + memset(result, 0, degree * sizeof(result[0])); + for (int i = 0; i < dataLen; i++) { + uint8_t factor = data[i] ^ result[0]; + memmove(&result[0], &result[1], (degree - 1) * sizeof(result[0])); + result[degree - 1] = 0; + for (int j = 0; j < degree; j++) + result[j] ^= finiteFieldMultiply(generator[j], factor); + } +} + +#undef qrcodegen_REED_SOLOMON_DEGREE_MAX + + +// Returns the product of the two given field elements modulo GF(2^8/0x11D). +// All inputs are valid. This could be implemented as a 256*256 lookup table. +testable uint8_t finiteFieldMultiply(uint8_t x, uint8_t y) { + // Russian peasant multiplication + uint8_t z = 0; + for (int i = 7; i >= 0; i--) { + z = (z << 1) ^ ((z >> 7) * 0x11D); + z ^= ((y >> i) & 1) * x; + } + return z; +} + + + +/*---- Drawing function modules ----*/ + +// Clears the given QR Code grid with white modules for the given +// version's size, then marks every function module as black. +testable void initializeFunctionModules(int version, uint8_t qrcode[]) { + // Initialize QR Code + int qrsize = version * 4 + 17; + memset(qrcode, 0, ((qrsize * qrsize + 7) / 8 + 1) * sizeof(qrcode[0])); + qrcode[0] = (uint8_t)qrsize; + + // Fill horizontal and vertical timing patterns + fillRectangle(6, 0, 1, qrsize, qrcode); + fillRectangle(0, 6, qrsize, 1, qrcode); + + // Fill 3 finder patterns (all corners except bottom right) and format bits + fillRectangle(0, 0, 9, 9, qrcode); + fillRectangle(qrsize - 8, 0, 8, 9, qrcode); + fillRectangle(0, qrsize - 8, 9, 8, qrcode); + + // Fill numerous alignment patterns + uint8_t alignPatPos[7]; + int numAlign = getAlignmentPatternPositions(version, alignPatPos); + for (int i = 0; i < numAlign; i++) { + for (int j = 0; j < numAlign; j++) { + // Don't draw on the three finder corners + if (!((i == 0 && j == 0) || (i == 0 && j == numAlign - 1) || (i == numAlign - 1 && j == 0))) + fillRectangle(alignPatPos[i] - 2, alignPatPos[j] - 2, 5, 5, qrcode); + } + } + + // Fill version blocks + if (version >= 7) { + fillRectangle(qrsize - 11, 0, 3, 6, qrcode); + fillRectangle(0, qrsize - 11, 6, 3, qrcode); + } +} + + +// Draws white function modules and possibly some black modules onto the given QR Code, without changing +// non-function modules. This does not draw the format bits. This requires all function modules to be previously +// marked black (namely by initializeFunctionModules()), because this may skip redrawing black function modules. +static void drawWhiteFunctionModules(uint8_t qrcode[], int version) { + // Draw horizontal and vertical timing patterns + int qrsize = qrcodegen_getSize(qrcode); + for (int i = 7; i < qrsize - 7; i += 2) { + setModule(qrcode, 6, i, false); + setModule(qrcode, i, 6, false); + } + + // Draw 3 finder patterns (all corners except bottom right; overwrites some timing modules) + for (int dy = -4; dy <= 4; dy++) { + for (int dx = -4; dx <= 4; dx++) { + int dist = abs(dx); + if (abs(dy) > dist) + dist = abs(dy); + if (dist == 2 || dist == 4) { + setModuleBounded(qrcode, 3 + dx, 3 + dy, false); + setModuleBounded(qrcode, qrsize - 4 + dx, 3 + dy, false); + setModuleBounded(qrcode, 3 + dx, qrsize - 4 + dy, false); + } + } + } + + // Draw numerous alignment patterns + uint8_t alignPatPos[7]; + int numAlign = getAlignmentPatternPositions(version, alignPatPos); + for (int i = 0; i < numAlign; i++) { + for (int j = 0; j < numAlign; j++) { + if ((i == 0 && j == 0) || (i == 0 && j == numAlign - 1) || (i == numAlign - 1 && j == 0)) + continue; // Don't draw on the three finder corners + for (int dy = -1; dy <= 1; dy++) { + for (int dx = -1; dx <= 1; dx++) + setModule(qrcode, alignPatPos[i] + dx, alignPatPos[j] + dy, dx == 0 && dy == 0); + } + } + } + + // Draw version blocks + if (version >= 7) { + // Calculate error correction code and pack bits + int rem = version; // version is uint6, in the range [7, 40] + for (int i = 0; i < 12; i++) + rem = (rem << 1) ^ ((rem >> 11) * 0x1F25); + long bits = (long)version << 12 | rem; // uint18 + LV_ASSERT(bits >> 18 == 0); + + // Draw two copies + for (int i = 0; i < 6; i++) { + for (int j = 0; j < 3; j++) { + int k = qrsize - 11 + j; + setModule(qrcode, k, i, (bits & 1) != 0); + setModule(qrcode, i, k, (bits & 1) != 0); + bits >>= 1; + } + } + } +} + + +// Draws two copies of the format bits (with its own error correction code) based +// on the given mask and error correction level. This always draws all modules of +// the format bits, unlike drawWhiteFunctionModules() which might skip black modules. +static void drawFormatBits(enum qrcodegen_Ecc ecl, enum qrcodegen_Mask mask, uint8_t qrcode[]) { + // Calculate error correction code and pack bits + LV_ASSERT(0 <= (int)mask && (int)mask <= 7); + static const int table[] = {1, 0, 3, 2}; + int data = table[(int)ecl] << 3 | (int)mask; // errCorrLvl is uint2, mask is uint3 + int rem = data; + for (int i = 0; i < 10; i++) + rem = (rem << 1) ^ ((rem >> 9) * 0x537); + int bits = (data << 10 | rem) ^ 0x5412; // uint15 + LV_ASSERT(bits >> 15 == 0); + + // Draw first copy + for (int i = 0; i <= 5; i++) + setModule(qrcode, 8, i, getBit(bits, i)); + setModule(qrcode, 8, 7, getBit(bits, 6)); + setModule(qrcode, 8, 8, getBit(bits, 7)); + setModule(qrcode, 7, 8, getBit(bits, 8)); + for (int i = 9; i < 15; i++) + setModule(qrcode, 14 - i, 8, getBit(bits, i)); + + // Draw second copy + int qrsize = qrcodegen_getSize(qrcode); + for (int i = 0; i < 8; i++) + setModule(qrcode, qrsize - 1 - i, 8, getBit(bits, i)); + for (int i = 8; i < 15; i++) + setModule(qrcode, 8, qrsize - 15 + i, getBit(bits, i)); + setModule(qrcode, 8, qrsize - 8, true); // Always black +} + + +// Calculates and stores an ascending list of positions of alignment patterns +// for this version number, returning the length of the list (in the range [0,7]). +// Each position is in the range [0,177), and are used on both the x and y axes. +// This could be implemented as lookup table of 40 variable-length lists of unsigned bytes. +testable int getAlignmentPatternPositions(int version, uint8_t result[7]) { + if (version == 1) + return 0; + int numAlign = version / 7 + 2; + int step = (version == 32) ? 26 : + (version*4 + numAlign*2 + 1) / (numAlign*2 - 2) * 2; + for (int i = numAlign - 1, pos = version * 4 + 10; i >= 1; i--, pos -= step) + result[i] = pos; + result[0] = 6; + return numAlign; +} + + +// Sets every pixel in the range [left : left + width] * [top : top + height] to black. +static void fillRectangle(int left, int top, int width, int height, uint8_t qrcode[]) { + for (int dy = 0; dy < height; dy++) { + for (int dx = 0; dx < width; dx++) + setModule(qrcode, left + dx, top + dy, true); + } +} + + + +/*---- Drawing data modules and masking ----*/ + +// Draws the raw codewords (including data and ECC) onto the given QR Code. This requires the initial state of +// the QR Code to be black at function modules and white at codeword modules (including unused remainder bits). +static void drawCodewords(const uint8_t data[], int dataLen, uint8_t qrcode[]) { + int qrsize = qrcodegen_getSize(qrcode); + int i = 0; // Bit index into the data + // Do the funny zigzag scan + for (int right = qrsize - 1; right >= 1; right -= 2) { // Index of right column in each column pair + if (right == 6) + right = 5; + for (int vert = 0; vert < qrsize; vert++) { // Vertical counter + for (int j = 0; j < 2; j++) { + int x = right - j; // Actual x coordinate + bool upward = ((right + 1) & 2) == 0; + int y = upward ? qrsize - 1 - vert : vert; // Actual y coordinate + if (!getModule(qrcode, x, y) && i < dataLen * 8) { + bool black = getBit(data[i >> 3], 7 - (i & 7)); + setModule(qrcode, x, y, black); + i++; + } + // If this QR Code has any remainder bits (0 to 7), they were assigned as + // 0/false/white by the constructor and are left unchanged by this method + } + } + } + LV_ASSERT(i == dataLen * 8); +} + + +// XORs the codeword modules in this QR Code with the given mask pattern. +// The function modules must be marked and the codeword bits must be drawn +// before masking. Due to the arithmetic of XOR, calling applyMask() with +// the same mask value a second time will undo the mask. A final well-formed +// QR Code needs exactly one (not zero, two, etc.) mask applied. +static void applyMask(const uint8_t functionModules[], uint8_t qrcode[], enum qrcodegen_Mask mask) { + LV_ASSERT(0 <= (int)mask && (int)mask <= 7); // Disallows qrcodegen_Mask_AUTO + int qrsize = qrcodegen_getSize(qrcode); + for (int y = 0; y < qrsize; y++) { + for (int x = 0; x < qrsize; x++) { + if (getModule(functionModules, x, y)) + continue; + bool invert; + switch ((int)mask) { + case 0: invert = (x + y) % 2 == 0; break; + case 1: invert = y % 2 == 0; break; + case 2: invert = x % 3 == 0; break; + case 3: invert = (x + y) % 3 == 0; break; + case 4: invert = (x / 3 + y / 2) % 2 == 0; break; + case 5: invert = x * y % 2 + x * y % 3 == 0; break; + case 6: invert = (x * y % 2 + x * y % 3) % 2 == 0; break; + case 7: invert = ((x + y) % 2 + x * y % 3) % 2 == 0; break; + default: LV_ASSERT(false); return; + } + bool val = getModule(qrcode, x, y); + setModule(qrcode, x, y, val ^ invert); + } + } +} + + +// Calculates and returns the penalty score based on state of the given QR Code's current modules. +// This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score. +static long getPenaltyScore(const uint8_t qrcode[]) { + int qrsize = qrcodegen_getSize(qrcode); + long result = 0; + + // Adjacent modules in row having same color, and finder-like patterns + for (int y = 0; y < qrsize; y++) { + unsigned char runHistory[7] = {0}; + bool color = false; + unsigned char runX = 0; + for (int x = 0; x < qrsize; x++) { + if (getModule(qrcode, x, y) == color) { + runX++; + if (runX == 5) + result += PENALTY_N1; + else if (runX > 5) + result++; + } else { + addRunToHistory(runX, runHistory); + if (!color && hasFinderLikePattern(runHistory)) + result += PENALTY_N3; + color = getModule(qrcode, x, y); + runX = 1; + } + } + addRunToHistory(runX, runHistory); + if (color) + addRunToHistory(0, runHistory); // Dummy run of white + if (hasFinderLikePattern(runHistory)) + result += PENALTY_N3; + } + // Adjacent modules in column having same color, and finder-like patterns + for (int x = 0; x < qrsize; x++) { + unsigned char runHistory[7] = {0}; + bool color = false; + unsigned char runY = 0; + for (int y = 0; y < qrsize; y++) { + if (getModule(qrcode, x, y) == color) { + runY++; + if (runY == 5) + result += PENALTY_N1; + else if (runY > 5) + result++; + } else { + addRunToHistory(runY, runHistory); + if (!color && hasFinderLikePattern(runHistory)) + result += PENALTY_N3; + color = getModule(qrcode, x, y); + runY = 1; + } + } + addRunToHistory(runY, runHistory); + if (color) + addRunToHistory(0, runHistory); // Dummy run of white + if (hasFinderLikePattern(runHistory)) + result += PENALTY_N3; + } + + // 2*2 blocks of modules having same color + for (int y = 0; y < qrsize - 1; y++) { + for (int x = 0; x < qrsize - 1; x++) { + bool color = getModule(qrcode, x, y); + if ( color == getModule(qrcode, x + 1, y) && + color == getModule(qrcode, x, y + 1) && + color == getModule(qrcode, x + 1, y + 1)) + result += PENALTY_N2; + } + } + + // Balance of black and white modules + int black = 0; + for (int y = 0; y < qrsize; y++) { + for (int x = 0; x < qrsize; x++) { + if (getModule(qrcode, x, y)) + black++; + } + } + int total = qrsize * qrsize; // Note that size is odd, so black/total != 1/2 + // Compute the smallest integer k >= 0 such that (45-5k)% <= black/total <= (55+5k)% + int k = (int)((labs(black * 20L - total * 10L) + total - 1) / total) - 1; + result += k * PENALTY_N4; + return result; +} + + +// Inserts the given value to the front of the given array, which shifts over the +// existing values and deletes the last value. A helper function for getPenaltyScore(). +static void addRunToHistory(unsigned char run, unsigned char history[7]) { + memmove(&history[1], &history[0], 6 * sizeof(history[0])); + history[0] = run; +} + + +// Tests whether the given run history has the pattern of ratio 1:1:3:1:1 in the middle, and +// surrounded by at least 4 on either or both ends. A helper function for getPenaltyScore(). +// Must only be called immediately after a run of white modules has ended. +static bool hasFinderLikePattern(const unsigned char runHistory[7]) { + unsigned char n = runHistory[1]; + // The maximum QR Code size is 177, hence the run length n <= 177. + // Arithmetic is promoted to int, so n*4 will not overflow. + return n > 0 && runHistory[2] == n && runHistory[4] == n && runHistory[5] == n + && runHistory[3] == n * 3 && (runHistory[0] >= n * 4 || runHistory[6] >= n * 4); +} + + + +/*---- Basic QR Code information ----*/ + +// Public function - see documentation comment in header file. +int qrcodegen_getSize(const uint8_t qrcode[]) { + LV_ASSERT(qrcode != NULL); + int result = qrcode[0]; + LV_ASSERT((qrcodegen_VERSION_MIN * 4 + 17) <= result + && result <= (qrcodegen_VERSION_MAX * 4 + 17)); + return result; +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_getModule(const uint8_t qrcode[], int x, int y) { + LV_ASSERT(qrcode != NULL); + int qrsize = qrcode[0]; + return (0 <= x && x < qrsize && 0 <= y && y < qrsize) && getModule(qrcode, x, y); +} + + +// Gets the module at the given coordinates, which must be in bounds. +testable bool getModule(const uint8_t qrcode[], int x, int y) { + int qrsize = qrcode[0]; + LV_ASSERT(21 <= qrsize && qrsize <= 177 && 0 <= x && x < qrsize && 0 <= y && y < qrsize); + int index = y * qrsize + x; + return getBit(qrcode[(index >> 3) + 1], index & 7); +} + + +// Sets the module at the given coordinates, which must be in bounds. +testable void setModule(uint8_t qrcode[], int x, int y, bool isBlack) { + int qrsize = qrcode[0]; + LV_ASSERT(21 <= qrsize && qrsize <= 177 && 0 <= x && x < qrsize && 0 <= y && y < qrsize); + int index = y * qrsize + x; + int bitIndex = index & 7; + int byteIndex = (index >> 3) + 1; + if (isBlack) + qrcode[byteIndex] |= 1 << bitIndex; + else + qrcode[byteIndex] &= (1 << bitIndex) ^ 0xFF; +} + + +// Sets the module at the given coordinates, doing nothing if out of bounds. +testable void setModuleBounded(uint8_t qrcode[], int x, int y, bool isBlack) { + int qrsize = qrcode[0]; + if (0 <= x && x < qrsize && 0 <= y && y < qrsize) + setModule(qrcode, x, y, isBlack); +} + + +// Returns true iff the i'th bit of x is set to 1. Requires x >= 0 and 0 <= i <= 14. +static bool getBit(int x, int i) { + return ((x >> i) & 1) != 0; +} + + + +/*---- Segment handling ----*/ + +// Public function - see documentation comment in header file. +bool qrcodegen_isAlphanumeric(const char *text) { + LV_ASSERT(text != NULL); + for (; *text != '\0'; text++) { + if (strchr(ALPHANUMERIC_CHARSET, *text) == NULL) + return false; + } + return true; +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_isNumeric(const char *text) { + LV_ASSERT(text != NULL); + for (; *text != '\0'; text++) { + if (*text < '0' || *text > '9') + return false; + } + return true; +} + + +// Public function - see documentation comment in header file. +size_t qrcodegen_calcSegmentBufferSize(enum qrcodegen_Mode mode, size_t numChars) { + int temp = calcSegmentBitLength(mode, numChars); + if (temp == -1) + return SIZE_MAX; + LV_ASSERT(0 <= temp && temp <= INT16_MAX); + return ((size_t)temp + 7) / 8; +} + + +// Returns the number of data bits needed to represent a segment +// containing the given number of characters using the given mode. Notes: +// - Returns -1 on failure, i.e. numChars > INT16_MAX or +// the number of needed bits exceeds INT16_MAX (i.e. 32767). +// - Otherwise, all valid results are in the range [0, INT16_MAX]. +// - For byte mode, numChars measures the number of bytes, not Unicode code points. +// - For ECI mode, numChars must be 0, and the worst-case number of bits is returned. +// An actual ECI segment can have shorter data. For non-ECI modes, the result is exact. +testable int calcSegmentBitLength(enum qrcodegen_Mode mode, size_t numChars) { + // All calculations are designed to avoid overflow on all platforms + if (numChars > (unsigned int)INT16_MAX) + return -1; + long result = (long)numChars; + if (mode == qrcodegen_Mode_NUMERIC) + result = (result * 10 + 2) / 3; // ceil(10/3 * n) + else if (mode == qrcodegen_Mode_ALPHANUMERIC) + result = (result * 11 + 1) / 2; // ceil(11/2 * n) + else if (mode == qrcodegen_Mode_BYTE) + result *= 8; + else if (mode == qrcodegen_Mode_KANJI) + result *= 13; + else if (mode == qrcodegen_Mode_ECI && numChars == 0) + result = 3 * 8; + else { // Invalid argument + LV_ASSERT(false); + return -1; + } + LV_ASSERT(result >= 0); + if ((unsigned int)result > (unsigned int)INT16_MAX) + return -1; + return (int)result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeBytes(const uint8_t data[], size_t len, uint8_t buf[]) { + LV_ASSERT(data != NULL || len == 0); + struct qrcodegen_Segment result; + result.mode = qrcodegen_Mode_BYTE; + result.bitLength = calcSegmentBitLength(result.mode, len); + LV_ASSERT(result.bitLength != -1); + result.numChars = (int)len; + if (len > 0) + memcpy(buf, data, len * sizeof(buf[0])); + result.data = buf; + return result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeNumeric(const char *digits, uint8_t buf[]) { + LV_ASSERT(digits != NULL); + struct qrcodegen_Segment result; + size_t len = strlen(digits); + result.mode = qrcodegen_Mode_NUMERIC; + int bitLen = calcSegmentBitLength(result.mode, len); + LV_ASSERT(bitLen != -1); + result.numChars = (int)len; + if (bitLen > 0) + memset(buf, 0, ((size_t)bitLen + 7) / 8 * sizeof(buf[0])); + result.bitLength = 0; + + unsigned int accumData = 0; + int accumCount = 0; + for (; *digits != '\0'; digits++) { + char c = *digits; + LV_ASSERT('0' <= c && c <= '9'); + accumData = accumData * 10 + (unsigned int)(c - '0'); + accumCount++; + if (accumCount == 3) { + appendBitsToBuffer(accumData, 10, buf, &result.bitLength); + accumData = 0; + accumCount = 0; + } + } + if (accumCount > 0) // 1 or 2 digits remaining + appendBitsToBuffer(accumData, accumCount * 3 + 1, buf, &result.bitLength); + LV_ASSERT(result.bitLength == bitLen); + result.data = buf; + return result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeAlphanumeric(const char *text, uint8_t buf[]) { + LV_ASSERT(text != NULL); + struct qrcodegen_Segment result; + size_t len = strlen(text); + result.mode = qrcodegen_Mode_ALPHANUMERIC; + int bitLen = calcSegmentBitLength(result.mode, len); + LV_ASSERT(bitLen != -1); + result.numChars = (int)len; + if (bitLen > 0) + memset(buf, 0, ((size_t)bitLen + 7) / 8 * sizeof(buf[0])); + result.bitLength = 0; + + unsigned int accumData = 0; + int accumCount = 0; + for (; *text != '\0'; text++) { + const char *temp = strchr(ALPHANUMERIC_CHARSET, *text); + LV_ASSERT(temp != NULL); + accumData = accumData * 45 + (unsigned int)(temp - ALPHANUMERIC_CHARSET); + accumCount++; + if (accumCount == 2) { + appendBitsToBuffer(accumData, 11, buf, &result.bitLength); + accumData = 0; + accumCount = 0; + } + } + if (accumCount > 0) // 1 character remaining + appendBitsToBuffer(accumData, 6, buf, &result.bitLength); + LV_ASSERT(result.bitLength == bitLen); + result.data = buf; + return result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeEci(long assignVal, uint8_t buf[]) { + struct qrcodegen_Segment result; + result.mode = qrcodegen_Mode_ECI; + result.numChars = 0; + result.bitLength = 0; + if (assignVal < 0) { + LV_ASSERT(false); + } else if (assignVal < (1 << 7)) { + memset(buf, 0, 1 * sizeof(buf[0])); + appendBitsToBuffer(assignVal, 8, buf, &result.bitLength); + } else if (assignVal < (1 << 14)) { + memset(buf, 0, 2 * sizeof(buf[0])); + appendBitsToBuffer(2, 2, buf, &result.bitLength); + appendBitsToBuffer(assignVal, 14, buf, &result.bitLength); + } else if (assignVal < 1000000L) { + memset(buf, 0, 3 * sizeof(buf[0])); + appendBitsToBuffer(6, 3, buf, &result.bitLength); + appendBitsToBuffer(assignVal >> 10, 11, buf, &result.bitLength); + appendBitsToBuffer(assignVal & 0x3FF, 10, buf, &result.bitLength); + } else { + LV_ASSERT(false); + } + result.data = buf; + return result; +} + + +// Calculates the number of bits needed to encode the given segments at the given version. +// Returns a non-negative number if successful. Otherwise returns -1 if a segment has too +// many characters to fit its length field, or the total bits exceeds INT16_MAX. +testable int getTotalBits(const struct qrcodegen_Segment segs[], size_t len, int version) { + LV_ASSERT(segs != NULL || len == 0); + long result = 0; + for (size_t i = 0; i < len; i++) { + int numChars = segs[i].numChars; + int bitLength = segs[i].bitLength; + LV_ASSERT(0 <= numChars && numChars <= INT16_MAX); + LV_ASSERT(0 <= bitLength && bitLength <= INT16_MAX); + int ccbits = numCharCountBits(segs[i].mode, version); + LV_ASSERT(0 <= ccbits && ccbits <= 16); + if (numChars >= (1L << ccbits)) + return -1; // The segment's length doesn't fit the field's bit width + result += 4L + ccbits + bitLength; + if (result > INT16_MAX) + return -1; // The sum might overflow an int type + } + LV_ASSERT(0 <= result && result <= INT16_MAX); + return (int)result; +} + + +// Returns the bit width of the character count field for a segment in the given mode +// in a QR Code at the given version number. The result is in the range [0, 16]. +static int numCharCountBits(enum qrcodegen_Mode mode, int version) { + LV_ASSERT(qrcodegen_VERSION_MIN <= version && version <= qrcodegen_VERSION_MAX); + int i = (version + 7) / 17; + switch (mode) { + case qrcodegen_Mode_NUMERIC : { static const int temp[] = {10, 12, 14}; return temp[i]; } + case qrcodegen_Mode_ALPHANUMERIC: { static const int temp[] = { 9, 11, 13}; return temp[i]; } + case qrcodegen_Mode_BYTE : { static const int temp[] = { 8, 16, 16}; return temp[i]; } + case qrcodegen_Mode_KANJI : { static const int temp[] = { 8, 10, 12}; return temp[i]; } + case qrcodegen_Mode_ECI : return 0; + default: LV_ASSERT(false); return -1; // Dummy value + } +} + +int qrcodegen_getMinFitVersion(enum qrcodegen_Ecc ecl, size_t dataLen) +{ + struct qrcodegen_Segment seg; + seg.mode = qrcodegen_Mode_BYTE; + seg.bitLength = calcSegmentBitLength(seg.mode, dataLen); + seg.numChars = (int)dataLen; + + for (int version = qrcodegen_VERSION_MIN; version <= qrcodegen_VERSION_MAX; version++) { + int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; // Number of data bits available + int dataUsedBits = getTotalBits(&seg, 1, version); + if (dataUsedBits != -1 && dataUsedBits <= dataCapacityBits) + return version; + } + return -1; +} + +int qrcodegen_version2size(int version) +{ + if (version < qrcodegen_VERSION_MIN || version > qrcodegen_VERSION_MAX) { + return -1; + } + + return ((version - 1)*4 + 21); +} diff --git a/L3_Middlewares/LVGL/src/libs/qrcode/qrcodegen.h b/L3_Middlewares/LVGL/src/extra/libs/qrcode/qrcodegen.h similarity index 82% rename from L3_Middlewares/LVGL/src/libs/qrcode/qrcodegen.h rename to L3_Middlewares/LVGL/src/extra/libs/qrcode/qrcodegen.h index 9509486..b484e91 100644 --- a/L3_Middlewares/LVGL/src/libs/qrcode/qrcodegen.h +++ b/L3_Middlewares/LVGL/src/extra/libs/qrcode/qrcodegen.h @@ -23,9 +23,6 @@ #pragma once -#include "../../../lvgl.h" -#ifdef LV_USE_QRCODE - #include #include #include @@ -58,12 +55,12 @@ extern "C" { * The error correction level in a QR Code symbol. */ enum qrcodegen_Ecc { - // Must be declared in ascending order of error protection - // so that an internal qrcodegen function works properly - qrcodegen_Ecc_LOW = 0, // The QR Code can tolerate about 7% erroneous codewords - qrcodegen_Ecc_MEDIUM, // The QR Code can tolerate about 15% erroneous codewords - qrcodegen_Ecc_QUARTILE, // The QR Code can tolerate about 25% erroneous codewords - qrcodegen_Ecc_HIGH, // The QR Code can tolerate about 30% erroneous codewords + // Must be declared in ascending order of error protection + // so that an internal qrcodegen function works properly + qrcodegen_Ecc_LOW = 0 , // The QR Code can tolerate about 7% erroneous codewords + qrcodegen_Ecc_MEDIUM , // The QR Code can tolerate about 15% erroneous codewords + qrcodegen_Ecc_QUARTILE, // The QR Code can tolerate about 25% erroneous codewords + qrcodegen_Ecc_HIGH , // The QR Code can tolerate about 30% erroneous codewords }; @@ -71,18 +68,18 @@ enum qrcodegen_Ecc { * The mask pattern used in a QR Code symbol. */ enum qrcodegen_Mask { - // A special value to tell the QR Code encoder to - // automatically select an appropriate mask pattern - qrcodegen_Mask_AUTO = -1, - // The eight actual mask patterns - qrcodegen_Mask_0 = 0, - qrcodegen_Mask_1, - qrcodegen_Mask_2, - qrcodegen_Mask_3, - qrcodegen_Mask_4, - qrcodegen_Mask_5, - qrcodegen_Mask_6, - qrcodegen_Mask_7, + // A special value to tell the QR Code encoder to + // automatically select an appropriate mask pattern + qrcodegen_Mask_AUTO = -1, + // The eight actual mask patterns + qrcodegen_Mask_0 = 0, + qrcodegen_Mask_1, + qrcodegen_Mask_2, + qrcodegen_Mask_3, + qrcodegen_Mask_4, + qrcodegen_Mask_5, + qrcodegen_Mask_6, + qrcodegen_Mask_7, }; @@ -90,11 +87,11 @@ enum qrcodegen_Mask { * Describes how a segment's data bits are interpreted. */ enum qrcodegen_Mode { - qrcodegen_Mode_NUMERIC = 0x1, - qrcodegen_Mode_ALPHANUMERIC = 0x2, - qrcodegen_Mode_BYTE = 0x4, - qrcodegen_Mode_KANJI = 0x8, - qrcodegen_Mode_ECI = 0x7, + qrcodegen_Mode_NUMERIC = 0x1, + qrcodegen_Mode_ALPHANUMERIC = 0x2, + qrcodegen_Mode_BYTE = 0x4, + qrcodegen_Mode_KANJI = 0x8, + qrcodegen_Mode_ECI = 0x7, }; @@ -110,22 +107,22 @@ enum qrcodegen_Mode { * the largest QR Code (version 40) has 31329 modules. */ struct qrcodegen_Segment { - // The mode indicator of this segment. - enum qrcodegen_Mode mode; - - // The length of this segment's unencoded data. Measured in characters for - // numeric/alphanumeric/kanji mode, bytes for byte mode, and 0 for ECI mode. - // Always zero or positive. Not the same as the data's bit length. - int numChars; - - // The data bits of this segment, packed in bitwise big endian. - // Can be null if the bit length is zero. - uint8_t * data; - - // The number of valid data bits used in the buffer. Requires - // 0 <= bitLength <= 32767, and bitLength <= (capacity of data array) * 8. - // The character count (numChars) must agree with the mode and the bit buffer length. - int bitLength; + // The mode indicator of this segment. + enum qrcodegen_Mode mode; + + // The length of this segment's unencoded data. Measured in characters for + // numeric/alphanumeric/kanji mode, bytes for byte mode, and 0 for ECI mode. + // Always zero or positive. Not the same as the data's bit length. + int numChars; + + // The data bits of this segment, packed in bitwise big endian. + // Can be null if the bit length is zero. + uint8_t *data; + + // The number of valid data bits used in the buffer. Requires + // 0 <= bitLength <= 32767, and bitLength <= (capacity of data array) * 8. + // The character count (numChars) must agree with the mode and the bit buffer length. + int bitLength; }; @@ -169,8 +166,8 @@ struct qrcodegen_Segment { * - Please consult the QR Code specification for information on * data capacities per version, ECC level, and text encoding mode. */ -bool qrcodegen_encodeText(const char * text, uint8_t tempBuffer[], uint8_t qrcode[], - enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl); +bool qrcodegen_encodeText(const char *text, uint8_t tempBuffer[], uint8_t qrcode[], + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl); /* @@ -192,7 +189,7 @@ bool qrcodegen_encodeText(const char * text, uint8_t tempBuffer[], uint8_t qrcod * data capacities per version, ECC level, and text encoding mode. */ bool qrcodegen_encodeBinary(uint8_t dataAndTemp[], size_t dataLen, uint8_t qrcode[], - enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl); + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl); /*---- Functions (low level) to generate QR Codes ----*/ @@ -210,7 +207,7 @@ bool qrcodegen_encodeBinary(uint8_t dataAndTemp[], size_t dataLen, uint8_t qrcod * But the qrcode array must not overlap tempBuffer or any segment's data buffer. */ bool qrcodegen_encodeSegments(const struct qrcodegen_Segment segs[], size_t len, - enum qrcodegen_Ecc ecl, uint8_t tempBuffer[], uint8_t qrcode[]); + enum qrcodegen_Ecc ecl, uint8_t tempBuffer[], uint8_t qrcode[]); /* @@ -229,7 +226,7 @@ bool qrcodegen_encodeSegments(const struct qrcodegen_Segment segs[], size_t len, * But the qrcode array must not overlap tempBuffer or any segment's data buffer. */ bool qrcodegen_encodeSegmentsAdvanced(const struct qrcodegen_Segment segs[], size_t len, enum qrcodegen_Ecc ecl, - int minVersion, int maxVersion, int mask, bool boostEcl, uint8_t tempBuffer[], uint8_t qrcode[]); + int minVersion, int maxVersion, int mask, bool boostEcl, uint8_t tempBuffer[], uint8_t qrcode[]); /* @@ -237,14 +234,14 @@ bool qrcodegen_encodeSegmentsAdvanced(const struct qrcodegen_Segment segs[], siz * A string is encodable iff each character is in the following set: 0 to 9, A to Z * (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon. */ -bool qrcodegen_isAlphanumeric(const char * text); +bool qrcodegen_isAlphanumeric(const char *text); /* * Tests whether the given string can be encoded as a segment in numeric mode. * A string is encodable iff each character is in the range 0 to 9. */ -bool qrcodegen_isNumeric(const char * text); +bool qrcodegen_isNumeric(const char *text); /* @@ -272,7 +269,7 @@ struct qrcodegen_Segment qrcodegen_makeBytes(const uint8_t data[], size_t len, u /* * Returns a segment representing the given string of decimal digits encoded in numeric mode. */ -struct qrcodegen_Segment qrcodegen_makeNumeric(const char * digits, uint8_t buf[]); +struct qrcodegen_Segment qrcodegen_makeNumeric(const char *digits, uint8_t buf[]); /* @@ -280,7 +277,7 @@ struct qrcodegen_Segment qrcodegen_makeNumeric(const char * digits, uint8_t buf[ * The characters allowed are: 0 to 9, A to Z (uppercase only), space, * dollar, percent, asterisk, plus, hyphen, period, slash, colon. */ -struct qrcodegen_Segment qrcodegen_makeAlphanumeric(const char * text, uint8_t buf[]); +struct qrcodegen_Segment qrcodegen_makeAlphanumeric(const char *text, uint8_t buf[]); /* @@ -320,5 +317,3 @@ int qrcodegen_getMinFitVersion(enum qrcodegen_Ecc ecl, size_t dataLen); #ifdef __cplusplus } #endif - -#endif diff --git a/L3_Middlewares/LVGL/src/libs/rlottie/lv_rlottie.c b/L3_Middlewares/LVGL/src/extra/libs/rlottie/lv_rlottie.c similarity index 58% rename from L3_Middlewares/LVGL/src/libs/rlottie/lv_rlottie.c rename to L3_Middlewares/LVGL/src/extra/libs/rlottie/lv_rlottie.c index 3c723ec..a264948 100644 --- a/L3_Middlewares/LVGL/src/libs/rlottie/lv_rlottie.c +++ b/L3_Middlewares/LVGL/src/extra/libs/rlottie/lv_rlottie.c @@ -6,18 +6,15 @@ /********************* * INCLUDES *********************/ -#include "../../lvgl.h" +#include "lv_rlottie.h" #if LV_USE_RLOTTIE -#include "lv_rlottie_private.h" -#include "../../core/lv_obj_class_private.h" #include -#include /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_rlottie_class) +#define MY_CLASS &lv_rlottie_class #define LV_ARGB32 32 /********************** @@ -35,24 +32,17 @@ static void next_frame_task_cb(lv_timer_t * t); /********************** * STATIC VARIABLES **********************/ - const lv_obj_class_t lv_rlottie_class = { .constructor_cb = lv_rlottie_constructor, .destructor_cb = lv_rlottie_destructor, .instance_size = sizeof(lv_rlottie_t), - .base_class = &lv_image_class, - .name = "rlottie", + .base_class = &lv_img_class }; -typedef struct { - int32_t width; - int32_t height; - const char * rlottie_desc; - const char * path; -} lv_rlottie_create_info_t; - -/*Only used in lv_obj_class_create_obj, no affect multiple instances*/ -static lv_rlottie_create_info_t create_info; +static lv_coord_t create_width; +static lv_coord_t create_height; +static const char * rlottie_desc_create; +static const char * path_create; /********************** * MACROS @@ -62,26 +52,29 @@ static lv_rlottie_create_info_t create_info; * GLOBAL FUNCTIONS **********************/ -lv_obj_t * lv_rlottie_create_from_file(lv_obj_t * parent, int32_t width, int32_t height, const char * path) +lv_obj_t * lv_rlottie_create_from_file(lv_obj_t * parent, lv_coord_t width, lv_coord_t height, const char * path) { - create_info.width = width; - create_info.height = height; - create_info.path = path; - create_info.rlottie_desc = NULL; + + create_width = width; + create_height = height; + path_create = path; + rlottie_desc_create = NULL; LV_LOG_INFO("begin"); lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); lv_obj_class_init_obj(obj); return obj; + } -lv_obj_t * lv_rlottie_create_from_raw(lv_obj_t * parent, int32_t width, int32_t height, const char * rlottie_desc) +lv_obj_t * lv_rlottie_create_from_raw(lv_obj_t * parent, lv_coord_t width, lv_coord_t height, const char * rlottie_desc) { - create_info.width = width; - create_info.height = height; - create_info.rlottie_desc = rlottie_desc; - create_info.path = NULL; + + create_width = width; + create_height = height; + rlottie_desc_create = rlottie_desc; + path_create = NULL; LV_LOG_INFO("begin"); lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); @@ -116,14 +109,14 @@ static void lv_rlottie_constructor(const lv_obj_class_t * class_p, lv_obj_t * ob LV_UNUSED(class_p); lv_rlottie_t * rlottie = (lv_rlottie_t *) obj; - if(create_info.rlottie_desc) { - rlottie->animation = lottie_animation_from_data(create_info.rlottie_desc, create_info.rlottie_desc, ""); + if(rlottie_desc_create) { + rlottie->animation = lottie_animation_from_data(rlottie_desc_create, rlottie_desc_create, ""); } - else if(create_info.path) { - rlottie->animation = lottie_animation_from_file(create_info.path); + else if(path_create) { + rlottie->animation = lottie_animation_from_file(path_create); } if(rlottie->animation == NULL) { - LV_LOG_WARN("The animation can't be opened"); + LV_LOG_WARN("The aniamtion can't be opened"); return; } @@ -131,22 +124,23 @@ static void lv_rlottie_constructor(const lv_obj_class_t * class_p, lv_obj_t * ob rlottie->framerate = (size_t)lottie_animation_get_framerate(rlottie->animation); rlottie->current_frame = 0; - rlottie->scanline_width = create_info.width * LV_ARGB32 / 8; + rlottie->scanline_width = create_width * LV_ARGB32 / 8; - size_t allocated_buf_size = (create_info.width * create_info.height * LV_ARGB32 / 8); - rlottie->allocated_buf = lv_malloc(allocated_buf_size); + size_t allocaled_buf_size = (create_width * create_height * LV_ARGB32 / 8); + rlottie->allocated_buf = lv_mem_alloc(allocaled_buf_size); if(rlottie->allocated_buf != NULL) { - rlottie->allocated_buffer_size = allocated_buf_size; - memset(rlottie->allocated_buf, 0, allocated_buf_size); + rlottie->allocated_buffer_size = allocaled_buf_size; + memset(rlottie->allocated_buf, 0, allocaled_buf_size); } - rlottie->imgdsc.header.cf = LV_COLOR_FORMAT_ARGB8888; - rlottie->imgdsc.header.h = create_info.height; - rlottie->imgdsc.header.w = create_info.width; + rlottie->imgdsc.header.always_zero = 0; + rlottie->imgdsc.header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA; + rlottie->imgdsc.header.h = create_height; + rlottie->imgdsc.header.w = create_width; rlottie->imgdsc.data = (void *)rlottie->allocated_buf; - rlottie->imgdsc.data_size = allocated_buf_size; + rlottie->imgdsc.data_size = allocaled_buf_size; - lv_image_set_src(obj, &rlottie->imgdsc); + lv_img_set_src(obj, &rlottie->imgdsc); rlottie->play_ctrl = LV_RLOTTIE_CTRL_FORWARD | LV_RLOTTIE_CTRL_PLAY | LV_RLOTTIE_CTRL_LOOP; rlottie->dest_frame = rlottie->total_frames; /* invalid destination frame so it's possible to pause on frame 0 */ @@ -156,6 +150,7 @@ static void lv_rlottie_constructor(const lv_obj_class_t * class_p, lv_obj_t * ob lv_obj_update_layout(obj); } + static void lv_rlottie_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { LV_UNUSED(class_p); @@ -171,25 +166,66 @@ static void lv_rlottie_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj } if(rlottie->task) { - lv_timer_delete(rlottie->task); + lv_timer_del(rlottie->task); rlottie->task = NULL; rlottie->play_ctrl = LV_RLOTTIE_CTRL_FORWARD; rlottie->dest_frame = 0; } - lv_image_cache_drop(&rlottie->imgdsc); - + lv_img_cache_invalidate_src(&rlottie->imgdsc); if(rlottie->allocated_buf) { - lv_free(rlottie->allocated_buf); + lv_mem_free(rlottie->allocated_buf); rlottie->allocated_buf = NULL; rlottie->allocated_buffer_size = 0; } } +#if LV_COLOR_DEPTH == 16 +static void convert_to_rgba5658(uint32_t * pix, const size_t width, const size_t height) +{ + /* rlottie draws in ARGB32 format, but LVGL only deal with RGB565 format with (optional 8 bit alpha channel) + so convert in place here the received buffer to LVGL format. */ + uint8_t * dest = (uint8_t *)pix; + uint32_t * src = pix; + for(size_t y = 0; y < height; y++) { + /* Convert a 4 bytes per pixel in format ARGB to R5G6B5A8 format + naive way: + r = ((c & 0xFF0000) >> 19) + g = ((c & 0xFF00) >> 10) + b = ((c & 0xFF) >> 3) + rgb565 = (r << 11) | (g << 5) | b + a = c >> 24; + That's 3 mask, 6 bitshift and 2 or operations + + A bit better: + r = ((c & 0xF80000) >> 8) + g = ((c & 0xFC00) >> 5) + b = ((c & 0xFF) >> 3) + rgb565 = r | g | b + a = c >> 24; + That's 3 mask, 3 bitshifts and 2 or operations */ + for(size_t x = 0; x < width; x++) { + uint32_t in = src[x]; +#if LV_COLOR_16_SWAP == 0 + uint16_t r = (uint16_t)(((in & 0xF80000) >> 8) | ((in & 0xFC00) >> 5) | ((in & 0xFF) >> 3)); +#else + /* We want: rrrr rrrr GGGg gggg bbbb bbbb => gggb bbbb rrrr rGGG */ + uint16_t r = (uint16_t)(((in & 0xF80000) >> 16) | ((in & 0xFC00) >> 13) | ((in & 0x1C00) << 3) | ((in & 0xF8) << 5)); +#endif + + lv_memcpy(dest, &r, sizeof(r)); + dest[sizeof(r)] = (uint8_t)(in >> 24); + dest += LV_IMG_PX_SIZE_ALPHA_BYTE; + } + src += width; + } +} +#endif + static void next_frame_task_cb(lv_timer_t * t) { - lv_obj_t * obj = lv_timer_get_user_data(t); + lv_obj_t * obj = t->user_data; lv_rlottie_t * rlottie = (lv_rlottie_t *) obj; if((rlottie->play_ctrl & LV_RLOTTIE_CTRL_PAUSE) == LV_RLOTTIE_CTRL_PAUSE) { @@ -208,7 +244,7 @@ static void next_frame_task_cb(lv_timer_t * t) if((rlottie->play_ctrl & LV_RLOTTIE_CTRL_LOOP) == LV_RLOTTIE_CTRL_LOOP) rlottie->current_frame = rlottie->total_frames - 1; else { - lv_obj_send_event(obj, LV_EVENT_READY, NULL); + lv_event_send(obj, LV_EVENT_READY, NULL); lv_timer_pause(t); return; } @@ -221,7 +257,7 @@ static void next_frame_task_cb(lv_timer_t * t) if((rlottie->play_ctrl & LV_RLOTTIE_CTRL_LOOP) == LV_RLOTTIE_CTRL_LOOP) rlottie->current_frame = 0; else { - lv_obj_send_event(obj, LV_EVENT_READY, NULL); + lv_event_send(obj, LV_EVENT_READY, NULL); lv_timer_pause(t); return; } @@ -238,6 +274,10 @@ static void next_frame_task_cb(lv_timer_t * t) rlottie->scanline_width ); +#if LV_COLOR_DEPTH == 16 + convert_to_rgba5658(rlottie->allocated_buf, rlottie->imgdsc.header.w, rlottie->imgdsc.header.h); +#endif + lv_obj_invalidate(obj); } diff --git a/L3_Middlewares/LVGL/src/libs/rlottie/lv_rlottie.h b/L3_Middlewares/LVGL/src/extra/libs/rlottie/lv_rlottie.h similarity index 59% rename from L3_Middlewares/LVGL/src/libs/rlottie/lv_rlottie.h rename to L3_Middlewares/LVGL/src/extra/libs/rlottie/lv_rlottie.h index 44bcf2e..d66dc22 100644 --- a/L3_Middlewares/LVGL/src/libs/rlottie/lv_rlottie.h +++ b/L3_Middlewares/LVGL/src/extra/libs/rlottie/lv_rlottie.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" +#include "../../../lvgl.h" #if LV_USE_RLOTTIE /********************* @@ -31,15 +31,32 @@ typedef enum { LV_RLOTTIE_CTRL_LOOP = 8, } lv_rlottie_ctrl_t; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_rlottie_class; +/** definition in lottieanimation_capi.c */ +struct Lottie_Animation_S; +typedef struct { + lv_img_t img_ext; + struct Lottie_Animation_S * animation; + lv_timer_t * task; + lv_img_dsc_t imgdsc; + size_t total_frames; + size_t current_frame; + size_t framerate; + uint32_t * allocated_buf; + size_t allocated_buffer_size; + size_t scanline_width; + lv_rlottie_ctrl_t play_ctrl; + size_t dest_frame; +} lv_rlottie_t; + +extern const lv_obj_class_t lv_rlottie_class; /********************** * GLOBAL PROTOTYPES **********************/ -lv_obj_t * lv_rlottie_create_from_file(lv_obj_t * parent, int32_t width, int32_t height, const char * path); +lv_obj_t * lv_rlottie_create_from_file(lv_obj_t * parent, lv_coord_t width, lv_coord_t height, const char * path); -lv_obj_t * lv_rlottie_create_from_raw(lv_obj_t * parent, int32_t width, int32_t height, +lv_obj_t * lv_rlottie_create_from_raw(lv_obj_t * parent, lv_coord_t width, lv_coord_t height, const char * rlottie_desc); void lv_rlottie_set_play_mode(lv_obj_t * rlottie, const lv_rlottie_ctrl_t ctrl); diff --git a/L3_Middlewares/LVGL/src/extra/libs/sjpg/lv_sjpg.c b/L3_Middlewares/LVGL/src/extra/libs/sjpg/lv_sjpg.c new file mode 100644 index 0000000..5a12ea2 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/sjpg/lv_sjpg.c @@ -0,0 +1,917 @@ +/** + * @file lv_sjpg.c + * + */ + +/*---------------------------------------------------------------------------------------------------------------------------------- +/ Added normal JPG support [7/10/2020] +/ ---------- +/ SJPEG is a custom created modified JPEG file format for small embedded platforms. +/ It will contain multiple JPEG fragments all embedded into a single file with a custom header. +/ This makes JPEG decoding easier using any JPEG library. Overall file size will be almost +/ similar to the parent jpeg file. We can generate sjpeg from any jpeg using a python script +/ provided along with this project. +/ (by vinodstanur | 2020 ) +/ SJPEG FILE STRUCTURE +/ -------------------------------------------------------------------------------------------------------------------------------- +/ Bytes | Value | +/ -------------------------------------------------------------------------------------------------------------------------------- +/ +/ 0 - 7 | "_SJPG__" followed by '\0' +/ +/ 8 - 13 | "V1.00" followed by '\0' [VERSION OF SJPG FILE for future compatibiliby] +/ +/ 14 - 15 | X_RESOLUTION (width) [little endian] +/ +/ 16 - 17 | Y_RESOLUTION (height) [little endian] +/ +/ 18 - 19 | TOTAL_FRAMES inside sjpeg [little endian] +/ +/ 20 - 21 | JPEG BLOCK WIDTH (16 normally) [little endian] +/ +/ 22 - [(TOTAL_FRAMES*2 )] | SIZE OF EACH JPEG SPLIT FRAGMENTS (FRAME_INFO_ARRAY) +/ +/ SJPEG data | Each JPEG frame can be extracted from SJPEG data by parsing the FRAME_INFO_ARRAY one time. +/ +/---------------------------------------------------------------------------------------------------------------------------------- +/ JPEG DECODER +/ ------------ +/ We are using TJpgDec - Tiny JPEG Decompressor library from ELM-CHAN for decoding each split-jpeg fragments. +/ The tjpgd.c and tjpgd.h is not modified and those are used as it is. So if any update comes for the tiny-jpeg, +/ just replace those files with updated files. +/---------------------------------------------------------------------------------------------------------------------------------*/ + +/********************* + * INCLUDES + *********************/ + +#include "../../../lvgl.h" +#if LV_USE_SJPG + +#include "tjpgd.h" +#include "lv_sjpg.h" +#include "../../../misc/lv_fs.h" + +/********************* + * DEFINES + *********************/ +#define TJPGD_WORKBUFF_SIZE 4096 //Recommended by TJPGD libray + +//NEVER EDIT THESE OFFSET VALUES +#define SJPEG_VERSION_OFFSET 8 +#define SJPEG_X_RES_OFFSET 14 +#define SJPEG_y_RES_OFFSET 16 +#define SJPEG_TOTAL_FRAMES_OFFSET 18 +#define SJPEG_BLOCK_WIDTH_OFFSET 20 +#define SJPEG_FRAME_INFO_ARRAY_OFFSET 22 + +/********************** + * TYPEDEFS + **********************/ + +enum io_source_type { + SJPEG_IO_SOURCE_C_ARRAY, + SJPEG_IO_SOURCE_DISK, +}; + +typedef struct { + enum io_source_type type; + lv_fs_file_t lv_file; + uint8_t * img_cache_buff; + int img_cache_x_res; + int img_cache_y_res; + uint8_t * raw_sjpg_data; //Used when type==SJPEG_IO_SOURCE_C_ARRAY. + uint32_t raw_sjpg_data_size; //Num bytes pointed to by raw_sjpg_data. + uint32_t raw_sjpg_data_next_read_pos; //Used for all types. +} io_source_t; + + +typedef struct { + uint8_t * sjpeg_data; + uint32_t sjpeg_data_size; + int sjpeg_x_res; + int sjpeg_y_res; + int sjpeg_total_frames; + int sjpeg_single_frame_height; + int sjpeg_cache_frame_index; + uint8_t ** frame_base_array; //to save base address of each split frames upto sjpeg_total_frames. + int * frame_base_offset; //to save base offset for fseek + uint8_t * frame_cache; + uint8_t * workb; //JPG work buffer for jpeg library + JDEC * tjpeg_jd; + io_source_t io; +} SJPEG; + +/********************** + * STATIC PROTOTYPES + **********************/ +static lv_res_t decoder_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header); +static lv_res_t decoder_open(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc); +static lv_res_t decoder_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, + lv_coord_t len, uint8_t * buf); +static void decoder_close(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc); +static size_t input_func(JDEC * jd, uint8_t * buff, size_t ndata); +static int is_jpg(const uint8_t * raw_data, size_t len); +static void lv_sjpg_cleanup(SJPEG * sjpeg); +static void lv_sjpg_free(SJPEG * sjpeg); + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ +void lv_split_jpeg_init(void) +{ + lv_img_decoder_t * dec = lv_img_decoder_create(); + lv_img_decoder_set_info_cb(dec, decoder_info); + lv_img_decoder_set_open_cb(dec, decoder_open); + lv_img_decoder_set_close_cb(dec, decoder_close); + lv_img_decoder_set_read_line_cb(dec, decoder_read_line); +} + +/********************** + * STATIC FUNCTIONS + **********************/ +/** + * Get info about an SJPG / JPG image + * @param decoder pointer to the decoder where this function belongs + * @param src can be file name or pointer to a C array + * @param header store the info here + * @return LV_RES_OK: no error; LV_RES_INV: can't get the info + */ +static lv_res_t decoder_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header) +{ + LV_UNUSED(decoder); + + /*Check whether the type `src` is known by the decoder*/ + /* Read the SJPG/JPG header and find `width` and `height` */ + + lv_img_src_t src_type = lv_img_src_get_type(src); /*Get the source type*/ + + lv_res_t ret = LV_RES_OK; + + if(src_type == LV_IMG_SRC_VARIABLE) { + const lv_img_dsc_t * img_dsc = src; + uint8_t * raw_sjpeg_data = (uint8_t *)img_dsc->data; + const uint32_t raw_sjpeg_data_size = img_dsc->data_size; + + if(!strncmp((char *)raw_sjpeg_data, "_SJPG__", strlen("_SJPG__"))) { + + raw_sjpeg_data += 14; //seek to res info ... refer sjpeg format + header->always_zero = 0; + header->cf = LV_IMG_CF_RAW; + + header->w = *raw_sjpeg_data++; + header->w |= *raw_sjpeg_data++ << 8; + + header->h = *raw_sjpeg_data++; + header->h |= *raw_sjpeg_data++ << 8; + + return ret; + + } + else if(is_jpg(raw_sjpeg_data, raw_sjpeg_data_size) == true) { + header->always_zero = 0; + header->cf = LV_IMG_CF_RAW; + + uint8_t * workb_temp = lv_mem_alloc(TJPGD_WORKBUFF_SIZE); + if(!workb_temp) return LV_RES_INV; + + io_source_t io_source_temp; + io_source_temp.type = SJPEG_IO_SOURCE_C_ARRAY; + io_source_temp.raw_sjpg_data = raw_sjpeg_data; + io_source_temp.raw_sjpg_data_size = raw_sjpeg_data_size; + io_source_temp.raw_sjpg_data_next_read_pos = 0; + + JDEC jd_tmp; + + JRESULT rc = jd_prepare(&jd_tmp, input_func, workb_temp, (size_t)TJPGD_WORKBUFF_SIZE, &io_source_temp); + if(rc == JDR_OK) { + header->w = jd_tmp.width; + header->h = jd_tmp.height; + + } + else { + ret = LV_RES_INV; + goto end; + } + +end: + lv_mem_free(workb_temp); + + return ret; + + } + } + else if(src_type == LV_IMG_SRC_FILE) { + const char * fn = src; + if(strcmp(lv_fs_get_ext(fn), "sjpg") == 0) { + + uint8_t buff[22]; + memset(buff, 0, sizeof(buff)); + + lv_fs_file_t file; + lv_fs_res_t res = lv_fs_open(&file, fn, LV_FS_MODE_RD); + if(res != LV_FS_RES_OK) return 78; + + uint32_t rn; + res = lv_fs_read(&file, buff, 8, &rn); + if(res != LV_FS_RES_OK || rn != 8) { + lv_fs_close(&file); + return LV_RES_INV; + } + + if(strcmp((char *)buff, "_SJPG__") == 0) { + lv_fs_seek(&file, 14, LV_FS_SEEK_SET); + res = lv_fs_read(&file, buff, 4, &rn); + if(res != LV_FS_RES_OK || rn != 4) { + lv_fs_close(&file); + return LV_RES_INV; + } + header->always_zero = 0; + header->cf = LV_IMG_CF_RAW; + uint8_t * raw_sjpeg_data = buff; + header->w = *raw_sjpeg_data++; + header->w |= *raw_sjpeg_data++ << 8; + header->h = *raw_sjpeg_data++; + header->h |= *raw_sjpeg_data++ << 8; + lv_fs_close(&file); + return LV_RES_OK; + + } + } + else if(strcmp(lv_fs_get_ext(fn), "jpg") == 0) { + lv_fs_file_t file; + lv_fs_res_t res = lv_fs_open(&file, fn, LV_FS_MODE_RD); + if(res != LV_FS_RES_OK) return 78; + + uint8_t * workb_temp = lv_mem_alloc(TJPGD_WORKBUFF_SIZE); + if(!workb_temp) { + lv_fs_close(&file); + return LV_RES_INV; + } + + io_source_t io_source_temp; + io_source_temp.type = SJPEG_IO_SOURCE_DISK; + io_source_temp.raw_sjpg_data_next_read_pos = 0; + io_source_temp.img_cache_buff = NULL; + io_source_temp.lv_file = file; + JDEC jd_tmp; + + JRESULT rc = jd_prepare(&jd_tmp, input_func, workb_temp, (size_t)TJPGD_WORKBUFF_SIZE, &io_source_temp); + lv_mem_free(workb_temp); + lv_fs_close(&file); + + if(rc == JDR_OK) { + header->always_zero = 0; + header->cf = LV_IMG_CF_RAW; + header->w = jd_tmp.width; + header->h = jd_tmp.height; + return LV_RES_OK; + } + } + } + return LV_RES_INV; +} + +static int img_data_cb(JDEC * jd, void * data, JRECT * rect) +{ + io_source_t * io = jd->device; + uint8_t * cache = io->img_cache_buff; + const int xres = io->img_cache_x_res; + uint8_t * buf = data; + const int INPUT_PIXEL_SIZE = 3; + const int row_width = rect->right - rect->left + 1; // Row width in pixels. + const int row_size = row_width * INPUT_PIXEL_SIZE; // Row size (bytes). + + for(int y = rect->top; y <= rect->bottom; y++) { + int row_offset = y * xres * INPUT_PIXEL_SIZE + rect->left * INPUT_PIXEL_SIZE; + memcpy(cache + row_offset, buf, row_size); + buf += row_size; + } + + return 1; +} + +static size_t input_func(JDEC * jd, uint8_t * buff, size_t ndata) +{ + io_source_t * io = jd->device; + + if(!io) return 0; + + if(io->type == SJPEG_IO_SOURCE_C_ARRAY) { + const uint32_t bytes_left = io->raw_sjpg_data_size - io->raw_sjpg_data_next_read_pos; + const uint32_t to_read = ndata <= bytes_left ? (uint32_t)ndata : bytes_left; + if(to_read == 0) + return 0; + if(buff) { + memcpy(buff, io->raw_sjpg_data + io->raw_sjpg_data_next_read_pos, to_read); + } + io->raw_sjpg_data_next_read_pos += to_read; + return to_read; + } + else if(io->type == SJPEG_IO_SOURCE_DISK) { + + lv_fs_file_t * lv_file_p = &(io->lv_file); + + if(buff) { + uint32_t rn = 0; + lv_fs_read(lv_file_p, buff, (uint32_t)ndata, &rn); + return rn; + } + else { + uint32_t pos; + lv_fs_tell(lv_file_p, &pos); + lv_fs_seek(lv_file_p, (uint32_t)(ndata + pos), LV_FS_SEEK_SET); + return ndata; + } + } + return 0; +} + +/** + * Open SJPG image and return the decided image + * @param decoder pointer to the decoder where this function belongs + * @param dsc pointer to a descriptor which describes this decoding session + * @return LV_RES_OK: no error; LV_RES_INV: can't get the info + */ +static lv_res_t decoder_open(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc) +{ + LV_UNUSED(decoder); + lv_res_t lv_ret = LV_RES_OK; + + if(dsc->src_type == LV_IMG_SRC_VARIABLE) { + uint8_t * data; + SJPEG * sjpeg = (SJPEG *) dsc->user_data; + const uint32_t raw_sjpeg_data_size = ((lv_img_dsc_t *)dsc->src)->data_size; + if(sjpeg == NULL) { + sjpeg = lv_mem_alloc(sizeof(SJPEG)); + if(!sjpeg) return LV_RES_INV; + + memset(sjpeg, 0, sizeof(SJPEG)); + + dsc->user_data = sjpeg; + sjpeg->sjpeg_data = (uint8_t *)((lv_img_dsc_t *)(dsc->src))->data; + sjpeg->sjpeg_data_size = ((lv_img_dsc_t *)(dsc->src))->data_size; + } + + if(!strncmp((char *) sjpeg->sjpeg_data, "_SJPG__", strlen("_SJPG__"))) { + + data = sjpeg->sjpeg_data; + data += 14; + + sjpeg->sjpeg_x_res = *data++; + sjpeg->sjpeg_x_res |= *data++ << 8; + + sjpeg->sjpeg_y_res = *data++; + sjpeg->sjpeg_y_res |= *data++ << 8; + + sjpeg->sjpeg_total_frames = *data++; + sjpeg->sjpeg_total_frames |= *data++ << 8; + + sjpeg->sjpeg_single_frame_height = *data++; + sjpeg->sjpeg_single_frame_height |= *data++ << 8; + + sjpeg->frame_base_array = lv_mem_alloc(sizeof(uint8_t *) * sjpeg->sjpeg_total_frames); + if(! sjpeg->frame_base_array) { + lv_sjpg_cleanup(sjpeg); + sjpeg = NULL; + return LV_RES_INV; + } + + sjpeg->frame_base_offset = NULL; + + uint8_t * img_frame_base = data + sjpeg->sjpeg_total_frames * 2; + sjpeg->frame_base_array[0] = img_frame_base; + + for(int i = 1; i < sjpeg->sjpeg_total_frames; i++) { + int offset = *data++; + offset |= *data++ << 8; + sjpeg->frame_base_array[i] = sjpeg->frame_base_array[i - 1] + offset; + } + sjpeg->sjpeg_cache_frame_index = -1; + sjpeg->frame_cache = (void *)lv_mem_alloc(sjpeg->sjpeg_x_res * sjpeg->sjpeg_single_frame_height * 3/*2*/); + if(! sjpeg->frame_cache) { + lv_sjpg_cleanup(sjpeg); + sjpeg = NULL; + return LV_RES_INV; + } + sjpeg->io.img_cache_buff = sjpeg->frame_cache; + sjpeg->io.img_cache_x_res = sjpeg->sjpeg_x_res; + sjpeg->workb = lv_mem_alloc(TJPGD_WORKBUFF_SIZE); + if(! sjpeg->workb) { + lv_sjpg_cleanup(sjpeg); + sjpeg = NULL; + return LV_RES_INV; + } + + sjpeg->tjpeg_jd = lv_mem_alloc(sizeof(JDEC)); + if(! sjpeg->tjpeg_jd) { + lv_sjpg_cleanup(sjpeg); + sjpeg = NULL; + return LV_RES_INV; + } + sjpeg->io.type = SJPEG_IO_SOURCE_C_ARRAY; + sjpeg->io.lv_file.file_d = NULL; + dsc->img_data = NULL; + return lv_ret; + } + else if(is_jpg(sjpeg->sjpeg_data, raw_sjpeg_data_size) == true) { + + uint8_t * workb_temp = lv_mem_alloc(TJPGD_WORKBUFF_SIZE); + if(! workb_temp) { + lv_sjpg_cleanup(sjpeg); + sjpeg = NULL; + return LV_RES_INV; + } + io_source_t io_source_temp; + io_source_temp.type = SJPEG_IO_SOURCE_C_ARRAY; + io_source_temp.raw_sjpg_data = sjpeg->sjpeg_data; + io_source_temp.raw_sjpg_data_size = sjpeg->sjpeg_data_size; + io_source_temp.raw_sjpg_data_next_read_pos = 0; + + JDEC jd_tmp; + JRESULT rc = jd_prepare(&jd_tmp, input_func, workb_temp, (size_t)TJPGD_WORKBUFF_SIZE, &io_source_temp); + lv_mem_free(workb_temp); + + + if(rc == JDR_OK) { + sjpeg->sjpeg_x_res = jd_tmp.width; + sjpeg->sjpeg_y_res = jd_tmp.height; + sjpeg->sjpeg_total_frames = 1; + sjpeg->sjpeg_single_frame_height = jd_tmp.height; + + sjpeg->frame_base_array = lv_mem_alloc(sizeof(uint8_t *) * sjpeg->sjpeg_total_frames); + if(! sjpeg->frame_base_array) { + lv_sjpg_cleanup(sjpeg); + sjpeg = NULL; + return LV_RES_INV; + } + sjpeg->frame_base_offset = NULL; + + uint8_t * img_frame_base = sjpeg->sjpeg_data; + sjpeg->frame_base_array[0] = img_frame_base; + + sjpeg->sjpeg_cache_frame_index = -1; + sjpeg->frame_cache = (void *)lv_mem_alloc(sjpeg->sjpeg_x_res * sjpeg->sjpeg_single_frame_height * 3); + if(! sjpeg->frame_cache) { + lv_sjpg_cleanup(sjpeg); + sjpeg = NULL; + return LV_RES_INV; + } + + sjpeg->io.img_cache_buff = sjpeg->frame_cache; + sjpeg->io.img_cache_x_res = sjpeg->sjpeg_x_res; + sjpeg->workb = lv_mem_alloc(TJPGD_WORKBUFF_SIZE); + if(! sjpeg->workb) { + lv_sjpg_cleanup(sjpeg); + sjpeg = NULL; + return LV_RES_INV; + } + + sjpeg->tjpeg_jd = lv_mem_alloc(sizeof(JDEC)); + if(! sjpeg->tjpeg_jd) { + lv_sjpg_cleanup(sjpeg); + sjpeg = NULL; + return LV_RES_INV; + } + + sjpeg->io.type = SJPEG_IO_SOURCE_C_ARRAY; + sjpeg->io.lv_file.file_d = NULL; + dsc->img_data = NULL; + return lv_ret; + } + else { + lv_ret = LV_RES_INV; + goto end; + } + +end: + lv_mem_free(workb_temp); + + return lv_ret; + } + } + else if(dsc->src_type == LV_IMG_SRC_FILE) { + /* If all fine, then the file will be kept open */ + const char * fn = dsc->src; + uint8_t * data; + + if(strcmp(lv_fs_get_ext(fn), "sjpg") == 0) { + + uint8_t buff[22]; + memset(buff, 0, sizeof(buff)); + + + lv_fs_file_t lv_file; + lv_fs_res_t res = lv_fs_open(&lv_file, fn, LV_FS_MODE_RD); + if(res != LV_FS_RES_OK) { + return 78; + } + + + uint32_t rn; + res = lv_fs_read(&lv_file, buff, 22, &rn); + if(res != LV_FS_RES_OK || rn != 22) { + lv_fs_close(&lv_file); + return LV_RES_INV; + } + + if(strcmp((char *)buff, "_SJPG__") == 0) { + + SJPEG * sjpeg = (SJPEG *) dsc->user_data; + if(sjpeg == NULL) { + sjpeg = lv_mem_alloc(sizeof(SJPEG)); + + if(! sjpeg) { + lv_fs_close(&lv_file); + return LV_RES_INV; + } + memset(sjpeg, 0, sizeof(SJPEG)); + + dsc->user_data = sjpeg; + sjpeg->sjpeg_data = (uint8_t *)((lv_img_dsc_t *)(dsc->src))->data; + sjpeg->sjpeg_data_size = ((lv_img_dsc_t *)(dsc->src))->data_size; + } + data = buff; + data += 14; + + sjpeg->sjpeg_x_res = *data++; + sjpeg->sjpeg_x_res |= *data++ << 8; + + sjpeg->sjpeg_y_res = *data++; + sjpeg->sjpeg_y_res |= *data++ << 8; + + sjpeg->sjpeg_total_frames = *data++; + sjpeg->sjpeg_total_frames |= *data++ << 8; + + sjpeg->sjpeg_single_frame_height = *data++; + sjpeg->sjpeg_single_frame_height |= *data++ << 8; + + sjpeg->frame_base_array = NULL;//lv_mem_alloc( sizeof(uint8_t *) * sjpeg->sjpeg_total_frames ); + sjpeg->frame_base_offset = lv_mem_alloc(sizeof(int) * sjpeg->sjpeg_total_frames); + if(! sjpeg->frame_base_offset) { + lv_fs_close(&lv_file); + lv_sjpg_cleanup(sjpeg); + return LV_RES_INV; + } + int img_frame_start_offset = (SJPEG_FRAME_INFO_ARRAY_OFFSET + sjpeg->sjpeg_total_frames * 2); + sjpeg->frame_base_offset[0] = img_frame_start_offset; //pointer used to save integer for now... + + for(int i = 1; i < sjpeg->sjpeg_total_frames; i++) { + res = lv_fs_read(&lv_file, buff, 2, &rn); + if(res != LV_FS_RES_OK || rn != 2) { + lv_fs_close(&lv_file); + return LV_RES_INV; + } + + data = buff; + int offset = *data++; + offset |= *data++ << 8; + sjpeg->frame_base_offset[i] = sjpeg->frame_base_offset[i - 1] + offset; + } + + sjpeg->sjpeg_cache_frame_index = -1; //INVALID AT BEGINNING for a forced compare mismatch at first time. + sjpeg->frame_cache = (void *)lv_mem_alloc(sjpeg->sjpeg_x_res * sjpeg->sjpeg_single_frame_height * 3); + if(! sjpeg->frame_cache) { + lv_fs_close(&lv_file); + lv_sjpg_cleanup(sjpeg); + return LV_RES_INV; + } + sjpeg->io.img_cache_buff = sjpeg->frame_cache; + sjpeg->io.img_cache_x_res = sjpeg->sjpeg_x_res; + sjpeg->workb = lv_mem_alloc(TJPGD_WORKBUFF_SIZE); + if(! sjpeg->workb) { + lv_fs_close(&lv_file); + lv_sjpg_cleanup(sjpeg); + return LV_RES_INV; + } + + sjpeg->tjpeg_jd = lv_mem_alloc(sizeof(JDEC)); + if(! sjpeg->tjpeg_jd) { + lv_fs_close(&lv_file); + lv_sjpg_cleanup(sjpeg); + return LV_RES_INV; + } + + sjpeg->io.type = SJPEG_IO_SOURCE_DISK; + sjpeg->io.lv_file = lv_file; + dsc->img_data = NULL; + return LV_RES_OK; + } + } + else if(strcmp(lv_fs_get_ext(fn), "jpg") == 0) { + + lv_fs_file_t lv_file; + lv_fs_res_t res = lv_fs_open(&lv_file, fn, LV_FS_MODE_RD); + if(res != LV_FS_RES_OK) { + return LV_RES_INV; + } + + SJPEG * sjpeg = (SJPEG *) dsc->user_data; + if(sjpeg == NULL) { + sjpeg = lv_mem_alloc(sizeof(SJPEG)); + if(! sjpeg) { + lv_fs_close(&lv_file); + return LV_RES_INV; + } + + memset(sjpeg, 0, sizeof(SJPEG)); + dsc->user_data = sjpeg; + sjpeg->sjpeg_data = (uint8_t *)((lv_img_dsc_t *)(dsc->src))->data; + sjpeg->sjpeg_data_size = ((lv_img_dsc_t *)(dsc->src))->data_size; + } + + uint8_t * workb_temp = lv_mem_alloc(TJPGD_WORKBUFF_SIZE); + if(! workb_temp) { + lv_fs_close(&lv_file); + lv_sjpg_cleanup(sjpeg); + return LV_RES_INV; + } + + io_source_t io_source_temp; + io_source_temp.type = SJPEG_IO_SOURCE_DISK; + io_source_temp.raw_sjpg_data_next_read_pos = 0; + io_source_temp.img_cache_buff = NULL; + io_source_temp.lv_file = lv_file; + + JDEC jd_tmp; + + JRESULT rc = jd_prepare(&jd_tmp, input_func, workb_temp, (size_t)TJPGD_WORKBUFF_SIZE, &io_source_temp); + + lv_mem_free(workb_temp); + + + if(rc == JDR_OK) { + sjpeg->sjpeg_x_res = jd_tmp.width; + sjpeg->sjpeg_y_res = jd_tmp.height; + sjpeg->sjpeg_total_frames = 1; + sjpeg->sjpeg_single_frame_height = jd_tmp.height; + + sjpeg->frame_base_array = NULL; + sjpeg->frame_base_offset = lv_mem_alloc(sizeof(uint8_t *) * sjpeg->sjpeg_total_frames); + if(! sjpeg->frame_base_offset) { + lv_fs_close(&lv_file); + lv_sjpg_cleanup(sjpeg); + return LV_RES_INV; + } + + int img_frame_start_offset = 0; + sjpeg->frame_base_offset[0] = img_frame_start_offset; + + sjpeg->sjpeg_cache_frame_index = -1; + sjpeg->frame_cache = (void *)lv_mem_alloc(sjpeg->sjpeg_x_res * sjpeg->sjpeg_single_frame_height * 3); + if(! sjpeg->frame_cache) { + lv_fs_close(&lv_file); + lv_sjpg_cleanup(sjpeg); + return LV_RES_INV; + } + + sjpeg->io.img_cache_buff = sjpeg->frame_cache; + sjpeg->io.img_cache_x_res = sjpeg->sjpeg_x_res; + sjpeg->workb = lv_mem_alloc(TJPGD_WORKBUFF_SIZE); + if(! sjpeg->workb) { + lv_fs_close(&lv_file); + lv_sjpg_cleanup(sjpeg); + return LV_RES_INV; + } + + sjpeg->tjpeg_jd = lv_mem_alloc(sizeof(JDEC)); + if(! sjpeg->tjpeg_jd) { + lv_fs_close(&lv_file); + lv_sjpg_cleanup(sjpeg); + return LV_RES_INV; + } + + sjpeg->io.type = SJPEG_IO_SOURCE_DISK; + sjpeg->io.lv_file = lv_file; + dsc->img_data = NULL; + return LV_RES_OK; + + } + else { + if(dsc->user_data) lv_mem_free(dsc->user_data); + lv_fs_close(&lv_file); + return LV_RES_INV; + } + } + } + + return LV_RES_INV; +} + +/** + * Decode `len` pixels starting from the given `x`, `y` coordinates and store them in `buf`. + * Required only if the "open" function can't open the whole decoded pixel array. (dsc->img_data == NULL) + * @param decoder pointer to the decoder the function associated with + * @param dsc pointer to decoder descriptor + * @param x start x coordinate + * @param y start y coordinate + * @param len number of pixels to decode + * @param buf a buffer to store the decoded pixels + * @return LV_RES_OK: ok; LV_RES_INV: failed + */ + +static lv_res_t decoder_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, + lv_coord_t len, uint8_t * buf) +{ + LV_UNUSED(decoder); + if(dsc->src_type == LV_IMG_SRC_VARIABLE) { + SJPEG * sjpeg = (SJPEG *) dsc->user_data; + JRESULT rc; + + int sjpeg_req_frame_index = y / sjpeg->sjpeg_single_frame_height; + + /*If line not from cache, refresh cache */ + if(sjpeg_req_frame_index != sjpeg->sjpeg_cache_frame_index) { + sjpeg->io.raw_sjpg_data = sjpeg->frame_base_array[ sjpeg_req_frame_index ]; + if(sjpeg_req_frame_index == (sjpeg->sjpeg_total_frames - 1)) { + /*This is the last frame. */ + const uint32_t frame_offset = (uint32_t)(sjpeg->io.raw_sjpg_data - sjpeg->sjpeg_data); + sjpeg->io.raw_sjpg_data_size = sjpeg->sjpeg_data_size - frame_offset; + } + else { + sjpeg->io.raw_sjpg_data_size = + (uint32_t)(sjpeg->frame_base_array[sjpeg_req_frame_index + 1] - sjpeg->io.raw_sjpg_data); + } + sjpeg->io.raw_sjpg_data_next_read_pos = 0; + rc = jd_prepare(sjpeg->tjpeg_jd, input_func, sjpeg->workb, (size_t)TJPGD_WORKBUFF_SIZE, &(sjpeg->io)); + if(rc != JDR_OK) return LV_RES_INV; + rc = jd_decomp(sjpeg->tjpeg_jd, img_data_cb, 0); + if(rc != JDR_OK) return LV_RES_INV; + sjpeg->sjpeg_cache_frame_index = sjpeg_req_frame_index; + } + + int offset = 0; + uint8_t * cache = (uint8_t *)sjpeg->frame_cache + x * 3 + (y % sjpeg->sjpeg_single_frame_height) * sjpeg->sjpeg_x_res * + 3; + +#if LV_COLOR_DEPTH == 32 + for(int i = 0; i < len; i++) { + buf[offset + 3] = 0xff; + buf[offset + 2] = *cache++; + buf[offset + 1] = *cache++; + buf[offset + 0] = *cache++; + offset += 4; + } + +#elif LV_COLOR_DEPTH == 16 + + for(int i = 0; i < len; i++) { + uint16_t col_16bit = (*cache++ & 0xf8) << 8; + col_16bit |= (*cache++ & 0xFC) << 3; + col_16bit |= (*cache++ >> 3); +#if LV_BIG_ENDIAN_SYSTEM == 1 || LV_COLOR_16_SWAP == 1 + buf[offset++] = col_16bit >> 8; + buf[offset++] = col_16bit & 0xff; +#else + buf[offset++] = col_16bit & 0xff; + buf[offset++] = col_16bit >> 8; +#endif // LV_BIG_ENDIAN_SYSTEM + } + +#elif LV_COLOR_DEPTH == 8 + + for(int i = 0; i < len; i++) { + uint8_t col_8bit = (*cache++ & 0xC0); + col_8bit |= (*cache++ & 0xe0) >> 2; + col_8bit |= (*cache++ & 0xe0) >> 5; + buf[offset++] = col_8bit; + } +#else +#error Unsupported LV_COLOR_DEPTH + + +#endif // LV_COLOR_DEPTH + return LV_RES_OK; + } + else if(dsc->src_type == LV_IMG_SRC_FILE) { + SJPEG * sjpeg = (SJPEG *) dsc->user_data; + JRESULT rc; + int sjpeg_req_frame_index = y / sjpeg->sjpeg_single_frame_height; + + lv_fs_file_t * lv_file_p = &(sjpeg->io.lv_file); + if(!lv_file_p) goto end; + + /*If line not from cache, refresh cache */ + if(sjpeg_req_frame_index != sjpeg->sjpeg_cache_frame_index) { + sjpeg->io.raw_sjpg_data_next_read_pos = (int)(sjpeg->frame_base_offset [ sjpeg_req_frame_index ]); + lv_fs_seek(&(sjpeg->io.lv_file), sjpeg->io.raw_sjpg_data_next_read_pos, LV_FS_SEEK_SET); + + rc = jd_prepare(sjpeg->tjpeg_jd, input_func, sjpeg->workb, (size_t)TJPGD_WORKBUFF_SIZE, &(sjpeg->io)); + if(rc != JDR_OK) return LV_RES_INV; + + rc = jd_decomp(sjpeg->tjpeg_jd, img_data_cb, 0); + if(rc != JDR_OK) return LV_RES_INV; + + sjpeg->sjpeg_cache_frame_index = sjpeg_req_frame_index; + } + + int offset = 0; + uint8_t * cache = (uint8_t *)sjpeg->frame_cache + x * 3 + (y % sjpeg->sjpeg_single_frame_height) * sjpeg->sjpeg_x_res * + 3; + +#if LV_COLOR_DEPTH == 32 + for(int i = 0; i < len; i++) { + buf[offset + 3] = 0xff; + buf[offset + 2] = *cache++; + buf[offset + 1] = *cache++; + buf[offset + 0] = *cache++; + offset += 4; + } +#elif LV_COLOR_DEPTH == 16 + + for(int i = 0; i < len; i++) { + uint16_t col_8bit = (*cache++ & 0xf8) << 8; + col_8bit |= (*cache++ & 0xFC) << 3; + col_8bit |= (*cache++ >> 3); +#if LV_BIG_ENDIAN_SYSTEM == 1 || LV_COLOR_16_SWAP == 1 + buf[offset++] = col_8bit >> 8; + buf[offset++] = col_8bit & 0xff; +#else + buf[offset++] = col_8bit & 0xff; + buf[offset++] = col_8bit >> 8; +#endif // LV_BIG_ENDIAN_SYSTEM + } + +#elif LV_COLOR_DEPTH == 8 + + for(int i = 0; i < len; i++) { + uint8_t col_8bit = (*cache++ & 0xC0); + col_8bit |= (*cache++ & 0xe0) >> 2; + col_8bit |= (*cache++ & 0xe0) >> 5; + buf[offset++] = col_8bit; + } + +#else +#error Unsupported LV_COLOR_DEPTH + + +#endif // LV_COLOR_DEPTH + + return LV_RES_OK; + } +end: + return LV_RES_INV; +} + +/** + * Free the allocated resources + * @param decoder pointer to the decoder where this function belongs + * @param dsc pointer to a descriptor which describes this decoding session + */ +static void decoder_close(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc) +{ + LV_UNUSED(decoder); + /*Free all allocated data*/ + SJPEG * sjpeg = (SJPEG *) dsc->user_data; + if(!sjpeg) return; + + switch(dsc->src_type) { + case LV_IMG_SRC_FILE: + if(sjpeg->io.lv_file.file_d) { + lv_fs_close(&(sjpeg->io.lv_file)); + } + lv_sjpg_cleanup(sjpeg); + break; + + case LV_IMG_SRC_VARIABLE: + lv_sjpg_cleanup(sjpeg); + break; + + default: + ; + } +} + +static int is_jpg(const uint8_t * raw_data, size_t len) +{ + const uint8_t jpg_signature[] = {0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46}; + if(len < sizeof(jpg_signature)) return false; + return memcmp(jpg_signature, raw_data, sizeof(jpg_signature)) == 0; +} + +static void lv_sjpg_free(SJPEG * sjpeg) +{ + if(sjpeg->frame_cache) lv_mem_free(sjpeg->frame_cache); + if(sjpeg->frame_base_array) lv_mem_free(sjpeg->frame_base_array); + if(sjpeg->frame_base_offset) lv_mem_free(sjpeg->frame_base_offset); + if(sjpeg->tjpeg_jd) lv_mem_free(sjpeg->tjpeg_jd); + if(sjpeg->workb) lv_mem_free(sjpeg->workb); +} + +static void lv_sjpg_cleanup(SJPEG * sjpeg) +{ + if(! sjpeg) return; + + lv_sjpg_free(sjpeg); + lv_mem_free(sjpeg); +} + +#endif /*LV_USE_SJPG*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_style_private.h b/L3_Middlewares/LVGL/src/extra/libs/sjpg/lv_sjpg.h similarity index 72% rename from L3_Middlewares/LVGL/src/misc/lv_style_private.h rename to L3_Middlewares/LVGL/src/extra/libs/sjpg/lv_sjpg.h index 8a88185..d06e80d 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_style_private.h +++ b/L3_Middlewares/LVGL/src/extra/libs/sjpg/lv_sjpg.h @@ -1,10 +1,10 @@ /** - * @file lv_style_private.h + * @file lv_sjpg.h * */ -#ifndef LV_STYLE_PRIVATE_H -#define LV_STYLE_PRIVATE_H +#ifndef LV_SJPEG_H +#define LV_SJPEG_H #ifdef __cplusplus extern "C" { @@ -14,7 +14,7 @@ extern "C" { * INCLUDES *********************/ -#include "lv_style.h" +#if LV_USE_SJPG /********************* * DEFINES @@ -28,12 +28,16 @@ extern "C" { * GLOBAL PROTOTYPES **********************/ +void lv_split_jpeg_init(void); + /********************** * MACROS **********************/ +#endif /*LV_USE_SJPG*/ + #ifdef __cplusplus -} /*extern "C"*/ +} #endif -#endif /*LV_STYLE_PRIVATE_H*/ +#endif /* LV_SJPEG_H */ diff --git a/L3_Middlewares/LVGL/src/extra/libs/sjpg/tjpgd.c b/L3_Middlewares/LVGL/src/extra/libs/sjpg/tjpgd.c new file mode 100644 index 0000000..47ddefb --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/sjpg/tjpgd.c @@ -0,0 +1,1155 @@ +/*----------------------------------------------------------------------------/ +/ TJpgDec - Tiny JPEG Decompressor R0.03 (C)ChaN, 2021 +/-----------------------------------------------------------------------------/ +/ The TJpgDec is a generic JPEG decompressor module for tiny embedded systems. +/ This is a free software that opened for education, research and commercial +/ developments under license policy of following terms. +/ +/ Copyright (C) 2021, ChaN, all right reserved. +/ +/ * The TJpgDec module is a free software and there is NO WARRANTY. +/ * No restriction on use. You can use, modify and redistribute it for +/ personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY. +/ * Redistributions of source code must retain the above copyright notice. +/ +/-----------------------------------------------------------------------------/ +/ Oct 04, 2011 R0.01 First release. +/ Feb 19, 2012 R0.01a Fixed decompression fails when scan starts with an escape seq. +/ Sep 03, 2012 R0.01b Added JD_TBLCLIP option. +/ Mar 16, 2019 R0.01c Supprted stdint.h. +/ Jul 01, 2020 R0.01d Fixed wrong integer type usage. +/ May 08, 2021 R0.02 Supprted grayscale image. Separated configuration options. +/ Jun 11, 2021 R0.02a Some performance improvement. +/ Jul 01, 2021 R0.03 Added JD_FASTDECODE option. +/ Some performance improvement. +/----------------------------------------------------------------------------*/ + +#include "tjpgd.h" +#if LV_USE_SJPG + +#if JD_FASTDECODE == 2 +#define HUFF_BIT 10 /* Bit length to apply fast huffman decode */ +#define HUFF_LEN (1 << HUFF_BIT) +#define HUFF_MASK (HUFF_LEN - 1) +#endif + + +/*-----------------------------------------------*/ +/* Zigzag-order to raster-order conversion table */ +/*-----------------------------------------------*/ + +static const uint8_t Zig[64] = { /* Zigzag-order to raster-order conversion table */ + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 +}; + + + +/*-------------------------------------------------*/ +/* Input scale factor of Arai algorithm */ +/* (scaled up 16 bits for fixed point operations) */ +/*-------------------------------------------------*/ + +static const uint16_t Ipsf[64] = { /* See also aa_idct.png */ + (uint16_t)(1.00000*8192), (uint16_t)(1.38704*8192), (uint16_t)(1.30656*8192), (uint16_t)(1.17588*8192), (uint16_t)(1.00000*8192), (uint16_t)(0.78570*8192), (uint16_t)(0.54120*8192), (uint16_t)(0.27590*8192), + (uint16_t)(1.38704*8192), (uint16_t)(1.92388*8192), (uint16_t)(1.81226*8192), (uint16_t)(1.63099*8192), (uint16_t)(1.38704*8192), (uint16_t)(1.08979*8192), (uint16_t)(0.75066*8192), (uint16_t)(0.38268*8192), + (uint16_t)(1.30656*8192), (uint16_t)(1.81226*8192), (uint16_t)(1.70711*8192), (uint16_t)(1.53636*8192), (uint16_t)(1.30656*8192), (uint16_t)(1.02656*8192), (uint16_t)(0.70711*8192), (uint16_t)(0.36048*8192), + (uint16_t)(1.17588*8192), (uint16_t)(1.63099*8192), (uint16_t)(1.53636*8192), (uint16_t)(1.38268*8192), (uint16_t)(1.17588*8192), (uint16_t)(0.92388*8192), (uint16_t)(0.63638*8192), (uint16_t)(0.32442*8192), + (uint16_t)(1.00000*8192), (uint16_t)(1.38704*8192), (uint16_t)(1.30656*8192), (uint16_t)(1.17588*8192), (uint16_t)(1.00000*8192), (uint16_t)(0.78570*8192), (uint16_t)(0.54120*8192), (uint16_t)(0.27590*8192), + (uint16_t)(0.78570*8192), (uint16_t)(1.08979*8192), (uint16_t)(1.02656*8192), (uint16_t)(0.92388*8192), (uint16_t)(0.78570*8192), (uint16_t)(0.61732*8192), (uint16_t)(0.42522*8192), (uint16_t)(0.21677*8192), + (uint16_t)(0.54120*8192), (uint16_t)(0.75066*8192), (uint16_t)(0.70711*8192), (uint16_t)(0.63638*8192), (uint16_t)(0.54120*8192), (uint16_t)(0.42522*8192), (uint16_t)(0.29290*8192), (uint16_t)(0.14932*8192), + (uint16_t)(0.27590*8192), (uint16_t)(0.38268*8192), (uint16_t)(0.36048*8192), (uint16_t)(0.32442*8192), (uint16_t)(0.27590*8192), (uint16_t)(0.21678*8192), (uint16_t)(0.14932*8192), (uint16_t)(0.07612*8192) +}; + + + +/*---------------------------------------------*/ +/* Conversion table for fast clipping process */ +/*---------------------------------------------*/ + +#if JD_TBLCLIP + +#define BYTECLIP(v) Clip8[(unsigned int)(v) & 0x3FF] + +static const uint8_t Clip8[1024] = { + /* 0..255 */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + /* 256..511 */ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + /* -512..-257 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +#else /* JD_TBLCLIP */ + +static uint8_t BYTECLIP (int val) +{ + if (val < 0) return 0; + if (val > 255) return 255; + return (uint8_t)val; +} + +#endif + + + +/*-----------------------------------------------------------------------*/ +/* Allocate a memory block from memory pool */ +/*-----------------------------------------------------------------------*/ + +static void* alloc_pool ( /* Pointer to allocated memory block (NULL:no memory available) */ + JDEC* jd, /* Pointer to the decompressor object */ + size_t ndata /* Number of bytes to allocate */ +) +{ + char *rp = 0; + + + ndata = (ndata + 3) & ~3; /* Align block size to the word boundary */ + + if (jd->sz_pool >= ndata) { + jd->sz_pool -= ndata; + rp = (char*)jd->pool; /* Get start of available memory pool */ + jd->pool = (void*)(rp + ndata); /* Allocate requierd bytes */ + } + + return (void*)rp; /* Return allocated memory block (NULL:no memory to allocate) */ +} + + + + +/*-----------------------------------------------------------------------*/ +/* Create de-quantization and prescaling tables with a DQT segment */ +/*-----------------------------------------------------------------------*/ + +static JRESULT create_qt_tbl ( /* 0:OK, !0:Failed */ + JDEC* jd, /* Pointer to the decompressor object */ + const uint8_t* data, /* Pointer to the quantizer tables */ + size_t ndata /* Size of input data */ +) +{ + unsigned int i, zi; + uint8_t d; + int32_t *pb; + + + while (ndata) { /* Process all tables in the segment */ + if (ndata < 65) return JDR_FMT1; /* Err: table size is unaligned */ + ndata -= 65; + d = *data++; /* Get table property */ + if (d & 0xF0) return JDR_FMT1; /* Err: not 8-bit resolution */ + i = d & 3; /* Get table ID */ + pb = alloc_pool(jd, 64 * sizeof (int32_t));/* Allocate a memory block for the table */ + if (!pb) return JDR_MEM1; /* Err: not enough memory */ + jd->qttbl[i] = pb; /* Register the table */ + for (i = 0; i < 64; i++) { /* Load the table */ + zi = Zig[i]; /* Zigzag-order to raster-order conversion */ + pb[zi] = (int32_t)((uint32_t)*data++ * Ipsf[zi]); /* Apply scale factor of Arai algorithm to the de-quantizers */ + } + } + + return JDR_OK; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Create huffman code tables with a DHT segment */ +/*-----------------------------------------------------------------------*/ + +static JRESULT create_huffman_tbl ( /* 0:OK, !0:Failed */ + JDEC* jd, /* Pointer to the decompressor object */ + const uint8_t* data, /* Pointer to the packed huffman tables */ + size_t ndata /* Size of input data */ +) +{ + unsigned int i, j, b, cls, num; + size_t np; + uint8_t d, *pb, *pd; + uint16_t hc, *ph; + + + while (ndata) { /* Process all tables in the segment */ + if (ndata < 17) return JDR_FMT1; /* Err: wrong data size */ + ndata -= 17; + d = *data++; /* Get table number and class */ + if (d & 0xEE) return JDR_FMT1; /* Err: invalid class/number */ + cls = d >> 4; num = d & 0x0F; /* class = dc(0)/ac(1), table number = 0/1 */ + pb = alloc_pool(jd, 16); /* Allocate a memory block for the bit distribution table */ + if (!pb) return JDR_MEM1; /* Err: not enough memory */ + jd->huffbits[num][cls] = pb; + for (np = i = 0; i < 16; i++) { /* Load number of patterns for 1 to 16-bit code */ + np += (pb[i] = *data++); /* Get sum of code words for each code */ + } + ph = alloc_pool(jd, np * sizeof (uint16_t));/* Allocate a memory block for the code word table */ + if (!ph) return JDR_MEM1; /* Err: not enough memory */ + jd->huffcode[num][cls] = ph; + hc = 0; + for (j = i = 0; i < 16; i++) { /* Re-build huffman code word table */ + b = pb[i]; + while (b--) ph[j++] = hc++; + hc <<= 1; + } + + if (ndata < np) return JDR_FMT1; /* Err: wrong data size */ + ndata -= np; + pd = alloc_pool(jd, np); /* Allocate a memory block for the decoded data */ + if (!pd) return JDR_MEM1; /* Err: not enough memory */ + jd->huffdata[num][cls] = pd; + for (i = 0; i < np; i++) { /* Load decoded data corresponds to each code word */ + d = *data++; + if (!cls && d > 11) return JDR_FMT1; + pd[i] = d; + } +#if JD_FASTDECODE == 2 + { /* Create fast huffman decode table */ + unsigned int span, td, ti; + uint16_t *tbl_ac = 0; + uint8_t *tbl_dc = 0; + + if (cls) { + tbl_ac = alloc_pool(jd, HUFF_LEN * sizeof (uint16_t)); /* LUT for AC elements */ + if (!tbl_ac) return JDR_MEM1; /* Err: not enough memory */ + jd->hufflut_ac[num] = tbl_ac; + memset(tbl_ac, 0xFF, HUFF_LEN * sizeof (uint16_t)); /* Default value (0xFFFF: may be long code) */ + } else { + tbl_dc = alloc_pool(jd, HUFF_LEN * sizeof (uint8_t)); /* LUT for AC elements */ + if (!tbl_dc) return JDR_MEM1; /* Err: not enough memory */ + jd->hufflut_dc[num] = tbl_dc; + memset(tbl_dc, 0xFF, HUFF_LEN * sizeof (uint8_t)); /* Default value (0xFF: may be long code) */ + } + for (i = b = 0; b < HUFF_BIT; b++) { /* Create LUT */ + for (j = pb[b]; j; j--) { + ti = ph[i] << (HUFF_BIT - 1 - b) & HUFF_MASK; /* Index of input pattern for the code */ + if (cls) { + td = pd[i++] | ((b + 1) << 8); /* b15..b8: code length, b7..b0: zero run and data length */ + for (span = 1 << (HUFF_BIT - 1 - b); span; span--, tbl_ac[ti++] = (uint16_t)td) ; + } else { + td = pd[i++] | ((b + 1) << 4); /* b7..b4: code length, b3..b0: data length */ + for (span = 1 << (HUFF_BIT - 1 - b); span; span--, tbl_dc[ti++] = (uint8_t)td) ; + } + } + } + jd->longofs[num][cls] = i; /* Code table offset for long code */ + } +#endif + } + + return JDR_OK; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Extract a huffman decoded data from input stream */ +/*-----------------------------------------------------------------------*/ + +static int huffext ( /* >=0: decoded data, <0: error code */ + JDEC* jd, /* Pointer to the decompressor object */ + unsigned int id, /* Table ID (0:Y, 1:C) */ + unsigned int cls /* Table class (0:DC, 1:AC) */ +) +{ + size_t dc = jd->dctr; + uint8_t *dp = jd->dptr; + unsigned int d, flg = 0; + +#if JD_FASTDECODE == 0 + uint8_t bm, nd, bl; + const uint8_t *hb = jd->huffbits[id][cls]; /* Bit distribution table */ + const uint16_t *hc = jd->huffcode[id][cls]; /* Code word table */ + const uint8_t *hd = jd->huffdata[id][cls]; /* Data table */ + + + bm = jd->dbit; /* Bit mask to extract */ + d = 0; bl = 16; /* Max code length */ + do { + if (!bm) { /* Next byte? */ + if (!dc) { /* No input data is available, re-fill input buffer */ + dp = jd->inbuf; /* Top of input buffer */ + dc = jd->infunc(jd, dp, JD_SZBUF); + if (!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ + } else { + dp++; /* Next data ptr */ + } + dc--; /* Decrement number of available bytes */ + if (flg) { /* In flag sequence? */ + flg = 0; /* Exit flag sequence */ + if (*dp != 0) return 0 - (int)JDR_FMT1; /* Err: unexpected flag is detected (may be collapted data) */ + *dp = 0xFF; /* The flag is a data 0xFF */ + } else { + if (*dp == 0xFF) { /* Is start of flag sequence? */ + flg = 1; continue; /* Enter flag sequence, get trailing byte */ + } + } + bm = 0x80; /* Read from MSB */ + } + d <<= 1; /* Get a bit */ + if (*dp & bm) d++; + bm >>= 1; + + for (nd = *hb++; nd; nd--) { /* Search the code word in this bit length */ + if (d == *hc++) { /* Matched? */ + jd->dbit = bm; jd->dctr = dc; jd->dptr = dp; + return *hd; /* Return the decoded data */ + } + hd++; + } + bl--; + } while (bl); + +#else + const uint8_t *hb, *hd; + const uint16_t *hc; + unsigned int nc, bl, wbit = jd->dbit % 32; + uint32_t w = jd->wreg & ((1UL << wbit) - 1); + + + while (wbit < 16) { /* Prepare 16 bits into the working register */ + if (jd->marker) { + d = 0xFF; /* Input stream has stalled for a marker. Generate stuff bits */ + } else { + if (!dc) { /* Buffer empty, re-fill input buffer */ + dp = jd->inbuf; /* Top of input buffer */ + dc = jd->infunc(jd, dp, JD_SZBUF); + if (!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ + } + d = *dp++; dc--; + if (flg) { /* In flag sequence? */ + flg = 0; /* Exit flag sequence */ + if (d != 0) jd->marker = d; /* Not an escape of 0xFF but a marker */ + d = 0xFF; + } else { + if (d == 0xFF) { /* Is start of flag sequence? */ + flg = 1; continue; /* Enter flag sequence, get trailing byte */ + } + } + } + w = w << 8 | d; /* Shift 8 bits in the working register */ + wbit += 8; + } + jd->dctr = dc; jd->dptr = dp; + jd->wreg = w; + +#if JD_FASTDECODE == 2 + /* Table serch for the short codes */ + d = (unsigned int)(w >> (wbit - HUFF_BIT)); /* Short code as table index */ + if (cls) { /* AC element */ + d = jd->hufflut_ac[id][d]; /* Table decode */ + if (d != 0xFFFF) { /* It is done if hit in short code */ + jd->dbit = wbit - (d >> 8); /* Snip the code length */ + return d & 0xFF; /* b7..0: zero run and following data bits */ + } + } else { /* DC element */ + d = jd->hufflut_dc[id][d]; /* Table decode */ + if (d != 0xFF) { /* It is done if hit in short code */ + jd->dbit = wbit - (d >> 4); /* Snip the code length */ + return d & 0xF; /* b3..0: following data bits */ + } + } + + /* Incremental serch for the codes longer than HUFF_BIT */ + hb = jd->huffbits[id][cls] + HUFF_BIT; /* Bit distribution table */ + hc = jd->huffcode[id][cls] + jd->longofs[id][cls]; /* Code word table */ + hd = jd->huffdata[id][cls] + jd->longofs[id][cls]; /* Data table */ + bl = HUFF_BIT + 1; +#else + /* Incremental serch for all codes */ + hb = jd->huffbits[id][cls]; /* Bit distribution table */ + hc = jd->huffcode[id][cls]; /* Code word table */ + hd = jd->huffdata[id][cls]; /* Data table */ + bl = 1; +#endif + for ( ; bl <= 16; bl++) { /* Incremental search */ + nc = *hb++; + if (nc) { + d = w >> (wbit - bl); + do { /* Search the code word in this bit length */ + if (d == *hc++) { /* Matched? */ + jd->dbit = wbit - bl; /* Snip the huffman code */ + return *hd; /* Return the decoded data */ + } + hd++; + } while (--nc); + } + } +#endif + + return 0 - (int)JDR_FMT1; /* Err: code not found (may be collapted data) */ +} + + + + +/*-----------------------------------------------------------------------*/ +/* Extract N bits from input stream */ +/*-----------------------------------------------------------------------*/ + +static int bitext ( /* >=0: extracted data, <0: error code */ + JDEC* jd, /* Pointer to the decompressor object */ + unsigned int nbit /* Number of bits to extract (1 to 16) */ +) +{ + size_t dc = jd->dctr; + uint8_t *dp = jd->dptr; + unsigned int d, flg = 0; + +#if JD_FASTDECODE == 0 + uint8_t mbit = jd->dbit; + + d = 0; + do { + if (!mbit) { /* Next byte? */ + if (!dc) { /* No input data is available, re-fill input buffer */ + dp = jd->inbuf; /* Top of input buffer */ + dc = jd->infunc(jd, dp, JD_SZBUF); + if (!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ + } else { + dp++; /* Next data ptr */ + } + dc--; /* Decrement number of available bytes */ + if (flg) { /* In flag sequence? */ + flg = 0; /* Exit flag sequence */ + if (*dp != 0) return 0 - (int)JDR_FMT1; /* Err: unexpected flag is detected (may be collapted data) */ + *dp = 0xFF; /* The flag is a data 0xFF */ + } else { + if (*dp == 0xFF) { /* Is start of flag sequence? */ + flg = 1; continue; /* Enter flag sequence */ + } + } + mbit = 0x80; /* Read from MSB */ + } + d <<= 1; /* Get a bit */ + if (*dp & mbit) d |= 1; + mbit >>= 1; + nbit--; + } while (nbit); + + jd->dbit = mbit; jd->dctr = dc; jd->dptr = dp; + return (int)d; + +#else + unsigned int wbit = jd->dbit % 32; + uint32_t w = jd->wreg & ((1UL << wbit) - 1); + + + while (wbit < nbit) { /* Prepare nbit bits into the working register */ + if (jd->marker) { + d = 0xFF; /* Input stream stalled, generate stuff bits */ + } else { + if (!dc) { /* Buffer empty, re-fill input buffer */ + dp = jd->inbuf; /* Top of input buffer */ + dc = jd->infunc(jd, dp, JD_SZBUF); + if (!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ + } + d = *dp++; dc--; + if (flg) { /* In flag sequence? */ + flg = 0; /* Exit flag sequence */ + if (d != 0) jd->marker = d; /* Not an escape of 0xFF but a marker */ + d = 0xFF; + } else { + if (d == 0xFF) { /* Is start of flag sequence? */ + flg = 1; continue; /* Enter flag sequence, get trailing byte */ + } + } + } + w = w << 8 | d; /* Get 8 bits into the working register */ + wbit += 8; + } + jd->wreg = w; jd->dbit = wbit - nbit; + jd->dctr = dc; jd->dptr = dp; + + return (int)(w >> ((wbit - nbit) % 32)); +#endif +} + + + + +/*-----------------------------------------------------------------------*/ +/* Process restart interval */ +/*-----------------------------------------------------------------------*/ + +static JRESULT restart ( + JDEC* jd, /* Pointer to the decompressor object */ + uint16_t rstn /* Expected restert sequense number */ +) +{ + unsigned int i; + uint8_t *dp = jd->dptr; + size_t dc = jd->dctr; + +#if JD_FASTDECODE == 0 + uint16_t d = 0; + + /* Get two bytes from the input stream */ + for (i = 0; i < 2; i++) { + if (!dc) { /* No input data is available, re-fill input buffer */ + dp = jd->inbuf; + dc = jd->infunc(jd, dp, JD_SZBUF); + if (!dc) return JDR_INP; + } else { + dp++; + } + dc--; + d = d << 8 | *dp; /* Get a byte */ + } + jd->dptr = dp; jd->dctr = dc; jd->dbit = 0; + + /* Check the marker */ + if ((d & 0xFFD8) != 0xFFD0 || (d & 7) != (rstn & 7)) { + return JDR_FMT1; /* Err: expected RSTn marker is not detected (may be collapted data) */ + } + +#else + uint16_t marker; + + + if (jd->marker) { /* Generate a maker if it has been detected */ + marker = 0xFF00 | jd->marker; + jd->marker = 0; + } else { + marker = 0; + for (i = 0; i < 2; i++) { /* Get a restart marker */ + if (!dc) { /* No input data is available, re-fill input buffer */ + dp = jd->inbuf; + dc = jd->infunc(jd, dp, JD_SZBUF); + if (!dc) return JDR_INP; + } + marker = (marker << 8) | *dp++; /* Get a byte */ + dc--; + } + jd->dptr = dp; jd->dctr = dc; + } + + /* Check the marker */ + if ((marker & 0xFFD8) != 0xFFD0 || (marker & 7) != (rstn & 7)) { + return JDR_FMT1; /* Err: expected RSTn marker was not detected (may be collapted data) */ + } + + jd->dbit = 0; /* Discard stuff bits */ +#endif + + jd->dcv[2] = jd->dcv[1] = jd->dcv[0] = 0; /* Reset DC offset */ + return JDR_OK; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Apply Inverse-DCT in Arai Algorithm (see also aa_idct.png) */ +/*-----------------------------------------------------------------------*/ + +static void block_idct ( + int32_t* src, /* Input block data (de-quantized and pre-scaled for Arai Algorithm) */ + jd_yuv_t* dst /* Pointer to the destination to store the block as byte array */ +) +{ + const int32_t M13 = (int32_t)(1.41421*4096), M2 = (int32_t)(1.08239*4096), M4 = (int32_t)(2.61313*4096), M5 = (int32_t)(1.84776*4096); + int32_t v0, v1, v2, v3, v4, v5, v6, v7; + int32_t t10, t11, t12, t13; + int i; + + /* Process columns */ + for (i = 0; i < 8; i++) { + v0 = src[8 * 0]; /* Get even elements */ + v1 = src[8 * 2]; + v2 = src[8 * 4]; + v3 = src[8 * 6]; + + t10 = v0 + v2; /* Process the even elements */ + t12 = v0 - v2; + t11 = (v1 - v3) * M13 >> 12; + v3 += v1; + t11 -= v3; + v0 = t10 + v3; + v3 = t10 - v3; + v1 = t11 + t12; + v2 = t12 - t11; + + v4 = src[8 * 7]; /* Get odd elements */ + v5 = src[8 * 1]; + v6 = src[8 * 5]; + v7 = src[8 * 3]; + + t10 = v5 - v4; /* Process the odd elements */ + t11 = v5 + v4; + t12 = v6 - v7; + v7 += v6; + v5 = (t11 - v7) * M13 >> 12; + v7 += t11; + t13 = (t10 + t12) * M5 >> 12; + v4 = t13 - (t10 * M2 >> 12); + v6 = t13 - (t12 * M4 >> 12) - v7; + v5 -= v6; + v4 -= v5; + + src[8 * 0] = v0 + v7; /* Write-back transformed values */ + src[8 * 7] = v0 - v7; + src[8 * 1] = v1 + v6; + src[8 * 6] = v1 - v6; + src[8 * 2] = v2 + v5; + src[8 * 5] = v2 - v5; + src[8 * 3] = v3 + v4; + src[8 * 4] = v3 - v4; + + src++; /* Next column */ + } + + /* Process rows */ + src -= 8; + for (i = 0; i < 8; i++) { + v0 = src[0] + (128L << 8); /* Get even elements (remove DC offset (-128) here) */ + v1 = src[2]; + v2 = src[4]; + v3 = src[6]; + + t10 = v0 + v2; /* Process the even elements */ + t12 = v0 - v2; + t11 = (v1 - v3) * M13 >> 12; + v3 += v1; + t11 -= v3; + v0 = t10 + v3; + v3 = t10 - v3; + v1 = t11 + t12; + v2 = t12 - t11; + + v4 = src[7]; /* Get odd elements */ + v5 = src[1]; + v6 = src[5]; + v7 = src[3]; + + t10 = v5 - v4; /* Process the odd elements */ + t11 = v5 + v4; + t12 = v6 - v7; + v7 += v6; + v5 = (t11 - v7) * M13 >> 12; + v7 += t11; + t13 = (t10 + t12) * M5 >> 12; + v4 = t13 - (t10 * M2 >> 12); + v6 = t13 - (t12 * M4 >> 12) - v7; + v5 -= v6; + v4 -= v5; + + /* Descale the transformed values 8 bits and output a row */ +#if JD_FASTDECODE >= 1 + dst[0] = (int16_t)((v0 + v7) >> 8); + dst[7] = (int16_t)((v0 - v7) >> 8); + dst[1] = (int16_t)((v1 + v6) >> 8); + dst[6] = (int16_t)((v1 - v6) >> 8); + dst[2] = (int16_t)((v2 + v5) >> 8); + dst[5] = (int16_t)((v2 - v5) >> 8); + dst[3] = (int16_t)((v3 + v4) >> 8); + dst[4] = (int16_t)((v3 - v4) >> 8); +#else + dst[0] = BYTECLIP((v0 + v7) >> 8); + dst[7] = BYTECLIP((v0 - v7) >> 8); + dst[1] = BYTECLIP((v1 + v6) >> 8); + dst[6] = BYTECLIP((v1 - v6) >> 8); + dst[2] = BYTECLIP((v2 + v5) >> 8); + dst[5] = BYTECLIP((v2 - v5) >> 8); + dst[3] = BYTECLIP((v3 + v4) >> 8); + dst[4] = BYTECLIP((v3 - v4) >> 8); +#endif + + dst += 8; src += 8; /* Next row */ + } +} + + + + +/*-----------------------------------------------------------------------*/ +/* Load all blocks in an MCU into working buffer */ +/*-----------------------------------------------------------------------*/ + +static JRESULT mcu_load ( + JDEC* jd /* Pointer to the decompressor object */ +) +{ + int32_t *tmp = (int32_t*)jd->workbuf; /* Block working buffer for de-quantize and IDCT */ + int d, e; + unsigned int blk, nby, i, bc, z, id, cmp; + jd_yuv_t *bp; + const int32_t *dqf; + + + nby = jd->msx * jd->msy; /* Number of Y blocks (1, 2 or 4) */ + bp = jd->mcubuf; /* Pointer to the first block of MCU */ + + for (blk = 0; blk < nby + 2; blk++) { /* Get nby Y blocks and two C blocks */ + cmp = (blk < nby) ? 0 : blk - nby + 1; /* Component number 0:Y, 1:Cb, 2:Cr */ + + if (cmp && jd->ncomp != 3) { /* Clear C blocks if not exist (monochrome image) */ + for (i = 0; i < 64; bp[i++] = 128) ; + + } else { /* Load Y/C blocks from input stream */ + id = cmp ? 1 : 0; /* Huffman table ID of this component */ + + /* Extract a DC element from input stream */ + d = huffext(jd, id, 0); /* Extract a huffman coded data (bit length) */ + if (d < 0) return (JRESULT)(0 - d); /* Err: invalid code or input */ + bc = (unsigned int)d; + d = jd->dcv[cmp]; /* DC value of previous block */ + if (bc) { /* If there is any difference from previous block */ + e = bitext(jd, bc); /* Extract data bits */ + if (e < 0) return (JRESULT)(0 - e); /* Err: input */ + bc = 1 << (bc - 1); /* MSB position */ + if (!(e & bc)) e -= (bc << 1) - 1; /* Restore negative value if needed */ + d += e; /* Get current value */ + jd->dcv[cmp] = (int16_t)d; /* Save current DC value for next block */ + } + dqf = jd->qttbl[jd->qtid[cmp]]; /* De-quantizer table ID for this component */ + tmp[0] = d * dqf[0] >> 8; /* De-quantize, apply scale factor of Arai algorithm and descale 8 bits */ + + /* Extract following 63 AC elements from input stream */ + memset(&tmp[1], 0, 63 * sizeof (int32_t)); /* Initialize all AC elements */ + z = 1; /* Top of the AC elements (in zigzag-order) */ + do { + d = huffext(jd, id, 1); /* Extract a huffman coded value (zero runs and bit length) */ + if (d == 0) break; /* EOB? */ + if (d < 0) return (JRESULT)(0 - d); /* Err: invalid code or input error */ + bc = (unsigned int)d; + z += bc >> 4; /* Skip leading zero run */ + if (z >= 64) return JDR_FMT1; /* Too long zero run */ + if (bc &= 0x0F) { /* Bit length? */ + d = bitext(jd, bc); /* Extract data bits */ + if (d < 0) return (JRESULT)(0 - d); /* Err: input device */ + bc = 1 << (bc - 1); /* MSB position */ + if (!(d & bc)) d -= (bc << 1) - 1; /* Restore negative value if needed */ + i = Zig[z]; /* Get raster-order index */ + tmp[i] = d * dqf[i] >> 8; /* De-quantize, apply scale factor of Arai algorithm and descale 8 bits */ + } + } while (++z < 64); /* Next AC element */ + + if (JD_FORMAT != 2 || !cmp) { /* C components may not be processed if in grayscale output */ + if (z == 1 || (JD_USE_SCALE && jd->scale == 3)) { /* If no AC element or scale ratio is 1/8, IDCT can be ommited and the block is filled with DC value */ + d = (jd_yuv_t)((*tmp / 256) + 128); + if (JD_FASTDECODE >= 1) { + for (i = 0; i < 64; bp[i++] = d) ; + } else { + memset(bp, d, 64); + } + } else { + block_idct(tmp, bp); /* Apply IDCT and store the block to the MCU buffer */ + } + } + } + + bp += 64; /* Next block */ + } + + return JDR_OK; /* All blocks have been loaded successfully */ +} + + + + +/*-----------------------------------------------------------------------*/ +/* Output an MCU: Convert YCrCb to RGB and output it in RGB form */ +/*-----------------------------------------------------------------------*/ + +static JRESULT mcu_output ( + JDEC* jd, /* Pointer to the decompressor object */ + int (*outfunc)(JDEC*, void*, JRECT*), /* RGB output function */ + unsigned int img_x, /* MCU location in the image */ + unsigned int img_y /* MCU location in the image */ +) +{ + const int CVACC = (sizeof (int) > 2) ? 1024 : 128; /* Adaptive accuracy for both 16-/32-bit systems */ + unsigned int ix, iy, mx, my, rx, ry; + int yy, cb, cr; + jd_yuv_t *py, *pc; + uint8_t *pix; + JRECT rect; + + + mx = jd->msx * 8; my = jd->msy * 8; /* MCU size (pixel) */ + rx = (img_x + mx <= jd->width) ? mx : jd->width - img_x; /* Output rectangular size (it may be clipped at right/bottom end of image) */ + ry = (img_y + my <= jd->height) ? my : jd->height - img_y; + if (JD_USE_SCALE) { + rx >>= jd->scale; ry >>= jd->scale; + if (!rx || !ry) return JDR_OK; /* Skip this MCU if all pixel is to be rounded off */ + img_x >>= jd->scale; img_y >>= jd->scale; + } + rect.left = img_x; rect.right = img_x + rx - 1; /* Rectangular area in the frame buffer */ + rect.top = img_y; rect.bottom = img_y + ry - 1; + + + if (!JD_USE_SCALE || jd->scale != 3) { /* Not for 1/8 scaling */ + pix = (uint8_t*)jd->workbuf; + + if (JD_FORMAT != 2) { /* RGB output (build an RGB MCU from Y/C component) */ + for (iy = 0; iy < my; iy++) { + pc = py = jd->mcubuf; + if (my == 16) { /* Double block height? */ + pc += 64 * 4 + (iy >> 1) * 8; + if (iy >= 8) py += 64; + } else { /* Single block height */ + pc += mx * 8 + iy * 8; + } + py += iy * 8; + for (ix = 0; ix < mx; ix++) { + cb = pc[0] - 128; /* Get Cb/Cr component and remove offset */ + cr = pc[64] - 128; + if (mx == 16) { /* Double block width? */ + if (ix == 8) py += 64 - 8; /* Jump to next block if double block heigt */ + pc += ix & 1; /* Step forward chroma pointer every two pixels */ + } else { /* Single block width */ + pc++; /* Step forward chroma pointer every pixel */ + } + yy = *py++; /* Get Y component */ + *pix++ = /*R*/ BYTECLIP(yy + ((int)(1.402 * CVACC) * cr) / CVACC); + *pix++ = /*G*/ BYTECLIP(yy - ((int)(0.344 * CVACC) * cb + (int)(0.714 * CVACC) * cr) / CVACC); + *pix++ = /*B*/ BYTECLIP(yy + ((int)(1.772 * CVACC) * cb) / CVACC); + } + } + } else { /* Monochrome output (build a grayscale MCU from Y comopnent) */ + for (iy = 0; iy < my; iy++) { + py = jd->mcubuf + iy * 8; + if (my == 16) { /* Double block height? */ + if (iy >= 8) py += 64; + } + for (ix = 0; ix < mx; ix++) { + if (mx == 16) { /* Double block width? */ + if (ix == 8) py += 64 - 8; /* Jump to next block if double block height */ + } + *pix++ = (uint8_t)*py++; /* Get and store a Y value as grayscale */ + } + } + } + + /* Descale the MCU rectangular if needed */ + if (JD_USE_SCALE && jd->scale) { + unsigned int x, y, r, g, b, s, w, a; + uint8_t *op; + + /* Get averaged RGB value of each square correcponds to a pixel */ + s = jd->scale * 2; /* Number of shifts for averaging */ + w = 1 << jd->scale; /* Width of square */ + a = (mx - w) * (JD_FORMAT != 2 ? 3 : 1); /* Bytes to skip for next line in the square */ + op = (uint8_t*)jd->workbuf; + for (iy = 0; iy < my; iy += w) { + for (ix = 0; ix < mx; ix += w) { + pix = (uint8_t*)jd->workbuf + (iy * mx + ix) * (JD_FORMAT != 2 ? 3 : 1); + r = g = b = 0; + for (y = 0; y < w; y++) { /* Accumulate RGB value in the square */ + for (x = 0; x < w; x++) { + r += *pix++; /* Accumulate R or Y (monochrome output) */ + if (JD_FORMAT != 2) { /* RGB output? */ + g += *pix++; /* Accumulate G */ + b += *pix++; /* Accumulate B */ + } + } + pix += a; + } /* Put the averaged pixel value */ + *op++ = (uint8_t)(r >> s); /* Put R or Y (monochrome output) */ + if (JD_FORMAT != 2) { /* RGB output? */ + *op++ = (uint8_t)(g >> s); /* Put G */ + *op++ = (uint8_t)(b >> s); /* Put B */ + } + } + } + } + + } else { /* For only 1/8 scaling (left-top pixel in each block are the DC value of the block) */ + + /* Build a 1/8 descaled RGB MCU from discrete comopnents */ + pix = (uint8_t*)jd->workbuf; + pc = jd->mcubuf + mx * my; + cb = pc[0] - 128; /* Get Cb/Cr component and restore right level */ + cr = pc[64] - 128; + for (iy = 0; iy < my; iy += 8) { + py = jd->mcubuf; + if (iy == 8) py += 64 * 2; + for (ix = 0; ix < mx; ix += 8) { + yy = *py; /* Get Y component */ + py += 64; + if (JD_FORMAT != 2) { + *pix++ = /*R*/ BYTECLIP(yy + ((int)(1.402 * CVACC) * cr / CVACC)); + *pix++ = /*G*/ BYTECLIP(yy - ((int)(0.344 * CVACC) * cb + (int)(0.714 * CVACC) * cr) / CVACC); + *pix++ = /*B*/ BYTECLIP(yy + ((int)(1.772 * CVACC) * cb / CVACC)); + } else { + *pix++ = yy; + } + } + } + } + + /* Squeeze up pixel table if a part of MCU is to be truncated */ + mx >>= jd->scale; + if (rx < mx) { /* Is the MCU spans rigit edge? */ + uint8_t *s, *d; + unsigned int x, y; + + s = d = (uint8_t*)jd->workbuf; + for (y = 0; y < ry; y++) { + for (x = 0; x < rx; x++) { /* Copy effective pixels */ + *d++ = *s++; + if (JD_FORMAT != 2) { + *d++ = *s++; + *d++ = *s++; + } + } + s += (mx - rx) * (JD_FORMAT != 2 ? 3 : 1); /* Skip truncated pixels */ + } + } + + /* Convert RGB888 to RGB565 if needed */ + if (JD_FORMAT == 1) { + uint8_t *s = (uint8_t*)jd->workbuf; + uint16_t w, *d = (uint16_t*)s; + unsigned int n = rx * ry; + + do { + w = (*s++ & 0xF8) << 8; /* RRRRR----------- */ + w |= (*s++ & 0xFC) << 3; /* -----GGGGGG----- */ + w |= *s++ >> 3; /* -----------BBBBB */ + *d++ = w; + } while (--n); + } + + /* Output the rectangular */ + return outfunc(jd, jd->workbuf, &rect) ? JDR_OK : JDR_INTR; +} + + + + +/*-----------------------------------------------------------------------*/ +/* Analyze the JPEG image and Initialize decompressor object */ +/*-----------------------------------------------------------------------*/ + +#define LDB_WORD(ptr) (uint16_t)(((uint16_t)*((uint8_t*)(ptr))<<8)|(uint16_t)*(uint8_t*)((ptr)+1)) + + +JRESULT jd_prepare ( + JDEC* jd, /* Blank decompressor object */ + size_t (*infunc)(JDEC*, uint8_t*, size_t), /* JPEG strem input function */ + void* pool, /* Working buffer for the decompression session */ + size_t sz_pool, /* Size of working buffer */ + void* dev /* I/O device identifier for the session */ +) +{ + uint8_t *seg, b; + uint16_t marker; + unsigned int n, i, ofs; + size_t len; + JRESULT rc; + + + memset(jd, 0, sizeof (JDEC)); /* Clear decompression object (this might be a problem if machine's null pointer is not all bits zero) */ + jd->pool = pool; /* Work memroy */ + jd->sz_pool = sz_pool; /* Size of given work memory */ + jd->infunc = infunc; /* Stream input function */ + jd->device = dev; /* I/O device identifier */ + + jd->inbuf = seg = alloc_pool(jd, JD_SZBUF); /* Allocate stream input buffer */ + if (!seg) return JDR_MEM1; + + ofs = marker = 0; /* Find SOI marker */ + do { + if (jd->infunc(jd, seg, 1) != 1) return JDR_INP; /* Err: SOI was not detected */ + ofs++; + marker = marker << 8 | seg[0]; + } while (marker != 0xFFD8); + + for (;;) { /* Parse JPEG segments */ + /* Get a JPEG marker */ + if (jd->infunc(jd, seg, 4) != 4) return JDR_INP; + marker = LDB_WORD(seg); /* Marker */ + len = LDB_WORD(seg + 2); /* Length field */ + if (len <= 2 || (marker >> 8) != 0xFF) return JDR_FMT1; + len -= 2; /* Segent content size */ + ofs += 4 + len; /* Number of bytes loaded */ + + switch (marker & 0xFF) { + case 0xC0: /* SOF0 (baseline JPEG) */ + if (len > JD_SZBUF) return JDR_MEM2; + if (jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ + + jd->width = LDB_WORD(&seg[3]); /* Image width in unit of pixel */ + jd->height = LDB_WORD(&seg[1]); /* Image height in unit of pixel */ + jd->ncomp = seg[5]; /* Number of color components */ + if (jd->ncomp != 3 && jd->ncomp != 1) return JDR_FMT3; /* Err: Supports only Grayscale and Y/Cb/Cr */ + + /* Check each image component */ + for (i = 0; i < jd->ncomp; i++) { + b = seg[7 + 3 * i]; /* Get sampling factor */ + if (i == 0) { /* Y component */ + if (b != 0x11 && b != 0x22 && b != 0x21) { /* Check sampling factor */ + return JDR_FMT3; /* Err: Supports only 4:4:4, 4:2:0 or 4:2:2 */ + } + jd->msx = b >> 4; jd->msy = b & 15; /* Size of MCU [blocks] */ + } else { /* Cb/Cr component */ + if (b != 0x11) return JDR_FMT3; /* Err: Sampling factor of Cb/Cr must be 1 */ + } + jd->qtid[i] = seg[8 + 3 * i]; /* Get dequantizer table ID for this component */ + if (jd->qtid[i] > 3) return JDR_FMT3; /* Err: Invalid ID */ + } + break; + + case 0xDD: /* DRI - Define Restart Interval */ + if (len > JD_SZBUF) return JDR_MEM2; + if (jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ + + jd->nrst = LDB_WORD(seg); /* Get restart interval (MCUs) */ + break; + + case 0xC4: /* DHT - Define Huffman Tables */ + if (len > JD_SZBUF) return JDR_MEM2; + if (jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ + + rc = create_huffman_tbl(jd, seg, len); /* Create huffman tables */ + if (rc) return rc; + break; + + case 0xDB: /* DQT - Define Quaitizer Tables */ + if (len > JD_SZBUF) return JDR_MEM2; + if (jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ + + rc = create_qt_tbl(jd, seg, len); /* Create de-quantizer tables */ + if (rc) return rc; + break; + + case 0xDA: /* SOS - Start of Scan */ + if (len > JD_SZBUF) return JDR_MEM2; + if (jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ + + if (!jd->width || !jd->height) return JDR_FMT1; /* Err: Invalid image size */ + if (seg[0] != jd->ncomp) return JDR_FMT3; /* Err: Wrong color components */ + + /* Check if all tables corresponding to each components have been loaded */ + for (i = 0; i < jd->ncomp; i++) { + b = seg[2 + 2 * i]; /* Get huffman table ID */ + if (b != 0x00 && b != 0x11) return JDR_FMT3; /* Err: Different table number for DC/AC element */ + n = i ? 1 : 0; /* Component class */ + if (!jd->huffbits[n][0] || !jd->huffbits[n][1]) { /* Check huffman table for this component */ + return JDR_FMT1; /* Err: Nnot loaded */ + } + if (!jd->qttbl[jd->qtid[i]]) { /* Check dequantizer table for this component */ + return JDR_FMT1; /* Err: Not loaded */ + } + } + + /* Allocate working buffer for MCU and pixel output */ + n = jd->msy * jd->msx; /* Number of Y blocks in the MCU */ + if (!n) return JDR_FMT1; /* Err: SOF0 has not been loaded */ + len = n * 64 * 2 + 64; /* Allocate buffer for IDCT and RGB output */ + if (len < 256) len = 256; /* but at least 256 byte is required for IDCT */ + jd->workbuf = alloc_pool(jd, len); /* and it may occupy a part of following MCU working buffer for RGB output */ + if (!jd->workbuf) return JDR_MEM1; /* Err: not enough memory */ + jd->mcubuf = alloc_pool(jd, (n + 2) * 64 * sizeof (jd_yuv_t)); /* Allocate MCU working buffer */ + if (!jd->mcubuf) return JDR_MEM1; /* Err: not enough memory */ + + /* Align stream read offset to JD_SZBUF */ + if (ofs %= JD_SZBUF) { + jd->dctr = jd->infunc(jd, seg + ofs, (size_t)(JD_SZBUF - ofs)); + } + jd->dptr = seg + ofs - (JD_FASTDECODE ? 0 : 1); + + return JDR_OK; /* Initialization succeeded. Ready to decompress the JPEG image. */ + + case 0xC1: /* SOF1 */ + case 0xC2: /* SOF2 */ + case 0xC3: /* SOF3 */ + case 0xC5: /* SOF5 */ + case 0xC6: /* SOF6 */ + case 0xC7: /* SOF7 */ + case 0xC9: /* SOF9 */ + case 0xCA: /* SOF10 */ + case 0xCB: /* SOF11 */ + case 0xCD: /* SOF13 */ + case 0xCE: /* SOF14 */ + case 0xCF: /* SOF15 */ + case 0xD9: /* EOI */ + return JDR_FMT3; /* Unsuppoted JPEG standard (may be progressive JPEG) */ + + default: /* Unknown segment (comment, exif or etc..) */ + /* Skip segment data (null pointer specifies to remove data from the stream) */ + if (jd->infunc(jd, 0, len) != len) return JDR_INP; + } + } +} + + + + +/*-----------------------------------------------------------------------*/ +/* Start to decompress the JPEG picture */ +/*-----------------------------------------------------------------------*/ + +JRESULT jd_decomp ( + JDEC* jd, /* Initialized decompression object */ + int (*outfunc)(JDEC*, void*, JRECT*), /* RGB output function */ + uint8_t scale /* Output de-scaling factor (0 to 3) */ +) +{ + unsigned int x, y, mx, my; + uint16_t rst, rsc; + JRESULT rc; + + + if (scale > (JD_USE_SCALE ? 3 : 0)) return JDR_PAR; + jd->scale = scale; + + mx = jd->msx * 8; my = jd->msy * 8; /* Size of the MCU (pixel) */ + + jd->dcv[2] = jd->dcv[1] = jd->dcv[0] = 0; /* Initialize DC values */ + rst = rsc = 0; + + rc = JDR_OK; + for (y = 0; y < jd->height; y += my) { /* Vertical loop of MCUs */ + for (x = 0; x < jd->width; x += mx) { /* Horizontal loop of MCUs */ + if (jd->nrst && rst++ == jd->nrst) { /* Process restart interval if enabled */ + rc = restart(jd, rsc++); + if (rc != JDR_OK) return rc; + rst = 1; + } + rc = mcu_load(jd); /* Load an MCU (decompress huffman coded stream, dequantize and apply IDCT) */ + if (rc != JDR_OK) return rc; + rc = mcu_output(jd, outfunc, x, y); /* Output the MCU (YCbCr to RGB, scaling and output) */ + if (rc != JDR_OK) return rc; + } + } + + return rc; +} + +#endif /*LV_USE_SJPG*/ diff --git a/L3_Middlewares/LVGL/src/extra/libs/sjpg/tjpgd.h b/L3_Middlewares/LVGL/src/extra/libs/sjpg/tjpgd.h new file mode 100644 index 0000000..b255ccf --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/sjpg/tjpgd.h @@ -0,0 +1,93 @@ +/*----------------------------------------------------------------------------/ +/ TJpgDec - Tiny JPEG Decompressor R0.03 include file (C)ChaN, 2021 +/----------------------------------------------------------------------------*/ +#ifndef DEF_TJPGDEC +#define DEF_TJPGDEC + +#ifdef __cplusplus +extern "C" { +#endif + +#include "../../../lv_conf_internal.h" +#if LV_USE_SJPG + +#include "tjpgdcnf.h" +#include +#include + +#if JD_FASTDECODE >= 1 +typedef int16_t jd_yuv_t; +#else +typedef uint8_t jd_yuv_t; +#endif + + +/* Error code */ +typedef enum { + JDR_OK = 0, /* 0: Succeeded */ + JDR_INTR, /* 1: Interrupted by output function */ + JDR_INP, /* 2: Device error or wrong termination of input stream */ + JDR_MEM1, /* 3: Insufficient memory pool for the image */ + JDR_MEM2, /* 4: Insufficient stream input buffer */ + JDR_PAR, /* 5: Parameter error */ + JDR_FMT1, /* 6: Data format error (may be broken data) */ + JDR_FMT2, /* 7: Right format but not supported */ + JDR_FMT3 /* 8: Not supported JPEG standard */ +} JRESULT; + +/* Rectangular region in the output image */ +typedef struct { + uint16_t left; /* Left end */ + uint16_t right; /* Right end */ + uint16_t top; /* Top end */ + uint16_t bottom; /* Bottom end */ +} JRECT; + +/* Decompressor object structure */ +typedef struct JDEC JDEC; +struct JDEC { + size_t dctr; /* Number of bytes available in the input buffer */ + uint8_t* dptr; /* Current data read ptr */ + uint8_t* inbuf; /* Bit stream input buffer */ + uint8_t dbit; /* Number of bits availavble in wreg or reading bit mask */ + uint8_t scale; /* Output scaling ratio */ + uint8_t msx, msy; /* MCU size in unit of block (width, height) */ + uint8_t qtid[3]; /* Quantization table ID of each component, Y, Cb, Cr */ + uint8_t ncomp; /* Number of color components 1:grayscale, 3:color */ + int16_t dcv[3]; /* Previous DC element of each component */ + uint16_t nrst; /* Restart inverval */ + uint16_t width, height; /* Size of the input image (pixel) */ + uint8_t* huffbits[2][2]; /* Huffman bit distribution tables [id][dcac] */ + uint16_t* huffcode[2][2]; /* Huffman code word tables [id][dcac] */ + uint8_t* huffdata[2][2]; /* Huffman decoded data tables [id][dcac] */ + int32_t* qttbl[4]; /* Dequantizer tables [id] */ +#if JD_FASTDECODE >= 1 + uint32_t wreg; /* Working shift register */ + uint8_t marker; /* Detected marker (0:None) */ +#if JD_FASTDECODE == 2 + uint8_t longofs[2][2]; /* Table offset of long code [id][dcac] */ + uint16_t* hufflut_ac[2]; /* Fast huffman decode tables for AC short code [id] */ + uint8_t* hufflut_dc[2]; /* Fast huffman decode tables for DC short code [id] */ +#endif +#endif + void* workbuf; /* Working buffer for IDCT and RGB output */ + jd_yuv_t* mcubuf; /* Working buffer for the MCU */ + void* pool; /* Pointer to available memory pool */ + size_t sz_pool; /* Size of momory pool (bytes available) */ + size_t (*infunc)(JDEC*, uint8_t*, size_t); /* Pointer to jpeg stream input function */ + void* device; /* Pointer to I/O device identifiler for the session */ +}; + + + +/* TJpgDec API functions */ +JRESULT jd_prepare (JDEC* jd, size_t (*infunc)(JDEC*,uint8_t*,size_t), void* pool, size_t sz_pool, void* dev); +JRESULT jd_decomp (JDEC* jd, int (*outfunc)(JDEC*,void*,JRECT*), uint8_t scale); + +#endif /*LV_USE_SJPG*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _TJPGDEC */ diff --git a/L3_Middlewares/LVGL/src/libs/tjpgd/tjpgdcnf.h b/L3_Middlewares/LVGL/src/extra/libs/sjpg/tjpgdcnf.h similarity index 84% rename from L3_Middlewares/LVGL/src/libs/tjpgd/tjpgdcnf.h rename to L3_Middlewares/LVGL/src/extra/libs/sjpg/tjpgdcnf.h index dc27d6a..6d425e6 100644 --- a/L3_Middlewares/LVGL/src/libs/tjpgd/tjpgdcnf.h +++ b/L3_Middlewares/LVGL/src/extra/libs/sjpg/tjpgdcnf.h @@ -2,29 +2,29 @@ /* TJpgDec System Configurations R0.03 */ /*----------------------------------------------*/ -#define JD_SZBUF 512 +#define JD_SZBUF 512 /* Specifies size of stream input buffer */ -#define JD_FORMAT 0 +#define JD_FORMAT 0 /* Specifies output pixel format. / 0: RGB888 (24-bit/pix) / 1: RGB565 (16-bit/pix) / 2: Grayscale (8-bit/pix) */ -#define JD_USE_SCALE 0 +#define JD_USE_SCALE 1 /* Switches output descaling feature. / 0: Disable / 1: Enable */ -#define JD_TBLCLIP 1 +#define JD_TBLCLIP 1 /* Use table conversion for saturation arithmetic. A bit faster, but increases 1 KB of code size. / 0: Disable / 1: Enable */ -#define JD_FASTDECODE 1 +#define JD_FASTDECODE 0 /* Optimization level / 0: Basic optimization. Suitable for 8/16-bit MCUs. / 1: + 32-bit barrel shifter. Suitable for 32-bit MCUs. diff --git a/L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/lv_tiny_ttf.c b/L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/lv_tiny_ttf.c new file mode 100644 index 0000000..c275bfe --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/lv_tiny_ttf.c @@ -0,0 +1,284 @@ +#include "lv_tiny_ttf.h" + +#if LV_USE_TINY_TTF +#include +#include "../../../misc/lv_lru.h" + +#define STB_RECT_PACK_IMPLEMENTATION +#define STBRP_STATIC +#define STBTT_STATIC +#define STB_TRUETYPE_IMPLEMENTATION +#define STBTT_HEAP_FACTOR_SIZE_32 50 +#define STBTT_HEAP_FACTOR_SIZE_128 20 +#define STBTT_HEAP_FACTOR_SIZE_DEFAULT 10 +#define STBTT_malloc(x, u) ((void)(u), lv_mem_alloc(x)) +#define STBTT_free(x, u) ((void)(u), lv_mem_free(x)) +#define TTF_MALLOC(x) (lv_mem_alloc(x)) +#define TTF_FREE(x) (lv_mem_free(x)) + +#if LV_TINY_TTF_FILE_SUPPORT +/* a hydra stream that can be in memory or from a file*/ +typedef struct ttf_cb_stream { + lv_fs_file_t * file; + const void * data; + size_t size; + size_t position; +} ttf_cb_stream_t; + +static void ttf_cb_stream_read(ttf_cb_stream_t * stream, void * data, size_t to_read) +{ + if(stream->file != NULL) { + uint32_t br; + lv_fs_read(stream->file, data, to_read, &br); + } + else { + if(to_read + stream->position >= stream->size) { + to_read = stream->size - stream->position; + } + lv_memcpy(data, ((const unsigned char *)stream->data + stream->position), to_read); + stream->position += to_read; + } +} +static void ttf_cb_stream_seek(ttf_cb_stream_t * stream, size_t position) +{ + if(stream->file != NULL) { + lv_fs_seek(stream->file, position, LV_FS_SEEK_SET); + } + else { + if(position > stream->size) { + stream->position = stream->size; + } + else { + stream->position = position; + } + } +} + +/* for stream support */ +#define STBTT_STREAM_TYPE ttf_cb_stream_t * +#define STBTT_STREAM_SEEK(s, x) ttf_cb_stream_seek(s, x); +#define STBTT_STREAM_READ(s, x, y) ttf_cb_stream_read(s, x, y); +#endif /*LV_TINY_TTF_FILE_SUPPORT*/ + +#include "stb_rect_pack.h" +#include "stb_truetype_htcw.h" + +typedef struct ttf_font_desc { + lv_fs_file_t file; +#if LV_TINY_TTF_FILE_SUPPORT + ttf_cb_stream_t stream; +#else + const uint8_t * stream; +#endif + stbtt_fontinfo info; + float scale; + int ascent; + int descent; + lv_lru_t * bitmap_cache; +} ttf_font_desc_t; + +typedef struct ttf_bitmap_cache_key { + uint32_t unicode_letter; + lv_coord_t line_height; +} ttf_bitmap_cache_key_t; + +static bool ttf_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, + uint32_t unicode_letter_next) +{ + if(unicode_letter < 0x20 || + unicode_letter == 0xf8ff || /*LV_SYMBOL_DUMMY*/ + unicode_letter == 0x200c) { /*ZERO WIDTH NON-JOINER*/ + dsc_out->box_w = 0; + dsc_out->adv_w = 0; + dsc_out->box_h = 0; /*height of the bitmap in [px]*/ + dsc_out->ofs_x = 0; /*X offset of the bitmap in [pf]*/ + dsc_out->ofs_y = 0; /*Y offset of the bitmap in [pf]*/ + dsc_out->bpp = 0; + dsc_out->is_placeholder = false; + return true; + } + ttf_font_desc_t * dsc = (ttf_font_desc_t *)font->dsc; + int g1 = stbtt_FindGlyphIndex(&dsc->info, (int)unicode_letter); + if(g1 == 0) { + /* Glyph not found */ + return false; + } + int x1, y1, x2, y2; + + stbtt_GetGlyphBitmapBox(&dsc->info, g1, dsc->scale, dsc->scale, &x1, &y1, &x2, &y2); + int g2 = 0; + if(unicode_letter_next != 0) { + g2 = stbtt_FindGlyphIndex(&dsc->info, (int)unicode_letter_next); + } + int advw, lsb; + stbtt_GetGlyphHMetrics(&dsc->info, g1, &advw, &lsb); + int k = stbtt_GetGlyphKernAdvance(&dsc->info, g1, g2); + dsc_out->adv_w = (uint16_t)floor((((float)advw + (float)k) * dsc->scale) + + 0.5f); /*Horizontal space required by the glyph in [px]*/ + + dsc_out->adv_w = (uint16_t)floor((((float)advw + (float)k) * dsc->scale) + + 0.5f); /*Horizontal space required by the glyph in [px]*/ + dsc_out->box_w = (x2 - x1 + 1); /*width of the bitmap in [px]*/ + dsc_out->box_h = (y2 - y1 + 1); /*height of the bitmap in [px]*/ + dsc_out->ofs_x = x1; /*X offset of the bitmap in [pf]*/ + dsc_out->ofs_y = -y2; /*Y offset of the bitmap measured from the as line*/ + dsc_out->bpp = 8; /*Bits per pixel: 1/2/4/8*/ + dsc_out->is_placeholder = false; + return true; /*true: glyph found; false: glyph was not found*/ +} + +static const uint8_t * ttf_get_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) +{ + ttf_font_desc_t * dsc = (ttf_font_desc_t *)font->dsc; + const stbtt_fontinfo * info = (const stbtt_fontinfo *)&dsc->info; + int g1 = stbtt_FindGlyphIndex(info, (int)unicode_letter); + if(g1 == 0) { + /* Glyph not found */ + return NULL; + } + int x1, y1, x2, y2; + stbtt_GetGlyphBitmapBox(info, g1, dsc->scale, dsc->scale, &x1, &y1, &x2, &y2); + int w, h; + w = x2 - x1 + 1; + h = y2 - y1 + 1; + uint32_t stride = w; + /*Try to load from cache*/ + ttf_bitmap_cache_key_t cache_key; + lv_memset(&cache_key, 0, sizeof(cache_key)); /*Zero padding*/ + cache_key.unicode_letter = unicode_letter; + cache_key.line_height = font->line_height; + uint8_t * buffer = NULL; + lv_lru_get(dsc->bitmap_cache, &cache_key, sizeof(cache_key), (void **)&buffer); + if(buffer) { + return buffer; + } + LV_LOG_TRACE("cache miss for letter: %u", unicode_letter); + /*Prepare space in cache*/ + size_t szb = h * stride; + buffer = lv_mem_alloc(szb); + if(!buffer) { + LV_LOG_ERROR("failed to allocate cache value"); + return NULL; + } + lv_memset(buffer, 0, szb); + if(LV_LRU_OK != lv_lru_set(dsc->bitmap_cache, &cache_key, sizeof(cache_key), buffer, szb)) { + LV_LOG_ERROR("failed to add cache value"); + lv_mem_free(buffer); + return NULL; + } + /*Render into cache*/ + stbtt_MakeGlyphBitmap(info, buffer, w, h, stride, dsc->scale, dsc->scale, g1); + return buffer; +} + +static lv_font_t * lv_tiny_ttf_create(const char * path, const void * data, size_t data_size, lv_coord_t font_size, + size_t cache_size) +{ + if((path == NULL && data == NULL) || 0 >= font_size) { + LV_LOG_ERROR("tiny_ttf: invalid argument\n"); + return NULL; + } + ttf_font_desc_t * dsc = (ttf_font_desc_t *)TTF_MALLOC(sizeof(ttf_font_desc_t)); + if(dsc == NULL) { + LV_LOG_ERROR("tiny_ttf: out of memory\n"); + return NULL; + } +#if LV_TINY_TTF_FILE_SUPPORT + if(path != NULL) { + if(LV_FS_RES_OK != lv_fs_open(&dsc->file, path, LV_FS_MODE_RD)) { + LV_LOG_ERROR("tiny_ttf: unable to open %s\n", path); + goto err_after_dsc; + } + dsc->stream.file = &dsc->file; + } + else { + dsc->stream.file = NULL; + dsc->stream.data = (const uint8_t *)data; + dsc->stream.size = data_size; + dsc->stream.position = 0; + } + if(0 == stbtt_InitFont(&dsc->info, &dsc->stream, stbtt_GetFontOffsetForIndex(&dsc->stream, 0))) { + LV_LOG_ERROR("tiny_ttf: init failed\n"); + goto err_after_dsc; + } + +#else + dsc->stream = (const uint8_t *)data; + LV_UNUSED(data_size); + if(0 == stbtt_InitFont(&dsc->info, dsc->stream, stbtt_GetFontOffsetForIndex(dsc->stream, 0))) { + LV_LOG_ERROR("tiny_ttf: init failed\n"); + goto err_after_dsc; + } +#endif + + dsc->bitmap_cache = lv_lru_create(cache_size, font_size * font_size, lv_mem_free, lv_mem_free); + if(dsc->bitmap_cache == NULL) { + LV_LOG_ERROR("failed to create lru cache"); + goto err_after_dsc; + } + + lv_font_t * out_font = (lv_font_t *)TTF_MALLOC(sizeof(lv_font_t)); + if(out_font == NULL) { + LV_LOG_ERROR("tiny_ttf: out of memory\n"); + goto err_after_bitmap_cache; + } + lv_memset(out_font, 0, sizeof(lv_font_t)); + out_font->get_glyph_dsc = ttf_get_glyph_dsc_cb; + out_font->get_glyph_bitmap = ttf_get_glyph_bitmap_cb; + out_font->dsc = dsc; + lv_tiny_ttf_set_size(out_font, font_size); + return out_font; +err_after_bitmap_cache: + lv_lru_del(dsc->bitmap_cache); +err_after_dsc: + TTF_FREE(dsc); + return NULL; +} +#if LV_TINY_TTF_FILE_SUPPORT +lv_font_t * lv_tiny_ttf_create_file_ex(const char * path, lv_coord_t font_size, size_t cache_size) +{ + return lv_tiny_ttf_create(path, NULL, 0, font_size, cache_size); +} +lv_font_t * lv_tiny_ttf_create_file(const char * path, lv_coord_t font_size) +{ + return lv_tiny_ttf_create_file_ex(path, font_size, 4096); +} +#endif /*LV_TINY_TTF_FILE_SUPPORT*/ +lv_font_t * lv_tiny_ttf_create_data_ex(const void * data, size_t data_size, lv_coord_t font_size, size_t cache_size) +{ + return lv_tiny_ttf_create(NULL, data, data_size, font_size, cache_size); +} +lv_font_t * lv_tiny_ttf_create_data(const void * data, size_t data_size, lv_coord_t font_size) +{ + return lv_tiny_ttf_create_data_ex(data, data_size, font_size, 4096); +} +void lv_tiny_ttf_set_size(lv_font_t * font, lv_coord_t font_size) +{ + if(font_size <= 0) { + LV_LOG_ERROR("invalid font size: %"PRIx32, font_size); + return; + } + ttf_font_desc_t * dsc = (ttf_font_desc_t *)font->dsc; + dsc->scale = stbtt_ScaleForMappingEmToPixels(&dsc->info, font_size); + int line_gap = 0; + stbtt_GetFontVMetrics(&dsc->info, &dsc->ascent, &dsc->descent, &line_gap); + font->line_height = (lv_coord_t)(dsc->scale * (dsc->ascent - dsc->descent + line_gap)); + font->base_line = (lv_coord_t)(dsc->scale * (line_gap - dsc->descent)); +} +void lv_tiny_ttf_destroy(lv_font_t * font) +{ + if(font != NULL) { + if(font->dsc != NULL) { + ttf_font_desc_t * ttf = (ttf_font_desc_t *)font->dsc; +#if LV_TINY_TTF_FILE_SUPPORT + if(ttf->stream.file != NULL) { + lv_fs_close(&ttf->file); + } +#endif + lv_lru_del(ttf->bitmap_cache); + TTF_FREE(ttf); + } + TTF_FREE(font); + } +} +#endif /*LV_USE_TINY_TTF*/ diff --git a/L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/lv_tiny_ttf.h b/L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/lv_tiny_ttf.h new file mode 100644 index 0000000..fe0936b --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/lv_tiny_ttf.h @@ -0,0 +1,62 @@ +/** + * @file lv_tiny_ttf.h + * + */ + +#ifndef LV_TINY_TTF_H +#define LV_TINY_TTF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" + +#if LV_USE_TINY_TTF + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +#if LV_TINY_TTF_FILE_SUPPORT +/* create a font from the specified file or path with the specified line height.*/ +lv_font_t * lv_tiny_ttf_create_file(const char * path, lv_coord_t font_size); + +/* create a font from the specified file or path with the specified line height with the specified cache size.*/ +lv_font_t * lv_tiny_ttf_create_file_ex(const char * path, lv_coord_t font_size, size_t cache_size); +#endif /*LV_TINY_TTF_FILE_SUPPORT*/ + +/* create a font from the specified data pointer with the specified line height.*/ +lv_font_t * lv_tiny_ttf_create_data(const void * data, size_t data_size, lv_coord_t font_size); + +/* create a font from the specified data pointer with the specified line height and the specified cache size.*/ +lv_font_t * lv_tiny_ttf_create_data_ex(const void * data, size_t data_size, lv_coord_t font_size, size_t cache_size); + +/* set the size of the font to a new font_size*/ +void lv_tiny_ttf_set_size(lv_font_t * font, lv_coord_t font_size); + +/* destroy a font previously created with lv_tiny_ttf_create_xxxx()*/ +void lv_tiny_ttf_destroy(lv_font_t * font); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_TINY_TTF*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_TINY_TTF_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/tiny_ttf/stb_rect_pack.h b/L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/stb_rect_pack.h similarity index 99% rename from L3_Middlewares/LVGL/src/libs/tiny_ttf/stb_rect_pack.h rename to L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/stb_rect_pack.h index b4c8b4d..413e504 100644 --- a/L3_Middlewares/LVGL/src/libs/tiny_ttf/stb_rect_pack.h +++ b/L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/stb_rect_pack.h @@ -97,6 +97,7 @@ typedef int stbrp_coord; #pragma GCC diagnostic ignored "-Wunused-function" #endif + STBRP_DEF int stbrp_pack_rects(stbrp_context * context, stbrp_rect * rects, int num_rects); // Assign packed locations to rectangles. The rectangles are of type // 'stbrp_rect' defined below, stored in the array 'rects', and there @@ -135,6 +136,7 @@ struct stbrp_rect { }; // 16 bytes, nominally + STBRP_DEF void stbrp_init_target(stbrp_context * context, int width, int height, stbrp_node * nodes, int num_nodes); // Initialize a rectangle packer to: // pack a rectangle that is 'width' by 'height' in dimensions @@ -161,6 +163,7 @@ STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context * context, int allow_o // change the handling of the out-of-temp-memory scenario, described above. // If you call init again, this will be reset to the default (false). + STBRP_DEF void stbrp_setup_heuristic(stbrp_context * context, int heuristic); // Optionally select which packing heuristic the library should use. Different // heuristics will produce better/worse results for different data sets. @@ -172,6 +175,7 @@ enum { STBRP_HEURISTIC_Skyline_BF_sortHeight }; + ////////////////////////////////////////////////////////////////////////////// // // the details of the following structures don't matter to you, but they must @@ -469,7 +473,7 @@ static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context * context, // insert the new node into the right starting point, and // let 'cur' point to the remaining nodes needing to be - // stitched back in + // stiched back in cur = *res.prev_link; if(cur->x < res.x) { diff --git a/L3_Middlewares/LVGL/src/libs/tiny_ttf/stb_truetype_htcw.h b/L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/stb_truetype_htcw.h similarity index 99% rename from L3_Middlewares/LVGL/src/libs/tiny_ttf/stb_truetype_htcw.h rename to L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/stb_truetype_htcw.h index 1cd3e2a..d0e839d 100644 --- a/L3_Middlewares/LVGL/src/libs/tiny_ttf/stb_truetype_htcw.h +++ b/L3_Middlewares/LVGL/src/extra/libs/tiny_ttf/stb_truetype_htcw.h @@ -418,6 +418,7 @@ int main(int arg, char ** argv) } #endif + ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //// @@ -589,6 +590,7 @@ STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar * chardata, int pw, int // // It's inefficient; you might want to c&p it and optimize it. + ////////////////////////////////////////////////////////////////////////////// // // NEW TEXTURE BAKING API @@ -767,6 +769,7 @@ STBTT_DEF int stbtt_InitFont(stbtt_fontinfo * info, const unsigned char * data, // need to do anything special to free it, because the contents are pure // value data with no additional data structures. Returns 0 on failure. + ////////////////////////////////////////////////////////////////////////////// // // CHARACTER TO GLYPH-INDEX CONVERSIOn @@ -778,6 +781,7 @@ STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo * info, int unicode_code // codepoint-based functions. // Returns 0 if the character codepoint is not defined in the font. + ////////////////////////////////////////////////////////////////////////////// // // CHARACTER PROPERTIES @@ -912,7 +916,7 @@ STBTT_DEF unsigned char * stbtt_GetCodepointBitmap(const stbtt_fontinfo * info, STBTT_DEF unsigned char * stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo * info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int * width, int * height, int * xoff, int * yoff); -// the same as stbtt_GetCodepointBitmap, but you can specify a subpixel +// the same as stbtt_GetCodepoitnBitmap, but you can specify a subpixel // shift for the character STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo * info, unsigned char * output, int out_w, int out_h, @@ -964,6 +968,7 @@ STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo * font, int glyph, f STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo * font, int glyph, float scale_x, float scale_y, float shift_x, float shift_y, int * ix0, int * iy0, int * ix1, int * iy1); + // @TODO: don't expose this structure typedef struct { int w, h, stride; @@ -1039,6 +1044,8 @@ STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo * info, flo // The algorithm has not been optimized at all, so expect it to be slow // if computing lots of characters or very large sizes. + + ////////////////////////////////////////////////////////////////////////////// // // Finding the right font... @@ -1367,6 +1374,7 @@ static stbtt__buf stbtt__cff_index_get(stbtt__buf b, int i) // on platforms that don't allow misaligned reads, if we want to allow // truetype fonts that aren't padded to alignment, define ALLOW_UNALIGNED_TRUETYPE + #ifdef STBTT_STREAM_TYPE static stbtt_uint8 ttBYTE(STBTT_STREAM_TYPE s, stbtt_uint32 offset) { @@ -2854,47 +2862,7 @@ static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo * info, i } } } - return 0; -} - -STBTT_DEF int stbtt_KernTableCheck(const stbtt_fontinfo * info) -{ - if(info->gpos) { - stbtt_uint16 lookupListOffset; - stbtt_uint32 lookupList; - stbtt_uint16 lookupCount; -#ifdef STBTT_STREAM_TYPE - STBTT_STREAM_TYPE data = info->data; -#else - const stbtt_uint8 * data = info->data; -#endif - stbtt_int32 i; - - if(!info->gpos) return 0; - - if(ttUSHORT(data, 0 + info->gpos) != 1) return 0; // Major version 1 - if(ttUSHORT(data, 2 + info->gpos) != 0) return 0; // Minor version 0 - lookupListOffset = ttUSHORT(data, 8 + info->gpos); - lookupList = lookupListOffset; - lookupCount = ttUSHORT(data, lookupList); - - for(i = 0; i < lookupCount; ++i) { - stbtt_uint16 lookupOffset = ttUSHORT(data, lookupList + 2 + 2 * i); - stbtt_uint32 lookupTable = lookupList + lookupOffset; - - stbtt_uint16 lookupType = ttUSHORT(data, lookupTable); - - if(lookupType != 2) // Pair Adjustment Positioning Subtable - continue; - - return 1; // we have a usable lookup table. - } - return 0; - } - else if(info->kern) { - return 1; - } return 0; } @@ -3107,6 +3075,7 @@ typedef struct stbtt__edge { int invert; } stbtt__edge; + typedef struct stbtt__active_edge { struct stbtt__active_edge * next; #if STBTT_RASTERIZER_VERSION==1 @@ -4668,6 +4637,7 @@ STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context * spc, const unsigned char stbtt_pack_range * ranges, int num_ranges); #endif + STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context * spc, stbrp_rect * rects, int num_rects) { stbrp_pack_rects((stbrp_context *)spc->pack_info, rects, num_rects); @@ -4741,6 +4711,7 @@ STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context * spc, const unsigned char return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1); } + #ifdef STBTT_STREAM_TYPE STBTT_DEF void stbtt_GetScaledFontVMetrics(STBTT_STREAM_TYPE fontdata, int index, float size, float * ascent, float * descent, float * lineGap); @@ -4749,6 +4720,7 @@ STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char * fontdata, int i float * descent, float * lineGap); #endif + #ifdef STBTT_STREAM_TYPE STBTT_DEF void stbtt_GetScaledFontVMetrics(STBTT_STREAM_TYPE fontdata, int index, float size, float * ascent, float * descent, float * lineGap) @@ -5400,6 +5372,7 @@ static int stbtt__matchpair(stbtt_uint8 * fc, stbtt_uint32 nm, stbtt_uint8 * nam #pragma GCC diagnostic ignored "-Wcast-qual" #endif + #ifdef STBTT_STREAM_TYPE STBTT_DEF int stbtt_BakeFontBitmap(STBTT_STREAM_TYPE data, int offset, float pixel_height, unsigned char * pixels, int pw, int ph, @@ -5492,6 +5465,7 @@ STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char * s1, int len1, cons #endif // STB_TRUETYPE_IMPLEMENTATION + // FULL VERSION HISTORY // // 1.25 (2021-07-11) many fixes diff --git a/L3_Middlewares/LVGL/src/extra/lv_extra.c b/L3_Middlewares/LVGL/src/extra/lv_extra.c new file mode 100644 index 0000000..3808337 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/lv_extra.c @@ -0,0 +1,97 @@ +/** + * @file lv_extra.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../lvgl.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_extra_init(void) +{ +#if LV_USE_FLEX + lv_flex_init(); +#endif + +#if LV_USE_GRID + lv_grid_init(); +#endif + +#if LV_USE_MSG + lv_msg_init(); +#endif + +#if LV_USE_FS_FATFS != '\0' + lv_fs_fatfs_init(); +#endif + +#if LV_USE_FS_LITTLEFS != '\0' + lv_fs_littlefs_init(); +#endif + +#if LV_USE_FS_STDIO != '\0' + lv_fs_stdio_init(); +#endif + +#if LV_USE_FS_POSIX != '\0' + lv_fs_posix_init(); +#endif + +#if LV_USE_FS_WIN32 != '\0' + lv_fs_win32_init(); +#endif + +#if LV_USE_FFMPEG + lv_ffmpeg_init(); +#endif + +#if LV_USE_PNG + lv_png_init(); +#endif + +#if LV_USE_SJPG + lv_split_jpeg_init(); +#endif + +#if LV_USE_BMP + lv_bmp_init(); +#endif + +#if LV_USE_FREETYPE + /*Init freetype library*/ +# if LV_FREETYPE_CACHE_SIZE >= 0 + lv_freetype_init(LV_FREETYPE_CACHE_FT_FACES, LV_FREETYPE_CACHE_FT_SIZES, LV_FREETYPE_CACHE_SIZE); +# else + lv_freetype_init(0, 0, 0); +# endif +#endif +} + +/********************** + * STATIC FUNCTIONS + **********************/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_os_private.h b/L3_Middlewares/LVGL/src/extra/lv_extra.h similarity index 60% rename from L3_Middlewares/LVGL/src/osal/lv_os_private.h rename to L3_Middlewares/LVGL/src/extra/lv_extra.h index 4fe08cd..c0306a9 100644 --- a/L3_Middlewares/LVGL/src/osal/lv_os_private.h +++ b/L3_Middlewares/LVGL/src/extra/lv_extra.h @@ -1,23 +1,25 @@ /** - * @file lv_os_private.h + * @file lv_extra.h * */ -#ifndef LV_OS_PRIVATE_H -#define LV_OS_PRIVATE_H +#ifndef LV_EXTRA_H +#define LV_EXTRA_H #ifdef __cplusplus extern "C" { #endif -/********************* - * OS OPTIONS - *********************/ - /********************* * INCLUDES *********************/ +#include "layouts/lv_layouts.h" +#include "libs/lv_libs.h" +#include "others/lv_others.h" +#include "themes/lv_themes.h" +#include "widgets/lv_widgets.h" + /********************* * DEFINES *********************/ @@ -31,10 +33,9 @@ extern "C" { **********************/ /** - * Initialize the OS layer + * Initialize the extra components */ -void lv_os_init(void); - +void lv_extra_init(void); /********************** * MACROS @@ -44,4 +45,4 @@ void lv_os_init(void); } /*extern "C"*/ #endif -#endif /*LV_OS_PRIVATE_H*/ +#endif /*LV_EXTRA_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/lv_extra.mk b/L3_Middlewares/LVGL/src/extra/lv_extra.mk new file mode 100644 index 0000000..8d418ad --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/lv_extra.mk @@ -0,0 +1 @@ +CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/extra -name "*.c") diff --git a/L3_Middlewares/LVGL/src/others/fragment/README.md b/L3_Middlewares/LVGL/src/extra/others/fragment/README.md similarity index 100% rename from L3_Middlewares/LVGL/src/others/fragment/README.md rename to L3_Middlewares/LVGL/src/extra/others/fragment/README.md diff --git a/L3_Middlewares/LVGL/src/others/fragment/lv_fragment.c b/L3_Middlewares/LVGL/src/extra/others/fragment/lv_fragment.c similarity index 77% rename from L3_Middlewares/LVGL/src/others/fragment/lv_fragment.c rename to L3_Middlewares/LVGL/src/extra/others/fragment/lv_fragment.c index 6deb4e7..a2cdfad 100644 --- a/L3_Middlewares/LVGL/src/others/fragment/lv_fragment.c +++ b/L3_Middlewares/LVGL/src/extra/others/fragment/lv_fragment.c @@ -7,10 +7,9 @@ * INCLUDES *********************/ -#include "lv_fragment_private.h" +#include "lv_fragment.h" #if LV_USE_FRAGMENT -#include "../../stdlib/lv_string.h" /********************** * STATIC PROTOTYPES @@ -26,8 +25,9 @@ lv_fragment_t * lv_fragment_create(const lv_fragment_class_t * cls, void * args) { LV_ASSERT_NULL(cls); LV_ASSERT_NULL(cls->create_obj_cb); - LV_ASSERT(cls->instance_size >= sizeof(lv_fragment_t)); - lv_fragment_t * instance = lv_malloc_zeroed(cls->instance_size); + LV_ASSERT(cls->instance_size > 0); + lv_fragment_t * instance = lv_mem_alloc(cls->instance_size); + lv_memset_00(instance, cls->instance_size); instance->cls = cls; instance->child_manager = lv_fragment_manager_create(instance); if(cls->constructor_cb) { @@ -36,7 +36,7 @@ lv_fragment_t * lv_fragment_create(const lv_fragment_class_t * cls, void * args) return instance; } -void lv_fragment_delete(lv_fragment_t * fragment) +void lv_fragment_del(lv_fragment_t * fragment) { LV_ASSERT_NULL(fragment); if(fragment->managed) { @@ -44,15 +44,15 @@ void lv_fragment_delete(lv_fragment_t * fragment) return; } if(fragment->obj) { - lv_fragment_delete_obj(fragment); + lv_fragment_del_obj(fragment); } /* Objects will leak if this function called before objects deleted */ const lv_fragment_class_t * cls = fragment->cls; if(cls->destructor_cb) { cls->destructor_cb(fragment); } - lv_fragment_manager_delete(fragment->child_manager); - lv_free(fragment); + lv_fragment_manager_del(fragment->child_manager); + lv_mem_free(fragment); } lv_fragment_manager_t * lv_fragment_get_manager(lv_fragment_t * fragment) @@ -97,26 +97,15 @@ lv_obj_t * lv_fragment_create_obj(lv_fragment_t * fragment, lv_obj_t * container return obj; } -void lv_fragment_delete_obj(lv_fragment_t * fragment) +void lv_fragment_del_obj(lv_fragment_t * fragment) { LV_ASSERT_NULL(fragment); - lv_fragment_manager_delete_obj(fragment->child_manager); + lv_fragment_manager_del_obj(fragment->child_manager); lv_fragment_managed_states_t * states = fragment->managed; if(states) { if(!states->obj_created) return; states->destroying_obj = true; - - uint32_t i; - uint32_t event_cnt = lv_obj_get_event_count(fragment->obj); - bool cb_removed = false; - for(i = 0; i < event_cnt; i++) { - lv_event_dsc_t * event_dsc = lv_obj_get_event_dsc(fragment->obj, i); - if(lv_event_dsc_get_cb(event_dsc) == cb_delete_assertion) { - cb_removed = lv_obj_remove_event(fragment->obj, i); - break; - } - } - + bool cb_removed = lv_obj_remove_event_cb(fragment->obj, cb_delete_assertion); LV_ASSERT(cb_removed); } LV_ASSERT_NULL(fragment->obj); @@ -124,7 +113,7 @@ void lv_fragment_delete_obj(lv_fragment_t * fragment) if(cls->obj_will_delete_cb) { cls->obj_will_delete_cb(fragment, fragment->obj); } - lv_obj_delete(fragment->obj); + lv_obj_del(fragment->obj); if(cls->obj_deleted_cb) { cls->obj_deleted_cb(fragment, fragment->obj); } @@ -138,7 +127,7 @@ void lv_fragment_recreate_obj(lv_fragment_t * fragment) { LV_ASSERT_NULL(fragment); LV_ASSERT_NULL(fragment->managed); - lv_fragment_delete_obj(fragment); + lv_fragment_del_obj(fragment); lv_fragment_create_obj(fragment, *fragment->managed->container); } diff --git a/L3_Middlewares/LVGL/src/others/fragment/lv_fragment.h b/L3_Middlewares/LVGL/src/extra/others/fragment/lv_fragment.h similarity index 85% rename from L3_Middlewares/LVGL/src/others/fragment/lv_fragment.h rename to L3_Middlewares/LVGL/src/extra/others/fragment/lv_fragment.h index f934737..da30b39 100644 --- a/L3_Middlewares/LVGL/src/others/fragment/lv_fragment.h +++ b/L3_Middlewares/LVGL/src/extra/others/fragment/lv_fragment.h @@ -13,10 +13,12 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../core/lv_obj.h" +#include "../../../lv_conf_internal.h" #if LV_USE_FRAGMENT +#include "../../../core/lv_obj.h" + /********************* * DEFINES *********************/ @@ -25,9 +27,13 @@ extern "C" { * TYPEDEFS **********************/ -typedef struct lv_fragment_manager_t lv_fragment_manager_t; +typedef struct _lv_fragment_manager_t lv_fragment_manager_t; + +typedef struct _lv_fragment_t lv_fragment_t; +typedef struct _lv_fragment_class_t lv_fragment_class_t; +typedef struct _lv_fragment_managed_states_t lv_fragment_managed_states_t; -struct lv_fragment_t { +struct _lv_fragment_t { /** * Class of this fragment */ @@ -49,7 +55,7 @@ struct lv_fragment_t { }; -struct lv_fragment_class_t { +struct _lv_fragment_class_t { /** * Constructor function for fragment class * @param self Fragment instance @@ -120,6 +126,40 @@ struct lv_fragment_class_t { size_t instance_size; }; +/** + * Fragment states + */ +typedef struct _lv_fragment_managed_states_t { + /** + * Class of the fragment + */ + const lv_fragment_class_t * cls; + /** + * Manager the fragment attached to + */ + lv_fragment_manager_t * manager; + /** + * Container object the fragment adding view to + */ + lv_obj_t * const * container; + /** + * Fragment instance + */ + lv_fragment_t * instance; + /** + * true between `create_obj_cb` and `obj_deleted_cb` + */ + bool obj_created; + /** + * true before `lv_fragment_del_obj` is called. Don't touch any object if this is true + */ + bool destroying_obj; + /** + * true if this fragment is in navigation stack that can be popped + */ + bool in_stack; +} lv_fragment_managed_states_t; + /********************** * GLOBAL PROTOTYPES **********************/ @@ -135,7 +175,7 @@ lv_fragment_manager_t * lv_fragment_manager_create(lv_fragment_t * parent); * Destroy fragment manager instance * @param manager Fragment manager instance */ -void lv_fragment_manager_delete(lv_fragment_manager_t * manager); +void lv_fragment_manager_del(lv_fragment_manager_t * manager); /** * Create object of all fragments managed by this manager. @@ -147,7 +187,7 @@ void lv_fragment_manager_create_obj(lv_fragment_manager_t * manager); * Delete object created by all fragments managed by this manager. Instance of fragments will not be deleted. * @param manager Fragment manager instance */ -void lv_fragment_manager_delete_obj(lv_fragment_manager_t * manager); +void lv_fragment_manager_del_obj(lv_fragment_manager_t * manager); /** * Attach fragment to manager, and add to container. @@ -226,6 +266,7 @@ lv_fragment_t * lv_fragment_manager_find_by_container(lv_fragment_manager_t * ma */ lv_fragment_t * lv_fragment_manager_get_parent_fragment(lv_fragment_manager_t * manager); + /** * Create a fragment instance. * @@ -239,7 +280,7 @@ lv_fragment_t * lv_fragment_create(const lv_fragment_class_t * cls, void * args) * Destroy a fragment. * @param fragment Fragment instance. */ -void lv_fragment_delete(lv_fragment_t * fragment); +void lv_fragment_del(lv_fragment_t * fragment); /** * Get associated manager of this fragment @@ -276,7 +317,7 @@ lv_obj_t * lv_fragment_create_obj(lv_fragment_t * fragment, lv_obj_t * container * * @param fragment Fragment instance. */ -void lv_fragment_delete_obj(lv_fragment_t * fragment); +void lv_fragment_del_obj(lv_fragment_t * fragment); /** * Destroy obj in fragment, and recreate them. @@ -284,6 +325,7 @@ void lv_fragment_delete_obj(lv_fragment_t * fragment); */ void lv_fragment_recreate_obj(lv_fragment_t * fragment); + /********************** * MACROS **********************/ diff --git a/L3_Middlewares/LVGL/src/others/fragment/lv_fragment_manager.c b/L3_Middlewares/LVGL/src/extra/others/fragment/lv_fragment_manager.c similarity index 73% rename from L3_Middlewares/LVGL/src/others/fragment/lv_fragment_manager.c rename to L3_Middlewares/LVGL/src/extra/others/fragment/lv_fragment_manager.c index a856518..ade7215 100644 --- a/L3_Middlewares/LVGL/src/others/fragment/lv_fragment_manager.c +++ b/L3_Middlewares/LVGL/src/extra/others/fragment/lv_fragment_manager.c @@ -7,12 +7,11 @@ * INCLUDES *********************/ -#include "lv_fragment_private.h" +#include "lv_fragment.h" #if LV_USE_FRAGMENT -#include "../../misc/lv_ll.h" -#include "../../stdlib/lv_string.h" +#include "../../../misc/lv_ll.h" /********************* * DEFINES @@ -21,11 +20,11 @@ /********************** * TYPEDEFS **********************/ -typedef struct lv_fragment_stack_item_t { +typedef struct _lv_fragment_stack_item_t { lv_fragment_managed_states_t * states; } lv_fragment_stack_item_t; -struct lv_fragment_manager_t { +struct _lv_fragment_manager_t { lv_fragment_t * parent; /** * Linked list to store attached fragments @@ -37,15 +36,16 @@ struct lv_fragment_manager_t { lv_ll_t stack; }; + /********************** * STATIC PROTOTYPES **********************/ static void item_create_obj(lv_fragment_managed_states_t * item); -static void item_delete_obj(lv_fragment_managed_states_t * item); +static void item_del_obj(lv_fragment_managed_states_t * item); -static void item_delete_fragment(lv_fragment_managed_states_t * item); +static void item_del_fragment(lv_fragment_managed_states_t * item); static lv_fragment_managed_states_t * fragment_attach(lv_fragment_manager_t * manager, lv_fragment_t * fragment, lv_obj_t * const * container); @@ -64,32 +64,33 @@ static lv_fragment_managed_states_t * fragment_attach(lv_fragment_manager_t * ma lv_fragment_manager_t * lv_fragment_manager_create(lv_fragment_t * parent) { - lv_fragment_manager_t * instance = lv_malloc_zeroed(sizeof(lv_fragment_manager_t)); + lv_fragment_manager_t * instance = lv_mem_alloc(sizeof(lv_fragment_manager_t)); + lv_memset_00(instance, sizeof(lv_fragment_manager_t)); instance->parent = parent; - lv_ll_init(&instance->attached, sizeof(lv_fragment_managed_states_t)); - lv_ll_init(&instance->stack, sizeof(lv_fragment_stack_item_t)); + _lv_ll_init(&instance->attached, sizeof(lv_fragment_managed_states_t)); + _lv_ll_init(&instance->stack, sizeof(lv_fragment_stack_item_t)); return instance; } -void lv_fragment_manager_delete(lv_fragment_manager_t * manager) +void lv_fragment_manager_del(lv_fragment_manager_t * manager) { LV_ASSERT_NULL(manager); lv_fragment_managed_states_t * states; - LV_LL_READ_BACK(&manager->attached, states) { - item_delete_obj(states); - item_delete_fragment(states); + _LV_LL_READ_BACK(&manager->attached, states) { + item_del_obj(states); + item_del_fragment(states); } - lv_ll_clear(&manager->attached); - lv_ll_clear(&manager->stack); - lv_free(manager); + _lv_ll_clear(&manager->attached); + _lv_ll_clear(&manager->stack); + lv_mem_free(manager); } void lv_fragment_manager_create_obj(lv_fragment_manager_t * manager) { LV_ASSERT_NULL(manager); - lv_fragment_stack_item_t * top = lv_ll_get_tail(&manager->stack); + lv_fragment_stack_item_t * top = _lv_ll_get_tail(&manager->stack); lv_fragment_managed_states_t * states = NULL; - LV_LL_READ(&manager->attached, states) { + _LV_LL_READ(&manager->attached, states) { if(states->in_stack && top->states != states) { /*Only create obj for top item in stack*/ continue; @@ -98,12 +99,12 @@ void lv_fragment_manager_create_obj(lv_fragment_manager_t * manager) } } -void lv_fragment_manager_delete_obj(lv_fragment_manager_t * manager) +void lv_fragment_manager_del_obj(lv_fragment_manager_t * manager) { LV_ASSERT_NULL(manager); lv_fragment_managed_states_t * states = NULL; - LV_LL_READ_BACK(&manager->attached, states) { - item_delete_obj(states); + _LV_LL_READ_BACK(&manager->attached, states) { + item_del_obj(states); } } @@ -125,26 +126,26 @@ void lv_fragment_manager_remove(lv_fragment_manager_t * manager, lv_fragment_t * lv_fragment_managed_states_t * prev = NULL; bool was_top = false; if(states->in_stack) { - void * stack_top = lv_ll_get_tail(&manager->stack); + void * stack_top = _lv_ll_get_tail(&manager->stack); lv_fragment_stack_item_t * item = NULL; - LV_LL_READ_BACK(&manager->stack, item) { + _LV_LL_READ_BACK(&manager->stack, item) { if(item->states == states) { was_top = stack_top == item; - void * stack_prev = lv_ll_get_prev(&manager->stack, item); + void * stack_prev = _lv_ll_get_prev(&manager->stack, item); if(!stack_prev) break; prev = ((lv_fragment_stack_item_t *) stack_prev)->states; break; } } if(item) { - lv_ll_remove(&manager->stack, item); - lv_free(item); + _lv_ll_remove(&manager->stack, item); + lv_mem_free(item); } } - item_delete_obj(states); - item_delete_fragment(states); - lv_ll_remove(&manager->attached, states); - lv_free(states); + item_del_obj(states); + item_del_fragment(states); + _lv_ll_remove(&manager->attached, states); + lv_mem_free(states); if(prev && was_top) { item_create_obj(prev); } @@ -152,15 +153,15 @@ void lv_fragment_manager_remove(lv_fragment_manager_t * manager, lv_fragment_t * void lv_fragment_manager_push(lv_fragment_manager_t * manager, lv_fragment_t * fragment, lv_obj_t * const * container) { - lv_fragment_stack_item_t * top = lv_ll_get_tail(&manager->stack); + lv_fragment_stack_item_t * top = _lv_ll_get_tail(&manager->stack); if(top != NULL) { - item_delete_obj(top->states); + item_del_obj(top->states); } lv_fragment_managed_states_t * states = fragment_attach(manager, fragment, container); states->in_stack = true; /*Add fragment to the top of the stack*/ - lv_fragment_stack_item_t * item = lv_ll_ins_tail(&manager->stack); - lv_memzero(item, sizeof(lv_fragment_stack_item_t)); + lv_fragment_stack_item_t * item = _lv_ll_ins_tail(&manager->stack); + lv_memset_00(item, sizeof(lv_fragment_stack_item_t)); item->states = states; item_create_obj(states); } @@ -187,7 +188,7 @@ bool lv_fragment_manager_send_event(lv_fragment_manager_t * manager, int code, v { LV_ASSERT_NULL(manager); lv_fragment_managed_states_t * p = NULL; - LV_LL_READ_BACK(&manager->attached, p) { + _LV_LL_READ_BACK(&manager->attached, p) { if(!p->obj_created || p->destroying_obj) continue; lv_fragment_t * instance = p->instance; if(!instance) continue; @@ -200,13 +201,13 @@ bool lv_fragment_manager_send_event(lv_fragment_manager_t * manager, int code, v size_t lv_fragment_manager_get_stack_size(lv_fragment_manager_t * manager) { LV_ASSERT_NULL(manager); - return lv_ll_get_len(&manager->stack); + return _lv_ll_get_len(&manager->stack); } lv_fragment_t * lv_fragment_manager_get_top(lv_fragment_manager_t * manager) { LV_ASSERT(manager); - lv_fragment_stack_item_t * top = lv_ll_get_tail(&manager->stack); + lv_fragment_stack_item_t * top = _lv_ll_get_tail(&manager->stack); if(!top)return NULL; return top->states->instance; } @@ -215,7 +216,7 @@ lv_fragment_t * lv_fragment_manager_find_by_container(lv_fragment_manager_t * ma { LV_ASSERT(manager); lv_fragment_managed_states_t * states; - LV_LL_READ(&manager->attached, states) { + _LV_LL_READ(&manager->attached, states) { if(*states->container == container) return states->instance; } return NULL; @@ -237,34 +238,35 @@ static void item_create_obj(lv_fragment_managed_states_t * item) lv_fragment_create_obj(item->instance, item->container ? *item->container : NULL); } -static void item_delete_obj(lv_fragment_managed_states_t * item) +static void item_del_obj(lv_fragment_managed_states_t * item) { - lv_fragment_delete_obj(item->instance); + lv_fragment_del_obj(item->instance); } /** * Detach, then destroy fragment * @param item fragment states */ -static void item_delete_fragment(lv_fragment_managed_states_t * item) +static void item_del_fragment(lv_fragment_managed_states_t * item) { lv_fragment_t * instance = item->instance; if(instance->cls->detached_cb) { instance->cls->detached_cb(instance); } instance->managed = NULL; - lv_fragment_delete(instance); + lv_fragment_del(instance); item->instance = NULL; } + static lv_fragment_managed_states_t * fragment_attach(lv_fragment_manager_t * manager, lv_fragment_t * fragment, lv_obj_t * const * container) { LV_ASSERT(manager); LV_ASSERT(fragment); LV_ASSERT(fragment->managed == NULL); - lv_fragment_managed_states_t * states = lv_ll_ins_tail(&manager->attached); - lv_memzero(states, sizeof(lv_fragment_managed_states_t)); + lv_fragment_managed_states_t * states = _lv_ll_ins_tail(&manager->attached); + lv_memset_00(states, sizeof(lv_fragment_managed_states_t)); states->cls = fragment->cls; states->manager = manager; states->container = container; diff --git a/L3_Middlewares/LVGL/src/others/gridnav/lv_gridnav.c b/L3_Middlewares/LVGL/src/extra/others/gridnav/lv_gridnav.c similarity index 74% rename from L3_Middlewares/LVGL/src/others/gridnav/lv_gridnav.c rename to L3_Middlewares/LVGL/src/extra/others/gridnav/lv_gridnav.c index 5f348af..505a977 100644 --- a/L3_Middlewares/LVGL/src/others/gridnav/lv_gridnav.c +++ b/L3_Middlewares/LVGL/src/extra/others/gridnav/lv_gridnav.c @@ -9,10 +9,9 @@ #include "lv_gridnav.h" #if LV_USE_GRIDNAV -#include "../../misc/lv_assert.h" -#include "../../misc/lv_math.h" -#include "../../indev/lv_indev.h" -#include "../../core/lv_obj_private.h" +#include "../../../misc/lv_assert.h" +#include "../../../misc/lv_math.h" +#include "../../../core/lv_indev.h" /********************* * DEFINES @@ -44,9 +43,9 @@ static void gridnav_event_cb(lv_event_t * e); static lv_obj_t * find_chid(lv_obj_t * obj, lv_obj_t * start_child, find_mode_t mode); static lv_obj_t * find_first_focusable(lv_obj_t * obj); static lv_obj_t * find_last_focusable(lv_obj_t * obj); -static bool obj_is_focusable(lv_obj_t * obj); -static int32_t get_x_center(lv_obj_t * obj); -static int32_t get_y_center(lv_obj_t * obj); +static bool obj_is_focuable(lv_obj_t * obj); +static lv_coord_t get_x_center(lv_obj_t * obj); +static lv_coord_t get_y_center(lv_obj_t * obj); /********************** * STATIC VARIABLES @@ -64,60 +63,39 @@ void lv_gridnav_add(lv_obj_t * obj, lv_gridnav_ctrl_t ctrl) { lv_gridnav_remove(obj); /*Be sure to not add gridnav twice*/ - lv_gridnav_dsc_t * dsc = lv_malloc(sizeof(lv_gridnav_dsc_t)); + lv_gridnav_dsc_t * dsc = lv_mem_alloc(sizeof(lv_gridnav_dsc_t)); LV_ASSERT_MALLOC(dsc); dsc->ctrl = ctrl; dsc->focused_obj = NULL; lv_obj_add_event_cb(obj, gridnav_event_cb, LV_EVENT_ALL, dsc); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_WITH_ARROW); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_WITH_ARROW); } void lv_gridnav_remove(lv_obj_t * obj) { - lv_event_dsc_t * event_dsc = NULL; - uint32_t event_cnt = lv_obj_get_event_count(obj); - uint32_t i; - for(i = 0; i < event_cnt; i++) { - event_dsc = lv_obj_get_event_dsc(obj, i); - if(lv_event_dsc_get_cb(event_dsc) == gridnav_event_cb) { - lv_free(lv_event_dsc_get_user_data(event_dsc)); - lv_obj_remove_event(obj, i); - break; - } - } + lv_gridnav_dsc_t * dsc = lv_obj_get_event_user_data(obj, gridnav_event_cb); + if(dsc == NULL) return; /* no gridnav on this object */ + lv_mem_free(dsc); + lv_obj_remove_event_cb(obj, gridnav_event_cb); } void lv_gridnav_set_focused(lv_obj_t * cont, lv_obj_t * to_focus, lv_anim_enable_t anim_en) { LV_ASSERT_NULL(to_focus); - - uint32_t i; - uint32_t event_cnt = lv_obj_get_event_count(cont); - lv_gridnav_dsc_t * dsc = NULL; - for(i = 0; i < event_cnt; i++) { - lv_event_dsc_t * event_dsc = lv_obj_get_event_dsc(cont, i); - if(lv_event_dsc_get_cb(event_dsc) == gridnav_event_cb) { - dsc = lv_event_dsc_get_user_data(event_dsc); - break; - } - } - + lv_gridnav_dsc_t * dsc = lv_obj_get_event_user_data(cont, gridnav_event_cb); if(dsc == NULL) { LV_LOG_WARN("`cont` is not a gridnav container"); return; } - if(obj_is_focusable(to_focus) == false) { + if(obj_is_focuable(to_focus) == false) { LV_LOG_WARN("The object to focus is not focusable"); return; } - if(dsc->focused_obj) { - lv_obj_remove_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); - } - + lv_obj_clear_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); lv_obj_add_state(to_focus, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); lv_obj_scroll_to_view(to_focus, anim_en); dsc->focused_obj = to_focus; @@ -135,7 +113,7 @@ static void gridnav_event_cb(lv_event_t * e) lv_event_code_t code = lv_event_get_code(e); if(code == LV_EVENT_KEY) { - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); if(child_cnt == 0) return; if(dsc->focused_obj == NULL) dsc->focused_obj = find_first_focusable(obj); @@ -144,10 +122,10 @@ static void gridnav_event_cb(lv_event_t * e) uint32_t key = lv_event_get_key(e); lv_obj_t * guess = NULL; - if(key == LV_KEY_RIGHT && !(dsc->ctrl & LV_GRIDNAV_CTRL_VERTICAL_MOVE_ONLY)) { + if(key == LV_KEY_RIGHT) { if((dsc->ctrl & LV_GRIDNAV_CTRL_SCROLL_FIRST) && lv_obj_has_flag(dsc->focused_obj, LV_OBJ_FLAG_SCROLLABLE) && lv_obj_get_scroll_right(dsc->focused_obj) > 0) { - int32_t d = lv_obj_get_width(dsc->focused_obj) / 4; + lv_coord_t d = lv_obj_get_width(dsc->focused_obj) / 4; if(d <= 0) d = 1; lv_obj_scroll_by_bounded(dsc->focused_obj, -d, 0, LV_ANIM_ON); } @@ -164,10 +142,10 @@ static void gridnav_event_cb(lv_event_t * e) } } } - else if(key == LV_KEY_LEFT && !(dsc->ctrl & LV_GRIDNAV_CTRL_VERTICAL_MOVE_ONLY)) { + else if(key == LV_KEY_LEFT) { if((dsc->ctrl & LV_GRIDNAV_CTRL_SCROLL_FIRST) && lv_obj_has_flag(dsc->focused_obj, LV_OBJ_FLAG_SCROLLABLE) && lv_obj_get_scroll_left(dsc->focused_obj) > 0) { - int32_t d = lv_obj_get_width(dsc->focused_obj) / 4; + lv_coord_t d = lv_obj_get_width(dsc->focused_obj) / 4; if(d <= 0) d = 1; lv_obj_scroll_by_bounded(dsc->focused_obj, d, 0, LV_ANIM_ON); } @@ -184,10 +162,10 @@ static void gridnav_event_cb(lv_event_t * e) } } } - else if(key == LV_KEY_DOWN && !(dsc->ctrl & LV_GRIDNAV_CTRL_HORIZONTAL_MOVE_ONLY)) { + else if(key == LV_KEY_DOWN) { if((dsc->ctrl & LV_GRIDNAV_CTRL_SCROLL_FIRST) && lv_obj_has_flag(dsc->focused_obj, LV_OBJ_FLAG_SCROLLABLE) && lv_obj_get_scroll_bottom(dsc->focused_obj) > 0) { - int32_t d = lv_obj_get_height(dsc->focused_obj) / 4; + lv_coord_t d = lv_obj_get_height(dsc->focused_obj) / 4; if(d <= 0) d = 1; lv_obj_scroll_by_bounded(dsc->focused_obj, 0, -d, LV_ANIM_ON); } @@ -203,10 +181,10 @@ static void gridnav_event_cb(lv_event_t * e) } } } - else if(key == LV_KEY_UP && !(dsc->ctrl & LV_GRIDNAV_CTRL_HORIZONTAL_MOVE_ONLY)) { + else if(key == LV_KEY_UP) { if((dsc->ctrl & LV_GRIDNAV_CTRL_SCROLL_FIRST) && lv_obj_has_flag(dsc->focused_obj, LV_OBJ_FLAG_SCROLLABLE) && lv_obj_get_scroll_top(dsc->focused_obj) > 0) { - int32_t d = lv_obj_get_height(dsc->focused_obj) / 4; + lv_coord_t d = lv_obj_get_height(dsc->focused_obj) / 4; if(d <= 0) d = 1; lv_obj_scroll_by_bounded(dsc->focused_obj, 0, d, LV_ANIM_ON); } @@ -224,15 +202,13 @@ static void gridnav_event_cb(lv_event_t * e) } else { if(lv_group_get_focused(lv_obj_get_group(obj)) == obj) { - lv_obj_send_event(dsc->focused_obj, LV_EVENT_KEY, &key); + lv_event_send(dsc->focused_obj, LV_EVENT_KEY, &key); } } if(guess && guess != dsc->focused_obj) { - lv_obj_remove_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); - lv_obj_send_event(dsc->focused_obj, LV_EVENT_DEFOCUSED, lv_indev_active()); + lv_obj_clear_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); lv_obj_add_state(guess, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); - lv_obj_send_event(guess, LV_EVENT_FOCUSED, lv_indev_active()); lv_obj_scroll_to_view(guess, LV_ANIM_ON); dsc->focused_obj = guess; } @@ -241,13 +217,13 @@ static void gridnav_event_cb(lv_event_t * e) if(dsc->focused_obj == NULL) dsc->focused_obj = find_first_focusable(obj); if(dsc->focused_obj) { lv_obj_add_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); - lv_obj_remove_state(dsc->focused_obj, LV_STATE_PRESSED); /*Be sure the focuses obj is not stuck in pressed state*/ + lv_obj_clear_state(dsc->focused_obj, LV_STATE_PRESSED); /*Be sure the focuses obj is not stuck in pressed state*/ lv_obj_scroll_to_view(dsc->focused_obj, LV_ANIM_OFF); } } else if(code == LV_EVENT_DEFOCUSED) { if(dsc->focused_obj) { - lv_obj_remove_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); + lv_obj_clear_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY); } } else if(code == LV_EVENT_CHILD_CREATED) { @@ -275,13 +251,13 @@ static void gridnav_event_cb(lv_event_t * e) lv_gridnav_remove(obj); } else if(code == LV_EVENT_PRESSED || code == LV_EVENT_PRESSING || code == LV_EVENT_PRESS_LOST || - code == LV_EVENT_SHORT_CLICKED || code == LV_EVENT_LONG_PRESSED || code == LV_EVENT_LONG_PRESSED_REPEAT || + code == LV_EVENT_LONG_PRESSED || code == LV_EVENT_LONG_PRESSED_REPEAT || code == LV_EVENT_CLICKED || code == LV_EVENT_RELEASED) { if(lv_group_get_focused(lv_obj_get_group(obj)) == obj) { /*Forward press/release related event too*/ - lv_indev_type_t t = lv_indev_get_type(lv_indev_active()); + lv_indev_type_t t = lv_indev_get_type(lv_indev_get_act()); if(t == LV_INDEV_TYPE_ENCODER || t == LV_INDEV_TYPE_KEYPAD) { - lv_obj_send_event(dsc->focused_obj, code, lv_indev_active()); + lv_event_send(dsc->focused_obj, code, lv_indev_get_act()); } } } @@ -289,22 +265,22 @@ static void gridnav_event_cb(lv_event_t * e) static lv_obj_t * find_chid(lv_obj_t * obj, lv_obj_t * start_child, find_mode_t mode) { - int32_t x_start = get_x_center(start_child); - int32_t y_start = get_y_center(start_child); - uint32_t child_cnt = lv_obj_get_child_count(obj); + lv_coord_t x_start = get_x_center(start_child); + lv_coord_t y_start = get_y_center(start_child); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); lv_obj_t * guess = NULL; - int32_t x_err_guess = LV_COORD_MAX; - int32_t y_err_guess = LV_COORD_MAX; - int32_t h_half = lv_obj_get_height(start_child) / 2; - int32_t h_max = lv_obj_get_height(obj) + lv_obj_get_scroll_top(obj) + lv_obj_get_scroll_bottom(obj); + lv_coord_t x_err_guess = LV_COORD_MAX; + lv_coord_t y_err_guess = LV_COORD_MAX; + lv_coord_t h_half = lv_obj_get_height(start_child) / 2; + lv_coord_t h_max = lv_obj_get_height(obj) + lv_obj_get_scroll_top(obj) + lv_obj_get_scroll_bottom(obj); uint32_t i; for(i = 0; i < child_cnt; i++) { lv_obj_t * child = lv_obj_get_child(obj, i); if(child == start_child) continue; - if(obj_is_focusable(child) == false) continue; + if(obj_is_focuable(child) == false) continue; - int32_t x_err = 0; - int32_t y_err = 0; + lv_coord_t x_err = 0; + lv_coord_t y_err = 0; switch(mode) { case FIND_LEFT: x_err = get_x_center(child) - x_start; @@ -359,11 +335,11 @@ static lv_obj_t * find_chid(lv_obj_t * obj, lv_obj_t * start_child, find_mode_t static lv_obj_t * find_first_focusable(lv_obj_t * obj) { - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); uint32_t i; for(i = 0; i < child_cnt; i++) { lv_obj_t * child = lv_obj_get_child(obj, i); - if(obj_is_focusable(child)) return child; + if(obj_is_focuable(child)) return child; } return NULL; @@ -371,28 +347,28 @@ static lv_obj_t * find_first_focusable(lv_obj_t * obj) static lv_obj_t * find_last_focusable(lv_obj_t * obj) { - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); int32_t i; for(i = child_cnt - 1; i >= 0; i--) { lv_obj_t * child = lv_obj_get_child(obj, i); - if(obj_is_focusable(child)) return child; + if(obj_is_focuable(child)) return child; } return NULL; } -static bool obj_is_focusable(lv_obj_t * obj) +static bool obj_is_focuable(lv_obj_t * obj) { if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return false; if(lv_obj_has_flag(obj, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_CLICK_FOCUSABLE)) return true; else return false; } -static int32_t get_x_center(lv_obj_t * obj) +static lv_coord_t get_x_center(lv_obj_t * obj) { return obj->coords.x1 + lv_area_get_width(&obj->coords) / 2; } -static int32_t get_y_center(lv_obj_t * obj) +static lv_coord_t get_y_center(lv_obj_t * obj) { return obj->coords.y1 + lv_area_get_height(&obj->coords) / 2; } diff --git a/L3_Middlewares/LVGL/src/others/gridnav/lv_gridnav.h b/L3_Middlewares/LVGL/src/extra/others/gridnav/lv_gridnav.h similarity index 72% rename from L3_Middlewares/LVGL/src/others/gridnav/lv_gridnav.h rename to L3_Middlewares/LVGL/src/extra/others/gridnav/lv_gridnav.h index 65bd1e0..f480ded 100644 --- a/L3_Middlewares/LVGL/src/others/gridnav/lv_gridnav.h +++ b/L3_Middlewares/LVGL/src/extra/others/gridnav/lv_gridnav.h @@ -1,10 +1,50 @@ +/** + * @file lv_templ.c + * + */ + +/********************* + * INCLUDES + *********************/ + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/*This typedef exists purely to keep -Wpedantic happy when the file is empty.*/ +/*It can be removed.*/ +typedef int _keep_pedantic_happy; + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/********************** + * STATIC FUNCTIONS + **********************/ /** * @file lv_gridnav.h * */ -#ifndef LV_GRIDNAV_H -#define LV_GRIDNAV_H +#ifndef LV_GRIDFOCUS_H +#define LV_GRIDFOCUS_H #ifdef __cplusplus extern "C" { @@ -13,7 +53,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../core/lv_obj.h" +#include "../../../core/lv_obj.h" #if LV_USE_GRIDNAV @@ -40,18 +80,6 @@ typedef enum { * If there is no more room for scrolling the next/previous object will be focused normally */ LV_GRIDNAV_CTRL_SCROLL_FIRST = 0x2, - /** - * Only use left/right keys for grid navigation. Up/down key events will be sent to the - * focused object. - */ - LV_GRIDNAV_CTRL_HORIZONTAL_MOVE_ONLY = 0x4, - - /** - * Only use up/down keys for grid navigation. Left/right key events will be sent to the - * focused object. - */ - LV_GRIDNAV_CTRL_VERTICAL_MOVE_ONLY = 0x8 - } lv_gridnav_ctrl_t; /********************** @@ -92,4 +120,4 @@ void lv_gridnav_set_focused(lv_obj_t * cont, lv_obj_t * to_focus, lv_anim_enable } /*extern "C"*/ #endif -#endif /* LV_GRIDNAV_H */ +#endif /*LV_GRIDFOCUS_H*/ diff --git a/L3_Middlewares/LVGL/src/others/ime/lv_ime_pinyin.c b/L3_Middlewares/LVGL/src/extra/others/ime/lv_ime_pinyin.c similarity index 73% rename from L3_Middlewares/LVGL/src/others/ime/lv_ime_pinyin.c rename to L3_Middlewares/LVGL/src/extra/others/ime/lv_ime_pinyin.c index 8382269..9834154 100644 --- a/L3_Middlewares/LVGL/src/others/ime/lv_ime_pinyin.c +++ b/L3_Middlewares/LVGL/src/extra/others/ime/lv_ime_pinyin.c @@ -6,18 +6,15 @@ /********************* * INCLUDES *********************/ -#include "lv_ime_pinyin_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_ime_pinyin.h" #if LV_USE_IME_PINYIN != 0 -#include "../../lvgl.h" -#include "../../core/lv_global.h" +#include /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_ime_pinyin_class) -#define cand_len LV_GLOBAL_DEFAULT()->ime_cand_len +#define MY_CLASS &lv_ime_pinyin_class /********************** * TYPEDEFS @@ -32,7 +29,7 @@ static void lv_ime_pinyin_style_change_event(lv_event_t * e); static void lv_ime_pinyin_kb_event(lv_event_t * e); static void lv_ime_pinyin_cand_panel_event(lv_event_t * e); -static void init_pinyin_dict(lv_obj_t * obj, const lv_pinyin_dict_t * dict); +static void init_pinyin_dict(lv_obj_t * obj, lv_pinyin_dict_t * dict); static void pinyin_input_proc(lv_obj_t * obj); static void pinyin_page_proc(lv_obj_t * obj, uint16_t btn); static char * pinyin_search_matching(lv_obj_t * obj, char * py_str, uint16_t * cand_num); @@ -49,7 +46,6 @@ static void pinyin_ime_clear_data(lv_obj_t * obj); /********************** * STATIC VARIABLES **********************/ - const lv_obj_class_t lv_ime_pinyin_class = { .constructor_cb = lv_ime_pinyin_constructor, .destructor_cb = lv_ime_pinyin_destructor, @@ -57,19 +53,18 @@ const lv_obj_class_t lv_ime_pinyin_class = { .height_def = LV_SIZE_CONTENT, .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, .instance_size = sizeof(lv_ime_pinyin_t), - .base_class = &lv_obj_class, - .name = "ime-pinyin", + .base_class = &lv_obj_class }; #if LV_IME_PINYIN_USE_K9_MODE -static const char * lv_btnm_def_pinyin_k9_map[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 21] = {\ - ",\0", "123\0", "abc \0", "def\0", LV_SYMBOL_BACKSPACE"\0", "\n\0", - ".\0", "ghi\0", "jkl\0", "mno\0", LV_SYMBOL_KEYBOARD"\0", "\n\0", - "?\0", "pqrs\0", "tuv\0", "wxyz\0", LV_SYMBOL_NEW_LINE"\0", "\n\0", - LV_SYMBOL_LEFT"\0", "\0" - }; - -static lv_buttonmatrix_ctrl_t default_kb_ctrl_k9_map[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 17] = { 1 }; +static char * lv_btnm_def_pinyin_k9_map[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 20] = {\ + ",\0", "1#\0", "abc \0", "def\0", LV_SYMBOL_BACKSPACE"\0", "\n\0", + ".\0", "ghi\0", "jkl\0", "mno\0", LV_SYMBOL_KEYBOARD"\0", "\n\0", + "?\0", "pqrs\0", "tuv\0", "wxyz\0", LV_SYMBOL_NEW_LINE"\0", "\n\0", + LV_SYMBOL_LEFT"\0", "\0" + }; + +static lv_btnmatrix_ctrl_t default_kb_ctrl_k9_map[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 16] = { 1 }; static char lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 2][LV_IME_PINYIN_K9_MAX_INPUT] = {0}; #endif @@ -77,7 +72,7 @@ static char lv_pinyin_cand_str[LV_IME_PINYIN_CAND_TEXT_NUM][4]; static char * lv_btnm_def_pinyin_sel_map[LV_IME_PINYIN_CAND_TEXT_NUM + 3]; #if LV_IME_PINYIN_USE_DEFAULT_DICT -static const lv_pinyin_dict_t lv_ime_pinyin_def_dict[] = { +lv_pinyin_dict_t lv_ime_pinyin_def_dict[] = { { "a", "啊" }, { "ai", "愛" }, { "an", "安暗案" }, @@ -257,13 +252,13 @@ static const lv_pinyin_dict_t lv_ime_pinyin_def_dict[] = { { "o", "" }, { "ou", "歐" }, { "pa", "怕" }, + { "pian", "片便" }, { "pai", "迫派排" }, { "pan", "判番" }, { "pang", "旁" }, { "pei", "配" }, { "peng", "朋" }, { "pi", "疲否" }, - { "pian", "片便" }, { "pin", "品貧" }, { "ping", "平評" }, { "po", "迫破泊頗" }, @@ -403,6 +398,7 @@ static const lv_pinyin_dict_t lv_ime_pinyin_def_dict[] = { }; #endif + /********************** * MACROS **********************/ @@ -418,10 +414,16 @@ lv_obj_t * lv_ime_pinyin_create(lv_obj_t * parent) return obj; } + /*===================== * Setter functions *====================*/ +/** + * Set the keyboard of Pinyin input method. + * @param obj pointer to a Pinyin input method object + * @param dict pointer to a Pinyin input method keyboard + */ void lv_ime_pinyin_set_keyboard(lv_obj_t * obj, lv_obj_t * kb) { if(kb) { @@ -432,12 +434,15 @@ void lv_ime_pinyin_set_keyboard(lv_obj_t * obj, lv_obj_t * kb) lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; pinyin_ime->kb = kb; - lv_obj_set_parent(obj, lv_obj_get_parent(kb)); - lv_obj_set_parent(pinyin_ime->cand_panel, lv_obj_get_parent(kb)); lv_obj_add_event_cb(pinyin_ime->kb, lv_ime_pinyin_kb_event, LV_EVENT_VALUE_CHANGED, obj); lv_obj_align_to(pinyin_ime->cand_panel, pinyin_ime->kb, LV_ALIGN_OUT_TOP_MID, 0, 0); } +/** + * Set the dictionary of Pinyin input method. + * @param obj pointer to a Pinyin input method object + * @param dict pointer to a Pinyin input method dictionary + */ void lv_ime_pinyin_set_dict(lv_obj_t * obj, lv_pinyin_dict_t * dict) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -445,6 +450,11 @@ void lv_ime_pinyin_set_dict(lv_obj_t * obj, lv_pinyin_dict_t * dict) init_pinyin_dict(obj, dict); } +/** + * Set mode, 26-key input(k26) or 9-key input(k9). + * @param obj pointer to a Pinyin input method object + * @param mode the mode from 'lv_keyboard_mode_t' + */ void lv_ime_pinyin_set_mode(lv_obj_t * obj, lv_ime_pinyin_mode_t mode) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -457,8 +467,8 @@ void lv_ime_pinyin_set_mode(lv_obj_t * obj, lv_ime_pinyin_mode_t mode) #if LV_IME_PINYIN_USE_K9_MODE if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K9) { pinyin_k9_init_data(obj); - lv_keyboard_set_map(pinyin_ime->kb, LV_KEYBOARD_MODE_USER_1, (const char **)lv_btnm_def_pinyin_k9_map, - default_kb_ctrl_k9_map); + lv_keyboard_set_map(pinyin_ime->kb, LV_KEYBOARD_MODE_USER_1, (const char *)lv_btnm_def_pinyin_k9_map, + (const)default_kb_ctrl_k9_map); lv_keyboard_set_mode(pinyin_ime->kb, LV_KEYBOARD_MODE_USER_1); } #endif @@ -468,6 +478,11 @@ void lv_ime_pinyin_set_mode(lv_obj_t * obj, lv_ime_pinyin_mode_t mode) * Getter functions *====================*/ +/** + * Set the dictionary of Pinyin input method. + * @param obj pointer to a Pinyin IME object + * @return pointer to the Pinyin IME keyboard + */ lv_obj_t * lv_ime_pinyin_get_kb(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -477,6 +492,11 @@ lv_obj_t * lv_ime_pinyin_get_kb(lv_obj_t * obj) return pinyin_ime->kb; } +/** + * Set the dictionary of Pinyin input method. + * @param obj pointer to a Pinyin input method object + * @return pointer to the Pinyin input method candidate panel + */ lv_obj_t * lv_ime_pinyin_get_cand_panel(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -486,7 +506,12 @@ lv_obj_t * lv_ime_pinyin_get_cand_panel(lv_obj_t * obj) return pinyin_ime->cand_panel; } -const lv_pinyin_dict_t * lv_ime_pinyin_get_dict(lv_obj_t * obj) +/** + * Set the dictionary of Pinyin input method. + * @param obj pointer to a Pinyin input method object + * @return pointer to the Pinyin input method dictionary + */ +lv_pinyin_dict_t * lv_ime_pinyin_get_dict(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -533,24 +558,27 @@ static void lv_ime_pinyin_constructor(const lv_obj_class_t * class_p, lv_obj_t * pinyin_ime->py_page = 0; pinyin_ime->ta_count = 0; pinyin_ime->cand_num = 0; - lv_memzero(pinyin_ime->input_char, sizeof(pinyin_ime->input_char)); - lv_memzero(pinyin_ime->py_num, sizeof(pinyin_ime->py_num)); - lv_memzero(pinyin_ime->py_pos, sizeof(pinyin_ime->py_pos)); + lv_memset_00(pinyin_ime->input_char, sizeof(pinyin_ime->input_char)); + lv_memset_00(pinyin_ime->py_num, sizeof(pinyin_ime->py_num)); + lv_memset_00(pinyin_ime->py_pos, sizeof(pinyin_ime->py_pos)); lv_obj_add_flag(obj, LV_OBJ_FLAG_HIDDEN); + lv_obj_set_size(obj, LV_PCT(100), LV_PCT(55)); + lv_obj_align(obj, LV_ALIGN_BOTTOM_MID, 0, 0); + #if LV_IME_PINYIN_USE_DEFAULT_DICT init_pinyin_dict(obj, lv_ime_pinyin_def_dict); #endif /* Init pinyin_ime->cand_panel */ - pinyin_ime->cand_panel = lv_buttonmatrix_create(lv_obj_get_parent(obj)); - lv_buttonmatrix_set_map(pinyin_ime->cand_panel, (const char **)lv_btnm_def_pinyin_sel_map); + pinyin_ime->cand_panel = lv_btnmatrix_create(lv_scr_act()); + lv_btnmatrix_set_map(pinyin_ime->cand_panel, (const char **)lv_btnm_def_pinyin_sel_map); lv_obj_set_size(pinyin_ime->cand_panel, LV_PCT(100), LV_PCT(5)); lv_obj_add_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); - lv_buttonmatrix_set_one_checked(pinyin_ime->cand_panel, true); - lv_obj_remove_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_CLICK_FOCUSABLE); + lv_btnmatrix_set_one_checked(pinyin_ime->cand_panel, true); + lv_obj_clear_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_CLICK_FOCUSABLE); /* Set cand_panel style*/ // Default style @@ -580,14 +608,15 @@ static void lv_ime_pinyin_constructor(const lv_obj_class_t * class_p, lv_obj_t * pinyin_ime->k9_input_str_len = 0; pinyin_ime->k9_py_ll_pos = 0; pinyin_ime->k9_legal_py_count = 0; - lv_memzero(pinyin_ime->k9_input_str, LV_IME_PINYIN_K9_MAX_INPUT); + lv_memset_00(pinyin_ime->k9_input_str, LV_IME_PINYIN_K9_MAX_INPUT); pinyin_k9_init_data(obj); - lv_ll_init(&(pinyin_ime->k9_legal_py_ll), sizeof(ime_pinyin_k9_py_str_t)); + _lv_ll_init(&(pinyin_ime->k9_legal_py_ll), sizeof(ime_pinyin_k9_py_str_t)); #endif } + static void lv_ime_pinyin_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { LV_UNUSED(class_p); @@ -595,16 +624,17 @@ static void lv_ime_pinyin_destructor(const lv_obj_class_t * class_p, lv_obj_t * lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; if(lv_obj_is_valid(pinyin_ime->kb)) - lv_obj_delete(pinyin_ime->kb); + lv_obj_del(pinyin_ime->kb); if(lv_obj_is_valid(pinyin_ime->cand_panel)) - lv_obj_delete(pinyin_ime->cand_panel); + lv_obj_del(pinyin_ime->cand_panel); } + static void lv_ime_pinyin_kb_event(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * kb = lv_event_get_current_target(e); + lv_obj_t * kb = lv_event_get_target(e); lv_obj_t * obj = lv_event_get_user_data(e); lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; @@ -614,29 +644,28 @@ static void lv_ime_pinyin_kb_event(lv_event_t * e) #endif if(code == LV_EVENT_VALUE_CHANGED) { - uint16_t btn_id = lv_buttonmatrix_get_selected_button(kb); - if(btn_id == LV_BUTTONMATRIX_BUTTON_NONE) return; + uint16_t btn_id = lv_btnmatrix_get_selected_btn(kb); + if(btn_id == LV_BTNMATRIX_BTN_NONE) return; - const char * txt = lv_buttonmatrix_get_button_text(kb, lv_buttonmatrix_get_selected_button(kb)); + const char * txt = lv_btnmatrix_get_btn_text(kb, lv_btnmatrix_get_selected_btn(kb)); if(txt == NULL) return; - lv_obj_t * ta = lv_keyboard_get_textarea(pinyin_ime->kb); - #if LV_IME_PINYIN_USE_K9_MODE if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K9) { - - uint16_t tmp_button_str_len = lv_strlen(pinyin_ime->input_char); - if((btn_id >= 16) && (tmp_button_str_len > 0) && (btn_id < (16 + LV_IME_PINYIN_K9_CAND_TEXT_NUM))) { - lv_memzero(pinyin_ime->input_char, sizeof(pinyin_ime->input_char)); - lv_strcat(pinyin_ime->input_char, txt); + lv_obj_t * ta = lv_keyboard_get_textarea(pinyin_ime->kb); + uint16_t tmp_btn_str_len = strlen(pinyin_ime->input_char); + if((btn_id >= 16) && (tmp_btn_str_len > 0) && (btn_id < (16 + LV_IME_PINYIN_K9_CAND_TEXT_NUM))) { + tmp_btn_str_len = strlen(pinyin_ime->input_char); + lv_memset_00(pinyin_ime->input_char, sizeof(pinyin_ime->input_char)); + strcat(pinyin_ime->input_char, txt); pinyin_input_proc(obj); - for(int index = 0; index < (pinyin_ime->ta_count + tmp_button_str_len); index++) { - lv_textarea_delete_char(ta); + for(int index = 0; index < (pinyin_ime->ta_count + tmp_btn_str_len); index++) { + lv_textarea_del_char(ta); } - pinyin_ime->ta_count = tmp_button_str_len; - pinyin_ime->k9_input_str_len = tmp_button_str_len; + pinyin_ime->ta_count = tmp_btn_str_len; + pinyin_ime->k9_input_str_len = tmp_btn_str_len; lv_textarea_add_text(ta, pinyin_ime->input_char); return; @@ -644,11 +673,11 @@ static void lv_ime_pinyin_kb_event(lv_event_t * e) } #endif - if(lv_strcmp(txt, "Enter") == 0 || lv_strcmp(txt, LV_SYMBOL_NEW_LINE) == 0) { + if(strcmp(txt, "Enter") == 0 || strcmp(txt, LV_SYMBOL_NEW_LINE) == 0) { pinyin_ime_clear_data(obj); lv_obj_add_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); } - else if(lv_strcmp(txt, LV_SYMBOL_BACKSPACE) == 0) { + else if(strcmp(txt, LV_SYMBOL_BACKSPACE) == 0) { // del input char if(pinyin_ime->ta_count > 0) { if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K26) @@ -658,68 +687,59 @@ static void lv_ime_pinyin_kb_event(lv_event_t * e) pinyin_ime->k9_input_str[pinyin_ime->ta_count - 1] = '\0'; #endif - pinyin_ime->ta_count--; + pinyin_ime->ta_count = pinyin_ime->ta_count - 1; if(pinyin_ime->ta_count <= 0) { - pinyin_ime_clear_data(obj); lv_obj_add_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); +#if LV_IME_PINYIN_USE_K9_MODE + lv_memset_00(lv_pinyin_k9_cand_str, sizeof(lv_pinyin_k9_cand_str)); + strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM], LV_SYMBOL_RIGHT"\0"); + strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 1], "\0"); +#endif } else if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K26) { pinyin_input_proc(obj); } #if LV_IME_PINYIN_USE_K9_MODE else if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K9) { - pinyin_ime->k9_input_str_len = lv_strlen(pinyin_ime->input_char) - 1; + pinyin_ime->k9_input_str_len = strlen(pinyin_ime->input_char) - 1; pinyin_k9_get_legal_py(obj, pinyin_ime->k9_input_str, k9_py_map); pinyin_k9_fill_cand(obj); pinyin_input_proc(obj); - pinyin_ime->ta_count--; } #endif } } - else if((lv_strcmp(txt, "ABC") == 0) || (lv_strcmp(txt, "abc") == 0) || (lv_strcmp(txt, "1#") == 0) || - (lv_strcmp(txt, LV_SYMBOL_OK) == 0)) { - pinyin_ime_clear_data(obj); + else if((strcmp(txt, "ABC") == 0) || (strcmp(txt, "abc") == 0) || (strcmp(txt, "1#") == 0)) { + pinyin_ime->ta_count = 0; + lv_memset_00(pinyin_ime->input_char, sizeof(pinyin_ime->input_char)); return; } - else if(lv_strcmp(txt, "123") == 0) { - for(uint16_t i = 0; i < lv_strlen(txt); i++) - lv_textarea_delete_char(ta); - - pinyin_ime_clear_data(obj); - lv_textarea_set_cursor_pos(ta, LV_TEXTAREA_CURSOR_LAST); - lv_ime_pinyin_set_mode(obj, LV_IME_PINYIN_MODE_K9_NUMBER); - lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_NUMBER); - lv_obj_add_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); - } - else if(lv_strcmp(txt, LV_SYMBOL_KEYBOARD) == 0) { + else if(strcmp(txt, LV_SYMBOL_KEYBOARD) == 0) { if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K26) { - lv_ime_pinyin_set_mode(obj, LV_IME_PINYIN_MODE_K9); + lv_ime_pinyin_set_mode(pinyin_ime, LV_IME_PINYIN_MODE_K9); } - else if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K9) { - lv_ime_pinyin_set_mode(obj, LV_IME_PINYIN_MODE_K26); + else { + lv_ime_pinyin_set_mode(pinyin_ime, LV_IME_PINYIN_MODE_K26); lv_keyboard_set_mode(pinyin_ime->kb, LV_KEYBOARD_MODE_TEXT_LOWER); } - else if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K9_NUMBER) { - lv_ime_pinyin_set_mode(obj, LV_IME_PINYIN_MODE_K9); - } + pinyin_ime_clear_data(obj); + } + else if(strcmp(txt, LV_SYMBOL_OK) == 0) { pinyin_ime_clear_data(obj); } else if((pinyin_ime->mode == LV_IME_PINYIN_MODE_K26) && ((txt[0] >= 'a' && txt[0] <= 'z') || (txt[0] >= 'A' && txt[0] <= 'Z'))) { - uint16_t len = lv_strlen(pinyin_ime->input_char); - lv_snprintf(pinyin_ime->input_char + len, sizeof(pinyin_ime->input_char) - len, "%s", txt); + strcat(pinyin_ime->input_char, txt); pinyin_input_proc(obj); pinyin_ime->ta_count++; } #if LV_IME_PINYIN_USE_K9_MODE else if((pinyin_ime->mode == LV_IME_PINYIN_MODE_K9) && (txt[0] >= 'a' && txt[0] <= 'z')) { for(uint16_t i = 0; i < 8; i++) { - if((lv_strcmp(txt, k9_py_map[i]) == 0) || (lv_strcmp(txt, "abc ") == 0)) { - if(lv_strcmp(txt, "abc ") == 0) pinyin_ime->k9_input_str_len += lv_strlen(k9_py_map[i]) + 1; - else pinyin_ime->k9_input_str_len += lv_strlen(k9_py_map[i]); + if((strcmp(txt, k9_py_map[i]) == 0) || (strcmp(txt, "abc ") == 0)) { + if(strcmp(txt, "abc ") == 0) pinyin_ime->k9_input_str_len += strlen(k9_py_map[i]) + 1; + else pinyin_ime->k9_input_str_len += strlen(k9_py_map[i]); pinyin_ime->k9_input_str[pinyin_ime->ta_count] = 50 + i; - pinyin_ime->k9_input_str[pinyin_ime->ta_count + 1] = '\0'; break; } @@ -728,45 +748,41 @@ static void lv_ime_pinyin_kb_event(lv_event_t * e) pinyin_k9_fill_cand(obj); pinyin_input_proc(obj); } - else if(lv_strcmp(txt, LV_SYMBOL_LEFT) == 0) { + else if(strcmp(txt, LV_SYMBOL_LEFT) == 0) { pinyin_k9_cand_page_proc(obj, 0); } - else if(lv_strcmp(txt, LV_SYMBOL_RIGHT) == 0) { + else if(strcmp(txt, LV_SYMBOL_RIGHT) == 0) { pinyin_k9_cand_page_proc(obj, 1); } #endif } } + static void lv_ime_pinyin_cand_panel_event(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * cand_panel = lv_event_get_current_target(e); + lv_obj_t * cand_panel = lv_event_get_target(e); lv_obj_t * obj = (lv_obj_t *)lv_event_get_user_data(e); lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; if(code == LV_EVENT_VALUE_CHANGED) { - lv_obj_t * ta = lv_keyboard_get_textarea(pinyin_ime->kb); - if(ta == NULL) return; - - uint32_t id = lv_buttonmatrix_get_selected_button(cand_panel); - if(id == LV_BUTTONMATRIX_BUTTON_NONE) { - return; - } - else if(id == 0) { + uint32_t id = lv_btnmatrix_get_selected_btn(cand_panel); + if(id == 0) { pinyin_page_proc(obj, 0); return; } - else if(id == (LV_IME_PINYIN_CAND_TEXT_NUM + 1)) { + if(id == (LV_IME_PINYIN_CAND_TEXT_NUM + 1)) { pinyin_page_proc(obj, 1); return; } - const char * txt = lv_buttonmatrix_get_button_text(cand_panel, id); + const char * txt = lv_btnmatrix_get_btn_text(cand_panel, id); + lv_obj_t * ta = lv_keyboard_get_textarea(pinyin_ime->kb); uint16_t index = 0; for(index = 0; index < pinyin_ime->ta_count; index++) - lv_textarea_delete_char(ta); + lv_textarea_del_char(ta); lv_textarea_add_text(ta, txt); @@ -774,6 +790,7 @@ static void lv_ime_pinyin_cand_panel_event(lv_event_t * e) } } + static void pinyin_input_proc(lv_obj_t * obj) { lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; @@ -786,7 +803,7 @@ static void pinyin_input_proc(lv_obj_t * obj) pinyin_ime->py_page = 0; for(uint8_t i = 0; i < LV_IME_PINYIN_CAND_TEXT_NUM; i++) { - lv_memset(lv_pinyin_cand_str[i], 0x00, sizeof(lv_pinyin_cand_str[i])); + memset(lv_pinyin_cand_str[i], 0x00, sizeof(lv_pinyin_cand_str[i])); lv_pinyin_cand_str[i][0] = ' '; } @@ -797,16 +814,14 @@ static void pinyin_input_proc(lv_obj_t * obj) } } - lv_obj_remove_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); } static void pinyin_page_proc(lv_obj_t * obj, uint16_t dir) { lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; uint16_t page_num = pinyin_ime->cand_num / LV_IME_PINYIN_CAND_TEXT_NUM; - uint16_t remainder = pinyin_ime->cand_num % LV_IME_PINYIN_CAND_TEXT_NUM; - - if(!pinyin_ime->cand_str) return; + uint16_t sur = pinyin_ime->cand_num % LV_IME_PINYIN_CAND_TEXT_NUM; if(dir == 0) { if(pinyin_ime->py_page) { @@ -814,7 +829,7 @@ static void pinyin_page_proc(lv_obj_t * obj, uint16_t dir) } } else { - if(remainder == 0) { + if(sur == 0) { page_num -= 1; } if(pinyin_ime->py_page < page_num) { @@ -824,15 +839,15 @@ static void pinyin_page_proc(lv_obj_t * obj, uint16_t dir) } for(uint8_t i = 0; i < LV_IME_PINYIN_CAND_TEXT_NUM; i++) { - lv_memset(lv_pinyin_cand_str[i], 0x00, sizeof(lv_pinyin_cand_str[i])); + memset(lv_pinyin_cand_str[i], 0x00, sizeof(lv_pinyin_cand_str[i])); lv_pinyin_cand_str[i][0] = ' '; } // fill buf uint16_t offset = pinyin_ime->py_page * (3 * LV_IME_PINYIN_CAND_TEXT_NUM); for(uint8_t i = 0; (i < pinyin_ime->cand_num && i < LV_IME_PINYIN_CAND_TEXT_NUM); i++) { - if((remainder > 0) && (pinyin_ime->py_page == page_num)) { - if(i >= remainder) + if((sur > 0) && (pinyin_ime->py_page == page_num)) { + if(i > sur) break; } for(uint8_t j = 0; j < 3; j++) { @@ -841,10 +856,11 @@ static void pinyin_page_proc(lv_obj_t * obj, uint16_t dir) } } + static void lv_ime_pinyin_style_change_event(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; @@ -854,7 +870,8 @@ static void lv_ime_pinyin_style_change_event(lv_event_t * e) } } -static void init_pinyin_dict(lv_obj_t * obj, const lv_pinyin_dict_t * dict) + +static void init_pinyin_dict(lv_obj_t * obj, lv_pinyin_dict_t * dict) { lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; @@ -878,8 +895,8 @@ static void init_pinyin_dict(lv_obj_t * obj, const lv_pinyin_dict_t * dict) } else { headletter = dict[i].py[0]; - pinyin_ime->py_num[letter_calc] = offset_count; letter_calc = headletter - 'a'; + pinyin_ime->py_num[letter_calc - 1] = offset_count; offset_sum += offset_count; pinyin_ime->py_pos[letter_calc] = offset_sum; @@ -888,11 +905,12 @@ static void init_pinyin_dict(lv_obj_t * obj, const lv_pinyin_dict_t * dict) } } + static char * pinyin_search_matching(lv_obj_t * obj, char * py_str, uint16_t * cand_num) { lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; - const lv_pinyin_dict_t * cpHZ; + lv_pinyin_dict_t * cpHZ; uint8_t index, len = 0, offset; volatile uint8_t count = 0; @@ -900,10 +918,9 @@ static char * pinyin_search_matching(lv_obj_t * obj, char * py_str, uint16_t * c if(*py_str == 'i') return NULL; if(*py_str == 'u') return NULL; if(*py_str == 'v') return NULL; - if(*py_str == ' ') return NULL; offset = py_str[0] - 'a'; - len = lv_strlen(py_str); + len = strlen(py_str); cpHZ = &pinyin_ime->dict[pinyin_ime->py_pos[offset]]; count = pinyin_ime->py_num[offset]; @@ -918,7 +935,7 @@ static char * pinyin_search_matching(lv_obj_t * obj, char * py_str, uint16_t * c // perfect match if(len == 1 || index == len) { // The Chinese character in UTF-8 encoding format is 3 bytes - * cand_num = lv_strlen((const char *)(cpHZ->py_mb)) / 3; + * cand_num = strlen((const char *)(cpHZ->py_mb)) / 3; return (char *)(cpHZ->py_mb); } cpHZ++; @@ -930,70 +947,64 @@ static void pinyin_ime_clear_data(lv_obj_t * obj) { lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; + #if LV_IME_PINYIN_USE_K9_MODE if(pinyin_ime->mode == LV_IME_PINYIN_MODE_K9) { pinyin_ime->k9_input_str_len = 0; pinyin_ime->k9_py_ll_pos = 0; pinyin_ime->k9_legal_py_count = 0; - lv_memzero(pinyin_ime->k9_input_str, LV_IME_PINYIN_K9_MAX_INPUT); - lv_memzero(lv_pinyin_k9_cand_str, sizeof(lv_pinyin_k9_cand_str)); - for(uint8_t i = 0; i < LV_IME_PINYIN_CAND_TEXT_NUM; i++) { - lv_strcpy(lv_pinyin_k9_cand_str[i], " "); - } - lv_strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM], LV_SYMBOL_RIGHT"\0"); - lv_strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 1], "\0"); - lv_buttonmatrix_set_map(pinyin_ime->kb, (const char **)lv_btnm_def_pinyin_k9_map); + lv_memset_00(pinyin_ime->k9_input_str, LV_IME_PINYIN_K9_MAX_INPUT); + lv_memset_00(lv_pinyin_k9_cand_str, sizeof(lv_pinyin_k9_cand_str)); + strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM], LV_SYMBOL_RIGHT"\0"); + strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 1], "\0"); } #endif pinyin_ime->ta_count = 0; - for(uint8_t i = 0; i < LV_IME_PINYIN_CAND_TEXT_NUM; i++) { - lv_memset(lv_pinyin_cand_str[i], 0x00, sizeof(lv_pinyin_cand_str[i])); - lv_pinyin_cand_str[i][0] = ' '; - } - lv_memzero(pinyin_ime->input_char, sizeof(pinyin_ime->input_char)); + lv_memset_00(lv_pinyin_cand_str, (sizeof(lv_pinyin_cand_str))); + lv_memset_00(pinyin_ime->input_char, sizeof(pinyin_ime->input_char)); lv_obj_add_flag(pinyin_ime->cand_panel, LV_OBJ_FLAG_HIDDEN); } + #if LV_IME_PINYIN_USE_K9_MODE static void pinyin_k9_init_data(lv_obj_t * obj) { - LV_UNUSED(obj); + lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; uint16_t py_str_i = 0; uint16_t btnm_i = 0; for(btnm_i = 19; btnm_i < (LV_IME_PINYIN_K9_CAND_TEXT_NUM + 21); btnm_i++) { if(py_str_i == LV_IME_PINYIN_K9_CAND_TEXT_NUM) { - lv_strcpy(lv_pinyin_k9_cand_str[py_str_i], LV_SYMBOL_RIGHT"\0"); + strcpy(lv_pinyin_k9_cand_str[py_str_i], LV_SYMBOL_RIGHT"\0"); } else if(py_str_i == LV_IME_PINYIN_K9_CAND_TEXT_NUM + 1) { - lv_strcpy(lv_pinyin_k9_cand_str[py_str_i], "\0"); + strcpy(lv_pinyin_k9_cand_str[py_str_i], "\0"); } else { - lv_strcpy(lv_pinyin_k9_cand_str[py_str_i], " \0"); + strcpy(lv_pinyin_k9_cand_str[py_str_i], " \0"); } lv_btnm_def_pinyin_k9_map[btnm_i] = lv_pinyin_k9_cand_str[py_str_i]; py_str_i++; } - default_kb_ctrl_k9_map[0] = LV_BUTTONMATRIX_CTRL_CHECKED | 1; - default_kb_ctrl_k9_map[1] = LV_BUTTONMATRIX_CTRL_NO_REPEAT | LV_BUTTONMATRIX_CTRL_CLICK_TRIG | 1; - default_kb_ctrl_k9_map[4] = LV_BUTTONMATRIX_CTRL_CHECKED | 1; - default_kb_ctrl_k9_map[5] = LV_BUTTONMATRIX_CTRL_CHECKED | 1; - default_kb_ctrl_k9_map[9] = LV_KEYBOARD_CTRL_BUTTON_FLAGS | 1; - default_kb_ctrl_k9_map[10] = LV_BUTTONMATRIX_CTRL_CHECKED | 1; - default_kb_ctrl_k9_map[14] = LV_BUTTONMATRIX_CTRL_CHECKED | 1; - default_kb_ctrl_k9_map[15] = LV_BUTTONMATRIX_CTRL_CHECKED | 1; - default_kb_ctrl_k9_map[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 16] = LV_BUTTONMATRIX_CTRL_CHECKED | 1; + default_kb_ctrl_k9_map[0] = LV_KEYBOARD_CTRL_BTN_FLAGS | 1; + default_kb_ctrl_k9_map[4] = LV_KEYBOARD_CTRL_BTN_FLAGS | 1; + default_kb_ctrl_k9_map[5] = LV_KEYBOARD_CTRL_BTN_FLAGS | 1; + default_kb_ctrl_k9_map[9] = LV_KEYBOARD_CTRL_BTN_FLAGS | 1; + default_kb_ctrl_k9_map[10] = LV_KEYBOARD_CTRL_BTN_FLAGS | 1; + default_kb_ctrl_k9_map[14] = LV_KEYBOARD_CTRL_BTN_FLAGS | 1; + default_kb_ctrl_k9_map[15] = LV_KEYBOARD_CTRL_BTN_FLAGS | 1; + default_kb_ctrl_k9_map[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 16] = LV_KEYBOARD_CTRL_BTN_FLAGS | 1; } static void pinyin_k9_get_legal_py(lv_obj_t * obj, char * k9_input, const char * py9_map[]) { lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; - uint16_t len = lv_strlen(k9_input); + uint16_t len = strlen(k9_input); if((len == 0) || (len >= LV_IME_PINYIN_K9_MAX_INPUT)) { return; @@ -1003,24 +1014,24 @@ static void pinyin_k9_get_legal_py(lv_obj_t * obj, char * k9_input, const char * int mark[LV_IME_PINYIN_K9_MAX_INPUT] = {0}; int index = 0; int flag = 0; - uint16_t count = 0; + int count = 0; uint32_t ll_len = 0; ime_pinyin_k9_py_str_t * ll_index = NULL; - ll_len = lv_ll_get_len(&pinyin_ime->k9_legal_py_ll); - ll_index = lv_ll_get_head(&pinyin_ime->k9_legal_py_ll); + ll_len = _lv_ll_get_len(&pinyin_ime->k9_legal_py_ll); + ll_index = _lv_ll_get_head(&pinyin_ime->k9_legal_py_ll); while(index != -1) { if(index == len) { if(pinyin_k9_is_valid_py(obj, py_comp)) { if((count >= ll_len) || (ll_len == 0)) { - ll_index = lv_ll_ins_tail(&pinyin_ime->k9_legal_py_ll); - lv_strcpy(ll_index->py_str, py_comp); + ll_index = _lv_ll_ins_tail(&pinyin_ime->k9_legal_py_ll); + strcpy(ll_index->py_str, py_comp); } else if((count < ll_len)) { - lv_strcpy(ll_index->py_str, py_comp); - ll_index = lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); + strcpy(ll_index->py_str, py_comp); + ll_index = _lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); } count++; } @@ -1028,7 +1039,7 @@ static void pinyin_k9_get_legal_py(lv_obj_t * obj, char * k9_input, const char * } else { flag = mark[index]; - if((size_t)flag < lv_strlen(py9_map[k9_input[index] - '2'])) { + if(flag < strlen(py9_map[k9_input[index] - '2'])) { py_comp[index] = py9_map[k9_input[index] - '2'][flag]; mark[index] = mark[index] + 1; index++; @@ -1046,13 +1057,15 @@ static void pinyin_k9_get_legal_py(lv_obj_t * obj, char * k9_input, const char * } } + /*true: visible; false: not visible*/ static bool pinyin_k9_is_valid_py(lv_obj_t * obj, char * py_str) { lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; - const lv_pinyin_dict_t * cpHZ = NULL; + lv_pinyin_dict_t * cpHZ = NULL; uint8_t index = 0, len = 0, offset = 0; + uint16_t ret = 1; volatile uint8_t count = 0; if(*py_str == '\0') return false; @@ -1061,7 +1074,7 @@ static bool pinyin_k9_is_valid_py(lv_obj_t * obj, char * py_str) if(*py_str == 'v') return false; offset = py_str[0] - 'a'; - len = lv_strlen(py_str); + len = strlen(py_str); cpHZ = &pinyin_ime->dict[pinyin_ime->py_pos[offset]]; count = pinyin_ime->py_num[offset]; @@ -1082,8 +1095,10 @@ static bool pinyin_k9_is_valid_py(lv_obj_t * obj, char * py_str) return false; } + static void pinyin_k9_fill_cand(lv_obj_t * obj) { + static uint16_t len = 0; uint16_t index = 0, tmp_len = 0; ime_pinyin_k9_py_str_t * ll_index = NULL; @@ -1091,79 +1106,70 @@ static void pinyin_k9_fill_cand(lv_obj_t * obj) tmp_len = pinyin_ime->k9_legal_py_count; - if(tmp_len != cand_len) { - lv_memzero(lv_pinyin_k9_cand_str, sizeof(lv_pinyin_k9_cand_str)); - lv_strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM], LV_SYMBOL_RIGHT"\0"); - lv_strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 1], "\0"); - cand_len = tmp_len; - } - - ll_index = lv_ll_get_head(&pinyin_ime->k9_legal_py_ll); - lv_strcpy(pinyin_ime->input_char, ll_index->py_str); - - for(uint8_t i = 0; i < LV_IME_PINYIN_K9_CAND_TEXT_NUM; i++) { - lv_strcpy(lv_pinyin_k9_cand_str[i], " "); + if(tmp_len != len) { + lv_memset_00(lv_pinyin_k9_cand_str, sizeof(lv_pinyin_k9_cand_str)); + strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM], LV_SYMBOL_RIGHT"\0"); + strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 1], "\0"); + len = tmp_len; } + ll_index = _lv_ll_get_head(&pinyin_ime->k9_legal_py_ll); + strcpy(pinyin_ime->input_char, ll_index->py_str); while(ll_index) { - if(index >= LV_IME_PINYIN_K9_CAND_TEXT_NUM) + if((index >= LV_IME_PINYIN_K9_CAND_TEXT_NUM) || \ + (index >= pinyin_ime->k9_legal_py_count)) break; - if(index < pinyin_ime->k9_legal_py_count) { - lv_strcpy(lv_pinyin_k9_cand_str[index], ll_index->py_str); - } - - ll_index = lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the next list*/ + strcpy(lv_pinyin_k9_cand_str[index], ll_index->py_str); + ll_index = _lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the next list*/ index++; } pinyin_ime->k9_py_ll_pos = index; lv_obj_t * ta = lv_keyboard_get_textarea(pinyin_ime->kb); for(index = 0; index < pinyin_ime->k9_input_str_len; index++) { - lv_textarea_delete_char(ta); + lv_textarea_del_char(ta); } - pinyin_ime->k9_input_str_len = lv_strlen(pinyin_ime->input_char); + pinyin_ime->k9_input_str_len = strlen(pinyin_ime->input_char); lv_textarea_add_text(ta, pinyin_ime->input_char); } + static void pinyin_k9_cand_page_proc(lv_obj_t * obj, uint16_t dir) { lv_ime_pinyin_t * pinyin_ime = (lv_ime_pinyin_t *)obj; lv_obj_t * ta = lv_keyboard_get_textarea(pinyin_ime->kb); - uint16_t ll_len = lv_ll_get_len(&pinyin_ime->k9_legal_py_ll); + uint16_t ll_len = _lv_ll_get_len(&pinyin_ime->k9_legal_py_ll); if((ll_len > LV_IME_PINYIN_K9_CAND_TEXT_NUM) && (pinyin_ime->k9_legal_py_count > LV_IME_PINYIN_K9_CAND_TEXT_NUM)) { ime_pinyin_k9_py_str_t * ll_index = NULL; + uint16_t tmp_btn_str_len = 0; int count = 0; - ll_index = lv_ll_get_head(&pinyin_ime->k9_legal_py_ll); + ll_index = _lv_ll_get_head(&pinyin_ime->k9_legal_py_ll); while(ll_index) { if(count >= pinyin_ime->k9_py_ll_pos) break; - ll_index = lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the next list*/ + ll_index = _lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the next list*/ count++; } if((NULL == ll_index) && (dir == 1)) return; - lv_memzero(lv_pinyin_k9_cand_str, sizeof(lv_pinyin_k9_cand_str)); - lv_strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM], LV_SYMBOL_RIGHT"\0"); - lv_strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 1], "\0"); + lv_memset_00(lv_pinyin_k9_cand_str, sizeof(lv_pinyin_k9_cand_str)); + strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM], LV_SYMBOL_RIGHT"\0"); + strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 1], "\0"); // next page if(dir == 1) { - for(uint8_t i = 0; i < LV_IME_PINYIN_K9_CAND_TEXT_NUM; i++) { - lv_strcpy(lv_pinyin_k9_cand_str[i], " "); - } - count = 0; while(ll_index) { if(count >= (LV_IME_PINYIN_K9_CAND_TEXT_NUM - 1)) break; - lv_strcpy(lv_pinyin_k9_cand_str[count], ll_index->py_str); - ll_index = lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the next list*/ + strcpy(lv_pinyin_k9_cand_str[count], ll_index->py_str); + ll_index = _lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the next list*/ count++; } pinyin_ime->k9_py_ll_pos += count - 1; @@ -1171,16 +1177,13 @@ static void pinyin_k9_cand_page_proc(lv_obj_t * obj, uint16_t dir) } // previous page else { - for(uint8_t i = 0; i < LV_IME_PINYIN_K9_CAND_TEXT_NUM; i++) { - lv_strcpy(lv_pinyin_k9_cand_str[i], " "); - } count = LV_IME_PINYIN_K9_CAND_TEXT_NUM - 1; - ll_index = lv_ll_get_prev(&pinyin_ime->k9_legal_py_ll, ll_index); + ll_index = _lv_ll_get_prev(&pinyin_ime->k9_legal_py_ll, ll_index); while(ll_index) { if(count < 0) break; - lv_strcpy(lv_pinyin_k9_cand_str[count], ll_index->py_str); - ll_index = lv_ll_get_prev(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the previous list*/ + strcpy(lv_pinyin_k9_cand_str[count], ll_index->py_str); + ll_index = _lv_ll_get_prev(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the previous list*/ count--; } @@ -1195,3 +1198,4 @@ static void pinyin_k9_cand_page_proc(lv_obj_t * obj, uint16_t dir) #endif /*LV_IME_PINYIN_USE_K9_MODE*/ #endif /*LV_USE_IME_PINYIN*/ + diff --git a/L3_Middlewares/LVGL/src/others/ime/lv_ime_pinyin.h b/L3_Middlewares/LVGL/src/extra/others/ime/lv_ime_pinyin.h similarity index 67% rename from L3_Middlewares/LVGL/src/others/ime/lv_ime_pinyin.h rename to L3_Middlewares/LVGL/src/extra/others/ime/lv_ime_pinyin.h index ff85eee..3ff7bb9 100644 --- a/L3_Middlewares/LVGL/src/others/ime/lv_ime_pinyin.h +++ b/L3_Middlewares/LVGL/src/extra/others/ime/lv_ime_pinyin.h @@ -12,8 +12,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" -#include "../../core/lv_obj.h" +#include "../../../lvgl.h" #if LV_USE_IME_PINYIN != 0 @@ -29,7 +28,6 @@ extern "C" { typedef enum { LV_IME_PINYIN_MODE_K26, LV_IME_PINYIN_MODE_K9, - LV_IME_PINYIN_MODE_K9_NUMBER, } lv_ime_pinyin_mode_t; /*Data of pinyin_dict*/ @@ -43,12 +41,33 @@ typedef struct { char py_str[7]; } ime_pinyin_k9_py_str_t; +/*Data of lv_ime_pinyin*/ +typedef struct { + lv_obj_t obj; + lv_obj_t * kb; + lv_obj_t * cand_panel; + lv_pinyin_dict_t * dict; + lv_ll_t k9_legal_py_ll; + char * cand_str; /* Candidate string */ + char input_char[16]; /* Input box character */ +#if LV_IME_PINYIN_USE_K9_MODE + char k9_input_str[LV_IME_PINYIN_K9_MAX_INPUT]; /* 9-key input(k9) mode input string */ + uint16_t k9_py_ll_pos; /* Current pinyin map pages(k9) */ + uint16_t k9_legal_py_count; /* Count of legal Pinyin numbers(k9) */ + uint16_t k9_input_str_len; /* 9-key input(k9) mode input string max len */ +#endif + uint16_t ta_count; /* The number of characters entered in the text box this time */ + uint16_t cand_num; /* Number of candidates */ + uint16_t py_page; /* Current pinyin map pages(k26) */ + uint16_t py_num[26]; /* Number and length of Pinyin */ + uint16_t py_pos[26]; /* Pinyin position */ + uint8_t mode : 1; /* Set mode, 1: 26-key input(k26), 0: 9-key input(k9). Default: 1. */ +} lv_ime_pinyin_t; + /*********************** * GLOBAL VARIABLES ***********************/ -extern const lv_obj_class_t lv_ime_pinyin_class; - /********************** * GLOBAL PROTOTYPES **********************/ @@ -61,7 +80,7 @@ lv_obj_t * lv_ime_pinyin_create(lv_obj_t * parent); /** * Set the keyboard of Pinyin input method. * @param obj pointer to a Pinyin input method object - * @param kb pointer to a Pinyin input method keyboard + * @param dict pointer to a Pinyin input method keyboard */ void lv_ime_pinyin_set_keyboard(lv_obj_t * obj, lv_obj_t * kb); @@ -79,6 +98,7 @@ void lv_ime_pinyin_set_dict(lv_obj_t * obj, lv_pinyin_dict_t * dict); */ void lv_ime_pinyin_set_mode(lv_obj_t * obj, lv_ime_pinyin_mode_t mode); + /*===================== * Getter functions *====================*/ @@ -90,6 +110,7 @@ void lv_ime_pinyin_set_mode(lv_obj_t * obj, lv_ime_pinyin_mode_t mode); */ lv_obj_t * lv_ime_pinyin_get_kb(lv_obj_t * obj); + /** * Set the dictionary of Pinyin input method. * @param obj pointer to a Pinyin input method object @@ -97,12 +118,13 @@ lv_obj_t * lv_ime_pinyin_get_kb(lv_obj_t * obj); */ lv_obj_t * lv_ime_pinyin_get_cand_panel(lv_obj_t * obj); + /** * Set the dictionary of Pinyin input method. * @param obj pointer to a Pinyin input method object * @return pointer to the Pinyin input method dictionary */ -const lv_pinyin_dict_t * lv_ime_pinyin_get_dict(lv_obj_t * obj); +lv_pinyin_dict_t * lv_ime_pinyin_get_dict(lv_obj_t * obj); /*===================== * Other functions @@ -119,3 +141,5 @@ const lv_pinyin_dict_t * lv_ime_pinyin_get_dict(lv_obj_t * obj); #endif #endif /*LV_USE_IME_PINYIN*/ + + diff --git a/L3_Middlewares/LVGL/src/others/imgfont/lv_imgfont.c b/L3_Middlewares/LVGL/src/extra/others/imgfont/lv_imgfont.c similarity index 55% rename from L3_Middlewares/LVGL/src/others/imgfont/lv_imgfont.c rename to L3_Middlewares/LVGL/src/extra/others/imgfont/lv_imgfont.c index edc6990..ad4ab60 100644 --- a/L3_Middlewares/LVGL/src/others/imgfont/lv_imgfont.c +++ b/L3_Middlewares/LVGL/src/extra/others/imgfont/lv_imgfont.c @@ -6,27 +6,28 @@ /********************* * INCLUDES *********************/ -#include "../../lvgl.h" +#include "lv_imgfont.h" #if LV_USE_IMGFONT /********************* * DEFINES *********************/ +#define LV_IMGFONT_PATH_MAX_LEN 64 /********************** * TYPEDEFS **********************/ typedef struct { - lv_font_t font; - lv_imgfont_get_path_cb_t path_cb; - void * user_data; + lv_font_t * font; + lv_get_imgfont_path_cb_t path_cb; + char path[LV_IMGFONT_PATH_MAX_LEN]; } imgfont_dsc_t; /********************** * STATIC PROTOTYPES **********************/ -static const void * imgfont_get_glyph_bitmap(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf); +static const uint8_t * imgfont_get_glyph_bitmap(const lv_font_t * font, uint32_t unicode); static bool imgfont_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode, uint32_t unicode_next); @@ -45,16 +46,20 @@ static bool imgfont_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * /********************** * GLOBAL FUNCTIONS **********************/ -lv_font_t * lv_imgfont_create(uint16_t height, lv_imgfont_get_path_cb_t path_cb, void * user_data) +lv_font_t * lv_imgfont_create(uint16_t height, lv_get_imgfont_path_cb_t path_cb) { - imgfont_dsc_t * dsc = lv_malloc_zeroed(sizeof(imgfont_dsc_t)); - LV_ASSERT_MALLOC(dsc); + LV_ASSERT_MSG(LV_IMGFONT_PATH_MAX_LEN > sizeof(lv_img_dsc_t), + "LV_IMGFONT_PATH_MAX_LEN must be greater than sizeof(lv_img_dsc_t)"); + + size_t size = sizeof(imgfont_dsc_t) + sizeof(lv_font_t); + imgfont_dsc_t * dsc = (imgfont_dsc_t *)lv_mem_alloc(size); if(dsc == NULL) return NULL; + lv_memset_00(dsc, size); + dsc->font = (lv_font_t *)(((char *)dsc) + sizeof(imgfont_dsc_t)); dsc->path_cb = path_cb; - dsc->user_data = user_data; - lv_font_t * font = &dsc->font; + lv_font_t * font = dsc->font; font->dsc = dsc; font->get_glyph_dsc = imgfont_get_glyph_dsc; font->get_glyph_bitmap = imgfont_get_glyph_bitmap; @@ -64,27 +69,29 @@ lv_font_t * lv_imgfont_create(uint16_t height, lv_imgfont_get_path_cb_t path_cb, font->underline_position = 0; font->underline_thickness = 0; - return font; + return dsc->font; } void lv_imgfont_destroy(lv_font_t * font) { - LV_ASSERT_NULL(font); + if(font == NULL) { + return; + } imgfont_dsc_t * dsc = (imgfont_dsc_t *)font->dsc; - lv_free(dsc); + lv_mem_free(dsc); } /********************** * STATIC FUNCTIONS **********************/ -static const void * imgfont_get_glyph_bitmap(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf) +static const uint8_t * imgfont_get_glyph_bitmap(const lv_font_t * font, uint32_t unicode) { - LV_UNUSED(draw_buf); - - const void * img_src = g_dsc->gid.src; - return img_src; + LV_UNUSED(unicode); + LV_ASSERT_NULL(font); + imgfont_dsc_t * dsc = (imgfont_dsc_t *)font->dsc; + return (uint8_t *)dsc->path; } static bool imgfont_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, @@ -96,24 +103,22 @@ static bool imgfont_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * LV_ASSERT_NULL(dsc); if(dsc->path_cb == NULL) return false; - int32_t offset_y = 0; - - const void * img_src = dsc->path_cb(font, unicode, unicode_next, &offset_y, dsc->user_data); - if(img_src == NULL) return false; + if(!dsc->path_cb(dsc->font, dsc->path, LV_IMGFONT_PATH_MAX_LEN, unicode, unicode_next)) { + return false; + } - lv_image_header_t header; - if(lv_image_decoder_get_info(img_src, &header) != LV_RESULT_OK) { + lv_img_header_t header; + if(lv_img_decoder_get_info(dsc->path, &header) != LV_RES_OK) { return false; } dsc_out->is_placeholder = 0; - dsc_out->adv_w = header.w; - dsc_out->box_w = header.w; - dsc_out->box_h = header.h; - dsc_out->ofs_x = 0; - dsc_out->ofs_y = offset_y; - dsc_out->format = LV_FONT_GLYPH_FORMAT_IMAGE; /* is image identifier */ - dsc_out->gid.src = img_src; + dsc_out->adv_w = header.w; + dsc_out->box_w = header.w; + dsc_out->box_h = header.h; + dsc_out->bpp = LV_IMGFONT_BPP; /* is image identifier */ + dsc_out->ofs_x = 0; + dsc_out->ofs_y = 0; return true; } diff --git a/L3_Middlewares/LVGL/src/others/imgfont/lv_imgfont.h b/L3_Middlewares/LVGL/src/extra/others/imgfont/lv_imgfont.h similarity index 68% rename from L3_Middlewares/LVGL/src/others/imgfont/lv_imgfont.h rename to L3_Middlewares/LVGL/src/extra/others/imgfont/lv_imgfont.h index 68c317a..5069b62 100644 --- a/L3_Middlewares/LVGL/src/others/imgfont/lv_imgfont.h +++ b/L3_Middlewares/LVGL/src/extra/others/imgfont/lv_imgfont.h @@ -13,8 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" -#include "../../font/lv_font.h" +#include "../../../lvgl.h" #if LV_USE_IMGFONT @@ -27,9 +26,8 @@ extern "C" { **********************/ /* gets the image path name of this character */ -typedef const void * (*lv_imgfont_get_path_cb_t)(const lv_font_t * font, - uint32_t unicode, uint32_t unicode_next, - int32_t * offset_y, void * user_data); +typedef bool (*lv_get_imgfont_path_cb_t)(const lv_font_t * font, void * img_src, + uint16_t len, uint32_t unicode, uint32_t unicode_next); /********************** * GLOBAL PROTOTYPES @@ -39,10 +37,9 @@ typedef const void * (*lv_imgfont_get_path_cb_t)(const lv_font_t * font, * Creates a image font with info parameter specified. * @param height font size * @param path_cb a function to get the image path name of character. - * @param user_data pointer to user data * @return pointer to the new imgfont or NULL if create error. */ -lv_font_t * lv_imgfont_create(uint16_t height, lv_imgfont_get_path_cb_t path_cb, void * user_data); +lv_font_t * lv_imgfont_create(uint16_t height, lv_get_imgfont_path_cb_t path_cb); /** * Destroy a image font that has been created. diff --git a/L3_Middlewares/LVGL/src/draw/lv_draw_triangle_private.h b/L3_Middlewares/LVGL/src/extra/others/lv_others.h similarity index 58% rename from L3_Middlewares/LVGL/src/draw/lv_draw_triangle_private.h rename to L3_Middlewares/LVGL/src/extra/others/lv_others.h index 7fc8ed5..106d85e 100644 --- a/L3_Middlewares/LVGL/src/draw/lv_draw_triangle_private.h +++ b/L3_Middlewares/LVGL/src/extra/others/lv_others.h @@ -1,10 +1,10 @@ /** - * @file lv_draw_triangle_private.h + * @file lv_others.h * */ -#ifndef LV_DRAW_TRIANGLE_PRIVATE_H -#define LV_DRAW_TRIANGLE_PRIVATE_H +#ifndef LV_OTHERS_H +#define LV_OTHERS_H #ifdef __cplusplus extern "C" { @@ -13,8 +13,13 @@ extern "C" { /********************* * INCLUDES *********************/ - -#include "lv_draw_triangle.h" +#include "snapshot/lv_snapshot.h" +#include "monkey/lv_monkey.h" +#include "gridnav/lv_gridnav.h" +#include "fragment/lv_fragment.h" +#include "imgfont/lv_imgfont.h" +#include "msg/lv_msg.h" +#include "ime/lv_ime_pinyin.h" /********************* * DEFINES @@ -24,10 +29,6 @@ extern "C" { * TYPEDEFS **********************/ -/********************** - * TYPEDEFS - **********************/ - /********************** * GLOBAL PROTOTYPES **********************/ @@ -40,4 +41,4 @@ extern "C" { } /*extern "C"*/ #endif -#endif /*LV_DRAW_TRIANGLE_PRIVATE_H*/ +#endif /*LV_OTHERS_H*/ diff --git a/L3_Middlewares/LVGL/src/others/monkey/lv_monkey.c b/L3_Middlewares/LVGL/src/extra/others/monkey/lv_monkey.c similarity index 76% rename from L3_Middlewares/LVGL/src/others/monkey/lv_monkey.c rename to L3_Middlewares/LVGL/src/extra/others/monkey/lv_monkey.c index 97ba10a..6ec45e2 100644 --- a/L3_Middlewares/LVGL/src/others/monkey/lv_monkey.c +++ b/L3_Middlewares/LVGL/src/extra/others/monkey/lv_monkey.c @@ -6,15 +6,10 @@ /********************* * INCLUDES *********************/ -#include "lv_monkey_private.h" +#include "lv_monkey.h" #if LV_USE_MONKEY != 0 -#include "../../misc/lv_math.h" -#include "../../misc/lv_assert.h" -#include "../../stdlib/lv_mem.h" -#include "../../display/lv_display.h" - /********************* * DEFINES *********************/ @@ -24,13 +19,16 @@ /********************** * TYPEDEFS **********************/ -struct lv_monkey_t { +typedef struct _lv_monkey { lv_monkey_config_t config; + lv_indev_drv_t indev_drv; lv_indev_data_t indev_data; lv_indev_t * indev; lv_timer_t * timer; +#if LV_USE_USER_DATA void * user_data; -}; +#endif +} lv_monkey_t; static const lv_key_t lv_key_map[] = { LV_KEY_UP, @@ -51,7 +49,7 @@ static const lv_key_t lv_key_map[] = { * STATIC PROTOTYPES **********************/ -static void lv_monkey_read_cb(lv_indev_t * indev, lv_indev_data_t * data); +static void lv_monkey_read_cb(lv_indev_drv_t * indev_drv, lv_indev_data_t * data); static int32_t lv_monkey_random(int32_t howsmall, int32_t howbig); static void lv_monkey_timer_cb(lv_timer_t * timer); @@ -61,7 +59,7 @@ static void lv_monkey_timer_cb(lv_timer_t * timer); void lv_monkey_config_init(lv_monkey_config_t * config) { - lv_memzero(config, sizeof(lv_monkey_config_t)); + lv_memset_00(config, sizeof(lv_monkey_config_t)); config->type = LV_INDEV_TYPE_POINTER; config->period_range.min = MONKEY_PERIOD_RANGE_MIN_DEF; config->period_range.max = MONKEY_PERIOD_RANGE_MAX_DEF; @@ -69,17 +67,24 @@ void lv_monkey_config_init(lv_monkey_config_t * config) lv_monkey_t * lv_monkey_create(const lv_monkey_config_t * config) { - lv_monkey_t * monkey = lv_malloc_zeroed(sizeof(lv_monkey_t)); + lv_monkey_t * monkey = lv_mem_alloc(sizeof(lv_monkey_t)); LV_ASSERT_MALLOC(monkey); + lv_memset_00(monkey, sizeof(lv_monkey_t)); + monkey->config = *config; + + lv_indev_drv_t * drv = &monkey->indev_drv; + lv_indev_drv_init(drv); + drv->type = config->type; + drv->read_cb = lv_monkey_read_cb; + drv->user_data = monkey; + monkey->timer = lv_timer_create(lv_monkey_timer_cb, monkey->config.period_range.min, monkey); lv_timer_pause(monkey->timer); - monkey->indev = lv_indev_create(); - lv_indev_set_type(monkey->indev, config->type); - lv_indev_set_read_cb(monkey->indev, lv_monkey_read_cb); - lv_indev_set_user_data(monkey->indev, monkey); + monkey->indev = lv_indev_drv_register(drv); + return monkey; } @@ -98,9 +103,11 @@ void lv_monkey_set_enable(lv_monkey_t * monkey, bool en) bool lv_monkey_get_enable(lv_monkey_t * monkey) { LV_ASSERT_NULL(monkey); - return !lv_timer_get_paused(monkey->timer); + return !monkey->timer->paused; } +#if LV_USE_USER_DATA + void lv_monkey_set_user_data(lv_monkey_t * monkey, void * user_data) { LV_ASSERT_NULL(monkey); @@ -113,22 +120,24 @@ void * lv_monkey_get_user_data(lv_monkey_t * monkey) return monkey->user_data; } -void lv_monkey_delete(lv_monkey_t * monkey) +#endif + +void lv_monkey_del(lv_monkey_t * monkey) { LV_ASSERT_NULL(monkey); - lv_timer_delete(monkey->timer); + lv_timer_del(monkey->timer); lv_indev_delete(monkey->indev); - lv_free(monkey); + lv_mem_free(monkey); } /********************** * STATIC FUNCTIONS **********************/ -static void lv_monkey_read_cb(lv_indev_t * indev, lv_indev_data_t * data) +static void lv_monkey_read_cb(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) { - lv_monkey_t * monkey = lv_indev_get_user_data(indev); + lv_monkey_t * monkey = indev_drv->user_data; data->btn_id = monkey->indev_data.btn_id; data->point = monkey->indev_data.point; @@ -147,13 +156,13 @@ static int32_t lv_monkey_random(int32_t howsmall, int32_t howbig) static void lv_monkey_timer_cb(lv_timer_t * timer) { - lv_monkey_t * monkey = lv_timer_get_user_data(timer); + lv_monkey_t * monkey = timer->user_data; lv_indev_data_t * data = &monkey->indev_data; - switch(lv_indev_get_type(monkey->indev)) { + switch(monkey->indev_drv.type) { case LV_INDEV_TYPE_POINTER: - data->point.x = (int32_t)lv_monkey_random(0, LV_HOR_RES - 1); - data->point.y = (int32_t)lv_monkey_random(0, LV_VER_RES - 1); + data->point.x = (lv_coord_t)lv_monkey_random(0, LV_HOR_RES - 1); + data->point.y = (lv_coord_t)lv_monkey_random(0, LV_VER_RES - 1); break; case LV_INDEV_TYPE_ENCODER: data->enc_diff = (int16_t)lv_monkey_random(monkey->config.input_range.min, monkey->config.input_range.max); diff --git a/L3_Middlewares/LVGL/src/others/monkey/lv_monkey.h b/L3_Middlewares/LVGL/src/extra/others/monkey/lv_monkey.h similarity index 90% rename from L3_Middlewares/LVGL/src/others/monkey/lv_monkey.h rename to L3_Middlewares/LVGL/src/extra/others/monkey/lv_monkey.h index 6cbe0ec..bf5e13c 100644 --- a/L3_Middlewares/LVGL/src/others/monkey/lv_monkey.h +++ b/L3_Middlewares/LVGL/src/extra/others/monkey/lv_monkey.h @@ -12,8 +12,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" -#include "../../indev/lv_indev.h" +#include "../../../lvgl.h" #if LV_USE_MONKEY != 0 @@ -24,19 +23,17 @@ extern "C" { /********************** * TYPEDEFS **********************/ +struct _lv_monkey; +typedef struct _lv_monkey lv_monkey_t; -typedef struct lv_monkey_t lv_monkey_t; - -struct lv_monkey_config_t { +typedef struct { /**< Input device type*/ lv_indev_type_t type; /**< Monkey execution period*/ struct { - //! @cond Doxygen_Suppress uint32_t min; uint32_t max; - //! @endcond } period_range; /**< The range of input value*/ @@ -44,7 +41,7 @@ struct lv_monkey_config_t { int32_t min; int32_t max; } input_range; -}; +} lv_monkey_config_t; /********************** * GLOBAL PROTOTYPES @@ -84,6 +81,8 @@ void lv_monkey_set_enable(lv_monkey_t * monkey, bool en); */ bool lv_monkey_get_enable(lv_monkey_t * monkey); +#if LV_USE_USER_DATA + /** * Set the user_data field of the monkey * @param monkey pointer to a monkey @@ -98,11 +97,13 @@ void lv_monkey_set_user_data(lv_monkey_t * monkey, void * user_data); */ void * lv_monkey_get_user_data(lv_monkey_t * monkey); +#endif/*LV_USE_USER_DATA*/ + /** * Delete monkey * @param monkey pointer to monkey */ -void lv_monkey_delete(lv_monkey_t * monkey); +void lv_monkey_del(lv_monkey_t * monkey); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/extra/others/msg/lv_msg.c b/L3_Middlewares/LVGL/src/extra/others/msg/lv_msg.c new file mode 100644 index 0000000..d54279c --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/others/msg/lv_msg.c @@ -0,0 +1,189 @@ +/** + * @file lv_msg.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_msg.h" +#if LV_USE_MSG + +#include "../../../misc/lv_assert.h" +#include "../../../misc/lv_ll.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + uint32_t msg_id; + lv_msg_subscribe_cb_t callback; + void * user_data; + void * _priv_data; /*Internal: used only store 'obj' in lv_obj_subscribe*/ +} sub_dsc_t; + +/********************** + * STATIC PROTOTYPES + **********************/ + +static void notify(lv_msg_t * m); +static void obj_notify_cb(void * s, lv_msg_t * m); +static void obj_delete_event_cb(lv_event_t * e); + +/********************** + * STATIC VARIABLES + **********************/ +static lv_ll_t subs_ll; + +/********************** + * GLOBAL VARIABLES + **********************/ +lv_event_code_t LV_EVENT_MSG_RECEIVED; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +void lv_msg_init(void) +{ + LV_EVENT_MSG_RECEIVED = lv_event_register_id(); + _lv_ll_init(&subs_ll, sizeof(sub_dsc_t)); +} + +void * lv_msg_subsribe(uint32_t msg_id, lv_msg_subscribe_cb_t cb, void * user_data) +{ + sub_dsc_t * s = _lv_ll_ins_tail(&subs_ll); + LV_ASSERT_MALLOC(s); + if(s == NULL) return NULL; + + lv_memset_00(s, sizeof(*s)); + + s->msg_id = msg_id; + s->callback = cb; + s->user_data = user_data; + return s; +} + +void * lv_msg_subsribe_obj(uint32_t msg_id, lv_obj_t * obj, void * user_data) +{ + sub_dsc_t * s = lv_msg_subsribe(msg_id, obj_notify_cb, user_data); + if(s == NULL) return NULL; + s->_priv_data = obj; + + /*If not added yet, add a delete event cb which automatically unsubcribes the object*/ + sub_dsc_t * s_first = lv_obj_get_event_user_data(obj, obj_delete_event_cb); + if(s_first == NULL) { + lv_obj_add_event_cb(obj, obj_delete_event_cb, LV_EVENT_DELETE, s); + } + return s; +} + +void lv_msg_unsubscribe(void * s) +{ + LV_ASSERT_NULL(s); + _lv_ll_remove(&subs_ll, s); + lv_mem_free(s); +} + +uint32_t lv_msg_unsubscribe_obj(uint32_t msg_id, lv_obj_t * obj) +{ + uint32_t cnt = 0; + sub_dsc_t * s = _lv_ll_get_head(&subs_ll); + while(s) { + sub_dsc_t * s_next = _lv_ll_get_next(&subs_ll, s); + if(s->callback == obj_notify_cb && + (s->msg_id == LV_MSG_ID_ANY || s->msg_id == msg_id) && + (obj == NULL || s->_priv_data == obj)) { + lv_msg_unsubscribe(s); + cnt++; + } + + s = s_next; + } + + return cnt; +} + +void lv_msg_send(uint32_t msg_id, const void * payload) +{ + lv_msg_t m; + lv_memset_00(&m, sizeof(m)); + m.id = msg_id; + m.payload = payload; + notify(&m); +} + +uint32_t lv_msg_get_id(lv_msg_t * m) +{ + return m->id; +} + +const void * lv_msg_get_payload(lv_msg_t * m) +{ + return m->payload; +} + +void * lv_msg_get_user_data(lv_msg_t * m) +{ + return m->user_data; +} + +lv_msg_t * lv_event_get_msg(lv_event_t * e) +{ + if(e->code == LV_EVENT_MSG_RECEIVED) { + return lv_event_get_param(e); + } + else { + LV_LOG_WARN("Not interpreted with this event code"); + return NULL; + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void notify(lv_msg_t * m) +{ + sub_dsc_t * s; + _LV_LL_READ(&subs_ll, s) { + if(s->msg_id == m->id && s->callback) { + m->user_data = s->user_data; + m->_priv_data = s->_priv_data; + s->callback(s, m); + } + } +} + +static void obj_notify_cb(void * s, lv_msg_t * m) +{ + LV_UNUSED(s); + lv_event_send(m->_priv_data, LV_EVENT_MSG_RECEIVED, m); +} + +static void obj_delete_event_cb(lv_event_t * e) +{ + lv_obj_t * obj = lv_event_get_target(e); + + sub_dsc_t * s = _lv_ll_get_head(&subs_ll); + sub_dsc_t * s_next; + while(s) { + /*On unsubscribe the list changes s becomes invalid so get next item while it's surely valid*/ + s_next = _lv_ll_get_next(&subs_ll, s); + if(s->_priv_data == obj) { + lv_msg_unsubscribe(s); + } + s = s_next; + } +} + +#endif /*LV_USE_MSG*/ diff --git a/L3_Middlewares/LVGL/src/extra/others/msg/lv_msg.h b/L3_Middlewares/LVGL/src/extra/others/msg/lv_msg.h new file mode 100644 index 0000000..0ac2f77 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/others/msg/lv_msg.h @@ -0,0 +1,145 @@ +/** + * @file lv_msg.h + * + */ + +#ifndef LV_MSG_H +#define LV_MSG_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../core/lv_obj.h" +#if LV_USE_MSG + +/********************* + * DEFINES + *********************/ +#define LV_MSG_ID_ANY UINT32_MAX +LV_EXPORT_CONST_INT(LV_MSG_ID_ANY); + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + uint32_t id; /*Identifier of the message*/ + void * user_data; /*Set the the user_data set in `lv_msg_subscribe`*/ + void * _priv_data; /*Used internally*/ + const void * payload; /*Pointer to the data of the message*/ +} lv_msg_t; + +typedef void (*lv_msg_subscribe_cb_t)(void * s, lv_msg_t * msg); + +typedef void (*lv_msg_request_cb_t)(void * r, uint32_t msg_id); + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Called internally to initialize the message module + */ +void lv_msg_init(void); + +/** + * Subscribe to an `msg_id` + * @param msg_id the message ID to listen to + * @param cb callback to call if a message with `msg_id` was sent + * @param user_data arbitrary data which will be available in `cb` too + * @return pointer to a "subscribe object". It can be used the unsubscribe. + */ +void * lv_msg_subsribe(uint32_t msg_id, lv_msg_subscribe_cb_t cb, void * user_data); + +/** + * Subscribe an `lv_obj` to a message. + * `LV_EVENT_MSG_RECEIVED` will be triggered if a message with matching ID was sent + * @param msg_id the message ID to listen to + * @param obj pointer to an `lv_obj` + * @param user_data arbitrary data which will be available in `cb` too + * @return pointer to a "subscribe object". It can be used the unsubscribe. + */ +void * lv_msg_subsribe_obj(uint32_t msg_id, lv_obj_t * obj, void * user_data); + +/** + * Cancel a previous subscription + * @param s pointer to a "subscibe object". + * Return value of `lv_msg_subsribe` or `lv_msg_subsribe_obj` + */ +void lv_msg_unsubscribe(void * s); + +/** + * Unsubscribe an object from a message ID + * @param msg_id the message ID to unsubcribe from or `LV_MSG_ID_ANY` for any message ID + * @param obj the object to unsubscribe or NULL for any object + * @return number of unsubscriptions + */ +uint32_t lv_msg_unsubscribe_obj(uint32_t msg_id, lv_obj_t * obj); + +/** + * Send a message with a given ID and payload + * @param msg_id ID of the message to send + * @param data pointer to the data to send + */ +void lv_msg_send(uint32_t msg_id, const void * payload); + +/** + * Get the ID of a message object. Typically used in the subscriber callback. + * @param m pointer to a message object + * @return the ID of the message + */ +uint32_t lv_msg_get_id(lv_msg_t * m); + +/** + * Get the payload of a message object. Typically used in the subscriber callback. + * @param m pointer to a message object + * @return the payload of the message + */ +const void * lv_msg_get_payload(lv_msg_t * m); + +/** + * Get the user data of a message object. Typically used in the subscriber callback. + * @param m pointer to a message object + * @return the user data of the message + */ +void * lv_msg_get_user_data(lv_msg_t * m); + +/** + * Get the message object from an event object. Can be used in `LV_EVENT_MSG_RECEIVED` events. + * @param e pointer to an event object + * @return the message object or NULL if called with unrelated event code. + */ +lv_msg_t * lv_event_get_msg(lv_event_t * e); + +/*Fix typo*/ +static inline void * lv_msg_subscribe(uint32_t msg_id, lv_msg_subscribe_cb_t cb, void * user_data) +{ + return lv_msg_subsribe(msg_id, cb, user_data); +} + +static inline void * lv_msg_subscribe_obj(uint32_t msg_id, lv_obj_t * obj, void * user_data) +{ + return lv_msg_subsribe_obj(msg_id, obj, user_data); +} + +/********************** + * GLOBAL VARIABLES + **********************/ + +extern lv_event_code_t LV_EVENT_MSG_RECEIVED; + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_MSG*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_MSG_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/others/snapshot/lv_snapshot.c b/L3_Middlewares/LVGL/src/extra/others/snapshot/lv_snapshot.c new file mode 100644 index 0000000..1b22751 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/others/snapshot/lv_snapshot.c @@ -0,0 +1,213 @@ +/** + * @file lv_snapshot.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_snapshot.h" +#if LV_USE_SNAPSHOT + +#include +#include "../../../core/lv_disp.h" +#include "../../../core/lv_refr.h" +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** Get the buffer needed for object snapshot image. + * + * @param obj The object to generate snapshot. + * @param cf color format for generated image. + * + * @return the buffer size needed in bytes + */ +uint32_t lv_snapshot_buf_size_needed(lv_obj_t * obj, lv_img_cf_t cf) +{ + LV_ASSERT_NULL(obj); + switch(cf) { + case LV_IMG_CF_TRUE_COLOR: + case LV_IMG_CF_TRUE_COLOR_ALPHA: + case LV_IMG_CF_ALPHA_1BIT: + case LV_IMG_CF_ALPHA_2BIT: + case LV_IMG_CF_ALPHA_4BIT: + case LV_IMG_CF_ALPHA_8BIT: + break; + default: + return 0; + } + + lv_obj_update_layout(obj); + + /*Width and height determine snapshot image size.*/ + lv_coord_t w = lv_obj_get_width(obj); + lv_coord_t h = lv_obj_get_height(obj); + lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj); + w += ext_size * 2; + h += ext_size * 2; + + uint8_t px_size = lv_img_cf_get_px_size(cf); + return w * h * ((px_size + 7) >> 3); +} + +/** Take snapshot for object with its children, save image info to provided buffer. + * + * @param obj The object to generate snapshot. + * @param cf color format for generated image. + * @param dsc image descriptor to store the image result. + * @param buf the buffer to store image data. + * @param buff_size provided buffer size in bytes. + * + * @return LV_RES_OK on success, LV_RES_INV on error. + */ +lv_res_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_img_cf_t cf, lv_img_dsc_t * dsc, void * buf, uint32_t buff_size) +{ + LV_ASSERT_NULL(obj); + LV_ASSERT_NULL(dsc); + LV_ASSERT_NULL(buf); + + switch(cf) { + case LV_IMG_CF_TRUE_COLOR: + case LV_IMG_CF_TRUE_COLOR_ALPHA: + case LV_IMG_CF_ALPHA_1BIT: + case LV_IMG_CF_ALPHA_2BIT: + case LV_IMG_CF_ALPHA_4BIT: + case LV_IMG_CF_ALPHA_8BIT: + break; + default: + return LV_RES_INV; + } + + if(lv_snapshot_buf_size_needed(obj, cf) > buff_size) + return LV_RES_INV; + + /*Width and height determine snapshot image size.*/ + lv_coord_t w = lv_obj_get_width(obj); + lv_coord_t h = lv_obj_get_height(obj); + lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj); + w += ext_size * 2; + h += ext_size * 2; + + lv_area_t snapshot_area; + lv_obj_get_coords(obj, &snapshot_area); + lv_area_increase(&snapshot_area, ext_size, ext_size); + + lv_memset(buf, 0x00, buff_size); + lv_memset_00(dsc, sizeof(lv_img_dsc_t)); + + lv_disp_t * obj_disp = lv_obj_get_disp(obj); + lv_disp_drv_t driver; + lv_disp_drv_init(&driver); + /*In lack of a better idea use the resolution of the object's display*/ + driver.hor_res = lv_disp_get_hor_res(obj_disp); + driver.ver_res = lv_disp_get_hor_res(obj_disp); + lv_disp_drv_use_generic_set_px_cb(&driver, cf); + + lv_disp_t fake_disp; + lv_memset_00(&fake_disp, sizeof(lv_disp_t)); + fake_disp.driver = &driver; + + lv_draw_ctx_t * draw_ctx = lv_mem_alloc(obj_disp->driver->draw_ctx_size); + LV_ASSERT_MALLOC(draw_ctx); + if(draw_ctx == NULL) return LV_RES_INV; + obj_disp->driver->draw_ctx_init(fake_disp.driver, draw_ctx); + fake_disp.driver->draw_ctx = draw_ctx; + draw_ctx->clip_area = &snapshot_area; + draw_ctx->buf_area = &snapshot_area; + draw_ctx->buf = (void *)buf; + driver.draw_ctx = draw_ctx; + + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&fake_disp); + + lv_obj_redraw(draw_ctx, obj); + + _lv_refr_set_disp_refreshing(refr_ori); + obj_disp->driver->draw_ctx_deinit(fake_disp.driver, draw_ctx); + lv_mem_free(draw_ctx); + + dsc->data = buf; + dsc->header.w = w; + dsc->header.h = h; + dsc->header.cf = cf; + return LV_RES_OK; +} + +/** Take snapshot for object with its children, alloc the memory needed. + * + * @param obj The object to generate snapshot. + * @param cf color format for generated image. + * + * @return a pointer to an image descriptor, or NULL if failed. + */ +lv_img_dsc_t * lv_snapshot_take(lv_obj_t * obj, lv_img_cf_t cf) +{ + LV_ASSERT_NULL(obj); + uint32_t buff_size = lv_snapshot_buf_size_needed(obj, cf); + + void * buf = lv_mem_alloc(buff_size); + LV_ASSERT_MALLOC(buf); + if(buf == NULL) { + return NULL; + } + + lv_img_dsc_t * dsc = lv_mem_alloc(sizeof(lv_img_dsc_t)); + LV_ASSERT_MALLOC(buf); + if(dsc == NULL) { + lv_mem_free(buf); + return NULL; + } + + if(lv_snapshot_take_to_buf(obj, cf, dsc, buf, buff_size) == LV_RES_INV) { + lv_mem_free(buf); + lv_mem_free(dsc); + return NULL; + } + + return dsc; +} + +/** Free the snapshot image returned by @ref lv_snapshot_take + * + * It will firstly free the data image takes, then the image descriptor. + * + * @param dsc The image descriptor generated by lv_snapshot_take. + * + */ +void lv_snapshot_free(lv_img_dsc_t * dsc) +{ + if(!dsc) + return; + + if(dsc->data) + lv_mem_free((void *)dsc->data); + + lv_mem_free(dsc); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +#endif /*LV_USE_SNAPSHOT*/ diff --git a/L3_Middlewares/LVGL/src/extra/others/snapshot/lv_snapshot.h b/L3_Middlewares/LVGL/src/extra/others/snapshot/lv_snapshot.h new file mode 100644 index 0000000..6451926 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/others/snapshot/lv_snapshot.h @@ -0,0 +1,84 @@ +/** + * @file lv_snapshot.h + * + */ + +#ifndef LV_SNAPSHOT_H +#define LV_SNAPSHOT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include +#include + +#include "../../../lv_conf_internal.h" +#include "../../../core/lv_obj.h" + +/********************* + * DEFINES + *********************/ + +#if LV_USE_SNAPSHOT +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** Take snapshot for object with its children. + * + * @param obj The object to generate snapshot. + * @param cf color format for generated image. + * + * @return a pointer to an image descriptor, or NULL if failed. + */ +lv_img_dsc_t * lv_snapshot_take(lv_obj_t * obj, lv_img_cf_t cf); + +/** Free the snapshot image returned by @ref lv_snapshot_take + * + * It will firstly free the data image takes, then the image descriptor. + * + * @param dsc The image descriptor generated by lv_snapshot_take. + * + */ +void lv_snapshot_free(lv_img_dsc_t * dsc); + +/** Get the buffer needed for object snapshot image. + * + * @param obj The object to generate snapshot. + * @param cf color format for generated image. + * + * @return the buffer size needed in bytes + */ +uint32_t lv_snapshot_buf_size_needed(lv_obj_t * obj, lv_img_cf_t cf); + +/** Take snapshot for object with its children, save image info to provided buffer. + * + * @param obj The object to generate snapshot. + * @param cf color format for generated image. + * @param dsc image descriptor to store the image result. + * @param buff the buffer to store image data. + * @param buff_size provided buffer size in bytes. + * + * @return LV_RES_OK on success, LV_RES_INV on error. + */ +lv_res_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_img_cf_t cf, lv_img_dsc_t * dsc, void * buf, uint32_t buff_size); + + +/********************** + * MACROS + **********************/ +#endif /*LV_USE_SNAPSHOT*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/L3_Middlewares/LVGL/src/extra/themes/basic/lv_theme_basic.c b/L3_Middlewares/LVGL/src/extra/themes/basic/lv_theme_basic.c new file mode 100644 index 0000000..d342455 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/themes/basic/lv_theme_basic.c @@ -0,0 +1,428 @@ +/** + * @file lv_theme_basic.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" /*To see all the widgets*/ + +#if LV_USE_THEME_BASIC + +#include "lv_theme_basic.h" +#include "../../../misc/lv_gc.h" + +/********************* + * DEFINES + *********************/ +#define COLOR_SCR lv_palette_lighten(LV_PALETTE_GREY, 4) +#define COLOR_WHITE lv_color_white() +#define COLOR_LIGHT lv_palette_lighten(LV_PALETTE_GREY, 2) +#define COLOR_DARK lv_palette_main(LV_PALETTE_GREY) +#define COLOR_DIM lv_palette_darken(LV_PALETTE_GREY, 2) +#define SCROLLBAR_WIDTH 2 + +/********************** + * TYPEDEFS + **********************/ +typedef struct { + lv_style_t scr; + lv_style_t transp; + lv_style_t white; + lv_style_t light; + lv_style_t dark; + lv_style_t dim; + lv_style_t scrollbar; +#if LV_USE_ARC || LV_USE_COLORWHEEL + lv_style_t arc_line; + lv_style_t arc_knob; +#endif +#if LV_USE_TEXTAREA + lv_style_t ta_cursor; +#endif +} my_theme_styles_t; + + +/********************** + * STATIC PROTOTYPES + **********************/ +static void style_init_reset(lv_style_t * style); +static void theme_apply(lv_theme_t * th, lv_obj_t * obj); + +/********************** + * STATIC VARIABLES + **********************/ +static my_theme_styles_t * styles; +static lv_theme_t theme; +static bool inited; + +/********************** + * MACROS + **********************/ + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void style_init(void) +{ + style_init_reset(&styles->scrollbar); + lv_style_set_bg_opa(&styles->scrollbar, LV_OPA_COVER); + lv_style_set_bg_color(&styles->scrollbar, COLOR_DARK); + lv_style_set_width(&styles->scrollbar, SCROLLBAR_WIDTH); + + style_init_reset(&styles->scr); + lv_style_set_bg_opa(&styles->scr, LV_OPA_COVER); + lv_style_set_bg_color(&styles->scr, COLOR_SCR); + lv_style_set_text_color(&styles->scr, COLOR_DIM); + + + style_init_reset(&styles->transp); + lv_style_set_bg_opa(&styles->transp, LV_OPA_TRANSP); + + style_init_reset(&styles->white); + lv_style_set_bg_opa(&styles->white, LV_OPA_COVER); + lv_style_set_bg_color(&styles->white, COLOR_WHITE); + lv_style_set_line_width(&styles->white, 1); + lv_style_set_line_color(&styles->white, COLOR_WHITE); + lv_style_set_arc_width(&styles->white, 2); + lv_style_set_arc_color(&styles->white, COLOR_WHITE); + + style_init_reset(&styles->light); + lv_style_set_bg_opa(&styles->light, LV_OPA_COVER); + lv_style_set_bg_color(&styles->light, COLOR_LIGHT); + lv_style_set_line_width(&styles->light, 1); + lv_style_set_line_color(&styles->light, COLOR_LIGHT); + lv_style_set_arc_width(&styles->light, 2); + lv_style_set_arc_color(&styles->light, COLOR_LIGHT); + + style_init_reset(&styles->dark); + lv_style_set_bg_opa(&styles->dark, LV_OPA_COVER); + lv_style_set_bg_color(&styles->dark, COLOR_DARK); + lv_style_set_line_width(&styles->dark, 1); + lv_style_set_line_color(&styles->dark, COLOR_DARK); + lv_style_set_arc_width(&styles->dark, 2); + lv_style_set_arc_color(&styles->dark, COLOR_DARK); + + style_init_reset(&styles->dim); + lv_style_set_bg_opa(&styles->dim, LV_OPA_COVER); + lv_style_set_bg_color(&styles->dim, COLOR_DIM); + lv_style_set_line_width(&styles->dim, 1); + lv_style_set_line_color(&styles->dim, COLOR_DIM); + lv_style_set_arc_width(&styles->dim, 2); + lv_style_set_arc_color(&styles->dim, COLOR_DIM); + +#if LV_USE_ARC || LV_USE_COLORWHEEL + style_init_reset(&styles->arc_line); + lv_style_set_arc_width(&styles->arc_line, 6); + style_init_reset(&styles->arc_knob); + lv_style_set_pad_all(&styles->arc_knob, 5); +#endif + +#if LV_USE_TEXTAREA + style_init_reset(&styles->ta_cursor); + lv_style_set_border_side(&styles->ta_cursor, LV_BORDER_SIDE_LEFT); + lv_style_set_border_color(&styles->ta_cursor, COLOR_DIM); + lv_style_set_border_width(&styles->ta_cursor, 2); + lv_style_set_bg_opa(&styles->ta_cursor, LV_OPA_TRANSP); + lv_style_set_anim_time(&styles->ta_cursor, 500); +#endif +} + + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +bool lv_theme_basic_is_inited(void) +{ + return LV_GC_ROOT(_lv_theme_basic_styles) == NULL ? false : true; +} + +lv_theme_t * lv_theme_basic_init(lv_disp_t * disp) +{ + + /*This trick is required only to avoid the garbage collection of + *styles' data if LVGL is used in a binding (e.g. Micropython) + *In a general case styles could be in simple `static lv_style_t my_style...` variables*/ + if(!lv_theme_basic_is_inited()) { + inited = false; + LV_GC_ROOT(_lv_theme_basic_styles) = lv_mem_alloc(sizeof(my_theme_styles_t)); + styles = (my_theme_styles_t *)LV_GC_ROOT(_lv_theme_basic_styles); + } + + theme.disp = disp; + theme.font_small = LV_FONT_DEFAULT; + theme.font_normal = LV_FONT_DEFAULT; + theme.font_large = LV_FONT_DEFAULT; + theme.apply_cb = theme_apply; + + style_init(); + + if(disp == NULL || lv_disp_get_theme(disp) == &theme) { + lv_obj_report_style_change(NULL); + } + + inited = true; + + return (lv_theme_t *)&theme; +} + + +static void theme_apply(lv_theme_t * th, lv_obj_t * obj) +{ + LV_UNUSED(th); + + if(lv_obj_get_parent(obj) == NULL) { + lv_obj_add_style(obj, &styles->scr, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + return; + } + + if(lv_obj_check_type(obj, &lv_obj_class)) { +#if LV_USE_TABVIEW + lv_obj_t * parent = lv_obj_get_parent(obj); + /*Tabview content area*/ + if(lv_obj_check_type(parent, &lv_tabview_class)) { + lv_obj_add_style(obj, &styles->scr, 0); + return; + } + /*Tabview pages*/ + else if(lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) { + lv_obj_add_style(obj, &styles->scr, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + return; + } +#endif + +#if LV_USE_WIN + /*Header*/ + if(lv_obj_get_index(obj) == 0 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) { + lv_obj_add_style(obj, &styles->light, 0); + return; + } + /*Content*/ + else if(lv_obj_get_index(obj) == 1 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) { + lv_obj_add_style(obj, &styles->light, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + return; + } +#endif + lv_obj_add_style(obj, &styles->white, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + } +#if LV_USE_BTN + else if(lv_obj_check_type(obj, &lv_btn_class)) { + lv_obj_add_style(obj, &styles->dark, 0); + } +#endif + +#if LV_USE_BTNMATRIX + else if(lv_obj_check_type(obj, &lv_btnmatrix_class)) { +#if LV_USE_MSGBOX + if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_msgbox_class)) { + lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS); + return; + } +#endif +#if LV_USE_TABVIEW + if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_tabview_class)) { + lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS); + return; + } +#endif + lv_obj_add_style(obj, &styles->white, 0); + lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS); + } +#endif + +#if LV_USE_BAR + else if(lv_obj_check_type(obj, &lv_bar_class)) { + lv_obj_add_style(obj, &styles->light, 0); + lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR); + } +#endif + +#if LV_USE_SLIDER + else if(lv_obj_check_type(obj, &lv_slider_class)) { + lv_obj_add_style(obj, &styles->light, 0); + lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->dim, LV_PART_KNOB); + } +#endif + +#if LV_USE_TABLE + else if(lv_obj_check_type(obj, &lv_table_class)) { + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS); + } +#endif + +#if LV_USE_CHECKBOX + else if(lv_obj_check_type(obj, &lv_checkbox_class)) { + lv_obj_add_style(obj, &styles->light, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR | LV_STATE_CHECKED); + } +#endif + +#if LV_USE_SWITCH + else if(lv_obj_check_type(obj, &lv_switch_class)) { + lv_obj_add_style(obj, &styles->light, 0); + lv_obj_add_style(obj, &styles->dim, LV_PART_KNOB); + } +#endif + +#if LV_USE_CHART + else if(lv_obj_check_type(obj, &lv_chart_class)) { + lv_obj_add_style(obj, &styles->white, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->dark, LV_PART_TICKS); + lv_obj_add_style(obj, &styles->dark, LV_PART_CURSOR); + } +#endif + +#if LV_USE_ROLLER + else if(lv_obj_check_type(obj, &lv_roller_class)) { + lv_obj_add_style(obj, &styles->light, 0); + lv_obj_add_style(obj, &styles->dark, LV_PART_SELECTED); + } +#endif + +#if LV_USE_DROPDOWN + else if(lv_obj_check_type(obj, &lv_dropdown_class)) { + lv_obj_add_style(obj, &styles->white, 0); + } + else if(lv_obj_check_type(obj, &lv_dropdownlist_class)) { + lv_obj_add_style(obj, &styles->white, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->light, LV_PART_SELECTED); + lv_obj_add_style(obj, &styles->dark, LV_PART_SELECTED | LV_STATE_CHECKED); + } +#endif + +#if LV_USE_ARC + else if(lv_obj_check_type(obj, &lv_arc_class)) { + lv_obj_add_style(obj, &styles->light, 0); + lv_obj_add_style(obj, &styles->transp, 0); + lv_obj_add_style(obj, &styles->arc_line, 0); + lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->arc_line, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->dim, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->arc_knob, LV_PART_KNOB); + } +#endif + +#if LV_USE_SPINNER + else if(lv_obj_check_type(obj, &lv_spinner_class)) { + lv_obj_add_style(obj, &styles->light, 0); + lv_obj_add_style(obj, &styles->transp, 0); + lv_obj_add_style(obj, &styles->arc_line, 0); + lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->arc_line, LV_PART_INDICATOR); + } +#endif + +#if LV_USE_COLORWHEEL + else if(lv_obj_check_type(obj, &lv_colorwheel_class)) { + lv_obj_add_style(obj, &styles->light, 0); + lv_obj_add_style(obj, &styles->transp, 0); + lv_obj_add_style(obj, &styles->arc_line, 0); + lv_obj_add_style(obj, &styles->dim, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->arc_knob, LV_PART_KNOB); + } +#endif + +#if LV_USE_METER + else if(lv_obj_check_type(obj, &lv_meter_class)) { + lv_obj_add_style(obj, &styles->light, 0); + } +#endif + +#if LV_USE_TEXTAREA + else if(lv_obj_check_type(obj, &lv_textarea_class)) { + lv_obj_add_style(obj, &styles->white, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->ta_cursor, LV_PART_CURSOR | LV_STATE_FOCUSED); + } +#endif + +#if LV_USE_CALENDAR + else if(lv_obj_check_type(obj, &lv_calendar_class)) { + lv_obj_add_style(obj, &styles->light, 0); + } +#endif + +#if LV_USE_KEYBOARD + else if(lv_obj_check_type(obj, &lv_keyboard_class)) { + lv_obj_add_style(obj, &styles->scr, 0); + lv_obj_add_style(obj, &styles->white, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->light, LV_PART_ITEMS | LV_STATE_CHECKED); + } +#endif +#if LV_USE_LIST + else if(lv_obj_check_type(obj, &lv_list_class)) { + lv_obj_add_style(obj, &styles->light, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + return; + } + else if(lv_obj_check_type(obj, &lv_list_text_class)) { + + } + else if(lv_obj_check_type(obj, &lv_list_btn_class)) { + lv_obj_add_style(obj, &styles->dark, 0); + + } +#endif +#if LV_USE_MSGBOX + else if(lv_obj_check_type(obj, &lv_msgbox_class)) { + lv_obj_add_style(obj, &styles->light, 0); + return; + } +#endif +#if LV_USE_SPINBOX + else if(lv_obj_check_type(obj, &lv_spinbox_class)) { + lv_obj_add_style(obj, &styles->light, 0); + lv_obj_add_style(obj, &styles->dark, LV_PART_CURSOR); + } +#endif +#if LV_USE_TILEVIEW + else if(lv_obj_check_type(obj, &lv_tileview_class)) { + lv_obj_add_style(obj, &styles->scr, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + } + else if(lv_obj_check_type(obj, &lv_tileview_tile_class)) { + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + } +#endif + +#if LV_USE_COLORWHEEL + else if(lv_obj_check_type(obj, &lv_colorwheel_class)) { + lv_obj_add_style(obj, &styles->light, 0); + lv_obj_add_style(obj, &styles->light, LV_PART_KNOB); + } +#endif + +#if LV_USE_LED + else if(lv_obj_check_type(obj, &lv_led_class)) { + lv_obj_add_style(obj, &styles->light, 0); + } +#endif +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void style_init_reset(lv_style_t * style) +{ + if(inited) { + lv_style_reset(style); + } + else { + lv_style_init(style); + } +} + +#endif diff --git a/L3_Middlewares/LVGL/src/themes/simple/lv_theme_simple.h b/L3_Middlewares/LVGL/src/extra/themes/basic/lv_theme_basic.h similarity index 57% rename from L3_Middlewares/LVGL/src/themes/simple/lv_theme_simple.h rename to L3_Middlewares/LVGL/src/extra/themes/basic/lv_theme_basic.h index 6717366..93a8fa8 100644 --- a/L3_Middlewares/LVGL/src/themes/simple/lv_theme_simple.h +++ b/L3_Middlewares/LVGL/src/extra/themes/basic/lv_theme_basic.h @@ -1,10 +1,10 @@ /** - * @file lv_theme_simple.h + * @file lv_theme_basic.h * */ -#ifndef LV_THEME_SIMPLE_H -#define LV_THEME_SIMPLE_H +#ifndef LV_THEME_BASIC_H +#define LV_THEME_BASIC_H #ifdef __cplusplus extern "C" { @@ -13,10 +13,9 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../lv_theme.h" -#include "../../display/lv_display.h" +#include "../../../core/lv_obj.h" -#if LV_USE_THEME_SIMPLE +#if LV_USE_THEME_BASIC /********************* * DEFINES @@ -35,24 +34,13 @@ extern "C" { * @param disp pointer to display to attach the theme * @return a pointer to reference this theme later */ -lv_theme_t * lv_theme_simple_init(lv_display_t * disp); +lv_theme_t * lv_theme_basic_init(lv_disp_t * disp); /** * Check if the theme is initialized * @return true if default theme is initialized, false otherwise */ -bool lv_theme_simple_is_inited(void); - -/** - * Get simple theme - * @return a pointer to simple theme, or NULL if this is not initialized - */ -lv_theme_t * lv_theme_simple_get(void); - -/** - * Deinitialize the simple theme - */ -void lv_theme_simple_deinit(void); +bool lv_theme_basic_is_inited(void); /********************** * MACROS @@ -64,4 +52,4 @@ void lv_theme_simple_deinit(void); } /*extern "C"*/ #endif -#endif /*LV_THEME_SIMPLE_H*/ +#endif /*LV_THEME_BASIC_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/themes/default/lv_theme_default.c b/L3_Middlewares/LVGL/src/extra/themes/default/lv_theme_default.c new file mode 100644 index 0000000..47392b0 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/themes/default/lv_theme_default.c @@ -0,0 +1,1181 @@ +/** + * @file lv_theme_default.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" /*To see all the widgets*/ + +#if LV_USE_THEME_DEFAULT + +#include "lv_theme_default.h" +#include "../../../misc/lv_gc.h" + +/********************* + * DEFINES + *********************/ +#define MODE_DARK 1 +#define RADIUS_DEFAULT (disp_size == DISP_LARGE ? lv_disp_dpx(theme.disp, 12) : lv_disp_dpx(theme.disp, 8)) + +/*SCREEN*/ +#define LIGHT_COLOR_SCR lv_palette_lighten(LV_PALETTE_GREY, 4) +#define LIGHT_COLOR_CARD lv_color_white() +#define LIGHT_COLOR_TEXT lv_palette_darken(LV_PALETTE_GREY, 4) +#define LIGHT_COLOR_GREY lv_palette_lighten(LV_PALETTE_GREY, 2) +#define DARK_COLOR_SCR lv_color_hex(0x15171A) +#define DARK_COLOR_CARD lv_color_hex(0x282b30) +#define DARK_COLOR_TEXT lv_palette_lighten(LV_PALETTE_GREY, 5) +#define DARK_COLOR_GREY lv_color_hex(0x2f3237) + +#define TRANSITION_TIME LV_THEME_DEFAULT_TRANSITION_TIME +#define BORDER_WIDTH lv_disp_dpx(theme.disp, 2) +#define OUTLINE_WIDTH lv_disp_dpx(theme.disp, 3) + +#define PAD_DEF (disp_size == DISP_LARGE ? lv_disp_dpx(theme.disp, 24) : disp_size == DISP_MEDIUM ? lv_disp_dpx(theme.disp, 20) : lv_disp_dpx(theme.disp, 16)) +#define PAD_SMALL (disp_size == DISP_LARGE ? lv_disp_dpx(theme.disp, 14) : disp_size == DISP_MEDIUM ? lv_disp_dpx(theme.disp, 12) : lv_disp_dpx(theme.disp, 10)) +#define PAD_TINY (disp_size == DISP_LARGE ? lv_disp_dpx(theme.disp, 8) : disp_size == DISP_MEDIUM ? lv_disp_dpx(theme.disp, 6) : lv_disp_dpx(theme.disp, 2)) + +/********************** + * TYPEDEFS + **********************/ +typedef struct { + lv_style_t scr; + lv_style_t scrollbar; + lv_style_t scrollbar_scrolled; + lv_style_t card; + lv_style_t btn; + + /*Utility*/ + lv_style_t bg_color_primary; + lv_style_t bg_color_primary_muted; + lv_style_t bg_color_secondary; + lv_style_t bg_color_secondary_muted; + lv_style_t bg_color_grey; + lv_style_t bg_color_white; + lv_style_t pressed; + lv_style_t disabled; + lv_style_t pad_zero; + lv_style_t pad_tiny; + lv_style_t pad_small; + lv_style_t pad_normal; + lv_style_t pad_gap; + lv_style_t line_space_large; + lv_style_t text_align_center; + lv_style_t outline_primary; + lv_style_t outline_secondary; + lv_style_t circle; + lv_style_t no_radius; + lv_style_t clip_corner; +#if LV_THEME_DEFAULT_GROW + lv_style_t grow; +#endif + lv_style_t transition_delayed; + lv_style_t transition_normal; + lv_style_t anim; + lv_style_t anim_fast; + + /*Parts*/ + lv_style_t knob; + lv_style_t indic; + +#if LV_USE_ARC + lv_style_t arc_indic; + lv_style_t arc_indic_primary; +#endif + +#if LV_USE_CHART + lv_style_t chart_series, chart_indic, chart_ticks, chart_bg; +#endif + +#if LV_USE_DROPDOWN + lv_style_t dropdown_list; +#endif + +#if LV_USE_CHECKBOX + lv_style_t cb_marker, cb_marker_checked; +#endif + +#if LV_USE_SWITCH + lv_style_t switch_knob; +#endif + +#if LV_USE_LINE + lv_style_t line; +#endif + +#if LV_USE_TABLE + lv_style_t table_cell; +#endif + +#if LV_USE_METER + lv_style_t meter_marker, meter_indic; +#endif + +#if LV_USE_TEXTAREA + lv_style_t ta_cursor, ta_placeholder; +#endif + +#if LV_USE_CALENDAR + lv_style_t calendar_btnm_bg, calendar_btnm_day, calendar_header; +#endif + +#if LV_USE_COLORWHEEL + lv_style_t colorwheel_main; +#endif + +#if LV_USE_MENU + lv_style_t menu_bg, menu_cont, menu_sidebar_cont, menu_main_cont, menu_page, menu_header_cont, menu_header_btn, + menu_section, menu_pressed, menu_separator; +#endif + +#if LV_USE_MSGBOX + lv_style_t msgbox_bg, msgbox_btn_bg, msgbox_backdrop_bg; +#endif + +#if LV_USE_KEYBOARD + lv_style_t keyboard_btn_bg; +#endif + +#if LV_USE_LIST + lv_style_t list_bg, list_btn, list_item_grow, list_label; +#endif + +#if LV_USE_TABVIEW + lv_style_t tab_bg_focus, tab_btn; +#endif +#if LV_USE_LED + lv_style_t led; +#endif +} my_theme_styles_t; + +typedef struct { + lv_theme_t base; + uint8_t light : 1; +} my_theme_t; + +typedef enum { + DISP_SMALL = 3, + DISP_MEDIUM = 2, + DISP_LARGE = 1, +} disp_size_t; + +/********************** + * STATIC PROTOTYPES + **********************/ +static void theme_apply(lv_theme_t * th, lv_obj_t * obj); +static void style_init_reset(lv_style_t * style); + +/********************** + * STATIC VARIABLES + **********************/ +static my_theme_styles_t * styles; +static lv_theme_t theme; +static disp_size_t disp_size; +static lv_color_t color_scr; +static lv_color_t color_text; +static lv_color_t color_card; +static lv_color_t color_grey; +static bool inited = false; + + +/********************** + * MACROS + **********************/ + +/********************** + * STATIC FUNCTIONS + **********************/ + + +static lv_color_t dark_color_filter_cb(const lv_color_filter_dsc_t * f, lv_color_t c, lv_opa_t opa) +{ + LV_UNUSED(f); + return lv_color_darken(c, opa); +} + +static lv_color_t grey_filter_cb(const lv_color_filter_dsc_t * f, lv_color_t color, lv_opa_t opa) +{ + LV_UNUSED(f); + if(theme.flags & MODE_DARK) return lv_color_mix(lv_palette_darken(LV_PALETTE_GREY, 2), color, opa); + else return lv_color_mix(lv_palette_lighten(LV_PALETTE_GREY, 2), color, opa); +} + +static void style_init(void) +{ + static const lv_style_prop_t trans_props[] = { + LV_STYLE_BG_OPA, LV_STYLE_BG_COLOR, + LV_STYLE_TRANSFORM_WIDTH, LV_STYLE_TRANSFORM_HEIGHT, + LV_STYLE_TRANSLATE_Y, LV_STYLE_TRANSLATE_X, + LV_STYLE_TRANSFORM_ZOOM, LV_STYLE_TRANSFORM_ANGLE, + LV_STYLE_COLOR_FILTER_OPA, LV_STYLE_COLOR_FILTER_DSC, + 0 + }; + + color_scr = theme.flags & MODE_DARK ? DARK_COLOR_SCR : LIGHT_COLOR_SCR; + color_text = theme.flags & MODE_DARK ? DARK_COLOR_TEXT : LIGHT_COLOR_TEXT; + color_card = theme.flags & MODE_DARK ? DARK_COLOR_CARD : LIGHT_COLOR_CARD; + color_grey = theme.flags & MODE_DARK ? DARK_COLOR_GREY : LIGHT_COLOR_GREY; + + style_init_reset(&styles->transition_delayed); + style_init_reset(&styles->transition_normal); +#if TRANSITION_TIME + static lv_style_transition_dsc_t trans_delayed; + lv_style_transition_dsc_init(&trans_delayed, trans_props, lv_anim_path_linear, TRANSITION_TIME, 70, NULL); + + static lv_style_transition_dsc_t trans_normal; + lv_style_transition_dsc_init(&trans_normal, trans_props, lv_anim_path_linear, TRANSITION_TIME, 0, NULL); + + lv_style_set_transition(&styles->transition_delayed, &trans_delayed); /*Go back to default state with delay*/ + + lv_style_set_transition(&styles->transition_normal, &trans_normal); /*Go back to default state with delay*/ +#endif + + style_init_reset(&styles->scrollbar); + lv_color_t sb_color = (theme.flags & MODE_DARK) ? lv_palette_darken(LV_PALETTE_GREY, + 2) : lv_palette_main(LV_PALETTE_GREY); + lv_style_set_bg_color(&styles->scrollbar, sb_color); + + lv_style_set_radius(&styles->scrollbar, LV_RADIUS_CIRCLE); + lv_style_set_pad_all(&styles->scrollbar, lv_disp_dpx(theme.disp, 7)); + lv_style_set_width(&styles->scrollbar, lv_disp_dpx(theme.disp, 5)); + lv_style_set_bg_opa(&styles->scrollbar, LV_OPA_40); +#if TRANSITION_TIME + lv_style_set_transition(&styles->scrollbar, &trans_normal); +#endif + + style_init_reset(&styles->scrollbar_scrolled); + lv_style_set_bg_opa(&styles->scrollbar_scrolled, LV_OPA_COVER); + + style_init_reset(&styles->scr); + lv_style_set_bg_opa(&styles->scr, LV_OPA_COVER); + lv_style_set_bg_color(&styles->scr, color_scr); + lv_style_set_text_color(&styles->scr, color_text); + lv_style_set_pad_row(&styles->scr, PAD_SMALL); + lv_style_set_pad_column(&styles->scr, PAD_SMALL); + + style_init_reset(&styles->card); + lv_style_set_radius(&styles->card, RADIUS_DEFAULT); + lv_style_set_bg_opa(&styles->card, LV_OPA_COVER); + lv_style_set_bg_color(&styles->card, color_card); + lv_style_set_border_color(&styles->card, color_grey); + lv_style_set_border_width(&styles->card, BORDER_WIDTH); + lv_style_set_border_post(&styles->card, true); + lv_style_set_text_color(&styles->card, color_text); + lv_style_set_pad_all(&styles->card, PAD_DEF); + lv_style_set_pad_row(&styles->card, PAD_SMALL); + lv_style_set_pad_column(&styles->card, PAD_SMALL); + lv_style_set_line_color(&styles->card, lv_palette_main(LV_PALETTE_GREY)); + lv_style_set_line_width(&styles->card, lv_disp_dpx(theme.disp, 1)); + + style_init_reset(&styles->outline_primary); + lv_style_set_outline_color(&styles->outline_primary, theme.color_primary); + lv_style_set_outline_width(&styles->outline_primary, OUTLINE_WIDTH); + lv_style_set_outline_pad(&styles->outline_primary, OUTLINE_WIDTH); + lv_style_set_outline_opa(&styles->outline_primary, LV_OPA_50); + + style_init_reset(&styles->outline_secondary); + lv_style_set_outline_color(&styles->outline_secondary, theme.color_secondary); + lv_style_set_outline_width(&styles->outline_secondary, OUTLINE_WIDTH); + lv_style_set_outline_opa(&styles->outline_secondary, LV_OPA_50); + + style_init_reset(&styles->btn); + lv_style_set_radius(&styles->btn, (disp_size == DISP_LARGE ? lv_disp_dpx(theme.disp, + 16) : disp_size == DISP_MEDIUM ? lv_disp_dpx(theme.disp, 12) : lv_disp_dpx(theme.disp, 8))); + lv_style_set_bg_opa(&styles->btn, LV_OPA_COVER); + lv_style_set_bg_color(&styles->btn, color_grey); + if(!(theme.flags & MODE_DARK)) { + lv_style_set_shadow_color(&styles->btn, lv_palette_main(LV_PALETTE_GREY)); + lv_style_set_shadow_width(&styles->btn, LV_DPX(3)); + lv_style_set_shadow_opa(&styles->btn, LV_OPA_50); + lv_style_set_shadow_ofs_y(&styles->btn, lv_disp_dpx(theme.disp, LV_DPX(4))); + } + lv_style_set_text_color(&styles->btn, color_text); + lv_style_set_pad_hor(&styles->btn, PAD_DEF); + lv_style_set_pad_ver(&styles->btn, PAD_SMALL); + lv_style_set_pad_column(&styles->btn, lv_disp_dpx(theme.disp, 5)); + lv_style_set_pad_row(&styles->btn, lv_disp_dpx(theme.disp, 5)); + + static lv_color_filter_dsc_t dark_filter; + lv_color_filter_dsc_init(&dark_filter, dark_color_filter_cb); + + static lv_color_filter_dsc_t grey_filter; + lv_color_filter_dsc_init(&grey_filter, grey_filter_cb); + + style_init_reset(&styles->pressed); + lv_style_set_color_filter_dsc(&styles->pressed, &dark_filter); + lv_style_set_color_filter_opa(&styles->pressed, 35); + + style_init_reset(&styles->disabled); + lv_style_set_color_filter_dsc(&styles->disabled, &grey_filter); + lv_style_set_color_filter_opa(&styles->disabled, LV_OPA_50); + + style_init_reset(&styles->clip_corner); + lv_style_set_clip_corner(&styles->clip_corner, true); + lv_style_set_border_post(&styles->clip_corner, true); + + style_init_reset(&styles->pad_normal); + lv_style_set_pad_all(&styles->pad_normal, PAD_DEF); + lv_style_set_pad_row(&styles->pad_normal, PAD_DEF); + lv_style_set_pad_column(&styles->pad_normal, PAD_DEF); + + style_init_reset(&styles->pad_small); + lv_style_set_pad_all(&styles->pad_small, PAD_SMALL); + lv_style_set_pad_gap(&styles->pad_small, PAD_SMALL); + + style_init_reset(&styles->pad_gap); + lv_style_set_pad_row(&styles->pad_gap, lv_disp_dpx(theme.disp, 10)); + lv_style_set_pad_column(&styles->pad_gap, lv_disp_dpx(theme.disp, 10)); + + style_init_reset(&styles->line_space_large); + lv_style_set_text_line_space(&styles->line_space_large, lv_disp_dpx(theme.disp, 20)); + + style_init_reset(&styles->text_align_center); + lv_style_set_text_align(&styles->text_align_center, LV_TEXT_ALIGN_CENTER); + + style_init_reset(&styles->pad_zero); + lv_style_set_pad_all(&styles->pad_zero, 0); + lv_style_set_pad_row(&styles->pad_zero, 0); + lv_style_set_pad_column(&styles->pad_zero, 0); + + style_init_reset(&styles->pad_tiny); + lv_style_set_pad_all(&styles->pad_tiny, PAD_TINY); + lv_style_set_pad_row(&styles->pad_tiny, PAD_TINY); + lv_style_set_pad_column(&styles->pad_tiny, PAD_TINY); + + style_init_reset(&styles->bg_color_primary); + lv_style_set_bg_color(&styles->bg_color_primary, theme.color_primary); + lv_style_set_text_color(&styles->bg_color_primary, lv_color_white()); + lv_style_set_bg_opa(&styles->bg_color_primary, LV_OPA_COVER); + + style_init_reset(&styles->bg_color_primary_muted); + lv_style_set_bg_color(&styles->bg_color_primary_muted, theme.color_primary); + lv_style_set_text_color(&styles->bg_color_primary_muted, theme.color_primary); + lv_style_set_bg_opa(&styles->bg_color_primary_muted, LV_OPA_20); + + style_init_reset(&styles->bg_color_secondary); + lv_style_set_bg_color(&styles->bg_color_secondary, theme.color_secondary); + lv_style_set_text_color(&styles->bg_color_secondary, lv_color_white()); + lv_style_set_bg_opa(&styles->bg_color_secondary, LV_OPA_COVER); + + style_init_reset(&styles->bg_color_secondary_muted); + lv_style_set_bg_color(&styles->bg_color_secondary_muted, theme.color_secondary); + lv_style_set_text_color(&styles->bg_color_secondary_muted, theme.color_secondary); + lv_style_set_bg_opa(&styles->bg_color_secondary_muted, LV_OPA_20); + + style_init_reset(&styles->bg_color_grey); + lv_style_set_bg_color(&styles->bg_color_grey, color_grey); + lv_style_set_bg_opa(&styles->bg_color_grey, LV_OPA_COVER); + lv_style_set_text_color(&styles->bg_color_grey, color_text); + + style_init_reset(&styles->bg_color_white); + lv_style_set_bg_color(&styles->bg_color_white, color_card); + lv_style_set_bg_opa(&styles->bg_color_white, LV_OPA_COVER); + lv_style_set_text_color(&styles->bg_color_white, color_text); + + style_init_reset(&styles->circle); + lv_style_set_radius(&styles->circle, LV_RADIUS_CIRCLE); + + style_init_reset(&styles->no_radius); + lv_style_set_radius(&styles->no_radius, 0); + +#if LV_THEME_DEFAULT_GROW + style_init_reset(&styles->grow); + lv_style_set_transform_width(&styles->grow, lv_disp_dpx(theme.disp, 3)); + lv_style_set_transform_height(&styles->grow, lv_disp_dpx(theme.disp, 3)); +#endif + + style_init_reset(&styles->knob); + lv_style_set_bg_color(&styles->knob, theme.color_primary); + lv_style_set_bg_opa(&styles->knob, LV_OPA_COVER); + lv_style_set_pad_all(&styles->knob, lv_disp_dpx(theme.disp, 6)); + lv_style_set_radius(&styles->knob, LV_RADIUS_CIRCLE); + + style_init_reset(&styles->anim); + lv_style_set_anim_time(&styles->anim, 200); + + style_init_reset(&styles->anim_fast); + lv_style_set_anim_time(&styles->anim_fast, 120); + +#if LV_USE_ARC + style_init_reset(&styles->arc_indic); + lv_style_set_arc_color(&styles->arc_indic, color_grey); + lv_style_set_arc_width(&styles->arc_indic, lv_disp_dpx(theme.disp, 15)); + lv_style_set_arc_rounded(&styles->arc_indic, true); + + style_init_reset(&styles->arc_indic_primary); + lv_style_set_arc_color(&styles->arc_indic_primary, theme.color_primary); +#endif + +#if LV_USE_DROPDOWN + style_init_reset(&styles->dropdown_list); + lv_style_set_max_height(&styles->dropdown_list, LV_DPI_DEF * 2); +#endif +#if LV_USE_CHECKBOX + style_init_reset(&styles->cb_marker); + lv_style_set_pad_all(&styles->cb_marker, lv_disp_dpx(theme.disp, 3)); + lv_style_set_border_width(&styles->cb_marker, BORDER_WIDTH); + lv_style_set_border_color(&styles->cb_marker, theme.color_primary); + lv_style_set_bg_color(&styles->cb_marker, color_card); + lv_style_set_bg_opa(&styles->cb_marker, LV_OPA_COVER); + lv_style_set_radius(&styles->cb_marker, RADIUS_DEFAULT / 2); + + style_init_reset(&styles->cb_marker_checked); + lv_style_set_bg_img_src(&styles->cb_marker_checked, LV_SYMBOL_OK); + lv_style_set_text_color(&styles->cb_marker_checked, lv_color_white()); + lv_style_set_text_font(&styles->cb_marker_checked, theme.font_small); +#endif + +#if LV_USE_SWITCH + style_init_reset(&styles->switch_knob); + lv_style_set_pad_all(&styles->switch_knob, - lv_disp_dpx(theme.disp, 4)); + lv_style_set_bg_color(&styles->switch_knob, lv_color_white()); +#endif + +#if LV_USE_LINE + style_init_reset(&styles->line); + lv_style_set_line_width(&styles->line, 1); + lv_style_set_line_color(&styles->line, color_text); +#endif + +#if LV_USE_CHART + style_init_reset(&styles->chart_bg); + lv_style_set_border_post(&styles->chart_bg, false); + lv_style_set_pad_column(&styles->chart_bg, lv_disp_dpx(theme.disp, 10)); + lv_style_set_line_color(&styles->chart_bg, color_grey); + + style_init_reset(&styles->chart_series); + lv_style_set_line_width(&styles->chart_series, lv_disp_dpx(theme.disp, 3)); + lv_style_set_radius(&styles->chart_series, lv_disp_dpx(theme.disp, 3)); + lv_style_set_size(&styles->chart_series, lv_disp_dpx(theme.disp, 8)); + lv_style_set_pad_column(&styles->chart_series, lv_disp_dpx(theme.disp, 2)); + + style_init_reset(&styles->chart_indic); + lv_style_set_radius(&styles->chart_indic, LV_RADIUS_CIRCLE); + lv_style_set_size(&styles->chart_indic, lv_disp_dpx(theme.disp, 8)); + lv_style_set_bg_color(&styles->chart_indic, theme.color_primary); + lv_style_set_bg_opa(&styles->chart_indic, LV_OPA_COVER); + + style_init_reset(&styles->chart_ticks); + lv_style_set_line_width(&styles->chart_ticks, lv_disp_dpx(theme.disp, 1)); + lv_style_set_line_color(&styles->chart_ticks, color_text); + lv_style_set_pad_all(&styles->chart_ticks, lv_disp_dpx(theme.disp, 2)); + lv_style_set_text_color(&styles->chart_ticks, lv_palette_main(LV_PALETTE_GREY)); +#endif + +#if LV_USE_MENU + style_init_reset(&styles->menu_bg); + lv_style_set_pad_all(&styles->menu_bg, 0); + lv_style_set_pad_gap(&styles->menu_bg, 0); + lv_style_set_radius(&styles->menu_bg, 0); + lv_style_set_clip_corner(&styles->menu_bg, true); + lv_style_set_border_side(&styles->menu_bg, LV_BORDER_SIDE_NONE); + + style_init_reset(&styles->menu_section); + lv_style_set_radius(&styles->menu_section, RADIUS_DEFAULT); + lv_style_set_clip_corner(&styles->menu_section, true); + lv_style_set_bg_opa(&styles->menu_section, LV_OPA_COVER); + lv_style_set_bg_color(&styles->menu_section, color_card); + lv_style_set_text_color(&styles->menu_section, color_text); + + style_init_reset(&styles->menu_cont); + lv_style_set_pad_hor(&styles->menu_cont, PAD_SMALL); + lv_style_set_pad_ver(&styles->menu_cont, PAD_SMALL); + lv_style_set_pad_gap(&styles->menu_cont, PAD_SMALL); + lv_style_set_border_width(&styles->menu_cont, lv_disp_dpx(theme.disp, 1)); + lv_style_set_border_opa(&styles->menu_cont, LV_OPA_10); + lv_style_set_border_color(&styles->menu_cont, color_text); + lv_style_set_border_side(&styles->menu_cont, LV_BORDER_SIDE_NONE); + + style_init_reset(&styles->menu_sidebar_cont); + lv_style_set_pad_all(&styles->menu_sidebar_cont, 0); + lv_style_set_pad_gap(&styles->menu_sidebar_cont, 0); + lv_style_set_border_width(&styles->menu_sidebar_cont, lv_disp_dpx(theme.disp, 1)); + lv_style_set_border_opa(&styles->menu_sidebar_cont, LV_OPA_10); + lv_style_set_border_color(&styles->menu_sidebar_cont, color_text); + lv_style_set_border_side(&styles->menu_sidebar_cont, LV_BORDER_SIDE_RIGHT); + + style_init_reset(&styles->menu_main_cont); + lv_style_set_pad_all(&styles->menu_main_cont, 0); + lv_style_set_pad_gap(&styles->menu_main_cont, 0); + + style_init_reset(&styles->menu_header_cont); + lv_style_set_pad_hor(&styles->menu_header_cont, PAD_SMALL); + lv_style_set_pad_ver(&styles->menu_header_cont, PAD_TINY); + lv_style_set_pad_gap(&styles->menu_header_cont, PAD_SMALL); + + style_init_reset(&styles->menu_header_btn); + lv_style_set_pad_hor(&styles->menu_header_btn, PAD_TINY); + lv_style_set_pad_ver(&styles->menu_header_btn, PAD_TINY); + lv_style_set_shadow_opa(&styles->menu_header_btn, LV_OPA_TRANSP); + lv_style_set_bg_opa(&styles->menu_header_btn, LV_OPA_TRANSP); + lv_style_set_text_color(&styles->menu_header_btn, color_text); + + style_init_reset(&styles->menu_page); + lv_style_set_pad_hor(&styles->menu_page, 0); + lv_style_set_pad_gap(&styles->menu_page, 0); + + style_init_reset(&styles->menu_pressed); + lv_style_set_bg_opa(&styles->menu_pressed, LV_OPA_20); + lv_style_set_bg_color(&styles->menu_pressed, lv_palette_main(LV_PALETTE_GREY)); + + style_init_reset(&styles->menu_separator); + lv_style_set_bg_opa(&styles->menu_separator, LV_OPA_TRANSP); + lv_style_set_pad_ver(&styles->menu_separator, PAD_TINY); +#endif + +#if LV_USE_METER + style_init_reset(&styles->meter_marker); + lv_style_set_line_width(&styles->meter_marker, lv_disp_dpx(theme.disp, 5)); + lv_style_set_line_color(&styles->meter_marker, color_text); + lv_style_set_size(&styles->meter_marker, lv_disp_dpx(theme.disp, 20)); + lv_style_set_pad_left(&styles->meter_marker, lv_disp_dpx(theme.disp, 15)); + + style_init_reset(&styles->meter_indic); + lv_style_set_radius(&styles->meter_indic, LV_RADIUS_CIRCLE); + lv_style_set_bg_color(&styles->meter_indic, color_text); + lv_style_set_bg_opa(&styles->meter_indic, LV_OPA_COVER); + lv_style_set_size(&styles->meter_indic, lv_disp_dpx(theme.disp, 15)); +#endif + +#if LV_USE_TABLE + style_init_reset(&styles->table_cell); + lv_style_set_border_width(&styles->table_cell, lv_disp_dpx(theme.disp, 1)); + lv_style_set_border_color(&styles->table_cell, color_grey); + lv_style_set_border_side(&styles->table_cell, LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_BOTTOM); +#endif + +#if LV_USE_TEXTAREA + style_init_reset(&styles->ta_cursor); + lv_style_set_border_color(&styles->ta_cursor, color_text); + lv_style_set_border_width(&styles->ta_cursor, lv_disp_dpx(theme.disp, 2)); + lv_style_set_pad_left(&styles->ta_cursor, - lv_disp_dpx(theme.disp, 1)); + lv_style_set_border_side(&styles->ta_cursor, LV_BORDER_SIDE_LEFT); + lv_style_set_anim_time(&styles->ta_cursor, 400); + + style_init_reset(&styles->ta_placeholder); + lv_style_set_text_color(&styles->ta_placeholder, (theme.flags & MODE_DARK) ? lv_palette_darken(LV_PALETTE_GREY, + 2) : lv_palette_lighten(LV_PALETTE_GREY, 1)); +#endif + +#if LV_USE_CALENDAR + style_init_reset(&styles->calendar_btnm_bg); + lv_style_set_pad_all(&styles->calendar_btnm_bg, PAD_SMALL); + lv_style_set_pad_gap(&styles->calendar_btnm_bg, PAD_SMALL / 2); + + style_init_reset(&styles->calendar_btnm_day); + lv_style_set_border_width(&styles->calendar_btnm_day, lv_disp_dpx(theme.disp, 1)); + lv_style_set_border_color(&styles->calendar_btnm_day, color_grey); + lv_style_set_bg_color(&styles->calendar_btnm_day, color_card); + lv_style_set_bg_opa(&styles->calendar_btnm_day, LV_OPA_20); + + style_init_reset(&styles->calendar_header); + lv_style_set_pad_hor(&styles->calendar_header, PAD_SMALL); + lv_style_set_pad_top(&styles->calendar_header, PAD_SMALL); + lv_style_set_pad_bottom(&styles->calendar_header, PAD_TINY); + lv_style_set_pad_gap(&styles->calendar_header, PAD_SMALL); +#endif + +#if LV_USE_COLORWHEEL + style_init_reset(&styles->colorwheel_main); + lv_style_set_arc_width(&styles->colorwheel_main, lv_disp_dpx(theme.disp, 10)); +#endif + +#if LV_USE_MSGBOX + /*To add space for for the button shadow*/ + style_init_reset(&styles->msgbox_btn_bg); + lv_style_set_pad_all(&styles->msgbox_btn_bg, lv_disp_dpx(theme.disp, 4)); + + style_init_reset(&styles->msgbox_bg); + lv_style_set_max_width(&styles->msgbox_bg, lv_pct(100)); + + style_init_reset(&styles->msgbox_backdrop_bg); + lv_style_set_bg_color(&styles->msgbox_backdrop_bg, lv_palette_main(LV_PALETTE_GREY)); + lv_style_set_bg_opa(&styles->msgbox_backdrop_bg, LV_OPA_50); +#endif +#if LV_USE_KEYBOARD + style_init_reset(&styles->keyboard_btn_bg); + lv_style_set_shadow_width(&styles->keyboard_btn_bg, 0); + lv_style_set_radius(&styles->keyboard_btn_bg, disp_size == DISP_SMALL ? RADIUS_DEFAULT / 2 : RADIUS_DEFAULT); +#endif + +#if LV_USE_TABVIEW + style_init_reset(&styles->tab_btn); + lv_style_set_border_color(&styles->tab_btn, theme.color_primary); + lv_style_set_border_width(&styles->tab_btn, BORDER_WIDTH * 2); + lv_style_set_border_side(&styles->tab_btn, LV_BORDER_SIDE_BOTTOM); + + style_init_reset(&styles->tab_bg_focus); + lv_style_set_outline_pad(&styles->tab_bg_focus, -BORDER_WIDTH); +#endif + +#if LV_USE_LIST + style_init_reset(&styles->list_bg); + lv_style_set_pad_hor(&styles->list_bg, PAD_DEF); + lv_style_set_pad_ver(&styles->list_bg, 0); + lv_style_set_pad_gap(&styles->list_bg, 0); + lv_style_set_clip_corner(&styles->list_bg, true); + + style_init_reset(&styles->list_btn); + lv_style_set_border_width(&styles->list_btn, lv_disp_dpx(theme.disp, 1)); + lv_style_set_border_color(&styles->list_btn, color_grey); + lv_style_set_border_side(&styles->list_btn, LV_BORDER_SIDE_BOTTOM); + lv_style_set_pad_all(&styles->list_btn, PAD_SMALL); + lv_style_set_pad_column(&styles->list_btn, PAD_SMALL); + + style_init_reset(&styles->list_item_grow); + lv_style_set_transform_width(&styles->list_item_grow, PAD_DEF); +#endif + + +#if LV_USE_LED + style_init_reset(&styles->led); + lv_style_set_bg_opa(&styles->led, LV_OPA_COVER); + lv_style_set_bg_color(&styles->led, lv_color_white()); + lv_style_set_bg_grad_color(&styles->led, lv_palette_main(LV_PALETTE_GREY)); + lv_style_set_radius(&styles->led, LV_RADIUS_CIRCLE); + lv_style_set_shadow_width(&styles->led, lv_disp_dpx(theme.disp, 15)); + lv_style_set_shadow_color(&styles->led, lv_color_white()); + lv_style_set_shadow_spread(&styles->led, lv_disp_dpx(theme.disp, 5)); +#endif +} + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, + const lv_font_t * font) +{ + + /*This trick is required only to avoid the garbage collection of + *styles' data if LVGL is used in a binding (e.g. Micropython) + *In a general case styles could be in simple `static lv_style_t my_style...` variables*/ + if(!lv_theme_default_is_inited()) { + inited = false; + LV_GC_ROOT(_lv_theme_default_styles) = lv_mem_alloc(sizeof(my_theme_styles_t)); + styles = (my_theme_styles_t *)LV_GC_ROOT(_lv_theme_default_styles); + } + + if(LV_HOR_RES <= 320) disp_size = DISP_SMALL; + else if(LV_HOR_RES < 720) disp_size = DISP_MEDIUM; + else disp_size = DISP_LARGE; + + theme.disp = disp; + theme.color_primary = color_primary; + theme.color_secondary = color_secondary; + theme.font_small = font; + theme.font_normal = font; + theme.font_large = font; + theme.apply_cb = theme_apply; + theme.flags = dark ? MODE_DARK : 0; + + style_init(); + + if(disp == NULL || lv_disp_get_theme(disp) == &theme) lv_obj_report_style_change(NULL); + + inited = true; + + return (lv_theme_t *)&theme; +} + +lv_theme_t * lv_theme_default_get(void) +{ + if(!lv_theme_default_is_inited()) { + return NULL; + } + + return (lv_theme_t *)&theme; +} + +bool lv_theme_default_is_inited(void) +{ + return LV_GC_ROOT(_lv_theme_default_styles) == NULL ? false : true; +} + + +static void theme_apply(lv_theme_t * th, lv_obj_t * obj) +{ + LV_UNUSED(th); + + if(lv_obj_get_parent(obj) == NULL) { + lv_obj_add_style(obj, &styles->scr, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + return; + } + + if(lv_obj_check_type(obj, &lv_obj_class)) { +#if LV_USE_TABVIEW + lv_obj_t * parent = lv_obj_get_parent(obj); + /*Tabview content area*/ + if(lv_obj_check_type(parent, &lv_tabview_class)) { + return; + } + /*Tabview pages*/ + else if(lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) { + lv_obj_add_style(obj, &styles->pad_normal, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + return; + } +#endif + +#if LV_USE_WIN + /*Header*/ + if(lv_obj_get_index(obj) == 0 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) { + lv_obj_add_style(obj, &styles->bg_color_grey, 0); + lv_obj_add_style(obj, &styles->pad_tiny, 0); + return; + } + /*Content*/ + else if(lv_obj_get_index(obj) == 1 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) { + lv_obj_add_style(obj, &styles->scr, 0); + lv_obj_add_style(obj, &styles->pad_normal, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + return; + } +#endif + + +#if LV_USE_CALENDAR + if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_calendar_class)) { + /*No style*/ + return; + } +#endif + + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + } +#if LV_USE_BTN + else if(lv_obj_check_type(obj, &lv_btn_class)) { + lv_obj_add_style(obj, &styles->btn, 0); + lv_obj_add_style(obj, &styles->bg_color_primary, 0); + lv_obj_add_style(obj, &styles->transition_delayed, 0); + lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->transition_normal, LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); +#if LV_THEME_DEFAULT_GROW + lv_obj_add_style(obj, &styles->grow, LV_STATE_PRESSED); +#endif + lv_obj_add_style(obj, &styles->bg_color_secondary, LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->disabled, LV_STATE_DISABLED); + +#if LV_USE_MENU + if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_menu_sidebar_header_cont_class) || + lv_obj_check_type(lv_obj_get_parent(obj), &lv_menu_main_header_cont_class)) { + lv_obj_add_style(obj, &styles->menu_header_btn, 0); + lv_obj_add_style(obj, &styles->menu_pressed, LV_STATE_PRESSED); + } +#endif + } +#endif + +#if LV_USE_LINE + else if(lv_obj_check_type(obj, &lv_line_class)) { + lv_obj_add_style(obj, &styles->line, 0); + } +#endif + +#if LV_USE_BTNMATRIX + else if(lv_obj_check_type(obj, &lv_btnmatrix_class)) { +#if LV_USE_MSGBOX + if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_msgbox_class)) { + lv_obj_add_style(obj, &styles->msgbox_btn_bg, 0); + lv_obj_add_style(obj, &styles->pad_gap, 0); + lv_obj_add_style(obj, &styles->btn, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_ITEMS | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->bg_color_primary_muted, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->bg_color_secondary_muted, LV_PART_ITEMS | LV_STATE_EDITED); + return; + } +#endif +#if LV_USE_TABVIEW + if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_tabview_class)) { + lv_obj_add_style(obj, &styles->bg_color_white, 0); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->tab_bg_focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->bg_color_primary_muted, LV_PART_ITEMS | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->tab_btn, LV_PART_ITEMS | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->tab_bg_focus, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + return; + } +#endif + +#if LV_USE_CALENDAR + if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_calendar_class)) { + lv_obj_add_style(obj, &styles->calendar_btnm_bg, 0); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->calendar_btnm_day, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED); + return; + } +#endif + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->btn, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_ITEMS | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED); + } +#endif + +#if LV_USE_BAR + else if(lv_obj_check_type(obj, &lv_bar_class)) { + lv_obj_add_style(obj, &styles->bg_color_primary_muted, 0); + lv_obj_add_style(obj, &styles->circle, 0); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->circle, LV_PART_INDICATOR); + } +#endif + +#if LV_USE_SLIDER + else if(lv_obj_check_type(obj, &lv_slider_class)) { + lv_obj_add_style(obj, &styles->bg_color_primary_muted, 0); + lv_obj_add_style(obj, &styles->circle, 0); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->circle, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->knob, LV_PART_KNOB); +#if LV_THEME_DEFAULT_GROW + lv_obj_add_style(obj, &styles->grow, LV_PART_KNOB | LV_STATE_PRESSED); +#endif + lv_obj_add_style(obj, &styles->transition_delayed, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->transition_normal, LV_PART_KNOB | LV_STATE_PRESSED); + } +#endif + +#if LV_USE_TABLE + else if(lv_obj_check_type(obj, &lv_table_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->pad_zero, 0); + lv_obj_add_style(obj, &styles->no_radius, 0); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->table_cell, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->pad_normal, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->bg_color_secondary, LV_PART_ITEMS | LV_STATE_EDITED); + } +#endif + +#if LV_USE_CHECKBOX + else if(lv_obj_check_type(obj, &lv_checkbox_class)) { + lv_obj_add_style(obj, &styles->pad_gap, 0); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->disabled, LV_PART_INDICATOR | LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->cb_marker, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->cb_marker_checked, LV_PART_INDICATOR | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->pressed, LV_PART_INDICATOR | LV_STATE_PRESSED); +#if LV_THEME_DEFAULT_GROW + lv_obj_add_style(obj, &styles->grow, LV_PART_INDICATOR | LV_STATE_PRESSED); +#endif + lv_obj_add_style(obj, &styles->transition_normal, LV_PART_INDICATOR | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->transition_delayed, LV_PART_INDICATOR); + } +#endif + +#if LV_USE_SWITCH + else if(lv_obj_check_type(obj, &lv_switch_class)) { + lv_obj_add_style(obj, &styles->bg_color_grey, 0); + lv_obj_add_style(obj, &styles->circle, 0); + lv_obj_add_style(obj, &styles->anim_fast, 0); + lv_obj_add_style(obj, &styles->disabled, LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->circle, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->disabled, LV_PART_INDICATOR | LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->knob, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->switch_knob, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->disabled, LV_PART_KNOB | LV_STATE_DISABLED); + + lv_obj_add_style(obj, &styles->transition_normal, LV_PART_INDICATOR | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->transition_normal, LV_PART_INDICATOR); + } +#endif + +#if LV_USE_CHART + else if(lv_obj_check_type(obj, &lv_chart_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->pad_small, 0); + lv_obj_add_style(obj, &styles->chart_bg, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &styles->chart_series, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->chart_indic, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->chart_ticks, LV_PART_TICKS); + lv_obj_add_style(obj, &styles->chart_series, LV_PART_CURSOR); + } +#endif + +#if LV_USE_ROLLER + else if(lv_obj_check_type(obj, &lv_roller_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->anim, 0); + lv_obj_add_style(obj, &styles->line_space_large, 0); + lv_obj_add_style(obj, &styles->text_align_center, 0); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_SELECTED); + } +#endif + +#if LV_USE_DROPDOWN + else if(lv_obj_check_type(obj, &lv_dropdown_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->pad_small, 0); + lv_obj_add_style(obj, &styles->transition_delayed, 0); + lv_obj_add_style(obj, &styles->transition_normal, LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->transition_normal, LV_PART_INDICATOR); + } + else if(lv_obj_check_type(obj, &lv_dropdownlist_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->clip_corner, 0); + lv_obj_add_style(obj, &styles->line_space_large, 0); + lv_obj_add_style(obj, &styles->dropdown_list, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_SELECTED); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_SELECTED | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->pressed, LV_PART_SELECTED | LV_STATE_PRESSED); + } +#endif + +#if LV_USE_ARC + else if(lv_obj_check_type(obj, &lv_arc_class)) { + lv_obj_add_style(obj, &styles->arc_indic, 0); + lv_obj_add_style(obj, &styles->arc_indic, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->arc_indic_primary, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->knob, LV_PART_KNOB); + } +#endif + + +#if LV_USE_SPINNER + else if(lv_obj_check_type(obj, &lv_spinner_class)) { + lv_obj_add_style(obj, &styles->arc_indic, 0); + lv_obj_add_style(obj, &styles->arc_indic, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->arc_indic_primary, LV_PART_INDICATOR); + } +#endif + +#if LV_USE_METER + else if(lv_obj_check_type(obj, &lv_meter_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->circle, 0); + lv_obj_add_style(obj, &styles->meter_indic, LV_PART_INDICATOR); + } +#endif + +#if LV_USE_TEXTAREA + else if(lv_obj_check_type(obj, &lv_textarea_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->pad_small, 0); + lv_obj_add_style(obj, &styles->disabled, LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &styles->ta_cursor, LV_PART_CURSOR | LV_STATE_FOCUSED); + lv_obj_add_style(obj, &styles->ta_placeholder, LV_PART_TEXTAREA_PLACEHOLDER); + } +#endif + +#if LV_USE_CALENDAR + else if(lv_obj_check_type(obj, &lv_calendar_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->pad_zero, 0); + } +#endif + +#if LV_USE_CALENDAR_HEADER_ARROW + else if(lv_obj_check_type(obj, &lv_calendar_header_arrow_class)) { + lv_obj_add_style(obj, &styles->calendar_header, 0); + } +#endif + +#if LV_USE_CALENDAR_HEADER_DROPDOWN + else if(lv_obj_check_type(obj, &lv_calendar_header_dropdown_class)) { + lv_obj_add_style(obj, &styles->calendar_header, 0); + } +#endif + +#if LV_USE_KEYBOARD + else if(lv_obj_check_type(obj, &lv_keyboard_class)) { + lv_obj_add_style(obj, &styles->scr, 0); + lv_obj_add_style(obj, disp_size == DISP_LARGE ? &styles->pad_small : &styles->pad_tiny, 0); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->btn, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->keyboard_btn_bg, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->bg_color_grey, LV_PART_ITEMS | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->bg_color_primary_muted, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->bg_color_secondary_muted, LV_PART_ITEMS | LV_STATE_EDITED); + } +#endif +#if LV_USE_LIST + else if(lv_obj_check_type(obj, &lv_list_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->list_bg, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + return; + } + else if(lv_obj_check_type(obj, &lv_list_text_class)) { + lv_obj_add_style(obj, &styles->bg_color_grey, 0); + lv_obj_add_style(obj, &styles->list_item_grow, 0); + } + else if(lv_obj_check_type(obj, &lv_list_btn_class)) { + lv_obj_add_style(obj, &styles->bg_color_white, 0); + lv_obj_add_style(obj, &styles->list_btn, 0); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->list_item_grow, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->list_item_grow, LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED); + + } +#endif +#if LV_USE_MENU + else if(lv_obj_check_type(obj, &lv_menu_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->menu_bg, 0); + } + else if(lv_obj_check_type(obj, &lv_menu_sidebar_cont_class)) { + lv_obj_add_style(obj, &styles->menu_sidebar_cont, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + } + else if(lv_obj_check_type(obj, &lv_menu_main_cont_class)) { + lv_obj_add_style(obj, &styles->menu_main_cont, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + } + else if(lv_obj_check_type(obj, &lv_menu_cont_class)) { + lv_obj_add_style(obj, &styles->menu_cont, 0); + lv_obj_add_style(obj, &styles->menu_pressed, LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->bg_color_primary_muted, LV_STATE_PRESSED | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->bg_color_primary_muted, LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_STATE_FOCUS_KEY); + } + else if(lv_obj_check_type(obj, &lv_menu_sidebar_header_cont_class) || + lv_obj_check_type(obj, &lv_menu_main_header_cont_class)) { + lv_obj_add_style(obj, &styles->menu_header_cont, 0); + } + else if(lv_obj_check_type(obj, &lv_menu_page_class)) { + lv_obj_add_style(obj, &styles->menu_page, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + } + else if(lv_obj_check_type(obj, &lv_menu_section_class)) { + lv_obj_add_style(obj, &styles->menu_section, 0); + } + else if(lv_obj_check_type(obj, &lv_menu_separator_class)) { + lv_obj_add_style(obj, &styles->menu_separator, 0); + } +#endif +#if LV_USE_MSGBOX + else if(lv_obj_check_type(obj, &lv_msgbox_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->msgbox_bg, 0); + return; + } + else if(lv_obj_check_type(obj, &lv_msgbox_backdrop_class)) { + lv_obj_add_style(obj, &styles->msgbox_backdrop_bg, 0); + } +#endif +#if LV_USE_SPINBOX + else if(lv_obj_check_type(obj, &lv_spinbox_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->pad_small, 0); + lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_CURSOR); + } +#endif +#if LV_USE_TILEVIEW + else if(lv_obj_check_type(obj, &lv_tileview_class)) { + lv_obj_add_style(obj, &styles->scr, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + } + else if(lv_obj_check_type(obj, &lv_tileview_tile_class)) { + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + } +#endif + +#if LV_USE_TABVIEW + else if(lv_obj_check_type(obj, &lv_tabview_class)) { + lv_obj_add_style(obj, &styles->scr, 0); + lv_obj_add_style(obj, &styles->pad_zero, 0); + } +#endif + +#if LV_USE_WIN + else if(lv_obj_check_type(obj, &lv_win_class)) { + lv_obj_add_style(obj, &styles->clip_corner, 0); + } +#endif + +#if LV_USE_COLORWHEEL + else if(lv_obj_check_type(obj, &lv_colorwheel_class)) { + lv_obj_add_style(obj, &styles->colorwheel_main, 0); + lv_obj_add_style(obj, &styles->pad_normal, 0); + lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->pad_normal, LV_PART_KNOB); + } +#endif + +#if LV_USE_LED + else if(lv_obj_check_type(obj, &lv_led_class)) { + lv_obj_add_style(obj, &styles->led, 0); + } +#endif +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void style_init_reset(lv_style_t * style) +{ + if(inited) { + lv_style_reset(style); + } + else { + lv_style_init(style); + } +} + +#endif diff --git a/L3_Middlewares/LVGL/src/themes/default/lv_theme_default.h b/L3_Middlewares/LVGL/src/extra/themes/default/lv_theme_default.h similarity index 81% rename from L3_Middlewares/LVGL/src/themes/default/lv_theme_default.h rename to L3_Middlewares/LVGL/src/extra/themes/default/lv_theme_default.h index 72d9acb..5b1fd91 100644 --- a/L3_Middlewares/LVGL/src/themes/default/lv_theme_default.h +++ b/L3_Middlewares/LVGL/src/extra/themes/default/lv_theme_default.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../lv_theme.h" +#include "../../../core/lv_obj.h" #if LV_USE_THEME_DEFAULT @@ -31,14 +31,12 @@ extern "C" { /** * Initialize the theme - * @param disp pointer to display * @param color_primary the primary color of the theme * @param color_secondary the secondary color for the theme - * @param dark * @param font pointer to a font to use. * @return a pointer to reference this theme later */ -lv_theme_t * lv_theme_default_init(lv_display_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, +lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font); /** @@ -53,11 +51,6 @@ lv_theme_t * lv_theme_default_get(void); */ bool lv_theme_default_is_inited(void); -/** - * Deinitialize the default theme - */ -void lv_theme_default_deinit(void); - /********************** * MACROS **********************/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_color_op_private.h b/L3_Middlewares/LVGL/src/extra/themes/lv_themes.h similarity index 69% rename from L3_Middlewares/LVGL/src/misc/lv_color_op_private.h rename to L3_Middlewares/LVGL/src/extra/themes/lv_themes.h index d6516eb..372f626 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_color_op_private.h +++ b/L3_Middlewares/LVGL/src/extra/themes/lv_themes.h @@ -1,10 +1,10 @@ /** - * @file lv_color_op_private.h + * @file lv_themes.h * */ -#ifndef LV_COLOR_OP_PRIVATE_H -#define LV_COLOR_OP_PRIVATE_H +#ifndef LV_THEMES_H +#define LV_THEMES_H #ifdef __cplusplus extern "C" { @@ -13,8 +13,9 @@ extern "C" { /********************* * INCLUDES *********************/ - -#include "lv_color_op.h" +#include "default/lv_theme_default.h" +#include "mono/lv_theme_mono.h" +#include "basic/lv_theme_basic.h" /********************* * DEFINES @@ -36,4 +37,4 @@ extern "C" { } /*extern "C"*/ #endif -#endif /*LV_COLOR_OP_PRIVATE_H*/ +#endif /*LV_THEMES_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/themes/mono/lv_theme_mono.c b/L3_Middlewares/LVGL/src/extra/themes/mono/lv_theme_mono.c new file mode 100644 index 0000000..b249e76 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/themes/mono/lv_theme_mono.c @@ -0,0 +1,504 @@ +/** + * @file lv_theme_mono.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" + +#if LV_USE_THEME_MONO + +#include "lv_theme_mono.h" +#include "../../../misc/lv_gc.h" + +/********************* + * DEFINES + *********************/ + +#define COLOR_FG dark_bg ? lv_color_white() : lv_color_black() +#define COLOR_BG dark_bg ? lv_color_black() : lv_color_white() + +#define BORDER_W_NORMAL 1 +#define BORDER_W_PR 3 +#define BORDER_W_DIS 0 +#define BORDER_W_FOCUS 1 +#define BORDER_W_EDIT 2 +#define PAD_DEF 4 + +/********************** + * TYPEDEFS + **********************/ +typedef struct { + lv_style_t scr; + lv_style_t card; + lv_style_t scrollbar; + lv_style_t btn; + lv_style_t pr; + lv_style_t inv; + lv_style_t disabled; + lv_style_t focus; + lv_style_t edit; + lv_style_t pad_gap; + lv_style_t pad_zero; + lv_style_t no_radius; + lv_style_t radius_circle; + lv_style_t large_border; + lv_style_t large_line_space; + lv_style_t underline; +#if LV_USE_TEXTAREA + lv_style_t ta_cursor; +#endif +} my_theme_styles_t; + + +/********************** + * STATIC PROTOTYPES + **********************/ +static void style_init_reset(lv_style_t * style); +static void theme_apply(lv_theme_t * th, lv_obj_t * obj); + +/********************** + * STATIC VARIABLES + **********************/ +static my_theme_styles_t * styles; +static lv_theme_t theme; +static bool inited; + +/********************** + * MACROS + **********************/ + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void style_init(bool dark_bg, const lv_font_t * font) +{ + style_init_reset(&styles->scrollbar); + lv_style_set_bg_opa(&styles->scrollbar, LV_OPA_COVER); + lv_style_set_bg_color(&styles->scrollbar, COLOR_FG); + lv_style_set_width(&styles->scrollbar, PAD_DEF); + + style_init_reset(&styles->scr); + lv_style_set_bg_opa(&styles->scr, LV_OPA_COVER); + lv_style_set_bg_color(&styles->scr, COLOR_BG); + lv_style_set_text_color(&styles->scr, COLOR_FG); + lv_style_set_pad_row(&styles->scr, PAD_DEF); + lv_style_set_pad_column(&styles->scr, PAD_DEF); + lv_style_set_text_font(&styles->scr, font); + + style_init_reset(&styles->card); + lv_style_set_bg_opa(&styles->card, LV_OPA_COVER); + lv_style_set_bg_color(&styles->card, COLOR_BG); + lv_style_set_border_color(&styles->card, COLOR_FG); + lv_style_set_radius(&styles->card, 2); + lv_style_set_border_width(&styles->card, BORDER_W_NORMAL); + lv_style_set_pad_all(&styles->card, PAD_DEF); + lv_style_set_pad_gap(&styles->card, PAD_DEF); + lv_style_set_text_color(&styles->card, COLOR_FG); + lv_style_set_line_width(&styles->card, 2); + lv_style_set_line_color(&styles->card, COLOR_FG); + lv_style_set_arc_width(&styles->card, 2); + lv_style_set_arc_color(&styles->card, COLOR_FG); + lv_style_set_outline_color(&styles->card, COLOR_FG); + lv_style_set_anim_time(&styles->card, 300); + + style_init_reset(&styles->pr); + lv_style_set_border_width(&styles->pr, BORDER_W_PR); + + style_init_reset(&styles->inv); + lv_style_set_bg_opa(&styles->inv, LV_OPA_COVER); + lv_style_set_bg_color(&styles->inv, COLOR_FG); + lv_style_set_border_color(&styles->inv, COLOR_BG); + lv_style_set_line_color(&styles->inv, COLOR_BG); + lv_style_set_arc_color(&styles->inv, COLOR_BG); + lv_style_set_text_color(&styles->inv, COLOR_BG); + lv_style_set_outline_color(&styles->inv, COLOR_BG); + + style_init_reset(&styles->disabled); + lv_style_set_border_width(&styles->disabled, BORDER_W_DIS); + + style_init_reset(&styles->focus); + lv_style_set_outline_width(&styles->focus, 1); + lv_style_set_outline_pad(&styles->focus, BORDER_W_FOCUS); + + style_init_reset(&styles->edit); + lv_style_set_outline_width(&styles->edit, BORDER_W_EDIT); + + style_init_reset(&styles->large_border); + lv_style_set_border_width(&styles->large_border, BORDER_W_EDIT); + + style_init_reset(&styles->pad_gap); + lv_style_set_pad_gap(&styles->pad_gap, PAD_DEF); + + style_init_reset(&styles->pad_zero); + lv_style_set_pad_all(&styles->pad_zero, 0); + lv_style_set_pad_gap(&styles->pad_zero, 0); + + style_init_reset(&styles->no_radius); + lv_style_set_radius(&styles->no_radius, 0); + + style_init_reset(&styles->radius_circle); + lv_style_set_radius(&styles->radius_circle, LV_RADIUS_CIRCLE); + + style_init_reset(&styles->large_line_space); + lv_style_set_text_line_space(&styles->large_line_space, 6); + + style_init_reset(&styles->underline); + lv_style_set_text_decor(&styles->underline, LV_TEXT_DECOR_UNDERLINE); + +#if LV_USE_TEXTAREA + style_init_reset(&styles->ta_cursor); + lv_style_set_border_side(&styles->ta_cursor, LV_BORDER_SIDE_LEFT); + lv_style_set_border_color(&styles->ta_cursor, COLOR_FG); + lv_style_set_border_width(&styles->ta_cursor, 2); + lv_style_set_bg_opa(&styles->ta_cursor, LV_OPA_TRANSP); + lv_style_set_anim_time(&styles->ta_cursor, 500); +#endif +} + + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +bool lv_theme_mono_is_inited(void) +{ + return LV_GC_ROOT(_lv_theme_default_styles) == NULL ? false : true; +} + +lv_theme_t * lv_theme_mono_init(lv_disp_t * disp, bool dark_bg, const lv_font_t * font) +{ + + /*This trick is required only to avoid the garbage collection of + *styles' data if LVGL is used in a binding (e.g. Micropython) + *In a general case styles could be in simple `static lv_style_t my_style...` variables*/ + if(!inited) { + inited = false; + LV_GC_ROOT(_lv_theme_default_styles) = lv_mem_alloc(sizeof(my_theme_styles_t)); + styles = (my_theme_styles_t *)LV_GC_ROOT(_lv_theme_default_styles); + } + + theme.disp = disp; + theme.font_small = LV_FONT_DEFAULT; + theme.font_normal = LV_FONT_DEFAULT; + theme.font_large = LV_FONT_DEFAULT; + theme.apply_cb = theme_apply; + + style_init(dark_bg, font); + + if(disp == NULL || lv_disp_get_theme(disp) == &theme) lv_obj_report_style_change(NULL); + + inited = true; + + return (lv_theme_t *)&theme; +} + + +static void theme_apply(lv_theme_t * th, lv_obj_t * obj) +{ + LV_UNUSED(th); + + if(lv_obj_get_parent(obj) == NULL) { + lv_obj_add_style(obj, &styles->scr, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + return; + } + + if(lv_obj_check_type(obj, &lv_obj_class)) { +#if LV_USE_TABVIEW + lv_obj_t * parent = lv_obj_get_parent(obj); + /*Tabview content area*/ + if(lv_obj_check_type(parent, &lv_tabview_class)) { + return; + } + /*Tabview pages*/ + else if(lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->no_radius, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + return; + } +#endif + +#if LV_USE_WIN + /*Header*/ + if(lv_obj_get_index(obj) == 0 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->no_radius, 0); + return; + } + /*Content*/ + else if(lv_obj_get_index(obj) == 1 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->no_radius, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + return; + } +#endif + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + } +#if LV_USE_BTN + else if(lv_obj_check_type(obj, &lv_btn_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->pr, LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->inv, LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->disabled, LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + } +#endif + +#if LV_USE_BTNMATRIX + else if(lv_obj_check_type(obj, &lv_btnmatrix_class)) { +#if LV_USE_MSGBOX + if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_msgbox_class)) { + lv_obj_add_style(obj, &styles->pad_gap, 0); + lv_obj_add_style(obj, &styles->card, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->pr, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->underline, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->large_border, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + return; + } +#endif +#if LV_USE_TABVIEW + if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_tabview_class)) { + lv_obj_add_style(obj, &styles->pad_gap, 0); + lv_obj_add_style(obj, &styles->card, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->pr, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->inv, LV_PART_ITEMS | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->underline, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->large_border, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + return; + } +#endif + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->card, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->pr, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->inv, LV_PART_ITEMS | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->underline, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->large_border, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + } +#endif + +#if LV_USE_BAR + else if(lv_obj_check_type(obj, &lv_bar_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->pad_zero, 0); + lv_obj_add_style(obj, &styles->inv, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + } +#endif + +#if LV_USE_SLIDER + else if(lv_obj_check_type(obj, &lv_slider_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->pad_zero, 0); + lv_obj_add_style(obj, &styles->inv, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->card, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->radius_circle, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + } +#endif + +#if LV_USE_TABLE + else if(lv_obj_check_type(obj, &lv_table_class)) { + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->card, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->no_radius, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->pr, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->inv, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + } +#endif + +#if LV_USE_CHECKBOX + else if(lv_obj_check_type(obj, &lv_checkbox_class)) { + lv_obj_add_style(obj, &styles->pad_gap, LV_PART_MAIN); + lv_obj_add_style(obj, &styles->card, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->disabled, LV_PART_INDICATOR | LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->inv, LV_PART_INDICATOR | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->pr, LV_PART_INDICATOR | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + } +#endif + +#if LV_USE_SWITCH + else if(lv_obj_check_type(obj, &lv_switch_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->radius_circle, 0); + lv_obj_add_style(obj, &styles->pad_zero, 0); + lv_obj_add_style(obj, &styles->inv, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->radius_circle, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->card, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->radius_circle, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->pad_zero, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + } +#endif + +#if LV_USE_CHART + else if(lv_obj_check_type(obj, &lv_chart_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->card, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->card, LV_PART_TICKS); + lv_obj_add_style(obj, &styles->card, LV_PART_CURSOR); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + } +#endif + +#if LV_USE_ROLLER + else if(lv_obj_check_type(obj, &lv_roller_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->large_line_space, 0); + lv_obj_add_style(obj, &styles->inv, LV_PART_SELECTED); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + } +#endif + +#if LV_USE_DROPDOWN + else if(lv_obj_check_type(obj, &lv_dropdown_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->pr, LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + } + else if(lv_obj_check_type(obj, &lv_dropdownlist_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->large_line_space, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->inv, LV_PART_SELECTED | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->pr, LV_PART_SELECTED | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + } +#endif + +#if LV_USE_ARC + else if(lv_obj_check_type(obj, &lv_arc_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->inv, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->pad_zero, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->card, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->radius_circle, LV_PART_KNOB); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + } +#endif + +#if LV_USE_METER + else if(lv_obj_check_type(obj, &lv_meter_class)) { + lv_obj_add_style(obj, &styles->card, 0); + } +#endif + +#if LV_USE_TEXTAREA + else if(lv_obj_check_type(obj, &lv_textarea_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &styles->ta_cursor, LV_PART_CURSOR | LV_STATE_FOCUSED); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUSED); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + } +#endif + +#if LV_USE_CALENDAR + else if(lv_obj_check_type(obj, &lv_calendar_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->no_radius, 0); + lv_obj_add_style(obj, &styles->pr, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->large_border, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + } +#endif + +#if LV_USE_KEYBOARD + else if(lv_obj_check_type(obj, &lv_keyboard_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->card, LV_PART_ITEMS); + lv_obj_add_style(obj, &styles->pr, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->inv, LV_PART_ITEMS | LV_STATE_CHECKED); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + lv_obj_add_style(obj, &styles->large_border, LV_PART_ITEMS | LV_STATE_EDITED); + } +#endif +#if LV_USE_LIST + else if(lv_obj_check_type(obj, &lv_list_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + return; + } + else if(lv_obj_check_type(obj, &lv_list_text_class)) { + + } + else if(lv_obj_check_type(obj, &lv_list_btn_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->pr, LV_STATE_PRESSED); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->large_border, LV_STATE_EDITED); + + } +#endif +#if LV_USE_MSGBOX + else if(lv_obj_check_type(obj, &lv_msgbox_class)) { + lv_obj_add_style(obj, &styles->card, 0); + return; + } +#endif +#if LV_USE_SPINBOX + else if(lv_obj_check_type(obj, &lv_spinbox_class)) { + lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &styles->inv, LV_PART_CURSOR); + lv_obj_add_style(obj, &styles->focus, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &styles->edit, LV_STATE_EDITED); + } +#endif +#if LV_USE_TILEVIEW + else if(lv_obj_check_type(obj, &lv_tileview_class)) { + lv_obj_add_style(obj, &styles->scr, 0); + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + } + else if(lv_obj_check_type(obj, &lv_tileview_tile_class)) { + lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); + } +#endif + +#if LV_USE_LED + else if(lv_obj_check_type(obj, &lv_led_class)) { + lv_obj_add_style(obj, &styles->card, 0); + } +#endif +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void style_init_reset(lv_style_t * style) +{ + if(inited) { + lv_style_reset(style); + } + else { + lv_style_init(style); + } +} + +#endif diff --git a/L3_Middlewares/LVGL/src/themes/mono/lv_theme_mono.h b/L3_Middlewares/LVGL/src/extra/themes/mono/lv_theme_mono.h similarity index 69% rename from L3_Middlewares/LVGL/src/themes/mono/lv_theme_mono.h rename to L3_Middlewares/LVGL/src/extra/themes/mono/lv_theme_mono.h index 30ac4c4..10b8f18 100644 --- a/L3_Middlewares/LVGL/src/themes/mono/lv_theme_mono.h +++ b/L3_Middlewares/LVGL/src/extra/themes/mono/lv_theme_mono.h @@ -3,8 +3,8 @@ * */ -#ifndef LV_THEME_MONO_H -#define LV_THEME_MONO_H +#ifndef LV_USE_THEME_MONO_H +#define LV_USE_THEME_MONO_H #ifdef __cplusplus extern "C" { @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../lv_theme.h" +#include "../../../core/lv_obj.h" #if LV_USE_THEME_MONO @@ -31,12 +31,12 @@ extern "C" { /** * Initialize the theme - * @param disp pointer to display - * @param dark_bg + * @param color_primary the primary color of the theme + * @param color_secondary the secondary color for the theme * @param font pointer to a font to use. * @return a pointer to reference this theme later */ -lv_theme_t * lv_theme_mono_init(lv_display_t * disp, bool dark_bg, const lv_font_t * font); +lv_theme_t * lv_theme_mono_init(lv_disp_t * disp, bool dark_bg, const lv_font_t * font); /** * Check if the theme is initialized @@ -44,11 +44,6 @@ lv_theme_t * lv_theme_mono_init(lv_display_t * disp, bool dark_bg, const lv_font */ bool lv_theme_mono_is_inited(void); -/** - * Deinitialize the mono theme - */ -void lv_theme_mono_deinit(void); - /********************** * MACROS **********************/ @@ -59,4 +54,4 @@ void lv_theme_mono_deinit(void); } /*extern "C"*/ #endif -#endif /* LV_THEME_MONO_H */ +#endif /*LV_USE_THEME_MONO_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/animimage/lv_animimage.c b/L3_Middlewares/LVGL/src/extra/widgets/animimg/lv_animimg.c similarity index 56% rename from L3_Middlewares/LVGL/src/widgets/animimage/lv_animimage.c rename to L3_Middlewares/LVGL/src/extra/widgets/animimg/lv_animimg.c index 548c48c..072d02e 100644 --- a/L3_Middlewares/LVGL/src/widgets/animimage/lv_animimage.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/animimg/lv_animimg.c @@ -6,29 +6,28 @@ /********************* * INCLUDES *********************/ -#include "lv_animimage_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_animimg.h" #if LV_USE_ANIMIMG != 0 /*Testing of dependencies*/ -#if LV_USE_IMAGE == 0 - #error "lv_animimg: lv_img is required. Enable it in lv_conf.h (LV_USE_IMAGE 1) " +#if LV_USE_IMG == 0 + #error "lv_animimg: lv_img is required. Enable it in lv_conf.h (LV_USE_IMG 1) " #endif -#include "../../draw/lv_image_decoder.h" -#include "../../misc/lv_assert.h" -#include "../../misc/lv_fs.h" -#include "../../misc/lv_text.h" -#include "../../misc/lv_math.h" -#include "../../misc/lv_log.h" -#include "../../misc/lv_anim.h" +#include "../../../misc/lv_assert.h" +#include "../../../draw/lv_img_decoder.h" +#include "../../../misc/lv_fs.h" +#include "../../../misc/lv_txt.h" +#include "../../../misc/lv_math.h" +#include "../../../misc/lv_log.h" +#include "../../../misc/lv_anim.h" /********************* * DEFINES *********************/ #define LV_OBJX_NAME "lv_animimg" -#define MY_CLASS (&lv_animimg_class) +#define MY_CLASS &lv_animimg_class /********************** * TYPEDEFS @@ -37,18 +36,16 @@ /********************** * STATIC PROTOTYPES **********************/ -static void index_change(lv_obj_t * obj, int32_t idx); +static void index_change(lv_obj_t * obj, int32_t index); static void lv_animimg_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); /********************** * STATIC VARIABLES **********************/ - const lv_obj_class_t lv_animimg_class = { .constructor_cb = lv_animimg_constructor, .instance_size = sizeof(lv_animimg_t), - .base_class = &lv_image_class, - .name = "animimg", + .base_class = &lv_img_class }; /********************** @@ -67,13 +64,13 @@ lv_obj_t * lv_animimg_create(lv_obj_t * parent) return obj; } -void lv_animimg_set_src(lv_obj_t * obj, const void * dsc[], size_t num) +void lv_animimg_set_src(lv_obj_t * obj, const void * dsc[], uint8_t num) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_animimg_t * animimg = (lv_animimg_t *)obj; animimg->dsc = dsc; animimg->pic_count = num; - lv_anim_set_values(&animimg->anim, 0, (int32_t)num); + lv_anim_set_values(&animimg->anim, 0, num); } void lv_animimg_start(lv_obj_t * obj) @@ -91,11 +88,11 @@ void lv_animimg_set_duration(lv_obj_t * obj, uint32_t duration) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_animimg_t * animimg = (lv_animimg_t *)obj; - lv_anim_set_duration(&animimg->anim, duration); + lv_anim_set_time(&animimg->anim, duration); lv_anim_set_playback_delay(&animimg->anim, duration); } -void lv_animimg_set_repeat_count(lv_obj_t * obj, uint32_t count) +void lv_animimg_set_repeat_count(lv_obj_t * obj, uint16_t count) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_animimg_t * animimg = (lv_animimg_t *)obj; @@ -106,41 +103,6 @@ void lv_animimg_set_repeat_count(lv_obj_t * obj, uint32_t count) * Getter functions *====================*/ -const void ** lv_animimg_get_src(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_animimg_t * animimg = (lv_animimg_t *)obj; - return animimg->dsc; -} - -uint8_t lv_animimg_get_src_count(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_animimg_t * animimg = (lv_animimg_t *)obj; - return animimg->pic_count; -} - -uint32_t lv_animimg_get_duration(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_animimg_t * animimg = (lv_animimg_t *)obj; - return lv_anim_get_time(&animimg->anim); -} - -uint32_t lv_animimg_get_repeat_count(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_animimg_t * animimg = (lv_animimg_t *)obj; - return lv_anim_get_repeat_count(&animimg->anim); -} - -lv_anim_t * lv_animimg_get_anim(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_animimg_t * animimg = (lv_animimg_t *)obj; - return &animimg->anim; -} - /********************** * STATIC FUNCTIONS **********************/ @@ -154,28 +116,23 @@ static void lv_animimg_constructor(const lv_obj_class_t * class_p, lv_obj_t * ob animimg->dsc = NULL; animimg->pic_count = -1; - - /*initial animation*/ + //initial animation lv_anim_init(&animimg->anim); lv_anim_set_var(&animimg->anim, obj); - lv_anim_set_duration(&animimg->anim, 30); + lv_anim_set_time(&animimg->anim, 30); lv_anim_set_exec_cb(&animimg->anim, (lv_anim_exec_xcb_t)index_change); lv_anim_set_values(&animimg->anim, 0, 1); lv_anim_set_repeat_count(&animimg->anim, LV_ANIM_REPEAT_INFINITE); } -static void index_change(lv_obj_t * obj, int32_t idx) +static void index_change(lv_obj_t * obj, int32_t index) { + lv_coord_t idx; lv_animimg_t * animimg = (lv_animimg_t *)obj; - if(animimg->dsc == NULL) { - LV_LOG_WARN("dsc is null"); - return; - } - - if(idx >= animimg->pic_count) idx = animimg->pic_count - 1; + idx = index % animimg->pic_count; - lv_image_set_src(obj, animimg->dsc[idx]); + lv_img_set_src(obj, animimg->dsc[idx]); } #endif diff --git a/L3_Middlewares/LVGL/src/extra/widgets/animimg/lv_animimg.h b/L3_Middlewares/LVGL/src/extra/widgets/animimg/lv_animimg.h new file mode 100644 index 0000000..0ba01f2 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/animimg/lv_animimg.h @@ -0,0 +1,103 @@ +/** + * @file lv_animimg.h + * + */ + +#ifndef LV_ANIM_IMG_H +#define LV_ANIM_IMG_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" + +#if LV_USE_ANIMIMG != 0 + +/*Testing of dependencies*/ +#if LV_USE_IMG == 0 +#error "lv_animimg: lv_img is required. Enable it in lv_conf.h (LV_USE_IMG 1)" +#endif + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +extern const lv_obj_class_t lv_animimg_class; + +/*Data of image*/ +typedef struct { + lv_img_t img; + lv_anim_t anim; + /*picture sequence */ + const void ** dsc; + int8_t pic_count; +} lv_animimg_t; + + +/*Image parts*/ +enum { + LV_ANIM_IMG_PART_MAIN, +}; +typedef uint8_t lv_animimg_part_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create an animation image objects + * @param parent pointer to an object, it will be the parent of the new button + * @return pointer to the created animation image object + */ +lv_obj_t * lv_animimg_create(lv_obj_t * parent); + +/*===================== + * Setter functions + *====================*/ + +/** + * Set the image animation images source. + * @param img pointer to an animation image object + * @param dsc pointer to a series images + * @param num images' number + */ +void lv_animimg_set_src(lv_obj_t * img, const void * dsc[], uint8_t num); + +/** + * Startup the image animation. + * @param obj pointer to an animation image object + */ +void lv_animimg_start(lv_obj_t * obj); + +/** + * Set the image animation duration time. unit:ms + * @param img pointer to an animation image object + */ +void lv_animimg_set_duration(lv_obj_t * img, uint32_t duration); + +/** + * Set the image animation reapeatly play times. + * @param img pointer to an animation image object + * @param count the number of times to repeat the animation + */ +void lv_animimg_set_repeat_count(lv_obj_t * img, uint16_t count); + +/*===================== + * Getter functions + *====================*/ + +#endif /*LV_USE_ANIMIMG*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*LV_ANIM_IMG_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar.c b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar.c similarity index 54% rename from L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar.c rename to L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar.c index 560e24a..b806d25 100644 --- a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar.c @@ -6,21 +6,19 @@ /********************* * INCLUDES *********************/ -#include "lv_calendar_private.h" -#include "../../draw/lv_draw_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_calendar.h" #include "../../../lvgl.h" #if LV_USE_CALENDAR -#include "../../misc/lv_assert.h" +#include "../../../misc/lv_assert.h" /********************* * DEFINES *********************/ -#define LV_CALENDAR_CTRL_TODAY LV_BUTTONMATRIX_CTRL_CUSTOM_1 -#define LV_CALENDAR_CTRL_HIGHLIGHT LV_BUTTONMATRIX_CTRL_CUSTOM_2 +#define LV_CALENDAR_CTRL_TODAY LV_BTNMATRIX_CTRL_CUSTOM_1 +#define LV_CALENDAR_CTRL_HIGHLIGHT LV_BTNMATRIX_CTRL_CUSTOM_2 -#define MY_CLASS (&lv_calendar_class) +#define MY_CLASS &lv_calendar_class /********************** * TYPEDEFS @@ -30,32 +28,23 @@ * STATIC PROTOTYPES **********************/ static void lv_calendar_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void draw_task_added_event_cb(lv_event_t * e); +static void draw_part_begin_event_cb(lv_event_t * e); static uint8_t get_day_of_week(uint32_t year, uint32_t month, uint32_t day); static uint8_t get_month_length(int32_t year, int32_t month); static uint8_t is_leap_year(uint32_t year); static void highlight_update(lv_obj_t * calendar); -#if LV_USE_CALENDAR_CHINESE -static lv_calendar_date_t gregorian_get_last_month_time(lv_calendar_date_t * time); -static lv_calendar_date_t gregorian_get_next_month_time(lv_calendar_date_t * time); -static void chinese_calendar_set_day_name(lv_obj_t * calendar, uint8_t index, uint8_t day, - lv_calendar_date_t * gregorian_time); -#endif - /********************** * STATIC VARIABLES **********************/ - const lv_obj_class_t lv_calendar_class = { .constructor_cb = lv_calendar_constructor, .width_def = (LV_DPI_DEF * 3) / 2, .height_def = (LV_DPI_DEF * 3) / 2, .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, .instance_size = sizeof(lv_calendar_t), - .base_class = &lv_obj_class, - .name = "calendar", + .base_class = &lv_obj_class }; static const char * day_names_def[7] = LV_CALENDAR_DEFAULT_DAY_NAMES; @@ -104,7 +93,7 @@ void lv_calendar_set_today_date(lv_obj_t * obj, uint32_t year, uint32_t month, u highlight_update(obj); } -void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], size_t date_num) +void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], uint16_t date_num) { LV_ASSERT_NULL(highlighted); @@ -134,81 +123,45 @@ void lv_calendar_set_showed_date(lv_obj_t * obj, uint32_t year, uint32_t month) uint32_t i; /*Remove the disabled state but revert it for day names*/ - lv_buttonmatrix_clear_button_ctrl_all(calendar->btnm, LV_BUTTONMATRIX_CTRL_DISABLED); + lv_btnmatrix_clear_btn_ctrl_all(calendar->btnm, LV_BTNMATRIX_CTRL_DISABLED); for(i = 0; i < 7; i++) { - lv_buttonmatrix_set_button_ctrl(calendar->btnm, i, LV_BUTTONMATRIX_CTRL_DISABLED); + lv_btnmatrix_set_btn_ctrl(calendar->btnm, i, LV_BTNMATRIX_CTRL_DISABLED); } uint8_t act_mo_len = get_month_length(d.year, d.month); uint8_t day_first = get_day_of_week(d.year, d.month, 1); uint8_t c; - -#if LV_USE_CALENDAR_CHINESE - lv_calendar_date_t gregorian_time; - gregorian_time = d; -#endif - for(i = day_first, c = 1; i < act_mo_len + day_first; i++, c++) { -#if LV_USE_CALENDAR_CHINESE - if(calendar->use_chinese_calendar) { - gregorian_time.day = c; - chinese_calendar_set_day_name(obj, i, c, &gregorian_time); - } - else -#endif - lv_snprintf(calendar->nums[i], sizeof(calendar->nums[0]), "%d", c); + lv_snprintf(calendar->nums[i], sizeof(calendar->nums[0]), "%d", c); } uint8_t prev_mo_len = get_month_length(d.year, d.month - 1); - -#if LV_USE_CALENDAR_CHINESE - gregorian_time = gregorian_get_last_month_time(&d); -#endif - for(i = 0, c = prev_mo_len - day_first + 1; i < day_first; i++, c++) { -#if LV_USE_CALENDAR_CHINESE - if(calendar->use_chinese_calendar) { - gregorian_time.day = c; - chinese_calendar_set_day_name(obj, i, c, &gregorian_time); - } - else -#endif - lv_snprintf(calendar->nums[i], sizeof(calendar->nums[0]), "%d", c); - lv_buttonmatrix_set_button_ctrl(calendar->btnm, i + 7, LV_BUTTONMATRIX_CTRL_DISABLED); + lv_snprintf(calendar->nums[i], sizeof(calendar->nums[0]), "%d", c); + lv_btnmatrix_set_btn_ctrl(calendar->btnm, i + 7, LV_BTNMATRIX_CTRL_DISABLED); } -#if LV_USE_CALENDAR_CHINESE - gregorian_time = gregorian_get_next_month_time(&d); -#endif - for(i = day_first + act_mo_len, c = 1; i < 6 * 7; i++, c++) { -#if LV_USE_CALENDAR_CHINESE - if(calendar->use_chinese_calendar) { - gregorian_time.day = c; - chinese_calendar_set_day_name(obj, i, c, &gregorian_time); - } - else -#endif - lv_snprintf(calendar->nums[i], sizeof(calendar->nums[0]), "%d", c); - lv_buttonmatrix_set_button_ctrl(calendar->btnm, i + 7, LV_BUTTONMATRIX_CTRL_DISABLED); + lv_snprintf(calendar->nums[i], sizeof(calendar->nums[0]), "%d", c); + lv_btnmatrix_set_btn_ctrl(calendar->btnm, i + 7, LV_BTNMATRIX_CTRL_DISABLED); } highlight_update(obj); /*Reset the focused button if the days changes*/ - if(lv_buttonmatrix_get_selected_button(calendar->btnm) != LV_BUTTONMATRIX_BUTTON_NONE) { - lv_buttonmatrix_set_selected_button(calendar->btnm, day_first + 7); + if(lv_btnmatrix_get_selected_btn(calendar->btnm) != LV_BTNMATRIX_BTN_NONE) { + lv_btnmatrix_set_selected_btn(calendar->btnm, day_first + 7); } lv_obj_invalidate(obj); /* The children of the calendar are probably headers. * Notify them to let the headers updated to the new date*/ - uint32_t child_cnt = lv_obj_get_child_count(obj); + uint32_t child_cnt = lv_obj_get_child_cnt(obj); for(i = 0; i < child_cnt; i++) { lv_obj_t * child = lv_obj_get_child(obj, i); if(child == calendar->btnm) continue; - lv_obj_send_event(child, LV_EVENT_VALUE_CHANGED, obj); + lv_event_send(child, LV_EVENT_VALUE_CHANGED, obj); } } @@ -247,7 +200,7 @@ lv_calendar_date_t * lv_calendar_get_highlighted_dates(const lv_obj_t * obj) return calendar->highlighted_dates; } -size_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * obj) +uint16_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_calendar_t * calendar = (lv_calendar_t *)obj; @@ -255,20 +208,20 @@ size_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * obj) return calendar->highlighted_dates_num; } -lv_result_t lv_calendar_get_pressed_date(const lv_obj_t * obj, lv_calendar_date_t * date) +lv_res_t lv_calendar_get_pressed_date(const lv_obj_t * obj, lv_calendar_date_t * date) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_calendar_t * calendar = (lv_calendar_t *)obj; - uint32_t d = lv_buttonmatrix_get_selected_button(calendar->btnm); - if(d == LV_BUTTONMATRIX_BUTTON_NONE) { + uint16_t d = lv_btnmatrix_get_selected_btn(calendar->btnm); + if(d == LV_BTNMATRIX_BTN_NONE) { date->year = 0; date->month = 0; date->day = 0; - return LV_RESULT_INVALID; + return LV_RES_INV; } - const char * txt = lv_buttonmatrix_get_button_text(calendar->btnm, lv_buttonmatrix_get_selected_button(calendar->btnm)); + const char * txt = lv_btnmatrix_get_btn_text(calendar->btnm, lv_btnmatrix_get_selected_btn(calendar->btnm)); if(txt[1] == 0) date->day = txt[0] - '0'; else date->day = (txt[0] - '0') * 10 + (txt[1] - '0'); @@ -276,9 +229,10 @@ lv_result_t lv_calendar_get_pressed_date(const lv_obj_t * obj, lv_calendar_date_ date->year = calendar->showed_date.year; date->month = calendar->showed_date.month; - return LV_RESULT_OK; + return LV_RES_OK; } + /********************** * STATIC FUNCTIONS **********************/ @@ -289,19 +243,18 @@ static void lv_calendar_constructor(const lv_obj_class_t * class_p, lv_obj_t * o lv_calendar_t * calendar = (lv_calendar_t *)obj; /*Initialize the allocated 'ext'*/ - - calendar->today.year = 2024; + calendar->today.year = 2020; calendar->today.month = 1; calendar->today.day = 1; - calendar->showed_date.year = 2024; + calendar->showed_date.year = 2020; calendar->showed_date.month = 1; calendar->showed_date.day = 1; calendar->highlighted_dates = NULL; calendar->highlighted_dates_num = 0; - lv_memzero(calendar->nums, sizeof(calendar->nums)); + lv_memset_00(calendar->nums, sizeof(calendar->nums)); uint8_t i; uint8_t j = 0; for(i = 0; i < 8 * 7; i++) { @@ -320,60 +273,51 @@ static void lv_calendar_constructor(const lv_obj_class_t * class_p, lv_obj_t * o } calendar->map[8 * 7 - 1] = ""; - calendar->btnm = lv_buttonmatrix_create(obj); - lv_buttonmatrix_set_map(calendar->btnm, calendar->map); - lv_buttonmatrix_set_button_ctrl_all(calendar->btnm, LV_BUTTONMATRIX_CTRL_CLICK_TRIG | LV_BUTTONMATRIX_CTRL_NO_REPEAT); - lv_obj_add_event_cb(calendar->btnm, draw_task_added_event_cb, LV_EVENT_DRAW_TASK_ADDED, NULL); + calendar->btnm = lv_btnmatrix_create(obj); + lv_btnmatrix_set_map(calendar->btnm, calendar->map); + lv_btnmatrix_set_btn_ctrl_all(calendar->btnm, LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_NO_REPEAT); + lv_obj_add_event_cb(calendar->btnm, draw_part_begin_event_cb, LV_EVENT_DRAW_PART_BEGIN, NULL); lv_obj_set_width(calendar->btnm, lv_pct(100)); - lv_obj_add_flag(calendar->btnm, LV_OBJ_FLAG_EVENT_BUBBLE | LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); lv_obj_set_flex_grow(calendar->btnm, 1); - lv_obj_set_style_text_align(obj, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN); - lv_calendar_set_showed_date(obj, calendar->showed_date.year, calendar->showed_date.month); lv_calendar_set_today_date(obj, calendar->today.year, calendar->today.month, calendar->today.day); + + lv_obj_add_flag(calendar->btnm, LV_OBJ_FLAG_EVENT_BUBBLE); } -static void draw_task_added_event_cb(lv_event_t * e) +static void draw_part_begin_event_cb(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); - lv_draw_task_t * draw_task = lv_event_get_param(e); - if(((lv_draw_dsc_base_t *)draw_task->draw_dsc)->part != LV_PART_ITEMS) return; - - lv_draw_fill_dsc_t * fill_draw_dsc = lv_draw_task_get_fill_dsc(draw_task); - lv_draw_border_dsc_t * border_draw_dsc = lv_draw_task_get_border_dsc(draw_task); - - if(!fill_draw_dsc && !border_draw_dsc) { - return; - } - - int32_t id = ((lv_draw_dsc_base_t *)draw_task->draw_dsc)->id1; + lv_obj_t * obj = lv_event_get_target(e); + lv_obj_draw_part_dsc_t * dsc = lv_event_get_param(e); + if(dsc->part == LV_PART_ITEMS) { + /*Day name styles*/ + if(dsc->id < 7) { + dsc->rect_dsc->bg_opa = LV_OPA_TRANSP; + dsc->rect_dsc->border_opa = LV_OPA_TRANSP; + } + else if(lv_btnmatrix_has_btn_ctrl(obj, dsc->id, LV_BTNMATRIX_CTRL_DISABLED)) { + dsc->rect_dsc->bg_opa = LV_OPA_TRANSP; + dsc->rect_dsc->border_opa = LV_OPA_TRANSP; + dsc->label_dsc->color = lv_palette_main(LV_PALETTE_GREY); + } - /*Day name styles*/ - if(id < 7) { - if(fill_draw_dsc) fill_draw_dsc->opa = LV_OPA_TRANSP; - if(border_draw_dsc) border_draw_dsc->opa = LV_OPA_TRANSP; - } - else if(lv_buttonmatrix_has_button_ctrl(obj, id, LV_BUTTONMATRIX_CTRL_DISABLED)) { - if(fill_draw_dsc) fill_draw_dsc->opa = LV_OPA_TRANSP; - if(border_draw_dsc) border_draw_dsc->opa = LV_OPA_TRANSP; - } + if(lv_btnmatrix_has_btn_ctrl(obj, dsc->id, LV_CALENDAR_CTRL_HIGHLIGHT)) { + dsc->rect_dsc->bg_opa = LV_OPA_40; + dsc->rect_dsc->bg_color = lv_theme_get_color_primary(obj); + if(lv_btnmatrix_get_selected_btn(obj) == dsc->id) { + dsc->rect_dsc->bg_opa = LV_OPA_70; + } + } - if(lv_buttonmatrix_has_button_ctrl(obj, id, LV_CALENDAR_CTRL_HIGHLIGHT)) { - if(border_draw_dsc) border_draw_dsc->color = lv_theme_get_color_primary(obj); - if(fill_draw_dsc) fill_draw_dsc->opa = LV_OPA_40; - if(fill_draw_dsc) fill_draw_dsc->color = lv_theme_get_color_primary(obj); - if(lv_buttonmatrix_get_selected_button(obj) == (uint32_t)id) { - if(fill_draw_dsc) fill_draw_dsc->opa = LV_OPA_70; + if(lv_btnmatrix_has_btn_ctrl(obj, dsc->id, LV_CALENDAR_CTRL_TODAY)) { + dsc->rect_dsc->border_opa = LV_OPA_COVER; + dsc->rect_dsc->border_color = lv_theme_get_color_primary(obj); + dsc->rect_dsc->border_width += 1; } - } - if(lv_buttonmatrix_has_button_ctrl(obj, id, LV_CALENDAR_CTRL_TODAY)) { - if(border_draw_dsc) border_draw_dsc->opa = LV_OPA_COVER; - if(border_draw_dsc) border_draw_dsc->color = lv_theme_get_color_primary(obj); - if(border_draw_dsc) border_draw_dsc->width += 1; } } @@ -388,7 +332,7 @@ static uint8_t get_month_length(int32_t year, int32_t month) { month--; if(month < 0) { - year--; /*Already in the previous year (won't be less than -12 to skip a whole year)*/ + year--; /*Already in the previous year (won't be less then -12 to skip a whole year)*/ month = 12 + month; /*`month` is negative, the result will be < 12*/ } if(month >= 12) { @@ -434,70 +378,25 @@ static uint8_t get_day_of_week(uint32_t year, uint32_t month, uint32_t day) static void highlight_update(lv_obj_t * obj) { lv_calendar_t * calendar = (lv_calendar_t *)obj; - uint32_t i; + uint16_t i; /*Clear all kind of selection*/ - lv_buttonmatrix_clear_button_ctrl_all(calendar->btnm, LV_CALENDAR_CTRL_TODAY | LV_CALENDAR_CTRL_HIGHLIGHT); + lv_btnmatrix_clear_btn_ctrl_all(calendar->btnm, LV_CALENDAR_CTRL_TODAY | LV_CALENDAR_CTRL_HIGHLIGHT); uint8_t day_first = get_day_of_week(calendar->showed_date.year, calendar->showed_date.month, 1); if(calendar->highlighted_dates) { for(i = 0; i < calendar->highlighted_dates_num; i++) { if(calendar->highlighted_dates[i].year == calendar->showed_date.year && calendar->highlighted_dates[i].month == calendar->showed_date.month) { - lv_buttonmatrix_set_button_ctrl(calendar->btnm, calendar->highlighted_dates[i].day - 1 + day_first + 7, - LV_CALENDAR_CTRL_HIGHLIGHT); + lv_btnmatrix_set_btn_ctrl(calendar->btnm, calendar->highlighted_dates[i].day - 1 + day_first + 7, + LV_CALENDAR_CTRL_HIGHLIGHT); } } } if(calendar->showed_date.year == calendar->today.year && calendar->showed_date.month == calendar->today.month) { - lv_buttonmatrix_set_button_ctrl(calendar->btnm, calendar->today.day - 1 + day_first + 7, LV_CALENDAR_CTRL_TODAY); - } -} - -#if LV_USE_CALENDAR_CHINESE - -static lv_calendar_date_t gregorian_get_last_month_time(lv_calendar_date_t * time) -{ - lv_calendar_date_t last_month_time; - if(time->month == 1) { - last_month_time.month = 12; - last_month_time.year = time->year - 1; - } - else { - last_month_time.month = time->month - 1; - last_month_time.year = time->year; - } - return last_month_time; -} - -static lv_calendar_date_t gregorian_get_next_month_time(lv_calendar_date_t * time) -{ - lv_calendar_date_t next_month_time; - if(time->month == 12) { - next_month_time.month = 1; - next_month_time.year = time->year + 1; + lv_btnmatrix_set_btn_ctrl(calendar->btnm, calendar->today.day - 1 + day_first + 7, LV_CALENDAR_CTRL_TODAY); } - else { - next_month_time.month = time->month + 1; - next_month_time.year = time->year; - } - return next_month_time; -} - -static void chinese_calendar_set_day_name(lv_obj_t * obj, uint8_t index, uint8_t day, - lv_calendar_date_t * gregorian_time) -{ - lv_calendar_t * calendar = (lv_calendar_t *)obj; - const char * day_name = lv_calendar_get_day_name(gregorian_time); - if(day_name != NULL) - lv_snprintf(calendar->nums[index], sizeof(calendar->nums[0]), - "%d\n%s", - day, - day_name); - else - lv_snprintf(calendar->nums[index], sizeof(calendar->nums[0]), "%d", day); } -#endif #endif /*LV_USE_CALENDAR*/ diff --git a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar.h b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar.h similarity index 64% rename from L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar.h rename to L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar.h index 38c5d64..2511b2f 100644 --- a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar.h +++ b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../buttonmatrix/lv_buttonmatrix.h" +#include "../../../widgets/lv_btnmatrix.h" #if LV_USE_CALENDAR @@ -30,21 +30,30 @@ extern "C" { */ typedef struct { uint16_t year; - int8_t month; /**< 1..12 */ - int8_t day; /**< 1..31 */ + int8_t month; /** 1..12*/ + int8_t day; /** 1..31*/ } lv_calendar_date_t; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_calendar_class; +/*Data of calendar*/ +typedef struct { + lv_obj_t obj; + lv_obj_t * btnm; + /*New data for this type*/ + lv_calendar_date_t today; /*Date of today*/ + lv_calendar_date_t showed_date; /*Currently visible month (day is ignored)*/ + lv_calendar_date_t * + highlighted_dates; /*Apply different style on these days (pointer to an array defined by the user)*/ + uint16_t highlighted_dates_num; /*Number of elements in `highlighted_days`*/ + const char * map[8 * 7]; + char nums [7 * 6][4]; +} lv_calendar_t; + +extern const lv_obj_class_t lv_calendar_class; /********************** * GLOBAL PROTOTYPES **********************/ -/** - * Create a calendar widget - * @param parent pointer to an object, it will be the parent of the new calendar - * @return pointer the created calendar - */ lv_obj_t * lv_calendar_create(lv_obj_t * parent); /*====================== @@ -79,7 +88,7 @@ void lv_calendar_set_showed_date(lv_obj_t * obj, uint32_t year, uint32_t month); * Only the pointer will be saved so this variable can't be local which will be destroyed later. * @param date_num number of dates in the array */ -void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], size_t date_num); +void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], uint16_t date_num); /** * Set the name of the days @@ -97,47 +106,46 @@ void lv_calendar_set_day_names(lv_obj_t * obj, const char ** day_names); /** * Get the button matrix object of the calendar. * It shows the dates and day names. - * @param obj pointer to a calendar object - * @return pointer to a the button matrix + * @param obj pointer to a calendar object + * @return pointer to a the button matrix */ lv_obj_t * lv_calendar_get_btnmatrix(const lv_obj_t * obj); /** * Get the today's date - * @param calendar pointer to a calendar object - * @return return pointer to an `lv_calendar_date_t` variable containing the date of today. + * @param calendar pointer to a calendar object + * @return return pointer to an `lv_calendar_date_t` variable containing the date of today. */ const lv_calendar_date_t * lv_calendar_get_today_date(const lv_obj_t * calendar); /** * Get the currently showed - * @param calendar pointer to a calendar object - * @return pointer to an `lv_calendar_date_t` variable containing the date is being shown. + * @param calendar pointer to a calendar object + * @return pointer to an `lv_calendar_date_t` variable containing the date is being shown. */ const lv_calendar_date_t * lv_calendar_get_showed_date(const lv_obj_t * calendar); /** * Get the highlighted dates - * @param calendar pointer to a calendar object - * @return pointer to an `lv_calendar_date_t` array containing the dates. + * @param calendar pointer to a calendar object + * @return pointer to an `lv_calendar_date_t` array containing the dates. */ lv_calendar_date_t * lv_calendar_get_highlighted_dates(const lv_obj_t * calendar); /** * Get the number of the highlighted dates - * @param calendar pointer to a calendar object - * @return number of highlighted days + * @param calendar pointer to a calendar object + * @return number of highlighted days */ -size_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * calendar); +uint16_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * calendar); /** * Get the currently pressed day - * @param calendar pointer to a calendar object - * @param date store the pressed date here - * @return LV_RESULT_OK: there is a valid pressed date - * LV_RESULT_INVALID: there is no pressed data + * @param calendar pointer to a calendar object + * @param date store the pressed date here + * @return LV_RES_OK: there is a valid pressed date; LV_RES_INV: there is no pressed data */ -lv_result_t lv_calendar_get_pressed_date(const lv_obj_t * calendar, lv_calendar_date_t * date); +lv_res_t lv_calendar_get_pressed_date(const lv_obj_t * calendar, lv_calendar_date_t * date); /*===================== * Other functions @@ -147,10 +155,6 @@ lv_result_t lv_calendar_get_pressed_date(const lv_obj_t * calendar, lv_calendar_ * MACROS **********************/ -#include "lv_calendar_header_arrow.h" -#include "lv_calendar_header_dropdown.h" -#include "lv_calendar_chinese.h" - #endif /*LV_USE_CALENDAR*/ #ifdef __cplusplus diff --git a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_arrow.c b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_arrow.c similarity index 71% rename from L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_arrow.c rename to L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_arrow.c index 09b201d..fecb139 100644 --- a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_arrow.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_arrow.c @@ -6,15 +6,13 @@ /********************* * INCLUDES *********************/ -#include "../../core/lv_obj_class_private.h" #include "lv_calendar_header_arrow.h" -#if LV_USE_CALENDAR && LV_USE_CALENDAR_HEADER_ARROW +#if LV_USE_CALENDAR_HEADER_ARROW #include "lv_calendar.h" -#include "../button/lv_button.h" -#include "../label/lv_label.h" +#include "../../../widgets/lv_btn.h" +#include "../../../widgets/lv_label.h" #include "../../layouts/flex/lv_flex.h" -#include "../../misc/lv_assert.h" /********************* * DEFINES @@ -34,13 +32,11 @@ static void value_changed_event_cb(lv_event_t * e); /********************** * STATIC VARIABLES **********************/ - const lv_obj_class_t lv_calendar_header_arrow_class = { .base_class = &lv_obj_class, .constructor_cb = my_constructor, .width_def = LV_PCT(100), - .height_def = LV_DPI_DEF / 3, - .name = "calendar-header-arrow", + .height_def = LV_DPI_DEF / 3 }; static const char * month_names_def[12] = LV_CALENDAR_DEFAULT_MONTH_NAMES; @@ -75,36 +71,36 @@ static void my_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW); lv_obj_set_flex_align(obj, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START); - lv_obj_t * mo_prev = lv_button_create(obj); - lv_obj_set_style_bg_image_src(mo_prev, LV_SYMBOL_LEFT, 0); + lv_obj_t * mo_prev = lv_btn_create(obj); + lv_obj_set_style_bg_img_src(mo_prev, LV_SYMBOL_LEFT, 0); lv_obj_set_height(mo_prev, lv_pct(100)); lv_obj_update_layout(mo_prev); - int32_t btn_size = lv_obj_get_height(mo_prev); + lv_coord_t btn_size = lv_obj_get_height(mo_prev); lv_obj_set_width(mo_prev, btn_size); lv_obj_add_event_cb(mo_prev, month_event_cb, LV_EVENT_CLICKED, NULL); - lv_obj_remove_flag(mo_prev, LV_OBJ_FLAG_CLICK_FOCUSABLE); + lv_obj_clear_flag(mo_prev, LV_OBJ_FLAG_CLICK_FOCUSABLE); lv_obj_t * label = lv_label_create(obj); lv_label_set_long_mode(label, LV_LABEL_LONG_SCROLL_CIRCULAR); lv_obj_set_style_text_align(label, LV_TEXT_ALIGN_CENTER, 0); lv_obj_set_flex_grow(label, 1); - lv_obj_t * mo_next = lv_button_create(obj); - lv_obj_set_style_bg_image_src(mo_next, LV_SYMBOL_RIGHT, 0); + lv_obj_t * mo_next = lv_btn_create(obj); + lv_obj_set_style_bg_img_src(mo_next, LV_SYMBOL_RIGHT, 0); lv_obj_set_size(mo_next, btn_size, btn_size); lv_obj_add_event_cb(mo_next, month_event_cb, LV_EVENT_CLICKED, NULL); - lv_obj_remove_flag(mo_next, LV_OBJ_FLAG_CLICK_FOCUSABLE); + lv_obj_clear_flag(mo_next, LV_OBJ_FLAG_CLICK_FOCUSABLE); lv_obj_add_event_cb(obj, value_changed_event_cb, LV_EVENT_VALUE_CHANGED, NULL); /*Refresh the drop downs*/ - lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); + lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); } static void month_event_cb(lv_event_t * e) { - lv_obj_t * btn = lv_event_get_current_target(e); + lv_obj_t * btn = lv_event_get_target(e); lv_obj_t * header = lv_obj_get_parent(btn); lv_obj_t * calendar = lv_obj_get_parent(header); @@ -113,9 +109,6 @@ static void month_event_cb(lv_event_t * e) d = lv_calendar_get_showed_date(calendar); lv_calendar_date_t newd = *d; - LV_ASSERT_FORMAT_MSG(newd.year >= 0 && newd.month >= 1 && newd.month <= 12, - "Invalid date: %d-%d", newd.year, newd.month); - /*The last child is the right button*/ if(lv_obj_get_child(header, 0) == btn) { if(newd.month == 1) { @@ -144,15 +137,13 @@ static void month_event_cb(lv_event_t * e) static void value_changed_event_cb(lv_event_t * e) { - lv_obj_t * header = lv_event_get_current_target(e); + lv_obj_t * header = lv_event_get_target(e); lv_obj_t * calendar = lv_obj_get_parent(header); - const lv_calendar_date_t * date = lv_calendar_get_showed_date(calendar); - LV_ASSERT_FORMAT_MSG(date->year >= 0 && date->month >= 1 && date->month <= 12, - "Invalid date: %d-%d", date->year, date->month); - + const lv_calendar_date_t * cur_date = lv_calendar_get_showed_date(calendar); lv_obj_t * label = lv_obj_get_child(header, 1); - lv_label_set_text_fmt(label, "%d %s", date->year, month_names_def[date->month - 1]); + lv_label_set_text_fmt(label, "%d %s", cur_date->year, month_names_def[cur_date->month - 1]); } #endif /*LV_USE_CALENDAR_HEADER_ARROW*/ + diff --git a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_arrow.h b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_arrow.h similarity index 83% rename from L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_arrow.h rename to L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_arrow.h index a04b355..609ccb0 100644 --- a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_arrow.h +++ b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_arrow.h @@ -13,8 +13,8 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../core/lv_obj.h" -#if LV_USE_CALENDAR && LV_USE_CALENDAR_HEADER_ARROW +#include "../../../core/lv_obj.h" +#if LV_USE_CALENDAR_HEADER_ARROW /********************* * DEFINES @@ -23,7 +23,7 @@ extern "C" { /********************** * TYPEDEFS **********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_calendar_header_arrow_class; +extern const lv_obj_class_t lv_calendar_header_arrow_class; /********************** * GLOBAL PROTOTYPES diff --git a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_dropdown.c b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_dropdown.c similarity index 64% rename from L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_dropdown.c rename to L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_dropdown.c index 41fe53a..5e8f90d 100644 --- a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_dropdown.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_dropdown.c @@ -6,12 +6,11 @@ /********************* * INCLUDES *********************/ -#include "../../core/lv_obj_class_private.h" #include "lv_calendar_header_dropdown.h" -#if LV_USE_CALENDAR && LV_USE_CALENDAR_HEADER_DROPDOWN +#if LV_USE_CALENDAR_HEADER_DROPDOWN #include "lv_calendar.h" -#include "../dropdown/lv_dropdown.h" +#include "../../../widgets/lv_dropdown.h" #include "../../layouts/flex/lv_flex.h" /********************* @@ -33,18 +32,16 @@ static void value_changed_event_cb(lv_event_t * e); /********************** * STATIC VARIABLES **********************/ - const lv_obj_class_t lv_calendar_header_dropdown_class = { .base_class = &lv_obj_class, .width_def = LV_PCT(100), .height_def = LV_SIZE_CONTENT, - .constructor_cb = my_constructor, - .name = "calendar-header-dropdown", + .constructor_cb = my_constructor }; static const char * month_list = "01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12"; static const char * year_list = { - "2025\n2024\n2023\n2022\n2021\n" + "2023\n2022\n2021\n" "2020\n2019\n2018\n2017\n2016\n2015\n2014\n2013\n2012\n2011\n2010\n2009\n2008\n2007\n2006\n2005\n2004\n2003\n2002\n2001\n" "2000\n1999\n1998\n1997\n1996\n1995\n1994\n1993\n1992\n1991\n1990\n1989\n1988\n1987\n1986\n1985\n1984\n1983\n1982\n1981\n" "1980\n1979\n1978\n1977\n1976\n1975\n1974\n1973\n1972\n1971\n1970\n1969\n1968\n1967\n1966\n1965\n1964\n1963\n1962\n1961\n" @@ -69,31 +66,6 @@ lv_obj_t * lv_calendar_header_dropdown_create(lv_obj_t * parent) return obj; } -void lv_calendar_header_dropdown_set_year_list(lv_obj_t * parent, const char * years_list) -{ - /* Search for the header dropdown */ - lv_obj_t * header = lv_obj_get_child_by_type(parent, 0, &lv_calendar_header_dropdown_class); - if(NULL == header) { - /* Header not found */ - return; - } - - /* Search for the year dropdown - * Index is 0 because in the header dropdown constructor the year dropdown (year_dd) - * is the first created child of the header */ - const int32_t year_dropdown_index = 0; - lv_obj_t * year_dropdown = lv_obj_get_child_by_type(header, year_dropdown_index, &lv_dropdown_class); - if(NULL == year_dropdown) { - /* year dropdown not found */ - return; - } - - lv_dropdown_clear_options(year_dropdown); - lv_dropdown_set_options(year_dropdown, years_list); - - lv_obj_invalidate(parent); -} - /********************** * STATIC FUNCTIONS **********************/ @@ -120,15 +92,15 @@ static void my_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_add_event_cb(obj, value_changed_event_cb, LV_EVENT_VALUE_CHANGED, NULL); /*Refresh the drop downs*/ - lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); + lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); } static void month_event_cb(lv_event_t * e) { - lv_obj_t * dropdown = lv_event_get_current_target(e); + lv_obj_t * dropdown = lv_event_get_target(e); lv_obj_t * calendar = lv_event_get_user_data(e); - uint32_t sel = lv_dropdown_get_selected(dropdown); + uint16_t sel = lv_dropdown_get_selected(dropdown); const lv_calendar_date_t * d; d = lv_calendar_get_showed_date(calendar); @@ -140,44 +112,31 @@ static void month_event_cb(lv_event_t * e) static void year_event_cb(lv_event_t * e) { - lv_obj_t * dropdown = lv_event_get_current_target(e); + lv_obj_t * dropdown = lv_event_get_target(e); lv_obj_t * calendar = lv_event_get_user_data(e); - uint32_t sel = lv_dropdown_get_selected(dropdown); + uint16_t sel = lv_dropdown_get_selected(dropdown); const lv_calendar_date_t * d; d = lv_calendar_get_showed_date(calendar); - - /* Get the first year on the options list - * NOTE: Assumes the first 4 digits in the option list are numbers */ - const char * year_p = lv_dropdown_get_options(dropdown); - const uint32_t year = (year_p[0] - '0') * 1000 + (year_p[1] - '0') * 100 + (year_p[2] - '0') * 10 + - (year_p[3] - '0'); - lv_calendar_date_t newd = *d; - newd.year = year - sel; + newd.year = 2023 - sel; lv_calendar_set_showed_date(calendar, newd.year, newd.month); } static void value_changed_event_cb(lv_event_t * e) { - lv_obj_t * header = lv_event_get_current_target(e); + lv_obj_t * header = lv_event_get_target(e); lv_obj_t * calendar = lv_obj_get_parent(header); const lv_calendar_date_t * cur_date = lv_calendar_get_showed_date(calendar); lv_obj_t * year_dd = lv_obj_get_child(header, 0); - - /* Get the first year on the options list - * NOTE: Assumes the first 4 digits in the option list are numbers */ - const char * year_p = lv_dropdown_get_options(year_dd); - const uint32_t year = (year_p[0] - '0') * 1000 + (year_p[1] - '0') * 100 + (year_p[2] - '0') * 10 + - (year_p[3] - '0'); - - lv_dropdown_set_selected(year_dd, year - cur_date->year); + lv_dropdown_set_selected(year_dd, 2023 - cur_date->year); lv_obj_t * month_dd = lv_obj_get_child(header, 1); lv_dropdown_set_selected(month_dd, cur_date->month - 1); } #endif /*LV_USE_CALENDAR_HEADER_ARROW*/ + diff --git a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_dropdown.h b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_dropdown.h similarity index 52% rename from L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_dropdown.h rename to L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_dropdown.h index 1ca8776..fca2197 100644 --- a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_header_dropdown.h +++ b/L3_Middlewares/LVGL/src/extra/widgets/calendar/lv_calendar_header_dropdown.h @@ -13,12 +13,8 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../core/lv_obj.h" -#if LV_USE_CALENDAR && LV_USE_CALENDAR_HEADER_DROPDOWN - -#if LV_USE_DROPDOWN == 0 -#error "LV_USE_DROPDOWN needs to be enabled" -#endif +#include "../../../core/lv_obj.h" +#if LV_USE_CALENDAR_HEADER_DROPDOWN /********************* * DEFINES @@ -27,7 +23,7 @@ extern "C" { /********************** * TYPEDEFS **********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_calendar_header_dropdown_class; +extern const lv_obj_class_t lv_calendar_header_dropdown_class; /********************** * GLOBAL PROTOTYPES @@ -40,15 +36,6 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_calendar_header_dropdown */ lv_obj_t * lv_calendar_header_dropdown_create(lv_obj_t * parent); -/** - * Sets a custom calendar year list - * @param parent pointer to a calendar object - * @param years_list pointer to an const char array with the years list, see lv_dropdown set_options for more information. - * E.g. `const char * years = "2023\n2022\n2021\n2020\n2019" - * Only the pointer will be saved so this variable can't be local which will be destroyed later. - */ -void lv_calendar_header_dropdown_set_year_list(lv_obj_t * parent, const char * years_list); - /********************** * MACROS **********************/ diff --git a/L3_Middlewares/LVGL/src/extra/widgets/chart/lv_chart.c b/L3_Middlewares/LVGL/src/extra/widgets/chart/lv_chart.c new file mode 100644 index 0000000..eae31bd --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/chart/lv_chart.c @@ -0,0 +1,1810 @@ +/** + * @file lv_chart.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_chart.h" +#if LV_USE_CHART != 0 + +#include "../../../misc/lv_assert.h" + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_chart_class + +#define LV_CHART_HDIV_DEF 3 +#define LV_CHART_VDIV_DEF 5 +#define LV_CHART_POINT_CNT_DEF 10 +#define LV_CHART_LABEL_MAX_TEXT_LENGTH 16 + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_chart_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_chart_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_chart_event(const lv_obj_class_t * class_p, lv_event_t * e); + +static void draw_div_lines(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx); +static void draw_series_line(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx); +static void draw_series_bar(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx); +static void draw_series_scatter(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx); +static void draw_cursors(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx); +static void draw_axes(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx); +static uint32_t get_index_from_x(lv_obj_t * obj, lv_coord_t x); +static void invalidate_point(lv_obj_t * obj, uint16_t i); +static void new_points_alloc(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t cnt, lv_coord_t ** a); +lv_chart_tick_dsc_t * get_tick_gsc(lv_obj_t * obj, lv_chart_axis_t axis); + +/********************** + * STATIC VARIABLES + **********************/ +const lv_obj_class_t lv_chart_class = { + .constructor_cb = lv_chart_constructor, + .destructor_cb = lv_chart_destructor, + .event_cb = lv_chart_event, + .width_def = LV_PCT(100), + .height_def = LV_DPI_DEF * 2, + .instance_size = sizeof(lv_chart_t), + .base_class = &lv_obj_class +}; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_obj_t * lv_chart_create(lv_obj_t * parent) +{ + LV_LOG_INFO("begin"); + lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); + lv_obj_class_init_obj(obj); + return obj; +} + +void lv_chart_set_type(lv_obj_t * obj, lv_chart_type_t type) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(chart->type == type) return; + + if(chart->type == LV_CHART_TYPE_SCATTER) { + lv_chart_series_t * ser; + _LV_LL_READ_BACK(&chart->series_ll, ser) { + lv_mem_free(ser->x_points); + ser->x_points = NULL; + } + } + + if(type == LV_CHART_TYPE_SCATTER) { + lv_chart_series_t * ser; + _LV_LL_READ_BACK(&chart->series_ll, ser) { + ser->x_points = lv_mem_alloc(sizeof(lv_point_t) * chart->point_cnt); + LV_ASSERT_MALLOC(ser->x_points); + if(ser->x_points == NULL) return; + } + } + + chart->type = type; + + lv_chart_refresh(obj); +} + +void lv_chart_set_point_count(lv_obj_t * obj, uint16_t cnt) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(chart->point_cnt == cnt) return; + + lv_chart_series_t * ser; + + if(cnt < 1) cnt = 1; + + _LV_LL_READ_BACK(&chart->series_ll, ser) { + if(chart->type == LV_CHART_TYPE_SCATTER) { + if(!ser->x_ext_buf_assigned) new_points_alloc(obj, ser, cnt, &ser->x_points); + } + if(!ser->y_ext_buf_assigned) new_points_alloc(obj, ser, cnt, &ser->y_points); + ser->start_point = 0; + } + + chart->point_cnt = cnt; + + lv_chart_refresh(obj); +} + +void lv_chart_set_range(lv_obj_t * obj, lv_chart_axis_t axis, lv_coord_t min, lv_coord_t max) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + max = max == min ? max + 1 : max; + + lv_chart_t * chart = (lv_chart_t *)obj; + switch(axis) { + case LV_CHART_AXIS_PRIMARY_Y: + chart->ymin[0] = min; + chart->ymax[0] = max; + break; + case LV_CHART_AXIS_SECONDARY_Y: + chart->ymin[1] = min; + chart->ymax[1] = max; + break; + case LV_CHART_AXIS_PRIMARY_X: + chart->xmin[0] = min; + chart->xmax[0] = max; + break; + case LV_CHART_AXIS_SECONDARY_X: + chart->xmin[1] = min; + chart->xmax[1] = max; + break; + default: + LV_LOG_WARN("Invalid axis: %d", axis); + return; + } + + lv_chart_refresh(obj); +} + +void lv_chart_set_update_mode(lv_obj_t * obj, lv_chart_update_mode_t update_mode) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(chart->update_mode == update_mode) return; + + chart->update_mode = update_mode; + lv_obj_invalidate(obj); +} + +void lv_chart_set_div_line_count(lv_obj_t * obj, uint8_t hdiv, uint8_t vdiv) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(chart->hdiv_cnt == hdiv && chart->vdiv_cnt == vdiv) return; + + chart->hdiv_cnt = hdiv; + chart->vdiv_cnt = vdiv; + + lv_obj_invalidate(obj); +} + + +void lv_chart_set_zoom_x(lv_obj_t * obj, uint16_t zoom_x) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(chart->zoom_x == zoom_x) return; + + chart->zoom_x = zoom_x; + lv_obj_refresh_self_size(obj); + /*Be the chart doesn't remain scrolled out*/ + lv_obj_readjust_scroll(obj, LV_ANIM_OFF); + lv_obj_invalidate(obj); +} + +void lv_chart_set_zoom_y(lv_obj_t * obj, uint16_t zoom_y) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(chart->zoom_y == zoom_y) return; + + chart->zoom_y = zoom_y; + lv_obj_refresh_self_size(obj); + /*Be the chart doesn't remain scrolled out*/ + lv_obj_readjust_scroll(obj, LV_ANIM_OFF); + lv_obj_invalidate(obj); +} + +uint16_t lv_chart_get_zoom_x(const lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + return chart->zoom_x; +} + +uint16_t lv_chart_get_zoom_y(const lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + return chart->zoom_y; +} + +void lv_chart_set_axis_tick(lv_obj_t * obj, lv_chart_axis_t axis, lv_coord_t major_len, lv_coord_t minor_len, + lv_coord_t major_cnt, lv_coord_t minor_cnt, bool label_en, lv_coord_t draw_size) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_tick_dsc_t * t = get_tick_gsc(obj, axis); + t->major_len = major_len; + t->minor_len = minor_len; + t->minor_cnt = minor_cnt; + t->major_cnt = major_cnt; + t->label_en = label_en; + t->draw_size = draw_size; + + lv_obj_refresh_ext_draw_size(obj); + lv_obj_invalidate(obj); +} + +lv_chart_type_t lv_chart_get_type(const lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + return chart->type; +} + +uint16_t lv_chart_get_point_count(const lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + return chart->point_cnt; +} + +uint16_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * ser) +{ + LV_ASSERT_NULL(ser); + lv_chart_t * chart = (lv_chart_t *)obj; + + return chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0; +} + +void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_point_t * p_out) +{ + LV_ASSERT_NULL(obj); + LV_ASSERT_NULL(ser); + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(id >= chart->point_cnt) { + LV_LOG_WARN("Invalid index: %d", id); + p_out->x = 0; + p_out->y = 0; + return; + } + + lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; + lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + + if(chart->type == LV_CHART_TYPE_LINE) { + p_out->x = (w * id) / (chart->point_cnt - 1); + } + else if(chart->type == LV_CHART_TYPE_SCATTER) { + p_out->x = lv_map(ser->x_points[id], chart->xmin[ser->x_axis_sec], chart->xmax[ser->x_axis_sec], 0, w); + } + else if(chart->type == LV_CHART_TYPE_BAR) { + uint32_t ser_cnt = _lv_ll_get_len(&chart->series_ll); + /*Gap between the column on the X tick*/ + int32_t ser_gap = ((int32_t)lv_obj_get_style_pad_column(obj, LV_PART_ITEMS) * chart->zoom_x) >> 8; + + /*Gap between the columns on adjacent X ticks*/ + int32_t block_gap = ((int32_t)lv_obj_get_style_pad_column(obj, LV_PART_MAIN) * chart->zoom_x) >> 8; + + lv_coord_t block_w = (w - ((chart->point_cnt - 1) * block_gap)) / chart->point_cnt; + + lv_chart_series_t * ser_i = NULL; + uint32_t ser_idx = 0; + _LV_LL_READ_BACK(&chart->series_ll, ser_i) { + if(ser_i == ser) break; + ser_idx++; + } + + p_out->x = (int32_t)((int32_t)(w + block_gap) * id) / chart->point_cnt; + p_out->x += block_w * ser_idx / ser_cnt; + + lv_coord_t col_w = (block_w - (ser_gap * (ser_cnt - 1))) / ser_cnt; + p_out->x += col_w / 2; + } + + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + p_out->x += lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; + p_out->x -= lv_obj_get_scroll_left(obj); + + uint32_t start_point = lv_chart_get_x_start_point(obj, ser); + id = ((int32_t)start_point + id) % chart->point_cnt; + int32_t temp_y = 0; + temp_y = (int32_t)((int32_t)ser->y_points[id] - chart->ymin[ser->y_axis_sec]) * h; + temp_y = temp_y / (chart->ymax[ser->y_axis_sec] - chart->ymin[ser->y_axis_sec]); + p_out->y = h - temp_y; + p_out->y += lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; + p_out->y -= lv_obj_get_scroll_top(obj); +} + +void lv_chart_refresh(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_obj_invalidate(obj); +} + +/*====================== + * Series + *=====================*/ + +lv_chart_series_t * lv_chart_add_series(lv_obj_t * obj, lv_color_t color, lv_chart_axis_t axis) +{ + LV_LOG_INFO("begin"); + + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + lv_chart_series_t * ser = _lv_ll_ins_head(&chart->series_ll); + LV_ASSERT_MALLOC(ser); + if(ser == NULL) return NULL; + + lv_coord_t def = LV_CHART_POINT_NONE; + + ser->color = color; + ser->y_points = lv_mem_alloc(sizeof(lv_coord_t) * chart->point_cnt); + LV_ASSERT_MALLOC(ser->y_points); + + if(chart->type == LV_CHART_TYPE_SCATTER) { + ser->x_points = lv_mem_alloc(sizeof(lv_coord_t) * chart->point_cnt); + LV_ASSERT_MALLOC(ser->x_points); + } + if(ser->y_points == NULL) { + _lv_ll_remove(&chart->series_ll, ser); + lv_mem_free(ser); + return NULL; + } + + ser->start_point = 0; + ser->y_ext_buf_assigned = false; + ser->hidden = 0; + ser->x_axis_sec = axis & LV_CHART_AXIS_SECONDARY_X ? 1 : 0; + ser->y_axis_sec = axis & LV_CHART_AXIS_SECONDARY_Y ? 1 : 0; + + uint16_t i; + lv_coord_t * p_tmp = ser->y_points; + for(i = 0; i < chart->point_cnt; i++) { + *p_tmp = def; + p_tmp++; + } + + return ser; +} + +void lv_chart_remove_series(lv_obj_t * obj, lv_chart_series_t * series) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(series); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(!series->y_ext_buf_assigned && series->y_points) lv_mem_free(series->y_points); + + _lv_ll_remove(&chart->series_ll, series); + lv_mem_free(series); + + return; +} + +void lv_chart_hide_series(lv_obj_t * chart, lv_chart_series_t * series, bool hide) +{ + LV_ASSERT_OBJ(chart, MY_CLASS); + LV_ASSERT_NULL(series); + + series->hidden = hide ? 1 : 0; + lv_chart_refresh(chart); +} + + +void lv_chart_set_series_color(lv_obj_t * chart, lv_chart_series_t * series, lv_color_t color) +{ + LV_ASSERT_OBJ(chart, MY_CLASS); + LV_ASSERT_NULL(series); + + series->color = color; + lv_chart_refresh(chart); +} + +void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(ser); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(id >= chart->point_cnt) return; + ser->start_point = id; +} + +lv_chart_series_t * lv_chart_get_series_next(const lv_obj_t * obj, const lv_chart_series_t * ser) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(ser == NULL) return _lv_ll_get_head(&chart->series_ll); + else return _lv_ll_get_next(&chart->series_ll, ser); +} + +/*===================== + * Cursor + *====================*/ + +/** + * Add a cursor with a given color + * @param chart pointer to chart object + * @param color color of the cursor + * @param dir direction of the cursor. `LV_DIR_RIGHT/LEFT/TOP/DOWN/HOR/VER/ALL`. OR-ed values are possible + * @return pointer to the created cursor + */ +lv_chart_cursor_t * lv_chart_add_cursor(lv_obj_t * obj, lv_color_t color, lv_dir_t dir) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + lv_chart_cursor_t * cursor = _lv_ll_ins_head(&chart->cursor_ll); + LV_ASSERT_MALLOC(cursor); + if(cursor == NULL) return NULL; + + cursor->pos.x = LV_CHART_POINT_NONE; + cursor->pos.y = LV_CHART_POINT_NONE; + cursor->point_id = LV_CHART_POINT_NONE; + cursor->pos_set = 0; + cursor->color = color; + cursor->dir = dir; + + return cursor; +} + +/** + * Set the coordinate of the cursor with respect + * to the origin of series area of the chart. + * @param chart pointer to a chart object. + * @param cursor pointer to the cursor. + * @param pos the new coordinate of cursor relative to the series area + */ +void lv_chart_set_cursor_pos(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_point_t * pos) +{ + LV_ASSERT_NULL(cursor); + LV_UNUSED(chart); + + cursor->pos.x = pos->x; + cursor->pos.y = pos->y; + cursor->pos_set = 1; + lv_chart_refresh(chart); +} + + +/** + * Set the coordinate of the cursor with respect + * to the origin of series area of the chart. + * @param chart pointer to a chart object. + * @param cursor pointer to the cursor. + * @param pos the new coordinate of cursor relative to the series area + */ +void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_chart_series_t * ser, uint16_t point_id) +{ + LV_ASSERT_NULL(cursor); + LV_UNUSED(chart); + + cursor->point_id = point_id; + cursor->pos_set = 0; + if(ser == NULL) ser = lv_chart_get_series_next(chart, NULL); + cursor->ser = ser; + lv_chart_refresh(chart); +} +/** + * Get the coordinate of the cursor with respect + * to the origin of series area of the chart. + * @param chart pointer to a chart object + * @param cursor pointer to cursor + * @return coordinate of the cursor as lv_point_t + */ +lv_point_t lv_chart_get_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor) +{ + LV_ASSERT_NULL(cursor); + LV_UNUSED(chart); + + return cursor->pos; +} + +/*===================== + * Set/Get value(s) + *====================*/ + + +void lv_chart_set_all_value(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_t value) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(ser); + + lv_chart_t * chart = (lv_chart_t *)obj; + uint16_t i; + for(i = 0; i < chart->point_cnt; i++) { + ser->y_points[i] = value; + } + ser->start_point = 0; + lv_chart_refresh(obj); +} + +void lv_chart_set_next_value(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_t value) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(ser); + + lv_chart_t * chart = (lv_chart_t *)obj; + ser->y_points[ser->start_point] = value; + invalidate_point(obj, ser->start_point); + ser->start_point = (ser->start_point + 1) % chart->point_cnt; + invalidate_point(obj, ser->start_point); +} + +void lv_chart_set_next_value2(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_t x_value, lv_coord_t y_value) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(ser); + + lv_chart_t * chart = (lv_chart_t *)obj; + + if(chart->type != LV_CHART_TYPE_SCATTER) { + LV_LOG_WARN("Type must be LV_CHART_TYPE_SCATTER"); + return; + } + + ser->x_points[ser->start_point] = x_value; + ser->y_points[ser->start_point] = y_value; + ser->start_point = (ser->start_point + 1) % chart->point_cnt; + invalidate_point(obj, ser->start_point); +} + +void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_coord_t value) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(ser); + lv_chart_t * chart = (lv_chart_t *)obj; + + if(id >= chart->point_cnt) return; + ser->y_points[id] = value; + invalidate_point(obj, id); +} + +void lv_chart_set_value_by_id2(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_coord_t x_value, + lv_coord_t y_value) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(ser); + lv_chart_t * chart = (lv_chart_t *)obj; + + if(chart->type != LV_CHART_TYPE_SCATTER) { + LV_LOG_WARN("Type must be LV_CHART_TYPE_SCATTER"); + return; + } + + if(id >= chart->point_cnt) return; + ser->x_points[id] = x_value; + ser->y_points[id] = y_value; + invalidate_point(obj, id); +} + +void lv_chart_set_ext_y_array(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_t array[]) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(ser); + + if(!ser->y_ext_buf_assigned && ser->y_points) lv_mem_free(ser->y_points); + ser->y_ext_buf_assigned = true; + ser->y_points = array; + lv_obj_invalidate(obj); +} + +void lv_chart_set_ext_x_array(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_t array[]) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(ser); + + if(!ser->x_ext_buf_assigned && ser->x_points) lv_mem_free(ser->x_points); + ser->x_ext_buf_assigned = true; + ser->x_points = array; + lv_obj_invalidate(obj); +} + +lv_coord_t * lv_chart_get_y_array(const lv_obj_t * obj, lv_chart_series_t * ser) +{ + LV_UNUSED(obj); + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(ser); + return ser->y_points; +} + +lv_coord_t * lv_chart_get_x_array(const lv_obj_t * obj, lv_chart_series_t * ser) +{ + LV_UNUSED(obj); + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(ser); + return ser->x_points; +} + +uint32_t lv_chart_get_pressed_point(const lv_obj_t * obj) +{ + lv_chart_t * chart = (lv_chart_t *)obj; + return chart->pressed_point_id; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_chart_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + LV_TRACE_OBJ_CREATE("begin"); + + lv_chart_t * chart = (lv_chart_t *)obj; + + _lv_ll_init(&chart->series_ll, sizeof(lv_chart_series_t)); + _lv_ll_init(&chart->cursor_ll, sizeof(lv_chart_cursor_t)); + + chart->ymin[0] = 0; + chart->xmin[0] = 0; + chart->ymin[1] = 0; + chart->xmin[1] = 0; + chart->ymax[0] = 100; + chart->xmax[0] = 100; + chart->ymax[1] = 100; + chart->xmax[1] = 100; + + chart->hdiv_cnt = LV_CHART_HDIV_DEF; + chart->vdiv_cnt = LV_CHART_VDIV_DEF; + chart->point_cnt = LV_CHART_POINT_CNT_DEF; + chart->pressed_point_id = LV_CHART_POINT_NONE; + chart->type = LV_CHART_TYPE_LINE; + chart->update_mode = LV_CHART_UPDATE_MODE_SHIFT; + chart->zoom_x = LV_IMG_ZOOM_NONE; + chart->zoom_y = LV_IMG_ZOOM_NONE; + + LV_TRACE_OBJ_CREATE("finished"); +} + +static void lv_chart_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + LV_TRACE_OBJ_CREATE("begin"); + + lv_chart_t * chart = (lv_chart_t *)obj; + lv_chart_series_t * ser; + while(chart->series_ll.head) { + ser = _lv_ll_get_head(&chart->series_ll); + + if(!ser->y_ext_buf_assigned) lv_mem_free(ser->y_points); + + _lv_ll_remove(&chart->series_ll, ser); + lv_mem_free(ser); + } + _lv_ll_clear(&chart->series_ll); + + lv_chart_cursor_t * cur; + while(chart->cursor_ll.head) { + cur = _lv_ll_get_head(&chart->cursor_ll); + _lv_ll_remove(&chart->cursor_ll, cur); + lv_mem_free(cur); + } + _lv_ll_clear(&chart->cursor_ll); + + LV_TRACE_OBJ_CREATE("finished"); +} + +static void lv_chart_event(const lv_obj_class_t * class_p, lv_event_t * e) +{ + LV_UNUSED(class_p); + + /*Call the ancestor's event handler*/ + lv_res_t res; + + res = lv_obj_event_base(MY_CLASS, e); + if(res != LV_RES_OK) return; + + lv_event_code_t code = lv_event_get_code(e); + lv_obj_t * obj = lv_event_get_target(e); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(code == LV_EVENT_PRESSED) { + lv_indev_t * indev = lv_indev_get_act(); + lv_point_t p; + lv_indev_get_point(indev, &p); + + p.x -= obj->coords.x1; + uint32_t id = get_index_from_x(obj, p.x + lv_obj_get_scroll_left(obj)); + if(id != (uint32_t)chart->pressed_point_id) { + invalidate_point(obj, id); + invalidate_point(obj, chart->pressed_point_id); + chart->pressed_point_id = id; + lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + } + } + else if(code == LV_EVENT_RELEASED) { + invalidate_point(obj, chart->pressed_point_id); + chart->pressed_point_id = LV_CHART_POINT_NONE; + } + else if(code == LV_EVENT_SIZE_CHANGED) { + lv_obj_refresh_self_size(obj); + } + else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { + lv_event_set_ext_draw_size(e, LV_MAX4(chart->tick[0].draw_size, chart->tick[1].draw_size, chart->tick[2].draw_size, + chart->tick[3].draw_size)); + } + else if(code == LV_EVENT_GET_SELF_SIZE) { + lv_point_t * p = lv_event_get_param(e); + p->x = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; + p->y = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + } + else if(code == LV_EVENT_DRAW_MAIN) { + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); + draw_div_lines(obj, draw_ctx); + draw_axes(obj, draw_ctx); + + if(_lv_ll_is_empty(&chart->series_ll) == false) { + if(chart->type == LV_CHART_TYPE_LINE) draw_series_line(obj, draw_ctx); + else if(chart->type == LV_CHART_TYPE_BAR) draw_series_bar(obj, draw_ctx); + else if(chart->type == LV_CHART_TYPE_SCATTER) draw_series_scatter(obj, draw_ctx); + } + + draw_cursors(obj, draw_ctx); + } +} + +static void draw_div_lines(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx) +{ + lv_chart_t * chart = (lv_chart_t *)obj; + + lv_area_t series_clip_area; + bool mask_ret = _lv_area_intersect(&series_clip_area, &obj->coords, draw_ctx->clip_area); + if(mask_ret == false) return; + + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &series_clip_area; + + int16_t i; + int16_t i_start; + int16_t i_end; + lv_point_t p1; + lv_point_t p2; + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; + lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; + lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; + lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + + lv_draw_line_dsc_t line_dsc; + lv_draw_line_dsc_init(&line_dsc); + lv_obj_init_draw_line_dsc(obj, LV_PART_MAIN, &line_dsc); + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.part = LV_PART_MAIN; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_CHART_DRAW_PART_DIV_LINE_INIT; + part_draw_dsc.line_dsc = &line_dsc; + part_draw_dsc.id = 0xFFFFFFFF; + part_draw_dsc.p1 = NULL; + part_draw_dsc.p2 = NULL; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + + lv_opa_t border_opa = lv_obj_get_style_border_opa(obj, LV_PART_MAIN); + lv_coord_t border_w = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_border_side_t border_side = lv_obj_get_style_border_side(obj, LV_PART_MAIN); + + lv_coord_t scroll_left = lv_obj_get_scroll_left(obj); + lv_coord_t scroll_top = lv_obj_get_scroll_top(obj); + if(chart->hdiv_cnt != 0) { + lv_coord_t y_ofs = obj->coords.y1 + pad_top - scroll_top; + p1.x = obj->coords.x1; + p2.x = obj->coords.x2; + + i_start = 0; + i_end = chart->hdiv_cnt; + if(border_opa > LV_OPA_MIN && border_w > 0) { + if((border_side & LV_BORDER_SIDE_TOP) && (lv_obj_get_style_pad_top(obj, LV_PART_MAIN) == 0)) i_start++; + if((border_side & LV_BORDER_SIDE_BOTTOM) && (lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN) == 0)) i_end--; + } + + for(i = i_start; i < i_end; i++) { + p1.y = (int32_t)((int32_t)h * i) / (chart->hdiv_cnt - 1); + p1.y += y_ofs; + p2.y = p1.y; + + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_CHART_DRAW_PART_DIV_LINE_HOR; + part_draw_dsc.p1 = &p1; + part_draw_dsc.p2 = &p2; + part_draw_dsc.id = i; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_line(draw_ctx, &line_dsc, &p1, &p2); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + } + + if(chart->vdiv_cnt != 0) { + lv_coord_t x_ofs = obj->coords.x1 + pad_left - scroll_left; + p1.y = obj->coords.y1; + p2.y = obj->coords.y2; + i_start = 0; + i_end = chart->vdiv_cnt; + if(border_opa > LV_OPA_MIN && border_w > 0) { + if((border_side & LV_BORDER_SIDE_LEFT) && (lv_obj_get_style_pad_left(obj, LV_PART_MAIN) == 0)) i_start++; + if((border_side & LV_BORDER_SIDE_RIGHT) && (lv_obj_get_style_pad_right(obj, LV_PART_MAIN) == 0)) i_end--; + } + + for(i = i_start; i < i_end; i++) { + p1.x = (int32_t)((int32_t)w * i) / (chart->vdiv_cnt - 1); + p1.x += x_ofs; + p2.x = p1.x; + + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_CHART_DRAW_PART_DIV_LINE_VER; + part_draw_dsc.p1 = &p1; + part_draw_dsc.p2 = &p2; + part_draw_dsc.id = i; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_line(draw_ctx, &line_dsc, &p1, &p2); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + } + + part_draw_dsc.id = 0xFFFFFFFF; + part_draw_dsc.p1 = NULL; + part_draw_dsc.p2 = NULL; + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + + draw_ctx->clip_area = clip_area_ori; +} + +static void draw_series_line(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx) +{ + lv_area_t clip_area; + if(_lv_area_intersect(&clip_area, &obj->coords, draw_ctx->clip_area) == false) return; + + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_area; + + lv_chart_t * chart = (lv_chart_t *)obj; + if(chart->point_cnt < 2) return; + + uint16_t i; + lv_point_t p1; + lv_point_t p2; + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; + lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; + lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; + lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + lv_coord_t x_ofs = obj->coords.x1 + pad_left - lv_obj_get_scroll_left(obj); + lv_coord_t y_ofs = obj->coords.y1 + pad_top - lv_obj_get_scroll_top(obj); + lv_chart_series_t * ser; + + lv_area_t series_clip_area; + bool mask_ret = _lv_area_intersect(&series_clip_area, &obj->coords, draw_ctx->clip_area); + if(mask_ret == false) return; + + lv_draw_line_dsc_t line_dsc_default; + lv_draw_line_dsc_init(&line_dsc_default); + lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &line_dsc_default); + + lv_draw_rect_dsc_t point_dsc_default; + lv_draw_rect_dsc_init(&point_dsc_default); + lv_obj_init_draw_rect_dsc(obj, LV_PART_INDICATOR, &point_dsc_default); + + lv_coord_t point_w = lv_obj_get_style_width(obj, LV_PART_INDICATOR) / 2; + lv_coord_t point_h = lv_obj_get_style_height(obj, LV_PART_INDICATOR) / 2; + + /*Do not bother with line ending is the point will over it*/ + if(LV_MIN(point_w, point_h) > line_dsc_default.width / 2) line_dsc_default.raw_end = 1; + if(line_dsc_default.width == 1) line_dsc_default.raw_end = 1; + + /*If there are at least as much points as pixels then draw only vertical lines*/ + bool crowded_mode = chart->point_cnt >= w ? true : false; + + /*Go through all data lines*/ + _LV_LL_READ_BACK(&chart->series_ll, ser) { + if(ser->hidden) continue; + line_dsc_default.color = ser->color; + point_dsc_default.bg_color = ser->color; + + lv_coord_t start_point = lv_chart_get_x_start_point(obj, ser); + + p1.x = x_ofs; + p2.x = x_ofs; + + lv_coord_t p_act = start_point; + lv_coord_t p_prev = start_point; + int32_t y_tmp = (int32_t)((int32_t)ser->y_points[p_prev] - chart->ymin[ser->y_axis_sec]) * h; + y_tmp = y_tmp / (chart->ymax[ser->y_axis_sec] - chart->ymin[ser->y_axis_sec]); + p2.y = h - y_tmp + y_ofs; + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_CHART_DRAW_PART_LINE_AND_POINT; + part_draw_dsc.part = LV_PART_ITEMS; + part_draw_dsc.line_dsc = &line_dsc_default; + part_draw_dsc.rect_dsc = &point_dsc_default; + part_draw_dsc.sub_part_ptr = ser; + + lv_coord_t y_min = p2.y; + lv_coord_t y_max = p2.y; + + for(i = 0; i < chart->point_cnt; i++) { + p1.x = p2.x; + p1.y = p2.y; + + if(p1.x > clip_area_ori->x2 + point_w + 1) break; + p2.x = ((w * i) / (chart->point_cnt - 1)) + x_ofs; + + p_act = (start_point + i) % chart->point_cnt; + + y_tmp = (int32_t)((int32_t)ser->y_points[p_act] - chart->ymin[ser->y_axis_sec]) * h; + y_tmp = y_tmp / (chart->ymax[ser->y_axis_sec] - chart->ymin[ser->y_axis_sec]); + p2.y = h - y_tmp + y_ofs; + + if(p2.x < clip_area_ori->x1 - point_w - 1) { + p_prev = p_act; + continue; + } + + /*Don't draw the first point. A second point is also required to draw the line*/ + if(i != 0) { + if(crowded_mode) { + if(ser->y_points[p_prev] != LV_CHART_POINT_NONE && ser->y_points[p_act] != LV_CHART_POINT_NONE) { + /*Draw only one vertical line between the min and max y-values on the same x-value*/ + y_max = LV_MAX(y_max, p2.y); + y_min = LV_MIN(y_min, p2.y); + if(p1.x != p2.x) { + lv_coord_t y_cur = p2.y; + p2.x--; /*It's already on the next x value*/ + p1.x = p2.x; + p1.y = y_min; + p2.y = y_max; + if(p1.y == p2.y) p2.y++; /*If they are the same no line will be drawn*/ + lv_draw_line(draw_ctx, &line_dsc_default, &p1, &p2); + p2.x++; /*Compensate the previous x--*/ + y_min = y_cur; /*Start the line of the next x from the current last y*/ + y_max = y_cur; + } + } + } + else { + lv_area_t point_area; + point_area.x1 = p1.x - point_w; + point_area.x2 = p1.x + point_w; + point_area.y1 = p1.y - point_h; + point_area.y2 = p1.y + point_h; + + part_draw_dsc.id = i - 1; + part_draw_dsc.p1 = ser->y_points[p_prev] != LV_CHART_POINT_NONE ? &p1 : NULL; + part_draw_dsc.p2 = ser->y_points[p_act] != LV_CHART_POINT_NONE ? &p2 : NULL; + part_draw_dsc.draw_area = &point_area; + part_draw_dsc.value = ser->y_points[p_prev]; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + + if(ser->y_points[p_prev] != LV_CHART_POINT_NONE && ser->y_points[p_act] != LV_CHART_POINT_NONE) { + lv_draw_line(draw_ctx, &line_dsc_default, &p1, &p2); + } + + if(point_w && point_h && ser->y_points[p_prev] != LV_CHART_POINT_NONE) { + lv_draw_rect(draw_ctx, &point_dsc_default, &point_area); + } + + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + + } + p_prev = p_act; + } + + /*Draw the last point*/ + if(!crowded_mode && i == chart->point_cnt) { + + if(ser->y_points[p_act] != LV_CHART_POINT_NONE) { + lv_area_t point_area; + point_area.x1 = p2.x - point_w; + point_area.x2 = p2.x + point_w; + point_area.y1 = p2.y - point_h; + point_area.y2 = p2.y + point_h; + + part_draw_dsc.id = i - 1; + part_draw_dsc.p1 = NULL; + part_draw_dsc.p2 = NULL; + part_draw_dsc.draw_area = &point_area; + part_draw_dsc.value = ser->y_points[p_act]; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_rect(draw_ctx, &point_dsc_default, &point_area); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + } + } + + draw_ctx->clip_area = clip_area_ori; +} + +static void draw_series_scatter(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx) +{ + + lv_area_t clip_area; + if(_lv_area_intersect(&clip_area, &obj->coords, draw_ctx->clip_area) == false) return; + + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_area; + + lv_chart_t * chart = (lv_chart_t *)obj; + + uint16_t i; + lv_point_t p1; + lv_point_t p2; + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; + lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + lv_coord_t x_ofs = obj->coords.x1 + pad_left + border_width - lv_obj_get_scroll_left(obj); + lv_coord_t y_ofs = obj->coords.y1 + pad_top + border_width - lv_obj_get_scroll_top(obj); + lv_chart_series_t * ser; + + lv_draw_line_dsc_t line_dsc_default; + lv_draw_line_dsc_init(&line_dsc_default); + lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &line_dsc_default); + + lv_draw_rect_dsc_t point_dsc_default; + lv_draw_rect_dsc_init(&point_dsc_default); + lv_obj_init_draw_rect_dsc(obj, LV_PART_INDICATOR, &point_dsc_default); + + lv_coord_t point_w = lv_obj_get_style_width(obj, LV_PART_INDICATOR) / 2; + lv_coord_t point_h = lv_obj_get_style_height(obj, LV_PART_INDICATOR) / 2; + + /*Do not bother with line ending is the point will over it*/ + if(LV_MIN(point_w, point_h) > line_dsc_default.width / 2) line_dsc_default.raw_end = 1; + if(line_dsc_default.width == 1) line_dsc_default.raw_end = 1; + + /*Go through all data lines*/ + _LV_LL_READ_BACK(&chart->series_ll, ser) { + if(ser->hidden) continue; + line_dsc_default.color = ser->color; + point_dsc_default.bg_color = ser->color; + + lv_coord_t start_point = lv_chart_get_x_start_point(obj, ser); + + p1.x = x_ofs; + p2.x = x_ofs; + + lv_coord_t p_act = start_point; + lv_coord_t p_prev = start_point; + if(ser->y_points[p_act] != LV_CHART_POINT_CNT_DEF) { + p2.x = lv_map(ser->x_points[p_act], chart->xmin[ser->x_axis_sec], chart->xmax[ser->x_axis_sec], 0, w); + p2.x += x_ofs; + + p2.y = lv_map(ser->y_points[p_act], chart->ymin[ser->y_axis_sec], chart->ymax[ser->y_axis_sec], 0, h); + p2.y = h - p2.y; + p2.y += y_ofs; + } + else { + p2.x = LV_COORD_MIN; + p2.y = LV_COORD_MIN; + } + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.part = LV_PART_ITEMS; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_CHART_DRAW_PART_LINE_AND_POINT; + part_draw_dsc.line_dsc = &line_dsc_default; + part_draw_dsc.rect_dsc = &point_dsc_default; + part_draw_dsc.sub_part_ptr = ser; + + for(i = 0; i < chart->point_cnt; i++) { + p1.x = p2.x; + p1.y = p2.y; + + p_act = (start_point + i) % chart->point_cnt; + if(ser->y_points[p_act] != LV_CHART_POINT_NONE) { + p2.y = lv_map(ser->y_points[p_act], chart->ymin[ser->y_axis_sec], chart->ymax[ser->y_axis_sec], 0, h); + p2.y = h - p2.y; + p2.y += y_ofs; + + p2.x = lv_map(ser->x_points[p_act], chart->xmin[ser->x_axis_sec], chart->xmax[ser->x_axis_sec], 0, w); + p2.x += x_ofs; + } + else { + p_prev = p_act; + continue; + } + + /*Don't draw the first point. A second point is also required to draw the line*/ + if(i != 0) { + lv_area_t point_area; + point_area.x1 = p1.x - point_w; + point_area.x2 = p1.x + point_w; + point_area.y1 = p1.y - point_h; + point_area.y2 = p1.y + point_h; + + part_draw_dsc.id = i - 1; + part_draw_dsc.p1 = ser->y_points[p_prev] != LV_CHART_POINT_NONE ? &p1 : NULL; + part_draw_dsc.p2 = ser->y_points[p_act] != LV_CHART_POINT_NONE ? &p2 : NULL; + part_draw_dsc.draw_area = &point_area; + part_draw_dsc.value = ser->y_points[p_prev]; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + + if(ser->y_points[p_prev] != LV_CHART_POINT_NONE && ser->y_points[p_act] != LV_CHART_POINT_NONE) { + lv_draw_line(draw_ctx, &line_dsc_default, &p1, &p2); + if(point_w && point_h) { + lv_draw_rect(draw_ctx, &point_dsc_default, &point_area); + } + } + + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + p_prev = p_act; + } + + /*Draw the last point*/ + if(i == chart->point_cnt) { + + if(ser->y_points[p_act] != LV_CHART_POINT_NONE) { + lv_area_t point_area; + point_area.x1 = p2.x - point_w; + point_area.x2 = p2.x + point_w; + point_area.y1 = p2.y - point_h; + point_area.y2 = p2.y + point_h; + + part_draw_dsc.id = i - 1; + part_draw_dsc.p1 = NULL; + part_draw_dsc.p2 = NULL; + part_draw_dsc.draw_area = &point_area; + part_draw_dsc.value = ser->y_points[p_act]; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_rect(draw_ctx, &point_dsc_default, &point_area); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + } + } + draw_ctx->clip_area = clip_area_ori; +} + +static void draw_series_bar(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx) +{ + lv_area_t clip_area; + if(_lv_area_intersect(&clip_area, &obj->coords, draw_ctx->clip_area) == false) return; + + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_area; + + lv_chart_t * chart = (lv_chart_t *)obj; + + uint16_t i; + lv_area_t col_a; + lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; + lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + int32_t y_tmp; + lv_chart_series_t * ser; + uint32_t ser_cnt = _lv_ll_get_len(&chart->series_ll); + int32_t block_gap = ((int32_t)lv_obj_get_style_pad_column(obj, + LV_PART_MAIN) * chart->zoom_x) >> 8; /*Gap between the column on ~adjacent X*/ + lv_coord_t block_w = (w - ((chart->point_cnt - 1) * block_gap)) / chart->point_cnt; + int32_t ser_gap = ((int32_t)lv_obj_get_style_pad_column(obj, + LV_PART_ITEMS) * chart->zoom_x) >> 8; /*Gap between the columns on the ~same X*/ + lv_coord_t col_w = (block_w - (ser_cnt - 1) * ser_gap) / ser_cnt; + if(col_w < 1) col_w = 1; + + lv_coord_t border_w = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t x_ofs = pad_left - lv_obj_get_scroll_left(obj) + border_w; + lv_coord_t y_ofs = pad_top - lv_obj_get_scroll_top(obj) + border_w; + + lv_draw_rect_dsc_t col_dsc; + lv_draw_rect_dsc_init(&col_dsc); + lv_obj_init_draw_rect_dsc(obj, LV_PART_ITEMS, &col_dsc); + col_dsc.bg_grad.dir = LV_GRAD_DIR_NONE; + col_dsc.bg_opa = LV_OPA_COVER; + + /*Make the cols longer with `radius` to clip the rounding from the bottom*/ + col_a.y2 = obj->coords.y2 + col_dsc.radius; + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.part = LV_PART_ITEMS; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_CHART_DRAW_PART_BAR; + + /*Go through all points*/ + for(i = 0; i < chart->point_cnt; i++) { + lv_coord_t x_act = (int32_t)((int32_t)(w - block_w) * i) / (chart->point_cnt - 1) + obj->coords.x1 + x_ofs; + + part_draw_dsc.id = i; + + /*Draw the current point of all data line*/ + _LV_LL_READ_BACK(&chart->series_ll, ser) { + if(ser->hidden) continue; + + lv_coord_t start_point = lv_chart_get_x_start_point(obj, ser); + + col_a.x1 = x_act; + col_a.x2 = col_a.x1 + col_w - 1; + x_act += col_w + ser_gap; + + if(col_a.x2 < clip_area.x1) continue; + if(col_a.x1 > clip_area.x2) break; + + col_dsc.bg_color = ser->color; + + lv_coord_t p_act = (start_point + i) % chart->point_cnt; + y_tmp = (int32_t)((int32_t)ser->y_points[p_act] - chart->ymin[ser->y_axis_sec]) * h; + y_tmp = y_tmp / (chart->ymax[ser->y_axis_sec] - chart->ymin[ser->y_axis_sec]); + col_a.y1 = h - y_tmp + obj->coords.y1 + y_ofs; + + if(ser->y_points[p_act] != LV_CHART_POINT_NONE) { + part_draw_dsc.draw_area = &col_a; + part_draw_dsc.rect_dsc = &col_dsc; + part_draw_dsc.sub_part_ptr = ser; + part_draw_dsc.value = ser->y_points[p_act]; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_rect(draw_ctx, &col_dsc, &col_a); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + } + } + draw_ctx->clip_area = clip_area_ori; +} + +static void draw_cursors(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_chart_t * chart = (lv_chart_t *)obj; + if(_lv_ll_is_empty(&chart->cursor_ll)) return; + + lv_area_t clip_area; + if(!_lv_area_intersect(&clip_area, draw_ctx->clip_area, &obj->coords)) return; + + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_area; + + lv_point_t p1; + lv_point_t p2; + lv_chart_cursor_t * cursor; + + lv_draw_line_dsc_t line_dsc_ori; + lv_draw_line_dsc_init(&line_dsc_ori); + lv_obj_init_draw_line_dsc(obj, LV_PART_CURSOR, &line_dsc_ori); + + lv_draw_rect_dsc_t point_dsc_ori; + lv_draw_rect_dsc_init(&point_dsc_ori); + point_dsc_ori.bg_opa = line_dsc_ori.opa; + point_dsc_ori.radius = LV_RADIUS_CIRCLE; + + lv_draw_line_dsc_t line_dsc_tmp; + lv_draw_rect_dsc_t point_dsc_tmp; + + lv_coord_t point_w = lv_obj_get_style_width(obj, LV_PART_CURSOR) / 2; + lv_coord_t point_h = lv_obj_get_style_width(obj, LV_PART_CURSOR) / 2; + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.line_dsc = &line_dsc_tmp; + part_draw_dsc.rect_dsc = &point_dsc_tmp; + part_draw_dsc.part = LV_PART_CURSOR; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_CHART_DRAW_PART_CURSOR; + + /*Go through all cursor lines*/ + _LV_LL_READ_BACK(&chart->cursor_ll, cursor) { + lv_memcpy(&line_dsc_tmp, &line_dsc_ori, sizeof(lv_draw_line_dsc_t)); + lv_memcpy(&point_dsc_tmp, &point_dsc_ori, sizeof(lv_draw_rect_dsc_t)); + line_dsc_tmp.color = cursor->color; + point_dsc_tmp.bg_color = cursor->color; + + part_draw_dsc.p1 = &p1; + part_draw_dsc.p2 = &p2; + + lv_coord_t cx; + lv_coord_t cy; + if(cursor->pos_set) { + cx = cursor->pos.x; + cy = cursor->pos.y; + } + else { + if(cursor->point_id == LV_CHART_POINT_NONE) continue; + lv_point_t p; + lv_chart_get_point_pos_by_id(obj, cursor->ser, cursor->point_id, &p); + cx = p.x; + cy = p.y; + } + + cx += obj->coords.x1; + cy += obj->coords.y1; + + lv_area_t point_area; + bool draw_point = point_w && point_h; + if(draw_point) { + point_area.x1 = cx - point_w; + point_area.x2 = cx + point_w; + point_area.y1 = cy - point_h; + point_area.y2 = cy + point_h; + + part_draw_dsc.draw_area = &point_area; + } + else { + part_draw_dsc.draw_area = NULL; + } + + if(cursor->dir & LV_DIR_HOR) { + p1.x = cursor->dir & LV_DIR_LEFT ? obj->coords.x1 : cx; + p1.y = cy; + p2.x = cursor->dir & LV_DIR_RIGHT ? obj->coords.x2 : cx; + p2.y = p1.y; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_line(draw_ctx, &line_dsc_tmp, &p1, &p2); + + if(draw_point) { + lv_draw_rect(draw_ctx, &point_dsc_tmp, &point_area); + } + + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + + if(cursor->dir & LV_DIR_VER) { + p1.x = cx; + p1.y = cursor->dir & LV_DIR_TOP ? obj->coords.y1 : cy; + p2.x = p1.x; + p2.y = cursor->dir & LV_DIR_BOTTOM ? obj->coords.y2 : cy; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_line(draw_ctx, &line_dsc_tmp, &p1, &p2); + + if(draw_point) { + lv_draw_rect(draw_ctx, &point_dsc_tmp, &point_area); + } + + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + } + + draw_ctx->clip_area = clip_area_ori; +} + +static void draw_y_ticks(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx, lv_chart_axis_t axis) +{ + lv_chart_t * chart = (lv_chart_t *)obj; + + lv_chart_tick_dsc_t * t = get_tick_gsc(obj, axis); + + if(!t->label_en && !t->major_len && !t->minor_len) return; + if(t->major_cnt <= 1) return; + uint32_t total_tick_num = (t->major_cnt - 1) * (t->minor_cnt); + if(total_tick_num == 0) return; + + uint8_t sec_axis = axis == LV_CHART_AXIS_PRIMARY_Y ? 0 : 1; + + uint32_t i; + + lv_point_t p1; + lv_point_t p2; + + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + lv_coord_t y_ofs = obj->coords.y1 + pad_top + border_width - lv_obj_get_scroll_top(obj); + + lv_coord_t label_gap; + lv_coord_t x_ofs; + if(axis == LV_CHART_AXIS_PRIMARY_Y) { + label_gap = lv_obj_get_style_pad_left(obj, LV_PART_TICKS); + x_ofs = obj->coords.x1; + } + else { + label_gap = lv_obj_get_style_pad_right(obj, LV_PART_TICKS); + x_ofs = obj->coords.x2; + } + + lv_coord_t major_len = t->major_len; + lv_coord_t minor_len = t->minor_len; + /*tick lines on secondary y axis are drawn in other direction*/ + if(axis == LV_CHART_AXIS_SECONDARY_Y) { + major_len *= -1; + minor_len *= -1; + } + + lv_draw_line_dsc_t line_dsc; + lv_draw_line_dsc_init(&line_dsc); + lv_obj_init_draw_line_dsc(obj, LV_PART_TICKS, &line_dsc); + + lv_draw_label_dsc_t label_dsc; + lv_draw_label_dsc_init(&label_dsc); + lv_obj_init_draw_label_dsc(obj, LV_PART_TICKS, &label_dsc); + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_CHART_DRAW_PART_TICK_LABEL; + part_draw_dsc.id = axis; + part_draw_dsc.part = LV_PART_TICKS; + part_draw_dsc.line_dsc = &line_dsc; + part_draw_dsc.label_dsc = &label_dsc; + + for(i = 0; i <= total_tick_num; i++) { + /*draw a line at moving y position*/ + p2.y = p1.y = y_ofs + (int32_t)((int32_t)(h - line_dsc.width) * i) / total_tick_num; + + /*first point of the tick*/ + p1.x = x_ofs; + + /*move extra pixel out of chart boundary*/ + if(axis == LV_CHART_AXIS_PRIMARY_Y) p1.x--; + else p1.x++; + + /*second point of the tick*/ + bool major = false; + if(i % t->minor_cnt == 0) major = true; + + if(major) p2.x = p1.x - major_len; /*major tick*/ + else p2.x = p1.x - minor_len; /*minor tick*/ + + part_draw_dsc.p1 = &p1; + part_draw_dsc.p2 = &p2; + + int32_t tick_value = lv_map(total_tick_num - i, 0, total_tick_num, chart->ymin[sec_axis], chart->ymax[sec_axis]); + part_draw_dsc.value = tick_value; + + /*add text only to major tick*/ + if(major && t->label_en) { + char buf[LV_CHART_LABEL_MAX_TEXT_LENGTH]; + lv_snprintf(buf, sizeof(buf), "%" LV_PRId32, tick_value); + part_draw_dsc.label_dsc = &label_dsc; + part_draw_dsc.text = buf; + part_draw_dsc.text_length = LV_CHART_LABEL_MAX_TEXT_LENGTH; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + + /*reserve appropriate area*/ + lv_point_t size; + lv_txt_get_size(&size, part_draw_dsc.text, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, + LV_TEXT_FLAG_NONE); + + /*set the area at some distance of the major tick len left of the tick*/ + lv_area_t a; + a.y1 = p2.y - size.y / 2; + a.y2 = p2.y + size.y / 2; + + if(!sec_axis) { + a.x1 = p2.x - size.x - label_gap; + a.x2 = p2.x - label_gap; + } + else { + a.x1 = p2.x + label_gap; + a.x2 = p2.x + size.x + label_gap; + } + + if(a.y2 >= obj->coords.y1 && + a.y1 <= obj->coords.y2) { + lv_draw_label(draw_ctx, &label_dsc, &a, part_draw_dsc.text, NULL); + } + } + else { + part_draw_dsc.label_dsc = NULL; + part_draw_dsc.text = NULL; + part_draw_dsc.text_length = 0; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + } + + if(p1.y + line_dsc.width / 2 >= obj->coords.y1 && + p2.y - line_dsc.width / 2 <= obj->coords.y2) { + lv_draw_line(draw_ctx, &line_dsc, &p1, &p2); + } + + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } +} + +static void draw_x_ticks(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx, lv_chart_axis_t axis) +{ + lv_chart_t * chart = (lv_chart_t *)obj; + + lv_chart_tick_dsc_t * t = get_tick_gsc(obj, axis); + if(t->major_cnt <= 1) return; + if(!t->label_en && !t->major_len && !t->minor_len) return; + uint32_t total_tick_num = (t->major_cnt - 1) * (t->minor_cnt); + if(total_tick_num == 0) return; + + uint32_t i; + lv_point_t p1; + lv_point_t p2; + + lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; + + lv_draw_label_dsc_t label_dsc; + lv_draw_label_dsc_init(&label_dsc); + lv_obj_init_draw_label_dsc(obj, LV_PART_TICKS, &label_dsc); + + lv_coord_t x_ofs = obj->coords.x1 + pad_left - lv_obj_get_scroll_left(obj); + lv_coord_t y_ofs; + lv_coord_t label_gap; + if(axis == LV_CHART_AXIS_PRIMARY_X) { + label_gap = t->label_en ? lv_obj_get_style_pad_bottom(obj, LV_PART_TICKS) : 0; + y_ofs = obj->coords.y2 + 1; + } + else { + label_gap = t->label_en ? lv_obj_get_style_pad_top(obj, LV_PART_TICKS) : 0; + y_ofs = obj->coords.y1 - 1; + } + + if(axis == LV_CHART_AXIS_PRIMARY_X) { + if(y_ofs > draw_ctx->clip_area->y2) return; + if(y_ofs + label_gap + label_dsc.font->line_height + t->major_len < draw_ctx->clip_area->y1) return; + } + + lv_draw_line_dsc_t line_dsc; + lv_draw_line_dsc_init(&line_dsc); + lv_obj_init_draw_line_dsc(obj, LV_PART_TICKS, &line_dsc); + line_dsc.dash_gap = 0; + line_dsc.dash_width = 0; + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_CHART_DRAW_PART_TICK_LABEL; + part_draw_dsc.id = LV_CHART_AXIS_PRIMARY_X; + part_draw_dsc.part = LV_PART_TICKS; + part_draw_dsc.label_dsc = &label_dsc; + part_draw_dsc.line_dsc = &line_dsc; + + uint8_t sec_axis = axis == LV_CHART_AXIS_PRIMARY_X ? 0 : 1; + + /*The columns ticks should be aligned to the center of blocks*/ + if(chart->type == LV_CHART_TYPE_BAR) { + int32_t block_gap = ((int32_t)lv_obj_get_style_pad_column(obj, + LV_PART_MAIN) * chart->zoom_x) >> 8; /*Gap between the columns on ~adjacent X*/ + lv_coord_t block_w = (w + block_gap) / (chart->point_cnt); + + x_ofs += (block_w - block_gap) / 2; + w -= block_w - block_gap; + } + + p1.y = y_ofs; + for(i = 0; i <= total_tick_num; i++) { /*one extra loop - it may not exist in the list, empty label*/ + bool major = false; + if(i % t->minor_cnt == 0) major = true; + + /*draw a line at moving x position*/ + p2.x = p1.x = x_ofs + (int32_t)((int32_t)(w - line_dsc.width) * i) / total_tick_num; + + if(sec_axis) p2.y = p1.y - (major ? t->major_len : t->minor_len); + else p2.y = p1.y + (major ? t->major_len : t->minor_len); + + part_draw_dsc.p1 = &p1; + part_draw_dsc.p2 = &p2; + + /*add text only to major tick*/ + int32_t tick_value; + if(chart->type == LV_CHART_TYPE_SCATTER) { + tick_value = lv_map(i, 0, total_tick_num, chart->xmin[sec_axis], chart->xmax[sec_axis]); + } + else { + tick_value = i / t->minor_cnt; + } + part_draw_dsc.value = tick_value; + + if(major && t->label_en) { + char buf[LV_CHART_LABEL_MAX_TEXT_LENGTH]; + lv_snprintf(buf, sizeof(buf), "%" LV_PRId32, tick_value); + part_draw_dsc.label_dsc = &label_dsc; + part_draw_dsc.text = buf; + part_draw_dsc.text_length = LV_CHART_LABEL_MAX_TEXT_LENGTH; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + + /*reserve appropriate area*/ + lv_point_t size; + lv_txt_get_size(&size, part_draw_dsc.text, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, + LV_TEXT_FLAG_NONE); + + /*set the area at some distance of the major tick len under of the tick*/ + lv_area_t a; + a.x1 = (p2.x - size.x / 2); + a.x2 = (p2.x + size.x / 2); + if(sec_axis) { + a.y2 = p2.y - label_gap; + a.y1 = a.y2 - size.y; + } + else { + a.y1 = p2.y + label_gap; + a.y2 = a.y1 + size.y; + } + + if(a.x2 >= obj->coords.x1 && + a.x1 <= obj->coords.x2) { + lv_draw_label(draw_ctx, &label_dsc, &a, part_draw_dsc.text, NULL); + } + } + else { + part_draw_dsc.label_dsc = NULL; + part_draw_dsc.text = NULL; + part_draw_dsc.text_length = 0; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + } + + if(p1.x + line_dsc.width / 2 >= obj->coords.x1 && + p2.x - line_dsc.width / 2 <= obj->coords.x2) { + lv_draw_line(draw_ctx, &line_dsc, &p1, &p2); + } + + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } +} + +static void draw_axes(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx) +{ + draw_y_ticks(obj, draw_ctx, LV_CHART_AXIS_PRIMARY_Y); + draw_y_ticks(obj, draw_ctx, LV_CHART_AXIS_SECONDARY_Y); + draw_x_ticks(obj, draw_ctx, LV_CHART_AXIS_PRIMARY_X); + draw_x_ticks(obj, draw_ctx, LV_CHART_AXIS_SECONDARY_X); +} + +/** + * Get the nearest index to an X coordinate + * @param chart pointer to a chart object + * @param coord the coordination of the point relative to the series area. + * @return the found index + */ +static uint32_t get_index_from_x(lv_obj_t * obj, lv_coord_t x) +{ + lv_chart_t * chart = (lv_chart_t *)obj; + lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; + lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + x -= pad_left; + + if(x < 0) return 0; + if(x > w) return chart->point_cnt - 1; + if(chart->type == LV_CHART_TYPE_LINE) return (x * (chart->point_cnt - 1) + w / 2) / w; + if(chart->type == LV_CHART_TYPE_BAR) return (x * chart->point_cnt) / w; + + return 0; +} + +static void invalidate_point(lv_obj_t * obj, uint16_t i) +{ + lv_chart_t * chart = (lv_chart_t *)obj; + if(i >= chart->point_cnt) return; + + lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; + lv_coord_t scroll_left = lv_obj_get_scroll_left(obj); + + /*In shift mode the whole chart changes so the whole object*/ + if(chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT) { + lv_obj_invalidate(obj); + return; + } + + if(chart->type == LV_CHART_TYPE_LINE) { + lv_coord_t bwidth = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t x_ofs = obj->coords.x1 + pleft + bwidth - scroll_left; + lv_coord_t line_width = lv_obj_get_style_line_width(obj, LV_PART_ITEMS); + lv_coord_t point_w = lv_obj_get_style_width(obj, LV_PART_INDICATOR); + + lv_area_t coords; + lv_area_copy(&coords, &obj->coords); + coords.y1 -= line_width + point_w; + coords.y2 += line_width + point_w; + + if(i < chart->point_cnt - 1) { + coords.x1 = ((w * i) / (chart->point_cnt - 1)) + x_ofs - line_width - point_w; + coords.x2 = ((w * (i + 1)) / (chart->point_cnt - 1)) + x_ofs + line_width + point_w; + lv_obj_invalidate_area(obj, &coords); + } + + if(i > 0) { + coords.x1 = ((w * (i - 1)) / (chart->point_cnt - 1)) + x_ofs - line_width - point_w; + coords.x2 = ((w * i) / (chart->point_cnt - 1)) + x_ofs + line_width + point_w; + lv_obj_invalidate_area(obj, &coords); + } + } + else if(chart->type == LV_CHART_TYPE_BAR) { + lv_area_t col_a; + int32_t block_gap = ((int32_t)lv_obj_get_style_pad_column(obj, + LV_PART_MAIN) * chart->zoom_x) >> 8; /*Gap between the column on ~adjacent X*/ + + lv_coord_t block_w = (w + block_gap) / chart->point_cnt; + + lv_coord_t bwidth = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t x_act; + x_act = (int32_t)((int32_t)(block_w) * i) ; + x_act += obj->coords.x1 + bwidth + lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + + lv_obj_get_coords(obj, &col_a); + col_a.x1 = x_act - scroll_left; + col_a.x2 = col_a.x1 + block_w; + col_a.x1 -= block_gap; + + lv_obj_invalidate_area(obj, &col_a); + } + else { + lv_obj_invalidate(obj); + } +} + +static void new_points_alloc(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t cnt, lv_coord_t ** a) +{ + if((*a) == NULL) return; + + lv_chart_t * chart = (lv_chart_t *) obj; + uint32_t point_cnt_old = chart->point_cnt; + uint32_t i; + + if(ser->start_point != 0) { + lv_coord_t * new_points = lv_mem_alloc(sizeof(lv_coord_t) * cnt); + LV_ASSERT_MALLOC(new_points); + if(new_points == NULL) return; + + if(cnt >= point_cnt_old) { + for(i = 0; i < point_cnt_old; i++) { + new_points[i] = + (*a)[(i + ser->start_point) % point_cnt_old]; /*Copy old contents to new array*/ + } + for(i = point_cnt_old; i < cnt; i++) { + new_points[i] = LV_CHART_POINT_NONE; /*Fill up the rest with default value*/ + } + } + else { + for(i = 0; i < cnt; i++) { + new_points[i] = + (*a)[(i + ser->start_point) % point_cnt_old]; /*Copy old contents to new array*/ + } + } + + /*Switch over pointer from old to new*/ + lv_mem_free((*a)); + (*a) = new_points; + } + else { + (*a) = lv_mem_realloc((*a), sizeof(lv_coord_t) * cnt); + LV_ASSERT_MALLOC((*a)); + if((*a) == NULL) return; + /*Initialize the new points*/ + if(cnt > point_cnt_old) { + for(i = point_cnt_old - 1; i < cnt; i++) { + (*a)[i] = LV_CHART_POINT_NONE; + } + } + } +} + +lv_chart_tick_dsc_t * get_tick_gsc(lv_obj_t * obj, lv_chart_axis_t axis) +{ + lv_chart_t * chart = (lv_chart_t *) obj; + switch(axis) { + case LV_CHART_AXIS_PRIMARY_Y: + return &chart->tick[0]; + case LV_CHART_AXIS_PRIMARY_X: + return &chart->tick[1]; + case LV_CHART_AXIS_SECONDARY_Y: + return &chart->tick[2]; + case LV_CHART_AXIS_SECONDARY_X: + return &chart->tick[3]; + default: + return NULL; + } +} + + +#endif diff --git a/L3_Middlewares/LVGL/src/widgets/chart/lv_chart.h b/L3_Middlewares/LVGL/src/extra/widgets/chart/lv_chart.h similarity index 65% rename from L3_Middlewares/LVGL/src/widgets/chart/lv_chart.h rename to L3_Middlewares/LVGL/src/extra/widgets/chart/lv_chart.h index de25831..394c0e7 100644 --- a/L3_Middlewares/LVGL/src/widgets/chart/lv_chart.h +++ b/L3_Middlewares/LVGL/src/extra/widgets/chart/lv_chart.h @@ -13,8 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" -#include "../../core/lv_obj.h" +#include "../../../lvgl.h" #if LV_USE_CHART != 0 @@ -23,7 +22,11 @@ extern "C" { *********************/ /**Default value of points. Can be used to not draw a point*/ -#define LV_CHART_POINT_NONE (INT32_MAX) +#if LV_USE_LARGE_COORD +#define LV_CHART_POINT_NONE (INT32_MAX) +#else +#define LV_CHART_POINT_NONE (INT16_MAX) +#endif LV_EXPORT_CONST_INT(LV_CHART_POINT_NONE); /********************** @@ -33,33 +36,103 @@ LV_EXPORT_CONST_INT(LV_CHART_POINT_NONE); /** * Chart types */ -typedef enum { +enum { LV_CHART_TYPE_NONE, /**< Don't draw the series*/ LV_CHART_TYPE_LINE, /**< Connect the points with lines*/ LV_CHART_TYPE_BAR, /**< Draw columns*/ LV_CHART_TYPE_SCATTER, /**< Draw points and lines in 2D (x,y coordinates)*/ -} lv_chart_type_t; +}; +typedef uint8_t lv_chart_type_t; /** * Chart update mode for `lv_chart_set_next` */ -typedef enum { +enum { LV_CHART_UPDATE_MODE_SHIFT, /**< Shift old data to the left and add the new one the right*/ LV_CHART_UPDATE_MODE_CIRCULAR, /**< Add the new data in a circular way*/ -} lv_chart_update_mode_t; +}; +typedef uint8_t lv_chart_update_mode_t; /** * Enumeration of the axis' */ -typedef enum { +enum { LV_CHART_AXIS_PRIMARY_Y = 0x00, LV_CHART_AXIS_SECONDARY_Y = 0x01, LV_CHART_AXIS_PRIMARY_X = 0x02, LV_CHART_AXIS_SECONDARY_X = 0x04, - LV_CHART_AXIS_LAST -} lv_chart_axis_t; - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_chart_class; + _LV_CHART_AXIS_LAST +}; +typedef uint8_t lv_chart_axis_t; + +/** + * Descriptor a chart series + */ +typedef struct { + lv_coord_t * x_points; + lv_coord_t * y_points; + lv_color_t color; + uint16_t start_point; + uint8_t hidden : 1; + uint8_t x_ext_buf_assigned : 1; + uint8_t y_ext_buf_assigned : 1; + uint8_t x_axis_sec : 1; + uint8_t y_axis_sec : 1; +} lv_chart_series_t; + +typedef struct { + lv_point_t pos; + lv_coord_t point_id; + lv_color_t color; + lv_chart_series_t * ser; + lv_dir_t dir; + uint8_t pos_set: 1; /*1: pos is set; 0: point_id is set*/ +} lv_chart_cursor_t; + +typedef struct { + lv_coord_t major_len; + lv_coord_t minor_len; + lv_coord_t draw_size; + uint32_t minor_cnt : 15; + uint32_t major_cnt : 15; + uint32_t label_en : 1; +} lv_chart_tick_dsc_t; + + +typedef struct { + lv_obj_t obj; + lv_ll_t series_ll; /**< Linked list for the series (stores lv_chart_series_t)*/ + lv_ll_t cursor_ll; /**< Linked list for the cursors (stores lv_chart_cursor_t)*/ + lv_chart_tick_dsc_t tick[4]; + lv_coord_t ymin[2]; + lv_coord_t ymax[2]; + lv_coord_t xmin[2]; + lv_coord_t xmax[2]; + lv_coord_t pressed_point_id; + uint16_t hdiv_cnt; /**< Number of horizontal division lines*/ + uint16_t vdiv_cnt; /**< Number of vertical division lines*/ + uint16_t point_cnt; /**< Point number in a data line*/ + uint16_t zoom_x; + uint16_t zoom_y; + lv_chart_type_t type : 3; /**< Line or column chart*/ + lv_chart_update_mode_t update_mode : 1; +} lv_chart_t; + +extern const lv_obj_class_t lv_chart_class; + +/** + * `type` field in `lv_obj_draw_part_dsc_t` if `class_p = lv_chart_class` + * Used in `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` + */ +typedef enum { + LV_CHART_DRAW_PART_DIV_LINE_INIT, /**< Used before/after drawn the div lines*/ + LV_CHART_DRAW_PART_DIV_LINE_HOR, /**< Used for each horizontal division lines*/ + LV_CHART_DRAW_PART_DIV_LINE_VER, /**< Used for each vertical division lines*/ + LV_CHART_DRAW_PART_LINE_AND_POINT, /**< Used on line and scatter charts for lines and points*/ + LV_CHART_DRAW_PART_BAR, /**< Used on bar charts for the rectangles*/ + LV_CHART_DRAW_PART_CURSOR, /**< Used on cursor lines and points*/ + LV_CHART_DRAW_PART_TICK_LABEL, /**< Used on tick lines and labels*/ +} lv_chart_draw_part_type_t; /********************** * GLOBAL PROTOTYPES @@ -83,7 +156,7 @@ void lv_chart_set_type(lv_obj_t * obj, lv_chart_type_t type); * @param obj pointer to a chart object * @param cnt new number of points on the data lines */ -void lv_chart_set_point_count(lv_obj_t * obj, uint32_t cnt); +void lv_chart_set_point_count(lv_obj_t * obj, uint16_t cnt); /** * Set the minimal and maximal y values on an axis @@ -92,12 +165,12 @@ void lv_chart_set_point_count(lv_obj_t * obj, uint32_t cnt); * @param min minimum value of the y axis * @param max maximum value of the y axis */ -void lv_chart_set_range(lv_obj_t * obj, lv_chart_axis_t axis, int32_t min, int32_t max); +void lv_chart_set_range(lv_obj_t * obj, lv_chart_axis_t axis, lv_coord_t min, lv_coord_t max); /** * Set update mode of the chart object. Affects - * @param obj pointer to a chart object - * @param update_mode the update mode + * @param obj pointer to a chart object + * @param mode the update mode */ void lv_chart_set_update_mode(lv_obj_t * obj, lv_chart_update_mode_t update_mode); @@ -109,6 +182,49 @@ void lv_chart_set_update_mode(lv_obj_t * obj, lv_chart_update_mode_t update_mode */ void lv_chart_set_div_line_count(lv_obj_t * obj, uint8_t hdiv, uint8_t vdiv); +/** + * Zoom into the chart in X direction + * @param obj pointer to a chart object + * @param zoom_x zoom in x direction. LV_ZOOM_NONE or 256 for no zoom, 512 double zoom + */ +void lv_chart_set_zoom_x(lv_obj_t * obj, uint16_t zoom_x); + +/** + * Zoom into the chart in Y direction + * @param obj pointer to a chart object + * @param zoom_y zoom in y direction. LV_ZOOM_NONE or 256 for no zoom, 512 double zoom + */ +void lv_chart_set_zoom_y(lv_obj_t * obj, uint16_t zoom_y); + +/** + * Get X zoom of a chart + * @param obj pointer to a chart object + * @return the X zoom value + */ +uint16_t lv_chart_get_zoom_x(const lv_obj_t * obj); + +/** + * Get Y zoom of a chart + * @param obj pointer to a chart object + * @return the Y zoom value + */ +uint16_t lv_chart_get_zoom_y(const lv_obj_t * obj); + +/** + * Set the number of tick lines on an axis + * @param obj pointer to a chart object + * @param axis an axis which ticks count should be set + * @param major_len length of major ticks + * @param minor_len length of minor ticks + * @param major_cnt number of major ticks on the axis + * @param minor_cnt number of minor ticks between two major ticks + * @param label_en true: enable label drawing on major ticks + * @param draw_size extra size required to draw the tick and labels + * (start with 20 px and increase if the ticks/labels are clipped) + */ +void lv_chart_set_axis_tick(lv_obj_t * obj, lv_chart_axis_t axis, lv_coord_t major_len, lv_coord_t minor_len, + lv_coord_t major_cnt, lv_coord_t minor_cnt, bool label_en, lv_coord_t draw_size); + /** * Get the type of a chart * @param obj pointer to chart object @@ -118,31 +234,31 @@ lv_chart_type_t lv_chart_get_type(const lv_obj_t * obj); /** * Get the data point number per data line on chart - * @param obj pointer to chart object + * @param chart pointer to chart object * @return point number on each data line */ -uint32_t lv_chart_get_point_count(const lv_obj_t * obj); +uint16_t lv_chart_get_point_count(const lv_obj_t * obj); /** * Get the current index of the x-axis start point in the data array - * @param obj pointer to a chart object + * @param chart pointer to a chart object * @param ser pointer to a data series on 'chart' * @return the index of the current x start point in the data array */ -uint32_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * ser); +uint16_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * ser); /** * Get the position of a point to the chart. - * @param obj pointer to a chart object + * @param chart pointer to a chart object * @param ser pointer to series * @param id the index. * @param p_out store the result position here */ -void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, lv_point_t * p_out); +void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_point_t * p_out); /** * Refresh a chart if its data line has changed - * @param obj pointer to chart object + * @param chart pointer to chart object */ void lv_chart_refresh(lv_obj_t * obj); @@ -155,20 +271,20 @@ void lv_chart_refresh(lv_obj_t * obj); * @param obj pointer to a chart object * @param color color of the data series * @param axis the y axis to which the series should be attached (::LV_CHART_AXIS_PRIMARY_Y or ::LV_CHART_AXIS_SECONDARY_Y) - * @return pointer to the allocated data series or NULL on failure + * @return pointer to the allocated data series */ lv_chart_series_t * lv_chart_add_series(lv_obj_t * obj, lv_color_t color, lv_chart_axis_t axis); /** * Deallocate and remove a data series from a chart - * @param obj pointer to a chart object + * @param chart pointer to a chart object * @param series pointer to a data series on 'chart' */ void lv_chart_remove_series(lv_obj_t * obj, lv_chart_series_t * series); /** * Hide/Unhide a single series of a chart. - * @param chart pointer to a chart object. + * @param obj pointer to a chart object. * @param series pointer to a series object * @param hide true: hide the series */ @@ -176,20 +292,12 @@ void lv_chart_hide_series(lv_obj_t * chart, lv_chart_series_t * series, bool hid /** * Change the color of a series - * @param chart pointer to a chart object. + * @param obj pointer to a chart object. * @param series pointer to a series object * @param color the new color of the series */ void lv_chart_set_series_color(lv_obj_t * chart, lv_chart_series_t * series, lv_color_t color); -/** - * Get the color of a series - * @param chart pointer to a chart object. - * @param series pointer to a series object - * @return the color of the series - */ -lv_color_t lv_chart_get_series_color(lv_obj_t * chart, const lv_chart_series_t * series); - /** * Set the index of the x-axis start point in the data array. * This point will be considers the first (left) point and the other points will be drawn after it. @@ -197,7 +305,7 @@ lv_color_t lv_chart_get_series_color(lv_obj_t * chart, const lv_chart_series_t * * @param ser pointer to a data series on 'chart' * @param id the index of the x point in the data array */ -void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id); +void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id); /** * Get the next series. @@ -207,6 +315,8 @@ void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint32_ */ lv_chart_series_t * lv_chart_get_series_next(const lv_obj_t * chart, const lv_chart_series_t * ser); + + /*===================== * Cursor *====================*/ @@ -222,7 +332,7 @@ lv_chart_cursor_t * lv_chart_add_cursor(lv_obj_t * obj, lv_color_t color, lv_di /** * Set the coordinate of the cursor with respect to the paddings - * @param chart pointer to a chart object + * @param obj pointer to a chart object * @param cursor pointer to the cursor * @param pos the new coordinate of cursor relative to the chart */ @@ -230,17 +340,17 @@ void lv_chart_set_cursor_pos(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_po /** * Stick the cursor to a point - * @param chart pointer to a chart object + * @param obj pointer to a chart object * @param cursor pointer to the cursor * @param ser pointer to a series * @param point_id the point's index or `LV_CHART_POINT_NONE` to not assign to any points. */ void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_chart_series_t * ser, - uint32_t point_id); + uint16_t point_id); /** * Get the coordinate of the cursor with respect to the paddings - * @param chart pointer to a chart object + * @param obj pointer to a chart object * @param cursor pointer to cursor * @return coordinate of the cursor as lv_point_t */ @@ -256,7 +366,7 @@ lv_point_t lv_chart_get_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * curso * @param ser pointer to a data series on 'chart' * @param value the new value for all points. `LV_CHART_POINT_NONE` can be used to hide the points. */ -void lv_chart_set_all_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value); +void lv_chart_set_all_value(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_t value); /** * Set the next point's Y value according to the update mode policy. @@ -264,7 +374,7 @@ void lv_chart_set_all_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t val * @param ser pointer to a data series on 'chart' * @param value the new value of the next data */ -void lv_chart_set_next_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value); +void lv_chart_set_next_value(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_t value); /** * Set the next point's X and Y value according to the update mode policy. @@ -273,7 +383,7 @@ void lv_chart_set_next_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t va * @param x_value the new X value of the next data * @param y_value the new Y value of the next data */ -void lv_chart_set_next_value2(lv_obj_t * obj, lv_chart_series_t * ser, int32_t x_value, int32_t y_value); +void lv_chart_set_next_value2(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_t x_value, lv_coord_t y_value); /** * Set an individual point's y value of a chart's series directly based on its index @@ -282,7 +392,7 @@ void lv_chart_set_next_value2(lv_obj_t * obj, lv_chart_series_t * ser, int32_t x * @param id the index of the x point in the array * @param value value to assign to array point */ -void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, int32_t value); +void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_coord_t value); /** * Set an individual point's x and y value of a chart's series directly based on its index @@ -293,8 +403,8 @@ void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t * @param x_value the new X value of the next data * @param y_value the new Y value of the next data */ -void lv_chart_set_value_by_id2(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, int32_t x_value, - int32_t y_value); +void lv_chart_set_value_by_id2(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_coord_t x_value, + lv_coord_t y_value); /** * Set an external array for the y data points to use for the chart @@ -303,7 +413,7 @@ void lv_chart_set_value_by_id2(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t * @param ser pointer to a data series on 'chart' * @param array external array of points for chart */ -void lv_chart_set_ext_y_array(lv_obj_t * obj, lv_chart_series_t * ser, int32_t array[]); +void lv_chart_set_ext_y_array(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_t array[]); /** * Set an external array for the x data points to use for the chart @@ -312,7 +422,7 @@ void lv_chart_set_ext_y_array(lv_obj_t * obj, lv_chart_series_t * ser, int32_t a * @param ser pointer to a data series on 'chart' * @param array external array of points for chart */ -void lv_chart_set_ext_x_array(lv_obj_t * obj, lv_chart_series_t * ser, int32_t array[]); +void lv_chart_set_ext_x_array(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_t array[]); /** * Get the array of y values of a series @@ -320,7 +430,7 @@ void lv_chart_set_ext_x_array(lv_obj_t * obj, lv_chart_series_t * ser, int32_t a * @param ser pointer to a data series on 'chart' * @return the array of values with 'point_count' elements */ -int32_t * lv_chart_get_y_array(const lv_obj_t * obj, lv_chart_series_t * ser); +lv_coord_t * lv_chart_get_y_array(const lv_obj_t * obj, lv_chart_series_t * ser); /** * Get the array of x values of a series @@ -328,7 +438,7 @@ int32_t * lv_chart_get_y_array(const lv_obj_t * obj, lv_chart_series_t * ser); * @param ser pointer to a data series on 'chart' * @return the array of values with 'point_count' elements */ -int32_t * lv_chart_get_x_array(const lv_obj_t * obj, lv_chart_series_t * ser); +lv_coord_t * lv_chart_get_x_array(const lv_obj_t * obj, lv_chart_series_t * ser); /** * Get the index of the currently pressed point. It's the same for every series. @@ -337,14 +447,6 @@ int32_t * lv_chart_get_x_array(const lv_obj_t * obj, lv_chart_series_t * ser); */ uint32_t lv_chart_get_pressed_point(const lv_obj_t * obj); -/** - * Get the overall offset from the chart's side to the center of the first point. - * In case of a bar chart it will be the center of the first column group - * @param obj pointer to a chart object - * @return the offset of the center - */ -int32_t lv_chart_get_first_point_center_offset(lv_obj_t * obj); - /********************** * MACROS **********************/ diff --git a/L3_Middlewares/LVGL/src/extra/widgets/colorwheel/lv_colorwheel.c b/L3_Middlewares/LVGL/src/extra/widgets/colorwheel/lv_colorwheel.c new file mode 100644 index 0000000..daf112e --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/colorwheel/lv_colorwheel.c @@ -0,0 +1,713 @@ +/** + * @file lv_colorwheel.c + * + * Based on the work of @AloyseTech and @paulpv. + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_colorwheel.h" +#if LV_USE_COLORWHEEL + +#include "../../../misc/lv_assert.h" + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_colorwheel_class + +#define LV_CPICKER_DEF_QF 3 + +/** + * The OUTER_MASK_WIDTH define is required to assist with the placing of a mask over the outer ring of the widget as when the + * multicoloured radial lines are calculated for the outer ring of the widget their lengths are jittering because of the + * integer based arithmetic. From tests the maximum delta was found to be 2 so the current value is set to 3 to achieve + * appropriate masking. + */ +#define OUTER_MASK_WIDTH 3 + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_colorwheel_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_colorwheel_event(const lv_obj_class_t * class_p, lv_event_t * e); + +static void draw_disc_grad(lv_event_t * e); +static void draw_knob(lv_event_t * e); +static void invalidate_knob(lv_obj_t * obj); +static lv_area_t get_knob_area(lv_obj_t * obj); + +static void next_color_mode(lv_obj_t * obj); +static lv_res_t double_click_reset(lv_obj_t * obj); +static void refr_knob_pos(lv_obj_t * obj); +static lv_color_t angle_to_mode_color_fast(lv_obj_t * obj, uint16_t angle); +static uint16_t get_angle(lv_obj_t * obj); + +/********************** + * STATIC VARIABLES + **********************/ +const lv_obj_class_t lv_colorwheel_class = {.instance_size = sizeof(lv_colorwheel_t), .base_class = &lv_obj_class, + .constructor_cb = lv_colorwheel_constructor, + .event_cb = lv_colorwheel_event, + .width_def = LV_DPI_DEF * 2, + .height_def = LV_DPI_DEF * 2, + .editable = LV_OBJ_CLASS_EDITABLE_TRUE, + }; + +static bool create_knob_recolor; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Create a color_picker object + * @param parent pointer to an object, it will be the parent of the new color_picker + * @return pointer to the created color_picker + */ +lv_obj_t * lv_colorwheel_create(lv_obj_t * parent, bool knob_recolor) +{ + LV_LOG_INFO("begin"); + create_knob_recolor = knob_recolor; + + lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); + lv_obj_class_init_obj(obj); + return obj; +} + +/*===================== + * Setter functions + *====================*/ + +/** + * Set the current hsv of a color wheel. + * @param colorwheel pointer to color wheel object + * @param color current selected hsv + * @return true if changed, otherwise false + */ +bool lv_colorwheel_set_hsv(lv_obj_t * obj, lv_color_hsv_t hsv) +{ + if(hsv.h > 360) hsv.h %= 360; + if(hsv.s > 100) hsv.s = 100; + if(hsv.v > 100) hsv.v = 100; + + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + + if(colorwheel->hsv.h == hsv.h && colorwheel->hsv.s == hsv.s && colorwheel->hsv.v == hsv.v) return false; + + colorwheel->hsv = hsv; + + refr_knob_pos(obj); + + lv_obj_invalidate(obj); + + return true; +} + +/** + * Set the current color of a color wheel. + * @param colorwheel pointer to color wheel object + * @param color current selected color + * @return true if changed, otherwise false + */ +bool lv_colorwheel_set_rgb(lv_obj_t * obj, lv_color_t color) +{ + lv_color32_t c32; + c32.full = lv_color_to32(color); + + return lv_colorwheel_set_hsv(obj, lv_color_rgb_to_hsv(c32.ch.red, c32.ch.green, c32.ch.blue)); +} + +/** + * Set the current color mode. + * @param colorwheel pointer to color wheel object + * @param mode color mode (hue/sat/val) + */ +void lv_colorwheel_set_mode(lv_obj_t * obj, lv_colorwheel_mode_t mode) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + + colorwheel->mode = mode; + refr_knob_pos(obj); + lv_obj_invalidate(obj); +} + +/** + * Set if the color mode is changed on long press on center + * @param colorwheel pointer to color wheel object + * @param fixed color mode cannot be changed on long press + */ +void lv_colorwheel_set_mode_fixed(lv_obj_t * obj, bool fixed) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + + colorwheel->mode_fixed = fixed; +} + +/*===================== + * Getter functions + *====================*/ + + +/** + * Get the current selected hsv of a color wheel. + * @param colorwheel pointer to color wheel object + * @return current selected hsv + */ +lv_color_hsv_t lv_colorwheel_get_hsv(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + + return colorwheel->hsv; +} + +/** + * Get the current selected color of a color wheel. + * @param colorwheel pointer to color wheel object + * @return color current selected color + */ +lv_color_t lv_colorwheel_get_rgb(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + + return lv_color_hsv_to_rgb(colorwheel->hsv.h, colorwheel->hsv.s, colorwheel->hsv.v); +} + +/** + * Get the current color mode. + * @param colorwheel pointer to color wheel object + * @return color mode (hue/sat/val) + */ +lv_colorwheel_mode_t lv_colorwheel_get_color_mode(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + + return colorwheel->mode; +} + +/** + * Get if the color mode is changed on long press on center + * @param colorwheel pointer to color wheel object + * @return mode cannot be changed on long press + */ +bool lv_colorwheel_get_color_mode_fixed(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + + return colorwheel->mode_fixed; +} + +/*===================== + * Other functions + *====================*/ + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_colorwheel_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + colorwheel->hsv.h = 0; + colorwheel->hsv.s = 100; + colorwheel->hsv.v = 100; + colorwheel->mode = LV_COLORWHEEL_MODE_HUE; + colorwheel->mode_fixed = 0; + colorwheel->last_click_time = 0; + colorwheel->last_change_time = 0; + colorwheel->knob.recolor = create_knob_recolor; + + lv_obj_add_flag(obj, LV_OBJ_FLAG_ADV_HITTEST); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN); + refr_knob_pos(obj); +} + +static void draw_disc_grad(lv_event_t * e) +{ + lv_obj_t * obj = lv_event_get_target(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); + lv_coord_t w = lv_obj_get_width(obj); + lv_coord_t h = lv_obj_get_height(obj); + lv_coord_t cx = obj->coords.x1 + w / 2; + lv_coord_t cy = obj->coords.y1 + h / 2; + lv_coord_t r = w / 2; + + lv_draw_line_dsc_t line_dsc; + lv_draw_line_dsc_init(&line_dsc); + lv_obj_init_draw_line_dsc(obj, LV_PART_MAIN, &line_dsc); + + line_dsc.width = (r * 628 / (256 / LV_CPICKER_DEF_QF)) / 100; + line_dsc.width += 2; + uint16_t i; + uint32_t a = 0; + lv_coord_t cir_w = lv_obj_get_style_arc_width(obj, LV_PART_MAIN); + +#if LV_DRAW_COMPLEX + /*Mask outer and inner ring of widget to tidy up ragged edges of lines while drawing outer ring*/ + lv_draw_mask_radius_param_t mask_out_param; + lv_draw_mask_radius_init(&mask_out_param, &obj->coords, LV_RADIUS_CIRCLE, false); + int16_t mask_out_id = lv_draw_mask_add(&mask_out_param, 0); + + lv_area_t mask_area; + lv_area_copy(&mask_area, &obj->coords); + mask_area.x1 += cir_w; + mask_area.x2 -= cir_w; + mask_area.y1 += cir_w; + mask_area.y2 -= cir_w; + lv_draw_mask_radius_param_t mask_in_param; + lv_draw_mask_radius_init(&mask_in_param, &mask_area, LV_RADIUS_CIRCLE, true); + int16_t mask_in_id = lv_draw_mask_add(&mask_in_param, 0); + + /*The inner and outer line ends will be masked out. + *So make lines a little bit longer because the masking makes a more even result*/ + lv_coord_t cir_w_extra = line_dsc.width; +#else + lv_coord_t cir_w_extra = 0; +#endif + + for(i = 0; i <= 256; i += LV_CPICKER_DEF_QF, a += 360 * LV_CPICKER_DEF_QF) { + line_dsc.color = angle_to_mode_color_fast(obj, i); + uint16_t angle_trigo = (uint16_t)(a >> 8); /*i * 360 / 256 is the scale to apply, but we can skip multiplication here*/ + + lv_point_t p[2]; + p[0].x = cx + ((r + cir_w_extra) * lv_trigo_sin(angle_trigo) >> LV_TRIGO_SHIFT); + p[0].y = cy + ((r + cir_w_extra) * lv_trigo_cos(angle_trigo) >> LV_TRIGO_SHIFT); + p[1].x = cx + ((r - cir_w - cir_w_extra) * lv_trigo_sin(angle_trigo) >> LV_TRIGO_SHIFT); + p[1].y = cy + ((r - cir_w - cir_w_extra) * lv_trigo_cos(angle_trigo) >> LV_TRIGO_SHIFT); + + lv_draw_line(draw_ctx, &line_dsc, &p[0], &p[1]); + } + +#if LV_DRAW_COMPLEX + lv_draw_mask_free_param(&mask_out_param); + lv_draw_mask_free_param(&mask_in_param); + lv_draw_mask_remove_id(mask_out_id); + lv_draw_mask_remove_id(mask_in_id); +#endif +} + +static void draw_knob(lv_event_t * e) +{ + lv_obj_t * obj = lv_event_get_target(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + + lv_draw_rect_dsc_t cir_dsc; + lv_draw_rect_dsc_init(&cir_dsc); + lv_obj_init_draw_rect_dsc(obj, LV_PART_KNOB, &cir_dsc); + + cir_dsc.radius = LV_RADIUS_CIRCLE; + + if(colorwheel->knob.recolor) { + cir_dsc.bg_color = lv_colorwheel_get_rgb(obj); + } + + lv_area_t knob_area = get_knob_area(obj); + + lv_draw_rect(draw_ctx, &cir_dsc, &knob_area); +} + +static void invalidate_knob(lv_obj_t * obj) +{ + lv_area_t knob_area = get_knob_area(obj); + + lv_obj_invalidate_area(obj, &knob_area); +} + +static lv_area_t get_knob_area(lv_obj_t * obj) +{ + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + + /*Get knob's radius*/ + uint16_t r = 0; + r = lv_obj_get_style_arc_width(obj, LV_PART_MAIN) / 2; + + lv_coord_t left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); + lv_coord_t right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); + lv_coord_t top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); + lv_coord_t bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); + + lv_area_t knob_area; + knob_area.x1 = obj->coords.x1 + colorwheel->knob.pos.x - r - left; + knob_area.y1 = obj->coords.y1 + colorwheel->knob.pos.y - r - right; + knob_area.x2 = obj->coords.x1 + colorwheel->knob.pos.x + r + top; + knob_area.y2 = obj->coords.y1 + colorwheel->knob.pos.y + r + bottom; + + return knob_area; +} + +static void lv_colorwheel_event(const lv_obj_class_t * class_p, lv_event_t * e) +{ + LV_UNUSED(class_p); + + /*Call the ancestor's event handler*/ + lv_res_t res = lv_obj_event_base(MY_CLASS, e); + + if(res != LV_RES_OK) return; + + lv_event_code_t code = lv_event_get_code(e); + lv_obj_t * obj = lv_event_get_target(e); + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + + if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { + lv_coord_t left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); + lv_coord_t right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); + lv_coord_t top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); + lv_coord_t bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); + + lv_coord_t knob_pad = LV_MAX4(left, right, top, bottom) + 2; + lv_coord_t * s = lv_event_get_param(e); + *s = LV_MAX(*s, knob_pad); + } + else if(code == LV_EVENT_SIZE_CHANGED) { + void * param = lv_event_get_param(e); + /*Refresh extended draw area to make knob visible*/ + if(lv_obj_get_width(obj) != lv_area_get_width(param) || + lv_obj_get_height(obj) != lv_area_get_height(param)) { + refr_knob_pos(obj); + } + } + else if(code == LV_EVENT_STYLE_CHANGED) { + /*Refresh extended draw area to make knob visible*/ + refr_knob_pos(obj); + } + else if(code == LV_EVENT_KEY) { + uint32_t c = *((uint32_t *)lv_event_get_param(e)); /*uint32_t because can be UTF-8*/ + + if(c == LV_KEY_RIGHT || c == LV_KEY_UP) { + lv_color_hsv_t hsv_cur; + hsv_cur = colorwheel->hsv; + + switch(colorwheel->mode) { + case LV_COLORWHEEL_MODE_HUE: + hsv_cur.h = (colorwheel->hsv.h + 1) % 360; + break; + case LV_COLORWHEEL_MODE_SATURATION: + hsv_cur.s = (colorwheel->hsv.s + 1) % 100; + break; + case LV_COLORWHEEL_MODE_VALUE: + hsv_cur.v = (colorwheel->hsv.v + 1) % 100; + break; + } + + if(lv_colorwheel_set_hsv(obj, hsv_cur)) { + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return; + } + } + else if(c == LV_KEY_LEFT || c == LV_KEY_DOWN) { + lv_color_hsv_t hsv_cur; + hsv_cur = colorwheel->hsv; + + switch(colorwheel->mode) { + case LV_COLORWHEEL_MODE_HUE: + hsv_cur.h = colorwheel->hsv.h > 0 ? (colorwheel->hsv.h - 1) : 360; + break; + case LV_COLORWHEEL_MODE_SATURATION: + hsv_cur.s = colorwheel->hsv.s > 0 ? (colorwheel->hsv.s - 1) : 100; + break; + case LV_COLORWHEEL_MODE_VALUE: + hsv_cur.v = colorwheel->hsv.v > 0 ? (colorwheel->hsv.v - 1) : 100; + break; + } + + if(lv_colorwheel_set_hsv(obj, hsv_cur)) { + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return; + } + } + } + else if(code == LV_EVENT_PRESSED) { + colorwheel->last_change_time = lv_tick_get(); + lv_indev_get_point(lv_indev_get_act(), &colorwheel->last_press_point); + res = double_click_reset(obj); + if(res != LV_RES_OK) return; + } + else if(code == LV_EVENT_PRESSING) { + lv_indev_t * indev = lv_indev_get_act(); + if(indev == NULL) return; + + lv_indev_type_t indev_type = lv_indev_get_type(indev); + lv_point_t p; + if(indev_type == LV_INDEV_TYPE_ENCODER || indev_type == LV_INDEV_TYPE_KEYPAD) { + p.x = obj->coords.x1 + lv_obj_get_width(obj) / 2; + p.y = obj->coords.y1 + lv_obj_get_height(obj) / 2; + } + else { + lv_indev_get_point(indev, &p); + } + + lv_coord_t drag_limit = indev->driver->scroll_limit; + if((LV_ABS(p.x - colorwheel->last_press_point.x) > drag_limit) || + (LV_ABS(p.y - colorwheel->last_press_point.y) > drag_limit)) { + colorwheel->last_change_time = lv_tick_get(); + colorwheel->last_press_point.x = p.x; + colorwheel->last_press_point.y = p.y; + } + + p.x -= obj->coords.x1; + p.y -= obj->coords.y1; + + /*Ignore pressing in the inner area*/ + uint16_t w = lv_obj_get_width(obj); + + int16_t angle = 0; + lv_coord_t cir_w = lv_obj_get_style_arc_width(obj, LV_PART_MAIN); + + lv_coord_t r_in = w / 2; + p.x -= r_in; + p.y -= r_in; + bool on_ring = true; + r_in -= cir_w; + if(r_in > LV_DPI_DEF / 2) { + lv_coord_t inner = cir_w / 2; + r_in -= inner; + + if(r_in < LV_DPI_DEF / 2) r_in = LV_DPI_DEF / 2; + } + + if(p.x * p.x + p.y * p.y < r_in * r_in) { + on_ring = false; + } + + /*If the inner area is being pressed, go to the next color mode on long press*/ + uint32_t diff = lv_tick_elaps(colorwheel->last_change_time); + if(!on_ring && diff > indev->driver->long_press_time && !colorwheel->mode_fixed) { + next_color_mode(obj); + lv_indev_wait_release(lv_indev_get_act()); + return; + } + + /*Set the angle only if pressed on the ring*/ + if(!on_ring) return; + + angle = lv_atan2(p.x, p.y) % 360; + + lv_color_hsv_t hsv_cur; + hsv_cur = colorwheel->hsv; + + switch(colorwheel->mode) { + case LV_COLORWHEEL_MODE_HUE: + hsv_cur.h = angle; + break; + case LV_COLORWHEEL_MODE_SATURATION: + hsv_cur.s = (angle * 100) / 360; + break; + case LV_COLORWHEEL_MODE_VALUE: + hsv_cur.v = (angle * 100) / 360; + break; + } + + if(lv_colorwheel_set_hsv(obj, hsv_cur)) { + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return; + } + } + else if(code == LV_EVENT_HIT_TEST) { + lv_hit_test_info_t * info = lv_event_get_param(e);; + + /*Valid clicks can be only in the circle*/ + info->res = _lv_area_is_point_on(&obj->coords, info->point, LV_RADIUS_CIRCLE); + } + else if(code == LV_EVENT_DRAW_MAIN) { + draw_disc_grad(e); + draw_knob(e); + } + else if(code == LV_EVENT_COVER_CHECK) { + lv_cover_check_info_t * info = lv_event_get_param(e); + if(info->res != LV_COVER_RES_MASKED) info->res = LV_COVER_RES_NOT_COVER; + } +} + + + +static void next_color_mode(lv_obj_t * obj) +{ + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + colorwheel->mode = (colorwheel->mode + 1) % 3; + refr_knob_pos(obj); + lv_obj_invalidate(obj); +} + +static void refr_knob_pos(lv_obj_t * obj) +{ + invalidate_knob(obj); + + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + lv_coord_t w = lv_obj_get_width(obj); + + lv_coord_t scale_w = lv_obj_get_style_arc_width(obj, LV_PART_MAIN); + lv_coord_t r = (w - scale_w) / 2; + uint16_t angle = get_angle(obj); + colorwheel->knob.pos.x = (((int32_t)r * lv_trigo_sin(angle)) >> LV_TRIGO_SHIFT); + colorwheel->knob.pos.y = (((int32_t)r * lv_trigo_cos(angle)) >> LV_TRIGO_SHIFT); + colorwheel->knob.pos.x = colorwheel->knob.pos.x + w / 2; + colorwheel->knob.pos.y = colorwheel->knob.pos.y + w / 2; + + invalidate_knob(obj); +} + +static lv_res_t double_click_reset(lv_obj_t * obj) +{ + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + lv_indev_t * indev = lv_indev_get_act(); + /*Double clicked? Use long press time as double click time out*/ + if(lv_tick_elaps(colorwheel->last_click_time) < indev->driver->long_press_time) { + lv_color_hsv_t hsv_cur; + hsv_cur = colorwheel->hsv; + + switch(colorwheel->mode) { + case LV_COLORWHEEL_MODE_HUE: + hsv_cur.h = 0; + break; + case LV_COLORWHEEL_MODE_SATURATION: + hsv_cur.s = 100; + break; + case LV_COLORWHEEL_MODE_VALUE: + hsv_cur.v = 100; + break; + } + + lv_indev_wait_release(indev); + + if(lv_colorwheel_set_hsv(obj, hsv_cur)) { + lv_res_t res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return res; + } + } + colorwheel->last_click_time = lv_tick_get(); + + return LV_RES_OK; +} + +#define SWAPPTR(A, B) do { uint8_t * t = A; A = B; B = t; } while(0) +#define HSV_PTR_SWAP(sextant,r,g,b) if((sextant) & 2) { SWAPPTR((r), (b)); } if((sextant) & 4) { SWAPPTR((g), (b)); } if(!((sextant) & 6)) { \ + if(!((sextant) & 1)) { SWAPPTR((r), (g)); } } else { if((sextant) & 1) { SWAPPTR((r), (g)); } } + +/** + * Based on the idea from https://www.vagrearg.org/content/hsvrgb + * Here we want to compute an approximate RGB value from a HSV input color space. We don't want to be accurate + * (for that, there's lv_color_hsv_to_rgb), but we want to be fast. + * + * Few tricks are used here: Hue is in range [0; 6 * 256] (so that the sextant is in the high byte and the fractional part is in the low byte) + * both s and v are in [0; 255] range (very convenient to avoid divisions). + * + * We fold all symmetry by swapping the R, G, B pointers so that the code is the same for all sextants. + * We replace division by 255 by a division by 256, a.k.a a shift right by 8 bits. + * This is wrong, but since this is only used to compute the pixels on the screen and not the final color, it's ok. + */ +static void fast_hsv2rgb(uint16_t h, uint8_t s, uint8_t v, uint8_t * r, uint8_t * g, uint8_t * b) +{ + if(!s) { + *r = *g = *b = v; + return; + } + + uint8_t sextant = h >> 8; + HSV_PTR_SWAP(sextant, r, g, b); /*Swap pointers so the conversion code is the same*/ + + *g = v; + + uint8_t bb = ~s; + uint16_t ww = v * bb; /*Don't try to be precise, but instead, be fast*/ + *b = ww >> 8; + + uint8_t h_frac = h & 0xff; + + if(!(sextant & 1)) { + /*Up slope*/ + ww = !h_frac ? ((uint16_t)s << 8) : (s * (uint8_t)(-h_frac)); /*Skip multiply if not required*/ + } + else { + /*Down slope*/ + ww = s * h_frac; + } + bb = ww >> 8; + bb = ~bb; + ww = v * bb; + *r = ww >> 8; +} + +static lv_color_t angle_to_mode_color_fast(lv_obj_t * obj, uint16_t angle) +{ + lv_colorwheel_t * ext = (lv_colorwheel_t *)obj; + uint8_t r = 0, g = 0, b = 0; + static uint16_t h = 0; + static uint8_t s = 0, v = 0, m = 255; + static uint16_t angle_saved = 0xffff; + + /*If the angle is different recalculate scaling*/ + if(angle_saved != angle) m = 255; + angle_saved = angle; + + switch(ext->mode) { + default: + case LV_COLORWHEEL_MODE_HUE: + /*Don't recompute costly scaling if it does not change*/ + if(m != ext->mode) { + s = (uint8_t)(((uint16_t)ext->hsv.s * 51) / 20); + v = (uint8_t)(((uint16_t)ext->hsv.v * 51) / 20); + m = ext->mode; + } + fast_hsv2rgb(angle * 6, s, v, &r, &g, + &b); /*A smart compiler will replace x * 6 by (x << 2) + (x << 1) if it's more efficient*/ + break; + case LV_COLORWHEEL_MODE_SATURATION: + /*Don't recompute costly scaling if it does not change*/ + if(m != ext->mode) { + h = (uint16_t)(((uint32_t)ext->hsv.h * 6 * 256) / 360); + v = (uint8_t)(((uint16_t)ext->hsv.v * 51) / 20); + m = ext->mode; + } + fast_hsv2rgb(h, angle, v, &r, &g, &b); + break; + case LV_COLORWHEEL_MODE_VALUE: + /*Don't recompute costly scaling if it does not change*/ + if(m != ext->mode) { + h = (uint16_t)(((uint32_t)ext->hsv.h * 6 * 256) / 360); + s = (uint8_t)(((uint16_t)ext->hsv.s * 51) / 20); + m = ext->mode; + } + fast_hsv2rgb(h, s, angle, &r, &g, &b); + break; + } + return lv_color_make(r, g, b); +} + +static uint16_t get_angle(lv_obj_t * obj) +{ + lv_colorwheel_t * colorwheel = (lv_colorwheel_t *)obj; + uint16_t angle; + switch(colorwheel->mode) { + default: + case LV_COLORWHEEL_MODE_HUE: + angle = colorwheel->hsv.h; + break; + case LV_COLORWHEEL_MODE_SATURATION: + angle = (colorwheel->hsv.s * 360) / 100; + break; + case LV_COLORWHEEL_MODE_VALUE: + angle = (colorwheel->hsv.v * 360) / 100 ; + break; + } + return angle; +} + +#endif /*LV_USE_COLORWHEEL*/ diff --git a/L3_Middlewares/LVGL/src/extra/widgets/colorwheel/lv_colorwheel.h b/L3_Middlewares/LVGL/src/extra/widgets/colorwheel/lv_colorwheel.h new file mode 100644 index 0000000..e9c9d92 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/colorwheel/lv_colorwheel.h @@ -0,0 +1,142 @@ +/** + * @file lv_colorwheel.h + * + */ + +#ifndef LV_COLORWHEEL_H +#define LV_COLORWHEEL_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" + +#if LV_USE_COLORWHEEL + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +enum { + LV_COLORWHEEL_MODE_HUE, + LV_COLORWHEEL_MODE_SATURATION, + LV_COLORWHEEL_MODE_VALUE +}; +typedef uint8_t lv_colorwheel_mode_t; + + +/*Data of color picker*/ +typedef struct { + lv_obj_t obj; + lv_color_hsv_t hsv; + struct { + lv_point_t pos; + uint8_t recolor : 1; + } knob; + uint32_t last_click_time; + uint32_t last_change_time; + lv_point_t last_press_point; + lv_colorwheel_mode_t mode : 2; + uint8_t mode_fixed : 1; +} lv_colorwheel_t; + +extern const lv_obj_class_t lv_colorwheel_class; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create a color picker object with disc shape + * @param parent pointer to an object, it will be the parent of the new color picker + * @param knob_recolor true: set the knob's color to the current color + * @return pointer to the created color picker + */ +lv_obj_t * lv_colorwheel_create(lv_obj_t * parent, bool knob_recolor); + +/*===================== + * Setter functions + *====================*/ + +/** + * Set the current hsv of a color wheel. + * @param colorwheel pointer to color wheel object + * @param color current selected hsv + * @return true if changed, otherwise false + */ +bool lv_colorwheel_set_hsv(lv_obj_t * obj, lv_color_hsv_t hsv); + +/** + * Set the current color of a color wheel. + * @param colorwheel pointer to color wheel object + * @param color current selected color + * @return true if changed, otherwise false + */ +bool lv_colorwheel_set_rgb(lv_obj_t * obj, lv_color_t color); + +/** + * Set the current color mode. + * @param colorwheel pointer to color wheel object + * @param mode color mode (hue/sat/val) + */ +void lv_colorwheel_set_mode(lv_obj_t * obj, lv_colorwheel_mode_t mode); + +/** + * Set if the color mode is changed on long press on center + * @param colorwheel pointer to color wheel object + * @param fixed color mode cannot be changed on long press + */ +void lv_colorwheel_set_mode_fixed(lv_obj_t * obj, bool fixed); + +/*===================== + * Getter functions + *====================*/ + +/** + * Get the current selected hsv of a color wheel. + * @param colorwheel pointer to color wheel object + * @return current selected hsv + */ +lv_color_hsv_t lv_colorwheel_get_hsv(lv_obj_t * obj); + +/** + * Get the current selected color of a color wheel. + * @param colorwheel pointer to color wheel object + * @return color current selected color + */ +lv_color_t lv_colorwheel_get_rgb(lv_obj_t * obj); + +/** + * Get the current color mode. + * @param colorwheel pointer to color wheel object + * @return color mode (hue/sat/val) + */ +lv_colorwheel_mode_t lv_colorwheel_get_color_mode(lv_obj_t * obj); + +/** + * Get if the color mode is changed on long press on center + * @param colorwheel pointer to color wheel object + * @return mode cannot be changed on long press + */ +bool lv_colorwheel_get_color_mode_fixed(lv_obj_t * obj); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_COLORWHEEL*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_COLORWHEEL_H*/ + diff --git a/L3_Middlewares/LVGL/src/extra/widgets/imgbtn/lv_imgbtn.c b/L3_Middlewares/LVGL/src/extra/widgets/imgbtn/lv_imgbtn.c new file mode 100644 index 0000000..06c68fb --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/imgbtn/lv_imgbtn.c @@ -0,0 +1,386 @@ +/** + * @file lv_imgbtn.c + * + */ + +/********************* + * INCLUDES + *********************/ + +#include "lv_imgbtn.h" + +#if LV_USE_IMGBTN != 0 + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_imgbtn_class + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_imgbtn_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void draw_main(lv_event_t * e); +static void lv_imgbtn_event(const lv_obj_class_t * class_p, lv_event_t * e); +static void refr_img(lv_obj_t * imgbtn); +static lv_imgbtn_state_t suggest_state(lv_obj_t * imgbtn, lv_imgbtn_state_t state); +lv_imgbtn_state_t get_state(const lv_obj_t * imgbtn); + +/********************** + * STATIC VARIABLES + **********************/ +const lv_obj_class_t lv_imgbtn_class = { + .base_class = &lv_obj_class, + .instance_size = sizeof(lv_imgbtn_t), + .constructor_cb = lv_imgbtn_constructor, + .event_cb = lv_imgbtn_event, +}; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Create an image button object + * @param parent pointer to an object, it will be the parent of the new image button + * @return pointer to the created image button + */ +lv_obj_t * lv_imgbtn_create(lv_obj_t * parent) +{ + LV_LOG_INFO("begin"); + lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); + lv_obj_class_init_obj(obj); + return obj; +} + +/*===================== + * Setter functions + *====================*/ + +/** + * Set images for a state of the image button + * @param obj pointer to an image button object + * @param state for which state set the new image + * @param src_left pointer to an image source for the left side of the button (a C array or path to + * a file) + * @param src_mid pointer to an image source for the middle of the button (ideally 1px wide) (a C + * array or path to a file) + * @param src_right pointer to an image source for the right side of the button (a C array or path + * to a file) + */ +void lv_imgbtn_set_src(lv_obj_t * obj, lv_imgbtn_state_t state, const void * src_left, const void * src_mid, + const void * src_right) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_imgbtn_t * imgbtn = (lv_imgbtn_t *)obj; + + imgbtn->img_src_left[state] = src_left; + imgbtn->img_src_mid[state] = src_mid; + imgbtn->img_src_right[state] = src_right; + + refr_img(obj); +} + +void lv_imgbtn_set_state(lv_obj_t * obj, lv_imgbtn_state_t state) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_state_t obj_state = LV_STATE_DEFAULT; + if(state == LV_IMGBTN_STATE_PRESSED || state == LV_IMGBTN_STATE_CHECKED_PRESSED) obj_state |= LV_STATE_PRESSED; + if(state == LV_IMGBTN_STATE_DISABLED || state == LV_IMGBTN_STATE_CHECKED_DISABLED) obj_state |= LV_STATE_DISABLED; + if(state == LV_IMGBTN_STATE_CHECKED_DISABLED || state == LV_IMGBTN_STATE_CHECKED_PRESSED || + state == LV_IMGBTN_STATE_CHECKED_RELEASED) { + obj_state |= LV_STATE_CHECKED; + } + + lv_obj_clear_state(obj, LV_STATE_CHECKED | LV_STATE_PRESSED | LV_STATE_DISABLED); + lv_obj_add_state(obj, obj_state); + + refr_img(obj); +} + +/*===================== + * Getter functions + *====================*/ + + +/** + * Get the left image in a given state + * @param obj pointer to an image button object + * @param state the state where to get the image (from `lv_btn_state_t`) ` + * @return pointer to the left image source (a C array or path to a file) + */ +const void * lv_imgbtn_get_src_left(lv_obj_t * obj, lv_imgbtn_state_t state) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_imgbtn_t * imgbtn = (lv_imgbtn_t *)obj; + + return imgbtn->img_src_left[state]; +} + +/** + * Get the middle image in a given state + * @param obj pointer to an image button object + * @param state the state where to get the image (from `lv_btn_state_t`) ` + * @return pointer to the middle image source (a C array or path to a file) + */ +const void * lv_imgbtn_get_src_middle(lv_obj_t * obj, lv_imgbtn_state_t state) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_imgbtn_t * imgbtn = (lv_imgbtn_t *)obj; + + return imgbtn->img_src_mid[state]; +} + +/** + * Get the right image in a given state + * @param obj pointer to an image button object + * @param state the state where to get the image (from `lv_btn_state_t`) ` + * @return pointer to the left image source (a C array or path to a file) + */ +const void * lv_imgbtn_get_src_right(lv_obj_t * obj, lv_imgbtn_state_t state) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_imgbtn_t * imgbtn = (lv_imgbtn_t *)obj; + + return imgbtn->img_src_right[state]; +} + + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_imgbtn_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + lv_imgbtn_t * imgbtn = (lv_imgbtn_t *)obj; + /*Initialize the allocated 'ext'*/ + lv_memset_00((void *)imgbtn->img_src_mid, sizeof(imgbtn->img_src_mid)); + lv_memset_00(imgbtn->img_src_left, sizeof(imgbtn->img_src_left)); + lv_memset_00(imgbtn->img_src_right, sizeof(imgbtn->img_src_right)); + + imgbtn->act_cf = LV_IMG_CF_UNKNOWN; +} + + +static void lv_imgbtn_event(const lv_obj_class_t * class_p, lv_event_t * e) +{ + LV_UNUSED(class_p); + + lv_res_t res = lv_obj_event_base(&lv_imgbtn_class, e); + if(res != LV_RES_OK) return; + + lv_event_code_t code = lv_event_get_code(e); + lv_obj_t * obj = lv_event_get_target(e); + if(code == LV_EVENT_PRESSED || code == LV_EVENT_RELEASED || code == LV_EVENT_PRESS_LOST) { + refr_img(obj); + } + else if(code == LV_EVENT_DRAW_MAIN) { + draw_main(e); + } + else if(code == LV_EVENT_COVER_CHECK) { + lv_cover_check_info_t * info = lv_event_get_param(e); + if(info->res != LV_COVER_RES_MASKED) info->res = LV_COVER_RES_NOT_COVER; + } + else if(code == LV_EVENT_GET_SELF_SIZE) { + lv_point_t * p = lv_event_get_self_size_info(e); + lv_imgbtn_t * imgbtn = (lv_imgbtn_t *)obj; + lv_imgbtn_state_t state = suggest_state(obj, get_state(obj)); + if(imgbtn->img_src_left[state] == NULL && + imgbtn->img_src_mid[state] != NULL && + imgbtn->img_src_right[state] == NULL) { + lv_img_header_t header; + lv_img_decoder_get_info(imgbtn->img_src_mid[state], &header); + p->x = LV_MAX(p->x, header.w); + } + } + /*Sent when the widget is checked due to LV_OBJ_FLAG_CHECKABLE */ + else if(code == LV_EVENT_VALUE_CHANGED) { + if(lv_obj_has_state(obj, LV_STATE_CHECKED)) { + lv_imgbtn_set_state(obj, LV_IMGBTN_STATE_CHECKED_RELEASED); + } + else { + lv_imgbtn_set_state(obj, LV_IMGBTN_STATE_RELEASED); + } + } +} + +static void draw_main(lv_event_t * e) +{ + lv_obj_t * obj = lv_event_get_target(e); + lv_imgbtn_t * imgbtn = (lv_imgbtn_t *)obj; + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); + + /*Just draw_main an image*/ + lv_imgbtn_state_t state = suggest_state(obj, get_state(obj)); + + /*Simply draw the middle src if no tiled*/ + const void * src = imgbtn->img_src_left[state]; + + lv_coord_t tw = lv_obj_get_style_transform_width(obj, LV_PART_MAIN); + lv_coord_t th = lv_obj_get_style_transform_height(obj, LV_PART_MAIN); + lv_area_t coords; + lv_area_copy(&coords, &obj->coords); + coords.x1 -= tw; + coords.x2 += tw; + coords.y1 -= th; + coords.y2 += th; + + lv_draw_img_dsc_t img_dsc; + lv_draw_img_dsc_init(&img_dsc); + lv_obj_init_draw_img_dsc(obj, LV_PART_MAIN, &img_dsc); + + lv_img_header_t header; + lv_area_t coords_part; + lv_coord_t left_w = 0; + lv_coord_t right_w = 0; + + if(src) { + lv_img_decoder_get_info(src, &header); + left_w = header.w; + coords_part.x1 = coords.x1; + coords_part.y1 = coords.y1; + coords_part.x2 = coords.x1 + header.w - 1; + coords_part.y2 = coords.y1 + header.h - 1; + lv_draw_img(draw_ctx, &img_dsc, &coords_part, src); + } + + src = imgbtn->img_src_right[state]; + if(src) { + lv_img_decoder_get_info(src, &header); + right_w = header.w; + coords_part.x1 = coords.x2 - header.w + 1; + coords_part.y1 = coords.y1; + coords_part.x2 = coords.x2; + coords_part.y2 = coords.y1 + header.h - 1; + lv_draw_img(draw_ctx, &img_dsc, &coords_part, src); + } + + src = imgbtn->img_src_mid[state]; + if(src) { + lv_area_t clip_area_center; + clip_area_center.x1 = coords.x1 + left_w; + clip_area_center.x2 = coords.x2 - right_w; + clip_area_center.y1 = coords.y1; + clip_area_center.y2 = coords.y2; + + + bool comm_res; + comm_res = _lv_area_intersect(&clip_area_center, &clip_area_center, draw_ctx->clip_area); + if(comm_res) { + lv_coord_t i; + lv_img_decoder_get_info(src, &header); + + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_area_center; + + coords_part.x1 = coords.x1 + left_w; + coords_part.y1 = coords.y1; + coords_part.x2 = coords_part.x1 + header.w - 1; + coords_part.y2 = coords_part.y1 + header.h - 1; + + for(i = coords_part.x1; i < (lv_coord_t)(clip_area_center.x2 + header.w - 1); i += header.w) { + lv_draw_img(draw_ctx, &img_dsc, &coords_part, src); + coords_part.x1 = coords_part.x2 + 1; + coords_part.x2 += header.w; + } + draw_ctx->clip_area = clip_area_ori; + } + } +} + +static void refr_img(lv_obj_t * obj) +{ + lv_imgbtn_t * imgbtn = (lv_imgbtn_t *)obj; + lv_imgbtn_state_t state = suggest_state(obj, get_state(obj)); + lv_img_header_t header; + + const void * src = imgbtn->img_src_mid[state]; + if(src == NULL) return; + + lv_res_t info_res = LV_RES_OK; + info_res = lv_img_decoder_get_info(src, &header); + + if(info_res == LV_RES_OK) { + imgbtn->act_cf = header.cf; + lv_obj_refresh_self_size(obj); + lv_obj_set_height(obj, header.h); /*Keep the user defined width*/ + } + else { + imgbtn->act_cf = LV_IMG_CF_UNKNOWN; + } + + lv_obj_invalidate(obj); +} + +/** + * If `src` is not defined for the current state try to get a state which is related to the current but has `src`. + * E.g. if the PRESSED src is not set but the RELEASED does, use the RELEASED. + * @param imgbtn pointer to an image button + * @param state the state to convert + * @return the suggested state + */ +static lv_imgbtn_state_t suggest_state(lv_obj_t * obj, lv_imgbtn_state_t state) +{ + lv_imgbtn_t * imgbtn = (lv_imgbtn_t *)obj; + if(imgbtn->img_src_mid[state] == NULL) { + switch(state) { + case LV_IMGBTN_STATE_PRESSED: + if(imgbtn->img_src_mid[LV_IMGBTN_STATE_RELEASED]) return LV_IMGBTN_STATE_RELEASED; + break; + case LV_IMGBTN_STATE_CHECKED_RELEASED: + if(imgbtn->img_src_mid[LV_IMGBTN_STATE_RELEASED]) return LV_IMGBTN_STATE_RELEASED; + break; + case LV_IMGBTN_STATE_CHECKED_PRESSED: + if(imgbtn->img_src_mid[LV_IMGBTN_STATE_CHECKED_RELEASED]) return LV_IMGBTN_STATE_CHECKED_RELEASED; + if(imgbtn->img_src_mid[LV_IMGBTN_STATE_PRESSED]) return LV_IMGBTN_STATE_PRESSED; + if(imgbtn->img_src_mid[LV_IMGBTN_STATE_RELEASED]) return LV_IMGBTN_STATE_RELEASED; + break; + case LV_IMGBTN_STATE_DISABLED: + if(imgbtn->img_src_mid[LV_IMGBTN_STATE_RELEASED]) return LV_IMGBTN_STATE_RELEASED; + break; + case LV_IMGBTN_STATE_CHECKED_DISABLED: + if(imgbtn->img_src_mid[LV_IMGBTN_STATE_CHECKED_RELEASED]) return LV_IMGBTN_STATE_CHECKED_RELEASED; + if(imgbtn->img_src_mid[LV_IMGBTN_STATE_RELEASED]) return LV_IMGBTN_STATE_RELEASED; + break; + default: + break; + } + } + + return state; +} + +lv_imgbtn_state_t get_state(const lv_obj_t * imgbtn) +{ + LV_ASSERT_OBJ(imgbtn, MY_CLASS); + + lv_state_t obj_state = lv_obj_get_state(imgbtn); + + if(obj_state & LV_STATE_DISABLED) { + if(obj_state & LV_STATE_CHECKED) return LV_IMGBTN_STATE_CHECKED_DISABLED; + else return LV_IMGBTN_STATE_DISABLED; + } + + if(obj_state & LV_STATE_CHECKED) { + if(obj_state & LV_STATE_PRESSED) return LV_IMGBTN_STATE_CHECKED_PRESSED; + else return LV_IMGBTN_STATE_CHECKED_RELEASED; + } + else { + if(obj_state & LV_STATE_PRESSED) return LV_IMGBTN_STATE_PRESSED; + else return LV_IMGBTN_STATE_RELEASED; + } +} + +#endif diff --git a/L3_Middlewares/LVGL/src/extra/widgets/imgbtn/lv_imgbtn.h b/L3_Middlewares/LVGL/src/extra/widgets/imgbtn/lv_imgbtn.h new file mode 100644 index 0000000..597faea --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/imgbtn/lv_imgbtn.h @@ -0,0 +1,131 @@ +/** + * @file lv_imgbtn.h + * + */ + +#ifndef LV_IMGBTN_H +#define LV_IMGBTN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" + +#if LV_USE_IMGBTN != 0 + +/********************* + * DEFINES + *********************/ +typedef enum { + LV_IMGBTN_STATE_RELEASED, + LV_IMGBTN_STATE_PRESSED, + LV_IMGBTN_STATE_DISABLED, + LV_IMGBTN_STATE_CHECKED_RELEASED, + LV_IMGBTN_STATE_CHECKED_PRESSED, + LV_IMGBTN_STATE_CHECKED_DISABLED, + _LV_IMGBTN_STATE_NUM, +} lv_imgbtn_state_t; + +/********************** + * TYPEDEFS + **********************/ +/*Data of image button*/ +typedef struct { + lv_obj_t obj; + const void * img_src_mid[_LV_IMGBTN_STATE_NUM]; /*Store center images to each state*/ + const void * img_src_left[_LV_IMGBTN_STATE_NUM]; /*Store left side images to each state*/ + const void * img_src_right[_LV_IMGBTN_STATE_NUM]; /*Store right side images to each state*/ + lv_img_cf_t act_cf; /*Color format of the currently active image*/ +} lv_imgbtn_t; + +extern const lv_obj_class_t lv_imgbtn_class; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create an image button object + * @param parent pointer to an object, it will be the parent of the new image button + * @return pointer to the created image button + */ +lv_obj_t * lv_imgbtn_create(lv_obj_t * parent); + +/*====================== + * Add/remove functions + *=====================*/ + +/*===================== + * Setter functions + *====================*/ + +/** + * Set images for a state of the image button + * @param imgbtn pointer to an image button object + * @param state for which state set the new image + * @param src_left pointer to an image source for the left side of the button (a C array or path to + * a file) + * @param src_mid pointer to an image source for the middle of the button (ideally 1px wide) (a C + * array or path to a file) + * @param src_right pointer to an image source for the right side of the button (a C array or path + * to a file) + */ +void lv_imgbtn_set_src(lv_obj_t * imgbtn, lv_imgbtn_state_t state, const void * src_left, const void * src_mid, + const void * src_right); + + +/** + * Use this function instead of `lv_obj_add/clear_state` to set a state manually + * @param imgbtn pointer to an image button object + * @param state the new state + */ +void lv_imgbtn_set_state(lv_obj_t * imgbtn, lv_imgbtn_state_t state); + +/*===================== + * Getter functions + *====================*/ + +/** + * Get the left image in a given state + * @param imgbtn pointer to an image button object + * @param state the state where to get the image (from `lv_btn_state_t`) ` + * @return pointer to the left image source (a C array or path to a file) + */ +const void * lv_imgbtn_get_src_left(lv_obj_t * imgbtn, lv_imgbtn_state_t state); + +/** + * Get the middle image in a given state + * @param imgbtn pointer to an image button object + * @param state the state where to get the image (from `lv_btn_state_t`) ` + * @return pointer to the middle image source (a C array or path to a file) + */ +const void * lv_imgbtn_get_src_middle(lv_obj_t * imgbtn, lv_imgbtn_state_t state); + +/** + * Get the right image in a given state + * @param imgbtn pointer to an image button object + * @param state the state where to get the image (from `lv_btn_state_t`) ` + * @return pointer to the left image source (a C array or path to a file) + */ +const void * lv_imgbtn_get_src_right(lv_obj_t * imgbtn, lv_imgbtn_state_t state); + + +/*===================== + * Other functions + *====================*/ + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_IMGBTN*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_IMGBTN_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/widgets/keyboard/lv_keyboard.c b/L3_Middlewares/LVGL/src/extra/widgets/keyboard/lv_keyboard.c new file mode 100644 index 0000000..cbb5e1c --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/keyboard/lv_keyboard.c @@ -0,0 +1,430 @@ + +/** + * @file lv_keyboard.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_keyboard.h" +#if LV_USE_KEYBOARD + +#include "../../../widgets/lv_textarea.h" +#include "../../../misc/lv_assert.h" + +#include + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_keyboard_class +#define LV_KB_BTN(width) LV_BTNMATRIX_CTRL_POPOVER | width + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_keyboard_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); + +static void lv_keyboard_update_map(lv_obj_t * obj); + +static void lv_keyboard_update_ctrl_map(lv_obj_t * obj); + +/********************** + * STATIC VARIABLES + **********************/ +const lv_obj_class_t lv_keyboard_class = { + .constructor_cb = lv_keyboard_constructor, + .width_def = LV_PCT(100), + .height_def = LV_PCT(50), + .instance_size = sizeof(lv_keyboard_t), + .editable = 1, + .base_class = &lv_btnmatrix_class +}; + +static const char * const default_kb_map_lc[] = {"1#", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", LV_SYMBOL_BACKSPACE, "\n", + "ABC", "a", "s", "d", "f", "g", "h", "j", "k", "l", LV_SYMBOL_NEW_LINE, "\n", + "_", "-", "z", "x", "c", "v", "b", "n", "m", ".", ",", ":", "\n", + LV_SYMBOL_KEYBOARD, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" + }; + +static const lv_btnmatrix_ctrl_t default_kb_ctrl_lc_map[] = { + LV_KEYBOARD_CTRL_BTN_FLAGS | 5, LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_BTNMATRIX_CTRL_CHECKED | 7, + LV_KEYBOARD_CTRL_BTN_FLAGS | 6, LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_BTNMATRIX_CTRL_CHECKED | 7, + LV_BTNMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BTNMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_BTNMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BTNMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BTNMATRIX_CTRL_CHECKED | LV_KB_BTN(1), + LV_KEYBOARD_CTRL_BTN_FLAGS | 2, LV_BTNMATRIX_CTRL_CHECKED | 2, 6, LV_BTNMATRIX_CTRL_CHECKED | 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 2 +}; + +static const char * const default_kb_map_uc[] = {"1#", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", LV_SYMBOL_BACKSPACE, "\n", + "abc", "A", "S", "D", "F", "G", "H", "J", "K", "L", LV_SYMBOL_NEW_LINE, "\n", + "_", "-", "Z", "X", "C", "V", "B", "N", "M", ".", ",", ":", "\n", + LV_SYMBOL_KEYBOARD, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" + }; + +static const lv_btnmatrix_ctrl_t default_kb_ctrl_uc_map[] = { + LV_KEYBOARD_CTRL_BTN_FLAGS | 5, LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_BTNMATRIX_CTRL_CHECKED | 7, + LV_KEYBOARD_CTRL_BTN_FLAGS | 6, LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_BTNMATRIX_CTRL_CHECKED | 7, + LV_BTNMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BTNMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_BTNMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BTNMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BTNMATRIX_CTRL_CHECKED | LV_KB_BTN(1), + LV_KEYBOARD_CTRL_BTN_FLAGS | 2, LV_BTNMATRIX_CTRL_CHECKED | 2, 6, LV_BTNMATRIX_CTRL_CHECKED | 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 2 +}; + +static const char * const default_kb_map_spec[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", LV_SYMBOL_BACKSPACE, "\n", + "abc", "+", "&", "/", "*", "=", "%", "!", "?", "#", "<", ">", "\n", + "\\", "@", "$", "(", ")", "{", "}", "[", "]", ";", "\"", "'", "\n", + LV_SYMBOL_KEYBOARD, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" + }; + +static const lv_btnmatrix_ctrl_t default_kb_ctrl_spec_map[] = { + LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_BTNMATRIX_CTRL_CHECKED | 2, + LV_KEYBOARD_CTRL_BTN_FLAGS | 2, LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), + LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), + LV_KEYBOARD_CTRL_BTN_FLAGS | 2, LV_BTNMATRIX_CTRL_CHECKED | 2, 6, LV_BTNMATRIX_CTRL_CHECKED | 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 2 +}; + +static const char * const default_kb_map_num[] = {"1", "2", "3", LV_SYMBOL_KEYBOARD, "\n", + "4", "5", "6", LV_SYMBOL_OK, "\n", + "7", "8", "9", LV_SYMBOL_BACKSPACE, "\n", + "+/-", "0", ".", LV_SYMBOL_LEFT, LV_SYMBOL_RIGHT, "" + }; + +static const lv_btnmatrix_ctrl_t default_kb_ctrl_num_map[] = { + 1, 1, 1, LV_KEYBOARD_CTRL_BTN_FLAGS | 2, + 1, 1, 1, LV_KEYBOARD_CTRL_BTN_FLAGS | 2, + 1, 1, 1, 2, + 1, 1, 1, 1, 1 +}; + +static const char * * kb_map[9] = { + (const char * *)default_kb_map_lc, + (const char * *)default_kb_map_uc, + (const char * *)default_kb_map_spec, + (const char * *)default_kb_map_num, + (const char * *)default_kb_map_lc, + (const char * *)default_kb_map_lc, + (const char * *)default_kb_map_lc, + (const char * *)default_kb_map_lc, + (const char * *)NULL, +}; +static const lv_btnmatrix_ctrl_t * kb_ctrl[9] = { + default_kb_ctrl_lc_map, + default_kb_ctrl_uc_map, + default_kb_ctrl_spec_map, + default_kb_ctrl_num_map, + default_kb_ctrl_lc_map, + default_kb_ctrl_lc_map, + default_kb_ctrl_lc_map, + default_kb_ctrl_lc_map, + NULL, +}; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Create a Keyboard object + * @param parent pointer to an object, it will be the parent of the new keyboard + * @return pointer to the created keyboard + */ +lv_obj_t * lv_keyboard_create(lv_obj_t * parent) +{ + LV_LOG_INFO("begin"); + lv_obj_t * obj = lv_obj_class_create_obj(&lv_keyboard_class, parent); + lv_obj_class_init_obj(obj); + return obj; +} + +/*===================== + * Setter functions + *====================*/ + +/** + * Assign a Text Area to the Keyboard. The pressed characters will be put there. + * @param kb pointer to a Keyboard object + * @param ta pointer to a Text Area object to write there + */ +void lv_keyboard_set_textarea(lv_obj_t * obj, lv_obj_t * ta) +{ + if(ta) { + LV_ASSERT_OBJ(ta, &lv_textarea_class); + } + + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; + + /*Hide the cursor of the old Text area if cursor management is enabled*/ + if(keyboard->ta) { + lv_obj_clear_state(obj, LV_STATE_FOCUSED); + } + + keyboard->ta = ta; + + /*Show the cursor of the new Text area if cursor management is enabled*/ + if(keyboard->ta) { + lv_obj_add_flag(obj, LV_STATE_FOCUSED); + } +} + +/** + * Set a new a mode (text or number map) + * @param kb pointer to a Keyboard object + * @param mode the mode from 'lv_keyboard_mode_t' + */ +void lv_keyboard_set_mode(lv_obj_t * obj, lv_keyboard_mode_t mode) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; + if(keyboard->mode == mode) return; + + keyboard->mode = mode; + lv_keyboard_update_map(obj); +} + +/** + * Show the button title in a popover when pressed. + * @param kb pointer to a Keyboard object + * @param en whether "popovers" mode is enabled + */ +void lv_keyboard_set_popovers(lv_obj_t * obj, bool en) +{ + lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; + + if(keyboard->popovers == en) { + return; + } + + keyboard->popovers = en; + lv_keyboard_update_ctrl_map(obj); +} + +/** + * Set a new map for the keyboard + * @param kb pointer to a Keyboard object + * @param mode keyboard map to alter 'lv_keyboard_mode_t' + * @param map pointer to a string array to describe the map. + * See 'lv_btnmatrix_set_map()' for more info. + */ +void lv_keyboard_set_map(lv_obj_t * obj, lv_keyboard_mode_t mode, const char * map[], + const lv_btnmatrix_ctrl_t ctrl_map[]) +{ + kb_map[mode] = map; + kb_ctrl[mode] = ctrl_map; + lv_keyboard_update_map(obj); +} + +/*===================== + * Getter functions + *====================*/ + +/** + * Assign a Text Area to the Keyboard. The pressed characters will be put there. + * @param kb pointer to a Keyboard object + * @return pointer to the assigned Text Area object + */ +lv_obj_t * lv_keyboard_get_textarea(const lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; + return keyboard->ta; +} + +/** + * Set a new a mode (text or number map) + * @param kb pointer to a Keyboard object + * @return the current mode from 'lv_keyboard_mode_t' + */ +lv_keyboard_mode_t lv_keyboard_get_mode(const lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; + return keyboard->mode; +} + +/** + * Tell whether "popovers" mode is enabled or not. + * @param kb pointer to a Keyboard object + * @return true: "popovers" mode is enabled; false: disabled + */ +bool lv_btnmatrix_get_popovers(const lv_obj_t * obj) +{ + lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; + return keyboard->popovers; +} + +/*===================== + * Other functions + *====================*/ + +/** + * Default keyboard event to add characters to the Text area and change the map. + * If a custom `event_cb` is added to the keyboard this function can be called from it to handle the + * button clicks + * @param kb pointer to a keyboard + * @param event the triggering event + */ +void lv_keyboard_def_event_cb(lv_event_t * e) +{ + lv_obj_t * obj = lv_event_get_target(e); + + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; + uint16_t btn_id = lv_btnmatrix_get_selected_btn(obj); + if(btn_id == LV_BTNMATRIX_BTN_NONE) return; + + const char * txt = lv_btnmatrix_get_btn_text(obj, lv_btnmatrix_get_selected_btn(obj)); + if(txt == NULL) return; + + if(strcmp(txt, "abc") == 0) { + keyboard->mode = LV_KEYBOARD_MODE_TEXT_LOWER; + lv_btnmatrix_set_map(obj, kb_map[LV_KEYBOARD_MODE_TEXT_LOWER]); + lv_keyboard_update_ctrl_map(obj); + return; + } + else if(strcmp(txt, "ABC") == 0) { + keyboard->mode = LV_KEYBOARD_MODE_TEXT_UPPER; + lv_btnmatrix_set_map(obj, kb_map[LV_KEYBOARD_MODE_TEXT_UPPER]); + lv_keyboard_update_ctrl_map(obj); + return; + } + else if(strcmp(txt, "1#") == 0) { + keyboard->mode = LV_KEYBOARD_MODE_SPECIAL; + lv_btnmatrix_set_map(obj, kb_map[LV_KEYBOARD_MODE_SPECIAL]); + lv_keyboard_update_ctrl_map(obj); + return; + } + else if(strcmp(txt, LV_SYMBOL_CLOSE) == 0 || strcmp(txt, LV_SYMBOL_KEYBOARD) == 0) { + lv_res_t res = lv_event_send(obj, LV_EVENT_CANCEL, NULL); + if(res != LV_RES_OK) return; + + if(keyboard->ta) { + res = lv_event_send(keyboard->ta, LV_EVENT_CANCEL, NULL); + if(res != LV_RES_OK) return; + } + return; + } + else if(strcmp(txt, LV_SYMBOL_OK) == 0) { + lv_res_t res = lv_event_send(obj, LV_EVENT_READY, NULL); + if(res != LV_RES_OK) return; + + if(keyboard->ta) { + res = lv_event_send(keyboard->ta, LV_EVENT_READY, NULL); + if(res != LV_RES_OK) return; + } + return; + } + + /*Add the characters to the text area if set*/ + if(keyboard->ta == NULL) return; + + if(strcmp(txt, "Enter") == 0 || strcmp(txt, LV_SYMBOL_NEW_LINE) == 0) { + lv_textarea_add_char(keyboard->ta, '\n'); + if(lv_textarea_get_one_line(keyboard->ta)) { + lv_res_t res = lv_event_send(keyboard->ta, LV_EVENT_READY, NULL); + if(res != LV_RES_OK) return; + } + } + else if(strcmp(txt, LV_SYMBOL_LEFT) == 0) { + lv_textarea_cursor_left(keyboard->ta); + } + else if(strcmp(txt, LV_SYMBOL_RIGHT) == 0) { + lv_textarea_cursor_right(keyboard->ta); + } + else if(strcmp(txt, LV_SYMBOL_BACKSPACE) == 0) { + lv_textarea_del_char(keyboard->ta); + } + else if(strcmp(txt, "+/-") == 0) { + uint16_t cur = lv_textarea_get_cursor_pos(keyboard->ta); + const char * ta_txt = lv_textarea_get_text(keyboard->ta); + if(ta_txt[0] == '-') { + lv_textarea_set_cursor_pos(keyboard->ta, 1); + lv_textarea_del_char(keyboard->ta); + lv_textarea_add_char(keyboard->ta, '+'); + lv_textarea_set_cursor_pos(keyboard->ta, cur); + } + else if(ta_txt[0] == '+') { + lv_textarea_set_cursor_pos(keyboard->ta, 1); + lv_textarea_del_char(keyboard->ta); + lv_textarea_add_char(keyboard->ta, '-'); + lv_textarea_set_cursor_pos(keyboard->ta, cur); + } + else { + lv_textarea_set_cursor_pos(keyboard->ta, 0); + lv_textarea_add_char(keyboard->ta, '-'); + lv_textarea_set_cursor_pos(keyboard->ta, cur + 1); + } + } + else { + lv_textarea_add_text(keyboard->ta, txt); + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_keyboard_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICK_FOCUSABLE); + + lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; + keyboard->ta = NULL; + keyboard->mode = LV_KEYBOARD_MODE_TEXT_LOWER; + keyboard->popovers = 0; + + lv_obj_align(obj, LV_ALIGN_BOTTOM_MID, 0, 0); + lv_obj_add_event_cb(obj, lv_keyboard_def_event_cb, LV_EVENT_VALUE_CHANGED, NULL); + lv_obj_set_style_base_dir(obj, LV_BASE_DIR_LTR, 0); + + lv_keyboard_update_map(obj); +} + +/** + * Update the key and control map for the current mode + * @param obj pointer to a keyboard object + */ +static void lv_keyboard_update_map(lv_obj_t * obj) +{ + lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; + lv_btnmatrix_set_map(obj, kb_map[keyboard->mode]); + lv_keyboard_update_ctrl_map(obj); +} + +/** + * Update the control map for the current mode + * @param obj pointer to a keyboard object + */ +static void lv_keyboard_update_ctrl_map(lv_obj_t * obj) +{ + lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; + + if(keyboard->popovers) { + /*Apply the current control map (already includes LV_BTNMATRIX_CTRL_POPOVER flags)*/ + lv_btnmatrix_set_ctrl_map(obj, kb_ctrl[keyboard->mode]); + } + else { + /*Make a copy of the current control map*/ + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; + lv_btnmatrix_ctrl_t * ctrl_map = lv_mem_alloc(btnm->btn_cnt * sizeof(lv_btnmatrix_ctrl_t)); + lv_memcpy(ctrl_map, kb_ctrl[keyboard->mode], sizeof(lv_btnmatrix_ctrl_t) * btnm->btn_cnt); + + /*Remove all LV_BTNMATRIX_CTRL_POPOVER flags*/ + for(uint16_t i = 0; i < btnm->btn_cnt; i++) { + ctrl_map[i] &= (~LV_BTNMATRIX_CTRL_POPOVER); + } + + /*Apply new control map and clean up*/ + lv_btnmatrix_set_ctrl_map(obj, ctrl_map); + lv_mem_free(ctrl_map); + } +} + +#endif /*LV_USE_KEYBOARD*/ diff --git a/L3_Middlewares/LVGL/src/widgets/keyboard/lv_keyboard.h b/L3_Middlewares/LVGL/src/extra/widgets/keyboard/lv_keyboard.h similarity index 51% rename from L3_Middlewares/LVGL/src/widgets/keyboard/lv_keyboard.h rename to L3_Middlewares/LVGL/src/extra/widgets/keyboard/lv_keyboard.h index f177c18..7f65cd7 100644 --- a/L3_Middlewares/LVGL/src/widgets/keyboard/lv_keyboard.h +++ b/L3_Middlewares/LVGL/src/extra/widgets/keyboard/lv_keyboard.h @@ -13,30 +13,30 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../buttonmatrix/lv_buttonmatrix.h" +#include "../../../widgets/lv_btnmatrix.h" #if LV_USE_KEYBOARD /*Testing of dependencies*/ -#if LV_USE_BUTTONMATRIX == 0 -#error "lv_buttonmatrix is required. Enable it in lv_conf.h (LV_USE_BUTTONMATRIX 1) " +#if LV_USE_BTNMATRIX == 0 +#error "lv_kb: lv_btnm is required. Enable it in lv_conf.h (LV_USE_BTNMATRIX 1) " #endif #if LV_USE_TEXTAREA == 0 -#error "lv_textarea is required. Enable it in lv_conf.h (LV_USE_TEXTAREA 1) " +#error "lv_kb: lv_ta is required. Enable it in lv_conf.h (LV_USE_TEXTAREA 1) " #endif /********************* * DEFINES *********************/ -#define LV_KEYBOARD_CTRL_BUTTON_FLAGS (LV_BUTTONMATRIX_CTRL_NO_REPEAT | LV_BUTTONMATRIX_CTRL_CLICK_TRIG | LV_BUTTONMATRIX_CTRL_CHECKED) +#define LV_KEYBOARD_CTRL_BTN_FLAGS (LV_BTNMATRIX_CTRL_NO_REPEAT | LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_CHECKED) /********************** * TYPEDEFS **********************/ /** Current keyboard mode.*/ -typedef enum { +enum { LV_KEYBOARD_MODE_TEXT_LOWER, LV_KEYBOARD_MODE_TEXT_UPPER, LV_KEYBOARD_MODE_SPECIAL, @@ -45,22 +45,18 @@ typedef enum { LV_KEYBOARD_MODE_USER_2, LV_KEYBOARD_MODE_USER_3, LV_KEYBOARD_MODE_USER_4, -#if LV_USE_ARABIC_PERSIAN_CHARS == 1 - LV_KEYBOARD_MODE_TEXT_ARABIC -#endif -} lv_keyboard_mode_t; - -#if LV_USE_OBJ_PROPERTY -enum { - LV_PROPERTY_ID(KEYBOARD, TEXTAREA, LV_PROPERTY_TYPE_OBJ, 0), - LV_PROPERTY_ID(KEYBOARD, MODE, LV_PROPERTY_TYPE_INT, 1), - LV_PROPERTY_ID(KEYBOARD, POPOVERS, LV_PROPERTY_TYPE_INT, 2), - LV_PROPERTY_ID(KEYBOARD, SELECTED_BUTTON, LV_PROPERTY_TYPE_INT, 3), - LV_PROPERTY_KEYBOARD_END, }; -#endif +typedef uint8_t lv_keyboard_mode_t; + +/*Data of keyboard*/ +typedef struct { + lv_btnmatrix_t btnm; + lv_obj_t * ta; /*Pointer to the assigned text area*/ + lv_keyboard_mode_t mode; /*Key map type*/ + uint8_t popovers : 1; /*Show button titles in popovers on press*/ +} lv_keyboard_t; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_keyboard_class; +extern const lv_obj_class_t lv_keyboard_class; /********************** * GLOBAL PROTOTYPES @@ -68,8 +64,8 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_keyboard_class; /** * Create a Keyboard object - * @param parent pointer to an object, it will be the parent of the new keyboard - * @return pointer to the created keyboard + * @param parent pointer to an object, it will be the parent of the new keyboard + * @return pointer to the created keyboard */ lv_obj_t * lv_keyboard_create(lv_obj_t * parent); @@ -79,36 +75,34 @@ lv_obj_t * lv_keyboard_create(lv_obj_t * parent); /** * Assign a Text Area to the Keyboard. The pressed characters will be put there. - * @param kb pointer to a Keyboard object - * @param ta pointer to a Text Area object to write there + * @param kb pointer to a Keyboard object + * @param ta pointer to a Text Area object to write there */ void lv_keyboard_set_textarea(lv_obj_t * kb, lv_obj_t * ta); /** * Set a new a mode (text or number map) - * @param kb pointer to a Keyboard object - * @param mode the mode from 'lv_keyboard_mode_t' + * @param kb pointer to a Keyboard object + * @param mode the mode from 'lv_keyboard_mode_t' */ void lv_keyboard_set_mode(lv_obj_t * kb, lv_keyboard_mode_t mode); /** * Show the button title in a popover when pressed. - * @param kb pointer to a Keyboard object - * @param en whether "popovers" mode is enabled + * @param kb pointer to a Keyboard object + * @param en whether "popovers" mode is enabled */ void lv_keyboard_set_popovers(lv_obj_t * kb, bool en); /** * Set a new map for the keyboard - * @param kb pointer to a Keyboard object - * @param mode keyboard map to alter 'lv_keyboard_mode_t' - * @param map pointer to a string array to describe the map. - * See 'lv_buttonmatrix_set_map()' for more info. - * @param ctrl_map See 'lv_buttonmatrix_set_ctrl_map()' for more info. - + * @param kb pointer to a Keyboard object + * @param mode keyboard map to alter 'lv_keyboard_mode_t' + * @param map pointer to a string array to describe the map. + * See 'lv_btnmatrix_set_map()' for more info. */ -void lv_keyboard_set_map(lv_obj_t * kb, lv_keyboard_mode_t mode, const char * const map[], - const lv_buttonmatrix_ctrl_t ctrl_map[]); +void lv_keyboard_set_map(lv_obj_t * kb, lv_keyboard_mode_t mode, const char * map[], + const lv_btnmatrix_ctrl_t ctrl_map[]); /*===================== * Getter functions @@ -116,39 +110,45 @@ void lv_keyboard_set_map(lv_obj_t * kb, lv_keyboard_mode_t mode, const char * co /** * Assign a Text Area to the Keyboard. The pressed characters will be put there. - * @param kb pointer to a Keyboard object - * @return pointer to the assigned Text Area object + * @param kb pointer to a Keyboard object + * @return pointer to the assigned Text Area object */ lv_obj_t * lv_keyboard_get_textarea(const lv_obj_t * kb); /** * Set a new a mode (text or number map) - * @param kb pointer to a Keyboard object - * @return the current mode from 'lv_keyboard_mode_t' + * @param kb pointer to a Keyboard object + * @return the current mode from 'lv_keyboard_mode_t' */ lv_keyboard_mode_t lv_keyboard_get_mode(const lv_obj_t * kb); /** * Tell whether "popovers" mode is enabled or not. - * @param obj pointer to a Keyboard object - * @return true: "popovers" mode is enabled; false: disabled + * @param kb pointer to a Keyboard object + * @return true: "popovers" mode is enabled; false: disabled */ -bool lv_keyboard_get_popovers(const lv_obj_t * obj); +bool lv_btnmatrix_get_popovers(const lv_obj_t * obj); /** * Get the current map of a keyboard - * @param kb pointer to a keyboard object - * @return the current map + * @param kb pointer to a keyboard object + * @return the current map */ -const char * const * lv_keyboard_get_map_array(const lv_obj_t * kb); +static inline const char ** lv_keyboard_get_map_array(const lv_obj_t * kb) +{ + return lv_btnmatrix_get_map(kb); +} /** * Get the index of the lastly "activated" button by the user (pressed, released, focused etc) * Useful in the `event_cb` to get the text of the button, check if hidden etc. * @param obj pointer to button matrix object - * @return index of the last released button (LV_BUTTONMATRIX_BUTTON_NONE: if unset) + * @return index of the last released button (LV_BTNMATRIX_BTN_NONE: if unset) */ -uint32_t lv_keyboard_get_selected_button(const lv_obj_t * obj); +static inline uint16_t lv_keyboard_get_selected_btn(const lv_obj_t * obj) +{ + return lv_btnmatrix_get_selected_btn(obj); +} /** * Get the button's text @@ -156,7 +156,10 @@ uint32_t lv_keyboard_get_selected_button(const lv_obj_t * obj); * @param btn_id the index a button not counting new line characters. * @return text of btn_index` button */ -const char * lv_keyboard_get_button_text(const lv_obj_t * obj, uint32_t btn_id); +static inline const char * lv_keyboard_get_btn_text(const lv_obj_t * obj, uint16_t btn_id) +{ + return lv_btnmatrix_get_btn_text(obj, btn_id); +} /*===================== * Other functions @@ -166,7 +169,8 @@ const char * lv_keyboard_get_button_text(const lv_obj_t * obj, uint32_t btn_id); * Default keyboard event to add characters to the Text area and change the map. * If a custom `event_cb` is added to the keyboard this function can be called from it to handle the * button clicks - * @param e the triggering event + * @param kb pointer to a keyboard + * @param event the triggering event */ void lv_keyboard_def_event_cb(lv_event_t * e); diff --git a/L3_Middlewares/LVGL/src/widgets/led/lv_led.c b/L3_Middlewares/LVGL/src/extra/widgets/led/lv_led.c similarity index 77% rename from L3_Middlewares/LVGL/src/widgets/led/lv_led.c rename to L3_Middlewares/LVGL/src/extra/widgets/led/lv_led.c index 6a8c29b..88b7b87 100644 --- a/L3_Middlewares/LVGL/src/widgets/led/lv_led.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/led/lv_led.c @@ -6,20 +6,15 @@ /********************* * INCLUDES *********************/ -#include "lv_led_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_class_private.h" - +#include "lv_led.h" #if LV_USE_LED -#include "../../misc/lv_assert.h" -#include "../../themes/lv_theme.h" -#include "../../misc/lv_color.h" +#include "../../../misc/lv_assert.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_led_class) +#define MY_CLASS &lv_led_class /********************** * TYPEDEFS @@ -34,7 +29,6 @@ static void lv_led_event(const lv_obj_class_t * class_p, lv_event_t * e); /********************** * STATIC VARIABLES **********************/ - const lv_obj_class_t lv_led_class = { .base_class = &lv_obj_class, .constructor_cb = lv_led_constructor, @@ -42,7 +36,6 @@ const lv_obj_class_t lv_led_class = { .height_def = LV_DPI_DEF / 5, .event_cb = lv_led_event, .instance_size = sizeof(lv_led_t), - .name = "led", }; /********************** @@ -53,6 +46,11 @@ const lv_obj_class_t lv_led_class = { * GLOBAL FUNCTIONS **********************/ +/** + * Create a led object + * @param parent pointer to an object, it will be the parent of the new led + * @return pointer to the created led + */ lv_obj_t * lv_led_create(lv_obj_t * parent) { LV_LOG_INFO("begin"); @@ -65,6 +63,11 @@ lv_obj_t * lv_led_create(lv_obj_t * parent) * Setter functions *====================*/ +/** + * Set the color of the LED + * @param led pointer to a LED object + * @param color the color of the LED + */ void lv_led_set_color(lv_obj_t * obj, lv_color_t color) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -74,6 +77,11 @@ void lv_led_set_color(lv_obj_t * obj, lv_color_t color) lv_obj_invalidate(obj); } +/** + * Set the brightness of a LED object + * @param led pointer to a LED object + * @param bright LV_LED_BRIGHT_MIN (max. dark) ... LV_LED_BRIGHT_MAX (max. light) + */ void lv_led_set_brightness(lv_obj_t * obj, uint8_t bright) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -87,16 +95,28 @@ void lv_led_set_brightness(lv_obj_t * obj, uint8_t bright) lv_obj_invalidate(obj); } +/** + * Light on a LED + * @param led pointer to a LED object + */ void lv_led_on(lv_obj_t * led) { lv_led_set_brightness(led, LV_LED_BRIGHT_MAX); } +/** + * Light off a LED + * @param led pointer to a LED object + */ void lv_led_off(lv_obj_t * led) { lv_led_set_brightness(led, LV_LED_BRIGHT_MIN); } +/** + * Toggle the state of a LED + * @param led pointer to a LED object + */ void lv_led_toggle(lv_obj_t * obj) { uint8_t bright = lv_led_get_brightness(obj); @@ -110,6 +130,11 @@ void lv_led_toggle(lv_obj_t * obj) * Getter functions *====================*/ +/** + * Get the brightness of a LEd object + * @param led pointer to LED object + * @return bright 0 (max. dark) ... 255 (max. light) + */ uint8_t lv_led_get_brightness(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -134,16 +159,16 @@ static void lv_led_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /* Call the ancestor's event handler */ lv_event_code_t code = lv_event_get_code(e); if(code != LV_EVENT_DRAW_MAIN && code != LV_EVENT_DRAW_MAIN_END) { res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; } - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); if(code == LV_EVENT_DRAW_MAIN) { /*Make darker colors in a temporary style according to the brightness*/ lv_led_t * led = (lv_led_t *)obj; @@ -177,9 +202,19 @@ static void lv_led_event(const lv_obj_class_t * class_p, lv_event_t * e) rect_dsc.shadow_spread = ((led->bright - LV_LED_BRIGHT_MIN) * rect_dsc.shadow_spread) / (LV_LED_BRIGHT_MAX - LV_LED_BRIGHT_MIN); - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.draw_area = &obj->coords; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_LED_DRAW_PART_RECTANGLE; + part_draw_dsc.rect_dsc = &rect_dsc; + part_draw_dsc.part = LV_PART_MAIN; - lv_draw_rect(layer, &rect_dsc, &obj->coords); + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_rect(draw_ctx, &rect_dsc, &obj->coords); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); } } diff --git a/L3_Middlewares/LVGL/src/widgets/led/lv_led.h b/L3_Middlewares/LVGL/src/extra/widgets/led/lv_led.h similarity index 58% rename from L3_Middlewares/LVGL/src/widgets/led/lv_led.h rename to L3_Middlewares/LVGL/src/extra/widgets/led/lv_led.h index c085a97..368bcd2 100644 --- a/L3_Middlewares/LVGL/src/widgets/led/lv_led.h +++ b/L3_Middlewares/LVGL/src/extra/widgets/led/lv_led.h @@ -13,10 +13,11 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../core/lv_obj.h" +#include "../../../lvgl.h" #if LV_USE_LED + /********************* * DEFINES *********************/ @@ -34,7 +35,22 @@ extern "C" { * TYPEDEFS **********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_led_class; +/*Data of led*/ +typedef struct { + lv_obj_t obj; + lv_color_t color; + uint8_t bright; /**< Current brightness of the LED (0..255)*/ +} lv_led_t; + +extern const lv_obj_class_t lv_led_class; + +/** + * `type` field in `lv_obj_draw_part_dsc_t` if `class_p = lv_led_class` + * Used in `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` + */ +typedef enum { + LV_LED_DRAW_PART_RECTANGLE, /**< The main rectangle*/ +} lv_led_draw_part_type_t; /********************** * GLOBAL PROTOTYPES @@ -42,8 +58,8 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_led_class; /** * Create a led object - * @param parent pointer to an object, it will be the parent of the new led - * @return pointer to the created led + * @param parent pointer to an object, it will be the parent of the new led + * @return pointer to the created led */ lv_obj_t * lv_led_create(lv_obj_t * parent); @@ -56,33 +72,33 @@ void lv_led_set_color(lv_obj_t * led, lv_color_t color); /** * Set the brightness of a LED object - * @param led pointer to a LED object - * @param bright LV_LED_BRIGHT_MIN (max. dark) ... LV_LED_BRIGHT_MAX (max. light) + * @param led pointer to a LED object + * @param bright LV_LED_BRIGHT_MIN (max. dark) ... LV_LED_BRIGHT_MAX (max. light) */ void lv_led_set_brightness(lv_obj_t * led, uint8_t bright); /** * Light on a LED - * @param led pointer to a LED object + * @param led pointer to a LED object */ void lv_led_on(lv_obj_t * led); /** * Light off a LED - * @param led pointer to a LED object + * @param led pointer to a LED object */ void lv_led_off(lv_obj_t * led); /** * Toggle the state of a LED - * @param led pointer to a LED object + * @param led pointer to a LED object */ void lv_led_toggle(lv_obj_t * led); /** - * Get the brightness of a LED object - * @param obj pointer to LED object - * @return bright 0 (max. dark) ... 255 (max. light) + * Get the brightness of a LEd object + * @param led pointer to LED object + * @return bright 0 (max. dark) ... 255 (max. light) */ uint8_t lv_led_get_brightness(const lv_obj_t * obj); @@ -96,4 +112,5 @@ uint8_t lv_led_get_brightness(const lv_obj_t * obj); } /*extern "C"*/ #endif + #endif /*LV_LED_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/list/lv_list.c b/L3_Middlewares/LVGL/src/extra/widgets/list/lv_list.c similarity index 53% rename from L3_Middlewares/LVGL/src/widgets/list/lv_list.c rename to L3_Middlewares/LVGL/src/extra/widgets/list/lv_list.c index 3556ef1..29355fd 100644 --- a/L3_Middlewares/LVGL/src/widgets/list/lv_list.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/list/lv_list.c @@ -6,22 +6,18 @@ /********************* * INCLUDES *********************/ -#include "../../core/lv_obj_class_private.h" #include "lv_list.h" -#include "../../layouts/flex/lv_flex.h" -#include "../../display/lv_display.h" -#include "../label/lv_label.h" -#include "../image/lv_image.h" -#include "../button/lv_button.h" +#include "../../../core/lv_disp.h" +#include "../../../widgets/lv_label.h" +#include "../../../widgets/lv_img.h" +#include "../../../widgets/lv_btn.h" #if LV_USE_LIST /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_list_class) -#define MY_CLASS_BUTTON (&lv_list_button_class) -#define MY_CLASS_TEXT (&lv_list_text_class) +#define MV_CLASS &lv_list /********************** * TYPEDEFS @@ -30,25 +26,19 @@ /********************** * STATIC PROTOTYPES **********************/ + const lv_obj_class_t lv_list_class = { .base_class = &lv_obj_class, .width_def = (LV_DPI_DEF * 3) / 2, - .height_def = LV_DPI_DEF * 2, - .name = "list", + .height_def = LV_DPI_DEF * 2 }; -const lv_obj_class_t lv_list_button_class = { - .base_class = &lv_button_class, - .width_def = LV_PCT(100), - .height_def = LV_SIZE_CONTENT, - .name = "list-btn", +const lv_obj_class_t lv_list_btn_class = { + .base_class = &lv_btn_class, }; const lv_obj_class_t lv_list_text_class = { .base_class = &lv_label_class, - .width_def = LV_PCT(100), - .height_def = LV_SIZE_CONTENT, - .name = "list-text", }; /********************** @@ -66,7 +56,7 @@ const lv_obj_class_t lv_list_text_class = { lv_obj_t * lv_list_create(lv_obj_t * parent) { LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); + lv_obj_t * obj = lv_obj_class_create_obj(&lv_list_class, parent); lv_obj_class_init_obj(obj); lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); return obj; @@ -75,24 +65,26 @@ lv_obj_t * lv_list_create(lv_obj_t * parent) lv_obj_t * lv_list_add_text(lv_obj_t * list, const char * txt) { LV_LOG_INFO("begin"); - - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS_TEXT, list); + lv_obj_t * obj = lv_obj_class_create_obj(&lv_list_text_class, list); lv_obj_class_init_obj(obj); lv_label_set_text(obj, txt); + lv_label_set_long_mode(obj, LV_LABEL_LONG_SCROLL_CIRCULAR); + lv_obj_set_width(obj, LV_PCT(100)); return obj; } -lv_obj_t * lv_list_add_button(lv_obj_t * list, const void * icon, const char * txt) +lv_obj_t * lv_list_add_btn(lv_obj_t * list, const void * icon, const char * txt) { LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS_BUTTON, list); + lv_obj_t * obj = lv_obj_class_create_obj(&lv_list_btn_class, list); lv_obj_class_init_obj(obj); + lv_obj_set_size(obj, LV_PCT(100), LV_SIZE_CONTENT); lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW); -#if LV_USE_IMAGE == 1 +#if LV_USE_IMG == 1 if(icon) { - lv_obj_t * img = lv_image_create(obj); - lv_image_set_src(img, icon); + lv_obj_t * img = lv_img_create(obj); + lv_img_set_src(img, icon); } #endif @@ -106,11 +98,11 @@ lv_obj_t * lv_list_add_button(lv_obj_t * list, const void * icon, const char * t return obj; } -const char * lv_list_get_button_text(lv_obj_t * list, lv_obj_t * btn) +const char * lv_list_get_btn_text(lv_obj_t * list, lv_obj_t * btn) { LV_UNUSED(list); uint32_t i; - for(i = 0; i < lv_obj_get_child_count(btn); i++) { + for(i = 0; i < lv_obj_get_child_cnt(btn); i++) { lv_obj_t * child = lv_obj_get_child(btn, i); if(lv_obj_check_type(child, &lv_label_class)) { return lv_label_get_text(child); @@ -121,19 +113,6 @@ const char * lv_list_get_button_text(lv_obj_t * list, lv_obj_t * btn) return ""; } -void lv_list_set_button_text(lv_obj_t * list, lv_obj_t * btn, const char * txt) -{ - LV_UNUSED(list); - uint32_t i; - for(i = 0; i < lv_obj_get_child_count(btn); i++) { - lv_obj_t * child = lv_obj_get_child(btn, i); - if(lv_obj_check_type(child, &lv_label_class)) { - lv_label_set_text(child, txt); - return; - } - } -} - /********************** * STATIC FUNCTIONS **********************/ diff --git a/L3_Middlewares/LVGL/src/extra/widgets/list/lv_list.h b/L3_Middlewares/LVGL/src/extra/widgets/list/lv_list.h new file mode 100644 index 0000000..0da5595 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/list/lv_list.h @@ -0,0 +1,54 @@ +/** + * @file lv_win.h + * + */ + +#ifndef LV_LIST_H +#define LV_LIST_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../core/lv_obj.h" +#include "../../layouts/flex/lv_flex.h" + +#if LV_USE_LIST + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +extern const lv_obj_class_t lv_list_class; +extern const lv_obj_class_t lv_list_text_class; +extern const lv_obj_class_t lv_list_btn_class; +/********************** + * GLOBAL PROTOTYPES + **********************/ + +lv_obj_t * lv_list_create(lv_obj_t * parent); + +lv_obj_t * lv_list_add_text(lv_obj_t * list, const char * txt); + +lv_obj_t * lv_list_add_btn(lv_obj_t * list, const void * icon, const char * txt); + +const char * lv_list_get_btn_text(lv_obj_t * list, lv_obj_t * btn); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_LIST*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_LIST_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/widgets/lv_widgets.h b/L3_Middlewares/LVGL/src/extra/widgets/lv_widgets.h new file mode 100644 index 0000000..1141810 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/lv_widgets.h @@ -0,0 +1,56 @@ +/** + * @file lv_widgets.h + * + */ + +#ifndef LV_WIDGETS_H +#define LV_WIDGETS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "animimg/lv_animimg.h" +#include "calendar/lv_calendar.h" +#include "calendar/lv_calendar_header_arrow.h" +#include "calendar/lv_calendar_header_dropdown.h" +#include "chart/lv_chart.h" +#include "keyboard/lv_keyboard.h" +#include "list/lv_list.h" +#include "menu/lv_menu.h" +#include "msgbox/lv_msgbox.h" +#include "meter/lv_meter.h" +#include "spinbox/lv_spinbox.h" +#include "spinner/lv_spinner.h" +#include "tabview/lv_tabview.h" +#include "tileview/lv_tileview.h" +#include "win/lv_win.h" +#include "colorwheel/lv_colorwheel.h" +#include "led/lv_led.h" +#include "imgbtn/lv_imgbtn.h" +#include "span/lv_span.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_WIDGETS_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/menu/lv_menu.c b/L3_Middlewares/LVGL/src/extra/widgets/menu/lv_menu.c similarity index 75% rename from L3_Middlewares/LVGL/src/widgets/menu/lv_menu.c rename to L3_Middlewares/LVGL/src/extra/widgets/menu/lv_menu.c index f9b49fc..f8dfd41 100644 --- a/L3_Middlewares/LVGL/src/widgets/menu/lv_menu.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/menu/lv_menu.c @@ -6,22 +6,20 @@ /********************* * INCLUDES *********************/ -#include "lv_menu_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_menu.h" #if LV_USE_MENU /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_menu_class) +#define MY_CLASS &lv_menu_class -#include "../../core/lv_obj_private.h" -#include "../../layouts/lv_layout.h" -#include "../../stdlib/lv_string.h" -#include "../label/lv_label.h" -#include "../button/lv_button.h" -#include "../image/lv_image.h" +#include "../../../core/lv_obj.h" +#include "../../layouts/flex/lv_flex.h" +#include "../../../widgets/lv_label.h" +#include "../../../widgets/lv_btn.h" +#include "../../../widgets/lv_img.h" /********************** * TYPEDEFS @@ -43,8 +41,7 @@ const lv_obj_class_t lv_menu_class = { .base_class = &lv_obj_class, .width_def = (LV_DPI_DEF * 3) / 2, .height_def = LV_DPI_DEF * 2, - .instance_size = sizeof(lv_menu_t), - .name = "menu", + .instance_size = sizeof(lv_menu_t) }; const lv_obj_class_t lv_menu_page_class = { .constructor_cb = lv_menu_page_constructor, @@ -52,54 +49,50 @@ const lv_obj_class_t lv_menu_page_class = { .base_class = &lv_obj_class, .width_def = LV_PCT(100), .height_def = LV_SIZE_CONTENT, - .instance_size = sizeof(lv_menu_page_t), - .name = "menu-page", + .instance_size = sizeof(lv_menu_page_t) }; const lv_obj_class_t lv_menu_cont_class = { .constructor_cb = lv_menu_cont_constructor, .base_class = &lv_obj_class, .width_def = LV_PCT(100), - .height_def = LV_SIZE_CONTENT, - .name = "menu-cont", + .height_def = LV_SIZE_CONTENT }; const lv_obj_class_t lv_menu_section_class = { .constructor_cb = lv_menu_section_constructor, .base_class = &lv_obj_class, .width_def = LV_PCT(100), - .height_def = LV_SIZE_CONTENT, - .name = "menu-section", + .height_def = LV_SIZE_CONTENT }; const lv_obj_class_t lv_menu_separator_class = { .base_class = &lv_obj_class, .width_def = LV_SIZE_CONTENT, - .height_def = LV_SIZE_CONTENT, - .name = "menu-separator", + .height_def = LV_SIZE_CONTENT }; const lv_obj_class_t lv_menu_sidebar_cont_class = { - .base_class = &lv_obj_class, + .base_class = &lv_obj_class }; const lv_obj_class_t lv_menu_main_cont_class = { - .base_class = &lv_obj_class, + .base_class = &lv_obj_class }; const lv_obj_class_t lv_menu_main_header_cont_class = { - .base_class = &lv_obj_class, + .base_class = &lv_obj_class }; const lv_obj_class_t lv_menu_sidebar_header_cont_class = { - .base_class = &lv_obj_class, + .base_class = &lv_obj_class }; static void lv_menu_refr(lv_obj_t * obj); static void lv_menu_refr_sidebar_header_mode(lv_obj_t * obj); static void lv_menu_refr_main_header_mode(lv_obj_t * obj); static void lv_menu_load_page_event_cb(lv_event_t * e); -static void lv_menu_obj_delete_event_cb(lv_event_t * e); +static void lv_menu_obj_del_event_cb(lv_event_t * e); static void lv_menu_back_event_cb(lv_event_t * e); static void lv_menu_value_changed_event_cb(lv_event_t * e); /********************** @@ -113,7 +106,7 @@ static void lv_menu_value_changed_event_cb(lv_event_t * e); /********************** * GLOBAL FUNCTIONS **********************/ -bool lv_menu_item_back_button_is_root(lv_obj_t * menu, lv_obj_t * obj); +bool lv_menu_item_back_btn_is_root(lv_obj_t * menu, lv_obj_t * obj); void lv_menu_clear_history(lv_obj_t * obj); lv_obj_t * lv_menu_create(lv_obj_t * parent) @@ -124,17 +117,22 @@ lv_obj_t * lv_menu_create(lv_obj_t * parent) return obj; } -lv_obj_t * lv_menu_page_create(lv_obj_t * parent, char const * const title) +lv_obj_t * lv_menu_page_create(lv_obj_t * parent, char * title) { LV_LOG_INFO("begin"); lv_obj_t * obj = lv_obj_class_create_obj(&lv_menu_page_class, parent); lv_obj_class_init_obj(obj); lv_menu_page_t * page = (lv_menu_page_t *)obj; - /* Initialise the object */ - page->title = NULL; - page->static_title = false; - lv_menu_set_page_title(obj, title); + if(title) { + page->title = lv_mem_alloc(strlen(title) + 1); + LV_ASSERT_MALLOC(page->title); + if(page->title == NULL) return NULL; + strcpy(page->title, title); + } + else { + page->title = NULL; + } return obj; } @@ -171,15 +169,15 @@ void lv_menu_refr(lv_obj_t * obj) lv_ll_t * history_ll = &(menu->history_ll); /* The current menu */ - lv_menu_history_t * act_hist = lv_ll_get_head(history_ll); + lv_menu_history_t * act_hist = _lv_ll_get_head(history_ll); lv_obj_t * page = NULL; if(act_hist != NULL) { page = act_hist->page; /* Delete the current item from the history */ - lv_ll_remove(history_ll, act_hist); - lv_free(act_hist); + _lv_ll_remove(history_ll, act_hist); + lv_mem_free(act_hist); menu->cur_depth--; } @@ -197,6 +195,11 @@ void lv_menu_set_page(lv_obj_t * obj, lv_obj_t * page) lv_menu_t * menu = (lv_menu_t *)obj; + /* Guard against setting the same page again */ + if(menu->main_page == page) { + return; + } + /* Hide previous page */ if(menu->main_page != NULL) { lv_obj_set_parent(menu->main_page, menu->storage); @@ -205,7 +208,7 @@ void lv_menu_set_page(lv_obj_t * obj, lv_obj_t * page) if(page != NULL) { /* Add a new node */ lv_ll_t * history_ll = &(menu->history_ll); - lv_menu_history_t * new_node = lv_ll_ins_head(history_ll); + lv_menu_history_t * new_node = _lv_ll_ins_head(history_ll); LV_ASSERT_MALLOC(new_node); new_node->page = page; menu->cur_depth++; @@ -226,7 +229,7 @@ void lv_menu_set_page(lv_obj_t * obj, lv_obj_t * page) lv_obj_add_state(menu->selected_tab, LV_STATE_CHECKED); } else { - lv_obj_remove_state(menu->selected_tab, LV_STATE_CHECKED); + lv_obj_clear_state(menu->selected_tab, LV_STATE_CHECKED); } } @@ -234,39 +237,39 @@ void lv_menu_set_page(lv_obj_t * obj, lv_obj_t * page) if(menu->sidebar_page != NULL) { /* With sidebar enabled */ if(menu->sidebar_generated) { - if(menu->mode_root_back_btn == LV_MENU_ROOT_BACK_BUTTON_ENABLED) { + if(menu->mode_root_back_btn == LV_MENU_ROOT_BACK_BTN_ENABLED) { /* Root back btn is always shown if enabled*/ - lv_obj_remove_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } else { lv_obj_add_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_HIDDEN); - lv_obj_remove_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_CLICKABLE); + lv_obj_clear_flag(menu->sidebar_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } } if(menu->cur_depth >= 2) { - lv_obj_remove_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } else { lv_obj_add_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); - lv_obj_remove_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); + lv_obj_clear_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } } else { /* With sidebar disabled */ - if(menu->cur_depth >= 2 || menu->mode_root_back_btn == LV_MENU_ROOT_BACK_BUTTON_ENABLED) { - lv_obj_remove_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); + if(menu->cur_depth >= 2 || menu->mode_root_back_btn == LV_MENU_ROOT_BACK_BTN_ENABLED) { + lv_obj_clear_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); lv_obj_add_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } else { lv_obj_add_flag(menu->main_header_back_btn, LV_OBJ_FLAG_HIDDEN); - lv_obj_remove_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); + lv_obj_clear_flag(menu->main_header_back_btn, LV_OBJ_FLAG_CLICKABLE); } } - lv_obj_send_event((lv_obj_t *)menu, LV_EVENT_VALUE_CHANGED, NULL); + lv_event_send((lv_obj_t *)menu, LV_EVENT_VALUE_CHANGED, NULL); lv_menu_refr_main_header_mode(obj); } @@ -288,7 +291,7 @@ void lv_menu_set_sidebar_page(lv_obj_t * obj, lv_obj_t * page) lv_obj_set_size(sidebar_cont, LV_PCT(30), LV_PCT(100)); lv_obj_set_flex_flow(sidebar_cont, LV_FLEX_FLOW_COLUMN); lv_obj_add_flag(sidebar_cont, LV_OBJ_FLAG_EVENT_BUBBLE); - lv_obj_remove_flag(sidebar_cont, LV_OBJ_FLAG_CLICKABLE); + lv_obj_clear_flag(sidebar_cont, LV_OBJ_FLAG_CLICKABLE); menu->sidebar = sidebar_cont; lv_obj_t * sidebar_header = lv_obj_class_create_obj(&lv_menu_sidebar_header_cont_class, sidebar_cont); @@ -296,18 +299,18 @@ void lv_menu_set_sidebar_page(lv_obj_t * obj, lv_obj_t * page) lv_obj_set_size(sidebar_header, LV_PCT(100), LV_SIZE_CONTENT); lv_obj_set_flex_flow(sidebar_header, LV_FLEX_FLOW_ROW); lv_obj_set_flex_align(sidebar_header, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); - lv_obj_remove_flag(sidebar_header, LV_OBJ_FLAG_CLICKABLE); + lv_obj_clear_flag(sidebar_header, LV_OBJ_FLAG_CLICKABLE); lv_obj_add_flag(sidebar_header, LV_OBJ_FLAG_EVENT_BUBBLE); menu->sidebar_header = sidebar_header; - lv_obj_t * sidebar_header_back_btn = lv_button_create(menu->sidebar_header); + lv_obj_t * sidebar_header_back_btn = lv_btn_create(menu->sidebar_header); lv_obj_add_event_cb(sidebar_header_back_btn, lv_menu_back_event_cb, LV_EVENT_CLICKED, menu); lv_obj_add_flag(sidebar_header_back_btn, LV_OBJ_FLAG_EVENT_BUBBLE); lv_obj_set_flex_flow(sidebar_header_back_btn, LV_FLEX_FLOW_ROW); menu->sidebar_header_back_btn = sidebar_header_back_btn; - lv_obj_t * sidebar_header_back_icon = lv_image_create(menu->sidebar_header_back_btn); - lv_image_set_src(sidebar_header_back_icon, LV_SYMBOL_LEFT); + lv_obj_t * sidebar_header_back_icon = lv_img_create(menu->sidebar_header_back_btn); + lv_img_set_src(sidebar_header_back_icon, LV_SYMBOL_LEFT); lv_obj_t * sidebar_header_title = lv_label_create(menu->sidebar_header); lv_obj_add_flag(sidebar_header_title, LV_OBJ_FLAG_HIDDEN); @@ -324,7 +327,7 @@ void lv_menu_set_sidebar_page(lv_obj_t * obj, lv_obj_t * page) /* Sidebar should be disabled */ if(menu->sidebar_generated) { lv_obj_set_parent(menu->sidebar_page, menu->storage); - lv_obj_delete(menu->sidebar); + lv_obj_del(menu->sidebar); menu->sidebar_generated = false; } @@ -334,27 +337,27 @@ void lv_menu_set_sidebar_page(lv_obj_t * obj, lv_obj_t * page) lv_menu_refr(obj); } -void lv_menu_set_mode_header(lv_obj_t * obj, lv_menu_mode_header_t mode) +void lv_menu_set_mode_header(lv_obj_t * obj, lv_menu_mode_header_t mode_header) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_menu_t * menu = (lv_menu_t *)obj; - if(menu->mode_header != mode) { - menu->mode_header = mode; + if(menu->mode_header != mode_header) { + menu->mode_header = mode_header; lv_menu_refr_main_header_mode(obj); if(menu->sidebar_generated) lv_menu_refr_sidebar_header_mode(obj); } } -void lv_menu_set_mode_root_back_button(lv_obj_t * obj, lv_menu_mode_root_back_button_t mode) +void lv_menu_set_mode_root_back_btn(lv_obj_t * obj, lv_menu_mode_root_back_btn_t mode_root_back_btn) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_menu_t * menu = (lv_menu_t *)obj; - if(menu->mode_root_back_btn != mode) { - menu->mode_root_back_btn = mode; + if(menu->mode_root_back_btn != mode_root_back_btn) { + menu->mode_root_back_btn = mode_root_back_btn; lv_menu_refr(obj); } } @@ -364,74 +367,21 @@ void lv_menu_set_load_page_event(lv_obj_t * menu, lv_obj_t * obj, lv_obj_t * pag LV_ASSERT_OBJ(menu, MY_CLASS); lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); /* Remove old event */ - uint32_t i; - uint32_t event_cnt = lv_obj_get_event_count(obj); - for(i = 0; i < event_cnt; i++) { - lv_event_dsc_t * event_dsc = lv_obj_get_event_dsc(obj, i); - if(lv_event_dsc_get_cb(event_dsc) == lv_menu_load_page_event_cb) { - lv_obj_send_event(obj, LV_EVENT_DELETE, NULL); - lv_obj_remove_event(obj, i); - break; - } + if(lv_obj_remove_event_cb(obj, lv_menu_load_page_event_cb)) { + lv_event_send(obj, LV_EVENT_DELETE, NULL); + lv_obj_remove_event_cb(obj, lv_menu_obj_del_event_cb); } - lv_menu_load_page_event_data_t * event_data = lv_malloc(sizeof(lv_menu_load_page_event_data_t)); + lv_menu_load_page_event_data_t * event_data = lv_mem_alloc(sizeof(lv_menu_load_page_event_data_t)); event_data->menu = menu; event_data->page = page; lv_obj_add_event_cb(obj, lv_menu_load_page_event_cb, LV_EVENT_CLICKED, event_data); - lv_obj_add_event_cb(obj, lv_menu_obj_delete_event_cb, LV_EVENT_DELETE, event_data); -} - -void lv_menu_set_page_title(lv_obj_t * page_obj, char const * const title) -{ - LV_LOG_INFO("begin"); - lv_menu_page_t * page = (lv_menu_page_t *)page_obj; - - /* Cleanup any previous set titles */ - if((!page->static_title) && page->title) { - lv_free(page->title); - page->title = NULL; - } - - if(title) { - page->static_title = false; - page->title = lv_strdup(title); - LV_ASSERT_MALLOC(page->title); - if(page->title == NULL) { - return; - } - } - else { - page->title = NULL; - page->static_title = false; - } -} - -void lv_menu_set_page_title_static(lv_obj_t * page_obj, char const * const title) -{ - LV_LOG_INFO("begin"); - lv_menu_page_t * page = (lv_menu_page_t *)page_obj; - - /* Cleanup any previous set titles */ - if((!page->static_title) && page->title) { - lv_free(page->title); - page->title = NULL; - } - - /* Set or clear the static title text */ - if(title) { - page->title = (char *) title; - page->static_title = true; - } - else { - page->title = NULL; - page->static_title = false; - } + lv_obj_add_event_cb(obj, lv_menu_obj_del_event_cb, LV_EVENT_DELETE, event_data); } /*===================== @@ -461,7 +411,7 @@ lv_obj_t * lv_menu_get_main_header(lv_obj_t * obj) return menu->main_header; } -lv_obj_t * lv_menu_get_main_header_back_button(lv_obj_t * obj) +lv_obj_t * lv_menu_get_main_header_back_btn(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -477,7 +427,7 @@ lv_obj_t * lv_menu_get_sidebar_header(lv_obj_t * obj) return menu->sidebar_header; } -lv_obj_t * lv_menu_get_sidebar_header_back_button(lv_obj_t * obj) +lv_obj_t * lv_menu_get_sidebar_header_back_btn(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -485,7 +435,7 @@ lv_obj_t * lv_menu_get_sidebar_header_back_button(lv_obj_t * obj) return menu->sidebar_header_back_btn; } -bool lv_menu_back_button_is_root(lv_obj_t * menu, lv_obj_t * obj) +bool lv_menu_back_btn_is_root(lv_obj_t * menu, lv_obj_t * obj) { LV_ASSERT_OBJ(menu, MY_CLASS); @@ -507,7 +457,7 @@ void lv_menu_clear_history(lv_obj_t * obj) lv_menu_t * menu = (lv_menu_t *)obj; lv_ll_t * history_ll = &(menu->history_ll); - lv_ll_clear(history_ll); + _lv_ll_clear(history_ll); menu->cur_depth = 0; } @@ -527,12 +477,12 @@ static void lv_menu_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_menu_t * menu = (lv_menu_t *)obj; menu->mode_header = LV_MENU_HEADER_TOP_FIXED; - menu->mode_root_back_btn = LV_MENU_ROOT_BACK_BUTTON_DISABLED; + menu->mode_root_back_btn = LV_MENU_ROOT_BACK_BTN_DISABLED; menu->cur_depth = 0; menu->prev_depth = 0; menu->sidebar_generated = false; - lv_ll_init(&(menu->history_ll), sizeof(lv_menu_history_t)); + _lv_ll_init(&(menu->history_ll), sizeof(lv_menu_history_t)); menu->storage = lv_obj_create(obj); lv_obj_add_flag(menu->storage, LV_OBJ_FLAG_HIDDEN); @@ -549,7 +499,7 @@ static void lv_menu_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_set_flex_grow(main_cont, 1); lv_obj_set_flex_flow(main_cont, LV_FLEX_FLOW_COLUMN); lv_obj_add_flag(main_cont, LV_OBJ_FLAG_EVENT_BUBBLE); - lv_obj_remove_flag(main_cont, LV_OBJ_FLAG_CLICKABLE); + lv_obj_clear_flag(main_cont, LV_OBJ_FLAG_CLICKABLE); menu->main = main_cont; lv_obj_t * main_header = lv_obj_class_create_obj(&lv_menu_main_header_cont_class, main_cont); @@ -557,19 +507,19 @@ static void lv_menu_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_set_size(main_header, LV_PCT(100), LV_SIZE_CONTENT); lv_obj_set_flex_flow(main_header, LV_FLEX_FLOW_ROW); lv_obj_set_flex_align(main_header, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); - lv_obj_remove_flag(main_header, LV_OBJ_FLAG_CLICKABLE); + lv_obj_clear_flag(main_header, LV_OBJ_FLAG_CLICKABLE); lv_obj_add_flag(main_header, LV_OBJ_FLAG_EVENT_BUBBLE); menu->main_header = main_header; /* Create the default simple back btn and title */ - lv_obj_t * main_header_back_btn = lv_button_create(menu->main_header); + lv_obj_t * main_header_back_btn = lv_btn_create(menu->main_header); lv_obj_add_event_cb(main_header_back_btn, lv_menu_back_event_cb, LV_EVENT_CLICKED, menu); lv_obj_add_flag(main_header_back_btn, LV_OBJ_FLAG_EVENT_BUBBLE); lv_obj_set_flex_flow(main_header_back_btn, LV_FLEX_FLOW_ROW); menu->main_header_back_btn = main_header_back_btn; - lv_obj_t * main_header_back_icon = lv_image_create(menu->main_header_back_btn); - lv_image_set_src(main_header_back_icon, LV_SYMBOL_LEFT); + lv_obj_t * main_header_back_icon = lv_img_create(menu->main_header_back_btn); + lv_img_set_src(main_header_back_icon, LV_SYMBOL_LEFT); lv_obj_t * main_header_title = lv_label_create(menu->main_header); lv_obj_add_flag(main_header_title, LV_OBJ_FLAG_HIDDEN); @@ -591,7 +541,7 @@ static void lv_menu_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_menu_t * menu = (lv_menu_t *)obj; lv_ll_t * history_ll = &(menu->history_ll); - lv_ll_clear(history_ll); + _lv_ll_clear(history_ll); LV_TRACE_OBJ_CREATE("finished"); } @@ -614,11 +564,10 @@ static void lv_menu_page_destructor(const lv_obj_class_t * class_p, lv_obj_t * o lv_menu_page_t * page = (lv_menu_page_t *)obj; - if((!page->static_title) && page->title != NULL) { - lv_free(page->title); + if(page->title != NULL) { + lv_mem_free(page->title); + page->title = NULL; } - page->title = NULL; - page->static_title = false; } static void lv_menu_cont_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) @@ -626,14 +575,14 @@ static void lv_menu_cont_constructor(const lv_obj_class_t * class_p, lv_obj_t * LV_UNUSED(class_p); lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW); lv_obj_set_flex_align(obj, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); } static void lv_menu_section_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { LV_UNUSED(class_p); lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); } static void lv_menu_refr_sidebar_header_mode(lv_obj_t * obj) @@ -667,7 +616,7 @@ static void lv_menu_refr_sidebar_header_mode(lv_obj_t * obj) lv_obj_add_flag(menu->sidebar_header, LV_OBJ_FLAG_HIDDEN); } else { - lv_obj_remove_flag(menu->sidebar_header, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(menu->sidebar_header, LV_OBJ_FLAG_HIDDEN); } } @@ -703,13 +652,13 @@ static void lv_menu_refr_main_header_mode(lv_obj_t * obj) lv_obj_add_flag(menu->main_header, LV_OBJ_FLAG_HIDDEN); } else { - lv_obj_remove_flag(menu->main_header, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(menu->main_header, LV_OBJ_FLAG_HIDDEN); } } static void lv_menu_load_page_event_cb(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_menu_load_page_event_data_t * event_data = lv_event_get_user_data(e); lv_menu_t * menu = (lv_menu_t *)(event_data->menu); lv_obj_t * page = event_data->page; @@ -731,7 +680,7 @@ static void lv_menu_load_page_event_cb(lv_event_t * e) if(sidebar) { /* Clear checked state of previous obj */ if(menu->selected_tab != obj && menu->selected_tab != NULL) { - lv_obj_remove_state(menu->selected_tab, LV_STATE_CHECKED); + lv_obj_clear_state(menu->selected_tab, LV_STATE_CHECKED); } lv_menu_clear_history((lv_obj_t *)menu); @@ -748,10 +697,10 @@ static void lv_menu_load_page_event_cb(lv_event_t * e) } } -static void lv_menu_obj_delete_event_cb(lv_event_t * e) +static void lv_menu_obj_del_event_cb(lv_event_t * e) { lv_menu_load_page_event_data_t * event_data = lv_event_get_user_data(e); - lv_free(event_data); + lv_mem_free(event_data); } static void lv_menu_back_event_cb(lv_event_t * e) @@ -759,36 +708,36 @@ static void lv_menu_back_event_cb(lv_event_t * e) lv_event_code_t code = lv_event_get_code(e); /* LV_EVENT_CLICKED */ if(code == LV_EVENT_CLICKED) { - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_menu_t * menu = (lv_menu_t *)lv_event_get_user_data(e); if(!(obj == menu->main_header_back_btn || obj == menu->sidebar_header_back_btn)) return; menu->prev_depth = menu->cur_depth; /* Save the previous value for user event handler */ - if(lv_menu_back_button_is_root((lv_obj_t *)menu, obj)) return; + if(lv_menu_back_btn_is_root((lv_obj_t *)menu, obj)) return; lv_ll_t * history_ll = &(menu->history_ll); /* The current menu */ - lv_menu_history_t * act_hist = lv_ll_get_head(history_ll); + lv_menu_history_t * act_hist = _lv_ll_get_head(history_ll); /* The previous menu */ - lv_menu_history_t * prev_hist = lv_ll_get_next(history_ll, act_hist); + lv_menu_history_t * prev_hist = _lv_ll_get_next(history_ll, act_hist); if(prev_hist != NULL) { /* Previous menu exists */ /* Delete the current item from the history */ - lv_ll_remove(history_ll, act_hist); - lv_free(act_hist); + _lv_ll_remove(history_ll, act_hist); + lv_mem_free(act_hist); menu->cur_depth--; /* Create the previous menu. * Remove it from the history because `lv_menu_set_page` will add it again */ - lv_ll_remove(history_ll, prev_hist); + _lv_ll_remove(history_ll, prev_hist); menu->cur_depth--; lv_menu_set_page(&(menu->obj), prev_hist->page); - lv_free(prev_hist); + lv_mem_free(prev_hist); } } } @@ -802,7 +751,7 @@ static void lv_menu_value_changed_event_cb(lv_event_t * e) if(main_page != NULL && menu->main_header_title != NULL) { if(main_page->title != NULL) { lv_label_set_text(menu->main_header_title, main_page->title); - lv_obj_remove_flag(menu->main_header_title, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(menu->main_header_title, LV_OBJ_FLAG_HIDDEN); } else { lv_obj_add_flag(menu->main_header_title, LV_OBJ_FLAG_HIDDEN); @@ -813,7 +762,7 @@ static void lv_menu_value_changed_event_cb(lv_event_t * e) if(sidebar_page != NULL && menu->sidebar_header_title != NULL) { if(sidebar_page->title != NULL) { lv_label_set_text(menu->sidebar_header_title, sidebar_page->title); - lv_obj_remove_flag(menu->sidebar_header_title, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(menu->sidebar_header_title, LV_OBJ_FLAG_HIDDEN); } else { lv_obj_add_flag(menu->sidebar_header_title, LV_OBJ_FLAG_HIDDEN); diff --git a/L3_Middlewares/LVGL/src/extra/widgets/menu/lv_menu.h b/L3_Middlewares/LVGL/src/extra/widgets/menu/lv_menu.h new file mode 100644 index 0000000..0449059 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/menu/lv_menu.h @@ -0,0 +1,233 @@ +/** + * @file lv_menu.h + * + */ + +#ifndef LV_MENU_H +#define LV_MENU_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../core/lv_obj.h" + +#if LV_USE_MENU + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +enum { + LV_MENU_HEADER_TOP_FIXED, /* Header is positioned at the top */ + LV_MENU_HEADER_TOP_UNFIXED, /* Header is positioned at the top and can be scrolled out of view*/ + LV_MENU_HEADER_BOTTOM_FIXED /* Header is positioned at the bottom */ +}; +typedef uint8_t lv_menu_mode_header_t; + +enum { + LV_MENU_ROOT_BACK_BTN_DISABLED, + LV_MENU_ROOT_BACK_BTN_ENABLED +}; +typedef uint8_t lv_menu_mode_root_back_btn_t; + +typedef struct lv_menu_load_page_event_data_t { + lv_obj_t * menu; + lv_obj_t * page; +} lv_menu_load_page_event_data_t; + +typedef struct { + lv_obj_t * page; +} lv_menu_history_t; + +typedef struct { + lv_obj_t obj; + lv_obj_t * storage; /* a pointer to obj that is the parent of all pages not displayed */ + lv_obj_t * main; + lv_obj_t * main_page; + lv_obj_t * main_header; + lv_obj_t * + main_header_back_btn; /* a pointer to obj that on click triggers back btn event handler, can be same as 'main_header' */ + lv_obj_t * main_header_title; + lv_obj_t * sidebar; + lv_obj_t * sidebar_page; + lv_obj_t * sidebar_header; + lv_obj_t * + sidebar_header_back_btn; /* a pointer to obj that on click triggers back btn event handler, can be same as 'sidebar_header' */ + lv_obj_t * sidebar_header_title; + lv_obj_t * selected_tab; + lv_ll_t history_ll; + uint8_t cur_depth; + uint8_t prev_depth; + uint8_t sidebar_generated : 1; + lv_menu_mode_header_t mode_header : 2; + lv_menu_mode_root_back_btn_t mode_root_back_btn : 1; +} lv_menu_t; + +typedef struct { + lv_obj_t obj; + char * title; +} lv_menu_page_t; + +extern const lv_obj_class_t lv_menu_class; +extern const lv_obj_class_t lv_menu_page_class; +extern const lv_obj_class_t lv_menu_cont_class; +extern const lv_obj_class_t lv_menu_section_class; +extern const lv_obj_class_t lv_menu_separator_class; +extern const lv_obj_class_t lv_menu_sidebar_cont_class; +extern const lv_obj_class_t lv_menu_main_cont_class; +extern const lv_obj_class_t lv_menu_sidebar_header_cont_class; +extern const lv_obj_class_t lv_menu_main_header_cont_class; +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create a menu object + * @param parent pointer to an object, it will be the parent of the new menu + * @return pointer to the created menu + */ +lv_obj_t * lv_menu_create(lv_obj_t * parent); + +/** + * Create a menu page object + * @param parent pointer to menu object + * @param title pointer to text for title in header (NULL to not display title) + * @return pointer to the created menu page + */ +lv_obj_t * lv_menu_page_create(lv_obj_t * parent, char * title); + +/** + * Create a menu cont object + * @param parent pointer to an object, it will be the parent of the new menu cont object + * @return pointer to the created menu cont + */ +lv_obj_t * lv_menu_cont_create(lv_obj_t * parent); + +/** + * Create a menu section object + * @param parent pointer to an object, it will be the parent of the new menu section object + * @return pointer to the created menu section + */ +lv_obj_t * lv_menu_section_create(lv_obj_t * parent); + +/** + * Create a menu separator object + * @param parent pointer to an object, it will be the parent of the new menu separator object + * @return pointer to the created menu separator + */ +lv_obj_t * lv_menu_separator_create(lv_obj_t * parent); +/*===================== + * Setter functions + *====================*/ +/** + * Set menu page to display in main + * @param obj pointer to the menu + * @param page pointer to the menu page to set (NULL to clear main and clear menu history) + */ +void lv_menu_set_page(lv_obj_t * obj, lv_obj_t * page); + +/** + * Set menu page to display in sidebar + * @param obj pointer to the menu + * @param page pointer to the menu page to set (NULL to clear sidebar) + */ +void lv_menu_set_sidebar_page(lv_obj_t * obj, lv_obj_t * page); + +/** + * Set the how the header should behave and its position + * @param obj pointer to a menu + * @param mode_header + */ +void lv_menu_set_mode_header(lv_obj_t * obj, lv_menu_mode_header_t mode_header); + +/** + * Set whether back button should appear at root + * @param obj pointer to a menu + * @param mode_root_back_btn + */ +void lv_menu_set_mode_root_back_btn(lv_obj_t * obj, lv_menu_mode_root_back_btn_t mode_root_back_btn); + +/** + * Add menu to the menu item + * @param menu pointer to the menu + * @param obj pointer to the obj + * @param page pointer to the page to load when obj is clicked + */ +void lv_menu_set_load_page_event(lv_obj_t * menu, lv_obj_t * obj, lv_obj_t * page); + +/*===================== + * Getter functions + *====================*/ +/** +* Get a pointer to menu page that is currently displayed in main +* @param obj pointer to the menu +* @return pointer to current page +*/ +lv_obj_t * lv_menu_get_cur_main_page(lv_obj_t * obj); + +/** +* Get a pointer to menu page that is currently displayed in sidebar +* @param obj pointer to the menu +* @return pointer to current page +*/ +lv_obj_t * lv_menu_get_cur_sidebar_page(lv_obj_t * obj); + +/** +* Get a pointer to main header obj +* @param obj pointer to the menu +* @return pointer to main header obj +*/ +lv_obj_t * lv_menu_get_main_header(lv_obj_t * obj); + +/** +* Get a pointer to main header back btn obj +* @param obj pointer to the menu +* @return pointer to main header back btn obj +*/ +lv_obj_t * lv_menu_get_main_header_back_btn(lv_obj_t * obj); + +/** +* Get a pointer to sidebar header obj +* @param obj pointer to the menu +* @return pointer to sidebar header obj +*/ +lv_obj_t * lv_menu_get_sidebar_header(lv_obj_t * obj); + +/** +* Get a pointer to sidebar header obj +* @param obj pointer to the menu +* @return pointer to sidebar header back btn obj +*/ +lv_obj_t * lv_menu_get_sidebar_header_back_btn(lv_obj_t * obj); + +/** + * Check if an obj is a root back btn + * @param menu pointer to the menu + * @return true if it is a root back btn + */ +bool lv_menu_back_btn_is_root(lv_obj_t * menu, lv_obj_t * obj); + +/** + * Clear menu history + * @param obj pointer to the menu + */ +void lv_menu_clear_history(lv_obj_t * obj); +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_MENU*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_MENU_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/widgets/meter/lv_meter.c b/L3_Middlewares/LVGL/src/extra/widgets/meter/lv_meter.c new file mode 100644 index 0000000..f1ea9d5 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/meter/lv_meter.c @@ -0,0 +1,702 @@ +/** + * @file lv_meter.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_meter.h" +#if LV_USE_METER != 0 + +#include "../../../misc/lv_assert.h" + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_meter_class + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_meter_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_meter_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_meter_event(const lv_obj_class_t * class_p, lv_event_t * e); +static void draw_arcs(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx, const lv_area_t * scale_area); +static void draw_ticks_and_labels(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx, const lv_area_t * scale_area); +static void draw_needles(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx, const lv_area_t * scale_area); +static void inv_arc(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t old_value, int32_t new_value); +static void inv_line(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value); + +/********************** + * STATIC VARIABLES + **********************/ +const lv_obj_class_t lv_meter_class = { + .constructor_cb = lv_meter_constructor, + .destructor_cb = lv_meter_destructor, + .event_cb = lv_meter_event, + .instance_size = sizeof(lv_meter_t), + .base_class = &lv_obj_class +}; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_obj_t * lv_meter_create(lv_obj_t * parent) +{ + LV_LOG_INFO("begin"); + lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); + lv_obj_class_init_obj(obj); + return obj; +} + +/*===================== + * Add scale + *====================*/ + +lv_meter_scale_t * lv_meter_add_scale(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_meter_t * meter = (lv_meter_t *)obj; + + lv_meter_scale_t * scale = _lv_ll_ins_head(&meter->scale_ll); + LV_ASSERT_MALLOC(scale); + lv_memset_00(scale, sizeof(lv_meter_scale_t)); + + scale->angle_range = 270; + scale->rotation = 90 + (360 - scale->angle_range) / 2; + scale->min = 0; + scale->max = 100; + scale->tick_cnt = 6; + scale->tick_length = 8; + scale->tick_width = 2; + scale->label_gap = 2; + + return scale; +} + +void lv_meter_set_scale_ticks(lv_obj_t * obj, lv_meter_scale_t * scale, uint16_t cnt, uint16_t width, uint16_t len, + lv_color_t color) +{ + scale->tick_cnt = cnt; + scale->tick_width = width; + scale->tick_length = len; + scale->tick_color = color; + lv_obj_invalidate(obj); +} + +void lv_meter_set_scale_major_ticks(lv_obj_t * obj, lv_meter_scale_t * scale, uint16_t nth, uint16_t width, + uint16_t len, lv_color_t color, int16_t label_gap) +{ + scale->tick_major_nth = nth; + scale->tick_major_width = width; + scale->tick_major_length = len; + scale->tick_major_color = color; + scale->label_gap = label_gap; + lv_obj_invalidate(obj); +} + +void lv_meter_set_scale_range(lv_obj_t * obj, lv_meter_scale_t * scale, int32_t min, int32_t max, uint32_t angle_range, + uint32_t rotation) +{ + scale->min = min; + scale->max = max; + scale->angle_range = angle_range; + scale->rotation = rotation; + lv_obj_invalidate(obj); +} + +/*===================== + * Add indicator + *====================*/ + +lv_meter_indicator_t * lv_meter_add_needle_line(lv_obj_t * obj, lv_meter_scale_t * scale, uint16_t width, + lv_color_t color, int16_t r_mod) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_meter_t * meter = (lv_meter_t *)obj; + lv_meter_indicator_t * indic = _lv_ll_ins_head(&meter->indicator_ll); + LV_ASSERT_MALLOC(indic); + lv_memset_00(indic, sizeof(lv_meter_indicator_t)); + indic->scale = scale; + indic->opa = LV_OPA_COVER; + + indic->type = LV_METER_INDICATOR_TYPE_NEEDLE_LINE; + indic->type_data.needle_line.width = width; + indic->type_data.needle_line.color = color; + indic->type_data.needle_line.r_mod = r_mod; + lv_obj_invalidate(obj); + + return indic; +} + +lv_meter_indicator_t * lv_meter_add_needle_img(lv_obj_t * obj, lv_meter_scale_t * scale, const void * src, + lv_coord_t pivot_x, lv_coord_t pivot_y) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_meter_t * meter = (lv_meter_t *)obj; + lv_meter_indicator_t * indic = _lv_ll_ins_head(&meter->indicator_ll); + LV_ASSERT_MALLOC(indic); + lv_memset_00(indic, sizeof(lv_meter_indicator_t)); + indic->scale = scale; + indic->opa = LV_OPA_COVER; + + indic->type = LV_METER_INDICATOR_TYPE_NEEDLE_IMG; + indic->type_data.needle_img.src = src; + indic->type_data.needle_img.pivot.x = pivot_x; + indic->type_data.needle_img.pivot.y = pivot_y; + lv_obj_invalidate(obj); + + return indic; +} + +lv_meter_indicator_t * lv_meter_add_arc(lv_obj_t * obj, lv_meter_scale_t * scale, uint16_t width, lv_color_t color, + int16_t r_mod) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_meter_t * meter = (lv_meter_t *)obj; + lv_meter_indicator_t * indic = _lv_ll_ins_head(&meter->indicator_ll); + LV_ASSERT_MALLOC(indic); + lv_memset_00(indic, sizeof(lv_meter_indicator_t)); + indic->scale = scale; + indic->opa = LV_OPA_COVER; + + indic->type = LV_METER_INDICATOR_TYPE_ARC; + indic->type_data.arc.width = width; + indic->type_data.arc.color = color; + indic->type_data.arc.r_mod = r_mod; + + lv_obj_invalidate(obj); + return indic; +} + +lv_meter_indicator_t * lv_meter_add_scale_lines(lv_obj_t * obj, lv_meter_scale_t * scale, lv_color_t color_start, + lv_color_t color_end, bool local, int16_t width_mod) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_meter_t * meter = (lv_meter_t *)obj; + lv_meter_indicator_t * indic = _lv_ll_ins_head(&meter->indicator_ll); + LV_ASSERT_MALLOC(indic); + lv_memset_00(indic, sizeof(lv_meter_indicator_t)); + indic->scale = scale; + indic->opa = LV_OPA_COVER; + + indic->type = LV_METER_INDICATOR_TYPE_SCALE_LINES; + indic->type_data.scale_lines.color_start = color_start; + indic->type_data.scale_lines.color_end = color_end; + indic->type_data.scale_lines.local_grad = local; + indic->type_data.scale_lines.width_mod = width_mod; + + lv_obj_invalidate(obj); + return indic; +} + +/*===================== + * Set indicator value + *====================*/ + +void lv_meter_set_indicator_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value) +{ + int32_t old_start = indic->start_value; + int32_t old_end = indic->end_value; + indic->start_value = value; + indic->end_value = value; + + if(indic->type == LV_METER_INDICATOR_TYPE_ARC) { + inv_arc(obj, indic, old_start, value); + inv_arc(obj, indic, old_end, value); + } + else if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_IMG || indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_LINE) { + inv_line(obj, indic, old_start); + inv_line(obj, indic, old_end); + inv_line(obj, indic, value); + } + else { + lv_obj_invalidate(obj); + } +} + +void lv_meter_set_indicator_start_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value) +{ + int32_t old_value = indic->start_value; + indic->start_value = value; + + if(indic->type == LV_METER_INDICATOR_TYPE_ARC) { + inv_arc(obj, indic, old_value, value); + } + else if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_IMG || indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_LINE) { + inv_line(obj, indic, old_value); + inv_line(obj, indic, value); + } + else { + lv_obj_invalidate(obj); + } +} + +void lv_meter_set_indicator_end_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value) +{ + int32_t old_value = indic->end_value; + indic->end_value = value; + + if(indic->type == LV_METER_INDICATOR_TYPE_ARC) { + inv_arc(obj, indic, old_value, value); + } + else if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_IMG || indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_LINE) { + inv_line(obj, indic, old_value); + inv_line(obj, indic, value); + } + else { + lv_obj_invalidate(obj); + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_meter_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + LV_TRACE_OBJ_CREATE("begin"); + + lv_meter_t * meter = (lv_meter_t *)obj; + + _lv_ll_init(&meter->scale_ll, sizeof(lv_meter_scale_t)); + _lv_ll_init(&meter->indicator_ll, sizeof(lv_meter_indicator_t)); + + LV_TRACE_OBJ_CREATE("finished"); +} + +static void lv_meter_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_meter_t * meter = (lv_meter_t *)obj; + _lv_ll_clear(&meter->indicator_ll); + _lv_ll_clear(&meter->scale_ll); + +} + +static void lv_meter_event(const lv_obj_class_t * class_p, lv_event_t * e) +{ + LV_UNUSED(class_p); + + lv_res_t res = lv_obj_event_base(MY_CLASS, e); + if(res != LV_RES_OK) return; + + lv_event_code_t code = lv_event_get_code(e); + lv_obj_t * obj = lv_event_get_target(e); + if(code == LV_EVENT_DRAW_MAIN) { + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); + lv_area_t scale_area; + lv_obj_get_content_coords(obj, &scale_area); + + draw_arcs(obj, draw_ctx, &scale_area); + draw_ticks_and_labels(obj, draw_ctx, &scale_area); + draw_needles(obj, draw_ctx, &scale_area); + + lv_coord_t r_edge = lv_area_get_width(&scale_area) / 2; + lv_point_t scale_center; + scale_center.x = scale_area.x1 + r_edge; + scale_center.y = scale_area.y1 + r_edge; + + lv_draw_rect_dsc_t mid_dsc; + lv_draw_rect_dsc_init(&mid_dsc); + lv_obj_init_draw_rect_dsc(obj, LV_PART_INDICATOR, &mid_dsc); + lv_coord_t w = lv_obj_get_style_width(obj, LV_PART_INDICATOR) / 2; + lv_coord_t h = lv_obj_get_style_height(obj, LV_PART_INDICATOR) / 2; + lv_area_t nm_cord; + nm_cord.x1 = scale_center.x - w; + nm_cord.y1 = scale_center.y - h; + nm_cord.x2 = scale_center.x + w; + nm_cord.y2 = scale_center.y + h; + lv_draw_rect(draw_ctx, &mid_dsc, &nm_cord); + } +} + +static void draw_arcs(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx, const lv_area_t * scale_area) +{ + lv_meter_t * meter = (lv_meter_t *)obj; + + lv_draw_arc_dsc_t arc_dsc; + lv_draw_arc_dsc_init(&arc_dsc); + arc_dsc.rounded = lv_obj_get_style_arc_rounded(obj, LV_PART_ITEMS); + + lv_coord_t r_out = lv_area_get_width(scale_area) / 2 ; + lv_point_t scale_center; + scale_center.x = scale_area->x1 + r_out; + scale_center.y = scale_area->y1 + r_out; + + lv_opa_t opa_main = lv_obj_get_style_opa_recursive(obj, LV_PART_MAIN); + lv_meter_indicator_t * indic; + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.arc_dsc = &arc_dsc; + part_draw_dsc.part = LV_PART_INDICATOR; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_METER_DRAW_PART_ARC; + + _LV_LL_READ_BACK(&meter->indicator_ll, indic) { + if(indic->type != LV_METER_INDICATOR_TYPE_ARC) continue; + + arc_dsc.color = indic->type_data.arc.color; + arc_dsc.width = indic->type_data.arc.width; + arc_dsc.opa = indic->opa > LV_OPA_MAX ? opa_main : (opa_main * indic->opa) >> 8; + + lv_meter_scale_t * scale = indic->scale; + + int32_t start_angle = lv_map(indic->start_value, scale->min, scale->max, scale->rotation, + scale->rotation + scale->angle_range); + int32_t end_angle = lv_map(indic->end_value, scale->min, scale->max, scale->rotation, + scale->rotation + scale->angle_range); + + arc_dsc.start_angle = start_angle; + arc_dsc.end_angle = end_angle; + part_draw_dsc.radius = r_out + indic->type_data.arc.r_mod; + part_draw_dsc.sub_part_ptr = indic; + part_draw_dsc.p1 = &scale_center; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_arc(draw_ctx, &arc_dsc, &scale_center, part_draw_dsc.radius, start_angle, end_angle); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } +} + +static void draw_ticks_and_labels(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx, const lv_area_t * scale_area) +{ + lv_meter_t * meter = (lv_meter_t *)obj; + + lv_point_t p_center; + lv_coord_t r_edge = LV_MIN(lv_area_get_width(scale_area) / 2, lv_area_get_height(scale_area) / 2); + p_center.x = scale_area->x1 + r_edge; + p_center.y = scale_area->y1 + r_edge; + + lv_draw_line_dsc_t line_dsc; + lv_draw_line_dsc_init(&line_dsc); + lv_obj_init_draw_line_dsc(obj, LV_PART_TICKS, &line_dsc); + line_dsc.raw_end = 1; + + lv_draw_label_dsc_t label_dsc; + lv_draw_label_dsc_init(&label_dsc); + lv_obj_init_draw_label_dsc(obj, LV_PART_TICKS, &label_dsc); + + lv_meter_scale_t * scale; + + lv_draw_mask_radius_param_t inner_minor_mask; + lv_draw_mask_radius_param_t inner_major_mask; + lv_draw_mask_radius_param_t outer_mask; + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.part = LV_PART_TICKS; + part_draw_dsc.type = LV_METER_DRAW_PART_TICK; + part_draw_dsc.line_dsc = &line_dsc; + + _LV_LL_READ_BACK(&meter->scale_ll, scale) { + part_draw_dsc.sub_part_ptr = scale; + + lv_coord_t r_out = r_edge; + lv_coord_t r_in_minor = r_out - scale->tick_length; + lv_coord_t r_in_major = r_out - scale->tick_major_length; + + lv_area_t area_inner_minor; + area_inner_minor.x1 = p_center.x - r_in_minor; + area_inner_minor.y1 = p_center.y - r_in_minor; + area_inner_minor.x2 = p_center.x + r_in_minor; + area_inner_minor.y2 = p_center.y + r_in_minor; + lv_draw_mask_radius_init(&inner_minor_mask, &area_inner_minor, LV_RADIUS_CIRCLE, true); + + lv_area_t area_inner_major; + area_inner_major.x1 = p_center.x - r_in_major; + area_inner_major.y1 = p_center.y - r_in_major; + area_inner_major.x2 = p_center.x + r_in_major - 1; + area_inner_major.y2 = p_center.y + r_in_major - 1; + lv_draw_mask_radius_init(&inner_major_mask, &area_inner_major, LV_RADIUS_CIRCLE, true); + + lv_area_t area_outer; + area_outer.x1 = p_center.x - r_out; + area_outer.y1 = p_center.y - r_out; + area_outer.x2 = p_center.x + r_out - 1; + area_outer.y2 = p_center.y + r_out - 1; + lv_draw_mask_radius_init(&outer_mask, &area_outer, LV_RADIUS_CIRCLE, false); + int16_t outer_mask_id = lv_draw_mask_add(&outer_mask, NULL); + + int16_t inner_act_mask_id = LV_MASK_ID_INV; /*Will be added later*/ + + uint32_t minor_cnt = scale->tick_major_nth ? scale->tick_major_nth - 1 : 0xFFFF; + uint16_t i; + for(i = 0; i < scale->tick_cnt; i++) { + minor_cnt++; + bool major = false; + if(minor_cnt == scale->tick_major_nth) { + minor_cnt = 0; + major = true; + } + + int32_t value_of_line = lv_map(i, 0, scale->tick_cnt - 1, scale->min, scale->max); + part_draw_dsc.value = value_of_line; + + lv_color_t line_color = major ? scale->tick_major_color : scale->tick_color; + lv_color_t line_color_ori = line_color; + + lv_coord_t line_width_ori = major ? scale->tick_major_width : scale->tick_width; + lv_coord_t line_width = line_width_ori; + + lv_meter_indicator_t * indic; + _LV_LL_READ_BACK(&meter->indicator_ll, indic) { + if(indic->type != LV_METER_INDICATOR_TYPE_SCALE_LINES) continue; + if(value_of_line >= indic->start_value && value_of_line <= indic->end_value) { + line_width += indic->type_data.scale_lines.width_mod; + + if(indic->type_data.scale_lines.color_start.full == indic->type_data.scale_lines.color_end.full) { + line_color = indic->type_data.scale_lines.color_start; + } + else { + lv_opa_t ratio; + if(indic->type_data.scale_lines.local_grad) { + ratio = lv_map(value_of_line, indic->start_value, indic->end_value, LV_OPA_TRANSP, LV_OPA_COVER); + } + else { + ratio = lv_map(value_of_line, scale->min, scale->max, LV_OPA_TRANSP, LV_OPA_COVER); + } + line_color = lv_color_mix(indic->type_data.scale_lines.color_end, indic->type_data.scale_lines.color_start, ratio); + } + } + } + + int32_t angle_upscale = ((i * scale->angle_range) * 10) / (scale->tick_cnt - 1) + + scale->rotation * 10; + + line_dsc.color = line_color; + line_dsc.width = line_width; + + /*Draw a little bit longer lines to be sure the mask will clip them correctly + *and to get a better precision*/ + lv_point_t p_outer; + p_outer.x = p_center.x + r_out + LV_MAX(LV_DPI_DEF, r_out); + p_outer.y = p_center.y; + lv_point_transform(&p_outer, angle_upscale, 256, &p_center); + + part_draw_dsc.p1 = &p_center; + part_draw_dsc.p2 = &p_outer; + part_draw_dsc.id = i; + part_draw_dsc.label_dsc = &label_dsc; + + /*Draw the text*/ + if(major) { + lv_draw_mask_remove_id(outer_mask_id); + uint32_t r_text = r_in_major - scale->label_gap; + lv_point_t p; + p.x = p_center.x + r_text; + p.y = p_center.y; + lv_point_transform(&p, angle_upscale, 256, &p_center); + + lv_draw_label_dsc_t label_dsc_tmp; + lv_memcpy(&label_dsc_tmp, &label_dsc, sizeof(label_dsc_tmp)); + + part_draw_dsc.label_dsc = &label_dsc_tmp; + char buf[16]; + + lv_snprintf(buf, sizeof(buf), "%" LV_PRId32, value_of_line); + part_draw_dsc.text = buf; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + + lv_point_t label_size; + lv_txt_get_size(&label_size, part_draw_dsc.text, label_dsc_tmp.font, label_dsc_tmp.letter_space, + label_dsc_tmp.line_space, + LV_COORD_MAX, LV_TEXT_FLAG_NONE); + + lv_area_t label_cord; + label_cord.x1 = p.x - label_size.x / 2; + label_cord.y1 = p.y - label_size.y / 2; + label_cord.x2 = label_cord.x1 + label_size.x; + label_cord.y2 = label_cord.y1 + label_size.y; + + lv_draw_label(draw_ctx, part_draw_dsc.label_dsc, &label_cord, part_draw_dsc.text, NULL); + + outer_mask_id = lv_draw_mask_add(&outer_mask, NULL); + } + else { + part_draw_dsc.label_dsc = NULL; + part_draw_dsc.text = NULL; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + } + + inner_act_mask_id = lv_draw_mask_add(major ? &inner_major_mask : &inner_minor_mask, NULL); + lv_draw_line(draw_ctx, &line_dsc, &p_outer, &p_center); + lv_draw_mask_remove_id(inner_act_mask_id); + lv_event_send(obj, LV_EVENT_DRAW_MAIN_END, &part_draw_dsc); + + line_dsc.color = line_color_ori; + line_dsc.width = line_width_ori; + + } + lv_draw_mask_free_param(&inner_minor_mask); + lv_draw_mask_free_param(&inner_major_mask); + lv_draw_mask_free_param(&outer_mask); + lv_draw_mask_remove_id(outer_mask_id); + } +} + + +static void draw_needles(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx, const lv_area_t * scale_area) +{ + lv_meter_t * meter = (lv_meter_t *)obj; + + lv_coord_t r_edge = lv_area_get_width(scale_area) / 2; + lv_point_t scale_center; + scale_center.x = scale_area->x1 + r_edge; + scale_center.y = scale_area->y1 + r_edge; + + lv_draw_line_dsc_t line_dsc; + lv_draw_line_dsc_init(&line_dsc); + lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &line_dsc); + + lv_draw_img_dsc_t img_dsc; + lv_draw_img_dsc_init(&img_dsc); + lv_obj_init_draw_img_dsc(obj, LV_PART_ITEMS, &img_dsc); + lv_opa_t opa_main = lv_obj_get_style_opa_recursive(obj, LV_PART_MAIN); + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.p1 = &scale_center; + part_draw_dsc.part = LV_PART_INDICATOR; + + lv_meter_indicator_t * indic; + _LV_LL_READ_BACK(&meter->indicator_ll, indic) { + lv_meter_scale_t * scale = indic->scale; + part_draw_dsc.sub_part_ptr = indic; + + if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_LINE) { + int32_t angle = lv_map(indic->end_value, scale->min, scale->max, scale->rotation, scale->rotation + scale->angle_range); + lv_coord_t r_out = r_edge + scale->r_mod + indic->type_data.needle_line.r_mod; + lv_point_t p_end; + p_end.y = (lv_trigo_sin(angle) * (r_out)) / LV_TRIGO_SIN_MAX + scale_center.y; + p_end.x = (lv_trigo_cos(angle) * (r_out)) / LV_TRIGO_SIN_MAX + scale_center.x; + line_dsc.color = indic->type_data.needle_line.color; + line_dsc.width = indic->type_data.needle_line.width; + line_dsc.opa = indic->opa > LV_OPA_MAX ? opa_main : (opa_main * indic->opa) >> 8; + + part_draw_dsc.type = LV_METER_DRAW_PART_NEEDLE_LINE; + part_draw_dsc.line_dsc = &line_dsc; + part_draw_dsc.p2 = &p_end; + part_draw_dsc.p1 = &scale_center; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_line(draw_ctx, &line_dsc, part_draw_dsc.p1, &p_end); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + else if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_IMG) { + if(indic->type_data.needle_img.src == NULL) continue; + + int32_t angle = lv_map(indic->end_value, scale->min, scale->max, scale->rotation, scale->rotation + scale->angle_range); + lv_img_header_t info; + lv_img_decoder_get_info(indic->type_data.needle_img.src, &info); + lv_area_t a; + a.x1 = scale_center.x - indic->type_data.needle_img.pivot.x; + a.y1 = scale_center.y - indic->type_data.needle_img.pivot.y; + a.x2 = a.x1 + info.w - 1; + a.y2 = a.y1 + info.h - 1; + + img_dsc.opa = indic->opa > LV_OPA_MAX ? opa_main : (opa_main * indic->opa) >> 8; + img_dsc.pivot.x = indic->type_data.needle_img.pivot.x; + img_dsc.pivot.y = indic->type_data.needle_img.pivot.y; + angle = angle * 10; + if(angle > 3600) angle -= 3600; + img_dsc.angle = angle; + + part_draw_dsc.type = LV_METER_DRAW_PART_NEEDLE_IMG; + part_draw_dsc.img_dsc = &img_dsc; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_img(draw_ctx, &img_dsc, &a, indic->type_data.needle_img.src); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + } +} + +static void inv_arc(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t old_value, int32_t new_value) +{ + bool rounded = lv_obj_get_style_arc_rounded(obj, LV_PART_ITEMS); + + lv_area_t scale_area; + lv_obj_get_content_coords(obj, &scale_area); + + lv_coord_t r_out = lv_area_get_width(&scale_area) / 2; + lv_point_t scale_center; + scale_center.x = scale_area.x1 + r_out; + scale_center.y = scale_area.y1 + r_out; + + r_out += indic->type_data.arc.r_mod; + + lv_meter_scale_t * scale = indic->scale; + + int32_t start_angle = lv_map(old_value, scale->min, scale->max, scale->rotation, scale->angle_range + scale->rotation); + int32_t end_angle = lv_map(new_value, scale->min, scale->max, scale->rotation, scale->angle_range + scale->rotation); + + lv_area_t a; + lv_draw_arc_get_area(scale_center.x, scale_center.y, r_out, LV_MIN(start_angle, end_angle), LV_MAX(start_angle, + end_angle), indic->type_data.arc.width, rounded, &a); + lv_obj_invalidate_area(obj, &a); +} + + +static void inv_line(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value) +{ + lv_area_t scale_area; + lv_obj_get_content_coords(obj, &scale_area); + + lv_coord_t r_out = lv_area_get_width(&scale_area) / 2; + lv_point_t scale_center; + scale_center.x = scale_area.x1 + r_out; + scale_center.y = scale_area.y1 + r_out; + + lv_meter_scale_t * scale = indic->scale; + + if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_LINE) { + int32_t angle = lv_map(value, scale->min, scale->max, scale->rotation, scale->rotation + scale->angle_range); + r_out += scale->r_mod + indic->type_data.needle_line.r_mod; + lv_point_t p_end; + p_end.y = (lv_trigo_sin(angle) * (r_out)) / LV_TRIGO_SIN_MAX + scale_center.y; + p_end.x = (lv_trigo_cos(angle) * (r_out)) / LV_TRIGO_SIN_MAX + scale_center.x; + + lv_area_t a; + a.x1 = LV_MIN(scale_center.x, p_end.x) - indic->type_data.needle_line.width - 2; + a.y1 = LV_MIN(scale_center.y, p_end.y) - indic->type_data.needle_line.width - 2; + a.x2 = LV_MAX(scale_center.x, p_end.x) + indic->type_data.needle_line.width + 2; + a.y2 = LV_MAX(scale_center.y, p_end.y) + indic->type_data.needle_line.width + 2; + + lv_obj_invalidate_area(obj, &a); + } + else if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_IMG) { + int32_t angle = lv_map(value, scale->min, scale->max, scale->rotation, scale->rotation + scale->angle_range); + lv_img_header_t info; + lv_img_decoder_get_info(indic->type_data.needle_img.src, &info); + + angle = angle * 10; + if(angle > 3600) angle -= 3600; + + scale_center.x -= indic->type_data.needle_img.pivot.x; + scale_center.y -= indic->type_data.needle_img.pivot.y; + lv_area_t a; + _lv_img_buf_get_transformed_area(&a, info.w, info.h, angle, LV_IMG_ZOOM_NONE, &indic->type_data.needle_img.pivot); + a.x1 += scale_center.x - 2; + a.y1 += scale_center.y - 2; + a.x2 += scale_center.x + 2; + a.y2 += scale_center.y + 2; + + lv_obj_invalidate_area(obj, &a); + } +} +#endif diff --git a/L3_Middlewares/LVGL/src/extra/widgets/meter/lv_meter.h b/L3_Middlewares/LVGL/src/extra/widgets/meter/lv_meter.h new file mode 100644 index 0000000..330bc2a --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/meter/lv_meter.h @@ -0,0 +1,266 @@ +/** + * @file lv_meter.h + * + */ + +#ifndef LV_METER_H +#define LV_METER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" + +#if LV_USE_METER != 0 + +/*Testing of dependencies*/ +#if LV_DRAW_COMPLEX == 0 +#error "lv_meter: Complex drawing is required. Enable it in lv_conf.h (LV_DRAW_COMPLEX 1)" +#endif + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_color_t tick_color; + uint16_t tick_cnt; + uint16_t tick_length; + uint16_t tick_width; + + lv_color_t tick_major_color; + uint16_t tick_major_nth; + uint16_t tick_major_length; + uint16_t tick_major_width; + + int16_t label_gap; + + int32_t min; + int32_t max; + int16_t r_mod; + uint16_t angle_range; + int16_t rotation; +} lv_meter_scale_t; + +enum { + LV_METER_INDICATOR_TYPE_NEEDLE_IMG, + LV_METER_INDICATOR_TYPE_NEEDLE_LINE, + LV_METER_INDICATOR_TYPE_SCALE_LINES, + LV_METER_INDICATOR_TYPE_ARC, +}; +typedef uint8_t lv_meter_indicator_type_t; + +typedef struct { + lv_meter_scale_t * scale; + lv_meter_indicator_type_t type; + lv_opa_t opa; + int32_t start_value; + int32_t end_value; + union { + struct { + const void * src; + lv_point_t pivot; + } needle_img; + struct { + uint16_t width; + int16_t r_mod; + lv_color_t color; + } needle_line; + struct { + uint16_t width; + const void * src; + lv_color_t color; + int16_t r_mod; + } arc; + struct { + int16_t width_mod; + lv_color_t color_start; + lv_color_t color_end; + uint8_t local_grad : 1; + } scale_lines; + } type_data; +} lv_meter_indicator_t; + +/*Data of line meter*/ +typedef struct { + lv_obj_t obj; + lv_ll_t scale_ll; + lv_ll_t indicator_ll; +} lv_meter_t; + +extern const lv_obj_class_t lv_meter_class; + +/** + * `type` field in `lv_obj_draw_part_dsc_t` if `class_p = lv_meter_class` + * Used in `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` + */ +typedef enum { + LV_METER_DRAW_PART_ARC, /**< The arc indicator*/ + LV_METER_DRAW_PART_NEEDLE_LINE, /**< The needle lines*/ + LV_METER_DRAW_PART_NEEDLE_IMG, /**< The needle images*/ + LV_METER_DRAW_PART_TICK, /**< The tick lines and labels*/ +} lv_meter_draw_part_type_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create a Meter object + * @param parent pointer to an object, it will be the parent of the new bar. + * @return pointer to the created meter + */ +lv_obj_t * lv_meter_create(lv_obj_t * parent); + +/*===================== + * Add scale + *====================*/ + +/** + * Add a new scale to the meter. + * @param obj pointer to a meter object + * @return the new scale + * @note Indicators can be attached to scales. + */ +lv_meter_scale_t * lv_meter_add_scale(lv_obj_t * obj); + +/** + * Set the properties of the ticks of a scale + * @param obj pointer to a meter object + * @param scale pointer to scale (added to `meter`) + * @param cnt number of tick lines + * @param width width of tick lines + * @param len length of tick lines + * @param color color of tick lines + */ +void lv_meter_set_scale_ticks(lv_obj_t * obj, lv_meter_scale_t * scale, uint16_t cnt, uint16_t width, uint16_t len, + lv_color_t color); + +/** + * Make some "normal" ticks major ticks and set their attributes. + * Texts with the current value are also added to the major ticks. + * @param obj pointer to a meter object + * @param scale pointer to scale (added to `meter`) + * @param nth make every Nth normal tick major tick. (start from the first on the left) + * @param width width of the major ticks + * @param len length of the major ticks + * @param color color of the major ticks + * @param label_gap gap between the major ticks and the labels + */ +void lv_meter_set_scale_major_ticks(lv_obj_t * obj, lv_meter_scale_t * scale, uint16_t nth, uint16_t width, + uint16_t len, lv_color_t color, int16_t label_gap); + +/** + * Set the value and angular range of a scale. + * @param obj pointer to a meter object + * @param scale pointer to scale (added to `meter`) + * @param min the minimum value + * @param max the maximal value + * @param angle_range the angular range of the scale + * @param rotation the angular offset from the 3 o'clock position (clock-wise) + */ +void lv_meter_set_scale_range(lv_obj_t * obj, lv_meter_scale_t * scale, int32_t min, int32_t max, uint32_t angle_range, + uint32_t rotation); + +/*===================== + * Add indicator + *====================*/ + +/** + * Add a needle line indicator the scale + * @param obj pointer to a meter object + * @param scale pointer to scale (added to `meter`) + * @param width width of the line + * @param color color of the line + * @param r_mod the radius modifier (added to the scale's radius) to get the lines length + * @return the new indicator + */ +lv_meter_indicator_t * lv_meter_add_needle_line(lv_obj_t * obj, lv_meter_scale_t * scale, uint16_t width, + lv_color_t color, int16_t r_mod); + +/** + * Add a needle image indicator the scale + * @param obj pointer to a meter object + * @param scale pointer to scale (added to `meter`) + * @param src the image source of the indicator. path or pointer to ::lv_img_dsc_t + * @param pivot_x the X pivot point of the needle + * @param pivot_y the Y pivot point of the needle + * @return the new indicator + * @note the needle image should point to the right, like -O-----> + */ +lv_meter_indicator_t * lv_meter_add_needle_img(lv_obj_t * obj, lv_meter_scale_t * scale, const void * src, + lv_coord_t pivot_x, lv_coord_t pivot_y); + +/** + * Add an arc indicator the scale + * @param obj pointer to a meter object + * @param scale pointer to scale (added to `meter`) + * @param width width of the arc + * @param color color of the arc + * @param r_mod the radius modifier (added to the scale's radius) to get the outer radius of the arc + * @return the new indicator + */ +lv_meter_indicator_t * lv_meter_add_arc(lv_obj_t * obj, lv_meter_scale_t * scale, uint16_t width, lv_color_t color, + int16_t r_mod); + + +/** + * Add a scale line indicator the scale. It will modify the ticks. + * @param obj pointer to a meter object + * @param scale pointer to scale (added to `meter`) + * @param color_start the start color + * @param color_end the end color + * @param local tell how to map start and end color. true: the indicator's start and end_value; false: the scale's min max value + * @param width_mod add this the affected tick's width + * @return the new indicator + */ +lv_meter_indicator_t * lv_meter_add_scale_lines(lv_obj_t * obj, lv_meter_scale_t * scale, lv_color_t color_start, + lv_color_t color_end, bool local, int16_t width_mod); + +/*===================== + * Set indicator value + *====================*/ + +/** + * Set the value of the indicator. It will set start and and value to the same value + * @param obj pointer to a meter object + * @param indic pointer to an indicator + * @param value the new value + */ +void lv_meter_set_indicator_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value); + +/** + * Set the start value of the indicator. + * @param obj pointer to a meter object + * @param indic pointer to an indicator + * @param value the new value + */ +void lv_meter_set_indicator_start_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value); + +/** + * Set the start value of the indicator. + * @param obj pointer to a meter object + * @param indic pointer to an indicator + * @param value the new value + */ +void lv_meter_set_indicator_end_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_METER*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_METER_H*/ diff --git a/L3_Middlewares/LVGL/src/extra/widgets/msgbox/lv_msgbox.c b/L3_Middlewares/LVGL/src/extra/widgets/msgbox/lv_msgbox.c new file mode 100644 index 0000000..54d65e3 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/msgbox/lv_msgbox.c @@ -0,0 +1,212 @@ +/** + * @file lv_msgbox.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_msgbox.h" +#if LV_USE_MSGBOX + +#include "../../../misc/lv_assert.h" + +/********************* + * DEFINES + *********************/ +#define LV_MSGBOX_FLAG_AUTO_PARENT LV_OBJ_FLAG_WIDGET_1 /*Mark that the parent was automatically created*/ +#define MY_CLASS &lv_msgbox_class + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void msgbox_close_click_event_cb(lv_event_t * e); + +/********************** + * STATIC VARIABLES + **********************/ +const lv_obj_class_t lv_msgbox_class = { + .base_class = &lv_obj_class, + .width_def = LV_DPI_DEF * 2, + .height_def = LV_SIZE_CONTENT, + .instance_size = sizeof(lv_msgbox_t) +}; + +const lv_obj_class_t lv_msgbox_content_class = { + .base_class = &lv_obj_class, + .width_def = LV_PCT(100), + .height_def = LV_SIZE_CONTENT, + .instance_size = sizeof(lv_obj_t) +}; + +const lv_obj_class_t lv_msgbox_backdrop_class = { + .base_class = &lv_obj_class, + .width_def = LV_PCT(100), + .height_def = LV_PCT(100), + .instance_size = sizeof(lv_obj_t) +}; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_obj_t * lv_msgbox_create(lv_obj_t * parent, const char * title, const char * txt, const char * btn_txts[], + bool add_close_btn) +{ + LV_LOG_INFO("begin"); + bool auto_parent = false; + if(parent == NULL) { + auto_parent = true; + parent = lv_obj_class_create_obj(&lv_msgbox_backdrop_class, lv_layer_top()); + LV_ASSERT_MALLOC(parent); + lv_obj_class_init_obj(parent); + lv_obj_clear_flag(parent, LV_OBJ_FLAG_IGNORE_LAYOUT); + lv_obj_set_size(parent, LV_PCT(100), LV_PCT(100)); + } + + lv_obj_t * obj = lv_obj_class_create_obj(&lv_msgbox_class, parent); + LV_ASSERT_MALLOC(obj); + if(obj == NULL) return NULL; + lv_obj_class_init_obj(obj); + lv_msgbox_t * mbox = (lv_msgbox_t *)obj; + + if(auto_parent) lv_obj_add_flag(obj, LV_MSGBOX_FLAG_AUTO_PARENT); + + lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW_WRAP); + + bool has_title = title && strlen(title) > 0; + + /*When a close button is required, we need the empty label as spacer to push the button to the right*/ + if(add_close_btn || has_title) { + mbox->title = lv_label_create(obj); + lv_label_set_text(mbox->title, has_title ? title : ""); + lv_label_set_long_mode(mbox->title, LV_LABEL_LONG_SCROLL_CIRCULAR); + if(add_close_btn) lv_obj_set_flex_grow(mbox->title, 1); + else lv_obj_set_width(mbox->title, LV_PCT(100)); + } + + if(add_close_btn) { + mbox->close_btn = lv_btn_create(obj); + lv_obj_set_ext_click_area(mbox->close_btn, LV_DPX(10)); + lv_obj_add_event_cb(mbox->close_btn, msgbox_close_click_event_cb, LV_EVENT_CLICKED, NULL); + lv_obj_t * label = lv_label_create(mbox->close_btn); + lv_label_set_text(label, LV_SYMBOL_CLOSE); + const lv_font_t * font = lv_obj_get_style_text_font(mbox->close_btn, LV_PART_MAIN); + lv_coord_t close_btn_size = lv_font_get_line_height(font) + LV_DPX(10); + lv_obj_set_size(mbox->close_btn, close_btn_size, close_btn_size); + lv_obj_align(label, LV_ALIGN_CENTER, 0, 0); + } + + mbox->content = lv_obj_class_create_obj(&lv_msgbox_content_class, obj); + LV_ASSERT_MALLOC(mbox->content); + if(mbox->content == NULL) return NULL; + lv_obj_class_init_obj(mbox->content); + + bool has_txt = txt && strlen(txt) > 0; + if(has_txt) { + mbox->text = lv_label_create(mbox->content); + lv_label_set_text(mbox->text, txt); + lv_label_set_long_mode(mbox->text, LV_LABEL_LONG_WRAP); + lv_obj_set_width(mbox->text, lv_pct(100)); + } + + if(btn_txts) { + mbox->btns = lv_btnmatrix_create(obj); + lv_btnmatrix_set_map(mbox->btns, btn_txts); + lv_btnmatrix_set_btn_ctrl_all(mbox->btns, LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_NO_REPEAT); + + uint32_t btn_cnt = 0; + while(btn_txts[btn_cnt] && btn_txts[btn_cnt][0] != '\0') { + btn_cnt++; + } + + const lv_font_t * font = lv_obj_get_style_text_font(mbox->btns, LV_PART_ITEMS); + lv_coord_t btn_h = lv_font_get_line_height(font) + LV_DPI_DEF / 10; + lv_obj_set_size(mbox->btns, btn_cnt * (2 * LV_DPI_DEF / 3), btn_h); + lv_obj_set_style_max_width(mbox->btns, lv_pct(100), 0); + lv_obj_add_flag(mbox->btns, LV_OBJ_FLAG_EVENT_BUBBLE); /*To see the event directly on the message box*/ + } + + return obj; +} + + +lv_obj_t * lv_msgbox_get_title(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_msgbox_t * mbox = (lv_msgbox_t *)obj; + return mbox->title; +} + +lv_obj_t * lv_msgbox_get_close_btn(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_msgbox_t * mbox = (lv_msgbox_t *)obj; + return mbox->close_btn; +} + +lv_obj_t * lv_msgbox_get_text(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_msgbox_t * mbox = (lv_msgbox_t *)obj; + return mbox->text; +} + +lv_obj_t * lv_msgbox_get_content(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_msgbox_t * mbox = (lv_msgbox_t *)obj; + return mbox->content; +} + +lv_obj_t * lv_msgbox_get_btns(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_msgbox_t * mbox = (lv_msgbox_t *)obj; + return mbox->btns; +} + +uint16_t lv_msgbox_get_active_btn(lv_obj_t * mbox) +{ + lv_obj_t * btnm = lv_msgbox_get_btns(mbox); + return lv_btnmatrix_get_selected_btn(btnm); +} + +const char * lv_msgbox_get_active_btn_text(lv_obj_t * mbox) +{ + lv_obj_t * btnm = lv_msgbox_get_btns(mbox); + return lv_btnmatrix_get_btn_text(btnm, lv_btnmatrix_get_selected_btn(btnm)); +} + +void lv_msgbox_close(lv_obj_t * mbox) +{ + if(lv_obj_has_flag(mbox, LV_MSGBOX_FLAG_AUTO_PARENT)) lv_obj_del(lv_obj_get_parent(mbox)); + else lv_obj_del(mbox); +} + +void lv_msgbox_close_async(lv_obj_t * dialog) +{ + if(lv_obj_has_flag(dialog, LV_MSGBOX_FLAG_AUTO_PARENT)) lv_obj_del_async(lv_obj_get_parent(dialog)); + else lv_obj_del_async(dialog); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void msgbox_close_click_event_cb(lv_event_t * e) +{ + lv_obj_t * btn = lv_event_get_target(e); + lv_obj_t * mbox = lv_obj_get_parent(btn); + lv_msgbox_close(mbox); +} + +#endif /*LV_USE_MSGBOX*/ diff --git a/L3_Middlewares/LVGL/src/extra/widgets/msgbox/lv_msgbox.h b/L3_Middlewares/LVGL/src/extra/widgets/msgbox/lv_msgbox.h new file mode 100644 index 0000000..2eaf0d3 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/msgbox/lv_msgbox.h @@ -0,0 +1,99 @@ +/** + * @file lv_mbox.h + * + */ + +#ifndef LV_MSGBOX_H +#define LV_MSGBOX_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" + +#if LV_USE_MSGBOX + +/*Testing of dependencies*/ +#if LV_USE_BTNMATRIX == 0 +#error "lv_mbox: lv_btnm is required. Enable it in lv_conf.h (LV_USE_BTNMATRIX 1) " +#endif + +#if LV_USE_LABEL == 0 +#error "lv_mbox: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) " +#endif + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_obj_t obj; + lv_obj_t * title; + lv_obj_t * close_btn; + lv_obj_t * content; + lv_obj_t * text; + lv_obj_t * btns; +} lv_msgbox_t; + +extern const lv_obj_class_t lv_msgbox_class; +extern const lv_obj_class_t lv_msgbox_content_class; +extern const lv_obj_class_t lv_msgbox_backdrop_class; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create a message box object + * @param parent pointer to parent or NULL to create a full screen modal message box + * @param title the title of the message box + * @param txt the text of the message box + * @param btn_txts the buttons as an array of texts terminated by an "" element. E.g. {"btn1", "btn2", ""} + * @param add_close_btn true: add a close button + * @return pointer to the message box object + */ +lv_obj_t * lv_msgbox_create(lv_obj_t * parent, const char * title, const char * txt, const char * btn_txts[], + bool add_close_btn); + +lv_obj_t * lv_msgbox_get_title(lv_obj_t * obj); + +lv_obj_t * lv_msgbox_get_close_btn(lv_obj_t * obj); + +lv_obj_t * lv_msgbox_get_text(lv_obj_t * obj); + +lv_obj_t * lv_msgbox_get_content(lv_obj_t * obj); + +lv_obj_t * lv_msgbox_get_btns(lv_obj_t * obj); + +/** + * Get the index of the selected button + * @param mbox message box object + * @return index of the button (LV_BTNMATRIX_BTN_NONE: if unset) + */ +uint16_t lv_msgbox_get_active_btn(lv_obj_t * mbox); + +const char * lv_msgbox_get_active_btn_text(lv_obj_t * mbox); + +void lv_msgbox_close(lv_obj_t * mbox); + +void lv_msgbox_close_async(lv_obj_t * mbox); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_MSGBOX*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_MSGBOX_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/span/lv_span.c b/L3_Middlewares/LVGL/src/extra/widgets/span/lv_span.c similarity index 66% rename from L3_Middlewares/LVGL/src/widgets/span/lv_span.c rename to L3_Middlewares/LVGL/src/extra/widgets/span/lv_span.c index c4afb43..6f970c5 100644 --- a/L3_Middlewares/LVGL/src/widgets/span/lv_span.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/span/lv_span.c @@ -6,22 +6,16 @@ /********************* * INCLUDES *********************/ -#include "lv_span_private.h" -#include "../../misc/lv_area_private.h" -#include "../../draw/lv_draw_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_span.h" #if LV_USE_SPAN != 0 -#include "../../misc/lv_assert.h" -#include "../../misc/lv_text_private.h" -#include "../../core/lv_global.h" +#include "../../../misc/lv_assert.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_spangroup_class) -#define snippet_stack LV_GLOBAL_DEFAULT()->span_snippet_stack +#define MY_CLASS &lv_spangroup_class /********************** * TYPEDEFS @@ -30,15 +24,15 @@ typedef struct { lv_span_t * span; const char * txt; const lv_font_t * font; - uint32_t bytes; - int32_t txt_w; - int32_t line_h; - int32_t letter_space; + uint16_t bytes; + lv_coord_t txt_w; + lv_coord_t line_h; + lv_coord_t letter_space; } lv_snippet_t; struct _snippet_stack { lv_snippet_t stack[LV_SPAN_SNIPPET_STACK_SIZE]; - uint32_t index; + uint16_t index; }; /********************** @@ -51,27 +45,28 @@ static void draw_main(lv_event_t * e); static void refresh_self_size(lv_obj_t * obj); static const lv_font_t * lv_span_get_style_text_font(lv_obj_t * par, lv_span_t * span); -static int32_t lv_span_get_style_text_letter_space(lv_obj_t * par, lv_span_t * span); +static lv_coord_t lv_span_get_style_text_letter_space(lv_obj_t * par, lv_span_t * span); static lv_color_t lv_span_get_style_text_color(lv_obj_t * par, lv_span_t * span); static lv_opa_t lv_span_get_style_text_opa(lv_obj_t * par, lv_span_t * span); -static lv_blend_mode_t lv_span_get_style_text_blend_mode(lv_obj_t * par, lv_span_t * span); +static lv_opa_t lv_span_get_style_text_blend_mode(lv_obj_t * par, lv_span_t * span); static int32_t lv_span_get_style_text_decor(lv_obj_t * par, lv_span_t * span); static inline void span_text_check(const char ** text); -static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer); -static bool lv_text_get_snippet(const char * txt, const lv_font_t * font, int32_t letter_space, - int32_t max_width, lv_text_flag_t flag, int32_t * use_width, - uint32_t * end_ofs); +static void lv_draw_span(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx); +static bool lv_txt_get_snippet(const char * txt, const lv_font_t * font, lv_coord_t letter_space, + lv_coord_t max_width, lv_text_flag_t flag, lv_coord_t * use_width, + uint32_t * end_ofs); static void lv_snippet_clear(void); -static uint32_t lv_get_snippet_count(void); +static uint16_t lv_get_snippet_cnt(void); static void lv_snippet_push(lv_snippet_t * item); -static lv_snippet_t * lv_get_snippet(uint32_t index); -static int32_t convert_indent_pct(lv_obj_t * spans, int32_t width); +static lv_snippet_t * lv_get_snippet(uint16_t index); +static lv_coord_t convert_indent_pct(lv_obj_t * spans, lv_coord_t width); /********************** * STATIC VARIABLES **********************/ +static struct _snippet_stack snippet_stack; const lv_obj_class_t lv_spangroup_class = { .base_class = &lv_obj_class, @@ -81,7 +76,6 @@ const lv_obj_class_t lv_spangroup_class = { .instance_size = sizeof(lv_spangroup_t), .width_def = LV_SIZE_CONTENT, .height_def = LV_SIZE_CONTENT, - .name = "span", }; /********************** @@ -91,19 +85,6 @@ const lv_obj_class_t lv_spangroup_class = { /********************** * GLOBAL FUNCTIONS **********************/ -void lv_span_stack_init(void) -{ - struct _snippet_stack * stack = snippet_stack = lv_malloc(sizeof(struct _snippet_stack)); - LV_ASSERT_MALLOC(stack); - if(!stack) { - LV_LOG_ERROR("malloc failed for snippet_stack"); - } -} - -void lv_span_stack_deinit(void) -{ - lv_free(snippet_stack); -} lv_obj_t * lv_spangroup_create(lv_obj_t * par) { @@ -120,7 +101,7 @@ lv_span_t * lv_spangroup_new_span(lv_obj_t * obj) LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; - lv_span_t * span = lv_ll_ins_tail(&spans->child_ll); + lv_span_t * span = _lv_ll_ins_tail(&spans->child_ll); LV_ASSERT_MALLOC(span); lv_style_init(&span->style); @@ -133,7 +114,7 @@ lv_span_t * lv_spangroup_new_span(lv_obj_t * obj) return span; } -void lv_spangroup_delete_span(lv_obj_t * obj, lv_span_t * span) +void lv_spangroup_del_span(lv_obj_t * obj, lv_span_t * span) { if(obj == NULL || span == NULL) { return; @@ -142,16 +123,14 @@ void lv_spangroup_delete_span(lv_obj_t * obj, lv_span_t * span) LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; lv_span_t * cur_span; - LV_LL_READ(&spans->child_ll, cur_span) { + _LV_LL_READ(&spans->child_ll, cur_span) { if(cur_span == span) { - lv_ll_remove(&spans->child_ll, cur_span); + _lv_ll_remove(&spans->child_ll, cur_span); if(cur_span->txt && cur_span->static_flag == 0) { - lv_free(cur_span->txt); - cur_span->txt = NULL; + lv_mem_free(cur_span->txt); } lv_style_reset(&cur_span->style); - lv_free(cur_span); - cur_span = NULL; + lv_mem_free(cur_span); break; } } @@ -169,21 +148,14 @@ void lv_span_set_text(lv_span_t * span, const char * text) return; } - size_t text_alloc_len = lv_strlen(text) + 1; - if(span->txt == NULL || span->static_flag == 1) { - span->txt = lv_malloc(text_alloc_len); - LV_ASSERT_MALLOC(span->txt); + span->txt = lv_mem_alloc(strlen(text) + 1); } else { - span->txt = lv_realloc(span->txt, text_alloc_len); - LV_ASSERT_MALLOC(span->txt); + span->txt = lv_mem_realloc(span->txt, strlen(text) + 1); } - - if(span->txt == NULL) return; - span->static_flag = 0; - lv_memcpy(span->txt, text, text_alloc_len); + strcpy(span->txt, text); refresh_self_size(span->spangroup); } @@ -195,8 +167,7 @@ void lv_span_set_text_static(lv_span_t * span, const char * text) } if(span->txt && span->static_flag == 0) { - lv_free(span->txt); - span->txt = NULL; + lv_mem_free(span->txt); } span->static_flag = 1; span->txt = (char *)text; @@ -214,12 +185,12 @@ void lv_spangroup_set_overflow(lv_obj_t * obj, lv_span_overflow_t overflow) LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; if(spans->overflow == overflow) return; - if(overflow >= LV_SPAN_OVERFLOW_LAST) return; + spans->overflow = overflow; lv_obj_invalidate(obj); } -void lv_spangroup_set_indent(lv_obj_t * obj, int32_t indent) +void lv_spangroup_set_indent(lv_obj_t * obj, lv_coord_t indent) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; @@ -234,14 +205,11 @@ void lv_spangroup_set_mode(lv_obj_t * obj, lv_span_mode_t mode) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; - - if(mode >= LV_SPAN_MODE_LAST) return; - spans->mode = mode; lv_spangroup_refr_mode(obj); } -void lv_spangroup_set_max_lines(lv_obj_t * obj, int32_t lines) +void lv_spangroup_set_lines(lv_obj_t * obj, int32_t lines) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; @@ -253,11 +221,6 @@ void lv_spangroup_set_max_lines(lv_obj_t * obj, int32_t lines) * Getter functions *====================*/ -lv_style_t * lv_span_get_style(lv_span_t * span) -{ - return &span->style; -} - lv_span_t * lv_spangroup_get_child(const lv_obj_t * obj, int32_t id) { if(obj == NULL) { @@ -283,11 +246,11 @@ lv_span_t * lv_spangroup_get_child(const lv_obj_t * obj, int32_t id) return (lv_span_t *) cur_node; } if(traverse_forwards) { - cur_node = (lv_ll_node_t *) lv_ll_get_next(linked_list, cur_node); + cur_node = (lv_ll_node_t *) _lv_ll_get_next(linked_list, cur_node); cur_idx++; } else { - cur_node = (lv_ll_node_t *) lv_ll_get_prev(linked_list, cur_node); + cur_node = (lv_ll_node_t *) _lv_ll_get_prev(linked_list, cur_node); cur_idx--; } } @@ -295,7 +258,7 @@ lv_span_t * lv_spangroup_get_child(const lv_obj_t * obj, int32_t id) return NULL; } -uint32_t lv_spangroup_get_span_count(const lv_obj_t * obj) +uint32_t lv_spangroup_get_child_cnt(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -305,7 +268,7 @@ uint32_t lv_spangroup_get_span_count(const lv_obj_t * obj) LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; - return lv_ll_get_len(&(spans->child_ll)); + return _lv_ll_get_len(&(spans->child_ll)); } lv_text_align_t lv_spangroup_get_align(lv_obj_t * obj) @@ -320,7 +283,7 @@ lv_span_overflow_t lv_spangroup_get_overflow(lv_obj_t * obj) return spans->overflow; } -int32_t lv_spangroup_get_indent(lv_obj_t * obj) +lv_coord_t lv_spangroup_get_indent(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; @@ -334,7 +297,7 @@ lv_span_mode_t lv_spangroup_get_mode(lv_obj_t * obj) return spans->mode; } -int32_t lv_spangroup_get_max_lines(lv_obj_t * obj) +int32_t lv_spangroup_get_lines(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; @@ -363,11 +326,11 @@ void lv_spangroup_refr_mode(lv_obj_t * obj) lv_obj_set_width(obj, 100); } if(lv_obj_get_style_height(obj, LV_PART_MAIN) == LV_SIZE_CONTENT) { - int32_t width = lv_obj_get_style_width(obj, LV_PART_MAIN); + lv_coord_t width = lv_obj_get_style_width(obj, LV_PART_MAIN); if(LV_COORD_IS_PCT(width)) { width = 100; } - int32_t height = lv_spangroup_get_expand_height(obj, width); + lv_coord_t height = lv_spangroup_get_expand_height(obj, width); lv_obj_set_content_height(obj, height); } } @@ -375,16 +338,16 @@ void lv_spangroup_refr_mode(lv_obj_t * obj) refresh_self_size(obj); } -int32_t lv_spangroup_get_max_line_height(lv_obj_t * obj) +lv_coord_t lv_spangroup_get_max_line_h(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; - int32_t max_line_h = 0; + lv_coord_t max_line_h = 0; lv_span_t * cur_span; - LV_LL_READ(&spans->child_ll, cur_span) { + _LV_LL_READ(&spans->child_ll, cur_span) { const lv_font_t * font = lv_span_get_style_text_font(obj, cur_span); - int32_t line_h = lv_font_get_line_height(font); + lv_coord_t line_h = lv_font_get_line_height(font); if(line_h > max_line_h) { max_line_h = line_h; } @@ -398,14 +361,14 @@ uint32_t lv_spangroup_get_expand_width(lv_obj_t * obj, uint32_t max_width) LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; - if(lv_ll_get_head(&spans->child_ll) == NULL) { + if(_lv_ll_get_head(&spans->child_ll) == NULL) { return 0; } uint32_t width = LV_COORD_IS_PCT(spans->indent) ? 0 : spans->indent; lv_span_t * cur_span; - int32_t letter_space = 0; - LV_LL_READ(&spans->child_ll, cur_span) { + lv_coord_t letter_space = 0; + _LV_LL_READ(&spans->child_ll, cur_span) { const lv_font_t * font = lv_span_get_style_text_font(obj, cur_span); letter_space = lv_span_get_style_text_letter_space(obj, cur_span); uint32_t j = 0; @@ -415,9 +378,9 @@ uint32_t lv_spangroup_get_expand_width(lv_obj_t * obj, uint32_t max_width) if(max_width > 0 && width >= max_width) { return max_width; } - uint32_t letter = lv_text_encoded_next(cur_txt, &j); - uint32_t letter_next = lv_text_encoded_next(&cur_txt[j], NULL); - uint32_t letter_w = lv_font_get_glyph_width(font, letter, letter_next); + uint32_t letter = _lv_txt_encoded_next(cur_txt, &j); + uint32_t letter_next = _lv_txt_encoded_next(&cur_txt[j], NULL); + uint16_t letter_w = lv_font_get_glyph_width(font, letter, letter_next); width = width + letter_w + letter_space; } } @@ -425,44 +388,45 @@ uint32_t lv_spangroup_get_expand_width(lv_obj_t * obj, uint32_t max_width) return width - letter_space; } -int32_t lv_spangroup_get_expand_height(lv_obj_t * obj, int32_t width) +lv_coord_t lv_spangroup_get_expand_height(lv_obj_t * obj, lv_coord_t width) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spangroup_t * spans = (lv_spangroup_t *)obj; - if(lv_ll_get_head(&spans->child_ll) == NULL || width <= 0) { + if(_lv_ll_get_head(&spans->child_ll) == NULL || width <= 0) { return 0; } /* init draw variable */ lv_text_flag_t txt_flag = LV_TEXT_FLAG_NONE; - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - int32_t max_width = width; - int32_t indent = convert_indent_pct(obj, max_width); - int32_t max_w = max_width - indent; /* first line need minus indent */ + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t max_width = width; + lv_coord_t indent = convert_indent_pct(obj, max_width); + lv_coord_t max_w = max_width - indent; /* first line need minus indent */ /* coords of draw span-txt */ lv_point_t txt_pos; - lv_point_set(&txt_pos, indent, 0); /* first line need add indent */ + txt_pos.y = 0; + txt_pos.x = 0 + indent; /* first line need add indent */ - lv_span_t * cur_span = lv_ll_get_head(&spans->child_ll); + lv_span_t * cur_span = _lv_ll_get_head(&spans->child_ll); const char * cur_txt = cur_span->txt; span_text_check(&cur_txt); uint32_t cur_txt_ofs = 0; lv_snippet_t snippet; /* use to save cur_span info and push it to stack */ - lv_memset(&snippet, 0, sizeof(snippet)); + memset(&snippet, 0, sizeof(snippet)); int32_t line_cnt = 0; int32_t lines = spans->lines < 0 ? INT32_MAX : spans->lines; /* the loop control how many lines need to draw */ while(cur_span) { int snippet_cnt = 0; - int32_t max_line_h = 0; /* the max height of span-font when a line have a lot of span */ + lv_coord_t max_line_h = 0; /* the max height of span-font when a line have a lot of span */ /* the loop control to find a line and push the relevant span info into stack */ while(1) { /* switch to the next span when current is end */ if(cur_txt[cur_txt_ofs] == '\0') { - cur_span = lv_ll_get_next(&spans->child_ll, cur_span); + cur_span = _lv_ll_get_next(&spans->child_ll, cur_span); if(cur_span == NULL) break; cur_txt = cur_span->txt; span_text_check(&cur_txt); @@ -481,26 +445,22 @@ int32_t lv_spangroup_get_expand_height(lv_obj_t * obj, int32_t width) /* get current span text line info */ uint32_t next_ofs = 0; - int32_t use_width = 0; - bool isfill = lv_text_get_snippet(&cur_txt[cur_txt_ofs], snippet.font, snippet.letter_space, - max_w, txt_flag, &use_width, &next_ofs); + lv_coord_t use_width = 0; + bool isfill = lv_txt_get_snippet(&cur_txt[cur_txt_ofs], snippet.font, snippet.letter_space, + max_w, txt_flag, &use_width, &next_ofs); /* break word deal width */ if(isfill && next_ofs > 0 && snippet_cnt > 0) { - int32_t drawn_width = use_width; - if(lv_ll_get_next(&spans->child_ll, cur_span) == NULL) { - drawn_width -= snippet.letter_space; - } - if(max_w < drawn_width) { + if(max_w < use_width) { break; } uint32_t tmp_ofs = next_ofs; - uint32_t letter = lv_text_encoded_prev(&cur_txt[cur_txt_ofs], &tmp_ofs); - uint32_t letter_next = lv_text_encoded_next(&cur_txt[cur_txt_ofs + next_ofs], NULL); - if(!(letter == '\0' || letter == '\n' || letter == '\r' || lv_text_is_break_char(letter) || - lv_text_is_a_word(letter) || lv_text_is_a_word(letter_next))) { - if(!(letter_next == '\0' || letter_next == '\n' || letter_next == '\r' || lv_text_is_break_char(letter_next))) { + uint32_t letter = _lv_txt_encoded_prev(&cur_txt[cur_txt_ofs], &tmp_ofs); + if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_txt_is_break_char(letter))) { + tmp_ofs = 0; + letter = _lv_txt_encoded_next(&cur_txt[cur_txt_ofs + next_ofs], &tmp_ofs); + if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_txt_is_break_char(letter))) { break; } } @@ -514,7 +474,7 @@ int32_t lv_spangroup_get_expand_height(lv_obj_t * obj, int32_t width) max_line_h = snippet.line_h; } snippet_cnt ++; - max_w = max_w - use_width; + max_w = max_w - use_width - snippet.letter_space; if(isfill || max_w <= 0) { break; } @@ -542,7 +502,7 @@ static void lv_spangroup_constructor(const lv_obj_class_t * class_p, lv_obj_t * { LV_UNUSED(class_p); lv_spangroup_t * spans = (lv_spangroup_t *)obj; - lv_ll_init(&spans->child_ll, sizeof(lv_span_t)); + _lv_ll_init(&spans->child_ll, sizeof(lv_span_t)); spans->indent = 0; spans->lines = -1; spans->mode = LV_SPAN_MODE_EXPAND; @@ -556,16 +516,15 @@ static void lv_spangroup_destructor(const lv_obj_class_t * class_p, lv_obj_t * o { LV_UNUSED(class_p); lv_spangroup_t * spans = (lv_spangroup_t *)obj; - lv_span_t * cur_span = lv_ll_get_head(&spans->child_ll); + lv_span_t * cur_span = _lv_ll_get_head(&spans->child_ll); while(cur_span) { - lv_ll_remove(&spans->child_ll, cur_span); + _lv_ll_remove(&spans->child_ll, cur_span); if(cur_span->txt && cur_span->static_flag == 0) { - lv_free(cur_span->txt); - cur_span->txt = NULL; + lv_mem_free(cur_span->txt); } lv_style_reset(&cur_span->style); - lv_free(cur_span); - cur_span = lv_ll_get_head(&spans->child_ll); + lv_mem_free(cur_span); + cur_span = _lv_ll_get_head(&spans->child_ll); } } @@ -574,10 +533,10 @@ static void lv_spangroup_event(const lv_obj_class_t * class_p, lv_event_t * e) LV_UNUSED(class_p); /* Call the ancestor's event handler */ - if(lv_obj_event_base(MY_CLASS, e) != LV_RESULT_OK) return; + if(lv_obj_event_base(MY_CLASS, e) != LV_RES_OK) return; lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_spangroup_t * spans = (lv_spangroup_t *)obj; if(code == LV_EVENT_DRAW_MAIN) { @@ -590,14 +549,14 @@ static void lv_spangroup_event(const lv_obj_class_t * class_p, lv_event_t * e) refresh_self_size(obj); } else if(code == LV_EVENT_GET_SELF_SIZE) { - int32_t width = 0; - int32_t height = 0; + lv_coord_t width = 0; + lv_coord_t height = 0; lv_point_t * self_size = lv_event_get_param(e); if(spans->mode == LV_SPAN_MODE_EXPAND) { if(spans->refresh) { - spans->cache_w = (int32_t)lv_spangroup_get_expand_width(obj, 0); - spans->cache_h = lv_spangroup_get_max_line_height(obj); + spans->cache_w = (lv_coord_t)lv_spangroup_get_expand_width(obj, 0); + spans->cache_h = lv_spangroup_get_max_line_h(obj); spans->refresh = 0; } width = spans->cache_w; @@ -628,18 +587,18 @@ static void lv_spangroup_event(const lv_obj_class_t * class_p, lv_event_t * e) static void draw_main(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); - lv_layer_t * layer = lv_event_get_layer(e); + lv_obj_t * obj = lv_event_get_target(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); - lv_draw_span(obj, layer); + lv_draw_span(obj, draw_ctx); } /** * @return true for txt fill the max_width. */ -static bool lv_text_get_snippet(const char * txt, const lv_font_t * font, - int32_t letter_space, int32_t max_width, lv_text_flag_t flag, - int32_t * use_width, uint32_t * end_ofs) +static bool lv_txt_get_snippet(const char * txt, const lv_font_t * font, + lv_coord_t letter_space, lv_coord_t max_width, lv_text_flag_t flag, + lv_coord_t * use_width, uint32_t * end_ofs) { if(txt == NULL || txt[0] == '\0') { *end_ofs = 0; @@ -647,17 +606,10 @@ static bool lv_text_get_snippet(const char * txt, const lv_font_t * font, return false; } - int32_t real_max_width = max_width; -#if !LV_USE_FONT_PLACEHOLDER - /* fix incomplete text display when disable the placeholder. */ - /* workaround by: https://github.com/lvgl/lvgl/issues/3685 */ - real_max_width++; -#endif - - uint32_t ofs = lv_text_get_next_line(txt, font, letter_space, real_max_width, use_width, flag); + uint32_t ofs = _lv_txt_get_next_line(txt, font, letter_space, max_width, use_width, flag); *end_ofs = ofs; - if(txt[ofs] == '\0' && *use_width < max_width && !(ofs && (txt[ofs - 1] == '\n' || txt[ofs - 1] == '\r'))) { + if(txt[ofs] == '\0' && *use_width < max_width) { return false; } else { @@ -667,37 +619,36 @@ static bool lv_text_get_snippet(const char * txt, const lv_font_t * font, static void lv_snippet_push(lv_snippet_t * item) { - struct _snippet_stack * stack_p = snippet_stack; - if(stack_p->index < LV_SPAN_SNIPPET_STACK_SIZE) { - lv_memcpy(&stack_p->stack[stack_p->index], item, sizeof(lv_snippet_t)); - stack_p->index++; + if(snippet_stack.index < LV_SPAN_SNIPPET_STACK_SIZE) { + memcpy(&snippet_stack.stack[snippet_stack.index], item, sizeof(lv_snippet_t)); + snippet_stack.index++; } else { LV_LOG_ERROR("span draw stack overflow, please set LV_SPAN_SNIPPET_STACK_SIZE too larger"); } } -static uint32_t lv_get_snippet_count(void) +static uint16_t lv_get_snippet_cnt(void) { - return snippet_stack->index; + return snippet_stack.index; } -static lv_snippet_t * lv_get_snippet(uint32_t index) +static lv_snippet_t * lv_get_snippet(uint16_t index) { - return &snippet_stack->stack[index]; + return &snippet_stack.stack[index]; } static void lv_snippet_clear(void) { - snippet_stack->index = 0; + snippet_stack.index = 0; } static const lv_font_t * lv_span_get_style_text_font(lv_obj_t * par, lv_span_t * span) { const lv_font_t * font; lv_style_value_t value; - lv_style_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_FONT, &value); - if(res != LV_STYLE_RES_FOUND) { + lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_FONT, &value); + if(res != LV_RES_OK) { font = lv_obj_get_style_text_font(par, LV_PART_MAIN); } else { @@ -706,16 +657,16 @@ static const lv_font_t * lv_span_get_style_text_font(lv_obj_t * par, lv_span_t * return font; } -static int32_t lv_span_get_style_text_letter_space(lv_obj_t * par, lv_span_t * span) +static lv_coord_t lv_span_get_style_text_letter_space(lv_obj_t * par, lv_span_t * span) { - int32_t letter_space; + lv_coord_t letter_space; lv_style_value_t value; - lv_style_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_LETTER_SPACE, &value); - if(res != LV_STYLE_RES_FOUND) { + lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_LETTER_SPACE, &value); + if(res != LV_RES_OK) { letter_space = lv_obj_get_style_text_letter_space(par, LV_PART_MAIN); } else { - letter_space = (int32_t)value.num; + letter_space = (lv_coord_t)value.num; } return letter_space; } @@ -723,8 +674,8 @@ static int32_t lv_span_get_style_text_letter_space(lv_obj_t * par, lv_span_t * s static lv_color_t lv_span_get_style_text_color(lv_obj_t * par, lv_span_t * span) { lv_style_value_t value; - lv_style_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_COLOR, &value); - if(res != LV_STYLE_RES_FOUND) { + lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_COLOR, &value); + if(res != LV_RES_OK) { value.color = lv_obj_get_style_text_color(par, LV_PART_MAIN); } return value.color; @@ -734,8 +685,8 @@ static lv_opa_t lv_span_get_style_text_opa(lv_obj_t * par, lv_span_t * span) { lv_opa_t opa; lv_style_value_t value; - lv_style_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_OPA, &value); - if(res != LV_STYLE_RES_FOUND) { + lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_OPA, &value); + if(res != LV_RES_OK) { opa = (lv_opa_t)lv_obj_get_style_text_opa(par, LV_PART_MAIN); } else { @@ -748,8 +699,8 @@ static lv_blend_mode_t lv_span_get_style_text_blend_mode(lv_obj_t * par, lv_span { lv_blend_mode_t mode; lv_style_value_t value; - lv_style_res_t res = lv_style_get_prop(&span->style, LV_STYLE_BLEND_MODE, &value); - if(res != LV_STYLE_RES_FOUND) { + lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_BLEND_MODE, &value); + if(res != LV_RES_OK) { mode = (lv_blend_mode_t)lv_obj_get_style_blend_mode(par, LV_PART_MAIN); } else { @@ -762,8 +713,8 @@ static int32_t lv_span_get_style_text_decor(lv_obj_t * par, lv_span_t * span) { int32_t decor; lv_style_value_t value; - lv_style_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_DECOR, &value); - if(res != LV_STYLE_RES_FOUND) { + lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_DECOR, &value); + if(res != LV_RES_OK) { decor = (lv_text_decor_t)lv_obj_get_style_text_decor(par, LV_PART_MAIN);; } else { @@ -780,11 +731,11 @@ static inline void span_text_check(const char ** text) } } -static int32_t convert_indent_pct(lv_obj_t * obj, int32_t width) +static lv_coord_t convert_indent_pct(lv_obj_t * obj, lv_coord_t width) { lv_spangroup_t * spans = (lv_spangroup_t *)obj; - int32_t indent = spans->indent; + lv_coord_t indent = spans->indent; if(LV_COORD_IS_PCT(spans->indent)) { if(spans->mode == LV_SPAN_MODE_EXPAND) { indent = 0; @@ -803,7 +754,7 @@ static int32_t convert_indent_pct(lv_obj_t * obj, int32_t width) * @param coords coordinates of the label * @param mask the label will be drawn only in this area */ -static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) +static void lv_draw_span(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx) { lv_area_t coords; @@ -812,22 +763,22 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) lv_spangroup_t * spans = (lv_spangroup_t *)obj; /* return if not span */ - if(lv_ll_get_head(&spans->child_ll) == NULL) { + if(_lv_ll_get_head(&spans->child_ll) == NULL) { return; } /* return if no draw area */ lv_area_t clip_area; - if(!lv_area_intersect(&clip_area, &coords, &layer->_clip_area)) return; - const lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = clip_area; + if(!_lv_area_intersect(&clip_area, &coords, draw_ctx->clip_area)) return; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_area; /* init draw variable */ lv_text_flag_t txt_flag = LV_TEXT_FLAG_NONE; - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN);; - int32_t max_width = lv_area_get_width(&coords); - int32_t indent = convert_indent_pct(obj, max_width); - int32_t max_w = max_width - indent; /* first line need minus indent */ + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN);; + lv_coord_t max_width = lv_area_get_width(&coords); + lv_coord_t indent = convert_indent_pct(obj, max_width); + lv_coord_t max_w = max_width - indent; /* first line need minus indent */ lv_opa_t obj_opa = lv_obj_get_style_opa_recursive(obj, LV_PART_MAIN); /* coords of draw span-txt */ @@ -835,12 +786,12 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) txt_pos.y = coords.y1; txt_pos.x = coords.x1 + indent; /* first line need add indent */ - lv_span_t * cur_span = lv_ll_get_head(&spans->child_ll); + lv_span_t * cur_span = _lv_ll_get_head(&spans->child_ll); const char * cur_txt = cur_span->txt; span_text_check(&cur_txt); uint32_t cur_txt_ofs = 0; lv_snippet_t snippet; /* use to save cur_span info and push it to stack */ - lv_memzero(&snippet, sizeof(snippet)); + lv_memset_00(&snippet, sizeof(snippet)); lv_draw_label_dsc_t label_draw_dsc; lv_draw_label_dsc_init(&label_draw_dsc); @@ -850,15 +801,15 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) while(cur_span) { bool is_end_line = false; bool ellipsis_valid = false; - int32_t max_line_h = 0; /* the max height of span-font when a line have a lot of span */ - int32_t max_baseline = 0; /*baseline of the highest span*/ + lv_coord_t max_line_h = 0; /* the max height of span-font when a line have a lot of span */ + lv_coord_t max_baseline = 0; /*baseline of the highest span*/ lv_snippet_clear(); /* the loop control to find a line and push the relevant span info into stack */ while(1) { /* switch to the next span when current is end */ if(cur_txt[cur_txt_ofs] == '\0') { - cur_span = lv_ll_get_next(&spans->child_ll, cur_span); + cur_span = _lv_ll_get_next(&spans->child_ll, cur_span); if(cur_span == NULL) break; cur_txt = cur_span->txt; span_text_check(&cur_txt); @@ -877,27 +828,23 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) /* get current span text line info */ uint32_t next_ofs = 0; - int32_t use_width = 0; - bool isfill = lv_text_get_snippet(&cur_txt[cur_txt_ofs], snippet.font, snippet.letter_space, - max_w, txt_flag, &use_width, &next_ofs); + lv_coord_t use_width = 0; + bool isfill = lv_txt_get_snippet(&cur_txt[cur_txt_ofs], snippet.font, snippet.letter_space, + max_w, txt_flag, &use_width, &next_ofs); if(isfill) { - if(next_ofs > 0 && lv_get_snippet_count() > 0) { - int32_t drawn_width = use_width; - if(lv_ll_get_next(&spans->child_ll, cur_span) == NULL) { - drawn_width -= snippet.letter_space; - } - /* To prevent infinite loops, the lv_text_get_next_line() may return incomplete words, */ - /* This phenomenon should be avoided when lv_get_snippet_count() > 0 */ - if(max_w < drawn_width) { + if(next_ofs > 0 && lv_get_snippet_cnt() > 0) { + /* To prevent infinite loops, the _lv_txt_get_next_line() may return incomplete words, */ + /* This phenomenon should be avoided when lv_get_snippet_cnt() > 0 */ + if(max_w < use_width) { break; } uint32_t tmp_ofs = next_ofs; - uint32_t letter = lv_text_encoded_prev(&cur_txt[cur_txt_ofs], &tmp_ofs); - uint32_t letter_next = lv_text_encoded_next(&cur_txt[cur_txt_ofs + next_ofs], NULL); - if(!(letter == '\0' || letter == '\n' || letter == '\r' || lv_text_is_break_char(letter) || - lv_text_is_a_word(letter) || lv_text_is_a_word(letter_next))) { - if(!(letter_next == '\0' || letter_next == '\n' || letter_next == '\r' || lv_text_is_break_char(letter_next))) { + uint32_t letter = _lv_txt_encoded_prev(&cur_txt[cur_txt_ofs], &tmp_ofs); + if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_txt_is_break_char(letter))) { + tmp_ofs = 0; + letter = _lv_txt_encoded_next(&cur_txt[cur_txt_ofs + next_ofs], &tmp_ofs); + if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_txt_is_break_char(letter))) { break; } } @@ -914,7 +861,7 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) } lv_snippet_push(&snippet); - max_w = max_w - use_width; + max_w = max_w - use_width - snippet.letter_space; if(isfill || max_w <= 0) { break; } @@ -922,7 +869,7 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) /* start current line deal with */ - uint32_t item_cnt = lv_get_snippet_count(); + uint16_t item_cnt = lv_get_snippet_cnt(); if(item_cnt == 0) { /* break if stack is empty */ break; } @@ -930,21 +877,21 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) /* Whether the current line is the end line and does overflow processing */ { lv_snippet_t * last_snippet = lv_get_snippet(item_cnt - 1); - int32_t next_line_h = last_snippet->line_h; + lv_coord_t next_line_h = last_snippet->line_h; if(last_snippet->txt[last_snippet->bytes] == '\0') { next_line_h = 0; - lv_span_t * next_span = lv_ll_get_next(&spans->child_ll, last_snippet->span); + lv_span_t * next_span = _lv_ll_get_next(&spans->child_ll, last_snippet->span); if(next_span) { /* have the next line */ next_line_h = lv_font_get_line_height(lv_span_get_style_text_font(obj, next_span)) + line_space; } } if(txt_pos.y + max_line_h + next_line_h - line_space > coords.y2 + 1) { /* for overflow if is end line. */ if(last_snippet->txt[last_snippet->bytes] != '\0') { - last_snippet->bytes = lv_strlen(last_snippet->txt); - last_snippet->txt_w = lv_text_get_width(last_snippet->txt, last_snippet->bytes, last_snippet->font, - last_snippet->letter_space); + last_snippet->bytes = strlen(last_snippet->txt); + last_snippet->txt_w = lv_txt_get_width(last_snippet->txt, last_snippet->bytes, last_snippet->font, + last_snippet->letter_space, txt_flag); } - ellipsis_valid = spans->overflow == LV_SPAN_OVERFLOW_ELLIPSIS; + ellipsis_valid = spans->overflow == LV_SPAN_OVERFLOW_ELLIPSIS ? true : false; is_end_line = true; } } @@ -957,12 +904,11 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) /* align deal with */ lv_text_align_t align = lv_obj_get_style_text_align(obj, LV_PART_MAIN); if(align == LV_TEXT_ALIGN_CENTER || align == LV_TEXT_ALIGN_RIGHT) { - int32_t align_ofs = 0; - int32_t txts_w = is_first_line ? indent : 0; - uint32_t i; - for(i = 0; i < item_cnt; i++) { + lv_coord_t align_ofs = 0; + lv_coord_t txts_w = is_first_line ? indent : 0; + for(int i = 0; i < item_cnt; i++) { lv_snippet_t * pinfo = lv_get_snippet(i); - txts_w = txts_w + pinfo->txt_w; + txts_w = txts_w + pinfo->txt_w + pinfo->letter_space; } txts_w -= lv_get_snippet(item_cnt - 1)->letter_space; align_ofs = max_width > txts_w ? max_width - txts_w : 0; @@ -973,7 +919,7 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) } /* draw line letters */ - uint32_t i; + int i; for(i = 0; i < item_cnt; i++) { lv_snippet_t * pinfo = lv_get_snippet(i); @@ -988,18 +934,18 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) label_draw_dsc.font = lv_span_get_style_text_font(obj, pinfo->span); label_draw_dsc.blend_mode = lv_span_get_style_text_blend_mode(obj, pinfo->span); if(obj_opa < LV_OPA_MAX) { - label_draw_dsc.opa = LV_OPA_MIX2(label_draw_dsc.opa, obj_opa); + label_draw_dsc.opa = (uint16_t)((uint16_t)label_draw_dsc.opa * obj_opa) >> 8; } uint32_t txt_bytes = pinfo->bytes; /* overflow */ - uint32_t dot_letter_w = 0; - uint32_t dot_width = 0; + uint16_t dot_letter_w = 0; + uint16_t dot_width = 0; if(ellipsis_valid) { dot_letter_w = lv_font_get_glyph_width(pinfo->font, '.', '.'); dot_width = dot_letter_w * 3; } - int32_t ellipsis_width = coords.x1 + max_width - dot_width; + lv_coord_t ellipsis_width = coords.x1 + max_width - dot_width; uint32_t j = 0; while(j < txt_bytes) { @@ -1007,8 +953,8 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) if(pos.x > clip_area.x2) { break; } - uint32_t letter = lv_text_encoded_next(bidi_txt, &j); - uint32_t letter_next = lv_text_encoded_next(&bidi_txt[j], NULL); + uint32_t letter = _lv_txt_encoded_next(bidi_txt, &j); + uint32_t letter_next = _lv_txt_encoded_next(&bidi_txt[j], NULL); int32_t letter_w = lv_font_get_glyph_width(pinfo->font, letter, letter_next); /* skip invalid fields */ @@ -1021,7 +967,7 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) if(ellipsis_valid && pos.x + letter_w + pinfo->letter_space > ellipsis_width) { for(int ell = 0; ell < 3; ell++) { - lv_draw_character(layer, &label_draw_dsc, &pos, '.'); + lv_draw_letter(draw_ctx, &label_draw_dsc, &pos, '.'); pos.x = pos.x + dot_letter_w + pinfo->letter_space; } if(pos.x <= ellipsis_width) { @@ -1030,7 +976,7 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) break; } else { - lv_draw_character(layer, &label_draw_dsc, &pos, letter); + lv_draw_letter(draw_ctx, &label_draw_dsc, &pos, letter); if(letter_w > 0) { pos.x = pos.x + letter_w + pinfo->letter_space; } @@ -1048,17 +994,23 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) line_dsc.blend_mode = label_draw_dsc.blend_mode; if(decor & LV_TEXT_DECOR_STRIKETHROUGH) { - int32_t y = pos.y + ((pinfo->line_h - line_space) >> 1) + (line_dsc.width >> 1); - lv_point_precise_set(&line_dsc.p1, txt_pos.x, y); - lv_point_precise_set(&line_dsc.p2, pos.x, y); - lv_draw_line(layer, &line_dsc); + lv_point_t p1; + lv_point_t p2; + p1.x = txt_pos.x; + p1.y = pos.y + ((pinfo->line_h - line_space) >> 1) + (line_dsc.width >> 1); + p2.x = pos.x; + p2.y = p1.y; + lv_draw_line(draw_ctx, &line_dsc, &p1, &p2); } if(decor & LV_TEXT_DECOR_UNDERLINE) { - int32_t y = pos.y + pinfo->line_h - line_space - pinfo->font->base_line - pinfo->font->underline_position; - lv_point_precise_set(&line_dsc.p1, txt_pos.x, y); - lv_point_precise_set(&line_dsc.p2, pos.x, y); - lv_draw_line(layer, &line_dsc); + lv_point_t p1; + lv_point_t p2; + p1.x = txt_pos.x; + p1.y = pos.y + pinfo->line_h - line_space - pinfo->font->base_line - pinfo->font->underline_position; + p2.x = pos.x; + p2.y = p1.y; + lv_draw_line(draw_ctx, &line_dsc, &p1, &p2); } } txt_pos.x = pos.x; @@ -1070,12 +1022,12 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) txt_pos.x = coords.x1; txt_pos.y += max_line_h; if(is_end_line || txt_pos.y > clip_area.y2 + 1) { - layer->_clip_area = clip_area_ori; + draw_ctx->clip_area = clip_area_ori; return; } max_w = max_width; } - layer->_clip_area = clip_area_ori; + draw_ctx->clip_area = clip_area_ori; } static void refresh_self_size(lv_obj_t * obj) diff --git a/L3_Middlewares/LVGL/src/extra/widgets/span/lv_span.h b/L3_Middlewares/LVGL/src/extra/widgets/span/lv_span.h new file mode 100644 index 0000000..f00d04d --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/span/lv_span.h @@ -0,0 +1,245 @@ +/** + * @file lv_span.h + * + */ + +#ifndef LV_SPAN_H +#define LV_SPAN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" + +#if LV_USE_SPAN != 0 + +/********************* + * DEFINES + *********************/ +#ifndef LV_SPAN_SNIPPET_STACK_SIZE +#define LV_SPAN_SNIPPET_STACK_SIZE 64 +#endif + +/********************** + * TYPEDEFS + **********************/ +enum { + LV_SPAN_OVERFLOW_CLIP, + LV_SPAN_OVERFLOW_ELLIPSIS, +}; +typedef uint8_t lv_span_overflow_t; + +enum { + LV_SPAN_MODE_FIXED, /**< fixed the obj size*/ + LV_SPAN_MODE_EXPAND, /**< Expand the object size to the text size*/ + LV_SPAN_MODE_BREAK, /**< Keep width, break the too long lines and expand height*/ +}; +typedef uint8_t lv_span_mode_t; + +typedef struct { + char * txt; /* a pointer to display text */ + lv_obj_t * spangroup; /* a pointer to spangroup */ + lv_style_t style; /* display text style */ + uint8_t static_flag : 1;/* the text is static flag */ +} lv_span_t; + +/** Data of label*/ +typedef struct { + lv_obj_t obj; + int32_t lines; + lv_coord_t indent; /* first line indent */ + lv_coord_t cache_w; /* the cache automatically calculates the width */ + lv_coord_t cache_h; /* similar cache_w */ + lv_ll_t child_ll; + uint8_t mode : 2; /* details see lv_span_mode_t */ + uint8_t overflow : 1; /* details see lv_span_overflow_t */ + uint8_t refresh : 1; /* the spangroup need refresh cache_w and cache_h */ +} lv_spangroup_t; + +extern const lv_obj_class_t lv_spangroup_class; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create a spangroup object + * @param par pointer to an object, it will be the parent of the new spangroup + * @return pointer to the created spangroup + */ +lv_obj_t * lv_spangroup_create(lv_obj_t * par); + +/** + * Create a span string descriptor and add to spangroup. + * @param obj pointer to a spangroup object. + * @return pointer to the created span. + */ +lv_span_t * lv_spangroup_new_span(lv_obj_t * obj); + +/** + * Remove the span from the spangroup and free memory. + * @param obj pointer to a spangroup object. + * @param span pointer to a span. + */ +void lv_spangroup_del_span(lv_obj_t * obj, lv_span_t * span); + +/*===================== + * Setter functions + *====================*/ + +/** + * Set a new text for a span. Memory will be allocated to store the text by the span. + * @param span pointer to a span. + * @param text pointer to a text. + */ +void lv_span_set_text(lv_span_t * span, const char * text); + +/** + * Set a static text. It will not be saved by the span so the 'text' variable + * has to be 'alive' while the span exist. + * @param span pointer to a span. + * @param text pointer to a text. + */ +void lv_span_set_text_static(lv_span_t * span, const char * text); + +/** + * Set the align of the spangroup. + * @param obj pointer to a spangroup object. + * @param align see lv_text_align_t for details. + */ +void lv_spangroup_set_align(lv_obj_t * obj, lv_text_align_t align); + +/** + * Set the overflow of the spangroup. + * @param obj pointer to a spangroup object. + * @param overflow see lv_span_overflow_t for details. + */ +void lv_spangroup_set_overflow(lv_obj_t * obj, lv_span_overflow_t overflow); + +/** + * Set the indent of the spangroup. + * @param obj pointer to a spangroup object. + * @param indent The first line indentation + */ +void lv_spangroup_set_indent(lv_obj_t * obj, lv_coord_t indent); + +/** + * Set the mode of the spangroup. + * @param obj pointer to a spangroup object. + * @param mode see lv_span_mode_t for details. + */ +void lv_spangroup_set_mode(lv_obj_t * obj, lv_span_mode_t mode); + +/** + * Set lines of the spangroup. + * @param obj pointer to a spangroup object. + * @param lines max lines that can be displayed in LV_SPAN_MODE_BREAK mode. < 0 means no limit. + */ +void lv_spangroup_set_lines(lv_obj_t * obj, int32_t lines); + +/*===================== + * Getter functions + *====================*/ + +/** + * Get a spangroup child by its index. + * + * @param obj The spangroup object + * @param id the index of the child. + * 0: the oldest (firstly created) child + * 1: the second oldest + * child count-1: the youngest + * -1: the youngest + * -2: the second youngest + * @return The child span at index `id`, or NULL if the ID does not exist + */ +lv_span_t * lv_spangroup_get_child(const lv_obj_t * obj, int32_t id); + +/** + * + * @param obj The spangroup object to get the child count of. + * @return The span count of the spangroup. + */ +uint32_t lv_spangroup_get_child_cnt(const lv_obj_t * obj); + +/** + * get the align of the spangroup. + * @param obj pointer to a spangroup object. + * @return the align value. + */ +lv_text_align_t lv_spangroup_get_align(lv_obj_t * obj); + +/** + * get the overflow of the spangroup. + * @param obj pointer to a spangroup object. + * @return the overflow value. + */ +lv_span_overflow_t lv_spangroup_get_overflow(lv_obj_t * obj); + +/** + * get the indent of the spangroup. + * @param obj pointer to a spangroup object. + * @return the indent value. + */ +lv_coord_t lv_spangroup_get_indent(lv_obj_t * obj); + +/** + * get the mode of the spangroup. + * @param obj pointer to a spangroup object. + */ +lv_span_mode_t lv_spangroup_get_mode(lv_obj_t * obj); + +/** + * get lines of the spangroup. + * @param obj pointer to a spangroup object. + * @return the lines value. + */ +int32_t lv_spangroup_get_lines(lv_obj_t * obj); + +/** + * get max line height of all span in the spangroup. + * @param obj pointer to a spangroup object. + */ +lv_coord_t lv_spangroup_get_max_line_h(lv_obj_t * obj); + +/** + * get the text content width when all span of spangroup on a line. + * @param obj pointer to a spangroup object. + * @param max_width if text content width >= max_width, return max_width + * to reduce computation, if max_width == 0, returns the text content width. + * @return text content width or max_width. + */ +uint32_t lv_spangroup_get_expand_width(lv_obj_t * obj, uint32_t max_width); + +/** + * get the text content height with width fixed. + * @param obj pointer to a spangroup object. + */ +lv_coord_t lv_spangroup_get_expand_height(lv_obj_t * obj, lv_coord_t width); + + +/*===================== + * Other functions + *====================*/ + +/** + * update the mode of the spangroup. + * @param obj pointer to a spangroup object. + */ +void lv_spangroup_refr_mode(lv_obj_t * obj); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_SPAN*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*LV_SPAN_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/spinbox/lv_spinbox.c b/L3_Middlewares/LVGL/src/extra/widgets/spinbox/lv_spinbox.c similarity index 56% rename from L3_Middlewares/LVGL/src/widgets/spinbox/lv_spinbox.c rename to L3_Middlewares/LVGL/src/extra/widgets/spinbox/lv_spinbox.c index 69e8d13..37db45c 100644 --- a/L3_Middlewares/LVGL/src/widgets/spinbox/lv_spinbox.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/spinbox/lv_spinbox.c @@ -6,20 +6,15 @@ /********************* * INCLUDES *********************/ -#include "lv_spinbox_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_spinbox.h" #if LV_USE_SPINBOX -#include "../../misc/lv_assert.h" -#include "../../indev/lv_indev.h" -#include "../../stdlib/lv_string.h" +#include "../../../misc/lv_assert.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_spinbox_class) -#define LV_SPINBOX_MAX_DIGIT_COUNT_WITH_8BYTES (LV_SPINBOX_MAX_DIGIT_COUNT + 8U) -#define LV_SPINBOX_MAX_DIGIT_COUNT_WITH_4BYTES (LV_SPINBOX_MAX_DIGIT_COUNT + 4U) +#define MY_CLASS &lv_spinbox_class /********************** * TYPEDEFS @@ -42,8 +37,7 @@ const lv_obj_class_t lv_spinbox_class = { .width_def = LV_DPI_DEF, .instance_size = sizeof(lv_spinbox_t), .editable = LV_OBJ_CLASS_EDITABLE_TRUE, - .base_class = &lv_textarea_class, - .name = "spinbox", + .base_class = &lv_textarea_class }; /********************** * MACROS @@ -65,48 +59,70 @@ lv_obj_t * lv_spinbox_create(lv_obj_t * parent) * Setter functions *====================*/ -void lv_spinbox_set_value(lv_obj_t * obj, int32_t v) +/** + * Set spinbox value + * @param obj pointer to spinbox + * @param i value to be set + */ +void lv_spinbox_set_value(lv_obj_t * obj, int32_t i) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; - if(v > spinbox->range_max) v = spinbox->range_max; - if(v < spinbox->range_min) v = spinbox->range_min; + if(i > spinbox->range_max) i = spinbox->range_max; + if(i < spinbox->range_min) i = spinbox->range_min; - spinbox->value = v; + spinbox->value = i; lv_spinbox_updatevalue(obj); } -void lv_spinbox_set_rollover(lv_obj_t * obj, bool rollover) +/** + * Set spinbox rollover function + * @param spinbox pointer to spinbox + * @param b true or false to enable or disable (default) + */ +void lv_spinbox_set_rollover(lv_obj_t * obj, bool b) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; - spinbox->rollover = rollover; + spinbox->rollover = b; } -void lv_spinbox_set_digit_format(lv_obj_t * obj, uint32_t digit_count, uint32_t sep_pos) +/** + * Set spinbox digit format (digit count and decimal format) + * @param spinbox pointer to spinbox + * @param digit_count number of digit excluding the decimal separator and the sign + * @param separator_position number of digit before the decimal point. If 0, decimal point is not + * shown + */ +void lv_spinbox_set_digit_format(lv_obj_t * obj, uint8_t digit_count, uint8_t separator_position) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; if(digit_count > LV_SPINBOX_MAX_DIGIT_COUNT) digit_count = LV_SPINBOX_MAX_DIGIT_COUNT; - if(sep_pos >= digit_count) sep_pos = 0; + if(separator_position >= digit_count) separator_position = 0; if(digit_count < LV_SPINBOX_MAX_DIGIT_COUNT) { - const int64_t max_val = lv_pow(10, digit_count); + int64_t max_val = lv_pow(10, digit_count); if(spinbox->range_max > max_val - 1) spinbox->range_max = max_val - 1; - if(spinbox->range_min < -max_val + 1) spinbox->range_min = -max_val + 1; + if(spinbox->range_min < - max_val + 1) spinbox->range_min = - max_val + 1; } spinbox->digit_count = digit_count; - spinbox->dec_point_pos = sep_pos; + spinbox->dec_point_pos = separator_position; lv_spinbox_updatevalue(obj); } +/** + * Set spinbox step + * @param spinbox pointer to spinbox + * @param step steps on increment/decrement + */ void lv_spinbox_set_step(lv_obj_t * obj, uint32_t step) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -116,6 +132,12 @@ void lv_spinbox_set_step(lv_obj_t * obj, uint32_t step) lv_spinbox_updatevalue(obj); } +/** + * Set spinbox value range + * @param spinbox pointer to spinbox + * @param range_min maximum value, inclusive + * @param range_max minimum value, inclusive + */ void lv_spinbox_set_range(lv_obj_t * obj, int32_t range_min, int32_t range_max) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -130,20 +152,29 @@ void lv_spinbox_set_range(lv_obj_t * obj, int32_t range_min, int32_t range_max) lv_spinbox_updatevalue(obj); } -void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint32_t pos) +/** + * Set cursor position to a specific digit for edition + * @param spinbox pointer to spinbox + * @param pos selected position in spinbox + */ +void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint8_t pos) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; - - const int32_t step_limit = LV_MAX(spinbox->range_max, LV_ABS(spinbox->range_min)); - const int32_t new_step = lv_pow(10, pos); - + int32_t step_limit; + step_limit = LV_MAX(spinbox->range_max, (spinbox->range_min < 0 ? (-spinbox->range_min) : spinbox->range_min)); + int32_t new_step = spinbox->step * lv_pow(10, pos); if(pos <= 0) spinbox->step = 1; else if(new_step <= step_limit) spinbox->step = new_step; lv_spinbox_updatevalue(obj); } +/** + * Set direction of digit step when clicking an encoder button while in editing mode + * @param spinbox pointer to spinbox + * @param direction the direction (LV_DIR_RIGHT or LV_DIR_LEFT) + */ void lv_spinbox_set_digit_step_direction(lv_obj_t * obj, lv_dir_t direction) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -156,6 +187,11 @@ void lv_spinbox_set_digit_step_direction(lv_obj_t * obj, lv_dir_t direction) * Getter functions *====================*/ +/** + * Get the spinbox numeral value (user has to convert to float according to its digit format) + * @param obj pointer to spinbox + * @return value integer value of the spinbox + */ int32_t lv_spinbox_get_value(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -163,7 +199,11 @@ int32_t lv_spinbox_get_value(lv_obj_t * obj) return spinbox->value; } - +/** + * Get the spinbox step value (user has to convert to float according to its digit format) + * @param obj pointer to spinbox + * @return value integer step value of the spinbox + */ int32_t lv_spinbox_get_step(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -176,29 +216,44 @@ int32_t lv_spinbox_get_step(lv_obj_t * obj) * Other functions *====================*/ +/** + * Select next lower digit for edition + * @param obj pointer to spinbox + */ void lv_spinbox_step_next(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; - const int32_t new_step = spinbox->step / 10; - spinbox->step = (new_step > 0) ? new_step : 1; + int32_t new_step = spinbox->step / 10; + if((new_step) > 0) + spinbox->step = new_step; + else + spinbox->step = 1; lv_spinbox_updatevalue(obj); } +/** + * Select next higher digit for edition + * @param obj pointer to spinbox + */ void lv_spinbox_step_prev(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; - - const int32_t step_limit = LV_MAX(spinbox->range_max, LV_ABS(spinbox->range_min)); - const int32_t new_step = spinbox->step * 10; + int32_t step_limit; + step_limit = LV_MAX(spinbox->range_max, (spinbox->range_min < 0 ? (-spinbox->range_min) : spinbox->range_min)); + int32_t new_step = spinbox->step * 10; if(new_step <= step_limit) spinbox->step = new_step; lv_spinbox_updatevalue(obj); } +/** + * Get spinbox rollover function status + * @param obj pointer to spinbox + */ bool lv_spinbox_get_rollover(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -207,62 +262,55 @@ bool lv_spinbox_get_rollover(lv_obj_t * obj) return spinbox->rollover; } +/** + * Increment spinbox value by one step + * @param obj pointer to spinbox + */ void lv_spinbox_increment(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; - int32_t v = spinbox->value; - /* Special mode when zero crossing. E.g -3+10 should be 3, not 7. - * Pretend we are on -7 now.*/ - if((spinbox->value < 0) && (spinbox->value + spinbox->step) > 0) { - v = -(spinbox->step + spinbox->value); - } + if(spinbox->value + spinbox->step <= spinbox->range_max) { + /*Special mode when zero crossing*/ + if((spinbox->value + spinbox->step) > 0 && spinbox->value < 0) spinbox->value = -spinbox->value; + spinbox->value += spinbox->step; - if(v + spinbox->step <= spinbox->range_max) { - v += spinbox->step; } else { - /*Rollover?*/ + // Rollover? if((spinbox->rollover) && (spinbox->value == spinbox->range_max)) - v = spinbox->range_min; + spinbox->value = spinbox->range_min; else - v = spinbox->range_max; + spinbox->value = spinbox->range_max; } - if(v != spinbox->value) { - spinbox->value = v; - lv_spinbox_updatevalue(obj); - } + lv_spinbox_updatevalue(obj); } +/** + * Decrement spinbox value by one step + * @param obj pointer to spinbox + */ void lv_spinbox_decrement(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; - int32_t v = spinbox->value; - /* Special mode when zero crossing. E.g 3-10 should be -3, not -7. - * Pretend we are on 7 now.*/ - if((spinbox->value > 0) && (spinbox->value - spinbox->step) < 0) { - v = spinbox->step - spinbox->value; - } - - if(v - spinbox->step >= spinbox->range_min) { - v -= spinbox->step; + if(spinbox->value - spinbox->step >= spinbox->range_min) { + /*Special mode when zero crossing*/ + if((spinbox->value - spinbox->step) < 0 && spinbox->value > 0) spinbox->value = -spinbox->value; + spinbox->value -= spinbox->step; } else { /*Rollover?*/ if((spinbox->rollover) && (spinbox->value == spinbox->range_min)) - v = spinbox->range_max; + spinbox->value = spinbox->range_max; else - v = spinbox->range_min; + spinbox->value = spinbox->range_min; } - if(v != spinbox->value) { - spinbox->value = v; - lv_spinbox_updatevalue(obj); - } + lv_spinbox_updatevalue(obj); } /********************** @@ -299,36 +347,38 @@ static void lv_spinbox_event(const lv_obj_class_t * class_p, lv_event_t * e) LV_UNUSED(class_p); /*Call the ancestor's event handler*/ - lv_result_t res = LV_RESULT_OK; + lv_res_t res = LV_RES_OK; res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; - const lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_event_code_t code = lv_event_get_code(e); + lv_obj_t * obj = lv_event_get_target(e); lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; if(code == LV_EVENT_RELEASED) { /*If released with an ENCODER then move to the next digit*/ - lv_indev_t * indev = lv_indev_active(); - if(lv_indev_get_type(indev) == LV_INDEV_TYPE_ENCODER && lv_group_get_editing(lv_obj_get_group(obj))) { - if(spinbox->digit_count > 1) { - if(spinbox->digit_step_dir == LV_DIR_RIGHT) { - if(spinbox->step > 1) { - lv_spinbox_step_next(obj); + lv_indev_t * indev = lv_indev_get_act(); + if(lv_indev_get_type(indev) == LV_INDEV_TYPE_ENCODER) { + if(lv_group_get_editing(lv_obj_get_group(obj))) { + if(spinbox->digit_count > 1) { + if(spinbox->digit_step_dir == LV_DIR_RIGHT) { + if(spinbox->step > 1) { + lv_spinbox_step_next(obj); + } + else { + /*Restart from the MSB*/ + spinbox->step = lv_pow(10, spinbox->digit_count - 2); + lv_spinbox_step_prev(obj); + } } else { - /*Restart from the MSB*/ - spinbox->step = lv_pow(10, spinbox->digit_count - 2); - lv_spinbox_step_prev(obj); - } - } - else { - if(spinbox->step < lv_pow(10, spinbox->digit_count - 1)) { - lv_spinbox_step_prev(obj); - } - else { - /*Restart from the LSB*/ - spinbox->step = 10; - lv_spinbox_step_next(obj); + if(spinbox->step < lv_pow(10, spinbox->digit_count - 1)) { + lv_spinbox_step_prev(obj); + } + else { + /*Restart from the LSB*/ + spinbox->step = 10; + lv_spinbox_step_next(obj); + } } } } @@ -337,40 +387,33 @@ static void lv_spinbox_event(const lv_obj_class_t * class_p, lv_event_t * e) * Set `step` accordingly*/ else { const char * txt = lv_textarea_get_text(obj); - const size_t txt_len = lv_strlen(txt); + size_t txt_len = strlen(txt); - /* Check cursor position */ - /* Cursor is in '.' digit */ if(txt[spinbox->ta.cursor.pos] == '.') { lv_textarea_cursor_left(obj); } - /* Cursor is already in the right-most digit */ else if(spinbox->ta.cursor.pos == (uint32_t)txt_len) { lv_textarea_set_cursor_pos(obj, txt_len - 1); } - /* Cursor is already in the left-most digit AND range_min is negative */ else if(spinbox->ta.cursor.pos == 0 && spinbox->range_min < 0) { lv_textarea_set_cursor_pos(obj, 1); } - /* Handle spinbox with decimal point (spinbox->dec_point_pos != 0) */ - uint32_t cp = spinbox->ta.cursor.pos; - if(spinbox->ta.cursor.pos > spinbox->dec_point_pos && spinbox->dec_point_pos != 0) cp--; + size_t len = spinbox->digit_count - 1; + uint16_t cp = spinbox->ta.cursor.pos; - const size_t len = spinbox->digit_count - 1; + if(spinbox->ta.cursor.pos > spinbox->dec_point_pos && spinbox->dec_point_pos != 0) cp--; uint32_t pos = len - cp; if(spinbox->range_min < 0) pos++; spinbox->step = 1; - uint32_t i; + uint16_t i; for(i = 0; i < pos; i++) spinbox->step *= 10; - - lv_spinbox_updatevalue(obj); } } else if(code == LV_EVENT_KEY) { - lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_active()); + lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); uint32_t c = *((uint32_t *)lv_event_get_param(e)); /*uint32_t because can be UTF-8*/ if(c == LV_KEY_RIGHT) { @@ -391,9 +434,6 @@ static void lv_spinbox_event(const lv_obj_class_t * class_p, lv_event_t * e) else if(c == LV_KEY_DOWN) { lv_spinbox_decrement(obj); } - else { - lv_textarea_add_char(obj, c); - } } } @@ -401,12 +441,12 @@ static void lv_spinbox_updatevalue(lv_obj_t * obj) { lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; - /* LV_SPINBOX_MAX_DIGIT_COUNT_WITH_8BYTES (18): Max possible digit_count value (15) + sign + decimal point + NULL terminator */ - char textarea_txt[LV_SPINBOX_MAX_DIGIT_COUNT_WITH_8BYTES] = {0U}; - char * buf_p = textarea_txt; + char buf[LV_SPINBOX_MAX_DIGIT_COUNT + 8]; + lv_memset_00(buf, sizeof(buf)); + char * buf_p = buf; + uint8_t cur_shift_left = 0; - uint32_t cur_shift_left = 0; - if(spinbox->range_min < 0) { /*hide sign if there are only positive values*/ + if(spinbox->range_min < 0) { // hide sign if there are only positive values /*Add the sign*/ (*buf_p) = spinbox->value >= 0 ? '+' : '-'; buf_p++; @@ -416,34 +456,33 @@ static void lv_spinbox_updatevalue(lv_obj_t * obj) cur_shift_left++; } - /*Convert the numbers to string (the sign is already handled so always convert positive number)*/ - char digits[LV_SPINBOX_MAX_DIGIT_COUNT_WITH_4BYTES]; - lv_snprintf(digits, LV_SPINBOX_MAX_DIGIT_COUNT_WITH_4BYTES, "%" LV_PRId32, LV_ABS(spinbox->value)); - - /*Add leading zeros*/ int32_t i; - const size_t digits_len = lv_strlen(digits); + char digits[LV_SPINBOX_MAX_DIGIT_COUNT + 4]; + /*Convert the numbers to string (the sign is already handled so always covert positive number)*/ + lv_snprintf(digits, sizeof(digits), "%" LV_PRId32, LV_ABS(spinbox->value)); - const int leading_zeros_cnt = spinbox->digit_count - digits_len; - if(leading_zeros_cnt) { - for(i = (int32_t) digits_len; i >= 0; i--) { - digits[i + leading_zeros_cnt] = digits[i]; + /*Add leading zeros*/ + int lz_cnt = spinbox->digit_count - (int)strlen(digits); + if(lz_cnt > 0) { + for(i = (uint16_t)strlen(digits); i >= 0; i--) { + digits[i + lz_cnt] = digits[i]; } - /* NOTE: Substitute with memset? */ - for(i = 0; i < leading_zeros_cnt; i++) { + for(i = 0; i < lz_cnt; i++) { digits[i] = '0'; } } + int32_t intDigits; + intDigits = (spinbox->dec_point_pos == 0) ? spinbox->digit_count : spinbox->dec_point_pos; + /*Add the decimal part*/ - const uint32_t intDigits = (spinbox->dec_point_pos == 0) ? spinbox->digit_count : spinbox->dec_point_pos; - for(i = 0; i < (int32_t)intDigits && digits[i] != '\0'; i++) { + for(i = 0; i < intDigits && digits[i] != '\0'; i++) { (*buf_p) = digits[i]; buf_p++; } - /*Insert the decimal point*/ - if(spinbox->dec_point_pos) { + if(spinbox->dec_point_pos != 0) { + /*Insert the decimal point*/ (*buf_p) = '.'; buf_p++; @@ -454,11 +493,11 @@ static void lv_spinbox_updatevalue(lv_obj_t * obj) } /*Refresh the text*/ - lv_textarea_set_text(obj, (char *)textarea_txt); + lv_textarea_set_text(obj, (char *)buf); /*Set the cursor position*/ - int32_t step = spinbox->step; - uint32_t cur_pos = (uint32_t)spinbox->digit_count; + int32_t step = spinbox->step; + uint8_t cur_pos = (uint8_t)spinbox->digit_count; while(step >= 10) { step /= 10; cur_pos--; diff --git a/L3_Middlewares/LVGL/src/widgets/spinbox/lv_spinbox.h b/L3_Middlewares/LVGL/src/extra/widgets/spinbox/lv_spinbox.h similarity index 53% rename from L3_Middlewares/LVGL/src/widgets/spinbox/lv_spinbox.h rename to L3_Middlewares/LVGL/src/extra/widgets/spinbox/lv_spinbox.h index ae3fdb0..1a4bc32 100644 --- a/L3_Middlewares/LVGL/src/widgets/spinbox/lv_spinbox.h +++ b/L3_Middlewares/LVGL/src/extra/widgets/spinbox/lv_spinbox.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../textarea/lv_textarea.h" +#include "../../../lvgl.h" #if LV_USE_SPINBOX @@ -31,16 +31,30 @@ extern "C" { * TYPEDEFS **********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_spinbox_class; +/*Data of spinbox*/ +typedef struct { + lv_textarea_t ta; /*Ext. of ancestor*/ + /*New data for this type*/ + int32_t value; + int32_t range_max; + int32_t range_min; + int32_t step; + uint16_t digit_count : 4; + uint16_t dec_point_pos : 4; /*if 0, there is no separator and the number is an integer*/ + uint16_t rollover : 1; // Set to true for rollover functionality + uint16_t digit_step_dir : 2; // the direction the digit will step on encoder button press when editing +} lv_spinbox_t; + +extern const lv_obj_class_t lv_spinbox_class; /********************** * GLOBAL PROTOTYPES **********************/ /** - * Create a spinbox object - * @param parent pointer to an object, it will be the parent of the new spinbox - * @return pointer to the created spinbox + * Create a Spinbox object + * @param parent pointer to an object, it will be the parent of the new spinbox + * @return pointer to the created spinbox */ lv_obj_t * lv_spinbox_create(lv_obj_t * parent); @@ -50,37 +64,37 @@ lv_obj_t * lv_spinbox_create(lv_obj_t * parent); /** * Set spinbox value - * @param obj pointer to spinbox - * @param v value to be set + * @param obj pointer to spinbox + * @param i value to be set */ -void lv_spinbox_set_value(lv_obj_t * obj, int32_t v); +void lv_spinbox_set_value(lv_obj_t * obj, int32_t i); /** * Set spinbox rollover function - * @param obj pointer to spinbox - * @param rollover true or false to enable or disable (default) + * @param obj pointer to spinbox + * @param b true or false to enable or disable (default) */ -void lv_spinbox_set_rollover(lv_obj_t * obj, bool rollover); +void lv_spinbox_set_rollover(lv_obj_t * obj, bool b); /** * Set spinbox digit format (digit count and decimal format) - * @param obj pointer to spinbox - * @param digit_count number of digit excluding the decimal separator and the sign - * @param sep_pos number of digit before the decimal point. If 0, decimal point is not + * @param obj pointer to spinbox + * @param digit_count number of digit excluding the decimal separator and the sign + * @param separator_position number of digit before the decimal point. If 0, decimal point is not * shown */ -void lv_spinbox_set_digit_format(lv_obj_t * obj, uint32_t digit_count, uint32_t sep_pos); +void lv_spinbox_set_digit_format(lv_obj_t * obj, uint8_t digit_count, uint8_t separator_position); /** * Set spinbox step - * @param obj pointer to spinbox - * @param step steps on increment/decrement. Can be 1, 10, 100, 1000, etc the digit that will change. + * @param obj pointer to spinbox + * @param step steps on increment/decrement. Can be 1, 10, 100, 1000, etc the digit that will change. */ void lv_spinbox_set_step(lv_obj_t * obj, uint32_t step); /** * Set spinbox value range - * @param obj pointer to spinbox + * @param obj pointer to spinbox * @param range_min maximum value, inclusive * @param range_max minimum value, inclusive */ @@ -88,15 +102,15 @@ void lv_spinbox_set_range(lv_obj_t * obj, int32_t range_min, int32_t range_max); /** * Set cursor position to a specific digit for edition - * @param obj pointer to spinbox - * @param pos selected position in spinbox + * @param obj pointer to spinbox + * @param pos selected position in spinbox */ -void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint32_t pos); +void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint8_t pos); /** * Set direction of digit step when clicking an encoder button while in editing mode - * @param obj pointer to spinbox - * @param direction the direction (LV_DIR_RIGHT or LV_DIR_LEFT) + * @param obj pointer to spinbox + * @param direction the direction (LV_DIR_RIGHT or LV_DIR_LEFT) */ void lv_spinbox_set_digit_step_direction(lv_obj_t * obj, lv_dir_t direction); @@ -106,21 +120,21 @@ void lv_spinbox_set_digit_step_direction(lv_obj_t * obj, lv_dir_t direction); /** * Get spinbox rollover function status - * @param obj pointer to spinbox + * @param obj pointer to spinbox */ bool lv_spinbox_get_rollover(lv_obj_t * obj); /** * Get the spinbox numeral value (user has to convert to float according to its digit format) - * @param obj pointer to spinbox - * @return value integer value of the spinbox + * @param obj pointer to spinbox + * @return value integer value of the spinbox */ int32_t lv_spinbox_get_value(lv_obj_t * obj); /** * Get the spinbox step value (user has to convert to float according to its digit format) - * @param obj pointer to spinbox - * @return value integer step value of the spinbox + * @param obj pointer to spinbox + * @return value integer step value of the spinbox */ int32_t lv_spinbox_get_step(lv_obj_t * obj); @@ -130,25 +144,25 @@ int32_t lv_spinbox_get_step(lv_obj_t * obj); /** * Select next lower digit for edition by dividing the step by 10 - * @param obj pointer to spinbox + * @param obj pointer to spinbox */ void lv_spinbox_step_next(lv_obj_t * obj); /** * Select next higher digit for edition by multiplying the step by 10 - * @param obj pointer to spinbox + * @param obj pointer to spinbox */ void lv_spinbox_step_prev(lv_obj_t * obj); /** * Increment spinbox value by one step - * @param obj pointer to spinbox + * @param obj pointer to spinbox */ void lv_spinbox_increment(lv_obj_t * obj); /** * Decrement spinbox value by one step - * @param obj pointer to spinbox + * @param obj pointer to spinbox */ void lv_spinbox_decrement(lv_obj_t * obj); @@ -156,6 +170,10 @@ void lv_spinbox_decrement(lv_obj_t * obj); * MACROS **********************/ +/* It was ambiguous in MicroPython. See https://github.com/lvgl/lvgl/issues/3301 + * TODO remove in v9*/ +#define lv_spinbox_set_pos lv_spinbox_set_cursor_pos + #endif /*LV_USE_SPINBOX*/ #ifdef __cplusplus diff --git a/L3_Middlewares/LVGL/src/widgets/spinner/lv_spinner.c b/L3_Middlewares/LVGL/src/extra/widgets/spinner/lv_spinner.c similarity index 64% rename from L3_Middlewares/LVGL/src/widgets/spinner/lv_spinner.c rename to L3_Middlewares/LVGL/src/extra/widgets/spinner/lv_spinner.c index 18cb005..6fc6d74 100644 --- a/L3_Middlewares/LVGL/src/widgets/spinner/lv_spinner.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/spinner/lv_spinner.c @@ -6,16 +6,12 @@ /********************* * INCLUDES *********************/ -#include "../../misc/lv_anim_private.h" -#include "../../core/lv_obj_class_private.h" -#include "../../lvgl.h" +#include "lv_spinner.h" #if LV_USE_SPINNER /********************* * DEFINES *********************/ -#define DEF_ARC_ANGLE 200 -#define DEF_TIME 1000 /********************** * TYPEDEFS @@ -33,10 +29,12 @@ static void arc_anim_end_angle(void * obj, int32_t v); **********************/ const lv_obj_class_t lv_spinner_class = { .base_class = &lv_arc_class, - .constructor_cb = lv_spinner_constructor, - .name = "spinner", + .constructor_cb = lv_spinner_constructor }; +static uint32_t time_param; +static uint32_t arc_length_param; + /********************** * MACROS **********************/ @@ -45,31 +43,44 @@ const lv_obj_class_t lv_spinner_class = { * GLOBAL FUNCTIONS **********************/ -lv_obj_t * lv_spinner_create(lv_obj_t * parent) +/** + * Create a spinner object + * @param parent pointer to an object, it will be the parent of the new spinner + * @return pointer to the created spinner + */ +lv_obj_t * lv_spinner_create(lv_obj_t * parent, uint32_t time, uint32_t arc_length) { + time_param = time; + arc_length_param = arc_length; lv_obj_t * obj = lv_obj_class_create_obj(&lv_spinner_class, parent); lv_obj_class_init_obj(obj); return obj; } -void lv_spinner_set_anim_params(lv_obj_t * obj, uint32_t t, uint32_t angle) + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_spinner_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { - /*Delete the current animation*/ - lv_anim_delete(obj, NULL); + LV_TRACE_OBJ_CREATE("begin"); + + LV_UNUSED(class_p); + + lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); lv_anim_t a; lv_anim_init(&a); lv_anim_set_var(&a, obj); lv_anim_set_exec_cb(&a, arc_anim_end_angle); lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); - lv_anim_set_duration(&a, t); - lv_anim_set_values(&a, angle, 360 + angle); + lv_anim_set_time(&a, time_param); + lv_anim_set_values(&a, arc_length_param, 360 + arc_length_param); lv_anim_start(&a); - lv_anim_set_path_cb(&a, lv_anim_path_custom_bezier3); - lv_anim_set_bezier3_param(&a, LV_BEZIER_VAL_FLOAT(0.42), LV_BEZIER_VAL_FLOAT(0.58), - LV_BEZIER_VAL_FLOAT(0), LV_BEZIER_VAL_FLOAT(1)); + lv_anim_set_path_cb(&a, lv_anim_path_ease_in_out); lv_anim_set_values(&a, 0, 360); lv_anim_set_exec_cb(&a, arc_anim_start_angle); lv_anim_start(&a); @@ -78,29 +89,16 @@ void lv_spinner_set_anim_params(lv_obj_t * obj, uint32_t t, uint32_t angle) lv_arc_set_rotation(obj, 270); } -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_spinner_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_TRACE_OBJ_CREATE("begin"); - - LV_UNUSED(class_p); - - lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); - - lv_spinner_set_anim_params(obj, DEF_TIME, DEF_ARC_ANGLE); -} static void arc_anim_start_angle(void * obj, int32_t v) { - lv_arc_set_start_angle(obj, (uint32_t) v); + lv_arc_set_start_angle(obj, (uint16_t) v); } + static void arc_anim_end_angle(void * obj, int32_t v) { - lv_arc_set_end_angle(obj, (uint32_t) v); + lv_arc_set_end_angle(obj, (uint16_t) v); } #endif /*LV_USE_SPINNER*/ diff --git a/L3_Middlewares/LVGL/src/widgets/spinner/lv_spinner.h b/L3_Middlewares/LVGL/src/extra/widgets/spinner/lv_spinner.h similarity index 53% rename from L3_Middlewares/LVGL/src/widgets/spinner/lv_spinner.h rename to L3_Middlewares/LVGL/src/extra/widgets/spinner/lv_spinner.h index 9244563..2ab36f6 100644 --- a/L3_Middlewares/LVGL/src/widgets/spinner/lv_spinner.h +++ b/L3_Middlewares/LVGL/src/extra/widgets/spinner/lv_spinner.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" +#include "../../../lvgl.h" #if LV_USE_SPINNER @@ -29,26 +29,13 @@ extern "C" { /********************** * TYPEDEFS **********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_spinner_class; +extern const lv_obj_class_t lv_spinner_class; /********************** * GLOBAL PROTOTYPES **********************/ -/** - * Create a spinner widget - * @param parent pointer to an object, it will be the parent of the new spinner. - * @return the created spinner - */ -lv_obj_t * lv_spinner_create(lv_obj_t * parent); - -/** - * Set the animation time and arc length of the spinner - * @param obj pointer to a spinner - * @param t the animation time in milliseconds - * @param angle the angle of the arc in degrees - */ -void lv_spinner_set_anim_params(lv_obj_t * obj, uint32_t t, uint32_t angle); +lv_obj_t * lv_spinner_create(lv_obj_t * parent, uint32_t time, uint32_t arc_length); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/extra/widgets/tabview/lv_tabview.c b/L3_Middlewares/LVGL/src/extra/widgets/tabview/lv_tabview.c new file mode 100644 index 0000000..f013823 --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/tabview/lv_tabview.c @@ -0,0 +1,354 @@ +/** + * @file lv_tabview.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_tabview.h" +#if LV_USE_TABVIEW + +#include "../../../misc/lv_assert.h" + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_tabview_class + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_tabview_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_tabview_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_tabview_event(const lv_obj_class_t * class_p, lv_event_t * e); +static void btns_value_changed_event_cb(lv_event_t * e); +static void cont_scroll_end_event_cb(lv_event_t * e); + +/********************** + * STATIC VARIABLES + **********************/ +const lv_obj_class_t lv_tabview_class = { + .constructor_cb = lv_tabview_constructor, + .destructor_cb = lv_tabview_destructor, + .event_cb = lv_tabview_event, + .width_def = LV_PCT(100), + .height_def = LV_PCT(100), + .base_class = &lv_obj_class, + .instance_size = sizeof(lv_tabview_t) +}; + +static lv_dir_t tabpos_create; +static lv_coord_t tabsize_create; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_obj_t * lv_tabview_create(lv_obj_t * parent, lv_dir_t tab_pos, lv_coord_t tab_size) +{ + LV_LOG_INFO("begin"); + tabpos_create = tab_pos; + tabsize_create = tab_size; + + lv_obj_t * obj = lv_obj_class_create_obj(&lv_tabview_class, parent); + lv_obj_class_init_obj(obj); + return obj; +} + +lv_obj_t * lv_tabview_add_tab(lv_obj_t * obj, const char * name) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_tabview_t * tabview = (lv_tabview_t *)obj; + lv_obj_t * cont = lv_tabview_get_content(obj); + + lv_obj_t * page = lv_obj_create(cont); + lv_obj_set_size(page, LV_PCT(100), LV_PCT(100)); + lv_obj_clear_flag(page, LV_OBJ_FLAG_CLICK_FOCUSABLE); + uint32_t tab_id = lv_obj_get_child_cnt(cont); + + lv_obj_t * btns = lv_tabview_get_tab_btns(obj); + + const char ** old_map = (const char **)tabview->map; + const char ** new_map; + + /*top or bottom dir*/ + if(tabview->tab_pos & LV_DIR_VER) { + new_map = lv_mem_alloc((tab_id + 1) * sizeof(const char *)); + lv_memcpy_small(new_map, old_map, sizeof(const char *) * (tab_id - 1)); + new_map[tab_id - 1] = lv_mem_alloc(strlen(name) + 1); + strcpy((char *)new_map[tab_id - 1], name); + new_map[tab_id] = ""; + } + /*left or right dir*/ + else { + new_map = lv_mem_alloc((tab_id * 2) * sizeof(const char *)); + lv_memcpy_small(new_map, old_map, sizeof(const char *) * (tab_id - 1) * 2); + if(tabview->tab_cnt == 0) { + new_map[0] = lv_mem_alloc(strlen(name) + 1); + strcpy((char *)new_map[0], name); + new_map[1] = ""; + } + else { + new_map[tab_id * 2 - 3] = "\n"; + new_map[tab_id * 2 - 2] = lv_mem_alloc(strlen(name) + 1); + new_map[tab_id * 2 - 1] = ""; + strcpy((char *)new_map[(tab_id * 2) - 2], name); + } + } + tabview->map = new_map; + lv_btnmatrix_set_map(btns, (const char **)new_map); + lv_mem_free(old_map); + + lv_btnmatrix_set_btn_ctrl_all(btns, LV_BTNMATRIX_CTRL_CHECKABLE | LV_BTNMATRIX_CTRL_CLICK_TRIG | + LV_BTNMATRIX_CTRL_NO_REPEAT); + + tabview->tab_cnt++; + if(tabview->tab_cnt == 1) { + lv_tabview_set_act(obj, 0, LV_ANIM_OFF); + } + + lv_btnmatrix_set_btn_ctrl(btns, tabview->tab_cur, LV_BTNMATRIX_CTRL_CHECKED); + + return page; +} + +void lv_tabview_rename_tab(lv_obj_t * obj, uint32_t id, const char * new_name) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_tabview_t * tabview = (lv_tabview_t *)obj; + + if(id >= tabview->tab_cnt) return; + if(tabview->tab_pos & LV_DIR_HOR) id *= 2; + + lv_mem_free((void *)tabview->map[id]); + tabview->map[id] = lv_mem_alloc(strlen(new_name) + 1); + strcpy((void *)tabview->map[id], new_name); + lv_obj_invalidate(obj); +} + +void lv_tabview_set_act(lv_obj_t * obj, uint32_t id, lv_anim_enable_t anim_en) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + if(obj->being_deleted) return; + + lv_tabview_t * tabview = (lv_tabview_t *)obj; + + if(id >= tabview->tab_cnt) { + id = tabview->tab_cnt - 1; + } + + /*To be sure lv_obj_get_content_width will return valid value*/ + lv_obj_update_layout(obj); + + lv_obj_t * cont = lv_tabview_get_content(obj); + if(cont == NULL) return; + + if((tabview->tab_pos & LV_DIR_VER) != 0) { + lv_coord_t gap = lv_obj_get_style_pad_column(cont, LV_PART_MAIN); + lv_coord_t w = lv_obj_get_content_width(cont); + if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) != LV_BASE_DIR_RTL) { + lv_obj_scroll_to_x(cont, id * (gap + w), anim_en); + } + else { + int32_t id_rtl = -(int32_t)id; + lv_obj_scroll_to_x(cont, (gap + w) * id_rtl, anim_en); + } + } + else { + lv_coord_t gap = lv_obj_get_style_pad_row(cont, LV_PART_MAIN); + lv_coord_t h = lv_obj_get_content_height(cont); + lv_obj_scroll_to_y(cont, id * (gap + h), anim_en); + } + + lv_obj_t * btns = lv_tabview_get_tab_btns(obj); + lv_btnmatrix_set_btn_ctrl(btns, id, LV_BTNMATRIX_CTRL_CHECKED); + tabview->tab_cur = id; +} + +uint16_t lv_tabview_get_tab_act(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_tabview_t * tabview = (lv_tabview_t *)obj; + return tabview->tab_cur; +} + +lv_obj_t * lv_tabview_get_content(lv_obj_t * tv) +{ + return lv_obj_get_child(tv, 1); +} + +lv_obj_t * lv_tabview_get_tab_btns(lv_obj_t * tv) +{ + return lv_obj_get_child(tv, 0); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_tabview_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + lv_tabview_t * tabview = (lv_tabview_t *)obj; + + tabview->tab_pos = tabpos_create; + + switch(tabview->tab_pos) { + case LV_DIR_TOP: + lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); + break; + case LV_DIR_BOTTOM: + lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN_REVERSE); + break; + case LV_DIR_LEFT: + lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW); + break; + case LV_DIR_RIGHT: + lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW_REVERSE); + break; + } + + lv_obj_set_size(obj, LV_PCT(100), LV_PCT(100)); + + lv_obj_t * btnm; + lv_obj_t * cont; + + btnm = lv_btnmatrix_create(obj); + cont = lv_obj_create(obj); + + lv_btnmatrix_set_one_checked(btnm, true); + tabview->map = lv_mem_alloc(sizeof(const char *)); + tabview->map[0] = ""; + lv_btnmatrix_set_map(btnm, (const char **)tabview->map); + lv_obj_add_event_cb(btnm, btns_value_changed_event_cb, LV_EVENT_VALUE_CHANGED, NULL); + lv_obj_add_flag(btnm, LV_OBJ_FLAG_EVENT_BUBBLE); + + lv_obj_add_event_cb(cont, cont_scroll_end_event_cb, LV_EVENT_ALL, NULL); + lv_obj_set_scrollbar_mode(cont, LV_SCROLLBAR_MODE_OFF); + + switch(tabview->tab_pos) { + case LV_DIR_TOP: + case LV_DIR_BOTTOM: + lv_obj_set_size(btnm, LV_PCT(100), tabsize_create); + lv_obj_set_width(cont, LV_PCT(100)); + lv_obj_set_flex_grow(cont, 1); + break; + case LV_DIR_LEFT: + case LV_DIR_RIGHT: + lv_obj_set_size(btnm, tabsize_create, LV_PCT(100)); + lv_obj_set_height(cont, LV_PCT(100)); + lv_obj_set_flex_grow(cont, 1); + break; + } + + lv_group_t * g = lv_group_get_default(); + if(g) lv_group_add_obj(g, btnm); + + if((tabview->tab_pos & LV_DIR_VER) != 0) { + lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW); + lv_obj_set_scroll_snap_x(cont, LV_SCROLL_SNAP_CENTER); + } + else { + lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_COLUMN); + lv_obj_set_scroll_snap_y(cont, LV_SCROLL_SNAP_CENTER); + } + lv_obj_add_flag(cont, LV_OBJ_FLAG_SCROLL_ONE); + lv_obj_clear_flag(cont, LV_OBJ_FLAG_SCROLL_ON_FOCUS); +} + +static void lv_tabview_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + lv_tabview_t * tabview = (lv_tabview_t *)obj; + + uint32_t i; + if(tabview->tab_pos & LV_DIR_VER) { + for(i = 0; i < tabview->tab_cnt; i++) { + lv_mem_free((void *)tabview->map[i]); + tabview->map[i] = NULL; + } + } + if(tabview->tab_pos & LV_DIR_HOR) { + for(i = 0; i < tabview->tab_cnt; i++) { + lv_mem_free((void *)tabview->map[i * 2]); + tabview->map[i * 2] = NULL; + } + } + + + lv_mem_free(tabview->map); + tabview->map = NULL; +} + +static void lv_tabview_event(const lv_obj_class_t * class_p, lv_event_t * e) +{ + LV_UNUSED(class_p); + lv_res_t res = lv_obj_event_base(&lv_tabview_class, e); + if(res != LV_RES_OK) return; + + lv_event_code_t code = lv_event_get_code(e); + lv_obj_t * target = lv_event_get_target(e); + + if(code == LV_EVENT_SIZE_CHANGED) { + lv_tabview_set_act(target, lv_tabview_get_tab_act(target), LV_ANIM_OFF); + } +} + + +static void btns_value_changed_event_cb(lv_event_t * e) +{ + lv_obj_t * btns = lv_event_get_target(e); + + lv_obj_t * tv = lv_obj_get_parent(btns); + uint32_t id = lv_btnmatrix_get_selected_btn(btns); + lv_tabview_set_act(tv, id, LV_ANIM_OFF); +} + +static void cont_scroll_end_event_cb(lv_event_t * e) +{ + lv_obj_t * cont = lv_event_get_target(e); + lv_event_code_t code = lv_event_get_code(e); + + lv_obj_t * tv = lv_obj_get_parent(cont); + lv_tabview_t * tv_obj = (lv_tabview_t *)tv; + if(code == LV_EVENT_LAYOUT_CHANGED) { + lv_tabview_set_act(tv, lv_tabview_get_tab_act(tv), LV_ANIM_OFF); + } + else if(code == LV_EVENT_SCROLL_END) { + lv_indev_t * indev = lv_indev_get_act(); + if(indev && indev->proc.state == LV_INDEV_STATE_PRESSED) { + return; + } + + lv_point_t p; + lv_obj_get_scroll_end(cont, &p); + + lv_coord_t t; + if((tv_obj->tab_pos & LV_DIR_VER) != 0) { + lv_coord_t w = lv_obj_get_content_width(cont); + if(lv_obj_get_style_base_dir(tv, LV_PART_MAIN) == LV_BASE_DIR_RTL) t = -(p.x - w / 2) / w; + else t = (p.x + w / 2) / w; + } + else { + lv_coord_t h = lv_obj_get_content_height(cont); + t = (p.y + h / 2) / h; + } + + if(t < 0) t = 0; + bool new_tab = false; + if(t != lv_tabview_get_tab_act(tv)) new_tab = true; + lv_tabview_set_act(tv, t, LV_ANIM_ON); + + if(new_tab) lv_event_send(tv, LV_EVENT_VALUE_CHANGED, NULL); + } +} +#endif /*LV_USE_TABVIEW*/ diff --git a/L3_Middlewares/LVGL/src/extra/widgets/tabview/lv_tabview.h b/L3_Middlewares/LVGL/src/extra/widgets/tabview/lv_tabview.h new file mode 100644 index 0000000..ee7d7ce --- /dev/null +++ b/L3_Middlewares/LVGL/src/extra/widgets/tabview/lv_tabview.h @@ -0,0 +1,65 @@ +/** + * @file lv_templ.h + * + */ + +#ifndef LV_TABVIEW_H +#define LV_TABVIEW_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../../../lvgl.h" + +#if LV_USE_TABVIEW + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_obj_t obj; + const char ** map; + uint16_t tab_cnt; + uint16_t tab_cur; + lv_dir_t tab_pos; +} lv_tabview_t; + +extern const lv_obj_class_t lv_tabview_class; + +/********************** + * GLOBAL PROTOTYPES + **********************/ +lv_obj_t * lv_tabview_create(lv_obj_t * parent, lv_dir_t tab_pos, lv_coord_t tab_size); + +lv_obj_t * lv_tabview_add_tab(lv_obj_t * tv, const char * name); + +void lv_tabview_rename_tab(lv_obj_t * obj, uint32_t tab_id, const char * new_name); + +lv_obj_t * lv_tabview_get_content(lv_obj_t * tv); + +lv_obj_t * lv_tabview_get_tab_btns(lv_obj_t * tv); + +void lv_tabview_set_act(lv_obj_t * obj, uint32_t id, lv_anim_enable_t anim_en); + +uint16_t lv_tabview_get_tab_act(lv_obj_t * tv); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_TABVIEW*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_TABVIEW_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/tileview/lv_tileview.c b/L3_Middlewares/LVGL/src/extra/widgets/tileview/lv_tileview.c similarity index 57% rename from L3_Middlewares/LVGL/src/widgets/tileview/lv_tileview.c rename to L3_Middlewares/LVGL/src/extra/widgets/tileview/lv_tileview.c index 8844a89..17fdb51 100644 --- a/L3_Middlewares/LVGL/src/widgets/tileview/lv_tileview.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/tileview/lv_tileview.c @@ -6,10 +6,8 @@ /********************* * INCLUDES *********************/ -#include "lv_tileview_private.h" -#include "../../core/lv_obj_class_private.h" -#include "../../indev/lv_indev.h" -#include "../../indev/lv_indev_private.h" +#include "lv_tileview.h" +#include "../../../core/lv_indev.h" #if LV_USE_TILEVIEW /********************* @@ -31,19 +29,19 @@ static void tileview_event_cb(lv_event_t * e); * STATIC VARIABLES **********************/ -const lv_obj_class_t lv_tileview_class = { - .constructor_cb = lv_tileview_constructor, - .base_class = &lv_obj_class, - .instance_size = sizeof(lv_tileview_t), - .name = "tileview", -}; +const lv_obj_class_t lv_tileview_class = {.constructor_cb = lv_tileview_constructor, + .base_class = &lv_obj_class, + .instance_size = sizeof(lv_tileview_t) + }; -const lv_obj_class_t lv_tileview_tile_class = { - .constructor_cb = lv_tileview_tile_constructor, - .base_class = &lv_obj_class, - .instance_size = sizeof(lv_tileview_tile_t), - .name = "tile", -}; +const lv_obj_class_t lv_tileview_tile_class = {.constructor_cb = lv_tileview_tile_constructor, + .base_class = &lv_obj_class, + .instance_size = sizeof(lv_tileview_tile_t) + }; + +static lv_dir_t create_dir; +static uint32_t create_col_id; +static uint32_t create_row_id; /********************** * MACROS @@ -68,24 +66,19 @@ lv_obj_t * lv_tileview_create(lv_obj_t * parent) lv_obj_t * lv_tileview_add_tile(lv_obj_t * tv, uint8_t col_id, uint8_t row_id, lv_dir_t dir) { LV_LOG_INFO("begin"); + create_dir = dir; + create_col_id = col_id; + create_row_id = row_id; lv_obj_t * obj = lv_obj_class_create_obj(&lv_tileview_tile_class, tv); lv_obj_class_init_obj(obj); - lv_obj_set_pos(obj, lv_pct(col_id * 100), lv_pct(row_id * 100)); - - lv_tileview_tile_t * tile = (lv_tileview_tile_t *)obj; - tile->dir = dir; - - if(col_id == 0 && row_id == 0) { - lv_obj_set_scroll_dir(tv, dir); - } return obj; } -void lv_tileview_set_tile(lv_obj_t * obj, lv_obj_t * tile_obj, lv_anim_enable_t anim_en) +void lv_obj_set_tile(lv_obj_t * obj, lv_obj_t * tile_obj, lv_anim_enable_t anim_en) { - int32_t tx = lv_obj_get_x(tile_obj); - int32_t ty = lv_obj_get_y(tile_obj); + lv_coord_t tx = lv_obj_get_x(tile_obj); + lv_coord_t ty = lv_obj_get_y(tile_obj); lv_tileview_tile_t * tile = (lv_tileview_tile_t *)tile_obj; lv_tileview_t * tv = (lv_tileview_t *) obj; @@ -95,23 +88,23 @@ void lv_tileview_set_tile(lv_obj_t * obj, lv_obj_t * tile_obj, lv_anim_enable_t lv_obj_scroll_to(obj, tx, ty, anim_en); } -void lv_tileview_set_tile_by_index(lv_obj_t * tv, uint32_t col_id, uint32_t row_id, lv_anim_enable_t anim_en) +void lv_obj_set_tile_id(lv_obj_t * tv, uint32_t col_id, uint32_t row_id, lv_anim_enable_t anim_en) { lv_obj_update_layout(tv); - int32_t w = lv_obj_get_content_width(tv); - int32_t h = lv_obj_get_content_height(tv); + lv_coord_t w = lv_obj_get_content_width(tv); + lv_coord_t h = lv_obj_get_content_height(tv); - int32_t tx = col_id * w; - int32_t ty = row_id * h; + lv_coord_t tx = col_id * w; + lv_coord_t ty = row_id * h; uint32_t i; - for(i = 0; i < lv_obj_get_child_count(tv); i++) { + for(i = 0; i < lv_obj_get_child_cnt(tv); i++) { lv_obj_t * tile_obj = lv_obj_get_child(tv, i); - int32_t x = lv_obj_get_x(tile_obj); - int32_t y = lv_obj_get_y(tile_obj); + lv_coord_t x = lv_obj_get_x(tile_obj); + lv_coord_t y = lv_obj_get_y(tile_obj); if(x == tx && y == ty) { - lv_tileview_set_tile(tv, tile_obj, anim_en); + lv_obj_set_tile(tv, tile_obj, anim_en); return; } } @@ -119,7 +112,7 @@ void lv_tileview_set_tile_by_index(lv_obj_t * tv, uint32_t col_id, uint32_t row_ LV_LOG_WARN("No tile found with at (%d,%d) index", (int)col_id, (int)row_id); } -lv_obj_t * lv_tileview_get_tile_active(lv_obj_t * obj) +lv_obj_t * lv_tileview_get_tile_act(lv_obj_t * obj) { lv_tileview_t * tv = (lv_tileview_t *) obj; return tv->tile_act; @@ -144,44 +137,54 @@ static void lv_tileview_tile_constructor(const lv_obj_class_t * class_p, lv_obj_ { LV_UNUSED(class_p); + lv_obj_t * parent = lv_obj_get_parent(obj); lv_obj_set_size(obj, LV_PCT(100), LV_PCT(100)); lv_obj_update_layout(obj); /*Be sure the size is correct*/ + lv_obj_set_pos(obj, create_col_id * lv_obj_get_content_width(parent), + create_row_id * lv_obj_get_content_height(parent)); + + lv_tileview_tile_t * tile = (lv_tileview_tile_t *)obj; + tile->dir = create_dir; + + if(create_col_id == 0 && create_row_id == 0) { + lv_obj_set_scroll_dir(parent, create_dir); + } } static void tileview_event_cb(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_tileview_t * tv = (lv_tileview_t *) obj; if(code == LV_EVENT_SCROLL_END) { - lv_indev_t * indev = lv_indev_active(); - if(indev && indev->state == LV_INDEV_STATE_PRESSED) { + lv_indev_t * indev = lv_indev_get_act(); + if(indev && indev->proc.state == LV_INDEV_STATE_PRESSED) { return; } - int32_t w = lv_obj_get_content_width(obj); - int32_t h = lv_obj_get_content_height(obj); + lv_coord_t w = lv_obj_get_content_width(obj); + lv_coord_t h = lv_obj_get_content_height(obj); lv_point_t scroll_end; lv_obj_get_scroll_end(obj, &scroll_end); - int32_t left = scroll_end.x; - int32_t top = scroll_end.y; + lv_coord_t left = scroll_end.x; + lv_coord_t top = scroll_end.y; - int32_t tx = ((left + (w / 2)) / w) * w; - int32_t ty = ((top + (h / 2)) / h) * h; + lv_coord_t tx = ((left + (w / 2)) / w) * w; + lv_coord_t ty = ((top + (h / 2)) / h) * h; lv_dir_t dir = LV_DIR_ALL; uint32_t i; - for(i = 0; i < lv_obj_get_child_count(obj); i++) { + for(i = 0; i < lv_obj_get_child_cnt(obj); i++) { lv_obj_t * tile_obj = lv_obj_get_child(obj, i); - int32_t x = lv_obj_get_x(tile_obj); - int32_t y = lv_obj_get_y(tile_obj); + lv_coord_t x = lv_obj_get_x(tile_obj); + lv_coord_t y = lv_obj_get_y(tile_obj); if(x == tx && y == ty) { lv_tileview_tile_t * tile = (lv_tileview_tile_t *)tile_obj; tv->tile_act = (lv_obj_t *)tile; dir = tile->dir; - lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); + lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); break; } } diff --git a/L3_Middlewares/LVGL/src/widgets/tileview/lv_tileview.h b/L3_Middlewares/LVGL/src/extra/widgets/tileview/lv_tileview.h similarity index 59% rename from L3_Middlewares/LVGL/src/widgets/tileview/lv_tileview.h rename to L3_Middlewares/LVGL/src/extra/widgets/tileview/lv_tileview.h index d373a26..7adeec3 100644 --- a/L3_Middlewares/LVGL/src/widgets/tileview/lv_tileview.h +++ b/L3_Middlewares/LVGL/src/extra/widgets/tileview/lv_tileview.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../core/lv_obj.h" +#include "../../../core/lv_obj.h" #if LV_USE_TILEVIEW @@ -21,8 +21,21 @@ extern "C" { * DEFINES *********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_tileview_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_tileview_tile_class; +/********************** + * TYPEDEFS + **********************/ +typedef struct { + lv_obj_t obj; + lv_obj_t * tile_act; +} lv_tileview_t; + +typedef struct { + lv_obj_t obj; + lv_dir_t dir; +} lv_tileview_tile_t; + +extern const lv_obj_class_t lv_tileview_class; +extern const lv_obj_class_t lv_tileview_tile_class; /********************** * GLOBAL PROTOTYPES @@ -37,10 +50,10 @@ lv_obj_t * lv_tileview_create(lv_obj_t * parent); lv_obj_t * lv_tileview_add_tile(lv_obj_t * tv, uint8_t col_id, uint8_t row_id, lv_dir_t dir); -void lv_tileview_set_tile(lv_obj_t * tv, lv_obj_t * tile_obj, lv_anim_enable_t anim_en); -void lv_tileview_set_tile_by_index(lv_obj_t * tv, uint32_t col_id, uint32_t row_id, lv_anim_enable_t anim_en); +void lv_obj_set_tile(lv_obj_t * tv, lv_obj_t * tile_obj, lv_anim_enable_t anim_en); +void lv_obj_set_tile_id(lv_obj_t * tv, uint32_t col_id, uint32_t row_id, lv_anim_enable_t anim_en); -lv_obj_t * lv_tileview_get_tile_active(lv_obj_t * obj); +lv_obj_t * lv_tileview_get_tile_act(lv_obj_t * obj); /*===================== * Other functions diff --git a/L3_Middlewares/LVGL/src/widgets/win/lv_win.c b/L3_Middlewares/LVGL/src/extra/widgets/win/lv_win.c similarity index 79% rename from L3_Middlewares/LVGL/src/widgets/win/lv_win.c rename to L3_Middlewares/LVGL/src/extra/widgets/win/lv_win.c index 508d2f0..92c3b8b 100644 --- a/L3_Middlewares/LVGL/src/widgets/win/lv_win.c +++ b/L3_Middlewares/LVGL/src/extra/widgets/win/lv_win.c @@ -6,11 +6,10 @@ /********************* * INCLUDES *********************/ -#include "lv_win_private.h" -#include "../../core/lv_obj_class_private.h" -#include "../../lvgl.h" +#include "lv_win.h" #if LV_USE_WIN + /********************* * DEFINES *********************/ @@ -32,9 +31,9 @@ const lv_obj_class_t lv_win_class = { .width_def = LV_PCT(100), .height_def = LV_PCT(100), .base_class = &lv_obj_class, - .instance_size = sizeof(lv_win_t), - .name = "win", + .instance_size = sizeof(lv_win_t) }; +static lv_coord_t create_header_height; /********************** * MACROS **********************/ @@ -43,9 +42,11 @@ const lv_obj_class_t lv_win_class = { * GLOBAL FUNCTIONS **********************/ -lv_obj_t * lv_win_create(lv_obj_t * parent) +lv_obj_t * lv_win_create(lv_obj_t * parent, lv_coord_t header_height) { LV_LOG_INFO("begin"); + create_header_height = header_height; + lv_obj_t * obj = lv_obj_class_create_obj(&lv_win_class, parent); lv_obj_class_init_obj(obj); return obj; @@ -61,17 +62,15 @@ lv_obj_t * lv_win_add_title(lv_obj_t * win, const char * txt) return title; } -lv_obj_t * lv_win_add_button(lv_obj_t * win, const void * icon, int32_t btn_w) +lv_obj_t * lv_win_add_btn(lv_obj_t * win, const void * icon, lv_coord_t btn_w) { lv_obj_t * header = lv_win_get_header(win); - lv_obj_t * btn = lv_button_create(header); + lv_obj_t * btn = lv_btn_create(header); lv_obj_set_size(btn, btn_w, LV_PCT(100)); - if(icon) { - lv_obj_t * img = lv_image_create(btn); - lv_image_set_src(img, icon); - lv_obj_align(img, LV_ALIGN_CENTER, 0, 0); - } + lv_obj_t * img = lv_img_create(btn); + lv_img_set_src(img, icon); + lv_obj_align(img, LV_ALIGN_CENTER, 0, 0); return btn; } @@ -98,7 +97,7 @@ static void lv_win_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); lv_obj_t * header = lv_obj_create(obj); - lv_obj_set_size(header, LV_PCT(100), lv_display_get_dpi(lv_obj_get_display(obj)) / 2); + lv_obj_set_size(header, LV_PCT(100), create_header_height); lv_obj_set_flex_flow(header, LV_FLEX_FLOW_ROW); lv_obj_set_flex_align(header, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); @@ -108,3 +107,4 @@ static void lv_win_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) } #endif + diff --git a/L3_Middlewares/LVGL/src/widgets/win/lv_win.h b/L3_Middlewares/LVGL/src/extra/widgets/win/lv_win.h similarity index 63% rename from L3_Middlewares/LVGL/src/widgets/win/lv_win.h rename to L3_Middlewares/LVGL/src/extra/widgets/win/lv_win.h index 8191bd1..4342b31 100644 --- a/L3_Middlewares/LVGL/src/widgets/win/lv_win.h +++ b/L3_Middlewares/LVGL/src/extra/widgets/win/lv_win.h @@ -13,30 +13,37 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" -#include "../../core/lv_obj.h" -#if LV_USE_WIN +#include "../../../lvgl.h" + /********************* * DEFINES *********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_win_class; +/********************** + * TYPEDEFS + **********************/ +typedef struct { + lv_obj_t obj; +} lv_win_t; + +extern const lv_obj_class_t lv_win_class; /********************** * GLOBAL PROTOTYPES **********************/ -lv_obj_t * lv_win_create(lv_obj_t * parent); +lv_obj_t * lv_win_create(lv_obj_t * parent, lv_coord_t header_height); + lv_obj_t * lv_win_add_title(lv_obj_t * win, const char * txt); -lv_obj_t * lv_win_add_button(lv_obj_t * win, const void * icon, int32_t btn_w); +lv_obj_t * lv_win_add_btn(lv_obj_t * win, const void * icon, lv_coord_t btn_w); lv_obj_t * lv_win_get_header(lv_obj_t * win); lv_obj_t * lv_win_get_content(lv_obj_t * win); /********************** * MACROS **********************/ -#endif /*LV_USE_WIN*/ + #ifdef __cplusplus } /*extern "C"*/ #endif diff --git a/L3_Middlewares/LVGL/src/font/korean.ttf b/L3_Middlewares/LVGL/src/font/korean.ttf new file mode 100644 index 0000000000000000000000000000000000000000..e0ec117ac6ff1e64332f1a9c378e48c760ae73a3 GIT binary patch literal 3371440 zcmeFa2YggjxBq=6L8OQf={Nre=;y{oli3ggdcDu(Iro3_NF8ABy?6}0;b3s8sNrl{hF6Uj& z?vti$f2sdDnr3)V&R(H$!HM4QEltr3 z>@y$HG`l{UVeFyUgwWti+;7??`hL<3^Jd2dXC}HlWcR7?w+O#ud~jU&)5Zl++N2GK zB;eZ;6H-zKy;HD7o3yn+v!A>yF*!UjruNXAA}{`G=cS9ibFwcem3TkKUb@)p^0n4g zn{x0xP1|yVM(zZ6Zo7MHQ199Q(&lv$f~E~_GH|2qe1DnC@vo0ZcIjrHAjfW+omIjr zW1nz5L2K!v$^B1Vy4mOmS${1Y2F3Y+!K@9?c4|FE64_pI`Jnc^W-oh#;TuDpCb_nI z-mX>XYuZ-B$J$gwcf&b$_Fcsezv?u*nSy8UgYu=mj*gm>=6L+WHXp>ddhyNn zOCqReYbP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ySE- zPySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE- zPySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE- zPySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE- zPySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE- zPySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE- zPySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE- zPySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE- zPySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE-PySE- zPySE-PySE-PySE-PySE-PySE-PySE-PySE-PyWY5{QvpifB%U#&}aVtn4n&K=Kqfg z+r?-8|CqpBeCGd;3BAQ<{{NWZT72gJj|rc}Xa4_~09kzI|6lxH{9pWE{9pWE{9pWE z{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE z{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE z{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE z{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE z{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE z{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE z{9pWE{9pWE{9pWE{9pWE{9pWE{9pWE{ErX*^Lfnw#s9_s#s9_s#s9_s#s9_s#s9_s z#s9_s#s9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7dk?TblKknx9yDQh$D7Uw?jX^%F~fem?qBef4Sm z|5N>!Qt8jnuYPC0t!4ft7nSLy7rj_p>?Nx&uV1Du_R96;s^!01{ST`zt}j}BDb`#4 zkE;JSw8g%(`c0L-wEDHxm)3t$-@m8Q=T<+n`ka>hrPY7?#8&@*(M$X5c=EjV;F!L9 z{r$`Inf2dTe^yiZEV_5F%p>cVV%eB}=5f>8*Jb+PI;J-*Q_4QF-ai%H87+V3`W@?! zFVm06UQGY>`Zt&9*Vi%qhs*R6>mObJO-&Dax^G{7?@_86-OfO^>L}-?#p8P48anJh_hP*!m_d zam%t?EP02f@1R$|e;w`ASi$s1S@Mymt#fxB)A98gO}DS#$5eV?SjTj1Y2gh|Zl_xK z#CC?ykN4=EPiwvO?p5p4%e1fORd@FMam`=1zIU14OYeSS{nz$QMRzZ{@FXVHrsP_jT*9)Au*8`$cx&x=fF(->>Nt>mOOB zN43O{pvfg7R_Le%uxuQ2_DIQvU=%G~FlZTno;v(Dvvsqb9d`SYv&)8}=R_VcS}-?IJd z=KSY$Z1D46!MBpXkXN*xsu!dGw9M*@Oxym`k&Qh5oqZZD^A+qoRn7b4t~+Xc{1lQe zVnuULTmQ4`>u0myY@eC6ua#fHc0QBq>6dyY?b0G0hsU(v`zVF%R~Nayzd{S1w(iH( zw!h{l%&XqK&hoVNE%wj-e$Ue5PgQdn9iRR)*3IqqRNqfk|M|go@4Cc_l-I?MPc`MqrQCtJ`u``3E>+EGLN2d^(o IU%3bVU)*)=ga7~l literal 0 HcmV?d00001 diff --git a/L3_Middlewares/LVGL/src/font/lv_binfont_loader.h b/L3_Middlewares/LVGL/src/font/lv_binfont_loader.h deleted file mode 100644 index 25e7b83..0000000 --- a/L3_Middlewares/LVGL/src/font/lv_binfont_loader.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @file lv_binfont_loader.h - * - */ - -#ifndef LV_BINFONT_LOADER_H -#define LV_BINFONT_LOADER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Loads a `lv_font_t` object from a binary font file - * @param path path to font file - * @return pointer to font where to load - */ -lv_font_t * lv_binfont_create(const char * path); - -#if LV_USE_FS_MEMFS -/** - * Loads a `lv_font_t` object from a memory buffer containing the binary font file. - * Requires LV_USE_FS_MEMFS - * @param buffer address of the font file in the memory - * @param size size of the font file buffer - * @return pointer to font where to load - */ -lv_font_t * lv_binfont_create_from_buffer(void * buffer, uint32_t size); -#endif - -/** - * Frees the memory allocated by the `lv_binfont_create()` function - * @param font lv_font_t object created by the lv_binfont_create function - */ -void lv_binfont_destroy(lv_font_t * font); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /* LV_BINFONT_LOADER_H */ diff --git a/L3_Middlewares/LVGL/src/font/lv_font.c b/L3_Middlewares/LVGL/src/font/lv_font.c index 35ae352..d4cc27e 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font.c +++ b/L3_Middlewares/LVGL/src/font/lv_font.c @@ -8,11 +8,9 @@ *********************/ #include "lv_font.h" -#include "../misc/lv_text_private.h" #include "../misc/lv_utils.h" #include "../misc/lv_log.h" #include "../misc/lv_assert.h" -#include "../stdlib/lv_string.h" /********************* * DEFINES @@ -42,22 +40,27 @@ * GLOBAL FUNCTIONS **********************/ -const void * lv_font_get_glyph_bitmap(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf) +/** + * Return with the bitmap of a font. + * @param font_p pointer to a font + * @param letter a UNICODE character code + * @return pointer to the bitmap of the letter + */ +const uint8_t * lv_font_get_glyph_bitmap(const lv_font_t * font_p, uint32_t letter) { - const lv_font_t * font_p = g_dsc->resolved_font; LV_ASSERT_NULL(font_p); - return font_p->get_glyph_bitmap(g_dsc, draw_buf); -} - -void lv_font_glyph_release_draw_data(lv_font_glyph_dsc_t * g_dsc) -{ - const lv_font_t * font = g_dsc->resolved_font; - - if(font != NULL && font->release_glyph) { - font->release_glyph(font, g_dsc); - } + return font_p->get_glyph_bitmap(font_p, letter); } +/** + * Get the descriptor of a glyph + * @param font_p pointer to font + * @param dsc_out store the result descriptor here + * @param letter a UNICODE letter code + * @param letter_next the next letter after `letter`. Used for kerning + * @return true: descriptor is successfully loaded into `dsc_out`. + * false: the letter was not found, no data is loaded to `dsc_out` + */ bool lv_font_get_glyph_dsc(const lv_font_t * font_p, lv_font_glyph_dsc_t * dsc_out, uint32_t letter, uint32_t letter_next) { @@ -74,7 +77,7 @@ bool lv_font_get_glyph_dsc(const lv_font_t * font_p, lv_font_glyph_dsc_t * dsc_o dsc_out->resolved_font = NULL; while(f) { - bool found = f->get_glyph_dsc(f, dsc_out, letter, f->kerning == LV_FONT_KERNING_NONE ? 0 : letter_next); + bool found = f->get_glyph_dsc(f, dsc_out, letter, letter_next); if(found) { if(!dsc_out->is_placeholder) { dsc_out->resolved_font = f; @@ -91,59 +94,53 @@ bool lv_font_get_glyph_dsc(const lv_font_t * font_p, lv_font_glyph_dsc_t * dsc_o #if LV_USE_FONT_PLACEHOLDER if(placeholder_font != NULL) { - placeholder_font->get_glyph_dsc(placeholder_font, dsc_out, letter, - placeholder_font->kerning == LV_FONT_KERNING_NONE ? 0 : letter_next); + placeholder_font->get_glyph_dsc(placeholder_font, dsc_out, letter, letter_next); dsc_out->resolved_font = placeholder_font; return true; } #endif + if(letter < 0x20 || + letter == 0xf8ff || /*LV_SYMBOL_DUMMY*/ + letter == 0x200c) { /*ZERO WIDTH NON-JOINER*/ + dsc_out->box_w = 0; + dsc_out->adv_w = 0; + } + else { #if LV_USE_FONT_PLACEHOLDER - dsc_out->box_w = font_p->line_height / 2; - dsc_out->adv_w = dsc_out->box_w + 2; + dsc_out->box_w = font_p->line_height / 2; + dsc_out->adv_w = dsc_out->box_w + 2; #else - dsc_out->box_w = 0; - dsc_out->adv_w = 0; + dsc_out->box_w = 0; + dsc_out->adv_w = 0; #endif + } dsc_out->resolved_font = NULL; dsc_out->box_h = font_p->line_height; dsc_out->ofs_x = 0; dsc_out->ofs_y = 0; - dsc_out->format = LV_FONT_GLYPH_FORMAT_A1; + dsc_out->bpp = 1; dsc_out->is_placeholder = true; return false; } +/** + * Get the width of a glyph with kerning + * @param font pointer to a font + * @param letter a UNICODE letter + * @param letter_next the next letter after `letter`. Used for kerning + * @return the width of the glyph + */ uint16_t lv_font_get_glyph_width(const lv_font_t * font, uint32_t letter, uint32_t letter_next) { LV_ASSERT_NULL(font); lv_font_glyph_dsc_t g; - - /*Return zero if letter is marker*/ - if(lv_text_is_marker(letter)) return 0; - lv_font_get_glyph_dsc(font, &g, letter, letter_next); return g.adv_w; } -void lv_font_set_kerning(lv_font_t * font, lv_font_kerning_t kerning) -{ - LV_ASSERT_NULL(font); - font->kerning = kerning; -} - -int32_t lv_font_get_line_height(const lv_font_t * font) -{ - return font->line_height; -} - -const lv_font_t * lv_font_default(void) -{ - return LV_FONT_DEFAULT; -} - /********************** * STATIC FUNCTIONS **********************/ diff --git a/L3_Middlewares/LVGL/src/font/lv_font.h b/L3_Middlewares/LVGL/src/font/lv_font.h index 2f172b9..e3b670c 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font.h +++ b/L3_Middlewares/LVGL/src/font/lv_font.h @@ -14,17 +14,20 @@ extern "C" { * INCLUDES *********************/ #include "../lv_conf_internal.h" -#include "../misc/lv_types.h" +#include +#include +#include #include "lv_symbol_def.h" -#include "../draw/lv_draw_buf.h" #include "../misc/lv_area.h" -#include "../misc/cache/lv_cache.h" /********************* * DEFINES *********************/ +/* imgfont identifier */ +#define LV_IMGFONT_BPP 9 + /********************** * TYPEDEFS **********************/ @@ -33,81 +36,52 @@ extern "C" { * General types *-----------------*/ -/** The font format.*/ -typedef enum { - LV_FONT_GLYPH_FORMAT_NONE = 0, /**< Maybe not visible*/ - - /**< Legacy simple formats*/ - LV_FONT_GLYPH_FORMAT_A1 = 0x01, /**< 1 bit per pixel*/ - LV_FONT_GLYPH_FORMAT_A2 = 0x02, /**< 2 bit per pixel*/ - LV_FONT_GLYPH_FORMAT_A4 = 0x04, /**< 4 bit per pixel*/ - LV_FONT_GLYPH_FORMAT_A8 = 0x08, /**< 8 bit per pixel*/ - - LV_FONT_GLYPH_FORMAT_IMAGE = 0x09, /**< Image format*/ - - /**< Advanced formats*/ - LV_FONT_GLYPH_FORMAT_VECTOR = 0x0A, /**< Vectorial format*/ - LV_FONT_GLYPH_FORMAT_SVG = 0x0B, /**< SVG format*/ - LV_FONT_GLYPH_FORMAT_CUSTOM = 0xFF, /**< Custom format*/ -} lv_font_glyph_format_t; - +struct _lv_font_t; /** Describes the properties of a glyph.*/ typedef struct { - const lv_font_t * - resolved_font; /**< Pointer to a font where the glyph was actually found after handling fallbacks*/ + const struct _lv_font_t * + resolved_font; /**< Pointer to a font where the glyph was actually found after handling fallbacks*/ uint16_t adv_w; /**< The glyph needs this space. Draw the next glyph after this width.*/ uint16_t box_w; /**< Width of the glyph's bounding box*/ uint16_t box_h; /**< Height of the glyph's bounding box*/ int16_t ofs_x; /**< x offset of the bounding box*/ int16_t ofs_y; /**< y offset of the bounding box*/ - lv_font_glyph_format_t format; /**< Font format of the glyph see lv_font_glyph_format_t */ - uint8_t is_placeholder: 1; /**< Glyph is missing. But placeholder will still be displayed*/ - - union { - uint32_t index; /**< Unicode code point*/ - const void * src; /**< Pointer to the source data used by image fonts*/ - } gid; /**< The index of the glyph in the font file. Used by the font cache*/ - lv_cache_entry_t * entry; /**< The cache entry of the glyph draw data. Used by the font cache*/ + uint8_t bpp: 4; /**< Bit-per-pixel: 1, 2, 4, 8*/ + uint8_t is_placeholder: 1; /** Glyph is missing. But placeholder will still be displayed */ } lv_font_glyph_dsc_t; /** The bitmaps might be upscaled by 3 to achieve subpixel rendering.*/ -typedef enum { +enum { LV_FONT_SUBPX_NONE, LV_FONT_SUBPX_HOR, LV_FONT_SUBPX_VER, LV_FONT_SUBPX_BOTH, -} lv_font_subpx_t; +}; -/** Adjust letter spacing for specific character pairs.*/ -typedef enum { - LV_FONT_KERNING_NORMAL, - LV_FONT_KERNING_NONE, -} lv_font_kerning_t; +typedef uint8_t lv_font_subpx_t; /** Describe the properties of a font*/ -struct lv_font_t { +typedef struct _lv_font_t { /** Get a glyph's descriptor from a font*/ - bool (*get_glyph_dsc)(const lv_font_t *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next); + bool (*get_glyph_dsc)(const struct _lv_font_t *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next); /** Get a glyph's bitmap from a font*/ - const void * (*get_glyph_bitmap)(lv_font_glyph_dsc_t *, lv_draw_buf_t *); - - /** Release a glyph*/ - void (*release_glyph)(const lv_font_t *, lv_font_glyph_dsc_t *); + const uint8_t * (*get_glyph_bitmap)(const struct _lv_font_t *, uint32_t); /*Pointer to the font in a font pack (must have the same line height)*/ - int32_t line_height; /**< The real line height where any text fits*/ - int32_t base_line; /**< Base line measured from the bottom of the line_height*/ - uint8_t subpx : 2; /**< An element of `lv_font_subpx_t`*/ - uint8_t kerning : 1; /**< An element of `lv_font_kerning_t`*/ + lv_coord_t line_height; /**< The real line height where any text fits*/ + lv_coord_t base_line; /**< Base line measured from the top of the line_height*/ + uint8_t subpx : 2; /**< An element of `lv_font_subpx_t`*/ int8_t underline_position; /**< Distance between the top of the underline and base line (< 0 means below the base line)*/ int8_t underline_thickness; /**< Thickness of the underline*/ const void * dsc; /**< Store implementation specific or run_time data or caching here*/ - const lv_font_t * fallback; /**< Fallback font for missing glyph. Resolved recursively */ + const struct _lv_font_t * fallback; /**< Fallback font for missing glyph. Resolved recursively */ +#if LV_USE_USER_DATA void * user_data; /**< Custom user data for font.*/ -}; +#endif +} lv_font_t; /********************** * GLOBAL PROTOTYPES @@ -115,60 +89,48 @@ struct lv_font_t { /** * Return with the bitmap of a font. - * @note You must call lv_font_get_glyph_dsc() to get `g_dsc` (lv_font_glyph_dsc_t) before you can call this function. - * @param g_dsc the glyph descriptor including which font to use, which supply the glyph_index and the format. - * @param draw_buf a draw buffer that can be used to store the bitmap of the glyph, it's OK not to use it. - * @return pointer to the glyph's data. It can be a draw buffer for bitmap fonts or an image source for imgfonts. + * @param font_p pointer to a font + * @param letter a UNICODE character code + * @return pointer to the bitmap of the letter */ -const void * lv_font_get_glyph_bitmap(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf); +const uint8_t * lv_font_get_glyph_bitmap(const lv_font_t * font_p, uint32_t letter); /** * Get the descriptor of a glyph - * @param font pointer to font - * @param dsc_out store the result descriptor here - * @param letter a UNICODE letter code - * @param letter_next the next letter after `letter`. Used for kerning + * @param font_p pointer to font + * @param dsc_out store the result descriptor here + * @param letter a UNICODE letter code + * @param letter_next the next letter after `letter`. Used for kerning * @return true: descriptor is successfully loaded into `dsc_out`. * false: the letter was not found, no data is loaded to `dsc_out` */ -bool lv_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t letter, +bool lv_font_get_glyph_dsc(const lv_font_t * font_p, lv_font_glyph_dsc_t * dsc_out, uint32_t letter, uint32_t letter_next); -/** - * Release the bitmap of a font. - * @note You must call lv_font_get_glyph_dsc() to get `g_dsc` (lv_font_glyph_dsc_t) before you can call this function. - * @param g_dsc the glyph descriptor including which font to use, which supply the glyph_index and the format. - */ -void lv_font_glyph_release_draw_data(lv_font_glyph_dsc_t * g_dsc); - /** * Get the width of a glyph with kerning - * @param font pointer to a font - * @param letter a UNICODE letter - * @param letter_next the next letter after `letter`. Used for kerning + * @param font pointer to a font + * @param letter a UNICODE letter + * @param letter_next the next letter after `letter`. Used for kerning * @return the width of the glyph */ uint16_t lv_font_get_glyph_width(const lv_font_t * font, uint32_t letter, uint32_t letter_next); /** * Get the line height of a font. All characters fit into this height - * @param font pointer to a font + * @param font_p pointer to a font * @return the height of a font */ -int32_t lv_font_get_line_height(const lv_font_t * font); - -/** - * Configure the use of kerning information stored in a font - * @param font pointer to a font - * @param kerning `LV_FONT_KERNING_NORMAL` (default) or `LV_FONT_KERNING_NONE` - */ -void lv_font_set_kerning(lv_font_t * font, lv_font_kerning_t kerning); +static inline lv_coord_t lv_font_get_line_height(const lv_font_t * font_p) +{ + return font_p->line_height; +} /********************** * MACROS **********************/ -#define LV_FONT_DECLARE(font_name) LV_ATTRIBUTE_EXTERN_DATA extern const lv_font_t font_name; +#define LV_FONT_DECLARE(font_name) extern const lv_font_t font_name; #if LV_FONT_MONTSERRAT_8 LV_FONT_DECLARE(lv_font_montserrat_8) @@ -254,6 +216,10 @@ LV_FONT_DECLARE(lv_font_montserrat_46) LV_FONT_DECLARE(lv_font_montserrat_48) #endif +#if LV_FONT_MONTSERRAT_12_SUBPX +LV_FONT_DECLARE(lv_font_montserrat_12_subpx) +#endif + #if LV_FONT_MONTSERRAT_28_COMPRESSED LV_FONT_DECLARE(lv_font_montserrat_28_compressed) #endif @@ -262,10 +228,6 @@ LV_FONT_DECLARE(lv_font_montserrat_28_compressed) LV_FONT_DECLARE(lv_font_dejavu_16_persian_hebrew) #endif -#if LV_FONT_SIMSUN_14_CJK -LV_FONT_DECLARE(lv_font_simsun_14_cjk) -#endif - #if LV_FONT_SIMSUN_16_CJK LV_FONT_DECLARE(lv_font_simsun_16_cjk) #endif @@ -287,7 +249,10 @@ LV_FONT_CUSTOM_DECLARE * Just a wrapper around LV_FONT_DEFAULT because it might be more convenient to use a function in some cases * @return pointer to LV_FONT_DEFAULT */ -const lv_font_t * lv_font_default(void); +static inline const lv_font_t * lv_font_default(void) +{ + return LV_FONT_DEFAULT; +} #ifdef __cplusplus } /*extern "C"*/ diff --git a/L3_Middlewares/LVGL/src/font/lv_font.mk b/L3_Middlewares/LVGL/src/font/lv_font.mk new file mode 100644 index 0000000..2201b73 --- /dev/null +++ b/L3_Middlewares/LVGL/src/font/lv_font.mk @@ -0,0 +1,36 @@ +CSRCS += lv_font.c +CSRCS += lv_font_fmt_txt.c +CSRCS += lv_font_loader.c + +CSRCS += lv_font_dejavu_16_persian_hebrew.c +CSRCS += lv_font_montserrat_8.c +CSRCS += lv_font_montserrat_10.c +CSRCS += lv_font_montserrat_12.c +CSRCS += lv_font_montserrat_12_subpx.c +CSRCS += lv_font_montserrat_14.c +CSRCS += lv_font_montserrat_16.c +CSRCS += lv_font_montserrat_18.c +CSRCS += lv_font_montserrat_20.c +CSRCS += lv_font_montserrat_22.c +CSRCS += lv_font_montserrat_24.c +CSRCS += lv_font_montserrat_26.c +CSRCS += lv_font_montserrat_28.c +CSRCS += lv_font_montserrat_28_compressed.c +CSRCS += lv_font_montserrat_30.c +CSRCS += lv_font_montserrat_32.c +CSRCS += lv_font_montserrat_34.c +CSRCS += lv_font_montserrat_36.c +CSRCS += lv_font_montserrat_38.c +CSRCS += lv_font_montserrat_40.c +CSRCS += lv_font_montserrat_42.c +CSRCS += lv_font_montserrat_44.c +CSRCS += lv_font_montserrat_46.c +CSRCS += lv_font_montserrat_48.c +CSRCS += lv_font_simsun_16_cjk.c +CSRCS += lv_font_unscii_8.c +CSRCS += lv_font_unscii_16.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/font +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/font + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/font" diff --git a/L3_Middlewares/LVGL/src/font/lv_font_dejavu_16_persian_hebrew.c b/L3_Middlewares/LVGL/src/font/lv_font_dejavu_16_persian_hebrew.c index 02a9573..fce6b0c 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_dejavu_16_persian_hebrew.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_dejavu_16_persian_hebrew.c @@ -5864,6 +5864,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -6555,13 +6556,15 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { } }; + + /*-------------------- * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -6575,15 +6578,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 0, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_dejavu_16_persian_hebrew = { #else lv_font_t lv_font_dejavu_16_persian_hebrew = { @@ -6602,4 +6608,7 @@ lv_font_t lv_font_dejavu_16_persian_hebrew = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_DEJAVU_16_PERSIAN_HEBREW*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_fmt_txt.c b/L3_Middlewares/LVGL/src/font/lv_font_fmt_txt.c index 5d01304..78beaff 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_fmt_txt.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_fmt_txt.c @@ -7,42 +7,41 @@ * INCLUDES *********************/ #include "lv_font.h" -#include "lv_font_fmt_txt_private.h" -#include "../core/lv_global.h" +#include "lv_font_fmt_txt.h" #include "../misc/lv_assert.h" #include "../misc/lv_types.h" +#include "../misc/lv_gc.h" #include "../misc/lv_log.h" #include "../misc/lv_utils.h" -#include "../stdlib/lv_mem.h" +#include "../misc/lv_mem.h" /********************* * DEFINES *********************/ -#if LV_USE_FONT_COMPRESSED - #define font_rle LV_GLOBAL_DEFAULT()->font_fmt_rle -#endif /*LV_USE_FONT_COMPRESSED*/ /********************** * TYPEDEFS **********************/ -typedef struct { - uint32_t gid_left; - uint32_t gid_right; -} kern_pair_ref_t; +typedef enum { + RLE_STATE_SINGLE = 0, + RLE_STATE_REPEATE, + RLE_STATE_COUNTER, +} rle_state_t; /********************** * STATIC PROTOTYPES **********************/ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter); static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t gid_right); -static int unicode_list_compare(const void * ref, const void * element); -static int kern_pair_8_compare(const void * ref, const void * element); -static int kern_pair_16_compare(const void * ref, const void * element); +static int32_t unicode_list_compare(const void * ref, const void * element); +static int32_t kern_pair_8_compare(const void * ref, const void * element); +static int32_t kern_pair_16_compare(const void * ref, const void * element); #if LV_USE_FONT_COMPRESSED - static void decompress(const uint8_t * in, uint8_t * out, int32_t w, int32_t h, uint8_t bpp, bool prefilter); - static inline void decompress_line(uint8_t * out, int32_t w); + static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter); + static inline void decompress_line(uint8_t * out, lv_coord_t w); static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len); + static inline void bits_write(uint8_t * out, uint32_t bit_pos, uint8_t val, uint8_t len); static inline void rle_init(const uint8_t * in, uint8_t bpp); static inline uint8_t rle_next(void); #endif /*LV_USE_FONT_COMPRESSED*/ @@ -50,18 +49,14 @@ static int kern_pair_16_compare(const void * ref, const void * element); /********************** * STATIC VARIABLES **********************/ - -static const uint8_t opa4_table[16] = {0, 17, 34, 51, - 68, 85, 102, 119, - 136, 153, 170, 187, - 204, 221, 238, 255 - }; - #if LV_USE_FONT_COMPRESSED -static const uint8_t opa3_table[8] = {0, 36, 73, 109, 146, 182, 218, 255}; -#endif - -static const uint8_t opa2_table[4] = {0, 85, 170, 255}; + static uint32_t rle_rdp; + static const uint8_t * rle_in; + static uint8_t rle_bpp; + static uint8_t rle_prev_v; + static uint8_t rle_cnt; + static rle_state_t rle_state; +#endif /*LV_USE_FONT_COMPRESSED*/ /********************** * GLOBAL PROTOTYPES @@ -75,86 +70,63 @@ static const uint8_t opa2_table[4] = {0, 85, 170, 255}; * GLOBAL FUNCTIONS **********************/ -const void * lv_font_get_bitmap_fmt_txt(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf) +/** + * Used as `get_glyph_bitmap` callback in LittelvGL's native font format if the font is uncompressed. + * @param font pointer to font + * @param unicode_letter a unicode letter which bitmap should be get + * @return pointer to the bitmap or NULL if not found + */ +const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unicode_letter) { - const lv_font_t * font = g_dsc->resolved_font; - uint8_t * bitmap_out = draw_buf->data; + if(unicode_letter == '\t') unicode_letter = ' '; lv_font_fmt_txt_dsc_t * fdsc = (lv_font_fmt_txt_dsc_t *)font->dsc; - uint32_t gid = g_dsc->gid.index; + uint32_t gid = get_glyph_dsc_id(font, unicode_letter); if(!gid) return NULL; const lv_font_fmt_txt_glyph_dsc_t * gdsc = &fdsc->glyph_dsc[gid]; - int32_t gsize = (int32_t) gdsc->box_w * gdsc->box_h; - if(gsize == 0) return NULL; - if(fdsc->bitmap_format == LV_FONT_FMT_TXT_PLAIN) { - const uint8_t * bitmap_in = &fdsc->glyph_bitmap[gdsc->bitmap_index]; - uint8_t * bitmap_out_tmp = bitmap_out; - int32_t i = 0; - int32_t x, y; - uint32_t stride = lv_draw_buf_width_to_stride(gdsc->box_w, LV_COLOR_FORMAT_A8); - - if(fdsc->bpp == 1) { - for(y = 0; y < gdsc->box_h; y ++) { - for(x = 0; x < gdsc->box_w; x++, i++) { - i = i & 0x7; - if(i == 0) bitmap_out_tmp[x] = (*bitmap_in) & 0x80 ? 0xff : 0x00; - else if(i == 1) bitmap_out_tmp[x] = (*bitmap_in) & 0x40 ? 0xff : 0x00; - else if(i == 2) bitmap_out_tmp[x] = (*bitmap_in) & 0x20 ? 0xff : 0x00; - else if(i == 3) bitmap_out_tmp[x] = (*bitmap_in) & 0x10 ? 0xff : 0x00; - else if(i == 4) bitmap_out_tmp[x] = (*bitmap_in) & 0x08 ? 0xff : 0x00; - else if(i == 5) bitmap_out_tmp[x] = (*bitmap_in) & 0x04 ? 0xff : 0x00; - else if(i == 6) bitmap_out_tmp[x] = (*bitmap_in) & 0x02 ? 0xff : 0x00; - else if(i == 7) { - bitmap_out_tmp[x] = (*bitmap_in) & 0x01 ? 0xff : 0x00; - bitmap_in++; - } - } - bitmap_out_tmp += stride; - } - } - else if(fdsc->bpp == 2) { - for(y = 0; y < gdsc->box_h; y ++) { - for(x = 0; x < gdsc->box_w; x++, i++) { - i = i & 0x3; - if(i == 0) bitmap_out_tmp[x] = opa2_table[(*bitmap_in) >> 6]; - else if(i == 1) bitmap_out_tmp[x] = opa2_table[((*bitmap_in) >> 4) & 0x3]; - else if(i == 2) bitmap_out_tmp[x] = opa2_table[((*bitmap_in) >> 2) & 0x3]; - else if(i == 3) { - bitmap_out_tmp[x] = opa2_table[((*bitmap_in) >> 0) & 0x3]; - bitmap_in++; - } - } - bitmap_out_tmp += stride; - } - - } - else if(fdsc->bpp == 4) { - for(y = 0; y < gdsc->box_h; y ++) { - for(x = 0; x < gdsc->box_w; x++, i++) { - i = i & 0x1; - if(i == 0) { - bitmap_out_tmp[x] = opa4_table[(*bitmap_in) >> 4]; - } - else if(i == 1) { - bitmap_out_tmp[x] = opa4_table[(*bitmap_in) & 0xF]; - bitmap_in++; - } - } - bitmap_out_tmp += stride; - } - } - return draw_buf; + return &fdsc->glyph_bitmap[gdsc->bitmap_index]; } /*Handle compressed bitmap*/ else { #if LV_USE_FONT_COMPRESSED - bool prefilter = fdsc->bitmap_format == LV_FONT_FMT_TXT_COMPRESSED; - decompress(&fdsc->glyph_bitmap[gdsc->bitmap_index], bitmap_out, gdsc->box_w, gdsc->box_h, + static size_t last_buf_size = 0; + if(LV_GC_ROOT(_lv_font_decompr_buf) == NULL) last_buf_size = 0; + + uint32_t gsize = gdsc->box_w * gdsc->box_h; + if(gsize == 0) return NULL; + + uint32_t buf_size = gsize; + /*Compute memory size needed to hold decompressed glyph, rounding up*/ + switch(fdsc->bpp) { + case 1: + buf_size = (gsize + 7) >> 3; + break; + case 2: + buf_size = (gsize + 3) >> 2; + break; + case 3: + buf_size = (gsize + 1) >> 1; + break; + case 4: + buf_size = (gsize + 1) >> 1; + break; + } + + if(last_buf_size < buf_size) { + uint8_t * tmp = lv_mem_realloc(LV_GC_ROOT(_lv_font_decompr_buf), buf_size); + LV_ASSERT_MALLOC(tmp); + if(tmp == NULL) return NULL; + LV_GC_ROOT(_lv_font_decompr_buf) = tmp; + last_buf_size = buf_size; + } + + bool prefilter = fdsc->bitmap_format == LV_FONT_FMT_TXT_COMPRESSED ? true : false; + decompress(&fdsc->glyph_bitmap[gdsc->bitmap_index], LV_GC_ROOT(_lv_font_decompr_buf), gdsc->box_w, gdsc->box_h, (uint8_t)fdsc->bpp, prefilter); - return draw_buf; + return LV_GC_ROOT(_lv_font_decompr_buf); #else /*!LV_USE_FONT_COMPRESSED*/ LV_LOG_WARN("Compressed fonts is used but LV_USE_FONT_COMPRESSED is not enabled in lv_conf.h"); return NULL; @@ -165,6 +137,14 @@ const void * lv_font_get_bitmap_fmt_txt(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf return NULL; } +/** + * Used as `get_glyph_dsc` callback in LittelvGL's native font format if the font is uncompressed. + * @param font_p pointer to font + * @param dsc_out store the result descriptor here + * @param letter a UNICODE letter code + * @return true: descriptor is successfully loaded into `dsc_out`. + * false: the letter was not found, no data is loaded to `dsc_out` + */ bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { @@ -201,15 +181,27 @@ bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out->box_w = gdsc->box_w; dsc_out->ofs_x = gdsc->ofs_x; dsc_out->ofs_y = gdsc->ofs_y; - dsc_out->format = (uint8_t)fdsc->bpp; + dsc_out->bpp = (uint8_t)fdsc->bpp; dsc_out->is_placeholder = false; - dsc_out->gid.index = gid; if(is_tab) dsc_out->box_w = dsc_out->box_w * 2; return true; } +/** + * Free the allocated memories. + */ +void _lv_font_clean_up_fmt_txt(void) +{ +#if LV_USE_FONT_COMPRESSED + if(LV_GC_ROOT(_lv_font_decompr_buf)) { + lv_mem_free(LV_GC_ROOT(_lv_font_decompr_buf)); + LV_GC_ROOT(_lv_font_decompr_buf) = NULL; + } +#endif +} + /********************** * STATIC FUNCTIONS **********************/ @@ -220,12 +212,15 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter) lv_font_fmt_txt_dsc_t * fdsc = (lv_font_fmt_txt_dsc_t *)font->dsc; + /*Check the cache first*/ + if(fdsc->cache && letter == fdsc->cache->last_letter) return fdsc->cache->last_glyph_id; + uint16_t i; for(i = 0; i < fdsc->cmap_num; i++) { /*Relative code point*/ uint32_t rcp = letter - fdsc->cmaps[i].range_start; - if(rcp >= fdsc->cmaps[i].range_length) continue; + if(rcp > fdsc->cmaps[i].range_length) continue; uint32_t glyph_id = 0; if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY) { glyph_id = fdsc->cmaps[i].glyph_id_start + rcp; @@ -236,18 +231,18 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter) } else if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_SPARSE_TINY) { uint16_t key = rcp; - uint16_t * p = lv_utils_bsearch(&key, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, - sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare); + uint16_t * p = _lv_utils_bsearch(&key, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, + sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare); if(p) { lv_uintptr_t ofs = p - fdsc->cmaps[i].unicode_list; - glyph_id = fdsc->cmaps[i].glyph_id_start + (uint32_t) ofs; + glyph_id = fdsc->cmaps[i].glyph_id_start + ofs; } } else if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_SPARSE_FULL) { uint16_t key = rcp; - uint16_t * p = lv_utils_bsearch(&key, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, - sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare); + uint16_t * p = _lv_utils_bsearch(&key, fdsc->cmaps[i].unicode_list, fdsc->cmaps[i].list_length, + sizeof(fdsc->cmaps[i].unicode_list[0]), unicode_list_compare); if(p) { lv_uintptr_t ofs = p - fdsc->cmaps[i].unicode_list; @@ -256,9 +251,18 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter) } } + /*Update the cache*/ + if(fdsc->cache) { + fdsc->cache->last_letter = letter; + fdsc->cache->last_glyph_id = glyph_id; + } return glyph_id; } + if(fdsc->cache) { + fdsc->cache->last_letter = letter; + fdsc->cache->last_glyph_id = 0; + } return 0; } @@ -276,8 +280,8 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t /*Use binary search to find the kern value. *The pairs are ordered left_id first, then right_id secondly.*/ const uint16_t * g_ids = kdsc->glyph_ids; - kern_pair_ref_t g_id_both = {gid_left, gid_right}; - uint16_t * kid_p = lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 2, kern_pair_8_compare); + uint16_t g_id_both = (gid_right << 8) + gid_left; /*Create one number from the ids*/ + uint16_t * kid_p = _lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 2, kern_pair_8_compare); /*If the `g_id_both` were found get its index from the pointer*/ if(kid_p) { @@ -289,8 +293,8 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t /*Use binary search to find the kern value. *The pairs are ordered left_id first, then right_id secondly.*/ const uint32_t * g_ids = kdsc->glyph_ids; - kern_pair_ref_t g_id_both = {gid_left, gid_right}; - uint32_t * kid_p = lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 4, kern_pair_16_compare); + uint32_t g_id_both = (gid_right << 16) + gid_left; /*Create one number from the ids*/ + uint32_t * kid_p = _lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 4, kern_pair_16_compare); /*If the `g_id_both` were found get its index from the pointer*/ if(kid_p) { @@ -319,28 +323,28 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t return value; } -static int kern_pair_8_compare(const void * ref, const void * element) +static int32_t kern_pair_8_compare(const void * ref, const void * element) { - const kern_pair_ref_t * ref8_p = ref; + const uint8_t * ref8_p = ref; const uint8_t * element8_p = element; /*If the MSB is different it will matter. If not return the diff. of the LSB*/ - if(ref8_p->gid_left != element8_p[0]) return ref8_p->gid_left - element8_p[0]; - else return ref8_p->gid_right - element8_p[1]; + if(ref8_p[0] != element8_p[0]) return (int32_t)ref8_p[0] - element8_p[0]; + else return (int32_t) ref8_p[1] - element8_p[1]; + } -static int kern_pair_16_compare(const void * ref, const void * element) +static int32_t kern_pair_16_compare(const void * ref, const void * element) { - const kern_pair_ref_t * ref16_p = ref; + const uint16_t * ref16_p = ref; const uint16_t * element16_p = element; /*If the MSB is different it will matter. If not return the diff. of the LSB*/ - if(ref16_p->gid_left != element16_p[0]) return ref16_p->gid_left - element16_p[0]; - else return ref16_p->gid_right - element16_p[1]; + if(ref16_p[0] != element16_p[0]) return (int32_t)ref16_p[0] - element16_p[0]; + else return (int32_t) ref16_p[1] - element16_p[1]; } #if LV_USE_FONT_COMPRESSED - /** * The compress a glyph's bitmap * @param in the compressed bitmap @@ -349,44 +353,31 @@ static int kern_pair_16_compare(const void * ref, const void * element) * @param bpp bit per pixel (bpp = 3 will be converted to bpp = 4) * @param prefilter true: the lines are XORed */ -static void decompress(const uint8_t * in, uint8_t * out, int32_t w, int32_t h, uint8_t bpp, bool prefilter) +static void decompress(const uint8_t * in, uint8_t * out, lv_coord_t w, lv_coord_t h, uint8_t bpp, bool prefilter) { - const lv_opa_t * opa_table; - switch(bpp) { - case 2: - opa_table = opa2_table; - break; - case 3: - opa_table = opa3_table; - break; - case 4: - opa_table = opa4_table; - break; - default: - LV_LOG_WARN("%d bpp is not handled", bpp); - return; - } + uint32_t wrp = 0; + uint8_t wr_size = bpp; + if(bpp == 3) wr_size = 4; rle_init(in, bpp); - uint8_t * line_buf1 = lv_malloc(w); + uint8_t * line_buf1 = lv_mem_buf_get(w); uint8_t * line_buf2 = NULL; if(prefilter) { - line_buf2 = lv_malloc(w); + line_buf2 = lv_mem_buf_get(w); } decompress_line(line_buf1, w); - int32_t y; - int32_t x; - uint32_t stride = lv_draw_buf_width_to_stride(w, LV_COLOR_FORMAT_A8); + lv_coord_t y; + lv_coord_t x; for(x = 0; x < w; x++) { - out[x] = opa_table[line_buf1[x]]; + bits_write(out, wrp, line_buf1[x], bpp); + wrp += wr_size; } - out += stride; for(y = 1; y < h; y++) { if(prefilter) { @@ -394,21 +385,22 @@ static void decompress(const uint8_t * in, uint8_t * out, int32_t w, int32_t h, for(x = 0; x < w; x++) { line_buf1[x] = line_buf2[x] ^ line_buf1[x]; - out[x] = opa_table[line_buf1[x]]; + bits_write(out, wrp, line_buf1[x], bpp); + wrp += wr_size; } } else { decompress_line(line_buf1, w); for(x = 0; x < w; x++) { - out[x] = opa_table[line_buf1[x]]; + bits_write(out, wrp, line_buf1[x], bpp); + wrp += wr_size; } } - out += stride; } - lv_free(line_buf1); - lv_free(line_buf2); + lv_mem_buf_release(line_buf1); + lv_mem_buf_release(line_buf2); } /** @@ -416,9 +408,9 @@ static void decompress(const uint8_t * in, uint8_t * out, int32_t w, int32_t h, * @param out output buffer * @param w width of the line in pixel count */ -static inline void decompress_line(uint8_t * out, int32_t w) +static inline void decompress_line(uint8_t * out, lv_coord_t w) { - int32_t i; + lv_coord_t i; for(i = 0; i < w; i++) { out[i] = rle_next(); } @@ -466,69 +458,116 @@ static inline uint8_t get_bits(const uint8_t * in, uint32_t bit_pos, uint8_t len } } +/** + * Write `val` data to `bit_pos` position of `out`. The write can NOT cross byte boundary. + * @param out buffer where to write + * @param bit_pos bit index to write + * @param val value to write + * @param len length of bits to write from `val`. (Counted from the LSB). + * @note `len == 3` will be converted to `len = 4` and `val` will be upscaled too + */ +static inline void bits_write(uint8_t * out, uint32_t bit_pos, uint8_t val, uint8_t len) +{ + if(len == 3) { + len = 4; + switch(val) { + case 0: + val = 0; + break; + case 1: + val = 2; + break; + case 2: + val = 4; + break; + case 3: + val = 6; + break; + case 4: + val = 9; + break; + case 5: + val = 11; + break; + case 6: + val = 13; + break; + case 7: + val = 15; + break; + } + } + + uint16_t byte_pos = bit_pos >> 3; + bit_pos = bit_pos & 0x7; + bit_pos = 8 - bit_pos - len; + + uint8_t bit_mask = (uint16_t)((uint16_t) 1 << len) - 1; + out[byte_pos] &= ((~bit_mask) << bit_pos); + out[byte_pos] |= (val << bit_pos); +} + static inline void rle_init(const uint8_t * in, uint8_t bpp) { - lv_font_fmt_rle_t * rle = &font_rle; - rle->in = in; - rle->bpp = bpp; - rle->state = RLE_STATE_SINGLE; - rle->rdp = 0; - rle->prev_v = 0; - rle->count = 0; + rle_in = in; + rle_bpp = bpp; + rle_state = RLE_STATE_SINGLE; + rle_rdp = 0; + rle_prev_v = 0; + rle_cnt = 0; } static inline uint8_t rle_next(void) { uint8_t v = 0; uint8_t ret = 0; - lv_font_fmt_rle_t * rle = &font_rle; - if(rle->state == RLE_STATE_SINGLE) { - ret = get_bits(rle->in, rle->rdp, rle->bpp); - if(rle->rdp != 0 && rle->prev_v == ret) { - rle->count = 0; - rle->state = RLE_STATE_REPEATED; + if(rle_state == RLE_STATE_SINGLE) { + ret = get_bits(rle_in, rle_rdp, rle_bpp); + if(rle_rdp != 0 && rle_prev_v == ret) { + rle_cnt = 0; + rle_state = RLE_STATE_REPEATE; } - rle->prev_v = ret; - rle->rdp += rle->bpp; + rle_prev_v = ret; + rle_rdp += rle_bpp; } - else if(rle->state == RLE_STATE_REPEATED) { - v = get_bits(rle->in, rle->rdp, 1); - rle->count++; - rle->rdp += 1; + else if(rle_state == RLE_STATE_REPEATE) { + v = get_bits(rle_in, rle_rdp, 1); + rle_cnt++; + rle_rdp += 1; if(v == 1) { - ret = rle->prev_v; - if(rle->count == 11) { - rle->count = get_bits(rle->in, rle->rdp, 6); - rle->rdp += 6; - if(rle->count != 0) { - rle->state = RLE_STATE_COUNTER; + ret = rle_prev_v; + if(rle_cnt == 11) { + rle_cnt = get_bits(rle_in, rle_rdp, 6); + rle_rdp += 6; + if(rle_cnt != 0) { + rle_state = RLE_STATE_COUNTER; } else { - ret = get_bits(rle->in, rle->rdp, rle->bpp); - rle->prev_v = ret; - rle->rdp += rle->bpp; - rle->state = RLE_STATE_SINGLE; + ret = get_bits(rle_in, rle_rdp, rle_bpp); + rle_prev_v = ret; + rle_rdp += rle_bpp; + rle_state = RLE_STATE_SINGLE; } } } else { - ret = get_bits(rle->in, rle->rdp, rle->bpp); - rle->prev_v = ret; - rle->rdp += rle->bpp; - rle->state = RLE_STATE_SINGLE; + ret = get_bits(rle_in, rle_rdp, rle_bpp); + rle_prev_v = ret; + rle_rdp += rle_bpp; + rle_state = RLE_STATE_SINGLE; } } - else if(rle->state == RLE_STATE_COUNTER) { - ret = rle->prev_v; - rle->count--; - if(rle->count == 0) { - ret = get_bits(rle->in, rle->rdp, rle->bpp); - rle->prev_v = ret; - rle->rdp += rle->bpp; - rle->state = RLE_STATE_SINGLE; + else if(rle_state == RLE_STATE_COUNTER) { + ret = rle_prev_v; + rle_cnt--; + if(rle_cnt == 0) { + ret = get_bits(rle_in, rle_rdp, rle_bpp); + rle_prev_v = ret; + rle_rdp += rle_bpp; + rle_state = RLE_STATE_SINGLE; } } @@ -549,7 +588,7 @@ static inline uint8_t rle_next(void) * @retval > 0 Reference is greater than element. * */ -static int unicode_list_compare(const void * ref, const void * element) +static int32_t unicode_list_compare(const void * ref, const void * element) { - return (*(uint16_t *)ref) - (*(uint16_t *)element); + return ((int32_t)(*(uint16_t *)ref)) - ((int32_t)(*(uint16_t *)element)); } diff --git a/L3_Middlewares/LVGL/src/font/lv_font_fmt_txt.h b/L3_Middlewares/LVGL/src/font/lv_font_fmt_txt.h index 4eeb0c6..86546a3 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_fmt_txt.h +++ b/L3_Middlewares/LVGL/src/font/lv_font_fmt_txt.h @@ -13,8 +13,10 @@ extern "C" { /********************* * INCLUDES *********************/ +#include +#include +#include #include "lv_font.h" -#include "../misc/lv_types.h" /********************* * DEFINES @@ -44,12 +46,14 @@ typedef struct { } lv_font_fmt_txt_glyph_dsc_t; /** Format of font character map.*/ -typedef enum { +enum { LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL, LV_FONT_FMT_TXT_CMAP_SPARSE_FULL, LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY, LV_FONT_FMT_TXT_CMAP_SPARSE_TINY, -} lv_font_fmt_txt_cmap_type_t; +}; + +typedef uint8_t lv_font_fmt_txt_cmap_type_t; /** * Map codepoints to a `glyph_dsc`s @@ -113,14 +117,14 @@ typedef struct { /*To get a kern value of two code points: 1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t 2. for(i = 0; i < pair_cnt * 2; i += 2) - if(glyph_ids[i] == glyph_id_left && - glyph_ids[i+1] == glyph_id_right) + if(gylph_ids[i] == glyph_id_left && + gylph_ids[i+1] == glyph_id_right) return values[i / 2]; */ const void * glyph_ids; const int8_t * values; uint32_t pair_cnt : 30; - uint32_t glyph_ids_size : 2; /**< 0: `glyph_ids` is stored as `uint8_t`; 1: as `uint16_t` */ + uint32_t glyph_ids_size : 2; /*0: `glyph_ids` is stored as `uint8_t`; 1: as `uint16_t`*/ } lv_font_fmt_txt_kern_pair_t; /** More complex but more optimal class based kern value storage*/ @@ -133,9 +137,9 @@ typedef struct { 3. value = class_pair_values[(left_class-1)*right_class_cnt + (right_class-1)] */ - const int8_t * class_pair_values; /**< left_class_cnt * right_class_cnt value */ - const uint8_t * left_class_mapping; /**< Map the glyph_ids to classes: index -> glyph_id -> class_id */ - const uint8_t * right_class_mapping; /**< Map the glyph_ids to classes: index -> glyph_id -> class_id */ + const int8_t * class_pair_values; /*left_class_cnt * right_class_cnt value*/ + const uint8_t * left_class_mapping; /*Map the glyph_ids to classes: index -> glyph_id -> class_id*/ + const uint8_t * right_class_mapping; /*Map the glyph_ids to classes: index -> glyph_id -> class_id*/ uint8_t left_class_cnt; uint8_t right_class_cnt; } lv_font_fmt_txt_kern_classes_t; @@ -147,16 +151,21 @@ typedef enum { LV_FONT_FMT_TXT_COMPRESSED_NO_PREFILTER = 1, } lv_font_fmt_txt_bitmap_format_t; -/** Describe store for additional data for fonts */ typedef struct { - /** The bitmaps of all glyphs */ + uint32_t last_letter; + uint32_t last_glyph_id; +} lv_font_fmt_txt_glyph_cache_t; + +/*Describe store additional data for fonts*/ +typedef struct { + /*The bitmaps of all glyphs*/ const uint8_t * glyph_bitmap; - /** Describe the glyphs */ + /*Describe the glyphs*/ const lv_font_fmt_txt_glyph_dsc_t * glyph_dsc; - /** Map the glyphs to Unicode characters. - *Array of `lv_font_cmap_fmt_txt_t` variables */ + /*Map the glyphs to Unicode characters. + *Array of `lv_font_cmap_fmt_txt_t` variables*/ const lv_font_fmt_txt_cmap_t * cmaps; /** @@ -166,23 +175,26 @@ typedef struct { */ const void * kern_dsc; - /** Scale kern values in 12.4 format */ + /*Scale kern values in 12.4 format*/ uint16_t kern_scale; - /** Number of cmap tables */ + /*Number of cmap tables*/ uint16_t cmap_num : 9; - /** Bit per pixel: 1, 2, 3, 4, 8 */ + /*Bit per pixel: 1, 2, 3, 4, 8*/ uint16_t bpp : 4; - /** Type of `kern_dsc` */ + /*Type of `kern_dsc`*/ uint16_t kern_classes : 1; - /** + /* * storage format of the bitmap * from `lv_font_fmt_txt_bitmap_format_t` */ uint16_t bitmap_format : 2; + + /*Cache the last letter and is glyph id*/ + lv_font_fmt_txt_glyph_cache_t * cache; } lv_font_fmt_txt_dsc_t; /********************** @@ -190,25 +202,29 @@ typedef struct { **********************/ /** - * Used as `get_glyph_bitmap` callback in lvgl's native font format if the font is uncompressed. - * @param g_dsc the glyph descriptor including which font to use, which supply the glyph_index and format. - * @param draw_buf a draw buffer that can be used to store the bitmap of the glyph, it's OK not to use it. - * @return pointer to an A8 bitmap (not necessarily bitmap_out) or NULL if `unicode_letter` not found + * Used as `get_glyph_bitmap` callback in LittelvGL's native font format if the font is uncompressed. + * @param font pointer to font + * @param unicode_letter a unicode letter which bitmap should be get + * @return pointer to the bitmap or NULL if not found */ -const void * lv_font_get_bitmap_fmt_txt(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf); +const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t letter); /** - * Used as `get_glyph_dsc` callback in lvgl's native font format if the font is uncompressed. - * @param font pointer to font + * Used as `get_glyph_dsc` callback in LittelvGL's native font format if the font is uncompressed. + * @param font_p pointer to font * @param dsc_out store the result descriptor here - * @param unicode_letter a UNICODE letter code - * @param unicode_letter_next the unicode letter succeeding the letter under test + * @param letter a UNICODE letter code * @return true: descriptor is successfully loaded into `dsc_out`. * false: the letter was not found, no data is loaded to `dsc_out` */ bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next); +/** + * Free the allocated memories. + */ +void _lv_font_clean_up_fmt_txt(void); + /********************** * MACROS **********************/ diff --git a/L3_Middlewares/LVGL/src/font/lv_font_fmt_txt_private.h b/L3_Middlewares/LVGL/src/font/lv_font_fmt_txt_private.h deleted file mode 100644 index 66df402..0000000 --- a/L3_Middlewares/LVGL/src/font/lv_font_fmt_txt_private.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file lv_font_fmt_txt_private.h - * - */ - -#ifndef LV_FONT_FMT_TXT_PRIVATE_H -#define LV_FONT_FMT_TXT_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_font_fmt_txt.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -#if LV_USE_FONT_COMPRESSED -typedef enum { - RLE_STATE_SINGLE = 0, - RLE_STATE_REPEATED, - RLE_STATE_COUNTER, -} lv_font_fmt_rle_state_t; - -typedef struct { - uint32_t rdp; - const uint8_t * in; - uint8_t bpp; - uint8_t prev_v; - uint8_t count; - lv_font_fmt_rle_state_t state; -} lv_font_fmt_rle_t; -#endif - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_FONT_FMT_TXT_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/font/lv_binfont_loader.c b/L3_Middlewares/LVGL/src/font/lv_font_loader.c similarity index 74% rename from L3_Middlewares/LVGL/src/font/lv_binfont_loader.c rename to L3_Middlewares/LVGL/src/font/lv_font_loader.c index 4746026..f7c061b 100644 --- a/L3_Middlewares/LVGL/src/font/lv_binfont_loader.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_loader.c @@ -1,17 +1,18 @@ /** - * @file lv_binfont_loader.c + * @file lv_font_loader.c * */ /********************* * INCLUDES *********************/ -#include "lv_font_fmt_txt_private.h" + +#include +#include + #include "../lvgl.h" -#include "../misc/lv_fs_private.h" -#include "../misc/lv_types.h" -#include "../stdlib/lv_string.h" -#include "lv_binfont_loader.h" +#include "../misc/lv_fs.h" +#include "lv_font_loader.h" /********************** * TYPEDEFS @@ -77,26 +78,31 @@ static unsigned int read_bits(bit_iterator_t * it, int n_bits, lv_fs_res_t * res * GLOBAL FUNCTIONS **********************/ -lv_font_t * lv_binfont_create(const char * path) +/** + * Loads a `lv_font_t` object from a binary font file + * @param font_name filename where the font file is located + * @return a pointer to the font or NULL in case of error + */ +lv_font_t * lv_font_load(const char * font_name) { - LV_ASSERT_NULL(path); - lv_fs_file_t file; - lv_fs_res_t fs_res = lv_fs_open(&file, path, LV_FS_MODE_RD); - if(fs_res != LV_FS_RES_OK) return NULL; - - lv_font_t * font = lv_malloc_zeroed(sizeof(lv_font_t)); - LV_ASSERT_MALLOC(font); - - if(!lvgl_load_font(&file, font)) { - LV_LOG_WARN("Error loading font file: %s", path); - /* - * When `lvgl_load_font` fails it can leak some pointers. - * All non-null pointers can be assumed as allocated and - * `lv_binfont_destroy` should free them correctly. - */ - lv_binfont_destroy(font); - font = NULL; + lv_fs_res_t res = lv_fs_open(&file, font_name, LV_FS_MODE_RD); + if(res != LV_FS_RES_OK) + return NULL; + + lv_font_t * font = lv_mem_alloc(sizeof(lv_font_t)); + if(font) { + memset(font, 0, sizeof(lv_font_t)); + if(!lvgl_load_font(&file, font)) { + LV_LOG_WARN("Error loading font file: %s\n", font_name); + /* + * When `lvgl_load_font` fails it can leak some pointers. + * All non-null pointers can be assumed as allocated and + * `lv_font_free` should free them correctly. + */ + lv_font_free(font); + font = NULL; + } } lv_fs_close(&file); @@ -104,54 +110,72 @@ lv_font_t * lv_binfont_create(const char * path) return font; } -#if LV_USE_FS_MEMFS -lv_font_t * lv_binfont_create_from_buffer(void * buffer, uint32_t size) +/** + * Frees the memory allocated by the `lv_font_load()` function + * @param font lv_font_t object created by the lv_font_load function + */ +void lv_font_free(lv_font_t * font) { - lv_fs_path_ex_t mempath; + if(NULL != font) { + lv_font_fmt_txt_dsc_t * dsc = (lv_font_fmt_txt_dsc_t *)font->dsc; - lv_fs_make_path_from_buffer(&mempath, LV_FS_MEMFS_LETTER, buffer, size); - return lv_binfont_create((const char *)&mempath); -} -#endif + if(NULL != dsc) { -void lv_binfont_destroy(lv_font_t * font) -{ - if(font == NULL) return; + if(dsc->kern_classes == 0) { + lv_font_fmt_txt_kern_pair_t * kern_dsc = + (lv_font_fmt_txt_kern_pair_t *)dsc->kern_dsc; - const lv_font_fmt_txt_dsc_t * dsc = font->dsc; - if(dsc == NULL) return; + if(NULL != kern_dsc) { + if(kern_dsc->glyph_ids) + lv_mem_free((void *)kern_dsc->glyph_ids); - if(dsc->kern_classes == 0) { - const lv_font_fmt_txt_kern_pair_t * kern_dsc = dsc->kern_dsc; - if(NULL != kern_dsc) { - lv_free((void *)kern_dsc->glyph_ids); - lv_free((void *)kern_dsc->values); - lv_free((void *)kern_dsc); - } - } - else { - const lv_font_fmt_txt_kern_classes_t * kern_dsc = dsc->kern_dsc; - if(NULL != kern_dsc) { - lv_free((void *)kern_dsc->class_pair_values); - lv_free((void *)kern_dsc->left_class_mapping); - lv_free((void *)kern_dsc->right_class_mapping); - lv_free((void *)kern_dsc); - } - } + if(kern_dsc->values) + lv_mem_free((void *)kern_dsc->values); - const lv_font_fmt_txt_cmap_t * cmaps = dsc->cmaps; - if(NULL != cmaps) { - for(int i = 0; i < dsc->cmap_num; ++i) { - lv_free((void *)cmaps[i].glyph_id_ofs_list); - lv_free((void *)cmaps[i].unicode_list); + lv_mem_free((void *)kern_dsc); + } + } + else { + lv_font_fmt_txt_kern_classes_t * kern_dsc = + (lv_font_fmt_txt_kern_classes_t *)dsc->kern_dsc; + + if(NULL != kern_dsc) { + if(kern_dsc->class_pair_values) + lv_mem_free((void *)kern_dsc->class_pair_values); + + if(kern_dsc->left_class_mapping) + lv_mem_free((void *)kern_dsc->left_class_mapping); + + if(kern_dsc->right_class_mapping) + lv_mem_free((void *)kern_dsc->right_class_mapping); + + lv_mem_free((void *)kern_dsc); + } + } + + lv_font_fmt_txt_cmap_t * cmaps = + (lv_font_fmt_txt_cmap_t *)dsc->cmaps; + + if(NULL != cmaps) { + for(int i = 0; i < dsc->cmap_num; ++i) { + if(NULL != cmaps[i].glyph_id_ofs_list) + lv_mem_free((void *)cmaps[i].glyph_id_ofs_list); + if(NULL != cmaps[i].unicode_list) + lv_mem_free((void *)cmaps[i].unicode_list); + } + lv_mem_free(cmaps); + } + + if(NULL != dsc->glyph_bitmap) { + lv_mem_free((void *)dsc->glyph_bitmap); + } + if(NULL != dsc->glyph_dsc) { + lv_mem_free((void *)dsc->glyph_dsc); + } + lv_mem_free(dsc); } - lv_free((void *)cmaps); + lv_mem_free(font); } - - lv_free((void *)dsc->glyph_bitmap); - lv_free((void *)dsc->glyph_dsc); - lv_free((void *)dsc); - lv_free(font); } /********************** @@ -207,7 +231,7 @@ static int read_label(lv_fs_file_t * fp, int start, const char * label) if(lv_fs_read(fp, &length, 4, NULL) != LV_FS_RES_OK || lv_fs_read(fp, buf, 4, NULL) != LV_FS_RES_OK - || lv_memcmp(label, buf, 4) != 0) { + || memcmp(label, buf, 4) != 0) { LV_LOG_WARN("Error reading '%s' label.", label); return -1; } @@ -237,8 +261,8 @@ static bool load_cmaps_tables(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_ds switch(cmap_table[i].format_type) { case LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL: { - uint8_t ids_size = (uint8_t)(sizeof(uint8_t) * cmap_table[i].data_entries_count); - uint8_t * glyph_id_ofs_list = lv_malloc(ids_size); + uint8_t ids_size = sizeof(uint8_t) * cmap_table[i].data_entries_count; + uint8_t * glyph_id_ofs_list = lv_mem_alloc(ids_size); cmap->glyph_id_ofs_list = glyph_id_ofs_list; @@ -254,7 +278,7 @@ static bool load_cmaps_tables(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_ds case LV_FONT_FMT_TXT_CMAP_SPARSE_FULL: case LV_FONT_FMT_TXT_CMAP_SPARSE_TINY: { uint32_t list_size = sizeof(uint16_t) * cmap_table[i].data_entries_count; - uint16_t * unicode_list = (uint16_t *)lv_malloc(list_size); + uint16_t * unicode_list = (uint16_t *)lv_mem_alloc(list_size); cmap->unicode_list = unicode_list; cmap->list_length = cmap_table[i].data_entries_count; @@ -264,7 +288,7 @@ static bool load_cmaps_tables(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_ds } if(cmap_table[i].format_type == LV_FONT_FMT_TXT_CMAP_SPARSE_FULL) { - uint16_t * buf = lv_malloc(sizeof(uint16_t) * cmap->list_length); + uint16_t * buf = lv_mem_alloc(sizeof(uint16_t) * cmap->list_length); cmap->glyph_id_ofs_list = buf; @@ -295,18 +319,18 @@ static int32_t load_cmaps(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, u } lv_font_fmt_txt_cmap_t * cmaps = - lv_malloc(cmaps_subtables_count * sizeof(lv_font_fmt_txt_cmap_t)); + lv_mem_alloc(cmaps_subtables_count * sizeof(lv_font_fmt_txt_cmap_t)); - lv_memset(cmaps, 0, cmaps_subtables_count * sizeof(lv_font_fmt_txt_cmap_t)); + memset(cmaps, 0, cmaps_subtables_count * sizeof(lv_font_fmt_txt_cmap_t)); font_dsc->cmaps = cmaps; font_dsc->cmap_num = cmaps_subtables_count; - cmap_table_bin_t * cmaps_tables = lv_malloc(sizeof(cmap_table_bin_t) * font_dsc->cmap_num); + cmap_table_bin_t * cmaps_tables = lv_mem_alloc(sizeof(cmap_table_bin_t) * font_dsc->cmap_num); bool success = load_cmaps_tables(fp, font_dsc, cmaps_start, cmaps_tables); - lv_free(cmaps_tables); + lv_mem_free(cmaps_tables); return success ? cmaps_length : -1; } @@ -320,9 +344,9 @@ static int32_t load_glyph(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, } lv_font_fmt_txt_glyph_dsc_t * glyph_dsc = (lv_font_fmt_txt_glyph_dsc_t *) - lv_malloc(loca_count * sizeof(lv_font_fmt_txt_glyph_dsc_t)); + lv_mem_alloc(loca_count * sizeof(lv_font_fmt_txt_glyph_dsc_t)); - lv_memset(glyph_dsc, 0, loca_count * sizeof(lv_font_fmt_txt_glyph_dsc_t)); + memset(glyph_dsc, 0, loca_count * sizeof(lv_font_fmt_txt_glyph_dsc_t)); font_dsc->glyph_dsc = glyph_dsc; @@ -390,7 +414,7 @@ static int32_t load_glyph(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, } } - uint8_t * glyph_bmp = (uint8_t *)lv_malloc(sizeof(uint8_t) * cur_bmp_size); + uint8_t * glyph_bmp = (uint8_t *)lv_mem_alloc(sizeof(uint8_t) * cur_bmp_size); font_dsc->glyph_bitmap = glyph_bmp; @@ -451,17 +475,17 @@ static int32_t load_glyph(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, * the pointer should be set on the `lv_font_t` data before any possible return. * * When something fails, it returns `false` and the memory on the `lv_font_t` - * still needs to be freed using `lv_binfont_destroy`. + * still needs to be freed using `lv_font_free`. * - * `lv_binfont_destroy` will assume that all non-null pointers are allocated and + * `lv_font_free` will assume that all non-null pointers are allocated and * should be freed. */ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font) { lv_font_fmt_txt_dsc_t * font_dsc = (lv_font_fmt_txt_dsc_t *) - lv_malloc(sizeof(lv_font_fmt_txt_dsc_t)); + lv_mem_alloc(sizeof(lv_font_fmt_txt_dsc_t)); - lv_memset(font_dsc, 0, sizeof(lv_font_fmt_txt_dsc_t)); + memset(font_dsc, 0, sizeof(lv_font_fmt_txt_dsc_t)); font->dsc = font_dsc; @@ -481,8 +505,8 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font) font->get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt; font->get_glyph_bitmap = lv_font_get_bitmap_fmt_txt; font->subpx = font_header.subpixels_mode; - font->underline_position = (int8_t) font_header.underline_position; - font->underline_thickness = (int8_t) font_header.underline_thickness; + font->underline_position = font_header.underline_position; + font->underline_thickness = font_header.underline_thickness; font_dsc->bpp = font_header.bits_per_pixel; font_dsc->kern_scale = font_header.kerning_scale; @@ -508,7 +532,7 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font) } bool failed = false; - uint32_t * glyph_offset = lv_malloc(sizeof(uint32_t) * (loca_count + 1)); + uint32_t * glyph_offset = lv_mem_alloc(sizeof(uint32_t) * (loca_count + 1)); if(font_header.index_to_loc_format == 0) { for(unsigned int i = 0; i < loca_count; ++i) { @@ -531,7 +555,7 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font) } if(failed) { - lv_free(glyph_offset); + lv_mem_free(glyph_offset); return false; } @@ -540,13 +564,12 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font) int32_t glyph_length = load_glyph( fp, font_dsc, glyph_start, glyph_offset, loca_count, &font_header); - lv_free(glyph_offset); + lv_mem_free(glyph_offset); if(glyph_length < 0) { return false; } - /*kerning*/ if(font_header.tables_count < 4) { font_dsc->kern_dsc = NULL; font_dsc->kern_classes = 0; @@ -576,9 +599,9 @@ int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t f } if(0 == kern_format_type) { /*sorted pairs*/ - lv_font_fmt_txt_kern_pair_t * kern_pair = lv_malloc(sizeof(lv_font_fmt_txt_kern_pair_t)); + lv_font_fmt_txt_kern_pair_t * kern_pair = lv_mem_alloc(sizeof(lv_font_fmt_txt_kern_pair_t)); - lv_memset(kern_pair, 0, sizeof(lv_font_fmt_txt_kern_pair_t)); + memset(kern_pair, 0, sizeof(lv_font_fmt_txt_kern_pair_t)); font_dsc->kern_dsc = kern_pair; font_dsc->kern_classes = 0; @@ -596,8 +619,8 @@ int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t f ids_size = sizeof(int16_t) * 2 * glyph_entries; } - uint8_t * glyph_ids = lv_malloc(ids_size); - int8_t * values = lv_malloc(glyph_entries); + uint8_t * glyph_ids = lv_mem_alloc(ids_size); + int8_t * values = lv_mem_alloc(glyph_entries); kern_pair->glyph_ids_size = format; kern_pair->pair_cnt = glyph_entries; @@ -614,9 +637,9 @@ int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t f } else if(3 == kern_format_type) { /*array M*N of classes*/ - lv_font_fmt_txt_kern_classes_t * kern_classes = lv_malloc(sizeof(lv_font_fmt_txt_kern_classes_t)); + lv_font_fmt_txt_kern_classes_t * kern_classes = lv_mem_alloc(sizeof(lv_font_fmt_txt_kern_classes_t)); - lv_memset(kern_classes, 0, sizeof(lv_font_fmt_txt_kern_classes_t)); + memset(kern_classes, 0, sizeof(lv_font_fmt_txt_kern_classes_t)); font_dsc->kern_dsc = kern_classes; font_dsc->kern_classes = 1; @@ -633,9 +656,9 @@ int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t f int kern_values_length = sizeof(int8_t) * kern_table_rows * kern_table_cols; - uint8_t * kern_left = lv_malloc(kern_class_mapping_length); - uint8_t * kern_right = lv_malloc(kern_class_mapping_length); - int8_t * kern_values = lv_malloc(kern_values_length); + uint8_t * kern_left = lv_mem_alloc(kern_class_mapping_length); + uint8_t * kern_right = lv_mem_alloc(kern_class_mapping_length); + int8_t * kern_values = lv_mem_alloc(kern_values_length); kern_classes->left_class_mapping = kern_left; kern_classes->right_class_mapping = kern_right; diff --git a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_cache.h b/L3_Middlewares/LVGL/src/font/lv_font_loader.h similarity index 69% rename from L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_cache.h rename to L3_Middlewares/LVGL/src/font/lv_font_loader.h index 74be6d3..783cb2e 100644 --- a/L3_Middlewares/LVGL/src/drivers/nuttx/lv_nuttx_cache.h +++ b/L3_Middlewares/LVGL/src/font/lv_font_loader.h @@ -1,10 +1,10 @@ /** - * @file lv_nuttx_cache.h + * @file lv_font_loader.h * */ -#ifndef LV_NUTTX_CACHE_H -#define LV_NUTTX_CACHE_H +#ifndef LV_FONT_LOADER_H +#define LV_FONT_LOADER_H #ifdef __cplusplus extern "C" { @@ -26,9 +26,8 @@ extern "C" { * GLOBAL PROTOTYPES **********************/ -void lv_nuttx_cache_init(void); - -void lv_nuttx_cache_deinit(void); +lv_font_t * lv_font_load(const char * fontName); +void lv_font_free(lv_font_t * font); /********************** * MACROS @@ -38,4 +37,4 @@ void lv_nuttx_cache_deinit(void); } /*extern "C"*/ #endif -#endif /*LV_NUTTX_CACHE_H*/ +#endif /*LV_FONT_LOADER_H*/ diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_10.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_10.c index 80fe261..485d9f6 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_10.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_10.c @@ -973,6 +973,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -1169,6 +1170,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -1595,6 +1597,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -1608,9 +1611,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -1624,15 +1627,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_10 = { #else lv_font_t lv_font_montserrat_10 = { @@ -1651,4 +1657,7 @@ lv_font_t lv_font_montserrat_10 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_10*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_12.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_12.c index 6e5c1ea..e84d00c 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_12.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_12.c @@ -1234,6 +1234,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -1430,6 +1431,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -1856,6 +1858,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -1869,9 +1872,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -1885,15 +1888,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_12 = { #else lv_font_t lv_font_montserrat_12 = { @@ -1912,4 +1918,7 @@ lv_font_t lv_font_montserrat_12 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_12*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_12_subpx.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_12_subpx.c new file mode 100644 index 0000000..1ffd7ed --- /dev/null +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_12_subpx.c @@ -0,0 +1,3865 @@ +/******************************************************************************* + * Size: 12 px + * Bpp: 4 + * Opts: --lcd --no-compress --no-prefilter --bpp 4 --size 12 --font Montserrat-Medium.ttf -r 0x20-0x7F,0xB0,0x2022 --font FontAwesome5-Solid+Brands+Regular.woff -r 61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61507,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61641,61664,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650 --format lvgl -o lv_font_montserrat_12_subpx.c --force-fast-kern-format + ******************************************************************************/ + +#ifdef LV_LVGL_H_INCLUDE_SIMPLE + #include "lvgl.h" +#else + #include "../../lvgl.h" +#endif + +#ifndef LV_FONT_MONTSERRAT_12_SUBPX + #define LV_FONT_MONTSERRAT_12_SUBPX 1 +#endif + +#if LV_FONT_MONTSERRAT_12_SUBPX + +/*----------------- + * BITMAPS + *----------------*/ + +/*Store the image of the glyphs*/ +static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { + /* U+0020 " " */ + + /* U+0021 "!" */ + 0x0, 0x6b, 0xff, 0x94, 0x0, 0x5, 0xaf, 0xe9, + 0x30, 0x0, 0x4a, 0xfd, 0x83, 0x0, 0x4, 0x9f, + 0xd7, 0x20, 0x0, 0x39, 0xec, 0x72, 0x0, 0x3, + 0x8d, 0xc6, 0x10, 0x0, 0x2, 0x33, 0x10, 0x0, + 0x2, 0x68, 0x84, 0x10, 0x1, 0x5a, 0xed, 0x83, + 0x0, + + /* U+0022 "\"" */ + 0x3, 0x9e, 0xc6, 0x11, 0x6b, 0xe9, 0x40, 0x0, + 0x38, 0xeb, 0x60, 0x6, 0xbe, 0x93, 0x0, 0x3, + 0x8d, 0xb6, 0x0, 0x5b, 0xe8, 0x30, 0x0, 0x14, + 0x75, 0x30, 0x2, 0x57, 0x41, 0x0, + + /* U+0023 "#" */ + 0x0, 0x0, 0x0, 0x4, 0xad, 0x83, 0x0, 0x0, + 0x38, 0xda, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x6c, 0xb6, 0x10, 0x0, 0x5, 0xad, 0x83, + 0x0, 0x0, 0x0, 0x4, 0x9e, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x61, + 0x0, 0x0, 0x0, 0x5, 0xad, 0x82, 0x0, 0x0, + 0x38, 0xd9, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x6c, 0xc6, 0x10, 0x0, 0x5, 0xad, 0x83, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x28, 0xda, + 0x50, 0x0, 0x1, 0x6b, 0xc7, 0x10, 0x0, 0x0, + 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xb6, 0x0, 0x0, 0x0, + 0x1, 0x6c, 0xc6, 0x10, 0x0, 0x4, 0xad, 0x83, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x38, 0xda, + 0x40, 0x0, 0x1, 0x6c, 0xc6, 0x10, 0x0, 0x0, + 0x0, 0x0, + + /* U+0024 "$" */ + 0x0, 0x0, 0x0, 0x0, 0x4, 0x9c, 0x82, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x4, 0x9c, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x1, 0x37, 0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25, 0x9b, 0xcc, + 0xba, 0x63, 0x26, 0xbc, 0x83, 0x25, 0x9b, 0xcc, + 0xb9, 0x62, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x15, 0xbc, 0x83, 0x15, 0xbc, 0x72, 0x0, 0x16, + 0xbb, 0x72, 0x0, 0x0, 0x0, 0x0, 0x15, 0xac, + 0x94, 0x0, 0x38, 0xc9, 0x30, 0x0, 0x2, 0x7c, + 0xa4, 0x0, 0x0, 0x0, 0x14, 0xac, 0x94, 0x0, + 0x0, 0x16, 0xbb, 0x61, 0x0, 0x4, 0x9c, 0x72, + 0x0, 0x0, 0x4, 0x9c, 0xa4, 0x10, 0x0, 0x0, + 0x0, 0x37, 0xab, 0xba, 0xbb, 0x84, 0x10, + + /* U+0026 "&" */ + 0x0, 0x0, 0x2, 0x59, 0xce, 0xee, 0xed, 0xc9, + 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, + 0xaf, 0xc8, 0x20, 0x0, 0x38, 0xdd, 0x82, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x4a, 0xfc, 0x72, + 0x0, 0x15, 0xae, 0xc6, 0x10, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x37, 0xce, 0xdb, 0xcd, 0xda, + 0x62, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x37, 0xbd, 0xdd, 0xef, 0xc8, 0x30, 0x0, 0x1, + 0x12, 0x0, 0x0, 0x0, 0x16, 0xce, 0xc7, 0x30, + 0x1, 0x5a, 0xde, 0xb7, 0x23, 0x8d, 0xd8, 0x30, + 0x0, 0x16, 0xbf, 0xb6, 0x0, 0x0, 0x0, 0x1, + 0x5a, 0xde, 0xff, 0xd7, 0x20, 0x0, 0x0, 0x49, + 0xef, 0xc8, 0x42, 0x11, 0x12, 0x36, 0x9c, 0xef, + 0xfe, 0xb6, 0x20, 0x0, 0x0, 0x3, 0x69, 0xcd, + 0xef, 0xff, 0xed, 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 0x0, 0x5a, 0xfc, 0x71, 0x0, 0x0, + 0x16, 0xbe, 0xb5, 0x10, 0x0, 0x0, + + /* U+002A "*" */ + 0x0, 0x0, 0x0, 0x0, 0x4a, 0xb6, 0x10, 0x0, + 0x0, 0x0, 0x3, 0x8c, 0xc9, 0x9c, 0xca, 0x9b, + 0xca, 0x51, 0x0, 0x0, 0x2, 0x6b, 0xef, 0xff, + 0xd8, 0x30, 0x0, 0x0, 0x3, 0x8b, 0xa7, 0x8b, + 0xc9, 0x79, 0xba, 0x51, 0x0, 0x0, 0x0, 0x0, + 0x38, 0xa6, 0x10, 0x0, 0x0, + + /* U+002B "+" */ + 0x0, 0x0, 0x0, 0x0, 0x37, 0xb7, 0x30, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xbf, + 0xa5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x5b, 0xfa, 0x50, 0x0, 0x0, 0x0, 0x0, + 0x27, 0xce, 0xee, 0xef, 0xff, 0xff, 0xee, 0xee, + 0xc7, 0x20, 0x0, 0x1, 0x11, 0x11, 0x6b, 0xfb, + 0x61, 0x11, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x5, 0xbf, 0xa5, 0x0, 0x0, 0x0, 0x0, + + /* U+002C "," */ + 0x1, 0x48, 0x85, 0x20, 0x0, 0x4a, 0xff, 0xc6, + 0x10, 0x0, 0x5b, 0xd8, 0x20, 0x0, 0x39, 0xc8, + 0x30, 0x0, + + /* U+002D "-" */ + 0x4, 0x9f, 0xff, 0xff, 0xff, 0xd8, 0x30, 0x0, + 0x1, 0x22, 0x22, 0x22, 0x22, 0x10, 0x0, + + /* U+002E "." */ + 0x2, 0x6a, 0xa7, 0x30, 0x0, 0x49, 0xdd, 0x94, + 0x0, + + /* U+002F "/" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x13, 0x67, + 0x42, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0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be, 0xea, 0x41, + 0x0, 0x0, 0x2, 0x8d, 0xf9, 0x40, 0x0, 0x0, + 0x0, 0x38, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xd8, 0x30, 0x0, 0x12, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x25, 0x9e, 0xfa, + 0x62, 0x22, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x38, 0xef, 0x94, 0x0, 0x0, + 0x0, 0x0, + + /* U+0035 "5" */ + 0x0, 0x0, 0x1, 0x7c, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xa5, 0x0, 0x0, 0x0, 0x3, 0x9e, + 0xe9, 0x52, 0x22, 0x22, 0x22, 0x22, 0x10, 0x0, + 0x0, 0x0, 0x5, 0xaf, 0xc6, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x17, 0xcf, + 0xff, 0xff, 0xee, 0xdd, 0xb9, 0x63, 0x10, 0x0, + 0x0, 0x0, 0x1, 0x22, 0x22, 0x22, 0x33, 0x46, + 0x9c, 0xff, 0xb6, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x2, 0x8d, 0xfb, 0x60, + 0x0, 0x0, 0x1, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x2, 0x8d, 0xfb, 0x61, 0x0, 0x4, 0x9e, 0xeb, + 0x86, 0x43, 0x33, 0x45, 0x8c, 0xef, 0xb6, 0x10, + 0x0, 0x0, 0x24, 0x8a, 0xcd, 0xef, 0xff, 0xfe, + 0xca, 0x74, 0x10, 0x0, + + /* U+0036 "6" */ + 0x0, 0x0, 0x1, 0x36, 0x9b, 0xde, 0xff, 0xfe, + 0xdc, 0x95, 0x10, 0x0, 0x0, 0x3, 0x8d, 0xfd, + 0xa7, 0x53, 0x32, 0x22, 0x34, 0x32, 0x0, 0x0, + 0x1, 0x6b, 0x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+ + /* U+0038 "8" */ + 0x0, 0x0, 0x36, 0x9c, 0xde, 0xff, 0xfe, 0xdc, + 0xa7, 0x31, 0x0, 0x0, 0x0, 0x49, 0xef, 0xc8, + 0x53, 0x11, 0x12, 0x48, 0xcf, 0xea, 0x50, 0x0, + 0x2, 0x7d, 0xfb, 0x61, 0x0, 0x0, 0x0, 0x0, + 0x5a, 0xfd, 0x83, 0x0, 0x0, 0x39, 0xef, 0xb7, + 0x31, 0x0, 0x1, 0x37, 0xbe, 0xe9, 0x40, 0x0, + 0x0, 0x2, 0x6b, 0xef, 0xff, 0xff, 0xff, 0xff, + 0xfb, 0x62, 0x0, 0x0, 0x3, 0x8d, 0xfd, 0x95, + 0x21, 0x0, 0x1, 0x24, 0x8c, 0xfe, 0x94, 0x0, + 0x16, 0xcf, 0xc7, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x6, 0xbf, 0xd7, 0x20, 0x3, 0x8d, 0xfd, 0xa6, + 0x32, 0x11, 0x12, 0x35, 0x9c, 0xfe, 0x94, 0x0, + 0x0, 0x2, 0x58, 0xbc, 0xef, 0xff, 0xff, 0xed, + 0xb9, 0x52, 0x0, 0x0, + + /* U+0039 "9" */ + 0x0, 0x13, 0x7a, 0xce, 0xff, 0xff, 0xec, 0xa7, + 0x31, 0x0, 0x0, 0x0, 0x16, 0xbf, 0xeb, 0x63, + 0x21, 0x12, 0x35, 0x9d, 0xeb, 0x61, 0x0, 0x0, + 0x49, 0xfe, 0x83, 0x0, 0x0, 0x0, 0x0, 0x6, + 0xbf, 0xd8, 0x30, 0x0, 0x27, 0xcf, 0xd9, 0x42, + 0x0, 0x0, 0x13, 0x7c, 0xff, 0xfb, 0x60, 0x0, + 0x0, 0x26, 0xad, 0xff, 0xff, 0xff, 0xfd, 0xa7, + 0x9c, 0xfc, 0x72, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x11, 0x10, 0x0, 0x3, 0x8d, 0xfb, 0x60, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x38, + 0xdf, 0xc7, 0x20, 0x0, 0x0, 0x24, 0x65, 0x32, + 0x23, 0x45, 0x8b, 0xef, 0xd9, 0x40, 0x0, 0x0, + 0x1, 0x48, 0xcd, 0xef, 0xff, 0xed, 0xca, 0x74, + 0x10, 0x0, 0x0, 0x0, + + /* U+003A ":" */ + 0x4, 0x9e, 0xe9, 0x40, 0x0, 0x26, 0xaa, 0x73, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26, + 0xaa, 0x73, 0x0, 0x4, 0x9d, 0xd9, 0x40, 0x0, + + /* U+003B ";" */ + 0x4, 0x9e, 0xe9, 0x40, 0x0, 0x26, 0xaa, 0x73, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14, + 0x88, 0x52, 0x0, 0x4, 0xaf, 0xfc, 0x61, 0x0, + 0x5, 0xbd, 0x82, 0x0, 0x3, 0x9c, 0x83, 0x0, + 0x0, + + /* U+003C "<" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x23, 0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, + 0x79, 0xbd, 0xee, 0xb6, 0x10, 0x0, 0x24, 0x79, + 0xbd, 0xee, 0xc9, 0x75, 0x31, 0x0, 0x0, 0x0, + 0x38, 0xdf, 0xec, 0x84, 0x10, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x2, 0x46, 0x9b, 0xde, 0xec, + 0xa7, 0x53, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x2, 0x46, 0x9b, 0xde, 0xc7, 0x20, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x10, 0x0, + + /* U+003D "=" */ + 0x3, 0x8e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfd, 0x83, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x27, 0xce, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, + 0xc7, 0x20, 0x0, 0x1, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x0, 0x0, + + /* U+003E ">" */ + 0x1, 0x23, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x26, 0xbe, 0xed, 0xb9, 0x64, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x35, 0x7a, 0xce, 0xed, 0xb9, 0x64, 0x20, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x14, 0x8c, 0xef, + 0xd8, 0x20, 0x0, 0x0, 0x13, 0x57, 0xac, 0xee, + 0xdb, 0x96, 0x42, 0x0, 0x0, 0x27, 0xce, 0xdb, + 0x96, 0x42, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, + + /* U+003F "?" */ + 0x0, 0x0, 0x14, 0x7a, 0xcd, 0xef, 0xff, 0xed, + 0xca, 0x63, 0x0, 0x0, 0x0, 0x4, 0x9d, 0xda, + 0x75, 0x32, 0x22, 0x36, 0xad, 0xfe, 0x83, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x38, 0xef, 0xa5, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x15, 0xae, 0xea, 0x51, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x49, 0xde, + 0xc8, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x27, 0xdf, 0xc7, 0x10, 0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ee, 0xee, 0xee, 0xee, 0xef, 0xff, 0xfb, + 0x61, 0x0, 0x0, 0x0, 0x0, 0x16, 0xbf, 0xea, + 0x52, 0x11, 0x11, 0x11, 0x11, 0x11, 0x14, 0x8d, + 0xfd, 0x72, 0x0, 0x0, 0x0, 0x27, 0xcf, 0xc7, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x6b, 0xfe, 0x94, 0x0, 0x0, + + /* U+0042 "B" */ + 0x0, 0x16, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfe, 0xdb, 0x95, 0x20, 0x0, 0x0, 0x1, 0x6b, + 0xfc, 0x72, 0x11, 0x11, 0x11, 0x12, 0x36, 0xad, + 0xfd, 0x72, 0x0, 0x0, 0x16, 0xbf, 0xc7, 0x20, + 0x0, 0x0, 0x0, 0x0, 0x3, 0x8e, 0xfa, 0x50, + 0x0, 0x1, 0x6b, 0xfc, 0x72, 0x0, 0x0, 0x0, + 0x0, 0x14, 0x8d, 0xfc, 0x72, 0x0, 0x0, 0x16, + 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xea, 0x51, 0x0, 0x0, 0x1, 0x6b, 0xfc, 0x83, + 0x22, 0x22, 0x22, 0x22, 0x34, 0x69, 0xdf, 0xd7, + 0x20, 0x0, 0x16, 0xbf, 0xc7, 0x20, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x17, 0xcf, 0xc7, 0x10, 0x1, + 0x6b, 0xfc, 0x72, 0x11, 0x11, 0x11, 0x11, 0x13, + 0x58, 0xcf, 0xe9, 0x40, 0x0, 0x16, 0xbf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xed, 0xc9, 0x63, + 0x0, 0x0, + + /* U+0043 "C" */ + 0x0, 0x0, 0x0, 0x13, 0x69, 0xbd, 0xee, 0xff, + 0xfe, 0xdb, 0x96, 0x31, 0x0, 0x0, 0x0, 0x15, + 0x9e, 0xfe, 0xc9, 0x65, 0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0xe8, 0x30, 0x0, 0x16, 0xbf, 0xc7, 0x20, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x2, 0x7c, 0xfe, 0x93, + 0x0, 0x0, 0x16, 0xbf, 0xc8, 0x32, 0x22, 0x22, + 0x23, 0x35, 0x69, 0xce, 0xfd, 0x94, 0x10, 0x0, + 0x0, 0x16, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xed, 0xcb, 0x86, 0x31, 0x0, 0x0, 0x0, + + /* U+0045 "E" */ + 0x0, 0x16, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xd8, 0x30, 0x0, 0x16, 0xbf, 0xc8, + 0x32, 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x0, + 0x0, 0x16, 0xbf, 0xc7, 0x20, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x16, 0xbf, 0xc7, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x16, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfa, 0x50, 0x0, 0x0, 0x16, 0xbf, 0xc8, + 0x32, 0x22, 0x22, 0x22, 0x22, 0x21, 0x0, 0x0, + 0x0, 0x16, 0xbf, 0xc7, 0x20, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x16, 0xbf, 0xc8, + 0x32, 0x22, 0x22, 0x22, 0x22, 0x22, 0x21, 0x0, + 0x0, 0x16, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfb, 0x50, + + /* U+0046 "F" */ + 0x0, 0x16, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xd8, 0x30, 0x0, 0x16, 0xbf, 0xc8, + 0x32, 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x0, + 0x0, 0x16, 0xbf, 0xc7, 0x20, 0x0, 0x0, 0x0, + 0x0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, 0xff, 0xfe, 0xdc, 0xa7, 0x41, + 0x0, 0x0, + + /* U+0048 "H" */ + 0x0, 0x16, 0xbf, 0xc7, 0x20, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x6, 0xbf, 0xd7, 0x20, 0x1, 0x6b, + 0xfc, 0x72, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x6b, 0xfd, 0x72, 0x0, 0x16, 0xbf, 0xc7, 0x20, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x6, 0xbf, 0xd7, + 0x20, 0x1, 0x6b, 0xfc, 0x72, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x6b, 0xfd, 0x72, 0x0, 0x16, + 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xd7, 0x20, 0x1, 0x6b, 0xfd, 0x84, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x23, 0x7c, 0xfd, + 0x72, 0x0, 0x16, 0xbf, 0xc7, 0x20, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x6, 0xbf, 0xd7, 0x20, 0x1, + 0x6b, 0xfc, 0x72, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x6b, 0xfd, 0x72, 0x0, 0x16, 0xbf, 0xc7, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6, 0xbf, + 0xd7, 0x20, + + /* U+0049 "I" */ + 0x0, 0x16, 0xbf, 0xc7, 0x20, 0x1, 0x6b, 0xfc, + 0x72, 0x0, 0x16, 0xbf, 0xc7, 0x20, 0x1, 0x6b, + 0xfc, 0x72, 0x0, 0x16, 0xbf, 0xc7, 0x20, 0x1, + 0x6b, 0xfc, 0x72, 0x0, 0x16, 0xbf, 0xc7, 0x20, + 0x1, 0x6b, 0xfc, 0x72, 0x0, 0x16, 0xbf, 0xc7, + 0x20, + + /* U+004A "J" */ + 0x0, 0x0, 0x49, 0xef, 0xff, 0xff, 0xff, 0xff, + 0xfa, 0x40, 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0x6b, 0xfc, 0x72, 0x0, 0x0, 0x0, 0x0, 0x14, + 0xae, 0xff, 0xfd, 0x72, 0x0, 0x16, 0xbf, 0xc7, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x38, 0xdf, + 0xd7, 0x20, + + /* U+004F "O" */ + 0x0, 0x0, 0x0, 0x13, 0x69, 0xbc, 0xee, 0xff, + 0xfe, 0xdb, 0x97, 0x41, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x59, 0xef, 0xec, 0x96, 0x53, 0x33, 0x34, + 0x68, 0xbe, 0xfe, 0xb6, 0x20, 0x0, 0x0, 0x4a, + 0xef, 0xb6, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x5a, 0xef, 0xb5, 0x10, 0x4, 0x9f, 0xe9, + 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x3, 0x8d, 0xfb, 0x50, 0x16, 0xbf, 0xc7, 0x20, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x6b, 0xfc, 0x72, 0x4, 0x9f, 0xe9, 0x40, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x8d, + 0xfb, 0x50, 0x0, 0x4a, 0xef, 0xb6, 0x20, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x1, 0x5a, 0xef, 0xb5, + 0x10, 0x0, 0x1, 0x5a, 0xef, 0xec, 0x96, 0x43, + 0x33, 0x34, 0x68, 0xbe, 0xfe, 0xb6, 0x20, 0x0, + 0x0, 0x0, 0x0, 0x13, 0x69, 0xbd, 0xee, 0xff, + 0xfe, 0xdb, 0x97, 0x41, 0x0, 0x0, 0x0, + + /* U+0050 "P" */ + 0x0, 0x16, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xdc, 0xa8, 0x52, 0x0, 0x0, 0x0, 0x1, 0x6b, + 0xfc, 0x83, 0x22, 0x22, 0x22, 0x35, 0x7a, 0xdf, + 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0x0, 0x16, 0xbf, 0xc8, 0x32, 0x22, 0x22, + 0x26, 0xbe, 0xd9, 0x40, 0x0, 0x0, 0x0, 0x1, + 0x6b, 0xfc, 0x72, 0x0, 0x0, 0x0, 0x1, 0x6b, + 0xfd, 0x83, 0x0, 0x0, 0x0, 0x16, 0xbf, 0xc7, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x27, 0xcf, 0xd8, + 0x30, 0x0, + + /* U+0053 "S" */ + 0x0, 0x1, 0x37, 0xac, 0xde, 0xff, 0xfe, 0xdc, + 0xb8, 0x63, 0x10, 0x0, 0x1, 0x5b, 0xfe, 0xb7, + 0x43, 0x22, 0x23, 0x45, 0x79, 0x84, 0x0, 0x0, + 0x4, 0x9e, 0xe9, 0x40, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x1, 0x5b, 0xfe, 0xc9, + 0x63, 0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x25, 0x8b, 0xce, 0xff, 0xfd, 0xca, + 0x74, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x1, 0x34, 0x69, 0xcf, 0xea, 0x51, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x49, 0xfe, 0x93, 0x0, 0x5, 0xad, 0xb8, 0x64, + 0x32, 0x22, 0x23, 0x48, 0xbe, 0xfb, 0x51, 0x0, + 0x0, 0x25, 0x8a, 0xcd, 0xef, 0xff, 0xfe, 0xdc, + 0xa7, 0x31, 0x0, 0x0, + + /* U+0054 "T" */ + 0x0, 0x4a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfa, 0x50, 0x0, 0x0, 0x12, + 0x22, 0x22, 0x23, 0x7c, 0xfc, 0x83, 0x22, 0x22, + 0x22, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x16, 0xcf, 0xc7, 0x10, 0x0, 0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 0x0, 0x0, 0x0, 0x0, 0x38, 0xef, 0xc6, 0x10, + 0x0, 0x4a, 0xef, 0xd9, 0x52, 0x10, 0x12, 0x5a, + 0xdf, 0xff, 0xc6, 0x10, 0x0, 0x0, 0x25, 0x9b, + 0xde, 0xff, 0xfe, 0xc9, 0x68, 0xbf, 0xc6, 0x10, + + /* U+0065 "e" */ + 0x0, 0x0, 0x25, 0x9b, 0xde, 0xff, 0xed, 0xc9, + 0x52, 0x0, 0x0, 0x0, 0x0, 0x49, 0xee, 0xc8, + 0x42, 0x11, 0x24, 0x7b, 0xee, 0x94, 0x0, 0x0, + 0x5, 0xaf, 0xc7, 0x20, 0x0, 0x0, 0x0, 0x1, + 0x6c, 0xfb, 0x50, 0x0, 0x27, 0xcf, 0xff, 0xee, + 0xee, 0xee, 0xee, 0xee, 0xee, 0xfc, 0x72, 0x0, + 0x5, 0xaf, 0xd8, 0x20, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x49, 0xef, 0xd9, + 0x64, 0x22, 0x23, 0x47, 0xaa, 0x62, 0x0, 0x0, + 0x0, 0x0, 0x25, 0x8b, 0xde, 0xff, 0xfe, 0xdc, + 0x95, 0x20, 0x0, 0x0, + + /* U+0066 "f" */ + 0x0, 0x0, 0x0, 0x1, 0x59, 0xce, 0xff, 0xeb, + 0x62, 0x0, 0x0, 0x0, 0x49, 0xee, 0xa5, 0x11, + 0x22, 0x10, 0x0, 0x0, 0x0, 0x6b, 0xfb, 0x61, + 0x0, 0x0, 0x0, 0x0, 0x27, 0xdf, 0xff, 0xff, + 0xff, 0xff, 0xe9, 0x30, 0x0, 0x0, 0x1, 0x6b, + 0xfb, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x6b, 0xfb, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x6b, 0xfb, 0x61, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x1, 0x6b, 0xfb, 0x61, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x1, 0x6b, 0xfb, 0x61, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x1, 0x6b, 0xfb, 0x61, 0x0, + 0x0, 0x0, + + /* U+0067 "g" */ + 0x0, 0x0, 0x25, 0x9b, 0xde, 0xff, 0xfe, 0xc9, + 0x67, 0xae, 0xd8, 0x20, 0x0, 0x49, 0xef, 0xda, + 0x64, 0x22, 0x23, 0x59, 0xcf, 0xff, 0xd8, 0x20, + 0x5, 0xaf, 0xd8, 0x30, 0x0, 0x0, 0x0, 0x0, + 0x27, 0xdf, 0xd8, 0x20, 0x27, 0xcf, 0xb5, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x5, 0xaf, 0xd8, 0x20, + 0x5, 0xaf, 0xd8, 0x30, 0x0, 0x0, 0x0, 0x0, + 0x28, 0xdf, 0xd8, 0x20, 0x0, 0x49, 0xef, 0xda, + 0x63, 0x22, 0x23, 0x6a, 0xdf, 0xff, 0xd8, 0x20, + 0x0, 0x0, 0x25, 0x9b, 0xde, 0xff, 0xfe, 0xc9, + 0x57, 0xaf, 0xc7, 0x20, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x27, 0xcf, 0xb5, 0x0, + 0x0, 0x38, 0xcc, 0x86, 0x43, 0x22, 0x23, 0x58, + 0xbe, 0xea, 0x50, 0x0, 0x0, 0x13, 0x69, 0xbd, + 0xef, 0xff, 0xfe, 0xdc, 0xa6, 0x31, 0x0, 0x0, + + /* U+0068 "h" */ + 0x0, 0x39, 0xee, 0x94, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x39, 0xee, 0x94, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x39, 0xee, 0x94, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x39, 0xee, 0xa7, + 0x6a, 0xde, 0xff, 0xee, 0xc9, 0x52, 0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, 0x0, 0x0, 0x2, + 0x8d, 0xfa, 0x40, 0x0, 0x0, 0x0, 0x0, 0x28, + 0xdf, 0x94, 0x0, 0x0, 0x22, 0x21, 0x27, 0xbf, + 0xd7, 0x20, 0x0, 0x38, 0xdf, 0xff, 0xec, 0x84, + 0x10, 0x0, + + /* U+006B "k" */ + 0x0, 0x39, 0xee, 0x94, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x39, 0xee, 0x94, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x39, 0xee, 0x94, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x39, 0xee, 0x94, + 0x0, 0x0, 0x0, 0x27, 0xbe, 0xda, 0x51, 0x0, + 0x0, 0x39, 0xee, 0x94, 0x0, 0x2, 0x7b, 0xee, + 0xb6, 0x20, 0x0, 0x0, 0x0, 0x39, 0xee, 0x94, + 0x27, 0xbe, 0xfc, 0x72, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x39, 0xef, 0xee, 0xef, 0xff, 0xfd, 0x83, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x39, 0xef, 0xfc, + 0x73, 0x13, 0x8d, 0xfd, 0x94, 0x0, 0x0, 0x0, + 0x0, 0x39, 0xee, 0x94, 0x0, 0x0, 0x2, 0x7c, + 0xfe, 0xa4, 0x10, 0x0, 0x0, 0x39, 0xee, 0x94, + 0x0, 0x0, 0x0, 0x2, 0x6b, 0xfe, 0xa5, 0x10, + + /* U+006C "l" */ + 0x0, 0x39, 0xee, 0x94, 0x0, 0x3, 0x9e, 0xe9, + 0x40, 0x0, 0x39, 0xee, 0x94, 0x0, 0x3, 0x9e, + 0xe9, 0x40, 0x0, 0x39, 0xee, 0x94, 0x0, 0x3, + 0x9e, 0xe9, 0x40, 0x0, 0x39, 0xee, 0x94, 0x0, + 0x3, 0x9e, 0xe9, 0x40, 0x0, 0x39, 0xee, 0x94, + 0x0, 0x3, 0x9e, 0xe9, 0x40, + + /* U+006D "m" */ + 0x0, 0x39, 0xee, 0x97, 0x7b, 0xde, 0xff, 0xfd, + 0xb9, 0x42, 0x25, 0x9b, 0xde, 0xff, 0xed, 0xb8, + 0x41, 0x0, 0x0, 0x39, 0xef, 0xfd, 0xa6, 0x32, + 0x12, 0x47, 0xcf, 0xff, 0xfe, 0xb6, 0x32, 0x12, + 0x37, 0xbe, 0xfa, 0x51, 0x0, 0x39, 0xef, 0xb6, + 0x10, 0x0, 0x0, 0x0, 0x49, 0xff, 0xc6, 0x10, + 0x0, 0x0, 0x0, 0x49, 0xee, 0x94, 0x0, 0x39, + 0xee, 0x94, 0x0, 0x0, 0x0, 0x0, 0x38, 0xef, + 0xa4, 0x0, 0x0, 0x0, 0x0, 0x28, 0xdf, 0xa5, + 0x0, 0x39, 0xee, 0x94, 0x0, 0x0, 0x0, 0x0, + 0x38, 0xef, 0xa4, 0x0, 0x0, 0x0, 0x0, 0x28, + 0xdf, 0xa5, 0x0, 0x39, 0xee, 0x94, 0x0, 0x0, + 0x0, 0x0, 0x38, 0xef, 0xa4, 0x0, 0x0, 0x0, + 0x0, 0x28, 0xdf, 0xa5, 0x0, 0x39, 0xee, 0x94, + 0x0, 0x0, 0x0, 0x0, 0x38, 0xef, 0xa4, 0x0, + 0x0, 0x0, 0x0, 0x28, 0xdf, 0xa5, + + /* U+006E "n" */ + 0x0, 0x39, 0xee, 0x96, 0x7a, 0xde, 0xff, 0xee, + 0xc9, 0x52, 0x0, 0x0, 0x0, 0x39, 0xef, 0xfe, + 0xa6, 0x42, 0x11, 0x35, 0xad, 0xfc, 0x72, 0x0, + 0x0, 0x39, 0xef, 0xb6, 0x10, 0x0, 0x0, 0x0, + 0x17, 0xcf, 0xb6, 0x0, 0x0, 0x39, 0xee, 0x94, + 0x0, 0x0, 0x0, 0x0, 0x5, 0xbf, 0xc7, 0x10, + 0x0, 0x39, 0xee, 0x94, 0x0, 0x0, 0x0, 0x0, + 0x5, 0xbf, 0xc7, 0x20, 0x0, 0x39, 0xee, 0x94, + 0x0, 0x0, 0x0, 0x0, 0x5, 0xbf, 0xc7, 0x20, + 0x0, 0x39, 0xee, 0x94, 0x0, 0x0, 0x0, 0x0, + 0x5, 0xbf, 0xc7, 0x20, + + /* U+006F "o" */ + 0x0, 0x0, 0x25, 0x8b, 0xde, 0xff, 0xfe, 0xdb, + 0x84, 0x10, 0x0, 0x0, 0x0, 0x49, 0xef, 0xda, + 0x63, 0x22, 0x23, 0x6a, 0xef, 0xd8, 0x30, 0x0, + 0x5, 0xaf, 0xd8, 0x30, 0x0, 0x0, 0x0, 0x0, + 0x49, 0xef, 0xa4, 0x0, 0x27, 0xcf, 0xb5, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x16, 0xbf, 0xc6, 0x10, + 0x5, 0xaf, 0xd8, 0x30, 0x0, 0x0, 0x0, 0x0, + 0x49, 0xef, 0xa4, 0x0, 0x0, 0x49, 0xdf, 0xda, + 0x63, 0x21, 0x23, 0x6a, 0xef, 0xd8, 0x30, 0x0, + 0x0, 0x0, 0x25, 0x8b, 0xde, 0xff, 0xfe, 0xdb, + 0x84, 0x10, 0x0, 0x0, + + /* U+0070 "p" */ + 0x0, 0x39, 0xee, 0x97, 0x7b, 0xde, 0xff, 0xfe, + 0xca, 0x74, 0x10, 0x0, 0x0, 0x0, 0x3, 0x9e, + 0xff, 0xfc, 0x84, 0x21, 0x11, 0x36, 0xae, 0xfc, + 0x72, 0x0, 0x0, 0x0, 0x39, 0xef, 0xc6, 0x10, + 0x0, 0x0, 0x0, 0x0, 0x5a, 0xfd, 0x83, 0x0, + 0x0, 0x3, 0x9e, 0xe9, 0x40, 0x0, 0x0, 0x0, + 0x0, 0x2, 0x8d, 0xfa, 0x50, 0x0, 0x0, 0x39, + 0xef, 0xc7, 0x10, 0x0, 0x0, 0x0, 0x1, 0x6b, + 0xfd, 0x83, 0x0, 0x0, 0x3, 0x9e, 0xff, 0xfc, + 0x95, 0x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 0xde, 0xc8, 0x20, + 0x3, 0x9e, 0xff, 0xec, 0x86, 0x43, 0x10, 0x0, + 0x39, 0xef, 0xc7, 0x10, 0x0, 0x0, 0x0, 0x3, + 0x9e, 0xf9, 0x40, 0x0, 0x0, 0x0, 0x0, 0x39, + 0xee, 0x94, 0x0, 0x0, 0x0, 0x0, 0x3, 0x9e, + 0xe9, 0x40, 0x0, 0x0, 0x0, 0x0, 0x39, 0xee, + 0x94, 0x0, 0x0, 0x0, 0x0, + + /* U+0073 "s" */ + 0x0, 0x0, 0x2, 0x59, 0xbd, 0xef, 0xff, 0xed, + 0xca, 0x62, 0x0, 0x0, 0x16, 0xbf, 0xd9, 0x52, + 0x11, 0x22, 0x46, 0x64, 0x10, 0x0, 0x1, 0x7c, + 0xfd, 0x95, 0x21, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x26, 0x9c, 0xef, 0xff, 0xed, 0xc9, + 0x63, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x12, 0x48, 0xcf, 0xe9, 0x30, 0x0, 0x15, 0x89, + 0x64, 0x32, 0x11, 0x23, 0x7b, 0xfd, 0x83, 0x0, + 0x1, 0x48, 0xac, 0xde, 0xff, 0xfe, 0xec, 0xa7, + 0x30, 0x0, + + /* U+0074 "t" */ + 0x0, 0x0, 0x0, 0x35, 0x85, 0x30, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x1, 0x6b, 0xfb, 0x61, 0x0, + 0x0, 0x0, 0x0, 0x27, 0xdf, 0xff, 0xff, 0xff, + 0xff, 0xe9, 0x30, 0x0, 0x0, 0x1, 0x6b, 0xfb, + 0x61, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x6b, + 0xfb, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x6b, 0xfb, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x6b, 0xfb, 0x61, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0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, 0x0, 0x1, + 0x6b, 0xfa, 0x50, 0x0, 0x16, 0xbf, 0xa5, 0x0, + 0x1, 0x6b, 0xfa, 0x50, 0x0, 0x16, 0xbf, 0xa5, + 0x0, 0x1, 0x6b, 0xfa, 0x50, 0x0, 0x16, 0xbf, + 0xa5, 0x0, 0x1, 0x6b, 0xfa, 0x50, 0x0, 0x16, + 0xbf, 0xa5, 0x0, + + /* U+007D "}" */ + 0x0, 0x17, 0xcf, 0xed, 0xa5, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x27, 0xcf, 0xd7, 0x20, 0x0, 0x0, + 0x0, 0x0, 0x49, 0xee, 0x93, 0x0, 0x0, 0x0, + 0x0, 0x4, 0x9e, 0xe9, 0x40, 0x0, 0x0, 0x0, + 0x0, 0x49, 0xee, 0x94, 0x0, 0x0, 0x0, 0x0, + 0x3, 0x8e, 0xfa, 0x40, 0x0, 0x0, 0x0, 0x0, + 0x3, 0x8d, 0xff, 0xc7, 0x20, 0x0, 0x0, 0x3, + 0x8d, 0xfb, 0x62, 0x0, 0x0, 0x0, 0x0, 0x49, + 0xee, 0x94, 0x0, 0x0, 0x0, 0x0, 0x4, 0x9e, + 0xe9, 0x40, 0x0, 0x0, 0x0, 0x0, 0x49, 0xee, + 0x93, 0x0, 0x0, 0x0, 0x0, 0x27, 0xcf, 0xd8, + 0x20, 0x0, 0x0, 0x17, 0xcf, 0xed, 0xa5, 0x20, + 0x0, 0x0, + + /* U+007E "~" */ + 0x0, 0x26, 0xbd, 0xee, 0xdb, 0x84, 0x20, 0x5, + 0xac, 0x83, 0x0, 0x38, 0xc9, 0x51, 0x12, 0x58, + 0xbd, 0xdd, 0xca, 0x62, 0x0, + + /* U+00B0 "°" */ + 0x0, 0x3, 0x6a, 0xbb, 0xba, 0x73, 0x0, 0x0, + 0x38, 0xb8, 0x30, 0x0, 0x38, 0xb9, 0x40, 0x16, + 0xa9, 0x40, 0x0, 0x0, 0x39, 0xb7, 0x20, 0x38, + 0xb8, 0x30, 0x0, 0x38, 0xb9, 0x40, 0x0, 0x3, + 0x6a, 0xbb, 0xba, 0x73, 0x0, 0x0, + + /* U+2022 "•" */ + 0x0, 0x2, 0x45, 0x42, 0x0, 0x0, 0x2, 0x7c, + 0xff, 0xfe, 0x83, 0x0, 0x0, 0x49, 0xdf, 0xea, + 0x51, 0x0, + + /* U+F001 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x12, 0x32, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x13, 0x46, 0x79, 0xbc, 0xef, 0xff, 0xff, + 0xa4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x13, 0x56, 0x89, 0xbc, 0xef, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x3, 0x9e, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xa5, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x5, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xed, 0xca, 0x87, 0x54, 0x23, 0x8d, 0xff, 0xa5, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xaf, + 0xff, 0xda, 0x87, 0x53, 0x21, 0x0, 0x0, 0x0, + 0x0, 0x2, 0x8d, 0xff, 0xa5, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x5, 0xaf, 0xfd, 0x82, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x8d, + 0xff, 0xa5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x5, 0xaf, 0xfd, 0x82, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x2, 0x8d, 0xff, 0xa5, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xaf, 0xfd, + 0x82, 0x0, 0x0, 0x0, 0x0, 0x24, 0x79, 0xbb, + 0xbc, 0xdf, 0xff, 0xa5, 0x0, 0x0, 0x0, 0x0, + 0x12, 0x33, 0x37, 0xbf, 0xfd, 0x82, 0x0, 0x0, + 0x0, 0x16, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xa5, 0x0, 0x0, 0x15, 0xad, 0xff, 0xff, 0xff, + 0xff, 0xfd, 0x82, 0x0, 0x0, 0x0, 0x2, 0x6b, + 0xef, 0xff, 0xff, 0xff, 0xd9, 0x41, 0x0, 0x0, + 0x39, 0xef, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x61, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x22, 0x32, + 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x25, 0x89, + 0xab, 0xaa, 0x87, 0x41, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, + + /* U+F008 "" */ + 0x0, 0x39, 0xb9, 0x54, 0x59, 0xdf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0x95, 0x45, 0x9b, 0x93, 0x0, 0x0, 0x5a, 0xeb, + 0x88, 0x9b, 0xef, 0xb7, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x23, 0x7c, 0xfe, 0xb8, 0x88, 0xbe, + 0xa5, 0x0, 0x0, 0x5a, 0xc7, 0x10, 0x17, 0xcf, + 0xb5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x6b, 0xfc, 0x61, 0x1, 0x7c, 0xa5, 0x0, 0x0, + 0x5a, 0xfd, 0xcc, 0xce, 0xff, 0xb6, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x12, 0x7c, 0xff, 0xdc, + 0xcc, 0xef, 0xa5, 0x0, 0x0, 0x5a, 0xc6, 0x10, + 0x17, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfb, 0x61, 0x1, 0x6c, 0xa5, + 0x0, 0x0, 0x5a, 0xfd, 0xcc, 0xce, 0xff, 0xb6, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x12, 0x7c, + 0xff, 0xdc, 0xcc, 0xef, 0xa5, 0x0, 0x0, 0x5a, + 0xc7, 0x10, 0x17, 0xcf, 0xb5, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x1, 0x6b, 0xfc, 0x61, 0x1, + 0x7c, 0xa5, 0x0, 0x0, 0x5a, 0xeb, 0x88, 0x9b, + 0xef, 0xb7, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x23, 0x7c, 0xfe, 0xb8, 0x88, 0xbe, 0xa5, 0x0, + 0x0, 0x49, 0xb9, 0x54, 0x59, 0xdf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0x95, 0x45, 0x9b, 0x93, 0x0, + + /* U+F00B "" */ + 0x0, 0x38, 0xdf, 0xff, 0xff, 0xfe, 0xb6, 0x25, + 0x9e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0x83, 0x0, 0x0, 0x5a, 0xff, + 0xff, 0xff, 0xff, 0xd8, 0x46, 0xcf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xa5, 0x0, 0x0, 0x49, 0xef, 0xff, 0xff, 0xff, + 0xc6, 0x25, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfe, 0x94, 0x0, 0x0, + 0x0, 0x12, 0x33, 0x33, 0x22, 0x10, 0x0, 0x1, + 0x23, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, + 0x33, 0x21, 0x0, 0x0, 0x0, 0x4a, 0xff, 0xff, + 0xff, 0xff, 0xc7, 0x26, 0xbf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa4, + 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xd8, + 0x46, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, 0x4a, + 0xff, 0xff, 0xff, 0xff, 0xc7, 0x26, 0xbf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xa4, 0x0, 0x0, 0x0, 0x12, 0x33, 0x33, + 0x22, 0x10, 0x0, 0x1, 0x23, 0x33, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x33, 0x21, 0x0, 0x0, + 0x0, 0x49, 0xef, 0xff, 0xff, 0xff, 0xc6, 0x25, + 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfe, 0x94, 0x0, 0x0, 0x5a, 0xff, + 0xff, 0xff, 0xff, 0xd8, 0x46, 0xcf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xa5, 0x0, 0x0, 0x38, 0xdf, 0xff, 0xff, 0xfe, + 0xb6, 0x25, 0xae, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfd, 0x83, 0x0, + + /* U+F00C "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, + 0x7c, 0xdc, 0x94, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0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x48, 0xdf, + 0xff, 0xff, 0xfd, 0x83, 0x0, 0x0, 0x0, 0x1, + 0x5a, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xd9, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x16, 0xbf, 0xff, 0xff, 0xff, 0xfe, 0xa5, 0x10, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14, 0x8d, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x73, 0x0, + 0x0, 0x0, 0x0, 0x1, 0x48, 0xdf, 0xff, 0xff, + 0xfd, 0x98, 0xad, 0xff, 0xff, 0xff, 0xc7, 0x30, + 0x0, 0x0, 0x39, 0xef, 0xff, 0xff, 0xd9, 0x41, + 0x0, 0x1, 0x5a, 0xdf, 0xff, 0xff, 0xd7, 0x20, + 0x0, 0x2, 0x59, 0xbb, 0x84, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x15, 0x9b, 0xb9, 0x51, 0x0, + + /* U+F011 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x47, 0x99, 0x74, 0x10, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x1, 0x36, 0x52, 0x0, 0x4, 0x9f, 0xff, + 0xf9, 0x40, 0x0, 0x25, 0x64, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x15, 0x9d, 0xff, + 0xfc, 0x71, 0x4, 0x9f, 0xff, 0xf9, 0x40, 0x17, + 0xcf, 0xff, 0xea, 0x51, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x15, 0xaf, 0xff, 0xfd, 0x94, 0x10, 0x4, + 0x9f, 0xff, 0xf9, 0x40, 0x1, 0x59, 0xdf, 0xff, + 0xfb, 0x51, 0x0, 0x0, 0x0, 0x2, 0x7d, 0xff, + 0xfd, 0x83, 0x0, 0x0, 0x4, 0x9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, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x27, 0xdf, 0xff, 0xff, 0xfd, 0x72, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x35, 0x64, + 0x11, 0x36, 0xad, 0xff, 0xff, 0xff, 0xff, 0xda, + 0x63, 0x11, 0x46, 0x53, 0x0, 0x0, 0x0, 0x49, + 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x94, 0x0, + 0x16, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0xba, 0xab, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfc, 0x61, 0x1, 0x37, 0xbe, 0xff, 0xff, 0xff, + 0xc7, 0x20, 0x0, 0x0, 0x2, 0x7c, 0xff, 0xff, + 0xff, 0xeb, 0x73, 0x10, 0x0, 0x2, 0x7c, 0xff, + 0xff, 0xfd, 0x82, 0x0, 0x0, 0x0, 0x0, 0x28, + 0xdf, 0xff, 0xff, 0xd7, 0x20, 0x0, 0x1, 0x37, + 0xbe, 0xff, 0xff, 0xff, 0xc7, 0x20, 0x0, 0x0, + 0x2, 0x7c, 0xff, 0xff, 0xff, 0xeb, 0x73, 0x10, + 0x16, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0xba, 0xab, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfc, 0x61, 0x0, 0x49, 0xef, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfe, 0x94, 0x0, 0x0, 0x0, 0x35, 0x64, + 0x11, 0x25, 0x9c, 0xff, 0xff, 0xff, 0xff, 0xc9, + 0x52, 0x11, 0x36, 0x53, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x27, 0xdf, 0xff, 0xff, + 0xfd, 0x72, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x23, + 0x44, 0x44, 0x32, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, + + /* U+F015 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x25, 0x77, 0x63, 0x10, 0x0, 0x3, + 0x68, 0x88, 0x63, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x59, + 0xdf, 0xff, 0xff, 0xfe, 0xb6, 0x32, 0x7c, 0xff, + 0xfc, 0x71, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x13, 0x7c, 0xef, 0xfe, 0xc8, + 0x54, 0x6a, 0xdf, 0xff, 0xee, 0xef, 0xff, 0xc7, + 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x26, 0xad, 0xff, 0xfd, 0xa5, 0x34, 0x8b, 0xc9, + 0x53, 0x47, 0xbe, 0xff, 0xff, 0xfc, 0x71, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x1, 0x59, 0xcf, 0xff, + 0xeb, 0x74, 0x36, 0xad, 0xff, 0xff, 0xff, 0xec, + 0x84, 0x35, 0x9d, 0xff, 0xfe, 0xb6, 0x30, 0x0, + 0x0, 0x2, 0x6b, 0xef, 0xff, 0xc9, 0x53, 0x59, + 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xb7, 0x33, 0x6b, 0xef, 0xff, 0xd8, 0x40, 0x0, + 0x3, 0x7a, 0x96, 0x33, 0x6b, 0xef, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xd9, 0x42, 0x48, 0xa9, 0x51, 0x0, 0x0, 0x0, + 0x0, 0x1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 0x0, 0x0, 0x38, 0xdf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfd, 0x83, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x1, 0x49, 0xdf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfd, 0x94, 0x10, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x14, 0x9d, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xd9, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x1, 0x23, 0x33, 0x33, 0x33, 0x33, 0x22, + 0x59, 0xdf, 0xff, 0xfd, 0x95, 0x22, 0x33, 0x33, + 0x33, 0x33, 0x32, 0x10, 0x0, 0x0, 0x4a, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfe, 0xa5, 0x34, 0x77, + 0x43, 0x5a, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xa4, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xec, 0xaa, 0xce, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, + 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xe9, 0x56, 0xbc, 0x75, + 0x8d, 0xff, 0xa5, 0x0, 0x0, 0x25, 0x9a, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa8, 0x52, + 0x0, + + /* U+F01C "" */ + 0x0, 0x0, 0x0, 0x0, 0x1, 0x49, 0xdf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfe, 0xb7, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x15, 0xae, 0xff, 0xda, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x9b, 0xef, + 0xfc, 0x83, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x5a, 0xef, 0xfc, 0x72, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x14, 0xae, 0xff, + 0xd7, 0x30, 0x0, 0x0, 0x0, 0x15, 0xae, 0xff, + 0xc7, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x1, 0x4a, 0xef, 0xfc, + 0x82, 0x0, 0x0, 0x38, 0xef, 0xff, 0xda, 0x88, + 0x88, 0x88, 0x63, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x25, 0x78, 0x88, 0x88, 0x9b, 0xef, 0xff, 0xb6, + 0x10, 0x5, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xd8, 0x30, 0x0, 0x0, 0x1, 0x5b, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x82, 0x0, + 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xd8, 0x20, 0x5, 0xaf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0x72, 0x0, 0x26, 0xbe, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfd, 0x84, 0x0, + + /* U+F021 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x11, 0x11, 0x10, 0x0, 0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b, 0xef, 0xff, 0xe9, 0x40, + 0x0, 0x0, 0x0, 0x5a, 0xff, 0xfb, 0xaa, 0xdf, + 0xff, 0xff, 0xdb, 0xa9, 0x99, 0xaa, 0xcd, 0xff, + 0xff, 0xfe, 0xb7, 0x30, 0x0, 0x0, 0x0, 0x0, + 0x5a, 0xff, 0xfa, 0x40, 0x2, 0x47, 0x9c, 0xdf, + 0xff, 0xff, 0xff, 0xff, 0xdb, 0x96, 0x31, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x26, 0x99, 0x85, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x1, 0x11, 0x11, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, + + /* U+F026 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x26, 0xaa, 0x72, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x2, 0x6b, 0xef, 0xff, 0xa5, 0x0, + 0x0, 0x14, 0x78, 0x88, 0x88, 0x89, 0xce, 0xff, + 0xff, 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, + 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, + 0x0, 0x38, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xa5, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x37, 0xcf, 0xff, 0xff, 0xa5, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, + 0x7c, 0xff, 0xa4, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x11, 0x10, 0x0, + + /* U+F027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x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x6b, 0xfd, + 0xa5, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x26, 0xaa, 0x72, + 0x0, 0x0, 0x0, 0x12, 0x11, 0x14, 0x8c, 0xfe, + 0x94, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x26, 0xbe, 0xff, 0xfa, 0x50, 0x0, + 0x0, 0x27, 0xcf, 0xda, 0x52, 0x16, 0xbe, 0xe9, + 0x40, 0x0, 0x0, 0x14, 0x78, 0x88, 0x88, 0x89, + 0xce, 0xff, 0xff, 0xff, 0xa5, 0x0, 0x23, 0x32, + 0x1, 0x4a, 0xdf, 0xb6, 0x13, 0x8d, 0xfa, 0x50, + 0x0, 0x5, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfa, 0x50, 0x15, 0xbe, 0xea, 0x51, + 0x16, 0xbf, 0xc6, 0x13, 0x9e, 0xe9, 0x30, 0x0, + 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xa5, 0x0, 0x3, 0x8d, 0xfa, 0x40, 0x39, + 0xee, 0x83, 0x17, 0xcf, 0xa5, 0x0, 0x5, 0xaf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, + 0x50, 0x15, 0xbe, 0xea, 0x51, 0x16, 0xcf, 0xc6, + 0x13, 0x8e, 0xe9, 0x30, 0x0, 0x38, 0xdf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, + 0x23, 0x31, 0x1, 0x5a, 0xef, 0xb6, 0x13, 0x8d, + 0xfa, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x3, 0x7c, 0xff, 0xff, 0xfa, 0x50, 0x0, 0x0, + 0x27, 0xcf, 0xda, 0x52, 0x16, 0xbf, 0xe9, 0x40, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x3, 0x7c, 0xff, 0xa4, 0x0, 0x0, 0x0, 0x12, + 0x11, 0x15, 0x9d, 0xfe, 0x94, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x11, 0x0, 0x0, 0x0, 0x0, 0x1, 0x6b, + 0xfd, 0xa5, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, + + /* U+F03E "" */ + 0x0, 0x26, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xeb, 0x62, 0x0, 0x0, 0x5a, 0xff, + 0xfd, 0xa7, 0x56, 0x7b, 0xef, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xb5, 0x0, 0x0, + 0x1, 0x7c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, + 0xef, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, + 0x5a, 0xff, 0xeb, 0x63, 0x12, 0x38, 0xcf, 0xff, + 0xff, 0xff, 0xfe, 0xa6, 0x20, 0x13, 0x8c, 0xff, + 0xff, 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xfe, 0xcc, 0xdf, 0xff, 0xff, 0xea, 0x62, + 0x0, 0x0, 0x0, 0x1, 0x38, 0xdf, 0xff, 0xa5, + 0x0, 0x0, 0x5a, 0xff, 0xff, 0xea, 0x62, 0x0, + 0x15, 0x9b, 0xa6, 0x20, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x2, 0x8d, 0xff, 0xa5, 0x0, 0x0, 0x5a, + 0xff, 0xe9, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x8d, + 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xec, 0x98, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x89, 0xce, 0xff, 0xa5, 0x0, + 0x0, 0x26, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xeb, 0x62, 0x0, + + /* U+F043 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x56, + 0x42, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x1, 0x6c, 0xff, 0xfb, + 0x51, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x38, 0xdf, 0xff, 0xff, 0xc7, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x5, 0xae, 0xff, 0xff, 0xff, 0xfe, 0x93, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14, + 0x9e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x83, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x9e, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x83, + 0x0, 0x0, 0x0, 0x3, 0x8d, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x72, + 0x0, 0x0, 0x38, 0xef, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0x20, + 0x0, 0x4a, 0xff, 0xe9, 0x56, 0xcf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xe8, 0x30, 0x0, + 0x27, 0xdf, 0xfc, 0x73, 0x5a, 0xef, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xb6, 0x10, 0x0, 0x1, + 0x6b, 0xff, 0xfd, 0xa6, 0x43, 0x47, 0xbe, 0xff, + 0xff, 0xff, 0xea, 0x40, 0x0, 0x0, 0x0, 0x1, + 0x48, 0xce, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xb7, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x24, 0x56, 0x77, 0x76, 0x54, 0x20, 0x0, + 0x0, 0x0, 0x0, + + /* U+F048 "" */ + 0x25, 0x78, 0x86, 0x30, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x13, 0x67, 0x52, 0x0, 0x4, 0x9f, 0xff, + 0xc6, 0x10, 0x0, 0x0, 0x0, 0x15, 0x9d, 0xff, + 0xfe, 0x83, 0x0, 0x49, 0xff, 0xfc, 0x61, 0x0, + 0x0, 0x26, 0xae, 0xff, 0xff, 0xff, 0xe9, 0x30, + 0x4, 0x9f, 0xff, 0xc6, 0x10, 0x37, 0xbe, 0xff, + 0xff, 0xff, 0xff, 0xfe, 0x93, 0x0, 0x49, 0xff, + 0xfd, 0xa9, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xe9, 0x30, 0x4, 0x9f, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x93, + 0x0, 0x49, 0xff, 0xfe, 0xee, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xe9, 0x30, 0x4, 0x9f, + 0xff, 0xc6, 0x24, 0x9d, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfe, 0x93, 0x0, 0x49, 0xff, 0xfc, 0x61, + 0x0, 0x3, 0x7c, 0xef, 0xff, 0xff, 0xff, 0xe9, + 0x30, 0x4, 0x9f, 0xff, 0xc6, 0x10, 0x0, 0x0, + 0x2, 0x6b, 0xef, 0xff, 0xfe, 0x93, 0x0, 0x38, + 0xdf, 0xfb, 0x50, 0x0, 0x0, 0x0, 0x0, 0x2, + 0x59, 0xde, 0xb6, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, + + /* U+F04B "" */ + 0x0, 0x1, 0x46, 0x76, 0x31, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x49, 0xff, 0xff, 0xff, 0xda, + 0x74, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfd, 0xa7, 0x41, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xdb, 0x74, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfd, 0xb8, 0x52, 0x0, + 0x0, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xeb, 0x84, 0x10, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfc, 0x61, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0x73, 0x10, + 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfd, 0xb8, 0x42, 0x0, + 0x0, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xdb, 0x74, 0x20, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfd, 0xa7, 0x41, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x49, + 0xff, 0xff, 0xff, 0xda, 0x74, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x1, 0x36, 0x76, 0x31, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, + + /* U+F04C "" */ + 0x0, 0x15, 0xad, 0xef, 0xff, 0xff, 0xfe, 0xc8, + 0x30, 0x0, 0x15, 0xad, 0xef, 0xff, 0xff, 0xfe, + 0xc8, 0x30, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfd, 0x72, 0x0, 0x5a, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0x72, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfd, 0x82, 0x0, 0x5a, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfd, 0x82, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x82, 0x0, + 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x82, + 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0x82, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfd, 0x82, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfd, 0x82, 0x0, 0x5a, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0x82, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfd, 0x82, 0x0, 0x5a, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfd, 0x82, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x82, 0x0, + 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x82, + 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0x82, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfd, 0x82, 0x0, 0x4a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfc, 0x72, 0x0, 0x4a, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfc, 0x72, 0x0, 0x2, 0x47, 0x88, + 0x99, 0x99, 0x88, 0x63, 0x10, 0x0, 0x2, 0x47, + 0x88, 0x99, 0x99, 0x88, 0x63, 0x10, + + /* U+F04D "" */ + 0x0, 0x2, 0x47, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x63, 0x10, 0x0, 0x4a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfc, 0x72, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfd, 0x82, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x82, + 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfd, 0x82, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0x82, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfd, 0x82, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x82, + 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfd, 0x82, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0x72, 0x0, 0x15, 0xad, 0xef, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfe, 0xc8, 0x30, + + /* U+F051 "" */ + 0x2, 0x57, 0x64, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x25, 0x88, 0x85, 0x20, 0x2, 0x7d, 0xff, + 0xfd, 0xa5, 0x20, 0x0, 0x0, 0x0, 0x5, 0xbf, + 0xff, 0xa5, 0x0, 0x28, 0xdf, 0xff, 0xff, 0xfe, + 0xb7, 0x30, 0x0, 0x0, 0x5b, 0xff, 0xfa, 0x50, + 0x2, 0x8d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc8, + 0x31, 0x5, 0xbf, 0xff, 0xa5, 0x0, 0x28, 0xdf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xda, 0xac, + 0xff, 0xfa, 0x50, 0x2, 0x8d, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, + 0x0, 0x28, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfe, 0xee, 0xff, 0xfa, 0x50, 0x2, 0x8d, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x94, 0x25, + 0xbf, 0xff, 0xa5, 0x0, 0x28, 0xdf, 0xff, 0xff, + 0xff, 0xfc, 0x84, 0x10, 0x0, 0x5b, 0xff, 0xfa, + 0x50, 0x2, 0x8d, 0xff, 0xff, 0xeb, 0x73, 0x0, + 0x0, 0x0, 0x5, 0xbf, 0xff, 0xa5, 0x0, 0x15, + 0xae, 0xda, 0x62, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x5a, 0xef, 0xe9, 0x40, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, + + /* U+F052 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x36, 0x77, 0x52, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x38, 0xcf, 0xff, 0xff, 0xea, 0x51, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x26, 0xbe, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xd9, 0x41, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x15, 0xae, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xc8, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x14, 0x9d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfe, 0xb7, 0x20, 0x0, + 0x0, 0x0, 0x2, 0x6c, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfe, 0x94, 0x0, 0x0, 0x0, 0x27, 0xdf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x50, 0x0, + 0x0, 0x0, 0x1, 0x23, 0x34, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x43, + 0x31, 0x0, 0x0, 0x0, 0x0, 0x38, 0xdf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfb, 0x51, 0x0, 0x0, + 0x5, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xd8, 0x20, 0x0, 0x0, 0x27, 0xce, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xea, 0x51, 0x0, 0x0, + + /* U+F053 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x34, 0x31, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x25, 0xae, 0xff, 0xfb, 0x61, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x2, 0x5a, 0xef, 0xff, + 0xfd, 0x94, 0x10, 0x0, 0x0, 0x0, 0x0, 0x25, + 0xae, 0xff, 0xff, 0xd9, 0x41, 0x0, 0x0, 0x0, + 0x0, 0x2, 0x5a, 0xef, 0xff, 0xfd, 0x94, 0x10, + 0x0, 0x0, 0x0, 0x0, 0x3, 0x8d, 0xff, 0xff, + 0xeb, 0x51, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x27, 0xbe, 0xff, 0xff, 0xc8, 0x30, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x7b, + 0xef, 0xff, 0xfc, 0x83, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0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, 0x38, 0xdf, 0xff, 0xfb, 0x50, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x38, 0xef, 0xff, 0xfb, 0x60, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x38, 0xef, 0xff, + 0xfb, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x3, 0x57, 0x88, 0x88, 0x88, 0x88, 0x9c, + 0xff, 0xff, 0xfd, 0xb8, 0x88, 0x88, 0x88, 0x88, + 0x74, 0x10, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0x72, 0x0, 0x15, 0x9b, 0xbb, + 0xbb, 0xbb, 0xbb, 0xce, 0xff, 0xff, 0xfe, 0xdb, + 0xbb, 0xbb, 0xbb, 0xbb, 0xa7, 0x30, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x38, 0xef, 0xff, + 0xfb, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x38, + 0xef, 0xff, 0xfb, 0x60, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x38, 0xef, 0xff, 0xfb, 0x60, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x15, 0x9c, 0xdd, 0xb7, 0x20, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + + /* U+F068 "" */ + 0x0, 0x2, 0x45, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x53, 0x10, 0x0, 0x4a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfc, 0x72, 0x0, 0x26, 0xac, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xc8, 0x40, + + /* U+F06E "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x13, 0x58, + 0xab, 0xcd, 0xef, 0xff, 0xff, 0xed, 0xca, 0x97, + 0x42, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x1, 0x49, 0xcf, 0xff, 0xfe, 0xc9, + 0x64, 0x32, 0x23, 0x45, 0x7a, 0xdf, 0xff, 0xfe, + 0xb7, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, + 0x6b, 0xef, 0xff, 0xff, 0xc6, 0x20, 0x0, 0x3, + 0x79, 0x87, 0x52, 0x0, 0x49, 0xdf, 0xff, 0xff, + 0xd9, 0x41, 0x0, 0x0, 0x0, 0x27, 0xcf, 0xff, + 0xff, 0xfe, 0x93, 0x0, 0x0, 0x2, 0x7c, 0xff, + 0xff, 0xea, 0x51, 0x16, 0xbf, 0xff, 0xff, 0xfe, + 0xa5, 0x10, 0x0, 0x49, 0xef, 0xff, 0xff, 0xff, + 0xc6, 0x12, 0x7c, 0xef, 0xff, 0xff, 0xff, 0xff, + 0xf9, 0x40, 0x49, 0xef, 0xff, 0xff, 0xff, 0xc7, + 0x10, 0x0, 0x38, 0xdf, 0xff, 0xff, 0xfe, 0x93, + 0x3, 0x9e, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x61, + 0x16, 0xbf, 0xff, 0xff, 0xfe, 0xa4, 0x10, 0x0, + 0x0, 0x2, 0x6b, 0xef, 0xff, 0xff, 0xc6, 0x20, + 0x26, 0x9b, 0xcc, 0xca, 0x84, 0x11, 0x49, 0xdf, + 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 0xff, 0xff, 0xfe, 0xa4, + 0x10, 0x0, 0x0, 0x0, 0x1, 0x6b, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xc7, 0x20, 0x0, 0x4a, + 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd9, 0x30, + 0x0, 0x0, 0x15, 0xae, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0x95, 0x21, 0x37, 0xcf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x72, 0x0, + 0x4, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfc, 0x61, 0x0, 0x1, + 0x46, 0x77, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x75, 0x20, 0x0, + + /* U+F074 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x46, + 0x63, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x5, 0xaf, 0xff, 0xc8, 0x31, + 0x0, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xc8, 0x30, 0x0, 0x0, 0x0, 0x26, 0xbe, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfc, 0x72, 0x0, 0x0, + 0x48, 0xcd, 0xdd, 0xde, 0xff, 0xff, 0xeb, 0x62, + 0x2, 0x6b, 0xef, 0xff, 0xfe, 0xde, 0xff, 0xff, + 0xff, 0xd9, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x26, 0xac, 0xa6, 0x46, 0xbe, 0xff, 0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0x0, 0x2, 0x6b, 0xef, 0xff, 0xfd, 0x94, 0x12, + 0x6b, 0xef, 0xff, 0xfd, 0x94, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x26, 0xbe, 0xff, 0xff, 0xd9, 0x41, + 0x0, 0x0, 0x0, 0x26, 0xbe, 0xff, 0xff, 0xd9, + 0x41, 0x0, 0x0, 0x16, 0xbf, 0xff, 0xfd, 0x94, + 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x6b, + 0xef, 0xff, 0xe9, 0x40, 0x0, 0x0, 0x25, 0x77, + 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x25, 0x77, 0x41, 0x0, + + /* U+F078 "" */ + 0x0, 0x0, 0x25, 0x77, 0x41, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x25, 0x77, + 0x41, 0x0, 0x0, 0x16, 0xbf, 0xff, 0xfd, 0x94, + 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x6b, + 0xef, 0xff, 0xe9, 0x40, 0x0, 0x0, 0x26, 0xbe, + 0xff, 0xff, 0xd9, 0x41, 0x0, 0x0, 0x0, 0x26, + 0xbe, 0xff, 0xff, 0xd9, 0x41, 0x0, 0x0, 0x0, + 0x0, 0x2, 0x6b, 0xef, 0xff, 0xfd, 0x94, 0x12, + 0x6b, 0xef, 0xff, 0xfd, 0x94, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x26, 0xbe, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xd9, 0x41, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x2, 0x6b, 0xef, 0xff, 0xfd, 0x94, 0x10, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x25, 0x76, 0x41, 0x0, + 0x0, 0x0,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, 0x77, 0x77, 0x77, 0x76, + 0x53, 0x36, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfe, 0xb6, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x38, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xd7, 0x20, 0x37, 0xbe, 0xff, 0xff, + 0xfe, 0xb7, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x26, + 0xac, 0xa6, 0x30, 0x0, 0x0, 0x0, 0x0, + + /* U+F07B "" */ + 0x0, 0x26, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfe, 0xa6, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5a, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xeb, + 0x98, 0x88, 0x88, 0x88, 0x88, 0x88, 0x77, 0x64, + 0x10, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xa4, 0x0, 0x0, + 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, + 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, + 0x0, 0x26, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xeb, 0x62, 0x0, + + /* U+F093 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x2, 0x44, 0x20, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x37, 0xce, 0xff, + 0xec, 0x73, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x3, 0x7c, 0xef, 0xff, 0xff, 0xff, 0xfe, 0xc7, + 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x37, 0xce, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xec, 0x73, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x39, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfe, 0x93, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x3, 0x8d, 0xff, 0xff, 0xff, 0xd8, 0x30, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x8d, 0xff, + 0xff, 0xff, 0xd8, 0x20, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x2, 0x8d, 0xff, 0xff, 0xff, 0xd8, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x1, 0x23, 0x33, 0x33, 0x33, 0x32, 0x13, + 0x8d, 0xff, 0xff, 0xff, 0xd8, 0x31, 0x23, 0x33, + 0x33, 0x33, 0x32, 0x10, 0x0, 0x0, 0x4a, 0xff, + 0xff, 0xff, 0xff, 0xfe, 0x94, 0x36, 0x99, 0x99, + 0x99, 0x63, 0x49, 0xef, 0xff, 0xff, 0xff, 0xff, + 0xa4, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfe, 0xca, 0x99, 0x99, 0x99, 0xac, 0xef, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, + 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xe9, 0x56, 0xbc, 0x75, + 0x8d, 0xff, 0xa5, 0x0, 0x0, 0x25, 0x9a, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa8, 0x52, + 0x0, + + /* U+F095 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x35, 0x76, + 0x53, 0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x27, 0xcf, 0xff, 0xff, 0xff, 0xfe, + 0x83, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x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x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, 0x77, + 0x76, 0x65, 0x43, 0x20, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, + + /* U+F0C4 "" */ + 0x0, 0x0, 0x2, 0x57, 0x89, 0x98, 0x63, 0x10, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x23, 0x32, + 0x10, 0x0, 0x0, 0x15, 0xae, 0xff, 0xff, 0xff, + 0xff, 0xd7, 0x20, 0x0, 0x0, 0x1, 0x48, 0xcf, + 0xff, 0xff, 0xea, 0x50, 0x0, 0x49, 0xff, 0xe9, + 0x40, 0x17, 0xcf, 0xfc, 0x71, 0x0, 0x14, 0x8c, + 0xff, 0xff, 0xff, 0xd9, 0x51, 0x0, 0x0, 0x17, + 0xcf, 0xff, 0xdb, 0xce, 0xff, 0xfd, 0x84, 0x48, + 0xcf, 0xff, 0xff, 0xfd, 0x95, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x14, 0x8a, 0xcd, 0xef, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xd9, 0x51, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, + 0x9e, 0xff, 0xff, 0xff, 0xff, 0xc7, 0x20, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x57, + 0x89, 0xbd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xb6, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x15, + 0xae, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xa7, 0x8b, + 0xef, 0xff, 0xff, 0xeb, 0x62, 0x0, 0x0, 0x0, + 0x0, 0x49, 0xff, 0xe9, 0x40, 0x17, 0xcf, 0xfc, + 0x71, 0x0, 0x27, 0xbe, 0xff, 0xff, 0xfe, 0xb6, + 0x20, 0x0, 0x0, 0x17, 0xcf, 0xff, 0xdb, 0xce, + 0xff, 0xe9, 0x40, 0x0, 0x0, 0x2, 0x6b, 0xef, + 0xff, 0xff, 0xe9, 0x40, 0x0, 0x0, 0x14, 0x8a, + 0xcc, 0xcb, 0x96, 0x30, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x13, 0x56, 0x66, 0x41, 0x0, + + /* U+F0C5 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x23, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x31, 0x12, 0x21, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, + 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x49, + 0xed, 0x94, 0x10, 0x0, 0x0, 0x1, 0x23, 0x44, + 0x32, 0x15, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xa5, 0x49, 0xef, 0xfe, 0xc7, 0x20, 0x0, 0x4a, + 0xff, 0xff, 0xe9, 0x45, 0xbf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xec, 0x98, 0x88, 0x88, 0x85, 0x20, + 0x0, 0x5a, 0xff, 0xff, 0xe9, 0x45, 0xbf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfa, 0x50, 0x0, 0x5a, 0xff, 0xff, 0xe9, 0x45, + 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfa, 0x50, 0x0, 0x5a, 0xff, 0xff, + 0xe9, 0x45, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfa, 0x50, 0x0, 0x5a, + 0xff, 0xff, 0xe9, 0x45, 0xbf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x50, + 0x0, 0x5a, 0xff, 0xff, 0xe9, 0x45, 0xbf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfa, 0x50, 0x0, 0x5a, 0xff, 0xff, 0xe9, 0x45, + 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfa, 0x40, 0x0, 0x5a, 0xff, 0xff, + 0xfd, 0x95, 0x33, 0x34, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x43, 0x21, 0x0, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xa5, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x14, 0x67, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x76, 0x31, 0x0, 0x0, 0x0, + 0x0, 0x0, + + /* U+F0C7 "" */ + 0x0, 0x2, 0x47, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x87, 0x52, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x4a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xb6, 0x20, 0x0, 0x0, 0x0, 0x5a, 0xff, 0xd8, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x6b, 0xff, 0xff, 0xeb, 0x62, 0x0, 0x0, 0x5a, + 0xff, 0xd8, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x6b, 0xff, 0xff, 0xff, 0xe9, 0x30, + 0x0, 0x5a, 0xff, 0xeb, 0x97, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0xad, 0xff, 0xff, 0xff, + 0xf9, 0x40, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf9, 0x40, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xd9, 0x42, 0x12, 0x5a, 0xdf, + 0xff, 0xff, 0xff, 0xff, 0xf9, 0x40, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xff, 0xfc, 0x72, 0x0, 0x0, + 0x3, 0x8d, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x40, + 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x94, + 0x0, 0x0, 0x5, 0xaf, 0xff, 0xff, 0xff, 0xff, + 0xf9, 0x40, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfe, 0xca, 0x9a, 0xce, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf9, 0x40, 0x0, 0x16, 0xad, 0xef, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xed, 0x95, 0x10, + + /* U+F0C9 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x4a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfc, 0x72, 0x0, 0x26, 0x9a, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xa7, 0x41, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x25, 0x88, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x86, 0x31, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0x72, 0x0, 0x0, 0x11, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x11, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x26, 0x9a, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xa7, 0x41, 0x0, 0x4a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfc, 0x72, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + + /* U+F0E0 "" */ + 0x0, 0x26, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xeb, 0x62, 0x0, 0x0, 0x49, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xa4, 0x0, 0x0, 0x1, 0x47, 0xbe, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xeb, 0x74, 0x10, 0x0, 0x0, + 0x59, 0xc9, 0x53, 0x47, 0xbe, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xeb, 0x74, + 0x35, 0x9c, 0x95, 0x0, 0x0, 0x5a, 0xff, 0xff, + 0xd9, 0x53, 0x47, 0xbe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xeb, 0x74, 0x35, 0x9c, 0xff, 0xff, 0xa5, + 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xd9, + 0x63, 0x36, 0xad, 0xee, 0xda, 0x63, 0x36, 0x9d, + 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xda, 0x75, + 0x44, 0x57, 0xad, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, + 0x0, 0x26, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xeb, 0x62, 0x0, + + /* U+F0E7 "" */ + 0x0, 0x0, 0x15, 0x9b, 0xbb, 0xbb, 0xbb, 0xbb, + 0xa8, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, + 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb6, 0x10, + 0x0, 0x0, 0x0, 0x0, 0x2, 0x7c, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xb6, 0x10, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x49, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xc6, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x16, + 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfe, 0xb6, 0x10, 0x3, 0x8e, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc6, + 0x10, 0x0, 0x49, 0xef, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfd, 0x82, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0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fa, 0x55, 0xbf, 0xff, 0xff, 0xff, 0xff, + 0xa5, 0x23, 0x56, 0x66, 0x53, 0x10, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xfa, 0x55, 0xbf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe9, 0x40, + 0x0, 0x5a, 0xff, 0xff, 0xff, 0xfa, 0x55, 0xbf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf9, 0x40, 0x0, 0x49, 0xef, 0xff, 0xff, 0xfa, + 0x55, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf9, 0x40, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x5, 0xbf, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xf9, 0x40, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x5, 0xaf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x40, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x23, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x31, 0x0, + + /* U+F0F3 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x14, 0x65, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x4, 0x9d, 0xff, 0xb6, 0x10, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x26, 0xad, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xc9, 0x51, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x49, 0xef, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfc, 0x72, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x5, 0xaf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x30, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x28, 0xdf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfb, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5a, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0x72, 0x0, 0x0, 0x0, 0x0, + 0x2, 0x8d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, + 0x0, 0x2, 0x6b, 0xef, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0x93, 0x0, 0x0, 0x39, 0xef, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfb, 0x61, 0x0, 0x1, 0x23, 0x34, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x43, 0x21, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x2, 0x7c, 0xff, 0xff, + 0xfe, 0x94, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, + 0x46, 0x76, 0x52, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, + + /* U+F11C "" */ + 0x0, 0x26, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfd, 0x84, 0x0, 0x5, + 0xaf, 0xfe, 0xc9, 0x88, 0xad, 0xeb, 0x88, 0x8b, + 0xed, 0xa8, 0x8b, 0xee, 0xb8, 0x88, 0x8b, 0xee, + 0xb8, 0x8a, 0xdf, 0xfd, 0x72, 0x0, 0x5a, 0xff, + 0xd8, 0x30, 0x5, 0xbc, 0x71, 0x1, 0x7c, 0xb5, + 0x1, 0x6b, 0xb6, 0x0, 0x0, 0x6b, 0xb6, 0x10, + 0x5b, 0xff, 0xd8, 0x20, 0x5, 0xaf, 0xff, 0xff, + 0xfe, 0xdc, 0xcd, 0xef, 0xed, 0xcc, 0xde, 0xed, + 0xcc, 0xce, 0xff, 0xec, 0xcc, 0xef, 0xff, 0xff, + 0xfd, 0x82, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xa4, + 0x0, 0x38, 0xc8, 0x30, 0x5, 0xaa, 0x40, 0x2, + 0x7d, 0xd7, 0x20, 0x27, 0xcf, 0xff, 0xff, 0xd8, + 0x20, 0x5, 0xaf, 0xff, 0xff, 0xfe, 0xdc, 0xcd, + 0xef, 0xed, 0xcc, 0xde, 0xed, 0xcc, 0xce, 0xff, + 0xec, 0xcc, 0xef, 0xff, 0xff, 0xfd, 0x82, 0x0, + 0x5a, 0xff, 0xd8, 0x30, 0x5, 0xbc, 0x71, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6b, + 0xb6, 0x10, 0x5b, 0xff, 0xd8, 0x20, 0x5, 0xaf, + 0xfe, 0xc9, 0x88, 0xad, 0xeb, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x8b, 0xde, 0xb8, + 0x8a, 0xdf, 0xfd, 0x72, 0x0, 0x26, 0xbe, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfd, 0x84, 0x0, + + /* U+F124 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x24, 0x66, 0x53, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x1, 0x35, 0x8a, 0xde, 0xff, 0xff, 0xfe, + 0x93, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x2, 0x47, 0x9c, 0xef, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xfb, 0x61, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x13, 0x68, 0xad, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfe, 0x93, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, + 0x79, 0xce, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0x20, 0x0, + 0x0, 0x0, 0x26, 0xbe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfa, 0x50, 0x0, 0x0, 0x0, 0x0, 0x38, + 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x83, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x12, 0x33, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x9d, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xb6, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x6c, 0xff, 0xff, 0xff, 0xff, 0xea, 0x40, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x6c, 0xff, + 0xff, 0xff, 0xfd, 0x82, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x1, 0x6c, 0xff, 0xff, 0xff, 0xb5, + 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x6b, 0xff, 0xff, 0xe9, 0x40, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x46, 0x64, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, + + /* U+F15B "" */ + 0x0, 0x26, 0x9b, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, + 0xba, 0x62, 0x36, 0x74, 0x10, 0x0, 0x0, 0x0, + 0x0, 0x5, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xe9, 0x45, 0xaf, 0xfd, 0x94, 0x10, 0x0, + 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfe, 0x94, 0x5a, 0xff, 0xff, 0xfd, 0x94, + 0x10, 0x0, 0x5, 0xaf, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfa, 0x52, 0x34, 0x44, 0x44, 0x44, + 0x31, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfa, 0x50, 0x0, 0x5, 0xaf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfa, 0x50, 0x0, 0x5, 0xaf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfa, 0x50, 0x0, 0x5, 0xaf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfa, 0x50, 0x0, 0x5, 0xaf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, 0x2, + 0x34, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x31, 0x0, 0x0, + + /* U+F1EB "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1, 0x35, 0x67, 0x99, 0xab, 0xbb, 0xcb, 0xbb, + 0xa9, 0x97, 0x65, 0x31, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x25, + 0x8b, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0x85, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x13, 0x7b, + 0xef, 0xff, 0xff, 0xfe, 0xca, 0x87, 0x54, 0x33, + 0x22, 0x22, 0x23, 0x34, 0x57, 0x8a, 0xce, 0xff, + 0xff, 0xff, 0xeb, 0x73, 0x10, 0x0, 0x0, 0x28, + 0xdf, 0xff, 0xfd,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, + 0x0, 0x0, + + /* U+F240 "" */ + 0x0, 0x1, 0x35, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x65, 0x20, 0x0, + 0x0, 0x0, 0x4, 0x9f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0x83, 0x0, 0x0, 0x0, 0x5a, 0xff, 0xd8, 0x32, + 0x34, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x21, 0x49, + 0xef, 0xff, 0xd8, 0x30, 0x0, 0x5, 0xaf, 0xfd, + 0x84, 0x6c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, + 0x52, 0x59, 0xce, 0xff, 0xa5, 0x0, 0x0, 0x5a, + 0xff, 0xd8, 0x46, 0xcf, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xa5, 0x0, 0x28, 0xdf, 0xfa, 0x50, 0x0, + 0x5, 0xaf, 0xfd, 0x83, 0x59, 0xcc, 0xcc, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcc, 0xcc, 0xc8, 0x43, 0x8e, 0xff, 0xff, 0xa5, + 0x0, 0x0, 0x5a, 0xff, 0xeb, 0x87, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x9c, 0xff, 0xfc, + 0x94, 0x10, 0x0, 0x2, 0x6c, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xea, 0x51, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + + /* U+F241 "" */ + 0x0, 0x1, 0x35, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x65, 0x20, 0x0, + 0x0, 0x0, 0x4, 0x9f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0x83, 0x0, 0x0, 0x0, 0x5a, 0xff, 0xd8, 0x32, + 0x34, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x43, 0x21, 0x0, 0x0, 0x0, 0x49, + 0xef, 0xff, 0xd8, 0x30, 0x0, 0x5, 0xaf, 0xfd, + 0x84, 0x6c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xc6, 0x10, 0x0, 0x0, + 0x2, 0x59, 0xce, 0xff, 0xa5, 0x0, 0x0, 0x5a, + 0xff, 0xd8, 0x46, 0xcf, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x61, 0x0, + 0x0, 0x0, 0x0, 0x28, 0xdf, 0xfa, 0x50, 0x0, + 0x5, 0xaf, 0xfd, 0x83, 0x59, 0xcc, 0xcc, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x95, + 0x0, 0x0, 0x0, 0x3, 0x8e, 0xff, 0xff, 0xa5, + 0x0, 0x0, 0x5a, 0xff, 0xeb, 0x87, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x9c, 0xff, 0xfc, + 0x94, 0x10, 0x0, 0x2, 0x6c, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xea, 0x51, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + + /* U+F242 "" */ + 0x0, 0x1, 0x35, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x65, 0x20, 0x0, + 0x0, 0x0, 0x4, 0x9f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0x83, 0x0, 0x0, 0x0, 0x5a, 0xff, 0xd8, 0x32, + 0x34, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x32, + 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x49, + 0xef, 0xff, 0xd8, 0x30, 0x0, 0x5, 0xaf, 0xfd, + 0x84, 0x6c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfd, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x2, 0x59, 0xce, 0xff, 0xa5, 0x0, 0x0, 0x5a, + 0xff, 0xd8, 0x46, 0xcf, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xd8, 0x20, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x28, 0xdf, 0xfa, 0x50, 0x0, + 0x5, 0xaf, 0xfd, 0x83, 0x59, 0xcc, 0xcc, 0xcc, + 0xcc, 0xcc, 0xcc, 0xca, 0x62, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x3, 0x8e, 0xff, 0xff, 0xa5, + 0x0, 0x0, 0x5a, 0xff, 0xeb, 0x87, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x9c, 0xff, 0xfc, + 0x94, 0x10, 0x0, 0x2, 0x6c, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xea, 0x51, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + + /* U+F243 "" */ + 0x0, 0x1, 0x35, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x65, 0x20, 0x0, + 0x0, 0x0, 0x4, 0x9f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0x83, 0x0, 0x0, 0x0, 0x5a, 0xff, 0xd8, 0x32, + 0x34, 0x44, 0x44, 0x43, 0x21, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x49, + 0xef, 0xff, 0xd8, 0x30, 0x0, 0x5, 0xaf, 0xfd, + 0x84, 0x6c, 0xff, 0xff, 0xff, 0xe9, 0x40, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x2, 0x59, 0xce, 0xff, 0xa5, 0x0, 0x0, 0x5a, + 0xff, 0xd8, 0x46, 0xcf, 0xff, 0xff, 0xfe, 0x94, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x28, 0xdf, 0xfa, 0x50, 0x0, + 0x5, 0xaf, 0xfd, 0x83, 0x59, 0xcc, 0xcc, 0xcc, + 0xb7, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x3, 0x8e, 0xff, 0xff, 0xa5, + 0x0, 0x0, 0x5a, 0xff, 0xeb, 0x87, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x9c, 0xff, 0xfc, + 0x94, 0x10, 0x0, 0x2, 0x6c, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xea, 0x51, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + + /* U+F244 "" */ + 0x0, 0x1, 0x35, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x65, 0x20, 0x0, + 0x0, 0x0, 0x4, 0x9f, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0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xc6, 0x20, 0x1, 0x5a, 0xef, 0xff, 0xff, + 0xff, 0xb6, 0x0, 0x0, 0x38, 0xef, 0xff, 0xff, + 0xfe, 0xb6, 0x20, 0x0, 0x1, 0x49, 0xdf, 0xff, + 0xff, 0xfb, 0x60, 0x0, 0x2, 0x7c, 0xff, 0xfe, + 0xb6, 0x22, 0x59, 0x84, 0x26, 0x97, 0x32, 0x5a, + 0xef, 0xff, 0xa5, 0x0, 0x0, 0x4, 0x9f, 0xff, + 0xec, 0xab, 0xdf, 0xfa, 0x41, 0x46, 0x42, 0x59, + 0xdf, 0xff, 0xd8, 0x20, 0x0, 0x0, 0x4, 0x9e, + 0xff, 0xff, 0xff, 0xff, 0xa4, 0x1, 0x5a, 0xdf, + 0xff, 0xff, 0xd8, 0x20, 0x0, 0x0, 0x0, 0x1, + 0x49, 0xdf, 0xff, 0xff, 0xfb, 0xaa, 0xdf, 0xff, + 0xff, 0xfd, 0x94, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x24, 0x68, 0x9a, 0xab, 0xbb, 0xa9, + 0x87, 0x52, 0x0, 0x0, 0x0, 0x0, 0x0, + + /* U+F2ED "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14, 0x67, + 0x88, 0x88, 0x87, 0x75, 0x20, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x37, 0xbb, 0xcc, 0xcc, 0xcc, + 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xed, 0xcc, + 0xcc, 0xcc, 0xb9, 0x51, 0x0, 0x37, 0xbb, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0xb9, 0x51, 0x0, 0x0, + 0x24, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x86, 0x30, 0x0, + 0x0, 0x0, 0x49, 0xef, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x61, 0x0, 0x0, 0x0, 0x49, 0xef, 0xff, 0xa5, + 0x5a, 0xff, 0xe9, 0x56, 0xbf, 0xfd, 0x85, 0x8d, + 0xff, 0xfc, 0x61, 0x0, 0x0, 0x0, 0x49, 0xef, + 0xff, 0xa4, 0x4a, 0xff, 0xe8, 0x46, 0xbf, 0xfc, + 0x74, 0x7c, 0xff, 0xfc, 0x61, 0x0, 0x0, 0x0, + 0x49, 0xef, 0xff, 0xa4, 0x4a, 0xff, 0xe8, 0x46, + 0xbf, 0xfc, 0x74, 0x7c, 0xff, 0xfc, 0x61, 0x0, + 0x0, 0x0, 0x49, 0xef, 0xff, 0xa4, 0x4a, 0xff, + 0xe8, 0x46, 0xbf, 0xfc, 0x74, 0x7c, 0xff, 0xfc, + 0x61, 0x0, 0x0, 0x0, 0x49, 0xef, 0xff, 0xa4, + 0x4a, 0xff, 0xe8, 0x46, 0xbf, 0xfc, 0x74, 0x7c, + 0xff, 0xfc, 0x61, 0x0, 0x0, 0x0, 0x49, 0xef, + 0xff, 0xa5, 0x5a, 0xff, 0xe9, 0x56, 0xbf, 0xfd, + 0x85, 0x8d, 0xff, 0xfc, 0x61, 0x0, 0x0, 0x0, + 0x38, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x60, 0x0, + 0x0, 0x0, 0x1, 0x36, 0x77, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x76, 0x42, + 0x0, 0x0, + + /* U+F304 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14, 0x67, + 0x63, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x2, 0x5a, 0xef, 0xff, 0xff, 0xd9, 0x41, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x11, 0x25, 0x9d, + 0xff, 0xff, 0xff, 0xff, 0xfc, 0x72, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x2, 0x5a, 0xef, 0xda, 0x53, 0x5a, 0xdf, 0xff, + 0xff, 0xfd, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x25, 0xae, 0xff, 0xff, + 0xff, 0xfd, 0xa5, 0x35, 0xad, 0xda, 0x52, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, + 0x5a, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xd8, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x25, 0xae, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xea, 0x52, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x5a, + 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, + 0xa5, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x25, 0xae, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xea, 0x52, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6, 0xbf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xa5, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x28, 0xdf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xea, 0x52, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x4a, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xa5, 0x20, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x13, 0x67, 0x76, + 0x55, 0x44, 0x21, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, + + /* U+F55A "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x15, 0x9c, + 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xec, 0x84, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x15, 0xad, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xa4, 0x0, 0x0, 0x0, 0x0, 0x15, 0xad, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x94, 0x1, + 0x49, 0xdf, 0xfd, 0x94, 0x10, 0x39, 0xdf, 0xff, + 0xff, 0xff, 0xfa, 0x50, 0x0, 0x0, 0x15, 0xad, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, + 0x94, 0x10, 0x1, 0x22, 0x10, 0x1, 0x49, 0xdf, + 0xff, 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, 0x39, + 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfb, 0x61, 0x0, 0x0, 0x15, 0xbf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x50, 0x0, + 0x0, 0x15, 0xad, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0x94, 0x10, 0x1, 0x33, 0x10, + 0x1, 0x49, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xa5, + 0x0, 0x0, 0x0, 0x0, 0x15, 0xad, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfd, 0x94, 0x11, 0x49, 0xdf, + 0xfd, 0x94, 0x10, 0x49, 0xdf, 0xff, 0xff, 0xff, + 0xfa, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, 0x15, + 0x9d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xa4, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x14, 0x9c, 0xef, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xec, 0x84, 0x0, 0x0, + + /* U+F7C2 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x14, 0x67, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x77, 0x64, 0x20, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x25, 0xad, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x83, + 0x0, 0x0, 0x0, 0x26, 0xbe, 0xff, 0xa4, 0x0, + 0x5b, 0xb6, 0x3, 0x9b, 0x72, 0x28, 0xdf, 0xfa, + 0x50, 0x0, 0x4, 0x9e, 0xff, 0xff, 0xfa, 0x40, + 0x5, 0xbb, 0x60, 0x39, 0xb7, 0x22, 0x8d, 0xff, + 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xfa, 0x50, 0x0, 0x5, 0xaf, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfa, 0x50, 0x0, 0x5, 0xaf, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfa, 0x50, 0x0, 0x5, 0xaf, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xa5, 0x0, 0x0, 0x5a, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfa, 0x50, 0x0, 0x2, 0x6c, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfc, 0x62, 0x0, 0x0, 0x0, + 0x1, 0x34, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x44, 0x31, 0x0, 0x0, 0x0, + + /* U+F8A2 "" */ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x12, 0x21, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x48, 0xdf, + 0xb6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x6a, + 0xc9, 0x51, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x27, 0xdf, 0xff, 0xb6, 0x0, 0x0, + 0x0, 0x0, 0x37, 0xce, 0xff, 0xfc, 0x72, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x28, + 0xdf, 0xff, 0xb6, 0x0, 0x0, 0x3, 0x8c, 0xff, + 0xff, 0xff, 0xff, 0xed, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xde, 0xff, 0xff, 0xb6, + 0x0, 0x0, 0x16, 0xbe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xa4, 0x0, 0x0, 0x0, + 0x2, 0x6b, 0xef, 0xff, 0xfc, 0x72, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x15, + 0xad, 0xfc, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0 +}; + + +/*--------------------- + * GLYPH DESCRIPTION + *--------------------*/ + +static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { + {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, + {.bitmap_index = 0, .adv_w = 52, .box_w = 6, .box_h = 0, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 0, .adv_w = 51, .box_w = 9, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 41, .adv_w = 75, .box_w = 15, .box_h = 4, .ofs_x = 0, .ofs_y = 5}, + {.bitmap_index = 71, .adv_w = 135, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 193, .adv_w = 119, .box_w = 24, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 349, .adv_w = 162, .box_w = 30, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 484, .adv_w = 132, .box_w = 27, .box_h = 10, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 619, .adv_w = 40, .box_w = 9, .box_h = 4, .ofs_x = 0, .ofs_y = 5}, + {.bitmap_index = 637, .adv_w = 65, .box_w = 12, .box_h = 13, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 715, .adv_w = 65, .box_w = 12, .box_h = 13, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 793, .adv_w = 77, .box_w = 18, .box_h = 5, .ofs_x = -1, .ofs_y = 5}, + {.bitmap_index = 838, .adv_w = 112, .box_w = 21, .box_h = 6, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 901, .adv_w = 44, .box_w = 9, .box_h = 4, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 919, .adv_w = 74, .box_w = 15, .box_h = 2, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 934, .adv_w = 44, .box_w = 9, .box_h = 2, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 943, .adv_w = 68, .box_w = 18, .box_h = 13, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 1060, .adv_w = 128, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1168, .adv_w = 71, .box_w = 15, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 1236, .adv_w = 110, .box_w = 24, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 1344, .adv_w = 110, .box_w = 24, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 1452, .adv_w = 128, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1574, .adv_w = 110, .box_w = 24, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 1682, .adv_w = 118, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1790, .adv_w = 115, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1898, .adv_w = 124, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2006, .adv_w = 118, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2114, .adv_w = 44, .box_w = 9, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2146, .adv_w = 44, .box_w = 9, .box_h = 9, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 2187, .adv_w = 112, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 2261, .adv_w = 112, .box_w = 21, .box_h = 5, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 2314, .adv_w = 112, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 2388, .adv_w = 110, .box_w = 24, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 2496, .adv_w = 199, .box_w = 39, .box_h = 12, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 2730, .adv_w = 141, .box_w = 33, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 2879, .adv_w = 145, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3001, .adv_w = 139, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3123, .adv_w = 159, .box_w = 30, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3258, .adv_w = 129, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3366, .adv_w = 122, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3474, .adv_w = 148, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3596, .adv_w = 156, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3718, .adv_w = 60, .box_w = 9, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3759, .adv_w = 98, .box_w = 21, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 3854, .adv_w = 138, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3976, .adv_w = 114, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 4084, .adv_w = 183, .box_w = 33, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 4233, .adv_w = 156, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 4355, .adv_w = 161, .box_w = 30, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 4490, .adv_w = 139, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 4612, .adv_w = 161, .box_w = 33, .box_h = 12, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 4810, .adv_w = 140, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 4932, .adv_w = 119, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 5040, .adv_w = 113, .box_w = 27, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 5162, .adv_w = 152, .box_w = 27, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 5284, .adv_w = 137, .box_w = 30, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 5419, .adv_w = 216, .box_w = 42, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 5608, .adv_w = 129, .box_w = 30, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 5743, .adv_w = 124, .box_w = 30, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 5878, .adv_w = 126, .box_w = 24, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 5986, .adv_w = 64, .box_w = 15, .box_h = 13, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 6084, .adv_w = 68, .box_w = 18, .box_h = 13, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 6201, .adv_w = 64, .box_w = 15, .box_h = 13, .ofs_x = -1, .ofs_y = -3}, + {.bitmap_index = 6299, .adv_w = 112, .box_w = 21, .box_h = 6, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 6362, .adv_w = 96, .box_w = 24, .box_h = 1, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 6374, .adv_w = 115, .box_w = 12, .box_h = 2, .ofs_x = 1, .ofs_y = 8}, + {.bitmap_index = 6386, .adv_w = 115, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 6460, .adv_w = 131, .box_w = 27, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 6595, .adv_w = 110, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 6669, .adv_w = 131, .box_w = 24, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 6789, .adv_w = 118, .box_w = 24, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 6873, .adv_w = 68, .box_w = 18, .box_h = 10, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 6963, .adv_w = 132, .box_w = 24, .box_h = 10, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 7083, .adv_w = 131, .box_w = 24, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 7203, .adv_w = 54, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 7248, .adv_w = 55, .box_w = 15, .box_h = 13, .ofs_x = -2, .ofs_y = -3}, + {.bitmap_index = 7346, .adv_w = 118, .box_w = 24, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 7466, .adv_w = 54, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 7511, .adv_w = 203, .box_w = 36, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 7637, .adv_w = 131, .box_w = 24, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 7721, .adv_w = 122, .box_w = 24, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 7805, .adv_w = 131, .box_w = 27, .box_h = 10, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 7940, .adv_w = 131, .box_w = 24, .box_h = 10, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 8060, .adv_w = 79, .box_w = 15, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 8113, .adv_w = 96, .box_w = 21, .box_h = 7, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 8187, .adv_w = 79, .box_w = 18, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 8268, .adv_w = 130, .box_w = 24, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 8352, .adv_w = 107, .box_w = 27, .box_h = 7, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 8447, .adv_w = 173, .box_w = 39, .box_h = 7, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 8584, .adv_w = 106, .box_w = 24, .box_h = 7, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 8668, .adv_w = 107, .box_w = 27, .box_h = 10, .ofs_x = -1, .ofs_y = -3}, + {.bitmap_index = 8803, .adv_w = 100, .box_w = 21, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 8877, .adv_w = 67, .box_w = 15, .box_h = 13, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 8975, .adv_w = 57, .box_w = 9, .box_h = 13, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 9034, .adv_w = 67, .box_w = 15, .box_h = 13, .ofs_x = -1, .ofs_y = -3}, + {.bitmap_index = 9132, .adv_w = 112, .box_w = 21, .box_h = 2, .ofs_x = 0, .ofs_y = 4}, + {.bitmap_index = 9153, .adv_w = 80, .box_w = 15, .box_h = 5, .ofs_x = 0, .ofs_y = 5}, + {.bitmap_index = 9191, .adv_w = 60, .box_w = 12, .box_h = 3, .ofs_x = 0, .ofs_y = 2}, + {.bitmap_index = 9209, .adv_w = 192, .box_w = 42, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 9482, .adv_w = 192, .box_w = 42, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 9671, .adv_w = 192, .box_w = 42, .box_h = 11, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 9902, .adv_w = 192, .box_w = 42, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 10091, .adv_w = 132, .box_w = 30, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 10226, .adv_w = 192, .box_w = 42, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 10499, .adv_w = 192, .box_w = 36, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 10733, .adv_w = 216, .box_w = 45, .box_h = 11, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 10981, .adv_w = 192, .box_w = 42, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 11254, .adv_w = 216, .box_w = 45, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 11457, .adv_w = 192, .box_w = 42, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 11730, .adv_w = 96, .box_w = 24, .box_h = 10, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 11850, .adv_w = 144, .box_w = 33, .box_h = 10, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 12015, .adv_w = 216, .box_w = 45, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 12308, .adv_w = 192, .box_w = 42, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 12497, .adv_w = 132, .box_w = 30, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 12692, .adv_w = 168, .box_w = 27, .box_h = 12, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 12854, .adv_w = 168, .box_w = 36, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 13088, .adv_w = 168, .box_w = 36, .box_h = 11, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 13286, .adv_w = 168, .box_w = 36, .box_h = 11, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 13484, .adv_w = 168, .box_w = 27, .box_h = 12, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 13646, .adv_w = 168, .box_w = 39, .box_h = 11, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 13861, .adv_w = 120, .box_w = 24, .box_h = 11, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 13993, .adv_w = 120, .box_w = 24, .box_h = 11, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 14125, .adv_w = 168, .box_w = 36, .box_h = 11, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 14323, .adv_w = 168, .box_w = 36, .box_h = 3, .ofs_x = -1, .ofs_y = 3}, + {.bitmap_index = 14377, .adv_w = 216, .box_w = 45, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 14580, .adv_w = 240, .box_w = 51, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 14912, .adv_w = 216, .box_w = 45, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 15205, .adv_w = 192, .box_w = 42, .box_h = 11, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 15436, .adv_w = 168, .box_w = 36, .box_h = 7, .ofs_x = -1, .ofs_y = 1}, + {.bitmap_index = 15562, .adv_w = 168, .box_w = 36, .box_h = 7, .ofs_x = -1, .ofs_y = 1}, + {.bitmap_index = 15688, .adv_w = 240, .box_w = 51, .box_h = 10, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 15943, .adv_w = 192, .box_w = 42, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 16132, .adv_w = 192, .box_w = 42, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 16405, .adv_w = 192, .box_w = 42, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 16678, .adv_w = 168, .box_w = 36, .box_h = 11, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 16876, .adv_w = 168, .box_w = 36, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 17110, .adv_w = 168, .box_w = 36, .box_h = 11, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 17308, .adv_w = 168, .box_w = 36, .box_h = 11, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 17506, .adv_w = 192, .box_w = 42, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 17695, .adv_w = 120, .box_w = 27, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 17871, .adv_w = 168, .box_w = 36, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 18105, .adv_w = 168, .box_w = 36, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 18339, .adv_w = 216, .box_w = 45, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 18542, .adv_w = 192, .box_w = 42, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 18815, .adv_w = 144, .box_w = 33, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 19030, .adv_w = 240, .box_w = 51, .box_h = 12, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 19336, .adv_w = 240, .box_w = 51, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 19566, .adv_w = 240, .box_w = 51, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 19796, .adv_w = 240, .box_w = 51, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 20026, .adv_w = 240, .box_w = 51, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 20256, .adv_w = 240, .box_w = 51, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 20486, .adv_w = 240, .box_w = 51, .box_h = 11, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 20767, .adv_w = 168, .box_w = 33, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 20982, .adv_w = 168, .box_w = 36, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 21216, .adv_w = 192, .box_w = 42, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 21489, .adv_w = 240, .box_w = 51, .box_h = 9, .ofs_x = -1, .ofs_y = 0}, + {.bitmap_index = 21719, .adv_w = 144, .box_w = 33, .box_h = 13, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 21934, .adv_w = 193, .box_w = 42, .box_h = 9, .ofs_x = -1, .ofs_y = 0} +}; + +/*--------------------- + * CHARACTER MAPPING + *--------------------*/ + +static const uint16_t unicode_list_1[] = { + 0x0, 0x1f72, 0xef51, 0xef58, 0xef5b, 0xef5c, 0xef5d, 0xef61, + 0xef63, 0xef65, 0xef69, 0xef6c, 0xef71, 0xef76, 0xef77, 0xef78, + 0xef8e, 0xef93, 0xef98, 0xef9b, 0xef9c, 0xef9d, 0xefa1, 0xefa2, + 0xefa3, 0xefa4, 0xefb7, 0xefb8, 0xefbe, 0xefc0, 0xefc1, 0xefc4, + 0xefc7, 0xefc8, 0xefc9, 0xefcb, 0xefe3, 0xefe5, 0xf014, 0xf015, + 0xf017, 0xf019, 0xf030, 0xf037, 0xf03a, 0xf043, 0xf06c, 0xf074, + 0xf0ab, 0xf13b, 0xf190, 0xf191, 0xf192, 0xf193, 0xf194, 0xf1d7, + 0xf1e3, 0xf23d, 0xf254, 0xf4aa, 0xf712, 0xf7f2 +}; + +/*Collect the unicode lists and glyph_id offsets*/ +static const lv_font_fmt_txt_cmap_t cmaps[] = { + { + .range_start = 32, .range_length = 95, .glyph_id_start = 1, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + }, + { + .range_start = 176, .range_length = 63475, .glyph_id_start = 96, + .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 62, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + } +}; + +/*----------------- + * KERNING + *----------------*/ + + +/*Map glyph_ids to kern left classes*/ +static const uint8_t kern_left_class_mapping[] = { + 0, 0, 1, 2, 0, 3, 4, 5, + 2, 6, 7, 8, 9, 10, 9, 10, + 11, 12, 0, 13, 14, 15, 16, 17, + 18, 19, 12, 20, 20, 0, 0, 0, + 21, 22, 23, 24, 25, 22, 26, 27, + 28, 29, 29, 30, 31, 32, 29, 29, + 22, 33, 34, 35, 3, 36, 30, 37, + 37, 38, 39, 40, 41, 42, 43, 0, + 44, 0, 45, 46, 47, 48, 49, 50, + 51, 45, 52, 52, 53, 48, 45, 45, + 46, 46, 54, 55, 56, 57, 51, 58, + 58, 59, 58, 60, 41, 0, 0, 9, + 61, 9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 +}; + +/*Map glyph_ids to kern right classes*/ +static const uint8_t kern_right_class_mapping[] = { + 0, 0, 1, 2, 0, 3, 4, 5, + 2, 6, 7, 8, 9, 10, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 12, + 18, 19, 20, 21, 21, 0, 0, 0, + 22, 23, 24, 25, 23, 25, 25, 25, + 23, 25, 25, 26, 25, 25, 25, 25, + 23, 25, 23, 25, 3, 27, 28, 29, + 29, 30, 31, 32, 33, 34, 35, 0, + 36, 0, 37, 38, 39, 39, 39, 0, + 39, 38, 40, 41, 38, 38, 42, 42, + 39, 42, 39, 42, 43, 44, 45, 46, + 46, 47, 46, 48, 0, 0, 35, 9, + 49, 9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 +}; + +/*Kern values between classes*/ +static const int8_t kern_class_values[] = { + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 2, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 9, 0, 5, -4, 0, 0, + 0, 0, -11, -12, 1, 9, 4, 3, + -8, 1, 9, 1, 8, 2, 6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 12, 2, -1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4, 0, -6, 0, 0, 0, 0, + 0, -4, 3, 4, 0, 0, -2, 0, + -1, 2, 0, -2, 0, -2, -1, -4, + 0, 0, 0, 0, -2, 0, 0, -2, + -3, 0, 0, -2, 0, -4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -2, + -2, 0, -3, 0, -5, 0, -23, 0, + 0, -4, 0, 4, 6, 0, 0, -4, + 2, 2, 6, 4, -3, 4, 0, 0, + -11, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -5, -2, -9, 0, -8, + -1, 0, 0, 0, 0, 0, 7, 0, + -6, -2, -1, 1, 0, -3, 0, 0, + -1, -14, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -15, -2, 7, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 6, + 0, 2, 0, 0, -4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 7, 2, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, + 4, 2, 6, -2, 0, 0, 4, -2, + -6, -26, 1, 5, 4, 0, -2, 0, + 7, 0, 6, 0, 6, 0, -18, 0, + -2, 6, 0, 6, -2, 4, 2, 0, + 0, 1, -2, 0, 0, -3, 15, 0, + 15, 0, 6, 0, 8, 2, 3, 6, + 0, 0, 0, -7, 0, 0, 0, 0, + 1, -1, 0, 1, -3, -2, -4, 1, + 0, -2, 0, 0, 0, -8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -12, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, -11, 0, -12, 0, 0, 0, + 0, -1, 0, 19, -2, -2, 2, 2, + -2, 0, -2, 2, 0, 0, -10, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -19, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -12, 0, 12, 0, 0, -7, 0, + 6, 0, -13, -19, -13, -4, 6, 0, + 0, -13, 0, 2, -4, 0, -3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 5, 6, -23, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 9, 0, 1, 0, 0, 0, + 0, 0, 1, 1, -2, -4, 0, -1, + -1, -2, 0, 0, -1, 0, 0, 0, + -4, 0, -2, 0, -4, -4, 0, -5, + -6, -6, -4, 0, -4, 0, -4, 0, + 0, 0, 0, -2, 0, 0, 2, 0, + 1, -2, 0, 1, 0, 0, 0, 2, + -1, 0, 0, 0, -1, 2, 2, -1, + 0, 0, 0, -4, 0, -1, 0, 0, + 0, 0, 0, 1, 0, 2, -1, 0, + -2, 0, -3, 0, 0, -1, 0, 6, + 0, 0, -2, 0, 0, 0, 0, 0, + -1, 1, -1, -1, 0, 0, -2, 0, + -2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -1, -1, 0, -2, -2, 0, + 0, 0, 0, 0, 1, 0, 0, -1, + 0, -2, -2, -2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -1, 0, 0, + 0, 0, -1, -2, 0, -3, 0, -6, + -1, -6, 4, 0, 0, -4, 2, 4, + 5, 0, -5, -1, -2, 0, -1, -9, + 2, -1, 1, -10, 2, 0, 0, 1, + -10, 0, -10, -2, -17, -1, 0, -10, + 0, 4, 5, 0, 2, 0, 0, 0, + 0, 0, 0, -3, -2, 0, -6, 0, + 0, 0, -2, 0, 0, 0, -2, 0, + 0, 0, 0, 0, -1, -1, 0, -1, + -2, 0, 0, 0, 0, 0, 0, 0, + -2, -2, 0, -1, -2, -2, 0, 0, + -2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, -2, 0, -2, + 0, -1, 0, -4, 2, 0, 0, -2, + 1, 2, 2, 0, 0, 0, 0, 0, + 0, -1, 0, 0, 0, 0, 0, 1, + 0, 0, -2, 0, -2, -1, -2, 0, + 0, 0, 0, 0, 0, 0, 2, 0, + -2, 0, 0, 0, 0, -2, -3, 0, + -4, 0, 6, -1, 1, -6, 0, 0, + 5, -10, -10, -8, -4, 2, 0, -2, + -12, -3, 0, -3, 0, -4, 3, -3, + -12, 0, -5, 0, 0, 1, -1, 2, + -1, 0, 2, 0, -6, -7, 0, -10, + -5, -4, -5, -6, -2, -5, 0, -4, + -5, 1, 0, 1, 0, -2, 0, 0, + 0, 1, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -2, + 0, -1, 0, -1, -2, 0, -3, -4, + -4, -1, 0, -6, 0, 0, 0, 0, + 0, 0, -2, 0, 0, 0, 0, 1, + -1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 9, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, + -2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -3, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -1, 0, 0, 0, + -4, 0, 0, 0, 0, -10, -6, 0, + 0, 0, -3, -10, 0, 0, -2, 2, + 0, -5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -3, 0, 0, -4, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, -3, 0, + 0, 0, 0, 2, 0, 1, -4, -4, + 0, -2, -2, -2, 0, 0, 0, 0, + 0, 0, -6, 0, -2, 0, -3, -2, + 0, -4, -5, -6, -2, 0, -4, 0, + -6, 0, 0, 0, 0, 15, 0, 0, + 1, 0, 0, -2, 0, 2, 0, -8, + 0, 0, 0, 0, 0, -18, -3, 6, + 6, -2, -8, 0, 2, -3, 0, -10, + -1, -2, 2, -13, -2, 2, 0, 3, + -7, -3, -7, -6, -8, 0, 0, -12, + 0, 11, 0, 0, -1, 0, 0, 0, + -1, -1, -2, -5, -6, 0, -18, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -2, 0, -1, -2, -3, 0, 0, + -4, 0, -2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -1, 0, -4, 0, 0, 4, + -1, 2, 0, -4, 2, -1, -1, -5, + -2, 0, -2, -2, -1, 0, -3, -3, + 0, 0, -2, -1, -1, -3, -2, 0, + 0, -2, 0, 2, -1, 0, -4, 0, + 0, 0, -4, 0, -3, 0, -3, -3, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, -4, 2, 0, -3, 0, -1, -2, + -6, -1, -1, -1, -1, -1, -2, -1, + 0, 0, 0, 0, 0, -2, -2, -2, + 0, 0, 0, 0, 2, -1, 0, -1, + 0, 0, 0, -1, -2, -1, -2, -2, + -2, 0, 2, 8, -1, 0, -5, 0, + -1, 4, 0, -2, -8, -2, 3, 0, + 0, -9, -3, 2, -3, 1, 0, -1, + -2, -6, 0, -3, 1, 0, 0, -3, + 0, 0, 0, 2, 2, -4, -4, 0, + -3, -2, -3, -2, -2, 0, -3, 1, + -4, -3, 6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -2, -2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -3, 0, 0, -2, + 0, 0, -2, -2, 0, 0, 0, 0, + -2, 0, 0, 0, 0, -1, 0, 0, + 0, 0, 0, -1, 0, 0, 0, 0, + -3, 0, -4, 0, 0, 0, -6, 0, + 1, -4, 4, 0, -1, -9, 0, 0, + -4, -2, 0, -8, -5, -5, 0, 0, + -8, -2, -8, -7, -9, 0, -5, 0, + 2, 13, -2, 0, -4, -2, -1, -2, + -3, -5, -3, -7, -8, -4, -2, 0, + 0, -1, 0, 1, 0, 0, -13, -2, + 6, 4, -4, -7, 0, 1, -6, 0, + -10, -1, -2, 4, -18, -2, 1, 0, + 0, -12, -2, -10, -2, -14, 0, 0, + -13, 0, 11, 1, 0, -1, 0, 0, + 0, 0, -1, -1, -7, -1, 0, -12, + 0, 0, 0, 0, -6, 0, -2, 0, + -1, -5, -9, 0, 0, -1, -3, -6, + -2, 0, -1, 0, 0, 0, 0, -9, + -2, -6, -6, -2, -3, -5, -2, -3, + 0, -4, -2, -6, -3, 0, -2, -4, + -2, -4, 0, 1, 0, -1, -6, 0, + 4, 0, -3, 0, 0, 0, 0, 2, + 0, 1, -4, 8, 0, -2, -2, -2, + 0, 0, 0, 0, 0, 0, -6, 0, + -2, 0, -3, -2, 0, -4, -5, -6, + -2, 0, -4, 2, 8, 0, 0, 0, + 0, 15, 0, 0, 1, 0, 0, -2, + 0, 2, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -1, -4, 0, 0, 0, 0, 0, -1, + 0, 0, 0, -2, -2, 0, 0, -4, + -2, 0, 0, -4, 0, 3, -1, 0, + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 3, 4, 2, -2, 0, -6, + -3, 0, 6, -6, -6, -4, -4, 8, + 3, 2, -17, -1, 4, -2, 0, -2, + 2, -2, -7, 0, -2, 2, -2, -2, + -6, -2, 0, 0, 6, 4, 0, -5, + 0, -11, -2, 6, -2, -7, 1, -2, + -6, -6, -2, 8, 2, 0, -3, 0, + -5, 0, 2, 6, -4, -7, -8, -5, + 6, 0, 1, -14, -2, 2, -3, -1, + -4, 0, -4, -7, -3, -3, -2, 0, + 0, -4, -4, -2, 0, 6, 4, -2, + -11, 0, -11, -3, 0, -7, -11, -1, + -6, -3, -6, -5, 5, 0, 0, -2, + 0, -4, -2, 0, -2, -3, 0, 3, + -6, 2, 0, 0, -10, 0, -2, -4, + -3, -1, -6, -5, -6, -4, 0, -6, + -2, -4, -4, -6, -2, 0, 0, 1, + 9, -3, 0, -6, -2, 0, -2, -4, + -4, -5, -5, -7, -2, -4, 4, 0, + -3, 0, -10, -2, 1, 4, -6, -7, + -4, -6, 6, -2, 1, -18, -3, 4, + -4, -3, -7, 0, -6, -8, -2, -2, + -2, -2, -4, -6, -1, 0, 0, 6, + 5, -1, -12, 0, -12, -4, 5, -7, + -13, -4, -7, -8, -10, -6, 4, 0, + 0, 0, 0, -2, 0, 0, 2, -2, + 4, 1, -4, 4, 0, 0, -6, -1, + 0, -1, 0, 1, 1, -2, 0, 0, + 0, 0, 0, 0, -2, 0, 0, 0, + 0, 2, 6, 0, 0, -2, 0, 0, + 0, 0, -1, -1, -2, 0, 0, 0, + 1, 2, 0, 0, 0, 0, 2, 0, + -2, 0, 7, 0, 3, 1, 1, -2, + 0, 4, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 0, 5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -12, 0, -2, 3, 0, 6, + 0, 0, 19, 2, -4, -4, 2, 2, + -1, 1, -10, 0, 0, 9, -12, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -13, 7, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -12, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -3, 0, 0, -4, + -2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -1, 0, -5, 0, + 0, 1, 0, 0, 2, 25, -4, -2, + 6, 5, -5, 2, 0, 0, 2, 2, + -2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -25, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -5, + 0, 0, 0, -5, 0, 0, 0, 0, + -4, -1, 0, 0, 0, -4, 0, -2, + 0, -9, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -13, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, -2, 0, 0, -4, 0, -3, 0, + -5, 0, 0, 0, -3, 2, -2, 0, + 0, -5, -2, -4, 0, 0, -5, 0, + -2, 0, -9, 0, -2, 0, 0, -16, + -4, -8, -2, -7, 0, 0, -13, 0, + -5, -1, 0, 0, 0, 0, 0, 0, + 0, 0, -3, -3, -2, -3, 0, 0, + 0, 0, -4, 0, -4, 2, -2, 4, + 0, -1, -4, -1, -3, -4, 0, -2, + -1, -1, 1, -5, -1, 0, 0, 0, + -17, -2, -3, 0, -4, 0, -1, -9, + -2, 0, 0, -1, -2, 0, 0, 0, + 0, 1, 0, -1, -3, -1, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, 0, 0, + 0, -4, 0, -1, 0, 0, 0, -4, + 2, 0, 0, 0, -5, -2, -4, 0, + 0, -5, 0, -2, 0, -9, 0, 0, + 0, 0, -19, 0, -4, -7, -10, 0, + 0, -13, 0, -1, -3, 0, 0, 0, + 0, 0, 0, 0, 0, -2, -3, -1, + -3, 1, 0, 0, 3, -2, 0, 6, + 9, -2, -2, -6, 2, 9, 3, 4, + -5, 2, 8, 2, 6, 4, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 12, 9, -3, -2, 0, -2, + 15, 8, 15, 0, 0, 0, 2, 0, + 0, 7, 0, 0, -3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -1, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 0, 0, 0, 0, -16, -2, -2, -8, + -9, 0, 0, -13, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -1, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, -16, -2, -2, + -8, -9, 0, 0, -8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -2, 0, 0, 0, -4, 2, 0, -2, + 2, 3, 2, -6, 0, 0, -2, 2, + 0, 2, 0, 0, 0, 0, -5, 0, + -2, -1, -4, 0, -2, -8, 0, 12, + -2, 0, -4, -1, 0, -1, -3, 0, + -2, -5, -4, -2, 0, 0, 0, -3, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, 0, -16, + -2, -2, -8, -9, 0, 0, -13, 0, + 0, 0, 0, 0, 0, 10, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -3, 0, -6, -2, -2, 6, -2, -2, + -8, 1, -1, 1, -1, -5, 0, 4, + 0, 2, 1, 2, -5, -8, -2, 0, + -7, -4, -5, -8, -7, 0, -3, -4, + -2, -2, -2, -1, -2, -1, 0, -1, + -1, 3, 0, 3, -1, 0, 6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -1, -2, -2, 0, 0, + -5, 0, -1, 0, -3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -2, -2, 0, -2, + 0, 0, 0, 0, -2, 0, 0, -3, + -2, 2, 0, -3, -4, -1, 0, -6, + -1, -4, -1, -2, 0, -3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -13, 0, 6, 0, 0, -3, 0, + 0, 0, 0, -2, 0, -2, 0, 0, + -1, 0, 0, -1, 0, -4, 0, 0, + 8, -2, -6, -6, 1, 2, 2, 0, + -5, 1, 3, 1, 6, 1, 6, -1, + -5, 0, 0, -8, 0, 0, -6, -5, + 0, 0, -4, 0, -2, -3, 0, -3, + 0, -3, 0, -1, 3, 0, -2, -6, + -2, 7, 0, 0, -2, 0, -4, 0, + 0, 2, -4, 0, 2, -2, 2, 0, + 0, -6, 0, -1, -1, 0, -2, 2, + -2, 0, 0, 0, -8, -2, -4, 0, + -6, 0, 0, -9, 0, 7, -2, 0, + -3, 0, 1, 0, -2, 0, -2, -6, + 0, -2, 2, 0, 0, 0, 0, -1, + 0, 0, 2, -2, 1, 0, 0, -2, + -1, 0, -2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -12, 0, 4, 0, + 0, -2, 0, 0, 0, 0, 0, 0, + -2, -2, 0, 0, 0, 4, 0, 4, + 0, 0, 0, 0, 0, -12, -11, 1, + 8, 6, 3, -8, 1, 8, 0, 7, + 0, 4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 10, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0 +}; + + +/*Collect the kern class' data in one place*/ +static const lv_font_fmt_txt_kern_classes_t kern_classes = { + .class_pair_values = kern_class_values, + .left_class_mapping = kern_left_class_mapping, + .right_class_mapping = kern_right_class_mapping, + .left_class_cnt = 61, + .right_class_cnt = 49, +}; + +/*-------------------- + * ALL CUSTOM DATA + *--------------------*/ + +#if LV_VERSION_CHECK(8, 0, 0) +/*Store all the custom data of the font*/ +static lv_font_fmt_txt_glyph_cache_t cache; +static const lv_font_fmt_txt_dsc_t font_dsc = { +#else +static lv_font_fmt_txt_dsc_t font_dsc = { +#endif + .glyph_bitmap = glyph_bitmap, + .glyph_dsc = glyph_dsc, + .cmaps = cmaps, + .kern_dsc = &kern_classes, + .kern_scale = 16, + .cmap_num = 2, + .bpp = 4, + .kern_classes = 1, + .bitmap_format = 0, +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif +}; + + +/*----------------- + * PUBLIC FONT + *----------------*/ + +/*Initialize a public general font descriptor*/ +#if LV_VERSION_CHECK(8, 0, 0) +const lv_font_t lv_font_montserrat_12_subpx = { +#else +lv_font_t lv_font_montserrat_12_subpx = { +#endif + .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ + .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ + .line_height = 15, /*The maximum line height required by the font*/ + .base_line = 3, /*Baseline measured from the bottom of the line*/ +#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) + .subpx = LV_FONT_SUBPX_HOR, +#endif +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 + .underline_position = -1, + .underline_thickness = 1, +#endif + .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ +}; + + + +#endif /*#if LV_FONT_MONTSERRAT_12_SUBPX*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_14.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_14.c index 2ba984e..cc4da95 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_14.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_14.c @@ -1510,6 +1510,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -1706,6 +1707,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -2132,6 +2134,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -2145,9 +2148,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -2161,15 +2164,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_14 = { #else lv_font_t lv_font_montserrat_14 = { @@ -2188,4 +2194,7 @@ lv_font_t lv_font_montserrat_14 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_14*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_16.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_16.c index 36cdea4..2b0dccf 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_16.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_16.c @@ -1779,6 +1779,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -1975,6 +1976,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -2401,6 +2403,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -2414,9 +2417,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -2430,15 +2433,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_16 = { #else lv_font_t lv_font_montserrat_16 = { @@ -2457,4 +2463,7 @@ lv_font_t lv_font_montserrat_16 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_16*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_18.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_18.c index de73390..c2e5d1d 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_18.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_18.c @@ -2179,6 +2179,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -2375,6 +2376,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -2801,6 +2803,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -2814,9 +2817,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -2830,15 +2833,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_18 = { #else lv_font_t lv_font_montserrat_18 = { @@ -2857,4 +2863,7 @@ lv_font_t lv_font_montserrat_18 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_18*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_20.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_20.c index de7e49d..bf11639 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_20.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_20.c @@ -2536,6 +2536,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -2732,6 +2733,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -3158,6 +3160,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -3171,9 +3174,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -3187,15 +3190,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_20 = { #else lv_font_t lv_font_montserrat_20 = { @@ -3214,4 +3220,7 @@ lv_font_t lv_font_montserrat_20 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_20*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_22.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_22.c index 3390743..d96a666 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_22.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_22.c @@ -2965,6 +2965,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -3161,6 +3162,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -3587,6 +3589,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -3600,9 +3603,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -3616,15 +3619,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_22 = { #else lv_font_t lv_font_montserrat_22 = { @@ -3643,4 +3649,7 @@ lv_font_t lv_font_montserrat_22 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_22*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_24.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_24.c index ffb9c83..9795f70 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_24.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_24.c @@ -3376,6 +3376,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -3572,6 +3573,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -3998,6 +4000,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -4011,9 +4014,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -4027,15 +4030,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_24 = { #else lv_font_t lv_font_montserrat_24 = { @@ -4054,4 +4060,7 @@ lv_font_t lv_font_montserrat_24 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_24*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_26.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_26.c index 93d4f71..416d840 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_26.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_26.c @@ -3911,6 +3911,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -4107,6 +4108,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -4533,6 +4535,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -4546,9 +4549,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -4562,15 +4565,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_26 = { #else lv_font_t lv_font_montserrat_26 = { @@ -4589,4 +4595,7 @@ lv_font_t lv_font_montserrat_26 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_26*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_28.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_28.c index a186747..0ae2d7e 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_28.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_28.c @@ -4460,6 +4460,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -4656,6 +4657,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -5082,6 +5084,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -5095,9 +5098,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -5111,14 +5114,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_28 = { #else lv_font_t lv_font_montserrat_28 = { @@ -5137,4 +5144,7 @@ lv_font_t lv_font_montserrat_28 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_28*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_28_compressed.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_28_compressed.c index 170ab48..4612584 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_28_compressed.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_28_compressed.c @@ -2590,6 +2590,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xff, 0x3a, 0xba, 0x40, 0x3f, 0xf9, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -2786,6 +2787,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -3212,6 +3214,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -3225,9 +3228,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -3241,15 +3244,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 1, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_28_compressed = { #else lv_font_t lv_font_montserrat_28_compressed = { @@ -3268,4 +3274,7 @@ lv_font_t lv_font_montserrat_28_compressed = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_28_COMPRESSED*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_30.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_30.c index 30e48eb..f5532b3 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_30.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_30.c @@ -5042,6 +5042,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -5238,6 +5239,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -5664,6 +5666,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -5677,9 +5680,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -5693,15 +5696,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_30 = { #else lv_font_t lv_font_montserrat_30 = { @@ -5720,4 +5726,7 @@ lv_font_t lv_font_montserrat_30 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_30*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_32.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_32.c index a12a49c..f4dad0c 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_32.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_32.c @@ -5531,6 +5531,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -5727,6 +5728,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -6153,6 +6155,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -6166,9 +6169,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -6182,15 +6185,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_32 = { #else lv_font_t lv_font_montserrat_32 = { @@ -6209,4 +6215,7 @@ lv_font_t lv_font_montserrat_32 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_32*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_34.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_34.c index 7577c73..064bb0a 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_34.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_34.c @@ -6330,6 +6330,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -6526,6 +6527,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -6952,6 +6954,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -6965,9 +6968,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -6981,15 +6984,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_34 = { #else lv_font_t lv_font_montserrat_34 = { @@ -7008,4 +7014,7 @@ lv_font_t lv_font_montserrat_34 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_34*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_36.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_36.c index f5ef2ec..e5b2b68 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_36.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_36.c @@ -6974,6 +6974,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -7170,6 +7171,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -7596,6 +7598,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -7609,9 +7612,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -7625,15 +7628,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_36 = { #else lv_font_t lv_font_montserrat_36 = { @@ -7652,4 +7658,7 @@ lv_font_t lv_font_montserrat_36 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_36*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_38.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_38.c index 992b5c6..883eae5 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_38.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_38.c @@ -7719,6 +7719,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -7915,6 +7916,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -8341,6 +8343,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -8354,9 +8357,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -8370,15 +8373,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_38 = { #else lv_font_t lv_font_montserrat_38 = { @@ -8397,4 +8403,7 @@ lv_font_t lv_font_montserrat_38 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_38*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_40.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_40.c index 36c7d31..0769235 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_40.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_40.c @@ -8567,6 +8567,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -8763,6 +8764,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -9189,6 +9191,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -9202,9 +9205,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -9218,15 +9221,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_40 = { #else lv_font_t lv_font_montserrat_40 = { @@ -9245,4 +9251,7 @@ lv_font_t lv_font_montserrat_40 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_40*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_42.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_42.c index 71fdd93..a656393 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_42.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_42.c @@ -9409,6 +9409,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -9605,6 +9606,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -10031,6 +10033,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -10044,9 +10047,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -10060,15 +10063,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_42 = { #else lv_font_t lv_font_montserrat_42 = { @@ -10087,4 +10093,7 @@ lv_font_t lv_font_montserrat_42 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_42*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_44.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_44.c index 0707153..4156909 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_44.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_44.c @@ -10235,6 +10235,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -10431,6 +10432,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -10857,6 +10859,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -10870,9 +10873,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -10886,15 +10889,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_44 = { #else lv_font_t lv_font_montserrat_44 = { @@ -10913,4 +10919,7 @@ lv_font_t lv_font_montserrat_44 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_44*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_46.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_46.c index 48fa687..745b42c 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_46.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_46.c @@ -11187,6 +11187,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -11383,6 +11384,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -11809,6 +11811,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -11822,9 +11825,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -11838,15 +11841,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_46 = { #else lv_font_t lv_font_montserrat_46 = { @@ -11865,4 +11871,7 @@ lv_font_t lv_font_montserrat_46 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_46*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_48.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_48.c index 1f731ac..9961b83 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_48.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_48.c @@ -11888,6 +11888,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -12084,6 +12085,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -12510,6 +12512,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -12523,9 +12526,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -12539,15 +12542,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_48 = { #else lv_font_t lv_font_montserrat_48 = { @@ -12566,4 +12572,7 @@ lv_font_t lv_font_montserrat_48 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_48*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_8.c b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_8.c index 6985792..3903332 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_montserrat_8.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_montserrat_8.c @@ -759,6 +759,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -955,6 +956,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { * KERNING *----------------*/ + /*Map glyph_ids to kern left classes*/ static const uint8_t kern_left_class_mapping[] = { 0, 0, 1, 2, 0, 3, 4, 5, @@ -1381,6 +1383,7 @@ static const int8_t kern_class_values[] = { 0, 0, 0, 0, 0 }; + /*Collect the kern class' data in one place*/ static const lv_font_fmt_txt_kern_classes_t kern_classes = { .class_pair_values = kern_class_values, @@ -1394,9 +1397,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes = { * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -1410,15 +1413,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 1, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_montserrat_8 = { #else lv_font_t lv_font_montserrat_8 = { @@ -1437,4 +1443,7 @@ lv_font_t lv_font_montserrat_8 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_MONTSERRAT_8*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_simsun_14_cjk.c b/L3_Middlewares/LVGL/src/font/lv_font_simsun_14_cjk.c deleted file mode 100644 index 4cd687f..0000000 --- a/L3_Middlewares/LVGL/src/font/lv_font_simsun_14_cjk.c +++ /dev/null @@ -1,20783 +0,0 @@ -/******************************************************************************* - * Size: 14 px - * Bpp: 4 - * Opts: --no-compress --no-prefilter --bpp 4 --size 14 --font SimSun.woff -r 0x20-0x7f --symbols (),盗提陽帯鼻画輕ッ冊ェル写父ぁフ結想正四O夫源庭場天續鳥れ講猿苦階給了製守8祝己妳薄泣塩帰ぺ吃変輪那着仍嗯爭熱創味保字宿捨準查達肯ァ薬得査障該降察ね網加昼料等図邪秋コ態品屬久原殊候路願楽確針上被怕悲風份重歡っ附ぷ既4黨價娘朝凍僅際洋止右航よ专角應酸師個比則響健昇豐筆歷適修據細忙跟管長令家ザ期般花越ミ域泳通些油乏ラ。營ス返調農叫樹刊愛間包知把ヤ貧橋拡普聞前ジ建当繰ネ送習渇用補ィ覺體法遊宙ョ酔余利壊語くつ払皆時辺追奇そ們只胸械勝住全沈力光ん深溝二類北面社值試9和五勵ゃ貿幾逐打課ゲて領3鼓辦発評1渉詳暇込计駄供嘛郵頃腦反構絵お容規借身妻国慮剛急乗静必議置克土オ乎荷更肉還混古渡授合主離條値決季晴東大尚央州が嗎験流先医亦林田星晩拿60旅婦量為痛テ孫う環友況玩務其ぼち揺坐一肩腰犯タょ希即果ぶ物練待み高九找やヶ都グ去」サ、气仮雑酒許終企笑録形リ銀切ギ快問滿役単黄集森毎實研喜蘇司鉛洲川条媽ノ才兩話言雖媒出客づ卻現異故り誌逮同訊已視本題ぞを横開音第席費持眾怎選元退限ー賽処喝就残無いガ多ケ沒義遠歌隣錢某雪析嬉採自透き側員予ゼ白婚电へ顯呀始均畫似懸格車騒度わ親店週維億締慣免帳電甚來園浴ゅ愈京と杯各海怒ぜ排敗挙老買7極模実紀ヒ携隻告シ並屋這孩讓質ワブ富賃争康由辞マ火於短樣削弟材注節另室ダ招擁ぃ若套底波行勤關著泊背疲狭作念推ぐ民貸祖介說ビ代温契你我レ入描變再札ソ派頭智遅私聽舉灣山伸放直安ト誕煙付符幅ふ絡她届耳飲忘参革團仕様載ど歩獲嫌息の汚交興魚指資雙與館初学年幸史位柱族走括び考青也共腕Lで販擔理病イ今逃當寺猫邊菓係ム秘示解池影ド文例斷曾事茶寫明科桃藝売便え導禁財飛替而亡到し具空寝辛業ウ府セ國何基菜厳市努張缺雲根外だ断万砂ゴ超使台实ぽ礼最慧算軟界段律像夕丈窓助刻月夏政呼ぴざ擇趣除動従涼方勉名線対存請子氏將5少否諸論美感或西者定食御表は參歳緑命進易性錯房も捕皿判中觀戦ニ緩町ピ番ず金千ろ?不た象治関ャ每看徒卒統じ手範訪押座步号ベ旁以母すほ密減成往歲件緒読歯效院种七謂凝濃嵌震喉繼クュ拭死円2積水欲如ポにさ寒道區精啦姐ア聯能足及停思壓2春且メ裏株官答概黒過氷柿戻厚ぱ党祭織引計け委暗複誘港バ失下村較続神ぇ尤強秀膝兒来績十書済化服破新廠1紹您情半式產系好教暑早め樂地休協良な哪常要揮周かエ麗境働避護ンツ香夜太見設非改広聲他検求危清彼經未在起葉控靴所差內造寄南望尺換向展備眠點完約ぎ裡分説申童優伝島机須塊日立拉,鉄軽單気信很転識支布数紙此迎受心輸坊モ處「訳三曇兄野顔戰增ナ伊列又髪両有取左毛至困吧昔赤狀相夠整別士経頼然簡ホ会發隨営需脱ヨば接永居冬迫圍甘醫誰部充消連弱宇會咲覚姉麼的増首统帶糖朋術商担移景功育庫曲總劃牛程駅犬報ロ學責因パ嚴八世後平負公げ曜陸專午之閉ぬ談ご災昨冷職悪謝對它近射敢意運船臉局難什産頗!球真記ま但蔵究制機案湖臺ひ害券男留内木驗雨施種特復句末濟キ色訴依せ百型る石牠討呢时任執飯歐宅組傳配小活ゆべ暖ズ漸站素らボ束価チ浅回女片独妹英目從認生違策僕楚ペ米こ掛む爸六状落漢プ投カ校做啊洗声探あ割体項履触々訓技ハ低工映是標速善点人デ口次可廿节宵植树端阳旦腊妇费愚劳动儿军师庆圣诞闰 --font FontAwesome5-Solid+Brands+Regular.woff -r 61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61507,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61641,61664,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650 --format lvgl -o lv_font_simsun_14_cjk.c --force-fast-kern-format - ******************************************************************************/ - -#ifdef LV_LVGL_H_INCLUDE_SIMPLE - #include "lvgl.h" -#else - #include "../../lvgl.h" -#endif - -#ifndef LV_FONT_SIMSUN_14_CJK - #define LV_FONT_SIMSUN_14_CJK 1 -#endif - -#if LV_FONT_SIMSUN_14_CJK - -/*----------------- - * BITMAPS - *----------------*/ - -/*Store the image of the glyphs*/ -static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { - /* U+0020 " " */ - - /* U+0021 "!" */ - 0x1d, 0x2, 0xf0, 0xe, 0x0, 0xc0, 0xa, 0x0, - 0x80, 0x5, 0x0, 0x0, 0x18, 0x2, 0xe1, - - /* U+0022 "\"" */ - 0x0, 0x89, 0x5b, 0x1, 0xe3, 0xd5, 0x8, 0x45, - 0x60, 0x4, 0x4, 0x0, - - /* U+0023 "#" */ - 0x0, 0x70, 0x7, 0x0, 0x7, 0x0, 0x70, 0x7f, - 0xff, 0xff, 0x71, 0x46, 0x24, 0x61, 0x4, 0x30, - 0x43, 0x0, 0x52, 0x5, 0x20, 0x7f, 0xff, 0xff, - 0x71, 0x92, 0x28, 0x21, 0x7, 0x0, 0x70, 0x0, - 0x70, 0x7, 0x0, - - /* U+0024 "$" */ - 0x0, 0x4, 0x0, 0x0, 0x8, 0x0, 0x1, 0x8b, - 0x82, 0x9, 0x28, 0x4a, 0xc, 0x28, 0x46, 0x6, - 0xc9, 0x0, 0x0, 0x8f, 0x30, 0x0, 0xa, 0xe2, - 0x0, 0x8, 0x6a, 0xd, 0x28, 0xc, 0xe, 0x8, - 0x19, 0x4, 0x7b, 0x71, 0x0, 0x8, 0x0, 0x0, - 0x4, 0x0, - - /* U+0025 "%" */ - 0x0, 0x0, 0x2, 0x4, 0x76, 0x3, 0x40, 0xa0, - 0x90, 0x70, 0xb, 0x9, 0x16, 0x0, 0x90, 0xa5, - 0x10, 0x1, 0x64, 0x64, 0x60, 0x0, 0x15, 0x93, - 0x60, 0x6, 0x37, 0x9, 0x0, 0x64, 0x70, 0xa0, - 0x32, 0x18, 0x28, 0x5, 0x0, 0x78, 0x10, - - /* U+0026 "&" */ - 0x3, 0x79, 0x0, 0x0, 0xa0, 0x83, 0x0, 0xb, - 0x9, 0x20, 0x0, 0xa5, 0x80, 0x0, 0x8, 0xa0, - 0x78, 0x14, 0x6d, 0x4, 0x40, 0xb0, 0x95, 0x51, - 0xc, 0x2, 0xd7, 0x0, 0x95, 0x8, 0xb0, 0x31, - 0xb9, 0x68, 0xc5, - - /* U+0027 "'" */ - 0xd, 0x60, 0x8a, 0x5, 0x50, 0x60, - - /* U+0028 "(" */ - 0x0, 0x0, 0x0, 0x71, 0x5, 0x40, 0xa, 0x0, - 0x65, 0x0, 0xb1, 0x0, 0xc0, 0x0, 0xc0, 0x0, - 0xc0, 0x0, 0xb0, 0x0, 0x65, 0x0, 0x1a, 0x0, - 0x6, 0x40, 0x0, 0x81, 0x0, 0x1, - - /* U+0029 ")" */ - 0x0, 0x0, 0x26, 0x0, 0x5, 0x40, 0x0, 0xa0, - 0x0, 0x65, 0x0, 0x2a, 0x0, 0xc, 0x0, 0xc, - 0x0, 0xc, 0x0, 0x1b, 0x0, 0x66, 0x0, 0xa0, - 0x4, 0x50, 0x17, 0x0, 0x10, 0x0, - - /* U+002A "*" */ - 0x0, 0x5, 0x0, 0x0, 0x0, 0xf0, 0x0, 0x6b, - 0xb, 0x1c, 0x50, 0x7a, 0x7a, 0x70, 0x0, 0x6a, - 0x60, 0x4, 0xe5, 0x86, 0xe3, 0x24, 0xd, 0x4, - 0x20, 0x0, 0xd0, 0x0, - - /* U+002B "+" */ - 0x0, 0x1, 0x0, 0x0, 0x0, 0x70, 0x0, 0x0, - 0x7, 0x0, 0x0, 0x0, 0x70, 0x0, 0x38, 0x8c, - 0x88, 0x40, 0x0, 0x70, 0x0, 0x0, 0x7, 0x0, - 0x0, 0x0, 0x70, 0x0, 0x0, 0x2, 0x0, 0x0, - - /* U+002C "," */ - 0xd, 0x60, 0x8a, 0x5, 0x50, 0x60, - - /* U+002D "-" */ - 0x48, 0x88, 0x88, 0x40, - - /* U+002E "." */ - 0x9, 0x40, 0xd6, - - /* U+002F "/" */ - 0x0, 0x0, 0x1, 0x30, 0x0, 0x0, 0x60, 0x0, - 0x0, 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 0x0, 0x7, 0xd, 0x0, 0x4, 0x20, - 0xd0, 0x0, 0x60, 0xd, 0x0, 0x45, 0x55, 0xe5, - 0x20, 0x0, 0xd, 0x0, 0x0, 0x0, 0xd0, 0x0, - 0x1, 0x6f, 0x81, - - /* U+0035 "5" */ - 0x8, 0xee, 0xec, 0x0, 0x60, 0x0, 0x0, 0x6, - 0x0, 0x0, 0x0, 0x68, 0x9b, 0x20, 0x9, 0x10, - 0x3b, 0x0, 0x0, 0x0, 0xe0, 0x1, 0x0, 0xd, - 0x11, 0xf0, 0x0, 0xd0, 0xc, 0x0, 0x2a, 0x0, - 0x37, 0x69, 0x10, - - /* U+0036 "6" */ - 0x0, 0x66, 0x96, 0x0, 0x73, 0x2, 0x60, 0xc, - 0x0, 0x0, 0x2, 0xb6, 0x9c, 0x40, 0x4e, 0x40, - 0x1d, 0x5, 0xc0, 0x0, 0xb3, 0x4c, 0x0, 0xa, - 0x41, 0xe0, 0x0, 0xb2, 0xb, 0x40, 0xb, 0x0, - 0x1a, 0x68, 0x20, - - /* U+0037 "7" */ - 0xd, 0xee, 0xef, 0x10, 0x90, 0x0, 0x70, 0x2, - 0x0, 0x61, 0x0, 0x0, 0x8, 0x0, 0x0, 0x5, - 0x40, 0x0, 0x0, 0xb0, 0x0, 0x0, 0x1c, 0x0, - 0x0, 0x5, 0xb0, 0x0, 0x0, 0x7b, 0x0, 0x0, - 0x6, 0xa0, 0x0, - - /* U+0038 "8" */ - 0x3, 0x86, 0x82, 0x0, 0xb0, 0x0, 0xb0, 0x2b, - 0x0, 0xb, 0x0, 0xd6, 0x1, 0xa0, 0x1, 0xec, - 0x90, 0x0, 0x83, 0x5e, 0x50, 0x39, 0x0, 0x2e, - 0x5, 0x60, 0x0, 0xb2, 0x29, 0x0, 0xb, 0x0, - 0x47, 0x67, 0x30, - - /* U+0039 "9" */ - 0x4, 0x87, 0x81, 0x1, 0xc0, 0x2, 0xa0, 0x59, - 0x0, 0xd, 0x5, 0x90, 0x0, 0xe2, 0x1d, 0x10, - 0x6e, 0x30, 0x49, 0x83, 0xe2, 0x0, 0x0, 0xf, - 0x0, 0x10, 0x3, 0xa0, 0xd, 0x30, 0x94, 0x0, - 0x79, 0x76, 0x0, - - /* U+003A ":" */ - 0x3e, 0x1, 0x80, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x80, 0x3e, 0x0, - - /* U+003B ";" */ - 0x3f, 0x1, 0x50, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x50, 0x3f, 0x0, 0xa0, 0x3, 0x0, - - /* U+003C "<" */ - 0x0, 0x0, 0x5, 0x0, 0x0, 0x5, 0x40, 0x0, - 0x5, 0x50, 0x0, 0x4, 0x60, 0x0, 0x3, 0x70, - 0x0, 0x0, 0xa0, 0x0, 0x0, 0x4, 0x60, 0x0, - 0x0, 0x5, 0x50, 0x0, 0x0, 0x6, 0x40, 0x0, - 0x0, 0x6, 0x30, 0x0, 0x0, 0x6, 0x0, - - /* U+003D "=" */ - 0x48, 0x88, 0x88, 0x40, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x4, 0x88, 0x88, 0x84, - - /* U+003E ">" */ - 0x5, 0x0, 0x0, 0x0, 0x46, 0x0, 0x0, 0x0, - 0x55, 0x0, 0x0, 0x0, 0x64, 0x0, 0x0, 0x0, - 0x73, 0x0, 0x0, 0x0, 0xa0, 0x0, 0x0, 0x64, - 0x0, 0x0, 0x55, 0x0, 0x0, 0x46, 0x0, 0x0, - 0x37, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, - - /* U+003F "?" */ - 0x2, 0x88, 0xa4, 0x0, 0x80, 0x0, 0xd1, 0x3a, - 0x0, 0xb, 0x31, 0x90, 0x0, 0xe1, 0x0, 0x1, - 0xa5, 0x0, 0x0, 0x81, 0x0, 0x0, 0x7, 0x0, - 0x0, 0x0, 0x20, 0x0, 0x0, 0x18, 0x0, 0x0, - 0x3, 0xe0, 0x0, - - /* U+0040 "@" */ - 0x0, 0x77, 0x74, 0x0, 0x72, 0x46, 0xa2, 0x9, - 0x17, 0x65, 0x74, 0x67, 0x27, 0x37, 0x65, 0xb0, - 0x91, 0x76, 0x5b, 0xa, 0x7, 0x46, 0xa1, 0xc4, - 0x31, 0x95, 0x66, 0x61, 0x8, 0x10, 0x4, 0x30, - 0x8, 0x77, 0x50, - - /* U+0041 "A" */ - 0x0, 0xb, 0x0, 0x0, 0x4, 0xe2, 0x0, 0x0, - 0x77, 0x60, 0x0, 0x8, 0x49, 0x0, 0x0, 0x70, - 0xd0, 0x0, 0x44, 0xc, 0x10, 0x7, 0x65, 0xb5, - 0x0, 0x80, 0x5, 0x80, 0x7, 0x0, 0x1c, 0x8, - 0xb0, 0x4, 0xf5, - - /* U+0042 "B" */ - 0x4e, 0x66, 0x95, 0x0, 0xd0, 0x0, 0xe0, 0xd, - 0x0, 0xe, 0x0, 0xd0, 0x3, 0xb0, 0xd, 0x56, - 0xb1, 0x0, 0xd0, 0x1, 0xc0, 0xd, 0x0, 0x9, - 0x60, 0xd0, 0x0, 0x97, 0xd, 0x0, 0xc, 0x34, - 0xe6, 0x68, 0x60, - - /* U+0043 "C" */ - 0x0, 0x87, 0x8f, 0x10, 0x94, 0x0, 0x54, 0x1d, - 0x0, 0x0, 0x36, 0x90, 0x0, 0x0, 0x88, 0x0, - 0x0, 0x8, 0x80, 0x0, 0x0, 0x79, 0x0, 0x0, - 0x4, 0xc0, 0x0, 0x4, 0xd, 0x30, 0x6, 0x10, - 0x1a, 0x88, 0x30, - - /* U+0044 "D" */ - 0x4e, 0x76, 0x80, 0x0, 0xd0, 0x3, 0xb0, 0xd, - 0x0, 0xc, 0x30, 0xd0, 0x0, 0x96, 0xd, 0x0, - 0x8, 0x70, 0xd0, 0x0, 0x87, 0xd, 0x0, 0xa, - 0x60, 0xd0, 0x0, 0xd2, 0xd, 0x0, 0x4a, 0x4, - 0xe7, 0x78, 0x0, - - /* U+0045 "E" */ - 0x3e, 0x75, 0x7d, 0x0, 0xc1, 0x0, 0x43, 0xc,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x0, 0x0, 0x0, 0xe0, - 0x0, 0x0, 0xe, 0x0, 0x0, 0x0, 0xe0, 0x0, - 0x0, 0xd, 0x0, 0x57, 0x3, 0x90, 0x3, 0xb6, - 0x70, 0x0, - - /* U+004B "K" */ - 0x4e, 0x50, 0x8c, 0x20, 0xd0, 0x7, 0x0, 0xd, - 0x4, 0x30, 0x0, 0xd1, 0x70, 0x0, 0xd, 0x8c, - 0x0, 0x0, 0xd4, 0xa4, 0x0, 0xd, 0x3, 0xb0, - 0x0, 0xd0, 0xc, 0x20, 0xd, 0x0, 0x59, 0x4, - 0xe6, 0x4, 0xf5, - - /* U+004C "L" */ - 0x2d, 0x80, 0x0, 0x0, 0xb3, 0x0, 0x0, 0xb, - 0x30, 0x0, 0x0, 0xb3, 0x0, 0x0, 0xb, 0x30, - 0x0, 0x0, 0xb3, 0x0, 0x0, 0xb, 0x30, 0x0, - 0x0, 0xb3, 0x0, 0x1, 0xb, 0x30, 0x1, 0x53, - 0xd8, 0x56, 0xd2, - - /* U+004D "M" */ - 0x7c, 0x0, 0xf, 0x62, 0xe0, 0x3, 0xe2, 0x2b, - 0x30, 0x6c, 0x22, 0x86, 0x6, 0xc2, 0x25, 0x90, - 0x6c, 0x22, 0x2c, 0x14, 0xc2, 0x22, 0xb5, 0xc, - 0x22, 0x28, 0x90, 0xc2, 0x22, 0x59, 0xc, 0x27, - 0x72, 0x63, 0xe7, - - /* U+004E "N" */ - 0x4f, 0x10, 0x1a, 0x50, 0xc8, 0x0, 0x50, 0x5, - 0xd1, 0x5, 0x0, 0x57, 0x80, 0x50, 0x5, 0xd, - 0x5, 0x0, 0x50, 0x87, 0x50, 0x5, 0x1, 0xe5, - 0x0, 0x50, 0x8, 0xc0, 0x5, 0x0, 0x1f, 0x5, - 0xa1, 0x0, 0x90, - - /* U+004F "O" */ - 0x1, 0x96, 0x81, 0x0, 0xa2, 0x0, 0xb0, 0x1c, - 0x0, 0xb, 0x35, 0x90, 0x0, 0x87, 0x78, 0x0, - 0x7, 0x97, 0x80, 0x0, 0x79, 0x59, 0x0, 0x7, - 0x71, 0xb0, 0x0, 0xa3, 0xa, 0x20, 0xb, 0x0, - 0x18, 0x57, 0x20, - - /* U+0050 "P" */ - 0x3e, 0x75, 0x75, 0x0, 0xc1, 0x0, 0xb2, 0xc, - 0x10, 0x8, 0x60, 0xc1, 0x0, 0x95, 0xc, 0x10, - 0x1c, 0x0, 0xc6, 0x57, 0x10, 0xc, 0x10, 0x0, - 0x0, 0xc1, 0x0, 0x0, 0xc, 0x10, 0x0, 0x4, - 0xe7, 0x0, 0x0, - - /* U+0051 "Q" */ - 0x2, 0x96, 0x81, 0x0, 0xc1, 0x1, 0xb0, 0x3b, - 0x0, 0xb, 0x36, 0x90, 0x0, 0x87, 0x87, 0x0, - 0x7, 0x88, 0x70, 0x0, 0x78, 0x78, 0x0, 0x8, - 0x74, 0xa8, 0xa1, 0xa3, 0xd, 0x44, 0x9b, 0x0, - 0x28, 0x7f, 0x30, 0x0, 0x0, 0x7d, 0x20, - - /* U+0052 "R" */ - 0x3d, 0x76, 0x95, 0x0, 0xb2, 0x0, 0xe1, 0xb, - 0x20, 0xc, 0x20, 0xb2, 0x2, 0xc0, 0xb, 0x68, - 0x91, 0x0, 0xb2, 0x58, 0x0, 0xb, 0x20, 0xd0, - 0x0, 0xb2, 0xa, 0x40, 0xb, 0x20, 0x49, 0x3, - 0xd7, 0x0, 0xe4, - - /* U+0053 "S" */ - 0x4, 0x67, 0xcb, 0x1, 0x80, 0x0, 0x90, 0x37, - 0x0, 0x1, 0x1, 0xd3, 0x0, 0x0, 0x3, 0xcb, - 0x20, 0x0, 0x0, 0x5d, 0x50, 0x0, 0x0, 0x1d, - 0x3, 0x10, 0x0, 0x92, 0x38, 0x0, 0xa, 0x0, - 0xfa, 0x67, 0x30, - - /* U+0054 "T" */ - 0x3b, 0x6f, 0x6b, 0x26, 0x0, 0xe0, 0x15, 0x10, - 0xe, 0x0, 0x10, 0x0, 0xe0, 0x0, 0x0, 0xe, - 0x0, 0x0, 0x0, 0xe0, 0x0, 0x0, 0xe, 0x0, - 0x0, 0x0, 0xe0, 0x0, 0x0, 0xe, 0x0, 0x0, - 0x6, 0xf5, 0x0, - - /* U+0055 "U" */ - 0x5f, 0x30, 0x1a, 0x40, 0xd0, 0x0, 0x50, 0xd, - 0x0, 0x5, 0x0, 0xd0, 0x0, 0x50, 0xd, 0x0, - 0x5, 0x0, 0xd0, 0x0, 0x50, 0xd, 0x0, 0x5, - 0x0, 0xd0, 0x0, 0x50, 0xc, 0x0, 0x6, 0x0, - 0x39, 0x77, 0x10, - - /* U+0056 "V" */ - 0x5f, 0x30, 0x2c, 0x40, 0xd1, 0x0, 0x70, 0x9, - 0x40, 0x15, 0x0, 0x58, 0x5, 0x10, 0x2, 0xc0, - 0x60, 0x0, 0xd, 0x6, 0x0, 0x0, 0xa4, 0x50, - 0x0, 0x7, 0xb1, 0x0, 0x0, 0x3d, 0x0, 0x0, - 0x0, 0x80, 0x0, - - /* U+0057 "W" */ - 0x9a, 0x2e, 0x36, 0x83, 0x80, 0xb0, 0x32, 0x1a, - 0xb, 0x25, 0x0, 0xb0, 0xd4, 0x50, 0xb, 0x1a, - 0x65, 0x0, 0xa5, 0x58, 0x50, 0x8, 0x91, 0xb5, - 0x0, 0x6b, 0xe, 0x20, 0x3, 0x90, 0xc0, 0x0, - 0x16, 0x7, 0x0, - - /* U+0058 "X" */ - 0x2d, 0x70, 0x4c, 0x20, 0x57, 0x3, 0x30, 0x0, - 0xc0, 0x70, 0x0, 0x8, 0x75, 0x0, 0x0, 0x1e, - 0x0, 0x0, 0x0, 0xe3, 0x0, 0x0, 0x65, 0xa0, - 0x0, 0x7, 0xc, 0x10, 0x5, 0x20, 0x68, 0x3, - 0xd2, 0x5, 0xf4, - - /* U+0059 "Y" */ - 0x4f, 0x40, 0x3d, 0x40, 0xa3, 0x0, 0x60, 0x4, - 0x90, 0x41, 0x0, 0xd, 0x6, 0x0, 0x0, 0x95, - 0x50, 0x0, 0x3, 0xd0, 0x0, 0x0, 0xe, 0x0, - 0x0, 0x0, 0xe0, 0x0, 0x0, 0xe, 0x0, 0x0, - 0x6, 0xf5, 0x0, - - /* U+005A "Z" */ - 0xb, 0x95, 0x5e, 0x21, 0x70, 0x4, 0xa0, 0x0, - 0x0, 0xc2, 0x0, 0x0, 0x4a, 0x0, 0x0, 0xc, - 0x20, 0x0, 0x4, 0xa0, 0x0, 0x0, 0xb2, 0x0, - 0x0, 0x4a, 0x0, 0x1, 0xb, 0x20, 0x6, 0x24, - 0xd5, 0x57, 0xd0, - - /* U+005B "[" */ - 0x39, 0x88, 0x4, 0x40, 0x0, 0x44, 0x0, 0x4, - 0x40, 0x0, 0x44, 0x0, 0x4, 0x40, 0x0, 0x44, - 0x0, 0x4, 0x40, 0x0, 0x44, 0x0, 0x4, 0x40, - 0x0, 0x44, 0x0, 0x4, 0x40, 0x0, 0x44, 0x0, - 0x3, 0x98, 0x80, - - /* U+005C "\\" */ - 0xa0, 0x0, 0x0, 0x64, 0x0, 0x0, 0x9, 0x0, - 0x0, 0x9, 0x0, 0x0, 0x4, 0x50, 0x0, 0x0, - 0xa0, 0x0, 0x0, 0x81, 0x0, 0x0, 0x27, 0x0, - 0x0, 0xa, 0x0, 0x0, 0x6, 0x30, 0x0, 0x1, - 0x90, 0x0, 0x0, 0x90, 0x0, 0x0, 0x32, - - /* U+005D "]" */ - 0x8, 0x89, 0x20, 0x0, 0x53, 0x0, 0x5, 0x30, - 0x0, 0x53, 0x0, 0x5, 0x30, 0x0, 0x53, 0x0, - 0x5, 0x30, 0x0, 0x53, 0x0, 0x5, 0x30, 0x0, - 0x53, 0x0, 0x5, 0x30, 0x0, 0x53, 0x0, 0x5, - 0x30, 0x88, 0x92, - - /* U+005E "^" */ - 0x8, 0xb8, 0x1, 0x30, 0x31, - - /* U+005F "_" */ - 0x55, 0x55, 0x55, 0x50, - - /* U+0060 "`" */ - 0x5c, 0x30, 0x4, - - /* U+0061 "a" */ - 0x5, 0x65, 0x81, 0x0, 0xd0, 0x4, 0x80, 0x0, - 0x4, 0x79, 0x0, 0x78, 0x23, 0x90, 0x3b, 0x0, - 0x39, 0x5, 0x90, 0x3, 0x92, 0xa, 0x76, 0x6b, - 0x50, - - /* U+0062 "b" */ - 0x3, 0x0, 0x0, 0x4, 0xd0, 0x0, 0x0, 0xc, - 0x0, 0x0, 0x0, 0xc0, 0x0, 0x0, 0xc, 0x47, - 0x94, 0x0, 0xd4, 0x0, 0xc0, 0xc, 0x0, 0xb, - 0x20, 0xc0, 0x0, 0xa3, 0xc, 0x0, 0xb, 0x10, - 0xd1, 0x0, 0xb0, 0x8, 0x66, 0x82, 0x0, - - /* U+0063 "c" */ - 0x0, 0x85, 0x83, 0x0, 0xa2, 0x3, 0xa0, 0xd, - 0x0, 0x2, 0x2, 0xb0, 0x0, 0x0, 0xc, 0x0, - 0x0, 0x0, 0xb2, 0x0, 0x60, 0x1, 0x97, 0x73, - 0x0, - - /* U+0064 "d" */ - 0x0, 0x0, 0x3, 0x0, 0x0, 0x5, 0xc0, 0x0, - 0x0, 0xc, 0x0, 0x0, 0x0, 0xc0, 0x1, 0x97, - 0x6c, 0x0, 0xa2, 0x0, 0xc0, 0xc, 0x0, 0xc, - 0x2, 0xb0, 0x0, 0xc0, 0xc, 0x0, 0xc, 0x0, - 0xb1, 0x3, 0xc0, 0x2, 0x97, 0x5c, 0x30, - - /* U+0065 "e" */ - 0x0, 0x86, 0x82, 0x0, 0x92, 0x1, 0xc0, 0xc, - 0x0, 0xc, 0x11, 0xd5, 0x55, 0x91, 0xd, 0x0, - 0x0, 0x0, 0xa2, 0x0, 0x50, 0x1, 0x97, 0x73, - 0x0, - - /* U+0066 "f" */ - 0x0, 0x7, 0x58, 0x50, 0x6, 0x40, 0x24, 0x0, - 0x83, 0x0, 0x1, 0x5b, 0x75, 0x20, 0x0, 0x83, - 0x0, 0x0, 0x8, 0x30, 0x0, 0x0, 0x83, 0x0, - 0x0, 0x8, 0x30, 0x0, 0x0, 0x83, 0x0, 0x0, - 0x5c, 0x95, 0x0, - - /* U+0067 "g" */ - 0x1, 0x86, 0x99, 0x70, 0xa1, 0x6, 0x60, 0xb, - 0x0, 0x47, 0x0, 0x83, 0x7, 0x30, 0x5, 0x75, - 0x40, 0x0, 0x99, 0x64, 0x0, 0x7, 0x2, 0x5b, - 0x2, 0x90, 0x0, 0x91, 0x7, 0x65, 0x66, 0x0, - - /* U+0068 "h" */ - 0x6, 0x0, 0x0, 0x3, 0xe0, 0x0, 0x0, 0xc, - 0x0, 0x0, 0x0, 0xc0, 0x0, 0x0, 0xc, 0x58, - 0xa4, 0x0, 0xc4, 0x0, 0xb0, 0xc, 0x0, 0xc, - 0x0, 0xc0, 0x0, 0xc0, 0xc, 0x0, 0xc, 0x0, - 0xc0, 0x0, 0xc0, 0x3e, 0x50, 0x4e, 0x30, - - /* U+0069 "i" */ - 0x0, 0xe2, 0x0, 0x5, 0x0, 0x0, 0x20, 0x2, - 0x5d, 0x0, 0x0, 0xc0, 0x0, 0xc, 0x0, 0x0, - 0xc0, 0x0, 0xc, 0x0, 0x0, 0xc0, 0x2, 0x6e, - 0x63, - - /* U+006A "j" */ - 0x0, 0x8, 0x80, 0x0, 0x33, 0x0, 0x1, 0x10, - 0x5, 0xa6, 0x0, 0x5, 0x60, 0x0, 0x56, 0x0, - 0x5, 0x60, 0x0, 0x56, 0x0, 0x5, 0x60, 0x0, - 0x55, 0x60, 0x8, 0x29, 0x97, 0x50, - - /* U+006B "k" */ - 0x6, 0x0, 0x0, 0x3, 0xd0, 0x0, 0x0, 0xb, - 0x0, 0x0, 0x0, 0xb0, 0x0, 0x0, 0xb, 0x0, - 0xc7, 0x0, 0xb0, 0x26, 0x0, 0xb, 0x1b, 0x0, - 0x0, 0xb8, 0xa3, 0x0, 0xb, 0x12, 0xc0, 0x0, - 0xb0, 0x9, 0x50, 0x2d, 0x50, 0x5e, 0x30, - - /* U+006C "l" */ - 0x2, 0x90, 0x3, 0x5d, 0x0, 0x0, 0xc0, 0x0, - 0xc, 0x0, 0x0, 0xc0, 0x0, 0xc, 0x0, 0x0, - 0xc0, 0x0, 0xc, 0x0, 0x0, 0xc0, 0x0, 0xc, - 0x0, 0x36, 0xe6, 0x30, - - /* U+006D "m" */ - 0x8a, 0x7a, 0x7a, 0x24, 0x90, 0xc0, 0x55, 0x47, - 0xc, 0x5, 0x64, 0x70, 0xc0, 0x56, 0x47, 0xc, - 0x5, 0x64, 0x70, 0xc0, 0x56, 0x8b, 0x2e, 0x39, - 0xa0, - - /* U+006E "n" */ - 0x3e, 0x47, 0x94, 0x0, 0xc4, 0x0, 0xb0, 0xc, - 0x0, 0xc, 0x0, 0xc0, 0x0, 0xc0, 0xc, 0x0, - 0xc, 0x0, 0xc0, 0x0, 0xc0, 0x3e, 0x50, 0x4e, - 0x30, - - /* U+006F "o" */ - 0x1, 0x86, 0x82, 0x0, 0xb0, 0x0, 0xb0, 0x2a, - 0x0, 0xa, 0x24, 0x80, 0x0, 0x84, 0x3a, 0x0, - 0xa, 0x30, 0xb0, 0x0, 0xb0, 0x2, 0x85, 0x71, - 0x0, - - /* U+0070 "p" */ - 0x4e, 0x57, 0x94, 0x0, 0xc3, 0x0, 0xc0, 0xc, - 0x0, 0x9, 0x30, 0xc0, 0x0, 0x84, 0xc, 0x0, - 0xa, 0x30, 0xc1, 0x0, 0xc0, 0xc, 0x66, 0x92, - 0x0, 0xc0, 0x0, 0x0, 0x3e, 0x50, 0x0, 0x0, - - /* U+0071 "q" */ - 0x2, 0x86, 0x68, 0x0, 0xb0, 0x2, 0xc0, 0x2a, - 0x0, 0xc, 0x4, 0x90, 0x0, 0xc0, 0x2a, 0x0, - 0xc, 0x0, 0xb0, 0x2, 0xc0, 0x3, 0x97, 0x5c, - 0x0, 0x0, 0x0, 0xc0, 0x0, 0x0, 0x6e, 0x30, - - /* U+0072 "r" */ - 0x38, 0xc2, 0x7c, 0x30, 0xc, 0x60, 0x42, 0x0, - 0xe0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0xc0, - 0x0, 0x0, 0xc, 0x0, 0x0, 0x36, 0xe5, 0x20, - 0x0, - - /* U+0073 "s" */ - 0x17, 0x6b, 0xa8, 0x10, 0x8, 0x69, 0x10, 0x0, - 0x5c, 0xa1, 0x10, 0x4, 0xc8, 0x0, 0xa, 0xba, - 0x66, 0x40, - - /* U+0074 "t" */ - 0x0, 0x24, 0x0, 0x0, 0x94, 0x0, 0x5, 0xa8, - 0x52, 0x0, 0x74, 0x0, 0x0, 0x74, 0x0, 0x0, - 0x74, 0x0, 0x0, 0x74, 0x0, 0x0, 0x65, 0x5, - 0x0, 0x1a, 0x83, - - /* U+0075 "u" */ - 0x4d, 0x0, 0x5c, 0x0, 0xc0, 0x0, 0xc0, 0xc, - 0x0, 0xc, 0x0, 0xc0, 0x0, 0xc0, 0xc, 0x0, - 0xc, 0x0, 0xb0, 0x4, 0xc0, 0x4, 0xb8, 0x5c, - 0x30, - - /* U+0076 "v" */ - 0x2d, 0x70, 0x3d, 0x20, 0x75, 0x1, 0x50, 0x2, - 0xa0, 0x50, 0x0, 0xc, 0x6, 0x0, 0x0, 0x84, - 0x50, 0x0, 0x3, 0xd1, 0x0, 0x0, 0xa, 0x0, - 0x0, - - /* U+0077 "w" */ - 0x9b, 0x3e, 0x28, 0x82, 0x90, 0xb0, 0x50, 0xb, - 0xd, 0x35, 0x0, 0xa2, 0x76, 0x50, 0x7, 0x81, - 0xa4, 0x0, 0x4b, 0xd, 0x10, 0x0, 0x80, 0x80, - 0x0, - - /* U+0078 "x" */ - 0x9, 0xd0, 0x89, 0x10, 0xc, 0x18, 0x0, 0x0, - 0x5d, 0x30, 0x0, 0x0, 0xe1, 0x0, 0x0, 0x65, - 0x90, 0x0, 0x16, 0xa, 0x20, 0x2c, 0x50, 0x9c, - 0x20, - - /* U+0079 "y" */ - 0x2c, 0x80, 0x5c, 0x20, 0x57, 0x3, 0x40, 0x0, - 0xb0, 0x70, 0x0, 0x9, 0x17, 0x0, 0x0, 0x48, - 0x50, 0x0, 0x0, 0xe0, 0x0, 0x0, 0x7, 0x0, - 0x0, 0x1, 0x50, 0x0, 0xd, 0x90, 0x0, 0x0, - - /* U+007A "z" */ - 0xc, 0x65, 0xa7, 0x0, 0x70, 0x1c, 0x0, 0x0, - 0x9, 0x40, 0x0, 0x2, 0xb0, 0x0, 0x0, 0xb2, - 0x2, 0x0, 0x58, 0x0, 0x70, 0xe, 0x65, 0x8b, - 0x0, - - /* U+007B "{" */ - 0x0, 0x26, 0x0, 0x80, 0x0, 0x70, 0x0, 0x80, - 0x0, 0x80, 0x0, 0x80, 0x5, 0x40, 0x5, 0x40, - 0x0, 0x80, 0x0, 0x80, 0x0, 0x80, 0x0, 0x70, - 0x0, 0x80, 0x0, 0x27, - - /* U+007C "|" */ - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x50, - - /* U+007D "}" */ - 0x62, 0x0, 0x7, 0x0, 0x7, 0x0, 0x7, 0x0, - 0x7, 0x0, 0x7, 0x0, 0x4, 0x50, 0x4, 0x50, - 0x7, 0x0, 0x7, 0x0, 0x7, 0x0, 0x7, 0x0, - 0x7, 0x0, 0x62, 0x0, - - /* U+007E "~" */ - 0x5, 0x92, 0x0, 0x3, 0x11, 0xb2, 0x4, 0x0, - 0x1, 0x97, 0x0, - - /* U+007F "" */ - - /* U+3001 "、" */ - 0x0, 0x0, 0x29, 0x50, 0x0, 0xd7, 0x0, 0x4d, - 0x0, 0x1, - - /* U+3002 "。" */ - 0x0, 0x0, 0x67, 0x70, 0x70, 0x70, 0x77, 0x70, - 0x0, 0x0, - - /* U+3005 "々" */ - 0x0, 0x11, 0x0, 0x0, 0x0, 0x49, 0x0, 0x0, - 0x0, 0x82, 0x0, 0x11, 0x1, 0xc7, 0x55, 0xc8, - 0x7, 0x21, 0x0, 0xb0, 0x11, 0x0, 0x5, 0x50, - 0x0, 0x0, 0x8, 0x0, 0x0, 0x6, 0x52, 0x0, - 0x0, 0x2, 0xd3, 0x0, 0x0, 0x0, 0x4d, 0x0, - 0x0, 0x0, 0x3, 0x0, - - /* U+300C "「" */ - 0x88, 0x86, 0x80, 0x0, 0x80, 0x0, 0x80, 0x0, - 0x80, 0x0, 0x80, 0x0, 0x80, 0x0, 0x80, 0x0, - 0x80, 0x0, 0x80, 0x0, 0x80, 0x0, 0x80, 0x0, - - /* U+300D "」" */ - 0x0, 0x8, 0x0, 0x8, 0x0, 0x8, 0x0, 0x8, - 0x0, 0x8, 0x0, 0x8, 0x0, 0x8, 0x0, 0x8, - 0x0, 0x8, 0x0, 0x8, 0x0, 0x8, 0x78, 0x88, - - /* U+3041 "ぁ" */ - 0x0, 0x33, 0x0, 0x0, 0x0, 0x55, 0x54, 0x0, - 0x5, 0xa8, 0x30, 0x0, 0x0, 0x63, 0x95, 0x10, - 0x0, 0xb4, 0x71, 0x91, 0x8, 0x67, 0x10, 0x46, - 0x70, 0x58, 0x0, 0x63, 0x78, 0x78, 0x3, 0x80, - 0x1, 0x0, 0x54, 0x0, - - /* U+3042 "あ" */ - 0x0, 0x4, 0x10, 0x0, 0x0, 0x0, 0x9, 0x30, - 0x10, 0x0, 0x0, 0xa, 0x7a, 0x91, 0x0, 0x6, - 0x7c, 0x21, 0x0, 0x0, 0x0, 0x9, 0x2c, 0x75, - 0x0, 0x0, 0x2d, 0x6c, 0x3, 0xb1, 0x3, 0xa9, - 0x37, 0x0, 0x48, 0x1a, 0x9, 0xa0, 0x0, 0x29, - 0x82, 0xa, 0x50, 0x0, 0x65, 0x93, 0x89, 0x90, - 0x2, 0xa0, 0x17, 0x20, 0x20, 0x67, 0x0, 0x0, - 0x0, 0x14, 0x10, 0x0, - - /* U+3043 "ぃ" */ - 0x0, 0x0, 0x0, 0x0, 0x55, 0x0, 0x1, 0x0, - 0x62, 0x0, 0x3, 0x50, 0x81, 0x0, 0x0, 0x82, - 0x71, 0x10, 0x1, 0x57, 0x37, 0x60, 0x0, 0x83, - 0x8, 0x30, 0x0, 0x0, - - /* U+3044 "い"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x70, 0x0, 0x81, 0x2c, 0x6, - 0x6d, 0x20, 0x0, 0x0, 0x12, 0x0, 0xb5, 0x0, - 0x0, 0x0, - - /* U+304D "き" */ - 0x0, 0x10, 0x0, 0x0, 0x1, 0xe1, 0x0, 0x0, - 0x0, 0x48, 0x6a, 0x20, 0x17, 0x8d, 0x40, 0x11, - 0x0, 0x2, 0xa6, 0xa1, 0x4, 0x79, 0xb7, 0x0, - 0x0, 0x0, 0xb, 0x10, 0x5, 0x99, 0x87, 0xb0, - 0x97, 0x0, 0x17, 0xf4, 0xc0, 0x0, 0x0, 0x10, - 0x69, 0x0, 0x1, 0x0, 0x5, 0xcc, 0xca, 0x0, - - /* U+304E "ぎ" */ - 0x0, 0x0, 0x0, 0x0, 0x12, 0x0, 0x1c, 0x0, - 0x0, 0x37, 0xb4, 0x0, 0x75, 0x2a, 0x40, 0xa1, - 0x1, 0x36, 0xe7, 0x10, 0x0, 0x0, 0x3, 0x25, - 0x54, 0xb2, 0x0, 0x0, 0x12, 0x6e, 0x80, 0x0, - 0x0, 0x2, 0x42, 0x1a, 0x0, 0x0, 0x0, 0x26, - 0x75, 0x69, 0x0, 0x0, 0x69, 0x32, 0x48, 0xe4, - 0x0, 0xb, 0x0, 0x0, 0x1, 0x0, 0x0, 0x5a, - 0x20, 0x26, 0x10, 0x0, 0x0, 0x4a, 0xca, 0x60, - 0x0, 0x0, - - /* U+304F "く" */ - 0x0, 0x1, 0x50, 0x0, 0x6, 0xe0, 0x0, 0x1c, - 0x20, 0x1, 0xa1, 0x0, 0x9, 0x10, 0x0, 0x71, - 0x0, 0x0, 0x46, 0x0, 0x0, 0x3, 0x91, 0x0, - 0x0, 0x2d, 0x20, 0x0, 0x7, 0xd0, 0x0, 0x0, - 0xe3, 0x0, 0x0, 0x30, - - /* U+3050 "ぐ" */ - 0x0, 0x2, 0x20, 0x0, 0x0, 0x0, 0x8b, 0x0, - 0x0, 0x0, 0x3c, 0x10, 0x8, 0x70, 0x1b, 0x10, - 0xa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71, 0x0, 0x7, 0x40, 0x0, 0x0, - 0x0, 0x47, 0x0, 0x0, 0x0, 0x8, 0x30, 0x0, - 0x0, 0x7, 0x70, 0x0, 0x4, 0x67, 0x20, 0x0, - - /* U+3064 "つ" */ - 0x0, 0x0, 0x17, 0x99, 0x81, 0x0, 0x36, 0xa8, - 0x20, 0x1, 0xb3, 0xb, 0x70, 0x0, 0x0, 0x3, - 0xb0, 0x0, 0x0, 0x0, 0x0, 0xd, 0x0, 0x0, - 0x0, 0x0, 0x3, 0xa0, 0x0, 0x0, 0x0, 0x0, - 0xb3, 0x0, 0x0, 0x0, 0x2, 0xb5, 0x0, 0x0, - 0x3, 0x68, 0x81, 0x0, 0x0, 0x0, 0x20, 0x0, - 0x0, 0x0, - - /* U+3065 "づ" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x72, 0x0, 0x0, - 0x0, 0x0, 0x8, 0x39, 0x0, 0x0, 0x37, 0x89, - 0x61, 0x60, 0x14, 0x8a, 0x50, 0x0, 0x4a, 0x0, - 0x2a, 0x30, 0x0, 0x0, 0xb, 0x20, 0x0, 0x0, - 0x0, 0x0, 0x9, 0x30, 0x0, 0x0, 0x0, 0x0, - 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x68, 0x0, - 0x0, 0x0, 0x0, 0x18, 0x80, 0x0, 0x0, 0x3, - 0x68, 0x72, 0x0, 0x0, - - /* U+3066 "て" */ - 0x0, 0x0, 0x0, 0x36, 0x82, 0x35, 0x78, 0x87, - 0xbc, 0x83, 0x46, 0x30, 0x9, 0x30, 0x0, 0x0, - 0x0, 0x92, 0x0, 0x0, 0x0, 0x4, 0x60, 0x0, - 0x0, 0x0, 0x9, 0x10, 0x0, 0x0, 0x0, 0xa, - 0x0, 0x0, 0x0, 0x0, 0x7, 0x40, 0x0, 0x0, - 0x0, 0x1, 0xc3, 0x0, 0x0, 0x0, 0x0, 0x1a, - 0xd7, 0x0, - - /* U+3067 "で" */ - 0x0, 0x0, 0x0, 0x26, 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, - 0x0, 0x6, 0x8c, 0x96, 0x5, 0x30, 0x0, 0x8, - 0x10, 0x0, 0x2b, 0x60, 0x2, 0x80, 0x0, 0x96, - 0x56, 0x1, 0xb0, 0x0, 0x9, 0x0, 0x0, 0xb4, - 0x0, 0x1, 0x90, 0x0, 0x3, 0x0, 0x67, 0x59, - 0x0, 0x0, 0x0, 0x92, 0x4, 0xe6, 0x0, 0x0, - 0x9, 0x42, 0x94, 0xa5, 0x0, 0x0, 0x5, 0x73, - 0x0, 0x20, - - /* U+306B "に" */ - 0x26, 0x0, 0x24, 0x6a, 0x50, 0x2c, 0x0, 0x23, - 0x78, 0x20, 0x65, 0x0, 0x1, 0x30, 0x0, 0xa0, - 0x0, 0x0, 0x0, 0x0, 0xa0, 0x0, 0x0, 0x0, - 0x0, 0xb0, 0x13, 0x0, 0x0, 0x0, 0xb6, 0x7, - 0x0, 0x0, 0x0, 0x7d, 0x6, 0x50, 0x0, 0x30, - 0x8, 0x0, 0x6a, 0xbc, 0x90, - - /* U+306C "ぬ" */ - 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xd, 0x0, 0x0, 0x0, 0xa, 0x20, 0x3d, 0x88, - 0x70, 0x0, 0x6, 0x48, 0x87, 0x0, 0x39, 0x0, - 0x3, 0xc2, 0x72, 0x0, 0xa, 0x10, 0x8, 0xa0, - 0x90, 0x0, 0x8, 0x30, 0x18, 0x69, 0x40, 0x0, - 0xa, 0x0, 0x53, 0xe, 0x32, 0xa9, 0xac, 0x0, - 0x46, 0x92, 0x56, 0x41, 0xa8, 0xb0, 0x6, 0x10, - 0x0, 0x78, 0x20, 0x40, - - /* U+306D "ね" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3a, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x1b, 0x5, 0x98, 0xa5, 0x0, - 0x29, 0x99, 0x84, 0x0, 0xa, 0x10, 0x1, 0x8d, - 0x10, 0x0, 0x7, 0x40, 0x0, 0xc8, 0x0, 0x0, - 0x6, 0x50, 0x7, 0x48, 0x0, 0x1, 0x9, 0x20, - 0x2b, 0x8, 0x3, 0xb8, 0xae, 0x30, 0x84, 0x99, - 0x7, 0x40, 0x88, 0xa7, 0x0, 0x76, 0x1, 0x9a, - 0x40, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - - /* U+306E "の" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x28, - 0xa9, 0x99, 0x10, 0x0, 0x69, 0x16, 0x0, 0x2c, - 0x10, 0x48, 0x0, 0x80, 0x0, 0x58, 0xb, 0x0, - 0x9, 0x0, 0x1, 0xc1, 0x90, 0x0, 0x90, 0x0, - 0xc, 0x36, 0x0, 0x19, 0x0, 0x0, 0xb2, 0x70, - 0x8, 0x30, 0x0, 0x57, 0xb, 0x15, 0x80, 0x0, - 0x2b, 0x0, 0x3a, 0x70, 0x0, 0x69, 0x10, 0x0, - 0x0, 0x2, 0x52, 0x0, 0x0, - - /* U+306F "は" */ - 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x24, 0x0, - 0x1, 0xe0, 0x0, 0x4, 0xa0, 0x0, 0xb, 0x0, - 0x0, 0x64, 0x0, 0x1, 0xc8, 0x90, 0xa, 0x0, - 0x16, 0x7c, 0x10, 0x0, 0xa0, 0x0, 0x0, 0xa0, - 0x0, 0x18, 0x0, 0x0, 0xa, 0x0, 0x3, 0x73, - 0x0, 0x0, 0xa0, 0x0, 0x3b, 0x51, 0xa8, 0x9d, - 0x30, 0x0, 0xe3, 0x55, 0x2, 0xaa, 0x70, 0x3, - 0x1, 0xb9, 0xa1, 0x4, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+3070 "ば" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x60, 0x5, 0x0, - 0x0, 0x92, 0x7, 0x49, 0xd, 0x0, 0x0, 0xa1, - 0x2, 0x70, 0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, 0x63, - 0x0, 0xa4, 0x3, 0xa0, 0x0, 0x7, 0x97, 0x0, - - /* U+3083 "ゃ" */ - 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x30, 0x38, - 0x0, 0x0, 0x0, 0xa0, 0x1a, 0x87, 0x10, 0x0, - 0x87, 0x94, 0x2, 0xc0, 0x17, 0xa9, 0x3, 0x0, - 0xc0, 0x13, 0x9, 0x12, 0x89, 0x30, 0x0, 0x2, - 0x90, 0x0, 0x0, 0x0, 0x0, 0xb0, 0x0, 0x0, - 0x0, 0x0, 0x40, 0x0, 0x0, - - /* U+3084 "や" */ - 0x0, 0x0, 0x2, 0x60, 0x0, 0x0, 0x0, 0xa3, - 0x3, 0xc3, 0x0, 0x0, 0x0, 0x74, 0x3, 0xb9, - 0x99, 0xa0, 0x0, 0xc, 0xa6, 0x0, 0x0, 0x74, - 0x3, 0xab, 0x40, 0x10, 0x0, 0x93, 0x49, 0x10, - 0xb0, 0x37, 0x57, 0xa0, 0x0, 0x0, 0x84, 0x0, - 0x32, 0x0, 0x0, 0x0, 0x2b, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xc, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x7, 0x50, 0x0, 0x0, 0x0, 0x0, 0x1, 0x10, - 0x0, 0x0, - - /* U+3085 "ゅ" */ - 0x0, 0x3, 0x60, 0x0, 0x65, 0x3, 0xd8, 0x40, - 0x91, 0x85, 0x72, 0x84, 0x95, 0x50, 0x72, 0x29, - 0xaa, 0x30, 0x90, 0x19, 0x97, 0x17, 0x90, 0x84, - 0x22, 0x7, 0xb9, 0x50, 0x0, 0x45, 0x0, 0x0, - - /* U+3086 "ゆ" */ - 0x0, 0x0, 0x49, 0x10, 0x0, 0x2, 0x30, 0x0, - 0x49, 0x10, 0x0, 0x39, 0x2, 0xa8, 0xc8, 0x90, - 0x6, 0x52, 0xa1, 0xa, 0x3, 0x90, 0x91, 0xa0, - 0x0, 0xa0, 0xc, 0xa, 0x55, 0x30, 0xa, 0x0, - 0xc0, 0xba, 0x6, 0x3, 0x70, 0xb, 0x9, 0xa0, - 0x18, 0x83, 0x9, 0x50, 0x26, 0x0, 0x4e, 0x9a, - 0x40, 0x0, 0x0, 0x2a, 0x20, 0x0, 0x0, 0x0, - 0x14, 0x0, 0x0, 0x0, 0x0, - - /* U+3087 "ょ" */ - 0x0, 0xa, 0x20, 0x0, 0x0, 0xb3, 0x31, 0x0, - 0xa, 0x66, 0x10, 0x0, 0xb0, 0x0, 0x0, 0xb, - 0x0, 0x0, 0x67, 0xe9, 0x30, 0x37, 0x1c, 0x1a, - 0x0, 0xce, 0x40, 0x0, - - /* U+3088 "よ" */ - 0x0, 0xa, 0x20, 0x0, 0x0, 0xa, 0x20, 0x0, - 0x0, 0xa, 0x8a, 0x80, 0x0, 0xa, 0x0, 0x0, - 0x0, 0xa, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, - 0x39, 0x9d, 0x81, 0x0, 0xa0, 0xa, 0x3c, 0x10, - 0x7a, 0xa3, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, - - /* U+3089 "ら" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x10, 0x0, - 0x0, 0x3, 0xc6, 0x0, 0x2, 0x93, 0x58, 0x0, - 0x9, 0x0, 0x0, 0x0, 0x18, 0x0, 0x21, 0x0, - 0x57, 0x98, 0x68, 0xb1, 0xac, 0x10, 0x0, 0x39, - 0x40, 0x0, 0x0, 0x2a, 0x0, 0x0, 0x0, 0x94, - 0x0, 0x13, 0x79, 0x50, 0x1, 0x33, 0x10, 0x0, - - /* U+308A "り" */ - 0x0, 0x0, 0x0, 0x7, 0x60, 0x68, 0x10, 0x83, - 0x93, 0x39, 0xa, 0x66, 0x0, 0xc0, 0xab, 0x0, - 0xb, 0xc, 0x70, 0x0, 0xb0, 0xd2, 0x0, 0xb, - 0x5, 0x0, 0x3, 0x70, 0x0, 0x0, 0x91, 0x0, - 0x0, 0x47, 0x0, 0x0, 0x27, 0x0, 0x0, 0x14, - 0x0, 0x0, - - /* U+308B "る" */ - 0x0, 0x0, 0x5a, 0x20, 0x0, 0x7a, 0x83, 0xb5, - 0x0, 0x0, 0x0, 0x85, 0x0, 0x0, 0x0, 0x75, - 0x0, 0x0, 0x0, 0x66, 0x23, 0x10, 0x0, 0x6e, - 0x85, 0x5a, 0x70, 0x9b, 0x10, 0x0, 0xc, 0x7, - 0x3, 0x40, 0x0, 0xb1, 0x2, 0xa4, 0x80, 0x2b, - 0x0, 0xb, 0x46, 0x9b, 0x10, 0x0, 0x15, 0x63, - 0x0, 0x0, - - /* U+308C "れ" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2b, - 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0x0, 0x46, - 0x0, 0x0, 0x0, 0xc, 0x29, 0x66, 0x50, 0x0, - 0x18, 0x8d, 0x91, 0x4, 0x60, 0x0, 0x0, 0x6c, - 0x0, 0x6, 0x40, 0x0, 0x0, 0xc9, 0x0, 0x8, - 0x10, 0x0, 0x5, 0x79, 0x0, 0xa, 0x0, 0x0, - 0xc, 0x9, 0x0, 0x9, 0x0, 0x12, 0x66, 0x9a, - 0x0, 0x9, 0x35, 0x70, 0x10, 0x68, 0x0, 0x1, - 0x63, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - - /* U+308D "ろ" */ - 0x0, 0x0, 0x36, 0x90, 0x0, 0x0, 0x89, 0x43, - 0xd1, 0x0, 0x0, 0x0, 0x1a, 0x0, 0x0, 0x0, - 0x1, 0x90, 0x0, 0x0, 0x0, 0x1a, 0x57, 0x74, - 0x0, 0x2, 0xda, 0x40, 0x15, 0xa0, 0x2d, 0x40, - 0x0, 0x0, 0x92, 0x11, 0x0, 0x0, 0x0, 0xa1, - 0x0, 0x0, 0x0, 0x3, 0xa0, 0x0, 0x2, 0x56, - 0x88, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - - /* U+308F "わ" */ - 0x0, 0x0,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, 0xb, 0x17, - 0x55, 0x55, 0x55, 0x50, 0x0, 0x6a, 0x0, 0x0, - 0x0, 0x6, 0x0, 0x0, 0xba, 0x1, 0x65, 0x55, - 0x55, 0x10, 0x6, 0x49, 0x0, 0x0, 0x0, 0x6, - 0x0, 0x13, 0x19, 0x1, 0x65, 0x55, 0x55, 0x20, - 0x0, 0x19, 0x0, 0x75, 0x55, 0x58, 0x20, 0x0, - 0x19, 0x0, 0xb0, 0x0, 0xb, 0x0, 0x0, 0x19, - 0x0, 0xb0, 0x0, 0xb, 0x0, 0x0, 0x19, 0x0, - 0xc5, 0x55, 0x5c, 0x0, 0x0, 0x19, 0x0, 0xa0, - 0x0, 0xa, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+4FEE "修" */ - 0x0, 0x3, 0x0, 0x2, 0x20, 0x0, 0x0, 0x0, - 0xd, 0x10, 0x9, 0x60, 0x0, 0x0, 0x0, 0x57, - 0x0, 0xd, 0x55, 0x59, 0x10, 0x0, 0xa1, 0x40, - 0x65, 0x30, 0x69, 0x0, 0x2, 0xf2, 0xb2, 0x40, - 0x78, 0x80, 0x0, 0x8, 0xa1, 0xa0, 0x0, 0x8b, - 0x60, 0x0, 0x34, 0x91, 0xa0, 0x47, 0x14, 0x6c, - 0x90, 0x10, 0x91, 0xa3, 0x10, 0x69, 0x20, 0x0, - 0x0, 0x91, 0xa0, 0x17, 0x30, 0xa6, 0x0, 0x0, - 0x91, 0xa1, 0x20, 0x2a, 0x60, 0x20, 0x0, 0x91, - 0xa0, 0x17, 0x70, 0x2c, 0x90, 0x0, 0x91, 0x1, - 0x30, 0x28, 0xa2, 0x0, 0x0, 0x91, 0x1, 0x57, - 0x71, 0x0, 0x0, 0x0, 0x20, 0x13, 0x0, 0x0, - 0x0, 0x0, - - /* U+500B "個" */ - 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xc7, 0x30, 0x0, 0x0, 0x30, 0x0, 0x2c, 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xd3, 0x56, 0x5a, - 0x5b, 0x67, 0x80, 0x5, 0xd2, 0x0, 0x82, 0x4, - 0x60, 0x0, 0x7, 0x92, 0x15, 0x78, 0x59, 0x6a, - 0x0, 0x20, 0x92, 0x1, 0x0, 0xb0, 0x10, 0x0, - 0x0, 0x92, 0x3, 0x65, 0xc5, 0x73, 0x0, 0x0, - 0x92, 0x45, 0x57, 0xa5, 0x59, 0x60, 0x0, 0x92, - 0x10, 0xa, 0x15, 0x0, 0x0, 0x0, 0x92, 0x1, - 0x92, 0x3, 0x80, 0x0, 0x0, 0x92, 0x46, 0x0, - 0x0, 0x3c, 0x80, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+50F9 "價" */ - 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x4d, 0x46, 0x57, 0x57, 0x56, 0x90, 0x0, 0x85, - 0x2, 0xa, 0xa, 0x2, 0x10, 0x0, 0xc2, 0xc, - 0x5c, 0x5c, 0x5a, 0x40, 0x2, 0xf3, 0xc, 0x5c, - 0x5c, 0x5a, 0x30, 0x7, 0xa2, 0x4, 0x0, 0x0, - 0x3, 0x0, 0x6, 0x82, 0x6, 0x65, 0x55, 0x5b, - 0x0, 0x30, 0x82, 0x6, 0x75, 0x55, 0x59, 0x0, - 0x0, 0x82, 0x6, 0x30, 0x0, 0x19, 0x0, 0x0, - 0x82, 0x6, 0x75, 0x55, 0x59, 0x0, 0x0, 0x82, - 0x6, 0x75, 0x55, 0x59, 0x0, 0x0, 0x82, 0x1, - 0xb3, 0x3, 0x86, 0x0, 0x0, 0x82, 0x48, 0x10, - 0x0, 0x6, 0xb0, 0x0, 0x10, 0x10, 0x0, 0x0, - 0x0, 0x0, - - /* U+5104 "億" */ - 0x0, 0x1, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, - 0x9, 0x70, 0x0, 0xb0, 0x0, 0x0, 0x0, 0xd, - 0x4, 0x65, 0x95, 0x58, 0x50, 0x0, 0x49, 0x0, - 0x55, 0x5, 0xa0, 0x0, 0x0, 0xab, 0x24, 0x48, - 0x49, 0x44, 0xa1, 0x1, 0x99, 0x12, 0x31, 0x11, - 0x24, 0x10, 0x6, 0x29, 0x0, 0xc5, 0x55, 0x6b, - 0x0, 0x2, 0x19, 0x0, 0xc5, 0x55, 0x69, 0x0, - 0x0, 0x19, 0x0, 0xd5, 0x55, 0x6a, 0x0, 0x0, - 0x19, 0x0, 0x42, 0x70, 0x22, 0x0, 0x0, 0x19, - 0x5, 0x1a, 0x63, 0x2a, 0x20, 0x0, 0x19, 0x38, - 0x19, 0x0, 0x83, 0x80, 0x0, 0x2a, 0x41, 0xc, - 0xab, 0xd2, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+512A "優" */ - 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xe, 0x26, 0x55, 0x85, 0x5a, 0x20, 0x0, 0x48, - 0x0, 0xb5, 0x75, 0xb1, 0x0, 0x0, 0x92, 0x0, - 0xc5, 0x55, 0xc0, 0x0, 0x0, 0xd2, 0x0, 0xc5, - 0x55, 0xc0, 0x0, 0x5, 0xe0, 0x75, 0xa5, 0x55, - 0xa5, 0xb0, 0x7, 0xb1, 0xa2, 0x73, 0xa2, 0x25, - 0x40, 0x21, 0xb0, 0x38, 0x83, 0x12, 0x7a, 0x10, - 0x0, 0xb0, 0x31, 0x5a, 0x88, 0x33, 0x0, 0x0, - 0xb0, 0x0, 0xd7, 0x55, 0x92, 0x0, 0x0, 0xb0, - 0x9, 0x47, 0x7, 0x70, 0x0, 0x0, 0xb0, 0x30, - 0x5, 0xf9, 0x0, 0x0, 0x0, 0xb0, 0x4, 0x75, - 0x6, 0xcb, 0x50, 0x0, 0x20, 0x30, 0x0, 0x0, - 0x2, 0x0, - - /* U+513F "儿" */ - 0x0, 0x0, 0x20, 0x3, 0x0, 0x0, 0x0, 0x0, - 0x1d, 0x0, 0xa3, 0x0, 0x0, 0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2, 0x90, 0x1d, 0xa4, 0x0, - 0x36, 0x3, 0x59, 0x60, 0x1, 0x0, 0x5, 0x40, - 0x0, 0x5a, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, - 0x0, 0x0, - - /* U+52AA "努" */ - 0x0, 0x1, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x8, 0x50, 0x1, 0x11, 0x14, 0x0, 0x5, 0x5c, - 0x57, 0x67, 0x44, 0x6d, 0x10, 0x1, 0x28, 0x9, - 0x30, 0x60, 0x93, 0x0, 0x0, 0x92, 0xb, 0x0, - 0x58, 0x80, 0x0, 0x0, 0x16, 0xca, 0x10, 0x2d, - 0x80, 0x0, 0x0, 0x18, 0x44, 0x76, 0x70, 0x5c, - 0x82, 0x14, 0x50, 0x1, 0xa4, 0x0, 0x0, 0x20, - 0x0, 0x35, 0x55, 0xc8, 0x55, 0x75, 0x0, 0x0, - 0x10, 0x1, 0xc0, 0x0, 0x85, 0x0, 0x0, 0x0, - 0x9, 0x50, 0x0, 0xa3, 0x0, 0x0, 0x0, 0x87, - 0x1, 0x31, 0xd0, 0x0, 0x2, 0x57, 0x20, 0x0, - 0x6f, 0x60, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+52B3 "劳" */ - 0x0, 0x0, 0x40, 0x0, 0x30, 0x0, 0x0, 0x0, - 0xc, 0x0, 0xd, 0x0, 0x0, 0x35, 0x55, 0xc5, - 0x55, 0xc5, 0x6d, 0x20, 0x0, 0xb, 0x0, 0xb, - 0x0, 0x0, 0x2, 0x0, 0x60, 0x0, 0x50, 0x2, - 0x0, 0x95, 0x55, 0x65, 0x55, 0x56, 0xe1, 0x3b, - 0x0, 0xb, 0x40, 0x0, 0x51, 0x0, 0x0, 0x0, - 0xc1, 0x0, 0x21, 0x0, 0x4, 0x65, 0x5e, 0x55, - 0x5b, 0x60, 0x0, 0x0, 0x2, 0xb0, 0x0, 0xa2, - 0x0, 0x0, 0x0, 0xa4, 0x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10, 0x40, 0xa0, 0x2, 0x80, 0x6, 0x5b, - 0x65, 0x52, 0x80, 0x4, 0x60, 0x0, 0x1a, 0x65, - 0x48, 0x3, 0x1a, 0x30, 0x1d, 0x94, 0x0, 0x52, - 0x2, 0xca, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x10, 0x0, - - /* U+52D9 "務" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, - 0x44, 0x46, 0x10, 0xd1, 0x0, 0x0, 0x1, 0x20, - 0x2a, 0x45, 0xa5, 0x5d, 0x20, 0x0, 0x19, 0x70, - 0x7, 0x60, 0x38, 0x0, 0x0, 0x1, 0xd0, 0x20, - 0x28, 0xb0, 0x0, 0x5, 0x57, 0x97, 0x70, 0x1a, - 0xb1, 0x0, 0x0, 0xc, 0xa5, 0x14, 0x91, 0x2c, - 0xa4, 0x0, 0x29, 0xa1, 0x63, 0x76, 0x0, 0x40, - 0x0, 0x92, 0xa0, 0x46, 0xc6, 0x5c, 0x30, 0x3, - 0x51, 0xa0, 0x0, 0xb0, 0xb, 0x0, 0x5, 0x1, - 0xa0, 0x5, 0x60, 0xb, 0x0, 0x0, 0x23, 0xa0, - 0x29, 0x0, 0x1b, 0x0, 0x0, 0x4d, 0x63, 0x60, - 0x7, 0xe6, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, - 0x10, 0x0, - - /* U+52DD "勝" */ - 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x8, - 0x55, 0xb0, 0x81, 0xc1, 0x76, 0x0, 0x9, 0x10, - 0xa0, 0x3a, 0xb2, 0x70, 0x0, 0x9, 0x10, 0xa2, - 0x57, 0xc6, 0x78, 0x0, 0x9, 0x65, 0xa0, 0x12, - 0x80, 0x2, 0x0, 0x9, 0x10, 0xb6, 0x5a, 0x77, - 0x58, 0x50, 0x9, 0x10, 0xa0, 0x2a, 0x25, 0x30, - 0x0, 0x9, 0x65, 0xa1, 0x83, 0xa0, 0x7b, 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b, 0x10, 0x80, 0xb, 0x0, - 0x0, 0x0, 0xb, 0x14, 0x0, 0x1a, 0x0, 0x3, - 0x0, 0xb, 0x26, 0x55, 0x7b, 0x55, 0x58, 0x30, - 0xb, 0x10, 0x0, 0x79, 0x10, 0x0, 0x0, 0xb, - 0x10, 0x2, 0xb0, 0x7a, 0x30, 0x0, 0xb, 0x10, - 0x39, 0x0, 0x3, 0xe3, 0x0, 0xb, 0x15, 0x40, - 0x0, 0x0, 0x36, 0x10, 0xb, 0x55, 0x55, 0x55, - 0x55, 0x58, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+5340 "區" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x85, 0x55, - 0x55, 0x55, 0x58, 0x80, 0x92, 0x1, 0x0, 0x0, - 0x30, 0x0, 0x92, 0x5, 0x95, 0x55, 0xc0, 0x0, - 0x92, 0x5, 0x60, 0x0, 0xa0, 0x0, 0x92, 0x5, - 0x95, 0x55, 0xa0, 0x0, 0x92, 0x1, 0x10, 0x0, - 0x20, 0x0, 0x92, 0x85, 0x58, 0x85, 0x5a, 0x10, - 0x92, 0xa0, 0x19, 0xa0, 0xa, 0x0, 0x92, 0xa0, - 0x19, 0xa0, 0xa, 0x0, 0x92, 0xb5, 0x69, 0xa5, - 0x5c, 0x0, 0x92, 0x30, 0x1, 0x20, 0x1, 0x0, - 0xa6, 0x55, 0x55, 0x55, 0x55, 0xe3, 0x20, 0x0, - 0x0, 0x0, 0x0, 0x0, - - /* U+5341 "十" */ - 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xb4, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xb1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xb1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xb1, - 0x0, 0x0, 0x0, 0x25, 0x55, 0x55, 0xc6, 0x55, - 0x5a, 0x90, 0x1,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, - 0x55, 0x55, 0x65, 0x58, 0x90, 0x0, 0xb1, 0x0, - 0x9, 0x30, 0x0, 0x0, 0xb, 0x11, 0x75, 0x95, - 0x59, 0x20, 0x0, 0xb1, 0x1a, 0x0, 0x0, 0x91, - 0x0, 0xb, 0x11, 0xc5, 0x55, 0x5b, 0x10, 0x0, - 0xb0, 0x1a, 0x0, 0x0, 0x91, 0x0, 0xb, 0x1, - 0xc5, 0x57, 0x5b, 0x20, 0x0, 0xb0, 0x3, 0x1, - 0xa0, 0x30, 0x0, 0xb, 0x0, 0x7a, 0x1a, 0x35, - 0x0, 0x2, 0x80, 0x5a, 0x1, 0xa0, 0x4c, 0x30, - 0x71, 0x65, 0x3, 0x5a, 0x0, 0x3c, 0x14, 0x11, - 0x0, 0x1b, 0x50, 0x0, 0x10, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+53B3 "厳" */ - 0x0, 0x1, 0x0, 0x10, 0x0, 0x10, 0x0, 0x0, - 0x2b, 0x4, 0x80, 0x67, 0x0, 0x0, 0x10, 0x80, - 0x8, 0x15, 0x6, 0x0, 0xc, 0x55, 0x55, 0x56, - 0x75, 0x73, 0x0, 0xc1, 0x77, 0x80, 0x59, 0x0, - 0x0, 0xc, 0x0, 0x72, 0x39, 0x10, 0x60, 0x0, - 0xc3, 0xc5, 0xc5, 0xc5, 0x99, 0x10, 0xc, 0xa, - 0x5c, 0x56, 0x8, 0x30, 0x0, 0xb0, 0xa0, 0xa0, - 0x33, 0xb0, 0x0, 0xa, 0xa, 0x5c, 0x0, 0x99, - 0x0, 0x2, 0x70, 0xb4, 0xc5, 0x1b, 0x60, 0x0, - 0x61, 0xa8, 0x3a, 0x5, 0x6b, 0x60, 0x6, 0x0, - 0x0, 0x94, 0x30, 0xb, 0x50, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+53BB "去" */ - 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xa, 0x40, 0x0, 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 0x0, 0xa, 0x1a, 0x6, 0x30, 0x0, - 0xa0, 0x40, 0xa0, 0xa0, 0xc2, 0x7b, 0x55, 0x55, - 0xa, 0xa, 0x3e, 0x4, 0xa0, 0x2, 0x0, 0xa0, - 0xa4, 0xa0, 0x95, 0xb5, 0x62, 0xa, 0xa, 0xa, - 0x32, 0xb, 0x0, 0x0, 0xa5, 0xc0, 0xa4, 0x55, - 0xc6, 0x59, 0xb, 0x9, 0xa, 0x0, 0xa, 0x60, - 0x0, 0x60, 0x0, 0xa0, 0x6, 0x56, 0x30, 0x0, - 0x0, 0xa, 0x1, 0x90, 0xb, 0x10, 0x0, 0x0, - 0xb2, 0x60, 0x0, 0x3b, 0x0, 0x0, 0x1, 0x10, - 0x0, 0x0, 0x0, - - /* U+559C "喜" */ - 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xb, 0x10, 0x4, 0x10, 0x2, 0x65, 0x55, - 0xc5, 0x55, 0x75, 0x0, 0x0, 0x22, 0x2c, 0x22, - 0x91, 0x0, 0x0, 0x6, 0x32, 0x22, 0x26, 0x10, - 0x0, 0x0, 0xb5, 0x55, 0x55, 0xc1, 0x0, 0x0, - 0xb, 0x55, 0x55, 0x5c, 0x0, 0x0, 0x0, 0x63, - 0x30, 0x8, 0x40, 0x0, 0x1, 0x11, 0x1b, 0x13, - 0x51, 0x18, 0x21, 0x64, 0x54, 0x44, 0x44, 0x54, - 0x42, 0x0, 0xa, 0x55, 0x55, 0x5b, 0x40, 0x0, - 0x0, 0xa0, 0x0, 0x0, 0x82, 0x0, 0x0, 0xb, - 0x55, 0x55, 0x5b, 0x30, 0x0, 0x0, 0x30, 0x0, - 0x0, 0x20, 0x0, - - /* U+559D "喝" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, - 0x10, 0xc5, 0x55, 0x5e, 0x0, 0xb5, 0x6c, 0xc, - 0x0, 0x0, 0xc0, 0xc, 0x1, 0xa0, 0xd5, 0x55, - 0x5c, 0x0, 0xc0, 0x1a, 0xd, 0x55, 0x55, 0xc0, - 0xc, 0x1, 0xa0, 0x8a, 0x0, 0x4, 0x0, 0xc0, - 0x1a, 0xa, 0x73, 0x33, 0x37, 0xc, 0x56, 0xb6, - 0x52, 0x86, 0x22, 0xb0, 0xc0, 0x8, 0xa5, 0x1c, - 0x60, 0x18, 0x9, 0x0, 0x26, 0x38, 0x13, 0xa3, - 0x70, 0x0, 0x0, 0x65, 0x0, 0x16, 0x46, 0x0, - 0x0, 0x6, 0x65, 0x55, 0x47, 0x40, 0x0, 0x0, - 0x0, 0x0, 0x3b, 0xd0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x11, 0x0, - - /* U+55AE "單" */ - 0x0, 0x10, 0x3, 0x2, 0x0, 0x11, 0x0, 0x0, - 0xb5, 0x5c, 0x1b, 0x55, 0x87, 0x0, 0x0, 0xb0, - 0xb, 0xa, 0x0, 0x55, 0x0, 0x0, 0xb5, 0x5a, - 0xb, 0x55, 0x85, 0x0, 0x0, 0x27, 0x55, 0x65, - 0x55, 0xa0, 0x0, 0x0, 0x38, 0x0, 0x90, 0x0, - 0xb0, 0x0, 0x0, 0x2b, 0x55, 0xb5, 0x55, 0xb0, - 0x0, 0x0, 0x28, 0x0, 0x90, 0x0, 0xb0, 0x0, - 0x0, 0x3b, 0x55, 0xb5, 0x55, 0xb0, 0x0, 0x0, - 0x11, 0x0, 0x90, 0x0, 0x13, 0x20, 0x16, 0x55, - 0x55, 0xb5, 0x55, 0x56, 0x60, 0x0, 0x0, 0x0, - 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30, 0x0, - 0x0, 0x0, - - /* U+55B6 "営" */ - 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x91, 0x9, 0x10, 0x87, 0x0, 0x0, 0x5, 0x90, - 0x57, 0x18, 0x0, 0x0, 0x20, 0x2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0x0, - 0x92, 0x3, 0xb0, 0x0, 0x0, 0x88, 0x0, 0x92, - 0x9, 0x80, 0x0, 0x0, 0xc5, 0xa0, 0x92, 0x1a, - 0x2b, 0x0, 0x6, 0x40, 0xb4, 0x92, 0x71, 0x9, - 0x60, 0x16, 0x0, 0x20, 0x95, 0x30, 0x1, 0x10, - 0x10, 0x35, 0x55, 0xb7, 0x55, 0xd3, 0x0, 0x0, - 0x10, 0x0, 0x92, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x92, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x92, 0x0, 0x5, 0x40, 0x26, 0x55, 0x55, 0x65, - 0x55, 0x57, 0x70, - - /* U+578B "型" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x0, 0x15, - 0x55, 0x58, 0x80, 0x0, 0xb1, 0x0, 0xa, 0x9, - 0x20, 0xb, 0xb, 0x0, 0x0, 0xa0, 0x92, 0x30, - 0xb0, 0xb0, 0x5, 0x5c, 0x5b, 0x78, 0x3b, 0xb, - 0x0, 0x0, 0xb0, 0x92, 0x0, 0xb0, 0xb0, 0x0, - 0x28, 0x9, 0x20, 0x3, 0xb, 0x0, 0x9, 0x0, - 0x92, 0x0, 0x38, 0xd0, 0x5, 0x10, 0x1, 0xa5, - 0x0, 0x23, 0x0, 0x1, 0x55, 0x5c, 0x75, 0x5c, - 0x30, 0x0, 0x1, 0x0, 0xa3, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xa, 0x30, 0x0, 0x10, 0x4, 0x55, - 0x55, 0xb7, 0x55, 0x5e, 0x80, 0x10, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+57DF "域" */ - 0x0, 0x0, 0x0, 0x0, 0x2, 0x10, 0x0, 0x0, - 0x94, 0x0, 0x0, 0xc, 0x2b, 0x20, 0x0, 0x92, - 0x0, 0x0, 0xb, 0x4, 0x40, 0x0, 0x92, 0x36, - 0x55, 0x5c, 0x56, 0xa1, 0x25, 0xb8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 0x58, - 0x55, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+58CA "壊" */ - 0x0, 0x10, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, - 0xb2, 0x0, 0x0, 0xd1, 0x2, 0x20, 0x0, 0xb0, - 0x26, 0x55, 0xd5, 0x56, 0x50, 0x0, 0xb0, 0x5, - 0x55, 0xd5, 0x58, 0x20, 0x25, 0xc6, 0x8a, 0xa, - 0xa, 0xa, 0x0, 0x1, 0xb0, 0xa, 0xa, 0xa, - 0xa, 0x0, 0x0, 0xb0, 0xb, 0x59, 0x59, 0x5c, - 0x0, 0x0, 0xb0, 0x1, 0x0, 0xa1, 0x3, 0x0, - 0x0, 0xb0, 0x26, 0x5b, 0x95, 0x58, 0x20, 0x0, - 0xb6, 0x50, 0x86, 0x24, 0x1b, 0x0, 0x2a, 0x91, - 0x7, 0xc3, 0x9, 0x71, 0x0, 0x5, 0x2, 0x62, - 0x73, 0x42, 0xd4, 0x0, 0x0, 0x1, 0x0, 0x8a, - 0x10, 0x3e, 0x91, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+58D3 "壓" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x0, 0xc, - 0x55, 0x55, 0x55, 0x65, 0x83, 0x0, 0xb3, 0x95, - 0x5b, 0xa, 0x27, 0x0, 0xb, 0x39, 0x55, 0xa0, - 0xa0, 0x52, 0x0, 0xb3, 0x75, 0x57, 0x5c, 0x59, - 0x0, 0x9, 0x67, 0x55, 0xb0, 0xa4, 0x0, 0x3, - 0x76, 0x85, 0x5a, 0x9, 0x60, 0x0, 0x62, 0x68, - 0x55, 0xa5, 0x45, 0x50, 0x8, 0x6, 0x40, 0x5a, - 0x60, 0xc, 0x42, 0x30, 0x31, 0x1, 0x70, 0x0, - 0x10, 0x0, 0x25, 0x55, 0x6b, 0x55, 0xa0, 0x0, - 0x0, 0x10, 0x1, 0x80, 0x0, 0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x1, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+58F2 "売" */ - 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xa, 0x20, 0x2, 0x10, 0x2, 0x65, 0x55, - 0xc6, 0x55, 0x86, 0x0, 0x0, 0x0, 0xa, 0x10, - 0x21, 0x0, 0x0, 0x16, 0x55, 0x75, 0x57, 0x40, - 0x0, 0x55, 0x55, 0x55, 0x55, 0x55, 0x82, 0xa, - 0x10, 0x0, 0x0, 0x0, 0xa, 0x20, 0x80, 0x6, - 0x60, 0x36, 0x1, 0x10, 0x0, 0x0, 0x86, 0x4, - 0x80, 0x0, 0x0, 0x0, 0x9, 0x30, 0x48, 0x0, - 0x0, 0x0, 0x0, 0xc0, 0x4, 0x80, 0x4, 0x0, - 0x0, 0x58, 0x0, 0x38, 0x0, 0x52, 0x0, 0x66, - 0x0, 0x2, 0xea, 0xac, 0x51, 0x40, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+5909 "変" */ - 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x5a, 0x0, 0x0, 0x30, 0x4, 0x65, - 0x58, 0x59, 0x68, 0x56, 0xb3, 0x0, 0x2, 0x1c, - 0x0, 0x3b, 0x0, 0x0, 0x0, 0x1c, 0x4c, 0x0, - 0x3c, 0x86, 0x0, 0x0, 0x91, 0x1c, 0x0, 0x3b, - 0x8, 0xb0, 0x5, 0x0, 0xa, 0x10, 0x11, 0x0, - 0x50, 0x0, 0x0, 0x4e, 0x65, 0x55, 0x91, 0x0, - 0x0, 0x2, 0x95, 0x0, 0x7, 0xc2, 0x0, 0x0, - 0x35, 0x4, 0x60, 0x7a, 0x0, 0x0, 0x0, 0x10, - 0x0, 0x6d, 0x80, 0x0, 0x0, 0x0, 0x0, 0x17, - 0x94, 0xa9, 0x40, 0x0, 0x1, 0x56, 0x61, 0x0, - 0x3, 0x9e, 0xe5, 0x2, 0x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, 0x55, 0x5b, 0x0, 0x0, - 0xb, 0x0, 0x0, 0x0, 0xb0, 0x0, 0x0, 0xb0, - 0x0, 0x6, 0xc9, 0x0, 0x0, 0x2, 0x0, 0x0, - 0x3, 0x0, 0x0, - - /* U+5BB6 "家" */ - 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x78, 0x0, 0x0, 0x0, 0x0, 0x95, - 0x55, 0x58, 0x55, 0x57, 0xa0, 0x6, 0x80, 0x0, - 0x0, 0x0, 0x7, 0x20, 0x1, 0x5, 0x55, 0x95, - 0x57, 0x70, 0x0, 0x0, 0x0, 0x1b, 0x60, 0x0, - 0x50, 0x0, 0x0, 0x4, 0x81, 0x92, 0x8, 0x71, - 0x0, 0x3, 0x53, 0x6, 0x7b, 0x54, 0x0, 0x0, - 0x0, 0x1, 0x84, 0x1e, 0x37, 0x0, 0x0, 0x1, - 0x56, 0x2, 0xb8, 0x75, 0x60, 0x0, 0x2, 0x0, - 0x49, 0x14, 0x80, 0x99, 0x20, 0x0, 0x37, 0x40, - 0x6, 0x60, 0x7, 0x80, 0x14, 0x20, 0x4, 0xbd, - 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+5BB9 "容" */ - 0x0, 0x0, 0x1, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x87, 0x0, 0x0, 0x0, 0x0, 0x95, - 0x55, 0x58, 0x55, 0x57, 0x70, 0x5, 0x80, 0x40, - 0x0, 0x20, 0x8, 0x30, 0x5, 0x12, 0xc3, 0x42, - 0x3a, 0x51, 0x0, 0x0, 0x29, 0x10, 0xd7, 0x0, - 0xb7, 0x0, 0x2, 0x40, 0xa, 0x54, 0x40, 0x4, - 0x0, 0x0, 0x0, 0x97, 0x0, 0x58, 0x0, 0x0, - 0x0, 0x9, 0x90, 0x0, 0x7, 0xda, 0x61, 0x4, - 0x71, 0xd5, 0x55, 0x5d, 0x36,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x55, 0xc5, - 0x5d, 0x0, 0x0, 0xc0, 0x1, 0xa0, 0xb, 0x0, - 0x0, 0xd5, 0x55, 0x75, 0x5d, 0x10, 0x0, 0x20, - 0x0, 0x0, 0x0, 0x0, - - /* U+5BD2 "寒" */ - 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x10, 0x0, 0x39, 0x0, 0x0, 0x10, 0x1, 0x95, - 0x55, 0x57, 0x55, 0x56, 0xd0, 0xa, 0x30, 0x1a, - 0x0, 0xb1, 0x14, 0x10, 0x0, 0x45, 0x6c, 0x55, - 0xc5, 0x93, 0x0, 0x0, 0x0, 0x1a, 0x0, 0xb0, - 0x51, 0x0, 0x0, 0x25, 0x6c, 0x55, 0xc5, 0x52, - 0x0, 0x4, 0x55, 0x6c, 0x55, 0xc5, 0x58, 0xc0, - 0x0, 0x0, 0x68, 0x0, 0x42, 0x0, 0x0, 0x0, - 0x3, 0xa0, 0x78, 0x8, 0x40, 0x0, 0x0, 0x38, - 0x0, 0x7, 0x0, 0x9d, 0x81, 0x4, 0x30, 0x15, - 0x87, 0x20, 0x2, 0x30, 0x0, 0x0, 0x0, 0x5, - 0xe2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+5BDD "寝" */ - 0x0, 0x0, 0x2, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xa, 0x50, 0x0, 0x0, 0x2, 0x85, 0x55, - 0x66, 0x55, 0x5a, 0x30, 0x84, 0x30, 0x0, 0x0, - 0x2, 0x50, 0x3, 0xb, 0x12, 0x65, 0x55, 0xc1, - 0x0, 0x71, 0xb0, 0x5, 0x55, 0x5c, 0x0, 0x4, - 0x8b, 0x2, 0x65, 0x55, 0xc0, 0x0, 0x1, 0xb0, - 0x53, 0x33, 0x34, 0x60, 0x2, 0x8c, 0x38, 0x11, - 0x12, 0x59, 0x13, 0xb0, 0xb3, 0x27, 0x65, 0x99, - 0x0, 0x0, 0xb, 0x0, 0x7, 0x2a, 0x0, 0x0, - 0x0, 0xb0, 0x0, 0x4f, 0x30, 0x0, 0x0, 0xb, - 0x1, 0x65, 0x17, 0xba, 0x60, 0x0, 0x32, 0x20, - 0x0, 0x0, 0x20, - - /* U+5BDF "察" */ - 0x0, 0x0, 0x0, 0x31, 0x0, 0x0, 0x0, 0x0, - 0x10, 0x0, 0xc, 0x0, 0x0, 0x20, 0x0, 0x95, - 0x65, 0x55, 0x55, 0x56, 0xd2, 0x6, 0x71, 0xd1, - 0x11, 0x10, 0x5, 0x10, 0x0, 0xa, 0x75, 0xd5, - 0x85, 0x5d, 0x50, 0x0, 0x57, 0x93, 0xa0, 0x52, - 0x54, 0x0, 0x2, 0x82, 0x5a, 0x10, 0x1a, 0x50, - 0x0, 0x1, 0x8, 0x96, 0x55, 0x74, 0xb7, 0x10, - 0x0, 0x18, 0x10, 0x0, 0x0, 0x89, 0xd2, 0x4, - 0x45, 0x55, 0x6c, 0x55, 0x52, 0x0, 0x0, 0x0, - 0xb4, 0x1a, 0x16, 0x10, 0x0, 0x0, 0x19, 0x30, - 0x1a, 0x0, 0xb6, 0x0, 0x3, 0x60, 0x6, 0xc9, - 0x0, 0x1b, 0x0, 0x0, 0x0, 0x0, 0x30, 0x0, - 0x0, 0x0, - - /* U+5BE6 "實" */ - 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x58, 0x0, 0x0, 0x0, 0x0, 0x84, - 0x44, 0x47, 0x44, 0x48, 0x60, 0x1, 0xb3, 0x55, - 0x55, 0x55, 0x87, 0x0, 0x2, 0x28, 0x52, 0x67, - 0x22, 0xb5, 0x80, 0x5, 0x3b, 0x43, 0x95, 0x36, - 0x93, 0x30, 0x0, 0x9, 0x55, 0x65, 0x57, 0x50, - 0x0, 0x0, 0xa, 0x55, 0x55, 0x55, 0xd0, 0x0, - 0x0, 0xb, 0x55, 0x55, 0x55, 0xb0, 0x0, 0x0, - 0xb, 0x55, 0x55, 0x55, 0xb0, 0x0, 0x0, 0xb, - 0x55, 0x55, 0x55, 0xb0, 0x0, 0x0, 0x3, 0x29, - 0x0, 0x56, 0x40, 0x0, 0x0, 0x37, 0x72, 0x0, - 0x3, 0xc7, 0x0, 0x2, 0x10, 0x0, 0x0, 0x0, - 0x3, 0x0, - - /* U+5BEB "寫" */ - 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x76, 0x0, 0x0, 0x0, 0x8, 0x55, 0x56, - 0x95, 0x55, 0x67, 0x7, 0x50, 0x5, 0x40, 0x0, - 0x26, 0x40, 0x61, 0xa5, 0x41, 0x46, 0x5d, 0x20, - 0x0, 0xc, 0x58, 0x31, 0x55, 0xb0, 0x0, 0x0, - 0xb0, 0x0, 0x1, 0xb, 0x0, 0x0, 0xc, 0x8a, - 0x55, 0x55, 0xa0, 0x0, 0x0, 0x1d, 0x65, 0x55, - 0x55, 0x91, 0x0, 0x38, 0x10, 0x2, 0x14, 0xb, - 0x0, 0x23, 0x60, 0x80, 0x91, 0xb1, 0xb0, 0x0, - 0x2c, 0x8, 0x24, 0x12, 0x39, 0x0, 0x1, 0x20, - 0x0, 0x4, 0xad, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x2, 0x20, 0x0, - - /* U+5BFA "寺" */ - 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xd1, 0x0, 0x0, 0x0, 0x1, 0x55, - 0x55, 0xe5, 0x55, 0x99, 0x0, 0x0, 0x10, 0x0, - 0xd0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd0, - 0x0, 0x1, 0x40, 0x36, 0x55, 0x55, 0x85, 0x66, - 0x57, 0x91, 0x0, 0x0, 0x0, 0x0, 0x2d, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x2b, 0x6, 0x30, - 0x6, 0x57, 0x55, 0x55, 0x6c, 0x55, 0x40, 0x0, - 0x1, 0xb0, 0x0, 0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, 0x0, 0x30, - 0xb, 0x22, 0x97, 0x0, 0x0, 0xac, 0xa8, 0x76, - 0x84, 0x96, 0x0, 0x45, 0x55, 0x55, 0x5c, 0x75, - 0xd7, 0x1, 0x3, 0x40, 0x0, 0xa2, 0x0, 0x0, - 0x0, 0xb, 0x30, 0xa, 0x20, 0x0, 0x0, 0x0, - 0x30, 0x3a, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x1, 0x0, 0x0, - - /* U+5C0D "對" */ - 0x0, 0x3, 0x3, 0x0, 0x0, 0x2, 0x0, 0x1, - 0xc, 0xc, 0x1, 0x0, 0xd, 0x0, 0x8, 0x4a, - 0xa, 0x67, 0x0, 0xb, 0x0, 0x2, 0x4a, 0xc, - 0x42, 0x0, 0xb, 0x0, 0x16, 0x58, 0x59, 0x5a, - 0x10, 0xb, 0x51, 0x0, 0x72, 0xb, 0x10, 0x65, - 0x5c, 0x52, 0x0, 0x38, 0x25, 0x22, 0x30, 0xb, - 0x0, 0x4, 0x66, 0xa5, 0x70, 0xb3, 0xb, 0x0, - 0x0, 0x2, 0x90, 0x0, 0x59, 0xb, 0x0, 0x1, - 0x66, 0xb6, 0x90, 0x1, 0xb, 0x0, 0x0, 0x2, - 0x90, 0x0, 0x0, 0xb, 0x0, 0x0, 0x2, 0xa3, - 0x42, 0x1, 0x1b, 0x0, 0xb, 0xb8, 0x52, 0x0, - 0x5, 0xe8, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, - 0x10, 0x0, - - /* U+5C0E "導" */ - 0x0, 0x10, 0x0, 0x30, 0x2, 0x0, 0x0, 0x0, - 0x94, 0x0, 0x2a, 0x8, 0x31, 0x0, 0x0, 0x38, - 0x46, 0x58, 0x77, 0x59, 0x60, 0x1, 0x26, 0x9, - 0x57, 0x55, 0x86, 0x0, 0x1, 0x3c, 0xb, 0x55, - 0x55, 0x95, 0x0, 0x0, 0xb, 0xb, 0x44, 0x44, - 0x95, 0x0, 0x0, 0xb, 0xb, 0x55, 0x55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 0x60, - 0x56, 0x5c, 0x65, 0x66, 0x0, 0x8, 0x0, 0x0, - 0xa, 0x10, 0x0, 0x0, 0x15, 0x5, 0x55, 0x5c, - 0x65, 0x58, 0xc0, 0x10, 0x1, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+5C55 "展" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x86, 0x55, 0x55, 0x55, 0x5d, 0x0, 0x0, 0x83, - 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x87, 0x55, - 0x55, 0x55, 0x5c, 0x0, 0x0, 0x83, 0x3, 0xa0, - 0x1a, 0x2, 0x0, 0x0, 0x97, 0x57, 0xb5, 0x6b, - 0x69, 0x0, 0x0, 0x92, 0x3, 0x80, 0x1a, 0x0, - 0x0, 0x0, 0xa1, 0x3, 0x80, 0x1a, 0x5, 0x50, - 0x0, 0xb5, 0x5c, 0x59, 0x55, 0x75, 0x40, 0x0, - 0xb0, 0xb, 0x5, 0x32, 0xb3, 0x0, 0x2, 0x70, - 0xb, 0x0, 0xa7, 0x0, 0x0, 0x7, 0x10, 0xb, - 0x55, 0x1b, 0x83, 0x10, 0x15, 0x0, 0x1e, 0x40, - 0x0, 0x6d, 0xa1, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+5C65 "履" */ - 0x0, 0x10, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, - 0xa6, 0x55, 0x55, 0x55, 0x5c, 0x10, 0x0, 0x96, - 0x55, 0x55, 0x55, 0x5c, 0x0, 0x0, 0x91, 0x27, - 0x9, 0x30, 0x5, 0x0, 0x0, 0x91, 0x92, 0xc, - 0x55, 0x58, 0x20, 0x0, 0x95, 0x46, 0x6b, 0x55, - 0x5b, 0x0, 0x0, 0xa2, 0x69, 0x5a, 0x55, 0x5a, - 0x0, 0x0, 0xa0, 0xc1, 0xa, 0x0, 0xa, 0x0, - 0x0, 0xa6, 0xc1, 0x7, 0xc6, 0x56,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x0, 0x0, 0x18, - 0x2, 0xa, 0x18, 0x3, 0x0, 0x1, 0xb6, 0x6b, - 0x1b, 0xa8, 0x5c, 0x30, 0x0, 0x32, 0x80, 0xa, - 0x10, 0x82, 0x0, 0x0, 0x36, 0x28, 0xb, 0x3a, - 0x47, 0x60, 0x0, 0x99, 0x67, 0x3a, 0x2a, 0x30, - 0x90, 0x0, 0x3, 0x90, 0x9, 0x12, 0x73, 0x40, - 0x5, 0x58, 0x95, 0x59, 0x85, 0x57, 0x60, 0x0, - 0x9, 0x80, 0x2, 0x90, 0xaa, 0x0, 0x0, 0x9, - 0x3c, 0x0, 0xbb, 0x70, 0x2, 0x0, 0x71, 0x3, - 0x4, 0xac, 0x40, 0x24, 0x5, 0x20, 0x4, 0x73, - 0x1, 0x9c, 0xc4, 0x1, 0x0, 0x30, 0x0, 0x0, - 0x1, 0x52, - - /* U+5E83 "広" */ - 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xc2, 0x0, 0x0, 0x0, 0x20, 0x0, - 0x5, 0x30, 0x8, 0x20, 0x9, 0x85, 0x55, 0x55, - 0x55, 0x53, 0x0, 0x94, 0x0, 0x4, 0x20, 0x0, - 0x0, 0x9, 0x30, 0x0, 0xb7, 0x0, 0x0, 0x0, - 0xa3, 0x0, 0x2d, 0x0, 0x0, 0x0, 0xb, 0x10, - 0x8, 0x40, 0x0, 0x0, 0x0, 0xc0, 0x1, 0xa0, - 0x0, 0x0, 0x0, 0xa, 0x0, 0x82, 0x0, 0x19, - 0x10, 0x3, 0x50, 0x46, 0x0, 0x0, 0x3d, 0x10, - 0x70, 0x2e, 0x99, 0x98, 0x87, 0xc8, 0x15, 0x0, - 0x84, 0x10, 0x0, 0x2, 0x61, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+5E86 "庆" */ - 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x1d, 0x0, 0x0, 0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x25, 0xb, 0x0, 0xb, - 0x0, 0x6, 0x9, 0x20, 0xd, 0x55, 0x5c, 0x0, - 0x10, 0x7, 0x20, 0x46, 0x0, 0x4, 0x0, 0x0, - 0x0, 0x71, 0x2d, 0x0, 0x2, 0x0, 0x0, 0x70, - 0xb0, 0x7, 0x14, 0x7, 0x60, 0x4, 0xa0, 0xb0, - 0x0, 0x6, 0x10, 0xc0, 0x4, 0x20, 0x8a, 0x99, - 0x9c, 0x40, 0x0, - - /* U+6108 "愈" */ - 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xab, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa5, - 0x17, 0x0, 0x0, 0x0, 0x3, 0x93, 0x11, 0x7b, - 0x61, 0x0, 0x35, 0x52, 0x36, 0x33, 0x17, 0xda, - 0x10, 0xc, 0x55, 0xb0, 0x80, 0xc0, 0x0, 0x0, - 0xb4, 0x4a, 0x9, 0xa, 0x0, 0x0, 0xc, 0x55, - 0xa0, 0xa0, 0xa0, 0x0, 0x0, 0xa0, 0x69, 0x3, - 0x2b, 0x0, 0x0, 0x5, 0x23, 0x84, 0x5, 0x60, - 0x0, 0x1, 0x18, 0x40, 0xc0, 0x0, 0x70, 0x0, - 0xa1, 0x83, 0x0, 0x2, 0x15, 0xa0, 0x27, 0x5, - 0xb9, 0x99, 0xb6, 0x2, 0x0, - - /* U+610F "意" */ - 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x75, 0x0, 0x30, 0x0, 0x0, 0x25, - 0x76, 0x66, 0x97, 0x80, 0x0, 0x0, 0x0, 0xc, - 0x0, 0xa1, 0x1, 0x0, 0x6, 0x55, 0x57, 0x56, - 0x65, 0x59, 0x80, 0x0, 0x7, 0x55, 0x55, 0x55, - 0x70, 0x0, 0x0, 0xb, 0x0, 0x0, 0x2, 0x90, - 0x0, 0x0, 0xc, 0x55, 0x55, 0x56, 0x90, 0x0, - 0x0, 0xc, 0x55, 0x55, 0x56, 0x90, 0x0, 0x0, - 0x5, 0x20, 0x71, 0x1, 0x30, 0x0, 0x0, 0x50, - 0xc0, 0x3a, 0x1, 0x39, 0x10, 0x2, 0xa0, 0xb0, - 0x1, 0x6, 0x6, 0x90, 0x8, 0x40, 0xaa, 0x99, - 0x9d, 0x10, 0x10, - - /* U+611A "愚" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc5, - 0x58, 0x55, 0x5c, 0x0, 0x0, 0xc0, 0x9, 0x10, - 0xb, 0x0, 0x0, 0xd5, 0x5b, 0x65, 0x5b, 0x0, - 0x0, 0xd5, 0x5b, 0x65, 0x5c, 0x0, 0x3, 0x30, - 0x9, 0x10, 0x1, 0x50, 0xd, 0x55, 0x5b, 0x67, - 0x55, 0xc1, 0xc, 0x1, 0x2a, 0x57, 0xb0, 0xb0, - 0xc, 0xb, 0x74, 0x10, 0x60, 0xb0, 0xb, 0x1, - 0x1a, 0x20, 0x29, 0xb0, 0x3, 0xc, 0x4, 0x80, - 0x23, 0x60, 0x1a, 0xb, 0x0, 0x0, 0x60, 0x97, - 0x74, 0x9, 0xa9, 0x99, 0xc4, 0x13, - - /* U+611B "愛" */ - 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x1, 0x24, - 0x57, 0x8a, 0xcc, 0x50, 0x1, 0x43, 0x7, 0x10, - 0x86, 0x0, 0x2, 0xb, 0x2, 0x60, 0x70, 0x12, - 0x2a, 0x56, 0x5a, 0x75, 0x55, 0xb7, 0xa4, 0x5a, - 0x31, 0xd1, 0x13, 0x80, 0x8, 0x59, 0x30, 0x10, - 0x64, 0x4c, 0x6, 0x4, 0xaa, 0xaa, 0x92, 0x2, - 0x0, 0xa, 0x50, 0x0, 0x10, 0x0, 0x0, 0x5a, - 0x85, 0x59, 0xc0, 0x0, 0x4, 0x50, 0x64, 0x5a, - 0x10, 0x0, 0x1, 0x0, 0x2d, 0xe2, 0x0, 0x0, - 0x2, 0x57, 0x61, 0x3a, 0xdb, 0x93, 0x12, 0x0, - 0x0, 0x0, 0x3, 0x30, - - /* U+611F "感" */ - 0x0, 0x0, 0x0, 0x0, 0x41, 0x10, 0x0, 0x0, - 0x0, 0x0, 0x0, 0xb0, 0xa2, 0x0, 0x0, 0x95, - 0x55, 0x55, 0xc5, 0x67, 0xb0, 0x0, 0xb0, 0x0, - 0x2, 0x91, 0x3, 0x0, 0x0, 0xb3, 0x55, 0x56, - 0x73, 0x2d, 0x10, 0x0, 0xb0, 0x85, 0x58, 0x48, - 0xb3, 0x0, 0x0, 0xb0, 0xb0, 0x1a, 0xe, 0x70, - 0x10, 0x3, 0x70, 0xd5, 0x6a, 0x4a, 0xa0, 0x50, - 0x8, 0x0, 0x60, 0x7, 0x40, 0x5c, 0xb0, 0x22, - 0x0, 0x50, 0x75, 0x0, 0x32, 0x82, 0x0, 0x70, - 0xd0, 0xc, 0x2, 0xc, 0x20, 0x7, 0x80, 0xb0, - 0x0, 0x7, 0x6, 0x40, 0x5, 0x10, 0xb9, 0x99, - 0x9c, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+614B "態" */ - 0x0, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, - 0x51, 0x1, 0xb0, 0x4, 0x0, 0x47, 0x10, 0x47, - 0x1b, 0x58, 0x61, 0x8, 0xa8, 0x54, 0x91, 0xa0, - 0x0, 0x70, 0xa, 0x55, 0x96, 0xb, 0x99, 0xa8, - 0x0, 0xc5, 0x59, 0x51, 0xc0, 0x16, 0x0, 0xb, - 0x0, 0x75, 0x1b, 0x69, 0x61, 0x0, 0xc4, 0x49, - 0x51, 0xb0, 0x0, 0x60, 0xc, 0x6, 0xc4, 0xc, - 0xaa, 0xb8, 0x0, 0x20, 0x55, 0x2a, 0x10, 0x3, - 0x0, 0x6, 0xc, 0x10, 0x47, 0x4, 0x58, 0x4, - 0xb0, 0xc0, 0x0, 0x0, 0x70, 0xc0, 0x42, 0xa, - 0xba, 0xaa, 0xc9, 0x0, 0x0, - - /* U+6163 "慣" */ - 0x0, 0x10, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, - 0xb2, 0x0, 0xc5, 0x87, 0x5c, 0x0, 0x0, 0xb0, - 0x0, 0xb0, 0x92, 0x1a, 0x50, 0x2, 0xb6, 0x56, - 0xb5, 0xd5, 0x8a, 0x50, 0x7, 0xb6, 0x55, 0xa5, - 0xd5, 0x97, 0x0, 0x49, 0xb2, 0x21, 0x10, 0x0, - 0x22, 0x0, 0x31, 0xb0, 0xa, 0x55, 0x55, 0x5c, - 0x0, 0x0, 0xb0, 0xb, 0x44, 0x44, 0x4b, 0x0, - 0x0, 0xb0, 0xb, 0x11, 0x11, 0x1b, 0x0, 0x0, - 0xb0, 0xb, 0x55, 0x55, 0x5b, 0x0, 0x0, 0xb0, - 0xc, 0x55, 0x55, 0x5b, 0x0, 0x0, 0xb0, 0x3, - 0xc4, 0x1, 0x84, 0x0, 0x0, 0xb0, 0x38, 0x20, - 0x0, 0x1d, 0x30, 0x0, 0x10, 0x20, 0x0, 0x0, - 0x1, 0x10, - - /* U+6167 "慧" */ - 0x0, 0x3, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, - 0xc1, 0x40, 0xc, 0x3, 0x20, 0x36, 0x5c, 0x55, - 0x46, 0xc5, 0x53, 0x0, 0x65, 0xc6, 0x53, 0x6c, - 0x59, 0x10, 0x45, 0x5c, 0x59, 0x35, 0xc5, 0x59, - 0x1, 0x0, 0xa0, 0x0, 0x1a, 0x0, 0x0, 0x3, - 0x65, 0x55, 0x55, 0x59, 0x70, 0x0, 0x5, 0x55, - 0x55, 0x55, 0x95, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x6, 0x50, 0x0, 0x27, 0x65, 0x95, 0x55, 0x83, - 0x0, 0x4, 0xa, 0x35, 0x90, 0x21, 0x70, 0x0, - 0xa0, 0xa2, 0x3, 0x7, 0x13, 0xb0, 0x33, 0x7, - 0xb9, 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 0x40, 0x10, 0x0, 0x35, - 0x77, 0x54, 0x98, 0xb0, 0x50, 0x1f, 0xa5, 0x10, - 0x28, 0x10, 0x7c, 0xa0, 0x0, 0x0, 0x5, 0x40, - 0x0, 0x5, 0xd2, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+6226 "戦" */ - 0x0, 0x2, 0x0, 0x10, 0x4, 0x0, 0x0, 0x8, - 0x18, 0x51, 0xb0, 0xe, 0x25, 0x0, 0x4, 0x81, - 0x66, 0x10, 0xc, 0x9, 0x50, 0x9, 0x55, 0x77, - 0xb0, 0xc, 0x1, 0x20, 0xb, 0x1, 0x90, 0xb0, - 0x2d, 0x55, 0x80, 0xb, 0x55, 0xb5, 0xb5, 0x3c, - 0x4, 0x20, 0xb, 0x1, 0x90, 0xb0, 0xc, 0xc, - 0x40, 0xb, 0x55, 0xb5, 0xb0, 0xc, 0x59, 0x0, - 0x7, 0x1, 0x90, 0x60, 0x9, 0xd1, 0x0, 0x0, - 0x1, 0x90, 0x43, 0x8, 0x90, 0x0, 0x27, 0x55, - 0xb5, 0x54, 0x4a, 0xd1, 0x51, 0x0, 0x1, 0x90, - 0x3, 0x90, 0x4d, 0xb0, 0x0, 0x1, 0xa0, 0x56, - 0x0, 0x6, 0xf1, 0x0, 0x0, 0x10, 0x10, 0x0, - 0x0, 0x31, - - /* U+6230 "戰" */ - 0x0, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0xa, - 0x5b, 0x57, 0xb2, 0xd, 0x34, 0x0, 0xa, 0xa, - 0x55, 0x91, 0xd, 0xa, 0x40, 0xb, 0x5b, 0x58, - 0xb1, 0xc, 0x1, 0x10, 0x5, 0x2, 0x21, 0x50, - 0xc, 0x46, 0x80, 0x7, 0x77, 0x95, 0xc3, 0x5c, - 0x3, 0x10, 0x7, 0x77, 0x95, 0xa0, 0xb, 0xb, - 0x40, 0x7, 0x33, 0x70, 0xa0, 0xa, 0x4a, 0x0, - 0x8, 0x77, 0x95, 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0x0, 0x0, 0x2d, 0x60, 0xb8, 0x1, 0xcb, - 0x0, 0x9, 0xc9, 0x0, 0xc2, 0x81, 0x6b, 0x0, - 0x5, 0x19, 0x0, 0x40, 0xc0, 0x4, 0x30, 0x0, - 0x19, 0x16, 0x56, 0xb7, 0x55, 0x81, 0x0, 0x19, - 0x0, 0x9, 0x25, 0x20, 0x0, 0x0, 0x19, 0x0, - 0x76, 0x0, 0xa6, 0x0, 0x4, 0xc7, 0x37, 0x20, - 0x0, 0x9, 0xd2, 0x0, 0x20, 0x10, 0x0, 0x0, - 0x0, 0x0, - - /* U+63EE "揮" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x93, 0x7, 0x55, 0x55, 0x56, 0x80, 0x0, 0x92, - 0xe, 0x10, 0x62, 0x7, 0x30, 0x0, 0x93, 0x13, - 0x0, 0xb1, 0x6, 0x0, 0x35, 0xb7, 0x45, 0x55, - 0xc5, 0x55, 0x20, 0x0, 0x92, 0x6, 0x55, 0xc5, - 0x5a, 0x20, 0x0, 0x93, 0x49, 0x20, 0xb0, 0xb, - 0x0, 0x1, 0xc6, 0x9, 0x65, 0xc5, 0x5c, 0x0, - 0x6c, 0xb2, 0x9, 0x65, 0xc5, 0x5c, 0x0, 0x10, - 0x92, 0x5, 0x0, 0xb0, 0x4, 0x0, 0x0, 0x92, - 0x26, 0x55, 0xc5, 0x58, 0x80, 0x0, 0x92, 0x0, - 0x0, 0xb0, 0x0, 0x0, 0x29, 0xe0, 0x0, 0x0, - 0xb0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x30, - 0x0, 0x0, - - /* U+63FA "揺" */ - 0x0, 0x2, 0x0, 0x0, 0x0, 0x1, 0x10, 0x0, - 0xd, 0x0, 0x1, 0x48, 0xbd, 0xa0, 0x0, 0xb, - 0x2, 0x44, 0x31, 0x0, 0x80, 0x0, 0xb, 0x34, - 0x20, 0x91, 0x5, 0xa0, 0x5, 0x5c, 0x53, 0xc1, - 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 0x60, 0x10, 0x0, 0x0, 0xb, - 0x0, 0x3a, 0x55, 0xd1, 0x0, 0x0, 0xb, 0x20, - 0xb5, 0x57, 0x65, 0xa0, 0x5, 0x5c, 0x65, 0xc1, - 0xa2, 0x37, 0x0, 0x0, 0xb, 0x0, 0xb5, 0x18, - 0x36, 0x30, 0x0, 0xb, 0x62, 0xb5, 0x56, 0x55, - 0x81, 0x0, 0x3d, 0x10, 0xb2, 0x55, 0x59, 0x0, - 0x9, 0x9b, 0x0, 0xa0, 0x0, 0x5, 0x0, 0x5, - 0xb, 0x3, 0x72, 0x65, 0x55, 0x10, 0x0, 0xb, - 0x8, 0x28, 0x65, 0x5b, 0x20, 0x1, 0xb, 0x7, - 0x8, 0x30, 0xa, 0x10, 0x2, 0xd7, 0x50, 0x8, - 0x75, 0x5a, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+64DA "據" */ - 0x0, 0x1, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, - 0x1b, 0x0, 0x0, 0xb1, 0x4, 0x0, 0x0, 0x19, - 0x1, 0x0, 0xb5, 0x55, 0x20, 0x0, 0x19, 0x29, - 0x65, 0xb6, 0x55, 0xd1, 0x5, 0x6b, 0x6a, 0x10, - 0xb5, 0x83, 0x20, 0x0, 0x19, 0x9, 0x44, 0xb1, - 0x7, 0x0, 0x0, 0x1a, 0x49, 0x10, 0x37, 0x76, - 0x40, 0x0, 0x4c, 0xa, 0x45, 0xa8, 0x57, 0x60, - 0x9, 0xa9, 0xa, 0x5, 0x84, 0x1b, 0x20, 0x4, - 0x19, 0xa, 0x23, 0x8a, 0x90, 0x0, 0x0, 0x19, - 0x26, 0x56, 0x4a, 0x97, 0x0, 0x0, 0x19, 0x61, - 0x27, 0x60, 0xb4, 0xc2, 0x5, 0xc7, 0x42, 0x30, - 0x39, 0x90, 0x10, 0x0, 0x20, 0x0, 0x0, 0x2, - 0x0, 0x0, - - /* U+652F "支" */ - 0x0, 0x0, 0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x0, 0x83, - 0x0, 0x75, 0x1c, 0x20, 0x0, 0x27, 0xd1, 0x26, - 0x20, 0x3, 0xd4, 0x0, 0x0, 0x30, 0x10, 0x0, - 0x0, 0x0, - - /* U+6562 "敢" */ - 0x0, 0x0, 0x0, 0x0, 0x12, 0x0, 0x0, 0x1, - 0x55, 0x58, 0x0, 0x5a, 0x0, 0x0, 0x0, 0x0, - 0x48, 0x0, 0x83, 0x0, 0x0, 0x15, 0x55, 0xa6, - 0x86, 0xb5, 0x56, 0xa0, 0x0, 0xb0, 0xb, 0x0, - 0xa0, 0x1a, 0x0, 0x0, 0xb0, 0xb, 0x5, 0x80, - 0x38, 0x0, 0x0, 0xc5, 0x5c, 0x7, 0x50, 0x65, - 0x0, 0x0, 0xb0, 0xb, 0x13, 0x34, 0x92, 0x0, - 0x0, 0xc5, 0x5c, 0x0, 0x8, 0xb0, 0x0, 0x0, - 0xb0, 0xb, 0x33, 0x9, 0x70, 0x0, 0x16, 0xe9, - 0x7d, 0x10, 0x1b, 0xb0, 0x0, 0x8, 0x20, 0xb, - 0x0, 0x91, 0x4b, 0x10, 0x0, 0x0, 0xb, 0x27, - 0x10, 0x5, 0xc2, 0x0, 0x0, 0x1, 0x20, 0x0, - 0x0, 0x0, - - /* U+6570 "数" */ - 0x0, 0x0, 0x30, 0x0, 0x11, 0x0, 0x0, 0x1, - 0x40, 0xc1, 0x62, 0x5b, 0x0, 0x0, 0x0, 0xb3, - 0xb1, 0x90, 0x93, 0x0, 0x0, 0x0, 0x31, 0xb3, - 0x41, 0xb0, 0x0, 0x60, 0x6, 0x5b, 0xe5, 0x56, - 0xb5, 0x5d, 0x51, 0x0, 0x48, 0xb9, 0x77, 0x50, - 0x1a, 0x0, 0x4, 0x60, 0xa0, 0x54, 0x50, 0x38, - 0x0, 0x11, 0x4, 0x90, 0x10, 0x52, 0x65, 0x0, - 0x6, 0x5b, 0x75, 0xc0, 0x17, 0xb1, 0x0, 0x0, - 0x29, 0x7, 0x50, 0xa, 0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x75, 0x54, 0xb5, - 0x87, 0x80, 0xb, 0x58, 0x56, 0x90, 0xb0, 0x92, - 0x0, 0xb, 0xa, 0x16, 0x40, 0xb0, 0x92, 0x0, - 0xb, 0x68, 0x79, 0xb1, 0xb0, 0x92, 0x0, 0xb, - 0x18, 0x4, 0x60, 0xa0, 0x92, 0x0, 0xb, 0x48, - 0x8a, 0x92, 0x80, 0x92, 0x0, 0xb, 0x0, 0x36, - 0x47, 0x20, 0x92, 0x0, 0x8, 0x55, 0x55, 0x46, - 0x0, 0x92, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x10, 0x0, - - /* U+65B9 "方" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xa5, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x29, 0x0, 0x0, 0x20, 0x16, 0x55, 0x55, - 0x85, 0x55, 0x57, 0xb1, 0x0, 0x0, 0x2, 0xa0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x80, 0x0, - 0x20, 0x0, 0x0, 0x0, 0x6, 0x95, 0x55, 0xe2, - 0x0, 0x0, 0x0, 0xa, 0x10, 0x1, 0xc0, 0x0, - 0x0, 0x0, 0xb, 0x0, 0x3, 0xa0, 0x0, 0x0, - 0x0, 0x73, 0x0, 0x5, 0x80, 0x0, 0x0, 0x2, - 0x80, 0x0, 0x8, 0x50, 0x0, 0x0, 0x28, 0x0, - 0x22, 0xc, 0x20, 0x0, 0x3, 0x50, 0x0, 0x7, - 0xfa, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x20, - 0x0, 0x0, - - /* U+65BC "於" */ - 0x0, 0x2, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, - 0x9, 0x30, 0x0, 0x7a, 0x0, 0x0, 0x0, 0x3, - 0x52, 0x10, 0xb8, 0x0, 0x0, 0x16, 0x96, 0x57, - 0x61, 0xb2, 0x60, 0x0, 0x0, 0x92, 0x0, 0x6,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0, 0x56, 0x0, 0x5, 0x0, 0x25, 0x85, 0x67, - 0x98, 0x55, 0x57, 0x20, 0x0, 0xb0, 0x1, 0x6d, - 0x10, 0x1, 0x0, 0x0, 0xb5, 0x95, 0x58, 0x85, - 0x68, 0x0, 0x0, 0xb0, 0xb0, 0x70, 0xa1, 0x0, - 0x0, 0x0, 0xb0, 0xb1, 0x0, 0xa0, 0x2, 0x10, - 0x0, 0xb0, 0xb5, 0x55, 0xc7, 0x57, 0x50, 0x1, - 0x90, 0xb0, 0x0, 0xa6, 0x0, 0x0, 0x6, 0x30, - 0xb0, 0x7, 0x42, 0x70, 0x0, 0x8, 0x29, 0x90, - 0x48, 0x0, 0x96, 0x0, 0x41, 0x4, 0x26, 0x50, - 0x0, 0xb, 0x90, 0x0, 0x0, 0x20, 0x0, 0x0, - 0x0, 0x0, - - /* U+65E2 "既" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6, 0x55, - 0x59, 0x25, 0x57, 0x58, 0x70, 0xa1, 0x0, 0xb1, - 0x30, 0xc0, 0x0, 0xa, 0x10, 0xb, 0x2b, 0xc, - 0x0, 0x0, 0xa6, 0x55, 0xb3, 0x70, 0xc0, 0x0, - 0xa, 0x10, 0xb, 0x46, 0xb, 0x0, 0x10, 0xa6, - 0x55, 0xb6, 0x77, 0xb5, 0x77, 0xa, 0x10, 0x4, - 0x0, 0x6c, 0x20, 0x0, 0xa1, 0x14, 0x0, 0xa, - 0xa2, 0x0, 0xa, 0x10, 0x67, 0x2, 0xa9, 0x20, - 0x0, 0xa1, 0x65, 0xd1, 0x91, 0x92, 0x5, 0xb, - 0xc3, 0x3, 0x64, 0x9, 0x20, 0x80, 0x31, 0x0, - 0x53, 0x0, 0x6b, 0xad, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, 0x0, - - /* U+65E5 "日" */ - 0x95, 0x55, 0x55, 0x5a, 0x2c, 0x0, 0x0, 0x0, - 0xc0, 0xc0, 0x0, 0x0, 0xc, 0xc, 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x0, - - /* U+6614 "昔" */ - 0x0, 0x0, 0x10, 0x0, 0x20, 0x0, 0x0, 0x0, - 0x0, 0x76, 0x0, 0xc2, 0x0, 0x0, 0x0, 0x0, - 0x74, 0x0, 0xc0, 0x36, 0x0, 0x2, 0x65, 0xa8, - 0x55, 0xd5, 0x55, 0x0, 0x0, 0x0, 0x74, 0x0, - 0xc0, 0x0, 0x0, 0x15, 0x55, 0xa8, 0x55, 0xd5, - 0x5b, 0x80, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xc, 0x55, 0x55, 0x5a, 0x70, 0x0, - 0x0, 0xc, 0x0, 0x0, 0x8, 0x40, 0x0, 0x0, - 0xc, 0x55, 0x55, 0x5a, 0x40, 0x0, 0x0, 0xc, - 0x0, 0x0, 0x8, 0x40, 0x0, 0x0, 0xc, 0x0, - 0x0, 0x8, 0x40, 0x0, 0x0, 0xc, 0x55, 0x55, - 0x5a, 0x40, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+661F "星" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xc, 0x55, 0x55, 0x55, 0x8a, 0x0, 0x0, 0xc, - 0x0, 0x0, 0x0, 0x57, 0x0, 0x0, 0xd, 0x55, - 0x55, 0x55, 0x87, 0x0, 0x0, 0xc, 0x0, 0x0, - 0x0, 0x57, 0x0, 0x0, 0xb, 0x55, 0x65, 0x55, - 0x86, 0x0, 0x0, 0x9, 0x20, 0x2b, 0x0, 0x0, - 0x0, 0x0, 0x1e, 0x55, 0x6b, 0x55, 0x6d, 0x20, - 0x0, 0x82, 0x0, 0x29, 0x0, 0x0, 0x0, 0x2, - 0x50, 0x0, 0x29, 0x0, 0x82, 0x0, 0x3, 0x5, - 0x55, 0x6b, 0x55, 0x53, 0x0, 0x0, 0x0, 0x0, - 0x29, 0x0, 0x0, 0x40, 0x6, 0x55, 0x55, 0x57, - 0x55, 0x56, 0x92, - - /* U+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a3, 0x0, 0xb0, 0xb, 0x0, 0xc1, 0xa, 0x0, - 0xb, 0x0, 0xb1, 0x26, 0x26, 0x32, 0x80, 0xc5, - 0x5b, 0x33, 0x33, 0x33, 0x33, 0xb, 0x0, 0xb0, - 0x75, 0x55, 0x5a, 0x0, 0xb0, 0xb, 0xb, 0x0, - 0x0, 0xb0, 0xb, 0x0, 0xb0, 0xb5, 0x55, 0x5b, - 0x0, 0xc5, 0x5b, 0xb, 0x0, 0x0, 0xb0, 0x4, - 0x0, 0x10, 0xb5, 0x55, 0x5c, 0x0, 0x0, 0x0, - 0xb, 0x0, 0x0, 0xa0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+66C7 "曇" */ - 0x0, 0x10, 0x0, 0x0, 0x4, 0x0, 0x0, 0xa, - 0x55, 0x55, 0x55, 0xc1, 0x0, 0x0, 0xa5, 0x55, - 0x55, 0x5b, 0x0, 0x0, 0xa, 0x55, 0x55, 0x55, - 0xb0, 0x0, 0x0, 0x53, 0x33, 0x33, 0x39, 0x20, - 0x0, 0x32, 0x11, 0xa2, 0x11, 0x11, 0x40, 0x39, - 0x77, 0x6b, 0x56, 0x77, 0x5c, 0x28, 0x27, 0x72, - 0x91, 0x37, 0x62, 0x0, 0x0, 0x11, 0x13, 0x11, - 0x44, 0x0, 0x0, 0x4, 0x43, 0x33, 0x33, 0x33, - 0x30, 0x55, 0x55, 0x79, 0x55, 0x55, 0x66, 0x0, - 0x0, 0x29, 0x20, 0x6, 0x40, 0x0, 0x0, 0x8d, - 0x98, 0x76, 0x5c, 0x30, 0x0, 0x2, 0x20, 0x0, - 0x0, 0x10, 0x0, - - /* U+66DC "曜" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, - 0x34, 0x65, 0xb4, 0x65, 0xb0, 0xc5, 0x6b, 0x37, - 0xa, 0x26, 0xa, 0xb, 0x1, 0x90, 0x60, 0xa0, - 0x61, 0xa0, 0xb0, 0x19, 0x16, 0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c, 0x0, 0x1a, - 0x0, 0x0, 0x1c, 0x55, 0x5d, 0x55, 0x6a, 0x0, - 0x0, 0x5, 0x10, 0x38, 0x0, 0x4, 0x0, 0x0, - 0x0, 0x33, 0x75, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x7, 0xd0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3a, - 0x7b, 0x62, 0x0, 0x0, 0x1, 0x57, 0x50, 0x1, - 0x6a, 0xdd, 0xe4, 0x2, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+66F8 "書" */ - 0x0, 0x0, 0x1, 0x20, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x2b, 0x0, 0x20, 0x0, 0x0, 0x45, 0x56, - 0xb5, 0x5c, 0x41, 0x3, 0x65, 0x55, 0x6b, 0x55, - 0xb7, 0x90, 0x0, 0x45, 0x56, 0xb5, 0x5b, 0x10, - 0x0, 0x0, 0x0, 0x29, 0x0, 0x32, 0x0, 0x3, - 0x55, 0x56, 0xb5, 0x56, 0x60, 0x4, 0x55, 0x55, - 0x69, 0x55, 0x58, 0x80, 0x0, 0x85, 0x55, 0x55, - 0x59, 0x20, 0x0, 0xc, 0x0, 0x0, 0x0, 0xa1, - 0x0, 0x0, 0xd5, 0x55, 0x55, 0x5c, 0x10, 0x0, - 0xc, 0x0, 0x0, 0x0, 0xa1, 0x0, 0x0, 0xd5, - 0x55, 0x55, 0x5c, 0x10, 0x0, 0x2, 0x0, 0x0, - 0x0, 0x20, 0x0, - - /* U+66FE "曾" */ - 0x0, 0x20, 0x0, 0x11, 0x0, 0x0, 0x3a, 0x0, - 0x96, 0x0, 0x20, 0x7, 0x2, 0x60, 0x12, 0xb5, - 0x55, 0xb6, 0x55, 0x88, 0xb0, 0x82, 0x91, 0x59, - 0x56, 0xb0, 0x39, 0x92, 0x80, 0x56, 0xb5, 0x56, - 0xb7, 0x55, 0x86, 0x60, 0x0, 0x0, 0x0, 0x22, - 0x9, 0x55, 0x55, 0x5b, 0x40, 0x9, 0x10, 0x0, - 0x9, 0x10, 0x9, 0x65, 0x55, 0x5b, 0x10, 0x9, - 0x10, 0x0, 0x9, 0x20, 0x9, 0x55, 0x55, 0x5b, - 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, - - /* U+66FF "替" */ - 0x0, 0x3, 0x0, 0x1, 0x20, 0x0, 0x0, 0xd, - 0x10, 0x2, 0xb0, 0x0, 0x5, 0x5d, 0x77, 0x46, - 0xb7, 0x70, 0x0, 0xb, 0x1, 0x3, 0x80, 0x20, - 0x25, 0x7b, 0x65, 0x59, 0xb5, 0x73, 0x0, 0x86, - 0x90, 0xa, 0x17, 0x0, 0x4, 0x60, 0x55, 0x81, - 0x5, 0xa4, 0x43, 0x75, 0x59, 0x55, 0x5a, 0x42, - 0x0, 0xc0, 0x0, 0x0, 0x2a, 0x0, 0x0, 0xc0, - 0x0, 0x0, 0x29, 0x0, 0x0, 0xc5, 0x55, 0x55, - 0x69, 0x0, 0x0, 0xc0, 0x0, 0x0, 0x2a, 0x0, - 0x0, 0xc5, 0x55, 0x55, 0x6a, 0x0, 0x0, 0x20, - 0x0, 0x0, 0x0, 0x0, - - /* U+6700 "最" */ - 0x0, 0x1, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, - 0x6, 0x85, 0x55, 0x55, 0xd2, 0x0, 0x0, 0x6, - 0x95, 0x55, 0x55, 0xd0, 0x0, 0x0, 0x6, 0x60, - 0x0, 0x0, 0xc0, 0x0, 0x0, 0x6, 0x95, 0x55, - 0x55, 0xd0, 0x0, 0x4, 0x56, 0x55, 0x55, 0x55, - 0x58, 0xd1, 0x0, 0x29, 0x0, 0xb0, 0x0, 0x3, - 0x0, 0x0, 0x2b, 0x55, 0xc4, 0x85, 0x5d, 0x30, - 0x0, 0x2b, 0x55, 0xc0, 0x50, 0x39, 0x0, 0x0, - 0x29, 0x0, 0xb0, 0x28, 0xb1, 0x0, 0x0, 0x2b, - 0x67, 0xd5, 0x1a, 0x90, 0x0, 0xa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x29, 0x9, 0x10, 0x40, 0x0, 0xc, 0x0, - 0x91, 0x9, 0x20, 0x80, 0x0, 0xc, 0x6, 0x30, - 0x6, 0xca, 0xd2, 0x0, 0x6, 0x21, 0x0, 0x0, - 0x0, 0x0, - - /* U+6848 "案" */ - 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x85, 0x0, 0x0, 0x0, 0x0, 0x75, - 0x55, 0x86, 0x55, 0x5a, 0x60, 0x3, 0xb0, 0x4, - 0xa0, 0x0, 0x9, 0x0, 0x1, 0x55, 0x5c, 0x55, - 0x58, 0x59, 0x60, 0x0, 0x0, 0x94, 0x0, 0xa4, - 0x0, 0x0, 0x0, 0x0, 0x14, 0x7d, 0xc6, 0x10, - 0x0, 0x0, 0x1, 0x57, 0x83, 0x6, 0xd4, 0x0, - 0x0, 0x32, 0x0, 0x2c, 0x0, 0x3, 0x70, 0x3, - 0x55, 0x57, 0xdc, 0x85, 0x55, 0x61, 0x0, 0x0, - 0x2b, 0x3a, 0x56, 0x0, 0x0, 0x0, 0x5, 0x80, - 0x2a, 0x5, 0xb7, 0x30, 0x4, 0x62, 0x0, 0x2b, - 0x0, 0x18, 0xb2, 0x0, 0x0, 0x0, 0x1, 0x0, - 0x0, 0x0, - - /* U+689D "條" */ - 0x0, 0x3, 0x0, 0x1, 0x30, 0x0, 0x0, 0x0, - 0x1f, 0x20, 0x6, 0xb0, 0x0, 0x0, 0x0, 0x58, - 0x0, 0xc, 0x75, 0x5a, 0x10, 0x0, 0xb1, 0x50, - 0x39, 0x50, 0x78, 0x0, 0x3, 0xf1, 0xc0, 0x80, - 0x87, 0x90, 0x0, 0x8, 0xb0, 0xb1, 0x0, 0x8d, - 0x60, 0x0, 0x41, 0xb0, 0xb0, 0x28, 0x41, 0x8d, - 0x92, 0x0, 0xb0, 0xb3, 0x30, 0x1c, 0x1, 0x40, - 0x0, 0xb0, 0xb4, 0x65, 0x6b, 0x57, 0x80, 0x0, - 0xb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0x60, 0x0, 0x82, 0x44, - 0x5c, 0x55, 0xc9, 0x30, 0x25, 0xb6, 0x51, 0xa, - 0x0, 0xa0, 0x40, 0x0, 0xd9, 0x55, 0x56, 0x97, - 0x65, 0x60, 0x1, 0xf4, 0xa5, 0x55, 0xa8, 0x58, - 0x20, 0x6, 0xc2, 0x38, 0x20, 0x74, 0xa, 0x0, - 0x8, 0x82, 0x8, 0x65, 0xa8, 0x5b, 0x0, 0x32, - 0x82, 0x8, 0x20, 0x74, 0xa, 0x50, 0x10, 0x82, - 0x5b, 0x65, 0x55, 0x5b, 0x61, 0x0, 0x82, 0x8, - 0x20, 0x0, 0xa, 0x0, 0x0, 0x92, 0x9, 0x20, - 0x2, 0x8d, 0x0, 0x0, 0x10, 0x2, 0x0, 0x0, - 0x1, 0x0, - - /* U+69D8 "様" */ - 0x0, 0x2, 0x0, 0x3, 0x0, 0x4, 0x0, 0x0, - 0xc, 0x0, 0x3, 0xb0, 0xb, 0x10, 0x0, 0xa, - 0x0, 0x45, 0xb5, 0x86, 0xb2, 0x0, 0xa, 0x23, - 0x0, 0xb, 0x0, 0x0, 0x5, 0x6c, 0x54, 0x25, - 0x5c, 0x57, 0x70, 0x0, 0x4d, 0x50, 0x0, 0xb, - 0x0, 0x10, 0x0, 0x8a, 0xa4, 0x65, 0x5b, 0x55, - 0x94, 0x0, 0xaa, 0x20, 0x0, 0xb, 0x20, 0x80, - 0x4, 0x4a, 0x4, 0x59, 0x7b, 0x47, 0x50, 0x6, - 0xa, 0x0, 0xa, 0x1b, 0x72, 0x0, 0x0, 0xa, - 0x0, 0x47, 0xb, 0xb, 0x0, 0x0, 0xb, 0x1, - 0x80, 0xb, 0x5, 0xc3, 0x0, 0xb, 0x25, 0x4, - 0xac, 0x0, 0x40, 0x0, 0x1, 0x0, 0x0, 0x11, - 0x0, 0x0, - - /* U+6A02 "樂" */ - 0x0, 0x21, 0x0, 0x32, 0x0, 0x30, 0x0, 0x0, - 0x86, 0x1, 0x72, 0x20, 0xa5, 0x0, 0x0, 0xa2, - 0x3a, 0x55, 0xc1, 0x83, 0x20, 0x7, 0x38, 0x7a, - 0x0, 0xa7, 0x2a, 0x40, 0x9, 0x7a, 0xa, 0x55, - 0xa9, 0x78, 0x0, 0x0, 0x73, 0xa, 0x0, 0xa0, - 0x83, 0x0, 0x6, 0x75, 0xaa, 0x55, 0xa6, 0x55, - 0xb0, 0x8, 0x62, 0xa4, 0x45, 0x3a, 0x62, 0x90, - 0x6, 0x55, 0x55, 0xaa, 0x55, 0x5a, 0x70, 0x0, - 0x0, 0xb, 0xb7, 0x60, 0x0, 0x0, 0x0, 0x1, - 0xa4, 0x66, 0x48, 0x0, 0x0, 0x0, 0x58, 0x10, - 0x66, 0x4, 0xd8, 0x50, 0x15, 0x20, 0x0, 0x66, - 0x0, 0x17, 0x70, 0x0, 0x0, 0x0, 0x21, 0x0, - 0x0, 0x0, - - /* U+6A19 "標" */ - 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xc, 0x3, 0x65, 0x75, 0x75, 0xa2, 0x0, 0xa, - 0x0, 0x0, 0x90, 0x90, 0x0, 0x5, 0x5c, 0x86, - 0xa5, 0xb5, 0xb5, 0xa0, 0x0, 0x2b, 0x0, 0xa0, - 0x90, 0x92, 0x80, 0x0, 0x7d, 0x60, 0xc5, 0xb5, - 0xb6, 0x80, 0x0, 0xaa, 0x94, 0x70, 0x0, 0x2, - 0x20, 0x3, 0x5a, 0x10, 0x55, 0x55, 0x58, 0x20, - 0x6, 0xa, 0x4, 0x55, 0x55, 0x55, 0x85, 0x12, - 0xa, 0x1, 0x23, 0xb, 0x10, 0x0, 0x0, 0xb, - 0x0, 0xb5, 0xb, 0x38, 0x0, 0x0, 0xb, 0x8, - 0x20, 0xb, 0x4, 0xb0, 0x0, 0xb, 0x40, 0x5, - 0xb8, 0x0, 0x40, 0x0, 0x1, 0x0, 0x0, 0x10, - 0x0, 0x0, - - /* U+6A21 "模" */ - 0x0, 0x4, 0x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0x92, 0x20, 0x0, - 0x2, 0xbb, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+6A4B "橋" */ - 0x0, 0x30, 0x0, 0x0, 0x0, 0x42, 0x0, 0x0, - 0x94, 0x3, 0x57, 0xaa, 0x85, 0x0, 0x0, 0x92, - 0x0, 0x0, 0xc0, 0x1, 0x0, 0x25, 0xb8, 0x74, - 0x5b, 0x75, 0x86, 0x40, 0x0, 0xb2, 0x0, 0x76, - 0x0, 0x87, 0x10, 0x0, 0xe5, 0x17, 0x4b, 0x55, - 0xc5, 0xa1, 0x3, 0xf7, 0x80, 0xb, 0x55, 0xb0, - 0x0, 0x8, 0xa2, 0x33, 0x13, 0x0, 0x41, 0x40, - 0x17, 0x92, 0xc, 0x45, 0x44, 0x55, 0xb0, 0x50, - 0x92, 0xb, 0x9, 0x55, 0xc1, 0x90, 0x0, 0x92, - 0xb, 0x9, 0x55, 0xa1, 0x90, 0x0, 0x92, 0xb, - 0x4, 0x0, 0x31, 0x90, 0x0, 0x92, 0xb, 0x0, - 0x0, 0x6c, 0x60, 0x0, 0x10, 0x1, 0x0, 0x0, - 0x1, 0x0, - - /* U+6A5F "機" */ - 0x0, 0x41, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, - 0xa2, 0x0, 0xb0, 0xb2, 0x68, 0x0, 0x0, 0xa1, - 0x4, 0x36, 0xb0, 0x83, 0x20, 0x25, 0xc9, 0x6b, - 0x78, 0xb9, 0x8b, 0x40, 0x0, 0xc1, 0x1, 0x71, - 0xb1, 0x46, 0x0, 0x0, 0xf3, 0x5, 0x29, 0xb2, - 0x65, 0x60, 0x4, 0xf8, 0x6a, 0x57, 0xb7, 0x92, - 0x80, 0x9, 0xb1, 0x40, 0xb0, 0x91, 0x56, 0x20, - 0x26, 0xa1, 0x25, 0xc5, 0xa7, 0x57, 0x80, 0x40, - 0xa1, 0x0, 0xc0, 0x47, 0x2c, 0x0, 0x0, 0xa1, - 0x5, 0x5a, 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0, 0xb0, 0x90, 0x0, 0x0, 0xa0, - 0xb, 0x3, 0x80, 0x74, 0x0, 0x0, 0xc5, 0x5c, - 0x19, 0x0, 0xd, 0x30, 0x0, 0x60, 0x4, 0x60, - 0x0, 0x4, 0xc2, 0x0, 0x0, 0x1, 0x0, 0x0, - 0x0, 0x0, - - /* U+6B4C "歌" */ - 0x0, 0x0, 0x0, 0x0, 0x21, 0x0, 0x0, 0x16, - 0x55, 0x56, 0xa3, 0x79, 0x0, 0x0, 0x1, 0x0, - 0x18, 0x30, 0xb1, 0x0, 0x0, 0x4, 0xa5, 0xa8, - 0x31, 0xc5, 0x56, 0x70, 0x4, 0xa5, 0xa8, 0x36, - 0x14, 0x7, 0x40, 0x3, 0x40, 0x47, 0x43, 0xe, - 0x2, 0x0, 0x26, 0x55, 0x58, 0xa2, 0xf, 0x0, - 0x0, 0x2, 0x0, 0x3a, 0x10, 0x2a, 0x40, 0x0, - 0xb, 0x65, 0xba, 0x10, 0x67, 0x70, 0x0, 0xb, - 0x10, 0xaa, 0x10, 0x91, 0x80, 0x0, 0xb, 0x65, - 0x7a, 0x11, 0x90, 0x57, 0x0, 0x1, 0x0, 0x3b, - 0x18, 0x10, 0xd, 0x40, 0x0, 0x0, 0x4b, 0x62, - 0x0, 0x3, 0x90, 0x0, 0x0, 0x2, 0x0, 0x0, - 0x0, 0x0, - - /* U+6B50 "歐" */ - 0x0, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, 0x9, - 0x55, 0x55, 0xa0, 0xc2, 0x0, 0x0, 0xa, 0x3, - 0x12, 0x30, 0xb0, 0x0, 0x0, 0xa, 0xa, 0x48, - 0x65, 0x95, 0x57, 0x80, 0xa, 0x9, 0x5, 0x48, - 0x5, 0x8, 0x20, 0xa, 0xa, 0x58, 0x53, 0xe, - 0x12, 0x0, 0xa, 0x1, 0x0, 0x0, 0xd, 0x10, - 0x0, 0xa, 0x87, 0x9a, 0x96, 0xb, 0x40, 0x0, - 0xa, 0x83, 0x79, 0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5a, 0x23, 0xa3, 0xc0, 0x0, 0x2, - 0xa7, 0x2a, 0xb6, 0x6e, 0x30, 0x0, 0x4, 0x64, - 0xf, 0x60, 0xad, 0x20, 0x40, 0x8, 0x0, 0x95, - 0x1a, 0x42, 0xd4, 0x80, 0x15, 0x47, 0x24, 0x71, - 0x0, 0x2c, 0xf0, 0x10, 0x10, 0x20, 0x0, 0x0, - 0x0, 0x10, - - /* U+6B73 "歳" */ - 0x0, 0x0, 0x0, 0x11, 0x0, 0x0, 0x0, 0x0, - 0x3, 0x50, 0x58, 0x0, 0x60, 0x0, 0x0, 0x4, - 0x70, 0x49, 0x55, 0x51, 0x10, 0x6, 0x57, 0x85, - 0x78, 0x55, 0x58, 0xa0, 0x0, 0x0, 0x0, 0x5, - 0x83, 0xa0, 0x0, 0x0, 0xa5, 0x55, 0x57, 0xa5, - 0x78, 0x60, 0x0, 0xb0, 0x0, 0x13, 0xa0, 0x14, - 0x0, 0x0, 0xb6, 0x5b, 0x54, 0xb0, 0x7b, 0x0, - 0x0, 0xa2, 0x3a, 0x40, 0x94, 0xd1, 0x0, 0x1, - 0x98, 0x3a, 0x57, 0x4f, 0x30, 0x0, 0x4, 0x84, - 0xa, 0x4, 0x9d, 0x20, 0x40, 0x7, 0x12, 0xa9, - 0x19, 0x43, 0xd3, 0x70, 0x6, 0x0, 0x4, 0x60, - 0x0, 0x2c, 0xe0, 0x10, 0x0, 0x20, 0x0, 0x0, - 0x0, 0x20, - - /* U+6B77 "歷" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x1, - 0x95, 0x55, 0x55, 0x55, 0x5b, 0x50, 0x1, 0xa0, - 0x15, 0xc2, 0x1, 0x78, 0x0, 0x1, 0xa3, 0x5a, - 0x0, 0x4c, 0x20, 0x0, 0x1, 0xa5, 0x7b, 0xa3, - 0x6c, 0x58, 0x50, 0x1, 0xa0, 0xab, 0x20, 0x5e, - 0x60, 0x0, 0x2, 0x92, 0x99, 0xa1, 0x8a, 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0, - 0x9, 0x10, 0x0, 0xb, 0x43, 0x2b, 0x46, 0xba, - 0x22, 0x70, 0x3, 0x56, 0xa, 0x0, 0x17, 0x36, - 0x70, 0x0, 0x16, 0xa, 0x95, 0xc7, 0x6b, 0x10, - 0x0, 0x72, 0xa, 0x90, 0xa2, 0xb9, 0x0, 0x18, - 0xc0, 0xa, 0x90, 0xa0, 0xe2, 0x0, 0x3, 0xa0, - 0x36, 0x95, 0xa6, 0xc5, 0x40, 0x4, 0x90, 0x91, - 0x0, 0x38, 0xc, 0x80, 0x3, 0x82, 0x50, 0x3, - 0x70, 0x3, 0xf3, 0x0, 0x2, 0x0, 0x2, 0x0, - 0x0, 0x12, - - /* U+6E21 "渡" */ - 0x0, 0x0, 0x0, 0x1, 0x10, 0x0, 0x0, 0x0, - 0x91, 0x0, 0x0, 0xb3, 0x0, 0x0, 0x0, 0x59, - 0x9, 0x55, 0x87, 0x55, 0xb1, 0x10, 0x1, 0x1b, - 0x7, 0x10, 0x80, 0x0, 0x1a, 0x10, 0x4b, 0xa, - 0x0, 0xa1, 0x40, 0x6, 0x65, 0xc, 0x5c, 0x55, - 0xc5, 0x40, 0x0, 0x6, 0xb, 0xa, 0x55, 0xb0, - 0x0, 0x0, 0x16, 0xb, 0x5, 0x0, 0x40, 0x0, - 0x0, 0x81, 0x19, 0x37, 0x55, 0xd4, 0x0, 0x18, - 0xd0, 0x46, 0x5, 0x15, 0x90, 0x0, 0x2, 0xb0, - 0x82, 0x0, 0xbb, 0x0, 0x0, 0x4, 0xb0, 0x90, - 0x7, 0x9b, 0x60, 0x0, 0x1, 0x66, 0x25, 0x73, - 0x0, 0x7e, 0xa1, 0x0, 0x1, 0x21, 0x0, 0x0, - 0x0, 0x10, - - /* U+6E29 "温" */ - 0x0, 0x81, 0x7, 0x55, 0x55, 0x91, 0x0, 0x0, - 0x47, 0xa, 0x0, 0x0, 0x90, 0x0, 0x0, 0x0, - 0x4b, 0x55, 0x55, 0xb0, 0x0, 0x17, 0x3,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0x90, 0x44, 0x4, 0x26, 0x82, - 0x1c, 0x55, 0x90, 0xc, 0x25, 0x3, 0x70, 0xa, - 0x1, 0x90, 0x2, 0x6, 0x46, 0x86, 0xa, 0x1, - 0x90, 0x0, 0x43, 0xb2, 0x2a, 0xc, 0x55, 0x90, - 0x0, 0x90, 0xa0, 0xa, 0x19, 0x1, 0x90, 0x29, - 0xb0, 0xa0, 0xa, 0x46, 0x1, 0x90, 0x3, 0x90, - 0xb5, 0x59, 0x90, 0x1, 0x90, 0x5, 0x90, 0x80, - 0x5, 0x40, 0x22, 0x90, 0x2, 0x60, 0x0, 0x44, - 0x0, 0x4e, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+6E90 "源" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x91, 0x8, 0x55, 0x55, 0x57, 0xb0, 0x0, 0x68, - 0xc, 0x0, 0xc, 0x10, 0x0, 0x0, 0x1, 0x4c, - 0x2, 0x34, 0x4, 0x0, 0x35, 0x1, 0x3c, 0xc, - 0x55, 0x5c, 0x20, 0xb, 0x65, 0xc, 0xb, 0x0, - 0xb, 0x0, 0x2, 0x26, 0xc, 0xc, 0x55, 0x5c, - 0x0, 0x0, 0x16, 0xb, 0xb, 0x0, 0xb, 0x0, - 0x0, 0x71, 0x29, 0xa, 0x5d, 0x59, 0x0, 0x18, - 0xd0, 0x64, 0x6, 0xc, 0x22, 0x0, 0x2, 0xb0, - 0x90, 0x4a, 0xc, 0xa, 0x50, 0x4, 0xa3, 0x41, - 0x80, 0xc, 0x1, 0xe0, 0x2, 0x85, 0x4, 0x2, - 0x9d, 0x0, 0x30, 0x0, 0x10, 0x0, 0x0, 0x11, - 0x0, 0x0, - - /* U+6E96 "準" */ - 0x0, 0x10, 0x0, 0x10, 0x10, 0x0, 0x0, 0x0, - 0x94, 0x0, 0x95, 0x2a, 0x0, 0x0, 0x0, 0x5, - 0x31, 0xc5, 0x58, 0x59, 0x70, 0x8, 0x30, 0x48, - 0xb0, 0x1a, 0x2, 0x0, 0x1, 0x65, 0x62, 0xc5, - 0x6c, 0x57, 0x20, 0x0, 0x7, 0x10, 0xb0, 0x1a, - 0x15, 0x10, 0x3, 0xb3, 0x0, 0xc5, 0x6b, 0x44, - 0x20, 0x0, 0x91, 0x0, 0xd5, 0x6b, 0x57, 0x90, - 0x0, 0x82, 0x0, 0x46, 0x0, 0x0, 0x0, 0x5, - 0x55, 0x55, 0x7b, 0x55, 0x55, 0xa2, 0x1, 0x0, - 0x0, 0x29, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x29, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x29, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, - 0x0, 0x0, - - /* U+6E9D "溝" */ - 0x0, 0x0, 0x0, 0x21, 0x2, 0x10, 0x0, 0x0, - 0x70, 0x0, 0x67, 0x6, 0x70, 0x0, 0x0, 0x69, - 0x36, 0x98, 0x59, 0x87, 0x70, 0x0, 0x4, 0x20, - 0x65, 0x5, 0x54, 0x0, 0x31, 0x0, 0x46, 0x98, - 0x59, 0x85, 0x30, 0xc, 0x25, 0x36, 0x76, 0x97, - 0x75, 0x90, 0x5, 0x36, 0x2, 0x0, 0xb0, 0x3, - 0x0, 0x0, 0x34, 0xb, 0x55, 0xc5, 0x5d, 0x0, - 0x0, 0x90, 0xb, 0x55, 0xc5, 0x5b, 0x0, 0x29, - 0xa0, 0xb, 0x0, 0xb0, 0xb, 0x20, 0x6, 0x70, - 0x6c, 0x55, 0x65, 0x5c, 0x61, 0x7, 0x70, 0xb, - 0x0, 0x0, 0xb, 0x0, 0x5, 0x60, 0xb, 0x0, - 0x5, 0x9a, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, - 0x42, 0x0, - - /* U+6EFF "滿" */ - 0x0, 0x0, 0x0, 0x11, 0x0, 0x30, 0x0, 0x0, - 0x72, 0x0, 0x47, 0x0, 0xc0, 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0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+6FDF "濟" */ - 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x2, - 0x60, 0x0, 0x1, 0xb0, 0x0, 0x10, 0x0, 0x95, - 0x46, 0x56, 0x66, 0x57, 0x80, 0x0, 0x12, 0x30, - 0xa, 0x2b, 0x15, 0x10, 0x27, 0x4, 0x3a, 0x98, - 0x93, 0x68, 0x10, 0x8, 0x76, 0xa, 0x64, 0xb4, - 0x68, 0x0, 0x0, 0x45, 0x36, 0x92, 0xa5, 0x97, - 0xa1, 0x0, 0x61, 0x65, 0x90, 0x62, 0x43, 0x61, - 0x0, 0xa0, 0xa, 0x75, 0x55, 0x5d, 0x0, 0x1a, - 0x90, 0xa, 0x10, 0x0, 0xc, 0x0, 0x5, 0x70, - 0xb, 0x55, 0x55, 0x5c, 0x0, 0x6, 0x70, 0x18, - 0x0, 0x0, 0xc, 0x0, 0x3, 0x41, 0x80, 0x0, - 0x0, 0xc, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, - 0x3, 0x0, - - /* U+7063 "灣" */ - 0x0, 0x0, 0x2, 0x1, 0x20, 0x2, 0x0, 0x2, - 0x50, 0x28, 0x10, 0x92, 0x9, 0x40, 0x0, 0xa4, - 0x97, 0x66, 0x57, 0x96, 0xa0, 0x0, 0x23, 0x34, - 0x26, 0x87, 0x17, 0x30, 0x16, 0x4, 0xa7, 0xa5, - 0x35, 0x89, 0x75, 0x7, 0x75, 0x33, 0x3a, 0x5b, - 0x23, 0x30, 0x1, 0x57, 0x99, 0x8a, 0x5b, 0x94, - 0x86, 0x0, 0x52, 0x16, 0x58, 0x57, 0x6a, 0x10, - 0x0, 0x90, 0x3, 0x22, 0x22, 0x2b, 0x0, 0x18, - 0xa0, 0xb, 0x33, 0x33, 0x37, 0x0, 0x4, 0x80, - 0x18, 0x55, 0x55, 0x5b, 0x50, 0x5, 0x70, 0x0, - 0x0, 0x0, 0xb, 0x0, 0x4, 0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0x0, 0x0, 0xb2, 0x1, 0x23, - 0x5, 0x1, 0x40, 0x24, 0x0, 0x0, 0x92, 0x7, - 0x50, 0xa3, 0xb, 0x40, 0x7, 0xa0, 0x2, 0x60, - 0x33, 0x4, 0x60, 0x1, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+71DF "營" */ - 0x0, 0x0, 0x30, 0x0, 0x2, 0x0, 0x0, 0x0, - 0x2b, 0x15, 0x2, 0xa1, 0x30, 0x0, 0x63, 0xc7, - 0x37, 0x4a, 0x84, 0x0, 0x6, 0x2c, 0x63, 0x86, - 0x94, 0x0, 0x0, 0x9, 0x12, 0x92, 0x90, 0x6b, - 0x0, 0x5, 0x22, 0x22, 0x62, 0x22, 0x64, 0x4, - 0x73, 0x43, 0x33, 0x36, 0x3a, 0x60, 0xa1, 0xc, - 0x55, 0x55, 0xd2, 0x30, 0x0, 0x0, 0xc5, 0x55, - 0x5c, 0x0, 0x0, 0x0, 0x15, 0x0, 0x0, 0x32, - 0x0, 0x0, 0xd, 0x55, 0x55, 0x55, 0xd2, 0x0, - 0x0, 0xc0, 0x0, 0x0, 0xc, 0x0, 0x0, 0xd, - 0x55, 0x55, 0x55, 0xd0, 0x0, 0x0, 0x70, 0x0, - 0x0, 0x5, 0x0, - - /* U+722D "爭" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, - 0x2, 0x35, 0x7a, 0xdc, 0x0, 0x1, 0x54, 0x47, - 0x21, 0x2, 0x50, 0x0, 0x8, 0x50, 0x3a, 0x0, - 0x94, 0x0, 0x0, 0x9, 0x0, 0x60, 0x53, 0x0, - 0x0, 0x5, 0x55, 0x57, 0x56, 0x5c, 0x0, 0x0, - 0x0, 0x1, 0x90, 0x1, 0xa0, 0x13, 0x65, 0x55, - 0x6b, 0x55, 0x5c, 0x86, 0x0, 0x0, 0x1, 0x90, - 0x1, 0xa0, 0x0, 0x6, 0x55, 0x6b, 0x55, 0x5a, - 0x0, 0x0, 0x0,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, 0x46, 0xb1, 0x90, 0x56, 0x7, 0x40, - 0x1, 0x80, 0xb1, 0x90, 0x56, 0x7, 0x40, 0x15, - 0x0, 0xb1, 0xb5, 0x99, 0x5a, 0x40, 0x10, 0x0, - 0xc1, 0x90, 0x56, 0x7, 0x40, 0x1, 0x37, 0x81, - 0xb5, 0x99, 0x5a, 0x40, 0x0, 0x4c, 0x1, 0x80, - 0x0, 0x4, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+733F "猿" */ - 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x3, - 0x0, 0x83, 0x0, 0xc2, 0x1, 0x0, 0x1, 0x74, - 0xb1, 0x65, 0xd5, 0x69, 0x0, 0x0, 0x3e, 0x0, - 0x0, 0xc0, 0x0, 0x50, 0x1, 0x8a, 0x26, 0x55, - 0x65, 0x55, 0x60, 0x15, 0x7, 0x50, 0xb5, 0x55, - 0x5c, 0x0, 0x0, 0xd, 0x80, 0xb0, 0x0, 0xb, - 0x0, 0x0, 0x66, 0xa0, 0xd5, 0x76, 0x5b, 0x0, - 0x1, 0x81, 0xb0, 0x29, 0x46, 0x4, 0xb0, 0x7, - 0x2, 0xb0, 0x68, 0x8, 0x67, 0x0, 0x10, 0x4, - 0xa5, 0x97, 0x1, 0xc0, 0x0, 0x0, 0x8, 0x80, - 0x46, 0x42, 0x5c, 0x30, 0x1, 0x9e, 0x0, 0x5c, - 0x20, 0x4, 0xb2, 0x0, 0x1, 0x0, 0x1, 0x0, - 0x0, 0x0, - - /* U+7372 "獲" */ - 0x0, 0x0, 0x0, 0x1, 0x0, 0x10, 0x0, 0x2, - 0x0, 0x63, 0x9, 0x20, 0xa3, 0x40, 0x2, 0x82, - 0xb4, 0x6b, 0x65, 0xb6, 0x61, 0x0, 0x2e, 0x10, - 0x55, 0x37, 0x30, 0x0, 0x0, 0x9a, 0x10, 0xd6, - 0x5a, 0x58, 0x50, 0x6, 0x16, 0x56, 0xc3, 0x3c,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x58, 0x30, 0x0, 0x90, 0x0, 0x2a, 0x0, - 0x0, 0x0, 0x2, 0x50, 0x0, 0x2a, 0x0, 0x0, - 0x0, 0x5, 0x0, 0x0, 0x2a, 0x0, 0x54, 0x0, - 0x0, 0x5, 0x55, 0x6c, 0x55, 0x54, 0x0, 0x0, - 0x0, 0x0, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x2a, 0x0, 0x0, 0x60, 0x6, 0x55, 0x55, 0x56, - 0x55, 0x56, 0x72, - - /* U+7522 "產" */ - 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x6, 0x40, 0x0, 0x40, 0x0, 0x55, 0x67, - 0x55, 0x6d, 0x65, 0x0, 0x0, 0x0, 0x27, 0x89, - 0x30, 0x0, 0x0, 0x0, 0x25, 0x65, 0xb4, 0x0, - 0x0, 0x7, 0x67, 0x55, 0x56, 0xb5, 0xc2, 0x0, - 0xc0, 0x23, 0x7, 0x10, 0x0, 0x0, 0xb, 0x8, - 0x60, 0xb0, 0x1, 0x0, 0x0, 0xb0, 0xc5, 0x5c, - 0x55, 0x84, 0x0, 0xa, 0x62, 0x0, 0xb0, 0x1, - 0x0, 0x2, 0x72, 0x46, 0x5c, 0x55, 0x80, 0x0, - 0x61, 0x0, 0x0, 0xb0, 0x0, 0x0, 0x6, 0x15, - 0x55, 0x5c, 0x55, 0x5a, 0x71, 0x0, 0x10, 0x0, - 0x0, 0x0, 0x0, - - /* U+7523 "産" */ - 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x6, 0x50, 0x0, 0x60, 0x0, 0x55, 0x75, - 0x55, 0x76, 0x56, 0x10, 0x0, 0x2, 0x90, 0x8, - 0x60, 0x0, 0x0, 0x20, 0x8, 0x0, 0x70, 0x4, - 0x0, 0xc, 0x55, 0x55, 0x85, 0x55, 0x62, 0x0, - 0xb0, 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 0x4a, 0x40, 0x2b, 0x2a, 0xe3, 0x4, - 0x30, 0xc, 0x0, 0x1a, 0x0, 0x0, 0x0, 0x0, - 0x2a, 0x0, 0x1a, 0x0, 0x0, 0x0, 0x1, 0xa1, - 0x0, 0x1a, 0x0, 0x0, 0x0, 0x46, 0x0, 0x0, - 0x2a, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+7559 "留" */ - 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x22, - 0x69, 0x80, 0x0, 0x0, 0x40, 0xc, 0x20, 0x0, - 0x6a, 0x95, 0x6b, 0x0, 0xb0, 0x17, 0x10, 0x93, - 0x3, 0x80, 0xb, 0x1, 0x7d, 0x1b, 0x0, 0x56, - 0x1, 0xd9, 0x60, 0x49, 0x22, 0x6b, 0x30, 0x7, - 0x0, 0x16, 0x20, 0x3, 0x70, 0x0, 0x59, 0x55, - 0x59, 0x55, 0x6c, 0x0, 0x4, 0x80, 0x1, 0xb0, - 0x1, 0xa0, 0x0, 0x4a, 0x55, 0x6c, 0x55, 0x6a, - 0x0, 0x4, 0x80, 0x1, 0xb0, 0x1, 0xa0, 0x0, - 0x48, 0x0, 0x1b, 0x0, 0x1b, 0x0, 0x5, 0xa5, - 0x55, 0x65, 0x56, 0xb0, 0x0, 0x11, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+756A "番" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, - 0x0, 0x24, 0x79, 0xbb, 0x10, 0x0, 0x36, 0x64, - 0xa2, 0x9, 0x10, 0x0, 0x0, 0xb, 0x9, 0x24, - 0x60, 0x0, 0x6, 0x55, 0x88, 0xc8, 0x75, 0x57, - 0x40, 0x0, 0x4, 0x99, 0x27, 0x0, 0x0, 0x0, - 0x6, 0x60, 0x92, 0x9, 0x71, 0x0, 0x26, 0x40, - 0x8, 0x10, 0x8, 0xd7, 0x11, 0xb, 0x55, 0x97, - 0x55, 0xd2, 0x0, 0x0, 0xb0, 0x7, 0x40, 0xb, - 0x0, 0x0, 0xb, 0x55, 0xa7, 0x55, 0xc0, 0x0, - 0x0, 0xb0, 0x7, 0x40, 0xb, 0x0, 0x0, 0xb, - 0x55, 0x55, 0x55, 0xb0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+756B "畫" */ - 0x0, 0x0, 0x0, 0x12, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x2b, 0x0, 0x30, 0x0, 0x0, 0x6, - 0x55, 0x6b, 0x55, 0xd1, 0x20, 0x3, 0x65, 0x55, - 0x6b, 0x55, 0xc5, 0x70, 0x0, 0x7, 0x55, 0x6b, - 0x55, 0xc0, 0x0, 0x0, 0x5, 0x55, 0x6b, 0x55, - 0x76, 0x0, 0x0, 0x23, 0x22, 0x3a, 0x22, 0x25, - 0x20, 0x0, 0x45, 0x33, 0x33, 0x33, 0x53, 0x10, - 0x0, 0xd, 0x55, 0x6b, 0x55, 0xb4, 0x0, 0x0, - 0xc, 0x55, 0x6b, 0x55, 0xb1, 0x0, 0x0, 0xb, - 0x0, 0x29, 0x0, 0xa1, 0x0, 0x0, 0xc, 0x55, - 0x55, 0x55, 0x91, 0x10, 0x5, 0x55, 0x55, 0x55, - 0x55, 0x58, 0xe1, 0x1, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+7570 "異" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, - 0x55, 0x57, 0x55, 0xa5, 0x0, 0x0, 0xb0, 0x0, - 0xb0, 0x9, 0x10, 0x0, 0xc, 0x55, 0x5c, 0x55, - 0xb1, 0x0, 0x0, 0xb0, 0x0, 0xb0, 0x9, 0x10, - 0x0, 0xd, 0x55, 0x58, 0x55, 0xb2, 0x0, 0x0, - 0x21, 0xb0, 0x8, 0x20, 0x0, 0x0, 0x65, 0x6c, - 0x55, 0xa6, 0x5a, 0x10, 0x0, 0x1, 0xa0, 0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3b, 0x1, 0xa5, 0x5c, 0x5c, 0x0, 0x5, - 0xb, 0x0, 0x40, 0xb, 0x4, 0x0, 0x10, 0xb, - 0x0, 0x65, 0x5c, 0x59, 0x40, 0x0, 0xc, 0x0, - 0x0, 0xb, 0x0, 0x0, 0x0, 0xc, 0x3, 0x55, - 0x5c, 0x57, 0xd0, 0x0, 0x3, 0x1, 0x0, 0x0, - 0x0, 0x0, - - /* U+7A4D "積" */ - 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, - 0x27, 0xd3, 0x0, 0xc, 0x0, 0x40, 0x3, 0x3b, - 0x0, 0x65, 0x5c, 0x55, 0x61, 0x0, 0xb, 0x0, - 0x27, 0x5c, 0x57, 0x50, 0x6, 0x6d, 0x85, 0x11, - 0x1b, 0x11, 0x62, 0x0, 0x5d, 0x31, 0x63, 0x33, - 0x33, 0x52, 0x0, 0xab, 0x83, 0x96, 0x55, 0x56, - 0xb0, 0x1, 0x8b, 0x23, 0x86, 0x55, 0x56, 0x90, - 0x7, 0x1b, 0x0, 0x81, 0x0, 0x2, 0x90, 0x14, - 0xb, 0x0, 0x86, 0x55, 0x56, 0x90, 0x0, 0xb, - 0x0, 0x96, 0x55, 0x56, 0x90, 0x0, 0xc, 0x0, - 0x2a, 0x60, 0x37, 0x10, 0x0, 0xb, 0x3, 0x73, - 0x0, 0x2, 0xc0, 0x0, 0x0, 0x1, 0x0, 0x0, - 0x0, 0x20, - - /* U+7A76 "究" */ - 0x0, 0x0, 0x1, 0x20, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xb4, 0x0, 0x0, 0x0, 0x0, 0x75, - 0x55, 0x87, 0x55, 0x5c, 0x10, 0x3, 0x90, 0x94, - 0x1, 0x50, 0x36, 0x0, 0x3, 0x29, 0x75, 0x10, - 0x2b, 0xa0, 0x0, 0x2, 0x61, 0xb, 0x10, 0x0, - 0x91, 0x0, 0x0, 0x46, 0x6d, 0x66, 0x94, 0x0, - 0x0, 0x0, 0x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0xa, 0x5a, 0x5b, 0x30, - 0x0, 0x94, 0x80, 0xb, 0x0, 0xb, 0x0, 0x0, - 0x51, 0x60, 0xb, 0x0, 0xb, 0x0, 0x0, 0x36, - 0x95, 0x2b, 0x0, 0xb, 0x0, 0xc, 0x83, 0x0, - 0xc, 0x55, 0x5c, 0x0, 0x0, 0x0, 0x0, 0xb, - 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+7AE5 "童" */ - 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x7, 0x40, 0x14, 0x0, 0x0, 0x46, 0x97, - 0x55, 0xc6, 0x50, 0x0, 0x0, 0x1, 0xb0, 0x26, - 0x0, 0x0, 0x5, 0x65, 0x56, 0x57, 0x55, 0x87, - 0x0, 0x0, 0x75, 0x55, 0x55, 0x75, 0x0, 0x0, - 0xb, 0x0, 0x91, 0x5, 0x50, 0x0, 0x0, 0xb5, - 0x5b, 0x65, 0x95, 0x0, 0x0, 0xb, 0x55, 0xb6, - 0x59, 0x60, 0x0, 0x0, 0x60, 0x9, 0x10, 0x33, - 0x0, 0x0, 0x55, 0x55, 0xb6, 0x55, 0xb4, 0x0, - 0x0, 0x0, 0x9, 0x10, 0x0, 0x20, 0x6, 0x55, - 0x55, 0x75, 0x55, 0x58, 0x50, - - /* U+7AEF "端" */ - 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x71, 0x0, 0x50, 0x1c, 0x2, 0x10, 0x0, 0x48, - 0x0, 0xb0, 0xa, 0x4, 0x70, 0x0, 0x1, 0x50, - 0xa0, 0xa, 0x4, 0x60, 0x5, 0x44, 0x62, 0x85, - 0x55, 0x57, 0x40, 0x3, 0x10, 0xd3, 0x55, 0x55, - 0x55, 0x92, 0x1, 0x72, 0x80, 0x10, 0x92, 0x0, - 0x0, 0x0, 0xb5, 0x30, 0x85, 0xa5, 0x55, 0x90, - 0x0, 0x66, 0x0, 0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x0, 0x1, 0x55, 0x55, 0x6b, 0x55, 0xd9, - 0x80, 0x0, 0x10, 0x0, 0x29, 0x0, 0xc0, 0x0, - 0x0, 0x4, 0x65, 0x6b, 0x55, 0xa0, 0x0, 0x0, - 0x2, 0x22, 0x4a, 0x23, 0x80, 0x0, 0x0, 0x3, - 0x33, 0x5a, 0x33, 0x35, 0x10, 0x3, 0x65, 0x55, - 0x6b, 0x55, 0x57, 0x40, 0x0, 0x0, 0x0, 0x2a, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11, 0x0, - 0x0, 0x0, - - /* U+7B49 "等" */ - 0x0, 0x3, 0x0, 0x0, 0x12, 0x0, 0x0, 0x0, - 0xe, 0x50, 0x10, 0x88, 0x0, 0x10, 0x0, 0x5b, - 0x75, 0x85, 0xb7, 0x55, 0x80, 0x1, 0xa0, 0x84, - 0x5, 0x10, 0xb0, 0x0, 0x6, 0x0, 0x35, 0xc, - 0x0, 0x70, 0x0, 0x0, 0x6, 0x55, 0x5d, 0x55, - 0x78, 0x0, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, - 0x30, 0x6, 0x55, 0x55, 0x57, 0x56, 0x55, 0x70, - 0x0, 0x0, 0x0, 0x0, 0xb, 0x21, 0x30, 0x1, - 0x75, 0x75, 0x55, 0x5c, 0x55, 0x60, 0x0, 0x0, - 0x39, 0x0, 0xb, 0x10, 0x0, 0x0, 0x0, 0xb, - 0x10, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, - 0xae, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x12, - 0x0, 0x0, - - /* U+7B54 "答" */ - 0x0, 0x2, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, - 0xf, 0x20, 0x1, 0xe0, 0x0, 0x0, 0x0, 0x7b, - 0x55, 0xa7, 0x86, 0x59, 0x30, 0x1, 0xa0, 0xa0, - 0x16, 0x6, 0x60, 0x0, 0x7, 0x10, 0x85, 0xe1, - 0x0, 0xa0, 0x0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b, 0x55, 0x55, - 0x57, 0xb0, 0x0, 0x0, 0xb, 0x55, 0x55, 0x57, - 0x90, 0x0, 0x0, 0xb, 0x0, 0x0, 0x3, 0x90, - 0x0, 0x0, 0xc, 0x55, 0x55, 0x57, 0x90, 0x0, - 0x0, 0xc, 0x59, 0x55, 0x97, 0x90, 0x0, 0x0, - 0x2, 0x2b, 0x0, 0xc0, 0x0, 0x20, 0x16, 0x55, - 0x8b, 0x55, 0xd5, 0x57, 0x80, 0x0, 0x0, 0xb2, - 0x0, 0xc0, 0x0, 0x0, 0x0, 0x38, 0x20, 0x0, - 0xc0, 0x0, 0x0, 0x2, 0x20, 0x0, 0x0, 0x30, - 0x0, 0x0, - - /* U+7BA1 "管" */ - 0x0, 0x3, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, - 0x79, 0x0, 0x11, 0xc1, 0x1, 0x0, 0x0, 0xb7, - 0x66, 0x58, 0x68, 0x57, 0x40, 0x7, 0x10, 0xa0, - 0x61, 0x6, 0x60, 0x0, 0x3, 0x0, 0x20, 0x92, - 0x0, 0x12, 0x30, 0x9, 0x55, 0x55, 0x55, 0x55, - 0x5b, 0x80, 0x29, 0x8, 0x55, 0x55, 0x5c, 0x4, - 0x0, 0x0, 0xa, 0x0, 0x0, 0xb, 0x0, 0x0, - 0x0, 0xa, 0x55, 0x55, 0x5b, 0x0, 0x0, 0x0, - 0xa, 0x0, 0x0, 0x2, 0x10, 0x0, 0x0, 0xa, - 0x55, 0x55, 0x5a, 0x60, 0x0, 0x0, 0xa, 0x0, - 0x0, 0x7, 0x30, 0x0, 0x0, 0xb, 0x55, 0x55, - 0x5a, 0x40, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+7BC0 "節" */ - 0x0, 0x4, 0x0, 0x0, 0x31, 0x0, 0x0, 0x0, - 0x3c, 0x0, 0x60, 0xb3, 0x3, 0x40, 0x0, 0xa5, - 0xa8, 0x54, 0xa6, 0xa5, 0x40, 0x4, 0x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1, 0x0, 0xb0, - 0x0, 0x2, 0x90, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+7D39 "紹" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x9, 0x50, 0x35, 0x55, 0x55, 0xa1, 0x0, 0x2a, - 0x0, 0x10, 0xa3, 0x0, 0xc0, 0x0, 0x90, 0x16, - 0x0, 0xc1, 0x1, 0xb0, 0xa, 0x75, 0xa5, 0x1, - 0xc0, 0x3, 0x90, 0x7, 0x57, 0x60, 0x7, 0x50, - 0x5, 0x70, 0x0, 0x47, 0x33, 0x27, 0x1, 0x8d, - 0x30, 0x6, 0x82, 0x5d, 0x43, 0x0, 0x3, 0x40, - 0xa, 0x94, 0x17, 0xc, 0x55, 0x55, 0xd0, 0x0, - 0x2, 0x18, 0xb, 0x0, 0x0, 0xb0, 0x4, 0x28, - 0x28, 0x6b, 0x0, 0x0, 0xb0, 0xb, 0x26, 0x61, - 0x3c, 0x55, 0x55, 0xb0, 0x8, 0x0, 0x0, 0xa, - 0x0, 0x0, 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+7D42 "終" */ - 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, - 0xa, 0x30, 0x2, 0xe1, 0x0, 0x0, 0x0, 0x39, - 0x0, 0x8, 0x85, 0x5a, 0x20, 0x0, 0x90, 0x35, - 0x2b, 0x10, 0x2b, 0x0, 0xb, 0x76, 0xb3, 0x60, - 0x70, 0xa2, 0x0, 0x5, 0x38, 0x40, 0x0, 0x5a, - 0x70, 0x0, 0x0, 0x64, 0x25, 0x0, 0x4e, 0x60, - 0x0, 0x9, 0x85, 0x5d, 0x15, 0x70, 0xab, 0x50, - 0x8, 0x62, 0x5, 0x62, 0x29, 0x25, 0x81, 0x1, - 0x2, 0x35, 0x0, 0x4, 0xa0, 0x0, 0x7, 0xa, - 0xc, 0x12, 0x62, 0x10, 0x0, 0xc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, - 0x11, 0x55, 0x9, 0x20, 0xb0, 0x0, 0x7, 0xb, - 0xc, 0xb, 0x0, 0xb0, 0x30, 0x1c, 0xa, 0x1, - 0x57, 0x0, 0xb0, 0x60, 0x13, 0x0, 0x6, 0x60, - 0x0, 0xba, 0xd4, 0x0, 0x0, 0x30, 0x0, 0x0, - 0x0, 0x0, - - /* U+7D75 "絵" */ - 0x0, 0x1, 0x0, 0x0, 0x11, 0x0, 0x0, 0x0, - 0x1d, 0x0, 0x0, 0x8a, 0x0, 0x0, 0x0, 0x93, - 0x0, 0x1, 0xc5, 0x20, 0x0, 0x4, 0x50, 0x82, - 0x9, 0x30, 0x91, 0x0, 0x2d, 0x77, 0xb0, 0x55, - 0x0, 0x1c, 0x40, 0x5, 0x1a, 0x14, 0x34, 0x55, - 0xb5, 0xb3, 0x0, 0x91, 0x62, 0x1, 0x0, 0x0, - 0x0, 0x1a, 0x44, 0x8b, 0x0, 0x0, 0x4, 0x30, - 0x1d, 0x73, 0x8, 0x55, 0xa7, 0x55, 0x40, 0x0, - 0x11, 0x51, 0x1, 0xd2, 0x0, 0x0, 0x6, 0xa, - 0x1c, 0x9, 0x20, 0x33, 0x0, 0xa, 0xb, 0x6, - 0x74, 0x12, 0x3c, 0x20, 0x24, 0x0, 0x0, 0xb9, - 0x64, 0x25, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+7D93 "經" */ - 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x1c, 0x1, 0x55, 0x55, 0x58, 0x90, 0x0, 0x82, - 0x0, 0x23, 0x5, 0x4, 0x0, 0x2, 0x60, 0x70, - 0x68, 0x3a, 0x1c, 0x10, 0x1b, 0x46, 0xa0, 0x90, - 0x80, 0x71, 0x0, 0x8, 0x3a, 0x1, 0x70, 0x80, - 0x83, 0x0, 0x0, 0x82, 0x50, 0x86, 0x4a, 0xd, - 0x10, 0x7, 0x51, 0x95, 0x26, 0x7, 0x4, 0x0, - 0xd, 0xa5, 0x47, 0x45, 0x55, 0x57, 0x70, 0x1, - 0x1, 0x41, 0x10, 0xb, 0x0, 0x0, 0x6, 0x9, - 0x1b, 0x0, 0xb, 0x0, 0x0, 0xc, 0xc, 0x6, - 0x0, 0xb, 0x0, 0x0, 0x18, 0x2, 0x2, 0x55, - 0x5c, 0x56, 0xd1, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+7D9A "続" */ - 0x0, 0x1, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, - 0x1c, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0x73, - 0x0, 0x55, 0x5c, 0x57, 0xa0, 0x1, 0x70, 0x60, - 0x10, 0xb, 0x0, 0x0, 0xb, 0x45, 0xa0, 0x6, - 0x5a, 0x5a, 0x10, 0x8, 0x4a, 0x0, 0x30, 0x0, - 0x0, 0x20, 0x0, 0x72, 0x50, 0xa5, 0x55, 0x55, - 0xe1, 0x6, 0x51, 0x96, 0x74, 0x51, 0x44, 0x20, - 0xd, 0xa6, 0x57, 0x5, 0x71, 0xa0, 0x0, 0x1, - 0x0, 0x30, 0x7, 0x41, 0x90, 0x0, 0x5, 0x17, - 0x2a, 0xa, 0x1, 0x90, 0x40, 0xb, 0xc, 0x7, - 0x47, 0x1, 0x90, 0x70, 0x17, 0x3, 0x6, 0x60, - 0x0, 0xca, 0xe2, 0x0, 0x0, 0x30, 0x0, 0x0, - 0x0, 0x0, - - /* U+7DAD "維" */ - 0x0, 0x1, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, - 0x1b, 0x0, 0x6, 0x6a, 0x30, 0x0, 0x0, 0x82, - 0x0, 0xb, 0x14, 0x80, 0x0, 0x2, 0x60, 0x70, - 0x1d, 0x57, 0x58, 0x80, 0x1b, 0x56, 0xa0, 0x7b, - 0xa, 0x10, 0x0, 0x6, 0x2a, 0x1, 0x6b, 0xa, - 0x11, 0x0, 0x0, 0x81, 0x74, 0xc, 0x5c, 0x57, -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1, 0x75, 0x69, - 0x58, 0x81, 0x0, 0x90, 0x70, 0x20, 0x2d, 0x2, - 0x60, 0xb, 0x66, 0xa6, 0x86, 0x2c, 0x68, 0x20, - 0x9, 0x50, 0x24, 0x9, 0x3a, 0xa0, 0x0, 0x2, - 0x31, 0x91, 0x5, 0x7a, 0x64, 0x0, 0x8, 0x1a, - 0x57, 0x94, 0x2a, 0xb, 0x20, 0x4a, 0x8, 0x7, - 0x30, 0x29, 0x2, 0xc2, 0x21, 0x0, 0x0, 0x5, - 0xe7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, - 0x0, 0x0, - - /* U+7DD2 "緒" */ - 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, - 0x1a, 0x0, 0x0, 0x92, 0x1, 0x0, 0x0, 0x82, - 0x0, 0x0, 0x91, 0x2b, 0x20, 0x2, 0x60, 0x60, - 0x65, 0xb6, 0x98, 0x0, 0x1b, 0x46, 0xa0, 0x0, - 0x91, 0xa0, 0x10, 0x7, 0x3a, 0x5, 0x65, 0x9b, - 0x76, 0xa0, 0x0, 0x91, 0x60, 0x0, 0x75, 0x0, - 0x0, 0xa, 0x54, 0xa7, 0xa, 0xa5, 0x59, 0x0, - 0xb, 0x62, 0x26, 0x89, 0x0, 0xa, 0x0, 0x1, - 0x20, 0x64, 0x1b, 0x55, 0x5b, 0x0, 0x7, 0x36, - 0x84, 0x9, 0x0, 0xa, 0x0, 0x2a, 0x1b, 0x25, - 0x19, 0x0, 0xa, 0x0, 0x33, 0x1, 0x0, 0x1b, - 0x55, 0x5b, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, - 0x0, 0x0, - - /* U+7DDA "線" */ - 0x0, 0x0, 0x0, 0x0, 0x11, 0x0, 0x0, 0x0, - 0x29, 0x0, 0x0, 0x85, 0x0, 0x0, 0x0, 0x92, - 0x0, 0x95, 0x85, 0x5c, 0x10, 0x3, 0x50, 0x50, - 0xb0, 0x0, 0xb, 0x0, 0x2a, 0x37, 0x80, 0xb5, - 0x55, 0x5c, 0x0, 0x18, 0x4a, 0x0, 0xb0, 0x0, - 0xb, 0x0, 0x0, 0x92, 0x40, 0xa5, 0x6b, 0x59, - 0x0, 0x9, 0x33, 0xd1, 0x1, 0x1d, 0x1, 0x50, - 0x1d, 0x73, 0x74, 0x6c, 0x8b, 0x59, 0x50, 0x2, - 0x30, 0x80, 0xb, 0x1a, 0x90, 0x0, 0x7, 0x65, - 0x93, 0x83, 0x1a, 0x57, 0x0, 0x86, 0x37, 0x15, - 0x50, 0x1a, 0xa, 0xa1, 0x30, 0x0, 0x42, 0x6, - 0xd8, 0x1, 0x20, 0x0, 0x0, 0x0, 0x0, 0x30, - 0x0, 0x0, - - /* U+7DE0 "締" */ - 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, - 0x1b, 0x0, 0x0, 0x5b, 0x0, 0x0, 0x0, 0x82, - 0x2, 0x65, 0x59, 0x58, 0x70, 0x2, 0x60, 0x50, - 0x8, 0x0, 0xa2, 0x0, 0x1a, 0x35, 0xa0, 0x5, - 0x60, 0x80, 0x0, 0x8, 0x4a, 0x5, 0x75, 0x56, - 0x55, 0xd1, 0x0, 0x81, 0x5b, 0x10, 0x18, 0x2, - 0x30, 0x8, 0x42, 0xa3, 0x20, 0x19, 0x3, 0x0, - 0xe, 0x94, 0x55, 0xa5, 0x6b, 0x5c, 0x10, 0x0, - 0x10, 0x50, 0xa0, 0x19, 0xa, 0x0, 0x6, 0x63, - 0x85, 0xa0, 0x19, 0xa, 0x0, 0x29, 0x2a, 0x13, - 0x90, 0x19, 0x7b, 0x0, 0x53, 0x1, 0x0, 0x0, - 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, - - /* U+7DE9 "緩" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, - 0x1c, 0x0, 0x35, 0x67, 0x9b, 0x40, 0x0, 0x85, - 0x0, 0x30, 0x50, 0x1a, 0x0, 0x2, 0x70, 0x60, - 0x65, 0x46, 0x55, 0x0, 0x1b, 0x46, 0xa1, 0x77, - 0x65, 0x88, 0x60, 0x7, 0x3a, 0x0, 0x1, 0xa0, - 0x0, 0x0, 0x0, 0x81, 0x64, 0x67, 0xa5, 0x55, - 0xb1, 0x8, 0x54, 0xa6, 0x8, 0x40, 0x0, 0x0, - 0xb, 0x72, 0x25, 0xb, 0x85, 0x6d, 0x0, 0x2, - 0x30, 0x60, 0x47, 0x70, 0xa4, 0x0, 0x8, 0x38, - 0x85, 0x90, 0x1c, 0x70, 0x0, 0x59, 0x9, 0x19, - 0x10, 0x7a, 0xb2, 0x0, 0x10, 0x0, 0x21, 0x27, - 0x30, 0x3d, 0xb2, 0x0, 0x0, 0x0, 0x20, 0x0, - 0x0, 0x20, - - /* U+7DF4 "練" */ - 0x0, 0x1, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, - 0x1c, 0x0, 0x0, 0xb, 0x0, 0x0, 0x0, 0x72, - 0x3, 0x65, 0x5c, 0x56, 0xb1, 0x2, 0x60, 0x70, - 0x0, 0xa, 0x0, 0x0, 0x1c, 0x56, 0x90, 0x95, - 0x5c, 0x5b, 0x20, 0x6, 0x29, 0x0, 0xa5, 0xa, - 0x7b, 0x0, 0x0, 0x81, 0x60, 0xa4, 0x6a, 0x7a, - 0x0, 0x8, 0x53, 0x97, 0xb5, 0x6d, 0x5c, 0x0, - 0xc, 0x73, 0x26, 0x61, 0xdb, 0x33, 0x0, 0x1, - 0x11, 0x61, 0x8, 0x5a, 0x80, 0x0, 0x6, 0xa, - 0x3a, 0x39, 0xa, 0x49, 0x0, 0x1b, 0xc, 0x5, - 0x80, 0xa, 0x9, 0xc3, 0x25, 0x0, 0x14, 0x0, - 0xa, 0x0, 0x30, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, - - /* U+7E3D "總" */ - 0x0, 0x0, 0x0, 0x0, 0x11, 0x0, 0x0, 0x0, - 0xc, 0x0, 0x0, 0x76, 0x0, 0x0, 0x0, 0x73, - 0x0, 0x94, 0x84, 0x48, 0x70, 0x1, 0x70, 0x60, - 0xa0, 0xa5, 0x27, 0x50, 0xb, 0x45, 0xa0, 0xa3, - 0x85, 0xc9, 0x50, 0x7, 0x39, 0x0, 0xa3, 0x39, - 0x76, 0x50, 0x0, 0x81, 0x60, 0xb1, 0x66, 0xc6, - 0x50, 0x9, 0x65, 0x97, 0xb8, 0x66, 0x7a, 0x50, - 0xa, 0x62, 0x15, 0x21, 0x44, 0x2, 0x0, 0x0, - 0x14, 0x30, 0x2c, 0xd, 0x14, 0x60, 0x5, 0x63, - 0xc6, 0x2a, 0x3, 0x3, 0xc2, 0x1a, 0x37, 0x1d, - 0xa, 0x0, 0x6, 0x10, 0x56, 0x0, 0x1, 0xd, - 0xaa, 0xbc, 0x0, - - /* U+7E3E "績" */ - 0x0, 0x0, 0x0, 0x0, 0x12, 0x0, 0x0, 0x0, - 0x1c, 0x0, 0x0, 0x2a, 0x4, 0x0, 0x0, 0x73, - 0x3, 0x65, 0x6b, 0x56, 0x30, 0x1, 0x70, 0x60, - 0x46, 0x6b, 0x58, 0x0, 0xb, 0x45, 0x91, 0x11, - 0x39, 0x14, 0x70, 0x7, 0x39, 0x3, 0x63, 0x33, - 0x36, 0x30, 0x0, 0x72, 0x60, 0xc5, 0x55, 0x5d, - 0x20, 0x7, 0x52, 0xa5, 0xc5, 0x55, 0x5c, 0x0, - 0xc, 0x94, 0x36, 0xc4, 0x44, 0x4c, 0x0, 0x0, - 0x20, 0x50, 0xc1, 0x11, 0x1b, 0x0, 0x6, 0x37, - 0x57, 0xa6, 0x55, 0x5a, 0x0, 0x1b, 0xc, 0x3, - 0xb, 0x60, 0x67, 0x10, 0x24, 0x0, 0x1, 0x93, - 0x0, 0x5, 0xd0, 0x0, 0x0, 0x3, 0x0, 0x0, - 0x0, 0x30, - - /* U+7E54 "織" */ - 0x0, 0x0, 0x0, 0x20, 0x0, 0x10, 0x0, 0x0, - 0x83, 0x0, 0x39, 0x0, 0xa0, 0x0, 0x0, 0x90, - 0x6, 0x58, 0x93, 0x97, 0x10, 0x6, 0x13, 0x15, - 0x20, 0xc0, 0x92, 0x90, 0x49, 0x4b, 0x21, 0x93, - 0x40, 0x90, 0x0, 0x35, 0x74, 0x26, 0x57, 0x55, - 0xb5, 0xb1, 0x1, 0x74, 0x22, 0x0, 0x30, 0x93, - 0x20, 0x19, 0x25, 0xb9, 0x65, 0xc0, 0x99, 0x40, - 0x4b, 0x51, 0x79, 0x10, 0xa0, 0x9b, 0x0, 0x0, - 0x24, 0x29, 0x65, 0xa0, 0xa5, 0x0, 0x7, 0x92, - 0xc9, 0x10, 0xa1, 0xc6, 0x22, 0x77, 0x75, 0x2a, - 0x65, 0x97, 0xb, 0xa0, 0x41, 0x0, 0x1, 0x1, - 0x50, 0x1, 0xd0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+7E70 "繰" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xc, 0x10, 0xb, 0x55, 0x5c, 0x0, 0x0, 0x45, - 0x0, 0xb, 0x0, 0xb, 0x0, 0x0, 0x80, 0x61, - 0xb, 0x55, 0x5a, 0x0, 0xb, 0x86, 0xb0, 0x75, - 0x70, 0x75, 0x70, 0x4, 0x19, 0x10, 0xa0, 0xa0, - 0xb0, 0x90, 0x0, 0x73, 0x61, 0xc5, 0xb0, 0xc5, - 0xa0, 0x6, 0x84, 0x8a, 0x40, 0x36, 0x50, 0x30, - 0x8, 0x83, 0x7, 0x65, 0x6e, 0x55, 0xb1, 0x0, - 0x10, 0x61, 0x0, 0xbc, 0x50, 0x0, 0x7, 0xa, - 0x2a, 0x9, 0x2c, 0x64, 0x0, 0x1b, 0xc, 0x3, - 0x82, 0xc, 0x9, 0x81, 0x14, 0x0, 0x15, 0x0, - 0xc, 0x0, 0x60, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, - - /* U+7E7C "繼" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x56, 0x8, 0x16, 0x0, 0x33, 0x0, 0x0, 0xa0, - 0xa, 0x37, 0x40, 0x93, 0x20, 0x6, 0x31, 0x3a, - 0xb6, 0xa6, 0x8a, 0x20, 0x3a, 0x49, 0x4a, 0x18, - 0x30, 0x64, 0x10, 0x26, 0x57, 0xa, 0xa7, 0x96, - 0xa4, 0xa0, 0x1, 0x81, 0x4a, 0x10, 0x0, 0x13, - 0x50, 0x1a, 0x34, 0xda, 0x59, 0x55, 0x69, 0x30, - 0x2c, 0x51, 0x6a, 0x18, 0x30, 0x73, 0x20, 0x0, - 0x13, 0xa, 0x95, 0xa6, 0x89, 0x40, 0x6, 0x81, - 0xba, 0x18, 0x20, 0x64, 0x30, 0x56, 0x84, 0x7a, - 0x96, 0x95, 0xa4, 0x90, 0x61, 0x10, 0xc, 0x75, - 0x86, 0x67, 0xb0, 0x0, 0x0, 0x3, 0x0, 0x0, - 0x0, 0x0, - - /* U+7E8C "續" */ - 0x0, 0x0, 0x0, 0x0, 0x15, 0x0, 0x0, 0x0, - 0xb, 0x2, 0x55, 0x6c, 0x55, 0xb1, 0x0, 0x64, - 0x0, 0x21, 0x2a, 0x15, 0x20, 0x1, 0x80, 0x40, - 0x55, 0x44, 0x44, 0x40, 0x9, 0x23, 0xb0, 0xb5, - 0xa5, 0xa5, 0xc0, 0xa, 0x5b, 0x10, 0xa0, 0x90, - 0x90, 0xa0, 0x0, 0x63, 0x50, 0x95, 0x55, 0x56, - 0x50, 0x6, 0x52, 0x95, 0x87, 0x55, 0x5a, 0x50, - 0xd, 0x95, 0x37, 0x77, 0x55, 0x5a, 0x40, 0x0, - 0x10, 0x30, 0x87, 0x55, 0x5a, 0x40, 0x6, 0x64, - 0x93, 0x87, 0x55, 0x5a, 0x40, 0x29, 0x2a, 0x34, - 0x39, 0x60, 0x48, 0x10, 0x43, 0x1, 0x4, 0x84, - 0x0, 0x4, 0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0, 0x3c, 0x61, 0x0, 0x2, 0x67, 0x10, 0x0, - 0x1, 0x9f, 0x90, 0x11, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+7FA9 "義" */ - 0x0, 0x0, 0x40, 0x0, 0x32, 0x0, 0x0, 0x0, - 0x0, 0x58, 0x0, 0xa3, 0x12, 0x0, 0x2, 0x65, - 0x57, 0x95, 0x75, 0x88, 0x0, 0x0, 0x25, 0x55, - 0xc5, 0x55, 0xb0, 0x0, 0x0, 0x1, 0x0, 0xb0, - 0x0, 0x5, 0x0, 0x5, 0x55, 0x55, 0x85, 0x55, - 0x59, 0x30, 0x0, 0x0, 0x38, 0xb5, 0x82, 0x81, - 0x0, 0x1, 0x45, 0xc3, 0x13, 0x90, 0x57, 0x0, - 0x16, 0x55, 0xc5, 0x55, 0xc5, 0x59, 0x80, 0x0, - 0x0, 0xa3, 0x30, 0xb0, 0x68, 0x0, 0xb, 0xa7, - 0xc0, 0x0, 0x6b, 0x90, 0x20, 0x0, 0x0, 0xa0, - 0x3, 0xac, 0x50, 0x60, 0x0, 0x29, 0xd2, 0x53, - 0x0, 0x7c, 0xd0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+7FD2 "習" */ - 0x0, 0x0, 0x20, 0x0, 0x0, 0x20, 0x26, 0x55, - 0xd2, 0x55, 0x57, 0xc0, 0x6, 0x70, 0xc0, 0x39, - 0x12, 0x90, 0x0, 0xb0, 0xc0, 0x6, 0x32, 0x90, - 0x0, 0x46, 0xd0, 0x3, 0x77, 0x90, 0x5b, 0x40, - 0xc2, 0x99, 0x12, 0x70, 0x21, 0x0, 0xc, 0x30, - 0x0, 0x0, 0x0, 0x85, 0x78, 0x55, 0x5a, 0x20, - 0x0, 0xc0, 0x0, 0x0, 0xc, 0x0, 0x0, 0xc0, - 0x0, 0x0, 0xc, 0x0, 0x0, 0xd5, 0x55, 0x55, - 0x5d, 0x0, 0x0, 0xc0, 0x0, 0x0, 0xc, 0x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0, 0xb0, 0xa, 0x32, 0x5a, - 0x79, 0xa0, 0xb3, 0x54, 0x32, 0x38, 0x0, 0xb0, - 0xb0, 0x0, 0x0, 0x25, 0x3a, 0xe0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x10, - - /* U+806F "聯" */ - 0x0, 0x0, 0x0, 0x2, 0x20, 0x3, 0x0, 0x5, - 0x55, 0x5c, 0x59, 0x30, 0x59, 0x0, 0x1, 0xb0, - 0x91, 0x54, 0x63, 0x80, 0x82, 0x0, 0xb0, 0x93, - 0xd7, 0x86, 0x87, 0x80, 0x0, 0xc5, 0xb1, 0x18, - 0x31, 0x36, 0x30, 0x0, 0xb0, 0x92, 0x93, 0x83, - 0x84, 0x94, 0x0, 0xb0, 0x93, 0xb5, 0x53, 0x83, - 0x23, 0x0, 0xc5, 0xb1, 0x1, 0x44, 0xa1, 0x10, - 0x0, 0xb0, 0x91, 0x1a, 0x44, 0xa0, 0xa0, 0x1, - 0xc6, 0xc5, 0x29, 0x64, 0xa0, 0xa0, 0xd, 0x71, - 0x91, 0x2a, 0x83, 0xa5, 0xb0, 0x0, 0x0, 0xa1, - 0x0, 0xa0, 0xa0, 0x0, 0x0, 0x0, 0xa2, 0x38, - 0x20, 0xb0, 0x0, 0x0, 0x0, 0x11, 0x10, 0x0, - 0x20, 0x0, - - /* U+8072 "聲" */ - 0x0, 0x0, 0x50, 0x0, 0x10, 0x10, 0x0, 0x4, - 0x55, 0xc5, 0xa2, 0xb5, 0xc1, 0x0, 0x1, 0x0, - 0xa0, 0x31, 0x80, 0xa4, 0x50, 0x2, 0x85, 0x55, - 0x57, 0x10, 0x28, 0x60, 0x0, 0xb5, 0xa6, 0xb2, - 0x95, 0xa8, 0x0, 0x1, 0xb5, 0xc6, 0x90, 0x1b, - 0x70, 0x0, 0x3, 0x60, 0x0, 0x2, 0x85, 0x98, - 0x50, 0x6, 0x35, 0x55, 0x68, 0x55, 0x89, 0x40, - 0x2, 0x1, 0xb1, 0x11, 0x17, 0x30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 0x0, 0x0, 0x0, - 0x0, 0x55, 0x55, 0xc7, 0x55, 0xd5, 0x0, 0x0, - 0x10, 0x0, 0xa2, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xa2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xa2, 0x0, 0x7, 0x50, 0x26, 0x55, 0x55, 0x55, - 0x55, 0x55, 0x40, - - /* U+81FA "臺" */ - 0x0, 0x0, 0x0, 0x13, 0x0, 0x0, 0x10, 0x6, - 0x55, 0x55, 0x6c, 0x55, 0x58, 0xa0, 0x0, 0x24, - 0x44, 0x6b, 0x44, 0x94, 0x0, 0x0, 0x8, 0x55, - 0x55, 0x55, 0xa1, 0x0, 0x0, 0xc, 0x0, 0x0, - 0x0, 0xc0, 0x0, 0x1, 0xb, 0x55, 0x55, 0x55, - 0x90, 0x0, 0x8, 0x55, 0x55, 0x55, 0x55, 0x56, - 0xd1, 0x4b, 0x35, 0x55, 0x65, 0x56, 0xb5, 0x20, - 0x0, 0x0, 0x48, 0x30, 0x6, 0x30, 0x0, 0x0, - 0x1d, 0xc8, 0x88, 0x55, 0xc5, 0x0, 0x0, 0x3, - 0x0, 0x38, 0x0, 0x82, 0x0, 0x0, 0x36, 0x55, - 0x7b, 0x55, 0x52, 0x0, 0x4, 0x55, 0x55, 0x7b, - 0x55, 0x5c, 0x70, 0x1, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+8207 "與" */ - 0x0, 0x0, 0x2, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x24, 0xa7, 0x70, 0x1, 0x16, 0x0, 0x0, 0xd2, - 0x6, 0x85, 0xa6, 0x4d, 0x20, 0x0, 0xc0, 0x26, - 0x50, 0x0, 0xc, 0x0, 0x0, 0xc5, 0x59, 0x85, - 0xb3, 0x6c, 0x0, 0x0, 0xb0, 0x3, 0x0, 0xb0, - 0xb, 0x0, 0x0, 0xc5, 0x99, 0x40, 0xb2, 0x5c, - 0x0, 0x0, 0xc0, 0x9, 0x20, 0xb0, 0x1b, 0x0, - 0x0, 0xc0, 0x9, 0x20, 0xb0, 0xb, 0x50, 0x8, - 0x65, 0x66, 0x55, 0x65, 0x56, 0x61, 0x0, 0x1, - 0xd5, 0x0, 0x17, 0x50, 0x0, 0x0, 0x1b, 0x40, - 0x0, 0x0, 0x5d, 0x40, 0x4, 0x81, 0x0, 0x0, - 0x0, 0x4, 0xb0, 0x1, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+8208 "興" */ - 0x0, 0x38, 0x68, 0x55, 0x85, 0x15, 0x0, 0x0, - 0xc1, 0x19, 0x2, 0x65, 0x5c, 0x10, 0x0, 0xb2, - 0x1a, 0x66, 0x84, 0xb, 0x0, 0x0, 0xb5, 0x39, - 0x67, 0x75, 0x5c, 0x0, 0x0, 0xa0, 0x19, 0x89, - 0x64, 0xb, 0x0, 0x0, 0xb8, 0x49, 0x89, 0x65, - 0x4b, 0x0, 0x0, 0xb1, 0x19, 0x89, 0x64, 0x2b, - 0x0, 0x0, 0xb0, 0x19, 0x0, 0x64, 0x1b, 0x50, - 0x6, 0x65, 0x57, 0x55, 0x65, 0x56, 0x61, 0x0, - 0x0, 0x9a, 0x0, 0x18, 0x60, 0x0, 0x0, 0x9, - 0x70, 0x0, 0x0, 0x7e, 0x50, 0x3, 0x71, 0x0, - 0x0, 0x0, 0x5, 0x90, 0x1, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+8209 "舉" */ - 0x0, 0x0, 0x31, 0x30, 0x0, 0x0, 0x0, 0x0, - 0xa7, 0x85, 0xd5, 0x95, 0x6c, 0x20, 0x0, 0xb0, - 0x31, 0xa0, 0x0, 0xb, 0x0, 0x0, 0xb5, 0x65, - 0xb5, 0xa5, 0x6b, 0x0, 0x0, 0xa0, 0x61, 0x50, - 0xc0, 0xa, 0x0, 0x0, 0xa6, 0x53, 0xb0, 0xc4, - 0x6b, 0x0, 0x5, 0xb6, 0x56, 0xb5, 0xd5, 0x5d, -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 0x55, 0xd5, 0x57, 0x90, 0x0, 0x0, 0xa, - 0x0, 0x73, 0x81, 0x0, 0x0, 0x34, 0x56, 0x78, - 0x97, 0x62, 0x0, 0x0, 0x11, 0x0, 0x54, 0x0, - 0xb1, 0x0, 0x0, 0xb, 0x30, 0xb, 0x4, 0x70, - 0x0, 0x0, 0x3, 0x30, 0x38, 0x7, 0x0, 0x20, - 0x17, 0x55, 0x55, 0xab, 0x65, 0x58, 0xb1, 0x0, - 0x0, 0xa, 0x88, 0x60, 0x0, 0x0, 0x0, 0x0, - 0x95, 0x38, 0x19, 0x10, 0x0, 0x0, 0x29, 0x20, - 0x38, 0x2, 0xc8, 0x30, 0x5, 0x50, 0x0, 0x38, - 0x0, 0x7, 0x91, 0x0, 0x0, 0x0, 0x11, 0x0, - 0x0, 0x0, - - /* U+843D "落" */ - 0x0, 0x0, 0x20, 0x0, 0x30, 0x0, 0x0, 0x0, - 0x0, 0xb2, 0x0, 0xc0, 0x3, 0x20, 0x6, 0x55, - 0xc5, 0x55, 0xc5, 0x58, 0x70, 0x1, 0x40, 0x60, - 0x36, 0x50, 0x0, 0x0, 0x0, 0x86, 0x10, 0xa7, - 0x55, 0x80, 0x0, 0x0, 0x2, 0x42, 0x84, 0x8, - 0x40, 0x0, 0xa, 0x23, 0x27, 0x5, 0x77, 0x0, - 0x0, 0x3, 0x47, 0x21, 0x6, 0xc6, 0x0, 0x0, - 0x0, 0x17, 0x0, 0x76, 0x5, 0xc7, 0x30, 0x3, - 0xb3, 0x37, 0xa5, 0x55, 0xb7, 0x70, 0x2, 0xd0, - 0x2, 0x90, 0x0, 0xb0, 0x0, 0x0, 0xd0, 0x2, - 0x90, 0x0, 0xb0, 0x0, 0x0, 0xb0, 0x2, 0xb5, - 0x55, 0xb0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+8449 "葉" */ - 0x0, 0x0, 0x20, 0x0, 0x30, 0x0, 0x0, 0x0, - 0x0, 0x91, 0x0,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0, 0x1b, 0x0, 0xa3, 0x2, 0x40, 0x6, 0x55, - 0x6b, 0x55, 0xb6, 0x57, 0x80, 0x0, 0x0, 0x5, - 0x0, 0x74, 0x80, 0x0, 0x0, 0x41, 0x11, 0x11, - 0x97, 0x76, 0x50, 0x0, 0xb4, 0x44, 0x46, 0x88, - 0x44, 0x30, 0x0, 0xb1, 0xb6, 0x87, 0x56, 0x6, - 0x20, 0x0, 0xb1, 0x93, 0x54, 0x38, 0xc, 0x30, - 0x0, 0xb1, 0xb5, 0x5c, 0x1b, 0x39, 0x0, 0x0, - 0xb1, 0xb5, 0x6b, 0xb, 0xb1, 0x0, 0x0, 0x91, - 0x93, 0x52, 0x9, 0xa0, 0x40, 0x5, 0x22, 0xa5, - 0x68, 0x75, 0xa5, 0x70, 0x5, 0x0, 0x0, 0x16, - 0x20, 0xa, 0xc0, 0x10, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x20, - - /* U+8584 "薄" */ - 0x0, 0x0, 0x3, 0x0, 0x21, 0x0, 0x0, 0x0, - 0x0, 0xc, 0x0, 0x58, 0x1, 0x50, 0x3, 0x65, - 0x5c, 0x55, 0x8a, 0x85, 0x60, 0x1, 0x81, 0x4, - 0x0, 0xa1, 0x83, 0x20, 0x0, 0x46, 0x26, 0x55, - 0xd5, 0x56, 0x70, 0x4, 0x0, 0x47, 0x55, 0xc5, - 0x5c, 0x0, 0x5, 0x84, 0x9, 0x54, 0xc4, 0x4b, - 0x0, 0x0, 0x26, 0x9, 0x31, 0xb1, 0x1b, 0x0, - 0x0, 0x44, 0x9, 0x65, 0xc5, 0x6a, 0x0, 0x5, - 0xe0, 0x56, 0x55, 0x65, 0xd5, 0xb1, 0x0, 0xc0, - 0x11, 0x70, 0x0, 0xb0, 0x0, 0x0, 0xe0, 0x0, - 0x54, 0x0, 0xb0, 0x0, 0x0, 0xa0, 0x0, 0x0, - 0x5d, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, - - /* U+85AC "薬" */ - 0x0, 0x0, 0x2, 0x0, 0x11, 0x0, 0x0, 0x0, - 0x0, 0xd, 0x0, 0x3a, 0x0, 0x81, 0x6, 0x55, - 0x5c, 0x55, 0x7a, 0x55, 0x52, 0x0, 0x0, 0x2, - 0x2a, 0x11, 0x0, 0x0, 0x1, 0x72, 0x17, 0x95, - 0x59, 0x2, 0x60, 0x0, 0x2a, 0x19, 0x0, 0xa, - 0x58, 0x30, 0x0, 0x0, 0x4b, 0x55, 0x5a, 0x40, - 0x0, 0x4, 0x96, 0x29, 0x0, 0xa, 0x1a, 0x80, - 0x3, 0x10, 0x19, 0x57, 0x57, 0x0, 0x60, 0x3, - 0x55, 0x55, 0x5e, 0x55, 0x57, 0xd1, 0x1, 0x0, - 0x9, 0x9b, 0x51, 0x0, 0x0, 0x0, 0x2, 0xa5, - 0xb, 0x7, 0x82, 0x0, 0x3, 0x55, 0x0, 0xb, - 0x0, 0x3c, 0xd3, 0x0, 0x0, 0x0, 0x2, 0x0, - 0x0, 0x0, - - /* U+85DD "藝" */ - 0x0, 0x0, 0x2, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x0, 0xc, 0x0, 0x1b, 0x0, 0x80, 0x5, 0x55, - 0x5c, 0x55, 0x6a, 0x55, 0x52, 0x0, 0x0, 0xa0, - 0x10, 0x7, 0x0, 0x0, 0x0, 0x65, 0xb5, 0x73, - 0x5c, 0x58, 0x0, 0x3, 0x75, 0x96, 0x93, 0xa, - 0x18, 0x0, 0x1, 0x92, 0xb6, 0x90, 0x5b, 0x19, - 0x0, 0x3, 0x26, 0xb5, 0x30, 0x95, 0x7b, 0x40, - 0x0, 0x78, 0xa5, 0x35, 0x21, 0x16, 0xc0, 0x0, - 0x33, 0x65, 0x55, 0x57, 0x72, 0x20, 0x1, 0x65, - 0x55, 0x95, 0x55, 0x5a, 0x30, 0x0, 0x0, 0x18, - 0x71, 0x27, 0x30, 0x0, 0x0, 0x8, 0xea, 0x87, - 0x54, 0xb4, 0x0, 0x0, 0x2, 0x10, 0x0, 0x0, - 0x0, 0x0, - - /* U+8607 "蘇" */ - 0x0, 0x0, 0x2, 0x0, 0x20, 0x0, 0x0, 0x0, - 0x0, 0x1b, 0x0, 0xa2, 0x2, 0x50, 0x6, 0x55, - 0x5b, 0x55, 0xc5, 0x55, 0x50, 0x0, 0x8, 0x24, - 0x0, 0x40, 0x15, 0x0, 0x0, 0x3c, 0x5a, 0x13, - 0x5b, 0x86, 0x10, 0x0, 0xa0, 0x44, 0x0, 0xa, - 0x0, 0x0, 0x6, 0xb5, 0xa5, 0xa5, 0x6d, 0x59, - 0x50, 0x0, 0x90, 0x91, 0x80, 0x9d, 0x50, 0x0, - 0x0, 0xb5, 0xb5, 0x80, 0x9a, 0x70, 0x0, 0x0, - 0x90, 0x91, 0x93, 0x5a, 0x29, 0x0, 0x0, 0x85, - 0x55, 0x45, 0xb, 0x9, 0xa1, 0x0, 0x43, 0x65, - 0x60, 0xb, 0x0, 0x20, 0xa, 0x2a, 0x44, 0x70, - 0xb, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, - - /* U+8655 "處" */ - 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xd1, 0x0, 0x50, 0x0, 0x0, 0x0, - 0x0, 0xd5, 0x55, 0x61, 0x0, 0x0, 0xb5, 0x55, - 0xa5, 0x55, 0x59, 0x90, 0x0, 0xb0, 0x0, 0xd1, - 0x3, 0x16, 0x0, 0x0, 0xb2, 0x34, 0xc4, 0x55, - 0x32, 0x0, 0x0, 0xb0, 0x20, 0xb9, 0x88, 0x9a, - 0x0, 0x0, 0xb0, 0xa4, 0x1, 0x20, 0x20, 0x0, - 0x0, 0xa0, 0xc5, 0x8b, 0x87, 0xc2, 0x0, 0x0, - 0x95, 0x80, 0x93, 0x91, 0xa0, 0x20, 0x3, 0x57, - 0x36, 0xa0, 0x90, 0xa0, 0x70, 0x6, 0x10, 0x2c, - 0x97, 0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15, 0xa0, 0x55, 0xc0, 0x0, 0x0, 0xb, - 0x4, 0x50, 0xe, 0x50, 0x0, 0x0, 0xb, 0x8, - 0x1, 0x94, 0xa6, 0x0, 0x0, 0xc, 0x43, 0x56, - 0x0, 0x8, 0xd3, 0x0, 0x1, 0x11, 0x0, 0x0, - 0x0, 0x0, - - /* U+88CF "裏" */ - 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x3a, 0x0, 0x5, 0x20, 0x5, 0x55, - 0x55, 0x55, 0x55, 0x65, 0x30, 0x0, 0xc, 0x55, - 0x69, 0x55, 0xd1, 0x0, 0x0, 0xc, 0x55, 0x6b, - 0x55, 0xc0, 0x0, 0x0, 0xb, 0x0, 0x19, 0x0, - 0xb0, 0x0, 0x0, 0x7, 0x55, 0x6b, 0x55, 0x70, - 0x0, 0x0, 0x36, 0x55, 0x6b, 0x55, 0x74, 0x0, - 0x4, 0x65, 0x55, 0x8a, 0x55, 0x58, 0x80, 0x0, - 0x0, 0x7, 0xa5, 0x1, 0xc4, 0x0, 0x0, 0x4, - 0xba, 0x3, 0x87, 0x20, 0x0, 0x3, 0x64, 0x48, - 0x15, 0x4a, 0x85, 0x30, 0x0, 0x0, 0x6d, 0x70, - 0x0, 0x49, 0x40, 0x0, 0x0, 0x1, 0x0, 0x0, - 0x0, 0x0, - - /* U+88DC "補" */ - 0x0, 0x20, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, - 0x1b, 0x0, 0x0, 0xd, 0x37, 0x0, 0x0, 0x7, - 0x0, 0x0, 0xb, 0x7, 0x40, 0x6, 0x55, 0xc4, - 0x65, 0x5c, 0x55, 0xb3, 0x0, 0x3, 0x90, 0x20, - 0xb, 0x0, 0x30, 0x0, 0xa, 0x23, 0xb5, 0x5c, - 0x57, 0xb0, 0x0, 0x4c, 0x57, 0xb0, 0xb, 0x2, - 0x90, 0x1, 0x8c, 0x70, 0xb5, 0x5c, 0x56, 0x90, - 0x6, 0xb,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 0x5d, 0x10, 0xb0, 0x0, 0xb, - 0x0, 0x2, 0x7b, 0xa5, 0xb0, 0x0, 0xb, 0x0, - 0x15, 0xb, 0x19, 0xb5, 0xd7, 0x9b, 0x0, 0x0, - 0xb, 0x0, 0x0, 0xb3, 0x70, 0x0, 0x0, 0xb, - 0x0, 0x5, 0x73, 0x70, 0x30, 0x0, 0xc, 0x0, - 0x1a, 0x3, 0x70, 0x70, 0x0, 0xc, 0x3, 0x60, - 0x1, 0xca, 0xe2, 0x0, 0x1, 0x21, 0x0, 0x0, - 0x0, 0x0, - - /* U+899A "覚" */ - 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x72, 0xa, 0x10, 0x97, 0x0, 0x1, 0x1, 0xc0, - 0x57, 0x19, 0x0, 0x0, 0x75, 0x56, 0x55, 0x58, - 0x55, 0xa9, 0x3d, 0x1, 0x0, 0x0, 0x2, 0x9, - 0x1, 0x20, 0xa5, 0x55, 0x55, 0xd4, 0x10, 0x0, - 0xa, 0x55, 0x55, 0x5c, 0x0, 0x0, 0x0, 0xa0, - 0x0, 0x0, 0xb0, 0x0, 0x0, 0xa, 0x55, 0x55, - 0x5c, 0x0, 0x0, 0x0, 0xa5, 0x75, 0x75, 0xc0, - 0x0, 0x0, 0x3, 0xc, 0xb, 0x3, 0x0, 0x30, - 0x0, 0x7, 0x60, 0xb0, 0x0, 0x15, 0x0, 0x47, - 0x50, 0x8, 0xba, 0xac, 0x90, 0x30, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+89AA "親" */ - 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x5, 0x80, 0x6, 0x55, 0x56, 0x80, 0x2, 0x65, - 0xa6, 0x89, 0x10, 0x3, 0x60, 0x0, 0x51, 0xb, - 0x9, 0x65, 0x57, 0x60, 0x0, 0x1a, 0x16, 0x9, - 0x10, 0x3, 0x60, 0x5, 0x56, 0x85, 0xa9, 0x65, - 0x57, 0x60, 0x0, 0x1, 0x80, 0x9, 0x10, 0x3, - 0x60, 0x2, 0x56, 0xb6, 0x69, 0x65, 0x57, 0x60, - 0x0, 0x1, 0x80, 0x8, 0x47, 0xa2, 0x40, 0x0, - 0xa4, 0x95, 0x0, 0x55, 0xa0, 0x0, 0x2, 0x81, - 0x86, 0x80, 0x82, 0xa0, 0x20, 0x7, 0x1, 0x80, - 0x71, 0x90, 0xa0, 0x40, 0x1, 0x4c, 0x50, 0x26, - 0x0, 0x7a, 0xc4, 0x0, 0x0, 0x0, 0x20, 0x0, - 0x0, 0x0, - - /* U+89BA "覺" */ - 0x0, 0x0, 0x20, 0x2, 0x0, 0x0, 0x0, 0x0, - 0x86, 0x71, 0x6a, 0x36, 0x98, 0x0, 0x0, 0xa4, - 0x63, 0x47, 0x14, 0x94, 0x0, 0x0, 0x92, 0x31, - 0x4a, 0x12, 0xa2, 0x0, 0x0, 0x87, 0x43, 0x7a, - 0x16, 0xd0, 0x0, 0x9, 0x76, 0x55, 0x55, 0x55, - 0x97, 0xb0, 0x58, 0x8, 0x55, 0x55, 0x5a, 0x25, - 0x0, 0x0, 0xa, 0x55, 0x55, 0x5b, 0x0, 0x0, - 0x0, 0xa, 0x33, 0x33, 0x3b, 0x0, 0x0, 0x0, - 0xa, 0x11, 0x11, 0x1a, 0x10, 0x0, 0x0, 0x8, - 0x5c, 0x5c, 0x58, 0x0, 0x30, 0x0, 0x0, 0x56, - 0xa, 0x0, 0x0, 0x60, 0x0, 0x36, 0x50, 0x8, - 0xa9, 0x9a, 0xd0, 0x3, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+89C0 "觀" */ - 0x0, 0x10, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x93, 0x56, 0x6, 0x55, 0x57, 0x60, 0x6, 0xb6, - 0x99, 0x99, 0x10, 0x5, 0x50, 0x1, 0x53, 0x42, - 0x28, 0x65, 0x58, 0x50, 0xa, 0x5b, 0xa5, 0xb8, - 0x10, 0x5, 0x50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, 0xa3, 0x7, 0x6, 0x3, 0x0, - 0x64, 0x0, 0xa3, 0x0, 0x0, 0x0, 0x0, 0x10, - 0x0, 0x0, - - /* U+8B70 "議" */ - 0x0, 0x10, 0x0, 0x3, 0x0, 0x52, 0x0, 0x0, - 0xa3, 0x0, 0x4, 0x90, 0xb2, 0x0, 0x25, 0x98, - 0x93, 0x65, 0x98, 0x68, 0x70, 0x1, 0x0, 0x0, - 0x1, 0x46, 0x15, 0x0, 0x5, 0x56, 0x60, 0x25, - 0x78, 0x44, 0x0, 0x0, 0x0, 0x2, 0x65, 0x78, - 0x56, 0xb0, 0x5, 0x56, 0x70, 0x3, 0x77, 0x25, - 0x0, 0x0, 0x0, 0x1, 0x6c, 0x39, 0x6, 0x30, - 0x9, 0x55, 0xc4, 0x5c, 0x5b, 0x65, 0xb2, 0xa, - 0x0, 0xa0, 0xa, 0x26, 0x46, 0x20, 0xa, 0x0, - 0xa5, 0x9d, 0x22, 0xc9, 0x0, 0xb, 0x55, 0xa3, - 0xa, 0x5, 0xd4, 0x21, 0x6, 0x0, 0x51, 0x7c, - 0x54, 0xa, 0xc1, 0x0, 0x0, 0x0, 0x1, 0x0, - 0x0, 0x31, - - /* U+8B77 "護" */ - 0x0, 0x20, 0x0, 0x3, 0x10, 0x40, 0x0, 0x0, - 0xa4, 0x0, 0x7, 0x40, 0xb0, 0x40, 0x25, 0x99, - 0x87, 0x5a, 0x95, 0xc5, 0x52, 0x1, 0x0, 0x0, - 0x66, 0x1b, 0x20, 0x10, 0x5, 0x55, 0x80, 0xd5, - 0x5c, 0x57, 0x80, 0x0, 0x0, 0x6, 0xd4, 0x4c, - 0x58, 0x20, 0x5, 0x55, 0x73, 0xa5, 0x5c, 0x58, - 0x20, 0x0, 0x0, 0x0, 0xa1, 0x1a, 0x11, 0x80, - 0xb, 0x55, 0xc0, 0x74, 0x44, 0x47, 0x41, 0xa, - 0x0, 0xa1, 0x68, 0x55, 0x8d, 0x0, 0xa, 0x0, - 0xa0, 0x3, 0x53, 0xa1, 0x0, 0xb, 0x55, 0xa0, - 0x1, 0xbc, 0x10, 0x0, 0x3, 0x0, 0x33, 0x55, - 0x1, 0x9a, 0x92, - - /* U+8B8A "變" */ - 0x0, 0x0, 0x0, 0x40, 0x0, 0x1, 0x0, 0x0, - 0x85, 0x0, 0x44, 0x30, 0x2a, 0x0, 0x4, 0x77, - 0x36, 0x55, 0x82, 0x85, 0x70, 0x9, 0x8a, 0x14, - 0x66, 0x86, 0x9c, 0x30, 0x5, 0x96, 0x74, 0x33, - 0x51, 0x96, 0x80, 0x4, 0x86, 0x96, 0x75, 0xb0, - 0xa7, 0x82, 0x6, 0x44, 0x96, 0x75, 0x91, 0x57, - 0x71, 0x6, 0x15, 0x53, 0x10, 0x35, 0x15, 0x22, - 0x0, 0x3, 0xf6, 0x55, 0x56, 0x7a, 0x0, 0x0, - 0x2a, 0x33, 0x0, 0x49, 0x0, 0x0, 0x0, 0x40, - 0x4, 0x65, 0x90, 0x0, 0x0, 0x0, 0x0, 0x4, - 0xbc, 0x40, 0x0, 0x0, 0x2, 0x46, 0x74, 0x0, - 0x5a, 0xbb, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+8B93 "讓" */ - 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x1, - 0x80, 0x0, 0x0, 0x57, 0x0, 0x20, 0x0, 0x75, - 0x34, 0x55, 0x57, 0x55, 0x91, 0x26, 0x55, 0x50, - 0x84, 0x95, 0x54, 0x80, 0x5, 0x55, 0x50, 0xb5, - 0xa6, 0x75, 0x90, 0x0, 0x0, 0x0, 0x34, 0x32, - 0x50, 0x20, 0x4, 0x57, 0x53, 0x6a, 0x65, 0xc6, - 0xa0, 0x0, 0x0, 0x0, 0x8, 0x10, 0x91, 0x40, - 0x8, 0x55, 0x90, 0x6a, 0x65, 0xb5, 0x60, 0x9, - 0x0, 0x95, 0x59, 0x96, 0x86, 0x92, 0x9, 0x0, - 0x90, 0x1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, 0xb, - 0x55, 0x5b, 0x63, 0x9, 0x80, 0x0, 0x1, 0xb1, - 0x91, 0x80, 0x1b, 0xa0, 0x0, 0x6, 0x60, 0x57, - 0x60, 0x91, 0x5b, 0x10, 0x17, 0x0, 0x5, 0x25, - 0x0, 0x7, 0xa0, 0x20, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+8CAC "責" */ - 0x0, 0x0, 0x1, 0x20, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x2b, 0x0, 0x7, 0x0, 0x6, 0x55, 0x56, - 0xb5, 0x56, 0x52, 0x0, 0x6, 0x55, 0x6b, 0x55, - 0x85, 0x0, 0x11, 0x11, 0x13, 0xa1, 0x11, 0x2a, - 0x4, 0x47, 0x44, 0x44, 0x44, 0x75, 0x41, 0x0, - 0xc5, 0x55, 0x55, 0x59, 0x60, 0x0, 0xc, 0x44, - 0x44, 0x44, 0x95, 0x0, 0x0, 0xc5, 0x55, 0x55, - 0x59, 0x50, 0x0, 0xc, 0x0, 0x0, 0x0, 0x75, - 0x0, 0x0, 0xb5, 0x75, 0x55, 0x59, 0x40, 0x0, - 0x0, 0x8c, 0x10, 0x48, 0x82, 0x0, 0x5, 0x94, - 0x0, 0x0, 0x3, 0xd3, 0x2, 0x10, 0x0, 0x0, - 0x0, 0x1, 0x0, - - /* U+8CB7 "買" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0x55, - 0x85, 0x58, 0x55, 0xc0, 0xc, 0x0, 0xb0, 0xb, - 0x1, 0xa0, 0xc, 0x0, 0xb0, 0xb, 0x1, 0xa0, - 0x9, 0x55, 0x55, 0x55, 0x55, 0x70, 0x0, 0x95, - 0x55, 0x55, 0x5c, 0x0, 0x0, 0xc0, 0x0, 0x0, - 0xc, 0x0, 0x0, 0xc5, 0x55, 0x55, 0x5c, 0x0, - 0x0, 0xc5, 0x55, 0x55, 0x5c, 0x0, 0x0, 0xc0, - 0x0, 0x0, 0xc, 0x0, 0x0, 0xb5, 0x75, 0x55, - 0x59, 0x0, 0x0, 0x1b, 0x90, 0x3, 0x78, 0x20, - 0x6, 0x82, 0x0, 0x0, 0x3, 0xd0, 0x20, 0x0, - 0x0, 0x0, 0x0, 0x0, - - /* U+8CB8 "貸" */ - 0x0, 0x0, 0x11, 0x1, 0x11, 0x0, 0x0, 0x0, - 0xc, 0x60, 0xc0, 0xa5, 0x0, 0x0, 0x1c, 0x40, - 0xa, 0x12, 0x39, 0x20, 0x48, 0x93, 0x55, 0x7a, - 0x43, 0x32, 0x11, 0x8, 0x20, 0x0, 0x86, 0x0, - 0x50, 0x0, 0x71, 0x0, 0x0, 0x7b, 0x78, 0x0, - 0xb, 0x55, 0x55, 0x55, 0xd5, 0x50, 0x0, 0xc5, - 0x55, 0x55, 0x5c, 0x0, 0x0, 0xc, 0x0, 0x0, - 0x0, 0xc0, 0x0, 0x0, 0xc5, 0x55, 0x55, 0x5c, - 0x0, 0x0, 0xc, 0x55, 0x55, 0x55, 0xc0, 0x0, - 0x0, 0x19, 0xa0, 0x2, 0x78, 0x20, 0x0, 0x59, - 0x30, 0x0, 0x0, 0x4d, 0x0, 0x20, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+8CBB "費" */ - 0x0, 0x0, 0x20, 0x2, 0x0, 0x0, 0x0, 0x0, - 0xa1, 0xc, 0x3, 0x0, 0x4, 0x55, 0xc5, 0x5c, - 0x5c, 0x20, 0x5, 0x95, 0xc5, 0x5c, 0x5a, 0x0, - 0x9, 0x95, 0xc5, 0x5c, 0x55, 0x69, 0x0, 0x8, - 0x20, 0xa, 0x3, 0x84, 0x14, 0x95, 0x44, 0x49, - 0x48, 0x60, 0x0, 0xb1, 0x11, 0x11, 0x1c, 0x0, - 0x0, 0xb5, 0x55, 0x55, 0x5b, 0x0, 0x0, 0xb5, - 0x55, 0x55, 0x5b, 0x0, 0x0, 0xb5, 0x55, 0x55, - 0x5b, 0x0, 0x0, 0x49, 0x50, 0x4, 0x78, 0x0, - 0x5, 0x94, 0x0, 0x0, 0x5, 0xd1, 0x21, 0x0, - 0x0, 0x0, 0x0, 0x20, - - /* U+8CBF "貿" */ - 0x0, 0x0, 0x60, 0x0, 0x0, 0x0, 0x5, 0x58, - 0x63, 0x55, 0x55, 0x93, 0xb, 0x1, 0x50, 0x1c, - 0x0, 0xb0, 0xb, 0x0, 0xa5, 0x29, 0x0, 0xc0, - 0xc, 0x87, 0x23, 0xa1, 0x58, 0x90, 0x5, 0x10, - 0x16, 0x10, 0x7, 0x10, 0x0, 0x95, 0x55, 0x55, - 0x5d, 0x10, 0x0, 0xb5, 0x55, 0x55, 0x5c, 0x0, - 0x0, 0xb0, 0x0, 0x0, 0xc, 0x0, 0x0, 0xb5, - 0x55, 0x55, 0x5d, 0x0, 0x0, 0xb5, 0x65, 0x55, - 0x5c, 0x0, 0x0, 0x17, 0xc0, 0x2, 0x78, 0x10, - 0x4, 0x84, 0x0, 0x0, 0x4, 0xd0, 0x21, 0x0, - 0x0, 0x0, 0x0, 0x0, - - /* U+8CC3 "賃" */ - 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5b, - 0x23, 0x68, 0x9b, 0x70, 0x3, 0xc0, 0x11, 0x1b, - 0x0, 0x0, 0x37, 0xb3, 0x65, 0x5c, 0x55, 0x86, - 0x20, 0xb0, 0x0, 0xb, 0x0, 0x20, 0x0, 0x70, - 0x36, 0x57, 0x57, 0x70, 0x0, 0x95, 0x55, 0x55, - 0x5d, 0x0, 0x0, 0xb5, 0x55, 0x55, 0x5b, 0x0, - 0x0, 0xb0, 0x0, 0x0, 0xb, 0x0, 0x0, 0xb5, - 0x55, 0x55, 0x5c, 0x0, 0x0, 0xb5, 0x55, 0x55, - 0x5b, 0x0, 0x0, 0x16, 0xb0, 0x2, 0x67, 0x10, - 0x3, 0x95, 0x0, 0x0, 0x3, 0xd1, 0x11, 0x0, - 0x0, 0x0, 0x0, 0x0, - - /* U+8CC7 "資" */ - 0x0, 0x0, 0x4, 0x10, 0x0, 0x0, 0x8, 0x50, - 0x1c, 0x10, 0x0, 0x10, 0x0, 0x46, 0x3a, 0x56, - 0x57, 0xb0, 0x0, 0x80, 0x90, 0x3d, 0x5, 0x0, - 0x3e, 0x12, 0x10, 0xb4, 0x70, 0x0, 0xc, 0x0, - 0x9, 0x50, 0x6a, 0x41, 0xa, 0x34, 0x72, 0x11, - 0x19, 0x94, 0x0, 0xc3, 0x33, 0x33, 0x3d, 0x0, - 0x0, 0xc5, 0x55, 0x55, 0x5c, 0x0, 0x0, 0xc5, - 0x55, 0x55, 0x5c, 0x0, 0x0, 0xc5, 0x55, 0x55, - 0x5c, 0x0, 0x0, 0x3a, 0x80, 0x2, 0x78, 0x0, - 0x5, 0x94, 0x0, 0x0, 0x5, 0xd0, 0x21, 0x0, - 0x0, 0x0, 0x0, 0x10, - - /* U+8CEA "質" */ - 0x0, 0x0, 0x1, 0x0, 0x0, 0x20, 0x0, 0x7, - 0x58, 0xa2, 0x66, 0x8a, 0x30, 0x0, 0xb0, 0x2, - 0xc, 0x0, 0x3, 0x0, 0xc, 0x5b, 0x63, 0xd5, - 0x97, 0x60, 0x4, 0x70, 0xb0, 0x37, 0x8, 0x30, - 0x0, 0x90, 0xa, 0x19, 0x0, 0x83, 0x0, 0x40, - 0x55, 0x68, 0x55, 0x5a, 0x10, 0x0, 0x8, 0x40, - 0x0, 0x0, 0xc0, 0x0, 0x0, 0x87, 0x55, 0x55, - 0x5d, 0x0, 0x0, 0x8, 0x75, 0x55, 0x55, 0xd0, - 0x0, 0x0, 0x87, 0x55, 0x55, 0x5d, 0x0, 0x0, - 0x2, 0x3b, 0x10, 0x26, 0x60, 0x0, 0x1, 0x77, - 0x10, 0x0, 0x6, 0xd0, 0x0, 0x30, 0x0, 0x0, - 0x0, 0x2, 0x0, - - /* U+8CFD "賽" */ - 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, - 0x10, 0x0, 0x39, 0x0, 0x1, 0x0, 0x0, 0xa5, - 0x59, 0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0x97, 0x17, - 0x37, 0x0, 0x36, 0xa6, 0x83, 0x78, 0x55, 0x96, - 0xa0, 0x0, 0xa0, 0x5, 0x49, 0x0, 0xa0, 0x0, - 0x3, 0xb6, 0x49, 0xa, 0x0, 0xa1, 0x20, 0x3, - 0xa1, 0x29, 0xa, 0x26, 0xc6, 0x50, 0x0, 0x90, - 0x81, 0xa, 0x0, 0xa0, 0x0, 0x6, 0x34, 0x43, - 0xb7, 0x0, 0xa0, 0x0, 0x25, 0x24, 0x0, 0x20, - 0x0, 0xb0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x30, 0x0, - - /* U+8FB2 "農" */ - 0x0, 0x0, 0x16, 0x0, 0x60, 0x0, 0x0, 0x5, - 0x56, 0xc5, 0x5d, 0x58, 0x20, 0x0, 0x92, 0x1a, - 0x0, 0xb0, 0xa1, 0x0, 0x9, 0x66, 0xc5, 0x5c, - 0x5c, 0x0, 0x0, 0x92, 0x1a, 0x0, 0xb0, 0xa1, - 0x0, 0x7, 0x55, 0x65, 0x56, 0x59, 0x10, 0x0, - 0x85, 0x55, 0x55, 0x55, 0x87, 0x0, 0x9, 0x33, - 0x33, 0x33, 0x62, 0x0, 0x0, 0x93, 0x21, 0x11, - 0x11, 0x15, 0x0, 0xb, 0x5b, 0x57, 0x65, 0x58, - 0x61, 0x0, 0xb0, 0xa0, 0x7, 0x18, 0x70, 0x0, - 0x55, 0xa, 0x1, 0x3a, 0xa0, 0x0, 0x17, 0x0, - 0xda, 0x60, 0x6, 0xdb, 0x52, 0x0, 0x2, 0x0, - 0x0, 0x0, 0x30, - - /* U+8FBA "辺" */ - 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x86, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x1e, - 0x6, 0x57, 0x75, 0x5c, 0x60, 0x0, 0x0, 0x0, - 0x8, 0x30, 0xa, 0x10, 0x0, 0x6, 0x0, 0xa, - 0x10, 0xa, 0x0, 0x6, 0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0, 0x0, 0x1, 0x0, 0x5, 0xbd, - 0xde, 0xef, 0xa1, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+9055 "違" */ - 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x4, - 0x90, 0x0, 0xc, 0x10, 0x40, 0x0, 0x0, 0xb5, - 0x6, 0x8a, 0x55, 0xc0, 0x0, 0x0, 0x20, 0x22, - 0x77, 0x22, 0xb4, 0x70, 0x0, 0x20, 0x35, 0x22, - 0x22, 0x43, 0x20, 0x46, 0xc5, 0x9, 0x65, 0x55, - 0xb4, 0x0, 0x0, 0x92, 0x9, 0x65, 0x75, 0xb1, - 0x0, 0x0, 0x92, 0x2, 0x0, 0xa0, 0x34, 0x0, - 0x0, 0x92, 0x4a, 0x55, 0xc5, 0x54, 0x0, 0x0, - 0x92, 0x4c, 0x55, 0xc5, 0x57, 0x80, 0x5, 0xc6, - 0x11, 0x0, 0xb0, 0x0, 0x0, 0x8b, 0x5, 0x81, - 0x0, 0x90, 0x0, 0x0, 0x10, 0x0, 0x3a, 0xcb, - 0xbc, 0xde, 0xa1, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x1, 0x0, - - /* U+9060 "遠" */ - 0x0, 0x0, 0x0, 0x0, 0x41, 0x0, 0x0, 0x0, - 0x74, 0x0, 0x0, 0xb2, 0x2, 0x0, 0x0, 0xe, - 0x1, 0x75, 0xc5, 0x59, 0x10, 0x0, 0x3, 0x0, - 0x0, 0xb0, 0x0, 0x60, 0x0, 0x0, 0x26, 0x65, - 0x55, 0x57, 0x51, 0x16, 0x6c, 0x0, 0xc4, 0x44, - 0x4d, 0x0, 0x0, 0x19, 0x0, 0xc5, 0x55, 0x5b, - 0x0, 0x0, 0x19, 0x0, 0x77, 0xb0, 0x6, 0x0, - 0x0, 0x19, 0x0, 0x78, 0xa4, 0x58, 0x20, 0x0, - 0x19, 0x27, 0x31, 0x90, 0x79, 0x10, 0x1, 0x8b, - 0x10, 0x2, 0x90, 0x3, 0x90, 0x1d, 0x40, 0x94, - 0x1, 0x60, 0x0, 0x0, 0x2, 0x0, 0x5, 0xab, - 0xcc, 0xdd, 0xd4, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+9069 "適" */ - 0x0, 0x0, 0x0, 0x1, 0x20, 0x0, 0x0, 0x0, - 0x91, 0x0, 0x0, 0xb0, 0x0, 0x0, 0x0, 0x5a, - 0x6, 0x55, 0x65, 0x58, 0x80, 0x0, 0x2, 0x0, - 0x46, 0x6, 0x50, 0x0, 0x0, 0x2, 0x6, 0x5a, - 0x5a, 0x58, 0x30, 0x16, 0x6d, 0xa, 0x0, 0xa2, - 0x9, 0x20, 0x0, 0x19, 0xa, 0x26, 0xc5, 0x89, - 0x10, 0x0, 0x19, 0xa, 0x2, 0xa1, 0x19, 0x10, - 0x0, 0x19, 0xa, 0xc, 0x59, 0x59, 0x10, 0x0, - 0x19, 0xa, 0xc, 0x59, 0x49, 0x10, 0x0, 0x7b, - 0xb, 0x5, 0x3, 0x3a, 0x10, 0x1d, 0x41, 0x94, - 0x0, 0x0, 0x39, 0x0, 0x2, 0x0, 0x7, 0xbb, - 0xcc, 0xcd, 0xa2, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+9078 "選" */ - 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x95, 0x7, 0x59, 0x48, 0x5a, 0x20, 0x0, 0x1d, - 0x9, 0x9, 0x19, 0x9, 0x0, 0x0, 0x0, 0x9, - 0x57, 0x39, 0x57, 0x30, 0x0, 0x2, 0x8, 0x65, - 0x98, 0x65, 0x90, 0x16, 0x6d, 0x0, 0x3a, 0x11, - 0x72, 0x0, 0x0, 0x19, 0x4, 0x5c, 0x57, 0xb8, - 0x50, 0x0, 0x19, 0x1, 0x9, 0x2, 0x70, 0x0, - 0x0, 0x19, 0x35, 0x5b, 0x56, 0x95, 0xa1, 0x0, - 0x19, 0x0, 0xa, 0x23, 0x61, 0x0, 0x1, 0xac, - 0x3, 0x93, 0x0, 0x1c, 0x30, 0x1e, 0x41, 0xa6, - 0x0, 0x0, 0x1, 0x10, 0x3, 0x0, 0x6, 0xaa, - 0xbb, 0xbc, 0xa2, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x11, 0x0, - - /* U+907F "避" */ - 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x3, - 0x60, 0x32, 0x25, 0x2, 0xa0, 0x0, 0x0, 0xa4, - 0x94, 0x3c, 0x65, 0x86, 0x70, 0x0, 0x10, 0x91, - 0xa, 0x31, 0xa, 0x0, 0x0, 0x0, 0x96, 0x5b, - 0xb, 0x26, 0x0, 0x46, 0xa5, 0x90, 0x3, 0x57, - 0x95, 0xa0, 0x0, 0x92, 0xa4, 0x25, 0x10, 0xa0, - 0x0, 0x0, 0x92, 0x8c, 0x3b, 0x0, 0xa0, 0x30, - 0x0, 0x93, 0x6b, 0xa, 0x55, 0xc5, 0x40, 0x0, - 0x97, 0xb, 0xa, 0x0, 0xa0, 0x0, 0x1, 0x94, - 0xc, 0x5a, 0x0, 0xb0, 0x0, 0x3b, 0x4, 0x72, - 0x0, 0x0, 0x50, 0x0, 0x1, 0x0, 0x18, 0xbc, - 0xcc, 0xde, 0x81, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+9084 "還" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, - 0xa0, 0xa, 0x58, 0x58, 0x5b, 0x30, 0x0, 0x97, - 0xb, 0xa, 0xa, 0x9, 0x0, 0x0, 0x11, 0xc, - 0x59, 0x59, 0x5b, 0x10, 0x0, 0x10, 0x57, 0x55, - 0x55, 0x56, 0xb0, 0x36, 0xb5, 0x4, 0x55, 0x55, - 0x58, 0x0, 0x0, 0x92, 0x7, 0x30, 0x0, 0xb, - 0x0, 0x0, 0x92, 0x7, 0x7c, 0x55, 0x59, 0x0, - 0x0, 0x92, 0x0, 0xb6, 0x42, 0x96, 0x0, 0x0, - 0x92, 0x29, 0x94, 0x2a, 0x60, 0x0, 0x1, 0xb5, - 0x40, 0x79, 0x72, 0x8a, 0x0, 0x3c, 0x15, 0x71, - 0x35, 0x0, 0x2, 0x0, 0x43, 0x0, 0x29, 0xbc, - 0xcc, 0xcd, 0x92, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+908A "邊" */ - 0x0, 0x0, 0x0, 0x0, 0x23, 0x0, 0x0, 0x0, - 0x71, 0x0, 0x55, 0xb7, 0x58, 0x0, 0x0, 0x3d, - 0x0, 0xb5, 0x55, 0x5b, 0x0, 0x0, 0x7, 0x0, - 0xa5, 0x55, 0x5b, 0x0, 0x0, 0x0, 0x0, 0xb5, - 0x55, 0x5c, 0x0, 0x14, 0x5a, 0x2, 0x30, 0x55, - 0x2, 0x30, 0x1, 0x1a, 0x2a, 0x5a, 0x77, 0x85, - 0xb1, 0x0, 0x19, 0x12, 0x54, 0x45, 0x35, 0x30, - 0x0, 0x19, 0x6, 0x58, 0x75, 0x57, 0x70, 0x0, - 0x19, 0x0, 0xb, 0x55, 0x5d, 0x10, 0x1, 0x9b, - 0x11, 0x92, 0x3, 0x58, 0x0, 0x1d, 0x31, 0xaa, - 0x10, 0x1, 0x91, 0x0, 0x2, 0x0, 0x6, 0xbc, - 0xdd, 0xde, 0xc3, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+90A3 "那" */ - 0x2, 0x55, 0x55, 0x93, 0x75, 0x56, 0x70, 0x0, - 0x11, 0xa0, 0xa1, 0xb0, 0x7, 0x70, 0x0, 0x1, - 0xa0, 0xa1, 0xb0, 0xa, 0x0, 0x1, 0x55, 0xc5, - 0xc1, 0xb0, 0x25, 0x0, 0x0, 0x11, 0xa0, 0xa1, - 0xb0, 0x50, 0x0, 0x0, 0x2, 0x90, 0xa1, 0xb0, - 0x7, 0x0, 0x2, 0x67, 0xa5, 0xc1, 0xb0, 0x5, -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b, 0x53, 0x6, 0x9d, - 0x0, 0x1, 0x92, 0xb, 0x30, 0x0, 0xb, 0x0, - 0x4, 0xe0, 0xc, 0x55, 0x55, 0x5c, 0x0, 0x0, - 0xb0, 0xb, 0x0, 0x0, 0xb, 0x0, 0x0, 0xe0, - 0xd, 0x55, 0x55, 0x5c, 0x0, 0x0, 0x80, 0xb, - 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+9154 "酔" */ - 0x0, 0x0, 0x0, 0x0, 0x32, 0x0, 0x0, 0x15, - 0x55, 0x55, 0x90, 0x85, 0x0, 0x0, 0x1, 0x54, - 0x90, 0x4, 0xa7, 0x58, 0x0, 0x1, 0x54, 0x92, - 0x1, 0x91, 0xa, 0x0, 0xa, 0x88, 0xba, 0x50, - 0xa0, 0xa, 0x10, 0x9, 0x53, 0x97, 0x24, 0x60, - 0x9, 0x50, 0x9, 0x71, 0x97, 0x46, 0x8, 0x4a, - 0xa3, 0x9, 0x70, 0xac, 0x40, 0xc, 0x10, 0x0, - 0xa, 0x0, 0x7, 0x43, 0x3c, 0x43, 0x80, 0xa, - 0x55, 0x5a, 0x43, 0x2c, 0x32, 0x20, 0x9, 0x0, - 0x7, 0x20, 0xb, 0x10, 0x0, 0xa, 0x55, 0x5a, - 0x30, 0xc, 0x10, 0x0, 0xa, 0x0, 0x7, 0x20, - 0xc, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, - - /* U+9178 "酸" */ - 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x15, - 0x55, 0x56, 0x80, 0x3a, 0x11, 0x0, 0x1, 0x36, - 0x90, 0x2, 0x70, 0x8, 0x40, 0x1, 0x36, 0x91, - 0x2c, 0x86, 0x55, 0xd0, 0xa, 0x79, 0xbb, 0x32, - 0x51, 0x33, 0x30, 0xa, 0x45, 0x99, 0x13, 0xa1, - 0x7, 0xb0, 0xa, 0x53, 0x99, 0x45, 0x57, 0x0, - 0x81, 0xa, 0x70, 0x9c, 0x10, 0xc6, 0x5b, 0x30, - 0xa, 0x20, 0x9, 0x16, 0x70, 0x1b, 0x0, 0xa, - 0x55, 0x5b, 0x44, 0x51, 0xa3, 0x0, 0xa, 0x0, - 0x9, 0x20, 0xc, 0x70, 0x0, 0xa, 0x55, 0x5b, - 0x10, 0x59, 0xa1, 0x0, 0xb, 0x0, 0x8, 0x27, - 0x50, 0x3d, 0x92, 0x3, 0x0, 0x1, 0x40, 0x0, - 0x1, 0x50, - - /* U+91AB "醫" */ - 0x0, 0x0, 0x0, 0x10, 0x0, 0x10, 0x0, 0x0, - 0xb5, 0x85, 0x82, 0x95, 0xb3, 0x0, 0x0, 0xa6, - 0x96, 0x80, 0x90, 0x86, 0x30, 0x0, 0xa4, 0x27, - 0x34, 0x30, 0x16, 0x20, 0x0, 0xa5, 0xaa, 0x52, - 0x75, 0xb7, 0x0, 0x0, 0xa3, 0x51, 0x61, 0x29, - 0xb1, 0x0, 0x2, 0xa6, 0x55, 0x57, 0x53, 0x29, - 0x10, 0x5, 0x55, 0x55, 0x95, 0x95, 0x55, 0x91, - 0x0, 0x17, 0x55, 0xc5, 0xc5, 0x76, 0x0, 0x0, - 0x1a, 0x5, 0x50, 0xa0, 0x55, 0x0, 0x0, 0x1a, - 0x44, 0x0, 0x57, 0xa5, 0x0, 0x0, 0x1b, 0x55, - 0x55, 0x55, 0x85, 0x0, 0x0, 0x1b, 0x55, 0x55, - 0x55, 0x85, 0x0, 0x0, 0x15, 0x0, 0x0, 0x0, - 0x22, 0x0, - - /* U+91CD "重" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, - 0x0, 0x23, 0x57, 0x9b, 0x90, 0x0, 0x0, 0x23, - 0x22, 0xb1, 0x0, 0x2, 0x0, 0x5, 0x65, 0x55, - 0xc5, 0x55, 0x5a, 0x40, 0x0, 0x2, 0x0, 0xa1, - 0x0, 0x40, 0x0, 0x0, 0xd, 0x55, 0xc5, 0x55, - 0xc0, 0x0, 0x0, 0xd, 0x55, 0xc5, 0x55, 0xb0, - 0x0, 0x0, 0xc, 0x0, 0xa1, 0x0, 0xb0, 0x0, - 0x0, 0xd, 0x55, 0xc5, 0x55, 0xc0, 0x0, 0x0, - 0x4, 0x0, 0xa1, 0x0, 0x50, 0x0, 0x0, 0x65, - 0x55, 0xc5, 0x55, 0x86, 0x0, 0x0, 0x0, 0x0, - 0xa1, 0x0, 0x1, 0x40, 0x26, 0x55, 0x55, 0x85, - 0x55, 0x57, 0x91, - - /* U+91CE "野" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x95, - 0x75, 0x5b, 0x45, 0x55, 0xd2, 0xb, 0x9, 0x10, - 0xb0, 0x0, 0x75, 0x0, 0xb0, 0x91, 0xb, 0x5, - 0x93, 0x0, 0xb, 0x5b, 0x65, 0xb0, 0x9, 0x60, - 0x0, 0xb0, 0x91, 0xb, 0x65, 0x86, 0x89, 0xb, - 0x5b, 0x65, 0xb0, 0xa, 0x8, 0x0, 0x40, 0x91, - 0x2, 0x0, 0xa1, 0x10, 0x1, 0x19, 0x10, 0x70, - 0xa, 0x0, 0x0, 0x54, 0xb6, 0x55, 0x0, 0xa0, - 0x0, 0x0, 0x9, 0x10, 0x11, 0xa, 0x0, 0x1, - 0x46, 0xb7, 0x53, 0x0, 0xa0, 0x0, 0x59, 0x30, - 0x0, 0x3, 0x9e, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x20, 0x0, - - /* U+91CF "量" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, - 0xb, 0x55, 0x55, 0x55, 0xd0, 0x0, 0x0, 0xb, - 0x55, 0x55, 0x55, 0xb0, 0x0, 0x0, 0xb, 0x55, - 0x55, 0x55, 0xb0, 0x0, 0x0, 0x8, 0x0, 0x0, - 0x0, 0x40, 0x50, 0x17, 0x55, 0x55, 0x55, 0x55, - 0x55, 0x72, 0x0, 0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, 0x0, 0x10, - 0x0, 0x0, 0x0, - - /* U+969B "際" */ - 0x0, 0x0, 0x1, 0x10, 0x0, 0x0, 0x7, 0x55, - 0xa1, 0x86, 0x24, 0x0, 0x20, 0xb0, 0x3a, 0xb, - 0x5c, 0x85, 0x97, 0xb, 0x8, 0x17, 0x75, 0xa3, - 0x38, 0x0, 0xb1, 0x53, 0x75, 0x93, 0xb, 0x20, - 0xb, 0x6, 0x0, 0x57, 0x0, 0x3c, 0x40, 0xb0, - 0x45, 0x35, 0x55, 0x58, 0x58, 0x1b, 0x0, 0xc1, - 0x1, 0x0, 0x0, 0x0, 0xb3, 0x5b, 0x26, 0x55, - 0x75, 0x77, 0xb, 0x8, 0x10, 0x13, 0xb, 0x20, - 0x0, 0xb0, 0x0, 0xb, 0x60, 0xb1, 0xa2, 0xb, - 0x0, 0x17, 0x20, 0xb, 0x2, 0xe0, 0xb0, 0x3, - 0x0, 0x6d, 0x80, 0x3, 0x1, 0x0, 0x0, 0x0, - 0x20, 0x0, 0x0, - - /* U+969C "障" */ - 0x0, 0x0, 0x0, 0x11, 0x0, 0x0, 0x6, 0x45, - 0x70, 0x0, 0xc0, 0x1, 0x0, 0xc0, 0x77, 0x17, - 0x57, 0x57, 0x90, 0xb, 0x9, 0x0, 0x19, 0x4, - 0xa0, 0x0, 0xb0, 0x61, 0x33, 0xa3, 0x83, 0x49, - 0xb, 0x5, 0x3, 0x42, 0x22, 0x25, 0x20, 0xb0, - 0x54, 0xc, 0x55, 0x55, 0xd1, 0xb, 0x0, 0xc0, - 0xc5, 0x55, 0x5c, 0x0, 0xb0, 0xe, 0xb, 0x0, - 0x0, 0xb0, 0xb, 0x5d, 0x80, 0xa5, 0xc5, 0x59, - 0x0, 0xb0, 0x12, 0x65, 0x5c, 0x55, 0x5b, 0x1b, - 0x0, 0x0, 0x0, 0xb0, 0x0, 0x0, 0xc0, 0x0, - 0x0, 0xc, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x30, 0x0, 0x0, - - /* U+96A3 "隣" */ - 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x7, 0x56, - 0x80, 0x71, 0x94, 0xa, 0x0, 0xb0, 0x74, 0x2, - 0x89, 0x27, 0x40, 0xb, 0x8, 0x4, 0x66, 0xc8, - 0x85, 0x70, 0xb3, 0x10, 0x2, 0xaa, 0x65, 0x0, - 0xb, 0x14, 0x5, 0x60, 0x92, 0x5c, 0x70, 0xb0, - 0x74, 0x14, 0x6, 0x10, 0x31, 0xb, 0x3, 0x86, - 0x92, 0x10, 0x19, 0x20, 0xb5, 0x97, 0xa5, 0xc4, - 0x86, 0xb5, 0xb, 0x6, 0x78, 0x1b, 0x3b, 0x19, - 0x0, 0xb0, 0x0, 0x49, 0x37, 0x65, 0xb7, 0x1b, - 0x0, 0x4, 0x70, 0x0, 0x19, 0x0, 0xb0, 0x4, - 0x50, 0x0, 0x1, 0x90, 0x1, 0x0, 0x0, 0x0, - 0x0, 0x1, 0x0, - - /* U+96A8 "隨" */ - 0x0, 0x0, 0x0, 0x0, 0x30, 0x0, 0x8, 0x5a, - 0x40, 0x0, 0xd, 0x0, 0x20, 0xa0, 0xb2, 0x64, - 0x69, 0x95, 0x55, 0xa, 0x35, 0xb, 0x3, 0xb5, - 0x78, 0x30, 0xa5, 0x0, 0x13, 0x62, 0x3a, 0x27, - 0xa, 0x33, 0x2, 0x2, 0x42, 0x24, 0x20, 0xa0, - 0x95, 0xb5, 0xb, 0x55, 0xa3, 0xa, 0x8, 0x39, - 0x10, 0xc5, 0x5a, 0x10, 0xb7, 0xc1, 0x91, 0xa, - 0x0, 0x81, 0xa, 0x33, 0x9, 0x10, 0xc5, 0x5a, - 0x10, 0xa0, 0x0, 0x91, 0xa, 0x4, 0xa1, 0xa, - 0x0, 0x83, 0x65, 0x30, 0x17, 0x0, 0xa0, 0x26, - 0x0, 0x4a, 0xdc, 0xdb, 0x20, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+96BB "隻" */ - 0x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0x55, 0x51, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, 0x0, - - /* U+96D9 "雙" */ - 0x0, 0x0, 0x20, 0x0, 0x3, 0x0, 0x0, 0x0, - 0x67, 0x92, 0x5, 0x87, 0x50, 0x0, 0x0, 0xd5, - 0x67, 0x69, 0x68, 0x69, 0x20, 0x7, 0xb0, 0xa0, - 0xf, 0xa, 0x1, 0x0, 0x13, 0xc5, 0xc7, 0x6b, - 0x5c, 0x57, 0x0, 0x0, 0xa0, 0xa2, 0x1a, 0xa, - 0x3, 0x0, 0x0, 0xc5, 0xc5, 0x2a, 0x5c, 0x55, - 0x0, 0x0, 0xc5, 0x95, 0x6b, 0x5b, 0x58, 0x30, - 0x0, 0x40, 0x0, 0x3, 0x0, 0x30, 0x0, 0x0, - 0x66, 0x95, 0x55, 0x5d, 0x80, 0x0, 0x0, 0x0, - 0x26, 0x2, 0xa3, 0x0, 0x0, 0x0, 0x0, 0x1, - 0xcd, 0x20, 0x0, 0x0, 0x0, 0x15, 0x65, 0x12, - 0x8a, 0x98, 0x72, 0x4, 0x30, 0x0, 0x0, 0x0, - 0x14, 0x30, - - /* U+96E2 "離" */ - 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x4, 0x80, 0x10, 0x84, 0x70, 0x0, 0x6, 0x56, - 0x85, 0x91, 0xa0, 0x83, 0x0, 0x4, 0x34, 0x85, - 0x30, 0xc5, 0x66, 0x90, 0x7, 0x26, 0xb1, 0x95, - 0xb0, 0xb0, 0x0, 0x7, 0x51, 0x52, 0x95, 0xb0, - 0xb0, 0x0, 0x8, 0x57, 0x85, 0x80, 0xc5, 0xc6, - 0x60, 0x3, 0x19, 0x51, 0x60, 0xb0, 0xb0, 0x0, - 0xa, 0x3a, 0x53, 0xc0, 0xb0, 0xb0, 0x20, 0xa, - 0x65, 0x75, 0xa0, 0xd5, 0xc5, 0x40, 0xa, 0x54, - 0x13, 0xa0, 0xb0, 0xb0, 0x0, 0xa, 0x0, 0x0, - 0xa0, 0xb0, 0xb0, 0x40, 0xa, 0x0, 0x3b, 0x80, - 0xd5, 0x55, 0x50, 0x2, 0x0, 0x0, 0x0, 0x10, - 0x0, 0x0, - - /* U+96E3 "難" */ - 0x0, 0x10, 0x0, 0x0, 0x40, 0x10, 0x0, 0x0, - 0xa0, 0x74, 0x3, 0xe1, 0x93, 0x0, 0x15, 0xb5, - 0x97, 0x87, 0x60, 0x35, 0x20, 0x1, 0x90, 0x73, - 0xb, 0x65, 0xa6, 0x80, 0x0, 0x8a, 0x82, 0x2e, - 0x20, 0xb0, 0x0, 0x6, 0x5c, 0x5a, 0x69, 0x20, - 0xb0, 0x0, 0x9, 0x1a, 0xa, 0x9, 0x65, 0xc6, - 0x40, 0x8, 0x5c, 0x58, 0x9, 0x20, 0xb0, 0x0, - 0x4, 0x5c, 0x58, 0x19, 0x30, 0xb2, 0x20, 0x15, - 0x5c, 0x56, 0x79, 0x64, 0xc4, 0x20, 0x1, 0x9, - 0x11, 0x9, 0x20, 0xb0, 0x0, 0x0, 0x83, 0xa, - 0x49, 0x20, 0xb0, 0x40, 0x6, 0x30, 0x1, 0x49, - 0x65, 0x65, 0x60, 0x10, 0x0, 0x0, 0x1, 0x0, - 0x0, 0x0, - - /* U+96E8 "雨" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x44, 0x45, 0x55, - 0x5c, 0x55, 0x55, 0x54, 0x0, 0x0, 0xb, 0x0, - 0x0, 0x20, 0xc, 0x55, 0x5c, 0x55, 0x55, 0xe0, - 0xc, 0x26, 0xb, 0x6, 0x0, 0xc0, 0xc, 0x8, - 0x7b, 0x4, 0xb0, 0xc0, 0xc, 0x0, 0x2b, 0x0, - 0x30, 0xc0, 0xc, 0x33, 0xb, 0x3, 0x0, 0xc0, - 0xc, 0xb, 0x4b, 0x6, 0xa0, 0xc0, 0xc, 0x1, - 0x2b, 0x0, 0x50, 0xc0, 0xc, 0x0, 0xb, 0x0, - 0x45, 0xb0, 0xa, 0x0, 0x7, 0x0, 0x1b, 0x60, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - - /* U+96EA "雪" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, - 0x46, 0x55, 0x65, 0x55, 0xc4, 0x0, 0x0, 0x0, - 0x0, 0x73, 0x0, 0x0, 0x10, 0x4, 0x75, 0x55, - 0xa7, 0x55, 0x58, 0xb0, 0xb, 0x35, 0x53, 0x73, - 0x45, 0x44, 0x0, 0x3, 0x0, 0x0, 0x74, 0x0, - 0x0, 0x0, 0x0, 0x5, 0x53, 0x84, 0x45, 0x50, - 0x0, 0x0, 0x0, 0x0, 0x30, 0x0, 0x40, 0x0, - 0x0, 0x46, 0x55, 0x55, 0x55, 0xc2, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0xb0, 0x0, 0x0, 0x16, - 0x55, 0x55, 0x55, 0xc0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xb0, 0x0, 0x0, 0x65, 0x55, 0x55, - 0x55, 0xd1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x20, 0x0, - - /* U+96F2 "雲" */ - 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x7, - 0x55, 0x77, 0x55, 0x83, 0x0, 0x3, 0x0, 0x5, - 0x60, 0x0, 0x12, 0x2, 0xa5, 0x55, 0x89, 0x55, - 0x59, 0xb0, 0x93, 0x55, 0x35, 0x63, 0x54, 0x50, - 0x0, 0x0, 0x0, 0x57, 0x0, 0x0, 0x0, 0x0, - 0x55, 0x34, 0x44, 0x54, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x70, 0x0, 0x1, 0x65, 0x55, 0x55, - 0x55, 0x20, 0x3, 0x65, 0x55, 0x65, 0x55, 0x58, - 0x80, 0x0, 0x0, 0xa8, 0x2, 0x20, 0x0, 0x0, - 0x5, 0x71, 0x0, 0x6, 0xa1, 0x0, 0x6, 0xeb, - 0x98, 0x65, 0x57, 0x90, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x1, 0x0, - - /* U+96FB "電" */ - 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x6, - 0x55, 0x59, 0x55, 0x91, 0x0, 0x7, 0x55, 0x56, - 0xc5, 0x55, 0x69, 0x3, 0x90, 0x0, 0x1a, 0x0, - 0x5, 0x60, 0x32, 0x45, 0x42, 0xa3, 0x55, 0x30, - 0x0, 0x4, 0x54, 0x29, 0x35, 0x50, 0x0, 0x0, - 0x20, 0x0, 0x0, 0x3, 0x0, 0x0, 0xc, 0x55, - 0x6b, 0x55, 0xc3, 0x0, 0x0, 0xc5, 0x56, 0xc5, - 0x5c, 0x0, 0x0, 0xb, 0x0, 0x1a, 0x0, 0xb0, - 0x0, 0x0, 0xc5, 0x56, 0xc5, 0x5c, 0x3, 0x0, - 0x5, 0x0, 0x1a, 0x0, 0x30, 0x70, 0x0, 0x0, - 0x0, 0xe9, 0x99, 0x9d, 0x10, - - /* U+9700 "需" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, - 0x36, 0x55, 0x77, 0x55, 0x85, 0x0, 0x1, 0x65, - 0x55, 0x99, 0x55, 0x56, 0x80, 0x8, 0x40, 0x0, - 0x66, 0x0, 0x6, 0x50, 0x4, 0x4, 0x52, 0x66, - 0x45, 0x31, 0x0, 0x0, 0x5, 0x52, 0x66, 0x45, - 0x30, 0x0, 0x3, 0x55, 0x55, 0x55, 0x55, 0x5b, - 0x40, 0x1, 0x0, 0x3, 0x80, 0x0, 0x0, 0x0, - 0x0, 0x85, 0x59, 0x55, 0x75, 0x5b, 0x0, 0x0, - 0xb1, 0xb, 0x0, 0xb0, 0x1a, 0x0, 0x0, 0xb1, - 0xb, 0x0, 0xb0, 0x1a, 0x0, 0x0, 0xb1, 0xb, - 0x0, 0xb0, 0x1a, 0x0, 0x0, 0xb0, 0x7, 0x0, - 0x52, 0xb8, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, - 0x10, 0x0, - - /* U+9707 "震" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, - 0x26, 0x55, 0x95, 0x56, 0x80, 0x0, 0x0, 0x85, - 0x55, 0xc5, 0x55, 0x59, 0x40, 0x8, 0x50, 0x0, - 0xb0, 0x0, 0x9, 0x10, 0x3, 0x5, 0x52, 0xb0, - 0x55, 0x30, 0x0, 0x0, 0x24, 0x42, 0x80, 0x44, - 0x52, 0x0, 0x0, 0xb5, 0x55, 0x55, 0x55, 0x65, - 0x0, 0x0, 0xb0, 0x65, 0x55, 0x55, 0x90, 0x0, - 0x0, 0xc5, 0x55, 0x55, 0x55, 0x5a, 0x50, 0x0, - 0xb0, 0xb0, 0x42, 0x2, 0x80, 0x0, 0x0, 0xa0, - 0xb0, 0x8, 0x57, 0x20, 0x0, 0x6, 0x30, 0xb3, - 0x51, 0x99, 0x30, 0x0, 0x15, 0x0, 0xb6, 0x0, - 0x3, 0xaf, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+9752 "青" */ - 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xd, 0x0, 0x1, 0x20, 0x6, 0x55, 0x55, - 0xd5, 0x55, 0x88, 0x0, 0x4, 0x55, 0x5d, 0x55, - 0x6a, 0x0, 0x0, 0x10, 0x0, 0xc0, 0x0, 0x2, - 0x3, 0x65, 0x55, 0x59, 0x55, 0x55, 0x96, 0x0, - 0x7, 0x55, 0x55, 0x58, 0x20, 0x0, 0x0, 0xc0, - 0x0, 0x0, 0xb1, 0x0, 0x0, 0xc, 0x55, 0x55, - 0x5c, 0x10, 0x0, 0x0, 0xc0, 0x0, 0x0, 0xb1, - 0x0, 0x0, 0xc, 0x55, 0x55, 0x5c, 0x10, 0x0, - 0x0, 0xc0, 0x0, 0x0, 0xb0, 0x0, 0x0, 0xc, - 0x0, 0x3, 0xae, 0x0, 0x0, 0x0, 0x30, 0x0, - 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20, 0x0, 0x2, 0x90, 0x0, 0x0, 0xa, 0x65, - 0x55, 0x56, 0xa0, 0x0, 0x0, 0x9, 0x20, 0x0, - 0x2, 0x90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+97FF "響" */ - 0x0, 0x0, 0x0, 0x31, 0x0, 0x0, 0x0, 0x2, - 0xa0, 0x66, 0x76, 0x54, 0x71, 0x1, 0x71, 0x49, - 0x0, 0xa9, 0x18, 0x0, 0xa6, 0x93, 0xa5, 0x5a, - 0x95, 0x0, 0x2, 0x62, 0x9a, 0x57, 0x59, 0x8, - 0x0, 0x46, 0x93, 0xa6, 0x67, 0x94, 0xa1, 0x0, - 0x67, 0x4, 0x71, 0x18, 0x14, 0x0, 0x46, 0x55, - 0x57, 0x76, 0x5a, 0x0, 0x0, 0x0, 0x47, 0x2, - 0xa0, 0x1, 0x0, 0x65, 0x55, 0x65, 0x75, 0x55, - 0x91, 0x0, 0xa, 0x55, 0x55, 0x5b, 0x20, 0x0, - 0x0, 0xa5, 0x55, 0x55, 0xc0, 0x0, 0x0, 0xa, - 0x55, 0x55, 0x5c, 0x0, 0x0, 0x0, 0x20, 0x0, - 0x0, 0x20, 0x0, - - /* U+9803 "頃" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30, - 0x0, 0x46, 0x57, 0x55, 0xa3, 0xd, 0x0, 0x0, - 0x0, 0xb0, 0x0, 0x0, 0xb0, 0x0, 0x8, 0x67, - 0x55, 0xb0, 0xb, 0x0, 0x10, 0xb0, 0x0, 0xb, - 0x0, 0xc5, 0x65, 0xc, 0x55, 0x55, 0xb0, 0xb, - 0x0, 0x0, 0xb0, 0x0, 0xb, 0x0, 0xb0, 0x0, - 0xc, 0x55, 0x55, 0xb0, 0xb, 0x0, 0x20, 0xb0, - 0x0, 0xb, 0x0, 0xb2, 0x82, 0xd, 0x55, 0x55, - 0xb0, 0x1f, 0xa0, 0x0, 0x1a, 0x23, 0x20, 0x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x1, - 0x20, 0x80, 0xc, 0x55, 0x55, 0xb0, 0x0, 0x6a, - 0x20, 0x2, 0x82, 0x22, 0x10, 0x0, 0x9, 0x80, - 0x6, 0x80, 0x8, 0x60, 0x0, 0x0, 0x60, 0x54, - 0x0, 0x0, 0xd0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+982D "頭" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x4, 0x36, 0x55, 0x55, 0xb1, 0x16, 0x55, - 0x55, 0x20, 0xc, 0x0, 0x0, 0x2, 0x0, 0x4, - 0x6, 0x57, 0x44, 0x80, 0xa, 0x65, 0x5d, 0xc, - 0x0, 0x0, 0xb0, 0xa, 0x10, 0xb, 0xc, 0x55, - 0x55, 0xb0, 0xa, 0x55, 0x5b, 0xb, 0x0, 0x0, - 0xb0, 0x4, 0x0, 0x12, 0xb, 0x55, 0x55, 0xb0, - 0x3, 0x20, 0x67, 0xb, 0x0, 0x0, 0xb0, 0x0, - 0xc0, 0x90, 0xc, 0x55, 0x55, 0xb0, 0x0, 0x60, - 0x73, 0x12, 0x82, 0x13, 0x10, 0x2c, 0xa8, 0x41, - 0x6, 0x90, 0x6, 0x80, 0x2, 0x0, 0x0, 0x55, - 0x0, 0x0, 0xc2, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+983C "頼" */ - 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xb, 0x20, 0x36, 0x56, 0x55, 0xb1, 0x1, 0x1b, - 0x16, 0x10, 0xc, 0x10, 0x0, 0x5, 0x3b, 0x33, - 0x26, 0x59, 0x55, 0x90, 0x3, 0x1a, 0x14, 0xc, - 0x0, 0x0, 0xb0, 0xa, 0x4b, 0x4c, 0x1b, 0x55, - 0x55, 0xb0, 0xa, 0xa, 0xb, 0xb, 0x0, 0x0, - 0xb0, 0xa, 0x5d, 0x5c, 0xb, 0x55, 0x55, 0xb0, - 0x2, 0x5f, 0x41, 0xb, 0x0, 0x0, 0xb0, 0x0, - 0xab, 0x3b, 0xb, 0x55, 0x55, 0xb0, 0x6, 0x3a, - 0x6, 0x52, 0x83, 0x14, 0x10, 0x24, 0xa, 0x0, - 0x5, 0x90, 0x6, 0x90, 0x0, 0xa, 0x0, 0x45, - 0x0, 0x0, 0xb2, 0x0, 0x1, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+984C "題" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, - 0x75, 0x5b, 0x36, 0x55, 0x57, 0x90, 0x4, 0x50, - 0xa, 0x0, 0x9, 0x0, 0x0, 0x4, 0x85, 0x5a, - 0x7, 0x67, 0x5b, 0x0, 0x5, 0x51, 0x1a, 0xa, - 0x0, 0xa, 0x0, 0x4, 0x64, 0x46, 0xa, 0x55, - 0x5a, 0x0, 0x5, 0x55, 0x57, 0x7a, 0x55, 0x5a, - 0x0, 0x3, 0xa, 0x0, 0xa, 0x0, 0xa, 0x0, - 0x8, 0x3a, 0x3, 0x1a, 0x55, 0x58, 0x0, 0x9, - 0x1a, 0x55, 0x21, 0xc0, 0x44, 0x0, 0x9, 0x5a, - 0x0, 0x8, 0x20, 0xa, 0x40, 0x7, 0xb, 0x30, - 0x30, 0x0, 0x1, 0x20, 0x41, 0x0, 0x7b, 0xbb, - 0xcc, 0xde, 0x80, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+9854 "顔" */ - 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x8, 0x40, 0x36, 0x56, 0x55, 0xb1, 0x5, 0x66, - 0x79, 0x60, 0xc, 0x10, 0x0, 0x0, 0x71, 0x39, - 0x7, 0x59, 0x55, 0xa0, 0x1, 0x36, 0x60, 0x1c, - 0x0, 0x0, 0xa0, 0xa, 0x55, 0x66, 0x6b, 0x55, - 0x55, 0xa0, 0xa, 0x0, 0x2a, 0xb, 0x0, 0x0, - 0xa0, 0xa, 0x5, 0x71, 0xb, 0x55, 0x55, 0xa0, - 0xa, 0x20, 0x1b, 0x4b, 0x0, 0x0, 0xa0, 0x9, - 0x3, 0x82, 0xb, 0x55, 0x55, 0xa0, 0x8, 0x22, - 0x6, 0xb1, 0x93, 0x24, 0x0, 0x15, 0x1, 0x87, - 0x5, 0x90, 0x7, 0x80, 0x40, 0x45, 0x0, 0x45, - 0x0, 0x0, 0xc0, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+9858 "願" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6, - 0x55, 0x59, 0x76, 0x57, 0x55, 0xb1, 0xa, 0x0, - 0x90, 0x0, 0xc, 0x10, 0x0, 0xa, 0x23, 0x32, - 0x15, 0x48, 0x44, 0x90, 0xa, 0x58, 0x59, 0x4b, - 0x11, 0x11, 0xc0, 0xa, 0x57, 0x59, 0x2b, 0x55, - 0x55, 0xb0, 0xa, 0x54, 0x7, 0x2b, 0x0, 0x0, - 0xb0, 0xa, 0x57, 0x99, 0x2b, 0x55, 0x55, 0xb0, - 0x8, 0x10, 0xa0, 0xb, 0x0, 0x0, 0xb0, 0x7, - 0x85, 0xa6, 0x1b, 0x55, 0x55, 0xb0, 0x33, 0x70, - 0xa2, 0xa1, 0x83, 0x14, 0x10, 0x24, 0x22, 0xb0, - 0x54, 0x90, 0x6, 0x90, 0x0, 0xa, 0x70, 0x36, - 0x0, 0x0, 0xc1, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+985E "類" */ - 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, - 0x9, 0x35, 0x26, 0x56, 0x55, 0xb1, 0x2, 0xa9, - 0x2a, 0x0, 0xc, 0x20, 0x0, 0x0, 0x39, 0x73, - 0x45, 0x49, 0x44, 0x90, 0x26, 0xaf, 0xb6, 0x4b, - 0x10, 0x0, 0xb0, 0x3, 0x89, 0x3b, 0x3b, 0x55, - 0x55, 0xb0, 0x34, 0x9, 0x32, 0x3a, 0x0, 0x0, - 0xb0, 0x0, 0x6, 0x4b, 0xa, 0x55, 0x55, 0xb0, - 0x12, 0x29, 0x55, 0x6a, 0x0, 0x0, 0xb0, 0x14, - 0x3d, 0x33, 0x3b, 0x55, 0x55, 0xb0, 0x0, 0x2a, - 0x78, 0x1, 0x84, 0x14, 0x10, 0x0, 0xa1, 0x7, - 0x54, 0xa0, 0x6, 0x90, 0x6, 0x10, 0x0, 0x36, - 0x0, 0x0, 0xb1, 0x10, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+986F "顯" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6, - 0x55, 0x59, 0x56, 0x57, 0x58, 0x70, 0xa, 0x0, - 0xa, 0x0, 0xc, 0x0, 0x0, 0xa, 0x55, 0x5c, - 0x6, 0x68, 0x59, 0x30, 0xa, 0x55, 0x5a, 0xb, - 0x0, 0x9, 0x10, 0x2, 0x80, 0x17, 0xa, 0x55, - 0x5b, 0x10, 0x6, 0x34, 0x74, 0x5a, 0x0, 0x9, - 0x10, 0x28, 0x91, 0x8a, 0x1a, 0x55, 0x5b, 0x10, - 0x27, 0x54, 0x64, 0x4a, 0x0, 0x9, 0x10, 0x36, - 0x39, 0x63, 0x7a, 0x55, 0x5b, 0x10, 0x3, 0x31, - 0x54, 0x21, 0x92, 0x24, 0x0, 0x19, 0x37, 0xa2, - 0xa3, 0x90, 0x8, 0x60, 0x33, 0x2, 0x10, 0x36, - 0x0, 0x0, 0xc0, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+98A8 "風" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, - 0x86, 0x55, 0x55, 0x55, 0xd0, 0x0, 0x0, 0x82, - 0x0, 0x4, 0x92, 0xb0, 0x0, 0x0, 0x84, 0x57, - 0xd5, 0x20, 0xb0, 0x0, 0x0, 0x82, 0x0, 0x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0, 0xb0, 0x0, 0x0, 0x0, 0x84, 0x7, - 0x85, 0x95, 0x58, 0x60, 0x3, 0x41, 0xa0, 0x29, - 0x10, 0x9, 0x30, 0x13, 0x95, 0x7a, 0x44, 0x4a, - 0x7, 0x0, 0x0, 0xa0, 0xa, 0x20, 0x59, 0x11, - 0x0, 0x0, 0xc5, 0x5c, 0x0, 0x69, 0x0, 0x0, - 0x0, 0xc5, 0x5c, 0x0, 0x97, 0x0, 0x0, 0x0, - 0xa0, 0x42, 0x0, 0xb1, 0x60, 0x0, 0x0, 0xa0, - 0x5b, 0x3, 0x80, 0xa1, 0x0, 0x1, 0xe9, 0x18, - 0x8, 0x0, 0x3c, 0x10, 0x0, 0x50, 0x0, 0x50, - 0x0, 0x5, 0xc1, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+9928 "館" */ - 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, - 0x8, 0x70, 0x0, 0x7, 0x60, 0x0, 0x0, 0xc, - 0x74, 0x8, 0x56, 0xa5, 0x93, 0x0, 0x85, 0xa, - 0xb6, 0x0, 0x0, 0x90, 0x3, 0x53, 0x80, 0x23, - 0x11, 0x16, 0x10, 0x14, 0x85, 0x79, 0x19, 0x64, - 0x4c, 0x10, 0x0, 0xa0, 0xa, 0x9, 0x20, 0xb, - 0x0, 0x0, 0xb5, 0x5b, 0x9, 0x65, 0x59, 0x0, - 0x0, 0xa1, 0x1b, 0x9, 0x20, 0x2, 0x30, 0x0, - 0xb3, 0x65, 0x9, 0x65, 0x58, 0x80, 0x0, 0xa0, - 0x4a, 0x9, 0x20, 0x5, 0x50, 0x1, 0xd9, 0x4a, - 0x9, 0x65, 0x58, 0x60, 0x0, 0x80, 0x0, 0x9, - 0x20, 0x4, 0x30, 0x0, 0x0, 0x0, 0x1, 0x0, - 0x0, 0x0, - - /* U+9996 "首" */ - 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, - 0x0, 0x84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, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+9A12 "騒" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, - 0x85, 0x76, 0x74, 0x65, 0x56, 0xb0, 0x1, 0xa0, - 0xb0, 0x0, 0x51, 0x9, 0x40, 0x1, 0xb5, 0xc7, - 0x40, 0x9, 0x3a, 0x0, 0x1, 0xa0, 0xb0, 0x0, - 0x4, 0xf2, 0x0, 0x1, 0xb5, 0xc7, 0x40, 0x58, - 0x5c, 0x83, 0x1, 0xa0, 0xb0, 0x14, 0x20, 0xc0, - 0x51, 0x2, 0xb4, 0x74, 0xd6, 0x85, 0xc5, 0xc0, - 0x0, 0x1, 0x30, 0xb5, 0x60, 0xb0, 0xb0, 0x3, - 0x66, 0x85, 0xa5, 0x95, 0xc5, 0xc0, 0xa, 0x65, - 0x43, 0x82, 0x20, 0xb2, 0x30, 0x14, 0x0, 0x6, - 0x50, 0x0, 0xb3, 0xb2, 0x0, 0x3, 0x9c, 0x1c, - 0xb8, 0x63, 0x28, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+9A13 "験" */ - 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x1, - 0x85, 0x77, 0x50, 0x1e, 0x10, 0x0, 0x1, 0x90, - 0xb0, 0x0, 0x93, 0x70, 0x0, 0x1, 0xb5, 0xc7, - 0x24, 0x70, 0x2b, 0x51, 0x1, 0x90, 0xb0, 0x37, - 0x68, 0x6a, 0x82, 0x1, 0xb5, 0xc7, 0x20, 0xa, - 0x11, 0x0, 0x1, 0x90, 0xb0, 0x1b, 0x5c, 0x5b, - 0x40, 0x2, 0xa4, 0x66, 0x9b, 0xa, 0x19, 0x10, - 0x0, 0x1, 0x43, 0x7b, 0x5c, 0x5b, 0x10, 0x7, - 0x66, 0x88, 0x66, 0xb, 0x14, 0x0, 0x2b, 0x73, - 0x36, 0x40, 0x28, 0x70, 0x0, 0x11, 0x0, 0x9, - 0x21, 0xa0, 0x59, 0x0, 0x0, 0x2, 0xaa, 0x37, - 0x0, 0x6, 0xd3, 0x0, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+9A57 "驗" */ - 0x0, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x1, - 0x85, 0x68, 0x40, 0xd, 0x30, 0x0, 0x1, 0x90, - 0xa0, 0x0, 0x64, 0x80, 0x0, 0x1, 0xb5, 0xc8, - 0x12, 0x80, 0x2a, 0x10, 0x1, 0x90, 0xa0, 0x18, - 0x65, 0x5b, 0xc5, 0x1, 0xb5, 0xc7, 0x31, 0x1, - 0x10, 0x20, 0x1, 0x90, 0xa0, 0xc, 0x77, 0xb5, - 0xc0, 0x1, 0xb4, 0x77, 0x8a, 0x35, 0xa0, 0xa0, - 0x0, 0x20, 0x34, 0x5c, 0x76, 0xb5, 0xb0, 0x4, - 0x56, 0x4b, 0x56, 0x81, 0x46, 0x40, 0xa, 0x82, - 0x37, 0x44, 0x80, 0xc, 0x0, 0x14, 0x0, 0xa, - 0x19, 0x63, 0x48, 0x60, 0x0, 0x2, 0x9a, 0x53, - 0x8, 0x70, 0x81, 0x0, 0x0, 0x0, 0x10, 0x2, - 0x0, 0x0, - - /* U+9AD4 "體" */ - 0x0, 0x0, 0x0, 0x0, 0x11, 0x20, 0x0, 0x0, - 0x85, 0x5a, 0x0, 0x46, 0xb1, 0x0, 0x0, 0xa2, - 0x1a, 0x7, 0x89, 0xc6, 0xa0, 0x0, 0xca, 0x5a, - 0xb, 0x46, 0xa2, 0x90, 0x2, 0xa7, 0x3a, 0x1b, - 0x78, 0xc6, 0x90, 0xb, 0x66, 0x57, 0x9b, 0x78, - 0xc6, 0x90, 0x25, 0x85, 0x5b, 0x5, 0x0, 0x1, - 0x60, 0x0, 0xb0, 0xa, 0x26, 0x55, 0x56, 0x51, - 0x0, 0xc5, 0x5a, 0x7, 0x75, 0x5a, 0x60, 0x0, - 0xb0, 0xa, 0x6, 0x52, 0x28, 0x40, 0x0, 0xc5, - 0x5a, 0x5, 0x73, 0x59, 0x20, 0x0, 0xb0, 0xa, - 0x0, 0x83, 0x64, 0x0, 0x0, 0xb2, 0x99, 0x45, - 0x66, 0x95, 0xb2, 0x0, 0x20, 0x0, 0x10, 0x0, - 0x0, 0x0, - - /* U+9AD8 "高" */ - 0x0, 0x0, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xa2, 0x0, 0x0, 0x20, 0x55, 0x55, 0x55, - 0x55, 0x55, 0x69, 0x0, 0x3, 0x65, 0x55, 0x59, - 0x0, 0x0, 0x0, 0x46, 0x0, 0x0, 0xb0, 0x0, - 0x0, 0x4, 0x95, 0x55, 0x5c, 0x0, 0x0, 0x0, - 0x32, 0x0, 0x0, 0x50, 0x10, 0x0, 0xc5, 0x55, - 0x55, 0x55, 0x5d, 0x30, 0xb, 0x6, 0x55, 0x59, - 0x30, 0xc0, 0x0, 0xb0, 0x91, 0x0, 0x91, 0xc, - 0x0, 0xb, 0x9, 0x65, 0x5b, 0x20, 0xc0, 0x0, - 0xb0, 0x70, 0x0, 0x61, 0xc, 0x0, 0xb, 0x0, - 0x0, 0x0, 0x39, 0xd0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x2, 0x0, - - /* U+9AEA "髪" */ - 0x0, 0x20, 0x0, 0x30, 0x0, 0x20, 0x0, 0x0, - 0xa5, 0x55, 0x50, 0x5, 0xb3, 0x0, 0x0, 0xa5, - 0x56, 0x44, 0x73, 0x4, 0x0, 0x0, 0xa5, 0x56, - 0x50, 0x3, 0xa6, 0x0, 0x6, 0xa8, 0x55, 0x86, - 0x53, 0x3, 0x40, 0x0, 0x58, 0x16, 0x20, 0x3, - 0x98, 0x30, 0x6, 0xc7, 0x55, 0x84, 0x64, 0x0, - 0x0, 0x0, 0x0, 0xa, 0x40, 0x0, 0x7, 0x20, - 0x16, 0x55, 0x8b, 0x55, 0x55, 0x55, 0x30, 0x0, - 0x1, 0xb8, 0x55, 0x5d, 0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 0x73, 0xb, 0x10, 0x0, 0x60, - 0xa0, 0xa4, 0x1d, 0xc, 0x0, 0x5, 0x80, 0xa1, - 0x24, 0x13, 0x1c, 0x0, 0x6, 0x10, 0x10, 0x0, - 0x29, 0xe6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x30, 0x0, - - /* U+9E97 "麗" */ - 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x4, - 0x65, 0x56, 0x64, 0x65, 0x56, 0x40, 0x0, 0xb5, - 0x5c, 0x10, 0xb5, 0x5b, 0x0, 0x0, 0xb2, 0x5b, - 0x0, 0xb8, 0x1a, 0x0, 0x0, 0x90, 0x28, 0x56, - 0x92, 0xa, 0x0, 0x0, 0x96, 0x59, 0x56, 0x95, - 0x57, 0x50, 0x0, 0x96, 0x5b, 0x65, 0xb5, 0x58, - 0x10, 0x0, 0x92, 0x9, 0x10, 0x90, 0xa, 0x0, - 0x0, 0xa6, 0x86, 0x55, 0xa7, 0x59, 0x0, 0x0, - 0xc0, 0xa1, 0x2, 0x90, 0x18, 0x0, 0x0, 0xa0, - 0xa5, 0x55, 0x96, 0x74, 0x30, 0x2, 0x60, 0xa1, - 0x43, 0x90, 0x0, 0x60, 0x7, 0x0, 0xb9, 0x20, - 0x6b, 0xaa, 0xd1, 0x1, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+9EBC "麼" */ - 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x1, 0xc0, 0x0, 0x21, 0x0, 0xc5, 0x56, - 0x57, 0x56, 0x58, 0x60, 0xb, 0x0, 0xa1, 0x0, - 0xa2, 0x0, 0x0, 0xb5, 0x6d, 0x74, 0x6d, 0x67, - 0x40, 0xb, 0x4, 0xf6, 0x14, 0xf6, 0x10, 0x0, - 0xa2, 0x7a, 0x16, 0x7a, 0x1b, 0x60, 0xa, 0x40, - 0x81, 0x50, 0x60, 0x12, 0x0, 0x90, 0x3, 0x95, - 0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0, 0xc8, 0xe, 0xfe, 0xef, 0x10, 0x0, - 0x0, 0xcf, 0xef, 0xe0, 0x3f, 0xee, 0xee, 0xee, - 0xf8, 0xe, 0xf6, 0x8f, 0x76, 0x66, 0x66, 0xeb, - 0x6f, 0xf8, 0xaf, 0x10, 0x0, 0x0, 0xcc, 0x8f, - 0xe0, 0x3f, 0x10, 0x0, 0x0, 0xc8, 0xe, 0xfc, - 0xdf, 0x65, 0x55, 0x55, 0xee, 0xcf, 0xc2, 0x5f, - 0xff, 0xff, 0xff, 0xf9, 0x2c, - - /* U+F00B "" */ - 0x57, 0x75, 0x5, 0x77, 0x77, 0x77, 0x75, 0xff, - 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x2f, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xe, - 0xff, 0xff, 0xff, 0xfe, 0x1, 0x10, 0x0, 0x11, - 0x11, 0x11, 0x10, 0xef, 0xfe, 0xe, 0xff, 0xff, - 0xff, 0xfe, 0xff, 0xff, 0x2f, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, - 0x68, 0x87, 0x7, 0x88, 0x88, 0x88, 0x86, 0x68, - 0x87, 0x7, 0x88, 0x88, 0x88, 0x86, 0xff, 0xff, - 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, - 0xff, 0xff, 0xff, 0xff, 0xdf, 0xfd, 0xd, 0xff, - 0xff, 0xff, 0xfd, - - /* U+F00C "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x50, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x1d, 0xf8, 0x0, 0x0, - 0x0, 0x0, 0x1, 0xdf, 0xfd, 0x0, 0x0, 0x0, - 0x0, 0x1d, 0xff, 0xe2, 0x2d, 0x60, 0x0, 0x1, - 0xdf, 0xfe, 0x20, 0xdf, 0xf7, 0x0, 0x1d, 0xff, - 0xe2, 0x0, 0x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, 0xff, 0xff, 0xf1, 0x0, - 0x0, 0x6f, 0xff, 0xd7, 0x7f, 0xff, 0xf2, 0x0, - 0x0, 0x6f, 0xff, 0x90, 0xd, 0xff, 0xf2, 0x0, - 0x0, 0x6f, 0xff, 0x90, 0xd, 0xff, 0xf2, 0x0, - 0x0, 0x4f, 0xff, 0x70, 0xb, 0xff, 0xe1, 0x0, - - /* U+F019 "" */ - 0x0, 0x0, 0x0, 0x33, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xb, 0xff, 0xb0, 0x0, 0x0, 0x0, 0x0, - 0xc, 0xff, 0xc0, 0x0, 0x0, 0x0, 0x0, 0xc, - 0xff, 0xc0, 0x0, 0x0, 0x0, 0x0, 0xc, 0xff, - 0xc0, 0x0, 0x0, 0x0, 0x0, 0xc, 0xff, 0xc0, - 0x0, 0x0, 0x0, 0x8f, 0xff, 0xff, 0xff, 0xf8, - 0x0, 0x0, 0x2e, 0xff, 0xff, 0xff, 0xe2, 0x0, - 0x0, 0x2, 0xef, 0xff, 0xfe, 0x20, 0x0, 0x0, - 0x0, 0x2d, 0xff, 0xe2, 0x0, 0x0, 0x79, 0x99, - 0x82, 0xde, 0x28, 0x99, 0x97, 0xff, 0xff, 0xfb, - 0x22, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, - 0xb3, 0xcf, 0xac, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, - 0xca, - - /* U+F01C "" */ - 0x0, 0x6, 0xbb, 0xbb, 0xbb, 0xba, 0x30, 0x0, - 0x0, 0x4f, 0xff, 0xff, 0xff, 0xff, 0xe1, 0x0, - 0x0, 0xef, 0x30, 0x0, 0x0, 0x6, 0xfb, 0x0, - 0x9, 0xf8, 0x0, 0x0, 0x0, 0x0, 0xcf, 0x50, - 0x4f, 0xd0, 0x0, 0x0, 0x0, 0x0, 0x2f, 0xe1, - 0xdf, 0x84, 0x42, 0x0, 0x0, 0x34, 0x4b, 0xf9, - 0xff, 0xff, 0xfd, 0x0, 0x1, 0xff, 0xff, 0xfb, - 0xff, 0xff, 0xff, 0x98, 0x8b, 0xff, 0xff, 0xfc, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, - 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf6, - - /* U+F021 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x33, 0x0, - 0x1, 0x8d, 0xff, 0xc6, 0x0, 0xef, 0x0, 0x4e, - 0xff, 0xff, 0xff, 0xe4, 0xdf, 0x4, 0xff, 0xb3, - 0x0, 0x4c, 0xff, 0xff, 0xe, 0xf9, 0x0, 0x0, - 0x0, 0x8f, 0xff, 0x6f, 0xc0, 0x0, 0x1, 0xff, - 0xff, 0xff, 0x8e, 0x50, 0x0, 0x1, 0xde, 0xee, - 0xed, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x22, 0x22, 0x22, 0x0, 0x0, 0x0, 0x21, 0xff, - 0xff, 0xff, 0x10, 0x0, 0x8, 0xf8, 0xff, 0xfb, - 0xbc, 0x10, 0x0, 0x1e, 0xf4, 0xff, 0xfc, 0x10, - 0x0, 0x1, 0xdf, 0xc0, 0xfe, 0xef, 0xe8, 0x44, - 0x8e, 0xfe, 0x10, 0xfe, 0x1a, 0xff, 0xff, 0xff, - 0xc1, 0x0, 0xfd, 0x0, 0x28, 0xbb, 0x94, 0x0, - 0x0, - - /* U+F026 "" */ - 0x0, 0x0, 0x2, 0x70, 0x0, 0x2, 0xef, 0x0, - 0x2, 0xef, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x34, 0x47, 0xff, 0xf0, - 0x0, 0x5, 0xff, 0x0, 0x0, 0x5,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, 0x88, 0x88, 0x88, 0x88, 0x88, 0x73, 0xef, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0x32, - 0xdf, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x0, 0x7f, - 0xff, 0xfd, 0xff, 0xff, 0xfd, 0x10, 0xcf, 0xff, - 0xa0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x0, - 0x7, 0xff, 0xff, 0xf3, 0x5f, 0xa0, 0x0, 0x0, - 0xcf, 0xff, 0x30, 0x3, 0x0, 0x0, 0x0, 0xcf, - 0xfc, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcf, 0xff, - 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xff, 0xaf, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf9, - - /* U+F043 "" */ - 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x1, 0xfa, - 0x0, 0x0, 0x0, 0x6, 0xff, 0x10, 0x0, 0x0, - 0xd, 0xff, 0x70, 0x0, 0x0, 0x6f, 0xff, 0xf1, - 0x0, 0x1, 0xef, 0xff, 0xfa, 0x0, 0xb, 0xff, - 0xff, 0xff, 0x60, 0x5f, 0xff, 0xff, 0xff, 0xe0, - 0xcf, 0xff, 0xff, 0xff, 0xf6, 0xfe, 0xbf, 0xff, - 0xff, 0xf9, 0xfd, 0x4f, 0xff, 0xff, 0xf9, 0xbf, - 0x49, 0xff, 0xff, 0xf5, 0x3f, 0xe5, 0x2e, 0xff, - 0xd0, 0x6, 0xff, 0xff, 0xfd, 0x20, 0x0, 0x28, - 0xba, 0x60, 0x0, - - /* U+F048 "" */ - 0x4, 0x30, 0x0, 0x0, 0x31, 0x1f, 0xe0, 0x0, - 0x6, 0xf9, 0x1f, 0xe0, 0x0, 0x7f, 0xfa, 0x1f, - 0xe0, 0x9, 0xff, 0xfa, 0x1f, 0xe0, 0xaf, 0xff, - 0xfa, 0x1f, 0xeb, 0xff, 0xff, 0xfa, 0x1f, 0xff, - 0xff, 0xff, 0xfa, 0x1f, 0xff, 0xff, 0xff, 0xfa, - 0x1f, 0xe6, 0xff, 0xff, 0xfa, 0x1f, 0xe0, 0x5f, - 0xff, 0xfa, 0x1f, 0xe0, 0x4, 0xff, 0xfa, 0x1f, - 0xe0, 0x0, 0x3e, 0xfa, 0xf, 0xd0, 0x0, 0x2, - 0xd7, 0x0, 0x0, 0x0, 0x0, 0x0, - - /* U+F04B "" */ - 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0xfb, - 0x20, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0x90, - 0x0, 0x0, 0x0, 0xf, 0xff, 0xff, 0xe6, 0x0, - 0x0, 0x0, 0xff, 0xff, 0xff, 0xfc, 0x30, 0x0, - 0xf, 0xff, 0xff, 0xff, 0xff, 0x91, 0x0, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xe6, 0xf, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xf2, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xfd, 0xf, 0xff, 0xff, 0xff, 0xff, 0xf8, - 0x0, 0xff, 0xff, 0xff, 0xff, 0xb2, 0x0, 0xf, - 0xff, 0xff, 0xfd, 0x40, 0x0, 0x0, 0xff, 0xff, - 0xf7, 0x0, 0x0, 0x0, 0xf, 0xff, 0xa1, 0x0, - 0x0, 0x0, 0x0, 0x6a, 0x40, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+F04C "" */ - 0x14, 0x44, 0x20, 0x1, 0x44, 0x42, 0xd, 0xff, - 0xff, 0x10, 0xdf, 0xff, 0xf1, 0xff, 0xff, 0xf3, - 0xf, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x40, 0xff, - 0xff, 0xf4, 0xff, 0xff, 0xf4, 0xf, 0xff, 0xff, - 0x4f, 0xff, 0xff, 0x40, 0xff, 0xff, 0xf4, 0xff, - 0xff, 0xf4, 0xf, 0xff, 0xff, 0x4f, 0xff, 0xff, - 0x40, 0xff, 0xff, 0xf4, 0xff, 0xff, 0xf4, 0xf, - 0xff, 0xff, 0x4f, 0xff, 0xff, 0x40, 0xff, 0xff, - 0xf4, 0xff, 0xff, 0xf4, 0xf, 0xff, 0xff, 0x4f, - 0xff, 0xff, 0x30, 0xff, 0xff, 0xf3, 0x9f, 0xff, - 0xc0, 0x9, 0xff, 0xfc, 0x0, - - /* U+F04D "" */ - 0x14, 0x44, 0x44, 0x44, 0x44, 0x42, 0xd, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x4f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf4, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x4f, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xf4, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x4f, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x9f, 0xff, - 0xff, 0xff, 0xff, 0xfc, 0x0, - - /* U+F051 "" */ - 0x2, 0x10, 0x0, 0x0, 0x42, 0xf, 0xe2, 0x0, - 0x3, 0xfb, 0xf, 0xfe, 0x30, 0x4, 0xfb, 0xf, - 0xff, 0xf4, 0x4, 0xfb, 0xf, 0xff, 0xff, 0x54, - 0xfb, 0xf, 0xff, 0xff, 0xfa, 0xfb, 0xf, 0xff, - 0xff, 0xff, 0xfb, 0xf, 0xff, 0xff, 0xff, 0xfb, - 0xf, 0xff, 0xff, 0xd6, 0xfb, 0xf, 0xff, 0xfd, - 0x14, 0xfb, 0xf, 0xff, 0xc1, 0x4, 0xfb, 0xf, - 0xfb, 0x0, 0x4, 0xfb, 0xc, 0xa0, 0x0, 0x3, - 0xfa, 0x0, 0x0, 0x0, 0x0, 0x0, - - /* U+F052 "" */ - 0x0, 0x0, 0x0, 0x12, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x3, 0xff, 0x60, 0x0, 0x0, 0x0, 0x0, - 0x2e, 0xff, 0xf5, 0x0, 0x0, 0x0, 0x1, 0xef, - 0xff, 0xff, 0x40, 0x0, 0x0, 0x1d, 0xff, 0xff, - 0xff, 0xf3, 0x0, 0x0, 0xcf, 0xff, 0xff, 0xff, - 0xfe, 0x20, 0xa, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xe0, 0xe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf2, - 0x3, 0x99, 0x99, 0x99, 0x99, 0x99, 0x50, 0x5, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0xf, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf3, 0xf, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xf4, 0xb, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xd1, - - /* U+F053 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f, - 0x90, 0x0, 0x0, 0x3f, 0xfc, 0x0, 0x0, 0x3f, - 0xfd, 0x10, 0x0, 0x3f, 0xfd, 0x10, 0x0, 0x3f, - 0xfd, 0x10, 0x0, 0x1f, 0xfd, 0x10, 0x0, 0x0, - 0xcf, 0xf4, 0x0, 0x0, 0x0, 0xcf, 0xf4, 0x0, - 0x0, 0x0, 0xcf, 0xf4, 0x0, 0x0, 0x0, 0xcf, - 0xf4, 0x0, 0x0, 0x0, 0xcf, 0xe0, 0x0, 0x0, - 0x0, 0xa4, 0x0, - - /* U+F054 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0xcd, 0x10, 0x0, - 0x0, 0x1f, 0xfd, 0x10, 0x0, 0x0, 0x3f, 0xfd, - 0x10, 0x0, 0x0, 0x3f, 0xfd, 0x10, 0x0, 0x0, - 0x3f, 0xfd, 0x10, 0x0, 0x0, 0x3f, 0xfd, 0x0, - 0x0, 0x8, 0xff, 0x90, 0x0, 0x8, 0xff, 0x90, - 0x0, 0x8, 0xff, 0x90, 0x0, 0x8, 0xff, 0x90, - 0x0, 0x2, 0xff, 0x90, 0x0, 0x0, 0x7, 0x80, - 0x0, 0x0, 0x0, - - /* U+F067 "" */ - 0x0, 0x0, 0x4, 0x50, 0x0, 0x0, 0x0, 0x0, - 0x2, 0xff, 0x60, 0x0, 0x0, 0x0, 0x0, 0x3f, - 0xf7, 0x0, 0x0, 0x0, 0x0, 0x3, 0xff, 0x70, - 0x0, 0x0, 0x0, 0x0, 0x3f, 0xf7, 0x0, 0x0, - 0x6, 0x99, 0x9a, 0xff, 0xc9, 0x99, 0x80, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x3d, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xf2, 0x1, 0x11, 0x3f, 0xf7, - 0x11, 0x10, 0x0, 0x0, 0x3, 0xff, 0x70, 0x0, - 0x0, 0x0, 0x0, 0x3f, 0xf7, 0x0, 0x0, 0x0, - 0x0, 0x3, 0xff, 0x70, 0x0, 0x0, 0x0, 0x0, - 0xc, 0xd3, 0x0, 0x0, 0x0, - - /* U+F068 "" */ - 0x69, 0x99, 0x99, 0x99, 0x99, 0x98, 0xf, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf3, 0xdf, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x20, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+F06E "" */ - 0x0, 0x0, 0x1, 0x56, 0x64, 0x0, 0x0, 0x0, - 0x0, 0x3, 0xbf, 0xfe, 0xef, 0xf9, 0x10, 0x0, - 0x0, 0x7f, 0xfa, 0x10, 0x3, 0xdf, 0xe4, 0x0, - 0x8, 0xff, 0xa0, 0x9, 0xb4, 0x1e, 0xff, 0x50, - 0x4f, 0xff, 0x20, 0xb, 0xff, 0x26, 0xff, 0xe1, - 0xef, 0xff, 0x9, 0xcf, 0xff, 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1, 0x0, 0x0, 0x2f, - 0x90, 0x0, 0x0, 0x3, 0xa, 0xf1, 0x30, 0x0, - 0x2f, 0x90, 0x0, 0x0, 0x1f, 0xcb, 0xf8, 0xf8, - 0x0, 0x2f, 0xeb, 0xbb, 0xbb, 0x39, 0xff, 0xff, - 0xe2, 0x0, 0x1f, 0xff, 0xff, 0xff, 0xb0, 0x9f, - 0xfd, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x8, 0xd1, 0x0, - - /* U+F07B "" */ - 0x37, 0x88, 0x87, 0x0, 0x0, 0x0, 0x0, 0xef, - 0xff, 0xff, 0xa0, 0x0, 0x0, 0x0, 0xff, 0xff, - 0xff, 0xfd, 0xcc, 0xcc, 0xb6, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xaf, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf9, - - /* U+F093 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x1, 0xdd, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x1d, 0xff, 0xd1, 0x0, 0x0, 0x0, 0x1, 0xdf, - 0xff, 0xfd, 0x10, 0x0, 0x0, 0x1d, 0xff, 0xff, - 0xff, 0xd1, 0x0, 0x0, 0x9f, 0xff, 0xff, 0xff, - 0xf9, 0x0, 0x0, 0x1, 0x1c, 0xff, 0xc1, 0x10, - 0x0, 0x0, 0x0, 0xc, 0xff, 0xc0, 0x0, 0x0, - 0x0, 0x0, 0xc, 0xff, 0xc0, 0x0, 0x0, 0x0,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fa, 0x0, - 0x0, 0x8d, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, - 0x6, 0xff, 0xfd, 0x0, 0x0, 0x0, 0x48, 0xef, - 0xff, 0xf6, 0x0, 0x0, 0x6f, 0xff, 0xfb, 0xff, - 0xf6, 0x0, 0xe, 0xf3, 0xcf, 0x23, 0xff, 0xf6, - 0x0, 0xee, 0xa, 0xf2, 0x4, 0xff, 0xf6, 0x9, - 0xfe, 0xfc, 0x0, 0x4, 0xff, 0xf1, 0x8, 0xda, - 0x10, 0x0, 0x2, 0x62, 0x0, - - /* U+F0C5 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x6f, 0xff, 0xf9, 0x87, 0x0, 0x0, 0x8, 0xff, - 0xff, 0x98, 0xf7, 0x8, 0xa6, 0x8f, 0xff, 0xf9, - 0x59, 0x90, 0xff, 0xa8, 0xff, 0xff, 0xfc, 0xcc, - 0xf, 0xfa, 0x8f, 0xff, 0xff, 0xff, 0xf1, 0xff, - 0xa8, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfa, 0x8f, - 0xff, 0xff, 0xff, 0xf1, 0xff, 0xa8, 0xff, 0xff, - 0xff, 0xff, 0x1f, 0xfa, 0x8f, 0xff, 0xff, 0xff, - 0xf1, 0xff, 0xa8, 0xff, 0xff, 0xff, 0xff, 0x1f, - 0xfa, 0x7f, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xe3, - 0x12, 0x22, 0x22, 0x21, 0xf, 0xff, 0xff, 0xff, - 0xf9, 0x0, 0x0, 0xac, 0xcc, 0xcc, 0xcb, 0x50, - 0x0, 0x0, - - /* U+F0C7 "" */ - 0x49, 0x99, 0x99, 0x99, 0x95, 0x0, 0xe, 0xff, - 0xff, 0xff, 0xff, 0xf6, 0x0, 0xfd, 0x22, 0x22, - 0x22, 0x4f, 0xf6, 0xf, 0xc0, 0x0, 0x0, 0x1, - 0xff, 0xf3, 0xfc, 0x0, 0x0, 0x0, 0x1f, 0xff, - 0x6f, 0xc0, 0x0, 0x0, 0x2, 0xff, 0xf6, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xff, 0xff, - 0xdc, 0xff, 0xff, 0xf6, 0xff, 0xff, 0xb0, 0x5, - 0xff, 0xff, 0x6f, 0xff, 0xf6, 0x0, 0xf, 0xff, - 0xf6, 0xff, 0xff, 0xc0, 0x6, 0xff, 0xff, 0x6f, - 0xff, 0xff, 0xed, 0xff, 0xff, 0xf6, 0x9f, 0xff, - 0xff, 0xff, 0xff, 0xfd, 0x10, - - /* U+F0C9 "" */ - 0xcd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0x2f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf3, 0x12, 0x22, 0x22, - 0x22, 0x22, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xde, - 0xee, 0xee, 0xee, 0xee, 0xee, 0x20, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xd, 0xee, 0xee, 0xee, 0xee, 0xee, - 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x30, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - - /* U+F0E0 "" */ - 0x37, 0x88, 0x88, 0x88, 0x88, 0x88, 0x73, 0xef, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xef, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xfe, 0x1c, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xc1, 0xd2, 0x8f, 0xff, 0xff, - 0xff, 0xf8, 0x2d, 0xff, 0x64, 0xef, 0xff, 0xfe, - 0x45, 0xff, 0xff, 0xfa, 0x2b, 0xff, 0xb2, 0xaf, - 0xff, 0xff, 0xff, 0xd3, 0x55, 0x3d, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xbb, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xaf, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf9, - - /* U+F0E7 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xff, 0xff, - 0xf0, 0x0, 0x4, 0xff, 0xff, 0xd0, 0x0, 0x6, - 0xff, 0xff, 0x80, 0x0, 0x8, 0xff, 0xff, 0x30, - 0x0, 0xa, 0xff, 0xff, 0xaa, 0xa6, 0xc, 0xff, - 0xff, 0xff, 0xf8, 0xe, 0xff, 0xff, 0xff, 0xe1, - 0xb, 0xdd, 0xdf, 0xff, 0x60, 0x0, 0x0, 0x4f, - 0xfd, 0x0, 0x0, 0x0, 0x7f, 0xf3, 0x0, 0x0, - 0x0, 0xbf, 0xa0, 0x0, 0x0, 0x0, 0xff, 0x10, - 0x0, 0x0, 0x3, 0xf8, 0x0, 0x0, 0x0, 0x3, - 0xc0, 0x0, 0x0, - - /* U+F0EA "" */ - 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x4, 0x55, - 0xef, 0xb5, 0x52, 0x0, 0x0, 0xff, 0xfd, 0x1f, - 0xff, 0xb0, 0x0, 0xf, 0xff, 0xff, 0xff, 0xfc, - 0x0, 0x0, 0xff, 0xff, 0x53, 0x33, 0x20, 0x0, - 0xf, 0xff, 0x97, 0xff, 0xfb, 0x57, 0x0, 0xff, - 0xf8, 0xaf, 0xff, 0xc6, 0xf8, 0xf, 0xff, 0x8a, - 0xff, 0xfc, 0x4a, 0xa1, 0xff, 0xf8, 0xaf, 0xff, - 0xe3, 0x22, 0xf, 0xff, 0x8a, 0xff, 0xff, 0xff, - 0xf4, 0xff, 0xf8, 0xaf, 0xff, 0xff, 0xff, 0x4f, - 0xff, 0x8a, 0xff, 0xff, 0xff, 0xf4, 0x35, 0x52, - 0xaf, 0xff, 0xff, 0xff, 0x40, 0x0, 0xa, 0xff, - 0xff, 0xff, 0xf4, 0x0, 0x0, 0x7f, 0xff, 0xff, - 0xfe, 0x20, - - /* U+F0F3 "" */ - 0x0, 0x0, 0x1, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xaf, 0x0, 0x0, 0x0, 0x0, 0x1, 0x8f, - 0xfa, 0x30, 0x0, 0x0, 0x2, 0xef, 0xff, 0xff, - 0x50, 0x0, 0x0, 0xbf, 0xff, 0xff, 0xff, 0x10, - 0x0, 0x1f, 0xff, 0xff, 0xff, 0xf5, 0x0, 0x3, - 0xff, 0xff, 0xff, 0xff, 0x70, 0x0, 0x5f, 0xff, - 0xff, 0xff, 0xf9, 0x0, 0x8, 0xff, 0xff, 0xff, - 0xff, 0xc0, 0x0, 0xdf, 0xff, 0xff, 0xff, 0xff, - 0x20, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xe, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xf2, 0x2, 0x22, - 0x22, 0x22, 0x22, 0x21, 0x0, 0x0, 0x8, 0xff, - 0xc0, 0x0, 0x0, 0x0, 0x0, 0x9, 0xa2, 0x0, - 0x0, 0x0, - - /* U+F11C "" */ - 0x5b, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xa3, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, - 0xfc, 0xc, 0x30, 0xe1, 0x1d, 0xd, 0x11, 0xfc, - 0xfc, 0xb, 0x30, 0xe0, 0x1d, 0xd, 0x10, 0xfc, - 0xff, 0xfe, 0xff, 0xef, 0xfe, 0xfe, 0xef, 0xfc, - 0xff, 0xf1, 0x5a, 0x8, 0x70, 0xa0, 0x5f, 0xfc, - 0xff, 0xf3, 0x7b, 0x29, 0x92, 0xc2, 0x7f, 0xfc, - 0xff, 0xbf, 0xcb, 0xbb, 0xbb, 0xbf, 0xcb, 0xfc, - 0xfc, 0xb, 0x20, 0x0, 0x0, 0xd, 0x0, 0xfc, - 0xff, 0xcf, 0xcc, 0xcc, 0xcc, 0xcf, 0xcc, 0xfb, - 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf6, - - /* U+F124 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xdf, 0xb0, - 0x0, 0x0, 0x0, 0x0, 0x7, 0xef, 0xff, 0xd0, - 0x0, 0x0, 0x0, 0x18, 0xff, 0xff, 0xff, 0x70, - 0x0, 0x0, 0x29, 0xff, 0xff, 0xff, 0xff, 0x0, - 0x0, 0x3b, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x0, - 0xa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0x0, - 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa0, 0x0, - 0x4, 0x9a, 0xaa, 0xaf, 0xff, 0xff, 0x20, 0x0, - 0x0, 0x0, 0x0, 0xe, 0xff, 0xfb, 0x0, 0x0, - 0x0, 0x0, 0x0, 0xe, 0xff, 0xf4, 0x0, 0x0, - 0x0, 0x0, 0x0, 0xe, 0xff, 0xc0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0xe, 0xff, 0x50, 0x0, 0x0, - 0x0, 0x0, 0x0, 0xd, 0xfd, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x4, 0xb3, 0x0, 0x0, 0x0, - - /* U+F15B "" */ - 0x35, 0x55, 0x55, 0x2, 0x0, 0xf, 0xff, 0xff, - 0xf2, 0xf4, 0x0, 0xff, 0xff, 0xff, 0x2f, 0xf4, - 0xf, 0xff, 0xff, 0xf2, 0xff, 0xf3, 0xff, 0xff, - 0xff, 0x32, 0x22, 0x1f, 0xff, 0xff, 0xff, 0xff, - 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, - 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, - 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, - 0xff, 0xff, 0xff, 0xff, 0xf8, 0x8a, 0xaa, 0xaa, - 0xaa, 0xaa, 0x30, - - /* U+F1EB "" */ - 0x0, 0x0, 0x0, 0x24, 0x55, 0x31, 0x0, 0x0, - 0x0, 0x0, 0x3, 0xaf, 0xff, 0xff, 0xff, 0xc7, - 0x0, 0x0, 0x2, 0xbf, 0xff, 0xfe, 0xde, 0xff, - 0xff, 0xf6, 0x0, 0x5f, 0xff, 0xb5, 0x10, 0x0, - 0x3, 0x8e, 0xff, 0xb0, 0xdf, 0xd3, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x8f, 0xf5, 0x18, 0x0, 0x5, - 0xae, 0xfe, 0xc8, 0x10, 0x4, 0x60, 0x0, 0x2, - 0xdf, 0xff, 0xff, 0xff, 0xf8, 0x0, 0x0, 0x0, - 0xc, 0xff, 0x95, 0x34, 0x7d, 0xff, 0x40, 0x0, - 0x0, 0x2, 0xa2, 0x0, 0x0, 0x0, 0x77, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x2, 0x96, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0xd, 0xff, 0x50, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe, 0xff, - 0x60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, - 0xda, 0x0, 0x0, 0x0, 0x0, - - /* U+F240 "" */ - 0x5b, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, - 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x90, 0xfc, 0x12, 0x22, 0x22, 0x22, 0x22, - 0x22, 0xf, 0xf7, 0xfc, 0x5f, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x2c, 0xfa, 0xfc, 0x5f, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x21, 0xfa, 0xfc, 0x5f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x27, 0xfa, 0xfc, 0x26, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x1f, 0xfa, 0xfe, - 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbf, 0xb1, - 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+F241 "" */ - 0x5b, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, - 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x90, 0xfc, 0x12, 0x22, 0x22, 0x22, 0x21, - 0x0, 0xf, 0xf7, 0xfc, 0x5f, 0xff, 0xff, 0xff, - 0xf8, 0x0, 0xc, 0xfa, 0xfc, 0x5f, 0xff, 0xff, - 0xff, 0xf8, 0x0, 0x1, 0xfa, 0xfc, 0x5f, 0xff, - 0xff, 0xff, 0xf8, 0x0, 0x7, 0xfa, 0xfc, 0x26, - 0x66, 0x66, 0x66, 0x63, 0x0, 0xf, 0xfa, 0xfe, - 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbf, 0xb1, - 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - - /* U+F242 "" */ - 0x5b, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, - 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x90, 0xfc, 0x12, 0x22, 0x22, 0x10, 0x0, - 0x0, 0xf, 0xf7, 0xfc, 0x5f, 0xff, 0xff, 0xd0, - 0x0, 0x0, 0xc, 0xfa, 0xfc, 0x5f, 0xff, 0xff, - 0xd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50, 0x0, - 0x0, 0x0, 0x4, 0x39, 0xff, 0xfe, 0x0, 0x0, - 0x0, 0x4, 0xff, 0x39, 0xff, 0xa0, 0x0, 0x0, - 0x4, 0xff, 0xff, 0x39, 0xb0, 0x0, 0x0, 0x4, - 0xff, 0xff, 0xff, 0x20, 0x0, 0x0, 0x4, 0xff, - 0xff, 0xff, 0xb0, 0x0, 0x0, 0x4, 0xff, 0xff, - 0xff, 0xb0, 0x0, 0x0, 0x4, 0xff, 0xff, 0xff, - 0xb0, 0x0, 0x0, 0x4, 0xff, 0xff, 0xff, 0xb0, - 0x0, 0x0, 0x0, 0xbf, 0xff, 0xff, 0xb0, 0x0, - 0x0, 0x0, 0xd, 0xff, 0xff, 0xb0, 0x0, 0x0, - 0x0, 0x0, 0xff, 0xff, 0xb0, 0x0, 0x0, 0x0, - 0x0, 0x9, 0xa8, 0x60, 0x0, 0x0, 0x0, 0x0, - 0x0, - - /* U+F55A "" */ - 0x0, 0x0, 0x17, 0x88, 0x88, 0x88, 0x88, 0x87, - 0x40, 0x0, 0x2, 0xef, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xf4, 0x0, 0x3e, 0xff, 0xff, 0xcf, 0xff, - 0xcf, 0xff, 0xf7, 0x3, 0xef, 0xff, 0xf9, 0x8, - 0xf8, 0x9, 0xff, 0xf8, 0x3e, 0xff, 0xff, 0xfe, - 0x20, 0x40, 0x2e, 0xff, 0xf8, 0xdf, 0xff, 0xff, - 0xff, 0xe1, 0x1, 0xef, 0xff, 0xf8, 0x9f, 0xff, - 0xff, 0xff, 0x80, 0x0, 0x8f, 0xff, 0xf8, 0x9, - 0xff, 0xff, 0xf9, 0x2, 0xc2, 0x9, 0xff, 0xf8, - 0x0, 0x9f, 0xff, 0xfe, 0x4e, 0xfe, 0x4e, 0xff, - 0xf8, 0x0, 0x9, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xf7, 0x0, 0x0, 0x8f, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xc1, - - /* U+F7C2 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0xef, - 0xff, 0xff, 0xe2, 0x3, 0xfb, 0xfb, 0xce, 0xbf, - 0xa4, 0xff, 0x1d, 0x3, 0xa1, 0xfa, 0xff, 0xf1, - 0xd0, 0x3a, 0x1f, 0xaf, 0xff, 0xff, 0xff, 0xff, - 0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xaf, 0xff, - 0xff, 0xff, 0xff, 0xfa, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xfa, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xaf, 0xff, 0xff, 0xff, - 0xff, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xad, - 0xff, 0xff, 0xff, 0xff, 0xf8, 0x29, 0xaa, 0xaa, - 0xaa, 0xa8, 0x0, - - /* U+F8A2 "" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0xf1, 0x0, - 0x8, 0x20, 0x0, 0x0, 0x1, 0xff, 0x10, 0xb, - 0xf7, 0x0, 0x0, 0x0, 0x2f, 0xf1, 0xc, 0xff, - 0x94, 0x44, 0x44, 0x45, 0xff, 0x1b, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf1, 0x8f, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xfd, 0x0, 0x7f, 0xf7, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f, 0x60, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, - 0x0, 0x0, 0x0, - - /* U+FF08 "(" */ - 0x0, 0x0, 0x20, 0x0, 0x61, 0x0, 0x81, 0x0, - 0x46, 0x0, 0xb, 0x10, 0x0, 0xc0, 0x0, 0xc, - 0x0, 0x0, 0xb0, 0x0, 0x4, 0x60, 0x0, 0x8, - 0x20, 0x0, 0x6, 0x20, 0x0, 0x1, - - /* U+FF09 ")" */ - 0x30, 0x0, 0x1, 0x70, 0x0, 0x1, 0x90, 0x0, - 0x6, 0x60, 0x0, 0xc, 0x0, 0x0, 0xd0, 0x0, - 0xd, 0x0, 0x0, 0xc0, 0x0, 0x66, 0x0, 0x2a, - 0x0, 0x27, 0x0, 0x2, 0x0, 0x0, - - /* U+FF0C "," */ - 0x1, 0x0, 0xfc, 0x7, 0xb0, 0x63, 0x3, 0x0, - - /* U+FF11 "1" */ - 0x0, 0x23, 0x0, 0x5, 0xd6, 0x0, 0x0, 0x86, - 0x0, 0x0, 0x86, 0x0, 0x0, 0x86, 0x0, 0x0, - 0x86, 0x0, 0x0, 0x86, 0x0, 0x0, 0x86, 0x0, - 0x0, 0x96, 0x0, 0x14, 0x66, 0x40, - - /* U+FF12 "2" */ - 0x0, 0x0, 0x0, 0x7, 0x67, 0x91, 0x87, 0x0, - 0x99, 0x69, 0x0, 0x8b, 0x0, 0x0, 0xd5, 0x0, - 0x6, 0x80, 0x0, 0x39, 0x0, 0x2, 0x90, 0x0, - 0x19, 0x0, 0x3, 0xab, 0xaa, 0xb4, 0x12, 0x22, - 0x20 -}; - -/*--------------------- - * GLYPH DESCRIPTION - *--------------------*/ - -static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { - {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, - {.bitmap_index = 0, .adv_w = 112, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 0, .adv_w = 112, .box_w = 3, .box_h = 10, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 15, .adv_w = 112, .box_w = 6, .box_h = 4, .ofs_x = 0, .ofs_y = 8}, - {.bitmap_index = 27, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 62, .adv_w = 112, .box_w = 6, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104, .adv_w = 112, .box_w = 7, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 143, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 178, .adv_w = 112, .box_w = 3, .box_h = 4, .ofs_x = 0, .ofs_y = 8}, - {.bitmap_index = 184, .adv_w = 112, .box_w = 4, .box_h = 15, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 214, .adv_w = 112, .box_w = 4, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 244, .adv_w = 112, .box_w = 7, .box_h = 8, .ofs_x = 0, .ofs_y = 2}, - {.bitmap_index = 272, .adv_w = 112, .box_w = 7, .box_h = 9, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 304, .adv_w = 112, .box_w = 3, .box_h = 4, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 310, .adv_w = 112, .box_w = 7, .box_h = 1, .ofs_x = 0, .ofs_y = 5}, - {.bitmap_index = 314, .adv_w = 112, .box_w = 3, .box_h = 2, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 317, .adv_w = 112, .box_w = 7, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 366, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 401, .adv_w = 112, .box_w = 5, .box_h = 10, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 426, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 461, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 496, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 531, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 566, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 601, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 636, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 671, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 706, .adv_w = 112, .box_w = 3, .box_h = 7, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 717, .adv_w = 112, .box_w = 3, .box_h = 9, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 731, .adv_w = 112, .box_w = 7, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 770, .adv_w = 112, .box_w = 7, .box_h = 4, .ofs_x = 0, .ofs_y = 3}, - {.bitmap_index = 784, .adv_w = 112, .box_w = 7, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 823, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 858, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 893, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 928, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 963, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 998, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1033, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1068, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1103, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1138, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1173, .adv_w = 112, .box_w = 5, .box_h = 10, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1198, .adv_w = 112, .box_w = 7, .box_h = 12, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1240, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1275, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1310, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1345, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1380, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1415, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1450, .adv_w = 112, .box_w = 7, .box_h = 11, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 1489, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1524, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1559, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1594, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1629, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1664, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1699, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1734, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1769, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1804, .adv_w = 112, .box_w = 5, .box_h = 14, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 1839, .adv_w = 112, .box_w = 6, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 1878, .adv_w = 112, .box_w = 5, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 1913, .adv_w = 112, .box_w = 5, .box_h = 2, .ofs_x = 1, .ofs_y = 10}, - {.bitmap_index = 1918, .adv_w = 112, .box_w = 7, .box_h = 1, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1922, .adv_w = 112, .box_w = 3, .box_h = 2, .ofs_x = 1, .ofs_y = 10}, - {.bitmap_index = 1925, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1950, .adv_w = 112, .box_w = 7, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1989, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2014, .adv_w = 112, .box_w = 7, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2053, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2078, .adv_w = 112, .box_w = 7, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2113, .adv_w = 112, .box_w = 7, .box_h = 9, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 2145, .adv_w = 112, .box_w = 7, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2184, .adv_w = 112, .box_w = 5, .box_h = 10, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2209, .adv_w = 112, .box_w = 5, .box_h = 12, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 2239, .adv_w = 112, .box_w = 7, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2278, .adv_w = 112, .box_w = 5, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2306, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2331, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2356, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2381, .adv_w = 112, .box_w = 7, .box_h = 9, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 2413, .adv_w = 112, .box_w = 7, .box_h = 9, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 2445, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2470, .adv_w = 112, .box_w = 5, .box_h = 7, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 2488, .adv_w = 112, .box_w = 6, .box_h = 9, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2515, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2540, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2565, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2590, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2615, .adv_w = 112, .box_w = 7, .box_h = 9, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 2647, .adv_w = 112, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2672, .adv_w = 112, .box_w = 4, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 2700, .adv_w = 112, .box_w = 1, .box_h = 15, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 2708, .adv_w = 112, .box_w = 4, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 2736, .adv_w = 112, .box_w = 7, .box_h = 3, .ofs_x = 0, .ofs_y = 10}, - {.bitmap_index = 2747, .adv_w = 112, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 2747, .adv_w = 224, .box_w = 4, .box_h = 5, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 2757, .adv_w = 224, .box_w = 4, .box_h = 5, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 2767, .adv_w = 224, .box_w = 8, .box_h = 11, .ofs_x = 3, .ofs_y = 0}, - {.bitmap_index = 2811, .adv_w = 224, .box_w = 4, .box_h = 12, .ofs_x = 8, .ofs_y = -1}, - {.bitmap_index = 2835, .adv_w = 224, .box_w = 4, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 2859, .adv_w = 224, .box_w = 8, .box_h = 9, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 2895, .adv_w = 224, .box_w = 10, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 2955, .adv_w = 224, .box_w = 8, .box_h = 7, .ofs_x = 3, .ofs_y = 0}, - {.bitmap_index = 2983, .adv_w = 224, .box_w = 10, .box_h = 9, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 3028, .adv_w = 224, .box_w = 8, .box_h = 12, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 3076, .adv_w = 224, .box_w = 8, .box_h = 9, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 3112, .adv_w = 224, .box_w = 10, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 3172, .adv_w = 224, .box_w = 11, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 3238, .adv_w = 224, .box_w = 12, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 3304, .adv_w = 224, .box_w = 12, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 3370, .adv_w = 224, .box_w = 8, .box_h = 12, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 3418, .adv_w = 224, .box_w = 11, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 3484, .adv_w = 224, .box_w = 6, .box_h = 12, .ofs_x = 4, .ofs_y = -1}, - {.bitmap_index = 3520, .adv_w = 224, .box_w = 9, .box_h = 12, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 3574, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 3646, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 3731, .adv_w = 224, .box_w = 9, .box_h = 10, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 3776, .adv_w = 224, .box_w = 11, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 3837, .adv_w = 224, .box_w = 8, .box_h = 11, .ofs_x = 3, .ofs_y = 0}, - {.bitmap_index = 3881, .adv_w = 224, .box_w = 11, .box_h = 13, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 3953, .adv_w = 224, .box_w = 8, .box_h = 12, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 4001, .adv_w = 224, .box_w = 8, .box_h = 12, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 4049, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 4121, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 4205, .adv_w = 224, .box_w = 11, .box_h = 10, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 4260, .adv_w = 224, .box_w = 13, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 4332, .adv_w = 224, .box_w = 10, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 4392, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 4464, .adv_w = 224, .box_w = 10, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 4524, .adv_w = 224, .box_w = 12, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 4590, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 4645, .adv_w = 224, .box_w = 9, .box_h = 7, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 4677, .adv_w = 224, .box_w = 11, .box_h = 9, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 4727, .adv_w = 224, .box_w = 12, .box_h = 10, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 4787, .adv_w = 224, .box_w = 10, .box_h = 10, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 4837, .adv_w = 224, .box_w = 12, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 4903, .adv_w = 224, .box_w = 8, .box_h = 12, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 4951, .adv_w = 224, .box_w = 11, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 5012, .adv_w = 224, .box_w = 11, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 5078, .adv_w = 224, .box_w = 10, .box_h = 9, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 5123, .adv_w = 224, .box_w = 12, .box_h = 10, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 5183, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 5255, .adv_w = 224, .box_w = 11, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 5316, .adv_w = 224, .box_w = 11, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 5382, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 5454, .adv_w = 224, .box_w = 13, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 5526, .adv_w = 224, .box_w = 12, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 5592, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 5664, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 5736, .adv_w = 224, .box_w = 10, .box_h = 10, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 5786, .adv_w = 224, .box_w = 12, .box_h = 10, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 5846, .adv_w = 224, .box_w = 11, .box_h = 10, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 5901, .adv_w = 224, .box_w = 12, .box_h = 8, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 5949, .adv_w = 224, .box_w = 12, .box_h = 9, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 6003, .adv_w = 224, .box_w = 12, .box_h = 9, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 6057, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 6112, .adv_w = 224, .box_w = 13, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 6184, .adv_w = 224, .box_w = 12, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 6250, .adv_w = 224, .box_w = 8, .box_h = 12, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 6298, .adv_w = 224, .box_w = 11, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 6359, .adv_w = 224, .box_w = 11, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 6420, .adv_w = 224, .box_w = 11, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 6481, .adv_w = 224, .box_w = 8, .box_h = 12, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 6529, .adv_w = 224, .box_w = 10, .box_h = 9, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 6574, .adv_w = 224, .box_w = 12, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 6640, .adv_w = 224, .box_w = 8, .box_h = 8, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 6672, .adv_w = 224, .box_w = 11, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 6733, .adv_w = 224, .box_w = 7, .box_h = 8, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 6761, .adv_w = 224, .box_w = 8, .box_h = 10, .ofs_x = 3, .ofs_y = 0}, - {.bitmap_index = 6801, .adv_w = 224, .box_w = 8, .box_h = 12, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 6849, .adv_w = 224, .box_w = 7, .box_h = 12, .ofs_x = 4, .ofs_y = -1}, - {.bitmap_index = 6891, .adv_w = 224, .box_w = 9, .box_h = 11, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 6941, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 7013, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 7068, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 7140, .adv_w = 224, .box_w = 10, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 7200, .adv_w = 224, .box_w = 11, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 7261, .adv_w = 224, .box_w = 8, .box_h = 9, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 7297, .adv_w = 224, .box_w = 10, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 7357, .adv_w = 224, .box_w = 8, .box_h = 10, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 7397, .adv_w = 224, .box_w = 9, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 7451, .adv_w = 224, .box_w = 10, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 7511, .adv_w = 224, .box_w = 9, .box_h = 6, .ofs_x = 2, .ofs_y = 1}, - {.bitmap_index = 7538, .adv_w = 224, .box_w = 11, .box_h = 8, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 7582, .adv_w = 224, .box_w = 11, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 7648, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 7703, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 7775, .adv_w = 224, .box_w = 10, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 7835, .adv_w = 224, .box_w = 11, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 7901, .adv_w = 224, .box_w = 9, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 7955, .adv_w = 224, .box_w = 11, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 8021, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 8076, .adv_w = 224, .box_w = 11, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 8142, .adv_w = 224, .box_w = 9, .box_h = 8, .ofs_x = 2, .ofs_y = 1}, - {.bitmap_index = 8178, .adv_w = 224, .box_w = 12, .box_h = 10, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 8238, .adv_w = 224, .box_w = 12, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 8304, .adv_w = 224, .box_w = 13, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 8382, .adv_w = 224, .box_w = 11, .box_h = 10, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 8437, .adv_w = 224, .box_w = 11, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 8498, .adv_w = 224, .box_w = 11, .box_h = 10, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 8553, .adv_w = 224, .box_w = 12, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 8619, .adv_w = 224, .box_w = 11, .box_h = 10, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 8674, .adv_w = 224, .box_w = 13, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 8746, .adv_w = 224, .box_w = 8, .box_h = 11, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 8790, .adv_w = 224, .box_w = 10, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 8850, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 8935, .adv_w = 224, .box_w = 12, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 9001, .adv_w = 224, .box_w = 8, .box_h = 8, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 9033, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 9088, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 9143, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 9215, .adv_w = 224, .box_w = 6, .box_h = 11, .ofs_x = 5, .ofs_y = -1}, - {.bitmap_index = 9248, .adv_w = 224, .box_w = 8, .box_h = 11, .ofs_x = 5, .ofs_y = -1}, - {.bitmap_index = 9292, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 9347, .adv_w = 224, .box_w = 12, .box_h = 7, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 9389, .adv_w = 224, .box_w = 10, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 9449, .adv_w = 224, .box_w = 10, .box_h = 10, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 9499, .adv_w = 224, .box_w = 12, .box_h = 7, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 9541, .adv_w = 224, .box_w = 12, .box_h = 10, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 9601, .adv_w = 224, .box_w = 12, .box_h = 10, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 9661, .adv_w = 224, .box_w = 8, .box_h = 10, .ofs_x = 3, .ofs_y = 0}, - {.bitmap_index = 9701, .adv_w = 224, .box_w = 9, .box_h = 10, .ofs_x = 3, .ofs_y = 0}, - {.bitmap_index = 9746, .adv_w = 224, .box_w = 10, .box_h = 10, .ofs_x = 3, .ofs_y = 0}, - {.bitmap_index = 9796, .adv_w = 224, .box_w = 10, .box_h = 10, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 9846, .adv_w = 224, .box_w = 13, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 9924, .adv_w = 224, .box_w = 13, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 10002, .adv_w = 224, .box_w = 12, .box_h = 9, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 10056, .adv_w = 224, .box_w = 12, .box_h = 10, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 10116, .adv_w = 224, .box_w = 10, .box_h = 10, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 10166, .adv_w = 224, .box_w = 11, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 10232, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 10287, .adv_w = 224, .box_w = 10, .box_h = 8, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 10327, .adv_w = 224, .box_w = 6, .box_h = 11, .ofs_x = 4, .ofs_y = -1}, - {.bitmap_index = 10360, .adv_w = 224, .box_w = 10, .box_h = 10, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 10410, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 10465, .adv_w = 224, .box_w = 11, .box_h = 9, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 10515, .adv_w = 224, .box_w = 10, .box_h = 8, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 10555, .adv_w = 224, .box_w = 11, .box_h = 11, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 10616, .adv_w = 224, .box_w = 10, .box_h = 6, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 10646, .adv_w = 224, .box_w = 8, .box_h = 7, .ofs_x = 3, .ofs_y = 0}, - {.bitmap_index = 10674, .adv_w = 224, .box_w = 9, .box_h = 10, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 10719, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 10774, .adv_w = 224, .box_w = 7, .box_h = 11, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 10813, .adv_w = 224, .box_w = 12, .box_h = 9, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 10867, .adv_w = 224, .box_w = 8, .box_h = 9, .ofs_x = 3, .ofs_y = 0}, - {.bitmap_index = 10903, .adv_w = 224, .box_w = 9, .box_h = 8, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 10939, .adv_w = 224, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 10994, .adv_w = 224, .box_w = 10, .box_h = 9, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 11039, .adv_w = 224, .box_w = 8, .box_h = 8, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 11071, .adv_w = 224, .box_w = 14, .box_h = 3, .ofs_x = 0, .ofs_y = 4}, - {.bitmap_index = 11092, .adv_w = 224, .box_w = 14, .box_h = 2, .ofs_x = 0, .ofs_y = 5}, - {.bitmap_index = 11106, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 11197, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 11282, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 11380, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 11464, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 11555, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 11640, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 11738, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 11836, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 11920, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 12018, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 12116, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 12207, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 12284, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 12375, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 12473, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 12564, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 12662, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 12747, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 12845, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 12943, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 13034, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 13111, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 13196, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 13294, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 13392, .adv_w = 224, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 13462, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 13546, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 13630, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 13721, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 13819, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 13910, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 14008, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 14106, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 14204, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 14302, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 14400, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 14498, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 14596, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 14694, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 14792, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 14890, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 14988, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 15072, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 15170, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 15268, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 15366, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 15464, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 15555, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 15653, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 15751, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 15849, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 15947, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 16045, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 16143, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 16241, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 16339, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 16430, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 16528, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 16626, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 16724, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 16822, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 16920, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17018, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17116, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17214, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17305, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17403, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17501, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17599, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17697, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17795, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17893, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 17991, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 18089, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 18180, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 18278, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 18376, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 18474, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 18572, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 18670, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 18768, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 18866, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 18964, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 19062, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 19160, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 19258, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 19356, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 19454, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 19552, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 19650, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 19748, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 19846, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 19944, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 20029, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 20120, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 20211, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 20309, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 20407, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 20505, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 20603, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 20701, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 20792, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 20890, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 20974, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 21051, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 21149, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 21240, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 21338, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 21436, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 21534, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 21632, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 21730, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 21828, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 21905, .adv_w = 224, .box_w = 11, .box_h = 13, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 21977, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 22068, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 22166, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 22257, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 22348, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 22446, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 22544, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 22642, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 22740, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 22838, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 22922, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 23020, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 23118, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 23216, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 23314, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 23412, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 23510, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 23608, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 23699, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 23797, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 23888, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 23986, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 24084, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 24182, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 24273, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 24371, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 24462, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 24560, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 24658, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 24756, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 24847, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 24938, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25036, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25134, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25232, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25330, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 25421, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25519, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25617, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25715, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25813, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25911, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26009, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 26100, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26198, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26296, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26394, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 26478, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26576, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26674, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26772, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26870, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26968, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27066, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27164, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27262, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27360, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 27444, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27542, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27640, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27731, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27822, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27913, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28011, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28109, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28200, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28291, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28389, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28487, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28585, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28683, .adv_w = 224, .box_w = 11, .box_h = 11, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 28744, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28842, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28940, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 29031, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 29115, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 29199, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 29290, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 29374, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 29465, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 29550, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 29641, .adv_w = 224, .box_w = 12, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 29719, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 29804, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 29902, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 30000, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 30084, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 30169, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 30246, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 30337, .adv_w = 224, .box_w = 13, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 30415, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 30500, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 30591, .adv_w = 224, .box_w = 12, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 30669, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 30760, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 30851, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 30942, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31040, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31138, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 31229, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 31313, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 31397, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 31482, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31580, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 31665, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 31756, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 31847, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31938, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 32029, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 32120, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 32211, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 32309, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 32400, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 32491, .adv_w = 224, .box_w = 13, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 32569, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 32660, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 32758, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 32835, .adv_w = 224, .box_w = 11, .box_h = 13, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 32907, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 32998, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 33082, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 33166, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 33243, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 33327, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 33418, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 33502, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 33586, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 33677, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 33768, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 33866, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 33957, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34055, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34153, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 34244, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34335, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34433, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34531, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34629, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34727, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34825, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34923, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35021, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35119, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35217, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35315, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35413, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35504, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 35595, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 35686, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35777, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35875, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35973, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36064, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 36155, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 36239, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36337, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36435, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36533, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36631, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36729, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36827, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36925, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37023, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37121, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37219, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37317, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37415, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37513, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37611, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37709, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37807, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37905, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 38003, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 38101, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 38192, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 38290, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 38388, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 38486, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 38584, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 38682, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 38780, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 38878, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 38976, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39074, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39172, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39270, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39368, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39466, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39564, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 39655, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39753, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39851, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39949, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 40040, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 40131, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 40222, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 40313, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 40411, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 40509, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 40600, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 40691, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 40782, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 40880, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 40971, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 41069, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 41167, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 41265, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 41356, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 41454, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 41552, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 41650, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 41741, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 41839, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 41923, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42021, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42112, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42210, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42308, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 42399, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42497, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42595, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42693, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42791, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42882, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42980, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43078, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 43162, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43253, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 43337, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43435, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43533, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43624, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43715, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43806, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43897, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43995, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44093, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44191, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44282, .adv_w = 224, .box_w = 12, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 44360, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44451, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44549, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44640, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44731, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 44815, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 44900, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44998, .adv_w = 224, .box_w = 13, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 45076, .adv_w = 224, .box_w = 12, .box_h = 12, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 45148, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 45239, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45337, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45428, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45526, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 45617, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45715, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45813, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45911, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46009, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46107, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 46198, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 46289, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46387, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46485, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46583, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46681, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46772, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46870, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46968, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47066, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47164, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47262, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47360, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47451, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47549, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47647, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47745, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47843, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47941, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48039, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 48116, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 48207, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48298, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48396, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48487, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 48571, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48669, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48767, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48865, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48963, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49061, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49159, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49257, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49355, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49453, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49551, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49649, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49747, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49845, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49943, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50041, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 50125, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 50210, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 50301, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50399, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50497, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50595, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50693, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 50784, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50875, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50973, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 51064, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 51162, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 51247, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 51332, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 51423, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 51521, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 51612, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 51703, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 51788, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 51879, .adv_w = 224, .box_w = 12, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 51957, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 52041, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52139, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 52224, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52322, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 52407, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52505, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52603, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 52694, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52792, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52890, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52988, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53086, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53184, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53282, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53380, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53478, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53576, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53674, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53772, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53863, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53961, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54059, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54157, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54255, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54353, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54451, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54549, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54640, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54738, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54836, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54934, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55032, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55130, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55221, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55319, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55417, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55515, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55613, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55711, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55809, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55907, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56005, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56103, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56201, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56299, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56397, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56495, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56593, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56691, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56789, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56887, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56985, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57083, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57181, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57279, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57377, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57468, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57566, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57664, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57762, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57860, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57958, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58056, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58154, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58252, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58350, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58448, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58546, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58644, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58742, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58840, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58938, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59036, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59134, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59232, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59330, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59428, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 59519, .adv_w = 224, .box_w = 9, .box_h = 13, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 59578, .adv_w = 224, .box_w = 13, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 59656, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59747, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 59838, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59936, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 60013, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 60097, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60195, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 60286, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 60377, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60475, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 60566, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60664, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 60748, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 60839, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 60930, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 61021, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 61119, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 61210, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 61294, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 61379, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 61477, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 61568, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 61659, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 61750, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 61841, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 61918, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62016, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 62107, .adv_w = 224, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 62177, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 62261, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62359, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62457, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 62534, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62632, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62717, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62808, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62906, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63004, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63102, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63200, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63298, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63396, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63494, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63592, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63690, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63788, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63886, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63984, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64082, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64180, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64271, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64369, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64467, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64565, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64663, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64761, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64852, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64950, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65048, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65146, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65244, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65342, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65440, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65538, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65636, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65734, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65832, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65930, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66028, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66126, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66224, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66322, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66420, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66518, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66616, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66714, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66812, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66910, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67008, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67106, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67204, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67302, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67400, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67498, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67596, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67694, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67792, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67890, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67988, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68086, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68184, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68282, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 68373, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 68464, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 68555, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68653, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 68744, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68842, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68940, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69038, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69136, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69234, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69332, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69430, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69528, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69626, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69724, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69822, .adv_w = 224, .box_w = 12, .box_h = 13, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 69900, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 69984, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 70068, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 70159, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70257, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70355, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70453, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70551, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70649, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70747, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70845, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 70936, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71034, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71132, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71230, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71321, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71419, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71517, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 71608, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71706, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71804, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 71895, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71993, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72091, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72189, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72287, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72385, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72483, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72581, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72679, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72777, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72875, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72973, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73064, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73162, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73253, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 73344, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73442, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73540, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73638, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73736, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73834, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73932, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74023, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 74114, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74212, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74310, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74408, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74506, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74604, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74702, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74800, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74898, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74996, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75094, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75192, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75290, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75381, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75479, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75570, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75668, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75766, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75864, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75955, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 76046, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76137, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 76228, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76319, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 76410, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76508, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76606, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76704, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76802, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76893, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76991, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 77089, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 77187, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 77285, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 77383, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 77481, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 77579, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 77677, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 77768, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 77866, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 77950, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 78041, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 78139, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 78237, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 78328, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 78419, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 78510, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 78601, .adv_w = 224, .box_w = 10, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 78661, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 78738, .adv_w = 224, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 78808, .adv_w = 224, .box_w = 12, .box_h = 13, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 78886, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 78970, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 79055, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 79140, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79238, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 79329, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79420, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79518, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 79609, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 79700, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79798, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79889, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79987, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 80085, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 80176, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 80253, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 80344, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 80435, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 80519, .adv_w = 224, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 80589, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 80680, .adv_w = 224, .box_w = 9, .box_h = 13, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 80739, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 80830, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 80921, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81019, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81117, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 81208, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 81292, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81390, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81488, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81586, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81677, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81775, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81873, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81971, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82069, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82167, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82265, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82363, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82461, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82559, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82657, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82755, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82853, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82951, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83049, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83147, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83245, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83343, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83441, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83539, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83637, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83735, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83833, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83931, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84029, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 84120, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 84211, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84309, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 84394, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84492, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84590, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84688, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84786, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84884, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84982, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85080, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85178, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85276, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85374, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85472, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85570, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85661, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85759, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85857, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85955, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86046, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 86137, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86235, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86333, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86431, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86529, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86627, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86725, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86823, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 86914, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87012, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87110, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87208, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87306, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87404, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87502, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87600, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87698, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87796, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87894, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87992, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88090, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88188, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88286, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88384, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 88475, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88573, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88671, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88769, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88867, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88965, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 89056, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89154, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89252, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89350, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89448, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 89532, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89630, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89728, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89826, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89924, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90022, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 90106, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90204, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90302, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90400, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90498, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 90575, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90666, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90764, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90855, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90946, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91037, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 91128, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91226, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91324, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91422, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91520, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91618, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91716, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91814, .adv_w = 224, .box_w = 9, .box_h = 14, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 91877, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 91968, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92066, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92164, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92255, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92353, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92451, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92549, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92647, .adv_w = 224, .box_w = 11, .box_h = 14, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 92724, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 92815, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92913, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93011, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93109, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93207, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93305, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93403, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93501, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93599, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93697, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93795, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93893, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93984, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94082, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94180, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94278, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94376, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94474, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94572, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94670, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94768, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94866, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94964, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95062, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95160, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95258, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95356, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95454, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95539, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95630, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95728, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95826, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95924, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96015, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96113, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96211, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96309, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96400, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96498, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96596, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96687, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96785, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96883, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96981, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97079, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97177, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97275, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97373, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97471, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97569, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97667, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97765, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97863, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97961, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98059, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98157, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98255, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98353, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98451, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98549, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98647, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98745, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98843, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98941, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 99039, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 99137, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 99235, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 99333, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 99431, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 99529, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 99620, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 99718, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 99816, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 99914, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100012, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100110, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 100201, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100299, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100397, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100495, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100593, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100691, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 100782, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 100866, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100964, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 101055, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 101153, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 101244, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 101328, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 101419, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 101503, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 101587, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 101671, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 101755, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 101846, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 101944, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 102035, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102133, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102231, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102329, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102427, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102525, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102623, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102721, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 102805, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102903, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 102994, .adv_w = 224, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103099, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103197, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103295, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103393, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103491, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103589, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103687, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103785, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103883, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103974, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104072, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104170, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104261, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104359, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104457, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 104548, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104646, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104744, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 104835, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104933, .adv_w = 224, .box_w = 14, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 105017, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105115, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105213, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105311, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105402, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105500, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105598, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105696, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105794, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 105885, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105983, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106081, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106179, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106277, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106375, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106466, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106564, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 106655, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106753, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106851, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106949, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107047, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107145, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107243, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107341, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107439, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107530, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107615, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107713, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107811, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107909, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108000, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108091, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108189, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108287, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108385, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 108476, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108567, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108665, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108763, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108861, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108959, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 109057, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 109148, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 109239, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 109337, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 109435, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 109533, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 109617, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 109701, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 109785, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 109876, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 109967, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 110058, .adv_w = 224, .box_w = 12, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 110136, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 110227, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 110318, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 110403, .adv_w = 224, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 110487, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 110578, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 110669, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 110760, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 110851, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 110942, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 111033, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 111124, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 111215, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111313, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111411, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111509, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111600, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111698, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111796, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111894, .adv_w = 224, .box_w = 12, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 111972, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112070, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 112161, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 112246, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112344, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112442, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112533, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112631, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112729, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112827, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112925, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113023, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113121, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113212, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 113303, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113401, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113499, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113597, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113695, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113793, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113891, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113989, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114087, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114185, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114283, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114381, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114479, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 114570, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114668, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114766, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114864, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114962, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115060, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115158, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115256, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115354, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115452, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115550, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115648, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115746, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 115837, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115935, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116026, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116124, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116222, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116313, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116411, .adv_w = 224, .box_w = 13, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 116496, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116594, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116692, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116790, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116888, .adv_w = 224, .box_w = 15, .box_h = 15, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 117001, .adv_w = 224, .box_w = 14, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 117078, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 117169, .adv_w = 224, .box_w = 14, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 117246, .adv_w = 154, .box_w = 10, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 117301, .adv_w = 224, .box_w = 14, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 117406, .adv_w = 224, .box_w = 14, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 117511, .adv_w = 252, .box_w = 16, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 117615, .adv_w = 224, .box_w = 14, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 117720, .adv_w = 252, .box_w = 16, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 117808, .adv_w = 224, .box_w = 14, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 117913, .adv_w = 112, .box_w = 7, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 117955, .adv_w = 168, .box_w = 11, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 118021, .adv_w = 252, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 118133, .adv_w = 224, .box_w = 14, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 118210, .adv_w = 154, .box_w = 10, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 118285, .adv_w = 196, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 118355, .adv_w = 196, .box_w = 13, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 118453, .adv_w = 196, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 118538, .adv_w = 196, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 118623, .adv_w = 196, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 118693, .adv_w = 196, .box_w = 14, .box_h = 13, .ofs_x = -1, .ofs_y = -1}, - {.bitmap_index = 118784, .adv_w = 140, .box_w = 9, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 118843, .adv_w = 140, .box_w = 9, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 118902, .adv_w = 196, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 118987, .adv_w = 196, .box_w = 13, .box_h = 4, .ofs_x = 0, .ofs_y = 3}, - {.bitmap_index = 119013, .adv_w = 252, .box_w = 16, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 119101, .adv_w = 280, .box_w = 18, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 119236, .adv_w = 252, .box_w = 17, .box_h = 15, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 119364, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 119455, .adv_w = 196, .box_w = 13, .box_h = 8, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 119507, .adv_w = 196, .box_w = 13, .box_h = 8, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 119559, .adv_w = 280, .box_w = 18, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 119658, .adv_w = 224, .box_w = 14, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 119735, .adv_w = 224, .box_w = 14, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 119840, .adv_w = 224, .box_w = 15, .box_h = 15, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 119953, .adv_w = 196, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 120038, .adv_w = 196, .box_w = 13, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120136, .adv_w = 196, .box_w = 13, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 120221, .adv_w = 196, .box_w = 13, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 120299, .adv_w = 224, .box_w = 14, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 120376, .adv_w = 140, .box_w = 10, .box_h = 15, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 120451, .adv_w = 196, .box_w = 13, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120549, .adv_w = 196, .box_w = 13, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120647, .adv_w = 252, .box_w = 16, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 120735, .adv_w = 224, .box_w = 16, .box_h = 15, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 120855, .adv_w = 168, .box_w = 11, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120938, .adv_w = 280, .box_w = 18, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 121055, .adv_w = 280, .box_w = 18, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 121145, .adv_w = 280, .box_w = 18, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 121235, .adv_w = 280, .box_w = 18, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 121325, .adv_w = 280, .box_w = 18, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 121415, .adv_w = 280, .box_w = 18, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 121505, .adv_w = 280, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 121613, .adv_w = 196, .box_w = 12, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 121703, .adv_w = 196, .box_w = 13, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 121801, .adv_w = 224, .box_w = 15, .box_h = 15, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 121914, .adv_w = 280, .box_w = 18, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 122013, .adv_w = 168, .box_w = 11, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 122096, .adv_w = 225, .box_w = 15, .box_h = 10, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 122171, .adv_w = 224, .box_w = 5, .box_h = 12, .ofs_x = 7, .ofs_y = -1}, - {.bitmap_index = 122201, .adv_w = 224, .box_w = 5, .box_h = 12, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 122231, .adv_w = 224, .box_w = 3, .box_h = 5, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 122239, .adv_w = 224, .box_w = 6, .box_h = 10, .ofs_x = 4, .ofs_y = 0}, - {.bitmap_index = 122269, .adv_w = 224, .box_w = 6, .box_h = 11, .ofs_x = 4, .ofs_y = 0} -}; - -/*--------------------- - * CHARACTER MAPPING - *--------------------*/ - -static const uint16_t unicode_list_1[] = { - 0x0, 0x1, 0x4, 0xb, 0xc, 0x40, 0x41, 0x42, - 0x43, 0x45, 0x46, 0x47 -}; - -static const uint8_t glyph_id_ofs_list_4[] = { - 0, 0, 0, 1, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 0, 7, - 8, 9, 0, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 0, - 30, 31, 32, 0, 33, 34, 0, 35, - 36, 37, 38, 39, 40, 0, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, - 51, 0, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 0, - 65, 66, 67, 68, 69, 70, 71 -}; - -static const uint16_t unicode_list_5[] = { - 0x0, 0x4, 0x7, 0xd, 0x1d11, 0x1d14, 0x1d18, 0x1d19, - 0x1d1a, 0x1d1b, 0x1d1c, 0x1d1e, 0x1d24, 0x1d25, 0x1d27, 0x1d32, - 0x1d37, 0x1d3e, 0x1d4c, 0x1d56, 0x1d5c, 0x1d5f, 0x1d60, 0x1d68, - 0x1d6e, 0x1d70, 0x1d97, 0x1d99, 0x1d9a, 0x1d9c, 0x1d9d, 0x1da5, - 0x1dac, 0x1db2, 0x1db5, 0x1db7, 0x1dbd, 0x1dcb, 0x1dd1, 0x1ddb, - 0x1ddc, 0x1dde, 0x1de6, 0x1de7, 0x1de9, 0x1df4, 0x1df5, 0x1df6, - 0x1dff, 0x1e07, 0x1e0c, 0x1e0e, 0x1e12, 0x1e1b, 0x1e22, 0x1e2b, - 0x1e2e, 0x1e49, 0x1e4d, 0x1e57, 0x1e5e, 0x1e5f, 0x1e60, 0x1e64, - 0x1e66, 0x1e6a, 0x1e6d, 0x1e71, 0x1e90, 0x1e97, 0x1e9c, 0x1eac, - 0x1eae, 0x1eb2, 0x1ed0, 0x1ed3, 0x1eee, 0x1ef2, 0x1eff, 0x1f1c, - 0x1f22, 0x1f2a, 0x1f30, 0x1f35, 0x1f4d, 0x1f6b, 0x1f6d, 0x1f76, - 0x1f85, 0x1faa, 0x1fc4, 0x1fd6, 0x1fde, 0x1fe0, 0x1fe6, 0x200a, - 0x2015, 0x203b, 0x2050, 0x2054, 0x2055, 0x2056, 0x2059, 0x205a, - 0x205c, 0x205e, 0x2063, 0x206b, 0x2076, 0x2078, 0x2079, 0x207a, - 0x207c, 0x207d, 0x207e, 0x2082, 0x2087, 0x2088, 0x2096, 0x2097, - 0x209b, 0x209e, 0x20aa, 0x20ac, 0x20bd, 0x20c8, 0x20de, 0x20ee, - 0x20f7, 0x210b, 0x2117, 0x2118, 0x211b, 0x2128, 0x212e, 0x2135, - 0x2136, 0x213a, 0x2141, 0x2147, 0x2149, 0x214c, 0x2158, 0x215b, - 0x215e, 0x216c, 0x2183, 0x2186, 0x2194, 0x21ac, 0x21b0, 0x21b1, - 0x21b9, 0x21ba, 0x21bb, 0x21c4, 0x21da, 0x21e6, 0x21ea, 0x21ee, - 0x21f5, 0x2206, 0x2216, 0x2227, 0x2228, 0x224c, 0x2251, 0x2252, - 0x2254, 0x2259, 0x225b, 0x2263, 0x2265, 0x2268, 0x2269, 0x2282, - 0x2284, 0x228c, 0x22ab, 0x22b0, 0x22c4, 0x22cc, 0x22d3, 0x22d4, - 0x22d9, 0x22db, 0x22dc, 0x22de, 0x22e7, 0x22e8, 0x22f4, 0x22f5, - 0x22f6, 0x22f7, 0x22fb, 0x22fc, 0x2300, 0x2301, 0x2303, 0x2304, - 0x2308, 0x2309, 0x2314, 0x2315, 0x2319, 0x231d, 0x231e, 0x2322, - 0x2337, 0x2338, 0x2351, 0x235b, 0x2373, 0x2379, 0x2384, 0x238d, - 0x238e, 0x239d, 0x23c3, 0x23d2, 0x23f2, 0x23fb, 0x2457, 0x245b, - 0x2460, 0x2477, 0x2495, 0x249a, 0x24ad, 0x24ae, 0x24bf, 0x24c7, - 0x24df, 0x2500, 0x252c, 0x25c5, 0x25ec, 0x25ef, 0x25f1, 0x2601, - 0x2604, 0x260e, 0x261c, 0x261e, 0x2623, 0x2629, 0x2630, 0x2634, - 0x2639, 0x2641, 0x2658, 0x265b, 0x2661, 0x269c, 0x26f0, 0x2708, - 0x270b, 0x2742, 0x2745, 0x275b, 0x277a, 0x2794, 0x27a8, 0x27af, - 0x27db, 0x27e4, 0x27fc, 0x2801, 0x2803, 0x281a, 0x2820, 0x2826, - 0x2827, 0x282b, 0x282d, 0x2831, 0x2838, 0x283a, 0x283b, 0x283c, - 0x283f, 0x2842, 0x2858, 0x2862, 0x2868, 0x2884, 0x288a, 0x288e, - 0x2893, 0x2898, 0x28c4, 0x28ca, 0x28cc, 0x28da, 0x28dc, 0x28e1, - 0x28e5, 0x2929, 0x296b, 0x2977, 0x29a3, 0x29ce, 0x29dd, 0x2a1a, - 0x2a61, 0x2a68, 0x2a69, 0x2a74, 0x2a77, 0x2a7a, 0x2a7c, 0x2a89, - 0x2a94, 0x2a96, 0x2a98, 0x2a99, 0x2a9a, 0x2a9d, 0x2aa9, 0x2aaa, - 0x2aab, 0x2aaf, 0x2ab0, 0x2ab3, 0x2ab5, 0x2ac4, 0x2ac6, 0x2ac7, - 0x2aca, 0x2ad0, 0x2ad5, 0x2ad7, 0x2add, 0x2ae3, 0x2aee, 0x2af0, - 0x2af7, 0x2afc, 0x2b0b, 0x2b0f, 0x2b15, 0x2b18, 0x2b19, 0x2b1e, - 0x2b1f, 0x2b20, 0x2b22, 0x2b2b, 0x2b35, 0x2b42, 0x2b4b, 0x2b51, - 0x2b56, 0x2b5b, 0x2b5c, 0x2b66, 0x2b76, 0x2b7d, 0x2b82, 0x2c07, - 0x2c5d, 0x2cee, 0x2cef, 0x2cf6, 0x2cf7, 0x2cff, 0x2d02, 0x2d03, - 0x2d13, 0x2d14, 0x2d19, 0x2d1d, 0x2d3c, 0x2d3e, 0x2d40, 0x2d41, - 0x2d44, 0x2d47, 0x2d49, 0x2d56, 0x2d84, 0x2d85, 0x2d89, 0x2d8f, - 0x2d94, 0x2d97, 0x2da6, 0x2da8, 0x2dad, 0x2db7, 0x2db8, 0x2dbc, - 0x2dbe, 0x2dc8, 0x2df1, 0x2e0b, 0x2e10, 0x2e20, 0x2e26, 0x2e30, - 0x2e42, 0x2e46, 0x2e48, 0x2e64, 0x2e73, 0x2e82, 0x2e8a, 0x2e8d, - 0x2e91, 0x2e96, 0x2e99, 0x2e9c, 0x2e9d, 0x2ea3, 0x2ea4, 0x2ea8, - 0x2eaf, 0x2eb2, 0x2eba, 0x2ed4, 0x2ed6, 0x2ee9, 0x2eea, 0x2efc, - 0x2f06, 0x2f1f, 0x2f23, 0x2f26, 0x2f2e, 0x2f36, 0x2f38, 0x2f80, - 0x2fb9, 0x2fbb, 0x2fc3, 0x2fd6, 0x3004, 0x3019, 0x3020, 0x302b, - 0x302c, 0x3030, 0x305c, 0x3074, 0x3078, 0x307f, 0x30da, 0x3109, - 0x3121, 0x3122, 0x3127, 0x3137, 0x3141, 0x314c, 0x3150, 0x3151, - 0x315c, 0x315e, 0x3164, 0x3166, 0x318f, 0x3191, 0x319b, 0x31a6, - 0x31cd, 0x31d6, 0x31da, 0x31ec, 0x31f2, 0x31fd, 0x31fe, 0x3210, - 0x3212, 0x3218, 0x322a, 0x3266, 0x3279, 0x3299, 0x32a3, 0x32ac, - 0x32b2, 0x32b3, 0x32b6, 0x32b8, 0x32b9, 0x32e0, 0x32e1, 0x32ec, - 0x32ff, 0x330b, 0x334b, 0x33d2, 0x33d8, 0x33e5, 0x33eb, 0x3440, - 0x344a, 0x344f, 0x3450, 0x3456, 0x3459, 0x3468, 0x346a, 0x3473, - 0x3481, 0x3485, 0x3498, 0x34aa, 0x34be, 0x34c1, 0x34c8, 0x34ca, - 0x34cd, 0x34ce, 0x34d2, 0x34d6, 0x34e0, 0x34f3, 0x34f6, 0x34f7, - 0x34fa, 0x3507, 0x3518, 0x351f, 0x3524, 0x3525, 0x3530, 0x3531, - 0x3536, 0x3539, 0x3540, 0x354d, 0x3553, 0x357a, 0x357f, 0x3580, - 0x3585, 0x358b, 0x3598, 0x35a2, 0x35a7, 0x35a8, 0x35d8, 0x35ed, - 0x3603, 0x3605, 0x3609, 0x360f, 0x3610, 0x3611, 0x3614, 0x3619, - 0x361a, 0x361c, 0x361e, 0x362c, 0x362e, 0x3630, 0x3639, 0x363b, - 0x363c, 0x363d, 0x363e, 0x364b, 0x3661, 0x3662, 0x3670, 0x3672, - 0x3676, 0x3680, 0x3682, 0x36a1, 0x36a8, 0x36ad, 0x36e1, 0x36f6, - 0x3702, 0x370c, 0x3710, 0x3722, 0x3732, 0x373b, 0x374a, 0x374d, - 0x3754, 0x3759, 0x37ae, 0x37c1, 0x37ff, 0x381e, 0x382d, 0x386b, - 0x387e, 0x3886, 0x388e, 0x3893, 0x38dc, 0x38e9, 0x3913, 0x392a, - 0x3932, 0x3934, 0x393b, 0x394a, 0x395c, 0x3970, 0x3a32, 0x3a43, - 0x3a5d, 0x3a61, 0x3a72, 0x3a73, 0x3a74, 0x3a75, 0x3a76, 0x3a7a, - 0x3a80, 0x3a83, 0x3a84, 0x3a88, 0x3a8c, 0x3a9b, 0x3a9c, 0x3ac6, - 0x3ade, 0x3adf, 0x3ae0, 0x3ae5, 0x3aec, 0x3b20, 0x3b22, 0x3b25, - 0x3b28, 0x3b45, 0x3b48, 0x3b49, 0x3b53, 0x3b6b, 0x3b71, 0x3b8b, - 0x3b99, 0x3ba3, 0x3bca, 0x3bcc, 0x3bd2, 0x3bdb, 0x3be6, 0x3bf3, - 0x3bf4, 0x3bf9, 0x3c04, 0x3c1c, 0x3c28, 0x3c43, 0x3c4c, 0x3c4f, - 0x3c52, 0x3c56, 0x3c85, 0x3c88, 0x3c99, 0x3ccd, 0x3d02, 0x3d08, - 0x3d16, 0x3d18, 0x3d19, 0x3d1a, 0x3d2c, 0x3d32, 0x3d3a, 0x3d40, - 0x3d67, 0x3da1, 0x3da7, 0x3dae, 0x3e10, 0x3e33, 0x3e49, 0x3ed4, - 0x3ef0, 0x3f74, 0x3f7c, 0x3f8e, 0x3fca, 0x3fcb, 0x4032, 0x4047, - 0x406a, 0x40c2, 0x40f0, 0x413e, 0x4147, 0x4149, 0x4158, 0x416c, - 0x4171, 0x417a, 0x418a, 0x41bd, 0x41c0, 0x41c7, 0x41d1, 0x41fd, - 0x41fe, 0x423c, 0x4250, 0x4283, 0x42ba, 0x430f, 0x4314, 0x4317, - 0x43c1, 0x4429, 0x442b, 0x4430, 0x4433, 0x4434, 0x4439, 0x4441, - 0x4442, 0x4444, 0x4446, 0x4448, 0x444b, 0x444c, 0x445d, 0x446a, - 0x447b, 0x447c, 0x4481, 0x4487, 0x44c3, 0x44d6, 0x44ec, 0x458b, - 0x458d, 0x458e, 0x458f, 0x4595, 0x4597, 0x45d0, 0x45e8, 0x45ff, - 0x4605, 0x4609, 0x461c, 0x4630, 0x4631, 0x464f, 0x4651, 0x46f6, - 0x46fe, 0x4704, 0x4713, 0x4725, 0x4745, 0x47cb, 0x484b, 0x484d, - 0x484f, 0x4867, 0x486e, 0x486f, 0x487e, 0x4892, 0x48d1, 0x48d2, - 0x48dc, 0x48de, 0x48e2, 0x48e9, 0x490c, 0x491c, 0x493f, 0x495e, - 0x4987, 0x498b, 0x49a4, 0x49dc, 0x49ea, 0x49f6, 0x4a00, 0x4a22, - 0x4a37, 0x4a3d, 0x4a57, 0x4a5a, 0x4a65, 0x4a67, 0x4aa8, 0x4ab2, - 0x4ad1, 0x4ad5, 0x4b32, 0x4b84, 0x4bcf, 0x4be7, 0x4c0c, 0x4c11, - 0x4c15, 0x4c2a, 0x4c31, 0x4c41, 0x4c4a, 0x4c53, 0x4c55, 0x4c5d, - 0x4c61, 0x4c72, 0x4c77, 0x4c82, 0x4c86, 0x4ca4, 0x4cab, 0x4cbe, - 0x4cc3, 0x4ce2, 0x4ce3, 0x4ceb, 0x4cf1, 0x4cfa, 0x4d05, 0x4d4e, - 0x4d4f, 0x4d65, 0x4d81, 0x4d8d, 0x4d9d, 0x4df0, 0x4e4b, 0x4e7f, - 0x4e9f, 0x4eba, 0x4ee3, 0x4f12, 0x4f14, 0x4f16, 0x4f1d, 0x4f44, - 0x4f6f, 0x4f80, 0x4f83, 0x4f88, 0x4f8e, 0x4f9a, 0x4fba, 0x4fc0, - 0x4fc3, 0x4fdd, 0x5009, 0x500e, 0x5042, 0x505b, 0x5066, 0x5077, - 0x5081, 0x50ae, 0x50da, 0x50fb, 0x5104, 0x510b, 0x5118, 0x5119, - 0x511a, 0x513b, 0x513d, 0x514a, 0x5180, 0x5183, 0x5193, 0x51c2, - 0x51f6, 0x51f7, 0x5202, 0x5247, 0x5288, 0x52e4, 0x52ed, 0x534e, - 0x535a, 0x5368, 0x5446, 0x5495, 0x54bd, 0x54ee, 0x5518, 0x5566, - 0x575d, 0x5764, 0x5779, 0x57bc, 0x57e0, 0x57ed, 0x57f2, 0x580e, - 0x5818, 0x5890, 0x5892, 0x589c, 0x58a0, 0x58a7, 0x58ab, 0x58bb, - 0x58cb, 0x58d1, 0x58e3, 0x58f4, 0x58f7, 0x5911, 0x5919, 0x591b, - 0x591f, 0x5924, 0x5929, 0x593b, 0x593e, 0x5942, 0x5944, 0x5945, - 0x5966, 0x5977, 0x5982, 0x5983, 0x5984, 0x599d, 0x599e, 0x59a6, - 0x59a9, 0x59af, 0x59bb, 0x59bd, 0x59be, 0x59c1, 0x59c3, 0x59d0, - 0x59d8, 0x59dc, 0x59e7, 0x5a09, 0x5a13, 0x5a2c, 0x5a2e, 0x5a69, - 0x5a81, 0x5a88, 0x5a9b, 0x5aa4, 0x5ab2, 0x5aef, 0x5b61, 0x5b72, - 0x5bb1, 0x5bb2, 0x5bb8, 0x5bba, 0x5bbd, 0x5bc8, 0x5bc9, 0x5bcc, - 0x5bd0, 0x5bd4, 0x5bd8, 0x5bfb, 0x5c0e, 0x5c4a, 0x5c75, 0x5c81, - 0x5c88, 0x5c96, 0x5c9b, 0x5cb4, 0x5cc4, 0x5cf0, 0x5d00, 0x5dbc, - 0x5ddb, 0x5df0, 0x5df3, 0x5e0e, 0x5e14, 0x5e1a, 0x5e26, 0x5e3b, - 0x5e49, 0x5eac, 0x5eaf, 0x5eb7, 0x5ec3, 0x5ecb, 0x5ecd, 0x5edf, - 0x5ee2, 0x5ee5, 0x5efc, 0x5f0e, 0x5f11, 0x5f12, 0x5f14, 0x5f20, - 0x5f21, 0x5f2a, 0x5f2b, 0x5f30, 0x5f31, 0x5f34, 0x5f3f, 0x5f42, - 0x5f43, 0x5f56, 0x5f5b, 0x5f5c, 0x5f5f, 0x5f64, 0x5f65, 0x5f66, - 0x5f71, 0x5f7a, 0x5f89, 0x5f90, 0x5f95, 0x5f9b, 0x5fb4, 0x5fbb, - 0x5ff9, 0x6006, 0x600e, 0x605e, 0x6063, 0x6065, 0x6089, 0x60bc, - 0x60de, 0x60df, 0x60e0, 0x60e2, 0x60ee, 0x6155, 0x616c, 0x6191, - 0x6233, 0x6240, 0x6243, 0x6488, 0x649a, 0x649c, 0x64a4, 0x64b3, - 0x64ed, 0x6501, 0x6544, 0x6555, 0x655e, 0x6561, 0x6573, 0x6575, - 0x6589, 0x658e, 0x659f, 0x65ac, 0x65ad, 0x65b4, 0x65b9, 0x65cc, - 0x65d7, 0x65e2, 0x65e7, 0x65ea, 0x65f3, 0x65f4, 0x65f9, 0x65fb, - 0x6603, 0x660c, 0x6611, 0x6618, 0x6663, 0x666a, 0x666f, 0x6673, - 0x667a, 0x6685, 0x6704, 0x6710, 0x6714, 0x6716, 0x6719, 0x6728, - 0x6729, 0x673e, 0x674d, 0x675d, 0x6765, 0x6769, 0x676f, 0x6780, - 0x67b9, 0x67ec, 0x67f0, 0x6800, 0x6803, 0x6839, 0x68a7, 0x68aa, - 0x68d5, 0x68d6, 0x6923, 0x6924, 0x6968, 0x69e5, 0x69e9, 0x69fb, - 0x6a6b, 0x6bf6, 0x6da8, 0x6dcd, 0x6dd5, 0x6de3, 0x6def, 0x6df9, - 0x6e24, 0x6e4c, 0xbf12, 0xbf19, 0xbf1c, 0xbf1d, 0xbf1e, 0xbf22, - 0xbf24, 0xbf26, 0xbf2a, 0xbf2d, 0xbf32, 0xbf37, 0xbf38, 0xbf39, - 0xbf4f, 0xbf54, 0xbf59, 0xbf5c, 0xbf5d, 0xbf5e, 0xbf62, 0xbf63, - 0xbf64, 0xbf65, 0xbf78, 0xbf79, 0xbf7f, 0xbf81, 0xbf82, 0xbf85, - 0xbf88, 0xbf89, 0xbf8a, 0xbf8c, 0xbfa4, 0xbfa6, 0xbfd5, 0xbfd6, - 0xbfd8, 0xbfda, 0xbff1, 0xbff8, 0xbffb, 0xc004, 0xc02d, 0xc035, - 0xc06c, 0xc0fc, 0xc151, 0xc152, 0xc153, 0xc154, 0xc155, 0xc198, - 0xc1a4, 0xc1fe, 0xc215, 0xc46b, 0xc6d3, 0xc7b3, 0xce19, 0xce1a, - 0xce1d, 0xce22, 0xce23 -}; - -/*Collect the unicode lists and glyph_id offsets*/ -static const lv_font_fmt_txt_cmap_t cmaps[] = { - { - .range_start = 32, .range_length = 96, .glyph_id_start = 1, - .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY - }, - { - .range_start = 12289, .range_length = 72, .glyph_id_start = 97, - .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 12, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY - }, - { - .range_start = 12362, .range_length = 24, .glyph_id_start = 109, - .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY - }, - { - .range_start = 12387, .range_length = 43, .glyph_id_start = 133, - .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY - }, - { - .range_start = 12431, .range_length = 95, .glyph_id_start = 176, - .unicode_list = NULL, .glyph_id_ofs_list = glyph_id_ofs_list_4, .list_length = 95, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL - }, - { - .range_start = 12527, .range_length = 52772, .glyph_id_start = 248, - .unicode_list = unicode_list_5, .glyph_id_ofs_list = NULL, .list_length = 1187, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY - } -}; - -/*-------------------- - * ALL CUSTOM DATA - *--------------------*/ - -#if LVGL_VERSION_MAJOR >= 8 -/*Store all the custom data of the font*/ - -static const lv_font_fmt_txt_dsc_t font_dsc = { -#else -static lv_font_fmt_txt_dsc_t font_dsc = { -#endif - .glyph_bitmap = glyph_bitmap, - .glyph_dsc = glyph_dsc, - .cmaps = cmaps, - .kern_dsc = NULL, - .kern_scale = 0, - .cmap_num = 6, - .bpp = 4, - .kern_classes = 0, - .bitmap_format = 0, - -}; - -/*----------------- - * PUBLIC FONT - *----------------*/ - -/*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 -const lv_font_t lv_font_simsun_14_cjk = { -#else -lv_font_t lv_font_simsun_14_cjk = { -#endif - .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ - .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ - .line_height = 15, /*The maximum line height required by the font*/ - .base_line = 2, /*Baseline measured from the bottom of the line*/ -#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) - .subpx = LV_FONT_SUBPX_NONE, -#endif -#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 - .underline_position = -2, - .underline_thickness = 1, -#endif - .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ -}; - -#endif /*#if LV_FONT_SIMSUN_14_CJK*/ diff --git a/L3_Middlewares/LVGL/src/font/lv_font_simsun_16_cjk.c b/L3_Middlewares/LVGL/src/font/lv_font_simsun_16_cjk.c index e8b2f28..bcd7c14 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_simsun_16_cjk.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_simsun_16_cjk.c @@ -1,7 +1,7 @@ /******************************************************************************* * Size: 16 px * Bpp: 4 - * Opts: --no-compress --no-prefilter --bpp 4 --size 16 --font SimSun.woff -r 0x20-0x7f --symbols (),盗提陽帯鼻画輕ッ冊ェル写父ぁフ結想正四O夫源庭場天續鳥れ講猿苦階給了製守8祝己妳薄泣塩帰ぺ吃変輪那着仍嗯爭熱創味保字宿捨準查達肯ァ薬得査障該降察ね網加昼料等図邪秋コ態品屬久原殊候路願楽確針上被怕悲風份重歡っ附ぷ既4黨價娘朝凍僅際洋止右航よ专角應酸師個比則響健昇豐筆歷適修據細忙跟管長令家ザ期般花越ミ域泳通些油乏ラ。營ス返調農叫樹刊愛間包知把ヤ貧橋拡普聞前ジ建当繰ネ送習渇用補ィ覺體法遊宙ョ酔余利壊語くつ払皆時辺追奇そ們只胸械勝住全沈力光ん深溝二類北面社值試9和五勵ゃ貿幾逐打課ゲて領3鼓辦発評1渉詳暇込计駄供嘛郵頃腦反構絵お容規借身妻国慮剛急乗静必議置克土オ乎荷更肉還混古渡授合主離條値決季晴東大尚央州が嗎験流先医亦林田星晩拿60旅婦量為痛テ孫う環友況玩務其ぼち揺坐一肩腰犯タょ希即果ぶ物練待み高九找やヶ都グ去」サ、气仮雑酒許終企笑録形リ銀切ギ快問滿役単黄集森毎實研喜蘇司鉛洲川条媽ノ才兩話言雖媒出客づ卻現異故り誌逮同訊已視本題ぞを横開音第席費持眾怎選元退限ー賽処喝就残無いガ多ケ沒義遠歌隣錢某雪析嬉採自透き側員予ゼ白婚电へ顯呀始均畫似懸格車騒度わ親店週維億締慣免帳電甚來園浴ゅ愈京と杯各海怒ぜ排敗挙老買7極模実紀ヒ携隻告シ並屋這孩讓質ワブ富賃争康由辞マ火於短樣削弟材注節另室ダ招擁ぃ若套底波行勤關著泊背疲狭作念推ぐ民貸祖介說ビ代温契你我レ入描變再札ソ派頭智遅私聽舉灣山伸放直安ト誕煙付符幅ふ絡她届耳飲忘参革團仕様載ど歩獲嫌息の汚交興魚指資雙與館初学年幸史位柱族走括び考青也共腕Lで販擔理病イ今逃當寺猫邊菓係ム秘示解池影ド文例斷曾事茶寫明科桃藝売便え導禁財飛替而亡到し具空寝辛業ウ府セ國何基菜厳市努張缺雲根外だ断万砂ゴ超使台实ぽ礼最慧算軟界段律像夕丈窓助刻月夏政呼ぴざ擇趣除動従涼方勉名線対存請子氏將5少否諸論美感或西者定食御表は參歳緑命進易性錯房も捕皿判中觀戦ニ緩町ピ番ず金千ろ?不た象治関ャ每看徒卒統じ手範訪押座步号ベ旁以母すほ密減成往歲件緒読歯效院种七謂凝濃嵌震喉繼クュ拭死円2積水欲如ポにさ寒道區精啦姐ア聯能足及停思壓2春且メ裏株官答概黒過氷柿戻厚ぱ党祭織引計け委暗複誘港バ失下村較続神ぇ尤強秀膝兒来績十書済化服破新廠1紹您情半式產系好教暑早め樂地休協良な哪常要揮周かエ麗境働避護ンツ香夜太見設非改広聲他検求危清彼經未在起葉控靴所差內造寄南望尺換向展備眠點完約ぎ裡分説申童優伝島机須塊日立拉,鉄軽單気信很転識支布数紙此迎受心輸坊モ處「訳三曇兄野顔戰增ナ伊列又髪両有取左毛至困吧昔赤狀相夠整別士経頼然簡ホ会發隨営需脱ヨば接永居冬迫圍甘醫誰部充消連弱宇會咲覚姉麼的増首统帶糖朋術商担移景功育庫曲總劃牛程駅犬報ロ學責因パ嚴八世後平負公げ曜陸專午之閉ぬ談ご災昨冷職悪謝對它近射敢意運船臉局難什産頗!球真記ま但蔵究制機案湖臺ひ害券男留内木驗雨施種特復句末濟キ色訴依せ百型る石牠討呢时任執飯歐宅組傳配小活ゆべ暖ズ漸站素らボ束価チ浅回女片独妹英目從認生違策僕楚ペ米こ掛む爸六状落漢プ投カ校做啊洗声探あ割体項履触々訓技ハ低工映是標速善点人デ口次可廿节宵植树端阳旦腊妇费愚劳动儿军师庆圣诞闰 --font FontAwesome5-Solid+Brands+Regular.woff -r 61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61507,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61641,61664,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650 --format lvgl -o lv_font_simsun_16_cjk.c --force-fast-kern-format + * Opts: --no-compress --no-prefilter --bpp 4 --size 16 --font SimSun.woff -r 0x20-0x7f --symbols (),盗提陽帯鼻画輕ッ冊ェル写父ぁフ結想正四O夫源庭場天續鳥れ講猿苦階給了製守8祝己妳薄泣塩帰ぺ吃変輪那着仍嗯爭熱創味保字宿捨準查達肯ァ薬得査障該降察ね網加昼料等図邪秋コ態品屬久原殊候路願楽確針上被怕悲風份重歡っ附ぷ既4黨價娘朝凍僅際洋止右航よ专角應酸師個比則響健昇豐筆歷適修據細忙跟管長令家ザ期般花越ミ域泳通些油乏ラ。營ス返調農叫樹刊愛間包知把ヤ貧橋拡普聞前ジ建当繰ネ送習渇用補ィ覺體法遊宙ョ酔余利壊語くつ払皆時辺追奇そ們只胸械勝住全沈力光ん深溝二類北面社值試9和五勵ゃ貿幾逐打課ゲて領3鼓辦発評1渉詳暇込计駄供嘛郵頃腦反構絵お容規借身妻国慮剛急乗静必議置克土オ乎荷更肉還混古渡授合主離條値決季晴東大尚央州が嗎験流先医亦林田星晩拿60旅婦量為痛テ孫う環友況玩務其ぼち揺坐一肩腰犯タょ希即果ぶ物練待み高九找やヶ都グ去」サ、气仮雑酒許終企笑録形リ銀切ギ快問滿役単黄集森毎實研喜蘇司鉛洲川条媽ノ才兩話言雖媒出客づ卻現異故り誌逮同訊已視本題ぞを横開音第席費持眾怎選元退限ー賽処喝就残無いガ多ケ沒義遠歌隣錢某雪析嬉採自透き側員予ゼ白婚电へ顯呀始均畫似懸格車騒度わ親店週維億締慣免帳電甚來園浴ゅ愈京と杯各海怒ぜ排敗挙老買7極模実紀ヒ携隻告シ並屋這孩讓質ワブ富賃争康由辞マ火於短樣削弟材注節另室ダ招擁ぃ若套底波行勤關著泊背疲狭作念推ぐ民貸祖介說ビ代温契你我レ入描變再札ソ派頭智遅私聽舉灣山伸放直安ト誕煙付符幅ふ絡她届耳飲忘参革團仕様載ど歩獲嫌息の汚交興魚指資雙與館初学年幸史位柱族走括び考青也共腕Lで販擔理病イ今逃當寺猫邊菓係ム秘示解池影ド文例斷曾事茶寫明科桃藝売便え導禁財飛替而亡到し具空寝辛業ウ府セ國何基菜厳市努張缺雲根外だ断万砂ゴ超使台实ぽ礼最慧算軟界段律像夕丈窓助刻月夏政呼ぴざ擇趣除動従涼方勉名線対存請子氏將5少否諸論美感或西者定食御表は參歳緑命進易性錯房も捕皿判中觀戦ニ緩町ピ番ず金千ろ?不た象治関ャ每看徒卒統じ手範訪押座步号ベ旁以母すほ密減成往歲件緒読歯效院种七謂凝濃嵌震喉繼クュ拭死円2積水欲如ポにさ寒道區精啦姐ア聯能足及停思壓2春且メ裏株官答概黒過氷柿戻厚ぱ党祭織引計け委暗複誘港バ失下村較続神ぇ尤強秀膝兒来績十書済化服破新廠1紹您情半式產系好教暑早め樂地休協良な哪常要揮周かエ麗境働避護ンツ香夜太見設非改広聲他検求危清彼經未在起葉控靴所差內造寄南望尺換向展備眠點完約ぎ裡分説申童優伝島机須塊日立拉,鉄軽單気信很転識支布数紙此迎受心輸坊モ處「訳三曇兄野顔戰增ナ伊列又髪両有取左毛至困吧昔赤狀相夠整別士経頼然簡ホ会發隨営需脱ヨば接永居冬迫圍甘醫誰部充消連弱宇會咲覚姉麼的増首统帶糖朋術商担移景功育庫曲總劃牛程駅犬報ロ學責因パ嚴八世後平負公げ曜陸專午之閉ぬ談ご災昨冷職悪謝對它近射敢意運船臉局難什産頗!球真記ま但蔵究制機案湖臺ひ害券男留内木驗雨施種特復句末濟キ色訴依せ百型る石牠討呢时任執飯歐宅組傳配小活ゆべ暖ズ漸站素らボ束価チ浅回女片独妹英目從認生違策僕楚ペ米こ掛む爸六状落漢プ投カ校做啊洗声探あ割体項履触々訓技ハ低工映是標速善点人デ口次可 --font FontAwesome5-Solid+Brands+Regular.woff -r 61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61507,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61641,61664,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650 --format lvgl -o lv_font_simsun_16_cjk.c --force-fast-kern-format ******************************************************************************/ #ifdef LV_LVGL_H_INCLUDE_SIMPLE @@ -3971,23 +3971,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x2c, 0x0, 0x38, 0x81, 0x3a, 0xda, 0x60, 0x0, 0x13, 0x15, 0x30, 0x0, 0x0, 0x15, 0x10, - /* U+513F "儿" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xa, 0x30, 0xb, 0x30, 0x0, 0x0, - 0x0, 0x0, 0xc, 0x20, 0xc, 0x10, 0x0, 0x0, - 0x0, 0x0, 0xc, 0x20, 0xc, 0x10, 0x0, 0x0, - 0x0, 0x0, 0xc, 0x10, 0xc, 0x10, 0x0, 0x0, - 0x0, 0x0, 0xc, 0x10, 0xc, 0x10, 0x0, 0x0, - 0x0, 0x0, 0xd, 0x0, 0xc, 0x10, 0x0, 0x0, - 0x0, 0x0, 0xe, 0x0, 0xc, 0x10, 0x0, 0x0, - 0x0, 0x0, 0x1c, 0x0, 0xc, 0x10, 0x0, 0x0, - 0x0, 0x0, 0x59, 0x0, 0xc, 0x10, 0x0, 0x20, - 0x0, 0x0, 0xb2, 0x0, 0xc, 0x10, 0x0, 0x60, - 0x0, 0x3, 0xa0, 0x0, 0xc, 0x10, 0x0, 0x80, - 0x0, 0x1b, 0x10, 0x0, 0xc, 0x20, 0x1, 0xe1, - 0x2, 0x81, 0x0, 0x0, 0x6, 0xed, 0xde, 0xc1, - 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - /* U+5143 "元" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x5, 0x76, 0x66, 0x66, 0x69, 0xb1, 0x0, @@ -4391,23 +4374,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] =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x76, 0x66, 0x92, 0x0, 0xd0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0xd, 0x0, 0x21, 0x0, 0x0, - 0x0, 0x2, 0x66, 0xe6, 0x6b, 0x70, 0x66, 0x67, - 0x67, 0xb1, 0xc, 0x0, 0x84, 0x0, 0x6, 0xd0, - 0x0, 0x0, 0xc0, 0x9, 0x40, 0x0, 0xc3, 0x0, - 0x0, 0x29, 0x0, 0x93, 0x0, 0x47, 0x5, 0x40, - 0x6, 0x60, 0xa, 0x30, 0x9, 0x0, 0xc, 0x30, - 0xa1, 0x0, 0xb2, 0x9, 0x56, 0x76, 0x8b, 0x2a, - 0x0, 0xb, 0x20, 0xc9, 0x40, 0x0, 0x7a, 0x10, - 0x0, 0xd0, 0x0, 0x0, 0x0, 0x6, 0x30, 0x31, - 0x2e, 0x0, 0x0, 0x0, 0x6, 0x30, 0x1, 0xaf, - 0x70, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x30, - 0x0, - /* U+52A9 "助" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0xa3, 0x0, 0x0, 0x0, 0xa6, 0x66, 0xc2, 0x0, 0xd1, 0x0, 0x0, @@ -4938,24 +4887,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x16, 0x92, 0x0, 0x7, 0xef, 0x20, 0x0, 0x3, 0x41, 0x0, 0x0, 0x0, 0x41, 0x0, 0x0, - /* U+52B3 "劳" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0xa, 0x50, 0x1, 0xc0, 0x0, 0x0, - 0x0, 0x0, 0xa, 0x20, 0x1, 0xc0, 0x4, 0x10, - 0x7, 0x66, 0x6c, 0x76, 0x66, 0xd6, 0x6a, 0x80, - 0x0, 0x0, 0xa, 0x20, 0x1, 0xc0, 0x0, 0x0, - 0x0, 0x30, 0x5, 0x10, 0x0, 0x30, 0x2, 0x0, - 0x0, 0xa6, 0x66, 0x66, 0x66, 0x66, 0x6e, 0x70, - 0x5, 0xb0, 0x0, 0x4b, 0x0, 0x0, 0x26, 0x0, - 0x2, 0x10, 0x0, 0x5b, 0x0, 0x0, 0x10, 0x0, - 0x0, 0x67, 0x66, 0x9b, 0x66, 0x6a, 0xb0, 0x0, - 0x0, 0x0, 0x0, 0x95, 0x0, 0x8, 0x60, 0x0, - 0x0, 0x0, 0x0, 0xe1, 0x0, 0xa, 0x50, 0x0, - 0x0, 0x0, 0x8, 0x90, 0x0, 0xc, 0x20, 0x0, - 0x0, 0x0, 0x7a, 0x0, 0x32, 0x2e, 0x0, 0x0, - 0x0, 0x39, 0x50, 0x0, 0x19, 0xf7, 0x0, 0x0, - 0x5, 0x30, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, - /* U+52C9 "勉" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xb3, 0x0, 0x0, 0x9, 0x40, 0x0, 0x0, @@ -6468,22 +6399,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x27, 0x66, 0x66, 0x6c, 0x76, 0x66, 0x6d, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - /* U+5723 "圣" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x10, 0x0, - 0x0, 0x6, 0x78, 0x66, 0x66, 0x8f, 0x70, 0x0, - 0x0, 0x0, 0x5, 0x20, 0x0, 0xc7, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x84, 0xa, 0x90, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x8, 0xca, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x2c, 0x9c, 0x83, 0x0, 0x0, - 0x0, 0x0, 0x29, 0x92, 0x60, 0x6d, 0xfc, 0xa2, - 0x2, 0x57, 0x50, 0x1, 0xf1, 0x0, 0x16, 0x40, - 0x2, 0x0, 0x0, 0x0, 0xe0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0xa, - 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - /* U+59B3 "妳" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xb0, 0x0, 0x8, 0x30, 0x0, 0x0, @@ -7833,22 +7731,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xa2, 0x0, 0x0, 0xe, 0x66, 0x66, 0x66, 0xc2, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x51, 0x0, - /* U+5BB5 "宵" */ - 0x0, 0x0, 0x4, 0x91, 0x0, 0x0, 0x0, 0x1, - 0x0, 0x0, 0x87, 0x0, 0x0, 0x10, 0x6, 0x76, - 0x66, 0x66, 0x66, 0x66, 0xc7, 0xd, 0x34, 0x0, - 0x18, 0x0, 0x51, 0x80, 0x15, 0x7, 0xc0, 0x1d, - 0x8, 0x92, 0x0, 0x0, 0x0, 0xb2, 0x1d, 0x46, - 0x0, 0x0, 0x0, 0x28, 0x66, 0x6d, 0x76, 0xa4, - 0x0, 0x0, 0x2a, 0x0, 0x0, 0x0, 0xb2, 0x0, - 0x0, 0x2c, 0x66, 0x66, 0x66, 0xc2, 0x0, 0x0, - 0x2a, 0x0, 0x0, 0x0, 0xb2, 0x0, 0x0, 0x2c, - 0x66, 0x66, 0x66, 0xc2, 0x0, 0x0, 0x2a, 0x0, - 0x0, 0x0, 0xb2, 0x0, 0x0, 0x2a, 0x0, 0x0, - 0x0, 0xb2, 0x0, 0x0, 0x2a, 0x0, 0x0, 0x6c, - 0xe0, 0x0, 0x0, 0x12, 0x0, 0x0, 0x2, 0x20, - 0x0, - /* U+5BB6 "家" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1b, 0x40, 0x0, 0x0, 0x0, @@ -8569,23 +8451,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0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4, 0x0, 0x9, 0x20, 0x6, 0xa, 0x40, - 0x44, 0x3, 0x8, 0x50, 0x2d, 0xa, 0x30, 0x0, - 0x6, 0x30, 0xd4, 0x65, 0x6, 0xdb, 0xbb, 0xbd, - 0x90, 0x41, - /* U+611B "愛" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x47, 0xbc, 0x0, 0x1, 0x45, @@ -11135,21 +10950,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xc3, 0xc0, 0x0, 0x0, 0x0, 0x92, 0x0, 0x0, 0x0, 0x0, 0x0, - /* U+65E6 "旦" */ - 0x0, 0x0, 0x96, 0x66, 0x66, 0x6b, 0x20, 0x0, - 0x0, 0x0, 0xe0, 0x0, 0x0, 0xe, 0x0, 0x0, - 0x0, 0x0, 0xe0, 0x0, 0x0, 0xe, 0x0, 0x0, - 0x0, 0x0, 0xe0, 0x0, 0x0, 0xe, 0x0, 0x0, - 0x0, 0x0, 0xe6, 0x66, 0x66, 0x6e, 0x0, 0x0, - 0x0, 0x0, 0xe0, 0x0, 0x0, 0xe, 0x0, 0x0, - 0x0, 0x0, 0xe0, 0x0, 0x0, 0xe, 0x0, 0x0, - 0x0, 0x0, 0xe0, 0x0, 0x0, 0xe, 0x0, 0x0, - 0x0, 0x0, 0xf6, 0x66, 0x66, 0x6e, 0x0, 0x0, - 0x0, 0x0, 0xe0, 0x0, 0x0, 0xb, 0x0, 0x0, - 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xb, 0x30, - 0x7, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x50, - /* U+65E9 "早" */ 0x0, 0x0, 0x30, 0x0, 0x0, 0x4, 0x10, 0x0, 0x0, 0x0, 0xe6, 0x66, 0x66, 0x6c, 0x60, 0x0, @@ -12150,24 +11950,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0xd, 0x10, 0x0, 0x0, 0xe0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x60, 0x0, 0x0, - /* U+6811 "树" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xb, 0x30, 0x0, 0x0, 0x0, 0xb3, 0x0, - 0x0, 0xd, 0x10, 0x0, 0x0, 0x0, 0xe0, 0x0, - 0x0, 0xc, 0x12, 0x66, 0x6d, 0x10, 0xe0, 0x0, - 0x0, 0xc, 0x16, 0x0, 0x3b, 0x22, 0xe4, 0x70, - 0x16, 0x6e, 0x66, 0x20, 0x76, 0x44, 0xe4, 0x40, - 0x0, 0x1f, 0x10, 0x51, 0xb2, 0x0, 0xe0, 0x0, - 0x0, 0x5f, 0x94, 0x9, 0xc2, 0x40, 0xe0, 0x0, - 0x0, 0xae, 0x2e, 0x9, 0x80, 0xc1, 0xe0, 0x0, - 0x1, 0x9c, 0x13, 0xc, 0xd0, 0x85, 0xe0, 0x0, - 0x7, 0x1c, 0x10, 0x74, 0xa5, 0x21, 0xe0, 0x0, - 0x14, 0xc, 0x12, 0x70, 0x56, 0x0, 0xe0, 0x0, - 0x0, 0xd, 0x27, 0x0, 0x0, 0x0, 0xe0, 0x0, - 0x0, 0xd, 0x20, 0x0, 0x1, 0x10, 0xe0, 0x0, - 0x0, 0xd, 0x10, 0x0, 0x1, 0x7f, 0xd0, 0x0, - 0x0, 0x6, 0x0, 0x0, 0x0, 0x3, 0x10, 0x0, - /* U+6821 "校" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0x30, 0x0, 0xa, 0x10, 0x0, 0x0, @@ -12329,24 +12111,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x10, 0x0, 0xe0, 0x20, 0x0, 0xd0, 0x0, 0x0, 0x0, 0x0, 0x60, 0x0, 0x0, 0x60, 0x0, 0x0, - /* U+690D "植" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xc, 0x40, 0x0, 0x9, 0x40, 0x0, 0x0, - 0x0, 0xd, 0x10, 0x0, 0xb, 0x20, 0x1, 0x0, - 0x0, 0xd, 0x10, 0x76, 0x6d, 0x76, 0x7d, 0x30, - 0x4, 0x4d, 0x69, 0x0, 0xb, 0x10, 0x0, 0x0, - 0x3, 0x2e, 0x22, 0xa, 0x6c, 0x66, 0xb2, 0x0, - 0x0, 0x1f, 0x40, 0xd, 0x0, 0x0, 0xd0, 0x0, - 0x0, 0x6f, 0x7a, 0xe, 0x66, 0x66, 0xe0, 0x0, - 0x0, 0xad, 0x1a, 0xd, 0x0, 0x0, 0xd0, 0x0, - 0x2, 0x7d, 0x10, 0xd, 0x66, 0x66, 0xe0, 0x0, - 0x7, 0xd, 0x10, 0xd, 0x0, 0x0, 0xd0, 0x0, - 0x14, 0xd, 0x10, 0xd, 0x0, 0x0, 0xd0, 0x0, - 0x0, 0xd, 0x10, 0xd, 0x66, 0x66, 0xe0, 0x0, - 0x0, 0xd, 0x10, 0xd, 0x0, 0x0, 0xd3, 0x30, - 0x0, 0xd, 0x27, 0x67, 0x66, 0x66, 0x77, 0x70, - 0x0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - /* U+691C "検" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0x40, 0x0, 0x9, 0x90, 0x0, 0x0, @@ -15636,24 +15400,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x0, 0x0, 0x0, 0xd0, 0x0, 0x0, 0x40, 0x6, 0x76, 0x66, 0x66, 0xa6, 0x66, 0x66, 0xa5, - /* U+7AEF "端" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x41, 0x0, 0x2, 0x0, 0xb1, 0x0, 0x0, - 0x0, 0x1c, 0x0, 0xd, 0x10, 0xb0, 0xc, 0x20, - 0x0, 0x9, 0x0, 0xc, 0x0, 0xb0, 0xc, 0x0, - 0x5, 0x66, 0x6c, 0x2d, 0x66, 0xd6, 0x6d, 0x0, - 0x0, 0x0, 0x33, 0x4, 0x0, 0x0, 0x5, 0x0, - 0x1, 0x40, 0x78, 0x56, 0x66, 0x66, 0x66, 0xb1, - 0x0, 0x90, 0x92, 0x11, 0x6, 0x60, 0x0, 0x0, - 0x0, 0xb1, 0xa0, 0x12, 0x7, 0x0, 0x1, 0x40, - 0x0, 0xa1, 0x80, 0x2d, 0x6d, 0x6d, 0x6a, 0x90, - 0x0, 0x12, 0x41, 0x4b, 0xc, 0xc, 0x7, 0x60, - 0x0, 0x3a, 0x84, 0x1b, 0xc, 0xc, 0x7, 0x60, - 0xc, 0xa2, 0x0, 0x1b, 0xc, 0xc, 0x7, 0x60, - 0x0, 0x0, 0x0, 0x1b, 0xc, 0xb, 0x7, 0x60, - 0x0, 0x0, 0x0, 0x2b, 0x5, 0x2, 0x7d, 0x50, - 0x0, 0x0, 0x0, 0x12, 0x0, 0x0, 0x6, 0x0, - /* U+7B11 "笑" */ 0x0, 0x2, 0xa0, 0x0, 0x0, 0x91, 0x0, 0x0, 0x0, 0x8, 0x80, 0x4, 0x5, 0xc0, 0x3, 0x10, @@ -16861,23 +16607,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x6, 0x0, 0x89, 0x38, 0x10, 0xb, 0xbb, 0xb0, 0x10, 0x0, 0x1, 0x20, 0x0, 0x0, 0x0, 0x0, - /* U+814A "腊" */ - 0x0, 0x30, 0x4, 0x0, 0x76, 0xa, 0x30, 0x0, - 0x0, 0xd6, 0x6e, 0x10, 0x84, 0xc, 0x0, 0x0, - 0x0, 0xd0, 0xd, 0x26, 0xb8, 0x6d, 0x7c, 0x10, - 0x0, 0xd0, 0xd, 0x1, 0x84, 0xc, 0x0, 0x0, - 0x0, 0xd6, 0x6d, 0x0, 0x84, 0xc, 0x0, 0x0, - 0x0, 0xd0, 0xd, 0x46, 0xb8, 0x6d, 0x6b, 0x90, - 0x0, 0xd0, 0xd, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xd3, 0x3d, 0x4, 0x0, 0x0, 0x33, 0x0, - 0x0, 0xd3, 0x3d, 0xc, 0x66, 0x66, 0xa9, 0x0, - 0x0, 0xc0, 0xd, 0xc, 0x0, 0x0, 0x66, 0x0, - 0x0, 0xb0, 0xd, 0xc, 0x66, 0x66, 0xa6, 0x0, - 0x3, 0x80, 0xd, 0xc, 0x0, 0x0, 0x66, 0x0, - 0x7, 0x22, 0x1d, 0xc, 0x66, 0x66, 0xa6, 0x0, - 0x6, 0x3, 0xca, 0xd, 0x0, 0x0, 0x66, 0x0, - 0x10, 0x0, 0x10, 0x1, 0x0, 0x0, 0x0, 0x0, - /* U+8155 "腕" */ 0x0, 0x0, 0x0, 0x0, 0x1, 0x80, 0x0, 0x0, 0x0, 0xb6, 0x6d, 0x1, 0x0, 0x96, 0x0, 0x0, @@ -17150,23 +16879,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0xd, 0x0, 0x0, 0x0, 0x0, 0x2, 0xc1, 0x0, 0xa, 0xdc, 0xcc, 0xcc, 0xcc, 0xcd, 0xa0, - /* U+8282 "节" */ - 0x0, 0x0, 0x7, 0x20, 0x1, 0x80, 0x0, 0x0, - 0x0, 0x0, 0xb, 0x30, 0x1, 0xd0, 0x2, 0x0, - 0x26, 0x66, 0x6d, 0x76, 0x66, 0xe6, 0x6e, 0x90, - 0x1, 0x0, 0xb, 0x20, 0x1, 0xd0, 0x0, 0x0, - 0x0, 0x0, 0xa, 0x10, 0x0, 0x90, 0x0, 0x0, - 0x0, 0x56, 0x66, 0x66, 0x66, 0x66, 0xc1, 0x0, - 0x0, 0x10, 0x0, 0x77, 0x0, 0x1, 0xe0, 0x0, - 0x0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x0, 0x0, 0xa4, 0x66, 0x6, 0xc9, 0x64, - 0x22, 0x10, 0x0, 0x64, 0x0, 0x0, 0x59, 0xce, - 0xe3, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, - /* U+8C50 "豐" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0x10, 0xb0, 0xc2, 0xa, 0x3, 0x0, 0x0, @@ -18793,22 +18488,6 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x0, 0x3, 0x96, 0x0, 0x0, 0x3d, 0x70, 0x0, 0x0, 0x33, 0x0, 0x0, 0x0, 0x0, 0x60, 0x0, - /* U+8D39 "费" */ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0xc, 0x10, 0xc1, 0x0, 0x0, 0x3, 0x66, - 0x6e, 0x66, 0xe6, 0x6a, 0x30, 0x0, 0x10, 0xd, - 0x0, 0xd0, 0xb, 0x20, 0x2, 0xb6, 0x6e, 0x66, - 0xe6, 0x6d, 0x10, 0x6, 0x80, 0xd, 0x0, 0xd0, - 0x4, 0x22, 0x6, 0x76, 0xaa, 0x66, 0xe6, 0x66, - 0xc7, 0x0, 0x7, 0x70, 0x0, 0xd0, 0x18, 0xc0, - 0x15, 0x69, 0x66, 0x66, 0x86, 0x95, 0x10, 0x0, - 0xd, 0x0, 0x63, 0x0, 0xd1, 0x0, 0x0, 0xd, - 0x0, 0xc5, 0x0, 0xd0, 0x0, 0x0, 0xd, 0x0, - 0xf1, 0x0, 0xd0, 0x0, 0x0, 0x7, 0x7, 0xa2, - 0x63, 0x40, 0x0, 0x0, 0x0, 0x6c, 0x10, 0x17, - 0xe8, 0x0, 0x1, 0x58, 0x60, 0x0, 0x0, 0x2e, - 0x40, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - /* U+8D64 "赤" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0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 0xd0, 0x0, 0xb0, 0xc0, - 0x0, 0xd, 0xd, 0x24, 0x98, 0xc, 0x0, 0x0, - 0xd0, 0xd0, 0x8a, 0x0, 0xc0, 0x0, 0xd, 0xd, - 0x0, 0x0, 0xd, 0x66, 0x66, 0xd0, 0xd0, 0x0, - 0x0, 0xc0, 0x0, 0xd, 0xd, 0x0, 0x0, 0x6, - 0x0, 0x0, 0x60, 0x10, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, - /* U+9644 "附" */ 0x20, 0x3, 0x0, 0x73, 0x0, 0x82, 0x0, 0xe6, 0x6e, 0x10, 0xd1, 0x0, 0xd0, 0x0, 0xd0, 0x56, @@ -22452,6 +22100,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0x2f, 0xdd, 0xdd, 0x80, 0x0, 0x0, 0x0, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -22804,1094 +22453,1073 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 25018, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, {.bitmap_index = 25131, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, {.bitmap_index = 25251, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25371, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25491, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 25596, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 25716, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25836, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 25956, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 26076, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26204, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 26324, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26437, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26557, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 26661, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 26789, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 26902, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27022, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 25371, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 25476, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 25596, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 25716, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 25836, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 25956, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 26084, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 26204, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 26317, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 26437, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 26541, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 26669, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 26782, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 26902, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 27015, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, {.bitmap_index = 27135, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27255, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27375, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27503, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27623, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 27727, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 27825, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 27945, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28058, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 28170, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 28283, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 28396, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28524, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 28637, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28757, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 28877, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 28975, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 29088, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 29201, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 29314, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 29427, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 27255, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 27383, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 27503, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 27607, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 27705, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 27825, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 27938, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 28050, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 28163, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 28291, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 28404, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 28524, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 28644, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 28742, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 28855, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 28968, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 29081, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 29194, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 29322, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 29442, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, {.bitmap_index = 29555, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 29675, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 29675, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, {.bitmap_index = 29788, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 29908, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 30021, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 30141, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 30269, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 30397, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 30510, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 30622, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 30742, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 30847, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 30967, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31095, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31223, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31343, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31463, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31583, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31696, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31816, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 31944, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 32072, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 32192, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 32312, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 32432, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 32560, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 32688, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 32808, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 32920, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 33033, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 33146, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 33259, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 33364, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 33484, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 33604, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 33724, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 33852, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 33972, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34092, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34212, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 34325, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34445, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 34550, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 34670, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 34783, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 34888, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35001, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35121, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 35257, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 35393, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35513, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35633, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35761, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 35881, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36001, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36121, .adv_w = 256, .box_w = 11, .box_h = 13, .ofs_x = 3, .ofs_y = -1}, - {.bitmap_index = 36193, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 36313, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36433, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 36538, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 36636, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 36741, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 36861, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 36965, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37093, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37213, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 37318, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 37416, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 37521, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37649, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37777, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 37875, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 37987, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 38091, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 38196, .adv_w = 256, .box_w = 15, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 38294, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 38407, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 38512, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 29908, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 30036, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 30164, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 30277, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 30389, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 30509, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 30614, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 30734, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 30862, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 30990, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 31110, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 31230, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 31350, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 31470, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 31598, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 31718, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 31838, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 31958, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 32086, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 32214, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 32334, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 32446, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 32559, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 32672, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 32785, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 32890, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 33010, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 33130, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 33250, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 33378, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 33498, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 33618, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 33738, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 33851, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 33971, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 34076, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 34196, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 34309, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 34414, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 34527, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 34647, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 34783, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 34919, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 35039, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 35159, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 35287, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 35407, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 35527, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 35647, .adv_w = 256, .box_w = 11, .box_h = 13, .ofs_x = 3, .ofs_y = -1}, + {.bitmap_index = 35719, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 35839, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 35959, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 36064, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 36162, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 36267, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 36387, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 36491, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 36619, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 36739, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 36844, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 36942, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 37047, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 37175, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 37303, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 37401, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 37513, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 37617, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 37722, .adv_w = 256, .box_w = 15, .box_h = 13, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 37820, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 37933, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 38038, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 38143, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 38256, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 38376, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 38489, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, {.bitmap_index = 38617, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, {.bitmap_index = 38730, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 38850, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 38963, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39091, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39204, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 39324, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 39429, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 39533, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 39646, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 39766, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 39879, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 39984, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 40097, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 40225, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 40338, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 40466, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 40571, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 40691, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 40804, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 40917, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 41022, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 41142, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 41262, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 41360, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 41458, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 41563, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 41661, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 41781, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 41879, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 41999, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 42111, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 42223, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 42335, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 42447, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 42559, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42687, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 42799, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 42912, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43025, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 43137, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 43249, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43377, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43505, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43633, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43753, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 43881, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44009, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44137, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44265, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44385, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44505, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44633, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44761, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 44866, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 44986, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45099, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45212, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45332, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 45437, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45550, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 45662, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45790, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 45910, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46038, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46158, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46286, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46406, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46526, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46646, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46774, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 46894, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47022, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 47135, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47263, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47383, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47496, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47616, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47744, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 47872, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 48008, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48128, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48256, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48384, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48504, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48632, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48760, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 48888, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49016, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49136, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49256, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49376, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49496, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49624, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49752, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 49872, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 49985, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50105, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50225, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50353, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 50458, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 50578, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 50698, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50818, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 50946, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 51066, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 51186, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 51299, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 51412, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 51532, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 51652, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 51780, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 51900, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 52012, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 52117, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52245, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 52365, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52485, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52605, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52725, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 52837, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 52957, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53085, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 53205, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 53325, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53445, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53573, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53693, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53821, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 53941, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 54061, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54189, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54309, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 54414, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54527, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 54631, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54751, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54879, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 54999, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55112, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55232, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55345, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55465, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55578, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55698, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 55818, .adv_w = 256, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 55909, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 56029, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 56149, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 56247, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 56352, .adv_w = 256, .box_w = 15, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 56450, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 56555, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 56675, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 56773, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 56871, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 56991, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57111, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 57224, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57352, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 57472, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57592, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57720, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 57840, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 57953, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58073, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 58185, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 58290, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58410, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58538, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58666, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58794, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 58907, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59035, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59163, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59283, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59411, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59531, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59651, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59771, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 59899, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60027, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60155, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60283, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60403, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 60523, .adv_w = 256, .box_w = 12, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 60613, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 60725, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60838, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 60958, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 61086, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 61191, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 61311, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 61431, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 61559, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 61679, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 61799, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 61919, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62039, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62167, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62287, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62407, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62535, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62663, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62783, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 62903, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63031, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 63136, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 63241, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 63354, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63474, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63602, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 63730, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 63842, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 63962, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64082, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64195, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 64308, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 64436, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 64541, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 64654, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 64759, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 64879, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65007, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 65127, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 65240, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 65353, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 65451, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 65563, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65691, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 65796, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 65916, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 66029, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 66165, .adv_w = 256, .box_w = 15, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 66293, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 66405, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66525, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66653, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 66773, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 66893, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 67029, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67149, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67269, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67389, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67509, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67637, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67757, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 67877, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 68013, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68141, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68269, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68389, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68509, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68629, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68749, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68862, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 68982, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69110, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69238, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69358, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69478, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 69591, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69711, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69839, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 69967, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70095, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70223, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70343, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70463, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70591, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70719, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70839, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 70952, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71072, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71200, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71328, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71456, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71576, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71696, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71816, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 71936, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72064, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72192, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72305, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 72418, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72546, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72674, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 72794, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 72907, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73027, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73155, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73283, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73411, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73539, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73659, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 73787, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 73900, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74020, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74140, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74260, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74380, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74508, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74628, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74748, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 74868, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 74981, .adv_w = 256, .box_w = 10, .box_h = 15, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 75056, .adv_w = 256, .box_w = 16, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 75160, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75280, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 75392, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75505, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 75603, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 75708, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 75836, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 75941, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 76046, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76174, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 76294, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76407, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 76519, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 76624, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 76744, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76872, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 76992, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 77104, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 77224, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 77337, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 77457, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 77562, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 77674, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 77786, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 77891, .adv_w = 256, .box_w = 12, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 77987, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 78107, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 78227, .adv_w = 256, .box_w = 12, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 78323, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 78435, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 78563, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 78691, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 78789, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 78917, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79030, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79150, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 79263, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79383, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79503, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79623, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79736, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79849, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 79977, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 80105, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 80233, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 80361, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 80489, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 80609, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 80737, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 80865, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 80993, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81113, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81233, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81361, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81474, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81602, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81730, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81850, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 81978, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82106, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82234, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82362, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82490, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82610, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82738, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82866, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 82994, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83122, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83250, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83378, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83506, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83634, .adv_w = 256, .box_w = 15, .box_h = 17, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 83762, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 83890, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84018, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84138, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84266, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84394, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84522, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84650, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84770, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 84898, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85026, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85154, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85282, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85410, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 85546, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 85666, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85786, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 85914, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86042, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86170, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 86282, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 86394, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86522, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 86642, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86770, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 86898, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87026, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87154, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87274, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87394, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87522, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87650, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87770, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 87890, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88018, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88146, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 88244, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 88356, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 88461, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 88574, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88702, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88830, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 88958, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89078, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89198, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89326, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89446, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89559, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 89679, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89799, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 89919, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90039, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 90152, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90272, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 90377, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90505, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90633, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90761, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90874, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 90987, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91115, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91235, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91348, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91468, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91588, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91716, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 91836, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 91956, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92084, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 92196, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92316, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92429, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 92541, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92661, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 92774, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 92894, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93014, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93142, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93262, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93382, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93510, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93623, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93743, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93863, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 93991, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 94111, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94239, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94367, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94495, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94623, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94751, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94879, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 94999, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 95111, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95239, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 95351, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95479, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95599, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95712, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 95832, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 95945, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96065, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 96177, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 96289, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 96409, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96529, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96657, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96785, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 96913, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97033, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97153, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97281, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97401, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97529, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97649, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97769, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 97889, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98009, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98129, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98257, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 98369, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98489, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98602, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98722, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 98842, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 98962, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 99082, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 99195, .adv_w = 256, .box_w = 13, .box_h = 14, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 99286, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 99384, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 99488, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 99586, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 99691, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 99804, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 99909, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100029, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 100134, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100262, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100382, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100495, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 100607, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100735, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100855, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 100983, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 101096, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 101216, .adv_w = 256, .box_w = 12, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 101306, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 101419, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 101523, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 101628, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 101724, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 101844, .adv_w = 256, .box_w = 11, .box_h = 15, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 101927, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 102047, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102167, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102295, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102423, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 102536, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 102641, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 102761, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 102874, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 102994, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103114, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103242, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103362, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103482, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103610, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103730, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103843, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 103963, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104083, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104203, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104323, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104451, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104571, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104699, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104819, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 104947, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105075, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105195, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105315, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105435, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105555, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105675, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 105803, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 105923, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106036, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 106149, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 106269, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106389, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 106509, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106637, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106757, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106885, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 106998, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107126, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107254, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107382, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107502, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107630, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107750, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 107870, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 107990, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108110, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108238, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108366, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108494, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108614, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 108726, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108839, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 108952, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 109072, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 109192, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 109305, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 109425, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 109545, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 109657, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 109777, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 109905, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 110025, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 110145, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 110265, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 110385, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 110513, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 110633, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 110753, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 110873, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111001, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111129, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111257, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111377, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111505, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 111610, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111738, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111866, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 111994, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112114, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112242, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 112362, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112490, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112610, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 112730, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 112866, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 112964, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113084, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113212, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113332, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113445, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113565, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 113678, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113806, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 113934, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114054, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114182, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 114286, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114398, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114518, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 114623, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114743, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 114871, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 114984, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115104, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115224, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115344, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115457, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115577, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115705, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 115833, .adv_w = 256, .box_w = 11, .box_h = 15, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 115916, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 116021, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116149, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116269, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116382, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116510, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116638, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116766, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 116894, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 116998, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 117118, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 117238, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 117358, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 117486, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 117614, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 117734, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 117854, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 117974, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 118087, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 118200, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 118320, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 118448, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 118576, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 118704, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 118824, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 118952, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 119080, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 119208, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 119336, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 119449, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 119569, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 119697, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 119825, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 119937, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120065, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120193, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120313, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120441, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120554, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120674, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120794, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 120914, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 121034, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 121154, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 121274, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 121402, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 121522, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 121642, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 121762, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 121890, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 122002, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 122122, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 122242, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 122362, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 122490, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 122610, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 122730, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 122858, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 122971, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 123099, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 123219, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 123339, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 123452, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 123572, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 123692, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 123820, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 123940, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 124060, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 124188, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 124308, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 124428, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 124556, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 124684, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 124812, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 124940, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 125060, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 125180, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 125308, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 125428, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 125556, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 125684, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 125804, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 125924, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 126052, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 126172, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 126300, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 126428, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 126564, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 126692, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 126805, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 126918, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 127038, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 127158, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 127270, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 127390, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 127503, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 127623, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 127743, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 127841, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 127961, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 128081, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 128193, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 128313, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 128433, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 128538, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 128666, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 128778, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 128898, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 129026, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 129162, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 129298, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 129418, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 129538, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 129666, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 129786, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 129914, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 130034, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 130154, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 130282, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 130410, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 130538, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 130666, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 130794, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 130922, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 131050, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 131178, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 131291, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 131419, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 131547, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 131675, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 131795, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 131915, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 132027, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 132147, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 132267, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 132379, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 132507, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 132619, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 132739, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 132859, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 132979, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 133099, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 133219, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 133339, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 133459, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 133579, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 133691, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 133811, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 133931, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 134051, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 134171, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 134291, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 134411, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 134531, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 134651, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 134779, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 134907, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 135027, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 135155, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 135275, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 135403, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 135523, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 135651, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 135764, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 135884, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 136004, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 136117, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 136245, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 136365, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 136485, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 136613, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 136741, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 136861, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 136966, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 137086, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 137206, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 137334, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 137462, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 137582, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 137702, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 137814, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 137942, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 138062, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 138182, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 138302, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 138400, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 138498, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 138602, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 138700, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 138798, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 138903, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 139001, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 139106, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 139218, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 139331, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 139444, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 139556, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 139669, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 139774, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 139887, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 140007, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 140112, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 140225, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 140345, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 140465, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 140593, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 140713, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 140826, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 140954, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 141067, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 141195, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 141300, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 141413, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 141525, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 141630, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 141743, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 141863, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 141991, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 142119, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 142239, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 142359, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 142479, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 142607, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 142727, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 142839, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 142952, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 143072, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 143185, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 143305, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 143425, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 143538, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 143658, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 143778, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 143898, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 144018, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 144138, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 144258, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 144378, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 144498, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 144626, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 144746, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 144866, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 144986, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 145114, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 145234, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 145362, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 145482, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 145602, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 145730, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 145858, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 145978, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 146098, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 146226, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 146346, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 146466, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 146586, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 146706, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 146826, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 146931, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 147051, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 147179, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 147307, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 147427, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 147563, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 147659, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 147771, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 147867, .adv_w = 176, .box_w = 11, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 147933, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 148061, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 148189, .adv_w = 288, .box_w = 18, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 148315, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 148443, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 148551, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 148679, .adv_w = 128, .box_w = 8, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 148735, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 148819, .adv_w = 288, .box_w = 18, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 148963, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 149059, .adv_w = 176, .box_w = 11, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 149147, .adv_w = 224, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 149227, .adv_w = 224, .box_w = 14, .box_h = 18, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 149353, .adv_w = 224, .box_w = 14, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 149458, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 149556, .adv_w = 224, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 149636, .adv_w = 224, .box_w = 16, .box_h = 14, .ofs_x = -1, .ofs_y = -1}, - {.bitmap_index = 149748, .adv_w = 160, .box_w = 10, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 149818, .adv_w = 160, .box_w = 10, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 149888, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 149986, .adv_w = 224, .box_w = 14, .box_h = 4, .ofs_x = 0, .ofs_y = 4}, - {.bitmap_index = 150014, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 150122, .adv_w = 320, .box_w = 20, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 150282, .adv_w = 288, .box_w = 20, .box_h = 16, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 150442, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 150570, .adv_w = 224, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 150640, .adv_w = 224, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 150710, .adv_w = 320, .box_w = 20, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 150850, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 150946, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 151074, .adv_w = 256, .box_w = 17, .box_h = 17, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 151219, .adv_w = 224, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 151324, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 151436, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 151534, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 151632, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 151728, .adv_w = 160, .box_w = 12, .box_h = 16, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 151824, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 151936, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 152048, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 152156, .adv_w = 256, .box_w = 18, .box_h = 18, .ofs_x = -1, .ofs_y = -3}, - {.bitmap_index = 152318, .adv_w = 192, .box_w = 12, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 152414, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 152564, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 152664, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 152764, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 152864, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 152964, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 153064, .adv_w = 320, .box_w = 21, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 153211, .adv_w = 224, .box_w = 12, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 153307, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 153419, .adv_w = 256, .box_w = 17, .box_h = 17, .ofs_x = -1, .ofs_y = -3}, - {.bitmap_index = 153564, .adv_w = 320, .box_w = 20, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 153684, .adv_w = 192, .box_w = 12, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 153780, .adv_w = 258, .box_w = 17, .box_h = 11, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 153874, .adv_w = 256, .box_w = 5, .box_h = 14, .ofs_x = 9, .ofs_y = -1}, - {.bitmap_index = 153909, .adv_w = 256, .box_w = 5, .box_h = 14, .ofs_x = 2, .ofs_y = -1}, - {.bitmap_index = 153944, .adv_w = 256, .box_w = 4, .box_h = 5, .ofs_x = 1, .ofs_y = -1}, - {.bitmap_index = 153954, .adv_w = 256, .box_w = 6, .box_h = 11, .ofs_x = 5, .ofs_y = 0}, - {.bitmap_index = 153987, .adv_w = 256, .box_w = 8, .box_h = 12, .ofs_x = 4, .ofs_y = 0} + {.bitmap_index = 38850, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 38955, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 39059, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 39172, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 39292, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 39405, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 39510, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 39623, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 39751, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 39864, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 39992, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 40097, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 40217, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 40330, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 40443, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 40548, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 40668, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 40788, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 40886, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 40984, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 41089, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 41187, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 41307, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 41405, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 41525, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 41637, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 41749, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 41861, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 41973, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 42101, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 42213, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 42326, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 42439, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 42551, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 42663, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 42791, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 42919, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 43047, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 43167, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 43295, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 43423, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 43551, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 43679, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 43799, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 43919, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 44047, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 44175, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 44280, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 44400, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 44513, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 44626, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 44746, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 44851, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 44964, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 45076, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 45204, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 45324, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 45452, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 45572, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 45700, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 45820, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 45940, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 46060, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 46188, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 46308, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 46436, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 46549, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 46677, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 46797, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 46910, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 47038, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 47166, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 47302, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 47422, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 47550, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 47678, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 47798, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 47926, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 48054, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 48182, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 48310, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 48430, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 48550, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 48670, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 48790, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 48918, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 49046, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 49166, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 49279, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 49399, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 49519, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 49647, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 49752, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 49872, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 49992, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 50112, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 50240, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 50360, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 50480, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 50593, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 50706, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 50826, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 50946, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 51074, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 51194, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 51306, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 51434, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 51554, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 51674, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 51794, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 51914, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 52026, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 52146, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 52274, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 52394, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 52514, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 52634, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 52762, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 52882, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 53010, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 53130, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 53250, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 53378, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 53498, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 53603, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 53716, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 53820, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 53940, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 54068, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 54188, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 54301, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 54421, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 54534, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 54654, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 54767, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 54887, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 55007, .adv_w = 256, .box_w = 13, .box_h = 14, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 55098, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 55218, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 55338, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 55436, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 55541, .adv_w = 256, .box_w = 15, .box_h = 13, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 55639, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 55744, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 55864, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 2, .ofs_y = -1}, + {.bitmap_index = 55962, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 2, .ofs_y = -1}, + {.bitmap_index = 56060, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 56180, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 56300, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 56428, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 56548, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 56668, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 56796, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 56916, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 57029, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 57149, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 57261, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 57366, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 57486, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 57614, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 57742, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 57870, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 57983, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 58111, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 58231, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 58359, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 58479, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 58599, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 58719, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 58847, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 58975, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 59103, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 59231, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 59351, .adv_w = 256, .box_w = 12, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 59441, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 59553, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 59666, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 59786, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 59914, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 60019, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60139, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60259, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60387, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60507, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60627, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60747, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60867, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 60995, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 61115, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 61235, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 61363, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 61491, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 61611, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 61731, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 61859, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 61964, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 62069, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 62182, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 62302, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 62430, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 62558, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 62670, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 62790, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 62910, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 63023, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 63136, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 63264, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 63369, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 63482, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 63587, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 63707, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 63835, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 63955, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 64068, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 64181, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 64293, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 64421, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 64526, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 64646, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 64759, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 64895, .adv_w = 256, .box_w = 15, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 65023, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 65135, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 65255, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 65383, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 65503, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 65623, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 65759, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 65879, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 65999, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 66119, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 66239, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 66367, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 66487, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 66607, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 66743, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 66871, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 66999, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 67119, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 67239, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 67359, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 67479, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 67592, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 67712, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 67840, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 67968, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 68088, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 68208, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 68321, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 68441, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 68569, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 68697, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 68825, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 68953, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 69073, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 69193, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 69321, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 69449, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 69569, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 69682, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 69802, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 69930, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 70058, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 70186, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 70306, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 70426, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 70546, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 70666, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 70794, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 70922, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 71035, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 71148, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 71276, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 71404, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 71524, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 71637, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 71757, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 71885, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 72013, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 72141, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 72269, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 72389, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 72517, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 72630, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 72750, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 72870, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 72990, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 73110, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 73238, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 73358, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 73478, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 73598, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 73711, .adv_w = 256, .box_w = 10, .box_h = 15, .ofs_x = 3, .ofs_y = -2}, + {.bitmap_index = 73786, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 73906, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 74018, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 74131, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 74229, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 74334, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 74462, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 74567, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 74672, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 74800, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 74920, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 75033, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 75145, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 75250, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 75370, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 75498, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 75618, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 75730, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 75850, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 75963, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 76083, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 76188, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 76300, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 76412, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 76517, .adv_w = 256, .box_w = 12, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 76613, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 76733, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 76853, .adv_w = 256, .box_w = 12, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 76949, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 77061, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 77189, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 77317, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 77415, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 77543, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 77656, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 77776, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 77889, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 78009, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 78129, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 78249, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 78362, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 78475, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 78603, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 78731, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 78859, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 78987, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 79115, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 79235, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 79363, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 79491, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 79619, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 79739, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 79859, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 79987, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 80100, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 80228, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 80356, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 80476, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 80604, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 80732, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 80860, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 80988, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 81108, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 81236, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 81364, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 81492, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 81620, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 81748, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 81876, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 82004, .adv_w = 256, .box_w = 15, .box_h = 17, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 82132, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 82260, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 82388, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 82508, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 82636, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 82764, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 82892, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 83020, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 83140, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 83268, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 83396, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 83524, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 83652, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 83780, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 83916, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 84036, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 84156, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 84284, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 84412, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 84540, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 84652, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 84764, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 84892, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 85012, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 85140, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 85268, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 85396, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 85524, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 85644, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 85764, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 85892, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 86020, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 86140, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 86260, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 86388, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 86516, .adv_w = 256, .box_w = 14, .box_h = 14, .ofs_x = 2, .ofs_y = -1}, + {.bitmap_index = 86614, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 86726, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 86831, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 86944, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 87072, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 87200, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 87328, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 87448, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 87568, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 87696, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 87816, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 87929, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 88049, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 88169, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 88289, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 88409, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 88522, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 88642, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 88747, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 88875, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 89003, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 89131, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 89244, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 89357, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 89485, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 89605, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 89718, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 89838, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 89958, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 90086, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 90206, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 90326, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 90454, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 90566, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 90686, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 90799, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 90911, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 91031, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 91144, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 91264, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 91384, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 91512, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 91632, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 91752, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 91880, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 91993, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 92113, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 92233, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 92361, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 92481, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 92609, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 92737, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 92865, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 92993, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 93121, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 93249, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 93369, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 93481, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 93609, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 93721, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 93849, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 93969, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 94082, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 94202, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 94315, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 94435, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 94547, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 94659, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 94779, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 94899, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 95027, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 95155, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 95283, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 95403, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 95523, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 95651, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 95771, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 95899, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 96019, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 96139, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 96259, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 96379, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 96499, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 96627, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 96739, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 96859, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 96972, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 97092, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 97212, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 97332, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 97452, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 97565, .adv_w = 256, .box_w = 13, .box_h = 14, .ofs_x = 2, .ofs_y = -1}, + {.bitmap_index = 97656, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 97754, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 97858, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -1}, + {.bitmap_index = 97956, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 98061, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 98174, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 98279, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 98399, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 98504, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 98632, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 98752, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 98865, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 98977, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 99105, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 99225, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 99353, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 99466, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 99586, .adv_w = 256, .box_w = 12, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 99676, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 99789, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 99893, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 99998, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 100094, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 100214, .adv_w = 256, .box_w = 11, .box_h = 15, .ofs_x = 3, .ofs_y = -2}, + {.bitmap_index = 100297, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 100417, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 100537, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 100665, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 100793, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 100906, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 101011, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 101131, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 101244, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 101364, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 101484, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 101612, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 101732, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 101852, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 101980, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 102100, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 102213, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 102333, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 102453, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 102573, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 102693, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 102821, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 102941, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 103069, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 103189, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 103317, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 103445, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 103565, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 103685, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 103805, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 103925, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 104045, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 104173, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 104293, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 104406, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 104519, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 104639, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 104759, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 104879, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 104999, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 105127, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 105240, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 105368, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 105496, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 105624, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 105744, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 105872, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 105992, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 106112, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 106232, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 106352, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 106480, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 106608, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 106736, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 106856, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 106968, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 107081, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 107194, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 107314, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 107434, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 107547, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 107667, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 107787, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 107899, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 108019, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 108147, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 108267, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 108387, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 108507, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 108627, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 108755, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 108875, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 108995, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 109115, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 109243, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 109371, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 109499, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 109619, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 109747, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 109852, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 109980, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 110108, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 110236, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 110356, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 110484, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 110604, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 110732, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 110852, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 110972, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 111108, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 111206, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 111326, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 111454, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 111574, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 111687, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 111807, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 111920, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 112048, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 112176, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 112296, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 112424, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 112528, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 112640, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 112760, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 112865, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 112985, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 113113, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 113226, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 113346, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 113466, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 113579, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 113699, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 113827, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 113955, .adv_w = 256, .box_w = 11, .box_h = 15, .ofs_x = 3, .ofs_y = -2}, + {.bitmap_index = 114038, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 114143, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 114271, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 114391, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 114504, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 114632, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 114760, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 114888, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 115016, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 115120, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 115240, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 115360, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 115488, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 115616, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 115736, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 115856, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 115976, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 116089, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 116202, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 116322, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 116450, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 116578, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 116706, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 116826, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 116954, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 117082, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 117210, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 117338, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 117451, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 117571, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 117699, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 117827, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 117939, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 118067, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 118195, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 118315, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 118443, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 118556, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 118676, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 118796, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 118916, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 119036, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 119156, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 119276, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 119404, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 119524, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 119644, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 119764, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 119892, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 120004, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 120124, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 120244, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 120364, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 120492, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 120612, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 120732, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 120860, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 120973, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 121101, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 121221, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 121341, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 121454, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 121574, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 121694, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 121822, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 121942, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 122062, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 122190, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 122310, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 122430, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 122558, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 122686, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 122814, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 122942, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 123062, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 123182, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 123310, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 123430, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 123558, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 123686, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 123806, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 123926, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 124054, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 124174, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 124302, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 124430, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 124566, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 124694, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 124807, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 124927, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 125047, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 125159, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 125279, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 125392, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 125512, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 125632, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 125730, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 125850, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 125970, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 126082, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 126202, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 126322, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 126427, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 126555, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 126675, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 126803, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 126939, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 127075, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 127195, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 127315, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 127443, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 127563, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 127691, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 127811, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 127931, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 128059, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 128187, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 128315, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 128443, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 128571, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 128699, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 128827, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 128955, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 129068, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 129196, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 129324, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 129452, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 129572, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 129692, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 129804, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 129924, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 130044, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 130156, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 130284, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 130396, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 130516, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 130636, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 130756, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 130876, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 130996, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 131116, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 131236, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 131356, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 131468, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 131588, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 131708, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 131828, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 131948, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 132068, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 132188, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 132308, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 132428, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 132556, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 132684, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 132804, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 132932, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 133052, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 133180, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 133300, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 133428, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 133541, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 133661, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 133781, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 133894, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 134022, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 134142, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 134262, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 134390, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 134518, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 134638, .adv_w = 256, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 134743, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 134863, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 134983, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 135111, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 135239, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 135359, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 135479, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 135591, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 135719, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 135839, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 135959, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 136079, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 136177, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 136275, .adv_w = 256, .box_w = 13, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 136379, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 136477, .adv_w = 256, .box_w = 13, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 136575, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 136680, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 136792, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 136905, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 137018, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 137130, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 137243, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 137348, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 137461, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 137581, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 137686, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 137799, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 137919, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 138039, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 138167, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 138287, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 138400, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 138528, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 138641, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 138769, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 138874, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 138987, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 139099, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 139204, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 139317, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 139437, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 139565, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 139693, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 139813, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 139933, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 140053, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 140181, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 140301, .adv_w = 256, .box_w = 14, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 140413, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 140526, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 140646, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 140759, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 140879, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 140999, .adv_w = 256, .box_w = 15, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 141112, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 141232, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 141352, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 141472, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 141592, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 141712, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 141832, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 141952, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 142072, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 142200, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 142320, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 142440, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 142560, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 142688, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 142808, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 142936, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 143056, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 143176, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 143304, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 143432, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 143552, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 143672, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 143800, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 143920, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 144040, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 144160, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 144280, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 144400, .adv_w = 256, .box_w = 14, .box_h = 15, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 144505, .adv_w = 256, .box_w = 16, .box_h = 15, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 144625, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 144753, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 144881, .adv_w = 256, .box_w = 15, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 145001, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 145137, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 145233, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 145345, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 145441, .adv_w = 176, .box_w = 11, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 145507, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 145635, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 145763, .adv_w = 288, .box_w = 18, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 145889, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 146017, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 146125, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 146253, .adv_w = 128, .box_w = 8, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 146309, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 146393, .adv_w = 288, .box_w = 18, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 146537, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 146633, .adv_w = 176, .box_w = 11, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 146721, .adv_w = 224, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 146801, .adv_w = 224, .box_w = 14, .box_h = 18, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 146927, .adv_w = 224, .box_w = 14, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 147032, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 147130, .adv_w = 224, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 147210, .adv_w = 224, .box_w = 16, .box_h = 14, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 147322, .adv_w = 160, .box_w = 10, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 147392, .adv_w = 160, .box_w = 10, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 147462, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 147560, .adv_w = 224, .box_w = 14, .box_h = 4, .ofs_x = 0, .ofs_y = 4}, + {.bitmap_index = 147588, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 147696, .adv_w = 320, .box_w = 20, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 147856, .adv_w = 288, .box_w = 20, .box_h = 16, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 148016, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 148144, .adv_w = 224, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 148214, .adv_w = 224, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 148284, .adv_w = 320, .box_w = 20, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 148424, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 148520, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 148648, .adv_w = 256, .box_w = 17, .box_h = 17, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 148793, .adv_w = 224, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 148898, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 149010, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 149108, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 149206, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 149302, .adv_w = 160, .box_w = 12, .box_h = 16, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 149398, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 149510, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 149622, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 149730, .adv_w = 256, .box_w = 18, .box_h = 18, .ofs_x = -1, .ofs_y = -3}, + {.bitmap_index = 149892, .adv_w = 192, .box_w = 12, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 149988, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 150138, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 150238, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 150338, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 150438, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 150538, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 150638, .adv_w = 320, .box_w = 21, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 150785, .adv_w = 224, .box_w = 12, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 150881, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 150993, .adv_w = 256, .box_w = 17, .box_h = 17, .ofs_x = -1, .ofs_y = -3}, + {.bitmap_index = 151138, .adv_w = 320, .box_w = 20, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 151258, .adv_w = 192, .box_w = 12, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 151354, .adv_w = 258, .box_w = 17, .box_h = 11, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 151448, .adv_w = 256, .box_w = 5, .box_h = 14, .ofs_x = 9, .ofs_y = -1}, + {.bitmap_index = 151483, .adv_w = 256, .box_w = 5, .box_h = 14, .ofs_x = 2, .ofs_y = -1}, + {.bitmap_index = 151518, .adv_w = 256, .box_w = 4, .box_h = 5, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 151528, .adv_w = 256, .box_w = 6, .box_h = 11, .ofs_x = 5, .ofs_y = 0}, + {.bitmap_index = 151561, .adv_w = 256, .box_w = 8, .box_h = 12, .ofs_x = 4, .ofs_y = 0} }; /*--------------------- @@ -23931,143 +23559,140 @@ static const uint16_t unicode_list_5[] = { 0x1eae, 0x1eb2, 0x1ed0, 0x1ed3, 0x1eee, 0x1ef2, 0x1eff, 0x1f1c, 0x1f22, 0x1f2a, 0x1f30, 0x1f35, 0x1f4d, 0x1f6b, 0x1f6d, 0x1f76, 0x1f85, 0x1faa, 0x1fc4, 0x1fd6, 0x1fde, 0x1fe0, 0x1fe6, 0x200a, - 0x2015, 0x203b, 0x2050, 0x2054, 0x2055, 0x2056, 0x2059, 0x205a, - 0x205c, 0x205e, 0x2063, 0x206b, 0x2076, 0x2078, 0x2079, 0x207a, - 0x207c, 0x207d, 0x207e, 0x2082, 0x2087, 0x2088, 0x2096, 0x2097, - 0x209b, 0x209e, 0x20aa, 0x20ac, 0x20bd, 0x20c8, 0x20de, 0x20ee, - 0x20f7, 0x210b, 0x2117, 0x2118, 0x211b, 0x2128, 0x212e, 0x2135, - 0x2136, 0x213a, 0x2141, 0x2147, 0x2149, 0x214c, 0x2158, 0x215b, - 0x215e, 0x216c, 0x2183, 0x2186, 0x2194, 0x21ac, 0x21b0, 0x21b1, - 0x21b9, 0x21ba, 0x21bb, 0x21c4, 0x21da, 0x21e6, 0x21ea, 0x21ee, - 0x21f5, 0x2206, 0x2216, 0x2227, 0x2228, 0x224c, 0x2251, 0x2252, - 0x2254, 0x2259, 0x225b, 0x2263, 0x2265, 0x2268, 0x2269, 0x2282, - 0x2284, 0x228c, 0x22ab, 0x22b0, 0x22c4, 0x22cc, 0x22d3, 0x22d4, - 0x22d9, 0x22db, 0x22dc, 0x22de, 0x22e7, 0x22e8, 0x22f4, 0x22f5, - 0x22f6, 0x22f7, 0x22fb, 0x22fc, 0x2300, 0x2301, 0x2303, 0x2304, - 0x2308, 0x2309, 0x2314, 0x2315, 0x2319, 0x231d, 0x231e, 0x2322, - 0x2337, 0x2338, 0x2351, 0x235b, 0x2373, 0x2379, 0x2384, 0x238d, - 0x238e, 0x239d, 0x23c3, 0x23d2, 0x23f2, 0x23fb, 0x2457, 0x245b, - 0x2460, 0x2477, 0x2495, 0x249a, 0x24ad, 0x24ae, 0x24bf, 0x24c7, - 0x24df, 0x2500, 0x252c, 0x25c5, 0x25ec, 0x25ef, 0x25f1, 0x2601, - 0x2604, 0x260e, 0x261c, 0x261e, 0x2623, 0x2629, 0x2630, 0x2634, - 0x2639, 0x2641, 0x2658, 0x265b, 0x2661, 0x269c, 0x26f0, 0x2708, - 0x270b, 0x2742, 0x2745, 0x275b, 0x277a, 0x2794, 0x27a8, 0x27af, - 0x27db, 0x27e4, 0x27fc, 0x2801, 0x2803, 0x281a, 0x2820, 0x2826, - 0x2827, 0x282b, 0x282d, 0x2831, 0x2838, 0x283a, 0x283b, 0x283c, - 0x283f, 0x2842, 0x2858, 0x2862, 0x2868, 0x2884, 0x288a, 0x288e, - 0x2893, 0x2898, 0x28c4, 0x28ca, 0x28cc, 0x28da, 0x28dc, 0x28e1, - 0x28e5, 0x2929, 0x296b, 0x2977, 0x29a3, 0x29ce, 0x29dd, 0x2a1a, - 0x2a61, 0x2a68, 0x2a69, 0x2a74, 0x2a77, 0x2a7a, 0x2a7c, 0x2a89, - 0x2a94, 0x2a96, 0x2a98, 0x2a99, 0x2a9a, 0x2a9d, 0x2aa9, 0x2aaa, - 0x2aab, 0x2aaf, 0x2ab0, 0x2ab3, 0x2ab5, 0x2ac4, 0x2ac6, 0x2ac7, - 0x2aca, 0x2ad0, 0x2ad5, 0x2ad7, 0x2add, 0x2ae3, 0x2aee, 0x2af0, - 0x2af7, 0x2afc, 0x2b0b, 0x2b0f, 0x2b15, 0x2b18, 0x2b19, 0x2b1e, - 0x2b1f, 0x2b20, 0x2b22, 0x2b2b, 0x2b35, 0x2b42, 0x2b4b, 0x2b51, - 0x2b56, 0x2b5b, 0x2b5c, 0x2b66, 0x2b76, 0x2b7d, 0x2b82, 0x2c07, - 0x2c5d, 0x2cee, 0x2cef, 0x2cf6, 0x2cf7, 0x2cff, 0x2d02, 0x2d03, - 0x2d13, 0x2d14, 0x2d19, 0x2d1d, 0x2d3c, 0x2d3e, 0x2d40, 0x2d41, + 0x2015, 0x203b, 0x2054, 0x2055, 0x2056, 0x2059, 0x205a, 0x205c, + 0x205e, 0x2063, 0x206b, 0x2076, 0x2078, 0x2079, 0x207a, 0x207c, + 0x207d, 0x207e, 0x2082, 0x2087, 0x2088, 0x2096, 0x2097, 0x209b, + 0x209e, 0x20aa, 0x20bd, 0x20c8, 0x20de, 0x20ee, 0x20f7, 0x210b, + 0x2117, 0x2118, 0x211b, 0x2128, 0x212e, 0x2135, 0x2136, 0x213a, + 0x2141, 0x2147, 0x2149, 0x214c, 0x2158, 0x215b, 0x215e, 0x216c, + 0x2183, 0x2186, 0x2194, 0x21ac, 0x21b0, 0x21b1, 0x21ba, 0x21bb, + 0x21da, 0x21e6, 0x21ea, 0x21ee, 0x21f5, 0x2206, 0x2216, 0x2227, + 0x2228, 0x224c, 0x2251, 0x2252, 0x2254, 0x2259, 0x225b, 0x2263, + 0x2265, 0x2268, 0x2269, 0x2282, 0x2284, 0x228c, 0x22ab, 0x22b0, + 0x22c4, 0x22cc, 0x22d3, 0x22d4, 0x22d9, 0x22db, 0x22dc, 0x22de, + 0x22e7, 0x22e8, 0x22f4, 0x22f5, 0x22f6, 0x22f7, 0x22fb, 0x22fc, + 0x2300, 0x2301, 0x2303, 0x2304, 0x2308, 0x2309, 0x2314, 0x2315, + 0x2319, 0x231d, 0x231e, 0x2322, 0x2337, 0x2338, 0x2351, 0x235b, + 0x2373, 0x2379, 0x2384, 0x238d, 0x238e, 0x239d, 0x23c3, 0x23d2, + 0x23f2, 0x23fb, 0x2457, 0x245b, 0x2460, 0x2477, 0x2495, 0x249a, + 0x24ad, 0x24ae, 0x24bf, 0x24c7, 0x24df, 0x2500, 0x252c, 0x25c5, + 0x25ec, 0x25ef, 0x25f1, 0x2601, 0x2604, 0x260e, 0x261c, 0x261e, + 0x2623, 0x2629, 0x2630, 0x2639, 0x2641, 0x2658, 0x265b, 0x2661, + 0x269c, 0x26f0, 0x2708, 0x270b, 0x2742, 0x2745, 0x275b, 0x277a, + 0x2794, 0x27a8, 0x27af, 0x27db, 0x27e4, 0x27fc, 0x2801, 0x2803, + 0x281a, 0x2820, 0x2826, 0x2827, 0x282b, 0x282d, 0x2831, 0x2838, + 0x283a, 0x283b, 0x283c, 0x283f, 0x2842, 0x2858, 0x2862, 0x2868, + 0x2884, 0x288a, 0x288e, 0x2893, 0x28c4, 0x28ca, 0x28cc, 0x28da, + 0x28dc, 0x28e1, 0x28e5, 0x2929, 0x296b, 0x2977, 0x29a3, 0x29ce, + 0x29dd, 0x2a1a, 0x2a61, 0x2a68, 0x2a69, 0x2a74, 0x2a77, 0x2a7a, + 0x2a7c, 0x2a89, 0x2a94, 0x2a96, 0x2a98, 0x2a99, 0x2a9a, 0x2a9d, + 0x2aa9, 0x2aaa, 0x2aab, 0x2aaf, 0x2ab0, 0x2ab3, 0x2ab5, 0x2ac4, + 0x2ac7, 0x2aca, 0x2ad0, 0x2ad5, 0x2ad7, 0x2add, 0x2ae3, 0x2aee, + 0x2af0, 0x2af7, 0x2afc, 0x2b0b, 0x2b0f, 0x2b15, 0x2b18, 0x2b19, + 0x2b1e, 0x2b1f, 0x2b20, 0x2b22, 0x2b2b, 0x2b35, 0x2b42, 0x2b4b, + 0x2b51, 0x2b56, 0x2b5b, 0x2b5c, 0x2b66, 0x2b76, 0x2b7d, 0x2b82, + 0x2c07, 0x2c5d, 0x2cee, 0x2cef, 0x2cf6, 0x2cf7, 0x2cff, 0x2d02, + 0x2d03, 0x2d13, 0x2d14, 0x2d1d, 0x2d3c, 0x2d3e, 0x2d40, 0x2d41, 0x2d44, 0x2d47, 0x2d49, 0x2d56, 0x2d84, 0x2d85, 0x2d89, 0x2d8f, - 0x2d94, 0x2d97, 0x2da6, 0x2da8, 0x2dad, 0x2db7, 0x2db8, 0x2dbc, - 0x2dbe, 0x2dc8, 0x2df1, 0x2e0b, 0x2e10, 0x2e20, 0x2e26, 0x2e30, - 0x2e42, 0x2e46, 0x2e48, 0x2e64, 0x2e73, 0x2e82, 0x2e8a, 0x2e8d, - 0x2e91, 0x2e96, 0x2e99, 0x2e9c, 0x2e9d, 0x2ea3, 0x2ea4, 0x2ea8, - 0x2eaf, 0x2eb2, 0x2eba, 0x2ed4, 0x2ed6, 0x2ee9, 0x2eea, 0x2efc, - 0x2f06, 0x2f1f, 0x2f23, 0x2f26, 0x2f2e, 0x2f36, 0x2f38, 0x2f80, - 0x2fb9, 0x2fbb, 0x2fc3, 0x2fd6, 0x3004, 0x3019, 0x3020, 0x302b, - 0x302c, 0x3030, 0x305c, 0x3074, 0x3078, 0x307f, 0x30da, 0x3109, - 0x3121, 0x3122, 0x3127, 0x3137, 0x3141, 0x314c, 0x3150, 0x3151, - 0x315c, 0x315e, 0x3164, 0x3166, 0x318f, 0x3191, 0x319b, 0x31a6, - 0x31cd, 0x31d6, 0x31da, 0x31ec, 0x31f2, 0x31fd, 0x31fe, 0x3210, - 0x3212, 0x3218, 0x322a, 0x3266, 0x3279, 0x3299, 0x32a3, 0x32ac, - 0x32b2, 0x32b3, 0x32b6, 0x32b8, 0x32b9, 0x32e0, 0x32e1, 0x32ec, - 0x32ff, 0x330b, 0x334b, 0x33d2, 0x33d8, 0x33e5, 0x33eb, 0x3440, - 0x344a, 0x344f, 0x3450, 0x3456, 0x3459, 0x3468, 0x346a, 0x3473, - 0x3481, 0x3485, 0x3498, 0x34aa, 0x34be, 0x34c1, 0x34c8, 0x34ca, - 0x34cd, 0x34ce, 0x34d2, 0x34d6, 0x34e0, 0x34f3, 0x34f6, 0x34f7, - 0x34fa, 0x3507, 0x3518, 0x351f, 0x3524, 0x3525, 0x3530, 0x3531, - 0x3536, 0x3539, 0x3540, 0x354d, 0x3553, 0x357a, 0x357f, 0x3580, - 0x3585, 0x358b, 0x3598, 0x35a2, 0x35a7, 0x35a8, 0x35d8, 0x35ed, - 0x3603, 0x3605, 0x3609, 0x360f, 0x3610, 0x3611, 0x3614, 0x3619, - 0x361a, 0x361c, 0x361e, 0x362c, 0x362e, 0x3630, 0x3639, 0x363b, - 0x363c, 0x363d, 0x363e, 0x364b, 0x3661, 0x3662, 0x3670, 0x3672, - 0x3676, 0x3680, 0x3682, 0x36a1, 0x36a8, 0x36ad, 0x36e1, 0x36f6, - 0x3702, 0x370c, 0x3710, 0x3722, 0x3732, 0x373b, 0x374a, 0x374d, - 0x3754, 0x3759, 0x37ae, 0x37c1, 0x37ff, 0x381e, 0x382d, 0x386b, - 0x387e, 0x3886, 0x388e, 0x3893, 0x38dc, 0x38e9, 0x3913, 0x392a, - 0x3932, 0x3934, 0x393b, 0x394a, 0x395c, 0x3970, 0x3a32, 0x3a43, - 0x3a5d, 0x3a61, 0x3a72, 0x3a73, 0x3a74, 0x3a75, 0x3a76, 0x3a7a, - 0x3a80, 0x3a83, 0x3a84, 0x3a88, 0x3a8c, 0x3a9b, 0x3a9c, 0x3ac6, - 0x3ade, 0x3adf, 0x3ae0, 0x3ae5, 0x3aec, 0x3b20, 0x3b22, 0x3b25, - 0x3b28, 0x3b45, 0x3b48, 0x3b49, 0x3b53, 0x3b6b, 0x3b71, 0x3b8b, - 0x3b99, 0x3ba3, 0x3bca, 0x3bcc, 0x3bd2, 0x3bdb, 0x3be6, 0x3bf3, - 0x3bf4, 0x3bf9, 0x3c04, 0x3c1c, 0x3c28, 0x3c43, 0x3c4c, 0x3c4f, - 0x3c52, 0x3c56, 0x3c85, 0x3c88, 0x3c99, 0x3ccd, 0x3d02, 0x3d08, - 0x3d16, 0x3d18, 0x3d19, 0x3d1a, 0x3d2c, 0x3d32, 0x3d3a, 0x3d40, - 0x3d67, 0x3da1, 0x3da7, 0x3dae, 0x3e10, 0x3e33, 0x3e49, 0x3ed4, - 0x3ef0, 0x3f74, 0x3f7c, 0x3f8e, 0x3fca, 0x3fcb, 0x4032, 0x4047, - 0x406a, 0x40c2, 0x40f0, 0x413e, 0x4147, 0x4149, 0x4158, 0x416c, - 0x4171, 0x417a, 0x418a, 0x41bd, 0x41c0, 0x41c7, 0x41d1, 0x41fd, - 0x41fe, 0x423c, 0x4250, 0x4283, 0x42ba, 0x430f, 0x4314, 0x4317, - 0x43c1, 0x4429, 0x442b, 0x4430, 0x4433, 0x4434, 0x4439, 0x4441, - 0x4442, 0x4444, 0x4446, 0x4448, 0x444b, 0x444c, 0x445d, 0x446a, - 0x447b, 0x447c, 0x4481, 0x4487, 0x44c3, 0x44d6, 0x44ec, 0x458b, - 0x458d, 0x458e, 0x458f, 0x4595, 0x4597, 0x45d0, 0x45e8, 0x45ff, - 0x4605, 0x4609, 0x461c, 0x4630, 0x4631, 0x464f, 0x4651, 0x46f6, - 0x46fe, 0x4704, 0x4713, 0x4725, 0x4745, 0x47cb, 0x484b, 0x484d, - 0x484f, 0x4867, 0x486e, 0x486f, 0x487e, 0x4892, 0x48d1, 0x48d2, - 0x48dc, 0x48de, 0x48e2, 0x48e9, 0x490c, 0x491c, 0x493f, 0x495e, - 0x4987, 0x498b, 0x49a4, 0x49dc, 0x49ea, 0x49f6, 0x4a00, 0x4a22, - 0x4a37, 0x4a3d, 0x4a57, 0x4a5a, 0x4a65, 0x4a67, 0x4aa8, 0x4ab2, - 0x4ad1, 0x4ad5, 0x4b32, 0x4b84, 0x4bcf, 0x4be7, 0x4c0c, 0x4c11, - 0x4c15, 0x4c2a, 0x4c31, 0x4c41, 0x4c4a, 0x4c53, 0x4c55, 0x4c5d, - 0x4c61, 0x4c72, 0x4c77, 0x4c82, 0x4c86, 0x4ca4, 0x4cab, 0x4cbe, - 0x4cc3, 0x4ce2, 0x4ce3, 0x4ceb, 0x4cf1, 0x4cfa, 0x4d05, 0x4d4e, - 0x4d4f, 0x4d65, 0x4d81, 0x4d8d, 0x4d9d, 0x4df0, 0x4e4b, 0x4e7f, - 0x4e9f, 0x4eba, 0x4ee3, 0x4f12, 0x4f14, 0x4f16, 0x4f1d, 0x4f44, - 0x4f6f, 0x4f80, 0x4f83, 0x4f88, 0x4f8e, 0x4f9a, 0x4fba, 0x4fc0, - 0x4fc3, 0x4fdd, 0x5009, 0x500e, 0x5042, 0x505b, 0x5066, 0x5077, + 0x2d94, 0x2da6, 0x2da8, 0x2dad, 0x2db7, 0x2db8, 0x2dbc, 0x2dbe, + 0x2dc8, 0x2df1, 0x2e0b, 0x2e20, 0x2e26, 0x2e30, 0x2e42, 0x2e46, + 0x2e48, 0x2e64, 0x2e73, 0x2e82, 0x2e8a, 0x2e8d, 0x2e91, 0x2e96, + 0x2e99, 0x2e9c, 0x2e9d, 0x2ea3, 0x2ea4, 0x2ea8, 0x2eaf, 0x2eb2, + 0x2eba, 0x2ed4, 0x2ed6, 0x2ee9, 0x2eea, 0x2efc, 0x2f06, 0x2f1f, + 0x2f23, 0x2f26, 0x2f2e, 0x2f36, 0x2f38, 0x2f80, 0x2fb9, 0x2fbb, + 0x2fc3, 0x2fd6, 0x3004, 0x3019, 0x3020, 0x302c, 0x3030, 0x305c, + 0x3074, 0x3078, 0x307f, 0x30da, 0x3109, 0x3121, 0x3122, 0x3127, + 0x3137, 0x3141, 0x314c, 0x3150, 0x3151, 0x315c, 0x315e, 0x3164, + 0x3166, 0x318f, 0x3191, 0x319b, 0x31a6, 0x31cd, 0x31d6, 0x31da, + 0x31ec, 0x31f2, 0x31fd, 0x31fe, 0x3210, 0x3212, 0x3218, 0x322a, + 0x3266, 0x3279, 0x3299, 0x32a3, 0x32ac, 0x32b2, 0x32b3, 0x32b6, + 0x32b8, 0x32b9, 0x32e0, 0x32e1, 0x32ec, 0x32ff, 0x330b, 0x334b, + 0x33d2, 0x33d8, 0x33e5, 0x33eb, 0x3440, 0x344a, 0x344f, 0x3450, + 0x3456, 0x3459, 0x3468, 0x346a, 0x3473, 0x3481, 0x3485, 0x3498, + 0x34aa, 0x34be, 0x34c1, 0x34c8, 0x34ca, 0x34cd, 0x34ce, 0x34d2, + 0x34d6, 0x34e0, 0x34f3, 0x34f6, 0x34fa, 0x3507, 0x3518, 0x351f, + 0x3524, 0x3525, 0x3530, 0x3531, 0x3536, 0x3539, 0x3540, 0x354d, + 0x3553, 0x357a, 0x357f, 0x3580, 0x3585, 0x358b, 0x3598, 0x35a2, + 0x35a7, 0x35a8, 0x35d8, 0x35ed, 0x3603, 0x3605, 0x3609, 0x360f, + 0x3610, 0x3611, 0x3614, 0x3619, 0x361a, 0x361c, 0x361e, 0x362c, + 0x362e, 0x3630, 0x3639, 0x363b, 0x363c, 0x363d, 0x363e, 0x364b, + 0x3661, 0x3662, 0x3670, 0x3672, 0x3676, 0x3680, 0x3682, 0x36a1, + 0x36a8, 0x36ad, 0x36e1, 0x36f6, 0x3702, 0x370c, 0x3710, 0x3732, + 0x373b, 0x374a, 0x374d, 0x3754, 0x3759, 0x37ae, 0x37c1, 0x37ff, + 0x382d, 0x386b, 0x387e, 0x3886, 0x388e, 0x3893, 0x38dc, 0x38e9, + 0x3913, 0x392a, 0x3932, 0x3934, 0x393b, 0x394a, 0x395c, 0x3970, + 0x3a32, 0x3a43, 0x3a5d, 0x3a61, 0x3a72, 0x3a73, 0x3a74, 0x3a75, + 0x3a76, 0x3a7a, 0x3a80, 0x3a83, 0x3a84, 0x3a88, 0x3a8c, 0x3a9b, + 0x3a9c, 0x3ac6, 0x3ade, 0x3adf, 0x3ae0, 0x3ae5, 0x3aec, 0x3b20, + 0x3b22, 0x3b25, 0x3b28, 0x3b45, 0x3b48, 0x3b49, 0x3b53, 0x3b6b, + 0x3b71, 0x3b8b, 0x3b99, 0x3ba3, 0x3bca, 0x3bcc, 0x3bd2, 0x3bdb, + 0x3be6, 0x3bf3, 0x3bf4, 0x3bf9, 0x3c04, 0x3c1c, 0x3c28, 0x3c43, + 0x3c4c, 0x3c4f, 0x3c52, 0x3c56, 0x3c85, 0x3c88, 0x3c99, 0x3ccd, + 0x3d02, 0x3d08, 0x3d16, 0x3d18, 0x3d19, 0x3d1a, 0x3d2c, 0x3d32, + 0x3d3a, 0x3d40, 0x3d67, 0x3da1, 0x3da7, 0x3dae, 0x3e10, 0x3e33, + 0x3e49, 0x3ed4, 0x3ef0, 0x3f74, 0x3f7c, 0x3f8e, 0x3fca, 0x3fcb, + 0x4032, 0x4047, 0x406a, 0x40c2, 0x40f0, 0x413e, 0x4147, 0x4149, + 0x4158, 0x416c, 0x4171, 0x417a, 0x418a, 0x41bd, 0x41c0, 0x41c7, + 0x41d1, 0x41fd, 0x41fe, 0x423c, 0x4250, 0x4283, 0x42ba, 0x430f, + 0x4314, 0x4317, 0x43c1, 0x4429, 0x442b, 0x4430, 0x4433, 0x4434, + 0x4439, 0x4441, 0x4442, 0x4444, 0x4446, 0x4448, 0x444b, 0x444c, + 0x445d, 0x446a, 0x447b, 0x447c, 0x4481, 0x4487, 0x44c3, 0x44d6, + 0x44ec, 0x458b, 0x458d, 0x458e, 0x458f, 0x4595, 0x4597, 0x45d0, + 0x45e8, 0x45ff, 0x4605, 0x4609, 0x461c, 0x4630, 0x4631, 0x464f, + 0x4651, 0x46f6, 0x46fe, 0x4704, 0x4713, 0x4725, 0x4745, 0x47cb, + 0x484b, 0x484d, 0x484f, 0x4867, 0x486e, 0x486f, 0x487e, 0x4892, + 0x48d1, 0x48d2, 0x48dc, 0x48de, 0x48e2, 0x48e9, 0x490c, 0x491c, + 0x493f, 0x495e, 0x4987, 0x498b, 0x49a4, 0x49dc, 0x49ea, 0x49f6, + 0x4a22, 0x4a37, 0x4a3d, 0x4a57, 0x4a5a, 0x4a65, 0x4a67, 0x4aa8, + 0x4ab2, 0x4ad1, 0x4ad5, 0x4b32, 0x4b84, 0x4bcf, 0x4be7, 0x4c0c, + 0x4c11, 0x4c15, 0x4c2a, 0x4c31, 0x4c41, 0x4c4a, 0x4c53, 0x4c55, + 0x4c5d, 0x4c61, 0x4c72, 0x4c77, 0x4c82, 0x4c86, 0x4ca4, 0x4cab, + 0x4cbe, 0x4cc3, 0x4ce2, 0x4ce3, 0x4ceb, 0x4cf1, 0x4cfa, 0x4d05, + 0x4d4e, 0x4d4f, 0x4d65, 0x4d81, 0x4d8d, 0x4d9d, 0x4df0, 0x4e4b, + 0x4e7f, 0x4e9f, 0x4eba, 0x4ee3, 0x4f12, 0x4f14, 0x4f16, 0x4f1d, + 0x4f44, 0x4f6f, 0x4f80, 0x4f83, 0x4f88, 0x4f8e, 0x4f9a, 0x4fba, + 0x4fc0, 0x4fc3, 0x4fdd, 0x5009, 0x500e, 0x5042, 0x5066, 0x5077, 0x5081, 0x50ae, 0x50da, 0x50fb, 0x5104, 0x510b, 0x5118, 0x5119, - 0x511a, 0x513b, 0x513d, 0x514a, 0x5180, 0x5183, 0x5193, 0x51c2, - 0x51f6, 0x51f7, 0x5202, 0x5247, 0x5288, 0x52e4, 0x52ed, 0x534e, - 0x535a, 0x5368, 0x5446, 0x5495, 0x54bd, 0x54ee, 0x5518, 0x5566, - 0x575d, 0x5764, 0x5779, 0x57bc, 0x57e0, 0x57ed, 0x57f2, 0x580e, - 0x5818, 0x5890, 0x5892, 0x589c, 0x58a0, 0x58a7, 0x58ab, 0x58bb, - 0x58cb, 0x58d1, 0x58e3, 0x58f4, 0x58f7, 0x5911, 0x5919, 0x591b, - 0x591f, 0x5924, 0x5929, 0x593b, 0x593e, 0x5942, 0x5944, 0x5945, - 0x5966, 0x5977, 0x5982, 0x5983, 0x5984, 0x599d, 0x599e, 0x59a6, - 0x59a9, 0x59af, 0x59bb, 0x59bd, 0x59be, 0x59c1, 0x59c3, 0x59d0, - 0x59d8, 0x59dc, 0x59e7, 0x5a09, 0x5a13, 0x5a2c, 0x5a2e, 0x5a69, - 0x5a81, 0x5a88, 0x5a9b, 0x5aa4, 0x5ab2, 0x5aef, 0x5b61, 0x5b72, - 0x5bb1, 0x5bb2, 0x5bb8, 0x5bba, 0x5bbd, 0x5bc8, 0x5bc9, 0x5bcc, - 0x5bd0, 0x5bd4, 0x5bd8, 0x5bfb, 0x5c0e, 0x5c4a, 0x5c75, 0x5c81, - 0x5c88, 0x5c96, 0x5c9b, 0x5cb4, 0x5cc4, 0x5cf0, 0x5d00, 0x5dbc, - 0x5ddb, 0x5df0, 0x5df3, 0x5e0e, 0x5e14, 0x5e1a, 0x5e26, 0x5e3b, - 0x5e49, 0x5eac, 0x5eaf, 0x5eb7, 0x5ec3, 0x5ecb, 0x5ecd, 0x5edf, - 0x5ee2, 0x5ee5, 0x5efc, 0x5f0e, 0x5f11, 0x5f12, 0x5f14, 0x5f20, - 0x5f21, 0x5f2a, 0x5f2b, 0x5f30, 0x5f31, 0x5f34, 0x5f3f, 0x5f42, - 0x5f43, 0x5f56, 0x5f5b, 0x5f5c, 0x5f5f, 0x5f64, 0x5f65, 0x5f66, - 0x5f71, 0x5f7a, 0x5f89, 0x5f90, 0x5f95, 0x5f9b, 0x5fb4, 0x5fbb, - 0x5ff9, 0x6006, 0x600e, 0x605e, 0x6063, 0x6065, 0x6089, 0x60bc, - 0x60de, 0x60df, 0x60e0, 0x60e2, 0x60ee, 0x6155, 0x616c, 0x6191, - 0x6233, 0x6240, 0x6243, 0x6488, 0x649a, 0x649c, 0x64a4, 0x64b3, - 0x64ed, 0x6501, 0x6544, 0x6555, 0x655e, 0x6561, 0x6573, 0x6575, - 0x6589, 0x658e, 0x659f, 0x65ac, 0x65ad, 0x65b4, 0x65b9, 0x65cc, - 0x65d7, 0x65e2, 0x65e7, 0x65ea, 0x65f3, 0x65f4, 0x65f9, 0x65fb, - 0x6603, 0x660c, 0x6611, 0x6618, 0x6663, 0x666a, 0x666f, 0x6673, - 0x667a, 0x6685, 0x6704, 0x6710, 0x6714, 0x6716, 0x6719, 0x6728, - 0x6729, 0x673e, 0x674d, 0x675d, 0x6765, 0x6769, 0x676f, 0x6780, - 0x67b9, 0x67ec, 0x67f0, 0x6800, 0x6803, 0x6839, 0x68a7, 0x68aa, - 0x68d5, 0x68d6, 0x6923, 0x6924, 0x6968, 0x69e5, 0x69e9, 0x69fb, - 0x6a6b, 0x6bf6, 0x6da8, 0x6dcd, 0x6dd5, 0x6de3, 0x6def, 0x6df9, - 0x6e24, 0x6e4c, 0xbf12, 0xbf19, 0xbf1c, 0xbf1d, 0xbf1e, 0xbf22, - 0xbf24, 0xbf26, 0xbf2a, 0xbf2d, 0xbf32, 0xbf37, 0xbf38, 0xbf39, - 0xbf4f, 0xbf54, 0xbf59, 0xbf5c, 0xbf5d, 0xbf5e, 0xbf62, 0xbf63, - 0xbf64, 0xbf65, 0xbf78, 0xbf79, 0xbf7f, 0xbf81, 0xbf82, 0xbf85, - 0xbf88, 0xbf89, 0xbf8a, 0xbf8c, 0xbfa4, 0xbfa6, 0xbfd5, 0xbfd6, - 0xbfd8, 0xbfda, 0xbff1, 0xbff8, 0xbffb, 0xc004, 0xc02d, 0xc035, - 0xc06c, 0xc0fc, 0xc151, 0xc152, 0xc153, 0xc154, 0xc155, 0xc198, - 0xc1a4, 0xc1fe, 0xc215, 0xc46b, 0xc6d3, 0xc7b3, 0xce19, 0xce1a, - 0xce1d, 0xce22, 0xce23 + 0x511a, 0x513b, 0x513d, 0x514a, 0x5180, 0x5183, 0x51c2, 0x51f6, + 0x51f7, 0x5202, 0x5247, 0x5288, 0x52e4, 0x52ed, 0x534e, 0x535a, + 0x5368, 0x5446, 0x5495, 0x54bd, 0x54ee, 0x5518, 0x5566, 0x575d, + 0x5764, 0x5779, 0x57bc, 0x57e0, 0x57ed, 0x57f2, 0x580e, 0x5818, + 0x5890, 0x5892, 0x589c, 0x58a0, 0x58a7, 0x58ab, 0x58bb, 0x58cb, + 0x58d1, 0x58e3, 0x58f4, 0x58f7, 0x5911, 0x5919, 0x591b, 0x591f, + 0x5924, 0x5929, 0x593b, 0x593e, 0x5942, 0x5944, 0x5945, 0x5966, + 0x5977, 0x5982, 0x5983, 0x5984, 0x599d, 0x599e, 0x59a6, 0x59a9, + 0x59af, 0x59bb, 0x59bd, 0x59be, 0x59c1, 0x59c3, 0x59d0, 0x59d8, + 0x59dc, 0x59e7, 0x5a09, 0x5a13, 0x5a2c, 0x5a2e, 0x5a69, 0x5a81, + 0x5a88, 0x5a9b, 0x5aa4, 0x5ab2, 0x5b61, 0x5b72, 0x5bb1, 0x5bb2, + 0x5bb8, 0x5bba, 0x5bbd, 0x5bc8, 0x5bc9, 0x5bcc, 0x5bd0, 0x5bd4, + 0x5bd8, 0x5bfb, 0x5c0e, 0x5c75, 0x5c81, 0x5c88, 0x5c96, 0x5c9b, + 0x5cb4, 0x5cc4, 0x5cf0, 0x5d00, 0x5dbc, 0x5ddb, 0x5df0, 0x5df3, + 0x5e0e, 0x5e14, 0x5e1a, 0x5e26, 0x5e3b, 0x5e49, 0x5eac, 0x5eaf, + 0x5eb7, 0x5ec3, 0x5ecb, 0x5ecd, 0x5edf, 0x5ee2, 0x5ee5, 0x5efc, + 0x5f0e, 0x5f11, 0x5f12, 0x5f14, 0x5f20, 0x5f21, 0x5f2a, 0x5f2b, + 0x5f30, 0x5f31, 0x5f34, 0x5f3f, 0x5f42, 0x5f43, 0x5f56, 0x5f5b, + 0x5f5c, 0x5f5f, 0x5f64, 0x5f65, 0x5f66, 0x5f71, 0x5f7a, 0x5f89, + 0x5f90, 0x5f95, 0x5f9b, 0x5fb4, 0x5fbb, 0x5ff9, 0x6006, 0x600e, + 0x605e, 0x6063, 0x6065, 0x6089, 0x60bc, 0x60de, 0x60df, 0x60e0, + 0x60e2, 0x60ee, 0x6155, 0x616c, 0x6191, 0x6233, 0x6240, 0x6243, + 0x6488, 0x649a, 0x649c, 0x64a4, 0x64b3, 0x64ed, 0x6555, 0x655e, + 0x6561, 0x6573, 0x6575, 0x6589, 0x658e, 0x659f, 0x65ac, 0x65ad, + 0x65b4, 0x65b9, 0x65cc, 0x65d7, 0x65e2, 0x65e7, 0x65ea, 0x65f3, + 0x65f4, 0x65f9, 0x65fb, 0x6603, 0x660c, 0x6611, 0x6618, 0x6663, + 0x666a, 0x666f, 0x6673, 0x667a, 0x6685, 0x6704, 0x6710, 0x6714, + 0x6716, 0x6719, 0x6728, 0x6729, 0x673e, 0x674d, 0x675d, 0x6765, + 0x6769, 0x676f, 0x6780, 0x67b9, 0x67ec, 0x67f0, 0x6800, 0x6803, + 0x6839, 0x68a7, 0x68aa, 0x68d5, 0x68d6, 0x6923, 0x6924, 0x6968, + 0x69e5, 0x69e9, 0x69fb, 0x6a6b, 0x6bf6, 0x6da8, 0x6dcd, 0x6dd5, + 0x6de3, 0x6def, 0x6df9, 0x6e24, 0x6e4c, 0xbf12, 0xbf19, 0xbf1c, + 0xbf1d, 0xbf1e, 0xbf22, 0xbf24, 0xbf26, 0xbf2a, 0xbf2d, 0xbf32, + 0xbf37, 0xbf38, 0xbf39, 0xbf4f, 0xbf54, 0xbf59, 0xbf5c, 0xbf5d, + 0xbf5e, 0xbf62, 0xbf63, 0xbf64, 0xbf65, 0xbf78, 0xbf79, 0xbf7f, + 0xbf81, 0xbf82, 0xbf85, 0xbf88, 0xbf89, 0xbf8a, 0xbf8c, 0xbfa4, + 0xbfa6, 0xbfd5, 0xbfd6, 0xbfd8, 0xbfda, 0xbff1, 0xbff8, 0xbffb, + 0xc004, 0xc02d, 0xc035, 0xc06c, 0xc0fc, 0xc151, 0xc152, 0xc153, + 0xc154, 0xc155, 0xc198, 0xc1a4, 0xc1fe, 0xc215, 0xc46b, 0xc6d3, + 0xc7b3, 0xce19, 0xce1a, 0xce1d, 0xce22, 0xce23 }; /*Collect the unicode lists and glyph_id offsets*/ @@ -24094,17 +23719,19 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { }, { .range_start = 12527, .range_length = 52772, .glyph_id_start = 248, - .unicode_list = unicode_list_5, .glyph_id_ofs_list = NULL, .list_length = 1187, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + .unicode_list = unicode_list_5, .glyph_id_ofs_list = NULL, .list_length = 1166, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY } }; + + /*-------------------- * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -24118,15 +23745,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 4, .kern_classes = 0, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_simsun_16_cjk = { #else lv_font_t lv_font_simsun_16_cjk = { @@ -24145,4 +23775,7 @@ lv_font_t lv_font_simsun_16_cjk = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_SIMSUN_16_CJK*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_unscii_16.c b/L3_Middlewares/LVGL/src/font/lv_font_unscii_16.c index b95d51a..d6b0eaa 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_unscii_16.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_unscii_16.c @@ -475,6 +475,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xc0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -583,6 +584,8 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { * CHARACTER MAPPING *--------------------*/ + + /*Collect the unicode lists and glyph_id offsets*/ static const lv_font_fmt_txt_cmap_t cmaps[] = { { @@ -591,13 +594,15 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { } }; + + /*-------------------- * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -611,15 +616,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 1, .kern_classes = 0, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_unscii_16 = { #else lv_font_t lv_font_unscii_16 = { @@ -638,4 +646,7 @@ lv_font_t lv_font_unscii_16 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_UNSCII_16*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_font_unscii_8.c b/L3_Middlewares/LVGL/src/font/lv_font_unscii_8.c index 26b92fb..1b03c85 100644 --- a/L3_Middlewares/LVGL/src/font/lv_font_unscii_8.c +++ b/L3_Middlewares/LVGL/src/font/lv_font_unscii_8.c @@ -311,6 +311,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xc1, 0x42, 0xbd, 0x2c, 0x40, 0x81, 0x0 }; + /*--------------------- * GLYPH DESCRIPTION *--------------------*/ @@ -419,6 +420,8 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { * CHARACTER MAPPING *--------------------*/ + + /*Collect the unicode lists and glyph_id offsets*/ static const lv_font_fmt_txt_cmap_t cmaps[] = { { @@ -427,13 +430,15 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = { } }; + + /*-------------------- * ALL CUSTOM DATA *--------------------*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) /*Store all the custom data of the font*/ - +static lv_font_fmt_txt_glyph_cache_t cache; static const lv_font_fmt_txt_dsc_t font_dsc = { #else static lv_font_fmt_txt_dsc_t font_dsc = { @@ -447,15 +452,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .bpp = 1, .kern_classes = 0, .bitmap_format = 0, - +#if LV_VERSION_CHECK(8, 0, 0) + .cache = &cache +#endif }; + /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ -#if LVGL_VERSION_MAJOR >= 8 +#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_unscii_8 = { #else lv_font_t lv_font_unscii_8 = { @@ -474,4 +482,7 @@ lv_font_t lv_font_unscii_8 = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if LV_FONT_UNSCII_8*/ + diff --git a/L3_Middlewares/LVGL/src/font/lv_symbol_def.h b/L3_Middlewares/LVGL/src/font/lv_symbol_def.h index d78f389..696daf1 100644 --- a/L3_Middlewares/LVGL/src/font/lv_symbol_def.h +++ b/L3_Middlewares/LVGL/src/font/lv_symbol_def.h @@ -1,8 +1,3 @@ -/** - * @file lv_symbol_def.h - * - */ - #ifndef LV_SYMBOL_DEF_H #define LV_SYMBOL_DEF_H @@ -32,10 +27,11 @@ extern "C" { 62018, 62019, 62020, 62087, 62099, 62189, 62212, 62810, 63426, 63650 */ -/* These symbols can be predefined in the lv_conf.h file. +/* These symbols can be prefined in the lv_conf.h file. * If they are not predefined, they will use the following values */ + #if !defined LV_SYMBOL_AUDIO #define LV_SYMBOL_AUDIO "\xEF\x80\x81" /*61441, 0xF001*/ #endif @@ -283,71 +279,71 @@ extern "C" { /* * The following list is generated using - * cat src/font/lv_symbol_def.h | sed -E -n 's/^#define\s+LV_(SYMBOL_\w+).*".*$/ LV_STR_\1,/p' + * cat src/font/lv_symbol_def.h | sed -E -n 's/^#define\s+LV_(SYMBOL_\w+).*".*$/ _LV_STR_\1,/p' */ enum { - LV_STR_SYMBOL_BULLET, - LV_STR_SYMBOL_AUDIO, - LV_STR_SYMBOL_VIDEO, - LV_STR_SYMBOL_LIST, - LV_STR_SYMBOL_OK, - LV_STR_SYMBOL_CLOSE, - LV_STR_SYMBOL_POWER, - LV_STR_SYMBOL_SETTINGS, - LV_STR_SYMBOL_HOME, - LV_STR_SYMBOL_DOWNLOAD, - LV_STR_SYMBOL_DRIVE, - LV_STR_SYMBOL_REFRESH, - LV_STR_SYMBOL_MUTE, - LV_STR_SYMBOL_VOLUME_MID, - LV_STR_SYMBOL_VOLUME_MAX, - LV_STR_SYMBOL_IMAGE, - LV_STR_SYMBOL_TINT, - LV_STR_SYMBOL_PREV, - LV_STR_SYMBOL_PLAY, - LV_STR_SYMBOL_PAUSE, - LV_STR_SYMBOL_STOP, - LV_STR_SYMBOL_NEXT, - LV_STR_SYMBOL_EJECT, - LV_STR_SYMBOL_LEFT, - LV_STR_SYMBOL_RIGHT, - LV_STR_SYMBOL_PLUS, - LV_STR_SYMBOL_MINUS, - LV_STR_SYMBOL_EYE_OPEN, - LV_STR_SYMBOL_EYE_CLOSE, - LV_STR_SYMBOL_WARNING, - LV_STR_SYMBOL_SHUFFLE, - LV_STR_SYMBOL_UP, - LV_STR_SYMBOL_DOWN, - LV_STR_SYMBOL_LOOP, - LV_STR_SYMBOL_DIRECTORY, - LV_STR_SYMBOL_UPLOAD, - LV_STR_SYMBOL_CALL, - LV_STR_SYMBOL_CUT, - LV_STR_SYMBOL_COPY, - LV_STR_SYMBOL_SAVE, - LV_STR_SYMBOL_BARS, - LV_STR_SYMBOL_ENVELOPE, - LV_STR_SYMBOL_CHARGE, - LV_STR_SYMBOL_PASTE, - LV_STR_SYMBOL_BELL, - LV_STR_SYMBOL_KEYBOARD, - LV_STR_SYMBOL_GPS, - LV_STR_SYMBOL_FILE, - LV_STR_SYMBOL_WIFI, - LV_STR_SYMBOL_BATTERY_FULL, - LV_STR_SYMBOL_BATTERY_3, - LV_STR_SYMBOL_BATTERY_2, - LV_STR_SYMBOL_BATTERY_1, - LV_STR_SYMBOL_BATTERY_EMPTY, - LV_STR_SYMBOL_USB, - LV_STR_SYMBOL_BLUETOOTH, - LV_STR_SYMBOL_TRASH, - LV_STR_SYMBOL_EDIT, - LV_STR_SYMBOL_BACKSPACE, - LV_STR_SYMBOL_SD_CARD, - LV_STR_SYMBOL_NEW_LINE, - LV_STR_SYMBOL_DUMMY, + _LV_STR_SYMBOL_BULLET, + _LV_STR_SYMBOL_AUDIO, + _LV_STR_SYMBOL_VIDEO, + _LV_STR_SYMBOL_LIST, + _LV_STR_SYMBOL_OK, + _LV_STR_SYMBOL_CLOSE, + _LV_STR_SYMBOL_POWER, + _LV_STR_SYMBOL_SETTINGS, + _LV_STR_SYMBOL_HOME, + _LV_STR_SYMBOL_DOWNLOAD, + _LV_STR_SYMBOL_DRIVE, + _LV_STR_SYMBOL_REFRESH, + _LV_STR_SYMBOL_MUTE, + _LV_STR_SYMBOL_VOLUME_MID, + _LV_STR_SYMBOL_VOLUME_MAX, + _LV_STR_SYMBOL_IMAGE, + _LV_STR_SYMBOL_TINT, + _LV_STR_SYMBOL_PREV, + _LV_STR_SYMBOL_PLAY, + _LV_STR_SYMBOL_PAUSE, + _LV_STR_SYMBOL_STOP, + _LV_STR_SYMBOL_NEXT, + _LV_STR_SYMBOL_EJECT, + _LV_STR_SYMBOL_LEFT, + _LV_STR_SYMBOL_RIGHT, + _LV_STR_SYMBOL_PLUS, + _LV_STR_SYMBOL_MINUS, + _LV_STR_SYMBOL_EYE_OPEN, + _LV_STR_SYMBOL_EYE_CLOSE, + _LV_STR_SYMBOL_WARNING, + _LV_STR_SYMBOL_SHUFFLE, + _LV_STR_SYMBOL_UP, + _LV_STR_SYMBOL_DOWN, + _LV_STR_SYMBOL_LOOP, + _LV_STR_SYMBOL_DIRECTORY, + _LV_STR_SYMBOL_UPLOAD, + _LV_STR_SYMBOL_CALL, + _LV_STR_SYMBOL_CUT, + _LV_STR_SYMBOL_COPY, + _LV_STR_SYMBOL_SAVE, + _LV_STR_SYMBOL_BARS, + _LV_STR_SYMBOL_ENVELOPE, + _LV_STR_SYMBOL_CHARGE, + _LV_STR_SYMBOL_PASTE, + _LV_STR_SYMBOL_BELL, + _LV_STR_SYMBOL_KEYBOARD, + _LV_STR_SYMBOL_GPS, + _LV_STR_SYMBOL_FILE, + _LV_STR_SYMBOL_WIFI, + _LV_STR_SYMBOL_BATTERY_FULL, + _LV_STR_SYMBOL_BATTERY_3, + _LV_STR_SYMBOL_BATTERY_2, + _LV_STR_SYMBOL_BATTERY_1, + _LV_STR_SYMBOL_BATTERY_EMPTY, + _LV_STR_SYMBOL_USB, + _LV_STR_SYMBOL_BLUETOOTH, + _LV_STR_SYMBOL_TRASH, + _LV_STR_SYMBOL_EDIT, + _LV_STR_SYMBOL_BACKSPACE, + _LV_STR_SYMBOL_SD_CARD, + _LV_STR_SYMBOL_NEW_LINE, + _LV_STR_SYMBOL_DUMMY, }; #ifdef __cplusplus diff --git a/L3_Middlewares/LVGL/src/hal/lv_hal.h b/L3_Middlewares/LVGL/src/hal/lv_hal.h new file mode 100644 index 0000000..167da1f --- /dev/null +++ b/L3_Middlewares/LVGL/src/hal/lv_hal.h @@ -0,0 +1,48 @@ +/** + * @file lv_hal.h + * + */ + +#ifndef LV_HAL_H +#define LV_HAL_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "lv_hal_disp.h" +#include "lv_hal_indev.h" +#include "lv_hal_tick.h" + +/********************* + * DEFINES + *********************/ +/** + * Same as Android's DIP. (Different name is chosen to avoid mistype between LV_DPI and LV_DIP) + * 1 dip is 1 px on a 160 DPI screen + * 1 dip is 2 px on a 320 DPI screen + * https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp + */ +#define _LV_DPX_CALC(dpi, n) ((n) == 0 ? 0 :LV_MAX((( (dpi) * (n) + 80) / 160), 1)) /*+80 for rounding*/ +#define LV_DPX(n) _LV_DPX_CALC(lv_disp_get_dpi(NULL), n) + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/L3_Middlewares/LVGL/src/hal/lv_hal.mk b/L3_Middlewares/LVGL/src/hal/lv_hal.mk new file mode 100644 index 0000000..c35ec2d --- /dev/null +++ b/L3_Middlewares/LVGL/src/hal/lv_hal.mk @@ -0,0 +1,8 @@ +CSRCS += lv_hal_disp.c +CSRCS += lv_hal_indev.c +CSRCS += lv_hal_tick.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/hal +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/hal + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/hal" diff --git a/L3_Middlewares/LVGL/src/hal/lv_hal_disp.c b/L3_Middlewares/LVGL/src/hal/lv_hal_disp.c new file mode 100644 index 0000000..6f1c962 --- /dev/null +++ b/L3_Middlewares/LVGL/src/hal/lv_hal_disp.c @@ -0,0 +1,720 @@ +/** + * @file lv_hal_disp.c + * + * @description HAL layer for display driver + * + */ + +/********************* + * INCLUDES + *********************/ +#include +#include +#include "lv_hal.h" +#include "../misc/lv_mem.h" +#include "../misc/lv_gc.h" +#include "../misc/lv_assert.h" +#include "../core/lv_obj.h" +#include "../core/lv_refr.h" +#include "../core/lv_theme.h" +#include "../draw/sdl/lv_draw_sdl.h" +#include "../draw/sw/lv_draw_sw.h" +#include "../draw/sdl/lv_draw_sdl.h" +#include "../draw/stm32_dma2d/lv_gpu_stm32_dma2d.h" +#include "../draw/swm341_dma2d/lv_gpu_swm341_dma2d.h" +#include "../draw/arm2d/lv_gpu_arm2d.h" +#include "../draw/nxp/vglite/lv_draw_vglite.h" +#include "../draw/nxp/pxp/lv_draw_pxp.h" +#include "../draw/renesas/lv_gpu_d2_ra6m3.h" + +#if LV_USE_THEME_DEFAULT + #include "../extra/themes/default/lv_theme_default.h" +#endif + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static lv_obj_tree_walk_res_t invalidate_layout_cb(lv_obj_t * obj, void * user_data); + +static void set_px_true_color_alpha(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, + lv_coord_t y, + lv_color_t color, lv_opa_t opa); + +static void set_px_cb_alpha1(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, + lv_color_t color, lv_opa_t opa); + +static void set_px_cb_alpha2(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, + lv_color_t color, lv_opa_t opa); + +static void set_px_cb_alpha4(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, + lv_color_t color, lv_opa_t opa); + +static void set_px_cb_alpha8(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, + lv_color_t color, lv_opa_t opa); + +static void set_px_alpha_generic(lv_img_dsc_t * d, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa); + +/********************** + * STATIC VARIABLES + **********************/ +static lv_disp_t * disp_def; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Initialize a display driver with default values. + * It is used to surly have known values in the fields ant not memory junk. + * After it you can set the fields. + * @param driver pointer to driver variable to initialize + */ +void lv_disp_drv_init(lv_disp_drv_t * driver) +{ + lv_memset_00(driver, sizeof(lv_disp_drv_t)); + + driver->hor_res = 320; + driver->ver_res = 240; + driver->physical_hor_res = -1; + driver->physical_ver_res = -1; + driver->offset_x = 0; + driver->offset_y = 0; + driver->antialiasing = LV_COLOR_DEPTH > 8 ? 1 : 0; + driver->screen_transp = 0; + driver->dpi = LV_DPI_DEF; + driver->color_chroma_key = LV_COLOR_CHROMA_KEY; + +#if LV_USE_GPU_RA6M3_G2D + driver->draw_ctx_init = lv_draw_ra6m3_2d_ctx_init; + driver->draw_ctx_deinit = lv_draw_ra6m3_2d_ctx_init; + driver->draw_ctx_size = sizeof(lv_draw_ra6m3_dma2d_ctx_t); +#elif LV_USE_GPU_STM32_DMA2D + driver->draw_ctx_init = lv_draw_stm32_dma2d_ctx_init; + driver->draw_ctx_deinit = lv_draw_stm32_dma2d_ctx_init; + driver->draw_ctx_size = sizeof(lv_draw_stm32_dma2d_ctx_t); +#elif LV_USE_GPU_SWM341_DMA2D + driver->draw_ctx_init = lv_draw_swm341_dma2d_ctx_init; + driver->draw_ctx_deinit = lv_draw_swm341_dma2d_ctx_init; + driver->draw_ctx_size = sizeof(lv_draw_swm341_dma2d_ctx_t); +#elif LV_USE_GPU_NXP_VG_LITE + driver->draw_ctx_init = lv_draw_vglite_ctx_init; + driver->draw_ctx_deinit = lv_draw_vglite_ctx_deinit; + driver->draw_ctx_size = sizeof(lv_draw_vglite_ctx_t); +#elif LV_USE_GPU_NXP_PXP + driver->draw_ctx_init = lv_draw_pxp_ctx_init; + driver->draw_ctx_deinit = lv_draw_pxp_ctx_deinit; + driver->draw_ctx_size = sizeof(lv_draw_pxp_ctx_t); +#elif LV_USE_GPU_SDL + driver->draw_ctx_init = lv_draw_sdl_init_ctx; + driver->draw_ctx_deinit = lv_draw_sdl_deinit_ctx; + driver->draw_ctx_size = sizeof(lv_draw_sdl_ctx_t); +#elif LV_USE_GPU_ARM2D + driver->draw_ctx_init = lv_draw_arm2d_ctx_init; + driver->draw_ctx_deinit = lv_draw_arm2d_ctx_init; + driver->draw_ctx_size = sizeof(lv_draw_arm2d_ctx_t); +#else + driver->draw_ctx_init = lv_draw_sw_init_ctx; + driver->draw_ctx_deinit = lv_draw_sw_init_ctx; + driver->draw_ctx_size = sizeof(lv_draw_sw_ctx_t); +#endif + +} + +/** + * Initialize a display buffer + * @param draw_buf pointer `lv_disp_draw_buf_t` variable to initialize + * @param buf1 A buffer to be used by LVGL to draw the image. + * Always has to specified and can't be NULL. + * Can be an array allocated by the user. E.g. `static lv_color_t disp_buf1[1024 * 10]` + * Or a memory address e.g. in external SRAM + * @param buf2 Optionally specify a second buffer to make image rendering and image flushing + * (sending to the display) parallel. + * In the `disp_drv->flush` you should use DMA or similar hardware to send + * the image to the display in the background. + * It lets LVGL to render next frame into the other buffer while previous is being + * sent. Set to `NULL` if unused. + * @param size_in_px_cnt size of the `buf1` and `buf2` in pixel count. + */ +void lv_disp_draw_buf_init(lv_disp_draw_buf_t * draw_buf, void * buf1, void * buf2, uint32_t size_in_px_cnt) +{ + lv_memset_00(draw_buf, sizeof(lv_disp_draw_buf_t)); + + draw_buf->buf1 = buf1; + draw_buf->buf2 = buf2; + draw_buf->buf_act = draw_buf->buf1; + draw_buf->size = size_in_px_cnt; +} + +/** + * Register an initialized display driver. + * Automatically set the first display as active. + * @param driver pointer to an initialized 'lv_disp_drv_t' variable. Only its pointer is saved! + * @return pointer to the new display or NULL on error + */ +lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver) +{ + lv_disp_t * disp = _lv_ll_ins_head(&LV_GC_ROOT(_lv_disp_ll)); + LV_ASSERT_MALLOC(disp); + if(!disp) { + return NULL; + } + + /*Create a draw context if not created yet*/ + if(driver->draw_ctx == NULL) { + lv_draw_ctx_t * draw_ctx = lv_mem_alloc(driver->draw_ctx_size); + LV_ASSERT_MALLOC(draw_ctx); + if(draw_ctx == NULL) return NULL; + driver->draw_ctx_init(driver, draw_ctx); + driver->draw_ctx = draw_ctx; + } + + lv_memset_00(disp, sizeof(lv_disp_t)); + + disp->driver = driver; + + disp->inv_en_cnt = 1; + + _lv_ll_init(&disp->sync_areas, sizeof(lv_area_t)); + + lv_disp_t * disp_def_tmp = disp_def; + disp_def = disp; /*Temporarily change the default screen to create the default screens on the + new display*/ + /*Create a refresh timer*/ + disp->refr_timer = lv_timer_create(_lv_disp_refr_timer, LV_DISP_DEF_REFR_PERIOD, disp); + LV_ASSERT_MALLOC(disp->refr_timer); + if(disp->refr_timer == NULL) { + lv_mem_free(disp); + return NULL; + } + + if(driver->full_refresh && driver->draw_buf->size < (uint32_t)driver->hor_res * driver->ver_res) { + driver->full_refresh = 0; + LV_LOG_WARN("full_refresh requires at least screen sized draw buffer(s)"); + } + + disp->bg_color = lv_color_white(); +#if LV_COLOR_SCREEN_TRANSP + disp->bg_opa = LV_OPA_TRANSP; +#else + disp->bg_opa = LV_OPA_COVER; +#endif + +#if LV_USE_THEME_DEFAULT + if(lv_theme_default_is_inited() == false) { + disp->theme = lv_theme_default_init(disp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), + LV_THEME_DEFAULT_DARK, LV_FONT_DEFAULT); + } + else { + disp->theme = lv_theme_default_get(); + } +#endif + + disp->act_scr = lv_obj_create(NULL); /*Create a default screen on the display*/ + disp->top_layer = lv_obj_create(NULL); /*Create top layer on the display*/ + disp->sys_layer = lv_obj_create(NULL); /*Create sys layer on the display*/ + lv_obj_remove_style_all(disp->top_layer); + lv_obj_remove_style_all(disp->sys_layer); + lv_obj_clear_flag(disp->top_layer, LV_OBJ_FLAG_CLICKABLE); + lv_obj_clear_flag(disp->sys_layer, LV_OBJ_FLAG_CLICKABLE); + + lv_obj_set_scrollbar_mode(disp->top_layer, LV_SCROLLBAR_MODE_OFF); + lv_obj_set_scrollbar_mode(disp->sys_layer, LV_SCROLLBAR_MODE_OFF); + + lv_obj_invalidate(disp->act_scr); + + disp_def = disp_def_tmp; /*Revert the default display*/ + if(disp_def == NULL) disp_def = disp; /*Initialize the default display*/ + + lv_timer_ready(disp->refr_timer); /*Be sure the screen will be refreshed immediately on start up*/ + + return disp; +} + +/** + * Update the driver in run time. + * @param disp pointer to a display. (return value of `lv_disp_drv_register`) + * @param new_drv pointer to the new driver + */ +void lv_disp_drv_update(lv_disp_t * disp, lv_disp_drv_t * new_drv) +{ + disp->driver = new_drv; + + if(disp->driver->full_refresh && + disp->driver->draw_buf->size < (uint32_t)disp->driver->hor_res * disp->driver->ver_res) { + disp->driver->full_refresh = 0; + LV_LOG_WARN("full_refresh requires at least screen sized draw buffer(s)"); + } + + lv_coord_t w = lv_disp_get_hor_res(disp); + lv_coord_t h = lv_disp_get_ver_res(disp); + uint32_t i; + for(i = 0; i < disp->screen_cnt; i++) { + lv_area_t prev_coords; + lv_obj_get_coords(disp->screens[i], &prev_coords); + lv_area_set_width(&disp->screens[i]->coords, w); + lv_area_set_height(&disp->screens[i]->coords, h); + lv_event_send(disp->screens[i], LV_EVENT_SIZE_CHANGED, &prev_coords); + } + + /* + * This method is usually called upon orientation change, thus the screen is now a + * different size. + * The object invalidated its previous area. That area is now out of the screen area + * so we reset all invalidated areas and invalidate the active screen's new area only. + */ + lv_memset_00(disp->inv_areas, sizeof(disp->inv_areas)); + lv_memset_00(disp->inv_area_joined, sizeof(disp->inv_area_joined)); + disp->inv_p = 0; + if(disp->act_scr != NULL) lv_obj_invalidate(disp->act_scr); + + lv_obj_tree_walk(NULL, invalidate_layout_cb, NULL); + + if(disp->driver->drv_update_cb) disp->driver->drv_update_cb(disp->driver); +} + +/** + * Remove a display + * @param disp pointer to display + */ +void lv_disp_remove(lv_disp_t * disp) +{ + bool was_default = false; + if(disp == lv_disp_get_default()) was_default = true; + + /*Detach the input devices*/ + lv_indev_t * indev; + indev = lv_indev_get_next(NULL); + while(indev) { + if(indev->driver->disp == disp) { + indev->driver->disp = NULL; + } + indev = lv_indev_get_next(indev); + } + + /** delete screen and other obj */ + if(disp->sys_layer) { + lv_obj_del(disp->sys_layer); + disp->sys_layer = NULL; + } + if(disp->top_layer) { + lv_obj_del(disp->top_layer); + disp->top_layer = NULL; + } + while(disp->screen_cnt != 0) { + /*Delete the screenst*/ + lv_obj_del(disp->screens[0]); + } + + _lv_ll_remove(&LV_GC_ROOT(_lv_disp_ll), disp); + _lv_ll_clear(&disp->sync_areas); + if(disp->refr_timer) lv_timer_del(disp->refr_timer); + lv_mem_free(disp); + + if(was_default) lv_disp_set_default(_lv_ll_get_head(&LV_GC_ROOT(_lv_disp_ll))); +} + +/** + * Set a default display. The new screens will be created on it by default. + * @param disp pointer to a display + */ +void lv_disp_set_default(lv_disp_t * disp) +{ + disp_def = disp; +} + +/** + * Get the default display + * @return pointer to the default display + */ +lv_disp_t * lv_disp_get_default(void) +{ + return disp_def; +} + +/** + * Get the horizontal resolution of a display + * @param disp pointer to a display (NULL to use the default display) + * @return the horizontal resolution of the display + */ +lv_coord_t lv_disp_get_hor_res(lv_disp_t * disp) +{ + if(disp == NULL) disp = lv_disp_get_default(); + + if(disp == NULL) { + return 0; + } + else { + switch(disp->driver->rotated) { + case LV_DISP_ROT_90: + case LV_DISP_ROT_270: + return disp->driver->ver_res; + default: + return disp->driver->hor_res; + } + } +} + +/** + * Get the vertical resolution of a display + * @param disp pointer to a display (NULL to use the default display) + * @return the vertical resolution of the display + */ +lv_coord_t lv_disp_get_ver_res(lv_disp_t * disp) +{ + if(disp == NULL) disp = lv_disp_get_default(); + + if(disp == NULL) { + return 0; + } + else { + switch(disp->driver->rotated) { + case LV_DISP_ROT_90: + case LV_DISP_ROT_270: + return disp->driver->hor_res; + default: + return disp->driver->ver_res; + } + } +} + +/** + * Get the full / physical horizontal resolution of a display + * @param disp pointer to a display (NULL to use the default display) + * @return the full / physical horizontal resolution of the display + */ +lv_coord_t lv_disp_get_physical_hor_res(lv_disp_t * disp) +{ + if(disp == NULL) disp = lv_disp_get_default(); + + if(disp == NULL) { + return 0; + } + else { + switch(disp->driver->rotated) { + case LV_DISP_ROT_90: + case LV_DISP_ROT_270: + return disp->driver->physical_ver_res > 0 ? disp->driver->physical_ver_res : disp->driver->ver_res; + default: + return disp->driver->physical_hor_res > 0 ? disp->driver->physical_hor_res : disp->driver->hor_res; + } + } +} + +/** + * Get the full / physical vertical resolution of a display + * @param disp pointer to a display (NULL to use the default display) + * @return the full / physical vertical resolution of the display + */ +lv_coord_t lv_disp_get_physical_ver_res(lv_disp_t * disp) +{ + if(disp == NULL) disp = lv_disp_get_default(); + + if(disp == NULL) { + return 0; + } + else { + switch(disp->driver->rotated) { + case LV_DISP_ROT_90: + case LV_DISP_ROT_270: + return disp->driver->physical_hor_res > 0 ? disp->driver->physical_hor_res : disp->driver->hor_res; + default: + return disp->driver->physical_ver_res > 0 ? disp->driver->physical_ver_res : disp->driver->ver_res; + } + } +} + +/** + * Get the horizontal offset from the full / physical display + * @param disp pointer to a display (NULL to use the default display) + * @return the horizontal offset from the full / physical display + */ +lv_coord_t lv_disp_get_offset_x(lv_disp_t * disp) +{ + if(disp == NULL) disp = lv_disp_get_default(); + + if(disp == NULL) { + return 0; + } + else { + switch(disp->driver->rotated) { + case LV_DISP_ROT_90: + return disp->driver->offset_y; + case LV_DISP_ROT_180: + return lv_disp_get_physical_hor_res(disp) - disp->driver->offset_x; + case LV_DISP_ROT_270: + return lv_disp_get_physical_hor_res(disp) - disp->driver->offset_y; + default: + return disp->driver->offset_x; + } + } +} + +/** + * Get the vertical offset from the full / physical display + * @param disp pointer to a display (NULL to use the default display) + * @return the horizontal offset from the full / physical display + */ +lv_coord_t lv_disp_get_offset_y(lv_disp_t * disp) +{ + if(disp == NULL) disp = lv_disp_get_default(); + + if(disp == NULL) { + return 0; + } + else { + switch(disp->driver->rotated) { + case LV_DISP_ROT_90: + return disp->driver->offset_x; + case LV_DISP_ROT_180: + return lv_disp_get_physical_ver_res(disp) - disp->driver->offset_y; + case LV_DISP_ROT_270: + return lv_disp_get_physical_ver_res(disp) - disp->driver->offset_x; + default: + return disp->driver->offset_y; + } + } +} + +/** + * Get if anti-aliasing is enabled for a display or not + * @param disp pointer to a display (NULL to use the default display) + * @return true: anti-aliasing is enabled; false: disabled + */ +bool lv_disp_get_antialiasing(lv_disp_t * disp) +{ + if(disp == NULL) disp = lv_disp_get_default(); + if(disp == NULL) return false; + + return disp->driver->antialiasing ? true : false; +} + +/** + * Get the DPI of the display + * @param disp pointer to a display (NULL to use the default display) + * @return dpi of the display + */ +lv_coord_t lv_disp_get_dpi(const lv_disp_t * disp) +{ + if(disp == NULL) disp = lv_disp_get_default(); + if(disp == NULL) return LV_DPI_DEF; /*Do not return 0 because it might be a divider*/ + return disp->driver->dpi; +} + +/** + * Call in the display driver's `flush_cb` function when the flushing is finished + * @param disp_drv pointer to display driver in `flush_cb` where this function is called + */ +void LV_ATTRIBUTE_FLUSH_READY lv_disp_flush_ready(lv_disp_drv_t * disp_drv) +{ + disp_drv->draw_buf->flushing = 0; + disp_drv->draw_buf->flushing_last = 0; +} + +/** + * Tell if it's the last area of the refreshing process. + * Can be called from `flush_cb` to execute some special display refreshing if needed when all areas area flushed. + * @param disp_drv pointer to display driver + * @return true: it's the last area to flush; false: there are other areas too which will be refreshed soon + */ +bool LV_ATTRIBUTE_FLUSH_READY lv_disp_flush_is_last(lv_disp_drv_t * disp_drv) +{ + return disp_drv->draw_buf->flushing_last; +} + +/** + * Get the next display. + * @param disp pointer to the current display. NULL to initialize. + * @return the next display or NULL if no more. Give the first display when the parameter is NULL + */ +lv_disp_t * lv_disp_get_next(lv_disp_t * disp) +{ + if(disp == NULL) + return _lv_ll_get_head(&LV_GC_ROOT(_lv_disp_ll)); + else + return _lv_ll_get_next(&LV_GC_ROOT(_lv_disp_ll), disp); +} + +/** + * Get the internal buffer of a display + * @param disp pointer to a display + * @return pointer to the internal buffers + */ +lv_disp_draw_buf_t * lv_disp_get_draw_buf(lv_disp_t * disp) +{ + return disp->driver->draw_buf; +} + +/** + * Set the rotation of this display. + * @param disp pointer to a display (NULL to use the default display) + * @param rotation rotation angle + */ +void lv_disp_set_rotation(lv_disp_t * disp, lv_disp_rot_t rotation) +{ + if(disp == NULL) disp = lv_disp_get_default(); + if(disp == NULL) return; + + disp->driver->rotated = rotation; + lv_disp_drv_update(disp, disp->driver); +} + +/** + * Get the current rotation of this display. + * @param disp pointer to a display (NULL to use the default display) + * @return rotation angle + */ +lv_disp_rot_t lv_disp_get_rotation(lv_disp_t * disp) +{ + if(disp == NULL) disp = lv_disp_get_default(); + if(disp == NULL) return LV_DISP_ROT_NONE; + return disp->driver->rotated; +} + +void lv_disp_drv_use_generic_set_px_cb(lv_disp_drv_t * disp_drv, lv_img_cf_t cf) +{ + switch(cf) { + case LV_IMG_CF_TRUE_COLOR_ALPHA: + disp_drv->set_px_cb = set_px_true_color_alpha; + break; + case LV_IMG_CF_ALPHA_1BIT: + disp_drv->set_px_cb = set_px_cb_alpha1; + break; + case LV_IMG_CF_ALPHA_2BIT: + disp_drv->set_px_cb = set_px_cb_alpha2; + break; + case LV_IMG_CF_ALPHA_4BIT: + disp_drv->set_px_cb = set_px_cb_alpha4; + break; + case LV_IMG_CF_ALPHA_8BIT: + disp_drv->set_px_cb = set_px_cb_alpha8; + break; + default: + disp_drv->set_px_cb = NULL; + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static lv_obj_tree_walk_res_t invalidate_layout_cb(lv_obj_t * obj, void * user_data) +{ + LV_UNUSED(user_data); + lv_obj_mark_layout_as_dirty(obj); + return LV_OBJ_TREE_WALK_NEXT; +} + +static void set_px_cb_alpha1(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, + lv_color_t color, lv_opa_t opa) +{ + (void) disp_drv; /*Unused*/ + + if(opa <= LV_OPA_MIN) return; + lv_img_dsc_t d; + d.data = buf; + d.header.w = buf_w; + d.header.cf = LV_IMG_CF_ALPHA_1BIT; + + set_px_alpha_generic(&d, x, y, color, opa); +} + +static void set_px_cb_alpha2(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, + lv_color_t color, lv_opa_t opa) +{ + (void) disp_drv; /*Unused*/ + + if(opa <= LV_OPA_MIN) return; + lv_img_dsc_t d; + d.data = buf; + d.header.w = buf_w; + d.header.cf = LV_IMG_CF_ALPHA_2BIT; + + set_px_alpha_generic(&d, x, y, color, opa); +} + +static void set_px_cb_alpha4(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, + lv_color_t color, lv_opa_t opa) +{ + (void) disp_drv; /*Unused*/ + + if(opa <= LV_OPA_MIN) return; + lv_img_dsc_t d; + d.data = buf; + d.header.w = buf_w; + d.header.cf = LV_IMG_CF_ALPHA_4BIT; + + set_px_alpha_generic(&d, x, y, color, opa); +} + +static void set_px_cb_alpha8(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, + lv_color_t color, lv_opa_t opa) +{ + (void) disp_drv; /*Unused*/ + + if(opa <= LV_OPA_MIN) return; + lv_img_dsc_t d; + d.data = buf; + d.header.w = buf_w; + d.header.cf = LV_IMG_CF_ALPHA_8BIT; + + set_px_alpha_generic(&d, x, y, color, opa); +} + +static void set_px_alpha_generic(lv_img_dsc_t * d, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa) +{ + d->header.always_zero = 0; + d->header.h = 1; /*Doesn't matter*/ + + uint8_t br = lv_color_brightness(color); + if(opa < LV_OPA_MAX) { + uint8_t bg = lv_img_buf_get_px_alpha(d, x, y); + br = (uint16_t)((uint16_t)br * opa + (bg * (255 - opa))) >> 8; + } + + lv_img_buf_set_px_alpha(d, x, y, br); +} + +static void set_px_true_color_alpha(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, + lv_coord_t x, lv_coord_t y, + lv_color_t color, lv_opa_t opa) +{ + (void) disp_drv; /*Unused*/ + + uint8_t * buf_px = buf + (buf_w * y * LV_IMG_PX_SIZE_ALPHA_BYTE + x * LV_IMG_PX_SIZE_ALPHA_BYTE); + + lv_color_t bg_color; + lv_color_t res_color; + lv_opa_t bg_opa = buf_px[LV_IMG_PX_SIZE_ALPHA_BYTE - 1]; +#if LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1 + bg_color.full = buf_px[0]; + lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf_px[2]); + if(buf_px[1] <= LV_OPA_MIN) return; + buf_px[0] = res_color.full; +#elif LV_COLOR_DEPTH == 16 + bg_color.full = buf_px[0] + (buf_px[1] << 8); + lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf_px[2]); + if(buf_px[2] <= LV_OPA_MIN) return; + buf_px[0] = res_color.full & 0xff; + buf_px[1] = res_color.full >> 8; +#elif LV_COLOR_DEPTH == 32 + bg_color = *((lv_color_t *)buf_px); + lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf_px[3]); + if(buf_px[3] <= LV_OPA_MIN) return; + buf_px[0] = res_color.ch.blue; + buf_px[1] = res_color.ch.green; + buf_px[2] = res_color.ch.red; +#endif + +} diff --git a/L3_Middlewares/LVGL/src/hal/lv_hal_disp.h b/L3_Middlewares/LVGL/src/hal/lv_hal_disp.h new file mode 100644 index 0000000..d5203a0 --- /dev/null +++ b/L3_Middlewares/LVGL/src/hal/lv_hal_disp.h @@ -0,0 +1,373 @@ +/** + * @file lv_hal_disp.h + * + * @description Display Driver HAL interface header file + * + */ + +#ifndef LV_HAL_DISP_H +#define LV_HAL_DISP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include +#include +#include "lv_hal.h" +#include "../draw/lv_draw.h" +#include "../misc/lv_color.h" +#include "../misc/lv_area.h" +#include "../misc/lv_ll.h" +#include "../misc/lv_timer.h" +#include "../misc/lv_ll.h" + +/********************* + * DEFINES + *********************/ +#ifndef LV_INV_BUF_SIZE +#define LV_INV_BUF_SIZE 32 /*Buffer size for invalid areas*/ +#endif + +#ifndef LV_ATTRIBUTE_FLUSH_READY +#define LV_ATTRIBUTE_FLUSH_READY +#endif + +/********************** + * TYPEDEFS + **********************/ + +struct _lv_obj_t; +struct _lv_disp_t; +struct _lv_disp_drv_t; +struct _lv_theme_t; + +/** + * Structure for holding display buffer information. + */ +typedef struct _lv_disp_draw_buf_t { + void * buf1; /**< First display buffer.*/ + void * buf2; /**< Second display buffer.*/ + + /*Internal, used by the library*/ + void * buf_act; + uint32_t size; /*In pixel count*/ + /*1: flushing is in progress. (It can't be a bit field because when it's cleared from IRQ Read-Modify-Write issue might occur)*/ + volatile int flushing; + /*1: It was the last chunk to flush. (It can't be a bit field because when it's cleared from IRQ Read-Modify-Write issue might occur)*/ + volatile int flushing_last; + volatile uint32_t last_area : 1; /*1: the last area is being rendered*/ + volatile uint32_t last_part : 1; /*1: the last part of the current area is being rendered*/ +} lv_disp_draw_buf_t; + +typedef enum { + LV_DISP_ROT_NONE = 0, + LV_DISP_ROT_90, + LV_DISP_ROT_180, + LV_DISP_ROT_270 +} lv_disp_rot_t; + +/** + * Display Driver structure to be registered by HAL. + * Only its pointer will be saved in `lv_disp_t` so it should be declared as + * `static lv_disp_drv_t my_drv` or allocated dynamically. + */ +typedef struct _lv_disp_drv_t { + + lv_coord_t hor_res; /**< Horizontal resolution.*/ + lv_coord_t ver_res; /**< Vertical resolution.*/ + + lv_coord_t + physical_hor_res; /**< Horizontal resolution of the full / physical display. Set to -1 for fullscreen mode.*/ + lv_coord_t + physical_ver_res; /**< Vertical resolution of the full / physical display. Set to -1 for fullscreen mode.*/ + lv_coord_t + offset_x; /**< Horizontal offset from the full / physical display. Set to 0 for fullscreen mode.*/ + lv_coord_t offset_y; /**< Vertical offset from the full / physical display. Set to 0 for fullscreen mode.*/ + + /** Pointer to a buffer initialized with `lv_disp_draw_buf_init()`. + * LVGL will use this buffer(s) to draw the screens contents*/ + lv_disp_draw_buf_t * draw_buf; + + uint32_t direct_mode : 1; /**< 1: Use screen-sized buffers and draw to absolute coordinates*/ + uint32_t full_refresh : 1; /**< 1: Always make the whole screen redrawn*/ + uint32_t sw_rotate : 1; /**< 1: use software rotation (slower)*/ + uint32_t antialiasing : 1; /**< 1: anti-aliasing is enabled on this display.*/ + uint32_t rotated : 2; /**< 1: turn the display by 90 degree. @warning Does not update coordinates for you!*/ + uint32_t screen_transp : 1; /**Handle if the screen doesn't have a solid (opa == LV_OPA_COVER) background. + * Use only if required because it's slower.*/ + + uint32_t dpi : 10; /** DPI (dot per inch) of the display. Default value is `LV_DPI_DEF`.*/ + + /** MANDATORY: Write the internal buffer (draw_buf) to the display. 'lv_disp_flush_ready()' has to be + * called when finished*/ + void (*flush_cb)(struct _lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p); + + /** OPTIONAL: Extend the invalidated areas to match with the display drivers requirements + * E.g. round `y` to, 8, 16 ..) on a monochrome display*/ + void (*rounder_cb)(struct _lv_disp_drv_t * disp_drv, lv_area_t * area); + + /** OPTIONAL: Set a pixel in a buffer according to the special requirements of the display + * Can be used for color format not supported in LittelvGL. E.g. 2 bit -> 4 gray scales + * @note Much slower then drawing with supported color formats.*/ + void (*set_px_cb)(struct _lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, + lv_color_t color, lv_opa_t opa); + + void (*clear_cb)(struct _lv_disp_drv_t * disp_drv, uint8_t * buf, uint32_t size); + + + /** OPTIONAL: Called after every refresh cycle to tell the rendering and flushing time + the + * number of flushed pixels*/ + void (*monitor_cb)(struct _lv_disp_drv_t * disp_drv, uint32_t time, uint32_t px); + + /** OPTIONAL: Called periodically while lvgl waits for operation to be completed. + * For example flushing or GPU + * User can execute very simple tasks here or yield the task*/ + void (*wait_cb)(struct _lv_disp_drv_t * disp_drv); + + /** OPTIONAL: Called when lvgl needs any CPU cache that affects rendering to be cleaned*/ + void (*clean_dcache_cb)(struct _lv_disp_drv_t * disp_drv); + + /** OPTIONAL: called when driver parameters are updated */ + void (*drv_update_cb)(struct _lv_disp_drv_t * disp_drv); + + /** OPTIONAL: called when start rendering */ + void (*render_start_cb)(struct _lv_disp_drv_t * disp_drv); + + /** On CHROMA_KEYED images this color will be transparent. + * `LV_COLOR_CHROMA_KEY` by default. (lv_conf.h)*/ + lv_color_t color_chroma_key; + + lv_draw_ctx_t * draw_ctx; + void (*draw_ctx_init)(struct _lv_disp_drv_t * disp_drv, lv_draw_ctx_t * draw_ctx); + void (*draw_ctx_deinit)(struct _lv_disp_drv_t * disp_drv, lv_draw_ctx_t * draw_ctx); + size_t draw_ctx_size; + +#if LV_USE_USER_DATA + void * user_data; /**< Custom display driver user data*/ +#endif + +} lv_disp_drv_t; + +/** + * Display structure. + * @note `lv_disp_drv_t` should be the first member of the structure. + */ +typedef struct _lv_disp_t { + /**< Driver to the display*/ + struct _lv_disp_drv_t * driver; + + /**< A timer which periodically checks the dirty areas and refreshes them*/ + lv_timer_t * refr_timer; + + /**< The theme assigned to the screen*/ + struct _lv_theme_t * theme; + + /** Screens of the display*/ + struct _lv_obj_t ** screens; /**< Array of screen objects.*/ + struct _lv_obj_t * act_scr; /**< Currently active screen on this display*/ + struct _lv_obj_t * prev_scr; /**< Previous screen. Used during screen animations*/ + struct _lv_obj_t * scr_to_load; /**< The screen prepared to load in lv_scr_load_anim*/ + struct _lv_obj_t * top_layer; /**< @see lv_disp_get_layer_top*/ + struct _lv_obj_t * sys_layer; /**< @see lv_disp_get_layer_sys*/ + uint32_t screen_cnt; + uint8_t draw_prev_over_act : 1; /**< 1: Draw previous screen over active screen*/ + uint8_t del_prev : 1; /**< 1: Automatically delete the previous screen when the screen load anim. is ready*/ + uint8_t rendering_in_progress : 1; /**< 1: The current screen rendering is in progress*/ + + lv_opa_t bg_opa; /**flush` you should use DMA or similar hardware to send + * the image to the display in the background. + * It lets LVGL to render next frame into the other buffer while previous is being + * sent. Set to `NULL` if unused. + * @param size_in_px_cnt size of the `buf1` and `buf2` in pixel count. + */ +void lv_disp_draw_buf_init(lv_disp_draw_buf_t * draw_buf, void * buf1, void * buf2, uint32_t size_in_px_cnt); + +/** + * Register an initialized display driver. + * Automatically set the first display as active. + * @param driver pointer to an initialized 'lv_disp_drv_t' variable. Only its pointer is saved! + * @return pointer to the new display or NULL on error + */ +lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver); + +/** + * Update the driver in run time. + * @param disp pointer to a display. (return value of `lv_disp_drv_register`) + * @param new_drv pointer to the new driver + */ +void lv_disp_drv_update(lv_disp_t * disp, lv_disp_drv_t * new_drv); + +/** + * Remove a display + * @param disp pointer to display + */ +void lv_disp_remove(lv_disp_t * disp); + +/** + * Set a default display. The new screens will be created on it by default. + * @param disp pointer to a display + */ +void lv_disp_set_default(lv_disp_t * disp); + +/** + * Get the default display + * @return pointer to the default display + */ +lv_disp_t * lv_disp_get_default(void); + +/** + * Get the horizontal resolution of a display + * @param disp pointer to a display (NULL to use the default display) + * @return the horizontal resolution of the display + */ +lv_coord_t lv_disp_get_hor_res(lv_disp_t * disp); + +/** + * Get the vertical resolution of a display + * @param disp pointer to a display (NULL to use the default display) + * @return the vertical resolution of the display + */ +lv_coord_t lv_disp_get_ver_res(lv_disp_t * disp); + +/** + * Get the full / physical horizontal resolution of a display + * @param disp pointer to a display (NULL to use the default display) + * @return the full / physical horizontal resolution of the display + */ +lv_coord_t lv_disp_get_physical_hor_res(lv_disp_t * disp); + +/** + * Get the full / physical vertical resolution of a display + * @param disp pointer to a display (NULL to use the default display) + * @return the full / physical vertical resolution of the display + */ +lv_coord_t lv_disp_get_physical_ver_res(lv_disp_t * disp); + +/** + * Get the horizontal offset from the full / physical display + * @param disp pointer to a display (NULL to use the default display) + * @return the horizontal offset from the full / physical display + */ +lv_coord_t lv_disp_get_offset_x(lv_disp_t * disp); + +/** + * Get the vertical offset from the full / physical display + * @param disp pointer to a display (NULL to use the default display) + * @return the horizontal offset from the full / physical display + */ +lv_coord_t lv_disp_get_offset_y(lv_disp_t * disp); + +/** + * Get if anti-aliasing is enabled for a display or not + * @param disp pointer to a display (NULL to use the default display) + * @return true: anti-aliasing is enabled; false: disabled + */ +bool lv_disp_get_antialiasing(lv_disp_t * disp); + +/** + * Get the DPI of the display + * @param disp pointer to a display (NULL to use the default display) + * @return dpi of the display + */ +lv_coord_t lv_disp_get_dpi(const lv_disp_t * disp); + + +/** + * Set the rotation of this display. + * @param disp pointer to a display (NULL to use the default display) + * @param rotation rotation angle + */ +void lv_disp_set_rotation(lv_disp_t * disp, lv_disp_rot_t rotation); + +/** + * Get the current rotation of this display. + * @param disp pointer to a display (NULL to use the default display) + * @return rotation angle + */ +lv_disp_rot_t lv_disp_get_rotation(lv_disp_t * disp); + +//! @cond Doxygen_Suppress + +/** + * Call in the display driver's `flush_cb` function when the flushing is finished + * @param disp_drv pointer to display driver in `flush_cb` where this function is called + */ +void /* LV_ATTRIBUTE_FLUSH_READY */ lv_disp_flush_ready(lv_disp_drv_t * disp_drv); + +/** + * Tell if it's the last area of the refreshing process. + * Can be called from `flush_cb` to execute some special display refreshing if needed when all areas area flushed. + * @param disp_drv pointer to display driver + * @return true: it's the last area to flush; false: there are other areas too which will be refreshed soon + */ +bool /* LV_ATTRIBUTE_FLUSH_READY */ lv_disp_flush_is_last(lv_disp_drv_t * disp_drv); + +//! @endcond + +/** + * Get the next display. + * @param disp pointer to the current display. NULL to initialize. + * @return the next display or NULL if no more. Give the first display when the parameter is NULL + */ +lv_disp_t * lv_disp_get_next(lv_disp_t * disp); + +/** + * Get the internal buffer of a display + * @param disp pointer to a display + * @return pointer to the internal buffers + */ +lv_disp_draw_buf_t * lv_disp_get_draw_buf(lv_disp_t * disp); + +void lv_disp_drv_use_generic_set_px_cb(lv_disp_drv_t * disp_drv, lv_img_cf_t cf); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/L3_Middlewares/LVGL/src/hal/lv_hal_indev.c b/L3_Middlewares/LVGL/src/hal/lv_hal_indev.c new file mode 100644 index 0000000..c3661e4 --- /dev/null +++ b/L3_Middlewares/LVGL/src/hal/lv_hal_indev.c @@ -0,0 +1,195 @@ +/** + * @file lv_hal_indev.c + * + * @description Input device HAL interface + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../misc/lv_assert.h" +#include "../hal/lv_hal_indev.h" +#include "../core/lv_indev.h" +#include "../misc/lv_mem.h" +#include "../misc/lv_gc.h" +#include "lv_hal_disp.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ +#if LV_LOG_TRACE_INDEV + #define INDEV_TRACE(...) LV_LOG_TRACE(__VA_ARGS__) +#else + #define INDEV_TRACE(...) +#endif + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Initialize an input device driver with default values. + * It is used to surly have known values in the fields ant not memory junk. + * After it you can set the fields. + * @param driver pointer to driver variable to initialize + */ +void lv_indev_drv_init(lv_indev_drv_t * driver) +{ + lv_memset_00(driver, sizeof(lv_indev_drv_t)); + + driver->type = LV_INDEV_TYPE_NONE; + driver->scroll_limit = LV_INDEV_DEF_SCROLL_LIMIT; + driver->scroll_throw = LV_INDEV_DEF_SCROLL_THROW; + driver->long_press_time = LV_INDEV_DEF_LONG_PRESS_TIME; + driver->long_press_repeat_time = LV_INDEV_DEF_LONG_PRESS_REP_TIME; + driver->gesture_limit = LV_INDEV_DEF_GESTURE_LIMIT; + driver->gesture_min_velocity = LV_INDEV_DEF_GESTURE_MIN_VELOCITY; +} + +/** + * Register an initialized input device driver. + * @param driver pointer to an initialized 'lv_indev_drv_t' variable. + * Only pointer is saved, so the driver should be static or dynamically allocated. + * @return pointer to the new input device or NULL on error + */ +lv_indev_t * lv_indev_drv_register(lv_indev_drv_t * driver) +{ + if(driver->disp == NULL) driver->disp = lv_disp_get_default(); + + if(driver->disp == NULL) { + LV_LOG_WARN("lv_indev_drv_register: no display registered hence can't attach the indev to " + "a display"); + return NULL; + } + + lv_indev_t * indev = _lv_ll_ins_head(&LV_GC_ROOT(_lv_indev_ll)); + LV_ASSERT_MALLOC(indev); + if(!indev) { + return NULL; + } + + lv_memset_00(indev, sizeof(lv_indev_t)); + indev->driver = driver; + + indev->proc.reset_query = 1; + indev->driver->read_timer = lv_timer_create(lv_indev_read_timer_cb, LV_INDEV_DEF_READ_PERIOD, indev); + + return indev; +} + +/** + * Update the driver in run time. + * @param indev pointer to a input device. (return value of `lv_indev_drv_register`) + * @param new_drv pointer to the new driver + */ +void lv_indev_drv_update(lv_indev_t * indev, lv_indev_drv_t * new_drv) +{ + LV_ASSERT_NULL(indev); + LV_ASSERT_NULL(indev->driver); + LV_ASSERT_NULL(indev->driver->read_timer); + lv_timer_del(indev->driver->read_timer); + + LV_ASSERT_NULL(new_drv); + if(new_drv->disp == NULL) { + new_drv->disp = lv_disp_get_default(); + } + if(new_drv->disp == NULL) { + LV_LOG_WARN("lv_indev_drv_register: no display registered hence can't attach the indev to " + "a display"); + indev->proc.disabled = true; + return; + } + + indev->driver = new_drv; + indev->driver->read_timer = lv_timer_create(lv_indev_read_timer_cb, LV_INDEV_DEF_READ_PERIOD, indev); + indev->proc.reset_query = 1; +} + +/** +* Remove the provided input device. Make sure not to use the provided input device afterwards anymore. +* @param indev pointer to delete +*/ +void lv_indev_delete(lv_indev_t * indev) +{ + LV_ASSERT_NULL(indev); + LV_ASSERT_NULL(indev->driver); + LV_ASSERT_NULL(indev->driver->read_timer); + /*Clean up the read timer first*/ + lv_timer_del(indev->driver->read_timer); + /*Remove the input device from the list*/ + _lv_ll_remove(&LV_GC_ROOT(_lv_indev_ll), indev); + /*Free the memory of the input device*/ + lv_mem_free(indev); +} + +/** + * Get the next input device. + * @param indev pointer to the current input device. NULL to initialize. + * @return the next input devise or NULL if no more. Give the first input device when the parameter + * is NULL + */ +lv_indev_t * lv_indev_get_next(lv_indev_t * indev) +{ + if(indev == NULL) + return _lv_ll_get_head(&LV_GC_ROOT(_lv_indev_ll)); + else + return _lv_ll_get_next(&LV_GC_ROOT(_lv_indev_ll), indev); +} + +/** + * Read data from an input device. + * @param indev pointer to an input device + * @param data input device will write its data here + */ +void _lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data) +{ + lv_memset_00(data, sizeof(lv_indev_data_t)); + + /* For touchpad sometimes users don't set the last pressed coordinate on release. + * So be sure a coordinates are initialized to the last point */ + if(indev->driver->type == LV_INDEV_TYPE_POINTER) { + data->point.x = indev->proc.types.pointer.last_raw_point.x; + data->point.y = indev->proc.types.pointer.last_raw_point.y; + } + /*Similarly set at least the last key in case of the user doesn't set it on release*/ + else if(indev->driver->type == LV_INDEV_TYPE_KEYPAD) { + data->key = indev->proc.types.keypad.last_key; + } + /*For compatibility assume that used button was enter (encoder push)*/ + else if(indev->driver->type == LV_INDEV_TYPE_ENCODER) { + data->key = LV_KEY_ENTER; + } + + if(indev->driver->read_cb) { + INDEV_TRACE("calling indev_read_cb"); + indev->driver->read_cb(indev->driver, data); + } + else { + LV_LOG_WARN("indev_read_cb is not registered"); + } +} + +/********************** + * STATIC FUNCTIONS + **********************/ diff --git a/L3_Middlewares/LVGL/src/hal/lv_hal_indev.h b/L3_Middlewares/LVGL/src/hal/lv_hal_indev.h new file mode 100644 index 0000000..5bbcf53 --- /dev/null +++ b/L3_Middlewares/LVGL/src/hal/lv_hal_indev.h @@ -0,0 +1,240 @@ +/** + * @file lv_hal_indev.h + * + * @description Input Device HAL interface layer header file + * + */ + +#ifndef LV_HAL_INDEV_H +#define LV_HAL_INDEV_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" + +#include +#include +#include "../misc/lv_area.h" +#include "../misc/lv_timer.h" + +/********************* + * DEFINES + *********************/ + +/*Drag threshold in pixels*/ +#define LV_INDEV_DEF_SCROLL_LIMIT 10 + +/*Drag throw slow-down in [%]. Greater value -> faster slow-down*/ +#define LV_INDEV_DEF_SCROLL_THROW 10 + +/*Long press time in milliseconds. + *Time to send `LV_EVENT_LONG_PRESSSED`)*/ +#define LV_INDEV_DEF_LONG_PRESS_TIME 400 + +/*Repeated trigger period in long press [ms] + *Time between `LV_EVENT_LONG_PRESSED_REPEAT*/ +#define LV_INDEV_DEF_LONG_PRESS_REP_TIME 100 + + +/*Gesture threshold in pixels*/ +#define LV_INDEV_DEF_GESTURE_LIMIT 50 + +/*Gesture min velocity at release before swipe (pixels)*/ +#define LV_INDEV_DEF_GESTURE_MIN_VELOCITY 3 + + +/********************** + * TYPEDEFS + **********************/ + +struct _lv_obj_t; +struct _lv_disp_t; +struct _lv_group_t; +struct _lv_indev_t; +struct _lv_indev_drv_t; + +/** Possible input device types*/ +typedef enum { + LV_INDEV_TYPE_NONE, /**< Uninitialized state*/ + LV_INDEV_TYPE_POINTER, /**< Touch pad, mouse, external button*/ + LV_INDEV_TYPE_KEYPAD, /**< Keypad or keyboard*/ + LV_INDEV_TYPE_BUTTON, /**< External (hardware button) which is assigned to a specific point of the screen*/ + LV_INDEV_TYPE_ENCODER, /**< Encoder with only Left, Right turn and a Button*/ +} lv_indev_type_t; + +/** States for input devices*/ +typedef enum { + LV_INDEV_STATE_RELEASED = 0, + LV_INDEV_STATE_PRESSED +} lv_indev_state_t; + +/** Data structure passed to an input driver to fill*/ +typedef struct { + lv_point_t point; /**< For LV_INDEV_TYPE_POINTER the currently pressed point*/ + uint32_t key; /**< For LV_INDEV_TYPE_KEYPAD the currently pressed key*/ + uint32_t btn_id; /**< For LV_INDEV_TYPE_BUTTON the currently pressed button*/ + int16_t enc_diff; /**< For LV_INDEV_TYPE_ENCODER number of steps since the previous read*/ + + lv_indev_state_t state; /**< LV_INDEV_STATE_REL or LV_INDEV_STATE_PR*/ + bool continue_reading; /**< If set to true, the read callback is invoked again*/ +} lv_indev_data_t; + +/** Initialized by the user and registered by 'lv_indev_add()'*/ +typedef struct _lv_indev_drv_t { + + /**< Input device type*/ + lv_indev_type_t type; + + /**< Function pointer to read input device data.*/ + void (*read_cb)(struct _lv_indev_drv_t * indev_drv, lv_indev_data_t * data); + + /** Called when an action happened on the input device. + * The second parameter is the event from `lv_event_t`*/ + void (*feedback_cb)(struct _lv_indev_drv_t *, uint8_t); + +#if LV_USE_USER_DATA + void * user_data; +#endif + + /**< Pointer to the assigned display*/ + struct _lv_disp_t * disp; + + /**< Timer to periodically read the input device*/ + lv_timer_t * read_timer; + + /**< Number of pixels to slide before actually drag the object*/ + uint8_t scroll_limit; + + /**< Drag throw slow-down in [%]. Greater value means faster slow-down*/ + uint8_t scroll_throw; + + /**< At least this difference should be between two points to evaluate as gesture*/ + uint8_t gesture_min_velocity; + + /**< At least this difference should be to send a gesture*/ + uint8_t gesture_limit; + + /**< Long press time in milliseconds*/ + uint16_t long_press_time; + + /**< Repeated trigger period in long press [ms]*/ + uint16_t long_press_repeat_time; +} lv_indev_drv_t; + +/** Run time data of input devices + * Internally used by the library, you should not need to touch it. + */ +typedef struct _lv_indev_proc_t { + lv_indev_state_t state; /**< Current state of the input device.*/ + /*Flags*/ + uint8_t long_pr_sent : 1; + uint8_t reset_query : 1; + uint8_t disabled : 1; + uint8_t wait_until_release : 1; + + union { + struct { + /*Pointer and button data*/ + lv_point_t act_point; /**< Current point of input device.*/ + lv_point_t indev_point; + lv_point_t last_point; /**< Last point of input device.*/ + lv_point_t last_raw_point; /**< Last point read from read_cb. */ + lv_point_t vect; /**< Difference between `act_point` and `last_point`.*/ + lv_point_t scroll_sum; /*Count the dragged pixels to check LV_INDEV_DEF_SCROLL_LIMIT*/ + lv_point_t scroll_throw_vect; + lv_point_t scroll_throw_vect_ori; + struct _lv_obj_t * act_obj; /*The object being pressed*/ + struct _lv_obj_t * last_obj; /*The last object which was pressed*/ + struct _lv_obj_t * scroll_obj; /*The object being scrolled*/ + struct _lv_obj_t * last_pressed; /*The lastly pressed object*/ + lv_area_t scroll_area; + + lv_point_t gesture_sum; /*Count the gesture pixels to check LV_INDEV_DEF_GESTURE_LIMIT*/ + /*Flags*/ + lv_dir_t scroll_dir : 4; + lv_dir_t gesture_dir : 4; + uint8_t gesture_sent : 1; + } pointer; + struct { + /*Keypad data*/ + lv_indev_state_t last_state; + uint32_t last_key; + } keypad; + } types; + + uint32_t pr_timestamp; /**< Pressed time stamp*/ + uint32_t longpr_rep_timestamp; /**< Long press repeat time stamp*/ +} _lv_indev_proc_t; + +/** The main input device descriptor with driver, runtime data ('proc') and some additional + * information*/ +typedef struct _lv_indev_t { + struct _lv_indev_drv_t * driver; + _lv_indev_proc_t proc; + struct _lv_obj_t * cursor; /**< Cursor for LV_INPUT_TYPE_POINTER*/ + struct _lv_group_t * group; /**< Keypad destination group*/ + const lv_point_t * btn_points; /**< Array points assigned to the button ()screen will be pressed + here by the buttons*/ +} lv_indev_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Initialize an input device driver with default values. + * It is used to surely have known values in the fields and not memory junk. + * After it you can set the fields. + * @param driver pointer to driver variable to initialize + */ +void lv_indev_drv_init(struct _lv_indev_drv_t * driver); + +/** + * Register an initialized input device driver. + * @param driver pointer to an initialized 'lv_indev_drv_t' variable (can be local variable) + * @return pointer to the new input device or NULL on error + */ +lv_indev_t * lv_indev_drv_register(struct _lv_indev_drv_t * driver); + +/** + * Update the driver in run time. + * @param indev pointer to an input device. (return value of `lv_indev_drv_register`) + * @param new_drv pointer to the new driver + */ +void lv_indev_drv_update(lv_indev_t * indev, struct _lv_indev_drv_t * new_drv); + +/** +* Remove the provided input device. Make sure not to use the provided input device afterwards anymore. +* @param indev pointer to delete +*/ +void lv_indev_delete(lv_indev_t * indev); + +/** + * Get the next input device. + * @param indev pointer to the current input device. NULL to initialize. + * @return the next input device or NULL if there are no more. Provide the first input device when + * the parameter is NULL + */ +lv_indev_t * lv_indev_get_next(lv_indev_t * indev); + +/** + * Read data from an input device. + * @param indev pointer to an input device + * @param data input device will write its data here + */ +void _lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/L3_Middlewares/LVGL/src/tick/lv_tick.c b/L3_Middlewares/LVGL/src/hal/lv_hal_tick.c similarity index 53% rename from L3_Middlewares/LVGL/src/tick/lv_tick.c rename to L3_Middlewares/LVGL/src/hal/lv_hal_tick.c index 21e2295..6c84346 100644 --- a/L3_Middlewares/LVGL/src/tick/lv_tick.c +++ b/L3_Middlewares/LVGL/src/hal/lv_hal_tick.c @@ -1,19 +1,21 @@ /** - * @file lv_tick.c + * @file lv_hal_tick.c * Provide access to the system tick with 1 millisecond resolution */ /********************* * INCLUDES *********************/ -#include "lv_tick_private.h" -#include "../misc/lv_types.h" -#include "../core/lv_global.h" +#include "lv_hal_tick.h" +#include + +#if LV_TICK_CUSTOM == 1 + #include LV_TICK_CUSTOM_INCLUDE +#endif /********************* * DEFINES *********************/ -#define state LV_GLOBAL_DEFAULT()->tick_state /********************** * TYPEDEFS @@ -26,6 +28,10 @@ /********************** * STATIC VARIABLES **********************/ +#if !LV_TICK_CUSTOM + static uint32_t sys_time = 0; + static volatile uint8_t tick_irq_flag; +#endif /********************** * MACROS @@ -35,20 +41,25 @@ * GLOBAL FUNCTIONS **********************/ -LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period) +#if !LV_TICK_CUSTOM +/** + * You have to call this function periodically + * @param tick_period the call period of this function in milliseconds + */ +void LV_ATTRIBUTE_TICK_INC lv_tick_inc(uint32_t tick_period) { - lv_tick_state_t * state_p = &state; - - state_p->sys_irq_flag = 0; - state_p->sys_time += tick_period; + tick_irq_flag = 0; + sys_time += tick_period; } +#endif +/** + * Get the elapsed milliseconds since start up + * @return the elapsed milliseconds + */ uint32_t lv_tick_get(void) { - lv_tick_state_t * state_p = &state; - - if(state_p->tick_get_cb) - return state_p->tick_get_cb(); +#if LV_TICK_CUSTOM == 0 /*If `lv_tick_inc` is called from an interrupt while `sys_time` is read *the result might be corrupted. @@ -57,13 +68,21 @@ uint32_t lv_tick_get(void) *until `tick_irq_flag` remains `1`.*/ uint32_t result; do { - state_p->sys_irq_flag = 1; - result = state_p->sys_time; - } while(!state_p->sys_irq_flag); /*Continue until see a non interrupted cycle*/ + tick_irq_flag = 1; + result = sys_time; + } while(!tick_irq_flag); /*Continue until see a non interrupted cycle*/ return result; +#else + return LV_TICK_CUSTOM_SYS_TIME_EXPR; +#endif } +/** + * Get the elapsed milliseconds since a previous time stamp + * @param prev_tick a previous time stamp (return value of lv_tick_get() ) + * @return the elapsed milliseconds since 'prev_tick' + */ uint32_t lv_tick_elaps(uint32_t prev_tick) { uint32_t act_time = lv_tick_get(); @@ -80,34 +99,6 @@ uint32_t lv_tick_elaps(uint32_t prev_tick) return prev_tick; } -void lv_delay_ms(uint32_t ms) -{ - if(state.delay_cb) { - state.delay_cb(ms); - } - else { - uint32_t t = lv_tick_get(); - while(lv_tick_elaps(t) < ms) { - /*Do something to no call `lv_tick_elaps` too often as it might interfere with interrupts*/ - volatile uint32_t i; - volatile uint32_t x = ms; - for(i = 0; i < 100; i++) { - x = x * 3; - } - } - } -} - -void lv_tick_set_cb(lv_tick_get_cb_t cb) -{ - state.tick_get_cb = cb; -} - -void lv_delay_set_cb(lv_delay_cb_t cb) -{ - state.delay_cb = cb; -} - /********************** * STATIC FUNCTIONS **********************/ diff --git a/L3_Middlewares/LVGL/src/hal/lv_hal_tick.h b/L3_Middlewares/LVGL/src/hal/lv_hal_tick.h new file mode 100644 index 0000000..d493ad3 --- /dev/null +++ b/L3_Middlewares/LVGL/src/hal/lv_hal_tick.h @@ -0,0 +1,69 @@ +/** + * @file lv_hal_tick.h + * Provide access to the system tick with 1 millisecond resolution + */ + +#ifndef LV_HAL_TICK_H +#define LV_HAL_TICK_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" + +#include +#include + +/********************* + * DEFINES + *********************/ +#ifndef LV_ATTRIBUTE_TICK_INC +#define LV_ATTRIBUTE_TICK_INC +#endif + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +//! @cond Doxygen_Suppress + +#if !LV_TICK_CUSTOM +/** + * You have to call this function periodically + * @param tick_period the call period of this function in milliseconds + */ +void /* LV_ATTRIBUTE_TICK_INC */ lv_tick_inc(uint32_t tick_period); +#endif + +//! @endcond + +/** + * Get the elapsed milliseconds since start up + * @return the elapsed milliseconds + */ +uint32_t lv_tick_get(void); + +/** + * Get the elapsed milliseconds since a previous time stamp + * @param prev_tick a previous time stamp (return value of lv_tick_get() ) + * @return the elapsed milliseconds since 'prev_tick' + */ +uint32_t lv_tick_elaps(uint32_t prev_tick); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_HAL_TICK_H*/ diff --git a/L3_Middlewares/LVGL/src/indev/lv_indev.c b/L3_Middlewares/LVGL/src/indev/lv_indev.c deleted file mode 100644 index 3a4a572..0000000 --- a/L3_Middlewares/LVGL/src/indev/lv_indev.c +++ /dev/null @@ -1,1741 +0,0 @@ -#include "lv_indev_private.h" -#include "../misc/lv_event_private.h" -#include "../misc/lv_area_private.h" -#include "../misc/lv_anim_private.h" -#include "../core/lv_obj_draw_private.h" -/** - * @file lv_indev.c - * - */ - -/********************* - * INCLUDES - ********************/ -#include "lv_indev_scroll.h" -#include "../display/lv_display_private.h" -#include "../core/lv_global.h" -#include "../core/lv_obj_private.h" -#include "../core/lv_group.h" -#include "../core/lv_refr.h" - -#include "../tick/lv_tick.h" -#include "../misc/lv_timer_private.h" -#include "../misc/lv_math.h" -#include "../misc/lv_profiler.h" -#include "../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ -/*Drag threshold in pixels*/ -#define LV_INDEV_DEF_SCROLL_LIMIT 10 - -/*Drag throw slow-down in [%]. Greater value -> faster slow-down*/ -#define LV_INDEV_DEF_SCROLL_THROW 10 - -/*Long press time in milliseconds. - *Time to send `LV_EVENT_LONG_PRESSED`)*/ -#define LV_INDEV_DEF_LONG_PRESS_TIME 400 - -/*Repeated trigger period in long press [ms] - *Time between `LV_EVENT_LONG_PRESSED_REPEAT*/ -#define LV_INDEV_DEF_LONG_PRESS_REP_TIME 100 - -/*Gesture threshold in pixels*/ -#define LV_INDEV_DEF_GESTURE_LIMIT 50 - -/*Gesture min velocity at release before swipe (pixels)*/ -#define LV_INDEV_DEF_GESTURE_MIN_VELOCITY 3 - -/**< Rotary diff count will be multiplied by this and divided by 256 */ -#define LV_INDEV_DEF_ROTARY_SENSITIVITY 256 - -#if LV_INDEV_DEF_SCROLL_THROW <= 0 - #warning "LV_INDEV_DEF_SCROLL_THROW must be greater than 0" -#endif - -#define indev_act LV_GLOBAL_DEFAULT()->indev_active -#define indev_obj_act LV_GLOBAL_DEFAULT()->indev_obj_active -#define indev_ll_head &(LV_GLOBAL_DEFAULT()->indev_ll) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data); -static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data); -static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data); -static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data); -static void indev_proc_press(lv_indev_t * indev); -static void indev_proc_release(lv_indev_t * indev); -static void indev_proc_pointer_diff(lv_indev_t * indev); -static lv_obj_t * pointer_search_obj(lv_display_t * disp, lv_point_t * p); -static void indev_proc_reset_query_handler(lv_indev_t * indev); -static void indev_click_focus(lv_indev_t * indev); -static void indev_gesture(lv_indev_t * indev); -static bool indev_reset_check(lv_indev_t * indev); -static void indev_read_core(lv_indev_t * indev, lv_indev_data_t * data); -static void indev_reset_core(lv_indev_t * indev, lv_obj_t * obj); -static lv_result_t send_event(lv_event_code_t code, void * param); - -static void indev_scroll_throw_anim_start(lv_indev_t * indev); -static void indev_scroll_throw_anim_cb(void * var, int32_t v); -static void indev_scroll_throw_anim_completed_cb(lv_anim_t * anim); -static inline void indev_scroll_throw_anim_reset(lv_indev_t * indev) -{ - if(indev) { - indev->pointer.scroll_throw_vect.x = 0; - indev->pointer.scroll_throw_vect.y = 0; - indev->scroll_throw_anim = NULL; - } -} - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ -#if LV_USE_LOG && LV_LOG_TRACE_INDEV - #define LV_TRACE_INDEV(...) LV_LOG_TRACE(__VA_ARGS__) -#else - #define LV_TRACE_INDEV(...) -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_indev_t * lv_indev_create(void) -{ - lv_display_t * disp = lv_display_get_default(); - if(disp == NULL) { - LV_LOG_WARN("no display was created so far"); - } - - lv_indev_t * indev = lv_ll_ins_head(indev_ll_head); - LV_ASSERT_MALLOC(indev); - if(indev == NULL) { - return NULL; - } - - lv_memzero(indev, sizeof(lv_indev_t)); - indev->reset_query = 1; - indev->enabled = 1; - - indev->read_timer = lv_timer_create(lv_indev_read_timer_cb, LV_DEF_REFR_PERIOD, indev); - - indev->disp = lv_display_get_default(); - indev->type = LV_INDEV_TYPE_NONE; - indev->mode = LV_INDEV_MODE_TIMER; - indev->scroll_limit = LV_INDEV_DEF_SCROLL_LIMIT; - indev->scroll_throw = LV_INDEV_DEF_SCROLL_THROW; - indev->long_press_time = LV_INDEV_DEF_LONG_PRESS_TIME; - indev->long_press_repeat_time = LV_INDEV_DEF_LONG_PRESS_REP_TIME; - indev->gesture_limit = LV_INDEV_DEF_GESTURE_LIMIT; - indev->gesture_min_velocity = LV_INDEV_DEF_GESTURE_MIN_VELOCITY; - indev->rotary_sensitivity = LV_INDEV_DEF_ROTARY_SENSITIVITY; - return indev; -} - -void lv_indev_delete(lv_indev_t * indev) -{ - LV_ASSERT_NULL(indev); - - lv_indev_send_event(indev, LV_EVENT_DELETE, NULL); - lv_event_remove_all(&(indev->event_list)); - - /*Clean up the read timer first*/ - if(indev->read_timer) lv_timer_delete(indev->read_timer); - - /*Remove the input device from the list*/ - lv_ll_remove(indev_ll_head, indev); - /*Free the memory of the input device*/ - lv_free(indev); -} - -lv_indev_t * lv_indev_get_next(lv_indev_t * indev) -{ - if(indev == NULL) - return lv_ll_get_head(indev_ll_head); - else - return lv_ll_get_next(indev_ll_head, indev); -} - -void indev_read_core(lv_indev_t * indev, lv_indev_data_t * data) -{ - LV_PROFILER_BEGIN; - lv_memzero(data, sizeof(lv_indev_data_t)); - - /* For touchpad sometimes users don't set the last pressed coordinate on release. - * So be sure a coordinates are initialized to the last point */ - if(indev->type == LV_INDEV_TYPE_POINTER) { - data->point.x = indev->pointer.last_raw_point.x; - data->point.y = indev->pointer.last_raw_point.y; - } - /*Similarly set at least the last key in case of the user doesn't set it on release*/ - else if(indev->type == LV_INDEV_TYPE_KEYPAD) { - data->key = indev->keypad.last_key; - } - /*For compatibility assume that used button was enter (encoder push)*/ - else if(indev->type == LV_INDEV_TYPE_ENCODER) { - data->key = LV_KEY_ENTER; - } - - if(indev->read_cb) { - LV_TRACE_INDEV("calling indev_read_cb"); - indev->read_cb(indev, data); - } - else { - LV_LOG_WARN("indev_read_cb is not registered"); - } - LV_PROFILER_END; -} - -void lv_indev_read_timer_cb(lv_timer_t * timer) -{ - lv_indev_read(timer->user_data); -} - -void lv_indev_read(lv_indev_t * indev) -{ - if(indev == NULL) return; - - LV_TRACE_INDEV("begin"); - - indev_act = indev; - - /*Read and process all indevs*/ - if(indev->disp == NULL) return; /*Not assigned to any displays*/ - - /*Handle reset query before processing the point*/ - indev_proc_reset_query_handler(indev); - - if(indev->enabled == 0) return; - if(indev->disp->prev_scr != NULL) { - LV_TRACE_INDEV("input blocked while screen animation active"); - return; - } - - LV_PROFILER_BEGIN; - - bool continue_reading; - lv_indev_data_t data; - - do { - /*Read the data*/ - indev_read_core(indev, &data); - continue_reading = indev->mode != LV_INDEV_MODE_EVENT && data.continue_reading; - - /*The active object might be deleted even in the read function*/ - indev_proc_reset_query_handler(indev); - indev_obj_act = NULL; - - indev->state = data.state; - - /*Save the last activity time*/ - if(indev->state == LV_INDEV_STATE_PRESSED) { - indev->disp->last_activity_time = lv_tick_get(); - } - else if(indev->type == LV_INDEV_TYPE_ENCODER && data.enc_diff) { - indev->disp->last_activity_time = lv_tick_get(); - } - - if(indev->type == LV_INDEV_TYPE_POINTER) { - indev_pointer_proc(indev, &data); - } - else if(indev->type == LV_INDEV_TYPE_KEYPAD) { - indev_keypad_proc(indev, &data); - } - else if(indev->type == LV_INDEV_TYPE_ENCODER) { - indev_encoder_proc(indev, &data); - } - else if(indev->type == LV_INDEV_TYPE_BUTTON) { - indev_button_proc(indev, &data); - } - /*Handle reset query if it happened in during processing*/ - indev_proc_reset_query_handler(indev); - } while(continue_reading); - - /*End of indev processing, so no act indev*/ - indev_act = NULL; - indev_obj_act = NULL; - - LV_TRACE_INDEV("finished"); - LV_PROFILER_END; -} - -void lv_indev_enable(lv_indev_t * indev, bool enable) -{ - if(indev) { - indev->enabled = (uint8_t) enable; - } - else { - lv_indev_t * i = lv_indev_get_next(NULL); - while(i) { - i->enabled = (uint8_t) enable; - i = lv_indev_get_next(i); - } - } -} - -lv_indev_t * lv_indev_active(void) -{ - return indev_act; -} - -void lv_indev_set_type(lv_indev_t * indev, lv_indev_type_t indev_type) -{ - if(indev == NULL) return; - - indev->type = indev_type; - indev->reset_query = 1; -} - -void lv_indev_set_read_cb(lv_indev_t * indev, lv_indev_read_cb_t read_cb) -{ - if(indev == NULL) return; - - indev->read_cb = read_cb; -} - -void lv_indev_set_user_data(lv_indev_t * indev, void * user_data) -{ - if(indev == NULL) return; - indev->user_data = user_data; -} - -void lv_indev_set_driver_data(lv_indev_t * indev, void * driver_data) -{ - if(indev == NULL) return; - indev->driver_data = driver_data; -} - -lv_indev_read_cb_t lv_indev_get_read_cb(lv_indev_t * indev) -{ - if(indev == NULL) { - LV_LOG_WARN("lv_indev_get_read_cb: indev was NULL"); - return NULL; - } - - return indev->read_cb; -} - -lv_indev_type_t lv_indev_get_type(const lv_indev_t * indev) -{ - if(indev == NULL) return LV_INDEV_TYPE_NONE; - - return indev->type; -} - -lv_indev_state_t lv_indev_get_state(const lv_indev_t * indev) -{ - if(indev == NULL) return LV_INDEV_STATE_RELEASED; - - return indev->state; -} - -lv_group_t * lv_indev_get_group(const lv_indev_t * indev) -{ - if(indev == NULL) return NULL; - - return indev->group; -} - -lv_display_t * lv_indev_get_display(const lv_indev_t * indev) -{ - if(indev == NULL) return NULL; - - return indev->disp; -} - -void lv_indev_set_display(lv_indev_t * indev, lv_display_t * disp) -{ - if(indev == NULL) return; - - indev->disp = disp; -} - -void lv_indev_set_long_press_time(lv_indev_t * indev, uint16_t long_press_time) -{ - if(indev == NULL) return; - - indev->long_press_time = long_press_time; -} - -void lv_indev_set_scroll_limit(lv_indev_t * indev, uint8_t scroll_limit) -{ - if(indev == NULL) return; - - indev->scroll_limit = scroll_limit; -} - -void lv_indev_set_scroll_throw(lv_indev_t * indev, uint8_t scroll_throw) -{ - if(indev == NULL) return; - - indev->scroll_throw = scroll_throw; -} - -void * lv_indev_get_user_data(const lv_indev_t * indev) -{ - if(indev == NULL) return NULL; - return indev->user_data; -} - -void * lv_indev_get_driver_data(const lv_indev_t * indev) -{ - if(indev == NULL) return NULL; - - return indev->driver_data; -} - -bool lv_indev_get_press_moved(const lv_indev_t * indev) -{ - if(indev == NULL) return false; - - return indev->pointer.press_moved; -} - -void lv_indev_reset(lv_indev_t * indev, lv_obj_t * obj) -{ - if(indev) { - indev_reset_core(indev, obj); - } - else { - lv_indev_t * i = lv_indev_get_next(NULL); - while(i) { - indev_reset_core(i, obj); - i = lv_indev_get_next(i); - } - indev_obj_act = NULL; - } -} - -void lv_indev_stop_processing(lv_indev_t * indev) -{ - if(indev == NULL) return; - indev->stop_processing_query = 1; -} - -void lv_indev_reset_long_press(lv_indev_t * indev) -{ - indev->long_pr_sent = 0; - indev->longpr_rep_timestamp = lv_tick_get(); - indev->pr_timestamp = lv_tick_get(); -} - -void lv_indev_set_cursor(lv_indev_t * indev, lv_obj_t * cur_obj) -{ - if(indev->type != LV_INDEV_TYPE_POINTER) return; - - indev->cursor = cur_obj; - lv_obj_set_parent(indev->cursor, lv_display_get_layer_sys(indev->disp)); - lv_obj_set_pos(indev->cursor, indev->pointer.act_point.x, indev->pointer.act_point.y); - lv_obj_remove_flag(indev->cursor, LV_OBJ_FLAG_CLICKABLE); - lv_obj_add_flag(indev->cursor, LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_FLOATING); -} - -void lv_indev_set_group(lv_indev_t * indev, lv_group_t * group) -{ - if(indev && (indev->type == LV_INDEV_TYPE_KEYPAD || indev->type == LV_INDEV_TYPE_ENCODER)) { - indev->group = group; - } -} - -void lv_indev_set_button_points(lv_indev_t * indev, const lv_point_t points[]) -{ - if(indev && indev->type == LV_INDEV_TYPE_BUTTON) { - indev->btn_points = points; - } -} - -void lv_indev_get_point(const lv_indev_t * indev, lv_point_t * point) -{ - if(indev == NULL) { - point->x = 0; - point->y = 0; - } - else if(indev->type != LV_INDEV_TYPE_POINTER && indev->type != LV_INDEV_TYPE_BUTTON) { - point->x = -1; - point->y = -1; - } - else { - point->x = indev->pointer.act_point.x; - point->y = indev->pointer.act_point.y; - } -} - -lv_dir_t lv_indev_get_gesture_dir(const lv_indev_t * indev) -{ - return indev->pointer.gesture_dir; -} - -uint32_t lv_indev_get_key(const lv_indev_t * indev) -{ - uint32_t key = 0; - - if(indev && indev->type == LV_INDEV_TYPE_KEYPAD) - key = indev->keypad.last_key; - - return key; -} - -lv_dir_t lv_indev_get_scroll_dir(const lv_indev_t * indev) -{ - if(indev == NULL) return false; - if(indev->type != LV_INDEV_TYPE_POINTER && indev->type != LV_INDEV_TYPE_BUTTON) return false; - return indev->pointer.scroll_dir; -} - -lv_obj_t * lv_indev_get_scroll_obj(const lv_indev_t * indev) -{ - if(indev == NULL) return NULL; - if(indev->type != LV_INDEV_TYPE_POINTER && indev->type != LV_INDEV_TYPE_BUTTON) return NULL; - return indev->pointer.scroll_obj; -} - -void lv_indev_get_vect(const lv_indev_t * indev, lv_point_t * point) -{ - point->x = 0; - point->y = 0; - - if(indev == NULL) return; - - if(indev->type == LV_INDEV_TYPE_POINTER || indev->type == LV_INDEV_TYPE_BUTTON) { - point->x = indev->pointer.vect.x; - point->y = indev->pointer.vect.y; - } -} - -void lv_indev_wait_release(lv_indev_t * indev) -{ - if(indev == NULL)return; - indev->wait_until_release = 1; -} - -lv_obj_t * lv_indev_get_active_obj(void) -{ - return indev_obj_act; -} - -lv_timer_t * lv_indev_get_read_timer(lv_indev_t * indev) -{ - if(indev == NULL) { - LV_LOG_WARN("lv_indev_get_read_timer: indev was NULL"); - return NULL; - } - - return indev->read_timer; -} - -lv_indev_mode_t lv_indev_get_mode(lv_indev_t * indev) -{ - if(indev) return indev->mode; - return LV_INDEV_MODE_NONE; -} - -void lv_indev_set_mode(lv_indev_t * indev, lv_indev_mode_t mode) -{ - if(indev == NULL || indev->mode == mode) - return; - - indev->mode = mode; - if(indev->read_timer) { - if(mode == LV_INDEV_MODE_EVENT) { - lv_timer_pause(indev->read_timer); - } - else if(mode == LV_INDEV_MODE_TIMER) { - /* use default timer mode*/ - lv_timer_set_cb(indev->read_timer, lv_indev_read_timer_cb); - lv_timer_resume(indev->read_timer); - } - } -} - -lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point) -{ - lv_obj_t * found_p = NULL; - - /*If this obj is hidden the children are hidden too so return immediately*/ - if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return NULL; - - lv_point_t p_trans = *point; - lv_obj_transform_point(obj, &p_trans, LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE); - - bool hit_test_ok = lv_obj_hit_test(obj, &p_trans); - - /*If the point is on this object check its children too*/ - lv_area_t obj_coords = obj->coords; - if(lv_obj_has_flag(obj, LV_OBJ_FLAG_OVERFLOW_VISIBLE)) { - int32_t ext_draw_size = lv_obj_get_ext_draw_size(obj); - lv_area_increase(&obj_coords, ext_draw_size, ext_draw_size); - } - if(lv_area_is_point_on(&obj_coords, &p_trans, 0)) { - int32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); - - /*If a child matches use it*/ - for(i = child_cnt - 1; i >= 0; i--) { - lv_obj_t * child = obj->spec_attr->children[i]; - found_p = lv_indev_search_obj(child, &p_trans); - if(found_p) return found_p; - } - } - - /*If not return earlier for a clicked child and this obj's hittest was ok use it - *else return NULL*/ - if(hit_test_ok) return obj; - else return NULL; -} - -void lv_indev_add_event_cb(lv_indev_t * indev, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data) -{ - LV_ASSERT_NULL(indev); - - lv_event_add(&indev->event_list, event_cb, filter, user_data); -} - -uint32_t lv_indev_get_event_count(lv_indev_t * indev) -{ - LV_ASSERT_NULL(indev); - return lv_event_get_count(&indev->event_list); -} - -lv_event_dsc_t * lv_indev_get_event_dsc(lv_indev_t * indev, uint32_t index) -{ - LV_ASSERT_NULL(indev); - return lv_event_get_dsc(&indev->event_list, index); - -} - -bool lv_indev_remove_event(lv_indev_t * indev, uint32_t index) -{ - LV_ASSERT_NULL(indev); - - return lv_event_remove(&indev->event_list, index); -} - -uint32_t lv_indev_remove_event_cb_with_user_data(lv_indev_t * indev, lv_event_cb_t event_cb, void * user_data) -{ - LV_ASSERT_NULL(indev); - - uint32_t event_cnt = lv_indev_get_event_count(indev); - uint32_t removed_count = 0; - int32_t i; - - for(i = event_cnt - 1; i >= 0; i--) { - lv_event_dsc_t * dsc = lv_indev_get_event_dsc(indev, i); - if(dsc && dsc->cb == event_cb && dsc->user_data == user_data) { - lv_indev_remove_event(indev, i); - removed_count ++; - } - } - - return removed_count; -} - -lv_result_t lv_indev_send_event(lv_indev_t * indev, lv_event_code_t code, void * param) -{ - - lv_event_t e; - lv_memzero(&e, sizeof(e)); - e.code = code; - e.current_target = indev; - e.original_target = indev; - e.param = param; - lv_result_t res; - res = lv_event_send(&indev->event_list, &e, true); - if(res != LV_RESULT_OK) return res; - - res = lv_event_send(&indev->event_list, &e, false); - if(res != LV_RESULT_OK) return res; - - return res; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Process a new point from LV_INDEV_TYPE_POINTER input device - * @param i pointer to an input device - * @param data pointer to the data read from the input device - */ -static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data) -{ - lv_display_t * disp = i->disp; - /*Save the raw points so they can be used again in indev_read_core*/ - i->pointer.last_raw_point.x = data->point.x; - i->pointer.last_raw_point.y = data->point.y; - - if(disp->rotation == LV_DISPLAY_ROTATION_180 || disp->rotation == LV_DISPLAY_ROTATION_270) { - data->point.x = disp->hor_res - data->point.x - 1; - data->point.y = disp->ver_res - data->point.y - 1; - } - if(disp->rotation == LV_DISPLAY_ROTATION_90 || disp->rotation == LV_DISPLAY_ROTATION_270) { - int32_t tmp = data->point.y; - data->point.y = data->point.x; - data->point.x = disp->ver_res - tmp - 1; - } - - /*Simple sanity check*/ - if(data->point.x < 0) { - LV_LOG_WARN("X is %d which is smaller than zero", (int)data->point.x); - } - if(data->point.x >= lv_display_get_horizontal_resolution(i->disp)) { - LV_LOG_WARN("X is %d which is greater than hor. res", (int)data->point.x); - } - if(data->point.y < 0) { - LV_LOG_WARN("Y is %d which is smaller than zero", (int)data->point.y); - } - if(data->point.y >= lv_display_get_vertical_resolution(i->disp)) { - LV_LOG_WARN("Y is %d which is greater than ver. res", (int)data->point.y); - } - - /*Move the cursor if set and moved*/ - if(i->cursor != NULL && - (i->pointer.last_point.x != data->point.x || i->pointer.last_point.y != data->point.y)) { - lv_obj_set_pos(i->cursor, data->point.x, data->point.y); - } - - i->pointer.act_point.x = data->point.x; - i->pointer.act_point.y = data->point.y; - i->pointer.diff = data->enc_diff; - - /*Process the diff first as scrolling will be processed in indev_proc_release*/ - indev_proc_pointer_diff(i); - - if(i->state == LV_INDEV_STATE_PRESSED) { - indev_proc_press(i); - } - else { - indev_proc_release(i); - } - - i->pointer.last_point.x = i->pointer.act_point.x; - i->pointer.last_point.y = i->pointer.act_point.y; -} - -/** - * Process a new point from LV_INDEV_TYPE_KEYPAD input device - * @param i pointer to an input device - * @param data pointer to the data read from the input device - */ -static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data) -{ - if(data->state == LV_INDEV_STATE_PRESSED && i->wait_until_release) return; - - if(i->wait_until_release) { - i->wait_until_release = 0; - i->pr_timestamp = 0; - i->long_pr_sent = 0; - i->keypad.last_state = LV_INDEV_STATE_RELEASED; /*To skip the processing of release*/ - } - - /*Save the last key. *It must be done here else `lv_indev_get_key` will return the last key in events*/ - uint32_t prev_key = i->keypad.last_key; - i->keypad.last_key = data->key; - - lv_group_t * g = i->group; - if(g == NULL) return; - - indev_obj_act = lv_group_get_focused(g); - if(indev_obj_act == NULL) return; - - const bool is_enabled = !lv_obj_has_state(indev_obj_act, LV_STATE_DISABLED); - - /*Save the previous state so we can detect state changes below and also set the last state now - *so if any event handler on the way returns `LV_RESULT_INVALID` the last state is remembered - *for the next time*/ - uint32_t prev_state = i->keypad.last_state; - i->keypad.last_state = data->state; - - /*Key press happened*/ - if(data->state == LV_INDEV_STATE_PRESSED && prev_state == LV_INDEV_STATE_RELEASED) { - LV_LOG_INFO("%" LV_PRIu32 " key is pressed", data->key); - i->pr_timestamp = lv_tick_get(); - - /*Move the focus on NEXT*/ - if(data->key == LV_KEY_NEXT) { - lv_group_set_editing(g, false); /*Editing is not used by KEYPAD is be sure it is disabled*/ - lv_group_focus_next(g); - if(indev_reset_check(i)) return; - } - /*Move the focus on PREV*/ - else if(data->key == LV_KEY_PREV) { - lv_group_set_editing(g, false); /*Editing is not used by KEYPAD is be sure it is disabled*/ - lv_group_focus_prev(g); - if(indev_reset_check(i)) return; - } - else if(is_enabled) { - /*Simulate a press on the object if ENTER was pressed*/ - if(data->key == LV_KEY_ENTER) { - /*Send the ENTER as a normal KEY*/ - lv_group_send_data(g, LV_KEY_ENTER); - if(indev_reset_check(i)) return; - - if(send_event(LV_EVENT_PRESSED, indev_act) == LV_RESULT_INVALID) return; - - } - else if(data->key == LV_KEY_ESC) { - /*Send the ESC as a normal KEY*/ - lv_group_send_data(g, LV_KEY_ESC); - if(indev_reset_check(i)) return; - - if(send_event(LV_EVENT_CANCEL, indev_act) == LV_RESULT_INVALID) return; - } - /*Just send other keys to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT`)*/ - else { - lv_group_send_data(g, data->key); - if(indev_reset_check(i)) return; - } - } - } - /*Pressing*/ - else if(is_enabled && data->state == LV_INDEV_STATE_PRESSED && prev_state == LV_INDEV_STATE_PRESSED) { - - if(data->key == LV_KEY_ENTER) { - if(send_event(LV_EVENT_PRESSING, indev_act) == LV_RESULT_INVALID) return; - } - - /*Long press time has elapsed?*/ - if(i->long_pr_sent == 0 && lv_tick_elaps(i->pr_timestamp) > i->long_press_time) { - i->long_pr_sent = 1; - if(data->key == LV_KEY_ENTER) { - i->longpr_rep_timestamp = lv_tick_get(); - - if(send_event(LV_EVENT_LONG_PRESSED, indev_act) == LV_RESULT_INVALID) return; - } - } - /*Long press repeated time has elapsed?*/ - else if(i->long_pr_sent != 0 && - lv_tick_elaps(i->longpr_rep_timestamp) > i->long_press_repeat_time) { - - i->longpr_rep_timestamp = lv_tick_get(); - - /*Send LONG_PRESS_REP on ENTER*/ - if(data->key == LV_KEY_ENTER) { - if(send_event(LV_EVENT_LONG_PRESSED_REPEAT, indev_act) == LV_RESULT_INVALID) return; - } - /*Move the focus on NEXT again*/ - else if(data->key == LV_KEY_NEXT) { - lv_group_set_editing(g, false); /*Editing is not used by KEYPAD is be sure it is disabled*/ - lv_group_focus_next(g); - if(indev_reset_check(i)) return; - } - /*Move the focus on PREV again*/ - else if(data->key == LV_KEY_PREV) { - lv_group_set_editing(g, false); /*Editing is not used by KEYPAD is be sure it is disabled*/ - lv_group_focus_prev(g); - if(indev_reset_check(i)) return; - } - /*Just send other keys again to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT)*/ - else { - lv_group_send_data(g, data->key); - if(indev_reset_check(i)) return; - } - } - } - /*Release happened*/ - else if(is_enabled && data->state == LV_INDEV_STATE_RELEASED && prev_state == LV_INDEV_STATE_PRESSED) { - LV_LOG_INFO("%" LV_PRIu32 " key is released", data->key); - /*The user might clear the key when it was released. Always release the pressed key*/ - data->key = prev_key; - if(data->key == LV_KEY_ENTER) { - - if(send_event(LV_EVENT_RELEASED, indev_act) == LV_RESULT_INVALID) return; - - if(i->long_pr_sent == 0) { - if(send_event(LV_EVENT_SHORT_CLICKED, indev_act) == LV_RESULT_INVALID) return; - } - - if(send_event(LV_EVENT_CLICKED, indev_act) == LV_RESULT_INVALID) return; - - } - i->pr_timestamp = 0; - i->long_pr_sent = 0; - } - indev_obj_act = NULL; -} - -/** - * Process a new point from LV_INDEV_TYPE_ENCODER input device - * @param i pointer to an input device - * @param data pointer to the data read from the input device - */ -static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) -{ - if(data->state == LV_INDEV_STATE_PRESSED && i->wait_until_release) return; - - if(i->wait_until_release) { - i->wait_until_release = 0; - i->pr_timestamp = 0; - i->long_pr_sent = 0; - i->keypad.last_state = LV_INDEV_STATE_RELEASED; /*To skip the processing of release*/ - } - - /*Save the last keys before anything else. - *They need to be already saved if the function returns for any reason*/ - lv_indev_state_t last_state = i->keypad.last_state; - i->keypad.last_state = data->state; - i->keypad.last_key = data->key; - - lv_group_t * g = i->group; - if(g == NULL) return; - - indev_obj_act = lv_group_get_focused(g); - if(indev_obj_act == NULL) return; - - /*Process the steps they are valid only with released button*/ - if(data->state != LV_INDEV_STATE_RELEASED) { - data->enc_diff = 0; - } - - const bool is_enabled = !lv_obj_has_state(indev_obj_act, LV_STATE_DISABLED); - - /*Button press happened*/ - if(data->state == LV_INDEV_STATE_PRESSED && last_state == LV_INDEV_STATE_RELEASED) { - LV_LOG_INFO("pressed"); - - i->pr_timestamp = lv_tick_get(); - - if(data->key == LV_KEY_ENTER) { - bool editable_or_scrollable = lv_obj_is_editable(indev_obj_act) || - lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_SCROLLABLE); - if(lv_group_get_editing(g) == true || editable_or_scrollable == false) { - - if(is_enabled) { - if(send_event(LV_EVENT_PRESSED, indev_act) == LV_RESULT_INVALID) return; - } - } - } - else if(data->key == LV_KEY_LEFT) { - /*emulate encoder left*/ - data->enc_diff--; - } - else if(data->key == LV_KEY_RIGHT) { - /*emulate encoder right*/ - data->enc_diff++; - } - else if(data->key == LV_KEY_ESC) { - /*Send the ESC as a normal KEY*/ - lv_group_send_data(g, LV_KEY_ESC); - if(indev_reset_check(i)) return; - - if(is_enabled) { - if(send_event(LV_EVENT_CANCEL, indev_act) == LV_RESULT_INVALID) return; - } - } - /*Just send other keys to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT`)*/ - else { - lv_group_send_data(g, data->key); - if(indev_reset_check(i)) return; - } - } - /*Pressing*/ - else if(data->state == LV_INDEV_STATE_PRESSED && last_state == LV_INDEV_STATE_PRESSED) { - /*Long press*/ - if(i->long_pr_sent == 0 && lv_tick_elaps(i->pr_timestamp) > i->long_press_time) { - - i->long_pr_sent = 1; - i->longpr_rep_timestamp = lv_tick_get(); - - if(data->key == LV_KEY_ENTER) { - /* Always send event to indev callbacks*/ - lv_indev_send_event(indev_act, LV_EVENT_LONG_PRESSED, indev_obj_act); - if(indev_reset_check(indev_act)) return; - - bool editable_or_scrollable = lv_obj_is_editable(indev_obj_act) || - lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_SCROLLABLE); - - /*On enter long press toggle edit mode.*/ - if(editable_or_scrollable) { - /*Don't leave edit mode if there is only one object (nowhere to navigate)*/ - if(lv_group_get_obj_count(g) > 1) { - LV_LOG_INFO("toggling edit mode"); - lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/ - lv_obj_remove_state(indev_obj_act, LV_STATE_PRESSED); /*Remove the pressed state manually*/ - } - } - /*If not editable then just send a long press event*/ - else { - if(is_enabled) { - lv_obj_send_event(indev_obj_act, LV_EVENT_LONG_PRESSED, indev_act); - if(indev_reset_check(indev_act)) return; - } - } - } - - i->long_pr_sent = 1; - } - /*Long press repeated time has elapsed?*/ - else if(i->long_pr_sent != 0 && lv_tick_elaps(i->longpr_rep_timestamp) > i->long_press_repeat_time) { - - i->longpr_rep_timestamp = lv_tick_get(); - - if(data->key == LV_KEY_ENTER) { - if(is_enabled) { - if(send_event(LV_EVENT_LONG_PRESSED_REPEAT, indev_act) == LV_RESULT_INVALID) return; - } - } - else if(data->key == LV_KEY_LEFT) { - /*emulate encoder left*/ - data->enc_diff--; - } - else if(data->key == LV_KEY_RIGHT) { - /*emulate encoder right*/ - data->enc_diff++; - } - else { - lv_group_send_data(g, data->key); - if(indev_reset_check(i)) return; - } - - } - - } - /*Release happened*/ - else if(data->state == LV_INDEV_STATE_RELEASED && last_state == LV_INDEV_STATE_PRESSED) { - LV_LOG_INFO("released"); - - if(data->key == LV_KEY_ENTER) { - bool editable_or_scrollable = lv_obj_is_editable(indev_obj_act) || - lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_SCROLLABLE); - - /*The button was released on a non-editable object. Just send enter*/ - if(editable_or_scrollable == false) { - if(is_enabled) { - if(send_event(LV_EVENT_RELEASED, indev_act) == LV_RESULT_INVALID) return; - } - - if(i->long_pr_sent == 0 && is_enabled) { - if(send_event(LV_EVENT_SHORT_CLICKED, indev_act) == LV_RESULT_INVALID) return; - } - - if(is_enabled) { - if(send_event(LV_EVENT_CLICKED, indev_act) == LV_RESULT_INVALID) return; - } - - } - /*An object is being edited and the button is released.*/ - else if(lv_group_get_editing(g)) { - /*Ignore long pressed enter release because it comes from mode switch*/ - if(!i->long_pr_sent || lv_group_get_obj_count(g) <= 1) { - if(is_enabled) { - if(send_event(LV_EVENT_RELEASED, indev_act) == LV_RESULT_INVALID) return; - if(send_event(LV_EVENT_SHORT_CLICKED, indev_act) == LV_RESULT_INVALID) return; - if(send_event(LV_EVENT_CLICKED, indev_act) == LV_RESULT_INVALID) return; - } - - lv_group_send_data(g, LV_KEY_ENTER); - if(indev_reset_check(i)) return; - } - else { - lv_obj_remove_state(indev_obj_act, LV_STATE_PRESSED); /*Remove the pressed state manually*/ - } - } - /*If the focused object is editable and now in navigate mode then on enter switch edit - mode*/ - else if(!i->long_pr_sent) { - LV_LOG_INFO("entering edit mode"); - lv_group_set_editing(g, true); /*Set edit mode*/ - } - } - - i->pr_timestamp = 0; - i->long_pr_sent = 0; - } - indev_obj_act = NULL; - - /*if encoder steps or simulated steps via left/right keys*/ - if(data->enc_diff != 0) { - /*In edit mode send LEFT/RIGHT keys*/ - if(lv_group_get_editing(g)) { - LV_LOG_INFO("rotated by %+d (edit)", data->enc_diff); - int32_t s; - if(data->enc_diff < 0) { - for(s = 0; s < -data->enc_diff; s++) { - lv_group_send_data(g, LV_KEY_LEFT); - if(indev_reset_check(i)) return; - } - } - else if(data->enc_diff > 0) { - for(s = 0; s < data->enc_diff; s++) { - lv_group_send_data(g, LV_KEY_RIGHT); - if(indev_reset_check(i)) return; - } - } - } - /*In navigate mode focus on the next/prev objects*/ - else { - LV_LOG_INFO("rotated by %+d (nav)", data->enc_diff); - int32_t s; - if(data->enc_diff < 0) { - for(s = 0; s < -data->enc_diff; s++) { - lv_group_focus_prev(g); - if(indev_reset_check(i)) return; - } - } - else if(data->enc_diff > 0) { - for(s = 0; s < data->enc_diff; s++) { - lv_group_focus_next(g); - if(indev_reset_check(i)) return; - } - } - } - } -} - -/** - * Process new points from an input device. indev->state.pressed has to be set - * @param indev pointer to an input device state - * @param x x coordinate of the next point - * @param y y coordinate of the next point - */ -static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data) -{ - /*Die gracefully if i->btn_points is NULL*/ - if(i->btn_points == NULL) { - LV_LOG_WARN("btn_points is NULL"); - return; - } - - int32_t x = i->btn_points[data->btn_id].x; - int32_t y = i->btn_points[data->btn_id].y; - - if(LV_INDEV_STATE_RELEASED != data->state) { - if(data->state == LV_INDEV_STATE_PRESSED) { - LV_LOG_INFO("button %" LV_PRIu32 " is pressed (x:%d y:%d)", data->btn_id, (int)x, (int)y); - } - else { - LV_LOG_INFO("button %" LV_PRIu32 " is released (x:%d y:%d)", data->btn_id, (int)x, (int)y); - } - } - - /*If a new point comes always make a release*/ - if(data->state == LV_INDEV_STATE_PRESSED) { - if(i->pointer.last_point.x != x || - i->pointer.last_point.y != y) { - indev_proc_release(i); - } - } - - if(indev_reset_check(i)) return; - - /*Save the new points*/ - i->pointer.act_point.x = x; - i->pointer.act_point.y = y; - - if(data->state == LV_INDEV_STATE_PRESSED) indev_proc_press(i); - else indev_proc_release(i); - - if(indev_reset_check(i)) return; - - i->pointer.last_point.x = i->pointer.act_point.x; - i->pointer.last_point.y = i->pointer.act_point.y; -} - -/** - * Process the pressed state of LV_INDEV_TYPE_POINTER input devices - * @param indev pointer to an input device 'proc' - */ -static void indev_proc_press(lv_indev_t * indev) -{ - LV_LOG_INFO("pressed at x:%d y:%d", (int)indev->pointer.act_point.x, - (int)indev->pointer.act_point.y); - indev_obj_act = indev->pointer.act_obj; - - if(indev->wait_until_release != 0) return; - - lv_display_t * disp = indev_act->disp; - bool new_obj_searched = false; - - /*If there is no last object then search*/ - if(indev_obj_act == NULL) { - indev_obj_act = pointer_search_obj(disp, &indev->pointer.act_point); - new_obj_searched = true; - } - /*If there is an active object it's not scrolled and not press locked also search*/ - else if(indev->pointer.scroll_obj == NULL && - lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_PRESS_LOCK) == false) { - indev_obj_act = pointer_search_obj(disp, &indev->pointer.act_point); - new_obj_searched = true; - } - - /*The scroll object might have scroll throw. Stop it manually*/ - if(new_obj_searched && indev->pointer.scroll_obj) { - /*Attempt to stop scroll throw animation firstly*/ - if(indev->scroll_throw_anim) { - lv_anim_delete(indev, indev_scroll_throw_anim_cb); - indev->scroll_throw_anim = NULL; - } - - lv_indev_scroll_throw_handler(indev); - if(indev_reset_check(indev)) return; - } - - /*If a new object was found reset some variables and send a pressed event handler*/ - if(indev_obj_act != indev->pointer.act_obj) { - indev->pointer.last_point.x = indev->pointer.act_point.x; - indev->pointer.last_point.y = indev->pointer.act_point.y; - - /*Without `LV_OBJ_FLAG_PRESS_LOCK` new widget can be found while pressing.*/ - if(indev->pointer.last_hovered && indev->pointer.last_hovered != indev_obj_act) { - lv_obj_send_event(indev->pointer.last_hovered, LV_EVENT_HOVER_LEAVE, indev); - if(indev_reset_check(indev)) return; - - lv_indev_send_event(indev, LV_EVENT_HOVER_LEAVE, indev->pointer.last_hovered); - if(indev_reset_check(indev)) return; - - indev->pointer.last_hovered = indev_obj_act; - } - - /*If a new object found the previous was lost, so send a PRESS_LOST event*/ - if(indev->pointer.act_obj != NULL) { - /*Save the obj because in special cases `act_obj` can change in the event */ - lv_obj_t * last_obj = indev->pointer.act_obj; - - lv_obj_send_event(last_obj, LV_EVENT_PRESS_LOST, indev_act); - if(indev_reset_check(indev)) return; - } - - indev->pointer.act_obj = indev_obj_act; /*Save the pressed object*/ - indev->pointer.last_obj = indev_obj_act; - - if(indev_obj_act != NULL) { - - /*Save the time when the obj pressed to count long press time.*/ - indev->pr_timestamp = lv_tick_get(); - indev->long_pr_sent = 0; - indev->pointer.scroll_sum.x = 0; - indev->pointer.scroll_sum.y = 0; - indev->pointer.scroll_dir = LV_DIR_NONE; - indev->pointer.scroll_obj = NULL; - indev->pointer.gesture_dir = LV_DIR_NONE; - indev->pointer.gesture_sent = 0; - indev->pointer.gesture_sum.x = 0; - indev->pointer.gesture_sum.y = 0; - indev->pointer.press_moved = 0; - indev->pointer.vect.x = 0; - indev->pointer.vect.y = 0; - - const bool is_enabled = !lv_obj_has_state(indev_obj_act, LV_STATE_DISABLED); - if(is_enabled) { - if(indev->pointer.last_hovered != indev_obj_act) { - if(send_event(LV_EVENT_HOVER_OVER, indev_act) == LV_RESULT_INVALID) return; - } - if(send_event(LV_EVENT_PRESSED, indev_act) == LV_RESULT_INVALID) return; - } - - if(indev_act->wait_until_release) return; - - /*Handle focus*/ - indev_click_focus(indev_act); - if(indev_reset_check(indev)) return; - - } - } - - /*Calculate the vector and apply a low pass filter: new value = 0.5 * old_value + 0.5 * new_value*/ - indev->pointer.vect.x = indev->pointer.act_point.x - indev->pointer.last_point.x; - indev->pointer.vect.y = indev->pointer.act_point.y - indev->pointer.last_point.y; - - indev->pointer.scroll_throw_vect.x = (indev->pointer.scroll_throw_vect.x + indev->pointer.vect.x) / 2; - indev->pointer.scroll_throw_vect.y = (indev->pointer.scroll_throw_vect.y + indev->pointer.vect.y) / 2; - - indev->pointer.scroll_throw_vect_ori = indev->pointer.scroll_throw_vect; - - if(LV_ABS(indev->pointer.vect.x) > indev->scroll_limit || LV_ABS(indev->pointer.vect.y) > indev->scroll_limit) { - indev->pointer.press_moved = 1; - } - - if(indev_obj_act) { - const bool is_enabled = !lv_obj_has_state(indev_obj_act, LV_STATE_DISABLED); - - if(is_enabled) { - if(send_event(LV_EVENT_PRESSING, indev_act) == LV_RESULT_INVALID) return; - } - - if(indev_act->wait_until_release) return; - - lv_indev_scroll_handler(indev); - if(indev_reset_check(indev)) return; - indev_gesture(indev); - if(indev_reset_check(indev)) return; - - if(indev->mode == LV_INDEV_MODE_EVENT && indev->read_timer && lv_timer_get_paused(indev->read_timer)) { - lv_timer_resume(indev->read_timer); - } - - /*If there is no scrolling then check for long press time*/ - if(indev->pointer.scroll_obj == NULL && indev->long_pr_sent == 0) { - /*Send a long press event if enough time elapsed*/ - if(lv_tick_elaps(indev->pr_timestamp) > indev_act->long_press_time) { - if(is_enabled) { - if(send_event(LV_EVENT_LONG_PRESSED, indev_act) == LV_RESULT_INVALID) return; - } - /*Mark it to do not send the event again*/ - indev->long_pr_sent = 1; - - /*Save the long press time stamp for the long press repeat handler*/ - indev->longpr_rep_timestamp = lv_tick_get(); - } - } - - if(indev->pointer.scroll_obj == NULL && indev->long_pr_sent == 1) { - if(lv_tick_elaps(indev->longpr_rep_timestamp) > indev_act->long_press_repeat_time) { - if(is_enabled) { - if(send_event(LV_EVENT_LONG_PRESSED_REPEAT, indev_act) == LV_RESULT_INVALID) return; - } - indev->longpr_rep_timestamp = lv_tick_get(); - } - } - } -} - -/** - * Process the released state of LV_INDEV_TYPE_POINTER input devices - * @param proc pointer to an input device 'proc' - */ -static void indev_proc_release(lv_indev_t * indev) -{ - if(indev->wait_until_release || /*Hover the new widget even if the coordinates didn't changed*/ - (indev->pointer.last_point.x != indev->pointer.act_point.x || - indev->pointer.last_point.y != indev->pointer.act_point.y)) { - lv_obj_t ** last = &indev->pointer.last_hovered; - lv_obj_t * hovered = pointer_search_obj(lv_display_get_default(), &indev->pointer.act_point); - if(*last != hovered) { - lv_obj_send_event(hovered, LV_EVENT_HOVER_OVER, indev); - if(indev_reset_check(indev)) return; - lv_indev_send_event(indev, LV_EVENT_HOVER_OVER, hovered); - if(indev_reset_check(indev)) return; - - lv_obj_send_event(*last, LV_EVENT_HOVER_LEAVE, indev); - if(indev_reset_check(indev)) return; - lv_indev_send_event(indev, LV_EVENT_HOVER_LEAVE, *last); - if(indev_reset_check(indev)) return; - *last = hovered; - } - } - - if(indev->wait_until_release) { - lv_obj_send_event(indev->pointer.act_obj, LV_EVENT_PRESS_LOST, indev_act); - if(indev_reset_check(indev)) return; - - indev->pointer.act_obj = NULL; - indev->pointer.last_obj = NULL; - indev->pr_timestamp = 0; - indev->longpr_rep_timestamp = 0; - indev->wait_until_release = 0; - } - indev_obj_act = indev->pointer.act_obj; - lv_obj_t * scroll_obj = indev->pointer.scroll_obj; - - if(indev->mode == LV_INDEV_MODE_EVENT && indev->read_timer && !lv_timer_get_paused(indev->read_timer)) { - lv_timer_pause(indev->read_timer); - } - - if(indev_obj_act) { - LV_LOG_INFO("released"); - - const bool is_enabled = !lv_obj_has_state(indev_obj_act, LV_STATE_DISABLED); - - if(is_enabled) { - if(send_event(LV_EVENT_RELEASED, indev_act) == LV_RESULT_INVALID) return; - } - - if(is_enabled) { - if(scroll_obj == NULL) { - if(indev->long_pr_sent == 0) { - if(send_event(LV_EVENT_SHORT_CLICKED, indev_act) == LV_RESULT_INVALID) return; - } - if(send_event(LV_EVENT_CLICKED, indev_act) == LV_RESULT_INVALID) return; - } - else { - lv_obj_send_event(scroll_obj, LV_EVENT_SCROLL_THROW_BEGIN, indev_act); - if(indev_reset_check(indev)) return; - } - } - indev->pointer.act_obj = NULL; - indev->pr_timestamp = 0; - indev->longpr_rep_timestamp = 0; - - /*Get the transformed vector with this object*/ - if(scroll_obj) { - int16_t angle = 0; - int16_t scale_x = 256; - int16_t scale_y = 256; - lv_point_t pivot = { 0, 0 }; - lv_obj_t * parent = scroll_obj; - while(parent) { - angle += lv_obj_get_style_transform_rotation(parent, 0); - int32_t zoom_act_x = lv_obj_get_style_transform_scale_x_safe(parent, 0); - int32_t zoom_act_y = lv_obj_get_style_transform_scale_y_safe(parent, 0); - scale_x = (scale_x * zoom_act_x) >> 8; - scale_y = (scale_x * zoom_act_y) >> 8; - parent = lv_obj_get_parent(parent); - } - - if(angle != 0 || scale_y != LV_SCALE_NONE || scale_x != LV_SCALE_NONE) { - angle = -angle; - scale_x = (256 * 256) / scale_x; - scale_y = (256 * 256) / scale_y; - lv_point_transform(&indev->pointer.scroll_throw_vect, angle, scale_x, scale_y, &pivot, false); - lv_point_transform(&indev->pointer.scroll_throw_vect_ori, angle, scale_x, scale_y, &pivot, false); - } - } - } - - if(scroll_obj) { - if(!indev->scroll_throw_anim) { - indev_scroll_throw_anim_start(indev); - } - - if(indev_reset_check(indev)) return; - } -} - -static void indev_proc_pointer_diff(lv_indev_t * indev) -{ - lv_obj_t * obj = indev->pointer.last_pressed; - if(obj == NULL) return; - if(indev->pointer.diff == 0) return; - - indev_obj_act = obj; - - bool editable = lv_obj_is_editable(obj); - - if(editable) { - uint32_t indev_sensitivity = indev->rotary_sensitivity; - uint32_t obj_sensitivity = lv_obj_get_style_rotary_sensitivity(indev_obj_act, 0); - int32_t diff = (int32_t)((int32_t)indev->pointer.diff * indev_sensitivity * obj_sensitivity + 32768) >> 16; - send_event(LV_EVENT_ROTARY, &diff); - } - else { - - int32_t vect = indev->pointer.diff > 0 ? indev->scroll_limit : -indev->scroll_limit; - indev->pointer.vect.y = vect; - indev->pointer.act_obj = obj; - lv_obj_t * scroll_obj = lv_indev_find_scroll_obj(indev); - if(scroll_obj == NULL) return; - uint32_t indev_sensitivity = indev->rotary_sensitivity; - uint32_t obj_sensitivity = lv_obj_get_style_rotary_sensitivity(scroll_obj, 0); - int32_t diff = (int32_t)((int32_t)indev->pointer.diff * indev_sensitivity * obj_sensitivity + 32768) >> 16; - - indev->pointer.scroll_throw_vect.y = diff; - indev->pointer.scroll_throw_vect_ori.y = diff; - lv_indev_scroll_handler(indev); - } - -} - -static lv_obj_t * pointer_search_obj(lv_display_t * disp, lv_point_t * p) -{ - indev_obj_act = lv_indev_search_obj(lv_display_get_layer_sys(disp), p); - if(indev_obj_act) return indev_obj_act; - - indev_obj_act = lv_indev_search_obj(lv_display_get_layer_top(disp), p); - if(indev_obj_act) return indev_obj_act; - - /* Search the object in the active screen */ - indev_obj_act = lv_indev_search_obj(lv_display_get_screen_active(disp), p); - if(indev_obj_act) return indev_obj_act; - - indev_obj_act = lv_indev_search_obj(lv_display_get_layer_bottom(disp), p); - return indev_obj_act; -} - -/** - * Process a new point from LV_INDEV_TYPE_BUTTON input device - * @param i pointer to an input device - * @param data pointer to the data read from the input device - * Reset input device if a reset query has been sent to it - * @param indev pointer to an input device - */ -static void indev_proc_reset_query_handler(lv_indev_t * indev) -{ - if(indev->reset_query) { - indev->pointer.act_obj = NULL; - indev->pointer.last_obj = NULL; - indev->pointer.scroll_obj = NULL; - indev->pointer.last_hovered = NULL; - indev->long_pr_sent = 0; - indev->pr_timestamp = 0; - indev->longpr_rep_timestamp = 0; - indev->pointer.scroll_sum.x = 0; - indev->pointer.scroll_sum.y = 0; - indev->pointer.scroll_dir = LV_DIR_NONE; - indev->pointer.scroll_obj = NULL; - indev->pointer.scroll_throw_vect.x = 0; - indev->pointer.scroll_throw_vect.y = 0; - indev->pointer.gesture_sum.x = 0; - indev->pointer.gesture_sum.y = 0; - indev->reset_query = 0; - indev->stop_processing_query = 0; - indev_obj_act = NULL; - } -} - -/** - * Handle focus/defocus on click for POINTER input devices - * @param proc pointer to the state of the indev - */ -static void indev_click_focus(lv_indev_t * indev) -{ - /*Handle click focus*/ - if(lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_CLICK_FOCUSABLE) == false) { - return; - } - - lv_group_t * g_act = lv_obj_get_group(indev_obj_act); - lv_group_t * g_prev = indev->pointer.last_pressed ? lv_obj_get_group(indev->pointer.last_pressed) : NULL; - - /*If both the last and act. obj. are in the same group (or have no group)*/ - if(g_act == g_prev) { - /*The objects are in a group*/ - if(g_act) { - lv_group_focus_obj(indev_obj_act); - if(indev_reset_check(indev)) return; - } - /*The object are not in group*/ - else { - if(indev->pointer.last_pressed != indev_obj_act) { - lv_obj_send_event(indev->pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act); - if(indev_reset_check(indev)) return; - - lv_obj_send_event(indev_obj_act, LV_EVENT_FOCUSED, indev_act); - if(indev_reset_check(indev)) return; - } - } - } - /*The object are not in the same group (in different groups or one has no group)*/ - else { - /*If the prev. obj. is not in a group then defocus it.*/ - if(g_prev == NULL && indev->pointer.last_pressed) { - lv_obj_send_event(indev->pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act); - if(indev_reset_check(indev)) return; - } - /*Focus on a non-group object*/ - else { - if(indev->pointer.last_pressed) { - /*If the prev. object also wasn't in a group defocus it*/ - if(g_prev == NULL) { - lv_obj_send_event(indev->pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act); - if(indev_reset_check(indev)) return; - } - /*If the prev. object also was in a group at least "LEAVE" it instead of defocus*/ - else { - lv_obj_send_event(indev->pointer.last_pressed, LV_EVENT_LEAVE, indev_act); - if(indev_reset_check(indev)) return; - } - } - } - - /*Focus to the act. in its group*/ - if(g_act) { - lv_group_focus_obj(indev_obj_act); - if(indev_reset_check(indev)) return; - } - else { - lv_obj_send_event(indev_obj_act, LV_EVENT_FOCUSED, indev_act); - if(indev_reset_check(indev)) return; - } - } - indev->pointer.last_pressed = indev_obj_act; -} - -/** -* Handle the gesture of indev_proc_p->pointer.act_obj -* @param indev pointer to an input device state -*/ -void indev_gesture(lv_indev_t * indev) -{ - if(indev->pointer.scroll_obj) return; - if(indev->pointer.gesture_sent) return; - - lv_obj_t * gesture_obj = indev->pointer.act_obj; - - /*If gesture parent is active check recursively the gesture attribute*/ - while(gesture_obj && lv_obj_has_flag(gesture_obj, LV_OBJ_FLAG_GESTURE_BUBBLE)) { - gesture_obj = lv_obj_get_parent(gesture_obj); - } - - if(gesture_obj == NULL) return; - - if((LV_ABS(indev->pointer.vect.x) < indev_act->gesture_min_velocity) && - (LV_ABS(indev->pointer.vect.y) < indev_act->gesture_min_velocity)) { - indev->pointer.gesture_sum.x = 0; - indev->pointer.gesture_sum.y = 0; - } - - /*Count the movement by gesture*/ - indev->pointer.gesture_sum.x += indev->pointer.vect.x; - indev->pointer.gesture_sum.y += indev->pointer.vect.y; - - if((LV_ABS(indev->pointer.gesture_sum.x) > indev_act->gesture_limit) || - (LV_ABS(indev->pointer.gesture_sum.y) > indev_act->gesture_limit)) { - - indev->pointer.gesture_sent = 1; - - if(LV_ABS(indev->pointer.gesture_sum.x) > LV_ABS(indev->pointer.gesture_sum.y)) { - if(indev->pointer.gesture_sum.x > 0) - indev->pointer.gesture_dir = LV_DIR_RIGHT; - else - indev->pointer.gesture_dir = LV_DIR_LEFT; - } - else { - if(indev->pointer.gesture_sum.y > 0) - indev->pointer.gesture_dir = LV_DIR_BOTTOM; - else - indev->pointer.gesture_dir = LV_DIR_TOP; - } - - lv_obj_send_event(gesture_obj, LV_EVENT_GESTURE, indev_act); - if(indev_reset_check(indev)) return; - - lv_indev_send_event(indev_act, LV_EVENT_GESTURE, gesture_obj); - if(indev_reset_check(indev_act)) return; - } -} - -/** - * Checks if the reset_query flag has been set. If so, perform necessary global indev cleanup actions - * @param proc pointer to an input device 'proc' - * @return true if indev query should be immediately truncated. - */ -static bool indev_reset_check(lv_indev_t * indev) -{ - if(indev->reset_query) { - indev_obj_act = NULL; - } - - return indev->reset_query; -} - -/** - * Checks if the stop_processing_query flag has been set. If so, do not send any events to the object - * @param indev pointer to an input device - * @return true if indev should stop processing the event. - */ -static bool indev_stop_processing_check(lv_indev_t * indev) -{ - return indev->stop_processing_query; -} - -/** - * Reset the indev and send event to active obj and scroll obj - * @param indev pointer to an input device - * @param obj pointer to obj -*/ -static void indev_reset_core(lv_indev_t * indev, lv_obj_t * obj) -{ - lv_obj_t * act_obj = NULL; - lv_obj_t * scroll_obj = NULL; - - indev->reset_query = 1; - if(indev_act == indev) indev_obj_act = NULL; - if(indev->type == LV_INDEV_TYPE_POINTER || indev->type == LV_INDEV_TYPE_KEYPAD) { - if(obj == NULL || indev->pointer.last_pressed == obj) { - indev->pointer.last_pressed = NULL; - } - if(obj == NULL || indev->pointer.act_obj == obj) { - if(indev->pointer.act_obj) { - /* Avoid recursive calls */ - act_obj = indev->pointer.act_obj; - indev->pointer.act_obj = NULL; - lv_obj_send_event(act_obj, LV_EVENT_INDEV_RESET, indev); - lv_indev_send_event(indev, LV_EVENT_INDEV_RESET, act_obj); - act_obj = NULL; - } - } - if(obj == NULL || indev->pointer.last_obj == obj) { - indev->pointer.last_obj = NULL; - } - if(obj == NULL || indev->pointer.scroll_obj == obj) { - if(indev->pointer.scroll_obj) { - /* Avoid recursive calls */ - scroll_obj = indev->pointer.scroll_obj; - indev->pointer.scroll_obj = NULL; - lv_obj_send_event(scroll_obj, LV_EVENT_INDEV_RESET, indev); - lv_indev_send_event(indev, LV_EVENT_INDEV_RESET, act_obj); - scroll_obj = NULL; - } - } - if(obj == NULL || indev->pointer.last_hovered == obj) { - indev->pointer.last_hovered = NULL; - } - } -} - -static lv_result_t send_event(lv_event_code_t code, void * param) -{ - lv_indev_t * indev = indev_act; - - if(code == LV_EVENT_PRESSED || - code == LV_EVENT_SHORT_CLICKED || - code == LV_EVENT_CLICKED || - code == LV_EVENT_RELEASED || - code == LV_EVENT_LONG_PRESSED || - code == LV_EVENT_LONG_PRESSED_REPEAT || - code == LV_EVENT_ROTARY) { - lv_indev_send_event(indev, code, indev_obj_act); - if(indev_reset_check(indev)) return LV_RESULT_INVALID; - - if(indev_stop_processing_check(indev)) { - /* Not send event to the object if stop processing query is set */ - indev->stop_processing_query = 0; - return LV_RESULT_OK; - } - } - - lv_obj_send_event(indev_obj_act, code, param); - if(indev_reset_check(indev)) return LV_RESULT_INVALID; - - return LV_RESULT_OK; -} - -static void indev_scroll_throw_anim_cb(void * var, int32_t v) -{ - LV_ASSERT_NULL(var); - LV_UNUSED(v); - lv_indev_t * indev = (lv_indev_t *)var; - - lv_indev_scroll_throw_handler(indev); - - if(indev->pointer.scroll_dir == LV_DIR_NONE || indev->pointer.scroll_obj == NULL) { - if(indev->scroll_throw_anim) { - LV_LOG_INFO("stop animation"); - lv_anim_delete(indev, indev_scroll_throw_anim_cb); - } - } -} - -static void indev_scroll_throw_anim_completed_cb(lv_anim_t * anim) -{ - if(anim) { - indev_scroll_throw_anim_reset((lv_indev_t *)anim->var); - } -} - -static void indev_scroll_throw_anim_start(lv_indev_t * indev) -{ - LV_ASSERT_NULL(indev); - - lv_anim_t a; - lv_anim_init(&a); - lv_anim_set_var(&a, indev); - lv_anim_set_duration(&a, 1024); - lv_anim_set_values(&a, 0, 1024); - lv_anim_set_exec_cb(&a, indev_scroll_throw_anim_cb); - lv_anim_set_completed_cb(&a, indev_scroll_throw_anim_completed_cb); - lv_anim_set_deleted_cb(&a, indev_scroll_throw_anim_completed_cb); - lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); - - indev->scroll_throw_anim = lv_anim_start(&a); -} diff --git a/L3_Middlewares/LVGL/src/indev/lv_indev.h b/L3_Middlewares/LVGL/src/indev/lv_indev.h deleted file mode 100644 index 9b0ee45..0000000 --- a/L3_Middlewares/LVGL/src/indev/lv_indev.h +++ /dev/null @@ -1,413 +0,0 @@ -/** - * @file lv_indev.h - * - */ - -#ifndef LV_INDEV_H -#define LV_INDEV_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../core/lv_group.h" -#include "../misc/lv_area.h" -#include "../misc/lv_timer.h" -#include "../misc/lv_event.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Possible input device types*/ -typedef enum { - LV_INDEV_TYPE_NONE, /**< Uninitialized state*/ - LV_INDEV_TYPE_POINTER, /**< Touch pad, mouse, external button*/ - LV_INDEV_TYPE_KEYPAD, /**< Keypad or keyboard*/ - LV_INDEV_TYPE_BUTTON, /**< External (hardware button) which is assigned to a specific point of the screen*/ - LV_INDEV_TYPE_ENCODER, /**< Encoder with only Left, Right turn and a Button*/ -} lv_indev_type_t; - -/** States for input devices*/ -typedef enum { - LV_INDEV_STATE_RELEASED = 0, - LV_INDEV_STATE_PRESSED -} lv_indev_state_t; - -typedef enum { - LV_INDEV_MODE_NONE = 0, - LV_INDEV_MODE_TIMER, - LV_INDEV_MODE_EVENT, -} lv_indev_mode_t; - -/** Data structure passed to an input driver to fill*/ -typedef struct { - lv_point_t point; /**< For LV_INDEV_TYPE_POINTER the currently pressed point*/ - uint32_t key; /**< For LV_INDEV_TYPE_KEYPAD the currently pressed key*/ - uint32_t btn_id; /**< For LV_INDEV_TYPE_BUTTON the currently pressed button*/ - int16_t enc_diff; /**< For LV_INDEV_TYPE_ENCODER number of steps since the previous read*/ - - lv_indev_state_t state; /**< LV_INDEV_STATE_RELEASED or LV_INDEV_STATE_PRESSED*/ - bool continue_reading; /**< If set to true, the read callback is invoked again, unless the device is in event-driven mode*/ -} lv_indev_data_t; - -typedef void (*lv_indev_read_cb_t)(lv_indev_t * indev, lv_indev_data_t * data); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an indev - * @return Pointer to the created indev or NULL when allocation failed - */ -lv_indev_t * lv_indev_create(void); - -/** - * Remove the provided input device. Make sure not to use the provided input device afterwards anymore. - * @param indev pointer to delete - */ -void lv_indev_delete(lv_indev_t * indev); - -/** - * Get the next input device. - * @param indev pointer to the current input device. NULL to initialize. - * @return the next input device or NULL if there are no more. Provide the first input device when - * the parameter is NULL - */ -lv_indev_t * lv_indev_get_next(lv_indev_t * indev); - -/** - * Read data from an input device. - * @param indev pointer to an input device - */ -void lv_indev_read(lv_indev_t * indev); - -/** - * Called periodically to read the input devices - * @param timer pointer to a timer to read - */ -void lv_indev_read_timer_cb(lv_timer_t * timer); - -/** - * Enable or disable one or all input devices (default enabled) - * @param indev pointer to an input device or NULL to enable/disable all of them - * @param enable true to enable, false to disable - */ -void lv_indev_enable(lv_indev_t * indev, bool enable); - -/** - * Get the currently processed input device. Can be used in action functions too. - * @return pointer to the currently processed input device or NULL if no input device processing - * right now - */ -lv_indev_t * lv_indev_active(void); - -/** - * Set the type of an input device - * @param indev pointer to an input device - * @param indev_type the type of the input device from `lv_indev_type_t` (`LV_INDEV_TYPE_...`) - */ -void lv_indev_set_type(lv_indev_t * indev, lv_indev_type_t indev_type); - -/** - * Set a callback function to read input device data to the indev - * @param indev pointer to an input device - * @param read_cb pointer to callback function to read input device data - */ -void lv_indev_set_read_cb(lv_indev_t * indev, lv_indev_read_cb_t read_cb); - -/** - * Set user data to the indev - * @param indev pointer to an input device - * @param user_data pointer to user data - */ -void lv_indev_set_user_data(lv_indev_t * indev, void * user_data); - -/** - * Set driver data to the indev - * @param indev pointer to an input device - * @param driver_data pointer to driver data - */ -void lv_indev_set_driver_data(lv_indev_t * indev, void * driver_data); - -/** - * Assign a display to the indev - * @param indev pointer to an input device - * @param disp pointer to an display - */ -void lv_indev_set_display(lv_indev_t * indev, struct lv_display_t * disp); - -/** - * Set long press time to indev - * @param indev pointer to input device - * @param long_press_time time long press time in ms - */ -void lv_indev_set_long_press_time(lv_indev_t * indev, uint16_t long_press_time); - -/** - * Set scroll limit to the input device - * @param indev pointer to an input device - * @param scroll_limit the number of pixels to slide before actually drag the object - */ -void lv_indev_set_scroll_limit(lv_indev_t * indev, uint8_t scroll_limit); - -/** - * Set scroll throw slow-down to the indev. Greater value means faster slow-down - * @param indev pointer to an input device - * @param scroll_throw the slow-down in [%] - */ -void lv_indev_set_scroll_throw(lv_indev_t * indev, uint8_t scroll_throw); - -/** - * Get the type of an input device - * @param indev pointer to an input device - * @return the type of the input device from `lv_hal_indev_type_t` (`LV_INDEV_TYPE_...`) - */ -lv_indev_type_t lv_indev_get_type(const lv_indev_t * indev); - -/** - * Get the callback function to read input device data to the indev - * @param indev pointer to an input device - * @return Pointer to callback function to read input device data or NULL if indev is NULL - */ -lv_indev_read_cb_t lv_indev_get_read_cb(lv_indev_t * indev); - -/** - * Get the indev state - * @param indev pointer to an input device - * @return Indev state or LV_INDEV_STATE_RELEASED if indev is NULL - */ -lv_indev_state_t lv_indev_get_state(const lv_indev_t * indev); - -/** - * Get the indev assigned group - * @param indev pointer to an input device - * @return Pointer to indev assigned group or NULL if indev is NULL - */ -lv_group_t * lv_indev_get_group(const lv_indev_t * indev); - -/** - * Get a pointer to the assigned display of the indev - * @param indev pointer to an input device - * @return pointer to the assigned display or NULL if indev is NULL - */ -lv_display_t * lv_indev_get_display(const lv_indev_t * indev); - -/** - * Get a pointer to the user data of the indev - * @param indev pointer to an input device - * @return pointer to the user data or NULL if indev is NULL - */ -void * lv_indev_get_user_data(const lv_indev_t * indev); - -/** - * Get a pointer to the driver data of the indev - * @param indev pointer to an input device - * @return pointer to the driver data or NULL if indev is NULL - */ -void * lv_indev_get_driver_data(const lv_indev_t * indev); - -/** - * Get whether indev is moved while pressed - * @param indev pointer to an input device - * @return true: indev is moved while pressed; false: indev is not moved while pressed - */ -bool lv_indev_get_press_moved(const lv_indev_t * indev); - -/** - * Reset one or all input devices - * @param indev pointer to an input device to reset or NULL to reset all of them - * @param obj pointer to an object which triggers the reset. - */ -void lv_indev_reset(lv_indev_t * indev, lv_obj_t * obj); - -/** - * Touch and key related events are sent to the input device first and to the widget after that. - * If this functions called in an indev event, the event won't be sent to the widget. - * @param indev pointer to an input device - */ -void lv_indev_stop_processing(lv_indev_t * indev); - -/** - * Reset the long press state of an input device - * @param indev pointer to an input device - */ -void lv_indev_reset_long_press(lv_indev_t * indev); - -/** - * Set a cursor for a pointer input device (for LV_INPUT_TYPE_POINTER and LV_INPUT_TYPE_BUTTON) - * @param indev pointer to an input device - * @param cur_obj pointer to an object to be used as cursor - */ -void lv_indev_set_cursor(lv_indev_t * indev, lv_obj_t * cur_obj); - -/** - * Set a destination group for a keypad input device (for LV_INDEV_TYPE_KEYPAD) - * @param indev pointer to an input device - * @param group pointer to a group - */ -void lv_indev_set_group(lv_indev_t * indev, lv_group_t * group); - -/** - * Set the an array of points for LV_INDEV_TYPE_BUTTON. - * These points will be assigned to the buttons to press a specific point on the screen - * @param indev pointer to an input device - * @param points array of points - */ -void lv_indev_set_button_points(lv_indev_t * indev, const lv_point_t points[]); - -/** - * Get the last point of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON) - * @param indev pointer to an input device - * @param point pointer to a point to store the result - */ -void lv_indev_get_point(const lv_indev_t * indev, lv_point_t * point); - -/** -* Get the current gesture direct -* @param indev pointer to an input device -* @return current gesture direct -*/ -lv_dir_t lv_indev_get_gesture_dir(const lv_indev_t * indev); - -/** - * Get the last pressed key of an input device (for LV_INDEV_TYPE_KEYPAD) - * @param indev pointer to an input device - * @return the last pressed key (0 on error) - */ -uint32_t lv_indev_get_key(const lv_indev_t * indev); - -/** - * Check the current scroll direction of an input device (for LV_INDEV_TYPE_POINTER and - * LV_INDEV_TYPE_BUTTON) - * @param indev pointer to an input device - * @return LV_DIR_NONE: no scrolling now - * LV_DIR_HOR/VER - */ -lv_dir_t lv_indev_get_scroll_dir(const lv_indev_t * indev); - -/** - * Get the currently scrolled object (for LV_INDEV_TYPE_POINTER and - * LV_INDEV_TYPE_BUTTON) - * @param indev pointer to an input device - * @return pointer to the currently scrolled object or NULL if no scrolling by this indev - */ -lv_obj_t * lv_indev_get_scroll_obj(const lv_indev_t * indev); - -/** - * Get the movement vector of an input device (for LV_INDEV_TYPE_POINTER and - * LV_INDEV_TYPE_BUTTON) - * @param indev pointer to an input device - * @param point pointer to a point to store the types.pointer.vector - */ -void lv_indev_get_vect(const lv_indev_t * indev, lv_point_t * point); - -/** - * Do nothing until the next release - * @param indev pointer to an input device - */ -void lv_indev_wait_release(lv_indev_t * indev); - -/** - * Gets a pointer to the currently active object in the currently processed input device. - * @return pointer to currently active object or NULL if no active object - */ -lv_obj_t * lv_indev_get_active_obj(void); - -/** - * Get a pointer to the indev read timer to - * modify its parameters with `lv_timer_...` functions. - * @param indev pointer to an input device - * @return pointer to the indev read refresher timer. (NULL on error) - */ -lv_timer_t * lv_indev_get_read_timer(lv_indev_t * indev); - -/** -* Set the input device's event model: event-driven mode or timer mode. -* @param indev pointer to an input device -* @param mode the mode of input device -*/ -void lv_indev_set_mode(lv_indev_t * indev, lv_indev_mode_t mode); - -/** - * Get the input device's running mode. - * @param indev pointer to an input device - * @return the running mode for the specified input device. - */ -lv_indev_mode_t lv_indev_get_mode(lv_indev_t * indev); - -/** - * Search the most top, clickable object by a point - * @param obj pointer to a start object, typically the screen - * @param point pointer to a point for searching the most top child - * @return pointer to the found object or NULL if there was no suitable object - */ -lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point); - -/** - * Add an event handler to the indev - * @param indev pointer to an indev - * @param event_cb an event callback - * @param filter event code to react or `LV_EVENT_ALL` - * @param user_data optional user_data - */ -void lv_indev_add_event_cb(lv_indev_t * indev, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data); - -/** - * Get the number of event attached to an indev - * @param indev pointer to an indev - * @return number of events - */ -uint32_t lv_indev_get_event_count(lv_indev_t * indev); - -/** - * Get an event descriptor for an event - * @param indev pointer to an indev - * @param index the index of the event - * @return the event descriptor - */ -lv_event_dsc_t * lv_indev_get_event_dsc(lv_indev_t * indev, uint32_t index); - -/** - * Remove an event - * @param indev pointer to an indev - * @param index the index of the event to remove - * @return true: and event was removed; false: no event was removed - */ -bool lv_indev_remove_event(lv_indev_t * indev, uint32_t index); - -/** - * Remove an event_cb with user_data - * @param indev pointer to a indev - * @param event_cb the event_cb of the event to remove - * @param user_data user_data - * @return the count of the event removed - */ -uint32_t lv_indev_remove_event_cb_with_user_data(lv_indev_t * indev, lv_event_cb_t event_cb, void * user_data); - -/** - * Send an event to an indev - * @param indev pointer to an indev - * @param code an event code. LV_EVENT_... - * @param param optional param - * @return LV_RESULT_OK: indev wasn't deleted in the event. - */ -lv_result_t lv_indev_send_event(lv_indev_t * indev, lv_event_code_t code, void * param); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_INDEV_H*/ diff --git a/L3_Middlewares/LVGL/src/indev/lv_indev_private.h b/L3_Middlewares/LVGL/src/indev/lv_indev_private.h deleted file mode 100644 index a5fa231..0000000 --- a/L3_Middlewares/LVGL/src/indev/lv_indev_private.h +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @file lv_indev_private.h - * - */ - -#ifndef LV_INDEV_PRIVATE_H -#define LV_INDEV_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_indev.h" -#include "../misc/lv_anim.h" -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_indev_t { - /** Input device type*/ - lv_indev_type_t type; - - /** Function pointer to read input device data.*/ - lv_indev_read_cb_t read_cb; - - lv_indev_state_t state; /**< Current state of the input device.*/ - lv_indev_mode_t mode; - - /*Flags*/ - uint8_t long_pr_sent : 1; - uint8_t reset_query : 1; - uint8_t enabled : 1; - uint8_t wait_until_release : 1; - uint8_t stop_processing_query : 1; - - uint32_t pr_timestamp; /**< Pressed time stamp*/ - uint32_t longpr_rep_timestamp; /**< Long press repeat time stamp*/ - - void * driver_data; - void * user_data; - - /**< Pointer to the assigned display*/ - lv_display_t * disp; - - /**< Timer to periodically read the input device*/ - lv_timer_t * read_timer; - - /**< Number of pixels to slide before actually drag the object*/ - uint8_t scroll_limit; - - /**< Drag throw slow-down in [%]. Greater value means faster slow-down*/ - uint8_t scroll_throw; - - /**< At least this difference should be between two points to evaluate as gesture*/ - uint8_t gesture_min_velocity; - - /**< At least this difference should be to send a gesture*/ - uint8_t gesture_limit; - - /**< Long press time in milliseconds*/ - uint16_t long_press_time; - - /**< Repeated trigger period in long press [ms]*/ - uint16_t long_press_repeat_time; - - /**< Rotary diff count will be multiplied by this value and divided by 256*/ - int32_t rotary_sensitivity; - - struct { - /*Pointer and button data*/ - lv_point_t act_point; /**< Current point of input device.*/ - lv_point_t last_point; /**< Last point of input device.*/ - lv_point_t last_raw_point; /**< Last point read from read_cb. */ - lv_point_t vect; /**< Difference between `act_point` and `last_point`.*/ - lv_point_t scroll_sum; /*Count the dragged pixels to check LV_INDEV_DEF_SCROLL_LIMIT*/ - lv_point_t scroll_throw_vect; - lv_point_t scroll_throw_vect_ori; - lv_obj_t * act_obj; /*The object being pressed*/ - lv_obj_t * last_obj; /*The last object which was pressed*/ - lv_obj_t * scroll_obj; /*The object being scrolled*/ - lv_obj_t * last_pressed; /*The lastly pressed object*/ - lv_obj_t * last_hovered; /*The lastly hovered object*/ - lv_area_t scroll_area; - lv_point_t gesture_sum; /*Count the gesture pixels to check LV_INDEV_DEF_GESTURE_LIMIT*/ - int32_t diff; - - /*Flags*/ - uint8_t scroll_dir : 4; - uint8_t gesture_dir : 4; - uint8_t gesture_sent : 1; - uint8_t press_moved : 1; - } pointer; - struct { - /*Keypad data*/ - lv_indev_state_t last_state; - uint32_t last_key; - } keypad; - - lv_obj_t * cursor; /**< Cursor for LV_INPUT_TYPE_POINTER*/ - lv_group_t * group; /**< Keypad destination group*/ - const lv_point_t * btn_points; /**< Array points assigned to the button ()screen will be pressed - here by the buttons*/ - lv_event_list_t event_list; - lv_anim_t * scroll_throw_anim; -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Find a scrollable object based on the current scroll vector in the indev. - * In handles scroll propagation to the parent if needed, and scroll directions too. - * @param indev pointer to an indev - * @return the found scrollable object or NULL if not found. - */ -lv_obj_t * lv_indev_find_scroll_obj(lv_indev_t * indev); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_INDEV_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/indev/lv_indev_scroll.c b/L3_Middlewares/LVGL/src/indev/lv_indev_scroll.c deleted file mode 100644 index f327865..0000000 --- a/L3_Middlewares/LVGL/src/indev/lv_indev_scroll.c +++ /dev/null @@ -1,733 +0,0 @@ -/** - * @file lv_indev_scroll.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../core/lv_obj_scroll_private.h" -#include "../core/lv_obj_private.h" -#include "lv_indev.h" -#include "lv_indev_private.h" -#include "lv_indev_scroll.h" - -/********************* - * DEFINES - *********************/ -#define ELASTIC_SLOWNESS_FACTOR 4 /*Scrolling on elastic parts are slower by this factor*/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void init_scroll_limits(lv_indev_t * indev); -static int32_t find_snap_point_x(const lv_obj_t * obj, int32_t min, int32_t max, int32_t ofs); -static int32_t find_snap_point_y(const lv_obj_t * obj, int32_t min, int32_t max, int32_t ofs); -static void scroll_limit_diff(lv_indev_t * indev, int32_t * diff_x, int32_t * diff_y); -static int32_t elastic_diff(lv_obj_t * scroll_obj, int32_t diff, int32_t scroll_start, int32_t scroll_end, - lv_dir_t dir); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_indev_scroll_handler(lv_indev_t * indev) -{ - if(indev->pointer.vect.x == 0 && indev->pointer.vect.y == 0) { - return; - } - - lv_obj_t * scroll_obj = indev->pointer.scroll_obj; - /*If there is no scroll object yet try to find one*/ - if(scroll_obj == NULL) { - scroll_obj = lv_indev_find_scroll_obj(indev); - if(scroll_obj == NULL) return; - - init_scroll_limits(indev); - - lv_obj_remove_state(indev->pointer.act_obj, LV_STATE_PRESSED); - lv_obj_send_event(scroll_obj, LV_EVENT_SCROLL_BEGIN, NULL); - if(indev->reset_query) return; - } - - /*Set new position or scroll if the vector is not zero*/ - int16_t angle = 0; - int16_t scale_x = 256; - int16_t scale_y = 256; - lv_obj_t * parent = scroll_obj; - while(parent) { - angle += lv_obj_get_style_transform_rotation(parent, 0); - int32_t zoom_act_x = lv_obj_get_style_transform_scale_x_safe(parent, 0); - int32_t zoom_act_y = lv_obj_get_style_transform_scale_y_safe(parent, 0); - scale_x = (scale_x * zoom_act_x) >> 8; - scale_y = (scale_y * zoom_act_y) >> 8; - parent = lv_obj_get_parent(parent); - } - - if(angle != 0 || scale_x != LV_SCALE_NONE || scale_y != LV_SCALE_NONE) { - angle = -angle; - scale_x = (256 * 256) / scale_x; - scale_y = (256 * 256) / scale_y; - lv_point_t pivot = { 0, 0 }; - lv_point_transform(&indev->pointer.vect, angle, scale_x, scale_y, &pivot, false); - } - - int32_t diff_x = 0; - int32_t diff_y = 0; - if(indev->pointer.scroll_dir == LV_DIR_HOR) { - int32_t sr = lv_obj_get_scroll_right(scroll_obj); - int32_t sl = lv_obj_get_scroll_left(scroll_obj); - diff_x = elastic_diff(scroll_obj, indev->pointer.vect.x, sl, sr, LV_DIR_HOR); - } - else { - int32_t st = lv_obj_get_scroll_top(scroll_obj); - int32_t sb = lv_obj_get_scroll_bottom(scroll_obj); - diff_y = elastic_diff(scroll_obj, indev->pointer.vect.y, st, sb, LV_DIR_VER); - } - - lv_dir_t scroll_dir = lv_obj_get_scroll_dir(scroll_obj); - if((scroll_dir & LV_DIR_LEFT) == 0 && diff_x > 0) diff_x = 0; - if((scroll_dir & LV_DIR_RIGHT) == 0 && diff_x < 0) diff_x = 0; - if((scroll_dir & LV_DIR_TOP) == 0 && diff_y > 0) diff_y = 0; - if((scroll_dir & LV_DIR_BOTTOM) == 0 && diff_y < 0) diff_y = 0; - - /*Respect the scroll limit area*/ - scroll_limit_diff(indev, &diff_x, &diff_y); - - lv_obj_scroll_by_raw(scroll_obj, diff_x, diff_y); - if(indev->reset_query) return; - indev->pointer.scroll_sum.x += diff_x; - indev->pointer.scroll_sum.y += diff_y; -} - -void lv_indev_scroll_throw_handler(lv_indev_t * indev) -{ - lv_obj_t * scroll_obj = indev->pointer.scroll_obj; - if(scroll_obj == NULL) return; - if(indev->pointer.scroll_dir == LV_DIR_NONE) return; - - int32_t scroll_throw = indev->scroll_throw; - - if(lv_obj_has_flag(scroll_obj, LV_OBJ_FLAG_SCROLL_MOMENTUM) == false) { - indev->pointer.scroll_throw_vect.y = 0; - indev->pointer.scroll_throw_vect.x = 0; - } - - lv_scroll_snap_t align_x = lv_obj_get_scroll_snap_x(scroll_obj); - lv_scroll_snap_t align_y = lv_obj_get_scroll_snap_y(scroll_obj); - - if(indev->pointer.scroll_dir == LV_DIR_VER) { - indev->pointer.scroll_throw_vect.x = 0; - /*If no snapping "throw"*/ - if(align_y == LV_SCROLL_SNAP_NONE) { - indev->pointer.scroll_throw_vect.y = - indev->pointer.scroll_throw_vect.y * (100 - scroll_throw) / 100; - - int32_t sb = lv_obj_get_scroll_bottom(scroll_obj); - int32_t st = lv_obj_get_scroll_top(scroll_obj); - - indev->pointer.scroll_throw_vect.y = elastic_diff(scroll_obj, indev->pointer.scroll_throw_vect.y, st, sb, - LV_DIR_VER); - - lv_obj_scroll_by_raw(scroll_obj, 0, indev->pointer.scroll_throw_vect.y); - if(indev->reset_query) return; - } - /*With snapping find the nearest snap point and scroll there*/ - else { - int32_t diff_y = lv_indev_scroll_throw_predict(indev, LV_DIR_VER); - indev->pointer.scroll_throw_vect.y = 0; - scroll_limit_diff(indev, NULL, &diff_y); - int32_t y = find_snap_point_y(scroll_obj, LV_COORD_MIN, LV_COORD_MAX, diff_y); - lv_obj_scroll_by(scroll_obj, 0, diff_y + y, LV_ANIM_ON); - if(indev->reset_query) return; - } - } - else if(indev->pointer.scroll_dir == LV_DIR_HOR) { - indev->pointer.scroll_throw_vect.y = 0; - /*If no snapping "throw"*/ - if(align_x == LV_SCROLL_SNAP_NONE) { - indev->pointer.scroll_throw_vect.x = - indev->pointer.scroll_throw_vect.x * (100 - scroll_throw) / 100; - - int32_t sl = lv_obj_get_scroll_left(scroll_obj); - int32_t sr = lv_obj_get_scroll_right(scroll_obj); - - indev->pointer.scroll_throw_vect.x = elastic_diff(scroll_obj, indev->pointer.scroll_throw_vect.x, sl, sr, - LV_DIR_HOR); - - lv_obj_scroll_by_raw(scroll_obj, indev->pointer.scroll_throw_vect.x, 0); - if(indev->reset_query) return; - } - /*With snapping find the nearest snap point and scroll there*/ - else { - int32_t diff_x = lv_indev_scroll_throw_predict(indev, LV_DIR_HOR); - indev->pointer.scroll_throw_vect.x = 0; - scroll_limit_diff(indev, &diff_x, NULL); - int32_t x = find_snap_point_x(scroll_obj, LV_COORD_MIN, LV_COORD_MAX, diff_x); - lv_obj_scroll_by(scroll_obj, x + diff_x, 0, LV_ANIM_ON); - if(indev->reset_query) return; - } - } - - /*Check if the scroll has finished*/ - if(indev->pointer.scroll_throw_vect.x == 0 && indev->pointer.scroll_throw_vect.y == 0) { - /*Revert if scrolled in*/ - /*If vertically scrollable and not controlled by snap*/ - if(align_y == LV_SCROLL_SNAP_NONE) { - int32_t st = lv_obj_get_scroll_top(scroll_obj); - int32_t sb = lv_obj_get_scroll_bottom(scroll_obj); - if(st > 0 || sb > 0) { - if(st < 0) { - lv_obj_scroll_by(scroll_obj, 0, st, LV_ANIM_ON); - if(indev->reset_query) return; - } - else if(sb < 0) { - lv_obj_scroll_by(scroll_obj, 0, -sb, LV_ANIM_ON); - if(indev->reset_query) return; - } - } - } - - /*If horizontally scrollable and not controlled by snap*/ - if(align_x == LV_SCROLL_SNAP_NONE) { - int32_t sl = lv_obj_get_scroll_left(scroll_obj); - int32_t sr = lv_obj_get_scroll_right(scroll_obj); - if(sl > 0 || sr > 0) { - if(sl < 0) { - lv_obj_scroll_by(scroll_obj, sl, 0, LV_ANIM_ON); - if(indev->reset_query) return; - } - else if(sr < 0) { - lv_obj_scroll_by(scroll_obj, -sr, 0, LV_ANIM_ON); - if(indev->reset_query) return; - } - } - } - - lv_obj_send_event(scroll_obj, LV_EVENT_SCROLL_END, indev); - if(indev->reset_query) return; - - indev->pointer.scroll_dir = LV_DIR_NONE; - indev->pointer.scroll_obj = NULL; - } -} - -int32_t lv_indev_scroll_throw_predict(lv_indev_t * indev, lv_dir_t dir) -{ - if(indev == NULL) return 0; - int32_t v; - switch(dir) { - case LV_DIR_VER: - v = indev->pointer.scroll_throw_vect_ori.y; - break; - case LV_DIR_HOR: - v = indev->pointer.scroll_throw_vect_ori.x; - break; - default: - return 0; - } - - int32_t scroll_throw = indev->scroll_throw; - int32_t sum = 0; - while(v) { - sum += v; - v = v * (100 - scroll_throw) / 100; - } - - return sum; -} - -void lv_indev_scroll_get_snap_dist(lv_obj_t * obj, lv_point_t * p) -{ - p->x = find_snap_point_x(obj, obj->coords.x1, obj->coords.x2, 0); - p->y = find_snap_point_y(obj, obj->coords.y1, obj->coords.y2, 0); -} - -lv_obj_t * lv_indev_find_scroll_obj(lv_indev_t * indev) -{ - lv_obj_t * obj_candidate = NULL; - lv_dir_t dir_candidate = LV_DIR_NONE; - int32_t scroll_limit = indev->scroll_limit; - - /*Go until find a scrollable object in the current direction - *More precisely: - * 1. Check the pressed object and all of its ancestors and try to find an object which is scrollable - * 2. Scrollable means it has some content out of its area - * 3. If an object can be scrolled into the current direction then use it ("real match"") - * 4. If can be scrolled on the current axis (hor/ver) save it as candidate (at least show an elastic scroll effect) - * 5. Use the last candidate. Always the "deepest" parent or the object from point 3*/ - lv_obj_t * obj_act = indev->pointer.act_obj; - - /*Decide if it's a horizontal or vertical scroll*/ - bool hor_en = false; - bool ver_en = false; - indev->pointer.scroll_sum.x += indev->pointer.vect.x; - indev->pointer.scroll_sum.y += indev->pointer.vect.y; - - while(obj_act) { - /*Get the transformed scroll_sum with this object*/ - int16_t angle = 0; - int32_t scale_x = 256; - int32_t scale_y = 256; - lv_point_t pivot = { 0, 0 }; - lv_obj_t * parent = obj_act; - while(parent) { - angle += lv_obj_get_style_transform_rotation(parent, 0); - int32_t zoom_act_x = lv_obj_get_style_transform_scale_x_safe(parent, 0); - int32_t zoom_act_y = lv_obj_get_style_transform_scale_y_safe(parent, 0); - scale_x = (scale_x * zoom_act_x) >> 8; - scale_y = (scale_y * zoom_act_y) >> 8; - parent = lv_obj_get_parent(parent); - } - - lv_point_t obj_scroll_sum = indev->pointer.scroll_sum; - if(angle != 0 || scale_x != LV_SCALE_NONE || scale_y != LV_SCALE_NONE) { - angle = -angle; - scale_x = (256 * 256) / scale_x; - scale_y = (256 * 256) / scale_y; - lv_point_transform(&obj_scroll_sum, angle, scale_x, scale_y, &pivot, false); - } - - if(LV_ABS(obj_scroll_sum.x) > LV_ABS(obj_scroll_sum.y)) { - hor_en = true; - } - else { - ver_en = true; - } - - if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLLABLE) == false) { - /*If this object don't want to chain the scroll to the parent stop searching*/ - if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_HOR) == false && hor_en) break; - if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_VER) == false && ver_en) break; - - obj_act = lv_obj_get_parent(obj_act); - continue; - } - - /*Consider both up-down or left/right scrollable according to the current direction*/ - bool up_en = ver_en; - bool down_en = ver_en; - bool left_en = hor_en; - bool right_en = hor_en; - - /*The object might have disabled some directions.*/ - lv_dir_t scroll_dir = lv_obj_get_scroll_dir(obj_act); - if((scroll_dir & LV_DIR_LEFT) == 0) left_en = false; - if((scroll_dir & LV_DIR_RIGHT) == 0) right_en = false; - if((scroll_dir & LV_DIR_TOP) == 0) up_en = false; - if((scroll_dir & LV_DIR_BOTTOM) == 0) down_en = false; - - /*The object is scrollable to a direction if its content overflow in that direction. - *If there are at least 2 snapable children always assume - *scrolling to allow scrolling to the other child*/ - uint32_t snap_cnt = 0; - - /*Horizontal scroll*/ - int32_t sl = 0; - int32_t sr = 0; - lv_scroll_snap_t snap_x = lv_obj_get_scroll_snap_x(obj_act); - if(snap_x != LV_SCROLL_SNAP_NONE) { - uint32_t child_cnt = lv_obj_get_child_count(obj_act); - uint32_t i; - for(i = 0; i < child_cnt; i++) { - if(lv_obj_has_flag(lv_obj_get_child(obj_act, i), LV_OBJ_FLAG_SNAPPABLE)) { - snap_cnt++; - if(snap_cnt == 2) { - sl = 1; /*Assume scrolling*/ - sr = 1; - break; - } - } - } - } - if(snap_x == LV_SCROLL_SNAP_NONE || snap_cnt < 2) { - sl = lv_obj_get_scroll_left(obj_act); - sr = lv_obj_get_scroll_right(obj_act); - } - - /*Vertical scroll*/ - snap_cnt = 0; - int32_t st = 0; - int32_t sb = 0; - lv_scroll_snap_t snap_y = lv_obj_get_scroll_snap_y(obj_act); - if(snap_y != LV_SCROLL_SNAP_NONE) { - uint32_t child_cnt = lv_obj_get_child_count(obj_act); - uint32_t i; - for(i = 0; i < child_cnt; i++) { - if(lv_obj_has_flag(lv_obj_get_child(obj_act, i), LV_OBJ_FLAG_SNAPPABLE)) { - snap_cnt++; - if(snap_cnt == 2) { - st = 1; /*Assume scrolling*/ - sb = 1; - break; - } - } - } - } - if(snap_y == LV_SCROLL_SNAP_NONE || snap_cnt < 2) { - st = lv_obj_get_scroll_top(obj_act); - sb = lv_obj_get_scroll_bottom(obj_act); - } - - - /*If this object is scrollable into the current scroll direction then save it as a candidate. - *It's important only to be scrollable on the current axis (hor/ver) because if the scroll - *is propagated to this object it can show at least elastic scroll effect. - *But if not hor/ver scrollable do not scroll it at all (so it's not a good candidate)*/ - if((st > 0 || sb > 0) && - ((up_en && obj_scroll_sum.y >= scroll_limit) || - (down_en && obj_scroll_sum.y <= - scroll_limit))) { - obj_candidate = obj_act; - dir_candidate = LV_DIR_VER; - } - - if((sl > 0 || sr > 0) && - ((left_en && obj_scroll_sum.x >= scroll_limit) || - (right_en && obj_scroll_sum.x <= - scroll_limit))) { - obj_candidate = obj_act; - dir_candidate = LV_DIR_HOR; - } - - if(st <= 0) up_en = false; - if(sb <= 0) down_en = false; - if(sl <= 0) left_en = false; - if(sr <= 0) right_en = false; - - /*If the object really can be scrolled into the current direction then use it.*/ - if((left_en && obj_scroll_sum.x >= scroll_limit) || - (right_en && obj_scroll_sum.x <= - scroll_limit) || - (up_en && obj_scroll_sum.y >= scroll_limit) || - (down_en && obj_scroll_sum.y <= - scroll_limit)) { - indev->pointer.scroll_dir = hor_en ? LV_DIR_HOR : LV_DIR_VER; - break; - } - - /*If this object don't want to chain the scroll to the parent stop searching*/ - if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_HOR) == false && hor_en) break; - if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_VER) == false && ver_en) break; - - /*Try the parent*/ - obj_act = lv_obj_get_parent(obj_act); - } - - /*Use the last candidate*/ - if(obj_candidate) { - indev->pointer.scroll_dir = dir_candidate; - indev->pointer.scroll_obj = obj_candidate; - indev->pointer.scroll_sum.x = 0; - indev->pointer.scroll_sum.y = 0; - } - - return obj_candidate; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void init_scroll_limits(lv_indev_t * indev) -{ - lv_obj_t * obj = indev->pointer.scroll_obj; - /*If there no STOP allow scrolling anywhere*/ - if(lv_obj_has_flag(obj, LV_OBJ_FLAG_SCROLL_ONE) == false) { - lv_area_set(&indev->pointer.scroll_area, LV_COORD_MIN, LV_COORD_MIN, LV_COORD_MAX, LV_COORD_MAX); - } - /*With STOP limit the scrolling to the perv and next snap point*/ - else { - switch(lv_obj_get_scroll_snap_y(obj)) { - case LV_SCROLL_SNAP_START: - indev->pointer.scroll_area.y1 = find_snap_point_y(obj, obj->coords.y1 + 1, LV_COORD_MAX, 0); - indev->pointer.scroll_area.y2 = find_snap_point_y(obj, LV_COORD_MIN, obj->coords.y1 - 1, 0); - break; - case LV_SCROLL_SNAP_END: - indev->pointer.scroll_area.y1 = find_snap_point_y(obj, obj->coords.y2, LV_COORD_MAX, 0); - indev->pointer.scroll_area.y2 = find_snap_point_y(obj, LV_COORD_MIN, obj->coords.y2, 0); - break; - case LV_SCROLL_SNAP_CENTER: { - int32_t y_mid = obj->coords.y1 + lv_area_get_height(&obj->coords) / 2; - indev->pointer.scroll_area.y1 = find_snap_point_y(obj, y_mid + 1, LV_COORD_MAX, 0); - indev->pointer.scroll_area.y2 = find_snap_point_y(obj, LV_COORD_MIN, y_mid - 1, 0); - break; - } - default: - indev->pointer.scroll_area.y1 = LV_COORD_MIN; - indev->pointer.scroll_area.y2 = LV_COORD_MAX; - break; - } - - switch(lv_obj_get_scroll_snap_x(obj)) { - case LV_SCROLL_SNAP_START: - indev->pointer.scroll_area.x1 = find_snap_point_x(obj, obj->coords.x1, LV_COORD_MAX, 0); - indev->pointer.scroll_area.x2 = find_snap_point_x(obj, LV_COORD_MIN, obj->coords.x1, 0); - break; - case LV_SCROLL_SNAP_END: - indev->pointer.scroll_area.x1 = find_snap_point_x(obj, obj->coords.x2, LV_COORD_MAX, 0); - indev->pointer.scroll_area.x2 = find_snap_point_x(obj, LV_COORD_MIN, obj->coords.x2, 0); - break; - case LV_SCROLL_SNAP_CENTER: { - int32_t x_mid = obj->coords.x1 + lv_area_get_width(&obj->coords) / 2; - indev->pointer.scroll_area.x1 = find_snap_point_x(obj, x_mid + 1, LV_COORD_MAX, 0); - indev->pointer.scroll_area.x2 = find_snap_point_x(obj, LV_COORD_MIN, x_mid - 1, 0); - break; - } - default: - indev->pointer.scroll_area.x1 = LV_COORD_MIN; - indev->pointer.scroll_area.x2 = LV_COORD_MAX; - break; - } - } - - /*`find_snap_point_x/y()` return LV_COORD_MAX is not snap point was found, - *but x1/y1 should be small. */ - if(indev->pointer.scroll_area.x1 == LV_COORD_MAX) indev->pointer.scroll_area.x1 = LV_COORD_MIN; - if(indev->pointer.scroll_area.y1 == LV_COORD_MAX) indev->pointer.scroll_area.y1 = LV_COORD_MIN; - - /*Allow scrolling on the edges. It will be reverted to the edge due to snapping anyway*/ - if(indev->pointer.scroll_area.x1 == 0) indev->pointer.scroll_area.x1 = LV_COORD_MIN; - if(indev->pointer.scroll_area.x2 == 0) indev->pointer.scroll_area.x2 = LV_COORD_MAX; - if(indev->pointer.scroll_area.y1 == 0) indev->pointer.scroll_area.y1 = LV_COORD_MIN; - if(indev->pointer.scroll_area.y2 == 0) indev->pointer.scroll_area.y2 = LV_COORD_MAX; -} - -/** - * Search for snap point in the min..max range. - * @param obj the object on which snap point should be found - * @param min ignore snap points smaller than this. (Absolute coordinate) - * @param max ignore snap points greater than this. (Absolute coordinate) - * @param ofs offset to snap points. Useful the get a snap point in an imagined case - * what if children are already moved by this value - * @return the absolute x coordinate of the nearest snap point - * or `LV_COORD_MAX` if there is no snap point in the min..max range - */ -static int32_t find_snap_point_x(const lv_obj_t * obj, int32_t min, int32_t max, int32_t ofs) -{ - lv_scroll_snap_t align = lv_obj_get_scroll_snap_x(obj); - if(align == LV_SCROLL_SNAP_NONE) return LV_COORD_MAX; - - int32_t dist = LV_COORD_MAX; - - int32_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t pad_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); - - uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); - for(i = 0; i < child_cnt; i++) { - lv_obj_t * child = obj->spec_attr->children[i]; - if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; - if(lv_obj_has_flag(child, LV_OBJ_FLAG_SNAPPABLE)) { - int32_t x_child = 0; - int32_t x_parent = 0; - switch(align) { - case LV_SCROLL_SNAP_START: - x_child = child->coords.x1; - x_parent = obj->coords.x1 + pad_left; - break; - case LV_SCROLL_SNAP_END: - x_child = child->coords.x2; - x_parent = obj->coords.x2 - pad_right; - break; - case LV_SCROLL_SNAP_CENTER: - x_child = child->coords.x1 + lv_area_get_width(&child->coords) / 2; - x_parent = obj->coords.x1 + pad_left + (lv_area_get_width(&obj->coords) - pad_left - pad_right) / 2; - break; - default: - continue; - } - - x_child += ofs; - if(x_child >= min && x_child <= max) { - int32_t x = x_child - x_parent; - if(LV_ABS(x) < LV_ABS(dist)) dist = x; - } - } - } - - return dist == LV_COORD_MAX ? LV_COORD_MAX : -dist; -} - -/** - * Search for snap point in the min..max range. - * @param obj the object on which snap point should be found - * @param min ignore snap points smaller than this. (Absolute coordinate) - * @param max ignore snap points greater than this. (Absolute coordinate) - * @param ofs offset to snap points. Useful to get a snap point in an imagined case - * what if children are already moved by this value - * @return the absolute y coordinate of the nearest snap point - * or `LV_COORD_MAX` if there is no snap point in the min..max range - */ -static int32_t find_snap_point_y(const lv_obj_t * obj, int32_t min, int32_t max, int32_t ofs) -{ - lv_scroll_snap_t align = lv_obj_get_scroll_snap_y(obj); - if(align == LV_SCROLL_SNAP_NONE) return LV_COORD_MAX; - - int32_t dist = LV_COORD_MAX; - - int32_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); - - uint32_t i; - uint32_t child_cnt = lv_obj_get_child_count(obj); - for(i = 0; i < child_cnt; i++) { - lv_obj_t * child = obj->spec_attr->children[i]; - if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; - if(lv_obj_has_flag(child, LV_OBJ_FLAG_SNAPPABLE)) { - int32_t y_child = 0; - int32_t y_parent = 0; - switch(align) { - case LV_SCROLL_SNAP_START: - y_child = child->coords.y1; - y_parent = obj->coords.y1 + pad_top; - break; - case LV_SCROLL_SNAP_END: - y_child = child->coords.y2; - y_parent = obj->coords.y2 - pad_bottom; - break; - case LV_SCROLL_SNAP_CENTER: - y_child = child->coords.y1 + lv_area_get_height(&child->coords) / 2; - y_parent = obj->coords.y1 + pad_top + (lv_area_get_height(&obj->coords) - pad_top - pad_bottom) / 2; - break; - default: - continue; - } - - y_child += ofs; - if(y_child >= min && y_child <= max) { - int32_t y = y_child - y_parent; - if(LV_ABS(y) < LV_ABS(dist)) dist = y; - } - } - } - - return dist == LV_COORD_MAX ? LV_COORD_MAX : -dist; -} - -static void scroll_limit_diff(lv_indev_t * indev, int32_t * diff_x, int32_t * diff_y) -{ - if(diff_y) { - if(indev->pointer.scroll_sum.y + *diff_y < indev->pointer.scroll_area.y1) { - *diff_y = indev->pointer.scroll_area.y1 - indev->pointer.scroll_sum.y; - } - - if(indev->pointer.scroll_sum.y + *diff_y > indev->pointer.scroll_area.y2) { - *diff_y = indev->pointer.scroll_area.y2 - indev->pointer.scroll_sum.y; - } - } - - if(diff_x) { - if(indev->pointer.scroll_sum.x + *diff_x < indev->pointer.scroll_area.x1) { - *diff_x = indev->pointer.scroll_area.x1 - indev->pointer.scroll_sum.x; - } - - if(indev->pointer.scroll_sum.x + *diff_x > indev->pointer.scroll_area.x2) { - *diff_x = indev->pointer.scroll_area.x2 - indev->pointer.scroll_sum.x; - } - } -} - -static int32_t elastic_diff(lv_obj_t * scroll_obj, int32_t diff, int32_t scroll_start, int32_t scroll_end, - lv_dir_t dir) -{ - /*Scroll back to the edge if required*/ - if(!lv_obj_has_flag(scroll_obj, LV_OBJ_FLAG_SCROLL_ELASTIC)) { - if(scroll_end + diff < 0) diff = - scroll_end; - if(scroll_start - diff < 0) diff = scroll_start; - } - /*Handle elastic scrolling*/ - else { - /*If there is snapping in the current direction don't use the elastic factor because - *it's natural that the first and last items are scrolled (snapped) in.*/ - lv_scroll_snap_t snap; - snap = dir == LV_DIR_HOR ? lv_obj_get_scroll_snap_x(scroll_obj) : lv_obj_get_scroll_snap_y(scroll_obj); - - bool no_more_start_snap = false; - bool no_more_end_snap = false; - - /*Without snapping just scale down the diff is scrolled out*/ - if(snap == LV_SCROLL_SNAP_NONE) { - if(scroll_end < 0 || scroll_start < 0) { - /*Rounding*/ - if(diff < 0) diff -= ELASTIC_SLOWNESS_FACTOR / 2; - if(diff > 0) diff += ELASTIC_SLOWNESS_FACTOR / 2; - diff = diff / ELASTIC_SLOWNESS_FACTOR; - } - } - /*With snapping the widget is scrolled out if there are no more snap points*/ - else { - if(dir == LV_DIR_HOR) { - int32_t x = 0; - switch(snap) { - case LV_SCROLL_SNAP_CENTER: { - int32_t pad_left = lv_obj_get_style_pad_left(scroll_obj, 0); - int32_t pad_right = lv_obj_get_style_pad_right(scroll_obj, 0); - x = scroll_obj->coords.x1; - x += (lv_area_get_width(&scroll_obj->coords) - pad_left - pad_right) / 2; - x += pad_left; - } - break; - case LV_SCROLL_SNAP_START: - x = scroll_obj->coords.x1 + lv_obj_get_style_pad_left(scroll_obj, 0); - break; - case LV_SCROLL_SNAP_END: - x = scroll_obj->coords.x2 - lv_obj_get_style_pad_right(scroll_obj, 0); - break; - default: - break; - } - int32_t d; - d = find_snap_point_x(scroll_obj, x + 1, LV_COORD_MAX, 0); - if(d == LV_COORD_MAX) no_more_end_snap = true; - d = find_snap_point_x(scroll_obj, LV_COORD_MIN, x, 0); - if(d == LV_COORD_MAX) no_more_start_snap = true; - } - else { - int32_t y = 0; - switch(snap) { - case LV_SCROLL_SNAP_CENTER: { - int32_t pad_top = lv_obj_get_style_pad_top(scroll_obj, 0); - int32_t pad_bottom = lv_obj_get_style_pad_bottom(scroll_obj, 0); - y = scroll_obj->coords.y1; - y += (lv_area_get_height(&scroll_obj->coords) - pad_top - pad_bottom) / 2; - y += pad_top; - } - break; - case LV_SCROLL_SNAP_START: - y = scroll_obj->coords.y1 + lv_obj_get_style_pad_top(scroll_obj, 0); - break; - case LV_SCROLL_SNAP_END: - y = scroll_obj->coords.y2 - lv_obj_get_style_pad_bottom(scroll_obj, 0); - break; - default: - break; - } - int32_t d; - d = find_snap_point_y(scroll_obj, y, LV_COORD_MAX, 0); - if(d == LV_COORD_MAX) no_more_end_snap = true; - d = find_snap_point_y(scroll_obj, LV_COORD_MIN, y, 0); - if(d == LV_COORD_MAX) no_more_start_snap = true; - } - } - - if(no_more_start_snap || no_more_end_snap) { - if(diff < 0) diff -= ELASTIC_SLOWNESS_FACTOR / 2; - if(diff > 0) diff += ELASTIC_SLOWNESS_FACTOR / 2; - return diff / ELASTIC_SLOWNESS_FACTOR; - } - else { - return diff; - } - } - - return diff; -} diff --git a/L3_Middlewares/LVGL/src/layouts/flex/lv_flex.h b/L3_Middlewares/LVGL/src/layouts/flex/lv_flex.h deleted file mode 100644 index 9724f9b..0000000 --- a/L3_Middlewares/LVGL/src/layouts/flex/lv_flex.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file lv_flex.h - * - */ - -#ifndef LV_FLEX_H -#define LV_FLEX_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#include "../../misc/lv_area.h" - -#if LV_USE_FLEX - -/********************* - * DEFINES - *********************/ - -#define LV_FLEX_COLUMN (1 << 0) -#define LV_FLEX_WRAP (1 << 2) -#define LV_FLEX_REVERSE (1 << 3) - -/********************** - * TYPEDEFS - **********************/ - -/*Can't include lv_obj.h because it includes this header file*/ - -typedef enum { - LV_FLEX_ALIGN_START, - LV_FLEX_ALIGN_END, - LV_FLEX_ALIGN_CENTER, - LV_FLEX_ALIGN_SPACE_EVENLY, - LV_FLEX_ALIGN_SPACE_AROUND, - LV_FLEX_ALIGN_SPACE_BETWEEN, -} lv_flex_align_t; - -typedef enum { - LV_FLEX_FLOW_ROW = 0x00, - LV_FLEX_FLOW_COLUMN = LV_FLEX_COLUMN, - LV_FLEX_FLOW_ROW_WRAP = LV_FLEX_FLOW_ROW | LV_FLEX_WRAP, - LV_FLEX_FLOW_ROW_REVERSE = LV_FLEX_FLOW_ROW | LV_FLEX_REVERSE, - LV_FLEX_FLOW_ROW_WRAP_REVERSE = LV_FLEX_FLOW_ROW | LV_FLEX_WRAP | LV_FLEX_REVERSE, - LV_FLEX_FLOW_COLUMN_WRAP = LV_FLEX_FLOW_COLUMN | LV_FLEX_WRAP, - LV_FLEX_FLOW_COLUMN_REVERSE = LV_FLEX_FLOW_COLUMN | LV_FLEX_REVERSE, - LV_FLEX_FLOW_COLUMN_WRAP_REVERSE = LV_FLEX_FLOW_COLUMN | LV_FLEX_WRAP | LV_FLEX_REVERSE, -} lv_flex_flow_t; - -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize a flex layout to default values - */ -void lv_flex_init(void); - -/** - * Set how the item should flow - * @param obj pointer to an object. The parent must have flex layout else nothing will happen. - * @param flow an element of `lv_flex_flow_t`. - */ -void lv_obj_set_flex_flow(lv_obj_t * obj, lv_flex_flow_t flow); - -/** - * Set how to place (where to align) the items and tracks - * @param obj pointer to an object. The parent must have flex layout else nothing will happen. - * @param main_place where to place the items on main axis (in their track). Any value of `lv_flex_align_t`. - * @param cross_place where to place the item in their track on the cross axis. `LV_FLEX_ALIGN_START/END/CENTER` - * @param track_cross_place where to place the tracks in the cross direction. Any value of `lv_flex_align_t`. - */ -void lv_obj_set_flex_align(lv_obj_t * obj, lv_flex_align_t main_place, lv_flex_align_t cross_place, - lv_flex_align_t track_cross_place); - -/** - * Sets the width or height (on main axis) to grow the object in order fill the free space - * @param obj pointer to an object. The parent must have flex layout else nothing will happen. - * @param grow a value to set how much free space to take proportionally to other growing items. - */ -void lv_obj_set_flex_grow(lv_obj_t * obj, uint8_t grow); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_FLEX*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_FLEX_H*/ diff --git a/L3_Middlewares/LVGL/src/layouts/grid/lv_grid.c b/L3_Middlewares/LVGL/src/layouts/grid/lv_grid.c deleted file mode 100644 index 70d3f79..0000000 --- a/L3_Middlewares/LVGL/src/layouts/grid/lv_grid.c +++ /dev/null @@ -1,665 +0,0 @@ -/** - * @file lv_grid.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_grid.h" - -#if LV_USE_GRID - -#include "../../stdlib/lv_string.h" -#include "../lv_layout.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_global.h" -/********************* - * DEFINES - *********************/ -#define layout_list_def LV_GLOBAL_DEFAULT()->layout_list - -/** - * Some helper defines - */ -#define IS_FR(x) (x >= LV_COORD_MAX - 100) -#define IS_CONTENT(x) (x == LV_COORD_MAX - 101) -#define GET_FR(x) (x - (LV_COORD_MAX - 100)) - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - uint32_t col; - uint32_t row; - lv_point_t grid_abs; -} item_repos_hint_t; - -typedef struct { - int32_t * x; - int32_t * y; - int32_t * w; - int32_t * h; - uint32_t col_num; - uint32_t row_num; - int32_t grid_w; - int32_t grid_h; -} lv_grid_calc_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void grid_update(lv_obj_t * cont, void * user_data); -static void calc(lv_obj_t * obj, lv_grid_calc_t * calc); -static void calc_free(lv_grid_calc_t * calc); -static void calc_cols(lv_obj_t * cont, lv_grid_calc_t * c); -static void calc_rows(lv_obj_t * cont, lv_grid_calc_t * c); -static void item_repos(lv_obj_t * item, lv_grid_calc_t * c, item_repos_hint_t * hint); -static int32_t grid_align(int32_t cont_size, bool auto_size, lv_grid_align_t align, int32_t gap, - uint32_t track_num, - int32_t * size_array, int32_t * pos_array, bool reverse); -static uint32_t count_tracks(const int32_t * templ); - -static inline const int32_t * get_col_dsc(lv_obj_t * obj) -{ - return lv_obj_get_style_grid_column_dsc_array(obj, 0); -} -static inline const int32_t * get_row_dsc(lv_obj_t * obj) -{ - return lv_obj_get_style_grid_row_dsc_array(obj, 0); -} -static inline int32_t get_col_pos(lv_obj_t * obj) -{ - return lv_obj_get_style_grid_cell_column_pos(obj, 0); -} -static inline int32_t get_row_pos(lv_obj_t * obj) -{ - return lv_obj_get_style_grid_cell_row_pos(obj, 0); -} -static inline int32_t get_col_span(lv_obj_t * obj) -{ - return lv_obj_get_style_grid_cell_column_span(obj, 0); -} -static inline int32_t get_row_span(lv_obj_t * obj) -{ - return lv_obj_get_style_grid_cell_row_span(obj, 0); -} -static inline lv_grid_align_t get_cell_col_align(lv_obj_t * obj) -{ - return lv_obj_get_style_grid_cell_x_align(obj, 0); -} -static inline lv_grid_align_t get_cell_row_align(lv_obj_t * obj) -{ - return lv_obj_get_style_grid_cell_y_align(obj, 0); -} -static inline lv_grid_align_t get_grid_col_align(lv_obj_t * obj) -{ - return lv_obj_get_style_grid_column_align(obj, 0); -} -static inline lv_grid_align_t get_grid_row_align(lv_obj_t * obj) -{ - return lv_obj_get_style_grid_row_align(obj, 0); -} -static inline int32_t get_margin_hor(lv_obj_t * obj) -{ - return lv_obj_get_style_margin_left(obj, LV_PART_MAIN) - + lv_obj_get_style_margin_right(obj, LV_PART_MAIN); -} -static inline int32_t get_margin_ver(lv_obj_t * obj) -{ - return lv_obj_get_style_margin_top(obj, LV_PART_MAIN) - + lv_obj_get_style_margin_bottom(obj, LV_PART_MAIN); -} - -static inline int32_t div_round_closest(int32_t dividend, int32_t divisor) -{ - return (dividend + divisor / 2) / divisor; -} - -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ -#if LV_USE_LOG && LV_LOG_TRACE_LAYOUT - #define LV_TRACE_LAYOUT(...) LV_LOG_TRACE(__VA_ARGS__) -#else - #define LV_TRACE_LAYOUT(...) -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_grid_init(void) -{ - layout_list_def[LV_LAYOUT_GRID].cb = grid_update; - layout_list_def[LV_LAYOUT_GRID].user_data = NULL; -} - -void lv_obj_set_grid_dsc_array(lv_obj_t * obj, const int32_t col_dsc[], const int32_t row_dsc[]) -{ - lv_obj_set_style_grid_column_dsc_array(obj, col_dsc, 0); - lv_obj_set_style_grid_row_dsc_array(obj, row_dsc, 0); - lv_obj_set_style_layout(obj, LV_LAYOUT_GRID, 0); -} - -void lv_obj_set_grid_align(lv_obj_t * obj, lv_grid_align_t column_align, lv_grid_align_t row_align) -{ - lv_obj_set_style_grid_column_align(obj, column_align, 0); - lv_obj_set_style_grid_row_align(obj, row_align, 0); - -} - -void lv_obj_set_grid_cell(lv_obj_t * obj, lv_grid_align_t x_align, int32_t col_pos, int32_t col_span, - lv_grid_align_t y_align, int32_t row_pos, int32_t row_span) - -{ - lv_obj_set_style_grid_cell_column_pos(obj, col_pos, 0); - lv_obj_set_style_grid_cell_row_pos(obj, row_pos, 0); - lv_obj_set_style_grid_cell_x_align(obj, x_align, 0); - lv_obj_set_style_grid_cell_column_span(obj, col_span, 0); - lv_obj_set_style_grid_cell_row_span(obj, row_span, 0); - lv_obj_set_style_grid_cell_y_align(obj, y_align, 0); - - lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj)); -} - -int32_t lv_grid_fr(uint8_t x) -{ - return LV_GRID_FR(x); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void grid_update(lv_obj_t * cont, void * user_data) -{ - LV_LOG_INFO("update %p container", (void *)cont); - LV_UNUSED(user_data); - - // const int32_t * col_templ = get_col_dsc(cont); - // const int32_t * row_templ = get_row_dsc(cont); - // if(col_templ == NULL || row_templ == NULL) return; - - lv_grid_calc_t c; - calc(cont, &c); - - item_repos_hint_t hint; - lv_memzero(&hint, sizeof(hint)); - - /*Calculate the grids absolute x and y coordinates. - *It will be used as helper during item repositioning to avoid calculating this value for every children*/ - int32_t pad_left = lv_obj_get_style_space_left(cont, LV_PART_MAIN); - int32_t pad_top = lv_obj_get_style_space_top(cont, LV_PART_MAIN); - hint.grid_abs.x = pad_left + cont->coords.x1 - lv_obj_get_scroll_x(cont); - hint.grid_abs.y = pad_top + cont->coords.y1 - lv_obj_get_scroll_y(cont); - - uint32_t i; - for(i = 0; i < cont->spec_attr->child_cnt; i++) { - lv_obj_t * item = cont->spec_attr->children[i]; - item_repos(item, &c, &hint); - } - calc_free(&c); - - int32_t w_set = lv_obj_get_style_width(cont, LV_PART_MAIN); - int32_t h_set = lv_obj_get_style_height(cont, LV_PART_MAIN); - if(w_set == LV_SIZE_CONTENT || h_set == LV_SIZE_CONTENT) { - lv_obj_refr_size(cont); - } - - lv_obj_send_event(cont, LV_EVENT_LAYOUT_CHANGED, NULL); - - LV_TRACE_LAYOUT("finished"); -} - -/** - * Calculate the grid cells coordinates - * @param cont an object that has a grid - * @param calc store the calculated cells sizes here - * @note `lv_grid_calc_free(calc_out)` needs to be called when `calc_out` is not needed anymore - */ -static void calc(lv_obj_t * cont, lv_grid_calc_t * calc_out) -{ - if(lv_obj_get_child(cont, 0) == NULL) { - lv_memzero(calc_out, sizeof(lv_grid_calc_t)); - return; - } - - calc_rows(cont, calc_out); - calc_cols(cont, calc_out); - - int32_t col_gap = lv_obj_get_style_pad_column(cont, LV_PART_MAIN); - int32_t row_gap = lv_obj_get_style_pad_row(cont, LV_PART_MAIN); - - bool rev = lv_obj_get_style_base_dir(cont, LV_PART_MAIN) == LV_BASE_DIR_RTL; - - int32_t w_set = lv_obj_get_style_width(cont, LV_PART_MAIN); - int32_t h_set = lv_obj_get_style_height(cont, LV_PART_MAIN); - bool auto_w = w_set == LV_SIZE_CONTENT && !cont->w_layout; - int32_t cont_w = lv_obj_get_content_width(cont); - calc_out->grid_w = grid_align(cont_w, auto_w, get_grid_col_align(cont), col_gap, calc_out->col_num, calc_out->w, - calc_out->x, rev); - - bool auto_h = h_set == LV_SIZE_CONTENT && !cont->h_layout; - int32_t cont_h = lv_obj_get_content_height(cont); - calc_out->grid_h = grid_align(cont_h, auto_h, get_grid_row_align(cont), row_gap, calc_out->row_num, calc_out->h, - calc_out->y, false); - - LV_ASSERT_MEM_INTEGRITY(); -} - -/** - * Free the a grid calculation's data - * @param calc pointer to the calculated grid cell coordinates - */ -static void calc_free(lv_grid_calc_t * calc) -{ - lv_free(calc->x); - lv_free(calc->y); - lv_free(calc->w); - lv_free(calc->h); -} - -static void calc_cols(lv_obj_t * cont, lv_grid_calc_t * c) -{ - - const int32_t * col_templ; - col_templ = get_col_dsc(cont); - bool subgrid = false; - if(col_templ == NULL) { - lv_obj_t * parent = lv_obj_get_parent(cont); - col_templ = get_col_dsc(parent); - if(col_templ == NULL) { - LV_LOG_WARN("No col descriptor found even on the parent"); - return; - } - - int32_t pos = get_col_pos(cont); - int32_t span = get_col_span(cont); - - int32_t * col_templ_sub = lv_malloc(sizeof(int32_t) * (span + 1)); - lv_memcpy(col_templ_sub, &col_templ[pos], sizeof(int32_t) * span); - col_templ_sub[span] = LV_GRID_TEMPLATE_LAST; - col_templ = col_templ_sub; - subgrid = true; - } - - int32_t cont_w = lv_obj_get_content_width(cont); - - c->col_num = count_tracks(col_templ); - c->x = lv_malloc(sizeof(int32_t) * c->col_num); - c->w = lv_malloc(sizeof(int32_t) * c->col_num); - - /*Set sizes for CONTENT cells*/ - uint32_t i; - for(i = 0; i < c->col_num; i++) { - int32_t size = LV_COORD_MIN; - if(IS_CONTENT(col_templ[i])) { - /*Check the size of children of this cell*/ - uint32_t ci; - for(ci = 0; ci < lv_obj_get_child_count(cont); ci++) { - lv_obj_t * item = lv_obj_get_child(cont, ci); - if(lv_obj_has_flag_any(item, LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; - uint32_t col_span = get_col_span(item); - if(col_span != 1) continue; - - uint32_t col_pos = get_col_pos(item); - if(col_pos != i) continue; - - size = LV_MAX(size, lv_obj_get_width(item)); - } - if(size >= 0) c->w[i] = size; - else c->w[i] = 0; - } - } - - uint32_t col_fr_cnt = 0; - int32_t grid_w = 0; - - for(i = 0; i < c->col_num; i++) { - int32_t x = col_templ[i]; - if(IS_FR(x)) { - col_fr_cnt += GET_FR(x); - } - else if(IS_CONTENT(x)) { - grid_w += c->w[i]; - } - else { - c->w[i] = x; - grid_w += x; - } - } - - int32_t col_gap = lv_obj_get_style_pad_column(cont, LV_PART_MAIN); - cont_w -= col_gap * (c->col_num - 1); - int32_t free_w = cont_w - grid_w; - if(free_w < 0) free_w = 0; - - for(i = 0; i < c->col_num && col_fr_cnt; i++) { - int32_t x = col_templ[i]; - if(IS_FR(x)) { - int32_t f = GET_FR(x); - c->w[i] = div_round_closest(free_w * f, col_fr_cnt); - /*By updating remaining fr and width, we ensure f == col_fr_cnt - *in the last loop iteration. That means the last iteration will - *not have rounding errors and use all remaining space.*/ - col_fr_cnt -= f; - free_w -= c->w[i]; - } - } - - if(subgrid) { - lv_free((void *)col_templ); - } -} - -static void calc_rows(lv_obj_t * cont, lv_grid_calc_t * c) -{ - const int32_t * row_templ; - row_templ = get_row_dsc(cont); - bool subgrid = false; - if(row_templ == NULL) { - lv_obj_t * parent = lv_obj_get_parent(cont); - row_templ = get_row_dsc(parent); - if(row_templ == NULL) { - LV_LOG_WARN("No row descriptor found even on the parent"); - return; - } - - int32_t pos = get_row_pos(cont); - int32_t span = get_row_span(cont); - - int32_t * row_templ_sub = lv_malloc(sizeof(int32_t) * (span + 1)); - lv_memcpy(row_templ_sub, &row_templ[pos], sizeof(int32_t) * span); - row_templ_sub[span] = LV_GRID_TEMPLATE_LAST; - row_templ = row_templ_sub; - subgrid = true; - } - - c->row_num = count_tracks(row_templ); - c->y = lv_malloc(sizeof(int32_t) * c->row_num); - c->h = lv_malloc(sizeof(int32_t) * c->row_num); - /*Set sizes for CONTENT cells*/ - uint32_t i; - for(i = 0; i < c->row_num; i++) { - int32_t size = LV_COORD_MIN; - if(IS_CONTENT(row_templ[i])) { - /*Check the size of children of this cell*/ - uint32_t ci; - for(ci = 0; ci < lv_obj_get_child_count(cont); ci++) { - lv_obj_t * item = lv_obj_get_child(cont, ci); - if(lv_obj_has_flag_any(item, LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; - uint32_t row_span = get_row_span(item); - if(row_span != 1) continue; - - uint32_t row_pos = get_row_pos(item); - if(row_pos != i) continue; - - size = LV_MAX(size, lv_obj_get_height(item)); - } - if(size >= 0) c->h[i] = size; - else c->h[i] = 0; - } - } - - uint32_t row_fr_cnt = 0; - int32_t grid_h = 0; - - for(i = 0; i < c->row_num; i++) { - int32_t x = row_templ[i]; - if(IS_FR(x)) { - row_fr_cnt += GET_FR(x); - } - else if(IS_CONTENT(x)) { - grid_h += c->h[i]; - } - else { - c->h[i] = x; - grid_h += x; - } - } - - int32_t row_gap = lv_obj_get_style_pad_row(cont, LV_PART_MAIN); - int32_t cont_h = lv_obj_get_content_height(cont) - row_gap * (c->row_num - 1); - int32_t free_h = cont_h - grid_h; - if(free_h < 0) free_h = 0; - - for(i = 0; i < c->row_num && row_fr_cnt; i++) { - int32_t x = row_templ[i]; - if(IS_FR(x)) { - int32_t f = GET_FR(x); - c->h[i] = div_round_closest(free_h * f, row_fr_cnt); - /*By updating remaining fr and height, we ensure f == row_fr_cnt - *in the last loop iteration. That means the last iteration will - *not have rounding errors and use all remaining space.*/ - row_fr_cnt -= f; - free_h -= c->h[i]; - } - } - - if(subgrid) { - lv_free((void *)row_templ); - } -} - -/** - * Reposition a grid item in its cell - * @param item a grid item to reposition - * @param calc the calculated grid of `cont` - * @param child_id_ext helper value if the ID of the child is know (order from the oldest) else -1 - * @param grid_abs helper value, the absolute position of the grid, NULL if unknown - */ -static void item_repos(lv_obj_t * item, lv_grid_calc_t * c, item_repos_hint_t * hint) -{ - if(lv_obj_has_flag_any(item, LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) return; - uint32_t col_span = get_col_span(item); - uint32_t row_span = get_row_span(item); - if(row_span == 0 || col_span == 0) return; - - uint32_t col_pos = get_col_pos(item); - uint32_t row_pos = get_row_pos(item); - lv_grid_align_t col_align = get_cell_col_align(item); - lv_grid_align_t row_align = get_cell_row_align(item); - - int32_t col_x1 = c->x[col_pos]; - int32_t col_x2 = c->x[col_pos + col_span - 1] + c->w[col_pos + col_span - 1]; - int32_t col_w = col_x2 - col_x1; - - int32_t row_y1 = c->y[row_pos]; - int32_t row_y2 = c->y[row_pos + row_span - 1] + c->h[row_pos + row_span - 1]; - int32_t row_h = row_y2 - row_y1; - - /*If the item has RTL base dir switch start and end*/ - if(lv_obj_get_style_base_dir(item, LV_PART_MAIN) == LV_BASE_DIR_RTL) { - if(col_align == LV_GRID_ALIGN_START) col_align = LV_GRID_ALIGN_END; - else if(col_align == LV_GRID_ALIGN_END) col_align = LV_GRID_ALIGN_START; - } - - int32_t x; - int32_t y; - int32_t item_w = lv_area_get_width(&item->coords); - int32_t item_h = lv_area_get_height(&item->coords); - - switch(col_align) { - default: - case LV_GRID_ALIGN_START: - x = c->x[col_pos] + lv_obj_get_style_margin_left(item, LV_PART_MAIN); - item->w_layout = 0; - break; - case LV_GRID_ALIGN_STRETCH: - x = c->x[col_pos] + lv_obj_get_style_margin_left(item, LV_PART_MAIN); - item_w = col_w - get_margin_hor(item); - item->w_layout = 1; - break; - case LV_GRID_ALIGN_CENTER: - x = c->x[col_pos] + (col_w - item_w) / 2 + (lv_obj_get_style_margin_left(item, LV_PART_MAIN) - - lv_obj_get_style_margin_right(item, LV_PART_MAIN)) / 2; - item->w_layout = 0; - break; - case LV_GRID_ALIGN_END: - x = c->x[col_pos] + col_w - lv_obj_get_width(item) - lv_obj_get_style_margin_right(item, LV_PART_MAIN); - item->w_layout = 0; - break; - } - - switch(row_align) { - default: - case LV_GRID_ALIGN_START: - y = c->y[row_pos] + lv_obj_get_style_margin_top(item, LV_PART_MAIN); - item->h_layout = 0; - break; - case LV_GRID_ALIGN_STRETCH: - y = c->y[row_pos] + lv_obj_get_style_margin_top(item, LV_PART_MAIN); - item_h = row_h - get_margin_ver(item); - item->h_layout = 1; - break; - case LV_GRID_ALIGN_CENTER: - y = c->y[row_pos] + (row_h - item_h) / 2 + (lv_obj_get_style_margin_top(item, LV_PART_MAIN) - - lv_obj_get_style_margin_bottom(item, LV_PART_MAIN)) / 2; - item->h_layout = 0; - break; - case LV_GRID_ALIGN_END: - y = c->y[row_pos] + row_h - lv_obj_get_height(item) - lv_obj_get_style_margin_bottom(item, LV_PART_MAIN); - item->h_layout = 0; - break; - } - - /*Set a new size if required*/ - if(lv_obj_get_width(item) != item_w || lv_obj_get_height(item) != item_h) { - lv_area_t old_coords; - lv_area_copy(&old_coords, &item->coords); - lv_obj_invalidate(item); - lv_area_set_width(&item->coords, item_w); - lv_area_set_height(&item->coords, item_h); - lv_obj_invalidate(item); - lv_obj_send_event(item, LV_EVENT_SIZE_CHANGED, &old_coords); - lv_obj_send_event(lv_obj_get_parent(item), LV_EVENT_CHILD_CHANGED, item); - - } - - /*Handle percentage value of translate*/ - int32_t tr_x = lv_obj_get_style_translate_x(item, LV_PART_MAIN); - int32_t tr_y = lv_obj_get_style_translate_y(item, LV_PART_MAIN); - int32_t w = lv_obj_get_width(item); - int32_t h = lv_obj_get_height(item); - if(LV_COORD_IS_PCT(tr_x)) tr_x = (w * LV_COORD_GET_PCT(tr_x)) / 100; - if(LV_COORD_IS_PCT(tr_y)) tr_y = (h * LV_COORD_GET_PCT(tr_y)) / 100; - - x += tr_x; - y += tr_y; - - int32_t diff_x = hint->grid_abs.x + x - item->coords.x1; - int32_t diff_y = hint->grid_abs.y + y - item->coords.y1; - if(diff_x || diff_y) { - lv_obj_invalidate(item); - item->coords.x1 += diff_x; - item->coords.x2 += diff_x; - item->coords.y1 += diff_y; - item->coords.y2 += diff_y; - lv_obj_invalidate(item); - lv_obj_move_children_by(item, diff_x, diff_y, false); - } -} - -/** - * Place the grid track according to align methods. It keeps the track sizes but sets their position. - * It can process both columns or rows according to the passed parameters. - * @param cont_size size of the containers content area (width/height) - * @param auto_size true: the container has auto size in the current direction - * @param align align method - * @param gap grid gap - * @param track_num number of tracks - * @param size_array array with the track sizes - * @param pos_array write the positions of the tracks here - * @return the total size of the grid - */ -static int32_t grid_align(int32_t cont_size, bool auto_size, lv_grid_align_t align, int32_t gap, - uint32_t track_num, - int32_t * size_array, int32_t * pos_array, bool reverse) -{ - int32_t grid_size = 0; - uint32_t i; - - if(auto_size) { - pos_array[0] = 0; - } - else { - /*With spaced alignment gap will be calculated from the remaining space*/ - if(align == LV_GRID_ALIGN_SPACE_AROUND || align == LV_GRID_ALIGN_SPACE_BETWEEN || align == LV_GRID_ALIGN_SPACE_EVENLY) { - gap = 0; - if(track_num == 1) align = LV_GRID_ALIGN_CENTER; - } - - /*Get the full grid size with gap*/ - for(i = 0; i < track_num; i++) { - grid_size += size_array[i] + gap; - } - grid_size -= gap; - - /*Calculate the position of the first item and set gap is necessary*/ - switch(align) { - case LV_GRID_ALIGN_START: - pos_array[0] = 0; - break; - case LV_GRID_ALIGN_CENTER: - pos_array[0] = (cont_size - grid_size) / 2; - break; - case LV_GRID_ALIGN_END: - pos_array[0] = cont_size - grid_size; - break; - case LV_GRID_ALIGN_SPACE_BETWEEN: - pos_array[0] = 0; - gap = (int32_t)(cont_size - grid_size) / (int32_t)(track_num - 1); - break; - case LV_GRID_ALIGN_SPACE_AROUND: - gap = (int32_t)(cont_size - grid_size) / (int32_t)(track_num); - pos_array[0] = gap / 2; - break; - case LV_GRID_ALIGN_SPACE_EVENLY: - gap = (int32_t)(cont_size - grid_size) / (int32_t)(track_num + 1); - pos_array[0] = gap; - break; - default: - break; - } - } - - /*Set the position of all tracks from the start position, gaps and track sizes*/ - for(i = 0; i < track_num - 1; i++) { - pos_array[i + 1] = pos_array[i] + size_array[i] + gap; - } - - int32_t total_gird_size = pos_array[track_num - 1] + size_array[track_num - 1] - pos_array[0]; - - if(reverse) { - for(i = 0; i < track_num; i++) { - pos_array[i] = cont_size - pos_array[i] - size_array[i]; - } - - } - - /*Return the full size of the grid*/ - return total_gird_size; -} - -static uint32_t count_tracks(const int32_t * templ) -{ - uint32_t i; - for(i = 0; templ[i] != LV_GRID_TEMPLATE_LAST; i++); - - return i; -} - -#endif /*LV_USE_GRID*/ diff --git a/L3_Middlewares/LVGL/src/layouts/grid/lv_grid.h b/L3_Middlewares/LVGL/src/layouts/grid/lv_grid.h deleted file mode 100644 index a7bf738..0000000 --- a/L3_Middlewares/LVGL/src/layouts/grid/lv_grid.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @file lv_grid.h - * - */ - -#ifndef LV_GRID_H -#define LV_GRID_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#include "../../misc/lv_area.h" - -#if LV_USE_GRID - -/********************* - * DEFINES - *********************/ -/** - * Can be used track size to make the track fill the free space. - * @param x how much space to take proportionally to other FR tracks - * @return a special track size - */ -#define LV_GRID_FR(x) (LV_COORD_MAX - 100 + x) - -#define LV_GRID_CONTENT (LV_COORD_MAX - 101) -LV_EXPORT_CONST_INT(LV_GRID_CONTENT); - -#define LV_GRID_TEMPLATE_LAST (LV_COORD_MAX) -LV_EXPORT_CONST_INT(LV_GRID_TEMPLATE_LAST); - -/********************** - * TYPEDEFS - **********************/ - -/*Can't include lv_obj.h because it includes this header file*/ - -typedef enum { - LV_GRID_ALIGN_START, - LV_GRID_ALIGN_CENTER, - LV_GRID_ALIGN_END, - LV_GRID_ALIGN_STRETCH, - LV_GRID_ALIGN_SPACE_EVENLY, - LV_GRID_ALIGN_SPACE_AROUND, - LV_GRID_ALIGN_SPACE_BETWEEN, -} lv_grid_align_t; - -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_grid_init(void); - -void lv_obj_set_grid_dsc_array(lv_obj_t * obj, const int32_t col_dsc[], const int32_t row_dsc[]); - -void lv_obj_set_grid_align(lv_obj_t * obj, lv_grid_align_t column_align, lv_grid_align_t row_align); - -/** - * Set the cell of an object. The object's parent needs to have grid layout, else nothing will happen - * @param obj pointer to an object - * @param column_align the vertical alignment in the cell. `LV_GRID_START/END/CENTER/STRETCH` - * @param col_pos column ID - * @param col_span number of columns to take (>= 1) - * @param row_align the horizontal alignment in the cell. `LV_GRID_START/END/CENTER/STRETCH` - * @param row_pos row ID - * @param row_span number of rows to take (>= 1) - */ -void lv_obj_set_grid_cell(lv_obj_t * obj, lv_grid_align_t column_align, int32_t col_pos, int32_t col_span, - lv_grid_align_t row_align, int32_t row_pos, int32_t row_span); - -/** - * Just a wrapper to `LV_GRID_FR` for bindings. - */ -int32_t lv_grid_fr(uint8_t x); - -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_GRID*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_GRID_H*/ diff --git a/L3_Middlewares/LVGL/src/layouts/lv_layout.c b/L3_Middlewares/LVGL/src/layouts/lv_layout.c deleted file mode 100644 index ddb3b0e..0000000 --- a/L3_Middlewares/LVGL/src/layouts/lv_layout.c +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @file lv_layout.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_layout_private.h" -#include "../core/lv_global.h" -#include "../core/lv_obj.h" - -/********************* - * DEFINES - *********************/ -#define layout_cnt LV_GLOBAL_DEFAULT()->layout_count -#define layout_list_def LV_GLOBAL_DEFAULT()->layout_list - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_layout_init(void) -{ - /*Malloc a list for the built in layouts*/ - layout_list_def = lv_malloc(layout_cnt * sizeof(lv_layout_dsc_t)); - -#if LV_USE_FLEX - lv_flex_init(); -#endif - -#if LV_USE_GRID - lv_grid_init(); -#endif -} - -void lv_layout_deinit(void) -{ - lv_free(layout_list_def); -} - -uint32_t lv_layout_register(lv_layout_update_cb_t cb, void * user_data) -{ - layout_list_def = lv_realloc(layout_list_def, (layout_cnt + 1) * sizeof(lv_layout_dsc_t)); - LV_ASSERT_MALLOC(layout_list_def); - - layout_list_def[layout_cnt].cb = cb; - layout_list_def[layout_cnt].user_data = user_data; - return layout_cnt++; -} - -void lv_layout_apply(lv_obj_t * obj) -{ - lv_layout_t layout_id = lv_obj_get_style_layout(obj, LV_PART_MAIN); - if(layout_id > 0 && layout_id <= layout_cnt) { - void * user_data = layout_list_def[layout_id].user_data; - layout_list_def[layout_id].cb(obj, user_data); - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ diff --git a/L3_Middlewares/LVGL/src/layouts/lv_layout.h b/L3_Middlewares/LVGL/src/layouts/lv_layout.h deleted file mode 100644 index a783d2b..0000000 --- a/L3_Middlewares/LVGL/src/layouts/lv_layout.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @file lv_layout.h - * - */ - -#ifndef LV_LAYOUT_H -#define LV_LAYOUT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_conf_internal.h" -#include "../misc/lv_types.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef void (*lv_layout_update_cb_t)(lv_obj_t *, void * user_data); - -typedef enum { - LV_LAYOUT_NONE = 0, - -#if LV_USE_FLEX - LV_LAYOUT_FLEX, -#endif - -#if LV_USE_GRID - LV_LAYOUT_GRID, -#endif - - LV_LAYOUT_LAST -} lv_layout_t; - -/** - * Register a new layout - * @param cb the layout update callback - * @param user_data custom data that will be passed to `cb` - * @return the ID of the new layout - */ -uint32_t lv_layout_register(lv_layout_update_cb_t cb, void * user_data); - -/********************** - * MACROS - **********************/ - -#if LV_USE_FLEX -#include "flex/lv_flex.h" -#endif /* LV_USE_FLEX */ - -#if LV_USE_GRID -#include "grid/lv_grid.h" -#endif /* LV_USE_GRID */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_LAYOUT_H*/ diff --git a/L3_Middlewares/LVGL/src/layouts/lv_layout_private.h b/L3_Middlewares/LVGL/src/layouts/lv_layout_private.h deleted file mode 100644 index dace2fc..0000000 --- a/L3_Middlewares/LVGL/src/layouts/lv_layout_private.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @file lv_layout_private.h - * - */ - -#ifndef LV_LAYOUT_PRIVATE_H -#define LV_LAYOUT_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_layout.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - lv_layout_update_cb_t cb; - void * user_data; -} lv_layout_dsc_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_layout_init(void); - -void lv_layout_deinit(void); - -/** - * Update the layout of a widget - * @param obj pointer to a widget - */ -void lv_layout_apply(lv_obj_t * obj); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_LAYOUT_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/barcode/code128.c b/L3_Middlewares/LVGL/src/libs/barcode/code128.c deleted file mode 100644 index 4fc00cb..0000000 --- a/L3_Middlewares/LVGL/src/libs/barcode/code128.c +++ /dev/null @@ -1,582 +0,0 @@ -// Copyright (c) 2013, LKC Technologies, Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. 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. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT -// HOLDERS 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 -// COPYRIGHT HOLDER 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. - -#include "../../../lvgl.h" -#if LV_USE_BARCODE - -#include "code128.h" -#include - -#define CODE128_MALLOC lv_malloc -#define CODE128_REALLOC lv_realloc -#define CODE128_FREE lv_free -#define CODE128_MEMSET lv_memset -#define CODE128_STRLEN lv_strlen -#define CODE128_ASSERT LV_ASSERT - -#define CODE128_QUIET_ZONE_LEN 10 -#define CODE128_CHAR_LEN 11 -#define CODE128_STOP_CODE_LEN 13 - -#define CODE128_START_CODE_A 103 -#define CODE128_START_CODE_B 104 -#define CODE128_START_CODE_C 105 - -#define CODE128_MODE_A 'a' -#define CODE128_MODE_B 'b' -#define CODE128_MODE_C 'c' - -#define CODE128_MIN_ENCODE_LEN (CODE128_QUIET_ZONE_LEN * 2 + CODE128_CHAR_LEN * 2 + CODE128_STOP_CODE_LEN) - -static const int code128_pattern[] = { - // value: pattern, bar/space widths - 1740, // 0: 11011001100, 212222 - 1644, // 1: 11001101100, 222122 - 1638, // 2: 11001100110, 222221 - 1176, // 3: 10010011000, 121223 - 1164, // 4: 10010001100, 121322 - 1100, // 5: 10001001100, 131222 - 1224, // 6: 10011001000, 122213 - 1220, // 7: 10011000100, 122312 - 1124, // 8: 10001100100, 132212 - 1608, // 9: 11001001000, 221213 - 1604, // 10: 11001000100, 221312 - 1572, // 11: 11000100100, 231212 - 1436, // 12: 10110011100, 112232 - 1244, // 13: 10011011100, 122132 - 1230, // 14: 10011001110, 122231 - 1484, // 15: 10111001100, 113222 - 1260, // 16: 10011101100, 123122 - 1254, // 17: 10011100110, 123221 - 1650, // 18: 11001110010, 223211 - 1628, // 19: 11001011100, 221132 - 1614, // 20: 11001001110, 221231 - 1764, // 21: 11011100100, 213212 - 1652, // 22: 11001110100, 223112 - 1902, // 23: 11101101110, 312131 - 1868, // 24: 11101001100, 311222 - 1836, // 25: 11100101100, 321122 - 1830, // 26: 11100100110, 321221 - 1892, // 27: 11101100100, 312212 - 1844, // 28: 11100110100, 322112 - 1842, // 29: 11100110010, 322211 - 1752, // 30: 11011011000, 212123 - 1734, // 31: 11011000110, 212321 - 1590, // 32: 11000110110, 232121 - 1304, // 33: 10100011000, 111323 - 1112, // 34: 10001011000, 131123 - 1094, // 35: 10001000110, 131321 - 1416, // 36: 10110001000, 112313 - 1128, // 37: 10001101000, 132113 - 1122, // 38: 10001100010, 132311 - 1672, // 39: 11010001000, 211313 - 1576, // 40: 11000101000, 231113 - 1570, // 41: 11000100010, 231311 - 1464, // 42: 10110111000, 112133 - 1422, // 43: 10110001110 - 1134, // 44: 10001101110 - 1496, // 45: 10111011000, 113123 - 1478, // 46: 10111000110, 113321 - 1142, // 47: 10001110110, 133121 - 1910, // 48: 11101110110, 313121 - 1678, // 49: 11010001110, 211331 - 1582, // 50: 11000101110, 231131 - 1768, // 51: 11011101000, 213113 - 1762, // 52: 11011100010, 213311 - 1774, // 53: 11011101110, 213131 - 1880, // 54: 11101011000, 311123 - 1862, // 55: 11101000110, 311321 - 1814, // 56: 11100010110, 331121 - 1896, // 57: 11101101000, 312113 - 1890, // 58: 11101100010, 312311 - 1818, // 59: 11100011010, 332111 - 1914, // 60: 11101111010, 314111 - 1602, // 61: 11001000010, 221411 - 1930, // 62: 11110001010, 431111 - 1328, // 63: 10100110000, 111224 - 1292, // 64: 10100001100, 111422 - 1200, // 65: 10010110000, 121124 - 1158, // 66: 10010000110, 121421 - 1068, // 67: 10000101100, 141122 - 1062, // 68: 10000100110, 141221 - 1424, // 69: 10110010000, 112214 - 1412, // 70: 10110000100, 112412 - 1232, // 71: 10011010000, 122114 - 1218, // 72: 10011000010, 122411 - 1076, // 73: 10000110100, 142112 - 1074, // 74: 10000110010, 142211 - 1554, // 75: 11000010010, 241211 - 1616, // 76: 11001010000, 221114 - 1978, // 77: 11110111010, 413111 - 1556, // 78: 11000010100, 241112 - 1146, // 79: 10001111010, 134111 - 1340, // 80: 10100111100, 111242 - 1212, // 81: 10010111100, 121142 - 1182, // 82: 10010011110, 121241 - 1508, // 83: 10111100100, 114212 - 1268, // 84: 10011110100, 124112 - 1266, // 85: 10011110010, 124211 - 1956, // 86: 11110100100, 411212 - 1940, // 87: 11110010100, 421112 - 1938, // 88: 11110010010, 421211 - 1758, // 89: 11011011110, 212141 - 1782, // 90: 11011110110, 214121 - 1974, // 91: 11110110110, 412121 - 1400, // 92: 10101111000, 111143 - 1310, // 93: 10100011110, 111341 - 1118, // 94: 10001011110, 131141 - 1512, // 95: 10111101000, 114113 - 1506, // 96: 10111100010, 114311 - 1960, // 97: 11110101000, 411113 - 1954, // 98: 11110100010, 411311 - 1502, // 99: 10111011110, 113141 - 1518, // 100: 10111101110, 114131 - 1886, // 101: 11101011110, 311141 - 1966, // 102: 11110101110, 411131 - 1668, // 103: 11010000100, 211412 - 1680, // 104: 11010010000, 211214 - 1692 // 105: 11010011100, 211232 -}; - -static const int code128_stop_pattern = 6379; // 1100011101011, 2331112 - -struct code128_step { - int prev_ix; // Index of previous step, if any - const char * next_input; // Remaining input - unsigned short len; // The length of the pattern so far (includes this step) - char mode; // State for the current encoding - signed char code; // What code should be written for this step -}; - -struct code128_state { - struct code128_step * steps; - int allocated_steps; - int current_ix; - int todo_ix; - int best_ix; - - size_t maxlength; -}; - -size_t code128_estimate_len(const char * s) -{ - return CODE128_QUIET_ZONE_LEN - + CODE128_CHAR_LEN // start code - + CODE128_CHAR_LEN * (CODE128_STRLEN(s) * 11 / 10) // contents + 10% padding - + CODE128_CHAR_LEN // checksum - + CODE128_STOP_CODE_LEN - + CODE128_QUIET_ZONE_LEN; -} - -static void code128_append_pattern(int pattern, int pattern_length, char * out) -{ - // All patterns have their first bit set by design - CODE128_ASSERT(pattern & (1 << (pattern_length - 1))); - - int i; - for(i = pattern_length - 1; i >= 0; i--) { - // cast avoids warning: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Wconstant-conversion] - *out++ = (unsigned char)((pattern & (1 << i)) ? 255 : 0); - } -} - -static int code128_append_code(int code, char * out) -{ - CODE128_ASSERT(code >= 0 && code < (int)(sizeof(code128_pattern) / sizeof(code128_pattern[0]))); - code128_append_pattern(code128_pattern[code], CODE128_CHAR_LEN, out); - return CODE128_CHAR_LEN; -} - -static int code128_append_stop_code(char * out) -{ - code128_append_pattern(code128_stop_pattern, CODE128_STOP_CODE_LEN, out); - return CODE128_STOP_CODE_LEN; -} - -static signed char code128_switch_code(char from_mode, char to_mode) -{ - switch(from_mode) { - case CODE128_MODE_A: - switch(to_mode) { - case CODE128_MODE_B: - return 100; - case CODE128_MODE_C: - return 99; - } - break; - - case CODE128_MODE_B: - switch(to_mode) { - case CODE128_MODE_A: - return 101; - case CODE128_MODE_C: - return 99; - } - break; - - case CODE128_MODE_C: - switch(to_mode) { - case CODE128_MODE_B: - return 100; - case CODE128_MODE_A: - return 101; - } - break; - default: - break; - } - - CODE128_ASSERT(0); // Invalid mode switch - return -1; -} - -static signed char code128a_ascii_to_code(signed char value) -{ - if(value >= ' ' && value <= '_') - return (signed char)(value - ' '); - else if(value >= 0 && value < ' ') - return (signed char)(value + 64); - else if(value == (signed char)CODE128_FNC1) - return 102; - else if(value == (signed char)CODE128_FNC2) - return 97; - else if(value == (signed char)CODE128_FNC3) - return 96; - else if(value == (signed char)CODE128_FNC4) - return 101; - else - return -1; -} - -static signed char code128b_ascii_to_code(signed char value) -{ - if(value >= ' ') // value <= 127 is implied - return (signed char)(value - ' '); - else if(value == (signed char)CODE128_FNC1) - return 102; - else if(value == (signed char)CODE128_FNC2) - return 97; - else if(value == (signed char)CODE128_FNC3) - return 96; - else if(value == (signed char)CODE128_FNC4) - return 100; - else - return -1; -} - -static signed char code128c_ascii_to_code(const char * values) -{ - if(values[0] == CODE128_FNC1) - return 102; - - if(values[0] >= '0' && values[0] <= '9' && - values[1] >= '0' && values[1] <= '9') { - char code = 10 * (values[0] - '0') + (values[1] - '0'); - return code; - } - - return -1; -} - -static int code128_do_a_step(struct code128_step * base, int prev_ix, int ix) -{ - struct code128_step * previous_step = &base[prev_ix]; - struct code128_step * step = &base[ix]; - - char value = *previous_step->next_input; - // NOTE: Currently we can't encode NULL - if(value == 0) - return 0; - - step->code = code128a_ascii_to_code(value); - if(step->code < 0) - return 0; - - step->prev_ix = prev_ix; - step->next_input = previous_step->next_input + 1; - step->mode = CODE128_MODE_A; - step->len = previous_step->len + CODE128_CHAR_LEN; - if(step->mode != previous_step->mode) - step->len += CODE128_CHAR_LEN; // Need to switch modes - - return 1; -} - -static int code128_do_b_step(struct code128_step * base, int prev_ix, int ix) -{ - struct code128_step * previous_step = &base[prev_ix]; - struct code128_step * step = &base[ix]; - - char value = *previous_step->next_input; - // NOTE: Currently we can't encode NULL - if(value == 0) - return 0; - - step->code = code128b_ascii_to_code(value); - if(step->code < 0) - return 0; - - step->prev_ix = prev_ix; - step->next_input = previous_step->next_input + 1; - step->mode = CODE128_MODE_B; - step->len = previous_step->len + CODE128_CHAR_LEN; - if(step->mode != previous_step->mode) - step->len += CODE128_CHAR_LEN; // Need to switch modes - - return 1; -} - -static int code128_do_c_step(struct code128_step * base, int prev_ix, int ix) -{ - struct code128_step * previous_step = &base[prev_ix]; - struct code128_step * step = &base[ix]; - - char value = *previous_step->next_input; - // NOTE: Currently we can't encode NULL - if(value == 0) - return 0; - - step->code = code128c_ascii_to_code(previous_step->next_input); - if(step->code < 0) - return 0; - - step->prev_ix = prev_ix; - step->next_input = previous_step->next_input + 1; - - // Mode C consumes 2 characters for codes 0-99 - if(step->code < 100) - step->next_input++; - - step->mode = CODE128_MODE_C; - step->len = previous_step->len + CODE128_CHAR_LEN; - if(step->mode != previous_step->mode) - step->len += CODE128_CHAR_LEN; // Need to switch modes - - return 1; -} - -static struct code128_step * code128_alloc_step(struct code128_state * state) -{ - if(state->todo_ix >= state->allocated_steps) { - state->allocated_steps += 1024; - state->steps = (struct code128_step *) CODE128_REALLOC(state->steps, - state->allocated_steps * sizeof(struct code128_step)); - } - - struct code128_step * step = &state->steps[state->todo_ix]; - - CODE128_MEMSET(step, 0, sizeof(*step)); - return step; -} - -static void code128_do_step(struct code128_state * state) -{ - struct code128_step * step = &state->steps[state->current_ix]; - if(*step->next_input == 0) { - // Done, so see if we have a new shortest encoding. - if((step->len < state->maxlength) || - (state->best_ix < 0 && step->len == state->maxlength)) { - state->best_ix = state->current_ix; - - // Update maxlength to avoid considering anything longer - state->maxlength = step->len; - } - return; - } - - // Don't try if we're already at or beyond the max acceptable - // length; - if(step->len >= state->maxlength) - return; - char mode = step->mode; - - code128_alloc_step(state); - int mode_c_worked = 0; - - // Always try mode C - if(code128_do_c_step(state->steps, state->current_ix, state->todo_ix)) { - state->todo_ix++; - code128_alloc_step(state); - mode_c_worked = 1; - } - - if(mode == CODE128_MODE_A) { - // If A works, stick with A. There's no advantage to switching - // to B proactively if A still works. - if(code128_do_a_step(state->steps, state->current_ix, state->todo_ix) || - code128_do_b_step(state->steps, state->current_ix, state->todo_ix)) - state->todo_ix++; - } - else if(mode == CODE128_MODE_B) { - // The same logic applies here. There's no advantage to switching - // proactively to A if B still works. - if(code128_do_b_step(state->steps, state->current_ix, state->todo_ix) || - code128_do_a_step(state->steps, state->current_ix, state->todo_ix)) - state->todo_ix++; - } - else if(!mode_c_worked) { - // In mode C. If mode C worked and we're in mode C, trying anything - // else is pointless since the mode C encoding will be shorter and - // there won't be any mode switches. - - // If we're leaving mode C, though, try both in case one ends up - // better than the other. - if(code128_do_a_step(state->steps, state->current_ix, state->todo_ix)) { - state->todo_ix++; - code128_alloc_step(state); - } - if(code128_do_b_step(state->steps, state->current_ix, state->todo_ix)) - state->todo_ix++; - } -} - -size_t code128_encode_raw(const char * s, char * out, size_t maxlength) -{ - struct code128_state state; - - const size_t overhead = CODE128_QUIET_ZONE_LEN - + CODE128_CHAR_LEN // checksum - + CODE128_STOP_CODE_LEN - + CODE128_QUIET_ZONE_LEN; - if(maxlength < overhead + CODE128_CHAR_LEN + CODE128_CHAR_LEN) { - // Need space to encode the start character and one additional - // character. - return 0; - } - - state.allocated_steps = 256; - state.steps = (struct code128_step *) CODE128_MALLOC(state.allocated_steps * sizeof(struct code128_step)); - state.current_ix = 0; - state.todo_ix = 0; - state.maxlength = maxlength - overhead; - state.best_ix = -1; - - // Initialize the first 3 steps for the 3 encoding routes (A, B, C) - state.steps[0].prev_ix = -1; - state.steps[0].next_input = s; - state.steps[0].len = CODE128_CHAR_LEN; - state.steps[0].mode = CODE128_MODE_C; - state.steps[0].code = CODE128_START_CODE_C; - - state.steps[1].prev_ix = -1; - state.steps[1].next_input = s; - state.steps[1].len = CODE128_CHAR_LEN; - state.steps[1].mode = CODE128_MODE_A; - state.steps[1].code = CODE128_START_CODE_A; - - state.steps[2].prev_ix = -1; - state.steps[2].next_input = s; - state.steps[2].len = CODE128_CHAR_LEN; - state.steps[2].mode = CODE128_MODE_B; - state.steps[2].code = CODE128_START_CODE_B; - - state.todo_ix = 3; - - // Keep going until no more work - do { - code128_do_step(&state); - state.current_ix++; - } while(state.current_ix != state.todo_ix); - - // If no best_step, then fail. - if(state.best_ix < 0) { - CODE128_FREE(state.steps); - return 0; - } - - // Determine the list of codes - size_t num_codes = state.maxlength / CODE128_CHAR_LEN; - char * codes = CODE128_MALLOC(num_codes); - CODE128_ASSERT(codes); - - struct code128_step * step = &state.steps[state.best_ix]; - size_t i; - for(i = num_codes - 1; i > 0; --i) { - struct code128_step * prev_step = &state.steps[step->prev_ix]; - codes[i] = step->code; - if(step->mode != prev_step->mode) { - --i; - codes[i] = code128_switch_code(prev_step->mode, step->mode); - } - step = prev_step; - } - codes[0] = step->code; - - // Encode everything up to the checksum - size_t actual_length = state.maxlength + overhead; - CODE128_MEMSET(out, 0, CODE128_QUIET_ZONE_LEN); - out += CODE128_QUIET_ZONE_LEN; - for(i = 0; i < num_codes; i++) - out += code128_append_code(codes[i], out); - - // Compute the checksum - int sum = codes[0]; - for(i = 1; i < num_codes; i++) - sum += (int)(codes[i] * i); - out += code128_append_code(sum % 103, out); - - // Finalize the code. - out += code128_append_stop_code(out); - CODE128_MEMSET(out, 0, CODE128_QUIET_ZONE_LEN); - - CODE128_FREE(codes); - CODE128_FREE(state.steps); - return actual_length; -} - -/** - * @brief Encode the GS1 string - * - * This converts [FNC1] sequences to raw FNC1 characters and - * removes spaces before encoding the barcodes. - * - * @return the length of barcode data in bytes - */ -size_t code128_encode_gs1(const char * s, char * out, size_t maxlength) -{ - size_t raw_size = CODE128_STRLEN(s) + 1; - char * raw = CODE128_MALLOC(raw_size); - CODE128_ASSERT(raw); - if(!raw) { - return 0; - } - - char * p = raw; - for(; *s != '\0'; s++) { - if(strncmp(s, "[FNC1]", 6) == 0) { - *p++ = CODE128_FNC1; - s += 5; - } - else if(*s != ' ') { - *p++ = *s; - } - } - *p = '\0'; - - size_t length = code128_encode_raw(raw, out, maxlength); - - CODE128_FREE(raw); - - return length; -} - -#endif /*LV_USE_BARCODE*/ diff --git a/L3_Middlewares/LVGL/src/libs/barcode/code128.h b/L3_Middlewares/LVGL/src/libs/barcode/code128.h deleted file mode 100644 index 51d53d0..0000000 --- a/L3_Middlewares/LVGL/src/libs/barcode/code128.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2013-15, LKC Technologies, Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. 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. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT -// HOLDERS 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 -// COPYRIGHT HOLDER 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. - -#ifndef CODE128_H -#define CODE128_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Since the FNCn characters are not ASCII, define versions here to -// simplify encoding strings that include them. -#define CODE128_FNC1 '\xf1' -#define CODE128_FNC2 '\xf2' -#define CODE128_FNC3 '\xf3' -#define CODE128_FNC4 '\xf4' - -size_t code128_estimate_len(const char * s); -size_t code128_encode_gs1(const char * s, char * out, size_t maxlength); -size_t code128_encode_raw(const char * s, char * out, size_t maxlength); - -#ifdef __cplusplus -} -#endif - -#endif // CODE128_H diff --git a/L3_Middlewares/LVGL/src/libs/barcode/lv_barcode.c b/L3_Middlewares/LVGL/src/libs/barcode/lv_barcode.c deleted file mode 100644 index 5688533..0000000 --- a/L3_Middlewares/LVGL/src/libs/barcode/lv_barcode.c +++ /dev/null @@ -1,300 +0,0 @@ -/** - * @file lv_barcode.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../core/lv_obj_class_private.h" -#include "lv_barcode_private.h" -#include "../../lvgl.h" - -#if LV_USE_BARCODE - -#include "code128.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_barcode_class) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_barcode_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_barcode_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static bool lv_barcode_change_buf_size(lv_obj_t * obj, int32_t w, int32_t h); -static void lv_barcode_clear(lv_obj_t * obj); - -/********************** - * STATIC VARIABLES - **********************/ - -const lv_obj_class_t lv_barcode_class = { - .constructor_cb = lv_barcode_constructor, - .destructor_cb = lv_barcode_destructor, - .width_def = LV_SIZE_CONTENT, - .instance_size = sizeof(lv_barcode_t), - .base_class = &lv_canvas_class, - .name = "barcode", -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_barcode_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -void lv_barcode_set_dark_color(lv_obj_t * obj, lv_color_t color) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_barcode_t * barcode = (lv_barcode_t *)obj; - barcode->dark_color = color; -} - -void lv_barcode_set_light_color(lv_obj_t * obj, lv_color_t color) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_barcode_t * barcode = (lv_barcode_t *)obj; - barcode->light_color = color; -} - -void lv_barcode_set_scale(lv_obj_t * obj, uint16_t scale) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - if(scale == 0) { - scale = 1; - } - - lv_barcode_t * barcode = (lv_barcode_t *)obj; - barcode->scale = scale; -} - -void lv_barcode_set_direction(lv_obj_t * obj, lv_dir_t direction) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_barcode_t * barcode = (lv_barcode_t *)obj; - barcode->direction = direction; -} - -void lv_barcode_set_tiled(lv_obj_t * obj, bool tiled) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_barcode_t * barcode = (lv_barcode_t *)obj; - barcode->tiled = tiled; - lv_image_set_inner_align(obj, tiled ? LV_IMAGE_ALIGN_TILE : LV_IMAGE_ALIGN_DEFAULT); -} - -lv_result_t lv_barcode_update(lv_obj_t * obj, const char * data) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(data); - - if(data == NULL || lv_strlen(data) == 0) { - LV_LOG_WARN("data is empty"); - lv_barcode_clear(obj); - return LV_RESULT_INVALID; - } - - size_t len = code128_estimate_len(data); - LV_LOG_INFO("data: %s, len = %zu", data, len); - - char * out_buf = lv_malloc(len); - LV_ASSERT_MALLOC(out_buf); - if(!out_buf) { - LV_LOG_ERROR("malloc failed for out_buf"); - lv_barcode_clear(obj); - return LV_RESULT_INVALID; - } - - int32_t barcode_w = (int32_t) code128_encode_gs1(data, out_buf, len); - LV_LOG_INFO("barcode width = %" LV_PRId32, barcode_w); - - lv_barcode_t * barcode = (lv_barcode_t *)obj; - LV_ASSERT(barcode->scale > 0); - uint16_t scale = barcode->scale; - - int32_t buf_w; - int32_t buf_h; - - if(barcode->tiled) { - buf_w = (barcode->direction == LV_DIR_HOR) ? barcode_w * scale : 1; - buf_h = (barcode->direction == LV_DIR_VER) ? barcode_w * scale : 1; - } - else { - lv_obj_update_layout(obj); - buf_w = (barcode->direction == LV_DIR_HOR) ? barcode_w * scale : lv_obj_get_width(obj); - buf_h = (barcode->direction == LV_DIR_VER) ? barcode_w * scale : lv_obj_get_height(obj); - } - - if(!lv_barcode_change_buf_size(obj, buf_w, buf_h)) { - lv_barcode_clear(obj); - lv_free(out_buf); - return LV_RESULT_INVALID; - } - - /* Temporarily disable invalidation to improve the efficiency of lv_canvas_set_px */ - lv_display_enable_invalidation(lv_obj_get_display(obj), false); - - lv_draw_buf_t * draw_buf = lv_canvas_get_draw_buf(obj); - uint32_t stride = draw_buf->header.stride; - const lv_color_t color = lv_color_hex(1); - - /* Clear the canvas */ - lv_draw_buf_clear(draw_buf, NULL); - - /* Set the palette */ - lv_canvas_set_palette(obj, 0, lv_color_to_32(barcode->light_color, LV_OPA_COVER)); - lv_canvas_set_palette(obj, 1, lv_color_to_32(barcode->dark_color, LV_OPA_COVER)); - - for(int32_t x = 0; x < barcode_w; x++) { - /*skip empty data*/ - if(out_buf[x] == 0) { - continue; - } - - for(uint16_t i = 0; i < scale; i++) { - int32_t offset = x * scale + i; - if(barcode->direction == LV_DIR_HOR) { - lv_canvas_set_px(obj, offset, 0, color, LV_OPA_COVER); - } - else { /*LV_DIR_VER*/ - if(barcode->tiled) { - lv_canvas_set_px(obj, 0, offset, color, LV_OPA_COVER); - } - else { - uint8_t * dest = lv_draw_buf_goto_xy(draw_buf, 0, offset); - lv_memset(dest, 0xFF, stride); - } - } - } - } - - /* Copy pixels by row */ - if(!barcode->tiled && barcode->direction == LV_DIR_HOR && buf_h > 1) { - /* Skip the first row */ - int32_t h = buf_h - 1; - const uint8_t * src = lv_draw_buf_goto_xy(draw_buf, 0, 0); - uint8_t * dest = lv_draw_buf_goto_xy(draw_buf, 0, 1); - while(h--) { - lv_memcpy(dest, src, stride); - dest += stride; - } - } - - /* invalidate the canvas to refresh it */ - lv_display_enable_invalidation(lv_obj_get_display(obj), true); - lv_obj_invalidate(obj); - - lv_free(out_buf); - - return LV_RESULT_OK; -} - -lv_color_t lv_barcode_get_dark_color(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_barcode_t * barcode = (lv_barcode_t *)obj; - return barcode->dark_color; -} - -lv_color_t lv_barcode_get_light_color(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_barcode_t * barcode = (lv_barcode_t *)obj; - return barcode->light_color; -} - -uint16_t lv_barcode_get_scale(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_barcode_t * barcode = (lv_barcode_t *)obj; - return barcode->scale; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_barcode_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - - lv_barcode_t * barcode = (lv_barcode_t *)obj; - barcode->dark_color = lv_color_black(); - barcode->light_color = lv_color_white(); - barcode->scale = 1; - barcode->direction = LV_DIR_HOR; - lv_image_set_inner_align(obj, LV_IMAGE_ALIGN_DEFAULT); -} - -static void lv_barcode_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - - lv_draw_buf_t * draw_buf = lv_canvas_get_draw_buf(obj); - if(draw_buf == NULL) return; - lv_image_cache_drop(draw_buf); - - /*@fixme destroy buffer in cache free_cb.*/ - lv_draw_buf_destroy(draw_buf); -} - -static bool lv_barcode_change_buf_size(lv_obj_t * obj, int32_t w, int32_t h) -{ - LV_ASSERT_NULL(obj); - if(w <= 0 || h <= 0) { - LV_LOG_WARN("invalid size: %" LV_PRId32 " x %" LV_PRId32, w, h); - return false; - } - - lv_draw_buf_t * old_buf = lv_canvas_get_draw_buf(obj); - lv_draw_buf_t * new_buf = lv_draw_buf_create(w, h, LV_COLOR_FORMAT_I1, LV_STRIDE_AUTO); - if(new_buf == NULL) { - LV_LOG_ERROR("malloc failed for canvas buffer"); - return false; - } - - lv_canvas_set_draw_buf(obj, new_buf); - LV_LOG_INFO("set canvas buffer: %p, width = %" LV_PRId32, (void *)new_buf, w); - - if(old_buf != NULL) lv_draw_buf_destroy(old_buf); - return true; -} - -static void lv_barcode_clear(lv_obj_t * obj) -{ - lv_draw_buf_t * draw_buf = lv_canvas_get_draw_buf(obj); - if(!draw_buf) { - return; - } - - lv_draw_buf_clear(draw_buf, NULL); - lv_image_cache_drop(draw_buf); - lv_obj_invalidate(obj); -} - -#endif /*LV_USE_BARCODE*/ diff --git a/L3_Middlewares/LVGL/src/libs/barcode/lv_barcode.h b/L3_Middlewares/LVGL/src/libs/barcode/lv_barcode.h deleted file mode 100644 index c9c0ce6..0000000 --- a/L3_Middlewares/LVGL/src/libs/barcode/lv_barcode.h +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @file lv_barcode.h - * - */ - -#ifndef LV_BARCODE_H -#define LV_BARCODE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#include "../../misc/lv_types.h" -#include "../../misc/lv_color.h" -#include "../../widgets/canvas/lv_canvas.h" - -#if LV_USE_BARCODE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_barcode_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an empty barcode (an `lv_canvas`) object. - * @param parent point to an object where to create the barcode - * @return pointer to the created barcode object - */ -lv_obj_t * lv_barcode_create(lv_obj_t * parent); - -/** - * Set the dark color of a barcode object - * @param obj pointer to barcode object - * @param color dark color of the barcode - */ -void lv_barcode_set_dark_color(lv_obj_t * obj, lv_color_t color); - -/** - * Set the light color of a barcode object - * @param obj pointer to barcode object - * @param color light color of the barcode - */ -void lv_barcode_set_light_color(lv_obj_t * obj, lv_color_t color); - -/** - * Set the scale of a barcode object - * @param obj pointer to barcode object - * @param scale scale factor - */ -void lv_barcode_set_scale(lv_obj_t * obj, uint16_t scale); - -/** - * Set the direction of a barcode object - * @param obj pointer to barcode object - * @param direction draw direction (`LV_DIR_HOR` or `LB_DIR_VER`) - */ -void lv_barcode_set_direction(lv_obj_t * obj, lv_dir_t direction); - -/** - * Set the tiled mode of a barcode object - * @param obj pointer to barcode object - * @param tiled true: tiled mode, false: normal mode (default) - */ -void lv_barcode_set_tiled(lv_obj_t * obj, bool tiled); - -/** - * Set the data of a barcode object - * @param obj pointer to barcode object - * @param data data to display - * @return LV_RESULT_OK: if no error; LV_RESULT_INVALID: on error - */ -lv_result_t lv_barcode_update(lv_obj_t * obj, const char * data); - -/** - * Get the dark color of a barcode object - * @param obj pointer to barcode object - * @return dark color of the barcode - */ -lv_color_t lv_barcode_get_dark_color(lv_obj_t * obj); - -/** - * Get the light color of a barcode object - * @param obj pointer to barcode object - * @return light color of the barcode - */ -lv_color_t lv_barcode_get_light_color(lv_obj_t * obj); - -/** - * Get the scale of a barcode object - * @param obj pointer to barcode object - * @return scale factor - */ -uint16_t lv_barcode_get_scale(lv_obj_t * obj); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_BARCODE*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*LV_BARCODE_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/barcode/lv_barcode_private.h b/L3_Middlewares/LVGL/src/libs/barcode/lv_barcode_private.h deleted file mode 100644 index e6d1819..0000000 --- a/L3_Middlewares/LVGL/src/libs/barcode/lv_barcode_private.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file lv_barcode_private.h - * - */ - -#ifndef LV_BARCODE_PRIVATE_H -#define LV_BARCODE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../widgets/canvas/lv_canvas_private.h" -#include "lv_barcode.h" - -#if LV_USE_BARCODE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/*Data of barcode*/ -struct lv_barcode_t { - lv_canvas_t canvas; - lv_color_t dark_color; - lv_color_t light_color; - uint16_t scale; - lv_dir_t direction; - bool tiled; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_BARCODE */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_BARCODE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/bin_decoder/lv_bin_decoder.c b/L3_Middlewares/LVGL/src/libs/bin_decoder/lv_bin_decoder.c deleted file mode 100644 index 45edd65..0000000 --- a/L3_Middlewares/LVGL/src/libs/bin_decoder/lv_bin_decoder.c +++ /dev/null @@ -1,1157 +0,0 @@ -/** - * @file lv_image_decoder.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../draw/lv_image_decoder_private.h" -#include "lv_bin_decoder.h" -#include "../../draw/lv_draw_image.h" -#include "../../draw/lv_draw_buf.h" -#include "../../stdlib/lv_string.h" -#include "../../stdlib/lv_sprintf.h" -#include "../../libs/rle/lv_rle.h" -#include "../../core/lv_global.h" - -#if LV_USE_LZ4_EXTERNAL - #include -#endif - -#if LV_USE_LZ4_INTERNAL - #include "../../libs/lz4/lz4.h" -#endif - -/********************* - * DEFINES - *********************/ - -#define DECODER_NAME "BIN" - -#define image_cache_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->image_cache_draw_buf_handlers) - -/********************** - * TYPEDEFS - **********************/ - -/** - * Data format for compressed image data. - */ - -typedef struct lv_image_compressed_t { - uint32_t method: 4; /*Compression method, see `lv_image_compress_t`*/ - uint32_t reserved : 28; /*Reserved to be used later*/ - uint32_t compressed_size; /*Compressed data size in byte*/ - uint32_t decompressed_size; /*Decompressed data size in byte*/ - const uint8_t * data; /*Compressed data*/ -} lv_image_compressed_t; - -typedef struct { - lv_fs_file_t * f; - lv_color32_t * palette; - lv_opa_t * opa; - lv_image_compressed_t compressed; - lv_draw_buf_t * decoded; /*A draw buf to store decoded image*/ - lv_draw_buf_t * decompressed; /*Decompressed data could be used directly, thus must also be draw buf*/ - lv_draw_buf_t c_array; /*An C-array image that need to be converted to a draw buf*/ - lv_draw_buf_t * decoded_partial; /*A draw buf for decoded image via get_area_cb*/ -} decoder_data_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static decoder_data_t * get_decoder_data(lv_image_decoder_dsc_t * dsc); -static void free_decoder_data(lv_image_decoder_dsc_t * dsc); -static lv_result_t decode_indexed(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -static lv_result_t load_indexed(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -#if LV_BIN_DECODER_RAM_LOAD - static lv_result_t decode_rgb(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -#endif -static lv_result_t decode_alpha_only(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -static lv_result_t decode_indexed_line(lv_color_format_t color_format, const lv_color32_t * palette, int32_t x, - int32_t w_px, const uint8_t * in, lv_color32_t * out); -static lv_result_t decode_compressed(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); - -static lv_fs_res_t fs_read_file_at(lv_fs_file_t * f, uint32_t pos, void * buff, uint32_t btr, uint32_t * br); - -static lv_result_t decompress_image(lv_image_decoder_dsc_t * dsc, const lv_image_compressed_t * compressed); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Initialize the lvgl binary image decoder module - */ -void lv_bin_decoder_init(void) -{ - lv_image_decoder_t * decoder; - - decoder = lv_image_decoder_create(); - LV_ASSERT_MALLOC(decoder); - if(decoder == NULL) { - LV_LOG_WARN("Out of memory"); - return; - } - - lv_image_decoder_set_info_cb(decoder, lv_bin_decoder_info); - lv_image_decoder_set_open_cb(decoder, lv_bin_decoder_open); - lv_image_decoder_set_get_area_cb(decoder, lv_bin_decoder_get_area); - lv_image_decoder_set_close_cb(decoder, lv_bin_decoder_close); - - decoder->name = DECODER_NAME; -} - -lv_result_t lv_bin_decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header) -{ - LV_UNUSED(decoder); /*Unused*/ - - const void * src = dsc->src; - lv_image_src_t src_type = dsc->src_type; - - if(src_type == LV_IMAGE_SRC_VARIABLE) { - lv_image_dsc_t * image = (lv_image_dsc_t *)src; - lv_memcpy(header, &image->header, sizeof(lv_image_header_t)); - } - else if(src_type == LV_IMAGE_SRC_FILE) { - /*Support only "*.bin" files*/ - if(lv_strcmp(lv_fs_get_ext(src), "bin")) return LV_RESULT_INVALID; - - lv_fs_res_t res; - uint32_t rn; - res = lv_fs_read(&dsc->file, header, sizeof(lv_image_header_t), &rn); - - if(res != LV_FS_RES_OK || rn != sizeof(lv_image_header_t)) { - LV_LOG_WARN("Read file header failed: %d", res); - return LV_RESULT_INVALID; - } - - /** - * @todo - * This is a temp backward compatibility solution after adding - * magic in image header. - */ - if(header->magic != LV_IMAGE_HEADER_MAGIC) { - LV_LOG_WARN("Legacy bin image detected: %s", (char *)src); - header->cf = header->magic; - header->magic = LV_IMAGE_HEADER_MAGIC; - } - - /*File is always read to buf, thus data can be modified.*/ - header->flags |= LV_IMAGE_FLAGS_MODIFIABLE; - } - else if(src_type == LV_IMAGE_SRC_SYMBOL) { - /*The size depend on the font but it is unknown here. It should be handled outside of the - *function*/ - header->w = 1; - header->h = 1; - /*Symbols always have transparent parts. Important because of cover check in the draw - *function. The actual value doesn't matter because lv_draw_label will draw it*/ - header->cf = LV_COLOR_FORMAT_A8; - } - else { - LV_LOG_WARN("Image get info found unknown src type"); - return LV_RESULT_INVALID; - } - - /*For backward compatibility, all images are not premultiplied for now.*/ - if(header->magic != LV_IMAGE_HEADER_MAGIC) { - header->flags &= ~LV_IMAGE_FLAGS_PREMULTIPLIED; - } - - return LV_RESULT_OK; -} - -/** - * Decode an image from a binary file - * @param decoder pointer to the decoder - * @param dsc pointer to the decoder descriptor - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't open the image - */ -lv_result_t lv_bin_decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); - - lv_result_t res = LV_RESULT_INVALID; - lv_fs_res_t fs_res = LV_FS_RES_UNKNOWN; - bool use_directly = false; /*If the image is already decoded and can be used directly*/ - - /*Open the file if it's a file*/ - if(dsc->src_type == LV_IMAGE_SRC_FILE) { - /*Support only "*.bin" files*/ - if(lv_strcmp(lv_fs_get_ext(dsc->src), "bin")) return LV_RESULT_INVALID; - - /*If the file was open successfully save the file descriptor*/ - decoder_data_t * decoder_data = get_decoder_data(dsc); - if(decoder_data == NULL) { - return LV_RESULT_INVALID; - } - - dsc->user_data = decoder_data; - lv_fs_file_t * f = lv_malloc(sizeof(*f)); - if(f == NULL) { - free_decoder_data(dsc); - return LV_RESULT_INVALID; - } - - fs_res = lv_fs_open(f, dsc->src, LV_FS_MODE_RD); - if(fs_res != LV_FS_RES_OK) { - LV_LOG_WARN("Open file failed: %d", fs_res); - lv_free(f); - free_decoder_data(dsc); - return LV_RESULT_INVALID; - } - - decoder_data->f = f; /*Now free_decoder_data will take care of the file*/ - - lv_color_format_t cf = dsc->header.cf; - - if(dsc->header.flags & LV_IMAGE_FLAGS_COMPRESSED) { - res = decode_compressed(decoder, dsc); - } - else if(LV_COLOR_FORMAT_IS_INDEXED(cf)) { - if(dsc->args.use_indexed) { - /*Palette for indexed image and whole image of A8 image are always loaded to RAM for simplicity*/ - res = load_indexed(decoder, dsc); - } - else { - res = decode_indexed(decoder, dsc); - } - } - else if(LV_COLOR_FORMAT_IS_ALPHA_ONLY(cf)) { - res = decode_alpha_only(decoder, dsc); - } -#if LV_BIN_DECODER_RAM_LOAD - else if(cf == LV_COLOR_FORMAT_ARGB8888 \ - || cf == LV_COLOR_FORMAT_XRGB8888 \ - || cf == LV_COLOR_FORMAT_RGB888 \ - || cf == LV_COLOR_FORMAT_RGB565 \ - || cf == LV_COLOR_FORMAT_RGB565A8 \ - || cf == LV_COLOR_FORMAT_ARGB8565) { - res = decode_rgb(decoder, dsc); - } -#else - else { - /* decode them in get_area_cb */ - res = LV_RESULT_OK; - } -#endif - } - - else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { - /*The variables should have valid data*/ - lv_image_dsc_t * image = (lv_image_dsc_t *)dsc->src; - if(image->data == NULL) { - return LV_RESULT_INVALID; - } - - lv_color_format_t cf = image->header.cf; - if(dsc->header.flags & LV_IMAGE_FLAGS_COMPRESSED) { - res = decode_compressed(decoder, dsc); - } - else if(LV_COLOR_FORMAT_IS_INDEXED(cf)) { - /*Need decoder data to store converted image*/ - decoder_data_t * decoder_data = get_decoder_data(dsc); - if(decoder_data == NULL) { - return LV_RESULT_INVALID; - } - - if(dsc->args.use_indexed) { - /*Palette for indexed image and whole image of A8 image are always loaded to RAM for simplicity*/ - res = load_indexed(decoder, dsc); - use_directly = true; /*If draw unit supports indexed image, it can be used directly.*/ - } - else { - res = decode_indexed(decoder, dsc); - } - } - else if(LV_COLOR_FORMAT_IS_ALPHA_ONLY(cf)) { - /*Alpha only image will need decoder data to store pointer to decoded image, to free it when decoder closes*/ - decoder_data_t * decoder_data = get_decoder_data(dsc); - if(decoder_data == NULL) { - return LV_RESULT_INVALID; - } - - res = decode_alpha_only(decoder, dsc); - } - else { - /*In case of uncompressed formats the image stored in the ROM/RAM. - *So simply give its pointer*/ - - decoder_data_t * decoder_data = get_decoder_data(dsc); - lv_draw_buf_t * decoded; - if(image->header.flags & LV_IMAGE_FLAGS_ALLOCATED) { - decoded = (lv_draw_buf_t *)image; - } - else { - decoded = &decoder_data->c_array; - if(image->header.stride == 0) { - /*If image doesn't have stride, treat it as lvgl v8 legacy image format*/ - lv_image_dsc_t tmp = *image; - tmp.header.stride = (tmp.header.w * lv_color_format_get_bpp(cf) + 7) >> 3; - lv_draw_buf_from_image(decoded, &tmp); - } - else - lv_draw_buf_from_image(decoded, image); - } - - dsc->decoded = decoded; - - if(decoded->header.stride == 0) { - /*Use the auto calculated value from decoder_info callback*/ - decoded->header.stride = dsc->header.stride; - } - - res = LV_RESULT_OK; - use_directly = true; /*A variable image that can be used directly.*/ - } - } - - if(res != LV_RESULT_OK) { - free_decoder_data(dsc); - return res; - } - - if(dsc->decoded == NULL) return LV_RESULT_OK; /*Need to read via get_area_cb*/ - - lv_draw_buf_t * decoded = (lv_draw_buf_t *)dsc->decoded; - lv_draw_buf_t * adjusted = lv_image_decoder_post_process(dsc, decoded); - if(adjusted == NULL) { - free_decoder_data(dsc); - return LV_RESULT_INVALID; - } - - /*The adjusted draw buffer is newly allocated.*/ - if(adjusted != decoded) { - use_directly = false; /*Cannot use original image directly*/ - free_decoder_data(dsc); - decoder_data_t * decoder_data = get_decoder_data(dsc); - decoder_data->decoded = adjusted; /*Now this new buffer need to be free'd on decoder close*/ - } - dsc->decoded = adjusted; - - if(use_directly || dsc->args.no_cache) return LV_RESULT_OK; /*Do not put image to cache if it can be used directly.*/ - - /*If the image cache is disabled, just return the decoded image*/ - if(!lv_image_cache_is_enabled()) return LV_RESULT_OK; - - /*Add it to cache*/ - lv_image_cache_data_t search_key; - search_key.src_type = dsc->src_type; - search_key.src = dsc->src; - search_key.slot.size = dsc->decoded->data_size; - - lv_cache_entry_t * cache_entry = lv_image_decoder_add_to_cache(decoder, &search_key, dsc->decoded, dsc->user_data); - if(cache_entry == NULL) { - free_decoder_data(dsc); - return LV_RESULT_INVALID; - } - dsc->cache_entry = cache_entry; - decoder_data_t * decoder_data = get_decoder_data(dsc); - decoder_data->decoded = NULL; /*Cache will take care of it*/ - - return LV_RESULT_OK; -} - -void lv_bin_decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); /*Unused*/ - - decoder_data_t * decoder_data = dsc->user_data; - if(decoder_data && decoder_data->decoded_partial) { - lv_draw_buf_destroy(decoder_data->decoded_partial); - decoder_data->decoded_partial = NULL; - } - - free_decoder_data(dsc); -} - -lv_result_t lv_bin_decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, - const lv_area_t * full_area, lv_area_t * decoded_area) -{ - LV_UNUSED(decoder); /*Unused*/ - - lv_color_format_t cf = dsc->header.cf; - /*Check if cf is supported*/ - - bool supported = LV_COLOR_FORMAT_IS_INDEXED(cf) - || cf == LV_COLOR_FORMAT_ARGB8888 \ - || cf == LV_COLOR_FORMAT_XRGB8888 \ - || cf == LV_COLOR_FORMAT_RGB888 \ - || cf == LV_COLOR_FORMAT_RGB565 \ - || cf == LV_COLOR_FORMAT_ARGB8565 \ - || cf == LV_COLOR_FORMAT_RGB565A8; - if(!supported) { - LV_LOG_WARN("CF: %d is not supported", cf); - return LV_RESULT_INVALID; - } - - lv_fs_res_t res = LV_FS_RES_UNKNOWN; - decoder_data_t * decoder_data = dsc->user_data; - if(decoder_data == NULL) { - LV_LOG_ERROR("Unexpected null decoder data"); - return LV_RESULT_INVALID; - } - - lv_fs_file_t * f = decoder_data->f; - uint32_t bpp = lv_color_format_get_bpp(cf); - int32_t w_px = lv_area_get_width(full_area); - uint8_t * img_data = NULL; - lv_draw_buf_t * decoded = NULL; - uint32_t offset = dsc->src_type == LV_IMAGE_SRC_FILE ? sizeof(lv_image_header_t) : 0; /*Skip the image header*/ - - /*We only support read line by line for now*/ - if(decoded_area->y1 == LV_COORD_MIN) { - /*Indexed image is converted to ARGB888*/ - lv_color_format_t cf_decoded = LV_COLOR_FORMAT_IS_INDEXED(cf) ? LV_COLOR_FORMAT_ARGB8888 : cf; - - decoded = lv_draw_buf_reshape(decoder_data->decoded_partial, cf_decoded, w_px, 1, LV_STRIDE_AUTO); - if(decoded == NULL) { - if(decoder_data->decoded_partial != NULL) { - lv_draw_buf_destroy(decoder_data->decoded_partial); - decoder_data->decoded_partial = NULL; - } - decoded = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, w_px, 1, cf_decoded, LV_STRIDE_AUTO); - if(decoded == NULL) return LV_RESULT_INVALID; - decoder_data->decoded_partial = decoded; /*Free on decoder close*/ - } - *decoded_area = *full_area; - decoded_area->y2 = decoded_area->y1; - } - else { - decoded_area->y1++; - decoded_area->y2++; - decoded = decoder_data->decoded_partial; /*Already allocated*/ - } - - img_data = decoded->data; /*Get the buffer to operate on*/ - - if(decoded_area->y1 > full_area->y2) { - return LV_RESULT_INVALID; - } - - if(LV_COLOR_FORMAT_IS_INDEXED(cf)) { - int32_t x_fraction = decoded_area->x1 % (8 / bpp); - uint32_t len = (w_px * bpp + 7) / 8 + 1; /*10px for 1bpp may across 3bytes*/ - uint8_t * buf = NULL; - - offset += dsc->palette_size * 4; /*Skip palette*/ - offset += decoded_area->y1 * dsc->header.stride; - offset += decoded_area->x1 * bpp / 8; /*Move to x1*/ - if(dsc->src_type == LV_IMAGE_SRC_FILE) { - buf = lv_malloc(len); - LV_ASSERT_NULL(buf); - if(buf == NULL) - return LV_RESULT_INVALID; - - res = fs_read_file_at(f, offset, buf, len, NULL); - if(res != LV_FS_RES_OK) { - lv_free(buf); - return LV_RESULT_INVALID; - } - } - else { - const lv_image_dsc_t * image = dsc->src; - buf = (void *)(image->data + offset); - } - - decode_indexed_line(cf, dsc->palette, x_fraction, w_px, buf, (lv_color32_t *)img_data); - - if(dsc->src_type == LV_IMAGE_SRC_FILE) lv_free((void *)buf); - - dsc->decoded = decoded; /*Return decoded image*/ - return LV_RESULT_OK; - } - - if(cf == LV_COLOR_FORMAT_ARGB8888 || cf == LV_COLOR_FORMAT_XRGB8888 || cf == LV_COLOR_FORMAT_RGB888 - || cf == LV_COLOR_FORMAT_RGB565 || cf == LV_COLOR_FORMAT_ARGB8565) { - uint32_t len = (w_px * bpp) / 8; - offset += decoded_area->y1 * dsc->header.stride; - offset += decoded_area->x1 * bpp / 8; /*Move to x1*/ - res = fs_read_file_at(f, offset, img_data, len, NULL); - if(res != LV_FS_RES_OK) { - return LV_RESULT_INVALID; - } - - dsc->decoded = decoded; /*Return decoded image*/ - return LV_RESULT_OK; - } - - if(cf == LV_COLOR_FORMAT_RGB565A8) { - bpp = 16; /* RGB565 + A8 mask*/ - uint32_t len = decoded->header.stride; - offset += decoded_area->y1 * dsc->header.stride; /*Move to y1*/ - offset += decoded_area->x1 * bpp / 8; /*Move to x1*/ - res = fs_read_file_at(f, offset, img_data, len, NULL); - if(res != LV_FS_RES_OK) { - return LV_RESULT_INVALID; - } - - /*Now the A8 mask*/ - offset = sizeof(lv_image_header_t); - offset += dsc->header.h * dsc->header.stride; /*Move to A8 map*/ - offset += decoded_area->y1 * (dsc->header.stride / 2); /*Move to y1*/ - offset += decoded_area->x1 * 1; /*Move to x1*/ - res = fs_read_file_at(f, offset, img_data + len, w_px * 1, NULL); - if(res != LV_FS_RES_OK) { - return LV_RESULT_INVALID; - } - - dsc->decoded = decoded; /*Return decoded image*/ - return LV_RESULT_OK; - } - - return LV_RESULT_INVALID; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static decoder_data_t * get_decoder_data(lv_image_decoder_dsc_t * dsc) -{ - decoder_data_t * data = dsc->user_data; - if(data == NULL) { - data = lv_malloc_zeroed(sizeof(decoder_data_t)); - LV_ASSERT_MALLOC(data); - if(data == NULL) { - LV_LOG_ERROR("Out of memory"); - return NULL; - } - - dsc->user_data = data; - } - - return data; -} - -static void free_decoder_data(lv_image_decoder_dsc_t * dsc) -{ - decoder_data_t * decoder_data = dsc->user_data; - if(decoder_data == NULL) return; - - if(decoder_data->f) { - lv_fs_close(decoder_data->f); - lv_free(decoder_data->f); - } - - if(decoder_data->decoded) lv_draw_buf_destroy(decoder_data->decoded); - if(decoder_data->decompressed) lv_draw_buf_destroy(decoder_data->decompressed); - lv_free(decoder_data->palette); - lv_free(decoder_data); - dsc->user_data = NULL; -} - -static lv_result_t decode_indexed(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); /*Unused*/ - lv_fs_res_t res; - uint32_t rn; - decoder_data_t * decoder_data = dsc->user_data; - lv_fs_file_t * f = decoder_data->f; - lv_color_format_t cf = dsc->header.cf; - uint32_t palette_len = sizeof(lv_color32_t) * LV_COLOR_INDEXED_PALETTE_SIZE(cf); - const lv_color32_t * palette; - const uint8_t * indexed_data = NULL; - lv_draw_buf_t * draw_buf_indexed = NULL; - uint32_t stride = dsc->header.stride; - - bool is_compressed = dsc->header.flags & LV_IMAGE_FLAGS_COMPRESSED; - if(is_compressed) { - uint8_t * data = decoder_data->decompressed->data; - palette = (lv_color32_t *)data; - indexed_data = data + palette_len; - } - else if(dsc->src_type == LV_IMAGE_SRC_FILE) { - /*read palette for indexed image*/ - palette = lv_malloc(palette_len); - LV_ASSERT_MALLOC(palette); - if(palette == NULL) { - LV_LOG_ERROR("Out of memory"); - return LV_RESULT_INVALID; - } - - res = fs_read_file_at(f, sizeof(lv_image_header_t), (uint8_t *)palette, palette_len, &rn); - if(res != LV_FS_RES_OK || rn != palette_len) { - LV_LOG_WARN("Read palette failed: %d", res); - lv_free((void *)palette); - return LV_RESULT_INVALID; - } - - decoder_data->palette = (void *)palette; /*Need to free when decoder closes*/ - -#if LV_BIN_DECODER_RAM_LOAD - draw_buf_indexed = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, dsc->header.w, dsc->header.h, cf, - dsc->header.stride); - if(draw_buf_indexed == NULL) { - LV_LOG_ERROR("Draw buffer alloc failed"); - goto exit_with_buf; - } - - indexed_data = draw_buf_indexed->data; - - uint32_t data_len = 0; - if(lv_fs_seek(f, 0, LV_FS_SEEK_END) != LV_FS_RES_OK || - lv_fs_tell(f, &data_len) != LV_FS_RES_OK) { - LV_LOG_WARN("Failed to get file to size"); - goto exit_with_buf; - } - - uint32_t data_offset = sizeof(lv_image_header_t) + palette_len; - data_len -= data_offset; - res = fs_read_file_at(f, data_offset, (uint8_t *)indexed_data, data_len, &rn); - if(res != LV_FS_RES_OK || rn != data_len) { - LV_LOG_WARN("Read indexed image failed: %d", res); - goto exit_with_buf; - } -#endif - } - else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { - lv_image_dsc_t * image = (lv_image_dsc_t *)dsc->src; - palette = (lv_color32_t *)image->data; - indexed_data = image->data + palette_len; - } - else { - return LV_RESULT_INVALID; - } - - dsc->palette = palette; - dsc->palette_size = LV_COLOR_INDEXED_PALETTE_SIZE(cf); - -#if LV_BIN_DECODER_RAM_LOAD - /*Convert to ARGB8888, since sw renderer cannot render it directly even it's in RAM*/ - lv_draw_buf_t * decoded = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, dsc->header.w, dsc->header.h, - LV_COLOR_FORMAT_ARGB8888, - 0); - if(decoded == NULL) { - LV_LOG_ERROR("No memory for indexed image"); - goto exit_with_buf; - } - - stride = decoded->header.stride; - uint8_t * img_data = decoded->data; - - const uint8_t * in = indexed_data; - uint8_t * out = img_data; - for(uint32_t y = 0; y < dsc->header.h; y++) { - decode_indexed_line(cf, dsc->palette, 0, dsc->header.w, in, (lv_color32_t *)out); - in += dsc->header.stride; - out += stride; - } - - dsc->decoded = decoded; - decoder_data->decoded = decoded; /*Free when decoder closes*/ - if(dsc->src_type == LV_IMAGE_SRC_FILE && !is_compressed) { - decoder_data->palette = (void *)palette; /*Free decoder data on close*/ - lv_draw_buf_destroy(draw_buf_indexed); - } - - return LV_RESULT_OK; -exit_with_buf: - if(dsc->src_type == LV_IMAGE_SRC_FILE && !is_compressed) { - lv_free((void *)palette); - decoder_data->palette = NULL; - } - - if(draw_buf_indexed) lv_draw_buf_destroy(draw_buf_indexed); - return LV_RESULT_INVALID; -#else - LV_UNUSED(stride); - LV_UNUSED(indexed_data); - LV_UNUSED(draw_buf_indexed); - /*It needs to be read by get_area_cb later*/ - return LV_RESULT_OK; -#endif -} - -static lv_result_t load_indexed(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ -#if LV_BIN_DECODER_RAM_LOAD == 0 - LV_UNUSED(decoder); /*Unused*/ - LV_UNUSED(dsc); /*Unused*/ - LV_LOG_ERROR("LV_BIN_DECODER_RAM_LOAD is disabled"); - return LV_RESULT_INVALID; -#else - - LV_UNUSED(decoder); /*Unused*/ - - lv_fs_res_t res; - uint32_t rn; - decoder_data_t * decoder_data = dsc->user_data; - - if(dsc->header.flags & LV_IMAGE_FLAGS_COMPRESSED) { - /*The decompressed image is already loaded to RAM*/ - dsc->decoded = decoder_data->decompressed; - - /*Transfer ownership to decoded pointer because it's the final data we use.*/ - decoder_data->decoded = decoder_data->decompressed; - decoder_data->decompressed = NULL; - return LV_RESULT_OK; - } - - if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { - lv_image_dsc_t * image = (lv_image_dsc_t *)dsc->src; - lv_draw_buf_t * decoded; - if(image->header.flags & LV_IMAGE_FLAGS_ALLOCATED) { - decoded = (lv_draw_buf_t *)image; - } - else { - decoded = &decoder_data->c_array; - lv_draw_buf_from_image(decoded, image); - } - - dsc->decoded = decoded; - - if(decoded->header.stride == 0) { - /*Use the auto calculated value from decoder_info callback*/ - decoded->header.stride = dsc->header.stride; - } - - return LV_RESULT_OK; - } - - if(dsc->src_type == LV_IMAGE_SRC_FILE) { - lv_color_format_t cf = dsc->header.cf; - lv_fs_file_t * f = decoder_data->f; - lv_draw_buf_t * decoded = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, dsc->header.w, dsc->header.h, cf, - dsc->header.stride); - if(decoded == NULL) { - LV_LOG_ERROR("Draw buffer alloc failed"); - return LV_RESULT_INVALID; - } - - uint8_t * data = decoded->data; - uint32_t palette_len = sizeof(lv_color32_t) * LV_COLOR_INDEXED_PALETTE_SIZE(cf); - res = fs_read_file_at(f, sizeof(lv_image_header_t), data, palette_len, &rn); - if(res != LV_FS_RES_OK || rn != palette_len) { - LV_LOG_WARN("Read palette failed: %d", res); - lv_draw_buf_destroy(decoded); - return LV_RESULT_INVALID; - } - - uint32_t data_len = 0; - if(lv_fs_seek(f, 0, LV_FS_SEEK_END) != LV_FS_RES_OK || - lv_fs_tell(f, &data_len) != LV_FS_RES_OK) { - LV_LOG_WARN("Failed to get file to size"); - lv_draw_buf_destroy(decoded); - return LV_RESULT_INVALID; - } - - uint32_t data_offset = sizeof(lv_image_header_t) + palette_len; - data_len -= data_offset; - data += palette_len; - res = fs_read_file_at(f, data_offset, data, data_len, &rn); - if(res != LV_FS_RES_OK || rn != data_len) { - LV_LOG_WARN("Read indexed image failed: %d", res); - lv_draw_buf_destroy(decoded); - return LV_RESULT_INVALID; - } - - decoder_data->decoded = decoded; - dsc->decoded = decoded; - return LV_RESULT_OK; - } - - LV_LOG_ERROR("Unknown src type: %d", dsc->src_type); - return LV_RESULT_INVALID; -#endif -} - -#if LV_BIN_DECODER_RAM_LOAD -static lv_result_t decode_rgb(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); - lv_fs_res_t res; - decoder_data_t * decoder_data = dsc->user_data; - lv_fs_file_t * f = decoder_data->f; - lv_color_format_t cf = dsc->header.cf; - - uint32_t len = dsc->header.stride * dsc->header.h; - if(cf == LV_COLOR_FORMAT_RGB565A8) { - len += (dsc->header.stride / 2) * dsc->header.h; /*A8 mask*/ - } - - lv_draw_buf_t * decoded = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, dsc->header.w, dsc->header.h, cf, - dsc->header.stride); - if(decoded == NULL) { - LV_LOG_ERROR("No memory for rgb file read"); - return LV_RESULT_INVALID; - } - - uint8_t * img_data = decoded->data; - - uint32_t rn; - res = fs_read_file_at(f, sizeof(lv_image_header_t), img_data, len, &rn); - if(res != LV_FS_RES_OK || rn != len) { - LV_LOG_WARN("Read rgb file failed: %d", res); - lv_draw_buf_destroy(decoded); - return LV_RESULT_INVALID; - } - - dsc->decoded = decoded; - decoder_data->decoded = decoded; /*Free when decoder closes*/ - return LV_RESULT_OK; -} -#endif - -/** - * Extend A1/2/4 to A8 with interpolation to reduce rounding error. - */ -static inline uint8_t bit_extend(uint8_t value, uint8_t bpp) -{ - if(value == 0) return 0; - - uint8_t res = value; - uint8_t bpp_now = bpp; - while(bpp_now < 8) { - res |= value << (8 - bpp_now); - bpp_now += bpp; - }; - - return res; -} - -static lv_result_t decode_alpha_only(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); - lv_fs_res_t res; - uint32_t rn; - decoder_data_t * decoder_data = dsc->user_data; - uint8_t bpp = lv_color_format_get_bpp(dsc->header.cf); - uint32_t w = (dsc->header.stride * 8) / bpp; - uint32_t buf_stride = (w * 8 + 7) >> 3; /*stride for img_data*/ - uint32_t buf_len = w * dsc->header.h; /*always decode to A8 format*/ - lv_draw_buf_t * decoded; - uint32_t file_len = (uint32_t)dsc->header.stride * dsc->header.h; - - decoded = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, dsc->header.w, dsc->header.h, LV_COLOR_FORMAT_A8, - buf_stride); - if(decoded == NULL) { - LV_LOG_ERROR("Out of memory"); - return LV_RESULT_INVALID; - } - - uint8_t * img_data = decoded->data; - - if(dsc->header.flags & LV_IMAGE_FLAGS_COMPRESSED) { - /*Copy from image data*/ - lv_memcpy(img_data, decoder_data->decompressed->data, file_len); - } - else if(dsc->src_type == LV_IMAGE_SRC_FILE) { - res = fs_read_file_at(decoder_data->f, sizeof(lv_image_header_t), img_data, file_len, &rn); - if(res != LV_FS_RES_OK || rn != file_len) { - LV_LOG_WARN("Read header failed: %d", res); - lv_draw_buf_destroy(decoded); - return LV_RESULT_INVALID; - } - } - else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { - /*Copy from image data*/ - lv_memcpy(img_data, ((lv_image_dsc_t *)dsc->src)->data, file_len); - } - - if(dsc->header.cf != LV_COLOR_FORMAT_A8) { - /*Convert A1/2/4 to A8 from last pixel to first pixel*/ - uint8_t * in = img_data + file_len - 1; - uint8_t * out = img_data + buf_len - 1; - uint8_t mask = (1 << bpp) - 1; - uint8_t shift = 0; - for(uint32_t i = 0; i < buf_len; i++) { - /** - * Rounding error: - * Take bpp = 4 as example, alpha value of 0x0 to 0x0F should be - * mapped to 0x00 to 0xFF. Using below equation will give us 0x00 to 0xF0 - * thus causes error. We can simply interpolate the value to fix it. - * - * Equation: *out = ((*in >> shift) & mask) << (8 - bpp); - * Ideal: *out = ((*in >> shift) & mask) * 255 / ((1L << bpp) - 1) - */ - uint8_t value = ((*in >> shift) & mask); - *out = bit_extend(value, bpp); - shift += bpp; - if(shift >= 8) { - shift = 0; - in--; - } - out--; - } - } - - decoder_data->decoded = decoded; - dsc->decoded = decoded; - return LV_RESULT_OK; -} - -static lv_result_t decode_compressed(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ -#if LV_BIN_DECODER_RAM_LOAD - uint32_t rn; - uint32_t len; - uint32_t compressed_len; - decoder_data_t * decoder_data = get_decoder_data(dsc); - lv_result_t res; - lv_fs_res_t fs_res; - uint8_t * file_buf = NULL; - lv_image_compressed_t * compressed = &decoder_data->compressed; - - lv_memzero(compressed, sizeof(lv_image_compressed_t)); - - if(dsc->src_type == LV_IMAGE_SRC_FILE) { - lv_fs_file_t * f = decoder_data->f; - - if(lv_fs_seek(f, 0, LV_FS_SEEK_END) != LV_FS_RES_OK || - lv_fs_tell(f, &compressed_len) != LV_FS_RES_OK) { - LV_LOG_WARN("Failed to get compressed file len"); - return LV_RESULT_INVALID; - } - - compressed_len -= sizeof(lv_image_header_t); - compressed_len -= 12; - - /*Read compress header*/ - len = 12; - fs_res = fs_read_file_at(f, sizeof(lv_image_header_t), compressed, len, &rn); - if(fs_res != LV_FS_RES_OK || rn != len) { - LV_LOG_WARN("Read compressed header failed: %d", fs_res); - return LV_RESULT_INVALID; - } - - if(compressed->compressed_size != compressed_len) { - LV_LOG_WARN("Compressed size mismatch: %" LV_PRIu32" != %" LV_PRIu32, compressed->compressed_size, compressed_len); - return LV_RESULT_INVALID; - } - - file_buf = lv_malloc(compressed_len); - if(file_buf == NULL) { - LV_LOG_WARN("No memory for compressed file"); - return LV_RESULT_INVALID; - - } - - /*Continue to read the compressed data following compression header*/ - fs_res = lv_fs_read(f, file_buf, compressed_len, &rn); - if(fs_res != LV_FS_RES_OK || rn != compressed_len) { - LV_LOG_WARN("Read compressed file failed: %d", fs_res); - lv_free(file_buf); - return LV_RESULT_INVALID; - } - - /*Decompress the image*/ - compressed->data = file_buf; - } - else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { - lv_image_dsc_t * image = (lv_image_dsc_t *)dsc->src; - compressed_len = image->data_size; - - /*Read compress header*/ - len = 12; - compressed_len -= len; - lv_memcpy(compressed, image->data, len); - compressed->data = image->data + len; - if(compressed->compressed_size != compressed_len) { - LV_LOG_WARN("Compressed size mismatch: %" LV_PRIu32" != %" LV_PRIu32, compressed->compressed_size, compressed_len); - return LV_RESULT_INVALID; - } - } - else { - LV_LOG_WARN("Compressed image only support file or variable"); - return LV_RESULT_INVALID; - } - - res = decompress_image(dsc, compressed); - compressed->data = NULL; /*No need to store the data any more*/ - lv_free(file_buf); - if(res != LV_RESULT_OK) { - LV_LOG_WARN("Decompress failed"); - return LV_RESULT_INVALID; - } - - /*Depends on the cf, need to further decode image like an C-array image*/ - lv_image_dsc_t * image = (lv_image_dsc_t *)dsc->src; - if(image->data == NULL) { - return LV_RESULT_INVALID; - } - - lv_color_format_t cf = dsc->header.cf; - if(LV_COLOR_FORMAT_IS_INDEXED(cf)) { - if(dsc->args.use_indexed) res = load_indexed(decoder, dsc); - else res = decode_indexed(decoder, dsc); - } - else if(LV_COLOR_FORMAT_IS_ALPHA_ONLY(cf)) { - res = decode_alpha_only(decoder, dsc); - } - else { - /*The decompressed data is the original image data.*/ - dsc->decoded = decoder_data->decompressed; - - /*Transfer ownership of decompressed to `decoded` since it can be used directly*/ - decoder_data->decoded = decoder_data->decompressed; - decoder_data->decompressed = NULL; - res = LV_RESULT_OK; - } - - return res; -#else - LV_UNUSED(decompress_image); - LV_UNUSED(decoder); - LV_UNUSED(dsc); - LV_LOG_ERROR("Need LV_BIN_DECODER_RAM_LOAD to be enabled"); - return LV_RESULT_INVALID; -#endif -} - -static lv_result_t decode_indexed_line(lv_color_format_t color_format, const lv_color32_t * palette, int32_t x, - int32_t w_px, const uint8_t * in, lv_color32_t * out) -{ - uint8_t px_size; - uint16_t mask; - - int8_t shift = 0; - switch(color_format) { - case LV_COLOR_FORMAT_I1: - px_size = 1; - in += x / 8; /*8pixel per byte*/ - shift = 7 - (x & 0x7); - break; - case LV_COLOR_FORMAT_I2: - px_size = 2; - in += x / 4; /*4pixel per byte*/ - shift = 6 - 2 * (x & 0x3); - break; - case LV_COLOR_FORMAT_I4: - px_size = 4; - in += x / 2; /*2pixel per byte*/ - shift = 4 - 4 * (x & 0x1); - break; - case LV_COLOR_FORMAT_I8: - px_size = 8; - in += x; - shift = 0; - break; - default: - return LV_RESULT_INVALID; - } - - mask = (1 << px_size) - 1; /*E.g. px_size = 2; mask = 0x03*/ - - int32_t i; - for(i = 0; i < w_px; i++) { - uint8_t val_act = (*in >> shift) & mask; - out[i] = palette[val_act]; - - shift -= px_size; - if(shift < 0) { - shift = 8 - px_size; - in++; - } - } - return LV_RESULT_OK; -} - -static lv_fs_res_t fs_read_file_at(lv_fs_file_t * f, uint32_t pos, void * buff, uint32_t btr, uint32_t * br) -{ - lv_fs_res_t res; - if(br) *br = 0; - - res = lv_fs_seek(f, pos, LV_FS_SEEK_SET); - if(res != LV_FS_RES_OK) { - return res; - } - - res |= lv_fs_read(f, buff, btr, br); - if(res != LV_FS_RES_OK) { - return res; - } - - return LV_FS_RES_OK; -} - -static lv_result_t decompress_image(lv_image_decoder_dsc_t * dsc, const lv_image_compressed_t * compressed) -{ - /*Need to store decompressed data to decoder to free on close*/ - decoder_data_t * decoder_data = get_decoder_data(dsc); - if(decoder_data == NULL) { - return LV_RESULT_INVALID; - } - - uint8_t * img_data; - uint32_t out_len = compressed->decompressed_size; - uint32_t input_len = compressed->compressed_size; - LV_UNUSED(input_len); - LV_UNUSED(out_len); - - lv_draw_buf_t * decompressed = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, dsc->header.w, dsc->header.h, - dsc->header.cf, - dsc->header.stride); - if(decompressed == NULL) { - LV_LOG_WARN("No memory for decompressed image, input: %" LV_PRIu32 ", output: %" LV_PRIu32, input_len, out_len); - return LV_RESULT_INVALID; - } - - if(out_len > decompressed->data_size) { - LV_LOG_ERROR("Decompressed size mismatch: %" LV_PRIu32 " > %" LV_PRIu32, out_len, decompressed->data_size); - lv_draw_buf_destroy(decompressed); - return LV_RESULT_INVALID; - } - - img_data = decompressed->data; - - if(compressed->method == LV_IMAGE_COMPRESS_RLE) { -#if LV_USE_RLE - /*Compress always happen on byte*/ - uint32_t pixel_byte; - if(dsc->header.cf == LV_COLOR_FORMAT_RGB565A8) - pixel_byte = 2; - else - pixel_byte = (lv_color_format_get_bpp(dsc->header.cf) + 7) >> 3; - const uint8_t * input = compressed->data; - uint8_t * output = img_data; - uint32_t len; - len = lv_rle_decompress(input, input_len, output, out_len, pixel_byte); - if(len != compressed->decompressed_size) { - LV_LOG_WARN("Decompress failed: %" LV_PRIu32 ", got: %" LV_PRIu32, out_len, len); - lv_draw_buf_destroy(decompressed); - return LV_RESULT_INVALID; - } -#else - LV_LOG_WARN("RLE decompress is not enabled"); - lv_draw_buf_destroy(decompressed); - return LV_RESULT_INVALID; -#endif - } - else if(compressed->method == LV_IMAGE_COMPRESS_LZ4) { -#if LV_USE_LZ4 - const char * input = (const char *)compressed->data; - char * output = (char *)img_data; - int len; - len = LZ4_decompress_safe(input, output, input_len, out_len); - if(len < 0 || (uint32_t)len != compressed->decompressed_size) { - LV_LOG_WARN("Decompress failed: %" LV_PRId32 ", got: %" LV_PRId32, out_len, len); - lv_draw_buf_destroy(decompressed); - return LV_RESULT_INVALID; - } -#else - LV_LOG_WARN("LZ4 decompress is not enabled"); - lv_draw_buf_destroy(decompressed); - return LV_RESULT_INVALID; -#endif - } - else { - LV_UNUSED(img_data); - LV_LOG_WARN("Unknown compression method: %d", compressed->method); - lv_draw_buf_destroy(decompressed); - return LV_RESULT_INVALID; - } - - decoder_data->decompressed = decompressed; /*Free on decoder close*/ - return LV_RESULT_OK; -} diff --git a/L3_Middlewares/LVGL/src/libs/bin_decoder/lv_bin_decoder.h b/L3_Middlewares/LVGL/src/libs/bin_decoder/lv_bin_decoder.h deleted file mode 100644 index d441230..0000000 --- a/L3_Middlewares/LVGL/src/libs/bin_decoder/lv_bin_decoder.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file lv_bin_decoder.h - * - */ - -#ifndef LV_BIN_DECODER_H -#define LV_BIN_DECODER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../draw/lv_image_decoder.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize the binary image decoder module - */ -void lv_bin_decoder_init(void); - -/** - * Get info about a lvgl binary image - * @param decoder the decoder where this function belongs - * @param dsc image descriptor containing the source and type of the image and other info. - * @param header store the image data here - * @return LV_RESULT_OK: the info is successfully stored in `header`; LV_RESULT_INVALID: unknown format or other error. - */ -lv_result_t lv_bin_decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header); - -lv_result_t lv_bin_decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, - const lv_area_t * full_area, lv_area_t * decoded_area); - -/** - * Open a lvgl binary image - * @param decoder the decoder where this function belongs - * @param dsc pointer to decoder descriptor. `src`, `style` are already initialized in it. - * @return LV_RESULT_OK: the info is successfully stored in `header`; LV_RESULT_INVALID: unknown format or other error. - */ -lv_result_t lv_bin_decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); - -/** - * Close the pending decoding. Free resources etc. - * @param decoder pointer to the decoder the function associated with - * @param dsc pointer to decoder descriptor - */ -void lv_bin_decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_BIN_DECODER_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/bmp/lv_bmp.c b/L3_Middlewares/LVGL/src/libs/bmp/lv_bmp.c deleted file mode 100644 index aeb9dad..0000000 --- a/L3_Middlewares/LVGL/src/libs/bmp/lv_bmp.c +++ /dev/null @@ -1,253 +0,0 @@ -/** - * @file lv_bmp.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../draw/lv_image_decoder_private.h" -#include "../../../lvgl.h" -#if LV_USE_BMP - -#include -#include "../../core/lv_global.h" - -/********************* - * DEFINES - *********************/ - -#define DECODER_NAME "BMP" - -#define image_cache_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->image_cache_draw_buf_handlers) - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - lv_fs_file_t f; - unsigned int px_offset; - int px_width; - int px_height; - unsigned int bpp; - int row_size_bytes; -} bmp_dsc_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * src, lv_image_header_t * header); -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); - -static lv_result_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, - const lv_area_t * full_area, lv_area_t * decoded_area); - -static void decoder_close(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ -void lv_bmp_init(void) -{ - lv_image_decoder_t * dec = lv_image_decoder_create(); - lv_image_decoder_set_info_cb(dec, decoder_info); - lv_image_decoder_set_open_cb(dec, decoder_open); - lv_image_decoder_set_get_area_cb(dec, decoder_get_area); - lv_image_decoder_set_close_cb(dec, decoder_close); - - dec->name = DECODER_NAME; -} - -void lv_bmp_deinit(void) -{ - lv_image_decoder_t * dec = NULL; - while((dec = lv_image_decoder_get_next(dec)) != NULL) { - if(dec->info_cb == decoder_info) { - lv_image_decoder_delete(dec); - break; - } - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Get info about a BMP image - * @param dsc image descriptor containing the source and type of the image and other info. - * @param header store the info here - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't get the info - */ -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header) -{ - LV_UNUSED(decoder); - - const void * src = dsc->src; - lv_image_src_t src_type = dsc->src_type; /*Get the source type*/ - - /*If it's a BMP file...*/ - if(src_type == LV_IMAGE_SRC_FILE) { - const char * fn = src; - if(lv_strcmp(lv_fs_get_ext(fn), "bmp") == 0) { /*Check the extension*/ - /*Save the data in the header*/ - uint8_t headers[54]; - - lv_fs_read(&dsc->file, headers, 54, NULL); - uint32_t w; - uint32_t h; - lv_memcpy(&w, headers + 18, 4); - lv_memcpy(&h, headers + 22, 4); - header->w = w; - header->h = h; - - uint16_t bpp; - lv_memcpy(&bpp, headers + 28, 2); - switch(bpp) { - case 16: - header->cf = LV_COLOR_FORMAT_RGB565; - break; - case 24: - header->cf = LV_COLOR_FORMAT_RGB888; - break; - case 32: - header->cf = LV_COLOR_FORMAT_ARGB8888; - break; - default: - LV_LOG_WARN("Not supported bpp: %d", bpp); - return LV_RESULT_OK; - } - return LV_RESULT_OK; - } - } - /* BMP file as data not supported for simplicity. - * Convert them to LVGL compatible C arrays directly. */ - else if(src_type == LV_IMAGE_SRC_VARIABLE) { - return LV_RESULT_INVALID; - } - - return LV_RESULT_INVALID; /*If didn't succeeded earlier then it's an error*/ -} - -/** - * Open a BMP image and return the decided image - * @param decoder pointer to the decoder - * @param dsc pointer to the decoder descriptor - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't open the image - */ -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); - - /*If it's a BMP file...*/ - if(dsc->src_type == LV_IMAGE_SRC_FILE) { - const char * fn = dsc->src; - - if(lv_strcmp(lv_fs_get_ext(fn), "bmp") != 0) { - return LV_RESULT_INVALID; /*Check the extension*/ - } - - bmp_dsc_t b; - lv_memset(&b, 0x00, sizeof(b)); - - lv_fs_res_t res = lv_fs_open(&b.f, dsc->src, LV_FS_MODE_RD); - if(res != LV_FS_RES_OK) return LV_RESULT_INVALID; - - uint8_t header[54]; - lv_fs_read(&b.f, header, 54, NULL); - - if(0x42 != header[0] || 0x4d != header[1]) { - lv_fs_close(&b.f); - return LV_RESULT_INVALID; - } - - lv_memcpy(&b.px_offset, header + 10, 4); - lv_memcpy(&b.px_width, header + 18, 4); - lv_memcpy(&b.px_height, header + 22, 4); - lv_memcpy(&b.bpp, header + 28, 2); - b.row_size_bytes = ((b.bpp * b.px_width + 31) / 32) * 4; - - dsc->user_data = lv_malloc(sizeof(bmp_dsc_t)); - LV_ASSERT_MALLOC(dsc->user_data); - if(dsc->user_data == NULL) return LV_RESULT_INVALID; - lv_memcpy(dsc->user_data, &b, sizeof(b)); - return LV_RESULT_OK; - } - /* BMP file as data not supported for simplicity. - * Convert them to LVGL compatible C arrays directly. */ - else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { - return LV_RESULT_INVALID; - } - - return LV_RESULT_INVALID; /*If not returned earlier then it failed*/ -} - -static lv_result_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, - const lv_area_t * full_area, lv_area_t * decoded_area) -{ - LV_UNUSED(decoder); - bmp_dsc_t * b = dsc->user_data; - lv_draw_buf_t * decoded = (void *)dsc->decoded; - - if(decoded_area->y1 == LV_COORD_MIN) { - *decoded_area = *full_area; - decoded_area->y2 = decoded_area->y1; - int32_t w_px = lv_area_get_width(full_area); - lv_draw_buf_t * reshaped = lv_draw_buf_reshape(decoded, dsc->header.cf, w_px, 1, LV_STRIDE_AUTO); - if(reshaped == NULL) { - if(decoded != NULL) { - lv_draw_buf_destroy(decoded); - decoded = NULL; - dsc->decoded = NULL; - } - decoded = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, w_px, 1, dsc->header.cf, LV_STRIDE_AUTO); - if(decoded == NULL) return LV_RESULT_INVALID; - } - else { - decoded = reshaped; - } - dsc->decoded = decoded; - } - else { - decoded_area->y1++; - decoded_area->y2++; - } - - if(decoded_area->y1 > full_area->y2) { - return LV_RESULT_INVALID; - } - else { - int32_t y = (b->px_height - 1) - (decoded_area->y1); /*BMP images are stored upside down*/ - uint32_t p = b->px_offset + b->row_size_bytes * y; - p += (decoded_area->x1) * (b->bpp / 8); - lv_fs_seek(&b->f, p, LV_FS_SEEK_SET); - uint32_t line_width_byte = lv_area_get_width(full_area) * (b->bpp / 8); - lv_fs_read(&b->f, decoded->data, line_width_byte, NULL); - - return LV_RESULT_OK; - } -} - -/** - * Free the allocated resources - */ -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); - bmp_dsc_t * b = dsc->user_data; - lv_fs_close(&b->f); - lv_free(dsc->user_data); - if(dsc->decoded) lv_draw_buf_destroy((void *)dsc->decoded); - -} - -#endif /*LV_USE_BMP*/ diff --git a/L3_Middlewares/LVGL/src/libs/ffmpeg/lv_ffmpeg_private.h b/L3_Middlewares/LVGL/src/libs/ffmpeg/lv_ffmpeg_private.h deleted file mode 100644 index b27b6bf..0000000 --- a/L3_Middlewares/LVGL/src/libs/ffmpeg/lv_ffmpeg_private.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file lv_ffmpeg_private.h - * - */ - -#ifndef LV_FFMPEG_PRIVATE_H -#define LV_FFMPEG_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_ffmpeg.h" -#if LV_USE_FFMPEG != 0 -#include "../../widgets/image/lv_image_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_ffmpeg_player_t { - lv_image_t img; - lv_timer_t * timer; - lv_image_dsc_t imgdsc; - bool auto_restart; - struct ffmpeg_context_s * ffmpeg_ctx; -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_FFMPEG*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_FFMPEG_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/freetype/ftmodule.h b/L3_Middlewares/LVGL/src/libs/freetype/ftmodule.h deleted file mode 100644 index b804b6e..0000000 --- a/L3_Middlewares/LVGL/src/libs/freetype/ftmodule.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file registers the FreeType modules compiled into the library. - * - * If you use GNU make, this file IS NOT USED! Instead, it is created in - * the objects directory (normally `/objs/`) based on information - * from `/modules.cfg`. - * - * Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile - * FreeType without GNU make. - * - */ - -/* FT_USE_MODULE( FT_Module_Class, autofit_module_class ) */ -FT_USE_MODULE(FT_Driver_ClassRec, tt_driver_class) -/* FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) */ -/* FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) */ -/* FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) */ -/* FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) */ -/* FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) */ -/* FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) */ -/* FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) */ -/* FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) */ -/* FT_USE_MODULE( FT_Module_Class, psaux_module_class ) */ -/* FT_USE_MODULE( FT_Module_Class, psnames_module_class ) */ -/* FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) */ -FT_USE_MODULE(FT_Module_Class, sfnt_module_class) -FT_USE_MODULE(FT_Renderer_Class, ft_smooth_renderer_class) -/* FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) */ -/* FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class ) */ -/* FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class ) */ -/* FT_USE_MODULE( FT_Renderer_Class, ft_svg_renderer_class ) */ - -/* EOF */ diff --git a/L3_Middlewares/LVGL/src/libs/freetype/ftoption.h b/L3_Middlewares/LVGL/src/libs/freetype/ftoption.h deleted file mode 100644 index 141278b..0000000 --- a/L3_Middlewares/LVGL/src/libs/freetype/ftoption.h +++ /dev/null @@ -1,964 +0,0 @@ -/**************************************************************************** - * - * ftoption.h - * - * User-selectable configuration macros (specification only). - * - * Copyright (C) 1996-2022 by - * David Turner, Robert Wilhelm, and Werner Lemberg. - * - * This file is part of the FreeType project, and may only be used, - * modified, and distributed under the terms of the FreeType project - * license, LICENSE.TXT. By continuing to use, modify, or distribute - * this file you indicate that you have read the license and - * understand and accept it fully. - * - */ - -#ifndef FTOPTION_H_ -#define FTOPTION_H_ - -#include - -FT_BEGIN_HEADER - -/************************************************************************** - * - * USER-SELECTABLE CONFIGURATION MACROS - * - * This file contains the default configuration macro definitions for a - * standard build of the FreeType library. There are three ways to use - * this file to build project-specific versions of the library: - * - * - You can modify this file by hand, but this is not recommended in - * cases where you would like to build several versions of the library - * from a single source directory. - * - * - You can put a copy of this file in your build directory, more - * precisely in `$BUILD/freetype/config/ftoption.h`, where `$BUILD` is - * the name of a directory that is included _before_ the FreeType include - * path during compilation. - * - * The default FreeType Makefiles use the build directory - * `builds/` by default, but you can easily change that for your - * own projects. - * - * - Copy the file to `$BUILD/ft2build.h` and modify it - * slightly to pre-define the macro `FT_CONFIG_OPTIONS_H` used to locate - * this file during the build. For example, - * - * ``` - * #define FT_CONFIG_OPTIONS_H - * #include - * ``` - * - * will use `$BUILD/myftoptions.h` instead of this file for macro - * definitions. - * - * Note also that you can similarly pre-define the macro - * `FT_CONFIG_MODULES_H` used to locate the file listing of the modules - * that are statically linked to the library at compile time. By - * default, this file is ``. - * - * We highly recommend using the third method whenever possible. - * - */ - -/*************************************************************************/ -/*************************************************************************/ -/**** ****/ -/**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/ -/**** ****/ -/*************************************************************************/ -/*************************************************************************/ - -/*#************************************************************************ - * - * If you enable this configuration option, FreeType recognizes an - * environment variable called `FREETYPE_PROPERTIES`, which can be used to - * control the various font drivers and modules. The controllable - * properties are listed in the section @properties. - * - * You have to undefine this configuration option on platforms that lack - * the concept of environment variables (and thus don't have the `getenv` - * function), for example Windows CE. - * - * `FREETYPE_PROPERTIES` has the following syntax form (broken here into - * multiple lines for better readability). - * - * ``` - * - * ':' - * '=' - * - * ':' - * '=' - * ... - * ``` - * - * Example: - * - * ``` - * FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ - * cff:no-stem-darkening=1 - * ``` - * - */ -#define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES - -/************************************************************************** - * - * Uncomment the line below if you want to activate LCD rendering - * technology similar to ClearType in this build of the library. This - * technology triples the resolution in the direction color subpixels. To - * mitigate color fringes inherent to this technology, you also need to - * explicitly set up LCD filtering. - * - * When this macro is not defined, FreeType offers alternative LCD - * rendering technology that produces excellent output. - */ -/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ - -/************************************************************************** - * - * Many compilers provide a non-ANSI 64-bit data type that can be used by - * FreeType to speed up some computations. However, this will create some - * problems when compiling the library in strict ANSI mode. - * - * For this reason, the use of 64-bit integers is normally disabled when - * the `__STDC__` macro is defined. You can however disable this by - * defining the macro `FT_CONFIG_OPTION_FORCE_INT64` here. - * - * For most compilers, this will only create compilation warnings when - * building the library. - * - * ObNote: The compiler-specific 64-bit integers are detected in the - * file `ftconfig.h` either statically or through the `configure` - * script on supported platforms. - */ -#undef FT_CONFIG_OPTION_FORCE_INT64 - -/************************************************************************** - * - * If this macro is defined, do not try to use an assembler version of - * performance-critical functions (e.g., @FT_MulFix). You should only do - * that to verify that the assembler function works properly, or to execute - * benchmark tests of the various implementations. - */ -/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */ - -/************************************************************************** - * - * If this macro is defined, try to use an inlined assembler version of the - * @FT_MulFix function, which is a 'hotspot' when loading and hinting - * glyphs, and which should be executed as fast as possible. - * - * Note that if your compiler or CPU is not supported, this will default to - * the standard and portable implementation found in `ftcalc.c`. - */ -#define FT_CONFIG_OPTION_INLINE_MULFIX - -/************************************************************************** - * - * LZW-compressed file support. - * - * FreeType now handles font files that have been compressed with the - * `compress` program. This is mostly used to parse many of the PCF - * files that come with various X11 distributions. The implementation - * uses NetBSD's `zopen` to partially uncompress the file on the fly (see - * `src/lzw/ftgzip.c`). - * - * Define this macro if you want to enable this 'feature'. - */ -#define FT_CONFIG_OPTION_USE_LZW - -/************************************************************************** - * - * Gzip-compressed file support. - * - * FreeType now handles font files that have been compressed with the - * `gzip` program. This is mostly used to parse many of the PCF files - * that come with XFree86. The implementation uses 'zlib' to partially - * uncompress the file on the fly (see `src/gzip/ftgzip.c`). - * - * Define this macro if you want to enable this 'feature'. See also the - * macro `FT_CONFIG_OPTION_SYSTEM_ZLIB` below. - */ -#define FT_CONFIG_OPTION_USE_ZLIB - -/************************************************************************** - * - * ZLib library selection - * - * This macro is only used when `FT_CONFIG_OPTION_USE_ZLIB` is defined. - * It allows FreeType's 'ftgzip' component to link to the system's - * installation of the ZLib library. This is useful on systems like - * Unix or VMS where it generally is already available. - * - * If you let it undefined, the component will use its own copy of the - * zlib sources instead. These have been modified to be included - * directly within the component and **not** export external function - * names. This allows you to link any program with FreeType _and_ ZLib - * without linking conflicts. - * - * Do not `#undef` this macro here since the build system might define - * it for certain configurations only. - * - * If you use a build system like cmake or the `configure` script, - * options set by those programs have precedence, overwriting the value - * here with the configured one. - * - * If you use the GNU make build system directly (that is, without the - * `configure` script) and you define this macro, you also have to pass - * `SYSTEM_ZLIB=yes` as an argument to make. - */ -/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ - -/************************************************************************** - * - * Bzip2-compressed file support. - * - * FreeType now handles font files that have been compressed with the - * `bzip2` program. This is mostly used to parse many of the PCF files - * that come with XFree86. The implementation uses `libbz2` to partially - * uncompress the file on the fly (see `src/bzip2/ftbzip2.c`). Contrary - * to gzip, bzip2 currently is not included and need to use the system - * available bzip2 implementation. - * - * Define this macro if you want to enable this 'feature'. - * - * If you use a build system like cmake or the `configure` script, - * options set by those programs have precedence, overwriting the value - * here with the configured one. - */ -/* #define FT_CONFIG_OPTION_USE_BZIP2 */ - -/************************************************************************** - * - * Define to disable the use of file stream functions and types, `FILE`, - * `fopen`, etc. Enables the use of smaller system libraries on embedded - * systems that have multiple system libraries, some with or without file - * stream support, in the cases where file stream support is not necessary - * such as memory loading of font files. - */ -/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ - -/************************************************************************** - * - * PNG bitmap support. - * - * FreeType now handles loading color bitmap glyphs in the PNG format. - * This requires help from the external libpng library. Uncompressed - * color bitmaps do not need any external libraries and will be supported - * regardless of this configuration. - * - * Define this macro if you want to enable this 'feature'. - * - * If you use a build system like cmake or the `configure` script, - * options set by those programs have precedence, overwriting the value - * here with the configured one. - */ -/* #define FT_CONFIG_OPTION_USE_PNG */ - -/************************************************************************** - * - * HarfBuzz support. - * - * FreeType uses the HarfBuzz library to improve auto-hinting of OpenType - * fonts. If available, many glyphs not directly addressable by a font's - * character map will be hinted also. - * - * Define this macro if you want to enable this 'feature'. - * - * If you use a build system like cmake or the `configure` script, - * options set by those programs have precedence, overwriting the value - * here with the configured one. - */ -/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */ - -/************************************************************************** - * - * Brotli support. - * - * FreeType uses the Brotli library to provide support for decompressing - * WOFF2 streams. - * - * Define this macro if you want to enable this 'feature'. - * - * If you use a build system like cmake or the `configure` script, - * options set by those programs have precedence, overwriting the value - * here with the configured one. - */ -/* #define FT_CONFIG_OPTION_USE_BROTLI */ - -/************************************************************************** - * - * Glyph Postscript Names handling - * - * By default, FreeType 2 is compiled with the 'psnames' module. This - * module is in charge of converting a glyph name string into a Unicode - * value, or return a Macintosh standard glyph name for the use with the - * TrueType 'post' table. - * - * Undefine this macro if you do not want 'psnames' compiled in your - * build of FreeType. This has the following effects: - * - * - The TrueType driver will provide its own set of glyph names, if you - * build it to support postscript names in the TrueType 'post' table, - * but will not synthesize a missing Unicode charmap. - * - * - The Type~1 driver will not be able to synthesize a Unicode charmap - * out of the glyphs found in the fonts. - * - * You would normally undefine this configuration macro when building a - * version of FreeType that doesn't contain a Type~1 or CFF driver. - */ -#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES - -/************************************************************************** - * - * Postscript Names to Unicode Values support - * - * By default, FreeType~2 is built with the 'psnames' module compiled in. - * Among other things, the module is used to convert a glyph name into a - * Unicode value. This is especially useful in order to synthesize on - * the fly a Unicode charmap from the CFF/Type~1 driver through a big - * table named the 'Adobe Glyph List' (AGL). - * - * Undefine this macro if you do not want the Adobe Glyph List compiled - * in your 'psnames' module. The Type~1 driver will not be able to - * synthesize a Unicode charmap out of the glyphs found in the fonts. - */ -#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST - -/************************************************************************** - * - * Support for Mac fonts - * - * Define this macro if you want support for outline fonts in Mac format - * (mac dfont, mac resource, macbinary containing a mac resource) on - * non-Mac platforms. - * - * Note that the 'FOND' resource isn't checked. - */ -/* #define FT_CONFIG_OPTION_MAC_FONTS */ - -/************************************************************************** - * - * Guessing methods to access embedded resource forks - * - * Enable extra Mac fonts support on non-Mac platforms (e.g., GNU/Linux). - * - * Resource forks which include fonts data are stored sometimes in - * locations which users or developers don't expected. In some cases, - * resource forks start with some offset from the head of a file. In - * other cases, the actual resource fork is stored in file different from - * what the user specifies. If this option is activated, FreeType tries - * to guess whether such offsets or different file names must be used. - * - * Note that normal, direct access of resource forks is controlled via - * the `FT_CONFIG_OPTION_MAC_FONTS` option. - */ -#ifdef FT_CONFIG_OPTION_MAC_FONTS - #define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK -#endif - -/************************************************************************** - * - * Allow the use of `FT_Incremental_Interface` to load typefaces that - * contain no glyph data, but supply it via a callback function. This is - * required by clients supporting document formats which supply font data - * incrementally as the document is parsed, such as the Ghostscript - * interpreter for the PostScript language. - */ -#define FT_CONFIG_OPTION_INCREMENTAL - -/************************************************************************** - * - * The size in bytes of the render pool used by the scan-line converter to - * do all of its work. - */ -#define FT_RENDER_POOL_SIZE 16384L - -/************************************************************************** - * - * FT_MAX_MODULES - * - * The maximum number of modules that can be registered in a single - * FreeType library object. 32~is the default. - */ -#define FT_MAX_MODULES 32 - -/************************************************************************** - * - * Debug level - * - * FreeType can be compiled in debug or trace mode. In debug mode, - * errors are reported through the 'ftdebug' component. In trace mode, - * additional messages are sent to the standard output during execution. - * - * Define `FT_DEBUG_LEVEL_ERROR` to build the library in debug mode. - * Define `FT_DEBUG_LEVEL_TRACE` to build it in trace mode. - * - * Don't define any of these macros to compile in 'release' mode! - * - * Do not `#undef` these macros here since the build system might define - * them for certain configurations only. - */ -/* #define FT_DEBUG_LEVEL_ERROR */ -/* #define FT_DEBUG_LEVEL_TRACE */ - -/************************************************************************** - * - * Logging - * - * Compiling FreeType in debug or trace mode makes FreeType write error - * and trace log messages to `stderr`. Enabling this macro - * automatically forces the `FT_DEBUG_LEVEL_ERROR` and - * `FT_DEBUG_LEVEL_TRACE` macros and allows FreeType to write error and - * trace log messages to a file instead of `stderr`. For writing logs - * to a file, FreeType uses an the external `dlg` library (the source - * code is in `src/dlg`). - * - * This option needs a C99 compiler. - */ -/* #define FT_DEBUG_LOGGING */ - -/************************************************************************** - * - * Autofitter debugging - * - * If `FT_DEBUG_AUTOFIT` is defined, FreeType provides some means to - * control the autofitter behaviour for debugging purposes with global - * boolean variables (consequently, you should **never** enable this - * while compiling in 'release' mode): - * - * ``` - * _af_debug_disable_horz_hints - * _af_debug_disable_vert_hints - * _af_debug_disable_blue_hints - * ``` - * - * Additionally, the following functions provide dumps of various - * internal autofit structures to stdout (using `printf`): - * - * ``` - * af_glyph_hints_dump_points - * af_glyph_hints_dump_segments - * af_glyph_hints_dump_edges - * af_glyph_hints_get_num_segments - * af_glyph_hints_get_segment_offset - * ``` - * - * As an argument, they use another global variable: - * - * ``` - * _af_debug_hints - * ``` - * - * Please have a look at the `ftgrid` demo program to see how those - * variables and macros should be used. - * - * Do not `#undef` these macros here since the build system might define - * them for certain configurations only. - */ -/* #define FT_DEBUG_AUTOFIT */ - -/************************************************************************** - * - * Memory Debugging - * - * FreeType now comes with an integrated memory debugger that is capable - * of detecting simple errors like memory leaks or double deletes. To - * compile it within your build of the library, you should define - * `FT_DEBUG_MEMORY` here. - * - * Note that the memory debugger is only activated at runtime when when - * the _environment_ variable `FT2_DEBUG_MEMORY` is defined also! - * - * Do not `#undef` this macro here since the build system might define it - * for certain configurations only. - */ -/* #define FT_DEBUG_MEMORY */ - -/************************************************************************** - * - * Module errors - * - * If this macro is set (which is _not_ the default), the higher byte of - * an error code gives the module in which the error has occurred, while - * the lower byte is the real error code. - * - * Setting this macro makes sense for debugging purposes only, since it - * would break source compatibility of certain programs that use - * FreeType~2. - * - * More details can be found in the files `ftmoderr.h` and `fterrors.h`. - */ -#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS - -/************************************************************************** - * - * OpenType SVG Glyph Support - * - * Setting this macro enables support for OpenType SVG glyphs. By - * default, FreeType can only fetch SVG documents. However, it can also - * render them if external rendering hook functions are plugged in at - * runtime. - * - * More details on the hooks can be found in file `otsvg.h`. - */ -#define FT_CONFIG_OPTION_SVG - -/************************************************************************** - * - * Error Strings - * - * If this macro is set, `FT_Error_String` will return meaningful - * descriptions. This is not enabled by default to reduce the overall - * size of FreeType. - * - * More details can be found in the file `fterrors.h`. - */ -#define FT_CONFIG_OPTION_ERROR_STRINGS - -/*************************************************************************/ -/*************************************************************************/ -/**** ****/ -/**** S F N T D R I V E R C O N F I G U R A T I O N ****/ -/**** ****/ -/*************************************************************************/ -/*************************************************************************/ - -/************************************************************************** - * - * Define `TT_CONFIG_OPTION_EMBEDDED_BITMAPS` if you want to support - * embedded bitmaps in all formats using the 'sfnt' module (namely - * TrueType~& OpenType). - */ -#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS - -/************************************************************************** - * - * Define `TT_CONFIG_OPTION_COLOR_LAYERS` if you want to support colored - * outlines (from the 'COLR'/'CPAL' tables) in all formats using the 'sfnt' - * module (namely TrueType~& OpenType). - */ -#define TT_CONFIG_OPTION_COLOR_LAYERS - -/************************************************************************** - * - * Define `TT_CONFIG_OPTION_POSTSCRIPT_NAMES` if you want to be able to - * load and enumerate the glyph Postscript names in a TrueType or OpenType - * file. - * - * Note that when you do not compile the 'psnames' module by undefining the - * above `FT_CONFIG_OPTION_POSTSCRIPT_NAMES`, the 'sfnt' module will - * contain additional code used to read the PS Names table from a font. - * - * (By default, the module uses 'psnames' to extract glyph names.) - */ -#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES - -/************************************************************************** - * - * Define `TT_CONFIG_OPTION_SFNT_NAMES` if your applications need to access - * the internal name table in a SFNT-based format like TrueType or - * OpenType. The name table contains various strings used to describe the - * font, like family name, copyright, version, etc. It does not contain - * any glyph name though. - * - * Accessing SFNT names is done through the functions declared in - * `ftsnames.h`. - */ -#define TT_CONFIG_OPTION_SFNT_NAMES - -/************************************************************************** - * - * TrueType CMap support - * - * Here you can fine-tune which TrueType CMap table format shall be - * supported. - */ -#define TT_CONFIG_CMAP_FORMAT_0 -#define TT_CONFIG_CMAP_FORMAT_2 -#define TT_CONFIG_CMAP_FORMAT_4 -#define TT_CONFIG_CMAP_FORMAT_6 -#define TT_CONFIG_CMAP_FORMAT_8 -#define TT_CONFIG_CMAP_FORMAT_10 -#define TT_CONFIG_CMAP_FORMAT_12 -#define TT_CONFIG_CMAP_FORMAT_13 -#define TT_CONFIG_CMAP_FORMAT_14 - -/*************************************************************************/ -/*************************************************************************/ -/**** ****/ -/**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/ -/**** ****/ -/*************************************************************************/ -/*************************************************************************/ - -/************************************************************************** - * - * Define `TT_CONFIG_OPTION_BYTECODE_INTERPRETER` if you want to compile a - * bytecode interpreter in the TrueType driver. - * - * By undefining this, you will only compile the code necessary to load - * TrueType glyphs without hinting. - * - * Do not `#undef` this macro here, since the build system might define it - * for certain configurations only. - */ -#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER - -/************************************************************************** - * - * Define `TT_CONFIG_OPTION_SUBPIXEL_HINTING` if you want to compile - * subpixel hinting support into the TrueType driver. This modifies the - * TrueType hinting mechanism when anything but `FT_RENDER_MODE_MONO` is - * requested. - * - * In particular, it modifies the bytecode interpreter to interpret (or - * not) instructions in a certain way so that all TrueType fonts look like - * they do in a Windows ClearType (DirectWrite) environment. See [1] for a - * technical overview on what this means. See `ttinterp.h` for more - * details on the LEAN option. - * - * There are three possible values. - * - * Value 1: - * This value is associated with the 'Infinality' moniker, contributed by - * an individual nicknamed Infinality with the goal of making TrueType - * fonts render better than on Windows. A high amount of configurability - * and flexibility, down to rules for single glyphs in fonts, but also - * very slow. Its experimental and slow nature and the original - * developer losing interest meant that this option was never enabled in - * default builds. - * - * The corresponding interpreter version is v38. - * - * Value 2: - * The new default mode for the TrueType driver. The Infinality code - * base was stripped to the bare minimum and all configurability removed - * in the name of speed and simplicity. The configurability was mainly - * aimed at legacy fonts like 'Arial', 'Times New Roman', or 'Courier'. - * Legacy fonts are fonts that modify vertical stems to achieve clean - * black-and-white bitmaps. The new mode focuses on applying a minimal - * set of rules to all fonts indiscriminately so that modern and web - * fonts render well while legacy fonts render okay. - * - * The corresponding interpreter version is v40. - * - * Value 3: - * Compile both, making both v38 and v40 available (the latter is the - * default). - * - * By undefining these, you get rendering behavior like on Windows without - * ClearType, i.e., Windows XP without ClearType enabled and Win9x - * (interpreter version v35). Or not, depending on how much hinting blood - * and testing tears the font designer put into a given font. If you - * define one or both subpixel hinting options, you can switch between - * between v35 and the ones you define (using `FT_Property_Set`). - * - * This option requires `TT_CONFIG_OPTION_BYTECODE_INTERPRETER` to be - * defined. - * - * [1] - * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx - */ -/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */ -#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 -/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */ - -/************************************************************************** - * - * Define `TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED` to compile the - * TrueType glyph loader to use Apple's definition of how to handle - * component offsets in composite glyphs. - * - * Apple and MS disagree on the default behavior of component offsets in - * composites. Apple says that they should be scaled by the scaling - * factors in the transformation matrix (roughly, it's more complex) while - * MS says they should not. OpenType defines two bits in the composite - * flags array which can be used to disambiguate, but old fonts will not - * have them. - * - * https://www.microsoft.com/typography/otspec/glyf.htm - * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html - */ -#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED - -/************************************************************************** - * - * Define `TT_CONFIG_OPTION_GX_VAR_SUPPORT` if you want to include support - * for Apple's distortable font technology ('fvar', 'gvar', 'cvar', and - * 'avar' tables). Tagged 'Font Variations', this is now part of OpenType - * also. This has many similarities to Type~1 Multiple Masters support. - */ -#define TT_CONFIG_OPTION_GX_VAR_SUPPORT - -/************************************************************************** - * - * Define `TT_CONFIG_OPTION_BDF` if you want to include support for an - * embedded 'BDF~' table within SFNT-based bitmap formats. - */ -#define TT_CONFIG_OPTION_BDF - -/************************************************************************** - * - * Option `TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES` controls the maximum - * number of bytecode instructions executed for a single run of the - * bytecode interpreter, needed to prevent infinite loops. You don't want - * to change this except for very special situations (e.g., making a - * library fuzzer spend less time to handle broken fonts). - * - * It is not expected that this value is ever modified by a configuring - * script; instead, it gets surrounded with `#ifndef ... #endif` so that - * the value can be set as a preprocessor option on the compiler's command - * line. - */ -#ifndef TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES - #define TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES 1000000L -#endif - -/*************************************************************************/ -/*************************************************************************/ -/**** ****/ -/**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ -/**** ****/ -/*************************************************************************/ -/*************************************************************************/ - -/************************************************************************** - * - * `T1_MAX_DICT_DEPTH` is the maximum depth of nest dictionaries and arrays - * in the Type~1 stream (see `t1load.c`). A minimum of~4 is required. - */ -#define T1_MAX_DICT_DEPTH 5 - -/************************************************************************** - * - * `T1_MAX_SUBRS_CALLS` details the maximum number of nested sub-routine - * calls during glyph loading. - */ -#define T1_MAX_SUBRS_CALLS 16 - -/************************************************************************** - * - * `T1_MAX_CHARSTRING_OPERANDS` is the charstring stack's capacity. A - * minimum of~16 is required. - * - * The Chinese font 'MingTiEG-Medium' (covering the CNS 11643 character - * set) needs 256. - */ -#define T1_MAX_CHARSTRINGS_OPERANDS 256 - -/************************************************************************** - * - * Define this configuration macro if you want to prevent the compilation - * of the 't1afm' module, which is in charge of reading Type~1 AFM files - * into an existing face. Note that if set, the Type~1 driver will be - * unable to produce kerning distances. - */ -#undef T1_CONFIG_OPTION_NO_AFM - -/************************************************************************** - * - * Define this configuration macro if you want to prevent the compilation - * of the Multiple Masters font support in the Type~1 driver. - */ -#undef T1_CONFIG_OPTION_NO_MM_SUPPORT - -/************************************************************************** - * - * `T1_CONFIG_OPTION_OLD_ENGINE` controls whether the pre-Adobe Type~1 - * engine gets compiled into FreeType. If defined, it is possible to - * switch between the two engines using the `hinting-engine` property of - * the 'type1' driver module. - */ -/* #define T1_CONFIG_OPTION_OLD_ENGINE */ - -/*************************************************************************/ -/*************************************************************************/ -/**** ****/ -/**** C F F D R I V E R C O N F I G U R A T I O N ****/ -/**** ****/ -/*************************************************************************/ -/*************************************************************************/ - -/************************************************************************** - * - * Using `CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4}` it is - * possible to set up the default values of the four control points that - * define the stem darkening behaviour of the (new) CFF engine. For more - * details please read the documentation of the `darkening-parameters` - * property (file `ftdriver.h`), which allows the control at run-time. - * - * Do **not** undefine these macros! - */ -#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500 -#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400 - -#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000 -#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275 - -#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667 -#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275 - -#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333 -#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0 - -/************************************************************************** - * - * `CFF_CONFIG_OPTION_OLD_ENGINE` controls whether the pre-Adobe CFF engine - * gets compiled into FreeType. If defined, it is possible to switch - * between the two engines using the `hinting-engine` property of the 'cff' - * driver module. - */ -/* #define CFF_CONFIG_OPTION_OLD_ENGINE */ - -/*************************************************************************/ -/*************************************************************************/ -/**** ****/ -/**** P C F D R I V E R C O N F I G U R A T I O N ****/ -/**** ****/ -/*************************************************************************/ -/*************************************************************************/ - -/************************************************************************** - * - * There are many PCF fonts just called 'Fixed' which look completely - * different, and which have nothing to do with each other. When selecting - * 'Fixed' in KDE or Gnome one gets results that appear rather random, the - * style changes often if one changes the size and one cannot select some - * fonts at all. This option makes the 'pcf' module prepend the foundry - * name (plus a space) to the family name. - * - * We also check whether we have 'wide' characters; all put together, we - * get family names like 'Sony Fixed' or 'Misc Fixed Wide'. - * - * If this option is activated, it can be controlled with the - * `no-long-family-names` property of the 'pcf' driver module. - */ -/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */ - -/*************************************************************************/ -/*************************************************************************/ -/**** ****/ -/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/ -/**** ****/ -/*************************************************************************/ -/*************************************************************************/ - -/************************************************************************** - * - * Compile 'autofit' module with CJK (Chinese, Japanese, Korean) script - * support. - */ -#define AF_CONFIG_OPTION_CJK - -/************************************************************************** - * - * Compile 'autofit' module with fallback Indic script support, covering - * some scripts that the 'latin' submodule of the 'autofit' module doesn't - * (yet) handle. Currently, this needs option `AF_CONFIG_OPTION_CJK`. - */ -#ifdef AF_CONFIG_OPTION_CJK - #define AF_CONFIG_OPTION_INDIC -#endif - -/************************************************************************** - * - * Use TrueType-like size metrics for 'light' auto-hinting. - * - * It is strongly recommended to avoid this option, which exists only to - * help some legacy applications retain its appearance and behaviour with - * respect to auto-hinted TrueType fonts. - * - * The very reason this option exists at all are GNU/Linux distributions - * like Fedora that did not un-patch the following change (which was - * present in FreeType between versions 2.4.6 and 2.7.1, inclusive). - * - * ``` - * 2011-07-16 Steven Chu - * - * [truetype] Fix metrics on size request for scalable fonts. - * ``` - * - * This problematic commit is now reverted (more or less). - */ -/* #define AF_CONFIG_OPTION_TT_SIZE_METRICS */ - -/* */ - -/* - * This macro is obsolete. Support has been removed in FreeType version - * 2.5. - */ -/* #define FT_CONFIG_OPTION_OLD_INTERNALS */ - -/* - * The next three macros are defined if native TrueType hinting is - * requested by the definitions above. Don't change this. - */ -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER - #define TT_USE_BYTECODE_INTERPRETER - - #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING - #if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1 - #define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - #endif - - #if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2 - #define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - #endif - #endif -#endif - -/* - * The TT_SUPPORT_COLRV1 macro is defined to indicate to clients that this - * version of FreeType has support for 'COLR' v1 API. This definition is - * useful to FreeType clients that want to build in support for 'COLR' v1 - * depending on a tip-of-tree checkout before it is officially released in - * FreeType, and while the feature cannot yet be tested against using - * version macros. Don't change this macro. This may be removed once the - * feature is in a FreeType release version and version macros can be used - * to test for availability. - */ -#ifdef TT_CONFIG_OPTION_COLOR_LAYERS - #define TT_SUPPORT_COLRV1 -#endif - -/* - * Check CFF darkening parameters. The checks are the same as in function - * `cff_property_set` in file `cffdrivr.c`. - */ -#if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0 || \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0 || \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0 || \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0 || \ - \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0 || \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0 || \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0 || \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0 || \ - \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 > \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 || \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 > \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 || \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 > \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 || \ - \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \ - CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500 - #error "Invalid CFF darkening parameters!" -#endif - -FT_END_HEADER - -#endif /* FTOPTION_H_ */ - -/* END */ diff --git a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype.c b/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype.c deleted file mode 100644 index b1da8f1..0000000 --- a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype.c +++ /dev/null @@ -1,408 +0,0 @@ -/** - * @file lv_freetype.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../misc/lv_fs_private.h" -#include "lv_freetype_private.h" - -#if LV_USE_FREETYPE - -#include "lv_freetype_private.h" -#include "../../core/lv_global.h" - -/********************* - * DEFINES - *********************/ - -#define ft_ctx LV_GLOBAL_DEFAULT()->ft_context -#define LV_FREETYPE_OUTLINE_REF_SIZE_DEF 128 - -/**< This value is from the FreeType's function `FT_GlyphSlot_Oblique` in `ftsynth.c` */ -#define LV_FREETYPE_OBLIQUE_SLANT_DEF 0x0366A - -#if LV_FREETYPE_CACHE_FT_GLYPH_CNT <= 0 - #error "LV_FREETYPE_CACHE_FT_GLYPH_CNT must be greater than 0" -#endif - -/********************** - * TYPEDEFS - **********************/ - -/* Use the pointer storing pathname as the unique request ID of the face */ -typedef struct { - char * pathname; - int ref_cnt; -} face_id_node_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_freetype_cleanup(lv_freetype_context_t * ctx); -static FTC_FaceID lv_freetype_req_face_id(lv_freetype_context_t * ctx, const char * pathname); -static void lv_freetype_drop_face_id(lv_freetype_context_t * ctx, FTC_FaceID face_id); -static bool freetype_on_font_create(lv_freetype_font_dsc_t * dsc, uint32_t max_glyph_cnt); -static void freetype_on_font_set_cbs(lv_freetype_font_dsc_t * dsc); - -static bool cache_node_cache_create_cb(lv_freetype_cache_node_t * node, void * user_data); -static void cache_node_cache_free_cb(lv_freetype_cache_node_t * node, void * user_data); -static lv_cache_compare_res_t cache_node_cache_compare_cb(const lv_freetype_cache_node_t * lhs, - const lv_freetype_cache_node_t * rhs); -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_freetype_init(uint32_t max_glyph_cnt) -{ - if(ft_ctx) { - LV_LOG_WARN("freetype already initialized"); - return LV_RESULT_INVALID; - } - - ft_ctx = lv_malloc_zeroed(sizeof(lv_freetype_context_t)); - LV_ASSERT_MALLOC(ft_ctx); - if(!ft_ctx) { - LV_LOG_ERROR("malloc failed for lv_freetype_context_t"); - return LV_RESULT_INVALID; - } - - lv_freetype_context_t * ctx = lv_freetype_get_context(); - - ctx->max_glyph_cnt = max_glyph_cnt; - - FT_Error error; - - error = FT_Init_FreeType(&ctx->library); - if(error) { - FT_ERROR_MSG("FT_Init_FreeType", error); - return LV_RESULT_INVALID; - } - - lv_ll_init(&ctx->face_id_ll, sizeof(face_id_node_t)); - - lv_cache_ops_t ops = { - .compare_cb = (lv_cache_compare_cb_t)cache_node_cache_compare_cb, - .create_cb = (lv_cache_create_cb_t)cache_node_cache_create_cb, - .free_cb = (lv_cache_free_cb_t)cache_node_cache_free_cb, - }; - ctx->cache_node_cache = lv_cache_create(&lv_cache_class_lru_rb_count, sizeof(lv_freetype_cache_node_t), INT32_MAX, ops); - lv_cache_set_name(ctx->cache_node_cache, "FREETYPE_CACHE_NODE"); - - return LV_RESULT_OK; -} - -void lv_freetype_uninit(void) -{ - lv_freetype_context_t * ctx = lv_freetype_get_context(); - lv_freetype_cleanup(ctx); - - lv_free(ft_ctx); - ft_ctx = NULL; -} - -lv_font_t * lv_freetype_font_create(const char * pathname, lv_freetype_font_render_mode_t render_mode, uint32_t size, - lv_freetype_font_style_t style) -{ - LV_ASSERT_NULL(pathname); - LV_ASSERT(size > 0); - - size_t pathname_len = lv_strlen(pathname); - LV_ASSERT(pathname_len > 0); - - lv_freetype_context_t * ctx = lv_freetype_get_context(); - - lv_freetype_cache_node_t search_key = { - .pathname = lv_freetype_req_face_id(ctx, pathname), - .style = style, - .render_mode = render_mode, - }; - - bool cache_hitting = true; - lv_cache_entry_t * cache_node_entry = lv_cache_acquire(ctx->cache_node_cache, &search_key, NULL); - if(cache_node_entry == NULL) { - cache_hitting = false; - cache_node_entry = lv_cache_acquire_or_create(ctx->cache_node_cache, &search_key, NULL); - if(cache_node_entry == NULL) { - lv_freetype_drop_face_id(ctx, (FTC_FaceID)search_key.pathname); - LV_LOG_ERROR("cache node creating failed"); - return NULL; - } - } - - lv_freetype_font_dsc_t * dsc = lv_malloc_zeroed(sizeof(lv_freetype_font_dsc_t)); - LV_ASSERT_MALLOC(dsc); - - dsc->face_id = (FTC_FaceID)search_key.pathname; - dsc->render_mode = render_mode; - dsc->context = ctx; - dsc->size = size; - dsc->style = style; - dsc->magic_num = LV_FREETYPE_FONT_DSC_MAGIC_NUM; - dsc->cache_node = lv_cache_entry_get_data(cache_node_entry); - dsc->cache_node_entry = cache_node_entry; - - if(cache_hitting == false && freetype_on_font_create(dsc, ctx->max_glyph_cnt) == false) { - lv_cache_release(ctx->cache_node_cache, dsc->cache_node_entry, NULL); - lv_freetype_drop_face_id(ctx, dsc->face_id); - lv_free(dsc); - return NULL; - } - freetype_on_font_set_cbs(dsc); - - FT_Face face = dsc->cache_node->face; - FT_Set_Pixel_Sizes(face, 0, size); - - lv_font_t * font = &dsc->font; - font->dsc = dsc; - font->subpx = LV_FONT_SUBPX_NONE; - font->line_height = FT_F26DOT6_TO_INT(face->size->metrics.height); - font->base_line = -FT_F26DOT6_TO_INT(face->size->metrics.descender); - - FT_Fixed scale = face->size->metrics.y_scale; - int8_t thickness = FT_F26DOT6_TO_INT(FT_MulFix(scale, face->underline_thickness)); - font->underline_position = FT_F26DOT6_TO_INT(FT_MulFix(scale, face->underline_position)); - font->underline_thickness = thickness < 1 ? 1 : thickness; - - return font; -} - -void lv_freetype_font_delete(lv_font_t * font) -{ - LV_ASSERT_NULL(font); - lv_freetype_context_t * ctx = lv_freetype_get_context(); - lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)(font->dsc); - LV_ASSERT_FREETYPE_FONT_DSC(dsc); - - lv_cache_release(ctx->cache_node_cache, dsc->cache_node_entry, NULL); - if(lv_cache_entry_get_ref(dsc->cache_node_entry) == 0) { - lv_cache_drop(ctx->cache_node_cache, dsc->cache_node, NULL); - } - - lv_freetype_drop_face_id(dsc->context, dsc->face_id); - - /* invalidate magic number */ - lv_memzero(dsc, sizeof(lv_freetype_font_dsc_t)); - lv_free(dsc); -} - -lv_freetype_context_t * lv_freetype_get_context(void) -{ - return LV_GLOBAL_DEFAULT()->ft_context; -} - -void lv_freetype_italic_transform(FT_Face face) -{ - LV_ASSERT_NULL(face); - FT_Matrix matrix; - matrix.xx = FT_INT_TO_F16DOT16(1); - matrix.xy = LV_FREETYPE_OBLIQUE_SLANT_DEF; - matrix.yx = 0; - matrix.yy = FT_INT_TO_F16DOT16(1); - FT_Set_Transform(face, &matrix, NULL); -} - -int32_t lv_freetype_italic_transform_on_pos(lv_point_t point) -{ - return point.x + FT_F16DOT16_TO_INT(point.y * LV_FREETYPE_OBLIQUE_SLANT_DEF); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static bool freetype_on_font_create(lv_freetype_font_dsc_t * dsc, uint32_t max_glyph_cnt) -{ - /* - * Glyph info uses a small amount of memory, and uses glyph info more frequently, - * so it plans to use twice the maximum number of caches here to - * get a better info acquisition performance.*/ - lv_cache_t * glyph_cache = lv_freetype_create_glyph_cache(max_glyph_cnt * 2); - if(glyph_cache == NULL) { - LV_LOG_ERROR("glyph cache creating failed"); - return false; - } - dsc->cache_node->glyph_cache = glyph_cache; - - lv_cache_t * draw_data_cache = NULL; - if(dsc->render_mode == LV_FREETYPE_FONT_RENDER_MODE_BITMAP) { - draw_data_cache = lv_freetype_create_draw_data_image(max_glyph_cnt); - } - else if(dsc->render_mode == LV_FREETYPE_FONT_RENDER_MODE_OUTLINE) { - draw_data_cache = lv_freetype_create_draw_data_outline(max_glyph_cnt); - } - else { - LV_LOG_ERROR("unknown render mode"); - return false; - } - - if(draw_data_cache == NULL) { - LV_LOG_ERROR("draw data cache creating failed"); - return false; - } - - dsc->cache_node->draw_data_cache = draw_data_cache; - - return true; -} - -static void freetype_on_font_set_cbs(lv_freetype_font_dsc_t * dsc) -{ - lv_freetype_set_cbs_glyph(dsc); - if(dsc->render_mode == LV_FREETYPE_FONT_RENDER_MODE_BITMAP) { - lv_freetype_set_cbs_image_font(dsc); - } - else if(dsc->render_mode == LV_FREETYPE_FONT_RENDER_MODE_OUTLINE) { - lv_freetype_set_cbs_outline_font(dsc); - } -} - -static void lv_freetype_cleanup(lv_freetype_context_t * ctx) -{ - LV_ASSERT_NULL(ctx); - if(ctx->cache_node_cache) { - lv_cache_destroy(ctx->cache_node_cache, NULL); - ctx->cache_node_cache = NULL; - } - - if(ctx->library) { - FT_Done_FreeType(ctx->library); - ctx->library = NULL; - } -} - -static FTC_FaceID lv_freetype_req_face_id(lv_freetype_context_t * ctx, const char * pathname) -{ - size_t len = lv_strlen(pathname); - LV_ASSERT(len > 0); - - lv_ll_t * ll_p = &ctx->face_id_ll; - face_id_node_t * node; - - /* search cache */ - LV_LL_READ(ll_p, node) { - if(strcmp(node->pathname, pathname) == 0) { - node->ref_cnt++; - LV_LOG_INFO("reuse face_id: %s, ref_cnt = %d", node->pathname, node->ref_cnt); - return node->pathname; - } - } - - /* insert new cache */ - node = lv_ll_ins_tail(ll_p); - LV_ASSERT_MALLOC(node); - -#if LV_USE_FS_MEMFS - if(pathname[0] == LV_FS_MEMFS_LETTER) { -#if !LV_FREETYPE_USE_LVGL_PORT - LV_LOG_WARN("LV_FREETYPE_USE_LVGL_PORT is not enabled"); -#endif - node->pathname = lv_malloc(sizeof(lv_fs_path_ex_t)); - LV_ASSERT_MALLOC(node->pathname); - lv_memcpy(node->pathname, pathname, sizeof(lv_fs_path_ex_t)); - } - else -#endif - { - node->pathname = lv_strdup(pathname); - LV_ASSERT_NULL(node->pathname); - } - - LV_LOG_INFO("add face_id: %s", node->pathname); - - node->ref_cnt = 1; - return node->pathname; -} - -static void lv_freetype_drop_face_id(lv_freetype_context_t * ctx, FTC_FaceID face_id) -{ - lv_ll_t * ll_p = &ctx->face_id_ll; - face_id_node_t * node; - LV_LL_READ(ll_p, node) { - if(face_id == node->pathname) { - LV_LOG_INFO("found face_id: %s, ref_cnt = %d", node->pathname, node->ref_cnt); - node->ref_cnt--; - if(node->ref_cnt == 0) { - LV_LOG_INFO("drop face_id: %s", node->pathname); - lv_ll_remove(ll_p, node); - lv_free(node->pathname); - lv_free(node); - } - return; - } - } - - LV_ASSERT_MSG(false, "face_id not found"); -} - -/*----------------- - * Cache Node Cache Callbacks - *----------------*/ - -static bool cache_node_cache_create_cb(lv_freetype_cache_node_t * node, void * user_data) -{ - LV_UNUSED(user_data); - lv_freetype_context_t * ctx = lv_freetype_get_context(); - - /* Cache miss, load face */ - FT_Face face; - FT_Error error = FT_New_Face(ctx->library, node->pathname, 0, &face); - if(error) { - FT_ERROR_MSG("FT_New_Face", error); - return false; - } - - node->ref_size = LV_FREETYPE_OUTLINE_REF_SIZE_DEF; - - if(node->style & LV_FREETYPE_FONT_STYLE_ITALIC) { - lv_freetype_italic_transform(face); - } - - node->face = face; - lv_mutex_init(&node->face_lock); - - return true; -} -static void cache_node_cache_free_cb(lv_freetype_cache_node_t * node, void * user_data) -{ - FT_Done_Face(node->face); - lv_mutex_delete(&node->face_lock); - - if(node->glyph_cache) { - lv_cache_destroy(node->glyph_cache, user_data); - node->glyph_cache = NULL; - } - if(node->draw_data_cache) { - lv_cache_destroy(node->draw_data_cache, user_data); - node->draw_data_cache = NULL; - } -} -static lv_cache_compare_res_t cache_node_cache_compare_cb(const lv_freetype_cache_node_t * lhs, - const lv_freetype_cache_node_t * rhs) -{ - if(lhs->render_mode != rhs->render_mode) { - return lhs->render_mode > rhs->render_mode ? 1 : -1; - } - if(lhs->style != rhs->style) { - return lhs->style > rhs->style ? 1 : -1; - } - - int32_t cmp_res = lv_strcmp(lhs->pathname, rhs->pathname); - if(cmp_res != 0) { - return cmp_res > 0 ? 1 : -1; - } - - return 0; -} - -#endif /*LV_USE_FREETYPE*/ diff --git a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype.h b/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype.h deleted file mode 100644 index 76b9f7b..0000000 --- a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype.h +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @file lv_freetype.h - * - */ -#ifndef LV_FREETYPE_H -#define LV_FREETYPE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#include "../../misc/lv_types.h" -#include "../../misc/lv_event.h" -#include LV_STDBOOL_INCLUDE - -#if LV_USE_FREETYPE - -/********************* - * DEFINES - *********************/ - -#define LV_FREETYPE_F26DOT6_TO_INT(x) ((x) >> 6) -#define LV_FREETYPE_F26DOT6_TO_FLOAT(x) ((float)(x) / 64) - -#define FT_FONT_STYLE_NORMAL LV_FREETYPE_FONT_STYLE_NORMAL -#define FT_FONT_STYLE_ITALIC LV_FREETYPE_FONT_STYLE_ITALIC -#define FT_FONT_STYLE_BOLD LV_FREETYPE_FONT_STYLE_BOLD - -/********************** - * TYPEDEFS - **********************/ - -typedef enum { - LV_FREETYPE_FONT_STYLE_NORMAL = 0, - LV_FREETYPE_FONT_STYLE_ITALIC = 1 << 0, - LV_FREETYPE_FONT_STYLE_BOLD = 1 << 1, -} lv_freetype_font_style_t; - -typedef lv_freetype_font_style_t LV_FT_FONT_STYLE; - -typedef enum { - LV_FREETYPE_FONT_RENDER_MODE_BITMAP = 0, - LV_FREETYPE_FONT_RENDER_MODE_OUTLINE = 1, -} lv_freetype_font_render_mode_t; - -typedef void * lv_freetype_outline_t; - -typedef enum { - LV_FREETYPE_OUTLINE_END, - LV_FREETYPE_OUTLINE_MOVE_TO, - LV_FREETYPE_OUTLINE_LINE_TO, - LV_FREETYPE_OUTLINE_CUBIC_TO, - LV_FREETYPE_OUTLINE_CONIC_TO, -} lv_freetype_outline_type_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize the freetype library. - * @return LV_RESULT_OK on success, otherwise LV_RESULT_INVALID. - */ -lv_result_t lv_freetype_init(uint32_t max_glyph_cnt); - -/** - * Uninitialize the freetype library - */ -void lv_freetype_uninit(void); - -/** - * Create a freetype font. - * @param pathname font file path. - * @param render_mode font render mode(see @lv_freetype_font_render_mode_t for details). - * @param size font size. - * @param style font style(see lv_freetype_font_style_t for details). - * @return Created font, or NULL on failure. - */ -lv_font_t * lv_freetype_font_create(const char * pathname, lv_freetype_font_render_mode_t render_mode, uint32_t size, - lv_freetype_font_style_t style); - -/** - * Delete a freetype font. - * @param font freetype font to be deleted. - */ -void lv_freetype_font_delete(lv_font_t * font); - -/** - * Register a callback function to generate outlines for FreeType fonts. - * - * @param cb The callback function to be registered. - * @param user_data User data to be passed to the callback function. - * @return The ID of the registered callback function, or a negative value on failure. - */ -void lv_freetype_outline_add_event(lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data); - -/** - * Get the scale of a FreeType font. - * - * @param font The FreeType font to get the scale of. - * @return The scale of the FreeType font. - */ -uint32_t lv_freetype_outline_get_scale(const lv_font_t * font); - -/** - * Check if the font is an outline font. - * - * @param font The FreeType font. - * @return Is outline font on success, otherwise false. - */ -bool lv_freetype_is_outline_font(const lv_font_t * font); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_FREETYPE*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_FREETYPE_H */ diff --git a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_glyph.c b/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_glyph.c deleted file mode 100644 index 7ed2178..0000000 --- a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_glyph.c +++ /dev/null @@ -1,201 +0,0 @@ -/** - * @file lv_freetype_glyph.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../lvgl.h" -#include "lv_freetype_private.h" - -#if LV_USE_FREETYPE - -/********************* - * DEFINES - *********************/ - -#define CACHE_NAME "FREETYPE_GLYPH" - -/********************** - * TYPEDEFS - **********************/ -typedef struct lv_freetype_glyph_cache_data_t { - uint32_t unicode; - uint32_t size; - - lv_font_glyph_dsc_t glyph_dsc; -} lv_freetype_glyph_cache_data_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static bool freetype_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * g_dsc, uint32_t unicode_letter, - uint32_t unicode_letter_next); - -static bool freetype_glyph_create_cb(lv_freetype_glyph_cache_data_t * data, void * user_data); -static void freetype_glyph_free_cb(lv_freetype_glyph_cache_data_t * data, void * user_data); -static lv_cache_compare_res_t freetype_glyph_compare_cb(const lv_freetype_glyph_cache_data_t * lhs, - const lv_freetype_glyph_cache_data_t * rhs); -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_cache_t * lv_freetype_create_glyph_cache(uint32_t cache_size) -{ - lv_cache_ops_t ops = { - .create_cb = (lv_cache_create_cb_t)freetype_glyph_create_cb, - .free_cb = (lv_cache_free_cb_t)freetype_glyph_free_cb, - .compare_cb = (lv_cache_compare_cb_t)freetype_glyph_compare_cb, - }; - - lv_cache_t * glyph_cache = lv_cache_create(&lv_cache_class_lru_rb_count, sizeof(lv_freetype_glyph_cache_data_t), - cache_size, ops); - lv_cache_set_name(glyph_cache, CACHE_NAME); - - return glyph_cache; -} - -void lv_freetype_set_cbs_glyph(lv_freetype_font_dsc_t * dsc) -{ - LV_ASSERT_FREETYPE_FONT_DSC(dsc); - dsc->font.get_glyph_dsc = freetype_get_glyph_dsc_cb; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static bool freetype_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * g_dsc, uint32_t unicode_letter, - uint32_t unicode_letter_next) -{ - LV_ASSERT_NULL(font); - LV_ASSERT_NULL(g_dsc); - - if(unicode_letter < 0x20) { - g_dsc->adv_w = 0; - g_dsc->box_h = 0; - g_dsc->box_w = 0; - g_dsc->ofs_x = 0; - g_dsc->ofs_y = 0; - g_dsc->format = LV_FONT_GLYPH_FORMAT_NONE; - return true; - } - - lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)font->dsc; - LV_ASSERT_FREETYPE_FONT_DSC(dsc); - - lv_freetype_glyph_cache_data_t search_key = { - .unicode = unicode_letter, - .size = dsc->size, - }; - - lv_cache_t * glyph_cache = dsc->cache_node->glyph_cache; - - lv_cache_entry_t * entry = lv_cache_acquire_or_create(glyph_cache, &search_key, dsc); - if(entry == NULL) { - LV_LOG_ERROR("glyph lookup failed for unicode = 0x%" LV_PRIx32, unicode_letter); - return false; - } - lv_freetype_glyph_cache_data_t * data = lv_cache_entry_get_data(entry); - *g_dsc = data->glyph_dsc; - - if((dsc->style & LV_FREETYPE_FONT_STYLE_ITALIC) && (unicode_letter_next == '\0')) { - g_dsc->adv_w = g_dsc->box_w + g_dsc->ofs_x; - } - - g_dsc->entry = NULL; - - lv_cache_release(glyph_cache, entry, NULL); - return true; -} - -/*----------------- - * Cache Callbacks - *----------------*/ - -static bool freetype_glyph_create_cb(lv_freetype_glyph_cache_data_t * data, void * user_data) -{ - lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)user_data; - - FT_Error error; - - lv_font_glyph_dsc_t * dsc_out = &data->glyph_dsc; - - lv_mutex_lock(&dsc->cache_node->face_lock); - FT_Face face = dsc->cache_node->face; - FT_UInt glyph_index = FT_Get_Char_Index(face, data->unicode); - - FT_Set_Pixel_Sizes(face, 0, dsc->size); - error = FT_Load_Glyph(face, glyph_index, FT_LOAD_COMPUTE_METRICS | FT_LOAD_NO_BITMAP | FT_LOAD_NO_AUTOHINT); - if(error) { - FT_ERROR_MSG("FT_Load_Glyph", error); - lv_mutex_unlock(&dsc->cache_node->face_lock); - return false; - } - - FT_GlyphSlot glyph = face->glyph; - - if(dsc->render_mode == LV_FREETYPE_FONT_RENDER_MODE_OUTLINE) { - dsc_out->adv_w = FT_F26DOT6_TO_INT(glyph->metrics.horiAdvance); - dsc_out->box_h = FT_F26DOT6_TO_INT(glyph->metrics.height); /*Height of the bitmap in [px]*/ - dsc_out->box_w = FT_F26DOT6_TO_INT(glyph->metrics.width); /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = FT_F26DOT6_TO_INT(glyph->metrics.horiBearingX); /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = FT_F26DOT6_TO_INT(glyph->metrics.horiBearingY - - glyph->metrics.height); /*Y offset of the bitmap measured from the as line*/ - dsc_out->format = LV_FONT_GLYPH_FORMAT_VECTOR; - - /*Transform the glyph to italic if required*/ - if(dsc->style & LV_FREETYPE_FONT_STYLE_ITALIC) { - dsc_out->box_w = lv_freetype_italic_transform_on_pos((lv_point_t) { - dsc_out->box_w, dsc_out->box_h - }); - } - } - else if(dsc->render_mode == LV_FREETYPE_FONT_RENDER_MODE_BITMAP) { - FT_Bitmap * glyph_bitmap = &face->glyph->bitmap; - - dsc_out->adv_w = FT_F26DOT6_TO_INT(glyph->advance.x); /*Width of the glyph in [pf]*/ - dsc_out->box_h = glyph_bitmap->rows; /*Height of the bitmap in [px]*/ - dsc_out->box_w = glyph_bitmap->width; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = glyph->bitmap_left; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = glyph->bitmap_top - - dsc_out->box_h; /*Y offset of the bitmap measured from the as line*/ - dsc_out->format = LV_FONT_GLYPH_FORMAT_A8; - } - - dsc_out->is_placeholder = glyph_index == 0; - dsc_out->gid.index = (uint32_t)glyph_index; - - lv_mutex_unlock(&dsc->cache_node->face_lock); - - return true; -} -static void freetype_glyph_free_cb(lv_freetype_glyph_cache_data_t * data, void * user_data) -{ - LV_UNUSED(data); - LV_UNUSED(user_data); -} -static lv_cache_compare_res_t freetype_glyph_compare_cb(const lv_freetype_glyph_cache_data_t * lhs, - const lv_freetype_glyph_cache_data_t * rhs) -{ - if(lhs->unicode != rhs->unicode) { - return lhs->unicode > rhs->unicode ? 1 : -1; - } - if(lhs->size != rhs->size) { - return lhs->size > rhs->size ? 1 : -1; - } - return 0; -} - -#endif /*LV_USE_FREETYPE*/ diff --git a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_image.c b/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_image.c deleted file mode 100644 index ab7dad2..0000000 --- a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_image.c +++ /dev/null @@ -1,188 +0,0 @@ -/** - * @file lv_freetype_image.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../lvgl.h" -#include "lv_freetype_private.h" - -#if LV_USE_FREETYPE - -#include "../../core/lv_global.h" - -#define font_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->font_draw_buf_handlers) - -/********************* - * DEFINES - *********************/ - -#define CACHE_NAME "FREETYPE_IMAGE" - -/********************** - * TYPEDEFS - **********************/ - -typedef struct lv_freetype_image_cache_data_t { - FT_UInt glyph_index; - uint32_t size; - - lv_draw_buf_t * draw_buf; -} lv_freetype_image_cache_data_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static const void * freetype_get_glyph_bitmap_cb(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf); - -static bool freetype_image_create_cb(lv_freetype_image_cache_data_t * data, void * user_data); -static void freetype_image_free_cb(lv_freetype_image_cache_data_t * node, void * user_data); -static lv_cache_compare_res_t freetype_image_compare_cb(const lv_freetype_image_cache_data_t * lhs, - const lv_freetype_image_cache_data_t * rhs); - -static void freetype_image_release_cb(const lv_font_t * font, lv_font_glyph_dsc_t * g_dsc); -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_cache_t * lv_freetype_create_draw_data_image(uint32_t cache_size) -{ - lv_cache_ops_t ops = { - .compare_cb = (lv_cache_compare_cb_t)freetype_image_compare_cb, - .create_cb = (lv_cache_create_cb_t)freetype_image_create_cb, - .free_cb = (lv_cache_free_cb_t)freetype_image_free_cb, - }; - - lv_cache_t * draw_data_cache = lv_cache_create(&lv_cache_class_lru_rb_count, sizeof(lv_freetype_image_cache_data_t), - cache_size, ops); - lv_cache_set_name(draw_data_cache, CACHE_NAME); - - return draw_data_cache; -} - -void lv_freetype_set_cbs_image_font(lv_freetype_font_dsc_t * dsc) -{ - LV_ASSERT_FREETYPE_FONT_DSC(dsc); - dsc->font.get_glyph_bitmap = freetype_get_glyph_bitmap_cb; - dsc->font.release_glyph = freetype_image_release_cb; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static const void * freetype_get_glyph_bitmap_cb(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf) -{ - LV_UNUSED(draw_buf); - const lv_font_t * font = g_dsc->resolved_font; - lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)font->dsc; - LV_ASSERT_FREETYPE_FONT_DSC(dsc); - - FT_UInt glyph_index = (FT_UInt)g_dsc->gid.index; - - lv_cache_t * cache = dsc->cache_node->draw_data_cache; - - lv_freetype_image_cache_data_t search_key = { - .glyph_index = glyph_index, - .size = dsc->size, - }; - - lv_cache_entry_t * entry = lv_cache_acquire_or_create(cache, &search_key, dsc); - - g_dsc->entry = entry; - lv_freetype_image_cache_data_t * cache_node = lv_cache_entry_get_data(entry); - - return cache_node->draw_buf; -} - -static void freetype_image_release_cb(const lv_font_t * font, lv_font_glyph_dsc_t * g_dsc) -{ - LV_ASSERT_NULL(font); - lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)font->dsc; - lv_cache_release(dsc->cache_node->draw_data_cache, g_dsc->entry, NULL); - g_dsc->entry = NULL; -} - -/*----------------- - * Cache Callbacks - *----------------*/ - -static bool freetype_image_create_cb(lv_freetype_image_cache_data_t * data, void * user_data) -{ - lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)user_data; - - FT_Error error; - - lv_mutex_lock(&dsc->cache_node->face_lock); - - FT_Face face = dsc->cache_node->face; - FT_Set_Pixel_Sizes(face, 0, dsc->size); - error = FT_Load_Glyph(face, data->glyph_index, FT_LOAD_RENDER | FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_AUTOHINT); - if(error) { - FT_ERROR_MSG("FT_Load_Glyph", error); - lv_mutex_unlock(&dsc->cache_node->face_lock); - return false; - } - error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL); - if(error) { - FT_ERROR_MSG("FT_Render_Glyph", error); - lv_mutex_unlock(&dsc->cache_node->face_lock); - return false; - } - - FT_Glyph glyph; - error = FT_Get_Glyph(face->glyph, &glyph); - if(error) { - FT_ERROR_MSG("FT_Get_Glyph", error); - lv_mutex_unlock(&dsc->cache_node->face_lock); - return false; - } - - FT_BitmapGlyph glyph_bitmap = (FT_BitmapGlyph)glyph; - - uint16_t box_h = glyph_bitmap->bitmap.rows; /*Height of the bitmap in [px]*/ - uint16_t box_w = glyph_bitmap->bitmap.width; /*Width of the bitmap in [px]*/ - - uint32_t stride = lv_draw_buf_width_to_stride(box_w, LV_COLOR_FORMAT_A8); - data->draw_buf = lv_draw_buf_create_ex(font_draw_buf_handlers, box_w, box_h, LV_COLOR_FORMAT_A8, stride); - - for(int y = 0; y < box_h; ++y) { - lv_memcpy((uint8_t *)(data->draw_buf->data) + y * stride, glyph_bitmap->bitmap.buffer + y * box_w, - box_w); - } - - FT_Done_Glyph(glyph); - - lv_mutex_unlock(&dsc->cache_node->face_lock); - - return true; -} -static void freetype_image_free_cb(lv_freetype_image_cache_data_t * data, void * user_data) -{ - LV_UNUSED(user_data); - lv_draw_buf_destroy(data->draw_buf); -} -static lv_cache_compare_res_t freetype_image_compare_cb(const lv_freetype_image_cache_data_t * lhs, - const lv_freetype_image_cache_data_t * rhs) -{ - if(lhs->glyph_index != rhs->glyph_index) { - return lhs->glyph_index > rhs->glyph_index ? 1 : -1; - } - if(lhs->size != rhs->size) { - return lhs->size > rhs->size ? 1 : -1; - } - return 0; -} - -#endif /*LV_USE_FREETYPE*/ diff --git a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_outline.c b/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_outline.c deleted file mode 100644 index 77d40fe..0000000 --- a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_outline.c +++ /dev/null @@ -1,373 +0,0 @@ -/** - * @file lv_freetype_outline.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../misc/lv_event_private.h" -#include "../../lvgl.h" -#include "lv_freetype_private.h" - -#if LV_USE_FREETYPE - -/********************* - * DEFINES - *********************/ - -#define CACHE_NAME "FREETYPE_OUTLINE" - -/********************** - * TYPEDEFS - **********************/ - -typedef struct lv_freetype_outline_node_t { - FT_UInt glyph_index; - lv_freetype_outline_t outline; -} lv_freetype_outline_node_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static lv_freetype_outline_t outline_create(lv_freetype_context_t * ctx, FT_Face face, FT_UInt glyph_index, - uint32_t size, uint32_t strength); -static lv_result_t outline_delete(lv_freetype_context_t * ctx, lv_freetype_outline_t outline); -static const void * freetype_get_glyph_bitmap_cb(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf); -static void freetype_release_glyph_cb(const lv_font_t * font, lv_font_glyph_dsc_t * g_dsc); - -static lv_cache_entry_t * lv_freetype_outline_lookup(lv_freetype_font_dsc_t * dsc, FT_UInt glyph_index); - -/*glyph dsc cache lru callbacks*/ -static bool freetype_glyph_outline_create_cb(lv_freetype_outline_node_t * node, lv_freetype_font_dsc_t * dsc); -static void freetype_glyph_outline_free_cb(lv_freetype_outline_node_t * node, lv_freetype_font_dsc_t * dsc); -static lv_cache_compare_res_t freetype_glyph_outline_cmp_cb(const lv_freetype_outline_node_t * node_a, - const lv_freetype_outline_node_t * node_b); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_cache_t * lv_freetype_create_draw_data_outline(uint32_t cache_size) -{ - lv_cache_ops_t glyph_outline_cache_ops = { - .create_cb = (lv_cache_create_cb_t)freetype_glyph_outline_create_cb, - .free_cb = (lv_cache_free_cb_t)freetype_glyph_outline_free_cb, - .compare_cb = (lv_cache_compare_cb_t)freetype_glyph_outline_cmp_cb, - }; - - lv_cache_t * draw_data_cache = lv_cache_create(&lv_cache_class_lru_rb_count, sizeof(lv_freetype_outline_node_t), - cache_size, - glyph_outline_cache_ops); - lv_cache_set_name(draw_data_cache, CACHE_NAME); - - return draw_data_cache; -} - -void lv_freetype_set_cbs_outline_font(lv_freetype_font_dsc_t * dsc) -{ - LV_ASSERT_FREETYPE_FONT_DSC(dsc); - dsc->font.get_glyph_bitmap = freetype_get_glyph_bitmap_cb; - dsc->font.release_glyph = freetype_release_glyph_cb; -} - -void lv_freetype_outline_add_event(lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data) -{ - LV_UNUSED(user_data); - lv_freetype_context_t * ctx = lv_freetype_get_context(); - - LV_UNUSED(filter); - ctx->event_cb = event_cb; -} - -uint32_t lv_freetype_outline_get_scale(const lv_font_t * font) -{ - LV_ASSERT_NULL(font); - const lv_freetype_font_dsc_t * dsc = font->dsc; - LV_ASSERT_FREETYPE_FONT_DSC(dsc); - - return FT_INT_TO_F26DOT6(dsc->size) / dsc->cache_node->ref_size; -} - -bool lv_freetype_is_outline_font(const lv_font_t * font) -{ - LV_ASSERT_NULL(font); - const lv_freetype_font_dsc_t * dsc = font->dsc; - if(!LV_FREETYPE_FONT_DSC_HAS_MAGIC_NUM(dsc)) { - return false; - } - - return dsc->render_mode == LV_FREETYPE_FONT_RENDER_MODE_OUTLINE; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/*------------------- - * OUTLINE CACHE - *------------------*/ - -static bool freetype_glyph_outline_create_cb(lv_freetype_outline_node_t * node, lv_freetype_font_dsc_t * dsc) -{ - lv_freetype_outline_t outline; - - lv_mutex_lock(&dsc->cache_node->face_lock); - outline = outline_create(dsc->context, - dsc->cache_node->face, - node->glyph_index, - dsc->cache_node->ref_size, - dsc->style & LV_FREETYPE_FONT_STYLE_BOLD ? 1 : 0); - lv_mutex_unlock(&dsc->cache_node->face_lock); - - if(!outline) { - return false; - } - - LV_LOG_INFO("glyph_index = 0x%" LV_PRIx32, (uint32_t)node->glyph_index); - - node->outline = outline; - return true; -} - -static void freetype_glyph_outline_free_cb(lv_freetype_outline_node_t * node, lv_freetype_font_dsc_t * dsc) -{ - LV_UNUSED(dsc); - - lv_freetype_outline_t outline = node->outline; - lv_freetype_context_t * ctx = lv_freetype_get_context(); - outline_delete(ctx, outline); -} - -static lv_cache_compare_res_t freetype_glyph_outline_cmp_cb(const lv_freetype_outline_node_t * node_a, - const lv_freetype_outline_node_t * node_b) -{ - if(node_a->glyph_index == node_b->glyph_index) { - return 0; - } - return node_a->glyph_index > node_b->glyph_index ? 1 : -1; -} - -static const void * freetype_get_glyph_bitmap_cb(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf) -{ - LV_UNUSED(draw_buf); - - const lv_font_t * font = g_dsc->resolved_font; - lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)font->dsc; - LV_ASSERT_FREETYPE_FONT_DSC(dsc); - lv_cache_entry_t * entry = lv_freetype_outline_lookup(dsc, (FT_UInt)g_dsc->gid.index); - if(entry == NULL) { - return NULL; - } - lv_freetype_outline_node_t * node = lv_cache_entry_get_data(entry); - - g_dsc->entry = entry; - - return node ? node->outline : NULL; -} - -static void freetype_release_glyph_cb(const lv_font_t * font, lv_font_glyph_dsc_t * g_dsc) -{ - LV_ASSERT_NULL(font); - lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)font->dsc; - - if(g_dsc->entry == NULL) { - return; - } - lv_cache_release(dsc->cache_node->draw_data_cache, g_dsc->entry, NULL); - g_dsc->entry = NULL; -} - -static lv_cache_entry_t * lv_freetype_outline_lookup(lv_freetype_font_dsc_t * dsc, FT_UInt glyph_index) -{ - lv_freetype_cache_node_t * cache_node = dsc->cache_node; - - lv_freetype_outline_node_t tmp_node; - tmp_node.glyph_index = glyph_index; - - lv_cache_entry_t * entry = lv_cache_acquire_or_create(cache_node->draw_data_cache, &tmp_node, dsc); - if(!entry) { - LV_LOG_ERROR("glyph outline lookup failed for glyph_index = 0x%" LV_PRIx32, (uint32_t)glyph_index); - return NULL; - } - return entry; -} - -static void ft_vector_to_lv_vector(lv_freetype_outline_vector_t * dest, const FT_Vector * src) -{ - dest->x = src ? src->x : 0; - dest->y = src ? src->y : 0; -} - -static lv_result_t outline_send_event(lv_freetype_context_t * ctx, lv_event_code_t code, - lv_freetype_outline_event_param_t * param) -{ - if(!ctx->event_cb) { - LV_LOG_ERROR("event_cb is not set"); - return LV_RESULT_INVALID; - } - - lv_event_t e; - lv_memzero(&e, sizeof(e)); - e.code = code; - e.param = param; - e.user_data = NULL; - - ctx->event_cb(&e); - - return LV_RESULT_OK; -} - -static lv_result_t outline_push_point( - lv_freetype_outline_t outline, - lv_freetype_outline_type_t type, - const FT_Vector * control1, - const FT_Vector * control2, - const FT_Vector * to) -{ - lv_freetype_context_t * ctx = lv_freetype_get_context(); - - lv_freetype_outline_event_param_t param; - lv_memzero(¶m, sizeof(param)); - param.outline = outline; - param.type = type; - ft_vector_to_lv_vector(¶m.control1, control1); - ft_vector_to_lv_vector(¶m.control2, control2); - ft_vector_to_lv_vector(¶m.to, to); - - return outline_send_event(ctx, LV_EVENT_INSERT, ¶m); -} - -static int outline_move_to_cb( - const FT_Vector * to, - void * user) -{ - lv_freetype_outline_t outline = user; - outline_push_point(outline, LV_FREETYPE_OUTLINE_MOVE_TO, NULL, NULL, to); - return FT_Err_Ok; -} - -static int outline_line_to_cb( - const FT_Vector * to, - void * user) -{ - lv_freetype_outline_t outline = user; - outline_push_point(outline, LV_FREETYPE_OUTLINE_LINE_TO, NULL, NULL, to); - return FT_Err_Ok; -} - -static int outline_conic_to_cb( - const FT_Vector * control, - const FT_Vector * to, - void * user) -{ - lv_freetype_outline_t outline = user; - outline_push_point(outline, LV_FREETYPE_OUTLINE_CONIC_TO, control, NULL, to); - return FT_Err_Ok; -} - -static int outline_cubic_to_cb( - const FT_Vector * control1, - const FT_Vector * control2, - const FT_Vector * to, - void * user) -{ - lv_freetype_outline_t outline = user; - outline_push_point(outline, LV_FREETYPE_OUTLINE_CUBIC_TO, control1, control2, to); - return FT_Err_Ok; -} - -static lv_freetype_outline_t outline_create( - lv_freetype_context_t * ctx, - FT_Face face, - FT_UInt glyph_index, - uint32_t size, - uint32_t strength) -{ - LV_ASSERT_NULL(ctx); - FT_Error error; - - error = FT_Set_Pixel_Sizes(face, 0, size); - if(error) { - FT_ERROR_MSG("FT_Set_Char_Size", error); - return NULL; - } - - /** - * Disable AUTOHINT(https://freetype.org/autohinting/hinter.html) to avoid display clipping - * caused by inconsistent glyph measurement and outline. - */ - error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT | FT_LOAD_NO_BITMAP | FT_LOAD_NO_AUTOHINT); - if(error) { - FT_ERROR_MSG("FT_Load_Glyph", error); - return NULL; - } - - if(strength > 0) { - error = FT_Outline_Embolden(&face->glyph->outline, FT_INT_TO_F26DOT6(strength)); - if(error) { - FT_ERROR_MSG("FT_Outline_Embolden", error); - } - } - - lv_result_t res; - lv_freetype_outline_event_param_t param; - - lv_memzero(¶m, sizeof(param)); - res = outline_send_event(ctx, LV_EVENT_CREATE, ¶m); - - lv_freetype_outline_t outline = param.outline; - - if(res != LV_RESULT_OK || !outline) { - LV_LOG_ERROR("Outline object create failed"); - return NULL; - } - - FT_Outline_Funcs outline_funcs = { - .move_to = outline_move_to_cb, - .line_to = outline_line_to_cb, - .conic_to = outline_conic_to_cb, - .cubic_to = outline_cubic_to_cb, - .shift = 0, - .delta = 0 - }; - - /* Run outline decompose again to fill outline data */ - error = FT_Outline_Decompose(&face->glyph->outline, &outline_funcs, outline); - if(error) { - FT_ERROR_MSG("FT_Outline_Decompose", error); - outline_delete(ctx, outline); - return NULL; - } - - /* close outline */ - res = outline_push_point(outline, LV_FREETYPE_OUTLINE_END, NULL, NULL, NULL); - if(res != LV_RESULT_OK) { - LV_LOG_ERROR("Outline object close failed"); - outline_delete(ctx, outline); - return NULL; - } - - return outline; -} - -static lv_result_t outline_delete(lv_freetype_context_t * ctx, lv_freetype_outline_t outline) -{ - lv_freetype_outline_event_param_t param; - lv_memzero(¶m, sizeof(param)); - param.outline = outline; - - return outline_send_event(ctx, LV_EVENT_DELETE, ¶m); -} - -#endif /*LV_USE_FREETYPE*/ diff --git a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_private.h b/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_private.h deleted file mode 100644 index 7644101..0000000 --- a/L3_Middlewares/LVGL/src/libs/freetype/lv_freetype_private.h +++ /dev/null @@ -1,151 +0,0 @@ -/** - * @file lv_freetype_private.h - * - */ - -#ifndef LV_FREETYPE_PRIVATE_H -#define LV_FREETYPE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_freetype.h" -#include "../../misc/cache/lv_cache.h" -#include "../../misc/lv_ll.h" -#include "../../font/lv_font.h" - -#if LV_USE_FREETYPE - -#include "ft2build.h" -#include FT_FREETYPE_H -#include FT_GLYPH_H -#include FT_CACHE_H -#include FT_SIZES_H -#include FT_IMAGE_H -#include FT_OUTLINE_H - -/********************* - * DEFINES - *********************/ - -#ifdef FT_CONFIG_OPTION_ERROR_STRINGS -#define FT_ERROR_MSG(msg, error_code) \ - LV_LOG_ERROR(msg " error(0x%x): %s", (int)error_code, FT_Error_String(error_code)) -#else -#define FT_ERROR_MSG(msg, error_code) \ - LV_LOG_ERROR(msg " error(0x%x)", (int)error_code) -#endif - -#define LV_FREETYPE_FONT_DSC_MAGIC_NUM 0x5F5F4654 /* '__FT' */ -#define LV_FREETYPE_FONT_DSC_HAS_MAGIC_NUM(dsc) ((dsc)->magic_num == LV_FREETYPE_FONT_DSC_MAGIC_NUM) -#define LV_ASSERT_FREETYPE_FONT_DSC(dsc) \ - do { \ - LV_ASSERT_NULL(dsc); \ - LV_ASSERT_FORMAT_MSG(LV_FREETYPE_FONT_DSC_HAS_MAGIC_NUM(dsc), \ - "Invalid font descriptor: 0x%" LV_PRIx32, (dsc)->magic_num); \ - } while (0) - -#define FT_INT_TO_F26DOT6(x) ((x) << 6) -#define FT_F26DOT6_TO_INT(x) ((x) >> 6) - -#define FT_INT_TO_F16DOT16(x) ((x) << 16) -#define FT_F16DOT16_TO_INT(x) ((x) >> 16) - -/********************** - * TYPEDEFS - **********************/ - -struct lv_freetype_outline_vector_t { - int32_t x; - int32_t y; -}; - -struct lv_freetype_outline_event_param_t { - lv_freetype_outline_t outline; - lv_freetype_outline_type_t type; - lv_freetype_outline_vector_t to; - lv_freetype_outline_vector_t control1; - lv_freetype_outline_vector_t control2; -}; - - -typedef struct lv_freetype_cache_node_t lv_freetype_cache_node_t; - -struct lv_freetype_cache_node_t { - const char * pathname; - lv_freetype_font_style_t style; - lv_freetype_font_render_mode_t render_mode; - - uint32_t ref_size; /**< Reference size for calculating outline glyph's real size.*/ - - FT_Face face; - lv_mutex_t face_lock; - - /*glyph cache*/ - lv_cache_t * glyph_cache; - - /*draw data cache*/ - lv_cache_t * draw_data_cache; -}; - -typedef struct lv_freetype_context_t { - FT_Library library; - lv_ll_t face_id_ll; - lv_event_cb_t event_cb; - - uint32_t max_glyph_cnt; - - lv_cache_t * cache_node_cache; -} lv_freetype_context_t; - -typedef struct lv_freetype_font_dsc_t { - uint32_t magic_num; - lv_font_t font; - uint32_t size; - lv_freetype_font_style_t style; - lv_freetype_font_render_mode_t render_mode; - lv_freetype_context_t * context; - lv_freetype_cache_node_t * cache_node; - lv_cache_entry_t * cache_node_entry; - FTC_FaceID face_id; -} lv_freetype_font_dsc_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Get the FreeType context. - * - * @return A pointer to the FreeType context used by LittlevGL. - */ -lv_freetype_context_t * lv_freetype_get_context(void); - -void lv_freetype_italic_transform(FT_Face face); -int32_t lv_freetype_italic_transform_on_pos(lv_point_t point); - -lv_cache_t * lv_freetype_create_glyph_cache(uint32_t cache_size); -void lv_freetype_set_cbs_glyph(lv_freetype_font_dsc_t * dsc); - -lv_cache_t * lv_freetype_create_draw_data_image(uint32_t cache_size); -void lv_freetype_set_cbs_image_font(lv_freetype_font_dsc_t * dsc); - -lv_cache_t * lv_freetype_create_draw_data_outline(uint32_t cache_size); -void lv_freetype_set_cbs_outline_font(lv_freetype_font_dsc_t * dsc); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_FREETYPE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_FREETYPE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/freetype/lv_ftsystem.c b/L3_Middlewares/LVGL/src/libs/freetype/lv_ftsystem.c deleted file mode 100644 index ee0e836..0000000 --- a/L3_Middlewares/LVGL/src/libs/freetype/lv_ftsystem.c +++ /dev/null @@ -1,291 +0,0 @@ -/** - * @file lv_ftsystem.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../../lvgl.h" -#if LV_USE_FREETYPE && LV_FREETYPE_USE_LVGL_PORT - -#include -#include FT_CONFIG_CONFIG_H -#include -#include -#include -#include -#include - -/********************* - * DEFINES - *********************/ - -/* The macro FT_COMPONENT is used in trace mode. It is an implicit - * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log - * messages during execution. - */ -#undef FT_COMPONENT -#define FT_COMPONENT io - -/* We use the macro STREAM_FILE for convenience to extract the */ -/* system-specific stream handle from a given FreeType stream object */ -#define STREAM_FILE( stream ) ( (lv_fs_file_t*)stream->descriptor.pointer ) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -FT_CALLBACK_DEF(unsigned long) -ft_lv_fs_stream_io(FT_Stream stream, - unsigned long offset, - unsigned char * buffer, - unsigned long count); -FT_CALLBACK_DEF(void) -ft_lv_fs_stream_close(FT_Stream stream); -FT_CALLBACK_DEF(void *) -ft_alloc(FT_Memory memory, - long size); -FT_CALLBACK_DEF(void *) -ft_realloc(FT_Memory memory, - long cur_size, - long new_size, - void * block); -FT_CALLBACK_DEF(void) -ft_free(FT_Memory memory, - void * block); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef FT_DEBUG_MEMORY - - extern FT_Int - ft_mem_debug_init(FT_Memory memory); - - extern void - ft_mem_debug_done(FT_Memory memory); - -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT - -/* documentation is in ftstream.h */ - -FT_BASE_DEF(FT_Error) -FT_Stream_Open(FT_Stream stream, - const char * filepathname) -{ - lv_fs_file_t file; - - if(!stream) - return FT_THROW(Invalid_Stream_Handle); - - stream->descriptor.pointer = NULL; - stream->pathname.pointer = (char *)filepathname; - stream->base = NULL; - stream->pos = 0; - stream->read = NULL; - stream->close = NULL; - - lv_fs_res_t res = lv_fs_open(&file, filepathname, LV_FS_MODE_RD); - - if(res != LV_FS_RES_OK) { - FT_ERROR(("FT_Stream_Open:" - " could not open `%s'\n", filepathname)); - - return FT_THROW(Cannot_Open_Resource); - } - - lv_fs_seek(&file, 0, LV_FS_SEEK_END); - - uint32_t pos; - res = lv_fs_tell(&file, &pos); - if(res != LV_FS_RES_OK) { - FT_ERROR(("FT_Stream_Open:")); - FT_ERROR((" opened `%s' but zero-sized\n", filepathname)); - lv_fs_close(&file); - return FT_THROW(Cannot_Open_Stream); - } - stream->size = pos; - lv_fs_seek(&file, 0, LV_FS_SEEK_SET); - - lv_fs_file_t * file_p = lv_malloc(sizeof(lv_fs_file_t)); - LV_ASSERT_MALLOC(file_p); - - if(!file_p) { - FT_ERROR(("FT_Stream_Open: malloc failed for file_p")); - lv_fs_close(&file); - return FT_THROW(Cannot_Open_Stream); - } - - *file_p = file; - - stream->descriptor.pointer = file_p; - stream->read = ft_lv_fs_stream_io; - stream->close = ft_lv_fs_stream_close; - - FT_TRACE1(("FT_Stream_Open:")); - FT_TRACE1((" opened `%s' (%ld bytes) successfully\n", - filepathname, stream->size)); - - return FT_Err_Ok; -} - -#endif /* !FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ - -/* documentation is in ftobjs.h */ - -FT_BASE_DEF(FT_Memory) -FT_New_Memory(void) -{ - FT_Memory memory; - - memory = (FT_Memory)lv_malloc(sizeof(*memory)); - if(memory) { - memory->user = NULL; - memory->alloc = ft_alloc; - memory->realloc = ft_realloc; - memory->free = ft_free; -#ifdef FT_DEBUG_MEMORY - ft_mem_debug_init(memory); -#endif - } - - return memory; -} - -/* documentation is in ftobjs.h */ - -FT_BASE_DEF(void) -FT_Done_Memory(FT_Memory memory) -{ -#ifdef FT_DEBUG_MEMORY - ft_mem_debug_done(memory); -#endif - lv_free(memory); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * The memory allocation function. - * @param memory A pointer to the memory object. - * @param size The requested size in bytes. - * @return The address of newly allocated block. - */ -FT_CALLBACK_DEF(void *) -ft_alloc(FT_Memory memory, - long size) -{ - FT_UNUSED(memory); - - return lv_malloc((size_t)size); -} - -/** - * The memory reallocation function. - * @param memory A pointer to the memory object. - * @param cur_size The current size of the allocated memory block. - * @param new_size The newly requested size in bytes. - * @param block The current address of the block in memory. - * @return The address of the reallocated memory block. - */ -FT_CALLBACK_DEF(void *) -ft_realloc(FT_Memory memory, - long cur_size, - long new_size, - void * block) -{ - FT_UNUSED(memory); - FT_UNUSED(cur_size); - - return lv_realloc(block, (size_t)new_size); -} - -/** - * The memory release function. - * @param memory A pointer to the memory object. - * @param block The address of block in memory to be freed. - */ -FT_CALLBACK_DEF(void) -ft_free(FT_Memory memory, - void * block) -{ - FT_UNUSED(memory); - - lv_free(block); -} - -#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT - -/** - * The function to close a stream. - * @param stream A pointer to the stream object. - */ -FT_CALLBACK_DEF(void) -ft_lv_fs_stream_close(FT_Stream stream) -{ - lv_fs_file_t * file_p = STREAM_FILE(stream); - lv_fs_close(file_p); - lv_free(file_p); - - stream->descriptor.pointer = NULL; - stream->size = 0; - stream->base = NULL; -} - -/** - * The function to open a stream. - * @param stream A pointer to the stream object. - * @param offset The position in the data stream to start reading. - * @param buffer The address of buffer to store the read data. - * @param count The number of bytes to read from the stream. - * @return The number of bytes actually read. If `count' is zero (this is, - * the function is used for seeking), a non-zero return value - * indicates an error. - */ -FT_CALLBACK_DEF(unsigned long) -ft_lv_fs_stream_io(FT_Stream stream, - unsigned long offset, - unsigned char * buffer, - unsigned long count) -{ - lv_fs_file_t * file_p; - - if(!count && offset > stream->size) - return 1; - - file_p = STREAM_FILE(stream); - - if(stream->pos != offset) - lv_fs_seek(file_p, (long)offset, LV_FS_SEEK_SET); - - if(count == 0) - return 0; - - uint32_t br; - lv_fs_res_t res = lv_fs_read(file_p, buffer, count, &br); - - return res == LV_FS_RES_OK ? br : 0; -} - -#endif /* !FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ - -#endif/*LV_FREETYPE_USE_LV_FTSYSTEM*/ diff --git a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_arduino_esp_littlefs.cpp b/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_arduino_esp_littlefs.cpp deleted file mode 100644 index cd8df4c..0000000 --- a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_arduino_esp_littlefs.cpp +++ /dev/null @@ -1,201 +0,0 @@ -#include "../../../lvgl.h" -#if LV_USE_FS_ARDUINO_ESP_LITTLEFS - -#include "../../core/lv_global.h" -#include "LittleFS.h" - -#if LV_FS_ARDUINO_ESP_LITTLEFS_LETTER == '\0' - #error "LV_FS_ARDUINO_ESP_LITTLEFS_LETTER must be set to a valid value" -#else - #if (LV_FS_ARDUINO_ESP_LITTLEFS_LETTER < 'A') || (LV_FS_ARDUINO_ESP_LITTLEFS_LETTER > 'Z') - #if LV_FS_DEFAULT_DRIVE_LETTER != '\0' /*When using default drive letter, strict format (X:) is mandatory*/ - #error "LV_FS_ARDUINO_ESP_LITTLEFS_LETTER must be an upper case ASCII letter" - #else /*Lean rules for backward compatibility*/ - #warning LV_FS_ARDUINO_ESP_LITTLEFS_LETTER should be an upper case ASCII letter. \ - Using a slash symbol as drive letter should be replaced with LV_FS_DEFAULT_DRIVE_LETTER mechanism - #endif - #endif -#endif - -typedef struct ArduinoEspLittleFile { - File file; -} ArduinoEspLittleFile; - -/********************** - * STATIC PROTOTYPES - **********************/ -static void fs_init(void); -static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode); -static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p); -static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br); -static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw); -static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); -static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); - -/** - * Register a driver for the LittleFS File System interface - */ -extern "C" void lv_fs_arduino_esp_littlefs_init(void) -{ - fs_init(); - - lv_fs_drv_t * fs_drv = &(LV_GLOBAL_DEFAULT()->arduino_esp_littlefs_fs_drv); - lv_fs_drv_init(fs_drv); - - fs_drv->letter = LV_FS_ARDUINO_ESP_LITTLEFS_LETTER; - fs_drv->open_cb = fs_open; - fs_drv->close_cb = fs_close; - fs_drv->read_cb = fs_read; - fs_drv->write_cb = fs_write; - fs_drv->seek_cb = fs_seek; - fs_drv->tell_cb = fs_tell; - - fs_drv->dir_close_cb = NULL; - fs_drv->dir_open_cb = NULL; - fs_drv->dir_read_cb = NULL; - - lv_fs_drv_register(fs_drv); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/*Initialize your Storage device and File system.*/ -static void fs_init(void) -{ - LittleFS.begin(); -} - -/** - * Open a file - * @param drv pointer to a driver where this function belongs - * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) - * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR - * @return a file descriptor or NULL on error - */ -static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) -{ - LV_UNUSED(drv); - - const char * flags; - if(mode == LV_FS_MODE_WR) - flags = FILE_WRITE; - else if(mode == LV_FS_MODE_RD) - flags = FILE_READ; - else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD)) - flags = FILE_WRITE; - - File file = LittleFS.open(path, flags); - if(!file) { - return NULL; - } - - ArduinoEspLittleFile * lf = new ArduinoEspLittleFile{file}; - - return (void *)lf; -} - -/** - * Close an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable. (opened with fs_open) - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p) -{ - LV_UNUSED(drv); - ArduinoEspLittleFile * lf = (ArduinoEspLittleFile *)file_p; - lf->file.close(); - delete lf; - - return LV_FS_RES_OK; -} - -/** - * Read data from an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable. - * @param buf pointer to a memory block where to store the read data - * @param btr number of Bytes To Read - * @param br the real number of read bytes (Byte Read) - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br) -{ - LV_UNUSED(drv); - ArduinoEspLittleFile * lf = (ArduinoEspLittleFile *)file_p; - *br = lf->file.read((uint8_t *)buf, btr); - - return (int32_t)(*br) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -/** - * Write into a file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable - * @param buf pointer to a buffer with the bytes to write - * @param btw Bytes To Write - * @param bw the number of real written bytes (Bytes Written) - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw) -{ - LV_UNUSED(drv); - ArduinoEspLittleFile * lf = (ArduinoEspLittleFile *)file_p; - *bw = lf->file.write((uint8_t *)buf, btw); - - return (int32_t)(*bw) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -/** - * Set the read write pointer. Also expand the file size if necessary. - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable. (opened with fs_open ) - * @param pos the new position of read write pointer - * @param whence tells from where to interpret the `pos`. See @lv_fs_whence_t - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence) -{ - LV_UNUSED(drv); - SeekMode mode; - if(whence == LV_FS_SEEK_SET) - mode = SeekSet; - else if(whence == LV_FS_SEEK_CUR) - mode = SeekCur; - else if(whence == LV_FS_SEEK_END) - mode = SeekEnd; - - ArduinoEspLittleFile * lf = (ArduinoEspLittleFile *)file_p; - - int rc = lf->file.seek(pos, mode); - - return rc < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -/** - * Give the position of the read write pointer - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_p variable - * @param pos_p pointer to store the result - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) -{ - LV_UNUSED(drv); - ArduinoEspLittleFile * lf = (ArduinoEspLittleFile *)file_p; - - *pos_p = lf->file.position(); - - return (int32_t)(*pos_p) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -#else /*LV_USE_FS_ARDUINO_ESP_LITTLEFS == 0*/ - -#if defined(LV_FS_ARDUINO_ESP_LITTLEFS_LETTER) && LV_FS_ARDUINO_ESP_LITTLEFS_LETTER != '\0' - #warning "LV_USE_FS_ARDUINO_ESP_LITTLEFS is not enabled but LV_FS_ARDUINO_ESP_LITTLEFS_LETTER is set" -#endif - -#endif /*LV_USE_FS_ARDUINO_ESP_LITTLEFS*/ - diff --git a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_arduino_sd.cpp b/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_arduino_sd.cpp deleted file mode 100644 index 14941ac..0000000 --- a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_arduino_sd.cpp +++ /dev/null @@ -1,192 +0,0 @@ -#include "../../../lvgl.h" -#if LV_USE_FS_ARDUINO_SD - -#include "../../core/lv_global.h" -#include -#include "SD.h" - -#if LV_FS_ARDUINO_SD_LETTER == '\0' - #error "LV_FS_ARDUINO_SD_LETTER must be set to a valid value" -#else - #if (LV_FS_ARDUINO_SD_LETTER < 'A') || (LV_FS_ARDUINO_SD_LETTER > 'Z') - #if LV_FS_DEFAULT_DRIVE_LETTER != '\0' /*When using default drive letter, strict format (X:) is mandatory*/ - #error "LV_FS_ARDUINO_SD_LETTER must be an upper case ASCII letter" - #else /*Lean rules for backward compatibility*/ - #warning LV_FS_ARDUINO_SD_LETTER should be an upper case ASCII letter. \ - Using a slash symbol as drive letter should be replaced with LV_FS_DEFAULT_DRIVE_LETTER mechanism - #endif - #endif -#endif - -typedef struct SdFile { - File file; -} SdFile; - -/********************** - * STATIC PROTOTYPES - **********************/ -static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode); -static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p); -static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br); -static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw); -static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); -static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); - -/** - * Register a driver for the SD File System interface - */ -extern "C" void lv_fs_arduino_sd_init(void) -{ - lv_fs_drv_t * fs_drv = &(LV_GLOBAL_DEFAULT()->arduino_sd_fs_drv); - lv_fs_drv_init(fs_drv); - - fs_drv->letter = LV_FS_ARDUINO_SD_LETTER; - fs_drv->open_cb = fs_open; - fs_drv->close_cb = fs_close; - fs_drv->read_cb = fs_read; - fs_drv->write_cb = fs_write; - fs_drv->seek_cb = fs_seek; - fs_drv->tell_cb = fs_tell; - - fs_drv->dir_close_cb = NULL; - fs_drv->dir_open_cb = NULL; - fs_drv->dir_read_cb = NULL; - - lv_fs_drv_register(fs_drv); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Open a file - * @param drv pointer to a driver where this function belongs - * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) - * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR - * @return a file descriptor or NULL on error - */ -static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) -{ - LV_UNUSED(drv); - - const char * flags; - if(mode == LV_FS_MODE_WR) - flags = FILE_WRITE; - else if(mode == LV_FS_MODE_RD) - flags = FILE_READ; - else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD)) - flags = FILE_WRITE; - - File file = SD.open(path, flags); - if(!file) { - return NULL; - } - - SdFile * lf = new SdFile{file}; - - return (void *)lf; -} - -/** - * Close an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable. (opened with fs_open) - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p) -{ - LV_UNUSED(drv); - SdFile * lf = (SdFile *)file_p; - lf->file.close(); - delete lf; - - return LV_FS_RES_OK; -} - -/** - * Read data from an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable. - * @param buf pointer to a memory block where to store the read data - * @param btr number of Bytes To Read - * @param br the real number of read bytes (Byte Read) - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br) -{ - LV_UNUSED(drv); - SdFile * lf = (SdFile *)file_p; - *br = lf->file.read((uint8_t *)buf, btr); - - return (int32_t)(*br) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -/** - * Write into a file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable - * @param buf pointer to a buffer with the bytes to write - * @param btw Bytes To Write - * @param bw the number of real written bytes (Bytes Written) - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw) -{ - LV_UNUSED(drv); - SdFile * lf = (SdFile *)file_p; - *bw = lf->file.write((uint8_t *)buf, btw); - - return (int32_t)(*bw) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -/** - * Set the read write pointer. Also expand the file size if necessary. - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable. (opened with fs_open ) - * @param pos the new position of read write pointer - * @param whence tells from where to interpret the `pos`. See @lv_fs_whence_t - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence) -{ - LV_UNUSED(drv); - SeekMode mode; - if(whence == LV_FS_SEEK_SET) - mode = SeekSet; - else if(whence == LV_FS_SEEK_CUR) - mode = SeekCur; - else if(whence == LV_FS_SEEK_END) - mode = SeekEnd; - - SdFile * lf = (SdFile *)file_p; - - int rc = lf->file.seek(pos, mode); - - return rc < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -/** - * Give the position of the read write pointer - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_p variable - * @param pos_p pointer to store the result - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) -{ - LV_UNUSED(drv); - SdFile * lf = (SdFile *)file_p; - - *pos_p = lf->file.position(); - - return (int32_t)(*pos_p) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -#else /*LV_USE_FS_ARDUINO_SD == 0*/ - -#if defined(LV_FS_ARDUINO_SD_LETTER) && LV_FS_ARDUINO_SD_LETTER != '\0' - #warning "LV_USE_FS_ARDUINO_SD is not enabled but LV_FS_ARDUINO_SD_LETTER is set" -#endif - -#endif /*LV_USE_FS_ARDUINO_SD*/ diff --git a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_cbfs.c b/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_cbfs.c deleted file mode 100644 index 6f1245b..0000000 --- a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_cbfs.c +++ /dev/null @@ -1,10 +0,0 @@ -// this file should not exist -#ifdef __GNUC__ - #define IS_NOT_USED __attribute__ ((unused)) -#else - #define IS_NOT_USED -#endif -IS_NOT_USED static void nothing(void) -{ - // do nothing -} diff --git a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_littlefs.c b/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_littlefs.c deleted file mode 100644 index 490c6fe..0000000 --- a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_littlefs.c +++ /dev/null @@ -1,286 +0,0 @@ -#include "../../../lvgl.h" -#if LV_USE_FS_LITTLEFS - -#include "lfs.h" -#include "../../core/lv_global.h" - -#if LV_FS_LITTLEFS_LETTER == '\0' - #error "LV_FS_LITTLEFS_LETTER must be set to a valid value" -#else - #if (LV_FS_LITTLEFS_LETTER < 'A') || (LV_FS_LITTLEFS_LETTER > 'Z') - #if LV_FS_DEFAULT_DRIVE_LETTER != '\0' /*When using default drive letter, strict format (X:) is mandatory*/ - #error "LV_FS_LITTLEFS_LETTER must be an upper case ASCII letter" - #else /*Lean rules for backward compatibility*/ - #warning LV_FS_LITTLEFS_LETTER should be an upper case ASCII letter. \ - Using a slash symbol as drive letter should be replaced with LV_FS_DEFAULT_DRIVE_LETTER mechanism - #endif - #endif -#endif - -typedef struct LittleFile { - lfs_file_t file; -} LittleFile; - -typedef struct LittleDirectory { - lfs_dir_t dir; -} LittleDirectory; - -/********************** - * STATIC PROTOTYPES - **********************/ -static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode); -static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p); -static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br); -static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw); -static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); -static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); -static void * fs_dir_open(lv_fs_drv_t * drv, const char * path); -static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p); -static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint32_t fn_len); - -void lv_littlefs_set_handler(lfs_t * lfs) -{ - lv_fs_drv_t * drv = lv_fs_get_drv(LV_FS_LITTLEFS_LETTER); - drv->user_data = lfs; -} - -/** - * Register a driver for the LittleFS File System interface - */ -void lv_fs_littlefs_init(void) -{ - lv_fs_drv_t * fs_drv = &(LV_GLOBAL_DEFAULT()->littlefs_fs_drv); - lv_fs_drv_init(fs_drv); - - fs_drv->letter = LV_FS_LITTLEFS_LETTER; - fs_drv->open_cb = fs_open; - fs_drv->close_cb = fs_close; - fs_drv->read_cb = fs_read; - fs_drv->write_cb = fs_write; - fs_drv->seek_cb = fs_seek; - fs_drv->tell_cb = fs_tell; - - fs_drv->dir_open_cb = fs_dir_open; - fs_drv->dir_close_cb = fs_dir_close; - fs_drv->dir_read_cb = fs_dir_read; - - lv_fs_drv_register(fs_drv); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Open a file - * @param drv pointer to a driver where this function belongs - * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) - * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR - * @return a file descriptor or NULL on error - */ -static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) -{ - int flags = 0; - if(mode == LV_FS_MODE_WR) - flags = LFS_O_WRONLY; - else if(mode == LV_FS_MODE_RD) - flags = LFS_O_RDONLY; - else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD)) - flags = LFS_O_RDWR; - - LittleFile * lf = lv_malloc(sizeof(LittleFile)); - LV_ASSERT_MALLOC(lf); - - lfs_t * lfs = drv->user_data; - int err = lfs_file_open(lfs, &lf->file, path, flags); - if(err) { - return NULL; - } - - return (void *)lf; -} - -/** - * Close an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable. (opened with fs_open) - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p) -{ - LittleFile * lf = file_p; - - lfs_t * lfs = drv->user_data; - lfs_file_close(lfs, &lf->file); - lv_free(lf); - - return LV_FS_RES_OK; -} - -/** - * Read data from an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable. - * @param buf pointer to a memory block where to store the read data - * @param btr number of Bytes To Read - * @param br the real number of read bytes (Byte Read) - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br) -{ - LittleFile * lf = file_p; - - lfs_t * lfs = drv->user_data; - *br = lfs_file_read(lfs, &lf->file, (uint8_t *)buf, btr); - - return (int32_t)(*br) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -/** - * Write into a file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable - * @param buf pointer to a buffer with the bytes to write - * @param btw Bytes To Write - * @param bw the number of real written bytes (Bytes Written) - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw) -{ - LittleFile * lf = file_p; - - lfs_t * lfs = drv->user_data; - *bw = lfs_file_write(lfs, &lf->file, (uint8_t *)buf, btw); - - return (int32_t)(*bw) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -/** - * Set the read write pointer. Also expand the file size if necessary. - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_t variable. (opened with fs_open) - * @param pos the new position of read write pointer - * @param whence tells from where to interpret the `pos`. See @lv_fs_whence_t - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence) -{ - int mode = 0; - if(whence == LV_FS_SEEK_SET) - mode = LFS_SEEK_SET; - else if(whence == LV_FS_SEEK_CUR) - mode = LFS_SEEK_CUR; - else if(whence == LV_FS_SEEK_END) - mode = LFS_SEEK_END; - - LittleFile * lf = file_p; - - lfs_t * lfs = drv->user_data; - int rc = lfs_file_seek(lfs, &lf->file, pos, mode); - - return rc < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -/** - * Give the position of the read write pointer - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a file_p variable - * @param pos_p pointer to store the result - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) -{ - LittleFile * lf = file_p; - - lfs_t * lfs = drv->user_data; - *pos_p = lfs_file_tell(lfs, &lf->file); - - return (int32_t)(*pos_p) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK; -} - -/** - * Open a directory - * @param drv pointer to a driver where this function belongs - * @param path path to the directory beginning with the driver letter (e.g. S:/folder) - * @return a directory descriptor or NULL on error - */ -static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) -{ - LittleDirectory * ld = lv_malloc(sizeof(LittleDirectory)); - LV_ASSERT_MALLOC(ld); - - lfs_t * lfs = drv->user_data; - int err = lfs_dir_open(lfs, &ld->dir, path); - if(err != LFS_ERR_OK) { - lv_free(ld); - return NULL; - } - - return (void *)ld; -} - -/** - * Close an opened directory - * @param drv pointer to a driver where this function belongs - * @param dir_p pointer to a dir_p variable. (opened with fs_dir_open) - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p) -{ - LittleDirectory * ld = dir_p; - - lfs_t * lfs = drv->user_data; - int rc = lfs_dir_close(lfs, &ld->dir); - - if(rc < 0) return LV_FS_RES_UNKNOWN; - lv_free(ld); - - return LV_FS_RES_OK; -} - -/** - * Read data from an opened directory - * @param drv pointer to a driver where this function belongs - * @param dir_p pointer to a file_t variable. - * @param fn pointer to a buffer to store the filename - * @param fn_len length of the buffer to store the filename - * @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum - */ -static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint32_t fn_len) -{ - if(fn_len == 0) return LV_FS_RES_INV_PARAM; - - LittleDirectory * lf = dir_p; - - lfs_t * lfs = drv->user_data; - - fn[0] = '\0'; - do { - struct lfs_info info; - int res = lfs_dir_read(lfs, &lf->dir, &info); - - if(res < 0) return LV_FS_RES_UNKNOWN; - if(res == 0) { /* End of the directory */ - fn[0] = '\0'; - break; - } - - if(info.type != LFS_TYPE_DIR) { - lv_strlcpy(fn, info.name, fn_len); - } - else { - lv_snprintf(fn, fn_len, "/%s", info.name); - } - - } while(lv_strcmp(fn, "/.") == 0 || lv_strcmp(fn, "/..") == 0); - - return LV_FS_RES_OK; -} - -#else /*LV_USE_FS_LITTLEFS == 0*/ - -#if defined(LV_FS_LITTLEFS_LETTER) && LV_FS_LITTLEFS_LETTER != '\0' - #warning "LV_USE_FS_LITTLEFS is not enabled but LV_FS_LITTLEFS_LETTER is set" -#endif - -#endif /*LV_USE_FS_LITTLEFS*/ diff --git a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_memfs.c b/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_memfs.c deleted file mode 100644 index c207c76..0000000 --- a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_memfs.c +++ /dev/null @@ -1,227 +0,0 @@ -/** - * @file lv_fs_memfs.c - * - * File System Interface driver for memory-mapped files - * - * This driver allows using a memory area as a file that can be read by normal file operations. It can - * be used, e.g., to store font files in slow flash memory, and load them into RAM on demand. - * - * You can enable it in lv_conf.h: - * - * #define LV_USE_FS_MEMFS 1 - * - * The actual implementation uses the built-in cache mechanism of the file system interface. - * - * Since this is not an actual file system, file write and directories are not supported. - * - * The default drive letter is 'M', but this can be changed in lv_conf.h: - * - * #define LV_FS_MEMFS_LETTER 'M' - * - * To use it seamlessly with the file system interface a new extended path object has been introduced: - * - * lv_fs_path_ex_t mempath; - * - * This structure can be initialized with the helper function: - * - * lv_fs_make_path_ex(&mempath, (const uint8_t *) & my_mem_buffer, sizeof(my_mem_buffer)); - * - * Then the "file" can be opened with: - * - * lv_fs_file_t file; - * lv_fs_res_t res = lv_fs_open(&file, (const char *) & mempath, LV_FS_MODE_RD); - * - * The path object can be used at any place where a file path is required, e.g.: - * - * lv_font_t* my_font = lv_binfont_create((const char *) & mempath); - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../misc/lv_fs_private.h" -#include "../../../lvgl.h" -#if LV_USE_FS_MEMFS - -/********************* - * DEFINES - *********************/ -#if LV_FS_MEMFS_LETTER == '\0' - #error "LV_FS_MEMFS_LETTER must be set to a valid value" -#else - #if (LV_FS_MEMFS_LETTER < 'A') || (LV_FS_MEMFS_LETTER > 'Z') - #if LV_FS_DEFAULT_DRIVE_LETTER != '\0' /*When using default drive letter, strict format (X:) is mandatory*/ - #error "LV_FS_MEMFS_LETTER must be an upper case ASCII letter" - #else /*Lean rules for backward compatibility*/ - #warning LV_FS_MEMFS_LETTER should be an upper case ASCII letter. \ - Using a slash symbol as drive letter should be replaced with LV_FS_DEFAULT_DRIVE_LETTER mechanism - #endif - #endif -#endif - -/********************** - * TYPEDEFS - **********************/ - -/********************** -* STATIC PROTOTYPES -**********************/ - -static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode); -static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p); -static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br); -static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); -static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); - -/********************** - * STATIC VARIABLES - **********************/ - -static lv_fs_drv_t fs_drv; /*A driver descriptor*/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Register a driver for the File system interface - */ -void lv_fs_memfs_init(void) -{ - /*--------------------------------------------------- - * Register the file system interface in LVGL - *--------------------------------------------------*/ - - lv_fs_drv_init(&fs_drv); - - /*Set up fields...*/ - fs_drv.letter = LV_FS_MEMFS_LETTER; - fs_drv.cache_size = LV_FS_CACHE_FROM_BUFFER; - - fs_drv.open_cb = fs_open; - fs_drv.close_cb = fs_close; - fs_drv.read_cb = fs_read; - fs_drv.write_cb = NULL; - fs_drv.seek_cb = fs_seek; - fs_drv.tell_cb = fs_tell; - - fs_drv.dir_close_cb = NULL; - fs_drv.dir_open_cb = NULL; - fs_drv.dir_read_cb = NULL; - - lv_fs_drv_register(&fs_drv); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Open a file - * @param drv pointer to a driver where this function belongs - * @param path pointer to an extended path object containing the memory buffer address and size - * @param mode read: FS_MODE_RD (currently only reading from the buffer is supported) - * @return pointer to FIL struct or NULL in case of fail - */ -static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) -{ - LV_UNUSED(drv); - LV_UNUSED(mode); - return (void *)path; -} - -/** - * Close an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable. (opened with fs_open) - * @return LV_FS_RES_OK: no error, the file is read - * any error from lv_fs_res_t enum - */ -static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p) -{ - LV_UNUSED(drv); - LV_UNUSED(file_p); - return LV_FS_RES_OK; -} - -/** - * Read data from an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable. - * @param buf pointer to a memory block where to store the read data - * @param btr number of Bytes To Read - * @param br the real number of read bytes (Byte Read) - * @return LV_FS_RES_OK: no error, the file is read - * any error from lv_fs_res_t enum - */ -static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br) -{ - LV_UNUSED(drv); - LV_UNUSED(file_p); - LV_UNUSED(buf); - LV_UNUSED(btr); - *br = 0; - return LV_FS_RES_OK; -} - -/** - * Set the read pointer. - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable. (opened with fs_open ) - * @param pos the new position of read pointer - * @return LV_FS_RES_OK: no error, the file is read - * any error from lv_fs_res_t enum - */ -static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence) -{ - /* NOTE: this function is only called to determine the end of the buffer when LV_FS_SEEK_END was given to lv_fs_seek() */ - LV_UNUSED(drv); - lv_fs_file_t * fp = (lv_fs_file_t *)file_p; - switch(whence) { - case LV_FS_SEEK_SET: { - fp->cache->file_position = pos; - break; - } - case LV_FS_SEEK_CUR: { - fp->cache->file_position += pos; - break; - } - case LV_FS_SEEK_END: { - fp->cache->file_position = fp->cache->end - pos; - break; - } - } - if(fp->cache->file_position < fp->cache->start) - fp->cache->file_position = fp->cache->start; - else if(fp->cache->file_position > fp->cache->end) - fp->cache->file_position = fp->cache->end; - return LV_FS_RES_OK; -} - -/** - * Give the position of the read write pointer - * @param drv pointer to a driver where this function belongs - * @param file_p pointer to a FILE variable - * @param pos_p pointer to store the result - * @return LV_FS_RES_OK: no error, the file is read - * any error from lv_fs_res_t enum - */ -static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) -{ - LV_UNUSED(drv); - *pos_p = ((lv_fs_file_t *)file_p)->cache->file_position; - return LV_FS_RES_OK; -} - -#else /*LV_USE_FS_MEMFS == 0*/ - -#if defined(LV_FS_MEMFS_LETTER) && LV_FS_MEMFS_LETTER != '\0' - #warning "LV_USE_FS_MEMFS is not enabled but LV_FS_MEMFS_LETTER is set" -#endif - -#endif /*LV_USE_FS_MEMFS*/ diff --git a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_posix.c b/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_posix.c deleted file mode 100644 index f1e66fd..0000000 --- a/L3_Middlewares/LVGL/src/libs/fsdrv/lv_fs_posix.c +++ /dev/null @@ -1,341 +0,0 @@ -/** - * @file lv_fs_posix.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../../lvgl.h" - -#if LV_USE_FS_POSIX - -#include -#include -#include -#include -#include -#include -#include "../../core/lv_global.h" - -/********************* - * DEFINES - *********************/ - -#if LV_FS_POSIX_LETTER == '\0' - #error "LV_FS_POSIX_LETTER must be set to a valid value" -#else - #if (LV_FS_POSIX_LETTER < 'A') || (LV_FS_POSIX_LETTER > 'Z') - #if LV_FS_DEFAULT_DRIVE_LETTER != '\0' /*When using default drive letter, strict format (X:) is mandatory*/ - #error "LV_FS_POSIX_LETTER must be an upper case ASCII letter" - #else /*Lean rules for backward compatibility*/ - #warning LV_FS_POSIX_LETTER should be an upper case ASCII letter. \ - Using a slash symbol as drive letter should be replaced with LV_FS_DEFAULT_DRIVE_LETTER mechanism - #endif - #endif -#endif - -/** The reason for 'fd + 1' is because open() may return a legal fd with a value of 0, - * preventing it from being judged as NULL when converted to a pointer type. - */ -#define FILEP2FD(file_p) ((lv_uintptr_t)file_p - 1) -#define FD2FILEP(fd) ((void *)(lv_uintptr_t)(fd + 1)) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode); -static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p); -static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br); -static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw); -static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); -static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); -static void * fs_dir_open(lv_fs_drv_t * drv, const char * path); -static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint32_t fn_len); -static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Register a driver for the File system interface - */ -void lv_fs_posix_init(void) -{ - /*--------------------------------------------------- - * Register the file system interface in LVGL - *--------------------------------------------------*/ - - lv_fs_drv_t * fs_drv_p = &(LV_GLOBAL_DEFAULT()->posix_fs_drv); - lv_fs_drv_init(fs_drv_p); - - /*Set up fields...*/ - fs_drv_p->letter = LV_FS_POSIX_LETTER; - fs_drv_p->cache_size = LV_FS_POSIX_CACHE_SIZE; - - fs_drv_p->open_cb = fs_open; - fs_drv_p->close_cb = fs_close; - fs_drv_p->read_cb = fs_read; - fs_drv_p->write_cb = fs_write; - fs_drv_p->seek_cb = fs_seek; - fs_drv_p->tell_cb = fs_tell; - - fs_drv_p->dir_close_cb = fs_dir_close; - fs_drv_p->dir_open_cb = fs_dir_open; - fs_drv_p->dir_read_cb = fs_dir_read; - - lv_fs_drv_register(fs_drv_p); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Open a file - * @param drv pointer to a driver where this function belongs - * @param path path to the file beginning with the driver letter (e.g. S:/folder/file.txt) - * @param mode read: FS_MODE_RD, write: FS_MODE_WR, both: FS_MODE_RD | FS_MODE_WR - * @return a file handle or -1 in case of fail - */ -static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode) -{ - LV_UNUSED(drv); - - int flags = 0; - if(mode == LV_FS_MODE_WR) flags = O_WRONLY | O_CREAT; - else if(mode == LV_FS_MODE_RD) flags = O_RDONLY; - else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD)) flags = O_RDWR | O_CREAT; - - /*Make the path relative to the current directory (the projects root folder)*/ - char buf[256]; - lv_snprintf(buf, sizeof(buf), LV_FS_POSIX_PATH "%s", path); - - int fd = open(buf, flags, 0666); - if(fd < 0) { - LV_LOG_WARN("Could not open file: %s, flags: 0x%x, errno: %d", buf, flags, errno); - return NULL; - } - - return FD2FILEP(fd); -} - -/** - * Close an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p a file handle. (opened with fs_open) - * @return LV_FS_RES_OK: no error, the file is read - * any error from lv_fs_res_t enum - */ -static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p) -{ - LV_UNUSED(drv); - - int fd = FILEP2FD(file_p); - int ret = close(fd); - if(ret < 0) { - LV_LOG_WARN("Could not close file: %d, errno: %d", fd, errno); - return LV_FS_RES_FS_ERR; - } - - return LV_FS_RES_OK; -} - -/** - * Read data from an opened file - * @param drv pointer to a driver where this function belongs - * @param file_p a file handle variable. - * @param buf pointer to a memory block where to store the read data - * @param btr number of Bytes To Read - * @param br the real number of read bytes (Byte Read) - * @return LV_FS_RES_OK: no error, the file is read - * any error from lv_fs_res_t enum - */ -static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br) -{ - LV_UNUSED(drv); - - int fd = FILEP2FD(file_p); - ssize_t ret = read(fd, buf, btr); - if(ret < 0) { - LV_LOG_WARN("Could not read file: %d, errno: %d", fd, errno); - return LV_FS_RES_FS_ERR; - } - - *br = (uint32_t)ret; - return LV_FS_RES_OK; -} - -/** - * Write into a file - * @param drv pointer to a driver where this function belongs - * @param file_p a file handle variable - * @param buf pointer to a buffer with the bytes to write - * @param btw Bytes To Write - * @param bw the number of real written bytes (Bytes Written). NULL if unused. - * @return LV_FS_RES_OK or any error from lv_fs_res_t enum - */ -static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw) -{ - LV_UNUSED(drv); - - int fd = FILEP2FD(file_p); - ssize_t ret = write(fd, buf, btw); - if(ret < 0) { - LV_LOG_WARN("Could not write file: %d, errno: %d", fd, errno); - return LV_FS_RES_FS_ERR; - } - - *bw = (uint32_t)ret; - return LV_FS_RES_OK; -} - -/** - * Set the read write pointer. Also expand the file size if necessary. - * @param drv pointer to a driver where this function belongs - * @param file_p a file handle variable. (opened with fs_open ) - * @param pos the new position of read write pointer - * @return LV_FS_RES_OK: no error, the file is read - * any error from lv_fs_res_t enum - */ -static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence) -{ - LV_UNUSED(drv); - int w; - switch(whence) { - case LV_FS_SEEK_SET: - w = SEEK_SET; - break; - case LV_FS_SEEK_CUR: - w = SEEK_CUR; - break; - case LV_FS_SEEK_END: - w = SEEK_END; - break; - default: - return LV_FS_RES_INV_PARAM; - } - - int fd = FILEP2FD(file_p); - off_t offset = lseek(fd, pos, w); - if(offset < 0) { - LV_LOG_WARN("Could not seek file: %d, errno: %d", fd, errno); - return LV_FS_RES_FS_ERR; - } - - return LV_FS_RES_OK; -} - -/** - * Give the position of the read write pointer - * @param drv pointer to a driver where this function belongs - * @param file_p a file handle variable - * @param pos_p pointer to store the result - * @return LV_FS_RES_OK: no error, the file is read - * any error from lv_fs_res_t enum - */ -static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) -{ - LV_UNUSED(drv); - - int fd = FILEP2FD(file_p); - off_t offset = lseek(fd, 0, SEEK_CUR); - if(offset < 0) { - LV_LOG_WARN("Could not get position of file: %d, errno: %d", fd, errno); - return LV_FS_RES_FS_ERR; - } - - *pos_p = (uint32_t)offset; - return LV_FS_RES_OK; -} - -/** - * Initialize a 'fs_read_dir_t' variable for directory reading - * @param drv pointer to a driver where this function belongs - * @param path path to a directory - * @return pointer to an initialized 'DIR' or 'HANDLE' variable - */ -static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) -{ - LV_UNUSED(drv); - - /*Make the path relative to the current directory (the projects root folder)*/ - char buf[256]; - lv_snprintf(buf, sizeof(buf), LV_FS_POSIX_PATH "%s", path); - - void * dir = opendir(buf); - if(!dir) { - LV_LOG_WARN("Could not open directory: %s, errno: %d", buf, errno); - return NULL; - } - - return dir; -} - -/** - * Read the next filename from a directory. - * The name of the directories will begin with '/' - * @param drv pointer to a driver where this function belongs - * @param dir_p pointer to an initialized 'DIR' or 'HANDLE' variable - * @param fn pointer to a buffer to store the filename - * @param fn_len length of the buffer to store the filename - * @return LV_FS_RES_OK or any error from lv_fs_res_t enum - */ -static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn, uint32_t fn_len) -{ - LV_UNUSED(drv); - if(fn_len == 0) return LV_FS_RES_INV_PARAM; - - struct dirent * entry; - do { - entry = readdir(dir_p); - if(entry) { - if(entry->d_type == DT_DIR) lv_snprintf(fn, fn_len, "/%s", entry->d_name); - else lv_strlcpy(fn, entry->d_name, fn_len); - } - else { - lv_strlcpy(fn, "", fn_len); - } - } while(lv_strcmp(fn, "/.") == 0 || lv_strcmp(fn, "/..") == 0); - - return LV_FS_RES_OK; -} - -/** - * Close the directory reading - * @param drv pointer to a driver where this function belongs - * @param dir_p pointer to an initialized 'DIR' or 'HANDLE' variable - * @return LV_FS_RES_OK or any error from lv_fs_res_t enum - */ -static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * dir_p) -{ - LV_UNUSED(drv); - - int ret = closedir(dir_p); - if(ret < 0) { - LV_LOG_WARN("Could not close directory: errno: %d", errno); - return LV_FS_RES_FS_ERR; - } - - return LV_FS_RES_OK; -} -#else /*LV_USE_FS_POSIX == 0*/ - -#if defined(LV_FS_POSIX_LETTER) && LV_FS_POSIX_LETTER != '\0' - #warning "LV_USE_FS_POSIX is not enabled but LV_FS_POSIX_LETTER is set" -#endif - -#endif /*LV_USE_FS_POSIX*/ diff --git a/L3_Middlewares/LVGL/src/libs/gif/gifdec.h b/L3_Middlewares/LVGL/src/libs/gif/gifdec.h deleted file mode 100644 index 21ff210..0000000 --- a/L3_Middlewares/LVGL/src/libs/gif/gifdec.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef GIFDEC_H -#define GIFDEC_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "../../misc/lv_fs.h" - -#if LV_USE_GIF -#include - -typedef struct _gd_Palette { - int size; - uint8_t colors[0x100 * 3]; -} gd_Palette; - -typedef struct _gd_GCE { - uint16_t delay; - uint8_t tindex; - uint8_t disposal; - int input; - int transparency; -} gd_GCE; - - - -typedef struct _gd_GIF { - lv_fs_file_t fd; - const char * data; - uint8_t is_file; - uint32_t f_rw_p; - int32_t anim_start; - uint16_t width, height; - uint16_t depth; - int32_t loop_count; - gd_GCE gce; - gd_Palette * palette; - gd_Palette lct, gct; - void (*plain_text)( - struct _gd_GIF * gif, uint16_t tx, uint16_t ty, - uint16_t tw, uint16_t th, uint8_t cw, uint8_t ch, - uint8_t fg, uint8_t bg - ); - void (*comment)(struct _gd_GIF * gif); - void (*application)(struct _gd_GIF * gif, char id[8], char auth[3]); - uint16_t fx, fy, fw, fh; - uint8_t bgindex; - uint8_t * canvas, * frame; - #if LV_GIF_CACHE_DECODE_DATA - uint8_t *lzw_cache; - #endif -} gd_GIF; - -gd_GIF * gd_open_gif_file(const char * fname); - -gd_GIF * gd_open_gif_data(const void * data); - -void gd_render_frame(gd_GIF * gif, uint8_t * buffer); - -int gd_get_frame(gd_GIF * gif); -void gd_rewind(gd_GIF * gif); -void gd_close_gif(gd_GIF * gif); - -#endif /*LV_USE_GIF*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* GIFDEC_H */ diff --git a/L3_Middlewares/LVGL/src/libs/gif/gifdec_mve.h b/L3_Middlewares/LVGL/src/libs/gif/gifdec_mve.h deleted file mode 100644 index 6d83393..0000000 --- a/L3_Middlewares/LVGL/src/libs/gif/gifdec_mve.h +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @file gifdec_mve.h - * - */ - -#ifndef GIFDEC_MVE_H -#define GIFDEC_MVE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include -#include "../../misc/lv_color.h" - -/********************* - * DEFINES - *********************/ - -#define GIFDEC_FILL_BG(dst, w, h, stride, color, opa) \ - _gifdec_fill_bg_mve(dst, w, h, stride, color, opa) - -#define GIFDEC_RENDER_FRAME(dst, w, h, stride, frame, pattern, tindex) \ - _gifdec_render_frame_mve(dst, w, h, stride, frame, pattern, tindex) - -/********************** - * MACROS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -static inline void _gifdec_fill_bg_mve(uint8_t * dst, uint16_t w, uint16_t h, uint16_t stride, uint8_t * color, - uint8_t opa) -{ - lv_color32_t c = lv_color32_make(*(color + 0), *(color + 1), *(color + 2), opa); - uint32_t color_32 = *(uint32_t *)&c; - - __asm volatile( - ".p2align 2 \n" - "vdup.32 q0, %[src] \n" - "3: \n" - "mov r0, %[dst] \n" - - "wlstp.32 lr, %[w], 1f \n" - "2: \n" - - "vstrw.32 q0, [r0], #16 \n" - "letp lr, 2b \n" - "1: \n" - "add %[dst], %[iTargetStride] \n" - "subs %[h], #1 \n" - "bne 3b \n" - : [dst] "+r"(dst), - [h] "+r"(h) - : [src] "r"(color_32), - [w] "r"(w), - [iTargetStride] "r"(stride * sizeof(uint32_t)) - : "r0", "q0", "memory", "r14", "cc"); -} - -static inline void _gifdec_render_frame_mve(uint8_t * dst, uint16_t w, uint16_t h, uint16_t stride, uint8_t * frame, - uint8_t * pattern, uint16_t tindex) -{ - if(w == 0 || h == 0) { - return; - } - - __asm volatile( - "vmov.u16 q3, #255 \n" - "vshl.u16 q3, q3, #8 \n" /* left shift 8 for a*/ - - "mov r0, #2 \n" - "vidup.u16 q6, r0, #4 \n" /* [2, 6, 10, 14, 18, 22, 26, 30] */ - "mov r0, #0 \n" - "vidup.u16 q7, r0, #4 \n" /* [0, 4, 8, 12, 16, 20, 24, 28] */ - - "3: \n" - "mov r1, %[dst] \n" - "mov r2, %[frame] \n" - - "wlstp.16 lr, %[w], 1f \n" - "2: \n" - - "mov r0, #3 \n" - "vldrb.u16 q4, [r2], #8 \n" - "vmul.u16 q5, q4, r0 \n" - - "mov r0, #1 \n" - "vldrb.u16 q2, [%[pattern], q5] \n" /* load 8 pixel r*/ - - "vadd.u16 q5, q5, r0 \n" - "vldrb.u16 q1, [%[pattern], q5] \n" /* load 8 pixel g*/ - - "vadd.u16 q5, q5, r0 \n" - "vldrb.u16 q0, [%[pattern], q5] \n" /* load 8 pixel b*/ - - "vshl.u16 q1, q1, #8 \n" /* left shift 8 for g*/ - - "vorr.u16 q0, q0, q1 \n" /* make 8 pixel gb*/ - "vorr.u16 q1, q2, q3 \n" /* make 8 pixel ar*/ - - "vcmp.i16 ne, q4, %[tindex] \n" - "vpstt \n" - "vstrht.16 q0, [r1, q7] \n" - "vstrht.16 q1, [r1, q6] \n" - "add r1, r1, #32 \n" - - "letp lr, 2b \n" - - "1: \n" - "mov r0, %[stride], LSL #2 \n" - "add %[dst], r0 \n" - "add %[frame], %[stride] \n" - "subs %[h], #1 \n" - "bne 3b \n" - - : [dst] "+r"(dst), - [frame] "+r"(frame), - [h] "+r"(h) - : [pattern] "r"(pattern), - [w] "r"(w), - [stride] "r"(stride), - [tindex] "r"(tindex) - : "r0", "r1", "r2", "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "memory", "r14", "cc"); -} - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*GIFDEC_MVE_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/gif/lv_gif.h b/L3_Middlewares/LVGL/src/libs/gif/lv_gif.h deleted file mode 100644 index cf1bee4..0000000 --- a/L3_Middlewares/LVGL/src/libs/gif/lv_gif.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @file lv_gif.h - * - */ - -#ifndef LV_GIF_H -#define LV_GIF_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" -#include "../../misc/lv_types.h" -#include "../../draw/lv_draw_buf.h" -#include "../../widgets/image/lv_image.h" -#include "../../core/lv_obj_class.h" -#include LV_STDBOOL_INCLUDE -#include LV_STDINT_INCLUDE -#if LV_USE_GIF - -#include "gifdec.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_gif_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a gif object - * @param parent pointer to an object, it will be the parent of the new gif. - * @return pointer to the gif obj - */ -lv_obj_t * lv_gif_create(lv_obj_t * parent); - -/** - * Set the gif data to display on the object - * @param obj pointer to a gif object - * @param src 1) pointer to an ::lv_image_dsc_t descriptor (which contains gif raw data) or - * 2) path to a gif file (e.g. "S:/dir/anim.gif") - */ -void lv_gif_set_src(lv_obj_t * obj, const void * src); - -/** - * Restart a gif animation. - * @param obj pointer to a gif obj - */ -void lv_gif_restart(lv_obj_t * obj); - -/** - * Pause a gif animation. - * @param obj pointer to a gif obj - */ -void lv_gif_pause(lv_obj_t * obj); - -/** - * Resume a gif animation. - * @param obj pointer to a gif obj - */ -void lv_gif_resume(lv_obj_t * obj); - -/** - * Checks if the GIF was loaded correctly. - * @param obj pointer to a gif obj - */ -bool lv_gif_is_loaded(lv_obj_t * obj); - -/** - * Get the loop count for the GIF. - * @param obj pointer to a gif obj - */ -int32_t lv_gif_get_loop_count(lv_obj_t * obj); - -/** - * Set the loop count for the GIF. - * @param obj pointer to a gif obj - * @param count the loop count to set - */ -void lv_gif_set_loop_count(lv_obj_t * obj, int32_t count); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_GIF*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*LV_GIF_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c b/L3_Middlewares/LVGL/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c deleted file mode 100644 index f058728..0000000 --- a/L3_Middlewares/LVGL/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c +++ /dev/null @@ -1,598 +0,0 @@ -/** - * @file lv_libjpeg_turbo.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../draw/lv_image_decoder_private.h" -#include "../../../lvgl.h" -#if LV_USE_LIBJPEG_TURBO - -#include "lv_libjpeg_turbo.h" -#include -#include -#include -#include -#include "../../core/lv_global.h" - -/********************* - * DEFINES - *********************/ - -#define DECODER_NAME "JPEG_TURBO" - -#define image_cache_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->image_cache_draw_buf_handlers) - -#define JPEG_PIXEL_SIZE 3 /* RGB888 */ -#define JPEG_SIGNATURE 0xFFD8FF -#define IS_JPEG_SIGNATURE(x) (((x) & 0x00FFFFFF) == JPEG_SIGNATURE) - -/********************** - * TYPEDEFS - **********************/ -typedef struct error_mgr_s { - struct jpeg_error_mgr pub; - jmp_buf jb; -} error_mgr_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header); -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -static lv_draw_buf_t * decode_jpeg_file(const char * filename); -static uint8_t * read_file(const char * filename, uint32_t * size); -static bool get_jpeg_head_info(const char * filename, uint32_t * width, uint32_t * height, uint32_t * orientation); -static bool get_jpeg_size(uint8_t * data, uint32_t data_size, uint32_t * width, uint32_t * height); -static bool get_jpeg_direction(uint8_t * data, uint32_t data_size, uint32_t * orientation); -static void rotate_buffer(lv_draw_buf_t * decoded, uint8_t * buffer, uint32_t line_index, uint32_t angle); -static void error_exit(j_common_ptr cinfo); -/********************** - * STATIC VARIABLES - **********************/ -const int JPEG_EXIF = 0x45786966; /* Exif data structure tag */ -const int JPEG_BIG_ENDIAN_TAG = 0x4d4d; -const int JPEG_LITTLE_ENDIAN_TAG = 0x4949; - -/********************** - * MACROS - **********************/ -#define TRANS_32_VALUE(big_endian, data) big_endian ? \ - ((*(data) << 24) | (*((data) + 1) << 16) | (*((data) + 2) << 8) | *((data) + 3)) : \ - (*(data) | (*((data) + 1) << 8) | (*((data) + 2) << 16) | (*((data) + 3) << 24)) -#define TRANS_16_VALUE(big_endian, data) big_endian ? \ - ((*(data) << 8) | *((data) + 1)) : (*(data) | (*((data) + 1) << 8)) - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Register the JPEG decoder functions in LVGL - */ -void lv_libjpeg_turbo_init(void) -{ - lv_image_decoder_t * dec = lv_image_decoder_create(); - lv_image_decoder_set_info_cb(dec, decoder_info); - lv_image_decoder_set_open_cb(dec, decoder_open); - lv_image_decoder_set_close_cb(dec, decoder_close); - - dec->name = DECODER_NAME; -} - -void lv_libjpeg_turbo_deinit(void) -{ - lv_image_decoder_t * dec = NULL; - while((dec = lv_image_decoder_get_next(dec)) != NULL) { - if(dec->info_cb == decoder_info) { - lv_image_decoder_delete(dec); - break; - } - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Get info about a JPEG image - * @param dsc image descriptor containing the source and type of the image and other info. - * @param header store the info here - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't get the info - */ -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header) -{ - LV_UNUSED(decoder); /*Unused*/ - lv_image_src_t src_type = dsc->src_type; /*Get the source type*/ - - /*If it's a JPEG file...*/ - if(src_type == LV_IMAGE_SRC_FILE) { - const char * src = dsc->src; - uint32_t jpg_signature = 0; - uint32_t rn; - lv_fs_read(&dsc->file, &jpg_signature, sizeof(jpg_signature), &rn); - - if(rn != sizeof(jpg_signature)) { - LV_LOG_WARN("file: %s signature len = %" LV_PRIu32 " error", src, rn); - return LV_RESULT_INVALID; - } - - const char * ext = lv_fs_get_ext(src); - bool is_jpeg_ext = (lv_strcmp(ext, "jpg") == 0) - || (lv_strcmp(ext, "jpeg") == 0); - - if(!IS_JPEG_SIGNATURE(jpg_signature)) { - if(is_jpeg_ext) { - LV_LOG_WARN("file: %s signature = 0X%" LV_PRIX32 " error", src, jpg_signature); - } - return LV_RESULT_INVALID; - } - - uint32_t width; - uint32_t height; - uint32_t orientation = 0; - - if(!get_jpeg_head_info(src, &width, &height, &orientation)) { - return LV_RESULT_INVALID; - } - - /*Save the data in the header*/ - header->cf = LV_COLOR_FORMAT_RGB888; - header->w = (orientation % 180) ? height : width; - header->h = (orientation % 180) ? width : height; - - return LV_RESULT_OK; - } - - return LV_RESULT_INVALID; /*If didn't succeeded earlier then it's an error*/ -} - -/** - * Open a JPEG image and return the decided image - * @param decoder pointer to the decoder - * @param dsc pointer to the decoder descriptor - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't open the image - */ -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); /*Unused*/ - - /*If it's a JPEG file...*/ - if(dsc->src_type == LV_IMAGE_SRC_FILE) { - const char * fn = dsc->src; - lv_draw_buf_t * decoded = decode_jpeg_file(fn); - if(decoded == NULL) { - LV_LOG_WARN("decode jpeg file failed"); - return LV_RESULT_INVALID; - } - - dsc->decoded = decoded; - - if(dsc->args.no_cache) return LV_RESULT_OK; - - /*If the image cache is disabled, just return the decoded image*/ - if(!lv_image_cache_is_enabled()) return LV_RESULT_OK; - - /*Add the decoded image to the cache*/ - lv_image_cache_data_t search_key; - search_key.src_type = dsc->src_type; - search_key.src = dsc->src; - search_key.slot.size = decoded->data_size; - - lv_cache_entry_t * entry = lv_image_decoder_add_to_cache(decoder, &search_key, decoded, NULL); - - if(entry == NULL) { - lv_draw_buf_destroy(decoded); - return LV_RESULT_INVALID; - } - dsc->cache_entry = entry; - return LV_RESULT_OK; /*If not returned earlier then it failed*/ - } - - return LV_RESULT_INVALID; /*If not returned earlier then it failed*/ -} - -/** - * Free the allocated resources - */ -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); /*Unused*/ - - if(dsc->args.no_cache || - !lv_image_cache_is_enabled()) lv_draw_buf_destroy((lv_draw_buf_t *)dsc->decoded); -} - -static uint8_t * read_file(const char * filename, uint32_t * size) -{ - uint8_t * data = NULL; - lv_fs_file_t f; - uint32_t data_size; - uint32_t rn; - lv_fs_res_t res; - - *size = 0; - - res = lv_fs_open(&f, filename, LV_FS_MODE_RD); - if(res != LV_FS_RES_OK) { - LV_LOG_WARN("can't open %s", filename); - return NULL; - } - - res = lv_fs_seek(&f, 0, LV_FS_SEEK_END); - if(res != LV_FS_RES_OK) { - goto failed; - } - - res = lv_fs_tell(&f, &data_size); - if(res != LV_FS_RES_OK) { - goto failed; - } - - res = lv_fs_seek(&f, 0, LV_FS_SEEK_SET); - if(res != LV_FS_RES_OK) { - goto failed; - } - - /*Read file to buffer*/ - data = lv_malloc(data_size); - if(data == NULL) { - LV_LOG_WARN("malloc failed for data"); - goto failed; - } - - res = lv_fs_read(&f, data, data_size, &rn); - - if(res == LV_FS_RES_OK && rn == data_size) { - *size = rn; - } - else { - LV_LOG_WARN("read file failed"); - lv_free(data); - data = NULL; - } - -failed: - lv_fs_close(&f); - - return data; -} - -static lv_draw_buf_t * decode_jpeg_file(const char * filename) -{ - /* This struct contains the JPEG decompression parameters and pointers to - * working space (which is allocated as needed by the JPEG library). - */ - struct jpeg_decompress_struct cinfo; - /* We use our private extension JPEG error handler. - * Note that this struct must live as long as the main JPEG parameter - * struct, to avoid dangling-pointer problems. - */ - error_mgr_t jerr; - - /* More stuff */ - JSAMPARRAY buffer; /* Output row buffer */ - - int row_stride; /* physical row width in output buffer */ - uint32_t image_angle = 0; /* image rotate angle */ - - lv_draw_buf_t * decoded = NULL; - - /* In this example we want to open the input file before doing anything else, - * so that the setjmp() error recovery below can assume the file is open. - * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that - * requires it in order to read binary files. - */ - - uint32_t data_size; - uint8_t * data = read_file(filename, &data_size); - if(data == NULL) { - LV_LOG_WARN("can't load file %s", filename); - return NULL; - } - - /* allocate and initialize JPEG decompression object */ - - /* We set up the normal JPEG error routines, then override error_exit. */ - cinfo.err = jpeg_std_error(&jerr.pub); - jerr.pub.error_exit = error_exit; - /* Establish the setjmp return context for my_error_exit to use. */ - if(setjmp(jerr.jb)) { - - LV_LOG_WARN("decoding error"); - - if(decoded) { - lv_draw_buf_destroy(decoded); - } - - /* If we get here, the JPEG code has signaled an error. - * We need to clean up the JPEG object, close the input file, and return. - */ - jpeg_destroy_decompress(&cinfo); - lv_free(data); - return NULL; - } - - /* Get rotate angle from Exif data */ - if(!get_jpeg_direction(data, data_size, &image_angle)) { - LV_LOG_WARN("read jpeg orientation failed."); - } - - /* Now we can initialize the JPEG decompression object. */ - jpeg_create_decompress(&cinfo); - - /* specify data source (eg, a file or buffer) */ - - jpeg_mem_src(&cinfo, data, data_size); - - /* read file parameters with jpeg_read_header() */ - - jpeg_read_header(&cinfo, TRUE); - - /* We can ignore the return value from jpeg_read_header since - * (a) suspension is not possible with the stdio data source, and - * (b) we passed TRUE to reject a tables-only JPEG file as an error. - * See libjpeg.doc for more info. - */ - - /* set parameters for decompression */ - - cinfo.out_color_space = JCS_EXT_BGR; - - /* In this example, we don't need to change any of the defaults set by - * jpeg_read_header(), so we do nothing here. - */ - - /* Start decompressor */ - - jpeg_start_decompress(&cinfo); - - /* We can ignore the return value since suspension is not possible - * with the stdio data source. - */ - - /* We may need to do some setup of our own at this point before reading - * the data. After jpeg_start_decompress() we have the correct scaled - * output image dimensions available, as well as the output colormap - * if we asked for color quantization. - * In this example, we need to make an output work buffer of the right size. - */ - /* JSAMPLEs per row in output buffer */ - row_stride = cinfo.output_width * cinfo.output_components; - /* Make a one-row-high sample array that will go away when done with image */ - buffer = (*cinfo.mem->alloc_sarray) - ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); - uint32_t buf_width = (image_angle % 180) ? cinfo.output_height : cinfo.output_width; - uint32_t buf_height = (image_angle % 180) ? cinfo.output_width : cinfo.output_height; - decoded = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, buf_width, buf_height, LV_COLOR_FORMAT_RGB888, - LV_STRIDE_AUTO); - if(decoded != NULL) { - uint32_t line_index = 0; - /* while (scan lines remain to be read) */ - /* jpeg_read_scanlines(...); */ - - /* Here we use the library's state variable cinfo.output_scanline as the - * loop counter, so that we don't have to keep track ourselves. - */ - while(cinfo.output_scanline < cinfo.output_height) { - /* jpeg_read_scanlines expects an array of pointers to scanlines. - * Here the array is only one element long, but you could ask for - * more than one scanline at a time if that's more convenient. - */ - jpeg_read_scanlines(&cinfo, buffer, 1); - - /* Assume put_scanline_someplace wants a pointer and sample count. */ - rotate_buffer(decoded, buffer[0], line_index, image_angle); - - line_index++; - } - } - - /* Finish decompression */ - - jpeg_finish_decompress(&cinfo); - - /* We can ignore the return value since suspension is not possible - * with the stdio data source. - */ - - /* Release JPEG decompression object */ - - /* This is an important step since it will release a good deal of memory. */ - jpeg_destroy_decompress(&cinfo); - - /* After finish_decompress, we can close the input file. - * Here we postpone it until after no more JPEG errors are possible, - * so as to simplify the setjmp error logic above. (Actually, I don't - * think that jpeg_destroy can do an error exit, but why assume anything...) - */ - lv_free(data); - - /* At this point you may want to check to see whether any corrupt-data - * warnings occurred (test whether jerr.pub.num_warnings is nonzero). - */ - - /* And we're done! */ - return decoded; -} - -static bool get_jpeg_head_info(const char * filename, uint32_t * width, uint32_t * height, uint32_t * orientation) -{ - uint8_t * data = NULL; - uint32_t data_size; - data = read_file(filename, &data_size); - if(data == NULL) { - return false; - } - - if(!get_jpeg_size(data, data_size, width, height)) { - LV_LOG_WARN("read jpeg size failed."); - } - - if(!get_jpeg_direction(data, data_size, orientation)) { - LV_LOG_WARN("read jpeg orientation failed."); - } - - lv_free(data); - - return JPEG_HEADER_OK; -} - -static bool get_jpeg_size(uint8_t * data, uint32_t data_size, uint32_t * width, uint32_t * height) -{ - struct jpeg_decompress_struct cinfo; - error_mgr_t jerr; - - cinfo.err = jpeg_std_error(&jerr.pub); - jerr.pub.error_exit = error_exit; - - if(setjmp(jerr.jb)) { - LV_LOG_WARN("read jpeg head failed"); - jpeg_destroy_decompress(&cinfo); - return false; - } - - jpeg_create_decompress(&cinfo); - - jpeg_mem_src(&cinfo, data, data_size); - - int ret = jpeg_read_header(&cinfo, TRUE); - - if(ret == JPEG_HEADER_OK) { - *width = cinfo.image_width; - *height = cinfo.image_height; - } - else { - LV_LOG_WARN("read jpeg head failed: %d", ret); - } - - jpeg_destroy_decompress(&cinfo); - - return JPEG_HEADER_OK; -} - -static bool get_jpeg_direction(uint8_t * data, uint32_t data_size, uint32_t * orientation) -{ - struct jpeg_decompress_struct cinfo; - error_mgr_t jerr; - - cinfo.err = jpeg_std_error(&jerr.pub); - jerr.pub.error_exit = error_exit; - - if(setjmp(jerr.jb)) { - LV_LOG_WARN("read jpeg orientation failed"); - jpeg_destroy_decompress(&cinfo); - return false; - } - - jpeg_create_decompress(&cinfo); - - jpeg_mem_src(&cinfo, data, data_size); - - jpeg_save_markers(&cinfo, JPEG_APP0 + 1, 0xFFFF); - - cinfo.marker->read_markers(&cinfo); - - jpeg_saved_marker_ptr marker = cinfo.marker_list; - while(marker != NULL) { - if(marker->marker == JPEG_APP0 + 1) { - JOCTET FAR * app1_data = marker->data; - if(TRANS_32_VALUE(true, app1_data) == JPEG_EXIF) { - uint16_t endian_tag = TRANS_16_VALUE(true, app1_data + 4 + 2); - if(!(endian_tag == JPEG_LITTLE_ENDIAN_TAG || endian_tag == JPEG_BIG_ENDIAN_TAG)) { - jpeg_destroy_decompress(&cinfo); - return false; - } - bool is_big_endian = endian_tag == JPEG_BIG_ENDIAN_TAG; - /* first ifd offset addr : 4bytes(Exif) + 2bytes(0x00) + 2bytes(align) + 2bytes(tag mark) */ - unsigned int offset = TRANS_32_VALUE(is_big_endian, app1_data + 8 + 2); - /* ifd base : 4bytes(Exif) + 2bytes(0x00) */ - unsigned char * ifd = 0; - do { - /* ifd start: 4bytes(Exif) + 2bytes(0x00) + offset value(2bytes(align) + 2bytes(tag mark) + 4bytes(offset size)) */ - unsigned int entry_offset = 4 + 2 + offset + 2; - if(entry_offset >= marker->data_length) { - jpeg_destroy_decompress(&cinfo); - return false; - } - ifd = app1_data + entry_offset; - unsigned short num_entries = TRANS_16_VALUE(is_big_endian, ifd - 2); - if(entry_offset + num_entries * 12 >= marker->data_length) { - jpeg_destroy_decompress(&cinfo); - return false; - } - for(int i = 0; i < num_entries; i++) { - unsigned short tag = TRANS_16_VALUE(is_big_endian, ifd); - if(tag == 0x0112) { - /* ifd entry: 12bytes = 2bytes(tag number) + 2bytes(kind of data) + 4bytes(number of components) + 4bytes(data) - * orientation kind(0x03) of data is unsigned short */ - int dirc = TRANS_16_VALUE(is_big_endian, ifd + 2 + 2 + 4); - switch(dirc) { - case 1: - *orientation = 0; - break; - case 3: - *orientation = 180; - break; - case 6: - *orientation = 90; - break; - case 8: - *orientation = 270; - break; - default: - *orientation = 0; - } - } - ifd += 12; - } - offset = TRANS_32_VALUE(is_big_endian, ifd); - } while(offset != 0); - } - break; - } - marker = marker->next; - } - - jpeg_destroy_decompress(&cinfo); - - return JPEG_HEADER_OK; -} - -static void rotate_buffer(lv_draw_buf_t * decoded, uint8_t * buffer, uint32_t line_index, uint32_t angle) -{ - if(angle == 90) { - for(uint32_t x = 0; x < decoded->header.h; x++) { - uint32_t dst_index = x * decoded->header.stride + (decoded->header.w - line_index - 1) * JPEG_PIXEL_SIZE; - lv_memcpy(decoded->data + dst_index, buffer + x * JPEG_PIXEL_SIZE, JPEG_PIXEL_SIZE); - } - } - else if(angle == 180) { - for(uint32_t x = 0; x < decoded->header.w; x++) { - uint32_t dst_index = (decoded->header.h - line_index - 1) * decoded->header.stride + x * JPEG_PIXEL_SIZE; - lv_memcpy(decoded->data + dst_index, buffer + (decoded->header.w - x - 1) * JPEG_PIXEL_SIZE, JPEG_PIXEL_SIZE); - } - } - else if(angle == 270) { - for(uint32_t x = 0; x < decoded->header.h; x++) { - uint32_t dst_index = (decoded->header.h - x - 1) * decoded->header.stride + line_index * JPEG_PIXEL_SIZE; - lv_memcpy(decoded->data + dst_index, buffer + x * JPEG_PIXEL_SIZE, JPEG_PIXEL_SIZE); - } - } - else { - lv_memcpy(decoded->data + line_index * decoded->header.stride, buffer, decoded->header.stride); - } -} - -static void error_exit(j_common_ptr cinfo) -{ - error_mgr_t * myerr = (error_mgr_t *)cinfo->err; - (*cinfo->err->output_message)(cinfo); - longjmp(myerr->jb, 1); -} - -#endif /*LV_USE_LIBJPEG_TURBO*/ diff --git a/L3_Middlewares/LVGL/src/libs/libjpeg_turbo/lv_libjpeg_turbo.h b/L3_Middlewares/LVGL/src/libs/libjpeg_turbo/lv_libjpeg_turbo.h deleted file mode 100644 index 177c83a..0000000 --- a/L3_Middlewares/LVGL/src/libs/libjpeg_turbo/lv_libjpeg_turbo.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file lv_libjpeg_turbo.h - * - */ - -#ifndef LV_LIBJPEG_TURBO_H -#define LV_LIBJPEG_TURBO_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#if LV_USE_LIBJPEG_TURBO - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Register the JPEG-Turbo decoder functions in LVGL - */ -void lv_libjpeg_turbo_init(void); - -void lv_libjpeg_turbo_deinit(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_LIBJPEG_TURBO*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*LV_LIBJPEG_TURBO_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/libpng/lv_libpng.c b/L3_Middlewares/LVGL/src/libs/libpng/lv_libpng.c deleted file mode 100644 index 587e5fc..0000000 --- a/L3_Middlewares/LVGL/src/libs/libpng/lv_libpng.c +++ /dev/null @@ -1,331 +0,0 @@ -/** - * @file lv_libpng.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../draw/lv_image_decoder_private.h" -#include "../../../lvgl.h" -#if LV_USE_LIBPNG - -#include "lv_libpng.h" -#include -#include -#include "../../core/lv_global.h" - -/********************* - * DEFINES - *********************/ - -#define DECODER_NAME "PNG" - -#define image_cache_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->image_cache_draw_buf_handlers) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * src, lv_image_header_t * header); -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -static lv_draw_buf_t * decode_png(lv_image_decoder_dsc_t * dsc); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Register the PNG decoder functions in LVGL - */ -void lv_libpng_init(void) -{ - lv_image_decoder_t * dec = lv_image_decoder_create(); - lv_image_decoder_set_info_cb(dec, decoder_info); - lv_image_decoder_set_open_cb(dec, decoder_open); - lv_image_decoder_set_close_cb(dec, decoder_close); - - dec->name = DECODER_NAME; -} - -void lv_libpng_deinit(void) -{ - lv_image_decoder_t * dec = NULL; - while((dec = lv_image_decoder_get_next(dec)) != NULL) { - if(dec->info_cb == decoder_info) { - lv_image_decoder_delete(dec); - break; - } - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Get info about a PNG image - * @param dsc can be file name or pointer to a C array - * @param header store the info here - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't get the info - */ -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header) -{ - LV_UNUSED(decoder); /*Unused*/ - - lv_image_src_t src_type = dsc->src_type; /*Get the source type*/ - - if(src_type == LV_IMAGE_SRC_FILE || src_type == LV_IMAGE_SRC_VARIABLE) { - uint32_t * size; - static const uint8_t magic[] = {0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a}; - uint8_t buf[24]; - - /*If it's a PNG file...*/ - if(src_type == LV_IMAGE_SRC_FILE) { - /* Read the width and height from the file. They have a constant location: - * [16..19]: width - * [20..23]: height - */ - uint32_t rn; - lv_fs_read(&dsc->file, buf, sizeof(buf), &rn); - - if(rn != sizeof(buf)) return LV_RESULT_INVALID; - - if(lv_memcmp(buf, magic, sizeof(magic)) != 0) return LV_RESULT_INVALID; - - size = (uint32_t *)&buf[16]; - } - /*If it's a PNG file in a C array...*/ - else { - const lv_image_dsc_t * img_dsc = dsc->src; - const uint32_t data_size = img_dsc->data_size; - size = ((uint32_t *)img_dsc->data) + 4; - - if(data_size < sizeof(magic)) return LV_RESULT_INVALID; - if(lv_memcmp(img_dsc->data, magic, sizeof(magic)) != 0) return LV_RESULT_INVALID; - } - - /*Save the data in the header*/ - header->cf = LV_COLOR_FORMAT_ARGB8888; - /*The width and height are stored in Big endian format so convert them to little endian*/ - header->w = (int32_t)((size[0] & 0xff000000) >> 24) + ((size[0] & 0x00ff0000) >> 8); - header->h = (int32_t)((size[1] & 0xff000000) >> 24) + ((size[1] & 0x00ff0000) >> 8); - - return LV_RESULT_OK; - } - - return LV_RESULT_INVALID; /*If didn't succeeded earlier then it's an error*/ -} - -/** - * Open a PNG image and return the decided image - * @param decoder pointer to the decoder - * @param dsc pointer to the decoder descriptor - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't open the image - */ -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); /*Unused*/ - lv_draw_buf_t * decoded; - decoded = decode_png(dsc); - - if(decoded == NULL) { - return LV_RESULT_INVALID; - } - - lv_draw_buf_t * adjusted = lv_image_decoder_post_process(dsc, decoded); - if(adjusted == NULL) { - lv_draw_buf_destroy_user(image_cache_draw_buf_handlers, decoded); - return LV_RESULT_INVALID; - } - - /*The adjusted draw buffer is newly allocated.*/ - if(adjusted != decoded) { - lv_draw_buf_destroy_user(image_cache_draw_buf_handlers, decoded); - decoded = adjusted; - } - - dsc->decoded = decoded; - - if(dsc->args.no_cache) return LV_RESULT_OK; - - /*If the image cache is disabled, just return the decoded image*/ - if(!lv_image_cache_is_enabled()) return LV_RESULT_OK; - - /*Add the decoded image to the cache*/ - lv_image_cache_data_t search_key; - search_key.src_type = dsc->src_type; - search_key.src = dsc->src; - search_key.slot.size = decoded->data_size; - - lv_cache_entry_t * entry = lv_image_decoder_add_to_cache(decoder, &search_key, decoded, NULL); - - if(entry == NULL) { - lv_draw_buf_destroy_user(image_cache_draw_buf_handlers, decoded); - return LV_RESULT_INVALID; - } - dsc->cache_entry = entry; - - return LV_RESULT_OK; /*The image is fully decoded. Return with its pointer*/ -} - -/** - * Free the allocated resources - */ -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); /*Unused*/ - - if(dsc->args.no_cache || - !lv_image_cache_is_enabled()) lv_draw_buf_destroy_user(image_cache_draw_buf_handlers, (lv_draw_buf_t *)dsc->decoded); -} - -static uint8_t * alloc_file(const char * filename, uint32_t * size) -{ - uint8_t * data = NULL; - lv_fs_file_t f; - uint32_t data_size; - uint32_t rn; - lv_fs_res_t res; - - *size = 0; - - res = lv_fs_open(&f, filename, LV_FS_MODE_RD); - if(res != LV_FS_RES_OK) { - LV_LOG_WARN("can't open %s", filename); - return NULL; - } - - res = lv_fs_seek(&f, 0, LV_FS_SEEK_END); - if(res != LV_FS_RES_OK) { - goto failed; - } - - res = lv_fs_tell(&f, &data_size); - if(res != LV_FS_RES_OK) { - goto failed; - } - - res = lv_fs_seek(&f, 0, LV_FS_SEEK_SET); - if(res != LV_FS_RES_OK) { - goto failed; - } - - /*Read file to buffer*/ - data = lv_malloc(data_size); - if(data == NULL) { - LV_LOG_WARN("malloc failed for data"); - goto failed; - } - - res = lv_fs_read(&f, data, data_size, &rn); - - if(res == LV_FS_RES_OK && rn == data_size) { - *size = rn; - } - else { - LV_LOG_WARN("read file failed"); - lv_free(data); - data = NULL; - } - -failed: - lv_fs_close(&f); - - return data; -} - -static lv_draw_buf_t * decode_png(lv_image_decoder_dsc_t * dsc) -{ - int ret; - uint8_t * png_data; - uint32_t png_data_size; - /*Prepare png_image*/ - png_image image; - lv_memzero(&image, sizeof(image)); - image.version = PNG_IMAGE_VERSION; - - if(dsc->src_type == LV_IMAGE_SRC_FILE) { - if(lv_strcmp(lv_fs_get_ext(dsc->src), "png") != 0) { /*Check the extension*/ - return NULL; - } - - png_data = alloc_file(dsc->src, &png_data_size); - if(png_data == NULL) { - LV_LOG_WARN("can't load file: %s", (const char *)dsc->src); - return NULL; - } - } - else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { - const lv_image_dsc_t * img_dsc = dsc->src; - png_data = (uint8_t *)img_dsc->data; - png_data_size = img_dsc->data_size; - } - else - return NULL; - - /*Ready to read file*/ - ret = png_image_begin_read_from_memory(&image, png_data, png_data_size); - if(!ret) { - LV_LOG_ERROR("png read failed: %d", ret); - if(dsc->src_type == LV_IMAGE_SRC_FILE) - lv_free(png_data); - return NULL; - } - - lv_color_format_t cf; - if(dsc->args.use_indexed && (image.format & PNG_FORMAT_FLAG_COLORMAP)) { - cf = LV_COLOR_FORMAT_I8; - image.format = PNG_FORMAT_BGRA_COLORMAP; - } - else { - cf = LV_COLOR_FORMAT_ARGB8888; - image.format = PNG_FORMAT_BGRA; - } - - /*Alloc image buffer*/ - lv_draw_buf_t * decoded; - decoded = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, image.width, image.height, cf, LV_STRIDE_AUTO); - if(decoded == NULL) { - - if(dsc->src_type == LV_IMAGE_SRC_FILE) { - LV_LOG_ERROR("alloc PNG_IMAGE_SIZE(%" LV_PRIu32 ") failed: %s", (uint32_t)PNG_IMAGE_SIZE(image), - (const char *)dsc->src); - lv_free(png_data); - } - else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) - LV_LOG_ERROR("alloc PNG_IMAGE_SIZE(%" LV_PRIu32 ")", (uint32_t)PNG_IMAGE_SIZE(image)); - - return NULL; - } - - void * palette = decoded->data; - void * map = decoded->data + LV_COLOR_INDEXED_PALETTE_SIZE(cf) * sizeof(lv_color32_t); - - /*Start decoding*/ - ret = png_image_finish_read(&image, NULL, map, decoded->header.stride, palette); - png_image_free(&image); - if(dsc->src_type == LV_IMAGE_SRC_FILE) - lv_free(png_data); - if(!ret) { - LV_LOG_ERROR("png decode failed: %s", image.message); - lv_draw_buf_destroy_user(image_cache_draw_buf_handlers, decoded); - return NULL; - } - - return decoded; -} - -#endif /*LV_USE_LIBPNG*/ diff --git a/L3_Middlewares/LVGL/src/libs/lodepng/lodepng.c b/L3_Middlewares/LVGL/src/libs/lodepng/lodepng.c deleted file mode 100644 index a3f0b59..0000000 --- a/L3_Middlewares/LVGL/src/libs/lodepng/lodepng.c +++ /dev/null @@ -1,7657 +0,0 @@ -/* -LodePNG version 20230410 - -Copyright (c) 2005-2023 Lode Vandevenne - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*/ - -/* -The manual and changelog are in the header file "lodepng.h" -Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for C. -*/ - -#include "lodepng.h" -#if LV_USE_LODEPNG -#include "../../core/lv_global.h" - -#define image_cache_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->image_cache_draw_buf_handlers) - -#ifdef LODEPNG_COMPILE_DISK - #include /* LONG_MAX */ - #include /* file handling */ -#endif /* LODEPNG_COMPILE_DISK */ - -#ifdef LODEPNG_COMPILE_ALLOCATORS - #include /* allocations */ -#endif /* LODEPNG_COMPILE_ALLOCATORS */ - -#if defined(_MSC_VER) && (_MSC_VER >= 1310) /*Visual Studio: A few warning types are not desired here.*/ - #pragma warning( disable : 4244 ) /*implicit conversions: not warned by gcc -Wall -Wextra and requires too much casts*/ - #pragma warning( disable : 4996 ) /*VS does not like fopen, but fopen_s is not standard C so unusable here*/ -#endif /*_MSC_VER */ - -const char * LODEPNG_VERSION_STRING = "20230410"; - -/* -This source file is divided into the following large parts. The code sections -with the "LODEPNG_COMPILE_" #defines divide this up further in an intermixed way. --Tools for C and common code for PNG and Zlib --C Code for Zlib (huffman, deflate, ...) --C Code for PNG (file format chunks, adam7, PNG filters, color conversions, ...) --The C++ wrapper around all of the above -*/ - -/* ////////////////////////////////////////////////////////////////////////// */ -/* ////////////////////////////////////////////////////////////////////////// */ -/* // Tools for C, and common code for PNG and Zlib. // */ -/* ////////////////////////////////////////////////////////////////////////// */ -/* ////////////////////////////////////////////////////////////////////////// */ - -/*The malloc, realloc and free functions defined here with "lodepng_" in front -of the name, so that you can easily change them to others related to your -platform if needed. Everything else in the code calls these. Pass --DLODEPNG_NO_COMPILE_ALLOCATORS to the compiler, or comment out -#define LODEPNG_COMPILE_ALLOCATORS in the header, to disable the ones here and -define them in your own project's source files without needing to change -lodepng source code. Don't forget to remove "static" if you copypaste them -from here.*/ - -#ifdef LODEPNG_COMPILE_ALLOCATORS -static void * lodepng_malloc(size_t size) -{ -#ifdef LODEPNG_MAX_ALLOC - if(size > LODEPNG_MAX_ALLOC) return 0; -#endif - return lv_malloc(size); -} - -/* NOTE: when realloc returns NULL, it leaves the original memory untouched */ -static void * lodepng_realloc(void * ptr, size_t new_size) -{ -#ifdef LODEPNG_MAX_ALLOC - if(new_size > LODEPNG_MAX_ALLOC) return 0; -#endif - return lv_realloc(ptr, new_size); -} - -static void lodepng_free(void * ptr) -{ - lv_free(ptr); -} -#else /*LODEPNG_COMPILE_ALLOCATORS*/ -/* TODO: support giving additional void* payload to the custom allocators */ -void * lodepng_malloc(size_t size); -void * lodepng_realloc(void * ptr, size_t new_size); -void lodepng_free(void * ptr); -#endif /*LODEPNG_COMPILE_ALLOCATORS*/ - -/* convince the compiler to inline a function, for use when this measurably improves performance */ -/* inline is not available in C90, but use it when supported by the compiler */ -#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || (defined(__cplusplus) && (__cplusplus >= 199711L)) - #define LODEPNG_INLINE inline -#else - #define LODEPNG_INLINE /* not available */ -#endif - -/* restrict is not available in C90, but use it when supported by the compiler */ -#if (defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) ||\ - (defined(_MSC_VER) && (_MSC_VER >= 1400)) || \ - (defined(__WATCOMC__) && (__WATCOMC__ >= 1250) && !defined(__cplusplus)) - #define LODEPNG_RESTRICT __restrict -#else - #define LODEPNG_RESTRICT /* not available */ -#endif - -/* Replacements for C library functions such as memcpy and strlen, to support platforms -where a full C library is not available. The compiler can recognize them and compile -to something as fast. */ - -static void lodepng_memcpy(void * LODEPNG_RESTRICT dst, - const void * LODEPNG_RESTRICT src, size_t size) -{ - lv_memcpy(dst, src, size); -} - -static void lodepng_memset(void * LODEPNG_RESTRICT dst, - int value, size_t num) -{ - lv_memset(dst, value, num); -} - -/* does not check memory out of bounds, do not use on untrusted data */ -static size_t lodepng_strlen(const char * a) -{ - const char * orig = a; - /* avoid warning about unused function in case of disabled COMPILE... macros */ - (void)(&lodepng_strlen); - while(*a) a++; - return (size_t)(a - orig); -} - -#define LODEPNG_MAX(a, b) (((a) > (b)) ? (a) : (b)) -#define LODEPNG_MIN(a, b) (((a) < (b)) ? (a) : (b)) - -#if defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_DECODER) -/* Safely check if adding two integers will overflow (no undefined -behavior, compiler removing the code, etc...) and output result. */ -static int lodepng_addofl(size_t a, size_t b, size_t * result) -{ - *result = a + b; /* Unsigned addition is well defined and safe in C90 */ - return *result < a; -} -#endif /*defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_DECODER)*/ - -#ifdef LODEPNG_COMPILE_DECODER -/* Safely check if multiplying two integers will overflow (no undefined -behavior, compiler removing the code, etc...) and output result. */ -static int lodepng_mulofl(size_t a, size_t b, size_t * result) -{ - *result = a * b; /* Unsigned multiplication is well defined and safe in C90 */ - return (a != 0 && *result / a != b); -} - -#ifdef LODEPNG_COMPILE_ZLIB -/* Safely check if a + b > c, even if overflow could happen. */ -static int lodepng_gtofl(size_t a, size_t b, size_t c) -{ - size_t d; - if(lodepng_addofl(a, b, &d)) return 1; - return d > c; -} -#endif /*LODEPNG_COMPILE_ZLIB*/ -#endif /*LODEPNG_COMPILE_DECODER*/ - - -/* -Often in case of an error a value is assigned to a variable and then it breaks -out of a loop (to go to the cleanup phase of a function). This macro does that. -It makes the error handling code shorter and more readable. - -Example: if(!uivector_resize(&lz77_encoded, datasize)) ERROR_BREAK(83); -*/ -#define CERROR_BREAK(errorvar, code){\ - errorvar = code;\ - break;\ - } - -/*version of CERROR_BREAK that assumes the common case where the error variable is named "error"*/ -#define ERROR_BREAK(code) CERROR_BREAK(error, code) - -/*Set error var to the error code, and return it.*/ -#define CERROR_RETURN_ERROR(errorvar, code){\ - errorvar = code;\ - return code;\ - } - -/*Try the code, if it returns error, also return the error.*/ -#define CERROR_TRY_RETURN(call){\ - unsigned error = call;\ - if(error) return error;\ - } - -/*Set error var to the error code, and return from the void function.*/ -#define CERROR_RETURN(errorvar, code){\ - errorvar = code;\ - return;\ - } - -/* -About uivector, ucvector and string: --All of them wrap dynamic arrays or text strings in a similar way. --LodePNG was originally written in C++. The vectors replace the std::vectors that were used in the C++ version. --The string tools are made to avoid problems with compilers that declare things like strncat as deprecated. --They're not used in the interface, only internally in this file as static functions. --As with many other structs in this file, the init and cleanup functions serve as ctor and dtor. -*/ - -#ifdef LODEPNG_COMPILE_ZLIB -#ifdef LODEPNG_COMPILE_ENCODER -/*dynamic vector of unsigned ints*/ -typedef struct uivector { - unsigned * data; - size_t size; /*size in number of unsigned longs*/ - size_t allocsize; /*allocated size in bytes*/ -} uivector; - -static void uivector_cleanup(void * p) -{ - ((uivector *)p)->size = ((uivector *)p)->allocsize = 0; - lodepng_free(((uivector *)p)->data); - ((uivector *)p)->data = NULL; -} - -/*returns 1 if success, 0 if failure ==> nothing done*/ -static unsigned uivector_resize(uivector * p, size_t size) -{ - size_t allocsize = size * sizeof(unsigned); - if(allocsize > p->allocsize) { - size_t newsize = allocsize + (p->allocsize >> 1u); - void * data = lodepng_realloc(p->data, newsize); - if(data) { - p->allocsize = newsize; - p->data = (unsigned *)data; - } - else return 0; /*error: not enough memory*/ - } - p->size = size; - return 1; /*success*/ -} - -static void uivector_init(uivector * p) -{ - p->data = NULL; - p->size = p->allocsize = 0; -} - -/*returns 1 if success, 0 if failure ==> nothing done*/ -static unsigned uivector_push_back(uivector * p, unsigned c) -{ - if(!uivector_resize(p, p->size + 1)) return 0; - p->data[p->size - 1] = c; - return 1; -} -#endif /*LODEPNG_COMPILE_ENCODER*/ -#endif /*LODEPNG_COMPILE_ZLIB*/ - -/* /////////////////////////////////////////////////////////////////////////// */ - -/*dynamic vector of unsigned chars*/ -typedef struct ucvector { - unsigned char * data; - size_t size; /*used size*/ - size_t allocsize; /*allocated size*/ -} ucvector; - -/*returns 1 if success, 0 if failure ==> nothing done*/ -static unsigned ucvector_reserve(ucvector * p, size_t size) -{ - if(size > p->allocsize) { - size_t newsize = size + (p->allocsize >> 1u); - void * data = lodepng_realloc(p->data, newsize); - if(data) { - p->allocsize = newsize; - p->data = (unsigned char *)data; - } - else return 0; /*error: not enough memory*/ - } - return 1; /*success*/ -} - -/*returns 1 if success, 0 if failure ==> nothing done*/ -static unsigned ucvector_resize(ucvector * p, size_t size) -{ - p->size = size; - return ucvector_reserve(p, size); -} - -static ucvector ucvector_init(unsigned char * buffer, size_t size) -{ - ucvector v; - v.data = buffer; - v.allocsize = v.size = size; - return v; -} - -/* ////////////////////////////////////////////////////////////////////////// */ - -#ifdef LODEPNG_COMPILE_PNG -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - -/*free string pointer and set it to NULL*/ -static void string_cleanup(char ** out) -{ - lodepng_free(*out); - *out = NULL; -} - -/*also appends null termination character*/ -static char * alloc_string_sized(const char * in, size_t insize) -{ - char * out = (char *)lodepng_malloc(insize + 1); - if(out) { - lodepng_memcpy(out, in, insize); - out[insize] = 0; - } - return out; -} - -/* dynamically allocates a new string with a copy of the null terminated input text */ -static char * alloc_string(const char * in) -{ - return alloc_string_sized(in, lodepng_strlen(in)); -} -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ -#endif /*LODEPNG_COMPILE_PNG*/ - -/* ////////////////////////////////////////////////////////////////////////// */ - -#if defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_PNG) -static unsigned lodepng_read32bitInt(const unsigned char * buffer) -{ - return (((unsigned)buffer[0] << 24u) | ((unsigned)buffer[1] << 16u) | - ((unsigned)buffer[2] << 8u) | (unsigned)buffer[3]); -} -#endif /*defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_PNG)*/ - -#if defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER) -/*buffer must have at least 4 allocated bytes available*/ -static void lodepng_set32bitInt(unsigned char * buffer, unsigned value) -{ - buffer[0] = (unsigned char)((value >> 24) & 0xff); - buffer[1] = (unsigned char)((value >> 16) & 0xff); - buffer[2] = (unsigned char)((value >> 8) & 0xff); - buffer[3] = (unsigned char)((value) & 0xff); -} -#endif /*defined(LODEPNG_COMPILE_PNG) || defined(LODEPNG_COMPILE_ENCODER)*/ - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / File IO / */ -/* ////////////////////////////////////////////////////////////////////////// */ - -#ifdef LODEPNG_COMPILE_DISK - -/* returns negative value on error. This should be pure C compatible, so no fstat. */ -static long lodepng_filesize(const char * filename) -{ - lv_fs_file_t f; - lv_fs_res_t res = lv_fs_open(&f, filename, LV_FS_MODE_RD); - if(res != LV_FS_RES_OK) return -1; - uint32_t size = 0; - if(lv_fs_seek(&f, 0, LV_FS_SEEK_END) != 0) { - lv_fs_close(&f); - return -1; - } - - lv_fs_tell(&f, &size); - lv_fs_close(&f); - return size; -} - -/* load file into buffer that already has the correct allocated size. Returns error code.*/ -static unsigned lodepng_buffer_file(unsigned char * out, size_t size, const char * filename) -{ - lv_fs_file_t f; - lv_fs_res_t res = lv_fs_open(&f, filename, LV_FS_MODE_RD); - if(res != LV_FS_RES_OK) return 78; - - uint32_t br; - res = lv_fs_read(&f, out, size, &br); - lv_fs_close(&f); - - if(res != LV_FS_RES_OK) return 78; - if(br != size) return 78; - - return 0; -} - -unsigned lodepng_load_file(unsigned char ** out, size_t * outsize, const char * filename) -{ - long size = lodepng_filesize(filename); - if(size < 0) return 78; - *outsize = (size_t)size; - - *out = (unsigned char *)lodepng_malloc((size_t)size); - if(!(*out) && size > 0) return 83; /*the above malloc failed*/ - - return lodepng_buffer_file(*out, (size_t)size, filename); -} - -/*write given buffer to the file, overwriting the file, it doesn't append to it.*/ -unsigned lodepng_save_file(const unsigned char * buffer, size_t buffersize, const char * filename) -{ - lv_fs_file_t f; - lv_fs_res_t res = lv_fs_open(&f, filename, LV_FS_MODE_WR); - if(res != LV_FS_RES_OK) return 79; - - uint32_t bw; - res = lv_fs_write(&f, buffer, buffersize, &bw); - lv_fs_close(&f); - return 0; -} - -#endif /*LODEPNG_COMPILE_DISK*/ - -/* ////////////////////////////////////////////////////////////////////////// */ -/* ////////////////////////////////////////////////////////////////////////// */ -/* // End of common code and tools. Begin of Zlib related code. // */ -/* ////////////////////////////////////////////////////////////////////////// */ -/* ////////////////////////////////////////////////////////////////////////// */ - -#ifdef LODEPNG_COMPILE_ZLIB -#ifdef LODEPNG_COMPILE_ENCODER - -typedef struct { - ucvector * data; - unsigned char bp; /*ok to overflow, indicates bit pos inside byte*/ -} LodePNGBitWriter; - -static void LodePNGBitWriter_init(LodePNGBitWriter * writer, ucvector * data) -{ - writer->data = data; - writer->bp = 0; -} - -/*TODO: this ignores potential out of memory errors*/ -#define WRITEBIT(writer, bit){\ - /* append new byte */\ - if(((writer->bp) & 7u) == 0) {\ - if(!ucvector_resize(writer->data, writer->data->size + 1)) return;\ - writer->data->data[writer->data->size - 1] = 0;\ - }\ - (writer->data->data[writer->data->size - 1]) |= (bit << ((writer->bp) & 7u));\ - ++writer->bp;\ - } - -/* LSB of value is written first, and LSB of bytes is used first */ -static void writeBits(LodePNGBitWriter * writer, unsigned value, size_t nbits) -{ - if(nbits == 1) { /* compiler should statically compile this case if nbits == 1 */ - WRITEBIT(writer, value); - } - else { - /* TODO: increase output size only once here rather than in each WRITEBIT */ - size_t i; - for(i = 0; i != nbits; ++i) { - WRITEBIT(writer, (unsigned char)((value >> i) & 1)); - } - } -} - -/* This one is to use for adding huffman symbol, the value bits are written MSB first */ -static void writeBitsReversed(LodePNGBitWriter * writer, unsigned value, size_t nbits) -{ - size_t i; - for(i = 0; i != nbits; ++i) { - /* TODO: increase output size only once here rather than in each WRITEBIT */ - WRITEBIT(writer, (unsigned char)((value >> (nbits - 1u - i)) & 1u)); - } -} -#endif /*LODEPNG_COMPILE_ENCODER*/ - -#ifdef LODEPNG_COMPILE_DECODER - -typedef struct { - const unsigned char * data; - size_t size; /*size of data in bytes*/ - size_t bitsize; /*size of data in bits, end of valid bp values, should be 8*size*/ - size_t bp; - unsigned buffer; /*buffer for reading bits. NOTE: 'unsigned' must support at least 32 bits*/ -} LodePNGBitReader; - -/* data size argument is in bytes. Returns error if size too large causing overflow */ -static unsigned LodePNGBitReader_init(LodePNGBitReader * reader, const unsigned char * data, size_t size) -{ - size_t temp; - reader->data = data; - reader->size = size; - /* size in bits, return error if overflow (if size_t is 32 bit this supports up to 500MB) */ - if(lodepng_mulofl(size, 8u, &reader->bitsize)) return 105; - /*ensure incremented bp can be compared to bitsize without overflow even when it would be incremented 32 too much and - trying to ensure 32 more bits*/ - if(lodepng_addofl(reader->bitsize, 64u, &temp)) return 105; - reader->bp = 0; - reader->buffer = 0; - return 0; /*ok*/ -} - -/* -ensureBits functions: -Ensures the reader can at least read nbits bits in one or more readBits calls, -safely even if not enough bits are available. -The nbits parameter is unused but is given for documentation purposes, error -checking for amount of bits must be done beforehand. -*/ - -/*See ensureBits documentation above. This one ensures up to 9 bits */ -static LODEPNG_INLINE void ensureBits9(LodePNGBitReader * reader, size_t nbits) -{ - size_t start = reader->bp >> 3u; - size_t size = reader->size; - if(start + 1u < size) { - reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u); - reader->buffer >>= (reader->bp & 7u); - } - else { - reader->buffer = 0; - if(start + 0u < size) reader->buffer = reader->data[start + 0]; - reader->buffer >>= (reader->bp & 7u); - } - (void)nbits; -} - -/*See ensureBits documentation above. This one ensures up to 17 bits */ -static LODEPNG_INLINE void ensureBits17(LodePNGBitReader * reader, size_t nbits) -{ - size_t start = reader->bp >> 3u; - size_t size = reader->size; - if(start + 2u < size) { - reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u) | - ((unsigned)reader->data[start + 2] << 16u); - reader->buffer >>= (reader->bp & 7u); - } - else { - reader->buffer = 0; - if(start + 0u < size) reader->buffer |= reader->data[start + 0]; - if(start + 1u < size) reader->buffer |= ((unsigned)reader->data[start + 1] << 8u); - reader->buffer >>= (reader->bp & 7u); - } - (void)nbits; -} - -/*See ensureBits documentation above. This one ensures up to 25 bits */ -static LODEPNG_INLINE void ensureBits25(LodePNGBitReader * reader, size_t nbits) -{ - size_t start = reader->bp >> 3u; - size_t size = reader->size; - if(start + 3u < size) { - reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u) | - ((unsigned)reader->data[start + 2] << 16u) | ((unsigned)reader->data[start + 3] << 24u); - reader->buffer >>= (reader->bp & 7u); - } - else { - reader->buffer = 0; - if(start + 0u < size) reader->buffer |= reader->data[start + 0]; - if(start + 1u < size) reader->buffer |= ((unsigned)reader->data[start + 1] << 8u); - if(start + 2u < size) reader->buffer |= ((unsigned)reader->data[start + 2] << 16u); - reader->buffer >>= (reader->bp & 7u); - } - (void)nbits; -} - -/*See ensureBits documentation above. This one ensures up to 32 bits */ -static LODEPNG_INLINE void ensureBits32(LodePNGBitReader * reader, size_t nbits) -{ - size_t start = reader->bp >> 3u; - size_t size = reader->size; - if(start + 4u < size) { - reader->buffer = (unsigned)reader->data[start + 0] | ((unsigned)reader->data[start + 1] << 8u) | - ((unsigned)reader->data[start + 2] << 16u) | ((unsigned)reader->data[start + 3] << 24u); - reader->buffer >>= (reader->bp & 7u); - reader->buffer |= (((unsigned)reader->data[start + 4] << 24u) << (8u - (reader->bp & 7u))); - } - else { - reader->buffer = 0; - if(start + 0u < size) reader->buffer |= reader->data[start + 0]; - if(start + 1u < size) reader->buffer |= ((unsigned)reader->data[start + 1] << 8u); - if(start + 2u < size) reader->buffer |= ((unsigned)reader->data[start + 2] << 16u); - if(start + 3u < size) reader->buffer |= ((unsigned)reader->data[start + 3] << 24u); - reader->buffer >>= (reader->bp & 7u); - } - (void)nbits; -} - -/* Get bits without advancing the bit pointer. Must have enough bits available with ensureBits. Max nbits is 31. */ -static LODEPNG_INLINE unsigned peekBits(LodePNGBitReader * reader, size_t nbits) -{ - /* The shift allows nbits to be only up to 31. */ - return reader->buffer & ((1u << nbits) - 1u); -} - -/* Must have enough bits available with ensureBits */ -static LODEPNG_INLINE void advanceBits(LodePNGBitReader * reader, size_t nbits) -{ - reader->buffer >>= nbits; - reader->bp += nbits; -} - -/* Must have enough bits available with ensureBits */ -static LODEPNG_INLINE unsigned readBits(LodePNGBitReader * reader, size_t nbits) -{ - unsigned result = peekBits(reader, nbits); - advanceBits(reader, nbits); - return result; -} -#endif /*LODEPNG_COMPILE_DECODER*/ - -static unsigned reverseBits(unsigned bits, unsigned num) -{ - /*TODO: implement faster lookup table based version when needed*/ - unsigned i, result = 0; - for(i = 0; i < num; i++) result |= ((bits >> (num - i - 1u)) & 1u) << i; - return result; -} - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / Deflate - Huffman / */ -/* ////////////////////////////////////////////////////////////////////////// */ - -#define FIRST_LENGTH_CODE_INDEX 257 -#define LAST_LENGTH_CODE_INDEX 285 -/*256 literals, the end code, some length codes, and 2 unused codes*/ -#define NUM_DEFLATE_CODE_SYMBOLS 288 -/*the distance codes have their own symbols, 30 used, 2 unused*/ -#define NUM_DISTANCE_SYMBOLS 32 -/*the code length codes. 0-15: code lengths, 16: copy previous 3-6 times, 17: 3-10 zeros, 18: 11-138 zeros*/ -#define NUM_CODE_LENGTH_CODES 19 - -/*the base lengths represented by codes 257-285*/ -static const unsigned LENGTHBASE[29] - = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, - 67, 83, 99, 115, 131, 163, 195, 227, 258 - }; - -/*the extra bits used by codes 257-285 (added to base length)*/ -static const unsigned LENGTHEXTRA[29] - = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, - 4, 4, 4, 4, 5, 5, 5, 5, 0 - }; - -/*the base backwards distances (the bits of distance codes appear after length codes and use their own huffman tree)*/ -static const unsigned DISTANCEBASE[30] - = {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, - 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 - }; - -/*the extra bits of backwards distances (added to base)*/ -static const unsigned DISTANCEEXTRA[30] - = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, - 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 - }; - -/*the order in which "code length alphabet code lengths" are stored as specified by deflate, out of this the huffman -tree of the dynamic huffman tree lengths is generated*/ -static const unsigned CLCL_ORDER[NUM_CODE_LENGTH_CODES] - = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - -/* ////////////////////////////////////////////////////////////////////////// */ - -/* -Huffman tree struct, containing multiple representations of the tree -*/ -typedef struct HuffmanTree { - unsigned * codes; /*the huffman codes (bit patterns representing the symbols)*/ - unsigned * lengths; /*the lengths of the huffman codes*/ - unsigned maxbitlen; /*maximum number of bits a single code can get*/ - unsigned numcodes; /*number of symbols in the alphabet = number of codes*/ - /* for reading only */ - unsigned char * table_len; /*length of symbol from lookup table, or max length if secondary lookup needed*/ - unsigned short * table_value; /*value of symbol from lookup table, or pointer to secondary table if needed*/ -} HuffmanTree; - -static void HuffmanTree_init(HuffmanTree * tree) -{ - tree->codes = 0; - tree->lengths = 0; - tree->table_len = 0; - tree->table_value = 0; -} - -static void HuffmanTree_cleanup(HuffmanTree * tree) -{ - lodepng_free(tree->codes); - lodepng_free(tree->lengths); - lodepng_free(tree->table_len); - lodepng_free(tree->table_value); -} - -/* amount of bits for first huffman table lookup (aka root bits), see HuffmanTree_makeTable and huffmanDecodeSymbol.*/ -/* values 8u and 9u work the fastest */ -#define FIRSTBITS 9u - -/* a symbol value too big to represent any valid symbol, to indicate reading disallowed huffman bits combination, -which is possible in case of only 0 or 1 present symbols. */ -#define INVALIDSYMBOL 65535u - -/* make table for huffman decoding */ -static unsigned HuffmanTree_makeTable(HuffmanTree * tree) -{ - static const unsigned headsize = 1u << FIRSTBITS; /*size of the first table*/ - static const unsigned mask = (1u << FIRSTBITS) /*headsize*/ - 1u; - size_t i, numpresent, pointer, size; /*total table size*/ - unsigned * maxlens = (unsigned *)lodepng_malloc(headsize * sizeof(unsigned)); - if(!maxlens) return 83; /*alloc fail*/ - - /* compute maxlens: max total bit length of symbols sharing prefix in the first table*/ - lodepng_memset(maxlens, 0, headsize * sizeof(*maxlens)); - for(i = 0; i < tree->numcodes; i++) { - unsigned symbol = tree->codes[i]; - unsigned l = tree->lengths[i]; - unsigned index; - if(l <= FIRSTBITS) continue; /*symbols that fit in first table don't increase secondary table size*/ - /*get the FIRSTBITS MSBs, the MSBs of the symbol are encoded first. See later comment about the reversing*/ - index = reverseBits(symbol >> (l - FIRSTBITS), FIRSTBITS); - maxlens[index] = LODEPNG_MAX(maxlens[index], l); - } - /* compute total table size: size of first table plus all secondary tables for symbols longer than FIRSTBITS */ - size = headsize; - for(i = 0; i < headsize; ++i) { - unsigned l = maxlens[i]; - if(l > FIRSTBITS) size += (((size_t)1) << (l - FIRSTBITS)); - } - tree->table_len = (unsigned char *)lodepng_malloc(size * sizeof(*tree->table_len)); - tree->table_value = (unsigned short *)lodepng_malloc(size * sizeof(*tree->table_value)); - if(!tree->table_len || !tree->table_value) { - lodepng_free(maxlens); - /* freeing tree->table values is done at a higher scope */ - return 83; /*alloc fail*/ - } - /*initialize with an invalid length to indicate unused entries*/ - for(i = 0; i < size; ++i) tree->table_len[i] = 16; - - /*fill in the first table for long symbols: max prefix size and pointer to secondary tables*/ - pointer = headsize; - for(i = 0; i < headsize; ++i) { - unsigned l = maxlens[i]; - if(l <= FIRSTBITS) continue; - tree->table_len[i] = l; - tree->table_value[i] = (unsigned short)pointer; - pointer += (((size_t)1) << (l - FIRSTBITS)); - } - lodepng_free(maxlens); - - /*fill in the first table for short symbols, or secondary table for long symbols*/ - numpresent = 0; - for(i = 0; i < tree->numcodes; ++i) { - unsigned l = tree->lengths[i]; - unsigned symbol, reverse; - if(l == 0) continue; - symbol = tree->codes[i]; /*the huffman bit pattern. i itself is the value.*/ - /*reverse bits, because the huffman bits are given in MSB first order but the bit reader reads LSB first*/ - reverse = reverseBits(symbol, l); - numpresent++; - - if(l <= FIRSTBITS) { - /*short symbol, fully in first table, replicated num times if l < FIRSTBITS*/ - unsigned num = 1u << (FIRSTBITS - l); - unsigned j; - for(j = 0; j < num; ++j) { - /*bit reader will read the l bits of symbol first, the remaining FIRSTBITS - l bits go to the MSB's*/ - unsigned index = reverse | (j << l); - if(tree->table_len[index] != 16) return 55; /*invalid tree: long symbol shares prefix with short symbol*/ - tree->table_len[index] = l; - tree->table_value[index] = (unsigned short)i; - } - } - else { - /*long symbol, shares prefix with other long symbols in first lookup table, needs second lookup*/ - /*the FIRSTBITS MSBs of the symbol are the first table index*/ - unsigned index = reverse & mask; - unsigned maxlen = tree->table_len[index]; - /*log2 of secondary table length, should be >= l - FIRSTBITS*/ - unsigned tablelen = maxlen - FIRSTBITS; - unsigned start = tree->table_value[index]; /*starting index in secondary table*/ - unsigned num = 1u << (tablelen - (l - FIRSTBITS)); /*amount of entries of this symbol in secondary table*/ - unsigned j; - if(maxlen < l) return 55; /*invalid tree: long symbol shares prefix with short symbol*/ - for(j = 0; j < num; ++j) { - unsigned reverse2 = reverse >> FIRSTBITS; /* l - FIRSTBITS bits */ - unsigned index2 = start + (reverse2 | (j << (l - FIRSTBITS))); - tree->table_len[index2] = l; - tree->table_value[index2] = (unsigned short)i; - } - } - } - - if(numpresent < 2) { - /* In case of exactly 1 symbol, in theory the huffman symbol needs 0 bits, - but deflate uses 1 bit instead. In case of 0 symbols, no symbols can - appear at all, but such huffman tree could still exist (e.g. if distance - codes are never used). In both cases, not all symbols of the table will be - filled in. Fill them in with an invalid symbol value so returning them from - huffmanDecodeSymbol will cause error. */ - for(i = 0; i < size; ++i) { - if(tree->table_len[i] == 16) { - /* As length, use a value smaller than FIRSTBITS for the head table, - and a value larger than FIRSTBITS for the secondary table, to ensure - valid behavior for advanceBits when reading this symbol. */ - tree->table_len[i] = (i < headsize) ? 1 : (FIRSTBITS + 1); - tree->table_value[i] = INVALIDSYMBOL; - } - } - } - else { - /* A good huffman tree has N * 2 - 1 nodes, of which N - 1 are internal nodes. - If that is not the case (due to too long length codes), the table will not - have been fully used, and this is an error (not all bit combinations can be - decoded): an oversubscribed huffman tree, indicated by error 55. */ - for(i = 0; i < size; ++i) { - if(tree->table_len[i] == 16) return 55; - } - } - - return 0; -} - -/* -Second step for the ...makeFromLengths and ...makeFromFrequencies functions. -numcodes, lengths and maxbitlen must already be filled in correctly. return -value is error. -*/ -static unsigned HuffmanTree_makeFromLengths2(HuffmanTree * tree) -{ - unsigned * blcount; - unsigned * nextcode; - unsigned error = 0; - unsigned bits, n; - - tree->codes = (unsigned *)lodepng_malloc(tree->numcodes * sizeof(unsigned)); - blcount = (unsigned *)lodepng_malloc((tree->maxbitlen + 1) * sizeof(unsigned)); - nextcode = (unsigned *)lodepng_malloc((tree->maxbitlen + 1) * sizeof(unsigned)); - if(!tree->codes || !blcount || !nextcode) error = 83; /*alloc fail*/ - - if(!error) { - for(n = 0; n != tree->maxbitlen + 1; n++) blcount[n] = nextcode[n] = 0; - /*step 1: count number of instances of each code length*/ - for(bits = 0; bits != tree->numcodes; ++bits) ++blcount[tree->lengths[bits]]; - /*step 2: generate the nextcode values*/ - for(bits = 1; bits <= tree->maxbitlen; ++bits) { - nextcode[bits] = (nextcode[bits - 1] + blcount[bits - 1]) << 1u; - } - /*step 3: generate all the codes*/ - for(n = 0; n != tree->numcodes; ++n) { - if(tree->lengths[n] != 0) { - tree->codes[n] = nextcode[tree->lengths[n]]++; - /*remove superfluous bits from the code*/ - tree->codes[n] &= ((1u << tree->lengths[n]) - 1u); - } - } - } - - lodepng_free(blcount); - lodepng_free(nextcode); - - if(!error) error = HuffmanTree_makeTable(tree); - return error; -} - -/* -given the code lengths (as stored in the PNG file), generate the tree as defined -by Deflate. maxbitlen is the maximum bits that a code in the tree can have. -return value is error. -*/ -static unsigned HuffmanTree_makeFromLengths(HuffmanTree * tree, const unsigned * bitlen, - size_t numcodes, unsigned maxbitlen) -{ - unsigned i; - tree->lengths = (unsigned *)lodepng_malloc(numcodes * sizeof(unsigned)); - if(!tree->lengths) return 83; /*alloc fail*/ - for(i = 0; i != numcodes; ++i) tree->lengths[i] = bitlen[i]; - tree->numcodes = (unsigned)numcodes; /*number of symbols*/ - tree->maxbitlen = maxbitlen; - return HuffmanTree_makeFromLengths2(tree); -} - -#ifdef LODEPNG_COMPILE_ENCODER - -/*BPM: Boundary Package Merge, see "A Fast and Space-Economical Algorithm for Length-Limited Coding", -Jyrki Katajainen, Alistair Moffat, Andrew Turpin, 1995.*/ - -/*chain node for boundary package merge*/ -typedef struct BPMNode { - int weight; /*the sum of all weights in this chain*/ - unsigned index; /*index of this leaf node (called "count" in the paper)*/ - struct BPMNode * tail; /*the next nodes in this chain (null if last)*/ - int in_use; -} BPMNode; - -/*lists of chains*/ -typedef struct BPMLists { - /*memory pool*/ - unsigned memsize; - BPMNode * memory; - unsigned numfree; - unsigned nextfree; - BPMNode ** freelist; - /*two heads of lookahead chains per list*/ - unsigned listsize; - BPMNode ** chains0; - BPMNode ** chains1; -} BPMLists; - -/*creates a new chain node with the given parameters, from the memory in the lists */ -static BPMNode * bpmnode_create(BPMLists * lists, int weight, unsigned index, BPMNode * tail) -{ - unsigned i; - BPMNode * result; - - /*memory full, so garbage collect*/ - if(lists->nextfree >= lists->numfree) { - /*mark only those that are in use*/ - for(i = 0; i != lists->memsize; ++i) lists->memory[i].in_use = 0; - for(i = 0; i != lists->listsize; ++i) { - BPMNode * node; - for(node = lists->chains0[i]; node != 0; node = node->tail) node->in_use = 1; - for(node = lists->chains1[i]; node != 0; node = node->tail) node->in_use = 1; - } - /*collect those that are free*/ - lists->numfree = 0; - for(i = 0; i != lists->memsize; ++i) { - if(!lists->memory[i].in_use) lists->freelist[lists->numfree++] = &lists->memory[i]; - } - lists->nextfree = 0; - } - - result = lists->freelist[lists->nextfree++]; - result->weight = weight; - result->index = index; - result->tail = tail; - return result; -} - -/*sort the leaves with stable mergesort*/ -static void bpmnode_sort(BPMNode * leaves, size_t num) -{ - BPMNode * mem = (BPMNode *)lodepng_malloc(sizeof(*leaves) * num); - size_t width, counter = 0; - for(width = 1; width < num; width *= 2) { - BPMNode * a = (counter & 1) ? mem : leaves; - BPMNode * b = (counter & 1) ? leaves : mem; - size_t p; - for(p = 0; p < num; p += 2 * width) { - size_t q = (p + width > num) ? num : (p + width); - size_t r = (p + 2 * width > num) ? num : (p + 2 * width); - size_t i = p, j = q, k; - for(k = p; k < r; k++) { - if(i < q && (j >= r || a[i].weight <= a[j].weight)) b[k] = a[i++]; - else b[k] = a[j++]; - } - } - counter++; - } - if(counter & 1) lodepng_memcpy(leaves, mem, sizeof(*leaves) * num); - lodepng_free(mem); -} - -/*Boundary Package Merge step, numpresent is the amount of leaves, and c is the current chain.*/ -static void boundaryPM(BPMLists * lists, BPMNode * leaves, size_t numpresent, int c, int num) -{ - unsigned lastindex = lists->chains1[c]->index; - - if(c == 0) { - if(lastindex >= numpresent) return; - lists->chains0[c] = lists->chains1[c]; - lists->chains1[c] = bpmnode_create(lists, leaves[lastindex].weight, lastindex + 1, 0); - } - else { - /*sum of the weights of the head nodes of the previous lookahead chains.*/ - int sum = lists->chains0[c - 1]->weight + lists->chains1[c - 1]->weight; - lists->chains0[c] = lists->chains1[c]; - if(lastindex < numpresent && sum > leaves[lastindex].weight) { - lists->chains1[c] = bpmnode_create(lists, leaves[lastindex].weight, lastindex + 1, lists->chains1[c]->tail); - return; - } - lists->chains1[c] = bpmnode_create(lists, sum, lastindex, lists->chains1[c - 1]); - /*in the end we are only interested in the chain of the last list, so no - need to recurse if we're at the last one (this gives measurable speedup)*/ - if(num + 1 < (int)(2 * numpresent - 2)) { - boundaryPM(lists, leaves, numpresent, c - 1, num); - boundaryPM(lists, leaves, numpresent, c - 1, num); - } - } -} - -unsigned lodepng_huffman_code_lengths(unsigned * lengths, const unsigned * frequencies, - size_t numcodes, unsigned maxbitlen) -{ - unsigned error = 0; - unsigned i; - size_t numpresent = 0; /*number of symbols with non-zero frequency*/ - BPMNode * leaves; /*the symbols, only those with > 0 frequency*/ - - if(numcodes == 0) return 80; /*error: a tree of 0 symbols is not supposed to be made*/ - if((1u << maxbitlen) < (unsigned)numcodes) return 80; /*error: represent all symbols*/ - - leaves = (BPMNode *)lodepng_malloc(numcodes * sizeof(*leaves)); - if(!leaves) return 83; /*alloc fail*/ - - for(i = 0; i != numcodes; ++i) { - if(frequencies[i] > 0) { - leaves[numpresent].weight = (int)frequencies[i]; - leaves[numpresent].index = i; - ++numpresent; - } - } - - lodepng_memset(lengths, 0, numcodes * sizeof(*lengths)); - - /*ensure at least two present symbols. There should be at least one symbol - according to RFC 1951 section 3.2.7. Some decoders incorrectly require two. To - make these work as well ensure there are at least two symbols. The - Package-Merge code below also doesn't work correctly if there's only one - symbol, it'd give it the theoretical 0 bits but in practice zlib wants 1 bit*/ - if(numpresent == 0) { - lengths[0] = lengths[1] = 1; /*note that for RFC 1951 section 3.2.7, only lengths[0] = 1 is needed*/ - } - else if(numpresent == 1) { - lengths[leaves[0].index] = 1; - lengths[leaves[0].index == 0 ? 1 : 0] = 1; - } - else { - BPMLists lists; - BPMNode * node; - - bpmnode_sort(leaves, numpresent); - - lists.listsize = maxbitlen; - lists.memsize = 2 * maxbitlen * (maxbitlen + 1); - lists.nextfree = 0; - lists.numfree = lists.memsize; - lists.memory = (BPMNode *)lodepng_malloc(lists.memsize * sizeof(*lists.memory)); - lists.freelist = (BPMNode **)lodepng_malloc(lists.memsize * sizeof(BPMNode *)); - lists.chains0 = (BPMNode **)lodepng_malloc(lists.listsize * sizeof(BPMNode *)); - lists.chains1 = (BPMNode **)lodepng_malloc(lists.listsize * sizeof(BPMNode *)); - if(!lists.memory || !lists.freelist || !lists.chains0 || !lists.chains1) error = 83; /*alloc fail*/ - - if(!error) { - for(i = 0; i != lists.memsize; ++i) lists.freelist[i] = &lists.memory[i]; - - bpmnode_create(&lists, leaves[0].weight, 1, 0); - bpmnode_create(&lists, leaves[1].weight, 2, 0); - - for(i = 0; i != lists.listsize; ++i) { - lists.chains0[i] = &lists.memory[0]; - lists.chains1[i] = &lists.memory[1]; - } - - /*each boundaryPM call adds one chain to the last list, and we need 2 * numpresent - 2 chains.*/ - for(i = 2; i != 2 * numpresent - 2; ++i) boundaryPM(&lists, leaves, numpresent, (int)maxbitlen - 1, (int)i); - - for(node = lists.chains1[maxbitlen - 1]; node; node = node->tail) { - for(i = 0; i != node->index; ++i) ++lengths[leaves[i].index]; - } - } - - lodepng_free(lists.memory); - lodepng_free(lists.freelist); - lodepng_free(lists.chains0); - lodepng_free(lists.chains1); - } - - lodepng_free(leaves); - return error; -} - -/*Create the Huffman tree given the symbol frequencies*/ -static unsigned HuffmanTree_makeFromFrequencies(HuffmanTree * tree, const unsigned * frequencies, - size_t mincodes, size_t numcodes, unsigned maxbitlen) -{ - unsigned error = 0; - while(!frequencies[numcodes - 1] && numcodes > mincodes) --numcodes; /*trim zeroes*/ - tree->lengths = (unsigned *)lodepng_malloc(numcodes * sizeof(unsigned)); - if(!tree->lengths) return 83; /*alloc fail*/ - tree->maxbitlen = maxbitlen; - tree->numcodes = (unsigned)numcodes; /*number of symbols*/ - - error = lodepng_huffman_code_lengths(tree->lengths, frequencies, numcodes, maxbitlen); - if(!error) error = HuffmanTree_makeFromLengths2(tree); - return error; -} -#endif /*LODEPNG_COMPILE_ENCODER*/ - -/*get the literal and length code tree of a deflated block with fixed tree, as per the deflate specification*/ -static unsigned generateFixedLitLenTree(HuffmanTree * tree) -{ - unsigned i, error = 0; - unsigned * bitlen = (unsigned *)lodepng_malloc(NUM_DEFLATE_CODE_SYMBOLS * sizeof(unsigned)); - if(!bitlen) return 83; /*alloc fail*/ - - /*288 possible codes: 0-255=literals, 256=endcode, 257-285=lengthcodes, 286-287=unused*/ - for(i = 0; i <= 143; ++i) bitlen[i] = 8; - for(i = 144; i <= 255; ++i) bitlen[i] = 9; - for(i = 256; i <= 279; ++i) bitlen[i] = 7; - for(i = 280; i <= 287; ++i) bitlen[i] = 8; - - error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DEFLATE_CODE_SYMBOLS, 15); - - lodepng_free(bitlen); - return error; -} - -/*get the distance code tree of a deflated block with fixed tree, as specified in the deflate specification*/ -static unsigned generateFixedDistanceTree(HuffmanTree * tree) -{ - unsigned i, error = 0; - unsigned * bitlen = (unsigned *)lodepng_malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); - if(!bitlen) return 83; /*alloc fail*/ - - /*there are 32 distance codes, but 30-31 are unused*/ - for(i = 0; i != NUM_DISTANCE_SYMBOLS; ++i) bitlen[i] = 5; - error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DISTANCE_SYMBOLS, 15); - - lodepng_free(bitlen); - return error; -} - -#ifdef LODEPNG_COMPILE_DECODER - -/* -returns the code. The bit reader must already have been ensured at least 15 bits -*/ -static unsigned huffmanDecodeSymbol(LodePNGBitReader * reader, const HuffmanTree * codetree) -{ - unsigned short code = peekBits(reader, FIRSTBITS); - unsigned short l = codetree->table_len[code]; - unsigned short value = codetree->table_value[code]; - if(l <= FIRSTBITS) { - advanceBits(reader, l); - return value; - } - else { - advanceBits(reader, FIRSTBITS); - value += peekBits(reader, l - FIRSTBITS); - advanceBits(reader, codetree->table_len[value] - FIRSTBITS); - return codetree->table_value[value]; - } -} -#endif /*LODEPNG_COMPILE_DECODER*/ - -#ifdef LODEPNG_COMPILE_DECODER - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / Inflator (Decompressor) / */ -/* ////////////////////////////////////////////////////////////////////////// */ - -/*get the tree of a deflated block with fixed tree, as specified in the deflate specification -Returns error code.*/ -static unsigned getTreeInflateFixed(HuffmanTree * tree_ll, HuffmanTree * tree_d) -{ - unsigned error = generateFixedLitLenTree(tree_ll); - if(error) return error; - return generateFixedDistanceTree(tree_d); -} - -/*get the tree of a deflated block with dynamic tree, the tree itself is also Huffman compressed with a known tree*/ -static unsigned getTreeInflateDynamic(HuffmanTree * tree_ll, HuffmanTree * tree_d, - LodePNGBitReader * reader) -{ - /*make sure that length values that aren't filled in will be 0, or a wrong tree will be generated*/ - unsigned error = 0; - unsigned n, HLIT, HDIST, HCLEN, i; - - /*see comments in deflateDynamic for explanation of the context and these variables, it is analogous*/ - unsigned * bitlen_ll = 0; /*lit,len code lengths*/ - unsigned * bitlen_d = 0; /*dist code lengths*/ - /*code length code lengths ("clcl"), the bit lengths of the huffman tree used to compress bitlen_ll and bitlen_d*/ - unsigned * bitlen_cl = 0; - HuffmanTree tree_cl; /*the code tree for code length codes (the huffman tree for compressed huffman trees)*/ - - if(reader->bitsize - reader->bp < 14) return 49; /*error: the bit pointer is or will go past the memory*/ - ensureBits17(reader, 14); - - /*number of literal/length codes + 257. Unlike the spec, the value 257 is added to it here already*/ - HLIT = readBits(reader, 5) + 257; - /*number of distance codes. Unlike the spec, the value 1 is added to it here already*/ - HDIST = readBits(reader, 5) + 1; - /*number of code length codes. Unlike the spec, the value 4 is added to it here already*/ - HCLEN = readBits(reader, 4) + 4; - - bitlen_cl = (unsigned *)lodepng_malloc(NUM_CODE_LENGTH_CODES * sizeof(unsigned)); - if(!bitlen_cl) return 83 /*alloc fail*/; - - HuffmanTree_init(&tree_cl); - - while(!error) { - /*read the code length codes out of 3 * (amount of code length codes) bits*/ - if(lodepng_gtofl(reader->bp, HCLEN * 3, reader->bitsize)) { - ERROR_BREAK(50); /*error: the bit pointer is or will go past the memory*/ - } - for(i = 0; i != HCLEN; ++i) { - ensureBits9(reader, 3); /*out of bounds already checked above */ - bitlen_cl[CLCL_ORDER[i]] = readBits(reader, 3); - } - for(i = HCLEN; i != NUM_CODE_LENGTH_CODES; ++i) { - bitlen_cl[CLCL_ORDER[i]] = 0; - } - - error = HuffmanTree_makeFromLengths(&tree_cl, bitlen_cl, NUM_CODE_LENGTH_CODES, 7); - if(error) break; - - /*now we can use this tree to read the lengths for the tree that this function will return*/ - bitlen_ll = (unsigned *)lodepng_malloc(NUM_DEFLATE_CODE_SYMBOLS * sizeof(unsigned)); - bitlen_d = (unsigned *)lodepng_malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); - if(!bitlen_ll || !bitlen_d) ERROR_BREAK(83 /*alloc fail*/); - lodepng_memset(bitlen_ll, 0, NUM_DEFLATE_CODE_SYMBOLS * sizeof(*bitlen_ll)); - lodepng_memset(bitlen_d, 0, NUM_DISTANCE_SYMBOLS * sizeof(*bitlen_d)); - - /*i is the current symbol we're reading in the part that contains the code lengths of lit/len and dist codes*/ - i = 0; - while(i < HLIT + HDIST) { - unsigned code; - ensureBits25(reader, 22); /* up to 15 bits for huffman code, up to 7 extra bits below*/ - code = huffmanDecodeSymbol(reader, &tree_cl); - if(code <= 15) { /*a length code*/ - if(i < HLIT) bitlen_ll[i] = code; - else bitlen_d[i - HLIT] = code; - ++i; - } - else if(code == 16) { /*repeat previous*/ - unsigned replength = 3; /*read in the 2 bits that indicate repeat length (3-6)*/ - unsigned value; /*set value to the previous code*/ - - if(i == 0) ERROR_BREAK(54); /*can't repeat previous if i is 0*/ - - replength += readBits(reader, 2); - - if(i < HLIT + 1) value = bitlen_ll[i - 1]; - else value = bitlen_d[i - HLIT - 1]; - /*repeat this value in the next lengths*/ - for(n = 0; n < replength; ++n) { - if(i >= HLIT + HDIST) ERROR_BREAK(13); /*error: i is larger than the amount of codes*/ - if(i < HLIT) bitlen_ll[i] = value; - else bitlen_d[i - HLIT] = value; - ++i; - } - } - else if(code == 17) { /*repeat "0" 3-10 times*/ - unsigned replength = 3; /*read in the bits that indicate repeat length*/ - replength += readBits(reader, 3); - - /*repeat this value in the next lengths*/ - for(n = 0; n < replength; ++n) { - if(i >= HLIT + HDIST) ERROR_BREAK(14); /*error: i is larger than the amount of codes*/ - - if(i < HLIT) bitlen_ll[i] = 0; - else bitlen_d[i - HLIT] = 0; - ++i; - } - } - else if(code == 18) { /*repeat "0" 11-138 times*/ - unsigned replength = 11; /*read in the bits that indicate repeat length*/ - replength += readBits(reader, 7); - - /*repeat this value in the next lengths*/ - for(n = 0; n < replength; ++n) { - if(i >= HLIT + HDIST) ERROR_BREAK(15); /*error: i is larger than the amount of codes*/ - - if(i < HLIT) bitlen_ll[i] = 0; - else bitlen_d[i - HLIT] = 0; - ++i; - } - } - else { /*if(code == INVALIDSYMBOL)*/ - ERROR_BREAK(16); /*error: tried to read disallowed huffman symbol*/ - } - /*check if any of the ensureBits above went out of bounds*/ - if(reader->bp > reader->bitsize) { - /*return error code 10 or 11 depending on the situation that happened in huffmanDecodeSymbol - (10=no endcode, 11=wrong jump outside of tree)*/ - /* TODO: revise error codes 10,11,50: the above comment is no longer valid */ - ERROR_BREAK(50); /*error, bit pointer jumps past memory*/ - } - } - if(error) break; - - if(bitlen_ll[256] == 0) ERROR_BREAK(64); /*the length of the end code 256 must be larger than 0*/ - - /*now we've finally got HLIT and HDIST, so generate the code trees, and the function is done*/ - error = HuffmanTree_makeFromLengths(tree_ll, bitlen_ll, NUM_DEFLATE_CODE_SYMBOLS, 15); - if(error) break; - error = HuffmanTree_makeFromLengths(tree_d, bitlen_d, NUM_DISTANCE_SYMBOLS, 15); - - break; /*end of error-while*/ - } - - lodepng_free(bitlen_cl); - lodepng_free(bitlen_ll); - lodepng_free(bitlen_d); - HuffmanTree_cleanup(&tree_cl); - - return error; -} - -/*inflate a block with dynamic of fixed Huffman tree. btype must be 1 or 2.*/ -static unsigned inflateHuffmanBlock(ucvector * out, LodePNGBitReader * reader, - unsigned btype, size_t max_output_size) -{ - unsigned error = 0; - HuffmanTree tree_ll; /*the huffman tree for literal and length codes*/ - HuffmanTree tree_d; /*the huffman tree for distance codes*/ - const size_t reserved_size = - 260; /* must be at least 258 for max length, and a few extra for adding a few extra literals */ - int done = 0; - - if(!ucvector_reserve(out, out->size + reserved_size)) return 83; /*alloc fail*/ - - HuffmanTree_init(&tree_ll); - HuffmanTree_init(&tree_d); - - if(btype == 1) error = getTreeInflateFixed(&tree_ll, &tree_d); - else /*if(btype == 2)*/ error = getTreeInflateDynamic(&tree_ll, &tree_d, reader); - - - while(!error && !done) { /*decode all symbols until end reached, breaks at end code*/ - /*code_ll is literal, length or end code*/ - unsigned code_ll; - /* ensure enough bits for 2 huffman code reads (15 bits each): if the first is a literal, a second literal is read at once. This - appears to be slightly faster, than ensuring 20 bits here for 1 huffman symbol and the potential 5 extra bits for the length symbol.*/ - ensureBits32(reader, 30); - code_ll = huffmanDecodeSymbol(reader, &tree_ll); - if(code_ll <= 255) { - /*slightly faster code path if multiple literals in a row*/ - out->data[out->size++] = (unsigned char)code_ll; - code_ll = huffmanDecodeSymbol(reader, &tree_ll); - } - if(code_ll <= 255) { /*literal symbol*/ - out->data[out->size++] = (unsigned char)code_ll; - } - else if(code_ll >= FIRST_LENGTH_CODE_INDEX && code_ll <= LAST_LENGTH_CODE_INDEX) { /*length code*/ - unsigned code_d, distance; - unsigned numextrabits_l, numextrabits_d; /*extra bits for length and distance*/ - size_t start, backward, length; - - /*part 1: get length base*/ - length = LENGTHBASE[code_ll - FIRST_LENGTH_CODE_INDEX]; - - /*part 2: get extra bits and add the value of that to length*/ - numextrabits_l = LENGTHEXTRA[code_ll - FIRST_LENGTH_CODE_INDEX]; - if(numextrabits_l != 0) { - /* bits already ensured above */ - ensureBits25(reader, 5); - length += readBits(reader, numextrabits_l); - } - - /*part 3: get distance code*/ - ensureBits32(reader, 28); /* up to 15 for the huffman symbol, up to 13 for the extra bits */ - code_d = huffmanDecodeSymbol(reader, &tree_d); - if(code_d > 29) { - if(code_d <= 31) { - ERROR_BREAK(18); /*error: invalid distance code (30-31 are never used)*/ - } - else { /* if(code_d == INVALIDSYMBOL) */ - ERROR_BREAK(16); /*error: tried to read disallowed huffman symbol*/ - } - } - distance = DISTANCEBASE[code_d]; - - /*part 4: get extra bits from distance*/ - numextrabits_d = DISTANCEEXTRA[code_d]; - if(numextrabits_d != 0) { - /* bits already ensured above */ - distance += readBits(reader, numextrabits_d); - } - - /*part 5: fill in all the out[n] values based on the length and dist*/ - start = out->size; - if(distance > start) ERROR_BREAK(52); /*too long backward distance*/ - backward = start - distance; - - out->size += length; - if(distance < length) { - size_t forward; - lodepng_memcpy(out->data + start, out->data + backward, distance); - start += distance; - for(forward = distance; forward < length; ++forward) { - out->data[start++] = out->data[backward++]; - } - } - else { - lodepng_memcpy(out->data + start, out->data + backward, length); - } - } - else if(code_ll == 256) { - done = 1; /*end code, finish the loop*/ - } - else { /*if(code_ll == INVALIDSYMBOL)*/ - ERROR_BREAK(16); /*error: tried to read disallowed huffman symbol*/ - } - if(out->allocsize - out->size < reserved_size) { - if(!ucvector_reserve(out, out->size + reserved_size)) ERROR_BREAK(83); /*alloc fail*/ - } - /*check if any of the ensureBits above went out of bounds*/ - if(reader->bp > reader->bitsize) { - /*return error code 10 or 11 depending on the situation that happened in huffmanDecodeSymbol - (10=no endcode, 11=wrong jump outside of tree)*/ - /* TODO: revise error codes 10,11,50: the above comment is no longer valid */ - ERROR_BREAK(51); /*error, bit pointer jumps past memory*/ - } - if(max_output_size && out->size > max_output_size) { - ERROR_BREAK(109); /*error, larger than max size*/ - } - } - - HuffmanTree_cleanup(&tree_ll); - HuffmanTree_cleanup(&tree_d); - - return error; -} - -static unsigned inflateNoCompression(ucvector * out, LodePNGBitReader * reader, - const LodePNGDecompressSettings * settings) -{ - size_t bytepos; - size_t size = reader->size; - unsigned LEN, NLEN, error = 0; - - /*go to first boundary of byte*/ - bytepos = (reader->bp + 7u) >> 3u; - - /*read LEN (2 bytes) and NLEN (2 bytes)*/ - if(bytepos + 4 >= size) return 52; /*error, bit pointer will jump past memory*/ - LEN = (unsigned)reader->data[bytepos] + ((unsigned)reader->data[bytepos + 1] << 8u); - bytepos += 2; - NLEN = (unsigned)reader->data[bytepos] + ((unsigned)reader->data[bytepos + 1] << 8u); - bytepos += 2; - - /*check if 16-bit NLEN is really the one's complement of LEN*/ - if(!settings->ignore_nlen && LEN + NLEN != 65535) { - return 21; /*error: NLEN is not one's complement of LEN*/ - } - - if(!ucvector_resize(out, out->size + LEN)) return 83; /*alloc fail*/ - - /*read the literal data: LEN bytes are now stored in the out buffer*/ - if(bytepos + LEN > size) return 23; /*error: reading outside of in buffer*/ - - /*out->data can be NULL (when LEN is zero), and arithmetics on NULL ptr is undefined*/ - if(LEN) { - lodepng_memcpy(out->data + out->size - LEN, reader->data + bytepos, LEN); - bytepos += LEN; - } - - reader->bp = bytepos << 3u; - - return error; -} - -static unsigned lodepng_inflatev(ucvector * out, - const unsigned char * in, size_t insize, - const LodePNGDecompressSettings * settings) -{ - unsigned BFINAL = 0; - LodePNGBitReader reader; - unsigned error = LodePNGBitReader_init(&reader, in, insize); - - if(error) return error; - - while(!BFINAL) { - unsigned BTYPE; - if(reader.bitsize - reader.bp < 3) return 52; /*error, bit pointer will jump past memory*/ - ensureBits9(&reader, 3); - BFINAL = readBits(&reader, 1); - BTYPE = readBits(&reader, 2); - - if(BTYPE == 3) return 20; /*error: invalid BTYPE*/ - else if(BTYPE == 0) error = inflateNoCompression(out, &reader, settings); /*no compression*/ - else error = inflateHuffmanBlock(out, &reader, BTYPE, settings->max_output_size); /*compression, BTYPE 01 or 10*/ - if(!error && settings->max_output_size && out->size > settings->max_output_size) error = 109; - if(error) break; - } - - return error; -} - -unsigned lodepng_inflate(unsigned char ** out, size_t * outsize, - const unsigned char * in, size_t insize, - const LodePNGDecompressSettings * settings) -{ - ucvector v = ucvector_init(*out, *outsize); - unsigned error = lodepng_inflatev(&v, in, insize, settings); - *out = v.data; - *outsize = v.size; - return error; -} - -static unsigned inflatev(ucvector * out, const unsigned char * in, size_t insize, - const LodePNGDecompressSettings * settings) -{ - if(settings->custom_inflate) { - unsigned error = settings->custom_inflate(&out->data, &out->size, in, insize, settings); - out->allocsize = out->size; - if(error) { - /*the custom inflate is allowed to have its own error codes, however, we translate it to code 110*/ - error = 110; - /*if there's a max output size, and the custom zlib returned error, then indicate that error instead*/ - if(settings->max_output_size && out->size > settings->max_output_size) error = 109; - } - return error; - } - else { - return lodepng_inflatev(out, in, insize, settings); - } -} - -#endif /*LODEPNG_COMPILE_DECODER*/ - -#ifdef LODEPNG_COMPILE_ENCODER - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / Deflator (Compressor) / */ -/* ////////////////////////////////////////////////////////////////////////// */ - -static const unsigned MAX_SUPPORTED_DEFLATE_LENGTH = 258; - -/*search the index in the array, that has the largest value smaller than or equal to the given value, -given array must be sorted (if no value is smaller, it returns the size of the given array)*/ -static size_t searchCodeIndex(const unsigned * array, size_t array_size, size_t value) -{ - /*binary search (only small gain over linear). TODO: use CPU log2 instruction for getting symbols instead*/ - size_t left = 1; - size_t right = array_size - 1; - - while(left <= right) { - size_t mid = (left + right) >> 1; - if(array[mid] >= value) right = mid - 1; - else left = mid + 1; - } - if(left >= array_size || array[left] > value) left--; - return left; -} - -static void addLengthDistance(uivector * values, size_t length, size_t distance) -{ - /*values in encoded vector are those used by deflate: - 0-255: literal bytes - 256: end - 257-285: length/distance pair (length code, followed by extra length bits, distance code, extra distance bits) - 286-287: invalid*/ - - unsigned length_code = (unsigned)searchCodeIndex(LENGTHBASE, 29, length); - unsigned extra_length = (unsigned)(length - LENGTHBASE[length_code]); - unsigned dist_code = (unsigned)searchCodeIndex(DISTANCEBASE, 30, distance); - unsigned extra_distance = (unsigned)(distance - DISTANCEBASE[dist_code]); - - size_t pos = values->size; - /*TODO: return error when this fails (out of memory)*/ - unsigned ok = uivector_resize(values, values->size + 4); - if(ok) { - values->data[pos + 0] = length_code + FIRST_LENGTH_CODE_INDEX; - values->data[pos + 1] = extra_length; - values->data[pos + 2] = dist_code; - values->data[pos + 3] = extra_distance; - } -} - -/*3 bytes of data get encoded into two bytes. The hash cannot use more than 3 -bytes as input because 3 is the minimum match length for deflate*/ -static const unsigned HASH_NUM_VALUES = 65536; -static const unsigned HASH_BIT_MASK = 65535; /*HASH_NUM_VALUES - 1, but C90 does not like that as initializer*/ - -typedef struct Hash { - int * head; /*hash value to head circular pos - can be outdated if went around window*/ - /*circular pos to prev circular pos*/ - unsigned short * chain; - int * val; /*circular pos to hash value*/ - - /*TODO: do this not only for zeros but for any repeated byte. However for PNG - it's always going to be the zeros that dominate, so not important for PNG*/ - int * headz; /*similar to head, but for chainz*/ - unsigned short * chainz; /*those with same amount of zeros*/ - unsigned short * zeros; /*length of zeros streak, used as a second hash chain*/ -} Hash; - -static unsigned hash_init(Hash * hash, unsigned windowsize) -{ - unsigned i; - hash->head = (int *)lodepng_malloc(sizeof(int) * HASH_NUM_VALUES); - hash->val = (int *)lodepng_malloc(sizeof(int) * windowsize); - hash->chain = (unsigned short *)lodepng_malloc(sizeof(unsigned short) * windowsize); - - hash->zeros = (unsigned short *)lodepng_malloc(sizeof(unsigned short) * windowsize); - hash->headz = (int *)lodepng_malloc(sizeof(int) * (MAX_SUPPORTED_DEFLATE_LENGTH + 1)); - hash->chainz = (unsigned short *)lodepng_malloc(sizeof(unsigned short) * windowsize); - - if(!hash->head || !hash->chain || !hash->val || !hash->headz || !hash->chainz || !hash->zeros) { - return 83; /*alloc fail*/ - } - - /*initialize hash table*/ - for(i = 0; i != HASH_NUM_VALUES; ++i) hash->head[i] = -1; - for(i = 0; i != windowsize; ++i) hash->val[i] = -1; - for(i = 0; i != windowsize; ++i) hash->chain[i] = i; /*same value as index indicates uninitialized*/ - - for(i = 0; i <= MAX_SUPPORTED_DEFLATE_LENGTH; ++i) hash->headz[i] = -1; - for(i = 0; i != windowsize; ++i) hash->chainz[i] = i; /*same value as index indicates uninitialized*/ - - return 0; -} - -static void hash_cleanup(Hash * hash) -{ - lodepng_free(hash->head); - lodepng_free(hash->val); - lodepng_free(hash->chain); - - lodepng_free(hash->zeros); - lodepng_free(hash->headz); - lodepng_free(hash->chainz); -} - - - -static unsigned getHash(const unsigned char * data, size_t size, size_t pos) -{ - unsigned result = 0; - if(pos + 2 < size) { - /*A simple shift and xor hash is used. Since the data of PNGs is dominated - by zeroes due to the filters, a better hash does not have a significant - effect on speed in traversing the chain, and causes more time spend on - calculating the hash.*/ - result ^= ((unsigned)data[pos + 0] << 0u); - result ^= ((unsigned)data[pos + 1] << 4u); - result ^= ((unsigned)data[pos + 2] << 8u); - } - else { - size_t amount, i; - if(pos >= size) return 0; - amount = size - pos; - for(i = 0; i != amount; ++i) result ^= ((unsigned)data[pos + i] << (i * 8u)); - } - return result & HASH_BIT_MASK; -} - -static unsigned countZeros(const unsigned char * data, size_t size, size_t pos) -{ - const unsigned char * start = data + pos; - const unsigned char * end = start + MAX_SUPPORTED_DEFLATE_LENGTH; - if(end > data + size) end = data + size; - data = start; - while(data != end && *data == 0) ++data; - /*subtracting two addresses returned as 32-bit number (max value is MAX_SUPPORTED_DEFLATE_LENGTH)*/ - return (unsigned)(data - start); -} - -/*wpos = pos & (windowsize - 1)*/ -static void updateHashChain(Hash * hash, size_t wpos, unsigned hashval, unsigned short numzeros) -{ - hash->val[wpos] = (int)hashval; - if(hash->head[hashval] != -1) hash->chain[wpos] = hash->head[hashval]; - hash->head[hashval] = (int)wpos; - - hash->zeros[wpos] = numzeros; - if(hash->headz[numzeros] != -1) hash->chainz[wpos] = hash->headz[numzeros]; - hash->headz[numzeros] = (int)wpos; -} - -/* -LZ77-encode the data. Return value is error code. The input are raw bytes, the output -is in the form of unsigned integers with codes representing for example literal bytes, or -length/distance pairs. -It uses a hash table technique to let it encode faster. When doing LZ77 encoding, a -sliding window (of windowsize) is used, and all past bytes in that window can be used as -the "dictionary". A brute force search through all possible distances would be slow, and -this hash technique is one out of several ways to speed this up. -*/ -static unsigned encodeLZ77(uivector * out, Hash * hash, - const unsigned char * in, size_t inpos, size_t insize, unsigned windowsize, - unsigned minmatch, unsigned nicematch, unsigned lazymatching) -{ - size_t pos; - unsigned i, error = 0; - /*for large window lengths, assume the user wants no compression loss. Otherwise, max hash chain length speedup.*/ - unsigned maxchainlength = windowsize >= 8192 ? windowsize : windowsize / 8u; - unsigned maxlazymatch = windowsize >= 8192 ? MAX_SUPPORTED_DEFLATE_LENGTH : 64; - - unsigned usezeros = 1; /*not sure if setting it to false for windowsize < 8192 is better or worse*/ - unsigned numzeros = 0; - - unsigned offset; /*the offset represents the distance in LZ77 terminology*/ - unsigned length; - unsigned lazy = 0; - unsigned lazylength = 0, lazyoffset = 0; - unsigned hashval; - unsigned current_offset, current_length; - unsigned prev_offset; - const unsigned char * lastptr, * foreptr, * backptr; - unsigned hashpos; - - if(windowsize == 0 || windowsize > 32768) return 60; /*error: windowsize smaller/larger than allowed*/ - if((windowsize & (windowsize - 1)) != 0) return 90; /*error: must be power of two*/ - - if(nicematch > MAX_SUPPORTED_DEFLATE_LENGTH) nicematch = MAX_SUPPORTED_DEFLATE_LENGTH; - - for(pos = inpos; pos < insize; ++pos) { - size_t wpos = pos & (windowsize - 1); /*position for in 'circular' hash buffers*/ - unsigned chainlength = 0; - - hashval = getHash(in, insize, pos); - - if(usezeros && hashval == 0) { - if(numzeros == 0) numzeros = countZeros(in, insize, pos); - else if(pos + numzeros > insize || in[pos + numzeros - 1] != 0) --numzeros; - } - else { - numzeros = 0; - } - - updateHashChain(hash, wpos, hashval, numzeros); - - /*the length and offset found for the current position*/ - length = 0; - offset = 0; - - hashpos = hash->chain[wpos]; - - lastptr = &in[insize < pos + MAX_SUPPORTED_DEFLATE_LENGTH ? insize : pos + MAX_SUPPORTED_DEFLATE_LENGTH]; - - /*search for the longest string*/ - prev_offset = 0; - for(;;) { - if(chainlength++ >= maxchainlength) break; - current_offset = (unsigned)(hashpos <= wpos ? wpos - hashpos : wpos - hashpos + windowsize); - - if(current_offset < prev_offset) break; /*stop when went completely around the circular buffer*/ - prev_offset = current_offset; - if(current_offset > 0) { - /*test the next characters*/ - foreptr = &in[pos]; - backptr = &in[pos - current_offset]; - - /*common case in PNGs is lots of zeros. Quickly skip over them as a speedup*/ - if(numzeros >= 3) { - unsigned skip = hash->zeros[hashpos]; - if(skip > numzeros) skip = numzeros; - backptr += skip; - foreptr += skip; - } - - while(foreptr != lastptr && *backptr == *foreptr) { /*maximum supported length by deflate is max length*/ - ++backptr; - ++foreptr; - } - current_length = (unsigned)(foreptr - &in[pos]); - - if(current_length > length) { - length = current_length; /*the longest length*/ - offset = current_offset; /*the offset that is related to this longest length*/ - /*jump out once a length of max length is found (speed gain). This also jumps - out if length is MAX_SUPPORTED_DEFLATE_LENGTH*/ - if(current_length >= nicematch) break; - } - } - - if(hashpos == hash->chain[hashpos]) break; - - if(numzeros >= 3 && length > numzeros) { - hashpos = hash->chainz[hashpos]; - if(hash->zeros[hashpos] != numzeros) break; - } - else { - hashpos = hash->chain[hashpos]; - /*outdated hash value, happens if particular value was not encountered in whole last window*/ - if(hash->val[hashpos] != (int)hashval) break; - } - } - - if(lazymatching) { - if(!lazy && length >= 3 && length <= maxlazymatch && length < MAX_SUPPORTED_DEFLATE_LENGTH) { - lazy = 1; - lazylength = length; - lazyoffset = offset; - continue; /*try the next byte*/ - } - if(lazy) { - lazy = 0; - if(pos == 0) ERROR_BREAK(81); - if(length > lazylength + 1) { - /*push the previous character as literal*/ - if(!uivector_push_back(out, in[pos - 1])) ERROR_BREAK(83 /*alloc fail*/); - } - else { - length = lazylength; - offset = lazyoffset; - hash->head[hashval] = -1; /*the same hashchain update will be done, this ensures no wrong alteration*/ - hash->headz[numzeros] = -1; /*idem*/ - --pos; - } - } - } - if(length >= 3 && offset > windowsize) ERROR_BREAK(86 /*too big (or overflown negative) offset*/); - - /*encode it as length/distance pair or literal value*/ - if(length < 3) { /*only lengths of 3 or higher are supported as length/distance pair*/ - if(!uivector_push_back(out, in[pos])) ERROR_BREAK(83 /*alloc fail*/); - } - else if(length < minmatch || (length == 3 && offset > 4096)) { - /*compensate for the fact that longer offsets have more extra bits, a - length of only 3 may be not worth it then*/ - if(!uivector_push_back(out, in[pos])) ERROR_BREAK(83 /*alloc fail*/); - } - else { - addLengthDistance(out, length, offset); - for(i = 1; i < length; ++i) { - ++pos; - wpos = pos & (windowsize - 1); - hashval = getHash(in, insize, pos); - if(usezeros && hashval == 0) { - if(numzeros == 0) numzeros = countZeros(in, insize, pos); - else if(pos + numzeros > insize || in[pos + numzeros - 1] != 0) --numzeros; - } - else { - numzeros = 0; - } - updateHashChain(hash, wpos, hashval, numzeros); - } - } - } /*end of the loop through each character of input*/ - - return error; -} - -/* /////////////////////////////////////////////////////////////////////////// */ - -static unsigned deflateNoCompression(ucvector * out, const unsigned char * data, size_t datasize) -{ - /*non compressed deflate block data: 1 bit BFINAL,2 bits BTYPE,(5 bits): it jumps to start of next byte, - 2 bytes LEN, 2 bytes NLEN, LEN bytes literal DATA*/ - - size_t i, numdeflateblocks = (datasize + 65534u) / 65535u; - unsigned datapos = 0; - for(i = 0; i != numdeflateblocks; ++i) { - unsigned BFINAL, BTYPE, LEN, NLEN; - unsigned char firstbyte; - size_t pos = out->size; - - BFINAL = (i == numdeflateblocks - 1); - BTYPE = 0; - - LEN = 65535; - if(datasize - datapos < 65535u) LEN = (unsigned)datasize - datapos; - NLEN = 65535 - LEN; - - if(!ucvector_resize(out, out->size + LEN + 5)) return 83; /*alloc fail*/ - - firstbyte = (unsigned char)(BFINAL + ((BTYPE & 1u) << 1u) + ((BTYPE & 2u) << 1u)); - out->data[pos + 0] = firstbyte; - out->data[pos + 1] = (unsigned char)(LEN & 255); - out->data[pos + 2] = (unsigned char)(LEN >> 8u); - out->data[pos + 3] = (unsigned char)(NLEN & 255); - out->data[pos + 4] = (unsigned char)(NLEN >> 8u); - lodepng_memcpy(out->data + pos + 5, data + datapos, LEN); - datapos += LEN; - } - - return 0; -} - -/* -write the lz77-encoded data, which has lit, len and dist codes, to compressed stream using huffman trees. -tree_ll: the tree for lit and len codes. -tree_d: the tree for distance codes. -*/ -static void writeLZ77data(LodePNGBitWriter * writer, const uivector * lz77_encoded, - const HuffmanTree * tree_ll, const HuffmanTree * tree_d) -{ - size_t i = 0; - for(i = 0; i != lz77_encoded->size; ++i) { - unsigned val = lz77_encoded->data[i]; - writeBitsReversed(writer, tree_ll->codes[val], tree_ll->lengths[val]); - if(val > 256) { /*for a length code, 3 more things have to be added*/ - unsigned length_index = val - FIRST_LENGTH_CODE_INDEX; - unsigned n_length_extra_bits = LENGTHEXTRA[length_index]; - unsigned length_extra_bits = lz77_encoded->data[++i]; - - unsigned distance_code = lz77_encoded->data[++i]; - - unsigned distance_index = distance_code; - unsigned n_distance_extra_bits = DISTANCEEXTRA[distance_index]; - unsigned distance_extra_bits = lz77_encoded->data[++i]; - - writeBits(writer, length_extra_bits, n_length_extra_bits); - writeBitsReversed(writer, tree_d->codes[distance_code], tree_d->lengths[distance_code]); - writeBits(writer, distance_extra_bits, n_distance_extra_bits); - } - } -} - -/*Deflate for a block of type "dynamic", that is, with freely, optimally, created huffman trees*/ -static unsigned deflateDynamic(LodePNGBitWriter * writer, Hash * hash, - const unsigned char * data, size_t datapos, size_t dataend, - const LodePNGCompressSettings * settings, unsigned final) -{ - unsigned error = 0; - - /* - A block is compressed as follows: The PNG data is lz77 encoded, resulting in - literal bytes and length/distance pairs. This is then huffman compressed with - two huffman trees. One huffman tree is used for the lit and len values ("ll"), - another huffman tree is used for the dist values ("d"). These two trees are - stored using their code lengths, and to compress even more these code lengths - are also run-length encoded and huffman compressed. This gives a huffman tree - of code lengths "cl". The code lengths used to describe this third tree are - the code length code lengths ("clcl"). - */ - - /*The lz77 encoded data, represented with integers since there will also be length and distance codes in it*/ - uivector lz77_encoded; - HuffmanTree tree_ll; /*tree for lit,len values*/ - HuffmanTree tree_d; /*tree for distance codes*/ - HuffmanTree tree_cl; /*tree for encoding the code lengths representing tree_ll and tree_d*/ - unsigned * frequencies_ll = 0; /*frequency of lit,len codes*/ - unsigned * frequencies_d = 0; /*frequency of dist codes*/ - unsigned * frequencies_cl = 0; /*frequency of code length codes*/ - unsigned * bitlen_lld = 0; /*lit,len,dist code lengths (int bits), literally (without repeat codes).*/ - unsigned * bitlen_lld_e = 0; /*bitlen_lld encoded with repeat codes (this is a rudimentary run length compression)*/ - size_t datasize = dataend - datapos; - - /* - If we could call "bitlen_cl" the code length code lengths ("clcl"), that is the bit lengths of codes to represent - tree_cl in CLCL_ORDER, then due to the huffman compression of huffman tree representations ("two levels"), there are - some analogies: - bitlen_lld is to tree_cl what data is to tree_ll and tree_d. - bitlen_lld_e is to bitlen_lld what lz77_encoded is to data. - bitlen_cl is to bitlen_lld_e what bitlen_lld is to lz77_encoded. - */ - - unsigned BFINAL = final; - size_t i; - size_t numcodes_ll, numcodes_d, numcodes_lld, numcodes_lld_e, numcodes_cl; - unsigned HLIT, HDIST, HCLEN; - - uivector_init(&lz77_encoded); - HuffmanTree_init(&tree_ll); - HuffmanTree_init(&tree_d); - HuffmanTree_init(&tree_cl); - /* could fit on stack, but >1KB is on the larger side so allocate instead */ - frequencies_ll = (unsigned *)lodepng_malloc(286 * sizeof(*frequencies_ll)); - frequencies_d = (unsigned *)lodepng_malloc(30 * sizeof(*frequencies_d)); - frequencies_cl = (unsigned *)lodepng_malloc(NUM_CODE_LENGTH_CODES * sizeof(*frequencies_cl)); - - if(!frequencies_ll || !frequencies_d || !frequencies_cl) error = 83; /*alloc fail*/ - - /*This while loop never loops due to a break at the end, it is here to - allow breaking out of it to the cleanup phase on error conditions.*/ - while(!error) { - lodepng_memset(frequencies_ll, 0, 286 * sizeof(*frequencies_ll)); - lodepng_memset(frequencies_d, 0, 30 * sizeof(*frequencies_d)); - lodepng_memset(frequencies_cl, 0, NUM_CODE_LENGTH_CODES * sizeof(*frequencies_cl)); - - if(settings->use_lz77) { - error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize, - settings->minmatch, settings->nicematch, settings->lazymatching); - if(error) break; - } - else { - if(!uivector_resize(&lz77_encoded, datasize)) ERROR_BREAK(83 /*alloc fail*/); - for(i = datapos; i < dataend; - ++i) lz77_encoded.data[i - datapos] = data[i]; /*no LZ77, but still will be Huffman compressed*/ - } - - /*Count the frequencies of lit, len and dist codes*/ - for(i = 0; i != lz77_encoded.size; ++i) { - unsigned symbol = lz77_encoded.data[i]; - ++frequencies_ll[symbol]; - if(symbol > 256) { - unsigned dist = lz77_encoded.data[i + 2]; - ++frequencies_d[dist]; - i += 3; - } - } - frequencies_ll[256] = 1; /*there will be exactly 1 end code, at the end of the block*/ - - /*Make both huffman trees, one for the lit and len codes, one for the dist codes*/ - error = HuffmanTree_makeFromFrequencies(&tree_ll, frequencies_ll, 257, 286, 15); - if(error) break; - /*2, not 1, is chosen for mincodes: some buggy PNG decoders require at least 2 symbols in the dist tree*/ - error = HuffmanTree_makeFromFrequencies(&tree_d, frequencies_d, 2, 30, 15); - if(error) break; - - numcodes_ll = LODEPNG_MIN(tree_ll.numcodes, 286); - numcodes_d = LODEPNG_MIN(tree_d.numcodes, 30); - /*store the code lengths of both generated trees in bitlen_lld*/ - numcodes_lld = numcodes_ll + numcodes_d; - bitlen_lld = (unsigned *)lodepng_malloc(numcodes_lld * sizeof(*bitlen_lld)); - /*numcodes_lld_e never needs more size than bitlen_lld*/ - bitlen_lld_e = (unsigned *)lodepng_malloc(numcodes_lld * sizeof(*bitlen_lld_e)); - if(!bitlen_lld || !bitlen_lld_e) ERROR_BREAK(83); /*alloc fail*/ - numcodes_lld_e = 0; - - for(i = 0; i != numcodes_ll; ++i) bitlen_lld[i] = tree_ll.lengths[i]; - for(i = 0; i != numcodes_d; ++i) bitlen_lld[numcodes_ll + i] = tree_d.lengths[i]; - - /*run-length compress bitlen_ldd into bitlen_lld_e by using repeat codes 16 (copy length 3-6 times), - 17 (3-10 zeroes), 18 (11-138 zeroes)*/ - for(i = 0; i != numcodes_lld; ++i) { - unsigned j = 0; /*amount of repetitions*/ - while(i + j + 1 < numcodes_lld && bitlen_lld[i + j + 1] == bitlen_lld[i]) ++j; - - if(bitlen_lld[i] == 0 && j >= 2) { /*repeat code for zeroes*/ - ++j; /*include the first zero*/ - if(j <= 10) { /*repeat code 17 supports max 10 zeroes*/ - bitlen_lld_e[numcodes_lld_e++] = 17; - bitlen_lld_e[numcodes_lld_e++] = j - 3; - } - else { /*repeat code 18 supports max 138 zeroes*/ - if(j > 138) j = 138; - bitlen_lld_e[numcodes_lld_e++] = 18; - bitlen_lld_e[numcodes_lld_e++] = j - 11; - } - i += (j - 1); - } - else if(j >= 3) { /*repeat code for value other than zero*/ - size_t k; - unsigned num = j / 6u, rest = j % 6u; - bitlen_lld_e[numcodes_lld_e++] = bitlen_lld[i]; - for(k = 0; k < num; ++k) { - bitlen_lld_e[numcodes_lld_e++] = 16; - bitlen_lld_e[numcodes_lld_e++] = 6 - 3; - } - if(rest >= 3) { - bitlen_lld_e[numcodes_lld_e++] = 16; - bitlen_lld_e[numcodes_lld_e++] = rest - 3; - } - else j -= rest; - i += j; - } - else { /*too short to benefit from repeat code*/ - bitlen_lld_e[numcodes_lld_e++] = bitlen_lld[i]; - } - } - - /*generate tree_cl, the huffmantree of huffmantrees*/ - for(i = 0; i != numcodes_lld_e; ++i) { - ++frequencies_cl[bitlen_lld_e[i]]; - /*after a repeat code come the bits that specify the number of repetitions, - those don't need to be in the frequencies_cl calculation*/ - if(bitlen_lld_e[i] >= 16) ++i; - } - - error = HuffmanTree_makeFromFrequencies(&tree_cl, frequencies_cl, - NUM_CODE_LENGTH_CODES, NUM_CODE_LENGTH_CODES, 7); - if(error) break; - - /*compute amount of code-length-code-lengths to output*/ - numcodes_cl = NUM_CODE_LENGTH_CODES; - /*trim zeros at the end (using CLCL_ORDER), but minimum size must be 4 (see HCLEN below)*/ - while(numcodes_cl > 4u && tree_cl.lengths[CLCL_ORDER[numcodes_cl - 1u]] == 0) { - numcodes_cl--; - } - - /* - Write everything into the output - - After the BFINAL and BTYPE, the dynamic block consists out of the following: - - 5 bits HLIT, 5 bits HDIST, 4 bits HCLEN - - (HCLEN+4)*3 bits code lengths of code length alphabet - - HLIT + 257 code lengths of lit/length alphabet (encoded using the code length - alphabet, + possible repetition codes 16, 17, 18) - - HDIST + 1 code lengths of distance alphabet (encoded using the code length - alphabet, + possible repetition codes 16, 17, 18) - - compressed data - - 256 (end code) - */ - - /*Write block type*/ - writeBits(writer, BFINAL, 1); - writeBits(writer, 0, 1); /*first bit of BTYPE "dynamic"*/ - writeBits(writer, 1, 1); /*second bit of BTYPE "dynamic"*/ - - /*write the HLIT, HDIST and HCLEN values*/ - /*all three sizes take trimmed ending zeroes into account, done either by HuffmanTree_makeFromFrequencies - or in the loop for numcodes_cl above, which saves space. */ - HLIT = (unsigned)(numcodes_ll - 257); - HDIST = (unsigned)(numcodes_d - 1); - HCLEN = (unsigned)(numcodes_cl - 4); - writeBits(writer, HLIT, 5); - writeBits(writer, HDIST, 5); - writeBits(writer, HCLEN, 4); - - /*write the code lengths of the code length alphabet ("bitlen_cl")*/ - for(i = 0; i != numcodes_cl; ++i) writeBits(writer, tree_cl.lengths[CLCL_ORDER[i]], 3); - - /*write the lengths of the lit/len AND the dist alphabet*/ - for(i = 0; i != numcodes_lld_e; ++i) { - writeBitsReversed(writer, tree_cl.codes[bitlen_lld_e[i]], tree_cl.lengths[bitlen_lld_e[i]]); - /*extra bits of repeat codes*/ - if(bitlen_lld_e[i] == 16) writeBits(writer, bitlen_lld_e[++i], 2); - else if(bitlen_lld_e[i] == 17) writeBits(writer, bitlen_lld_e[++i], 3); - else if(bitlen_lld_e[i] == 18) writeBits(writer, bitlen_lld_e[++i], 7); - } - - /*write the compressed data symbols*/ - writeLZ77data(writer, &lz77_encoded, &tree_ll, &tree_d); - /*error: the length of the end code 256 must be larger than 0*/ - if(tree_ll.lengths[256] == 0) ERROR_BREAK(64); - - /*write the end code*/ - writeBitsReversed(writer, tree_ll.codes[256], tree_ll.lengths[256]); - - break; /*end of error-while*/ - } - - /*cleanup*/ - uivector_cleanup(&lz77_encoded); - HuffmanTree_cleanup(&tree_ll); - HuffmanTree_cleanup(&tree_d); - HuffmanTree_cleanup(&tree_cl); - lodepng_free(frequencies_ll); - lodepng_free(frequencies_d); - lodepng_free(frequencies_cl); - lodepng_free(bitlen_lld); - lodepng_free(bitlen_lld_e); - - return error; -} - -static unsigned deflateFixed(LodePNGBitWriter * writer, Hash * hash, - const unsigned char * data, - size_t datapos, size_t dataend, - const LodePNGCompressSettings * settings, unsigned final) -{ - HuffmanTree tree_ll; /*tree for literal values and length codes*/ - HuffmanTree tree_d; /*tree for distance codes*/ - - unsigned BFINAL = final; - unsigned error = 0; - size_t i; - - HuffmanTree_init(&tree_ll); - HuffmanTree_init(&tree_d); - - error = generateFixedLitLenTree(&tree_ll); - if(!error) error = generateFixedDistanceTree(&tree_d); - - if(!error) { - writeBits(writer, BFINAL, 1); - writeBits(writer, 1, 1); /*first bit of BTYPE*/ - writeBits(writer, 0, 1); /*second bit of BTYPE*/ - - if(settings->use_lz77) { /*LZ77 encoded*/ - uivector lz77_encoded; - uivector_init(&lz77_encoded); - error = encodeLZ77(&lz77_encoded, hash, data, datapos, dataend, settings->windowsize, - settings->minmatch, settings->nicematch, settings->lazymatching); - if(!error) writeLZ77data(writer, &lz77_encoded, &tree_ll, &tree_d); - uivector_cleanup(&lz77_encoded); - } - else { /*no LZ77, but still will be Huffman compressed*/ - for(i = datapos; i < dataend; ++i) { - writeBitsReversed(writer, tree_ll.codes[data[i]], tree_ll.lengths[data[i]]); - } - } - /*add END code*/ - if(!error) writeBitsReversed(writer, tree_ll.codes[256], tree_ll.lengths[256]); - } - - /*cleanup*/ - HuffmanTree_cleanup(&tree_ll); - HuffmanTree_cleanup(&tree_d); - - return error; -} - -static unsigned lodepng_deflatev(ucvector * out, const unsigned char * in, size_t insize, - const LodePNGCompressSettings * settings) -{ - unsigned error = 0; - size_t i, blocksize, numdeflateblocks; - Hash hash; - LodePNGBitWriter writer; - - LodePNGBitWriter_init(&writer, out); - - if(settings->btype > 2) return 61; - else if(settings->btype == 0) return deflateNoCompression(out, in, insize); - else if(settings->btype == 1) blocksize = insize; - else { /*if(settings->btype == 2)*/ - /*on PNGs, deflate blocks of 65-262k seem to give most dense encoding*/ - blocksize = insize / 8u + 8; - if(blocksize < 65536) blocksize = 65536; - if(blocksize > 262144) blocksize = 262144; - } - - numdeflateblocks = (insize + blocksize - 1) / blocksize; - if(numdeflateblocks == 0) numdeflateblocks = 1; - - error = hash_init(&hash, settings->windowsize); - - if(!error) { - for(i = 0; i != numdeflateblocks && !error; ++i) { - unsigned final = (i == numdeflateblocks - 1); - size_t start = i * blocksize; - size_t end = start + blocksize; - if(end > insize) end = insize; - - if(settings->btype == 1) error = deflateFixed(&writer, &hash, in, start, end, settings, final); - else if(settings->btype == 2) error = deflateDynamic(&writer, &hash, in, start, end, settings, final); - } - } - - hash_cleanup(&hash); - - return error; -} - -unsigned lodepng_deflate(unsigned char ** out, size_t * outsize, - const unsigned char * in, size_t insize, - const LodePNGCompressSettings * settings) -{ - ucvector v = ucvector_init(*out, *outsize); - unsigned error = lodepng_deflatev(&v, in, insize, settings); - *out = v.data; - *outsize = v.size; - return error; -} - -static unsigned deflate(unsigned char ** out, size_t * outsize, - const unsigned char * in, size_t insize, - const LodePNGCompressSettings * settings) -{ - if(settings->custom_deflate) { - unsigned error = settings->custom_deflate(out, outsize, in, insize, settings); - /*the custom deflate is allowed to have its own error codes, however, we translate it to code 111*/ - return error ? 111 : 0; - } - else { - return lodepng_deflate(out, outsize, in, insize, settings); - } -} - -#endif /*LODEPNG_COMPILE_DECODER*/ - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / Adler32 / */ -/* ////////////////////////////////////////////////////////////////////////// */ - -static unsigned update_adler32(unsigned adler, const unsigned char * data, unsigned len) -{ - unsigned s1 = adler & 0xffffu; - unsigned s2 = (adler >> 16u) & 0xffffu; - - while(len != 0u) { - unsigned i; - /*at least 5552 sums can be done before the sums overflow, saving a lot of module divisions*/ - unsigned amount = len > 5552u ? 5552u : len; - len -= amount; - for(i = 0; i != amount; ++i) { - s1 += (*data++); - s2 += s1; - } - s1 %= 65521u; - s2 %= 65521u; - } - - return (s2 << 16u) | s1; -} - -/*Return the adler32 of the bytes data[0..len-1]*/ -static unsigned adler32(const unsigned char * data, unsigned len) -{ - return update_adler32(1u, data, len); -} - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / Zlib / */ -/* ////////////////////////////////////////////////////////////////////////// */ - -#ifdef LODEPNG_COMPILE_DECODER - -static unsigned lodepng_zlib_decompressv(ucvector * out, - const unsigned char * in, size_t insize, - const LodePNGDecompressSettings * settings) -{ - unsigned error = 0; - unsigned CM, CINFO, FDICT; - - if(insize < 2) return 53; /*error, size of zlib data too small*/ - /*read information from zlib header*/ - if((in[0] * 256 + in[1]) % 31 != 0) { - /*error: 256 * in[0] + in[1] must be a multiple of 31, the FCHECK value is supposed to be made that way*/ - return 24; - } - - CM = in[0] & 15; - CINFO = (in[0] >> 4) & 15; - /*FCHECK = in[1] & 31;*/ /*FCHECK is already tested above*/ - FDICT = (in[1] >> 5) & 1; - /*FLEVEL = (in[1] >> 6) & 3;*/ /*FLEVEL is not used here*/ - - if(CM != 8 || CINFO > 7) { - /*error: only compression method 8: inflate with sliding window of 32k is supported by the PNG spec*/ - return 25; - } - if(FDICT != 0) { - /*error: the specification of PNG says about the zlib stream: - "The additional flags shall not specify a preset dictionary."*/ - return 26; - } - - error = inflatev(out, in + 2, insize - 2, settings); - if(error) return error; - - if(!settings->ignore_adler32) { - unsigned ADLER32 = lodepng_read32bitInt(&in[insize - 4]); - unsigned checksum = adler32(out->data, (unsigned)(out->size)); - if(checksum != ADLER32) return 58; /*error, adler checksum not correct, data must be corrupted*/ - } - - return 0; /*no error*/ -} - - -unsigned lodepng_zlib_decompress(unsigned char ** out, size_t * outsize, const unsigned char * in, - size_t insize, const LodePNGDecompressSettings * settings) -{ - ucvector v = ucvector_init(*out, *outsize); - unsigned error = lodepng_zlib_decompressv(&v, in, insize, settings); - *out = v.data; - *outsize = v.size; - return error; -} - -/*expected_size is expected output size, to avoid intermediate allocations. Set to 0 if not known. */ -static unsigned zlib_decompress(unsigned char ** out, size_t * outsize, size_t expected_size, - const unsigned char * in, size_t insize, const LodePNGDecompressSettings * settings) -{ - unsigned error; - if(settings->custom_zlib) { - error = settings->custom_zlib(out, outsize, in, insize, settings); - if(error) { - /*the custom zlib is allowed to have its own error codes, however, we translate it to code 110*/ - error = 110; - /*if there's a max output size, and the custom zlib returned error, then indicate that error instead*/ - if(settings->max_output_size && *outsize > settings->max_output_size) error = 109; - } - } - else { - ucvector v = ucvector_init(*out, *outsize); - if(expected_size) { - /*reserve the memory to avoid intermediate reallocations*/ - ucvector_resize(&v, *outsize + expected_size); - v.size = *outsize; - } - error = lodepng_zlib_decompressv(&v, in, insize, settings); - *out = v.data; - *outsize = v.size; - } - return error; -} - -#endif /*LODEPNG_COMPILE_DECODER*/ - -#ifdef LODEPNG_COMPILE_ENCODER - -unsigned lodepng_zlib_compress(unsigned char ** out, size_t * outsize, const unsigned char * in, - size_t insize, const LodePNGCompressSettings * settings) -{ - size_t i; - unsigned error; - unsigned char * deflatedata = 0; - size_t deflatesize = 0; - - error = deflate(&deflatedata, &deflatesize, in, insize, settings); - - *out = NULL; - *outsize = 0; - if(!error) { - *outsize = deflatesize + 6; - *out = (unsigned char *)lodepng_malloc(*outsize); - if(!*out) error = 83; /*alloc fail*/ - } - - if(!error) { - unsigned ADLER32 = adler32(in, (unsigned)insize); - /*zlib data: 1 byte CMF (CM+CINFO), 1 byte FLG, deflate data, 4 byte ADLER32 checksum of the Decompressed data*/ - unsigned CMF = 120; /*0b01111000: CM 8, CINFO 7. With CINFO 7, any window size up to 32768 can be used.*/ - unsigned FLEVEL = 0; - unsigned FDICT = 0; - unsigned CMFFLG = 256 * CMF + FDICT * 32 + FLEVEL * 64; - unsigned FCHECK = 31 - CMFFLG % 31; - CMFFLG += FCHECK; - - (*out)[0] = (unsigned char)(CMFFLG >> 8); - (*out)[1] = (unsigned char)(CMFFLG & 255); - for(i = 0; i != deflatesize; ++i)(*out)[i + 2] = deflatedata[i]; - lodepng_set32bitInt(&(*out)[*outsize - 4], ADLER32); - } - - lodepng_free(deflatedata); - return error; -} - -/* compress using the default or custom zlib function */ -static unsigned zlib_compress(unsigned char ** out, size_t * outsize, const unsigned char * in, - size_t insize, const LodePNGCompressSettings * settings) -{ - if(settings->custom_zlib) { - unsigned error = settings->custom_zlib(out, outsize, in, insize, settings); - /*the custom zlib is allowed to have its own error codes, however, we translate it to code 111*/ - return error ? 111 : 0; - } - else { - return lodepng_zlib_compress(out, outsize, in, insize, settings); - } -} - -#endif /*LODEPNG_COMPILE_ENCODER*/ - -#else /*no LODEPNG_COMPILE_ZLIB*/ - -#ifdef LODEPNG_COMPILE_DECODER -static unsigned zlib_decompress(unsigned char ** out, size_t * outsize, size_t expected_size, - const unsigned char * in, size_t insize, const LodePNGDecompressSettings * settings) -{ - if(!settings->custom_zlib) return 87; /*no custom zlib function provided */ - (void)expected_size; - return settings->custom_zlib(out, outsize, in, insize, settings); -} -#endif /*LODEPNG_COMPILE_DECODER*/ -#ifdef LODEPNG_COMPILE_ENCODER -static unsigned zlib_compress(unsigned char ** out, size_t * outsize, const unsigned char * in, - size_t insize, const LodePNGCompressSettings * settings) -{ - if(!settings->custom_zlib) return 87; /*no custom zlib function provided */ - return settings->custom_zlib(out, outsize, in, insize, settings); -} -#endif /*LODEPNG_COMPILE_ENCODER*/ - -#endif /*LODEPNG_COMPILE_ZLIB*/ - -/* ////////////////////////////////////////////////////////////////////////// */ - -#ifdef LODEPNG_COMPILE_ENCODER - -/*this is a good tradeoff between speed and compression ratio*/ -#define DEFAULT_WINDOWSIZE 2048 - -void lodepng_compress_settings_init(LodePNGCompressSettings * settings) -{ - /*compress with dynamic huffman tree (not in the mathematical sense, just not the predefined one)*/ - settings->btype = 2; - settings->use_lz77 = 1; - settings->windowsize = DEFAULT_WINDOWSIZE; - settings->minmatch = 3; - settings->nicematch = 128; - settings->lazymatching = 1; - - settings->custom_zlib = 0; - settings->custom_deflate = 0; - settings->custom_context = 0; -} - -const LodePNGCompressSettings lodepng_default_compress_settings = {2, 1, DEFAULT_WINDOWSIZE, 3, 128, 1, 0, 0, 0}; - - -#endif /*LODEPNG_COMPILE_ENCODER*/ - -#ifdef LODEPNG_COMPILE_DECODER - -void lodepng_decompress_settings_init(LodePNGDecompressSettings * settings) -{ - settings->ignore_adler32 = 0; - settings->ignore_nlen = 0; - settings->max_output_size = 0; - - settings->custom_zlib = 0; - settings->custom_inflate = 0; - settings->custom_context = 0; -} - -const LodePNGDecompressSettings lodepng_default_decompress_settings = {0, 0, 0, 0, 0, 0}; - -#endif /*LODEPNG_COMPILE_DECODER*/ - -/* ////////////////////////////////////////////////////////////////////////// */ -/* ////////////////////////////////////////////////////////////////////////// */ -/* // End of Zlib related code. Begin of PNG related code. // */ -/* ////////////////////////////////////////////////////////////////////////// */ -/* ////////////////////////////////////////////////////////////////////////// */ - -#ifdef LODEPNG_COMPILE_PNG - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / CRC32 / */ -/* ////////////////////////////////////////////////////////////////////////// */ - - -#ifdef LODEPNG_COMPILE_CRC - -static const unsigned lodepng_crc32_table0[256] = { - 0x00000000u, 0x77073096u, 0xee0e612cu, 0x990951bau, 0x076dc419u, 0x706af48fu, 0xe963a535u, 0x9e6495a3u, - 0x0edb8832u, 0x79dcb8a4u, 0xe0d5e91eu, 0x97d2d988u, 0x09b64c2bu, 0x7eb17cbdu, 0xe7b82d07u, 0x90bf1d91u, - 0x1db71064u, 0x6ab020f2u, 0xf3b97148u, 0x84be41deu, 0x1adad47du, 0x6ddde4ebu, 0xf4d4b551u, 0x83d385c7u, - 0x136c9856u, 0x646ba8c0u, 0xfd62f97au, 0x8a65c9ecu, 0x14015c4fu, 0x63066cd9u, 0xfa0f3d63u, 0x8d080df5u, - 0x3b6e20c8u, 0x4c69105eu, 0xd56041e4u, 0xa2677172u, 0x3c03e4d1u, 0x4b04d447u, 0xd20d85fdu, 0xa50ab56bu, - 0x35b5a8fau, 0x42b2986cu, 0xdbbbc9d6u, 0xacbcf940u, 0x32d86ce3u, 0x45df5c75u, 0xdcd60dcfu, 0xabd13d59u, - 0x26d930acu, 0x51de003au, 0xc8d75180u, 0xbfd06116u, 0x21b4f4b5u, 0x56b3c423u, 0xcfba9599u, 0xb8bda50fu, - 0x2802b89eu, 0x5f058808u, 0xc60cd9b2u, 0xb10be924u, 0x2f6f7c87u, 0x58684c11u, 0xc1611dabu, 0xb6662d3du, - 0x76dc4190u, 0x01db7106u, 0x98d220bcu, 0xefd5102au, 0x71b18589u, 0x06b6b51fu, 0x9fbfe4a5u, 0xe8b8d433u, - 0x7807c9a2u, 0x0f00f934u, 0x9609a88eu, 0xe10e9818u, 0x7f6a0dbbu, 0x086d3d2du, 0x91646c97u, 0xe6635c01u, - 0x6b6b51f4u, 0x1c6c6162u, 0x856530d8u, 0xf262004eu, 0x6c0695edu, 0x1b01a57bu, 0x8208f4c1u, 0xf50fc457u, - 0x65b0d9c6u, 0x12b7e950u, 0x8bbeb8eau, 0xfcb9887cu, 0x62dd1ddfu, 0x15da2d49u, 0x8cd37cf3u, 0xfbd44c65u, - 0x4db26158u, 0x3ab551ceu, 0xa3bc0074u, 0xd4bb30e2u, 0x4adfa541u, 0x3dd895d7u, 0xa4d1c46du, 0xd3d6f4fbu, - 0x4369e96au, 0x346ed9fcu, 0xad678846u, 0xda60b8d0u, 0x44042d73u, 0x33031de5u, 0xaa0a4c5fu, 0xdd0d7cc9u, - 0x5005713cu, 0x270241aau, 0xbe0b1010u, 0xc90c2086u, 0x5768b525u, 0x206f85b3u, 0xb966d409u, 0xce61e49fu, - 0x5edef90eu, 0x29d9c998u, 0xb0d09822u, 0xc7d7a8b4u, 0x59b33d17u, 0x2eb40d81u, 0xb7bd5c3bu, 0xc0ba6cadu, - 0xedb88320u, 0x9abfb3b6u, 0x03b6e20cu, 0x74b1d29au, 0xead54739u, 0x9dd277afu, 0x04db2615u, 0x73dc1683u, - 0xe3630b12u, 0x94643b84u, 0x0d6d6a3eu, 0x7a6a5aa8u, 0xe40ecf0bu, 0x9309ff9du, 0x0a00ae27u, 0x7d079eb1u, - 0xf00f9344u, 0x8708a3d2u, 0x1e01f268u, 0x6906c2feu, 0xf762575du, 0x806567cbu, 0x196c3671u, 0x6e6b06e7u, - 0xfed41b76u, 0x89d32be0u, 0x10da7a5au, 0x67dd4accu, 0xf9b9df6fu, 0x8ebeeff9u, 0x17b7be43u, 0x60b08ed5u, - 0xd6d6a3e8u, 0xa1d1937eu, 0x38d8c2c4u, 0x4fdff252u, 0xd1bb67f1u, 0xa6bc5767u, 0x3fb506ddu, 0x48b2364bu, - 0xd80d2bdau, 0xaf0a1b4cu, 0x36034af6u, 0x41047a60u, 0xdf60efc3u, 0xa867df55u, 0x316e8eefu, 0x4669be79u, - 0xcb61b38cu, 0xbc66831au, 0x256fd2a0u, 0x5268e236u, 0xcc0c7795u, 0xbb0b4703u, 0x220216b9u, 0x5505262fu, - 0xc5ba3bbeu, 0xb2bd0b28u, 0x2bb45a92u, 0x5cb36a04u, 0xc2d7ffa7u, 0xb5d0cf31u, 0x2cd99e8bu, 0x5bdeae1du, - 0x9b64c2b0u, 0xec63f226u, 0x756aa39cu, 0x026d930au, 0x9c0906a9u, 0xeb0e363fu, 0x72076785u, 0x05005713u, - 0x95bf4a82u, 0xe2b87a14u, 0x7bb12baeu, 0x0cb61b38u, 0x92d28e9bu, 0xe5d5be0du, 0x7cdcefb7u, 0x0bdbdf21u, - 0x86d3d2d4u, 0xf1d4e242u, 0x68ddb3f8u, 0x1fda836eu, 0x81be16cdu, 0xf6b9265bu, 0x6fb077e1u, 0x18b74777u, - 0x88085ae6u, 0xff0f6a70u, 0x66063bcau, 0x11010b5cu, 0x8f659effu, 0xf862ae69u, 0x616bffd3u, 0x166ccf45u, - 0xa00ae278u, 0xd70dd2eeu, 0x4e048354u, 0x3903b3c2u, 0xa7672661u, 0xd06016f7u, 0x4969474du, 0x3e6e77dbu, - 0xaed16a4au, 0xd9d65adcu, 0x40df0b66u, 0x37d83bf0u, 0xa9bcae53u, 0xdebb9ec5u, 0x47b2cf7fu, 0x30b5ffe9u, - 0xbdbdf21cu, 0xcabac28au, 0x53b39330u, 0x24b4a3a6u, 0xbad03605u, 0xcdd70693u, 0x54de5729u, 0x23d967bfu, - 0xb3667a2eu, 0xc4614ab8u, 0x5d681b02u, 0x2a6f2b94u, 0xb40bbe37u, 0xc30c8ea1u, 0x5a05df1bu, 0x2d02ef8du -}; - -static const unsigned lodepng_crc32_table1[256] = { - 0x00000000u, 0x191b3141u, 0x32366282u, 0x2b2d53c3u, 0x646cc504u, 0x7d77f445u, 0x565aa786u, 0x4f4196c7u, - 0xc8d98a08u, 0xd1c2bb49u, 0xfaefe88au, 0xe3f4d9cbu, 0xacb54f0cu, 0xb5ae7e4du, 0x9e832d8eu, 0x87981ccfu, - 0x4ac21251u, 0x53d92310u, 0x78f470d3u, 0x61ef4192u, 0x2eaed755u, 0x37b5e614u, 0x1c98b5d7u, 0x05838496u, - 0x821b9859u, 0x9b00a918u, 0xb02dfadbu, 0xa936cb9au, 0xe6775d5du, 0xff6c6c1cu, 0xd4413fdfu, 0xcd5a0e9eu, - 0x958424a2u, 0x8c9f15e3u, 0xa7b24620u, 0xbea97761u, 0xf1e8e1a6u, 0xe8f3d0e7u, 0xc3de8324u, 0xdac5b265u, - 0x5d5daeaau, 0x44469febu, 0x6f6bcc28u, 0x7670fd69u, 0x39316baeu, 0x202a5aefu, 0x0b07092cu, 0x121c386du, - 0xdf4636f3u, 0xc65d07b2u, 0xed705471u, 0xf46b6530u, 0xbb2af3f7u, 0xa231c2b6u, 0x891c9175u, 0x9007a034u, - 0x179fbcfbu, 0x0e848dbau, 0x25a9de79u, 0x3cb2ef38u, 0x73f379ffu, 0x6ae848beu, 0x41c51b7du, 0x58de2a3cu, - 0xf0794f05u, 0xe9627e44u, 0xc24f2d87u, 0xdb541cc6u, 0x94158a01u, 0x8d0ebb40u, 0xa623e883u, 0xbf38d9c2u, - 0x38a0c50du, 0x21bbf44cu, 0x0a96a78fu, 0x138d96ceu, 0x5ccc0009u, 0x45d73148u, 0x6efa628bu, 0x77e153cau, - 0xbabb5d54u, 0xa3a06c15u, 0x888d3fd6u, 0x91960e97u, 0xded79850u, 0xc7cca911u, 0xece1fad2u, 0xf5facb93u, - 0x7262d75cu, 0x6b79e61du, 0x4054b5deu, 0x594f849fu, 0x160e1258u, 0x0f152319u, 0x243870dau, 0x3d23419bu, - 0x65fd6ba7u, 0x7ce65ae6u, 0x57cb0925u, 0x4ed03864u, 0x0191aea3u, 0x188a9fe2u, 0x33a7cc21u, 0x2abcfd60u, - 0xad24e1afu, 0xb43fd0eeu, 0x9f12832du, 0x8609b26cu, 0xc94824abu, 0xd05315eau, 0xfb7e4629u, 0xe2657768u, - 0x2f3f79f6u, 0x362448b7u, 0x1d091b74u, 0x04122a35u, 0x4b53bcf2u, 0x52488db3u, 0x7965de70u, 0x607eef31u, - 0xe7e6f3feu, 0xfefdc2bfu, 0xd5d0917cu, 0xcccba03du, 0x838a36fau, 0x9a9107bbu, 0xb1bc5478u, 0xa8a76539u, - 0x3b83984bu, 0x2298a90au, 0x09b5fac9u, 0x10aecb88u, 0x5fef5d4fu, 0x46f46c0eu, 0x6dd93fcdu, 0x74c20e8cu, - 0xf35a1243u, 0xea412302u, 0xc16c70c1u, 0xd8774180u, 0x9736d747u, 0x8e2de606u, 0xa500b5c5u, 0xbc1b8484u, - 0x71418a1au, 0x685abb5bu, 0x4377e898u, 0x5a6cd9d9u, 0x152d4f1eu, 0x0c367e5fu, 0x271b2d9cu, 0x3e001cddu, - 0xb9980012u, 0xa0833153u, 0x8bae6290u, 0x92b553d1u, 0xddf4c516u, 0xc4eff457u, 0xefc2a794u, 0xf6d996d5u, - 0xae07bce9u, 0xb71c8da8u, 0x9c31de6bu, 0x852aef2au, 0xca6b79edu, 0xd37048acu, 0xf85d1b6fu, 0xe1462a2eu, - 0x66de36e1u, 0x7fc507a0u, 0x54e85463u, 0x4df36522u, 0x02b2f3e5u, 0x1ba9c2a4u, 0x30849167u, 0x299fa026u, - 0xe4c5aeb8u, 0xfdde9ff9u, 0xd6f3cc3au, 0xcfe8fd7bu, 0x80a96bbcu, 0x99b25afdu, 0xb29f093eu, 0xab84387fu, - 0x2c1c24b0u, 0x350715f1u, 0x1e2a4632u, 0x07317773u, 0x4870e1b4u, 0x516bd0f5u, 0x7a468336u, 0x635db277u, - 0xcbfad74eu, 0xd2e1e60fu, 0xf9ccb5ccu, 0xe0d7848du, 0xaf96124au, 0xb68d230bu, 0x9da070c8u, 0x84bb4189u, - 0x03235d46u, 0x1a386c07u, 0x31153fc4u, 0x280e0e85u, 0x674f9842u, 0x7e54a903u, 0x5579fac0u, 0x4c62cb81u, - 0x8138c51fu, 0x9823f45eu, 0xb30ea79du, 0xaa1596dcu, 0xe554001bu, 0xfc4f315au, 0xd7626299u, 0xce7953d8u, - 0x49e14f17u, 0x50fa7e56u, 0x7bd72d95u, 0x62cc1cd4u, 0x2d8d8a13u, 0x3496bb52u, 0x1fbbe891u, 0x06a0d9d0u, - 0x5e7ef3ecu, 0x4765c2adu, 0x6c48916eu, 0x7553a02fu, 0x3a1236e8u, 0x230907a9u, 0x0824546au, 0x113f652bu, - 0x96a779e4u, 0x8fbc48a5u, 0xa4911b66u, 0xbd8a2a27u, 0xf2cbbce0u, 0xebd08da1u, 0xc0fdde62u, 0xd9e6ef23u, - 0x14bce1bdu, 0x0da7d0fcu, 0x268a833fu, 0x3f91b27eu, 0x70d024b9u, 0x69cb15f8u, 0x42e6463bu, 0x5bfd777au, - 0xdc656bb5u, 0xc57e5af4u, 0xee530937u, 0xf7483876u, 0xb809aeb1u, 0xa1129ff0u, 0x8a3fcc33u, 0x9324fd72u -}; - -static const unsigned lodepng_crc32_table2[256] = { - 0x00000000u, 0x01c26a37u, 0x0384d46eu, 0x0246be59u, 0x0709a8dcu, 0x06cbc2ebu, 0x048d7cb2u, 0x054f1685u, - 0x0e1351b8u, 0x0fd13b8fu, 0x0d9785d6u, 0x0c55efe1u, 0x091af964u, 0x08d89353u, 0x0a9e2d0au, 0x0b5c473du, - 0x1c26a370u, 0x1de4c947u, 0x1fa2771eu, 0x1e601d29u, 0x1b2f0bacu, 0x1aed619bu, 0x18abdfc2u, 0x1969b5f5u, - 0x1235f2c8u, 0x13f798ffu, 0x11b126a6u, 0x10734c91u, 0x153c5a14u, 0x14fe3023u, 0x16b88e7au, 0x177ae44du, - 0x384d46e0u, 0x398f2cd7u, 0x3bc9928eu, 0x3a0bf8b9u, 0x3f44ee3cu, 0x3e86840bu, 0x3cc03a52u, 0x3d025065u, - 0x365e1758u, 0x379c7d6fu, 0x35dac336u, 0x3418a901u, 0x3157bf84u, 0x3095d5b3u, 0x32d36beau, 0x331101ddu, - 0x246be590u, 0x25a98fa7u, 0x27ef31feu, 0x262d5bc9u, 0x23624d4cu, 0x22a0277bu, 0x20e69922u, 0x2124f315u, - 0x2a78b428u, 0x2bbade1fu, 0x29fc6046u, 0x283e0a71u, 0x2d711cf4u, 0x2cb376c3u, 0x2ef5c89au, 0x2f37a2adu, - 0x709a8dc0u, 0x7158e7f7u, 0x731e59aeu, 0x72dc3399u, 0x7793251cu, 0x76514f2bu, 0x7417f172u, 0x75d59b45u, - 0x7e89dc78u, 0x7f4bb64fu, 0x7d0d0816u, 0x7ccf6221u, 0x798074a4u, 0x78421e93u, 0x7a04a0cau, 0x7bc6cafdu, - 0x6cbc2eb0u, 0x6d7e4487u, 0x6f38fadeu, 0x6efa90e9u, 0x6bb5866cu, 0x6a77ec5bu, 0x68315202u, 0x69f33835u, - 0x62af7f08u, 0x636d153fu, 0x612bab66u, 0x60e9c151u, 0x65a6d7d4u, 0x6464bde3u, 0x662203bau, 0x67e0698du, - 0x48d7cb20u, 0x4915a117u, 0x4b531f4eu, 0x4a917579u, 0x4fde63fcu, 0x4e1c09cbu, 0x4c5ab792u, 0x4d98dda5u, - 0x46c49a98u, 0x4706f0afu, 0x45404ef6u, 0x448224c1u, 0x41cd3244u, 0x400f5873u, 0x4249e62au, 0x438b8c1du, - 0x54f16850u, 0x55330267u, 0x5775bc3eu, 0x56b7d609u, 0x53f8c08cu, 0x523aaabbu, 0x507c14e2u, 0x51be7ed5u, - 0x5ae239e8u, 0x5b2053dfu, 0x5966ed86u, 0x58a487b1u, 0x5deb9134u, 0x5c29fb03u, 0x5e6f455au, 0x5fad2f6du, - 0xe1351b80u, 0xe0f771b7u, 0xe2b1cfeeu, 0xe373a5d9u, 0xe63cb35cu, 0xe7fed96bu, 0xe5b86732u, 0xe47a0d05u, - 0xef264a38u, 0xeee4200fu, 0xeca29e56u, 0xed60f461u, 0xe82fe2e4u, 0xe9ed88d3u, 0xebab368au, 0xea695cbdu, - 0xfd13b8f0u, 0xfcd1d2c7u, 0xfe976c9eu, 0xff5506a9u, 0xfa1a102cu, 0xfbd87a1bu, 0xf99ec442u, 0xf85cae75u, - 0xf300e948u, 0xf2c2837fu, 0xf0843d26u, 0xf1465711u, 0xf4094194u, 0xf5cb2ba3u, 0xf78d95fau, 0xf64fffcdu, - 0xd9785d60u, 0xd8ba3757u, 0xdafc890eu, 0xdb3ee339u, 0xde71f5bcu, 0xdfb39f8bu, 0xddf521d2u, 0xdc374be5u, - 0xd76b0cd8u, 0xd6a966efu, 0xd4efd8b6u, 0xd52db281u, 0xd062a404u, 0xd1a0ce33u, 0xd3e6706au, 0xd2241a5du, - 0xc55efe10u, 0xc49c9427u, 0xc6da2a7eu, 0xc7184049u, 0xc25756ccu, 0xc3953cfbu, 0xc1d382a2u, 0xc011e895u, - 0xcb4dafa8u, 0xca8fc59fu, 0xc8c97bc6u, 0xc90b11f1u, 0xcc440774u, 0xcd866d43u, 0xcfc0d31au, 0xce02b92du, - 0x91af9640u, 0x906dfc77u, 0x922b422eu, 0x93e92819u, 0x96a63e9cu, 0x976454abu, 0x9522eaf2u, 0x94e080c5u, - 0x9fbcc7f8u, 0x9e7eadcfu, 0x9c381396u, 0x9dfa79a1u, 0x98b56f24u, 0x99770513u, 0x9b31bb4au, 0x9af3d17du, - 0x8d893530u, 0x8c4b5f07u, 0x8e0de15eu, 0x8fcf8b69u, 0x8a809decu, 0x8b42f7dbu, 0x89044982u, 0x88c623b5u, - 0x839a6488u, 0x82580ebfu, 0x801eb0e6u, 0x81dcdad1u, 0x8493cc54u, 0x8551a663u, 0x8717183au, 0x86d5720du, - 0xa9e2d0a0u, 0xa820ba97u, 0xaa6604ceu, 0xaba46ef9u, 0xaeeb787cu, 0xaf29124bu, 0xad6fac12u, 0xacadc625u, - 0xa7f18118u, 0xa633eb2fu, 0xa4755576u, 0xa5b73f41u, 0xa0f829c4u, 0xa13a43f3u, 0xa37cfdaau, 0xa2be979du, - 0xb5c473d0u, 0xb40619e7u, 0xb640a7beu, 0xb782cd89u, 0xb2cddb0cu, 0xb30fb13bu, 0xb1490f62u, 0xb08b6555u, - 0xbbd72268u, 0xba15485fu, 0xb853f606u, 0xb9919c31u, 0xbcde8ab4u, 0xbd1ce083u, 0xbf5a5edau, 0xbe9834edu -}; - -static const unsigned lodepng_crc32_table3[256] = { - 0x00000000u, 0xb8bc6765u, 0xaa09c88bu, 0x12b5afeeu, 0x8f629757u, 0x37def032u, 0x256b5fdcu, 0x9dd738b9u, - 0xc5b428efu, 0x7d084f8au, 0x6fbde064u, 0xd7018701u, 0x4ad6bfb8u, 0xf26ad8ddu, 0xe0df7733u, 0x58631056u, - 0x5019579fu, 0xe8a530fau, 0xfa109f14u, 0x42acf871u, 0xdf7bc0c8u, 0x67c7a7adu, 0x75720843u, 0xcdce6f26u, - 0x95ad7f70u, 0x2d111815u, 0x3fa4b7fbu, 0x8718d09eu, 0x1acfe827u, 0xa2738f42u, 0xb0c620acu, 0x087a47c9u, - 0xa032af3eu, 0x188ec85bu, 0x0a3b67b5u, 0xb28700d0u, 0x2f503869u, 0x97ec5f0cu, 0x8559f0e2u, 0x3de59787u, - 0x658687d1u, 0xdd3ae0b4u, 0xcf8f4f5au, 0x7733283fu, 0xeae41086u, 0x525877e3u, 0x40edd80du, 0xf851bf68u, - 0xf02bf8a1u, 0x48979fc4u, 0x5a22302au, 0xe29e574fu, 0x7f496ff6u, 0xc7f50893u, 0xd540a77du, 0x6dfcc018u, - 0x359fd04eu, 0x8d23b72bu, 0x9f9618c5u, 0x272a7fa0u, 0xbafd4719u, 0x0241207cu, 0x10f48f92u, 0xa848e8f7u, - 0x9b14583du, 0x23a83f58u, 0x311d90b6u, 0x89a1f7d3u, 0x1476cf6au, 0xaccaa80fu, 0xbe7f07e1u, 0x06c36084u, - 0x5ea070d2u, 0xe61c17b7u, 0xf4a9b859u, 0x4c15df3cu, 0xd1c2e785u, 0x697e80e0u, 0x7bcb2f0eu, 0xc377486bu, - 0xcb0d0fa2u, 0x73b168c7u, 0x6104c729u, 0xd9b8a04cu, 0x446f98f5u, 0xfcd3ff90u, 0xee66507eu, 0x56da371bu, - 0x0eb9274du, 0xb6054028u, 0xa4b0efc6u, 0x1c0c88a3u, 0x81dbb01au, 0x3967d77fu, 0x2bd27891u, 0x936e1ff4u, - 0x3b26f703u, 0x839a9066u, 0x912f3f88u, 0x299358edu, 0xb4446054u, 0x0cf80731u, 0x1e4da8dfu, 0xa6f1cfbau, - 0xfe92dfecu, 0x462eb889u, 0x549b1767u, 0xec277002u, 0x71f048bbu, 0xc94c2fdeu, 0xdbf98030u, 0x6345e755u, - 0x6b3fa09cu, 0xd383c7f9u, 0xc1366817u, 0x798a0f72u, 0xe45d37cbu, 0x5ce150aeu, 0x4e54ff40u, 0xf6e89825u, - 0xae8b8873u, 0x1637ef16u, 0x048240f8u, 0xbc3e279du, 0x21e91f24u, 0x99557841u, 0x8be0d7afu, 0x335cb0cau, - 0xed59b63bu, 0x55e5d15eu, 0x47507eb0u, 0xffec19d5u, 0x623b216cu, 0xda874609u, 0xc832e9e7u, 0x708e8e82u, - 0x28ed9ed4u, 0x9051f9b1u, 0x82e4565fu, 0x3a58313au, 0xa78f0983u, 0x1f336ee6u, 0x0d86c108u, 0xb53aa66du, - 0xbd40e1a4u, 0x05fc86c1u, 0x1749292fu, 0xaff54e4au, 0x322276f3u, 0x8a9e1196u, 0x982bbe78u, 0x2097d91du, - 0x78f4c94bu, 0xc048ae2eu, 0xd2fd01c0u, 0x6a4166a5u, 0xf7965e1cu, 0x4f2a3979u, 0x5d9f9697u, 0xe523f1f2u, - 0x4d6b1905u, 0xf5d77e60u, 0xe762d18eu, 0x5fdeb6ebu, 0xc2098e52u, 0x7ab5e937u, 0x680046d9u, 0xd0bc21bcu, - 0x88df31eau, 0x3063568fu, 0x22d6f961u, 0x9a6a9e04u, 0x07bda6bdu, 0xbf01c1d8u, 0xadb46e36u, 0x15080953u, - 0x1d724e9au, 0xa5ce29ffu, 0xb77b8611u, 0x0fc7e174u, 0x9210d9cdu, 0x2aacbea8u, 0x38191146u, 0x80a57623u, - 0xd8c66675u, 0x607a0110u, 0x72cfaefeu, 0xca73c99bu, 0x57a4f122u, 0xef189647u, 0xfdad39a9u, 0x45115eccu, - 0x764dee06u, 0xcef18963u, 0xdc44268du, 0x64f841e8u, 0xf92f7951u, 0x41931e34u, 0x5326b1dau, 0xeb9ad6bfu, - 0xb3f9c6e9u, 0x0b45a18cu, 0x19f00e62u, 0xa14c6907u, 0x3c9b51beu, 0x842736dbu, 0x96929935u, 0x2e2efe50u, - 0x2654b999u, 0x9ee8defcu, 0x8c5d7112u, 0x34e11677u, 0xa9362eceu, 0x118a49abu, 0x033fe645u, 0xbb838120u, - 0xe3e09176u, 0x5b5cf613u, 0x49e959fdu, 0xf1553e98u, 0x6c820621u, 0xd43e6144u, 0xc68bceaau, 0x7e37a9cfu, - 0xd67f4138u, 0x6ec3265du, 0x7c7689b3u, 0xc4caeed6u, 0x591dd66fu, 0xe1a1b10au, 0xf3141ee4u, 0x4ba87981u, - 0x13cb69d7u, 0xab770eb2u, 0xb9c2a15cu, 0x017ec639u, 0x9ca9fe80u, 0x241599e5u, 0x36a0360bu, 0x8e1c516eu, - 0x866616a7u, 0x3eda71c2u, 0x2c6fde2cu, 0x94d3b949u, 0x090481f0u, 0xb1b8e695u, 0xa30d497bu, 0x1bb12e1eu, - 0x43d23e48u, 0xfb6e592du, 0xe9dbf6c3u, 0x516791a6u, 0xccb0a91fu, 0x740cce7au, 0x66b96194u, 0xde0506f1u -}; - -static const unsigned lodepng_crc32_table4[256] = { - 0x00000000u, 0x3d6029b0u, 0x7ac05360u, 0x47a07ad0u, 0xf580a6c0u, 0xc8e08f70u, 0x8f40f5a0u, 0xb220dc10u, - 0x30704bc1u, 0x0d106271u, 0x4ab018a1u, 0x77d03111u, 0xc5f0ed01u, 0xf890c4b1u, 0xbf30be61u, 0x825097d1u, - 0x60e09782u, 0x5d80be32u, 0x1a20c4e2u, 0x2740ed52u, 0x95603142u, 0xa80018f2u, 0xefa06222u, 0xd2c04b92u, - 0x5090dc43u, 0x6df0f5f3u, 0x2a508f23u, 0x1730a693u, 0xa5107a83u, 0x98705333u, 0xdfd029e3u, 0xe2b00053u, - 0xc1c12f04u, 0xfca106b4u, 0xbb017c64u, 0x866155d4u, 0x344189c4u, 0x0921a074u, 0x4e81daa4u, 0x73e1f314u, - 0xf1b164c5u, 0xccd14d75u, 0x8b7137a5u, 0xb6111e15u, 0x0431c205u, 0x3951ebb5u, 0x7ef19165u, 0x4391b8d5u, - 0xa121b886u, 0x9c419136u, 0xdbe1ebe6u, 0xe681c256u, 0x54a11e46u, 0x69c137f6u, 0x2e614d26u, 0x13016496u, - 0x9151f347u, 0xac31daf7u, 0xeb91a027u, 0xd6f18997u, 0x64d15587u, 0x59b17c37u, 0x1e1106e7u, 0x23712f57u, - 0x58f35849u, 0x659371f9u, 0x22330b29u, 0x1f532299u, 0xad73fe89u, 0x9013d739u, 0xd7b3ade9u, 0xead38459u, - 0x68831388u, 0x55e33a38u, 0x124340e8u, 0x2f236958u, 0x9d03b548u, 0xa0639cf8u, 0xe7c3e628u, 0xdaa3cf98u, - 0x3813cfcbu, 0x0573e67bu, 0x42d39cabu, 0x7fb3b51bu, 0xcd93690bu, 0xf0f340bbu, 0xb7533a6bu, 0x8a3313dbu, - 0x0863840au, 0x3503adbau, 0x72a3d76au, 0x4fc3fedau, 0xfde322cau, 0xc0830b7au, 0x872371aau, 0xba43581au, - 0x9932774du, 0xa4525efdu, 0xe3f2242du, 0xde920d9du, 0x6cb2d18du, 0x51d2f83du, 0x167282edu, 0x2b12ab5du, - 0xa9423c8cu, 0x9422153cu, 0xd3826fecu, 0xeee2465cu, 0x5cc29a4cu, 0x61a2b3fcu, 0x2602c92cu, 0x1b62e09cu, - 0xf9d2e0cfu, 0xc4b2c97fu, 0x8312b3afu, 0xbe729a1fu, 0x0c52460fu, 0x31326fbfu, 0x7692156fu, 0x4bf23cdfu, - 0xc9a2ab0eu, 0xf4c282beu, 0xb362f86eu, 0x8e02d1deu, 0x3c220dceu, 0x0142247eu, 0x46e25eaeu, 0x7b82771eu, - 0xb1e6b092u, 0x8c869922u, 0xcb26e3f2u, 0xf646ca42u, 0x44661652u, 0x79063fe2u, 0x3ea64532u, 0x03c66c82u, - 0x8196fb53u, 0xbcf6d2e3u, 0xfb56a833u, 0xc6368183u, 0x74165d93u, 0x49767423u, 0x0ed60ef3u, 0x33b62743u, - 0xd1062710u, 0xec660ea0u, 0xabc67470u, 0x96a65dc0u, 0x248681d0u, 0x19e6a860u, 0x5e46d2b0u, 0x6326fb00u, - 0xe1766cd1u, 0xdc164561u, 0x9bb63fb1u, 0xa6d61601u, 0x14f6ca11u, 0x2996e3a1u, 0x6e369971u, 0x5356b0c1u, - 0x70279f96u, 0x4d47b626u, 0x0ae7ccf6u, 0x3787e546u, 0x85a73956u, 0xb8c710e6u, 0xff676a36u, 0xc2074386u, - 0x4057d457u, 0x7d37fde7u, 0x3a978737u, 0x07f7ae87u, 0xb5d77297u, 0x88b75b27u, 0xcf1721f7u, 0xf2770847u, - 0x10c70814u, 0x2da721a4u, 0x6a075b74u, 0x576772c4u, 0xe547aed4u, 0xd8278764u, 0x9f87fdb4u, 0xa2e7d404u, - 0x20b743d5u, 0x1dd76a65u, 0x5a7710b5u, 0x67173905u, 0xd537e515u, 0xe857cca5u, 0xaff7b675u, 0x92979fc5u, - 0xe915e8dbu, 0xd475c16bu, 0x93d5bbbbu, 0xaeb5920bu, 0x1c954e1bu, 0x21f567abu, 0x66551d7bu, 0x5b3534cbu, - 0xd965a31au, 0xe4058aaau, 0xa3a5f07au, 0x9ec5d9cau, 0x2ce505dau, 0x11852c6au, 0x562556bau, 0x6b457f0au, - 0x89f57f59u, 0xb49556e9u, 0xf3352c39u, 0xce550589u, 0x7c75d999u, 0x4115f029u, 0x06b58af9u, 0x3bd5a349u, - 0xb9853498u, 0x84e51d28u, 0xc34567f8u, 0xfe254e48u, 0x4c059258u, 0x7165bbe8u, 0x36c5c138u, 0x0ba5e888u, - 0x28d4c7dfu, 0x15b4ee6fu, 0x521494bfu, 0x6f74bd0fu, 0xdd54611fu, 0xe03448afu, 0xa794327fu, 0x9af41bcfu, - 0x18a48c1eu, 0x25c4a5aeu, 0x6264df7eu, 0x5f04f6ceu, 0xed242adeu, 0xd044036eu, 0x97e479beu, 0xaa84500eu, - 0x4834505du, 0x755479edu, 0x32f4033du, 0x0f942a8du, 0xbdb4f69du, 0x80d4df2du, 0xc774a5fdu, 0xfa148c4du, - 0x78441b9cu, 0x4524322cu, 0x028448fcu, 0x3fe4614cu, 0x8dc4bd5cu, 0xb0a494ecu, 0xf704ee3cu, 0xca64c78cu -}; - -static const unsigned lodepng_crc32_table5[256] = { - 0x00000000u, 0xcb5cd3a5u, 0x4dc8a10bu, 0x869472aeu, 0x9b914216u, 0x50cd91b3u, 0xd659e31du, 0x1d0530b8u, - 0xec53826du, 0x270f51c8u, 0xa19b2366u, 0x6ac7f0c3u, 0x77c2c07bu, 0xbc9e13deu, 0x3a0a6170u, 0xf156b2d5u, - 0x03d6029bu, 0xc88ad13eu, 0x4e1ea390u, 0x85427035u, 0x9847408du, 0x531b9328u, 0xd58fe186u, 0x1ed33223u, - 0xef8580f6u, 0x24d95353u, 0xa24d21fdu, 0x6911f258u, 0x7414c2e0u, 0xbf481145u, 0x39dc63ebu, 0xf280b04eu, - 0x07ac0536u, 0xccf0d693u, 0x4a64a43du, 0x81387798u, 0x9c3d4720u, 0x57619485u, 0xd1f5e62bu, 0x1aa9358eu, - 0xebff875bu, 0x20a354feu, 0xa6372650u, 0x6d6bf5f5u, 0x706ec54du, 0xbb3216e8u, 0x3da66446u, 0xf6fab7e3u, - 0x047a07adu, 0xcf26d408u, 0x49b2a6a6u, 0x82ee7503u, 0x9feb45bbu, 0x54b7961eu, 0xd223e4b0u, 0x197f3715u, - 0xe82985c0u, 0x23755665u, 0xa5e124cbu, 0x6ebdf76eu, 0x73b8c7d6u, 0xb8e41473u, 0x3e7066ddu, 0xf52cb578u, - 0x0f580a6cu, 0xc404d9c9u, 0x4290ab67u, 0x89cc78c2u, 0x94c9487au, 0x5f959bdfu, 0xd901e971u, 0x125d3ad4u, - 0xe30b8801u, 0x28575ba4u, 0xaec3290au, 0x659ffaafu, 0x789aca17u, 0xb3c619b2u, 0x35526b1cu, 0xfe0eb8b9u, - 0x0c8e08f7u, 0xc7d2db52u, 0x4146a9fcu, 0x8a1a7a59u, 0x971f4ae1u, 0x5c439944u, 0xdad7ebeau, 0x118b384fu, - 0xe0dd8a9au, 0x2b81593fu, 0xad152b91u, 0x6649f834u, 0x7b4cc88cu, 0xb0101b29u, 0x36846987u, 0xfdd8ba22u, - 0x08f40f5au, 0xc3a8dcffu, 0x453cae51u, 0x8e607df4u, 0x93654d4cu, 0x58399ee9u, 0xdeadec47u, 0x15f13fe2u, - 0xe4a78d37u, 0x2ffb5e92u, 0xa96f2c3cu, 0x6233ff99u, 0x7f36cf21u, 0xb46a1c84u, 0x32fe6e2au, 0xf9a2bd8fu, - 0x0b220dc1u, 0xc07ede64u, 0x46eaaccau, 0x8db67f6fu, 0x90b34fd7u, 0x5bef9c72u, 0xdd7beedcu, 0x16273d79u, - 0xe7718facu, 0x2c2d5c09u, 0xaab92ea7u, 0x61e5fd02u, 0x7ce0cdbau, 0xb7bc1e1fu, 0x31286cb1u, 0xfa74bf14u, - 0x1eb014d8u, 0xd5ecc77du, 0x5378b5d3u, 0x98246676u, 0x852156ceu, 0x4e7d856bu, 0xc8e9f7c5u, 0x03b52460u, - 0xf2e396b5u, 0x39bf4510u, 0xbf2b37beu, 0x7477e41bu, 0x6972d4a3u, 0xa22e0706u, 0x24ba75a8u, 0xefe6a60du, - 0x1d661643u, 0xd63ac5e6u, 0x50aeb748u, 0x9bf264edu, 0x86f75455u, 0x4dab87f0u, 0xcb3ff55eu, 0x006326fbu, - 0xf135942eu, 0x3a69478bu, 0xbcfd3525u, 0x77a1e680u, 0x6aa4d638u, 0xa1f8059du, 0x276c7733u, 0xec30a496u, - 0x191c11eeu, 0xd240c24bu, 0x54d4b0e5u, 0x9f886340u, 0x828d53f8u, 0x49d1805du, 0xcf45f2f3u, 0x04192156u, - 0xf54f9383u, 0x3e134026u, 0xb8873288u, 0x73dbe12du, 0x6eded195u, 0xa5820230u, 0x2316709eu, 0xe84aa33bu, - 0x1aca1375u, 0xd196c0d0u, 0x5702b27eu, 0x9c5e61dbu, 0x815b5163u, 0x4a0782c6u, 0xcc93f068u, 0x07cf23cdu, - 0xf6999118u, 0x3dc542bdu, 0xbb513013u, 0x700de3b6u, 0x6d08d30eu, 0xa65400abu, 0x20c07205u, 0xeb9ca1a0u, - 0x11e81eb4u, 0xdab4cd11u, 0x5c20bfbfu, 0x977c6c1au, 0x8a795ca2u, 0x41258f07u, 0xc7b1fda9u, 0x0ced2e0cu, - 0xfdbb9cd9u, 0x36e74f7cu, 0xb0733dd2u, 0x7b2fee77u, 0x662adecfu, 0xad760d6au, 0x2be27fc4u, 0xe0beac61u, - 0x123e1c2fu, 0xd962cf8au, 0x5ff6bd24u, 0x94aa6e81u, 0x89af5e39u, 0x42f38d9cu, 0xc467ff32u, 0x0f3b2c97u, - 0xfe6d9e42u, 0x35314de7u, 0xb3a53f49u, 0x78f9ececu, 0x65fcdc54u, 0xaea00ff1u, 0x28347d5fu, 0xe368aefau, - 0x16441b82u, 0xdd18c827u, 0x5b8cba89u, 0x90d0692cu, 0x8dd55994u, 0x46898a31u, 0xc01df89fu, 0x0b412b3au, - 0xfa1799efu, 0x314b4a4au, 0xb7df38e4u, 0x7c83eb41u, 0x6186dbf9u, 0xaada085cu, 0x2c4e7af2u, 0xe712a957u, - 0x15921919u, 0xdececabcu, 0x585ab812u, 0x93066bb7u, 0x8e035b0fu, 0x455f88aau, 0xc3cbfa04u, 0x089729a1u, - 0xf9c19b74u, 0x329d48d1u, 0xb4093a7fu, 0x7f55e9dau, 0x6250d962u, 0xa90c0ac7u, 0x2f987869u, 0xe4c4abccu -}; - -static const unsigned lodepng_crc32_table6[256] = { - 0x00000000u, 0xa6770bb4u, 0x979f1129u, 0x31e81a9du, 0xf44f2413u, 0x52382fa7u, 0x63d0353au, 0xc5a73e8eu, - 0x33ef4e67u, 0x959845d3u, 0xa4705f4eu, 0x020754fau, 0xc7a06a74u, 0x61d761c0u, 0x503f7b5du, 0xf64870e9u, - 0x67de9cceu, 0xc1a9977au, 0xf0418de7u, 0x56368653u, 0x9391b8ddu, 0x35e6b369u, 0x040ea9f4u, 0xa279a240u, - 0x5431d2a9u, 0xf246d91du, 0xc3aec380u, 0x65d9c834u, 0xa07ef6bau, 0x0609fd0eu, 0x37e1e793u, 0x9196ec27u, - 0xcfbd399cu, 0x69ca3228u, 0x582228b5u, 0xfe552301u, 0x3bf21d8fu, 0x9d85163bu, 0xac6d0ca6u, 0x0a1a0712u, - 0xfc5277fbu, 0x5a257c4fu, 0x6bcd66d2u, 0xcdba6d66u, 0x081d53e8u, 0xae6a585cu, 0x9f8242c1u, 0x39f54975u, - 0xa863a552u, 0x0e14aee6u, 0x3ffcb47bu, 0x998bbfcfu, 0x5c2c8141u, 0xfa5b8af5u, 0xcbb39068u, 0x6dc49bdcu, - 0x9b8ceb35u, 0x3dfbe081u, 0x0c13fa1cu, 0xaa64f1a8u, 0x6fc3cf26u, 0xc9b4c492u, 0xf85cde0fu, 0x5e2bd5bbu, - 0x440b7579u, 0xe27c7ecdu, 0xd3946450u, 0x75e36fe4u, 0xb044516au, 0x16335adeu, 0x27db4043u, 0x81ac4bf7u, - 0x77e43b1eu, 0xd19330aau, 0xe07b2a37u, 0x460c2183u, 0x83ab1f0du, 0x25dc14b9u, 0x14340e24u, 0xb2430590u, - 0x23d5e9b7u, 0x85a2e203u, 0xb44af89eu, 0x123df32au, 0xd79acda4u, 0x71edc610u, 0x4005dc8du, 0xe672d739u, - 0x103aa7d0u, 0xb64dac64u, 0x87a5b6f9u, 0x21d2bd4du, 0xe47583c3u, 0x42028877u, 0x73ea92eau, 0xd59d995eu, - 0x8bb64ce5u, 0x2dc14751u, 0x1c295dccu, 0xba5e5678u, 0x7ff968f6u, 0xd98e6342u, 0xe86679dfu, 0x4e11726bu, - 0xb8590282u, 0x1e2e0936u, 0x2fc613abu, 0x89b1181fu, 0x4c162691u, 0xea612d25u, 0xdb8937b8u, 0x7dfe3c0cu, - 0xec68d02bu, 0x4a1fdb9fu, 0x7bf7c102u, 0xdd80cab6u, 0x1827f438u, 0xbe50ff8cu, 0x8fb8e511u, 0x29cfeea5u, - 0xdf879e4cu, 0x79f095f8u, 0x48188f65u, 0xee6f84d1u, 0x2bc8ba5fu, 0x8dbfb1ebu, 0xbc57ab76u, 0x1a20a0c2u, - 0x8816eaf2u, 0x2e61e146u, 0x1f89fbdbu, 0xb9fef06fu, 0x7c59cee1u, 0xda2ec555u, 0xebc6dfc8u, 0x4db1d47cu, - 0xbbf9a495u, 0x1d8eaf21u, 0x2c66b5bcu, 0x8a11be08u, 0x4fb68086u, 0xe9c18b32u, 0xd82991afu, 0x7e5e9a1bu, - 0xefc8763cu, 0x49bf7d88u, 0x78576715u, 0xde206ca1u, 0x1b87522fu, 0xbdf0599bu, 0x8c184306u, 0x2a6f48b2u, - 0xdc27385bu, 0x7a5033efu, 0x4bb82972u, 0xedcf22c6u, 0x28681c48u, 0x8e1f17fcu, 0xbff70d61u, 0x198006d5u, - 0x47abd36eu, 0xe1dcd8dau, 0xd034c247u, 0x7643c9f3u, 0xb3e4f77du, 0x1593fcc9u, 0x247be654u, 0x820cede0u, - 0x74449d09u, 0xd23396bdu, 0xe3db8c20u, 0x45ac8794u, 0x800bb91au, 0x267cb2aeu, 0x1794a833u, 0xb1e3a387u, - 0x20754fa0u, 0x86024414u, 0xb7ea5e89u, 0x119d553du, 0xd43a6bb3u, 0x724d6007u, 0x43a57a9au, 0xe5d2712eu, - 0x139a01c7u, 0xb5ed0a73u, 0x840510eeu, 0x22721b5au, 0xe7d525d4u, 0x41a22e60u, 0x704a34fdu, 0xd63d3f49u, - 0xcc1d9f8bu, 0x6a6a943fu, 0x5b828ea2u, 0xfdf58516u, 0x3852bb98u, 0x9e25b02cu, 0xafcdaab1u, 0x09baa105u, - 0xfff2d1ecu, 0x5985da58u, 0x686dc0c5u, 0xce1acb71u, 0x0bbdf5ffu, 0xadcafe4bu, 0x9c22e4d6u, 0x3a55ef62u, - 0xabc30345u, 0x0db408f1u, 0x3c5c126cu, 0x9a2b19d8u, 0x5f8c2756u, 0xf9fb2ce2u, 0xc813367fu, 0x6e643dcbu, - 0x982c4d22u, 0x3e5b4696u, 0x0fb35c0bu, 0xa9c457bfu, 0x6c636931u, 0xca146285u, 0xfbfc7818u, 0x5d8b73acu, - 0x03a0a617u, 0xa5d7ada3u, 0x943fb73eu, 0x3248bc8au, 0xf7ef8204u, 0x519889b0u, 0x6070932du, 0xc6079899u, - 0x304fe870u, 0x9638e3c4u, 0xa7d0f959u, 0x01a7f2edu, 0xc400cc63u, 0x6277c7d7u, 0x539fdd4au, 0xf5e8d6feu, - 0x647e3ad9u, 0xc209316du, 0xf3e12bf0u, 0x55962044u, 0x90311ecau, 0x3646157eu, 0x07ae0fe3u, 0xa1d90457u, - 0x579174beu, 0xf1e67f0au, 0xc00e6597u, 0x66796e23u, 0xa3de50adu, 0x05a95b19u, 0x34414184u, 0x92364a30u -}; - -static const unsigned lodepng_crc32_table7[256] = { - 0x00000000u, 0xccaa009eu, 0x4225077du, 0x8e8f07e3u, 0x844a0efau, 0x48e00e64u, 0xc66f0987u, 0x0ac50919u, - 0xd3e51bb5u, 0x1f4f1b2bu, 0x91c01cc8u, 0x5d6a1c56u, 0x57af154fu, 0x9b0515d1u, 0x158a1232u, 0xd92012acu, - 0x7cbb312bu, 0xb01131b5u, 0x3e9e3656u, 0xf23436c8u, 0xf8f13fd1u, 0x345b3f4fu, 0xbad438acu, 0x767e3832u, - 0xaf5e2a9eu, 0x63f42a00u, 0xed7b2de3u, 0x21d12d7du, 0x2b142464u, 0xe7be24fau, 0x69312319u, 0xa59b2387u, - 0xf9766256u, 0x35dc62c8u, 0xbb53652bu, 0x77f965b5u, 0x7d3c6cacu, 0xb1966c32u, 0x3f196bd1u, 0xf3b36b4fu, - 0x2a9379e3u, 0xe639797du, 0x68b67e9eu, 0xa41c7e00u, 0xaed97719u, 0x62737787u, 0xecfc7064u, 0x205670fau, - 0x85cd537du, 0x496753e3u, 0xc7e85400u, 0x0b42549eu, 0x01875d87u, 0xcd2d5d19u, 0x43a25afau, 0x8f085a64u, - 0x562848c8u, 0x9a824856u, 0x140d4fb5u, 0xd8a74f2bu, 0xd2624632u, 0x1ec846acu, 0x9047414fu, 0x5ced41d1u, - 0x299dc2edu, 0xe537c273u, 0x6bb8c590u, 0xa712c50eu, 0xadd7cc17u, 0x617dcc89u, 0xeff2cb6au, 0x2358cbf4u, - 0xfa78d958u, 0x36d2d9c6u, 0xb85dde25u, 0x74f7debbu, 0x7e32d7a2u, 0xb298d73cu, 0x3c17d0dfu, 0xf0bdd041u, - 0x5526f3c6u, 0x998cf358u, 0x1703f4bbu, 0xdba9f425u, 0xd16cfd3cu, 0x1dc6fda2u, 0x9349fa41u, 0x5fe3fadfu, - 0x86c3e873u, 0x4a69e8edu, 0xc4e6ef0eu, 0x084cef90u, 0x0289e689u, 0xce23e617u, 0x40ace1f4u, 0x8c06e16au, - 0xd0eba0bbu, 0x1c41a025u, 0x92cea7c6u, 0x5e64a758u, 0x54a1ae41u, 0x980baedfu, 0x1684a93cu, 0xda2ea9a2u, - 0x030ebb0eu, 0xcfa4bb90u, 0x412bbc73u, 0x8d81bcedu, 0x8744b5f4u, 0x4beeb56au, 0xc561b289u, 0x09cbb217u, - 0xac509190u, 0x60fa910eu, 0xee7596edu, 0x22df9673u, 0x281a9f6au, 0xe4b09ff4u, 0x6a3f9817u, 0xa6959889u, - 0x7fb58a25u, 0xb31f8abbu, 0x3d908d58u, 0xf13a8dc6u, 0xfbff84dfu, 0x37558441u, 0xb9da83a2u, 0x7570833cu, - 0x533b85dau, 0x9f918544u, 0x111e82a7u, 0xddb48239u, 0xd7718b20u, 0x1bdb8bbeu, 0x95548c5du, 0x59fe8cc3u, - 0x80de9e6fu, 0x4c749ef1u, 0xc2fb9912u, 0x0e51998cu, 0x04949095u, 0xc83e900bu, 0x46b197e8u, 0x8a1b9776u, - 0x2f80b4f1u, 0xe32ab46fu, 0x6da5b38cu, 0xa10fb312u, 0xabcaba0bu, 0x6760ba95u, 0xe9efbd76u, 0x2545bde8u, - 0xfc65af44u, 0x30cfafdau, 0xbe40a839u, 0x72eaa8a7u, 0x782fa1beu, 0xb485a120u, 0x3a0aa6c3u, 0xf6a0a65du, - 0xaa4de78cu, 0x66e7e712u, 0xe868e0f1u, 0x24c2e06fu, 0x2e07e976u, 0xe2ade9e8u, 0x6c22ee0bu, 0xa088ee95u, - 0x79a8fc39u, 0xb502fca7u, 0x3b8dfb44u, 0xf727fbdau, 0xfde2f2c3u, 0x3148f25du, 0xbfc7f5beu, 0x736df520u, - 0xd6f6d6a7u, 0x1a5cd639u, 0x94d3d1dau, 0x5879d144u, 0x52bcd85du, 0x9e16d8c3u, 0x1099df20u, 0xdc33dfbeu, - 0x0513cd12u, 0xc9b9cd8cu, 0x4736ca6fu, 0x8b9ccaf1u, 0x8159c3e8u, 0x4df3c376u, 0xc37cc495u, 0x0fd6c40bu, - 0x7aa64737u, 0xb60c47a9u, 0x3883404au, 0xf42940d4u, 0xfeec49cdu, 0x32464953u, 0xbcc94eb0u, 0x70634e2eu, - 0xa9435c82u, 0x65e95c1cu, 0xeb665bffu, 0x27cc5b61u, 0x2d095278u, 0xe1a352e6u, 0x6f2c5505u, 0xa386559bu, - 0x061d761cu, 0xcab77682u, 0x44387161u, 0x889271ffu, 0x825778e6u, 0x4efd7878u, 0xc0727f9bu, 0x0cd87f05u, - 0xd5f86da9u, 0x19526d37u, 0x97dd6ad4u, 0x5b776a4au, 0x51b26353u, 0x9d1863cdu, 0x1397642eu, 0xdf3d64b0u, - 0x83d02561u, 0x4f7a25ffu, 0xc1f5221cu, 0x0d5f2282u, 0x079a2b9bu, 0xcb302b05u, 0x45bf2ce6u, 0x89152c78u, - 0x50353ed4u, 0x9c9f3e4au, 0x121039a9u, 0xdeba3937u, 0xd47f302eu, 0x18d530b0u, 0x965a3753u, 0x5af037cdu, - 0xff6b144au, 0x33c114d4u, 0xbd4e1337u, 0x71e413a9u, 0x7b211ab0u, 0xb78b1a2eu, 0x39041dcdu, 0xf5ae1d53u, - 0x2c8e0fffu, 0xe0240f61u, 0x6eab0882u, 0xa201081cu, 0xa8c40105u, 0x646e019bu, 0xeae10678u, 0x264b06e6u -}; - -/* Computes the cyclic redundancy check as used by PNG chunks*/ -unsigned lodepng_crc32(const unsigned char * data, size_t length) -{ - /*Using the Slicing by Eight algorithm*/ - unsigned r = 0xffffffffu; - while(length >= 8) { - r = lodepng_crc32_table7[(data[0] ^ (r & 0xffu))] ^ - lodepng_crc32_table6[(data[1] ^ ((r >> 8) & 0xffu))] ^ - lodepng_crc32_table5[(data[2] ^ ((r >> 16) & 0xffu))] ^ - lodepng_crc32_table4[(data[3] ^ ((r >> 24) & 0xffu))] ^ - lodepng_crc32_table3[data[4]] ^ - lodepng_crc32_table2[data[5]] ^ - lodepng_crc32_table1[data[6]] ^ - lodepng_crc32_table0[data[7]]; - data += 8; - length -= 8; - } - while(length--) { - r = lodepng_crc32_table0[(r ^ *data++) & 0xffu] ^ (r >> 8); - } - return r ^ 0xffffffffu; -} -#else /* LODEPNG_COMPILE_CRC */ -/*in this case, the function is only declared here, and must be defined externally -so that it will be linked in. - -Example implementation that uses a much smaller lookup table for memory constrained cases: - -unsigned lodepng_crc32(const unsigned char* data, size_t length) { - unsigned r = 0xffffffffu; - static const unsigned table[16] = { - 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c, - 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c, 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c - }; - while(length--) { - r = table[(r ^ *data) & 0xf] ^ (r >> 4); - r = table[(r ^ (*data >> 4)) & 0xf] ^ (r >> 4); - data++; - } - return r ^ 0xffffffffu; -} -*/ -unsigned lodepng_crc32(const unsigned char * data, size_t length); -#endif /* LODEPNG_COMPILE_CRC */ - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / Reading and writing PNG color channel bits / */ -/* ////////////////////////////////////////////////////////////////////////// */ - -/* The color channel bits of less-than-8-bit pixels are read with the MSB of bytes first, -so LodePNGBitWriter and LodePNGBitReader can't be used for those. */ - -static unsigned char readBitFromReversedStream(size_t * bitpointer, const unsigned char * bitstream) -{ - unsigned char result = (unsigned char)((bitstream[(*bitpointer) >> 3] >> (7 - ((*bitpointer) & 0x7))) & 1); - ++(*bitpointer); - return result; -} - -/* TODO: make this faster */ -static unsigned readBitsFromReversedStream(size_t * bitpointer, const unsigned char * bitstream, size_t nbits) -{ - unsigned result = 0; - size_t i; - for(i = 0 ; i < nbits; ++i) { - result <<= 1u; - result |= (unsigned)readBitFromReversedStream(bitpointer, bitstream); - } - return result; -} - -static void setBitOfReversedStream(size_t * bitpointer, unsigned char * bitstream, unsigned char bit) -{ - /*the current bit in bitstream may be 0 or 1 for this to work*/ - if(bit == 0) bitstream[(*bitpointer) >> 3u] &= (unsigned char)(~(1u << (7u - ((*bitpointer) & 7u)))); - else bitstream[(*bitpointer) >> 3u] |= (1u << (7u - ((*bitpointer) & 7u))); - ++(*bitpointer); -} - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / PNG chunks / */ -/* ////////////////////////////////////////////////////////////////////////// */ - -unsigned lodepng_chunk_length(const unsigned char * chunk) -{ - return lodepng_read32bitInt(chunk); -} - -void lodepng_chunk_type(char type[5], const unsigned char * chunk) -{ - unsigned i; - for(i = 0; i != 4; ++i) type[i] = (char)chunk[4 + i]; - type[4] = 0; /*null termination char*/ -} - -unsigned char lodepng_chunk_type_equals(const unsigned char * chunk, const char * type) -{ - if(lodepng_strlen(type) != 4) return 0; - return (chunk[4] == type[0] && chunk[5] == type[1] && chunk[6] == type[2] && chunk[7] == type[3]); -} - -unsigned char lodepng_chunk_ancillary(const unsigned char * chunk) -{ - return((chunk[4] & 32) != 0); -} - -unsigned char lodepng_chunk_private(const unsigned char * chunk) -{ - return((chunk[6] & 32) != 0); -} - -unsigned char lodepng_chunk_safetocopy(const unsigned char * chunk) -{ - return((chunk[7] & 32) != 0); -} - -unsigned char * lodepng_chunk_data(unsigned char * chunk) -{ - return &chunk[8]; -} - -const unsigned char * lodepng_chunk_data_const(const unsigned char * chunk) -{ - return &chunk[8]; -} - -unsigned lodepng_chunk_check_crc(const unsigned char * chunk) -{ - unsigned length = lodepng_chunk_length(chunk); - unsigned CRC = lodepng_read32bitInt(&chunk[length + 8]); - /*the CRC is taken of the data and the 4 chunk type letters, not the length*/ - unsigned checksum = lodepng_crc32(&chunk[4], length + 4); - if(CRC != checksum) return 1; - else return 0; -} - -void lodepng_chunk_generate_crc(unsigned char * chunk) -{ - unsigned length = lodepng_chunk_length(chunk); - unsigned CRC = lodepng_crc32(&chunk[4], length + 4); - lodepng_set32bitInt(chunk + 8 + length, CRC); -} - -unsigned char * lodepng_chunk_next(unsigned char * chunk, unsigned char * end) -{ - size_t available_size = (size_t)(end - chunk); - if(chunk >= end || available_size < 12) return end; /*too small to contain a chunk*/ - if(chunk[0] == 0x89 && chunk[1] == 0x50 && chunk[2] == 0x4e && chunk[3] == 0x47 - && chunk[4] == 0x0d && chunk[5] == 0x0a && chunk[6] == 0x1a && chunk[7] == 0x0a) { - /* Is PNG magic header at start of PNG file. Jump to first actual chunk. */ - return chunk + 8; - } - else { - size_t total_chunk_length; - if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return end; - if(total_chunk_length > available_size) return end; /*outside of range*/ - return chunk + total_chunk_length; - } -} - -const unsigned char * lodepng_chunk_next_const(const unsigned char * chunk, const unsigned char * end) -{ - size_t available_size = (size_t)(end - chunk); - if(chunk >= end || available_size < 12) return end; /*too small to contain a chunk*/ - if(chunk[0] == 0x89 && chunk[1] == 0x50 && chunk[2] == 0x4e && chunk[3] == 0x47 - && chunk[4] == 0x0d && chunk[5] == 0x0a && chunk[6] == 0x1a && chunk[7] == 0x0a) { - /* Is PNG magic header at start of PNG file. Jump to first actual chunk. */ - return chunk + 8; - } - else { - size_t total_chunk_length; - if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return end; - if(total_chunk_length > available_size) return end; /*outside of range*/ - return chunk + total_chunk_length; - } -} - -unsigned char * lodepng_chunk_find(unsigned char * chunk, unsigned char * end, const char type[5]) -{ - for(;;) { - if(chunk >= end || end - chunk < 12) return 0; /* past file end: chunk + 12 > end */ - if(lodepng_chunk_type_equals(chunk, type)) return chunk; - chunk = lodepng_chunk_next(chunk, end); - } -} - -const unsigned char * lodepng_chunk_find_const(const unsigned char * chunk, const unsigned char * end, - const char type[5]) -{ - for(;;) { - if(chunk >= end || end - chunk < 12) return 0; /* past file end: chunk + 12 > end */ - if(lodepng_chunk_type_equals(chunk, type)) return chunk; - chunk = lodepng_chunk_next_const(chunk, end); - } -} - -unsigned lodepng_chunk_append(unsigned char ** out, size_t * outsize, const unsigned char * chunk) -{ - unsigned i; - size_t total_chunk_length, new_length; - unsigned char * chunk_start, * new_buffer; - - if(lodepng_addofl(lodepng_chunk_length(chunk), 12, &total_chunk_length)) return 77; - if(lodepng_addofl(*outsize, total_chunk_length, &new_length)) return 77; - - new_buffer = (unsigned char *)lodepng_realloc(*out, new_length); - if(!new_buffer) return 83; /*alloc fail*/ - (*out) = new_buffer; - (*outsize) = new_length; - chunk_start = &(*out)[new_length - total_chunk_length]; - - for(i = 0; i != total_chunk_length; ++i) chunk_start[i] = chunk[i]; - - return 0; -} - -/*Sets length and name and allocates the space for data and crc but does not -set data or crc yet. Returns the start of the chunk in chunk. The start of -the data is at chunk + 8. To finalize chunk, add the data, then use -lodepng_chunk_generate_crc */ -static unsigned lodepng_chunk_init(unsigned char ** chunk, - ucvector * out, - size_t length, const char * type) -{ - size_t new_length = out->size; - if(lodepng_addofl(new_length, length, &new_length)) return 77; - if(lodepng_addofl(new_length, 12, &new_length)) return 77; - if(!ucvector_resize(out, new_length)) return 83; /*alloc fail*/ - *chunk = out->data + new_length - length - 12u; - - /*1: length*/ - lodepng_set32bitInt(*chunk, (unsigned)length); - - /*2: chunk name (4 letters)*/ - lodepng_memcpy(*chunk + 4, type, 4); - - return 0; -} - -/* like lodepng_chunk_create but with custom allocsize */ -static unsigned lodepng_chunk_createv(ucvector * out, - size_t length, const char * type, const unsigned char * data) -{ - unsigned char * chunk; - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, length, type)); - - /*3: the data*/ - lodepng_memcpy(chunk + 8, data, length); - - /*4: CRC (of the chunkname characters and the data)*/ - lodepng_chunk_generate_crc(chunk); - - return 0; -} - -unsigned lodepng_chunk_create(unsigned char ** out, size_t * outsize, - size_t length, const char * type, const unsigned char * data) -{ - ucvector v = ucvector_init(*out, *outsize); - unsigned error = lodepng_chunk_createv(&v, length, type, data); - *out = v.data; - *outsize = v.size; - return error; -} - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / Color types, channels, bits / */ -/* ////////////////////////////////////////////////////////////////////////// */ - -/*checks if the colortype is valid and the bitdepth bd is allowed for this colortype. -Return value is a LodePNG error code.*/ -static unsigned checkColorValidity(LodePNGColorType colortype, unsigned bd) -{ - switch(colortype) { - case LCT_GREY: - if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8 || bd == 16)) return 37; - break; - case LCT_RGB: - if(!(bd == 8 || bd == 16)) return 37; - break; - case LCT_PALETTE: - if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8)) return 37; - break; - case LCT_GREY_ALPHA: - if(!(bd == 8 || bd == 16)) return 37; - break; - case LCT_RGBA: - if(!(bd == 8 || bd == 16)) return 37; - break; - case LCT_MAX_OCTET_VALUE: - return 31; /* invalid color type */ - default: - return 31; /* invalid color type */ - } - return 0; /*allowed color type / bits combination*/ -} - -static unsigned getNumColorChannels(LodePNGColorType colortype) -{ - switch(colortype) { - case LCT_GREY: - return 1; - case LCT_RGB: - return 3; - case LCT_PALETTE: - return 1; - case LCT_GREY_ALPHA: - return 2; - case LCT_RGBA: - return 4; - case LCT_MAX_OCTET_VALUE: - return 0; /* invalid color type */ - default: - return 0; /*invalid color type*/ - } -} - -static unsigned lodepng_get_bpp_lct(LodePNGColorType colortype, unsigned bitdepth) -{ - /*bits per pixel is amount of channels * bits per channel*/ - return getNumColorChannels(colortype) * bitdepth; -} - -/* ////////////////////////////////////////////////////////////////////////// */ - -void lodepng_color_mode_init(LodePNGColorMode * info) -{ - info->key_defined = 0; - info->key_r = info->key_g = info->key_b = 0; - info->colortype = LCT_RGBA; - info->bitdepth = 8; - info->palette = 0; - info->palettesize = 0; -} - -/*allocates palette memory if needed, and initializes all colors to black*/ -static void lodepng_color_mode_alloc_palette(LodePNGColorMode * info) -{ - size_t i; - /*if the palette is already allocated, it will have size 1024 so no reallocation needed in that case*/ - /*the palette must have room for up to 256 colors with 4 bytes each.*/ - if(!info->palette) info->palette = (unsigned char *)lodepng_malloc(1024); - if(!info->palette) return; /*alloc fail*/ - for(i = 0; i != 256; ++i) { - /*Initialize all unused colors with black, the value used for invalid palette indices. - This is an error according to the PNG spec, but common PNG decoders make it black instead. - That makes color conversion slightly faster due to no error handling needed.*/ - info->palette[i * 4 + 0] = 0; - info->palette[i * 4 + 1] = 0; - info->palette[i * 4 + 2] = 0; - info->palette[i * 4 + 3] = 255; - } -} - -void lodepng_color_mode_cleanup(LodePNGColorMode * info) -{ - lodepng_palette_clear(info); -} - -unsigned lodepng_color_mode_copy(LodePNGColorMode * dest, const LodePNGColorMode * source) -{ - lodepng_color_mode_cleanup(dest); - lodepng_memcpy(dest, source, sizeof(LodePNGColorMode)); - if(source->palette) { - dest->palette = (unsigned char *)lodepng_malloc(1024); - if(!dest->palette && source->palettesize) return 83; /*alloc fail*/ - lodepng_memcpy(dest->palette, source->palette, source->palettesize * 4); - } - return 0; -} - -LodePNGColorMode lodepng_color_mode_make(LodePNGColorType colortype, unsigned bitdepth) -{ - LodePNGColorMode result; - lodepng_color_mode_init(&result); - result.colortype = colortype; - result.bitdepth = bitdepth; - return result; -} - -static int lodepng_color_mode_equal(const LodePNGColorMode * a, const LodePNGColorMode * b) -{ - size_t i; - if(a->colortype != b->colortype) return 0; - if(a->bitdepth != b->bitdepth) return 0; - if(a->key_defined != b->key_defined) return 0; - if(a->key_defined) { - if(a->key_r != b->key_r) return 0; - if(a->key_g != b->key_g) return 0; - if(a->key_b != b->key_b) return 0; - } - if(a->palettesize != b->palettesize) return 0; - for(i = 0; i != a->palettesize * 4; ++i) { - if(a->palette[i] != b->palette[i]) return 0; - } - return 1; -} - -void lodepng_palette_clear(LodePNGColorMode * info) -{ - if(info->palette) lodepng_free(info->palette); - info->palette = 0; - info->palettesize = 0; -} - -unsigned lodepng_palette_add(LodePNGColorMode * info, - unsigned char r, unsigned char g, unsigned char b, unsigned char a) -{ - if(!info->palette) { /*allocate palette if empty*/ - lodepng_color_mode_alloc_palette(info); - if(!info->palette) return 83; /*alloc fail*/ - } - if(info->palettesize >= 256) { - return 108; /*too many palette values*/ - } - info->palette[4 * info->palettesize + 0] = r; - info->palette[4 * info->palettesize + 1] = g; - info->palette[4 * info->palettesize + 2] = b; - info->palette[4 * info->palettesize + 3] = a; - ++info->palettesize; - return 0; -} - -/*calculate bits per pixel out of colortype and bitdepth*/ -unsigned lodepng_get_bpp(const LodePNGColorMode * info) -{ - return lodepng_get_bpp_lct(info->colortype, info->bitdepth); -} - -unsigned lodepng_get_channels(const LodePNGColorMode * info) -{ - return getNumColorChannels(info->colortype); -} - -unsigned lodepng_is_greyscale_type(const LodePNGColorMode * info) -{ - return info->colortype == LCT_GREY || info->colortype == LCT_GREY_ALPHA; -} - -unsigned lodepng_is_alpha_type(const LodePNGColorMode * info) -{ - return (info->colortype & 4) != 0; /*4 or 6*/ -} - -unsigned lodepng_is_palette_type(const LodePNGColorMode * info) -{ - return info->colortype == LCT_PALETTE; -} - -unsigned lodepng_has_palette_alpha(const LodePNGColorMode * info) -{ - size_t i; - for(i = 0; i != info->palettesize; ++i) { - if(info->palette[i * 4 + 3] < 255) return 1; - } - return 0; -} - -unsigned lodepng_can_have_alpha(const LodePNGColorMode * info) -{ - return info->key_defined - || lodepng_is_alpha_type(info) - || lodepng_has_palette_alpha(info); -} - -static size_t lodepng_get_raw_size_lct(unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) -{ - size_t bpp = lodepng_get_bpp_lct(colortype, bitdepth); - size_t n = (size_t)w * (size_t)h; - return ((n / 8u) * bpp) + ((n & 7u) * bpp + 7u) / 8u; -} - -size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode * color) -{ - return lodepng_get_raw_size_lct(w, h, color->colortype, color->bitdepth); -} - - -#ifdef LODEPNG_COMPILE_PNG - -/*in an idat chunk, each scanline is a multiple of 8 bits, unlike the lodepng output buffer, -and in addition has one extra byte per line: the filter byte. So this gives a larger -result than lodepng_get_raw_size. Set h to 1 to get the size of 1 row including filter byte. */ -static size_t lodepng_get_raw_size_idat(unsigned w, unsigned h, unsigned bpp) -{ - /* + 1 for the filter byte, and possibly plus padding bits per line. */ - /* Ignoring casts, the expression is equal to (w * bpp + 7) / 8 + 1, but avoids overflow of w * bpp */ - size_t line = ((size_t)(w / 8u) * bpp) + 1u + ((w & 7u) * bpp + 7u) / 8u; - return (size_t)h * line; -} - -#ifdef LODEPNG_COMPILE_DECODER -/*Safely checks whether size_t overflow can be caused due to amount of pixels. -This check is overcautious rather than precise. If this check indicates no overflow, -you can safely compute in a size_t (but not an unsigned): --(size_t)w * (size_t)h * 8 --amount of bytes in IDAT (including filter, padding and Adam7 bytes) --amount of bytes in raw color model -Returns 1 if overflow possible, 0 if not. -*/ -static int lodepng_pixel_overflow(unsigned w, unsigned h, - const LodePNGColorMode * pngcolor, const LodePNGColorMode * rawcolor) -{ - size_t bpp = LODEPNG_MAX(lodepng_get_bpp(pngcolor), lodepng_get_bpp(rawcolor)); - size_t numpixels, total; - size_t line; /* bytes per line in worst case */ - - if(lodepng_mulofl((size_t)w, (size_t)h, &numpixels)) return 1; - if(lodepng_mulofl(numpixels, 8, &total)) return 1; /* bit pointer with 8-bit color, or 8 bytes per channel color */ - - /* Bytes per scanline with the expression "(w / 8u) * bpp) + ((w & 7u) * bpp + 7u) / 8u" */ - if(lodepng_mulofl((size_t)(w / 8u), bpp, &line)) return 1; - if(lodepng_addofl(line, ((w & 7u) * bpp + 7u) / 8u, &line)) return 1; - - if(lodepng_addofl(line, 5, &line)) return 1; /* 5 bytes overhead per line: 1 filterbyte, 4 for Adam7 worst case */ - if(lodepng_mulofl(line, h, &total)) return 1; /* Total bytes in worst case */ - - return 0; /* no overflow */ -} -#endif /*LODEPNG_COMPILE_DECODER*/ -#endif /*LODEPNG_COMPILE_PNG*/ - -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - -static void LodePNGUnknownChunks_init(LodePNGInfo * info) -{ - unsigned i; - for(i = 0; i != 3; ++i) info->unknown_chunks_data[i] = 0; - for(i = 0; i != 3; ++i) info->unknown_chunks_size[i] = 0; -} - -static void LodePNGUnknownChunks_cleanup(LodePNGInfo * info) -{ - unsigned i; - for(i = 0; i != 3; ++i) lodepng_free(info->unknown_chunks_data[i]); -} - -static unsigned LodePNGUnknownChunks_copy(LodePNGInfo * dest, const LodePNGInfo * src) -{ - unsigned i; - - LodePNGUnknownChunks_cleanup(dest); - - for(i = 0; i != 3; ++i) { - size_t j; - dest->unknown_chunks_size[i] = src->unknown_chunks_size[i]; - dest->unknown_chunks_data[i] = (unsigned char *)lodepng_malloc(src->unknown_chunks_size[i]); - if(!dest->unknown_chunks_data[i] && dest->unknown_chunks_size[i]) return 83; /*alloc fail*/ - for(j = 0; j < src->unknown_chunks_size[i]; ++j) { - dest->unknown_chunks_data[i][j] = src->unknown_chunks_data[i][j]; - } - } - - return 0; -} - -/******************************************************************************/ - -static void LodePNGText_init(LodePNGInfo * info) -{ - info->text_num = 0; - info->text_keys = NULL; - info->text_strings = NULL; -} - -static void LodePNGText_cleanup(LodePNGInfo * info) -{ - size_t i; - for(i = 0; i != info->text_num; ++i) { - string_cleanup(&info->text_keys[i]); - string_cleanup(&info->text_strings[i]); - } - lodepng_free(info->text_keys); - lodepng_free(info->text_strings); -} - -static unsigned LodePNGText_copy(LodePNGInfo * dest, const LodePNGInfo * source) -{ - size_t i = 0; - dest->text_keys = NULL; - dest->text_strings = NULL; - dest->text_num = 0; - for(i = 0; i != source->text_num; ++i) { - CERROR_TRY_RETURN(lodepng_add_text(dest, source->text_keys[i], source->text_strings[i])); - } - return 0; -} - -static unsigned lodepng_add_text_sized(LodePNGInfo * info, const char * key, const char * str, size_t size) -{ - char ** new_keys = (char **)(lodepng_realloc(info->text_keys, sizeof(char *) * (info->text_num + 1))); - char ** new_strings = (char **)(lodepng_realloc(info->text_strings, sizeof(char *) * (info->text_num + 1))); - - if(new_keys) info->text_keys = new_keys; - if(new_strings) info->text_strings = new_strings; - - if(!new_keys || !new_strings) return 83; /*alloc fail*/ - - ++info->text_num; - info->text_keys[info->text_num - 1] = alloc_string(key); - info->text_strings[info->text_num - 1] = alloc_string_sized(str, size); - if(!info->text_keys[info->text_num - 1] || !info->text_strings[info->text_num - 1]) return 83; /*alloc fail*/ - - return 0; -} - -unsigned lodepng_add_text(LodePNGInfo * info, const char * key, const char * str) -{ - return lodepng_add_text_sized(info, key, str, lodepng_strlen(str)); -} - -void lodepng_clear_text(LodePNGInfo * info) -{ - LodePNGText_cleanup(info); -} - -/******************************************************************************/ - -static void LodePNGIText_init(LodePNGInfo * info) -{ - info->itext_num = 0; - info->itext_keys = NULL; - info->itext_langtags = NULL; - info->itext_transkeys = NULL; - info->itext_strings = NULL; -} - -static void LodePNGIText_cleanup(LodePNGInfo * info) -{ - size_t i; - for(i = 0; i != info->itext_num; ++i) { - string_cleanup(&info->itext_keys[i]); - string_cleanup(&info->itext_langtags[i]); - string_cleanup(&info->itext_transkeys[i]); - string_cleanup(&info->itext_strings[i]); - } - lodepng_free(info->itext_keys); - lodepng_free(info->itext_langtags); - lodepng_free(info->itext_transkeys); - lodepng_free(info->itext_strings); -} - -static unsigned LodePNGIText_copy(LodePNGInfo * dest, const LodePNGInfo * source) -{ - size_t i = 0; - dest->itext_keys = NULL; - dest->itext_langtags = NULL; - dest->itext_transkeys = NULL; - dest->itext_strings = NULL; - dest->itext_num = 0; - for(i = 0; i != source->itext_num; ++i) { - CERROR_TRY_RETURN(lodepng_add_itext(dest, source->itext_keys[i], source->itext_langtags[i], - source->itext_transkeys[i], source->itext_strings[i])); - } - return 0; -} - -void lodepng_clear_itext(LodePNGInfo * info) -{ - LodePNGIText_cleanup(info); -} - -static unsigned lodepng_add_itext_sized(LodePNGInfo * info, const char * key, const char * langtag, - const char * transkey, const char * str, size_t size) -{ - char ** new_keys = (char **)(lodepng_realloc(info->itext_keys, sizeof(char *) * (info->itext_num + 1))); - char ** new_langtags = (char **)(lodepng_realloc(info->itext_langtags, sizeof(char *) * (info->itext_num + 1))); - char ** new_transkeys = (char **)(lodepng_realloc(info->itext_transkeys, sizeof(char *) * (info->itext_num + 1))); - char ** new_strings = (char **)(lodepng_realloc(info->itext_strings, sizeof(char *) * (info->itext_num + 1))); - - if(new_keys) info->itext_keys = new_keys; - if(new_langtags) info->itext_langtags = new_langtags; - if(new_transkeys) info->itext_transkeys = new_transkeys; - if(new_strings) info->itext_strings = new_strings; - - if(!new_keys || !new_langtags || !new_transkeys || !new_strings) return 83; /*alloc fail*/ - - ++info->itext_num; - - info->itext_keys[info->itext_num - 1] = alloc_string(key); - info->itext_langtags[info->itext_num - 1] = alloc_string(langtag); - info->itext_transkeys[info->itext_num - 1] = alloc_string(transkey); - info->itext_strings[info->itext_num - 1] = alloc_string_sized(str, size); - - return 0; -} - -unsigned lodepng_add_itext(LodePNGInfo * info, const char * key, const char * langtag, - const char * transkey, const char * str) -{ - return lodepng_add_itext_sized(info, key, langtag, transkey, str, lodepng_strlen(str)); -} - -/* same as set but does not delete */ -static unsigned lodepng_assign_icc(LodePNGInfo * info, const char * name, const unsigned char * profile, - unsigned profile_size) -{ - if(profile_size == 0) return 100; /*invalid ICC profile size*/ - - info->iccp_name = alloc_string(name); - info->iccp_profile = (unsigned char *)lodepng_malloc(profile_size); - - if(!info->iccp_name || !info->iccp_profile) return 83; /*alloc fail*/ - - lodepng_memcpy(info->iccp_profile, profile, profile_size); - info->iccp_profile_size = profile_size; - - return 0; /*ok*/ -} - -unsigned lodepng_set_icc(LodePNGInfo * info, const char * name, const unsigned char * profile, unsigned profile_size) -{ - if(info->iccp_name) lodepng_clear_icc(info); - info->iccp_defined = 1; - - return lodepng_assign_icc(info, name, profile, profile_size); -} - -void lodepng_clear_icc(LodePNGInfo * info) -{ - string_cleanup(&info->iccp_name); - lodepng_free(info->iccp_profile); - info->iccp_profile = NULL; - info->iccp_profile_size = 0; - info->iccp_defined = 0; -} -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - -void lodepng_info_init(LodePNGInfo * info) -{ - lodepng_color_mode_init(&info->color); - info->interlace_method = 0; - info->compression_method = 0; - info->filter_method = 0; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - info->background_defined = 0; - info->background_r = info->background_g = info->background_b = 0; - - LodePNGText_init(info); - LodePNGIText_init(info); - - info->time_defined = 0; - info->phys_defined = 0; - - info->gama_defined = 0; - info->chrm_defined = 0; - info->srgb_defined = 0; - info->iccp_defined = 0; - info->iccp_name = NULL; - info->iccp_profile = NULL; - - info->sbit_defined = 0; - info->sbit_r = info->sbit_g = info->sbit_b = info->sbit_a = 0; - - LodePNGUnknownChunks_init(info); -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ -} - -void lodepng_info_cleanup(LodePNGInfo * info) -{ - lodepng_color_mode_cleanup(&info->color); -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - LodePNGText_cleanup(info); - LodePNGIText_cleanup(info); - - lodepng_clear_icc(info); - - LodePNGUnknownChunks_cleanup(info); -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ -} - -unsigned lodepng_info_copy(LodePNGInfo * dest, const LodePNGInfo * source) -{ - lodepng_info_cleanup(dest); - lodepng_memcpy(dest, source, sizeof(LodePNGInfo)); - lodepng_color_mode_init(&dest->color); - CERROR_TRY_RETURN(lodepng_color_mode_copy(&dest->color, &source->color)); - -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - CERROR_TRY_RETURN(LodePNGText_copy(dest, source)); - CERROR_TRY_RETURN(LodePNGIText_copy(dest, source)); - if(source->iccp_defined) { - CERROR_TRY_RETURN(lodepng_assign_icc(dest, source->iccp_name, source->iccp_profile, source->iccp_profile_size)); - } - - LodePNGUnknownChunks_init(dest); - CERROR_TRY_RETURN(LodePNGUnknownChunks_copy(dest, source)); -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - return 0; -} - -/* ////////////////////////////////////////////////////////////////////////// */ - -/*index: bitgroup index, bits: bitgroup size(1, 2 or 4), in: bitgroup value, out: octet array to add bits to*/ -static void addColorBits(unsigned char * out, size_t index, unsigned bits, unsigned in) -{ - unsigned m = bits == 1 ? 7 : bits == 2 ? 3 : 1; /*8 / bits - 1*/ - /*p = the partial index in the byte, e.g. with 4 palettebits it is 0 for first half or 1 for second half*/ - unsigned p = index & m; - in &= (1u << bits) - 1u; /*filter out any other bits of the input value*/ - in = in << (bits * (m - p)); - if(p == 0) out[index * bits / 8u] = in; - else out[index * bits / 8u] |= in; -} - -typedef struct ColorTree ColorTree; - -/* -One node of a color tree -This is the data structure used to count the number of unique colors and to get a palette -index for a color. It's like an octree, but because the alpha channel is used too, each -node has 16 instead of 8 children. -*/ -struct ColorTree { - ColorTree * children[16]; /*up to 16 pointers to ColorTree of next level*/ - int index; /*the payload. Only has a meaningful value if this is in the last level*/ -}; - -static void color_tree_init(ColorTree * tree) -{ - lodepng_memset(tree->children, 0, 16 * sizeof(*tree->children)); - tree->index = -1; -} - -static void color_tree_cleanup(ColorTree * tree) -{ - int i; - for(i = 0; i != 16; ++i) { - if(tree->children[i]) { - color_tree_cleanup(tree->children[i]); - lodepng_free(tree->children[i]); - } - } -} - -/*returns -1 if color not present, its index otherwise*/ -static int color_tree_get(ColorTree * tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a) -{ - int bit = 0; - for(bit = 0; bit < 8; ++bit) { - int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + 1 * ((a >> bit) & 1); - if(!tree->children[i]) return -1; - else tree = tree->children[i]; - } - return tree ? tree->index : -1; -} - -#ifdef LODEPNG_COMPILE_ENCODER -static int color_tree_has(ColorTree * tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a) -{ - return color_tree_get(tree, r, g, b, a) >= 0; -} -#endif /*LODEPNG_COMPILE_ENCODER*/ - -/*color is not allowed to already exist. -Index should be >= 0 (it's signed to be compatible with using -1 for "doesn't exist") -Returns error code, or 0 if ok*/ -static unsigned color_tree_add(ColorTree * tree, - unsigned char r, unsigned char g, unsigned char b, unsigned char a, unsigned index) -{ - int bit; - for(bit = 0; bit < 8; ++bit) { - int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + 1 * ((a >> bit) & 1); - if(!tree->children[i]) { - tree->children[i] = (ColorTree *)lodepng_malloc(sizeof(ColorTree)); - if(!tree->children[i]) return 83; /*alloc fail*/ - color_tree_init(tree->children[i]); - } - tree = tree->children[i]; - } - tree->index = (int)index; - return 0; -} - -/*put a pixel, given its RGBA color, into image of any color type*/ -static unsigned rgba8ToPixel(unsigned char * out, size_t i, - const LodePNGColorMode * mode, ColorTree * tree /*for palette*/, - unsigned char r, unsigned char g, unsigned char b, unsigned char a) -{ - if(mode->colortype == LCT_GREY) { - unsigned char gray = r; /*((unsigned short)r + g + b) / 3u;*/ - if(mode->bitdepth == 8) out[i] = gray; - else if(mode->bitdepth == 16) out[i * 2 + 0] = out[i * 2 + 1] = gray; - else { - /*take the most significant bits of gray*/ - gray = ((unsigned)gray >> (8u - mode->bitdepth)) & ((1u << mode->bitdepth) - 1u); - addColorBits(out, i, mode->bitdepth, gray); - } - } - else if(mode->colortype == LCT_RGB) { - if(mode->bitdepth == 8) { - out[i * 3 + 0] = r; - out[i * 3 + 1] = g; - out[i * 3 + 2] = b; - } - else { - out[i * 6 + 0] = out[i * 6 + 1] = r; - out[i * 6 + 2] = out[i * 6 + 3] = g; - out[i * 6 + 4] = out[i * 6 + 5] = b; - } - } - else if(mode->colortype == LCT_PALETTE) { - int index = color_tree_get(tree, r, g, b, a); - if(index < 0) return 82; /*color not in palette*/ - if(mode->bitdepth == 8) out[i] = index; - else addColorBits(out, i, mode->bitdepth, (unsigned)index); - } - else if(mode->colortype == LCT_GREY_ALPHA) { - unsigned char gray = r; /*((unsigned short)r + g + b) / 3u;*/ - if(mode->bitdepth == 8) { - out[i * 2 + 0] = gray; - out[i * 2 + 1] = a; - } - else if(mode->bitdepth == 16) { - out[i * 4 + 0] = out[i * 4 + 1] = gray; - out[i * 4 + 2] = out[i * 4 + 3] = a; - } - } - else if(mode->colortype == LCT_RGBA) { - if(mode->bitdepth == 8) { - out[i * 4 + 0] = r; - out[i * 4 + 1] = g; - out[i * 4 + 2] = b; - out[i * 4 + 3] = a; - } - else { - out[i * 8 + 0] = out[i * 8 + 1] = r; - out[i * 8 + 2] = out[i * 8 + 3] = g; - out[i * 8 + 4] = out[i * 8 + 5] = b; - out[i * 8 + 6] = out[i * 8 + 7] = a; - } - } - - return 0; /*no error*/ -} - -/*put a pixel, given its RGBA16 color, into image of any color 16-bitdepth type*/ -static void rgba16ToPixel(unsigned char * out, size_t i, - const LodePNGColorMode * mode, - unsigned short r, unsigned short g, unsigned short b, unsigned short a) -{ - if(mode->colortype == LCT_GREY) { - unsigned short gray = r; /*((unsigned)r + g + b) / 3u;*/ - out[i * 2 + 0] = (gray >> 8) & 255; - out[i * 2 + 1] = gray & 255; - } - else if(mode->colortype == LCT_RGB) { - out[i * 6 + 0] = (r >> 8) & 255; - out[i * 6 + 1] = r & 255; - out[i * 6 + 2] = (g >> 8) & 255; - out[i * 6 + 3] = g & 255; - out[i * 6 + 4] = (b >> 8) & 255; - out[i * 6 + 5] = b & 255; - } - else if(mode->colortype == LCT_GREY_ALPHA) { - unsigned short gray = r; /*((unsigned)r + g + b) / 3u;*/ - out[i * 4 + 0] = (gray >> 8) & 255; - out[i * 4 + 1] = gray & 255; - out[i * 4 + 2] = (a >> 8) & 255; - out[i * 4 + 3] = a & 255; - } - else if(mode->colortype == LCT_RGBA) { - out[i * 8 + 0] = (r >> 8) & 255; - out[i * 8 + 1] = r & 255; - out[i * 8 + 2] = (g >> 8) & 255; - out[i * 8 + 3] = g & 255; - out[i * 8 + 4] = (b >> 8) & 255; - out[i * 8 + 5] = b & 255; - out[i * 8 + 6] = (a >> 8) & 255; - out[i * 8 + 7] = a & 255; - } -} - -/*Get RGBA8 color of pixel with index i (y * width + x) from the raw image with given color type.*/ -static void getPixelColorRGBA8(unsigned char * r, unsigned char * g, - unsigned char * b, unsigned char * a, - const unsigned char * in, size_t i, - const LodePNGColorMode * mode) -{ - if(mode->colortype == LCT_GREY) { - if(mode->bitdepth == 8) { - *r = *g = *b = in[i]; - if(mode->key_defined && *r == mode->key_r) *a = 0; - else *a = 255; - } - else if(mode->bitdepth == 16) { - *r = *g = *b = in[i * 2 + 0]; - if(mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r) *a = 0; - else *a = 255; - } - else { - unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ - size_t j = i * mode->bitdepth; - unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); - *r = *g = *b = (value * 255) / highest; - if(mode->key_defined && value == mode->key_r) *a = 0; - else *a = 255; - } - } - else if(mode->colortype == LCT_RGB) { - if(mode->bitdepth == 8) { - *r = in[i * 3 + 0]; - *g = in[i * 3 + 1]; - *b = in[i * 3 + 2]; - if(mode->key_defined && *r == mode->key_r && *g == mode->key_g && *b == mode->key_b) *a = 0; - else *a = 255; - } - else { - *r = in[i * 6 + 0]; - *g = in[i * 6 + 2]; - *b = in[i * 6 + 4]; - if(mode->key_defined && 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r - && 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g - && 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b) *a = 0; - else *a = 255; - } - } - else if(mode->colortype == LCT_PALETTE) { - unsigned index; - if(mode->bitdepth == 8) index = in[i]; - else { - size_t j = i * mode->bitdepth; - index = readBitsFromReversedStream(&j, in, mode->bitdepth); - } - /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ - *r = mode->palette[index * 4 + 0]; - *g = mode->palette[index * 4 + 1]; - *b = mode->palette[index * 4 + 2]; - *a = mode->palette[index * 4 + 3]; - } - else if(mode->colortype == LCT_GREY_ALPHA) { - if(mode->bitdepth == 8) { - *r = *g = *b = in[i * 2 + 0]; - *a = in[i * 2 + 1]; - } - else { - *r = *g = *b = in[i * 4 + 0]; - *a = in[i * 4 + 2]; - } - } - else if(mode->colortype == LCT_RGBA) { - if(mode->bitdepth == 8) { - *r = in[i * 4 + 0]; - *g = in[i * 4 + 1]; - *b = in[i * 4 + 2]; - *a = in[i * 4 + 3]; - } - else { - *r = in[i * 8 + 0]; - *g = in[i * 8 + 2]; - *b = in[i * 8 + 4]; - *a = in[i * 8 + 6]; - } - } -} - -/*Similar to getPixelColorRGBA8, but with all the for loops inside of the color -mode test cases, optimized to convert the colors much faster, when converting -to the common case of RGBA with 8 bit per channel. buffer must be RGBA with -enough memory.*/ -static void getPixelColorsRGBA8(unsigned char * LODEPNG_RESTRICT buffer, size_t numpixels, - const unsigned char * LODEPNG_RESTRICT in, - const LodePNGColorMode * mode) -{ - unsigned num_channels = 4; - size_t i; - if(mode->colortype == LCT_GREY) { - if(mode->bitdepth == 8) { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = buffer[1] = buffer[2] = in[i]; - buffer[3] = 255; - } - if(mode->key_defined) { - buffer -= numpixels * num_channels; - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - if(buffer[0] == mode->key_r) buffer[3] = 0; - } - } - } - else if(mode->bitdepth == 16) { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = buffer[1] = buffer[2] = in[i * 2]; - buffer[3] = mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r ? 0 : 255; - } - } - else { - unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ - size_t j = 0; - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); - buffer[0] = buffer[1] = buffer[2] = (value * 255) / highest; - buffer[3] = mode->key_defined && value == mode->key_r ? 0 : 255; - } - } - } - else if(mode->colortype == LCT_RGB) { - if(mode->bitdepth == 8) { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - lodepng_memcpy(buffer, &in[i * 3], 3); - buffer[3] = 255; - } - if(mode->key_defined) { - buffer -= numpixels * num_channels; - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - if(buffer[0] == mode->key_r && buffer[1] == mode->key_g && buffer[2] == mode->key_b) buffer[3] = 0; - } - } - } - else { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = in[i * 6 + 0]; - buffer[1] = in[i * 6 + 2]; - buffer[2] = in[i * 6 + 4]; - buffer[3] = mode->key_defined - && 256U * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r - && 256U * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g - && 256U * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b ? 0 : 255; - } - } - } - else if(mode->colortype == LCT_PALETTE) { - if(mode->bitdepth == 8) { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - unsigned index = in[i]; - /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ - lodepng_memcpy(buffer, &mode->palette[index * 4], 4); - } - } - else { - size_t j = 0; - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - unsigned index = readBitsFromReversedStream(&j, in, mode->bitdepth); - /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ - lodepng_memcpy(buffer, &mode->palette[index * 4], 4); - } - } - } - else if(mode->colortype == LCT_GREY_ALPHA) { - if(mode->bitdepth == 8) { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = buffer[1] = buffer[2] = in[i * 2 + 0]; - buffer[3] = in[i * 2 + 1]; - } - } - else { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = buffer[1] = buffer[2] = in[i * 4 + 0]; - buffer[3] = in[i * 4 + 2]; - } - } - } - else if(mode->colortype == LCT_RGBA) { - if(mode->bitdepth == 8) { - lodepng_memcpy(buffer, in, numpixels * 4); - } - else { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = in[i * 8 + 0]; - buffer[1] = in[i * 8 + 2]; - buffer[2] = in[i * 8 + 4]; - buffer[3] = in[i * 8 + 6]; - } - } - } -} - -/*Similar to getPixelColorsRGBA8, but with 3-channel RGB output.*/ -static void getPixelColorsRGB8(unsigned char * LODEPNG_RESTRICT buffer, size_t numpixels, - const unsigned char * LODEPNG_RESTRICT in, - const LodePNGColorMode * mode) -{ - const unsigned num_channels = 3; - size_t i; - if(mode->colortype == LCT_GREY) { - if(mode->bitdepth == 8) { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = buffer[1] = buffer[2] = in[i]; - } - } - else if(mode->bitdepth == 16) { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = buffer[1] = buffer[2] = in[i * 2]; - } - } - else { - unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/ - size_t j = 0; - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - unsigned value = readBitsFromReversedStream(&j, in, mode->bitdepth); - buffer[0] = buffer[1] = buffer[2] = (value * 255) / highest; - } - } - } - else if(mode->colortype == LCT_RGB) { - if(mode->bitdepth == 8) { - lodepng_memcpy(buffer, in, numpixels * 3); - } - else { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = in[i * 6 + 0]; - buffer[1] = in[i * 6 + 2]; - buffer[2] = in[i * 6 + 4]; - } - } - } - else if(mode->colortype == LCT_PALETTE) { - if(mode->bitdepth == 8) { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - unsigned index = in[i]; - /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ - lodepng_memcpy(buffer, &mode->palette[index * 4], 3); - } - } - else { - size_t j = 0; - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - unsigned index = readBitsFromReversedStream(&j, in, mode->bitdepth); - /*out of bounds of palette not checked: see lodepng_color_mode_alloc_palette.*/ - lodepng_memcpy(buffer, &mode->palette[index * 4], 3); - } - } - } - else if(mode->colortype == LCT_GREY_ALPHA) { - if(mode->bitdepth == 8) { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = buffer[1] = buffer[2] = in[i * 2 + 0]; - } - } - else { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = buffer[1] = buffer[2] = in[i * 4 + 0]; - } - } - } - else if(mode->colortype == LCT_RGBA) { - if(mode->bitdepth == 8) { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - lodepng_memcpy(buffer, &in[i * 4], 3); - } - } - else { - for(i = 0; i != numpixels; ++i, buffer += num_channels) { - buffer[0] = in[i * 8 + 0]; - buffer[1] = in[i * 8 + 2]; - buffer[2] = in[i * 8 + 4]; - } - } - } -} - -/*Get RGBA16 color of pixel with index i (y * width + x) from the raw image with -given color type, but the given color type must be 16-bit itself.*/ -static void getPixelColorRGBA16(unsigned short * r, unsigned short * g, unsigned short * b, unsigned short * a, - const unsigned char * in, size_t i, const LodePNGColorMode * mode) -{ - if(mode->colortype == LCT_GREY) { - *r = *g = *b = 256 * in[i * 2 + 0] + in[i * 2 + 1]; - if(mode->key_defined && 256U * in[i * 2 + 0] + in[i * 2 + 1] == mode->key_r) *a = 0; - else *a = 65535; - } - else if(mode->colortype == LCT_RGB) { - *r = 256u * in[i * 6 + 0] + in[i * 6 + 1]; - *g = 256u * in[i * 6 + 2] + in[i * 6 + 3]; - *b = 256u * in[i * 6 + 4] + in[i * 6 + 5]; - if(mode->key_defined - && 256u * in[i * 6 + 0] + in[i * 6 + 1] == mode->key_r - && 256u * in[i * 6 + 2] + in[i * 6 + 3] == mode->key_g - && 256u * in[i * 6 + 4] + in[i * 6 + 5] == mode->key_b) *a = 0; - else *a = 65535; - } - else if(mode->colortype == LCT_GREY_ALPHA) { - *r = *g = *b = 256u * in[i * 4 + 0] + in[i * 4 + 1]; - *a = 256u * in[i * 4 + 2] + in[i * 4 + 3]; - } - else if(mode->colortype == LCT_RGBA) { - *r = 256u * in[i * 8 + 0] + in[i * 8 + 1]; - *g = 256u * in[i * 8 + 2] + in[i * 8 + 3]; - *b = 256u * in[i * 8 + 4] + in[i * 8 + 5]; - *a = 256u * in[i * 8 + 6] + in[i * 8 + 7]; - } -} - -unsigned lodepng_convert(unsigned char * out, const unsigned char * in, - const LodePNGColorMode * mode_out, const LodePNGColorMode * mode_in, - unsigned w, unsigned h) -{ - size_t i; - ColorTree tree; - size_t numpixels = (size_t)w * (size_t)h; - unsigned error = 0; - - if(mode_in->colortype == LCT_PALETTE && !mode_in->palette) { - return 107; /* error: must provide palette if input mode is palette */ - } - - if(lodepng_color_mode_equal(mode_out, mode_in)) { - size_t numbytes = lodepng_get_raw_size(w, h, mode_in); - lodepng_memcpy(out, in, numbytes); - return 0; - } - - if(mode_out->colortype == LCT_PALETTE) { - size_t palettesize = mode_out->palettesize; - const unsigned char * palette = mode_out->palette; - size_t palsize = (size_t)1u << mode_out->bitdepth; - /*if the user specified output palette but did not give the values, assume - they want the values of the input color type (assuming that one is palette). - Note that we never create a new palette ourselves.*/ - if(palettesize == 0) { - palettesize = mode_in->palettesize; - palette = mode_in->palette; - /*if the input was also palette with same bitdepth, then the color types are also - equal, so copy literally. This to preserve the exact indices that were in the PNG - even in case there are duplicate colors in the palette.*/ - if(mode_in->colortype == LCT_PALETTE && mode_in->bitdepth == mode_out->bitdepth) { - size_t numbytes = lodepng_get_raw_size(w, h, mode_in); - lodepng_memcpy(out, in, numbytes); - return 0; - } - } - if(palettesize < palsize) palsize = palettesize; - color_tree_init(&tree); - for(i = 0; i != palsize; ++i) { - const unsigned char * p = &palette[i * 4]; - error = color_tree_add(&tree, p[0], p[1], p[2], p[3], (unsigned)i); - if(error) break; - } - } - - if(!error) { - if(mode_in->bitdepth == 16 && mode_out->bitdepth == 16) { - for(i = 0; i != numpixels; ++i) { - unsigned short r = 0, g = 0, b = 0, a = 0; - getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); - rgba16ToPixel(out, i, mode_out, r, g, b, a); - } - } - else if(mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGBA) { - getPixelColorsRGBA8(out, numpixels, in, mode_in); - } - else if(mode_out->bitdepth == 8 && mode_out->colortype == LCT_RGB) { - getPixelColorsRGB8(out, numpixels, in, mode_in); - } - else { - unsigned char r = 0, g = 0, b = 0, a = 0; - for(i = 0; i != numpixels; ++i) { - getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); - error = rgba8ToPixel(out, i, mode_out, &tree, r, g, b, a); - if(error) break; - } - } - } - - if(mode_out->colortype == LCT_PALETTE) { - color_tree_cleanup(&tree); - } - - return error; -} - - -/* Converts a single rgb color without alpha from one type to another, color bits truncated to -their bitdepth. In case of single channel (gray or palette), only the r channel is used. Slow -function, do not use to process all pixels of an image. Alpha channel not supported on purpose: -this is for bKGD, supporting alpha may prevent it from finding a color in the palette, from the -specification it looks like bKGD should ignore the alpha values of the palette since it can use -any palette index but doesn't have an alpha channel. Idem with ignoring color key. */ -static unsigned lodepng_convert_rgb( - unsigned * r_out, unsigned * g_out, unsigned * b_out, - unsigned r_in, unsigned g_in, unsigned b_in, - const LodePNGColorMode * mode_out, const LodePNGColorMode * mode_in) -{ - unsigned r = 0, g = 0, b = 0; - unsigned mul = 65535 / ((1u << mode_in->bitdepth) - 1u); /*65535, 21845, 4369, 257, 1*/ - unsigned shift = 16 - mode_out->bitdepth; - - if(mode_in->colortype == LCT_GREY || mode_in->colortype == LCT_GREY_ALPHA) { - r = g = b = r_in * mul; - } - else if(mode_in->colortype == LCT_RGB || mode_in->colortype == LCT_RGBA) { - r = r_in * mul; - g = g_in * mul; - b = b_in * mul; - } - else if(mode_in->colortype == LCT_PALETTE) { - if(r_in >= mode_in->palettesize) return 82; - r = mode_in->palette[r_in * 4 + 0] * 257u; - g = mode_in->palette[r_in * 4 + 1] * 257u; - b = mode_in->palette[r_in * 4 + 2] * 257u; - } - else { - return 31; - } - - /* now convert to output format */ - if(mode_out->colortype == LCT_GREY || mode_out->colortype == LCT_GREY_ALPHA) { - *r_out = r >> shift ; - } - else if(mode_out->colortype == LCT_RGB || mode_out->colortype == LCT_RGBA) { - *r_out = r >> shift ; - *g_out = g >> shift ; - *b_out = b >> shift ; - } - else if(mode_out->colortype == LCT_PALETTE) { - unsigned i; - /* a 16-bit color cannot be in the palette */ - if((r >> 8) != (r & 255) || (g >> 8) != (g & 255) || (b >> 8) != (b & 255)) return 82; - for(i = 0; i < mode_out->palettesize; i++) { - unsigned j = i * 4; - if((r >> 8) == mode_out->palette[j + 0] && (g >> 8) == mode_out->palette[j + 1] && - (b >> 8) == mode_out->palette[j + 2]) { - *r_out = i; - return 0; - } - } - return 82; - } - else { - return 31; - } - - return 0; -} - -#ifdef LODEPNG_COMPILE_ENCODER - -void lodepng_color_stats_init(LodePNGColorStats * stats) -{ - /*stats*/ - stats->colored = 0; - stats->key = 0; - stats->key_r = stats->key_g = stats->key_b = 0; - stats->alpha = 0; - stats->numcolors = 0; - stats->bits = 1; - stats->numpixels = 0; - /*settings*/ - stats->allow_palette = 1; - stats->allow_greyscale = 1; -} - -/*function used for debug purposes with C++*/ -/*void printColorStats(LodePNGColorStats* p) { - std::cout << "colored: " << (int)p->colored << ", "; - std::cout << "key: " << (int)p->key << ", "; - std::cout << "key_r: " << (int)p->key_r << ", "; - std::cout << "key_g: " << (int)p->key_g << ", "; - std::cout << "key_b: " << (int)p->key_b << ", "; - std::cout << "alpha: " << (int)p->alpha << ", "; - std::cout << "numcolors: " << (int)p->numcolors << ", "; - std::cout << "bits: " << (int)p->bits << std::endl; -}*/ - -/*Returns how many bits needed to represent given value (max 8 bit)*/ -static unsigned getValueRequiredBits(unsigned char value) -{ - if(value == 0 || value == 255) return 1; - /*The scaling of 2-bit and 4-bit values uses multiples of 85 and 17*/ - if(value % 17 == 0) return value % 85 == 0 ? 2 : 4; - return 8; -} - -/*stats must already have been inited. */ -unsigned lodepng_compute_color_stats(LodePNGColorStats * stats, - const unsigned char * in, unsigned w, unsigned h, - const LodePNGColorMode * mode_in) -{ - size_t i; - ColorTree tree; - size_t numpixels = (size_t)w * (size_t)h; - unsigned error = 0; - - /* mark things as done already if it would be impossible to have a more expensive case */ - unsigned colored_done = lodepng_is_greyscale_type(mode_in) ? 1 : 0; - unsigned alpha_done = lodepng_can_have_alpha(mode_in) ? 0 : 1; - unsigned numcolors_done = 0; - unsigned bpp = lodepng_get_bpp(mode_in); - unsigned bits_done = (stats->bits == 1 && bpp == 1) ? 1 : 0; - unsigned sixteen = 0; /* whether the input image is 16 bit */ - unsigned maxnumcolors = 257; - if(bpp <= 8) maxnumcolors = LODEPNG_MIN(257, stats->numcolors + (1u << bpp)); - - stats->numpixels += numpixels; - - /*if palette not allowed, no need to compute numcolors*/ - if(!stats->allow_palette) numcolors_done = 1; - - color_tree_init(&tree); - - /*If the stats was already filled in from previous data, fill its palette in tree - and mark things as done already if we know they are the most expensive case already*/ - if(stats->alpha) alpha_done = 1; - if(stats->colored) colored_done = 1; - if(stats->bits == 16) numcolors_done = 1; - if(stats->bits >= bpp) bits_done = 1; - if(stats->numcolors >= maxnumcolors) numcolors_done = 1; - - if(!numcolors_done) { - for(i = 0; i < stats->numcolors; i++) { - const unsigned char * color = &stats->palette[i * 4]; - error = color_tree_add(&tree, color[0], color[1], color[2], color[3], (unsigned)i); - if(error) goto cleanup; - } - } - - /*Check if the 16-bit input is truly 16-bit*/ - if(mode_in->bitdepth == 16 && !sixteen) { - unsigned short r = 0, g = 0, b = 0, a = 0; - for(i = 0; i != numpixels; ++i) { - getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); - if((r & 255) != ((r >> 8) & 255) || (g & 255) != ((g >> 8) & 255) || - (b & 255) != ((b >> 8) & 255) || (a & 255) != ((a >> 8) & 255)) { /*first and second byte differ*/ - stats->bits = 16; - sixteen = 1; - bits_done = 1; - numcolors_done = 1; /*counting colors no longer useful, palette doesn't support 16-bit*/ - break; - } - } - } - - if(sixteen) { - unsigned short r = 0, g = 0, b = 0, a = 0; - - for(i = 0; i != numpixels; ++i) { - getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); - - if(!colored_done && (r != g || r != b)) { - stats->colored = 1; - colored_done = 1; - } - - if(!alpha_done) { - unsigned matchkey = (r == stats->key_r && g == stats->key_g && b == stats->key_b); - if(a != 65535 && (a != 0 || (stats->key && !matchkey))) { - stats->alpha = 1; - stats->key = 0; - alpha_done = 1; - } - else if(a == 0 && !stats->alpha && !stats->key) { - stats->key = 1; - stats->key_r = r; - stats->key_g = g; - stats->key_b = b; - } - else if(a == 65535 && stats->key && matchkey) { - /* Color key cannot be used if an opaque pixel also has that RGB color. */ - stats->alpha = 1; - stats->key = 0; - alpha_done = 1; - } - } - if(alpha_done && numcolors_done && colored_done && bits_done) break; - } - - if(stats->key && !stats->alpha) { - for(i = 0; i != numpixels; ++i) { - getPixelColorRGBA16(&r, &g, &b, &a, in, i, mode_in); - if(a != 0 && r == stats->key_r && g == stats->key_g && b == stats->key_b) { - /* Color key cannot be used if an opaque pixel also has that RGB color. */ - stats->alpha = 1; - stats->key = 0; - alpha_done = 1; - } - } - } - } - else { /* < 16-bit */ - unsigned char r = 0, g = 0, b = 0, a = 0; - for(i = 0; i != numpixels; ++i) { - getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); - - if(!bits_done && stats->bits < 8) { - /*only r is checked, < 8 bits is only relevant for grayscale*/ - unsigned bits = getValueRequiredBits(r); - if(bits > stats->bits) stats->bits = bits; - } - bits_done = (stats->bits >= bpp); - - if(!colored_done && (r != g || r != b)) { - stats->colored = 1; - colored_done = 1; - if(stats->bits < 8) stats->bits = 8; /*PNG has no colored modes with less than 8-bit per channel*/ - } - - if(!alpha_done) { - unsigned matchkey = (r == stats->key_r && g == stats->key_g && b == stats->key_b); - if(a != 255 && (a != 0 || (stats->key && !matchkey))) { - stats->alpha = 1; - stats->key = 0; - alpha_done = 1; - if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ - } - else if(a == 0 && !stats->alpha && !stats->key) { - stats->key = 1; - stats->key_r = r; - stats->key_g = g; - stats->key_b = b; - } - else if(a == 255 && stats->key && matchkey) { - /* Color key cannot be used if an opaque pixel also has that RGB color. */ - stats->alpha = 1; - stats->key = 0; - alpha_done = 1; - if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ - } - } - - if(!numcolors_done) { - if(!color_tree_has(&tree, r, g, b, a)) { - error = color_tree_add(&tree, r, g, b, a, stats->numcolors); - if(error) goto cleanup; - if(stats->numcolors < 256) { - unsigned char * p = stats->palette; - unsigned n = stats->numcolors; - p[n * 4 + 0] = r; - p[n * 4 + 1] = g; - p[n * 4 + 2] = b; - p[n * 4 + 3] = a; - } - ++stats->numcolors; - numcolors_done = stats->numcolors >= maxnumcolors; - } - } - - if(alpha_done && numcolors_done && colored_done && bits_done) break; - } - - if(stats->key && !stats->alpha) { - for(i = 0; i != numpixels; ++i) { - getPixelColorRGBA8(&r, &g, &b, &a, in, i, mode_in); - if(a != 0 && r == stats->key_r && g == stats->key_g && b == stats->key_b) { - /* Color key cannot be used if an opaque pixel also has that RGB color. */ - stats->alpha = 1; - stats->key = 0; - alpha_done = 1; - if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ - } - } - } - - /*make the stats's key always 16-bit for consistency - repeat each byte twice*/ - stats->key_r += (stats->key_r << 8); - stats->key_g += (stats->key_g << 8); - stats->key_b += (stats->key_b << 8); - } - -cleanup: - color_tree_cleanup(&tree); - return error; -} - -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS -/*Adds a single color to the color stats. The stats must already have been inited. The color must be given as 16-bit -(with 2 bytes repeating for 8-bit and 65535 for opaque alpha channel). This function is expensive, do not call it for -all pixels of an image but only for a few additional values. */ -static unsigned lodepng_color_stats_add(LodePNGColorStats * stats, - unsigned r, unsigned g, unsigned b, unsigned a) -{ - unsigned error = 0; - unsigned char image[8]; - LodePNGColorMode mode; - lodepng_color_mode_init(&mode); - image[0] = r >> 8; - image[1] = r; - image[2] = g >> 8; - image[3] = g; - image[4] = b >> 8; - image[5] = b; - image[6] = a >> 8; - image[7] = a; - mode.bitdepth = 16; - mode.colortype = LCT_RGBA; - error = lodepng_compute_color_stats(stats, image, 1, 1, &mode); - lodepng_color_mode_cleanup(&mode); - return error; -} -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - -/*Computes a minimal PNG color model that can contain all colors as indicated by the stats. -The stats should be computed with lodepng_compute_color_stats. -mode_in is raw color profile of the image the stats were computed on, to copy palette order from when relevant. -Minimal PNG color model means the color type and bit depth that gives smallest amount of bits in the output image, -e.g. gray if only grayscale pixels, palette if less than 256 colors, color key if only single transparent color, ... -This is used if auto_convert is enabled (it is by default). -*/ -static unsigned auto_choose_color(LodePNGColorMode * mode_out, - const LodePNGColorMode * mode_in, - const LodePNGColorStats * stats) -{ - unsigned error = 0; - unsigned palettebits; - size_t i, n; - size_t numpixels = stats->numpixels; - unsigned palette_ok, gray_ok; - - unsigned alpha = stats->alpha; - unsigned key = stats->key; - unsigned bits = stats->bits; - - mode_out->key_defined = 0; - - if(key && numpixels <= 16) { - alpha = 1; /*too few pixels to justify tRNS chunk overhead*/ - key = 0; - if(bits < 8) bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ - } - - gray_ok = !stats->colored; - if(!stats->allow_greyscale) gray_ok = 0; - if(!gray_ok && bits < 8) bits = 8; - - n = stats->numcolors; - palettebits = n <= 2 ? 1 : (n <= 4 ? 2 : (n <= 16 ? 4 : 8)); - palette_ok = n <= 256 && bits <= 8 && n != 0; /*n==0 means likely numcolors wasn't computed*/ - if(numpixels < n * 2) palette_ok = 0; /*don't add palette overhead if image has only a few pixels*/ - if(gray_ok && !alpha && bits <= palettebits) palette_ok = 0; /*gray is less overhead*/ - if(!stats->allow_palette) palette_ok = 0; - - if(palette_ok) { - const unsigned char * p = stats->palette; - lodepng_palette_clear(mode_out); /*remove potential earlier palette*/ - for(i = 0; i != stats->numcolors; ++i) { - error = lodepng_palette_add(mode_out, p[i * 4 + 0], p[i * 4 + 1], p[i * 4 + 2], p[i * 4 + 3]); - if(error) break; - } - - mode_out->colortype = LCT_PALETTE; - mode_out->bitdepth = palettebits; - - if(mode_in->colortype == LCT_PALETTE && mode_in->palettesize >= mode_out->palettesize - && mode_in->bitdepth == mode_out->bitdepth) { - /*If input should have same palette colors, keep original to preserve its order and prevent conversion*/ - lodepng_color_mode_cleanup(mode_out); /*clears palette, keeps the above set colortype and bitdepth fields as-is*/ - lodepng_color_mode_copy(mode_out, mode_in); - } - } - else { /*8-bit or 16-bit per channel*/ - mode_out->bitdepth = bits; - mode_out->colortype = alpha ? (gray_ok ? LCT_GREY_ALPHA : LCT_RGBA) - : (gray_ok ? LCT_GREY : LCT_RGB); - if(key) { - unsigned mask = (1u << mode_out->bitdepth) - 1u; /*stats always uses 16-bit, mask converts it*/ - mode_out->key_r = stats->key_r & mask; - mode_out->key_g = stats->key_g & mask; - mode_out->key_b = stats->key_b & mask; - mode_out->key_defined = 1; - } - } - - return error; -} - -#endif /* #ifdef LODEPNG_COMPILE_ENCODER */ - -/*Paeth predictor, used by PNG filter type 4*/ -static unsigned char paethPredictor(unsigned char a, unsigned char b, unsigned char c) -{ - /* the subtractions of unsigned char cast it to a signed type. - With gcc, short is faster than int, with clang int is as fast (as of april 2023)*/ - short pa = (b - c) < 0 ? -(b - c) : (b - c); - short pb = (a - c) < 0 ? -(a - c) : (a - c); - /* writing it out like this compiles to something faster than introducing a temp variable*/ - short pc = (a + b - c - c) < 0 ? -(a + b - c - c) : (a + b - c - c); - /* return input value associated with smallest of pa, pb, pc (with certain priority if equal) */ - if(pb < pa) { - a = b; - pa = pb; - } - return (pc < pa) ? c : a; -} - -/*shared values used by multiple Adam7 related functions*/ - -static const unsigned ADAM7_IX[7] = { 0, 4, 0, 2, 0, 1, 0 }; /*x start values*/ -static const unsigned ADAM7_IY[7] = { 0, 0, 4, 0, 2, 0, 1 }; /*y start values*/ -static const unsigned ADAM7_DX[7] = { 8, 8, 4, 4, 2, 2, 1 }; /*x delta values*/ -static const unsigned ADAM7_DY[7] = { 8, 8, 8, 4, 4, 2, 2 }; /*y delta values*/ - -/* -Outputs various dimensions and positions in the image related to the Adam7 reduced images. -passw: output containing the width of the 7 passes -passh: output containing the height of the 7 passes -filter_passstart: output containing the index of the start and end of each - reduced image with filter bytes -padded_passstart output containing the index of the start and end of each - reduced image when without filter bytes but with padded scanlines -passstart: output containing the index of the start and end of each reduced - image without padding between scanlines, but still padding between the images -w, h: width and height of non-interlaced image -bpp: bits per pixel -"padded" is only relevant if bpp is less than 8 and a scanline or image does not - end at a full byte -*/ -static void Adam7_getpassvalues(unsigned passw[7], unsigned passh[7], size_t filter_passstart[8], - size_t padded_passstart[8], size_t passstart[8], unsigned w, unsigned h, unsigned bpp) -{ - /*the passstart values have 8 values: the 8th one indicates the byte after the end of the 7th (= last) pass*/ - unsigned i; - - /*calculate width and height in pixels of each pass*/ - for(i = 0; i != 7; ++i) { - passw[i] = (w + ADAM7_DX[i] - ADAM7_IX[i] - 1) / ADAM7_DX[i]; - passh[i] = (h + ADAM7_DY[i] - ADAM7_IY[i] - 1) / ADAM7_DY[i]; - if(passw[i] == 0) passh[i] = 0; - if(passh[i] == 0) passw[i] = 0; - } - - filter_passstart[0] = padded_passstart[0] = passstart[0] = 0; - for(i = 0; i != 7; ++i) { - /*if passw[i] is 0, it's 0 bytes, not 1 (no filtertype-byte)*/ - filter_passstart[i + 1] = filter_passstart[i] - + ((passw[i] && passh[i]) ? passh[i] * (1u + (passw[i] * bpp + 7u) / 8u) : 0); - /*bits padded if needed to fill full byte at end of each scanline*/ - padded_passstart[i + 1] = padded_passstart[i] + passh[i] * ((passw[i] * bpp + 7u) / 8u); - /*only padded at end of reduced image*/ - passstart[i + 1] = passstart[i] + (passh[i] * passw[i] * bpp + 7u) / 8u; - } -} - -#ifdef LODEPNG_COMPILE_DECODER - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / PNG Decoder / */ -/* ////////////////////////////////////////////////////////////////////////// */ - -/*read the information from the header and store it in the LodePNGInfo. return value is error*/ -unsigned lodepng_inspect(unsigned * w, unsigned * h, LodePNGState * state, - const unsigned char * in, size_t insize) -{ - unsigned width, height; - LodePNGInfo * info = &state->info_png; - if(insize == 0 || in == 0) { - CERROR_RETURN_ERROR(state->error, 48); /*error: the given data is empty*/ - } - if(insize < 33) { - CERROR_RETURN_ERROR(state->error, 27); /*error: the data length is smaller than the length of a PNG header*/ - } - - /*when decoding a new PNG image, make sure all parameters created after previous decoding are reset*/ - /* TODO: remove this. One should use a new LodePNGState for new sessions */ - lodepng_info_cleanup(info); - lodepng_info_init(info); - - if(in[0] != 137 || in[1] != 80 || in[2] != 78 || in[3] != 71 - || in[4] != 13 || in[5] != 10 || in[6] != 26 || in[7] != 10) { - CERROR_RETURN_ERROR(state->error, 28); /*error: the first 8 bytes are not the correct PNG signature*/ - } - if(lodepng_chunk_length(in + 8) != 13) { - CERROR_RETURN_ERROR(state->error, 94); /*error: header size must be 13 bytes*/ - } - if(!lodepng_chunk_type_equals(in + 8, "IHDR")) { - CERROR_RETURN_ERROR(state->error, 29); /*error: it doesn't start with a IHDR chunk!*/ - } - - /*read the values given in the header*/ - width = lodepng_read32bitInt(&in[16]); - height = lodepng_read32bitInt(&in[20]); - /*TODO: remove the undocumented feature that allows to give null pointers to width or height*/ - if(w) *w = width; - if(h) *h = height; - info->color.bitdepth = in[24]; - info->color.colortype = (LodePNGColorType)in[25]; - info->compression_method = in[26]; - info->filter_method = in[27]; - info->interlace_method = in[28]; - - /*errors returned only after the parsing so other values are still output*/ - - /*error: invalid image size*/ - if(width == 0 || height == 0) CERROR_RETURN_ERROR(state->error, 93); - /*error: invalid colortype or bitdepth combination*/ - state->error = checkColorValidity(info->color.colortype, info->color.bitdepth); - if(state->error) return state->error; - /*error: only compression method 0 is allowed in the specification*/ - if(info->compression_method != 0) CERROR_RETURN_ERROR(state->error, 32); - /*error: only filter method 0 is allowed in the specification*/ - if(info->filter_method != 0) CERROR_RETURN_ERROR(state->error, 33); - /*error: only interlace methods 0 and 1 exist in the specification*/ - if(info->interlace_method > 1) CERROR_RETURN_ERROR(state->error, 34); - - if(!state->decoder.ignore_crc) { - unsigned CRC = lodepng_read32bitInt(&in[29]); - unsigned checksum = lodepng_crc32(&in[12], 17); - if(CRC != checksum) { - CERROR_RETURN_ERROR(state->error, 57); /*invalid CRC*/ - } - } - - return state->error; -} - -static unsigned unfilterScanline(unsigned char * recon, const unsigned char * scanline, const unsigned char * precon, - size_t bytewidth, unsigned char filterType, size_t length) -{ - /* - For PNG filter method 0 - unfilter a PNG image scanline by scanline. when the pixels are smaller than 1 byte, - the filter works byte per byte (bytewidth = 1) - precon is the previous unfiltered scanline, recon the result, scanline the current one - the incoming scanlines do NOT include the filtertype byte, that one is given in the parameter filterType instead - recon and scanline MAY be the same memory address! precon must be disjoint. - */ - - size_t i; - switch(filterType) { - case 0: - for(i = 0; i != length; ++i) recon[i] = scanline[i]; - break; - case 1: { - size_t j = 0; - for(i = 0; i != bytewidth; ++i) recon[i] = scanline[i]; - for(i = bytewidth; i != length; ++i, ++j) recon[i] = scanline[i] + recon[j]; - break; - } - case 2: - if(precon) { - for(i = 0; i != length; ++i) recon[i] = scanline[i] + precon[i]; - } - else { - for(i = 0; i != length; ++i) recon[i] = scanline[i]; - } - break; - case 3: - if(precon) { - size_t j = 0; - for(i = 0; i != bytewidth; ++i) recon[i] = scanline[i] + (precon[i] >> 1u); - /* Unroll independent paths of this predictor. A 6x and 8x version is also possible but that adds - too much code. Whether this speeds up anything depends on compiler and settings. */ - if(bytewidth >= 4) { - for(; i + 3 < length; i += 4, j += 4) { - unsigned char s0 = scanline[i + 0], s1 = scanline[i + 1], s2 = scanline[i + 2], s3 = scanline[i + 3]; - unsigned char r0 = recon[j + 0], r1 = recon[j + 1], r2 = recon[j + 2], r3 = recon[j + 3]; - unsigned char p0 = precon[i + 0], p1 = precon[i + 1], p2 = precon[i + 2], p3 = precon[i + 3]; - recon[i + 0] = s0 + ((r0 + p0) >> 1u); - recon[i + 1] = s1 + ((r1 + p1) >> 1u); - recon[i + 2] = s2 + ((r2 + p2) >> 1u); - recon[i + 3] = s3 + ((r3 + p3) >> 1u); - } - } - else if(bytewidth >= 3) { - for(; i + 2 < length; i += 3, j += 3) { - unsigned char s0 = scanline[i + 0], s1 = scanline[i + 1], s2 = scanline[i + 2]; - unsigned char r0 = recon[j + 0], r1 = recon[j + 1], r2 = recon[j + 2]; - unsigned char p0 = precon[i + 0], p1 = precon[i + 1], p2 = precon[i + 2]; - recon[i + 0] = s0 + ((r0 + p0) >> 1u); - recon[i + 1] = s1 + ((r1 + p1) >> 1u); - recon[i + 2] = s2 + ((r2 + p2) >> 1u); - } - } - else if(bytewidth >= 2) { - for(; i + 1 < length; i += 2, j += 2) { - unsigned char s0 = scanline[i + 0], s1 = scanline[i + 1]; - unsigned char r0 = recon[j + 0], r1 = recon[j + 1]; - unsigned char p0 = precon[i + 0], p1 = precon[i + 1]; - recon[i + 0] = s0 + ((r0 + p0) >> 1u); - recon[i + 1] = s1 + ((r1 + p1) >> 1u); - } - } - for(; i != length; ++i, ++j) recon[i] = scanline[i] + ((recon[j] + precon[i]) >> 1u); - } - else { - size_t j = 0; - for(i = 0; i != bytewidth; ++i) recon[i] = scanline[i]; - for(i = bytewidth; i != length; ++i, ++j) recon[i] = scanline[i] + (recon[j] >> 1u); - } - break; - case 4: - if(precon) { - /* Unroll independent paths of this predictor. Whether this speeds up - anything depends on compiler and settings. */ - if(bytewidth == 8) { - unsigned char a0, b0 = 0, c0, d0 = 0, a1, b1 = 0, c1, d1 = 0; - unsigned char a2, b2 = 0, c2, d2 = 0, a3, b3 = 0, c3, d3 = 0; - unsigned char a4, b4 = 0, c4, d4 = 0, a5, b5 = 0, c5, d5 = 0; - unsigned char a6, b6 = 0, c6, d6 = 0, a7, b7 = 0, c7, d7 = 0; - for(i = 0; i + 7 < length; i += 8) { - c0 = b0; - c1 = b1; - c2 = b2; - c3 = b3; - c4 = b4; - c5 = b5; - c6 = b6; - c7 = b7; - b0 = precon[i + 0]; - b1 = precon[i + 1]; - b2 = precon[i + 2]; - b3 = precon[i + 3]; - b4 = precon[i + 4]; - b5 = precon[i + 5]; - b6 = precon[i + 6]; - b7 = precon[i + 7]; - a0 = d0; - a1 = d1; - a2 = d2; - a3 = d3; - a4 = d4; - a5 = d5; - a6 = d6; - a7 = d7; - d0 = scanline[i + 0] + paethPredictor(a0, b0, c0); - d1 = scanline[i + 1] + paethPredictor(a1, b1, c1); - d2 = scanline[i + 2] + paethPredictor(a2, b2, c2); - d3 = scanline[i + 3] + paethPredictor(a3, b3, c3); - d4 = scanline[i + 4] + paethPredictor(a4, b4, c4); - d5 = scanline[i + 5] + paethPredictor(a5, b5, c5); - d6 = scanline[i + 6] + paethPredictor(a6, b6, c6); - d7 = scanline[i + 7] + paethPredictor(a7, b7, c7); - recon[i + 0] = d0; - recon[i + 1] = d1; - recon[i + 2] = d2; - recon[i + 3] = d3; - recon[i + 4] = d4; - recon[i + 5] = d5; - recon[i + 6] = d6; - recon[i + 7] = d7; - } - } - else if(bytewidth == 6) { - unsigned char a0, b0 = 0, c0, d0 = 0, a1, b1 = 0, c1, d1 = 0; - unsigned char a2, b2 = 0, c2, d2 = 0, a3, b3 = 0, c3, d3 = 0; - unsigned char a4, b4 = 0, c4, d4 = 0, a5, b5 = 0, c5, d5 = 0; - for(i = 0; i + 5 < length; i += 6) { - c0 = b0; - c1 = b1; - c2 = b2; - c3 = b3; - c4 = b4; - c5 = b5; - b0 = precon[i + 0]; - b1 = precon[i + 1]; - b2 = precon[i + 2]; - b3 = precon[i + 3]; - b4 = precon[i + 4]; - b5 = precon[i + 5]; - a0 = d0; - a1 = d1; - a2 = d2; - a3 = d3; - a4 = d4; - a5 = d5; - d0 = scanline[i + 0] + paethPredictor(a0, b0, c0); - d1 = scanline[i + 1] + paethPredictor(a1, b1, c1); - d2 = scanline[i + 2] + paethPredictor(a2, b2, c2); - d3 = scanline[i + 3] + paethPredictor(a3, b3, c3); - d4 = scanline[i + 4] + paethPredictor(a4, b4, c4); - d5 = scanline[i + 5] + paethPredictor(a5, b5, c5); - recon[i + 0] = d0; - recon[i + 1] = d1; - recon[i + 2] = d2; - recon[i + 3] = d3; - recon[i + 4] = d4; - recon[i + 5] = d5; - } - } - else if(bytewidth == 4) { - unsigned char a0, b0 = 0, c0, d0 = 0, a1, b1 = 0, c1, d1 = 0; - unsigned char a2, b2 = 0, c2, d2 = 0, a3, b3 = 0, c3, d3 = 0; - for(i = 0; i + 3 < length; i += 4) { - c0 = b0; - c1 = b1; - c2 = b2; - c3 = b3; - b0 = precon[i + 0]; - b1 = precon[i + 1]; - b2 = precon[i + 2]; - b3 = precon[i + 3]; - a0 = d0; - a1 = d1; - a2 = d2; - a3 = d3; - d0 = scanline[i + 0] + paethPredictor(a0, b0, c0); - d1 = scanline[i + 1] + paethPredictor(a1, b1, c1); - d2 = scanline[i + 2] + paethPredictor(a2, b2, c2); - d3 = scanline[i + 3] + paethPredictor(a3, b3, c3); - recon[i + 0] = d0; - recon[i + 1] = d1; - recon[i + 2] = d2; - recon[i + 3] = d3; - } - } - else if(bytewidth == 3) { - unsigned char a0, b0 = 0, c0, d0 = 0; - unsigned char a1, b1 = 0, c1, d1 = 0; - unsigned char a2, b2 = 0, c2, d2 = 0; - for(i = 0; i + 2 < length; i += 3) { - c0 = b0; - c1 = b1; - c2 = b2; - b0 = precon[i + 0]; - b1 = precon[i + 1]; - b2 = precon[i + 2]; - a0 = d0; - a1 = d1; - a2 = d2; - d0 = scanline[i + 0] + paethPredictor(a0, b0, c0); - d1 = scanline[i + 1] + paethPredictor(a1, b1, c1); - d2 = scanline[i + 2] + paethPredictor(a2, b2, c2); - recon[i + 0] = d0; - recon[i + 1] = d1; - recon[i + 2] = d2; - } - } - else if(bytewidth == 2) { - unsigned char a0, b0 = 0, c0, d0 = 0; - unsigned char a1, b1 = 0, c1, d1 = 0; - for(i = 0; i + 1 < length; i += 2) { - c0 = b0; - c1 = b1; - b0 = precon[i + 0]; - b1 = precon[i + 1]; - a0 = d0; - a1 = d1; - d0 = scanline[i + 0] + paethPredictor(a0, b0, c0); - d1 = scanline[i + 1] + paethPredictor(a1, b1, c1); - recon[i + 0] = d0; - recon[i + 1] = d1; - } - } - else if(bytewidth == 1) { - unsigned char a, b = 0, c, d = 0; - for(i = 0; i != length; ++i) { - c = b; - b = precon[i]; - a = d; - d = scanline[i] + paethPredictor(a, b, c); - recon[i] = d; - } - } - else { - /* Normally not a possible case, but this would handle it correctly */ - for(i = 0; i != bytewidth; ++i) { - recon[i] = (scanline[i] + precon[i]); /*paethPredictor(0, precon[i], 0) is always precon[i]*/ - } - } - /* finish any remaining bytes */ - for(; i != length; ++i) { - recon[i] = (scanline[i] + paethPredictor(recon[i - bytewidth], precon[i], precon[i - bytewidth])); - } - } - else { - size_t j = 0; - for(i = 0; i != bytewidth; ++i) { - recon[i] = scanline[i]; - } - for(i = bytewidth; i != length; ++i, ++j) { - /*paethPredictor(recon[i - bytewidth], 0, 0) is always recon[i - bytewidth]*/ - recon[i] = (scanline[i] + recon[j]); - } - } - break; - default: - return 36; /*error: invalid filter type given*/ - } - return 0; -} - -static unsigned unfilter(unsigned char * out, const unsigned char * in, unsigned w, unsigned h, unsigned bpp) -{ - /* - For PNG filter method 0 - this function unfilters a single image (e.g. without interlacing this is called once, with Adam7 seven times) - out must have enough bytes allocated already, in must have the scanlines + 1 filtertype byte per scanline - w and h are image dimensions or dimensions of reduced image, bpp is bits per pixel - in and out are allowed to be the same memory address (but aren't the same size since in has the extra filter bytes) - */ - - unsigned y; - unsigned char * prevline = 0; - - /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/ - size_t bytewidth = (bpp + 7u) / 8u; - /*the width of a scanline in bytes, not including the filter type*/ - size_t linebytes = lodepng_get_raw_size_idat(w, 1, bpp) - 1u; - - for(y = 0; y < h; ++y) { - size_t outindex = linebytes * y; - size_t inindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ - unsigned char filterType = in[inindex]; - - CERROR_TRY_RETURN(unfilterScanline(&out[outindex], &in[inindex + 1], prevline, bytewidth, filterType, linebytes)); - - prevline = &out[outindex]; - } - - return 0; -} - -/* -in: Adam7 interlaced image, with no padding bits between scanlines, but between - reduced images so that each reduced image starts at a byte. -out: the same pixels, but re-ordered so that they're now a non-interlaced image with size w*h -bpp: bits per pixel -out has the following size in bits: w * h * bpp. -in is possibly bigger due to padding bits between reduced images. -out must be big enough AND must be 0 everywhere if bpp < 8 in the current implementation -(because that's likely a little bit faster) -NOTE: comments about padding bits are only relevant if bpp < 8 -*/ -static void Adam7_deinterlace(unsigned char * out, const unsigned char * in, unsigned w, unsigned h, unsigned bpp) -{ - unsigned passw[7], passh[7]; - size_t filter_passstart[8], padded_passstart[8], passstart[8]; - unsigned i; - - Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); - - if(bpp >= 8) { - for(i = 0; i != 7; ++i) { - unsigned x, y, b; - size_t bytewidth = bpp / 8u; - for(y = 0; y < passh[i]; ++y) - for(x = 0; x < passw[i]; ++x) { - size_t pixelinstart = passstart[i] + (y * passw[i] + x) * bytewidth; - size_t pixeloutstart = ((ADAM7_IY[i] + (size_t)y * ADAM7_DY[i]) * (size_t)w - + ADAM7_IX[i] + (size_t)x * ADAM7_DX[i]) * bytewidth; - for(b = 0; b < bytewidth; ++b) { - out[pixeloutstart + b] = in[pixelinstart + b]; - } - } - } - } - else { /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/ - for(i = 0; i != 7; ++i) { - unsigned x, y, b; - unsigned ilinebits = bpp * passw[i]; - unsigned olinebits = bpp * w; - size_t obp, ibp; /*bit pointers (for out and in buffer)*/ - for(y = 0; y < passh[i]; ++y) - for(x = 0; x < passw[i]; ++x) { - ibp = (8 * passstart[i]) + (y * ilinebits + x * bpp); - obp = (ADAM7_IY[i] + (size_t)y * ADAM7_DY[i]) * olinebits + (ADAM7_IX[i] + (size_t)x * ADAM7_DX[i]) * bpp; - for(b = 0; b < bpp; ++b) { - unsigned char bit = readBitFromReversedStream(&ibp, in); - setBitOfReversedStream(&obp, out, bit); - } - } - } - } -} - -static void removePaddingBits(unsigned char * out, const unsigned char * in, - size_t olinebits, size_t ilinebits, unsigned h) -{ - /* - After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts. They need - to be removed (except at last scanline of (Adam7-reduced) image) before working with pure image buffers - for the Adam7 code, the color convert code and the output to the user. - in and out are allowed to be the same buffer, in may also be higher but still overlapping; in must - have >= ilinebits*h bits, out must have >= olinebits*h bits, olinebits must be <= ilinebits - also used to move bits after earlier such operations happened, e.g. in a sequence of reduced images from Adam7 - only useful if (ilinebits - olinebits) is a value in the range 1..7 - */ - unsigned y; - size_t diff = ilinebits - olinebits; - size_t ibp = 0, obp = 0; /*input and output bit pointers*/ - for(y = 0; y < h; ++y) { - size_t x; - for(x = 0; x < olinebits; ++x) { - unsigned char bit = readBitFromReversedStream(&ibp, in); - setBitOfReversedStream(&obp, out, bit); - } - ibp += diff; - } -} - -/*out must be buffer big enough to contain full image, and in must contain the full decompressed data from -the IDAT chunks (with filter index bytes and possible padding bits) -return value is error*/ -static unsigned postProcessScanlines(unsigned char * out, unsigned char * in, - unsigned w, unsigned h, const LodePNGInfo * info_png) -{ - /* - This function converts the filtered-padded-interlaced data into pure 2D image buffer with the PNG's colortype. - Steps: - *) if no Adam7: 1) unfilter 2) remove padding bits (= possible extra bits per scanline if bpp < 8) - *) if adam7: 1) 7x unfilter 2) 7x remove padding bits 3) Adam7_deinterlace - NOTE: the in buffer will be overwritten with intermediate data! - */ - unsigned bpp = lodepng_get_bpp(&info_png->color); - if(bpp == 0) return 31; /*error: invalid colortype*/ - - if(info_png->interlace_method == 0) { - if(bpp < 8 && w * bpp != ((w * bpp + 7u) / 8u) * 8u) { - CERROR_TRY_RETURN(unfilter(in, in, w, h, bpp)); - removePaddingBits(out, in, w * bpp, ((w * bpp + 7u) / 8u) * 8u, h); - } - /*we can immediately filter into the out buffer, no other steps needed*/ - else CERROR_TRY_RETURN(unfilter(out, in, w, h, bpp)); - } - else { /*interlace_method is 1 (Adam7)*/ - unsigned passw[7], passh[7]; - size_t filter_passstart[8], padded_passstart[8], passstart[8]; - unsigned i; - - Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); - - for(i = 0; i != 7; ++i) { - CERROR_TRY_RETURN(unfilter(&in[padded_passstart[i]], &in[filter_passstart[i]], passw[i], passh[i], bpp)); - /*TODO: possible efficiency improvement: if in this reduced image the bits fit nicely in 1 scanline, - move bytes instead of bits or move not at all*/ - if(bpp < 8) { - /*remove padding bits in scanlines; after this there still may be padding - bits between the different reduced images: each reduced image still starts nicely at a byte*/ - removePaddingBits(&in[passstart[i]], &in[padded_passstart[i]], passw[i] * bpp, - ((passw[i] * bpp + 7u) / 8u) * 8u, passh[i]); - } - } - - Adam7_deinterlace(out, in, w, h, bpp); - } - - return 0; -} - -static unsigned readChunk_PLTE(LodePNGColorMode * color, const unsigned char * data, size_t chunkLength) -{ - unsigned pos = 0, i; - color->palettesize = chunkLength / 3u; - if(color->palettesize == 0 || color->palettesize > 256) return 38; /*error: palette too small or big*/ - lodepng_color_mode_alloc_palette(color); - if(!color->palette && color->palettesize) { - color->palettesize = 0; - return 83; /*alloc fail*/ - } - - for(i = 0; i != color->palettesize; ++i) { - color->palette[4 * i + 0] = data[pos++]; /*R*/ - color->palette[4 * i + 1] = data[pos++]; /*G*/ - color->palette[4 * i + 2] = data[pos++]; /*B*/ - color->palette[4 * i + 3] = 255; /*alpha*/ - } - - return 0; /* OK */ -} - -static unsigned readChunk_tRNS(LodePNGColorMode * color, const unsigned char * data, size_t chunkLength) -{ - unsigned i; - if(color->colortype == LCT_PALETTE) { - /*error: more alpha values given than there are palette entries*/ - if(chunkLength > color->palettesize) return 39; - - for(i = 0; i != chunkLength; ++i) color->palette[4 * i + 3] = data[i]; - } - else if(color->colortype == LCT_GREY) { - /*error: this chunk must be 2 bytes for grayscale image*/ - if(chunkLength != 2) return 30; - - color->key_defined = 1; - color->key_r = color->key_g = color->key_b = 256u * data[0] + data[1]; - } - else if(color->colortype == LCT_RGB) { - /*error: this chunk must be 6 bytes for RGB image*/ - if(chunkLength != 6) return 41; - - color->key_defined = 1; - color->key_r = 256u * data[0] + data[1]; - color->key_g = 256u * data[2] + data[3]; - color->key_b = 256u * data[4] + data[5]; - } - else return 42; /*error: tRNS chunk not allowed for other color models*/ - - return 0; /* OK */ -} - - -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS -/*background color chunk (bKGD)*/ -static unsigned readChunk_bKGD(LodePNGInfo * info, const unsigned char * data, size_t chunkLength) -{ - if(info->color.colortype == LCT_PALETTE) { - /*error: this chunk must be 1 byte for indexed color image*/ - if(chunkLength != 1) return 43; - - /*error: invalid palette index, or maybe this chunk appeared before PLTE*/ - if(data[0] >= info->color.palettesize) return 103; - - info->background_defined = 1; - info->background_r = info->background_g = info->background_b = data[0]; - } - else if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) { - /*error: this chunk must be 2 bytes for grayscale image*/ - if(chunkLength != 2) return 44; - - /*the values are truncated to bitdepth in the PNG file*/ - info->background_defined = 1; - info->background_r = info->background_g = info->background_b = 256u * data[0] + data[1]; - } - else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) { - /*error: this chunk must be 6 bytes for grayscale image*/ - if(chunkLength != 6) return 45; - - /*the values are truncated to bitdepth in the PNG file*/ - info->background_defined = 1; - info->background_r = 256u * data[0] + data[1]; - info->background_g = 256u * data[2] + data[3]; - info->background_b = 256u * data[4] + data[5]; - } - - return 0; /* OK */ -} - -/*text chunk (tEXt)*/ -static unsigned readChunk_tEXt(LodePNGInfo * info, const unsigned char * data, size_t chunkLength) -{ - unsigned error = 0; - char * key = 0, * str = 0; - - while(!error) { /*not really a while loop, only used to break on error*/ - unsigned length, string2_begin; - - length = 0; - while(length < chunkLength && data[length] != 0) ++length; - /*even though it's not allowed by the standard, no error is thrown if - there's no null termination char, if the text is empty*/ - if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ - - key = (char *)lodepng_malloc(length + 1); - if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ - - lodepng_memcpy(key, data, length); - key[length] = 0; - - string2_begin = length + 1; /*skip keyword null terminator*/ - - length = (unsigned)(chunkLength < string2_begin ? 0 : chunkLength - string2_begin); - str = (char *)lodepng_malloc(length + 1); - if(!str) CERROR_BREAK(error, 83); /*alloc fail*/ - - lodepng_memcpy(str, data + string2_begin, length); - str[length] = 0; - - error = lodepng_add_text(info, key, str); - - break; - } - - lodepng_free(key); - lodepng_free(str); - - return error; -} - -/*compressed text chunk (zTXt)*/ -static unsigned readChunk_zTXt(LodePNGInfo * info, const LodePNGDecoderSettings * decoder, - const unsigned char * data, size_t chunkLength) -{ - unsigned error = 0; - - /*copy the object to change parameters in it*/ - LodePNGDecompressSettings zlibsettings = decoder->zlibsettings; - - unsigned length, string2_begin; - char * key = 0; - unsigned char * str = 0; - size_t size = 0; - - while(!error) { /*not really a while loop, only used to break on error*/ - for(length = 0; length < chunkLength && data[length] != 0; ++length) ; - if(length + 2 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ - if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ - - key = (char *)lodepng_malloc(length + 1); - if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ - - lodepng_memcpy(key, data, length); - key[length] = 0; - - if(data[length + 1] != 0) CERROR_BREAK(error, 72); /*the 0 byte indicating compression must be 0*/ - - string2_begin = length + 2; - if(string2_begin > chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ - - length = (unsigned)chunkLength - string2_begin; - zlibsettings.max_output_size = decoder->max_text_size; - /*will fail if zlib error, e.g. if length is too small*/ - error = zlib_decompress(&str, &size, 0, &data[string2_begin], - length, &zlibsettings); - /*error: compressed text larger than decoder->max_text_size*/ - if(error && size > zlibsettings.max_output_size) error = 112; - if(error) break; - error = lodepng_add_text_sized(info, key, (char *)str, size); - break; - } - - lodepng_free(key); - lodepng_free(str); - - return error; -} - -/*international text chunk (iTXt)*/ -static unsigned readChunk_iTXt(LodePNGInfo * info, const LodePNGDecoderSettings * decoder, - const unsigned char * data, size_t chunkLength) -{ - unsigned error = 0; - unsigned i; - - /*copy the object to change parameters in it*/ - LodePNGDecompressSettings zlibsettings = decoder->zlibsettings; - - unsigned length, begin, compressed; - char * key = 0, * langtag = 0, * transkey = 0; - - while(!error) { /*not really a while loop, only used to break on error*/ - /*Quick check if the chunk length isn't too small. Even without check - it'd still fail with other error checks below if it's too short. This just gives a different error code.*/ - if(chunkLength < 5) CERROR_BREAK(error, 30); /*iTXt chunk too short*/ - - /*read the key*/ - for(length = 0; length < chunkLength && data[length] != 0; ++length) ; - if(length + 3 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination char, corrupt?*/ - if(length < 1 || length > 79) CERROR_BREAK(error, 89); /*keyword too short or long*/ - - key = (char *)lodepng_malloc(length + 1); - if(!key) CERROR_BREAK(error, 83); /*alloc fail*/ - - lodepng_memcpy(key, data, length); - key[length] = 0; - - /*read the compression method*/ - compressed = data[length + 1]; - if(data[length + 2] != 0) CERROR_BREAK(error, 72); /*the 0 byte indicating compression must be 0*/ - - /*even though it's not allowed by the standard, no error is thrown if - there's no null termination char, if the text is empty for the next 3 texts*/ - - /*read the langtag*/ - begin = length + 3; - length = 0; - for(i = begin; i < chunkLength && data[i] != 0; ++i) ++length; - - langtag = (char *)lodepng_malloc(length + 1); - if(!langtag) CERROR_BREAK(error, 83); /*alloc fail*/ - - lodepng_memcpy(langtag, data + begin, length); - langtag[length] = 0; - - /*read the transkey*/ - begin += length + 1; - length = 0; - for(i = begin; i < chunkLength && data[i] != 0; ++i) ++length; - - transkey = (char *)lodepng_malloc(length + 1); - if(!transkey) CERROR_BREAK(error, 83); /*alloc fail*/ - - lodepng_memcpy(transkey, data + begin, length); - transkey[length] = 0; - - /*read the actual text*/ - begin += length + 1; - - length = (unsigned)chunkLength < begin ? 0 : (unsigned)chunkLength - begin; - - if(compressed) { - unsigned char * str = 0; - size_t size = 0; - zlibsettings.max_output_size = decoder->max_text_size; - /*will fail if zlib error, e.g. if length is too small*/ - error = zlib_decompress(&str, &size, 0, &data[begin], - length, &zlibsettings); - /*error: compressed text larger than decoder->max_text_size*/ - if(error && size > zlibsettings.max_output_size) error = 112; - if(!error) error = lodepng_add_itext_sized(info, key, langtag, transkey, (char *)str, size); - lodepng_free(str); - } - else { - error = lodepng_add_itext_sized(info, key, langtag, transkey, (char *)(data + begin), length); - } - - break; - } - - lodepng_free(key); - lodepng_free(langtag); - lodepng_free(transkey); - - return error; -} - -static unsigned readChunk_tIME(LodePNGInfo * info, const unsigned char * data, size_t chunkLength) -{ - if(chunkLength != 7) return 73; /*invalid tIME chunk size*/ - - info->time_defined = 1; - info->time.year = 256u * data[0] + data[1]; - info->time.month = data[2]; - info->time.day = data[3]; - info->time.hour = data[4]; - info->time.minute = data[5]; - info->time.second = data[6]; - - return 0; /* OK */ -} - -static unsigned readChunk_pHYs(LodePNGInfo * info, const unsigned char * data, size_t chunkLength) -{ - if(chunkLength != 9) return 74; /*invalid pHYs chunk size*/ - - info->phys_defined = 1; - info->phys_x = 16777216u * data[0] + 65536u * data[1] + 256u * data[2] + data[3]; - info->phys_y = 16777216u * data[4] + 65536u * data[5] + 256u * data[6] + data[7]; - info->phys_unit = data[8]; - - return 0; /* OK */ -} - -static unsigned readChunk_gAMA(LodePNGInfo * info, const unsigned char * data, size_t chunkLength) -{ - if(chunkLength != 4) return 96; /*invalid gAMA chunk size*/ - - info->gama_defined = 1; - info->gama_gamma = 16777216u * data[0] + 65536u * data[1] + 256u * data[2] + data[3]; - - return 0; /* OK */ -} - -static unsigned readChunk_cHRM(LodePNGInfo * info, const unsigned char * data, size_t chunkLength) -{ - if(chunkLength != 32) return 97; /*invalid cHRM chunk size*/ - - info->chrm_defined = 1; - info->chrm_white_x = 16777216u * data[ 0] + 65536u * data[ 1] + 256u * data[ 2] + data[ 3]; - info->chrm_white_y = 16777216u * data[ 4] + 65536u * data[ 5] + 256u * data[ 6] + data[ 7]; - info->chrm_red_x = 16777216u * data[ 8] + 65536u * data[ 9] + 256u * data[10] + data[11]; - info->chrm_red_y = 16777216u * data[12] + 65536u * data[13] + 256u * data[14] + data[15]; - info->chrm_green_x = 16777216u * data[16] + 65536u * data[17] + 256u * data[18] + data[19]; - info->chrm_green_y = 16777216u * data[20] + 65536u * data[21] + 256u * data[22] + data[23]; - info->chrm_blue_x = 16777216u * data[24] + 65536u * data[25] + 256u * data[26] + data[27]; - info->chrm_blue_y = 16777216u * data[28] + 65536u * data[29] + 256u * data[30] + data[31]; - - return 0; /* OK */ -} - -static unsigned readChunk_sRGB(LodePNGInfo * info, const unsigned char * data, size_t chunkLength) -{ - if(chunkLength != 1) return 98; /*invalid sRGB chunk size (this one is never ignored)*/ - - info->srgb_defined = 1; - info->srgb_intent = data[0]; - - return 0; /* OK */ -} - -static unsigned readChunk_iCCP(LodePNGInfo * info, const LodePNGDecoderSettings * decoder, - const unsigned char * data, size_t chunkLength) -{ - unsigned error = 0; - unsigned i; - size_t size = 0; - /*copy the object to change parameters in it*/ - LodePNGDecompressSettings zlibsettings = decoder->zlibsettings; - - unsigned length, string2_begin; - - info->iccp_defined = 1; - if(info->iccp_name) lodepng_clear_icc(info); - - for(length = 0; length < chunkLength && data[length] != 0; ++length) ; - if(length + 2 >= chunkLength) return 75; /*no null termination, corrupt?*/ - if(length < 1 || length > 79) return 89; /*keyword too short or long*/ - - info->iccp_name = (char *)lodepng_malloc(length + 1); - if(!info->iccp_name) return 83; /*alloc fail*/ - - info->iccp_name[length] = 0; - for(i = 0; i != length; ++i) info->iccp_name[i] = (char)data[i]; - - if(data[length + 1] != 0) return 72; /*the 0 byte indicating compression must be 0*/ - - string2_begin = length + 2; - if(string2_begin > chunkLength) return 75; /*no null termination, corrupt?*/ - - length = (unsigned)chunkLength - string2_begin; - zlibsettings.max_output_size = decoder->max_icc_size; - error = zlib_decompress(&info->iccp_profile, &size, 0, - &data[string2_begin], - length, &zlibsettings); - /*error: ICC profile larger than decoder->max_icc_size*/ - if(error && size > zlibsettings.max_output_size) error = 113; - info->iccp_profile_size = (unsigned)size; - if(!error && !info->iccp_profile_size) error = 100; /*invalid ICC profile size*/ - return error; -} - -/*significant bits chunk (sBIT)*/ -static unsigned readChunk_sBIT(LodePNGInfo * info, const unsigned char * data, size_t chunkLength) -{ - unsigned bitdepth = (info->color.colortype == LCT_PALETTE) ? 8 : info->color.bitdepth; - if(info->color.colortype == LCT_GREY) { - /*error: this chunk must be 1 bytes for grayscale image*/ - if(chunkLength != 1) return 114; - if(data[0] == 0 || data[0] > bitdepth) return 115; - info->sbit_defined = 1; - info->sbit_r = info->sbit_g = info->sbit_b = data[0]; /*setting g and b is not required, but sensible*/ - } - else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_PALETTE) { - /*error: this chunk must be 3 bytes for RGB and palette image*/ - if(chunkLength != 3) return 114; - if(data[0] == 0 || data[1] == 0 || data[2] == 0) return 115; - if(data[0] > bitdepth || data[1] > bitdepth || data[2] > bitdepth) return 115; - info->sbit_defined = 1; - info->sbit_r = data[0]; - info->sbit_g = data[1]; - info->sbit_b = data[2]; - } - else if(info->color.colortype == LCT_GREY_ALPHA) { - /*error: this chunk must be 2 byte for grayscale with alpha image*/ - if(chunkLength != 2) return 114; - if(data[0] == 0 || data[1] == 0) return 115; - if(data[0] > bitdepth || data[1] > bitdepth) return 115; - info->sbit_defined = 1; - info->sbit_r = info->sbit_g = info->sbit_b = data[0]; /*setting g and b is not required, but sensible*/ - info->sbit_a = data[1]; - } - else if(info->color.colortype == LCT_RGBA) { - /*error: this chunk must be 4 bytes for grayscale image*/ - if(chunkLength != 4) return 114; - if(data[0] == 0 || data[1] == 0 || data[2] == 0 || data[3] == 0) return 115; - if(data[0] > bitdepth || data[1] > bitdepth || data[2] > bitdepth || data[3] > bitdepth) return 115; - info->sbit_defined = 1; - info->sbit_r = data[0]; - info->sbit_g = data[1]; - info->sbit_b = data[2]; - info->sbit_a = data[3]; - } - - return 0; /* OK */ -} -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - -unsigned lodepng_inspect_chunk(LodePNGState * state, size_t pos, - const unsigned char * in, size_t insize) -{ - const unsigned char * chunk = in + pos; - unsigned chunkLength; - const unsigned char * data; - unsigned unhandled = 0; - unsigned error = 0; - - if(pos + 4 > insize) return 30; - chunkLength = lodepng_chunk_length(chunk); - if(chunkLength > 2147483647) return 63; - data = lodepng_chunk_data_const(chunk); - if(chunkLength + 12 > insize - pos) return 30; - - if(lodepng_chunk_type_equals(chunk, "PLTE")) { - error = readChunk_PLTE(&state->info_png.color, data, chunkLength); - } - else if(lodepng_chunk_type_equals(chunk, "tRNS")) { - error = readChunk_tRNS(&state->info_png.color, data, chunkLength); -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - } - else if(lodepng_chunk_type_equals(chunk, "bKGD")) { - error = readChunk_bKGD(&state->info_png, data, chunkLength); - } - else if(lodepng_chunk_type_equals(chunk, "tEXt")) { - error = readChunk_tEXt(&state->info_png, data, chunkLength); - } - else if(lodepng_chunk_type_equals(chunk, "zTXt")) { - error = readChunk_zTXt(&state->info_png, &state->decoder, data, chunkLength); - } - else if(lodepng_chunk_type_equals(chunk, "iTXt")) { - error = readChunk_iTXt(&state->info_png, &state->decoder, data, chunkLength); - } - else if(lodepng_chunk_type_equals(chunk, "tIME")) { - error = readChunk_tIME(&state->info_png, data, chunkLength); - } - else if(lodepng_chunk_type_equals(chunk, "pHYs")) { - error = readChunk_pHYs(&state->info_png, data, chunkLength); - } - else if(lodepng_chunk_type_equals(chunk, "gAMA")) { - error = readChunk_gAMA(&state->info_png, data, chunkLength); - } - else if(lodepng_chunk_type_equals(chunk, "cHRM")) { - error = readChunk_cHRM(&state->info_png, data, chunkLength); - } - else if(lodepng_chunk_type_equals(chunk, "sRGB")) { - error = readChunk_sRGB(&state->info_png, data, chunkLength); - } - else if(lodepng_chunk_type_equals(chunk, "iCCP")) { - error = readChunk_iCCP(&state->info_png, &state->decoder, data, chunkLength); - } - else if(lodepng_chunk_type_equals(chunk, "sBIT")) { - error = readChunk_sBIT(&state->info_png, data, chunkLength); -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - } - else { - /* unhandled chunk is ok (is not an error) */ - unhandled = 1; - } - - if(!error && !unhandled && !state->decoder.ignore_crc) { - if(lodepng_chunk_check_crc(chunk)) return 57; /*invalid CRC*/ - } - - return error; -} - -/*read a PNG, the result will be in the same color type as the PNG (hence "generic")*/ -static void decodeGeneric(unsigned char ** out, unsigned * w, unsigned * h, - LodePNGState * state, - const unsigned char * in, size_t insize) -{ - unsigned char IEND = 0; - const unsigned char * chunk; /*points to beginning of next chunk*/ - unsigned char * idat; /*the data from idat chunks, zlib compressed*/ - size_t idatsize = 0; - unsigned char * scanlines = 0; - size_t scanlines_size = 0, expected_size = 0; - size_t outsize = 0; - - /*for unknown chunk order*/ - unsigned unknown = 0; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - unsigned critical_pos = 1; /*1 = after IHDR, 2 = after PLTE, 3 = after IDAT*/ -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - - - /* safe output values in case error happens */ - *out = 0; - *w = *h = 0; - - state->error = lodepng_inspect(w, h, state, in, insize); /*reads header and resets other parameters in state->info_png*/ - if(state->error) return; - - if(lodepng_pixel_overflow(*w, *h, &state->info_png.color, &state->info_raw)) { - CERROR_RETURN(state->error, 92); /*overflow possible due to amount of pixels*/ - } - - /*the input filesize is a safe upper bound for the sum of idat chunks size*/ - idat = (unsigned char *)lodepng_malloc(insize); - if(!idat) CERROR_RETURN(state->error, 83); /*alloc fail*/ - - chunk = &in[33]; /*first byte of the first chunk after the header*/ - - /*loop through the chunks, ignoring unknown chunks and stopping at IEND chunk. - IDAT data is put at the start of the in buffer*/ - while(!IEND && !state->error) { - unsigned chunkLength; - const unsigned char * data; /*the data in the chunk*/ - size_t pos = (size_t)(chunk - in); - - /*error: next chunk out of bounds of the in buffer*/ - if(chunk < in || pos + 12 > insize) { - if(state->decoder.ignore_end) break; /*other errors may still happen though*/ - CERROR_BREAK(state->error, 30); - } - - /*length of the data of the chunk, excluding the 12 bytes for length, chunk type and CRC*/ - chunkLength = lodepng_chunk_length(chunk); - /*error: chunk length larger than the max PNG chunk size*/ - if(chunkLength > 2147483647) { - if(state->decoder.ignore_end) break; /*other errors may still happen though*/ - CERROR_BREAK(state->error, 63); - } - - if(pos + (size_t)chunkLength + 12 > insize || pos + (size_t)chunkLength + 12 < pos) { - CERROR_BREAK(state->error, 64); /*error: size of the in buffer too small to contain next chunk (or int overflow)*/ - } - - data = lodepng_chunk_data_const(chunk); - - unknown = 0; - - /*IDAT chunk, containing compressed image data*/ - if(lodepng_chunk_type_equals(chunk, "IDAT")) { - size_t newsize; - if(lodepng_addofl(idatsize, chunkLength, &newsize)) CERROR_BREAK(state->error, 95); - if(newsize > insize) CERROR_BREAK(state->error, 95); - lodepng_memcpy(idat + idatsize, data, chunkLength); - idatsize += chunkLength; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - critical_pos = 3; -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - } - else if(lodepng_chunk_type_equals(chunk, "IEND")) { - /*IEND chunk*/ - IEND = 1; - } - else if(lodepng_chunk_type_equals(chunk, "PLTE")) { - /*palette chunk (PLTE)*/ - state->error = readChunk_PLTE(&state->info_png.color, data, chunkLength); - if(state->error) break; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - critical_pos = 2; -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - } - else if(lodepng_chunk_type_equals(chunk, "tRNS")) { - /*palette transparency chunk (tRNS). Even though this one is an ancillary chunk , it is still compiled - in without 'LODEPNG_COMPILE_ANCILLARY_CHUNKS' because it contains essential color information that - affects the alpha channel of pixels. */ - state->error = readChunk_tRNS(&state->info_png.color, data, chunkLength); - if(state->error) break; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*background color chunk (bKGD)*/ - } - else if(lodepng_chunk_type_equals(chunk, "bKGD")) { - state->error = readChunk_bKGD(&state->info_png, data, chunkLength); - if(state->error) break; - } - else if(lodepng_chunk_type_equals(chunk, "tEXt")) { - /*text chunk (tEXt)*/ - if(state->decoder.read_text_chunks) { - state->error = readChunk_tEXt(&state->info_png, data, chunkLength); - if(state->error) break; - } - } - else if(lodepng_chunk_type_equals(chunk, "zTXt")) { - /*compressed text chunk (zTXt)*/ - if(state->decoder.read_text_chunks) { - state->error = readChunk_zTXt(&state->info_png, &state->decoder, data, chunkLength); - if(state->error) break; - } - } - else if(lodepng_chunk_type_equals(chunk, "iTXt")) { - /*international text chunk (iTXt)*/ - if(state->decoder.read_text_chunks) { - state->error = readChunk_iTXt(&state->info_png, &state->decoder, data, chunkLength); - if(state->error) break; - } - } - else if(lodepng_chunk_type_equals(chunk, "tIME")) { - state->error = readChunk_tIME(&state->info_png, data, chunkLength); - if(state->error) break; - } - else if(lodepng_chunk_type_equals(chunk, "pHYs")) { - state->error = readChunk_pHYs(&state->info_png, data, chunkLength); - if(state->error) break; - } - else if(lodepng_chunk_type_equals(chunk, "gAMA")) { - state->error = readChunk_gAMA(&state->info_png, data, chunkLength); - if(state->error) break; - } - else if(lodepng_chunk_type_equals(chunk, "cHRM")) { - state->error = readChunk_cHRM(&state->info_png, data, chunkLength); - if(state->error) break; - } - else if(lodepng_chunk_type_equals(chunk, "sRGB")) { - state->error = readChunk_sRGB(&state->info_png, data, chunkLength); - if(state->error) break; - } - else if(lodepng_chunk_type_equals(chunk, "iCCP")) { - state->error = readChunk_iCCP(&state->info_png, &state->decoder, data, chunkLength); - if(state->error) break; - } - else if(lodepng_chunk_type_equals(chunk, "sBIT")) { - state->error = readChunk_sBIT(&state->info_png, data, chunkLength); - if(state->error) break; -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - } - else /*it's not an implemented chunk type, so ignore it: skip over the data*/ { - /*error: unknown critical chunk (5th bit of first byte of chunk type is 0)*/ - if(!state->decoder.ignore_critical && !lodepng_chunk_ancillary(chunk)) { - CERROR_BREAK(state->error, 69); - } - - unknown = 1; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - if(state->decoder.remember_unknown_chunks) { - state->error = lodepng_chunk_append(&state->info_png.unknown_chunks_data[critical_pos - 1], - &state->info_png.unknown_chunks_size[critical_pos - 1], chunk); - if(state->error) break; - } -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - } - - if(!state->decoder.ignore_crc && !unknown) { /*check CRC if wanted, only on known chunk types*/ - if(lodepng_chunk_check_crc(chunk)) CERROR_BREAK(state->error, 57); /*invalid CRC*/ - } - - if(!IEND) chunk = lodepng_chunk_next_const(chunk, in + insize); - } - - if(!state->error && state->info_png.color.colortype == LCT_PALETTE && !state->info_png.color.palette) { - state->error = 106; /* error: PNG file must have PLTE chunk if color type is palette */ - } - - if(!state->error) { - /*predict output size, to allocate exact size for output buffer to avoid more dynamic allocation. - If the decompressed size does not match the prediction, the image must be corrupt.*/ - if(state->info_png.interlace_method == 0) { - unsigned bpp = lodepng_get_bpp(&state->info_png.color); - expected_size = lodepng_get_raw_size_idat(*w, *h, bpp); - } - else { - unsigned bpp = lodepng_get_bpp(&state->info_png.color); - /*Adam-7 interlaced: expected size is the sum of the 7 sub-images sizes*/ - expected_size = 0; - expected_size += lodepng_get_raw_size_idat((*w + 7) >> 3, (*h + 7) >> 3, bpp); - if(*w > 4) expected_size += lodepng_get_raw_size_idat((*w + 3) >> 3, (*h + 7) >> 3, bpp); - expected_size += lodepng_get_raw_size_idat((*w + 3) >> 2, (*h + 3) >> 3, bpp); - if(*w > 2) expected_size += lodepng_get_raw_size_idat((*w + 1) >> 2, (*h + 3) >> 2, bpp); - expected_size += lodepng_get_raw_size_idat((*w + 1) >> 1, (*h + 1) >> 2, bpp); - if(*w > 1) expected_size += lodepng_get_raw_size_idat((*w + 0) >> 1, (*h + 1) >> 1, bpp); - expected_size += lodepng_get_raw_size_idat((*w + 0), (*h + 0) >> 1, bpp); - } - - state->error = zlib_decompress(&scanlines, &scanlines_size, expected_size, idat, idatsize, - &state->decoder.zlibsettings); - } - if(!state->error && scanlines_size != expected_size) state->error = 91; /*decompressed size doesn't match prediction*/ - lodepng_free(idat); - - if(!state->error) { - lv_draw_buf_t * decoded = lv_draw_buf_create_ex(image_cache_draw_buf_handlers, *w, *h, LV_COLOR_FORMAT_ARGB8888, 4 * *w); - if(decoded) { - *out = (unsigned char*)decoded; - outsize = decoded->data_size; - } - else state->error = 83; /*alloc fail*/ - } - if(!state->error) { - lv_draw_buf_t * decoded = (lv_draw_buf_t *)*out; - lodepng_memset(decoded->data, 0, outsize); - state->error = postProcessScanlines(decoded->data, scanlines, *w, *h, &state->info_png); - } - lodepng_free(scanlines); -} - -unsigned lodepng_decode(unsigned char ** out, unsigned * w, unsigned * h, - LodePNGState * state, - const unsigned char * in, size_t insize) -{ - *out = NULL; - decodeGeneric(out, w, h, state, in, insize); - if(state->error) return state->error; - if(!state->decoder.color_convert || lodepng_color_mode_equal(&state->info_raw, &state->info_png.color)) { - /*same color type, no copying or converting of data needed*/ - /*store the info_png color settings on the info_raw so that the info_raw still reflects what colortype - the raw image has to the end user*/ - if(!state->decoder.color_convert) { - state->error = lodepng_color_mode_copy(&state->info_raw, &state->info_png.color); - if(state->error) return state->error; - } - } - else { /*color conversion needed*/ - lv_draw_buf_t * old_buf = (lv_draw_buf_t *)*out; - - /*TODO: check if this works according to the statement in the documentation: "The converter can convert - from grayscale input color type, to 8-bit grayscale or grayscale with alpha"*/ - if(!(state->info_raw.colortype == LCT_RGB || state->info_raw.colortype == LCT_RGBA) - && !(state->info_raw.bitdepth == 8)) { - return 56; /*unsupported color mode conversion*/ - } - - lv_draw_buf_t * new_buf = lv_draw_buf_create_user(image_cache_draw_buf_handlers,*w, *h, LV_COLOR_FORMAT_ARGB8888, 4 * *w); - if(new_buf == NULL) { - state->error = 83; /*alloc fail*/ - } - else { - state->error = lodepng_convert(new_buf->data, old_buf->data, - &state->info_raw, &state->info_png.color, *w, *h); - - if (state->error) { - lv_draw_buf_destroy(new_buf); - new_buf = NULL; - } - } - - *out = (unsigned char*)new_buf; - lv_draw_buf_destroy(old_buf); - } - return state->error; -} - -unsigned lodepng_decode_memory(unsigned char ** out, unsigned * w, unsigned * h, const unsigned char * in, - size_t insize, LodePNGColorType colortype, unsigned bitdepth) -{ - unsigned error; - LodePNGState state; - lodepng_state_init(&state); - state.info_raw.colortype = colortype; - state.info_raw.bitdepth = bitdepth; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*disable reading things that this function doesn't output*/ - state.decoder.read_text_chunks = 0; - state.decoder.remember_unknown_chunks = 0; -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - error = lodepng_decode(out, w, h, &state, in, insize); - lodepng_state_cleanup(&state); - return error; -} - -unsigned lodepng_decode32(unsigned char ** out, unsigned * w, unsigned * h, const unsigned char * in, size_t insize) -{ - return lodepng_decode_memory(out, w, h, in, insize, LCT_RGBA, 8); -} - -unsigned lodepng_decode24(unsigned char ** out, unsigned * w, unsigned * h, const unsigned char * in, size_t insize) -{ - return lodepng_decode_memory(out, w, h, in, insize, LCT_RGB, 8); -} - -#ifdef LODEPNG_COMPILE_DISK -unsigned lodepng_decode_file(unsigned char ** out, unsigned * w, unsigned * h, const char * filename, - LodePNGColorType colortype, unsigned bitdepth) -{ - unsigned char * buffer = 0; - size_t buffersize; - unsigned error; - /* safe output values in case error happens */ - *out = 0; - *w = *h = 0; - error = lodepng_load_file(&buffer, &buffersize, filename); - if(!error) error = lodepng_decode_memory(out, w, h, buffer, buffersize, colortype, bitdepth); - lodepng_free(buffer); - return error; -} - -unsigned lodepng_decode32_file(unsigned char ** out, unsigned * w, unsigned * h, const char * filename) -{ - return lodepng_decode_file(out, w, h, filename, LCT_RGBA, 8); -} - -unsigned lodepng_decode24_file(unsigned char ** out, unsigned * w, unsigned * h, const char * filename) -{ - return lodepng_decode_file(out, w, h, filename, LCT_RGB, 8); -} -#endif /*LODEPNG_COMPILE_DISK*/ - -void lodepng_decoder_settings_init(LodePNGDecoderSettings * settings) -{ - settings->color_convert = 1; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - settings->read_text_chunks = 1; - settings->remember_unknown_chunks = 0; - settings->max_text_size = 16777216; - settings->max_icc_size = 16777216; /* 16MB is much more than enough for any reasonable ICC profile */ -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - settings->ignore_crc = 0; - settings->ignore_critical = 0; - settings->ignore_end = 0; - lodepng_decompress_settings_init(&settings->zlibsettings); -} - -#endif /*LODEPNG_COMPILE_DECODER*/ - -#if defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) - -void lodepng_state_init(LodePNGState * state) -{ -#ifdef LODEPNG_COMPILE_DECODER - lodepng_decoder_settings_init(&state->decoder); -#endif /*LODEPNG_COMPILE_DECODER*/ -#ifdef LODEPNG_COMPILE_ENCODER - lodepng_encoder_settings_init(&state->encoder); -#endif /*LODEPNG_COMPILE_ENCODER*/ - lodepng_color_mode_init(&state->info_raw); - lodepng_info_init(&state->info_png); - state->error = 1; -} - -void lodepng_state_cleanup(LodePNGState * state) -{ - lodepng_color_mode_cleanup(&state->info_raw); - lodepng_info_cleanup(&state->info_png); -} - -void lodepng_state_copy(LodePNGState * dest, const LodePNGState * source) -{ - lodepng_state_cleanup(dest); - *dest = *source; - lodepng_color_mode_init(&dest->info_raw); - lodepng_info_init(&dest->info_png); - dest->error = lodepng_color_mode_copy(&dest->info_raw, &source->info_raw); - if(dest->error) return; - dest->error = lodepng_info_copy(&dest->info_png, &source->info_png); - if(dest->error) return; -} - -#endif /* defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) */ - -#ifdef LODEPNG_COMPILE_ENCODER - -/* ////////////////////////////////////////////////////////////////////////// */ -/* / PNG Encoder / */ -/* ////////////////////////////////////////////////////////////////////////// */ - - -static unsigned writeSignature(ucvector * out) -{ - size_t pos = out->size; - const unsigned char signature[] = {137, 80, 78, 71, 13, 10, 26, 10}; - /*8 bytes PNG signature, aka the magic bytes*/ - if(!ucvector_resize(out, out->size + 8)) return 83; /*alloc fail*/ - lodepng_memcpy(out->data + pos, signature, 8); - return 0; -} - -static unsigned addChunk_IHDR(ucvector * out, unsigned w, unsigned h, - LodePNGColorType colortype, unsigned bitdepth, unsigned interlace_method) -{ - unsigned char * chunk, * data; - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 13, "IHDR")); - data = chunk + 8; - - lodepng_set32bitInt(data + 0, w); /*width*/ - lodepng_set32bitInt(data + 4, h); /*height*/ - data[8] = (unsigned char)bitdepth; /*bit depth*/ - data[9] = (unsigned char)colortype; /*color type*/ - data[10] = 0; /*compression method*/ - data[11] = 0; /*filter method*/ - data[12] = interlace_method; /*interlace method*/ - - lodepng_chunk_generate_crc(chunk); - return 0; -} - -/* only adds the chunk if needed (there is a key or palette with alpha) */ -static unsigned addChunk_PLTE(ucvector * out, const LodePNGColorMode * info) -{ - unsigned char * chunk; - size_t i, j = 8; - - if(info->palettesize == 0 || info->palettesize > 256) { - return 68; /*invalid palette size, it is only allowed to be 1-256*/ - } - - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, info->palettesize * 3, "PLTE")); - - for(i = 0; i != info->palettesize; ++i) { - /*add all channels except alpha channel*/ - chunk[j++] = info->palette[i * 4 + 0]; - chunk[j++] = info->palette[i * 4 + 1]; - chunk[j++] = info->palette[i * 4 + 2]; - } - - lodepng_chunk_generate_crc(chunk); - return 0; -} - -static unsigned addChunk_tRNS(ucvector * out, const LodePNGColorMode * info) -{ - unsigned char * chunk = 0; - - if(info->colortype == LCT_PALETTE) { - size_t i, amount = info->palettesize; - /*the tail of palette values that all have 255 as alpha, does not have to be encoded*/ - for(i = info->palettesize; i != 0; --i) { - if(info->palette[4 * (i - 1) + 3] != 255) break; - --amount; - } - if(amount) { - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, amount, "tRNS")); - /*add the alpha channel values from the palette*/ - for(i = 0; i != amount; ++i) chunk[8 + i] = info->palette[4 * i + 3]; - } - } - else if(info->colortype == LCT_GREY) { - if(info->key_defined) { - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 2, "tRNS")); - chunk[8] = (unsigned char)(info->key_r >> 8); - chunk[9] = (unsigned char)(info->key_r & 255); - } - } - else if(info->colortype == LCT_RGB) { - if(info->key_defined) { - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 6, "tRNS")); - chunk[8] = (unsigned char)(info->key_r >> 8); - chunk[9] = (unsigned char)(info->key_r & 255); - chunk[10] = (unsigned char)(info->key_g >> 8); - chunk[11] = (unsigned char)(info->key_g & 255); - chunk[12] = (unsigned char)(info->key_b >> 8); - chunk[13] = (unsigned char)(info->key_b & 255); - } - } - - if(chunk) lodepng_chunk_generate_crc(chunk); - return 0; -} - -static unsigned addChunk_IDAT(ucvector * out, const unsigned char * data, size_t datasize, - LodePNGCompressSettings * zlibsettings) -{ - unsigned error = 0; - unsigned char * zlib = 0; - size_t zlibsize = 0; - - error = zlib_compress(&zlib, &zlibsize, data, datasize, zlibsettings); - if(!error) { - error = lodepng_chunk_createv(out, zlibsize, "IDAT", zlib); - } - lodepng_free(zlib); - return error; -} - -static unsigned addChunk_IEND(ucvector * out) -{ - return lodepng_chunk_createv(out, 0, "IEND", 0); -} - -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - -static unsigned addChunk_tEXt(ucvector * out, const char * keyword, const char * textstring) -{ - unsigned char * chunk = 0; - size_t keysize = lodepng_strlen(keyword), textsize = lodepng_strlen(textstring); - size_t size = keysize + 1 + textsize; - if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, size, "tEXt")); - lodepng_memcpy(chunk + 8, keyword, keysize); - chunk[8 + keysize] = 0; /*null termination char*/ - lodepng_memcpy(chunk + 9 + keysize, textstring, textsize); - lodepng_chunk_generate_crc(chunk); - return 0; -} - -static unsigned addChunk_zTXt(ucvector * out, const char * keyword, const char * textstring, - LodePNGCompressSettings * zlibsettings) -{ - unsigned error = 0; - unsigned char * chunk = 0; - unsigned char * compressed = 0; - size_t compressedsize = 0; - size_t textsize = lodepng_strlen(textstring); - size_t keysize = lodepng_strlen(keyword); - if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ - - error = zlib_compress(&compressed, &compressedsize, - (const unsigned char *)textstring, textsize, zlibsettings); - if(!error) { - size_t size = keysize + 2 + compressedsize; - error = lodepng_chunk_init(&chunk, out, size, "zTXt"); - } - if(!error) { - lodepng_memcpy(chunk + 8, keyword, keysize); - chunk[8 + keysize] = 0; /*null termination char*/ - chunk[9 + keysize] = 0; /*compression method: 0*/ - lodepng_memcpy(chunk + 10 + keysize, compressed, compressedsize); - lodepng_chunk_generate_crc(chunk); - } - - lodepng_free(compressed); - return error; -} - -static unsigned addChunk_iTXt(ucvector * out, unsigned compress, const char * keyword, const char * langtag, - const char * transkey, const char * textstring, LodePNGCompressSettings * zlibsettings) -{ - unsigned error = 0; - unsigned char * chunk = 0; - unsigned char * compressed = 0; - size_t compressedsize = 0; - size_t textsize = lodepng_strlen(textstring); - size_t keysize = lodepng_strlen(keyword), langsize = lodepng_strlen(langtag), transsize = lodepng_strlen(transkey); - - if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ - - if(compress) { - error = zlib_compress(&compressed, &compressedsize, - (const unsigned char *)textstring, textsize, zlibsettings); - } - if(!error) { - size_t size = keysize + 3 + langsize + 1 + transsize + 1 + (compress ? compressedsize : textsize); - error = lodepng_chunk_init(&chunk, out, size, "iTXt"); - } - if(!error) { - size_t pos = 8; - lodepng_memcpy(chunk + pos, keyword, keysize); - pos += keysize; - chunk[pos++] = 0; /*null termination char*/ - chunk[pos++] = (compress ? 1 : 0); /*compression flag*/ - chunk[pos++] = 0; /*compression method: 0*/ - lodepng_memcpy(chunk + pos, langtag, langsize); - pos += langsize; - chunk[pos++] = 0; /*null termination char*/ - lodepng_memcpy(chunk + pos, transkey, transsize); - pos += transsize; - chunk[pos++] = 0; /*null termination char*/ - if(compress) { - lodepng_memcpy(chunk + pos, compressed, compressedsize); - } - else { - lodepng_memcpy(chunk + pos, textstring, textsize); - } - lodepng_chunk_generate_crc(chunk); - } - - lodepng_free(compressed); - return error; -} - -static unsigned addChunk_bKGD(ucvector * out, const LodePNGInfo * info) -{ - unsigned char * chunk = 0; - if(info->color.colortype == LCT_GREY || info->color.colortype == LCT_GREY_ALPHA) { - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 2, "bKGD")); - chunk[8] = (unsigned char)(info->background_r >> 8); - chunk[9] = (unsigned char)(info->background_r & 255); - } - else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_RGBA) { - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 6, "bKGD")); - chunk[8] = (unsigned char)(info->background_r >> 8); - chunk[9] = (unsigned char)(info->background_r & 255); - chunk[10] = (unsigned char)(info->background_g >> 8); - chunk[11] = (unsigned char)(info->background_g & 255); - chunk[12] = (unsigned char)(info->background_b >> 8); - chunk[13] = (unsigned char)(info->background_b & 255); - } - else if(info->color.colortype == LCT_PALETTE) { - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 1, "bKGD")); - chunk[8] = (unsigned char)(info->background_r & 255); /*palette index*/ - } - if(chunk) lodepng_chunk_generate_crc(chunk); - return 0; -} - -static unsigned addChunk_tIME(ucvector * out, const LodePNGTime * time) -{ - unsigned char * chunk; - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 7, "tIME")); - chunk[8] = (unsigned char)(time->year >> 8); - chunk[9] = (unsigned char)(time->year & 255); - chunk[10] = (unsigned char)time->month; - chunk[11] = (unsigned char)time->day; - chunk[12] = (unsigned char)time->hour; - chunk[13] = (unsigned char)time->minute; - chunk[14] = (unsigned char)time->second; - lodepng_chunk_generate_crc(chunk); - return 0; -} - -static unsigned addChunk_pHYs(ucvector * out, const LodePNGInfo * info) -{ - unsigned char * chunk; - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 9, "pHYs")); - lodepng_set32bitInt(chunk + 8, info->phys_x); - lodepng_set32bitInt(chunk + 12, info->phys_y); - chunk[16] = info->phys_unit; - lodepng_chunk_generate_crc(chunk); - return 0; -} - -static unsigned addChunk_gAMA(ucvector * out, const LodePNGInfo * info) -{ - unsigned char * chunk; - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 4, "gAMA")); - lodepng_set32bitInt(chunk + 8, info->gama_gamma); - lodepng_chunk_generate_crc(chunk); - return 0; -} - -static unsigned addChunk_cHRM(ucvector * out, const LodePNGInfo * info) -{ - unsigned char * chunk; - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 32, "cHRM")); - lodepng_set32bitInt(chunk + 8, info->chrm_white_x); - lodepng_set32bitInt(chunk + 12, info->chrm_white_y); - lodepng_set32bitInt(chunk + 16, info->chrm_red_x); - lodepng_set32bitInt(chunk + 20, info->chrm_red_y); - lodepng_set32bitInt(chunk + 24, info->chrm_green_x); - lodepng_set32bitInt(chunk + 28, info->chrm_green_y); - lodepng_set32bitInt(chunk + 32, info->chrm_blue_x); - lodepng_set32bitInt(chunk + 36, info->chrm_blue_y); - lodepng_chunk_generate_crc(chunk); - return 0; -} - -static unsigned addChunk_sRGB(ucvector * out, const LodePNGInfo * info) -{ - unsigned char data = info->srgb_intent; - return lodepng_chunk_createv(out, 1, "sRGB", &data); -} - -static unsigned addChunk_iCCP(ucvector * out, const LodePNGInfo * info, LodePNGCompressSettings * zlibsettings) -{ - unsigned error = 0; - unsigned char * chunk = 0; - unsigned char * compressed = 0; - size_t compressedsize = 0; - size_t keysize = lodepng_strlen(info->iccp_name); - - if(keysize < 1 || keysize > 79) return 89; /*error: invalid keyword size*/ - error = zlib_compress(&compressed, &compressedsize, - info->iccp_profile, info->iccp_profile_size, zlibsettings); - if(!error) { - size_t size = keysize + 2 + compressedsize; - error = lodepng_chunk_init(&chunk, out, size, "iCCP"); - } - if(!error) { - lodepng_memcpy(chunk + 8, info->iccp_name, keysize); - chunk[8 + keysize] = 0; /*null termination char*/ - chunk[9 + keysize] = 0; /*compression method: 0*/ - lodepng_memcpy(chunk + 10 + keysize, compressed, compressedsize); - lodepng_chunk_generate_crc(chunk); - } - - lodepng_free(compressed); - return error; -} - -static unsigned addChunk_sBIT(ucvector * out, const LodePNGInfo * info) -{ - unsigned bitdepth = (info->color.colortype == LCT_PALETTE) ? 8 : info->color.bitdepth; - unsigned char * chunk = 0; - if(info->color.colortype == LCT_GREY) { - if(info->sbit_r == 0 || info->sbit_r > bitdepth) return 115; - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 1, "sBIT")); - chunk[8] = info->sbit_r; - } - else if(info->color.colortype == LCT_RGB || info->color.colortype == LCT_PALETTE) { - if(info->sbit_r == 0 || info->sbit_g == 0 || info->sbit_b == 0) return 115; - if(info->sbit_r > bitdepth || info->sbit_g > bitdepth || info->sbit_b > bitdepth) return 115; - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 3, "sBIT")); - chunk[8] = info->sbit_r; - chunk[9] = info->sbit_g; - chunk[10] = info->sbit_b; - } - else if(info->color.colortype == LCT_GREY_ALPHA) { - if(info->sbit_r == 0 || info->sbit_a == 0) return 115; - if(info->sbit_r > bitdepth || info->sbit_a > bitdepth) return 115; - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 2, "sBIT")); - chunk[8] = info->sbit_r; - chunk[9] = info->sbit_a; - } - else if(info->color.colortype == LCT_RGBA) { - if(info->sbit_r == 0 || info->sbit_g == 0 || info->sbit_b == 0 || info->sbit_a == 0 || - info->sbit_r > bitdepth || info->sbit_g > bitdepth || - info->sbit_b > bitdepth || info->sbit_a > bitdepth) { - return 115; - } - CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, 4, "sBIT")); - chunk[8] = info->sbit_r; - chunk[9] = info->sbit_g; - chunk[10] = info->sbit_b; - chunk[11] = info->sbit_a; - } - if(chunk) lodepng_chunk_generate_crc(chunk); - return 0; -} - -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - -static void filterScanline(unsigned char * out, const unsigned char * scanline, const unsigned char * prevline, - size_t length, size_t bytewidth, unsigned char filterType) -{ - size_t i; - switch(filterType) { - case 0: /*None*/ - for(i = 0; i != length; ++i) out[i] = scanline[i]; - break; - case 1: /*Sub*/ - for(i = 0; i != bytewidth; ++i) out[i] = scanline[i]; - for(i = bytewidth; i < length; ++i) out[i] = scanline[i] - scanline[i - bytewidth]; - break; - case 2: /*Up*/ - if(prevline) { - for(i = 0; i != length; ++i) out[i] = scanline[i] - prevline[i]; - } - else { - for(i = 0; i != length; ++i) out[i] = scanline[i]; - } - break; - case 3: /*Average*/ - if(prevline) { - for(i = 0; i != bytewidth; ++i) out[i] = scanline[i] - (prevline[i] >> 1); - for(i = bytewidth; i < length; ++i) out[i] = scanline[i] - ((scanline[i - bytewidth] + prevline[i]) >> 1); - } - else { - for(i = 0; i != bytewidth; ++i) out[i] = scanline[i]; - for(i = bytewidth; i < length; ++i) out[i] = scanline[i] - (scanline[i - bytewidth] >> 1); - } - break; - case 4: /*Paeth*/ - if(prevline) { - /*paethPredictor(0, prevline[i], 0) is always prevline[i]*/ - for(i = 0; i != bytewidth; ++i) out[i] = (scanline[i] - prevline[i]); - for(i = bytewidth; i < length; ++i) { - out[i] = (scanline[i] - paethPredictor(scanline[i - bytewidth], prevline[i], prevline[i - bytewidth])); - } - } - else { - for(i = 0; i != bytewidth; ++i) out[i] = scanline[i]; - /*paethPredictor(scanline[i - bytewidth], 0, 0) is always scanline[i - bytewidth]*/ - for(i = bytewidth; i < length; ++i) out[i] = (scanline[i] - scanline[i - bytewidth]); - } - break; - default: - return; /*invalid filter type given*/ - } -} - -/* integer binary logarithm, max return value is 31 */ -static size_t ilog2(size_t i) -{ - size_t result = 0; - if(i >= 65536) { - result += 16; - i >>= 16; - } - if(i >= 256) { - result += 8; - i >>= 8; - } - if(i >= 16) { - result += 4; - i >>= 4; - } - if(i >= 4) { - result += 2; - i >>= 2; - } - if(i >= 2) { - result += 1; /*i >>= 1;*/ - } - return result; -} - -/* integer approximation for i * log2(i), helper function for LFS_ENTROPY */ -static size_t ilog2i(size_t i) -{ - size_t l; - if(i == 0) return 0; - l = ilog2(i); - /* approximate i*log2(i): l is integer logarithm, ((i - (1u << l)) << 1u) - linearly approximates the missing fractional part multiplied by i */ - return i * l + ((i - (((size_t)1) << l)) << 1u); -} - -static unsigned filter(unsigned char * out, const unsigned char * in, unsigned w, unsigned h, - const LodePNGColorMode * color, const LodePNGEncoderSettings * settings) -{ - /* - For PNG filter method 0 - out must be a buffer with as size: h + (w * h * bpp + 7u) / 8u, because there are - the scanlines with 1 extra byte per scanline - */ - - unsigned bpp = lodepng_get_bpp(color); - /*the width of a scanline in bytes, not including the filter type*/ - size_t linebytes = lodepng_get_raw_size_idat(w, 1, bpp) - 1u; - - /*bytewidth is used for filtering, is 1 when bpp < 8, number of bytes per pixel otherwise*/ - size_t bytewidth = (bpp + 7u) / 8u; - const unsigned char * prevline = 0; - unsigned x, y; - unsigned error = 0; - LodePNGFilterStrategy strategy = settings->filter_strategy; - - /* - There is a heuristic called the minimum sum of absolute differences heuristic, suggested by the PNG standard: - * If the image type is Palette, or the bit depth is smaller than 8, then do not filter the image (i.e. - use fixed filtering, with the filter None). - * (The other case) If the image type is Grayscale or RGB (with or without Alpha), and the bit depth is - not smaller than 8, then use adaptive filtering heuristic as follows: independently for each row, apply - all five filters and select the filter that produces the smallest sum of absolute values per row. - This heuristic is used if filter strategy is LFS_MINSUM and filter_palette_zero is true. - - If filter_palette_zero is true and filter_strategy is not LFS_MINSUM, the above heuristic is followed, - but for "the other case", whatever strategy filter_strategy is set to instead of the minimum sum - heuristic is used. - */ - if(settings->filter_palette_zero && - (color->colortype == LCT_PALETTE || color->bitdepth < 8)) strategy = LFS_ZERO; - - if(bpp == 0) return 31; /*error: invalid color type*/ - - if(strategy >= LFS_ZERO && strategy <= LFS_FOUR) { - unsigned char type = (unsigned char)strategy; - for(y = 0; y != h; ++y) { - size_t outindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ - size_t inindex = linebytes * y; - out[outindex] = type; /*filter type byte*/ - filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, type); - prevline = &in[inindex]; - } - } - else if(strategy == LFS_MINSUM) { - /*adaptive filtering*/ - unsigned char * attempt[5]; /*five filtering attempts, one for each filter type*/ - size_t smallest = 0; - unsigned char type, bestType = 0; - - for(type = 0; type != 5; ++type) { - attempt[type] = (unsigned char *)lodepng_malloc(linebytes); - if(!attempt[type]) error = 83; /*alloc fail*/ - } - - if(!error) { - for(y = 0; y != h; ++y) { - /*try the 5 filter types*/ - for(type = 0; type != 5; ++type) { - size_t sum = 0; - filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type); - - /*calculate the sum of the result*/ - if(type == 0) { - for(x = 0; x != linebytes; ++x) sum += (unsigned char)(attempt[type][x]); - } - else { - for(x = 0; x != linebytes; ++x) { - /*For differences, each byte should be treated as signed, values above 127 are negative - (converted to signed char). Filtertype 0 isn't a difference though, so use unsigned there. - This means filtertype 0 is almost never chosen, but that is justified.*/ - unsigned char s = attempt[type][x]; - sum += s < 128 ? s : (255U - s); - } - } - - /*check if this is smallest sum (or if type == 0 it's the first case so always store the values)*/ - if(type == 0 || sum < smallest) { - bestType = type; - smallest = sum; - } - } - - prevline = &in[y * linebytes]; - - /*now fill the out values*/ - out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/ - for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x]; - } - } - - for(type = 0; type != 5; ++type) lodepng_free(attempt[type]); - } - else if(strategy == LFS_ENTROPY) { - unsigned char * attempt[5]; /*five filtering attempts, one for each filter type*/ - size_t bestSum = 0; - unsigned type, bestType = 0; - unsigned count[256]; - - for(type = 0; type != 5; ++type) { - attempt[type] = (unsigned char *)lodepng_malloc(linebytes); - if(!attempt[type]) error = 83; /*alloc fail*/ - } - - if(!error) { - for(y = 0; y != h; ++y) { - /*try the 5 filter types*/ - for(type = 0; type != 5; ++type) { - size_t sum = 0; - filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type); - lodepng_memset(count, 0, 256 * sizeof(*count)); - for(x = 0; x != linebytes; ++x) ++count[attempt[type][x]]; - ++count[type]; /*the filter type itself is part of the scanline*/ - for(x = 0; x != 256; ++x) { - sum += ilog2i(count[x]); - } - /*check if this is smallest sum (or if type == 0 it's the first case so always store the values)*/ - if(type == 0 || sum > bestSum) { - bestType = type; - bestSum = sum; - } - } - - prevline = &in[y * linebytes]; - - /*now fill the out values*/ - out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/ - for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x]; - } - } - - for(type = 0; type != 5; ++type) lodepng_free(attempt[type]); - } - else if(strategy == LFS_PREDEFINED) { - for(y = 0; y != h; ++y) { - size_t outindex = (1 + linebytes) * y; /*the extra filterbyte added to each row*/ - size_t inindex = linebytes * y; - unsigned char type = settings->predefined_filters[y]; - out[outindex] = type; /*filter type byte*/ - filterScanline(&out[outindex + 1], &in[inindex], prevline, linebytes, bytewidth, type); - prevline = &in[inindex]; - } - } - else if(strategy == LFS_BRUTE_FORCE) { - /*brute force filter chooser. - deflate the scanline after every filter attempt to see which one deflates best. - This is very slow and gives only slightly smaller, sometimes even larger, result*/ - size_t size[5]; - unsigned char * attempt[5]; /*five filtering attempts, one for each filter type*/ - size_t smallest = 0; - unsigned type = 0, bestType = 0; - unsigned char * dummy; - LodePNGCompressSettings zlibsettings; - lodepng_memcpy(&zlibsettings, &settings->zlibsettings, sizeof(LodePNGCompressSettings)); - /*use fixed tree on the attempts so that the tree is not adapted to the filtertype on purpose, - to simulate the true case where the tree is the same for the whole image. Sometimes it gives - better result with dynamic tree anyway. Using the fixed tree sometimes gives worse, but in rare - cases better compression. It does make this a bit less slow, so it's worth doing this.*/ - zlibsettings.btype = 1; - /*a custom encoder likely doesn't read the btype setting and is optimized for complete PNG - images only, so disable it*/ - zlibsettings.custom_zlib = 0; - zlibsettings.custom_deflate = 0; - for(type = 0; type != 5; ++type) { - attempt[type] = (unsigned char *)lodepng_malloc(linebytes); - if(!attempt[type]) error = 83; /*alloc fail*/ - } - if(!error) { - for(y = 0; y != h; ++y) { /*try the 5 filter types*/ - for(type = 0; type != 5; ++type) { - unsigned testsize = (unsigned)linebytes; - /*if(testsize > 8) testsize /= 8;*/ /*it already works good enough by testing a part of the row*/ - - filterScanline(attempt[type], &in[y * linebytes], prevline, linebytes, bytewidth, type); - size[type] = 0; - dummy = 0; - zlib_compress(&dummy, &size[type], attempt[type], testsize, &zlibsettings); - lodepng_free(dummy); - /*check if this is smallest size (or if type == 0 it's the first case so always store the values)*/ - if(type == 0 || size[type] < smallest) { - bestType = type; - smallest = size[type]; - } - } - prevline = &in[y * linebytes]; - out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/ - for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x]; - } - } - for(type = 0; type != 5; ++type) lodepng_free(attempt[type]); - } - else return 88; /* unknown filter strategy */ - - return error; -} - -static void addPaddingBits(unsigned char * out, const unsigned char * in, - size_t olinebits, size_t ilinebits, unsigned h) -{ - /*The opposite of the removePaddingBits function - olinebits must be >= ilinebits*/ - unsigned y; - size_t diff = olinebits - ilinebits; - size_t obp = 0, ibp = 0; /*bit pointers*/ - for(y = 0; y != h; ++y) { - size_t x; - for(x = 0; x < ilinebits; ++x) { - unsigned char bit = readBitFromReversedStream(&ibp, in); - setBitOfReversedStream(&obp, out, bit); - } - /*obp += diff; --> no, fill in some value in the padding bits too, to avoid - "Use of uninitialised value of size ###" warning from valgrind*/ - for(x = 0; x != diff; ++x) setBitOfReversedStream(&obp, out, 0); - } -} - -/* -in: non-interlaced image with size w*h -out: the same pixels, but re-ordered according to PNG's Adam7 interlacing, with - no padding bits between scanlines, but between reduced images so that each - reduced image starts at a byte. -bpp: bits per pixel -there are no padding bits, not between scanlines, not between reduced images -in has the following size in bits: w * h * bpp. -out is possibly bigger due to padding bits between reduced images -NOTE: comments about padding bits are only relevant if bpp < 8 -*/ -static void Adam7_interlace(unsigned char * out, const unsigned char * in, unsigned w, unsigned h, unsigned bpp) -{ - unsigned passw[7], passh[7]; - size_t filter_passstart[8], padded_passstart[8], passstart[8]; - unsigned i; - - Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); - - if(bpp >= 8) { - for(i = 0; i != 7; ++i) { - unsigned x, y, b; - size_t bytewidth = bpp / 8u; - for(y = 0; y < passh[i]; ++y) - for(x = 0; x < passw[i]; ++x) { - size_t pixelinstart = ((ADAM7_IY[i] + y * ADAM7_DY[i]) * w + ADAM7_IX[i] + x * ADAM7_DX[i]) * bytewidth; - size_t pixeloutstart = passstart[i] + (y * passw[i] + x) * bytewidth; - for(b = 0; b < bytewidth; ++b) { - out[pixeloutstart + b] = in[pixelinstart + b]; - } - } - } - } - else { /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/ - for(i = 0; i != 7; ++i) { - unsigned x, y, b; - unsigned ilinebits = bpp * passw[i]; - unsigned olinebits = bpp * w; - size_t obp, ibp; /*bit pointers (for out and in buffer)*/ - for(y = 0; y < passh[i]; ++y) - for(x = 0; x < passw[i]; ++x) { - ibp = (ADAM7_IY[i] + y * ADAM7_DY[i]) * olinebits + (ADAM7_IX[i] + x * ADAM7_DX[i]) * bpp; - obp = (8 * passstart[i]) + (y * ilinebits + x * bpp); - for(b = 0; b < bpp; ++b) { - unsigned char bit = readBitFromReversedStream(&ibp, in); - setBitOfReversedStream(&obp, out, bit); - } - } - } - } -} - -/*out must be buffer big enough to contain uncompressed IDAT chunk data, and in must contain the full image. -return value is error**/ -static unsigned preProcessScanlines(unsigned char ** out, size_t * outsize, const unsigned char * in, - unsigned w, unsigned h, - const LodePNGInfo * info_png, const LodePNGEncoderSettings * settings) -{ - /* - This function converts the pure 2D image with the PNG's colortype, into filtered-padded-interlaced data. Steps: - *) if no Adam7: 1) add padding bits (= possible extra bits per scanline if bpp < 8) 2) filter - *) if adam7: 1) Adam7_interlace 2) 7x add padding bits 3) 7x filter - */ - unsigned bpp = lodepng_get_bpp(&info_png->color); - unsigned error = 0; - - if(info_png->interlace_method == 0) { - *outsize = h + (h * ((w * bpp + 7u) / 8u)); /*image size plus an extra byte per scanline + possible padding bits*/ - *out = (unsigned char *)lodepng_malloc(*outsize); - if(!(*out) && (*outsize)) error = 83; /*alloc fail*/ - - if(!error) { - /*non multiple of 8 bits per scanline, padding bits needed per scanline*/ - if(bpp < 8 && w * bpp != ((w * bpp + 7u) / 8u) * 8u) { - unsigned char * padded = (unsigned char *)lodepng_malloc(h * ((w * bpp + 7u) / 8u)); - if(!padded) error = 83; /*alloc fail*/ - if(!error) { - addPaddingBits(padded, in, ((w * bpp + 7u) / 8u) * 8u, w * bpp, h); - error = filter(*out, padded, w, h, &info_png->color, settings); - } - lodepng_free(padded); - } - else { - /*we can immediately filter into the out buffer, no other steps needed*/ - error = filter(*out, in, w, h, &info_png->color, settings); - } - } - } - else { /*interlace_method is 1 (Adam7)*/ - unsigned passw[7], passh[7]; - size_t filter_passstart[8], padded_passstart[8], passstart[8]; - unsigned char * adam7; - - Adam7_getpassvalues(passw, passh, filter_passstart, padded_passstart, passstart, w, h, bpp); - - *outsize = filter_passstart[7]; /*image size plus an extra byte per scanline + possible padding bits*/ - *out = (unsigned char *)lodepng_malloc(*outsize); - if(!(*out)) error = 83; /*alloc fail*/ - - adam7 = (unsigned char *)lodepng_malloc(passstart[7]); - if(!adam7 && passstart[7]) error = 83; /*alloc fail*/ - - if(!error) { - unsigned i; - - Adam7_interlace(adam7, in, w, h, bpp); - for(i = 0; i != 7; ++i) { - if(bpp < 8) { - unsigned char * padded = (unsigned char *)lodepng_malloc(padded_passstart[i + 1] - padded_passstart[i]); - if(!padded) ERROR_BREAK(83); /*alloc fail*/ - addPaddingBits(padded, &adam7[passstart[i]], - ((passw[i] * bpp + 7u) / 8u) * 8u, passw[i] * bpp, passh[i]); - error = filter(&(*out)[filter_passstart[i]], padded, - passw[i], passh[i], &info_png->color, settings); - lodepng_free(padded); - } - else { - error = filter(&(*out)[filter_passstart[i]], &adam7[padded_passstart[i]], - passw[i], passh[i], &info_png->color, settings); - } - - if(error) break; - } - } - - lodepng_free(adam7); - } - - return error; -} - -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS -static unsigned addUnknownChunks(ucvector * out, unsigned char * data, size_t datasize) -{ - unsigned char * inchunk = data; - while((size_t)(inchunk - data) < datasize) { - CERROR_TRY_RETURN(lodepng_chunk_append(&out->data, &out->size, inchunk)); - out->allocsize = out->size; /*fix the allocsize again*/ - inchunk = lodepng_chunk_next(inchunk, data + datasize); - } - return 0; -} - -static unsigned isGrayICCProfile(const unsigned char * profile, unsigned size) -{ - /* - It is a gray profile if bytes 16-19 are "GRAY", rgb profile if bytes 16-19 - are "RGB ". We do not perform any full parsing of the ICC profile here, other - than check those 4 bytes to grayscale profile. Other than that, validity of - the profile is not checked. This is needed only because the PNG specification - requires using a non-gray color model if there is an ICC profile with "RGB " - (sadly limiting compression opportunities if the input data is grayscale RGB - data), and requires using a gray color model if it is "GRAY". - */ - if(size < 20) return 0; - return profile[16] == 'G' && profile[17] == 'R' && profile[18] == 'A' && profile[19] == 'Y'; -} - -static unsigned isRGBICCProfile(const unsigned char * profile, unsigned size) -{ - /* See comment in isGrayICCProfile*/ - if(size < 20) return 0; - return profile[16] == 'R' && profile[17] == 'G' && profile[18] == 'B' && profile[19] == ' '; -} -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - -unsigned lodepng_encode(unsigned char ** out, size_t * outsize, - const unsigned char * image, unsigned w, unsigned h, - LodePNGState * state) -{ - unsigned char * data = 0; /*uncompressed version of the IDAT chunk data*/ - size_t datasize = 0; - ucvector outv = ucvector_init(NULL, 0); - LodePNGInfo info; - const LodePNGInfo * info_png = &state->info_png; - LodePNGColorMode auto_color; - - lodepng_info_init(&info); - lodepng_color_mode_init(&auto_color); - - /*provide some proper output values if error will happen*/ - *out = 0; - *outsize = 0; - state->error = 0; - - /*check input values validity*/ - if((info_png->color.colortype == LCT_PALETTE || state->encoder.force_palette) - && (info_png->color.palettesize == 0 || info_png->color.palettesize > 256)) { - /*this error is returned even if auto_convert is enabled and thus encoder could - generate the palette by itself: while allowing this could be possible in theory, - it may complicate the code or edge cases, and always requiring to give a palette - when setting this color type is a simpler contract*/ - state->error = 68; /*invalid palette size, it is only allowed to be 1-256*/ - goto cleanup; - } - if(state->encoder.zlibsettings.btype > 2) { - state->error = 61; /*error: invalid btype*/ - goto cleanup; - } - if(info_png->interlace_method > 1) { - state->error = 71; /*error: invalid interlace mode*/ - goto cleanup; - } - state->error = checkColorValidity(info_png->color.colortype, info_png->color.bitdepth); - if(state->error) goto cleanup; /*error: invalid color type given*/ - state->error = checkColorValidity(state->info_raw.colortype, state->info_raw.bitdepth); - if(state->error) goto cleanup; /*error: invalid color type given*/ - - /* color convert and compute scanline filter types */ - lodepng_info_copy(&info, &state->info_png); - if(state->encoder.auto_convert) { - LodePNGColorStats stats; - unsigned allow_convert = 1; - lodepng_color_stats_init(&stats); -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - if(info_png->iccp_defined && - isGrayICCProfile(info_png->iccp_profile, info_png->iccp_profile_size)) { - /*the PNG specification does not allow to use palette with a GRAY ICC profile, even - if the palette has only gray colors, so disallow it.*/ - stats.allow_palette = 0; - } - if(info_png->iccp_defined && - isRGBICCProfile(info_png->iccp_profile, info_png->iccp_profile_size)) { - /*the PNG specification does not allow to use grayscale color with RGB ICC profile, so disallow gray.*/ - stats.allow_greyscale = 0; - } -#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */ - state->error = lodepng_compute_color_stats(&stats, image, w, h, &state->info_raw); - if(state->error) goto cleanup; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - if(info_png->background_defined) { - /*the background chunk's color must be taken into account as well*/ - unsigned r = 0, g = 0, b = 0; - LodePNGColorMode mode16 = lodepng_color_mode_make(LCT_RGB, 16); - lodepng_convert_rgb(&r, &g, &b, - info_png->background_r, info_png->background_g, info_png->background_b, &mode16, &info_png->color); - state->error = lodepng_color_stats_add(&stats, r, g, b, 65535); - if(state->error) goto cleanup; - } -#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */ - state->error = auto_choose_color(&auto_color, &state->info_raw, &stats); - if(state->error) goto cleanup; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - if(info_png->sbit_defined) { - /*if sbit is defined, due to strict requirements of which sbit values can be present for which color modes, - auto_convert can't be done in many cases. However, do support a few cases here. - TODO: more conversions may be possible, and it may also be possible to get a more appropriate color type out of - auto_choose_color if knowledge about sbit is used beforehand - */ - unsigned sbit_max = LODEPNG_MAX(LODEPNG_MAX(LODEPNG_MAX(info_png->sbit_r, info_png->sbit_g), - info_png->sbit_b), info_png->sbit_a); - unsigned equal = (!info_png->sbit_g || info_png->sbit_g == info_png->sbit_r) - && (!info_png->sbit_b || info_png->sbit_b == info_png->sbit_r) - && (!info_png->sbit_a || info_png->sbit_a == info_png->sbit_r); - allow_convert = 0; - if(info.color.colortype == LCT_PALETTE && - auto_color.colortype == LCT_PALETTE) { - /* input and output are palette, and in this case it may happen that palette data is - expected to be copied from info_raw into the info_png */ - allow_convert = 1; - } - /*going from 8-bit RGB to palette (or 16-bit as long as sbit_max <= 8) is possible - since both are 8-bit RGB for sBIT's purposes*/ - if(info.color.colortype == LCT_RGB && - auto_color.colortype == LCT_PALETTE && sbit_max <= 8) { - allow_convert = 1; - } - /*going from 8-bit RGBA to palette is also ok but only if sbit_a is exactly 8*/ - if(info.color.colortype == LCT_RGBA && auto_color.colortype == LCT_PALETTE && - info_png->sbit_a == 8 && sbit_max <= 8) { - allow_convert = 1; - } - /*going from 16-bit RGB(A) to 8-bit RGB(A) is ok if all sbit values are <= 8*/ - if((info.color.colortype == LCT_RGB || info.color.colortype == LCT_RGBA) && info.color.bitdepth == 16 && - auto_color.colortype == info.color.colortype && auto_color.bitdepth == 8 && - sbit_max <= 8) { - allow_convert = 1; - } - /*going to less channels is ok if all bit values are equal (all possible values in sbit, - as well as the chosen bitdepth of the result). Due to how auto_convert works, - we already know that auto_color.colortype has less than or equal amount of channels than - info.colortype. Palette is not used here. This conversion is not allowed if - info_png->sbit_r < auto_color.bitdepth, because specifically for alpha, non-presence of - an sbit value heavily implies that alpha's bit depth is equal to the PNG bit depth (rather - than the bit depths set in the r, g and b sbit values, by how the PNG specification describes - handling tRNS chunk case with sBIT), so be conservative here about ignoring user input.*/ - if(info.color.colortype != LCT_PALETTE && auto_color.colortype != LCT_PALETTE && - equal && info_png->sbit_r == auto_color.bitdepth) { - allow_convert = 1; - } - } -#endif - if(state->encoder.force_palette) { - if(info.color.colortype != LCT_GREY && info.color.colortype != LCT_GREY_ALPHA && - (auto_color.colortype == LCT_GREY || auto_color.colortype == LCT_GREY_ALPHA)) { - /*user speficially forced a PLTE palette, so cannot convert to grayscale types because - the PNG specification only allows writing a suggested palette in PLTE for truecolor types*/ - allow_convert = 0; - } - } - if(allow_convert) { - lodepng_color_mode_copy(&info.color, &auto_color); -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*also convert the background chunk*/ - if(info_png->background_defined) { - if(lodepng_convert_rgb(&info.background_r, &info.background_g, &info.background_b, - info_png->background_r, info_png->background_g, info_png->background_b, &info.color, &info_png->color)) { - state->error = 104; - goto cleanup; - } - } -#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */ - } - } -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - if(info_png->iccp_defined) { - unsigned gray_icc = isGrayICCProfile(info_png->iccp_profile, info_png->iccp_profile_size); - unsigned rgb_icc = isRGBICCProfile(info_png->iccp_profile, info_png->iccp_profile_size); - unsigned gray_png = info.color.colortype == LCT_GREY || info.color.colortype == LCT_GREY_ALPHA; - if(!gray_icc && !rgb_icc) { - state->error = 100; /* Disallowed profile color type for PNG */ - goto cleanup; - } - if(gray_icc != gray_png) { - /*Not allowed to use RGB/RGBA/palette with GRAY ICC profile or vice versa, - or in case of auto_convert, it wasn't possible to find appropriate model*/ - state->error = state->encoder.auto_convert ? 102 : 101; - goto cleanup; - } - } -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - if(!lodepng_color_mode_equal(&state->info_raw, &info.color)) { - unsigned char * converted; - size_t size = ((size_t)w * (size_t)h * (size_t)lodepng_get_bpp(&info.color) + 7u) / 8u; - - converted = (unsigned char *)lodepng_malloc(size); - if(!converted && size) state->error = 83; /*alloc fail*/ - if(!state->error) { - state->error = lodepng_convert(converted, image, &info.color, &state->info_raw, w, h); - } - if(!state->error) { - state->error = preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder); - } - lodepng_free(converted); - if(state->error) goto cleanup; - } - else { - state->error = preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder); - if(state->error) goto cleanup; - } - - /* output all PNG chunks */ { -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - size_t i; -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - /*write signature and chunks*/ - state->error = writeSignature(&outv); - if(state->error) goto cleanup; - /*IHDR*/ - state->error = addChunk_IHDR(&outv, w, h, info.color.colortype, info.color.bitdepth, info.interlace_method); - if(state->error) goto cleanup; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*unknown chunks between IHDR and PLTE*/ - if(info.unknown_chunks_data[0]) { - state->error = addUnknownChunks(&outv, info.unknown_chunks_data[0], info.unknown_chunks_size[0]); - if(state->error) goto cleanup; - } - /*color profile chunks must come before PLTE */ - if(info.iccp_defined) { - state->error = addChunk_iCCP(&outv, &info, &state->encoder.zlibsettings); - if(state->error) goto cleanup; - } - if(info.srgb_defined) { - state->error = addChunk_sRGB(&outv, &info); - if(state->error) goto cleanup; - } - if(info.gama_defined) { - state->error = addChunk_gAMA(&outv, &info); - if(state->error) goto cleanup; - } - if(info.chrm_defined) { - state->error = addChunk_cHRM(&outv, &info); - if(state->error) goto cleanup; - } - if(info_png->sbit_defined) { - state->error = addChunk_sBIT(&outv, &info); - if(state->error) goto cleanup; - } -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - /*PLTE*/ - if(info.color.colortype == LCT_PALETTE) { - state->error = addChunk_PLTE(&outv, &info.color); - if(state->error) goto cleanup; - } - if(state->encoder.force_palette && (info.color.colortype == LCT_RGB || info.color.colortype == LCT_RGBA)) { - /*force_palette means: write suggested palette for truecolor in PLTE chunk*/ - state->error = addChunk_PLTE(&outv, &info.color); - if(state->error) goto cleanup; - } - /*tRNS (this will only add if when necessary) */ - state->error = addChunk_tRNS(&outv, &info.color); - if(state->error) goto cleanup; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*bKGD (must come between PLTE and the IDAt chunks*/ - if(info.background_defined) { - state->error = addChunk_bKGD(&outv, &info); - if(state->error) goto cleanup; - } - /*pHYs (must come before the IDAT chunks)*/ - if(info.phys_defined) { - state->error = addChunk_pHYs(&outv, &info); - if(state->error) goto cleanup; - } - - /*unknown chunks between PLTE and IDAT*/ - if(info.unknown_chunks_data[1]) { - state->error = addUnknownChunks(&outv, info.unknown_chunks_data[1], info.unknown_chunks_size[1]); - if(state->error) goto cleanup; - } -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - /*IDAT (multiple IDAT chunks must be consecutive)*/ - state->error = addChunk_IDAT(&outv, data, datasize, &state->encoder.zlibsettings); - if(state->error) goto cleanup; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - /*tIME*/ - if(info.time_defined) { - state->error = addChunk_tIME(&outv, &info.time); - if(state->error) goto cleanup; - } - /*tEXt and/or zTXt*/ - for(i = 0; i != info.text_num; ++i) { - if(lodepng_strlen(info.text_keys[i]) > 79) { - state->error = 66; /*text chunk too large*/ - goto cleanup; - } - if(lodepng_strlen(info.text_keys[i]) < 1) { - state->error = 67; /*text chunk too small*/ - goto cleanup; - } - if(state->encoder.text_compression) { - state->error = addChunk_zTXt(&outv, info.text_keys[i], info.text_strings[i], &state->encoder.zlibsettings); - if(state->error) goto cleanup; - } - else { - state->error = addChunk_tEXt(&outv, info.text_keys[i], info.text_strings[i]); - if(state->error) goto cleanup; - } - } - /*LodePNG version id in text chunk*/ - if(state->encoder.add_id) { - unsigned already_added_id_text = 0; - for(i = 0; i != info.text_num; ++i) { - const char * k = info.text_keys[i]; - /* Could use strcmp, but we're not calling or reimplementing this C library function for this use only */ - if(k[0] == 'L' && k[1] == 'o' && k[2] == 'd' && k[3] == 'e' && - k[4] == 'P' && k[5] == 'N' && k[6] == 'G' && k[7] == '\0') { - already_added_id_text = 1; - break; - } - } - if(already_added_id_text == 0) { - state->error = addChunk_tEXt(&outv, "LodePNG", LODEPNG_VERSION_STRING); /*it's shorter as tEXt than as zTXt chunk*/ - if(state->error) goto cleanup; - } - } - /*iTXt*/ - for(i = 0; i != info.itext_num; ++i) { - if(lodepng_strlen(info.itext_keys[i]) > 79) { - state->error = 66; /*text chunk too large*/ - goto cleanup; - } - if(lodepng_strlen(info.itext_keys[i]) < 1) { - state->error = 67; /*text chunk too small*/ - goto cleanup; - } - state->error = addChunk_iTXt( - &outv, state->encoder.text_compression, - info.itext_keys[i], info.itext_langtags[i], info.itext_transkeys[i], info.itext_strings[i], - &state->encoder.zlibsettings); - if(state->error) goto cleanup; - } - - /*unknown chunks between IDAT and IEND*/ - if(info.unknown_chunks_data[2]) { - state->error = addUnknownChunks(&outv, info.unknown_chunks_data[2], info.unknown_chunks_size[2]); - if(state->error) goto cleanup; - } -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ - state->error = addChunk_IEND(&outv); - if(state->error) goto cleanup; - } - -cleanup: - lodepng_info_cleanup(&info); - lodepng_free(data); - lodepng_color_mode_cleanup(&auto_color); - - /*instead of cleaning the vector up, give it to the output*/ - *out = outv.data; - *outsize = outv.size; - - return state->error; -} - -unsigned lodepng_encode_memory(unsigned char ** out, size_t * outsize, const unsigned char * image, - unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth) -{ - unsigned error; - LodePNGState state; - lodepng_state_init(&state); - state.info_raw.colortype = colortype; - state.info_raw.bitdepth = bitdepth; - state.info_png.color.colortype = colortype; - state.info_png.color.bitdepth = bitdepth; - lodepng_encode(out, outsize, image, w, h, &state); - error = state.error; - lodepng_state_cleanup(&state); - return error; -} - -unsigned lodepng_encode32(unsigned char ** out, size_t * outsize, const unsigned char * image, unsigned w, unsigned h) -{ - return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGBA, 8); -} - -unsigned lodepng_encode24(unsigned char ** out, size_t * outsize, const unsigned char * image, unsigned w, unsigned h) -{ - return lodepng_encode_memory(out, outsize, image, w, h, LCT_RGB, 8); -} - -#ifdef LODEPNG_COMPILE_DISK -unsigned lodepng_encode_file(const char * filename, const unsigned char * image, unsigned w, unsigned h, - LodePNGColorType colortype, unsigned bitdepth) -{ - unsigned char * buffer; - size_t buffersize; - unsigned error = lodepng_encode_memory(&buffer, &buffersize, image, w, h, colortype, bitdepth); - if(!error) error = lodepng_save_file(buffer, buffersize, filename); - lodepng_free(buffer); - return error; -} - -unsigned lodepng_encode32_file(const char * filename, const unsigned char * image, unsigned w, unsigned h) -{ - return lodepng_encode_file(filename, image, w, h, LCT_RGBA, 8); -} - -unsigned lodepng_encode24_file(const char * filename, const unsigned char * image, unsigned w, unsigned h) -{ - return lodepng_encode_file(filename, image, w, h, LCT_RGB, 8); -} -#endif /*LODEPNG_COMPILE_DISK*/ - -void lodepng_encoder_settings_init(LodePNGEncoderSettings * settings) -{ - lodepng_compress_settings_init(&settings->zlibsettings); - settings->filter_palette_zero = 1; - settings->filter_strategy = LFS_MINSUM; - settings->auto_convert = 1; - settings->force_palette = 0; - settings->predefined_filters = 0; -#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS - settings->add_id = 0; - settings->text_compression = 1; -#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/ -} - -#endif /*LODEPNG_COMPILE_ENCODER*/ -#endif /*LODEPNG_COMPILE_PNG*/ - -#ifdef LODEPNG_COMPILE_ERROR_TEXT -/* -This returns the description of a numerical error code in English. This is also -the documentation of all the error codes. -*/ -const char * lodepng_error_text(unsigned code) -{ - switch(code) { - case 0: - return "no error, everything went ok"; - case 1: - return "nothing done yet"; /*the Encoder/Decoder has done nothing yet, error checking makes no sense yet*/ - case 10: - return "end of input memory reached without huffman end code"; /*while huffman decoding*/ - case 11: - return "error in code tree made it jump outside of huffman tree"; /*while huffman decoding*/ - case 13: - return "problem while processing dynamic deflate block"; - case 14: - return "problem while processing dynamic deflate block"; - case 15: - return "problem while processing dynamic deflate block"; - /*this error could happen if there are only 0 or 1 symbols present in the huffman code:*/ - case 16: - return "invalid code while processing dynamic deflate block"; - case 17: - return "end of out buffer memory reached while inflating"; - case 18: - return "invalid distance code while inflating"; - case 19: - return "end of out buffer memory reached while inflating"; - case 20: - return "invalid deflate block BTYPE encountered while decoding"; - case 21: - return "NLEN is not ones complement of LEN in a deflate block"; - - /*end of out buffer memory reached while inflating: - This can happen if the inflated deflate data is longer than the amount of bytes required to fill up - all the pixels of the image, given the color depth and image dimensions. Something that doesn't - happen in a normal, well encoded, PNG image.*/ - case 22: - return "end of out buffer memory reached while inflating"; - case 23: - return "end of in buffer memory reached while inflating"; - case 24: - return "invalid FCHECK in zlib header"; - case 25: - return "invalid compression method in zlib header"; - case 26: - return "FDICT encountered in zlib header while it's not used for PNG"; - case 27: - return "PNG file is smaller than a PNG header"; - /*Checks the magic file header, the first 8 bytes of the PNG file*/ - case 28: - return "incorrect PNG signature, it's no PNG or corrupted"; - case 29: - return "first chunk is not the header chunk"; - case 30: - return "chunk length too large, chunk broken off at end of file"; - case 31: - return "illegal PNG color type or bpp"; - case 32: - return "illegal PNG compression method"; - case 33: - return "illegal PNG filter method"; - case 34: - return "illegal PNG interlace method"; - case 35: - return "chunk length of a chunk is too large or the chunk too small"; - case 36: - return "illegal PNG filter type encountered"; - case 37: - return "illegal bit depth for this color type given"; - case 38: - return "the palette is too small or too big"; /*0, or more than 256 colors*/ - case 39: - return "tRNS chunk before PLTE or has more entries than palette size"; - case 40: - return "tRNS chunk has wrong size for grayscale image"; - case 41: - return "tRNS chunk has wrong size for RGB image"; - case 42: - return "tRNS chunk appeared while it was not allowed for this color type"; - case 43: - return "bKGD chunk has wrong size for palette image"; - case 44: - return "bKGD chunk has wrong size for grayscale image"; - case 45: - return "bKGD chunk has wrong size for RGB image"; - case 48: - return "empty input buffer given to decoder. Maybe caused by non-existing file?"; - case 49: - return "jumped past memory while generating dynamic huffman tree"; - case 50: - return "jumped past memory while generating dynamic huffman tree"; - case 51: - return "jumped past memory while inflating huffman block"; - case 52: - return "jumped past memory while inflating"; - case 53: - return "size of zlib data too small"; - case 54: - return "repeat symbol in tree while there was no value symbol yet"; - /*jumped past tree while generating huffman tree, this could be when the - tree will have more leaves than symbols after generating it out of the - given lengths. They call this an oversubscribed dynamic bit lengths tree in zlib.*/ - case 55: - return "jumped past tree while generating huffman tree"; - case 56: - return "given output image colortype or bitdepth not supported for color conversion"; - case 57: - return "invalid CRC encountered (checking CRC can be disabled)"; - case 58: - return "invalid ADLER32 encountered (checking ADLER32 can be disabled)"; - case 59: - return "requested color conversion not supported"; - case 60: - return "invalid window size given in the settings of the encoder (must be 0-32768)"; - case 61: - return "invalid BTYPE given in the settings of the encoder (only 0, 1 and 2 are allowed)"; - /*LodePNG leaves the choice of RGB to grayscale conversion formula to the user.*/ - case 62: - return "conversion from color to grayscale not supported"; - /*(2^31-1)*/ - case 63: - return "length of a chunk too long, max allowed for PNG is 2147483647 bytes per chunk"; - /*this would result in the inability of a deflated block to ever contain an end code. It must be at least 1.*/ - case 64: - return "the length of the END symbol 256 in the Huffman tree is 0"; - case 66: - return "the length of a text chunk keyword given to the encoder is longer than the maximum of 79 bytes"; - case 67: - return "the length of a text chunk keyword given to the encoder is smaller than the minimum of 1 byte"; - case 68: - return "tried to encode a PLTE chunk with a palette that has less than 1 or more than 256 colors"; - case 69: - return "unknown chunk type with 'critical' flag encountered by the decoder"; - case 71: - return "invalid interlace mode given to encoder (must be 0 or 1)"; - case 72: - return "while decoding, invalid compression method encountering in zTXt or iTXt chunk (it must be 0)"; - case 73: - return "invalid tIME chunk size"; - case 74: - return "invalid pHYs chunk size"; - /*length could be wrong, or data chopped off*/ - case 75: - return "no null termination char found while decoding text chunk"; - case 76: - return "iTXt chunk too short to contain required bytes"; - case 77: - return "integer overflow in buffer size"; - case 78: - return "failed to open file for reading"; /*file doesn't exist or couldn't be opened for reading*/ - case 79: - return "failed to open file for writing"; - case 80: - return "tried creating a tree of 0 symbols"; - case 81: - return "lazy matching at pos 0 is impossible"; - case 82: - return "color conversion to palette requested while a color isn't in palette, or index out of bounds"; - case 83: - return "memory allocation failed"; - case 84: - return "given image too small to contain all pixels to be encoded"; - case 86: - return "impossible offset in lz77 encoding (internal bug)"; - case 87: - return "must provide custom zlib function pointer if LODEPNG_COMPILE_ZLIB is not defined"; - case 88: - return "invalid filter strategy given for LodePNGEncoderSettings.filter_strategy"; - case 89: - return "text chunk keyword too short or long: must have size 1-79"; - /*the windowsize in the LodePNGCompressSettings. Requiring POT(==> & instead of %) makes encoding 12% faster.*/ - case 90: - return "windowsize must be a power of two"; - case 91: - return "invalid decompressed idat size"; - case 92: - return "integer overflow due to too many pixels"; - case 93: - return "zero width or height is invalid"; - case 94: - return "header chunk must have a size of 13 bytes"; - case 95: - return "integer overflow with combined idat chunk size"; - case 96: - return "invalid gAMA chunk size"; - case 97: - return "invalid cHRM chunk size"; - case 98: - return "invalid sRGB chunk size"; - case 99: - return "invalid sRGB rendering intent"; - case 100: - return "invalid ICC profile color type, the PNG specification only allows RGB or GRAY"; - case 101: - return "PNG specification does not allow RGB ICC profile on gray color types and vice versa"; - case 102: - return "not allowed to set grayscale ICC profile with colored pixels by PNG specification"; - case 103: - return "invalid palette index in bKGD chunk. Maybe it came before PLTE chunk?"; - case 104: - return "invalid bKGD color while encoding (e.g. palette index out of range)"; - case 105: - return "integer overflow of bitsize"; - case 106: - return "PNG file must have PLTE chunk if color type is palette"; - case 107: - return "color convert from palette mode requested without setting the palette data in it"; - case 108: - return "tried to add more than 256 values to a palette"; - /*this limit can be configured in LodePNGDecompressSettings*/ - case 109: - return "tried to decompress zlib or deflate data larger than desired max_output_size"; - case 110: - return "custom zlib or inflate decompression failed"; - case 111: - return "custom zlib or deflate compression failed"; - /*max text size limit can be configured in LodePNGDecoderSettings. This error prevents - unreasonable memory consumption when decoding due to impossibly large text sizes.*/ - case 112: - return "compressed text unreasonably large"; - /*max ICC size limit can be configured in LodePNGDecoderSettings. This error prevents - unreasonable memory consumption when decoding due to impossibly large ICC profile*/ - case 113: - return "ICC profile unreasonably large"; - case 114: - return "sBIT chunk has wrong size for the color type of the image"; - case 115: - return "sBIT value out of range"; - } - return "unknown error code"; -} -#endif /*LODEPNG_COMPILE_ERROR_TEXT*/ - -/* ////////////////////////////////////////////////////////////////////////// */ -/* ////////////////////////////////////////////////////////////////////////// */ -/* // C++ Wrapper // */ -/* ////////////////////////////////////////////////////////////////////////// */ -/* ////////////////////////////////////////////////////////////////////////// */ - -#ifdef LODEPNG_COMPILE_CPP -namespace lodepng -{ - -#ifdef LODEPNG_COMPILE_DISK -unsigned load_file(std::vector & buffer, const std::string & filename) -{ - long size = lodepng_filesize(filename.c_str()); - if(size < 0) return 78; - buffer.resize((size_t)size); - return size == 0 ? 0 : lodepng_buffer_file(&buffer[0], (size_t)size, filename.c_str()); -} - -/*write given buffer to the file, overwriting the file, it doesn't append to it.*/ -unsigned save_file(const std::vector & buffer, const std::string & filename) -{ - return lodepng_save_file(buffer.empty() ? 0 : &buffer[0], buffer.size(), filename.c_str()); -} -#endif /* LODEPNG_COMPILE_DISK */ - -#ifdef LODEPNG_COMPILE_ZLIB -#ifdef LODEPNG_COMPILE_DECODER -unsigned decompress(std::vector & out, const unsigned char * in, size_t insize, - const LodePNGDecompressSettings & settings) -{ - unsigned char * buffer = 0; - size_t buffersize = 0; - unsigned error = zlib_decompress(&buffer, &buffersize, 0, in, insize, &settings); - if(buffer) { - out.insert(out.end(), buffer, &buffer[buffersize]); - lodepng_free(buffer); - } - return error; -} - -unsigned decompress(std::vector & out, const std::vector & in, - const LodePNGDecompressSettings & settings) -{ - return decompress(out, in.empty() ? 0 : &in[0], in.size(), settings); -} -#endif /* LODEPNG_COMPILE_DECODER */ - -#ifdef LODEPNG_COMPILE_ENCODER -unsigned compress(std::vector & out, const unsigned char * in, size_t insize, - const LodePNGCompressSettings & settings) -{ - unsigned char * buffer = 0; - size_t buffersize = 0; - unsigned error = zlib_compress(&buffer, &buffersize, in, insize, &settings); - if(buffer) { - out.insert(out.end(), buffer, &buffer[buffersize]); - lodepng_free(buffer); - } - return error; -} - -unsigned compress(std::vector & out, const std::vector & in, - const LodePNGCompressSettings & settings) -{ - return compress(out, in.empty() ? 0 : &in[0], in.size(), settings); -} -#endif /* LODEPNG_COMPILE_ENCODER */ -#endif /* LODEPNG_COMPILE_ZLIB */ - - -#ifdef LODEPNG_COMPILE_PNG - -State::State() -{ - lodepng_state_init(this); -} - -State::State(const State & other) -{ - lodepng_state_init(this); - lodepng_state_copy(this, &other); -} - -State::~State() -{ - lodepng_state_cleanup(this); -} - -State & State::operator=(const State & other) -{ - lodepng_state_copy(this, &other); - return *this; -} - -#ifdef LODEPNG_COMPILE_DECODER - -unsigned decode(std::vector & out, unsigned & w, unsigned & h, const unsigned char * in, - size_t insize, LodePNGColorType colortype, unsigned bitdepth) -{ - unsigned char * buffer = 0; - unsigned error = lodepng_decode_memory(&buffer, &w, &h, in, insize, colortype, bitdepth); - if(buffer && !error) { - State state; - state.info_raw.colortype = colortype; - state.info_raw.bitdepth = bitdepth; - size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw); - out.insert(out.end(), buffer, &buffer[buffersize]); - } - lodepng_free(buffer); - return error; -} - -unsigned decode(std::vector & out, unsigned & w, unsigned & h, - const std::vector & in, LodePNGColorType colortype, unsigned bitdepth) -{ - return decode(out, w, h, in.empty() ? 0 : &in[0], (unsigned)in.size(), colortype, bitdepth); -} - -unsigned decode(std::vector & out, unsigned & w, unsigned & h, - State & state, - const unsigned char * in, size_t insize) -{ - unsigned char * buffer = NULL; - unsigned error = lodepng_decode(&buffer, &w, &h, &state, in, insize); - if(buffer && !error) { - size_t buffersize = lodepng_get_raw_size(w, h, &state.info_raw); - out.insert(out.end(), buffer, &buffer[buffersize]); - } - lodepng_free(buffer); - return error; -} - -unsigned decode(std::vector & out, unsigned & w, unsigned & h, - State & state, - const std::vector & in) -{ - return decode(out, w, h, state, in.empty() ? 0 : &in[0], in.size()); -} - -#ifdef LODEPNG_COMPILE_DISK -unsigned decode(std::vector & out, unsigned & w, unsigned & h, const std::string & filename, - LodePNGColorType colortype, unsigned bitdepth) -{ - std::vector buffer; - /* safe output values in case error happens */ - w = h = 0; - unsigned error = load_file(buffer, filename); - if(error) return error; - return decode(out, w, h, buffer, colortype, bitdepth); -} -#endif /* LODEPNG_COMPILE_DECODER */ -#endif /* LODEPNG_COMPILE_DISK */ - -#ifdef LODEPNG_COMPILE_ENCODER -unsigned encode(std::vector & out, const unsigned char * in, unsigned w, unsigned h, - LodePNGColorType colortype, unsigned bitdepth) -{ - unsigned char * buffer; - size_t buffersize; - unsigned error = lodepng_encode_memory(&buffer, &buffersize, in, w, h, colortype, bitdepth); - if(buffer) { - out.insert(out.end(), buffer, &buffer[buffersize]); - lodepng_free(buffer); - } - return error; -} - -unsigned encode(std::vector & out, - const std::vector & in, unsigned w, unsigned h, - LodePNGColorType colortype, unsigned bitdepth) -{ - if(lodepng_get_raw_size_lct(w, h, colortype, bitdepth) > in.size()) return 84; - return encode(out, in.empty() ? 0 : &in[0], w, h, colortype, bitdepth); -} - -unsigned encode(std::vector & out, - const unsigned char * in, unsigned w, unsigned h, - State & state) -{ - unsigned char * buffer; - size_t buffersize; - unsigned error = lodepng_encode(&buffer, &buffersize, in, w, h, &state); - if(buffer) { - out.insert(out.end(), buffer, &buffer[buffersize]); - lodepng_free(buffer); - } - return error; -} - -unsigned encode(std::vector & out, - const std::vector & in, unsigned w, unsigned h, - State & state) -{ - if(lodepng_get_raw_size(w, h, &state.info_raw) > in.size()) return 84; - return encode(out, in.empty() ? 0 : &in[0], w, h, state); -} - -#ifdef LODEPNG_COMPILE_DISK -unsigned encode(const std::string & filename, - const unsigned char * in, unsigned w, unsigned h, - LodePNGColorType colortype, unsigned bitdepth) -{ - std::vector buffer; - unsigned error = encode(buffer, in, w, h, colortype, bitdepth); - if(!error) error = save_file(buffer, filename); - return error; -} - -unsigned encode(const std::string & filename, - const std::vector & in, unsigned w, unsigned h, - LodePNGColorType colortype, unsigned bitdepth) -{ - if(lodepng_get_raw_size_lct(w, h, colortype, bitdepth) > in.size()) return 84; - return encode(filename, in.empty() ? 0 : &in[0], w, h, colortype, bitdepth); -} -#endif /* LODEPNG_COMPILE_DISK */ -#endif /* LODEPNG_COMPILE_ENCODER */ -#endif /* LODEPNG_COMPILE_PNG */ -} /* namespace lodepng */ -#endif /*LODEPNG_COMPILE_CPP*/ - -#endif /*LV_USE_LODEPNG*/ diff --git a/L3_Middlewares/LVGL/src/libs/lodepng/lv_lodepng.c b/L3_Middlewares/LVGL/src/libs/lodepng/lv_lodepng.c deleted file mode 100644 index e5b55de..0000000 --- a/L3_Middlewares/LVGL/src/libs/lodepng/lv_lodepng.c +++ /dev/null @@ -1,261 +0,0 @@ -/** - * @file lv_lodepng.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../draw/lv_image_decoder_private.h" -#include "../../../lvgl.h" -#include "../../core/lv_global.h" -#if LV_USE_LODEPNG - -#include "lv_lodepng.h" -#include "lodepng.h" -#include - -/********************* - * DEFINES - *********************/ - -#define DECODER_NAME "LODEPNG" - -#define image_cache_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->image_cache_draw_buf_handlers) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * src, lv_image_header_t * header); -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -static void decoder_close(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc); -static void convert_color_depth(uint8_t * img_p, uint32_t px_cnt); -static lv_draw_buf_t * decode_png_data(const void * png_data, size_t png_data_size); -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Register the PNG decoder functions in LVGL - */ -void lv_lodepng_init(void) -{ - lv_image_decoder_t * dec = lv_image_decoder_create(); - lv_image_decoder_set_info_cb(dec, decoder_info); - lv_image_decoder_set_open_cb(dec, decoder_open); - lv_image_decoder_set_close_cb(dec, decoder_close); - - dec->name = DECODER_NAME; -} - -void lv_lodepng_deinit(void) -{ - lv_image_decoder_t * dec = NULL; - while((dec = lv_image_decoder_get_next(dec)) != NULL) { - if(dec->info_cb == decoder_info) { - lv_image_decoder_delete(dec); - break; - } - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Get info about a PNG image - * @param decoder pointer to the decoder where this function belongs - * @param dsc image descriptor containing the source and type of the image and other info. - * @param header image information is set in header parameter - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't get the info - */ -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header) -{ - LV_UNUSED(decoder); /*Unused*/ - - lv_image_src_t src_type = dsc->src_type; /*Get the source type*/ - - if(src_type == LV_IMAGE_SRC_FILE || src_type == LV_IMAGE_SRC_VARIABLE) { - uint32_t * size; - static const uint8_t magic[] = {0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a}; - uint8_t buf[24]; - - /*If it's a PNG file...*/ - if(src_type == LV_IMAGE_SRC_FILE) { - /* Read the width and height from the file. They have a constant location: - * [16..19]: width - * [20..23]: height - */ - uint32_t rn; - lv_fs_read(&dsc->file, buf, sizeof(buf), &rn); - - if(rn != sizeof(buf)) return LV_RESULT_INVALID; - - if(lv_memcmp(buf, magic, sizeof(magic)) != 0) return LV_RESULT_INVALID; - - size = (uint32_t *)&buf[16]; - } - /*If it's a PNG file in a C array...*/ - else { - const lv_image_dsc_t * img_dsc = dsc->src; - const uint32_t data_size = img_dsc->data_size; - size = ((uint32_t *)img_dsc->data) + 4; - - if(data_size < sizeof(magic)) return LV_RESULT_INVALID; - if(lv_memcmp(img_dsc->data, magic, sizeof(magic)) != 0) return LV_RESULT_INVALID; - } - - /*Save the data in the header*/ - header->cf = LV_COLOR_FORMAT_ARGB8888; - /*The width and height are stored in Big endian format so convert them to little endian*/ - header->w = (int32_t)((size[0] & 0xff000000) >> 24) + ((size[0] & 0x00ff0000) >> 8); - header->h = (int32_t)((size[1] & 0xff000000) >> 24) + ((size[1] & 0x00ff0000) >> 8); - - return LV_RESULT_OK; - } - - return LV_RESULT_INVALID; /*If didn't succeeded earlier then it's an error*/ -} - -/** - * Open a PNG image and decode it into dsc.decoded - * @param decoder pointer to the decoder where this function belongs - * @param dsc decoded image descriptor - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't open the image - */ -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); - - const uint8_t * png_data = NULL; - size_t png_data_size = 0; - if(dsc->src_type == LV_IMAGE_SRC_FILE) { - const char * fn = dsc->src; - if(lv_strcmp(lv_fs_get_ext(fn), "png") == 0) { /*Check the extension*/ - unsigned error; - error = lodepng_load_file((void *)&png_data, &png_data_size, fn); /*Load the file*/ - if(error) { - if(png_data != NULL) { - lv_free((void *)png_data); - } - LV_LOG_WARN("error %u: %s\n", error, lodepng_error_text(error)); - return LV_RESULT_INVALID; - } - } - } - else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { - const lv_image_dsc_t * img_dsc = dsc->src; - png_data = img_dsc->data; - png_data_size = img_dsc->data_size; - } - else { - return LV_RESULT_INVALID; - } - - lv_draw_buf_t * decoded = decode_png_data(png_data, png_data_size); - - if(dsc->src_type == LV_IMAGE_SRC_FILE) lv_free((void *)png_data); - - if(!decoded) { - LV_LOG_WARN("Error decoding PNG"); - return LV_RESULT_INVALID; - } - - lv_draw_buf_t * adjusted = lv_image_decoder_post_process(dsc, decoded); - if(adjusted == NULL) { - lv_draw_buf_destroy(decoded); - return LV_RESULT_INVALID; - } - - /*The adjusted draw buffer is newly allocated.*/ - if(adjusted != decoded) { - lv_draw_buf_destroy(decoded); - decoded = adjusted; - } - - dsc->decoded = decoded; - - if(dsc->args.no_cache) return LV_RESULT_OK; - - /*If the image cache is disabled, just return the decoded image*/ - if(!lv_image_cache_is_enabled()) return LV_RESULT_OK; - - /*Add the decoded image to the cache*/ - lv_image_cache_data_t search_key; - search_key.src_type = dsc->src_type; - search_key.src = dsc->src; - search_key.slot.size = decoded->data_size; - - lv_cache_entry_t * entry = lv_image_decoder_add_to_cache(decoder, &search_key, decoded, NULL); - - if(entry == NULL) { - return LV_RESULT_INVALID; - } - dsc->cache_entry = entry; - - return LV_RESULT_OK; /*If not returned earlier then it failed*/ -} - -/** - * Close PNG image and free data - * @param decoder pointer to the decoder where this function belongs - * @param dsc decoded image descriptor - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't open the image - */ -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); - - if(dsc->args.no_cache || - !lv_image_cache_is_enabled()) lv_draw_buf_destroy((lv_draw_buf_t *)dsc->decoded); -} - -static lv_draw_buf_t * decode_png_data(const void * png_data, size_t png_data_size) -{ - unsigned png_width; /*Not used, just required by the decoder*/ - unsigned png_height; /*Not used, just required by the decoder*/ - lv_draw_buf_t * decoded = NULL; - - /*Decode the image in ARGB8888 */ - unsigned error = lodepng_decode32((unsigned char **)&decoded, &png_width, &png_height, png_data, png_data_size); - if(error) { - if(decoded != NULL) lv_draw_buf_destroy(decoded); - return NULL; - } - - /*Convert the image to the system's color depth*/ - convert_color_depth(decoded->data, png_width * png_height); - - return decoded; -} - -/** - * If the display is not in 32 bit format (ARGB888) then convert the image to the current color depth - * @param img the ARGB888 image - * @param px_cnt number of pixels in `img` - */ -static void convert_color_depth(uint8_t * img_p, uint32_t px_cnt) -{ - lv_color32_t * img_argb = (lv_color32_t *)img_p; - uint32_t i; - for(i = 0; i < px_cnt; i++) { - uint8_t blue = img_argb[i].blue; - img_argb[i].blue = img_argb[i].red; - img_argb[i].red = blue; - } -} - -#endif /*LV_USE_LODEPNG*/ diff --git a/L3_Middlewares/LVGL/src/libs/lodepng/lv_lodepng.h b/L3_Middlewares/LVGL/src/libs/lodepng/lv_lodepng.h deleted file mode 100644 index f3dc4b7..0000000 --- a/L3_Middlewares/LVGL/src/libs/lodepng/lv_lodepng.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file lv_lodepng.h - * - */ - -#ifndef LV_LODEPNG_H -#define LV_LODEPNG_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#if LV_USE_LODEPNG - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Register the PNG decoder functions in LVGL - */ -void lv_lodepng_init(void); - -void lv_lodepng_deinit(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_LODEPNG*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*LV_LODEPNG_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/lz4/LICENSE b/L3_Middlewares/LVGL/src/libs/lz4/LICENSE deleted file mode 100644 index 4884916..0000000 --- a/L3_Middlewares/LVGL/src/libs/lz4/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -LZ4 Library -Copyright (c) 2011-2020, Yann Collet -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* 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. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. diff --git a/L3_Middlewares/LVGL/src/libs/lz4/lz4.c b/L3_Middlewares/LVGL/src/libs/lz4/lz4.c deleted file mode 100644 index 145f5fb..0000000 --- a/L3_Middlewares/LVGL/src/libs/lz4/lz4.c +++ /dev/null @@ -1,2761 +0,0 @@ -/* - LZ4 - Fast LZ compression algorithm - Copyright (C) 2011-2020, Yann Collet. - - BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * 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. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT - OWNER 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. - - You can contact the author at : - - LZ4 homepage : http://www.lz4.org - - LZ4 source repository : https://github.com/lz4/lz4 -*/ - -#include "../../lv_conf_internal.h" -#if LV_USE_LZ4_INTERNAL - -/*-************************************ -* Tuning parameters -**************************************/ -/* - * LZ4_HEAPMODE : - * Select how stateless compression functions like `LZ4_compress_default()` - * allocate memory for their hash table, - * in memory stack (0:default, fastest), or in memory heap (1:requires malloc()). - */ -#ifndef LZ4_HEAPMODE -# define LZ4_HEAPMODE 0 -#endif - -/* - * LZ4_ACCELERATION_DEFAULT : - * Select "acceleration" for LZ4_compress_fast() when parameter value <= 0 - */ -#define LZ4_ACCELERATION_DEFAULT 1 -/* - * LZ4_ACCELERATION_MAX : - * Any "acceleration" value higher than this threshold - * get treated as LZ4_ACCELERATION_MAX instead (fix #876) - */ -#define LZ4_ACCELERATION_MAX 65537 - - -/*-************************************ -* CPU Feature Detection -**************************************/ -/* LZ4_FORCE_MEMORY_ACCESS - * By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable. - * Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal. - * The below switch allow to select different access method for improved performance. - * Method 0 (default) : use `memcpy()`. Safe and portable. - * Method 1 : `__packed` statement. It depends on compiler extension (ie, not portable). - * This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`. - * Method 2 : direct access. This method is portable but violate C standard. - * It can generate buggy code on targets which assembly generation depends on alignment. - * But in some circumstances, it's the only known way to get the most performance (ie GCC + ARMv6) - * See https://fastcompression.blogspot.fr/2015/08/accessing-unaligned-memory.html for details. - * Prefer these methods in priority order (0 > 1 > 2) - */ -#ifndef LZ4_FORCE_MEMORY_ACCESS /* can be defined externally */ -# if defined(__GNUC__) && \ - ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) \ - || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) ) -# define LZ4_FORCE_MEMORY_ACCESS 2 -# elif (defined(__INTEL_COMPILER) && !defined(_WIN32)) || defined(__GNUC__) || defined(_MSC_VER) -# define LZ4_FORCE_MEMORY_ACCESS 1 -# endif -#endif - -/* - * LZ4_FORCE_SW_BITCOUNT - * Define this parameter if your target system or compiler does not support hardware bit count - */ -#if defined(_MSC_VER) && defined(_WIN32_WCE) /* Visual Studio for WinCE doesn't support Hardware bit count */ -# undef LZ4_FORCE_SW_BITCOUNT /* avoid double def */ -# define LZ4_FORCE_SW_BITCOUNT -#endif - - - -/*-************************************ -* Dependency -**************************************/ -/* - * LZ4_SRC_INCLUDED: - * Amalgamation flag, whether lz4.c is included - */ -#ifndef LZ4_SRC_INCLUDED -# define LZ4_SRC_INCLUDED 1 -#endif - -#ifndef LZ4_STATIC_LINKING_ONLY -#define LZ4_STATIC_LINKING_ONLY -#endif - -#ifndef LZ4_DISABLE_DEPRECATE_WARNINGS -#define LZ4_DISABLE_DEPRECATE_WARNINGS /* due to LZ4_decompress_safe_withPrefix64k */ -#endif - -#define LZ4_STATIC_LINKING_ONLY /* LZ4_DISTANCE_MAX */ -#include "lz4.h" -/* see also "memory routines" below */ - - -/*-************************************ -* Compiler Options -**************************************/ -#if defined(_MSC_VER) && (_MSC_VER >= 1400) /* Visual Studio 2005+ */ -# include /* only present in VS2005+ */ -# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ -# pragma warning(disable : 6237) /* disable: C6237: conditional expression is always 0 */ -#endif /* _MSC_VER */ - -#ifndef LZ4_FORCE_INLINE -# ifdef _MSC_VER /* Visual Studio */ -# define LZ4_FORCE_INLINE static __forceinline -# else -# if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ -# ifdef __GNUC__ -# define LZ4_FORCE_INLINE static inline __attribute__((always_inline)) -# else -# define LZ4_FORCE_INLINE static inline -# endif -# else -# define LZ4_FORCE_INLINE static -# endif /* __STDC_VERSION__ */ -# endif /* _MSC_VER */ -#endif /* LZ4_FORCE_INLINE */ - -/* LZ4_FORCE_O2 and LZ4_FORCE_INLINE - * gcc on ppc64le generates an unrolled SIMDized loop for LZ4_wildCopy8, - * together with a simple 8-byte copy loop as a fall-back path. - * However, this optimization hurts the decompression speed by >30%, - * because the execution does not go to the optimized loop - * for typical compressible data, and all of the preamble checks - * before going to the fall-back path become useless overhead. - * This optimization happens only with the -O3 flag, and -O2 generates - * a simple 8-byte copy loop. - * With gcc on ppc64le, all of the LZ4_decompress_* and LZ4_wildCopy8 - * functions are annotated with __attribute__((optimize("O2"))), - * and also LZ4_wildCopy8 is forcibly inlined, so that the O2 attribute - * of LZ4_wildCopy8 does not affect the compression speed. - */ -#if defined(__PPC64__) && defined(__LITTLE_ENDIAN__) && defined(__GNUC__) && !defined(__clang__) -# define LZ4_FORCE_O2 __attribute__((optimize("O2"))) -# undef LZ4_FORCE_INLINE -# define LZ4_FORCE_INLINE static __inline __attribute__((optimize("O2"),always_inline)) -#else -# define LZ4_FORCE_O2 -#endif - -#if (defined(__GNUC__) && (__GNUC__ >= 3)) || (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 800)) || defined(__clang__) -# define expect(expr,value) (__builtin_expect ((expr),(value)) ) -#else -# define expect(expr,value) (expr) -#endif - -#ifndef likely -#define likely(expr) expect((expr) != 0, 1) -#endif -#ifndef unlikely -#define unlikely(expr) expect((expr) != 0, 0) -#endif - -/* Should the alignment test prove unreliable, for some reason, - * it can be disabled by setting LZ4_ALIGN_TEST to 0 */ -#ifndef LZ4_ALIGN_TEST /* can be externally provided */ -# define LZ4_ALIGN_TEST 1 -#endif - - -/*-************************************ -* Memory routines -**************************************/ - -/*! LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION : - * Disable relatively high-level LZ4/HC functions that use dynamic memory - * allocation functions (malloc(), calloc(), free()). - * - * Note that this is a compile-time switch. And since it disables - * public/stable LZ4 v1 API functions, we don't recommend using this - * symbol to generate a library for distribution. - * - * The following public functions are removed when this symbol is defined. - * - lz4 : LZ4_createStream, LZ4_freeStream, - * LZ4_createStreamDecode, LZ4_freeStreamDecode, LZ4_create (deprecated) - * - lz4hc : LZ4_createStreamHC, LZ4_freeStreamHC, - * LZ4_createHC (deprecated), LZ4_freeHC (deprecated) - * - lz4frame, lz4file : All LZ4F_* functions - */ -#if defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION) -# define ALLOC(s) lz4_error_memory_allocation_is_disabled -# define ALLOC_AND_ZERO(s) lz4_error_memory_allocation_is_disabled -# define FREEMEM(p) lz4_error_memory_allocation_is_disabled -#elif defined(LZ4_USER_MEMORY_FUNCTIONS) -/* memory management functions can be customized by user project. - * Below functions must exist somewhere in the Project - * and be available at link time */ -void* LZ4_malloc(size_t s); -void* LZ4_calloc(size_t n, size_t s); -void LZ4_free(void* p); -# define ALLOC(s) LZ4_malloc(s) -# define ALLOC_AND_ZERO(s) LZ4_calloc(1,s) -# define FREEMEM(p) LZ4_free(p) -#else -# include /* malloc, calloc, free */ -# define ALLOC(s) malloc(s) -# define ALLOC_AND_ZERO(s) calloc(1,s) -# define FREEMEM(p) free(p) -#endif - -#if ! LZ4_FREESTANDING -# include /* memset, memcpy */ -#endif -#if !defined(LZ4_memset) -# define LZ4_memset(p,v,s) memset((p),(v),(s)) -#endif -#define MEM_INIT(p,v,s) LZ4_memset((p),(v),(s)) - - -/*-************************************ -* Common Constants -**************************************/ -#define MINMATCH 4 - -#define WILDCOPYLENGTH 8 -#define LASTLITERALS 5 /* see ../doc/lz4_Block_format.md#parsing-restrictions */ -#define MFLIMIT 12 /* see ../doc/lz4_Block_format.md#parsing-restrictions */ -#define MATCH_SAFEGUARD_DISTANCE ((2*WILDCOPYLENGTH) - MINMATCH) /* ensure it's possible to write 2 x wildcopyLength without overflowing output buffer */ -#define FASTLOOP_SAFE_DISTANCE 64 -static const int LZ4_minLength = (MFLIMIT+1); - -#define KB *(1 <<10) -#define MB *(1 <<20) -#define GB *(1U<<30) - -#define LZ4_DISTANCE_ABSOLUTE_MAX 65535 -#if (LZ4_DISTANCE_MAX > LZ4_DISTANCE_ABSOLUTE_MAX) /* max supported by LZ4 format */ -# error "LZ4_DISTANCE_MAX is too big : must be <= 65535" -#endif - -#define ML_BITS 4 -#define ML_MASK ((1U<=1) -# include -#else -# ifndef assert -# define assert(condition) ((void)0) -# endif -#endif - -#define LZ4_STATIC_ASSERT(c) { enum { LZ4_static_assert = 1/(int)(!!(c)) }; } /* use after variable declarations */ - -#if defined(LZ4_DEBUG) && (LZ4_DEBUG>=2) -# include - static int g_debuglog_enable = 1; -# define DEBUGLOG(l, ...) { \ - if ((g_debuglog_enable) && (l<=LZ4_DEBUG)) { \ - fprintf(stderr, __FILE__ " %i: ", __LINE__); \ - fprintf(stderr, __VA_ARGS__); \ - fprintf(stderr, " \n"); \ - } } -#else -# define DEBUGLOG(l, ...) {} /* disabled */ -#endif - -static int LZ4_isAligned(const void* ptr, size_t alignment) -{ - return ((size_t)ptr & (alignment -1)) == 0; -} - - -/*-************************************ -* Types -**************************************/ -#include -#if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) -# include - typedef uint8_t BYTE; - typedef uint16_t U16; - typedef uint32_t U32; - typedef int32_t S32; - typedef uint64_t U64; - typedef uintptr_t uptrval; -#else -# if UINT_MAX != 4294967295UL -# error "LZ4 code (when not C++ or C99) assumes that sizeof(int) == 4" -# endif - typedef unsigned char BYTE; - typedef unsigned short U16; - typedef unsigned int U32; - typedef signed int S32; - typedef unsigned long long U64; - typedef size_t uptrval; /* generally true, except OpenVMS-64 */ -#endif - -#if defined(__x86_64__) - typedef U64 reg_t; /* 64-bits in x32 mode */ -#else - typedef size_t reg_t; /* 32-bits in x32 mode */ -#endif - -typedef enum { - notLimited = 0, - limitedOutput = 1, - fillOutput = 2 -} limitedOutput_directive; - - -/*-************************************ -* Reading and writing into memory -**************************************/ - -/** - * LZ4 relies on memcpy with a constant size being inlined. In freestanding - * environments, the compiler can't assume the implementation of memcpy() is - * standard compliant, so it can't apply its specialized memcpy() inlining - * logic. When possible, use __builtin_memcpy() to tell the compiler to analyze - * memcpy() as if it were standard compliant, so it can inline it in freestanding - * environments. This is needed when decompressing the Linux Kernel, for example. - */ -#if !defined(LZ4_memcpy) -# if defined(__GNUC__) && (__GNUC__ >= 4) -# define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size) -# else -# define LZ4_memcpy(dst, src, size) memcpy(dst, src, size) -# endif -#endif - -#if !defined(LZ4_memmove) -# if defined(__GNUC__) && (__GNUC__ >= 4) -# define LZ4_memmove __builtin_memmove -# else -# define LZ4_memmove memmove -# endif -#endif - -static unsigned LZ4_isLittleEndian(void) -{ - const union { U32 u; BYTE c[4]; } one = { 1 }; /* don't use static : performance detrimental */ - return one.c[0]; -} - -#if defined(__GNUC__) || defined(__INTEL_COMPILER) -#define LZ4_PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__)) -#elif defined(_MSC_VER) -#define LZ4_PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop)) -#endif - -#if defined(LZ4_FORCE_MEMORY_ACCESS) && (LZ4_FORCE_MEMORY_ACCESS==2) -/* lie to the compiler about data alignment; use with caution */ - -static U16 LZ4_read16(const void* memPtr) { return *(const U16*) memPtr; } -static U32 LZ4_read32(const void* memPtr) { return *(const U32*) memPtr; } -static reg_t LZ4_read_ARCH(const void* memPtr) { return *(const reg_t*) memPtr; } - -static void LZ4_write16(void* memPtr, U16 value) { *(U16*)memPtr = value; } -static void LZ4_write32(void* memPtr, U32 value) { *(U32*)memPtr = value; } - -#elif defined(LZ4_FORCE_MEMORY_ACCESS) && (LZ4_FORCE_MEMORY_ACCESS==1) - -/* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */ -/* currently only defined for gcc and icc */ -LZ4_PACK(typedef struct { U16 u16; }) LZ4_unalign16; -LZ4_PACK(typedef struct { U32 u32; }) LZ4_unalign32; -LZ4_PACK(typedef struct { reg_t uArch; }) LZ4_unalignST; - -static U16 LZ4_read16(const void* ptr) { return ((const LZ4_unalign16*)ptr)->u16; } -static U32 LZ4_read32(const void* ptr) { return ((const LZ4_unalign32*)ptr)->u32; } -static reg_t LZ4_read_ARCH(const void* ptr) { return ((const LZ4_unalignST*)ptr)->uArch; } - -static void LZ4_write16(void* memPtr, U16 value) { ((LZ4_unalign16*)memPtr)->u16 = value; } -static void LZ4_write32(void* memPtr, U32 value) { ((LZ4_unalign32*)memPtr)->u32 = value; } - -#else /* safe and portable access using memcpy() */ - -static U16 LZ4_read16(const void* memPtr) -{ - U16 val; LZ4_memcpy(&val, memPtr, sizeof(val)); return val; -} - -static U32 LZ4_read32(const void* memPtr) -{ - U32 val; LZ4_memcpy(&val, memPtr, sizeof(val)); return val; -} - -static reg_t LZ4_read_ARCH(const void* memPtr) -{ - reg_t val; LZ4_memcpy(&val, memPtr, sizeof(val)); return val; -} - -static void LZ4_write16(void* memPtr, U16 value) -{ - LZ4_memcpy(memPtr, &value, sizeof(value)); -} - -static void LZ4_write32(void* memPtr, U32 value) -{ - LZ4_memcpy(memPtr, &value, sizeof(value)); -} - -#endif /* LZ4_FORCE_MEMORY_ACCESS */ - - -static U16 LZ4_readLE16(const void* memPtr) -{ - if (LZ4_isLittleEndian()) { - return LZ4_read16(memPtr); - } else { - const BYTE* p = (const BYTE*)memPtr; - return (U16)((U16)p[0] + (p[1]<<8)); - } -} - -static void LZ4_writeLE16(void* memPtr, U16 value) -{ - if (LZ4_isLittleEndian()) { - LZ4_write16(memPtr, value); - } else { - BYTE* p = (BYTE*)memPtr; - p[0] = (BYTE) value; - p[1] = (BYTE)(value>>8); - } -} - -/* customized variant of memcpy, which can overwrite up to 8 bytes beyond dstEnd */ -LZ4_FORCE_INLINE -void LZ4_wildCopy8(void* dstPtr, const void* srcPtr, void* dstEnd) -{ - BYTE* d = (BYTE*)dstPtr; - const BYTE* s = (const BYTE*)srcPtr; - BYTE* const e = (BYTE*)dstEnd; - - do { LZ4_memcpy(d,s,8); d+=8; s+=8; } while (d= 16. */ -LZ4_FORCE_INLINE void -LZ4_wildCopy32(void* dstPtr, const void* srcPtr, void* dstEnd) -{ - BYTE* d = (BYTE*)dstPtr; - const BYTE* s = (const BYTE*)srcPtr; - BYTE* const e = (BYTE*)dstEnd; - - do { LZ4_memcpy(d,s,16); LZ4_memcpy(d+16,s+16,16); d+=32; s+=32; } while (d= dstPtr + MINMATCH - * - there is at least 8 bytes available to write after dstEnd */ -LZ4_FORCE_INLINE void -LZ4_memcpy_using_offset(BYTE* dstPtr, const BYTE* srcPtr, BYTE* dstEnd, const size_t offset) -{ - BYTE v[8]; - - assert(dstEnd >= dstPtr + MINMATCH); - - switch(offset) { - case 1: - MEM_INIT(v, *srcPtr, 8); - break; - case 2: - LZ4_memcpy(v, srcPtr, 2); - LZ4_memcpy(&v[2], srcPtr, 2); -#if defined(_MSC_VER) && (_MSC_VER <= 1937) /* MSVC 2022 ver 17.7 or earlier */ -# pragma warning(push) -# pragma warning(disable : 6385) /* warning C6385: Reading invalid data from 'v'. */ -#endif - LZ4_memcpy(&v[4], v, 4); -#if defined(_MSC_VER) && (_MSC_VER <= 1937) /* MSVC 2022 ver 17.7 or earlier */ -# pragma warning(pop) -#endif - break; - case 4: - LZ4_memcpy(v, srcPtr, 4); - LZ4_memcpy(&v[4], srcPtr, 4); - break; - default: - LZ4_memcpy_using_offset_base(dstPtr, srcPtr, dstEnd, offset); - return; - } - - LZ4_memcpy(dstPtr, v, 8); - dstPtr += 8; - while (dstPtr < dstEnd) { - LZ4_memcpy(dstPtr, v, 8); - dstPtr += 8; - } -} -#endif - - -/*-************************************ -* Common functions -**************************************/ -static unsigned LZ4_NbCommonBytes (reg_t val) -{ - assert(val != 0); - if (LZ4_isLittleEndian()) { - if (sizeof(val) == 8) { -# if defined(_MSC_VER) && (_MSC_VER >= 1800) && (defined(_M_AMD64) && !defined(_M_ARM64EC)) && !defined(LZ4_FORCE_SW_BITCOUNT) -/*-************************************************************************************************* -* ARM64EC is a Microsoft-designed ARM64 ABI compatible with AMD64 applications on ARM64 Windows 11. -* The ARM64EC ABI does not support AVX/AVX2/AVX512 instructions, nor their relevant intrinsics -* including _tzcnt_u64. Therefore, we need to neuter the _tzcnt_u64 code path for ARM64EC. -****************************************************************************************************/ -# if defined(__clang__) && (__clang_major__ < 10) - /* Avoid undefined clang-cl intrinsics issue. - * See https://github.com/lz4/lz4/pull/1017 for details. */ - return (unsigned)__builtin_ia32_tzcnt_u64(val) >> 3; -# else - /* x64 CPUS without BMI support interpret `TZCNT` as `REP BSF` */ - return (unsigned)_tzcnt_u64(val) >> 3; -# endif -# elif defined(_MSC_VER) && defined(_WIN64) && !defined(LZ4_FORCE_SW_BITCOUNT) - unsigned long r = 0; - _BitScanForward64(&r, (U64)val); - return (unsigned)r >> 3; -# elif (defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 3) || \ - ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))) && \ - !defined(LZ4_FORCE_SW_BITCOUNT) - return (unsigned)__builtin_ctzll((U64)val) >> 3; -# else - const U64 m = 0x0101010101010101ULL; - val ^= val - 1; - return (unsigned)(((U64)((val & (m - 1)) * m)) >> 56); -# endif - } else /* 32 bits */ { -# if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(LZ4_FORCE_SW_BITCOUNT) - unsigned long r; - _BitScanForward(&r, (U32)val); - return (unsigned)r >> 3; -# elif (defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 3) || \ - ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))) && \ - !defined(__TINYC__) && !defined(LZ4_FORCE_SW_BITCOUNT) - return (unsigned)__builtin_ctz((U32)val) >> 3; -# else - const U32 m = 0x01010101; - return (unsigned)((((val - 1) ^ val) & (m - 1)) * m) >> 24; -# endif - } - } else /* Big Endian CPU */ { - if (sizeof(val)==8) { -# if (defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 3) || \ - ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))) && \ - !defined(__TINYC__) && !defined(LZ4_FORCE_SW_BITCOUNT) - return (unsigned)__builtin_clzll((U64)val) >> 3; -# else -#if 1 - /* this method is probably faster, - * but adds a 128 bytes lookup table */ - static const unsigned char ctz7_tab[128] = { - 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, - }; - U64 const mask = 0x0101010101010101ULL; - U64 const t = (((val >> 8) - mask) | val) & mask; - return ctz7_tab[(t * 0x0080402010080402ULL) >> 57]; -#else - /* this method doesn't consume memory space like the previous one, - * but it contains several branches, - * that may end up slowing execution */ - static const U32 by32 = sizeof(val)*4; /* 32 on 64 bits (goal), 16 on 32 bits. - Just to avoid some static analyzer complaining about shift by 32 on 32-bits target. - Note that this code path is never triggered in 32-bits mode. */ - unsigned r; - if (!(val>>by32)) { r=4; } else { r=0; val>>=by32; } - if (!(val>>16)) { r+=2; val>>=8; } else { val>>=24; } - r += (!val); - return r; -#endif -# endif - } else /* 32 bits */ { -# if (defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 3) || \ - ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))) && \ - !defined(LZ4_FORCE_SW_BITCOUNT) - return (unsigned)__builtin_clz((U32)val) >> 3; -# else - val >>= 8; - val = ((((val + 0x00FFFF00) | 0x00FFFFFF) + val) | - (val + 0x00FF0000)) >> 24; - return (unsigned)val ^ 3; -# endif - } - } -} - - -#define STEPSIZE sizeof(reg_t) -LZ4_FORCE_INLINE -unsigned LZ4_count(const BYTE* pIn, const BYTE* pMatch, const BYTE* pInLimit) -{ - const BYTE* const pStart = pIn; - - if (likely(pIn < pInLimit-(STEPSIZE-1))) { - reg_t const diff = LZ4_read_ARCH(pMatch) ^ LZ4_read_ARCH(pIn); - if (!diff) { - pIn+=STEPSIZE; pMatch+=STEPSIZE; - } else { - return LZ4_NbCommonBytes(diff); - } } - - while (likely(pIn < pInLimit-(STEPSIZE-1))) { - reg_t const diff = LZ4_read_ARCH(pMatch) ^ LZ4_read_ARCH(pIn); - if (!diff) { pIn+=STEPSIZE; pMatch+=STEPSIZE; continue; } - pIn += LZ4_NbCommonBytes(diff); - return (unsigned)(pIn - pStart); - } - - if ((STEPSIZE==8) && (pIn<(pInLimit-3)) && (LZ4_read32(pMatch) == LZ4_read32(pIn))) { pIn+=4; pMatch+=4; } - if ((pIn<(pInLimit-1)) && (LZ4_read16(pMatch) == LZ4_read16(pIn))) { pIn+=2; pMatch+=2; } - if ((pIn compression run slower on incompressible data */ - - -/*-************************************ -* Local Structures and types -**************************************/ -typedef enum { clearedTable = 0, byPtr, byU32, byU16 } tableType_t; - -/** - * This enum distinguishes several different modes of accessing previous - * content in the stream. - * - * - noDict : There is no preceding content. - * - withPrefix64k : Table entries up to ctx->dictSize before the current blob - * blob being compressed are valid and refer to the preceding - * content (of length ctx->dictSize), which is available - * contiguously preceding in memory the content currently - * being compressed. - * - usingExtDict : Like withPrefix64k, but the preceding content is somewhere - * else in memory, starting at ctx->dictionary with length - * ctx->dictSize. - * - usingDictCtx : Everything concerning the preceding content is - * in a separate context, pointed to by ctx->dictCtx. - * ctx->dictionary, ctx->dictSize, and table entries - * in the current context that refer to positions - * preceding the beginning of the current compression are - * ignored. Instead, ctx->dictCtx->dictionary and ctx->dictCtx - * ->dictSize describe the location and size of the preceding - * content, and matches are found by looking in the ctx - * ->dictCtx->hashTable. - */ -typedef enum { noDict = 0, withPrefix64k, usingExtDict, usingDictCtx } dict_directive; -typedef enum { noDictIssue = 0, dictSmall } dictIssue_directive; - - -/*-************************************ -* Local Utils -**************************************/ -int LZ4_versionNumber (void) { return LZ4_VERSION_NUMBER; } -const char* LZ4_versionString(void) { return LZ4_VERSION_STRING; } -int LZ4_compressBound(int isize) { return LZ4_COMPRESSBOUND(isize); } -int LZ4_sizeofState(void) { return sizeof(LZ4_stream_t); } - - -/*-**************************************** -* Internal Definitions, used only in Tests -*******************************************/ -#if defined (__cplusplus) -extern "C" { -#endif - -int LZ4_compress_forceExtDict (LZ4_stream_t* LZ4_dict, const char* source, char* dest, int srcSize); - -int LZ4_decompress_safe_forceExtDict(const char* source, char* dest, - int compressedSize, int maxOutputSize, - const void* dictStart, size_t dictSize); -int LZ4_decompress_safe_partial_forceExtDict(const char* source, char* dest, - int compressedSize, int targetOutputSize, int dstCapacity, - const void* dictStart, size_t dictSize); -#if defined (__cplusplus) -} -#endif - -/*-****************************** -* Compression functions -********************************/ -LZ4_FORCE_INLINE U32 LZ4_hash4(U32 sequence, tableType_t const tableType) -{ - if (tableType == byU16) - return ((sequence * 2654435761U) >> ((MINMATCH*8)-(LZ4_HASHLOG+1))); - else - return ((sequence * 2654435761U) >> ((MINMATCH*8)-LZ4_HASHLOG)); -} - -LZ4_FORCE_INLINE U32 LZ4_hash5(U64 sequence, tableType_t const tableType) -{ - const U32 hashLog = (tableType == byU16) ? LZ4_HASHLOG+1 : LZ4_HASHLOG; - if (LZ4_isLittleEndian()) { - const U64 prime5bytes = 889523592379ULL; - return (U32)(((sequence << 24) * prime5bytes) >> (64 - hashLog)); - } else { - const U64 prime8bytes = 11400714785074694791ULL; - return (U32)(((sequence >> 24) * prime8bytes) >> (64 - hashLog)); - } -} - -LZ4_FORCE_INLINE U32 LZ4_hashPosition(const void* const p, tableType_t const tableType) -{ - if ((sizeof(reg_t)==8) && (tableType != byU16)) return LZ4_hash5(LZ4_read_ARCH(p), tableType); - return LZ4_hash4(LZ4_read32(p), tableType); -} - -LZ4_FORCE_INLINE void LZ4_clearHash(U32 h, void* tableBase, tableType_t const tableType) -{ - switch (tableType) - { - default: /* fallthrough */ - case clearedTable: { /* illegal! */ assert(0); return; } - case byPtr: { const BYTE** hashTable = (const BYTE**)tableBase; hashTable[h] = NULL; return; } - case byU32: { U32* hashTable = (U32*) tableBase; hashTable[h] = 0; return; } - case byU16: { U16* hashTable = (U16*) tableBase; hashTable[h] = 0; return; } - } -} - -LZ4_FORCE_INLINE void LZ4_putIndexOnHash(U32 idx, U32 h, void* tableBase, tableType_t const tableType) -{ - switch (tableType) - { - default: /* fallthrough */ - case clearedTable: /* fallthrough */ - case byPtr: { /* illegal! */ assert(0); return; } - case byU32: { U32* hashTable = (U32*) tableBase; hashTable[h] = idx; return; } - case byU16: { U16* hashTable = (U16*) tableBase; assert(idx < 65536); hashTable[h] = (U16)idx; return; } - } -} - -/* LZ4_putPosition*() : only used in byPtr mode */ -LZ4_FORCE_INLINE void LZ4_putPositionOnHash(const BYTE* p, U32 h, - void* tableBase, tableType_t const tableType) -{ - const BYTE** const hashTable = (const BYTE**)tableBase; - assert(tableType == byPtr); (void)tableType; - hashTable[h] = p; -} - -LZ4_FORCE_INLINE void LZ4_putPosition(const BYTE* p, void* tableBase, tableType_t tableType) -{ - U32 const h = LZ4_hashPosition(p, tableType); - LZ4_putPositionOnHash(p, h, tableBase, tableType); -} - -/* LZ4_getIndexOnHash() : - * Index of match position registered in hash table. - * hash position must be calculated by using base+index, or dictBase+index. - * Assumption 1 : only valid if tableType == byU32 or byU16. - * Assumption 2 : h is presumed valid (within limits of hash table) - */ -LZ4_FORCE_INLINE U32 LZ4_getIndexOnHash(U32 h, const void* tableBase, tableType_t tableType) -{ - LZ4_STATIC_ASSERT(LZ4_MEMORY_USAGE > 2); - if (tableType == byU32) { - const U32* const hashTable = (const U32*) tableBase; - assert(h < (1U << (LZ4_MEMORY_USAGE-2))); - return hashTable[h]; - } - if (tableType == byU16) { - const U16* const hashTable = (const U16*) tableBase; - assert(h < (1U << (LZ4_MEMORY_USAGE-1))); - return hashTable[h]; - } - assert(0); return 0; /* forbidden case */ -} - -static const BYTE* LZ4_getPositionOnHash(U32 h, const void* tableBase, tableType_t tableType) -{ - assert(tableType == byPtr); (void)tableType; - { const BYTE* const* hashTable = (const BYTE* const*) tableBase; return hashTable[h]; } -} - -LZ4_FORCE_INLINE const BYTE* -LZ4_getPosition(const BYTE* p, - const void* tableBase, tableType_t tableType) -{ - U32 const h = LZ4_hashPosition(p, tableType); - return LZ4_getPositionOnHash(h, tableBase, tableType); -} - -LZ4_FORCE_INLINE void -LZ4_prepareTable(LZ4_stream_t_internal* const cctx, - const int inputSize, - const tableType_t tableType) { - /* If the table hasn't been used, it's guaranteed to be zeroed out, and is - * therefore safe to use no matter what mode we're in. Otherwise, we figure - * out if it's safe to leave as is or whether it needs to be reset. - */ - if ((tableType_t)cctx->tableType != clearedTable) { - assert(inputSize >= 0); - if ((tableType_t)cctx->tableType != tableType - || ((tableType == byU16) && cctx->currentOffset + (unsigned)inputSize >= 0xFFFFU) - || ((tableType == byU32) && cctx->currentOffset > 1 GB) - || tableType == byPtr - || inputSize >= 4 KB) - { - DEBUGLOG(4, "LZ4_prepareTable: Resetting table in %p", cctx); - MEM_INIT(cctx->hashTable, 0, LZ4_HASHTABLESIZE); - cctx->currentOffset = 0; - cctx->tableType = (U32)clearedTable; - } else { - DEBUGLOG(4, "LZ4_prepareTable: Re-use hash table (no reset)"); - } - } - - /* Adding a gap, so all previous entries are > LZ4_DISTANCE_MAX back, - * is faster than compressing without a gap. - * However, compressing with currentOffset == 0 is faster still, - * so we preserve that case. - */ - if (cctx->currentOffset != 0 && tableType == byU32) { - DEBUGLOG(5, "LZ4_prepareTable: adding 64KB to currentOffset"); - cctx->currentOffset += 64 KB; - } - - /* Finally, clear history */ - cctx->dictCtx = NULL; - cctx->dictionary = NULL; - cctx->dictSize = 0; -} - -/** LZ4_compress_generic_validated() : - * inlined, to ensure branches are decided at compilation time. - * The following conditions are presumed already validated: - * - source != NULL - * - inputSize > 0 - */ -LZ4_FORCE_INLINE int LZ4_compress_generic_validated( - LZ4_stream_t_internal* const cctx, - const char* const source, - char* const dest, - const int inputSize, - int* inputConsumed, /* only written when outputDirective == fillOutput */ - const int maxOutputSize, - const limitedOutput_directive outputDirective, - const tableType_t tableType, - const dict_directive dictDirective, - const dictIssue_directive dictIssue, - const int acceleration) -{ - int result; - const BYTE* ip = (const BYTE*)source; - - U32 const startIndex = cctx->currentOffset; - const BYTE* base = (const BYTE*)source - startIndex; - const BYTE* lowLimit; - - const LZ4_stream_t_internal* dictCtx = (const LZ4_stream_t_internal*) cctx->dictCtx; - const BYTE* const dictionary = - dictDirective == usingDictCtx ? dictCtx->dictionary : cctx->dictionary; - const U32 dictSize = - dictDirective == usingDictCtx ? dictCtx->dictSize : cctx->dictSize; - const U32 dictDelta = - (dictDirective == usingDictCtx) ? startIndex - dictCtx->currentOffset : 0; /* make indexes in dictCtx comparable with indexes in current context */ - - int const maybe_extMem = (dictDirective == usingExtDict) || (dictDirective == usingDictCtx); - U32 const prefixIdxLimit = startIndex - dictSize; /* used when dictDirective == dictSmall */ - const BYTE* const dictEnd = dictionary ? dictionary + dictSize : dictionary; - const BYTE* anchor = (const BYTE*) source; - const BYTE* const iend = ip + inputSize; - const BYTE* const mflimitPlusOne = iend - MFLIMIT + 1; - const BYTE* const matchlimit = iend - LASTLITERALS; - - /* the dictCtx currentOffset is indexed on the start of the dictionary, - * while a dictionary in the current context precedes the currentOffset */ - const BYTE* dictBase = (dictionary == NULL) ? NULL : - (dictDirective == usingDictCtx) ? - dictionary + dictSize - dictCtx->currentOffset : - dictionary + dictSize - startIndex; - - BYTE* op = (BYTE*) dest; - BYTE* const olimit = op + maxOutputSize; - - U32 offset = 0; - U32 forwardH; - - DEBUGLOG(5, "LZ4_compress_generic_validated: srcSize=%i, tableType=%u", inputSize, tableType); - assert(ip != NULL); - if (tableType == byU16) assert(inputSize= 1); - - lowLimit = (const BYTE*)source - (dictDirective == withPrefix64k ? dictSize : 0); - - /* Update context state */ - if (dictDirective == usingDictCtx) { - /* Subsequent linked blocks can't use the dictionary. */ - /* Instead, they use the block we just compressed. */ - cctx->dictCtx = NULL; - cctx->dictSize = (U32)inputSize; - } else { - cctx->dictSize += (U32)inputSize; - } - cctx->currentOffset += (U32)inputSize; - cctx->tableType = (U32)tableType; - - if (inputSizehashTable, byPtr); - } else { - LZ4_putIndexOnHash(startIndex, h, cctx->hashTable, tableType); - } } - ip++; forwardH = LZ4_hashPosition(ip, tableType); - - /* Main Loop */ - for ( ; ; ) { - const BYTE* match; - BYTE* token; - const BYTE* filledIp; - - /* Find a match */ - if (tableType == byPtr) { - const BYTE* forwardIp = ip; - int step = 1; - int searchMatchNb = acceleration << LZ4_skipTrigger; - do { - U32 const h = forwardH; - ip = forwardIp; - forwardIp += step; - step = (searchMatchNb++ >> LZ4_skipTrigger); - - if (unlikely(forwardIp > mflimitPlusOne)) goto _last_literals; - assert(ip < mflimitPlusOne); - - match = LZ4_getPositionOnHash(h, cctx->hashTable, tableType); - forwardH = LZ4_hashPosition(forwardIp, tableType); - LZ4_putPositionOnHash(ip, h, cctx->hashTable, tableType); - - } while ( (match+LZ4_DISTANCE_MAX < ip) - || (LZ4_read32(match) != LZ4_read32(ip)) ); - - } else { /* byU32, byU16 */ - - const BYTE* forwardIp = ip; - int step = 1; - int searchMatchNb = acceleration << LZ4_skipTrigger; - do { - U32 const h = forwardH; - U32 const current = (U32)(forwardIp - base); - U32 matchIndex = LZ4_getIndexOnHash(h, cctx->hashTable, tableType); - assert(matchIndex <= current); - assert(forwardIp - base < (ptrdiff_t)(2 GB - 1)); - ip = forwardIp; - forwardIp += step; - step = (searchMatchNb++ >> LZ4_skipTrigger); - - if (unlikely(forwardIp > mflimitPlusOne)) goto _last_literals; - assert(ip < mflimitPlusOne); - - if (dictDirective == usingDictCtx) { - if (matchIndex < startIndex) { - /* there was no match, try the dictionary */ - assert(tableType == byU32); - matchIndex = LZ4_getIndexOnHash(h, dictCtx->hashTable, byU32); - match = dictBase + matchIndex; - matchIndex += dictDelta; /* make dictCtx index comparable with current context */ - lowLimit = dictionary; - } else { - match = base + matchIndex; - lowLimit = (const BYTE*)source; - } - } else if (dictDirective == usingExtDict) { - if (matchIndex < startIndex) { - DEBUGLOG(7, "extDict candidate: matchIndex=%5u < startIndex=%5u", matchIndex, startIndex); - assert(startIndex - matchIndex >= MINMATCH); - assert(dictBase); - match = dictBase + matchIndex; - lowLimit = dictionary; - } else { - match = base + matchIndex; - lowLimit = (const BYTE*)source; - } - } else { /* single continuous memory segment */ - match = base + matchIndex; - } - forwardH = LZ4_hashPosition(forwardIp, tableType); - LZ4_putIndexOnHash(current, h, cctx->hashTable, tableType); - - DEBUGLOG(7, "candidate at pos=%u (offset=%u \n", matchIndex, current - matchIndex); - if ((dictIssue == dictSmall) && (matchIndex < prefixIdxLimit)) { continue; } /* match outside of valid area */ - assert(matchIndex < current); - if ( ((tableType != byU16) || (LZ4_DISTANCE_MAX < LZ4_DISTANCE_ABSOLUTE_MAX)) - && (matchIndex+LZ4_DISTANCE_MAX < current)) { - continue; - } /* too far */ - assert((current - matchIndex) <= LZ4_DISTANCE_MAX); /* match now expected within distance */ - - if (LZ4_read32(match) == LZ4_read32(ip)) { - if (maybe_extMem) offset = current - matchIndex; - break; /* match found */ - } - - } while(1); - } - - /* Catch up */ - filledIp = ip; - assert(ip > anchor); /* this is always true as ip has been advanced before entering the main loop */ - if ((match > lowLimit) && unlikely(ip[-1] == match[-1])) { - do { ip--; match--; } while (((ip > anchor) & (match > lowLimit)) && (unlikely(ip[-1] == match[-1]))); - } - - /* Encode Literals */ - { unsigned const litLength = (unsigned)(ip - anchor); - token = op++; - if ((outputDirective == limitedOutput) && /* Check output buffer overflow */ - (unlikely(op + litLength + (2 + 1 + LASTLITERALS) + (litLength/255) > olimit)) ) { - return 0; /* cannot compress within `dst` budget. Stored indexes in hash table are nonetheless fine */ - } - if ((outputDirective == fillOutput) && - (unlikely(op + (litLength+240)/255 /* litlen */ + litLength /* literals */ + 2 /* offset */ + 1 /* token */ + MFLIMIT - MINMATCH /* min last literals so last match is <= end - MFLIMIT */ > olimit))) { - op--; - goto _last_literals; - } - if (litLength >= RUN_MASK) { - int len = (int)(litLength - RUN_MASK); - *token = (RUN_MASK<= 255 ; len-=255) *op++ = 255; - *op++ = (BYTE)len; - } - else *token = (BYTE)(litLength< olimit)) { - /* the match was too close to the end, rewind and go to last literals */ - op = token; - goto _last_literals; - } - - /* Encode Offset */ - if (maybe_extMem) { /* static test */ - DEBUGLOG(6, " with offset=%u (ext if > %i)", offset, (int)(ip - (const BYTE*)source)); - assert(offset <= LZ4_DISTANCE_MAX && offset > 0); - LZ4_writeLE16(op, (U16)offset); op+=2; - } else { - DEBUGLOG(6, " with offset=%u (same segment)", (U32)(ip - match)); - assert(ip-match <= LZ4_DISTANCE_MAX); - LZ4_writeLE16(op, (U16)(ip - match)); op+=2; - } - - /* Encode MatchLength */ - { unsigned matchCode; - - if ( (dictDirective==usingExtDict || dictDirective==usingDictCtx) - && (lowLimit==dictionary) /* match within extDict */ ) { - const BYTE* limit = ip + (dictEnd-match); - assert(dictEnd > match); - if (limit > matchlimit) limit = matchlimit; - matchCode = LZ4_count(ip+MINMATCH, match+MINMATCH, limit); - ip += (size_t)matchCode + MINMATCH; - if (ip==limit) { - unsigned const more = LZ4_count(limit, (const BYTE*)source, matchlimit); - matchCode += more; - ip += more; - } - DEBUGLOG(6, " with matchLength=%u starting in extDict", matchCode+MINMATCH); - } else { - matchCode = LZ4_count(ip+MINMATCH, match+MINMATCH, matchlimit); - ip += (size_t)matchCode + MINMATCH; - DEBUGLOG(6, " with matchLength=%u", matchCode+MINMATCH); - } - - if ((outputDirective) && /* Check output buffer overflow */ - (unlikely(op + (1 + LASTLITERALS) + (matchCode+240)/255 > olimit)) ) { - if (outputDirective == fillOutput) { - /* Match description too long : reduce it */ - U32 newMatchCode = 15 /* in token */ - 1 /* to avoid needing a zero byte */ + ((U32)(olimit - op) - 1 - LASTLITERALS) * 255; - ip -= matchCode - newMatchCode; - assert(newMatchCode < matchCode); - matchCode = newMatchCode; - if (unlikely(ip <= filledIp)) { - /* We have already filled up to filledIp so if ip ends up less than filledIp - * we have positions in the hash table beyond the current position. This is - * a problem if we reuse the hash table. So we have to remove these positions - * from the hash table. - */ - const BYTE* ptr; - DEBUGLOG(5, "Clearing %u positions", (U32)(filledIp - ip)); - for (ptr = ip; ptr <= filledIp; ++ptr) { - U32 const h = LZ4_hashPosition(ptr, tableType); - LZ4_clearHash(h, cctx->hashTable, tableType); - } - } - } else { - assert(outputDirective == limitedOutput); - return 0; /* cannot compress within `dst` budget. Stored indexes in hash table are nonetheless fine */ - } - } - if (matchCode >= ML_MASK) { - *token += ML_MASK; - matchCode -= ML_MASK; - LZ4_write32(op, 0xFFFFFFFF); - while (matchCode >= 4*255) { - op+=4; - LZ4_write32(op, 0xFFFFFFFF); - matchCode -= 4*255; - } - op += matchCode / 255; - *op++ = (BYTE)(matchCode % 255); - } else - *token += (BYTE)(matchCode); - } - /* Ensure we have enough space for the last literals. */ - assert(!(outputDirective == fillOutput && op + 1 + LASTLITERALS > olimit)); - - anchor = ip; - - /* Test end of chunk */ - if (ip >= mflimitPlusOne) break; - - /* Fill table */ - { U32 const h = LZ4_hashPosition(ip-2, tableType); - if (tableType == byPtr) { - LZ4_putPositionOnHash(ip-2, h, cctx->hashTable, byPtr); - } else { - U32 const idx = (U32)((ip-2) - base); - LZ4_putIndexOnHash(idx, h, cctx->hashTable, tableType); - } } - - /* Test next position */ - if (tableType == byPtr) { - - match = LZ4_getPosition(ip, cctx->hashTable, tableType); - LZ4_putPosition(ip, cctx->hashTable, tableType); - if ( (match+LZ4_DISTANCE_MAX >= ip) - && (LZ4_read32(match) == LZ4_read32(ip)) ) - { token=op++; *token=0; goto _next_match; } - - } else { /* byU32, byU16 */ - - U32 const h = LZ4_hashPosition(ip, tableType); - U32 const current = (U32)(ip-base); - U32 matchIndex = LZ4_getIndexOnHash(h, cctx->hashTable, tableType); - assert(matchIndex < current); - if (dictDirective == usingDictCtx) { - if (matchIndex < startIndex) { - /* there was no match, try the dictionary */ - assert(tableType == byU32); - matchIndex = LZ4_getIndexOnHash(h, dictCtx->hashTable, byU32); - match = dictBase + matchIndex; - lowLimit = dictionary; /* required for match length counter */ - matchIndex += dictDelta; - } else { - match = base + matchIndex; - lowLimit = (const BYTE*)source; /* required for match length counter */ - } - } else if (dictDirective==usingExtDict) { - if (matchIndex < startIndex) { - assert(dictBase); - match = dictBase + matchIndex; - lowLimit = dictionary; /* required for match length counter */ - } else { - match = base + matchIndex; - lowLimit = (const BYTE*)source; /* required for match length counter */ - } - } else { /* single memory segment */ - match = base + matchIndex; - } - LZ4_putIndexOnHash(current, h, cctx->hashTable, tableType); - assert(matchIndex < current); - if ( ((dictIssue==dictSmall) ? (matchIndex >= prefixIdxLimit) : 1) - && (((tableType==byU16) && (LZ4_DISTANCE_MAX == LZ4_DISTANCE_ABSOLUTE_MAX)) ? 1 : (matchIndex+LZ4_DISTANCE_MAX >= current)) - && (LZ4_read32(match) == LZ4_read32(ip)) ) { - token=op++; - *token=0; - if (maybe_extMem) offset = current - matchIndex; - DEBUGLOG(6, "seq.start:%i, literals=%u, match.start:%i", - (int)(anchor-(const BYTE*)source), 0, (int)(ip-(const BYTE*)source)); - goto _next_match; - } - } - - /* Prepare next loop */ - forwardH = LZ4_hashPosition(++ip, tableType); - - } - -_last_literals: - /* Encode Last Literals */ - { size_t lastRun = (size_t)(iend - anchor); - if ( (outputDirective) && /* Check output buffer overflow */ - (op + lastRun + 1 + ((lastRun+255-RUN_MASK)/255) > olimit)) { - if (outputDirective == fillOutput) { - /* adapt lastRun to fill 'dst' */ - assert(olimit >= op); - lastRun = (size_t)(olimit-op) - 1/*token*/; - lastRun -= (lastRun + 256 - RUN_MASK) / 256; /*additional length tokens*/ - } else { - assert(outputDirective == limitedOutput); - return 0; /* cannot compress within `dst` budget. Stored indexes in hash table are nonetheless fine */ - } - } - DEBUGLOG(6, "Final literal run : %i literals", (int)lastRun); - if (lastRun >= RUN_MASK) { - size_t accumulator = lastRun - RUN_MASK; - *op++ = RUN_MASK << ML_BITS; - for(; accumulator >= 255 ; accumulator-=255) *op++ = 255; - *op++ = (BYTE) accumulator; - } else { - *op++ = (BYTE)(lastRun< 0); - DEBUGLOG(5, "LZ4_compress_generic: compressed %i bytes into %i bytes", inputSize, result); - return result; -} - -/** LZ4_compress_generic() : - * inlined, to ensure branches are decided at compilation time; - * takes care of src == (NULL, 0) - * and forward the rest to LZ4_compress_generic_validated */ -LZ4_FORCE_INLINE int LZ4_compress_generic( - LZ4_stream_t_internal* const cctx, - const char* const src, - char* const dst, - const int srcSize, - int *inputConsumed, /* only written when outputDirective == fillOutput */ - const int dstCapacity, - const limitedOutput_directive outputDirective, - const tableType_t tableType, - const dict_directive dictDirective, - const dictIssue_directive dictIssue, - const int acceleration) -{ - DEBUGLOG(5, "LZ4_compress_generic: srcSize=%i, dstCapacity=%i", - srcSize, dstCapacity); - - if ((U32)srcSize > (U32)LZ4_MAX_INPUT_SIZE) { return 0; } /* Unsupported srcSize, too large (or negative) */ - if (srcSize == 0) { /* src == NULL supported if srcSize == 0 */ - if (outputDirective != notLimited && dstCapacity <= 0) return 0; /* no output, can't write anything */ - DEBUGLOG(5, "Generating an empty block"); - assert(outputDirective == notLimited || dstCapacity >= 1); - assert(dst != NULL); - dst[0] = 0; - if (outputDirective == fillOutput) { - assert (inputConsumed != NULL); - *inputConsumed = 0; - } - return 1; - } - assert(src != NULL); - - return LZ4_compress_generic_validated(cctx, src, dst, srcSize, - inputConsumed, /* only written into if outputDirective == fillOutput */ - dstCapacity, outputDirective, - tableType, dictDirective, dictIssue, acceleration); -} - - -int LZ4_compress_fast_extState(void* state, const char* source, char* dest, int inputSize, int maxOutputSize, int acceleration) -{ - LZ4_stream_t_internal* const ctx = & LZ4_initStream(state, sizeof(LZ4_stream_t)) -> internal_donotuse; - assert(ctx != NULL); - if (acceleration < 1) acceleration = LZ4_ACCELERATION_DEFAULT; - if (acceleration > LZ4_ACCELERATION_MAX) acceleration = LZ4_ACCELERATION_MAX; - if (maxOutputSize >= LZ4_compressBound(inputSize)) { - if (inputSize < LZ4_64Klimit) { - return LZ4_compress_generic(ctx, source, dest, inputSize, NULL, 0, notLimited, byU16, noDict, noDictIssue, acceleration); - } else { - const tableType_t tableType = ((sizeof(void*)==4) && ((uptrval)source > LZ4_DISTANCE_MAX)) ? byPtr : byU32; - return LZ4_compress_generic(ctx, source, dest, inputSize, NULL, 0, notLimited, tableType, noDict, noDictIssue, acceleration); - } - } else { - if (inputSize < LZ4_64Klimit) { - return LZ4_compress_generic(ctx, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, byU16, noDict, noDictIssue, acceleration); - } else { - const tableType_t tableType = ((sizeof(void*)==4) && ((uptrval)source > LZ4_DISTANCE_MAX)) ? byPtr : byU32; - return LZ4_compress_generic(ctx, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, tableType, noDict, noDictIssue, acceleration); - } - } -} - -/** - * LZ4_compress_fast_extState_fastReset() : - * A variant of LZ4_compress_fast_extState(). - * - * Using this variant avoids an expensive initialization step. It is only safe - * to call if the state buffer is known to be correctly initialized already - * (see comment in lz4.h on LZ4_resetStream_fast() for a definition of - * "correctly initialized"). - */ -int LZ4_compress_fast_extState_fastReset(void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration) -{ - LZ4_stream_t_internal* const ctx = &((LZ4_stream_t*)state)->internal_donotuse; - if (acceleration < 1) acceleration = LZ4_ACCELERATION_DEFAULT; - if (acceleration > LZ4_ACCELERATION_MAX) acceleration = LZ4_ACCELERATION_MAX; - assert(ctx != NULL); - - if (dstCapacity >= LZ4_compressBound(srcSize)) { - if (srcSize < LZ4_64Klimit) { - const tableType_t tableType = byU16; - LZ4_prepareTable(ctx, srcSize, tableType); - if (ctx->currentOffset) { - return LZ4_compress_generic(ctx, src, dst, srcSize, NULL, 0, notLimited, tableType, noDict, dictSmall, acceleration); - } else { - return LZ4_compress_generic(ctx, src, dst, srcSize, NULL, 0, notLimited, tableType, noDict, noDictIssue, acceleration); - } - } else { - const tableType_t tableType = ((sizeof(void*)==4) && ((uptrval)src > LZ4_DISTANCE_MAX)) ? byPtr : byU32; - LZ4_prepareTable(ctx, srcSize, tableType); - return LZ4_compress_generic(ctx, src, dst, srcSize, NULL, 0, notLimited, tableType, noDict, noDictIssue, acceleration); - } - } else { - if (srcSize < LZ4_64Klimit) { - const tableType_t tableType = byU16; - LZ4_prepareTable(ctx, srcSize, tableType); - if (ctx->currentOffset) { - return LZ4_compress_generic(ctx, src, dst, srcSize, NULL, dstCapacity, limitedOutput, tableType, noDict, dictSmall, acceleration); - } else { - return LZ4_compress_generic(ctx, src, dst, srcSize, NULL, dstCapacity, limitedOutput, tableType, noDict, noDictIssue, acceleration); - } - } else { - const tableType_t tableType = ((sizeof(void*)==4) && ((uptrval)src > LZ4_DISTANCE_MAX)) ? byPtr : byU32; - LZ4_prepareTable(ctx, srcSize, tableType); - return LZ4_compress_generic(ctx, src, dst, srcSize, NULL, dstCapacity, limitedOutput, tableType, noDict, noDictIssue, acceleration); - } - } -} - - -int LZ4_compress_fast(const char* src, char* dest, int srcSize, int dstCapacity, int acceleration) -{ - int result; -#if (LZ4_HEAPMODE) - LZ4_stream_t* const ctxPtr = (LZ4_stream_t*)ALLOC(sizeof(LZ4_stream_t)); /* malloc-calloc always properly aligned */ - if (ctxPtr == NULL) return 0; -#else - LZ4_stream_t ctx; - LZ4_stream_t* const ctxPtr = &ctx; -#endif - result = LZ4_compress_fast_extState(ctxPtr, src, dest, srcSize, dstCapacity, acceleration); - -#if (LZ4_HEAPMODE) - FREEMEM(ctxPtr); -#endif - return result; -} - - -int LZ4_compress_default(const char* src, char* dst, int srcSize, int dstCapacity) -{ - return LZ4_compress_fast(src, dst, srcSize, dstCapacity, 1); -} - - -/* Note!: This function leaves the stream in an unclean/broken state! - * It is not safe to subsequently use the same state with a _fastReset() or - * _continue() call without resetting it. */ -static int LZ4_compress_destSize_extState (LZ4_stream_t* state, const char* src, char* dst, int* srcSizePtr, int targetDstSize) -{ - void* const s = LZ4_initStream(state, sizeof (*state)); - assert(s != NULL); (void)s; - - if (targetDstSize >= LZ4_compressBound(*srcSizePtr)) { /* compression success is guaranteed */ - return LZ4_compress_fast_extState(state, src, dst, *srcSizePtr, targetDstSize, 1); - } else { - if (*srcSizePtr < LZ4_64Klimit) { - return LZ4_compress_generic(&state->internal_donotuse, src, dst, *srcSizePtr, srcSizePtr, targetDstSize, fillOutput, byU16, noDict, noDictIssue, 1); - } else { - tableType_t const addrMode = ((sizeof(void*)==4) && ((uptrval)src > LZ4_DISTANCE_MAX)) ? byPtr : byU32; - return LZ4_compress_generic(&state->internal_donotuse, src, dst, *srcSizePtr, srcSizePtr, targetDstSize, fillOutput, addrMode, noDict, noDictIssue, 1); - } } -} - - -int LZ4_compress_destSize(const char* src, char* dst, int* srcSizePtr, int targetDstSize) -{ -#if (LZ4_HEAPMODE) - LZ4_stream_t* const ctx = (LZ4_stream_t*)ALLOC(sizeof(LZ4_stream_t)); /* malloc-calloc always properly aligned */ - if (ctx == NULL) return 0; -#else - LZ4_stream_t ctxBody; - LZ4_stream_t* const ctx = &ctxBody; -#endif - - int result = LZ4_compress_destSize_extState(ctx, src, dst, srcSizePtr, targetDstSize); - -#if (LZ4_HEAPMODE) - FREEMEM(ctx); -#endif - return result; -} - - - -/*-****************************** -* Streaming functions -********************************/ - -#if !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION) -LZ4_stream_t* LZ4_createStream(void) -{ - LZ4_stream_t* const lz4s = (LZ4_stream_t*)ALLOC(sizeof(LZ4_stream_t)); - LZ4_STATIC_ASSERT(sizeof(LZ4_stream_t) >= sizeof(LZ4_stream_t_internal)); - DEBUGLOG(4, "LZ4_createStream %p", lz4s); - if (lz4s == NULL) return NULL; - LZ4_initStream(lz4s, sizeof(*lz4s)); - return lz4s; -} -#endif - -static size_t LZ4_stream_t_alignment(void) -{ -#if LZ4_ALIGN_TEST - typedef struct { char c; LZ4_stream_t t; } t_a; - return sizeof(t_a) - sizeof(LZ4_stream_t); -#else - return 1; /* effectively disabled */ -#endif -} - -LZ4_stream_t* LZ4_initStream (void* buffer, size_t size) -{ - DEBUGLOG(5, "LZ4_initStream"); - if (buffer == NULL) { return NULL; } - if (size < sizeof(LZ4_stream_t)) { return NULL; } - if (!LZ4_isAligned(buffer, LZ4_stream_t_alignment())) return NULL; - MEM_INIT(buffer, 0, sizeof(LZ4_stream_t_internal)); - return (LZ4_stream_t*)buffer; -} - -/* resetStream is now deprecated, - * prefer initStream() which is more general */ -void LZ4_resetStream (LZ4_stream_t* LZ4_stream) -{ - DEBUGLOG(5, "LZ4_resetStream (ctx:%p)", LZ4_stream); - MEM_INIT(LZ4_stream, 0, sizeof(LZ4_stream_t_internal)); -} - -void LZ4_resetStream_fast(LZ4_stream_t* ctx) { - LZ4_prepareTable(&(ctx->internal_donotuse), 0, byU32); -} - -#if !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION) -int LZ4_freeStream (LZ4_stream_t* LZ4_stream) -{ - if (!LZ4_stream) return 0; /* support free on NULL */ - DEBUGLOG(5, "LZ4_freeStream %p", LZ4_stream); - FREEMEM(LZ4_stream); - return (0); -} -#endif - - -#define HASH_UNIT sizeof(reg_t) -int LZ4_loadDict (LZ4_stream_t* LZ4_dict, const char* dictionary, int dictSize) -{ - LZ4_stream_t_internal* const dict = &LZ4_dict->internal_donotuse; - const tableType_t tableType = byU32; - const BYTE* p = (const BYTE*)dictionary; - const BYTE* const dictEnd = p + dictSize; - U32 idx32; - - DEBUGLOG(4, "LZ4_loadDict (%i bytes from %p into %p)", dictSize, dictionary, LZ4_dict); - - /* It's necessary to reset the context, - * and not just continue it with prepareTable() - * to avoid any risk of generating overflowing matchIndex - * when compressing using this dictionary */ - LZ4_resetStream(LZ4_dict); - - /* We always increment the offset by 64 KB, since, if the dict is longer, - * we truncate it to the last 64k, and if it's shorter, we still want to - * advance by a whole window length so we can provide the guarantee that - * there are only valid offsets in the window, which allows an optimization - * in LZ4_compress_fast_continue() where it uses noDictIssue even when the - * dictionary isn't a full 64k. */ - dict->currentOffset += 64 KB; - - if (dictSize < (int)HASH_UNIT) { - return 0; - } - - if ((dictEnd - p) > 64 KB) p = dictEnd - 64 KB; - dict->dictionary = p; - dict->dictSize = (U32)(dictEnd - p); - dict->tableType = (U32)tableType; - idx32 = dict->currentOffset - dict->dictSize; - - while (p <= dictEnd-HASH_UNIT) { - U32 const h = LZ4_hashPosition(p, tableType); - LZ4_putIndexOnHash(idx32, h, dict->hashTable, tableType); - p+=3; idx32+=3; - } - - return (int)dict->dictSize; -} - -void LZ4_attach_dictionary(LZ4_stream_t* workingStream, const LZ4_stream_t* dictionaryStream) -{ - const LZ4_stream_t_internal* dictCtx = (dictionaryStream == NULL) ? NULL : - &(dictionaryStream->internal_donotuse); - - DEBUGLOG(4, "LZ4_attach_dictionary (%p, %p, size %u)", - workingStream, dictionaryStream, - dictCtx != NULL ? dictCtx->dictSize : 0); - - if (dictCtx != NULL) { - /* If the current offset is zero, we will never look in the - * external dictionary context, since there is no value a table - * entry can take that indicate a miss. In that case, we need - * to bump the offset to something non-zero. - */ - if (workingStream->internal_donotuse.currentOffset == 0) { - workingStream->internal_donotuse.currentOffset = 64 KB; - } - - /* Don't actually attach an empty dictionary. - */ - if (dictCtx->dictSize == 0) { - dictCtx = NULL; - } - } - workingStream->internal_donotuse.dictCtx = dictCtx; -} - - -static void LZ4_renormDictT(LZ4_stream_t_internal* LZ4_dict, int nextSize) -{ - assert(nextSize >= 0); - if (LZ4_dict->currentOffset + (unsigned)nextSize > 0x80000000) { /* potential ptrdiff_t overflow (32-bits mode) */ - /* rescale hash table */ - U32 const delta = LZ4_dict->currentOffset - 64 KB; - const BYTE* dictEnd = LZ4_dict->dictionary + LZ4_dict->dictSize; - int i; - DEBUGLOG(4, "LZ4_renormDictT"); - for (i=0; ihashTable[i] < delta) LZ4_dict->hashTable[i]=0; - else LZ4_dict->hashTable[i] -= delta; - } - LZ4_dict->currentOffset = 64 KB; - if (LZ4_dict->dictSize > 64 KB) LZ4_dict->dictSize = 64 KB; - LZ4_dict->dictionary = dictEnd - LZ4_dict->dictSize; - } -} - - -int LZ4_compress_fast_continue (LZ4_stream_t* LZ4_stream, - const char* source, char* dest, - int inputSize, int maxOutputSize, - int acceleration) -{ - const tableType_t tableType = byU32; - LZ4_stream_t_internal* const streamPtr = &LZ4_stream->internal_donotuse; - const char* dictEnd = streamPtr->dictSize ? (const char*)streamPtr->dictionary + streamPtr->dictSize : NULL; - - DEBUGLOG(5, "LZ4_compress_fast_continue (inputSize=%i, dictSize=%u)", inputSize, streamPtr->dictSize); - - LZ4_renormDictT(streamPtr, inputSize); /* fix index overflow */ - if (acceleration < 1) acceleration = LZ4_ACCELERATION_DEFAULT; - if (acceleration > LZ4_ACCELERATION_MAX) acceleration = LZ4_ACCELERATION_MAX; - - /* invalidate tiny dictionaries */ - if ( (streamPtr->dictSize < 4) /* tiny dictionary : not enough for a hash */ - && (dictEnd != source) /* prefix mode */ - && (inputSize > 0) /* tolerance : don't lose history, in case next invocation would use prefix mode */ - && (streamPtr->dictCtx == NULL) /* usingDictCtx */ - ) { - DEBUGLOG(5, "LZ4_compress_fast_continue: dictSize(%u) at addr:%p is too small", streamPtr->dictSize, streamPtr->dictionary); - /* remove dictionary existence from history, to employ faster prefix mode */ - streamPtr->dictSize = 0; - streamPtr->dictionary = (const BYTE*)source; - dictEnd = source; - } - - /* Check overlapping input/dictionary space */ - { const char* const sourceEnd = source + inputSize; - if ((sourceEnd > (const char*)streamPtr->dictionary) && (sourceEnd < dictEnd)) { - streamPtr->dictSize = (U32)(dictEnd - sourceEnd); - if (streamPtr->dictSize > 64 KB) streamPtr->dictSize = 64 KB; - if (streamPtr->dictSize < 4) streamPtr->dictSize = 0; - streamPtr->dictionary = (const BYTE*)dictEnd - streamPtr->dictSize; - } - } - - /* prefix mode : source data follows dictionary */ - if (dictEnd == source) { - if ((streamPtr->dictSize < 64 KB) && (streamPtr->dictSize < streamPtr->currentOffset)) - return LZ4_compress_generic(streamPtr, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, tableType, withPrefix64k, dictSmall, acceleration); - else - return LZ4_compress_generic(streamPtr, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, tableType, withPrefix64k, noDictIssue, acceleration); - } - - /* external dictionary mode */ - { int result; - if (streamPtr->dictCtx) { - /* We depend here on the fact that dictCtx'es (produced by - * LZ4_loadDict) guarantee that their tables contain no references - * to offsets between dictCtx->currentOffset - 64 KB and - * dictCtx->currentOffset - dictCtx->dictSize. This makes it safe - * to use noDictIssue even when the dict isn't a full 64 KB. - */ - if (inputSize > 4 KB) { - /* For compressing large blobs, it is faster to pay the setup - * cost to copy the dictionary's tables into the active context, - * so that the compression loop is only looking into one table. - */ - LZ4_memcpy(streamPtr, streamPtr->dictCtx, sizeof(*streamPtr)); - result = LZ4_compress_generic(streamPtr, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, tableType, usingExtDict, noDictIssue, acceleration); - } else { - result = LZ4_compress_generic(streamPtr, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, tableType, usingDictCtx, noDictIssue, acceleration); - } - } else { /* small data <= 4 KB */ - if ((streamPtr->dictSize < 64 KB) && (streamPtr->dictSize < streamPtr->currentOffset)) { - result = LZ4_compress_generic(streamPtr, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, tableType, usingExtDict, dictSmall, acceleration); - } else { - result = LZ4_compress_generic(streamPtr, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, tableType, usingExtDict, noDictIssue, acceleration); - } - } - streamPtr->dictionary = (const BYTE*)source; - streamPtr->dictSize = (U32)inputSize; - return result; - } -} - - -/* Hidden debug function, to force-test external dictionary mode */ -int LZ4_compress_forceExtDict (LZ4_stream_t* LZ4_dict, const char* source, char* dest, int srcSize) -{ - LZ4_stream_t_internal* const streamPtr = &LZ4_dict->internal_donotuse; - int result; - - LZ4_renormDictT(streamPtr, srcSize); - - if ((streamPtr->dictSize < 64 KB) && (streamPtr->dictSize < streamPtr->currentOffset)) { - result = LZ4_compress_generic(streamPtr, source, dest, srcSize, NULL, 0, notLimited, byU32, usingExtDict, dictSmall, 1); - } else { - result = LZ4_compress_generic(streamPtr, source, dest, srcSize, NULL, 0, notLimited, byU32, usingExtDict, noDictIssue, 1); - } - - streamPtr->dictionary = (const BYTE*)source; - streamPtr->dictSize = (U32)srcSize; - - return result; -} - - -/*! LZ4_saveDict() : - * If previously compressed data block is not guaranteed to remain available at its memory location, - * save it into a safer place (char* safeBuffer). - * Note : no need to call LZ4_loadDict() afterwards, dictionary is immediately usable, - * one can therefore call LZ4_compress_fast_continue() right after. - * @return : saved dictionary size in bytes (necessarily <= dictSize), or 0 if error. - */ -int LZ4_saveDict (LZ4_stream_t* LZ4_dict, char* safeBuffer, int dictSize) -{ - LZ4_stream_t_internal* const dict = &LZ4_dict->internal_donotuse; - - DEBUGLOG(5, "LZ4_saveDict : dictSize=%i, safeBuffer=%p", dictSize, safeBuffer); - - if ((U32)dictSize > 64 KB) { dictSize = 64 KB; } /* useless to define a dictionary > 64 KB */ - if ((U32)dictSize > dict->dictSize) { dictSize = (int)dict->dictSize; } - - if (safeBuffer == NULL) assert(dictSize == 0); - if (dictSize > 0) { - const BYTE* const previousDictEnd = dict->dictionary + dict->dictSize; - assert(dict->dictionary); - LZ4_memmove(safeBuffer, previousDictEnd - dictSize, (size_t)dictSize); - } - - dict->dictionary = (const BYTE*)safeBuffer; - dict->dictSize = (U32)dictSize; - - return dictSize; -} - - - -/*-******************************* - * Decompression functions - ********************************/ - -typedef enum { decode_full_block = 0, partial_decode = 1 } earlyEnd_directive; - -#undef MIN -#define MIN(a,b) ( (a) < (b) ? (a) : (b) ) - - -/* variant for decompress_unsafe() - * does not know end of input - * presumes input is well formed - * note : will consume at least one byte */ -static size_t read_long_length_no_check(const BYTE** pp) -{ - size_t b, l = 0; - do { b = **pp; (*pp)++; l += b; } while (b==255); - DEBUGLOG(6, "read_long_length_no_check: +length=%zu using %zu input bytes", l, l/255 + 1) - return l; -} - -/* core decoder variant for LZ4_decompress_fast*() - * for legacy support only : these entry points are deprecated. - * - Presumes input is correctly formed (no defense vs malformed inputs) - * - Does not know input size (presume input buffer is "large enough") - * - Decompress a full block (only) - * @return : nb of bytes read from input. - * Note : this variant is not optimized for speed, just for maintenance. - * the goal is to remove support of decompress_fast*() variants by v2.0 -**/ -LZ4_FORCE_INLINE int -LZ4_decompress_unsafe_generic( - const BYTE* const istart, - BYTE* const ostart, - int decompressedSize, - - size_t prefixSize, - const BYTE* const dictStart, /* only if dict==usingExtDict */ - const size_t dictSize /* note: =0 if dictStart==NULL */ - ) -{ - const BYTE* ip = istart; - BYTE* op = (BYTE*)ostart; - BYTE* const oend = ostart + decompressedSize; - const BYTE* const prefixStart = ostart - prefixSize; - - DEBUGLOG(5, "LZ4_decompress_unsafe_generic"); - if (dictStart == NULL) assert(dictSize == 0); - - while (1) { - /* start new sequence */ - unsigned token = *ip++; - - /* literals */ - { size_t ll = token >> ML_BITS; - if (ll==15) { - /* long literal length */ - ll += read_long_length_no_check(&ip); - } - if ((size_t)(oend-op) < ll) return -1; /* output buffer overflow */ - LZ4_memmove(op, ip, ll); /* support in-place decompression */ - op += ll; - ip += ll; - if ((size_t)(oend-op) < MFLIMIT) { - if (op==oend) break; /* end of block */ - DEBUGLOG(5, "invalid: literals end at distance %zi from end of block", oend-op); - /* incorrect end of block : - * last match must start at least MFLIMIT==12 bytes before end of output block */ - return -1; - } } - - /* match */ - { size_t ml = token & 15; - size_t const offset = LZ4_readLE16(ip); - ip+=2; - - if (ml==15) { - /* long literal length */ - ml += read_long_length_no_check(&ip); - } - ml += MINMATCH; - - if ((size_t)(oend-op) < ml) return -1; /* output buffer overflow */ - - { const BYTE* match = op - offset; - - /* out of range */ - if (offset > (size_t)(op - prefixStart) + dictSize) { - DEBUGLOG(6, "offset out of range"); - return -1; - } - - /* check special case : extDict */ - if (offset > (size_t)(op - prefixStart)) { - /* extDict scenario */ - const BYTE* const dictEnd = dictStart + dictSize; - const BYTE* extMatch = dictEnd - (offset - (size_t)(op-prefixStart)); - size_t const extml = (size_t)(dictEnd - extMatch); - if (extml > ml) { - /* match entirely within extDict */ - LZ4_memmove(op, extMatch, ml); - op += ml; - ml = 0; - } else { - /* match split between extDict & prefix */ - LZ4_memmove(op, extMatch, extml); - op += extml; - ml -= extml; - } - match = prefixStart; - } - - /* match copy - slow variant, supporting overlap copy */ - { size_t u; - for (u=0; u= ipmax before start of loop. Returns initial_error if so. - * @error (output) - error code. Must be set to 0 before call. -**/ -typedef size_t Rvl_t; -static const Rvl_t rvl_error = (Rvl_t)(-1); -LZ4_FORCE_INLINE Rvl_t -read_variable_length(const BYTE** ip, const BYTE* ilimit, - int initial_check) -{ - Rvl_t s, length = 0; - assert(ip != NULL); - assert(*ip != NULL); - assert(ilimit != NULL); - if (initial_check && unlikely((*ip) >= ilimit)) { /* read limit reached */ - return rvl_error; - } - do { - s = **ip; - (*ip)++; - length += s; - if (unlikely((*ip) > ilimit)) { /* read limit reached */ - return rvl_error; - } - /* accumulator overflow detection (32-bit mode only) */ - if ((sizeof(length)<8) && unlikely(length > ((Rvl_t)(-1)/2)) ) { - return rvl_error; - } - } while (s==255); - - return length; -} - -/*! LZ4_decompress_generic() : - * This generic decompression function covers all use cases. - * It shall be instantiated several times, using different sets of directives. - * Note that it is important for performance that this function really get inlined, - * in order to remove useless branches during compilation optimization. - */ -LZ4_FORCE_INLINE int -LZ4_decompress_generic( - const char* const src, - char* const dst, - int srcSize, - int outputSize, /* If endOnInput==endOnInputSize, this value is `dstCapacity` */ - - earlyEnd_directive partialDecoding, /* full, partial */ - dict_directive dict, /* noDict, withPrefix64k, usingExtDict */ - const BYTE* const lowPrefix, /* always <= dst, == dst when no prefix */ - const BYTE* const dictStart, /* only if dict==usingExtDict */ - const size_t dictSize /* note : = 0 if noDict */ - ) -{ - if ((src == NULL) || (outputSize < 0)) { return -1; } - - { const BYTE* ip = (const BYTE*) src; - const BYTE* const iend = ip + srcSize; - - BYTE* op = (BYTE*) dst; - BYTE* const oend = op + outputSize; - BYTE* cpy; - - const BYTE* const dictEnd = (dictStart == NULL) ? NULL : dictStart + dictSize; - - const int checkOffset = (dictSize < (int)(64 KB)); - - - /* Set up the "end" pointers for the shortcut. */ - const BYTE* const shortiend = iend - 14 /*maxLL*/ - 2 /*offset*/; - const BYTE* const shortoend = oend - 14 /*maxLL*/ - 18 /*maxML*/; - - const BYTE* match; - size_t offset; - unsigned token; - size_t length; - - - DEBUGLOG(5, "LZ4_decompress_generic (srcSize:%i, dstSize:%i)", srcSize, outputSize); - - /* Special cases */ - assert(lowPrefix <= op); - if (unlikely(outputSize==0)) { - /* Empty output buffer */ - if (partialDecoding) return 0; - return ((srcSize==1) && (*ip==0)) ? 0 : -1; - } - if (unlikely(srcSize==0)) { return -1; } - - /* LZ4_FAST_DEC_LOOP: - * designed for modern OoO performance cpus, - * where copying reliably 32-bytes is preferable to an unpredictable branch. - * note : fast loop may show a regression for some client arm chips. */ -#if LZ4_FAST_DEC_LOOP - if ((oend - op) < FASTLOOP_SAFE_DISTANCE) { - DEBUGLOG(6, "skip fast decode loop"); - goto safe_decode; - } - - /* Fast loop : decode sequences as long as output < oend-FASTLOOP_SAFE_DISTANCE */ - DEBUGLOG(6, "using fast decode loop"); - while (1) { - /* Main fastloop assertion: We can always wildcopy FASTLOOP_SAFE_DISTANCE */ - assert(oend - op >= FASTLOOP_SAFE_DISTANCE); - assert(ip < iend); - token = *ip++; - length = token >> ML_BITS; /* literal length */ - - /* decode literal length */ - if (length == RUN_MASK) { - size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1); - if (addl == rvl_error) { - DEBUGLOG(6, "error reading long literal length"); - goto _output_error; - } - length += addl; - if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */ - if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { goto _output_error; } /* overflow detection */ - - /* copy literals */ - LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH); - if ((op+length>oend-32) || (ip+length>iend-32)) { goto safe_literal_copy; } - LZ4_wildCopy32(op, ip, op+length); - ip += length; op += length; - } else if (ip <= iend-(16 + 1/*max lit + offset + nextToken*/)) { - /* We don't need to check oend, since we check it once for each loop below */ - DEBUGLOG(7, "copy %u bytes in a 16-bytes stripe", (unsigned)length); - /* Literals can only be <= 14, but hope compilers optimize better when copy by a register size */ - LZ4_memcpy(op, ip, 16); - ip += length; op += length; - } else { - goto safe_literal_copy; - } - - /* get offset */ - offset = LZ4_readLE16(ip); ip+=2; - DEBUGLOG(6, " offset = %zu", offset); - match = op - offset; - assert(match <= op); /* overflow check */ - - /* get matchlength */ - length = token & ML_MASK; - - if (length == ML_MASK) { - size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0); - if (addl == rvl_error) { - DEBUGLOG(6, "error reading long match length"); - goto _output_error; - } - length += addl; - length += MINMATCH; - if (unlikely((uptrval)(op)+length<(uptrval)op)) { goto _output_error; } /* overflow detection */ - if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) { - goto safe_match_copy; - } - } else { - length += MINMATCH; - if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) { - goto safe_match_copy; - } - - /* Fastpath check: skip LZ4_wildCopy32 when true */ - if ((dict == withPrefix64k) || (match >= lowPrefix)) { - if (offset >= 8) { - assert(match >= lowPrefix); - assert(match <= op); - assert(op + 18 <= oend); - - LZ4_memcpy(op, match, 8); - LZ4_memcpy(op+8, match+8, 8); - LZ4_memcpy(op+16, match+16, 2); - op += length; - continue; - } } } - - if ( checkOffset && (unlikely(match + dictSize < lowPrefix)) ) { - DEBUGLOG(6, "Error : pos=%zi, offset=%zi => outside buffers", op-lowPrefix, op-match); - goto _output_error; - } - /* match starting within external dictionary */ - if ((dict==usingExtDict) && (match < lowPrefix)) { - assert(dictEnd != NULL); - if (unlikely(op+length > oend-LASTLITERALS)) { - if (partialDecoding) { - DEBUGLOG(7, "partialDecoding: dictionary match, close to dstEnd"); - length = MIN(length, (size_t)(oend-op)); - } else { - DEBUGLOG(6, "end-of-block condition violated") - goto _output_error; - } } - - if (length <= (size_t)(lowPrefix-match)) { - /* match fits entirely within external dictionary : just copy */ - LZ4_memmove(op, dictEnd - (lowPrefix-match), length); - op += length; - } else { - /* match stretches into both external dictionary and current block */ - size_t const copySize = (size_t)(lowPrefix - match); - size_t const restSize = length - copySize; - LZ4_memcpy(op, dictEnd - copySize, copySize); - op += copySize; - if (restSize > (size_t)(op - lowPrefix)) { /* overlap copy */ - BYTE* const endOfMatch = op + restSize; - const BYTE* copyFrom = lowPrefix; - while (op < endOfMatch) { *op++ = *copyFrom++; } - } else { - LZ4_memcpy(op, lowPrefix, restSize); - op += restSize; - } } - continue; - } - - /* copy match within block */ - cpy = op + length; - - assert((op <= oend) && (oend-op >= 32)); - if (unlikely(offset<16)) { - LZ4_memcpy_using_offset(op, match, cpy, offset); - } else { - LZ4_wildCopy32(op, match, cpy); - } - - op = cpy; /* wildcopy correction */ - } - safe_decode: -#endif - - /* Main Loop : decode remaining sequences where output < FASTLOOP_SAFE_DISTANCE */ - DEBUGLOG(6, "using safe decode loop"); - while (1) { - assert(ip < iend); - token = *ip++; - length = token >> ML_BITS; /* literal length */ - - /* A two-stage shortcut for the most common case: - * 1) If the literal length is 0..14, and there is enough space, - * enter the shortcut and copy 16 bytes on behalf of the literals - * (in the fast mode, only 8 bytes can be safely copied this way). - * 2) Further if the match length is 4..18, copy 18 bytes in a similar - * manner; but we ensure that there's enough space in the output for - * those 18 bytes earlier, upon entering the shortcut (in other words, - * there is a combined check for both stages). - */ - if ( (length != RUN_MASK) - /* strictly "less than" on input, to re-enter the loop with at least one byte */ - && likely((ip < shortiend) & (op <= shortoend)) ) { - /* Copy the literals */ - LZ4_memcpy(op, ip, 16); - op += length; ip += length; - - /* The second stage: prepare for match copying, decode full info. - * If it doesn't work out, the info won't be wasted. */ - length = token & ML_MASK; /* match length */ - offset = LZ4_readLE16(ip); ip += 2; - match = op - offset; - assert(match <= op); /* check overflow */ - - /* Do not deal with overlapping matches. */ - if ( (length != ML_MASK) - && (offset >= 8) - && (dict==withPrefix64k || match >= lowPrefix) ) { - /* Copy the match. */ - LZ4_memcpy(op + 0, match + 0, 8); - LZ4_memcpy(op + 8, match + 8, 8); - LZ4_memcpy(op +16, match +16, 2); - op += length + MINMATCH; - /* Both stages worked, load the next token. */ - continue; - } - - /* The second stage didn't work out, but the info is ready. - * Propel it right to the point of match copying. */ - goto _copy_match; - } - - /* decode literal length */ - if (length == RUN_MASK) { - size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1); - if (addl == rvl_error) { goto _output_error; } - length += addl; - if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */ - if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { goto _output_error; } /* overflow detection */ - } - -#if LZ4_FAST_DEC_LOOP - safe_literal_copy: -#endif - /* copy literals */ - cpy = op+length; - - LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH); - if ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) { - /* We've either hit the input parsing restriction or the output parsing restriction. - * In the normal scenario, decoding a full block, it must be the last sequence, - * otherwise it's an error (invalid input or dimensions). - * In partialDecoding scenario, it's necessary to ensure there is no buffer overflow. - */ - if (partialDecoding) { - /* Since we are partial decoding we may be in this block because of the output parsing - * restriction, which is not valid since the output buffer is allowed to be undersized. - */ - DEBUGLOG(7, "partialDecoding: copying literals, close to input or output end") - DEBUGLOG(7, "partialDecoding: literal length = %u", (unsigned)length); - DEBUGLOG(7, "partialDecoding: remaining space in dstBuffer : %i", (int)(oend - op)); - DEBUGLOG(7, "partialDecoding: remaining space in srcBuffer : %i", (int)(iend - ip)); - /* Finishing in the middle of a literals segment, - * due to lack of input. - */ - if (ip+length > iend) { - length = (size_t)(iend-ip); - cpy = op + length; - } - /* Finishing in the middle of a literals segment, - * due to lack of output space. - */ - if (cpy > oend) { - cpy = oend; - assert(op<=oend); - length = (size_t)(oend-op); - } - } else { - /* We must be on the last sequence (or invalid) because of the parsing limitations - * so check that we exactly consume the input and don't overrun the output buffer. - */ - if ((ip+length != iend) || (cpy > oend)) { - DEBUGLOG(6, "should have been last run of literals") - DEBUGLOG(6, "ip(%p) + length(%i) = %p != iend (%p)", ip, (int)length, ip+length, iend); - DEBUGLOG(6, "or cpy(%p) > oend(%p)", cpy, oend); - goto _output_error; - } - } - LZ4_memmove(op, ip, length); /* supports overlapping memory regions, for in-place decompression scenarios */ - ip += length; - op += length; - /* Necessarily EOF when !partialDecoding. - * When partialDecoding, it is EOF if we've either - * filled the output buffer or - * can't proceed with reading an offset for following match. - */ - if (!partialDecoding || (cpy == oend) || (ip >= (iend-2))) { - break; - } - } else { - LZ4_wildCopy8(op, ip, cpy); /* can overwrite up to 8 bytes beyond cpy */ - ip += length; op = cpy; - } - - /* get offset */ - offset = LZ4_readLE16(ip); ip+=2; - match = op - offset; - - /* get matchlength */ - length = token & ML_MASK; - - _copy_match: - if (length == ML_MASK) { - size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0); - if (addl == rvl_error) { goto _output_error; } - length += addl; - if (unlikely((uptrval)(op)+length<(uptrval)op)) goto _output_error; /* overflow detection */ - } - length += MINMATCH; - -#if LZ4_FAST_DEC_LOOP - safe_match_copy: -#endif - if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) goto _output_error; /* Error : offset outside buffers */ - /* match starting within external dictionary */ - if ((dict==usingExtDict) && (match < lowPrefix)) { - assert(dictEnd != NULL); - if (unlikely(op+length > oend-LASTLITERALS)) { - if (partialDecoding) length = MIN(length, (size_t)(oend-op)); - else goto _output_error; /* doesn't respect parsing restriction */ - } - - if (length <= (size_t)(lowPrefix-match)) { - /* match fits entirely within external dictionary : just copy */ - LZ4_memmove(op, dictEnd - (lowPrefix-match), length); - op += length; - } else { - /* match stretches into both external dictionary and current block */ - size_t const copySize = (size_t)(lowPrefix - match); - size_t const restSize = length - copySize; - LZ4_memcpy(op, dictEnd - copySize, copySize); - op += copySize; - if (restSize > (size_t)(op - lowPrefix)) { /* overlap copy */ - BYTE* const endOfMatch = op + restSize; - const BYTE* copyFrom = lowPrefix; - while (op < endOfMatch) *op++ = *copyFrom++; - } else { - LZ4_memcpy(op, lowPrefix, restSize); - op += restSize; - } } - continue; - } - assert(match >= lowPrefix); - - /* copy match within block */ - cpy = op + length; - - /* partialDecoding : may end anywhere within the block */ - assert(op<=oend); - if (partialDecoding && (cpy > oend-MATCH_SAFEGUARD_DISTANCE)) { - size_t const mlen = MIN(length, (size_t)(oend-op)); - const BYTE* const matchEnd = match + mlen; - BYTE* const copyEnd = op + mlen; - if (matchEnd > op) { /* overlap copy */ - while (op < copyEnd) { *op++ = *match++; } - } else { - LZ4_memcpy(op, match, mlen); - } - op = copyEnd; - if (op == oend) { break; } - continue; - } - - if (unlikely(offset<8)) { - LZ4_write32(op, 0); /* silence msan warning when offset==0 */ - op[0] = match[0]; - op[1] = match[1]; - op[2] = match[2]; - op[3] = match[3]; - match += inc32table[offset]; - LZ4_memcpy(op+4, match, 4); - match -= dec64table[offset]; - } else { - LZ4_memcpy(op, match, 8); - match += 8; - } - op += 8; - - if (unlikely(cpy > oend-MATCH_SAFEGUARD_DISTANCE)) { - BYTE* const oCopyLimit = oend - (WILDCOPYLENGTH-1); - if (cpy > oend-LASTLITERALS) { goto _output_error; } /* Error : last LASTLITERALS bytes must be literals (uncompressed) */ - if (op < oCopyLimit) { - LZ4_wildCopy8(op, match, oCopyLimit); - match += oCopyLimit - op; - op = oCopyLimit; - } - while (op < cpy) { *op++ = *match++; } - } else { - LZ4_memcpy(op, match, 8); - if (length > 16) { LZ4_wildCopy8(op+8, match+8, cpy); } - } - op = cpy; /* wildcopy correction */ - } - - /* end of decoding */ - DEBUGLOG(5, "decoded %i bytes", (int) (((char*)op)-dst)); - return (int) (((char*)op)-dst); /* Nb of output bytes decoded */ - - /* Overflow error detected */ - _output_error: - return (int) (-(((const char*)ip)-src))-1; - } -} - - -/*===== Instantiate the API decoding functions. =====*/ - -LZ4_FORCE_O2 -int LZ4_decompress_safe(const char* source, char* dest, int compressedSize, int maxDecompressedSize) -{ - return LZ4_decompress_generic(source, dest, compressedSize, maxDecompressedSize, - decode_full_block, noDict, - (BYTE*)dest, NULL, 0); -} - -LZ4_FORCE_O2 -int LZ4_decompress_safe_partial(const char* src, char* dst, int compressedSize, int targetOutputSize, int dstCapacity) -{ - dstCapacity = MIN(targetOutputSize, dstCapacity); - return LZ4_decompress_generic(src, dst, compressedSize, dstCapacity, - partial_decode, - noDict, (BYTE*)dst, NULL, 0); -} - -LZ4_FORCE_O2 -int LZ4_decompress_fast(const char* source, char* dest, int originalSize) -{ - DEBUGLOG(5, "LZ4_decompress_fast"); - return LZ4_decompress_unsafe_generic( - (const BYTE*)source, (BYTE*)dest, originalSize, - 0, NULL, 0); -} - -/*===== Instantiate a few more decoding cases, used more than once. =====*/ - -LZ4_FORCE_O2 /* Exported, an obsolete API function. */ -int LZ4_decompress_safe_withPrefix64k(const char* source, char* dest, int compressedSize, int maxOutputSize) -{ - return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, - decode_full_block, withPrefix64k, - (BYTE*)dest - 64 KB, NULL, 0); -} - -LZ4_FORCE_O2 -static int LZ4_decompress_safe_partial_withPrefix64k(const char* source, char* dest, int compressedSize, int targetOutputSize, int dstCapacity) -{ - dstCapacity = MIN(targetOutputSize, dstCapacity); - return LZ4_decompress_generic(source, dest, compressedSize, dstCapacity, - partial_decode, withPrefix64k, - (BYTE*)dest - 64 KB, NULL, 0); -} - -/* Another obsolete API function, paired with the previous one. */ -int LZ4_decompress_fast_withPrefix64k(const char* source, char* dest, int originalSize) -{ - return LZ4_decompress_unsafe_generic( - (const BYTE*)source, (BYTE*)dest, originalSize, - 64 KB, NULL, 0); -} - -LZ4_FORCE_O2 -static int LZ4_decompress_safe_withSmallPrefix(const char* source, char* dest, int compressedSize, int maxOutputSize, - size_t prefixSize) -{ - return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, - decode_full_block, noDict, - (BYTE*)dest-prefixSize, NULL, 0); -} - -LZ4_FORCE_O2 -static int LZ4_decompress_safe_partial_withSmallPrefix(const char* source, char* dest, int compressedSize, int targetOutputSize, int dstCapacity, - size_t prefixSize) -{ - dstCapacity = MIN(targetOutputSize, dstCapacity); - return LZ4_decompress_generic(source, dest, compressedSize, dstCapacity, - partial_decode, noDict, - (BYTE*)dest-prefixSize, NULL, 0); -} - -LZ4_FORCE_O2 -int LZ4_decompress_safe_forceExtDict(const char* source, char* dest, - int compressedSize, int maxOutputSize, - const void* dictStart, size_t dictSize) -{ - DEBUGLOG(5, "LZ4_decompress_safe_forceExtDict"); - return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, - decode_full_block, usingExtDict, - (BYTE*)dest, (const BYTE*)dictStart, dictSize); -} - -LZ4_FORCE_O2 -int LZ4_decompress_safe_partial_forceExtDict(const char* source, char* dest, - int compressedSize, int targetOutputSize, int dstCapacity, - const void* dictStart, size_t dictSize) -{ - dstCapacity = MIN(targetOutputSize, dstCapacity); - return LZ4_decompress_generic(source, dest, compressedSize, dstCapacity, - partial_decode, usingExtDict, - (BYTE*)dest, (const BYTE*)dictStart, dictSize); -} - -LZ4_FORCE_O2 -static int LZ4_decompress_fast_extDict(const char* source, char* dest, int originalSize, - const void* dictStart, size_t dictSize) -{ - return LZ4_decompress_unsafe_generic( - (const BYTE*)source, (BYTE*)dest, originalSize, - 0, (const BYTE*)dictStart, dictSize); -} - -/* The "double dictionary" mode, for use with e.g. ring buffers: the first part - * of the dictionary is passed as prefix, and the second via dictStart + dictSize. - * These routines are used only once, in LZ4_decompress_*_continue(). - */ -LZ4_FORCE_INLINE -int LZ4_decompress_safe_doubleDict(const char* source, char* dest, int compressedSize, int maxOutputSize, - size_t prefixSize, const void* dictStart, size_t dictSize) -{ - return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, - decode_full_block, usingExtDict, - (BYTE*)dest-prefixSize, (const BYTE*)dictStart, dictSize); -} - -/*===== streaming decompression functions =====*/ - -#if !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION) -LZ4_streamDecode_t* LZ4_createStreamDecode(void) -{ - LZ4_STATIC_ASSERT(sizeof(LZ4_streamDecode_t) >= sizeof(LZ4_streamDecode_t_internal)); - return (LZ4_streamDecode_t*) ALLOC_AND_ZERO(sizeof(LZ4_streamDecode_t)); -} - -int LZ4_freeStreamDecode (LZ4_streamDecode_t* LZ4_stream) -{ - if (LZ4_stream == NULL) { return 0; } /* support free on NULL */ - FREEMEM(LZ4_stream); - return 0; -} -#endif - -/*! LZ4_setStreamDecode() : - * Use this function to instruct where to find the dictionary. - * This function is not necessary if previous data is still available where it was decoded. - * Loading a size of 0 is allowed (same effect as no dictionary). - * @return : 1 if OK, 0 if error - */ -int LZ4_setStreamDecode (LZ4_streamDecode_t* LZ4_streamDecode, const char* dictionary, int dictSize) -{ - LZ4_streamDecode_t_internal* lz4sd = &LZ4_streamDecode->internal_donotuse; - lz4sd->prefixSize = (size_t)dictSize; - if (dictSize) { - assert(dictionary != NULL); - lz4sd->prefixEnd = (const BYTE*) dictionary + dictSize; - } else { - lz4sd->prefixEnd = (const BYTE*) dictionary; - } - lz4sd->externalDict = NULL; - lz4sd->extDictSize = 0; - return 1; -} - -/*! LZ4_decoderRingBufferSize() : - * when setting a ring buffer for streaming decompression (optional scenario), - * provides the minimum size of this ring buffer - * to be compatible with any source respecting maxBlockSize condition. - * Note : in a ring buffer scenario, - * blocks are presumed decompressed next to each other. - * When not enough space remains for next block (remainingSize < maxBlockSize), - * decoding resumes from beginning of ring buffer. - * @return : minimum ring buffer size, - * or 0 if there is an error (invalid maxBlockSize). - */ -int LZ4_decoderRingBufferSize(int maxBlockSize) -{ - if (maxBlockSize < 0) return 0; - if (maxBlockSize > LZ4_MAX_INPUT_SIZE) return 0; - if (maxBlockSize < 16) maxBlockSize = 16; - return LZ4_DECODER_RING_BUFFER_SIZE(maxBlockSize); -} - -/* -*_continue() : - These decoding functions allow decompression of multiple blocks in "streaming" mode. - Previously decoded blocks must still be available at the memory position where they were decoded. - If it's not possible, save the relevant part of decoded data into a safe buffer, - and indicate where it stands using LZ4_setStreamDecode() -*/ -LZ4_FORCE_O2 -int LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* source, char* dest, int compressedSize, int maxOutputSize) -{ - LZ4_streamDecode_t_internal* lz4sd = &LZ4_streamDecode->internal_donotuse; - int result; - - if (lz4sd->prefixSize == 0) { - /* The first call, no dictionary yet. */ - assert(lz4sd->extDictSize == 0); - result = LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize); - if (result <= 0) return result; - lz4sd->prefixSize = (size_t)result; - lz4sd->prefixEnd = (BYTE*)dest + result; - } else if (lz4sd->prefixEnd == (BYTE*)dest) { - /* They're rolling the current segment. */ - if (lz4sd->prefixSize >= 64 KB - 1) - result = LZ4_decompress_safe_withPrefix64k(source, dest, compressedSize, maxOutputSize); - else if (lz4sd->extDictSize == 0) - result = LZ4_decompress_safe_withSmallPrefix(source, dest, compressedSize, maxOutputSize, - lz4sd->prefixSize); - else - result = LZ4_decompress_safe_doubleDict(source, dest, compressedSize, maxOutputSize, - lz4sd->prefixSize, lz4sd->externalDict, lz4sd->extDictSize); - if (result <= 0) return result; - lz4sd->prefixSize += (size_t)result; - lz4sd->prefixEnd += result; - } else { - /* The buffer wraps around, or they're switching to another buffer. */ - lz4sd->extDictSize = lz4sd->prefixSize; - lz4sd->externalDict = lz4sd->prefixEnd - lz4sd->extDictSize; - result = LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize, - lz4sd->externalDict, lz4sd->extDictSize); - if (result <= 0) return result; - lz4sd->prefixSize = (size_t)result; - lz4sd->prefixEnd = (BYTE*)dest + result; - } - - return result; -} - -LZ4_FORCE_O2 int -LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, - const char* source, char* dest, int originalSize) -{ - LZ4_streamDecode_t_internal* const lz4sd = - (assert(LZ4_streamDecode!=NULL), &LZ4_streamDecode->internal_donotuse); - int result; - - DEBUGLOG(5, "LZ4_decompress_fast_continue (toDecodeSize=%i)", originalSize); - assert(originalSize >= 0); - - if (lz4sd->prefixSize == 0) { - DEBUGLOG(5, "first invocation : no prefix nor extDict"); - assert(lz4sd->extDictSize == 0); - result = LZ4_decompress_fast(source, dest, originalSize); - if (result <= 0) return result; - lz4sd->prefixSize = (size_t)originalSize; - lz4sd->prefixEnd = (BYTE*)dest + originalSize; - } else if (lz4sd->prefixEnd == (BYTE*)dest) { - DEBUGLOG(5, "continue using existing prefix"); - result = LZ4_decompress_unsafe_generic( - (const BYTE*)source, (BYTE*)dest, originalSize, - lz4sd->prefixSize, - lz4sd->externalDict, lz4sd->extDictSize); - if (result <= 0) return result; - lz4sd->prefixSize += (size_t)originalSize; - lz4sd->prefixEnd += originalSize; - } else { - DEBUGLOG(5, "prefix becomes extDict"); - lz4sd->extDictSize = lz4sd->prefixSize; - lz4sd->externalDict = lz4sd->prefixEnd - lz4sd->extDictSize; - result = LZ4_decompress_fast_extDict(source, dest, originalSize, - lz4sd->externalDict, lz4sd->extDictSize); - if (result <= 0) return result; - lz4sd->prefixSize = (size_t)originalSize; - lz4sd->prefixEnd = (BYTE*)dest + originalSize; - } - - return result; -} - - -/* -Advanced decoding functions : -*_usingDict() : - These decoding functions work the same as "_continue" ones, - the dictionary must be explicitly provided within parameters -*/ - -int LZ4_decompress_safe_usingDict(const char* source, char* dest, int compressedSize, int maxOutputSize, const char* dictStart, int dictSize) -{ - if (dictSize==0) - return LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize); - if (dictStart+dictSize == dest) { - if (dictSize >= 64 KB - 1) { - return LZ4_decompress_safe_withPrefix64k(source, dest, compressedSize, maxOutputSize); - } - assert(dictSize >= 0); - return LZ4_decompress_safe_withSmallPrefix(source, dest, compressedSize, maxOutputSize, (size_t)dictSize); - } - assert(dictSize >= 0); - return LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize, dictStart, (size_t)dictSize); -} - -int LZ4_decompress_safe_partial_usingDict(const char* source, char* dest, int compressedSize, int targetOutputSize, int dstCapacity, const char* dictStart, int dictSize) -{ - if (dictSize==0) - return LZ4_decompress_safe_partial(source, dest, compressedSize, targetOutputSize, dstCapacity); - if (dictStart+dictSize == dest) { - if (dictSize >= 64 KB - 1) { - return LZ4_decompress_safe_partial_withPrefix64k(source, dest, compressedSize, targetOutputSize, dstCapacity); - } - assert(dictSize >= 0); - return LZ4_decompress_safe_partial_withSmallPrefix(source, dest, compressedSize, targetOutputSize, dstCapacity, (size_t)dictSize); - } - assert(dictSize >= 0); - return LZ4_decompress_safe_partial_forceExtDict(source, dest, compressedSize, targetOutputSize, dstCapacity, dictStart, (size_t)dictSize); -} - -int LZ4_decompress_fast_usingDict(const char* source, char* dest, int originalSize, const char* dictStart, int dictSize) -{ - if (dictSize==0 || dictStart+dictSize == dest) - return LZ4_decompress_unsafe_generic( - (const BYTE*)source, (BYTE*)dest, originalSize, - (size_t)dictSize, NULL, 0); - assert(dictSize >= 0); - return LZ4_decompress_fast_extDict(source, dest, originalSize, dictStart, (size_t)dictSize); -} - - -/*=************************************************* -* Obsolete Functions -***************************************************/ -/* obsolete compression functions */ -int LZ4_compress_limitedOutput(const char* source, char* dest, int inputSize, int maxOutputSize) -{ - return LZ4_compress_default(source, dest, inputSize, maxOutputSize); -} -int LZ4_compress(const char* src, char* dest, int srcSize) -{ - return LZ4_compress_default(src, dest, srcSize, LZ4_compressBound(srcSize)); -} -int LZ4_compress_limitedOutput_withState (void* state, const char* src, char* dst, int srcSize, int dstSize) -{ - return LZ4_compress_fast_extState(state, src, dst, srcSize, dstSize, 1); -} -int LZ4_compress_withState (void* state, const char* src, char* dst, int srcSize) -{ - return LZ4_compress_fast_extState(state, src, dst, srcSize, LZ4_compressBound(srcSize), 1); -} -int LZ4_compress_limitedOutput_continue (LZ4_stream_t* LZ4_stream, const char* src, char* dst, int srcSize, int dstCapacity) -{ - return LZ4_compress_fast_continue(LZ4_stream, src, dst, srcSize, dstCapacity, 1); -} -int LZ4_compress_continue (LZ4_stream_t* LZ4_stream, const char* source, char* dest, int inputSize) -{ - return LZ4_compress_fast_continue(LZ4_stream, source, dest, inputSize, LZ4_compressBound(inputSize), 1); -} - -/* -These decompression functions are deprecated and should no longer be used. -They are only provided here for compatibility with older user programs. -- LZ4_uncompress is totally equivalent to LZ4_decompress_fast -- LZ4_uncompress_unknownOutputSize is totally equivalent to LZ4_decompress_safe -*/ -int LZ4_uncompress (const char* source, char* dest, int outputSize) -{ - return LZ4_decompress_fast(source, dest, outputSize); -} -int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize) -{ - return LZ4_decompress_safe(source, dest, isize, maxOutputSize); -} - -/* Obsolete Streaming functions */ - -int LZ4_sizeofStreamState(void) { return sizeof(LZ4_stream_t); } - -int LZ4_resetStreamState(void* state, char* inputBuffer) -{ - (void)inputBuffer; - LZ4_resetStream((LZ4_stream_t*)state); - return 0; -} - -#if !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION) -void* LZ4_create (char* inputBuffer) -{ - (void)inputBuffer; - return LZ4_createStream(); -} -#endif - -char* LZ4_slideInputBuffer (void* state) -{ - /* avoid const char * -> char * conversion warning */ - return (char *)(uptrval)((LZ4_stream_t*)state)->internal_donotuse.dictionary; -} - -#endif /* LZ4_COMMONDEFS_ONLY */ - -#endif /* LV_USE_LZ4_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/lz4/lz4.h b/L3_Middlewares/LVGL/src/libs/lz4/lz4.h deleted file mode 100644 index ce763af..0000000 --- a/L3_Middlewares/LVGL/src/libs/lz4/lz4.h +++ /dev/null @@ -1,877 +0,0 @@ -/* - * LZ4 - Fast LZ compression algorithm - * Header File - * Copyright (C) 2011-2020, Yann Collet. - - BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * 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. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT - OWNER 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. - - You can contact the author at : - - LZ4 homepage : http://www.lz4.org - - LZ4 source repository : https://github.com/lz4/lz4 -*/ - -#include "../../lv_conf_internal.h" -#if LV_USE_LZ4_INTERNAL -#if defined (__cplusplus) -extern "C" { -#endif - -/** - * LVGL's porting - */ -#include "../../lvgl.h" -#define LZ4_FREESTANDING 1 -#define LZ4_memset lv_memset -#define LZ4_memcpy lv_memcpy -#define LZ4_memmove lv_memmove - -#ifndef LZ4_H_2983827168210 -#define LZ4_H_2983827168210 - -/* --- Dependency --- */ -#include /* size_t */ - - -/** - Introduction - - LZ4 is lossless compression algorithm, providing compression speed >500 MB/s per core, - scalable with multi-cores CPU. It features an extremely fast decoder, with speed in - multiple GB/s per core, typically reaching RAM speed limits on multi-core systems. - - The LZ4 compression library provides in-memory compression and decompression functions. - It gives full buffer control to user. - Compression can be done in: - - a single step (described as Simple Functions) - - a single step, reusing a context (described in Advanced Functions) - - unbounded multiple steps (described as Streaming compression) - - lz4.h generates and decodes LZ4-compressed blocks (doc/lz4_Block_format.md). - Decompressing such a compressed block requires additional metadata. - Exact metadata depends on exact decompression function. - For the typical case of LZ4_decompress_safe(), - metadata includes block's compressed size, and maximum bound of decompressed size. - Each application is free to encode and pass such metadata in whichever way it wants. - - lz4.h only handle blocks, it cannot generate Frames. - - Blocks are different from Frames (doc/lz4_Frame_format.md). - Frames bundle both blocks and metadata in a specified manner. - Embedding metadata is required for compressed data to be self-contained and portable. - Frame format is delivered through a companion API, declared in lz4frame.h. - The `lz4` CLI can only manage frames. -*/ - -/*^*************************************************************** -* Export parameters -*****************************************************************/ -/* -* LZ4_DLL_EXPORT : -* Enable exporting of functions when building a Windows DLL -* LZ4LIB_VISIBILITY : -* Control library symbols visibility. -*/ -#ifndef LZ4LIB_VISIBILITY -# if defined(__GNUC__) && (__GNUC__ >= 4) -# define LZ4LIB_VISIBILITY __attribute__ ((visibility ("default"))) -# else -# define LZ4LIB_VISIBILITY -# endif -#endif -#if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) -# define LZ4LIB_API __declspec(dllexport) LZ4LIB_VISIBILITY -#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1) -# define LZ4LIB_API __declspec(dllimport) LZ4LIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/ -#else -# define LZ4LIB_API LZ4LIB_VISIBILITY -#endif - -/*! LZ4_FREESTANDING : - * When this macro is set to 1, it enables "freestanding mode" that is - * suitable for typical freestanding environment which doesn't support - * standard C library. - * - * - LZ4_FREESTANDING is a compile-time switch. - * - It requires the following macros to be defined: - * LZ4_memcpy, LZ4_memmove, LZ4_memset. - * - It only enables LZ4/HC functions which don't use heap. - * All LZ4F_* functions are not supported. - * - See tests/freestanding.c to check its basic setup. - */ -#if defined(LZ4_FREESTANDING) && (LZ4_FREESTANDING == 1) -# define LZ4_HEAPMODE 0 -# define LZ4HC_HEAPMODE 0 -# define LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION 1 -# if !defined(LZ4_memcpy) -# error "LZ4_FREESTANDING requires macro 'LZ4_memcpy'." -# endif -# if !defined(LZ4_memset) -# error "LZ4_FREESTANDING requires macro 'LZ4_memset'." -# endif -# if !defined(LZ4_memmove) -# error "LZ4_FREESTANDING requires macro 'LZ4_memmove'." -# endif -#elif ! defined(LZ4_FREESTANDING) -# define LZ4_FREESTANDING 0 -#endif - - -/*------ Version ------*/ -#define LZ4_VERSION_MAJOR 1 /* for breaking interface changes */ -#define LZ4_VERSION_MINOR 9 /* for new (non-breaking) interface capabilities */ -#define LZ4_VERSION_RELEASE 5 /* for tweaks, bug-fixes, or development */ - -#define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR *100*100 + LZ4_VERSION_MINOR *100 + LZ4_VERSION_RELEASE) - -#define LZ4_LIB_VERSION LZ4_VERSION_MAJOR.LZ4_VERSION_MINOR.LZ4_VERSION_RELEASE -#define LZ4_QUOTE(str) #str -#define LZ4_EXPAND_AND_QUOTE(str) LZ4_QUOTE(str) -#define LZ4_VERSION_STRING LZ4_EXPAND_AND_QUOTE(LZ4_LIB_VERSION) /* requires v1.7.3+ */ - -LZ4LIB_API int LZ4_versionNumber (void); /**< library version number; useful to check dll version; requires v1.3.0+ */ -LZ4LIB_API const char* LZ4_versionString (void); /**< library version string; useful to check dll version; requires v1.7.5+ */ - - -/*-************************************ -* Tuning parameter -**************************************/ -#define LZ4_MEMORY_USAGE_MIN 10 -#define LZ4_MEMORY_USAGE_DEFAULT 14 -#define LZ4_MEMORY_USAGE_MAX 20 - -/*! - * LZ4_MEMORY_USAGE : - * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; ) - * Increasing memory usage improves compression ratio, at the cost of speed. - * Reduced memory usage may improve speed at the cost of ratio, thanks to better cache locality. - * Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache - */ -#ifndef LZ4_MEMORY_USAGE -# define LZ4_MEMORY_USAGE LZ4_MEMORY_USAGE_DEFAULT -#endif - -#if (LZ4_MEMORY_USAGE < LZ4_MEMORY_USAGE_MIN) -# error "LZ4_MEMORY_USAGE is too small !" -#endif - -#if (LZ4_MEMORY_USAGE > LZ4_MEMORY_USAGE_MAX) -# error "LZ4_MEMORY_USAGE is too large !" -#endif - -/*-************************************ -* Simple Functions -**************************************/ -/*! LZ4_compress_default() : - * Compresses 'srcSize' bytes from buffer 'src' - * into already allocated 'dst' buffer of size 'dstCapacity'. - * Compression is guaranteed to succeed if 'dstCapacity' >= LZ4_compressBound(srcSize). - * It also runs faster, so it's a recommended setting. - * If the function cannot compress 'src' into a more limited 'dst' budget, - * compression stops *immediately*, and the function result is zero. - * In which case, 'dst' content is undefined (invalid). - * srcSize : max supported value is LZ4_MAX_INPUT_SIZE. - * dstCapacity : size of buffer 'dst' (which must be already allocated) - * @return : the number of bytes written into buffer 'dst' (necessarily <= dstCapacity) - * or 0 if compression fails - * Note : This function is protected against buffer overflow scenarios (never writes outside 'dst' buffer, nor read outside 'source' buffer). - */ -LZ4LIB_API int LZ4_compress_default(const char* src, char* dst, int srcSize, int dstCapacity); - -/*! LZ4_decompress_safe() : - * @compressedSize : is the exact complete size of the compressed block. - * @dstCapacity : is the size of destination buffer (which must be already allocated), - * is an upper bound of decompressed size. - * @return : the number of bytes decompressed into destination buffer (necessarily <= dstCapacity) - * If destination buffer is not large enough, decoding will stop and output an error code (negative value). - * If the source stream is detected malformed, the function will stop decoding and return a negative result. - * Note 1 : This function is protected against malicious data packets : - * it will never writes outside 'dst' buffer, nor read outside 'source' buffer, - * even if the compressed block is maliciously modified to order the decoder to do these actions. - * In such case, the decoder stops immediately, and considers the compressed block malformed. - * Note 2 : compressedSize and dstCapacity must be provided to the function, the compressed block does not contain them. - * The implementation is free to send / store / derive this information in whichever way is most beneficial. - * If there is a need for a different format which bundles together both compressed data and its metadata, consider looking at lz4frame.h instead. - */ -LZ4LIB_API int LZ4_decompress_safe (const char* src, char* dst, int compressedSize, int dstCapacity); - - -/*-************************************ -* Advanced Functions -**************************************/ -#define LZ4_MAX_INPUT_SIZE 0x7E000000 /* 2 113 929 216 bytes */ -#define LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16) - -/*! LZ4_compressBound() : - Provides the maximum size that LZ4 compression may output in a "worst case" scenario (input data not compressible) - This function is primarily useful for memory allocation purposes (destination buffer size). - Macro LZ4_COMPRESSBOUND() is also provided for compilation-time evaluation (stack memory allocation for example). - Note that LZ4_compress_default() compresses faster when dstCapacity is >= LZ4_compressBound(srcSize) - inputSize : max supported value is LZ4_MAX_INPUT_SIZE - return : maximum output size in a "worst case" scenario - or 0, if input size is incorrect (too large or negative) -*/ -LZ4LIB_API int LZ4_compressBound(int inputSize); - -/*! LZ4_compress_fast() : - Same as LZ4_compress_default(), but allows selection of "acceleration" factor. - The larger the acceleration value, the faster the algorithm, but also the lesser the compression. - It's a trade-off. It can be fine tuned, with each successive value providing roughly +~3% to speed. - An acceleration value of "1" is the same as regular LZ4_compress_default() - Values <= 0 will be replaced by LZ4_ACCELERATION_DEFAULT (currently == 1, see lz4.c). - Values > LZ4_ACCELERATION_MAX will be replaced by LZ4_ACCELERATION_MAX (currently == 65537, see lz4.c). -*/ -LZ4LIB_API int LZ4_compress_fast (const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); - - -/*! LZ4_compress_fast_extState() : - * Same as LZ4_compress_fast(), using an externally allocated memory space for its state. - * Use LZ4_sizeofState() to know how much memory must be allocated, - * and allocate it on 8-bytes boundaries (using `malloc()` typically). - * Then, provide this buffer as `void* state` to compression function. - */ -LZ4LIB_API int LZ4_sizeofState(void); -LZ4LIB_API int LZ4_compress_fast_extState (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); - - -/*! LZ4_compress_destSize() : - * Reverse the logic : compresses as much data as possible from 'src' buffer - * into already allocated buffer 'dst', of size >= 'targetDestSize'. - * This function either compresses the entire 'src' content into 'dst' if it's large enough, - * or fill 'dst' buffer completely with as much data as possible from 'src'. - * note: acceleration parameter is fixed to "default". - * - * *srcSizePtr : will be modified to indicate how many bytes where read from 'src' to fill 'dst'. - * New value is necessarily <= input value. - * @return : Nb bytes written into 'dst' (necessarily <= targetDestSize) - * or 0 if compression fails. - * - * Note : from v1.8.2 to v1.9.1, this function had a bug (fixed in v1.9.2+): - * the produced compressed content could, in specific circumstances, - * require to be decompressed into a destination buffer larger - * by at least 1 byte than the content to decompress. - * If an application uses `LZ4_compress_destSize()`, - * it's highly recommended to update liblz4 to v1.9.2 or better. - * If this can't be done or ensured, - * the receiving decompression function should provide - * a dstCapacity which is > decompressedSize, by at least 1 byte. - * See https://github.com/lz4/lz4/issues/859 for details - */ -LZ4LIB_API int LZ4_compress_destSize (const char* src, char* dst, int* srcSizePtr, int targetDstSize); - - -/*! LZ4_decompress_safe_partial() : - * Decompress an LZ4 compressed block, of size 'srcSize' at position 'src', - * into destination buffer 'dst' of size 'dstCapacity'. - * Up to 'targetOutputSize' bytes will be decoded. - * The function stops decoding on reaching this objective. - * This can be useful to boost performance - * whenever only the beginning of a block is required. - * - * @return : the number of bytes decoded in `dst` (necessarily <= targetOutputSize) - * If source stream is detected malformed, function returns a negative result. - * - * Note 1 : @return can be < targetOutputSize, if compressed block contains less data. - * - * Note 2 : targetOutputSize must be <= dstCapacity - * - * Note 3 : this function effectively stops decoding on reaching targetOutputSize, - * so dstCapacity is kind of redundant. - * This is because in older versions of this function, - * decoding operation would still write complete sequences. - * Therefore, there was no guarantee that it would stop writing at exactly targetOutputSize, - * it could write more bytes, though only up to dstCapacity. - * Some "margin" used to be required for this operation to work properly. - * Thankfully, this is no longer necessary. - * The function nonetheless keeps the same signature, in an effort to preserve API compatibility. - * - * Note 4 : If srcSize is the exact size of the block, - * then targetOutputSize can be any value, - * including larger than the block's decompressed size. - * The function will, at most, generate block's decompressed size. - * - * Note 5 : If srcSize is _larger_ than block's compressed size, - * then targetOutputSize **MUST** be <= block's decompressed size. - * Otherwise, *silent corruption will occur*. - */ -LZ4LIB_API int LZ4_decompress_safe_partial (const char* src, char* dst, int srcSize, int targetOutputSize, int dstCapacity); - - -/*-********************************************* -* Streaming Compression Functions -***********************************************/ -typedef union LZ4_stream_u LZ4_stream_t; /* incomplete type (defined later) */ - -/** - Note about RC_INVOKED - - - RC_INVOKED is predefined symbol of rc.exe (the resource compiler which is part of MSVC/Visual Studio). - https://docs.microsoft.com/en-us/windows/win32/menurc/predefined-macros - - - Since rc.exe is a legacy compiler, it truncates long symbol (> 30 chars) - and reports warning "RC4011: identifier truncated". - - - To eliminate the warning, we surround long preprocessor symbol with - "#if !defined(RC_INVOKED) ... #endif" block that means - "skip this block when rc.exe is trying to read it". -*/ -#if !defined(RC_INVOKED) /* https://docs.microsoft.com/en-us/windows/win32/menurc/predefined-macros */ -#if !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION) -LZ4LIB_API LZ4_stream_t* LZ4_createStream(void); -LZ4LIB_API int LZ4_freeStream (LZ4_stream_t* streamPtr); -#endif /* !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION) */ -#endif - -/*! LZ4_resetStream_fast() : v1.9.0+ - * Use this to prepare an LZ4_stream_t for a new chain of dependent blocks - * (e.g., LZ4_compress_fast_continue()). - * - * An LZ4_stream_t must be initialized once before usage. - * This is automatically done when created by LZ4_createStream(). - * However, should the LZ4_stream_t be simply declared on stack (for example), - * it's necessary to initialize it first, using LZ4_initStream(). - * - * After init, start any new stream with LZ4_resetStream_fast(). - * A same LZ4_stream_t can be re-used multiple times consecutively - * and compress multiple streams, - * provided that it starts each new stream with LZ4_resetStream_fast(). - * - * LZ4_resetStream_fast() is much faster than LZ4_initStream(), - * but is not compatible with memory regions containing garbage data. - * - * Note: it's only useful to call LZ4_resetStream_fast() - * in the context of streaming compression. - * The *extState* functions perform their own resets. - * Invoking LZ4_resetStream_fast() before is redundant, and even counterproductive. - */ -LZ4LIB_API void LZ4_resetStream_fast (LZ4_stream_t* streamPtr); - -/*! LZ4_loadDict() : - * Use this function to reference a static dictionary into LZ4_stream_t. - * The dictionary must remain available during compression. - * LZ4_loadDict() triggers a reset, so any previous data will be forgotten. - * The same dictionary will have to be loaded on decompression side for successful decoding. - * Dictionary are useful for better compression of small data (KB range). - * While LZ4 accept any input as dictionary, - * results are generally better when using Zstandard's Dictionary Builder. - * Loading a size of 0 is allowed, and is the same as reset. - * @return : loaded dictionary size, in bytes (necessarily <= 64 KB) - */ -LZ4LIB_API int LZ4_loadDict (LZ4_stream_t* streamPtr, const char* dictionary, int dictSize); - -/*! LZ4_compress_fast_continue() : - * Compress 'src' content using data from previously compressed blocks, for better compression ratio. - * 'dst' buffer must be already allocated. - * If dstCapacity >= LZ4_compressBound(srcSize), compression is guaranteed to succeed, and runs faster. - * - * @return : size of compressed block - * or 0 if there is an error (typically, cannot fit into 'dst'). - * - * Note 1 : Each invocation to LZ4_compress_fast_continue() generates a new block. - * Each block has precise boundaries. - * Each block must be decompressed separately, calling LZ4_decompress_*() with relevant metadata. - * It's not possible to append blocks together and expect a single invocation of LZ4_decompress_*() to decompress them together. - * - * Note 2 : The previous 64KB of source data is __assumed__ to remain present, unmodified, at same address in memory ! - * - * Note 3 : When input is structured as a double-buffer, each buffer can have any size, including < 64 KB. - * Make sure that buffers are separated, by at least one byte. - * This construction ensures that each block only depends on previous block. - * - * Note 4 : If input buffer is a ring-buffer, it can have any size, including < 64 KB. - * - * Note 5 : After an error, the stream status is undefined (invalid), it can only be reset or freed. - */ -LZ4LIB_API int LZ4_compress_fast_continue (LZ4_stream_t* streamPtr, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); - -/*! LZ4_saveDict() : - * If last 64KB data cannot be guaranteed to remain available at its current memory location, - * save it into a safer place (char* safeBuffer). - * This is schematically equivalent to a memcpy() followed by LZ4_loadDict(), - * but is much faster, because LZ4_saveDict() doesn't need to rebuild tables. - * @return : saved dictionary size in bytes (necessarily <= maxDictSize), or 0 if error. - */ -LZ4LIB_API int LZ4_saveDict (LZ4_stream_t* streamPtr, char* safeBuffer, int maxDictSize); - - -/*-********************************************** -* Streaming Decompression Functions -* Bufferless synchronous API -************************************************/ -typedef union LZ4_streamDecode_u LZ4_streamDecode_t; /* tracking context */ - -/*! LZ4_createStreamDecode() and LZ4_freeStreamDecode() : - * creation / destruction of streaming decompression tracking context. - * A tracking context can be re-used multiple times. - */ -#if !defined(RC_INVOKED) /* https://docs.microsoft.com/en-us/windows/win32/menurc/predefined-macros */ -#if !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION) -LZ4LIB_API LZ4_streamDecode_t* LZ4_createStreamDecode(void); -LZ4LIB_API int LZ4_freeStreamDecode (LZ4_streamDecode_t* LZ4_stream); -#endif /* !defined(LZ4_STATIC_LINKING_ONLY_DISABLE_MEMORY_ALLOCATION) */ -#endif - -/*! LZ4_setStreamDecode() : - * An LZ4_streamDecode_t context can be allocated once and re-used multiple times. - * Use this function to start decompression of a new stream of blocks. - * A dictionary can optionally be set. Use NULL or size 0 for a reset order. - * Dictionary is presumed stable : it must remain accessible and unmodified during next decompression. - * @return : 1 if OK, 0 if error - */ -LZ4LIB_API int LZ4_setStreamDecode (LZ4_streamDecode_t* LZ4_streamDecode, const char* dictionary, int dictSize); - -/*! LZ4_decoderRingBufferSize() : v1.8.2+ - * Note : in a ring buffer scenario (optional), - * blocks are presumed decompressed next to each other - * up to the moment there is not enough remaining space for next block (remainingSize < maxBlockSize), - * at which stage it resumes from beginning of ring buffer. - * When setting such a ring buffer for streaming decompression, - * provides the minimum size of this ring buffer - * to be compatible with any source respecting maxBlockSize condition. - * @return : minimum ring buffer size, - * or 0 if there is an error (invalid maxBlockSize). - */ -LZ4LIB_API int LZ4_decoderRingBufferSize(int maxBlockSize); -#define LZ4_DECODER_RING_BUFFER_SIZE(maxBlockSize) (65536 + 14 + (maxBlockSize)) /* for static allocation; maxBlockSize presumed valid */ - -/*! LZ4_decompress_safe_continue() : - * This decoding function allows decompression of consecutive blocks in "streaming" mode. - * The difference with the usual independent blocks is that - * new blocks are allowed to find references into former blocks. - * A block is an unsplittable entity, and must be presented entirely to the decompression function. - * LZ4_decompress_safe_continue() only accepts one block at a time. - * It's modeled after `LZ4_decompress_safe()` and behaves similarly. - * - * @LZ4_streamDecode : decompression state, tracking the position in memory of past data - * @compressedSize : exact complete size of one compressed block. - * @dstCapacity : size of destination buffer (which must be already allocated), - * must be an upper bound of decompressed size. - * @return : number of bytes decompressed into destination buffer (necessarily <= dstCapacity) - * If destination buffer is not large enough, decoding will stop and output an error code (negative value). - * If the source stream is detected malformed, the function will stop decoding and return a negative result. - * - * The last 64KB of previously decoded data *must* remain available and unmodified - * at the memory position where they were previously decoded. - * If less than 64KB of data has been decoded, all the data must be present. - * - * Special : if decompression side sets a ring buffer, it must respect one of the following conditions : - * - Decompression buffer size is _at least_ LZ4_decoderRingBufferSize(maxBlockSize). - * maxBlockSize is the maximum size of any single block. It can have any value > 16 bytes. - * In which case, encoding and decoding buffers do not need to be synchronized. - * Actually, data can be produced by any source compliant with LZ4 format specification, and respecting maxBlockSize. - * - Synchronized mode : - * Decompression buffer size is _exactly_ the same as compression buffer size, - * and follows exactly same update rule (block boundaries at same positions), - * and decoding function is provided with exact decompressed size of each block (exception for last block of the stream), - * _then_ decoding & encoding ring buffer can have any size, including small ones ( < 64 KB). - * - Decompression buffer is larger than encoding buffer, by a minimum of maxBlockSize more bytes. - * In which case, encoding and decoding buffers do not need to be synchronized, - * and encoding ring buffer can have any size, including small ones ( < 64 KB). - * - * Whenever these conditions are not possible, - * save the last 64KB of decoded data into a safe buffer where it can't be modified during decompression, - * then indicate where this data is saved using LZ4_setStreamDecode(), before decompressing next block. -*/ -LZ4LIB_API int -LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode, - const char* src, char* dst, - int srcSize, int dstCapacity); - - -/*! LZ4_decompress_safe_usingDict() : - * Works the same as - * a combination of LZ4_setStreamDecode() followed by LZ4_decompress_safe_continue() - * However, it's stateless: it doesn't need any LZ4_streamDecode_t state. - * Dictionary is presumed stable : it must remain accessible and unmodified during decompression. - * Performance tip : Decompression speed can be substantially increased - * when dst == dictStart + dictSize. - */ -LZ4LIB_API int -LZ4_decompress_safe_usingDict(const char* src, char* dst, - int srcSize, int dstCapacity, - const char* dictStart, int dictSize); - -/*! LZ4_decompress_safe_partial_usingDict() : - * Behaves the same as LZ4_decompress_safe_partial() - * with the added ability to specify a memory segment for past data. - * Performance tip : Decompression speed can be substantially increased - * when dst == dictStart + dictSize. - */ -LZ4LIB_API int -LZ4_decompress_safe_partial_usingDict(const char* src, char* dst, - int compressedSize, - int targetOutputSize, int maxOutputSize, - const char* dictStart, int dictSize); - -#endif /* LZ4_H_2983827168210 */ - - -/*^************************************* - * !!!!!! STATIC LINKING ONLY !!!!!! - ***************************************/ - -/*-**************************************************************************** - * Experimental section - * - * Symbols declared in this section must be considered unstable. Their - * signatures or semantics may change, or they may be removed altogether in the - * future. They are therefore only safe to depend on when the caller is - * statically linked against the library. - * - * To protect against unsafe usage, not only are the declarations guarded, - * the definitions are hidden by default - * when building LZ4 as a shared/dynamic library. - * - * In order to access these declarations, - * define LZ4_STATIC_LINKING_ONLY in your application - * before including LZ4's headers. - * - * In order to make their implementations accessible dynamically, you must - * define LZ4_PUBLISH_STATIC_FUNCTIONS when building the LZ4 library. - ******************************************************************************/ - -#ifdef LZ4_STATIC_LINKING_ONLY - -#ifndef LZ4_STATIC_3504398509 -#define LZ4_STATIC_3504398509 - -#ifdef LZ4_PUBLISH_STATIC_FUNCTIONS -#define LZ4LIB_STATIC_API LZ4LIB_API -#else -#define LZ4LIB_STATIC_API -#endif - - -/*! LZ4_compress_fast_extState_fastReset() : - * A variant of LZ4_compress_fast_extState(). - * - * Using this variant avoids an expensive initialization step. - * It is only safe to call if the state buffer is known to be correctly initialized already - * (see above comment on LZ4_resetStream_fast() for a definition of "correctly initialized"). - * From a high level, the difference is that - * this function initializes the provided state with a call to something like LZ4_resetStream_fast() - * while LZ4_compress_fast_extState() starts with a call to LZ4_resetStream(). - */ -LZ4LIB_STATIC_API int LZ4_compress_fast_extState_fastReset (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); - -/*! LZ4_attach_dictionary() : - * This is an experimental API that allows - * efficient use of a static dictionary many times. - * - * Rather than re-loading the dictionary buffer into a working context before - * each compression, or copying a pre-loaded dictionary's LZ4_stream_t into a - * working LZ4_stream_t, this function introduces a no-copy setup mechanism, - * in which the working stream references the dictionary stream in-place. - * - * Several assumptions are made about the state of the dictionary stream. - * Currently, only streams which have been prepared by LZ4_loadDict() should - * be expected to work. - * - * Alternatively, the provided dictionaryStream may be NULL, - * in which case any existing dictionary stream is unset. - * - * If a dictionary is provided, it replaces any preexisting stream history. - * The dictionary contents are the only history that can be referenced and - * logically immediately precede the data compressed in the first subsequent - * compression call. - * - * The dictionary will only remain attached to the working stream through the - * first compression call, at the end of which it is cleared. The dictionary - * stream (and source buffer) must remain in-place / accessible / unchanged - * through the completion of the first compression call on the stream. - */ -LZ4LIB_STATIC_API void -LZ4_attach_dictionary(LZ4_stream_t* workingStream, - const LZ4_stream_t* dictionaryStream); - - -/*! In-place compression and decompression - * - * It's possible to have input and output sharing the same buffer, - * for highly constrained memory environments. - * In both cases, it requires input to lay at the end of the buffer, - * and decompression to start at beginning of the buffer. - * Buffer size must feature some margin, hence be larger than final size. - * - * |<------------------------buffer--------------------------------->| - * |<-----------compressed data--------->| - * |<-----------decompressed size------------------>| - * |<----margin---->| - * - * This technique is more useful for decompression, - * since decompressed size is typically larger, - * and margin is short. - * - * In-place decompression will work inside any buffer - * which size is >= LZ4_DECOMPRESS_INPLACE_BUFFER_SIZE(decompressedSize). - * This presumes that decompressedSize > compressedSize. - * Otherwise, it means compression actually expanded data, - * and it would be more efficient to store such data with a flag indicating it's not compressed. - * This can happen when data is not compressible (already compressed, or encrypted). - * - * For in-place compression, margin is larger, as it must be able to cope with both - * history preservation, requiring input data to remain unmodified up to LZ4_DISTANCE_MAX, - * and data expansion, which can happen when input is not compressible. - * As a consequence, buffer size requirements are much higher, - * and memory savings offered by in-place compression are more limited. - * - * There are ways to limit this cost for compression : - * - Reduce history size, by modifying LZ4_DISTANCE_MAX. - * Note that it is a compile-time constant, so all compressions will apply this limit. - * Lower values will reduce compression ratio, except when input_size < LZ4_DISTANCE_MAX, - * so it's a reasonable trick when inputs are known to be small. - * - Require the compressor to deliver a "maximum compressed size". - * This is the `dstCapacity` parameter in `LZ4_compress*()`. - * When this size is < LZ4_COMPRESSBOUND(inputSize), then compression can fail, - * in which case, the return code will be 0 (zero). - * The caller must be ready for these cases to happen, - * and typically design a backup scheme to send data uncompressed. - * The combination of both techniques can significantly reduce - * the amount of margin required for in-place compression. - * - * In-place compression can work in any buffer - * which size is >= (maxCompressedSize) - * with maxCompressedSize == LZ4_COMPRESSBOUND(srcSize) for guaranteed compression success. - * LZ4_COMPRESS_INPLACE_BUFFER_SIZE() depends on both maxCompressedSize and LZ4_DISTANCE_MAX, - * so it's possible to reduce memory requirements by playing with them. - */ - -#define LZ4_DECOMPRESS_INPLACE_MARGIN(compressedSize) (((compressedSize) >> 8) + 32) -#define LZ4_DECOMPRESS_INPLACE_BUFFER_SIZE(decompressedSize) ((decompressedSize) + LZ4_DECOMPRESS_INPLACE_MARGIN(decompressedSize)) /**< note: presumes that compressedSize < decompressedSize. note2: margin is overestimated a bit, since it could use compressedSize instead */ - -#ifndef LZ4_DISTANCE_MAX /* history window size; can be user-defined at compile time */ -# define LZ4_DISTANCE_MAX 65535 /* set to maximum value by default */ -#endif - -#define LZ4_COMPRESS_INPLACE_MARGIN (LZ4_DISTANCE_MAX + 32) /* LZ4_DISTANCE_MAX can be safely replaced by srcSize when it's smaller */ -#define LZ4_COMPRESS_INPLACE_BUFFER_SIZE(maxCompressedSize) ((maxCompressedSize) + LZ4_COMPRESS_INPLACE_MARGIN) /**< maxCompressedSize is generally LZ4_COMPRESSBOUND(inputSize), but can be set to any lower value, with the risk that compression can fail (return code 0(zero)) */ - -#endif /* LZ4_STATIC_3504398509 */ -#endif /* LZ4_STATIC_LINKING_ONLY */ - - - -#ifndef LZ4_H_98237428734687 -#define LZ4_H_98237428734687 - -/*-************************************************************ - * Private Definitions - ************************************************************** - * Do not use these definitions directly. - * They are only exposed to allow static allocation of `LZ4_stream_t` and `LZ4_streamDecode_t`. - * Accessing members will expose user code to API and/or ABI break in future versions of the library. - **************************************************************/ -#define LZ4_HASHLOG (LZ4_MEMORY_USAGE-2) -#define LZ4_HASHTABLESIZE (1 << LZ4_MEMORY_USAGE) -#define LZ4_HASH_SIZE_U32 (1 << LZ4_HASHLOG) /* required as macro for static allocation */ - -#if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) -# include - typedef int8_t LZ4_i8; - typedef uint8_t LZ4_byte; - typedef uint16_t LZ4_u16; - typedef uint32_t LZ4_u32; -#else - typedef signed char LZ4_i8; - typedef unsigned char LZ4_byte; - typedef unsigned short LZ4_u16; - typedef unsigned int LZ4_u32; -#endif - -/*! LZ4_stream_t : - * Never ever use below internal definitions directly ! - * These definitions are not API/ABI safe, and may change in future versions. - * If you need static allocation, declare or allocate an LZ4_stream_t object. -**/ - -typedef struct LZ4_stream_t_internal LZ4_stream_t_internal; -struct LZ4_stream_t_internal { - LZ4_u32 hashTable[LZ4_HASH_SIZE_U32]; - const LZ4_byte* dictionary; - const LZ4_stream_t_internal* dictCtx; - LZ4_u32 currentOffset; - LZ4_u32 tableType; - LZ4_u32 dictSize; - /* Implicit padding to ensure structure is aligned */ -}; - -#define LZ4_STREAM_MINSIZE ((1UL << LZ4_MEMORY_USAGE) + 32) /* static size, for inter-version compatibility */ -union LZ4_stream_u { - char minStateSize[LZ4_STREAM_MINSIZE]; - LZ4_stream_t_internal internal_donotuse; -}; /* previously typedef'd to LZ4_stream_t */ - - -/*! LZ4_initStream() : v1.9.0+ - * An LZ4_stream_t structure must be initialized at least once. - * This is automatically done when invoking LZ4_createStream(), - * but it's not when the structure is simply declared on stack (for example). - * - * Use LZ4_initStream() to properly initialize a newly declared LZ4_stream_t. - * It can also initialize any arbitrary buffer of sufficient size, - * and will @return a pointer of proper type upon initialization. - * - * Note : initialization fails if size and alignment conditions are not respected. - * In which case, the function will @return NULL. - * Note2: An LZ4_stream_t structure guarantees correct alignment and size. - * Note3: Before v1.9.0, use LZ4_resetStream() instead -**/ -LZ4LIB_API LZ4_stream_t* LZ4_initStream (void* buffer, size_t size); - - -/*! LZ4_streamDecode_t : - * Never ever use below internal definitions directly ! - * These definitions are not API/ABI safe, and may change in future versions. - * If you need static allocation, declare or allocate an LZ4_streamDecode_t object. -**/ -typedef struct { - const LZ4_byte* externalDict; - const LZ4_byte* prefixEnd; - size_t extDictSize; - size_t prefixSize; -} LZ4_streamDecode_t_internal; - -#define LZ4_STREAMDECODE_MINSIZE 32 -union LZ4_streamDecode_u { - char minStateSize[LZ4_STREAMDECODE_MINSIZE]; - LZ4_streamDecode_t_internal internal_donotuse; -} ; /* previously typedef'd to LZ4_streamDecode_t */ - - - -/*-************************************ -* Obsolete Functions -**************************************/ - -/*! Deprecation warnings - * - * Deprecated functions make the compiler generate a warning when invoked. - * This is meant to invite users to update their source code. - * Should deprecation warnings be a problem, it is generally possible to disable them, - * typically with -Wno-deprecated-declarations for gcc - * or _CRT_SECURE_NO_WARNINGS in Visual. - * - * Another method is to define LZ4_DISABLE_DEPRECATE_WARNINGS - * before including the header file. - */ -#ifdef LZ4_DISABLE_DEPRECATE_WARNINGS -# define LZ4_DEPRECATED(message) /* disable deprecation warnings */ -#else -# if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */ -# define LZ4_DEPRECATED(message) [[deprecated(message)]] -# elif defined(_MSC_VER) -# define LZ4_DEPRECATED(message) __declspec(deprecated(message)) -# elif defined(__clang__) || (defined(__GNUC__) && (__GNUC__ * 10 + __GNUC_MINOR__ >= 45)) -# define LZ4_DEPRECATED(message) __attribute__((deprecated(message))) -# elif defined(__GNUC__) && (__GNUC__ * 10 + __GNUC_MINOR__ >= 31) -# define LZ4_DEPRECATED(message) __attribute__((deprecated)) -# else -# pragma message("WARNING: LZ4_DEPRECATED needs custom implementation for this compiler") -# define LZ4_DEPRECATED(message) /* disabled */ -# endif -#endif /* LZ4_DISABLE_DEPRECATE_WARNINGS */ - -/*! Obsolete compression functions (since v1.7.3) */ -LZ4_DEPRECATED("use LZ4_compress_default() instead") LZ4LIB_API int LZ4_compress (const char* src, char* dest, int srcSize); -LZ4_DEPRECATED("use LZ4_compress_default() instead") LZ4LIB_API int LZ4_compress_limitedOutput (const char* src, char* dest, int srcSize, int maxOutputSize); -LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") LZ4LIB_API int LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize); -LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") LZ4LIB_API int LZ4_compress_limitedOutput_withState (void* state, const char* source, char* dest, int inputSize, int maxOutputSize); -LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") LZ4LIB_API int LZ4_compress_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize); -LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") LZ4LIB_API int LZ4_compress_limitedOutput_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize, int maxOutputSize); - -/*! Obsolete decompression functions (since v1.8.0) */ -LZ4_DEPRECATED("use LZ4_decompress_fast() instead") LZ4LIB_API int LZ4_uncompress (const char* source, char* dest, int outputSize); -LZ4_DEPRECATED("use LZ4_decompress_safe() instead") LZ4LIB_API int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize); - -/* Obsolete streaming functions (since v1.7.0) - * degraded functionality; do not use! - * - * In order to perform streaming compression, these functions depended on data - * that is no longer tracked in the state. They have been preserved as well as - * possible: using them will still produce a correct output. However, they don't - * actually retain any history between compression calls. The compression ratio - * achieved will therefore be no better than compressing each chunk - * independently. - */ -LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API void* LZ4_create (char* inputBuffer); -LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API int LZ4_sizeofStreamState(void); -LZ4_DEPRECATED("Use LZ4_resetStream() instead") LZ4LIB_API int LZ4_resetStreamState(void* state, char* inputBuffer); -LZ4_DEPRECATED("Use LZ4_saveDict() instead") LZ4LIB_API char* LZ4_slideInputBuffer (void* state); - -/*! Obsolete streaming decoding functions (since v1.7.0) */ -LZ4_DEPRECATED("use LZ4_decompress_safe_usingDict() instead") LZ4LIB_API int LZ4_decompress_safe_withPrefix64k (const char* src, char* dst, int compressedSize, int maxDstSize); -LZ4_DEPRECATED("use LZ4_decompress_fast_usingDict() instead") LZ4LIB_API int LZ4_decompress_fast_withPrefix64k (const char* src, char* dst, int originalSize); - -/*! Obsolete LZ4_decompress_fast variants (since v1.9.0) : - * These functions used to be faster than LZ4_decompress_safe(), - * but this is no longer the case. They are now slower. - * This is because LZ4_decompress_fast() doesn't know the input size, - * and therefore must progress more cautiously into the input buffer to not read beyond the end of block. - * On top of that `LZ4_decompress_fast()` is not protected vs malformed or malicious inputs, making it a security liability. - * As a consequence, LZ4_decompress_fast() is strongly discouraged, and deprecated. - * - * The last remaining LZ4_decompress_fast() specificity is that - * it can decompress a block without knowing its compressed size. - * Such functionality can be achieved in a more secure manner - * by employing LZ4_decompress_safe_partial(). - * - * Parameters: - * originalSize : is the uncompressed size to regenerate. - * `dst` must be already allocated, its size must be >= 'originalSize' bytes. - * @return : number of bytes read from source buffer (== compressed size). - * The function expects to finish at block's end exactly. - * If the source stream is detected malformed, the function stops decoding and returns a negative result. - * note : LZ4_decompress_fast*() requires originalSize. Thanks to this information, it never writes past the output buffer. - * However, since it doesn't know its 'src' size, it may read an unknown amount of input, past input buffer bounds. - * Also, since match offsets are not validated, match reads from 'src' may underflow too. - * These issues never happen if input (compressed) data is correct. - * But they may happen if input data is invalid (error or intentional tampering). - * As a consequence, use these functions in trusted environments with trusted data **only**. - */ -LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using LZ4_decompress_safe() instead") -LZ4LIB_API int LZ4_decompress_fast (const char* src, char* dst, int originalSize); -LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using LZ4_decompress_safe_continue() instead") -LZ4LIB_API int LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* src, char* dst, int originalSize); -LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using LZ4_decompress_safe_usingDict() instead") -LZ4LIB_API int LZ4_decompress_fast_usingDict (const char* src, char* dst, int originalSize, const char* dictStart, int dictSize); - -/*! LZ4_resetStream() : - * An LZ4_stream_t structure must be initialized at least once. - * This is done with LZ4_initStream(), or LZ4_resetStream(). - * Consider switching to LZ4_initStream(), - * invoking LZ4_resetStream() will trigger deprecation warnings in the future. - */ -LZ4LIB_API void LZ4_resetStream (LZ4_stream_t* streamPtr); - - -#endif /* LZ4_H_98237428734687 */ - - -#if defined (__cplusplus) -} -#endif - -#endif /* LV_USE_LZ4_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode.c b/L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode.c deleted file mode 100644 index f4b5b54..0000000 --- a/L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode.c +++ /dev/null @@ -1,242 +0,0 @@ -/** - * @file lv_qrcode.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../core/lv_obj_class_private.h" -#include "lv_qrcode_private.h" - -#if LV_USE_QRCODE - -#include "qrcodegen.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_qrcode_class) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_qrcode_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_qrcode_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); - -/********************** - * STATIC VARIABLES - **********************/ - -const lv_obj_class_t lv_qrcode_class = { - .constructor_cb = lv_qrcode_constructor, - .destructor_cb = lv_qrcode_destructor, - .instance_size = sizeof(lv_qrcode_t), - .base_class = &lv_canvas_class, - .name = "qrcode", -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_qrcode_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -void lv_qrcode_set_size(lv_obj_t * obj, int32_t size) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_draw_buf_t * old_buf = lv_canvas_get_draw_buf(obj); - lv_draw_buf_t * new_buf = lv_draw_buf_create(size, size, LV_COLOR_FORMAT_I1, LV_STRIDE_AUTO); - if(new_buf == NULL) { - LV_LOG_ERROR("malloc failed for canvas buffer"); - return; - } - - lv_canvas_set_draw_buf(obj, new_buf); - LV_LOG_INFO("set canvas buffer: %p, size = %d", (void *)new_buf, (int)size); - - /*Clear canvas buffer*/ - lv_draw_buf_clear(new_buf, NULL); - - if(old_buf != NULL) lv_draw_buf_destroy(old_buf); -} - -void lv_qrcode_set_dark_color(lv_obj_t * obj, lv_color_t color) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_qrcode_t * qrcode = (lv_qrcode_t *)obj; - qrcode->dark_color = color; -} - -void lv_qrcode_set_light_color(lv_obj_t * obj, lv_color_t color) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_qrcode_t * qrcode = (lv_qrcode_t *)obj; - qrcode->light_color = color; -} - -lv_result_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_qrcode_t * qrcode = (lv_qrcode_t *)obj; - - lv_draw_buf_t * draw_buf = lv_canvas_get_draw_buf(obj); - if(draw_buf == NULL) { - LV_LOG_ERROR("canvas draw buffer is NULL"); - return LV_RESULT_INVALID; - } - - lv_draw_buf_clear(draw_buf, NULL); - lv_canvas_set_palette(obj, 0, lv_color_to_32(qrcode->light_color, LV_OPA_COVER)); - lv_canvas_set_palette(obj, 1, lv_color_to_32(qrcode->dark_color, LV_OPA_COVER)); - lv_image_cache_drop(draw_buf); - - lv_obj_invalidate(obj); - - if(data_len > qrcodegen_BUFFER_LEN_MAX) return LV_RESULT_INVALID; - - int32_t qr_version = qrcodegen_getMinFitVersion(qrcodegen_Ecc_MEDIUM, data_len); - if(qr_version <= 0) return LV_RESULT_INVALID; - int32_t qr_size = qrcodegen_version2size(qr_version); - if(qr_size <= 0) return LV_RESULT_INVALID; - int32_t scale = draw_buf->header.w / qr_size; - if(scale <= 0) return LV_RESULT_INVALID; - - /* Pick the largest QR code that still maintains scale. */ - for(int32_t i = qr_version + 1; i < qrcodegen_VERSION_MAX; i++) { - if(qrcodegen_version2size(i) * scale > draw_buf->header.w) - break; - - qr_version = i; - } - qr_size = qrcodegen_version2size(qr_version); - - uint8_t * qr0 = lv_malloc(qrcodegen_BUFFER_LEN_FOR_VERSION(qr_version)); - LV_ASSERT_MALLOC(qr0); - uint8_t * data_tmp = lv_malloc(qrcodegen_BUFFER_LEN_FOR_VERSION(qr_version)); - LV_ASSERT_MALLOC(data_tmp); - lv_memcpy(data_tmp, data, data_len); - - bool ok = qrcodegen_encodeBinary(data_tmp, data_len, - qr0, qrcodegen_Ecc_MEDIUM, - qr_version, qr_version, - qrcodegen_Mask_AUTO, true); - - if(!ok) { - lv_free(qr0); - lv_free(data_tmp); - return LV_RESULT_INVALID; - } - - /* Temporarily disable invalidation to improve the efficiency of lv_canvas_set_px */ - lv_display_enable_invalidation(lv_obj_get_display(obj), false); - - int32_t obj_w = draw_buf->header.w; - qr_size = qrcodegen_getSize(qr0); - scale = obj_w / qr_size; - int scaled = qr_size * scale; - int margin = (obj_w - scaled) / 2; - uint8_t * buf_u8 = (uint8_t *)draw_buf->data + 8; /*+8 skip the palette*/ - lv_color_t c = lv_color_hex(1); - - /* Copy the qr code canvas: - * A simple `lv_canvas_set_px` would work but it's slow for so many pixels. - * So buffer 1 byte (8 px) from the qr code and set it in the canvas image */ - uint32_t row_byte_cnt = draw_buf->header.stride; - int y; - for(y = margin; y < scaled + margin; y += scale) { - uint8_t b = 0; - uint8_t p = 0; - bool aligned = false; - int x; - for(x = margin; x < scaled + margin; x++) { - bool a = qrcodegen_getModule(qr0, (x - margin) / scale, (y - margin) / scale); - - if(aligned == false && (x & 0x7) == 0) aligned = true; - - if(aligned == false) { - if(a) { - lv_canvas_set_px(obj, x, y, c, LV_OPA_COVER); - } - } - else { - if(!a) b |= (1 << (7 - p)); - p++; - if(p == 8) { - uint32_t px = row_byte_cnt * y + (x >> 3); - buf_u8[px] = ~b; - b = 0; - p = 0; - } - } - } - - /*Process the last byte of the row*/ - if(p) { - /*Make the rest of the bits white*/ - b |= (1 << (8 - p)) - 1; - - uint32_t px = row_byte_cnt * y + (x >> 3); - buf_u8[px] = ~b; - } - - /*The Qr is probably scaled so simply to the repeated rows*/ - int s; - const uint8_t * row_ori = buf_u8 + row_byte_cnt * y; - for(s = 1; s < scale; s++) { - lv_memcpy((uint8_t *)buf_u8 + row_byte_cnt * (y + s), row_ori, row_byte_cnt); - } - } - - /* invalidate the canvas to refresh it */ - lv_display_enable_invalidation(lv_obj_get_display(obj), true); - - lv_free(qr0); - lv_free(data_tmp); - return LV_RESULT_OK; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_qrcode_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - - /*Set default size*/ - lv_qrcode_set_size(obj, LV_DPI_DEF); - - /*Set default color*/ - lv_qrcode_set_dark_color(obj, lv_color_black()); - lv_qrcode_set_light_color(obj, lv_color_white()); -} - -static void lv_qrcode_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - - lv_draw_buf_t * draw_buf = lv_canvas_get_draw_buf(obj); - if(draw_buf == NULL) return; - lv_image_cache_drop(draw_buf); - - /*@fixme destroy buffer in cache free_cb.*/ - lv_draw_buf_destroy(draw_buf); -} - -#endif /*LV_USE_QRCODE*/ diff --git a/L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode.h b/L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode.h deleted file mode 100644 index ba9b0e8..0000000 --- a/L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @file lv_qrcode.h - * - */ - -#ifndef LV_QRCODE_H -#define LV_QRCODE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#include "../../misc/lv_color.h" -#include "../../misc/lv_types.h" -#include "../../widgets/canvas/lv_canvas.h" -#include LV_STDBOOL_INCLUDE -#include LV_STDINT_INCLUDE -#if LV_USE_QRCODE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_qrcode_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an empty QR code (an `lv_canvas`) object. - * @param parent point to an object where to create the QR code - * @return pointer to the created QR code object - */ -lv_obj_t * lv_qrcode_create(lv_obj_t * parent); - -/** - * Set QR code size. - * @param obj pointer to a QR code object - * @param size width and height of the QR code - */ -void lv_qrcode_set_size(lv_obj_t * obj, int32_t size); - -/** - * Set QR code dark color. - * @param obj pointer to a QR code object - * @param color dark color of the QR code - */ -void lv_qrcode_set_dark_color(lv_obj_t * obj, lv_color_t color); - -/** - * Set QR code light color. - * @param obj pointer to a QR code object - * @param color light color of the QR code - */ -void lv_qrcode_set_light_color(lv_obj_t * obj, lv_color_t color); - -/** - * Set the data of a QR code object - * @param obj pointer to a QR code object - * @param data data to display - * @param data_len length of data in bytes - * @return LV_RESULT_OK: if no error; LV_RESULT_INVALID: on error - */ -lv_result_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_QRCODE*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*LV_QRCODE_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode_private.h b/L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode_private.h deleted file mode 100644 index b912d65..0000000 --- a/L3_Middlewares/LVGL/src/libs/qrcode/lv_qrcode_private.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file lv_qrcode_private.h - * - */ - -#ifndef LV_QRCODE_PRIVATE_H -#define LV_QRCODE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../widgets/canvas/lv_canvas_private.h" -#include "lv_qrcode.h" - -#if LV_USE_QRCODE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/*Data of qrcode*/ -struct lv_qrcode_t { - lv_canvas_t canvas; - lv_color_t dark_color; - lv_color_t light_color; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_QRCODE */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_QRCODE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/qrcode/qrcodegen.c b/L3_Middlewares/LVGL/src/libs/qrcode/qrcodegen.c deleted file mode 100644 index f501a24..0000000 --- a/L3_Middlewares/LVGL/src/libs/qrcode/qrcodegen.c +++ /dev/null @@ -1,1116 +0,0 @@ -/* - * QR Code generator library (C) - * - * Copyright (c) Project Nayuki. (MIT License) - * https://www.nayuki.io/page/qr-code-generator-library - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - The Software is provided "as is", without warranty of any kind, express or - * implied, including but not limited to the warranties of merchantability, - * fitness for a particular purpose and noninfringement. In no event shall the - * authors or copyright holders be liable for any claim, damages or other - * liability, whether in an action of contract, tort or otherwise, arising from, - * out of or in connection with the Software or the use or other dealings in the - * Software. - */ - -#include "qrcodegen.h" -#include "../../misc/lv_assert.h" - -#if LV_USE_QRCODE -#include -#include -#include - -#ifndef QRCODEGEN_TEST - #define testable static // Keep functions private -#else - #define testable // Expose private functions -#endif - - -/*---- Forward declarations for private functions ----*/ - -// Regarding all public and private functions defined in this source file: -// - They require all pointer/array arguments to be not null unless the array length is zero. -// - They only read input scalar/array arguments, write to output pointer/array -// arguments, and return scalar values; they are "pure" functions. -// - They don't read mutable global variables or write to any global variables. -// - They don't perform I/O, read the clock, print to console, etc. -// - They allocate a small and constant amount of stack memory. -// - They don't allocate or free any memory on the heap. -// - They don't recurse or mutually recurse. All the code -// could be inlined into the top-level public functions. -// - They run in at most quadratic time with respect to input arguments. -// Most functions run in linear time, and some in constant time. -// There are no unbounded loops or non-obvious termination conditions. -// - They are completely thread-safe if the caller does not give the -// same writable buffer to concurrent calls to these functions. - -testable void appendBitsToBuffer(unsigned int val, int numBits, uint8_t buffer[], int * bitLen); - -testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]); -testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl); -testable int getNumRawDataModules(int ver); - -testable void calcReedSolomonGenerator(int degree, uint8_t result[]); -testable void calcReedSolomonRemainder(const uint8_t data[], int dataLen, - const uint8_t generator[], int degree, uint8_t result[]); -testable uint8_t finiteFieldMultiply(uint8_t x, uint8_t y); - -testable void initializeFunctionModules(int version, uint8_t qrcode[]); -static void drawWhiteFunctionModules(uint8_t qrcode[], int version); -static void drawFormatBits(enum qrcodegen_Ecc ecl, enum qrcodegen_Mask mask, uint8_t qrcode[]); -testable int getAlignmentPatternPositions(int version, uint8_t result[7]); -static void fillRectangle(int left, int top, int width, int height, uint8_t qrcode[]); - -static void drawCodewords(const uint8_t data[], int dataLen, uint8_t qrcode[]); -static void applyMask(const uint8_t functionModules[], uint8_t qrcode[], enum qrcodegen_Mask mask); -static long getPenaltyScore(const uint8_t qrcode[]); -static void addRunToHistory(unsigned char run, unsigned char history[7]); -static bool hasFinderLikePattern(const unsigned char runHistory[7]); - -testable bool getModule(const uint8_t qrcode[], int x, int y); -testable void setModule(uint8_t qrcode[], int x, int y, bool isBlack); -testable void setModuleBounded(uint8_t qrcode[], int x, int y, bool isBlack); -static bool getBit(int x, int i); - -testable int calcSegmentBitLength(enum qrcodegen_Mode mode, size_t numChars); -testable int getTotalBits(const struct qrcodegen_Segment segs[], size_t len, int version); -static int numCharCountBits(enum qrcodegen_Mode mode, int version); - - - -/*---- Private tables of constants ----*/ - -// The set of all legal characters in alphanumeric mode, where each character -// value maps to the index in the string. For checking text and encoding segments. -static const char * ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"; - -// For generating error correction codes. -testable const int8_t ECC_CODEWORDS_PER_BLOCK[4][41] = { - // Version: (note that index 0 is for padding, and is set to an illegal value) - //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level - {-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // Low - {-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28}, // Medium - {-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // Quartile - {-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // High -}; - -#define qrcodegen_REED_SOLOMON_DEGREE_MAX 30 // Based on the table above - -// For generating error correction codes. -testable const int8_t NUM_ERROR_CORRECTION_BLOCKS[4][41] = { - // Version: (note that index 0 is for padding, and is set to an illegal value) - //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level - {-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25}, // Low - {-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49}, // Medium - {-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68}, // Quartile - {-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81}, // High -}; - -// For automatic mask pattern selection. -static const int PENALTY_N1 = 3; -static const int PENALTY_N2 = 3; -static const int PENALTY_N3 = 40; -static const int PENALTY_N4 = 10; - - - -/*---- High-level QR Code encoding functions ----*/ - -// Public function - see documentation comment in header file. -bool qrcodegen_encodeText(const char * text, uint8_t tempBuffer[], uint8_t qrcode[], - enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl) -{ - - size_t textLen = strlen(text); - if(textLen == 0) - return qrcodegen_encodeSegmentsAdvanced(NULL, 0, ecl, minVersion, maxVersion, mask, boostEcl, tempBuffer, qrcode); - size_t bufLen = qrcodegen_BUFFER_LEN_FOR_VERSION(maxVersion); - - struct qrcodegen_Segment seg; - if(qrcodegen_isNumeric(text)) { - if(qrcodegen_calcSegmentBufferSize(qrcodegen_Mode_NUMERIC, textLen) > bufLen) - goto fail; - seg = qrcodegen_makeNumeric(text, tempBuffer); - } - else if(qrcodegen_isAlphanumeric(text)) { - if(qrcodegen_calcSegmentBufferSize(qrcodegen_Mode_ALPHANUMERIC, textLen) > bufLen) - goto fail; - seg = qrcodegen_makeAlphanumeric(text, tempBuffer); - } - else { - if(textLen > bufLen) - goto fail; - for(size_t i = 0; i < textLen; i++) - tempBuffer[i] = (uint8_t)text[i]; - seg.mode = qrcodegen_Mode_BYTE; - seg.bitLength = calcSegmentBitLength(seg.mode, textLen); - if(seg.bitLength == -1) - goto fail; - seg.numChars = (int)textLen; - seg.data = tempBuffer; - } - return qrcodegen_encodeSegmentsAdvanced(&seg, 1, ecl, minVersion, maxVersion, mask, boostEcl, tempBuffer, qrcode); - -fail: - qrcode[0] = 0; // Set size to invalid value for safety - return false; -} - - -// Public function - see documentation comment in header file. -bool qrcodegen_encodeBinary(uint8_t dataAndTemp[], size_t dataLen, uint8_t qrcode[], - enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl) -{ - - struct qrcodegen_Segment seg; - seg.mode = qrcodegen_Mode_BYTE; - seg.bitLength = calcSegmentBitLength(seg.mode, dataLen); - if(seg.bitLength == -1) { - qrcode[0] = 0; // Set size to invalid value for safety - return false; - } - seg.numChars = (int)dataLen; - seg.data = dataAndTemp; - return qrcodegen_encodeSegmentsAdvanced(&seg, 1, ecl, minVersion, maxVersion, mask, boostEcl, dataAndTemp, qrcode); -} - - -// Appends the given number of low-order bits of the given value to the given byte-based -// bit buffer, increasing the bit length. Requires 0 <= numBits <= 16 and val < 2^numBits. -testable void appendBitsToBuffer(unsigned int val, int numBits, uint8_t buffer[], int * bitLen) -{ - LV_ASSERT(0 <= numBits && numBits <= 16 && (unsigned long)val >> numBits == 0); - for(int i = numBits - 1; i >= 0; i--, (*bitLen)++) - buffer[*bitLen >> 3] |= ((val >> i) & 1) << (7 - (*bitLen & 7)); -} - - - -/*---- Low-level QR Code encoding functions ----*/ - -// Public function - see documentation comment in header file. -bool qrcodegen_encodeSegments(const struct qrcodegen_Segment segs[], size_t len, - enum qrcodegen_Ecc ecl, uint8_t tempBuffer[], uint8_t qrcode[]) -{ - return qrcodegen_encodeSegmentsAdvanced(segs, len, ecl, - qrcodegen_VERSION_MIN, qrcodegen_VERSION_MAX, -1, true, tempBuffer, qrcode); -} - - -// Public function - see documentation comment in header file. -bool qrcodegen_encodeSegmentsAdvanced(const struct qrcodegen_Segment segs[], size_t len, enum qrcodegen_Ecc ecl, - int minVersion, int maxVersion, int mask, bool boostEcl, uint8_t tempBuffer[], uint8_t qrcode[]) -{ - LV_ASSERT(segs != NULL || len == 0); - LV_ASSERT(qrcodegen_VERSION_MIN <= minVersion && minVersion <= maxVersion && maxVersion <= qrcodegen_VERSION_MAX); - LV_ASSERT(0 <= (int)ecl && (int)ecl <= 3 && -1 <= (int)mask && (int)mask <= 7); - - // Find the minimal version number to use - int version, dataUsedBits; - for(version = minVersion; ; version++) { - int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; // Number of data bits available - dataUsedBits = getTotalBits(segs, len, version); - if(dataUsedBits != -1 && dataUsedBits <= dataCapacityBits) - break; // This version number is found to be suitable - if(version >= maxVersion) { // All versions in the range could not fit the given data - qrcode[0] = 0; // Set size to invalid value for safety - return false; - } - } - LV_ASSERT(dataUsedBits != -1); - - // Increase the error correction level while the data still fits in the current version number - for(int i = (int)qrcodegen_Ecc_MEDIUM; i <= (int)qrcodegen_Ecc_HIGH; i++) { // From low to high - if(boostEcl && dataUsedBits <= getNumDataCodewords(version, (enum qrcodegen_Ecc)i) * 8) - ecl = (enum qrcodegen_Ecc)i; - } - - // Concatenate all segments to create the data bit string - memset(qrcode, 0, qrcodegen_BUFFER_LEN_FOR_VERSION(version) * sizeof(qrcode[0])); - int bitLen = 0; - for(size_t i = 0; i < len; i++) { - const struct qrcodegen_Segment * seg = &segs[i]; - appendBitsToBuffer((int)seg->mode, 4, qrcode, &bitLen); - appendBitsToBuffer(seg->numChars, numCharCountBits(seg->mode, version), qrcode, &bitLen); - for(int j = 0; j < seg->bitLength; j++) - appendBitsToBuffer((seg->data[j >> 3] >> (7 - (j & 7))) & 1, 1, qrcode, &bitLen); - } - LV_ASSERT(bitLen == dataUsedBits); - - // Add terminator and pad up to a byte if applicable - int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; - LV_ASSERT(bitLen <= dataCapacityBits); - int terminatorBits = dataCapacityBits - bitLen; - if(terminatorBits > 4) - terminatorBits = 4; - appendBitsToBuffer(0, terminatorBits, qrcode, &bitLen); - appendBitsToBuffer(0, (8 - bitLen % 8) % 8, qrcode, &bitLen); - LV_ASSERT(bitLen % 8 == 0); - - // Pad with alternating bytes until data capacity is reached - for(uint8_t padByte = 0xEC; bitLen < dataCapacityBits; padByte ^= 0xEC ^ 0x11) - appendBitsToBuffer(padByte, 8, qrcode, &bitLen); - - // Draw function and data codeword modules - addEccAndInterleave(qrcode, version, ecl, tempBuffer); - initializeFunctionModules(version, qrcode); - drawCodewords(tempBuffer, getNumRawDataModules(version) / 8, qrcode); - drawWhiteFunctionModules(qrcode, version); - initializeFunctionModules(version, tempBuffer); - - // Handle masking - if(mask == qrcodegen_Mask_AUTO) { // Automatically choose best mask - long minPenalty = LONG_MAX; - for(int i = 0; i < 8; i++) { - enum qrcodegen_Mask msk = (enum qrcodegen_Mask)i; - applyMask(tempBuffer, qrcode, msk); - drawFormatBits(ecl, msk, qrcode); - long penalty = getPenaltyScore(qrcode); - if(penalty < minPenalty) { - mask = msk; - minPenalty = penalty; - } - applyMask(tempBuffer, qrcode, msk); // Undoes the mask due to XOR - } - } - LV_ASSERT(0 <= (int)mask && (int)mask <= 7); - applyMask(tempBuffer, qrcode, mask); - drawFormatBits(ecl, mask, qrcode); - return true; -} - - - -/*---- Error correction code generation functions ----*/ - -// Appends error correction bytes to each block of the given data array, then interleaves -// bytes from the blocks and stores them in the result array. data[0 : dataLen] contains -// the input data. data[dataLen : rawCodewords] is used as a temporary work area and will -// be clobbered by this function. The final answer is stored in result[0 : rawCodewords]. -testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]) -{ - // Calculate parameter numbers - LV_ASSERT(0 <= (int)ecl && (int)ecl < 4 && qrcodegen_VERSION_MIN <= version && version <= qrcodegen_VERSION_MAX); - int numBlocks = NUM_ERROR_CORRECTION_BLOCKS[(int)ecl][version]; - int blockEccLen = ECC_CODEWORDS_PER_BLOCK [(int)ecl][version]; - int rawCodewords = getNumRawDataModules(version) / 8; - int dataLen = getNumDataCodewords(version, ecl); - int numShortBlocks = numBlocks - rawCodewords % numBlocks; - int shortBlockDataLen = rawCodewords / numBlocks - blockEccLen; - - // Split data into blocks, calculate ECC, and interleave - // (not concatenate) the bytes into a single sequence - uint8_t generator[qrcodegen_REED_SOLOMON_DEGREE_MAX]; - calcReedSolomonGenerator(blockEccLen, generator); - const uint8_t * dat = data; - for(int i = 0; i < numBlocks; i++) { - int datLen = shortBlockDataLen + (i < numShortBlocks ? 0 : 1); - uint8_t * ecc = &data[dataLen]; // Temporary storage - calcReedSolomonRemainder(dat, datLen, generator, blockEccLen, ecc); - for(int j = 0, k = i; j < datLen; j++, k += numBlocks) { // Copy data - if(j == shortBlockDataLen) - k -= numShortBlocks; - result[k] = dat[j]; - } - for(int j = 0, k = dataLen + i; j < blockEccLen; j++, k += numBlocks) // Copy ECC - result[k] = ecc[j]; - dat += datLen; - } -} - - -// Returns the number of 8-bit codewords that can be used for storing data (not ECC), -// for the given version number and error correction level. The result is in the range [9, 2956]. -testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl) -{ - int v = version, e = (int)ecl; - LV_ASSERT(0 <= e && e < 4); - return getNumRawDataModules(v) / 8 - - ECC_CODEWORDS_PER_BLOCK [e][v] - * NUM_ERROR_CORRECTION_BLOCKS[e][v]; -} - - -// Returns the number of data bits that can be stored in a QR Code of the given version number, after -// all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. -// The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table. -testable int getNumRawDataModules(int ver) -{ - LV_ASSERT(qrcodegen_VERSION_MIN <= ver && ver <= qrcodegen_VERSION_MAX); - int result = (16 * ver + 128) * ver + 64; - if(ver >= 2) { - int numAlign = ver / 7 + 2; - result -= (25 * numAlign - 10) * numAlign - 55; - if(ver >= 7) - result -= 36; - } - return result; -} - - - -/*---- Reed-Solomon ECC generator functions ----*/ - -// Calculates the Reed-Solomon generator polynomial of the given degree, storing in result[0 : degree]. -testable void calcReedSolomonGenerator(int degree, uint8_t result[]) -{ - // Start with the monomial x^0 - LV_ASSERT(1 <= degree && degree <= qrcodegen_REED_SOLOMON_DEGREE_MAX); - memset(result, 0, degree * sizeof(result[0])); - result[degree - 1] = 1; - - // Compute the product polynomial (x - r^0) * (x - r^1) * (x - r^2) * ... * (x - r^{degree-1}), - // drop the highest term, and store the rest of the coefficients in order of descending powers. - // Note that r = 0x02, which is a generator element of this field GF(2^8/0x11D). - uint8_t root = 1; - for(int i = 0; i < degree; i++) { - // Multiply the current product by (x - r^i) - for(int j = 0; j < degree; j++) { - result[j] = finiteFieldMultiply(result[j], root); - if(j + 1 < degree) - result[j] ^= result[j + 1]; - } - root = finiteFieldMultiply(root, 0x02); - } -} - - -// Calculates the remainder of the polynomial data[0 : dataLen] when divided by the generator[0 : degree], where all -// polynomials are in big endian and the generator has an implicit leading 1 term, storing the result in result[0 : degree]. -testable void calcReedSolomonRemainder(const uint8_t data[], int dataLen, - const uint8_t generator[], int degree, uint8_t result[]) -{ - - // Perform polynomial division - LV_ASSERT(1 <= degree && degree <= qrcodegen_REED_SOLOMON_DEGREE_MAX); - memset(result, 0, degree * sizeof(result[0])); - for(int i = 0; i < dataLen; i++) { - uint8_t factor = data[i] ^ result[0]; - memmove(&result[0], &result[1], (degree - 1) * sizeof(result[0])); - result[degree - 1] = 0; - for(int j = 0; j < degree; j++) - result[j] ^= finiteFieldMultiply(generator[j], factor); - } -} - -#undef qrcodegen_REED_SOLOMON_DEGREE_MAX - - -// Returns the product of the two given field elements modulo GF(2^8/0x11D). -// All inputs are valid. This could be implemented as a 256*256 lookup table. -testable uint8_t finiteFieldMultiply(uint8_t x, uint8_t y) -{ - // Russian peasant multiplication - uint8_t z = 0; - for(int i = 7; i >= 0; i--) { - z = (z << 1) ^ ((z >> 7) * 0x11D); - z ^= ((y >> i) & 1) * x; - } - return z; -} - - - -/*---- Drawing function modules ----*/ - -// Clears the given QR Code grid with white modules for the given -// version's size, then marks every function module as black. -testable void initializeFunctionModules(int version, uint8_t qrcode[]) -{ - // Initialize QR Code - int qrsize = version * 4 + 17; - memset(qrcode, 0, ((qrsize * qrsize + 7) / 8 + 1) * sizeof(qrcode[0])); - qrcode[0] = (uint8_t)qrsize; - - // Fill horizontal and vertical timing patterns - fillRectangle(6, 0, 1, qrsize, qrcode); - fillRectangle(0, 6, qrsize, 1, qrcode); - - // Fill 3 finder patterns (all corners except bottom right) and format bits - fillRectangle(0, 0, 9, 9, qrcode); - fillRectangle(qrsize - 8, 0, 8, 9, qrcode); - fillRectangle(0, qrsize - 8, 9, 8, qrcode); - - // Fill numerous alignment patterns - uint8_t alignPatPos[7]; - int numAlign = getAlignmentPatternPositions(version, alignPatPos); - for(int i = 0; i < numAlign; i++) { - for(int j = 0; j < numAlign; j++) { - // Don't draw on the three finder corners - if(!((i == 0 && j == 0) || (i == 0 && j == numAlign - 1) || (i == numAlign - 1 && j == 0))) - fillRectangle(alignPatPos[i] - 2, alignPatPos[j] - 2, 5, 5, qrcode); - } - } - - // Fill version blocks - if(version >= 7) { - fillRectangle(qrsize - 11, 0, 3, 6, qrcode); - fillRectangle(0, qrsize - 11, 6, 3, qrcode); - } -} - - -// Draws white function modules and possibly some black modules onto the given QR Code, without changing -// non-function modules. This does not draw the format bits. This requires all function modules to be previously -// marked black (namely by initializeFunctionModules()), because this may skip redrawing black function modules. -static void drawWhiteFunctionModules(uint8_t qrcode[], int version) -{ - // Draw horizontal and vertical timing patterns - int qrsize = qrcodegen_getSize(qrcode); - for(int i = 7; i < qrsize - 7; i += 2) { - setModule(qrcode, 6, i, false); - setModule(qrcode, i, 6, false); - } - - // Draw 3 finder patterns (all corners except bottom right; overwrites some timing modules) - for(int dy = -4; dy <= 4; dy++) { - for(int dx = -4; dx <= 4; dx++) { - int dist = abs(dx); - if(abs(dy) > dist) - dist = abs(dy); - if(dist == 2 || dist == 4) { - setModuleBounded(qrcode, 3 + dx, 3 + dy, false); - setModuleBounded(qrcode, qrsize - 4 + dx, 3 + dy, false); - setModuleBounded(qrcode, 3 + dx, qrsize - 4 + dy, false); - } - } - } - - // Draw numerous alignment patterns - uint8_t alignPatPos[7]; - int numAlign = getAlignmentPatternPositions(version, alignPatPos); - for(int i = 0; i < numAlign; i++) { - for(int j = 0; j < numAlign; j++) { - if((i == 0 && j == 0) || (i == 0 && j == numAlign - 1) || (i == numAlign - 1 && j == 0)) - continue; // Don't draw on the three finder corners - for(int dy = -1; dy <= 1; dy++) { - for(int dx = -1; dx <= 1; dx++) - setModule(qrcode, alignPatPos[i] + dx, alignPatPos[j] + dy, dx == 0 && dy == 0); - } - } - } - - // Draw version blocks - if(version >= 7) { - // Calculate error correction code and pack bits - int rem = version; // version is uint6, in the range [7, 40] - for(int i = 0; i < 12; i++) - rem = (rem << 1) ^ ((rem >> 11) * 0x1F25); - long bits = (long)version << 12 | rem; // uint18 - LV_ASSERT(bits >> 18 == 0); - - // Draw two copies - for(int i = 0; i < 6; i++) { - for(int j = 0; j < 3; j++) { - int k = qrsize - 11 + j; - setModule(qrcode, k, i, (bits & 1) != 0); - setModule(qrcode, i, k, (bits & 1) != 0); - bits >>= 1; - } - } - } -} - - -// Draws two copies of the format bits (with its own error correction code) based -// on the given mask and error correction level. This always draws all modules of -// the format bits, unlike drawWhiteFunctionModules() which might skip black modules. -static void drawFormatBits(enum qrcodegen_Ecc ecl, enum qrcodegen_Mask mask, uint8_t qrcode[]) -{ - // Calculate error correction code and pack bits - LV_ASSERT(0 <= (int)mask && (int)mask <= 7); - static const int table[] = {1, 0, 3, 2}; - int data = table[(int)ecl] << 3 | (int)mask; // errCorrLvl is uint2, mask is uint3 - int rem = data; - for(int i = 0; i < 10; i++) - rem = (rem << 1) ^ ((rem >> 9) * 0x537); - int bits = (data << 10 | rem) ^ 0x5412; // uint15 - LV_ASSERT(bits >> 15 == 0); - - // Draw first copy - for(int i = 0; i <= 5; i++) - setModule(qrcode, 8, i, getBit(bits, i)); - setModule(qrcode, 8, 7, getBit(bits, 6)); - setModule(qrcode, 8, 8, getBit(bits, 7)); - setModule(qrcode, 7, 8, getBit(bits, 8)); - for(int i = 9; i < 15; i++) - setModule(qrcode, 14 - i, 8, getBit(bits, i)); - - // Draw second copy - int qrsize = qrcodegen_getSize(qrcode); - for(int i = 0; i < 8; i++) - setModule(qrcode, qrsize - 1 - i, 8, getBit(bits, i)); - for(int i = 8; i < 15; i++) - setModule(qrcode, 8, qrsize - 15 + i, getBit(bits, i)); - setModule(qrcode, 8, qrsize - 8, true); // Always black -} - - -// Calculates and stores an ascending list of positions of alignment patterns -// for this version number, returning the length of the list (in the range [0,7]). -// Each position is in the range [0,177), and are used on both the x and y axes. -// This could be implemented as lookup table of 40 variable-length lists of unsigned bytes. -testable int getAlignmentPatternPositions(int version, uint8_t result[7]) -{ - if(version == 1) - return 0; - int numAlign = version / 7 + 2; - int step = (version == 32) ? 26 : - (version * 4 + numAlign * 2 + 1) / (numAlign * 2 - 2) * 2; - for(int i = numAlign - 1, pos = version * 4 + 10; i >= 1; i--, pos -= step) - result[i] = pos; - result[0] = 6; - return numAlign; -} - - -// Sets every pixel in the range [left : left + width] * [top : top + height] to black. -static void fillRectangle(int left, int top, int width, int height, uint8_t qrcode[]) -{ - for(int dy = 0; dy < height; dy++) { - for(int dx = 0; dx < width; dx++) - setModule(qrcode, left + dx, top + dy, true); - } -} - - - -/*---- Drawing data modules and masking ----*/ - -// Draws the raw codewords (including data and ECC) onto the given QR Code. This requires the initial state of -// the QR Code to be black at function modules and white at codeword modules (including unused remainder bits). -static void drawCodewords(const uint8_t data[], int dataLen, uint8_t qrcode[]) -{ - int qrsize = qrcodegen_getSize(qrcode); - int i = 0; // Bit index into the data - // Do the funny zigzag scan - for(int right = qrsize - 1; right >= 1; right -= 2) { // Index of right column in each column pair - if(right == 6) - right = 5; - for(int vert = 0; vert < qrsize; vert++) { // Vertical counter - for(int j = 0; j < 2; j++) { - int x = right - j; // Actual x coordinate - bool upward = ((right + 1) & 2) == 0; - int y = upward ? qrsize - 1 - vert : vert; // Actual y coordinate - if(!getModule(qrcode, x, y) && i < dataLen * 8) { - bool black = getBit(data[i >> 3], 7 - (i & 7)); - setModule(qrcode, x, y, black); - i++; - } - // If this QR Code has any remainder bits (0 to 7), they were assigned as - // 0/false/white by the constructor and are left unchanged by this method - } - } - } - LV_ASSERT(i == dataLen * 8); -} - - -// XORs the codeword modules in this QR Code with the given mask pattern. -// The function modules must be marked and the codeword bits must be drawn -// before masking. Due to the arithmetic of XOR, calling applyMask() with -// the same mask value a second time will undo the mask. A final well-formed -// QR Code needs exactly one (not zero, two, etc.) mask applied. -static void applyMask(const uint8_t functionModules[], uint8_t qrcode[], enum qrcodegen_Mask mask) -{ - LV_ASSERT(0 <= (int)mask && (int)mask <= 7); // Disallows qrcodegen_Mask_AUTO - int qrsize = qrcodegen_getSize(qrcode); - for(int y = 0; y < qrsize; y++) { - for(int x = 0; x < qrsize; x++) { - if(getModule(functionModules, x, y)) - continue; - bool invert; - switch((int)mask) { - case 0: - invert = (x + y) % 2 == 0; - break; - case 1: - invert = y % 2 == 0; - break; - case 2: - invert = x % 3 == 0; - break; - case 3: - invert = (x + y) % 3 == 0; - break; - case 4: - invert = (x / 3 + y / 2) % 2 == 0; - break; - case 5: - invert = x * y % 2 + x * y % 3 == 0; - break; - case 6: - invert = (x * y % 2 + x * y % 3) % 2 == 0; - break; - case 7: - invert = ((x + y) % 2 + x * y % 3) % 2 == 0; - break; - default: - LV_ASSERT(false); - return; - } - bool val = getModule(qrcode, x, y); - setModule(qrcode, x, y, val ^ invert); - } - } -} - - -// Calculates and returns the penalty score based on state of the given QR Code's current modules. -// This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score. -static long getPenaltyScore(const uint8_t qrcode[]) -{ - int qrsize = qrcodegen_getSize(qrcode); - long result = 0; - - // Adjacent modules in row having same color, and finder-like patterns - for(int y = 0; y < qrsize; y++) { - unsigned char runHistory[7] = {0}; - bool color = false; - unsigned char runX = 0; - for(int x = 0; x < qrsize; x++) { - if(getModule(qrcode, x, y) == color) { - runX++; - if(runX == 5) - result += PENALTY_N1; - else if(runX > 5) - result++; - } - else { - addRunToHistory(runX, runHistory); - if(!color && hasFinderLikePattern(runHistory)) - result += PENALTY_N3; - color = getModule(qrcode, x, y); - runX = 1; - } - } - addRunToHistory(runX, runHistory); - if(color) - addRunToHistory(0, runHistory); // Dummy run of white - if(hasFinderLikePattern(runHistory)) - result += PENALTY_N3; - } - // Adjacent modules in column having same color, and finder-like patterns - for(int x = 0; x < qrsize; x++) { - unsigned char runHistory[7] = {0}; - bool color = false; - unsigned char runY = 0; - for(int y = 0; y < qrsize; y++) { - if(getModule(qrcode, x, y) == color) { - runY++; - if(runY == 5) - result += PENALTY_N1; - else if(runY > 5) - result++; - } - else { - addRunToHistory(runY, runHistory); - if(!color && hasFinderLikePattern(runHistory)) - result += PENALTY_N3; - color = getModule(qrcode, x, y); - runY = 1; - } - } - addRunToHistory(runY, runHistory); - if(color) - addRunToHistory(0, runHistory); // Dummy run of white - if(hasFinderLikePattern(runHistory)) - result += PENALTY_N3; - } - - // 2*2 blocks of modules having same color - for(int y = 0; y < qrsize - 1; y++) { - for(int x = 0; x < qrsize - 1; x++) { - bool color = getModule(qrcode, x, y); - if(color == getModule(qrcode, x + 1, y) && - color == getModule(qrcode, x, y + 1) && - color == getModule(qrcode, x + 1, y + 1)) - result += PENALTY_N2; - } - } - - // Balance of black and white modules - int black = 0; - for(int y = 0; y < qrsize; y++) { - for(int x = 0; x < qrsize; x++) { - if(getModule(qrcode, x, y)) - black++; - } - } - int total = qrsize * qrsize; // Note that size is odd, so black/total != 1/2 - // Compute the smallest integer k >= 0 such that (45-5k)% <= black/total <= (55+5k)% - int k = (int)((labs(black * 20L - total * 10L) + total - 1) / total) - 1; - result += k * PENALTY_N4; - return result; -} - - -// Inserts the given value to the front of the given array, which shifts over the -// existing values and deletes the last value. A helper function for getPenaltyScore(). -static void addRunToHistory(unsigned char run, unsigned char history[7]) -{ - memmove(&history[1], &history[0], 6 * sizeof(history[0])); - history[0] = run; -} - - -// Tests whether the given run history has the pattern of ratio 1:1:3:1:1 in the middle, and -// surrounded by at least 4 on either or both ends. A helper function for getPenaltyScore(). -// Must only be called immediately after a run of white modules has ended. -static bool hasFinderLikePattern(const unsigned char runHistory[7]) -{ - unsigned char n = runHistory[1]; - // The maximum QR Code size is 177, hence the run length n <= 177. - // Arithmetic is promoted to int, so n*4 will not overflow. - return n > 0 && runHistory[2] == n && runHistory[4] == n && runHistory[5] == n - && runHistory[3] == n * 3 && (runHistory[0] >= n * 4 || runHistory[6] >= n * 4); -} - - - -/*---- Basic QR Code information ----*/ - -// Public function - see documentation comment in header file. -int qrcodegen_getSize(const uint8_t qrcode[]) -{ - LV_ASSERT(qrcode != NULL); - int result = qrcode[0]; - LV_ASSERT((qrcodegen_VERSION_MIN * 4 + 17) <= result - && result <= (qrcodegen_VERSION_MAX * 4 + 17)); - return result; -} - - -// Public function - see documentation comment in header file. -bool qrcodegen_getModule(const uint8_t qrcode[], int x, int y) -{ - LV_ASSERT(qrcode != NULL); - int qrsize = qrcode[0]; - return (0 <= x && x < qrsize && 0 <= y && y < qrsize) && getModule(qrcode, x, y); -} - - -// Gets the module at the given coordinates, which must be in bounds. -testable bool getModule(const uint8_t qrcode[], int x, int y) -{ - int qrsize = qrcode[0]; - LV_ASSERT(21 <= qrsize && qrsize <= 177 && 0 <= x && x < qrsize && 0 <= y && y < qrsize); - int index = y * qrsize + x; - return getBit(qrcode[(index >> 3) + 1], index & 7); -} - - -// Sets the module at the given coordinates, which must be in bounds. -testable void setModule(uint8_t qrcode[], int x, int y, bool isBlack) -{ - int qrsize = qrcode[0]; - LV_ASSERT(21 <= qrsize && qrsize <= 177 && 0 <= x && x < qrsize && 0 <= y && y < qrsize); - int index = y * qrsize + x; - int bitIndex = index & 7; - int byteIndex = (index >> 3) + 1; - if(isBlack) - qrcode[byteIndex] |= 1 << bitIndex; - else - qrcode[byteIndex] &= (1 << bitIndex) ^ 0xFF; -} - - -// Sets the module at the given coordinates, doing nothing if out of bounds. -testable void setModuleBounded(uint8_t qrcode[], int x, int y, bool isBlack) -{ - int qrsize = qrcode[0]; - if(0 <= x && x < qrsize && 0 <= y && y < qrsize) - setModule(qrcode, x, y, isBlack); -} - - -// Returns true iff the i'th bit of x is set to 1. Requires x >= 0 and 0 <= i <= 14. -static bool getBit(int x, int i) -{ - return ((x >> i) & 1) != 0; -} - - - -/*---- Segment handling ----*/ - -// Public function - see documentation comment in header file. -bool qrcodegen_isAlphanumeric(const char * text) -{ - LV_ASSERT(text != NULL); - for(; *text != '\0'; text++) { - if(strchr(ALPHANUMERIC_CHARSET, *text) == NULL) - return false; - } - return true; -} - - -// Public function - see documentation comment in header file. -bool qrcodegen_isNumeric(const char * text) -{ - LV_ASSERT(text != NULL); - for(; *text != '\0'; text++) { - if(*text < '0' || *text > '9') - return false; - } - return true; -} - - -// Public function - see documentation comment in header file. -size_t qrcodegen_calcSegmentBufferSize(enum qrcodegen_Mode mode, size_t numChars) -{ - int temp = calcSegmentBitLength(mode, numChars); - if(temp == -1) - return SIZE_MAX; - LV_ASSERT(0 <= temp && temp <= INT16_MAX); - return ((size_t)temp + 7) / 8; -} - - -// Returns the number of data bits needed to represent a segment -// containing the given number of characters using the given mode. Notes: -// - Returns -1 on failure, i.e. numChars > INT16_MAX or -// the number of needed bits exceeds INT16_MAX (i.e. 32767). -// - Otherwise, all valid results are in the range [0, INT16_MAX]. -// - For byte mode, numChars measures the number of bytes, not Unicode code points. -// - For ECI mode, numChars must be 0, and the worst-case number of bits is returned. -// An actual ECI segment can have shorter data. For non-ECI modes, the result is exact. -testable int calcSegmentBitLength(enum qrcodegen_Mode mode, size_t numChars) -{ - // All calculations are designed to avoid overflow on all platforms - if(numChars > (unsigned int)INT16_MAX) - return -1; - long result = (long)numChars; - if(mode == qrcodegen_Mode_NUMERIC) - result = (result * 10 + 2) / 3; // ceil(10/3 * n) - else if(mode == qrcodegen_Mode_ALPHANUMERIC) - result = (result * 11 + 1) / 2; // ceil(11/2 * n) - else if(mode == qrcodegen_Mode_BYTE) - result *= 8; - else if(mode == qrcodegen_Mode_KANJI) - result *= 13; - else if(mode == qrcodegen_Mode_ECI && numChars == 0) - result = 3 * 8; - else { // Invalid argument - LV_ASSERT(false); - return -1; - } - LV_ASSERT(result >= 0); - if((unsigned int)result > (unsigned int)INT16_MAX) - return -1; - return (int)result; -} - - -// Public function - see documentation comment in header file. -struct qrcodegen_Segment qrcodegen_makeBytes(const uint8_t data[], size_t len, uint8_t buf[]) -{ - LV_ASSERT(data != NULL || len == 0); - struct qrcodegen_Segment result; - result.mode = qrcodegen_Mode_BYTE; - result.bitLength = calcSegmentBitLength(result.mode, len); - LV_ASSERT(result.bitLength != -1); - result.numChars = (int)len; - if(len > 0) - memcpy(buf, data, len * sizeof(buf[0])); - result.data = buf; - return result; -} - - -// Public function - see documentation comment in header file. -struct qrcodegen_Segment qrcodegen_makeNumeric(const char * digits, uint8_t buf[]) -{ - LV_ASSERT(digits != NULL); - struct qrcodegen_Segment result; - size_t len = strlen(digits); - result.mode = qrcodegen_Mode_NUMERIC; - int bitLen = calcSegmentBitLength(result.mode, len); - LV_ASSERT(bitLen != -1); - result.numChars = (int)len; - if(bitLen > 0) - memset(buf, 0, ((size_t)bitLen + 7) / 8 * sizeof(buf[0])); - result.bitLength = 0; - - unsigned int accumData = 0; - int accumCount = 0; - for(; *digits != '\0'; digits++) { - char c = *digits; - LV_ASSERT('0' <= c && c <= '9'); - accumData = accumData * 10 + (unsigned int)(c - '0'); - accumCount++; - if(accumCount == 3) { - appendBitsToBuffer(accumData, 10, buf, &result.bitLength); - accumData = 0; - accumCount = 0; - } - } - if(accumCount > 0) // 1 or 2 digits remaining - appendBitsToBuffer(accumData, accumCount * 3 + 1, buf, &result.bitLength); - LV_ASSERT(result.bitLength == bitLen); - result.data = buf; - return result; -} - - -// Public function - see documentation comment in header file. -struct qrcodegen_Segment qrcodegen_makeAlphanumeric(const char * text, uint8_t buf[]) -{ - LV_ASSERT(text != NULL); - struct qrcodegen_Segment result; - size_t len = strlen(text); - result.mode = qrcodegen_Mode_ALPHANUMERIC; - int bitLen = calcSegmentBitLength(result.mode, len); - LV_ASSERT(bitLen != -1); - result.numChars = (int)len; - if(bitLen > 0) - memset(buf, 0, ((size_t)bitLen + 7) / 8 * sizeof(buf[0])); - result.bitLength = 0; - - unsigned int accumData = 0; - int accumCount = 0; - for(; *text != '\0'; text++) { - const char * temp = strchr(ALPHANUMERIC_CHARSET, *text); - LV_ASSERT(temp != NULL); - accumData = accumData * 45 + (unsigned int)(temp - ALPHANUMERIC_CHARSET); - accumCount++; - if(accumCount == 2) { - appendBitsToBuffer(accumData, 11, buf, &result.bitLength); - accumData = 0; - accumCount = 0; - } - } - if(accumCount > 0) // 1 character remaining - appendBitsToBuffer(accumData, 6, buf, &result.bitLength); - LV_ASSERT(result.bitLength == bitLen); - result.data = buf; - return result; -} - - -// Public function - see documentation comment in header file. -struct qrcodegen_Segment qrcodegen_makeEci(long assignVal, uint8_t buf[]) -{ - struct qrcodegen_Segment result; - result.mode = qrcodegen_Mode_ECI; - result.numChars = 0; - result.bitLength = 0; - if(assignVal < 0) { - LV_ASSERT(false); - } - else if(assignVal < (1 << 7)) { - memset(buf, 0, 1 * sizeof(buf[0])); - appendBitsToBuffer(assignVal, 8, buf, &result.bitLength); - } - else if(assignVal < (1 << 14)) { - memset(buf, 0, 2 * sizeof(buf[0])); - appendBitsToBuffer(2, 2, buf, &result.bitLength); - appendBitsToBuffer(assignVal, 14, buf, &result.bitLength); - } - else if(assignVal < 1000000L) { - memset(buf, 0, 3 * sizeof(buf[0])); - appendBitsToBuffer(6, 3, buf, &result.bitLength); - appendBitsToBuffer(assignVal >> 10, 11, buf, &result.bitLength); - appendBitsToBuffer(assignVal & 0x3FF, 10, buf, &result.bitLength); - } - else { - LV_ASSERT(false); - } - result.data = buf; - return result; -} - - -// Calculates the number of bits needed to encode the given segments at the given version. -// Returns a non-negative number if successful. Otherwise returns -1 if a segment has too -// many characters to fit its length field, or the total bits exceeds INT16_MAX. -testable int getTotalBits(const struct qrcodegen_Segment segs[], size_t len, int version) -{ - LV_ASSERT(segs != NULL || len == 0); - long result = 0; - for(size_t i = 0; i < len; i++) { - int numChars = segs[i].numChars; - int bitLength = segs[i].bitLength; - LV_ASSERT(0 <= numChars && numChars <= INT16_MAX); - LV_ASSERT(0 <= bitLength && bitLength <= INT16_MAX); - int ccbits = numCharCountBits(segs[i].mode, version); - LV_ASSERT(0 <= ccbits && ccbits <= 16); - if(numChars >= (1L << ccbits)) - return -1; // The segment's length doesn't fit the field's bit width - result += 4L + ccbits + bitLength; - if(result > INT16_MAX) - return -1; // The sum might overflow an int type - } - LV_ASSERT(0 <= result && result <= INT16_MAX); - return (int)result; -} - - -// Returns the bit width of the character count field for a segment in the given mode -// in a QR Code at the given version number. The result is in the range [0, 16]. -static int numCharCountBits(enum qrcodegen_Mode mode, int version) -{ - LV_ASSERT(qrcodegen_VERSION_MIN <= version && version <= qrcodegen_VERSION_MAX); - int i = (version + 7) / 17; - switch(mode) { - case qrcodegen_Mode_NUMERIC : { - static const int temp[] = {10, 12, 14}; - return temp[i]; - } - case qrcodegen_Mode_ALPHANUMERIC: { - static const int temp[] = { 9, 11, 13}; - return temp[i]; - } - case qrcodegen_Mode_BYTE : { - static const int temp[] = { 8, 16, 16}; - return temp[i]; - } - case qrcodegen_Mode_KANJI : { - static const int temp[] = { 8, 10, 12}; - return temp[i]; - } - case qrcodegen_Mode_ECI : - return 0; - default: - LV_ASSERT(false); - return -1; // Dummy value - } -} - -int qrcodegen_getMinFitVersion(enum qrcodegen_Ecc ecl, size_t dataLen) -{ - struct qrcodegen_Segment seg; - seg.mode = qrcodegen_Mode_BYTE; - seg.bitLength = calcSegmentBitLength(seg.mode, dataLen); - seg.numChars = (int)dataLen; - - for(int version = qrcodegen_VERSION_MIN; version <= qrcodegen_VERSION_MAX; version++) { - int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; // Number of data bits available - int dataUsedBits = getTotalBits(&seg, 1, version); - if(dataUsedBits != -1 && dataUsedBits <= dataCapacityBits) - return version; - } - return -1; -} - -int qrcodegen_version2size(int version) -{ - if(version < qrcodegen_VERSION_MIN || version > qrcodegen_VERSION_MAX) { - return -1; - } - - return ((version - 1) * 4 + 21); -} -#endif diff --git a/L3_Middlewares/LVGL/src/libs/rle/lv_rle.c b/L3_Middlewares/LVGL/src/libs/rle/lv_rle.c deleted file mode 100644 index e715b7c..0000000 --- a/L3_Middlewares/LVGL/src/libs/rle/lv_rle.c +++ /dev/null @@ -1,112 +0,0 @@ -/** - * @file lv_rle.c - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../stdlib/lv_string.h" -#include "lv_rle.h" - -#if LV_USE_RLE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -uint32_t lv_rle_decompress(const uint8_t * input, - uint32_t input_buff_len, uint8_t * output, - uint32_t output_buff_len, uint8_t blk_size) -{ - uint32_t ctrl_byte; - uint32_t rd_len = 0; - uint32_t wr_len = 0; - - while(rd_len < input_buff_len) { - ctrl_byte = input[0]; - rd_len++; - input++; - if(rd_len > input_buff_len) - return 0; - - if(ctrl_byte & 0x80) { - /* copy directly from input to output */ - uint32_t bytes = blk_size * (ctrl_byte & 0x7f); - rd_len += bytes; - if(rd_len > input_buff_len) - return 0; - - wr_len += bytes; - if(wr_len > output_buff_len) { - if(wr_len > output_buff_len + blk_size) - return 0; /* Error */ - lv_memcpy(output, input, output_buff_len - (wr_len - bytes)); - return output_buff_len; - } - - lv_memcpy(output, input, bytes); - output += bytes; - input += bytes; - } - else { - rd_len += blk_size; - if(rd_len > input_buff_len) - return 0; - - wr_len += blk_size * ctrl_byte; - if(wr_len > output_buff_len) { - if(wr_len > output_buff_len + blk_size) - return 0; /* Error happened */ - - /* Skip the last pixel, which could overflow output buffer.*/ - for(uint32_t i = 0; i < ctrl_byte - 1; i++) { - lv_memcpy(output, input, blk_size); - output += blk_size; - } - return output_buff_len; - } - - if(blk_size == 1) { - /* optimize the most common case. */ - lv_memset(output, input[0], ctrl_byte); - output += ctrl_byte; - } - else { - for(uint32_t i = 0; i < ctrl_byte; i++) { - lv_memcpy(output, input, blk_size); - output += blk_size; - } - } - input += blk_size; - } - } - - return wr_len; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_RLE*/ diff --git a/L3_Middlewares/LVGL/src/libs/rle/lv_rle.h b/L3_Middlewares/LVGL/src/libs/rle/lv_rle.h deleted file mode 100644 index 02ab6a3..0000000 --- a/L3_Middlewares/LVGL/src/libs/rle/lv_rle.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file lv_rle.h - * - */ - -#ifndef LV_RLE_H -#define LV_RLE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" - -#if LV_USE_RLE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -uint32_t lv_rle_decompress(const uint8_t * input, - uint32_t input_buff_len, uint8_t * output, - uint32_t output_buff_len, uint8_t blk_size); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_RLE*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*LV_RLE_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/rlottie/lv_rlottie_private.h b/L3_Middlewares/LVGL/src/libs/rlottie/lv_rlottie_private.h deleted file mode 100644 index 91587bd..0000000 --- a/L3_Middlewares/LVGL/src/libs/rlottie/lv_rlottie_private.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @file lv_rlottie_private.h - * - */ - -#ifndef LV_RLOTTIE_PRIVATE_H -#define LV_RLOTTIE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_rlottie.h" -#if LV_USE_RLOTTIE -#include "../../widgets/image/lv_image_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** definition in lottieanimation_capi.c */ -struct Lottie_Animation_S; - -struct lv_rlottie_t { - lv_image_t img_ext; - struct Lottie_Animation_S * animation; - lv_timer_t * task; - lv_image_dsc_t imgdsc; - size_t total_frames; - size_t current_frame; - size_t framerate; - uint32_t * allocated_buf; - size_t allocated_buffer_size; - size_t scanline_width; - lv_rlottie_ctrl_t play_ctrl; - size_t dest_frame; -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_RLOTTIE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_RLOTTIE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/add_lvgl_if.sh b/L3_Middlewares/LVGL/src/libs/thorvg/add_lvgl_if.sh deleted file mode 100644 index 43ce903..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/add_lvgl_if.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -#Add LVGL #if LV_USE_THORVG_INTERNAL guard -#Usage -# find -name "*.cpp" | xargs ./add_lvgl_if.sh -# find -name "t*.h" | xargs ./add_lvgl_if.sh - -sed '0,/\*\/$/ {/\*\/$/ {n; s|^|\n#include "../../lv_conf_internal.h"\n#if LV_USE_THORVG_INTERNAL\n|}}' $@ -i - -sed -i -e '$a\ -\ -#endif /* LV_USE_THORVG_INTERNAL */\ -' $@ -i diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/config.h b/L3_Middlewares/LVGL/src/libs/thorvg/config.h deleted file mode 100644 index baa258a..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/config.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Autogenerated by the Meson build system. - * Do not edit, your changes will be lost. - */ - -#pragma once - -#define THORVG_SW_RASTER_SUPPORT 1 - -#define THORVG_SVG_LOADER_SUPPORT LV_USE_LOTTIE - -#define THORVG_LOTTIE_LOADER_SUPPORT LV_USE_LOTTIE - -#define THORVG_VERSION_STRING "0.13.5" - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/allocators.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/allocators.h deleted file mode 100644 index a943cf1..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/allocators.h +++ /dev/null @@ -1,693 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_ALLOCATORS_H_ -#define RAPIDJSON_ALLOCATORS_H_ - -#include "rapidjson.h" -#include "internal/meta.h" - -#include -#include - -#if RAPIDJSON_HAS_CXX11 -#include -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// Allocator - -/*! \class rapidjson::Allocator - \brief Concept for allocating, resizing and freeing memory block. - - Note that Malloc() and Realloc() are non-static but Free() is static. - - So if an allocator need to support Free(), it needs to put its pointer in - the header of memory block. - -\code -concept Allocator { - static const bool kNeedFree; //!< Whether this allocator needs to call Free(). - - // Allocate a memory block. - // \param size of the memory block in bytes. - // \returns pointer to the memory block. - void* Malloc(size_t size); - - // Resize a memory block. - // \param originalPtr The pointer to current memory block. Null pointer is permitted. - // \param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.) - // \param newSize the new size in bytes. - void* Realloc(void* originalPtr, size_t originalSize, size_t newSize); - - // Free a memory block. - // \param pointer to the memory block. Null pointer is permitted. - static void Free(void *ptr); -}; -\endcode -*/ - - -/*! \def RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY - \ingroup RAPIDJSON_CONFIG - \brief User-defined kDefaultChunkCapacity definition. - - User can define this as any \c size that is a power of 2. -*/ - -#ifndef RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY -#define RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY (64 * 1024) -#endif - - -/////////////////////////////////////////////////////////////////////////////// -// CrtAllocator - -//! C-runtime library allocator. -/*! This class is just wrapper for standard C library memory routines. - \note implements Allocator concept -*/ -class CrtAllocator { -public: - static const bool kNeedFree = true; - void* Malloc(size_t size) { - if (size) // behavior of malloc(0) is implementation defined. - return RAPIDJSON_MALLOC(size); - else - return NULL; // standardize to returning NULL. - } - void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { - (void)originalSize; - if (newSize == 0) { - RAPIDJSON_FREE(originalPtr); - return NULL; - } - return RAPIDJSON_REALLOC(originalPtr, newSize); - } - static void Free(void *ptr) RAPIDJSON_NOEXCEPT { RAPIDJSON_FREE(ptr); } - - bool operator==(const CrtAllocator&) const RAPIDJSON_NOEXCEPT { - return true; - } - bool operator!=(const CrtAllocator&) const RAPIDJSON_NOEXCEPT { - return false; - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// MemoryPoolAllocator - -//! Default memory allocator used by the parser and DOM. -/*! This allocator allocate memory blocks from pre-allocated memory chunks. - - It does not free memory blocks. And Realloc() only allocate new memory. - - The memory chunks are allocated by BaseAllocator, which is CrtAllocator by default. - - User may also supply a buffer as the first chunk. - - If the user-buffer is full then additional chunks are allocated by BaseAllocator. - - The user-buffer is not deallocated by this allocator. - - \tparam BaseAllocator the allocator type for allocating memory chunks. Default is CrtAllocator. - \note implements Allocator concept -*/ -template -class MemoryPoolAllocator { - //! Chunk header for perpending to each chunk. - /*! Chunks are stored as a singly linked list. - */ - struct ChunkHeader { - size_t capacity; //!< Capacity of the chunk in bytes (excluding the header itself). - size_t size; //!< Current size of allocated memory in bytes. - ChunkHeader *next; //!< Next chunk in the linked list. - }; - - struct SharedData { - ChunkHeader *chunkHead; //!< Head of the chunk linked-list. Only the head chunk serves allocation. - BaseAllocator* ownBaseAllocator; //!< base allocator created by this object. - size_t refcount; - bool ownBuffer; - }; - - static const size_t SIZEOF_SHARED_DATA = RAPIDJSON_ALIGN(sizeof(SharedData)); - static const size_t SIZEOF_CHUNK_HEADER = RAPIDJSON_ALIGN(sizeof(ChunkHeader)); - - static inline ChunkHeader *GetChunkHead(SharedData *shared) - { - return reinterpret_cast(reinterpret_cast(shared) + SIZEOF_SHARED_DATA); - } - static inline uint8_t *GetChunkBuffer(SharedData *shared) - { - return reinterpret_cast(shared->chunkHead) + SIZEOF_CHUNK_HEADER; - } - - static const size_t kDefaultChunkCapacity = RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY; //!< Default chunk capacity. - -public: - static const bool kNeedFree = false; //!< Tell users that no need to call Free() with this allocator. (concept Allocator) - static const bool kRefCounted = true; //!< Tell users that this allocator is reference counted on copy - - //! Constructor with chunkSize. - /*! \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. - \param baseAllocator The allocator for allocating memory chunks. - */ - explicit - MemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : - chunk_capacity_(chunkSize), - baseAllocator_(baseAllocator ? baseAllocator : RAPIDJSON_NEW(BaseAllocator)()), - shared_(static_cast(baseAllocator_ ? baseAllocator_->Malloc(SIZEOF_SHARED_DATA + SIZEOF_CHUNK_HEADER) : 0)) - { - RAPIDJSON_ASSERT(baseAllocator_ != 0); - RAPIDJSON_ASSERT(shared_ != 0); - if (baseAllocator) { - shared_->ownBaseAllocator = 0; - } - else { - shared_->ownBaseAllocator = baseAllocator_; - } - shared_->chunkHead = GetChunkHead(shared_); - shared_->chunkHead->capacity = 0; - shared_->chunkHead->size = 0; - shared_->chunkHead->next = 0; - shared_->ownBuffer = true; - shared_->refcount = 1; - } - - //! Constructor with user-supplied buffer. - /*! The user buffer will be used firstly. When it is full, memory pool allocates new chunk with chunk size. - - The user buffer will not be deallocated when this allocator is destructed. - - \param buffer User supplied buffer. - \param size Size of the buffer in bytes. It must at least larger than sizeof(ChunkHeader). - \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. - \param baseAllocator The allocator for allocating memory chunks. - */ - MemoryPoolAllocator(void *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : - chunk_capacity_(chunkSize), - baseAllocator_(baseAllocator), - shared_(static_cast(AlignBuffer(buffer, size))) - { - RAPIDJSON_ASSERT(size >= SIZEOF_SHARED_DATA + SIZEOF_CHUNK_HEADER); - shared_->chunkHead = GetChunkHead(shared_); - shared_->chunkHead->capacity = size - SIZEOF_SHARED_DATA - SIZEOF_CHUNK_HEADER; - shared_->chunkHead->size = 0; - shared_->chunkHead->next = 0; - shared_->ownBaseAllocator = 0; - shared_->ownBuffer = false; - shared_->refcount = 1; - } - - MemoryPoolAllocator(const MemoryPoolAllocator& rhs) RAPIDJSON_NOEXCEPT : - chunk_capacity_(rhs.chunk_capacity_), - baseAllocator_(rhs.baseAllocator_), - shared_(rhs.shared_) - { - RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); - ++shared_->refcount; - } - MemoryPoolAllocator& operator=(const MemoryPoolAllocator& rhs) RAPIDJSON_NOEXCEPT - { - RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0); - ++rhs.shared_->refcount; - this->~MemoryPoolAllocator(); - baseAllocator_ = rhs.baseAllocator_; - chunk_capacity_ = rhs.chunk_capacity_; - shared_ = rhs.shared_; - return *this; - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - MemoryPoolAllocator(MemoryPoolAllocator&& rhs) RAPIDJSON_NOEXCEPT : - chunk_capacity_(rhs.chunk_capacity_), - baseAllocator_(rhs.baseAllocator_), - shared_(rhs.shared_) - { - RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0); - rhs.shared_ = 0; - } - MemoryPoolAllocator& operator=(MemoryPoolAllocator&& rhs) RAPIDJSON_NOEXCEPT - { - RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0); - this->~MemoryPoolAllocator(); - baseAllocator_ = rhs.baseAllocator_; - chunk_capacity_ = rhs.chunk_capacity_; - shared_ = rhs.shared_; - rhs.shared_ = 0; - return *this; - } -#endif - - //! Destructor. - /*! This deallocates all memory chunks, excluding the user-supplied buffer. - */ - ~MemoryPoolAllocator() RAPIDJSON_NOEXCEPT { - if (!shared_) { - // do nothing if moved - return; - } - if (shared_->refcount > 1) { - --shared_->refcount; - return; - } - Clear(); - BaseAllocator *a = shared_->ownBaseAllocator; - if (shared_->ownBuffer) { - baseAllocator_->Free(shared_); - } - RAPIDJSON_DELETE(a); - } - - //! Deallocates all memory chunks, excluding the first/user one. - void Clear() RAPIDJSON_NOEXCEPT { - RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); - for (;;) { - ChunkHeader* c = shared_->chunkHead; - if (!c->next) { - break; - } - shared_->chunkHead = c->next; - baseAllocator_->Free(c); - } - shared_->chunkHead->size = 0; - } - - //! Computes the total capacity of allocated memory chunks. - /*! \return total capacity in bytes. - */ - size_t Capacity() const RAPIDJSON_NOEXCEPT { - RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); - size_t capacity = 0; - for (ChunkHeader* c = shared_->chunkHead; c != 0; c = c->next) - capacity += c->capacity; - return capacity; - } - - //! Computes the memory blocks allocated. - /*! \return total used bytes. - */ - size_t Size() const RAPIDJSON_NOEXCEPT { - RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); - size_t size = 0; - for (ChunkHeader* c = shared_->chunkHead; c != 0; c = c->next) - size += c->size; - return size; - } - - //! Whether the allocator is shared. - /*! \return true or false. - */ - bool Shared() const RAPIDJSON_NOEXCEPT { - RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); - return shared_->refcount > 1; - } - - //! Allocates a memory block. (concept Allocator) - void* Malloc(size_t size) { - RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); - if (!size) - return NULL; - - size = RAPIDJSON_ALIGN(size); - if (RAPIDJSON_UNLIKELY(shared_->chunkHead->size + size > shared_->chunkHead->capacity)) - if (!AddChunk(chunk_capacity_ > size ? chunk_capacity_ : size)) - return NULL; - - void *buffer = GetChunkBuffer(shared_) + shared_->chunkHead->size; - shared_->chunkHead->size += size; - return buffer; - } - - //! Resizes a memory block (concept Allocator) - void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { - if (originalPtr == 0) - return Malloc(newSize); - - RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); - if (newSize == 0) - return NULL; - - originalSize = RAPIDJSON_ALIGN(originalSize); - newSize = RAPIDJSON_ALIGN(newSize); - - // Do not shrink if new size is smaller than original - if (originalSize >= newSize) - return originalPtr; - - // Simply expand it if it is the last allocation and there is sufficient space - if (originalPtr == GetChunkBuffer(shared_) + shared_->chunkHead->size - originalSize) { - size_t increment = static_cast(newSize - originalSize); - if (shared_->chunkHead->size + increment <= shared_->chunkHead->capacity) { - shared_->chunkHead->size += increment; - return originalPtr; - } - } - - // Realloc process: allocate and copy memory, do not free original buffer. - if (void* newBuffer = Malloc(newSize)) { - if (originalSize) - std::memcpy(newBuffer, originalPtr, originalSize); - return newBuffer; - } - else - return NULL; - } - - //! Frees a memory block (concept Allocator) - static void Free(void *ptr) RAPIDJSON_NOEXCEPT { (void)ptr; } // Do nothing - - //! Compare (equality) with another MemoryPoolAllocator - bool operator==(const MemoryPoolAllocator& rhs) const RAPIDJSON_NOEXCEPT { - RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); - RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0); - return shared_ == rhs.shared_; - } - //! Compare (inequality) with another MemoryPoolAllocator - bool operator!=(const MemoryPoolAllocator& rhs) const RAPIDJSON_NOEXCEPT { - return !operator==(rhs); - } - -private: - //! Creates a new chunk. - /*! \param capacity Capacity of the chunk in bytes. - \return true if success. - */ - bool AddChunk(size_t capacity) { - if (!baseAllocator_) - shared_->ownBaseAllocator = baseAllocator_ = RAPIDJSON_NEW(BaseAllocator)(); - if (ChunkHeader* chunk = static_cast(baseAllocator_->Malloc(SIZEOF_CHUNK_HEADER + capacity))) { - chunk->capacity = capacity; - chunk->size = 0; - chunk->next = shared_->chunkHead; - shared_->chunkHead = chunk; - return true; - } - else - return false; - } - - static inline void* AlignBuffer(void* buf, size_t &size) - { - RAPIDJSON_NOEXCEPT_ASSERT(buf != 0); - const uintptr_t mask = sizeof(void*) - 1; - const uintptr_t ubuf = reinterpret_cast(buf); - if (RAPIDJSON_UNLIKELY(ubuf & mask)) { - const uintptr_t abuf = (ubuf + mask) & ~mask; - RAPIDJSON_ASSERT(size >= abuf - ubuf); - buf = reinterpret_cast(abuf); - size -= abuf - ubuf; - } - return buf; - } - - size_t chunk_capacity_; //!< The minimum capacity of chunk when they are allocated. - BaseAllocator* baseAllocator_; //!< base allocator for allocating memory chunks. - SharedData *shared_; //!< The shared data of the allocator -}; - -namespace internal { - template - struct IsRefCounted : - public FalseType - { }; - template - struct IsRefCounted::Type> : - public TrueType - { }; -} - -template -inline T* Realloc(A& a, T* old_p, size_t old_n, size_t new_n) -{ - RAPIDJSON_NOEXCEPT_ASSERT(old_n <= (std::numeric_limits::max)() / sizeof(T) && new_n <= (std::numeric_limits::max)() / sizeof(T)); - return static_cast(a.Realloc(old_p, old_n * sizeof(T), new_n * sizeof(T))); -} - -template -inline T *Malloc(A& a, size_t n = 1) -{ - return Realloc(a, NULL, 0, n); -} - -template -inline void Free(A& a, T *p, size_t n = 1) -{ - static_cast(Realloc(a, p, n, 0)); -} - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) // std::allocator can safely be inherited -#endif - -template -class StdAllocator : - public std::allocator -{ - typedef std::allocator allocator_type; -#if RAPIDJSON_HAS_CXX11 - typedef std::allocator_traits traits_type; -#else - typedef allocator_type traits_type; -#endif - -public: - typedef BaseAllocator BaseAllocatorType; - - StdAllocator() RAPIDJSON_NOEXCEPT : - allocator_type(), - baseAllocator_() - { } - - StdAllocator(const StdAllocator& rhs) RAPIDJSON_NOEXCEPT : - allocator_type(rhs), - baseAllocator_(rhs.baseAllocator_) - { } - - template - StdAllocator(const StdAllocator& rhs) RAPIDJSON_NOEXCEPT : - allocator_type(rhs), - baseAllocator_(rhs.baseAllocator_) - { } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - StdAllocator(StdAllocator&& rhs) RAPIDJSON_NOEXCEPT : - allocator_type(std::move(rhs)), - baseAllocator_(std::move(rhs.baseAllocator_)) - { } -#endif -#if RAPIDJSON_HAS_CXX11 - using propagate_on_container_move_assignment = std::true_type; - using propagate_on_container_swap = std::true_type; -#endif - - /* implicit */ - StdAllocator(const BaseAllocator& allocator) RAPIDJSON_NOEXCEPT : - allocator_type(), - baseAllocator_(allocator) - { } - - ~StdAllocator() RAPIDJSON_NOEXCEPT - { } - - template - struct rebind { - typedef StdAllocator other; - }; - - typedef typename traits_type::size_type size_type; - typedef typename traits_type::difference_type difference_type; - - typedef typename traits_type::value_type value_type; - typedef typename traits_type::pointer pointer; - typedef typename traits_type::const_pointer const_pointer; - -#if RAPIDJSON_HAS_CXX11 - - typedef typename std::add_lvalue_reference::type &reference; - typedef typename std::add_lvalue_reference::type>::type &const_reference; - - pointer address(reference r) const RAPIDJSON_NOEXCEPT - { - return std::addressof(r); - } - const_pointer address(const_reference r) const RAPIDJSON_NOEXCEPT - { - return std::addressof(r); - } - - size_type max_size() const RAPIDJSON_NOEXCEPT - { - return traits_type::max_size(*this); - } - - template - void construct(pointer p, Args&&... args) - { - traits_type::construct(*this, p, std::forward(args)...); - } - void destroy(pointer p) - { - traits_type::destroy(*this, p); - } - -#else // !RAPIDJSON_HAS_CXX11 - - typedef typename allocator_type::reference reference; - typedef typename allocator_type::const_reference const_reference; - - pointer address(reference r) const RAPIDJSON_NOEXCEPT - { - return allocator_type::address(r); - } - const_pointer address(const_reference r) const RAPIDJSON_NOEXCEPT - { - return allocator_type::address(r); - } - - size_type max_size() const RAPIDJSON_NOEXCEPT - { - return allocator_type::max_size(); - } - - void construct(pointer p, const_reference r) - { - allocator_type::construct(p, r); - } - void destroy(pointer p) - { - allocator_type::destroy(p); - } - -#endif // !RAPIDJSON_HAS_CXX11 - - template - U* allocate(size_type n = 1, const void* = 0) - { - return RAPIDJSON_NAMESPACE::Malloc(baseAllocator_, n); - } - template - void deallocate(U* p, size_type n = 1) - { - RAPIDJSON_NAMESPACE::Free(baseAllocator_, p, n); - } - - pointer allocate(size_type n = 1, const void* = 0) - { - return allocate(n); - } - void deallocate(pointer p, size_type n = 1) - { - deallocate(p, n); - } - -#if RAPIDJSON_HAS_CXX11 - using is_always_equal = std::is_empty; -#endif - - template - bool operator==(const StdAllocator& rhs) const RAPIDJSON_NOEXCEPT - { - return baseAllocator_ == rhs.baseAllocator_; - } - template - bool operator!=(const StdAllocator& rhs) const RAPIDJSON_NOEXCEPT - { - return !operator==(rhs); - } - - //! rapidjson Allocator concept - static const bool kNeedFree = BaseAllocator::kNeedFree; - static const bool kRefCounted = internal::IsRefCounted::Value; - void* Malloc(size_t size) - { - return baseAllocator_.Malloc(size); - } - void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) - { - return baseAllocator_.Realloc(originalPtr, originalSize, newSize); - } - static void Free(void *ptr) RAPIDJSON_NOEXCEPT - { - BaseAllocator::Free(ptr); - } - -private: - template - friend class StdAllocator; // access to StdAllocator.* - - BaseAllocator baseAllocator_; -}; - -#if !RAPIDJSON_HAS_CXX17 // std::allocator deprecated in C++17 -template -class StdAllocator : - public std::allocator -{ - typedef std::allocator allocator_type; - -public: - typedef BaseAllocator BaseAllocatorType; - - StdAllocator() RAPIDJSON_NOEXCEPT : - allocator_type(), - baseAllocator_() - { } - - StdAllocator(const StdAllocator& rhs) RAPIDJSON_NOEXCEPT : - allocator_type(rhs), - baseAllocator_(rhs.baseAllocator_) - { } - - template - StdAllocator(const StdAllocator& rhs) RAPIDJSON_NOEXCEPT : - allocator_type(rhs), - baseAllocator_(rhs.baseAllocator_) - { } - - /* implicit */ - StdAllocator(const BaseAllocator& baseAllocator) RAPIDJSON_NOEXCEPT : - allocator_type(), - baseAllocator_(baseAllocator) - { } - - ~StdAllocator() RAPIDJSON_NOEXCEPT - { } - - template - struct rebind { - typedef StdAllocator other; - }; - - typedef typename allocator_type::value_type value_type; - -private: - template - friend class StdAllocator; // access to StdAllocator.* - - BaseAllocator baseAllocator_; -}; -#endif - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_ENCODINGS_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/cursorstreamwrapper.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/cursorstreamwrapper.h deleted file mode 100644 index fd6513d..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/cursorstreamwrapper.h +++ /dev/null @@ -1,78 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_CURSORSTREAMWRAPPER_H_ -#define RAPIDJSON_CURSORSTREAMWRAPPER_H_ - -#include "stream.h" - -#if defined(__GNUC__) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -#if defined(_MSC_VER) && _MSC_VER <= 1800 -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4702) // unreachable code -RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated -#endif - -RAPIDJSON_NAMESPACE_BEGIN - - -//! Cursor stream wrapper for counting line and column number if error exists. -/*! - \tparam InputStream Any stream that implements Stream Concept -*/ -template > -class CursorStreamWrapper : public GenericStreamWrapper { -public: - typedef typename Encoding::Ch Ch; - - CursorStreamWrapper(InputStream& is): - GenericStreamWrapper(is), line_(1), col_(0) {} - - // counting line and column number - Ch Take() { - Ch ch = this->is_.Take(); - if(ch == '\n') { - line_ ++; - col_ = 0; - } else { - col_ ++; - } - return ch; - } - - //! Get the error line number, if error exists. - size_t GetLine() const { return line_; } - //! Get the error column number, if error exists. - size_t GetColumn() const { return col_; } - -private: - size_t line_; //!< Current Line - size_t col_; //!< Current Column -}; - -#if defined(_MSC_VER) && _MSC_VER <= 1800 -RAPIDJSON_DIAG_POP -#endif - -#if defined(__GNUC__) -RAPIDJSON_DIAG_POP -#endif - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_CURSORSTREAMWRAPPER_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/document.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/document.h deleted file mode 100644 index f18fbd5..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/document.h +++ /dev/null @@ -1,3043 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_DOCUMENT_H_ -#define RAPIDJSON_DOCUMENT_H_ - -/*! \file document.h */ - -#include "reader.h" -#include "internal/meta.h" -#include "internal/strfunc.h" -#include "memorystream.h" -#include "encodedstream.h" -#include // placement new -#include -#ifdef __cpp_lib_three_way_comparison -#include -#endif - -RAPIDJSON_DIAG_PUSH -#ifdef __clang__ -RAPIDJSON_DIAG_OFF(padded) -RAPIDJSON_DIAG_OFF(switch-enum) -RAPIDJSON_DIAG_OFF(c++98-compat) -#elif defined(_MSC_VER) -RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant -RAPIDJSON_DIAG_OFF(4244) // conversion from kXxxFlags to 'uint16_t', possible loss of data -#endif - -#ifdef __GNUC__ -RAPIDJSON_DIAG_OFF(effc++) -#endif // __GNUC__ - -#ifdef GetObject -// see https://github.com/Tencent/rapidjson/issues/1448 -// a former included windows.h might have defined a macro called GetObject, which affects -// GetObject defined here. This ensures the macro does not get applied -#pragma push_macro("GetObject") -#define RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED -#undef GetObject -#endif - -#ifndef RAPIDJSON_NOMEMBERITERATORCLASS -#include // std::random_access_iterator_tag -#endif - -#if RAPIDJSON_USE_MEMBERSMAP -#include // std::multimap -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -// Forward declaration. -template -class GenericValue; - -template -class GenericDocument; - -/*! \def RAPIDJSON_DEFAULT_ALLOCATOR - \ingroup RAPIDJSON_CONFIG - \brief Allows to choose default allocator. - - User can define this to use CrtAllocator or MemoryPoolAllocator. -*/ -#ifndef RAPIDJSON_DEFAULT_ALLOCATOR -#define RAPIDJSON_DEFAULT_ALLOCATOR ::RAPIDJSON_NAMESPACE::MemoryPoolAllocator<::RAPIDJSON_NAMESPACE::CrtAllocator> -#endif - -/*! \def RAPIDJSON_DEFAULT_STACK_ALLOCATOR - \ingroup RAPIDJSON_CONFIG - \brief Allows to choose default stack allocator for Document. - - User can define this to use CrtAllocator or MemoryPoolAllocator. -*/ -#ifndef RAPIDJSON_DEFAULT_STACK_ALLOCATOR -#define RAPIDJSON_DEFAULT_STACK_ALLOCATOR ::RAPIDJSON_NAMESPACE::CrtAllocator -#endif - -/*! \def RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY - \ingroup RAPIDJSON_CONFIG - \brief User defined kDefaultObjectCapacity value. - - User can define this as any natural number. -*/ -#ifndef RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY -// number of objects that rapidjson::Value allocates memory for by default -#define RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY 16 -#endif - -/*! \def RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY - \ingroup RAPIDJSON_CONFIG - \brief User defined kDefaultArrayCapacity value. - - User can define this as any natural number. -*/ -#ifndef RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY -// number of array elements that rapidjson::Value allocates memory for by default -#define RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY 16 -#endif - -//! Name-value pair in a JSON object value. -/*! - This class was internal to GenericValue. It used to be a inner struct. - But a compiler (IBM XL C/C++ for AIX) have reported to have problem with that so it moved as a namespace scope struct. - https://code.google.com/p/rapidjson/issues/detail?id=64 -*/ -template -class GenericMember { -public: - GenericValue name; //!< name of member (must be a string) - GenericValue value; //!< value of member. - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move constructor in C++11 - GenericMember(GenericMember&& rhs) RAPIDJSON_NOEXCEPT - : name(std::move(rhs.name)), - value(std::move(rhs.value)) - { - } - - //! Move assignment in C++11 - GenericMember& operator=(GenericMember&& rhs) RAPIDJSON_NOEXCEPT { - return *this = static_cast(rhs); - } -#endif - - //! Assignment with move semantics. - /*! \param rhs Source of the assignment. Its name and value will become a null value after assignment. - */ - GenericMember& operator=(GenericMember& rhs) RAPIDJSON_NOEXCEPT { - if (RAPIDJSON_LIKELY(this != &rhs)) { - name = rhs.name; - value = rhs.value; - } - return *this; - } - - // swap() for std::sort() and other potential use in STL. - friend inline void swap(GenericMember& a, GenericMember& b) RAPIDJSON_NOEXCEPT { - a.name.Swap(b.name); - a.value.Swap(b.value); - } - -private: - //! Copy constructor is not permitted. - GenericMember(const GenericMember& rhs); -}; - -/////////////////////////////////////////////////////////////////////////////// -// GenericMemberIterator - -#ifndef RAPIDJSON_NOMEMBERITERATORCLASS - -//! (Constant) member iterator for a JSON object value -/*! - \tparam Const Is this a constant iterator? - \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) - \tparam Allocator Allocator type for allocating memory of object, array and string. - - This class implements a Random Access Iterator for GenericMember elements - of a GenericValue, see ISO/IEC 14882:2003(E) C++ standard, 24.1 [lib.iterator.requirements]. - - \note This iterator implementation is mainly intended to avoid implicit - conversions from iterator values to \c NULL, - e.g. from GenericValue::FindMember. - - \note Define \c RAPIDJSON_NOMEMBERITERATORCLASS to fall back to a - pointer-based implementation, if your platform doesn't provide - the C++ header. - - \see GenericMember, GenericValue::MemberIterator, GenericValue::ConstMemberIterator - */ -template -class GenericMemberIterator { - - friend class GenericValue; - template friend class GenericMemberIterator; - - typedef GenericMember PlainType; - typedef typename internal::MaybeAddConst::Type ValueType; - -public: - //! Iterator type itself - typedef GenericMemberIterator Iterator; - //! Constant iterator type - typedef GenericMemberIterator ConstIterator; - //! Non-constant iterator type - typedef GenericMemberIterator NonConstIterator; - - /** \name std::iterator_traits support */ - //@{ - typedef ValueType value_type; - typedef ValueType * pointer; - typedef ValueType & reference; - typedef std::ptrdiff_t difference_type; - typedef std::random_access_iterator_tag iterator_category; - //@} - - //! Pointer to (const) GenericMember - typedef pointer Pointer; - //! Reference to (const) GenericMember - typedef reference Reference; - //! Signed integer type (e.g. \c ptrdiff_t) - typedef difference_type DifferenceType; - - //! Default constructor (singular value) - /*! Creates an iterator pointing to no element. - \note All operations, except for comparisons, are undefined on such values. - */ - GenericMemberIterator() : ptr_() {} - - //! Iterator conversions to more const - /*! - \param it (Non-const) iterator to copy from - - Allows the creation of an iterator from another GenericMemberIterator - that is "less const". Especially, creating a non-constant iterator - from a constant iterator are disabled: - \li const -> non-const (not ok) - \li const -> const (ok) - \li non-const -> const (ok) - \li non-const -> non-const (ok) - - \note If the \c Const template parameter is already \c false, this - constructor effectively defines a regular copy-constructor. - Otherwise, the copy constructor is implicitly defined. - */ - GenericMemberIterator(const NonConstIterator & it) : ptr_(it.ptr_) {} - Iterator& operator=(const NonConstIterator & it) { ptr_ = it.ptr_; return *this; } - - //! @name stepping - //@{ - Iterator& operator++(){ ++ptr_; return *this; } - Iterator& operator--(){ --ptr_; return *this; } - Iterator operator++(int){ Iterator old(*this); ++ptr_; return old; } - Iterator operator--(int){ Iterator old(*this); --ptr_; return old; } - //@} - - //! @name increment/decrement - //@{ - Iterator operator+(DifferenceType n) const { return Iterator(ptr_+n); } - Iterator operator-(DifferenceType n) const { return Iterator(ptr_-n); } - - Iterator& operator+=(DifferenceType n) { ptr_+=n; return *this; } - Iterator& operator-=(DifferenceType n) { ptr_-=n; return *this; } - //@} - - //! @name relations - //@{ - template bool operator==(const GenericMemberIterator& that) const { return ptr_ == that.ptr_; } - template bool operator!=(const GenericMemberIterator& that) const { return ptr_ != that.ptr_; } - template bool operator<=(const GenericMemberIterator& that) const { return ptr_ <= that.ptr_; } - template bool operator>=(const GenericMemberIterator& that) const { return ptr_ >= that.ptr_; } - template bool operator< (const GenericMemberIterator& that) const { return ptr_ < that.ptr_; } - template bool operator> (const GenericMemberIterator& that) const { return ptr_ > that.ptr_; } - -#ifdef __cpp_lib_three_way_comparison - template std::strong_ordering operator<=>(const GenericMemberIterator& that) const { return ptr_ <=> that.ptr_; } -#endif - //@} - - //! @name dereference - //@{ - Reference operator*() const { return *ptr_; } - Pointer operator->() const { return ptr_; } - Reference operator[](DifferenceType n) const { return ptr_[n]; } - //@} - - //! Distance - DifferenceType operator-(ConstIterator that) const { return ptr_-that.ptr_; } - -private: - //! Internal constructor from plain pointer - explicit GenericMemberIterator(Pointer p) : ptr_(p) {} - - Pointer ptr_; //!< raw pointer -}; - -#else // RAPIDJSON_NOMEMBERITERATORCLASS - -// class-based member iterator implementation disabled, use plain pointers - -template -class GenericMemberIterator; - -//! non-const GenericMemberIterator -template -class GenericMemberIterator { -public: - //! use plain pointer as iterator type - typedef GenericMember* Iterator; -}; -//! const GenericMemberIterator -template -class GenericMemberIterator { -public: - //! use plain const pointer as iterator type - typedef const GenericMember* Iterator; -}; - -#endif // RAPIDJSON_NOMEMBERITERATORCLASS - -/////////////////////////////////////////////////////////////////////////////// -// GenericStringRef - -//! Reference to a constant string (not taking a copy) -/*! - \tparam CharType character type of the string - - This helper class is used to automatically infer constant string - references for string literals, especially from \c const \b (!) - character arrays. - - The main use is for creating JSON string values without copying the - source string via an \ref Allocator. This requires that the referenced - string pointers have a sufficient lifetime, which exceeds the lifetime - of the associated GenericValue. - - \b Example - \code - Value v("foo"); // ok, no need to copy & calculate length - const char foo[] = "foo"; - v.SetString(foo); // ok - - const char* bar = foo; - // Value x(bar); // not ok, can't rely on bar's lifetime - Value x(StringRef(bar)); // lifetime explicitly guaranteed by user - Value y(StringRef(bar, 3)); // ok, explicitly pass length - \endcode - - \see StringRef, GenericValue::SetString -*/ -template -struct GenericStringRef { - typedef CharType Ch; //!< character type of the string - - //! Create string reference from \c const character array -#ifndef __clang__ // -Wdocumentation - /*! - This constructor implicitly creates a constant string reference from - a \c const character array. It has better performance than - \ref StringRef(const CharType*) by inferring the string \ref length - from the array length, and also supports strings containing null - characters. - - \tparam N length of the string, automatically inferred - - \param str Constant character array, lifetime assumed to be longer - than the use of the string in e.g. a GenericValue - - \post \ref s == str - - \note Constant complexity. - \note There is a hidden, private overload to disallow references to - non-const character arrays to be created via this constructor. - By this, e.g. function-scope arrays used to be filled via - \c snprintf are excluded from consideration. - In such cases, the referenced string should be \b copied to the - GenericValue instead. - */ -#endif - template - GenericStringRef(const CharType (&str)[N]) RAPIDJSON_NOEXCEPT - : s(str), length(N-1) {} - - //! Explicitly create string reference from \c const character pointer -#ifndef __clang__ // -Wdocumentation - /*! - This constructor can be used to \b explicitly create a reference to - a constant string pointer. - - \see StringRef(const CharType*) - - \param str Constant character pointer, lifetime assumed to be longer - than the use of the string in e.g. a GenericValue - - \post \ref s == str - - \note There is a hidden, private overload to disallow references to - non-const character arrays to be created via this constructor. - By this, e.g. function-scope arrays used to be filled via - \c snprintf are excluded from consideration. - In such cases, the referenced string should be \b copied to the - GenericValue instead. - */ -#endif - explicit GenericStringRef(const CharType* str) - : s(str), length(NotNullStrLen(str)) {} - - //! Create constant string reference from pointer and length -#ifndef __clang__ // -Wdocumentation - /*! \param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \param len length of the string, excluding the trailing NULL terminator - - \post \ref s == str && \ref length == len - \note Constant complexity. - */ -#endif - GenericStringRef(const CharType* str, SizeType len) - : s(RAPIDJSON_LIKELY(str) ? str : emptyString), length(len) { RAPIDJSON_ASSERT(str != 0 || len == 0u); } - - GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} - - //! implicit conversion to plain CharType pointer - operator const Ch *() const { return s; } - - const Ch* const s; //!< plain CharType pointer - const SizeType length; //!< length of the string (excluding the trailing NULL terminator) - -private: - SizeType NotNullStrLen(const CharType* str) { - RAPIDJSON_ASSERT(str != 0); - return internal::StrLen(str); - } - - /// Empty string - used when passing in a NULL pointer - static const Ch emptyString[]; - - //! Disallow construction from non-const array - template - GenericStringRef(CharType (&str)[N]) /* = delete */; - //! Copy assignment operator not permitted - immutable type - GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */; -}; - -template -const CharType GenericStringRef::emptyString[] = { CharType() }; - -//! Mark a character pointer as constant string -/*! Mark a plain character pointer as a "string literal". This function - can be used to avoid copying a character string to be referenced as a - value in a JSON GenericValue object, if the string's lifetime is known - to be valid long enough. - \tparam CharType Character type of the string - \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \return GenericStringRef string reference object - \relatesalso GenericStringRef - - \see GenericValue::GenericValue(StringRefType), GenericValue::operator=(StringRefType), GenericValue::SetString(StringRefType), GenericValue::PushBack(StringRefType, Allocator&), GenericValue::AddMember -*/ -template -inline GenericStringRef StringRef(const CharType* str) { - return GenericStringRef(str); -} - -//! Mark a character pointer as constant string -/*! Mark a plain character pointer as a "string literal". This function - can be used to avoid copying a character string to be referenced as a - value in a JSON GenericValue object, if the string's lifetime is known - to be valid long enough. - - This version has better performance with supplied length, and also - supports string containing null characters. - - \tparam CharType character type of the string - \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \param length The length of source string. - \return GenericStringRef string reference object - \relatesalso GenericStringRef -*/ -template -inline GenericStringRef StringRef(const CharType* str, size_t length) { - return GenericStringRef(str, SizeType(length)); -} - -#if RAPIDJSON_HAS_STDSTRING -//! Mark a string object as constant string -/*! Mark a string object (e.g. \c std::string) as a "string literal". - This function can be used to avoid copying a string to be referenced as a - value in a JSON GenericValue object, if the string's lifetime is known - to be valid long enough. - - \tparam CharType character type of the string - \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue - \return GenericStringRef string reference object - \relatesalso GenericStringRef - \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. -*/ -template -inline GenericStringRef StringRef(const std::basic_string& str) { - return GenericStringRef(str.data(), SizeType(str.size())); -} -#endif - -/////////////////////////////////////////////////////////////////////////////// -// GenericValue type traits -namespace internal { - -template -struct IsGenericValueImpl : FalseType {}; - -// select candidates according to nested encoding and allocator types -template struct IsGenericValueImpl::Type, typename Void::Type> - : IsBaseOf, T>::Type {}; - -// helper to match arbitrary GenericValue instantiations, including derived classes -template struct IsGenericValue : IsGenericValueImpl::Type {}; - -} // namespace internal - -/////////////////////////////////////////////////////////////////////////////// -// TypeHelper - -namespace internal { - -template -struct TypeHelper {}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsBool(); } - static bool Get(const ValueType& v) { return v.GetBool(); } - static ValueType& Set(ValueType& v, bool data) { return v.SetBool(data); } - static ValueType& Set(ValueType& v, bool data, typename ValueType::AllocatorType&) { return v.SetBool(data); } -}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsInt(); } - static int Get(const ValueType& v) { return v.GetInt(); } - static ValueType& Set(ValueType& v, int data) { return v.SetInt(data); } - static ValueType& Set(ValueType& v, int data, typename ValueType::AllocatorType&) { return v.SetInt(data); } -}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsUint(); } - static unsigned Get(const ValueType& v) { return v.GetUint(); } - static ValueType& Set(ValueType& v, unsigned data) { return v.SetUint(data); } - static ValueType& Set(ValueType& v, unsigned data, typename ValueType::AllocatorType&) { return v.SetUint(data); } -}; - -#ifdef _MSC_VER -RAPIDJSON_STATIC_ASSERT(sizeof(long) == sizeof(int)); -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsInt(); } - static long Get(const ValueType& v) { return v.GetInt(); } - static ValueType& Set(ValueType& v, long data) { return v.SetInt(data); } - static ValueType& Set(ValueType& v, long data, typename ValueType::AllocatorType&) { return v.SetInt(data); } -}; - -RAPIDJSON_STATIC_ASSERT(sizeof(unsigned long) == sizeof(unsigned)); -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsUint(); } - static unsigned long Get(const ValueType& v) { return v.GetUint(); } - static ValueType& Set(ValueType& v, unsigned long data) { return v.SetUint(data); } - static ValueType& Set(ValueType& v, unsigned long data, typename ValueType::AllocatorType&) { return v.SetUint(data); } -}; -#endif - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsInt64(); } - static int64_t Get(const ValueType& v) { return v.GetInt64(); } - static ValueType& Set(ValueType& v, int64_t data) { return v.SetInt64(data); } - static ValueType& Set(ValueType& v, int64_t data, typename ValueType::AllocatorType&) { return v.SetInt64(data); } -}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsUint64(); } - static uint64_t Get(const ValueType& v) { return v.GetUint64(); } - static ValueType& Set(ValueType& v, uint64_t data) { return v.SetUint64(data); } - static ValueType& Set(ValueType& v, uint64_t data, typename ValueType::AllocatorType&) { return v.SetUint64(data); } -}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsDouble(); } - static double Get(const ValueType& v) { return v.GetDouble(); } - static ValueType& Set(ValueType& v, double data) { return v.SetDouble(data); } - static ValueType& Set(ValueType& v, double data, typename ValueType::AllocatorType&) { return v.SetDouble(data); } -}; - -template -struct TypeHelper { - static bool Is(const ValueType& v) { return v.IsFloat(); } - static float Get(const ValueType& v) { return v.GetFloat(); } - static ValueType& Set(ValueType& v, float data) { return v.SetFloat(data); } - static ValueType& Set(ValueType& v, float data, typename ValueType::AllocatorType&) { return v.SetFloat(data); } -}; - -template -struct TypeHelper { - typedef const typename ValueType::Ch* StringType; - static bool Is(const ValueType& v) { return v.IsString(); } - static StringType Get(const ValueType& v) { return v.GetString(); } - static ValueType& Set(ValueType& v, const StringType data) { return v.SetString(typename ValueType::StringRefType(data)); } - static ValueType& Set(ValueType& v, const StringType data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } -}; - -#if RAPIDJSON_HAS_STDSTRING -template -struct TypeHelper > { - typedef std::basic_string StringType; - static bool Is(const ValueType& v) { return v.IsString(); } - static StringType Get(const ValueType& v) { return StringType(v.GetString(), v.GetStringLength()); } - static ValueType& Set(ValueType& v, const StringType& data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } -}; -#endif - -template -struct TypeHelper { - typedef typename ValueType::Array ArrayType; - static bool Is(const ValueType& v) { return v.IsArray(); } - static ArrayType Get(ValueType& v) { return v.GetArray(); } - static ValueType& Set(ValueType& v, ArrayType data) { return v = data; } - static ValueType& Set(ValueType& v, ArrayType data, typename ValueType::AllocatorType&) { return v = data; } -}; - -template -struct TypeHelper { - typedef typename ValueType::ConstArray ArrayType; - static bool Is(const ValueType& v) { return v.IsArray(); } - static ArrayType Get(const ValueType& v) { return v.GetArray(); } -}; - -template -struct TypeHelper { - typedef typename ValueType::Object ObjectType; - static bool Is(const ValueType& v) { return v.IsObject(); } - static ObjectType Get(ValueType& v) { return v.GetObject(); } - static ValueType& Set(ValueType& v, ObjectType data) { return v = data; } - static ValueType& Set(ValueType& v, ObjectType data, typename ValueType::AllocatorType&) { return v = data; } -}; - -template -struct TypeHelper { - typedef typename ValueType::ConstObject ObjectType; - static bool Is(const ValueType& v) { return v.IsObject(); } - static ObjectType Get(const ValueType& v) { return v.GetObject(); } -}; - -} // namespace internal - -// Forward declarations -template class GenericArray; -template class GenericObject; - -/////////////////////////////////////////////////////////////////////////////// -// GenericValue - -//! Represents a JSON value. Use Value for UTF8 encoding and default allocator. -/*! - A JSON value can be one of 7 types. This class is a variant type supporting - these types. - - Use the Value if UTF8 and default allocator - - \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) - \tparam Allocator Allocator type for allocating memory of object, array and string. -*/ -template -class GenericValue { -public: - //! Name-value pair in an object. - typedef GenericMember Member; - typedef Encoding EncodingType; //!< Encoding type from template parameter. - typedef Allocator AllocatorType; //!< Allocator type from template parameter. - typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. - typedef GenericStringRef StringRefType; //!< Reference to a constant string - typedef typename GenericMemberIterator::Iterator MemberIterator; //!< Member iterator for iterating in object. - typedef typename GenericMemberIterator::Iterator ConstMemberIterator; //!< Constant member iterator for iterating in object. - typedef GenericValue* ValueIterator; //!< Value iterator for iterating in array. - typedef const GenericValue* ConstValueIterator; //!< Constant value iterator for iterating in array. - typedef GenericValue ValueType; //!< Value type of itself. - typedef GenericArray Array; - typedef GenericArray ConstArray; - typedef GenericObject Object; - typedef GenericObject ConstObject; - - //!@name Constructors and destructor. - //@{ - - //! Default constructor creates a null value. - GenericValue() RAPIDJSON_NOEXCEPT : data_() { data_.f.flags = kNullFlag; } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move constructor in C++11 - GenericValue(GenericValue&& rhs) RAPIDJSON_NOEXCEPT : data_(rhs.data_) { - rhs.data_.f.flags = kNullFlag; // give up contents - } -#endif - -private: - //! Copy constructor is not permitted. - GenericValue(const GenericValue& rhs); - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Moving from a GenericDocument is not permitted. - template - GenericValue(GenericDocument&& rhs); - - //! Move assignment from a GenericDocument is not permitted. - template - GenericValue& operator=(GenericDocument&& rhs); -#endif - -public: - - //! Constructor with JSON value type. - /*! This creates a Value of specified type with default content. - \param type Type of the value. - \note Default content for number is zero. - */ - explicit GenericValue(Type type) RAPIDJSON_NOEXCEPT : data_() { - static const uint16_t defaultFlags[] = { - kNullFlag, kFalseFlag, kTrueFlag, kObjectFlag, kArrayFlag, kShortStringFlag, - kNumberAnyFlag - }; - RAPIDJSON_NOEXCEPT_ASSERT(type >= kNullType && type <= kNumberType); - data_.f.flags = defaultFlags[type]; - - // Use ShortString to store empty string. - if (type == kStringType) - data_.ss.SetLength(0); - } - - //! Explicit copy constructor (with allocator) - /*! Creates a copy of a Value by using the given Allocator - \tparam SourceAllocator allocator of \c rhs - \param rhs Value to copy from (read-only) - \param allocator Allocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator(). - \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer) - \see CopyFrom() - */ - template - GenericValue(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings = false) { - switch (rhs.GetType()) { - case kObjectType: - DoCopyMembers(rhs, allocator, copyConstStrings); - break; - case kArrayType: { - SizeType count = rhs.data_.a.size; - GenericValue* le = reinterpret_cast(allocator.Malloc(count * sizeof(GenericValue))); - const GenericValue* re = rhs.GetElementsPointer(); - for (SizeType i = 0; i < count; i++) - new (&le[i]) GenericValue(re[i], allocator, copyConstStrings); - data_.f.flags = kArrayFlag; - data_.a.size = data_.a.capacity = count; - SetElementsPointer(le); - } - break; - case kStringType: - if (rhs.data_.f.flags == kConstStringFlag && !copyConstStrings) { - data_.f.flags = rhs.data_.f.flags; - data_ = *reinterpret_cast(&rhs.data_); - } - else - SetStringRaw(StringRef(rhs.GetString(), rhs.GetStringLength()), allocator); - break; - default: - data_.f.flags = rhs.data_.f.flags; - data_ = *reinterpret_cast(&rhs.data_); - break; - } - } - - //! Constructor for boolean value. - /*! \param b Boolean value - \note This constructor is limited to \em real boolean values and rejects - implicitly converted types like arbitrary pointers. Use an explicit cast - to \c bool, if you want to construct a boolean JSON value in such cases. - */ -#ifndef RAPIDJSON_DOXYGEN_RUNNING // hide SFINAE from Doxygen - template - explicit GenericValue(T b, RAPIDJSON_ENABLEIF((internal::IsSame))) RAPIDJSON_NOEXCEPT // See #472 -#else - explicit GenericValue(bool b) RAPIDJSON_NOEXCEPT -#endif - : data_() { - // safe-guard against failing SFINAE - RAPIDJSON_STATIC_ASSERT((internal::IsSame::Value)); - data_.f.flags = b ? kTrueFlag : kFalseFlag; - } - - //! Constructor for int value. - explicit GenericValue(int i) RAPIDJSON_NOEXCEPT : data_() { - data_.n.i64 = i; - data_.f.flags = (i >= 0) ? (kNumberIntFlag | kUintFlag | kUint64Flag) : kNumberIntFlag; - } - - //! Constructor for unsigned value. - explicit GenericValue(unsigned u) RAPIDJSON_NOEXCEPT : data_() { - data_.n.u64 = u; - data_.f.flags = (u & 0x80000000) ? kNumberUintFlag : (kNumberUintFlag | kIntFlag | kInt64Flag); - } - - //! Constructor for int64_t value. - explicit GenericValue(int64_t i64) RAPIDJSON_NOEXCEPT : data_() { - data_.n.i64 = i64; - data_.f.flags = kNumberInt64Flag; - if (i64 >= 0) { - data_.f.flags |= kNumberUint64Flag; - if (!(static_cast(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) - data_.f.flags |= kUintFlag; - if (!(static_cast(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) - data_.f.flags |= kIntFlag; - } - else if (i64 >= static_cast(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) - data_.f.flags |= kIntFlag; - } - - //! Constructor for uint64_t value. - explicit GenericValue(uint64_t u64) RAPIDJSON_NOEXCEPT : data_() { - data_.n.u64 = u64; - data_.f.flags = kNumberUint64Flag; - if (!(u64 & RAPIDJSON_UINT64_C2(0x80000000, 0x00000000))) - data_.f.flags |= kInt64Flag; - if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) - data_.f.flags |= kUintFlag; - if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) - data_.f.flags |= kIntFlag; - } - - //! Constructor for double value. - explicit GenericValue(double d) RAPIDJSON_NOEXCEPT : data_() { data_.n.d = d; data_.f.flags = kNumberDoubleFlag; } - - //! Constructor for float value. - explicit GenericValue(float f) RAPIDJSON_NOEXCEPT : data_() { data_.n.d = static_cast(f); data_.f.flags = kNumberDoubleFlag; } - - //! Constructor for constant string (i.e. do not make a copy of string) - GenericValue(const Ch* s, SizeType length) RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(StringRef(s, length)); } - - //! Constructor for constant string (i.e. do not make a copy of string) - explicit GenericValue(StringRefType s) RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(s); } - - //! Constructor for copy-string (i.e. do make a copy of string) - GenericValue(const Ch* s, SizeType length, Allocator& allocator) : data_() { SetStringRaw(StringRef(s, length), allocator); } - - //! Constructor for copy-string (i.e. do make a copy of string) - GenericValue(const Ch*s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); } - -#if RAPIDJSON_HAS_STDSTRING - //! Constructor for copy-string from a string object (i.e. do make a copy of string) - /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. - */ - GenericValue(const std::basic_string& s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); } -#endif - - //! Constructor for Array. - /*! - \param a An array obtained by \c GetArray(). - \note \c Array is always pass-by-value. - \note the source array is moved into this value and the source array becomes empty. - */ - GenericValue(Array a) RAPIDJSON_NOEXCEPT : data_(a.value_.data_) { - a.value_.data_ = Data(); - a.value_.data_.f.flags = kArrayFlag; - } - - //! Constructor for Object. - /*! - \param o An object obtained by \c GetObject(). - \note \c Object is always pass-by-value. - \note the source object is moved into this value and the source object becomes empty. - */ - GenericValue(Object o) RAPIDJSON_NOEXCEPT : data_(o.value_.data_) { - o.value_.data_ = Data(); - o.value_.data_.f.flags = kObjectFlag; - } - - //! Destructor. - /*! Need to destruct elements of array, members of object, or copy-string. - */ - ~GenericValue() { - // With RAPIDJSON_USE_MEMBERSMAP, the maps need to be destroyed to release - // their Allocator if it's refcounted (e.g. MemoryPoolAllocator). - if (Allocator::kNeedFree || (RAPIDJSON_USE_MEMBERSMAP+0 && - internal::IsRefCounted::Value)) { - switch(data_.f.flags) { - case kArrayFlag: - { - GenericValue* e = GetElementsPointer(); - for (GenericValue* v = e; v != e + data_.a.size; ++v) - v->~GenericValue(); - if (Allocator::kNeedFree) { // Shortcut by Allocator's trait - Allocator::Free(e); - } - } - break; - - case kObjectFlag: - DoFreeMembers(); - break; - - case kCopyStringFlag: - if (Allocator::kNeedFree) { // Shortcut by Allocator's trait - Allocator::Free(const_cast(GetStringPointer())); - } - break; - - default: - break; // Do nothing for other types. - } - } - } - - //@} - - //!@name Assignment operators - //@{ - - //! Assignment with move semantics. - /*! \param rhs Source of the assignment. It will become a null value after assignment. - */ - GenericValue& operator=(GenericValue& rhs) RAPIDJSON_NOEXCEPT { - if (RAPIDJSON_LIKELY(this != &rhs)) { - // Can't destroy "this" before assigning "rhs", otherwise "rhs" - // could be used after free if it's an sub-Value of "this", - // hence the temporary dance. - GenericValue temp; - temp.RawAssign(rhs); - this->~GenericValue(); - RawAssign(temp); - } - return *this; - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move assignment in C++11 - GenericValue& operator=(GenericValue&& rhs) RAPIDJSON_NOEXCEPT { - return *this = rhs.Move(); - } -#endif - - //! Assignment of constant string reference (no copy) - /*! \param str Constant string reference to be assigned - \note This overload is needed to avoid clashes with the generic primitive type assignment overload below. - \see GenericStringRef, operator=(T) - */ - GenericValue& operator=(StringRefType str) RAPIDJSON_NOEXCEPT { - GenericValue s(str); - return *this = s; - } - - //! Assignment with primitive types. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param value The value to be assigned. - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref SetString(const Ch*, Allocator&) (for copying) or - \ref StringRef() (to explicitly mark the pointer as constant) instead. - All other pointer types would implicitly convert to \c bool, - use \ref SetBool() instead. - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::IsPointer), (GenericValue&)) - operator=(T value) { - GenericValue v(value); - return *this = v; - } - - //! Deep-copy assignment from Value - /*! Assigns a \b copy of the Value to the current Value object - \tparam SourceAllocator Allocator type of \c rhs - \param rhs Value to copy from (read-only) - \param allocator Allocator to use for copying - \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer) - */ - template - GenericValue& CopyFrom(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings = false) { - RAPIDJSON_ASSERT(static_cast(this) != static_cast(&rhs)); - this->~GenericValue(); - new (this) GenericValue(rhs, allocator, copyConstStrings); - return *this; - } - - //! Exchange the contents of this value with those of other. - /*! - \param other Another value. - \note Constant complexity. - */ - GenericValue& Swap(GenericValue& other) RAPIDJSON_NOEXCEPT { - GenericValue temp; - temp.RawAssign(*this); - RawAssign(other); - other.RawAssign(temp); - return *this; - } - - //! free-standing swap function helper - /*! - Helper function to enable support for common swap implementation pattern based on \c std::swap: - \code - void swap(MyClass& a, MyClass& b) { - using std::swap; - swap(a.value, b.value); - // ... - } - \endcode - \see Swap() - */ - friend inline void swap(GenericValue& a, GenericValue& b) RAPIDJSON_NOEXCEPT { a.Swap(b); } - - //! Prepare Value for move semantics - /*! \return *this */ - GenericValue& Move() RAPIDJSON_NOEXCEPT { return *this; } - //@} - - //!@name Equal-to and not-equal-to operators - //@{ - //! Equal-to operator - /*! - \note If an object contains duplicated named member, comparing equality with any object is always \c false. - \note Complexity is quadratic in Object's member number and linear for the rest (number of all values in the subtree and total lengths of all strings). - */ - template - bool operator==(const GenericValue& rhs) const { - typedef GenericValue RhsType; - if (GetType() != rhs.GetType()) - return false; - - switch (GetType()) { - case kObjectType: // Warning: O(n^2) inner-loop - if (data_.o.size != rhs.data_.o.size) - return false; - for (ConstMemberIterator lhsMemberItr = MemberBegin(); lhsMemberItr != MemberEnd(); ++lhsMemberItr) { - typename RhsType::ConstMemberIterator rhsMemberItr = rhs.FindMember(lhsMemberItr->name); - if (rhsMemberItr == rhs.MemberEnd() || lhsMemberItr->value != rhsMemberItr->value) - return false; - } - return true; - - case kArrayType: - if (data_.a.size != rhs.data_.a.size) - return false; - for (SizeType i = 0; i < data_.a.size; i++) - if ((*this)[i] != rhs[i]) - return false; - return true; - - case kStringType: - return StringEqual(rhs); - - case kNumberType: - if (IsDouble() || rhs.IsDouble()) { - double a = GetDouble(); // May convert from integer to double. - double b = rhs.GetDouble(); // Ditto - return a >= b && a <= b; // Prevent -Wfloat-equal - } - else - return data_.n.u64 == rhs.data_.n.u64; - - default: - return true; - } - } - - //! Equal-to operator with const C-string pointer - bool operator==(const Ch* rhs) const { return *this == GenericValue(StringRef(rhs)); } - -#if RAPIDJSON_HAS_STDSTRING - //! Equal-to operator with string object - /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. - */ - bool operator==(const std::basic_string& rhs) const { return *this == GenericValue(StringRef(rhs)); } -#endif - - //! Equal-to operator with primitive types - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c true, \c false - */ - template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr,internal::IsGenericValue >), (bool)) operator==(const T& rhs) const { return *this == GenericValue(rhs); } - -#ifndef __cpp_impl_three_way_comparison - //! Not-equal-to operator - /*! \return !(*this == rhs) - */ - template - bool operator!=(const GenericValue& rhs) const { return !(*this == rhs); } - - //! Not-equal-to operator with const C-string pointer - bool operator!=(const Ch* rhs) const { return !(*this == rhs); } - - //! Not-equal-to operator with arbitrary types - /*! \return !(*this == rhs) - */ - template RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); } - - //! Equal-to operator with arbitrary types (symmetric version) - /*! \return (rhs == lhs) - */ - template friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator==(const T& lhs, const GenericValue& rhs) { return rhs == lhs; } - - //! Not-Equal-to operator with arbitrary types (symmetric version) - /*! \return !(rhs == lhs) - */ - template friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); } - //@} -#endif - - //!@name Type - //@{ - - Type GetType() const { return static_cast(data_.f.flags & kTypeMask); } - bool IsNull() const { return data_.f.flags == kNullFlag; } - bool IsFalse() const { return data_.f.flags == kFalseFlag; } - bool IsTrue() const { return data_.f.flags == kTrueFlag; } - bool IsBool() const { return (data_.f.flags & kBoolFlag) != 0; } - bool IsObject() const { return data_.f.flags == kObjectFlag; } - bool IsArray() const { return data_.f.flags == kArrayFlag; } - bool IsNumber() const { return (data_.f.flags & kNumberFlag) != 0; } - bool IsInt() const { return (data_.f.flags & kIntFlag) != 0; } - bool IsUint() const { return (data_.f.flags & kUintFlag) != 0; } - bool IsInt64() const { return (data_.f.flags & kInt64Flag) != 0; } - bool IsUint64() const { return (data_.f.flags & kUint64Flag) != 0; } - bool IsDouble() const { return (data_.f.flags & kDoubleFlag) != 0; } - bool IsString() const { return (data_.f.flags & kStringFlag) != 0; } - - // Checks whether a number can be losslessly converted to a double. - bool IsLosslessDouble() const { - if (!IsNumber()) return false; - if (IsUint64()) { - uint64_t u = GetUint64(); - volatile double d = static_cast(u); - return (d >= 0.0) - && (d < static_cast((std::numeric_limits::max)())) - && (u == static_cast(d)); - } - if (IsInt64()) { - int64_t i = GetInt64(); - volatile double d = static_cast(i); - return (d >= static_cast((std::numeric_limits::min)())) - && (d < static_cast((std::numeric_limits::max)())) - && (i == static_cast(d)); - } - return true; // double, int, uint are always lossless - } - - // Checks whether a number is a float (possible lossy). - bool IsFloat() const { - if ((data_.f.flags & kDoubleFlag) == 0) - return false; - double d = GetDouble(); - return d >= -3.4028234e38 && d <= 3.4028234e38; - } - // Checks whether a number can be losslessly converted to a float. - bool IsLosslessFloat() const { - if (!IsNumber()) return false; - double a = GetDouble(); - if (a < static_cast(-(std::numeric_limits::max)()) - || a > static_cast((std::numeric_limits::max)())) - return false; - double b = static_cast(static_cast(a)); - return a >= b && a <= b; // Prevent -Wfloat-equal - } - - //@} - - //!@name Null - //@{ - - GenericValue& SetNull() { this->~GenericValue(); new (this) GenericValue(); return *this; } - - //@} - - //!@name Bool - //@{ - - bool GetBool() const { RAPIDJSON_ASSERT(IsBool()); return data_.f.flags == kTrueFlag; } - //!< Set boolean value - /*! \post IsBool() == true */ - GenericValue& SetBool(bool b) { this->~GenericValue(); new (this) GenericValue(b); return *this; } - - //@} - - //!@name Object - //@{ - - //! Set this value as an empty object. - /*! \post IsObject() == true */ - GenericValue& SetObject() { this->~GenericValue(); new (this) GenericValue(kObjectType); return *this; } - - //! Get the number of members in the object. - SizeType MemberCount() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size; } - - //! Get the capacity of object. - SizeType MemberCapacity() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.capacity; } - - //! Check whether the object is empty. - bool ObjectEmpty() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size == 0; } - - //! Get a value from an object associated with the name. - /*! \pre IsObject() == true - \tparam T Either \c Ch or \c const \c Ch (template used for disambiguation with \ref operator[](SizeType)) - \note In version 0.1x, if the member is not found, this function returns a null value. This makes issue 7. - Since 0.2, if the name is not correct, it will assert. - If user is unsure whether a member exists, user should use HasMember() first. - A better approach is to use FindMember(). - \note Linear time complexity. - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(GenericValue&)) operator[](T* name) { - GenericValue n(StringRef(name)); - return (*this)[n]; - } - template - RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(const GenericValue&)) operator[](T* name) const { return const_cast(*this)[name]; } - - //! Get a value from an object associated with the name. - /*! \pre IsObject() == true - \tparam SourceAllocator Allocator of the \c name value - - \note Compared to \ref operator[](T*), this version is faster because it does not need a StrLen(). - And it can also handle strings with embedded null characters. - - \note Linear time complexity. - */ - template - GenericValue& operator[](const GenericValue& name) { - MemberIterator member = FindMember(name); - if (member != MemberEnd()) - return member->value; - else { - RAPIDJSON_ASSERT(false); // see above note - -#if RAPIDJSON_HAS_CXX11 - // Use thread-local storage to prevent races between threads. - // Use static buffer and placement-new to prevent destruction, with - // alignas() to ensure proper alignment. - alignas(GenericValue) thread_local static char buffer[sizeof(GenericValue)]; - return *new (buffer) GenericValue(); -#elif defined(_MSC_VER) && _MSC_VER < 1900 - // There's no way to solve both thread locality and proper alignment - // simultaneously. - __declspec(thread) static char buffer[sizeof(GenericValue)]; - return *new (buffer) GenericValue(); -#elif defined(__GNUC__) || defined(__clang__) - // This will generate -Wexit-time-destructors in clang, but that's - // better than having under-alignment. - __thread static GenericValue buffer; - return buffer; -#else - // Don't know what compiler this is, so don't know how to ensure - // thread-locality. - static GenericValue buffer; - return buffer; -#endif - } - } - template - const GenericValue& operator[](const GenericValue& name) const { return const_cast(*this)[name]; } - -#if RAPIDJSON_HAS_STDSTRING - //! Get a value from an object associated with name (string object). - GenericValue& operator[](const std::basic_string& name) { return (*this)[GenericValue(StringRef(name))]; } - const GenericValue& operator[](const std::basic_string& name) const { return (*this)[GenericValue(StringRef(name))]; } -#endif - - //! Const member iterator - /*! \pre IsObject() == true */ - ConstMemberIterator MemberBegin() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer()); } - //! Const \em past-the-end member iterator - /*! \pre IsObject() == true */ - ConstMemberIterator MemberEnd() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer() + data_.o.size); } - //! Member iterator - /*! \pre IsObject() == true */ - MemberIterator MemberBegin() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer()); } - //! \em Past-the-end member iterator - /*! \pre IsObject() == true */ - MemberIterator MemberEnd() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer() + data_.o.size); } - - //! Request the object to have enough capacity to store members. - /*! \param newCapacity The capacity that the object at least need to have. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \note Linear time complexity. - */ - GenericValue& MemberReserve(SizeType newCapacity, Allocator &allocator) { - RAPIDJSON_ASSERT(IsObject()); - DoReserveMembers(newCapacity, allocator); - return *this; - } - - //! Check whether a member exists in the object. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Whether a member with that name exists. - \note It is better to use FindMember() directly if you need the obtain the value as well. - \note Linear time complexity. - */ - bool HasMember(const Ch* name) const { return FindMember(name) != MemberEnd(); } - -#if RAPIDJSON_HAS_STDSTRING - //! Check whether a member exists in the object with string object. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Whether a member with that name exists. - \note It is better to use FindMember() directly if you need the obtain the value as well. - \note Linear time complexity. - */ - bool HasMember(const std::basic_string& name) const { return FindMember(name) != MemberEnd(); } -#endif - - //! Check whether a member exists in the object with GenericValue name. - /*! - This version is faster because it does not need a StrLen(). It can also handle string with null character. - \param name Member name to be searched. - \pre IsObject() == true - \return Whether a member with that name exists. - \note It is better to use FindMember() directly if you need the obtain the value as well. - \note Linear time complexity. - */ - template - bool HasMember(const GenericValue& name) const { return FindMember(name) != MemberEnd(); } - - //! Find member by name. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Iterator to member, if it exists. - Otherwise returns \ref MemberEnd(). - - \note Earlier versions of Rapidjson returned a \c NULL pointer, in case - the requested member doesn't exist. For consistency with e.g. - \c std::map, this has been changed to MemberEnd() now. - \note Linear time complexity. - */ - MemberIterator FindMember(const Ch* name) { - GenericValue n(StringRef(name)); - return FindMember(n); - } - - ConstMemberIterator FindMember(const Ch* name) const { return const_cast(*this).FindMember(name); } - - //! Find member by name. - /*! - This version is faster because it does not need a StrLen(). It can also handle string with null character. - \param name Member name to be searched. - \pre IsObject() == true - \return Iterator to member, if it exists. - Otherwise returns \ref MemberEnd(). - - \note Earlier versions of Rapidjson returned a \c NULL pointer, in case - the requested member doesn't exist. For consistency with e.g. - \c std::map, this has been changed to MemberEnd() now. - \note Linear time complexity. - */ - template - MemberIterator FindMember(const GenericValue& name) { - RAPIDJSON_ASSERT(IsObject()); - RAPIDJSON_ASSERT(name.IsString()); - return DoFindMember(name); - } - template ConstMemberIterator FindMember(const GenericValue& name) const { return const_cast(*this).FindMember(name); } - -#if RAPIDJSON_HAS_STDSTRING - //! Find member by string object name. - /*! - \param name Member name to be searched. - \pre IsObject() == true - \return Iterator to member, if it exists. - Otherwise returns \ref MemberEnd(). - */ - MemberIterator FindMember(const std::basic_string& name) { return FindMember(GenericValue(StringRef(name))); } - ConstMemberIterator FindMember(const std::basic_string& name) const { return FindMember(GenericValue(StringRef(name))); } -#endif - - //! Add a member (name-value pair) to the object. - /*! \param name A string value as name of member. - \param value Value of any type. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \note The ownership of \c name and \c value will be transferred to this object on success. - \pre IsObject() && name.IsString() - \post name.IsNull() && value.IsNull() - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(GenericValue& name, GenericValue& value, Allocator& allocator) { - RAPIDJSON_ASSERT(IsObject()); - RAPIDJSON_ASSERT(name.IsString()); - DoAddMember(name, value, allocator); - return *this; - } - - //! Add a constant string value as member (name-value pair) to the object. - /*! \param name A string value as name of member. - \param value constant string reference as value of member. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(GenericValue& name, StringRefType value, Allocator& allocator) { - GenericValue v(value); - return AddMember(name, v, allocator); - } - -#if RAPIDJSON_HAS_STDSTRING - //! Add a string object as member (name-value pair) to the object. - /*! \param name A string value as name of member. - \param value constant string reference as value of member. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(GenericValue& name, std::basic_string& value, Allocator& allocator) { - GenericValue v(value, allocator); - return AddMember(name, v, allocator); - } -#endif - - //! Add any primitive value as member (name-value pair) to the object. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param name A string value as name of member. - \param value Value of primitive type \c T as value of member - \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref - AddMember(StringRefType, StringRefType, Allocator&). - All other pointer types would implicitly convert to \c bool, - use an explicit cast instead, if needed. - \note Amortized Constant time complexity. - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) - AddMember(GenericValue& name, T value, Allocator& allocator) { - GenericValue v(value); - return AddMember(name, v, allocator); - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericValue& AddMember(GenericValue&& name, GenericValue&& value, Allocator& allocator) { - return AddMember(name, value, allocator); - } - GenericValue& AddMember(GenericValue&& name, GenericValue& value, Allocator& allocator) { - return AddMember(name, value, allocator); - } - GenericValue& AddMember(GenericValue& name, GenericValue&& value, Allocator& allocator) { - return AddMember(name, value, allocator); - } - GenericValue& AddMember(StringRefType name, GenericValue&& value, Allocator& allocator) { - GenericValue n(name); - return AddMember(n, value, allocator); - } -#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS - - - //! Add a member (name-value pair) to the object. - /*! \param name A constant string reference as name of member. - \param value Value of any type. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \note The ownership of \c value will be transferred to this object on success. - \pre IsObject() - \post value.IsNull() - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(StringRefType name, GenericValue& value, Allocator& allocator) { - GenericValue n(name); - return AddMember(n, value, allocator); - } - - //! Add a constant string value as member (name-value pair) to the object. - /*! \param name A constant string reference as name of member. - \param value constant string reference as value of member. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - \note This overload is needed to avoid clashes with the generic primitive type AddMember(StringRefType,T,Allocator&) overload below. - \note Amortized Constant time complexity. - */ - GenericValue& AddMember(StringRefType name, StringRefType value, Allocator& allocator) { - GenericValue v(value); - return AddMember(name, v, allocator); - } - - //! Add any primitive value as member (name-value pair) to the object. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param name A constant string reference as name of member. - \param value Value of primitive type \c T as value of member - \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \pre IsObject() - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref - AddMember(StringRefType, StringRefType, Allocator&). - All other pointer types would implicitly convert to \c bool, - use an explicit cast instead, if needed. - \note Amortized Constant time complexity. - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) - AddMember(StringRefType name, T value, Allocator& allocator) { - GenericValue n(name); - return AddMember(n, value, allocator); - } - - //! Remove all members in the object. - /*! This function do not deallocate memory in the object, i.e. the capacity is unchanged. - \note Linear time complexity. - */ - void RemoveAllMembers() { - RAPIDJSON_ASSERT(IsObject()); - DoClearMembers(); - } - - //! Remove a member in object by its name. - /*! \param name Name of member to be removed. - \return Whether the member existed. - \note This function may reorder the object members. Use \ref - EraseMember(ConstMemberIterator) if you need to preserve the - relative order of the remaining members. - \note Linear time complexity. - */ - bool RemoveMember(const Ch* name) { - GenericValue n(StringRef(name)); - return RemoveMember(n); - } - -#if RAPIDJSON_HAS_STDSTRING - bool RemoveMember(const std::basic_string& name) { return RemoveMember(GenericValue(StringRef(name))); } -#endif - - template - bool RemoveMember(const GenericValue& name) { - MemberIterator m = FindMember(name); - if (m != MemberEnd()) { - RemoveMember(m); - return true; - } - else - return false; - } - - //! Remove a member in object by iterator. - /*! \param m member iterator (obtained by FindMember() or MemberBegin()). - \return the new iterator after removal. - \note This function may reorder the object members. Use \ref - EraseMember(ConstMemberIterator) if you need to preserve the - relative order of the remaining members. - \note Constant time complexity. - */ - MemberIterator RemoveMember(MemberIterator m) { - RAPIDJSON_ASSERT(IsObject()); - RAPIDJSON_ASSERT(data_.o.size > 0); - RAPIDJSON_ASSERT(GetMembersPointer() != 0); - RAPIDJSON_ASSERT(m >= MemberBegin() && m < MemberEnd()); - return DoRemoveMember(m); - } - - //! Remove a member from an object by iterator. - /*! \param pos iterator to the member to remove - \pre IsObject() == true && \ref MemberBegin() <= \c pos < \ref MemberEnd() - \return Iterator following the removed element. - If the iterator \c pos refers to the last element, the \ref MemberEnd() iterator is returned. - \note This function preserves the relative order of the remaining object - members. If you do not need this, use the more efficient \ref RemoveMember(MemberIterator). - \note Linear time complexity. - */ - MemberIterator EraseMember(ConstMemberIterator pos) { - return EraseMember(pos, pos +1); - } - - //! Remove members in the range [first, last) from an object. - /*! \param first iterator to the first member to remove - \param last iterator following the last member to remove - \pre IsObject() == true && \ref MemberBegin() <= \c first <= \c last <= \ref MemberEnd() - \return Iterator following the last removed element. - \note This function preserves the relative order of the remaining object - members. - \note Linear time complexity. - */ - MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) { - RAPIDJSON_ASSERT(IsObject()); - RAPIDJSON_ASSERT(data_.o.size > 0); - RAPIDJSON_ASSERT(GetMembersPointer() != 0); - RAPIDJSON_ASSERT(first >= MemberBegin()); - RAPIDJSON_ASSERT(first <= last); - RAPIDJSON_ASSERT(last <= MemberEnd()); - return DoEraseMembers(first, last); - } - - //! Erase a member in object by its name. - /*! \param name Name of member to be removed. - \return Whether the member existed. - \note Linear time complexity. - */ - bool EraseMember(const Ch* name) { - GenericValue n(StringRef(name)); - return EraseMember(n); - } - -#if RAPIDJSON_HAS_STDSTRING - bool EraseMember(const std::basic_string& name) { return EraseMember(GenericValue(StringRef(name))); } -#endif - - template - bool EraseMember(const GenericValue& name) { - MemberIterator m = FindMember(name); - if (m != MemberEnd()) { - EraseMember(m); - return true; - } - else - return false; - } - - Object GetObject() { RAPIDJSON_ASSERT(IsObject()); return Object(*this); } - Object GetObj() { RAPIDJSON_ASSERT(IsObject()); return Object(*this); } - ConstObject GetObject() const { RAPIDJSON_ASSERT(IsObject()); return ConstObject(*this); } - ConstObject GetObj() const { RAPIDJSON_ASSERT(IsObject()); return ConstObject(*this); } - - //@} - - //!@name Array - //@{ - - //! Set this value as an empty array. - /*! \post IsArray == true */ - GenericValue& SetArray() { this->~GenericValue(); new (this) GenericValue(kArrayType); return *this; } - - //! Get the number of elements in array. - SizeType Size() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size; } - - //! Get the capacity of array. - SizeType Capacity() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.capacity; } - - //! Check whether the array is empty. - bool Empty() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size == 0; } - - //! Remove all elements in the array. - /*! This function do not deallocate memory in the array, i.e. the capacity is unchanged. - \note Linear time complexity. - */ - void Clear() { - RAPIDJSON_ASSERT(IsArray()); - GenericValue* e = GetElementsPointer(); - for (GenericValue* v = e; v != e + data_.a.size; ++v) - v->~GenericValue(); - data_.a.size = 0; - } - - //! Get an element from array by index. - /*! \pre IsArray() == true - \param index Zero-based index of element. - \see operator[](T*) - */ - GenericValue& operator[](SizeType index) { - RAPIDJSON_ASSERT(IsArray()); - RAPIDJSON_ASSERT(index < data_.a.size); - return GetElementsPointer()[index]; - } - const GenericValue& operator[](SizeType index) const { return const_cast(*this)[index]; } - - //! Element iterator - /*! \pre IsArray() == true */ - ValueIterator Begin() { RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer(); } - //! \em Past-the-end element iterator - /*! \pre IsArray() == true */ - ValueIterator End() { RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer() + data_.a.size; } - //! Constant element iterator - /*! \pre IsArray() == true */ - ConstValueIterator Begin() const { return const_cast(*this).Begin(); } - //! Constant \em past-the-end element iterator - /*! \pre IsArray() == true */ - ConstValueIterator End() const { return const_cast(*this).End(); } - - //! Request the array to have enough capacity to store elements. - /*! \param newCapacity The capacity that the array at least need to have. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \note Linear time complexity. - */ - GenericValue& Reserve(SizeType newCapacity, Allocator &allocator) { - RAPIDJSON_ASSERT(IsArray()); - if (newCapacity > data_.a.capacity) { - SetElementsPointer(reinterpret_cast(allocator.Realloc(GetElementsPointer(), data_.a.capacity * sizeof(GenericValue), newCapacity * sizeof(GenericValue)))); - data_.a.capacity = newCapacity; - } - return *this; - } - - //! Append a GenericValue at the end of the array. - /*! \param value Value to be appended. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \pre IsArray() == true - \post value.IsNull() == true - \return The value itself for fluent API. - \note The ownership of \c value will be transferred to this array on success. - \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. - \note Amortized constant time complexity. - */ - GenericValue& PushBack(GenericValue& value, Allocator& allocator) { - RAPIDJSON_ASSERT(IsArray()); - if (data_.a.size >= data_.a.capacity) - Reserve(data_.a.capacity == 0 ? kDefaultArrayCapacity : (data_.a.capacity + (data_.a.capacity + 1) / 2), allocator); - GetElementsPointer()[data_.a.size++].RawAssign(value); - return *this; - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericValue& PushBack(GenericValue&& value, Allocator& allocator) { - return PushBack(value, allocator); - } -#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS - - //! Append a constant string reference at the end of the array. - /*! \param value Constant string reference to be appended. - \param allocator Allocator for reallocating memory. It must be the same one used previously. Commonly use GenericDocument::GetAllocator(). - \pre IsArray() == true - \return The value itself for fluent API. - \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. - \note Amortized constant time complexity. - \see GenericStringRef - */ - GenericValue& PushBack(StringRefType value, Allocator& allocator) { - return (*this).template PushBack(value, allocator); - } - - //! Append a primitive value at the end of the array. - /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t - \param value Value of primitive type T to be appended. - \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). - \pre IsArray() == true - \return The value itself for fluent API. - \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. - - \note The source type \c T explicitly disallows all pointer types, - especially (\c const) \ref Ch*. This helps avoiding implicitly - referencing character strings with insufficient lifetime, use - \ref PushBack(GenericValue&, Allocator&) or \ref - PushBack(StringRefType, Allocator&). - All other pointer types would implicitly convert to \c bool, - use an explicit cast instead, if needed. - \note Amortized constant time complexity. - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) - PushBack(T value, Allocator& allocator) { - GenericValue v(value); - return PushBack(v, allocator); - } - - //! Remove the last element in the array. - /*! - \note Constant time complexity. - */ - GenericValue& PopBack() { - RAPIDJSON_ASSERT(IsArray()); - RAPIDJSON_ASSERT(!Empty()); - GetElementsPointer()[--data_.a.size].~GenericValue(); - return *this; - } - - //! Remove an element of array by iterator. - /*! - \param pos iterator to the element to remove - \pre IsArray() == true && \ref Begin() <= \c pos < \ref End() - \return Iterator following the removed element. If the iterator pos refers to the last element, the End() iterator is returned. - \note Linear time complexity. - */ - ValueIterator Erase(ConstValueIterator pos) { - return Erase(pos, pos + 1); - } - - //! Remove elements in the range [first, last) of the array. - /*! - \param first iterator to the first element to remove - \param last iterator following the last element to remove - \pre IsArray() == true && \ref Begin() <= \c first <= \c last <= \ref End() - \return Iterator following the last removed element. - \note Linear time complexity. - */ - ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) { - RAPIDJSON_ASSERT(IsArray()); - RAPIDJSON_ASSERT(data_.a.size > 0); - RAPIDJSON_ASSERT(GetElementsPointer() != 0); - RAPIDJSON_ASSERT(first >= Begin()); - RAPIDJSON_ASSERT(first <= last); - RAPIDJSON_ASSERT(last <= End()); - ValueIterator pos = Begin() + (first - Begin()); - for (ValueIterator itr = pos; itr != last; ++itr) - itr->~GenericValue(); - std::memmove(static_cast(pos), last, static_cast(End() - last) * sizeof(GenericValue)); - data_.a.size -= static_cast(last - first); - return pos; - } - - Array GetArray() { RAPIDJSON_ASSERT(IsArray()); return Array(*this); } - ConstArray GetArray() const { RAPIDJSON_ASSERT(IsArray()); return ConstArray(*this); } - - //@} - - //!@name Number - //@{ - - int GetInt() const { RAPIDJSON_ASSERT(data_.f.flags & kIntFlag); return data_.n.i.i; } - unsigned GetUint() const { RAPIDJSON_ASSERT(data_.f.flags & kUintFlag); return data_.n.u.u; } - int64_t GetInt64() const { RAPIDJSON_ASSERT(data_.f.flags & kInt64Flag); return data_.n.i64; } - uint64_t GetUint64() const { RAPIDJSON_ASSERT(data_.f.flags & kUint64Flag); return data_.n.u64; } - - //! Get the value as double type. - /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessDouble() to check whether the conversion is lossless. - */ - double GetDouble() const { - RAPIDJSON_ASSERT(IsNumber()); - if ((data_.f.flags & kDoubleFlag) != 0) return data_.n.d; // exact type, no conversion. - if ((data_.f.flags & kIntFlag) != 0) return data_.n.i.i; // int -> double - if ((data_.f.flags & kUintFlag) != 0) return data_.n.u.u; // unsigned -> double - if ((data_.f.flags & kInt64Flag) != 0) return static_cast(data_.n.i64); // int64_t -> double (may lose precision) - RAPIDJSON_ASSERT((data_.f.flags & kUint64Flag) != 0); return static_cast(data_.n.u64); // uint64_t -> double (may lose precision) - } - - //! Get the value as float type. - /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessFloat() to check whether the conversion is lossless. - */ - float GetFloat() const { - return static_cast(GetDouble()); - } - - GenericValue& SetInt(int i) { this->~GenericValue(); new (this) GenericValue(i); return *this; } - GenericValue& SetUint(unsigned u) { this->~GenericValue(); new (this) GenericValue(u); return *this; } - GenericValue& SetInt64(int64_t i64) { this->~GenericValue(); new (this) GenericValue(i64); return *this; } - GenericValue& SetUint64(uint64_t u64) { this->~GenericValue(); new (this) GenericValue(u64); return *this; } - GenericValue& SetDouble(double d) { this->~GenericValue(); new (this) GenericValue(d); return *this; } - GenericValue& SetFloat(float f) { this->~GenericValue(); new (this) GenericValue(static_cast(f)); return *this; } - - //@} - - //!@name String - //@{ - - const Ch* GetString() const { RAPIDJSON_ASSERT(IsString()); return DataString(data_); } - - //! Get the length of string. - /*! Since rapidjson permits "\\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength(). - */ - SizeType GetStringLength() const { RAPIDJSON_ASSERT(IsString()); return DataStringLength(data_); } - - //! Set this value as a string without copying source string. - /*! This version has better performance with supplied length, and also support string containing null character. - \param s source string pointer. - \param length The length of source string, excluding the trailing null terminator. - \return The value itself for fluent API. - \post IsString() == true && GetString() == s && GetStringLength() == length - \see SetString(StringRefType) - */ - GenericValue& SetString(const Ch* s, SizeType length) { return SetString(StringRef(s, length)); } - - //! Set this value as a string without copying source string. - /*! \param s source string reference - \return The value itself for fluent API. - \post IsString() == true && GetString() == s && GetStringLength() == s.length - */ - GenericValue& SetString(StringRefType s) { this->~GenericValue(); SetStringRaw(s); return *this; } - - //! Set this value as a string by copying from source string. - /*! This version has better performance with supplied length, and also support string containing null character. - \param s source string. - \param length The length of source string, excluding the trailing null terminator. - \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length - */ - GenericValue& SetString(const Ch* s, SizeType length, Allocator& allocator) { return SetString(StringRef(s, length), allocator); } - - //! Set this value as a string by copying from source string. - /*! \param s source string. - \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length - */ - GenericValue& SetString(const Ch* s, Allocator& allocator) { return SetString(StringRef(s), allocator); } - - //! Set this value as a string by copying from source string. - /*! \param s source string reference - \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \post IsString() == true && GetString() != s.s && strcmp(GetString(),s) == 0 && GetStringLength() == length - */ - GenericValue& SetString(StringRefType s, Allocator& allocator) { this->~GenericValue(); SetStringRaw(s, allocator); return *this; } - -#if RAPIDJSON_HAS_STDSTRING - //! Set this value as a string by copying from source string. - /*! \param s source string. - \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). - \return The value itself for fluent API. - \post IsString() == true && GetString() != s.data() && strcmp(GetString(),s.data() == 0 && GetStringLength() == s.size() - \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. - */ - GenericValue& SetString(const std::basic_string& s, Allocator& allocator) { return SetString(StringRef(s), allocator); } -#endif - - //@} - - //!@name Array - //@{ - - //! Templated version for checking whether this value is type T. - /*! - \tparam T Either \c bool, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c float, \c const \c char*, \c std::basic_string - */ - template - bool Is() const { return internal::TypeHelper::Is(*this); } - - template - T Get() const { return internal::TypeHelper::Get(*this); } - - template - T Get() { return internal::TypeHelper::Get(*this); } - - template - ValueType& Set(const T& data) { return internal::TypeHelper::Set(*this, data); } - - template - ValueType& Set(const T& data, AllocatorType& allocator) { return internal::TypeHelper::Set(*this, data, allocator); } - - //@} - - //! Generate events of this value to a Handler. - /*! This function adopts the GoF visitor pattern. - Typical usage is to output this JSON value as JSON text via Writer, which is a Handler. - It can also be used to deep clone this value via GenericDocument, which is also a Handler. - \tparam Handler type of handler. - \param handler An object implementing concept Handler. - */ - template - bool Accept(Handler& handler) const { - switch(GetType()) { - case kNullType: return handler.Null(); - case kFalseType: return handler.Bool(false); - case kTrueType: return handler.Bool(true); - - case kObjectType: - if (RAPIDJSON_UNLIKELY(!handler.StartObject())) - return false; - for (ConstMemberIterator m = MemberBegin(); m != MemberEnd(); ++m) { - RAPIDJSON_ASSERT(m->name.IsString()); // User may change the type of name by MemberIterator. - if (RAPIDJSON_UNLIKELY(!handler.Key(m->name.GetString(), m->name.GetStringLength(), (m->name.data_.f.flags & kCopyFlag) != 0))) - return false; - if (RAPIDJSON_UNLIKELY(!m->value.Accept(handler))) - return false; - } - return handler.EndObject(data_.o.size); - - case kArrayType: - if (RAPIDJSON_UNLIKELY(!handler.StartArray())) - return false; - for (ConstValueIterator v = Begin(); v != End(); ++v) - if (RAPIDJSON_UNLIKELY(!v->Accept(handler))) - return false; - return handler.EndArray(data_.a.size); - - case kStringType: - return handler.String(GetString(), GetStringLength(), (data_.f.flags & kCopyFlag) != 0); - - default: - RAPIDJSON_ASSERT(GetType() == kNumberType); - if (IsDouble()) return handler.Double(data_.n.d); - else if (IsInt()) return handler.Int(data_.n.i.i); - else if (IsUint()) return handler.Uint(data_.n.u.u); - else if (IsInt64()) return handler.Int64(data_.n.i64); - else return handler.Uint64(data_.n.u64); - } - } - -private: - template friend class GenericValue; - template friend class GenericDocument; - - enum { - kBoolFlag = 0x0008, - kNumberFlag = 0x0010, - kIntFlag = 0x0020, - kUintFlag = 0x0040, - kInt64Flag = 0x0080, - kUint64Flag = 0x0100, - kDoubleFlag = 0x0200, - kStringFlag = 0x0400, - kCopyFlag = 0x0800, - kInlineStrFlag = 0x1000, - - // Initial flags of different types. - kNullFlag = kNullType, - // These casts are added to suppress the warning on MSVC about bitwise operations between enums of different types. - kTrueFlag = static_cast(kTrueType) | static_cast(kBoolFlag), - kFalseFlag = static_cast(kFalseType) | static_cast(kBoolFlag), - kNumberIntFlag = static_cast(kNumberType) | static_cast(kNumberFlag | kIntFlag | kInt64Flag), - kNumberUintFlag = static_cast(kNumberType) | static_cast(kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag), - kNumberInt64Flag = static_cast(kNumberType) | static_cast(kNumberFlag | kInt64Flag), - kNumberUint64Flag = static_cast(kNumberType) | static_cast(kNumberFlag | kUint64Flag), - kNumberDoubleFlag = static_cast(kNumberType) | static_cast(kNumberFlag | kDoubleFlag), - kNumberAnyFlag = static_cast(kNumberType) | static_cast(kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag), - kConstStringFlag = static_cast(kStringType) | static_cast(kStringFlag), - kCopyStringFlag = static_cast(kStringType) | static_cast(kStringFlag | kCopyFlag), - kShortStringFlag = static_cast(kStringType) | static_cast(kStringFlag | kCopyFlag | kInlineStrFlag), - kObjectFlag = kObjectType, - kArrayFlag = kArrayType, - - kTypeMask = 0x07 - }; - - static const SizeType kDefaultArrayCapacity = RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY; - static const SizeType kDefaultObjectCapacity = RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY; - - struct Flag { -#if RAPIDJSON_48BITPOINTER_OPTIMIZATION - char payload[sizeof(SizeType) * 2 + 6]; // 2 x SizeType + lower 48-bit pointer -#elif RAPIDJSON_64BIT - char payload[sizeof(SizeType) * 2 + sizeof(void*) + 6]; // 6 padding bytes -#else - char payload[sizeof(SizeType) * 2 + sizeof(void*) + 2]; // 2 padding bytes -#endif - uint16_t flags; - }; - - struct String { - SizeType length; - SizeType hashcode; //!< reserved - const Ch* str; - }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - // implementation detail: ShortString can represent zero-terminated strings up to MaxSize chars - // (excluding the terminating zero) and store a value to determine the length of the contained - // string in the last character str[LenPos] by storing "MaxSize - length" there. If the string - // to store has the maximal length of MaxSize then str[LenPos] will be 0 and therefore act as - // the string terminator as well. For getting the string length back from that value just use - // "MaxSize - str[LenPos]". - // This allows to store 13-chars strings in 32-bit mode, 21-chars strings in 64-bit mode, - // 13-chars strings for RAPIDJSON_48BITPOINTER_OPTIMIZATION=1 inline (for `UTF8`-encoded strings). - struct ShortString { - enum { MaxChars = sizeof(static_cast(0)->payload) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize }; - Ch str[MaxChars]; - - inline static bool Usable(SizeType len) { return (MaxSize >= len); } - inline void SetLength(SizeType len) { str[LenPos] = static_cast(MaxSize - len); } - inline SizeType GetLength() const { return static_cast(MaxSize - str[LenPos]); } - }; // at most as many bytes as "String" above => 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - // By using proper binary layout, retrieval of different integer types do not need conversions. - union Number { -#if RAPIDJSON_ENDIAN == RAPIDJSON_LITTLEENDIAN - struct I { - int i; - char padding[4]; - }i; - struct U { - unsigned u; - char padding2[4]; - }u; -#else - struct I { - char padding[4]; - int i; - }i; - struct U { - char padding2[4]; - unsigned u; - }u; -#endif - int64_t i64; - uint64_t u64; - double d; - }; // 8 bytes - - struct ObjectData { - SizeType size; - SizeType capacity; - Member* members; - }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - struct ArrayData { - SizeType size; - SizeType capacity; - GenericValue* elements; - }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode - - union Data { - String s; - ShortString ss; - Number n; - ObjectData o; - ArrayData a; - Flag f; - }; // 16 bytes in 32-bit mode, 24 bytes in 64-bit mode, 16 bytes in 64-bit with RAPIDJSON_48BITPOINTER_OPTIMIZATION - - static RAPIDJSON_FORCEINLINE const Ch* DataString(const Data& data) { - return (data.f.flags & kInlineStrFlag) ? data.ss.str : RAPIDJSON_GETPOINTER(Ch, data.s.str); - } - static RAPIDJSON_FORCEINLINE SizeType DataStringLength(const Data& data) { - return (data.f.flags & kInlineStrFlag) ? data.ss.GetLength() : data.s.length; - } - - RAPIDJSON_FORCEINLINE const Ch* GetStringPointer() const { return RAPIDJSON_GETPOINTER(Ch, data_.s.str); } - RAPIDJSON_FORCEINLINE const Ch* SetStringPointer(const Ch* str) { return RAPIDJSON_SETPOINTER(Ch, data_.s.str, str); } - RAPIDJSON_FORCEINLINE GenericValue* GetElementsPointer() const { return RAPIDJSON_GETPOINTER(GenericValue, data_.a.elements); } - RAPIDJSON_FORCEINLINE GenericValue* SetElementsPointer(GenericValue* elements) { return RAPIDJSON_SETPOINTER(GenericValue, data_.a.elements, elements); } - RAPIDJSON_FORCEINLINE Member* GetMembersPointer() const { return RAPIDJSON_GETPOINTER(Member, data_.o.members); } - RAPIDJSON_FORCEINLINE Member* SetMembersPointer(Member* members) { return RAPIDJSON_SETPOINTER(Member, data_.o.members, members); } - -#if RAPIDJSON_USE_MEMBERSMAP - - struct MapTraits { - struct Less { - bool operator()(const Data& s1, const Data& s2) const { - SizeType n1 = DataStringLength(s1), n2 = DataStringLength(s2); - int cmp = std::memcmp(DataString(s1), DataString(s2), sizeof(Ch) * (n1 < n2 ? n1 : n2)); - return cmp < 0 || (cmp == 0 && n1 < n2); - } - }; - typedef std::pair Pair; - typedef std::multimap > Map; - typedef typename Map::iterator Iterator; - }; - typedef typename MapTraits::Map Map; - typedef typename MapTraits::Less MapLess; - typedef typename MapTraits::Pair MapPair; - typedef typename MapTraits::Iterator MapIterator; - - // - // Layout of the members' map/array, re(al)located according to the needed capacity: - // - // {Map*}<>{capacity}<>{Member[capacity]}<>{MapIterator[capacity]} - // - // (where <> stands for the RAPIDJSON_ALIGN-ment, if needed) - // - - static RAPIDJSON_FORCEINLINE size_t GetMapLayoutSize(SizeType capacity) { - return RAPIDJSON_ALIGN(sizeof(Map*)) + - RAPIDJSON_ALIGN(sizeof(SizeType)) + - RAPIDJSON_ALIGN(capacity * sizeof(Member)) + - capacity * sizeof(MapIterator); - } - - static RAPIDJSON_FORCEINLINE SizeType &GetMapCapacity(Map* &map) { - return *reinterpret_cast(reinterpret_cast(&map) + - RAPIDJSON_ALIGN(sizeof(Map*))); - } - - static RAPIDJSON_FORCEINLINE Member* GetMapMembers(Map* &map) { - return reinterpret_cast(reinterpret_cast(&map) + - RAPIDJSON_ALIGN(sizeof(Map*)) + - RAPIDJSON_ALIGN(sizeof(SizeType))); - } - - static RAPIDJSON_FORCEINLINE MapIterator* GetMapIterators(Map* &map) { - return reinterpret_cast(reinterpret_cast(&map) + - RAPIDJSON_ALIGN(sizeof(Map*)) + - RAPIDJSON_ALIGN(sizeof(SizeType)) + - RAPIDJSON_ALIGN(GetMapCapacity(map) * sizeof(Member))); - } - - static RAPIDJSON_FORCEINLINE Map* &GetMap(Member* members) { - RAPIDJSON_ASSERT(members != 0); - return *reinterpret_cast(reinterpret_cast(members) - - RAPIDJSON_ALIGN(sizeof(SizeType)) - - RAPIDJSON_ALIGN(sizeof(Map*))); - } - - // Some compilers' debug mechanisms want all iterators to be destroyed, for their accounting.. - RAPIDJSON_FORCEINLINE MapIterator DropMapIterator(MapIterator& rhs) { -#if RAPIDJSON_HAS_CXX11 - MapIterator ret = std::move(rhs); -#else - MapIterator ret = rhs; -#endif - rhs.~MapIterator(); - return ret; - } - - Map* &DoReallocMap(Map** oldMap, SizeType newCapacity, Allocator& allocator) { - Map **newMap = static_cast(allocator.Malloc(GetMapLayoutSize(newCapacity))); - GetMapCapacity(*newMap) = newCapacity; - if (!oldMap) { - *newMap = new (allocator.Malloc(sizeof(Map))) Map(MapLess(), allocator); - } - else { - *newMap = *oldMap; - size_t count = (*oldMap)->size(); - std::memcpy(static_cast(GetMapMembers(*newMap)), - static_cast(GetMapMembers(*oldMap)), - count * sizeof(Member)); - MapIterator *oldIt = GetMapIterators(*oldMap), - *newIt = GetMapIterators(*newMap); - while (count--) { - new (&newIt[count]) MapIterator(DropMapIterator(oldIt[count])); - } - Allocator::Free(oldMap); - } - return *newMap; - } - - RAPIDJSON_FORCEINLINE Member* DoAllocMembers(SizeType capacity, Allocator& allocator) { - return GetMapMembers(DoReallocMap(0, capacity, allocator)); - } - - void DoReserveMembers(SizeType newCapacity, Allocator& allocator) { - ObjectData& o = data_.o; - if (newCapacity > o.capacity) { - Member* oldMembers = GetMembersPointer(); - Map **oldMap = oldMembers ? &GetMap(oldMembers) : 0, - *&newMap = DoReallocMap(oldMap, newCapacity, allocator); - RAPIDJSON_SETPOINTER(Member, o.members, GetMapMembers(newMap)); - o.capacity = newCapacity; - } - } - - template - MemberIterator DoFindMember(const GenericValue& name) { - if (Member* members = GetMembersPointer()) { - Map* &map = GetMap(members); - MapIterator mit = map->find(reinterpret_cast(name.data_)); - if (mit != map->end()) { - return MemberIterator(&members[mit->second]); - } - } - return MemberEnd(); - } - - void DoClearMembers() { - if (Member* members = GetMembersPointer()) { - Map* &map = GetMap(members); - MapIterator* mit = GetMapIterators(map); - for (SizeType i = 0; i < data_.o.size; i++) { - map->erase(DropMapIterator(mit[i])); - members[i].~Member(); - } - data_.o.size = 0; - } - } - - void DoFreeMembers() { - if (Member* members = GetMembersPointer()) { - GetMap(members)->~Map(); - for (SizeType i = 0; i < data_.o.size; i++) { - members[i].~Member(); - } - if (Allocator::kNeedFree) { // Shortcut by Allocator's trait - Map** map = &GetMap(members); - Allocator::Free(*map); - Allocator::Free(map); - } - } - } - -#else // !RAPIDJSON_USE_MEMBERSMAP - - RAPIDJSON_FORCEINLINE Member* DoAllocMembers(SizeType capacity, Allocator& allocator) { - return Malloc(allocator, capacity); - } - - void DoReserveMembers(SizeType newCapacity, Allocator& allocator) { - ObjectData& o = data_.o; - if (newCapacity > o.capacity) { - Member* newMembers = Realloc(allocator, GetMembersPointer(), o.capacity, newCapacity); - RAPIDJSON_SETPOINTER(Member, o.members, newMembers); - o.capacity = newCapacity; - } - } - - template - MemberIterator DoFindMember(const GenericValue& name) { - MemberIterator member = MemberBegin(); - for ( ; member != MemberEnd(); ++member) - if (name.StringEqual(member->name)) - break; - return member; - } - - void DoClearMembers() { - for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) - m->~Member(); - data_.o.size = 0; - } - - void DoFreeMembers() { - for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) - m->~Member(); - Allocator::Free(GetMembersPointer()); - } - -#endif // !RAPIDJSON_USE_MEMBERSMAP - - void DoAddMember(GenericValue& name, GenericValue& value, Allocator& allocator) { - ObjectData& o = data_.o; - if (o.size >= o.capacity) - DoReserveMembers(o.capacity ? (o.capacity + (o.capacity + 1) / 2) : kDefaultObjectCapacity, allocator); - Member* members = GetMembersPointer(); - Member* m = members + o.size; - m->name.RawAssign(name); - m->value.RawAssign(value); -#if RAPIDJSON_USE_MEMBERSMAP - Map* &map = GetMap(members); - MapIterator* mit = GetMapIterators(map); - new (&mit[o.size]) MapIterator(map->insert(MapPair(m->name.data_, o.size))); -#endif - ++o.size; - } - - MemberIterator DoRemoveMember(MemberIterator m) { - ObjectData& o = data_.o; - Member* members = GetMembersPointer(); -#if RAPIDJSON_USE_MEMBERSMAP - Map* &map = GetMap(members); - MapIterator* mit = GetMapIterators(map); - SizeType mpos = static_cast(&*m - members); - map->erase(DropMapIterator(mit[mpos])); -#endif - MemberIterator last(members + (o.size - 1)); - if (o.size > 1 && m != last) { -#if RAPIDJSON_USE_MEMBERSMAP - new (&mit[mpos]) MapIterator(DropMapIterator(mit[&*last - members])); - mit[mpos]->second = mpos; -#endif - *m = *last; // Move the last one to this place - } - else { - m->~Member(); // Only one left, just destroy - } - --o.size; - return m; - } - - MemberIterator DoEraseMembers(ConstMemberIterator first, ConstMemberIterator last) { - ObjectData& o = data_.o; - MemberIterator beg = MemberBegin(), - pos = beg + (first - beg), - end = MemberEnd(); -#if RAPIDJSON_USE_MEMBERSMAP - Map* &map = GetMap(GetMembersPointer()); - MapIterator* mit = GetMapIterators(map); -#endif - for (MemberIterator itr = pos; itr != last; ++itr) { -#if RAPIDJSON_USE_MEMBERSMAP - map->erase(DropMapIterator(mit[itr - beg])); -#endif - itr->~Member(); - } -#if RAPIDJSON_USE_MEMBERSMAP - if (first != last) { - // Move remaining members/iterators - MemberIterator next = pos + (last - first); - for (MemberIterator itr = pos; next != end; ++itr, ++next) { - std::memcpy(static_cast(&*itr), &*next, sizeof(Member)); - SizeType mpos = static_cast(itr - beg); - new (&mit[mpos]) MapIterator(DropMapIterator(mit[next - beg])); - mit[mpos]->second = mpos; - } - } -#else - std::memmove(static_cast(&*pos), &*last, - static_cast(end - last) * sizeof(Member)); -#endif - o.size -= static_cast(last - first); - return pos; - } - - template - void DoCopyMembers(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings) { - RAPIDJSON_ASSERT(rhs.GetType() == kObjectType); - - data_.f.flags = kObjectFlag; - SizeType count = rhs.data_.o.size; - Member* lm = DoAllocMembers(count, allocator); - const typename GenericValue::Member* rm = rhs.GetMembersPointer(); -#if RAPIDJSON_USE_MEMBERSMAP - Map* &map = GetMap(lm); - MapIterator* mit = GetMapIterators(map); -#endif - for (SizeType i = 0; i < count; i++) { - new (&lm[i].name) GenericValue(rm[i].name, allocator, copyConstStrings); - new (&lm[i].value) GenericValue(rm[i].value, allocator, copyConstStrings); -#if RAPIDJSON_USE_MEMBERSMAP - new (&mit[i]) MapIterator(map->insert(MapPair(lm[i].name.data_, i))); -#endif - } - data_.o.size = data_.o.capacity = count; - SetMembersPointer(lm); - } - - // Initialize this value as array with initial data, without calling destructor. - void SetArrayRaw(GenericValue* values, SizeType count, Allocator& allocator) { - data_.f.flags = kArrayFlag; - if (count) { - GenericValue* e = static_cast(allocator.Malloc(count * sizeof(GenericValue))); - SetElementsPointer(e); - std::memcpy(static_cast(e), values, count * sizeof(GenericValue)); - } - else - SetElementsPointer(0); - data_.a.size = data_.a.capacity = count; - } - - //! Initialize this value as object with initial data, without calling destructor. - void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) { - data_.f.flags = kObjectFlag; - if (count) { - Member* m = DoAllocMembers(count, allocator); - SetMembersPointer(m); - std::memcpy(static_cast(m), members, count * sizeof(Member)); -#if RAPIDJSON_USE_MEMBERSMAP - Map* &map = GetMap(m); - MapIterator* mit = GetMapIterators(map); - for (SizeType i = 0; i < count; i++) { - new (&mit[i]) MapIterator(map->insert(MapPair(m[i].name.data_, i))); - } -#endif - } - else - SetMembersPointer(0); - data_.o.size = data_.o.capacity = count; - } - - //! Initialize this value as constant string, without calling destructor. - void SetStringRaw(StringRefType s) RAPIDJSON_NOEXCEPT { - data_.f.flags = kConstStringFlag; - SetStringPointer(s); - data_.s.length = s.length; - } - - //! Initialize this value as copy string with initial data, without calling destructor. - void SetStringRaw(StringRefType s, Allocator& allocator) { - Ch* str = 0; - if (ShortString::Usable(s.length)) { - data_.f.flags = kShortStringFlag; - data_.ss.SetLength(s.length); - str = data_.ss.str; - } else { - data_.f.flags = kCopyStringFlag; - data_.s.length = s.length; - str = static_cast(allocator.Malloc((s.length + 1) * sizeof(Ch))); - SetStringPointer(str); - } - std::memcpy(str, s, s.length * sizeof(Ch)); - str[s.length] = '\0'; - } - - //! Assignment without calling destructor - void RawAssign(GenericValue& rhs) RAPIDJSON_NOEXCEPT { - data_ = rhs.data_; - // data_.f.flags = rhs.data_.f.flags; - rhs.data_.f.flags = kNullFlag; - } - - template - bool StringEqual(const GenericValue& rhs) const { - RAPIDJSON_ASSERT(IsString()); - RAPIDJSON_ASSERT(rhs.IsString()); - - const SizeType len1 = GetStringLength(); - const SizeType len2 = rhs.GetStringLength(); - if(len1 != len2) { return false; } - - const Ch* const str1 = GetString(); - const Ch* const str2 = rhs.GetString(); - if(str1 == str2) { return true; } // fast path for constant string - - return (std::memcmp(str1, str2, sizeof(Ch) * len1) == 0); - } - - Data data_; -}; - -//! GenericValue with UTF8 encoding -typedef GenericValue > Value; - -/////////////////////////////////////////////////////////////////////////////// -// GenericDocument - -//! A document for parsing JSON text as DOM. -/*! - \note implements Handler concept - \tparam Encoding Encoding for both parsing and string storage. - \tparam Allocator Allocator for allocating memory for the DOM - \tparam StackAllocator Allocator for allocating memory for stack during parsing. - \warning Although GenericDocument inherits from GenericValue, the API does \b not provide any virtual functions, especially no virtual destructor. To avoid memory leaks, do not \c delete a GenericDocument object via a pointer to a GenericValue. -*/ -template -class GenericDocument : public GenericValue { -public: - typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. - typedef GenericValue ValueType; //!< Value type of the document. - typedef Allocator AllocatorType; //!< Allocator type from template parameter. - typedef StackAllocator StackAllocatorType; //!< StackAllocator type from template parameter. - - //! Constructor - /*! Creates an empty document of specified type. - \param type Mandatory type of object to create. - \param allocator Optional allocator for allocating memory. - \param stackCapacity Optional initial capacity of stack in bytes. - \param stackAllocator Optional allocator for allocating memory for stack. - */ - explicit GenericDocument(Type type, Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : - GenericValue(type), allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() - { - if (!allocator_) - ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); - } - - //! Constructor - /*! Creates an empty document which type is Null. - \param allocator Optional allocator for allocating memory. - \param stackCapacity Optional initial capacity of stack in bytes. - \param stackAllocator Optional allocator for allocating memory for stack. - */ - GenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : - allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() - { - if (!allocator_) - ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move constructor in C++11 - GenericDocument(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT - : ValueType(std::forward(rhs)), // explicit cast to avoid prohibited move from Document - allocator_(rhs.allocator_), - ownAllocator_(rhs.ownAllocator_), - stack_(std::move(rhs.stack_)), - parseResult_(rhs.parseResult_) - { - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.parseResult_ = ParseResult(); - } -#endif - - ~GenericDocument() { - // Clear the ::ValueType before ownAllocator is destroyed, ~ValueType() - // runs last and may access its elements or members which would be freed - // with an allocator like MemoryPoolAllocator (CrtAllocator does not - // free its data when destroyed, but MemoryPoolAllocator does). - if (ownAllocator_) { - ValueType::SetNull(); - } - Destroy(); - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move assignment in C++11 - GenericDocument& operator=(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT - { - // The cast to ValueType is necessary here, because otherwise it would - // attempt to call GenericValue's templated assignment operator. - ValueType::operator=(std::forward(rhs)); - - // Calling the destructor here would prematurely call stack_'s destructor - Destroy(); - - allocator_ = rhs.allocator_; - ownAllocator_ = rhs.ownAllocator_; - stack_ = std::move(rhs.stack_); - parseResult_ = rhs.parseResult_; - - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.parseResult_ = ParseResult(); - - return *this; - } -#endif - - //! Exchange the contents of this document with those of another. - /*! - \param rhs Another document. - \note Constant complexity. - \see GenericValue::Swap - */ - GenericDocument& Swap(GenericDocument& rhs) RAPIDJSON_NOEXCEPT { - ValueType::Swap(rhs); - stack_.Swap(rhs.stack_); - internal::Swap(allocator_, rhs.allocator_); - internal::Swap(ownAllocator_, rhs.ownAllocator_); - internal::Swap(parseResult_, rhs.parseResult_); - return *this; - } - - // Allow Swap with ValueType. - // Refer to Effective C++ 3rd Edition/Item 33: Avoid hiding inherited names. - using ValueType::Swap; - - //! free-standing swap function helper - /*! - Helper function to enable support for common swap implementation pattern based on \c std::swap: - \code - void swap(MyClass& a, MyClass& b) { - using std::swap; - swap(a.doc, b.doc); - // ... - } - \endcode - \see Swap() - */ - friend inline void swap(GenericDocument& a, GenericDocument& b) RAPIDJSON_NOEXCEPT { a.Swap(b); } - - //! Populate this document by a generator which produces SAX events. - /*! \tparam Generator A functor with bool f(Handler) prototype. - \param g Generator functor which sends SAX events to the parameter. - \return The document itself for fluent API. - */ - template - GenericDocument& Populate(Generator& g) { - ClearStackOnExit scope(*this); - if (g(*this)) { - RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object - ValueType::operator=(*stack_.template Pop(1));// Move value from stack to document - } - return *this; - } - - //!@name Parse from stream - //!@{ - - //! Parse JSON text from an input stream (with Encoding conversion) - /*! \tparam parseFlags Combination of \ref ParseFlag. - \tparam SourceEncoding Encoding of input stream - \tparam InputStream Type of input stream, implementing Stream concept - \param is Input stream to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseStream(InputStream& is) { - GenericReader reader( - stack_.HasAllocator() ? &stack_.GetAllocator() : 0); - ClearStackOnExit scope(*this); - parseResult_ = reader.template Parse(is, *this); - if (parseResult_) { - RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object - ValueType::operator=(*stack_.template Pop(1));// Move value from stack to document - } - return *this; - } - - //! Parse JSON text from an input stream - /*! \tparam parseFlags Combination of \ref ParseFlag. - \tparam InputStream Type of input stream, implementing Stream concept - \param is Input stream to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseStream(InputStream& is) { - return ParseStream(is); - } - - //! Parse JSON text from an input stream (with \ref kParseDefaultFlags) - /*! \tparam InputStream Type of input stream, implementing Stream concept - \param is Input stream to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseStream(InputStream& is) { - return ParseStream(is); - } - //!@} - - //!@name Parse in-place from mutable string - //!@{ - - //! Parse JSON text from a mutable string - /*! \tparam parseFlags Combination of \ref ParseFlag. - \param str Mutable zero-terminated string to be parsed. - \return The document itself for fluent API. - */ - template - GenericDocument& ParseInsitu(Ch* str) { - GenericInsituStringStream s(str); - return ParseStream(s); - } - - //! Parse JSON text from a mutable string (with \ref kParseDefaultFlags) - /*! \param str Mutable zero-terminated string to be parsed. - \return The document itself for fluent API. - */ - GenericDocument& ParseInsitu(Ch* str) { - return ParseInsitu(str); - } - //!@} - - //!@name Parse from read-only string - //!@{ - - //! Parse JSON text from a read-only string (with Encoding conversion) - /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). - \tparam SourceEncoding Transcoding from input Encoding - \param str Read-only zero-terminated string to be parsed. - */ - template - GenericDocument& Parse(const typename SourceEncoding::Ch* str) { - RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag)); - GenericStringStream s(str); - return ParseStream(s); - } - - //! Parse JSON text from a read-only string - /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). - \param str Read-only zero-terminated string to be parsed. - */ - template - GenericDocument& Parse(const Ch* str) { - return Parse(str); - } - - //! Parse JSON text from a read-only string (with \ref kParseDefaultFlags) - /*! \param str Read-only zero-terminated string to be parsed. - */ - GenericDocument& Parse(const Ch* str) { - return Parse(str); - } - - template - GenericDocument& Parse(const typename SourceEncoding::Ch* str, size_t length) { - RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag)); - MemoryStream ms(reinterpret_cast(str), length * sizeof(typename SourceEncoding::Ch)); - EncodedInputStream is(ms); - ParseStream(is); - return *this; - } - - template - GenericDocument& Parse(const Ch* str, size_t length) { - return Parse(str, length); - } - - GenericDocument& Parse(const Ch* str, size_t length) { - return Parse(str, length); - } - -#if RAPIDJSON_HAS_STDSTRING - template - GenericDocument& Parse(const std::basic_string& str) { - // c_str() is constant complexity according to standard. Should be faster than Parse(const char*, size_t) - return Parse(str.c_str()); - } - - template - GenericDocument& Parse(const std::basic_string& str) { - return Parse(str.c_str()); - } - - GenericDocument& Parse(const std::basic_string& str) { - return Parse(str); - } -#endif // RAPIDJSON_HAS_STDSTRING - - //!@} - - //!@name Handling parse errors - //!@{ - - //! Whether a parse error has occurred in the last parsing. - bool HasParseError() const { return parseResult_.IsError(); } - - //! Get the \ref ParseErrorCode of last parsing. - ParseErrorCode GetParseError() const { return parseResult_.Code(); } - - //! Get the position of last parsing error in input, 0 otherwise. - size_t GetErrorOffset() const { return parseResult_.Offset(); } - - //! Implicit conversion to get the last parse result -#ifndef __clang // -Wdocumentation - /*! \return \ref ParseResult of the last parse operation - - \code - Document doc; - ParseResult ok = doc.Parse(json); - if (!ok) - printf( "JSON parse error: %s (%u)\n", GetParseError_En(ok.Code()), ok.Offset()); - \endcode - */ -#endif - operator ParseResult() const { return parseResult_; } - //!@} - - //! Get the allocator of this document. - Allocator& GetAllocator() { - RAPIDJSON_ASSERT(allocator_); - return *allocator_; - } - - //! Get the capacity of stack in bytes. - size_t GetStackCapacity() const { return stack_.GetCapacity(); } - -private: - // clear stack on any exit from ParseStream, e.g. due to exception - struct ClearStackOnExit { - explicit ClearStackOnExit(GenericDocument& d) : d_(d) {} - ~ClearStackOnExit() { d_.ClearStack(); } - private: - ClearStackOnExit(const ClearStackOnExit&); - ClearStackOnExit& operator=(const ClearStackOnExit&); - GenericDocument& d_; - }; - - // callers of the following private Handler functions - // template friend class GenericReader; // for parsing - template friend class GenericValue; // for deep copying - -public: - // Implementation of Handler - bool Null() { new (stack_.template Push()) ValueType(); return true; } - bool Bool(bool b) { new (stack_.template Push()) ValueType(b); return true; } - bool Int(int i) { new (stack_.template Push()) ValueType(i); return true; } - bool Uint(unsigned i) { new (stack_.template Push()) ValueType(i); return true; } - bool Int64(int64_t i) { new (stack_.template Push()) ValueType(i); return true; } - bool Uint64(uint64_t i) { new (stack_.template Push()) ValueType(i); return true; } - bool Double(double d) { new (stack_.template Push()) ValueType(d); return true; } - - bool RawNumber(const Ch* str, SizeType length, bool copy) { - if (copy) - new (stack_.template Push()) ValueType(str, length, GetAllocator()); - else - new (stack_.template Push()) ValueType(str, length); - return true; - } - - bool String(const Ch* str, SizeType length, bool copy) { - if (copy) - new (stack_.template Push()) ValueType(str, length, GetAllocator()); - else - new (stack_.template Push()) ValueType(str, length); - return true; - } - - bool StartObject() { new (stack_.template Push()) ValueType(kObjectType); return true; } - - bool Key(const Ch* str, SizeType length, bool copy) { return String(str, length, copy); } - - bool EndObject(SizeType memberCount) { - typename ValueType::Member* members = stack_.template Pop(memberCount); - stack_.template Top()->SetObjectRaw(members, memberCount, GetAllocator()); - return true; - } - - bool StartArray() { new (stack_.template Push()) ValueType(kArrayType); return true; } - - bool EndArray(SizeType elementCount) { - ValueType* elements = stack_.template Pop(elementCount); - stack_.template Top()->SetArrayRaw(elements, elementCount, GetAllocator()); - return true; - } - -private: - //! Prohibit copying - GenericDocument(const GenericDocument&); - //! Prohibit assignment - GenericDocument& operator=(const GenericDocument&); - - void ClearStack() { - if (Allocator::kNeedFree) - while (stack_.GetSize() > 0) // Here assumes all elements in stack array are GenericValue (Member is actually 2 GenericValue objects) - (stack_.template Pop(1))->~ValueType(); - else - stack_.Clear(); - stack_.ShrinkToFit(); - } - - void Destroy() { - RAPIDJSON_DELETE(ownAllocator_); - } - - static const size_t kDefaultStackCapacity = 1024; - Allocator* allocator_; - Allocator* ownAllocator_; - internal::Stack stack_; - ParseResult parseResult_; -}; - -//! GenericDocument with UTF8 encoding -typedef GenericDocument > Document; - - -//! Helper class for accessing Value of array type. -/*! - Instance of this helper class is obtained by \c GenericValue::GetArray(). - In addition to all APIs for array type, it provides range-based for loop if \c RAPIDJSON_HAS_CXX11_RANGE_FOR=1. -*/ -template -class GenericArray { -public: - typedef GenericArray ConstArray; - typedef GenericArray Array; - typedef ValueT PlainType; - typedef typename internal::MaybeAddConst::Type ValueType; - typedef ValueType* ValueIterator; // This may be const or non-const iterator - typedef const ValueT* ConstValueIterator; - typedef typename ValueType::AllocatorType AllocatorType; - typedef typename ValueType::StringRefType StringRefType; - - template - friend class GenericValue; - - GenericArray(const GenericArray& rhs) : value_(rhs.value_) {} - GenericArray& operator=(const GenericArray& rhs) { value_ = rhs.value_; return *this; } - ~GenericArray() {} - - operator ValueType&() const { return value_; } - SizeType Size() const { return value_.Size(); } - SizeType Capacity() const { return value_.Capacity(); } - bool Empty() const { return value_.Empty(); } - void Clear() const { value_.Clear(); } - ValueType& operator[](SizeType index) const { return value_[index]; } - ValueIterator Begin() const { return value_.Begin(); } - ValueIterator End() const { return value_.End(); } - GenericArray Reserve(SizeType newCapacity, AllocatorType &allocator) const { value_.Reserve(newCapacity, allocator); return *this; } - GenericArray PushBack(ValueType& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericArray PushBack(ValueType&& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } -#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericArray PushBack(StringRefType value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } - template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (const GenericArray&)) PushBack(T value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } - GenericArray PopBack() const { value_.PopBack(); return *this; } - ValueIterator Erase(ConstValueIterator pos) const { return value_.Erase(pos); } - ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) const { return value_.Erase(first, last); } - -#if RAPIDJSON_HAS_CXX11_RANGE_FOR - ValueIterator begin() const { return value_.Begin(); } - ValueIterator end() const { return value_.End(); } -#endif - -private: - GenericArray(); - GenericArray(ValueType& value) : value_(value) {} - ValueType& value_; -}; - -//! Helper class for accessing Value of object type. -/*! - Instance of this helper class is obtained by \c GenericValue::GetObject(). - In addition to all APIs for array type, it provides range-based for loop if \c RAPIDJSON_HAS_CXX11_RANGE_FOR=1. -*/ -template -class GenericObject { -public: - typedef GenericObject ConstObject; - typedef GenericObject Object; - typedef ValueT PlainType; - typedef typename internal::MaybeAddConst::Type ValueType; - typedef GenericMemberIterator MemberIterator; // This may be const or non-const iterator - typedef GenericMemberIterator ConstMemberIterator; - typedef typename ValueType::AllocatorType AllocatorType; - typedef typename ValueType::StringRefType StringRefType; - typedef typename ValueType::EncodingType EncodingType; - typedef typename ValueType::Ch Ch; - - template - friend class GenericValue; - - GenericObject(const GenericObject& rhs) : value_(rhs.value_) {} - GenericObject& operator=(const GenericObject& rhs) { value_ = rhs.value_; return *this; } - ~GenericObject() {} - - operator ValueType&() const { return value_; } - SizeType MemberCount() const { return value_.MemberCount(); } - SizeType MemberCapacity() const { return value_.MemberCapacity(); } - bool ObjectEmpty() const { return value_.ObjectEmpty(); } - template ValueType& operator[](T* name) const { return value_[name]; } - template ValueType& operator[](const GenericValue& name) const { return value_[name]; } -#if RAPIDJSON_HAS_STDSTRING - ValueType& operator[](const std::basic_string& name) const { return value_[name]; } -#endif - MemberIterator MemberBegin() const { return value_.MemberBegin(); } - MemberIterator MemberEnd() const { return value_.MemberEnd(); } - GenericObject MemberReserve(SizeType newCapacity, AllocatorType &allocator) const { value_.MemberReserve(newCapacity, allocator); return *this; } - bool HasMember(const Ch* name) const { return value_.HasMember(name); } -#if RAPIDJSON_HAS_STDSTRING - bool HasMember(const std::basic_string& name) const { return value_.HasMember(name); } -#endif - template bool HasMember(const GenericValue& name) const { return value_.HasMember(name); } - MemberIterator FindMember(const Ch* name) const { return value_.FindMember(name); } - template MemberIterator FindMember(const GenericValue& name) const { return value_.FindMember(name); } -#if RAPIDJSON_HAS_STDSTRING - MemberIterator FindMember(const std::basic_string& name) const { return value_.FindMember(name); } -#endif - GenericObject AddMember(ValueType& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - GenericObject AddMember(ValueType& name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } -#if RAPIDJSON_HAS_STDSTRING - GenericObject AddMember(ValueType& name, std::basic_string& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } -#endif - template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) AddMember(ValueType& name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericObject AddMember(ValueType&& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - GenericObject AddMember(ValueType&& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - GenericObject AddMember(ValueType& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - GenericObject AddMember(StringRefType name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } -#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericObject AddMember(StringRefType name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - GenericObject AddMember(StringRefType name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericObject)) AddMember(StringRefType name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } - void RemoveAllMembers() { value_.RemoveAllMembers(); } - bool RemoveMember(const Ch* name) const { return value_.RemoveMember(name); } -#if RAPIDJSON_HAS_STDSTRING - bool RemoveMember(const std::basic_string& name) const { return value_.RemoveMember(name); } -#endif - template bool RemoveMember(const GenericValue& name) const { return value_.RemoveMember(name); } - MemberIterator RemoveMember(MemberIterator m) const { return value_.RemoveMember(m); } - MemberIterator EraseMember(ConstMemberIterator pos) const { return value_.EraseMember(pos); } - MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) const { return value_.EraseMember(first, last); } - bool EraseMember(const Ch* name) const { return value_.EraseMember(name); } -#if RAPIDJSON_HAS_STDSTRING - bool EraseMember(const std::basic_string& name) const { return EraseMember(ValueType(StringRef(name))); } -#endif - template bool EraseMember(const GenericValue& name) const { return value_.EraseMember(name); } - -#if RAPIDJSON_HAS_CXX11_RANGE_FOR - MemberIterator begin() const { return value_.MemberBegin(); } - MemberIterator end() const { return value_.MemberEnd(); } -#endif - -private: - GenericObject(); - GenericObject(ValueType& value) : value_(value) {} - ValueType& value_; -}; - -RAPIDJSON_NAMESPACE_END -RAPIDJSON_DIAG_POP - -#ifdef RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED -#pragma pop_macro("GetObject") -#undef RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED -#endif - -#endif // RAPIDJSON_DOCUMENT_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/encodedstream.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/encodedstream.h deleted file mode 100644 index 309499d..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/encodedstream.h +++ /dev/null @@ -1,299 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_ENCODEDSTREAM_H_ -#define RAPIDJSON_ENCODEDSTREAM_H_ - -#include "stream.h" -#include "memorystream.h" - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(padded) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! Input byte stream wrapper with a statically bound encoding. -/*! - \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. - \tparam InputByteStream Type of input byte stream. For example, FileReadStream. -*/ -template -class EncodedInputStream { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); -public: - typedef typename Encoding::Ch Ch; - - EncodedInputStream(InputByteStream& is) : is_(is) { - current_ = Encoding::TakeBOM(is_); - } - - Ch Peek() const { return current_; } - Ch Take() { Ch c = current_; current_ = Encoding::Take(is_); return c; } - size_t Tell() const { return is_.Tell(); } - - // Not implemented - void Put(Ch) { RAPIDJSON_ASSERT(false); } - void Flush() { RAPIDJSON_ASSERT(false); } - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - -private: - EncodedInputStream(const EncodedInputStream&); - EncodedInputStream& operator=(const EncodedInputStream&); - - InputByteStream& is_; - Ch current_; -}; - -//! Specialized for UTF8 MemoryStream. -template <> -class EncodedInputStream, MemoryStream> { -public: - typedef UTF8<>::Ch Ch; - - EncodedInputStream(MemoryStream& is) : is_(is) { - if (static_cast(is_.Peek()) == 0xEFu) is_.Take(); - if (static_cast(is_.Peek()) == 0xBBu) is_.Take(); - if (static_cast(is_.Peek()) == 0xBFu) is_.Take(); - } - Ch Peek() const { return is_.Peek(); } - Ch Take() { return is_.Take(); } - size_t Tell() const { return is_.Tell(); } - - // Not implemented - void Put(Ch) {} - void Flush() {} - Ch* PutBegin() { return 0; } - size_t PutEnd(Ch*) { return 0; } - - MemoryStream& is_; - -private: - EncodedInputStream(const EncodedInputStream&); - EncodedInputStream& operator=(const EncodedInputStream&); -}; - -//! Output byte stream wrapper with statically bound encoding. -/*! - \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. - \tparam OutputByteStream Type of input byte stream. For example, FileWriteStream. -*/ -template -class EncodedOutputStream { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); -public: - typedef typename Encoding::Ch Ch; - - EncodedOutputStream(OutputByteStream& os, bool putBOM = true) : os_(os) { - if (putBOM) - Encoding::PutBOM(os_); - } - - void Put(Ch c) { Encoding::Put(os_, c); } - void Flush() { os_.Flush(); } - - // Not implemented - Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;} - Ch Take() { RAPIDJSON_ASSERT(false); return 0;} - size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - -private: - EncodedOutputStream(const EncodedOutputStream&); - EncodedOutputStream& operator=(const EncodedOutputStream&); - - OutputByteStream& os_; -}; - -#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x - -//! Input stream wrapper with dynamically bound encoding and automatic encoding detection. -/*! - \tparam CharType Type of character for reading. - \tparam InputByteStream type of input byte stream to be wrapped. -*/ -template -class AutoUTFInputStream { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); -public: - typedef CharType Ch; - - //! Constructor. - /*! - \param is input stream to be wrapped. - \param type UTF encoding type if it is not detected from the stream. - */ - AutoUTFInputStream(InputByteStream& is, UTFType type = kUTF8) : is_(&is), type_(type), hasBOM_(false) { - RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); - DetectType(); - static const TakeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Take) }; - takeFunc_ = f[type_]; - current_ = takeFunc_(*is_); - } - - UTFType GetType() const { return type_; } - bool HasBOM() const { return hasBOM_; } - - Ch Peek() const { return current_; } - Ch Take() { Ch c = current_; current_ = takeFunc_(*is_); return c; } - size_t Tell() const { return is_->Tell(); } - - // Not implemented - void Put(Ch) { RAPIDJSON_ASSERT(false); } - void Flush() { RAPIDJSON_ASSERT(false); } - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - -private: - AutoUTFInputStream(const AutoUTFInputStream&); - AutoUTFInputStream& operator=(const AutoUTFInputStream&); - - // Detect encoding type with BOM or RFC 4627 - void DetectType() { - // BOM (Byte Order Mark): - // 00 00 FE FF UTF-32BE - // FF FE 00 00 UTF-32LE - // FE FF UTF-16BE - // FF FE UTF-16LE - // EF BB BF UTF-8 - - const unsigned char* c = reinterpret_cast(is_->Peek4()); - if (!c) - return; - - unsigned bom = static_cast(c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24)); - hasBOM_ = false; - if (bom == 0xFFFE0000) { type_ = kUTF32BE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } - else if (bom == 0x0000FEFF) { type_ = kUTF32LE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } - else if ((bom & 0xFFFF) == 0xFFFE) { type_ = kUTF16BE; hasBOM_ = true; is_->Take(); is_->Take(); } - else if ((bom & 0xFFFF) == 0xFEFF) { type_ = kUTF16LE; hasBOM_ = true; is_->Take(); is_->Take(); } - else if ((bom & 0xFFFFFF) == 0xBFBBEF) { type_ = kUTF8; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); } - - // RFC 4627: Section 3 - // "Since the first two characters of a JSON text will always be ASCII - // characters [RFC0020], it is possible to determine whether an octet - // stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking - // at the pattern of nulls in the first four octets." - // 00 00 00 xx UTF-32BE - // 00 xx 00 xx UTF-16BE - // xx 00 00 00 UTF-32LE - // xx 00 xx 00 UTF-16LE - // xx xx xx xx UTF-8 - - if (!hasBOM_) { - int pattern = (c[0] ? 1 : 0) | (c[1] ? 2 : 0) | (c[2] ? 4 : 0) | (c[3] ? 8 : 0); - switch (pattern) { - case 0x08: type_ = kUTF32BE; break; - case 0x0A: type_ = kUTF16BE; break; - case 0x01: type_ = kUTF32LE; break; - case 0x05: type_ = kUTF16LE; break; - case 0x0F: type_ = kUTF8; break; - default: break; // Use type defined by user. - } - } - - // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. - if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2); - if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4); - } - - typedef Ch (*TakeFunc)(InputByteStream& is); - InputByteStream* is_; - UTFType type_; - Ch current_; - TakeFunc takeFunc_; - bool hasBOM_; -}; - -//! Output stream wrapper with dynamically bound encoding and automatic encoding detection. -/*! - \tparam CharType Type of character for writing. - \tparam OutputByteStream type of output byte stream to be wrapped. -*/ -template -class AutoUTFOutputStream { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); -public: - typedef CharType Ch; - - //! Constructor. - /*! - \param os output stream to be wrapped. - \param type UTF encoding type. - \param putBOM Whether to write BOM at the beginning of the stream. - */ - AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) { - RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); - - // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. - if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2); - if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4); - - static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) }; - putFunc_ = f[type_]; - - if (putBOM) - PutBOM(); - } - - UTFType GetType() const { return type_; } - - void Put(Ch c) { putFunc_(*os_, c); } - void Flush() { os_->Flush(); } - - // Not implemented - Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;} - Ch Take() { RAPIDJSON_ASSERT(false); return 0;} - size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - -private: - AutoUTFOutputStream(const AutoUTFOutputStream&); - AutoUTFOutputStream& operator=(const AutoUTFOutputStream&); - - void PutBOM() { - typedef void (*PutBOMFunc)(OutputByteStream&); - static const PutBOMFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(PutBOM) }; - f[type_](*os_); - } - - typedef void (*PutFunc)(OutputByteStream&, Ch); - - OutputByteStream* os_; - UTFType type_; - PutFunc putFunc_; -}; - -#undef RAPIDJSON_ENCODINGS_FUNC - -RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -RAPIDJSON_DIAG_POP -#endif - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/encodings.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/encodings.h deleted file mode 100644 index 5ee169e..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/encodings.h +++ /dev/null @@ -1,716 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_ENCODINGS_H_ -#define RAPIDJSON_ENCODINGS_H_ - -#include "rapidjson.h" - -#if defined(_MSC_VER) && !defined(__clang__) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4244) // conversion from 'type1' to 'type2', possible loss of data -RAPIDJSON_DIAG_OFF(4702) // unreachable code -#elif defined(__GNUC__) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -RAPIDJSON_DIAG_OFF(overflow) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// Encoding - -/*! \class rapidjson::Encoding - \brief Concept for encoding of Unicode characters. - -\code -concept Encoding { - typename Ch; //! Type of character. A "character" is actually a code unit in unicode's definition. - - enum { supportUnicode = 1 }; // or 0 if not supporting unicode - - //! \brief Encode a Unicode codepoint to an output stream. - //! \param os Output stream. - //! \param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively. - template - static void Encode(OutputStream& os, unsigned codepoint); - - //! \brief Decode a Unicode codepoint from an input stream. - //! \param is Input stream. - //! \param codepoint Output of the unicode codepoint. - //! \return true if a valid codepoint can be decoded from the stream. - template - static bool Decode(InputStream& is, unsigned* codepoint); - - //! \brief Validate one Unicode codepoint from an encoded stream. - //! \param is Input stream to obtain codepoint. - //! \param os Output for copying one codepoint. - //! \return true if it is valid. - //! \note This function just validating and copying the codepoint without actually decode it. - template - static bool Validate(InputStream& is, OutputStream& os); - - // The following functions are deal with byte streams. - - //! Take a character from input byte stream, skip BOM if exist. - template - static CharType TakeBOM(InputByteStream& is); - - //! Take a character from input byte stream. - template - static Ch Take(InputByteStream& is); - - //! Put BOM to output byte stream. - template - static void PutBOM(OutputByteStream& os); - - //! Put a character to output byte stream. - template - static void Put(OutputByteStream& os, Ch c); -}; -\endcode -*/ - -/////////////////////////////////////////////////////////////////////////////// -// UTF8 - -//! UTF-8 encoding. -/*! http://en.wikipedia.org/wiki/UTF-8 - http://tools.ietf.org/html/rfc3629 - \tparam CharType Code unit for storing 8-bit UTF-8 data. Default is char. - \note implements Encoding concept -*/ -template -struct UTF8 { - typedef CharType Ch; - - enum { supportUnicode = 1 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - if (codepoint <= 0x7F) - os.Put(static_cast(codepoint & 0xFF)); - else if (codepoint <= 0x7FF) { - os.Put(static_cast(0xC0 | ((codepoint >> 6) & 0xFF))); - os.Put(static_cast(0x80 | ((codepoint & 0x3F)))); - } - else if (codepoint <= 0xFFFF) { - os.Put(static_cast(0xE0 | ((codepoint >> 12) & 0xFF))); - os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); - os.Put(static_cast(0x80 | (codepoint & 0x3F))); - } - else { - RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - os.Put(static_cast(0xF0 | ((codepoint >> 18) & 0xFF))); - os.Put(static_cast(0x80 | ((codepoint >> 12) & 0x3F))); - os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); - os.Put(static_cast(0x80 | (codepoint & 0x3F))); - } - } - - template - static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { - if (codepoint <= 0x7F) - PutUnsafe(os, static_cast(codepoint & 0xFF)); - else if (codepoint <= 0x7FF) { - PutUnsafe(os, static_cast(0xC0 | ((codepoint >> 6) & 0xFF))); - PutUnsafe(os, static_cast(0x80 | ((codepoint & 0x3F)))); - } - else if (codepoint <= 0xFFFF) { - PutUnsafe(os, static_cast(0xE0 | ((codepoint >> 12) & 0xFF))); - PutUnsafe(os, static_cast(0x80 | ((codepoint >> 6) & 0x3F))); - PutUnsafe(os, static_cast(0x80 | (codepoint & 0x3F))); - } - else { - RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - PutUnsafe(os, static_cast(0xF0 | ((codepoint >> 18) & 0xFF))); - PutUnsafe(os, static_cast(0x80 | ((codepoint >> 12) & 0x3F))); - PutUnsafe(os, static_cast(0x80 | ((codepoint >> 6) & 0x3F))); - PutUnsafe(os, static_cast(0x80 | (codepoint & 0x3F))); - } - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { -#define RAPIDJSON_COPY() c = is.Take(); *codepoint = (*codepoint << 6) | (static_cast(c) & 0x3Fu) -#define RAPIDJSON_TRANS(mask) result &= ((GetRange(static_cast(c)) & mask) != 0) -#define RAPIDJSON_TAIL() RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x70) - typename InputStream::Ch c = is.Take(); - if (!(c & 0x80)) { - *codepoint = static_cast(c); - return true; - } - - unsigned char type = GetRange(static_cast(c)); - if (type >= 32) { - *codepoint = 0; - } else { - *codepoint = (0xFFu >> type) & static_cast(c); - } - bool result = true; - switch (type) { - case 2: RAPIDJSON_TAIL(); return result; - case 3: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; - case 4: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x50); RAPIDJSON_TAIL(); return result; - case 5: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x10); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; - case 6: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; - case 10: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x20); RAPIDJSON_TAIL(); return result; - case 11: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x60); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; - default: return false; - } -#undef RAPIDJSON_COPY -#undef RAPIDJSON_TRANS -#undef RAPIDJSON_TAIL - } - - template - static bool Validate(InputStream& is, OutputStream& os) { -#define RAPIDJSON_COPY() os.Put(c = is.Take()) -#define RAPIDJSON_TRANS(mask) result &= ((GetRange(static_cast(c)) & mask) != 0) -#define RAPIDJSON_TAIL() RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x70) - Ch c; - RAPIDJSON_COPY(); - if (!(c & 0x80)) - return true; - - bool result = true; - switch (GetRange(static_cast(c))) { - case 2: RAPIDJSON_TAIL(); return result; - case 3: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; - case 4: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x50); RAPIDJSON_TAIL(); return result; - case 5: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x10); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; - case 6: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; - case 10: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x20); RAPIDJSON_TAIL(); return result; - case 11: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x60); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; - default: return false; - } -#undef RAPIDJSON_COPY -#undef RAPIDJSON_TRANS -#undef RAPIDJSON_TAIL - } - - static unsigned char GetRange(unsigned char c) { - // Referring to DFA of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ - // With new mapping 1 -> 0x10, 7 -> 0x20, 9 -> 0x40, such that AND operation can test multiple types. - static const unsigned char type[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8, - }; - return type[c]; - } - - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - typename InputByteStream::Ch c = Take(is); - if (static_cast(c) != 0xEFu) return c; - c = is.Take(); - if (static_cast(c) != 0xBBu) return c; - c = is.Take(); - if (static_cast(c) != 0xBFu) return c; - c = is.Take(); - return c; - } - - template - static Ch Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - return static_cast(is.Take()); - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(0xEFu)); - os.Put(static_cast(0xBBu)); - os.Put(static_cast(0xBFu)); - } - - template - static void Put(OutputByteStream& os, Ch c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(c)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// UTF16 - -//! UTF-16 encoding. -/*! http://en.wikipedia.org/wiki/UTF-16 - http://tools.ietf.org/html/rfc2781 - \tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead. - \note implements Encoding concept - - \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. - For streaming, use UTF16LE and UTF16BE, which handle endianness. -*/ -template -struct UTF16 { - typedef CharType Ch; - RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 2); - - enum { supportUnicode = 1 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); - if (codepoint <= 0xFFFF) { - RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair - os.Put(static_cast(codepoint)); - } - else { - RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - unsigned v = codepoint - 0x10000; - os.Put(static_cast((v >> 10) | 0xD800)); - os.Put(static_cast((v & 0x3FF) | 0xDC00)); - } - } - - - template - static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); - if (codepoint <= 0xFFFF) { - RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair - PutUnsafe(os, static_cast(codepoint)); - } - else { - RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - unsigned v = codepoint - 0x10000; - PutUnsafe(os, static_cast((v >> 10) | 0xD800)); - PutUnsafe(os, static_cast((v & 0x3FF) | 0xDC00)); - } - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); - typename InputStream::Ch c = is.Take(); - if (c < 0xD800 || c > 0xDFFF) { - *codepoint = static_cast(c); - return true; - } - else if (c <= 0xDBFF) { - *codepoint = (static_cast(c) & 0x3FF) << 10; - c = is.Take(); - *codepoint |= (static_cast(c) & 0x3FF); - *codepoint += 0x10000; - return c >= 0xDC00 && c <= 0xDFFF; - } - return false; - } - - template - static bool Validate(InputStream& is, OutputStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); - typename InputStream::Ch c; - os.Put(static_cast(c = is.Take())); - if (c < 0xD800 || c > 0xDFFF) - return true; - else if (c <= 0xDBFF) { - os.Put(c = is.Take()); - return c >= 0xDC00 && c <= 0xDFFF; - } - return false; - } -}; - -//! UTF-16 little endian encoding. -template -struct UTF16LE : UTF16 { - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return static_cast(c) == 0xFEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - unsigned c = static_cast(is.Take()); - c |= static_cast(static_cast(is.Take())) << 8; - return static_cast(c); - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(0xFFu)); - os.Put(static_cast(0xFEu)); - } - - template - static void Put(OutputByteStream& os, CharType c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(static_cast(c) & 0xFFu)); - os.Put(static_cast((static_cast(c) >> 8) & 0xFFu)); - } -}; - -//! UTF-16 big endian encoding. -template -struct UTF16BE : UTF16 { - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return static_cast(c) == 0xFEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - unsigned c = static_cast(static_cast(is.Take())) << 8; - c |= static_cast(static_cast(is.Take())); - return static_cast(c); - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(0xFEu)); - os.Put(static_cast(0xFFu)); - } - - template - static void Put(OutputByteStream& os, CharType c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast((static_cast(c) >> 8) & 0xFFu)); - os.Put(static_cast(static_cast(c) & 0xFFu)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// UTF32 - -//! UTF-32 encoding. -/*! http://en.wikipedia.org/wiki/UTF-32 - \tparam CharType Type for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_t instead. - \note implements Encoding concept - - \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. - For streaming, use UTF32LE and UTF32BE, which handle endianness. -*/ -template -struct UTF32 { - typedef CharType Ch; - RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 4); - - enum { supportUnicode = 1 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4); - RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - os.Put(codepoint); - } - - template - static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4); - RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); - PutUnsafe(os, codepoint); - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); - Ch c = is.Take(); - *codepoint = c; - return c <= 0x10FFFF; - } - - template - static bool Validate(InputStream& is, OutputStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); - Ch c; - os.Put(c = is.Take()); - return c <= 0x10FFFF; - } -}; - -//! UTF-32 little endian encoding. -template -struct UTF32LE : UTF32 { - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return static_cast(c) == 0x0000FEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - unsigned c = static_cast(is.Take()); - c |= static_cast(static_cast(is.Take())) << 8; - c |= static_cast(static_cast(is.Take())) << 16; - c |= static_cast(static_cast(is.Take())) << 24; - return static_cast(c); - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(0xFFu)); - os.Put(static_cast(0xFEu)); - os.Put(static_cast(0x00u)); - os.Put(static_cast(0x00u)); - } - - template - static void Put(OutputByteStream& os, CharType c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(c & 0xFFu)); - os.Put(static_cast((c >> 8) & 0xFFu)); - os.Put(static_cast((c >> 16) & 0xFFu)); - os.Put(static_cast((c >> 24) & 0xFFu)); - } -}; - -//! UTF-32 big endian encoding. -template -struct UTF32BE : UTF32 { - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - CharType c = Take(is); - return static_cast(c) == 0x0000FEFFu ? Take(is) : c; - } - - template - static CharType Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - unsigned c = static_cast(static_cast(is.Take())) << 24; - c |= static_cast(static_cast(is.Take())) << 16; - c |= static_cast(static_cast(is.Take())) << 8; - c |= static_cast(static_cast(is.Take())); - return static_cast(c); - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(0x00u)); - os.Put(static_cast(0x00u)); - os.Put(static_cast(0xFEu)); - os.Put(static_cast(0xFFu)); - } - - template - static void Put(OutputByteStream& os, CharType c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast((c >> 24) & 0xFFu)); - os.Put(static_cast((c >> 16) & 0xFFu)); - os.Put(static_cast((c >> 8) & 0xFFu)); - os.Put(static_cast(c & 0xFFu)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// ASCII - -//! ASCII encoding. -/*! http://en.wikipedia.org/wiki/ASCII - \tparam CharType Code unit for storing 7-bit ASCII data. Default is char. - \note implements Encoding concept -*/ -template -struct ASCII { - typedef CharType Ch; - - enum { supportUnicode = 0 }; - - template - static void Encode(OutputStream& os, unsigned codepoint) { - RAPIDJSON_ASSERT(codepoint <= 0x7F); - os.Put(static_cast(codepoint & 0xFF)); - } - - template - static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { - RAPIDJSON_ASSERT(codepoint <= 0x7F); - PutUnsafe(os, static_cast(codepoint & 0xFF)); - } - - template - static bool Decode(InputStream& is, unsigned* codepoint) { - uint8_t c = static_cast(is.Take()); - *codepoint = c; - return c <= 0X7F; - } - - template - static bool Validate(InputStream& is, OutputStream& os) { - uint8_t c = static_cast(is.Take()); - os.Put(static_cast(c)); - return c <= 0x7F; - } - - template - static CharType TakeBOM(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - uint8_t c = static_cast(Take(is)); - return static_cast(c); - } - - template - static Ch Take(InputByteStream& is) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); - return static_cast(is.Take()); - } - - template - static void PutBOM(OutputByteStream& os) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - (void)os; - } - - template - static void Put(OutputByteStream& os, Ch c) { - RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); - os.Put(static_cast(c)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// AutoUTF - -//! Runtime-specified UTF encoding type of a stream. -enum UTFType { - kUTF8 = 0, //!< UTF-8. - kUTF16LE = 1, //!< UTF-16 little endian. - kUTF16BE = 2, //!< UTF-16 big endian. - kUTF32LE = 3, //!< UTF-32 little endian. - kUTF32BE = 4 //!< UTF-32 big endian. -}; - -//! Dynamically select encoding according to stream's runtime-specified UTF encoding type. -/*! \note This class can be used with AutoUTFInputStream and AutoUTFOutputStream, which provides GetType(). -*/ -template -struct AutoUTF { - typedef CharType Ch; - - enum { supportUnicode = 1 }; - -#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x - - template - static RAPIDJSON_FORCEINLINE void Encode(OutputStream& os, unsigned codepoint) { - typedef void (*EncodeFunc)(OutputStream&, unsigned); - static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Encode) }; - (*f[os.GetType()])(os, codepoint); - } - - template - static RAPIDJSON_FORCEINLINE void EncodeUnsafe(OutputStream& os, unsigned codepoint) { - typedef void (*EncodeFunc)(OutputStream&, unsigned); - static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(EncodeUnsafe) }; - (*f[os.GetType()])(os, codepoint); - } - - template - static RAPIDJSON_FORCEINLINE bool Decode(InputStream& is, unsigned* codepoint) { - typedef bool (*DecodeFunc)(InputStream&, unsigned*); - static const DecodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Decode) }; - return (*f[is.GetType()])(is, codepoint); - } - - template - static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { - typedef bool (*ValidateFunc)(InputStream&, OutputStream&); - static const ValidateFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Validate) }; - return (*f[is.GetType()])(is, os); - } - -#undef RAPIDJSON_ENCODINGS_FUNC -}; - -/////////////////////////////////////////////////////////////////////////////// -// Transcoder - -//! Encoding conversion. -template -struct Transcoder { - //! Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream. - template - static RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) { - unsigned codepoint; - if (!SourceEncoding::Decode(is, &codepoint)) - return false; - TargetEncoding::Encode(os, codepoint); - return true; - } - - template - static RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) { - unsigned codepoint; - if (!SourceEncoding::Decode(is, &codepoint)) - return false; - TargetEncoding::EncodeUnsafe(os, codepoint); - return true; - } - - //! Validate one Unicode codepoint from an encoded stream. - template - static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { - return Transcode(is, os); // Since source/target encoding is different, must transcode. - } -}; - -// Forward declaration. -template -inline void PutUnsafe(Stream& stream, typename Stream::Ch c); - -//! Specialization of Transcoder with same source and target encoding. -template -struct Transcoder { - template - static RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) { - os.Put(is.Take()); // Just copy one code unit. This semantic is different from primary template class. - return true; - } - - template - static RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) { - PutUnsafe(os, is.Take()); // Just copy one code unit. This semantic is different from primary template class. - return true; - } - - template - static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { - return Encoding::Validate(is, os); // source/target encoding are the same - } -}; - -RAPIDJSON_NAMESPACE_END - -#if defined(__GNUC__) || (defined(_MSC_VER) && !defined(__clang__)) -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_ENCODINGS_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/error/en.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/error/en.h deleted file mode 100644 index c87b04e..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/error/en.h +++ /dev/null @@ -1,176 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_ERROR_EN_H_ -#define RAPIDJSON_ERROR_EN_H_ - -#include "error.h" - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(switch-enum) -RAPIDJSON_DIAG_OFF(covered-switch-default) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! Maps error code of parsing into error message. -/*! - \ingroup RAPIDJSON_ERRORS - \param parseErrorCode Error code obtained in parsing. - \return the error message. - \note User can make a copy of this function for localization. - Using switch-case is safer for future modification of error codes. -*/ -inline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErrorCode) { - switch (parseErrorCode) { - case kParseErrorNone: return RAPIDJSON_ERROR_STRING("No error."); - - case kParseErrorDocumentEmpty: return RAPIDJSON_ERROR_STRING("The document is empty."); - case kParseErrorDocumentRootNotSingular: return RAPIDJSON_ERROR_STRING("The document root must not be followed by other values."); - - case kParseErrorValueInvalid: return RAPIDJSON_ERROR_STRING("Invalid value."); - - case kParseErrorObjectMissName: return RAPIDJSON_ERROR_STRING("Missing a name for object member."); - case kParseErrorObjectMissColon: return RAPIDJSON_ERROR_STRING("Missing a colon after a name of object member."); - case kParseErrorObjectMissCommaOrCurlyBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or '}' after an object member."); - - case kParseErrorArrayMissCommaOrSquareBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or ']' after an array element."); - - case kParseErrorStringUnicodeEscapeInvalidHex: return RAPIDJSON_ERROR_STRING("Incorrect hex digit after \\u escape in string."); - case kParseErrorStringUnicodeSurrogateInvalid: return RAPIDJSON_ERROR_STRING("The surrogate pair in string is invalid."); - case kParseErrorStringEscapeInvalid: return RAPIDJSON_ERROR_STRING("Invalid escape character in string."); - case kParseErrorStringMissQuotationMark: return RAPIDJSON_ERROR_STRING("Missing a closing quotation mark in string."); - case kParseErrorStringInvalidEncoding: return RAPIDJSON_ERROR_STRING("Invalid encoding in string."); - - case kParseErrorNumberTooBig: return RAPIDJSON_ERROR_STRING("Number too big to be stored in double."); - case kParseErrorNumberMissFraction: return RAPIDJSON_ERROR_STRING("Miss fraction part in number."); - case kParseErrorNumberMissExponent: return RAPIDJSON_ERROR_STRING("Miss exponent in number."); - - case kParseErrorTermination: return RAPIDJSON_ERROR_STRING("Terminate parsing due to Handler error."); - case kParseErrorUnspecificSyntaxError: return RAPIDJSON_ERROR_STRING("Unspecific syntax error."); - - default: return RAPIDJSON_ERROR_STRING("Unknown error."); - } -} - -//! Maps error code of validation into error message. -/*! - \ingroup RAPIDJSON_ERRORS - \param validateErrorCode Error code obtained from validator. - \return the error message. - \note User can make a copy of this function for localization. - Using switch-case is safer for future modification of error codes. -*/ -inline const RAPIDJSON_ERROR_CHARTYPE* GetValidateError_En(ValidateErrorCode validateErrorCode) { - switch (validateErrorCode) { - case kValidateErrors: return RAPIDJSON_ERROR_STRING("One or more validation errors have occurred"); - case kValidateErrorNone: return RAPIDJSON_ERROR_STRING("No error."); - - case kValidateErrorMultipleOf: return RAPIDJSON_ERROR_STRING("Number '%actual' is not a multiple of the 'multipleOf' value '%expected'."); - case kValidateErrorMaximum: return RAPIDJSON_ERROR_STRING("Number '%actual' is greater than the 'maximum' value '%expected'."); - case kValidateErrorExclusiveMaximum: return RAPIDJSON_ERROR_STRING("Number '%actual' is greater than or equal to the 'exclusiveMaximum' value '%expected'."); - case kValidateErrorMinimum: return RAPIDJSON_ERROR_STRING("Number '%actual' is less than the 'minimum' value '%expected'."); - case kValidateErrorExclusiveMinimum: return RAPIDJSON_ERROR_STRING("Number '%actual' is less than or equal to the 'exclusiveMinimum' value '%expected'."); - - case kValidateErrorMaxLength: return RAPIDJSON_ERROR_STRING("String '%actual' is longer than the 'maxLength' value '%expected'."); - case kValidateErrorMinLength: return RAPIDJSON_ERROR_STRING("String '%actual' is shorter than the 'minLength' value '%expected'."); - case kValidateErrorPattern: return RAPIDJSON_ERROR_STRING("String '%actual' does not match the 'pattern' regular expression."); - - case kValidateErrorMaxItems: return RAPIDJSON_ERROR_STRING("Array of length '%actual' is longer than the 'maxItems' value '%expected'."); - case kValidateErrorMinItems: return RAPIDJSON_ERROR_STRING("Array of length '%actual' is shorter than the 'minItems' value '%expected'."); - case kValidateErrorUniqueItems: return RAPIDJSON_ERROR_STRING("Array has duplicate items at indices '%duplicates' but 'uniqueItems' is true."); - case kValidateErrorAdditionalItems: return RAPIDJSON_ERROR_STRING("Array has an additional item at index '%disallowed' that is not allowed by the schema."); - - case kValidateErrorMaxProperties: return RAPIDJSON_ERROR_STRING("Object has '%actual' members which is more than 'maxProperties' value '%expected'."); - case kValidateErrorMinProperties: return RAPIDJSON_ERROR_STRING("Object has '%actual' members which is less than 'minProperties' value '%expected'."); - case kValidateErrorRequired: return RAPIDJSON_ERROR_STRING("Object is missing the following members required by the schema: '%missing'."); - case kValidateErrorAdditionalProperties: return RAPIDJSON_ERROR_STRING("Object has an additional member '%disallowed' that is not allowed by the schema."); - case kValidateErrorPatternProperties: return RAPIDJSON_ERROR_STRING("Object has 'patternProperties' that are not allowed by the schema."); - case kValidateErrorDependencies: return RAPIDJSON_ERROR_STRING("Object has missing property or schema dependencies, refer to following errors."); - - case kValidateErrorEnum: return RAPIDJSON_ERROR_STRING("Property has a value that is not one of its allowed enumerated values."); - case kValidateErrorType: return RAPIDJSON_ERROR_STRING("Property has a type '%actual' that is not in the following list: '%expected'."); - - case kValidateErrorOneOf: return RAPIDJSON_ERROR_STRING("Property did not match any of the sub-schemas specified by 'oneOf', refer to following errors."); - case kValidateErrorOneOfMatch: return RAPIDJSON_ERROR_STRING("Property matched more than one of the sub-schemas specified by 'oneOf', indices '%matches'."); - case kValidateErrorAllOf: return RAPIDJSON_ERROR_STRING("Property did not match all of the sub-schemas specified by 'allOf', refer to following errors."); - case kValidateErrorAnyOf: return RAPIDJSON_ERROR_STRING("Property did not match any of the sub-schemas specified by 'anyOf', refer to following errors."); - case kValidateErrorNot: return RAPIDJSON_ERROR_STRING("Property matched the sub-schema specified by 'not'."); - - case kValidateErrorReadOnly: return RAPIDJSON_ERROR_STRING("Property is read-only but has been provided when validation is for writing."); - case kValidateErrorWriteOnly: return RAPIDJSON_ERROR_STRING("Property is write-only but has been provided when validation is for reading."); - - default: return RAPIDJSON_ERROR_STRING("Unknown error."); - } -} - -//! Maps error code of schema document compilation into error message. -/*! - \ingroup RAPIDJSON_ERRORS - \param schemaErrorCode Error code obtained from compiling the schema document. - \return the error message. - \note User can make a copy of this function for localization. - Using switch-case is safer for future modification of error codes. -*/ - inline const RAPIDJSON_ERROR_CHARTYPE* GetSchemaError_En(SchemaErrorCode schemaErrorCode) { - switch (schemaErrorCode) { - case kSchemaErrorNone: return RAPIDJSON_ERROR_STRING("No error."); - - case kSchemaErrorStartUnknown: return RAPIDJSON_ERROR_STRING("Pointer '%value' to start of schema does not resolve to a location in the document."); - case kSchemaErrorRefPlainName: return RAPIDJSON_ERROR_STRING("$ref fragment '%value' must be a JSON pointer."); - case kSchemaErrorRefInvalid: return RAPIDJSON_ERROR_STRING("$ref must not be an empty string."); - case kSchemaErrorRefPointerInvalid: return RAPIDJSON_ERROR_STRING("$ref fragment '%value' is not a valid JSON pointer at offset '%offset'."); - case kSchemaErrorRefUnknown: return RAPIDJSON_ERROR_STRING("$ref '%value' does not resolve to a location in the target document."); - case kSchemaErrorRefCyclical: return RAPIDJSON_ERROR_STRING("$ref '%value' is cyclical."); - case kSchemaErrorRefNoRemoteProvider: return RAPIDJSON_ERROR_STRING("$ref is remote but there is no remote provider."); - case kSchemaErrorRefNoRemoteSchema: return RAPIDJSON_ERROR_STRING("$ref '%value' is remote but the remote provider did not return a schema."); - case kSchemaErrorRegexInvalid: return RAPIDJSON_ERROR_STRING("Invalid regular expression '%value' in 'pattern' or 'patternProperties'."); - case kSchemaErrorSpecUnknown: return RAPIDJSON_ERROR_STRING("JSON schema draft or OpenAPI version is not recognized."); - case kSchemaErrorSpecUnsupported: return RAPIDJSON_ERROR_STRING("JSON schema draft or OpenAPI version is not supported."); - case kSchemaErrorSpecIllegal: return RAPIDJSON_ERROR_STRING("Both JSON schema draft and OpenAPI version found in document."); - case kSchemaErrorReadOnlyAndWriteOnly: return RAPIDJSON_ERROR_STRING("Property must not be both 'readOnly' and 'writeOnly'."); - - default: return RAPIDJSON_ERROR_STRING("Unknown error."); - } - } - -//! Maps error code of pointer parse into error message. -/*! - \ingroup RAPIDJSON_ERRORS - \param pointerParseErrorCode Error code obtained from pointer parse. - \return the error message. - \note User can make a copy of this function for localization. - Using switch-case is safer for future modification of error codes. -*/ -inline const RAPIDJSON_ERROR_CHARTYPE* GetPointerParseError_En(PointerParseErrorCode pointerParseErrorCode) { - switch (pointerParseErrorCode) { - case kPointerParseErrorNone: return RAPIDJSON_ERROR_STRING("No error."); - - case kPointerParseErrorTokenMustBeginWithSolidus: return RAPIDJSON_ERROR_STRING("A token must begin with a '/'."); - case kPointerParseErrorInvalidEscape: return RAPIDJSON_ERROR_STRING("Invalid escape."); - case kPointerParseErrorInvalidPercentEncoding: return RAPIDJSON_ERROR_STRING("Invalid percent encoding in URI fragment."); - case kPointerParseErrorCharacterMustPercentEncode: return RAPIDJSON_ERROR_STRING("A character must be percent encoded in a URI fragment."); - - default: return RAPIDJSON_ERROR_STRING("Unknown error."); - } -} - -RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_ERROR_EN_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/error/error.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/error/error.h deleted file mode 100644 index cae345d..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/error/error.h +++ /dev/null @@ -1,285 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_ERROR_ERROR_H_ -#define RAPIDJSON_ERROR_ERROR_H_ - -#include "../rapidjson.h" - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(padded) -#endif - -/*! \file error.h */ - -/*! \defgroup RAPIDJSON_ERRORS RapidJSON error handling */ - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_ERROR_CHARTYPE - -//! Character type of error messages. -/*! \ingroup RAPIDJSON_ERRORS - The default character type is \c char. - On Windows, user can define this macro as \c TCHAR for supporting both - unicode/non-unicode settings. -*/ -#ifndef RAPIDJSON_ERROR_CHARTYPE -#define RAPIDJSON_ERROR_CHARTYPE char -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_ERROR_STRING - -//! Macro for converting string literal to \ref RAPIDJSON_ERROR_CHARTYPE[]. -/*! \ingroup RAPIDJSON_ERRORS - By default this conversion macro does nothing. - On Windows, user can define this macro as \c _T(x) for supporting both - unicode/non-unicode settings. -*/ -#ifndef RAPIDJSON_ERROR_STRING -#define RAPIDJSON_ERROR_STRING(x) x -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// ParseErrorCode - -//! Error code of parsing. -/*! \ingroup RAPIDJSON_ERRORS - \see GenericReader::Parse, GenericReader::GetParseErrorCode -*/ -enum ParseErrorCode { - kParseErrorNone = 0, //!< No error. - - kParseErrorDocumentEmpty, //!< The document is empty. - kParseErrorDocumentRootNotSingular, //!< The document root must not follow by other values. - - kParseErrorValueInvalid, //!< Invalid value. - - kParseErrorObjectMissName, //!< Missing a name for object member. - kParseErrorObjectMissColon, //!< Missing a colon after a name of object member. - kParseErrorObjectMissCommaOrCurlyBracket, //!< Missing a comma or '}' after an object member. - - kParseErrorArrayMissCommaOrSquareBracket, //!< Missing a comma or ']' after an array element. - - kParseErrorStringUnicodeEscapeInvalidHex, //!< Incorrect hex digit after \\u escape in string. - kParseErrorStringUnicodeSurrogateInvalid, //!< The surrogate pair in string is invalid. - kParseErrorStringEscapeInvalid, //!< Invalid escape character in string. - kParseErrorStringMissQuotationMark, //!< Missing a closing quotation mark in string. - kParseErrorStringInvalidEncoding, //!< Invalid encoding in string. - - kParseErrorNumberTooBig, //!< Number too big to be stored in double. - kParseErrorNumberMissFraction, //!< Miss fraction part in number. - kParseErrorNumberMissExponent, //!< Miss exponent in number. - - kParseErrorTermination, //!< Parsing was terminated. - kParseErrorUnspecificSyntaxError //!< Unspecific syntax error. -}; - -//! Result of parsing (wraps ParseErrorCode) -/*! - \ingroup RAPIDJSON_ERRORS - \code - Document doc; - ParseResult ok = doc.Parse("[42]"); - if (!ok) { - fprintf(stderr, "JSON parse error: %s (%u)", - GetParseError_En(ok.Code()), ok.Offset()); - exit(EXIT_FAILURE); - } - \endcode - \see GenericReader::Parse, GenericDocument::Parse -*/ -struct ParseResult { - //!! Unspecified boolean type - typedef bool (ParseResult::*BooleanType)() const; -public: - //! Default constructor, no error. - ParseResult() : code_(kParseErrorNone), offset_(0) {} - //! Constructor to set an error. - ParseResult(ParseErrorCode code, size_t offset) : code_(code), offset_(offset) {} - - //! Get the error code. - ParseErrorCode Code() const { return code_; } - //! Get the error offset, if \ref IsError(), 0 otherwise. - size_t Offset() const { return offset_; } - - //! Explicit conversion to \c bool, returns \c true, iff !\ref IsError(). - operator BooleanType() const { return !IsError() ? &ParseResult::IsError : NULL; } - //! Whether the result is an error. - bool IsError() const { return code_ != kParseErrorNone; } - - bool operator==(const ParseResult& that) const { return code_ == that.code_; } - bool operator==(ParseErrorCode code) const { return code_ == code; } - friend bool operator==(ParseErrorCode code, const ParseResult & err) { return code == err.code_; } - - bool operator!=(const ParseResult& that) const { return !(*this == that); } - bool operator!=(ParseErrorCode code) const { return !(*this == code); } - friend bool operator!=(ParseErrorCode code, const ParseResult & err) { return err != code; } - - //! Reset error code. - void Clear() { Set(kParseErrorNone); } - //! Update error code and offset. - void Set(ParseErrorCode code, size_t offset = 0) { code_ = code; offset_ = offset; } - -private: - ParseErrorCode code_; - size_t offset_; -}; - -//! Function pointer type of GetParseError(). -/*! \ingroup RAPIDJSON_ERRORS - - This is the prototype for \c GetParseError_X(), where \c X is a locale. - User can dynamically change locale in runtime, e.g.: -\code - GetParseErrorFunc GetParseError = GetParseError_En; // or whatever - const RAPIDJSON_ERROR_CHARTYPE* s = GetParseError(document.GetParseErrorCode()); -\endcode -*/ -typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetParseErrorFunc)(ParseErrorCode); - -/////////////////////////////////////////////////////////////////////////////// -// ValidateErrorCode - -//! Error codes when validating. -/*! \ingroup RAPIDJSON_ERRORS - \see GenericSchemaValidator -*/ -enum ValidateErrorCode { - kValidateErrors = -1, //!< Top level error code when kValidateContinueOnErrorsFlag set. - kValidateErrorNone = 0, //!< No error. - - kValidateErrorMultipleOf, //!< Number is not a multiple of the 'multipleOf' value. - kValidateErrorMaximum, //!< Number is greater than the 'maximum' value. - kValidateErrorExclusiveMaximum, //!< Number is greater than or equal to the 'maximum' value. - kValidateErrorMinimum, //!< Number is less than the 'minimum' value. - kValidateErrorExclusiveMinimum, //!< Number is less than or equal to the 'minimum' value. - - kValidateErrorMaxLength, //!< String is longer than the 'maxLength' value. - kValidateErrorMinLength, //!< String is longer than the 'maxLength' value. - kValidateErrorPattern, //!< String does not match the 'pattern' regular expression. - - kValidateErrorMaxItems, //!< Array is longer than the 'maxItems' value. - kValidateErrorMinItems, //!< Array is shorter than the 'minItems' value. - kValidateErrorUniqueItems, //!< Array has duplicate items but 'uniqueItems' is true. - kValidateErrorAdditionalItems, //!< Array has additional items that are not allowed by the schema. - - kValidateErrorMaxProperties, //!< Object has more members than 'maxProperties' value. - kValidateErrorMinProperties, //!< Object has less members than 'minProperties' value. - kValidateErrorRequired, //!< Object is missing one or more members required by the schema. - kValidateErrorAdditionalProperties, //!< Object has additional members that are not allowed by the schema. - kValidateErrorPatternProperties, //!< See other errors. - kValidateErrorDependencies, //!< Object has missing property or schema dependencies. - - kValidateErrorEnum, //!< Property has a value that is not one of its allowed enumerated values. - kValidateErrorType, //!< Property has a type that is not allowed by the schema. - - kValidateErrorOneOf, //!< Property did not match any of the sub-schemas specified by 'oneOf'. - kValidateErrorOneOfMatch, //!< Property matched more than one of the sub-schemas specified by 'oneOf'. - kValidateErrorAllOf, //!< Property did not match all of the sub-schemas specified by 'allOf'. - kValidateErrorAnyOf, //!< Property did not match any of the sub-schemas specified by 'anyOf'. - kValidateErrorNot, //!< Property matched the sub-schema specified by 'not'. - - kValidateErrorReadOnly, //!< Property is read-only but has been provided when validation is for writing - kValidateErrorWriteOnly //!< Property is write-only but has been provided when validation is for reading -}; - -//! Function pointer type of GetValidateError(). -/*! \ingroup RAPIDJSON_ERRORS - - This is the prototype for \c GetValidateError_X(), where \c X is a locale. - User can dynamically change locale in runtime, e.g.: -\code - GetValidateErrorFunc GetValidateError = GetValidateError_En; // or whatever - const RAPIDJSON_ERROR_CHARTYPE* s = GetValidateError(validator.GetInvalidSchemaCode()); -\endcode -*/ -typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetValidateErrorFunc)(ValidateErrorCode); - -/////////////////////////////////////////////////////////////////////////////// -// SchemaErrorCode - -//! Error codes when validating. -/*! \ingroup RAPIDJSON_ERRORS - \see GenericSchemaValidator -*/ -enum SchemaErrorCode { - kSchemaErrorNone = 0, //!< No error. - - kSchemaErrorStartUnknown, //!< Pointer to start of schema does not resolve to a location in the document - kSchemaErrorRefPlainName, //!< $ref fragment must be a JSON pointer - kSchemaErrorRefInvalid, //!< $ref must not be an empty string - kSchemaErrorRefPointerInvalid, //!< $ref fragment is not a valid JSON pointer at offset - kSchemaErrorRefUnknown, //!< $ref does not resolve to a location in the target document - kSchemaErrorRefCyclical, //!< $ref is cyclical - kSchemaErrorRefNoRemoteProvider, //!< $ref is remote but there is no remote provider - kSchemaErrorRefNoRemoteSchema, //!< $ref is remote but the remote provider did not return a schema - kSchemaErrorRegexInvalid, //!< Invalid regular expression in 'pattern' or 'patternProperties' - kSchemaErrorSpecUnknown, //!< JSON schema draft or OpenAPI version is not recognized - kSchemaErrorSpecUnsupported, //!< JSON schema draft or OpenAPI version is not supported - kSchemaErrorSpecIllegal, //!< Both JSON schema draft and OpenAPI version found in document - kSchemaErrorReadOnlyAndWriteOnly //!< Property must not be both 'readOnly' and 'writeOnly' -}; - -//! Function pointer type of GetSchemaError(). -/*! \ingroup RAPIDJSON_ERRORS - - This is the prototype for \c GetSchemaError_X(), where \c X is a locale. - User can dynamically change locale in runtime, e.g.: -\code - GetSchemaErrorFunc GetSchemaError = GetSchemaError_En; // or whatever - const RAPIDJSON_ERROR_CHARTYPE* s = GetSchemaError(validator.GetInvalidSchemaCode()); -\endcode -*/ -typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetSchemaErrorFunc)(SchemaErrorCode); - -/////////////////////////////////////////////////////////////////////////////// -// PointerParseErrorCode - -//! Error code of JSON pointer parsing. -/*! \ingroup RAPIDJSON_ERRORS - \see GenericPointer::GenericPointer, GenericPointer::GetParseErrorCode -*/ -enum PointerParseErrorCode { - kPointerParseErrorNone = 0, //!< The parse is successful - - kPointerParseErrorTokenMustBeginWithSolidus, //!< A token must begin with a '/' - kPointerParseErrorInvalidEscape, //!< Invalid escape - kPointerParseErrorInvalidPercentEncoding, //!< Invalid percent encoding in URI fragment - kPointerParseErrorCharacterMustPercentEncode //!< A character must percent encoded in URI fragment -}; - -//! Function pointer type of GetPointerParseError(). -/*! \ingroup RAPIDJSON_ERRORS - - This is the prototype for \c GetPointerParseError_X(), where \c X is a locale. - User can dynamically change locale in runtime, e.g.: -\code - GetPointerParseErrorFunc GetPointerParseError = GetPointerParseError_En; // or whatever - const RAPIDJSON_ERROR_CHARTYPE* s = GetPointerParseError(pointer.GetParseErrorCode()); -\endcode -*/ -typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetPointerParseErrorFunc)(PointerParseErrorCode); - - -RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_ERROR_ERROR_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/filereadstream.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/filereadstream.h deleted file mode 100644 index 3daff09..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/filereadstream.h +++ /dev/null @@ -1,99 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_FILEREADSTREAM_H_ -#define RAPIDJSON_FILEREADSTREAM_H_ - -#include "stream.h" -#include - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(padded) -RAPIDJSON_DIAG_OFF(unreachable-code) -RAPIDJSON_DIAG_OFF(missing-noreturn) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! File byte stream for input using fread(). -/*! - \note implements Stream concept -*/ -class FileReadStream { -public: - typedef char Ch; //!< Character type (byte). - - //! Constructor. - /*! - \param fp File pointer opened for read. - \param buffer user-supplied buffer. - \param bufferSize size of buffer in bytes. Must >=4 bytes. - */ - FileReadStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { - RAPIDJSON_ASSERT(fp_ != 0); - RAPIDJSON_ASSERT(bufferSize >= 4); - Read(); - } - - Ch Peek() const { return *current_; } - Ch Take() { Ch c = *current_; Read(); return c; } - size_t Tell() const { return count_ + static_cast(current_ - buffer_); } - - // Not implemented - void Put(Ch) { RAPIDJSON_ASSERT(false); } - void Flush() { RAPIDJSON_ASSERT(false); } - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - - // For encoding detection only. - const Ch* Peek4() const { - return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; - } - -private: - void Read() { - if (current_ < bufferLast_) - ++current_; - else if (!eof_) { - count_ += readCount_; - readCount_ = std::fread(buffer_, 1, bufferSize_, fp_); - bufferLast_ = buffer_ + readCount_ - 1; - current_ = buffer_; - - if (readCount_ < bufferSize_) { - buffer_[readCount_] = '\0'; - ++bufferLast_; - eof_ = true; - } - } - } - - std::FILE* fp_; - Ch *buffer_; - size_t bufferSize_; - Ch *bufferLast_; - Ch *current_; - size_t readCount_; - size_t count_; //!< Number of characters read - bool eof_; -}; - -RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/filewritestream.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/filewritestream.h deleted file mode 100644 index 8a78ef7..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/filewritestream.h +++ /dev/null @@ -1,104 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_FILEWRITESTREAM_H_ -#define RAPIDJSON_FILEWRITESTREAM_H_ - -#include "stream.h" -#include - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(unreachable-code) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! Wrapper of C file stream for output using fwrite(). -/*! - \note implements Stream concept -*/ -class FileWriteStream { -public: - typedef char Ch; //!< Character type. Only support char. - - FileWriteStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) { - RAPIDJSON_ASSERT(fp_ != 0); - } - - void Put(char c) { - if (current_ >= bufferEnd_) - Flush(); - - *current_++ = c; - } - - void PutN(char c, size_t n) { - size_t avail = static_cast(bufferEnd_ - current_); - while (n > avail) { - std::memset(current_, c, avail); - current_ += avail; - Flush(); - n -= avail; - avail = static_cast(bufferEnd_ - current_); - } - - if (n > 0) { - std::memset(current_, c, n); - current_ += n; - } - } - - void Flush() { - if (current_ != buffer_) { - size_t result = std::fwrite(buffer_, 1, static_cast(current_ - buffer_), fp_); - if (result < static_cast(current_ - buffer_)) { - // failure deliberately ignored at this time - // added to avoid warn_unused_result build errors - } - current_ = buffer_; - } - } - - // Not implemented - char Peek() const { RAPIDJSON_ASSERT(false); return 0; } - char Take() { RAPIDJSON_ASSERT(false); return 0; } - size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } - char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } - -private: - // Prohibit copy constructor & assignment operator. - FileWriteStream(const FileWriteStream&); - FileWriteStream& operator=(const FileWriteStream&); - - std::FILE* fp_; - char *buffer_; - char *bufferEnd_; - char *current_; -}; - -//! Implement specialized version of PutN() with memset() for better performance. -template<> -inline void PutN(FileWriteStream& stream, char c, size_t n) { - stream.PutN(c, n); -} - -RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/fwd.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/fwd.h deleted file mode 100644 index 07358d8..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/fwd.h +++ /dev/null @@ -1,151 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_FWD_H_ -#define RAPIDJSON_FWD_H_ - -#include "rapidjson.h" - -RAPIDJSON_NAMESPACE_BEGIN - -// encodings.h - -template struct UTF8; -template struct UTF16; -template struct UTF16BE; -template struct UTF16LE; -template struct UTF32; -template struct UTF32BE; -template struct UTF32LE; -template struct ASCII; -template struct AutoUTF; - -template -struct Transcoder; - -// allocators.h - -class CrtAllocator; - -template -class MemoryPoolAllocator; - -// stream.h - -template -struct GenericStringStream; - -typedef GenericStringStream > StringStream; - -template -struct GenericInsituStringStream; - -typedef GenericInsituStringStream > InsituStringStream; - -// stringbuffer.h - -template -class GenericStringBuffer; - -typedef GenericStringBuffer, CrtAllocator> StringBuffer; - -// filereadstream.h - -class FileReadStream; - -// filewritestream.h - -class FileWriteStream; - -// memorybuffer.h - -template -struct GenericMemoryBuffer; - -typedef GenericMemoryBuffer MemoryBuffer; - -// memorystream.h - -struct MemoryStream; - -// reader.h - -template -struct BaseReaderHandler; - -template -class GenericReader; - -typedef GenericReader, UTF8, CrtAllocator> Reader; - -// writer.h - -template -class Writer; - -// prettywriter.h - -template -class PrettyWriter; - -// document.h - -template -class GenericMember; - -template -class GenericMemberIterator; - -template -struct GenericStringRef; - -template -class GenericValue; - -typedef GenericValue, MemoryPoolAllocator > Value; - -template -class GenericDocument; - -typedef GenericDocument, MemoryPoolAllocator, CrtAllocator> Document; - -// pointer.h - -template -class GenericPointer; - -typedef GenericPointer Pointer; - -// schema.h - -template -class IGenericRemoteSchemaDocumentProvider; - -template -class GenericSchemaDocument; - -typedef GenericSchemaDocument SchemaDocument; -typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; - -template < - typename SchemaDocumentType, - typename OutputHandler, - typename StateAllocator> -class GenericSchemaValidator; - -typedef GenericSchemaValidator, void>, CrtAllocator> SchemaValidator; - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_RAPIDJSONFWD_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/biginteger.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/biginteger.h deleted file mode 100644 index 09d0387..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/biginteger.h +++ /dev/null @@ -1,297 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_BIGINTEGER_H_ -#define RAPIDJSON_BIGINTEGER_H_ - -#include "../rapidjson.h" - -#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && defined(_M_AMD64) -#include // for _umul128 -#if !defined(_ARM64EC_) -#pragma intrinsic(_umul128) -#else -#pragma comment(lib,"softintrin") -#endif -#endif - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -class BigInteger { -public: - typedef uint64_t Type; - - BigInteger(const BigInteger& rhs) : count_(rhs.count_) { - std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); - } - - explicit BigInteger(uint64_t u) : count_(1) { - digits_[0] = u; - } - - template - BigInteger(const Ch* decimals, size_t length) : count_(1) { - RAPIDJSON_ASSERT(length > 0); - digits_[0] = 0; - size_t i = 0; - const size_t kMaxDigitPerIteration = 19; // 2^64 = 18446744073709551616 > 10^19 - while (length >= kMaxDigitPerIteration) { - AppendDecimal64(decimals + i, decimals + i + kMaxDigitPerIteration); - length -= kMaxDigitPerIteration; - i += kMaxDigitPerIteration; - } - - if (length > 0) - AppendDecimal64(decimals + i, decimals + i + length); - } - - BigInteger& operator=(const BigInteger &rhs) - { - if (this != &rhs) { - count_ = rhs.count_; - std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); - } - return *this; - } - - BigInteger& operator=(uint64_t u) { - digits_[0] = u; - count_ = 1; - return *this; - } - - BigInteger& operator+=(uint64_t u) { - Type backup = digits_[0]; - digits_[0] += u; - for (size_t i = 0; i < count_ - 1; i++) { - if (digits_[i] >= backup) - return *this; // no carry - backup = digits_[i + 1]; - digits_[i + 1] += 1; - } - - // Last carry - if (digits_[count_ - 1] < backup) - PushBack(1); - - return *this; - } - - BigInteger& operator*=(uint64_t u) { - if (u == 0) return *this = 0; - if (u == 1) return *this; - if (*this == 1) return *this = u; - - uint64_t k = 0; - for (size_t i = 0; i < count_; i++) { - uint64_t hi; - digits_[i] = MulAdd64(digits_[i], u, k, &hi); - k = hi; - } - - if (k > 0) - PushBack(k); - - return *this; - } - - BigInteger& operator*=(uint32_t u) { - if (u == 0) return *this = 0; - if (u == 1) return *this; - if (*this == 1) return *this = u; - - uint64_t k = 0; - for (size_t i = 0; i < count_; i++) { - const uint64_t c = digits_[i] >> 32; - const uint64_t d = digits_[i] & 0xFFFFFFFF; - const uint64_t uc = u * c; - const uint64_t ud = u * d; - const uint64_t p0 = ud + k; - const uint64_t p1 = uc + (p0 >> 32); - digits_[i] = (p0 & 0xFFFFFFFF) | (p1 << 32); - k = p1 >> 32; - } - - if (k > 0) - PushBack(k); - - return *this; - } - - BigInteger& operator<<=(size_t shift) { - if (IsZero() || shift == 0) return *this; - - size_t offset = shift / kTypeBit; - size_t interShift = shift % kTypeBit; - RAPIDJSON_ASSERT(count_ + offset <= kCapacity); - - if (interShift == 0) { - std::memmove(digits_ + offset, digits_, count_ * sizeof(Type)); - count_ += offset; - } - else { - digits_[count_] = 0; - for (size_t i = count_; i > 0; i--) - digits_[i + offset] = (digits_[i] << interShift) | (digits_[i - 1] >> (kTypeBit - interShift)); - digits_[offset] = digits_[0] << interShift; - count_ += offset; - if (digits_[count_]) - count_++; - } - - std::memset(digits_, 0, offset * sizeof(Type)); - - return *this; - } - - bool operator==(const BigInteger& rhs) const { - return count_ == rhs.count_ && std::memcmp(digits_, rhs.digits_, count_ * sizeof(Type)) == 0; - } - - bool operator==(const Type rhs) const { - return count_ == 1 && digits_[0] == rhs; - } - - BigInteger& MultiplyPow5(unsigned exp) { - static const uint32_t kPow5[12] = { - 5, - 5 * 5, - 5 * 5 * 5, - 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, - 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 - }; - if (exp == 0) return *this; - for (; exp >= 27; exp -= 27) *this *= RAPIDJSON_UINT64_C2(0X6765C793, 0XFA10079D); // 5^27 - for (; exp >= 13; exp -= 13) *this *= static_cast(1220703125u); // 5^13 - if (exp > 0) *this *= kPow5[exp - 1]; - return *this; - } - - // Compute absolute difference of this and rhs. - // Assume this != rhs - bool Difference(const BigInteger& rhs, BigInteger* out) const { - int cmp = Compare(rhs); - RAPIDJSON_ASSERT(cmp != 0); - const BigInteger *a, *b; // Makes a > b - bool ret; - if (cmp < 0) { a = &rhs; b = this; ret = true; } - else { a = this; b = &rhs; ret = false; } - - Type borrow = 0; - for (size_t i = 0; i < a->count_; i++) { - Type d = a->digits_[i] - borrow; - if (i < b->count_) - d -= b->digits_[i]; - borrow = (d > a->digits_[i]) ? 1 : 0; - out->digits_[i] = d; - if (d != 0) - out->count_ = i + 1; - } - - return ret; - } - - int Compare(const BigInteger& rhs) const { - if (count_ != rhs.count_) - return count_ < rhs.count_ ? -1 : 1; - - for (size_t i = count_; i-- > 0;) - if (digits_[i] != rhs.digits_[i]) - return digits_[i] < rhs.digits_[i] ? -1 : 1; - - return 0; - } - - size_t GetCount() const { return count_; } - Type GetDigit(size_t index) const { RAPIDJSON_ASSERT(index < count_); return digits_[index]; } - bool IsZero() const { return count_ == 1 && digits_[0] == 0; } - -private: - template - void AppendDecimal64(const Ch* begin, const Ch* end) { - uint64_t u = ParseUint64(begin, end); - if (IsZero()) - *this = u; - else { - unsigned exp = static_cast(end - begin); - (MultiplyPow5(exp) <<= exp) += u; // *this = *this * 10^exp + u - } - } - - void PushBack(Type digit) { - RAPIDJSON_ASSERT(count_ < kCapacity); - digits_[count_++] = digit; - } - - template - static uint64_t ParseUint64(const Ch* begin, const Ch* end) { - uint64_t r = 0; - for (const Ch* p = begin; p != end; ++p) { - RAPIDJSON_ASSERT(*p >= Ch('0') && *p <= Ch('9')); - r = r * 10u + static_cast(*p - Ch('0')); - } - return r; - } - - // Assume a * b + k < 2^128 - static uint64_t MulAdd64(uint64_t a, uint64_t b, uint64_t k, uint64_t* outHigh) { -#if defined(_MSC_VER) && defined(_M_AMD64) - uint64_t low = _umul128(a, b, outHigh) + k; - if (low < k) - (*outHigh)++; - return low; -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) - __extension__ typedef unsigned __int128 uint128; - uint128 p = static_cast(a) * static_cast(b); - p += k; - *outHigh = static_cast(p >> 64); - return static_cast(p); -#else - const uint64_t a0 = a & 0xFFFFFFFF, a1 = a >> 32, b0 = b & 0xFFFFFFFF, b1 = b >> 32; - uint64_t x0 = a0 * b0, x1 = a0 * b1, x2 = a1 * b0, x3 = a1 * b1; - x1 += (x0 >> 32); // can't give carry - x1 += x2; - if (x1 < x2) - x3 += (static_cast(1) << 32); - uint64_t lo = (x1 << 32) + (x0 & 0xFFFFFFFF); - uint64_t hi = x3 + (x1 >> 32); - - lo += k; - if (lo < k) - hi++; - *outHigh = hi; - return lo; -#endif - } - - static const size_t kBitCount = 3328; // 64bit * 54 > 10^1000 - static const size_t kCapacity = kBitCount / sizeof(Type); - static const size_t kTypeBit = sizeof(Type) * 8; - - Type digits_[kCapacity]; - size_t count_; -}; - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_BIGINTEGER_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/clzll.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/clzll.h deleted file mode 100644 index 8fc5118..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/clzll.h +++ /dev/null @@ -1,71 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_CLZLL_H_ -#define RAPIDJSON_CLZLL_H_ - -#include "../rapidjson.h" - -#if defined(_MSC_VER) && !defined(UNDER_CE) -#include -#if defined(_WIN64) -#pragma intrinsic(_BitScanReverse64) -#else -#pragma intrinsic(_BitScanReverse) -#endif -#endif - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -inline uint32_t clzll(uint64_t x) { - // Passing 0 to __builtin_clzll is UB in GCC and results in an - // infinite loop in the software implementation. - RAPIDJSON_ASSERT(x != 0); - -#if defined(_MSC_VER) && !defined(UNDER_CE) - unsigned long r = 0; -#if defined(_WIN64) - _BitScanReverse64(&r, x); -#else - // Scan the high 32 bits. - if (_BitScanReverse(&r, static_cast(x >> 32))) - return 63 - (r + 32); - - // Scan the low 32 bits. - _BitScanReverse(&r, static_cast(x & 0xFFFFFFFF)); -#endif // _WIN64 - - return 63 - r; -#elif (defined(__GNUC__) && __GNUC__ >= 4) || RAPIDJSON_HAS_BUILTIN(__builtin_clzll) - // __builtin_clzll wrapper - return static_cast(__builtin_clzll(x)); -#else - // naive version - uint32_t r = 0; - while (!(x & (static_cast(1) << 63))) { - x <<= 1; - ++r; - } - - return r; -#endif // _MSC_VER -} - -#define RAPIDJSON_CLZLL RAPIDJSON_NAMESPACE::internal::clzll - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_CLZLL_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/diyfp.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/diyfp.h deleted file mode 100644 index 1f60fb6..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/diyfp.h +++ /dev/null @@ -1,261 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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. - -// This is a C++ header-only implementation of Grisu2 algorithm from the publication: -// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with -// integers." ACM Sigplan Notices 45.6 (2010): 233-243. - -#ifndef RAPIDJSON_DIYFP_H_ -#define RAPIDJSON_DIYFP_H_ - -#include "../rapidjson.h" -#include "clzll.h" -#include - -#if defined(_MSC_VER) && defined(_M_AMD64) && !defined(__INTEL_COMPILER) -#include -#if !defined(_ARM64EC_) -#pragma intrinsic(_umul128) -#else -#pragma comment(lib,"softintrin") -#endif -#endif - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(padded) -#endif - -struct DiyFp { - DiyFp() : f(), e() {} - - DiyFp(uint64_t fp, int exp) : f(fp), e(exp) {} - - explicit DiyFp(double d) { - union { - double d; - uint64_t u64; - } u = { d }; - - int biased_e = static_cast((u.u64 & kDpExponentMask) >> kDpSignificandSize); - uint64_t significand = (u.u64 & kDpSignificandMask); - if (biased_e != 0) { - f = significand + kDpHiddenBit; - e = biased_e - kDpExponentBias; - } - else { - f = significand; - e = kDpMinExponent + 1; - } - } - - DiyFp operator-(const DiyFp& rhs) const { - return DiyFp(f - rhs.f, e); - } - - DiyFp operator*(const DiyFp& rhs) const { -#if defined(_MSC_VER) && defined(_M_AMD64) - uint64_t h; - uint64_t l = _umul128(f, rhs.f, &h); - if (l & (uint64_t(1) << 63)) // rounding - h++; - return DiyFp(h, e + rhs.e + 64); -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) - __extension__ typedef unsigned __int128 uint128; - uint128 p = static_cast(f) * static_cast(rhs.f); - uint64_t h = static_cast(p >> 64); - uint64_t l = static_cast(p); - if (l & (uint64_t(1) << 63)) // rounding - h++; - return DiyFp(h, e + rhs.e + 64); -#else - const uint64_t M32 = 0xFFFFFFFF; - const uint64_t a = f >> 32; - const uint64_t b = f & M32; - const uint64_t c = rhs.f >> 32; - const uint64_t d = rhs.f & M32; - const uint64_t ac = a * c; - const uint64_t bc = b * c; - const uint64_t ad = a * d; - const uint64_t bd = b * d; - uint64_t tmp = (bd >> 32) + (ad & M32) + (bc & M32); - tmp += 1U << 31; /// mult_round - return DiyFp(ac + (ad >> 32) + (bc >> 32) + (tmp >> 32), e + rhs.e + 64); -#endif - } - - DiyFp Normalize() const { - int s = static_cast(clzll(f)); - return DiyFp(f << s, e - s); - } - - DiyFp NormalizeBoundary() const { - DiyFp res = *this; - while (!(res.f & (kDpHiddenBit << 1))) { - res.f <<= 1; - res.e--; - } - res.f <<= (kDiySignificandSize - kDpSignificandSize - 2); - res.e = res.e - (kDiySignificandSize - kDpSignificandSize - 2); - return res; - } - - void NormalizedBoundaries(DiyFp* minus, DiyFp* plus) const { - DiyFp pl = DiyFp((f << 1) + 1, e - 1).NormalizeBoundary(); - DiyFp mi = (f == kDpHiddenBit) ? DiyFp((f << 2) - 1, e - 2) : DiyFp((f << 1) - 1, e - 1); - mi.f <<= mi.e - pl.e; - mi.e = pl.e; - *plus = pl; - *minus = mi; - } - - double ToDouble() const { - union { - double d; - uint64_t u64; - }u; - RAPIDJSON_ASSERT(f <= kDpHiddenBit + kDpSignificandMask); - if (e < kDpDenormalExponent) { - // Underflow. - return 0.0; - } - if (e >= kDpMaxExponent) { - // Overflow. - return std::numeric_limits::infinity(); - } - const uint64_t be = (e == kDpDenormalExponent && (f & kDpHiddenBit) == 0) ? 0 : - static_cast(e + kDpExponentBias); - u.u64 = (f & kDpSignificandMask) | (be << kDpSignificandSize); - return u.d; - } - - static const int kDiySignificandSize = 64; - static const int kDpSignificandSize = 52; - static const int kDpExponentBias = 0x3FF + kDpSignificandSize; - static const int kDpMaxExponent = 0x7FF - kDpExponentBias; - static const int kDpMinExponent = -kDpExponentBias; - static const int kDpDenormalExponent = -kDpExponentBias + 1; - static const uint64_t kDpExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); - static const uint64_t kDpSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); - static const uint64_t kDpHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); - - uint64_t f; - int e; -}; - -inline DiyFp GetCachedPowerByIndex(size_t index) { - // 10^-348, 10^-340, ..., 10^340 - static const uint64_t kCachedPowers_F[] = { - RAPIDJSON_UINT64_C2(0xfa8fd5a0, 0x081c0288), RAPIDJSON_UINT64_C2(0xbaaee17f, 0xa23ebf76), - RAPIDJSON_UINT64_C2(0x8b16fb20, 0x3055ac76), RAPIDJSON_UINT64_C2(0xcf42894a, 0x5dce35ea), - RAPIDJSON_UINT64_C2(0x9a6bb0aa, 0x55653b2d), RAPIDJSON_UINT64_C2(0xe61acf03, 0x3d1a45df), - RAPIDJSON_UINT64_C2(0xab70fe17, 0xc79ac6ca), RAPIDJSON_UINT64_C2(0xff77b1fc, 0xbebcdc4f), - RAPIDJSON_UINT64_C2(0xbe5691ef, 0x416bd60c), RAPIDJSON_UINT64_C2(0x8dd01fad, 0x907ffc3c), - RAPIDJSON_UINT64_C2(0xd3515c28, 0x31559a83), RAPIDJSON_UINT64_C2(0x9d71ac8f, 0xada6c9b5), - RAPIDJSON_UINT64_C2(0xea9c2277, 0x23ee8bcb), RAPIDJSON_UINT64_C2(0xaecc4991, 0x4078536d), - RAPIDJSON_UINT64_C2(0x823c1279, 0x5db6ce57), RAPIDJSON_UINT64_C2(0xc2109436, 0x4dfb5637), - RAPIDJSON_UINT64_C2(0x9096ea6f, 0x3848984f), RAPIDJSON_UINT64_C2(0xd77485cb, 0x25823ac7), - RAPIDJSON_UINT64_C2(0xa086cfcd, 0x97bf97f4), RAPIDJSON_UINT64_C2(0xef340a98, 0x172aace5), - RAPIDJSON_UINT64_C2(0xb23867fb, 0x2a35b28e), RAPIDJSON_UINT64_C2(0x84c8d4df, 0xd2c63f3b), - RAPIDJSON_UINT64_C2(0xc5dd4427, 0x1ad3cdba), RAPIDJSON_UINT64_C2(0x936b9fce, 0xbb25c996), - RAPIDJSON_UINT64_C2(0xdbac6c24, 0x7d62a584), RAPIDJSON_UINT64_C2(0xa3ab6658, 0x0d5fdaf6), - RAPIDJSON_UINT64_C2(0xf3e2f893, 0xdec3f126), RAPIDJSON_UINT64_C2(0xb5b5ada8, 0xaaff80b8), - RAPIDJSON_UINT64_C2(0x87625f05, 0x6c7c4a8b), RAPIDJSON_UINT64_C2(0xc9bcff60, 0x34c13053), - RAPIDJSON_UINT64_C2(0x964e858c, 0x91ba2655), RAPIDJSON_UINT64_C2(0xdff97724, 0x70297ebd), - RAPIDJSON_UINT64_C2(0xa6dfbd9f, 0xb8e5b88f), RAPIDJSON_UINT64_C2(0xf8a95fcf, 0x88747d94), - RAPIDJSON_UINT64_C2(0xb9447093, 0x8fa89bcf), RAPIDJSON_UINT64_C2(0x8a08f0f8, 0xbf0f156b), - RAPIDJSON_UINT64_C2(0xcdb02555, 0x653131b6), RAPIDJSON_UINT64_C2(0x993fe2c6, 0xd07b7fac), - RAPIDJSON_UINT64_C2(0xe45c10c4, 0x2a2b3b06), RAPIDJSON_UINT64_C2(0xaa242499, 0x697392d3), - RAPIDJSON_UINT64_C2(0xfd87b5f2, 0x8300ca0e), RAPIDJSON_UINT64_C2(0xbce50864, 0x92111aeb), - RAPIDJSON_UINT64_C2(0x8cbccc09, 0x6f5088cc), RAPIDJSON_UINT64_C2(0xd1b71758, 0xe219652c), - RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), RAPIDJSON_UINT64_C2(0xe8d4a510, 0x00000000), - RAPIDJSON_UINT64_C2(0xad78ebc5, 0xac620000), RAPIDJSON_UINT64_C2(0x813f3978, 0xf8940984), - RAPIDJSON_UINT64_C2(0xc097ce7b, 0xc90715b3), RAPIDJSON_UINT64_C2(0x8f7e32ce, 0x7bea5c70), - RAPIDJSON_UINT64_C2(0xd5d238a4, 0xabe98068), RAPIDJSON_UINT64_C2(0x9f4f2726, 0x179a2245), - RAPIDJSON_UINT64_C2(0xed63a231, 0xd4c4fb27), RAPIDJSON_UINT64_C2(0xb0de6538, 0x8cc8ada8), - RAPIDJSON_UINT64_C2(0x83c7088e, 0x1aab65db), RAPIDJSON_UINT64_C2(0xc45d1df9, 0x42711d9a), - RAPIDJSON_UINT64_C2(0x924d692c, 0xa61be758), RAPIDJSON_UINT64_C2(0xda01ee64, 0x1a708dea), - RAPIDJSON_UINT64_C2(0xa26da399, 0x9aef774a), RAPIDJSON_UINT64_C2(0xf209787b, 0xb47d6b85), - RAPIDJSON_UINT64_C2(0xb454e4a1, 0x79dd1877), RAPIDJSON_UINT64_C2(0x865b8692, 0x5b9bc5c2), - RAPIDJSON_UINT64_C2(0xc83553c5, 0xc8965d3d), RAPIDJSON_UINT64_C2(0x952ab45c, 0xfa97a0b3), - RAPIDJSON_UINT64_C2(0xde469fbd, 0x99a05fe3), RAPIDJSON_UINT64_C2(0xa59bc234, 0xdb398c25), - RAPIDJSON_UINT64_C2(0xf6c69a72, 0xa3989f5c), RAPIDJSON_UINT64_C2(0xb7dcbf53, 0x54e9bece), - RAPIDJSON_UINT64_C2(0x88fcf317, 0xf22241e2), RAPIDJSON_UINT64_C2(0xcc20ce9b, 0xd35c78a5), - RAPIDJSON_UINT64_C2(0x98165af3, 0x7b2153df), RAPIDJSON_UINT64_C2(0xe2a0b5dc, 0x971f303a), - RAPIDJSON_UINT64_C2(0xa8d9d153, 0x5ce3b396), RAPIDJSON_UINT64_C2(0xfb9b7cd9, 0xa4a7443c), - RAPIDJSON_UINT64_C2(0xbb764c4c, 0xa7a44410), RAPIDJSON_UINT64_C2(0x8bab8eef, 0xb6409c1a), - RAPIDJSON_UINT64_C2(0xd01fef10, 0xa657842c), RAPIDJSON_UINT64_C2(0x9b10a4e5, 0xe9913129), - RAPIDJSON_UINT64_C2(0xe7109bfb, 0xa19c0c9d), RAPIDJSON_UINT64_C2(0xac2820d9, 0x623bf429), - RAPIDJSON_UINT64_C2(0x80444b5e, 0x7aa7cf85), RAPIDJSON_UINT64_C2(0xbf21e440, 0x03acdd2d), - RAPIDJSON_UINT64_C2(0x8e679c2f, 0x5e44ff8f), RAPIDJSON_UINT64_C2(0xd433179d, 0x9c8cb841), - RAPIDJSON_UINT64_C2(0x9e19db92, 0xb4e31ba9), RAPIDJSON_UINT64_C2(0xeb96bf6e, 0xbadf77d9), - RAPIDJSON_UINT64_C2(0xaf87023b, 0x9bf0ee6b) - }; - static const int16_t kCachedPowers_E[] = { - -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980, - -954, -927, -901, -874, -847, -821, -794, -768, -741, -715, - -688, -661, -635, -608, -582, -555, -529, -502, -475, -449, - -422, -396, -369, -343, -316, -289, -263, -236, -210, -183, - -157, -130, -103, -77, -50, -24, 3, 30, 56, 83, - 109, 136, 162, 189, 216, 242, 269, 295, 322, 348, - 375, 402, 428, 455, 481, 508, 534, 561, 588, 614, - 641, 667, 694, 720, 747, 774, 800, 827, 853, 880, - 907, 933, 960, 986, 1013, 1039, 1066 - }; - RAPIDJSON_ASSERT(index < 87); - return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]); -} - -inline DiyFp GetCachedPower(int e, int* K) { - - //int k = static_cast(ceil((-61 - e) * 0.30102999566398114)) + 374; - double dk = (-61 - e) * 0.30102999566398114 + 347; // dk must be positive, so can do ceiling in positive - int k = static_cast(dk); - if (dk - k > 0.0) - k++; - - unsigned index = static_cast((k >> 3) + 1); - *K = -(-348 + static_cast(index << 3)); // decimal exponent no need lookup table - - return GetCachedPowerByIndex(index); -} - -inline DiyFp GetCachedPower10(int exp, int *outExp) { - RAPIDJSON_ASSERT(exp >= -348); - unsigned index = static_cast(exp + 348) / 8u; - *outExp = -348 + static_cast(index) * 8; - return GetCachedPowerByIndex(index); -} - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -#ifdef __clang__ -RAPIDJSON_DIAG_POP -RAPIDJSON_DIAG_OFF(padded) -#endif - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_DIYFP_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/dtoa.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/dtoa.h deleted file mode 100644 index 91c5756..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/dtoa.h +++ /dev/null @@ -1,249 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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. - -// This is a C++ header-only implementation of Grisu2 algorithm from the publication: -// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with -// integers." ACM Sigplan Notices 45.6 (2010): 233-243. - -#ifndef RAPIDJSON_DTOA_ -#define RAPIDJSON_DTOA_ - -#include "itoa.h" // GetDigitsLut() -#include "diyfp.h" -#include "ieee754.h" - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -RAPIDJSON_DIAG_OFF(array-bounds) // some gcc versions generate wrong warnings https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124 -#endif - -inline void GrisuRound(char* buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w) { - while (rest < wp_w && delta - rest >= ten_kappa && - (rest + ten_kappa < wp_w || /// closer - wp_w - rest > rest + ten_kappa - wp_w)) { - buffer[len - 1]--; - rest += ten_kappa; - } -} - -inline int CountDecimalDigit32(uint32_t n) { - // Simple pure C++ implementation was faster than __builtin_clz version in this situation. - if (n < 10) return 1; - if (n < 100) return 2; - if (n < 1000) return 3; - if (n < 10000) return 4; - if (n < 100000) return 5; - if (n < 1000000) return 6; - if (n < 10000000) return 7; - if (n < 100000000) return 8; - // Will not reach 10 digits in DigitGen() - //if (n < 1000000000) return 9; - //return 10; - return 9; -} - -inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) { - static const uint64_t kPow10[] = { 1ULL, 10ULL, 100ULL, 1000ULL, 10000ULL, 100000ULL, 1000000ULL, 10000000ULL, 100000000ULL, - 1000000000ULL, 10000000000ULL, 100000000000ULL, 1000000000000ULL, - 10000000000000ULL, 100000000000000ULL, 1000000000000000ULL, - 10000000000000000ULL, 100000000000000000ULL, 1000000000000000000ULL, - 10000000000000000000ULL }; - const DiyFp one(uint64_t(1) << -Mp.e, Mp.e); - const DiyFp wp_w = Mp - W; - uint32_t p1 = static_cast(Mp.f >> -one.e); - uint64_t p2 = Mp.f & (one.f - 1); - int kappa = CountDecimalDigit32(p1); // kappa in [0, 9] - *len = 0; - - while (kappa > 0) { - uint32_t d = 0; - switch (kappa) { - case 9: d = p1 / 100000000; p1 %= 100000000; break; - case 8: d = p1 / 10000000; p1 %= 10000000; break; - case 7: d = p1 / 1000000; p1 %= 1000000; break; - case 6: d = p1 / 100000; p1 %= 100000; break; - case 5: d = p1 / 10000; p1 %= 10000; break; - case 4: d = p1 / 1000; p1 %= 1000; break; - case 3: d = p1 / 100; p1 %= 100; break; - case 2: d = p1 / 10; p1 %= 10; break; - case 1: d = p1; p1 = 0; break; - default:; - } - if (d || *len) - buffer[(*len)++] = static_cast('0' + static_cast(d)); - kappa--; - uint64_t tmp = (static_cast(p1) << -one.e) + p2; - if (tmp <= delta) { - *K += kappa; - GrisuRound(buffer, *len, delta, tmp, kPow10[kappa] << -one.e, wp_w.f); - return; - } - } - - // kappa = 0 - for (;;) { - p2 *= 10; - delta *= 10; - char d = static_cast(p2 >> -one.e); - if (d || *len) - buffer[(*len)++] = static_cast('0' + d); - p2 &= one.f - 1; - kappa--; - if (p2 < delta) { - *K += kappa; - int index = -kappa; - GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * (index < 20 ? kPow10[index] : 0)); - return; - } - } -} - -inline void Grisu2(double value, char* buffer, int* length, int* K) { - const DiyFp v(value); - DiyFp w_m, w_p; - v.NormalizedBoundaries(&w_m, &w_p); - - const DiyFp c_mk = GetCachedPower(w_p.e, K); - const DiyFp W = v.Normalize() * c_mk; - DiyFp Wp = w_p * c_mk; - DiyFp Wm = w_m * c_mk; - Wm.f++; - Wp.f--; - DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); -} - -inline char* WriteExponent(int K, char* buffer) { - if (K < 0) { - *buffer++ = '-'; - K = -K; - } - - if (K >= 100) { - *buffer++ = static_cast('0' + static_cast(K / 100)); - K %= 100; - const char* d = GetDigitsLut() + K * 2; - *buffer++ = d[0]; - *buffer++ = d[1]; - } - else if (K >= 10) { - const char* d = GetDigitsLut() + K * 2; - *buffer++ = d[0]; - *buffer++ = d[1]; - } - else - *buffer++ = static_cast('0' + static_cast(K)); - - return buffer; -} - -inline char* Prettify(char* buffer, int length, int k, int maxDecimalPlaces) { - const int kk = length + k; // 10^(kk-1) <= v < 10^kk - - if (0 <= k && kk <= 21) { - // 1234e7 -> 12340000000 - for (int i = length; i < kk; i++) - buffer[i] = '0'; - buffer[kk] = '.'; - buffer[kk + 1] = '0'; - return &buffer[kk + 2]; - } - else if (0 < kk && kk <= 21) { - // 1234e-2 -> 12.34 - std::memmove(&buffer[kk + 1], &buffer[kk], static_cast(length - kk)); - buffer[kk] = '.'; - if (0 > k + maxDecimalPlaces) { - // When maxDecimalPlaces = 2, 1.2345 -> 1.23, 1.102 -> 1.1 - // Remove extra trailing zeros (at least one) after truncation. - for (int i = kk + maxDecimalPlaces; i > kk + 1; i--) - if (buffer[i] != '0') - return &buffer[i + 1]; - return &buffer[kk + 2]; // Reserve one zero - } - else - return &buffer[length + 1]; - } - else if (-6 < kk && kk <= 0) { - // 1234e-6 -> 0.001234 - const int offset = 2 - kk; - std::memmove(&buffer[offset], &buffer[0], static_cast(length)); - buffer[0] = '0'; - buffer[1] = '.'; - for (int i = 2; i < offset; i++) - buffer[i] = '0'; - if (length - kk > maxDecimalPlaces) { - // When maxDecimalPlaces = 2, 0.123 -> 0.12, 0.102 -> 0.1 - // Remove extra trailing zeros (at least one) after truncation. - for (int i = maxDecimalPlaces + 1; i > 2; i--) - if (buffer[i] != '0') - return &buffer[i + 1]; - return &buffer[3]; // Reserve one zero - } - else - return &buffer[length + offset]; - } - else if (kk < -maxDecimalPlaces) { - // Truncate to zero - buffer[0] = '0'; - buffer[1] = '.'; - buffer[2] = '0'; - return &buffer[3]; - } - else if (length == 1) { - // 1e30 - buffer[1] = 'e'; - return WriteExponent(kk - 1, &buffer[2]); - } - else { - // 1234e30 -> 1.234e33 - std::memmove(&buffer[2], &buffer[1], static_cast(length - 1)); - buffer[1] = '.'; - buffer[length + 1] = 'e'; - return WriteExponent(kk - 1, &buffer[0 + length + 2]); - } -} - -inline char* dtoa(double value, char* buffer, int maxDecimalPlaces = 324) { - RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); - Double d(value); - if (d.IsZero()) { - if (d.Sign()) - *buffer++ = '-'; // -0.0, Issue #289 - buffer[0] = '0'; - buffer[1] = '.'; - buffer[2] = '0'; - return &buffer[3]; - } - else { - if (value < 0) { - *buffer++ = '-'; - value = -value; - } - int length, K; - Grisu2(value, buffer, &length, &K); - return Prettify(buffer, length, K, maxDecimalPlaces); - } -} - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_DTOA_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/ieee754.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/ieee754.h deleted file mode 100644 index f887d1b..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/ieee754.h +++ /dev/null @@ -1,78 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_IEEE754_ -#define RAPIDJSON_IEEE754_ - -#include "../rapidjson.h" - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -class Double { -public: - Double() {} - Double(double d) : d_(d) {} - Double(uint64_t u) : u_(u) {} - - double Value() const { return d_; } - uint64_t Uint64Value() const { return u_; } - - double NextPositiveDouble() const { - RAPIDJSON_ASSERT(!Sign()); - return Double(u_ + 1).Value(); - } - - bool Sign() const { return (u_ & kSignMask) != 0; } - uint64_t Significand() const { return u_ & kSignificandMask; } - int Exponent() const { return static_cast(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); } - - bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; } - bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; } - bool IsNanOrInf() const { return (u_ & kExponentMask) == kExponentMask; } - bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; } - bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; } - - uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); } - int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; } - uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; } - - static int EffectiveSignificandSize(int order) { - if (order >= -1021) - return 53; - else if (order <= -1074) - return 0; - else - return order + 1074; - } - -private: - static const int kSignificandSize = 52; - static const int kExponentBias = 0x3FF; - static const int kDenormalExponent = 1 - kExponentBias; - static const uint64_t kSignMask = RAPIDJSON_UINT64_C2(0x80000000, 0x00000000); - static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); - static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); - static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); - - union { - double d_; - uint64_t u_; - }; -}; - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_IEEE754_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/itoa.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/itoa.h deleted file mode 100644 index 9fe8c93..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/itoa.h +++ /dev/null @@ -1,308 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_ITOA_ -#define RAPIDJSON_ITOA_ - -#include "../rapidjson.h" - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -inline const char* GetDigitsLut() { - static const char cDigitsLut[200] = { - '0','0','0','1','0','2','0','3','0','4','0','5','0','6','0','7','0','8','0','9', - '1','0','1','1','1','2','1','3','1','4','1','5','1','6','1','7','1','8','1','9', - '2','0','2','1','2','2','2','3','2','4','2','5','2','6','2','7','2','8','2','9', - '3','0','3','1','3','2','3','3','3','4','3','5','3','6','3','7','3','8','3','9', - '4','0','4','1','4','2','4','3','4','4','4','5','4','6','4','7','4','8','4','9', - '5','0','5','1','5','2','5','3','5','4','5','5','5','6','5','7','5','8','5','9', - '6','0','6','1','6','2','6','3','6','4','6','5','6','6','6','7','6','8','6','9', - '7','0','7','1','7','2','7','3','7','4','7','5','7','6','7','7','7','8','7','9', - '8','0','8','1','8','2','8','3','8','4','8','5','8','6','8','7','8','8','8','9', - '9','0','9','1','9','2','9','3','9','4','9','5','9','6','9','7','9','8','9','9' - }; - return cDigitsLut; -} - -inline char* u32toa(uint32_t value, char* buffer) { - RAPIDJSON_ASSERT(buffer != 0); - - const char* cDigitsLut = GetDigitsLut(); - - if (value < 10000) { - const uint32_t d1 = (value / 100) << 1; - const uint32_t d2 = (value % 100) << 1; - - if (value >= 1000) - *buffer++ = cDigitsLut[d1]; - if (value >= 100) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= 10) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - } - else if (value < 100000000) { - // value = bbbbcccc - const uint32_t b = value / 10000; - const uint32_t c = value % 10000; - - const uint32_t d1 = (b / 100) << 1; - const uint32_t d2 = (b % 100) << 1; - - const uint32_t d3 = (c / 100) << 1; - const uint32_t d4 = (c % 100) << 1; - - if (value >= 10000000) - *buffer++ = cDigitsLut[d1]; - if (value >= 1000000) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= 100000) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - } - else { - // value = aabbbbcccc in decimal - - const uint32_t a = value / 100000000; // 1 to 42 - value %= 100000000; - - if (a >= 10) { - const unsigned i = a << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - } - else - *buffer++ = static_cast('0' + static_cast(a)); - - const uint32_t b = value / 10000; // 0 to 9999 - const uint32_t c = value % 10000; // 0 to 9999 - - const uint32_t d1 = (b / 100) << 1; - const uint32_t d2 = (b % 100) << 1; - - const uint32_t d3 = (c / 100) << 1; - const uint32_t d4 = (c % 100) << 1; - - *buffer++ = cDigitsLut[d1]; - *buffer++ = cDigitsLut[d1 + 1]; - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - } - return buffer; -} - -inline char* i32toa(int32_t value, char* buffer) { - RAPIDJSON_ASSERT(buffer != 0); - uint32_t u = static_cast(value); - if (value < 0) { - *buffer++ = '-'; - u = ~u + 1; - } - - return u32toa(u, buffer); -} - -inline char* u64toa(uint64_t value, char* buffer) { - RAPIDJSON_ASSERT(buffer != 0); - const char* cDigitsLut = GetDigitsLut(); - const uint64_t kTen8 = 100000000; - const uint64_t kTen9 = kTen8 * 10; - const uint64_t kTen10 = kTen8 * 100; - const uint64_t kTen11 = kTen8 * 1000; - const uint64_t kTen12 = kTen8 * 10000; - const uint64_t kTen13 = kTen8 * 100000; - const uint64_t kTen14 = kTen8 * 1000000; - const uint64_t kTen15 = kTen8 * 10000000; - const uint64_t kTen16 = kTen8 * kTen8; - - if (value < kTen8) { - uint32_t v = static_cast(value); - if (v < 10000) { - const uint32_t d1 = (v / 100) << 1; - const uint32_t d2 = (v % 100) << 1; - - if (v >= 1000) - *buffer++ = cDigitsLut[d1]; - if (v >= 100) - *buffer++ = cDigitsLut[d1 + 1]; - if (v >= 10) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - } - else { - // value = bbbbcccc - const uint32_t b = v / 10000; - const uint32_t c = v % 10000; - - const uint32_t d1 = (b / 100) << 1; - const uint32_t d2 = (b % 100) << 1; - - const uint32_t d3 = (c / 100) << 1; - const uint32_t d4 = (c % 100) << 1; - - if (value >= 10000000) - *buffer++ = cDigitsLut[d1]; - if (value >= 1000000) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= 100000) - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - } - } - else if (value < kTen16) { - const uint32_t v0 = static_cast(value / kTen8); - const uint32_t v1 = static_cast(value % kTen8); - - const uint32_t b0 = v0 / 10000; - const uint32_t c0 = v0 % 10000; - - const uint32_t d1 = (b0 / 100) << 1; - const uint32_t d2 = (b0 % 100) << 1; - - const uint32_t d3 = (c0 / 100) << 1; - const uint32_t d4 = (c0 % 100) << 1; - - const uint32_t b1 = v1 / 10000; - const uint32_t c1 = v1 % 10000; - - const uint32_t d5 = (b1 / 100) << 1; - const uint32_t d6 = (b1 % 100) << 1; - - const uint32_t d7 = (c1 / 100) << 1; - const uint32_t d8 = (c1 % 100) << 1; - - if (value >= kTen15) - *buffer++ = cDigitsLut[d1]; - if (value >= kTen14) - *buffer++ = cDigitsLut[d1 + 1]; - if (value >= kTen13) - *buffer++ = cDigitsLut[d2]; - if (value >= kTen12) - *buffer++ = cDigitsLut[d2 + 1]; - if (value >= kTen11) - *buffer++ = cDigitsLut[d3]; - if (value >= kTen10) - *buffer++ = cDigitsLut[d3 + 1]; - if (value >= kTen9) - *buffer++ = cDigitsLut[d4]; - - *buffer++ = cDigitsLut[d4 + 1]; - *buffer++ = cDigitsLut[d5]; - *buffer++ = cDigitsLut[d5 + 1]; - *buffer++ = cDigitsLut[d6]; - *buffer++ = cDigitsLut[d6 + 1]; - *buffer++ = cDigitsLut[d7]; - *buffer++ = cDigitsLut[d7 + 1]; - *buffer++ = cDigitsLut[d8]; - *buffer++ = cDigitsLut[d8 + 1]; - } - else { - const uint32_t a = static_cast(value / kTen16); // 1 to 1844 - value %= kTen16; - - if (a < 10) - *buffer++ = static_cast('0' + static_cast(a)); - else if (a < 100) { - const uint32_t i = a << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - } - else if (a < 1000) { - *buffer++ = static_cast('0' + static_cast(a / 100)); - - const uint32_t i = (a % 100) << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - } - else { - const uint32_t i = (a / 100) << 1; - const uint32_t j = (a % 100) << 1; - *buffer++ = cDigitsLut[i]; - *buffer++ = cDigitsLut[i + 1]; - *buffer++ = cDigitsLut[j]; - *buffer++ = cDigitsLut[j + 1]; - } - - const uint32_t v0 = static_cast(value / kTen8); - const uint32_t v1 = static_cast(value % kTen8); - - const uint32_t b0 = v0 / 10000; - const uint32_t c0 = v0 % 10000; - - const uint32_t d1 = (b0 / 100) << 1; - const uint32_t d2 = (b0 % 100) << 1; - - const uint32_t d3 = (c0 / 100) << 1; - const uint32_t d4 = (c0 % 100) << 1; - - const uint32_t b1 = v1 / 10000; - const uint32_t c1 = v1 % 10000; - - const uint32_t d5 = (b1 / 100) << 1; - const uint32_t d6 = (b1 % 100) << 1; - - const uint32_t d7 = (c1 / 100) << 1; - const uint32_t d8 = (c1 % 100) << 1; - - *buffer++ = cDigitsLut[d1]; - *buffer++ = cDigitsLut[d1 + 1]; - *buffer++ = cDigitsLut[d2]; - *buffer++ = cDigitsLut[d2 + 1]; - *buffer++ = cDigitsLut[d3]; - *buffer++ = cDigitsLut[d3 + 1]; - *buffer++ = cDigitsLut[d4]; - *buffer++ = cDigitsLut[d4 + 1]; - *buffer++ = cDigitsLut[d5]; - *buffer++ = cDigitsLut[d5 + 1]; - *buffer++ = cDigitsLut[d6]; - *buffer++ = cDigitsLut[d6 + 1]; - *buffer++ = cDigitsLut[d7]; - *buffer++ = cDigitsLut[d7 + 1]; - *buffer++ = cDigitsLut[d8]; - *buffer++ = cDigitsLut[d8 + 1]; - } - - return buffer; -} - -inline char* i64toa(int64_t value, char* buffer) { - RAPIDJSON_ASSERT(buffer != 0); - uint64_t u = static_cast(value); - if (value < 0) { - *buffer++ = '-'; - u = ~u + 1; - } - - return u64toa(u, buffer); -} - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_ITOA_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/meta.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/meta.h deleted file mode 100644 index 76a1d5b..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/meta.h +++ /dev/null @@ -1,186 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_INTERNAL_META_H_ -#define RAPIDJSON_INTERNAL_META_H_ - -#include "../rapidjson.h" - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -#if defined(_MSC_VER) && !defined(__clang__) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(6334) -#endif - -#if RAPIDJSON_HAS_CXX11_TYPETRAITS -#include -#endif - -//@cond RAPIDJSON_INTERNAL -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -// Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching -template struct Void { typedef void Type; }; - -/////////////////////////////////////////////////////////////////////////////// -// BoolType, TrueType, FalseType -// -template struct BoolType { - static const bool Value = Cond; - typedef BoolType Type; -}; -typedef BoolType TrueType; -typedef BoolType FalseType; - - -/////////////////////////////////////////////////////////////////////////////// -// SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr -// - -template struct SelectIfImpl { template struct Apply { typedef T1 Type; }; }; -template <> struct SelectIfImpl { template struct Apply { typedef T2 Type; }; }; -template struct SelectIfCond : SelectIfImpl::template Apply {}; -template struct SelectIf : SelectIfCond {}; - -template struct AndExprCond : FalseType {}; -template <> struct AndExprCond : TrueType {}; -template struct OrExprCond : TrueType {}; -template <> struct OrExprCond : FalseType {}; - -template struct BoolExpr : SelectIf::Type {}; -template struct NotExpr : SelectIf::Type {}; -template struct AndExpr : AndExprCond::Type {}; -template struct OrExpr : OrExprCond::Type {}; - - -/////////////////////////////////////////////////////////////////////////////// -// AddConst, MaybeAddConst, RemoveConst -template struct AddConst { typedef const T Type; }; -template struct MaybeAddConst : SelectIfCond {}; -template struct RemoveConst { typedef T Type; }; -template struct RemoveConst { typedef T Type; }; - - -/////////////////////////////////////////////////////////////////////////////// -// IsSame, IsConst, IsMoreConst, IsPointer -// -template struct IsSame : FalseType {}; -template struct IsSame : TrueType {}; - -template struct IsConst : FalseType {}; -template struct IsConst : TrueType {}; - -template -struct IsMoreConst - : AndExpr::Type, typename RemoveConst::Type>, - BoolType::Value >= IsConst::Value> >::Type {}; - -template struct IsPointer : FalseType {}; -template struct IsPointer : TrueType {}; - -/////////////////////////////////////////////////////////////////////////////// -// IsBaseOf -// -#if RAPIDJSON_HAS_CXX11_TYPETRAITS - -template struct IsBaseOf - : BoolType< ::std::is_base_of::value> {}; - -#else // simplified version adopted from Boost - -template struct IsBaseOfImpl { - RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0); - RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0); - - typedef char (&Yes)[1]; - typedef char (&No) [2]; - - template - static Yes Check(const D*, T); - static No Check(const B*, int); - - struct Host { - operator const B*() const; - operator const D*(); - }; - - enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) }; -}; - -template struct IsBaseOf - : OrExpr, BoolExpr > >::Type {}; - -#endif // RAPIDJSON_HAS_CXX11_TYPETRAITS - - -////////////////////////////////////////////////////////////////////////// -// EnableIf / DisableIf -// -template struct EnableIfCond { typedef T Type; }; -template struct EnableIfCond { /* empty */ }; - -template struct DisableIfCond { typedef T Type; }; -template struct DisableIfCond { /* empty */ }; - -template -struct EnableIf : EnableIfCond {}; - -template -struct DisableIf : DisableIfCond {}; - -// SFINAE helpers -struct SfinaeTag {}; -template struct RemoveSfinaeTag; -template struct RemoveSfinaeTag { typedef T Type; }; - -#define RAPIDJSON_REMOVEFPTR_(type) \ - typename ::RAPIDJSON_NAMESPACE::internal::RemoveSfinaeTag \ - < ::RAPIDJSON_NAMESPACE::internal::SfinaeTag&(*) type>::Type - -#define RAPIDJSON_ENABLEIF(cond) \ - typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \ - ::Type * = NULL - -#define RAPIDJSON_DISABLEIF(cond) \ - typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \ - ::Type * = NULL - -#define RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \ - typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \ - ::Type - -#define RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \ - typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \ - ::Type - -} // namespace internal -RAPIDJSON_NAMESPACE_END -//@endcond - -#if defined(_MSC_VER) && !defined(__clang__) -RAPIDJSON_DIAG_POP -#endif - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_INTERNAL_META_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/pow10.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/pow10.h deleted file mode 100644 index 04ee1f6..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/pow10.h +++ /dev/null @@ -1,55 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_POW10_ -#define RAPIDJSON_POW10_ - -#include "../rapidjson.h" - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -//! Computes integer powers of 10 in double (10.0^n). -/*! This function uses lookup table for fast and accurate results. - \param n non-negative exponent. Must <= 308. - \return 10.0^n -*/ -inline double Pow10(int n) { - static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes - 1e+0, - 1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, - 1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40, - 1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60, - 1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80, - 1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100, - 1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120, - 1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140, - 1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160, - 1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180, - 1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200, - 1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220, - 1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240, - 1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260, - 1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280, - 1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300, - 1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308 - }; - RAPIDJSON_ASSERT(n >= 0 && n <= 308); - return e[n]; -} - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_POW10_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/regex.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/regex.h deleted file mode 100644 index e371261..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/regex.h +++ /dev/null @@ -1,739 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_INTERNAL_REGEX_H_ -#define RAPIDJSON_INTERNAL_REGEX_H_ - -#include "../allocators.h" -#include "../stream.h" -#include "stack.h" - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(padded) -RAPIDJSON_DIAG_OFF(switch-enum) -#elif defined(_MSC_VER) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated -#endif - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -#ifndef RAPIDJSON_REGEX_VERBOSE -#define RAPIDJSON_REGEX_VERBOSE 0 -#endif - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -/////////////////////////////////////////////////////////////////////////////// -// DecodedStream - -template -class DecodedStream { -public: - DecodedStream(SourceStream& ss) : ss_(ss), codepoint_() { Decode(); } - unsigned Peek() { return codepoint_; } - unsigned Take() { - unsigned c = codepoint_; - if (c) // No further decoding when '\0' - Decode(); - return c; - } - -private: - void Decode() { - if (!Encoding::Decode(ss_, &codepoint_)) - codepoint_ = 0; - } - - SourceStream& ss_; - unsigned codepoint_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// GenericRegex - -static const SizeType kRegexInvalidState = ~SizeType(0); //!< Represents an invalid index in GenericRegex::State::out, out1 -static const SizeType kRegexInvalidRange = ~SizeType(0); - -template -class GenericRegexSearch; - -//! Regular expression engine with subset of ECMAscript grammar. -/*! - Supported regular expression syntax: - - \c ab Concatenation - - \c a|b Alternation - - \c a? Zero or one - - \c a* Zero or more - - \c a+ One or more - - \c a{3} Exactly 3 times - - \c a{3,} At least 3 times - - \c a{3,5} 3 to 5 times - - \c (ab) Grouping - - \c ^a At the beginning - - \c a$ At the end - - \c . Any character - - \c [abc] Character classes - - \c [a-c] Character class range - - \c [a-z0-9_] Character class combination - - \c [^abc] Negated character classes - - \c [^a-c] Negated character class range - - \c [\b] Backspace (U+0008) - - \c \\| \\\\ ... Escape characters - - \c \\f Form feed (U+000C) - - \c \\n Line feed (U+000A) - - \c \\r Carriage return (U+000D) - - \c \\t Tab (U+0009) - - \c \\v Vertical tab (U+000B) - - \note This is a Thompson NFA engine, implemented with reference to - Cox, Russ. "Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby,...).", - https://swtch.com/~rsc/regexp/regexp1.html -*/ -template -class GenericRegex { -public: - typedef Encoding EncodingType; - typedef typename Encoding::Ch Ch; - template friend class GenericRegexSearch; - - GenericRegex(const Ch* source, Allocator* allocator = 0) : - ownAllocator_(allocator ? 0 : RAPIDJSON_NEW(Allocator)()), allocator_(allocator ? allocator : ownAllocator_), - states_(allocator_, 256), ranges_(allocator_, 256), root_(kRegexInvalidState), stateCount_(), rangeCount_(), - anchorBegin_(), anchorEnd_() - { - GenericStringStream ss(source); - DecodedStream, Encoding> ds(ss); - Parse(ds); - } - - ~GenericRegex() - { - RAPIDJSON_DELETE(ownAllocator_); - } - - bool IsValid() const { - return root_ != kRegexInvalidState; - } - -private: - enum Operator { - kZeroOrOne, - kZeroOrMore, - kOneOrMore, - kConcatenation, - kAlternation, - kLeftParenthesis - }; - - static const unsigned kAnyCharacterClass = 0xFFFFFFFF; //!< For '.' - static const unsigned kRangeCharacterClass = 0xFFFFFFFE; - static const unsigned kRangeNegationFlag = 0x80000000; - - struct Range { - unsigned start; // - unsigned end; - SizeType next; - }; - - struct State { - SizeType out; //!< Equals to kInvalid for matching state - SizeType out1; //!< Equals to non-kInvalid for split - SizeType rangeStart; - unsigned codepoint; - }; - - struct Frag { - Frag(SizeType s, SizeType o, SizeType m) : start(s), out(o), minIndex(m) {} - SizeType start; - SizeType out; //!< link-list of all output states - SizeType minIndex; - }; - - State& GetState(SizeType index) { - RAPIDJSON_ASSERT(index < stateCount_); - return states_.template Bottom()[index]; - } - - const State& GetState(SizeType index) const { - RAPIDJSON_ASSERT(index < stateCount_); - return states_.template Bottom()[index]; - } - - Range& GetRange(SizeType index) { - RAPIDJSON_ASSERT(index < rangeCount_); - return ranges_.template Bottom()[index]; - } - - const Range& GetRange(SizeType index) const { - RAPIDJSON_ASSERT(index < rangeCount_); - return ranges_.template Bottom()[index]; - } - - template - void Parse(DecodedStream& ds) { - Stack operandStack(allocator_, 256); // Frag - Stack operatorStack(allocator_, 256); // Operator - Stack atomCountStack(allocator_, 256); // unsigned (Atom per parenthesis) - - *atomCountStack.template Push() = 0; - - unsigned codepoint; - while (ds.Peek() != 0) { - switch (codepoint = ds.Take()) { - case '^': - anchorBegin_ = true; - break; - - case '$': - anchorEnd_ = true; - break; - - case '|': - while (!operatorStack.Empty() && *operatorStack.template Top() < kAlternation) - if (!Eval(operandStack, *operatorStack.template Pop(1))) - return; - *operatorStack.template Push() = kAlternation; - *atomCountStack.template Top() = 0; - break; - - case '(': - *operatorStack.template Push() = kLeftParenthesis; - *atomCountStack.template Push() = 0; - break; - - case ')': - while (!operatorStack.Empty() && *operatorStack.template Top() != kLeftParenthesis) - if (!Eval(operandStack, *operatorStack.template Pop(1))) - return; - if (operatorStack.Empty()) - return; - operatorStack.template Pop(1); - atomCountStack.template Pop(1); - ImplicitConcatenation(atomCountStack, operatorStack); - break; - - case '?': - if (!Eval(operandStack, kZeroOrOne)) - return; - break; - - case '*': - if (!Eval(operandStack, kZeroOrMore)) - return; - break; - - case '+': - if (!Eval(operandStack, kOneOrMore)) - return; - break; - - case '{': - { - unsigned n, m; - if (!ParseUnsigned(ds, &n)) - return; - - if (ds.Peek() == ',') { - ds.Take(); - if (ds.Peek() == '}') - m = kInfinityQuantifier; - else if (!ParseUnsigned(ds, &m) || m < n) - return; - } - else - m = n; - - if (!EvalQuantifier(operandStack, n, m) || ds.Peek() != '}') - return; - ds.Take(); - } - break; - - case '.': - PushOperand(operandStack, kAnyCharacterClass); - ImplicitConcatenation(atomCountStack, operatorStack); - break; - - case '[': - { - SizeType range; - if (!ParseRange(ds, &range)) - return; - SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, kRangeCharacterClass); - GetState(s).rangeStart = range; - *operandStack.template Push() = Frag(s, s, s); - } - ImplicitConcatenation(atomCountStack, operatorStack); - break; - - case '\\': // Escape character - if (!CharacterEscape(ds, &codepoint)) - return; // Unsupported escape character - // fall through to default - RAPIDJSON_DELIBERATE_FALLTHROUGH; - - default: // Pattern character - PushOperand(operandStack, codepoint); - ImplicitConcatenation(atomCountStack, operatorStack); - } - } - - while (!operatorStack.Empty()) - if (!Eval(operandStack, *operatorStack.template Pop(1))) - return; - - // Link the operand to matching state. - if (operandStack.GetSize() == sizeof(Frag)) { - Frag* e = operandStack.template Pop(1); - Patch(e->out, NewState(kRegexInvalidState, kRegexInvalidState, 0)); - root_ = e->start; - -#if RAPIDJSON_REGEX_VERBOSE - printf("root: %d\n", root_); - for (SizeType i = 0; i < stateCount_ ; i++) { - State& s = GetState(i); - printf("[%2d] out: %2d out1: %2d c: '%c'\n", i, s.out, s.out1, (char)s.codepoint); - } - printf("\n"); -#endif - } - } - - SizeType NewState(SizeType out, SizeType out1, unsigned codepoint) { - State* s = states_.template Push(); - s->out = out; - s->out1 = out1; - s->codepoint = codepoint; - s->rangeStart = kRegexInvalidRange; - return stateCount_++; - } - - void PushOperand(Stack& operandStack, unsigned codepoint) { - SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, codepoint); - *operandStack.template Push() = Frag(s, s, s); - } - - void ImplicitConcatenation(Stack& atomCountStack, Stack& operatorStack) { - if (*atomCountStack.template Top()) - *operatorStack.template Push() = kConcatenation; - (*atomCountStack.template Top())++; - } - - SizeType Append(SizeType l1, SizeType l2) { - SizeType old = l1; - while (GetState(l1).out != kRegexInvalidState) - l1 = GetState(l1).out; - GetState(l1).out = l2; - return old; - } - - void Patch(SizeType l, SizeType s) { - for (SizeType next; l != kRegexInvalidState; l = next) { - next = GetState(l).out; - GetState(l).out = s; - } - } - - bool Eval(Stack& operandStack, Operator op) { - switch (op) { - case kConcatenation: - RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag) * 2); - { - Frag e2 = *operandStack.template Pop(1); - Frag e1 = *operandStack.template Pop(1); - Patch(e1.out, e2.start); - *operandStack.template Push() = Frag(e1.start, e2.out, Min(e1.minIndex, e2.minIndex)); - } - return true; - - case kAlternation: - if (operandStack.GetSize() >= sizeof(Frag) * 2) { - Frag e2 = *operandStack.template Pop(1); - Frag e1 = *operandStack.template Pop(1); - SizeType s = NewState(e1.start, e2.start, 0); - *operandStack.template Push() = Frag(s, Append(e1.out, e2.out), Min(e1.minIndex, e2.minIndex)); - return true; - } - return false; - - case kZeroOrOne: - if (operandStack.GetSize() >= sizeof(Frag)) { - Frag e = *operandStack.template Pop(1); - SizeType s = NewState(kRegexInvalidState, e.start, 0); - *operandStack.template Push() = Frag(s, Append(e.out, s), e.minIndex); - return true; - } - return false; - - case kZeroOrMore: - if (operandStack.GetSize() >= sizeof(Frag)) { - Frag e = *operandStack.template Pop(1); - SizeType s = NewState(kRegexInvalidState, e.start, 0); - Patch(e.out, s); - *operandStack.template Push() = Frag(s, s, e.minIndex); - return true; - } - return false; - - case kOneOrMore: - if (operandStack.GetSize() >= sizeof(Frag)) { - Frag e = *operandStack.template Pop(1); - SizeType s = NewState(kRegexInvalidState, e.start, 0); - Patch(e.out, s); - *operandStack.template Push() = Frag(e.start, s, e.minIndex); - return true; - } - return false; - - default: - // syntax error (e.g. unclosed kLeftParenthesis) - return false; - } - } - - bool EvalQuantifier(Stack& operandStack, unsigned n, unsigned m) { - RAPIDJSON_ASSERT(n <= m); - RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag)); - - if (n == 0) { - if (m == 0) // a{0} not support - return false; - else if (m == kInfinityQuantifier) - Eval(operandStack, kZeroOrMore); // a{0,} -> a* - else { - Eval(operandStack, kZeroOrOne); // a{0,5} -> a? - for (unsigned i = 0; i < m - 1; i++) - CloneTopOperand(operandStack); // a{0,5} -> a? a? a? a? a? - for (unsigned i = 0; i < m - 1; i++) - Eval(operandStack, kConcatenation); // a{0,5} -> a?a?a?a?a? - } - return true; - } - - for (unsigned i = 0; i < n - 1; i++) // a{3} -> a a a - CloneTopOperand(operandStack); - - if (m == kInfinityQuantifier) - Eval(operandStack, kOneOrMore); // a{3,} -> a a a+ - else if (m > n) { - CloneTopOperand(operandStack); // a{3,5} -> a a a a - Eval(operandStack, kZeroOrOne); // a{3,5} -> a a a a? - for (unsigned i = n; i < m - 1; i++) - CloneTopOperand(operandStack); // a{3,5} -> a a a a? a? - for (unsigned i = n; i < m; i++) - Eval(operandStack, kConcatenation); // a{3,5} -> a a aa?a? - } - - for (unsigned i = 0; i < n - 1; i++) - Eval(operandStack, kConcatenation); // a{3} -> aaa, a{3,} -> aaa+, a{3.5} -> aaaa?a? - - return true; - } - - static SizeType Min(SizeType a, SizeType b) { return a < b ? a : b; } - - void CloneTopOperand(Stack& operandStack) { - const Frag src = *operandStack.template Top(); // Copy constructor to prevent invalidation - SizeType count = stateCount_ - src.minIndex; // Assumes top operand contains states in [src->minIndex, stateCount_) - State* s = states_.template Push(count); - memcpy(s, &GetState(src.minIndex), count * sizeof(State)); - for (SizeType j = 0; j < count; j++) { - if (s[j].out != kRegexInvalidState) - s[j].out += count; - if (s[j].out1 != kRegexInvalidState) - s[j].out1 += count; - } - *operandStack.template Push() = Frag(src.start + count, src.out + count, src.minIndex + count); - stateCount_ += count; - } - - template - bool ParseUnsigned(DecodedStream& ds, unsigned* u) { - unsigned r = 0; - if (ds.Peek() < '0' || ds.Peek() > '9') - return false; - while (ds.Peek() >= '0' && ds.Peek() <= '9') { - if (r >= 429496729 && ds.Peek() > '5') // 2^32 - 1 = 4294967295 - return false; // overflow - r = r * 10 + (ds.Take() - '0'); - } - *u = r; - return true; - } - - template - bool ParseRange(DecodedStream& ds, SizeType* range) { - bool isBegin = true; - bool negate = false; - int step = 0; - SizeType start = kRegexInvalidRange; - SizeType current = kRegexInvalidRange; - unsigned codepoint; - while ((codepoint = ds.Take()) != 0) { - if (isBegin) { - isBegin = false; - if (codepoint == '^') { - negate = true; - continue; - } - } - - switch (codepoint) { - case ']': - if (start == kRegexInvalidRange) - return false; // Error: nothing inside [] - if (step == 2) { // Add trailing '-' - SizeType r = NewRange('-'); - RAPIDJSON_ASSERT(current != kRegexInvalidRange); - GetRange(current).next = r; - } - if (negate) - GetRange(start).start |= kRangeNegationFlag; - *range = start; - return true; - - case '\\': - if (ds.Peek() == 'b') { - ds.Take(); - codepoint = 0x0008; // Escape backspace character - } - else if (!CharacterEscape(ds, &codepoint)) - return false; - // fall through to default - RAPIDJSON_DELIBERATE_FALLTHROUGH; - - default: - switch (step) { - case 1: - if (codepoint == '-') { - step++; - break; - } - // fall through to step 0 for other characters - RAPIDJSON_DELIBERATE_FALLTHROUGH; - - case 0: - { - SizeType r = NewRange(codepoint); - if (current != kRegexInvalidRange) - GetRange(current).next = r; - if (start == kRegexInvalidRange) - start = r; - current = r; - } - step = 1; - break; - - default: - RAPIDJSON_ASSERT(step == 2); - GetRange(current).end = codepoint; - step = 0; - } - } - } - return false; - } - - SizeType NewRange(unsigned codepoint) { - Range* r = ranges_.template Push(); - r->start = r->end = codepoint; - r->next = kRegexInvalidRange; - return rangeCount_++; - } - - template - bool CharacterEscape(DecodedStream& ds, unsigned* escapedCodepoint) { - unsigned codepoint; - switch (codepoint = ds.Take()) { - case '^': - case '$': - case '|': - case '(': - case ')': - case '?': - case '*': - case '+': - case '.': - case '[': - case ']': - case '{': - case '}': - case '\\': - *escapedCodepoint = codepoint; return true; - case 'f': *escapedCodepoint = 0x000C; return true; - case 'n': *escapedCodepoint = 0x000A; return true; - case 'r': *escapedCodepoint = 0x000D; return true; - case 't': *escapedCodepoint = 0x0009; return true; - case 'v': *escapedCodepoint = 0x000B; return true; - default: - return false; // Unsupported escape character - } - } - - Allocator* ownAllocator_; - Allocator* allocator_; - Stack states_; - Stack ranges_; - SizeType root_; - SizeType stateCount_; - SizeType rangeCount_; - - static const unsigned kInfinityQuantifier = ~0u; - - // For SearchWithAnchoring() - bool anchorBegin_; - bool anchorEnd_; -}; - -template -class GenericRegexSearch { -public: - typedef typename RegexType::EncodingType Encoding; - typedef typename Encoding::Ch Ch; - - GenericRegexSearch(const RegexType& regex, Allocator* allocator = 0) : - regex_(regex), allocator_(allocator), ownAllocator_(0), - state0_(allocator, 0), state1_(allocator, 0), stateSet_() - { - RAPIDJSON_ASSERT(regex_.IsValid()); - if (!allocator_) - ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); - stateSet_ = static_cast(allocator_->Malloc(GetStateSetSize())); - state0_.template Reserve(regex_.stateCount_); - state1_.template Reserve(regex_.stateCount_); - } - - ~GenericRegexSearch() { - Allocator::Free(stateSet_); - RAPIDJSON_DELETE(ownAllocator_); - } - - template - bool Match(InputStream& is) { - return SearchWithAnchoring(is, true, true); - } - - bool Match(const Ch* s) { - GenericStringStream is(s); - return Match(is); - } - - template - bool Search(InputStream& is) { - return SearchWithAnchoring(is, regex_.anchorBegin_, regex_.anchorEnd_); - } - - bool Search(const Ch* s) { - GenericStringStream is(s); - return Search(is); - } - -private: - typedef typename RegexType::State State; - typedef typename RegexType::Range Range; - - template - bool SearchWithAnchoring(InputStream& is, bool anchorBegin, bool anchorEnd) { - DecodedStream ds(is); - - state0_.Clear(); - Stack *current = &state0_, *next = &state1_; - const size_t stateSetSize = GetStateSetSize(); - std::memset(stateSet_, 0, stateSetSize); - - bool matched = AddState(*current, regex_.root_); - unsigned codepoint; - while (!current->Empty() && (codepoint = ds.Take()) != 0) { - std::memset(stateSet_, 0, stateSetSize); - next->Clear(); - matched = false; - for (const SizeType* s = current->template Bottom(); s != current->template End(); ++s) { - const State& sr = regex_.GetState(*s); - if (sr.codepoint == codepoint || - sr.codepoint == RegexType::kAnyCharacterClass || - (sr.codepoint == RegexType::kRangeCharacterClass && MatchRange(sr.rangeStart, codepoint))) - { - matched = AddState(*next, sr.out) || matched; - if (!anchorEnd && matched) - return true; - } - if (!anchorBegin) - AddState(*next, regex_.root_); - } - internal::Swap(current, next); - } - - return matched; - } - - size_t GetStateSetSize() const { - return (regex_.stateCount_ + 31) / 32 * 4; - } - - // Return whether the added states is a match state - bool AddState(Stack& l, SizeType index) { - RAPIDJSON_ASSERT(index != kRegexInvalidState); - - const State& s = regex_.GetState(index); - if (s.out1 != kRegexInvalidState) { // Split - bool matched = AddState(l, s.out); - return AddState(l, s.out1) || matched; - } - else if (!(stateSet_[index >> 5] & (1u << (index & 31)))) { - stateSet_[index >> 5] |= (1u << (index & 31)); - *l.template PushUnsafe() = index; - } - return s.out == kRegexInvalidState; // by using PushUnsafe() above, we can ensure s is not validated due to reallocation. - } - - bool MatchRange(SizeType rangeIndex, unsigned codepoint) const { - bool yes = (regex_.GetRange(rangeIndex).start & RegexType::kRangeNegationFlag) == 0; - while (rangeIndex != kRegexInvalidRange) { - const Range& r = regex_.GetRange(rangeIndex); - if (codepoint >= (r.start & ~RegexType::kRangeNegationFlag) && codepoint <= r.end) - return yes; - rangeIndex = r.next; - } - return !yes; - } - - const RegexType& regex_; - Allocator* allocator_; - Allocator* ownAllocator_; - Stack state0_; - Stack state1_; - uint32_t* stateSet_; -}; - -typedef GenericRegex > Regex; -typedef GenericRegexSearch RegexSearch; - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -#if defined(__clang__) || defined(_MSC_VER) -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_INTERNAL_REGEX_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/stack.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/stack.h deleted file mode 100644 index ceead44..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/stack.h +++ /dev/null @@ -1,232 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_INTERNAL_STACK_H_ -#define RAPIDJSON_INTERNAL_STACK_H_ - -#include "../allocators.h" -#include "swap.h" -#include - -#if defined(__clang__) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(c++98-compat) -#endif - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -/////////////////////////////////////////////////////////////////////////////// -// Stack - -//! A type-unsafe stack for storing different types of data. -/*! \tparam Allocator Allocator for allocating stack memory. -*/ -template -class Stack { -public: - // Optimization note: Do not allocate memory for stack_ in constructor. - // Do it lazily when first Push() -> Expand() -> Resize(). - Stack(Allocator* allocator, size_t stackCapacity) : allocator_(allocator), ownAllocator_(0), stack_(0), stackTop_(0), stackEnd_(0), initialCapacity_(stackCapacity) { - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - Stack(Stack&& rhs) - : allocator_(rhs.allocator_), - ownAllocator_(rhs.ownAllocator_), - stack_(rhs.stack_), - stackTop_(rhs.stackTop_), - stackEnd_(rhs.stackEnd_), - initialCapacity_(rhs.initialCapacity_) - { - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.stack_ = 0; - rhs.stackTop_ = 0; - rhs.stackEnd_ = 0; - rhs.initialCapacity_ = 0; - } -#endif - - ~Stack() { - Destroy(); - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - Stack& operator=(Stack&& rhs) { - if (&rhs != this) - { - Destroy(); - - allocator_ = rhs.allocator_; - ownAllocator_ = rhs.ownAllocator_; - stack_ = rhs.stack_; - stackTop_ = rhs.stackTop_; - stackEnd_ = rhs.stackEnd_; - initialCapacity_ = rhs.initialCapacity_; - - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.stack_ = 0; - rhs.stackTop_ = 0; - rhs.stackEnd_ = 0; - rhs.initialCapacity_ = 0; - } - return *this; - } -#endif - - void Swap(Stack& rhs) RAPIDJSON_NOEXCEPT { - internal::Swap(allocator_, rhs.allocator_); - internal::Swap(ownAllocator_, rhs.ownAllocator_); - internal::Swap(stack_, rhs.stack_); - internal::Swap(stackTop_, rhs.stackTop_); - internal::Swap(stackEnd_, rhs.stackEnd_); - internal::Swap(initialCapacity_, rhs.initialCapacity_); - } - - void Clear() { stackTop_ = stack_; } - - void ShrinkToFit() { - if (Empty()) { - // If the stack is empty, completely deallocate the memory. - Allocator::Free(stack_); // NOLINT (+clang-analyzer-unix.Malloc) - stack_ = 0; - stackTop_ = 0; - stackEnd_ = 0; - } - else - Resize(GetSize()); - } - - // Optimization note: try to minimize the size of this function for force inline. - // Expansion is run very infrequently, so it is moved to another (probably non-inline) function. - template - RAPIDJSON_FORCEINLINE void Reserve(size_t count = 1) { - // Expand the stack if needed - if (RAPIDJSON_UNLIKELY(static_cast(sizeof(T) * count) > (stackEnd_ - stackTop_))) - Expand(count); - } - - template - RAPIDJSON_FORCEINLINE T* Push(size_t count = 1) { - Reserve(count); - return PushUnsafe(count); - } - - template - RAPIDJSON_FORCEINLINE T* PushUnsafe(size_t count = 1) { - RAPIDJSON_ASSERT(stackTop_); - RAPIDJSON_ASSERT(static_cast(sizeof(T) * count) <= (stackEnd_ - stackTop_)); - T* ret = reinterpret_cast(stackTop_); - stackTop_ += sizeof(T) * count; - return ret; - } - - template - T* Pop(size_t count) { - RAPIDJSON_ASSERT(GetSize() >= count * sizeof(T)); - stackTop_ -= count * sizeof(T); - return reinterpret_cast(stackTop_); - } - - template - T* Top() { - RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); - return reinterpret_cast(stackTop_ - sizeof(T)); - } - - template - const T* Top() const { - RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); - return reinterpret_cast(stackTop_ - sizeof(T)); - } - - template - T* End() { return reinterpret_cast(stackTop_); } - - template - const T* End() const { return reinterpret_cast(stackTop_); } - - template - T* Bottom() { return reinterpret_cast(stack_); } - - template - const T* Bottom() const { return reinterpret_cast(stack_); } - - bool HasAllocator() const { - return allocator_ != 0; - } - - Allocator& GetAllocator() { - RAPIDJSON_ASSERT(allocator_); - return *allocator_; - } - - bool Empty() const { return stackTop_ == stack_; } - size_t GetSize() const { return static_cast(stackTop_ - stack_); } - size_t GetCapacity() const { return static_cast(stackEnd_ - stack_); } - -private: - template - void Expand(size_t count) { - // Only expand the capacity if the current stack exists. Otherwise just create a stack with initial capacity. - size_t newCapacity; - if (stack_ == 0) { - if (!allocator_) - ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); - newCapacity = initialCapacity_; - } else { - newCapacity = GetCapacity(); - newCapacity += (newCapacity + 1) / 2; - } - size_t newSize = GetSize() + sizeof(T) * count; - if (newCapacity < newSize) - newCapacity = newSize; - - Resize(newCapacity); - } - - void Resize(size_t newCapacity) { - const size_t size = GetSize(); // Backup the current size - stack_ = static_cast(allocator_->Realloc(stack_, GetCapacity(), newCapacity)); - stackTop_ = stack_ + size; - stackEnd_ = stack_ + newCapacity; - } - - void Destroy() { - Allocator::Free(stack_); - RAPIDJSON_DELETE(ownAllocator_); // Only delete if it is owned by the stack - } - - // Prohibit copy constructor & assignment operator. - Stack(const Stack&); - Stack& operator=(const Stack&); - - Allocator* allocator_; - Allocator* ownAllocator_; - char *stack_; - char *stackTop_; - char *stackEnd_; - size_t initialCapacity_; -}; - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_STACK_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/strfunc.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/strfunc.h deleted file mode 100644 index 1a88f49..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/strfunc.h +++ /dev/null @@ -1,83 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_INTERNAL_STRFUNC_H_ -#define RAPIDJSON_INTERNAL_STRFUNC_H_ - -#include "../stream.h" -#include - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -//! Custom strlen() which works on different character types. -/*! \tparam Ch Character type (e.g. char, wchar_t, short) - \param s Null-terminated input string. - \return Number of characters in the string. - \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. -*/ -template -inline SizeType StrLen(const Ch* s) { - RAPIDJSON_ASSERT(s != 0); - const Ch* p = s; - while (*p) ++p; - return SizeType(p - s); -} - -template <> -inline SizeType StrLen(const char* s) { - return SizeType(std::strlen(s)); -} - -template <> -inline SizeType StrLen(const wchar_t* s) { - return SizeType(std::wcslen(s)); -} - -//! Custom strcmpn() which works on different character types. -/*! \tparam Ch Character type (e.g. char, wchar_t, short) - \param s1 Null-terminated input string. - \param s2 Null-terminated input string. - \return 0 if equal -*/ -template -inline int StrCmp(const Ch* s1, const Ch* s2) { - RAPIDJSON_ASSERT(s1 != 0); - RAPIDJSON_ASSERT(s2 != 0); - while(*s1 && (*s1 == *s2)) { s1++; s2++; } - return static_cast(*s1) < static_cast(*s2) ? -1 : static_cast(*s1) > static_cast(*s2); -} - -//! Returns number of code points in a encoded string. -template -bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) { - RAPIDJSON_ASSERT(s != 0); - RAPIDJSON_ASSERT(outCount != 0); - GenericStringStream is(s); - const typename Encoding::Ch* end = s + length; - SizeType count = 0; - while (is.src_ < end) { - unsigned codepoint; - if (!Encoding::Decode(is, &codepoint)) - return false; - count++; - } - *outCount = count; - return true; -} - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_INTERNAL_STRFUNC_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/strtod.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/strtod.h deleted file mode 100644 index 62a42c6..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/strtod.h +++ /dev/null @@ -1,293 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_STRTOD_ -#define RAPIDJSON_STRTOD_ - -#include "ieee754.h" -#include "biginteger.h" -#include "diyfp.h" -#include "pow10.h" -#include -#include - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -inline double FastPath(double significand, int exp) { - if (exp < -308) - return 0.0; - else if (exp >= 0) - return significand * internal::Pow10(exp); - else - return significand / internal::Pow10(-exp); -} - -inline double StrtodNormalPrecision(double d, int p) { - if (p < -308) { - // Prevent expSum < -308, making Pow10(p) = 0 - d = FastPath(d, -308); - d = FastPath(d, p + 308); - } - else - d = FastPath(d, p); - return d; -} - -template -inline T Min3(T a, T b, T c) { - T m = a; - if (m > b) m = b; - if (m > c) m = c; - return m; -} - -inline int CheckWithinHalfULP(double b, const BigInteger& d, int dExp) { - const Double db(b); - const uint64_t bInt = db.IntegerSignificand(); - const int bExp = db.IntegerExponent(); - const int hExp = bExp - 1; - - int dS_Exp2 = 0, dS_Exp5 = 0, bS_Exp2 = 0, bS_Exp5 = 0, hS_Exp2 = 0, hS_Exp5 = 0; - - // Adjust for decimal exponent - if (dExp >= 0) { - dS_Exp2 += dExp; - dS_Exp5 += dExp; - } - else { - bS_Exp2 -= dExp; - bS_Exp5 -= dExp; - hS_Exp2 -= dExp; - hS_Exp5 -= dExp; - } - - // Adjust for binary exponent - if (bExp >= 0) - bS_Exp2 += bExp; - else { - dS_Exp2 -= bExp; - hS_Exp2 -= bExp; - } - - // Adjust for half ulp exponent - if (hExp >= 0) - hS_Exp2 += hExp; - else { - dS_Exp2 -= hExp; - bS_Exp2 -= hExp; - } - - // Remove common power of two factor from all three scaled values - int common_Exp2 = Min3(dS_Exp2, bS_Exp2, hS_Exp2); - dS_Exp2 -= common_Exp2; - bS_Exp2 -= common_Exp2; - hS_Exp2 -= common_Exp2; - - BigInteger dS = d; - dS.MultiplyPow5(static_cast(dS_Exp5)) <<= static_cast(dS_Exp2); - - BigInteger bS(bInt); - bS.MultiplyPow5(static_cast(bS_Exp5)) <<= static_cast(bS_Exp2); - - BigInteger hS(1); - hS.MultiplyPow5(static_cast(hS_Exp5)) <<= static_cast(hS_Exp2); - - BigInteger delta(0); - dS.Difference(bS, &delta); - - return delta.Compare(hS); -} - -inline bool StrtodFast(double d, int p, double* result) { - // Use fast path for string-to-double conversion if possible - // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ - if (p > 22 && p < 22 + 16) { - // Fast Path Cases In Disguise - d *= internal::Pow10(p - 22); - p = 22; - } - - if (p >= -22 && p <= 22 && d <= 9007199254740991.0) { // 2^53 - 1 - *result = FastPath(d, p); - return true; - } - else - return false; -} - -// Compute an approximation and see if it is within 1/2 ULP -template -inline bool StrtodDiyFp(const Ch* decimals, int dLen, int dExp, double* result) { - uint64_t significand = 0; - int i = 0; // 2^64 - 1 = 18446744073709551615, 1844674407370955161 = 0x1999999999999999 - for (; i < dLen; i++) { - if (significand > RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || - (significand == RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) && decimals[i] > Ch('5'))) - break; - significand = significand * 10u + static_cast(decimals[i] - Ch('0')); - } - - if (i < dLen && decimals[i] >= Ch('5')) // Rounding - significand++; - - int remaining = dLen - i; - const int kUlpShift = 3; - const int kUlp = 1 << kUlpShift; - int64_t error = (remaining == 0) ? 0 : kUlp / 2; - - DiyFp v(significand, 0); - v = v.Normalize(); - error <<= -v.e; - - dExp += remaining; - - int actualExp; - DiyFp cachedPower = GetCachedPower10(dExp, &actualExp); - if (actualExp != dExp) { - static const DiyFp kPow10[] = { - DiyFp(RAPIDJSON_UINT64_C2(0xa0000000, 0x00000000), -60), // 10^1 - DiyFp(RAPIDJSON_UINT64_C2(0xc8000000, 0x00000000), -57), // 10^2 - DiyFp(RAPIDJSON_UINT64_C2(0xfa000000, 0x00000000), -54), // 10^3 - DiyFp(RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), -50), // 10^4 - DiyFp(RAPIDJSON_UINT64_C2(0xc3500000, 0x00000000), -47), // 10^5 - DiyFp(RAPIDJSON_UINT64_C2(0xf4240000, 0x00000000), -44), // 10^6 - DiyFp(RAPIDJSON_UINT64_C2(0x98968000, 0x00000000), -40) // 10^7 - }; - int adjustment = dExp - actualExp; - RAPIDJSON_ASSERT(adjustment >= 1 && adjustment < 8); - v = v * kPow10[adjustment - 1]; - if (dLen + adjustment > 19) // has more digits than decimal digits in 64-bit - error += kUlp / 2; - } - - v = v * cachedPower; - - error += kUlp + (error == 0 ? 0 : 1); - - const int oldExp = v.e; - v = v.Normalize(); - error <<= oldExp - v.e; - - const int effectiveSignificandSize = Double::EffectiveSignificandSize(64 + v.e); - int precisionSize = 64 - effectiveSignificandSize; - if (precisionSize + kUlpShift >= 64) { - int scaleExp = (precisionSize + kUlpShift) - 63; - v.f >>= scaleExp; - v.e += scaleExp; - error = (error >> scaleExp) + 1 + kUlp; - precisionSize -= scaleExp; - } - - DiyFp rounded(v.f >> precisionSize, v.e + precisionSize); - const uint64_t precisionBits = (v.f & ((uint64_t(1) << precisionSize) - 1)) * kUlp; - const uint64_t halfWay = (uint64_t(1) << (precisionSize - 1)) * kUlp; - if (precisionBits >= halfWay + static_cast(error)) { - rounded.f++; - if (rounded.f & (DiyFp::kDpHiddenBit << 1)) { // rounding overflows mantissa (issue #340) - rounded.f >>= 1; - rounded.e++; - } - } - - *result = rounded.ToDouble(); - - return halfWay - static_cast(error) >= precisionBits || precisionBits >= halfWay + static_cast(error); -} - -template -inline double StrtodBigInteger(double approx, const Ch* decimals, int dLen, int dExp) { - RAPIDJSON_ASSERT(dLen >= 0); - const BigInteger dInt(decimals, static_cast(dLen)); - Double a(approx); - int cmp = CheckWithinHalfULP(a.Value(), dInt, dExp); - if (cmp < 0) - return a.Value(); // within half ULP - else if (cmp == 0) { - // Round towards even - if (a.Significand() & 1) - return a.NextPositiveDouble(); - else - return a.Value(); - } - else // adjustment - return a.NextPositiveDouble(); -} - -template -inline double StrtodFullPrecision(double d, int p, const Ch* decimals, size_t length, size_t decimalPosition, int exp) { - RAPIDJSON_ASSERT(d >= 0.0); - RAPIDJSON_ASSERT(length >= 1); - - double result = 0.0; - if (StrtodFast(d, p, &result)) - return result; - - RAPIDJSON_ASSERT(length <= INT_MAX); - int dLen = static_cast(length); - - RAPIDJSON_ASSERT(length >= decimalPosition); - RAPIDJSON_ASSERT(length - decimalPosition <= INT_MAX); - int dExpAdjust = static_cast(length - decimalPosition); - - RAPIDJSON_ASSERT(exp >= INT_MIN + dExpAdjust); - int dExp = exp - dExpAdjust; - - // Make sure length+dExp does not overflow - RAPIDJSON_ASSERT(dExp <= INT_MAX - dLen); - - // Trim leading zeros - while (dLen > 0 && *decimals == '0') { - dLen--; - decimals++; - } - - // Trim trailing zeros - while (dLen > 0 && decimals[dLen - 1] == '0') { - dLen--; - dExp++; - } - - if (dLen == 0) { // Buffer only contains zeros. - return 0.0; - } - - // Trim right-most digits - const int kMaxDecimalDigit = 767 + 1; - if (dLen > kMaxDecimalDigit) { - dExp += dLen - kMaxDecimalDigit; - dLen = kMaxDecimalDigit; - } - - // If too small, underflow to zero. - // Any x <= 10^-324 is interpreted as zero. - if (dLen + dExp <= -324) - return 0.0; - - // If too large, overflow to infinity. - // Any x >= 10^309 is interpreted as +infinity. - if (dLen + dExp > 309) - return std::numeric_limits::infinity(); - - if (StrtodDiyFp(decimals, dLen, dExp, &result)) - return result; - - // Use approximation from StrtodDiyFp and make adjustment with BigInteger comparison - return StrtodBigInteger(result, decimals, dLen, dExp); -} - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_STRTOD_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/swap.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/swap.h deleted file mode 100644 index 2cf92f9..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/internal/swap.h +++ /dev/null @@ -1,46 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_INTERNAL_SWAP_H_ -#define RAPIDJSON_INTERNAL_SWAP_H_ - -#include "../rapidjson.h" - -#if defined(__clang__) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(c++98-compat) -#endif - -RAPIDJSON_NAMESPACE_BEGIN -namespace internal { - -//! Custom swap() to avoid dependency on C++ header -/*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. - \note This has the same semantics as std::swap(). -*/ -template -inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT { - T tmp = a; - a = b; - b = tmp; -} - -} // namespace internal -RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_INTERNAL_SWAP_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/istreamwrapper.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/istreamwrapper.h deleted file mode 100644 index 23dd83e..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/istreamwrapper.h +++ /dev/null @@ -1,128 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_ISTREAMWRAPPER_H_ -#define RAPIDJSON_ISTREAMWRAPPER_H_ - -#include "stream.h" -#include -#include - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(padded) -#elif defined(_MSC_VER) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4351) // new behavior: elements of array 'array' will be default initialized -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! Wrapper of \c std::basic_istream into RapidJSON's Stream concept. -/*! - The classes can be wrapped including but not limited to: - - - \c std::istringstream - - \c std::stringstream - - \c std::wistringstream - - \c std::wstringstream - - \c std::ifstream - - \c std::fstream - - \c std::wifstream - - \c std::wfstream - - \tparam StreamType Class derived from \c std::basic_istream. -*/ - -template -class BasicIStreamWrapper { -public: - typedef typename StreamType::char_type Ch; - - //! Constructor. - /*! - \param stream stream opened for read. - */ - BasicIStreamWrapper(StreamType &stream) : stream_(stream), buffer_(peekBuffer_), bufferSize_(4), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { - Read(); - } - - //! Constructor. - /*! - \param stream stream opened for read. - \param buffer user-supplied buffer. - \param bufferSize size of buffer in bytes. Must >=4 bytes. - */ - BasicIStreamWrapper(StreamType &stream, char* buffer, size_t bufferSize) : stream_(stream), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { - RAPIDJSON_ASSERT(bufferSize >= 4); - Read(); - } - - Ch Peek() const { return *current_; } - Ch Take() { Ch c = *current_; Read(); return c; } - size_t Tell() const { return count_ + static_cast(current_ - buffer_); } - - // Not implemented - void Put(Ch) { RAPIDJSON_ASSERT(false); } - void Flush() { RAPIDJSON_ASSERT(false); } - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - - // For encoding detection only. - const Ch* Peek4() const { - return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; - } - -private: - BasicIStreamWrapper(); - BasicIStreamWrapper(const BasicIStreamWrapper&); - BasicIStreamWrapper& operator=(const BasicIStreamWrapper&); - - void Read() { - if (current_ < bufferLast_) - ++current_; - else if (!eof_) { - count_ += readCount_; - readCount_ = bufferSize_; - bufferLast_ = buffer_ + readCount_ - 1; - current_ = buffer_; - - if (!stream_.read(buffer_, static_cast(bufferSize_))) { - readCount_ = static_cast(stream_.gcount()); - *(bufferLast_ = buffer_ + readCount_) = '\0'; - eof_ = true; - } - } - } - - StreamType &stream_; - Ch peekBuffer_[4], *buffer_; - size_t bufferSize_; - Ch *bufferLast_; - Ch *current_; - size_t readCount_; - size_t count_; //!< Number of characters read - bool eof_; -}; - -typedef BasicIStreamWrapper IStreamWrapper; -typedef BasicIStreamWrapper WIStreamWrapper; - -#if defined(__clang__) || defined(_MSC_VER) -RAPIDJSON_DIAG_POP -#endif - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_ISTREAMWRAPPER_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/memorybuffer.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/memorybuffer.h deleted file mode 100644 index 14aad68..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/memorybuffer.h +++ /dev/null @@ -1,70 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_MEMORYBUFFER_H_ -#define RAPIDJSON_MEMORYBUFFER_H_ - -#include "stream.h" -#include "internal/stack.h" - -RAPIDJSON_NAMESPACE_BEGIN - -//! Represents an in-memory output byte stream. -/*! - This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream. - - It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file. - - Differences between MemoryBuffer and StringBuffer: - 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. - 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator. - - \tparam Allocator type for allocating memory buffer. - \note implements Stream concept -*/ -template -struct GenericMemoryBuffer { - typedef char Ch; // byte - - GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} - - void Put(Ch c) { *stack_.template Push() = c; } - void Flush() {} - - void Clear() { stack_.Clear(); } - void ShrinkToFit() { stack_.ShrinkToFit(); } - Ch* Push(size_t count) { return stack_.template Push(count); } - void Pop(size_t count) { stack_.template Pop(count); } - - const Ch* GetBuffer() const { - return stack_.template Bottom(); - } - - size_t GetSize() const { return stack_.GetSize(); } - - static const size_t kDefaultCapacity = 256; - mutable internal::Stack stack_; -}; - -typedef GenericMemoryBuffer<> MemoryBuffer; - -//! Implement specialized version of PutN() with memset() for better performance. -template<> -inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) { - std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c)); -} - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_MEMORYBUFFER_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/memorystream.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/memorystream.h deleted file mode 100644 index 1bc393f..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/memorystream.h +++ /dev/null @@ -1,71 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_MEMORYSTREAM_H_ -#define RAPIDJSON_MEMORYSTREAM_H_ - -#include "stream.h" - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(unreachable-code) -RAPIDJSON_DIAG_OFF(missing-noreturn) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! Represents an in-memory input byte stream. -/*! - This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream. - - It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file. - - Differences between MemoryStream and StringStream: - 1. StringStream has encoding but MemoryStream is a byte stream. - 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source. - 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4(). - \note implements Stream concept -*/ -struct MemoryStream { - typedef char Ch; // byte - - MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {} - - Ch Peek() const { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; } - Ch Take() { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; } - size_t Tell() const { return static_cast(src_ - begin_); } - - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - void Put(Ch) { RAPIDJSON_ASSERT(false); } - void Flush() { RAPIDJSON_ASSERT(false); } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - - // For encoding detection only. - const Ch* Peek4() const { - return Tell() + 4 <= size_ ? src_ : 0; - } - - const Ch* src_; //!< Current read position. - const Ch* begin_; //!< Original head of the string. - const Ch* end_; //!< End of stream. - size_t size_; //!< Size of the stream. -}; - -RAPIDJSON_NAMESPACE_END - -#ifdef __clang__ -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_MEMORYBUFFER_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/msinttypes/inttypes.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/msinttypes/inttypes.h deleted file mode 100644 index 1620402..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/msinttypes/inttypes.h +++ /dev/null @@ -1,316 +0,0 @@ -// ISO C9x compliant inttypes.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006-2013 Alexander Chemeris -// -// 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 product 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 AUTHOR ``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 AUTHOR 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. -// -/////////////////////////////////////////////////////////////////////////////// - -// The above software in this distribution may have been modified by -// THL A29 Limited ("Tencent Modifications"). -// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. - -#ifndef _MSC_VER // [ -#error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] - -#ifndef _MSC_INTTYPES_H_ // [ -#define _MSC_INTTYPES_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#include "stdint.h" - -// miloyip: VC supports inttypes.h since VC2013 -#if _MSC_VER >= 1800 -#include -#else - -// 7.8 Format conversion of integer types - -typedef struct { - intmax_t quot; - intmax_t rem; -} imaxdiv_t; - -// 7.8.1 Macros for format specifiers - -#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 - -// The fprintf macros for signed integers are: -#define PRId8 "d" -#define PRIi8 "i" -#define PRIdLEAST8 "d" -#define PRIiLEAST8 "i" -#define PRIdFAST8 "d" -#define PRIiFAST8 "i" - -#define PRId16 "hd" -#define PRIi16 "hi" -#define PRIdLEAST16 "hd" -#define PRIiLEAST16 "hi" -#define PRIdFAST16 "hd" -#define PRIiFAST16 "hi" - -#define PRId32 "I32d" -#define PRIi32 "I32i" -#define PRIdLEAST32 "I32d" -#define PRIiLEAST32 "I32i" -#define PRIdFAST32 "I32d" -#define PRIiFAST32 "I32i" - -#define PRId64 "I64d" -#define PRIi64 "I64i" -#define PRIdLEAST64 "I64d" -#define PRIiLEAST64 "I64i" -#define PRIdFAST64 "I64d" -#define PRIiFAST64 "I64i" - -#define PRIdMAX "I64d" -#define PRIiMAX "I64i" - -#define PRIdPTR "Id" -#define PRIiPTR "Ii" - -// The fprintf macros for unsigned integers are: -#define PRIo8 "o" -#define PRIu8 "u" -#define PRIx8 "x" -#define PRIX8 "X" -#define PRIoLEAST8 "o" -#define PRIuLEAST8 "u" -#define PRIxLEAST8 "x" -#define PRIXLEAST8 "X" -#define PRIoFAST8 "o" -#define PRIuFAST8 "u" -#define PRIxFAST8 "x" -#define PRIXFAST8 "X" - -#define PRIo16 "ho" -#define PRIu16 "hu" -#define PRIx16 "hx" -#define PRIX16 "hX" -#define PRIoLEAST16 "ho" -#define PRIuLEAST16 "hu" -#define PRIxLEAST16 "hx" -#define PRIXLEAST16 "hX" -#define PRIoFAST16 "ho" -#define PRIuFAST16 "hu" -#define PRIxFAST16 "hx" -#define PRIXFAST16 "hX" - -#define PRIo32 "I32o" -#define PRIu32 "I32u" -#define PRIx32 "I32x" -#define PRIX32 "I32X" -#define PRIoLEAST32 "I32o" -#define PRIuLEAST32 "I32u" -#define PRIxLEAST32 "I32x" -#define PRIXLEAST32 "I32X" -#define PRIoFAST32 "I32o" -#define PRIuFAST32 "I32u" -#define PRIxFAST32 "I32x" -#define PRIXFAST32 "I32X" - -#define PRIo64 "I64o" -#define PRIu64 "I64u" -#define PRIx64 "I64x" -#define PRIX64 "I64X" -#define PRIoLEAST64 "I64o" -#define PRIuLEAST64 "I64u" -#define PRIxLEAST64 "I64x" -#define PRIXLEAST64 "I64X" -#define PRIoFAST64 "I64o" -#define PRIuFAST64 "I64u" -#define PRIxFAST64 "I64x" -#define PRIXFAST64 "I64X" - -#define PRIoMAX "I64o" -#define PRIuMAX "I64u" -#define PRIxMAX "I64x" -#define PRIXMAX "I64X" - -#define PRIoPTR "Io" -#define PRIuPTR "Iu" -#define PRIxPTR "Ix" -#define PRIXPTR "IX" - -// The fscanf macros for signed integers are: -#define SCNd8 "d" -#define SCNi8 "i" -#define SCNdLEAST8 "d" -#define SCNiLEAST8 "i" -#define SCNdFAST8 "d" -#define SCNiFAST8 "i" - -#define SCNd16 "hd" -#define SCNi16 "hi" -#define SCNdLEAST16 "hd" -#define SCNiLEAST16 "hi" -#define SCNdFAST16 "hd" -#define SCNiFAST16 "hi" - -#define SCNd32 "ld" -#define SCNi32 "li" -#define SCNdLEAST32 "ld" -#define SCNiLEAST32 "li" -#define SCNdFAST32 "ld" -#define SCNiFAST32 "li" - -#define SCNd64 "I64d" -#define SCNi64 "I64i" -#define SCNdLEAST64 "I64d" -#define SCNiLEAST64 "I64i" -#define SCNdFAST64 "I64d" -#define SCNiFAST64 "I64i" - -#define SCNdMAX "I64d" -#define SCNiMAX "I64i" - -#ifdef _WIN64 // [ -# define SCNdPTR "I64d" -# define SCNiPTR "I64i" -#else // _WIN64 ][ -# define SCNdPTR "ld" -# define SCNiPTR "li" -#endif // _WIN64 ] - -// The fscanf macros for unsigned integers are: -#define SCNo8 "o" -#define SCNu8 "u" -#define SCNx8 "x" -#define SCNX8 "X" -#define SCNoLEAST8 "o" -#define SCNuLEAST8 "u" -#define SCNxLEAST8 "x" -#define SCNXLEAST8 "X" -#define SCNoFAST8 "o" -#define SCNuFAST8 "u" -#define SCNxFAST8 "x" -#define SCNXFAST8 "X" - -#define SCNo16 "ho" -#define SCNu16 "hu" -#define SCNx16 "hx" -#define SCNX16 "hX" -#define SCNoLEAST16 "ho" -#define SCNuLEAST16 "hu" -#define SCNxLEAST16 "hx" -#define SCNXLEAST16 "hX" -#define SCNoFAST16 "ho" -#define SCNuFAST16 "hu" -#define SCNxFAST16 "hx" -#define SCNXFAST16 "hX" - -#define SCNo32 "lo" -#define SCNu32 "lu" -#define SCNx32 "lx" -#define SCNX32 "lX" -#define SCNoLEAST32 "lo" -#define SCNuLEAST32 "lu" -#define SCNxLEAST32 "lx" -#define SCNXLEAST32 "lX" -#define SCNoFAST32 "lo" -#define SCNuFAST32 "lu" -#define SCNxFAST32 "lx" -#define SCNXFAST32 "lX" - -#define SCNo64 "I64o" -#define SCNu64 "I64u" -#define SCNx64 "I64x" -#define SCNX64 "I64X" -#define SCNoLEAST64 "I64o" -#define SCNuLEAST64 "I64u" -#define SCNxLEAST64 "I64x" -#define SCNXLEAST64 "I64X" -#define SCNoFAST64 "I64o" -#define SCNuFAST64 "I64u" -#define SCNxFAST64 "I64x" -#define SCNXFAST64 "I64X" - -#define SCNoMAX "I64o" -#define SCNuMAX "I64u" -#define SCNxMAX "I64x" -#define SCNXMAX "I64X" - -#ifdef _WIN64 // [ -# define SCNoPTR "I64o" -# define SCNuPTR "I64u" -# define SCNxPTR "I64x" -# define SCNXPTR "I64X" -#else // _WIN64 ][ -# define SCNoPTR "lo" -# define SCNuPTR "lu" -# define SCNxPTR "lx" -# define SCNXPTR "lX" -#endif // _WIN64 ] - -#endif // __STDC_FORMAT_MACROS ] - -// 7.8.2 Functions for greatest-width integer types - -// 7.8.2.1 The imaxabs function -#define imaxabs _abs64 - -// 7.8.2.2 The imaxdiv function - -// This is modified version of div() function from Microsoft's div.c found -// in %MSVC.NET%\crt\src\div.c -#ifdef STATIC_IMAXDIV // [ -static -#else // STATIC_IMAXDIV ][ -_inline -#endif // STATIC_IMAXDIV ] -imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) -{ - imaxdiv_t result; - - result.quot = numer / denom; - result.rem = numer % denom; - - if (numer < 0 && result.rem > 0) { - // did division wrong; must fix up - ++result.quot; - result.rem -= denom; - } - - return result; -} - -// 7.8.2.3 The strtoimax and strtoumax functions -#define strtoimax _strtoi64 -#define strtoumax _strtoui64 - -// 7.8.2.4 The wcstoimax and wcstoumax functions -#define wcstoimax _wcstoi64 -#define wcstoumax _wcstoui64 - -#endif // _MSC_VER >= 1800 - -#endif // _MSC_INTTYPES_H_ ] diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/msinttypes/stdint.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/msinttypes/stdint.h deleted file mode 100644 index 1c266ec..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/msinttypes/stdint.h +++ /dev/null @@ -1,300 +0,0 @@ -// ISO C9x compliant stdint.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006-2013 Alexander Chemeris -// -// 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 product 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 AUTHOR ``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 AUTHOR 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. -// -/////////////////////////////////////////////////////////////////////////////// - -// The above software in this distribution may have been modified by -// THL A29 Limited ("Tencent Modifications"). -// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. - -#ifndef _MSC_VER // [ -#error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] - -#ifndef _MSC_STDINT_H_ // [ -#define _MSC_STDINT_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -// miloyip: Originally Visual Studio 2010 uses its own stdint.h. However it generates warning with INT64_C(), so change to use this file for vs2010. -#if _MSC_VER >= 1600 // [ -#include - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 - -#undef INT8_C -#undef INT16_C -#undef INT32_C -#undef INT64_C -#undef UINT8_C -#undef UINT16_C -#undef UINT32_C -#undef UINT64_C - -// 7.18.4.1 Macros for minimum-width integer constants - -#define INT8_C(val) val##i8 -#define INT16_C(val) val##i16 -#define INT32_C(val) val##i32 -#define INT64_C(val) val##i64 - -#define UINT8_C(val) val##ui8 -#define UINT16_C(val) val##ui16 -#define UINT32_C(val) val##ui32 -#define UINT64_C(val) val##ui64 - -// 7.18.4.2 Macros for greatest-width integer constants -// These #ifndef's are needed to prevent collisions with . -// Check out Issue 9 for the details. -#ifndef INTMAX_C // [ -# define INTMAX_C INT64_C -#endif // INTMAX_C ] -#ifndef UINTMAX_C // [ -# define UINTMAX_C UINT64_C -#endif // UINTMAX_C ] - -#endif // __STDC_CONSTANT_MACROS ] - -#else // ] _MSC_VER >= 1700 [ - -#include - -// For Visual Studio 6 in C++ mode and for many Visual Studio versions when -// compiling for ARM we have to wrap include with 'extern "C++" {}' -// or compiler would give many errors like this: -// error C2733: second C linkage of overloaded function 'wmemchr' not allowed -#if defined(__cplusplus) && !defined(_M_ARM) -extern "C" { -#endif -# include -#if defined(__cplusplus) && !defined(_M_ARM) -} -#endif - -// Define _W64 macros to mark types changing their size, like intptr_t. -#ifndef _W64 -# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 -# define _W64 __w64 -# else -# define _W64 -# endif -#endif - - -// 7.18.1 Integer types - -// 7.18.1.1 Exact-width integer types - -// Visual Studio 6 and Embedded Visual C++ 4 doesn't -// realize that, e.g. char has the same size as __int8 -// so we give up on __intX for them. -#if (_MSC_VER < 1300) - typedef signed char int8_t; - typedef signed short int16_t; - typedef signed int int32_t; - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; -#else - typedef signed __int8 int8_t; - typedef signed __int16 int16_t; - typedef signed __int32 int32_t; - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; -#endif -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; - - -// 7.18.1.2 Minimum-width integer types -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -typedef int64_t int_least64_t; -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -typedef uint64_t uint_least64_t; - -// 7.18.1.3 Fastest minimum-width integer types -typedef int8_t int_fast8_t; -typedef int16_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef int64_t int_fast64_t; -typedef uint8_t uint_fast8_t; -typedef uint16_t uint_fast16_t; -typedef uint32_t uint_fast32_t; -typedef uint64_t uint_fast64_t; - -// 7.18.1.4 Integer types capable of holding object pointers -#ifdef _WIN64 // [ - typedef signed __int64 intptr_t; - typedef unsigned __int64 uintptr_t; -#else // _WIN64 ][ - typedef _W64 signed int intptr_t; - typedef _W64 unsigned int uintptr_t; -#endif // _WIN64 ] - -// 7.18.1.5 Greatest-width integer types -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; - - -// 7.18.2 Limits of specified-width integer types - -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 - -// 7.18.2.1 Limits of exact-width integer types -#define INT8_MIN ((int8_t)_I8_MIN) -#define INT8_MAX _I8_MAX -#define INT16_MIN ((int16_t)_I16_MIN) -#define INT16_MAX _I16_MAX -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX -#define UINT8_MAX _UI8_MAX -#define UINT16_MAX _UI16_MAX -#define UINT32_MAX _UI32_MAX -#define UINT64_MAX _UI64_MAX - -// 7.18.2.2 Limits of minimum-width integer types -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MIN INT64_MIN -#define INT_LEAST64_MAX INT64_MAX -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -// 7.18.2.3 Limits of fastest minimum-width integer types -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MIN INT64_MIN -#define INT_FAST64_MAX INT64_MAX -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -// 7.18.2.4 Limits of integer types capable of holding object pointers -#ifdef _WIN64 // [ -# define INTPTR_MIN INT64_MIN -# define INTPTR_MAX INT64_MAX -# define UINTPTR_MAX UINT64_MAX -#else // _WIN64 ][ -# define INTPTR_MIN INT32_MIN -# define INTPTR_MAX INT32_MAX -# define UINTPTR_MAX UINT32_MAX -#endif // _WIN64 ] - -// 7.18.2.5 Limits of greatest-width integer types -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -// 7.18.3 Limits of other integer types - -#ifdef _WIN64 // [ -# define PTRDIFF_MIN _I64_MIN -# define PTRDIFF_MAX _I64_MAX -#else // _WIN64 ][ -# define PTRDIFF_MIN _I32_MIN -# define PTRDIFF_MAX _I32_MAX -#endif // _WIN64 ] - -#define SIG_ATOMIC_MIN INT_MIN -#define SIG_ATOMIC_MAX INT_MAX - -#ifndef SIZE_MAX // [ -# ifdef _WIN64 // [ -# define SIZE_MAX _UI64_MAX -# else // _WIN64 ][ -# define SIZE_MAX _UI32_MAX -# endif // _WIN64 ] -#endif // SIZE_MAX ] - -// WCHAR_MIN and WCHAR_MAX are also defined in -#ifndef WCHAR_MIN // [ -# define WCHAR_MIN 0 -#endif // WCHAR_MIN ] -#ifndef WCHAR_MAX // [ -# define WCHAR_MAX _UI16_MAX -#endif // WCHAR_MAX ] - -#define WINT_MIN 0 -#define WINT_MAX _UI16_MAX - -#endif // __STDC_LIMIT_MACROS ] - - -// 7.18.4 Limits of other integer types - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 - -// 7.18.4.1 Macros for minimum-width integer constants - -#define INT8_C(val) val##i8 -#define INT16_C(val) val##i16 -#define INT32_C(val) val##i32 -#define INT64_C(val) val##i64 - -#define UINT8_C(val) val##ui8 -#define UINT16_C(val) val##ui16 -#define UINT32_C(val) val##ui32 -#define UINT64_C(val) val##ui64 - -// 7.18.4.2 Macros for greatest-width integer constants -// These #ifndef's are needed to prevent collisions with . -// Check out Issue 9 for the details. -#ifndef INTMAX_C // [ -# define INTMAX_C INT64_C -#endif // INTMAX_C ] -#ifndef UINTMAX_C // [ -# define UINTMAX_C UINT64_C -#endif // UINTMAX_C ] - -#endif // __STDC_CONSTANT_MACROS ] - -#endif // _MSC_VER >= 1600 ] - -#endif // _MSC_STDINT_H_ ] diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/ostreamwrapper.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/ostreamwrapper.h deleted file mode 100644 index bfd4d6d..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/ostreamwrapper.h +++ /dev/null @@ -1,81 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_OSTREAMWRAPPER_H_ -#define RAPIDJSON_OSTREAMWRAPPER_H_ - -#include "stream.h" -#include - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(padded) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept. -/*! - The classes can be wrapped including but not limited to: - - - \c std::ostringstream - - \c std::stringstream - - \c std::wpstringstream - - \c std::wstringstream - - \c std::ifstream - - \c std::fstream - - \c std::wofstream - - \c std::wfstream - - \tparam StreamType Class derived from \c std::basic_ostream. -*/ - -template -class BasicOStreamWrapper { -public: - typedef typename StreamType::char_type Ch; - BasicOStreamWrapper(StreamType& stream) : stream_(stream) {} - - void Put(Ch c) { - stream_.put(c); - } - - void Flush() { - stream_.flush(); - } - - // Not implemented - char Peek() const { RAPIDJSON_ASSERT(false); return 0; } - char Take() { RAPIDJSON_ASSERT(false); return 0; } - size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } - char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } - -private: - BasicOStreamWrapper(const BasicOStreamWrapper&); - BasicOStreamWrapper& operator=(const BasicOStreamWrapper&); - - StreamType& stream_; -}; - -typedef BasicOStreamWrapper OStreamWrapper; -typedef BasicOStreamWrapper WOStreamWrapper; - -#ifdef __clang__ -RAPIDJSON_DIAG_POP -#endif - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_OSTREAMWRAPPER_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/pointer.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/pointer.h deleted file mode 100644 index d0d762d..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/pointer.h +++ /dev/null @@ -1,1470 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_POINTER_H_ -#define RAPIDJSON_POINTER_H_ - -#include "document.h" -#include "uri.h" -#include "internal/itoa.h" -#include "error/error.h" // PointerParseErrorCode - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(switch-enum) -#elif defined(_MSC_VER) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -static const SizeType kPointerInvalidIndex = ~SizeType(0); //!< Represents an invalid index in GenericPointer::Token - -/////////////////////////////////////////////////////////////////////////////// -// GenericPointer - -//! Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator. -/*! - This class implements RFC 6901 "JavaScript Object Notation (JSON) Pointer" - (https://tools.ietf.org/html/rfc6901). - - A JSON pointer is for identifying a specific value in a JSON document - (GenericDocument). It can simplify coding of DOM tree manipulation, because it - can access multiple-level depth of DOM tree with single API call. - - After it parses a string representation (e.g. "/foo/0" or URI fragment - representation (e.g. "#/foo/0") into its internal representation (tokens), - it can be used to resolve a specific value in multiple documents, or sub-tree - of documents. - - Contrary to GenericValue, Pointer can be copy constructed and copy assigned. - Apart from assignment, a Pointer cannot be modified after construction. - - Although Pointer is very convenient, please aware that constructing Pointer - involves parsing and dynamic memory allocation. A special constructor with user- - supplied tokens eliminates these. - - GenericPointer depends on GenericDocument and GenericValue. - - \tparam ValueType The value type of the DOM tree. E.g. GenericValue > - \tparam Allocator The allocator type for allocating memory for internal representation. - - \note GenericPointer uses same encoding of ValueType. - However, Allocator of GenericPointer is independent of Allocator of Value. -*/ -template -class GenericPointer { -public: - typedef typename ValueType::EncodingType EncodingType; //!< Encoding type from Value - typedef typename ValueType::Ch Ch; //!< Character type from Value - typedef GenericUri UriType; - - - //! A token is the basic units of internal representation. - /*! - A JSON pointer string representation "/foo/123" is parsed to two tokens: - "foo" and 123. 123 will be represented in both numeric form and string form. - They are resolved according to the actual value type (object or array). - - For token that are not numbers, or the numeric value is out of bound - (greater than limits of SizeType), they are only treated as string form - (i.e. the token's index will be equal to kPointerInvalidIndex). - - This struct is public so that user can create a Pointer without parsing and - allocation, using a special constructor. - */ - struct Token { - const Ch* name; //!< Name of the token. It has null character at the end but it can contain null character. - SizeType length; //!< Length of the name. - SizeType index; //!< A valid array index, if it is not equal to kPointerInvalidIndex. - }; - - //!@name Constructors and destructor. - //@{ - - //! Default constructor. - GenericPointer(Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {} - - //! Constructor that parses a string or URI fragment representation. - /*! - \param source A null-terminated, string or URI fragment representation of JSON pointer. - \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. - */ - explicit GenericPointer(const Ch* source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { - Parse(source, internal::StrLen(source)); - } - -#if RAPIDJSON_HAS_STDSTRING - //! Constructor that parses a string or URI fragment representation. - /*! - \param source A string or URI fragment representation of JSON pointer. - \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. - \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. - */ - explicit GenericPointer(const std::basic_string& source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { - Parse(source.c_str(), source.size()); - } -#endif - - //! Constructor that parses a string or URI fragment representation, with length of the source string. - /*! - \param source A string or URI fragment representation of JSON pointer. - \param length Length of source. - \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. - \note Slightly faster than the overload without length. - */ - GenericPointer(const Ch* source, size_t length, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { - Parse(source, length); - } - - //! Constructor with user-supplied tokens. - /*! - This constructor let user supplies const array of tokens. - This prevents the parsing process and eliminates allocation. - This is preferred for memory constrained environments. - - \param tokens An constant array of tokens representing the JSON pointer. - \param tokenCount Number of tokens. - - \b Example - \code - #define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex } - #define INDEX(i) { #i, sizeof(#i) - 1, i } - - static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) }; - static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0])); - // Equivalent to static const Pointer p("/foo/123"); - - #undef NAME - #undef INDEX - \endcode - */ - GenericPointer(const Token* tokens, size_t tokenCount) : allocator_(), ownAllocator_(), nameBuffer_(), tokens_(const_cast(tokens)), tokenCount_(tokenCount), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {} - - //! Copy constructor. - GenericPointer(const GenericPointer& rhs) : allocator_(), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { - *this = rhs; - } - - //! Copy constructor. - GenericPointer(const GenericPointer& rhs, Allocator* allocator) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { - *this = rhs; - } - - //! Destructor. - ~GenericPointer() { - if (nameBuffer_) // If user-supplied tokens constructor is used, nameBuffer_ is nullptr and tokens_ are not deallocated. - Allocator::Free(tokens_); - RAPIDJSON_DELETE(ownAllocator_); - } - - //! Assignment operator. - GenericPointer& operator=(const GenericPointer& rhs) { - if (this != &rhs) { - // Do not delete ownAllocator - if (nameBuffer_) - Allocator::Free(tokens_); - - tokenCount_ = rhs.tokenCount_; - parseErrorOffset_ = rhs.parseErrorOffset_; - parseErrorCode_ = rhs.parseErrorCode_; - - if (rhs.nameBuffer_) - CopyFromRaw(rhs); // Normally parsed tokens. - else { - tokens_ = rhs.tokens_; // User supplied const tokens. - nameBuffer_ = 0; - } - } - return *this; - } - - //! Swap the content of this pointer with another. - /*! - \param other The pointer to swap with. - \note Constant complexity. - */ - GenericPointer& Swap(GenericPointer& other) RAPIDJSON_NOEXCEPT { - internal::Swap(allocator_, other.allocator_); - internal::Swap(ownAllocator_, other.ownAllocator_); - internal::Swap(nameBuffer_, other.nameBuffer_); - internal::Swap(tokens_, other.tokens_); - internal::Swap(tokenCount_, other.tokenCount_); - internal::Swap(parseErrorOffset_, other.parseErrorOffset_); - internal::Swap(parseErrorCode_, other.parseErrorCode_); - return *this; - } - - //! free-standing swap function helper - /*! - Helper function to enable support for common swap implementation pattern based on \c std::swap: - \code - void swap(MyClass& a, MyClass& b) { - using std::swap; - swap(a.pointer, b.pointer); - // ... - } - \endcode - \see Swap() - */ - friend inline void swap(GenericPointer& a, GenericPointer& b) RAPIDJSON_NOEXCEPT { a.Swap(b); } - - //@} - - //!@name Append token - //@{ - - //! Append a token and return a new Pointer - /*! - \param token Token to be appended. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - GenericPointer Append(const Token& token, Allocator* allocator = 0) const { - GenericPointer r; - r.allocator_ = allocator; - Ch *p = r.CopyFromRaw(*this, 1, token.length + 1); - std::memcpy(p, token.name, (token.length + 1) * sizeof(Ch)); - r.tokens_[tokenCount_].name = p; - r.tokens_[tokenCount_].length = token.length; - r.tokens_[tokenCount_].index = token.index; - return r; - } - - //! Append a name token with length, and return a new Pointer - /*! - \param name Name to be appended. - \param length Length of name. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - GenericPointer Append(const Ch* name, SizeType length, Allocator* allocator = 0) const { - Token token = { name, length, kPointerInvalidIndex }; - return Append(token, allocator); - } - - //! Append a name token without length, and return a new Pointer - /*! - \param name Name (const Ch*) to be appended. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >), (GenericPointer)) - Append(T* name, Allocator* allocator = 0) const { - return Append(name, internal::StrLen(name), allocator); - } - -#if RAPIDJSON_HAS_STDSTRING - //! Append a name token, and return a new Pointer - /*! - \param name Name to be appended. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - GenericPointer Append(const std::basic_string& name, Allocator* allocator = 0) const { - return Append(name.c_str(), static_cast(name.size()), allocator); - } -#endif - - //! Append a index token, and return a new Pointer - /*! - \param index Index to be appended. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - GenericPointer Append(SizeType index, Allocator* allocator = 0) const { - char buffer[21]; - char* end = sizeof(SizeType) == 4 ? internal::u32toa(index, buffer) : internal::u64toa(index, buffer); - SizeType length = static_cast(end - buffer); - buffer[length] = '\0'; - - if (sizeof(Ch) == 1) { - Token token = { reinterpret_cast(buffer), length, index }; - return Append(token, allocator); - } - else { - Ch name[21]; - for (size_t i = 0; i <= length; i++) - name[i] = static_cast(buffer[i]); - Token token = { name, length, index }; - return Append(token, allocator); - } - } - - //! Append a token by value, and return a new Pointer - /*! - \param token token to be appended. - \param allocator Allocator for the newly return Pointer. - \return A new Pointer with appended token. - */ - GenericPointer Append(const ValueType& token, Allocator* allocator = 0) const { - if (token.IsString()) - return Append(token.GetString(), token.GetStringLength(), allocator); - else { - RAPIDJSON_ASSERT(token.IsUint64()); - RAPIDJSON_ASSERT(token.GetUint64() <= SizeType(~0)); - return Append(static_cast(token.GetUint64()), allocator); - } - } - - //!@name Handling Parse Error - //@{ - - //! Check whether this is a valid pointer. - bool IsValid() const { return parseErrorCode_ == kPointerParseErrorNone; } - - //! Get the parsing error offset in code unit. - size_t GetParseErrorOffset() const { return parseErrorOffset_; } - - //! Get the parsing error code. - PointerParseErrorCode GetParseErrorCode() const { return parseErrorCode_; } - - //@} - - //! Get the allocator of this pointer. - Allocator& GetAllocator() { return *allocator_; } - - //!@name Tokens - //@{ - - //! Get the token array (const version only). - const Token* GetTokens() const { return tokens_; } - - //! Get the number of tokens. - size_t GetTokenCount() const { return tokenCount_; } - - //@} - - //!@name Equality/inequality operators - //@{ - - //! Equality operator. - /*! - \note When any pointers are invalid, always returns false. - */ - bool operator==(const GenericPointer& rhs) const { - if (!IsValid() || !rhs.IsValid() || tokenCount_ != rhs.tokenCount_) - return false; - - for (size_t i = 0; i < tokenCount_; i++) { - if (tokens_[i].index != rhs.tokens_[i].index || - tokens_[i].length != rhs.tokens_[i].length || - (tokens_[i].length != 0 && std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch)* tokens_[i].length) != 0)) - { - return false; - } - } - - return true; - } - - //! Inequality operator. - /*! - \note When any pointers are invalid, always returns true. - */ - bool operator!=(const GenericPointer& rhs) const { return !(*this == rhs); } - - //! Less than operator. - /*! - \note Invalid pointers are always greater than valid ones. - */ - bool operator<(const GenericPointer& rhs) const { - if (!IsValid()) - return false; - if (!rhs.IsValid()) - return true; - - if (tokenCount_ != rhs.tokenCount_) - return tokenCount_ < rhs.tokenCount_; - - for (size_t i = 0; i < tokenCount_; i++) { - if (tokens_[i].index != rhs.tokens_[i].index) - return tokens_[i].index < rhs.tokens_[i].index; - - if (tokens_[i].length != rhs.tokens_[i].length) - return tokens_[i].length < rhs.tokens_[i].length; - - if (int cmp = std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch) * tokens_[i].length)) - return cmp < 0; - } - - return false; - } - - //@} - - //!@name Stringify - //@{ - - //! Stringify the pointer into string representation. - /*! - \tparam OutputStream Type of output stream. - \param os The output stream. - */ - template - bool Stringify(OutputStream& os) const { - return Stringify(os); - } - - //! Stringify the pointer into URI fragment representation. - /*! - \tparam OutputStream Type of output stream. - \param os The output stream. - */ - template - bool StringifyUriFragment(OutputStream& os) const { - return Stringify(os); - } - - //@} - - //!@name Create value - //@{ - - //! Create a value in a subtree. - /*! - If the value is not exist, it creates all parent values and a JSON Null value. - So it always succeed and return the newly created or existing value. - - Remind that it may change types of parents according to tokens, so it - potentially removes previously stored values. For example, if a document - was an array, and "/foo" is used to create a value, then the document - will be changed to an object, and all existing array elements are lost. - - \param root Root value of a DOM subtree to be resolved. It can be any value other than document root. - \param allocator Allocator for creating the values if the specified value or its parents are not exist. - \param alreadyExist If non-null, it stores whether the resolved value is already exist. - \return The resolved newly created (a JSON Null value), or already exists value. - */ - ValueType& Create(ValueType& root, typename ValueType::AllocatorType& allocator, bool* alreadyExist = 0) const { - RAPIDJSON_ASSERT(IsValid()); - ValueType* v = &root; - bool exist = true; - for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { - if (v->IsArray() && t->name[0] == '-' && t->length == 1) { - v->PushBack(ValueType().Move(), allocator); - v = &((*v)[v->Size() - 1]); - exist = false; - } - else { - if (t->index == kPointerInvalidIndex) { // must be object name - if (!v->IsObject()) - v->SetObject(); // Change to Object - } - else { // object name or array index - if (!v->IsArray() && !v->IsObject()) - v->SetArray(); // Change to Array - } - - if (v->IsArray()) { - if (t->index >= v->Size()) { - v->Reserve(t->index + 1, allocator); - while (t->index >= v->Size()) - v->PushBack(ValueType().Move(), allocator); - exist = false; - } - v = &((*v)[t->index]); - } - else { - typename ValueType::MemberIterator m = v->FindMember(GenericValue(GenericStringRef(t->name, t->length))); - if (m == v->MemberEnd()) { - v->AddMember(ValueType(t->name, t->length, allocator).Move(), ValueType().Move(), allocator); - m = v->MemberEnd(); - v = &(--m)->value; // Assumes AddMember() appends at the end - exist = false; - } - else - v = &m->value; - } - } - } - - if (alreadyExist) - *alreadyExist = exist; - - return *v; - } - - //! Creates a value in a document. - /*! - \param document A document to be resolved. - \param alreadyExist If non-null, it stores whether the resolved value is already exist. - \return The resolved newly created, or already exists value. - */ - template - ValueType& Create(GenericDocument& document, bool* alreadyExist = 0) const { - return Create(document, document.GetAllocator(), alreadyExist); - } - - //@} - - //!@name Compute URI - //@{ - - //! Compute the in-scope URI for a subtree. - // For use with JSON pointers into JSON schema documents. - /*! - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \param rootUri Root URI - \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token. - \param allocator Allocator for Uris - \return Uri if it can be resolved. Otherwise null. - - \note - There are only 3 situations when a URI cannot be resolved: - 1. A value in the path is neither an array nor object. - 2. An object value does not contain the token. - 3. A token is out of range of an array value. - - Use unresolvedTokenIndex to retrieve the token index. - */ - UriType GetUri(ValueType& root, const UriType& rootUri, size_t* unresolvedTokenIndex = 0, Allocator* allocator = 0) const { - static const Ch kIdString[] = { 'i', 'd', '\0' }; - static const ValueType kIdValue(kIdString, 2); - UriType base = UriType(rootUri, allocator); - RAPIDJSON_ASSERT(IsValid()); - ValueType* v = &root; - for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { - switch (v->GetType()) { - case kObjectType: - { - // See if we have an id, and if so resolve with the current base - typename ValueType::MemberIterator m = v->FindMember(kIdValue); - if (m != v->MemberEnd() && (m->value).IsString()) { - UriType here = UriType(m->value, allocator).Resolve(base, allocator); - base = here; - } - m = v->FindMember(GenericValue(GenericStringRef(t->name, t->length))); - if (m == v->MemberEnd()) - break; - v = &m->value; - } - continue; - case kArrayType: - if (t->index == kPointerInvalidIndex || t->index >= v->Size()) - break; - v = &((*v)[t->index]); - continue; - default: - break; - } - - // Error: unresolved token - if (unresolvedTokenIndex) - *unresolvedTokenIndex = static_cast(t - tokens_); - return UriType(allocator); - } - return base; - } - - UriType GetUri(const ValueType& root, const UriType& rootUri, size_t* unresolvedTokenIndex = 0, Allocator* allocator = 0) const { - return GetUri(const_cast(root), rootUri, unresolvedTokenIndex, allocator); - } - - - //!@name Query value - //@{ - - //! Query a value in a subtree. - /*! - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token. - \return Pointer to the value if it can be resolved. Otherwise null. - - \note - There are only 3 situations when a value cannot be resolved: - 1. A value in the path is neither an array nor object. - 2. An object value does not contain the token. - 3. A token is out of range of an array value. - - Use unresolvedTokenIndex to retrieve the token index. - */ - ValueType* Get(ValueType& root, size_t* unresolvedTokenIndex = 0) const { - RAPIDJSON_ASSERT(IsValid()); - ValueType* v = &root; - for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { - switch (v->GetType()) { - case kObjectType: - { - typename ValueType::MemberIterator m = v->FindMember(GenericValue(GenericStringRef(t->name, t->length))); - if (m == v->MemberEnd()) - break; - v = &m->value; - } - continue; - case kArrayType: - if (t->index == kPointerInvalidIndex || t->index >= v->Size()) - break; - v = &((*v)[t->index]); - continue; - default: - break; - } - - // Error: unresolved token - if (unresolvedTokenIndex) - *unresolvedTokenIndex = static_cast(t - tokens_); - return 0; - } - return v; - } - - //! Query a const value in a const subtree. - /*! - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \return Pointer to the value if it can be resolved. Otherwise null. - */ - const ValueType* Get(const ValueType& root, size_t* unresolvedTokenIndex = 0) const { - return Get(const_cast(root), unresolvedTokenIndex); - } - - //@} - - //!@name Query a value with default - //@{ - - //! Query a value in a subtree with default value. - /*! - Similar to Get(), but if the specified value do not exists, it creates all parents and clone the default value. - So that this function always succeed. - - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \param defaultValue Default value to be cloned if the value was not exists. - \param allocator Allocator for creating the values if the specified value or its parents are not exist. - \see Create() - */ - ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const { - bool alreadyExist; - ValueType& v = Create(root, allocator, &alreadyExist); - return alreadyExist ? v : v.CopyFrom(defaultValue, allocator); - } - - //! Query a value in a subtree with default null-terminated string. - ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const { - bool alreadyExist; - ValueType& v = Create(root, allocator, &alreadyExist); - return alreadyExist ? v : v.SetString(defaultValue, allocator); - } - -#if RAPIDJSON_HAS_STDSTRING - //! Query a value in a subtree with default std::basic_string. - ValueType& GetWithDefault(ValueType& root, const std::basic_string& defaultValue, typename ValueType::AllocatorType& allocator) const { - bool alreadyExist; - ValueType& v = Create(root, allocator, &alreadyExist); - return alreadyExist ? v : v.SetString(defaultValue, allocator); - } -#endif - - //! Query a value in a subtree with default primitive value. - /*! - \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) - GetWithDefault(ValueType& root, T defaultValue, typename ValueType::AllocatorType& allocator) const { - return GetWithDefault(root, ValueType(defaultValue).Move(), allocator); - } - - //! Query a value in a document with default value. - template - ValueType& GetWithDefault(GenericDocument& document, const ValueType& defaultValue) const { - return GetWithDefault(document, defaultValue, document.GetAllocator()); - } - - //! Query a value in a document with default null-terminated string. - template - ValueType& GetWithDefault(GenericDocument& document, const Ch* defaultValue) const { - return GetWithDefault(document, defaultValue, document.GetAllocator()); - } - -#if RAPIDJSON_HAS_STDSTRING - //! Query a value in a document with default std::basic_string. - template - ValueType& GetWithDefault(GenericDocument& document, const std::basic_string& defaultValue) const { - return GetWithDefault(document, defaultValue, document.GetAllocator()); - } -#endif - - //! Query a value in a document with default primitive value. - /*! - \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) - GetWithDefault(GenericDocument& document, T defaultValue) const { - return GetWithDefault(document, defaultValue, document.GetAllocator()); - } - - //@} - - //!@name Set a value - //@{ - - //! Set a value in a subtree, with move semantics. - /*! - It creates all parents if they are not exist or types are different to the tokens. - So this function always succeeds but potentially remove existing values. - - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \param value Value to be set. - \param allocator Allocator for creating the values if the specified value or its parents are not exist. - \see Create() - */ - ValueType& Set(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator) = value; - } - - //! Set a value in a subtree, with copy semantics. - ValueType& Set(ValueType& root, const ValueType& value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator).CopyFrom(value, allocator); - } - - //! Set a null-terminated string in a subtree. - ValueType& Set(ValueType& root, const Ch* value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator) = ValueType(value, allocator).Move(); - } - -#if RAPIDJSON_HAS_STDSTRING - //! Set a std::basic_string in a subtree. - ValueType& Set(ValueType& root, const std::basic_string& value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator) = ValueType(value, allocator).Move(); - } -#endif - - //! Set a primitive value in a subtree. - /*! - \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) - Set(ValueType& root, T value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator) = ValueType(value).Move(); - } - - //! Set a value in a document, with move semantics. - template - ValueType& Set(GenericDocument& document, ValueType& value) const { - return Create(document) = value; - } - - //! Set a value in a document, with copy semantics. - template - ValueType& Set(GenericDocument& document, const ValueType& value) const { - return Create(document).CopyFrom(value, document.GetAllocator()); - } - - //! Set a null-terminated string in a document. - template - ValueType& Set(GenericDocument& document, const Ch* value) const { - return Create(document) = ValueType(value, document.GetAllocator()).Move(); - } - -#if RAPIDJSON_HAS_STDSTRING - //! Sets a std::basic_string in a document. - template - ValueType& Set(GenericDocument& document, const std::basic_string& value) const { - return Create(document) = ValueType(value, document.GetAllocator()).Move(); - } -#endif - - //! Set a primitive value in a document. - /*! - \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool - */ - template - RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) - Set(GenericDocument& document, T value) const { - return Create(document) = value; - } - - //@} - - //!@name Swap a value - //@{ - - //! Swap a value with a value in a subtree. - /*! - It creates all parents if they are not exist or types are different to the tokens. - So this function always succeeds but potentially remove existing values. - - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \param value Value to be swapped. - \param allocator Allocator for creating the values if the specified value or its parents are not exist. - \see Create() - */ - ValueType& Swap(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const { - return Create(root, allocator).Swap(value); - } - - //! Swap a value with a value in a document. - template - ValueType& Swap(GenericDocument& document, ValueType& value) const { - return Create(document).Swap(value); - } - - //@} - - //! Erase a value in a subtree. - /*! - \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. - \return Whether the resolved value is found and erased. - - \note Erasing with an empty pointer \c Pointer(""), i.e. the root, always fail and return false. - */ - bool Erase(ValueType& root) const { - RAPIDJSON_ASSERT(IsValid()); - if (tokenCount_ == 0) // Cannot erase the root - return false; - - ValueType* v = &root; - const Token* last = tokens_ + (tokenCount_ - 1); - for (const Token *t = tokens_; t != last; ++t) { - switch (v->GetType()) { - case kObjectType: - { - typename ValueType::MemberIterator m = v->FindMember(GenericValue(GenericStringRef(t->name, t->length))); - if (m == v->MemberEnd()) - return false; - v = &m->value; - } - break; - case kArrayType: - if (t->index == kPointerInvalidIndex || t->index >= v->Size()) - return false; - v = &((*v)[t->index]); - break; - default: - return false; - } - } - - switch (v->GetType()) { - case kObjectType: - return v->EraseMember(GenericStringRef(last->name, last->length)); - case kArrayType: - if (last->index == kPointerInvalidIndex || last->index >= v->Size()) - return false; - v->Erase(v->Begin() + last->index); - return true; - default: - return false; - } - } - -private: - //! Clone the content from rhs to this. - /*! - \param rhs Source pointer. - \param extraToken Extra tokens to be allocated. - \param extraNameBufferSize Extra name buffer size (in number of Ch) to be allocated. - \return Start of non-occupied name buffer, for storing extra names. - */ - Ch* CopyFromRaw(const GenericPointer& rhs, size_t extraToken = 0, size_t extraNameBufferSize = 0) { - if (!allocator_) // allocator is independently owned. - ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); - - size_t nameBufferSize = rhs.tokenCount_; // null terminators for tokens - for (Token *t = rhs.tokens_; t != rhs.tokens_ + rhs.tokenCount_; ++t) - nameBufferSize += t->length; - - tokenCount_ = rhs.tokenCount_ + extraToken; - tokens_ = static_cast(allocator_->Malloc(tokenCount_ * sizeof(Token) + (nameBufferSize + extraNameBufferSize) * sizeof(Ch))); - nameBuffer_ = reinterpret_cast(tokens_ + tokenCount_); - if (rhs.tokenCount_ > 0) { - std::memcpy(tokens_, rhs.tokens_, rhs.tokenCount_ * sizeof(Token)); - } - if (nameBufferSize > 0) { - std::memcpy(nameBuffer_, rhs.nameBuffer_, nameBufferSize * sizeof(Ch)); - } - - // Adjust pointers to name buffer - std::ptrdiff_t diff = nameBuffer_ - rhs.nameBuffer_; - for (Token *t = tokens_; t != tokens_ + rhs.tokenCount_; ++t) - t->name += diff; - - return nameBuffer_ + nameBufferSize; - } - - //! Check whether a character should be percent-encoded. - /*! - According to RFC 3986 2.3 Unreserved Characters. - \param c The character (code unit) to be tested. - */ - bool NeedPercentEncode(Ch c) const { - return !((c >= '0' && c <= '9') || (c >= 'A' && c <='Z') || (c >= 'a' && c <= 'z') || c == '-' || c == '.' || c == '_' || c =='~'); - } - - //! Parse a JSON String or its URI fragment representation into tokens. -#ifndef __clang__ // -Wdocumentation - /*! - \param source Either a JSON Pointer string, or its URI fragment representation. Not need to be null terminated. - \param length Length of the source string. - \note Source cannot be JSON String Representation of JSON Pointer, e.g. In "/\u0000", \u0000 will not be unescaped. - */ -#endif - void Parse(const Ch* source, size_t length) { - RAPIDJSON_ASSERT(source != NULL); - RAPIDJSON_ASSERT(nameBuffer_ == 0); - RAPIDJSON_ASSERT(tokens_ == 0); - - // Create own allocator if user did not supply. - if (!allocator_) - ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); - - // Count number of '/' as tokenCount - tokenCount_ = 0; - for (const Ch* s = source; s != source + length; s++) - if (*s == '/') - tokenCount_++; - - Token* token = tokens_ = static_cast(allocator_->Malloc(tokenCount_ * sizeof(Token) + length * sizeof(Ch))); - Ch* name = nameBuffer_ = reinterpret_cast(tokens_ + tokenCount_); - size_t i = 0; - - // Detect if it is a URI fragment - bool uriFragment = false; - if (source[i] == '#') { - uriFragment = true; - i++; - } - - if (i != length && source[i] != '/') { - parseErrorCode_ = kPointerParseErrorTokenMustBeginWithSolidus; - goto error; - } - - while (i < length) { - RAPIDJSON_ASSERT(source[i] == '/'); - i++; // consumes '/' - - token->name = name; - bool isNumber = true; - - while (i < length && source[i] != '/') { - Ch c = source[i]; - if (uriFragment) { - // Decoding percent-encoding for URI fragment - if (c == '%') { - PercentDecodeStream is(&source[i], source + length); - GenericInsituStringStream os(name); - Ch* begin = os.PutBegin(); - if (!Transcoder, EncodingType>().Validate(is, os) || !is.IsValid()) { - parseErrorCode_ = kPointerParseErrorInvalidPercentEncoding; - goto error; - } - size_t len = os.PutEnd(begin); - i += is.Tell() - 1; - if (len == 1) - c = *name; - else { - name += len; - isNumber = false; - i++; - continue; - } - } - else if (NeedPercentEncode(c)) { - parseErrorCode_ = kPointerParseErrorCharacterMustPercentEncode; - goto error; - } - } - - i++; - - // Escaping "~0" -> '~', "~1" -> '/' - if (c == '~') { - if (i < length) { - c = source[i]; - if (c == '0') c = '~'; - else if (c == '1') c = '/'; - else { - parseErrorCode_ = kPointerParseErrorInvalidEscape; - goto error; - } - i++; - } - else { - parseErrorCode_ = kPointerParseErrorInvalidEscape; - goto error; - } - } - - // First check for index: all of characters are digit - if (c < '0' || c > '9') - isNumber = false; - - *name++ = c; - } - token->length = static_cast(name - token->name); - if (token->length == 0) - isNumber = false; - *name++ = '\0'; // Null terminator - - // Second check for index: more than one digit cannot have leading zero - if (isNumber && token->length > 1 && token->name[0] == '0') - isNumber = false; - - // String to SizeType conversion - SizeType n = 0; - if (isNumber) { - for (size_t j = 0; j < token->length; j++) { - SizeType m = n * 10 + static_cast(token->name[j] - '0'); - if (m < n) { // overflow detection - isNumber = false; - break; - } - n = m; - } - } - - token->index = isNumber ? n : kPointerInvalidIndex; - token++; - } - - RAPIDJSON_ASSERT(name <= nameBuffer_ + length); // Should not overflow buffer - parseErrorCode_ = kPointerParseErrorNone; - return; - - error: - Allocator::Free(tokens_); - nameBuffer_ = 0; - tokens_ = 0; - tokenCount_ = 0; - parseErrorOffset_ = i; - return; - } - - //! Stringify to string or URI fragment representation. - /*! - \tparam uriFragment True for stringifying to URI fragment representation. False for string representation. - \tparam OutputStream type of output stream. - \param os The output stream. - */ - template - bool Stringify(OutputStream& os) const { - RAPIDJSON_ASSERT(IsValid()); - - if (uriFragment) - os.Put('#'); - - for (Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { - os.Put('/'); - for (size_t j = 0; j < t->length; j++) { - Ch c = t->name[j]; - if (c == '~') { - os.Put('~'); - os.Put('0'); - } - else if (c == '/') { - os.Put('~'); - os.Put('1'); - } - else if (uriFragment && NeedPercentEncode(c)) { - // Transcode to UTF8 sequence - GenericStringStream source(&t->name[j]); - PercentEncodeStream target(os); - if (!Transcoder >().Validate(source, target)) - return false; - j += source.Tell() - 1; - } - else - os.Put(c); - } - } - return true; - } - - //! A helper stream for decoding a percent-encoded sequence into code unit. - /*! - This stream decodes %XY triplet into code unit (0-255). - If it encounters invalid characters, it sets output code unit as 0 and - mark invalid, and to be checked by IsValid(). - */ - class PercentDecodeStream { - public: - typedef typename ValueType::Ch Ch; - - //! Constructor - /*! - \param source Start of the stream - \param end Past-the-end of the stream. - */ - PercentDecodeStream(const Ch* source, const Ch* end) : src_(source), head_(source), end_(end), valid_(true) {} - - Ch Take() { - if (*src_ != '%' || src_ + 3 > end_) { // %XY triplet - valid_ = false; - return 0; - } - src_++; - Ch c = 0; - for (int j = 0; j < 2; j++) { - c = static_cast(c << 4); - Ch h = *src_; - if (h >= '0' && h <= '9') c = static_cast(c + h - '0'); - else if (h >= 'A' && h <= 'F') c = static_cast(c + h - 'A' + 10); - else if (h >= 'a' && h <= 'f') c = static_cast(c + h - 'a' + 10); - else { - valid_ = false; - return 0; - } - src_++; - } - return c; - } - - size_t Tell() const { return static_cast(src_ - head_); } - bool IsValid() const { return valid_; } - - private: - const Ch* src_; //!< Current read position. - const Ch* head_; //!< Original head of the string. - const Ch* end_; //!< Past-the-end position. - bool valid_; //!< Whether the parsing is valid. - }; - - //! A helper stream to encode character (UTF-8 code unit) into percent-encoded sequence. - template - class PercentEncodeStream { - public: - PercentEncodeStream(OutputStream& os) : os_(os) {} - void Put(char c) { // UTF-8 must be byte - unsigned char u = static_cast(c); - static const char hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; - os_.Put('%'); - os_.Put(static_cast(hexDigits[u >> 4])); - os_.Put(static_cast(hexDigits[u & 15])); - } - private: - OutputStream& os_; - }; - - Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_. - Allocator* ownAllocator_; //!< Allocator owned by this Pointer. - Ch* nameBuffer_; //!< A buffer containing all names in tokens. - Token* tokens_; //!< A list of tokens. - size_t tokenCount_; //!< Number of tokens in tokens_. - size_t parseErrorOffset_; //!< Offset in code unit when parsing fail. - PointerParseErrorCode parseErrorCode_; //!< Parsing error code. -}; - -//! GenericPointer for Value (UTF-8, default allocator). -typedef GenericPointer Pointer; - -//!@name Helper functions for GenericPointer -//@{ - -////////////////////////////////////////////////////////////////////////////// - -template -typename T::ValueType& CreateValueByPointer(T& root, const GenericPointer& pointer, typename T::AllocatorType& a) { - return pointer.Create(root, a); -} - -template -typename T::ValueType& CreateValueByPointer(T& root, const CharType(&source)[N], typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Create(root, a); -} - -// No allocator parameter - -template -typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const GenericPointer& pointer) { - return pointer.Create(document); -} - -template -typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const CharType(&source)[N]) { - return GenericPointer(source, N - 1).Create(document); -} - -////////////////////////////////////////////////////////////////////////////// - -template -typename T::ValueType* GetValueByPointer(T& root, const GenericPointer& pointer, size_t* unresolvedTokenIndex = 0) { - return pointer.Get(root, unresolvedTokenIndex); -} - -template -const typename T::ValueType* GetValueByPointer(const T& root, const GenericPointer& pointer, size_t* unresolvedTokenIndex = 0) { - return pointer.Get(root, unresolvedTokenIndex); -} - -template -typename T::ValueType* GetValueByPointer(T& root, const CharType (&source)[N], size_t* unresolvedTokenIndex = 0) { - return GenericPointer(source, N - 1).Get(root, unresolvedTokenIndex); -} - -template -const typename T::ValueType* GetValueByPointer(const T& root, const CharType(&source)[N], size_t* unresolvedTokenIndex = 0) { - return GenericPointer(source, N - 1).Get(root, unresolvedTokenIndex); -} - -////////////////////////////////////////////////////////////////////////////// - -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const typename T::ValueType& defaultValue, typename T::AllocatorType& a) { - return pointer.GetWithDefault(root, defaultValue, a); -} - -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const typename T::Ch* defaultValue, typename T::AllocatorType& a) { - return pointer.GetWithDefault(root, defaultValue, a); -} - -#if RAPIDJSON_HAS_STDSTRING -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const std::basic_string& defaultValue, typename T::AllocatorType& a) { - return pointer.GetWithDefault(root, defaultValue, a); -} -#endif - -template -RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) -GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, T2 defaultValue, typename T::AllocatorType& a) { - return pointer.GetWithDefault(root, defaultValue, a); -} - -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::ValueType& defaultValue, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); -} - -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::Ch* defaultValue, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); -} - -#if RAPIDJSON_HAS_STDSTRING -template -typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const std::basic_string& defaultValue, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); -} -#endif - -template -RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) -GetValueByPointerWithDefault(T& root, const CharType(&source)[N], T2 defaultValue, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); -} - -// No allocator parameter - -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::ValueType& defaultValue) { - return pointer.GetWithDefault(document, defaultValue); -} - -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::Ch* defaultValue) { - return pointer.GetWithDefault(document, defaultValue); -} - -#if RAPIDJSON_HAS_STDSTRING -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const std::basic_string& defaultValue) { - return pointer.GetWithDefault(document, defaultValue); -} -#endif - -template -RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) -GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, T2 defaultValue) { - return pointer.GetWithDefault(document, defaultValue); -} - -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& defaultValue) { - return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); -} - -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* defaultValue) { - return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); -} - -#if RAPIDJSON_HAS_STDSTRING -template -typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const std::basic_string& defaultValue) { - return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); -} -#endif - -template -RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) -GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], T2 defaultValue) { - return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); -} - -////////////////////////////////////////////////////////////////////////////// - -template -typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, typename T::ValueType& value, typename T::AllocatorType& a) { - return pointer.Set(root, value, a); -} - -template -typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const typename T::ValueType& value, typename T::AllocatorType& a) { - return pointer.Set(root, value, a); -} - -template -typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const typename T::Ch* value, typename T::AllocatorType& a) { - return pointer.Set(root, value, a); -} - -#if RAPIDJSON_HAS_STDSTRING -template -typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const std::basic_string& value, typename T::AllocatorType& a) { - return pointer.Set(root, value, a); -} -#endif - -template -RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) -SetValueByPointer(T& root, const GenericPointer& pointer, T2 value, typename T::AllocatorType& a) { - return pointer.Set(root, value, a); -} - -template -typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Set(root, value, a); -} - -template -typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::ValueType& value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Set(root, value, a); -} - -template -typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::Ch* value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Set(root, value, a); -} - -#if RAPIDJSON_HAS_STDSTRING -template -typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const std::basic_string& value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Set(root, value, a); -} -#endif - -template -RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) -SetValueByPointer(T& root, const CharType(&source)[N], T2 value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Set(root, value, a); -} - -// No allocator parameter - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, typename DocumentType::ValueType& value) { - return pointer.Set(document, value); -} - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::ValueType& value) { - return pointer.Set(document, value); -} - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::Ch* value) { - return pointer.Set(document, value); -} - -#if RAPIDJSON_HAS_STDSTRING -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const std::basic_string& value) { - return pointer.Set(document, value); -} -#endif - -template -RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) -SetValueByPointer(DocumentType& document, const GenericPointer& pointer, T2 value) { - return pointer.Set(document, value); -} - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) { - return GenericPointer(source, N - 1).Set(document, value); -} - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& value) { - return GenericPointer(source, N - 1).Set(document, value); -} - -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* value) { - return GenericPointer(source, N - 1).Set(document, value); -} - -#if RAPIDJSON_HAS_STDSTRING -template -typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const std::basic_string& value) { - return GenericPointer(source, N - 1).Set(document, value); -} -#endif - -template -RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) -SetValueByPointer(DocumentType& document, const CharType(&source)[N], T2 value) { - return GenericPointer(source, N - 1).Set(document, value); -} - -////////////////////////////////////////////////////////////////////////////// - -template -typename T::ValueType& SwapValueByPointer(T& root, const GenericPointer& pointer, typename T::ValueType& value, typename T::AllocatorType& a) { - return pointer.Swap(root, value, a); -} - -template -typename T::ValueType& SwapValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) { - return GenericPointer(source, N - 1).Swap(root, value, a); -} - -template -typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const GenericPointer& pointer, typename DocumentType::ValueType& value) { - return pointer.Swap(document, value); -} - -template -typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) { - return GenericPointer(source, N - 1).Swap(document, value); -} - -////////////////////////////////////////////////////////////////////////////// - -template -bool EraseValueByPointer(T& root, const GenericPointer& pointer) { - return pointer.Erase(root); -} - -template -bool EraseValueByPointer(T& root, const CharType(&source)[N]) { - return GenericPointer(source, N - 1).Erase(root); -} - -//@} - -RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) || defined(_MSC_VER) -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_POINTER_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/prettywriter.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/prettywriter.h deleted file mode 100644 index cea596e..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/prettywriter.h +++ /dev/null @@ -1,277 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_PRETTYWRITER_H_ -#define RAPIDJSON_PRETTYWRITER_H_ - -#include "writer.h" - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -#if defined(__clang__) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(c++98-compat) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! Combination of PrettyWriter format flags. -/*! \see PrettyWriter::SetFormatOptions - */ -enum PrettyFormatOptions { - kFormatDefault = 0, //!< Default pretty formatting. - kFormatSingleLineArray = 1 //!< Format arrays on a single line. -}; - -//! Writer with indentation and spacing. -/*! - \tparam OutputStream Type of output os. - \tparam SourceEncoding Encoding of source string. - \tparam TargetEncoding Encoding of output stream. - \tparam StackAllocator Type of allocator for allocating memory of stack. -*/ -template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags> -class PrettyWriter : public Writer { -public: - typedef Writer Base; - typedef typename Base::Ch Ch; - - //! Constructor - /*! \param os Output stream. - \param allocator User supplied allocator. If it is null, it will create a private one. - \param levelDepth Initial capacity of stack. - */ - explicit PrettyWriter(OutputStream& os, StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : - Base(os, allocator, levelDepth), indentChar_(' '), indentCharCount_(4), formatOptions_(kFormatDefault) {} - - - explicit PrettyWriter(StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : - Base(allocator, levelDepth), indentChar_(' '), indentCharCount_(4), formatOptions_(kFormatDefault) {} - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - PrettyWriter(PrettyWriter&& rhs) : - Base(std::forward(rhs)), indentChar_(rhs.indentChar_), indentCharCount_(rhs.indentCharCount_), formatOptions_(rhs.formatOptions_) {} -#endif - - //! Set custom indentation. - /*! \param indentChar Character for indentation. Must be whitespace character (' ', '\\t', '\\n', '\\r'). - \param indentCharCount Number of indent characters for each indentation level. - \note The default indentation is 4 spaces. - */ - PrettyWriter& SetIndent(Ch indentChar, unsigned indentCharCount) { - RAPIDJSON_ASSERT(indentChar == ' ' || indentChar == '\t' || indentChar == '\n' || indentChar == '\r'); - indentChar_ = indentChar; - indentCharCount_ = indentCharCount; - return *this; - } - - //! Set pretty writer formatting options. - /*! \param options Formatting options. - */ - PrettyWriter& SetFormatOptions(PrettyFormatOptions options) { - formatOptions_ = options; - return *this; - } - - /*! @name Implementation of Handler - \see Handler - */ - //@{ - - bool Null() { PrettyPrefix(kNullType); return Base::EndValue(Base::WriteNull()); } - bool Bool(bool b) { PrettyPrefix(b ? kTrueType : kFalseType); return Base::EndValue(Base::WriteBool(b)); } - bool Int(int i) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt(i)); } - bool Uint(unsigned u) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint(u)); } - bool Int64(int64_t i64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt64(i64)); } - bool Uint64(uint64_t u64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint64(u64)); } - bool Double(double d) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteDouble(d)); } - - bool RawNumber(const Ch* str, SizeType length, bool copy = false) { - RAPIDJSON_ASSERT(str != 0); - (void)copy; - PrettyPrefix(kNumberType); - return Base::EndValue(Base::WriteString(str, length)); - } - - bool String(const Ch* str, SizeType length, bool copy = false) { - RAPIDJSON_ASSERT(str != 0); - (void)copy; - PrettyPrefix(kStringType); - return Base::EndValue(Base::WriteString(str, length)); - } - -#if RAPIDJSON_HAS_STDSTRING - bool String(const std::basic_string& str) { - return String(str.data(), SizeType(str.size())); - } -#endif - - bool StartObject() { - PrettyPrefix(kObjectType); - new (Base::level_stack_.template Push()) typename Base::Level(false); - return Base::WriteStartObject(); - } - - bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } - -#if RAPIDJSON_HAS_STDSTRING - bool Key(const std::basic_string& str) { - return Key(str.data(), SizeType(str.size())); - } -#endif - - bool EndObject(SizeType memberCount = 0) { - (void)memberCount; - RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); // not inside an Object - RAPIDJSON_ASSERT(!Base::level_stack_.template Top()->inArray); // currently inside an Array, not Object - RAPIDJSON_ASSERT(0 == Base::level_stack_.template Top()->valueCount % 2); // Object has a Key without a Value - - bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; - - if (!empty) { - Base::os_->Put('\n'); - WriteIndent(); - } - bool ret = Base::EndValue(Base::WriteEndObject()); - (void)ret; - RAPIDJSON_ASSERT(ret == true); - if (Base::level_stack_.Empty()) // end of json text - Base::Flush(); - return true; - } - - bool StartArray() { - PrettyPrefix(kArrayType); - new (Base::level_stack_.template Push()) typename Base::Level(true); - return Base::WriteStartArray(); - } - - bool EndArray(SizeType memberCount = 0) { - (void)memberCount; - RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); - RAPIDJSON_ASSERT(Base::level_stack_.template Top()->inArray); - bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; - - if (!empty && !(formatOptions_ & kFormatSingleLineArray)) { - Base::os_->Put('\n'); - WriteIndent(); - } - bool ret = Base::EndValue(Base::WriteEndArray()); - (void)ret; - RAPIDJSON_ASSERT(ret == true); - if (Base::level_stack_.Empty()) // end of json text - Base::Flush(); - return true; - } - - //@} - - /*! @name Convenience extensions */ - //@{ - - //! Simpler but slower overload. - bool String(const Ch* str) { return String(str, internal::StrLen(str)); } - bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); } - - //@} - - //! Write a raw JSON value. - /*! - For user to write a stringified JSON as a value. - - \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range. - \param length Length of the json. - \param type Type of the root of json. - \note When using PrettyWriter::RawValue(), the result json may not be indented correctly. - */ - bool RawValue(const Ch* json, size_t length, Type type) { - RAPIDJSON_ASSERT(json != 0); - PrettyPrefix(type); - return Base::EndValue(Base::WriteRawValue(json, length)); - } - -protected: - void PrettyPrefix(Type type) { - (void)type; - if (Base::level_stack_.GetSize() != 0) { // this value is not at root - typename Base::Level* level = Base::level_stack_.template Top(); - - if (level->inArray) { - if (level->valueCount > 0) { - Base::os_->Put(','); // add comma if it is not the first element in array - if (formatOptions_ & kFormatSingleLineArray) - Base::os_->Put(' '); - } - - if (!(formatOptions_ & kFormatSingleLineArray)) { - Base::os_->Put('\n'); - WriteIndent(); - } - } - else { // in object - if (level->valueCount > 0) { - if (level->valueCount % 2 == 0) { - Base::os_->Put(','); - Base::os_->Put('\n'); - } - else { - Base::os_->Put(':'); - Base::os_->Put(' '); - } - } - else - Base::os_->Put('\n'); - - if (level->valueCount % 2 == 0) - WriteIndent(); - } - if (!level->inArray && level->valueCount % 2 == 0) - RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name - level->valueCount++; - } - else { - RAPIDJSON_ASSERT(!Base::hasRoot_); // Should only has one and only one root. - Base::hasRoot_ = true; - } - } - - void WriteIndent() { - size_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_; - PutN(*Base::os_, static_cast(indentChar_), count); - } - - Ch indentChar_; - unsigned indentCharCount_; - PrettyFormatOptions formatOptions_; - -private: - // Prohibit copy constructor & assignment operator. - PrettyWriter(const PrettyWriter&); - PrettyWriter& operator=(const PrettyWriter&); -}; - -RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) -RAPIDJSON_DIAG_POP -#endif - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/rapidjson.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/rapidjson.h deleted file mode 100644 index 89de838..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/rapidjson.h +++ /dev/null @@ -1,741 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_RAPIDJSON_H_ -#define RAPIDJSON_RAPIDJSON_H_ - -/*!\file rapidjson.h - \brief common definitions and configuration - - \see RAPIDJSON_CONFIG - */ - -/*! \defgroup RAPIDJSON_CONFIG RapidJSON configuration - \brief Configuration macros for library features - - Some RapidJSON features are configurable to adapt the library to a wide - variety of platforms, environments and usage scenarios. Most of the - features can be configured in terms of overridden or predefined - preprocessor macros at compile-time. - - Some additional customization is available in the \ref RAPIDJSON_ERRORS APIs. - - \note These macros should be given on the compiler command-line - (where applicable) to avoid inconsistent values when compiling - different translation units of a single application. - */ - -#include // malloc(), realloc(), free(), size_t -#include // memset(), memcpy(), memmove(), memcmp() - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_VERSION_STRING -// -// ALWAYS synchronize the following 3 macros with corresponding variables in /CMakeLists.txt. -// - -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -// token stringification -#define RAPIDJSON_STRINGIFY(x) RAPIDJSON_DO_STRINGIFY(x) -#define RAPIDJSON_DO_STRINGIFY(x) #x - -// token concatenation -#define RAPIDJSON_JOIN(X, Y) RAPIDJSON_DO_JOIN(X, Y) -#define RAPIDJSON_DO_JOIN(X, Y) RAPIDJSON_DO_JOIN2(X, Y) -#define RAPIDJSON_DO_JOIN2(X, Y) X##Y -//!@endcond - -/*! \def RAPIDJSON_MAJOR_VERSION - \ingroup RAPIDJSON_CONFIG - \brief Major version of RapidJSON in integer. -*/ -/*! \def RAPIDJSON_MINOR_VERSION - \ingroup RAPIDJSON_CONFIG - \brief Minor version of RapidJSON in integer. -*/ -/*! \def RAPIDJSON_PATCH_VERSION - \ingroup RAPIDJSON_CONFIG - \brief Patch version of RapidJSON in integer. -*/ -/*! \def RAPIDJSON_VERSION_STRING - \ingroup RAPIDJSON_CONFIG - \brief Version of RapidJSON in ".." string format. -*/ -#define RAPIDJSON_MAJOR_VERSION 1 -#define RAPIDJSON_MINOR_VERSION 1 -#define RAPIDJSON_PATCH_VERSION 0 -#define RAPIDJSON_VERSION_STRING \ - RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION) - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_NAMESPACE_(BEGIN|END) -/*! \def RAPIDJSON_NAMESPACE - \ingroup RAPIDJSON_CONFIG - \brief provide custom rapidjson namespace - - In order to avoid symbol clashes and/or "One Definition Rule" errors - between multiple inclusions of (different versions of) RapidJSON in - a single binary, users can customize the name of the main RapidJSON - namespace. - - In case of a single nesting level, defining \c RAPIDJSON_NAMESPACE - to a custom name (e.g. \c MyRapidJSON) is sufficient. If multiple - levels are needed, both \ref RAPIDJSON_NAMESPACE_BEGIN and \ref - RAPIDJSON_NAMESPACE_END need to be defined as well: - - \code - // in some .cpp file - #define RAPIDJSON_NAMESPACE my::rapidjson - #define RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapidjson { - #define RAPIDJSON_NAMESPACE_END } } - #include "rapidjson/..." - \endcode - - \see rapidjson - */ -/*! \def RAPIDJSON_NAMESPACE_BEGIN - \ingroup RAPIDJSON_CONFIG - \brief provide custom rapidjson namespace (opening expression) - \see RAPIDJSON_NAMESPACE -*/ -/*! \def RAPIDJSON_NAMESPACE_END - \ingroup RAPIDJSON_CONFIG - \brief provide custom rapidjson namespace (closing expression) - \see RAPIDJSON_NAMESPACE -*/ -#ifndef RAPIDJSON_NAMESPACE -#define RAPIDJSON_NAMESPACE rapidjson -#endif -#ifndef RAPIDJSON_NAMESPACE_BEGIN -#define RAPIDJSON_NAMESPACE_BEGIN namespace RAPIDJSON_NAMESPACE { -#endif -#ifndef RAPIDJSON_NAMESPACE_END -#define RAPIDJSON_NAMESPACE_END } -#endif - -/////////////////////////////////////////////////////////////////////////////// -// __cplusplus macro - -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN - -#if defined(_MSC_VER) -#define RAPIDJSON_CPLUSPLUS _MSVC_LANG -#else -#define RAPIDJSON_CPLUSPLUS __cplusplus -#endif - -//!@endcond - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_HAS_STDSTRING - -#ifndef RAPIDJSON_HAS_STDSTRING -#ifdef RAPIDJSON_DOXYGEN_RUNNING -#define RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation -#else -#define RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default -#endif -/*! \def RAPIDJSON_HAS_STDSTRING - \ingroup RAPIDJSON_CONFIG - \brief Enable RapidJSON support for \c std::string - - By defining this preprocessor symbol to \c 1, several convenience functions for using - \ref rapidjson::GenericValue with \c std::string are enabled, especially - for construction and comparison. - - \hideinitializer -*/ -#endif // !defined(RAPIDJSON_HAS_STDSTRING) - -#if RAPIDJSON_HAS_STDSTRING -#include -#endif // RAPIDJSON_HAS_STDSTRING - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_USE_MEMBERSMAP - -/*! \def RAPIDJSON_USE_MEMBERSMAP - \ingroup RAPIDJSON_CONFIG - \brief Enable RapidJSON support for object members handling in a \c std::multimap - - By defining this preprocessor symbol to \c 1, \ref rapidjson::GenericValue object - members are stored in a \c std::multimap for faster lookup and deletion times, a - trade off with a slightly slower insertion time and a small object allocat(or)ed - memory overhead. - - \hideinitializer -*/ -#ifndef RAPIDJSON_USE_MEMBERSMAP -#define RAPIDJSON_USE_MEMBERSMAP 0 // not by default -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_NO_INT64DEFINE - -/*! \def RAPIDJSON_NO_INT64DEFINE - \ingroup RAPIDJSON_CONFIG - \brief Use external 64-bit integer types. - - RapidJSON requires the 64-bit integer types \c int64_t and \c uint64_t types - to be available at global scope. - - If users have their own definition, define RAPIDJSON_NO_INT64DEFINE to - prevent RapidJSON from defining its own types. -*/ -#ifndef RAPIDJSON_NO_INT64DEFINE -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -#if defined(_MSC_VER) && (_MSC_VER < 1800) // Visual Studio 2013 -#include "msinttypes/stdint.h" -#include "msinttypes/inttypes.h" -#else -// Other compilers should have this. -#include -#include -#endif -//!@endcond -#ifdef RAPIDJSON_DOXYGEN_RUNNING -#define RAPIDJSON_NO_INT64DEFINE -#endif -#endif // RAPIDJSON_NO_INT64TYPEDEF - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_FORCEINLINE - -#ifndef RAPIDJSON_FORCEINLINE -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -#if defined(_MSC_VER) && defined(NDEBUG) -#define RAPIDJSON_FORCEINLINE __forceinline -#elif defined(__GNUC__) && __GNUC__ >= 4 && defined(NDEBUG) -#define RAPIDJSON_FORCEINLINE __attribute__((always_inline)) -#else -#define RAPIDJSON_FORCEINLINE -#endif -//!@endcond -#endif // RAPIDJSON_FORCEINLINE - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_ENDIAN -#define RAPIDJSON_LITTLEENDIAN 0 //!< Little endian machine -#define RAPIDJSON_BIGENDIAN 1 //!< Big endian machine - -//! Endianness of the machine. -/*! - \def RAPIDJSON_ENDIAN - \ingroup RAPIDJSON_CONFIG - - GCC 4.6 provided macro for detecting endianness of the target machine. But other - compilers may not have this. User can define RAPIDJSON_ENDIAN to either - \ref RAPIDJSON_LITTLEENDIAN or \ref RAPIDJSON_BIGENDIAN. - - Default detection implemented with reference to - \li https://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html - \li http://www.boost.org/doc/libs/1_42_0/boost/detail/endian.hpp -*/ -#ifndef RAPIDJSON_ENDIAN -// Detect with GCC 4.6's macro -# ifdef __BYTE_ORDER__ -# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN -# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN -# else -# error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN. -# endif // __BYTE_ORDER__ -// Detect with GLIBC's endian.h -# elif defined(__GLIBC__) -# include -# if (__BYTE_ORDER == __LITTLE_ENDIAN) -# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN -# elif (__BYTE_ORDER == __BIG_ENDIAN) -# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN -# else -# error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN. -# endif // __GLIBC__ -// Detect with _LITTLE_ENDIAN and _BIG_ENDIAN macro -# elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) -# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN -# elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) -# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN -// Detect with architecture macros -# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__) -# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN -# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) -# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN -# elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) -# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN -# elif defined(RAPIDJSON_DOXYGEN_RUNNING) -# define RAPIDJSON_ENDIAN -# else -# error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN. -# endif -#endif // RAPIDJSON_ENDIAN - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_64BIT - -//! Whether using 64-bit architecture -#ifndef RAPIDJSON_64BIT -#if defined(__LP64__) || (defined(__x86_64__) && defined(__ILP32__)) || defined(_WIN64) || defined(__EMSCRIPTEN__) -#define RAPIDJSON_64BIT 1 -#else -#define RAPIDJSON_64BIT 0 -#endif -#endif // RAPIDJSON_64BIT - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_ALIGN - -//! Data alignment of the machine. -/*! \ingroup RAPIDJSON_CONFIG - \param x pointer to align - - Some machines require strict data alignment. The default is 8 bytes. - User can customize by defining the RAPIDJSON_ALIGN function macro. -*/ -#ifndef RAPIDJSON_ALIGN -#define RAPIDJSON_ALIGN(x) (((x) + static_cast(7u)) & ~static_cast(7u)) -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_UINT64_C2 - -//! Construct a 64-bit literal by a pair of 32-bit integer. -/*! - 64-bit literal with or without ULL suffix is prone to compiler warnings. - UINT64_C() is C macro which cause compilation problems. - Use this macro to define 64-bit constants by a pair of 32-bit integer. -*/ -#ifndef RAPIDJSON_UINT64_C2 -#define RAPIDJSON_UINT64_C2(high32, low32) ((static_cast(high32) << 32) | static_cast(low32)) -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_48BITPOINTER_OPTIMIZATION - -//! Use only lower 48-bit address for some pointers. -/*! - \ingroup RAPIDJSON_CONFIG - - This optimization uses the fact that current X86-64 architecture only implement lower 48-bit virtual address. - The higher 16-bit can be used for storing other data. - \c GenericValue uses this optimization to reduce its size form 24 bytes to 16 bytes in 64-bit architecture. -*/ -#ifndef RAPIDJSON_48BITPOINTER_OPTIMIZATION -#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) -#define RAPIDJSON_48BITPOINTER_OPTIMIZATION 1 -#else -#define RAPIDJSON_48BITPOINTER_OPTIMIZATION 0 -#endif -#endif // RAPIDJSON_48BITPOINTER_OPTIMIZATION - -#if RAPIDJSON_48BITPOINTER_OPTIMIZATION == 1 -#if RAPIDJSON_64BIT != 1 -#error RAPIDJSON_48BITPOINTER_OPTIMIZATION can only be set to 1 when RAPIDJSON_64BIT=1 -#endif -#define RAPIDJSON_SETPOINTER(type, p, x) (p = reinterpret_cast((reinterpret_cast(p) & static_cast(RAPIDJSON_UINT64_C2(0xFFFF0000, 0x00000000))) | reinterpret_cast(reinterpret_cast(x)))) -#define RAPIDJSON_GETPOINTER(type, p) (reinterpret_cast(reinterpret_cast(p) & static_cast(RAPIDJSON_UINT64_C2(0x0000FFFF, 0xFFFFFFFF)))) -#else -#define RAPIDJSON_SETPOINTER(type, p, x) (p = (x)) -#define RAPIDJSON_GETPOINTER(type, p) (p) -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_SSE2/RAPIDJSON_SSE42/RAPIDJSON_NEON/RAPIDJSON_SIMD - -/*! \def RAPIDJSON_SIMD - \ingroup RAPIDJSON_CONFIG - \brief Enable SSE2/SSE4.2/Neon optimization. - - RapidJSON supports optimized implementations for some parsing operations - based on the SSE2, SSE4.2 or NEon SIMD extensions on modern Intel - or ARM compatible processors. - - To enable these optimizations, three different symbols can be defined; - \code - // Enable SSE2 optimization. - #define RAPIDJSON_SSE2 - - // Enable SSE4.2 optimization. - #define RAPIDJSON_SSE42 - \endcode - - // Enable ARM Neon optimization. - #define RAPIDJSON_NEON - \endcode - - \c RAPIDJSON_SSE42 takes precedence over SSE2, if both are defined. - - If any of these symbols is defined, RapidJSON defines the macro - \c RAPIDJSON_SIMD to indicate the availability of the optimized code. -*/ -#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) \ - || defined(RAPIDJSON_NEON) || defined(RAPIDJSON_DOXYGEN_RUNNING) -#define RAPIDJSON_SIMD -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_NO_SIZETYPEDEFINE - -#ifndef RAPIDJSON_NO_SIZETYPEDEFINE -/*! \def RAPIDJSON_NO_SIZETYPEDEFINE - \ingroup RAPIDJSON_CONFIG - \brief User-provided \c SizeType definition. - - In order to avoid using 32-bit size types for indexing strings and arrays, - define this preprocessor symbol and provide the type rapidjson::SizeType - before including RapidJSON: - \code - #define RAPIDJSON_NO_SIZETYPEDEFINE - namespace rapidjson { typedef ::std::size_t SizeType; } - #include "rapidjson/..." - \endcode - - \see rapidjson::SizeType -*/ -#ifdef RAPIDJSON_DOXYGEN_RUNNING -#define RAPIDJSON_NO_SIZETYPEDEFINE -#endif -RAPIDJSON_NAMESPACE_BEGIN -//! Size type (for string lengths, array sizes, etc.) -/*! RapidJSON uses 32-bit array/string indices even on 64-bit platforms, - instead of using \c size_t. Users may override the SizeType by defining - \ref RAPIDJSON_NO_SIZETYPEDEFINE. -*/ -typedef unsigned SizeType; -RAPIDJSON_NAMESPACE_END -#endif - -// always import std::size_t to rapidjson namespace -RAPIDJSON_NAMESPACE_BEGIN -using std::size_t; -RAPIDJSON_NAMESPACE_END - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_ASSERT - -//! Assertion. -/*! \ingroup RAPIDJSON_CONFIG - By default, rapidjson uses C \c assert() for internal assertions. - User can override it by defining RAPIDJSON_ASSERT(x) macro. - - \note Parsing errors are handled and can be customized by the - \ref RAPIDJSON_ERRORS APIs. -*/ -#ifndef RAPIDJSON_ASSERT -#include -#define RAPIDJSON_ASSERT(x) assert(x) -#endif // RAPIDJSON_ASSERT - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_STATIC_ASSERT - -// Prefer C++11 static_assert, if available -#ifndef RAPIDJSON_STATIC_ASSERT -#if RAPIDJSON_CPLUSPLUS >= 201103L || ( defined(_MSC_VER) && _MSC_VER >= 1800 ) -#define RAPIDJSON_STATIC_ASSERT(x) \ - static_assert(x, RAPIDJSON_STRINGIFY(x)) -#endif // C++11 -#endif // RAPIDJSON_STATIC_ASSERT - -// Adopt C++03 implementation from boost -#ifndef RAPIDJSON_STATIC_ASSERT -#ifndef __clang__ -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -#endif -RAPIDJSON_NAMESPACE_BEGIN -template struct STATIC_ASSERTION_FAILURE; -template <> struct STATIC_ASSERTION_FAILURE { enum { value = 1 }; }; -template struct StaticAssertTest {}; -RAPIDJSON_NAMESPACE_END - -#if defined(__GNUC__) || defined(__clang__) -#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused)) -#else -#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE -#endif -#ifndef __clang__ -//!@endcond -#endif - -/*! \def RAPIDJSON_STATIC_ASSERT - \brief (Internal) macro to check for conditions at compile-time - \param x compile-time condition - \hideinitializer - */ -#define RAPIDJSON_STATIC_ASSERT(x) \ - typedef ::RAPIDJSON_NAMESPACE::StaticAssertTest< \ - sizeof(::RAPIDJSON_NAMESPACE::STATIC_ASSERTION_FAILURE)> \ - RAPIDJSON_JOIN(StaticAssertTypedef, __LINE__) RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE -#endif // RAPIDJSON_STATIC_ASSERT - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_LIKELY, RAPIDJSON_UNLIKELY - -//! Compiler branching hint for expression with high probability to be true. -/*! - \ingroup RAPIDJSON_CONFIG - \param x Boolean expression likely to be true. -*/ -#ifndef RAPIDJSON_LIKELY -#if defined(__GNUC__) || defined(__clang__) -#define RAPIDJSON_LIKELY(x) __builtin_expect(!!(x), 1) -#else -#define RAPIDJSON_LIKELY(x) (x) -#endif -#endif - -//! Compiler branching hint for expression with low probability to be true. -/*! - \ingroup RAPIDJSON_CONFIG - \param x Boolean expression unlikely to be true. -*/ -#ifndef RAPIDJSON_UNLIKELY -#if defined(__GNUC__) || defined(__clang__) -#define RAPIDJSON_UNLIKELY(x) __builtin_expect(!!(x), 0) -#else -#define RAPIDJSON_UNLIKELY(x) (x) -#endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -// Helpers - -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN - -#define RAPIDJSON_MULTILINEMACRO_BEGIN do { -#define RAPIDJSON_MULTILINEMACRO_END \ -} while((void)0, 0) - -// adopted from Boost -#define RAPIDJSON_VERSION_CODE(x,y,z) \ - (((x)*100000) + ((y)*100) + (z)) - -#if defined(__has_builtin) -#define RAPIDJSON_HAS_BUILTIN(x) __has_builtin(x) -#else -#define RAPIDJSON_HAS_BUILTIN(x) 0 -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_DIAG_PUSH/POP, RAPIDJSON_DIAG_OFF - -#if defined(__GNUC__) -#define RAPIDJSON_GNUC \ - RAPIDJSON_VERSION_CODE(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) -#endif - -#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,2,0)) - -#define RAPIDJSON_PRAGMA(x) _Pragma(RAPIDJSON_STRINGIFY(x)) -#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(GCC diagnostic x) -#define RAPIDJSON_DIAG_OFF(x) \ - RAPIDJSON_DIAG_PRAGMA(ignored RAPIDJSON_STRINGIFY(RAPIDJSON_JOIN(-W,x))) - -// push/pop support in Clang and GCC>=4.6 -#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) -#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push) -#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop) -#else // GCC >= 4.2, < 4.6 -#define RAPIDJSON_DIAG_PUSH /* ignored */ -#define RAPIDJSON_DIAG_POP /* ignored */ -#endif - -#elif defined(_MSC_VER) - -// pragma (MSVC specific) -#define RAPIDJSON_PRAGMA(x) __pragma(x) -#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(warning(x)) - -#define RAPIDJSON_DIAG_OFF(x) RAPIDJSON_DIAG_PRAGMA(disable: x) -#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push) -#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop) - -#else - -#define RAPIDJSON_DIAG_OFF(x) /* ignored */ -#define RAPIDJSON_DIAG_PUSH /* ignored */ -#define RAPIDJSON_DIAG_POP /* ignored */ - -#endif // RAPIDJSON_DIAG_* - -/////////////////////////////////////////////////////////////////////////////// -// C++11 features - -#ifndef RAPIDJSON_HAS_CXX11 -#define RAPIDJSON_HAS_CXX11 (RAPIDJSON_CPLUSPLUS >= 201103L) -#endif - -#ifndef RAPIDJSON_HAS_CXX11_RVALUE_REFS -#if RAPIDJSON_HAS_CXX11 -#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 -#elif defined(__clang__) -#if __has_feature(cxx_rvalue_references) && \ - (defined(_MSC_VER) || defined(_LIBCPP_VERSION) || defined(__GLIBCXX__) && __GLIBCXX__ >= 20080306) -#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 -#else -#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 -#endif -#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ - (defined(_MSC_VER) && _MSC_VER >= 1600) || \ - (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) - -#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 -#else -#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 -#endif -#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS -#include // std::move -#endif - -#ifndef RAPIDJSON_HAS_CXX11_NOEXCEPT -#if RAPIDJSON_HAS_CXX11 -#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1 -#elif defined(__clang__) -#define RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept) -#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ - (defined(_MSC_VER) && _MSC_VER >= 1900) || \ - (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) -#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1 -#else -#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0 -#endif -#endif -#ifndef RAPIDJSON_NOEXCEPT -#if RAPIDJSON_HAS_CXX11_NOEXCEPT -#define RAPIDJSON_NOEXCEPT noexcept -#else -#define RAPIDJSON_NOEXCEPT throw() -#endif // RAPIDJSON_HAS_CXX11_NOEXCEPT -#endif - -// no automatic detection, yet -#ifndef RAPIDJSON_HAS_CXX11_TYPETRAITS -#if (defined(_MSC_VER) && _MSC_VER >= 1700) -#define RAPIDJSON_HAS_CXX11_TYPETRAITS 1 -#else -#define RAPIDJSON_HAS_CXX11_TYPETRAITS 0 -#endif -#endif - -#ifndef RAPIDJSON_HAS_CXX11_RANGE_FOR -#if defined(__clang__) -#define RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for) -#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ - (defined(_MSC_VER) && _MSC_VER >= 1700) || \ - (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) -#define RAPIDJSON_HAS_CXX11_RANGE_FOR 1 -#else -#define RAPIDJSON_HAS_CXX11_RANGE_FOR 0 -#endif -#endif // RAPIDJSON_HAS_CXX11_RANGE_FOR - -/////////////////////////////////////////////////////////////////////////////// -// C++17 features - -#ifndef RAPIDJSON_HAS_CXX17 -#define RAPIDJSON_HAS_CXX17 (RAPIDJSON_CPLUSPLUS >= 201703L) -#endif - -#if RAPIDJSON_HAS_CXX17 -# define RAPIDJSON_DELIBERATE_FALLTHROUGH [[fallthrough]] -#elif defined(__has_cpp_attribute) -# if __has_cpp_attribute(clang::fallthrough) -# define RAPIDJSON_DELIBERATE_FALLTHROUGH [[clang::fallthrough]] -# elif __has_cpp_attribute(fallthrough) -# define RAPIDJSON_DELIBERATE_FALLTHROUGH __attribute__((fallthrough)) -# else -# define RAPIDJSON_DELIBERATE_FALLTHROUGH -# endif -#else -# define RAPIDJSON_DELIBERATE_FALLTHROUGH -#endif - -//!@endcond - -//! Assertion (in non-throwing contexts). - /*! \ingroup RAPIDJSON_CONFIG - Some functions provide a \c noexcept guarantee, if the compiler supports it. - In these cases, the \ref RAPIDJSON_ASSERT macro cannot be overridden to - throw an exception. This macro adds a separate customization point for - such cases. - - Defaults to C \c assert() (as \ref RAPIDJSON_ASSERT), if \c noexcept is - supported, and to \ref RAPIDJSON_ASSERT otherwise. - */ - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_NOEXCEPT_ASSERT - -#ifndef RAPIDJSON_NOEXCEPT_ASSERT -#ifdef RAPIDJSON_ASSERT_THROWS -#include -#define RAPIDJSON_NOEXCEPT_ASSERT(x) assert(x) -#else -#define RAPIDJSON_NOEXCEPT_ASSERT(x) RAPIDJSON_ASSERT(x) -#endif // RAPIDJSON_ASSERT_THROWS -#endif // RAPIDJSON_NOEXCEPT_ASSERT - -/////////////////////////////////////////////////////////////////////////////// -// malloc/realloc/free - -#ifndef RAPIDJSON_MALLOC -///! customization point for global \c malloc -#define RAPIDJSON_MALLOC(size) std::malloc(size) -#endif -#ifndef RAPIDJSON_REALLOC -///! customization point for global \c realloc -#define RAPIDJSON_REALLOC(ptr, new_size) std::realloc(ptr, new_size) -#endif -#ifndef RAPIDJSON_FREE -///! customization point for global \c free -#define RAPIDJSON_FREE(ptr) std::free(ptr) -#endif - -/////////////////////////////////////////////////////////////////////////////// -// new/delete - -#ifndef RAPIDJSON_NEW -///! customization point for global \c new -#define RAPIDJSON_NEW(TypeName) new TypeName -#endif -#ifndef RAPIDJSON_DELETE -///! customization point for global \c delete -#define RAPIDJSON_DELETE(x) delete x -#endif - -/////////////////////////////////////////////////////////////////////////////// -// Type - -/*! \namespace rapidjson - \brief main RapidJSON namespace - \see RAPIDJSON_NAMESPACE -*/ -RAPIDJSON_NAMESPACE_BEGIN - -//! Type of JSON value -enum Type { - kNullType = 0, //!< null - kFalseType = 1, //!< false - kTrueType = 2, //!< true - kObjectType = 3, //!< object - kArrayType = 4, //!< array - kStringType = 5, //!< string - kNumberType = 6 //!< number -}; - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/reader.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/reader.h deleted file mode 100644 index 86c1f28..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/reader.h +++ /dev/null @@ -1,2246 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_READER_H_ -#define RAPIDJSON_READER_H_ - -/*! \file reader.h */ - -#include "allocators.h" -#include "stream.h" -#include "encodedstream.h" -#include "internal/clzll.h" -#include "internal/meta.h" -#include "internal/stack.h" -#include "internal/strtod.h" -#include - -#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER) -#include -#pragma intrinsic(_BitScanForward) -#endif -#ifdef RAPIDJSON_SSE42 -#include -#elif defined(RAPIDJSON_SSE2) -#include -#elif defined(RAPIDJSON_NEON) -#include -#endif - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(old-style-cast) -RAPIDJSON_DIAG_OFF(padded) -RAPIDJSON_DIAG_OFF(switch-enum) -#elif defined(_MSC_VER) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant -RAPIDJSON_DIAG_OFF(4702) // unreachable code -#endif - -#ifdef __GNUC__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(effc++) -#endif - -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -#define RAPIDJSON_NOTHING /* deliberately empty */ -#ifndef RAPIDJSON_PARSE_ERROR_EARLY_RETURN -#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN(value) \ - RAPIDJSON_MULTILINEMACRO_BEGIN \ - if (RAPIDJSON_UNLIKELY(HasParseError())) { return value; } \ - RAPIDJSON_MULTILINEMACRO_END -#endif -#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID \ - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(RAPIDJSON_NOTHING) -//!@endcond - -/*! \def RAPIDJSON_PARSE_ERROR_NORETURN - \ingroup RAPIDJSON_ERRORS - \brief Macro to indicate a parse error. - \param parseErrorCode \ref rapidjson::ParseErrorCode of the error - \param offset position of the error in JSON input (\c size_t) - - This macros can be used as a customization point for the internal - error handling mechanism of RapidJSON. - - A common usage model is to throw an exception instead of requiring the - caller to explicitly check the \ref rapidjson::GenericReader::Parse's - return value: - - \code - #define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode,offset) \ - throw ParseException(parseErrorCode, #parseErrorCode, offset) - - #include // std::runtime_error - #include "rapidjson/error/error.h" // rapidjson::ParseResult - - struct ParseException : std::runtime_error, rapidjson::ParseResult { - ParseException(rapidjson::ParseErrorCode code, const char* msg, size_t offset) - : std::runtime_error(msg), ParseResult(code, offset) {} - }; - - #include "rapidjson/reader.h" - \endcode - - \see RAPIDJSON_PARSE_ERROR, rapidjson::GenericReader::Parse - */ -#ifndef RAPIDJSON_PARSE_ERROR_NORETURN -#define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) \ - RAPIDJSON_MULTILINEMACRO_BEGIN \ - RAPIDJSON_ASSERT(!HasParseError()); /* Error can only be assigned once */ \ - SetParseError(parseErrorCode, offset); \ - RAPIDJSON_MULTILINEMACRO_END -#endif - -/*! \def RAPIDJSON_PARSE_ERROR - \ingroup RAPIDJSON_ERRORS - \brief (Internal) macro to indicate and handle a parse error. - \param parseErrorCode \ref rapidjson::ParseErrorCode of the error - \param offset position of the error in JSON input (\c size_t) - - Invokes RAPIDJSON_PARSE_ERROR_NORETURN and stops the parsing. - - \see RAPIDJSON_PARSE_ERROR_NORETURN - \hideinitializer - */ -#ifndef RAPIDJSON_PARSE_ERROR -#define RAPIDJSON_PARSE_ERROR(parseErrorCode, offset) \ - RAPIDJSON_MULTILINEMACRO_BEGIN \ - RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset); \ - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; \ - RAPIDJSON_MULTILINEMACRO_END -#endif - -#include "error/error.h" // ParseErrorCode, ParseResult - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// ParseFlag - -/*! \def RAPIDJSON_PARSE_DEFAULT_FLAGS - \ingroup RAPIDJSON_CONFIG - \brief User-defined kParseDefaultFlags definition. - - User can define this as any \c ParseFlag combinations. -*/ -#ifndef RAPIDJSON_PARSE_DEFAULT_FLAGS -#define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseNoFlags -#endif - -//! Combination of parseFlags -/*! \see Reader::Parse, Document::Parse, Document::ParseInsitu, Document::ParseStream - */ -enum ParseFlag { - kParseNoFlags = 0, //!< No flags are set. - kParseInsituFlag = 1, //!< In-situ(destructive) parsing. - kParseValidateEncodingFlag = 2, //!< Validate encoding of JSON strings. - kParseIterativeFlag = 4, //!< Iterative(constant complexity in terms of function call stack size) parsing. - kParseStopWhenDoneFlag = 8, //!< After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate kParseErrorDocumentRootNotSingular error. - kParseFullPrecisionFlag = 16, //!< Parse number in full precision (but slower). - kParseCommentsFlag = 32, //!< Allow one-line (//) and multi-line (/**/) comments. - kParseNumbersAsStringsFlag = 64, //!< Parse all numbers (ints/doubles) as strings. - kParseTrailingCommasFlag = 128, //!< Allow trailing commas at the end of objects and arrays. - kParseNanAndInfFlag = 256, //!< Allow parsing NaN, Inf, Infinity, -Inf and -Infinity as doubles. - kParseEscapedApostropheFlag = 512, //!< Allow escaped apostrophe in strings. - kParseDefaultFlags = RAPIDJSON_PARSE_DEFAULT_FLAGS //!< Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS -}; - -/////////////////////////////////////////////////////////////////////////////// -// Handler - -/*! \class rapidjson::Handler - \brief Concept for receiving events from GenericReader upon parsing. - The functions return true if no error occurs. If they return false, - the event publisher should terminate the process. -\code -concept Handler { - typename Ch; - - bool Null(); - bool Bool(bool b); - bool Int(int i); - bool Uint(unsigned i); - bool Int64(int64_t i); - bool Uint64(uint64_t i); - bool Double(double d); - /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length) - bool RawNumber(const Ch* str, SizeType length, bool copy); - bool String(const Ch* str, SizeType length, bool copy); - bool StartObject(); - bool Key(const Ch* str, SizeType length, bool copy); - bool EndObject(SizeType memberCount); - bool StartArray(); - bool EndArray(SizeType elementCount); -}; -\endcode -*/ -/////////////////////////////////////////////////////////////////////////////// -// BaseReaderHandler - -//! Default implementation of Handler. -/*! This can be used as base class of any reader handler. - \note implements Handler concept -*/ -template, typename Derived = void> -struct BaseReaderHandler { - typedef typename Encoding::Ch Ch; - - typedef typename internal::SelectIf, BaseReaderHandler, Derived>::Type Override; - - bool Default() { return true; } - bool Null() { return static_cast(*this).Default(); } - bool Bool(bool) { return static_cast(*this).Default(); } - bool Int(int) { return static_cast(*this).Default(); } - bool Uint(unsigned) { return static_cast(*this).Default(); } - bool Int64(int64_t) { return static_cast(*this).Default(); } - bool Uint64(uint64_t) { return static_cast(*this).Default(); } - bool Double(double) { return static_cast(*this).Default(); } - /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length) - bool RawNumber(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } - bool String(const Ch*, SizeType, bool) { return static_cast(*this).Default(); } - bool StartObject() { return static_cast(*this).Default(); } - bool Key(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } - bool EndObject(SizeType) { return static_cast(*this).Default(); } - bool StartArray() { return static_cast(*this).Default(); } - bool EndArray(SizeType) { return static_cast(*this).Default(); } -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamLocalCopy - -namespace internal { - -template::copyOptimization> -class StreamLocalCopy; - -//! Do copy optimization. -template -class StreamLocalCopy { -public: - StreamLocalCopy(Stream& original) : s(original), original_(original) {} - ~StreamLocalCopy() { original_ = s; } - - Stream s; - -private: - StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; - - Stream& original_; -}; - -//! Keep reference. -template -class StreamLocalCopy { -public: - StreamLocalCopy(Stream& original) : s(original) {} - - Stream& s; - -private: - StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; -}; - -} // namespace internal - -/////////////////////////////////////////////////////////////////////////////// -// SkipWhitespace - -//! Skip the JSON white spaces in a stream. -/*! \param is A input stream for skipping white spaces. - \note This function has SSE2/SSE4.2 specialization. -*/ -template -void SkipWhitespace(InputStream& is) { - internal::StreamLocalCopy copy(is); - InputStream& s(copy.s); - - typename InputStream::Ch c; - while ((c = s.Peek()) == ' ' || c == '\n' || c == '\r' || c == '\t') - s.Take(); -} - -inline const char* SkipWhitespace(const char* p, const char* end) { - while (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) - ++p; - return p; -} - -#ifdef RAPIDJSON_SSE42 -//! Skip whitespace with SSE 4.2 pcmpistrm instruction, testing 16 8-byte characters at once. -inline const char *SkipWhitespace_SIMD(const char* p) { - // Fast return for single non-whitespace - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // 16-byte align to the next boundary - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // The rest of string using SIMD - static const char whitespace[16] = " \n\r\t"; - const __m128i w = _mm_loadu_si128(reinterpret_cast(&whitespace[0])); - - for (;; p += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY); - if (r != 16) // some of characters is non-whitespace - return p + r; - } -} - -inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { - // Fast return for single non-whitespace - if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) - ++p; - else - return p; - - // The middle of string using SIMD - static const char whitespace[16] = " \n\r\t"; - const __m128i w = _mm_loadu_si128(reinterpret_cast(&whitespace[0])); - - for (; p <= end - 16; p += 16) { - const __m128i s = _mm_loadu_si128(reinterpret_cast(p)); - const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY); - if (r != 16) // some of characters is non-whitespace - return p + r; - } - - return SkipWhitespace(p, end); -} - -#elif defined(RAPIDJSON_SSE2) - -//! Skip whitespace with SSE2 instructions, testing 16 8-byte characters at once. -inline const char *SkipWhitespace_SIMD(const char* p) { - // Fast return for single non-whitespace - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // 16-byte align to the next boundary - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // The rest of string - #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c } - static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') }; - #undef C16 - - const __m128i w0 = _mm_loadu_si128(reinterpret_cast(&whitespaces[0][0])); - const __m128i w1 = _mm_loadu_si128(reinterpret_cast(&whitespaces[1][0])); - const __m128i w2 = _mm_loadu_si128(reinterpret_cast(&whitespaces[2][0])); - const __m128i w3 = _mm_loadu_si128(reinterpret_cast(&whitespaces[3][0])); - - for (;; p += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - __m128i x = _mm_cmpeq_epi8(s, w0); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1)); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2)); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3)); - unsigned short r = static_cast(~_mm_movemask_epi8(x)); - if (r != 0) { // some of characters may be non-whitespace -#ifdef _MSC_VER // Find the index of first non-whitespace - unsigned long offset; - _BitScanForward(&offset, r); - return p + offset; -#else - return p + __builtin_ffs(r) - 1; -#endif - } - } -} - -inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { - // Fast return for single non-whitespace - if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) - ++p; - else - return p; - - // The rest of string - #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c } - static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') }; - #undef C16 - - const __m128i w0 = _mm_loadu_si128(reinterpret_cast(&whitespaces[0][0])); - const __m128i w1 = _mm_loadu_si128(reinterpret_cast(&whitespaces[1][0])); - const __m128i w2 = _mm_loadu_si128(reinterpret_cast(&whitespaces[2][0])); - const __m128i w3 = _mm_loadu_si128(reinterpret_cast(&whitespaces[3][0])); - - for (; p <= end - 16; p += 16) { - const __m128i s = _mm_loadu_si128(reinterpret_cast(p)); - __m128i x = _mm_cmpeq_epi8(s, w0); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1)); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2)); - x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3)); - unsigned short r = static_cast(~_mm_movemask_epi8(x)); - if (r != 0) { // some of characters may be non-whitespace -#ifdef _MSC_VER // Find the index of first non-whitespace - unsigned long offset; - _BitScanForward(&offset, r); - return p + offset; -#else - return p + __builtin_ffs(r) - 1; -#endif - } - } - - return SkipWhitespace(p, end); -} - -#elif defined(RAPIDJSON_NEON) - -//! Skip whitespace with ARM Neon instructions, testing 16 8-byte characters at once. -inline const char *SkipWhitespace_SIMD(const char* p) { - // Fast return for single non-whitespace - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - // 16-byte align to the next boundary - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') - ++p; - else - return p; - - const uint8x16_t w0 = vmovq_n_u8(' '); - const uint8x16_t w1 = vmovq_n_u8('\n'); - const uint8x16_t w2 = vmovq_n_u8('\r'); - const uint8x16_t w3 = vmovq_n_u8('\t'); - - for (;; p += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, w0); - x = vorrq_u8(x, vceqq_u8(s, w1)); - x = vorrq_u8(x, vceqq_u8(s, w2)); - x = vorrq_u8(x, vceqq_u8(s, w3)); - - x = vmvnq_u8(x); // Negate - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract - uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract - - if (low == 0) { - if (high != 0) { - uint32_t lz = internal::clzll(high); - return p + 8 + (lz >> 3); - } - } else { - uint32_t lz = internal::clzll(low); - return p + (lz >> 3); - } - } -} - -inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { - // Fast return for single non-whitespace - if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) - ++p; - else - return p; - - const uint8x16_t w0 = vmovq_n_u8(' '); - const uint8x16_t w1 = vmovq_n_u8('\n'); - const uint8x16_t w2 = vmovq_n_u8('\r'); - const uint8x16_t w3 = vmovq_n_u8('\t'); - - for (; p <= end - 16; p += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, w0); - x = vorrq_u8(x, vceqq_u8(s, w1)); - x = vorrq_u8(x, vceqq_u8(s, w2)); - x = vorrq_u8(x, vceqq_u8(s, w3)); - - x = vmvnq_u8(x); // Negate - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract - uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract - - if (low == 0) { - if (high != 0) { - uint32_t lz = internal::clzll(high); - return p + 8 + (lz >> 3); - } - } else { - uint32_t lz = internal::clzll(low); - return p + (lz >> 3); - } - } - - return SkipWhitespace(p, end); -} - -#endif // RAPIDJSON_NEON - -#ifdef RAPIDJSON_SIMD -//! Template function specialization for InsituStringStream -template<> inline void SkipWhitespace(InsituStringStream& is) { - is.src_ = const_cast(SkipWhitespace_SIMD(is.src_)); -} - -//! Template function specialization for StringStream -template<> inline void SkipWhitespace(StringStream& is) { - is.src_ = SkipWhitespace_SIMD(is.src_); -} - -template<> inline void SkipWhitespace(EncodedInputStream, MemoryStream>& is) { - is.is_.src_ = SkipWhitespace_SIMD(is.is_.src_, is.is_.end_); -} -#endif // RAPIDJSON_SIMD - -/////////////////////////////////////////////////////////////////////////////// -// GenericReader - -//! SAX-style JSON parser. Use \ref Reader for UTF8 encoding and default allocator. -/*! GenericReader parses JSON text from a stream, and send events synchronously to an - object implementing Handler concept. - - It needs to allocate a stack for storing a single decoded string during - non-destructive parsing. - - For in-situ parsing, the decoded string is directly written to the source - text string, no temporary buffer is required. - - A GenericReader object can be reused for parsing multiple JSON text. - - \tparam SourceEncoding Encoding of the input stream. - \tparam TargetEncoding Encoding of the parse output. - \tparam StackAllocator Allocator type for stack. -*/ -template -class GenericReader { -public: - typedef typename SourceEncoding::Ch Ch; //!< SourceEncoding character type - - //! Constructor. - /*! \param stackAllocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing) - \param stackCapacity stack capacity in bytes for storing a single decoded string. (Only use for non-destructive parsing) - */ - GenericReader(StackAllocator* stackAllocator = 0, size_t stackCapacity = kDefaultStackCapacity) : - stack_(stackAllocator, stackCapacity), parseResult_(), state_(IterativeParsingStartState) {} - - //! Parse JSON text. - /*! \tparam parseFlags Combination of \ref ParseFlag. - \tparam InputStream Type of input stream, implementing Stream concept. - \tparam Handler Type of handler, implementing Handler concept. - \param is Input stream to be parsed. - \param handler The handler to receive events. - \return Whether the parsing is successful. - */ - template - ParseResult Parse(InputStream& is, Handler& handler) { - if (parseFlags & kParseIterativeFlag) - return IterativeParse(is, handler); - - parseResult_.Clear(); - - ClearStackOnExit scope(*this); - - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - - if (RAPIDJSON_UNLIKELY(is.Peek() == '\0')) { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentEmpty, is.Tell()); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - } - else { - ParseValue(is, handler); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - - if (!(parseFlags & kParseStopWhenDoneFlag)) { - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - - if (RAPIDJSON_UNLIKELY(is.Peek() != '\0')) { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentRootNotSingular, is.Tell()); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - } - } - } - - return parseResult_; - } - - //! Parse JSON text (with \ref kParseDefaultFlags) - /*! \tparam InputStream Type of input stream, implementing Stream concept - \tparam Handler Type of handler, implementing Handler concept. - \param is Input stream to be parsed. - \param handler The handler to receive events. - \return Whether the parsing is successful. - */ - template - ParseResult Parse(InputStream& is, Handler& handler) { - return Parse(is, handler); - } - - //! Initialize JSON text token-by-token parsing - /*! - */ - void IterativeParseInit() { - parseResult_.Clear(); - state_ = IterativeParsingStartState; - } - - //! Parse one token from JSON text - /*! \tparam InputStream Type of input stream, implementing Stream concept - \tparam Handler Type of handler, implementing Handler concept. - \param is Input stream to be parsed. - \param handler The handler to receive events. - \return Whether the parsing is successful. - */ - template - bool IterativeParseNext(InputStream& is, Handler& handler) { - while (RAPIDJSON_LIKELY(is.Peek() != '\0')) { - SkipWhitespaceAndComments(is); - - Token t = Tokenize(is.Peek()); - IterativeParsingState n = Predict(state_, t); - IterativeParsingState d = Transit(state_, t, n, is, handler); - - // If we've finished or hit an error... - if (RAPIDJSON_UNLIKELY(IsIterativeParsingCompleteState(d))) { - // Report errors. - if (d == IterativeParsingErrorState) { - HandleError(state_, is); - return false; - } - - // Transition to the finish state. - RAPIDJSON_ASSERT(d == IterativeParsingFinishState); - state_ = d; - - // If StopWhenDone is not set... - if (!(parseFlags & kParseStopWhenDoneFlag)) { - // ... and extra non-whitespace data is found... - SkipWhitespaceAndComments(is); - if (is.Peek() != '\0') { - // ... this is considered an error. - HandleError(state_, is); - return false; - } - } - - // Success! We are done! - return true; - } - - // Transition to the new state. - state_ = d; - - // If we parsed anything other than a delimiter, we invoked the handler, so we can return true now. - if (!IsIterativeParsingDelimiterState(n)) - return true; - } - - // We reached the end of file. - stack_.Clear(); - - if (state_ != IterativeParsingFinishState) { - HandleError(state_, is); - return false; - } - - return true; - } - - //! Check if token-by-token parsing JSON text is complete - /*! \return Whether the JSON has been fully decoded. - */ - RAPIDJSON_FORCEINLINE bool IterativeParseComplete() const { - return IsIterativeParsingCompleteState(state_); - } - - //! Whether a parse error has occurred in the last parsing. - bool HasParseError() const { return parseResult_.IsError(); } - - //! Get the \ref ParseErrorCode of last parsing. - ParseErrorCode GetParseErrorCode() const { return parseResult_.Code(); } - - //! Get the position of last parsing error in input, 0 otherwise. - size_t GetErrorOffset() const { return parseResult_.Offset(); } - -protected: - void SetParseError(ParseErrorCode code, size_t offset) { parseResult_.Set(code, offset); } - -private: - // Prohibit copy constructor & assignment operator. - GenericReader(const GenericReader&); - GenericReader& operator=(const GenericReader&); - - void ClearStack() { stack_.Clear(); } - - // clear stack on any exit from ParseStream, e.g. due to exception - struct ClearStackOnExit { - explicit ClearStackOnExit(GenericReader& r) : r_(r) {} - ~ClearStackOnExit() { r_.ClearStack(); } - private: - GenericReader& r_; - ClearStackOnExit(const ClearStackOnExit&); - ClearStackOnExit& operator=(const ClearStackOnExit&); - }; - - template - void SkipWhitespaceAndComments(InputStream& is) { - SkipWhitespace(is); - - if (parseFlags & kParseCommentsFlag) { - while (RAPIDJSON_UNLIKELY(Consume(is, '/'))) { - if (Consume(is, '*')) { - while (true) { - if (RAPIDJSON_UNLIKELY(is.Peek() == '\0')) - RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); - else if (Consume(is, '*')) { - if (Consume(is, '/')) - break; - } - else - is.Take(); - } - } - else if (RAPIDJSON_LIKELY(Consume(is, '/'))) - while (is.Peek() != '\0' && is.Take() != '\n') {} - else - RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); - - SkipWhitespace(is); - } - } - } - - // Parse object: { string : value, ... } - template - void ParseObject(InputStream& is, Handler& handler) { - RAPIDJSON_ASSERT(is.Peek() == '{'); - is.Take(); // Skip '{' - - if (RAPIDJSON_UNLIKELY(!handler.StartObject())) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - if (Consume(is, '}')) { - if (RAPIDJSON_UNLIKELY(!handler.EndObject(0))) // empty object - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - } - - for (SizeType memberCount = 0;;) { - if (RAPIDJSON_UNLIKELY(is.Peek() != '"')) - RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); - - ParseString(is, handler, true); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - if (RAPIDJSON_UNLIKELY(!Consume(is, ':'))) - RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); - - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - ParseValue(is, handler); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - ++memberCount; - - switch (is.Peek()) { - case ',': - is.Take(); - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - break; - case '}': - is.Take(); - if (RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount))) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - default: - RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); break; // This useless break is only for making warning and coverage happy - } - - if (parseFlags & kParseTrailingCommasFlag) { - if (is.Peek() == '}') { - if (RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount))) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - is.Take(); - return; - } - } - } - } - - // Parse array: [ value, ... ] - template - void ParseArray(InputStream& is, Handler& handler) { - RAPIDJSON_ASSERT(is.Peek() == '['); - is.Take(); // Skip '[' - - if (RAPIDJSON_UNLIKELY(!handler.StartArray())) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - if (Consume(is, ']')) { - if (RAPIDJSON_UNLIKELY(!handler.EndArray(0))) // empty array - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - } - - for (SizeType elementCount = 0;;) { - ParseValue(is, handler); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - ++elementCount; - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - - if (Consume(is, ',')) { - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - } - else if (Consume(is, ']')) { - if (RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount))) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - return; - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); - - if (parseFlags & kParseTrailingCommasFlag) { - if (is.Peek() == ']') { - if (RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount))) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - is.Take(); - return; - } - } - } - } - - template - void ParseNull(InputStream& is, Handler& handler) { - RAPIDJSON_ASSERT(is.Peek() == 'n'); - is.Take(); - - if (RAPIDJSON_LIKELY(Consume(is, 'u') && Consume(is, 'l') && Consume(is, 'l'))) { - if (RAPIDJSON_UNLIKELY(!handler.Null())) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); - } - - template - void ParseTrue(InputStream& is, Handler& handler) { - RAPIDJSON_ASSERT(is.Peek() == 't'); - is.Take(); - - if (RAPIDJSON_LIKELY(Consume(is, 'r') && Consume(is, 'u') && Consume(is, 'e'))) { - if (RAPIDJSON_UNLIKELY(!handler.Bool(true))) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); - } - - template - void ParseFalse(InputStream& is, Handler& handler) { - RAPIDJSON_ASSERT(is.Peek() == 'f'); - is.Take(); - - if (RAPIDJSON_LIKELY(Consume(is, 'a') && Consume(is, 'l') && Consume(is, 's') && Consume(is, 'e'))) { - if (RAPIDJSON_UNLIKELY(!handler.Bool(false))) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); - } - - template - RAPIDJSON_FORCEINLINE static bool Consume(InputStream& is, typename InputStream::Ch expect) { - if (RAPIDJSON_LIKELY(is.Peek() == expect)) { - is.Take(); - return true; - } - else - return false; - } - - // Helper function to parse four hexadecimal digits in \uXXXX in ParseString(). - template - unsigned ParseHex4(InputStream& is, size_t escapeOffset) { - unsigned codepoint = 0; - for (int i = 0; i < 4; i++) { - Ch c = is.Peek(); - codepoint <<= 4; - codepoint += static_cast(c); - if (c >= '0' && c <= '9') - codepoint -= '0'; - else if (c >= 'A' && c <= 'F') - codepoint -= 'A' - 10; - else if (c >= 'a' && c <= 'f') - codepoint -= 'a' - 10; - else { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorStringUnicodeEscapeInvalidHex, escapeOffset); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(0); - } - is.Take(); - } - return codepoint; - } - - template - class StackStream { - public: - typedef CharType Ch; - - StackStream(internal::Stack& stack) : stack_(stack), length_(0) {} - RAPIDJSON_FORCEINLINE void Put(Ch c) { - *stack_.template Push() = c; - ++length_; - } - - RAPIDJSON_FORCEINLINE void* Push(SizeType count) { - length_ += count; - return stack_.template Push(count); - } - - size_t Length() const { return length_; } - - Ch* Pop() { - return stack_.template Pop(length_); - } - - private: - StackStream(const StackStream&); - StackStream& operator=(const StackStream&); - - internal::Stack& stack_; - SizeType length_; - }; - - // Parse string and generate String event. Different code paths for kParseInsituFlag. - template - void ParseString(InputStream& is, Handler& handler, bool isKey = false) { - internal::StreamLocalCopy copy(is); - InputStream& s(copy.s); - - RAPIDJSON_ASSERT(s.Peek() == '\"'); - s.Take(); // Skip '\"' - - bool success = false; - if (parseFlags & kParseInsituFlag) { - typename InputStream::Ch *head = s.PutBegin(); - ParseStringToStream(s, s); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - size_t length = s.PutEnd(head) - 1; - RAPIDJSON_ASSERT(length <= 0xFFFFFFFF); - const typename TargetEncoding::Ch* const str = reinterpret_cast(head); - success = (isKey ? handler.Key(str, SizeType(length), false) : handler.String(str, SizeType(length), false)); - } - else { - StackStream stackStream(stack_); - ParseStringToStream(s, stackStream); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - SizeType length = static_cast(stackStream.Length()) - 1; - const typename TargetEncoding::Ch* const str = stackStream.Pop(); - success = (isKey ? handler.Key(str, length, true) : handler.String(str, length, true)); - } - if (RAPIDJSON_UNLIKELY(!success)) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell()); - } - - // Parse string to an output is - // This function handles the prefix/suffix double quotes, escaping, and optional encoding validation. - template - RAPIDJSON_FORCEINLINE void ParseStringToStream(InputStream& is, OutputStream& os) { -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - static const char escape[256] = { - Z16, Z16, 0, 0,'\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/', - Z16, Z16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, - 0, 0,'\b', 0, 0, 0,'\f', 0, 0, 0, 0, 0, 0, 0,'\n', 0, - 0, 0,'\r', 0,'\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 - }; -#undef Z16 -//!@endcond - - for (;;) { - // Scan and copy string before "\\\"" or < 0x20. This is an optional optimization. - if (!(parseFlags & kParseValidateEncodingFlag)) - ScanCopyUnescapedString(is, os); - - Ch c = is.Peek(); - if (RAPIDJSON_UNLIKELY(c == '\\')) { // Escape - size_t escapeOffset = is.Tell(); // For invalid escaping, report the initial '\\' as error offset - is.Take(); - Ch e = is.Peek(); - if ((sizeof(Ch) == 1 || unsigned(e) < 256) && RAPIDJSON_LIKELY(escape[static_cast(e)])) { - is.Take(); - os.Put(static_cast(escape[static_cast(e)])); - } - else if ((parseFlags & kParseEscapedApostropheFlag) && RAPIDJSON_LIKELY(e == '\'')) { // Allow escaped apostrophe - is.Take(); - os.Put('\''); - } - else if (RAPIDJSON_LIKELY(e == 'u')) { // Unicode - is.Take(); - unsigned codepoint = ParseHex4(is, escapeOffset); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - if (RAPIDJSON_UNLIKELY(codepoint >= 0xD800 && codepoint <= 0xDFFF)) { - // high surrogate, check if followed by valid low surrogate - if (RAPIDJSON_LIKELY(codepoint <= 0xDBFF)) { - // Handle UTF-16 surrogate pair - if (RAPIDJSON_UNLIKELY(!Consume(is, '\\') || !Consume(is, 'u'))) - RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); - unsigned codepoint2 = ParseHex4(is, escapeOffset); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; - if (RAPIDJSON_UNLIKELY(codepoint2 < 0xDC00 || codepoint2 > 0xDFFF)) - RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); - codepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000; - } - // single low surrogate - else - { - RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); - } - } - TEncoding::Encode(os, codepoint); - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, escapeOffset); - } - else if (RAPIDJSON_UNLIKELY(c == '"')) { // Closing double quote - is.Take(); - os.Put('\0'); // null-terminate the string - return; - } - else if (RAPIDJSON_UNLIKELY(static_cast(c) < 0x20)) { // RFC 4627: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF - if (c == '\0') - RAPIDJSON_PARSE_ERROR(kParseErrorStringMissQuotationMark, is.Tell()); - else - RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, is.Tell()); - } - else { - size_t offset = is.Tell(); - if (RAPIDJSON_UNLIKELY((parseFlags & kParseValidateEncodingFlag ? - !Transcoder::Validate(is, os) : - !Transcoder::Transcode(is, os)))) - RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, offset); - } - } - } - - template - static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InputStream&, OutputStream&) { - // Do nothing for generic version - } - -#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) - // StringStream -> StackStream - static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream& os) { - const char* p = is.src_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = p; - return; - } - else - os.Put(*p++); - - // The rest of string using SIMD - static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; - static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; - static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; - const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); - const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); - const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); - - for (;; p += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - const __m128i t1 = _mm_cmpeq_epi8(s, dq); - const __m128i t2 = _mm_cmpeq_epi8(s, bs); - const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F - const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); - unsigned short r = static_cast(_mm_movemask_epi8(x)); - if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped - SizeType length; - #ifdef _MSC_VER // Find the index of first escaped - unsigned long offset; - _BitScanForward(&offset, r); - length = offset; - #else - length = static_cast(__builtin_ffs(r) - 1); - #endif - if (length != 0) { - char* q = reinterpret_cast(os.Push(length)); - for (size_t i = 0; i < length; i++) - q[i] = p[i]; - - p += length; - } - break; - } - _mm_storeu_si128(reinterpret_cast<__m128i *>(os.Push(16)), s); - } - - is.src_ = p; - } - - // InsituStringStream -> InsituStringStream - static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) { - RAPIDJSON_ASSERT(&is == &os); - (void)os; - - if (is.src_ == is.dst_) { - SkipUnescapedString(is); - return; - } - - char* p = is.src_; - char *q = is.dst_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = p; - is.dst_ = q; - return; - } - else - *q++ = *p++; - - // The rest of string using SIMD - static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; - static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; - static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; - const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); - const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); - const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); - - for (;; p += 16, q += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - const __m128i t1 = _mm_cmpeq_epi8(s, dq); - const __m128i t2 = _mm_cmpeq_epi8(s, bs); - const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F - const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); - unsigned short r = static_cast(_mm_movemask_epi8(x)); - if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped - size_t length; -#ifdef _MSC_VER // Find the index of first escaped - unsigned long offset; - _BitScanForward(&offset, r); - length = offset; -#else - length = static_cast(__builtin_ffs(r) - 1); -#endif - for (const char* pend = p + length; p != pend; ) - *q++ = *p++; - break; - } - _mm_storeu_si128(reinterpret_cast<__m128i *>(q), s); - } - - is.src_ = p; - is.dst_ = q; - } - - // When read/write pointers are the same for insitu stream, just skip unescaped characters - static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { - RAPIDJSON_ASSERT(is.src_ == is.dst_); - char* p = is.src_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - for (; p != nextAligned; p++) - if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = is.dst_ = p; - return; - } - - // The rest of string using SIMD - static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; - static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; - static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; - const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); - const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); - const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); - - for (;; p += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - const __m128i t1 = _mm_cmpeq_epi8(s, dq); - const __m128i t2 = _mm_cmpeq_epi8(s, bs); - const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F - const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); - unsigned short r = static_cast(_mm_movemask_epi8(x)); - if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped - size_t length; -#ifdef _MSC_VER // Find the index of first escaped - unsigned long offset; - _BitScanForward(&offset, r); - length = offset; -#else - length = static_cast(__builtin_ffs(r) - 1); -#endif - p += length; - break; - } - } - - is.src_ = is.dst_ = p; - } -#elif defined(RAPIDJSON_NEON) - // StringStream -> StackStream - static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream& os) { - const char* p = is.src_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = p; - return; - } - else - os.Put(*p++); - - // The rest of string using SIMD - const uint8x16_t s0 = vmovq_n_u8('"'); - const uint8x16_t s1 = vmovq_n_u8('\\'); - const uint8x16_t s2 = vmovq_n_u8('\b'); - const uint8x16_t s3 = vmovq_n_u8(32); - - for (;; p += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, s0); - x = vorrq_u8(x, vceqq_u8(s, s1)); - x = vorrq_u8(x, vceqq_u8(s, s2)); - x = vorrq_u8(x, vcltq_u8(s, s3)); - - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract - uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract - - SizeType length = 0; - bool escaped = false; - if (low == 0) { - if (high != 0) { - uint32_t lz = internal::clzll(high); - length = 8 + (lz >> 3); - escaped = true; - } - } else { - uint32_t lz = internal::clzll(low); - length = lz >> 3; - escaped = true; - } - if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped - if (length != 0) { - char* q = reinterpret_cast(os.Push(length)); - for (size_t i = 0; i < length; i++) - q[i] = p[i]; - - p += length; - } - break; - } - vst1q_u8(reinterpret_cast(os.Push(16)), s); - } - - is.src_ = p; - } - - // InsituStringStream -> InsituStringStream - static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) { - RAPIDJSON_ASSERT(&is == &os); - (void)os; - - if (is.src_ == is.dst_) { - SkipUnescapedString(is); - return; - } - - char* p = is.src_; - char *q = is.dst_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - while (p != nextAligned) - if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = p; - is.dst_ = q; - return; - } - else - *q++ = *p++; - - // The rest of string using SIMD - const uint8x16_t s0 = vmovq_n_u8('"'); - const uint8x16_t s1 = vmovq_n_u8('\\'); - const uint8x16_t s2 = vmovq_n_u8('\b'); - const uint8x16_t s3 = vmovq_n_u8(32); - - for (;; p += 16, q += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, s0); - x = vorrq_u8(x, vceqq_u8(s, s1)); - x = vorrq_u8(x, vceqq_u8(s, s2)); - x = vorrq_u8(x, vcltq_u8(s, s3)); - - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract - uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract - - SizeType length = 0; - bool escaped = false; - if (low == 0) { - if (high != 0) { - uint32_t lz = internal::clzll(high); - length = 8 + (lz >> 3); - escaped = true; - } - } else { - uint32_t lz = internal::clzll(low); - length = lz >> 3; - escaped = true; - } - if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped - for (const char* pend = p + length; p != pend; ) { - *q++ = *p++; - } - break; - } - vst1q_u8(reinterpret_cast(q), s); - } - - is.src_ = p; - is.dst_ = q; - } - - // When read/write pointers are the same for insitu stream, just skip unescaped characters - static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { - RAPIDJSON_ASSERT(is.src_ == is.dst_); - char* p = is.src_; - - // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - for (; p != nextAligned; p++) - if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { - is.src_ = is.dst_ = p; - return; - } - - // The rest of string using SIMD - const uint8x16_t s0 = vmovq_n_u8('"'); - const uint8x16_t s1 = vmovq_n_u8('\\'); - const uint8x16_t s2 = vmovq_n_u8('\b'); - const uint8x16_t s3 = vmovq_n_u8(32); - - for (;; p += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, s0); - x = vorrq_u8(x, vceqq_u8(s, s1)); - x = vorrq_u8(x, vceqq_u8(s, s2)); - x = vorrq_u8(x, vcltq_u8(s, s3)); - - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract - uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract - - if (low == 0) { - if (high != 0) { - uint32_t lz = internal::clzll(high); - p += 8 + (lz >> 3); - break; - } - } else { - uint32_t lz = internal::clzll(low); - p += lz >> 3; - break; - } - } - - is.src_ = is.dst_ = p; - } -#endif // RAPIDJSON_NEON - - template - class NumberStream; - - template - class NumberStream { - public: - typedef typename InputStream::Ch Ch; - - NumberStream(GenericReader& reader, InputStream& s) : is(s) { (void)reader; } - - RAPIDJSON_FORCEINLINE Ch Peek() const { return is.Peek(); } - RAPIDJSON_FORCEINLINE Ch TakePush() { return is.Take(); } - RAPIDJSON_FORCEINLINE Ch Take() { return is.Take(); } - RAPIDJSON_FORCEINLINE void Push(char) {} - - size_t Tell() { return is.Tell(); } - size_t Length() { return 0; } - const StackCharacter* Pop() { return 0; } - - protected: - NumberStream& operator=(const NumberStream&); - - InputStream& is; - }; - - template - class NumberStream : public NumberStream { - typedef NumberStream Base; - public: - NumberStream(GenericReader& reader, InputStream& s) : Base(reader, s), stackStream(reader.stack_) {} - - RAPIDJSON_FORCEINLINE Ch TakePush() { - stackStream.Put(static_cast(Base::is.Peek())); - return Base::is.Take(); - } - - RAPIDJSON_FORCEINLINE void Push(StackCharacter c) { - stackStream.Put(c); - } - - size_t Length() { return stackStream.Length(); } - - const StackCharacter* Pop() { - stackStream.Put('\0'); - return stackStream.Pop(); - } - - private: - StackStream stackStream; - }; - - template - class NumberStream : public NumberStream { - typedef NumberStream Base; - public: - NumberStream(GenericReader& reader, InputStream& s) : Base(reader, s) {} - - RAPIDJSON_FORCEINLINE Ch Take() { return Base::TakePush(); } - }; - - template - void ParseNumber(InputStream& is, Handler& handler) { - typedef typename internal::SelectIf, typename TargetEncoding::Ch, char>::Type NumberCharacter; - - internal::StreamLocalCopy copy(is); - NumberStream s(*this, copy.s); - - size_t startOffset = s.Tell(); - double d = 0.0; - bool useNanOrInf = false; - - // Parse minus - bool minus = Consume(s, '-'); - - // Parse int: zero / ( digit1-9 *DIGIT ) - unsigned i = 0; - uint64_t i64 = 0; - bool use64bit = false; - int significandDigit = 0; - if (RAPIDJSON_UNLIKELY(s.Peek() == '0')) { - i = 0; - s.TakePush(); - } - else if (RAPIDJSON_LIKELY(s.Peek() >= '1' && s.Peek() <= '9')) { - i = static_cast(s.TakePush() - '0'); - - if (minus) - while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (RAPIDJSON_UNLIKELY(i >= 214748364)) { // 2^31 = 2147483648 - if (RAPIDJSON_LIKELY(i != 214748364 || s.Peek() > '8')) { - i64 = i; - use64bit = true; - break; - } - } - i = i * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - else - while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (RAPIDJSON_UNLIKELY(i >= 429496729)) { // 2^32 - 1 = 4294967295 - if (RAPIDJSON_LIKELY(i != 429496729 || s.Peek() > '5')) { - i64 = i; - use64bit = true; - break; - } - } - i = i * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - } - // Parse NaN or Infinity here - else if ((parseFlags & kParseNanAndInfFlag) && RAPIDJSON_LIKELY((s.Peek() == 'I' || s.Peek() == 'N'))) { - if (Consume(s, 'N')) { - if (Consume(s, 'a') && Consume(s, 'N')) { - d = std::numeric_limits::quiet_NaN(); - useNanOrInf = true; - } - } - else if (RAPIDJSON_LIKELY(Consume(s, 'I'))) { - if (Consume(s, 'n') && Consume(s, 'f')) { - d = (minus ? -std::numeric_limits::infinity() : std::numeric_limits::infinity()); - useNanOrInf = true; - - if (RAPIDJSON_UNLIKELY(s.Peek() == 'i' && !(Consume(s, 'i') && Consume(s, 'n') - && Consume(s, 'i') && Consume(s, 't') && Consume(s, 'y')))) { - RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); - } - } - } - - if (RAPIDJSON_UNLIKELY(!useNanOrInf)) { - RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); - } - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); - - // Parse 64bit int - bool useDouble = false; - if (use64bit) { - if (minus) - while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (RAPIDJSON_UNLIKELY(i64 >= RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC))) // 2^63 = 9223372036854775808 - if (RAPIDJSON_LIKELY(i64 != RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC) || s.Peek() > '8')) { - d = static_cast(i64); - useDouble = true; - break; - } - i64 = i64 * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - else - while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (RAPIDJSON_UNLIKELY(i64 >= RAPIDJSON_UINT64_C2(0x19999999, 0x99999999))) // 2^64 - 1 = 18446744073709551615 - if (RAPIDJSON_LIKELY(i64 != RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || s.Peek() > '5')) { - d = static_cast(i64); - useDouble = true; - break; - } - i64 = i64 * 10 + static_cast(s.TakePush() - '0'); - significandDigit++; - } - } - - // Force double for big integer - if (useDouble) { - while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - d = d * 10 + (s.TakePush() - '0'); - } - } - - // Parse frac = decimal-point 1*DIGIT - int expFrac = 0; - size_t decimalPosition; - if (Consume(s, '.')) { - decimalPosition = s.Length(); - - if (RAPIDJSON_UNLIKELY(!(s.Peek() >= '0' && s.Peek() <= '9'))) - RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissFraction, s.Tell()); - - if (!useDouble) { -#if RAPIDJSON_64BIT - // Use i64 to store significand in 64-bit architecture - if (!use64bit) - i64 = i; - - while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (i64 > RAPIDJSON_UINT64_C2(0x1FFFFF, 0xFFFFFFFF)) // 2^53 - 1 for fast path - break; - else { - i64 = i64 * 10 + static_cast(s.TakePush() - '0'); - --expFrac; - if (i64 != 0) - significandDigit++; - } - } - - d = static_cast(i64); -#else - // Use double to store significand in 32-bit architecture - d = static_cast(use64bit ? i64 : i); -#endif - useDouble = true; - } - - while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - if (significandDigit < 17) { - d = d * 10.0 + (s.TakePush() - '0'); - --expFrac; - if (RAPIDJSON_LIKELY(d > 0.0)) - significandDigit++; - } - else - s.TakePush(); - } - } - else - decimalPosition = s.Length(); // decimal position at the end of integer. - - // Parse exp = e [ minus / plus ] 1*DIGIT - int exp = 0; - if (Consume(s, 'e') || Consume(s, 'E')) { - if (!useDouble) { - d = static_cast(use64bit ? i64 : i); - useDouble = true; - } - - bool expMinus = false; - if (Consume(s, '+')) - ; - else if (Consume(s, '-')) - expMinus = true; - - if (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - exp = static_cast(s.Take() - '0'); - if (expMinus) { - // (exp + expFrac) must not underflow int => we're detecting when -exp gets - // dangerously close to INT_MIN (a pessimistic next digit 9 would push it into - // underflow territory): - // - // -(exp * 10 + 9) + expFrac >= INT_MIN - // <=> exp <= (expFrac - INT_MIN - 9) / 10 - RAPIDJSON_ASSERT(expFrac <= 0); - int maxExp = (expFrac + 2147483639) / 10; - - while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - exp = exp * 10 + static_cast(s.Take() - '0'); - if (RAPIDJSON_UNLIKELY(exp > maxExp)) { - while (RAPIDJSON_UNLIKELY(s.Peek() >= '0' && s.Peek() <= '9')) // Consume the rest of exponent - s.Take(); - } - } - } - else { // positive exp - int maxExp = 308 - expFrac; - while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { - exp = exp * 10 + static_cast(s.Take() - '0'); - if (RAPIDJSON_UNLIKELY(exp > maxExp)) - RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset); - } - } - } - else - RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissExponent, s.Tell()); - - if (expMinus) - exp = -exp; - } - - // Finish parsing, call event according to the type of number. - bool cont = true; - - if (parseFlags & kParseNumbersAsStringsFlag) { - if (parseFlags & kParseInsituFlag) { - s.Pop(); // Pop stack no matter if it will be used or not. - typename InputStream::Ch* head = is.PutBegin(); - const size_t length = s.Tell() - startOffset; - RAPIDJSON_ASSERT(length <= 0xFFFFFFFF); - // unable to insert the \0 character here, it will erase the comma after this number - const typename TargetEncoding::Ch* const str = reinterpret_cast(head); - cont = handler.RawNumber(str, SizeType(length), false); - } - else { - SizeType numCharsToCopy = static_cast(s.Length()); - GenericStringStream > srcStream(s.Pop()); - StackStream dstStream(stack_); - while (numCharsToCopy--) { - Transcoder, TargetEncoding>::Transcode(srcStream, dstStream); - } - dstStream.Put('\0'); - const typename TargetEncoding::Ch* str = dstStream.Pop(); - const SizeType length = static_cast(dstStream.Length()) - 1; - cont = handler.RawNumber(str, SizeType(length), true); - } - } - else { - size_t length = s.Length(); - const NumberCharacter* decimal = s.Pop(); // Pop stack no matter if it will be used or not. - - if (useDouble) { - int p = exp + expFrac; - if (parseFlags & kParseFullPrecisionFlag) - d = internal::StrtodFullPrecision(d, p, decimal, length, decimalPosition, exp); - else - d = internal::StrtodNormalPrecision(d, p); - - // Use > max, instead of == inf, to fix bogus warning -Wfloat-equal - if (d > (std::numeric_limits::max)()) { - // Overflow - // TODO: internal::StrtodX should report overflow (or underflow) - RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset); - } - - cont = handler.Double(minus ? -d : d); - } - else if (useNanOrInf) { - cont = handler.Double(d); - } - else { - if (use64bit) { - if (minus) - cont = handler.Int64(static_cast(~i64 + 1)); - else - cont = handler.Uint64(i64); - } - else { - if (minus) - cont = handler.Int(static_cast(~i + 1)); - else - cont = handler.Uint(i); - } - } - } - if (RAPIDJSON_UNLIKELY(!cont)) - RAPIDJSON_PARSE_ERROR(kParseErrorTermination, startOffset); - } - - // Parse any JSON value - template - void ParseValue(InputStream& is, Handler& handler) { - switch (is.Peek()) { - case 'n': ParseNull (is, handler); break; - case 't': ParseTrue (is, handler); break; - case 'f': ParseFalse (is, handler); break; - case '"': ParseString(is, handler); break; - case '{': ParseObject(is, handler); break; - case '[': ParseArray (is, handler); break; - default : - ParseNumber(is, handler); - break; - - } - } - - // Iterative Parsing - - // States - enum IterativeParsingState { - IterativeParsingFinishState = 0, // sink states at top - IterativeParsingErrorState, // sink states at top - IterativeParsingStartState, - - // Object states - IterativeParsingObjectInitialState, - IterativeParsingMemberKeyState, - IterativeParsingMemberValueState, - IterativeParsingObjectFinishState, - - // Array states - IterativeParsingArrayInitialState, - IterativeParsingElementState, - IterativeParsingArrayFinishState, - - // Single value state - IterativeParsingValueState, - - // Delimiter states (at bottom) - IterativeParsingElementDelimiterState, - IterativeParsingMemberDelimiterState, - IterativeParsingKeyValueDelimiterState, - - cIterativeParsingStateCount - }; - - // Tokens - enum Token { - LeftBracketToken = 0, - RightBracketToken, - - LeftCurlyBracketToken, - RightCurlyBracketToken, - - CommaToken, - ColonToken, - - StringToken, - FalseToken, - TrueToken, - NullToken, - NumberToken, - - kTokenCount - }; - - RAPIDJSON_FORCEINLINE Token Tokenize(Ch c) const { - -//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN -#define N NumberToken -#define N16 N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N - // Maps from ASCII to Token - static const unsigned char tokenMap[256] = { - N16, // 00~0F - N16, // 10~1F - N, N, StringToken, N, N, N, N, N, N, N, N, N, CommaToken, N, N, N, // 20~2F - N, N, N, N, N, N, N, N, N, N, ColonToken, N, N, N, N, N, // 30~3F - N16, // 40~4F - N, N, N, N, N, N, N, N, N, N, N, LeftBracketToken, N, RightBracketToken, N, N, // 50~5F - N, N, N, N, N, N, FalseToken, N, N, N, N, N, N, N, NullToken, N, // 60~6F - N, N, N, N, TrueToken, N, N, N, N, N, N, LeftCurlyBracketToken, N, RightCurlyBracketToken, N, N, // 70~7F - N16, N16, N16, N16, N16, N16, N16, N16 // 80~FF - }; -#undef N -#undef N16 -//!@endcond - - if (sizeof(Ch) == 1 || static_cast(c) < 256) - return static_cast(tokenMap[static_cast(c)]); - else - return NumberToken; - } - - RAPIDJSON_FORCEINLINE IterativeParsingState Predict(IterativeParsingState state, Token token) const { - // current state x one lookahead token -> new state - static const char G[cIterativeParsingStateCount][kTokenCount] = { - // Finish(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // Error(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // Start - { - IterativeParsingArrayInitialState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingValueState, // String - IterativeParsingValueState, // False - IterativeParsingValueState, // True - IterativeParsingValueState, // Null - IterativeParsingValueState // Number - }, - // ObjectInitial - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingObjectFinishState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingMemberKeyState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // MemberKey - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingKeyValueDelimiterState, // Colon - IterativeParsingErrorState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // MemberValue - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingObjectFinishState, // Right curly bracket - IterativeParsingMemberDelimiterState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingErrorState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // ObjectFinish(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // ArrayInitial - { - IterativeParsingArrayInitialState, // Left bracket(push Element state) - IterativeParsingArrayFinishState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket(push Element state) - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingElementState, // String - IterativeParsingElementState, // False - IterativeParsingElementState, // True - IterativeParsingElementState, // Null - IterativeParsingElementState // Number - }, - // Element - { - IterativeParsingErrorState, // Left bracket - IterativeParsingArrayFinishState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingErrorState, // Right curly bracket - IterativeParsingElementDelimiterState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingErrorState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // ArrayFinish(sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // Single Value (sink state) - { - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, - IterativeParsingErrorState - }, - // ElementDelimiter - { - IterativeParsingArrayInitialState, // Left bracket(push Element state) - IterativeParsingArrayFinishState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket(push Element state) - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingElementState, // String - IterativeParsingElementState, // False - IterativeParsingElementState, // True - IterativeParsingElementState, // Null - IterativeParsingElementState // Number - }, - // MemberDelimiter - { - IterativeParsingErrorState, // Left bracket - IterativeParsingErrorState, // Right bracket - IterativeParsingErrorState, // Left curly bracket - IterativeParsingObjectFinishState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingMemberKeyState, // String - IterativeParsingErrorState, // False - IterativeParsingErrorState, // True - IterativeParsingErrorState, // Null - IterativeParsingErrorState // Number - }, - // KeyValueDelimiter - { - IterativeParsingArrayInitialState, // Left bracket(push MemberValue state) - IterativeParsingErrorState, // Right bracket - IterativeParsingObjectInitialState, // Left curly bracket(push MemberValue state) - IterativeParsingErrorState, // Right curly bracket - IterativeParsingErrorState, // Comma - IterativeParsingErrorState, // Colon - IterativeParsingMemberValueState, // String - IterativeParsingMemberValueState, // False - IterativeParsingMemberValueState, // True - IterativeParsingMemberValueState, // Null - IterativeParsingMemberValueState // Number - }, - }; // End of G - - return static_cast(G[state][token]); - } - - // Make an advance in the token stream and state based on the candidate destination state which was returned by Transit(). - // May return a new state on state pop. - template - RAPIDJSON_FORCEINLINE IterativeParsingState Transit(IterativeParsingState src, Token token, IterativeParsingState dst, InputStream& is, Handler& handler) { - (void)token; - - switch (dst) { - case IterativeParsingErrorState: - return dst; - - case IterativeParsingObjectInitialState: - case IterativeParsingArrayInitialState: - { - // Push the state(Element or MemberValue) if we are nested in another array or value of member. - // In this way we can get the correct state on ObjectFinish or ArrayFinish by frame pop. - IterativeParsingState n = src; - if (src == IterativeParsingArrayInitialState || src == IterativeParsingElementDelimiterState) - n = IterativeParsingElementState; - else if (src == IterativeParsingKeyValueDelimiterState) - n = IterativeParsingMemberValueState; - // Push current state. - *stack_.template Push(1) = n; - // Initialize and push the member/element count. - *stack_.template Push(1) = 0; - // Call handler - bool hr = (dst == IterativeParsingObjectInitialState) ? handler.StartObject() : handler.StartArray(); - // On handler short circuits the parsing. - if (!hr) { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); - return IterativeParsingErrorState; - } - else { - is.Take(); - return dst; - } - } - - case IterativeParsingMemberKeyState: - ParseString(is, handler, true); - if (HasParseError()) - return IterativeParsingErrorState; - else - return dst; - - case IterativeParsingKeyValueDelimiterState: - RAPIDJSON_ASSERT(token == ColonToken); - is.Take(); - return dst; - - case IterativeParsingMemberValueState: - // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. - ParseValue(is, handler); - if (HasParseError()) { - return IterativeParsingErrorState; - } - return dst; - - case IterativeParsingElementState: - // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. - ParseValue(is, handler); - if (HasParseError()) { - return IterativeParsingErrorState; - } - return dst; - - case IterativeParsingMemberDelimiterState: - case IterativeParsingElementDelimiterState: - is.Take(); - // Update member/element count. - *stack_.template Top() = *stack_.template Top() + 1; - return dst; - - case IterativeParsingObjectFinishState: - { - // Transit from delimiter is only allowed when trailing commas are enabled - if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingMemberDelimiterState) { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorObjectMissName, is.Tell()); - return IterativeParsingErrorState; - } - // Get member count. - SizeType c = *stack_.template Pop(1); - // If the object is not empty, count the last member. - if (src == IterativeParsingMemberValueState) - ++c; - // Restore the state. - IterativeParsingState n = static_cast(*stack_.template Pop(1)); - // Transit to Finish state if this is the topmost scope. - if (n == IterativeParsingStartState) - n = IterativeParsingFinishState; - // Call handler - bool hr = handler.EndObject(c); - // On handler short circuits the parsing. - if (!hr) { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); - return IterativeParsingErrorState; - } - else { - is.Take(); - return n; - } - } - - case IterativeParsingArrayFinishState: - { - // Transit from delimiter is only allowed when trailing commas are enabled - if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingElementDelimiterState) { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorValueInvalid, is.Tell()); - return IterativeParsingErrorState; - } - // Get element count. - SizeType c = *stack_.template Pop(1); - // If the array is not empty, count the last element. - if (src == IterativeParsingElementState) - ++c; - // Restore the state. - IterativeParsingState n = static_cast(*stack_.template Pop(1)); - // Transit to Finish state if this is the topmost scope. - if (n == IterativeParsingStartState) - n = IterativeParsingFinishState; - // Call handler - bool hr = handler.EndArray(c); - // On handler short circuits the parsing. - if (!hr) { - RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); - return IterativeParsingErrorState; - } - else { - is.Take(); - return n; - } - } - - default: - // This branch is for IterativeParsingValueState actually. - // Use `default:` rather than - // `case IterativeParsingValueState:` is for code coverage. - - // The IterativeParsingStartState is not enumerated in this switch-case. - // It is impossible for that case. And it can be caught by following assertion. - - // The IterativeParsingFinishState is not enumerated in this switch-case either. - // It is a "derivative" state which cannot triggered from Predict() directly. - // Therefore it cannot happen here. And it can be caught by following assertion. - RAPIDJSON_ASSERT(dst == IterativeParsingValueState); - - // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. - ParseValue(is, handler); - if (HasParseError()) { - return IterativeParsingErrorState; - } - return IterativeParsingFinishState; - } - } - - template - void HandleError(IterativeParsingState src, InputStream& is) { - if (HasParseError()) { - // Error flag has been set. - return; - } - - switch (src) { - case IterativeParsingStartState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentEmpty, is.Tell()); return; - case IterativeParsingFinishState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentRootNotSingular, is.Tell()); return; - case IterativeParsingObjectInitialState: - case IterativeParsingMemberDelimiterState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); return; - case IterativeParsingMemberKeyState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); return; - case IterativeParsingMemberValueState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); return; - case IterativeParsingKeyValueDelimiterState: - case IterativeParsingArrayInitialState: - case IterativeParsingElementDelimiterState: RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); return; - default: RAPIDJSON_ASSERT(src == IterativeParsingElementState); RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); return; - } - } - - RAPIDJSON_FORCEINLINE bool IsIterativeParsingDelimiterState(IterativeParsingState s) const { - return s >= IterativeParsingElementDelimiterState; - } - - RAPIDJSON_FORCEINLINE bool IsIterativeParsingCompleteState(IterativeParsingState s) const { - return s <= IterativeParsingErrorState; - } - - template - ParseResult IterativeParse(InputStream& is, Handler& handler) { - parseResult_.Clear(); - ClearStackOnExit scope(*this); - IterativeParsingState state = IterativeParsingStartState; - - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - while (is.Peek() != '\0') { - Token t = Tokenize(is.Peek()); - IterativeParsingState n = Predict(state, t); - IterativeParsingState d = Transit(state, t, n, is, handler); - - if (d == IterativeParsingErrorState) { - HandleError(state, is); - break; - } - - state = d; - - // Do not further consume streams if a root JSON has been parsed. - if ((parseFlags & kParseStopWhenDoneFlag) && state == IterativeParsingFinishState) - break; - - SkipWhitespaceAndComments(is); - RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); - } - - // Handle the end of file. - if (state != IterativeParsingFinishState) - HandleError(state, is); - - return parseResult_; - } - - static const size_t kDefaultStackCapacity = 256; //!< Default stack capacity in bytes for storing a single decoded string. - internal::Stack stack_; //!< A stack for storing decoded string temporarily during non-destructive parsing. - ParseResult parseResult_; - IterativeParsingState state_; -}; // class GenericReader - -//! Reader with UTF8 encoding and default allocator. -typedef GenericReader, UTF8<> > Reader; - -RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) || defined(_MSC_VER) -RAPIDJSON_DIAG_POP -#endif - - -#ifdef __GNUC__ -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_READER_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/schema.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/schema.h deleted file mode 100644 index 453e43e..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/schema.h +++ /dev/null @@ -1,3262 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available-> -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip-> All rights reserved-> -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License-> You may obtain a copy of the License at -// -// http://opensource->org/licenses/MIT -// -// 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 RAPIDJSON_SCHEMA_H_ -#define RAPIDJSON_SCHEMA_H_ - -#include "document.h" -#include "pointer.h" -#include "stringbuffer.h" -#include "error/en.h" -#include "uri.h" -#include // abs, floor - -#if !defined(RAPIDJSON_SCHEMA_USE_INTERNALREGEX) -#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 1 -#else -#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 0 -#endif - -#if !RAPIDJSON_SCHEMA_USE_INTERNALREGEX && defined(RAPIDJSON_SCHEMA_USE_STDREGEX) && (__cplusplus >=201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)) -#define RAPIDJSON_SCHEMA_USE_STDREGEX 1 -#else -#define RAPIDJSON_SCHEMA_USE_STDREGEX 0 -#endif - -#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX -#include "internal/regex.h" -#elif RAPIDJSON_SCHEMA_USE_STDREGEX -#include -#endif - -#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX || RAPIDJSON_SCHEMA_USE_STDREGEX -#define RAPIDJSON_SCHEMA_HAS_REGEX 1 -#else -#define RAPIDJSON_SCHEMA_HAS_REGEX 0 -#endif - -#ifndef RAPIDJSON_SCHEMA_VERBOSE -#define RAPIDJSON_SCHEMA_VERBOSE 0 -#endif - -RAPIDJSON_DIAG_PUSH - -#if defined(__GNUC__) -RAPIDJSON_DIAG_OFF(effc++) -#endif - -#ifdef __clang__ -RAPIDJSON_DIAG_OFF(weak-vtables) -RAPIDJSON_DIAG_OFF(exit-time-destructors) -RAPIDJSON_DIAG_OFF(c++98-compat-pedantic) -RAPIDJSON_DIAG_OFF(variadic-macros) -#elif defined(_MSC_VER) -RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// Verbose Utilities - -#if RAPIDJSON_SCHEMA_VERBOSE - -namespace internal { - -inline void PrintInvalidKeywordData(const char* keyword) { - printf(" Fail keyword: '%s'\n", keyword); -} - -inline void PrintInvalidKeywordData(const wchar_t* keyword) { - wprintf(L" Fail keyword: '%ls'\n", keyword); -} - -inline void PrintInvalidDocumentData(const char* document) { - printf(" Fail document: '%s'\n", document); -} - -inline void PrintInvalidDocumentData(const wchar_t* document) { - wprintf(L" Fail document: '%ls'\n", document); -} - -inline void PrintValidatorPointersData(const char* s, const char* d, unsigned depth) { - printf(" Sch: %*s'%s'\n Doc: %*s'%s'\n", depth * 4, " ", s, depth * 4, " ", d); -} - -inline void PrintValidatorPointersData(const wchar_t* s, const wchar_t* d, unsigned depth) { - wprintf(L" Sch: %*ls'%ls'\n Doc: %*ls'%ls'\n", depth * 4, L" ", s, depth * 4, L" ", d); -} - -inline void PrintSchemaIdsData(const char* base, const char* local, const char* resolved) { - printf(" Resolving id: Base: '%s', Local: '%s', Resolved: '%s'\n", base, local, resolved); -} - -inline void PrintSchemaIdsData(const wchar_t* base, const wchar_t* local, const wchar_t* resolved) { - wprintf(L" Resolving id: Base: '%ls', Local: '%ls', Resolved: '%ls'\n", base, local, resolved); -} - -inline void PrintMethodData(const char* method) { - printf("%s\n", method); -} - -inline void PrintMethodData(const char* method, bool b) { - printf("%s, Data: '%s'\n", method, b ? "true" : "false"); -} - -inline void PrintMethodData(const char* method, int64_t i) { - printf("%s, Data: '%" PRId64 "'\n", method, i); -} - -inline void PrintMethodData(const char* method, uint64_t u) { - printf("%s, Data: '%" PRIu64 "'\n", method, u); -} - -inline void PrintMethodData(const char* method, double d) { - printf("%s, Data: '%lf'\n", method, d); -} - -inline void PrintMethodData(const char* method, const char* s) { - printf("%s, Data: '%s'\n", method, s); -} - -inline void PrintMethodData(const char* method, const wchar_t* s) { - wprintf(L"%hs, Data: '%ls'\n", method, s); -} - -inline void PrintMethodData(const char* method, const char* s1, const char* s2) { - printf("%s, Data: '%s', '%s'\n", method, s1, s2); -} - -inline void PrintMethodData(const char* method, const wchar_t* s1, const wchar_t* s2) { - wprintf(L"%hs, Data: '%ls', '%ls'\n", method, s1, s2); -} - -} // namespace internal - -#endif // RAPIDJSON_SCHEMA_VERBOSE - -#ifndef RAPIDJSON_SCHEMA_PRINT -#if RAPIDJSON_SCHEMA_VERBOSE -#define RAPIDJSON_SCHEMA_PRINT(name, ...) internal::Print##name##Data(__VA_ARGS__) -#else -#define RAPIDJSON_SCHEMA_PRINT(name, ...) -#endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_INVALID_KEYWORD_RETURN - -#define RAPIDJSON_INVALID_KEYWORD_RETURN(code)\ -RAPIDJSON_MULTILINEMACRO_BEGIN\ - context.invalidCode = code;\ - context.invalidKeyword = SchemaType::GetValidateErrorKeyword(code).GetString();\ - RAPIDJSON_SCHEMA_PRINT(InvalidKeyword, context.invalidKeyword);\ - return false;\ -RAPIDJSON_MULTILINEMACRO_END - -/////////////////////////////////////////////////////////////////////////////// -// ValidateFlag - -/*! \def RAPIDJSON_VALIDATE_DEFAULT_FLAGS - \ingroup RAPIDJSON_CONFIG - \brief User-defined kValidateDefaultFlags definition. - - User can define this as any \c ValidateFlag combinations. -*/ -#ifndef RAPIDJSON_VALIDATE_DEFAULT_FLAGS -#define RAPIDJSON_VALIDATE_DEFAULT_FLAGS kValidateNoFlags -#endif - -//! Combination of validate flags -/*! \see - */ -enum ValidateFlag { - kValidateNoFlags = 0, //!< No flags are set. - kValidateContinueOnErrorFlag = 1, //!< Don't stop after first validation error. - kValidateReadFlag = 2, //!< Validation is for a read semantic. - kValidateWriteFlag = 4, //!< Validation is for a write semantic. - kValidateDefaultFlags = RAPIDJSON_VALIDATE_DEFAULT_FLAGS //!< Default validate flags. Can be customized by defining RAPIDJSON_VALIDATE_DEFAULT_FLAGS -}; - -/////////////////////////////////////////////////////////////////////////////// -// Specification -enum SchemaDraft { - kDraftUnknown = -1, - kDraftNone = 0, - kDraft03 = 3, - kDraftMin = 4, //!< Current minimum supported draft - kDraft04 = 4, - kDraft05 = 5, - kDraftMax = 5, //!< Current maximum supported draft - kDraft06 = 6, - kDraft07 = 7, - kDraft2019_09 = 8, - kDraft2020_12 = 9 -}; - -enum OpenApiVersion { - kVersionUnknown = -1, - kVersionNone = 0, - kVersionMin = 2, //!< Current minimum supported version - kVersion20 = 2, - kVersion30 = 3, - kVersionMax = 3, //!< Current maximum supported version - kVersion31 = 4, -}; - -struct Specification { - Specification(SchemaDraft d) : draft(d), oapi(kVersionNone) {} - Specification(OpenApiVersion o) : oapi(o) { - if (oapi == kVersion20) draft = kDraft04; - else if (oapi == kVersion30) draft = kDraft05; - else if (oapi == kVersion31) draft = kDraft2020_12; - else draft = kDraft04; - } - ~Specification() {} - bool IsSupported() const { - return ((draft >= kDraftMin && draft <= kDraftMax) && ((oapi == kVersionNone) || (oapi >= kVersionMin && oapi <= kVersionMax))); - } - SchemaDraft draft; - OpenApiVersion oapi; -}; - -/////////////////////////////////////////////////////////////////////////////// -// Forward declarations - -template -class GenericSchemaDocument; - -namespace internal { - -template -class Schema; - -/////////////////////////////////////////////////////////////////////////////// -// ISchemaValidator - -class ISchemaValidator { -public: - virtual ~ISchemaValidator() {} - virtual bool IsValid() const = 0; - virtual void SetValidateFlags(unsigned flags) = 0; - virtual unsigned GetValidateFlags() const = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// -// ISchemaStateFactory - -template -class ISchemaStateFactory { -public: - virtual ~ISchemaStateFactory() {} - virtual ISchemaValidator* CreateSchemaValidator(const SchemaType&, const bool inheritContinueOnErrors) = 0; - virtual void DestroySchemaValidator(ISchemaValidator* validator) = 0; - virtual void* CreateHasher() = 0; - virtual uint64_t GetHashCode(void* hasher) = 0; - virtual void DestroyHasher(void* hasher) = 0; - virtual void* MallocState(size_t size) = 0; - virtual void FreeState(void* p) = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// -// IValidationErrorHandler - -template -class IValidationErrorHandler { -public: - typedef typename SchemaType::Ch Ch; - typedef typename SchemaType::SValue SValue; - - virtual ~IValidationErrorHandler() {} - - virtual void NotMultipleOf(int64_t actual, const SValue& expected) = 0; - virtual void NotMultipleOf(uint64_t actual, const SValue& expected) = 0; - virtual void NotMultipleOf(double actual, const SValue& expected) = 0; - virtual void AboveMaximum(int64_t actual, const SValue& expected, bool exclusive) = 0; - virtual void AboveMaximum(uint64_t actual, const SValue& expected, bool exclusive) = 0; - virtual void AboveMaximum(double actual, const SValue& expected, bool exclusive) = 0; - virtual void BelowMinimum(int64_t actual, const SValue& expected, bool exclusive) = 0; - virtual void BelowMinimum(uint64_t actual, const SValue& expected, bool exclusive) = 0; - virtual void BelowMinimum(double actual, const SValue& expected, bool exclusive) = 0; - - virtual void TooLong(const Ch* str, SizeType length, SizeType expected) = 0; - virtual void TooShort(const Ch* str, SizeType length, SizeType expected) = 0; - virtual void DoesNotMatch(const Ch* str, SizeType length) = 0; - - virtual void DisallowedItem(SizeType index) = 0; - virtual void TooFewItems(SizeType actualCount, SizeType expectedCount) = 0; - virtual void TooManyItems(SizeType actualCount, SizeType expectedCount) = 0; - virtual void DuplicateItems(SizeType index1, SizeType index2) = 0; - - virtual void TooManyProperties(SizeType actualCount, SizeType expectedCount) = 0; - virtual void TooFewProperties(SizeType actualCount, SizeType expectedCount) = 0; - virtual void StartMissingProperties() = 0; - virtual void AddMissingProperty(const SValue& name) = 0; - virtual bool EndMissingProperties() = 0; - virtual void PropertyViolations(ISchemaValidator** subvalidators, SizeType count) = 0; - virtual void DisallowedProperty(const Ch* name, SizeType length) = 0; - - virtual void StartDependencyErrors() = 0; - virtual void StartMissingDependentProperties() = 0; - virtual void AddMissingDependentProperty(const SValue& targetName) = 0; - virtual void EndMissingDependentProperties(const SValue& sourceName) = 0; - virtual void AddDependencySchemaError(const SValue& sourceName, ISchemaValidator* subvalidator) = 0; - virtual bool EndDependencyErrors() = 0; - - virtual void DisallowedValue(const ValidateErrorCode code) = 0; - virtual void StartDisallowedType() = 0; - virtual void AddExpectedType(const typename SchemaType::ValueType& expectedType) = 0; - virtual void EndDisallowedType(const typename SchemaType::ValueType& actualType) = 0; - virtual void NotAllOf(ISchemaValidator** subvalidators, SizeType count) = 0; - virtual void NoneOf(ISchemaValidator** subvalidators, SizeType count) = 0; - virtual void NotOneOf(ISchemaValidator** subvalidators, SizeType count) = 0; - virtual void MultipleOneOf(SizeType index1, SizeType index2) = 0; - virtual void Disallowed() = 0; - virtual void DisallowedWhenWriting() = 0; - virtual void DisallowedWhenReading() = 0; -}; - - -/////////////////////////////////////////////////////////////////////////////// -// Hasher - -// For comparison of compound value -template -class Hasher { -public: - typedef typename Encoding::Ch Ch; - - Hasher(Allocator* allocator = 0, size_t stackCapacity = kDefaultSize) : stack_(allocator, stackCapacity) {} - - bool Null() { return WriteType(kNullType); } - bool Bool(bool b) { return WriteType(b ? kTrueType : kFalseType); } - bool Int(int i) { Number n; n.u.i = i; n.d = static_cast(i); return WriteNumber(n); } - bool Uint(unsigned u) { Number n; n.u.u = u; n.d = static_cast(u); return WriteNumber(n); } - bool Int64(int64_t i) { Number n; n.u.i = i; n.d = static_cast(i); return WriteNumber(n); } - bool Uint64(uint64_t u) { Number n; n.u.u = u; n.d = static_cast(u); return WriteNumber(n); } - bool Double(double d) { - Number n; - if (d < 0) n.u.i = static_cast(d); - else n.u.u = static_cast(d); - n.d = d; - return WriteNumber(n); - } - - bool RawNumber(const Ch* str, SizeType len, bool) { - WriteBuffer(kNumberType, str, len * sizeof(Ch)); - return true; - } - - bool String(const Ch* str, SizeType len, bool) { - WriteBuffer(kStringType, str, len * sizeof(Ch)); - return true; - } - - bool StartObject() { return true; } - bool Key(const Ch* str, SizeType len, bool copy) { return String(str, len, copy); } - bool EndObject(SizeType memberCount) { - uint64_t h = Hash(0, kObjectType); - uint64_t* kv = stack_.template Pop(memberCount * 2); - for (SizeType i = 0; i < memberCount; i++) - h ^= Hash(kv[i * 2], kv[i * 2 + 1]); // Use xor to achieve member order insensitive - *stack_.template Push() = h; - return true; - } - - bool StartArray() { return true; } - bool EndArray(SizeType elementCount) { - uint64_t h = Hash(0, kArrayType); - uint64_t* e = stack_.template Pop(elementCount); - for (SizeType i = 0; i < elementCount; i++) - h = Hash(h, e[i]); // Use hash to achieve element order sensitive - *stack_.template Push() = h; - return true; - } - - bool IsValid() const { return stack_.GetSize() == sizeof(uint64_t); } - - uint64_t GetHashCode() const { - RAPIDJSON_ASSERT(IsValid()); - return *stack_.template Top(); - } - -private: - static const size_t kDefaultSize = 256; - struct Number { - union U { - uint64_t u; - int64_t i; - }u; - double d; - }; - - bool WriteType(Type type) { return WriteBuffer(type, 0, 0); } - - bool WriteNumber(const Number& n) { return WriteBuffer(kNumberType, &n, sizeof(n)); } - - bool WriteBuffer(Type type, const void* data, size_t len) { - // FNV-1a from http://isthe.com/chongo/tech/comp/fnv/ - uint64_t h = Hash(RAPIDJSON_UINT64_C2(0x84222325, 0xcbf29ce4), type); - const unsigned char* d = static_cast(data); - for (size_t i = 0; i < len; i++) - h = Hash(h, d[i]); - *stack_.template Push() = h; - return true; - } - - static uint64_t Hash(uint64_t h, uint64_t d) { - static const uint64_t kPrime = RAPIDJSON_UINT64_C2(0x00000100, 0x000001b3); - h ^= d; - h *= kPrime; - return h; - } - - Stack stack_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// SchemaValidationContext - -template -struct SchemaValidationContext { - typedef Schema SchemaType; - typedef ISchemaStateFactory SchemaValidatorFactoryType; - typedef IValidationErrorHandler ErrorHandlerType; - typedef typename SchemaType::ValueType ValueType; - typedef typename ValueType::Ch Ch; - - enum PatternValidatorType { - kPatternValidatorOnly, - kPatternValidatorWithProperty, - kPatternValidatorWithAdditionalProperty - }; - - SchemaValidationContext(SchemaValidatorFactoryType& f, ErrorHandlerType& eh, const SchemaType* s, unsigned fl = 0) : - factory(f), - error_handler(eh), - schema(s), - flags(fl), - valueSchema(), - invalidKeyword(), - invalidCode(), - hasher(), - arrayElementHashCodes(), - validators(), - validatorCount(), - patternPropertiesValidators(), - patternPropertiesValidatorCount(), - patternPropertiesSchemas(), - patternPropertiesSchemaCount(), - valuePatternValidatorType(kPatternValidatorOnly), - propertyExist(), - inArray(false), - valueUniqueness(false), - arrayUniqueness(false) - { - } - - ~SchemaValidationContext() { - if (hasher) - factory.DestroyHasher(hasher); - if (validators) { - for (SizeType i = 0; i < validatorCount; i++) { - if (validators[i]) { - factory.DestroySchemaValidator(validators[i]); - } - } - factory.FreeState(validators); - } - if (patternPropertiesValidators) { - for (SizeType i = 0; i < patternPropertiesValidatorCount; i++) { - if (patternPropertiesValidators[i]) { - factory.DestroySchemaValidator(patternPropertiesValidators[i]); - } - } - factory.FreeState(patternPropertiesValidators); - } - if (patternPropertiesSchemas) - factory.FreeState(patternPropertiesSchemas); - if (propertyExist) - factory.FreeState(propertyExist); - } - - SchemaValidatorFactoryType& factory; - ErrorHandlerType& error_handler; - const SchemaType* schema; - unsigned flags; - const SchemaType* valueSchema; - const Ch* invalidKeyword; - ValidateErrorCode invalidCode; - void* hasher; // Only validator access - void* arrayElementHashCodes; // Only validator access this - ISchemaValidator** validators; - SizeType validatorCount; - ISchemaValidator** patternPropertiesValidators; - SizeType patternPropertiesValidatorCount; - const SchemaType** patternPropertiesSchemas; - SizeType patternPropertiesSchemaCount; - PatternValidatorType valuePatternValidatorType; - PatternValidatorType objectPatternValidatorType; - SizeType arrayElementIndex; - bool* propertyExist; - bool inArray; - bool valueUniqueness; - bool arrayUniqueness; -}; - -/////////////////////////////////////////////////////////////////////////////// -// Schema - -template -class Schema { -public: - typedef typename SchemaDocumentType::ValueType ValueType; - typedef typename SchemaDocumentType::AllocatorType AllocatorType; - typedef typename SchemaDocumentType::PointerType PointerType; - typedef typename ValueType::EncodingType EncodingType; - typedef typename EncodingType::Ch Ch; - typedef SchemaValidationContext Context; - typedef Schema SchemaType; - typedef GenericValue SValue; - typedef IValidationErrorHandler ErrorHandler; - typedef GenericUri UriType; - friend class GenericSchemaDocument; - - Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator, const UriType& id = UriType()) : - allocator_(allocator), - uri_(schemaDocument->GetURI(), *allocator), - id_(id, allocator), - spec_(schemaDocument->GetSpecification()), - pointer_(p, allocator), - typeless_(schemaDocument->GetTypeless()), - enum_(), - enumCount_(), - not_(), - type_((1 << kTotalSchemaType) - 1), // typeless - validatorCount_(), - notValidatorIndex_(), - properties_(), - additionalPropertiesSchema_(), - patternProperties_(), - patternPropertyCount_(), - propertyCount_(), - minProperties_(), - maxProperties_(SizeType(~0)), - additionalProperties_(true), - hasDependencies_(), - hasRequired_(), - hasSchemaDependencies_(), - additionalItemsSchema_(), - itemsList_(), - itemsTuple_(), - itemsTupleCount_(), - minItems_(), - maxItems_(SizeType(~0)), - additionalItems_(true), - uniqueItems_(false), - pattern_(), - minLength_(0), - maxLength_(~SizeType(0)), - exclusiveMinimum_(false), - exclusiveMaximum_(false), - defaultValueLength_(0), - readOnly_(false), - writeOnly_(false), - nullable_(false) - { - GenericStringBuffer sb; - p.StringifyUriFragment(sb); - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Schema", sb.GetString(), id.GetString()); - - typedef typename ValueType::ConstValueIterator ConstValueIterator; - typedef typename ValueType::ConstMemberIterator ConstMemberIterator; - - // PR #1393 - // Early add this Schema and its $ref(s) in schemaDocument's map to avoid infinite - // recursion (with recursive schemas), since schemaDocument->getSchema() is always - // checked before creating a new one. Don't cache typeless_, though. - if (this != typeless_) { - typedef typename SchemaDocumentType::SchemaEntry SchemaEntry; - SchemaEntry *entry = schemaDocument->schemaMap_.template Push(); - new (entry) SchemaEntry(pointer_, this, true, allocator_); - schemaDocument->AddSchemaRefs(this); - } - - if (!value.IsObject()) - return; - - // If we have an id property, resolve it with the in-scope id - // Not supported for open api 2.0 or 3.0 - if (spec_.oapi != kVersion20 && spec_.oapi != kVersion30) - if (const ValueType* v = GetMember(value, GetIdString())) { - if (v->IsString()) { - UriType local(*v, allocator); - id_ = local.Resolve(id_, allocator); - RAPIDJSON_SCHEMA_PRINT(SchemaIds, id.GetString(), v->GetString(), id_.GetString()); - } - } - - if (const ValueType* v = GetMember(value, GetTypeString())) { - type_ = 0; - if (v->IsString()) - AddType(*v); - else if (v->IsArray()) - for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) - AddType(*itr); - } - - if (const ValueType* v = GetMember(value, GetEnumString())) { - if (v->IsArray() && v->Size() > 0) { - enum_ = static_cast(allocator_->Malloc(sizeof(uint64_t) * v->Size())); - for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) { - typedef Hasher > EnumHasherType; - char buffer[256u + 24]; - MemoryPoolAllocator hasherAllocator(buffer, sizeof(buffer)); - EnumHasherType h(&hasherAllocator, 256); - itr->Accept(h); - enum_[enumCount_++] = h.GetHashCode(); - } - } - } - - if (schemaDocument) - AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document); - - // AnyOf, OneOf, Not not supported for open api 2.0 - if (schemaDocument && spec_.oapi != kVersion20) { - AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document); - AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document); - - if (const ValueType* v = GetMember(value, GetNotString())) { - schemaDocument->CreateSchema(¬_, p.Append(GetNotString(), allocator_), *v, document, id_); - notValidatorIndex_ = validatorCount_; - validatorCount_++; - } - } - - // Object - - const ValueType* properties = GetMember(value, GetPropertiesString()); - const ValueType* required = GetMember(value, GetRequiredString()); - const ValueType* dependencies = GetMember(value, GetDependenciesString()); - { - // Gather properties from properties/required/dependencies - SValue allProperties(kArrayType); - - if (properties && properties->IsObject()) - for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) - AddUniqueElement(allProperties, itr->name); - - if (required && required->IsArray()) - for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) - if (itr->IsString()) - AddUniqueElement(allProperties, *itr); - - // Dependencies not supported for open api 2.0 and 3.0 - if (spec_.oapi != kVersion20 && spec_.oapi != kVersion30) - if (dependencies && dependencies->IsObject()) - for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) { - AddUniqueElement(allProperties, itr->name); - if (itr->value.IsArray()) - for (ConstValueIterator i = itr->value.Begin(); i != itr->value.End(); ++i) - if (i->IsString()) - AddUniqueElement(allProperties, *i); - } - - if (allProperties.Size() > 0) { - propertyCount_ = allProperties.Size(); - properties_ = static_cast(allocator_->Malloc(sizeof(Property) * propertyCount_)); - for (SizeType i = 0; i < propertyCount_; i++) { - new (&properties_[i]) Property(); - properties_[i].name = allProperties[i]; - properties_[i].schema = typeless_; - } - } - } - - if (properties && properties->IsObject()) { - PointerType q = p.Append(GetPropertiesString(), allocator_); - for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) { - SizeType index; - if (FindPropertyIndex(itr->name, &index)) - schemaDocument->CreateSchema(&properties_[index].schema, q.Append(itr->name, allocator_), itr->value, document, id_); - } - } - - // PatternProperties not supported for open api 2.0 and 3.0 - if (spec_.oapi != kVersion20 && spec_.oapi != kVersion30) - if (const ValueType* v = GetMember(value, GetPatternPropertiesString())) { - PointerType q = p.Append(GetPatternPropertiesString(), allocator_); - patternProperties_ = static_cast(allocator_->Malloc(sizeof(PatternProperty) * v->MemberCount())); - patternPropertyCount_ = 0; - - for (ConstMemberIterator itr = v->MemberBegin(); itr != v->MemberEnd(); ++itr) { - new (&patternProperties_[patternPropertyCount_]) PatternProperty(); - PointerType r = q.Append(itr->name, allocator_); - patternProperties_[patternPropertyCount_].pattern = CreatePattern(itr->name, schemaDocument, r); - schemaDocument->CreateSchema(&patternProperties_[patternPropertyCount_].schema, r, itr->value, document, id_); - patternPropertyCount_++; - } - } - - if (required && required->IsArray()) - for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) - if (itr->IsString()) { - SizeType index; - if (FindPropertyIndex(*itr, &index)) { - properties_[index].required = true; - hasRequired_ = true; - } - } - - // Dependencies not supported for open api 2.0 and 3.0 - if (spec_.oapi != kVersion20 && spec_.oapi != kVersion30) - if (dependencies && dependencies->IsObject()) { - PointerType q = p.Append(GetDependenciesString(), allocator_); - hasDependencies_ = true; - for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) { - SizeType sourceIndex; - if (FindPropertyIndex(itr->name, &sourceIndex)) { - if (itr->value.IsArray()) { - properties_[sourceIndex].dependencies = static_cast(allocator_->Malloc(sizeof(bool) * propertyCount_)); - std::memset(properties_[sourceIndex].dependencies, 0, sizeof(bool)* propertyCount_); - for (ConstValueIterator targetItr = itr->value.Begin(); targetItr != itr->value.End(); ++targetItr) { - SizeType targetIndex; - if (FindPropertyIndex(*targetItr, &targetIndex)) - properties_[sourceIndex].dependencies[targetIndex] = true; - } - } - else if (itr->value.IsObject()) { - hasSchemaDependencies_ = true; - schemaDocument->CreateSchema(&properties_[sourceIndex].dependenciesSchema, q.Append(itr->name, allocator_), itr->value, document, id_); - properties_[sourceIndex].dependenciesValidatorIndex = validatorCount_; - validatorCount_++; - } - } - } - } - - if (const ValueType* v = GetMember(value, GetAdditionalPropertiesString())) { - if (v->IsBool()) - additionalProperties_ = v->GetBool(); - else if (v->IsObject()) - schemaDocument->CreateSchema(&additionalPropertiesSchema_, p.Append(GetAdditionalPropertiesString(), allocator_), *v, document, id_); - } - - AssignIfExist(minProperties_, value, GetMinPropertiesString()); - AssignIfExist(maxProperties_, value, GetMaxPropertiesString()); - - // Array - if (const ValueType* v = GetMember(value, GetItemsString())) { - PointerType q = p.Append(GetItemsString(), allocator_); - if (v->IsObject()) // List validation - schemaDocument->CreateSchema(&itemsList_, q, *v, document, id_); - else if (v->IsArray()) { // Tuple validation - itemsTuple_ = static_cast(allocator_->Malloc(sizeof(const Schema*) * v->Size())); - SizeType index = 0; - for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr, index++) - schemaDocument->CreateSchema(&itemsTuple_[itemsTupleCount_++], q.Append(index, allocator_), *itr, document, id_); - } - } - - AssignIfExist(minItems_, value, GetMinItemsString()); - AssignIfExist(maxItems_, value, GetMaxItemsString()); - - // AdditionalItems not supported for openapi 2.0 and 3.0 - if (spec_.oapi != kVersion20 && spec_.oapi != kVersion30) - if (const ValueType* v = GetMember(value, GetAdditionalItemsString())) { - if (v->IsBool()) - additionalItems_ = v->GetBool(); - else if (v->IsObject()) - schemaDocument->CreateSchema(&additionalItemsSchema_, p.Append(GetAdditionalItemsString(), allocator_), *v, document, id_); - } - - AssignIfExist(uniqueItems_, value, GetUniqueItemsString()); - - // String - AssignIfExist(minLength_, value, GetMinLengthString()); - AssignIfExist(maxLength_, value, GetMaxLengthString()); - - if (const ValueType* v = GetMember(value, GetPatternString())) - pattern_ = CreatePattern(*v, schemaDocument, p.Append(GetPatternString(), allocator_)); - - // Number - if (const ValueType* v = GetMember(value, GetMinimumString())) - if (v->IsNumber()) - minimum_.CopyFrom(*v, *allocator_); - - if (const ValueType* v = GetMember(value, GetMaximumString())) - if (v->IsNumber()) - maximum_.CopyFrom(*v, *allocator_); - - AssignIfExist(exclusiveMinimum_, value, GetExclusiveMinimumString()); - AssignIfExist(exclusiveMaximum_, value, GetExclusiveMaximumString()); - - if (const ValueType* v = GetMember(value, GetMultipleOfString())) - if (v->IsNumber() && v->GetDouble() > 0.0) - multipleOf_.CopyFrom(*v, *allocator_); - - // Default - if (const ValueType* v = GetMember(value, GetDefaultValueString())) - if (v->IsString()) - defaultValueLength_ = v->GetStringLength(); - - // ReadOnly - open api only (until draft 7 supported) - // WriteOnly - open api 3 only (until draft 7 supported) - // Both can't be true - if (spec_.oapi != kVersionNone) - AssignIfExist(readOnly_, value, GetReadOnlyString()); - if (spec_.oapi >= kVersion30) - AssignIfExist(writeOnly_, value, GetWriteOnlyString()); - if (readOnly_ && writeOnly_) - schemaDocument->SchemaError(kSchemaErrorReadOnlyAndWriteOnly, p); - - // Nullable - open api 3 only - // If true add 'null' as allowable type - if (spec_.oapi >= kVersion30) { - AssignIfExist(nullable_, value, GetNullableString()); - if (nullable_) - AddType(GetNullString()); - } - } - - ~Schema() { - AllocatorType::Free(enum_); - if (properties_) { - for (SizeType i = 0; i < propertyCount_; i++) - properties_[i].~Property(); - AllocatorType::Free(properties_); - } - if (patternProperties_) { - for (SizeType i = 0; i < patternPropertyCount_; i++) - patternProperties_[i].~PatternProperty(); - AllocatorType::Free(patternProperties_); - } - AllocatorType::Free(itemsTuple_); -#if RAPIDJSON_SCHEMA_HAS_REGEX - if (pattern_) { - pattern_->~RegexType(); - AllocatorType::Free(pattern_); - } -#endif - } - - const SValue& GetURI() const { - return uri_; - } - - const UriType& GetId() const { - return id_; - } - - const Specification& GetSpecification() const { - return spec_; - } - - const PointerType& GetPointer() const { - return pointer_; - } - - bool BeginValue(Context& context) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::BeginValue"); - if (context.inArray) { - if (uniqueItems_) - context.valueUniqueness = true; - - if (itemsList_) - context.valueSchema = itemsList_; - else if (itemsTuple_) { - if (context.arrayElementIndex < itemsTupleCount_) - context.valueSchema = itemsTuple_[context.arrayElementIndex]; - else if (additionalItemsSchema_) - context.valueSchema = additionalItemsSchema_; - else if (additionalItems_) - context.valueSchema = typeless_; - else { - context.error_handler.DisallowedItem(context.arrayElementIndex); - // Must set valueSchema for when kValidateContinueOnErrorFlag is set, else reports spurious type error - context.valueSchema = typeless_; - // Must bump arrayElementIndex for when kValidateContinueOnErrorFlag is set - context.arrayElementIndex++; - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAdditionalItems); - } - } - else - context.valueSchema = typeless_; - - context.arrayElementIndex++; - } - return true; - } - - RAPIDJSON_FORCEINLINE bool EndValue(Context& context) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::EndValue"); - // Only check pattern properties if we have validators - if (context.patternPropertiesValidatorCount > 0) { - bool otherValid = false; - SizeType count = context.patternPropertiesValidatorCount; - if (context.objectPatternValidatorType != Context::kPatternValidatorOnly) - otherValid = context.patternPropertiesValidators[--count]->IsValid(); - - bool patternValid = true; - for (SizeType i = 0; i < count; i++) - if (!context.patternPropertiesValidators[i]->IsValid()) { - patternValid = false; - break; - } - - if (context.objectPatternValidatorType == Context::kPatternValidatorOnly) { - if (!patternValid) { - context.error_handler.PropertyViolations(context.patternPropertiesValidators, count); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPatternProperties); - } - } - else if (context.objectPatternValidatorType == Context::kPatternValidatorWithProperty) { - if (!patternValid || !otherValid) { - context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPatternProperties); - } - } - else if (!patternValid && !otherValid) { // kPatternValidatorWithAdditionalProperty) - context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPatternProperties); - } - } - - // For enums only check if we have a hasher - if (enum_ && context.hasher) { - const uint64_t h = context.factory.GetHashCode(context.hasher); - for (SizeType i = 0; i < enumCount_; i++) - if (enum_[i] == h) - goto foundEnum; - context.error_handler.DisallowedValue(kValidateErrorEnum); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorEnum); - foundEnum:; - } - - // Only check allOf etc if we have validators - if (context.validatorCount > 0) { - if (allOf_.schemas) - for (SizeType i = allOf_.begin; i < allOf_.begin + allOf_.count; i++) - if (!context.validators[i]->IsValid()) { - context.error_handler.NotAllOf(&context.validators[allOf_.begin], allOf_.count); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAllOf); - } - - if (anyOf_.schemas) { - for (SizeType i = anyOf_.begin; i < anyOf_.begin + anyOf_.count; i++) - if (context.validators[i]->IsValid()) - goto foundAny; - context.error_handler.NoneOf(&context.validators[anyOf_.begin], anyOf_.count); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAnyOf); - foundAny:; - } - - if (oneOf_.schemas) { - bool oneValid = false; - SizeType firstMatch = 0; - for (SizeType i = oneOf_.begin; i < oneOf_.begin + oneOf_.count; i++) - if (context.validators[i]->IsValid()) { - if (oneValid) { - context.error_handler.MultipleOneOf(firstMatch, i - oneOf_.begin); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorOneOfMatch); - } else { - oneValid = true; - firstMatch = i - oneOf_.begin; - } - } - if (!oneValid) { - context.error_handler.NotOneOf(&context.validators[oneOf_.begin], oneOf_.count); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorOneOf); - } - } - - if (not_ && context.validators[notValidatorIndex_]->IsValid()) { - context.error_handler.Disallowed(); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorNot); - } - } - - return true; - } - - bool Null(Context& context) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Null"); - if (!(type_ & (1 << kNullSchemaType))) { - DisallowedType(context, GetNullString()); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); - } - return CreateParallelValidator(context); - } - - bool Bool(Context& context, bool b) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Bool", b); - if (!CheckBool(context, b)) - return false; - return CreateParallelValidator(context); - } - - bool Int(Context& context, int i) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Int", (int64_t)i); - if (!CheckInt(context, i)) - return false; - return CreateParallelValidator(context); - } - - bool Uint(Context& context, unsigned u) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Uint", (uint64_t)u); - if (!CheckUint(context, u)) - return false; - return CreateParallelValidator(context); - } - - bool Int64(Context& context, int64_t i) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Int64", i); - if (!CheckInt(context, i)) - return false; - return CreateParallelValidator(context); - } - - bool Uint64(Context& context, uint64_t u) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Uint64", u); - if (!CheckUint(context, u)) - return false; - return CreateParallelValidator(context); - } - - bool Double(Context& context, double d) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Double", d); - if (!(type_ & (1 << kNumberSchemaType))) { - DisallowedType(context, GetNumberString()); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); - } - - if (!minimum_.IsNull() && !CheckDoubleMinimum(context, d)) - return false; - - if (!maximum_.IsNull() && !CheckDoubleMaximum(context, d)) - return false; - - if (!multipleOf_.IsNull() && !CheckDoubleMultipleOf(context, d)) - return false; - - return CreateParallelValidator(context); - } - - bool String(Context& context, const Ch* str, SizeType length, bool) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::String", str); - if (!(type_ & (1 << kStringSchemaType))) { - DisallowedType(context, GetStringString()); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); - } - - if (minLength_ != 0 || maxLength_ != SizeType(~0)) { - SizeType count; - if (internal::CountStringCodePoint(str, length, &count)) { - if (count < minLength_) { - context.error_handler.TooShort(str, length, minLength_); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMinLength); - } - if (count > maxLength_) { - context.error_handler.TooLong(str, length, maxLength_); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMaxLength); - } - } - } - - if (pattern_ && !IsPatternMatch(pattern_, str, length)) { - context.error_handler.DoesNotMatch(str, length); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPattern); - } - - return CreateParallelValidator(context); - } - - bool StartObject(Context& context) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::StartObject"); - if (!(type_ & (1 << kObjectSchemaType))) { - DisallowedType(context, GetObjectString()); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); - } - - if (hasDependencies_ || hasRequired_) { - context.propertyExist = static_cast(context.factory.MallocState(sizeof(bool) * propertyCount_)); - std::memset(context.propertyExist, 0, sizeof(bool) * propertyCount_); - } - - if (patternProperties_) { // pre-allocate schema array - SizeType count = patternPropertyCount_ + 1; // extra for valuePatternValidatorType - context.patternPropertiesSchemas = static_cast(context.factory.MallocState(sizeof(const SchemaType*) * count)); - context.patternPropertiesSchemaCount = 0; - std::memset(context.patternPropertiesSchemas, 0, sizeof(SchemaType*) * count); - } - - return CreateParallelValidator(context); - } - - bool Key(Context& context, const Ch* str, SizeType len, bool) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Key", str); - - if (patternProperties_) { - context.patternPropertiesSchemaCount = 0; - for (SizeType i = 0; i < patternPropertyCount_; i++) - if (patternProperties_[i].pattern && IsPatternMatch(patternProperties_[i].pattern, str, len)) { - context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = patternProperties_[i].schema; - context.valueSchema = typeless_; - } - } - - SizeType index = 0; - if (FindPropertyIndex(ValueType(str, len).Move(), &index)) { - if (context.patternPropertiesSchemaCount > 0) { - context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = properties_[index].schema; - context.valueSchema = typeless_; - context.valuePatternValidatorType = Context::kPatternValidatorWithProperty; - } - else - context.valueSchema = properties_[index].schema; - - if (context.propertyExist) - context.propertyExist[index] = true; - - return true; - } - - if (additionalPropertiesSchema_) { - if (context.patternPropertiesSchemaCount > 0) { - context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_; - context.valueSchema = typeless_; - context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty; - } - else - context.valueSchema = additionalPropertiesSchema_; - return true; - } - else if (additionalProperties_) { - context.valueSchema = typeless_; - return true; - } - - if (context.patternPropertiesSchemaCount == 0) { // patternProperties are not additional properties - // Must set valueSchema for when kValidateContinueOnErrorFlag is set, else reports spurious type error - context.valueSchema = typeless_; - context.error_handler.DisallowedProperty(str, len); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAdditionalProperties); - } - - return true; - } - - bool EndObject(Context& context, SizeType memberCount) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::EndObject"); - if (hasRequired_) { - context.error_handler.StartMissingProperties(); - for (SizeType index = 0; index < propertyCount_; index++) - if (properties_[index].required && !context.propertyExist[index]) - if (properties_[index].schema->defaultValueLength_ == 0 ) - context.error_handler.AddMissingProperty(properties_[index].name); - if (context.error_handler.EndMissingProperties()) - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorRequired); - } - - if (memberCount < minProperties_) { - context.error_handler.TooFewProperties(memberCount, minProperties_); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMinProperties); - } - - if (memberCount > maxProperties_) { - context.error_handler.TooManyProperties(memberCount, maxProperties_); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMaxProperties); - } - - if (hasDependencies_) { - context.error_handler.StartDependencyErrors(); - for (SizeType sourceIndex = 0; sourceIndex < propertyCount_; sourceIndex++) { - const Property& source = properties_[sourceIndex]; - if (context.propertyExist[sourceIndex]) { - if (source.dependencies) { - context.error_handler.StartMissingDependentProperties(); - for (SizeType targetIndex = 0; targetIndex < propertyCount_; targetIndex++) - if (source.dependencies[targetIndex] && !context.propertyExist[targetIndex]) - context.error_handler.AddMissingDependentProperty(properties_[targetIndex].name); - context.error_handler.EndMissingDependentProperties(source.name); - } - else if (source.dependenciesSchema) { - ISchemaValidator* dependenciesValidator = context.validators[source.dependenciesValidatorIndex]; - if (!dependenciesValidator->IsValid()) - context.error_handler.AddDependencySchemaError(source.name, dependenciesValidator); - } - } - } - if (context.error_handler.EndDependencyErrors()) - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorDependencies); - } - - return true; - } - - bool StartArray(Context& context) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::StartArray"); - context.arrayElementIndex = 0; - context.inArray = true; // Ensure we note that we are in an array - - if (!(type_ & (1 << kArraySchemaType))) { - DisallowedType(context, GetArrayString()); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); - } - - return CreateParallelValidator(context); - } - - bool EndArray(Context& context, SizeType elementCount) const { - RAPIDJSON_SCHEMA_PRINT(Method, "Schema::EndArray"); - context.inArray = false; - - if (elementCount < minItems_) { - context.error_handler.TooFewItems(elementCount, minItems_); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMinItems); - } - - if (elementCount > maxItems_) { - context.error_handler.TooManyItems(elementCount, maxItems_); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMaxItems); - } - - return true; - } - - static const ValueType& GetValidateErrorKeyword(ValidateErrorCode validateErrorCode) { - switch (validateErrorCode) { - case kValidateErrorMultipleOf: return GetMultipleOfString(); - case kValidateErrorMaximum: return GetMaximumString(); - case kValidateErrorExclusiveMaximum: return GetMaximumString(); // Same - case kValidateErrorMinimum: return GetMinimumString(); - case kValidateErrorExclusiveMinimum: return GetMinimumString(); // Same - - case kValidateErrorMaxLength: return GetMaxLengthString(); - case kValidateErrorMinLength: return GetMinLengthString(); - case kValidateErrorPattern: return GetPatternString(); - - case kValidateErrorMaxItems: return GetMaxItemsString(); - case kValidateErrorMinItems: return GetMinItemsString(); - case kValidateErrorUniqueItems: return GetUniqueItemsString(); - case kValidateErrorAdditionalItems: return GetAdditionalItemsString(); - - case kValidateErrorMaxProperties: return GetMaxPropertiesString(); - case kValidateErrorMinProperties: return GetMinPropertiesString(); - case kValidateErrorRequired: return GetRequiredString(); - case kValidateErrorAdditionalProperties: return GetAdditionalPropertiesString(); - case kValidateErrorPatternProperties: return GetPatternPropertiesString(); - case kValidateErrorDependencies: return GetDependenciesString(); - - case kValidateErrorEnum: return GetEnumString(); - case kValidateErrorType: return GetTypeString(); - - case kValidateErrorOneOf: return GetOneOfString(); - case kValidateErrorOneOfMatch: return GetOneOfString(); // Same - case kValidateErrorAllOf: return GetAllOfString(); - case kValidateErrorAnyOf: return GetAnyOfString(); - case kValidateErrorNot: return GetNotString(); - - case kValidateErrorReadOnly: return GetReadOnlyString(); - case kValidateErrorWriteOnly: return GetWriteOnlyString(); - - default: return GetNullString(); - } - } - - - // Generate functions for string literal according to Ch -#define RAPIDJSON_STRING_(name, ...) \ - static const ValueType& Get##name##String() {\ - static const Ch s[] = { __VA_ARGS__, '\0' };\ - static const ValueType v(s, static_cast(sizeof(s) / sizeof(Ch) - 1));\ - return v;\ - } - - RAPIDJSON_STRING_(Null, 'n', 'u', 'l', 'l') - RAPIDJSON_STRING_(Boolean, 'b', 'o', 'o', 'l', 'e', 'a', 'n') - RAPIDJSON_STRING_(Object, 'o', 'b', 'j', 'e', 'c', 't') - RAPIDJSON_STRING_(Array, 'a', 'r', 'r', 'a', 'y') - RAPIDJSON_STRING_(String, 's', 't', 'r', 'i', 'n', 'g') - RAPIDJSON_STRING_(Number, 'n', 'u', 'm', 'b', 'e', 'r') - RAPIDJSON_STRING_(Integer, 'i', 'n', 't', 'e', 'g', 'e', 'r') - RAPIDJSON_STRING_(Type, 't', 'y', 'p', 'e') - RAPIDJSON_STRING_(Enum, 'e', 'n', 'u', 'm') - RAPIDJSON_STRING_(AllOf, 'a', 'l', 'l', 'O', 'f') - RAPIDJSON_STRING_(AnyOf, 'a', 'n', 'y', 'O', 'f') - RAPIDJSON_STRING_(OneOf, 'o', 'n', 'e', 'O', 'f') - RAPIDJSON_STRING_(Not, 'n', 'o', 't') - RAPIDJSON_STRING_(Properties, 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') - RAPIDJSON_STRING_(Required, 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd') - RAPIDJSON_STRING_(Dependencies, 'd', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 'c', 'i', 'e', 's') - RAPIDJSON_STRING_(PatternProperties, 'p', 'a', 't', 't', 'e', 'r', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') - RAPIDJSON_STRING_(AdditionalProperties, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') - RAPIDJSON_STRING_(MinProperties, 'm', 'i', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') - RAPIDJSON_STRING_(MaxProperties, 'm', 'a', 'x', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') - RAPIDJSON_STRING_(Items, 'i', 't', 'e', 'm', 's') - RAPIDJSON_STRING_(MinItems, 'm', 'i', 'n', 'I', 't', 'e', 'm', 's') - RAPIDJSON_STRING_(MaxItems, 'm', 'a', 'x', 'I', 't', 'e', 'm', 's') - RAPIDJSON_STRING_(AdditionalItems, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'I', 't', 'e', 'm', 's') - RAPIDJSON_STRING_(UniqueItems, 'u', 'n', 'i', 'q', 'u', 'e', 'I', 't', 'e', 'm', 's') - RAPIDJSON_STRING_(MinLength, 'm', 'i', 'n', 'L', 'e', 'n', 'g', 't', 'h') - RAPIDJSON_STRING_(MaxLength, 'm', 'a', 'x', 'L', 'e', 'n', 'g', 't', 'h') - RAPIDJSON_STRING_(Pattern, 'p', 'a', 't', 't', 'e', 'r', 'n') - RAPIDJSON_STRING_(Minimum, 'm', 'i', 'n', 'i', 'm', 'u', 'm') - RAPIDJSON_STRING_(Maximum, 'm', 'a', 'x', 'i', 'm', 'u', 'm') - RAPIDJSON_STRING_(ExclusiveMinimum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'i', 'n', 'i', 'm', 'u', 'm') - RAPIDJSON_STRING_(ExclusiveMaximum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'a', 'x', 'i', 'm', 'u', 'm') - RAPIDJSON_STRING_(MultipleOf, 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'O', 'f') - RAPIDJSON_STRING_(DefaultValue, 'd', 'e', 'f', 'a', 'u', 'l', 't') - RAPIDJSON_STRING_(Schema, '$', 's', 'c', 'h', 'e', 'm', 'a') - RAPIDJSON_STRING_(Ref, '$', 'r', 'e', 'f') - RAPIDJSON_STRING_(Id, 'i', 'd') - RAPIDJSON_STRING_(Swagger, 's', 'w', 'a', 'g', 'g', 'e', 'r') - RAPIDJSON_STRING_(OpenApi, 'o', 'p', 'e', 'n', 'a', 'p', 'i') - RAPIDJSON_STRING_(ReadOnly, 'r', 'e', 'a', 'd', 'O', 'n', 'l', 'y') - RAPIDJSON_STRING_(WriteOnly, 'w', 'r', 'i', 't', 'e', 'O', 'n', 'l', 'y') - RAPIDJSON_STRING_(Nullable, 'n', 'u', 'l', 'l', 'a', 'b', 'l', 'e') - -#undef RAPIDJSON_STRING_ - -private: - enum SchemaValueType { - kNullSchemaType, - kBooleanSchemaType, - kObjectSchemaType, - kArraySchemaType, - kStringSchemaType, - kNumberSchemaType, - kIntegerSchemaType, - kTotalSchemaType - }; - -#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX - typedef internal::GenericRegex RegexType; -#elif RAPIDJSON_SCHEMA_USE_STDREGEX - typedef std::basic_regex RegexType; -#else - typedef char RegexType; -#endif - - struct SchemaArray { - SchemaArray() : schemas(), count() {} - ~SchemaArray() { AllocatorType::Free(schemas); } - const SchemaType** schemas; - SizeType begin; // begin index of context.validators - SizeType count; - }; - - template - void AddUniqueElement(V1& a, const V2& v) { - for (typename V1::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr) - if (*itr == v) - return; - V1 c(v, *allocator_); - a.PushBack(c, *allocator_); - } - - static const ValueType* GetMember(const ValueType& value, const ValueType& name) { - typename ValueType::ConstMemberIterator itr = value.FindMember(name); - return itr != value.MemberEnd() ? &(itr->value) : 0; - } - - static void AssignIfExist(bool& out, const ValueType& value, const ValueType& name) { - if (const ValueType* v = GetMember(value, name)) - if (v->IsBool()) - out = v->GetBool(); - } - - static void AssignIfExist(SizeType& out, const ValueType& value, const ValueType& name) { - if (const ValueType* v = GetMember(value, name)) - if (v->IsUint64() && v->GetUint64() <= SizeType(~0)) - out = static_cast(v->GetUint64()); - } - - void AssignIfExist(SchemaArray& out, SchemaDocumentType& schemaDocument, const PointerType& p, const ValueType& value, const ValueType& name, const ValueType& document) { - if (const ValueType* v = GetMember(value, name)) { - if (v->IsArray() && v->Size() > 0) { - PointerType q = p.Append(name, allocator_); - out.count = v->Size(); - out.schemas = static_cast(allocator_->Malloc(out.count * sizeof(const Schema*))); - memset(out.schemas, 0, sizeof(Schema*)* out.count); - for (SizeType i = 0; i < out.count; i++) - schemaDocument.CreateSchema(&out.schemas[i], q.Append(i, allocator_), (*v)[i], document, id_); - out.begin = validatorCount_; - validatorCount_ += out.count; - } - } - } - -#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX - template - RegexType* CreatePattern(const ValueType& value, SchemaDocumentType* sd, const PointerType& p) { - if (value.IsString()) { - RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString(), allocator_); - if (!r->IsValid()) { - sd->SchemaErrorValue(kSchemaErrorRegexInvalid, p, value.GetString(), value.GetStringLength()); - r->~RegexType(); - AllocatorType::Free(r); - r = 0; - } - return r; - } - return 0; - } - - static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType) { - GenericRegexSearch rs(*pattern); - return rs.Search(str); - } -#elif RAPIDJSON_SCHEMA_USE_STDREGEX - template - RegexType* CreatePattern(const ValueType& value, SchemaDocumentType* sd, const PointerType& p) { - if (value.IsString()) { - RegexType *r = static_cast(allocator_->Malloc(sizeof(RegexType))); - try { - return new (r) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript); - } - catch (const std::regex_error& e) { - sd->SchemaErrorValue(kSchemaErrorRegexInvalid, p, value.GetString(), value.GetStringLength()); - AllocatorType::Free(r); - } - } - return 0; - } - - static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType length) { - std::match_results r; - return std::regex_search(str, str + length, r, *pattern); - } -#else - template - RegexType* CreatePattern(const ValueType&) { - return 0; - } - - static bool IsPatternMatch(const RegexType*, const Ch *, SizeType) { return true; } -#endif // RAPIDJSON_SCHEMA_USE_STDREGEX - - void AddType(const ValueType& type) { - if (type == GetNullString() ) type_ |= 1 << kNullSchemaType; - else if (type == GetBooleanString()) type_ |= 1 << kBooleanSchemaType; - else if (type == GetObjectString() ) type_ |= 1 << kObjectSchemaType; - else if (type == GetArrayString() ) type_ |= 1 << kArraySchemaType; - else if (type == GetStringString() ) type_ |= 1 << kStringSchemaType; - else if (type == GetIntegerString()) type_ |= 1 << kIntegerSchemaType; - else if (type == GetNumberString() ) type_ |= (1 << kNumberSchemaType) | (1 << kIntegerSchemaType); - } - - // Creates parallel validators for allOf, anyOf, oneOf, not and schema dependencies, if required. - // Also creates a hasher for enums and array uniqueness, if required. - // Also a useful place to add type-independent error checks. - bool CreateParallelValidator(Context& context) const { - if (enum_ || context.arrayUniqueness) - context.hasher = context.factory.CreateHasher(); - - if (validatorCount_) { - RAPIDJSON_ASSERT(context.validators == 0); - context.validators = static_cast(context.factory.MallocState(sizeof(ISchemaValidator*) * validatorCount_)); - std::memset(context.validators, 0, sizeof(ISchemaValidator*) * validatorCount_); - context.validatorCount = validatorCount_; - - // Always return after first failure for these sub-validators - if (allOf_.schemas) - CreateSchemaValidators(context, allOf_, false); - - if (anyOf_.schemas) - CreateSchemaValidators(context, anyOf_, false); - - if (oneOf_.schemas) - CreateSchemaValidators(context, oneOf_, false); - - if (not_) - context.validators[notValidatorIndex_] = context.factory.CreateSchemaValidator(*not_, false); - - if (hasSchemaDependencies_) { - for (SizeType i = 0; i < propertyCount_; i++) - if (properties_[i].dependenciesSchema) - context.validators[properties_[i].dependenciesValidatorIndex] = context.factory.CreateSchemaValidator(*properties_[i].dependenciesSchema, false); - } - } - - // Add any other type-independent checks here - if (readOnly_ && (context.flags & kValidateWriteFlag)) { - context.error_handler.DisallowedWhenWriting(); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorReadOnly); - } - if (writeOnly_ && (context.flags & kValidateReadFlag)) { - context.error_handler.DisallowedWhenReading(); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorWriteOnly); - } - - return true; - } - - void CreateSchemaValidators(Context& context, const SchemaArray& schemas, const bool inheritContinueOnErrors) const { - for (SizeType i = 0; i < schemas.count; i++) - context.validators[schemas.begin + i] = context.factory.CreateSchemaValidator(*schemas.schemas[i], inheritContinueOnErrors); - } - - // O(n) - bool FindPropertyIndex(const ValueType& name, SizeType* outIndex) const { - SizeType len = name.GetStringLength(); - const Ch* str = name.GetString(); - for (SizeType index = 0; index < propertyCount_; index++) - if (properties_[index].name.GetStringLength() == len && - (std::memcmp(properties_[index].name.GetString(), str, sizeof(Ch) * len) == 0)) - { - *outIndex = index; - return true; - } - return false; - } - - bool CheckBool(Context& context, bool) const { - if (!(type_ & (1 << kBooleanSchemaType))) { - DisallowedType(context, GetBooleanString()); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); - } - return true; - } - - bool CheckInt(Context& context, int64_t i) const { - if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) { - DisallowedType(context, GetIntegerString()); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); - } - - if (!minimum_.IsNull()) { - if (minimum_.IsInt64()) { - if (exclusiveMinimum_ ? i <= minimum_.GetInt64() : i < minimum_.GetInt64()) { - context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); - RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum); - } - } - else if (minimum_.IsUint64()) { - context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); - RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum); // i <= max(int64_t) < minimum.GetUint64() - } - else if (!CheckDoubleMinimum(context, static_cast(i))) - return false; - } - - if (!maximum_.IsNull()) { - if (maximum_.IsInt64()) { - if (exclusiveMaximum_ ? i >= maximum_.GetInt64() : i > maximum_.GetInt64()) { - context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); - RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum); - } - } - else if (maximum_.IsUint64()) { } - /* do nothing */ // i <= max(int64_t) < maximum_.GetUint64() - else if (!CheckDoubleMaximum(context, static_cast(i))) - return false; - } - - if (!multipleOf_.IsNull()) { - if (multipleOf_.IsUint64()) { - if (static_cast(i >= 0 ? i : -i) % multipleOf_.GetUint64() != 0) { - context.error_handler.NotMultipleOf(i, multipleOf_); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf); - } - } - else if (!CheckDoubleMultipleOf(context, static_cast(i))) - return false; - } - - return true; - } - - bool CheckUint(Context& context, uint64_t i) const { - if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) { - DisallowedType(context, GetIntegerString()); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); - } - - if (!minimum_.IsNull()) { - if (minimum_.IsUint64()) { - if (exclusiveMinimum_ ? i <= minimum_.GetUint64() : i < minimum_.GetUint64()) { - context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); - RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum); - } - } - else if (minimum_.IsInt64()) - /* do nothing */; // i >= 0 > minimum.Getint64() - else if (!CheckDoubleMinimum(context, static_cast(i))) - return false; - } - - if (!maximum_.IsNull()) { - if (maximum_.IsUint64()) { - if (exclusiveMaximum_ ? i >= maximum_.GetUint64() : i > maximum_.GetUint64()) { - context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); - RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum); - } - } - else if (maximum_.IsInt64()) { - context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); - RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum); // i >= 0 > maximum_ - } - else if (!CheckDoubleMaximum(context, static_cast(i))) - return false; - } - - if (!multipleOf_.IsNull()) { - if (multipleOf_.IsUint64()) { - if (i % multipleOf_.GetUint64() != 0) { - context.error_handler.NotMultipleOf(i, multipleOf_); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf); - } - } - else if (!CheckDoubleMultipleOf(context, static_cast(i))) - return false; - } - - return true; - } - - bool CheckDoubleMinimum(Context& context, double d) const { - if (exclusiveMinimum_ ? d <= minimum_.GetDouble() : d < minimum_.GetDouble()) { - context.error_handler.BelowMinimum(d, minimum_, exclusiveMinimum_); - RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum); - } - return true; - } - - bool CheckDoubleMaximum(Context& context, double d) const { - if (exclusiveMaximum_ ? d >= maximum_.GetDouble() : d > maximum_.GetDouble()) { - context.error_handler.AboveMaximum(d, maximum_, exclusiveMaximum_); - RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum); - } - return true; - } - - bool CheckDoubleMultipleOf(Context& context, double d) const { - double a = std::abs(d), b = std::abs(multipleOf_.GetDouble()); - double q = std::floor(a / b); - double r = a - q * b; - if (r > 0.0) { - context.error_handler.NotMultipleOf(d, multipleOf_); - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf); - } - return true; - } - - void DisallowedType(Context& context, const ValueType& actualType) const { - ErrorHandler& eh = context.error_handler; - eh.StartDisallowedType(); - - if (type_ & (1 << kNullSchemaType)) eh.AddExpectedType(GetNullString()); - if (type_ & (1 << kBooleanSchemaType)) eh.AddExpectedType(GetBooleanString()); - if (type_ & (1 << kObjectSchemaType)) eh.AddExpectedType(GetObjectString()); - if (type_ & (1 << kArraySchemaType)) eh.AddExpectedType(GetArrayString()); - if (type_ & (1 << kStringSchemaType)) eh.AddExpectedType(GetStringString()); - - if (type_ & (1 << kNumberSchemaType)) eh.AddExpectedType(GetNumberString()); - else if (type_ & (1 << kIntegerSchemaType)) eh.AddExpectedType(GetIntegerString()); - - eh.EndDisallowedType(actualType); - } - - struct Property { - Property() : schema(), dependenciesSchema(), dependenciesValidatorIndex(), dependencies(), required(false) {} - ~Property() { AllocatorType::Free(dependencies); } - SValue name; - const SchemaType* schema; - const SchemaType* dependenciesSchema; - SizeType dependenciesValidatorIndex; - bool* dependencies; - bool required; - }; - - struct PatternProperty { - PatternProperty() : schema(), pattern() {} - ~PatternProperty() { - if (pattern) { - pattern->~RegexType(); - AllocatorType::Free(pattern); - } - } - const SchemaType* schema; - RegexType* pattern; - }; - - AllocatorType* allocator_; - SValue uri_; - UriType id_; - Specification spec_; - PointerType pointer_; - const SchemaType* typeless_; - uint64_t* enum_; - SizeType enumCount_; - SchemaArray allOf_; - SchemaArray anyOf_; - SchemaArray oneOf_; - const SchemaType* not_; - unsigned type_; // bitmask of kSchemaType - SizeType validatorCount_; - SizeType notValidatorIndex_; - - Property* properties_; - const SchemaType* additionalPropertiesSchema_; - PatternProperty* patternProperties_; - SizeType patternPropertyCount_; - SizeType propertyCount_; - SizeType minProperties_; - SizeType maxProperties_; - bool additionalProperties_; - bool hasDependencies_; - bool hasRequired_; - bool hasSchemaDependencies_; - - const SchemaType* additionalItemsSchema_; - const SchemaType* itemsList_; - const SchemaType** itemsTuple_; - SizeType itemsTupleCount_; - SizeType minItems_; - SizeType maxItems_; - bool additionalItems_; - bool uniqueItems_; - - RegexType* pattern_; - SizeType minLength_; - SizeType maxLength_; - - SValue minimum_; - SValue maximum_; - SValue multipleOf_; - bool exclusiveMinimum_; - bool exclusiveMaximum_; - - SizeType defaultValueLength_; - - bool readOnly_; - bool writeOnly_; - bool nullable_; -}; - -template -struct TokenHelper { - RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) { - *documentStack.template Push() = '/'; - char buffer[21]; - size_t length = static_cast((sizeof(SizeType) == 4 ? u32toa(index, buffer) : u64toa(index, buffer)) - buffer); - for (size_t i = 0; i < length; i++) - *documentStack.template Push() = static_cast(buffer[i]); - } -}; - -// Partial specialized version for char to prevent buffer copying. -template -struct TokenHelper { - RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) { - if (sizeof(SizeType) == 4) { - char *buffer = documentStack.template Push(1 + 10); // '/' + uint - *buffer++ = '/'; - const char* end = internal::u32toa(index, buffer); - documentStack.template Pop(static_cast(10 - (end - buffer))); - } - else { - char *buffer = documentStack.template Push(1 + 20); // '/' + uint64 - *buffer++ = '/'; - const char* end = internal::u64toa(index, buffer); - documentStack.template Pop(static_cast(20 - (end - buffer))); - } - } -}; - -} // namespace internal - -/////////////////////////////////////////////////////////////////////////////// -// IGenericRemoteSchemaDocumentProvider - -template -class IGenericRemoteSchemaDocumentProvider { -public: - typedef typename SchemaDocumentType::Ch Ch; - typedef typename SchemaDocumentType::ValueType ValueType; - typedef typename SchemaDocumentType::AllocatorType AllocatorType; - - virtual ~IGenericRemoteSchemaDocumentProvider() {} - virtual const SchemaDocumentType* GetRemoteDocument(const Ch* uri, SizeType length) = 0; - virtual const SchemaDocumentType* GetRemoteDocument(const GenericUri uri, Specification& spec) { - // Default implementation just calls through for compatibility - // Following line suppresses unused parameter warning - (void)spec; - // printf("GetRemoteDocument: %d %d\n", spec.draft, spec.oapi); - return GetRemoteDocument(uri.GetBaseString(), uri.GetBaseStringLength()); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// GenericSchemaDocument - -//! JSON schema document. -/*! - A JSON schema document is a compiled version of a JSON schema. - It is basically a tree of internal::Schema. - - \note This is an immutable class (i.e. its instance cannot be modified after construction). - \tparam ValueT Type of JSON value (e.g. \c Value ), which also determine the encoding. - \tparam Allocator Allocator type for allocating memory of this document. -*/ -template -class GenericSchemaDocument { -public: - typedef ValueT ValueType; - typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProviderType; - typedef Allocator AllocatorType; - typedef typename ValueType::EncodingType EncodingType; - typedef typename EncodingType::Ch Ch; - typedef internal::Schema SchemaType; - typedef GenericPointer PointerType; - typedef GenericValue GValue; - typedef GenericUri UriType; - typedef GenericStringRef StringRefType; - friend class internal::Schema; - template - friend class GenericSchemaValidator; - - //! Constructor. - /*! - Compile a JSON document into schema document. - - \param document A JSON document as source. - \param uri The base URI of this schema document for purposes of violation reporting. - \param uriLength Length of \c name, in code points. - \param remoteProvider An optional remote schema document provider for resolving remote reference. Can be null. - \param allocator An optional allocator instance for allocating memory. Can be null. - \param pointer An optional JSON pointer to the start of the schema document - \param spec Optional schema draft or OpenAPI version. Used if no specification in document. Defaults to draft-04. - */ - explicit GenericSchemaDocument(const ValueType& document, const Ch* uri = 0, SizeType uriLength = 0, - IRemoteSchemaDocumentProviderType* remoteProvider = 0, Allocator* allocator = 0, - const PointerType& pointer = PointerType(), // PR #1393 - const Specification& spec = Specification(kDraft04)) : - remoteProvider_(remoteProvider), - allocator_(allocator), - ownAllocator_(), - root_(), - typeless_(), - schemaMap_(allocator, kInitialSchemaMapSize), - schemaRef_(allocator, kInitialSchemaRefSize), - spec_(spec), - error_(kObjectType), - currentError_() - { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaDocument::GenericSchemaDocument"); - if (!allocator_) - ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); - - Ch noUri[1] = {0}; - uri_.SetString(uri ? uri : noUri, uriLength, *allocator_); - docId_ = UriType(uri_, allocator_); - - typeless_ = static_cast(allocator_->Malloc(sizeof(SchemaType))); - new (typeless_) SchemaType(this, PointerType(), ValueType(kObjectType).Move(), ValueType(kObjectType).Move(), allocator_, docId_); - - // Establish the schema draft or open api version. - // We only ever look for '$schema' or 'swagger' or 'openapi' at the root of the document. - SetSchemaSpecification(document); - - // Generate root schema, it will call CreateSchema() to create sub-schemas, - // And call HandleRefSchema() if there are $ref. - // PR #1393 use input pointer if supplied - root_ = typeless_; - if (pointer.GetTokenCount() == 0) { - CreateSchemaRecursive(&root_, pointer, document, document, docId_); - } - else if (const ValueType* v = pointer.Get(document)) { - CreateSchema(&root_, pointer, *v, document, docId_); - } - else { - GenericStringBuffer sb; - pointer.StringifyUriFragment(sb); - SchemaErrorValue(kSchemaErrorStartUnknown, PointerType(), sb.GetString(), static_cast(sb.GetSize() / sizeof(Ch))); - } - - RAPIDJSON_ASSERT(root_ != 0); - - schemaRef_.ShrinkToFit(); // Deallocate all memory for ref - } - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - //! Move constructor in C++11 - GenericSchemaDocument(GenericSchemaDocument&& rhs) RAPIDJSON_NOEXCEPT : - remoteProvider_(rhs.remoteProvider_), - allocator_(rhs.allocator_), - ownAllocator_(rhs.ownAllocator_), - root_(rhs.root_), - typeless_(rhs.typeless_), - schemaMap_(std::move(rhs.schemaMap_)), - schemaRef_(std::move(rhs.schemaRef_)), - uri_(std::move(rhs.uri_)), - docId_(std::move(rhs.docId_)), - spec_(rhs.spec_), - error_(std::move(rhs.error_)), - currentError_(std::move(rhs.currentError_)) - { - rhs.remoteProvider_ = 0; - rhs.allocator_ = 0; - rhs.ownAllocator_ = 0; - rhs.typeless_ = 0; - } -#endif - - //! Destructor - ~GenericSchemaDocument() { - while (!schemaMap_.Empty()) - schemaMap_.template Pop(1)->~SchemaEntry(); - - if (typeless_) { - typeless_->~SchemaType(); - Allocator::Free(typeless_); - } - - // these may contain some allocator data so clear before deleting ownAllocator_ - uri_.SetNull(); - error_.SetNull(); - currentError_.SetNull(); - - RAPIDJSON_DELETE(ownAllocator_); - } - - const GValue& GetURI() const { return uri_; } - - const Specification& GetSpecification() const { return spec_; } - bool IsSupportedSpecification() const { return spec_.IsSupported(); } - - //! Static method to get the specification of any schema document - // Returns kDraftNone if document is silent - static const Specification GetSpecification(const ValueType& document) { - SchemaDraft draft = GetSchemaDraft(document); - if (draft != kDraftNone) - return Specification(draft); - else { - OpenApiVersion oapi = GetOpenApiVersion(document); - if (oapi != kVersionNone) - return Specification(oapi); - } - return Specification(kDraftNone); - } - - //! Get the root schema. - const SchemaType& GetRoot() const { return *root_; } - - //! Gets the error object. - GValue& GetError() { return error_; } - const GValue& GetError() const { return error_; } - - static const StringRefType& GetSchemaErrorKeyword(SchemaErrorCode schemaErrorCode) { - switch (schemaErrorCode) { - case kSchemaErrorStartUnknown: return GetStartUnknownString(); - case kSchemaErrorRefPlainName: return GetRefPlainNameString(); - case kSchemaErrorRefInvalid: return GetRefInvalidString(); - case kSchemaErrorRefPointerInvalid: return GetRefPointerInvalidString(); - case kSchemaErrorRefUnknown: return GetRefUnknownString(); - case kSchemaErrorRefCyclical: return GetRefCyclicalString(); - case kSchemaErrorRefNoRemoteProvider: return GetRefNoRemoteProviderString(); - case kSchemaErrorRefNoRemoteSchema: return GetRefNoRemoteSchemaString(); - case kSchemaErrorRegexInvalid: return GetRegexInvalidString(); - case kSchemaErrorSpecUnknown: return GetSpecUnknownString(); - case kSchemaErrorSpecUnsupported: return GetSpecUnsupportedString(); - case kSchemaErrorSpecIllegal: return GetSpecIllegalString(); - case kSchemaErrorReadOnlyAndWriteOnly: return GetReadOnlyAndWriteOnlyString(); - default: return GetNullString(); - } - } - - //! Default error method - void SchemaError(const SchemaErrorCode code, const PointerType& location) { - currentError_ = GValue(kObjectType); - AddCurrentError(code, location); - } - - //! Method for error with single string value insert - void SchemaErrorValue(const SchemaErrorCode code, const PointerType& location, const Ch* value, SizeType length) { - currentError_ = GValue(kObjectType); - currentError_.AddMember(GetValueString(), GValue(value, length, *allocator_).Move(), *allocator_); - AddCurrentError(code, location); - } - - //! Method for error with invalid pointer - void SchemaErrorPointer(const SchemaErrorCode code, const PointerType& location, const Ch* value, SizeType length, const PointerType& pointer) { - currentError_ = GValue(kObjectType); - currentError_.AddMember(GetValueString(), GValue(value, length, *allocator_).Move(), *allocator_); - currentError_.AddMember(GetOffsetString(), static_cast(pointer.GetParseErrorOffset() / sizeof(Ch)), *allocator_); - AddCurrentError(code, location); - } - - private: - //! Prohibit copying - GenericSchemaDocument(const GenericSchemaDocument&); - //! Prohibit assignment - GenericSchemaDocument& operator=(const GenericSchemaDocument&); - - typedef const PointerType* SchemaRefPtr; // PR #1393 - - struct SchemaEntry { - SchemaEntry(const PointerType& p, SchemaType* s, bool o, Allocator* allocator) : pointer(p, allocator), schema(s), owned(o) {} - ~SchemaEntry() { - if (owned) { - schema->~SchemaType(); - Allocator::Free(schema); - } - } - PointerType pointer; - SchemaType* schema; - bool owned; - }; - - void AddErrorInstanceLocation(GValue& result, const PointerType& location) { - GenericStringBuffer sb; - location.StringifyUriFragment(sb); - GValue instanceRef(sb.GetString(), static_cast(sb.GetSize() / sizeof(Ch)), *allocator_); - result.AddMember(GetInstanceRefString(), instanceRef, *allocator_); - } - - void AddError(GValue& keyword, GValue& error) { - typename GValue::MemberIterator member = error_.FindMember(keyword); - if (member == error_.MemberEnd()) - error_.AddMember(keyword, error, *allocator_); - else { - if (member->value.IsObject()) { - GValue errors(kArrayType); - errors.PushBack(member->value, *allocator_); - member->value = errors; - } - member->value.PushBack(error, *allocator_); - } - } - - void AddCurrentError(const SchemaErrorCode code, const PointerType& location) { - RAPIDJSON_SCHEMA_PRINT(InvalidKeyword, GetSchemaErrorKeyword(code)); - currentError_.AddMember(GetErrorCodeString(), code, *allocator_); - AddErrorInstanceLocation(currentError_, location); - AddError(GValue(GetSchemaErrorKeyword(code)).Move(), currentError_); - } - -#define RAPIDJSON_STRING_(name, ...) \ - static const StringRefType& Get##name##String() {\ - static const Ch s[] = { __VA_ARGS__, '\0' };\ - static const StringRefType v(s, static_cast(sizeof(s) / sizeof(Ch) - 1)); \ - return v;\ - } - - RAPIDJSON_STRING_(InstanceRef, 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'R', 'e', 'f') - RAPIDJSON_STRING_(ErrorCode, 'e', 'r', 'r', 'o', 'r', 'C', 'o', 'd', 'e') - RAPIDJSON_STRING_(Value, 'v', 'a', 'l', 'u', 'e') - RAPIDJSON_STRING_(Offset, 'o', 'f', 'f', 's', 'e', 't') - - RAPIDJSON_STRING_(Null, 'n', 'u', 'l', 'l') - RAPIDJSON_STRING_(SpecUnknown, 'S', 'p', 'e', 'c', 'U', 'n', 'k', 'n', 'o', 'w', 'n') - RAPIDJSON_STRING_(SpecUnsupported, 'S', 'p', 'e', 'c', 'U', 'n', 's', 'u', 'p', 'p', 'o', 'r', 't', 'e', 'd') - RAPIDJSON_STRING_(SpecIllegal, 'S', 'p', 'e', 'c', 'I', 'l', 'l', 'e', 'g', 'a', 'l') - RAPIDJSON_STRING_(StartUnknown, 'S', 't', 'a', 'r', 't', 'U', 'n', 'k', 'n', 'o', 'w', 'n') - RAPIDJSON_STRING_(RefPlainName, 'R', 'e', 'f', 'P', 'l', 'a', 'i', 'n', 'N', 'a', 'm', 'e') - RAPIDJSON_STRING_(RefInvalid, 'R', 'e', 'f', 'I', 'n', 'v', 'a', 'l', 'i', 'd') - RAPIDJSON_STRING_(RefPointerInvalid, 'R', 'e', 'f', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'I', 'n', 'v', 'a', 'l', 'i', 'd') - RAPIDJSON_STRING_(RefUnknown, 'R', 'e', 'f', 'U', 'n', 'k', 'n', 'o', 'w', 'n') - RAPIDJSON_STRING_(RefCyclical, 'R', 'e', 'f', 'C', 'y', 'c', 'l', 'i', 'c', 'a', 'l') - RAPIDJSON_STRING_(RefNoRemoteProvider, 'R', 'e', 'f', 'N', 'o', 'R', 'e', 'm', 'o', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r') - RAPIDJSON_STRING_(RefNoRemoteSchema, 'R', 'e', 'f', 'N', 'o', 'R', 'e', 'm', 'o', 't', 'e', 'S', 'c', 'h', 'e', 'm', 'a') - RAPIDJSON_STRING_(ReadOnlyAndWriteOnly, 'R', 'e', 'a', 'd', 'O', 'n', 'l', 'y', 'A', 'n', 'd', 'W', 'r', 'i', 't', 'e', 'O', 'n', 'l', 'y') - RAPIDJSON_STRING_(RegexInvalid, 'R', 'e', 'g', 'e', 'x', 'I', 'n', 'v', 'a', 'l', 'i', 'd') - -#undef RAPIDJSON_STRING_ - - // Static method to get schema draft of any schema document - static SchemaDraft GetSchemaDraft(const ValueType& document) { - static const Ch kDraft03String[] = { 'h', 't', 't', 'p', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '-', '0', '3', '/', 's', 'c', 'h', 'e', 'm', 'a', '#', '\0' }; - static const Ch kDraft04String[] = { 'h', 't', 't', 'p', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '-', '0', '4', '/', 's', 'c', 'h', 'e', 'm', 'a', '#', '\0' }; - static const Ch kDraft05String[] = { 'h', 't', 't', 'p', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '-', '0', '5', '/', 's', 'c', 'h', 'e', 'm', 'a', '#', '\0' }; - static const Ch kDraft06String[] = { 'h', 't', 't', 'p', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '-', '0', '6', '/', 's', 'c', 'h', 'e', 'm', 'a', '#', '\0' }; - static const Ch kDraft07String[] = { 'h', 't', 't', 'p', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '-', '0', '7', '/', 's', 'c', 'h', 'e', 'm', 'a', '#', '\0' }; - static const Ch kDraft2019_09String[] = { 'h', 't', 't', 'p', 's', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '/', '2', '0', '1', '9', '-', '0', '9', '/', 's', 'c', 'h', 'e', 'm', 'a', '\0' }; - static const Ch kDraft2020_12String[] = { 'h', 't', 't', 'p', 's', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '/', '2', '0', '2', '0', '-', '1', '2', '/', 's', 'c', 'h', 'e', 'm', 'a', '\0' }; - - if (!document.IsObject()) { - return kDraftNone; - } - - // Get the schema draft from the $schema keyword at the supplied location - typename ValueType::ConstMemberIterator itr = document.FindMember(SchemaType::GetSchemaString()); - if (itr != document.MemberEnd()) { - if (!itr->value.IsString()) return kDraftUnknown; - const UriType draftUri(itr->value); - // Check base uri for match - if (draftUri.Match(UriType(kDraft04String), false)) return kDraft04; - if (draftUri.Match(UriType(kDraft05String), false)) return kDraft05; - if (draftUri.Match(UriType(kDraft06String), false)) return kDraft06; - if (draftUri.Match(UriType(kDraft07String), false)) return kDraft07; - if (draftUri.Match(UriType(kDraft03String), false)) return kDraft03; - if (draftUri.Match(UriType(kDraft2019_09String), false)) return kDraft2019_09; - if (draftUri.Match(UriType(kDraft2020_12String), false)) return kDraft2020_12; - return kDraftUnknown; - } - // $schema not found - return kDraftNone; - } - - - // Get open api version of any schema document - static OpenApiVersion GetOpenApiVersion(const ValueType& document) { - static const Ch kVersion20String[] = { '2', '.', '0', '\0' }; - static const Ch kVersion30String[] = { '3', '.', '0', '.', '\0' }; // ignore patch level - static const Ch kVersion31String[] = { '3', '.', '1', '.', '\0' }; // ignore patch level - static SizeType len = internal::StrLen(kVersion30String); - - if (!document.IsObject()) { - return kVersionNone; - } - - // Get the open api version from the swagger / openapi keyword at the supplied location - typename ValueType::ConstMemberIterator itr = document.FindMember(SchemaType::GetSwaggerString()); - if (itr == document.MemberEnd()) itr = document.FindMember(SchemaType::GetOpenApiString()); - if (itr != document.MemberEnd()) { - if (!itr->value.IsString()) return kVersionUnknown; - const ValueType kVersion20Value(kVersion20String); - if (kVersion20Value == itr->value) return kVersion20; // must match 2.0 exactly - const ValueType kVersion30Value(kVersion30String); - if (itr->value.GetStringLength() > len && kVersion30Value == ValueType(itr->value.GetString(), len)) return kVersion30; // must match 3.0.x - const ValueType kVersion31Value(kVersion31String); - if (itr->value.GetStringLength() > len && kVersion31Value == ValueType(itr->value.GetString(), len)) return kVersion31; // must match 3.1.x - return kVersionUnknown; - } - // swagger or openapi not found - return kVersionNone; - } - - // Get the draft of the schema or the open api version (which implies the draft). - // Report an error if schema draft or open api version not supported or not recognized, or both in document, and carry on. - void SetSchemaSpecification(const ValueType& document) { - // Look for '$schema', 'swagger' or 'openapi' keyword at document root - SchemaDraft docDraft = GetSchemaDraft(document); - OpenApiVersion docOapi = GetOpenApiVersion(document); - // Error if both in document - if (docDraft != kDraftNone && docOapi != kVersionNone) - SchemaError(kSchemaErrorSpecIllegal, PointerType()); - // Use document draft or open api version if present or use spec from constructor - if (docDraft != kDraftNone) - spec_ = Specification(docDraft); - else if (docOapi != kVersionNone) - spec_ = Specification(docOapi); - // Error if draft or version unknown - if (spec_.draft == kDraftUnknown || spec_.oapi == kVersionUnknown) - SchemaError(kSchemaErrorSpecUnknown, PointerType()); - else if (!spec_.IsSupported()) - SchemaError(kSchemaErrorSpecUnsupported, PointerType()); - } - - // Changed by PR #1393 - void CreateSchemaRecursive(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document, const UriType& id) { - if (v.GetType() == kObjectType) { - UriType newid = UriType(CreateSchema(schema, pointer, v, document, id), allocator_); - - for (typename ValueType::ConstMemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr) - CreateSchemaRecursive(0, pointer.Append(itr->name, allocator_), itr->value, document, newid); - } - else if (v.GetType() == kArrayType) - for (SizeType i = 0; i < v.Size(); i++) - CreateSchemaRecursive(0, pointer.Append(i, allocator_), v[i], document, id); - } - - // Changed by PR #1393 - const UriType& CreateSchema(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document, const UriType& id) { - RAPIDJSON_ASSERT(pointer.IsValid()); - GenericStringBuffer sb; - pointer.StringifyUriFragment(sb); - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaDocument::CreateSchema", sb.GetString(), id.GetString()); - if (v.IsObject()) { - if (const SchemaType* sc = GetSchema(pointer)) { - if (schema) - *schema = sc; - AddSchemaRefs(const_cast(sc)); - } - else if (!HandleRefSchema(pointer, schema, v, document, id)) { - // The new schema constructor adds itself and its $ref(s) to schemaMap_ - SchemaType* s = new (allocator_->Malloc(sizeof(SchemaType))) SchemaType(this, pointer, v, document, allocator_, id); - if (schema) - *schema = s; - return s->GetId(); - } - } - else { - if (schema) - *schema = typeless_; - AddSchemaRefs(typeless_); - } - return id; - } - - // Changed by PR #1393 - // TODO should this return a UriType& ? - bool HandleRefSchema(const PointerType& source, const SchemaType** schema, const ValueType& v, const ValueType& document, const UriType& id) { - typename ValueType::ConstMemberIterator itr = v.FindMember(SchemaType::GetRefString()); - if (itr == v.MemberEnd()) - return false; - - GenericStringBuffer sb; - source.StringifyUriFragment(sb); - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaDocument::HandleRefSchema", sb.GetString(), id.GetString()); - // Resolve the source pointer to the $ref'ed schema (finally) - new (schemaRef_.template Push()) SchemaRefPtr(&source); - - if (itr->value.IsString()) { - SizeType len = itr->value.GetStringLength(); - if (len == 0) - SchemaError(kSchemaErrorRefInvalid, source); - else { - // First resolve $ref against the in-scope id - UriType scopeId = UriType(id, allocator_); - UriType ref = UriType(itr->value, allocator_).Resolve(scopeId, allocator_); - RAPIDJSON_SCHEMA_PRINT(SchemaIds, id.GetString(), itr->value.GetString(), ref.GetString()); - // See if the resolved $ref minus the fragment matches a resolved id in this document - // Search from the root. Returns the subschema in the document and its absolute JSON pointer. - PointerType basePointer = PointerType(); - const ValueType *base = FindId(document, ref, basePointer, docId_, false); - if (!base) { - // Remote reference - call the remote document provider - if (!remoteProvider_) - SchemaError(kSchemaErrorRefNoRemoteProvider, source); - else { - if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(ref, spec_)) { - const Ch* s = ref.GetFragString(); - len = ref.GetFragStringLength(); - if (len <= 1 || s[1] == '/') { - // JSON pointer fragment, absolute in the remote schema - const PointerType pointer(s, len, allocator_); - if (!pointer.IsValid()) - SchemaErrorPointer(kSchemaErrorRefPointerInvalid, source, s, len, pointer); - else { - // Get the subschema - if (const SchemaType *sc = remoteDocument->GetSchema(pointer)) { - if (schema) - *schema = sc; - AddSchemaRefs(const_cast(sc)); - return true; - } else - SchemaErrorValue(kSchemaErrorRefUnknown, source, ref.GetString(), ref.GetStringLength()); - } - } else - // Plain name fragment, not allowed in remote schema - SchemaErrorValue(kSchemaErrorRefPlainName, source, s, len); - } else - SchemaErrorValue(kSchemaErrorRefNoRemoteSchema, source, ref.GetString(), ref.GetStringLength()); - } - } - else { // Local reference - const Ch* s = ref.GetFragString(); - len = ref.GetFragStringLength(); - if (len <= 1 || s[1] == '/') { - // JSON pointer fragment, relative to the resolved URI - const PointerType relPointer(s, len, allocator_); - if (!relPointer.IsValid()) - SchemaErrorPointer(kSchemaErrorRefPointerInvalid, source, s, len, relPointer); - else { - // Get the subschema - if (const ValueType *pv = relPointer.Get(*base)) { - // Now get the absolute JSON pointer by adding relative to base - PointerType pointer(basePointer, allocator_); - for (SizeType i = 0; i < relPointer.GetTokenCount(); i++) - pointer = pointer.Append(relPointer.GetTokens()[i], allocator_); - if (IsCyclicRef(pointer)) - SchemaErrorValue(kSchemaErrorRefCyclical, source, ref.GetString(), ref.GetStringLength()); - else { - // Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there - // TODO: cache pointer <-> id mapping - size_t unresolvedTokenIndex; - scopeId = pointer.GetUri(document, docId_, &unresolvedTokenIndex, allocator_); - CreateSchema(schema, pointer, *pv, document, scopeId); - return true; - } - } else - SchemaErrorValue(kSchemaErrorRefUnknown, source, ref.GetString(), ref.GetStringLength()); - } - } else { - // Plain name fragment, relative to the resolved URI - // Not supported in open api 2.0 and 3.0 - PointerType pointer(allocator_); - if (spec_.oapi == kVersion20 || spec_.oapi == kVersion30) - SchemaErrorValue(kSchemaErrorRefPlainName, source, s, len); - // See if the fragment matches an id in this document. - // Search from the base we just established. Returns the subschema in the document and its absolute JSON pointer. - else if (const ValueType *pv = FindId(*base, ref, pointer, UriType(ref.GetBaseString(), ref.GetBaseStringLength(), allocator_), true, basePointer)) { - if (IsCyclicRef(pointer)) - SchemaErrorValue(kSchemaErrorRefCyclical, source, ref.GetString(), ref.GetStringLength()); - else { - // Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there - // TODO: cache pointer <-> id mapping - size_t unresolvedTokenIndex; - scopeId = pointer.GetUri(document, docId_, &unresolvedTokenIndex, allocator_); - CreateSchema(schema, pointer, *pv, document, scopeId); - return true; - } - } else - SchemaErrorValue(kSchemaErrorRefUnknown, source, ref.GetString(), ref.GetStringLength()); - } - } - } - } - - // Invalid/Unknown $ref - if (schema) - *schema = typeless_; - AddSchemaRefs(typeless_); - return true; - } - - //! Find the first subschema with a resolved 'id' that matches the specified URI. - // If full specified use all URI else ignore fragment. - // If found, return a pointer to the subschema and its JSON pointer. - // TODO cache pointer <-> id mapping - ValueType* FindId(const ValueType& doc, const UriType& finduri, PointerType& resptr, const UriType& baseuri, bool full, const PointerType& here = PointerType()) const { - SizeType i = 0; - ValueType* resval = 0; - UriType tempuri = UriType(finduri, allocator_); - UriType localuri = UriType(baseuri, allocator_); - if (doc.GetType() == kObjectType) { - // Establish the base URI of this object - typename ValueType::ConstMemberIterator m = doc.FindMember(SchemaType::GetIdString()); - if (m != doc.MemberEnd() && m->value.GetType() == kStringType) { - localuri = UriType(m->value, allocator_).Resolve(baseuri, allocator_); - } - // See if it matches - if (localuri.Match(finduri, full)) { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaDocument::FindId (match)", full ? localuri.GetString() : localuri.GetBaseString()); - resval = const_cast(&doc); - resptr = here; - return resval; - } - // No match, continue looking - for (m = doc.MemberBegin(); m != doc.MemberEnd(); ++m) { - if (m->value.GetType() == kObjectType || m->value.GetType() == kArrayType) { - resval = FindId(m->value, finduri, resptr, localuri, full, here.Append(m->name.GetString(), m->name.GetStringLength(), allocator_)); - } - if (resval) break; - } - } else if (doc.GetType() == kArrayType) { - // Continue looking - for (typename ValueType::ConstValueIterator v = doc.Begin(); v != doc.End(); ++v) { - if (v->GetType() == kObjectType || v->GetType() == kArrayType) { - resval = FindId(*v, finduri, resptr, localuri, full, here.Append(i, allocator_)); - } - if (resval) break; - i++; - } - } - return resval; - } - - // Added by PR #1393 - void AddSchemaRefs(SchemaType* schema) { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaDocument::AddSchemaRefs"); - while (!schemaRef_.Empty()) { - SchemaRefPtr *ref = schemaRef_.template Pop(1); - SchemaEntry *entry = schemaMap_.template Push(); - new (entry) SchemaEntry(**ref, schema, false, allocator_); - } - } - - // Added by PR #1393 - bool IsCyclicRef(const PointerType& pointer) const { - for (const SchemaRefPtr* ref = schemaRef_.template Bottom(); ref != schemaRef_.template End(); ++ref) - if (pointer == **ref) - return true; - return false; - } - - const SchemaType* GetSchema(const PointerType& pointer) const { - for (const SchemaEntry* target = schemaMap_.template Bottom(); target != schemaMap_.template End(); ++target) - if (pointer == target->pointer) - return target->schema; - return 0; - } - - PointerType GetPointer(const SchemaType* schema) const { - for (const SchemaEntry* target = schemaMap_.template Bottom(); target != schemaMap_.template End(); ++target) - if (schema == target->schema) - return target->pointer; - return PointerType(); - } - - const SchemaType* GetTypeless() const { return typeless_; } - - static const size_t kInitialSchemaMapSize = 64; - static const size_t kInitialSchemaRefSize = 64; - - IRemoteSchemaDocumentProviderType* remoteProvider_; - Allocator *allocator_; - Allocator *ownAllocator_; - const SchemaType* root_; //!< Root schema. - SchemaType* typeless_; - internal::Stack schemaMap_; // Stores created Pointer -> Schemas - internal::Stack schemaRef_; // Stores Pointer(s) from $ref(s) until resolved - GValue uri_; // Schema document URI - UriType docId_; - Specification spec_; - GValue error_; - GValue currentError_; -}; - -//! GenericSchemaDocument using Value type. -typedef GenericSchemaDocument SchemaDocument; -//! IGenericRemoteSchemaDocumentProvider using SchemaDocument. -typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; - -/////////////////////////////////////////////////////////////////////////////// -// GenericSchemaValidator - -//! JSON Schema Validator. -/*! - A SAX style JSON schema validator. - It uses a \c GenericSchemaDocument to validate SAX events. - It delegates the incoming SAX events to an output handler. - The default output handler does nothing. - It can be reused multiple times by calling \c Reset(). - - \tparam SchemaDocumentType Type of schema document. - \tparam OutputHandler Type of output handler. Default handler does nothing. - \tparam StateAllocator Allocator for storing the internal validation states. -*/ -template < - typename SchemaDocumentType, - typename OutputHandler = BaseReaderHandler, - typename StateAllocator = CrtAllocator> -class GenericSchemaValidator : - public internal::ISchemaStateFactory, - public internal::ISchemaValidator, - public internal::IValidationErrorHandler { -public: - typedef typename SchemaDocumentType::SchemaType SchemaType; - typedef typename SchemaDocumentType::PointerType PointerType; - typedef typename SchemaType::EncodingType EncodingType; - typedef typename SchemaType::SValue SValue; - typedef typename EncodingType::Ch Ch; - typedef GenericStringRef StringRefType; - typedef GenericValue ValueType; - - //! Constructor without output handler. - /*! - \param schemaDocument The schema document to conform to. - \param allocator Optional allocator for storing internal validation states. - \param schemaStackCapacity Optional initial capacity of schema path stack. - \param documentStackCapacity Optional initial capacity of document path stack. - */ - GenericSchemaValidator( - const SchemaDocumentType& schemaDocument, - StateAllocator* allocator = 0, - size_t schemaStackCapacity = kDefaultSchemaStackCapacity, - size_t documentStackCapacity = kDefaultDocumentStackCapacity) - : - schemaDocument_(&schemaDocument), - root_(schemaDocument.GetRoot()), - stateAllocator_(allocator), - ownStateAllocator_(0), - schemaStack_(allocator, schemaStackCapacity), - documentStack_(allocator, documentStackCapacity), - outputHandler_(0), - error_(kObjectType), - currentError_(), - missingDependents_(), - valid_(true), - flags_(kValidateDefaultFlags), - depth_(0) - { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::GenericSchemaValidator"); - } - - //! Constructor with output handler. - /*! - \param schemaDocument The schema document to conform to. - \param allocator Optional allocator for storing internal validation states. - \param schemaStackCapacity Optional initial capacity of schema path stack. - \param documentStackCapacity Optional initial capacity of document path stack. - */ - GenericSchemaValidator( - const SchemaDocumentType& schemaDocument, - OutputHandler& outputHandler, - StateAllocator* allocator = 0, - size_t schemaStackCapacity = kDefaultSchemaStackCapacity, - size_t documentStackCapacity = kDefaultDocumentStackCapacity) - : - schemaDocument_(&schemaDocument), - root_(schemaDocument.GetRoot()), - stateAllocator_(allocator), - ownStateAllocator_(0), - schemaStack_(allocator, schemaStackCapacity), - documentStack_(allocator, documentStackCapacity), - outputHandler_(&outputHandler), - error_(kObjectType), - currentError_(), - missingDependents_(), - valid_(true), - flags_(kValidateDefaultFlags), - depth_(0) - { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::GenericSchemaValidator (output handler)"); - } - - //! Destructor. - ~GenericSchemaValidator() { - Reset(); - RAPIDJSON_DELETE(ownStateAllocator_); - } - - //! Reset the internal states. - void Reset() { - while (!schemaStack_.Empty()) - PopSchema(); - documentStack_.Clear(); - ResetError(); - } - - //! Reset the error state. - void ResetError() { - error_.SetObject(); - currentError_.SetNull(); - missingDependents_.SetNull(); - valid_ = true; - } - - //! Implementation of ISchemaValidator - void SetValidateFlags(unsigned flags) { - flags_ = flags; - } - virtual unsigned GetValidateFlags() const { - return flags_; - } - - virtual bool IsValid() const { - if (!valid_) return false; - if (GetContinueOnErrors() && !error_.ObjectEmpty()) return false; - return true; - } - //! End of Implementation of ISchemaValidator - - //! Gets the error object. - ValueType& GetError() { return error_; } - const ValueType& GetError() const { return error_; } - - //! Gets the JSON pointer pointed to the invalid schema. - // If reporting all errors, the stack will be empty. - PointerType GetInvalidSchemaPointer() const { - return schemaStack_.Empty() ? PointerType() : CurrentSchema().GetPointer(); - } - - //! Gets the keyword of invalid schema. - // If reporting all errors, the stack will be empty, so return "errors". - const Ch* GetInvalidSchemaKeyword() const { - if (!schemaStack_.Empty()) return CurrentContext().invalidKeyword; - if (GetContinueOnErrors() && !error_.ObjectEmpty()) return (const Ch*)GetErrorsString(); - return 0; - } - - //! Gets the error code of invalid schema. - // If reporting all errors, the stack will be empty, so return kValidateErrors. - ValidateErrorCode GetInvalidSchemaCode() const { - if (!schemaStack_.Empty()) return CurrentContext().invalidCode; - if (GetContinueOnErrors() && !error_.ObjectEmpty()) return kValidateErrors; - return kValidateErrorNone; - } - - //! Gets the JSON pointer pointed to the invalid value. - // If reporting all errors, the stack will be empty. - PointerType GetInvalidDocumentPointer() const { - if (documentStack_.Empty()) { - return PointerType(); - } - else { - return PointerType(documentStack_.template Bottom(), documentStack_.GetSize() / sizeof(Ch)); - } - } - - void NotMultipleOf(int64_t actual, const SValue& expected) { - AddNumberError(kValidateErrorMultipleOf, ValueType(actual).Move(), expected); - } - void NotMultipleOf(uint64_t actual, const SValue& expected) { - AddNumberError(kValidateErrorMultipleOf, ValueType(actual).Move(), expected); - } - void NotMultipleOf(double actual, const SValue& expected) { - AddNumberError(kValidateErrorMultipleOf, ValueType(actual).Move(), expected); - } - void AboveMaximum(int64_t actual, const SValue& expected, bool exclusive) { - AddNumberError(exclusive ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum, ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMaximumString : 0); - } - void AboveMaximum(uint64_t actual, const SValue& expected, bool exclusive) { - AddNumberError(exclusive ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum, ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMaximumString : 0); - } - void AboveMaximum(double actual, const SValue& expected, bool exclusive) { - AddNumberError(exclusive ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum, ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMaximumString : 0); - } - void BelowMinimum(int64_t actual, const SValue& expected, bool exclusive) { - AddNumberError(exclusive ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum, ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMinimumString : 0); - } - void BelowMinimum(uint64_t actual, const SValue& expected, bool exclusive) { - AddNumberError(exclusive ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum, ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMinimumString : 0); - } - void BelowMinimum(double actual, const SValue& expected, bool exclusive) { - AddNumberError(exclusive ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum, ValueType(actual).Move(), expected, - exclusive ? &SchemaType::GetExclusiveMinimumString : 0); - } - - void TooLong(const Ch* str, SizeType length, SizeType expected) { - AddNumberError(kValidateErrorMaxLength, - ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move()); - } - void TooShort(const Ch* str, SizeType length, SizeType expected) { - AddNumberError(kValidateErrorMinLength, - ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move()); - } - void DoesNotMatch(const Ch* str, SizeType length) { - currentError_.SetObject(); - currentError_.AddMember(GetActualString(), ValueType(str, length, GetStateAllocator()).Move(), GetStateAllocator()); - AddCurrentError(kValidateErrorPattern); - } - - void DisallowedItem(SizeType index) { - currentError_.SetObject(); - currentError_.AddMember(GetDisallowedString(), ValueType(index).Move(), GetStateAllocator()); - AddCurrentError(kValidateErrorAdditionalItems, true); - } - void TooFewItems(SizeType actualCount, SizeType expectedCount) { - AddNumberError(kValidateErrorMinItems, - ValueType(actualCount).Move(), SValue(expectedCount).Move()); - } - void TooManyItems(SizeType actualCount, SizeType expectedCount) { - AddNumberError(kValidateErrorMaxItems, - ValueType(actualCount).Move(), SValue(expectedCount).Move()); - } - void DuplicateItems(SizeType index1, SizeType index2) { - ValueType duplicates(kArrayType); - duplicates.PushBack(index1, GetStateAllocator()); - duplicates.PushBack(index2, GetStateAllocator()); - currentError_.SetObject(); - currentError_.AddMember(GetDuplicatesString(), duplicates, GetStateAllocator()); - AddCurrentError(kValidateErrorUniqueItems, true); - } - - void TooManyProperties(SizeType actualCount, SizeType expectedCount) { - AddNumberError(kValidateErrorMaxProperties, - ValueType(actualCount).Move(), SValue(expectedCount).Move()); - } - void TooFewProperties(SizeType actualCount, SizeType expectedCount) { - AddNumberError(kValidateErrorMinProperties, - ValueType(actualCount).Move(), SValue(expectedCount).Move()); - } - void StartMissingProperties() { - currentError_.SetArray(); - } - void AddMissingProperty(const SValue& name) { - currentError_.PushBack(ValueType(name, GetStateAllocator()).Move(), GetStateAllocator()); - } - bool EndMissingProperties() { - if (currentError_.Empty()) - return false; - ValueType error(kObjectType); - error.AddMember(GetMissingString(), currentError_, GetStateAllocator()); - currentError_ = error; - AddCurrentError(kValidateErrorRequired); - return true; - } - void PropertyViolations(ISchemaValidator** subvalidators, SizeType count) { - for (SizeType i = 0; i < count; ++i) - MergeError(static_cast(subvalidators[i])->GetError()); - } - void DisallowedProperty(const Ch* name, SizeType length) { - currentError_.SetObject(); - currentError_.AddMember(GetDisallowedString(), ValueType(name, length, GetStateAllocator()).Move(), GetStateAllocator()); - AddCurrentError(kValidateErrorAdditionalProperties, true); - } - - void StartDependencyErrors() { - currentError_.SetObject(); - } - void StartMissingDependentProperties() { - missingDependents_.SetArray(); - } - void AddMissingDependentProperty(const SValue& targetName) { - missingDependents_.PushBack(ValueType(targetName, GetStateAllocator()).Move(), GetStateAllocator()); - } - void EndMissingDependentProperties(const SValue& sourceName) { - if (!missingDependents_.Empty()) { - // Create equivalent 'required' error - ValueType error(kObjectType); - ValidateErrorCode code = kValidateErrorRequired; - error.AddMember(GetMissingString(), missingDependents_.Move(), GetStateAllocator()); - AddErrorCode(error, code); - AddErrorInstanceLocation(error, false); - // When appending to a pointer ensure its allocator is used - PointerType schemaRef = GetInvalidSchemaPointer().Append(SchemaType::GetValidateErrorKeyword(kValidateErrorDependencies), &GetInvalidSchemaPointer().GetAllocator()); - AddErrorSchemaLocation(error, schemaRef.Append(sourceName.GetString(), sourceName.GetStringLength(), &GetInvalidSchemaPointer().GetAllocator())); - ValueType wrapper(kObjectType); - wrapper.AddMember(ValueType(SchemaType::GetValidateErrorKeyword(code), GetStateAllocator()).Move(), error, GetStateAllocator()); - currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(), wrapper, GetStateAllocator()); - } - } - void AddDependencySchemaError(const SValue& sourceName, ISchemaValidator* subvalidator) { - currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(), - static_cast(subvalidator)->GetError(), GetStateAllocator()); - } - bool EndDependencyErrors() { - if (currentError_.ObjectEmpty()) - return false; - ValueType error(kObjectType); - error.AddMember(GetErrorsString(), currentError_, GetStateAllocator()); - currentError_ = error; - AddCurrentError(kValidateErrorDependencies); - return true; - } - - void DisallowedValue(const ValidateErrorCode code = kValidateErrorEnum) { - currentError_.SetObject(); - AddCurrentError(code); - } - void StartDisallowedType() { - currentError_.SetArray(); - } - void AddExpectedType(const typename SchemaType::ValueType& expectedType) { - currentError_.PushBack(ValueType(expectedType, GetStateAllocator()).Move(), GetStateAllocator()); - } - void EndDisallowedType(const typename SchemaType::ValueType& actualType) { - ValueType error(kObjectType); - error.AddMember(GetExpectedString(), currentError_, GetStateAllocator()); - error.AddMember(GetActualString(), ValueType(actualType, GetStateAllocator()).Move(), GetStateAllocator()); - currentError_ = error; - AddCurrentError(kValidateErrorType); - } - void NotAllOf(ISchemaValidator** subvalidators, SizeType count) { - // Treat allOf like oneOf and anyOf to match https://rapidjson.org/md_doc_schema.html#allOf-anyOf-oneOf - AddErrorArray(kValidateErrorAllOf, subvalidators, count); - //for (SizeType i = 0; i < count; ++i) { - // MergeError(static_cast(subvalidators[i])->GetError()); - //} - } - void NoneOf(ISchemaValidator** subvalidators, SizeType count) { - AddErrorArray(kValidateErrorAnyOf, subvalidators, count); - } - void NotOneOf(ISchemaValidator** subvalidators, SizeType count) { - AddErrorArray(kValidateErrorOneOf, subvalidators, count); - } - void MultipleOneOf(SizeType index1, SizeType index2) { - ValueType matches(kArrayType); - matches.PushBack(index1, GetStateAllocator()); - matches.PushBack(index2, GetStateAllocator()); - currentError_.SetObject(); - currentError_.AddMember(GetMatchesString(), matches, GetStateAllocator()); - AddCurrentError(kValidateErrorOneOfMatch); - } - void Disallowed() { - currentError_.SetObject(); - AddCurrentError(kValidateErrorNot); - } - void DisallowedWhenWriting() { - currentError_.SetObject(); - AddCurrentError(kValidateErrorReadOnly); - } - void DisallowedWhenReading() { - currentError_.SetObject(); - AddCurrentError(kValidateErrorWriteOnly); - } - -#define RAPIDJSON_STRING_(name, ...) \ - static const StringRefType& Get##name##String() {\ - static const Ch s[] = { __VA_ARGS__, '\0' };\ - static const StringRefType v(s, static_cast(sizeof(s) / sizeof(Ch) - 1)); \ - return v;\ - } - - RAPIDJSON_STRING_(InstanceRef, 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'R', 'e', 'f') - RAPIDJSON_STRING_(SchemaRef, 's', 'c', 'h', 'e', 'm', 'a', 'R', 'e', 'f') - RAPIDJSON_STRING_(Expected, 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd') - RAPIDJSON_STRING_(Actual, 'a', 'c', 't', 'u', 'a', 'l') - RAPIDJSON_STRING_(Disallowed, 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd') - RAPIDJSON_STRING_(Missing, 'm', 'i', 's', 's', 'i', 'n', 'g') - RAPIDJSON_STRING_(Errors, 'e', 'r', 'r', 'o', 'r', 's') - RAPIDJSON_STRING_(ErrorCode, 'e', 'r', 'r', 'o', 'r', 'C', 'o', 'd', 'e') - RAPIDJSON_STRING_(ErrorMessage, 'e', 'r', 'r', 'o', 'r', 'M', 'e', 's', 's', 'a', 'g', 'e') - RAPIDJSON_STRING_(Duplicates, 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', 's') - RAPIDJSON_STRING_(Matches, 'm', 'a', 't', 'c', 'h', 'e', 's') - -#undef RAPIDJSON_STRING_ - -#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_(method, arg1)\ - if (!valid_) return false; \ - if ((!BeginValue() && !GetContinueOnErrors()) || (!CurrentSchema().method arg1 && !GetContinueOnErrors())) {\ - *documentStack_.template Push() = '\0';\ - documentStack_.template Pop(1);\ - RAPIDJSON_SCHEMA_PRINT(InvalidDocument, documentStack_.template Bottom());\ - valid_ = false;\ - return valid_;\ - } - -#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)\ - for (Context* context = schemaStack_.template Bottom(); context != schemaStack_.template End(); context++) {\ - if (context->hasher)\ - static_cast(context->hasher)->method arg2;\ - if (context->validators)\ - for (SizeType i_ = 0; i_ < context->validatorCount; i_++)\ - static_cast(context->validators[i_])->method arg2;\ - if (context->patternPropertiesValidators)\ - for (SizeType i_ = 0; i_ < context->patternPropertiesValidatorCount; i_++)\ - static_cast(context->patternPropertiesValidators[i_])->method arg2;\ - } - -#define RAPIDJSON_SCHEMA_HANDLE_END_(method, arg2)\ - valid_ = (EndValue() || GetContinueOnErrors()) && (!outputHandler_ || outputHandler_->method arg2);\ - return valid_; - -#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2) \ - RAPIDJSON_SCHEMA_HANDLE_BEGIN_ (method, arg1);\ - RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2);\ - RAPIDJSON_SCHEMA_HANDLE_END_ (method, arg2) - - bool Null() { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Null, (CurrentContext()), ( )); } - bool Bool(bool b) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Bool, (CurrentContext(), b), (b)); } - bool Int(int i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int, (CurrentContext(), i), (i)); } - bool Uint(unsigned u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint, (CurrentContext(), u), (u)); } - bool Int64(int64_t i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int64, (CurrentContext(), i), (i)); } - bool Uint64(uint64_t u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint64, (CurrentContext(), u), (u)); } - bool Double(double d) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Double, (CurrentContext(), d), (d)); } - bool RawNumber(const Ch* str, SizeType length, bool copy) - { RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); } - bool String(const Ch* str, SizeType length, bool copy) - { RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); } - - bool StartObject() { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::StartObject"); - RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartObject, (CurrentContext())); - RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartObject, ()); - valid_ = !outputHandler_ || outputHandler_->StartObject(); - return valid_; - } - - bool Key(const Ch* str, SizeType len, bool copy) { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::Key", str); - if (!valid_) return false; - AppendToken(str, len); - if (!CurrentSchema().Key(CurrentContext(), str, len, copy) && !GetContinueOnErrors()) { - valid_ = false; - return valid_; - } - RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(Key, (str, len, copy)); - valid_ = !outputHandler_ || outputHandler_->Key(str, len, copy); - return valid_; - } - - bool EndObject(SizeType memberCount) { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::EndObject"); - if (!valid_) return false; - RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndObject, (memberCount)); - if (!CurrentSchema().EndObject(CurrentContext(), memberCount) && !GetContinueOnErrors()) { - valid_ = false; - return valid_; - } - RAPIDJSON_SCHEMA_HANDLE_END_(EndObject, (memberCount)); - } - - bool StartArray() { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::StartArray"); - RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartArray, (CurrentContext())); - RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartArray, ()); - valid_ = !outputHandler_ || outputHandler_->StartArray(); - return valid_; - } - - bool EndArray(SizeType elementCount) { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::EndArray"); - if (!valid_) return false; - RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndArray, (elementCount)); - if (!CurrentSchema().EndArray(CurrentContext(), elementCount) && !GetContinueOnErrors()) { - valid_ = false; - return valid_; - } - RAPIDJSON_SCHEMA_HANDLE_END_(EndArray, (elementCount)); - } - -#undef RAPIDJSON_SCHEMA_HANDLE_BEGIN_ -#undef RAPIDJSON_SCHEMA_HANDLE_PARALLEL_ -#undef RAPIDJSON_SCHEMA_HANDLE_VALUE_ - - // Implementation of ISchemaStateFactory - virtual ISchemaValidator* CreateSchemaValidator(const SchemaType& root, const bool inheritContinueOnErrors) { - *documentStack_.template Push() = '\0'; - documentStack_.template Pop(1); - ISchemaValidator* sv = new (GetStateAllocator().Malloc(sizeof(GenericSchemaValidator))) GenericSchemaValidator(*schemaDocument_, root, documentStack_.template Bottom(), documentStack_.GetSize(), - depth_ + 1, - &GetStateAllocator()); - sv->SetValidateFlags(inheritContinueOnErrors ? GetValidateFlags() : GetValidateFlags() & ~(unsigned)kValidateContinueOnErrorFlag); - return sv; - } - - virtual void DestroySchemaValidator(ISchemaValidator* validator) { - GenericSchemaValidator* v = static_cast(validator); - v->~GenericSchemaValidator(); - StateAllocator::Free(v); - } - - virtual void* CreateHasher() { - return new (GetStateAllocator().Malloc(sizeof(HasherType))) HasherType(&GetStateAllocator()); - } - - virtual uint64_t GetHashCode(void* hasher) { - return static_cast(hasher)->GetHashCode(); - } - - virtual void DestroyHasher(void* hasher) { - HasherType* h = static_cast(hasher); - h->~HasherType(); - StateAllocator::Free(h); - } - - virtual void* MallocState(size_t size) { - return GetStateAllocator().Malloc(size); - } - - virtual void FreeState(void* p) { - StateAllocator::Free(p); - } - // End of implementation of ISchemaStateFactory - -private: - typedef typename SchemaType::Context Context; - typedef GenericValue, StateAllocator> HashCodeArray; - typedef internal::Hasher HasherType; - - GenericSchemaValidator( - const SchemaDocumentType& schemaDocument, - const SchemaType& root, - const char* basePath, size_t basePathSize, - unsigned depth, - StateAllocator* allocator = 0, - size_t schemaStackCapacity = kDefaultSchemaStackCapacity, - size_t documentStackCapacity = kDefaultDocumentStackCapacity) - : - schemaDocument_(&schemaDocument), - root_(root), - stateAllocator_(allocator), - ownStateAllocator_(0), - schemaStack_(allocator, schemaStackCapacity), - documentStack_(allocator, documentStackCapacity), - outputHandler_(0), - error_(kObjectType), - currentError_(), - missingDependents_(), - valid_(true), - flags_(kValidateDefaultFlags), - depth_(depth) - { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::GenericSchemaValidator (internal)", basePath && basePathSize ? basePath : ""); - if (basePath && basePathSize) - memcpy(documentStack_.template Push(basePathSize), basePath, basePathSize); - } - - StateAllocator& GetStateAllocator() { - if (!stateAllocator_) - stateAllocator_ = ownStateAllocator_ = RAPIDJSON_NEW(StateAllocator)(); - return *stateAllocator_; - } - - bool GetContinueOnErrors() const { - return flags_ & kValidateContinueOnErrorFlag; - } - - bool BeginValue() { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::BeginValue"); - if (schemaStack_.Empty()) - PushSchema(root_); - else { - if (CurrentContext().inArray) - internal::TokenHelper, Ch>::AppendIndexToken(documentStack_, CurrentContext().arrayElementIndex); - - if (!CurrentSchema().BeginValue(CurrentContext()) && !GetContinueOnErrors()) - return false; - - SizeType count = CurrentContext().patternPropertiesSchemaCount; - const SchemaType** sa = CurrentContext().patternPropertiesSchemas; - typename Context::PatternValidatorType patternValidatorType = CurrentContext().valuePatternValidatorType; - bool valueUniqueness = CurrentContext().valueUniqueness; - RAPIDJSON_ASSERT(CurrentContext().valueSchema); - PushSchema(*CurrentContext().valueSchema); - - if (count > 0) { - CurrentContext().objectPatternValidatorType = patternValidatorType; - ISchemaValidator**& va = CurrentContext().patternPropertiesValidators; - SizeType& validatorCount = CurrentContext().patternPropertiesValidatorCount; - va = static_cast(MallocState(sizeof(ISchemaValidator*) * count)); - std::memset(va, 0, sizeof(ISchemaValidator*) * count); - for (SizeType i = 0; i < count; i++) - va[validatorCount++] = CreateSchemaValidator(*sa[i], true); // Inherit continueOnError - } - - CurrentContext().arrayUniqueness = valueUniqueness; - } - return true; - } - - bool EndValue() { - RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::EndValue"); - if (!CurrentSchema().EndValue(CurrentContext()) && !GetContinueOnErrors()) - return false; - - GenericStringBuffer sb; - schemaDocument_->GetPointer(&CurrentSchema()).StringifyUriFragment(sb); - *documentStack_.template Push() = '\0'; - documentStack_.template Pop(1); - RAPIDJSON_SCHEMA_PRINT(ValidatorPointers, sb.GetString(), documentStack_.template Bottom(), depth_); - void* hasher = CurrentContext().hasher; - uint64_t h = hasher && CurrentContext().arrayUniqueness ? static_cast(hasher)->GetHashCode() : 0; - - PopSchema(); - - if (!schemaStack_.Empty()) { - Context& context = CurrentContext(); - // Only check uniqueness if there is a hasher - if (hasher && context.valueUniqueness) { - HashCodeArray* a = static_cast(context.arrayElementHashCodes); - if (!a) - CurrentContext().arrayElementHashCodes = a = new (GetStateAllocator().Malloc(sizeof(HashCodeArray))) HashCodeArray(kArrayType); - for (typename HashCodeArray::ConstValueIterator itr = a->Begin(); itr != a->End(); ++itr) - if (itr->GetUint64() == h) { - DuplicateItems(static_cast(itr - a->Begin()), a->Size()); - // Cleanup before returning if continuing - if (GetContinueOnErrors()) { - a->PushBack(h, GetStateAllocator()); - while (!documentStack_.Empty() && *documentStack_.template Pop(1) != '/'); - } - RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorUniqueItems); - } - a->PushBack(h, GetStateAllocator()); - } - } - - // Remove the last token of document pointer - while (!documentStack_.Empty() && *documentStack_.template Pop(1) != '/') - ; - - return true; - } - - void AppendToken(const Ch* str, SizeType len) { - documentStack_.template Reserve(1 + len * 2); // worst case all characters are escaped as two characters - *documentStack_.template PushUnsafe() = '/'; - for (SizeType i = 0; i < len; i++) { - if (str[i] == '~') { - *documentStack_.template PushUnsafe() = '~'; - *documentStack_.template PushUnsafe() = '0'; - } - else if (str[i] == '/') { - *documentStack_.template PushUnsafe() = '~'; - *documentStack_.template PushUnsafe() = '1'; - } - else - *documentStack_.template PushUnsafe() = str[i]; - } - } - - RAPIDJSON_FORCEINLINE void PushSchema(const SchemaType& schema) { new (schemaStack_.template Push()) Context(*this, *this, &schema, flags_); } - - RAPIDJSON_FORCEINLINE void PopSchema() { - Context* c = schemaStack_.template Pop(1); - if (HashCodeArray* a = static_cast(c->arrayElementHashCodes)) { - a->~HashCodeArray(); - StateAllocator::Free(a); - } - c->~Context(); - } - - void AddErrorInstanceLocation(ValueType& result, bool parent) { - GenericStringBuffer sb; - PointerType instancePointer = GetInvalidDocumentPointer(); - ((parent && instancePointer.GetTokenCount() > 0) - ? PointerType(instancePointer.GetTokens(), instancePointer.GetTokenCount() - 1) - : instancePointer).StringifyUriFragment(sb); - ValueType instanceRef(sb.GetString(), static_cast(sb.GetSize() / sizeof(Ch)), - GetStateAllocator()); - result.AddMember(GetInstanceRefString(), instanceRef, GetStateAllocator()); - } - - void AddErrorSchemaLocation(ValueType& result, PointerType schema = PointerType()) { - GenericStringBuffer sb; - SizeType len = CurrentSchema().GetURI().GetStringLength(); - if (len) memcpy(sb.Push(len), CurrentSchema().GetURI().GetString(), len * sizeof(Ch)); - if (schema.GetTokenCount()) schema.StringifyUriFragment(sb); - else GetInvalidSchemaPointer().StringifyUriFragment(sb); - ValueType schemaRef(sb.GetString(), static_cast(sb.GetSize() / sizeof(Ch)), - GetStateAllocator()); - result.AddMember(GetSchemaRefString(), schemaRef, GetStateAllocator()); - } - - void AddErrorCode(ValueType& result, const ValidateErrorCode code) { - result.AddMember(GetErrorCodeString(), code, GetStateAllocator()); - } - - void AddError(ValueType& keyword, ValueType& error) { - typename ValueType::MemberIterator member = error_.FindMember(keyword); - if (member == error_.MemberEnd()) - error_.AddMember(keyword, error, GetStateAllocator()); - else { - if (member->value.IsObject()) { - ValueType errors(kArrayType); - errors.PushBack(member->value, GetStateAllocator()); - member->value = errors; - } - member->value.PushBack(error, GetStateAllocator()); - } - } - - void AddCurrentError(const ValidateErrorCode code, bool parent = false) { - AddErrorCode(currentError_, code); - AddErrorInstanceLocation(currentError_, parent); - AddErrorSchemaLocation(currentError_); - AddError(ValueType(SchemaType::GetValidateErrorKeyword(code), GetStateAllocator(), false).Move(), currentError_); - } - - void MergeError(ValueType& other) { - for (typename ValueType::MemberIterator it = other.MemberBegin(), end = other.MemberEnd(); it != end; ++it) { - AddError(it->name, it->value); - } - } - - void AddNumberError(const ValidateErrorCode code, ValueType& actual, const SValue& expected, - const typename SchemaType::ValueType& (*exclusive)() = 0) { - currentError_.SetObject(); - currentError_.AddMember(GetActualString(), actual, GetStateAllocator()); - currentError_.AddMember(GetExpectedString(), ValueType(expected, GetStateAllocator()).Move(), GetStateAllocator()); - if (exclusive) - currentError_.AddMember(ValueType(exclusive(), GetStateAllocator()).Move(), true, GetStateAllocator()); - AddCurrentError(code); - } - - void AddErrorArray(const ValidateErrorCode code, - ISchemaValidator** subvalidators, SizeType count) { - ValueType errors(kArrayType); - for (SizeType i = 0; i < count; ++i) - errors.PushBack(static_cast(subvalidators[i])->GetError(), GetStateAllocator()); - currentError_.SetObject(); - currentError_.AddMember(GetErrorsString(), errors, GetStateAllocator()); - AddCurrentError(code); - } - - const SchemaType& CurrentSchema() const { return *schemaStack_.template Top()->schema; } - Context& CurrentContext() { return *schemaStack_.template Top(); } - const Context& CurrentContext() const { return *schemaStack_.template Top(); } - - static const size_t kDefaultSchemaStackCapacity = 1024; - static const size_t kDefaultDocumentStackCapacity = 256; - const SchemaDocumentType* schemaDocument_; - const SchemaType& root_; - StateAllocator* stateAllocator_; - StateAllocator* ownStateAllocator_; - internal::Stack schemaStack_; //!< stack to store the current path of schema (BaseSchemaType *) - internal::Stack documentStack_; //!< stack to store the current path of validating document (Ch) - OutputHandler* outputHandler_; - ValueType error_; - ValueType currentError_; - ValueType missingDependents_; - bool valid_; - unsigned flags_; - unsigned depth_; -}; - -typedef GenericSchemaValidator SchemaValidator; - -/////////////////////////////////////////////////////////////////////////////// -// SchemaValidatingReader - -//! A helper class for parsing with validation. -/*! - This helper class is a functor, designed as a parameter of \ref GenericDocument::Populate(). - - \tparam parseFlags Combination of \ref ParseFlag. - \tparam InputStream Type of input stream, implementing Stream concept. - \tparam SourceEncoding Encoding of the input stream. - \tparam SchemaDocumentType Type of schema document. - \tparam StackAllocator Allocator type for stack. -*/ -template < - unsigned parseFlags, - typename InputStream, - typename SourceEncoding, - typename SchemaDocumentType = SchemaDocument, - typename StackAllocator = CrtAllocator> -class SchemaValidatingReader { -public: - typedef typename SchemaDocumentType::PointerType PointerType; - typedef typename InputStream::Ch Ch; - typedef GenericValue ValueType; - - //! Constructor - /*! - \param is Input stream. - \param sd Schema document. - */ - SchemaValidatingReader(InputStream& is, const SchemaDocumentType& sd) : is_(is), sd_(sd), invalidSchemaKeyword_(), invalidSchemaCode_(kValidateErrorNone), error_(kObjectType), isValid_(true) {} - - template - bool operator()(Handler& handler) { - GenericReader reader; - GenericSchemaValidator validator(sd_, handler); - parseResult_ = reader.template Parse(is_, validator); - - isValid_ = validator.IsValid(); - if (isValid_) { - invalidSchemaPointer_ = PointerType(); - invalidSchemaKeyword_ = 0; - invalidDocumentPointer_ = PointerType(); - error_.SetObject(); - } - else { - invalidSchemaPointer_ = validator.GetInvalidSchemaPointer(); - invalidSchemaKeyword_ = validator.GetInvalidSchemaKeyword(); - invalidSchemaCode_ = validator.GetInvalidSchemaCode(); - invalidDocumentPointer_ = validator.GetInvalidDocumentPointer(); - error_.CopyFrom(validator.GetError(), allocator_); - } - - return parseResult_; - } - - const ParseResult& GetParseResult() const { return parseResult_; } - bool IsValid() const { return isValid_; } - const PointerType& GetInvalidSchemaPointer() const { return invalidSchemaPointer_; } - const Ch* GetInvalidSchemaKeyword() const { return invalidSchemaKeyword_; } - const PointerType& GetInvalidDocumentPointer() const { return invalidDocumentPointer_; } - const ValueType& GetError() const { return error_; } - ValidateErrorCode GetInvalidSchemaCode() const { return invalidSchemaCode_; } - -private: - InputStream& is_; - const SchemaDocumentType& sd_; - - ParseResult parseResult_; - PointerType invalidSchemaPointer_; - const Ch* invalidSchemaKeyword_; - PointerType invalidDocumentPointer_; - ValidateErrorCode invalidSchemaCode_; - StackAllocator allocator_; - ValueType error_; - bool isValid_; -}; - -RAPIDJSON_NAMESPACE_END -RAPIDJSON_DIAG_POP - -#endif // RAPIDJSON_SCHEMA_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/stream.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/stream.h deleted file mode 100644 index 1fd7091..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/stream.h +++ /dev/null @@ -1,223 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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. - -#include "rapidjson.h" - -#ifndef RAPIDJSON_STREAM_H_ -#define RAPIDJSON_STREAM_H_ - -#include "encodings.h" - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// Stream - -/*! \class rapidjson::Stream - \brief Concept for reading and writing characters. - - For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd(). - - For write-only stream, only need to implement Put() and Flush(). - -\code -concept Stream { - typename Ch; //!< Character type of the stream. - - //! Read the current character from stream without moving the read cursor. - Ch Peek() const; - - //! Read the current character from stream and moving the read cursor to next character. - Ch Take(); - - //! Get the current read cursor. - //! \return Number of characters read from start. - size_t Tell(); - - //! Begin writing operation at the current read pointer. - //! \return The begin writer pointer. - Ch* PutBegin(); - - //! Write a character. - void Put(Ch c); - - //! Flush the buffer. - void Flush(); - - //! End the writing operation. - //! \param begin The begin write pointer returned by PutBegin(). - //! \return Number of characters written. - size_t PutEnd(Ch* begin); -} -\endcode -*/ - -//! Provides additional information for stream. -/*! - By using traits pattern, this type provides a default configuration for stream. - For custom stream, this type can be specialized for other configuration. - See TEST(Reader, CustomStringStream) in readertest.cpp for example. -*/ -template -struct StreamTraits { - //! Whether to make local copy of stream for optimization during parsing. - /*! - By default, for safety, streams do not use local copy optimization. - Stream that can be copied fast should specialize this, like StreamTraits. - */ - enum { copyOptimization = 0 }; -}; - -//! Reserve n characters for writing to a stream. -template -inline void PutReserve(Stream& stream, size_t count) { - (void)stream; - (void)count; -} - -//! Write character to a stream, presuming buffer is reserved. -template -inline void PutUnsafe(Stream& stream, typename Stream::Ch c) { - stream.Put(c); -} - -//! Put N copies of a character to a stream. -template -inline void PutN(Stream& stream, Ch c, size_t n) { - PutReserve(stream, n); - for (size_t i = 0; i < n; i++) - PutUnsafe(stream, c); -} - -/////////////////////////////////////////////////////////////////////////////// -// GenericStreamWrapper - -//! A Stream Wrapper -/*! \tThis string stream is a wrapper for any stream by just forwarding any - \treceived message to the origin stream. - \note implements Stream concept -*/ - -#if defined(_MSC_VER) && _MSC_VER <= 1800 -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4702) // unreachable code -RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated -#endif - -template > -class GenericStreamWrapper { -public: - typedef typename Encoding::Ch Ch; - GenericStreamWrapper(InputStream& is): is_(is) {} - - Ch Peek() const { return is_.Peek(); } - Ch Take() { return is_.Take(); } - size_t Tell() { return is_.Tell(); } - Ch* PutBegin() { return is_.PutBegin(); } - void Put(Ch ch) { is_.Put(ch); } - void Flush() { is_.Flush(); } - size_t PutEnd(Ch* ch) { return is_.PutEnd(ch); } - - // wrapper for MemoryStream - const Ch* Peek4() const { return is_.Peek4(); } - - // wrapper for AutoUTFInputStream - UTFType GetType() const { return is_.GetType(); } - bool HasBOM() const { return is_.HasBOM(); } - -protected: - InputStream& is_; -}; - -#if defined(_MSC_VER) && _MSC_VER <= 1800 -RAPIDJSON_DIAG_POP -#endif - -/////////////////////////////////////////////////////////////////////////////// -// StringStream - -//! Read-only string stream. -/*! \note implements Stream concept -*/ -template -struct GenericStringStream { - typedef typename Encoding::Ch Ch; - - GenericStringStream(const Ch *src) : src_(src), head_(src) {} - - Ch Peek() const { return *src_; } - Ch Take() { return *src_++; } - size_t Tell() const { return static_cast(src_ - head_); } - - Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - void Put(Ch) { RAPIDJSON_ASSERT(false); } - void Flush() { RAPIDJSON_ASSERT(false); } - size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } - - const Ch* src_; //!< Current read position. - const Ch* head_; //!< Original head of the string. -}; - -template -struct StreamTraits > { - enum { copyOptimization = 1 }; -}; - -//! String stream with UTF8 encoding. -typedef GenericStringStream > StringStream; - -/////////////////////////////////////////////////////////////////////////////// -// InsituStringStream - -//! A read-write string stream. -/*! This string stream is particularly designed for in-situ parsing. - \note implements Stream concept -*/ -template -struct GenericInsituStringStream { - typedef typename Encoding::Ch Ch; - - GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {} - - // Read - Ch Peek() { return *src_; } - Ch Take() { return *src_++; } - size_t Tell() { return static_cast(src_ - head_); } - - // Write - void Put(Ch c) { RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; } - - Ch* PutBegin() { return dst_ = src_; } - size_t PutEnd(Ch* begin) { return static_cast(dst_ - begin); } - void Flush() {} - - Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; } - void Pop(size_t count) { dst_ -= count; } - - Ch* src_; - Ch* dst_; - Ch* head_; -}; - -template -struct StreamTraits > { - enum { copyOptimization = 1 }; -}; - -//! Insitu string stream with UTF8 encoding. -typedef GenericInsituStringStream > InsituStringStream; - -RAPIDJSON_NAMESPACE_END - -#endif // RAPIDJSON_STREAM_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/stringbuffer.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/stringbuffer.h deleted file mode 100644 index 17bfeac..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/stringbuffer.h +++ /dev/null @@ -1,121 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_STRINGBUFFER_H_ -#define RAPIDJSON_STRINGBUFFER_H_ - -#include "stream.h" -#include "internal/stack.h" - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS -#include // std::move -#endif - -#include "internal/stack.h" - -#if defined(__clang__) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(c++98-compat) -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -//! Represents an in-memory output stream. -/*! - \tparam Encoding Encoding of the stream. - \tparam Allocator type for allocating memory buffer. - \note implements Stream concept -*/ -template -class GenericStringBuffer { -public: - typedef typename Encoding::Ch Ch; - - GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {} - GenericStringBuffer& operator=(GenericStringBuffer&& rhs) { - if (&rhs != this) - stack_ = std::move(rhs.stack_); - return *this; - } -#endif - - void Put(Ch c) { *stack_.template Push() = c; } - void PutUnsafe(Ch c) { *stack_.template PushUnsafe() = c; } - void Flush() {} - - void Clear() { stack_.Clear(); } - void ShrinkToFit() { - // Push and pop a null terminator. This is safe. - *stack_.template Push() = '\0'; - stack_.ShrinkToFit(); - stack_.template Pop(1); - } - - void Reserve(size_t count) { stack_.template Reserve(count); } - Ch* Push(size_t count) { return stack_.template Push(count); } - Ch* PushUnsafe(size_t count) { return stack_.template PushUnsafe(count); } - void Pop(size_t count) { stack_.template Pop(count); } - - const Ch* GetString() const { - // Push and pop a null terminator. This is safe. - *stack_.template Push() = '\0'; - stack_.template Pop(1); - - return stack_.template Bottom(); - } - - //! Get the size of string in bytes in the string buffer. - size_t GetSize() const { return stack_.GetSize(); } - - //! Get the length of string in Ch in the string buffer. - size_t GetLength() const { return stack_.GetSize() / sizeof(Ch); } - - static const size_t kDefaultCapacity = 256; - mutable internal::Stack stack_; - -private: - // Prohibit copy constructor & assignment operator. - GenericStringBuffer(const GenericStringBuffer&); - GenericStringBuffer& operator=(const GenericStringBuffer&); -}; - -//! String buffer with UTF8 encoding -typedef GenericStringBuffer > StringBuffer; - -template -inline void PutReserve(GenericStringBuffer& stream, size_t count) { - stream.Reserve(count); -} - -template -inline void PutUnsafe(GenericStringBuffer& stream, typename Encoding::Ch c) { - stream.PutUnsafe(c); -} - -//! Implement specialized version of PutN() with memset() for better performance. -template<> -inline void PutN(GenericStringBuffer >& stream, char c, size_t n) { - std::memset(stream.stack_.Push(n), c, n * sizeof(c)); -} - -RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_STRINGBUFFER_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/uri.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/uri.h deleted file mode 100644 index f93e508..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/uri.h +++ /dev/null @@ -1,481 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// (C) Copyright IBM Corporation 2021 -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_URI_H_ -#define RAPIDJSON_URI_H_ - -#include "internal/strfunc.h" - -#if defined(__clang__) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(c++98-compat) -#elif defined(_MSC_VER) -RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// GenericUri - -template -class GenericUri { -public: - typedef typename ValueType::Ch Ch; -#if RAPIDJSON_HAS_STDSTRING - typedef std::basic_string String; -#endif - - //! Constructors - GenericUri(Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { - } - - GenericUri(const Ch* uri, SizeType len, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { - Parse(uri, len); - } - - GenericUri(const Ch* uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { - Parse(uri, internal::StrLen(uri)); - } - - // Use with specializations of GenericValue - template GenericUri(const T& uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { - const Ch* u = uri.template Get(); // TypeHelper from document.h - Parse(u, internal::StrLen(u)); - } - -#if RAPIDJSON_HAS_STDSTRING - GenericUri(const String& uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { - Parse(uri.c_str(), internal::StrLen(uri.c_str())); - } -#endif - - //! Copy constructor - GenericUri(const GenericUri& rhs) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(), ownAllocator_() { - *this = rhs; - } - - //! Copy constructor - GenericUri(const GenericUri& rhs, Allocator* allocator) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { - *this = rhs; - } - - //! Destructor. - ~GenericUri() { - Free(); - RAPIDJSON_DELETE(ownAllocator_); - } - - //! Assignment operator - GenericUri& operator=(const GenericUri& rhs) { - if (this != &rhs) { - // Do not delete ownAllocator - Free(); - Allocate(rhs.GetStringLength()); - auth_ = CopyPart(scheme_, rhs.scheme_, rhs.GetSchemeStringLength()); - path_ = CopyPart(auth_, rhs.auth_, rhs.GetAuthStringLength()); - query_ = CopyPart(path_, rhs.path_, rhs.GetPathStringLength()); - frag_ = CopyPart(query_, rhs.query_, rhs.GetQueryStringLength()); - base_ = CopyPart(frag_, rhs.frag_, rhs.GetFragStringLength()); - uri_ = CopyPart(base_, rhs.base_, rhs.GetBaseStringLength()); - CopyPart(uri_, rhs.uri_, rhs.GetStringLength()); - } - return *this; - } - - //! Getters - // Use with specializations of GenericValue - template void Get(T& uri, Allocator& allocator) { - uri.template Set(this->GetString(), allocator); // TypeHelper from document.h - } - - const Ch* GetString() const { return uri_; } - SizeType GetStringLength() const { return uri_ == 0 ? 0 : internal::StrLen(uri_); } - const Ch* GetBaseString() const { return base_; } - SizeType GetBaseStringLength() const { return base_ == 0 ? 0 : internal::StrLen(base_); } - const Ch* GetSchemeString() const { return scheme_; } - SizeType GetSchemeStringLength() const { return scheme_ == 0 ? 0 : internal::StrLen(scheme_); } - const Ch* GetAuthString() const { return auth_; } - SizeType GetAuthStringLength() const { return auth_ == 0 ? 0 : internal::StrLen(auth_); } - const Ch* GetPathString() const { return path_; } - SizeType GetPathStringLength() const { return path_ == 0 ? 0 : internal::StrLen(path_); } - const Ch* GetQueryString() const { return query_; } - SizeType GetQueryStringLength() const { return query_ == 0 ? 0 : internal::StrLen(query_); } - const Ch* GetFragString() const { return frag_; } - SizeType GetFragStringLength() const { return frag_ == 0 ? 0 : internal::StrLen(frag_); } - -#if RAPIDJSON_HAS_STDSTRING - static String Get(const GenericUri& uri) { return String(uri.GetString(), uri.GetStringLength()); } - static String GetBase(const GenericUri& uri) { return String(uri.GetBaseString(), uri.GetBaseStringLength()); } - static String GetScheme(const GenericUri& uri) { return String(uri.GetSchemeString(), uri.GetSchemeStringLength()); } - static String GetAuth(const GenericUri& uri) { return String(uri.GetAuthString(), uri.GetAuthStringLength()); } - static String GetPath(const GenericUri& uri) { return String(uri.GetPathString(), uri.GetPathStringLength()); } - static String GetQuery(const GenericUri& uri) { return String(uri.GetQueryString(), uri.GetQueryStringLength()); } - static String GetFrag(const GenericUri& uri) { return String(uri.GetFragString(), uri.GetFragStringLength()); } -#endif - - //! Equality operators - bool operator==(const GenericUri& rhs) const { - return Match(rhs, true); - } - - bool operator!=(const GenericUri& rhs) const { - return !Match(rhs, true); - } - - bool Match(const GenericUri& uri, bool full = true) const { - Ch* s1; - Ch* s2; - if (full) { - s1 = uri_; - s2 = uri.uri_; - } else { - s1 = base_; - s2 = uri.base_; - } - if (s1 == s2) return true; - if (s1 == 0 || s2 == 0) return false; - return internal::StrCmp(s1, s2) == 0; - } - - //! Resolve this URI against another (base) URI in accordance with URI resolution rules. - // See https://tools.ietf.org/html/rfc3986 - // Use for resolving an id or $ref with an in-scope id. - // Returns a new GenericUri for the resolved URI. - GenericUri Resolve(const GenericUri& baseuri, Allocator* allocator = 0) { - GenericUri resuri; - resuri.allocator_ = allocator; - // Ensure enough space for combining paths - resuri.Allocate(GetStringLength() + baseuri.GetStringLength() + 1); // + 1 for joining slash - - if (!(GetSchemeStringLength() == 0)) { - // Use all of this URI - resuri.auth_ = CopyPart(resuri.scheme_, scheme_, GetSchemeStringLength()); - resuri.path_ = CopyPart(resuri.auth_, auth_, GetAuthStringLength()); - resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength()); - resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength()); - resuri.RemoveDotSegments(); - } else { - // Use the base scheme - resuri.auth_ = CopyPart(resuri.scheme_, baseuri.scheme_, baseuri.GetSchemeStringLength()); - if (!(GetAuthStringLength() == 0)) { - // Use this auth, path, query - resuri.path_ = CopyPart(resuri.auth_, auth_, GetAuthStringLength()); - resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength()); - resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength()); - resuri.RemoveDotSegments(); - } else { - // Use the base auth - resuri.path_ = CopyPart(resuri.auth_, baseuri.auth_, baseuri.GetAuthStringLength()); - if (GetPathStringLength() == 0) { - // Use the base path - resuri.query_ = CopyPart(resuri.path_, baseuri.path_, baseuri.GetPathStringLength()); - if (GetQueryStringLength() == 0) { - // Use the base query - resuri.frag_ = CopyPart(resuri.query_, baseuri.query_, baseuri.GetQueryStringLength()); - } else { - // Use this query - resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength()); - } - } else { - if (path_[0] == '/') { - // Absolute path - use all of this path - resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength()); - resuri.RemoveDotSegments(); - } else { - // Relative path - append this path to base path after base path's last slash - size_t pos = 0; - if (!(baseuri.GetAuthStringLength() == 0) && baseuri.GetPathStringLength() == 0) { - resuri.path_[pos] = '/'; - pos++; - } - size_t lastslashpos = baseuri.GetPathStringLength(); - while (lastslashpos > 0) { - if (baseuri.path_[lastslashpos - 1] == '/') break; - lastslashpos--; - } - std::memcpy(&resuri.path_[pos], baseuri.path_, lastslashpos * sizeof(Ch)); - pos += lastslashpos; - resuri.query_ = CopyPart(&resuri.path_[pos], path_, GetPathStringLength()); - resuri.RemoveDotSegments(); - } - // Use this query - resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength()); - } - } - } - // Always use this frag - resuri.base_ = CopyPart(resuri.frag_, frag_, GetFragStringLength()); - - // Re-constitute base_ and uri_ - resuri.SetBase(); - resuri.uri_ = resuri.base_ + resuri.GetBaseStringLength() + 1; - resuri.SetUri(); - return resuri; - } - - //! Get the allocator of this GenericUri. - Allocator& GetAllocator() { return *allocator_; } - -private: - // Allocate memory for a URI - // Returns total amount allocated - std::size_t Allocate(std::size_t len) { - // Create own allocator if user did not supply. - if (!allocator_) - ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); - - // Allocate one block containing each part of the URI (5) plus base plus full URI, all null terminated. - // Order: scheme, auth, path, query, frag, base, uri - // Note need to set, increment, assign in 3 stages to avoid compiler warning bug. - size_t total = (3 * len + 7) * sizeof(Ch); - scheme_ = static_cast(allocator_->Malloc(total)); - *scheme_ = '\0'; - auth_ = scheme_; - auth_++; - *auth_ = '\0'; - path_ = auth_; - path_++; - *path_ = '\0'; - query_ = path_; - query_++; - *query_ = '\0'; - frag_ = query_; - frag_++; - *frag_ = '\0'; - base_ = frag_; - base_++; - *base_ = '\0'; - uri_ = base_; - uri_++; - *uri_ = '\0'; - return total; - } - - // Free memory for a URI - void Free() { - if (scheme_) { - Allocator::Free(scheme_); - scheme_ = 0; - } - } - - // Parse a URI into constituent scheme, authority, path, query, & fragment parts - // Supports URIs that match regex ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? as per - // https://tools.ietf.org/html/rfc3986 - void Parse(const Ch* uri, std::size_t len) { - std::size_t start = 0, pos1 = 0, pos2 = 0; - Allocate(len); - - // Look for scheme ([^:/?#]+):)? - if (start < len) { - while (pos1 < len) { - if (uri[pos1] == ':') break; - pos1++; - } - if (pos1 != len) { - while (pos2 < len) { - if (uri[pos2] == '/') break; - if (uri[pos2] == '?') break; - if (uri[pos2] == '#') break; - pos2++; - } - if (pos1 < pos2) { - pos1++; - std::memcpy(scheme_, &uri[start], pos1 * sizeof(Ch)); - scheme_[pos1] = '\0'; - start = pos1; - } - } - } - // Look for auth (//([^/?#]*))? - // Note need to set, increment, assign in 3 stages to avoid compiler warning bug. - auth_ = scheme_ + GetSchemeStringLength(); - auth_++; - *auth_ = '\0'; - if (start < len - 1 && uri[start] == '/' && uri[start + 1] == '/') { - pos2 = start + 2; - while (pos2 < len) { - if (uri[pos2] == '/') break; - if (uri[pos2] == '?') break; - if (uri[pos2] == '#') break; - pos2++; - } - std::memcpy(auth_, &uri[start], (pos2 - start) * sizeof(Ch)); - auth_[pos2 - start] = '\0'; - start = pos2; - } - // Look for path ([^?#]*) - // Note need to set, increment, assign in 3 stages to avoid compiler warning bug. - path_ = auth_ + GetAuthStringLength(); - path_++; - *path_ = '\0'; - if (start < len) { - pos2 = start; - while (pos2 < len) { - if (uri[pos2] == '?') break; - if (uri[pos2] == '#') break; - pos2++; - } - if (start != pos2) { - std::memcpy(path_, &uri[start], (pos2 - start) * sizeof(Ch)); - path_[pos2 - start] = '\0'; - if (path_[0] == '/') - RemoveDotSegments(); // absolute path - normalize - start = pos2; - } - } - // Look for query (\?([^#]*))? - // Note need to set, increment, assign in 3 stages to avoid compiler warning bug. - query_ = path_ + GetPathStringLength(); - query_++; - *query_ = '\0'; - if (start < len && uri[start] == '?') { - pos2 = start + 1; - while (pos2 < len) { - if (uri[pos2] == '#') break; - pos2++; - } - if (start != pos2) { - std::memcpy(query_, &uri[start], (pos2 - start) * sizeof(Ch)); - query_[pos2 - start] = '\0'; - start = pos2; - } - } - // Look for fragment (#(.*))? - // Note need to set, increment, assign in 3 stages to avoid compiler warning bug. - frag_ = query_ + GetQueryStringLength(); - frag_++; - *frag_ = '\0'; - if (start < len && uri[start] == '#') { - std::memcpy(frag_, &uri[start], (len - start) * sizeof(Ch)); - frag_[len - start] = '\0'; - } - - // Re-constitute base_ and uri_ - base_ = frag_ + GetFragStringLength() + 1; - SetBase(); - uri_ = base_ + GetBaseStringLength() + 1; - SetUri(); - } - - // Reconstitute base - void SetBase() { - Ch* next = base_; - std::memcpy(next, scheme_, GetSchemeStringLength() * sizeof(Ch)); - next+= GetSchemeStringLength(); - std::memcpy(next, auth_, GetAuthStringLength() * sizeof(Ch)); - next+= GetAuthStringLength(); - std::memcpy(next, path_, GetPathStringLength() * sizeof(Ch)); - next+= GetPathStringLength(); - std::memcpy(next, query_, GetQueryStringLength() * sizeof(Ch)); - next+= GetQueryStringLength(); - *next = '\0'; - } - - // Reconstitute uri - void SetUri() { - Ch* next = uri_; - std::memcpy(next, base_, GetBaseStringLength() * sizeof(Ch)); - next+= GetBaseStringLength(); - std::memcpy(next, frag_, GetFragStringLength() * sizeof(Ch)); - next+= GetFragStringLength(); - *next = '\0'; - } - - // Copy a part from one GenericUri to another - // Return the pointer to the next part to be copied to - Ch* CopyPart(Ch* to, Ch* from, std::size_t len) { - RAPIDJSON_ASSERT(to != 0); - RAPIDJSON_ASSERT(from != 0); - std::memcpy(to, from, len * sizeof(Ch)); - to[len] = '\0'; - Ch* next = to + len + 1; - return next; - } - - // Remove . and .. segments from the path_ member. - // https://tools.ietf.org/html/rfc3986 - // This is done in place as we are only removing segments. - void RemoveDotSegments() { - std::size_t pathlen = GetPathStringLength(); - std::size_t pathpos = 0; // Position in path_ - std::size_t newpos = 0; // Position in new path_ - - // Loop through each segment in original path_ - while (pathpos < pathlen) { - // Get next segment, bounded by '/' or end - size_t slashpos = 0; - while ((pathpos + slashpos) < pathlen) { - if (path_[pathpos + slashpos] == '/') break; - slashpos++; - } - // Check for .. and . segments - if (slashpos == 2 && path_[pathpos] == '.' && path_[pathpos + 1] == '.') { - // Backup a .. segment in the new path_ - // We expect to find a previously added slash at the end or nothing - RAPIDJSON_ASSERT(newpos == 0 || path_[newpos - 1] == '/'); - size_t lastslashpos = newpos; - // Make sure we don't go beyond the start segment - if (lastslashpos > 1) { - // Find the next to last slash and back up to it - lastslashpos--; - while (lastslashpos > 0) { - if (path_[lastslashpos - 1] == '/') break; - lastslashpos--; - } - // Set the new path_ position - newpos = lastslashpos; - } - } else if (slashpos == 1 && path_[pathpos] == '.') { - // Discard . segment, leaves new path_ unchanged - } else { - // Move any other kind of segment to the new path_ - RAPIDJSON_ASSERT(newpos <= pathpos); - std::memmove(&path_[newpos], &path_[pathpos], slashpos * sizeof(Ch)); - newpos += slashpos; - // Add slash if not at end - if ((pathpos + slashpos) < pathlen) { - path_[newpos] = '/'; - newpos++; - } - } - // Move to next segment - pathpos += slashpos + 1; - } - path_[newpos] = '\0'; - } - - Ch* uri_; // Everything - Ch* base_; // Everything except fragment - Ch* scheme_; // Includes the : - Ch* auth_; // Includes the // - Ch* path_; // Absolute if starts with / - Ch* query_; // Includes the ? - Ch* frag_; // Includes the # - - Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_. - Allocator* ownAllocator_; //!< Allocator owned by this Uri. -}; - -//! GenericUri for Value (UTF-8, default allocator). -typedef GenericUri Uri; - -RAPIDJSON_NAMESPACE_END - -#if defined(__clang__) -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_URI_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/writer.h b/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/writer.h deleted file mode 100644 index 81f34fc..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/rapidjson/writer.h +++ /dev/null @@ -1,710 +0,0 @@ -// Tencent is pleased to support the open source community by making RapidJSON available. -// -// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -// -// Licensed under the MIT License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// http://opensource.org/licenses/MIT -// -// 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 RAPIDJSON_WRITER_H_ -#define RAPIDJSON_WRITER_H_ - -#include "stream.h" -#include "internal/clzll.h" -#include "internal/meta.h" -#include "internal/stack.h" -#include "internal/strfunc.h" -#include "internal/dtoa.h" -#include "internal/itoa.h" -#include "stringbuffer.h" -#include // placement new - -#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER) -#include -#pragma intrinsic(_BitScanForward) -#endif -#ifdef RAPIDJSON_SSE42 -#include -#elif defined(RAPIDJSON_SSE2) -#include -#elif defined(RAPIDJSON_NEON) -#include -#endif - -#ifdef __clang__ -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(padded) -RAPIDJSON_DIAG_OFF(unreachable-code) -RAPIDJSON_DIAG_OFF(c++98-compat) -#elif defined(_MSC_VER) -RAPIDJSON_DIAG_PUSH -RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant -#endif - -RAPIDJSON_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// WriteFlag - -/*! \def RAPIDJSON_WRITE_DEFAULT_FLAGS - \ingroup RAPIDJSON_CONFIG - \brief User-defined kWriteDefaultFlags definition. - - User can define this as any \c WriteFlag combinations. -*/ -#ifndef RAPIDJSON_WRITE_DEFAULT_FLAGS -#define RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNoFlags -#endif - -//! Combination of writeFlags -enum WriteFlag { - kWriteNoFlags = 0, //!< No flags are set. - kWriteValidateEncodingFlag = 1, //!< Validate encoding of JSON strings. - kWriteNanAndInfFlag = 2, //!< Allow writing of Infinity, -Infinity and NaN. - kWriteDefaultFlags = RAPIDJSON_WRITE_DEFAULT_FLAGS //!< Default write flags. Can be customized by defining RAPIDJSON_WRITE_DEFAULT_FLAGS -}; - -//! JSON writer -/*! Writer implements the concept Handler. - It generates JSON text by events to an output os. - - User may programmatically calls the functions of a writer to generate JSON text. - - On the other side, a writer can also be passed to objects that generates events, - - for example Reader::Parse() and Document::Accept(). - - \tparam OutputStream Type of output stream. - \tparam SourceEncoding Encoding of source string. - \tparam TargetEncoding Encoding of output stream. - \tparam StackAllocator Type of allocator for allocating memory of stack. - \note implements Handler concept -*/ -template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags> -class Writer { -public: - typedef typename SourceEncoding::Ch Ch; - - static const int kDefaultMaxDecimalPlaces = 324; - - //! Constructor - /*! \param os Output stream. - \param stackAllocator User supplied allocator. If it is null, it will create a private one. - \param levelDepth Initial capacity of stack. - */ - explicit - Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t levelDepth = kDefaultLevelDepth) : - os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {} - - explicit - Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) : - os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {} - -#if RAPIDJSON_HAS_CXX11_RVALUE_REFS - Writer(Writer&& rhs) : - os_(rhs.os_), level_stack_(std::move(rhs.level_stack_)), maxDecimalPlaces_(rhs.maxDecimalPlaces_), hasRoot_(rhs.hasRoot_) { - rhs.os_ = 0; - } -#endif - - //! Reset the writer with a new stream. - /*! - This function reset the writer with a new stream and default settings, - in order to make a Writer object reusable for output multiple JSONs. - - \param os New output stream. - \code - Writer writer(os1); - writer.StartObject(); - // ... - writer.EndObject(); - - writer.Reset(os2); - writer.StartObject(); - // ... - writer.EndObject(); - \endcode - */ - void Reset(OutputStream& os) { - os_ = &os; - hasRoot_ = false; - level_stack_.Clear(); - } - - //! Checks whether the output is a complete JSON. - /*! - A complete JSON has a complete root object or array. - */ - bool IsComplete() const { - return hasRoot_ && level_stack_.Empty(); - } - - int GetMaxDecimalPlaces() const { - return maxDecimalPlaces_; - } - - //! Sets the maximum number of decimal places for double output. - /*! - This setting truncates the output with specified number of decimal places. - - For example, - - \code - writer.SetMaxDecimalPlaces(3); - writer.StartArray(); - writer.Double(0.12345); // "0.123" - writer.Double(0.0001); // "0.0" - writer.Double(1.234567890123456e30); // "1.234567890123456e30" (do not truncate significand for positive exponent) - writer.Double(1.23e-4); // "0.0" (do truncate significand for negative exponent) - writer.EndArray(); - \endcode - - The default setting does not truncate any decimal places. You can restore to this setting by calling - \code - writer.SetMaxDecimalPlaces(Writer::kDefaultMaxDecimalPlaces); - \endcode - */ - void SetMaxDecimalPlaces(int maxDecimalPlaces) { - maxDecimalPlaces_ = maxDecimalPlaces; - } - - /*!@name Implementation of Handler - \see Handler - */ - //@{ - - bool Null() { Prefix(kNullType); return EndValue(WriteNull()); } - bool Bool(bool b) { Prefix(b ? kTrueType : kFalseType); return EndValue(WriteBool(b)); } - bool Int(int i) { Prefix(kNumberType); return EndValue(WriteInt(i)); } - bool Uint(unsigned u) { Prefix(kNumberType); return EndValue(WriteUint(u)); } - bool Int64(int64_t i64) { Prefix(kNumberType); return EndValue(WriteInt64(i64)); } - bool Uint64(uint64_t u64) { Prefix(kNumberType); return EndValue(WriteUint64(u64)); } - - //! Writes the given \c double value to the stream - /*! - \param d The value to be written. - \return Whether it is succeed. - */ - bool Double(double d) { Prefix(kNumberType); return EndValue(WriteDouble(d)); } - - bool RawNumber(const Ch* str, SizeType length, bool copy = false) { - RAPIDJSON_ASSERT(str != 0); - (void)copy; - Prefix(kNumberType); - return EndValue(WriteString(str, length)); - } - - bool String(const Ch* str, SizeType length, bool copy = false) { - RAPIDJSON_ASSERT(str != 0); - (void)copy; - Prefix(kStringType); - return EndValue(WriteString(str, length)); - } - -#if RAPIDJSON_HAS_STDSTRING - bool String(const std::basic_string& str) { - return String(str.data(), SizeType(str.size())); - } -#endif - - bool StartObject() { - Prefix(kObjectType); - new (level_stack_.template Push()) Level(false); - return WriteStartObject(); - } - - bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } - -#if RAPIDJSON_HAS_STDSTRING - bool Key(const std::basic_string& str) - { - return Key(str.data(), SizeType(str.size())); - } -#endif - - bool EndObject(SizeType memberCount = 0) { - (void)memberCount; - RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); // not inside an Object - RAPIDJSON_ASSERT(!level_stack_.template Top()->inArray); // currently inside an Array, not Object - RAPIDJSON_ASSERT(0 == level_stack_.template Top()->valueCount % 2); // Object has a Key without a Value - level_stack_.template Pop(1); - return EndValue(WriteEndObject()); - } - - bool StartArray() { - Prefix(kArrayType); - new (level_stack_.template Push()) Level(true); - return WriteStartArray(); - } - - bool EndArray(SizeType elementCount = 0) { - (void)elementCount; - RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); - RAPIDJSON_ASSERT(level_stack_.template Top()->inArray); - level_stack_.template Pop(1); - return EndValue(WriteEndArray()); - } - //@} - - /*! @name Convenience extensions */ - //@{ - - //! Simpler but slower overload. - bool String(const Ch* const& str) { return String(str, internal::StrLen(str)); } - bool Key(const Ch* const& str) { return Key(str, internal::StrLen(str)); } - - //@} - - //! Write a raw JSON value. - /*! - For user to write a stringified JSON as a value. - - \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range. - \param length Length of the json. - \param type Type of the root of json. - */ - bool RawValue(const Ch* json, size_t length, Type type) { - RAPIDJSON_ASSERT(json != 0); - Prefix(type); - return EndValue(WriteRawValue(json, length)); - } - - //! Flush the output stream. - /*! - Allows the user to flush the output stream immediately. - */ - void Flush() { - os_->Flush(); - } - - static const size_t kDefaultLevelDepth = 32; - -protected: - //! Information for each nested level - struct Level { - Level(bool inArray_) : valueCount(0), inArray(inArray_) {} - size_t valueCount; //!< number of values in this level - bool inArray; //!< true if in array, otherwise in object - }; - - bool WriteNull() { - PutReserve(*os_, 4); - PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 'l'); return true; - } - - bool WriteBool(bool b) { - if (b) { - PutReserve(*os_, 4); - PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'r'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'e'); - } - else { - PutReserve(*os_, 5); - PutUnsafe(*os_, 'f'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 's'); PutUnsafe(*os_, 'e'); - } - return true; - } - - bool WriteInt(int i) { - char buffer[11]; - const char* end = internal::i32toa(i, buffer); - PutReserve(*os_, static_cast(end - buffer)); - for (const char* p = buffer; p != end; ++p) - PutUnsafe(*os_, static_cast(*p)); - return true; - } - - bool WriteUint(unsigned u) { - char buffer[10]; - const char* end = internal::u32toa(u, buffer); - PutReserve(*os_, static_cast(end - buffer)); - for (const char* p = buffer; p != end; ++p) - PutUnsafe(*os_, static_cast(*p)); - return true; - } - - bool WriteInt64(int64_t i64) { - char buffer[21]; - const char* end = internal::i64toa(i64, buffer); - PutReserve(*os_, static_cast(end - buffer)); - for (const char* p = buffer; p != end; ++p) - PutUnsafe(*os_, static_cast(*p)); - return true; - } - - bool WriteUint64(uint64_t u64) { - char buffer[20]; - char* end = internal::u64toa(u64, buffer); - PutReserve(*os_, static_cast(end - buffer)); - for (char* p = buffer; p != end; ++p) - PutUnsafe(*os_, static_cast(*p)); - return true; - } - - bool WriteDouble(double d) { - if (internal::Double(d).IsNanOrInf()) { - if (!(writeFlags & kWriteNanAndInfFlag)) - return false; - if (internal::Double(d).IsNan()) { - PutReserve(*os_, 3); - PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N'); - return true; - } - if (internal::Double(d).Sign()) { - PutReserve(*os_, 9); - PutUnsafe(*os_, '-'); - } - else - PutReserve(*os_, 8); - PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f'); - PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y'); - return true; - } - - char buffer[25]; - char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); - PutReserve(*os_, static_cast(end - buffer)); - for (char* p = buffer; p != end; ++p) - PutUnsafe(*os_, static_cast(*p)); - return true; - } - - bool WriteString(const Ch* str, SizeType length) { - static const typename OutputStream::Ch hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; - static const char escape[256] = { -#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - //0 1 2 3 4 5 6 7 8 9 A B C D E F - 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00 - 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10 - 0, 0, '"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 - Z16, Z16, // 30~4F - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, // 50 - Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 // 60~FF -#undef Z16 - }; - - if (TargetEncoding::supportUnicode) - PutReserve(*os_, 2 + length * 6); // "\uxxxx..." - else - PutReserve(*os_, 2 + length * 12); // "\uxxxx\uyyyy..." - - PutUnsafe(*os_, '\"'); - GenericStringStream is(str); - while (ScanWriteUnescapedString(is, length)) { - const Ch c = is.Peek(); - if (!TargetEncoding::supportUnicode && static_cast(c) >= 0x80) { - // Unicode escaping - unsigned codepoint; - if (RAPIDJSON_UNLIKELY(!SourceEncoding::Decode(is, &codepoint))) - return false; - PutUnsafe(*os_, '\\'); - PutUnsafe(*os_, 'u'); - if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint <= 0xFFFF)) { - PutUnsafe(*os_, hexDigits[(codepoint >> 12) & 15]); - PutUnsafe(*os_, hexDigits[(codepoint >> 8) & 15]); - PutUnsafe(*os_, hexDigits[(codepoint >> 4) & 15]); - PutUnsafe(*os_, hexDigits[(codepoint ) & 15]); - } - else { - RAPIDJSON_ASSERT(codepoint >= 0x010000 && codepoint <= 0x10FFFF); - // Surrogate pair - unsigned s = codepoint - 0x010000; - unsigned lead = (s >> 10) + 0xD800; - unsigned trail = (s & 0x3FF) + 0xDC00; - PutUnsafe(*os_, hexDigits[(lead >> 12) & 15]); - PutUnsafe(*os_, hexDigits[(lead >> 8) & 15]); - PutUnsafe(*os_, hexDigits[(lead >> 4) & 15]); - PutUnsafe(*os_, hexDigits[(lead ) & 15]); - PutUnsafe(*os_, '\\'); - PutUnsafe(*os_, 'u'); - PutUnsafe(*os_, hexDigits[(trail >> 12) & 15]); - PutUnsafe(*os_, hexDigits[(trail >> 8) & 15]); - PutUnsafe(*os_, hexDigits[(trail >> 4) & 15]); - PutUnsafe(*os_, hexDigits[(trail ) & 15]); - } - } - else if ((sizeof(Ch) == 1 || static_cast(c) < 256) && RAPIDJSON_UNLIKELY(escape[static_cast(c)])) { - is.Take(); - PutUnsafe(*os_, '\\'); - PutUnsafe(*os_, static_cast(escape[static_cast(c)])); - if (escape[static_cast(c)] == 'u') { - PutUnsafe(*os_, '0'); - PutUnsafe(*os_, '0'); - PutUnsafe(*os_, hexDigits[static_cast(c) >> 4]); - PutUnsafe(*os_, hexDigits[static_cast(c) & 0xF]); - } - } - else if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ? - Transcoder::Validate(is, *os_) : - Transcoder::TranscodeUnsafe(is, *os_)))) - return false; - } - PutUnsafe(*os_, '\"'); - return true; - } - - bool ScanWriteUnescapedString(GenericStringStream& is, size_t length) { - return RAPIDJSON_LIKELY(is.Tell() < length); - } - - bool WriteStartObject() { os_->Put('{'); return true; } - bool WriteEndObject() { os_->Put('}'); return true; } - bool WriteStartArray() { os_->Put('['); return true; } - bool WriteEndArray() { os_->Put(']'); return true; } - - bool WriteRawValue(const Ch* json, size_t length) { - PutReserve(*os_, length); - GenericStringStream is(json); - while (RAPIDJSON_LIKELY(is.Tell() < length)) { - RAPIDJSON_ASSERT(is.Peek() != '\0'); - if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ? - Transcoder::Validate(is, *os_) : - Transcoder::TranscodeUnsafe(is, *os_)))) - return false; - } - return true; - } - - void Prefix(Type type) { - (void)type; - if (RAPIDJSON_LIKELY(level_stack_.GetSize() != 0)) { // this value is not at root - Level* level = level_stack_.template Top(); - if (level->valueCount > 0) { - if (level->inArray) - os_->Put(','); // add comma if it is not the first element in array - else // in object - os_->Put((level->valueCount % 2 == 0) ? ',' : ':'); - } - if (!level->inArray && level->valueCount % 2 == 0) - RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name - level->valueCount++; - } - else { - RAPIDJSON_ASSERT(!hasRoot_); // Should only has one and only one root. - hasRoot_ = true; - } - } - - // Flush the value if it is the top level one. - bool EndValue(bool ret) { - if (RAPIDJSON_UNLIKELY(level_stack_.Empty())) // end of json text - Flush(); - return ret; - } - - OutputStream* os_; - internal::Stack level_stack_; - int maxDecimalPlaces_; - bool hasRoot_; - -private: - // Prohibit copy constructor & assignment operator. - Writer(const Writer&); - Writer& operator=(const Writer&); -}; - -// Full specialization for StringStream to prevent memory copying - -template<> -inline bool Writer::WriteInt(int i) { - char *buffer = os_->Push(11); - const char* end = internal::i32toa(i, buffer); - os_->Pop(static_cast(11 - (end - buffer))); - return true; -} - -template<> -inline bool Writer::WriteUint(unsigned u) { - char *buffer = os_->Push(10); - const char* end = internal::u32toa(u, buffer); - os_->Pop(static_cast(10 - (end - buffer))); - return true; -} - -template<> -inline bool Writer::WriteInt64(int64_t i64) { - char *buffer = os_->Push(21); - const char* end = internal::i64toa(i64, buffer); - os_->Pop(static_cast(21 - (end - buffer))); - return true; -} - -template<> -inline bool Writer::WriteUint64(uint64_t u) { - char *buffer = os_->Push(20); - const char* end = internal::u64toa(u, buffer); - os_->Pop(static_cast(20 - (end - buffer))); - return true; -} - -template<> -inline bool Writer::WriteDouble(double d) { - if (internal::Double(d).IsNanOrInf()) { - // Note: This code path can only be reached if (RAPIDJSON_WRITE_DEFAULT_FLAGS & kWriteNanAndInfFlag). - if (!(kWriteDefaultFlags & kWriteNanAndInfFlag)) - return false; - if (internal::Double(d).IsNan()) { - PutReserve(*os_, 3); - PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N'); - return true; - } - if (internal::Double(d).Sign()) { - PutReserve(*os_, 9); - PutUnsafe(*os_, '-'); - } - else - PutReserve(*os_, 8); - PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f'); - PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y'); - return true; - } - - char *buffer = os_->Push(25); - char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); - os_->Pop(static_cast(25 - (end - buffer))); - return true; -} - -#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) -template<> -inline bool Writer::ScanWriteUnescapedString(StringStream& is, size_t length) { - if (length < 16) - return RAPIDJSON_LIKELY(is.Tell() < length); - - if (!RAPIDJSON_LIKELY(is.Tell() < length)) - return false; - - const char* p = is.src_; - const char* end = is.head_ + length; - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - const char* endAligned = reinterpret_cast(reinterpret_cast(end) & static_cast(~15)); - if (nextAligned > end) - return true; - - while (p != nextAligned) - if (*p < 0x20 || *p == '\"' || *p == '\\') { - is.src_ = p; - return RAPIDJSON_LIKELY(is.Tell() < length); - } - else - os_->PutUnsafe(*p++); - - // The rest of string using SIMD - static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; - static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; - static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; - const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); - const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); - const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); - - for (; p != endAligned; p += 16) { - const __m128i s = _mm_load_si128(reinterpret_cast(p)); - const __m128i t1 = _mm_cmpeq_epi8(s, dq); - const __m128i t2 = _mm_cmpeq_epi8(s, bs); - const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F - const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); - unsigned short r = static_cast(_mm_movemask_epi8(x)); - if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped - SizeType len; -#ifdef _MSC_VER // Find the index of first escaped - unsigned long offset; - _BitScanForward(&offset, r); - len = offset; -#else - len = static_cast(__builtin_ffs(r) - 1); -#endif - char* q = reinterpret_cast(os_->PushUnsafe(len)); - for (size_t i = 0; i < len; i++) - q[i] = p[i]; - - p += len; - break; - } - _mm_storeu_si128(reinterpret_cast<__m128i *>(os_->PushUnsafe(16)), s); - } - - is.src_ = p; - return RAPIDJSON_LIKELY(is.Tell() < length); -} -#elif defined(RAPIDJSON_NEON) -template<> -inline bool Writer::ScanWriteUnescapedString(StringStream& is, size_t length) { - if (length < 16) - return RAPIDJSON_LIKELY(is.Tell() < length); - - if (!RAPIDJSON_LIKELY(is.Tell() < length)) - return false; - - const char* p = is.src_; - const char* end = is.head_ + length; - const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); - const char* endAligned = reinterpret_cast(reinterpret_cast(end) & static_cast(~15)); - if (nextAligned > end) - return true; - - while (p != nextAligned) - if (*p < 0x20 || *p == '\"' || *p == '\\') { - is.src_ = p; - return RAPIDJSON_LIKELY(is.Tell() < length); - } - else - os_->PutUnsafe(*p++); - - // The rest of string using SIMD - const uint8x16_t s0 = vmovq_n_u8('"'); - const uint8x16_t s1 = vmovq_n_u8('\\'); - const uint8x16_t s2 = vmovq_n_u8('\b'); - const uint8x16_t s3 = vmovq_n_u8(32); - - for (; p != endAligned; p += 16) { - const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); - uint8x16_t x = vceqq_u8(s, s0); - x = vorrq_u8(x, vceqq_u8(s, s1)); - x = vorrq_u8(x, vceqq_u8(s, s2)); - x = vorrq_u8(x, vcltq_u8(s, s3)); - - x = vrev64q_u8(x); // Rev in 64 - uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract - uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract - - SizeType len = 0; - bool escaped = false; - if (low == 0) { - if (high != 0) { - uint32_t lz = internal::clzll(high); - len = 8 + (lz >> 3); - escaped = true; - } - } else { - uint32_t lz = internal::clzll(low); - len = lz >> 3; - escaped = true; - } - if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped - char* q = reinterpret_cast(os_->PushUnsafe(len)); - for (size_t i = 0; i < len; i++) - q[i] = p[i]; - - p += len; - break; - } - vst1q_u8(reinterpret_cast(os_->PushUnsafe(16)), s); - } - - is.src_ = p; - return RAPIDJSON_LIKELY(is.Tell() < length); -} -#endif // RAPIDJSON_NEON - -RAPIDJSON_NAMESPACE_END - -#if defined(_MSC_VER) || defined(__clang__) -RAPIDJSON_DIAG_POP -#endif - -#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/thorvg.h b/L3_Middlewares/LVGL/src/libs/thorvg/thorvg.h deleted file mode 100644 index da3944c..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/thorvg.h +++ /dev/null @@ -1,2182 +0,0 @@ -#ifndef _THORVG_H_ -#define _THORVG_H_ - -#include "../../lv_conf_internal.h" - -/*Testing of dependencies*/ -#if LV_USE_THORVG && LV_USE_VECTOR_GRAPHIC == 0 -#error "ThorVG: LV_USE_VECTOR_GRAPHIC is required. Enable it in lv_conf.h" -#endif - -#if LV_USE_THORVG_INTERNAL -#define TVG_BUILD 1 - - -#include -#include -#include -#include - -#ifdef TVG_API - #undef TVG_API -#endif - -#ifndef TVG_STATIC - #ifdef _WIN32 - #if TVG_BUILD - #define TVG_API __declspec(dllexport) - #else - #define TVG_API __declspec(dllimport) - #endif - #elif (defined(__SUNPRO_C) || defined(__SUNPRO_CC)) - #define TVG_API __global - #else - #if (defined(__GNUC__) && __GNUC__ >= 4) || defined(__INTEL_COMPILER) - #define TVG_API __attribute__ ((visibility("default"))) - #else - #define TVG_API - #endif - #endif -#else - #define TVG_API -#endif - -#ifdef TVG_DEPRECATED - #undef TVG_DEPRECATED -#endif - -#ifdef _WIN32 - #define TVG_DEPRECATED __declspec(deprecated) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) - #define TVG_DEPRECATED __attribute__ ((__deprecated__)) -#else - #define TVG_DEPRECATED -#endif - -#define _TVG_DECLARE_PRIVATE(A) \ - struct Impl; \ - Impl* pImpl; \ -protected: \ - A(const A&) = delete; \ - const A& operator=(const A&) = delete; \ - A() - -#define _TVG_DISABLE_CTOR(A) \ - A() = delete; \ - ~A() = delete - -#define _TVG_DECLARE_ACCESSOR(A) \ - friend A - -namespace tvg -{ - -class RenderMethod; -class Animation; - -/** - * @defgroup ThorVG ThorVG - * @brief ThorVG classes and enumerations providing C++ APIs. - */ - -/**@{*/ - -/** - * @brief Enumeration specifying the result from the APIs. - */ -enum class Result -{ - Success = 0, ///< The value returned in case of a correct request execution. - InvalidArguments, ///< The value returned in the event of a problem with the arguments given to the API - e.g. empty paths or null pointers. - InsufficientCondition, ///< The value returned in case the request cannot be processed - e.g. asking for properties of an object, which does not exist. - FailedAllocation, ///< The value returned in case of unsuccessful memory allocation. - MemoryCorruption, ///< The value returned in the event of bad memory handling - e.g. failing in pointer releasing or casting - NonSupport, ///< The value returned in case of choosing unsupported options. - Unknown ///< The value returned in all other cases. -}; - - -/** - * @brief Enumeration specifying the values of the path commands accepted by TVG. - * - * Not to be confused with the path commands from the svg path element (like M, L, Q, H and many others). - * TVG interprets all of them and translates to the ones from the PathCommand values. - */ -enum class PathCommand -{ - Close = 0, ///< Ends the current sub-path and connects it with its initial point. This command doesn't expect any points. - MoveTo, ///< Sets a new initial point of the sub-path and a new current point. This command expects 1 point: the starting position. - LineTo, ///< Draws a line from the current point to the given point and sets a new value of the current point. This command expects 1 point: the end-position of the line. - CubicTo ///< Draws a cubic Bezier curve from the current point to the given point using two given control points and sets a new value of the current point. This command expects 3 points: the 1st control-point, the 2nd control-point, the end-point of the curve. -}; - - -/** - * @brief Enumeration determining the ending type of a stroke in the open sub-paths. - */ -enum class StrokeCap -{ - Square = 0, ///< The stroke is extended in both end-points of a sub-path by a rectangle, with the width equal to the stroke width and the length equal to the half of the stroke width. For zero length sub-paths the square is rendered with the size of the stroke width. - Round, ///< The stroke is extended in both end-points of a sub-path by a half circle, with a radius equal to the half of a stroke width. For zero length sub-paths a full circle is rendered. - Butt ///< The stroke ends exactly at each of the two end-points of a sub-path. For zero length sub-paths no stroke is rendered. -}; - - -/** - * @brief Enumeration determining the style used at the corners of joined stroked path segments. - */ -enum class StrokeJoin -{ - Bevel = 0, ///< The outer corner of the joined path segments is bevelled at the join point. The triangular region of the corner is enclosed by a straight line between the outer corners of each stroke. - Round, ///< The outer corner of the joined path segments is rounded. The circular region is centered at the join point. - Miter ///< The outer corner of the joined path segments is spiked. The spike is created by extension beyond the join point of the outer edges of the stroke until they intersect. In case the extension goes beyond the limit, the join style is converted to the Bevel style. -}; - - -/** - * @brief Enumeration specifying how to fill the area outside the gradient bounds. - */ -enum class FillSpread -{ - Pad = 0, ///< The remaining area is filled with the closest stop color. - Reflect, ///< The gradient pattern is reflected outside the gradient area until the expected region is filled. - Repeat ///< The gradient pattern is repeated continuously beyond the gradient area until the expected region is filled. -}; - - -/** - * @brief Enumeration specifying the algorithm used to establish which parts of the shape are treated as the inside of the shape. - */ -enum class FillRule -{ - Winding = 0, ///< A line from the point to a location outside the shape is drawn. The intersections of the line with the path segment of the shape are counted. Starting from zero, if the path segment of the shape crosses the line clockwise, one is added, otherwise one is subtracted. If the resulting sum is non zero, the point is inside the shape. - EvenOdd ///< A line from the point to a location outside the shape is drawn and its intersections with the path segments of the shape are counted. If the number of intersections is an odd number, the point is inside the shape. -}; - - -/** - * @brief Enumeration indicating the method used in the composition of two objects - the target and the source. - * - * Notation: S(Source), T(Target), SA(Source Alpha), TA(Target Alpha) - * - * @see Paint::composite() - */ -enum class CompositeMethod -{ - None = 0, ///< No composition is applied. - ClipPath, ///< The intersection of the source and the target is determined and only the resulting pixels from the source are rendered. - AlphaMask, ///< Alpha Masking using the compositing target's pixels as an alpha value. - InvAlphaMask, ///< Alpha Masking using the complement to the compositing target's pixels as an alpha value. - LumaMask, ///< Alpha Masking using the grayscale (0.2125R + 0.7154G + 0.0721*B) of the compositing target's pixels. @since 0.9 - InvLumaMask, ///< Alpha Masking using the grayscale (0.2125R + 0.7154G + 0.0721*B) of the complement to the compositing target's pixels. - AddMask, ///< Combines the target and source objects pixels using target alpha. (T * TA) + (S * (255 - TA)) (Experimental API) - SubtractMask, ///< Subtracts the source color from the target color while considering their respective target alpha. (T * TA) - (S * (255 - TA)) (Experimental API) - IntersectMask, ///< Computes the result by taking the minimum value between the target alpha and the source alpha and multiplies it with the target color. (T * min(TA, SA)) (Experimental API) - DifferenceMask ///< Calculates the absolute difference between the target color and the source color multiplied by the complement of the target alpha. abs(T - S * (255 - TA)) (Experimental API) -}; - - -/** - * @brief Enumeration indicates the method used for blending paint. Please refer to the respective formulas for each method. - * - * Notation: S(source paint as the top layer), D(destination as the bottom layer), Sa(source paint alpha), Da(destination alpha) - * - * @see Paint::blend() - * - * @note Experimental API - */ -enum class BlendMethod : uint8_t -{ - Normal = 0, ///< Perform the alpha blending(default). S if (Sa == 255), otherwise (Sa * S) + (255 - Sa) * D - Add, ///< Simply adds pixel values of one layer with the other. (S + D) - Screen, ///< The values of the pixels in the two layers are inverted, multiplied, and then inverted again. (S + D) - (S * D) - Multiply, ///< Takes the RGB channel values from 0 to 255 of each pixel in the top layer and multiples them with the values for the corresponding pixel from the bottom layer. (S * D) - Overlay, ///< Combines Multiply and Screen blend modes. (2 * S * D) if (2 * D < Da), otherwise (Sa * Da) - 2 * (Da - S) * (Sa - D) - Difference, ///< Subtracts the bottom layer from the top layer or the other way around, to always get a non-negative value. (S - D) if (S > D), otherwise (D - S) - Exclusion, ///< The result is twice the product of the top and bottom layers, subtracted from their sum. s + d - (2 * s * d) - SrcOver, ///< Replace the bottom layer with the top layer. - Darken, ///< Creates a pixel that retains the smallest components of the top and bottom layer pixels. min(S, D) - Lighten, ///< Only has the opposite action of Darken Only. max(S, D) - ColorDodge, ///< Divides the bottom layer by the inverted top layer. D / (255 - S) - ColorBurn, ///< Divides the inverted bottom layer by the top layer, and then inverts the result. 255 - (255 - D) / S - HardLight, ///< The same as Overlay but with the color roles reversed. (2 * S * D) if (S < Sa), otherwise (Sa * Da) - 2 * (Da - S) * (Sa - D) - SoftLight ///< The same as Overlay but with applying pure black or white does not result in pure black or white. (1 - 2 * S) * (D ^ 2) + (2 * S * D) -}; - - -/** - * @brief Enumeration specifying the engine type used for the graphics backend. For multiple backends bitwise operation is allowed. - */ -enum class CanvasEngine -{ - Sw = (1 << 1), ///< CPU rasterizer. - Gl = (1 << 2), ///< OpenGL rasterizer. - Wg = (1 << 3), ///< WebGPU rasterizer. (Experimental API) -}; - - -/** - * @brief A data structure representing a point in two-dimensional space. - */ -struct Point -{ - float x, y; -}; - - -/** - * @brief A data structure representing a three-dimensional matrix. - * - * The elements e11, e12, e21 and e22 represent the rotation matrix, including the scaling factor. - * The elements e13 and e23 determine the translation of the object along the x and y-axis, respectively. - * The elements e31 and e32 are set to 0, e33 is set to 1. - */ -struct Matrix -{ - float e11, e12, e13; - float e21, e22, e23; - float e31, e32, e33; -}; - - -/** - * @brief A data structure representing a texture mesh vertex - * - * @param pt The vertex coordinate - * @param uv The normalized texture coordinate in the range (0.0..1.0, 0.0..1.0) - * - * @note Experimental API - */ -struct Vertex -{ - Point pt; - Point uv; -}; - - -/** - * @brief A data structure representing a triangle in a texture mesh - * - * @param vertex The three vertices that make up the polygon - * - * @note Experimental API - */ -struct Polygon -{ - Vertex vertex[3]; -}; - - -/** - * @class Paint - * - * @brief An abstract class for managing graphical elements. - * - * A graphical element in TVG is any object composed into a Canvas. - * Paint represents such a graphical object and its behaviors such as duplication, transformation and composition. - * TVG recommends the user to regard a paint as a set of volatile commands. They can prepare a Paint and then request a Canvas to run them. - */ -class TVG_API Paint -{ -public: - virtual ~Paint(); - - /** - * @brief Sets the angle by which the object is rotated. - * - * The angle in measured clockwise from the horizontal axis. - * The rotational axis passes through the point on the object with zero coordinates. - * - * @param[in] degree The value of the angle in degrees. - * - * @retval Result::Success when succeed, Result::FailedAllocation otherwise. - */ - Result rotate(float degree) noexcept; - - /** - * @brief Sets the scale value of the object. - * - * @param[in] factor The value of the scaling factor. The default value is 1. - * - * @retval Result::Success when succeed, Result::FailedAllocation otherwise. - */ - Result scale(float factor) noexcept; - - /** - * @brief Sets the values by which the object is moved in a two-dimensional space. - * - * The origin of the coordinate system is in the upper left corner of the canvas. - * The horizontal and vertical axes point to the right and down, respectively. - * - * @param[in] x The value of the horizontal shift. - * @param[in] y The value of the vertical shift. - * - * @retval Result::Success when succeed, Result::FailedAllocation otherwise. - */ - Result translate(float x, float y) noexcept; - - /** - * @brief Sets the matrix of the affine transformation for the object. - * - * The augmented matrix of the transformation is expected to be given. - * - * @param[in] m The 3x3 augmented matrix. - * - * @retval Result::Success when succeed, Result::FailedAllocation otherwise. - */ - Result transform(const Matrix& m) noexcept; - - /** - * @brief Gets the matrix of the affine transformation of the object. - * - * The values of the matrix can be set by the transform() API, as well by the translate(), - * scale() and rotate(). In case no transformation was applied, the identity matrix is returned. - * - * @return The augmented transformation matrix. - * - * @since 0.4 - */ - Matrix transform() noexcept; - - /** - * @brief Sets the opacity of the object. - * - * @param[in] o The opacity value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. - * - * @retval Result::Success when succeed. - * - * @note Setting the opacity with this API may require multiple render pass for composition. It is recommended to avoid changing the opacity if possible. - * @note ClipPath won't use the opacity value. (see: enum class CompositeMethod::ClipPath) - */ - Result opacity(uint8_t o) noexcept; - - /** - * @brief Sets the composition target object and the composition method. - * - * @param[in] target The paint of the target object. - * @param[in] method The method used to composite the source object with the target. - * - * @retval Result::Success when succeed, Result::InvalidArguments otherwise. - */ - Result composite(std::unique_ptr target, CompositeMethod method) noexcept; - - /** - * @brief Sets the blending method for the paint object. - * - * The blending feature allows you to combine colors to create visually appealing effects, including transparency, lighting, shading, and color mixing, among others. - * its process involves the combination of colors or images from the source paint object with the destination (the lower layer image) using blending operations. - * The blending operation is determined by the chosen @p BlendMethod, which specifies how the colors or images are combined. - * - * @param[in] method The blending method to be set. - * - * @retval Result::Success when the blending method is successfully set. - * - * @note Experimental API - */ - Result blend(BlendMethod method) const noexcept; - - /** - * @brief Gets the bounding box of the paint object before any transformation. - * - * @param[out] x The x coordinate of the upper left corner of the object. - * @param[out] y The y coordinate of the upper left corner of the object. - * @param[out] w The width of the object. - * @param[out] h The height of the object. - * - * @return Result::Success when succeed, Result::InsufficientCondition otherwise. - * - * @note The bounding box doesn't indicate the final rendered region. It's the smallest rectangle that encloses the object. - * @see Paint::bounds(float* x, float* y, float* w, float* h, bool transformed); - * @deprecated Use bounds(float* x, float* y, float* w, float* h, bool transformed) instead - */ - TVG_DEPRECATED Result bounds(float* x, float* y, float* w, float* h) const noexcept; - - /** - * @brief Gets the axis-aligned bounding box of the paint object. - * - * In case @p transform is @c true, all object's transformations are applied first, and then the bounding box is established. Otherwise, the bounding box is determined before any transformations. - * - * @param[out] x The x coordinate of the upper left corner of the object. - * @param[out] y The y coordinate of the upper left corner of the object. - * @param[out] w The width of the object. - * @param[out] h The height of the object. - * @param[in] transformed If @c true, the paint's transformations are taken into account, otherwise they aren't. - * - * @retval Result::Success when succeed, Result::InsufficientCondition otherwise. - * - * @note The bounding box doesn't indicate the actual drawing region. It's the smallest rectangle that encloses the object. - */ - Result bounds(float* x, float* y, float* w, float* h, bool transformed) const noexcept; - - /** - * @brief Duplicates the object. - * - * Creates a new object and sets its all properties as in the original object. - * - * @return The created object when succeed, @c nullptr otherwise. - */ - Paint* duplicate() const noexcept; - - /** - * @brief Gets the opacity value of the object. - * - * @return The opacity value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. - */ - uint8_t opacity() const noexcept; - - /** - * @brief Gets the composition target object and the composition method. - * - * @param[out] target The paint of the target object. - * - * @return The method used to composite the source object with the target. - * - * @since 0.5 - */ - CompositeMethod composite(const Paint** target) const noexcept; - - /** - * @brief Gets the blending method of the object. - * - * @return The blending method - * - * @note Experimental API - */ - BlendMethod blend() const noexcept; - - /** - * @brief Return the unique id value of the paint instance. - * - * This method can be called for checking the current concrete instance type. - * - * @return The type id of the Paint instance. - */ - uint32_t identifier() const noexcept; - - _TVG_DECLARE_PRIVATE(Paint); -}; - - -/** - * @class Fill - * - * @brief An abstract class representing the gradient fill of the Shape object. - * - * It contains the information about the gradient colors and their arrangement - * inside the gradient bounds. The gradients bounds are defined in the LinearGradient - * or RadialGradient class, depending on the type of the gradient to be used. - * It specifies the gradient behavior in case the area defined by the gradient bounds - * is smaller than the area to be filled. - */ -class TVG_API Fill -{ -public: - /** - * @brief A data structure storing the information about the color and its relative position inside the gradient bounds. - */ - struct ColorStop - { - float offset; /**< The relative position of the color. */ - uint8_t r; /**< The red color channel value in the range [0 ~ 255]. */ - uint8_t g; /**< The green color channel value in the range [0 ~ 255]. */ - uint8_t b; /**< The blue color channel value in the range [0 ~ 255]. */ - uint8_t a; /**< The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. */ - }; - - virtual ~Fill(); - - /** - * @brief Sets the parameters of the colors of the gradient and their position. - * - * @param[in] colorStops An array of ColorStop data structure. - * @param[in] cnt The count of the @p colorStops array equal to the colors number used in the gradient. - * - * @retval Result::Success when succeed. - */ - Result colorStops(const ColorStop* colorStops, uint32_t cnt) noexcept; - - /** - * @brief Sets the FillSpread value, which specifies how to fill the area outside the gradient bounds. - * - * @param[in] s The FillSpread value. - * - * @retval Result::Success when succeed. - */ - Result spread(FillSpread s) noexcept; - - /** - * @brief Sets the matrix of the affine transformation for the gradient fill. - * - * The augmented matrix of the transformation is expected to be given. - * - * @param[in] m The 3x3 augmented matrix. - * - * @retval Result::Success when succeed, Result::FailedAllocation otherwise. - */ - Result transform(const Matrix& m) noexcept; - - /** - * @brief Gets the parameters of the colors of the gradient, their position and number. - * - * @param[out] colorStops A pointer to the memory location, where the array of the gradient's ColorStop is stored. - * - * @return The number of colors used in the gradient. This value corresponds to the length of the @p colorStops array. - */ - uint32_t colorStops(const ColorStop** colorStops) const noexcept; - - /** - * @brief Gets the FillSpread value of the fill. - * - * @return The FillSpread value of this Fill. - */ - FillSpread spread() const noexcept; - - /** - * @brief Gets the matrix of the affine transformation of the gradient fill. - * - * In case no transformation was applied, the identity matrix is returned. - * - * @return The augmented transformation matrix. - */ - Matrix transform() const noexcept; - - /** - * @brief Creates a copy of the Fill object. - * - * Return a newly created Fill object with the properties copied from the original. - * - * @return A copied Fill object when succeed, @c nullptr otherwise. - */ - Fill* duplicate() const noexcept; - - /** - * @brief Return the unique id value of the Fill instance. - * - * This method can be called for checking the current concrete instance type. - * - * @return The type id of the Fill instance. - */ - uint32_t identifier() const noexcept; - - _TVG_DECLARE_PRIVATE(Fill); -}; - - -/** - * @class Canvas - * - * @brief An abstract class for drawing graphical elements. - * - * A canvas is an entity responsible for drawing the target. It sets up the drawing engine and the buffer, which can be drawn on the screen. It also manages given Paint objects. - * - * @note A Canvas behavior depends on the raster engine though the final content of the buffer is expected to be identical. - * @warning The Paint objects belonging to one Canvas can't be shared among multiple Canvases. - */ -class TVG_API Canvas -{ -public: - Canvas(RenderMethod*); - virtual ~Canvas(); - - /** - * @brief Sets the size of the container, where all the paints pushed into the Canvas are stored. - * - * If the number of objects pushed into the Canvas is known in advance, calling the function - * prevents multiple memory reallocation, thus improving the performance. - * - * @param[in] n The number of objects for which the memory is to be reserved. - * - * @return Result::Success when succeed. - */ - TVG_DEPRECATED Result reserve(uint32_t n) noexcept; - - /** - * @brief Returns the list of the paints that currently held by the Canvas. - * - * This function provides the list of paint nodes, allowing users a direct opportunity to modify the scene tree. - * - * @warning Please avoid accessing the paints during Canvas update/draw. You can access them after calling sync(). - * @see Canvas::sync() - * - * @note Experimental API - */ - std::list& paints() noexcept; - - /** - * @brief Passes drawing elements to the Canvas using Paint objects. - * - * Only pushed paints in the canvas will be drawing targets. - * They are retained by the canvas until you call Canvas::clear(). - * - * @param[in] paint A Paint object to be drawn. - * - * @retval Result::Success When succeed. - * @retval Result::MemoryCorruption In case a @c nullptr is passed as the argument. - * @retval Result::InsufficientCondition An internal error. - * - * @note The rendering order of the paints is the same as the order as they were pushed into the canvas. Consider sorting the paints before pushing them if you intend to use layering. - * @see Canvas::paints() - * @see Canvas::clear() - */ - virtual Result push(std::unique_ptr paint) noexcept; - - /** - * @brief Clear the internal canvas resources that used for the drawing. - * - * This API sets the total number of paints pushed into the canvas to zero. - * Depending on the value of the @p free argument, the paints are either freed or retained. - * So if you need to update paint properties while maintaining the existing scene structure, you can set @p free = false. - * - * @param[in] free If @c true, the memory occupied by paints is deallocated, otherwise it is not. - * - * @retval Result::Success when succeed, Result::InsufficientCondition otherwise. - * - * @see Canvas::push() - * @see Canvas::paints() - */ - virtual Result clear(bool free = true) noexcept; - - /** - * @brief Request the canvas to update the paint objects. - * - * If a @c nullptr is passed all paint objects retained by the Canvas are updated, - * otherwise only the paint to which the given @p paint points. - * - * @param[in] paint A pointer to the Paint object or @c nullptr. - * - * @retval Result::Success when succeed, Result::InsufficientCondition otherwise. - * - * @note The Update behavior can be asynchronous if the assigned thread number is greater than zero. - */ - virtual Result update(Paint* paint = nullptr) noexcept; - - /** - * @brief Requests the canvas to draw the Paint objects. - * - * @retval Result::Success when succeed, Result::InsufficientCondition otherwise. - * - * @note Drawing can be asynchronous if the assigned thread number is greater than zero. To guarantee the drawing is done, call sync() afterwards. - * @see Canvas::sync() - */ - virtual Result draw() noexcept; - - /** - * @brief Sets the drawing region in the canvas. - * - * This function defines the rectangular area of the canvas that will be used for drawing operations. - * The specified viewport is used to clip the rendering output to the boundaries of the rectangle. - * - * @param[in] x The x-coordinate of the upper-left corner of the rectangle. - * @param[in] y The y-coordinate of the upper-left corner of the rectangle. - * @param[in] w The width of the rectangle. - * @param[in] h The height of the rectangle. - * - * @retval Result::Success when succeed, Result::InsufficientCondition otherwise. - * - * @see SwCanvas::target() - * @see GlCanvas::target() - * @see WgCanvas::target() - * - * @warning It's not allowed to change the viewport during Canvas::push() - Canvas::sync() or Canvas::update() - Canvas::sync(). - * - * @note When resetting the target, the viewport will also be reset to the target size. - * @note Experimental API - */ - virtual Result viewport(int32_t x, int32_t y, int32_t w, int32_t h) noexcept; - - /** - * @brief Guarantees that drawing task is finished. - * - * The Canvas rendering can be performed asynchronously. To make sure that rendering is finished, - * the sync() must be called after the draw() regardless of threading. - * - * @retval Result::Success when succeed, Result::InsufficientCondition otherwise. - * @see Canvas::draw() - */ - virtual Result sync() noexcept; - - _TVG_DECLARE_PRIVATE(Canvas); -}; - - -/** - * @class LinearGradient - * - * @brief A class representing the linear gradient fill of the Shape object. - * - * Besides the APIs inherited from the Fill class, it enables setting and getting the linear gradient bounds. - * The behavior outside the gradient bounds depends on the value specified in the spread API. - */ -class TVG_API LinearGradient final : public Fill -{ -public: - ~LinearGradient(); - - /** - * @brief Sets the linear gradient bounds. - * - * The bounds of the linear gradient are defined as a surface constrained by two parallel lines crossing - * the given points (@p x1, @p y1) and (@p x2, @p y2), respectively. Both lines are perpendicular to the line linking - * (@p x1, @p y1) and (@p x2, @p y2). - * - * @param[in] x1 The horizontal coordinate of the first point used to determine the gradient bounds. - * @param[in] y1 The vertical coordinate of the first point used to determine the gradient bounds. - * @param[in] x2 The horizontal coordinate of the second point used to determine the gradient bounds. - * @param[in] y2 The vertical coordinate of the second point used to determine the gradient bounds. - * - * @retval Result::Success when succeed. - * - * @note In case the first and the second points are equal, an object filled with such a gradient fill is not rendered. - */ - Result linear(float x1, float y1, float x2, float y2) noexcept; - - /** - * @brief Gets the linear gradient bounds. - * - * The bounds of the linear gradient are defined as a surface constrained by two parallel lines crossing - * the given points (@p x1, @p y1) and (@p x2, @p y2), respectively. Both lines are perpendicular to the line linking - * (@p x1, @p y1) and (@p x2, @p y2). - * - * @param[out] x1 The horizontal coordinate of the first point used to determine the gradient bounds. - * @param[out] y1 The vertical coordinate of the first point used to determine the gradient bounds. - * @param[out] x2 The horizontal coordinate of the second point used to determine the gradient bounds. - * @param[out] y2 The vertical coordinate of the second point used to determine the gradient bounds. - * - * @retval Result::Success when succeed. - */ - Result linear(float* x1, float* y1, float* x2, float* y2) const noexcept; - - /** - * @brief Creates a new LinearGradient object. - * - * @return A new LinearGradient object. - */ - static std::unique_ptr gen() noexcept; - - /** - * @brief Return the unique id value of this class. - * - * This method can be referred for identifying the LinearGradient class type. - * - * @return The type id of the LinearGradient class. - */ - static uint32_t identifier() noexcept; - - _TVG_DECLARE_PRIVATE(LinearGradient); -}; - - -/** - * @class RadialGradient - * - * @brief A class representing the radial gradient fill of the Shape object. - * - */ -class TVG_API RadialGradient final : public Fill -{ -public: - ~RadialGradient(); - - /** - * @brief Sets the radial gradient bounds. - * - * The radial gradient bounds are defined as a circle centered in a given point (@p cx, @p cy) of a given radius. - * - * @param[in] cx The horizontal coordinate of the center of the bounding circle. - * @param[in] cy The vertical coordinate of the center of the bounding circle. - * @param[in] radius The radius of the bounding circle. - * - * @retval Result::Success when succeed, Result::InvalidArguments in case the @p radius value is zero or less. - */ - Result radial(float cx, float cy, float radius) noexcept; - - /** - * @brief Gets the radial gradient bounds. - * - * The radial gradient bounds are defined as a circle centered in a given point (@p cx, @p cy) of a given radius. - * - * @param[out] cx The horizontal coordinate of the center of the bounding circle. - * @param[out] cy The vertical coordinate of the center of the bounding circle. - * @param[out] radius The radius of the bounding circle. - * - * @retval Result::Success when succeed. - */ - Result radial(float* cx, float* cy, float* radius) const noexcept; - - /** - * @brief Creates a new RadialGradient object. - * - * @return A new RadialGradient object. - */ - static std::unique_ptr gen() noexcept; - - /** - * @brief Return the unique id value of this class. - * - * This method can be referred for identifying the RadialGradient class type. - * - * @return The type id of the RadialGradient class. - */ - static uint32_t identifier() noexcept; - - _TVG_DECLARE_PRIVATE(RadialGradient); -}; - - -/** - * @class Shape - * - * @brief A class representing two-dimensional figures and their properties. - * - * A shape has three major properties: shape outline, stroking, filling. The outline in the Shape is retained as the path. - * Path can be composed by accumulating primitive commands such as moveTo(), lineTo(), cubicTo(), or complete shape interfaces such as appendRect(), appendCircle(), etc. - * Path can consists of sub-paths. One sub-path is determined by a close command. - * - * The stroke of Shape is an optional property in case the Shape needs to be represented with/without the outline borders. - * It's efficient since the shape path and the stroking path can be shared with each other. It's also convenient when controlling both in one context. - */ -class TVG_API Shape final : public Paint -{ -public: - ~Shape(); - - /** - * @brief Resets the properties of the shape path. - * - * The transformation matrix, the color, the fill and the stroke properties are retained. - * - * @retval Result::Success when succeed. - * - * @note The memory, where the path data is stored, is not deallocated at this stage for caching effect. - */ - Result reset() noexcept; - - /** - * @brief Sets the initial point of the sub-path. - * - * The value of the current point is set to the given point. - * - * @param[in] x The horizontal coordinate of the initial point of the sub-path. - * @param[in] y The vertical coordinate of the initial point of the sub-path. - * - * @retval Result::Success when succeed. - */ - Result moveTo(float x, float y) noexcept; - - /** - * @brief Adds a new point to the sub-path, which results in drawing a line from the current point to the given end-point. - * - * The value of the current point is set to the given end-point. - * - * @param[in] x The horizontal coordinate of the end-point of the line. - * @param[in] y The vertical coordinate of the end-point of the line. - * - * @retval Result::Success when succeed. - * - * @note In case this is the first command in the path, it corresponds to the moveTo() call. - */ - Result lineTo(float x, float y) noexcept; - - /** - * @brief Adds new points to the sub-path, which results in drawing a cubic Bezier curve starting - * at the current point and ending at the given end-point (@p x, @p y) using the control points (@p cx1, @p cy1) and (@p cx2, @p cy2). - * - * The value of the current point is set to the given end-point. - * - * @param[in] cx1 The horizontal coordinate of the 1st control point. - * @param[in] cy1 The vertical coordinate of the 1st control point. - * @param[in] cx2 The horizontal coordinate of the 2nd control point. - * @param[in] cy2 The vertical coordinate of the 2nd control point. - * @param[in] x The horizontal coordinate of the end-point of the curve. - * @param[in] y The vertical coordinate of the end-point of the curve. - * - * @retval Result::Success when succeed. - * - * @note In case this is the first command in the path, no data from the path are rendered. - */ - Result cubicTo(float cx1, float cy1, float cx2, float cy2, float x, float y) noexcept; - - /** - * @brief Closes the current sub-path by drawing a line from the current point to the initial point of the sub-path. - * - * The value of the current point is set to the initial point of the closed sub-path. - * - * @retval Result::Success when succeed. - * - * @note In case the sub-path does not contain any points, this function has no effect. - */ - Result close() noexcept; - - /** - * @brief Appends a rectangle to the path. - * - * The rectangle with rounded corners can be achieved by setting non-zero values to @p rx and @p ry arguments. - * The @p rx and @p ry values specify the radii of the ellipse defining the rounding of the corners. - * - * The position of the rectangle is specified by the coordinates of its upper left corner - @p x and @p y arguments. - * - * The rectangle is treated as a new sub-path - it is not connected with the previous sub-path. - * - * The value of the current point is set to (@p x + @p rx, @p y) - in case @p rx is greater - * than @p w/2 the current point is set to (@p x + @p w/2, @p y) - * - * @param[in] x The horizontal coordinate of the upper left corner of the rectangle. - * @param[in] y The vertical coordinate of the upper left corner of the rectangle. - * @param[in] w The width of the rectangle. - * @param[in] h The height of the rectangle. - * @param[in] rx The x-axis radius of the ellipse defining the rounded corners of the rectangle. - * @param[in] ry The y-axis radius of the ellipse defining the rounded corners of the rectangle. - * - * @retval Result::Success when succeed. - * - * @note For @p rx and @p ry greater than or equal to the half of @p w and the half of @p h, respectively, the shape become an ellipse. - */ - Result appendRect(float x, float y, float w, float h, float rx = 0, float ry = 0) noexcept; - - /** - * @brief Appends an ellipse to the path. - * - * The position of the ellipse is specified by the coordinates of its center - @p cx and @p cy arguments. - * - * The ellipse is treated as a new sub-path - it is not connected with the previous sub-path. - * - * The value of the current point is set to (@p cx, @p cy - @p ry). - * - * @param[in] cx The horizontal coordinate of the center of the ellipse. - * @param[in] cy The vertical coordinate of the center of the ellipse. - * @param[in] rx The x-axis radius of the ellipse. - * @param[in] ry The y-axis radius of the ellipse. - * - * @retval Result::Success when succeed. - */ - Result appendCircle(float cx, float cy, float rx, float ry) noexcept; - - /** - * @brief Appends a circular arc to the path. - * - * The arc is treated as a new sub-path - it is not connected with the previous sub-path. - * The current point value is set to the end-point of the arc in case @p pie is @c false, and to the center of the arc otherwise. - * - * @param[in] cx The horizontal coordinate of the center of the arc. - * @param[in] cy The vertical coordinate of the center of the arc. - * @param[in] radius The radius of the arc. - * @param[in] startAngle The start angle of the arc given in degrees, measured counter-clockwise from the horizontal line. - * @param[in] sweep The central angle of the arc given in degrees, measured counter-clockwise from @p startAngle. - * @param[in] pie Specifies whether to draw radii from the arc's center to both of its end-point - drawn if @c true. - * - * @retval Result::Success when succeed. - * - * @note Setting @p sweep value greater than 360 degrees, is equivalent to calling appendCircle(cx, cy, radius, radius). - */ - Result appendArc(float cx, float cy, float radius, float startAngle, float sweep, bool pie) noexcept; - - /** - * @brief Appends a given sub-path to the path. - * - * The current point value is set to the last point from the sub-path. - * For each command from the @p cmds array, an appropriate number of points in @p pts array should be specified. - * If the number of points in the @p pts array is different than the number required by the @p cmds array, the shape with this sub-path will not be displayed on the screen. - * - * @param[in] cmds The array of the commands in the sub-path. - * @param[in] cmdCnt The number of the sub-path's commands. - * @param[in] pts The array of the two-dimensional points. - * @param[in] ptsCnt The number of the points in the @p pts array. - * - * @retval Result::Success when succeed, Result::InvalidArguments otherwise. - * - * @note The interface is designed for optimal path setting if the caller has a completed path commands already. - */ - Result appendPath(const PathCommand* cmds, uint32_t cmdCnt, const Point* pts, uint32_t ptsCnt) noexcept; - - /** - * @brief Sets the stroke width for all of the figures from the path. - * - * @param[in] width The width of the stroke. The default value is 0. - * - * @retval Result::Success when succeed, Result::FailedAllocation otherwise. - */ - Result stroke(float width) noexcept; - - /** - * @brief Sets the color of the stroke for all of the figures from the path. - * - * @param[in] r The red color channel value in the range [0 ~ 255]. The default value is 0. - * @param[in] g The green color channel value in the range [0 ~ 255]. The default value is 0. - * @param[in] b The blue color channel value in the range [0 ~ 255]. The default value is 0. - * @param[in] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. The default value is 0. - * - * @retval Result::Success when succeed, Result::FailedAllocation otherwise. - */ - Result stroke(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255) noexcept; - - /** - * @brief Sets the gradient fill of the stroke for all of the figures from the path. - * - * @param[in] f The gradient fill. - * - * @retval Result::Success When succeed. - * @retval Result::FailedAllocation An internal error with a memory allocation for an object to be filled. - * @retval Result::MemoryCorruption In case a @c nullptr is passed as the argument. - */ - Result stroke(std::unique_ptr f) noexcept; - - /** - * @brief Sets the dash pattern of the stroke. - * - * @param[in] dashPattern The array of consecutive pair values of the dash length and the gap length. - * @param[in] cnt The length of the @p dashPattern array. - * - * @retval Result::Success When succeed. - * @retval Result::FailedAllocation An internal error with a memory allocation for an object to be dashed. - * @retval Result::InvalidArguments In case @p dashPattern is @c nullptr and @p cnt > 0, @p cnt is zero, any of the dash pattern values is zero or less. - * - * @note To reset the stroke dash pattern, pass @c nullptr to @p dashPattern and zero to @p cnt. - * @warning @p cnt must be greater than 1 if the dash pattern is valid. - */ - Result stroke(const float* dashPattern, uint32_t cnt) noexcept; - - /** - * @brief Sets the cap style of the stroke in the open sub-paths. - * - * @param[in] cap The cap style value. The default value is @c StrokeCap::Square. - * - * @retval Result::Success when succeed, Result::FailedAllocation otherwise. - */ - Result stroke(StrokeCap cap) noexcept; - - /** - * @brief Sets the join style for stroked path segments. - * - * The join style is used for joining the two line segment while stroking the path. - * - * @param[in] join The join style value. The default value is @c StrokeJoin::Bevel. - * - * @retval Result::Success when succeed, Result::FailedAllocation otherwise. - */ - Result stroke(StrokeJoin join) noexcept; - - - /** - * @brief Sets the stroke miterlimit. - * - * @param[in] miterlimit The miterlimit imposes a limit on the extent of the stroke join, when the @c StrokeJoin::Miter join style is set. The default value is 4. - * - * @retval Result::Success when succeed, Result::NonSupport unsupported value, Result::FailedAllocation otherwise. - * - * @since 0.11 - */ - Result strokeMiterlimit(float miterlimit) noexcept; - - /** - * @brief Sets the solid color for all of the figures from the path. - * - * The parts of the shape defined as inner are colored. - * - * @param[in] r The red color channel value in the range [0 ~ 255]. The default value is 0. - * @param[in] g The green color channel value in the range [0 ~ 255]. The default value is 0. - * @param[in] b The blue color channel value in the range [0 ~ 255]. The default value is 0. - * @param[in] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. The default value is 0. - * - * @retval Result::Success when succeed. - * - * @note Either a solid color or a gradient fill is applied, depending on what was set as last. - * @note ClipPath won't use the fill values. (see: enum class CompositeMethod::ClipPath) - */ - Result fill(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255) noexcept; - - /** - * @brief Sets the gradient fill for all of the figures from the path. - * - * The parts of the shape defined as inner are filled. - * - * @param[in] f The unique pointer to the gradient fill. - * - * @retval Result::Success when succeed, Result::MemoryCorruption otherwise. - * - * @note Either a solid color or a gradient fill is applied, depending on what was set as last. - */ - Result fill(std::unique_ptr f) noexcept; - - /** - * @brief Sets the fill rule for the Shape object. - * - * @param[in] r The fill rule value. The default value is @c FillRule::Winding. - * - * @retval Result::Success when succeed. - */ - Result fill(FillRule r) noexcept; - - - /** - * @brief Sets the rendering order of the stroke and the fill. - * - * @param[in] strokeFirst If @c true the stroke is rendered before the fill, otherwise the stroke is rendered as the second one (the default option). - * - * @retval Result::Success when succeed, Result::FailedAllocation otherwise. - * - * @since 0.10 - */ - Result order(bool strokeFirst) noexcept; - - - /** - * @brief Gets the commands data of the path. - * - * @param[out] cmds The pointer to the array of the commands from the path. - * - * @return The length of the @p cmds array when succeed, zero otherwise. - */ - uint32_t pathCommands(const PathCommand** cmds) const noexcept; - - /** - * @brief Gets the points values of the path. - * - * @param[out] pts The pointer to the array of the two-dimensional points from the path. - * - * @return The length of the @p pts array when succeed, zero otherwise. - */ - uint32_t pathCoords(const Point** pts) const noexcept; - - /** - * @brief Gets the pointer to the gradient fill of the shape. - * - * @return The pointer to the gradient fill of the stroke when succeed, @c nullptr in case no fill was set. - */ - const Fill* fill() const noexcept; - - /** - * @brief Gets the solid color of the shape. - * - * @param[out] r The red color channel value in the range [0 ~ 255]. - * @param[out] g The green color channel value in the range [0 ~ 255]. - * @param[out] b The blue color channel value in the range [0 ~ 255]. - * @param[out] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. - * - * @return Result::Success when succeed. - */ - Result fillColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a = nullptr) const noexcept; - - /** - * @brief Gets the fill rule value. - * - * @return The fill rule value of the shape. - */ - FillRule fillRule() const noexcept; - - /** - * @brief Gets the stroke width. - * - * @return The stroke width value when succeed, zero if no stroke was set. - */ - float strokeWidth() const noexcept; - - /** - * @brief Gets the color of the shape's stroke. - * - * @param[out] r The red color channel value in the range [0 ~ 255]. - * @param[out] g The green color channel value in the range [0 ~ 255]. - * @param[out] b The blue color channel value in the range [0 ~ 255]. - * @param[out] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. - * - * @retval Result::Success when succeed, Result::InsufficientCondition otherwise. - */ - Result strokeColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a = nullptr) const noexcept; - - /** - * @brief Gets the pointer to the gradient fill of the stroke. - * - * @return The pointer to the gradient fill of the stroke when succeed, @c nullptr otherwise. - */ - const Fill* strokeFill() const noexcept; - - /** - * @brief Gets the dash pattern of the stroke. - * - * @param[out] dashPattern The pointer to the memory, where the dash pattern array is stored. - * - * @return The length of the @p dashPattern array. - */ - uint32_t strokeDash(const float** dashPattern) const noexcept; - - /** - * @brief Gets the cap style used for stroking the path. - * - * @return The cap style value of the stroke. - */ - StrokeCap strokeCap() const noexcept; - - /** - * @brief Gets the join style value used for stroking the path. - * - * @return The join style value of the stroke. - */ - StrokeJoin strokeJoin() const noexcept; - - /** - * @brief Gets the stroke miterlimit. - * - * @return The stroke miterlimit value when succeed, 4 if no stroke was set. - * - * @since 0.11 - */ - float strokeMiterlimit() const noexcept; - - /** - * @brief Creates a new Shape object. - * - * @return A new Shape object. - */ - static std::unique_ptr gen() noexcept; - - /** - * @brief Return the unique id value of this class. - * - * This method can be referred for identifying the Shape class type. - * - * @return The type id of the Shape class. - */ - static uint32_t identifier() noexcept; - - _TVG_DECLARE_PRIVATE(Shape); -}; - - -/** - * @class Picture - * - * @brief A class representing an image read in one of the supported formats: raw, svg, png, jpg, lottie(json) and etc. - * Besides the methods inherited from the Paint, it provides methods to load & draw images on the canvas. - * - * @note Supported formats are depended on the available TVG loaders. - * @note See Animation class if the picture data is animatable. - */ -class TVG_API Picture final : public Paint -{ -public: - ~Picture(); - - /** - * @brief Loads a picture data directly from a file. - * - * ThorVG efficiently caches the loaded data using the specified @p path as a key. - * This means that loading the same file again will not result in duplicate operations; - * instead, ThorVG will reuse the previously loaded picture data. - * - * @param[in] path A path to the picture file. - * - * @retval Result::Success When succeed. - * @retval Result::InvalidArguments In case the @p path is invalid. - * @retval Result::NonSupport When trying to load a file with an unknown extension. - * @retval Result::Unknown If an error occurs at a later stage. - * - * @note The Load behavior can be asynchronous if the assigned thread number is greater than zero. - * @see Initializer::init() - */ - Result load(const std::string& path) noexcept; - - /** - * @brief Loads a picture data from a memory block of a given size. - * - * ThorVG efficiently caches the loaded data using the specified @p data address as a key - * when the @p copy has @c false. This means that loading the same data again will not result in duplicate operations - * for the sharable @p data. Instead, ThorVG will reuse the previously loaded picture data. - * - * @param[in] data A pointer to a memory location where the content of the picture file is stored. - * @param[in] size The size in bytes of the memory occupied by the @p data. - * @param[in] copy Decides whether the data should be copied into the engine local buffer. - * - * @retval Result::Success When succeed. - * @retval Result::InvalidArguments In case no data are provided or the @p size is zero or less. - * @retval Result::NonSupport When trying to load a file with an unknown extension. - * @retval Result::Unknown If an error occurs at a later stage. - * - * @warning: you have responsibility to release the @p data memory if the @p copy is true - * @deprecated Use load(const char* data, uint32_t size, const std::string& mimeType, bool copy) instead. - * @see Result load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false) noexcept - */ - TVG_DEPRECATED Result load(const char* data, uint32_t size, bool copy = false) noexcept; - - /** - * @brief Loads a picture data from a memory block of a given size. - * - * @param[in] data A pointer to a memory location where the content of the picture file is stored. - * @param[in] size The size in bytes of the memory occupied by the @p data. - * @param[in] mimeType Mimetype or extension of data such as "jpg", "jpeg", "lottie", "svg", "svg+xml", "png", etc. In case an empty string or an unknown type is provided, the loaders will be tried one by one. - * @param[in] copy If @c true the data are copied into the engine local buffer, otherwise they are not. - * - * @retval Result::Success When succeed. - * @retval Result::InvalidArguments In case no data are provided or the @p size is zero or less. - * @retval Result::NonSupport When trying to load a file with an unknown extension. - * @retval Result::Unknown If an error occurs at a later stage. - * - * @warning: It's the user responsibility to release the @p data memory if the @p copy is @c true. - * - * @note If you are unsure about the MIME type, you can provide an empty value like @c "", and thorvg will attempt to figure it out. - * @since 0.5 - */ - Result load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false) noexcept; - - /** - * @brief Resizes the picture content to the given width and height. - * - * The picture content is resized while keeping the default size aspect ratio. - * The scaling factor is established for each of dimensions and the smaller value is applied to both of them. - * - * @param[in] w A new width of the image in pixels. - * @param[in] h A new height of the image in pixels. - * - * @retval Result::Success when succeed, Result::InsufficientCondition otherwise. - */ - Result size(float w, float h) noexcept; - - /** - * @brief Gets the size of the image. - * - * @param[out] w The width of the image in pixels. - * @param[out] h The height of the image in pixels. - * - * @retval Result::Success when succeed. - */ - Result size(float* w, float* h) const noexcept; - - /** - * @brief Loads a raw data from a memory block with a given size. - * - * ThorVG efficiently caches the loaded data using the specified @p data address as a key - * when the @p copy has @c false. This means that loading the same data again will not result in duplicate operations - * for the sharable @p data. Instead, ThorVG will reuse the previously loaded picture data. - * - * @param[in] paint A Tvg_Paint pointer to the picture object. - * @param[in] data A pointer to a memory location where the content of the picture raw data is stored. - * @param[in] w The width of the image @p data in pixels. - * @param[in] h The height of the image @p data in pixels. - * @param[in] premultiplied If @c true, the given image data is alpha-premultiplied. - * @param[in] copy If @c true the data are copied into the engine local buffer, otherwise they are not. - * - * @retval Result::Success When succeed, Result::InsufficientCondition otherwise. - * @retval Result::FailedAllocation An internal error possibly with memory allocation. - * - * @since 0.9 - */ - Result load(uint32_t* data, uint32_t w, uint32_t h, bool copy) noexcept; - - /** - * @brief Sets or removes the triangle mesh to deform the image. - * - * If a mesh is provided, the transform property of the Picture will apply to the triangle mesh, and the - * image data will be used as the texture. - * - * If @p triangles is @c nullptr, or @p triangleCnt is 0, the mesh will be removed. - * - * Only raster image types are supported at this time (png, jpg). Vector types like svg and tvg do not support. - * mesh deformation. However, if required you should be able to render a vector image to a raster image and then apply a mesh. - * - * @param[in] triangles An array of Polygons(triangles) that make up the mesh, or null to remove the mesh. - * @param[in] triangleCnt The number of Polygons(triangles) provided, or 0 to remove the mesh. - * - * @retval Result::Success When succeed. - * @retval Result::Unknown If fails - * - * @note The Polygons are copied internally, so modifying them after calling Mesh::mesh has no affect. - * @warning Please do not use it, this API is not official one. It could be modified in the next version. - * - * @note Experimental API - */ - Result mesh(const Polygon* triangles, uint32_t triangleCnt) noexcept; - - /** - * @brief Return the number of triangles in the mesh, and optionally get a pointer to the array of triangles in the mesh. - * - * @param[out] triangles Optional. A pointer to the array of Polygons used by this mesh. - * - * @return The number of polygons in the array. - * - * @note Modifying the triangles returned by this method will modify them directly within the mesh. - * @warning Please do not use it, this API is not official one. It could be modified in the next version. - * - * @note Experimental API - */ - uint32_t mesh(const Polygon** triangles) const noexcept; - - /** - * @brief Creates a new Picture object. - * - * @return A new Picture object. - */ - static std::unique_ptr gen() noexcept; - - /** - * @brief Return the unique id value of this class. - * - * This method can be referred for identifying the Picture class type. - * - * @return The type id of the Picture class. - */ - static uint32_t identifier() noexcept; - - _TVG_DECLARE_ACCESSOR(Animation); - _TVG_DECLARE_PRIVATE(Picture); -}; - - -/** - * @class Scene - * - * @brief A class to composite children paints. - * - * As the traditional graphics rendering method, TVG also enables scene-graph mechanism. - * This feature supports an array function for managing the multiple paints as one group paint. - * - * As a group, the scene can be transformed, made translucent and composited with other target paints, - * its children will be affected by the scene world. - */ -class TVG_API Scene final : public Paint -{ -public: - ~Scene(); - - /** - * @brief Passes drawing elements to the Scene using Paint objects. - * - * Only the paints pushed into the scene will be the drawn targets. - * The paints are retained by the scene until Scene::clear() is called. - * - * @param[in] paint A Paint object to be drawn. - * - * @retval Result::Success when succeed, Result::MemoryCorruption otherwise. - * - * @note The rendering order of the paints is the same as the order as they were pushed. Consider sorting the paints before pushing them if you intend to use layering. - * @see Scene::paints() - * @see Scene::clear() - */ - Result push(std::unique_ptr paint) noexcept; - - /** - * @brief Sets the size of the container, where all the paints pushed into the Scene are stored. - * - * If the number of objects pushed into the scene is known in advance, calling the function - * prevents multiple memory reallocation, thus improving the performance. - * - * @param[in] size The number of objects for which the memory is to be reserved. - * - * @return Result::Success when succeed, Result::FailedAllocation otherwise. - */ - TVG_DEPRECATED Result reserve(uint32_t size) noexcept; - - /** - * @brief Returns the list of the paints that currently held by the Scene. - * - * This function provides the list of paint nodes, allowing users a direct opportunity to modify the scene tree. - * - * @warning Please avoid accessing the paints during Scene update/draw. You can access them after calling Canvas::sync(). - * @see Canvas::sync() - * @see Scene::push() - * @see Scene::clear() - * - * @note Experimental API - */ - std::list& paints() noexcept; - - /** - * @brief Sets the total number of the paints pushed into the scene to be zero. - * Depending on the value of the @p free argument, the paints are freed or not. - * - * @param[in] free If @c true, the memory occupied by paints is deallocated, otherwise it is not. - * - * @retval Result::Success when succeed - * - * @warning If you don't free the paints they become dangled. They are supposed to be reused, otherwise you are responsible for their lives. Thus please use the @p free argument only when you know how it works, otherwise it's not recommended. - * - * @since 0.2 - */ - Result clear(bool free = true) noexcept; - - /** - * @brief Creates a new Scene object. - * - * @return A new Scene object. - */ - static std::unique_ptr gen() noexcept; - - /** - * @brief Return the unique id value of this class. - * - * This method can be referred for identifying the Scene class type. - * - * @return The type id of the Scene class. - */ - static uint32_t identifier() noexcept; - - _TVG_DECLARE_PRIVATE(Scene); -}; - - -/** - * @class Text - * - * @brief A class to represent text objects in a graphical context, allowing for rendering and manipulation of unicode text. - * - * @note Experimental API - */ -class TVG_API Text final : public Paint -{ -public: - ~Text(); - - /** - * @brief Sets the font properties for the text. - * - * This function allows you to define the font characteristics used for text rendering. - * It sets the font name, size and optionally the style. - * - * @param[in] name The name of the font. This should correspond to a font available in the canvas. - * @param[in] size The size of the font in points. This determines how large the text will appear. - * @param[in] style The style of the font. It can be used to set the font to 'italic'. - * If not specified, the default style is used. Only 'italic' style is supported currently. - * - * @retval Result::Success when the font properties are set successfully. - * @retval Result::InsufficientCondition when the specified @p name cannot be found. - * - * @note Experimental API - */ - Result font(const char* name, float size, const char* style = nullptr) noexcept; - - /** - * @brief Assigns the given unicode text to be rendered. - * - * This function sets the unicode string that will be displayed by the rendering system. - * The text is set according to the specified UTF encoding method, which defaults to UTF-8. - * - * @param[in] text The multi-byte text encoded with utf8 string to be rendered. - * - * @retval Result::Success when succeed. - * - * @note Experimental API - */ - Result text(const char* text) noexcept; - - /** - * @brief Sets the text color. - * - * @param[in] r The red color channel value in the range [0 ~ 255]. The default value is 0. - * @param[in] g The green color channel value in the range [0 ~ 255]. The default value is 0. - * @param[in] b The blue color channel value in the range [0 ~ 255]. The default value is 0. - * - * @retval Result::Success when succeed. - * @retval Result::InsufficientCondition when the font has not been set up prior to this operation. - * - * @see Text::font() - * - * @note Experimental API - */ - Result fill(uint8_t r, uint8_t g, uint8_t b) noexcept; - - /** - * @brief Sets the gradient fill for all of the figures from the text. - * - * The parts of the text defined as inner are filled. - * - * @param[in] f The unique pointer to the gradient fill. - * - * @retval Result::Success when succeed, Result::MemoryCorruption otherwise. - * @retval Result::InsufficientCondition when the font has not been set up prior to this operation. - * - * @note Either a solid color or a gradient fill is applied, depending on what was set as last. - * @note Experimental API - * - * @see Text::font() - */ - Result fill(std::unique_ptr f) noexcept; - - /** - * @brief Loads a scalable font data(ttf) from a file. - * - * ThorVG efficiently caches the loaded data using the specified @p path as a key. - * This means that loading the same file again will not result in duplicate operations; - * instead, ThorVG will reuse the previously loaded font data. - * - * @param[in] path The path to the font file. - * - * @retval Result::Success When succeed. - * @retval Result::InvalidArguments In case the @p path is invalid. - * @retval Result::NonSupport When trying to load a file with an unknown extension. - * @retval Result::Unknown If an error occurs at a later stage. - * - * @note Experimental API - * - * @see Text::unload(const std::string& path) - */ - static Result load(const std::string& path) noexcept; - - /** - * @brief Unloads the specified scalable font data (TTF) that was previously loaded. - * - * This function is used to release resources associated with a font file that has been loaded into memory. - * - * @param[in] path The file path of the loaded font. - * - * @retval Result::Success Successfully unloads the font data. - * @retval Result::InsufficientCondition Fails if the loader is not initialized. - * - * @note If the font data is currently in use, it will not be immediately unloaded. - * @note Experimental API - * - * @see Text::load(const std::string& path) - */ - static Result unload(const std::string& path) noexcept; - - /** - * @brief Creates a new Text object. - * - * @return A new Text object. - * - * @note Experimental API - */ - static std::unique_ptr gen() noexcept; - - /** - * @brief Return the unique id value of this class. - * - * This method can be referred for identifying the Text class type. - * - * @return The type id of the Text class. - */ - static uint32_t identifier() noexcept; - - _TVG_DECLARE_PRIVATE(Text); -}; - - -/** - * @class SwCanvas - * - * @brief A class for the rendering graphical elements with a software raster engine. - */ -class TVG_API SwCanvas final : public Canvas -{ -public: - ~SwCanvas(); - - /** - * @brief Enumeration specifying the methods of combining the 8-bit color channels into 32-bit color. - */ - enum Colorspace - { - ABGR8888 = 0, ///< The channels are joined in the order: alpha, blue, green, red. Colors are alpha-premultiplied. (a << 24 | b << 16 | g << 8 | r) - ARGB8888, ///< The channels are joined in the order: alpha, red, green, blue. Colors are alpha-premultiplied. (a << 24 | r << 16 | g << 8 | b) - ABGR8888S, ///< The channels are joined in the order: alpha, blue, green, red. Colors are un-alpha-premultiplied. @since 0.12 - ARGB8888S, ///< The channels are joined in the order: alpha, red, green, blue. Colors are un-alpha-premultiplied. @since 0.12 - }; - - /** - * @brief Enumeration specifying the methods of Memory Pool behavior policy. - * @since 0.4 - */ - enum MempoolPolicy - { - Default = 0, ///< Default behavior that ThorVG is designed to. - Shareable, ///< Memory Pool is shared among the SwCanvases. - Individual ///< Allocate designated memory pool that is only used by current instance. - }; - - /** - * @brief Sets the drawing target for the rasterization. - * - * The buffer of a desirable size should be allocated and owned by the caller. - * - * @param[in] buffer A pointer to a memory block of the size @p stride x @p h, where the raster data are stored. - * @param[in] stride The stride of the raster image - greater than or equal to @p w. - * @param[in] w The width of the raster image. - * @param[in] h The height of the raster image. - * @param[in] cs The value specifying the way the 32-bits colors should be read/written. - * - * @retval Result::Success When succeed. - * @retval Result::MemoryCorruption When casting in the internal function implementation failed. - * @retval Result::InvalidArguments In case no valid pointer is provided or the width, or the height or the stride is zero. - * @retval Result::NonSupport In case the software engine is not supported. - * - * @warning Do not access @p buffer during Canvas::push() - Canvas::sync(). It should not be accessed while the engine is writing on it. - * - * @see Canvas::viewport() - */ - Result target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, Colorspace cs) noexcept; - - /** - * @brief Set sw engine memory pool behavior policy. - * - * Basically ThorVG draws a lot of shapes, it allocates/deallocates a few chunk of memory - * while processing rendering. It internally uses one shared memory pool - * which can be reused among the canvases in order to avoid memory overhead. - * - * Thus ThorVG suggests using a memory pool policy to satisfy user demands, - * if it needs to guarantee the thread-safety of the internal data access. - * - * @param[in] policy The method specifying the Memory Pool behavior. The default value is @c MempoolPolicy::Default. - * - * @retval Result::Success When succeed. - * @retval Result::InsufficientCondition If the canvas contains some paints already. - * @retval Result::NonSupport In case the software engine is not supported. - * - * @note When @c policy is set as @c MempoolPolicy::Individual, the current instance of canvas uses its own individual - * memory data, which is not shared with others. This is necessary when the canvas is accessed on a worker-thread. - * - * @warning It's not allowed after pushing any paints. - * - * @since 0.4 - */ - Result mempool(MempoolPolicy policy) noexcept; - - /** - * @brief Creates a new SwCanvas object. - * @return A new SwCanvas object. - */ - static std::unique_ptr gen() noexcept; - - _TVG_DECLARE_PRIVATE(SwCanvas); -}; - - -/** - * @class GlCanvas - * - * @brief A class for the rendering graphic elements with a GL raster engine. - * - * @warning Please do not use it. This class is not fully supported yet. - * - * @note Experimental API - */ -class TVG_API GlCanvas final : public Canvas -{ -public: - ~GlCanvas(); - - /** - * @brief Sets the drawing target for rasterization. - * - * This function specifies the drawing target where the rasterization will occur. It can target - * a specific framebuffer object (FBO) or the main surface. - * - * @param[in] id The GL target ID, usually indicating the FBO ID. A value of @c 0 specifies the main surface. - * @param[in] w The width (in pixels) of the raster image. - * @param[in] h The height (in pixels) of the raster image. - * - * @warning This API is experimental and not officially supported. It may be modified or removed in future versions. - * @warning Drawing on the main surface is currently not permitted. If the identifier (@p id) is set to @c 0, the operation will be aborted. - * - * @see Canvas::viewport() - * - * @note Currently, this only allows the GL_RGBA8 color space format. - * @note Experimental API - */ - Result target(int32_t id, uint32_t w, uint32_t h) noexcept; - - /** - * @brief Creates a new GlCanvas object. - * - * @return A new GlCanvas object. - * - * @note Experimental API - */ - static std::unique_ptr gen() noexcept; - - _TVG_DECLARE_PRIVATE(GlCanvas); -}; - - -/** - * @class WgCanvas - * - * @brief A class for the rendering graphic elements with a WebGPU raster engine. - * - * @warning Please do not use it. This class is not fully supported yet. - * - * @note Experimental API - */ -class TVG_API WgCanvas final : public Canvas -{ -public: - ~WgCanvas(); - - /** - * @brief Sets the target window for the rasterization. - * - * @warning Please do not use it, this API is not official one. It could be modified in the next version. - * - * @note Experimental API - * @see Canvas::viewport() - */ - Result target(void* window, uint32_t w, uint32_t h) noexcept; - - /** - * @brief Creates a new WgCanvas object. - * - * @return A new WgCanvas object. - * - * @note Experimental API - */ - static std::unique_ptr gen() noexcept; - - _TVG_DECLARE_PRIVATE(WgCanvas); -}; - - -/** - * @class Initializer - * - * @brief A class that enables initialization and termination of the TVG engines. - */ -class TVG_API Initializer final -{ -public: - /** - * @brief Initializes TVG engines. - * - * TVG requires the running-engine environment. - * TVG runs its own task-scheduler for parallelizing rendering tasks efficiently. - * You can indicate the number of threads, the count of which is designated @p threads. - * In the initialization step, TVG will generate/spawn the threads as set by @p threads count. - * - * @param[in] engine The engine types to initialize. This is relative to the Canvas types, in which it will be used. For multiple backends bitwise operation is allowed. - * @param[in] threads The number of additional threads. Zero indicates only the main thread is to be used. - * - * @retval Result::Success When succeed. - * @retval Result::FailedAllocation An internal error possibly with memory allocation. - * @retval Result::InvalidArguments If unknown engine type chosen. - * @retval Result::NonSupport In case the engine type is not supported on the system. - * @retval Result::Unknown Others. - * - * @note The Initializer keeps track of the number of times it was called. Threads count is fixed at the first init() call. - * @see Initializer::term() - */ - static Result init(CanvasEngine engine, uint32_t threads) noexcept; - - /** - * @brief Terminates TVG engines. - * - * @param[in] engine The engine types to terminate. This is relative to the Canvas types, in which it will be used. For multiple backends bitwise operation is allowed - * - * @retval Result::Success When succeed. - * @retval Result::InsufficientCondition In case there is nothing to be terminated. - * @retval Result::InvalidArguments If unknown engine type chosen. - * @retval Result::NonSupport In case the engine type is not supported on the system. - * @retval Result::Unknown Others. - * - * @note Initializer does own reference counting for multiple calls. - * @see Initializer::init() - */ - static Result term(CanvasEngine engine) noexcept; - - _TVG_DISABLE_CTOR(Initializer); -}; - - -/** - * @class Animation - * - * @brief The Animation class enables manipulation of animatable images. - * - * This class supports the display and control of animation frames. - * - * @since 0.13 - */ - -class TVG_API Animation -{ -public: - ~Animation(); - - /** - * @brief Specifies the current frame in the animation. - * - * @param[in] no The index of the animation frame to be displayed. The index should be less than the totalFrame(). - * - * @retval Result::Success Successfully set the frame. - * @retval Result::InsufficientCondition if the given @p no is the same as the current frame value. - * @retval Result::NonSupport The current Picture data does not support animations. - * - * @note For efficiency, ThorVG ignores updates to the new frame value if the difference from the current frame value - * is less than 0.001. In such cases, it returns @c Result::InsufficientCondition. - * Values less than 0.001 may be disregarded and may not be accurately retained by the Animation. - * - * @see totalFrame() - * - */ - Result frame(float no) noexcept; - - /** - * @brief Retrieves a picture instance associated with this animation instance. - * - * This function provides access to the picture instance that can be used to load animation formats, such as Lottie(json). - * After setting up the picture, it can be pushed to the designated canvas, enabling control over animation frames - * with this Animation instance. - * - * @return A picture instance that is tied to this animation. - * - * @warning The picture instance is owned by Animation. It should not be deleted manually. - * - */ - Picture* picture() const noexcept; - - /** - * @brief Retrieves the current frame number of the animation. - * - * @return The current frame number of the animation, between 0 and totalFrame() - 1. - * - * @note If the Picture is not properly configured, this function will return 0. - * - * @see Animation::frame(float no) - * @see Animation::totalFrame() - * - */ - float curFrame() const noexcept; - - /** - * @brief Retrieves the total number of frames in the animation. - * - * @return The total number of frames in the animation. - * - * @note Frame numbering starts from 0. - * @note If the Picture is not properly configured, this function will return 0. - * - */ - float totalFrame() const noexcept; - - /** - * @brief Retrieves the duration of the animation in seconds. - * - * @return The duration of the animation in seconds. - * - * @note If the Picture is not properly configured, this function will return 0. - * - */ - float duration() const noexcept; - - /** - * @brief Specifies the playback segment of the animation. - * - * The set segment is designated as the play area of the animation. - * This is useful for playing a specific segment within the entire animation. - * After setting, the number of animation frames and the playback time are calculated - * by mapping the playback segment as the entire range. - * - * @param[in] begin segment start. - * @param[in] end segment end. - * - * @retval Result::Success When succeed. - * @retval Result::InsufficientCondition In case the animation is not loaded. - * @retval Result::InvalidArguments When the given parameter is invalid. - * @retval Result::NonSupport When it's not animatable. - * - * @note Range from 0.0~1.0 - * @note If a marker has been specified, its range will be disregarded. - * @see LottieAnimation::segment(const char* marker) - * @note Experimental API - */ - Result segment(float begin, float end) noexcept; - - /** - * @brief Gets the current segment. - * - * @param[out] begin segment start. - * @param[out] end segment end. - * - * @retval Result::Success When succeed. - * @retval Result::InsufficientCondition In case the animation is not loaded. - * @retval Result::InvalidArguments When the given parameter is invalid. - * @retval Result::NonSupport When it's not animatable. - * - * @note Experimental API - */ - Result segment(float* begin, float* end = nullptr) noexcept; - - /** - * @brief Creates a new Animation object. - * - * @return A new Animation object. - * - */ - static std::unique_ptr gen() noexcept; - - _TVG_DECLARE_PRIVATE(Animation); -}; - - -/** - * @class Saver - * - * @brief A class for exporting a paint object into a specified file, from which to recover the paint data later. - * - * ThorVG provides a feature for exporting & importing paint data. The Saver role is to export the paint data to a file. - * It's useful when you need to save the composed scene or image from a paint object and recreate it later. - * - * The file format is decided by the extension name(i.e. "*.tvg") while the supported formats depend on the TVG packaging environment. - * If it doesn't support the file format, the save() method returns the @c Result::NonSupport result. - * - * Once you export a paint to the file successfully, you can recreate it using the Picture class. - * - * @see Picture::load() - * - * @since 0.5 - */ -class TVG_API Saver final -{ -public: - ~Saver(); - - /** - * @brief Sets the base background content for the saved image. - * - * @param[in] paint The paint to be drawn as the background image for the saving paint. - * - * @note Experimental API - */ - Result background(std::unique_ptr paint) noexcept; - - /** - * @brief Exports the given @p paint data to the given @p path - * - * If the saver module supports any compression mechanism, it will optimize the data size. - * This might affect the encoding/decoding time in some cases. You can turn off the compression - * if you wish to optimize for speed. - * - * @param[in] paint The paint to be saved with all its associated properties. - * @param[in] path A path to the file, in which the paint data is to be saved. - * @param[in] compress If @c true then compress data if possible. - * - * @retval Result::Success When succeed. - * @retval Result::InsufficientCondition If currently saving other resources. - * @retval Result::NonSupport When trying to save a file with an unknown extension or in an unsupported format. - * @retval Result::MemoryCorruption An internal error. - * @retval Result::Unknown In case an empty paint is to be saved. - * - * @note Saving can be asynchronous if the assigned thread number is greater than zero. To guarantee the saving is done, call sync() afterwards. - * @see Saver::sync() - * - * @since 0.5 - */ - Result save(std::unique_ptr paint, const std::string& path, bool compress = true) noexcept; - - /** - * @brief Export the provided animation data to the specified file path. - * - * This function exports the given animation data to the provided file path. You can also specify the desired frame rate in frames per second (FPS) by providing the fps parameter. - * - * @param[in] animation The animation to be saved, including all associated properties. - * @param[in] path The path to the file where the animation will be saved. - * @param[in] quality The encoded quality level. @c 0 is the minimum, @c 100 is the maximum value(recommended). - * @param[in] fps The desired frames per second (FPS). For example, to encode data at 60 FPS, pass 60. Pass 0 to keep the original frame data. - * - * @retval Result::Success if the export succeeds. - * @retval Result::InsufficientCondition if there are ongoing resource-saving operations. - * @retval Result::NonSupport if an attempt is made to save the file with an unknown extension or in an unsupported format. - * @retval Result::MemoryCorruption in case of an internal error. - * @retval Result::Unknown if attempting to save an empty paint. - * - * @note A higher frames per second (FPS) would result in a larger file size. It is recommended to use the default value. - * @note Saving can be asynchronous if the assigned thread number is greater than zero. To guarantee the saving is done, call sync() afterwards. - * - * @see Saver::sync() - * - * @note Experimental API - */ - Result save(std::unique_ptr animation, const std::string& path, uint32_t quality = 100, uint32_t fps = 0) noexcept; - - /** - * @brief Guarantees that the saving task is finished. - * - * The behavior of the Saver works on a sync/async basis, depending on the threading setting of the Initializer. - * Thus, if you wish to have a benefit of it, you must call sync() after the save() in the proper delayed time. - * Otherwise, you can call sync() immediately. - * - * @retval Result::Success when succeed. - * @retval Result::InsufficientCondition otherwise. - * - * @note The asynchronous tasking is dependent on the Saver module implementation. - * @see Saver::save() - * - * @since 0.5 - */ - Result sync() noexcept; - - /** - * @brief Creates a new Saver object. - * - * @return A new Saver object. - * - * @since 0.5 - */ - static std::unique_ptr gen() noexcept; - - _TVG_DECLARE_PRIVATE(Saver); -}; - - -/** - * @class Accessor - * - * @brief The Accessor is a utility class to debug the Scene structure by traversing the scene-tree. - * - * The Accessor helps you search specific nodes to read the property information, figure out the structure of the scene tree and its size. - * - * @warning We strongly warn you not to change the paints of a scene unless you really know the design-structure. - * - * @since 0.10 - */ -class TVG_API Accessor final -{ -public: - ~Accessor(); - - /** - * @brief Set the access function for traversing the Picture scene tree nodes. - * - * @param[in] picture The picture node to traverse the internal scene-tree. - * @param[in] func The callback function calling for every paint nodes of the Picture. - * - * @return Return the given @p picture instance. - * - * @note The bitmap based picture might not have the scene-tree. - */ - std::unique_ptr set(std::unique_ptr picture, std::function func) noexcept; - - /** - * @brief Creates a new Accessor object. - * - * @return A new Accessor object. - */ - static std::unique_ptr gen() noexcept; - - _TVG_DECLARE_PRIVATE(Accessor); -}; - - -/** - * @brief The cast() function is a utility function used to cast a 'Paint' to type 'T'. - * @since 0.11 - */ -template -std::unique_ptr cast(Paint* paint) -{ - return std::unique_ptr(static_cast(paint)); -} - - -/** - * @brief The cast() function is a utility function used to cast a 'Fill' to type 'T'. - * @since 0.11 - */ -template -std::unique_ptr cast(Fill* fill) -{ - return std::unique_ptr(static_cast(fill)); -} - - -/** @}*/ - -} //namespace - -#endif //_THORVG_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/thorvg_capi.h b/L3_Middlewares/LVGL/src/libs/thorvg/thorvg_capi.h deleted file mode 100644 index 98b709e..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/thorvg_capi.h +++ /dev/null @@ -1,2508 +0,0 @@ -/*! -* \file thorvg_capi.h -* -* \brief The module provides C bindings for the ThorVG library. -* Please refer to src/examples/Capi.cpp to find the thorvg_capi usage examples. -* -* The thorvg_capi module allows to implement the ThorVG client and provides -* the following functionalities: -* - drawing shapes: line, arc, curve, polygon, circle, user-defined, ... -* - filling: solid, linear and radial gradient -* - scene graph & affine transformation (translation, rotation, scale, ...) -* - stroking: width, join, cap, dash -* - composition: blending, masking, path clipping -* - pictures: SVG, PNG, JPG, bitmap -* -*/ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL -#define TVG_BUILD 1 - -#define TVG_BUILD 1 - -#ifndef __THORVG_CAPI_H__ -#define __THORVG_CAPI_H__ - -#include -#include - -#ifdef TVG_API - #undef TVG_API -#endif - -#ifndef TVG_STATIC - #ifdef _WIN32 - #if TVG_BUILD - #define TVG_API __declspec(dllexport) - #else - #define TVG_API __declspec(dllimport) - #endif - #elif (defined(__SUNPRO_C) || defined(__SUNPRO_CC)) - #define TVG_API __global - #else - #if (defined(__GNUC__) && __GNUC__ >= 4) || defined(__INTEL_COMPILER) - #define TVG_API __attribute__ ((visibility("default"))) - #else - #define TVG_API - #endif - #endif -#else - #define TVG_API -#endif - -#ifdef TVG_DEPRECATED - #undef TVG_DEPRECATED -#endif - -#ifdef _WIN32 - #define TVG_DEPRECATED __declspec(deprecated) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) - #define TVG_DEPRECATED __attribute__ ((__deprecated__)) -#else - #define TVG_DEPRECATED -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** -* \defgroup ThorVG_CAPI ThorVG_CAPI -* \brief ThorVG C language binding APIs. -* -* \{ -*/ - - -/** -* \brief A structure responsible for managing and drawing graphical elements. -* -* It sets up the target buffer, which can be drawn on the screen. It stores the Tvg_Paint objects (Shape, Scene, Picture). -*/ -typedef struct _Tvg_Canvas Tvg_Canvas; - - -/** -* \brief A structure representing a graphical element. -* -* \warning The TvgPaint objects cannot be shared between Canvases. -*/ -typedef struct _Tvg_Paint Tvg_Paint; - - -/** -* \brief A structure representing a gradient fill of a Tvg_Paint object. -*/ -typedef struct _Tvg_Gradient Tvg_Gradient; - - -/** -* \brief A structure representing an object that enables to save a Tvg_Paint object into a file. -*/ -typedef struct _Tvg_Saver Tvg_Saver; - -/** -* \brief A structure representing an animation controller object. -*/ -typedef struct _Tvg_Animation Tvg_Animation; - - -/** -* \brief Enumeration specifying the engine type used for the graphics backend. For multiple backends bitwise operation is allowed. -* -* \ingroup ThorVGCapi_Initializer -*/ -typedef enum { - TVG_ENGINE_SW = (1 << 1), ///< CPU rasterizer. - TVG_ENGINE_GL = (1 << 2) ///< OpenGL rasterizer. -} Tvg_Engine; - - -/** - * \brief Enumeration specifying the result from the APIs. - */ -typedef enum { - TVG_RESULT_SUCCESS = 0, ///< The value returned in case of a correct request execution. - TVG_RESULT_INVALID_ARGUMENT, ///< The value returned in the event of a problem with the arguments given to the API - e.g. empty paths or null pointers. - TVG_RESULT_INSUFFICIENT_CONDITION, ///< The value returned in case the request cannot be processed - e.g. asking for properties of an object, which does not exist. - TVG_RESULT_FAILED_ALLOCATION, ///< The value returned in case of unsuccessful memory allocation. - TVG_RESULT_MEMORY_CORRUPTION, ///< The value returned in the event of bad memory handling - e.g. failing in pointer releasing or casting - TVG_RESULT_NOT_SUPPORTED, ///< The value returned in case of choosing unsupported options. - TVG_RESULT_UNKNOWN ///< The value returned in all other cases. -} Tvg_Result; - - -/** - * \brief Enumeration indicating the method used in the composition of two objects - the target and the source. - * - * \ingroup ThorVGCapi_Paint - */ -typedef enum { - TVG_COMPOSITE_METHOD_NONE = 0, ///< No composition is applied. - TVG_COMPOSITE_METHOD_CLIP_PATH, ///< The intersection of the source and the target is determined and only the resulting pixels from the source are rendered. - TVG_COMPOSITE_METHOD_ALPHA_MASK, ///< The pixels of the source and the target are alpha blended. As a result, only the part of the source, which intersects with the target is visible. - TVG_COMPOSITE_METHOD_INVERSE_ALPHA_MASK, ///< The pixels of the source and the complement to the target's pixels are alpha blended. As a result, only the part of the source which is not covered by the target is visible. - TVG_COMPOSITE_METHOD_LUMA_MASK, ///< The source pixels are converted to grayscale (luma value) and alpha blended with the target. As a result, only the part of the source which intersects with the target is visible. \since 0.9 - TVG_COMPOSITE_METHOD_INVERSE_LUMA_MASK ///< The source pixels are converted to grayscale (luma value) and complement to the target's pixels are alpha blended. As a result, only the part of the source which is not covered by the target is visible. \Experimental API -} Tvg_Composite_Method; - -/** - * @brief Enumeration indicates the method used for blending paint. Please refer to the respective formulas for each method. - * - * \ingroup ThorVGCapi_Paint - * - * @note Experimental API - */ -typedef enum { - TVG_BLEND_METHOD_NORMAL = 0, ///< Perform the alpha blending(default). S if (Sa == 255), otherwise (Sa * S) + (255 - Sa) * D - TVG_BLEND_METHOD_ADD, ///< Simply adds pixel values of one layer with the other. (S + D) - TVG_BLEND_METHOD_SCREEN, ///< The values of the pixels in the two layers are inverted, multiplied, and then inverted again. (S + D) - (S * D) - TVG_BLEND_METHOD_MULTIPLY, ///< Takes the RGB channel values from 0 to 255 of each pixel in the top layer and multiples them with the values for the corresponding pixel from the bottom layer. (S * D) - TVG_BLEND_METHOD_OVERLAY, ///< Combines Multiply and Screen blend modes. (2 * S * D) if (2 * D < Da), otherwise (Sa * Da) - 2 * (Da - S) * (Sa - D) - TVG_BLEND_METHOD_DIFFERENCE, ///< Subtracts the bottom layer from the top layer or the other way around, to always get a non-negative value. (S - D) if (S > D), otherwise (D - S) - TVG_BLEND_METHOD_EXCLUSION, ///< The result is twice the product of the top and bottom layers, subtracted from their sum. s + d - (2 * s * d) - TVG_BLEND_METHOD_SRCOVER, ///< Replace the bottom layer with the top layer. - TVG_BLEND_METHOD_DARKEN, ///< Creates a pixel that retains the smallest components of the top and bottom layer pixels. min(S, D) - TVG_BLEND_METHOD_LIGHTEN, ///< Only has the opposite action of Darken Only. max(S, D) - TVG_BLEND_METHOD_COLORDODGE, ///< Divides the bottom layer by the inverted top layer. D / (255 - S) - TVG_BLEND_METHOD_COLORBURN, ///< Divides the inverted bottom layer by the top layer, and then inverts the result. 255 - (255 - D) / S - TVG_BLEND_METHOD_HARDLIGHT, ///< The same as Overlay but with the color roles reversed. (2 * S * D) if (S < Sa), otherwise (Sa * Da) - 2 * (Da - S) * (Sa - D) - TVG_BLEND_METHOD_SOFTLIGHT ///< The same as Overlay but with applying pure black or white does not result in pure black or white. (1 - 2 * S) * (D ^ 2) + (2 * S * D) -} Tvg_Blend_Method; - - -/** - * \brief Enumeration indicating the ThorVG class type. - * - * \ingroup ThorVGCapi_Paint - * - * \since 0.9 - */ -typedef enum { - TVG_IDENTIFIER_UNDEF = 0, ///< Undefined type. - TVG_IDENTIFIER_SHAPE, ///< A shape type paint. - TVG_IDENTIFIER_SCENE, ///< A scene type paint. - TVG_IDENTIFIER_PICTURE, ///< A picture type paint. - TVG_IDENTIFIER_LINEAR_GRAD, ///< A linear gradient type. - TVG_IDENTIFIER_RADIAL_GRAD ///< A radial gradient type. -} Tvg_Identifier; - - -/** - * \addtogroup ThorVGCapi_Shape - * \{ - */ - -/** - * \brief Enumeration specifying the values of the path commands accepted by TVG. - * - * Not to be confused with the path commands from the svg path element (like M, L, Q, H and many others). - * TVG interprets all of them and translates to the ones from the PathCommand values. - */ -typedef enum { - TVG_PATH_COMMAND_CLOSE = 0, ///< Ends the current sub-path and connects it with its initial point - corresponds to Z command in the svg path commands. - TVG_PATH_COMMAND_MOVE_TO, ///< Sets a new initial point of the sub-path and a new current point - corresponds to M command in the svg path commands. - TVG_PATH_COMMAND_LINE_TO, ///< Draws a line from the current point to the given point and sets a new value of the current point - corresponds to L command in the svg path commands. - TVG_PATH_COMMAND_CUBIC_TO ///< Draws a cubic Bezier curve from the current point to the given point using two given control points and sets a new value of the current point - corresponds to C command in the svg path commands. -} Tvg_Path_Command; - - -/** - * \brief Enumeration determining the ending type of a stroke in the open sub-paths. - */ -typedef enum { - TVG_STROKE_CAP_SQUARE = 0, ///< The stroke is extended in both endpoints of a sub-path by a rectangle, with the width equal to the stroke width and the length equal to the half of the stroke width. For zero length sub-paths the square is rendered with the size of the stroke width. - TVG_STROKE_CAP_ROUND, ///< The stroke is extended in both endpoints of a sub-path by a half circle, with a radius equal to the half of a stroke width. For zero length sub-paths a full circle is rendered. - TVG_STROKE_CAP_BUTT ///< The stroke ends exactly at each of the two endpoints of a sub-path. For zero length sub-paths no stroke is rendered. -} Tvg_Stroke_Cap; - - -/** - * \brief Enumeration specifying how to fill the area outside the gradient bounds. - */ -typedef enum { - TVG_STROKE_JOIN_BEVEL = 0, ///< The outer corner of the joined path segments is bevelled at the join point. The triangular region of the corner is enclosed by a straight line between the outer corners of each stroke. - TVG_STROKE_JOIN_ROUND, ///< The outer corner of the joined path segments is rounded. The circular region is centered at the join point. - TVG_STROKE_JOIN_MITER ///< The outer corner of the joined path segments is spiked. The spike is created by extension beyond the join point of the outer edges of the stroke until they intersect. In case the extension goes beyond the limit, the join style is converted to the Bevel style. -} Tvg_Stroke_Join; - - -/** - * \brief Enumeration specifying how to fill the area outside the gradient bounds. - */ -typedef enum { - TVG_STROKE_FILL_PAD = 0, ///< The remaining area is filled with the closest stop color. - TVG_STROKE_FILL_REFLECT, ///< The gradient pattern is reflected outside the gradient area until the expected region is filled. - TVG_STROKE_FILL_REPEAT ///< The gradient pattern is repeated continuously beyond the gradient area until the expected region is filled. -} Tvg_Stroke_Fill; - - -/** - * \brief Enumeration specifying the algorithm used to establish which parts of the shape are treated as the inside of the shape. - */ -typedef enum { - TVG_FILL_RULE_WINDING = 0, ///< A line from the point to a location outside the shape is drawn. The intersections of the line with the path segment of the shape are counted. Starting from zero, if the path segment of the shape crosses the line clockwise, one is added, otherwise one is subtracted. If the resulting sum is non zero, the point is inside the shape. - TVG_FILL_RULE_EVEN_ODD ///< A line from the point to a location outside the shape is drawn and its intersections with the path segments of the shape are counted. If the number of intersections is an odd number, the point is inside the shape. -} Tvg_Fill_Rule; - -/** \} */ // end addtogroup ThorVGCapi_Shape - - -/*! -* \addtogroup ThorVGCapi_Gradient -* \{ -*/ - -/*! -* \brief A data structure storing the information about the color and its relative position inside the gradient bounds. -*/ -typedef struct -{ - float offset; /**< The relative position of the color. */ - uint8_t r; /**< The red color channel value in the range [0 ~ 255]. */ - uint8_t g; /**< The green color channel value in the range [0 ~ 255]. */ - uint8_t b; /**< The blue color channel value in the range [0 ~ 255]. */ - uint8_t a; /**< The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. */ -} Tvg_Color_Stop; - -/** \} */ // end addtogroup ThorVGCapi_Gradient - - -/** - * \brief A data structure representing a point in two-dimensional space. - */ -typedef struct -{ - float x, y; -} Tvg_Point; - - -/** - * \brief A data structure representing a three-dimensional matrix. - * - * The elements e11, e12, e21 and e22 represent the rotation matrix, including the scaling factor. - * The elements e13 and e23 determine the translation of the object along the x and y-axis, respectively. - * The elements e31 and e32 are set to 0, e33 is set to 1. - */ -typedef struct -{ - float e11, e12, e13; - float e21, e22, e23; - float e31, e32, e33; -} Tvg_Matrix; - - -/** -* \defgroup ThorVGCapi_Initializer Initializer -* \brief A module enabling initialization and termination of the TVG engines. -* -* \{ -*/ - -/************************************************************************/ -/* Engine API */ -/************************************************************************/ -/*! -* \brief Initializes TVG engines. -* -* TVG requires the running-engine environment. -* TVG runs its own task-scheduler for parallelizing rendering tasks efficiently. -* You can indicate the number of threads, the count of which is designated @p threads. -* In the initialization step, TVG will generate/spawn the threads as set by @p threads count. -* -* \code -* tvg_engine_init(TVG_ENGINE_SW, 0); //Initialize software renderer and use the main thread only -* \endcode -* -* \param[in] engine_method The engine types to initialize. This is relative to the Canvas types, in which it will be used. For multiple backends bitwise operation is allowed. -* - TVG_ENGINE_SW: CPU rasterizer -* - TVG_ENGINE_GL: OpenGL rasterizer (not supported yet) -* \param[in] threads The number of additional threads used to perform rendering. Zero indicates only the main thread is to be used. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error possibly with memory allocation. -* \retval TVG_RESULT_INVALID_ARGUMENT Unknown engine type. -* \retval TVG_RESULT_NOT_SUPPORTED Unsupported engine type. -* \retval TVG_RESULT_UNKNOWN Other error. -* -* \note The Initializer keeps track of the number of times it was called. Threads count is fixed at the first init() call. -* \see tvg_engine_term() -* \see Tvg_Engine -*/ -TVG_API Tvg_Result tvg_engine_init(Tvg_Engine engine_method, unsigned threads); - - -/*! -* \brief Terminates TVG engines. -* -* It should be called in case of termination of the TVG client with the same engine types as were passed when tvg_engine_init() was called. -* -* \code -* tvg_engine_init(TVG_ENGINE_SW, 0); -* //define canvas and shapes, update shapes, general rendering calls -* tvg_engine_term(TVG_ENGINE_SW); -* \endcode -* -* \param engine_method The engine types to terminate. This is relative to the Canvas types, in which it will be used. For multiple backends bitwise operation is allowed -* - TVG_ENGINE_SW: CPU rasterizer -* - TVG_ENGINE_GL: OpenGL rasterizer (not supported yet) -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION Nothing to be terminated. -* \retval TVG_RESULT_INVALID_ARGUMENT Unknown engine type. -* \retval TVG_RESULT_NOT_SUPPORTED Unsupported engine type. -* \retval TVG_RESULT_UNKNOWN An internal error. -* -* \see tvg_engine_init() -* \see Tvg_Engine -*/ -TVG_API Tvg_Result tvg_engine_term(Tvg_Engine engine_method); - - -/** \} */ // end defgroup ThorVGCapi_Initializer - - -/** -* \defgroup ThorVGCapi_Canvas Canvas -* \brief A module for managing and drawing graphical elements. -* -* A canvas is an entity responsible for drawing the target. It sets up the drawing engine and the buffer, which can be drawn on the screen. It also manages given Paint objects. -* -* \note A Canvas behavior depends on the raster engine though the final content of the buffer is expected to be identical. -* \warning The Paint objects belonging to one Canvas can't be shared among multiple Canvases. -\{ -*/ - - -/** -* \defgroup ThorVGCapi_SwCanvas SwCanvas -* \ingroup ThorVGCapi_Canvas -* -* \brief A module for rendering the graphical elements using the software engine. -* -* \{ -*/ - -/************************************************************************/ -/* SwCanvas API */ -/************************************************************************/ - -/** - * \brief Enumeration specifying the methods of Memory Pool behavior policy. - */ -typedef enum { - TVG_MEMPOOL_POLICY_DEFAULT = 0, ///< Default behavior that ThorVG is designed to. - TVG_MEMPOOL_POLICY_SHAREABLE, ///< Memory Pool is shared among canvases. - TVG_MEMPOOL_POLICY_INDIVIDUAL ///< Allocate designated memory pool that is used only by the current canvas instance. -} Tvg_Mempool_Policy; - - -/** - * \brief Enumeration specifying the methods of combining the 8-bit color channels into 32-bit color. - */ -typedef enum { - TVG_COLORSPACE_ABGR8888 = 0, ///< The channels are joined in the order: alpha, blue, green, red. Colors are alpha-premultiplied. (a << 24 | b << 16 | g << 8 | r) - TVG_COLORSPACE_ARGB8888, ///< The channels are joined in the order: alpha, red, green, blue. Colors are alpha-premultiplied. (a << 24 | r << 16 | g << 8 | b) - TVG_COLORSPACE_ABGR8888S, ///< The channels are joined in the order: alpha, blue, green, red. Colors are un-alpha-premultiplied. @since 0.13 - TVG_COLORSPACE_ARGB8888S ///< The channels are joined in the order: alpha, red, green, blue. Colors are un-alpha-premultiplied. @since 0.13 -} Tvg_Colorspace; - - -/*! -* \brief Creates a Canvas object. -* -* \code -* Tvg_Canvas *canvas = NULL; -* -* tvg_engine_init(TVG_ENGINE_SW, 4); -* canvas = tvg_swcanvas_create(); -* -* //set up the canvas buffer -* uint32_t *buffer = NULL; -* buffer = (uint32_t*) malloc(sizeof(uint32_t) * 100 * 100); -* if (!buffer) return; -* -* tvg_swcanvas_set_target(canvas, buffer, 100, 100, 100, TVG_COLORSPACE_ARGB8888); -* -* //set up paints and add them into the canvas before drawing it -* -* tvg_canvas_destroy(canvas); -* tvg_engine_term(TVG_ENGINE_SW); -* \endcode -* -* \return A new Tvg_Canvas object. -*/ -TVG_API Tvg_Canvas* tvg_swcanvas_create(void); - - -/*! -* \brief Sets the buffer used in the rasterization process and defines the used colorspace. -* -* For optimisation reasons TVG does not allocate memory for the output buffer on its own. -* The buffer of a desirable size should be allocated and owned by the caller. -* -* \param[in] canvas The Tvg_Canvas object managing the @p buffer. -* \param[in] buffer A pointer to the allocated memory block of the size @p stride x @p h. -* \param[in] stride The stride of the raster image - in most cases same value as @p w. -* \param[in] w The width of the raster image. -* \param[in] h The height of the raster image. -* \param[in] cs The colorspace value defining the way the 32-bits colors should be read/written. -* - TVG_COLORSPACE_ABGR8888 -* - TVG_COLORSPACE_ARGB8888 -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_MEMORY_CORRUPTION Casting in the internal function implementation failed. -* \retval TVG_RESULT_INVALID_ARGUMENTS An invalid canvas or buffer pointer passed or one of the @p stride, @p w or @p h being zero. -* \retval TVG_RESULT_NOT_SUPPORTED The software engine is not supported. -* -* \warning Do not access @p buffer during tvg_canvas_draw() - tvg_canvas_sync(). It should not be accessed while the engine is writing on it. -* -* \see Tvg_Colorspace -*/ -TVG_API Tvg_Result tvg_swcanvas_set_target(Tvg_Canvas* canvas, uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, Tvg_Colorspace cs); - - -/*! -* \brief Sets the software engine memory pool behavior policy. -* -* ThorVG draws a lot of shapes, it allocates/deallocates a few chunk of memory -* while processing rendering. It internally uses one shared memory pool -* which can be reused among the canvases in order to avoid memory overhead. -* -* Thus ThorVG suggests using a memory pool policy to satisfy user demands, -* if it needs to guarantee the thread-safety of the internal data access. -* -* \param[in] canvas The Tvg_Canvas object of which the Memory Pool behavior is to be specified. -* \param[in] policy The method specifying the Memory Pool behavior. The default value is @c TVG_MEMPOOL_POLICY_DEFAULT. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENTS An invalid canvas pointer passed. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION The canvas contains some paints already. -* \retval TVG_RESULT_NOT_SUPPORTED The software engine is not supported. -* -* \note When @c policy is set as @c TVG_MEMPOOL_POLICY_INDIVIDUAL, the current instance of canvas uses its own individual -* memory data, which is not shared with others. This is necessary when the canvas is accessed on a worker-thread. -* -* \warning It's not allowed after pushing any paints. -*/ -TVG_API Tvg_Result tvg_swcanvas_set_mempool(Tvg_Canvas* canvas, Tvg_Mempool_Policy policy); - -/** \} */ // end defgroup ThorVGCapi_SwCanvas - - -/************************************************************************/ -/* Common Canvas API */ -/************************************************************************/ -/*! -* \brief Clears the canvas internal data, releases all paints stored by the canvas and destroys the canvas object itself. -* -* \code -* static Tvg_Canvas *canvas = NULL; -* static uint32_t *buffer = NULL; -* -* static void _init() { -* canvas = tvg_swcanvas_create(); -* buffer = (uint32_t*) malloc(sizeof(uint32_t) * 100 * 100); -* tvg_swcanvas_set_target(canvas, buffer, 100, 100, 100, TVG_COLORSPACE_ARGB8888); -* } -* -* //a task called from main function in a loop -* static void _job(const int cmd) { -* //define a valid rectangle shape -* switch (cmd) { -* case CMD_EXIT: return 0; -* case CMD_ADD_RECT: -* tvg_canvas_push(canvas, rect); -* break; -* case CMD_DEL_RECT: -* tvg_paint_del(rect); -* //now to safely delete Tvg_Canvas, tvg_canvas_clear() API have to be used -* break; -* default: -* break; -* } -* } -* -* int main(int argc, char **argv) { -* int cmd = 0; -* int stop = 1; -* -* tvg_engine_init(TVG_ENGINE_SW, 4); -* -* while (stop) { -* //wait for a command e.g. from a console -* stop = _job(cmd); -* } -* tvg_canvas_clear(canvas, false); -* tvg_canvas_destroy(canvas); -* tvg_engine_term(TVG_ENGINE_SW); -* return 0; -* } -* -* tvg_canvas_destroy(canvas); -* tvg_engine_term(TVG_ENGINE_SW) -* \endcode -* -* \param[in] canvas The Tvg_Canvas object to be destroyed. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid pointer to the Tvg_Canvas object is passed. -* -* \note If the paints from the canvas should not be released, the tvg_canvas_clear() with a @c free argument value set to @c false should be called. -* Please be aware that in such a case TVG is not responsible for the paints release anymore and it has to be done manually in order to avoid memory leaks. -* -* \see tvg_paint_del(), tvg_canvas_clear() -*/ -TVG_API Tvg_Result tvg_canvas_destroy(Tvg_Canvas* canvas); - - -/*! -* \brief Inserts a drawing element into the canvas using a Tvg_Paint object. -* -* \param[in] canvas The Tvg_Canvas object managing the @p paint. -* \param[in] paint The Tvg_Paint object to be drawn. -* -* Only the paints pushed into the canvas will be drawing targets. -* They are retained by the canvas until you call tvg_canvas_clear(). -* If you know the number of the pushed objects in advance, please call tvg_canvas_reserve(). -* -* \return Tvg_Result return values: -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION An internal error. -* -* \note The rendering order of the paints is the same as the order as they were pushed. Consider sorting the paints before pushing them if you intend to use layering. -* \see tvg_canvas_clear() -*/ -TVG_API Tvg_Result tvg_canvas_push(Tvg_Canvas* canvas, Tvg_Paint* paint); - - -/*! -* \brief Reserves a memory block where the objects pushed into a canvas are stored. -* -* If the number of Tvg_Paints to be stored in a canvas is known in advance, calling this function reduces the multiple -* memory allocations thus improves the performance. -* -* \code -* Tvg_Canvas *canvas = NULL; -* -* tvg_engine_init(TVG_ENGINE_SW, 4); -* canvas = tvg_swcanvas_create(); -* -* uint32_t *buffer = NULL; -* buffer = (uint32_t*) malloc(sizeof(uint32_t) * 100 * 100); -* if (!buffer) return; -* -* tvg_swcanvas_set_target(canvas, buffer, 100, 100, 100, TVG_COLORSPACE_ARGB8888); -* -* tvg_canvas_destroy(canvas); -* tvg_engine_term(TVG_ENGINE_SW) -* \endcode -* -* \param[in] canvas The Tvg_Canvas object managing the reserved memory. -* \param[in] n The number of objects for which the memory is to be reserved. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Canvas pointer. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with memory allocation. -*/ -TVG_DEPRECATED TVG_API Tvg_Result tvg_canvas_reserve(Tvg_Canvas* canvas, uint32_t n); - - -/*! -* \brief Sets the total number of the paints pushed into the canvas to be zero. -* Tvg_Paint objects stored in the canvas are released if @p free is set to @c true, otherwise the memory is not deallocated and -* all paints should be released manually in order to avoid memory leaks. -* -* \param[in] canvas The Tvg_Canvas object to be cleared. -* \param[in] free If @c true the memory occupied by paints is deallocated, otherwise it is not. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Canvas pointer. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION An internal error. -* -* \warning Please use the @p free argument only when you know how it works, otherwise it's not recommended. -* -* \see tvg_canvas_destroy() -*/ -TVG_API Tvg_Result tvg_canvas_clear(Tvg_Canvas* canvas, bool free); - - -/*! -* \brief Updates all paints in a canvas. -* -* Should be called before drawing in order to prepare paints for the rendering. -* -* \code -* //A frame drawing example. Thread safety and events implementation is skipped to show only TVG code. -* -* static Tvg_Canvas *canvas = NULL; -* static Tvg_Paint *rect = NULL; -* -* int _frame_render(void) { -* tvg_canvas_update(canvas); -* tvg_canvas_draw(canvas); -* tvg_canvas_sync(canvas); -* } -* -* //event handler from your code or third party library -* void _event_handler(event *event_data) { -* if (!event_data) return NULL; -* switch(event_data.type) { -* case EVENT_RECT_ADD: -* if (!rect) { -* tvg_shape_append_rect(rect, 10, 10, 50, 50, 0, 0); -* tvg_shape_set_stroke_width(rect, 1.0f); -* tvg_shape_set_stroke_color(rect, 255, 0, 0, 255); -* tvg_canvas_push(canvas, rect); -* } -* break; -* case EVENT_RECT_MOVE: -* if (rect) tvg_paint_translate(rect, 10.0, 10.0); -* break; -* default: -* break; -* } -* } -* -* int main(int argc, char **argv) { -* //example handler from your code or third party lib -* event_handler_add(handler, _event_handler); -* -* //create frame rendering process which calls _frame_render() function. -* app_loop_begin(_frame_render); -* app_loop_finish(); -* cleanup(); -* } -* \endcode -* -* \param[in] canvas The Tvg_Canvas object to be updated. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Canvas pointer. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION An internal error. -* -* \see tvg_canvas_update_paint() -*/ -TVG_API Tvg_Result tvg_canvas_update(Tvg_Canvas* canvas); - - -/*! -* \brief Updates the given Tvg_Paint object from the canvas before the rendering. -* -* If a client application using the TVG library does not update the entire canvas with tvg_canvas_update() in the frame -* rendering process, Tvg_Paint objects previously added to the canvas should be updated manually with this function. -* -* \param[in] canvas The Tvg_Canvas object to which the @p paint belongs. -* \param[in] paint The Tvg_Paint object to be updated. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument. -* -* \see tvg_canvas_update() -*/ -TVG_API Tvg_Result tvg_canvas_update_paint(Tvg_Canvas* canvas, Tvg_Paint* paint); - - -/*! -* \brief Requests the canvas to draw the Tvg_Paint objects. -* -* All paints from the given canvas will be rasterized to the buffer. -* -* \param[in] canvas The Tvg_Canvas object containing elements to be drawn. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Canvas pointer. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION An internal error. -* -* \note Drawing can be asynchronous based on the assigned thread number. To guarantee the drawing is done, call tvg_canvas_sync() afterwards. -* \see tvg_canvas_sync() -*/ -TVG_API Tvg_Result tvg_canvas_draw(Tvg_Canvas* canvas); - - -/*! -* \brief Guarantees that the drawing process is finished. -* -* Since the canvas rendering can be performed asynchronously, it should be called after the tvg_canvas_draw(). -* -* \param[in] canvas The Tvg_Canvas object containing elements which were drawn. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Canvas pointer. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION An internal error. -* -* \see tvg_canvas_draw() -*/ -TVG_API Tvg_Result tvg_canvas_sync(Tvg_Canvas* canvas); - - -/*! -* \brief Sets the drawing region in the canvas. -* -* This function defines the rectangular area of the canvas that will be used for drawing operations. -* The specified viewport is used to clip the rendering output to the boundaries of the rectangle. -* -* \param[in] canvas The Tvg_Canvas object containing elements which were drawn. -* \param[in] x The x-coordinate of the upper-left corner of the rectangle. -* \param[in] y The y-coordinate of the upper-left corner of the rectangle. -* \param[in] w The width of the rectangle. -* \param[in] h The height of the rectangle. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION An internal error. -* -* \warning It's not allowed to change the viewport during tvg_canvas_update() - tvg_canvas_sync() or tvg_canvas_push() - tvg_canvas_sync(). -* -* \note When resetting the target, the viewport will also be reset to the target size. -* \note Experimental API -* \see tvg_swcanvas_set_target() -*/ -TVG_API Tvg_Result tvg_canvas_set_viewport(Tvg_Canvas* canvas, int32_t x, int32_t y, int32_t w, int32_t h); - -/** \} */ // end defgroup ThorVGCapi_Canvas - - -/** -* \defgroup ThorVGCapi_Paint Paint -* \brief A module for managing graphical elements. It enables duplication, transformation and composition. -* -* \{ -*/ - -/************************************************************************/ -/* Paint API */ -/************************************************************************/ -/*! -* \brief Releases the given Tvg_Paint object. -* -* \code -* //example of cleanup function -* Tvg_Paint *rect = NULL; //rectangle shape added in other function -* -* //rectangle delete API -* int rectangle_delete(void) { -* if (rect) tvg_paint_del(rect); -* rect = NULL; -* } -* -* int cleanup(void) { -* tvg_canvas_clear(canvas, false); -* tvg_canvas_destroy(canvas); -* canvas = NULL; -* } -* \endcode -* -* \param[in] paint The Tvg_Paint object to be released. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* -* \warning If this function is used, tvg_canvas_clear() with the @c free argument value set to @c false should be used in order to avoid unexpected behaviours. -* -* \see tvg_canvas_clear(), tvg_canvas_destroy() -*/ -TVG_API Tvg_Result tvg_paint_del(Tvg_Paint* paint); - - -/*! -* \brief Scales the given Tvg_Paint object by the given factor. -* -* \param[in] paint The Tvg_Paint object to be scaled. -* \param[in] factor The value of the scaling factor. The default value is 1. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with memory allocation. -*/ -TVG_API Tvg_Result tvg_paint_scale(Tvg_Paint* paint, float factor); - - -/*! -* \brief Rotates the given Tvg_Paint by the given angle. -* -* The angle in measured clockwise from the horizontal axis. -* The rotational axis passes through the point on the object with zero coordinates. -* -* \param[in] paint The Tvg_Paint object to be rotated. -* \param[in] degree The value of the rotation angle in degrees. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with memory allocation. -*/ -TVG_API Tvg_Result tvg_paint_rotate(Tvg_Paint* paint, float degree); - - -/*! -* \brief Moves the given Tvg_Paint in a two-dimensional space. -* -* The origin of the coordinate system is in the upper left corner of the canvas. -* The horizontal and vertical axes point to the right and down, respectively. -* -* \param[in] paint The Tvg_Paint object to be shifted. -* \param[in] x The value of the horizontal shift. -* \param[in] y The value of the vertical shift. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with memory allocation. -*/ -TVG_API Tvg_Result tvg_paint_translate(Tvg_Paint* paint, float x, float y); - - -/*! -* \brief Transforms the given Tvg_Paint using the augmented transformation matrix. -* -* The augmented matrix of the transformation is expected to be given. -* -* \param[in] paint The Tvg_Paint object to be transformed. -* \param[in] m The 3x3 augmented matrix. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr is passed as the argument. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with memory allocation. -*/ -TVG_API Tvg_Result tvg_paint_set_transform(Tvg_Paint* paint, const Tvg_Matrix* m); - - -/*! -* \brief Gets the matrix of the affine transformation of the given Tvg_Paint object. -* -* In case no transformation was applied, the identity matrix is returned. -* -* \param[in] paint The Tvg_Paint object of which to get the transformation matrix. -* \param[out] m The 3x3 augmented matrix. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr is passed as the argument. -*/ -TVG_API Tvg_Result tvg_paint_get_transform(Tvg_Paint* paint, Tvg_Matrix* m); - - -/*! -* \brief Sets the opacity of the given Tvg_Paint. -* -* \param[in] paint The Tvg_Paint object of which the opacity value is to be set. -* \param[in] opacity The opacity value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* -* \note Setting the opacity with this API may require multiple renderings using a composition. It is recommended to avoid changing the opacity if possible. -*/ -TVG_API Tvg_Result tvg_paint_set_opacity(Tvg_Paint* paint, uint8_t opacity); - - -/*! -* \brief Gets the opacity of the given Tvg_Paint. -* -* \param[in] paint The Tvg_Paint object of which to get the opacity value. -* \param[out] opacity The opacity value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument. -*/ -TVG_API Tvg_Result tvg_paint_get_opacity(const Tvg_Paint* paint, uint8_t* opacity); - - -/*! -* \brief Duplicates the given Tvg_Paint object. -* -* Creates a new object and sets its all properties as in the original object. -* -* \param[in] paint The Tvg_Paint object to be copied. -* -* \return A copied Tvg_Paint object if succeed, @c nullptr otherwise. -*/ -TVG_API Tvg_Paint* tvg_paint_duplicate(Tvg_Paint* paint); - - -/*! -* \brief Gets the axis-aligned bounding box of the Tvg_Paint object. -* -* \param[in] paint The Tvg_Paint object of which to get the bounds. -* \param[out] x The x coordinate of the upper left corner of the object. -* \param[out] y The y coordinate of the upper left corner of the object. -* \param[out] w The width of the object. -* \param[out] h The height of the object. -* \param[in] transformed If @c true, the transformation of the paint is taken into account, otherwise it isn't. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION Other errors. -* -* \note The bounding box doesn't indicate the actual drawing region. It's the smallest rectangle that encloses the object. -*/ -TVG_API Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h, bool transformed); - - -/*! -* \brief Sets the composition target object and the composition method. -* -* \param[in] paint The source object of the composition. -* \param[in] target The target object of the composition. -* \param[in] method The method used to composite the source object with the target. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid @p paint or @p target object or the @p method equal to TVG_COMPOSITE_METHOD_NONE. -*/ -TVG_API Tvg_Result tvg_paint_set_composite_method(Tvg_Paint* paint, Tvg_Paint* target, Tvg_Composite_Method method); - - -/** -* \brief Gets the composition target object and the composition method. -* -* \param[in] paint The source object of the composition. -* \param[out] target The target object of the composition. -* \param[out] method The method used to composite the source object with the target. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr is passed as the argument. -*/ -TVG_API Tvg_Result tvg_paint_get_composite_method(const Tvg_Paint* paint, const Tvg_Paint** target, Tvg_Composite_Method* method); - - -/** -* \brief Gets the unique id value of the paint instance indicating the instance type. -* -* \param[in] paint The Tvg_Paint object of which to get the identifier value. -* \param[out] identifier The unique identifier of the paint instance type. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument. -* -* \since 0.9 -*/ -TVG_API Tvg_Result tvg_paint_get_identifier(const Tvg_Paint* paint, Tvg_Identifier* identifier); - - -/** - * @brief Sets the blending method for the paint object. - * - * The blending feature allows you to combine colors to create visually appealing effects, including transparency, lighting, shading, and color mixing, among others. - * its process involves the combination of colors or images from the source paint object with the destination (the lower layer image) using blending operations. - * The blending operation is determined by the chosen @p BlendMethod, which specifies how the colors or images are combined. - * - * \param[in] paint The Tvg_Paint object of which to get the identifier value. - * \param[in] method The blending method to be set. - * - * \return Tvg_Result enumeration. - * \retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument. - * - * @note Experimental API - */ -TVG_API Tvg_Result tvg_paint_set_blend_method(const Tvg_Paint* paint, Tvg_Blend_Method method); - - -/** - * @brief Gets the blending method for the paint object. - * - * The blending feature allows you to combine colors to create visually appealing effects, including transparency, lighting, shading, and color mixing, among others. - * its process involves the combination of colors or images from the source paint object with the destination (the lower layer image) using blending operations. - * The blending operation is determined by the chosen @p BlendMethod, which specifies how the colors or images are combined. - * - * \param[in] paint The Tvg_Paint object of which to get the identifier value. - * \param[out] method The blending method of the paint. - * - * \return Tvg_Result enumeration. - * \retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument. - * - * @note Experimental API - */ -TVG_API Tvg_Result tvg_paint_get_blend_method(const Tvg_Paint* paint, Tvg_Blend_Method* method); - - -/** \} */ // end defgroup ThorVGCapi_Paint - -/** -* \defgroup ThorVGCapi_Shape Shape -* -* \brief A module for managing two-dimensional figures and their properties. -* -* A shape has three major properties: shape outline, stroking, filling. The outline in the shape is retained as the path. -* Path can be composed by accumulating primitive commands such as tvg_shape_move_to(), tvg_shape_line_to(), tvg_shape_cubic_to() or complete shape interfaces such as tvg_shape_append_rect(), tvg_shape_append_circle(), etc. -* Path can consists of sub-paths. One sub-path is determined by a close command. -* -* The stroke of a shape is an optional property in case the shape needs to be represented with/without the outline borders. -* It's efficient since the shape path and the stroking path can be shared with each other. It's also convenient when controlling both in one context. -* -* \{ -*/ - -/************************************************************************/ -/* Shape API */ -/************************************************************************/ -/*! -* \brief Creates a new shape object. -* -* \return A new shape object. -*/ -TVG_API Tvg_Paint* tvg_shape_new(void); - - -/*! -* \brief Resets the shape path properties. -* -* The color, the fill and the stroke properties are retained. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* -* \note The memory, where the path data is stored, is not deallocated at this stage for caching effect. -*/ -TVG_API Tvg_Result tvg_shape_reset(Tvg_Paint* paint); - - -/*! -* \brief Sets the initial point of the sub-path. -* -* The value of the current point is set to the given point. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] x The horizontal coordinate of the initial point of the sub-path. -* \param[in] y The vertical coordinate of the initial point of the sub-path. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -*/ -TVG_API Tvg_Result tvg_shape_move_to(Tvg_Paint* paint, float x, float y); - - -/*! -* \brief Adds a new point to the sub-path, which results in drawing a line from the current point to the given end-point. -* -* The value of the current point is set to the given end-point. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] x The horizontal coordinate of the end-point of the line. -* \param[in] y The vertical coordinate of the end-point of the line. - -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* -* \note In case this is the first command in the path, it corresponds to the tvg_shape_move_to() call. -*/ -TVG_API Tvg_Result tvg_shape_line_to(Tvg_Paint* paint, float x, float y); - - -/*! -* \brief Adds new points to the sub-path, which results in drawing a cubic Bezier curve. -* -* The Bezier curve starts at the current point and ends at the given end-point (@p x, @p y). Two control points (@p cx1, @p cy1) and (@p cx2, @p cy2) are used to determine the shape of the curve. -* The value of the current point is set to the given end-point. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] cx1 The horizontal coordinate of the 1st control point. -* \param[in] cy1 The vertical coordinate of the 1st control point. -* \param[in] cx2 The horizontal coordinate of the 2nd control point. -* \param[in] cy2 The vertical coordinate of the 2nd control point. -* \param[in] x The horizontal coordinate of the endpoint of the curve. -* \param[in] y The vertical coordinate of the endpoint of the curve. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* -* \note In case this is the first command in the path, no data from the path are rendered. -*/ -TVG_API Tvg_Result tvg_shape_cubic_to(Tvg_Paint* paint, float cx1, float cy1, float cx2, float cy2, float x, float y); - - -/*! -* \brief Closes the current sub-path by drawing a line from the current point to the initial point of the sub-path. -* -* The value of the current point is set to the initial point of the closed sub-path. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* -* \note In case the sub-path does not contain any points, this function has no effect. -*/ -TVG_API Tvg_Result tvg_shape_close(Tvg_Paint* paint); - - -/*! -* \brief Appends a rectangle to the path. -* -* The rectangle with rounded corners can be achieved by setting non-zero values to @p rx and @p ry arguments. -* The @p rx and @p ry values specify the radii of the ellipse defining the rounding of the corners. -* -* The position of the rectangle is specified by the coordinates of its upper left corner - @p x and @p y arguments. -* -* The rectangle is treated as a new sub-path - it is not connected with the previous sub-path. -* -* The value of the current point is set to (@p x + @p rx, @p y) - in case @p rx is greater -* than @p w/2 the current point is set to (@p x + @p w/2, @p y) -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] x The horizontal coordinate of the upper left corner of the rectangle. -* \param[in] y The vertical coordinate of the upper left corner of the rectangle. -* \param[in] w The width of the rectangle. -* \param[in] h The height of the rectangle. -* \param[in] rx The x-axis radius of the ellipse defining the rounded corners of the rectangle. -* \param[in] ry The y-axis radius of the ellipse defining the rounded corners of the rectangle. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* -& \note For @p rx and @p ry greater than or equal to the half of @p w and the half of @p h, respectively, the shape become an ellipse. -*/ -TVG_API Tvg_Result tvg_shape_append_rect(Tvg_Paint* paint, float x, float y, float w, float h, float rx, float ry); - - -/*! -* \brief Appends an ellipse to the path. -* -* The position of the ellipse is specified by the coordinates of its center - @p cx and @p cy arguments. -* -* The ellipse is treated as a new sub-path - it is not connected with the previous sub-path. -* -* The value of the current point is set to (@p cx, @p cy - @p ry). -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] cx The horizontal coordinate of the center of the ellipse. -* \param[in] cy The vertical coordinate of the center of the ellipse. -* \param[in] rx The x-axis radius of the ellipse. -* \param[in] ry The y-axis radius of the ellipse. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -*/ -TVG_API Tvg_Result tvg_shape_append_circle(Tvg_Paint* paint, float cx, float cy, float rx, float ry); - - -/*! -* \brief Appends a circular arc to the path. -* -* The arc is treated as a new sub-path - it is not connected with the previous sub-path. -* The current point value is set to the end-point of the arc in case @p pie is @c false, and to the center of the arc otherwise. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] cx The horizontal coordinate of the center of the arc. -* \param[in] cy The vertical coordinate of the center of the arc. -* \param[in] radius The radius of the arc. -* \param[in] startAngle The start angle of the arc given in degrees, measured counter-clockwise from the horizontal line. -* \param[in] sweep The central angle of the arc given in degrees, measured counter-clockwise from @p startAngle. -* \param[in] pie Specifies whether to draw radii from the arc's center to both of its end-point - drawn if @c true. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* -* \note Setting @p sweep value greater than 360 degrees, is equivalent to calling tvg_shape_append_circle(paint, cx, cy, radius, radius). -*/ -TVG_API Tvg_Result tvg_shape_append_arc(Tvg_Paint* paint, float cx, float cy, float radius, float startAngle, float sweep, uint8_t pie); - - -/*! -* \brief Appends a given sub-path to the path. -* -* The current point value is set to the last point from the sub-path. -* For each command from the @p cmds array, an appropriate number of points in @p pts array should be specified. -* If the number of points in the @p pts array is different than the number required by the @p cmds array, the shape with this sub-path will not be displayed on the screen. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] cmds The array of the commands in the sub-path. -* \param[in] cmdCnt The length of the @p cmds array. -* \param[in] pts The array of the two-dimensional points. -* \param[in] ptsCnt The length of the @p pts array. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr passed as the argument or @p cmdCnt or @p ptsCnt equal to zero. -*/ -TVG_API Tvg_Result tvg_shape_append_path(Tvg_Paint* paint, const Tvg_Path_Command* cmds, uint32_t cmdCnt, const Tvg_Point* pts, uint32_t ptsCnt); - - -/*! -* \brief Gets the points values of the path. -* -* The function does not allocate any data, it operates on internal memory. There is no need to free the @p pts array. -* -* \code -* Tvg_Shape *shape = tvg_shape_new(); -* Tvg_Point *coords = NULL; -* uint32_t len = 0; -* -* tvg_shape_append_circle(shape, 10, 10, 50, 50); -* tvg_shape_get_path_coords(shape, (const Tvg_Point**)&coords, &len); -* //TVG approximates a circle by four Bezier curves. In the example above the coords array stores their coordinates. -* \endcode -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] pts The pointer to the array of the two-dimensional points from the path. -* \param[out] cnt The length of the @p pts array. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr passed as the argument. -*/ -TVG_API Tvg_Result tvg_shape_get_path_coords(const Tvg_Paint* paint, const Tvg_Point** pts, uint32_t* cnt); - - -/*! -* \brief Gets the commands data of the path. -* -* The function does not allocate any data. There is no need to free the @p cmds array. -* -* \code -* Tvg_Shape *shape = tvg_shape_new(); -* Tvg_Path_Command *cmds = NULL; -* uint32_t len = 0; -* -* tvg_shape_append_circle(shape, 10, 10, 50, 50); -* tvg_shape_get_path_commands(shape, (const Tvg_Path_Command**)&cmds, &len); -* //TVG approximates a circle by four Bezier curves. In the example above the cmds array stores the commands of the path data. -* \endcode -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] cmds The pointer to the array of the commands from the path. -* \param[out] cnt The length of the @p cmds array. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr passed as the argument. -*/ -TVG_API Tvg_Result tvg_shape_get_path_commands(const Tvg_Paint* paint, const Tvg_Path_Command** cmds, uint32_t* cnt); - - -/*! -* \brief Sets the stroke width for all of the figures from the @p paint. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] width The width of the stroke. The default value is 0. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with a memory allocation. -*/ -TVG_API Tvg_Result tvg_shape_set_stroke_width(Tvg_Paint* paint, float width); - - -/*! -* \brief Gets the shape's stroke width. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] width The stroke width. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid pointer passed as an argument. -*/ -TVG_API Tvg_Result tvg_shape_get_stroke_width(const Tvg_Paint* paint, float* width); - - -/*! -* \brief Sets the shape's stroke color. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] r The red color channel value in the range [0 ~ 255]. The default value is 0. -* \param[in] g The green color channel value in the range [0 ~ 255]. The default value is 0. -* \param[in] b The blue color channel value in the range [0 ~ 255]. The default value is 0. -* \param[in] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with a memory allocation. -* -* \note Either a solid color or a gradient fill is applied, depending on what was set as last. -*/ -TVG_API Tvg_Result tvg_shape_set_stroke_color(Tvg_Paint* paint, uint8_t r, uint8_t g, uint8_t b, uint8_t a); - - -/*! -* \brief Gets the shape's stroke color. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] r The red color channel value in the range [0 ~ 255]. The default value is 0. -* \param[out] g The green color channel value in the range [0 ~ 255]. The default value is 0. -* \param[out] b The blue color channel value in the range [0 ~ 255]. The default value is 0. -* \param[out] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION No stroke was set. -*/ -TVG_API Tvg_Result tvg_shape_get_stroke_color(const Tvg_Paint* paint, uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a); - - -/*! -* \brief Sets the linear gradient fill of the stroke for all of the figures from the path. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] grad The linear gradient fill. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with a memory allocation. -* \retval TVG_RESULT_MEMORY_CORRUPTION An invalid Tvg_Gradient pointer. -* -* \note Either a solid color or a gradient fill is applied, depending on what was set as last. -*/ -TVG_API Tvg_Result tvg_shape_set_stroke_linear_gradient(Tvg_Paint* paint, Tvg_Gradient* grad); - - -/*! -* \brief Sets the radial gradient fill of the stroke for all of the figures from the path. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] grad The radial gradient fill. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with a memory allocation. -* \retval TVG_RESULT_MEMORY_CORRUPTION An invalid Tvg_Gradient pointer. -* -* \note Either a solid color or a gradient fill is applied, depending on what was set as last. -*/ -TVG_API Tvg_Result tvg_shape_set_stroke_radial_gradient(Tvg_Paint* paint, Tvg_Gradient* grad); - - -/*! -* \brief Gets the gradient fill of the shape's stroke. -* -* The function does not allocate any memory. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] grad The gradient fill. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid pointer passed as an argument. -*/ -TVG_API Tvg_Result tvg_shape_get_stroke_gradient(const Tvg_Paint* paint, Tvg_Gradient** grad); - - -/*! -* \brief Sets the shape's stroke dash pattern. -* -* \code -* //dash pattern examples -* float dashPattern[2] = {20, 10}; // -- -- -- -* float dashPattern[2] = {40, 20}; // ---- ---- ---- -* float dashPattern[4] = {10, 20, 30, 40} // - --- - --- -* \endcode -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] dashPattern The array of consecutive pair values of the dash length and the gap length. -* \param[in] cnt The size of the @p dashPattern array. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid pointer passed as an argument and @p cnt > 0, the given length of the array is less than two or any of the @p dashPattern values is zero or less. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with a memory allocation. -* -* \note To reset the stroke dash pattern, pass @c nullptr to @p dashPattern and zero to @p cnt. -*/ -TVG_API Tvg_Result tvg_shape_set_stroke_dash(Tvg_Paint* paint, const float* dashPattern, uint32_t cnt); - - -/*! -* \brief Gets the dash pattern of the stroke. -* -* The function does not allocate any memory. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] dashPattern The array of consecutive pair values of the dash length and the gap length. -* \param[out] cnt The size of the @p dashPattern array. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid pointer passed as an argument. -*/ -TVG_API Tvg_Result tvg_shape_get_stroke_dash(const Tvg_Paint* paint, const float** dashPattern, uint32_t* cnt); - - -/*! -* \brief Sets the cap style used for stroking the path. -* -* The cap style specifies the shape to be used at the end of the open stroked sub-paths. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] cap The cap style value. The default value is @c TVG_STROKE_CAP_SQUARE. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with a memory allocation. -*/ -TVG_API Tvg_Result tvg_shape_set_stroke_cap(Tvg_Paint* paint, Tvg_Stroke_Cap cap); - - -/*! -* \brief Gets the stroke cap style used for stroking the path. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] cap The cap style value. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid pointer passed as an argument. -*/ -TVG_API Tvg_Result tvg_shape_get_stroke_cap(const Tvg_Paint* paint, Tvg_Stroke_Cap* cap); - - -/*! -* \brief Sets the join style for stroked path segments. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] join The join style value. The default value is @c TVG_STROKE_JOIN_BEVEL. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with a memory allocation. -*/ -TVG_API Tvg_Result tvg_shape_set_stroke_join(Tvg_Paint* paint, Tvg_Stroke_Join join); - - -/*! -* \brief The function gets the stroke join method -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] join The join style value. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid pointer passed as an argument. -*/ -TVG_API Tvg_Result tvg_shape_get_stroke_join(const Tvg_Paint* paint, Tvg_Stroke_Join* join); - - -/*! -* \brief Sets the stroke miterlimit. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] miterlimit The miterlimit imposes a limit on the extent of the stroke join when the @c TVG_STROKE_JOIN_MITER join style is set. The default value is 4. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_NOT_SUPPORTED Unsupported value. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with a memory allocation. -* -* \since 0.11 -*/ -TVG_API Tvg_Result tvg_shape_set_stroke_miterlimit(Tvg_Paint* paint, float miterlimit); - - -/*! -* \brief The function gets the stroke miterlimit. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] miterlimit The stroke miterlimit. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid pointer passed as an argument. -* -* \since 0.11 -*/ -TVG_API Tvg_Result tvg_shape_get_stroke_miterlimit(const Tvg_Paint* paint, float* miterlimit); - - -/*! -* \brief Sets the shape's solid color. -* -* The parts of the shape defined as inner are colored. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] r The red color channel value in the range [0 ~ 255]. The default value is 0. -* \param[in] g The green color channel value in the range [0 ~ 255]. The default value is 0. -* \param[in] b The blue color channel value in the range [0 ~ 255]. The default value is 0. -* \param[in] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. The default value is 0. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* -* \note Either a solid color or a gradient fill is applied, depending on what was set as last. -* \see tvg_shape_set_fill_rule() -*/ -TVG_API Tvg_Result tvg_shape_set_fill_color(Tvg_Paint* paint, uint8_t r, uint8_t g, uint8_t b, uint8_t a); - - -/*! -* \brief Gets the shape's solid color. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] r The red color channel value in the range [0 ~ 255]. The default value is 0. -* \param[out] g The green color channel value in the range [0 ~ 255]. The default value is 0. -* \param[out] b The blue color channel value in the range [0 ~ 255]. The default value is 0. -* \param[out] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. The default value is 0. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -*/ -TVG_API Tvg_Result tvg_shape_get_fill_color(const Tvg_Paint* paint, uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a); - - -/*! -* \brief Sets the shape's fill rule. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] rule The fill rule value. The default value is @c TVG_FILL_RULE_WINDING. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -*/ -TVG_API Tvg_Result tvg_shape_set_fill_rule(Tvg_Paint* paint, Tvg_Fill_Rule rule); - - -/*! -* \brief Gets the shape's fill rule. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] rule shape's fill rule -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid pointer passed as an argument. -*/ -TVG_API Tvg_Result tvg_shape_get_fill_rule(const Tvg_Paint* paint, Tvg_Fill_Rule* rule); - - -/*! -* \brief Sets the rendering order of the stroke and the fill. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] strokeFirst If @c true the stroke is rendered before the fill, otherwise the stroke is rendered as the second one (the default option). -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with a memory allocation. -* -* \since 0.10 -*/ -TVG_API Tvg_Result tvg_shape_set_paint_order(Tvg_Paint* paint, bool strokeFirst); - - -/*! -* \brief Sets the linear gradient fill for all of the figures from the path. -* -* The parts of the shape defined as inner are filled. -* -* \code -* Tvg_Gradient* grad = tvg_linear_gradient_new(); -* tvg_linear_gradient_set(grad, 700, 700, 800, 800); -* Tvg_Color_Stop color_stops[4] = -* { -* {0.0 , 0, 0, 0, 255}, -* {0.25, 255, 0, 0, 255}, -* {0.5 , 0, 255, 0, 255}, -* {1.0 , 0, 0, 255, 255} -* }; -* tvg_gradient_set_color_stops(grad, color_stops, 4); -* tvg_shape_set_linear_gradient(shape, grad); -* \endcode -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] grad The linear gradient fill. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_MEMORY_CORRUPTION An invalid Tvg_Gradient pointer. -* -* \note Either a solid color or a gradient fill is applied, depending on what was set as last. -* \see tvg_shape_set_fill_rule() -*/ -TVG_API Tvg_Result tvg_shape_set_linear_gradient(Tvg_Paint* paint, Tvg_Gradient* grad); - - -/*! -* \brief Sets the radial gradient fill for all of the figures from the path. -* -* The parts of the shape defined as inner are filled. -* -* \code -* Tvg_Gradient* grad = tvg_radial_gradient_new(); -* tvg_radial_gradient_set(grad, 550, 550, 50); -* Tvg_Color_Stop color_stops[4] = -* { -* {0.0 , 0, 0, 0, 255}, -* {0.25, 255, 0, 0, 255}, -* {0.5 , 0, 255, 0, 255}, -* {1.0 , 0, 0, 255, 255} -* }; -* tvg_gradient_set_color_stops(grad, color_stops, 4); -* tvg_shape_set_radial_gradient(shape, grad); -* \endcode -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[in] grad The radial gradient fill. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_MEMORY_CORRUPTION An invalid Tvg_Gradient pointer. -* -* \note Either a solid color or a gradient fill is applied, depending on what was set as last. -* \see tvg_shape_set_fill_rule() -*/ -TVG_API Tvg_Result tvg_shape_set_radial_gradient(Tvg_Paint* paint, Tvg_Gradient* grad); - - -/*! -* \brief Gets the gradient fill of the shape. -* -* The function does not allocate any data. -* -* \param[in] paint A Tvg_Paint pointer to the shape object. -* \param[out] grad The gradient fill. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid pointer passed as an argument. -*/ -TVG_API Tvg_Result tvg_shape_get_gradient(const Tvg_Paint* paint, Tvg_Gradient** grad); - - -/** \} */ // end defgroup ThorVGCapi_Shape - - -/** -* \defgroup ThorVGCapi_Gradient Gradient -* \brief A module managing the gradient fill of objects. -* -* The module enables to set and to get the gradient colors and their arrangement inside the gradient bounds, -* to specify the gradient bounds and the gradient behavior in case the area defined by the gradient bounds -* is smaller than the area to be filled. -* -* \{ -*/ - -/************************************************************************/ -/* Gradient API */ -/************************************************************************/ -/*! -* \brief Creates a new linear gradient object. -* -* \code -* Tvg_Paint* shape = tvg_shape_new(); -* tvg_shape_append_rect(shape, 700, 700, 100, 100, 20, 20); -* Tvg_Gradient* grad = tvg_linear_gradient_new(); -* tvg_linear_gradient_set(grad, 700, 700, 800, 800); -* Tvg_Color_Stop color_stops[2] = -* { -* {0.0, 0, 0, 0, 255}, -* {1.0, 0, 255, 0, 255}, -* }; -* tvg_gradient_set_color_stops(grad, color_stops, 2); -* tvg_shape_set_linear_gradient(shape, grad); -* \endcode -* -* \return A new linear gradient object. -*/ -TVG_API Tvg_Gradient* tvg_linear_gradient_new(void); - - -/*! -* \brief Creates a new radial gradient object. -* -* \code -* Tvg_Paint* shape = tvg_shape_new(); -* tvg_shape_append_rect(shape, 700, 700, 100, 100, 20, 20); -* Tvg_Gradient* grad = tvg_radial_gradient_new(); -* tvg_radial_gradient_set(grad, 550, 550, 50); -* Tvg_Color_Stop color_stops[2] = -* { -* {0.0, 0, 0, 0, 255}, -* {1.0, 0, 255, 0, 255}, -* }; -* tvg_gradient_set_color_stops(grad, color_stops, 2); -* tvg_shape_set_radial_gradient(shape, grad); -* \endcode -* -* \return A new radial gradient object. -*/ -TVG_API Tvg_Gradient* tvg_radial_gradient_new(void); - - -/*! -* \brief Sets the linear gradient bounds. -* -* The bounds of the linear gradient are defined as a surface constrained by two parallel lines crossing -* the given points (@p x1, @p y1) and (@p x2, @p y2), respectively. Both lines are perpendicular to the line linking -* (@p x1, @p y1) and (@p x2, @p y2). -* -* \param[in] grad The Tvg_Gradient object of which bounds are to be set. -* @param[in] x1 The horizontal coordinate of the first point used to determine the gradient bounds. -* @param[in] y1 The vertical coordinate of the first point used to determine the gradient bounds. -* @param[in] x2 The horizontal coordinate of the second point used to determine the gradient bounds. -* @param[in] y2 The vertical coordinate of the second point used to determine the gradient bounds. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Gradient pointer. -* -* \note In case the first and the second points are equal, an object filled with such a gradient fill is not rendered. -*/ -TVG_API Tvg_Result tvg_linear_gradient_set(Tvg_Gradient* grad, float x1, float y1, float x2, float y2); - - -/*! -* \brief Gets the linear gradient bounds. -* -* The bounds of the linear gradient are defined as a surface constrained by two parallel lines crossing -* the given points (@p x1, @p y1) and (@p x2, @p y2), respectively. Both lines are perpendicular to the line linking -* (@p x1, @p y1) and (@p x2, @p y2). -* -* \param[in] grad The Tvg_Gradient object of which to get the bounds. -* \param[out] x1 The horizontal coordinate of the first point used to determine the gradient bounds. -* \param[out] y1 The vertical coordinate of the first point used to determine the gradient bounds. -* \param[out] x2 The horizontal coordinate of the second point used to determine the gradient bounds. -* \param[out] y2 The vertical coordinate of the second point used to determine the gradient bounds. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Gradient pointer. -*/ -TVG_API Tvg_Result tvg_linear_gradient_get(Tvg_Gradient* grad, float* x1, float* y1, float* x2, float* y2); - - -/*! -* \brief Sets the radial gradient bounds. -* -* The radial gradient bounds are defined as a circle centered in a given point (@p cx, @p cy) of a given radius. -* -* \param[in] grad The Tvg_Gradient object of which bounds are to be set. -* \param[in] cx The horizontal coordinate of the center of the bounding circle. -* \param[in] cy The vertical coordinate of the center of the bounding circle. -* \param[in] radius The radius of the bounding circle. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Gradient pointer or the @p radius value less than zero. -*/ -TVG_API Tvg_Result tvg_radial_gradient_set(Tvg_Gradient* grad, float cx, float cy, float radius); - - -/*! -* \brief The function gets radial gradient center point ant radius -* -* \param[in] grad The Tvg_Gradient object of which bounds are to be set. -* \param[out] cx The horizontal coordinate of the center of the bounding circle. -* \param[out] cy The vertical coordinate of the center of the bounding circle. -* \param[out] radius The radius of the bounding circle. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Gradient pointer. -*/ -TVG_API Tvg_Result tvg_radial_gradient_get(Tvg_Gradient* grad, float* cx, float* cy, float* radius); - - -/*! -* \brief Sets the parameters of the colors of the gradient and their position. -* -* \param[in] grad The Tvg_Gradient object of which the color information is to be set. -* \param[in] color_stop An array of Tvg_Color_Stop data structure. -* \param[in] cnt The size of the @p color_stop array equal to the colors number used in the gradient. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Gradient pointer. -*/ -TVG_API Tvg_Result tvg_gradient_set_color_stops(Tvg_Gradient* grad, const Tvg_Color_Stop* color_stop, uint32_t cnt); - - -/*! -* \brief Gets the parameters of the colors of the gradient, their position and number -* -* The function does not allocate any memory. -* -* \param[in] grad The Tvg_Gradient object of which to get the color information. -* \param[out] color_stop An array of Tvg_Color_Stop data structure. -* \param[out] cnt The size of the @p color_stop array equal to the colors number used in the gradient. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr passed as the argument. -*/ -TVG_API Tvg_Result tvg_gradient_get_color_stops(const Tvg_Gradient* grad, const Tvg_Color_Stop** color_stop, uint32_t* cnt); - - -/*! -* \brief Sets the Tvg_Stroke_Fill value, which specifies how to fill the area outside the gradient bounds. -* -* \param[in] grad The Tvg_Gradient object. -* \param[in] spread The FillSpread value. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Gradient pointer. -*/ -TVG_API Tvg_Result tvg_gradient_set_spread(Tvg_Gradient* grad, const Tvg_Stroke_Fill spread); - - -/*! -* \brief Gets the FillSpread value of the gradient object. -* -* \param[in] grad The Tvg_Gradient object. -* \param[out] spread The FillSpread value. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr passed as the argument. -*/ -TVG_API Tvg_Result tvg_gradient_get_spread(const Tvg_Gradient* grad, Tvg_Stroke_Fill* spread); - - -/*! -* \brief Sets the matrix of the affine transformation for the gradient object. -* -* The augmented matrix of the transformation is expected to be given. -* -* \param[in] grad The Tvg_Gradient object to be transformed. -* \param[in] m The 3x3 augmented matrix. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr is passed as the argument. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with a memory allocation. -*/ -TVG_API Tvg_Result tvg_gradient_set_transform(Tvg_Gradient* grad, const Tvg_Matrix* m); - - -/*! -* \brief Gets the matrix of the affine transformation of the gradient object. -* -* In case no transformation was applied, the identity matrix is set. -* -* \param[in] grad The Tvg_Gradient object of which to get the transformation matrix. -* \param[out] m The 3x3 augmented matrix. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr is passed as the argument. -*/ -TVG_API Tvg_Result tvg_gradient_get_transform(const Tvg_Gradient* grad, Tvg_Matrix* m); - -/** -* \brief Gets the unique id value of the gradient instance indicating the instance type. -* -* \param[in] grad The Tvg_Gradient object of which to get the identifier value. -* \param[out] identifier The unique identifier of the gradient instance type. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument. -* -* \since 0.9 -*/ -TVG_API Tvg_Result tvg_gradient_get_identifier(const Tvg_Gradient* grad, Tvg_Identifier* identifier); - - -/*! -* \brief Duplicates the given Tvg_Gradient object. -* -* Creates a new object and sets its all properties as in the original object. -* -* \param[in] grad The Tvg_Gradient object to be copied. -* -* \return A copied Tvg_Gradient object if succeed, @c nullptr otherwise. -*/ -TVG_API Tvg_Gradient* tvg_gradient_duplicate(Tvg_Gradient* grad); - - -/*! -* \brief Deletes the given gradient object. -* -* \param[in] grad The gradient object to be deleted. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Gradient pointer. -*/ -TVG_API Tvg_Result tvg_gradient_del(Tvg_Gradient* grad); - - -/** \} */ // end defgroup ThorVGCapi_Gradient - - -/** -* \defgroup ThorVGCapi_Picture Picture -* -* \brief A module enabling to create and to load an image in one of the supported formats: svg, png, jpg, lottie and raw. -* -* -* \{ -*/ - -/************************************************************************/ -/* Picture API */ -/************************************************************************/ -/*! -* \brief Creates a new picture object. -* -* \return A new picture object. -*/ -TVG_API Tvg_Paint* tvg_picture_new(void); - - -/*! -* \brief Loads a picture data directly from a file. -* -* ThorVG efficiently caches the loaded data using the specified @p path as a key. -* This means that loading the same file again will not result in duplicate operations; -* instead, ThorVG will reuse the previously loaded picture data. -* -* \param[in] paint A Tvg_Paint pointer to the picture object. -* \param[in] path The absolute path to the image file. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer or an empty @p path. -* \retval TVG_RESULT_NOT_SUPPORTED A file with an unknown extension. -* \retval TVG_RESULT_UNKNOWN An error at a later stage. -*/ -TVG_API Tvg_Result tvg_picture_load(Tvg_Paint* paint, const char* path); - - -/*! -* \brief Loads a picture data from a memory block of a given size. -* -* ThorVG efficiently caches the loaded data using the specified @p data address as a key -* when the @p copy has @c false. This means that loading the same data again will not result in duplicate operations -* for the sharable @p data. Instead, ThorVG will reuse the previously loaded picture data. -* -* \param[in] paint A Tvg_Paint pointer to the picture object. -* \param[in] data A pointer to a memory location where the content of the picture raw data is stored. -* \param[in] w The width of the image @p data in pixels. -* \param[in] h The height of the image @p data in pixels. -* \param[in] premultiplied If @c true, the given image data is alpha-premultiplied. -* \param[in] copy If @c true the data are copied into the engine local buffer, otherwise they are not. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer or no data are provided or the @p width or @p height value is zero or less. -* \retval TVG_RESULT_FAILED_ALLOCATION A problem with memory allocation occurs. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION An error occurs at a later stage. -* -* \since 0.9 -*/ -TVG_API Tvg_Result tvg_picture_load_raw(Tvg_Paint* paint, uint32_t *data, uint32_t w, uint32_t h, bool copy); - - -/*! -* \brief Loads a picture data from a memory block of a given size. -* -* ThorVG efficiently caches the loaded data using the specified @p data address as a key -* when the @p copy has @c false. This means that loading the same data again will not result in duplicate operations -* for the sharable @p data. Instead, ThorVG will reuse the previously loaded picture data. -* -* \param[in] paint A Tvg_Paint pointer to the picture object. -* \param[in] data A pointer to a memory location where the content of the picture file is stored. -* \param[in] size The size in bytes of the memory occupied by the @p data. -* \param[in] mimetype Mimetype or extension of data such as "jpg", "jpeg", "svg", "svg+xml", "lottie", "png", etc. In case an empty string or an unknown type is provided, the loaders will be tried one by one. -* \param[in] copy If @c true the data are copied into the engine local buffer, otherwise they are not. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument or the @p size is zero or less. -* \retval TVG_RESULT_NOT_SUPPORTED A file with an unknown extension. -* \retval TVG_RESULT_UNKNOWN An error at a later stage. -* -* \warning: It's the user responsibility to release the @p data memory if the @p copy is @c true. -*/ -TVG_API Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size, const char *mimetype, bool copy); - - -/*! -* \brief Resizes the picture content to the given width and height. -* -* The picture content is resized while keeping the default size aspect ratio. -* The scaling factor is established for each of dimensions and the smaller value is applied to both of them. -* -* \param[in] paint A Tvg_Paint pointer to the picture object. -* \param[in] w A new width of the image in pixels. -* \param[in] h A new height of the image in pixels. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION An internal error. -*/ -TVG_API Tvg_Result tvg_picture_set_size(Tvg_Paint* paint, float w, float h); - - -/*! -* \brief Gets the size of the loaded picture. -* -* \param[in] paint A Tvg_Paint pointer to the picture object. -* \param[out] w A width of the image in pixels. -* \param[out] h A height of the image in pixels. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -*/ -TVG_API Tvg_Result tvg_picture_get_size(const Tvg_Paint* paint, float* w, float* h); - - -/** \} */ // end defgroup ThorVGCapi_Picture - - -/** -* \defgroup ThorVGCapi_Scene Scene -* \brief A module managing the multiple paints as one group paint. -* -* As a group, scene can be transformed, translucent, composited with other target paints, -* its children will be affected by the scene world. -* -* \{ -*/ - -/************************************************************************/ -/* Scene API */ -/************************************************************************/ -/*! -* \brief Creates a new scene object. -* -* A scene object is used to group many paints into one object, which can be manipulated using TVG APIs. -* -* \return A new scene object. -*/ -TVG_API Tvg_Paint* tvg_scene_new(void); - - -/*! -* \brief Sets the size of the container, where all the paints pushed into the scene are stored. -* -* If the number of objects pushed into the scene is known in advance, calling the function -* prevents multiple memory reallocation, thus improving the performance. -* -* \param[in] scene A Tvg_Paint pointer to the scene object. -* \param[in] size The number of objects for which the memory is to be reserved. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with a memory allocation. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer. -*/ -TVG_DEPRECATED TVG_API Tvg_Result tvg_scene_reserve(Tvg_Paint* scene, uint32_t size); - - -/*! -* \brief Passes drawing elements to the scene using Tvg_Paint objects. -* -* Only the paints pushed into the scene will be the drawn targets. -* The paints are retained by the scene until the tvg_scene_clear() is called. -* If you know the number of pushed objects in advance, please call tvg_scene_reserve(). -* -* \param[in] scene A Tvg_Paint pointer to the scene object. -* \param[in] paint A graphical object to be drawn. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr passed as the argument. -* \retval TVG_RESULT_MEMORY_CORRUPTION An internal error. -* -* \note The rendering order of the paints is the same as the order as they were pushed. Consider sorting the paints before pushing them if you intend to use layering. -*/ -TVG_API Tvg_Result tvg_scene_push(Tvg_Paint* scene, Tvg_Paint* paint); - - -/*! -* \brief Clears a Tvg_Scene objects from pushed paints. -* -* Tvg_Paint objects stored in the scene are released if @p free is set to @c true, otherwise the memory is not deallocated and -* all paints should be released manually in order to avoid memory leaks. -* -* \param[in] scene The Tvg_Scene object to be cleared. -* \param[in] free If @c true the memory occupied by paints is deallocated, otherwise it is not. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Canvas pointer. -* -* \warning Please use the @p free argument only when you know how it works, otherwise it's not recommended. -*/ -TVG_API Tvg_Result tvg_scene_clear(Tvg_Paint* scene, bool free); - -/** \} */ // end defgroup ThorVGCapi_Scene - - -/** -* \defgroup ThorVGCapi_Saver Saver -* \brief A module for exporting a paint object into a specified file. -* -* The module enables to save the composed scene and/or image from a paint object. -* Once it's successfully exported to a file, it can be recreated using the Picture module. -* -* \{ -*/ - -/************************************************************************/ -/* Saver API */ -/************************************************************************/ -/*! -* \brief Creates a new Tvg_Saver object. -* -* \return A new Tvg_Saver object. -*/ -TVG_API Tvg_Saver* tvg_saver_new(void); - - -/*! -* \brief Exports the given @p paint data to the given @p path -* -* If the saver module supports any compression mechanism, it will optimize the data size. -* This might affect the encoding/decoding time in some cases. You can turn off the compression -* if you wish to optimize for speed. -* -* \param[in] saver The Tvg_Saver object connected with the saving task. -* \param[in] paint The paint to be saved with all its associated properties. -* \param[in] path A path to the file, in which the paint data is to be saved. -* \param[in] compress If @c true then compress data if possible. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr passed as the argument. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION Currently saving other resources. -* \retval TVG_RESULT_NOT_SUPPORTED Trying to save a file with an unknown extension or in an unsupported format. -* \retval TVG_RESULT_MEMORY_CORRUPTION An internal error. -* \retval TVG_RESULT_UNKNOWN An empty paint is to be saved. -* -* \note Saving can be asynchronous if the assigned thread number is greater than zero. To guarantee the saving is done, call tvg_saver_sync() afterwards. -* \see tvg_saver_sync() -*/ -TVG_API Tvg_Result tvg_saver_save(Tvg_Saver* saver, Tvg_Paint* paint, const char* path, bool compress); - - -/*! -* \brief Guarantees that the saving task is finished. -* -* The behavior of the Saver module works on a sync/async basis, depending on the threading setting of the Initializer. -* Thus, if you wish to have a benefit of it, you must call tvg_saver_sync() after the tvg_saver_save() in the proper delayed time. -* Otherwise, you can call tvg_saver_sync() immediately. -* -* \param[in] saver The Tvg_Saver object connected with the saving task. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr passed as the argument. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION No saving task is running. -* -* \note The asynchronous tasking is dependent on the Saver module implementation. -* \see tvg_saver_save() -*/ -TVG_API Tvg_Result tvg_saver_sync(Tvg_Saver* saver); - - -/*! -* \brief Deletes the given Tvg_Saver object. -* -* \param[in] saver The Tvg_Saver object to be deleted. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Saver pointer. -*/ -TVG_API Tvg_Result tvg_saver_del(Tvg_Saver* saver); - - -/** \} */ // end defgroup ThorVGCapi_Saver - - -/** -* \defgroup ThorVGCapi_Animation Animation -* \brief A module for manipulation of animatable images. -* -* The module supports the display and control of animation frames. -* -* \{ -*/ - -/************************************************************************/ -/* Animation API */ -/************************************************************************/ - -/*! -* \brief Creates a new Animation object. -* -* \return Tvg_Animation A new Tvg_Animation object. -* -* \since 0.13 -*/ -TVG_API Tvg_Animation* tvg_animation_new(void); - - -/*! -* \brief Specifies the current frame in the animation. -* -* \param[in] animation A Tvg_Animation pointer to the animation object. -* \param[in] no The index of the animation frame to be displayed. The index should be less than the tvg_animation_total_frame(). -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Animation pointer. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION No animatable data loaded from the Picture. -* \retval TVG_RESULT_NOT_SUPPORTED The picture data does not support animations. -* -* \note For efficiency, ThorVG ignores updates to the new frame value if the difference from the current frame value -* is less than 0.001. In such cases, it returns @c Result::InsufficientCondition. -* Values less than 0.001 may be disregarded and may not be accurately retained by the Animation. -* \see tvg_animation_get_total_frame() -* -* \since 0.13 -*/ -TVG_API Tvg_Result tvg_animation_set_frame(Tvg_Animation* animation, float no); - - -/*! -* \brief Retrieves a picture instance associated with this animation instance. -* -* This function provides access to the picture instance that can be used to load animation formats, such as Lottie(json). -* After setting up the picture, it can be pushed to the designated canvas, enabling control over animation frames -* with this Animation instance. -* -* \param[in] animation A Tvg_Animation pointer to the animation object. -* -* \return A picture instance that is tied to this animation. -* -* \warning The picture instance is owned by Animation. It should not be deleted manually. -* -* \since 0.13 -*/ -TVG_API Tvg_Paint* tvg_animation_get_picture(Tvg_Animation* animation); - - -/*! -* \brief Retrieves the current frame number of the animation. -* -* \param[in] animation A Tvg_Animation pointer to the animation object. -* \param[in] no The current frame number of the animation, between 0 and totalFrame() - 1. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Animation pointer or @p no -* -* \see tvg_animation_get_total_frame() -* \see tvg_animation_set_frame() -* -* \since 0.13 -*/ -TVG_API Tvg_Result tvg_animation_get_frame(Tvg_Animation* animation, float* no); - - -/*! -* \brief Retrieves the total number of frames in the animation. -* -* \param[in] animation A Tvg_Animation pointer to the animation object. -* \param[in] cnt The total number of frames in the animation. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Animation pointer or @p cnt. -* -* \note Frame numbering starts from 0. -* \note If the Picture is not properly configured, this function will return 0. -* -* \since 0.13 -*/ -TVG_API Tvg_Result tvg_animation_get_total_frame(Tvg_Animation* animation, float* cnt); - - -/*! -* \brief Retrieves the duration of the animation in seconds. -* -* \param[in] animation A Tvg_Animation pointer to the animation object. -* \param[in] duration The duration of the animation in seconds. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Animation pointer or @p duration. -* -* \note If the Picture is not properly configured, this function will return 0. -* -* \since 0.13 -*/ -TVG_API Tvg_Result tvg_animation_get_duration(Tvg_Animation* animation, float* duration); - - -/*! -* \brief Specifies the playback segment of the animation. (Experimental API) -* -* \param[in] animation The Tvg_Animation pointer to the animation object. -* \param[in] begin segment begin. -* \param[in] end segment end. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION In case the animation is not loaded. -* \retval TVG_RESULT_INVALID_ARGUMENT When the given parameters are out of range. -* -* \since 0.13 -*/ -TVG_API Tvg_Result tvg_animation_set_segment(Tvg_Animation* animation, float begin, float end); - - -/*! -* \brief Gets the current segment. (Experimental API) -* -* \param[in] animation The Tvg_Animation pointer to the animation object. -* \param[out] begin segment begin. -* \param[out] end segment end. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION In case the animation is not loaded. -* \retval TVG_RESULT_INVALID_ARGUMENT When the given parameters are @c nullptr. -*/ -TVG_API Tvg_Result tvg_animation_get_segment(Tvg_Animation* animation, float* begin, float* end); - - -/*! -* \brief Deletes the given Tvg_Animation object. -* -* \param[in] animation The Tvg_Animation object to be deleted. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Animation pointer. -* -* \since 0.13 -*/ -TVG_API Tvg_Result tvg_animation_del(Tvg_Animation* animation); - - -/** \} */ // end defgroup ThorVGCapi_Animation - - -/** -* \defgroup ThorVGCapi_LottieAnimation LottieAnimation -* \brief A module for manipulation of lottie extension features. -* -* The module enables control of advanced Lottie features. -* \{ -*/ - -/************************************************************************/ -/* LottieAnimation Extension API */ -/************************************************************************/ - -/*! -* \brief Creates a new LottieAnimation object. (Experimental API) -* -* \return Tvg_Animation A new Tvg_LottieAnimation object. -*/ -TVG_API Tvg_Animation* tvg_lottie_animation_new(void); - - -/*! -* \brief Override the lottie properties through the slot data. (Experimental API) -* -* \param[in] animation The Tvg_Animation object to override the property with the slot. -* \param[in] slot The Lottie slot data in json, or @c nullptr to reset. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION In case the animation is not loaded. -* \retval TVG_RESULT_INVALID_ARGUMENT When the given @p slot is invalid -* \retval TVG_RESULT_NOT_SUPPORTED The Lottie Animation is not supported. -*/ -TVG_API Tvg_Result tvg_lottie_animation_override(Tvg_Animation* animation, const char* slot); - - -/*! -* \brief Specifies a segment by marker. (Experimental API) -* -* \param[in] animation The Tvg_Animation pointer to the Lottie animation object. -* \param[in] marker The name of the segment marker. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INSUFFICIENT_CONDITION In case the animation is not loaded. -* \retval TVG_RESULT_INVALID_ARGUMENT When the given @p marker is invalid. -* \retval TVG_RESULT_NOT_SUPPORTED The Lottie Animation is not supported. -*/ -TVG_API Tvg_Result tvg_lottie_animation_set_marker(Tvg_Animation* animation, const char* marker); - - -/*! -* \brief Gets the marker count of the animation. (Experimental API) -* -* \param[in] animation The Tvg_Animation pointer to the Lottie animation object. -* \param[out] cnt The count value of the markers. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT In case a @c nullptr is passed as the argument. -*/ -TVG_API Tvg_Result tvg_lottie_animation_get_markers_cnt(Tvg_Animation* animation, uint32_t* cnt); - - -/*! -* \brief Gets the marker name by a given index. (Experimental API) -* -* \param[in] animation The Tvg_Animation pointer to the Lottie animation object. -* \param[in] idx The index of the animation marker, starts from 0. -* \param[out] name The name of marker when succeed. -* -* \return Tvg_Result enumeration. -* \retval TVG_RESULT_SUCCESS Succeed. -* \retval TVG_RESULT_INVALID_ARGUMENT In case @c nullptr is passed as the argument or @c idx is out of range. -*/ -TVG_API Tvg_Result tvg_lottie_animation_get_marker(Tvg_Animation* animation, uint32_t idx, const char** name); - - -/** \} */ // end addtogroup ThorVGCapi_LottieAnimation - - -/** \} */ // end defgroup ThorVGCapi - - -#ifdef __cplusplus -} -#endif - -#endif //_THORVG_CAPI_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/thorvg_lottie.h b/L3_Middlewares/LVGL/src/libs/thorvg/thorvg_lottie.h deleted file mode 100644 index b69410a..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/thorvg_lottie.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef _THORVG_LOTTIE_H_ -#define _THORVG_LOTTIE_H_ - -#include "thorvg.h" - -namespace tvg -{ - -/** - * @class LottieAnimation - * - * @brief The LottieAnimation class enables control of advanced Lottie features. - * - * This class extends the Animation and has additional interfaces. - * - * @see Animation - * - * @note Experimental API - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL -class TVG_API LottieAnimation final : public Animation -{ -public: - ~LottieAnimation(); - - /** - * @brief Override Lottie properties using slot data. - * - * @param[in] slot The Lottie slot data in JSON format to override, or @c nullptr to reset. - * - * @retval Result::Success When succeed. - * @retval Result::InsufficientCondition In case the animation is not loaded. - * @retval Result::InvalidArguments When the given parameter is invalid. - * - * @note Experimental API - */ - Result override(const char* slot) noexcept; - - /** - * @brief Specifies a segment by marker. - * - * Markers are used to control animation playback by specifying start and end points, - * eliminating the need to know the exact frame numbers. - * Generally, markers are designated at the design level, - * meaning the callers must know the marker name in advance to use it. - * - * @param[in] marker The name of the segment marker. - * - * @retval Result::Success When successful. - * @retval Result::InsufficientCondition If the animation is not loaded. - * @retval Result::InvalidArguments When the given parameter is invalid. - * @retval Result::NonSupport When it's not animatable. - * - * @note If a @c marker is specified, the previously set segment will be disregarded. - * @note Set @c nullptr to reset the specified segment. - * @see Animation::segment(float begin, float end) - * @note Experimental API - */ - Result segment(const char* marker) noexcept; - - /** - * @brief Gets the marker count of the animation. - * - * @retval The count of the markers, zero if there is no marker. - * - * @see LottieAnimation::marker() - * @note Experimental API - */ - uint32_t markersCnt() noexcept; - - /** - * @brief Gets the marker name by a given index. - * - * @param[in] idx The index of the animation marker, starts from 0. - * - * @retval The name of marker when succeed, @c nullptr otherwise. - * - * @see LottieAnimation::markersCnt() - * @note Experimental API - */ - const char* marker(uint32_t idx) noexcept; - - /** - * @brief Creates a new LottieAnimation object. - * - * @return A new LottieAnimation object. - * - * @note Experimental API - */ - static std::unique_ptr gen() noexcept; -}; - -} //namespace - -#endif //_THORVG_LOTTIE_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgAccessor.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgAccessor.cpp deleted file mode 100644 index e1f8608..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgAccessor.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgIteratorAccessor.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static bool accessChildren(Iterator* it, function func) -{ - while (auto child = it->next()) { - //Access the child - if (!func(child)) return false; - - //Access the children of the child - if (auto it2 = IteratorAccessor::iterator(child)) { - if (!accessChildren(it2, func)) { - delete(it2); - return false; - } - delete(it2); - } - } - return true; -} - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -unique_ptr Accessor::set(unique_ptr picture, function func) noexcept -{ - auto p = picture.get(); - if (!p || !func) return picture; - - //Use the Preorder Tree-Search - - //Root - if (!func(p)) return picture; - - //Children - if (auto it = IteratorAccessor::iterator(p)) { - accessChildren(it, func); - delete(it); - } - return picture; -} - - -Accessor::~Accessor() -{ - -} - - -Accessor::Accessor() : pImpl(nullptr) -{ - -} - - -unique_ptr Accessor::gen() noexcept -{ - return unique_ptr(new Accessor); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgAnimation.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgAnimation.cpp deleted file mode 100644 index 399ee45..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgAnimation.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgFrameModule.h" -#include "tvgAnimation.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -Animation::~Animation() -{ - delete(pImpl); -} - - -Animation::Animation() : pImpl(new Impl) -{ -} - - -Result Animation::frame(float no) noexcept -{ - auto loader = pImpl->picture->pImpl->loader; - - if (!loader) return Result::InsufficientCondition; - if (!loader->animatable()) return Result::NonSupport; - - if (static_cast(loader)->frame(no)) return Result::Success; - return Result::InsufficientCondition; -} - - -Picture* Animation::picture() const noexcept -{ - return pImpl->picture; -} - - -float Animation::curFrame() const noexcept -{ - auto loader = pImpl->picture->pImpl->loader; - - if (!loader) return 0; - if (!loader->animatable()) return 0; - - return static_cast(loader)->curFrame(); -} - - -float Animation::totalFrame() const noexcept -{ - auto loader = pImpl->picture->pImpl->loader; - - if (!loader) return 0; - if (!loader->animatable()) return 0; - - return static_cast(loader)->totalFrame(); -} - - -float Animation::duration() const noexcept -{ - auto loader = pImpl->picture->pImpl->loader; - - if (!loader) return 0; - if (!loader->animatable()) return 0; - - return static_cast(loader)->duration(); -} - - -Result Animation::segment(float begin, float end) noexcept -{ - if (begin < 0.0 || end > 1.0 || begin >= end) return Result::InvalidArguments; - - auto loader = pImpl->picture->pImpl->loader; - if (!loader) return Result::InsufficientCondition; - if (!loader->animatable()) return Result::NonSupport; - - static_cast(loader)->segment(begin, end); - - return Result::Success; -} - - -Result Animation::segment(float *begin, float *end) noexcept -{ - auto loader = pImpl->picture->pImpl->loader; - if (!loader) return Result::InsufficientCondition; - if (!loader->animatable()) return Result::NonSupport; - if (!begin && !end) return Result::InvalidArguments; - - static_cast(loader)->segment(begin, end); - - return Result::Success; -} - - -unique_ptr Animation::gen() noexcept -{ - return unique_ptr(new Animation); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgAnimation.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgAnimation.h deleted file mode 100644 index d0b4567..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgAnimation.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_ANIMATION_H_ -#define _TVG_ANIMATION_H_ - -#include "tvgCommon.h" -#include "tvgPaint.h" -#include "tvgPicture.h" - -struct Animation::Impl -{ - Picture* picture = nullptr; - - Impl() - { - picture = Picture::gen().release(); - PP(picture)->ref(); - } - - ~Impl() - { - if (PP(picture)->unref() == 0) { - delete(picture); - } - } -}; - -#endif //_TVG_ANIMATION_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgArray.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgArray.h deleted file mode 100644 index 33cd55b..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgArray.h +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_ARRAY_H_ -#define _TVG_ARRAY_H_ - -#include -#include -#include - -namespace tvg -{ - -template -struct Array -{ - T* data = nullptr; - uint32_t count = 0; - uint32_t reserved = 0; - - Array(){} - - Array(int32_t size) - { - reserve(size); - } - - Array(const Array& rhs) - { - reset(); - *this = rhs; - } - - void push(T element) - { - if (count + 1 > reserved) { - reserved = count + (count + 2) / 2; - data = static_cast(realloc(data, sizeof(T) * reserved)); - } - data[count++] = element; - } - - void push(Array& rhs) - { - if (rhs.count == 0) return; - grow(rhs.count); - memcpy(data + count, rhs.data, rhs.count * sizeof(T)); - count += rhs.count; - } - - bool reserve(uint32_t size) - { - if (size > reserved) { - reserved = size; - data = static_cast(realloc(data, sizeof(T) * reserved)); - } - return true; - } - - bool grow(uint32_t size) - { - return reserve(count + size); - } - - const T& operator[](size_t idx) const - { - return data[idx]; - } - - T& operator[](size_t idx) - { - return data[idx]; - } - - const T* begin() const - { - return data; - } - - T* begin() - { - return data; - } - - T* end() - { - return data + count; - } - - const T* end() const - { - return data + count; - } - - const T& last() const - { - return data[count - 1]; - } - - const T& first() const - { - return data[0]; - } - - T& last() - { - return data[count - 1]; - } - - T& first() - { - return data[0]; - } - - void pop() - { - if (count > 0) --count; - } - - void reset() - { - free(data); - data = nullptr; - count = reserved = 0; - } - - void clear() - { - count = 0; - } - - bool empty() const - { - return count == 0; - } - - template - void sort() - { - qsort(data, 0, static_cast(count) - 1); - } - - void operator=(const Array& rhs) - { - reserve(rhs.count); - if (rhs.count > 0) memcpy(data, rhs.data, sizeof(T) * rhs.count); - count = rhs.count; - } - - ~Array() - { - free(data); - } - -private: - template - void qsort(T* arr, int32_t low, int32_t high) - { - if (low < high) { - int32_t i = low; - int32_t j = high; - T tmp = arr[low]; - while (i < j) { - while (i < j && !COMPARE{}(arr[j], tmp)) --j; - if (i < j) { - arr[i] = arr[j]; - ++i; - } - while (i < j && COMPARE{}(arr[i], tmp)) ++i; - if (i < j) { - arr[j] = arr[i]; - --j; - } - } - arr[i] = tmp; - qsort(arr, low, i - 1); - qsort(arr, i + 1, high); - } - } -}; - -} - -#endif //_TVG_ARRAY_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgBinaryDesc.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgBinaryDesc.h deleted file mode 100644 index add8b08..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgBinaryDesc.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_BINARY_DESC_H_ -#define _TVG_BINARY_DESC_H_ - -/* TODO: Need to consider whether uin8_t is enough size for extension... - Rather than optimal data, we can use enough size and data compress? */ - -using TvgBinByte = uint8_t; -using TvgBinCounter = uint32_t; -using TvgBinTag = TvgBinByte; -using TvgBinFlag = TvgBinByte; - - -//Header -#define TVG_HEADER_SIZE 33 //TVG_HEADER_SIGNATURE_LENGTH + TVG_HEADER_VERSION_LENGTH + 2*SIZE(float) + TVG_HEADER_RESERVED_LENGTH + TVG_HEADER_COMPRESS_SIZE -#define TVG_HEADER_SIGNATURE "ThorVG" -#define TVG_HEADER_SIGNATURE_LENGTH 6 -#define TVG_HEADER_VERSION "001200" //Major 00, Minor 12, Micro 00 -#define TVG_HEADER_VERSION_LENGTH 6 -#define TVG_HEADER_RESERVED_LENGTH 1 //Storing flags for extensions -#define TVG_HEADER_COMPRESS_SIZE 12 //TVG_HEADER_UNCOMPRESSED_SIZE + TVG_HEADER_COMPRESSED_SIZE + TVG_HEADER_COMPRESSED_SIZE_BITS -//Compress Size -#define TVG_HEADER_UNCOMPRESSED_SIZE 4 //SIZE (TvgBinCounter) -#define TVG_HEADER_COMPRESSED_SIZE 4 //SIZE (TvgBinCounter) -#define TVG_HEADER_COMPRESSED_SIZE_BITS 4 //SIZE (TvgBinCounter) -//Reserved Flag -#define TVG_HEAD_FLAG_COMPRESSED 0x01 - -//Paint Type -#define TVG_TAG_CLASS_PICTURE (TvgBinTag)0xfc -#define TVG_TAG_CLASS_SHAPE (TvgBinTag)0xfd -#define TVG_TAG_CLASS_SCENE (TvgBinTag)0xfe - - -//Paint -#define TVG_TAG_PAINT_OPACITY (TvgBinTag)0x10 -#define TVG_TAG_PAINT_TRANSFORM (TvgBinTag)0x11 -#define TVG_TAG_PAINT_CMP_TARGET (TvgBinTag)0x01 -#define TVG_TAG_PAINT_CMP_METHOD (TvgBinTag)0x20 - - -//TODO: Keep this for the compatibility, Remove in TVG 1.0 release -//Scene - #define TVG_TAG_SCENE_RESERVEDCNT (TvgBinTag)0x30 - - -//Shape -#define TVG_TAG_SHAPE_PATH (TvgBinTag)0x40 -#define TVG_TAG_SHAPE_STROKE (TvgBinTag)0x41 -#define TVG_TAG_SHAPE_FILL (TvgBinTag)0x42 -#define TVG_TAG_SHAPE_COLOR (TvgBinTag)0x43 -#define TVG_TAG_SHAPE_FILLRULE (TvgBinTag)0x44 - - -//Stroke -#define TVG_TAG_SHAPE_STROKE_CAP (TvgBinTag)0x50 -#define TVG_TAG_SHAPE_STROKE_JOIN (TvgBinTag)0x51 -#define TVG_TAG_SHAPE_STROKE_WIDTH (TvgBinTag)0x52 -#define TVG_TAG_SHAPE_STROKE_COLOR (TvgBinTag)0x53 -#define TVG_TAG_SHAPE_STROKE_FILL (TvgBinTag)0x54 -#define TVG_TAG_SHAPE_STROKE_DASHPTRN (TvgBinTag)0x55 -#define TVG_TAG_SHAPE_STROKE_MITERLIMIT (TvgBinTag)0x56 -#define TVG_TAG_SHAPE_STROKE_ORDER (TvgBinTag)0x57 -#define TVG_TAG_SHAPE_STROKE_DASH_OFFSET (TvgBinTag)0x58 - - -//Fill -#define TVG_TAG_FILL_LINEAR_GRADIENT (TvgBinTag)0x60 -#define TVG_TAG_FILL_RADIAL_GRADIENT (TvgBinTag)0x61 -#define TVG_TAG_FILL_COLORSTOPS (TvgBinTag)0x62 -#define TVG_TAG_FILL_FILLSPREAD (TvgBinTag)0x63 -#define TVG_TAG_FILL_TRANSFORM (TvgBinTag)0x64 -#define TVG_TAG_FILL_RADIAL_GRADIENT_FOCAL (TvgBinTag)0x65 - -//Picture -#define TVG_TAG_PICTURE_RAW_IMAGE (TvgBinTag)0x70 -#define TVG_TAG_PICTURE_MESH (TvgBinTag)0x71 - -#endif //_TVG_BINARY_DESC_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCanvas.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgCanvas.cpp deleted file mode 100644 index 22a97c2..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCanvas.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgCanvas.h" - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -Canvas::Canvas(RenderMethod *pRenderer):pImpl(new Impl(pRenderer)) -{ -} - - -Canvas::~Canvas() -{ - delete(pImpl); -} - - -Result Canvas::reserve(TVG_UNUSED uint32_t n) noexcept -{ - return Result::NonSupport; -} - - -list& Canvas::paints() noexcept -{ - return pImpl->paints; -} - - -Result Canvas::push(unique_ptr paint) noexcept -{ - return pImpl->push(std::move(paint)); -} - - -Result Canvas::clear(bool free) noexcept -{ - return pImpl->clear(free); -} - - -Result Canvas::draw() noexcept -{ - TVGLOG("RENDERER", "Draw S. -------------------------------- Canvas(%p)", this); - auto ret = pImpl->draw(); - TVGLOG("RENDERER", "Draw E. -------------------------------- Canvas(%p)", this); - - return ret; -} - - -Result Canvas::update(Paint* paint) noexcept -{ - TVGLOG("RENDERER", "Update S. ------------------------------ Canvas(%p)", this); - auto ret = pImpl->update(paint, false); - TVGLOG("RENDERER", "Update E. ------------------------------ Canvas(%p)", this); - - return ret; -} - - -Result Canvas::viewport(int32_t x, int32_t y, int32_t w, int32_t h) noexcept -{ - return pImpl->viewport(x, y, w, h); -} - - -Result Canvas::sync() noexcept -{ - return pImpl->sync(); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCanvas.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgCanvas.h deleted file mode 100644 index 171f6aa..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCanvas.h +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_CANVAS_H_ -#define _TVG_CANVAS_H_ - -#include "tvgPaint.h" - - -struct Canvas::Impl -{ - enum Status : uint8_t {Synced = 0, Updating, Drawing}; - - list paints; - RenderMethod* renderer; - RenderRegion vport = {0, 0, INT32_MAX, INT32_MAX}; - Status status = Status::Synced; - - bool refresh = false; //if all paints should be updated by force. - - Impl(RenderMethod* pRenderer) : renderer(pRenderer) - { - renderer->ref(); - } - - ~Impl() - { - //make it sure any deferred jobs - renderer->sync(); - renderer->clear(); - - clearPaints(); - - if (renderer->unref() == 0) delete(renderer); - } - - void clearPaints() - { - for (auto paint : paints) { - if (P(paint)->unref() == 0) delete(paint); - } - paints.clear(); - } - - Result push(unique_ptr paint) - { - //You cannot push paints during rendering. - if (status == Status::Drawing) return Result::InsufficientCondition; - - auto p = paint.release(); - if (!p) return Result::MemoryCorruption; - PP(p)->ref(); - paints.push_back(p); - - return update(p, true); - } - - Result clear(bool free) - { - //Clear render target before drawing - if (!renderer->clear()) return Result::InsufficientCondition; - - //Free paints - if (free) clearPaints(); - - status = Status::Synced; - - return Result::Success; - } - - void needRefresh() - { - refresh = true; - } - - Result update(Paint* paint, bool force) - { - if (paints.empty() || status == Status::Drawing) return Result::InsufficientCondition; - - Array clips; - auto flag = RenderUpdateFlag::None; - if (refresh || force) flag = RenderUpdateFlag::All; - - if (paint) { - paint->pImpl->update(renderer, nullptr, clips, 255, flag); - } else { - for (auto paint : paints) { - paint->pImpl->update(renderer, nullptr, clips, 255, flag); - } - refresh = false; - } - status = Status::Updating; - return Result::Success; - } - - Result draw() - { - if (status == Status::Drawing || paints.empty() || !renderer->preRender()) return Result::InsufficientCondition; - - bool rendered = false; - for (auto paint : paints) { - if (paint->pImpl->render(renderer)) rendered = true; - } - - if (!rendered || !renderer->postRender()) return Result::InsufficientCondition; - - status = Status::Drawing; - return Result::Success; - } - - Result sync() - { - if (status == Status::Synced) return Result::InsufficientCondition; - - if (renderer->sync()) { - status = Status::Synced; - return Result::Success; - } - - return Result::InsufficientCondition; - } - - Result viewport(int32_t x, int32_t y, int32_t w, int32_t h) - { - if (status != Status::Synced) return Result::InsufficientCondition; - RenderRegion val = {x, y, w, h}; - //intersect if the target buffer is already set. - auto surface = renderer->mainSurface(); - if (surface && surface->w > 0 && surface->h > 0) { - val.intersect({0, 0, (int32_t)surface->w, (int32_t)surface->h}); - } - if (vport == val) return Result::Success; - renderer->viewport(val); - vport = val; - needRefresh(); - return Result::Success; - } -}; - -#endif /* _TVG_CANVAS_H_ */ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCapi.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgCapi.cpp deleted file mode 100644 index 1720d50..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCapi.cpp +++ /dev/null @@ -1,871 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "config.h" -#include -#include "thorvg.h" -#include "thorvg_capi.h" -#ifdef THORVG_LOTTIE_LOADER_SUPPORT -#include "thorvg_lottie.h" -#endif - -using namespace std; -using namespace tvg; - -#ifdef __cplusplus -extern "C" { -#endif - - -/************************************************************************/ -/* Engine API */ -/************************************************************************/ - -TVG_API Tvg_Result tvg_engine_init(Tvg_Engine engine_method, unsigned threads) -{ - return (Tvg_Result) Initializer::init(CanvasEngine(engine_method), threads); -} - - -TVG_API Tvg_Result tvg_engine_term(Tvg_Engine engine_method) -{ - return (Tvg_Result) Initializer::term(CanvasEngine(engine_method)); -} - - -/************************************************************************/ -/* Canvas API */ -/************************************************************************/ - -TVG_API Tvg_Canvas* tvg_swcanvas_create() -{ - return (Tvg_Canvas*) SwCanvas::gen().release(); -} - - -TVG_API Tvg_Result tvg_canvas_destroy(Tvg_Canvas* canvas) -{ - if (!canvas) return TVG_RESULT_INVALID_ARGUMENT; - delete(reinterpret_cast(canvas)); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_swcanvas_set_mempool(Tvg_Canvas* canvas, Tvg_Mempool_Policy policy) -{ - if (!canvas) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(canvas)->mempool(static_cast(policy)); -} - - -TVG_API Tvg_Result tvg_swcanvas_set_target(Tvg_Canvas* canvas, uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, Tvg_Colorspace cs) -{ - if (!canvas) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(canvas)->target(buffer, stride, w, h, static_cast(cs)); -} - - -TVG_API Tvg_Result tvg_canvas_push(Tvg_Canvas* canvas, Tvg_Paint* paint) -{ - if (!canvas || !paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(canvas)->push(unique_ptr((Paint*)paint)); -} - - -TVG_API Tvg_Result tvg_canvas_reserve(Tvg_Canvas* canvas, uint32_t n) -{ - return TVG_RESULT_NOT_SUPPORTED; -} - - -TVG_API Tvg_Result tvg_canvas_clear(Tvg_Canvas* canvas, bool free) -{ - if (!canvas) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(canvas)->clear(free); -} - - -TVG_API Tvg_Result tvg_canvas_update(Tvg_Canvas* canvas) -{ - if (!canvas) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(canvas)->update(nullptr); -} - - -TVG_API Tvg_Result tvg_canvas_est_viewport(Tvg_Canvas* canvas, int32_t x, int32_t y, int32_t w, int32_t h) -{ - if (!canvas) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(canvas)->viewport(x, y, w, h); -} - - -TVG_API Tvg_Result tvg_canvas_update_paint(Tvg_Canvas* canvas, Tvg_Paint* paint) -{ - if (!canvas || !paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(canvas)->update((Paint*) paint); -} - - -TVG_API Tvg_Result tvg_canvas_draw(Tvg_Canvas* canvas) -{ - if (!canvas) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(canvas)->draw(); -} - - -TVG_API Tvg_Result tvg_canvas_sync(Tvg_Canvas* canvas) -{ - if (!canvas) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(canvas)->sync(); -} - -TVG_API Tvg_Result tvg_canvas_set_viewport(Tvg_Canvas* canvas, int32_t x, int32_t y, int32_t w, int32_t h) -{ - if (!canvas) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(canvas)->viewport(x, y, w, h); -} - - -/************************************************************************/ -/* Paint API */ -/************************************************************************/ - -TVG_API Tvg_Result tvg_paint_del(Tvg_Paint* paint) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - delete(reinterpret_cast(paint)); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_paint_scale(Tvg_Paint* paint, float factor) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->scale(factor); -} - - -TVG_API Tvg_Result tvg_paint_rotate(Tvg_Paint* paint, float degree) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->rotate(degree); -} - - -TVG_API Tvg_Result tvg_paint_translate(Tvg_Paint* paint, float x, float y) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->translate(x, y); -} - - -TVG_API Tvg_Result tvg_paint_set_transform(Tvg_Paint* paint, const Tvg_Matrix* m) -{ - if (!paint || !m) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->transform(*(reinterpret_cast(m))); -} - - -TVG_API Tvg_Result tvg_paint_get_transform(Tvg_Paint* paint, Tvg_Matrix* m) -{ - if (!paint || !m) return TVG_RESULT_INVALID_ARGUMENT; - *reinterpret_cast(m) = reinterpret_cast(paint)->transform(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Paint* tvg_paint_duplicate(Tvg_Paint* paint) -{ - if (!paint) return nullptr; - return (Tvg_Paint*) reinterpret_cast(paint)->duplicate(); -} - - -TVG_API Tvg_Result tvg_paint_set_opacity(Tvg_Paint* paint, uint8_t opacity) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->opacity(opacity); -} - - -TVG_API Tvg_Result tvg_paint_get_opacity(const Tvg_Paint* paint, uint8_t* opacity) -{ - if (!paint || !opacity) return TVG_RESULT_INVALID_ARGUMENT; - *opacity = reinterpret_cast(paint)->opacity(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h, bool transformed) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->bounds(x, y, w, h, transformed); -} - - -TVG_API Tvg_Result tvg_paint_set_composite_method(Tvg_Paint* paint, Tvg_Paint* target, Tvg_Composite_Method method) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->composite(unique_ptr((Paint*)(target)), (CompositeMethod)method); -} - - -TVG_API Tvg_Result tvg_paint_get_composite_method(const Tvg_Paint* paint, const Tvg_Paint** target, Tvg_Composite_Method* method) -{ - if (!paint || !target || !method) return TVG_RESULT_INVALID_ARGUMENT; - *reinterpret_cast(method) = reinterpret_cast(paint)->composite(reinterpret_cast(target)); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_paint_set_blend_method(const Tvg_Paint* paint, Tvg_Blend_Method method) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->blend((BlendMethod)method); -} - - -TVG_API Tvg_Result tvg_paint_get_blend_method(const Tvg_Paint* paint, Tvg_Blend_Method* method) -{ - if (!paint || !method) return TVG_RESULT_INVALID_ARGUMENT; - *method = static_cast(reinterpret_cast(paint)->blend()); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_paint_get_identifier(const Tvg_Paint* paint, Tvg_Identifier* identifier) -{ - if (!paint || !identifier) return TVG_RESULT_INVALID_ARGUMENT; - *identifier = static_cast(reinterpret_cast(paint)->identifier()); - return TVG_RESULT_SUCCESS; -} - -/************************************************************************/ -/* Shape API */ -/************************************************************************/ - -TVG_API Tvg_Paint* tvg_shape_new() -{ - return (Tvg_Paint*) Shape::gen().release(); -} - - -TVG_API Tvg_Result tvg_shape_reset(Tvg_Paint* paint) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->reset(); -} - - -TVG_API Tvg_Result tvg_shape_move_to(Tvg_Paint* paint, float x, float y) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->moveTo(x, y); -} - - -TVG_API Tvg_Result tvg_shape_line_to(Tvg_Paint* paint, float x, float y) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->lineTo(x, y); -} - - -TVG_API Tvg_Result tvg_shape_cubic_to(Tvg_Paint* paint, float cx1, float cy1, float cx2, float cy2, float x, float y) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->cubicTo(cx1, cy1, cx2, cy2, x, y); -} - - -TVG_API Tvg_Result tvg_shape_close(Tvg_Paint* paint) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->close(); -} - - -TVG_API Tvg_Result tvg_shape_append_rect(Tvg_Paint* paint, float x, float y, float w, float h, float rx, float ry) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->appendRect(x, y, w, h, rx, ry); -} - - -TVG_API Tvg_Result tvg_shape_append_arc(Tvg_Paint* paint, float cx, float cy, float radius, float startAngle, float sweep, uint8_t pie) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->appendArc(cx, cy, radius, startAngle, sweep, pie); -} - - -TVG_API Tvg_Result tvg_shape_append_circle(Tvg_Paint* paint, float cx, float cy, float rx, float ry) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->appendCircle(cx, cy, rx, ry); -} - - -TVG_API Tvg_Result tvg_shape_append_path(Tvg_Paint* paint, const Tvg_Path_Command* cmds, uint32_t cmdCnt, const Tvg_Point* pts, uint32_t ptsCnt) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->appendPath((const PathCommand*)cmds, cmdCnt, (const Point*)pts, ptsCnt); -} - - -TVG_API Tvg_Result tvg_shape_get_path_coords(const Tvg_Paint* paint, const Tvg_Point** pts, uint32_t* cnt) -{ - if (!paint || !pts || !cnt) return TVG_RESULT_INVALID_ARGUMENT; - *cnt = reinterpret_cast(paint)->pathCoords((const Point**)pts); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_shape_get_path_commands(const Tvg_Paint* paint, const Tvg_Path_Command** cmds, uint32_t* cnt) -{ - if (!paint || !cmds || !cnt) return TVG_RESULT_INVALID_ARGUMENT; - *cnt = reinterpret_cast(paint)->pathCommands((const PathCommand**)cmds); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_shape_set_stroke_width(Tvg_Paint* paint, float width) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->stroke(width); -} - - -TVG_API Tvg_Result tvg_shape_get_stroke_width(const Tvg_Paint* paint, float* width) -{ - if (!paint || !width) return TVG_RESULT_INVALID_ARGUMENT; - *width = reinterpret_cast(paint)->strokeWidth(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_shape_set_stroke_color(Tvg_Paint* paint, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->stroke(r, g, b, a); -} - - -TVG_API Tvg_Result tvg_shape_get_stroke_color(const Tvg_Paint* paint, uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->strokeColor(r, g, b, a); -} - - -TVG_API Tvg_Result tvg_shape_set_stroke_linear_gradient(Tvg_Paint* paint, Tvg_Gradient* gradient) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->stroke(unique_ptr((LinearGradient*)(gradient))); -} - - -TVG_API Tvg_Result tvg_shape_set_stroke_radial_gradient(Tvg_Paint* paint, Tvg_Gradient* gradient) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->stroke(unique_ptr((RadialGradient*)(gradient))); -} - - -TVG_API Tvg_Result tvg_shape_get_stroke_gradient(const Tvg_Paint* paint, Tvg_Gradient** gradient) -{ - if (!paint || !gradient) return TVG_RESULT_INVALID_ARGUMENT; - *gradient = (Tvg_Gradient*)(reinterpret_cast(paint)->strokeFill()); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_shape_set_stroke_dash(Tvg_Paint* paint, const float* dashPattern, uint32_t cnt) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->stroke(dashPattern, cnt); -} - - -TVG_API Tvg_Result tvg_shape_get_stroke_dash(const Tvg_Paint* paint, const float** dashPattern, uint32_t* cnt) -{ - if (!paint || !cnt || !dashPattern) return TVG_RESULT_INVALID_ARGUMENT; - *cnt = reinterpret_cast(paint)->strokeDash(dashPattern); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_shape_set_stroke_cap(Tvg_Paint* paint, Tvg_Stroke_Cap cap) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->stroke((StrokeCap)cap); -} - - -TVG_API Tvg_Result tvg_shape_get_stroke_cap(const Tvg_Paint* paint, Tvg_Stroke_Cap* cap) -{ - if (!paint || !cap) return TVG_RESULT_INVALID_ARGUMENT; - *cap = (Tvg_Stroke_Cap) reinterpret_cast(paint)->strokeCap(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_shape_set_stroke_join(Tvg_Paint* paint, Tvg_Stroke_Join join) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->stroke((StrokeJoin)join); -} - - -TVG_API Tvg_Result tvg_shape_get_stroke_join(const Tvg_Paint* paint, Tvg_Stroke_Join* join) -{ - if (!paint || !join) return TVG_RESULT_INVALID_ARGUMENT; - *join = (Tvg_Stroke_Join) reinterpret_cast(paint)->strokeJoin(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_shape_set_stroke_miterlimit(Tvg_Paint* paint, float ml) -{ - if (ml < 0.0f) return TVG_RESULT_NOT_SUPPORTED; - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->strokeMiterlimit(ml); -} - - -TVG_API Tvg_Result tvg_shape_get_stroke_miterlimit(const Tvg_Paint* paint, float* ml) -{ - if (!paint || !ml) return TVG_RESULT_INVALID_ARGUMENT; - *ml = reinterpret_cast(paint)->strokeMiterlimit(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_shape_set_fill_color(Tvg_Paint* paint, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->fill(r, g, b, a); -} - - -TVG_API Tvg_Result tvg_shape_get_fill_color(const Tvg_Paint* paint, uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->fillColor(r, g, b, a); -} - - -TVG_API Tvg_Result tvg_shape_set_fill_rule(Tvg_Paint* paint, Tvg_Fill_Rule rule) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->fill((FillRule)rule); -} - - -TVG_API Tvg_Result tvg_shape_get_fill_rule(const Tvg_Paint* paint, Tvg_Fill_Rule* rule) -{ - if (!paint || !rule) return TVG_RESULT_INVALID_ARGUMENT; - *rule = (Tvg_Fill_Rule) reinterpret_cast(paint)->fillRule(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_shape_set_paint_order(Tvg_Paint* paint, bool strokeFirst) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->order(strokeFirst); -} - - -TVG_API Tvg_Result tvg_shape_set_linear_gradient(Tvg_Paint* paint, Tvg_Gradient* gradient) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->fill(unique_ptr((LinearGradient*)(gradient))); -} - - -TVG_API Tvg_Result tvg_shape_set_radial_gradient(Tvg_Paint* paint, Tvg_Gradient* gradient) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->fill(unique_ptr((RadialGradient*)(gradient))); -} - - -TVG_API Tvg_Result tvg_shape_get_gradient(const Tvg_Paint* paint, Tvg_Gradient** gradient) -{ - if (!paint || !gradient) return TVG_RESULT_INVALID_ARGUMENT; - *gradient = (Tvg_Gradient*)(reinterpret_cast(paint)->fill()); - return TVG_RESULT_SUCCESS; -} - -/************************************************************************/ -/* Picture API */ -/************************************************************************/ - -TVG_API Tvg_Paint* tvg_picture_new() -{ - return (Tvg_Paint*) Picture::gen().release(); -} - - -TVG_API Tvg_Result tvg_picture_load(Tvg_Paint* paint, const char* path) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->load(path); -} - - -TVG_API Tvg_Result tvg_picture_load_raw(Tvg_Paint* paint, uint32_t *data, uint32_t w, uint32_t h, bool copy) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->load(data, w, h, copy); -} - - -TVG_API Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size, const char *mimetype, bool copy) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->load(data, size, mimetype ? mimetype : "", copy); -} - - -TVG_API Tvg_Result tvg_picture_set_size(Tvg_Paint* paint, float w, float h) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->size(w, h); -} - - -TVG_API Tvg_Result tvg_picture_get_size(const Tvg_Paint* paint, float* w, float* h) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->size(w, h); -} - - -/************************************************************************/ -/* Gradient API */ -/************************************************************************/ - -TVG_API Tvg_Gradient* tvg_linear_gradient_new() -{ - return (Tvg_Gradient*)LinearGradient::gen().release(); -} - - -TVG_API Tvg_Gradient* tvg_radial_gradient_new() -{ - return (Tvg_Gradient*)RadialGradient::gen().release(); -} - - -TVG_API Tvg_Gradient* tvg_gradient_duplicate(Tvg_Gradient* grad) -{ - if (!grad) return nullptr; - return (Tvg_Gradient*) reinterpret_cast(grad)->duplicate(); -} - - -TVG_API Tvg_Result tvg_gradient_del(Tvg_Gradient* grad) -{ - if (!grad) return TVG_RESULT_INVALID_ARGUMENT; - delete(reinterpret_cast(grad)); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_linear_gradient_set(Tvg_Gradient* grad, float x1, float y1, float x2, float y2) -{ - if (!grad) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(grad)->linear(x1, y1, x2, y2); -} - - -TVG_API Tvg_Result tvg_linear_gradient_get(Tvg_Gradient* grad, float* x1, float* y1, float* x2, float* y2) -{ - if (!grad) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(grad)->linear(x1, y1, x2, y2); -} - - -TVG_API Tvg_Result tvg_radial_gradient_set(Tvg_Gradient* grad, float cx, float cy, float radius) -{ - if (!grad) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(grad)->radial(cx, cy, radius); -} - - -TVG_API Tvg_Result tvg_radial_gradient_get(Tvg_Gradient* grad, float* cx, float* cy, float* radius) -{ - if (!grad) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(grad)->radial(cx, cy, radius); -} - - -TVG_API Tvg_Result tvg_gradient_set_color_stops(Tvg_Gradient* grad, const Tvg_Color_Stop* color_stop, uint32_t cnt) -{ - if (!grad) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(grad)->colorStops(reinterpret_cast(color_stop), cnt); -} - - -TVG_API Tvg_Result tvg_gradient_get_color_stops(const Tvg_Gradient* grad, const Tvg_Color_Stop** color_stop, uint32_t* cnt) -{ - if (!grad || !color_stop || !cnt) return TVG_RESULT_INVALID_ARGUMENT; - *cnt = reinterpret_cast(grad)->colorStops(reinterpret_cast(color_stop)); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_gradient_set_spread(Tvg_Gradient* grad, const Tvg_Stroke_Fill spread) -{ - if (!grad) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(grad)->spread((FillSpread)spread); -} - - -TVG_API Tvg_Result tvg_gradient_get_spread(const Tvg_Gradient* grad, Tvg_Stroke_Fill* spread) -{ - if (!grad || !spread) return TVG_RESULT_INVALID_ARGUMENT; - *spread = (Tvg_Stroke_Fill) reinterpret_cast(grad)->spread(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_gradient_set_transform(Tvg_Gradient* grad, const Tvg_Matrix* m) -{ - if (!grad || !m) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(grad)->transform(*(reinterpret_cast(m))); -} - - -TVG_API Tvg_Result tvg_gradient_get_transform(const Tvg_Gradient* grad, Tvg_Matrix* m) -{ - if (!grad || !m) return TVG_RESULT_INVALID_ARGUMENT; - *reinterpret_cast(m) = reinterpret_cast(const_cast(grad))->transform(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_gradient_get_identifier(const Tvg_Gradient* grad, Tvg_Identifier* identifier) -{ - if (!grad || !identifier) return TVG_RESULT_INVALID_ARGUMENT; - *identifier = static_cast(reinterpret_cast(grad)->identifier()); - return TVG_RESULT_SUCCESS; -} - -/************************************************************************/ -/* Scene API */ -/************************************************************************/ - -TVG_API Tvg_Paint* tvg_scene_new() -{ - return (Tvg_Paint*) Scene::gen().release(); -} - - -TVG_API Tvg_Result tvg_scene_reserve(Tvg_Paint* scene, uint32_t size) -{ - return TVG_RESULT_NOT_SUPPORTED; -} - - -TVG_API Tvg_Result tvg_scene_push(Tvg_Paint* scene, Tvg_Paint* paint) -{ - if (!scene || !paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(scene)->push(unique_ptr((Paint*)paint)); -} - - -TVG_API Tvg_Result tvg_scene_clear(Tvg_Paint* scene, bool free) -{ - if (!scene) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(scene)->clear(free); -} - - -/************************************************************************/ -/* Saver API */ -/************************************************************************/ - -TVG_API Tvg_Saver* tvg_saver_new() -{ - return (Tvg_Saver*) Saver::gen().release(); -} - - -TVG_API Tvg_Result tvg_saver_save(Tvg_Saver* saver, Tvg_Paint* paint, const char* path, bool compress) -{ - if (!saver || !paint || !path) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(saver)->save(unique_ptr((Paint*)paint), path, compress); -} - - -TVG_API Tvg_Result tvg_saver_sync(Tvg_Saver* saver) -{ - if (!saver) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(saver)->sync(); -} - - -TVG_API Tvg_Result tvg_saver_del(Tvg_Saver* saver) -{ - if (!saver) return TVG_RESULT_INVALID_ARGUMENT; - delete(reinterpret_cast(saver)); - return TVG_RESULT_SUCCESS; -} - - -/************************************************************************/ -/* Animation API */ -/************************************************************************/ - -TVG_API Tvg_Animation* tvg_animation_new() -{ - return (Tvg_Animation*) Animation::gen().release(); -} - - -TVG_API Tvg_Result tvg_animation_set_frame(Tvg_Animation* animation, float no) -{ - if (!animation) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(animation)->frame(no); -} - - -TVG_API Tvg_Result tvg_animation_get_frame(Tvg_Animation* animation, float* no) -{ - if (!animation || !no) return TVG_RESULT_INVALID_ARGUMENT; - *no = reinterpret_cast(animation)->curFrame(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_animation_get_total_frame(Tvg_Animation* animation, float* cnt) -{ - if (!animation || !cnt) return TVG_RESULT_INVALID_ARGUMENT; - *cnt = reinterpret_cast(animation)->totalFrame(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Paint* tvg_animation_get_picture(Tvg_Animation* animation) -{ - if (!animation) return nullptr; - return (Tvg_Paint*) reinterpret_cast(animation)->picture(); -} - - -TVG_API Tvg_Result tvg_animation_get_duration(Tvg_Animation* animation, float* duration) -{ - if (!animation || !duration) return TVG_RESULT_INVALID_ARGUMENT; - *duration = reinterpret_cast(animation)->duration(); - return TVG_RESULT_SUCCESS; -} - - -TVG_API Tvg_Result tvg_animation_set_segment(Tvg_Animation* animation, float start, float end) -{ - if (!animation) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(animation)->segment(start, end); -} - - -TVG_API Tvg_Result tvg_animation_get_segment(Tvg_Animation* animation, float* start, float* end) -{ - if (!animation) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(animation)->segment(start, end); -} - - -TVG_API Tvg_Result tvg_animation_del(Tvg_Animation* animation) -{ - if (!animation) return TVG_RESULT_INVALID_ARGUMENT; - delete(reinterpret_cast(animation)); - return TVG_RESULT_SUCCESS; -} - - -/************************************************************************/ -/* Lottie Animation API */ -/************************************************************************/ - -TVG_API Tvg_Animation* tvg_lottie_animation_new() -{ -#ifdef THORVG_LOTTIE_LOADER_SUPPORT - return (Tvg_Animation*) LottieAnimation::gen().release(); -#endif - return nullptr; -} - - -TVG_API Tvg_Result tvg_lottie_animation_override(Tvg_Animation* animation, const char* slot) -{ -#ifdef THORVG_LOTTIE_LOADER_SUPPORT - if (!animation) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(animation)->override(slot); -#endif - return TVG_RESULT_NOT_SUPPORTED; -} - - -TVG_API Tvg_Result tvg_lottie_animation_set_marker(Tvg_Animation* animation, const char* marker) -{ -#ifdef THORVG_LOTTIE_LOADER_SUPPORT - if (!animation) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(animation)->segment(marker); -#endif - return TVG_RESULT_NOT_SUPPORTED; -} - - -TVG_API Tvg_Result tvg_lottie_animation_get_markers_cnt(Tvg_Animation* animation, uint32_t* cnt) -{ -#ifdef THORVG_LOTTIE_LOADER_SUPPORT - if (!animation || !cnt) return TVG_RESULT_INVALID_ARGUMENT; - *cnt = reinterpret_cast(animation)->markersCnt(); - return TVG_RESULT_SUCCESS; -#endif - return TVG_RESULT_NOT_SUPPORTED; -} - - -TVG_API Tvg_Result tvg_lottie_animation_get_marker(Tvg_Animation* animation, uint32_t idx, const char** name) -{ -#ifdef THORVG_LOTTIE_LOADER_SUPPORT - if (!animation || !name) return TVG_RESULT_INVALID_ARGUMENT; - *name = reinterpret_cast(animation)->marker(idx); - if (!(*name)) return TVG_RESULT_INVALID_ARGUMENT; - return TVG_RESULT_SUCCESS; -#endif - return TVG_RESULT_NOT_SUPPORTED; -} - -#ifdef __cplusplus -} -#endif - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCommon.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgCommon.h deleted file mode 100644 index d22c893..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCommon.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_COMMON_H_ -#define _TVG_COMMON_H_ - -#include "config.h" -#include "thorvg.h" - -using namespace std; -using namespace tvg; - -//for MSVC Compat -#ifdef _MSC_VER - #define TVG_UNUSED - #define strncasecmp _strnicmp - #define strcasecmp _stricmp -#else - #define TVG_UNUSED __attribute__ ((__unused__)) -#endif - -// Portable 'fallthrough' attribute -#if __has_cpp_attribute(fallthrough) - #ifdef _MSC_VER - #define TVG_FALLTHROUGH [[fallthrough]]; - #else - #define TVG_FALLTHROUGH __attribute__ ((fallthrough)); - #endif -#else - #define TVG_FALLTHROUGH -#endif - -#if defined(_MSC_VER) && defined(__clang__) - #define strncpy strncpy_s - #define strdup _strdup -#endif - -//TVG class identifier values -#define TVG_CLASS_ID_UNDEFINED 0 -#define TVG_CLASS_ID_SHAPE 1 -#define TVG_CLASS_ID_SCENE 2 -#define TVG_CLASS_ID_PICTURE 3 -#define TVG_CLASS_ID_LINEAR 4 -#define TVG_CLASS_ID_RADIAL 5 -#define TVG_CLASS_ID_TEXT 6 - -enum class FileType { Png = 0, Jpg, Webp, Tvg, Svg, Lottie, Ttf, Raw, Gif, Unknown }; - -using Size = Point; - -#ifdef THORVG_LOG_ENABLED - constexpr auto ErrorColor = "\033[31m"; //red - constexpr auto ErrorBgColor = "\033[41m";//bg red - constexpr auto LogColor = "\033[32m"; //green - constexpr auto LogBgColor = "\033[42m"; //bg green - constexpr auto GreyColor = "\033[90m"; //grey - constexpr auto ResetColors = "\033[0m"; //default - #define TVGERR(tag, fmt, ...) fprintf(stderr, "%s[E]%s %s" tag "%s (%s %d): %s" fmt "\n", ErrorBgColor, ResetColors, ErrorColor, GreyColor, __FILE__, __LINE__, ResetColors, ##__VA_ARGS__) - #define TVGLOG(tag, fmt, ...) fprintf(stdout, "%s[L]%s %s" tag "%s (%s %d): %s" fmt "\n", LogBgColor, ResetColors, LogColor, GreyColor, __FILE__, __LINE__, ResetColors, ##__VA_ARGS__) -#else - #define TVGERR(...) do {} while(0) - #define TVGLOG(...) do {} while(0) -#endif - -uint16_t THORVG_VERSION_NUMBER(); - - -#define P(A) ((A)->pImpl) //Access to pimpl. -#define PP(A) (((Paint*)(A))->pImpl) //Access to pimpl. - -#endif //_TVG_COMMON_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCompressor.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgCompressor.cpp deleted file mode 100644 index d0c7c4e..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCompressor.cpp +++ /dev/null @@ -1,481 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -/* - * Lempel–Ziv–Welch (LZW) encoder/decoder by Guilherme R. Lampert(guilherme.ronaldo.lampert@gmail.com) - - * This is the compression scheme used by the GIF image format and the Unix 'compress' tool. - * Main differences from this implementation is that End Of Input (EOI) and Clear Codes (CC) - * are not stored in the output and the max code length in bits is 12, vs 16 in compress. - * - * EOI is simply detected by the end of the data stream, while CC happens if the - * dictionary gets filled. Data is written/read from bit streams, which handle - * byte-alignment for us in a transparent way. - - * The decoder relies on the hardcoded data layout produced by the encoder, since - * no additional reconstruction data is added to the output, so they must match. - * The nice thing about LZW is that we can reconstruct the dictionary directly from - * the stream of codes generated by the encoder, so this avoids storing additional - * headers in the bit stream. - - * The output code length is variable. It starts with the minimum number of bits - * required to store the base byte-sized dictionary and automatically increases - * as the dictionary gets larger (it starts at 9-bits and grows to 10-bits when - * code 512 is added, then 11-bits when 1024 is added, and so on). If the dictionary - * is filled (4096 items for a 12-bits dictionary), the whole thing is cleared and - * the process starts over. This is the main reason why the encoder and the decoder - * must match perfectly, since the lengths of the codes will not be specified with - * the data itself. - - * USEFUL LINKS: - * https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch - * http://rosettacode.org/wiki/LZW_compression - * http://www.cs.duke.edu/csed/curious/compression/lzw.html - * http://www.cs.cf.ac.uk/Dave/Multimedia/node214.html - * http://marknelson.us/1989/10/01/lzw-data-compression/ - */ -#include "config.h" - - - -#include -#include -#include "tvgCompressor.h" - -namespace tvg { - - -/************************************************************************/ -/* LZW Implementation */ -/************************************************************************/ - - -//LZW Dictionary helper: -constexpr int Nil = -1; -constexpr int MaxDictBits = 12; -constexpr int StartBits = 9; -constexpr int FirstCode = (1 << (StartBits - 1)); // 256 -constexpr int MaxDictEntries = (1 << MaxDictBits); // 4096 - - -//Round up to the next power-of-two number, e.g. 37 => 64 -static int nextPowerOfTwo(int num) -{ - --num; - for (size_t i = 1; i < sizeof(num) * 8; i <<= 1) { - num = num | num >> i; - } - return ++num; -} - - -struct BitStreamWriter -{ - uint8_t* stream; //Growable buffer to store our bits. Heap allocated & owned by the class instance. - int bytesAllocated; //Current size of heap-allocated stream buffer *in bytes*. - int granularity; //Amount bytesAllocated multiplies by when auto-resizing in appendBit(). - int currBytePos; //Current byte being written to, from 0 to bytesAllocated-1. - int nextBitPos; //Bit position within the current byte to access next. 0 to 7. - int numBitsWritten; //Number of bits in use from the stream buffer, not including byte-rounding padding. - - void internalInit() - { - stream = nullptr; - bytesAllocated = 0; - granularity = 2; - currBytePos = 0; - nextBitPos = 0; - numBitsWritten = 0; - } - - uint8_t* allocBytes(const int bytesWanted, uint8_t * oldPtr, const int oldSize) - { - auto newMemory = static_cast(malloc(bytesWanted)); - memset(newMemory, 0, bytesWanted); - - if (oldPtr) { - memcpy(newMemory, oldPtr, oldSize); - free(oldPtr); - } - return newMemory; - } - - BitStreamWriter() - { - /* 8192 bits for a start (1024 bytes). It will resize if needed. - Default granularity is 2. */ - internalInit(); - allocate(8192); - } - - BitStreamWriter(const int initialSizeInBits, const int growthGranularity = 2) - { - internalInit(); - setGranularity(growthGranularity); - allocate(initialSizeInBits); - } - - ~BitStreamWriter() - { - free(stream); - } - - void allocate(int bitsWanted) - { - //Require at least a byte. - if (bitsWanted <= 0) bitsWanted = 8; - - //Round upwards if needed: - if ((bitsWanted % 8) != 0) bitsWanted = nextPowerOfTwo(bitsWanted); - - //We might already have the required count. - const int sizeInBytes = bitsWanted / 8; - if (sizeInBytes <= bytesAllocated) return; - - stream = allocBytes(sizeInBytes, stream, bytesAllocated); - bytesAllocated = sizeInBytes; - } - - void appendBit(const int bit) - { - const uint32_t mask = uint32_t(1) << nextBitPos; - stream[currBytePos] = (stream[currBytePos] & ~mask) | (-bit & mask); - ++numBitsWritten; - - if (++nextBitPos == 8) { - nextBitPos = 0; - if (++currBytePos == bytesAllocated) allocate(bytesAllocated * granularity * 8); - } - } - - void appendBitsU64(const uint64_t num, const int bitCount) - { - for (int b = 0; b < bitCount; ++b) { - const uint64_t mask = uint64_t(1) << b; - const int bit = !!(num & mask); - appendBit(bit); - } - } - - uint8_t* release() - { - auto oldPtr = stream; - internalInit(); - return oldPtr; - } - - void setGranularity(const int growthGranularity) - { - granularity = (growthGranularity >= 2) ? growthGranularity : 2; - } - - int getByteCount() const - { - int usedBytes = numBitsWritten / 8; - int leftovers = numBitsWritten % 8; - if (leftovers != 0) ++usedBytes; - return usedBytes; - } -}; - - -struct BitStreamReader -{ - const uint8_t* stream; // Pointer to the external bit stream. Not owned by the reader. - const int sizeInBytes; // Size of the stream *in bytes*. Might include padding. - const int sizeInBits; // Size of the stream *in bits*, padding *not* include. - int currBytePos = 0; // Current byte being read in the stream. - int nextBitPos = 0; // Bit position within the current byte to access next. 0 to 7. - int numBitsRead = 0; // Total bits read from the stream so far. Never includes byte-rounding padding. - - BitStreamReader(const uint8_t* bitStream, const int byteCount, const int bitCount) : stream(bitStream), sizeInBytes(byteCount), sizeInBits(bitCount) - { - } - - bool readNextBit(int& bitOut) - { - if (numBitsRead >= sizeInBits) return false; //We are done. - - const uint32_t mask = uint32_t(1) << nextBitPos; - bitOut = !!(stream[currBytePos] & mask); - ++numBitsRead; - - if (++nextBitPos == 8) { - nextBitPos = 0; - ++currBytePos; - } - return true; - } - - uint64_t readBitsU64(const int bitCount) - { - uint64_t num = 0; - for (int b = 0; b < bitCount; ++b) { - int bit; - if (!readNextBit(bit)) break; - /* Based on a "Stanford bit-hack": - http://graphics.stanford.edu/~seander/bithacks.html#ConditionalSetOrClearBitsWithoutBranching */ - const uint64_t mask = uint64_t(1) << b; - num = (num & ~mask) | (-bit & mask); - } - return num; - } - - bool isEndOfStream() const - { - return numBitsRead >= sizeInBits; - } -}; - - -struct Dictionary -{ - struct Entry - { - int code; - int value; - }; - - //Dictionary entries 0-255 are always reserved to the byte/ASCII range. - int size; - Entry entries[MaxDictEntries]; - - Dictionary() - { - /* First 256 dictionary entries are reserved to the byte/ASCII range. - Additional entries follow for the character sequences found in the input. - Up to 4096 - 256 (MaxDictEntries - FirstCode). */ - size = FirstCode; - - for (int i = 0; i < size; ++i) { - entries[i].code = Nil; - entries[i].value = i; - } - } - - int findIndex(const int code, const int value) const - { - if (code == Nil) return value; - - //Linear search for now. - //TODO: Worth optimizing with a proper hash-table? - for (int i = 0; i < size; ++i) { - if (entries[i].code == code && entries[i].value == value) return i; - } - return Nil; - } - - bool add(const int code, const int value) - { - if (size == MaxDictEntries) return false; - entries[size].code = code; - entries[size].value = value; - ++size; - return true; - } - - bool flush(int & codeBitsWidth) - { - if (size == (1 << codeBitsWidth)) { - ++codeBitsWidth; - if (codeBitsWidth > MaxDictBits) { - //Clear the dictionary (except the first 256 byte entries). - codeBitsWidth = StartBits; - size = FirstCode; - return true; - } - } - return false; - } -}; - - -static bool outputByte(int code, uint8_t*& output, int outputSizeBytes, int& bytesDecodedSoFar) -{ - if (bytesDecodedSoFar >= outputSizeBytes) return false; - *output++ = static_cast(code); - ++bytesDecodedSoFar; - return true; -} - - -static bool outputSequence(const Dictionary& dict, int code, uint8_t*& output, int outputSizeBytes, int& bytesDecodedSoFar, int& firstByte) -{ - /* A sequence is stored backwards, so we have to write - it to a temp then output the buffer in reverse. */ - int i = 0; - uint8_t sequence[MaxDictEntries]; - - do { - sequence[i++] = dict.entries[code].value; - code = dict.entries[code].code; - } while (code >= 0); - - firstByte = sequence[--i]; - - for (; i >= 0; --i) { - if (!outputByte(sequence[i], output, outputSizeBytes, bytesDecodedSoFar)) return false; - } - return true; -} - - -uint8_t* lzwDecode(const uint8_t* compressed, uint32_t compressedSizeBytes, uint32_t compressedSizeBits, uint32_t uncompressedSizeBytes) -{ - int code = Nil; - int prevCode = Nil; - int firstByte = 0; - int bytesDecoded = 0; - int codeBitsWidth = StartBits; - auto uncompressed = (uint8_t*) malloc(sizeof(uint8_t) * uncompressedSizeBytes); - auto ptr = uncompressed; - - /* We'll reconstruct the dictionary based on the bit stream codes. - Unlike Huffman encoding, we don't store the dictionary as a prefix to the data. */ - Dictionary dictionary; - BitStreamReader bitStream(compressed, compressedSizeBytes, compressedSizeBits); - - /* We check to avoid an overflow of the user buffer. - If the buffer is smaller than the decompressed size, we break the loop and return the current decompression count. */ - while (!bitStream.isEndOfStream()) { - code = static_cast(bitStream.readBitsU64(codeBitsWidth)); - - if (prevCode == Nil) { - if (!outputByte(code, ptr, uncompressedSizeBytes, bytesDecoded)) break; - firstByte = code; - prevCode = code; - continue; - } - if (code >= dictionary.size) { - if (!outputSequence(dictionary, prevCode, ptr, uncompressedSizeBytes, bytesDecoded, firstByte)) break; - if (!outputByte(firstByte, ptr, uncompressedSizeBytes, bytesDecoded)) break; - } else if (!outputSequence(dictionary, code, ptr, uncompressedSizeBytes, bytesDecoded, firstByte)) break; - - dictionary.add(prevCode, firstByte); - if (dictionary.flush(codeBitsWidth)) prevCode = Nil; - else prevCode = code; - } - - return uncompressed; -} - - -uint8_t* lzwEncode(const uint8_t* uncompressed, uint32_t uncompressedSizeBytes, uint32_t* compressedSizeBytes, uint32_t* compressedSizeBits) -{ - //LZW encoding context: - int code = Nil; - int codeBitsWidth = StartBits; - Dictionary dictionary; - - //Output bit stream we write to. This will allocate memory as needed to accommodate the encoded data. - BitStreamWriter bitStream; - - for (; uncompressedSizeBytes > 0; --uncompressedSizeBytes, ++uncompressed) { - const int value = *uncompressed; - const int index = dictionary.findIndex(code, value); - - if (index != Nil) { - code = index; - continue; - } - - //Write the dictionary code using the minimum bit-with: - bitStream.appendBitsU64(code, codeBitsWidth); - - //Flush it when full so we can restart the sequences. - if (!dictionary.flush(codeBitsWidth)) { - //There's still space for this sequence. - dictionary.add(code, value); - } - code = value; - } - - //Residual code at the end: - if (code != Nil) bitStream.appendBitsU64(code, codeBitsWidth); - - //Pass ownership of the compressed data buffer to the user pointer: - *compressedSizeBytes = bitStream.getByteCount(); - *compressedSizeBits = bitStream.numBitsWritten; - - return bitStream.release(); -} - - -/************************************************************************/ -/* B64 Implementation */ -/************************************************************************/ - - -size_t b64Decode(const char* encoded, const size_t len, char** decoded) -{ - static constexpr const char B64_INDEX[256] = - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 62, 63, 62, 62, 63, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 0, 0, 0, 0, 63, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 - }; - - - if (!decoded || !encoded || len == 0) return 0; - - auto reserved = 3 * (1 + (len >> 2)) + 1; - auto output = static_cast(malloc(reserved * sizeof(char))); - if (!output) return 0; - output[reserved - 1] = '\0'; - - size_t idx = 0; - - while (*encoded && *(encoded + 1)) { - if (*encoded <= 0x20) { - ++encoded; - continue; - } - - auto value1 = B64_INDEX[(size_t)encoded[0]]; - auto value2 = B64_INDEX[(size_t)encoded[1]]; - output[idx++] = (value1 << 2) + ((value2 & 0x30) >> 4); - - if (!encoded[2] || encoded[3] < 0 || encoded[2] == '=' || encoded[2] == '.') break; - auto value3 = B64_INDEX[(size_t)encoded[2]]; - output[idx++] = ((value2 & 0x0f) << 4) + ((value3 & 0x3c) >> 2); - - if (!encoded[3] || encoded[3] < 0 || encoded[3] == '=' || encoded[3] == '.') break; - auto value4 = B64_INDEX[(size_t)encoded[3]]; - output[idx++] = ((value3 & 0x03) << 6) + value4; - encoded += 4; - } - *decoded = output; - return reserved; -} - - -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCompressor.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgCompressor.h deleted file mode 100644 index 11e5fb3..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgCompressor.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_COMPRESSOR_H_ -#define _TVG_COMPRESSOR_H_ - -#include - -namespace tvg -{ - uint8_t* lzwEncode(const uint8_t* uncompressed, uint32_t uncompressedSizeBytes, uint32_t* compressedSizeBytes, uint32_t* compressedSizeBits); - uint8_t* lzwDecode(const uint8_t* compressed, uint32_t compressedSizeBytes, uint32_t compressedSizeBits, uint32_t uncompressedSizeBytes); - size_t b64Decode(const char* encoded, const size_t len, char** decoded); -} - -#endif //_TVG_COMPRESSOR_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgFill.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgFill.cpp deleted file mode 100644 index 76d678f..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgFill.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgFill.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -Fill* RadialGradient::Impl::duplicate() -{ - auto ret = RadialGradient::gen(); - if (!ret) return nullptr; - - ret->pImpl->cx = cx; - ret->pImpl->cy = cy; - ret->pImpl->r = r; - ret->pImpl->fx = fx; - ret->pImpl->fy = fy; - ret->pImpl->fr = fr; - - return ret.release(); -} - - -Result RadialGradient::Impl::radial(float cx, float cy, float r, float fx, float fy, float fr) -{ - if (r < 0 || fr < 0) return Result::InvalidArguments; - - this->cx = cx; - this->cy = cy; - this->r = r; - this->fx = fx; - this->fy = fy; - this->fr = fr; - - return Result::Success; -}; - - -Fill* LinearGradient::Impl::duplicate() -{ - auto ret = LinearGradient::gen(); - if (!ret) return nullptr; - - ret->pImpl->x1 = x1; - ret->pImpl->y1 = y1; - ret->pImpl->x2 = x2; - ret->pImpl->y2 = y2; - - return ret.release(); -}; - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -Fill::Fill():pImpl(new Impl()) -{ -} - - -Fill::~Fill() -{ - delete(pImpl); -} - - -Result Fill::colorStops(const ColorStop* colorStops, uint32_t cnt) noexcept -{ - if ((!colorStops && cnt > 0) || (colorStops && cnt == 0)) return Result::InvalidArguments; - - if (cnt == 0) { - if (pImpl->colorStops) { - free(pImpl->colorStops); - pImpl->colorStops = nullptr; - pImpl->cnt = 0; - } - return Result::Success; - } - - if (pImpl->cnt != cnt) { - pImpl->colorStops = static_cast(realloc(pImpl->colorStops, cnt * sizeof(ColorStop))); - } - - pImpl->cnt = cnt; - memcpy(pImpl->colorStops, colorStops, cnt * sizeof(ColorStop)); - - return Result::Success; -} - - -uint32_t Fill::colorStops(const ColorStop** colorStops) const noexcept -{ - if (colorStops) *colorStops = pImpl->colorStops; - - return pImpl->cnt; -} - - -Result Fill::spread(FillSpread s) noexcept -{ - pImpl->spread = s; - - return Result::Success; -} - - -FillSpread Fill::spread() const noexcept -{ - return pImpl->spread; -} - - -Result Fill::transform(const Matrix& m) noexcept -{ - if (!pImpl->transform) { - pImpl->transform = static_cast(malloc(sizeof(Matrix))); - } - *pImpl->transform = m; - return Result::Success; -} - - -Matrix Fill::transform() const noexcept -{ - if (pImpl->transform) return *pImpl->transform; - return {1, 0, 0, 0, 1, 0, 0, 0, 1}; -} - - -Fill* Fill::duplicate() const noexcept -{ - return pImpl->duplicate(); -} - - -uint32_t Fill::identifier() const noexcept -{ - return pImpl->id; -} - - -RadialGradient::RadialGradient():pImpl(new Impl()) -{ - Fill::pImpl->id = TVG_CLASS_ID_RADIAL; - Fill::pImpl->method(new FillDup(pImpl)); -} - - -RadialGradient::~RadialGradient() -{ - delete(pImpl); -} - - -Result RadialGradient::radial(float cx, float cy, float r) noexcept -{ - return pImpl->radial(cx, cy, r, cx, cy, 0.0f); -} - - -Result RadialGradient::radial(float* cx, float* cy, float* r) const noexcept -{ - if (cx) *cx = pImpl->cx; - if (cy) *cy = pImpl->cy; - if (r) *r = pImpl->r; - - return Result::Success; -} - - -unique_ptr RadialGradient::gen() noexcept -{ - return unique_ptr(new RadialGradient); -} - - -uint32_t RadialGradient::identifier() noexcept -{ - return TVG_CLASS_ID_RADIAL; -} - - -LinearGradient::LinearGradient():pImpl(new Impl()) -{ - Fill::pImpl->id = TVG_CLASS_ID_LINEAR; - Fill::pImpl->method(new FillDup(pImpl)); -} - - -LinearGradient::~LinearGradient() -{ - delete(pImpl); -} - - -Result LinearGradient::linear(float x1, float y1, float x2, float y2) noexcept -{ - pImpl->x1 = x1; - pImpl->y1 = y1; - pImpl->x2 = x2; - pImpl->y2 = y2; - - return Result::Success; -} - - -Result LinearGradient::linear(float* x1, float* y1, float* x2, float* y2) const noexcept -{ - if (x1) *x1 = pImpl->x1; - if (x2) *x2 = pImpl->x2; - if (y1) *y1 = pImpl->y1; - if (y2) *y2 = pImpl->y2; - - return Result::Success; -} - - -unique_ptr LinearGradient::gen() noexcept -{ - return unique_ptr(new LinearGradient); -} - - -uint32_t LinearGradient::identifier() noexcept -{ - return TVG_CLASS_ID_LINEAR; -} - - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgFill.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgFill.h deleted file mode 100644 index e6d776f..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgFill.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_FILL_H_ -#define _TVG_FILL_H_ - -#include -#include -#include "tvgCommon.h" - -template -struct DuplicateMethod -{ - virtual ~DuplicateMethod() {} - virtual T* duplicate() = 0; -}; - -template -struct FillDup : DuplicateMethod -{ - T* inst = nullptr; - - FillDup(T* _inst) : inst(_inst) {} - ~FillDup() {} - - Fill* duplicate() override - { - return inst->duplicate(); - } -}; - -struct Fill::Impl -{ - ColorStop* colorStops = nullptr; - Matrix* transform = nullptr; - uint32_t cnt = 0; - FillSpread spread; - DuplicateMethod* dup = nullptr; - uint8_t id; - - ~Impl() - { - delete(dup); - free(colorStops); - free(transform); - } - - void method(DuplicateMethod* dup) - { - this->dup = dup; - } - - Fill* duplicate() - { - auto ret = dup->duplicate(); - if (!ret) return nullptr; - - ret->pImpl->cnt = cnt; - ret->pImpl->spread = spread; - ret->pImpl->colorStops = static_cast(malloc(sizeof(ColorStop) * cnt)); - memcpy(ret->pImpl->colorStops, colorStops, sizeof(ColorStop) * cnt); - if (transform) { - ret->pImpl->transform = static_cast(malloc(sizeof(Matrix))); - *ret->pImpl->transform = *transform; - } - return ret; - } -}; - - -struct RadialGradient::Impl -{ - float cx = 0.0f, cy = 0.0f; - float fx = 0.0f, fy = 0.0f; - float r = 0.0f, fr = 0.0f; - - Fill* duplicate(); - Result radial(float cx, float cy, float r, float fx, float fy, float fr); -}; - - -struct LinearGradient::Impl -{ - float x1 = 0.0f; - float y1 = 0.0f; - float x2 = 0.0f; - float y2 = 0.0f; - - Fill* duplicate(); -}; - - -#endif //_TVG_FILL_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgFrameModule.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgFrameModule.h deleted file mode 100644 index 02e69a8..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgFrameModule.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_FRAME_MODULE_H_ -#define _TVG_FRAME_MODULE_H_ - -#include "tvgLoadModule.h" - -namespace tvg -{ - -class FrameModule: public ImageLoader -{ -public: - float segmentBegin = 0.0f; - float segmentEnd = 1.0f; - - FrameModule(FileType type) : ImageLoader(type) {} - virtual ~FrameModule() {} - - virtual bool frame(float no) = 0; //set the current frame number - virtual float totalFrame() = 0; //return the total frame count - virtual float curFrame() = 0; //return the current frame number - virtual float duration() = 0; //return the animation duration in seconds - - void segment(float* begin, float* end) - { - if (begin) *begin = segmentBegin; - if (end) *end = segmentEnd; - } - - void segment(float begin, float end) - { - segmentBegin = begin; - segmentEnd = end; - } - - virtual bool animatable() override { return true; } -}; - -} - -#endif //_TVG_FRAME_MODULE_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgGlCanvas.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgGlCanvas.cpp deleted file mode 100644 index d246ea5..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgGlCanvas.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgCanvas.h" - -#ifdef THORVG_GL_RASTER_SUPPORT - #include "tvgGlRenderer.h" -#else - class GlRenderer : public RenderMethod - { - //Non Supported. Dummy Class */ - }; -#endif - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -struct GlCanvas::Impl -{ -}; - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -#ifdef THORVG_GL_RASTER_SUPPORT -GlCanvas::GlCanvas() : Canvas(GlRenderer::gen()), pImpl(new Impl) -#else -GlCanvas::GlCanvas() : Canvas(nullptr), pImpl(new Impl) -#endif -{ -} - - - -GlCanvas::~GlCanvas() -{ - delete(pImpl); -} - - -Result GlCanvas::target(int32_t id, uint32_t w, uint32_t h) noexcept -{ -#ifdef THORVG_GL_RASTER_SUPPORT - //We know renderer type, avoid dynamic_cast for performance. - auto renderer = static_cast(Canvas::pImpl->renderer); - if (!renderer) return Result::MemoryCorruption; - - if (!renderer->target(id, w, h)) return Result::Unknown; - Canvas::pImpl->vport = {0, 0, (int32_t)w, (int32_t)h}; - renderer->viewport(Canvas::pImpl->vport); - - //Paints must be updated again with this new target. - Canvas::pImpl->needRefresh(); - - return Result::Success; -#endif - return Result::NonSupport; -} - - -unique_ptr GlCanvas::gen() noexcept -{ -#ifdef THORVG_GL_RASTER_SUPPORT - if (GlRenderer::init() <= 0) return nullptr; - return unique_ptr(new GlCanvas); -#endif - return nullptr; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgInitializer.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgInitializer.cpp deleted file mode 100644 index 2506fd2..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgInitializer.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgCommon.h" -#include "tvgTaskScheduler.h" -#include "tvgLoader.h" - -#ifdef _WIN32 - #include -#endif - -#ifdef THORVG_SW_RASTER_SUPPORT - #include "tvgSwRenderer.h" -#endif - -#ifdef THORVG_GL_RASTER_SUPPORT - #include "tvgGlRenderer.h" -#endif - -#ifdef THORVG_WG_RASTER_SUPPORT - #include "tvgWgRenderer.h" -#endif - - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static int _initCnt = 0; -static uint16_t _version = 0; - -//enum class operation helper -static constexpr bool operator &(CanvasEngine a, CanvasEngine b) -{ - return int(a) & int(b); -} - -static bool _buildVersionInfo() -{ - auto SRC = THORVG_VERSION_STRING; //ex) 0.3.99 - auto p = SRC; - const char* x; - - char major[3]; - x = strchr(p, '.'); - if (!x) return false; - memcpy(major, p, x - p); - major[x - p] = '\0'; - p = x + 1; - - char minor[3]; - x = strchr(p, '.'); - if (!x) return false; - memcpy(minor, p, x - p); - minor[x - p] = '\0'; - p = x + 1; - - char micro[3]; - x = SRC + strlen(THORVG_VERSION_STRING); - memcpy(micro, p, x - p); - micro[x - p] = '\0'; - - char sum[7]; - snprintf(sum, sizeof(sum), "%s%s%s", major, minor, micro); - - _version = atoi(sum); - - return true; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -Result Initializer::init(CanvasEngine engine, uint32_t threads) noexcept -{ - auto nonSupport = true; - if (static_cast(engine) == 0) return Result::InvalidArguments; - - if (engine & CanvasEngine::Sw) { - #ifdef THORVG_SW_RASTER_SUPPORT - if (!SwRenderer::init(threads)) return Result::FailedAllocation; - nonSupport = false; - #endif - } - - if (engine & CanvasEngine::Gl) { - #ifdef THORVG_GL_RASTER_SUPPORT - if (!GlRenderer::init(threads)) return Result::FailedAllocation; - nonSupport = false; - #endif - } - - if (engine & CanvasEngine::Wg) { - #ifdef THORVG_WG_RASTER_SUPPORT - if (!WgRenderer::init(threads)) return Result::FailedAllocation; - nonSupport = false; - #endif - } - - if (nonSupport) return Result::NonSupport; - - if (_initCnt++ > 0) return Result::Success; - - if (!_buildVersionInfo()) return Result::Unknown; - - if (!LoaderMgr::init()) return Result::Unknown; - - TaskScheduler::init(threads); - - return Result::Success; -} - - -Result Initializer::term(CanvasEngine engine) noexcept -{ - if (_initCnt == 0) return Result::InsufficientCondition; - - auto nonSupport = true; - if (static_cast(engine) == 0) return Result::InvalidArguments; - - if (engine & CanvasEngine::Sw) { - #ifdef THORVG_SW_RASTER_SUPPORT - if (!SwRenderer::term()) return Result::InsufficientCondition; - nonSupport = false; - #endif - } - - if (engine & CanvasEngine::Gl) { - #ifdef THORVG_GL_RASTER_SUPPORT - if (!GlRenderer::term()) return Result::InsufficientCondition; - nonSupport = false; - #endif - } - - if (engine & CanvasEngine::Wg) { - #ifdef THORVG_WG_RASTER_SUPPORT - if (!WgRenderer::term()) return Result::InsufficientCondition; - nonSupport = false; - #endif - } - - if (nonSupport) return Result::NonSupport; - - if (--_initCnt > 0) return Result::Success; - - TaskScheduler::term(); - - if (!LoaderMgr::term()) return Result::Unknown; - - return Result::Success; -} - - -uint16_t THORVG_VERSION_NUMBER() -{ - return _version; -} - - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgInlist.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgInlist.h deleted file mode 100644 index eaedecc..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgInlist.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_INLIST_H_ -#define _TVG_INLIST_H_ - -namespace tvg { - -//NOTE: declare this in your list item -#define INLIST_ITEM(T) \ - T* prev; \ - T* next - -template -struct Inlist -{ - T* head = nullptr; - T* tail = nullptr; - - void free() - { - while (head) { - auto t = head; - head = t->next; - delete(t); - } - head = tail = nullptr; - } - - void back(T* element) - { - if (tail) { - tail->next = element; - element->prev = tail; - element->next = nullptr; - tail = element; - } else { - head = tail = element; - element->prev = nullptr; - element->next = nullptr; - } - } - - void front(T* element) - { - if (head) { - head->prev = element; - element->prev = nullptr; - element->next = head; - head = element; - } else { - head = tail = element; - element->prev = nullptr; - element->next = nullptr; - } - } - - T* back() - { - if (!tail) return nullptr; - auto t = tail; - tail = t->prev; - if (!tail) head = nullptr; - return t; - } - - T* front() - { - if (!head) return nullptr; - auto t = head; - head = t->next; - if (!head) tail = nullptr; - return t; - } - - void remove(T* element) - { - if (element->prev) element->prev->next = element->next; - if (element->next) element->next->prev = element->prev; - if (element == head) head = element->next; - if (element == tail) tail = element->prev; - } - - bool empty() - { - return head ? false : true; - } -}; - -} - -#endif // _TVG_INLIST_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgIteratorAccessor.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgIteratorAccessor.h deleted file mode 100644 index adc5f6e..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgIteratorAccessor.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_ITERATOR_ACCESSOR_H_ -#define _TVG_ITERATOR_ACCESSOR_H_ - -#include "tvgPaint.h" - -namespace tvg -{ - -class IteratorAccessor -{ -public: - //Utility Method: Iterator Accessor - static Iterator* iterator(const Paint* paint) - { - return paint->pImpl->iterator(); - } -}; - -} - -#endif //_TVG_ITERATOR_ACCESSOR_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLines.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLines.cpp deleted file mode 100644 index 3bdab76..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLines.cpp +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgMath.h" -#include "tvgLines.h" - -#define BEZIER_EPSILON 1e-2f - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static float _lineLengthApprox(const Point& pt1, const Point& pt2) -{ - /* approximate sqrt(x*x + y*y) using alpha max plus beta min algorithm. - With alpha = 1, beta = 3/8, giving results with the largest error less - than 7% compared to the exact value. */ - Point diff = {pt2.x - pt1.x, pt2.y - pt1.y}; - if (diff.x < 0) diff.x = -diff.x; - if (diff.y < 0) diff.y = -diff.y; - return (diff.x > diff.y) ? (diff.x + diff.y * 0.375f) : (diff.y + diff.x * 0.375f); -} - - -static float _lineLength(const Point& pt1, const Point& pt2) -{ - Point diff = {pt2.x - pt1.x, pt2.y - pt1.y}; - return sqrtf(diff.x * diff.x + diff.y * diff.y); -} - - -template -float _bezLength(const Bezier& cur, LengthFunc lineLengthFunc) -{ - Bezier left, right; - auto len = lineLengthFunc(cur.start, cur.ctrl1) + lineLengthFunc(cur.ctrl1, cur.ctrl2) + lineLengthFunc(cur.ctrl2, cur.end); - auto chord = lineLengthFunc(cur.start, cur.end); - - if (fabsf(len - chord) > BEZIER_EPSILON) { - tvg::bezSplit(cur, left, right); - return _bezLength(left, lineLengthFunc) + _bezLength(right, lineLengthFunc); - } - return len; -} - - -template -float _bezAt(const Bezier& bz, float at, float length, LengthFunc lineLengthFunc) -{ - auto biggest = 1.0f; - auto smallest = 0.0f; - auto t = 0.5f; - - //just in case to prevent an infinite loop - if (at <= 0) return 0.0f; - if (at >= length) return 1.0f; - - while (true) { - auto right = bz; - Bezier left; - bezSplitLeft(right, t, left); - length = _bezLength(left, lineLengthFunc); - if (fabsf(length - at) < BEZIER_EPSILON || fabsf(smallest - biggest) < BEZIER_EPSILON) { - break; - } - if (length < at) { - smallest = t; - t = (t + biggest) * 0.5f; - } else { - biggest = t; - t = (smallest + t) * 0.5f; - } - } - return t; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -namespace tvg -{ - -float lineLength(const Point& pt1, const Point& pt2) -{ - return _lineLength(pt1, pt2); -} - - -void lineSplitAt(const Line& cur, float at, Line& left, Line& right) -{ - auto len = lineLength(cur.pt1, cur.pt2); - auto dx = ((cur.pt2.x - cur.pt1.x) / len) * at; - auto dy = ((cur.pt2.y - cur.pt1.y) / len) * at; - left.pt1 = cur.pt1; - left.pt2.x = left.pt1.x + dx; - left.pt2.y = left.pt1.y + dy; - right.pt1 = left.pt2; - right.pt2 = cur.pt2; -} - - -void bezSplit(const Bezier& cur, Bezier& left, Bezier& right) -{ - auto c = (cur.ctrl1.x + cur.ctrl2.x) * 0.5f; - left.ctrl1.x = (cur.start.x + cur.ctrl1.x) * 0.5f; - right.ctrl2.x = (cur.ctrl2.x + cur.end.x) * 0.5f; - left.start.x = cur.start.x; - right.end.x = cur.end.x; - left.ctrl2.x = (left.ctrl1.x + c) * 0.5f; - right.ctrl1.x = (right.ctrl2.x + c) * 0.5f; - left.end.x = right.start.x = (left.ctrl2.x + right.ctrl1.x) * 0.5f; - - c = (cur.ctrl1.y + cur.ctrl2.y) * 0.5f; - left.ctrl1.y = (cur.start.y + cur.ctrl1.y) * 0.5f; - right.ctrl2.y = (cur.ctrl2.y + cur.end.y) * 0.5f; - left.start.y = cur.start.y; - right.end.y = cur.end.y; - left.ctrl2.y = (left.ctrl1.y + c) * 0.5f; - right.ctrl1.y = (right.ctrl2.y + c) * 0.5f; - left.end.y = right.start.y = (left.ctrl2.y + right.ctrl1.y) * 0.5f; -} - - -float bezLength(const Bezier& cur) -{ - return _bezLength(cur, _lineLength); -} - - -float bezLengthApprox(const Bezier& cur) -{ - return _bezLength(cur, _lineLengthApprox); -} - - -void bezSplitLeft(Bezier& cur, float at, Bezier& left) -{ - left.start = cur.start; - - left.ctrl1.x = cur.start.x + at * (cur.ctrl1.x - cur.start.x); - left.ctrl1.y = cur.start.y + at * (cur.ctrl1.y - cur.start.y); - - left.ctrl2.x = cur.ctrl1.x + at * (cur.ctrl2.x - cur.ctrl1.x); //temporary holding spot - left.ctrl2.y = cur.ctrl1.y + at * (cur.ctrl2.y - cur.ctrl1.y); //temporary holding spot - - cur.ctrl2.x = cur.ctrl2.x + at * (cur.end.x - cur.ctrl2.x); - cur.ctrl2.y = cur.ctrl2.y + at * (cur.end.y - cur.ctrl2.y); - - cur.ctrl1.x = left.ctrl2.x + at * (cur.ctrl2.x - left.ctrl2.x); - cur.ctrl1.y = left.ctrl2.y + at * (cur.ctrl2.y - left.ctrl2.y); - - left.ctrl2.x = left.ctrl1.x + at * (left.ctrl2.x - left.ctrl1.x); - left.ctrl2.y = left.ctrl1.y + at * (left.ctrl2.y - left.ctrl1.y); - - left.end.x = cur.start.x = left.ctrl2.x + at * (cur.ctrl1.x - left.ctrl2.x); - left.end.y = cur.start.y = left.ctrl2.y + at * (cur.ctrl1.y - left.ctrl2.y); -} - - -float bezAt(const Bezier& bz, float at, float length) -{ - return _bezAt(bz, at, length, _lineLength); -} - - -float bezAtApprox(const Bezier& bz, float at, float length) -{ - return _bezAt(bz, at, length, _lineLengthApprox); -} - - -void bezSplitAt(const Bezier& cur, float at, Bezier& left, Bezier& right) -{ - right = cur; - auto t = bezAt(right, at, bezLength(right)); - bezSplitLeft(right, t, left); -} - - -Point bezPointAt(const Bezier& bz, float t) -{ - Point cur; - auto it = 1.0f - t; - - auto ax = bz.start.x * it + bz.ctrl1.x * t; - auto bx = bz.ctrl1.x * it + bz.ctrl2.x * t; - auto cx = bz.ctrl2.x * it + bz.end.x * t; - ax = ax * it + bx * t; - bx = bx * it + cx * t; - cur.x = ax * it + bx * t; - - float ay = bz.start.y * it + bz.ctrl1.y * t; - float by = bz.ctrl1.y * it + bz.ctrl2.y * t; - float cy = bz.ctrl2.y * it + bz.end.y * t; - ay = ay * it + by * t; - by = by * it + cy * t; - cur.y = ay * it + by * t; - - return cur; -} - - -float bezAngleAt(const Bezier& bz, float t) -{ - if (t < 0 || t > 1) return 0; - - //derivate - // p'(t) = 3 * (-(1-2t+t^2) * p0 + (1 - 4 * t + 3 * t^2) * p1 + (2 * t - 3 * - // t^2) * p2 + t^2 * p3) - float mt = 1.0f - t; - float d = t * t; - float a = -mt * mt; - float b = 1 - 4 * t + 3 * d; - float c = 2 * t - 3 * d; - - Point pt ={a * bz.start.x + b * bz.ctrl1.x + c * bz.ctrl2.x + d * bz.end.x, a * bz.start.y + b * bz.ctrl1.y + c * bz.ctrl2.y + d * bz.end.y}; - pt.x *= 3; - pt.y *= 3; - - return mathRad2Deg(atan2(pt.x, pt.y)); -} - -} - -#endif /* LV_USE_THORVG_INTERNAL */ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLines.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLines.h deleted file mode 100644 index 804ced1..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLines.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_LINES_H_ -#define _TVG_LINES_H_ - -#include "tvgCommon.h" - -namespace tvg -{ - -struct Line -{ - Point pt1; - Point pt2; -}; - -float lineLength(const Point& pt1, const Point& pt2); -void lineSplitAt(const Line& cur, float at, Line& left, Line& right); - - -struct Bezier -{ - Point start; - Point ctrl1; - Point ctrl2; - Point end; -}; - -void bezSplit(const Bezier&cur, Bezier& left, Bezier& right); -float bezLength(const Bezier& cur); -void bezSplitLeft(Bezier& cur, float at, Bezier& left); -float bezAt(const Bezier& bz, float at, float length); -void bezSplitAt(const Bezier& cur, float at, Bezier& left, Bezier& right); -Point bezPointAt(const Bezier& bz, float t); -float bezAngleAt(const Bezier& bz, float t); - -float bezLengthApprox(const Bezier& cur); -float bezAtApprox(const Bezier& bz, float at, float length); -} - -#endif //_TVG_LINES_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLoadModule.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLoadModule.h deleted file mode 100644 index 210995f..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLoadModule.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_LOAD_MODULE_H_ -#define _TVG_LOAD_MODULE_H_ - -#include "tvgRender.h" -#include "tvgInlist.h" - - -struct LoadModule -{ - INLIST_ITEM(LoadModule); - - //Use either hashkey(data) or hashpath(path) - union { - uintptr_t hashkey; - char* hashpath = nullptr; - }; - - FileType type; //current loader file type - uint16_t sharing = 0; //reference count - bool readied = false; //read done already. - bool pathcache = false; //cached by path - - LoadModule(FileType type) : type(type) {} - virtual ~LoadModule() - { - if (pathcache) free(hashpath); - } - - virtual bool open(const string& path) { return false; } - virtual bool open(const char* data, uint32_t size, bool copy) { return false; } - virtual bool resize(Paint* paint, float w, float h) { return false; } - virtual void sync() {}; //finish immediately if any async update jobs. - - virtual bool read() - { - if (readied) return false; - readied = true; - return true; - } - - bool cached() - { - if (hashkey) return true; - return false; - } - - virtual bool close() - { - if (sharing == 0) return true; - --sharing; - return false; - } -}; - - -struct ImageLoader : LoadModule -{ - static ColorSpace cs; //desired value - - float w = 0, h = 0; //default image size - Surface surface; - - ImageLoader(FileType type) : LoadModule(type) {} - - virtual bool animatable() { return false; } //true if this loader supports animation. - virtual Paint* paint() { return nullptr; } - - virtual Surface* bitmap() - { - if (surface.data) return &surface; - return nullptr; - } -}; - - -struct FontLoader : LoadModule -{ - float scale = 1.0f; - - FontLoader(FileType type) : LoadModule(type) {} - - virtual bool request(Shape* shape, char* text, bool italic = false) = 0; -}; - -#endif //_TVG_LOAD_MODULE_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLoader.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLoader.cpp deleted file mode 100644 index 8d1a3c5..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLoader.cpp +++ /dev/null @@ -1,441 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include - -#include "tvgInlist.h" -#include "tvgLoader.h" -#include "tvgLock.h" - -#ifdef THORVG_SVG_LOADER_SUPPORT - #include "tvgSvgLoader.h" -#endif - -#ifdef THORVG_PNG_LOADER_SUPPORT - #include "tvgPngLoader.h" -#endif - -#ifdef THORVG_TVG_LOADER_SUPPORT - #include "tvgTvgLoader.h" -#endif - -#ifdef THORVG_JPG_LOADER_SUPPORT - #include "tvgJpgLoader.h" -#endif - -#ifdef THORVG_WEBP_LOADER_SUPPORT - #include "tvgWebpLoader.h" -#endif - -#ifdef THORVG_TTF_LOADER_SUPPORT - #include "tvgTtfLoader.h" -#endif - -#ifdef THORVG_LOTTIE_LOADER_SUPPORT - #include "tvgLottieLoader.h" -#endif - -#include "tvgRawLoader.h" - - -uintptr_t HASH_KEY(const char* data) -{ - return reinterpret_cast(data); -} - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -ColorSpace ImageLoader::cs = ColorSpace::ARGB8888; - -static Key key; -static Inlist _activeLoaders; - - -static LoadModule* _find(FileType type) -{ - switch(type) { - case FileType::Png: { -#ifdef THORVG_PNG_LOADER_SUPPORT - return new PngLoader; -#endif - break; - } - case FileType::Jpg: { -#ifdef THORVG_JPG_LOADER_SUPPORT - return new JpgLoader; -#endif - break; - } - case FileType::Webp: { -#ifdef THORVG_WEBP_LOADER_SUPPORT - return new WebpLoader; -#endif - break; - } - case FileType::Tvg: { -#ifdef THORVG_TVG_LOADER_SUPPORT - return new TvgLoader; -#endif - break; - } - case FileType::Svg: { -#ifdef THORVG_SVG_LOADER_SUPPORT - return new SvgLoader; -#endif - break; - } - case FileType::Ttf: { -#ifdef THORVG_TTF_LOADER_SUPPORT - return new TtfLoader; -#endif - break; - } - case FileType::Lottie: { -#ifdef THORVG_LOTTIE_LOADER_SUPPORT - return new LottieLoader; -#endif - break; - } - case FileType::Raw: { - return new RawLoader; - break; - } - default: { - break; - } - } - -#ifdef THORVG_LOG_ENABLED - const char *format; - switch(type) { - case FileType::Tvg: { - format = "TVG"; - break; - } - case FileType::Svg: { - format = "SVG"; - break; - } - case FileType::Ttf: { - format = "TTF"; - break; - } - case FileType::Lottie: { - format = "lottie(json)"; - break; - } - case FileType::Raw: { - format = "RAW"; - break; - } - case FileType::Png: { - format = "PNG"; - break; - } - case FileType::Jpg: { - format = "JPG"; - break; - } - case FileType::Webp: { - format = "WEBP"; - break; - } - default: { - format = "???"; - break; - } - } - TVGLOG("RENDERER", "%s format is not supported", format); -#endif - return nullptr; -} - - -static LoadModule* _findByPath(const string& path) -{ - auto ext = path.substr(path.find_last_of(".") + 1); - if (!ext.compare("tvg")) return _find(FileType::Tvg); - if (!ext.compare("svg")) return _find(FileType::Svg); - if (!ext.compare("json")) return _find(FileType::Lottie); - if (!ext.compare("png")) return _find(FileType::Png); - if (!ext.compare("jpg")) return _find(FileType::Jpg); - if (!ext.compare("webp")) return _find(FileType::Webp); - if (!ext.compare("ttf") || !ext.compare("ttc")) return _find(FileType::Ttf); - if (!ext.compare("otf") || !ext.compare("otc")) return _find(FileType::Ttf); - return nullptr; -} - - -static FileType _convert(const string& mimeType) -{ - auto type = FileType::Unknown; - - if (mimeType == "tvg") type = FileType::Tvg; - else if (mimeType == "svg" || mimeType == "svg+xml") type = FileType::Svg; - else if (mimeType == "ttf" || mimeType == "otf") type = FileType::Ttf; - else if (mimeType == "lottie") type = FileType::Lottie; - else if (mimeType == "raw") type = FileType::Raw; - else if (mimeType == "png") type = FileType::Png; - else if (mimeType == "jpg" || mimeType == "jpeg") type = FileType::Jpg; - else if (mimeType == "webp") type = FileType::Webp; - else TVGLOG("RENDERER", "Given mimetype is unknown = \"%s\".", mimeType.c_str()); - - return type; -} - - -static LoadModule* _findByType(const string& mimeType) -{ - return _find(_convert(mimeType)); -} - - -static LoadModule* _findFromCache(const string& path) -{ - ScopedLock lock(key); - - auto loader = _activeLoaders.head; - - while (loader) { - if (loader->pathcache && !strcmp(loader->hashpath, path.c_str())) { - ++loader->sharing; - return loader; - } - loader = loader->next; - } - return nullptr; -} - - -static LoadModule* _findFromCache(const char* data, uint32_t size, const string& mimeType) -{ - auto type = _convert(mimeType); - if (type == FileType::Unknown) return nullptr; - - ScopedLock lock(key); - auto loader = _activeLoaders.head; - - auto key = HASH_KEY(data); - - while (loader) { - if (loader->type == type && loader->hashkey == key) { - ++loader->sharing; - return loader; - } - loader = loader->next; - } - return nullptr; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - - -bool LoaderMgr::init() -{ - return true; -} - - -bool LoaderMgr::term() -{ - auto loader = _activeLoaders.head; - - //clean up the remained font loaders which is globally used. - while (loader && loader->type == FileType::Ttf) { - auto ret = loader->close(); - auto tmp = loader; - loader = loader->next; - _activeLoaders.remove(tmp); - if (ret) delete(tmp); - } - return true; -} - - -bool LoaderMgr::retrieve(LoadModule* loader) -{ - if (!loader) return false; - if (loader->close()) { - if (loader->cached()) { - ScopedLock lock(key); - _activeLoaders.remove(loader); - } - delete(loader); - } - return true; -} - - -LoadModule* LoaderMgr::loader(const string& path, bool* invalid) -{ - *invalid = false; - - //TODO: lottie is not sharable. - auto allowCache = true; - auto ext = path.substr(path.find_last_of(".") + 1); - if (!ext.compare("json")) allowCache = false; - - if (allowCache) { - if (auto loader = _findFromCache(path)) return loader; - } - - if (auto loader = _findByPath(path)) { - if (loader->open(path)) { - if (allowCache) { - loader->hashpath = strdup(path.c_str()); - loader->pathcache = true; - { - ScopedLock lock(key); - _activeLoaders.back(loader); - } - } - return loader; - } - delete(loader); - } - //Unknown MimeType. Try with the candidates in the order - for (int i = 0; i < static_cast(FileType::Raw); i++) { - if (auto loader = _find(static_cast(i))) { - if (loader->open(path)) { - if (allowCache) { - loader->hashpath = strdup(path.c_str()); - loader->pathcache = true; - { - ScopedLock lock(key); - _activeLoaders.back(loader); - } - } - return loader; - } - delete(loader); - } - } - *invalid = true; - return nullptr; -} - - -bool LoaderMgr::retrieve(const string& path) -{ - return retrieve(_findFromCache(path)); -} - - -LoadModule* LoaderMgr::loader(const char* key) -{ - auto loader = _activeLoaders.head; - - while (loader) { - if (loader->pathcache && strstr(loader->hashpath, key)) { - ++loader->sharing; - return loader; - } - loader = loader->next; - } - return nullptr; -} - - -LoadModule* LoaderMgr::loader(const char* data, uint32_t size, const string& mimeType, bool copy) -{ - //Note that users could use the same data pointer with the different content. - //Thus caching is only valid for shareable. - auto allowCache = !copy; - - //TODO: lottie is not sharable. - if (allowCache) { - auto type = _convert(mimeType); - if (type == FileType::Lottie) allowCache = false; - } - - if (allowCache) { - if (auto loader = _findFromCache(data, size, mimeType)) return loader; - } - - //Try with the given MimeType - if (!mimeType.empty()) { - if (auto loader = _findByType(mimeType)) { - if (loader->open(data, size, copy)) { - if (allowCache) { - loader->hashkey = HASH_KEY(data); - ScopedLock lock(key); - _activeLoaders.back(loader); - } - return loader; - } else { - TVGLOG("LOADER", "Given mimetype \"%s\" seems incorrect or not supported.", mimeType.c_str()); - delete(loader); - } - } - } - //Unknown MimeType. Try with the candidates in the order - for (int i = 0; i < static_cast(FileType::Raw); i++) { - auto loader = _find(static_cast(i)); - if (loader) { - if (loader->open(data, size, copy)) { - if (allowCache) { - loader->hashkey = HASH_KEY(data); - ScopedLock lock(key); - _activeLoaders.back(loader); - } - return loader; - } - delete(loader); - } - } - return nullptr; -} - - -LoadModule* LoaderMgr::loader(const uint32_t *data, uint32_t w, uint32_t h, bool copy) -{ - //Note that users could use the same data pointer with the different content. - //Thus caching is only valid for shareable. - if (!copy) { - //TODO: should we check premultiplied?? - if (auto loader = _findFromCache((const char*)(data), w * h, "raw")) return loader; - } - - //function is dedicated for raw images only - auto loader = new RawLoader; - if (loader->open(data, w, h, copy)) { - if (!copy) { - loader->hashkey = HASH_KEY((const char*)data); - ScopedLock lock(key); - _activeLoaders.back(loader); - } - return loader; - } - delete(loader); - return nullptr; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLoader.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLoader.h deleted file mode 100644 index 5067699..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLoader.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_LOADER_H_ -#define _TVG_LOADER_H_ - -#include "tvgLoadModule.h" - -struct LoaderMgr -{ - static bool init(); - static bool term(); - static LoadModule* loader(const string& path, bool* invalid); - static LoadModule* loader(const char* data, uint32_t size, const string& mimeType, bool copy); - static LoadModule* loader(const uint32_t* data, uint32_t w, uint32_t h, bool copy); - static LoadModule* loader(const char* key); - static bool retrieve(const string& path); - static bool retrieve(LoadModule* loader); -}; - -#endif //_TVG_LOADER_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLock.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLock.h deleted file mode 100644 index 709c120..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLock.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_LOCK_H_ -#define _TVG_LOCK_H_ - -#ifdef THORVG_THREAD_SUPPORT - -#include - -namespace tvg { - - struct Key - { - std::mutex mtx; - }; - - struct ScopedLock - { - Key* key = nullptr; - - ScopedLock(Key& k) - { - k.mtx.lock(); - key = &k; - } - - ~ScopedLock() - { - key->mtx.unlock(); - } - }; - -} - -#else //THORVG_THREAD_SUPPORT - -namespace tvg { - - struct Key {}; - - struct ScopedLock - { - ScopedLock(Key& key) {} - }; - -} - -#endif //THORVG_THREAD_SUPPORT - -#endif //_TVG_LOCK_H_ - - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieAnimation.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieAnimation.cpp deleted file mode 100644 index 69818b3..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieAnimation.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgCommon.h" -#include "thorvg_lottie.h" -#include "tvgLottieLoader.h" -#include "tvgAnimation.h" - - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -LottieAnimation::~LottieAnimation() -{ -} - - -Result LottieAnimation::override(const char* slot) noexcept -{ - if (!pImpl->picture->pImpl->loader) return Result::InsufficientCondition; - - if (static_cast(pImpl->picture->pImpl->loader)->override(slot)) { - return Result::Success; - } - - return Result::InvalidArguments; -} - - -Result LottieAnimation::segment(const char* marker) noexcept -{ - auto loader = pImpl->picture->pImpl->loader; - if (!loader) return Result::InsufficientCondition; - if (!loader->animatable()) return Result::NonSupport; - - if (!marker) { - static_cast(loader)->segment(0.0f, 1.0f); - return Result::Success; - } - - float begin, end; - if (!static_cast(loader)->segment(marker, begin, end)) { - return Result::InvalidArguments; - } - return static_cast(this)->segment(begin, end); -} - - -uint32_t LottieAnimation::markersCnt() noexcept -{ - auto loader = pImpl->picture->pImpl->loader; - if (!loader || !loader->animatable()) return 0; - return static_cast(loader)->markersCnt(); -} - - -const char* LottieAnimation::marker(uint32_t idx) noexcept -{ - auto loader = pImpl->picture->pImpl->loader; - if (!loader || !loader->animatable()) return nullptr; - return static_cast(loader)->markers(idx); -} - - -unique_ptr LottieAnimation::gen() noexcept -{ - return unique_ptr(new LottieAnimation); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieBuilder.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieBuilder.cpp deleted file mode 100644 index 82a43cf..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieBuilder.cpp +++ /dev/null @@ -1,1378 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include - -#include "tvgCommon.h" -#include "tvgMath.h" -#include "tvgPaint.h" -#include "tvgShape.h" -#include "tvgInlist.h" -#include "tvgTaskScheduler.h" -#include "tvgLottieModel.h" -#include "tvgLottieBuilder.h" -#include "tvgLottieExpressions.h" - - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -struct RenderRepeater -{ - int cnt; - float offset; - Point position; - Point anchor; - Point scale; - float rotation; - uint8_t startOpacity; - uint8_t endOpacity; - bool interpOpacity; - bool inorder; -}; - - -struct RenderContext -{ - INLIST_ITEM(RenderContext); - - Shape* propagator = nullptr; - Shape* merging = nullptr; //merging shapes if possible (if shapes have same properties) - LottieObject** begin = nullptr; //iteration entry point - RenderRepeater* repeater = nullptr; - Matrix* transform = nullptr; - float roundness = 0.0f; - bool fragmenting = false; //render context has been fragmented by filling - bool reqFragment = false; //requirement to fragment the render context - bool ownPropagator = true; //this rendering context shares the propagator - - RenderContext() - { - propagator = Shape::gen().release(); - } - - ~RenderContext() - { - if (ownPropagator) delete(propagator); - delete(repeater); - free(transform); - } - - RenderContext(const RenderContext& rhs, bool mergeable = false) - { - if (mergeable) { - this->ownPropagator = false; - propagator = rhs.propagator; - merging = rhs.merging; - } else { - propagator = static_cast(rhs.propagator->duplicate()); - } - - if (rhs.repeater) { - repeater = new RenderRepeater(); - *repeater = *rhs.repeater; - } - roundness = rhs.roundness; - } -}; - - -static void _updateChildren(LottieGroup* parent, float frameNo, Inlist& contexts, LottieExpressions* exps); -static void _updateLayer(LottieLayer* root, LottieLayer* layer, float frameNo, LottieExpressions* exps); -static bool _buildComposition(LottieComposition* comp, LottieGroup* parent); -static Shape* _draw(LottieGroup* parent, RenderContext* ctx); - -static void _rotateX(Matrix* m, float degree) -{ - if (degree == 0.0f) return; - auto radian = mathDeg2Rad(degree); - m->e22 *= cosf(radian); -} - - -static void _rotateY(Matrix* m, float degree) -{ - if (degree == 0.0f) return; - auto radian = mathDeg2Rad(degree); - m->e11 *= cosf(radian); -} - - -static void _rotationZ(Matrix* m, float degree) -{ - if (degree == 0.0f) return; - auto radian = mathDeg2Rad(degree); - m->e11 = cosf(radian); - m->e12 = -sinf(radian); - m->e21 = sinf(radian); - m->e22 = cosf(radian); -} - - -static void _skew(Matrix* m, float angleDeg, float axisDeg) -{ - auto angle = -mathDeg2Rad(angleDeg); - float tanVal = tanf(angle); - - axisDeg = fmod(axisDeg, 180.0f); - if (fabsf(axisDeg) < 0.01f || fabsf(axisDeg - 180.0f) < 0.01f || fabsf(axisDeg + 180.0f) < 0.01f) { - float cosVal = cosf(mathDeg2Rad(axisDeg)); - auto B = cosVal * cosVal * tanVal; - m->e12 += B * m->e11; - m->e22 += B * m->e21; - return; - } else if (fabsf(axisDeg - 90.0f) < 0.01f || fabsf(axisDeg + 90.0f) < 0.01f) { - float sinVal = -sinf(mathDeg2Rad(axisDeg)); - auto C = sinVal * sinVal * tanVal; - m->e11 -= C * m->e12; - m->e21 -= C * m->e22; - return; - } - - auto axis = -mathDeg2Rad(axisDeg); - float cosVal = cosf(axis); - float sinVal = sinf(axis); - auto A = sinVal * cosVal * tanVal; - auto B = cosVal * cosVal * tanVal; - auto C = sinVal * sinVal * tanVal; - - auto e11 = m->e11; - auto e21 = m->e21; - m->e11 = (1.0f - A) * e11 - C * m->e12; - m->e12 = B * e11 + (1.0f + A) * m->e12; - m->e21 = (1.0f - A) * e21 - C * m->e22; - m->e22 = B * e21 + (1.0f + A) * m->e22; -} - - -static bool _updateTransform(LottieTransform* transform, float frameNo, bool autoOrient, Matrix& matrix, uint8_t& opacity, LottieExpressions* exps) -{ - mathIdentity(&matrix); - - if (!transform) { - opacity = 255; - return false; - } - - if (transform->coords) { - mathTranslate(&matrix, transform->coords->x(frameNo), transform->coords->y(frameNo)); - } else { - auto position = transform->position(frameNo, exps); - mathTranslate(&matrix, position.x, position.y); - } - - auto angle = 0.0f; - if (autoOrient) angle = transform->position.angle(frameNo); - _rotationZ(&matrix, transform->rotation(frameNo, exps) + angle); - - if (transform->rotationEx) { - _rotateY(&matrix, transform->rotationEx->y(frameNo, exps)); - _rotateX(&matrix, transform->rotationEx->x(frameNo, exps)); - } - - auto skewAngle = transform->skewAngle(frameNo, exps); - if (skewAngle != 0.0f) { - // For angles where tangent explodes, the shape degenerates into an infinitely thin line. - // This is handled by zeroing out the matrix due to finite numerical precision. - skewAngle = fmod(skewAngle, 180.0f); - if (fabsf(skewAngle - 90.0f) < 0.01f || fabsf(skewAngle + 90.0f) < 0.01f) return false; - _skew(&matrix, skewAngle, transform->skewAxis(frameNo, exps)); - } - - auto scale = transform->scale(frameNo, exps); - mathScaleR(&matrix, scale.x * 0.01f, scale.y * 0.01f); - - //Lottie specific anchor transform. - auto anchor = transform->anchor(frameNo, exps); - mathTranslateR(&matrix, -anchor.x, -anchor.y); - - //invisible just in case. - if (scale.x == 0.0f || scale.y == 0.0f) opacity = 0; - else opacity = transform->opacity(frameNo, exps); - - return true; -} - - -static void _updateTransform(LottieLayer* layer, float frameNo, LottieExpressions* exps) -{ - if (!layer || mathEqual(layer->cache.frameNo, frameNo)) return; - - auto transform = layer->transform; - auto parent = layer->parent; - - if (parent) _updateTransform(parent, frameNo, exps); - - auto& matrix = layer->cache.matrix; - - _updateTransform(transform, frameNo, layer->autoOrient, matrix, layer->cache.opacity, exps); - - if (parent) { - if (!mathIdentity((const Matrix*) &parent->cache.matrix)) { - if (mathIdentity((const Matrix*) &matrix)) layer->cache.matrix = parent->cache.matrix; - else layer->cache.matrix = mathMultiply(&parent->cache.matrix, &matrix); - } - } - layer->cache.frameNo = frameNo; -} - - -static void _updateTransform(LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - auto transform = static_cast(*child); - if (!transform) return; - - uint8_t opacity; - - if (parent->mergeable()) { - if (!ctx->transform) ctx->transform = (Matrix*)malloc(sizeof(Matrix)); - _updateTransform(transform, frameNo, false, *ctx->transform, opacity, exps); - return; - } - - ctx->merging = nullptr; - - Matrix matrix; - if (!_updateTransform(transform, frameNo, false, matrix, opacity, exps)) return; - - auto pmatrix = PP(ctx->propagator)->transform(); - ctx->propagator->transform(pmatrix ? mathMultiply(pmatrix, &matrix) : matrix); - ctx->propagator->opacity(MULTIPLY(opacity, PP(ctx->propagator)->opacity)); - - //FIXME: preserve the stroke width. too workaround, need a better design. - if (P(ctx->propagator)->rs.strokeWidth() > 0.0f) { - auto denominator = sqrtf(matrix.e11 * matrix.e11 + matrix.e12 * matrix.e12); - if (denominator > 1.0f) ctx->propagator->stroke(ctx->propagator->strokeWidth() / denominator); - } -} - - -static void _updateGroup(LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& pcontexts, RenderContext* ctx, LottieExpressions* exps) -{ - auto group = static_cast(*child); - - if (group->children.empty()) return; - - //Prepare render data - group->scene = parent->scene; - group->reqFragment |= ctx->reqFragment; - - //generate a merging shape to consolidate partial shapes into a single entity - if (group->mergeable()) _draw(parent, ctx); - - Inlist contexts; - contexts.back(new RenderContext(*ctx, group->mergeable())); - - _updateChildren(group, frameNo, contexts, exps); - - contexts.free(); -} - - -static void _updateStroke(LottieStroke* stroke, float frameNo, RenderContext* ctx, LottieExpressions* exps) -{ - ctx->propagator->stroke(stroke->width(frameNo, exps)); - ctx->propagator->stroke(stroke->cap); - ctx->propagator->stroke(stroke->join); - ctx->propagator->strokeMiterlimit(stroke->miterLimit); - - if (stroke->dashattr) { - float dashes[2]; - dashes[0] = stroke->dashSize(frameNo, exps); - dashes[1] = dashes[0] + stroke->dashGap(frameNo, exps); - P(ctx->propagator)->strokeDash(dashes, 2, stroke->dashOffset(frameNo, exps)); - } else { - ctx->propagator->stroke(nullptr, 0); - } -} - - -static bool _fragmented(LottieObject** child, Inlist& contexts, RenderContext* ctx) -{ - if (!ctx->reqFragment) return false; - if (ctx->fragmenting) return true; - - contexts.back(new RenderContext(*ctx)); - auto fragment = contexts.tail; - fragment->begin = child - 1; - ctx->fragmenting = true; - - return false; -} - - -static void _updateSolidStroke(TVG_UNUSED LottieGroup* parent, LottieObject** child, float frameNo, Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - if (_fragmented(child, contexts, ctx)) return; - - auto stroke = static_cast(*child); - - ctx->merging = nullptr; - auto color = stroke->color(frameNo, exps); - ctx->propagator->stroke(color.rgb[0], color.rgb[1], color.rgb[2], stroke->opacity(frameNo, exps)); - _updateStroke(static_cast(stroke), frameNo, ctx, exps); -} - - -static void _updateGradientStroke(TVG_UNUSED LottieGroup* parent, LottieObject** child, float frameNo, Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - if (_fragmented(child, contexts, ctx)) return; - - auto stroke = static_cast(*child); - - ctx->merging = nullptr; - ctx->propagator->stroke(unique_ptr(stroke->fill(frameNo, exps))); - _updateStroke(static_cast(stroke), frameNo, ctx, exps); -} - - -static void _updateSolidFill(TVG_UNUSED LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - if (_fragmented(child, contexts, ctx)) return; - - auto fill = static_cast(*child); - - ctx->merging = nullptr; - auto color = fill->color(frameNo); - ctx->propagator->fill(color.rgb[0], color.rgb[1], color.rgb[2], fill->opacity(frameNo, exps)); - ctx->propagator->fill(fill->rule); - - if (ctx->propagator->strokeWidth() > 0) ctx->propagator->order(true); -} - - -static void _updateGradientFill(TVG_UNUSED LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - if (_fragmented(child, contexts, ctx)) return; - - auto fill = static_cast(*child); - - ctx->merging = nullptr; - //TODO: reuse the fill instance? - ctx->propagator->fill(unique_ptr(fill->fill(frameNo, exps))); - ctx->propagator->fill(fill->rule); - ctx->propagator->opacity(MULTIPLY(fill->opacity(frameNo), PP(ctx->propagator)->opacity)); - - if (ctx->propagator->strokeWidth() > 0) ctx->propagator->order(true); -} - - -static Shape* _draw(LottieGroup* parent, RenderContext* ctx) -{ - if (ctx->merging) return ctx->merging; - - auto shape = cast(ctx->propagator->duplicate()); - ctx->merging = shape.get(); - parent->scene->push(std::move(shape)); - - return ctx->merging; -} - - -//OPTIMIZE: path? -static void _repeat(LottieGroup* parent, unique_ptr path, RenderContext* ctx) -{ - auto repeater = ctx->repeater; - - Array shapes(repeater->cnt); - - for (int i = 0; i < repeater->cnt; ++i) { - auto multiplier = repeater->offset + static_cast(i); - - auto shape = static_cast(ctx->propagator->duplicate()); - P(shape)->rs.path = P(path.get())->rs.path; - - auto opacity = repeater->interpOpacity ? mathLerp(repeater->startOpacity, repeater->endOpacity, static_cast(i + 1) / repeater->cnt) : repeater->startOpacity; - shape->opacity(opacity); - - Matrix m; - mathIdentity(&m); - mathTranslate(&m, repeater->position.x * multiplier + repeater->anchor.x, repeater->position.y * multiplier + repeater->anchor.y); - mathScale(&m, powf(repeater->scale.x * 0.01f, multiplier), powf(repeater->scale.y * 0.01f, multiplier)); - mathRotate(&m, repeater->rotation * multiplier); - mathTranslateR(&m, -repeater->anchor.x, -repeater->anchor.y); - - auto pm = PP(shape)->transform(); - shape->transform(pm ? mathMultiply(&m, pm) : m); - - if (ctx->roundness > 1.0f && P(shape)->rs.stroke) { - TVGERR("LOTTIE", "FIXME: Path roundness should be applied properly!"); - P(shape)->rs.stroke->join = StrokeJoin::Round; - } - - shapes.push(shape); - } - - //push repeat shapes in order. - if (repeater->inorder) { - for (auto shape = shapes.begin(); shape < shapes.end(); ++shape) { - parent->scene->push(cast(*shape)); - } - } else { - for (auto shape = shapes.end() - 1; shape >= shapes.begin(); --shape) { - parent->scene->push(cast(*shape)); - } - } -} - - -static void _appendRect(Shape* shape, float x, float y, float w, float h, float r, Matrix* transform) -{ - //sharp rect - if (mathZero(r)) { - PathCommand commands[] = { - PathCommand::MoveTo, PathCommand::LineTo, PathCommand::LineTo, - PathCommand::LineTo, PathCommand::Close - }; - - Point points[] = {{x + w, y}, {x + w, y + h}, {x, y + h}, {x, y}}; - if (transform) { - for (int i = 0; i < 4; i++) mathTransform(transform, &points[i]); - } - shape->appendPath(commands, 5, points, 4); - //round rect - } else { - PathCommand commands[] = { - PathCommand::MoveTo, PathCommand::LineTo, PathCommand::CubicTo, - PathCommand::LineTo, PathCommand::CubicTo, PathCommand::LineTo, - PathCommand::CubicTo, PathCommand::LineTo, PathCommand::CubicTo, - PathCommand::Close - }; - - auto halfW = w * 0.5f; - auto halfH = h * 0.5f; - auto rx = r > halfW ? halfW : r; - auto ry = r > halfH ? halfH : r; - auto hrx = rx * PATH_KAPPA; - auto hry = ry * PATH_KAPPA; - - constexpr int ptsCnt = 17; - Point points[ptsCnt] = { - {x + w, y + ry}, //moveTo - {x + w, y + h - ry}, //lineTo - {x + w, y + h - ry + hry}, {x + w - rx + hrx, y + h}, {x + w - rx, y + h}, //cubicTo - {x + rx, y + h}, //lineTo - {x + rx - hrx, y + h}, {x, y + h - ry + hry}, {x, y + h - ry}, //cubicTo - {x, y + ry}, //lineTo - {x, y + ry - hry}, {x + rx - hrx, y}, {x + rx, y}, //cubicTo - {x + w - rx, y}, //lineTo - {x + w - rx + hrx, y}, {x + w, y + ry - hry}, {x + w, y + ry} //cubicTo - }; - - if (transform) { - for (int i = 0; i < ptsCnt; i++) mathTransform(transform, &points[i]); - } - shape->appendPath(commands, 10, points, ptsCnt); - } -} - -static void _updateRect(LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - auto rect = static_cast(*child); - - auto position = rect->position(frameNo, exps); - auto size = rect->size(frameNo, exps); - auto roundness = rect->radius(frameNo, exps); - if (ctx->roundness > roundness) roundness = ctx->roundness; - - if (roundness > ROUNDNESS_EPSILON) { - if (roundness > size.x * 0.5f) roundness = size.x * 0.5f; - if (roundness > size.y * 0.5f) roundness = size.y * 0.5f; - } - - if (ctx->repeater) { - auto path = Shape::gen(); - _appendRect(path.get(), position.x - size.x * 0.5f, position.y - size.y * 0.5f, size.x, size.y, roundness, ctx->transform); - _repeat(parent, std::move(path), ctx); - } else { - auto merging = _draw(parent, ctx); - _appendRect(merging, position.x - size.x * 0.5f, position.y - size.y * 0.5f, size.x, size.y, roundness, ctx->transform); - } -} - - -static void _appendCircle(Shape* shape, float cx, float cy, float rx, float ry, Matrix* transform) -{ - auto rxKappa = rx * PATH_KAPPA; - auto ryKappa = ry * PATH_KAPPA; - - constexpr int cmdsCnt = 6; - PathCommand commands[cmdsCnt] = { - PathCommand::MoveTo, PathCommand::CubicTo, PathCommand::CubicTo, - PathCommand::CubicTo, PathCommand::CubicTo, PathCommand::Close - }; - - constexpr int ptsCnt = 13; - Point points[ptsCnt] = { - {cx, cy - ry}, //moveTo - {cx + rxKappa, cy - ry}, {cx + rx, cy - ryKappa}, {cx + rx, cy}, //cubicTo - {cx + rx, cy + ryKappa}, {cx + rxKappa, cy + ry}, {cx, cy + ry}, //cubicTo - {cx - rxKappa, cy + ry}, {cx - rx, cy + ryKappa}, {cx - rx, cy}, //cubicTo - {cx - rx, cy - ryKappa}, {cx - rxKappa, cy - ry}, {cx, cy - ry} //cubicTo - }; - - if (transform) { - for (int i = 0; i < ptsCnt; ++i) mathTransform(transform, &points[i]); - } - - shape->appendPath(commands, cmdsCnt, points, ptsCnt); -} - - -static void _updateEllipse(LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - auto ellipse = static_cast(*child); - - auto position = ellipse->position(frameNo, exps); - auto size = ellipse->size(frameNo, exps); - - if (ctx->repeater) { - auto path = Shape::gen(); - _appendCircle(path.get(), position.x, position.y, size.x * 0.5f, size.y * 0.5f, ctx->transform); - _repeat(parent, std::move(path), ctx); - } else { - auto merging = _draw(parent, ctx); - _appendCircle(merging, position.x, position.y, size.x * 0.5f, size.y * 0.5f, ctx->transform); - } -} - - -static void _updatePath(LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - auto path = static_cast(*child); - - if (ctx->repeater) { - auto p = Shape::gen(); - path->pathset(frameNo, P(p)->rs.path.cmds, P(p)->rs.path.pts, ctx->transform, ctx->roundness, exps); - _repeat(parent, std::move(p), ctx); - } else { - auto merging = _draw(parent, ctx); - if (path->pathset(frameNo, P(merging)->rs.path.cmds, P(merging)->rs.path.pts, ctx->transform, ctx->roundness, exps)) { - P(merging)->update(RenderUpdateFlag::Path); - } - } -} - - -static void _updateText(LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, TVG_UNUSED RenderContext* ctx, LottieExpressions* exps) -{ - auto text = static_cast(*child); - auto& doc = text->doc(frameNo); - auto p = doc.text; - - if (!p || !text->font) return; - - auto scale = doc.size * 0.01f; - float spacing = text->spacing(frameNo) / scale; - Point cursor = {0.0f, 0.0f}; - auto scene = Scene::gen(); - int line = 0; - - //text string - while (true) { - //TODO: remove nested scenes. - //end of text, new line of the cursor position - if (*p == 13 || *p == 3 || *p == '\0') { - //text layout position - auto ascent = text->font->ascent * scale; - if (ascent > doc.bbox.size.y) ascent = doc.bbox.size.y; - Point layout = {doc.bbox.pos.x, doc.bbox.pos.y + ascent - doc.shift}; - - //adjust the layout - if (doc.justify == 1) layout.x += doc.bbox.size.x - (cursor.x * scale); //right aligned - else if (doc.justify == 2) layout.x += (doc.bbox.size.x * 0.5f) - (cursor.x * 0.5f * scale); //center aligned - - scene->translate(layout.x, layout.y); - scene->scale(scale); - - parent->scene->push(std::move(scene)); - - if (*p == '\0') break; - ++p; - - //new text group, single scene for each line - scene = Scene::gen(); - cursor.x = 0.0f; - cursor.y = ++line * (doc.height / scale); - } - - //find the glyph - for (auto g = text->font->chars.begin(); g < text->font->chars.end(); ++g) { - auto glyph = *g; - //draw matched glyphs - if (!strncmp(glyph->code, p, glyph->len)) { - //TODO: caching? - auto shape = Shape::gen(); - for (auto g = glyph->children.begin(); g < glyph->children.end(); ++g) { - auto group = static_cast(*g); - for (auto p = group->children.begin(); p < group->children.end(); ++p) { - if (static_cast(*p)->pathset(frameNo, P(shape)->rs.path.cmds, P(shape)->rs.path.pts, nullptr, 0.0f, exps)) { - P(shape)->update(RenderUpdateFlag::Path); - } - } - } - shape->fill(doc.color.rgb[0], doc.color.rgb[1], doc.color.rgb[2]); - shape->translate(cursor.x, cursor.y); - - if (doc.stroke.render) { - shape->stroke(StrokeJoin::Round); - shape->stroke(doc.stroke.width / scale); - shape->stroke(doc.stroke.color.rgb[0], doc.stroke.color.rgb[1], doc.stroke.color.rgb[2]); - } - - scene->push(std::move(shape)); - - p += glyph->len; - - //advance the cursor position horizontally - cursor.x += glyph->width + spacing + doc.tracking; - break; - } - } - } -} - - -static void _applyRoundedCorner(Shape* star, Shape* merging, float outerRoundness, float roundness, bool hasRoundness) -{ - static constexpr auto ROUNDED_POLYSTAR_MAGIC_NUMBER = 0.47829f; - - auto cmdCnt = star->pathCommands(nullptr); - const Point *pts = nullptr; - auto ptsCnt = star->pathCoords(&pts); - - auto len = mathLength(pts[1] - pts[2]); - auto r = len > 0.0f ? ROUNDED_POLYSTAR_MAGIC_NUMBER * mathMin(len * 0.5f, roundness) / len : 0.0f; - - if (hasRoundness) { - P(merging)->rs.path.cmds.grow((uint32_t)(1.5 * cmdCnt)); - P(merging)->rs.path.pts.grow((uint32_t)(4.5 * cmdCnt)); - - int start = 3 * mathZero(outerRoundness); - merging->moveTo(pts[start].x, pts[start].y); - - for (uint32_t i = 1 + start; i < ptsCnt; i += 6) { - auto& prev = pts[i]; - auto& curr = pts[i + 2]; - auto& next = (i < ptsCnt - start) ? pts[i + 4] : pts[2]; - auto& nextCtrl = (i < ptsCnt - start) ? pts[i + 5] : pts[3]; - auto dNext = r * (curr - next); - auto dPrev = r * (curr - prev); - - auto p0 = curr - 2.0f * dPrev; - auto p1 = curr - dPrev; - auto p2 = curr - dNext; - auto p3 = curr - 2.0f * dNext; - - merging->cubicTo(prev.x, prev.y, p0.x, p0.y, p0.x, p0.y); - merging->cubicTo(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y); - merging->cubicTo(p3.x, p3.y, next.x, next.y, nextCtrl.x, nextCtrl.y); - } - } else { - P(merging)->rs.path.cmds.grow(2 * cmdCnt); - P(merging)->rs.path.pts.grow(4 * cmdCnt); - - auto dPrev = r * (pts[1] - pts[0]); - auto p = pts[0] + 2.0f * dPrev; - merging->moveTo(p.x, p.y); - - for (uint32_t i = 1; i < ptsCnt; ++i) { - auto& curr = pts[i]; - auto& next = (i == ptsCnt - 1) ? pts[1] : pts[i + 1]; - auto dNext = r * (curr - next); - - auto p0 = curr - 2.0f * dPrev; - auto p1 = curr - dPrev; - auto p2 = curr - dNext; - auto p3 = curr - 2.0f * dNext; - - merging->lineTo(p0.x, p0.y); - merging->cubicTo(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y); - - dPrev = -1.0f * dNext; - } - } - merging->close(); -} - - -static void _updateStar(LottieGroup* parent, LottiePolyStar* star, Matrix* transform, float roundness, float frameNo, Shape* merging, LottieExpressions* exps) -{ - static constexpr auto POLYSTAR_MAGIC_NUMBER = 0.47829f / 0.28f; - - auto ptsCnt = star->ptsCnt(frameNo, exps); - auto innerRadius = star->innerRadius(frameNo, exps); - auto outerRadius = star->outerRadius(frameNo, exps); - auto innerRoundness = star->innerRoundness(frameNo, exps) * 0.01f; - auto outerRoundness = star->outerRoundness(frameNo, exps) * 0.01f; - - auto angle = mathDeg2Rad(-90.0f); - auto partialPointRadius = 0.0f; - auto anglePerPoint = (2.0f * MATH_PI / ptsCnt); - auto halfAnglePerPoint = anglePerPoint * 0.5f; - auto partialPointAmount = ptsCnt - floorf(ptsCnt); - auto longSegment = false; - auto numPoints = size_t(ceilf(ptsCnt) * 2); - auto direction = (star->direction == 0) ? 1.0f : -1.0f; - auto hasRoundness = false; - bool roundedCorner = (roundness > ROUNDNESS_EPSILON) && (mathZero(innerRoundness) || mathZero(outerRoundness)); - //TODO: we can use PathCommand / PathCoord directly. - auto shape = roundedCorner ? Shape::gen().release() : merging; - - float x, y; - - if (!mathZero(partialPointAmount)) { - angle += halfAnglePerPoint * (1.0f - partialPointAmount) * direction; - } - - if (!mathZero(partialPointAmount)) { - partialPointRadius = innerRadius + partialPointAmount * (outerRadius - innerRadius); - x = partialPointRadius * cosf(angle); - y = partialPointRadius * sinf(angle); - angle += anglePerPoint * partialPointAmount * 0.5f * direction; - } else { - x = outerRadius * cosf(angle); - y = outerRadius * sinf(angle); - angle += halfAnglePerPoint * direction; - } - - if (mathZero(innerRoundness) && mathZero(outerRoundness)) { - P(shape)->rs.path.pts.reserve(numPoints + 2); - P(shape)->rs.path.cmds.reserve(numPoints + 3); - } else { - P(shape)->rs.path.pts.reserve(numPoints * 3 + 2); - P(shape)->rs.path.cmds.reserve(numPoints + 3); - hasRoundness = true; - } - - Point in = {x, y}; - if (transform) mathTransform(transform, &in); - shape->moveTo(in.x, in.y); - - for (size_t i = 0; i < numPoints; i++) { - auto radius = longSegment ? outerRadius : innerRadius; - auto dTheta = halfAnglePerPoint; - if (!mathZero(partialPointRadius) && i == numPoints - 2) { - dTheta = anglePerPoint * partialPointAmount * 0.5f; - } - if (!mathZero(partialPointRadius) && i == numPoints - 1) { - radius = partialPointRadius; - } - auto previousX = x; - auto previousY = y; - x = radius * cosf(angle); - y = radius * sinf(angle); - - if (hasRoundness) { - auto cp1Theta = (atan2f(previousY, previousX) - MATH_PI2 * direction); - auto cp1Dx = cosf(cp1Theta); - auto cp1Dy = sinf(cp1Theta); - auto cp2Theta = (atan2f(y, x) - MATH_PI2 * direction); - auto cp2Dx = cosf(cp2Theta); - auto cp2Dy = sinf(cp2Theta); - - auto cp1Roundness = longSegment ? innerRoundness : outerRoundness; - auto cp2Roundness = longSegment ? outerRoundness : innerRoundness; - auto cp1Radius = longSegment ? innerRadius : outerRadius; - auto cp2Radius = longSegment ? outerRadius : innerRadius; - - auto cp1x = cp1Radius * cp1Roundness * POLYSTAR_MAGIC_NUMBER * cp1Dx / ptsCnt; - auto cp1y = cp1Radius * cp1Roundness * POLYSTAR_MAGIC_NUMBER * cp1Dy / ptsCnt; - auto cp2x = cp2Radius * cp2Roundness * POLYSTAR_MAGIC_NUMBER * cp2Dx / ptsCnt; - auto cp2y = cp2Radius * cp2Roundness * POLYSTAR_MAGIC_NUMBER * cp2Dy / ptsCnt; - - if (!mathZero(partialPointAmount) && ((i == 0) || (i == numPoints - 1))) { - cp1x *= partialPointAmount; - cp1y *= partialPointAmount; - cp2x *= partialPointAmount; - cp2y *= partialPointAmount; - } - Point in2 = {previousX - cp1x, previousY - cp1y}; - Point in3 = {x + cp2x, y + cp2y}; - Point in4 = {x, y}; - if (transform) { - mathTransform(transform, &in2); - mathTransform(transform, &in3); - mathTransform(transform, &in4); - } - shape->cubicTo(in2.x, in2.y, in3.x, in3.y, in4.x, in4.y); - } else { - Point in = {x, y}; - if (transform) mathTransform(transform, &in); - shape->lineTo(in.x, in.y); - } - angle += dTheta * direction; - longSegment = !longSegment; - } - shape->close(); - - if (roundedCorner) { - _applyRoundedCorner(shape, merging, outerRoundness, roundness, hasRoundness); - delete(shape); - } -} - - -static void _updatePolygon(LottieGroup* parent, LottiePolyStar* star, Matrix* transform, float frameNo, Shape* merging, LottieExpressions* exps) -{ - static constexpr auto POLYGON_MAGIC_NUMBER = 0.25f; - - auto ptsCnt = size_t(floor(star->ptsCnt(frameNo, exps))); - auto radius = star->outerRadius(frameNo, exps); - auto roundness = star->outerRoundness(frameNo, exps) * 0.01f; - - auto angle = mathDeg2Rad(-90.0f); - auto anglePerPoint = 2.0f * MATH_PI / float(ptsCnt); - auto direction = (star->direction == 0) ? 1.0f : -1.0f; - auto hasRoundness = false; - auto x = radius * cosf(angle); - auto y = radius * sinf(angle); - - angle += anglePerPoint * direction; - - if (mathZero(roundness)) { - P(merging)->rs.path.pts.reserve(ptsCnt + 2); - P(merging)->rs.path.cmds.reserve(ptsCnt + 3); - } else { - P(merging)->rs.path.pts.reserve(ptsCnt * 3 + 2); - P(merging)->rs.path.cmds.reserve(ptsCnt + 3); - hasRoundness = true; - } - - Point in = {x, y}; - if (transform) mathTransform(transform, &in); - merging->moveTo(in.x, in.y); - - for (size_t i = 0; i < ptsCnt; i++) { - auto previousX = x; - auto previousY = y; - x = (radius * cosf(angle)); - y = (radius * sinf(angle)); - - if (hasRoundness) { - auto cp1Theta = atan2f(previousY, previousX) - MATH_PI2 * direction; - auto cp1Dx = cosf(cp1Theta); - auto cp1Dy = sinf(cp1Theta); - auto cp2Theta = atan2f(y, x) - MATH_PI2 * direction; - auto cp2Dx = cosf(cp2Theta); - auto cp2Dy = sinf(cp2Theta); - - auto cp1x = radius * roundness * POLYGON_MAGIC_NUMBER * cp1Dx; - auto cp1y = radius * roundness * POLYGON_MAGIC_NUMBER * cp1Dy; - auto cp2x = radius * roundness * POLYGON_MAGIC_NUMBER * cp2Dx; - auto cp2y = radius * roundness * POLYGON_MAGIC_NUMBER * cp2Dy; - - Point in2 = {previousX - cp1x, previousY - cp1y}; - Point in3 = {x + cp2x, y + cp2y}; - Point in4 = {x, y}; - if (transform) { - mathTransform(transform, &in2); - mathTransform(transform, &in3); - mathTransform(transform, &in4); - } - merging->cubicTo(in2.x, in2.y, in3.x, in3.y, in4.x, in4.y); - } else { - Point in = {x, y}; - if (transform) mathTransform(transform, &in); - merging->lineTo(in.x, in.y); - } - angle += anglePerPoint * direction; - } - merging->close(); -} - - -static void _updatePolystar(LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - auto star= static_cast(*child); - - //Optimize: Can we skip the individual coords transform? - Matrix matrix; - mathIdentity(&matrix); - auto position = star->position(frameNo, exps); - mathTranslate(&matrix, position.x, position.y); - mathRotate(&matrix, star->rotation(frameNo, exps)); - - if (ctx->transform) matrix = mathMultiply(ctx->transform, &matrix); - - auto identity = mathIdentity((const Matrix*)&matrix); - - if (ctx->repeater) { - auto p = Shape::gen(); - if (star->type == LottiePolyStar::Star) _updateStar(parent, star, identity ? nullptr : &matrix, ctx->roundness, frameNo, p.get(), exps); - else _updatePolygon(parent, star, identity ? nullptr : &matrix, frameNo, p.get(), exps); - _repeat(parent, std::move(p), ctx); - } else { - auto merging = _draw(parent, ctx); - if (star->type == LottiePolyStar::Star) _updateStar(parent, star, identity ? nullptr : &matrix, ctx->roundness, frameNo, merging, exps); - else _updatePolygon(parent, star, identity ? nullptr : &matrix, frameNo, merging, exps); - P(merging)->update(RenderUpdateFlag::Path); - } -} - - -static void _updateImage(LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, RenderContext* ctx) -{ - auto image = static_cast(*child); - auto picture = image->picture; - - if (!picture) { - picture = Picture::gen().release(); - - //force to load a picture on the same thread - TaskScheduler::async(false); - - if (image->size > 0) { - if (picture->load((const char*)image->b64Data, image->size, image->mimeType, false) != Result::Success) { - delete(picture); - return; - } - } else { - if (picture->load(image->path) != Result::Success) { - delete(picture); - return; - } - } - - TaskScheduler::async(true); - - image->picture = picture; - PP(picture)->ref(); - } - - if (ctx->propagator) { - if (auto matrix = PP(ctx->propagator)->transform()) { - picture->transform(*matrix); - } - picture->opacity(PP(ctx->propagator)->opacity); - } - parent->scene->push(cast(picture)); -} - - -static void _updateRoundedCorner(TVG_UNUSED LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - auto roundedCorner= static_cast(*child); - auto roundness = roundedCorner->radius(frameNo, exps); - if (ctx->roundness < roundness) ctx->roundness = roundness; -} - - -static void _updateRepeater(TVG_UNUSED LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - auto repeater= static_cast(*child); - - if (!ctx->repeater) ctx->repeater = new RenderRepeater(); - ctx->repeater->cnt = static_cast(repeater->copies(frameNo, exps)); - ctx->repeater->offset = repeater->offset(frameNo, exps); - ctx->repeater->position = repeater->position(frameNo, exps); - ctx->repeater->anchor = repeater->anchor(frameNo, exps); - ctx->repeater->scale = repeater->scale(frameNo, exps); - ctx->repeater->rotation = repeater->rotation(frameNo, exps); - ctx->repeater->startOpacity = repeater->startOpacity(frameNo, exps); - ctx->repeater->endOpacity = repeater->endOpacity(frameNo, exps); - ctx->repeater->inorder = repeater->inorder; - ctx->repeater->interpOpacity = (ctx->repeater->startOpacity == ctx->repeater->endOpacity) ? false : true; - - ctx->merging = nullptr; -} - - -static void _updateTrimpath(TVG_UNUSED LottieGroup* parent, LottieObject** child, float frameNo, TVG_UNUSED Inlist& contexts, RenderContext* ctx, LottieExpressions* exps) -{ - auto trimpath= static_cast(*child); - - float begin, end; - trimpath->segment(frameNo, begin, end, exps); - - if (P(ctx->propagator)->rs.stroke) { - auto pbegin = P(ctx->propagator)->rs.stroke->trim.begin; - auto pend = P(ctx->propagator)->rs.stroke->trim.end; - auto length = fabsf(pend - pbegin); - begin = (length * begin) + pbegin; - end = (length * end) + pbegin; - } - - P(ctx->propagator)->strokeTrim(begin, end, trimpath->type == LottieTrimpath::Type::Individual ? true : false); -} - - -static void _updateChildren(LottieGroup* parent, float frameNo, Inlist& contexts, LottieExpressions* exps) -{ - contexts.head->begin = parent->children.end() - 1; - - while (!contexts.empty()) { - auto ctx = contexts.front(); - ctx->reqFragment = parent->reqFragment; - for (auto child = ctx->begin; child >= parent->children.data; --child) { - //Here switch-case statements are more performant than virtual methods. - switch ((*child)->type) { - case LottieObject::Group: { - _updateGroup(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::Transform: { - _updateTransform(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::SolidFill: { - _updateSolidFill(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::SolidStroke: { - _updateSolidStroke(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::GradientFill: { - _updateGradientFill(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::GradientStroke: { - _updateGradientStroke(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::Rect: { - _updateRect(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::Ellipse: { - _updateEllipse(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::Path: { - _updatePath(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::Polystar: { - _updatePolystar(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::Image: { - _updateImage(parent, child, frameNo, contexts, ctx); - break; - } - case LottieObject::Trimpath: { - _updateTrimpath(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::Text: { - _updateText(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::Repeater: { - _updateRepeater(parent, child, frameNo, contexts, ctx, exps); - break; - } - case LottieObject::RoundedCorner: { - _updateRoundedCorner(parent, child, frameNo, contexts, ctx, exps); - break; - } - default: break; - } - } - delete(ctx); - } -} - - -static void _updatePrecomp(LottieLayer* precomp, float frameNo, LottieExpressions* exps) -{ - if (precomp->children.empty()) return; - - frameNo = precomp->remap(frameNo, exps); - - for (auto child = precomp->children.end() - 1; child >= precomp->children.begin(); --child) { - _updateLayer(precomp, static_cast(*child), frameNo, exps); - } - - //clip the layer viewport - if (precomp->w > 0 && precomp->h > 0) { - auto clipper = Shape::gen().release(); - clipper->appendRect(0, 0, static_cast(precomp->w), static_cast(precomp->h)); - clipper->transform(precomp->cache.matrix); - - //TODO: remove the intermediate scene.... - auto cscene = Scene::gen(); - cscene->composite(cast(clipper), CompositeMethod::ClipPath); - cscene->push(cast(precomp->scene)); - precomp->scene = cscene.release(); - } -} - - -static void _updateSolid(LottieLayer* layer) -{ - auto shape = Shape::gen(); - shape->appendRect(0, 0, static_cast(layer->w), static_cast(layer->h)); - shape->fill(layer->color.rgb[0], layer->color.rgb[1], layer->color.rgb[2], layer->cache.opacity); - layer->scene->push(std::move(shape)); -} - - -static void _updateMaskings(LottieLayer* layer, float frameNo, LottieExpressions* exps) -{ - if (layer->masks.count == 0) return; - - //maskings - Shape* pmask = nullptr; - auto pmethod = CompositeMethod::AlphaMask; - - for (auto m = layer->masks.begin(); m < layer->masks.end(); ++m) { - auto mask = static_cast(*m); - auto shape = Shape::gen().release(); - shape->fill(255, 255, 255, mask->opacity(frameNo)); - shape->transform(layer->cache.matrix); - if (mask->pathset(frameNo, P(shape)->rs.path.cmds, P(shape)->rs.path.pts, nullptr, 0.0f, exps)) { - P(shape)->update(RenderUpdateFlag::Path); - } - auto method = mask->method; - if (pmask) { - //false of false is true. invert. - if (method == CompositeMethod::SubtractMask && pmethod == method) { - method = CompositeMethod::AddMask; - } else if (pmethod == CompositeMethod::DifferenceMask && pmethod == method) { - method = CompositeMethod::IntersectMask; - } - pmask->composite(cast(shape), method); - } else { - if (method == CompositeMethod::SubtractMask) method = CompositeMethod::InvAlphaMask; - else if (method == CompositeMethod::AddMask) method = CompositeMethod::AlphaMask; - else if (method == CompositeMethod::IntersectMask) method = CompositeMethod::AlphaMask; - else if (method == CompositeMethod::DifferenceMask) method = CompositeMethod::AlphaMask; //does this correct? - layer->scene->composite(cast(shape), method); - } - pmethod = mask->method; - pmask = shape; - } -} - - -static bool _updateMatte(LottieLayer* root, LottieLayer* layer, float frameNo, LottieExpressions* exps) -{ - auto target = layer->matte.target; - if (!target) return true; - - _updateLayer(root, target, frameNo, exps); - - if (target->scene) { - layer->scene->composite(cast(target->scene), layer->matte.type); - } else if (layer->matte.type == CompositeMethod::AlphaMask || layer->matte.type == CompositeMethod::LumaMask) { - //matte target is not exist. alpha blending definitely bring an invisible result - delete(layer->scene); - layer->scene = nullptr; - return false; - } - return true; -} - - -static void _updateLayer(LottieLayer* root, LottieLayer* layer, float frameNo, LottieExpressions* exps) -{ - layer->scene = nullptr; - - //visibility - if (frameNo < layer->inFrame || frameNo >= layer->outFrame) return; - - _updateTransform(layer, frameNo, exps); - - //full transparent scene. no need to perform - if (layer->type != LottieLayer::Null && layer->cache.opacity == 0) return; - - //Prepare render data - layer->scene = Scene::gen().release(); - - //ignore opacity when Null layer? - if (layer->type != LottieLayer::Null) layer->scene->opacity(layer->cache.opacity); - - layer->scene->transform(layer->cache.matrix); - - if (layer->matte.target && layer->masks.count > 0) TVGERR("LOTTIE", "FIXME: Matte + Masking??"); - - if (!_updateMatte(root, layer, frameNo, exps)) return; - - _updateMaskings(layer, frameNo, exps); - - switch (layer->type) { - case LottieLayer::Precomp: { - _updatePrecomp(layer, frameNo, exps); - break; - } - case LottieLayer::Solid: { - _updateSolid(layer); - break; - } - default: { - if (!layer->children.empty()) { - Inlist contexts; - contexts.back(new RenderContext); - _updateChildren(layer, frameNo, contexts, exps); - contexts.free(); - } - break; - } - } - - layer->scene->blend(layer->blendMethod); - - //the given matte source was composited by the target earlier. - if (!layer->matteSrc) root->scene->push(cast(layer->scene)); -} - - -static void _buildReference(LottieComposition* comp, LottieLayer* layer) -{ - for (auto asset = comp->assets.begin(); asset < comp->assets.end(); ++asset) { - if (strcmp(layer->refId, (*asset)->name)) continue; - if (layer->type == LottieLayer::Precomp) { - auto assetLayer = static_cast(*asset); - if (_buildComposition(comp, assetLayer)) { - layer->children = assetLayer->children; - layer->reqFragment = assetLayer->reqFragment; - } - } else if (layer->type == LottieLayer::Image) { - layer->children.push(*asset); - } - break; - } -} - - -static void _buildHierarchy(LottieGroup* parent, LottieLayer* child) -{ - if (child->pid == -1) return; - - if (child->matte.target && child->pid == child->matte.target->id) { - child->parent = child->matte.target; - return; - } - - for (auto p = parent->children.begin(); p < parent->children.end(); ++p) { - auto parent = static_cast(*p); - if (child == parent) continue; - if (child->pid == parent->id) { - child->parent = parent; - break; - } - if (parent->matte.target && parent->matte.target->id == child->pid) { - child->parent = parent->matte.target; - break; - } - } -} - - -static void _attachFont(LottieComposition* comp, LottieLayer* parent) -{ - //TODO: Consider to migrate this attachment to the frame update time. - for (auto c = parent->children.begin(); c < parent->children.end(); ++c) { - auto text = static_cast(*c); - auto& doc = text->doc(0); - if (!doc.name) continue; - auto len = strlen(doc.name); - for (uint32_t i = 0; i < comp->fonts.count; ++i) { - auto font = comp->fonts[i]; - auto len2 = strlen(font->name); - if (!strncmp(font->name, doc.name, len < len2 ? len : len2)) { - text->font = font; - break; - } - } - } -} - - -static bool _buildComposition(LottieComposition* comp, LottieGroup* parent) -{ - if (parent->children.count == 0) return false; - if (parent->buildDone) return true; - parent->buildDone = true; - - for (auto c = parent->children.begin(); c < parent->children.end(); ++c) { - auto child = static_cast(*c); - - //attach the precomp layer. - if (child->refId) _buildReference(comp, child); - - if (child->matte.target) { - //parenting - _buildHierarchy(parent, child->matte.target); - //precomp referencing - if (child->matte.target->refId) _buildReference(comp, child->matte.target); - } - _buildHierarchy(parent, child); - - //attach the necessary font data - if (child->type == LottieLayer::Text) _attachFont(comp, child); - } - return true; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -bool LottieBuilder::update(LottieComposition* comp, float frameNo) -{ - if (comp->root->children.empty()) return false; - - frameNo += comp->startFrame; - if (frameNo < comp->startFrame) frameNo = comp->startFrame; - if (frameNo >= comp->endFrame) frameNo = (comp->endFrame - 1); - - //update children layers - auto root = comp->root; - root->scene->clear(); - - if (exps && comp->expressions) exps->update(comp->timeAtFrame(frameNo)); - - for (auto child = root->children.end() - 1; child >= root->children.begin(); --child) { - _updateLayer(root, static_cast(*child), frameNo, exps); - } - - return true; -} - - -void LottieBuilder::build(LottieComposition* comp) -{ - if (!comp) return; - - comp->root->scene = Scene::gen().release(); - if (!comp->root->scene) return; - - _buildComposition(comp, comp->root); - - if (!update(comp, 0)) return; - - //viewport clip - auto clip = Shape::gen(); - clip->appendRect(0, 0, static_cast(comp->w), static_cast(comp->h)); - comp->root->scene->composite(std::move(clip), CompositeMethod::ClipPath); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieBuilder.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieBuilder.h deleted file mode 100644 index 690fa85..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieBuilder.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL -#ifndef _TVG_LOTTIE_BUILDER_H_ -#define _TVG_LOTTIE_BUILDER_H_ - -#include "tvgCommon.h" -#include "tvgLottieExpressions.h" - -struct LottieComposition; - -struct LottieBuilder -{ - LottieExpressions* exps = nullptr; - - LottieBuilder() - { - exps = LottieExpressions::instance(); - } - - ~LottieBuilder() - { - LottieExpressions::retrieve(exps); - } - - bool update(LottieComposition* comp, float progress); - void build(LottieComposition* comp); -}; - -#endif //_TVG_LOTTIE_BUILDER_H - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieExpressions.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieExpressions.cpp deleted file mode 100644 index aa6c9b1..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieExpressions.cpp +++ /dev/null @@ -1,1298 +0,0 @@ -/* - * Copyright (c) 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgMath.h" -#include "tvgLottieModel.h" -#include "tvgLottieExpressions.h" - -#ifdef THORVG_LOTTIE_EXPRESSIONS_SUPPORT - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -struct ExpContent -{ - LottieObject* obj; - float frameNo; -}; - - -//reserved expressions specifiers -static const char* EXP_NAME = "name"; -static const char* EXP_CONTENT = "content"; -static const char* EXP_WIDTH = "width"; -static const char* EXP_HEIGHT = "height"; -static const char* EXP_CYCLE = "cycle"; -static const char* EXP_PINGPONG = "pingpong"; -static const char* EXP_OFFSET = "offset"; -static const char* EXP_CONTINUE = "continue"; -static const char* EXP_TIME = "time"; -static const char* EXP_VALUE = "value"; -static const char* EXP_INDEX = "index"; -static const char* EXP_EFFECT= "effect"; - -static LottieExpressions* exps = nullptr; //singleton instance engine - - -static void contentFree(void *native_p, struct jerry_object_native_info_t *info_p) -{ - free(native_p); -} - -static jerry_object_native_info_t freeCb {contentFree, 0, 0}; -static uint32_t engineRefCnt = 0; //Expressions Engine reference count - - -static char* _name(jerry_value_t args) -{ - auto arg0 = jerry_value_to_string(args); - auto len = jerry_string_length(arg0); - auto name = (jerry_char_t*)malloc(len * sizeof(jerry_char_t) + 1); - jerry_string_to_buffer(arg0, JERRY_ENCODING_UTF8, name, len); - name[len] = '\0'; - jerry_value_free(arg0); - return (char*) name; -} - - -static jerry_value_t _toComp(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - TVGERR("LOTTIE", "toComp is not supported in expressions!"); - - return jerry_undefined(); -} - - -static void _buildTransform(jerry_value_t context, LottieTransform* transform) -{ - if (!transform) return; - - auto obj = jerry_object(); - jerry_object_set_sz(context, "transform", obj); - - auto anchorPoint = jerry_object(); - jerry_object_set_native_ptr(anchorPoint, nullptr, &transform->anchor); - jerry_object_set_sz(obj, "anchorPoint", anchorPoint); - jerry_value_free(anchorPoint); - - auto position = jerry_object(); - jerry_object_set_native_ptr(position, nullptr, &transform->position); - jerry_object_set_sz(obj, "position", position); - jerry_value_free(position); - - auto scale = jerry_object(); - jerry_object_set_native_ptr(scale, nullptr, &transform->scale); - jerry_object_set_sz(obj, "scale", scale); - jerry_value_free(scale); - - auto rotation = jerry_object(); - jerry_object_set_native_ptr(rotation, nullptr, &transform->rotation); - jerry_object_set_sz(obj, "rotation", rotation); - jerry_value_free(rotation); - - auto opacity = jerry_object(); - jerry_object_set_native_ptr(opacity, nullptr, &transform->opacity); - jerry_object_set_sz(obj, "opacity", opacity); - jerry_value_free(opacity); - - jerry_value_free(obj); -} - - -static void _buildLayer(jerry_value_t context, LottieLayer* layer, LottieComposition* comp) -{ - auto width = jerry_number(layer->w); - jerry_object_set_sz(context, EXP_WIDTH, width); - jerry_value_free(width); - - auto height = jerry_number(layer->h); - jerry_object_set_sz(context, EXP_HEIGHT, height); - jerry_value_free(height); - - auto index = jerry_number(layer->id); - jerry_object_set_sz(context, EXP_INDEX, index); - jerry_value_free(index); - - auto parent = jerry_object(); - jerry_object_set_native_ptr(parent, nullptr, layer->parent); - jerry_object_set_sz(context, "parent", parent); - jerry_value_free(parent); - - auto hasParent = jerry_boolean(layer->parent ? true : false); - jerry_object_set_sz(context, "hasParent", hasParent); - jerry_value_free(hasParent); - - auto inPoint = jerry_number(layer->inFrame); - jerry_object_set_sz(context, "inPoint", inPoint); - jerry_value_free(inPoint); - - auto outPoint = jerry_number(layer->outFrame); - jerry_object_set_sz(context, "outPoint", outPoint); - jerry_value_free(outPoint); - - auto startTime = jerry_number(comp->timeAtFrame(layer->startFrame)); - jerry_object_set_sz(context, "startTime", startTime); - jerry_value_free(startTime); - - auto hasVideo = jerry_boolean(false); - jerry_object_set_sz(context, "hasVideo", hasVideo); - jerry_value_free(hasVideo); - - auto hasAudio = jerry_boolean(false); - jerry_object_set_sz(context, "hasAudio", hasAudio); - jerry_value_free(hasAudio); - - //active, #current in the animation range? - - auto enabled = jerry_boolean(!layer->hidden); - jerry_object_set_sz(context, "enabled", enabled); - jerry_value_free(enabled); - - auto audioActive = jerry_boolean(false); - jerry_object_set_sz(context, "audioActive", audioActive); - jerry_value_free(audioActive); - - //sampleImage(point, radius = [.5, .5], postEffect=true, t=time) - - _buildTransform(context, layer->transform); - - //audioLevels, #the value of the Audio Levels property of the layer in decibels - - auto timeRemap = jerry_object(); - jerry_object_set_native_ptr(timeRemap, nullptr, &layer->timeRemap); - jerry_object_set_sz(context, "timeRemap", timeRemap); - jerry_value_free(timeRemap); - - //marker.key(index) - //marker.key(name) - //marker.nearestKey(t) - //marker.numKeys - - auto name = jerry_string_sz(layer->name); - jerry_object_set_sz(context, EXP_NAME, name); - jerry_value_free(name); - - auto toComp = jerry_function_external(_toComp); - jerry_object_set_sz(context, "toComp", toComp); - jerry_object_set_native_ptr(toComp, nullptr, comp); - jerry_value_free(toComp); -} - - -static jerry_value_t _value(float frameNo, LottieExpression* exp) -{ - switch (exp->type) { - case LottieProperty::Type::Point: { - auto value = jerry_object(); - auto pos = (*static_cast(exp->property))(frameNo); - auto val1 = jerry_number(pos.x); - auto val2 = jerry_number(pos.y); - jerry_object_set_index(value, 0, val1); - jerry_object_set_index(value, 1, val2); - jerry_value_free(val1); - jerry_value_free(val2); - return value; - } - case LottieProperty::Type::Float: { - return jerry_number((*static_cast(exp->property))(frameNo)); - } - case LottieProperty::Type::Opacity: { - return jerry_number((*static_cast(exp->property))(frameNo)); - } - case LottieProperty::Type::PathSet: { - auto value = jerry_object(); - jerry_object_set_native_ptr(value, nullptr, exp->property); - return value; - } - case LottieProperty::Type::Position: { - auto value = jerry_object(); - auto pos = (*static_cast(exp->property))(frameNo); - auto val1 = jerry_number(pos.x); - auto val2 = jerry_number(pos.y); - jerry_object_set_index(value, 0, val1); - jerry_object_set_index(value, 1, val2); - jerry_value_free(val1); - jerry_value_free(val2); - return value; - } - default: { - TVGERR("LOTTIE", "Non supported type for value? = %d", (int) exp->type); - } - } - return jerry_undefined(); -} - - -static jerry_value_t _addsub(const jerry_value_t args[], float addsub) -{ - //1d - if (jerry_value_is_number(args[0])) return jerry_number(jerry_value_as_number(args[0]) + addsub * jerry_value_as_number(args[1])); - - //2d - auto val1 = jerry_object_get_index(args[0], 0); - auto val2 = jerry_object_get_index(args[0], 1); - auto val3 = jerry_object_get_index(args[1], 0); - auto val4 = jerry_object_get_index(args[1], 1); - auto x = jerry_value_as_number(val1) + addsub * jerry_value_as_number(val3); - auto y = jerry_value_as_number(val2) + addsub * jerry_value_as_number(val4); - - jerry_value_free(val1); - jerry_value_free(val2); - jerry_value_free(val3); - jerry_value_free(val4); - - auto obj = jerry_object(); - val1 = jerry_number(x); - val2 = jerry_number(y); - jerry_object_set_index(obj, 0, val1); - jerry_object_set_index(obj, 1, val2); - jerry_value_free(val1); - jerry_value_free(val2); - - return obj; -} - - -static jerry_value_t _muldiv(const jerry_value_t arg1, float arg2) -{ - //1d - if (jerry_value_is_number(arg1)) return jerry_number(jerry_value_as_number(arg1) * arg2); - - //2d - auto val1 = jerry_object_get_index(arg1, 0); - auto val2 = jerry_object_get_index(arg1, 1); - auto x = jerry_value_as_number(val1) * arg2; - auto y = jerry_value_as_number(val2) * arg2; - - jerry_value_free(val1); - jerry_value_free(val2); - - auto obj = jerry_object(); - val1 = jerry_number(x); - val2 = jerry_number(y); - jerry_object_set_index(obj, 0, val1); - jerry_object_set_index(obj, 1, val2); - jerry_value_free(val1); - jerry_value_free(val2); - - return obj; -} - - -static jerry_value_t _add(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - return _addsub(args, 1.0f); -} - - -static jerry_value_t _sub(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - return _addsub(args, -1.0f); -} - - -static jerry_value_t _mul(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - return _muldiv(args[0], jerry_value_as_number(args[1])); -} - - -static jerry_value_t _div(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - return _muldiv(args[0], 1.0f / jerry_value_as_number(args[1])); -} - - -static jerry_value_t _interp(float t, const jerry_value_t args[], int argsCnt) -{ - auto tMin = 0.0f; - auto tMax = 1.0f; - int idx = 0; - - if (argsCnt > 3) { - tMin = jerry_value_as_number(args[1]); - tMax = jerry_value_as_number(args[2]); - idx += 2; - } - - //2d - if (jerry_value_is_object(args[idx + 1]) && jerry_value_is_object(args[idx + 2])) { - auto val1 = jerry_object_get_index(args[0], 0); - auto val2 = jerry_object_get_index(args[0], 1); - auto val3 = jerry_object_get_index(args[1], 0); - auto val4 = jerry_object_get_index(args[1], 1); - - Point pt1 = {(float)jerry_value_as_number(val1), (float)jerry_value_as_number(val2)}; - Point pt2 = {(float)jerry_value_as_number(val3), (float)jerry_value_as_number(val4)}; - Point ret; - if (t <= tMin) ret = pt1; - else if (t >= tMax) ret = pt2; - else ret = mathLerp(pt1, pt2, t); - - jerry_value_free(val1); - jerry_value_free(val2); - jerry_value_free(val3); - jerry_value_free(val4); - - auto obj = jerry_object(); - val1 = jerry_number(ret.x); - val2 = jerry_number(ret.y); - jerry_object_set_index(obj, 0, val1); - jerry_object_set_index(obj, 1, val2); - jerry_value_free(val1); - jerry_value_free(val2); - - return obj; - } - - //1d - auto val1 = (float) jerry_value_as_number(args[idx + 1]); - if (t <= tMin) jerry_number(val1); - auto val2 = (float) jerry_value_as_number(args[idx + 2]); - if (t >= tMax) jerry_number(val2); - return jerry_number(mathLerp(val1, val2, t)); -} - - -static jerry_value_t _linear(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto t = (float) jerry_value_as_number(args[0]); - return _interp(t, args, jerry_value_as_uint32(argsCnt)); -} - - -static jerry_value_t _ease(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto t = (float) jerry_value_as_number(args[0]); - t = (t < 0.5) ? (4 * t * t * t) : (1.0f - pow(-2.0f * t + 2.0f, 3) * 0.5f); - return _interp(t, args, jerry_value_as_uint32(argsCnt)); -} - - - -static jerry_value_t _easeIn(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto t = (float) jerry_value_as_number(args[0]); - t = t * t * t; - return _interp(t, args, jerry_value_as_uint32(argsCnt)); -} - - -static jerry_value_t _easeOut(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto t = (float) jerry_value_as_number(args[0]); - t = 1.0f - pow(1.0f - t, 3); - return _interp(t, args, jerry_value_as_uint32(argsCnt)); -} - - -static jerry_value_t _clamp(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto num = jerry_value_as_number(args[0]); - auto limit1 = jerry_value_as_number(args[1]); - auto limit2 = jerry_value_as_number(args[2]); - - //clamping - if (num < limit1) num = limit1; - if (num > limit2) num = limit2; - - return jerry_number(num); -} - - -static jerry_value_t _dot(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto val1 = jerry_object_get_index(args[0], 0); - auto val2 = jerry_object_get_index(args[0], 1); - auto val3 = jerry_object_get_index(args[1], 0); - auto val4 = jerry_object_get_index(args[1], 1); - - auto x = jerry_value_as_number(val1) * jerry_value_as_number(val3); - auto y = jerry_value_as_number(val2) * jerry_value_as_number(val4); - - jerry_value_free(val1); - jerry_value_free(val2); - jerry_value_free(val3); - jerry_value_free(val4); - - return jerry_number(x + y); -} - - -static jerry_value_t _cross(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto val1 = jerry_object_get_index(args[0], 0); - auto val2 = jerry_object_get_index(args[0], 1); - auto val3 = jerry_object_get_index(args[1], 0); - auto val4 = jerry_object_get_index(args[1], 1); - - auto x = jerry_value_as_number(val1) * jerry_value_as_number(val4); - auto y = jerry_value_as_number(val2) * jerry_value_as_number(val3); - - jerry_value_free(val1); - jerry_value_free(val2); - jerry_value_free(val3); - jerry_value_free(val4); - - return jerry_number(x - y); -} - - -static jerry_value_t _normalize(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto val1 = jerry_object_get_index(args[0], 0); - auto val2 = jerry_object_get_index(args[0], 1); - auto x = jerry_value_as_number(val1); - auto y = jerry_value_as_number(val2); - - jerry_value_free(val1); - jerry_value_free(val2); - - auto length = sqrtf(x * x + y * y); - - x /= length; - y /= length; - - auto obj = jerry_object(); - val1 = jerry_number(x); - val2 = jerry_number(y); - jerry_object_set_index(obj, 0, val1); - jerry_object_set_index(obj, 0, val2); - jerry_value_free(val1); - jerry_value_free(val2); - - return obj; -} - - -static jerry_value_t _length(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto val1 = jerry_object_get_index(args[0], 0); - auto val2 = jerry_object_get_index(args[0], 1); - auto x = jerry_value_as_number(val1); - auto y = jerry_value_as_number(val2); - - jerry_value_free(val1); - jerry_value_free(val2); - - return jerry_number(sqrtf(x * x + y * y)); -} - - -static jerry_value_t _random(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto val = (float)(rand() % 10000001); - return jerry_number(val * 0.0000001f); -} - - -static jerry_value_t _deg2rad(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - return jerry_number(mathDeg2Rad((float)jerry_value_as_number(args[0]))); -} - - -static jerry_value_t _rad2deg(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - return jerry_number(mathRad2Deg((float)jerry_value_as_number(args[0]))); -} - - -static jerry_value_t _effect(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - TVGERR("LOTTIE", "effect is not supported in expressions!"); - - return jerry_undefined(); -} - - -static jerry_value_t _fromCompToSurface(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - TVGERR("LOTTIE", "fromCompToSurface is not supported in expressions!"); - - return jerry_undefined(); -} - - -static jerry_value_t _content(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto name = _name(args[0]); - auto data = static_cast(jerry_object_get_native_ptr(info->function, &freeCb)); - auto group = static_cast(data->obj); - auto target = group->content((char*)name); - free(name); - if (!target) return jerry_undefined(); - - //find the a path property(sh) in the group layer? - switch (target->type) { - case LottieObject::Group: { - auto group = static_cast(target); - auto obj = jerry_function_external(_content); - - //attach a transform - for (auto c = group->children.begin(); c < group->children.end(); ++c) { - if ((*c)->type == LottieObject::Type::Transform) { - _buildTransform(obj, static_cast(*c)); - break; - } - } - auto data2 = (ExpContent*)malloc(sizeof(ExpContent)); - data2->obj = group; - data2->frameNo = data->frameNo; - jerry_object_set_native_ptr(obj, &freeCb, data2); - jerry_object_set_sz(obj, EXP_CONTENT, obj); - return obj; - } - case LottieObject::Path: { - jerry_value_t obj = jerry_object(); - jerry_object_set_native_ptr(obj, nullptr, &static_cast(target)->pathset); - jerry_object_set_sz(obj, "path", obj); - return obj; - } - case LottieObject::Trimpath: { - auto trimpath = static_cast(target); - jerry_value_t obj = jerry_object(); - auto start = jerry_number(trimpath->start(data->frameNo)); - jerry_object_set_sz(obj, "start", start); - jerry_value_free(start); - auto end = jerry_number(trimpath->end(data->frameNo)); - jerry_object_set_sz(obj, "end", end); - jerry_value_free(end); - auto offset = jerry_number(trimpath->offset(data->frameNo)); - jerry_object_set_sz(obj, "offset", end); - jerry_value_free(offset); - return obj; - } - default: break; - } - return jerry_undefined(); -} - - -static jerry_value_t _layer(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto comp = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - LottieLayer* layer; - - //layer index - if (jerry_value_is_number(args[0])) { - auto idx = (uint16_t)jerry_value_as_int32(args[0]); - layer = comp->layer(idx); - jerry_value_free(idx); - //layer name - } else { - auto name = _name(args[0]); - layer = comp->layer((char*)name); - free(name); - } - - if (!layer) return jerry_undefined(); - - auto obj = jerry_object(); - jerry_object_set_native_ptr(obj, nullptr, layer); - _buildLayer(obj, layer, comp); - - return obj; -} - - -static jerry_value_t _nearestKey(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto exp = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - auto time = jerry_value_as_number(args[0]); - auto frameNo = exp->comp->frameAtTime(time); - auto index = jerry_number(exp->property->nearest(frameNo)); - - auto obj = jerry_object(); - jerry_object_set_sz(obj, EXP_INDEX, index); - jerry_value_free(index); - - return obj; -} - - -static jerry_value_t _valueAtTime(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto exp = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - auto time = jerry_value_as_number(args[0]); - auto frameNo = exp->comp->frameAtTime(time); - return _value(frameNo, exp); -} - - -static jerry_value_t _velocityAtTime(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto exp = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - auto time = jerry_value_as_number(args[0]); - auto frameNo = exp->comp->frameAtTime(time); - auto key = exp->property->nearest(frameNo); - auto pframe = exp->property->frameNo(key - 1); - auto cframe = exp->property->frameNo(key); - auto elapsed = (cframe - pframe) / (exp->comp->frameRate); - - Point cur, prv; - - //compute the velocity - switch (exp->type) { - case LottieProperty::Type::Point: { - prv = (*static_cast(exp->property))(pframe); - cur = (*static_cast(exp->property))(cframe); - break; - } - case LottieProperty::Type::Position: { - prv = (*static_cast(exp->property))(pframe); - cur = (*static_cast(exp->property))(cframe); - break; - } - default: { - TVGERR("LOTTIE", "Non supported type for velocityAtTime?"); - return jerry_undefined(); - } - } - - float velocity[] = {(cur.x - prv.x) / elapsed, (cur.y - prv.y) / elapsed}; - - auto obj = jerry_object(); - auto val1 = jerry_number(velocity[0]); - auto val2 = jerry_number(velocity[1]); - jerry_object_set_index(obj, 0, val1); - jerry_object_set_index(obj, 1, val2); - jerry_value_free(val1); - jerry_value_free(val2); - - return obj; -} - - -static jerry_value_t _speedAtTime(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto exp = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - auto time = jerry_value_as_number(args[0]); - auto frameNo = exp->comp->frameAtTime(time); - auto key = exp->property->nearest(frameNo); - auto pframe = exp->property->frameNo(key - 1); - auto cframe = exp->property->frameNo(key); - auto elapsed = (cframe - pframe) / (exp->comp->frameRate); - - Point cur, prv; - - //compute the velocity - switch (exp->type) { - case LottieProperty::Type::Point: { - prv = (*static_cast(exp->property))(pframe); - cur = (*static_cast(exp->property))(cframe); - break; - } - case LottieProperty::Type::Position: { - prv = (*static_cast(exp->property))(pframe); - cur = (*static_cast(exp->property))(cframe); - break; - } - default: { - TVGERR("LOTTIE", "Non supported type for speedAtTime?"); - return jerry_undefined(); - } - } - - auto speed = sqrtf(pow(cur.x - prv.x, 2) + pow(cur.y - prv.y, 2)) / elapsed; - auto obj = jerry_number(speed); - return obj; -} - - -static bool _loopOutCommon(LottieExpression* exp, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - exp->loop.mode = LottieExpression::LoopMode::OutCycle; - - if (argsCnt > 0) { - auto name = _name(args[0]); - if (!strcmp(name, EXP_CYCLE)) exp->loop.mode = LottieExpression::LoopMode::OutCycle; - else if (!strcmp(name, EXP_PINGPONG)) exp->loop.mode = LottieExpression::LoopMode::OutPingPong; - else if (!strcmp(name, EXP_OFFSET)) exp->loop.mode = LottieExpression::LoopMode::OutOffset; - else if (!strcmp(name, EXP_CONTINUE)) exp->loop.mode = LottieExpression::LoopMode::OutContinue; - free(name); - } - - if (exp->loop.mode != LottieExpression::LoopMode::OutCycle) { - TVGERR("hermet", "Not supported loopOut type = %d", exp->loop.mode); - return false; - } - - return true; -} - - -static jerry_value_t _loopOut(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto exp = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - - if (!_loopOutCommon(exp, args, argsCnt)) return jerry_undefined(); - - if (argsCnt > 1) exp->loop.key = jerry_value_as_int32(args[1]); - - auto obj = jerry_object(); - jerry_object_set_native_ptr(obj, nullptr, exp->property); - return obj; -} - - -static jerry_value_t _loopOutDuration(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto exp = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - - if (!_loopOutCommon(exp, args, argsCnt)) return jerry_undefined(); - - if (argsCnt > 1) { - exp->loop.in = exp->comp->frameAtTime((float)jerry_value_as_int32(args[1])); - } - - auto obj = jerry_object(); - jerry_object_set_native_ptr(obj, nullptr, exp->property); - return obj; -} - - -static bool _loopInCommon(LottieExpression* exp, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - exp->loop.mode = LottieExpression::LoopMode::InCycle; - - if (argsCnt > 0) { - auto name = _name(args[0]); - if (!strcmp(name, EXP_CYCLE)) exp->loop.mode = LottieExpression::LoopMode::InCycle; - else if (!strcmp(name, EXP_PINGPONG)) exp->loop.mode = LottieExpression::LoopMode::InPingPong; - else if (!strcmp(name, EXP_OFFSET)) exp->loop.mode = LottieExpression::LoopMode::InOffset; - else if (!strcmp(name, EXP_CONTINUE)) exp->loop.mode = LottieExpression::LoopMode::InContinue; - free(name); - } - - if (exp->loop.mode != LottieExpression::LoopMode::InCycle) { - TVGERR("hermet", "Not supported loopOut type = %d", exp->loop.mode); - return false; - } - - return true; -} - -static jerry_value_t _loopIn(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto exp = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - - if (!_loopInCommon(exp, args, argsCnt)) return jerry_undefined(); - - if (argsCnt > 1) { - exp->loop.in = exp->comp->frameAtTime((float)jerry_value_as_int32(args[1])); - } - - auto obj = jerry_object(); - jerry_object_set_native_ptr(obj, nullptr, exp->property); - return obj; -} - - -static jerry_value_t _loopInDuration(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto exp = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - - if (argsCnt > 1) { - exp->loop.in = exp->comp->frameAtTime((float)jerry_value_as_int32(args[1])); - } - - if (!_loopInCommon(exp, args, argsCnt)) return jerry_undefined(); - - auto obj = jerry_object(); - jerry_object_set_native_ptr(obj, nullptr, exp->property); - return obj; -} - - -static jerry_value_t _key(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto exp = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - auto key = jerry_value_as_int32(args[0]); - auto frameNo = exp->property->frameNo(key); - auto time = jerry_number(exp->comp->timeAtFrame(frameNo)); - auto value = _value(frameNo, exp); - - auto obj = jerry_object(); - jerry_object_set_sz(obj, EXP_TIME, time); - jerry_object_set_sz(obj, EXP_INDEX, args[0]); - jerry_object_set_sz(obj, EXP_VALUE, value); - - jerry_value_free(time); - jerry_value_free(value); - - return obj; -} - - - -static jerry_value_t _createPath(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - //TODO: arg1: points, arg2: inTangents, arg3: outTangents, arg4: isClosed - auto arg1 = jerry_value_to_object(args[0]); - auto pathset = jerry_object_get_native_ptr(arg1, nullptr); - if (!pathset) { - TVGERR("LOTTIE", "failed createPath()"); - return jerry_undefined(); - } - - jerry_value_free(arg1); - - auto obj = jerry_object(); - jerry_object_set_native_ptr(obj, nullptr, pathset); - return obj; -} - - -static jerry_value_t _uniformPath(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto pathset = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - - /* TODO: ThorVG prebuilds the path data for performance. - It actually need to constructs the Array for points, inTangents, outTangents and then return here... */ - auto obj = jerry_object(); - jerry_object_set_native_ptr(obj, nullptr, pathset); - return obj; -} - - -static jerry_value_t _isClosed(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - //TODO: Not used - return jerry_boolean(true); -} - - -static void _buildPath(jerry_value_t context, LottieExpression* exp) -{ - //Trick for fast building path. - auto points = jerry_function_external(_uniformPath); - jerry_object_set_native_ptr(points, nullptr, exp->property); - jerry_object_set_sz(context, "points", points); - jerry_value_free(points); - - auto inTangents = jerry_function_external(_uniformPath); - jerry_object_set_native_ptr(inTangents, nullptr, exp->property); - jerry_object_set_sz(context, "inTangents", inTangents); - jerry_value_free(inTangents); - - auto outTangents = jerry_function_external(_uniformPath); - jerry_object_set_native_ptr(outTangents, nullptr, exp->property); - jerry_object_set_sz(context, "outTangents", outTangents); - jerry_value_free(outTangents); - - auto isClosed = jerry_function_external(_isClosed); - jerry_object_set_native_ptr(isClosed, nullptr, exp->property); - jerry_object_set_sz(context, "isClosed", isClosed); - jerry_value_free(isClosed); - -} - - -static void _buildProperty(float frameNo, jerry_value_t context, LottieExpression* exp) -{ - auto value = _value(frameNo, exp); - jerry_object_set_sz(context, EXP_VALUE, value); - jerry_value_free(value); - - auto valueAtTime = jerry_function_external(_valueAtTime); - jerry_object_set_sz(context, "valueAtTime", valueAtTime); - jerry_object_set_native_ptr(valueAtTime, nullptr, exp); - jerry_value_free(valueAtTime); - - auto velocity = jerry_number(0.0f); - jerry_object_set_sz(context, "velocity", velocity); - jerry_value_free(velocity); - - auto velocityAtTime = jerry_function_external(_velocityAtTime); - jerry_object_set_sz(context, "velocityAtTime", velocityAtTime); - jerry_object_set_native_ptr(velocityAtTime, nullptr, exp); - jerry_value_free(velocityAtTime); - - auto speed = jerry_number(0.0f); - jerry_object_set_sz(context, "speed", speed); - jerry_value_free(speed); - - auto speedAtTime = jerry_function_external(_speedAtTime); - jerry_object_set_sz(context, "speedAtTime", speedAtTime); - jerry_object_set_native_ptr(speedAtTime, nullptr, exp); - jerry_value_free(speedAtTime); - - //wiggle(freq, amp, octaves=1, amp_mult=.5, t=time) - //temporalWiggle(freq, amp, octaves=1, amp_mult=.5, t=time) - //smooth(width=.2, samples=5, t=time) - - auto loopIn = jerry_function_external(_loopIn); - jerry_object_set_sz(context, "loopIn", loopIn); - jerry_object_set_native_ptr(loopIn, nullptr, exp); - jerry_value_free(loopIn); - - auto loopOut = jerry_function_external(_loopOut); - jerry_object_set_sz(context, "loopOut", loopOut); - jerry_object_set_native_ptr(loopOut, nullptr, exp); - jerry_value_free(loopOut); - - auto loopInDuration = jerry_function_external(_loopInDuration); - jerry_object_set_sz(context, "loopInDuration", loopInDuration); - jerry_object_set_native_ptr(loopInDuration, nullptr, exp); - jerry_value_free(loopInDuration); - - auto loopOutDuration = jerry_function_external(_loopOutDuration); - jerry_object_set_sz(context, "loopOutDuration", loopOutDuration); - jerry_object_set_native_ptr(loopOutDuration, nullptr, exp); - jerry_value_free(loopOutDuration); - - auto key = jerry_function_external(_key); - jerry_object_set_sz(context, "key", key); - jerry_object_set_native_ptr(key, nullptr, exp); - jerry_value_free(key); - - //key(markerName) - - auto nearestKey = jerry_function_external(_nearestKey); - jerry_object_set_native_ptr(nearestKey, nullptr, exp); - jerry_object_set_sz(context, "nearestKey", nearestKey); - jerry_value_free(nearestKey); - - auto numKeys = jerry_number(exp->property->frameCnt()); - jerry_object_set_sz(context, "numKeys", numKeys); - jerry_value_free(numKeys); - - //propertyGroup(countUp = 1) - //propertyIndex - //name - - //content("name"), #look for the named property from a layer - auto data = (ExpContent*)malloc(sizeof(ExpContent)); - data->obj = exp->layer; - data->frameNo = frameNo; - - auto content = jerry_function_external(_content); - jerry_object_set_sz(context, EXP_CONTENT, content); - jerry_object_set_native_ptr(content, &freeCb, data); - jerry_value_free(content); -} - - -static jerry_value_t _comp(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt) -{ - auto comp = static_cast(jerry_object_get_native_ptr(info->function, nullptr)); - LottieLayer* layer; - - auto arg0 = jerry_value_to_string(args[0]); - auto len = jerry_string_length(arg0); - auto name = (jerry_char_t*)alloca(len * sizeof(jerry_char_t) + 1); - jerry_string_to_buffer(arg0, JERRY_ENCODING_UTF8, name, len); - name[len] = '\0'; - - jerry_value_free(arg0); - - layer = comp->asset((char*)name); - - if (!layer) return jerry_undefined(); - - auto obj = jerry_object(); - jerry_object_set_native_ptr(obj, nullptr, layer); - _buildLayer(obj, layer, comp); - - return obj; -} - - -static void _buildMath(jerry_value_t context) -{ - auto bm_mul = jerry_function_external(_mul); - jerry_object_set_sz(context, "$bm_mul", bm_mul); - jerry_value_free(bm_mul); - - auto bm_sum = jerry_function_external(_add); - jerry_object_set_sz(context, "$bm_sum", bm_sum); - jerry_value_free(bm_sum); - - auto bm_add = jerry_function_external(_add); - jerry_object_set_sz(context, "$bm_add", bm_add); - jerry_value_free(bm_add); - - auto bm_sub = jerry_function_external(_sub); - jerry_object_set_sz(context, "$bm_sub", bm_sub); - jerry_value_free(bm_sub); - - auto bm_div = jerry_function_external(_div); - jerry_object_set_sz(context, "$bm_div", bm_div); - jerry_value_free(bm_div); - - auto mul = jerry_function_external(_mul); - jerry_object_set_sz(context, "mul", mul); - jerry_value_free(mul); - - auto sum = jerry_function_external(_add); - jerry_object_set_sz(context, "sum", sum); - jerry_value_free(sum); - - auto add = jerry_function_external(_add); - jerry_object_set_sz(context, "add", add); - jerry_value_free(add); - - auto sub = jerry_function_external(_sub); - jerry_object_set_sz(context, "sub", sub); - jerry_value_free(sub); - - auto div = jerry_function_external(_div); - jerry_object_set_sz(context, "div", div); - jerry_value_free(div); - - auto clamp = jerry_function_external(_clamp); - jerry_object_set_sz(context, "clamp", clamp); - jerry_value_free(clamp); - - auto dot = jerry_function_external(_dot); - jerry_object_set_sz(context, "dot", dot); - jerry_value_free(dot); - - auto cross = jerry_function_external(_cross); - jerry_object_set_sz(context, "cross", cross); - jerry_value_free(cross); - - auto normalize = jerry_function_external(_normalize); - jerry_object_set_sz(context, "normalize", normalize); - jerry_value_free(normalize); - - auto length = jerry_function_external(_length); - jerry_object_set_sz(context, "length", length); - jerry_value_free(length); - - auto random = jerry_function_external(_random); - jerry_object_set_sz(context, "random", random); - jerry_value_free(random); - - auto deg2rad = jerry_function_external(_deg2rad); - jerry_object_set_sz(context, "degreesToRadians", deg2rad); - jerry_value_free(deg2rad); - - auto rad2deg = jerry_function_external(_rad2deg); - jerry_object_set_sz(context, "radiansToDegrees", rad2deg); - jerry_value_free(rad2deg); - - auto linear = jerry_function_external(_linear); - jerry_object_set_sz(context, "linear", linear); - jerry_value_free(linear); - - auto ease = jerry_function_external(_ease); - jerry_object_set_sz(context, "ease", ease); - jerry_value_free(ease); - - auto easeIn = jerry_function_external(_easeIn); - jerry_object_set_sz(context, "easeIn", easeIn); - jerry_value_free(easeIn); - - auto easeOut = jerry_function_external(_easeOut); - jerry_object_set_sz(context, "easeOut", easeOut); - jerry_value_free(easeOut); - - //lookAt -} - - -void LottieExpressions::buildComp(LottieComposition* comp) -{ - jerry_object_set_native_ptr(this->comp, nullptr, comp); - jerry_object_set_native_ptr(thisComp, nullptr, comp); - jerry_object_set_native_ptr(layer, nullptr, comp); - - //marker - //marker.key(index) - //marker.key(name) - //marker.nearestKey(t) - //marker.numKeys - - auto numLayers = jerry_number(comp->root->children.count); - jerry_object_set_sz(thisComp, "numLayers", numLayers); - jerry_value_free(numLayers); - - //activeCamera - - auto width = jerry_number(comp->w); - jerry_object_set_sz(thisComp, EXP_WIDTH, width); - jerry_value_free(width); - - auto height = jerry_number(comp->h); - jerry_object_set_sz(thisComp, EXP_HEIGHT, height); - jerry_value_free(height); - - auto duration = jerry_number(comp->duration()); - jerry_object_set_sz(thisComp, "duration", duration); - jerry_value_free(duration); - - //ntscDropFrame - //displayStartTime - - auto frameDuration = jerry_number(1.0f / comp->frameRate); - jerry_object_set_sz(thisComp, "frameDuration", frameDuration); - jerry_value_free(frameDuration); - - //shutterAngle - //shutterPhase - //bgColor - //pixelAspect - - auto name = jerry_string((jerry_char_t*)comp->name, strlen(comp->name), JERRY_ENCODING_UTF8); - jerry_object_set_sz(thisComp, EXP_NAME, name); - jerry_value_free(name); -} - - -jerry_value_t LottieExpressions::buildGlobal() -{ - global = jerry_current_realm(); - - //comp(name) - comp = jerry_function_external(_comp); - jerry_object_set_sz(global, "comp", comp); - - //footage(name) - - thisComp = jerry_object(); - jerry_object_set_sz(global, "thisComp", thisComp); - - //layer(index) / layer(name) / layer(otherLayer, reIndex) - layer = jerry_function_external(_layer); - jerry_object_set_sz(thisComp, "layer", layer); - - thisLayer = jerry_object(); - jerry_object_set_sz(global, "thisLayer", thisLayer); - - thisProperty = jerry_object(); - jerry_object_set_sz(global, "thisProperty", thisProperty); - - auto effect = jerry_function_external(_effect); - jerry_object_set_sz(global, EXP_EFFECT, effect); - jerry_value_free(effect); - - auto fromCompToSurface = jerry_function_external(_fromCompToSurface); - jerry_object_set_sz(global, "fromCompToSurface", fromCompToSurface); - jerry_value_free(fromCompToSurface); - - auto createPath = jerry_function_external(_createPath); - jerry_object_set_sz(global, "createPath", createPath); - jerry_value_free(createPath); - - //posterizeTime(framesPerSecond) - //value - - return global; -} - - -jerry_value_t LottieExpressions::evaluate(float frameNo, LottieExpression* exp) -{ - buildComp(exp->comp); - - //update global context values - jerry_object_set_native_ptr(thisLayer, nullptr, exp->layer); - _buildLayer(thisLayer, exp->layer, exp->comp); - - jerry_object_set_native_ptr(thisProperty, nullptr, exp->property); - _buildProperty(frameNo, global, exp); - - if (exp->type == LottieProperty::Type::PathSet) _buildPath(thisProperty, exp); - if (exp->object->type == LottieObject::Transform) _buildTransform(global, static_cast(exp->object)); - - //evaluate the code - auto eval = jerry_eval((jerry_char_t *) exp->code, strlen(exp->code), JERRY_PARSE_NO_OPTS); - - if (jerry_value_is_exception(eval) || jerry_value_is_undefined(eval)) { - exp->enabled = false; // The feature is experimental, it will be forcefully turned off if it's incompatible. - return jerry_undefined(); - } - - jerry_value_free(eval); - - return jerry_object_get_sz(global, "$bm_rt"); -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -LottieExpressions::~LottieExpressions() -{ - jerry_value_free(thisProperty); - jerry_value_free(thisLayer); - jerry_value_free(layer); - jerry_value_free(thisComp); - jerry_value_free(comp); - jerry_value_free(global); - jerry_cleanup(); -} - - -LottieExpressions::LottieExpressions() -{ - jerry_init(JERRY_INIT_EMPTY); - _buildMath(buildGlobal()); -} - - -void LottieExpressions::update(float curTime) -{ - //time, #current time in seconds - auto time = jerry_number(curTime); - jerry_object_set_sz(global, EXP_TIME, time); - jerry_value_free(time); -} - - -//FIXME: Threads support -#include "tvgTaskScheduler.h" - -LottieExpressions* LottieExpressions::instance() -{ - //FIXME: Threads support - if (TaskScheduler::threads() > 1) { - TVGLOG("LOTTIE", "Lottie Expressions are not supported with tvg threads"); - return nullptr; - } - - if (!exps) exps = new LottieExpressions; - ++engineRefCnt; - return exps; -} - - -void LottieExpressions::retrieve(LottieExpressions* instance) -{ - if (--engineRefCnt == 0) { - delete(instance); - exps = nullptr; - } -} - - -#endif //THORVG_LOTTIE_EXPRESSIONS_SUPPORT - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieExpressions.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieExpressions.h deleted file mode 100644 index 14819a8..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieExpressions.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (c) 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_LOTTIE_EXPRESSIONS_H_ -#define _TVG_LOTTIE_EXPRESSIONS_H_ - -#include "tvgCommon.h" - -struct LottieExpression; -struct LottieComposition; -struct RGB24; - -#ifdef THORVG_LOTTIE_EXPRESSIONS_SUPPORT - -#include "jerryscript.h" - - -struct LottieExpressions -{ -public: - template - bool result(float frameNo, NumType& out, LottieExpression* exp) - { - auto bm_rt = evaluate(frameNo, exp); - - if (auto prop = static_cast(jerry_object_get_native_ptr(bm_rt, nullptr))) { - out = (*prop)(frameNo); - } else if (jerry_value_is_number(bm_rt)) { - out = (NumType) jerry_value_as_number(bm_rt); - } else { - TVGERR("LOTTIE", "Failed dispatching a Value!"); - return false; - } - jerry_value_free(bm_rt); - return true; - } - - template - bool result(float frameNo, Point& out, LottieExpression* exp) - { - auto bm_rt = evaluate(frameNo, exp); - - if (jerry_value_is_object(bm_rt)) { - if (auto prop = static_cast(jerry_object_get_native_ptr(bm_rt, nullptr))) { - out = (*prop)(frameNo); - } else { - auto x = jerry_object_get_index(bm_rt, 0); - auto y = jerry_object_get_index(bm_rt, 1); - out.x = jerry_value_as_number(x); - out.y = jerry_value_as_number(y); - jerry_value_free(x); - jerry_value_free(y); - } - } else { - TVGERR("LOTTIE", "Failed dispatching Point!"); - return false; - } - jerry_value_free(bm_rt); - return true; - } - - template - bool result(float frameNo, RGB24& out, LottieExpression* exp) - { - auto bm_rt = evaluate(frameNo, exp); - - if (auto color = static_cast(jerry_object_get_native_ptr(bm_rt, nullptr))) { - out = (*color)(frameNo); - } else { - TVGERR("LOTTIE", "Failed dispatching Color!"); - return false; - } - jerry_value_free(bm_rt); - return true; - } - - template - bool result(float frameNo, Fill* fill, LottieExpression* exp) - { - auto bm_rt = evaluate(frameNo, exp); - - if (auto colorStop = static_cast(jerry_object_get_native_ptr(bm_rt, nullptr))) { - (*colorStop)(frameNo, fill, this); - } else { - TVGERR("LOTTIE", "Failed dispatching ColorStop!"); - return false; - } - jerry_value_free(bm_rt); - return true; - } - - template - bool result(float frameNo, Array& cmds, Array& pts, Matrix* transform, float roundness, LottieExpression* exp) - { - auto bm_rt = evaluate(frameNo, exp); - - if (auto pathset = static_cast(jerry_object_get_native_ptr(bm_rt, nullptr))) { - (*pathset)(frameNo, cmds, pts, transform, roundness); - } else { - TVGERR("LOTTIE", "Failed dispatching PathSet!"); - return false; - } - jerry_value_free(bm_rt); - return true; - } - - void update(float curTime); - - //singleton (no thread safety) - static LottieExpressions* instance(); - static void retrieve(LottieExpressions* instance); - -private: - LottieExpressions(); - ~LottieExpressions(); - - jerry_value_t evaluate(float frameNo, LottieExpression* exp); - jerry_value_t buildGlobal(); - void buildComp(LottieComposition* comp); - - //global object, attributes, methods - jerry_value_t global; - jerry_value_t comp; - jerry_value_t layer; - jerry_value_t thisComp; - jerry_value_t thisLayer; - jerry_value_t thisProperty; -}; - -#else - -struct LottieExpressions -{ - template bool result(TVG_UNUSED float, TVG_UNUSED NumType&, TVG_UNUSED LottieExpression*) { return false; } - template bool result(TVG_UNUSED float, TVG_UNUSED Point&, LottieExpression*) { return false; } - template bool result(TVG_UNUSED float, TVG_UNUSED RGB24&, TVG_UNUSED LottieExpression*) { return false; } - template bool result(TVG_UNUSED float, TVG_UNUSED Fill*, TVG_UNUSED LottieExpression*) { return false; } - template bool result(TVG_UNUSED float, TVG_UNUSED Array&, TVG_UNUSED Array&, TVG_UNUSED Matrix* transform, TVG_UNUSED float, TVG_UNUSED LottieExpression*) { return false; } - void update(TVG_UNUSED float) {} - static LottieExpressions* instance() { return nullptr; } - static void retrieve(TVG_UNUSED LottieExpressions* instance) {} -}; - -#endif //THORVG_LOTTIE_EXPRESSIONS_SUPPORT - -#endif //_TVG_LOTTIE_EXPRESSIONS_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieInterpolator.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieInterpolator.cpp deleted file mode 100644 index c92bfb6..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieInterpolator.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include -#include "tvgCommon.h" -#include "tvgMath.h" -#include "tvgLottieInterpolator.h" - - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -#define NEWTON_MIN_SLOPE 0.02f -#define NEWTON_ITERATIONS 4 -#define SUBDIVISION_PRECISION 0.0000001f -#define SUBDIVISION_MAX_ITERATIONS 10 - - -static inline float _constA(float aA1, float aA2) { return 1.0f - 3.0f * aA2 + 3.0f * aA1; } -static inline float _constB(float aA1, float aA2) { return 3.0f * aA2 - 6.0f * aA1; } -static inline float _constC(float aA1) { return 3.0f * aA1; } - - -static inline float _getSlope(float t, float aA1, float aA2) -{ - return 3.0f * _constA(aA1, aA2) * t * t + 2.0f * _constB(aA1, aA2) * t + _constC(aA1); -} - - -static inline float _calcBezier(float t, float aA1, float aA2) -{ - return ((_constA(aA1, aA2) * t + _constB(aA1, aA2)) * t + _constC(aA1)) * t; -} - - -float LottieInterpolator::getTForX(float aX) -{ - //Find interval where t lies - auto intervalStart = 0.0f; - auto currentSample = &samples[1]; - auto lastSample = &samples[SPLINE_TABLE_SIZE - 1]; - - for (; currentSample != lastSample && *currentSample <= aX; ++currentSample) { - intervalStart += SAMPLE_STEP_SIZE; - } - - --currentSample; // t now lies between *currentSample and *currentSample+1 - - // Interpolate to provide an initial guess for t - auto dist = (aX - *currentSample) / (*(currentSample + 1) - *currentSample); - auto guessForT = intervalStart + dist * SAMPLE_STEP_SIZE; - - // Check the slope to see what strategy to use. If the slope is too small - // Newton-Raphson iteration won't converge on a root so we use bisection - // instead. - auto initialSlope = _getSlope(guessForT, outTangent.x, inTangent.x); - if (initialSlope >= NEWTON_MIN_SLOPE) return NewtonRaphsonIterate(aX, guessForT); - else if (initialSlope == 0.0) return guessForT; - else return binarySubdivide(aX, intervalStart, intervalStart + SAMPLE_STEP_SIZE); -} - - -float LottieInterpolator::binarySubdivide(float aX, float aA, float aB) -{ - float x, t; - int i = 0; - - do { - t = aA + (aB - aA) / 2.0f; - x = _calcBezier(t, outTangent.x, inTangent.x) - aX; - if (x > 0.0f) aB = t; - else aA = t; - } while (fabsf(x) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); - return t; -} - - -float LottieInterpolator::NewtonRaphsonIterate(float aX, float aGuessT) -{ - // Refine guess with Newton-Raphson iteration - for (int i = 0; i < NEWTON_ITERATIONS; ++i) { - // We're trying to find where f(t) = aX, - // so we're actually looking for a root for: CalcBezier(t) - aX - auto currentX = _calcBezier(aGuessT, outTangent.x, inTangent.x) - aX; - auto currentSlope = _getSlope(aGuessT, outTangent.x, inTangent.x); - if (currentSlope == 0.0f) return aGuessT; - aGuessT -= currentX / currentSlope; - } - return aGuessT; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -float LottieInterpolator::progress(float t) -{ - if (outTangent.x == outTangent.y && inTangent.x == inTangent.y) return t; - return _calcBezier(getTForX(t), outTangent.y, inTangent.y); -} - - -void LottieInterpolator::set(const char* key, Point& inTangent, Point& outTangent) -{ - this->key = strdup(key); - this->inTangent = inTangent; - this->outTangent = outTangent; - - if (outTangent.x == outTangent.y && inTangent.x == inTangent.y) return; - - //calculates sample values - for (int i = 0; i < SPLINE_TABLE_SIZE; ++i) { - samples[i] = _calcBezier(float(i) * SAMPLE_STEP_SIZE, outTangent.x, inTangent.x); - } -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieInterpolator.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieInterpolator.h deleted file mode 100644 index c7d07d4..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieInterpolator.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_LOTTIE_INTERPOLATOR_H_ -#define _TVG_LOTTIE_INTERPOLATOR_H_ - -#define SPLINE_TABLE_SIZE 11 - -struct LottieInterpolator -{ - char* key; - Point outTangent, inTangent; - - float progress(float t); - void set(const char* key, Point& inTangent, Point& outTangent); - -private: - static constexpr float SAMPLE_STEP_SIZE = 1.0f / float(SPLINE_TABLE_SIZE - 1); - float samples[SPLINE_TABLE_SIZE]; - - float getTForX(float aX); - float binarySubdivide(float aX, float aA, float aB); - float NewtonRaphsonIterate(float aX, float aGuessT); -}; - -#endif //_TVG_LOTTIE_INTERPOLATOR_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieLoader.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieLoader.cpp deleted file mode 100644 index 8230211..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieLoader.cpp +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgLottieLoader.h" -#include "tvgLottieModel.h" -#include "tvgLottieParser.h" -#include "tvgLottieBuilder.h" -#include "tvgStr.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -void LottieLoader::run(unsigned tid) -{ - //update frame - if (comp) { - builder->update(comp, frameNo); - //initial loading - } else { - LottieParser parser(content, dirName); - if (!parser.parse()) return; - comp = parser.comp; - builder->build(comp); - } - rebuild = false; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -LottieLoader::LottieLoader() : FrameModule(FileType::Lottie), builder(new LottieBuilder) -{ - -} - - -LottieLoader::~LottieLoader() -{ - this->done(); - - if (copy) free((char*)content); - free(dirName); - - //TODO: correct position? - delete(comp); - delete(builder); -} - - -bool LottieLoader::header() -{ - //A single thread doesn't need to perform intensive tasks. - if (TaskScheduler::threads() == 0) { - run(0); - if (comp) { - w = static_cast(comp->w); - h = static_cast(comp->h); - frameDuration = comp->duration(); - frameCnt = comp->frameCnt(); - return true; - } else { - return false; - } - } - - //Quickly validate the given Lottie file without parsing in order to get the animation info. - auto startFrame = 0.0f; - auto endFrame = 0.0f; - auto frameRate = 0.0f; - uint32_t depth = 0; - - auto p = content; - - while (*p != '\0') { - if (*p == '{') { - ++depth; - ++p; - continue; - } - if (*p == '}') { - --depth; - ++p; - continue; - } - if (depth != 1) { - ++p; - continue; - } - //version. - if (!strncmp(p, "\"v\":", 4)) { - p += 4; - continue; - } - - //framerate - if (!strncmp(p, "\"fr\":", 5)) { - p += 5; - auto e = strstr(p, ","); - if (!e) e = strstr(p, "}"); - frameRate = strToFloat(p, nullptr); - p = e; - continue; - } - - //start frame - if (!strncmp(p, "\"ip\":", 5)) { - p += 5; - auto e = strstr(p, ","); - if (!e) e = strstr(p, "}"); - startFrame = strToFloat(p, nullptr); - p = e; - continue; - } - - //end frame - if (!strncmp(p, "\"op\":", 5)) { - p += 5; - auto e = strstr(p, ","); - if (!e) e = strstr(p, "}"); - endFrame = strToFloat(p, nullptr); - p = e; - continue; - } - - //width - if (!strncmp(p, "\"w\":", 4)) { - p += 4; - auto e = strstr(p, ","); - if (!e) e = strstr(p, "}"); - w = strToFloat(p, nullptr); - p = e; - continue; - } - //height - if (!strncmp(p, "\"h\":", 4)) { - p += 4; - auto e = strstr(p, ","); - if (!e) e = strstr(p, "}"); - h = strToFloat(p, nullptr); - p = e; - continue; - } - ++p; - } - - if (frameRate < FLOAT_EPSILON) { - TVGLOG("LOTTIE", "Not a Lottie file? Frame rate is 0!"); - return false; - } - - frameCnt = (endFrame - startFrame); - frameDuration = frameCnt / frameRate; - - TVGLOG("LOTTIE", "info: frame rate = %f, duration = %f size = %f x %f", frameRate, frameDuration, w, h); - - return true; -} - - -bool LottieLoader::open(const char* data, uint32_t size, bool copy) -{ - if (copy) { - content = (char*)malloc(size); - if (!content) return false; - memcpy((char*)content, data, size); - } else content = data; - - this->size = size; - this->copy = copy; - - return header(); -} - - -bool LottieLoader::open(const string& path) -{ - auto f = fopen(path.c_str(), "r"); - if (!f) return false; - - fseek(f, 0, SEEK_END); - - size = ftell(f); - if (size == 0) { - fclose(f); - return false; - } - - auto content = (char*)(malloc(sizeof(char) * size + 1)); - fseek(f, 0, SEEK_SET); - auto ret = fread(content, sizeof(char), size, f); - if (ret < size) { - fclose(f); - return false; - } - content[size] = '\0'; - - fclose(f); - - this->dirName = strDirname(path.c_str()); - this->content = content; - this->copy = true; - - return header(); -} - - -bool LottieLoader::resize(Paint* paint, float w, float h) -{ - if (!paint) return false; - - auto sx = w / this->w; - auto sy = h / this->h; - Matrix m = {sx, 0, 0, 0, sy, 0, 0, 0, 1}; - paint->transform(m); - - //apply the scale to the base clipper - const Paint* clipper; - paint->composite(&clipper); - if (clipper) const_cast(clipper)->transform(m); - - return true; -} - - -bool LottieLoader::read() -{ - if (!content || size == 0) return false; - - //the loading has been already completed - if (comp || !LoadModule::read()) return true; - - TaskScheduler::request(this); - - return true; -} - - -Paint* LottieLoader::paint() -{ - done(); - - if (!comp) return nullptr; - comp->initiated = true; - return comp->root->scene; -} - - -bool LottieLoader::override(const char* slot) -{ - if (!comp) done(); - - if (!comp || comp->slots.count == 0) return false; - - auto success = true; - - //override slots - if (slot) { - //Copy the input data because the JSON parser will encode the data immediately. - auto temp = strdup(slot); - - //parsing slot json - LottieParser parser(temp, dirName); - - auto idx = 0; - while (auto sid = parser.sid(idx == 0)) { - for (auto s = comp->slots.begin(); s < comp->slots.end(); ++s) { - if (strcmp((*s)->sid, sid)) continue; - if (!parser.apply(*s)) success = false; - break; - } - ++idx; - } - - if (idx < 1) success = false; - free(temp); - rebuild = overridden = success; - //reset slots - } else if (overridden) { - for (auto s = comp->slots.begin(); s < comp->slots.end(); ++s) { - (*s)->reset(); - } - overridden = false; - rebuild = true; - } - return success; -} - - -bool LottieLoader::frame(float no) -{ - auto frameNo = no + startFrame(); - - //This ensures that the target frame number is reached. - frameNo *= 10000.0f; - frameNo = roundf(frameNo); - frameNo *= 0.0001f; - - //Skip update if frame diff is too small. - if (fabsf(this->frameNo - frameNo) <= 0.0009f) return false; - - this->done(); - - this->frameNo = frameNo; - - TaskScheduler::request(this); - - return true; -} - - -float LottieLoader::startFrame() -{ - return frameCnt * segmentBegin; -} - - -float LottieLoader::totalFrame() -{ - return (segmentEnd - segmentBegin) * frameCnt; -} - - -float LottieLoader::curFrame() -{ - return frameNo - startFrame(); -} - - -float LottieLoader::duration() -{ - if (segmentBegin == 0.0f && segmentEnd == 1.0f) return frameDuration; - - if (!comp) done(); - if (!comp) return 0.0f; - - return frameCnt * (segmentEnd - segmentBegin) / comp->frameRate; -} - - -void LottieLoader::sync() -{ - this->done(); - - if (rebuild) run(0); -} - - -uint32_t LottieLoader::markersCnt() -{ - if (!comp) done(); - if (!comp) return 0; - return comp->markers.count; -} - - -const char* LottieLoader::markers(uint32_t index) -{ - if (!comp) done(); - if (!comp || index >= comp->markers.count) return nullptr; - auto marker = comp->markers.begin() + index; - return (*marker)->name; -} - - -bool LottieLoader::segment(const char* marker, float& begin, float& end) -{ - if (!comp) done(); - if (!comp) return false; - - for (auto m = comp->markers.begin(); m < comp->markers.end(); ++m) { - if (!strcmp(marker, (*m)->name)) { - begin = (*m)->time / frameCnt; - end = ((*m)->time + (*m)->duration) / frameCnt; - return true; - } - } - return false; -} - - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieLoader.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieLoader.h deleted file mode 100644 index 57ad9b7..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieLoader.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_LOTTIE_LOADER_H_ -#define _TVG_LOTTIE_LOADER_H_ - -#include "tvgCommon.h" -#include "tvgFrameModule.h" -#include "tvgTaskScheduler.h" - -struct LottieComposition; -struct LottieBuilder; - -class LottieLoader : public FrameModule, public Task -{ -public: - const char* content = nullptr; //lottie file data - uint32_t size = 0; //lottie data size - float frameNo = 0.0f; //current frame number - float frameCnt = 0.0f; - float frameDuration = 0.0f; - - LottieBuilder* builder; - LottieComposition* comp = nullptr; - - char* dirName = nullptr; //base resource directory - bool copy = false; //"content" is owned by this loader - bool overridden = false; //overridden properties with slots - bool rebuild = false; //require building the lottie scene - - LottieLoader(); - ~LottieLoader(); - - bool open(const string& path) override; - bool open(const char* data, uint32_t size, bool copy) override; - bool resize(Paint* paint, float w, float h) override; - bool read() override; - Paint* paint() override; - bool override(const char* slot); - - //Frame Controls - bool frame(float no) override; - float totalFrame() override; - float curFrame() override; - float duration() override; - void sync() override; - - //Marker Supports - uint32_t markersCnt(); - const char* markers(uint32_t index); - bool segment(const char* marker, float& begin, float& end); - -private: - bool header(); - void clear(); - float startFrame(); - void run(unsigned tid) override; -}; - - -#endif //_TVG_LOTTIELOADER_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieModel.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieModel.cpp deleted file mode 100644 index 5230adb..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieModel.cpp +++ /dev/null @@ -1,424 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgPaint.h" -#include "tvgFill.h" -#include "tvgLottieModel.h" - - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -void LottieSlot::reset() -{ - if (!overridden) return; - - for (auto pair = pairs.begin(); pair < pairs.end(); ++pair) { - switch (type) { - case LottieProperty::Type::ColorStop: { - static_cast(pair->obj)->colorStops.release(); - static_cast(pair->obj)->colorStops = *static_cast(pair->prop); - static_cast(pair->prop)->frames = nullptr; - break; - } - case LottieProperty::Type::Color: { - static_cast(pair->obj)->color.release(); - static_cast(pair->obj)->color = *static_cast(pair->prop); - static_cast(pair->prop)->frames = nullptr; - break; - } - case LottieProperty::Type::TextDoc: { - static_cast(pair->obj)->doc.release(); - static_cast(pair->obj)->doc = *static_cast(pair->prop); - static_cast(pair->prop)->frames = nullptr; - break; - } - default: break; - } - delete(pair->prop); - pair->prop = nullptr; - } - overridden = false; -} - - -void LottieSlot::assign(LottieObject* target) -{ - //apply slot object to all targets - for (auto pair = pairs.begin(); pair < pairs.end(); ++pair) { - //backup the original properties before overwriting - switch (type) { - case LottieProperty::Type::ColorStop: { - if (!overridden) { - pair->prop = new LottieColorStop; - *static_cast(pair->prop) = static_cast(pair->obj)->colorStops; - } - - pair->obj->override(&static_cast(target)->colorStops); - break; - } - case LottieProperty::Type::Color: { - if (!overridden) { - pair->prop = new LottieColor; - *static_cast(pair->prop) = static_cast(pair->obj)->color; - } - - pair->obj->override(&static_cast(target)->color); - break; - } - case LottieProperty::Type::TextDoc: { - if (!overridden) { - pair->prop = new LottieTextDoc; - *static_cast(pair->prop) = static_cast(pair->obj)->doc; - } - - pair->obj->override(&static_cast(target)->doc); - break; - } - default: break; - } - } - overridden = true; -} - - -LottieImage::~LottieImage() -{ - free(b64Data); - free(mimeType); - - if (picture && PP(picture)->unref() == 0) { - delete(picture); - } -} - - -void LottieTrimpath::segment(float frameNo, float& start, float& end, LottieExpressions* exps) -{ - auto s = this->start(frameNo, exps) * 0.01f; - auto e = this->end(frameNo, exps) * 0.01f; - auto o = fmodf(this->offset(frameNo, exps), 360.0f) / 360.0f; //0 ~ 1 - - auto diff = fabs(s - e); - if (mathZero(diff)) { - start = 0.0f; - end = 0.0f; - return; - } - if (mathEqual(diff, 1.0f) || mathEqual(diff, 2.0f)) { - start = 0.0f; - end = 1.0f; - return; - } - - s += o; - e += o; - - auto loop = true; - - //no loop - if (s > 1.0f && e > 1.0f) loop = false; - if (s < 0.0f && e < 0.0f) loop = false; - if (s >= 0.0f && s <= 1.0f && e >= 0.0f && e <= 1.0f) loop = false; - - if (s > 1.0f) s -= 1.0f; - if (s < 0.0f) s += 1.0f; - if (e > 1.0f) e -= 1.0f; - if (e < 0.0f) e += 1.0f; - - if (loop) { - start = s > e ? s : e; - end = s < e ? s : e; - } else { - start = s < e ? s : e; - end = s > e ? s : e; - } -} - - -uint32_t LottieGradient::populate(ColorStop& color) -{ - colorStops.populated = true; - if (!color.input) return 0; - - uint32_t alphaCnt = (color.input->count - (colorStops.count * 4)) / 2; - Array output(colorStops.count + alphaCnt); - uint32_t cidx = 0; //color count - uint32_t clast = colorStops.count * 4; - if (clast > color.input->count) clast = color.input->count; - uint32_t aidx = clast; //alpha count - Fill::ColorStop cs; - - //merge color stops. - for (uint32_t i = 0; i < color.input->count; ++i) { - if (cidx == clast || aidx == color.input->count) break; - if ((*color.input)[cidx] == (*color.input)[aidx]) { - cs.offset = (*color.input)[cidx]; - cs.r = lroundf((*color.input)[cidx + 1] * 255.0f); - cs.g = lroundf((*color.input)[cidx + 2] * 255.0f); - cs.b = lroundf((*color.input)[cidx + 3] * 255.0f); - cs.a = lroundf((*color.input)[aidx + 1] * 255.0f); - cidx += 4; - aidx += 2; - } else if ((*color.input)[cidx] < (*color.input)[aidx]) { - cs.offset = (*color.input)[cidx]; - cs.r = lroundf((*color.input)[cidx + 1] * 255.0f); - cs.g = lroundf((*color.input)[cidx + 2] * 255.0f); - cs.b = lroundf((*color.input)[cidx + 3] * 255.0f); - //generate alpha value - if (output.count > 0) { - auto p = ((*color.input)[cidx] - output.last().offset) / ((*color.input)[aidx] - output.last().offset); - cs.a = mathLerp(output.last().a, lroundf((*color.input)[aidx + 1] * 255.0f), p); - } else cs.a = 255; - cidx += 4; - } else { - cs.offset = (*color.input)[aidx]; - cs.a = lroundf((*color.input)[aidx + 1] * 255.0f); - //generate color value - if (output.count > 0) { - auto p = ((*color.input)[aidx] - output.last().offset) / ((*color.input)[cidx] - output.last().offset); - cs.r = mathLerp(output.last().r, lroundf((*color.input)[cidx + 1] * 255.0f), p); - cs.g = mathLerp(output.last().g, lroundf((*color.input)[cidx + 2] * 255.0f), p); - cs.b = mathLerp(output.last().b, lroundf((*color.input)[cidx + 3] * 255.0f), p); - } else cs.r = cs.g = cs.b = 255; - aidx += 2; - } - output.push(cs); - } - - //color remains - while (cidx + 3 < clast) { - cs.offset = (*color.input)[cidx]; - cs.r = lroundf((*color.input)[cidx + 1] * 255.0f); - cs.g = lroundf((*color.input)[cidx + 2] * 255.0f); - cs.b = lroundf((*color.input)[cidx + 3] * 255.0f); - cs.a = (output.count > 0) ? output.last().a : 255; - output.push(cs); - cidx += 4; - } - - //alpha remains - while (aidx < color.input->count) { - cs.offset = (*color.input)[aidx]; - cs.a = lroundf((*color.input)[aidx + 1] * 255.0f); - if (output.count > 0) { - cs.r = output.last().r; - cs.g = output.last().g; - cs.b = output.last().b; - } else cs.r = cs.g = cs.b = 255; - output.push(cs); - aidx += 2; - } - - color.data = output.data; - output.data = nullptr; - - color.input->reset(); - delete(color.input); - - return output.count; -} - - -Fill* LottieGradient::fill(float frameNo, LottieExpressions* exps) -{ - Fill* fill = nullptr; - auto s = start(frameNo, exps); - auto e = end(frameNo, exps); - - //Linear Gradient - if (id == 1) { - fill = LinearGradient::gen().release(); - static_cast(fill)->linear(s.x, s.y, e.x, e.y); - } - //Radial Gradient - if (id == 2) { - fill = RadialGradient::gen().release(); - - auto w = fabsf(e.x - s.x); - auto h = fabsf(e.y - s.y); - auto r = (w > h) ? (w + 0.375f * h) : (h + 0.375f * w); - auto progress = this->height(frameNo, exps) * 0.01f; - - if (mathZero(progress)) { - P(static_cast(fill))->radial(s.x, s.y, r, s.x, s.y, 0.0f); - } else { - if (mathEqual(progress, 1.0f)) progress = 0.99f; - auto startAngle = mathRad2Deg(atan2(e.y - s.y, e.x - s.x)); - auto angle = mathDeg2Rad((startAngle + this->angle(frameNo, exps))); - auto fx = s.x + cos(angle) * progress * r; - auto fy = s.y + sin(angle) * progress * r; - // Lottie doesn't have any focal radius concept - P(static_cast(fill))->radial(s.x, s.y, r, fx, fy, 0.0f); - } - } - - if (!fill) return nullptr; - - colorStops(frameNo, fill, exps); - - return fill; -} - - -void LottieGroup::prepare(LottieObject::Type type) -{ - LottieObject::type = type; - - if (children.count == 0) return; - - size_t strokeCnt = 0; - size_t fillCnt = 0; - - for (auto c = children.end() - 1; c >= children.begin(); --c) { - auto child = static_cast(*c); - - if (child->type == LottieObject::Type::Trimpath) trimpath = true; - - /* Figure out if this group is a simple path drawing. - In that case, the rendering context can be sharable with the parent's. */ - if (allowMerge && (child->type == LottieObject::Group || !child->mergeable())) allowMerge = false; - - if (reqFragment) continue; - - /* Figure out if the rendering context should be fragmented. - Multiple stroking or grouping with a stroking would occur this. - This fragment resolves the overlapped stroke outlines. */ - if (child->type == LottieObject::Group && !child->mergeable()) { - if (strokeCnt > 0 || fillCnt > 0) reqFragment = true; - } else if (child->type == LottieObject::SolidStroke || child->type == LottieObject::GradientStroke) { - if (strokeCnt > 0) reqFragment = true; - else ++strokeCnt; - } else if (child->type == LottieObject::SolidFill || child->type == LottieObject::GradientFill) { - if (fillCnt > 0) reqFragment = true; - else ++fillCnt; - } - } - - //Reverse the drawing order if this group has a trimpath. - if (!trimpath) return; - - for (uint32_t i = 0; i < children.count - 1; ) { - auto child2 = children[i + 1]; - if (!child2->mergeable() || child2->type == LottieObject::Transform) { - i += 2; - continue; - } - auto child = children[i]; - if (!child->mergeable() || child->type == LottieObject::Transform) { - i++; - continue; - } - children[i] = child2; - children[i + 1] = child; - i++; - } -} - - -LottieLayer::~LottieLayer() -{ - if (refId) { - //No need to free assets children because the Composition owns them. - children.clear(); - free(refId); - } - - for (auto m = masks.begin(); m < masks.end(); ++m) { - delete(*m); - } - - delete(matte.target); - delete(transform); -} - -void LottieLayer::prepare() -{ - /* if layer is hidden, only useful data is its transform matrix. - so force it to be a Null Layer and release all resource. */ - if (hidden) { - type = LottieLayer::Null; - for (auto p = children.begin(); p < children.end(); ++p) delete(*p); - children.reset(); - return; - } - LottieGroup::prepare(LottieObject::Layer); -} - - -float LottieLayer::remap(float frameNo, LottieExpressions* exp) -{ - if (timeRemap.frames || timeRemap.value) { - frameNo = comp->frameAtTime(timeRemap(frameNo, exp)); - } else { - frameNo -= startFrame; - } - return (frameNo / timeStretch); -} - - -LottieComposition::~LottieComposition() -{ - if (!initiated && root) delete(root->scene); - - delete(root); - free(version); - free(name); - - //delete interpolators - for (auto i = interpolators.begin(); i < interpolators.end(); ++i) { - free((*i)->key); - free(*i); - } - - //delete assets - for (auto a = assets.begin(); a < assets.end(); ++a) { - delete(*a); - } - - //delete fonts - for (auto f = fonts.begin(); f < fonts.end(); ++f) { - delete(*f); - } - - //delete slots - for (auto s = slots.begin(); s < slots.end(); ++s) { - delete(*s); - } - - for (auto m = markers.begin(); m < markers.end(); ++m) { - delete(*m); - } -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieModel.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieModel.h deleted file mode 100644 index 6ba92de..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieModel.h +++ /dev/null @@ -1,685 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_LOTTIE_MODEL_H_ -#define _TVG_LOTTIE_MODEL_H_ - -#include - -#include "tvgCommon.h" -#include "tvgRender.h" -#include "tvgLottieProperty.h" - - -struct LottieComposition; - -struct LottieStroke -{ - struct DashAttr - { - //0: offset, 1: dash, 2: gap - LottieFloat value[3] = {0.0f, 0.0f, 0.0f}; - }; - - virtual ~LottieStroke() - { - delete(dashattr); - } - - LottieFloat& dash(int no) - { - if (!dashattr) dashattr = new DashAttr; - return dashattr->value[no]; - } - - float dashOffset(float frameNo, LottieExpressions* exps) - { - return dash(0)(frameNo, exps); - } - - float dashGap(float frameNo, LottieExpressions* exps) - { - return dash(2)(frameNo, exps); - } - - float dashSize(float frameNo, LottieExpressions* exps) - { - auto d = dash(1)(frameNo, exps); - if (d == 0.0f) return 0.1f; - else return d; - } - - LottieFloat width = 0.0f; - DashAttr* dashattr = nullptr; - float miterLimit = 0; - StrokeCap cap = StrokeCap::Round; - StrokeJoin join = StrokeJoin::Round; -}; - - -struct LottieMask -{ - LottiePathSet pathset; - LottieOpacity opacity = 255; - CompositeMethod method; - bool inverse = false; -}; - - -struct LottieObject -{ - enum Type : uint8_t - { - Composition = 0, - Layer, - Group, - Transform, - SolidFill, - SolidStroke, - GradientFill, - GradientStroke, - Rect, - Ellipse, - Path, - Polystar, - Image, - Trimpath, - Text, - Repeater, - RoundedCorner - }; - - virtual ~LottieObject() - { - free(name); - } - - virtual void override(LottieProperty* prop) - { - TVGERR("LOTTIE", "Unsupported slot type"); - } - - virtual bool mergeable() { return false; } - - char* name = nullptr; - Type type; - bool hidden = false; //remove? -}; - - -struct LottieGlyph -{ - Array children; //glyph shapes. - float width; - char* code; - char* family = nullptr; - char* style = nullptr; - uint16_t size; - uint8_t len; - - void prepare() - { - len = strlen(code); - } - - ~LottieGlyph() - { - for (auto p = children.begin(); p < children.end(); ++p) delete(*p); - free(code); - } -}; - - -struct LottieFont -{ - enum Origin : uint8_t { Local = 0, CssURL, ScriptURL, FontURL, Embedded }; - - ~LottieFont() - { - for (auto c = chars.begin(); c < chars.end(); ++c) delete(*c); - free(style); - free(family); - free(name); - } - - Array chars; - char* name = nullptr; - char* family = nullptr; - char* style = nullptr; - float ascent = 0.0f; - Origin origin = Embedded; -}; - -struct LottieMarker -{ - char* name = nullptr; - float time = 0.0f; - float duration = 0.0f; - - ~LottieMarker() - { - free(name); - } -}; - -struct LottieText : LottieObject -{ - void prepare() - { - LottieObject::type = LottieObject::Text; - } - - void override(LottieProperty* prop) override - { - this->doc = *static_cast(prop); - this->prepare(); - } - - LottieTextDoc doc; - LottieFont* font; - LottieFloat spacing = 0.0f; //letter spacing -}; - - -struct LottieTrimpath : LottieObject -{ - enum Type : uint8_t { Simultaneous = 1, Individual = 2 }; - - void prepare() - { - LottieObject::type = LottieObject::Trimpath; - } - - bool mergeable() override - { - if (!start.frames && start.value == 0.0f && !end.frames && end.value == 100.0f && !offset.frames && offset.value == 0.0f) return true; - return false; - } - - void segment(float frameNo, float& start, float& end, LottieExpressions* exps); - - LottieFloat start = 0.0f; - LottieFloat end = 100.0f; - LottieFloat offset = 0.0f; - Type type = Simultaneous; -}; - - -struct LottieShape : LottieObject -{ - virtual ~LottieShape() {} - uint8_t direction = 0; //0: clockwise, 2: counter-clockwise, 3: xor(?) - - bool mergeable() override - { - return true; - } -}; - - -struct LottieRoundedCorner : LottieObject -{ - void prepare() - { - LottieObject::type = LottieObject::RoundedCorner; - } - LottieFloat radius = 0.0f; -}; - - -struct LottiePath : LottieShape -{ - void prepare() - { - LottieObject::type = LottieObject::Path; - } - - LottiePathSet pathset; -}; - - -struct LottieRect : LottieShape -{ - void prepare() - { - LottieObject::type = LottieObject::Rect; - } - - LottiePosition position = Point{0.0f, 0.0f}; - LottiePoint size = Point{0.0f, 0.0f}; - LottieFloat radius = 0.0f; //rounded corner radius -}; - - -struct LottiePolyStar : LottieShape -{ - enum Type : uint8_t {Star = 1, Polygon}; - - void prepare() - { - LottieObject::type = LottieObject::Polystar; - } - - LottiePosition position = Point{0.0f, 0.0f}; - LottieFloat innerRadius = 0.0f; - LottieFloat outerRadius = 0.0f; - LottieFloat innerRoundness = 0.0f; - LottieFloat outerRoundness = 0.0f; - LottieFloat rotation = 0.0f; - LottieFloat ptsCnt = 0.0f; - Type type = Polygon; -}; - - -struct LottieEllipse : LottieShape -{ - void prepare() - { - LottieObject::type = LottieObject::Ellipse; - } - - LottiePosition position = Point{0.0f, 0.0f}; - LottiePoint size = Point{0.0f, 0.0f}; -}; - - -struct LottieTransform : LottieObject -{ - struct SeparateCoord - { - LottieFloat x = 0.0f; - LottieFloat y = 0.0f; - }; - - struct RotationEx - { - LottieFloat x = 0.0f; - LottieFloat y = 0.0f; - }; - - ~LottieTransform() - { - delete(coords); - delete(rotationEx); - } - - void prepare() - { - LottieObject::type = LottieObject::Transform; - } - - bool mergeable() override - { - if (!opacity.frames && opacity.value == 255) return true; - return false; - } - - LottiePosition position = Point{0.0f, 0.0f}; - LottieFloat rotation = 0.0f; //z rotation - LottiePoint scale = Point{100.0f, 100.0f}; - LottiePoint anchor = Point{0.0f, 0.0f}; - LottieOpacity opacity = 255; - LottieFloat skewAngle = 0.0f; - LottieFloat skewAxis = 0.0f; - - SeparateCoord* coords = nullptr; //either a position or separate coordinates - RotationEx* rotationEx = nullptr; //extension for 3d rotation -}; - - -struct LottieSolid : LottieObject -{ - LottieColor color = RGB24{255, 255, 255}; - LottieOpacity opacity = 255; -}; - - -struct LottieSolidStroke : LottieSolid, LottieStroke -{ - void prepare() - { - LottieObject::type = LottieObject::SolidStroke; - } - - void override(LottieProperty* prop) override - { - this->color = *static_cast(prop); - this->prepare(); - } -}; - - -struct LottieSolidFill : LottieSolid -{ - void prepare() - { - LottieObject::type = LottieObject::SolidFill; - } - - void override(LottieProperty* prop) override - { - this->color = *static_cast(prop); - this->prepare(); - } - - FillRule rule = FillRule::Winding; -}; - - -struct LottieGradient : LottieObject -{ - bool prepare() - { - if (!colorStops.populated) { - if (colorStops.frames) { - for (auto v = colorStops.frames->begin(); v < colorStops.frames->end(); ++v) { - colorStops.count = populate(v->value); - } - } else { - colorStops.count = populate(colorStops.value); - } - } - if (start.frames || end.frames || height.frames || angle.frames || opacity.frames || colorStops.frames) return true; - return false; - } - - uint32_t populate(ColorStop& color); - Fill* fill(float frameNo, LottieExpressions* exps); - - LottiePoint start = Point{0.0f, 0.0f}; - LottiePoint end = Point{0.0f, 0.0f}; - LottieFloat height = 0.0f; - LottieFloat angle = 0.0f; - LottieOpacity opacity = 255; - LottieColorStop colorStops; - uint8_t id = 0; //1: linear, 2: radial -}; - - -struct LottieGradientFill : LottieGradient -{ - void prepare() - { - LottieObject::type = LottieObject::GradientFill; - LottieGradient::prepare(); - } - - void override(LottieProperty* prop) override - { - this->colorStops = *static_cast(prop); - this->prepare(); - } - - FillRule rule = FillRule::Winding; -}; - - -struct LottieGradientStroke : LottieGradient, LottieStroke -{ - void prepare() - { - LottieObject::type = LottieObject::GradientStroke; - LottieGradient::prepare(); - } - - void override(LottieProperty* prop) override - { - this->colorStops = *static_cast(prop); - this->prepare(); - } -}; - - -struct LottieImage : LottieObject -{ - union { - char* b64Data = nullptr; - char* path; - }; - char* mimeType = nullptr; - uint32_t size = 0; - - Picture* picture = nullptr; //tvg render data - - ~LottieImage(); - - void prepare() - { - LottieObject::type = LottieObject::Image; - } -}; - - -struct LottieRepeater : LottieObject -{ - void prepare() - { - LottieObject::type = LottieObject::Repeater; - } - - LottieFloat copies = 0.0f; - LottieFloat offset = 0.0f; - - //Transform - LottiePosition position = Point{0.0f, 0.0f}; - LottieFloat rotation = 0.0f; - LottiePoint scale = Point{100.0f, 100.0f}; - LottiePoint anchor = Point{0.0f, 0.0f}; - LottieOpacity startOpacity = 255; - LottieOpacity endOpacity = 255; - bool inorder = true; //true: higher, false: lower -}; - - -struct LottieGroup : LottieObject -{ - virtual ~LottieGroup() - { - for (auto p = children.begin(); p < children.end(); ++p) delete(*p); - } - - void prepare(LottieObject::Type type = LottieObject::Group); - bool mergeable() override { return allowMerge; } - - LottieObject* content(const char* id) - { - if (name && !strcmp(name, id)) return this; - - //source has children, find recursively. - for (auto c = children.begin(); c < children.end(); ++c) { - auto child = *c; - if (child->type == LottieObject::Type::Group || child->type == LottieObject::Type::Layer) { - if (auto ret = static_cast(child)->content(id)) return ret; - } else if (child->name && !strcmp(child->name, id)) return child; - } - return nullptr; - } - - Scene* scene = nullptr; //tvg render data - Array children; - - bool reqFragment = false; //requirement to fragment the render context - bool buildDone = false; //completed in building the composition. - bool allowMerge = true; //if this group is consisted of simple (transformed) shapes. - bool trimpath = false; //this group has a trimpath. -}; - - -struct LottieLayer : LottieGroup -{ - enum Type : uint8_t {Precomp = 0, Solid, Image, Null, Shape, Text}; - - ~LottieLayer(); - - uint8_t opacity(float frameNo) - { - //return zero if the visibility is false. - if (type == Null) return 255; - return transform->opacity(frameNo); - } - - bool mergeable() override { return false; } - - void prepare(); - float remap(float frameNo, LottieExpressions* exp); - - struct { - CompositeMethod type = CompositeMethod::None; - LottieLayer* target = nullptr; - } matte; - - BlendMethod blendMethod = BlendMethod::Normal; - LottieLayer* parent = nullptr; - LottieFloat timeRemap = 0.0f; - LottieComposition* comp = nullptr; - LottieTransform* transform = nullptr; - Array masks; - RGB24 color; //used by Solid layer - - float timeStretch = 1.0f; - float w = 0.0f, h = 0.0f; - float inFrame = 0.0f; - float outFrame = 0.0f; - float startFrame = 0.0f; - char* refId = nullptr; //pre-composition reference. - int16_t pid = -1; //id of the parent layer. - int16_t id = -1; //id of the current layer. - - //cached data - struct { - float frameNo = -1.0f; - Matrix matrix; - uint8_t opacity; - } cache; - - Type type = Null; - bool autoOrient = false; - bool matteSrc = false; -}; - - -struct LottieSlot -{ - struct Pair { - LottieObject* obj; - LottieProperty* prop; - }; - - void assign(LottieObject* target); - void reset(); - - LottieSlot(char* sid, LottieObject* obj, LottieProperty::Type type) : sid(sid), type(type) - { - pairs.push({obj, 0}); - } - - ~LottieSlot() - { - free(sid); - if (!overridden) return; - for (auto pair = pairs.begin(); pair < pairs.end(); ++pair) { - delete(pair->prop); - } - } - - char* sid; - Array pairs; - LottieProperty::Type type; - bool overridden = false; -}; - - -struct LottieComposition -{ - ~LottieComposition(); - - float duration() const - { - return frameCnt() / frameRate; // in second - } - - float frameAtTime(float timeInSec) const - { - auto p = timeInSec / duration(); - if (p < 0.0f) p = 0.0f; - return p * frameCnt(); - } - - float timeAtFrame(float frameNo) - { - return (frameNo - startFrame) / frameRate; - } - - float frameCnt() const - { - return endFrame - startFrame; - } - - LottieLayer* layer(const char* name) - { - for (auto child = root->children.begin(); child < root->children.end(); ++child) { - auto layer = static_cast(*child); - if (layer->name && !strcmp(layer->name, name)) return layer; - } - return nullptr; - } - - LottieLayer* layer(int16_t id) - { - for (auto child = root->children.begin(); child < root->children.end(); ++child) { - auto layer = static_cast(*child); - if (layer->id == id) return layer; - } - return nullptr; - } - - LottieLayer* asset(const char* name) - { - for (auto asset = assets.begin(); asset < assets.end(); ++asset) { - auto layer = static_cast(*asset); - if (layer->name && !strcmp(layer->name, name)) return layer; - } - return nullptr; - } - - LottieLayer* root = nullptr; - char* version = nullptr; - char* name = nullptr; - float w, h; - float startFrame, endFrame; - float frameRate; - Array assets; - Array interpolators; - Array fonts; - Array slots; - Array markers; - bool expressions = false; - bool initiated = false; -}; - -#endif //_TVG_LOTTIE_MODEL_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParser.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParser.cpp deleted file mode 100644 index 17e43b0..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParser.cpp +++ /dev/null @@ -1,1405 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgStr.h" -#include "tvgCompressor.h" -#include "tvgLottieModel.h" -#include "tvgLottieParser.h" -#include "tvgLottieExpressions.h" - - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -#define KEY_AS(name) !strcmp(key, name) - - -static LottieExpression* _expression(char* code, LottieComposition* comp, LottieLayer* layer, LottieObject* object, LottieProperty* property, LottieProperty::Type type) -{ - if (!comp->expressions) comp->expressions = true; - - auto inst = new LottieExpression; - inst->code = code; - inst->comp = comp; - inst->layer = layer; - inst->object = object; - inst->property = property; - inst->type = type; - inst->enabled = true; - - return inst; -} - - -static char* _int2str(int num) -{ - char str[20]; - snprintf(str, 20, "%d", num); - return strdup(str); -} - - -CompositeMethod LottieParser::getMaskMethod(bool inversed) -{ - auto mode = getString(); - if (!mode) return CompositeMethod::None; - - switch (mode[0]) { - case 'a': { - if (inversed) return CompositeMethod::InvAlphaMask; - else return CompositeMethod::AddMask; - } - case 's': return CompositeMethod::SubtractMask; - case 'i': return CompositeMethod::IntersectMask; - case 'f': return CompositeMethod::DifferenceMask; - default: return CompositeMethod::None; - } -} - - -BlendMethod LottieParser::getBlendMethod() -{ - switch (getInt()) { - case 0: return BlendMethod::Normal; - case 1: return BlendMethod::Multiply; - case 2: return BlendMethod::Screen; - case 3: return BlendMethod::Overlay; - case 4: return BlendMethod::Darken; - case 5: return BlendMethod::Lighten; - case 6: return BlendMethod::ColorDodge; - case 7: return BlendMethod::ColorBurn; - case 8: return BlendMethod::HardLight; - case 9: return BlendMethod::SoftLight; - case 10: return BlendMethod::Difference; - case 11: return BlendMethod::Exclusion; - //case 12: return BlendMethod::Hue: - //case 13: return BlendMethod::Saturation: - //case 14: return BlendMethod::Color: - //case 15: return BlendMethod::Luminosity: - case 16: return BlendMethod::Add; - //case 17: return BlendMethod::HardMix: - default: { - TVGERR("LOTTIE", "Non-Supported Blend Mode"); - return BlendMethod::Normal; - } - } -} - - -RGB24 LottieParser::getColor(const char *str) -{ - RGB24 color = {0, 0, 0}; - - if (!str) return color; - - auto len = strlen(str); - - // some resource has empty color string, return a default color for those cases. - if (len != 7 || str[0] != '#') return color; - - char tmp[3] = {'\0', '\0', '\0'}; - tmp[0] = str[1]; - tmp[1] = str[2]; - color.rgb[0] = uint8_t(strtol(tmp, nullptr, 16)); - - tmp[0] = str[3]; - tmp[1] = str[4]; - color.rgb[1] = uint8_t(strtol(tmp, nullptr, 16)); - - tmp[0] = str[5]; - tmp[1] = str[6]; - color.rgb[2] = uint8_t(strtol(tmp, nullptr, 16)); - - return color; -} - - -FillRule LottieParser::getFillRule() -{ - switch (getInt()) { - case 1: return FillRule::Winding; - default: return FillRule::EvenOdd; - } -} - - -CompositeMethod LottieParser::getMatteType() -{ - switch (getInt()) { - case 1: return CompositeMethod::AlphaMask; - case 2: return CompositeMethod::InvAlphaMask; - case 3: return CompositeMethod::LumaMask; - case 4: return CompositeMethod::InvLumaMask; - default: return CompositeMethod::None; - } -} - - -StrokeCap LottieParser::getStrokeCap() -{ - switch (getInt()) { - case 1: return StrokeCap::Butt; - case 2: return StrokeCap::Round; - default: return StrokeCap::Square; - } -} - - -StrokeJoin LottieParser::getStrokeJoin() -{ - switch (getInt()) { - case 1: return StrokeJoin::Miter; - case 2: return StrokeJoin::Round; - default: return StrokeJoin::Bevel; - } -} - - -void LottieParser::getValue(TextDocument& doc) -{ - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("s")) doc.size = getFloat(); - else if (KEY_AS("f")) doc.name = getStringCopy(); - else if (KEY_AS("t")) doc.text = getStringCopy(); - else if (KEY_AS("j")) doc.justify = getInt(); - else if (KEY_AS("tr")) doc.tracking = getFloat() * 0.1f; - else if (KEY_AS("lh")) doc.height = getFloat(); - else if (KEY_AS("ls")) doc.shift = getFloat(); - else if (KEY_AS("fc")) getValue(doc.color); - else if (KEY_AS("ps")) getValue(doc.bbox.pos); - else if (KEY_AS("sz")) getValue(doc.bbox.size); - else if (KEY_AS("sc")) getValue(doc.stroke.color); - else if (KEY_AS("sw")) doc.stroke.width = getFloat(); - else if (KEY_AS("of")) doc.stroke.render = getBool(); - else skip(key); - } -} - - -void LottieParser::getValue(PathSet& path) -{ - Array outs, ins, pts; - bool closed = false; - - /* The shape object could be wrapped by a array - if its part of the keyframe object */ - auto arrayWrapper = (peekType() == kArrayType) ? true : false; - if (arrayWrapper) enterArray(); - - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("i")) getValue(ins); - else if (KEY_AS("o")) getValue(outs); - else if (KEY_AS("v")) getValue(pts); - else if (KEY_AS("c")) closed = getBool(); - else skip(key); - } - - //exit properly from the array - if (arrayWrapper) nextArrayValue(); - - //valid path data? - if (ins.empty() || outs.empty() || pts.empty()) return; - if (ins.count != outs.count || outs.count != pts.count) return; - - //convert path - auto out = outs.begin(); - auto in = ins.begin(); - auto pt = pts.begin(); - - //Store manipulated results - Array outPts; - Array outCmds; - - //Reuse the buffers - outPts.data = path.pts; - outPts.reserved = path.ptsCnt; - outCmds.data = path.cmds; - outCmds.reserved = path.cmdsCnt; - - size_t extra = closed ? 3 : 0; - outPts.reserve(pts.count * 3 + 1 + extra); - outCmds.reserve(pts.count + 2); - - outCmds.push(PathCommand::MoveTo); - outPts.push(*pt); - - for (++pt, ++out, ++in; pt < pts.end(); ++pt, ++out, ++in) { - outCmds.push(PathCommand::CubicTo); - outPts.push(*(pt - 1) + *(out - 1)); - outPts.push(*pt + *in); - outPts.push(*pt); - } - - if (closed) { - outPts.push(pts.last() + outs.last()); - outPts.push(pts.first() + ins.first()); - outPts.push(pts.first()); - outCmds.push(PathCommand::CubicTo); - outCmds.push(PathCommand::Close); - } - - path.pts = outPts.data; - path.cmds = outCmds.data; - path.ptsCnt = outPts.count; - path.cmdsCnt = outCmds.count; - - outPts.data = nullptr; - outCmds.data = nullptr; -} - - -void LottieParser::getValue(ColorStop& color) -{ - if (peekType() == kArrayType) enterArray(); - - color.input = new Array(static_cast(context.parent)->colorStops.count); - - while (nextArrayValue()) color.input->push(getFloat()); -} - - -void LottieParser::getValue(Array& pts) -{ - enterArray(); - while (nextArrayValue()) { - enterArray(); - Point pt; - getValue(pt); - pts.push(pt); - } -} - - -void LottieParser::getValue(uint8_t& val) -{ - if (peekType() == kArrayType) { - enterArray(); - if (nextArrayValue()) val = (uint8_t)(getFloat() * 2.55f); - //discard rest - while (nextArrayValue()) getFloat(); - } else { - val = (uint8_t)(getFloat() * 2.55f); - } -} - - -void LottieParser::getValue(float& val) -{ - if (peekType() == kArrayType) { - enterArray(); - if (nextArrayValue()) val = getFloat(); - //discard rest - while (nextArrayValue()) getFloat(); - } else { - val = getFloat(); - } -} - - -void LottieParser::getValue(Point& pt) -{ - int i = 0; - auto ptr = (float*)(&pt); - - if (peekType() == kArrayType) enterArray(); - - while (nextArrayValue()) { - auto val = getFloat(); - if (i < 2) ptr[i++] = val; - } -} - - -void LottieParser::getValue(RGB24& color) -{ - int i = 0; - - if (peekType() == kArrayType) enterArray(); - - while (nextArrayValue()) { - auto val = getFloat(); - if (i < 3) color.rgb[i++] = int32_t(lroundf(val * 255.0f)); - } - - //TODO: color filter? -} - - -void LottieParser::getInterpolatorPoint(Point& pt) -{ - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("x")) getValue(pt.x); - else if (KEY_AS("y")) getValue(pt.y); - } -} - - -template -void LottieParser::parseSlotProperty(T& prop) -{ - while (auto key = nextObjectKey()) { - if (KEY_AS("p")) parseProperty(prop); - else skip(key); - } -} - - -template -bool LottieParser::parseTangent(const char *key, LottieVectorFrame& value) -{ - if (KEY_AS("ti")) { - value.hasTangent = true; - getValue(value.inTangent); - } else if (KEY_AS("to")) { - value.hasTangent = true; - getValue(value.outTangent); - } else return false; - - return true; -} - - -template -bool LottieParser::parseTangent(const char *key, LottieScalarFrame& value) -{ - return false; -} - - -LottieInterpolator* LottieParser::getInterpolator(const char* key, Point& in, Point& out) -{ - char buf[20]; - - if (!key) { - snprintf(buf, sizeof(buf), "%.2f_%.2f_%.2f_%.2f", in.x, in.y, out.x, out.y); - key = buf; - } - - LottieInterpolator* interpolator = nullptr; - - //get a cached interpolator if it has any. - for (auto i = comp->interpolators.begin(); i < comp->interpolators.end(); ++i) { - if (!strncmp((*i)->key, key, sizeof(buf))) interpolator = *i; - } - - //new interpolator - if (!interpolator) { - interpolator = static_cast(malloc(sizeof(LottieInterpolator))); - interpolator->set(key, in, out); - comp->interpolators.push(interpolator); - } - - return interpolator; -} - - -template -void LottieParser::parseKeyFrame(T& prop) -{ - Point inTangent, outTangent; - const char* interpolatorKey = nullptr; - auto& frame = prop.newFrame(); - auto interpolator = false; - - enterObject(); - - while (auto key = nextObjectKey()) { - if (KEY_AS("i")) { - interpolator = true; - getInterpolatorPoint(inTangent); - } else if (KEY_AS("o")) { - getInterpolatorPoint(outTangent); - } else if (KEY_AS("n")) { - if (peekType() == kStringType) { - interpolatorKey = getString(); - } else { - enterArray(); - while (nextArrayValue()) { - if (!interpolatorKey) interpolatorKey = getString(); - else skip(nullptr); - } - } - } else if (KEY_AS("t")) { - frame.no = getFloat(); - } else if (KEY_AS("s")) { - getValue(frame.value); - } else if (KEY_AS("e")) { - //current end frame and the next start frame is duplicated, - //We propagate the end value to the next frame to avoid having duplicated values. - auto& frame2 = prop.nextFrame(); - getValue(frame2.value); - } else if (parseTangent(key, frame)) { - continue; - } else if (KEY_AS("h")) { - frame.hold = getInt(); - } else skip(key); - } - - if (interpolator) { - frame.interpolator = getInterpolator(interpolatorKey, inTangent, outTangent); - } -} - -template -void LottieParser::parsePropertyInternal(T& prop) -{ - //single value property - if (peekType() == kNumberType) { - getValue(prop.value); - //multi value property - } else { - //TODO: Here might be a single frame. - //Can we figure out the frame number in advance? - enterArray(); - while (nextArrayValue()) { - //keyframes value - if (peekType() == kObjectType) { - parseKeyFrame(prop); - //multi value property with no keyframes - } else { - getValue(prop.value); - break; - } - } - prop.prepare(); - } -} - - -template -void LottieParser::parseProperty(T& prop, LottieObject* obj) -{ - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("k")) parsePropertyInternal(prop); - else if (obj && KEY_AS("sid")) { - auto sid = getStringCopy(); - //append object if the slot already exists. - for (auto slot = comp->slots.begin(); slot < comp->slots.end(); ++slot) { - if (strcmp((*slot)->sid, sid)) continue; - (*slot)->pairs.push({obj, 0}); - return; - } - comp->slots.push(new LottieSlot(sid, obj, type)); - } else if (!strcmp(key, "x")) { - prop.exp = _expression(getStringCopy(), comp, context.layer, context.parent, &prop, type); - } - else skip(key); - } -} - - -LottieRect* LottieParser::parseRect() -{ - auto rect = new LottieRect; - if (!rect) return nullptr; - - context.parent = rect; - - while (auto key = nextObjectKey()) { - if (KEY_AS("s")) parseProperty(rect->size); - else if (KEY_AS("p"))parseProperty(rect->position); - else if (KEY_AS("r")) parseProperty(rect->radius); - else if (KEY_AS("nm")) rect->name = getStringCopy(); - else if (KEY_AS("hd")) rect->hidden = getBool(); - else skip(key); - } - rect->prepare(); - return rect; -} - - -LottieEllipse* LottieParser::parseEllipse() -{ - auto ellipse = new LottieEllipse; - if (!ellipse) return nullptr; - - context.parent = ellipse; - - while (auto key = nextObjectKey()) { - if (KEY_AS("nm")) ellipse->name = getStringCopy(); - else if (KEY_AS("p")) parseProperty(ellipse->position); - else if (KEY_AS("s")) parseProperty(ellipse->size); - else if (KEY_AS("hd")) ellipse->hidden = getBool(); - else skip(key); - } - ellipse->prepare(); - return ellipse; -} - - -LottieTransform* LottieParser::parseTransform(bool ddd) -{ - auto transform = new LottieTransform; - if (!transform) return nullptr; - - context.parent = transform; - - if (ddd) { - transform->rotationEx = new LottieTransform::RotationEx; - TVGLOG("LOTTIE", "3D transform(ddd) is not totally compatible."); - } - - while (auto key = nextObjectKey()) { - if (KEY_AS("p")) - { - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("k")) parsePropertyInternal(transform->position); - else if (KEY_AS("s") && getBool()) transform->coords = new LottieTransform::SeparateCoord; - //check separateCoord to figure out whether "x(expression)" / "x(coord)" - else if (transform->coords && KEY_AS("x")) parseProperty(transform->coords->x); - else if (transform->coords && KEY_AS("y")) parseProperty(transform->coords->y); - else if (KEY_AS("x")) transform->position.exp = _expression(getStringCopy(), comp, context.layer, context.parent, &transform->position, LottieProperty::Type::Position); - else skip(key); - } - } - else if (KEY_AS("a")) parseProperty(transform->anchor); - else if (KEY_AS("s")) parseProperty(transform->scale); - else if (KEY_AS("r")) parseProperty(transform->rotation); - else if (KEY_AS("o")) parseProperty(transform->opacity); - else if (transform->rotationEx && KEY_AS("rx")) parseProperty(transform->rotationEx->x); - else if (transform->rotationEx && KEY_AS("ry")) parseProperty(transform->rotationEx->y); - else if (transform->rotationEx && KEY_AS("rz")) parseProperty(transform->rotation); - else if (KEY_AS("nm")) transform->name = getStringCopy(); - else if (KEY_AS("sk")) parseProperty(transform->skewAngle); - else if (KEY_AS("sa")) parseProperty(transform->skewAxis); - else skip(key); - } - transform->prepare(); - return transform; -} - - -LottieSolidFill* LottieParser::parseSolidFill() -{ - auto fill = new LottieSolidFill; - if (!fill) return nullptr; - - context.parent = fill; - - while (auto key = nextObjectKey()) { - if (KEY_AS("nm")) fill->name = getStringCopy(); - else if (KEY_AS("c")) parseProperty(fill->color, fill); - else if (KEY_AS("o")) parseProperty(fill->opacity, fill); - else if (KEY_AS("fillEnabled")) fill->hidden |= !getBool(); - else if (KEY_AS("r")) fill->rule = getFillRule(); - else if (KEY_AS("hd")) fill->hidden = getBool(); - else skip(key); - } - fill->prepare(); - return fill; -} - - -void LottieParser::parseStrokeDash(LottieStroke* stroke) -{ - enterArray(); - while (nextArrayValue()) { - enterObject(); - int idx = 0; - while (auto key = nextObjectKey()) { - if (KEY_AS("n")) { - auto style = getString(); - if (!strcmp("o", style)) idx = 0; //offset - else if (!strcmp("d", style)) idx = 1; //dash - else if (!strcmp("g", style)) idx = 2; //gap - } else if (KEY_AS("v")) { - parseProperty(stroke->dash(idx)); - } else skip(key); - } - } -} - - -LottieSolidStroke* LottieParser::parseSolidStroke() -{ - auto stroke = new LottieSolidStroke; - if (!stroke) return nullptr; - - context.parent = stroke; - - while (auto key = nextObjectKey()) { - if (KEY_AS("c")) parseProperty(stroke->color, stroke); - else if (KEY_AS("o")) parseProperty(stroke->opacity, stroke); - else if (KEY_AS("w")) parseProperty(stroke->width, stroke); - else if (KEY_AS("lc")) stroke->cap = getStrokeCap(); - else if (KEY_AS("lj")) stroke->join = getStrokeJoin(); - else if (KEY_AS("ml")) stroke->miterLimit = getFloat(); - else if (KEY_AS("nm")) stroke->name = getStringCopy(); - else if (KEY_AS("hd")) stroke->hidden = getBool(); - else if (KEY_AS("fillEnabled")) stroke->hidden |= !getBool(); - else if (KEY_AS("d")) parseStrokeDash(stroke); - else skip(key); - } - stroke->prepare(); - return stroke; -} - - -void LottieParser::getPathSet(LottiePathSet& path) -{ - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("k")) { - if (peekType() == kArrayType) { - enterArray(); - while (nextArrayValue()) parseKeyFrame(path); - } else { - getValue(path.value); - } - } else if (!strcmp(key, "x")) { - path.exp = _expression(getStringCopy(), comp, context.layer, context.parent, &path, LottieProperty::Type::PathSet); - } else skip(key); - } -} - - -LottiePath* LottieParser::parsePath() -{ - auto path = new LottiePath; - if (!path) return nullptr; - - while (auto key = nextObjectKey()) { - if (KEY_AS("nm")) path->name = getStringCopy(); - else if (KEY_AS("ks")) getPathSet(path->pathset); - else if (KEY_AS("hd")) path->hidden = getBool(); - else skip(key); - } - path->prepare(); - return path; -} - - -LottiePolyStar* LottieParser::parsePolyStar() -{ - auto star = new LottiePolyStar; - if (!star) return nullptr; - - context.parent = star; - - while (auto key = nextObjectKey()) { - if (KEY_AS("nm")) star->name = getStringCopy(); - else if (KEY_AS("p")) parseProperty(star->position); - else if (KEY_AS("pt")) parseProperty(star->ptsCnt); - else if (KEY_AS("ir")) parseProperty(star->innerRadius); - else if (KEY_AS("is")) parseProperty(star->innerRoundness); - else if (KEY_AS("or")) parseProperty(star->outerRadius); - else if (KEY_AS("os")) parseProperty(star->outerRoundness); - else if (KEY_AS("r")) parseProperty(star->rotation); - else if (KEY_AS("sy")) star->type = (LottiePolyStar::Type) getInt(); - else if (KEY_AS("hd")) star->hidden = getBool(); - else skip(key); - } - star->prepare(); - return star; -} - - -LottieRoundedCorner* LottieParser::parseRoundedCorner() -{ - auto corner = new LottieRoundedCorner; - if (!corner) return nullptr; - - context.parent = corner; - - while (auto key = nextObjectKey()) { - if (KEY_AS("nm")) corner->name = getStringCopy(); - else if (KEY_AS("r")) parseProperty(corner->radius); - else if (KEY_AS("hd")) corner->hidden = getBool(); - else skip(key); - } - corner->prepare(); - return corner; -} - - -void LottieParser::parseGradient(LottieGradient* gradient, const char* key) -{ - if (KEY_AS("t")) gradient->id = getInt(); - else if (KEY_AS("o")) parseProperty(gradient->opacity, gradient); - else if (KEY_AS("g")) - { - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("p")) gradient->colorStops.count = getInt(); - else if (KEY_AS("k")) parseProperty(gradient->colorStops, gradient); - else skip(key); - } - } - else if (KEY_AS("s")) parseProperty(gradient->start, gradient); - else if (KEY_AS("e")) parseProperty(gradient->end, gradient); - else if (KEY_AS("h")) parseProperty(gradient->height, gradient); - else if (KEY_AS("a")) parseProperty(gradient->angle, gradient); - else skip(key); -} - - -LottieGradientFill* LottieParser::parseGradientFill() -{ - auto fill = new LottieGradientFill; - if (!fill) return nullptr; - - context.parent = fill; - - while (auto key = nextObjectKey()) { - if (KEY_AS("nm")) fill->name = getStringCopy(); - else if (KEY_AS("r")) fill->rule = getFillRule(); - else if (KEY_AS("hd")) fill->hidden = getBool(); - else parseGradient(fill, key); - } - - fill->prepare(); - - return fill; -} - - -LottieGradientStroke* LottieParser::parseGradientStroke() -{ - auto stroke = new LottieGradientStroke; - if (!stroke) return nullptr; - - context.parent = stroke; - - while (auto key = nextObjectKey()) { - if (KEY_AS("nm")) stroke->name = getStringCopy(); - else if (KEY_AS("lc")) stroke->cap = getStrokeCap(); - else if (KEY_AS("lj")) stroke->join = getStrokeJoin(); - else if (KEY_AS("ml")) stroke->miterLimit = getFloat(); - else if (KEY_AS("hd")) stroke->hidden = getBool(); - else if (KEY_AS("w")) parseProperty(stroke->width); - else if (KEY_AS("d")) parseStrokeDash(stroke); - else parseGradient(stroke, key); - } - stroke->prepare(); - - return stroke; -} - - -LottieTrimpath* LottieParser::parseTrimpath() -{ - auto trim = new LottieTrimpath; - if (!trim) return nullptr; - - context.parent = trim; - - while (auto key = nextObjectKey()) { - if (KEY_AS("nm")) trim->name = getStringCopy(); - else if (KEY_AS("s")) parseProperty(trim->start); - else if (KEY_AS("e")) parseProperty(trim->end); - else if (KEY_AS("o")) parseProperty(trim->offset); - else if (KEY_AS("m")) trim->type = static_cast(getInt()); - else if (KEY_AS("hd")) trim->hidden = getBool(); - else skip(key); - } - trim->prepare(); - - return trim; -} - - -LottieRepeater* LottieParser::parseRepeater() -{ - auto repeater = new LottieRepeater; - if (!repeater) return nullptr; - - context.parent = repeater; - - while (auto key = nextObjectKey()) { - if (KEY_AS("nm")) repeater->name = getStringCopy(); - else if (KEY_AS("c")) parseProperty(repeater->copies); - else if (KEY_AS("o")) parseProperty(repeater->offset); - else if (KEY_AS("m")) repeater->inorder = getInt(); - else if (KEY_AS("tr")) - { - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("a")) parseProperty(repeater->anchor); - else if (KEY_AS("p")) parseProperty(repeater->position); - else if (KEY_AS("r")) parseProperty(repeater->rotation); - else if (KEY_AS("s")) parseProperty(repeater->scale); - else if (KEY_AS("so")) parseProperty(repeater->startOpacity); - else if (KEY_AS("eo")) parseProperty(repeater->endOpacity); - else skip(key); - } - } - else if (KEY_AS("hd")) repeater->hidden = getBool(); - else skip(key); - } - repeater->prepare(); - - return repeater; -} - - -LottieObject* LottieParser::parseObject() -{ - auto type = getString(); - if (!type) return nullptr; - - if (!strcmp(type, "gr")) return parseGroup(); - else if (!strcmp(type, "rc")) return parseRect(); - else if (!strcmp(type, "el")) return parseEllipse(); - else if (!strcmp(type, "tr")) return parseTransform(); - else if (!strcmp(type, "fl")) return parseSolidFill(); - else if (!strcmp(type, "st")) return parseSolidStroke(); - else if (!strcmp(type, "sh")) return parsePath(); - else if (!strcmp(type, "sr")) return parsePolyStar(); - else if (!strcmp(type, "rd")) return parseRoundedCorner(); - else if (!strcmp(type, "gf")) return parseGradientFill(); - else if (!strcmp(type, "gs")) return parseGradientStroke(); - else if (!strcmp(type, "tm")) return parseTrimpath(); - else if (!strcmp(type, "rp")) return parseRepeater(); - else if (!strcmp(type, "mm")) TVGERR("LOTTIE", "MergePath(mm) is not supported yet"); - else if (!strcmp(type, "pb")) TVGERR("LOTTIE", "Puker/Bloat(pb) is not supported yet"); - else if (!strcmp(type, "tw")) TVGERR("LOTTIE", "Twist(tw) is not supported yet"); - else if (!strcmp(type, "op")) TVGERR("LOTTIE", "Offset Path(op) is not supported yet"); - else if (!strcmp(type, "zz")) TVGERR("LOTTIE", "Zig Zag(zz) is not supported yet"); - return nullptr; -} - - -void LottieParser::parseObject(Array& parent) -{ - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("ty")) { - if (auto child = parseObject()) { - if (child->hidden) delete(child); - else parent.push(child); - } - } else skip(key); - } -} - - -LottieImage* LottieParser::parseImage(const char* data, const char* subPath, bool embedded) -{ - //Used for Image Asset - auto image = new LottieImage; - - //embedded image resource. should start with "data:" - //header look like "data:image/png;base64," so need to skip till ','. - if (embedded && !strncmp(data, "data:", 5)) { - //figure out the mimetype - auto mimeType = data + 11; - auto needle = strstr(mimeType, ";"); - image->mimeType = strDuplicate(mimeType, needle - mimeType); - //b64 data - auto b64Data = strstr(data, ",") + 1; - size_t length = strlen(data) - (b64Data - data); - image->size = b64Decode(b64Data, length, &image->b64Data); - //external image resource - } else { - auto len = strlen(dirName) + strlen(subPath) + strlen(data) + 1; - image->path = static_cast(malloc(len)); - snprintf(image->path, len, "%s%s%s", dirName, subPath, data); - } - - image->prepare(); - - return image; -} - - -LottieObject* LottieParser::parseAsset() -{ - enterObject(); - - LottieObject* obj = nullptr; - char *id = nullptr; - - //Used for Image Asset - const char* data = nullptr; - const char* subPath = nullptr; - auto embedded = false; - - while (auto key = nextObjectKey()) { - if (KEY_AS("id")) - { - if (peekType() == kStringType) { - id = getStringCopy(); - } else { - id = _int2str(getInt()); - } - } - else if (KEY_AS("layers")) obj = parseLayers(); - else if (KEY_AS("u")) subPath = getString(); - else if (KEY_AS("p")) data = getString(); - else if (KEY_AS("e")) embedded = getInt(); - else skip(key); - } - if (data) obj = parseImage(data, subPath, embedded); - if (obj) obj->name = id; - else free(id); - return obj; -} - - -LottieFont* LottieParser::parseFont() -{ - enterObject(); - - auto font = new LottieFont; - - while (auto key = nextObjectKey()) { - if (KEY_AS("fName")) font->name = getStringCopy(); - else if (KEY_AS("fFamily")) font->family = getStringCopy(); - else if (KEY_AS("fStyle")) font->style = getStringCopy(); - else if (KEY_AS("ascent")) font->ascent = getFloat(); - else if (KEY_AS("origin")) font->origin = (LottieFont::Origin) getInt(); - else skip(key); - } - return font; -} - - -void LottieParser::parseAssets() -{ - enterArray(); - while (nextArrayValue()) { - auto asset = parseAsset(); - if (asset) comp->assets.push(asset); - else TVGERR("LOTTIE", "Invalid Asset!"); - } -} - -LottieMarker* LottieParser::parseMarker() -{ - enterObject(); - - auto marker = new LottieMarker; - - while (auto key = nextObjectKey()) { - if (KEY_AS("cm")) marker->name = getStringCopy(); - else if (KEY_AS("tm")) marker->time = getFloat(); - else if (KEY_AS("dr")) marker->duration = getFloat(); - else skip(key); - } - - return marker; -} - -void LottieParser::parseMarkers() -{ - enterArray(); - while (nextArrayValue()) { - comp->markers.push(parseMarker()); - } -} - -void LottieParser::parseChars(Array& glyphs) -{ - enterArray(); - while (nextArrayValue()) { - enterObject(); - //a new glyph - auto glyph = new LottieGlyph; - while (auto key = nextObjectKey()) { - if (KEY_AS("ch")) glyph->code = getStringCopy(); - else if (KEY_AS("size")) glyph->size = static_cast(getFloat()); - else if (KEY_AS("style")) glyph->style = getStringCopy(); - else if (KEY_AS("w")) glyph->width = getFloat(); - else if (KEY_AS("fFamily")) glyph->family = getStringCopy(); - else if (KEY_AS("data")) - { //glyph shapes - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("shapes")) parseShapes(glyph->children); - } - } else skip(key); - } - glyph->prepare(); - glyphs.push(glyph); - } -} - -void LottieParser::parseFonts() -{ - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("list")) { - enterArray(); - while (nextArrayValue()) { - comp->fonts.push(parseFont()); - } - } else skip(key); - } -} - - -LottieObject* LottieParser::parseGroup() -{ - auto group = new LottieGroup; - if (!group) return nullptr; - - while (auto key = nextObjectKey()) { - if (KEY_AS("nm")) { - group->name = getStringCopy(); - } else if (KEY_AS("it")) { - enterArray(); - while (nextArrayValue()) parseObject(group->children); - } else skip(key); - } - if (group->children.empty()) { - delete(group); - return nullptr; - } - group->prepare(); - - return group; -} - - -void LottieParser::parseTimeRemap(LottieLayer* layer) -{ - parseProperty(layer->timeRemap); -} - - -uint8_t LottieParser::getDirection() -{ - auto v = getInt(); - if (v == 1) return 0; - if (v == 2) return 3; - if (v == 3) return 2; - return 0; -} - -void LottieParser::parseShapes(Array& parent) -{ - uint8_t direction; - - enterArray(); - while (nextArrayValue()) { - direction = 0; - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("it")) { - enterArray(); - while (nextArrayValue()) parseObject(parent); - } else if (KEY_AS("d")) { - direction = getDirection(); - } else if (KEY_AS("ty")) { - if (auto child = parseObject()) { - if (child->hidden) delete(child); - else parent.push(child); - if (direction > 0) static_cast(child)->direction = direction; - } - } else skip(key); - } - } -} - - -void LottieParser::parseTextRange(LottieText* text) -{ - enterArray(); - while (nextArrayValue()) { - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("a")) { //text style - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("t")) parseProperty(text->spacing); - else skip(key); - } - } else skip(key); - } - } -} - - -void LottieParser::parseText(Array& parent) -{ - enterObject(); - - auto text = new LottieText; - - while (auto key = nextObjectKey()) { - if (KEY_AS("d")) parseProperty(text->doc, text); - else if (KEY_AS("a")) parseTextRange(text); - //else if (KEY_AS("p")) TVGLOG("LOTTIE", "Text Follow Path (p) is not supported"); - //else if (KEY_AS("m")) TVGLOG("LOTTIE", "Text Alignment Option (m) is not supported"); - else skip(key); - } - - text->prepare(); - parent.push(text); -} - - -void LottieParser::getLayerSize(float& val) -{ - if (val == 0.0f) { - val = getFloat(); - } else { - //layer might have both w(width) & sw(solid color width) - //override one if the a new size is smaller. - auto w = getFloat(); - if (w < val) val = w; - } -} - -LottieMask* LottieParser::parseMask() -{ - auto mask = new LottieMask; - if (!mask) return nullptr; - - enterObject(); - while (auto key = nextObjectKey()) { - if (KEY_AS("inv")) mask->inverse = getBool(); - else if (KEY_AS("mode")) mask->method = getMaskMethod(mask->inverse); - else if (KEY_AS("pt")) getPathSet(mask->pathset); - else if (KEY_AS("o")) parseProperty(mask->opacity); - else skip(key); - } - - return mask; -} - - -void LottieParser::parseMasks(LottieLayer* layer) -{ - enterArray(); - while (nextArrayValue()) { - auto mask = parseMask(); - layer->masks.push(mask); - } -} - - -LottieLayer* LottieParser::parseLayer() -{ - auto layer = new LottieLayer; - if (!layer) return nullptr; - - layer->comp = comp; - context.layer = layer; - - auto ddd = false; - - enterObject(); - - while (auto key = nextObjectKey()) { - if (KEY_AS("ddd")) ddd = getInt(); //3d layer - else if (KEY_AS("ind")) layer->id = getInt(); - else if (KEY_AS("ty")) layer->type = (LottieLayer::Type) getInt(); - else if (KEY_AS("nm")) layer->name = getStringCopy(); - else if (KEY_AS("sr")) layer->timeStretch = getFloat(); - else if (KEY_AS("ks")) - { - enterObject(); - layer->transform = parseTransform(ddd); - } - else if (KEY_AS("ao")) layer->autoOrient = getInt(); - else if (KEY_AS("shapes")) parseShapes(layer->children); - else if (KEY_AS("ip")) layer->inFrame = getFloat(); - else if (KEY_AS("op")) layer->outFrame = getFloat(); - else if (KEY_AS("st")) layer->startFrame = getFloat(); - else if (KEY_AS("bm")) layer->blendMethod = getBlendMethod(); - else if (KEY_AS("parent")) layer->pid = getInt(); - else if (KEY_AS("tm")) parseTimeRemap(layer); - else if (KEY_AS("w") || KEY_AS("sw")) getLayerSize(layer->w); - else if (KEY_AS("h") || KEY_AS("sh")) getLayerSize(layer->h); - else if (KEY_AS("sc")) layer->color = getColor(getString()); - else if (KEY_AS("tt")) layer->matte.type = getMatteType(); - else if (KEY_AS("masksProperties")) parseMasks(layer); - else if (KEY_AS("hd")) layer->hidden = getBool(); - else if (KEY_AS("refId")) layer->refId = getStringCopy(); - else if (KEY_AS("td")) layer->matteSrc = getInt(); //used for matte layer - else if (KEY_AS("t")) parseText(layer->children); - else if (KEY_AS("ef")) - { - TVGERR("LOTTIE", "layer effect(ef) is not supported!"); - skip(key); - } - else skip(key); - } - - //Not a valid layer - if (!layer->transform) { - delete(layer); - return nullptr; - } - - layer->prepare(); - - return layer; -} - - -LottieLayer* LottieParser::parseLayers() -{ - auto root = new LottieLayer; - if (!root) return nullptr; - - root->type = LottieLayer::Precomp; - root->comp = comp; - - enterArray(); - while (nextArrayValue()) { - if (auto layer = parseLayer()) { - if (layer->matte.type == CompositeMethod::None) { - root->children.push(layer); - } else { - //matte source must be located in the right previous. - auto matte = static_cast(root->children.last()); - if (matte->matteSrc) { - layer->matte.target = matte; - } else { - TVGLOG("LOTTIE", "Matte Source(%s) is not designated?", matte->name); - } - root->children.last() = layer; - } - } - } - root->prepare(); - return root; -} - - -void LottieParser::postProcess(Array& glyphs) -{ - //aggregate font characters - for (uint32_t g = 0; g < glyphs.count; ++g) { - auto glyph = glyphs[g]; - for (uint32_t i = 0; i < comp->fonts.count; ++i) { - auto& font = comp->fonts[i]; - if (!strcmp(font->family, glyph->family) && !strcmp(font->style, glyph->style)) { - font->chars.push(glyph); - free(glyph->family); - free(glyph->style); - break; - } - } - } -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -const char* LottieParser::sid(bool first) -{ - if (first) { - //verify json - if (!parseNext()) return nullptr; - enterObject(); - } - return nextObjectKey(); -} - - -bool LottieParser::apply(LottieSlot* slot) -{ - enterObject(); - - //OPTIMIZE: we can create the property directly, without object - LottieObject* obj = nullptr; //slot object - - switch (slot->type) { - case LottieProperty::Type::ColorStop: { - obj = new LottieGradient; - context.parent = obj; - parseSlotProperty(static_cast(obj)->colorStops); - break; - } - case LottieProperty::Type::Color: { - obj = new LottieSolid; - context.parent = obj; - parseSlotProperty(static_cast(obj)->color); - break; - } - case LottieProperty::Type::TextDoc: { - obj = new LottieText; - context.parent = obj; - parseSlotProperty(static_cast(obj)->doc); - break; - } - default: break; - } - - if (!obj || Invalid()) return false; - - slot->assign(obj); - - delete(obj); - - return true; -} - - -bool LottieParser::parse() -{ - //verify json. - if (!parseNext()) return false; - - enterObject(); - - if (comp) delete(comp); - comp = new LottieComposition; - if (!comp) return false; - - Array glyphs; - - while (auto key = nextObjectKey()) { - if (KEY_AS("v")) comp->version = getStringCopy(); - else if (KEY_AS("fr")) comp->frameRate = getFloat(); - else if (KEY_AS("ip")) comp->startFrame = getFloat(); - else if (KEY_AS("op")) comp->endFrame = getFloat(); - else if (KEY_AS("w")) comp->w = getFloat(); - else if (KEY_AS("h")) comp->h = getFloat(); - else if (KEY_AS("nm")) comp->name = getStringCopy(); - else if (KEY_AS("assets")) parseAssets(); - else if (KEY_AS("layers")) comp->root = parseLayers(); - else if (KEY_AS("fonts")) parseFonts(); - else if (KEY_AS("chars")) parseChars(glyphs); - else if (KEY_AS("markers")) parseMarkers(); - else skip(key); - } - - if (Invalid() || !comp->root) { - delete(comp); - return false; - } - - comp->root->inFrame = comp->startFrame; - comp->root->outFrame = comp->endFrame; - - postProcess(glyphs); - - return true; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParser.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParser.h deleted file mode 100644 index a8b6b0d..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParser.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_LOTTIE_PARSER_H_ -#define _TVG_LOTTIE_PARSER_H_ - -#include "tvgCommon.h" -#include "tvgLottieParserHandler.h" -#include "tvgLottieProperty.h" - -struct LottieParser : LookaheadParserHandler -{ -public: - LottieParser(const char *str, const char* dirName) : LookaheadParserHandler(str) - { - this->dirName = dirName; - } - - bool parse(); - bool apply(LottieSlot* slot); - const char* sid(bool first = false); - - LottieComposition* comp = nullptr; - const char* dirName = nullptr; //base resource directory - -private: - BlendMethod getBlendMethod(); - RGB24 getColor(const char *str); - CompositeMethod getMatteType(); - FillRule getFillRule(); - StrokeCap getStrokeCap(); - StrokeJoin getStrokeJoin(); - CompositeMethod getMaskMethod(bool inversed); - LottieInterpolator* getInterpolator(const char* key, Point& in, Point& out); - uint8_t getDirection(); - - void getInterpolatorPoint(Point& pt); - void getPathSet(LottiePathSet& path); - void getLayerSize(float& val); - void getValue(TextDocument& doc); - void getValue(PathSet& path); - void getValue(Array& pts); - void getValue(ColorStop& color); - void getValue(float& val); - void getValue(uint8_t& val); - void getValue(Point& pt); - void getValue(RGB24& color); - - template bool parseTangent(const char *key, LottieVectorFrame& value); - template bool parseTangent(const char *key, LottieScalarFrame& value); - template void parseKeyFrame(T& prop); - template void parsePropertyInternal(T& prop); - template void parseProperty(T& prop, LottieObject* obj = nullptr); - template void parseSlotProperty(T& prop); - - LottieObject* parseObject(); - LottieObject* parseAsset(); - LottieImage* parseImage(const char* data, const char* subPath, bool embedded); - LottieLayer* parseLayer(); - LottieObject* parseGroup(); - LottieRect* parseRect(); - LottieEllipse* parseEllipse(); - LottieSolidFill* parseSolidFill(); - LottieTransform* parseTransform(bool ddd = false); - LottieSolidStroke* parseSolidStroke(); - LottieGradientStroke* parseGradientStroke(); - LottiePath* parsePath(); - LottiePolyStar* parsePolyStar(); - LottieRoundedCorner* parseRoundedCorner(); - LottieGradientFill* parseGradientFill(); - LottieLayer* parseLayers(); - LottieMask* parseMask(); - LottieTrimpath* parseTrimpath(); - LottieRepeater* parseRepeater(); - LottieFont* parseFont(); - LottieMarker* parseMarker(); - - void parseObject(Array& parent); - void parseShapes(Array& parent); - void parseText(Array& parent); - void parseMasks(LottieLayer* layer); - void parseTimeRemap(LottieLayer* layer); - void parseStrokeDash(LottieStroke* stroke); - void parseGradient(LottieGradient* gradient, const char* key); - void parseTextRange(LottieText* text); - void parseAssets(); - void parseFonts(); - void parseChars(Array& glyphs); - void parseMarkers(); - void postProcess(Array& glyphs); - - //Current parsing context - struct Context { - LottieLayer* layer = nullptr; - LottieObject* parent = nullptr; - } context; -}; - -#endif //_TVG_LOTTIE_PARSER_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParserHandler.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParserHandler.cpp deleted file mode 100644 index 4d00441..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParserHandler.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -/* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "tvgLottieParserHandler.h" - - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static const int PARSE_FLAGS = kParseDefaultFlags | kParseInsituFlag; - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - - -bool LookaheadParserHandler::enterArray() -{ - if (state != kEnteringArray) { - Error(); - return false; - } - parseNext(); - return true; -} - - -bool LookaheadParserHandler::nextArrayValue() -{ - if (state == kExitingArray) { - parseNext(); - return false; - } - //SPECIAL CASE: same as nextObjectKey() - if (state == kExitingObject) return false; - if (state == kError || state == kHasKey) { - Error(); - return false; - } - return true; -} - - -int LookaheadParserHandler::getInt() -{ - if (state != kHasNumber || !val.IsInt()) { - Error(); - return 0; - } - auto result = val.GetInt(); - parseNext(); - return result; -} - - -float LookaheadParserHandler::getFloat() -{ - if (state != kHasNumber) { - Error(); - return 0; - } - auto result = val.GetFloat(); - parseNext(); - return result; -} - - -const char* LookaheadParserHandler::getString() -{ - if (state != kHasString) { - Error(); - return nullptr; - } - auto result = val.GetString(); - parseNext(); - return result; -} - - -char* LookaheadParserHandler::getStringCopy() -{ - auto str = getString(); - if (str) return strdup(str); - return nullptr; -} - - -bool LookaheadParserHandler::getBool() -{ - if (state != kHasBool) { - Error(); - return false; - } - auto result = val.GetBool(); - parseNext(); - return result; -} - - -void LookaheadParserHandler::getNull() -{ - if (state != kHasNull) { - Error(); - return; - } - parseNext(); -} - - -bool LookaheadParserHandler::parseNext() -{ - if (reader.HasParseError()) { - Error(); - return false; - } - if (!reader.IterativeParseNext(iss, *this)) { - Error(); - return false; - } - return true; -} - - -bool LookaheadParserHandler::enterObject() -{ - if (state != kEnteringObject) { - Error(); - return false; - } - parseNext(); - return true; -} - - -int LookaheadParserHandler::peekType() -{ - if (state >= kHasNull && state <= kHasKey) return val.GetType(); - if (state == kEnteringArray) return kArrayType; - if (state == kEnteringObject) return kObjectType; - return -1; -} - - -void LookaheadParserHandler::skipOut(int depth) -{ - do { - if (state == kEnteringArray || state == kEnteringObject) ++depth; - else if (state == kExitingArray || state == kExitingObject) --depth; - else if (state == kError) return; - parseNext(); - } while (depth > 0); -} - - -const char* LookaheadParserHandler::nextObjectKey() -{ - if (state == kHasKey) { - auto result = val.GetString(); - parseNext(); - return result; - } - - /* SPECIAL CASE: The parser works with a predefined rule that it will be only - while (nextObjectKey()) for each object but in case of our nested group - object we can call multiple time nextObjectKey() while exiting the object - so ignore those and don't put parser in the error state. */ - if (state == kExitingArray || state == kEnteringObject) return nullptr; - - if (state != kExitingObject) { - Error(); - return nullptr; - } - - parseNext(); - return nullptr; -} - - -void LookaheadParserHandler::skip(const char* key) -{ - //if (key) TVGLOG("LOTTIE", "Skipped parsing value = %s", key); - - if (peekType() == kArrayType) { - enterArray(); - skipOut(1); - } else if (peekType() == kObjectType) { - enterObject(); - skipOut(1); - } else { - skipOut(0); - } -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParserHandler.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParserHandler.h deleted file mode 100644 index 65b4545..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieParserHandler.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -/* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef _TVG_LOTTIE_PARSER_HANDLER_H_ -#define _TVG_LOTTIE_PARSER_HANDLER_H_ - -#include "rapidjson/document.h" -#include "tvgCommon.h" - - -using namespace rapidjson; - - -struct LookaheadParserHandler -{ - enum LookaheadParsingState { - kInit = 0, - kError, - kHasNull, - kHasBool, - kHasNumber, - kHasString, - kHasKey, - kEnteringObject, - kExitingObject, - kEnteringArray, - kExitingArray - }; - - Value val; - LookaheadParsingState state = kInit; - Reader reader; - InsituStringStream iss; - - LookaheadParserHandler(const char *str) : iss((char*)str) - { - reader.IterativeParseInit(); - } - - bool Null() - { - state = kHasNull; - val.SetNull(); - return true; - } - - bool Bool(bool b) - { - state = kHasBool; - val.SetBool(b); - return true; - } - - bool Int(int i) - { - state = kHasNumber; - val.SetInt(i); - return true; - } - - bool Uint(unsigned u) - { - state = kHasNumber; - val.SetUint(u); - return true; - } - - bool Int64(int64_t i) - { - state = kHasNumber; - val.SetInt64(i); - return true; - } - - bool Uint64(int64_t u) - { - state = kHasNumber; - val.SetUint64(u); - return true; - } - - bool Double(double d) - { - state = kHasNumber; - val.SetDouble(d); - return true; - } - - bool RawNumber(const char *, SizeType, TVG_UNUSED bool) - { - return false; - } - - bool String(const char *str, SizeType length, TVG_UNUSED bool) - { - state = kHasString; - val.SetString(str, length); - return true; - } - - bool StartObject() - { - state = kEnteringObject; - return true; - } - - bool Key(const char *str, SizeType length, TVG_UNUSED bool) - { - state = kHasKey; - val.SetString(str, length); - return true; - } - - bool EndObject(SizeType) - { - state = kExitingObject; - return true; - } - - bool StartArray() - { - state = kEnteringArray; - return true; - } - - bool EndArray(SizeType) - { - state = kExitingArray; - return true; - } - - void Error() - { - TVGERR("LOTTIE", "Parsing Error!"); - state = kError; - } - - bool Invalid() - { - return state == kError; - } - - bool enterObject(); - bool enterArray(); - bool nextArrayValue(); - int getInt(); - float getFloat(); - const char* getString(); - char* getStringCopy(); - bool getBool(); - void getNull(); - bool parseNext(); - const char* nextObjectKey(); - void skip(const char* key); - void skipOut(int depth); - int peekType(); -}; - -#endif //_TVG_LOTTIE_PARSER_HANDLER_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieProperty.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieProperty.h deleted file mode 100644 index 19df895..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgLottieProperty.h +++ /dev/null @@ -1,935 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_LOTTIE_PROPERTY_H_ -#define _TVG_LOTTIE_PROPERTY_H_ - -#include "tvgCommon.h" -#include "tvgArray.h" -#include "tvgMath.h" -#include "tvgLines.h" -#include "tvgLottieInterpolator.h" -#include "tvgLottieExpressions.h" - -#define ROUNDNESS_EPSILON 1.0f - -struct LottieFont; -struct LottieLayer; -struct LottieObject; - - -struct PathSet -{ - Point* pts = nullptr; - PathCommand* cmds = nullptr; - uint16_t ptsCnt = 0; - uint16_t cmdsCnt = 0; -}; - - -struct RGB24 -{ - int32_t rgb[3]; -}; - - -struct ColorStop -{ - Fill::ColorStop* data = nullptr; - Array* input = nullptr; -}; - - -struct TextDocument -{ - char* text = nullptr; - float height; - float shift; - RGB24 color; - struct { - Point pos; - Point size; - } bbox; - struct { - RGB24 color; - float width; - bool render = false; - } stroke; - char* name = nullptr; - float size; - float tracking = 0.0f; - uint8_t justify; -}; - - -static inline RGB24 operator-(const RGB24& lhs, const RGB24& rhs) -{ - return {lhs.rgb[0] - rhs.rgb[0], lhs.rgb[1] - rhs.rgb[1], lhs.rgb[2] - rhs.rgb[2]}; -} - - -static inline RGB24 operator+(const RGB24& lhs, const RGB24& rhs) -{ - return {lhs.rgb[0] + rhs.rgb[0], lhs.rgb[1] + rhs.rgb[1], lhs.rgb[2] + rhs.rgb[2]}; -} - - -static inline RGB24 operator*(const RGB24& lhs, float rhs) -{ - return {(int32_t)lroundf(lhs.rgb[0] * rhs), (int32_t)lroundf(lhs.rgb[1] * rhs), (int32_t)lroundf(lhs.rgb[2] * rhs)}; -} - - -template -struct LottieScalarFrame -{ - T value; //keyframe value - float no; //frame number - LottieInterpolator* interpolator; - bool hold = false; //do not interpolate. - - T interpolate(LottieScalarFrame* next, float frameNo) - { - auto t = (frameNo - no) / (next->no - no); - if (interpolator) t = interpolator->progress(t); - - if (hold) { - if (t < 1.0f) return value; - else return next->value; - } - return mathLerp(value, next->value, t); - } -}; - - -template -struct LottieVectorFrame -{ - T value; //keyframe value - float no; //frame number - LottieInterpolator* interpolator; - T outTangent, inTangent; - float length; - bool hasTangent = false; - bool hold = false; - - T interpolate(LottieVectorFrame* next, float frameNo) - { - auto t = (frameNo - no) / (next->no - no); - if (interpolator) t = interpolator->progress(t); - - if (hold) { - if (t < 1.0f) return value; - else return next->value; - } - - if (hasTangent) { - Bezier bz = {value, value + outTangent, next->value + inTangent, next->value}; - t = bezAtApprox(bz, t * length, length); - return bezPointAt(bz, t); - } else { - return mathLerp(value, next->value, t); - } - } - - float angle(LottieVectorFrame* next, float frameNo) - { - if (!hasTangent) return 0; - auto t = (frameNo - no) / (next->no - no); - if (interpolator) t = interpolator->progress(t); - Bezier bz = {value, value + outTangent, next->value + inTangent, next->value}; - t = bezAtApprox(bz, t * length, length); - return -bezAngleAt(bz, t); - } - - void prepare(LottieVectorFrame* next) - { - Bezier bz = {value, value + outTangent, next->value + inTangent, next->value}; - length = bezLengthApprox(bz); - } -}; - - -//Property would have an either keyframes or single value. -struct LottieProperty -{ - enum class Type : uint8_t { Point = 0, Float, Opacity, Color, PathSet, ColorStop, Position, TextDoc, Invalid }; - virtual ~LottieProperty() {} - - LottieExpression* exp = nullptr; - - //TODO: Apply common bodies? - virtual uint32_t frameCnt() = 0; - virtual uint32_t nearest(float time) = 0; - virtual float frameNo(int32_t key) = 0; -}; - - -struct LottieExpression -{ - enum LoopMode : uint8_t { None = 0, InCycle = 1, InPingPong, InOffset, InContinue, OutCycle, OutPingPong, OutOffset, OutContinue }; - - char* code; - LottieComposition* comp; - LottieLayer* layer; - LottieObject* object; - LottieProperty* property; - LottieProperty::Type type; - - bool enabled; - - struct { - uint32_t key = 0; //the keyframe number repeating to - float in = FLT_MAX; //looping duration in frame number - LoopMode mode = None; - } loop; -; - ~LottieExpression() - { - free(code); - } -}; - - -static void _copy(PathSet* pathset, Array& outPts, Matrix* transform) -{ - Array inPts; - - if (transform) { - for (int i = 0; i < pathset->ptsCnt; ++i) { - Point pt = pathset->pts[i]; - mathMultiply(&pt, transform); - outPts.push(pt); - } - } else { - inPts.data = pathset->pts; - inPts.count = pathset->ptsCnt; - outPts.push(inPts); - inPts.data = nullptr; - } -} - - -static void _copy(PathSet* pathset, Array& outCmds) -{ - Array inCmds; - inCmds.data = pathset->cmds; - inCmds.count = pathset->cmdsCnt; - outCmds.push(inCmds); - inCmds.data = nullptr; -} - - -static void _roundCorner(Array& cmds, Array& pts, const Point& prev, const Point& curr, const Point& next, float roundness) -{ - auto lenPrev = mathLength(prev - curr); - auto rPrev = lenPrev > 0.0f ? 0.5f * mathMin(lenPrev * 0.5f, roundness) / lenPrev : 0.0f; - auto lenNext = mathLength(next - curr); - auto rNext = lenNext > 0.0f ? 0.5f * mathMin(lenNext * 0.5f, roundness) / lenNext : 0.0f; - - auto dPrev = rPrev * (curr - prev); - auto dNext = rNext * (curr - next); - - pts.push(curr - 2.0f * dPrev); - pts.push(curr - dPrev); - pts.push(curr - dNext); - pts.push(curr - 2.0f * dNext); - cmds.push(PathCommand::LineTo); - cmds.push(PathCommand::CubicTo); -} - - -static bool _modifier(Point* inputPts, uint32_t inputPtsCnt, PathCommand* inputCmds, uint32_t inputCmdsCnt, Array& cmds, Array& pts, Matrix* transform, float roundness) -{ - cmds.reserve(inputCmdsCnt * 2); - pts.reserve((uint16_t)(inputPtsCnt * 1.5)); - auto ptsCnt = pts.count; - - auto startIndex = 0; - for (uint32_t iCmds = 0, iPts = 0; iCmds < inputCmdsCnt; ++iCmds) { - switch (inputCmds[iCmds]) { - case PathCommand::MoveTo: { - startIndex = pts.count; - cmds.push(PathCommand::MoveTo); - pts.push(inputPts[iPts++]); - break; - } - case PathCommand::CubicTo: { - auto& prev = inputPts[iPts - 1]; - auto& curr = inputPts[iPts + 2]; - if (iCmds < inputCmdsCnt - 1 && - mathZero(inputPts[iPts - 1] - inputPts[iPts]) && - mathZero(inputPts[iPts + 1] - inputPts[iPts + 2])) { - if (inputCmds[iCmds + 1] == PathCommand::CubicTo && - mathZero(inputPts[iPts + 2] - inputPts[iPts + 3]) && - mathZero(inputPts[iPts + 4] - inputPts[iPts + 5])) { - _roundCorner(cmds, pts, prev, curr, inputPts[iPts + 5], roundness); - iPts += 3; - break; - } else if (inputCmds[iCmds + 1] == PathCommand::Close) { - _roundCorner(cmds, pts, prev, curr, inputPts[2], roundness); - pts[startIndex] = pts.last(); - iPts += 3; - break; - } - } - cmds.push(PathCommand::CubicTo); - pts.push(inputPts[iPts++]); - pts.push(inputPts[iPts++]); - pts.push(inputPts[iPts++]); - break; - } - case PathCommand::Close: { - cmds.push(PathCommand::Close); - break; - } - default: break; - } - } - if (transform) { - for (auto i = ptsCnt; i < pts.count; ++i) - mathTransform(transform, &pts[i]); - } - return true; -} - - -template -uint32_t _bsearch(T* frames, float frameNo) -{ - int32_t low = 0; - int32_t high = int32_t(frames->count) - 1; - - while (low <= high) { - auto mid = low + (high - low) / 2; - auto frame = frames->data + mid; - if (frameNo < frame->no) high = mid - 1; - else low = mid + 1; - } - if (high < low) low = high; - if (low < 0) low = 0; - return low; -} - - -template -uint32_t _nearest(T* frames, float frameNo) -{ - if (frames) { - auto key = _bsearch(frames, frameNo); - if (key == frames->count - 1) return key; - return (fabsf(frames->data[key].no - frameNo) < fabsf(frames->data[key + 1].no - frameNo)) ? key : (key + 1); - } - return 0; -} - - -template -float _frameNo(T* frames, int32_t key) -{ - if (!frames) return 0.0f; - if (key < 0) key = 0; - if (key >= (int32_t) frames->count) key = (int32_t)(frames->count - 1); - return (*frames)[key].no; -} - - -template -float _loop(T* frames, float frameNo, LottieExpression* exp) -{ - if (frameNo >= exp->loop.in || frameNo < frames->first().no ||frameNo < frames->last().no) return frameNo; - - switch (exp->loop.mode) { - case LottieExpression::LoopMode::InCycle: { - frameNo -= frames->first().no; - return fmodf(frameNo, frames->last().no - frames->first().no) + (*frames)[exp->loop.key].no; - } - case LottieExpression::LoopMode::OutCycle: { - frameNo -= frames->first().no; - return fmodf(frameNo, (*frames)[frames->count - 1 - exp->loop.key].no - frames->first().no) + frames->first().no; - } - default: break; - } - return frameNo; -} - - -template -struct LottieGenericProperty : LottieProperty -{ - //Property has an either keyframes or single value. - Array>* frames = nullptr; - T value; - - LottieGenericProperty(T v) : value(v) {} - LottieGenericProperty() {} - - ~LottieGenericProperty() - { - release(); - } - - void release() - { - delete(frames); - frames = nullptr; - if (exp) { - delete(exp); - exp = nullptr; - } - } - - uint32_t nearest(float frameNo) override - { - return _nearest(frames, frameNo); - } - - uint32_t frameCnt() override - { - return frames ? frames->count : 1; - } - - float frameNo(int32_t key) override - { - return _frameNo(frames, key); - } - - LottieScalarFrame& newFrame() - { - if (!frames) frames = new Array>; - if (frames->count + 1 >= frames->reserved) { - auto old = frames->reserved; - frames->grow(frames->count + 2); - memset((void*)(frames->data + old), 0x00, sizeof(LottieScalarFrame) * (frames->reserved - old)); - } - ++frames->count; - return frames->last(); - } - - LottieScalarFrame& nextFrame() - { - return (*frames)[frames->count]; - } - - T operator()(float frameNo) - { - if (!frames) return value; - if (frames->count == 1 || frameNo <= frames->first().no) return frames->first().value; - if (frameNo >= frames->last().no) return frames->last().value; - - auto frame = frames->data + _bsearch(frames, frameNo); - if (mathEqual(frame->no, frameNo)) return frame->value; - return frame->interpolate(frame + 1, frameNo); - } - - T operator()(float frameNo, LottieExpressions* exps) - { - if (exps && (exp && exp->enabled)) { - T out{}; - if (exp->loop.mode != LottieExpression::LoopMode::None) frameNo = _loop(frames, frameNo, exp); - if (exps->result>(frameNo, out, exp)) return out; - } - return operator()(frameNo); - } - - T& operator=(const T& other) - { - //shallow copy, used for slot overriding - if (other.frames) { - frames = other.frames; - const_cast(other).frames = nullptr; - } else value = other.value; - return *this; - } - - float angle(float frameNo) { return 0; } - void prepare() {} -}; - - -struct LottiePathSet : LottieProperty -{ - Array>* frames = nullptr; - PathSet value; - - ~LottiePathSet() - { - release(); - } - - void release() - { - if (exp) { - delete(exp); - exp = nullptr; - } - - free(value.cmds); - free(value.pts); - - if (!frames) return; - - for (auto p = frames->begin(); p < frames->end(); ++p) { - free((*p).value.cmds); - free((*p).value.pts); - } - free(frames->data); - free(frames); - } - - uint32_t nearest(float frameNo) override - { - return _nearest(frames, frameNo); - } - - uint32_t frameCnt() override - { - return frames ? frames->count : 1; - } - - float frameNo(int32_t key) override - { - return _frameNo(frames, key); - } - - LottieScalarFrame& newFrame() - { - if (!frames) { - frames = static_cast>*>(calloc(1, sizeof(Array>))); - } - if (frames->count + 1 >= frames->reserved) { - auto old = frames->reserved; - frames->grow(frames->count + 2); - memset((void*)(frames->data + old), 0x00, sizeof(LottieScalarFrame) * (frames->reserved - old)); - } - ++frames->count; - return frames->last(); - } - - LottieScalarFrame& nextFrame() - { - return (*frames)[frames->count]; - } - - bool operator()(float frameNo, Array& cmds, Array& pts, Matrix* transform, float roundness) - { - PathSet* path = nullptr; - LottieScalarFrame* frame = nullptr; - float t; - bool interpolate = false; - - if (!frames) path = &value; - else if (frames->count == 1 || frameNo <= frames->first().no) path = &frames->first().value; - else if (frameNo >= frames->last().no) path = &frames->last().value; - else { - frame = frames->data + _bsearch(frames, frameNo); - if (mathEqual(frame->no, frameNo)) path = &frame->value; - else { - t = (frameNo - frame->no) / ((frame + 1)->no - frame->no); - if (frame->interpolator) t = frame->interpolator->progress(t); - if (frame->hold) path = &(frame + ((t < 1.0f) ? 0 : 1))->value; - else interpolate = true; - } - } - - if (!interpolate) { - if (roundness > ROUNDNESS_EPSILON) return _modifier(path->pts, path->ptsCnt, path->cmds, path->cmdsCnt, cmds, pts, transform, roundness); - _copy(path, cmds); - _copy(path, pts, transform); - return true; - } - - auto s = frame->value.pts; - auto e = (frame + 1)->value.pts; - - if (roundness > ROUNDNESS_EPSILON) { - auto interpPts = (Point*)malloc(frame->value.ptsCnt * sizeof(Point)); - auto p = interpPts; - for (auto i = 0; i < frame->value.ptsCnt; ++i, ++s, ++e, ++p) { - *p = mathLerp(*s, *e, t); - if (transform) mathMultiply(p, transform); - } - _modifier(interpPts, frame->value.ptsCnt, frame->value.cmds, frame->value.cmdsCnt, cmds, pts, nullptr, roundness); - free(interpPts); - return true; - } else { - for (auto i = 0; i < frame->value.ptsCnt; ++i, ++s, ++e) { - auto pt = mathLerp(*s, *e, t); - if (transform) mathMultiply(&pt, transform); - pts.push(pt); - } - _copy(&frame->value, cmds); - } - return true; - } - - - bool operator()(float frameNo, Array& cmds, Array& pts, Matrix* transform, float roundness, LottieExpressions* exps) - { - if (exps && (exp && exp->enabled)) { - if (exp->loop.mode != LottieExpression::LoopMode::None) frameNo = _loop(frames, frameNo, exp); - if (exps->result(frameNo, cmds, pts, transform, roundness, exp)) return true; - } - return operator()(frameNo, cmds, pts, transform, roundness); - } - - void prepare() {} -}; - - -struct LottieColorStop : LottieProperty -{ - Array>* frames = nullptr; - ColorStop value; - uint16_t count = 0; //colorstop count - bool populated = false; - - ~LottieColorStop() - { - release(); - } - - void release() - { - if (exp) { - delete(exp); - exp = nullptr; - } - - if (value.data) { - free(value.data); - value.data = nullptr; - } - - if (!frames) return; - - for (auto p = frames->begin(); p < frames->end(); ++p) { - free((*p).value.data); - } - free(frames->data); - free(frames); - frames = nullptr; - } - - uint32_t nearest(float frameNo) override - { - return _nearest(frames, frameNo); - } - - uint32_t frameCnt() override - { - return frames ? frames->count : 1; - } - - float frameNo(int32_t key) override - { - return _frameNo(frames, key); - } - - LottieScalarFrame& newFrame() - { - if (!frames) { - frames = static_cast>*>(calloc(1, sizeof(Array>))); - } - if (frames->count + 1 >= frames->reserved) { - auto old = frames->reserved; - frames->grow(frames->count + 2); - memset((void*)(frames->data + old), 0x00, sizeof(LottieScalarFrame) * (frames->reserved - old)); - } - ++frames->count; - return frames->last(); - } - - LottieScalarFrame& nextFrame() - { - return (*frames)[frames->count]; - } - - Result operator()(float frameNo, Fill* fill, LottieExpressions* exps) - { - if (exps && (exp && exp->enabled)) { - if (exp->loop.mode != LottieExpression::LoopMode::None) frameNo = _loop(frames, frameNo, exp); - if (exps->result(frameNo, fill, exp)) return Result::Success; - } - - if (!frames) return fill->colorStops(value.data, count); - - if (frames->count == 1 || frameNo <= frames->first().no) { - return fill->colorStops(frames->first().value.data, count); - } - - if (frameNo >= frames->last().no) return fill->colorStops(frames->last().value.data, count); - - auto frame = frames->data + _bsearch(frames, frameNo); - if (mathEqual(frame->no, frameNo)) return fill->colorStops(frame->value.data, count); - - //interpolate - auto t = (frameNo - frame->no) / ((frame + 1)->no - frame->no); - if (frame->interpolator) t = frame->interpolator->progress(t); - - if (frame->hold) { - if (t < 1.0f) fill->colorStops(frame->value.data, count); - else fill->colorStops((frame + 1)->value.data, count); - } - - auto s = frame->value.data; - auto e = (frame + 1)->value.data; - - Array result; - - for (auto i = 0; i < count; ++i, ++s, ++e) { - auto offset = mathLerp(s->offset, e->offset, t); - auto r = mathLerp(s->r, e->r, t); - auto g = mathLerp(s->g, e->g, t); - auto b = mathLerp(s->b, e->b, t); - auto a = mathLerp(s->a, e->a, t); - result.push({offset, r, g, b, a}); - } - return fill->colorStops(result.data, count); - } - - LottieColorStop& operator=(const LottieColorStop& other) - { - //shallow copy, used for slot overriding - if (other.frames) { - frames = other.frames; - const_cast(other).frames = nullptr; - } else { - value = other.value; - const_cast(other).value = {nullptr, nullptr}; - } - populated = other.populated; - count = other.count; - - return *this; - } - - void prepare() {} -}; - - -struct LottiePosition : LottieProperty -{ - Array>* frames = nullptr; - Point value; - - LottiePosition(Point v) : value(v) - { - } - - ~LottiePosition() - { - release(); - } - - void release() - { - delete(frames); - frames = nullptr; - - if (exp) { - delete(exp); - exp = nullptr; - } - } - - uint32_t nearest(float frameNo) override - { - return _nearest(frames, frameNo); - } - - uint32_t frameCnt() override - { - return frames ? frames->count : 1; - } - - float frameNo(int32_t key) override - { - return _frameNo(frames, key); - } - - LottieVectorFrame& newFrame() - { - if (!frames) frames = new Array>; - if (frames->count + 1 >= frames->reserved) { - auto old = frames->reserved; - frames->grow(frames->count + 2); - memset((void*)(frames->data + old), 0x00, sizeof(LottieVectorFrame) * (frames->reserved - old)); - } - ++frames->count; - return frames->last(); - } - - LottieVectorFrame& nextFrame() - { - return (*frames)[frames->count]; - } - - Point operator()(float frameNo) - { - if (!frames) return value; - if (frames->count == 1 || frameNo <= frames->first().no) return frames->first().value; - if (frameNo >= frames->last().no) return frames->last().value; - - auto frame = frames->data + _bsearch(frames, frameNo); - if (mathEqual(frame->no, frameNo)) return frame->value; - return frame->interpolate(frame + 1, frameNo); - } - - Point operator()(float frameNo, LottieExpressions* exps) - { - Point out{}; - if (exps && (exp && exp->enabled)) { - if (exp->loop.mode != LottieExpression::LoopMode::None) frameNo = _loop(frames, frameNo, exp); - if (exps->result(frameNo, out, exp)) return out; - } - return operator()(frameNo); - } - - float angle(float frameNo) - { - if (!frames) return 0; - if (frames->count == 1 || frameNo <= frames->first().no) return 0; - if (frameNo >= frames->last().no) return 0; - - auto frame = frames->data + _bsearch(frames, frameNo); - return frame->angle(frame + 1, frameNo); - } - - void prepare() - { - if (!frames || frames->count < 2) return; - for (auto frame = frames->begin() + 1; frame < frames->end(); ++frame) { - (frame - 1)->prepare(frame); - } - } -}; - - -struct LottieTextDoc : LottieProperty -{ - Array>* frames = nullptr; - TextDocument value; - - ~LottieTextDoc() - { - release(); - } - - void release() - { - if (exp) { - delete(exp); - exp = nullptr; - } - - if (value.text) { - free(value.text); - value.text = nullptr; - } - if (value.name) { - free(value.name); - value.name = nullptr; - } - - if (!frames) return; - - for (auto p = frames->begin(); p < frames->end(); ++p) { - free((*p).value.text); - free((*p).value.name); - } - delete(frames); - frames = nullptr; - } - - uint32_t nearest(float frameNo) override - { - return _nearest(frames, frameNo); - } - - uint32_t frameCnt() override - { - return frames ? frames->count : 1; - } - - float frameNo(int32_t key) override - { - return _frameNo(frames, key); - } - - LottieScalarFrame& newFrame() - { - if (!frames) frames = new Array>; - if (frames->count + 1 >= frames->reserved) { - auto old = frames->reserved; - frames->grow(frames->count + 2); - memset((void*)(frames->data + old), 0x00, sizeof(LottieScalarFrame) * (frames->reserved - old)); - } - ++frames->count; - return frames->last(); - } - - LottieScalarFrame& nextFrame() - { - return (*frames)[frames->count]; - } - - TextDocument& operator()(float frameNo) - { - if (!frames) return value; - if (frames->count == 1 || frameNo <= frames->first().no) return frames->first().value; - if (frameNo >= frames->last().no) return frames->last().value; - - auto frame = frames->data + _bsearch(frames, frameNo); - return frame->value; - } - - LottieTextDoc& operator=(const LottieTextDoc& other) - { - //shallow copy, used for slot overriding - if (other.frames) { - frames = other.frames; - const_cast(other).frames = nullptr; - } else { - value = other.value; - const_cast(other).value.text = nullptr; - const_cast(other).value.name = nullptr; - } - return *this; - } - - void prepare() {} -}; - - -using LottiePoint = LottieGenericProperty; -using LottieFloat = LottieGenericProperty; -using LottieOpacity = LottieGenericProperty; -using LottieColor = LottieGenericProperty; - -#endif //_TVG_LOTTIE_PROPERTY_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgMath.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgMath.cpp deleted file mode 100644 index 509a459..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgMath.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgMath.h" - - -bool mathInverse(const Matrix* m, Matrix* out) -{ - auto det = m->e11 * (m->e22 * m->e33 - m->e32 * m->e23) - - m->e12 * (m->e21 * m->e33 - m->e23 * m->e31) + - m->e13 * (m->e21 * m->e32 - m->e22 * m->e31); - - if (mathZero(det)) return false; - - auto invDet = 1 / det; - - out->e11 = (m->e22 * m->e33 - m->e32 * m->e23) * invDet; - out->e12 = (m->e13 * m->e32 - m->e12 * m->e33) * invDet; - out->e13 = (m->e12 * m->e23 - m->e13 * m->e22) * invDet; - out->e21 = (m->e23 * m->e31 - m->e21 * m->e33) * invDet; - out->e22 = (m->e11 * m->e33 - m->e13 * m->e31) * invDet; - out->e23 = (m->e21 * m->e13 - m->e11 * m->e23) * invDet; - out->e31 = (m->e21 * m->e32 - m->e31 * m->e22) * invDet; - out->e32 = (m->e31 * m->e12 - m->e11 * m->e32) * invDet; - out->e33 = (m->e11 * m->e22 - m->e21 * m->e12) * invDet; - - return true; -} - - -Matrix mathMultiply(const Matrix* lhs, const Matrix* rhs) -{ - Matrix m; - - m.e11 = lhs->e11 * rhs->e11 + lhs->e12 * rhs->e21 + lhs->e13 * rhs->e31; - m.e12 = lhs->e11 * rhs->e12 + lhs->e12 * rhs->e22 + lhs->e13 * rhs->e32; - m.e13 = lhs->e11 * rhs->e13 + lhs->e12 * rhs->e23 + lhs->e13 * rhs->e33; - - m.e21 = lhs->e21 * rhs->e11 + lhs->e22 * rhs->e21 + lhs->e23 * rhs->e31; - m.e22 = lhs->e21 * rhs->e12 + lhs->e22 * rhs->e22 + lhs->e23 * rhs->e32; - m.e23 = lhs->e21 * rhs->e13 + lhs->e22 * rhs->e23 + lhs->e23 * rhs->e33; - - m.e31 = lhs->e31 * rhs->e11 + lhs->e32 * rhs->e21 + lhs->e33 * rhs->e31; - m.e32 = lhs->e31 * rhs->e12 + lhs->e32 * rhs->e22 + lhs->e33 * rhs->e32; - m.e33 = lhs->e31 * rhs->e13 + lhs->e32 * rhs->e23 + lhs->e33 * rhs->e33; - - return m; -} - - -void mathRotate(Matrix* m, float degree) -{ - if (degree == 0.0f) return; - - auto radian = degree / 180.0f * MATH_PI; - auto cosVal = cosf(radian); - auto sinVal = sinf(radian); - - m->e12 = m->e11 * -sinVal; - m->e11 *= cosVal; - m->e21 = m->e22 * sinVal; - m->e22 *= cosVal; -} - - -bool mathIdentity(const Matrix* m) -{ - if (m->e11 != 1.0f || m->e12 != 0.0f || m->e13 != 0.0f || - m->e21 != 0.0f || m->e22 != 1.0f || m->e23 != 0.0f || - m->e31 != 0.0f || m->e32 != 0.0f || m->e33 != 1.0f) { - return false; - } - return true; -} - - -void mathMultiply(Point* pt, const Matrix* transform) -{ - auto tx = pt->x * transform->e11 + pt->y * transform->e12 + transform->e13; - auto ty = pt->x * transform->e21 + pt->y * transform->e22 + transform->e23; - pt->x = tx; - pt->y = ty; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgMath.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgMath.h deleted file mode 100644 index 49bbe18..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgMath.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_MATH_H_ -#define _TVG_MATH_H_ - - #define _USE_MATH_DEFINES - -#include -#include -#include "tvgCommon.h" - -#define MATH_PI 3.14159265358979323846f -#define MATH_PI2 1.57079632679489661923f -#define FLOAT_EPSILON 1.0e-06f //1.192092896e-07f -#define PATH_KAPPA 0.552284f - -#define mathMin(x, y) (((x) < (y)) ? (x) : (y)) -#define mathMax(x, y) (((x) > (y)) ? (x) : (y)) - - -bool mathInverse(const Matrix* m, Matrix* out); -Matrix mathMultiply(const Matrix* lhs, const Matrix* rhs); -void mathRotate(Matrix* m, float degree); -bool mathIdentity(const Matrix* m); -void mathMultiply(Point* pt, const Matrix* transform); - - -static inline float mathDeg2Rad(float degree) -{ - return degree * (MATH_PI / 180.0f); -} - - -static inline float mathRad2Deg(float radian) -{ - return radian * (180.0f / MATH_PI); -} - - -static inline bool mathZero(float a) -{ - return (fabsf(a) <= FLOAT_EPSILON) ? true : false; -} - - -static inline bool mathZero(const Point& p) -{ - return mathZero(p.x) && mathZero(p.y); -} - - -static inline bool mathEqual(float a, float b) -{ - return mathZero(a - b); -} - - -static inline bool mathEqual(const Matrix& a, const Matrix& b) -{ - if (!mathEqual(a.e11, b.e11) || !mathEqual(a.e12, b.e12) || !mathEqual(a.e13, b.e13) || - !mathEqual(a.e21, b.e21) || !mathEqual(a.e22, b.e22) || !mathEqual(a.e23, b.e23) || - !mathEqual(a.e31, b.e31) || !mathEqual(a.e32, b.e32) || !mathEqual(a.e33, b.e33)) { - return false; - } - return true; -} - - -static inline bool mathRightAngle(const Matrix* m) -{ - auto radian = fabsf(atan2f(m->e21, m->e11)); - if (radian < FLOAT_EPSILON || mathEqual(radian, MATH_PI2) || mathEqual(radian, MATH_PI)) return true; - return false; -} - - -static inline bool mathSkewed(const Matrix* m) -{ - return !mathZero(m->e21 + m->e12); -} - - -static inline void mathIdentity(Matrix* m) -{ - m->e11 = 1.0f; - m->e12 = 0.0f; - m->e13 = 0.0f; - m->e21 = 0.0f; - m->e22 = 1.0f; - m->e23 = 0.0f; - m->e31 = 0.0f; - m->e32 = 0.0f; - m->e33 = 1.0f; -} - - -static inline void mathTransform(Matrix* transform, Point* coord) -{ - auto x = coord->x; - auto y = coord->y; - coord->x = x * transform->e11 + y * transform->e12 + transform->e13; - coord->y = x * transform->e21 + y * transform->e22 + transform->e23; -} - - -static inline void mathScale(Matrix* m, float sx, float sy) -{ - m->e11 *= sx; - m->e22 *= sy; -} - - -static inline void mathScaleR(Matrix* m, float x, float y) -{ - if (x != 1.0f) { - m->e11 *= x; - m->e21 *= x; - } - if (y != 1.0f) { - m->e22 *= y; - m->e12 *= y; - } -} - - -static inline void mathTranslate(Matrix* m, float x, float y) -{ - m->e13 += x; - m->e23 += y; -} - - -static inline void mathTranslateR(Matrix* m, float x, float y) -{ - if (x == 0.0f && y == 0.0f) return; - m->e13 += (x * m->e11 + y * m->e12); - m->e23 += (x * m->e21 + y * m->e22); -} - - -static inline void mathLog(Matrix* m) -{ - TVGLOG("MATH", "Matrix: [%f %f %f] [%f %f %f] [%f %f %f]", m->e11, m->e12, m->e13, m->e21, m->e22, m->e23, m->e31, m->e32, m->e33); -} - - -static inline float mathLength(const Point* a, const Point* b) -{ - auto x = b->x - a->x; - auto y = b->y - a->y; - - if (x < 0) x = -x; - if (y < 0) y = -y; - - return (x > y) ? (x + 0.375f * y) : (y + 0.375f * x); -} - - -static inline float mathLength(const Point& a) -{ - return sqrtf(a.x * a.x + a.y * a.y); -} - - -static inline Point operator-(const Point& lhs, const Point& rhs) -{ - return {lhs.x - rhs.x, lhs.y - rhs.y}; -} - - -static inline Point operator+(const Point& lhs, const Point& rhs) -{ - return {lhs.x + rhs.x, lhs.y + rhs.y}; -} - - -static inline Point operator*(const Point& lhs, float rhs) -{ - return {lhs.x * rhs, lhs.y * rhs}; -} - - -static inline Point operator*(const float& lhs, const Point& rhs) -{ - return {lhs * rhs.x, lhs * rhs.y}; -} - - -static inline Point operator/(const Point& lhs, const float rhs) -{ - return {lhs.x / rhs, lhs.y / rhs}; -} - - -template -static inline T mathLerp(const T &start, const T &end, float t) -{ - return static_cast(start + (end - start) * t); -} - - -#endif //_TVG_MATH_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgPaint.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgPaint.cpp deleted file mode 100644 index 4db4831..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgPaint.cpp +++ /dev/null @@ -1,481 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgMath.h" -#include "tvgPaint.h" -#include "tvgShape.h" -#include "tvgPicture.h" -#include "tvgScene.h" -#include "tvgText.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -#define PAINT_METHOD(ret, METHOD) \ - switch (id) { \ - case TVG_CLASS_ID_SHAPE: ret = P((Shape*)paint)->METHOD; break; \ - case TVG_CLASS_ID_SCENE: ret = P((Scene*)paint)->METHOD; break; \ - case TVG_CLASS_ID_PICTURE: ret = P((Picture*)paint)->METHOD; break; \ - case TVG_CLASS_ID_TEXT: ret = P((Text*)paint)->METHOD; break; \ - default: ret = {}; \ - } - - - -static Result _compFastTrack(Paint* cmpTarget, const RenderTransform* pTransform, RenderTransform* rTransform, RenderRegion& viewport) -{ - /* Access Shape class by Paint is bad... but it's ok still it's an internal usage. */ - auto shape = static_cast(cmpTarget); - - //Rectangle Candidates? - const Point* pts; - auto ptsCnt = shape->pathCoords(&pts); - - //nothing to clip - if (ptsCnt == 0) return Result::InvalidArguments; - - if (ptsCnt != 4) return Result::InsufficientCondition; - - if (rTransform) rTransform->update(); - - //No rotation and no skewing - if (pTransform && (!mathRightAngle(&pTransform->m) || mathSkewed(&pTransform->m))) return Result::InsufficientCondition; - if (rTransform && (!mathRightAngle(&rTransform->m) || mathSkewed(&rTransform->m))) return Result::InsufficientCondition; - - //Perpendicular Rectangle? - auto pt1 = pts + 0; - auto pt2 = pts + 1; - auto pt3 = pts + 2; - auto pt4 = pts + 3; - - if ((mathEqual(pt1->x, pt2->x) && mathEqual(pt2->y, pt3->y) && mathEqual(pt3->x, pt4->x) && mathEqual(pt1->y, pt4->y)) || - (mathEqual(pt2->x, pt3->x) && mathEqual(pt1->y, pt2->y) && mathEqual(pt1->x, pt4->x) && mathEqual(pt3->y, pt4->y))) { - - auto v1 = *pt1; - auto v2 = *pt3; - - if (rTransform) { - mathMultiply(&v1, &rTransform->m); - mathMultiply(&v2, &rTransform->m); - } - - if (pTransform) { - mathMultiply(&v1, &pTransform->m); - mathMultiply(&v2, &pTransform->m); - } - - //sorting - if (v1.x > v2.x) { - auto tmp = v2.x; - v2.x = v1.x; - v1.x = tmp; - } - - if (v1.y > v2.y) { - auto tmp = v2.y; - v2.y = v1.y; - v1.y = tmp; - } - - viewport.x = static_cast(v1.x); - viewport.y = static_cast(v1.y); - viewport.w = static_cast(ceil(v2.x - viewport.x)); - viewport.h = static_cast(ceil(v2.y - viewport.y)); - - if (viewport.w < 0) viewport.w = 0; - if (viewport.h < 0) viewport.h = 0; - - return Result::Success; - } - return Result::InsufficientCondition; -} - - -RenderRegion Paint::Impl::bounds(RenderMethod* renderer) const -{ - RenderRegion ret; - PAINT_METHOD(ret, bounds(renderer)); - return ret; -} - - -Iterator* Paint::Impl::iterator() -{ - Iterator* ret; - PAINT_METHOD(ret, iterator()); - return ret; -} - - -Paint* Paint::Impl::duplicate() -{ - Paint* ret; - PAINT_METHOD(ret, duplicate()); - - //duplicate Transform - if (rTransform) { - ret->pImpl->rTransform = new RenderTransform(); - *ret->pImpl->rTransform = *rTransform; - ret->pImpl->renderFlag |= RenderUpdateFlag::Transform; - } - - ret->pImpl->opacity = opacity; - - if (compData) ret->pImpl->composite(ret, compData->target->duplicate(), compData->method); - - return ret; -} - - -bool Paint::Impl::rotate(float degree) -{ - if (rTransform) { - if (mathEqual(degree, rTransform->degree)) return true; - } else { - if (mathZero(degree)) return true; - rTransform = new RenderTransform(); - } - rTransform->degree = degree; - if (!rTransform->overriding) renderFlag |= RenderUpdateFlag::Transform; - - return true; -} - - -bool Paint::Impl::scale(float factor) -{ - if (rTransform) { - if (mathEqual(factor, rTransform->scale)) return true; - } else { - if (mathEqual(factor, 1.0f)) return true; - rTransform = new RenderTransform(); - } - rTransform->scale = factor; - if (!rTransform->overriding) renderFlag |= RenderUpdateFlag::Transform; - - return true; -} - - -bool Paint::Impl::translate(float x, float y) -{ - if (rTransform) { - if (mathEqual(x, rTransform->x) && mathEqual(y, rTransform->y)) return true; - } else { - if (mathZero(x) && mathZero(y)) return true; - rTransform = new RenderTransform(); - } - rTransform->x = x; - rTransform->y = y; - if (!rTransform->overriding) renderFlag |= RenderUpdateFlag::Transform; - - return true; -} - - -bool Paint::Impl::render(RenderMethod* renderer) -{ - Compositor* cmp = nullptr; - - /* Note: only ClipPath is processed in update() step. - Create a composition image. */ - if (compData && compData->method != CompositeMethod::ClipPath && !(compData->target->pImpl->ctxFlag & ContextFlag::FastTrack)) { - RenderRegion region; - PAINT_METHOD(region, bounds(renderer)); - - if (MASK_REGION_MERGING(compData->method)) region.add(P(compData->target)->bounds(renderer)); - if (region.w == 0 || region.h == 0) return true; - cmp = renderer->target(region, COMPOSITE_TO_COLORSPACE(renderer, compData->method)); - if (renderer->beginComposite(cmp, CompositeMethod::None, 255)) { - compData->target->pImpl->render(renderer); - } - } - - if (cmp) renderer->beginComposite(cmp, compData->method, compData->target->pImpl->opacity); - - renderer->blend(blendMethod); - - bool ret; - PAINT_METHOD(ret, render(renderer)); - - if (cmp) renderer->endComposite(cmp); - - return ret; -} - - -RenderData Paint::Impl::update(RenderMethod* renderer, const RenderTransform* pTransform, Array& clips, uint8_t opacity, RenderUpdateFlag pFlag, bool clipper) -{ - if (this->renderer != renderer) { - if (this->renderer) TVGERR("RENDERER", "paint's renderer has been changed!"); - renderer->ref(); - this->renderer = renderer; - } - - if (renderFlag & RenderUpdateFlag::Transform) { - if (!rTransform) return nullptr; - rTransform->update(); - } - - /* 1. Composition Pre Processing */ - RenderData trd = nullptr; //composite target render data - RenderRegion viewport; - Result compFastTrack = Result::InsufficientCondition; - bool childClipper = false; - - if (compData) { - auto target = compData->target; - auto method = compData->method; - target->pImpl->ctxFlag &= ~ContextFlag::FastTrack; //reset - - /* If the transformation has no rotational factors and the ClipPath/Alpha(InvAlpha)Masking involves a simple rectangle, - we can optimize by using the viewport instead of the regular ClipPath/AlphaMasking sequence for improved performance. */ - auto tryFastTrack = false; - if (target->identifier() == TVG_CLASS_ID_SHAPE) { - if (method == CompositeMethod::ClipPath) tryFastTrack = true; - else { - auto shape = static_cast(target); - uint8_t a; - shape->fillColor(nullptr, nullptr, nullptr, &a); - //no gradient fill & no compositions of the composition target. - if (!shape->fill() && !(PP(shape)->compData)) { - if (method == CompositeMethod::AlphaMask && a == 255 && PP(shape)->opacity == 255) tryFastTrack = true; - else if (method == CompositeMethod::InvAlphaMask && (a == 0 || PP(shape)->opacity == 0)) tryFastTrack = true; - } - } - if (tryFastTrack) { - RenderRegion viewport2; - if ((compFastTrack = _compFastTrack(target, pTransform, target->pImpl->rTransform, viewport2)) == Result::Success) { - viewport = renderer->viewport(); - viewport2.intersect(viewport); - renderer->viewport(viewport2); - target->pImpl->ctxFlag |= ContextFlag::FastTrack; - } - } - } - if (compFastTrack == Result::InsufficientCondition) { - childClipper = compData->method == CompositeMethod::ClipPath ? true : false; - trd = target->pImpl->update(renderer, pTransform, clips, 255, pFlag, childClipper); - if (childClipper) clips.push(trd); - } - } - - /* 2. Main Update */ - auto newFlag = static_cast(pFlag | renderFlag); - renderFlag = RenderUpdateFlag::None; - opacity = MULTIPLY(opacity, this->opacity); - - RenderData rd = nullptr; - RenderTransform outTransform(pTransform, rTransform); - PAINT_METHOD(rd, update(renderer, &outTransform, clips, opacity, newFlag, clipper)); - - /* 3. Composition Post Processing */ - if (compFastTrack == Result::Success) renderer->viewport(viewport); - else if (childClipper) clips.pop(); - - return rd; -} - - -bool Paint::Impl::bounds(float* x, float* y, float* w, float* h, bool transformed, bool stroking) -{ - Matrix* m = nullptr; - bool ret; - - //Case: No transformed, quick return! - if (!transformed || !(m = this->transform())) { - PAINT_METHOD(ret, bounds(x, y, w, h, stroking)); - return ret; - } - - //Case: Transformed - auto tx = 0.0f; - auto ty = 0.0f; - auto tw = 0.0f; - auto th = 0.0f; - - PAINT_METHOD(ret, bounds(&tx, &ty, &tw, &th, stroking)); - - //Get vertices - Point pt[4] = {{tx, ty}, {tx + tw, ty}, {tx + tw, ty + th}, {tx, ty + th}}; - - //New bounding box - auto x1 = FLT_MAX; - auto y1 = FLT_MAX; - auto x2 = -FLT_MAX; - auto y2 = -FLT_MAX; - - //Compute the AABB after transformation - for (int i = 0; i < 4; i++) { - mathMultiply(&pt[i], m); - - if (pt[i].x < x1) x1 = pt[i].x; - if (pt[i].x > x2) x2 = pt[i].x; - if (pt[i].y < y1) y1 = pt[i].y; - if (pt[i].y > y2) y2 = pt[i].y; - } - - if (x) *x = x1; - if (y) *y = y1; - if (w) *w = x2 - x1; - if (h) *h = y2 - y1; - - return ret; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -Paint :: Paint() : pImpl(new Impl(this)) -{ -} - - -Paint :: ~Paint() -{ - delete(pImpl); -} - - -Result Paint::rotate(float degree) noexcept -{ - if (pImpl->rotate(degree)) return Result::Success; - return Result::FailedAllocation; -} - - -Result Paint::scale(float factor) noexcept -{ - if (pImpl->scale(factor)) return Result::Success; - return Result::FailedAllocation; -} - - -Result Paint::translate(float x, float y) noexcept -{ - if (pImpl->translate(x, y)) return Result::Success; - return Result::FailedAllocation; -} - - -Result Paint::transform(const Matrix& m) noexcept -{ - if (pImpl->transform(m)) return Result::Success; - return Result::FailedAllocation; -} - - -Matrix Paint::transform() noexcept -{ - auto pTransform = pImpl->transform(); - if (pTransform) return *pTransform; - return {1, 0, 0, 0, 1, 0, 0, 0, 1}; -} - - -TVG_DEPRECATED Result Paint::bounds(float* x, float* y, float* w, float* h) const noexcept -{ - return this->bounds(x, y, w, h, false); -} - - -Result Paint::bounds(float* x, float* y, float* w, float* h, bool transform) const noexcept -{ - if (pImpl->bounds(x, y, w, h, transform, true)) return Result::Success; - return Result::InsufficientCondition; -} - - -Paint* Paint::duplicate() const noexcept -{ - return pImpl->duplicate(); -} - - -Result Paint::composite(std::unique_ptr target, CompositeMethod method) noexcept -{ - auto p = target.release(); - if (pImpl->composite(this, p, method)) return Result::Success; - delete(p); - return Result::InvalidArguments; -} - - -CompositeMethod Paint::composite(const Paint** target) const noexcept -{ - if (pImpl->compData) { - if (target) *target = pImpl->compData->target; - return pImpl->compData->method; - } else { - if (target) *target = nullptr; - return CompositeMethod::None; - } -} - - -Result Paint::opacity(uint8_t o) noexcept -{ - if (pImpl->opacity == o) return Result::Success; - - pImpl->opacity = o; - pImpl->renderFlag |= RenderUpdateFlag::Color; - - return Result::Success; -} - - -uint8_t Paint::opacity() const noexcept -{ - return pImpl->opacity; -} - - -uint32_t Paint::identifier() const noexcept -{ - return pImpl->id; -} - - -Result Paint::blend(BlendMethod method) const noexcept -{ - if (pImpl->blendMethod != method) { - pImpl->blendMethod = method; - pImpl->renderFlag |= RenderUpdateFlag::Blend; - } - - return Result::Success; -} - - -BlendMethod Paint::blend() const noexcept -{ - return pImpl->blendMethod; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgPaint.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgPaint.h deleted file mode 100644 index a3fbc07..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgPaint.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_PAINT_H_ -#define _TVG_PAINT_H_ - -#include "tvgRender.h" -#include "tvgMath.h" - -namespace tvg -{ - enum ContextFlag : uint8_t {Invalid = 0, FastTrack = 1}; - - struct Iterator - { - virtual ~Iterator() {} - virtual const Paint* next() = 0; - virtual uint32_t count() = 0; - virtual void begin() = 0; - }; - - struct Composite - { - Paint* target; - Paint* source; - CompositeMethod method; - }; - - struct Paint::Impl - { - Paint* paint = nullptr; - RenderTransform* rTransform = nullptr; - Composite* compData = nullptr; - RenderMethod* renderer = nullptr; - BlendMethod blendMethod = BlendMethod::Normal; //uint8_t - uint8_t renderFlag = RenderUpdateFlag::None; - uint8_t ctxFlag = ContextFlag::Invalid; - uint8_t id; - uint8_t opacity = 255; - uint8_t refCnt = 0; //reference count - - Impl(Paint* pnt) : paint(pnt) {} - - ~Impl() - { - if (compData) { - if (P(compData->target)->unref() == 0) delete(compData->target); - free(compData); - } - delete(rTransform); - if (renderer && (renderer->unref() == 0)) delete(renderer); - } - - uint8_t ref() - { - if (refCnt == 255) TVGERR("RENDERER", "Corrupted reference count!"); - return ++refCnt; - } - - uint8_t unref() - { - if (refCnt == 0) TVGERR("RENDERER", "Corrupted reference count!"); - return --refCnt; - } - - bool transform(const Matrix& m) - { - if (!rTransform) { - if (mathIdentity(&m)) return true; - rTransform = new RenderTransform(); - if (!rTransform) return false; - } - rTransform->override(m); - renderFlag |= RenderUpdateFlag::Transform; - - return true; - } - - Matrix* transform() - { - if (rTransform) { - rTransform->update(); - return &rTransform->m; - } - return nullptr; - } - - bool composite(Paint* source, Paint* target, CompositeMethod method) - { - //Invalid case - if ((!target && method != CompositeMethod::None) || (target && method == CompositeMethod::None)) return false; - - if (compData) { - P(compData->target)->unref(); - if ((compData->target != target) && P(compData->target)->refCnt == 0) { - delete(compData->target); - } - //Reset scenario - if (!target && method == CompositeMethod::None) { - free(compData); - compData = nullptr; - return true; - } - } else { - if (!target && method == CompositeMethod::None) return true; - compData = static_cast(calloc(1, sizeof(Composite))); - } - P(target)->ref(); - compData->target = target; - compData->source = source; - compData->method = method; - return true; - } - - RenderRegion bounds(RenderMethod* renderer) const; - Iterator* iterator(); - bool rotate(float degree); - bool scale(float factor); - bool translate(float x, float y); - bool bounds(float* x, float* y, float* w, float* h, bool transformed, bool stroking); - RenderData update(RenderMethod* renderer, const RenderTransform* pTransform, Array& clips, uint8_t opacity, RenderUpdateFlag pFlag, bool clipper = false); - bool render(RenderMethod* renderer); - Paint* duplicate(); - }; -} - -#endif //_TVG_PAINT_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgPicture.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgPicture.cpp deleted file mode 100644 index 3d7859d..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgPicture.cpp +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgPicture.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -RenderUpdateFlag Picture::Impl::load() -{ - if (loader) { - if (paint) { - loader->sync(); - } else { - paint = loader->paint(); - if (paint) { - if (w != loader->w || h != loader->h) { - if (!resizing) { - w = loader->w; - h = loader->h; - } - loader->resize(paint, w, h); - resizing = false; - } - return RenderUpdateFlag::None; - } - } - if (!surface) { - if ((surface = loader->bitmap())) { - return RenderUpdateFlag::Image; - } - } - } - return RenderUpdateFlag::None; -} - - -bool Picture::Impl::needComposition(uint8_t opacity) -{ - //In this case, paint(scene) would try composition itself. - if (opacity < 255) return false; - - //Composition test - const Paint* target; - auto method = picture->composite(&target); - if (!target || method == tvg::CompositeMethod::ClipPath) return false; - if (target->pImpl->opacity == 255 || target->pImpl->opacity == 0) return false; - - return true; -} - - -bool Picture::Impl::render(RenderMethod* renderer) -{ - bool ret = false; - if (surface) return renderer->renderImage(rd); - else if (paint) { - Compositor* cmp = nullptr; - if (needComp) { - cmp = renderer->target(bounds(renderer), renderer->colorSpace()); - renderer->beginComposite(cmp, CompositeMethod::None, 255); - } - ret = paint->pImpl->render(renderer); - if (cmp) renderer->endComposite(cmp); - } - return ret; -} - - -bool Picture::Impl::size(float w, float h) -{ - this->w = w; - this->h = h; - resizing = true; - return true; -} - - -RenderRegion Picture::Impl::bounds(RenderMethod* renderer) -{ - if (rd) return renderer->region(rd); - if (paint) return paint->pImpl->bounds(renderer); - return {0, 0, 0, 0}; -} - - -RenderTransform Picture::Impl::resizeTransform(const RenderTransform* pTransform) -{ - //Overriding Transformation by the desired image size - auto sx = w / loader->w; - auto sy = h / loader->h; - auto scale = sx < sy ? sx : sy; - - RenderTransform tmp; - tmp.m = {scale, 0, 0, 0, scale, 0, 0, 0, 1}; - - if (!pTransform) return tmp; - else return RenderTransform(pTransform, &tmp); -} - - -Result Picture::Impl::load(ImageLoader* loader) -{ - //Same resource has been loaded. - if (this->loader == loader) { - this->loader->sharing--; //make it sure the reference counting. - return Result::Success; - } else if (this->loader) { - LoaderMgr::retrieve(this->loader); - } - - this->loader = loader; - - if (!loader->read()) return Result::Unknown; - - this->w = loader->w; - this->h = loader->h; - - return Result::Success; -} - - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -Picture::Picture() : pImpl(new Impl(this)) -{ - Paint::pImpl->id = TVG_CLASS_ID_PICTURE; -} - - -Picture::~Picture() -{ - delete(pImpl); -} - - -unique_ptr Picture::gen() noexcept -{ - return unique_ptr(new Picture); -} - - -uint32_t Picture::identifier() noexcept -{ - return TVG_CLASS_ID_PICTURE; -} - - -Result Picture::load(const std::string& path) noexcept -{ - if (path.empty()) return Result::InvalidArguments; - - return pImpl->load(path); -} - - -Result Picture::load(const char* data, uint32_t size, const string& mimeType, bool copy) noexcept -{ - if (!data || size <= 0) return Result::InvalidArguments; - - return pImpl->load(data, size, mimeType, copy); -} - - -TVG_DEPRECATED Result Picture::load(const char* data, uint32_t size, bool copy) noexcept -{ - return load(data, size, "", copy); -} - - -Result Picture::load(uint32_t* data, uint32_t w, uint32_t h, bool copy) noexcept -{ - if (!data || w <= 0 || h <= 0) return Result::InvalidArguments; - - return pImpl->load(data, w, h, copy); -} - - -Result Picture::size(float w, float h) noexcept -{ - if (pImpl->size(w, h)) return Result::Success; - return Result::InsufficientCondition; -} - - -Result Picture::size(float* w, float* h) const noexcept -{ - if (!pImpl->loader) return Result::InsufficientCondition; - if (w) *w = pImpl->w; - if (h) *h = pImpl->h; - return Result::Success; -} - - -Result Picture::mesh(const Polygon* triangles, uint32_t triangleCnt) noexcept -{ - if (!triangles && triangleCnt > 0) return Result::InvalidArguments; - if (triangles && triangleCnt == 0) return Result::InvalidArguments; - - pImpl->mesh(triangles, triangleCnt); - return Result::Success; -} - - -uint32_t Picture::mesh(const Polygon** triangles) const noexcept -{ - if (triangles) *triangles = pImpl->rm.triangles; - return pImpl->rm.triangleCnt; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgPicture.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgPicture.h deleted file mode 100644 index 7c3ec54..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgPicture.h +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_PICTURE_H_ -#define _TVG_PICTURE_H_ - -#include -#include "tvgPaint.h" -#include "tvgLoader.h" - - -struct PictureIterator : Iterator -{ - Paint* paint = nullptr; - Paint* ptr = nullptr; - - PictureIterator(Paint* p) : paint(p) {} - - const Paint* next() override - { - if (!ptr) ptr = paint; - else ptr = nullptr; - return ptr; - } - - uint32_t count() override - { - if (paint) return 1; - else return 0; - } - - void begin() override - { - ptr = nullptr; - } -}; - - -struct Picture::Impl -{ - ImageLoader* loader = nullptr; - - Paint* paint = nullptr; //vector picture uses - Surface* surface = nullptr; //bitmap picture uses - RenderData rd = nullptr; //engine data - float w = 0, h = 0; - RenderMesh rm; //mesh data - Picture* picture = nullptr; - bool resizing = false; - bool needComp = false; //need composition - - RenderTransform resizeTransform(const RenderTransform* pTransform); - bool needComposition(uint8_t opacity); - bool render(RenderMethod* renderer); - bool size(float w, float h); - RenderRegion bounds(RenderMethod* renderer); - Result load(ImageLoader* ploader); - - Impl(Picture* p) : picture(p) - { - } - - ~Impl() - { - LoaderMgr::retrieve(loader); - if (surface) { - if (auto renderer = PP(picture)->renderer) { - renderer->dispose(rd); - } - } - delete(paint); - } - - RenderData update(RenderMethod* renderer, const RenderTransform* pTransform, Array& clips, uint8_t opacity, RenderUpdateFlag pFlag, bool clipper) - { - auto flag = load(); - - if (surface) { - auto transform = resizeTransform(pTransform); - rd = renderer->prepare(surface, &rm, rd, &transform, clips, opacity, static_cast(pFlag | flag)); - } else if (paint) { - if (resizing) { - loader->resize(paint, w, h); - resizing = false; - } - needComp = needComposition(opacity) ? true : false; - rd = paint->pImpl->update(renderer, pTransform, clips, opacity, static_cast(pFlag | flag), clipper); - } - return rd; - } - - bool bounds(float* x, float* y, float* w, float* h, bool stroking) - { - if (rm.triangleCnt > 0) { - auto triangles = rm.triangles; - auto min = triangles[0].vertex[0].pt; - auto max = triangles[0].vertex[0].pt; - - for (uint32_t i = 0; i < rm.triangleCnt; ++i) { - if (triangles[i].vertex[0].pt.x < min.x) min.x = triangles[i].vertex[0].pt.x; - else if (triangles[i].vertex[0].pt.x > max.x) max.x = triangles[i].vertex[0].pt.x; - if (triangles[i].vertex[0].pt.y < min.y) min.y = triangles[i].vertex[0].pt.y; - else if (triangles[i].vertex[0].pt.y > max.y) max.y = triangles[i].vertex[0].pt.y; - - if (triangles[i].vertex[1].pt.x < min.x) min.x = triangles[i].vertex[1].pt.x; - else if (triangles[i].vertex[1].pt.x > max.x) max.x = triangles[i].vertex[1].pt.x; - if (triangles[i].vertex[1].pt.y < min.y) min.y = triangles[i].vertex[1].pt.y; - else if (triangles[i].vertex[1].pt.y > max.y) max.y = triangles[i].vertex[1].pt.y; - - if (triangles[i].vertex[2].pt.x < min.x) min.x = triangles[i].vertex[2].pt.x; - else if (triangles[i].vertex[2].pt.x > max.x) max.x = triangles[i].vertex[2].pt.x; - if (triangles[i].vertex[2].pt.y < min.y) min.y = triangles[i].vertex[2].pt.y; - else if (triangles[i].vertex[2].pt.y > max.y) max.y = triangles[i].vertex[2].pt.y; - } - if (x) *x = min.x; - if (y) *y = min.y; - if (w) *w = max.x - min.x; - if (h) *h = max.y - min.y; - } else { - if (x) *x = 0; - if (y) *y = 0; - if (w) *w = this->w; - if (h) *h = this->h; - } - return true; - } - - Result load(const string& path) - { - if (paint || surface) return Result::InsufficientCondition; - - bool invalid; //Invalid Path - auto loader = static_cast(LoaderMgr::loader(path, &invalid)); - if (!loader) { - if (invalid) return Result::InvalidArguments; - return Result::NonSupport; - } - return load(loader); - } - - Result load(const char* data, uint32_t size, const string& mimeType, bool copy) - { - if (paint || surface) return Result::InsufficientCondition; - auto loader = static_cast(LoaderMgr::loader(data, size, mimeType, copy)); - if (!loader) return Result::NonSupport; - return load(loader); - } - - Result load(uint32_t* data, uint32_t w, uint32_t h, bool copy) - { - if (paint || surface) return Result::InsufficientCondition; - - auto loader = static_cast(LoaderMgr::loader(data, w, h, copy)); - if (!loader) return Result::FailedAllocation; - - return load(loader); - } - - void mesh(const Polygon* triangles, const uint32_t triangleCnt) - { - if (triangles && triangleCnt > 0) { - this->rm.triangleCnt = triangleCnt; - this->rm.triangles = (Polygon*)malloc(sizeof(Polygon) * triangleCnt); - memcpy(this->rm.triangles, triangles, sizeof(Polygon) * triangleCnt); - } else { - free(this->rm.triangles); - this->rm.triangles = nullptr; - this->rm.triangleCnt = 0; - } - } - - Paint* duplicate() - { - load(); - - auto ret = Picture::gen().release(); - auto dup = ret->pImpl; - - if (paint) dup->paint = paint->duplicate(); - - if (loader) { - dup->loader = loader; - ++dup->loader->sharing; - } - - dup->surface = surface; - dup->w = w; - dup->h = h; - dup->resizing = resizing; - - if (rm.triangleCnt > 0) { - dup->rm.triangleCnt = rm.triangleCnt; - dup->rm.triangles = (Polygon*)malloc(sizeof(Polygon) * rm.triangleCnt); - memcpy(dup->rm.triangles, rm.triangles, sizeof(Polygon) * rm.triangleCnt); - } - - return ret; - } - - Iterator* iterator() - { - load(); - return new PictureIterator(paint); - } - - uint32_t* data(uint32_t* w, uint32_t* h) - { - //Try it, If not loaded yet. - load(); - - if (loader) { - if (w) *w = static_cast(loader->w); - if (h) *h = static_cast(loader->h); - } else { - if (w) *w = 0; - if (h) *h = 0; - } - if (surface) return surface->buf32; - else return nullptr; - } - - RenderUpdateFlag load(); -}; - -#endif //_TVG_PICTURE_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgRawLoader.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgRawLoader.cpp deleted file mode 100644 index 2274141..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgRawLoader.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include -#include -#include "tvgLoader.h" -#include "tvgRawLoader.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -RawLoader::RawLoader() : ImageLoader(FileType::Raw) -{ -} - - -RawLoader::~RawLoader() -{ - if (copy) free(surface.buf32); -} - - -bool RawLoader::open(const uint32_t* data, uint32_t w, uint32_t h, bool copy) -{ - if (!LoadModule::read()) return true; - - if (!data || w == 0 || h == 0) return false; - - this->w = (float)w; - this->h = (float)h; - this->copy = copy; - - if (copy) { - surface.buf32 = (uint32_t*)malloc(sizeof(uint32_t) * w * h); - if (!surface.buf32) return false; - memcpy((void*)surface.buf32, data, sizeof(uint32_t) * w * h); - } - else surface.buf32 = const_cast(data); - - //setup the surface - surface.stride = w; - surface.w = w; - surface.h = h; - surface.cs = ColorSpace::ARGB8888; - surface.channelSize = sizeof(uint32_t); - surface.premultiplied = true; - - return true; -} - - -bool RawLoader::read() -{ - LoadModule::read(); - - return true; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgRawLoader.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgRawLoader.h deleted file mode 100644 index 492fd53..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgRawLoader.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_RAW_LOADER_H_ -#define _TVG_RAW_LOADER_H_ - -class RawLoader : public ImageLoader -{ -public: - bool copy = false; - - RawLoader(); - ~RawLoader(); - - using LoadModule::open; - bool open(const uint32_t* data, uint32_t w, uint32_t h, bool copy); - bool read() override; -}; - - -#endif //_TVG_RAW_LOADER_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgRender.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgRender.cpp deleted file mode 100644 index dad20e8..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgRender.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgMath.h" -#include "tvgRender.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -void RenderTransform::override(const Matrix& m) -{ - this->m = m; - overriding = true; -} - - -void RenderTransform::update() -{ - if (overriding) return; - - mathIdentity(&m); - - mathScale(&m, scale, scale); - - if (!mathZero(degree)) mathRotate(&m, degree); - - mathTranslate(&m, x, y); -} - - -RenderTransform::RenderTransform(const RenderTransform* lhs, const RenderTransform* rhs) -{ - if (lhs && rhs) m = mathMultiply(&lhs->m, &rhs->m); - else if (lhs) m = lhs->m; - else if (rhs) m = rhs->m; - else mathIdentity(&m); -} - - -void RenderRegion::intersect(const RenderRegion& rhs) -{ - auto x1 = x + w; - auto y1 = y + h; - auto x2 = rhs.x + rhs.w; - auto y2 = rhs.y + rhs.h; - - x = (x > rhs.x) ? x : rhs.x; - y = (y > rhs.y) ? y : rhs.y; - w = ((x1 < x2) ? x1 : x2) - x; - h = ((y1 < y2) ? y1 : y2) - y; - - if (w < 0) w = 0; - if (h < 0) h = 0; -} - - -void RenderRegion::add(const RenderRegion& rhs) -{ - if (rhs.x < x) { - w += (x - rhs.x); - x = rhs.x; - } - if (rhs.y < y) { - h += (y - rhs.y); - y = rhs.y; - } - if (rhs.x + rhs.w > x + w) w = (rhs.x + rhs.w) - x; - if (rhs.y + rhs.h > y + h) h = (rhs.y + rhs.h) - y; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgRender.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgRender.h deleted file mode 100644 index 8467a91..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgRender.h +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_RENDER_H_ -#define _TVG_RENDER_H_ - -#include "tvgCommon.h" -#include "tvgArray.h" -#include "tvgLock.h" - -namespace tvg -{ - -using RenderData = void*; -using pixel_t = uint32_t; - -enum RenderUpdateFlag : uint8_t {None = 0, Path = 1, Color = 2, Gradient = 4, Stroke = 8, Transform = 16, Image = 32, GradientStroke = 64, Blend = 128, All = 255}; - -struct Surface; - -enum ColorSpace -{ - ABGR8888 = 0, //The channels are joined in the order: alpha, blue, green, red. Colors are alpha-premultiplied. - ARGB8888, //The channels are joined in the order: alpha, red, green, blue. Colors are alpha-premultiplied. - ABGR8888S, //The channels are joined in the order: alpha, blue, green, red. Colors are un-alpha-premultiplied. - ARGB8888S, //The channels are joined in the order: alpha, red, green, blue. Colors are un-alpha-premultiplied. - Grayscale8, //One single channel data. - Unsupported //TODO: Change to the default, At the moment, we put it in the last to align with SwCanvas::Colorspace. -}; - -struct Surface -{ - union { - pixel_t* data = nullptr; //system based data pointer - uint32_t* buf32; //for explicit 32bits channels - uint8_t* buf8; //for explicit 8bits grayscale - }; - Key key; //a reserved lock for the thread safety - uint32_t stride = 0; - uint32_t w = 0, h = 0; - ColorSpace cs = ColorSpace::Unsupported; - uint8_t channelSize = 0; - bool premultiplied = false; //Alpha-premultiplied - - Surface() - { - } - - Surface(const Surface* rhs) - { - data = rhs->data; - stride = rhs->stride; - w = rhs->w; - h = rhs->h; - cs = rhs->cs; - channelSize = rhs->channelSize; - premultiplied = rhs->premultiplied; - } - - -}; - -struct Compositor -{ - CompositeMethod method; - uint8_t opacity; -}; - -struct RenderMesh -{ - Polygon* triangles = nullptr; - uint32_t triangleCnt = 0; - - ~RenderMesh() - { - free(triangles); - } -}; - -struct RenderRegion -{ - int32_t x, y, w, h; - - void intersect(const RenderRegion& rhs); - void add(const RenderRegion& rhs); - - bool operator==(const RenderRegion& rhs) - { - if (x == rhs.x && y == rhs.y && w == rhs.w && h == rhs.h) return true; - return false; - } -}; - -struct RenderTransform -{ - Matrix m; //3x3 Matrix Elements - float x = 0.0f; - float y = 0.0f; - float degree = 0.0f; //rotation degree - float scale = 1.0f; //scale factor - bool overriding = false; //user transform? - - void update(); - void override(const Matrix& m); - - RenderTransform() {} - RenderTransform(const RenderTransform* lhs, const RenderTransform* rhs); -}; - -struct RenderStroke -{ - float width = 0.0f; - uint8_t color[4] = {0, 0, 0, 0}; - Fill *fill = nullptr; - float* dashPattern = nullptr; - uint32_t dashCnt = 0; - float dashOffset = 0.0f; - StrokeCap cap = StrokeCap::Square; - StrokeJoin join = StrokeJoin::Bevel; - float miterlimit = 4.0f; - bool strokeFirst = false; - - struct { - float begin = 0.0f; - float end = 1.0f; - bool individual = false; - } trim; - - ~RenderStroke() - { - free(dashPattern); - delete(fill); - } -}; - -struct RenderShape -{ - struct - { - Array cmds; - Array pts; - } path; - - Fill *fill = nullptr; - RenderStroke *stroke = nullptr; - uint8_t color[4] = {0, 0, 0, 0}; //r, g, b, a - FillRule rule = FillRule::Winding; - - ~RenderShape() - { - delete(fill); - delete(stroke); - } - - void fillColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a) const - { - if (r) *r = color[0]; - if (g) *g = color[1]; - if (b) *b = color[2]; - if (a) *a = color[3]; - } - - float strokeWidth() const - { - if (!stroke) return 0; - return stroke->width; - } - - bool strokeTrim() const - { - if (!stroke) return false; - if (stroke->trim.begin == 0.0f && stroke->trim.end == 1.0f) return false; - if (stroke->trim.begin == 1.0f && stroke->trim.end == 0.0f) return false; - return true; - } - - bool strokeColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a) const - { - if (!stroke) return false; - - if (r) *r = stroke->color[0]; - if (g) *g = stroke->color[1]; - if (b) *b = stroke->color[2]; - if (a) *a = stroke->color[3]; - - return true; - } - - const Fill* strokeFill() const - { - if (!stroke) return nullptr; - return stroke->fill; - } - - uint32_t strokeDash(const float** dashPattern, float* offset) const - { - if (!stroke) return 0; - if (dashPattern) *dashPattern = stroke->dashPattern; - if (offset) *offset = stroke->dashOffset; - return stroke->dashCnt; - } - - StrokeCap strokeCap() const - { - if (!stroke) return StrokeCap::Square; - return stroke->cap; - } - - StrokeJoin strokeJoin() const - { - if (!stroke) return StrokeJoin::Bevel; - return stroke->join; - } - - float strokeMiterlimit() const - { - if (!stroke) return 4.0f; - - return stroke->miterlimit;; - } -}; - -class RenderMethod -{ -private: - uint32_t refCnt = 0; //reference count - Key key; - -public: - uint32_t ref() - { - ScopedLock lock(key); - return (++refCnt); - } - - uint32_t unref() - { - ScopedLock lock(key); - return (--refCnt); - } - - virtual ~RenderMethod() {} - virtual RenderData prepare(const RenderShape& rshape, RenderData data, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag flags, bool clipper) = 0; - virtual RenderData prepare(const Array& scene, RenderData data, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag flags) = 0; - virtual RenderData prepare(Surface* surface, const RenderMesh* mesh, RenderData data, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag flags) = 0; - virtual bool preRender() = 0; - virtual bool renderShape(RenderData data) = 0; - virtual bool renderImage(RenderData data) = 0; - virtual bool postRender() = 0; - virtual void dispose(RenderData data) = 0; - virtual RenderRegion region(RenderData data) = 0; - virtual RenderRegion viewport() = 0; - virtual bool viewport(const RenderRegion& vp) = 0; - virtual bool blend(BlendMethod method) = 0; - virtual ColorSpace colorSpace() = 0; - virtual const Surface* mainSurface() = 0; - - virtual bool clear() = 0; - virtual bool sync() = 0; - - virtual Compositor* target(const RenderRegion& region, ColorSpace cs) = 0; - virtual bool beginComposite(Compositor* cmp, CompositeMethod method, uint8_t opacity) = 0; - virtual bool endComposite(Compositor* cmp) = 0; -}; - -static inline bool MASK_REGION_MERGING(CompositeMethod method) -{ - switch(method) { - case CompositeMethod::AlphaMask: - case CompositeMethod::InvAlphaMask: - case CompositeMethod::LumaMask: - case CompositeMethod::InvLumaMask: - case CompositeMethod::SubtractMask: - case CompositeMethod::IntersectMask: - return false; - //these might expand the rendering region - case CompositeMethod::AddMask: - case CompositeMethod::DifferenceMask: - return true; - default: - TVGERR("RENDERER", "Unsupported Composite Method! = %d", (int)method); - return false; - } -} - -static inline uint8_t CHANNEL_SIZE(ColorSpace cs) -{ - switch(cs) { - case ColorSpace::ABGR8888: - case ColorSpace::ABGR8888S: - case ColorSpace::ARGB8888: - case ColorSpace::ARGB8888S: - return sizeof(uint32_t); - case ColorSpace::Grayscale8: - return sizeof(uint8_t); - case ColorSpace::Unsupported: - default: - TVGERR("RENDERER", "Unsupported Channel Size! = %d", (int)cs); - return 0; - } -} - -static inline ColorSpace COMPOSITE_TO_COLORSPACE(RenderMethod* renderer, CompositeMethod method) -{ - switch(method) { - case CompositeMethod::AlphaMask: - case CompositeMethod::InvAlphaMask: - case CompositeMethod::AddMask: - case CompositeMethod::DifferenceMask: - case CompositeMethod::SubtractMask: - case CompositeMethod::IntersectMask: - return ColorSpace::Grayscale8; - //TODO: Optimize Luma/InvLuma colorspace to Grayscale8 - case CompositeMethod::LumaMask: - case CompositeMethod::InvLumaMask: - return renderer->colorSpace(); - default: - TVGERR("RENDERER", "Unsupported Composite Size! = %d", (int)method); - return ColorSpace::Unsupported; - } -} - -static inline uint8_t MULTIPLY(uint8_t c, uint8_t a) -{ - return (((c) * (a) + 0xff) >> 8); -} - - -} - -#endif //_TVG_RENDER_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSaveModule.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSaveModule.h deleted file mode 100644 index abfd538..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSaveModule.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SAVE_MODULE_H_ -#define _TVG_SAVE_MODULE_H_ - -#include "tvgIteratorAccessor.h" - -namespace tvg -{ - -class SaveModule -{ -public: - virtual ~SaveModule() {} - - virtual bool save(Paint* paint, const string& path, bool compress) = 0; - virtual bool save(Animation* animation, Paint* bg, const string& path, uint32_t quality, uint32_t fps) = 0; - virtual bool close() = 0; -}; - -} - -#endif //_TVG_SAVE_MODULE_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSaver.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSaver.cpp deleted file mode 100644 index f2a22ec..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSaver.cpp +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgCommon.h" -#include "tvgSaveModule.h" -#include "tvgPaint.h" - -#ifdef THORVG_TVG_SAVER_SUPPORT - #include "tvgTvgSaver.h" -#endif -#ifdef THORVG_GIF_SAVER_SUPPORT - #include "tvgGifSaver.h" -#endif - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -struct Saver::Impl -{ - SaveModule* saveModule = nullptr; - Paint* bg = nullptr; - - ~Impl() - { - delete(saveModule); - delete(bg); - } -}; - - -static SaveModule* _find(FileType type) -{ - switch(type) { - case FileType::Tvg: { -#ifdef THORVG_TVG_SAVER_SUPPORT - return new TvgSaver; -#endif - break; - } - case FileType::Gif: { -#ifdef THORVG_GIF_SAVER_SUPPORT - return new GifSaver; -#endif - break; - } - default: { - break; - } - } - -#ifdef THORVG_LOG_ENABLED - const char *format; - switch(type) { - case FileType::Tvg: { - format = "TVG"; - break; - } - case FileType::Gif: { - format = "GIF"; - break; - } - default: { - format = "???"; - break; - } - } - TVGLOG("RENDERER", "%s format is not supported", format); -#endif - return nullptr; -} - - -static SaveModule* _find(const string& path) -{ - auto ext = path.substr(path.find_last_of(".") + 1); - if (!ext.compare("tvg")) { - return _find(FileType::Tvg); - } else if (!ext.compare("gif")) { - return _find(FileType::Gif); - } - return nullptr; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -Saver::Saver() : pImpl(new Impl()) -{ -} - - -Saver::~Saver() -{ - delete(pImpl); -} - - -Result Saver::save(std::unique_ptr paint, const string& path, bool compress) noexcept -{ - auto p = paint.release(); - if (!p) return Result::MemoryCorruption; - - //Already on saving another resource. - if (pImpl->saveModule) { - if (P(p)->refCnt == 0) delete(p); - return Result::InsufficientCondition; - } - - if (auto saveModule = _find(path)) { - if (saveModule->save(p, path, compress)) { - pImpl->saveModule = saveModule; - return Result::Success; - } else { - if (P(p)->refCnt == 0) delete(p); - delete(saveModule); - return Result::Unknown; - } - } - if (P(p)->refCnt == 0) delete(p); - return Result::NonSupport; -} - - -Result Saver::background(unique_ptr paint) noexcept -{ - delete(pImpl->bg); - pImpl->bg = paint.release(); - - return Result::Success; -} - - -Result Saver::save(unique_ptr animation, const string& path, uint32_t quality, uint32_t fps) noexcept -{ - auto a = animation.release(); - if (!a) return Result::MemoryCorruption; - - //animation holds the picture, it must be 1 at the bottom. - auto remove = PP(a->picture())->refCnt <= 1 ? true : false; - - if (mathZero(a->totalFrame())) { - if (remove) delete(a); - return Result::InsufficientCondition; - } - - //Already on saving another resource. - if (pImpl->saveModule) { - if (remove) delete(a); - return Result::InsufficientCondition; - } - - if (auto saveModule = _find(path)) { - if (saveModule->save(a, pImpl->bg, path, quality, fps)) { - pImpl->saveModule = saveModule; - return Result::Success; - } else { - if (remove) delete(a); - delete(saveModule); - return Result::Unknown; - } - } - if (remove) delete(a); - return Result::NonSupport; -} - - -Result Saver::sync() noexcept -{ - if (!pImpl->saveModule) return Result::InsufficientCondition; - pImpl->saveModule->close(); - delete(pImpl->saveModule); - pImpl->saveModule = nullptr; - - return Result::Success; -} - - -unique_ptr Saver::gen() noexcept -{ - return unique_ptr(new Saver); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgScene.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgScene.cpp deleted file mode 100644 index cd911f7..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgScene.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgScene.h" - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -Scene::Scene() : pImpl(new Impl(this)) -{ - Paint::pImpl->id = TVG_CLASS_ID_SCENE; -} - - -Scene::~Scene() -{ - delete(pImpl); -} - - -unique_ptr Scene::gen() noexcept -{ - return unique_ptr(new Scene); -} - - -uint32_t Scene::identifier() noexcept -{ - return TVG_CLASS_ID_SCENE; -} - - -Result Scene::push(unique_ptr paint) noexcept -{ - auto p = paint.release(); - if (!p) return Result::MemoryCorruption; - PP(p)->ref(); - pImpl->paints.push_back(p); - - return Result::Success; -} - - -Result Scene::reserve(TVG_UNUSED uint32_t size) noexcept -{ - return Result::NonSupport; -} - - -Result Scene::clear(bool free) noexcept -{ - pImpl->clear(free); - - return Result::Success; -} - - -list& Scene::paints() noexcept -{ - return pImpl->paints; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgScene.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgScene.h deleted file mode 100644 index 8347d92..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgScene.h +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SCENE_H_ -#define _TVG_SCENE_H_ - -#include -#include "tvgPaint.h" - - -struct SceneIterator : Iterator -{ - list* paints; - list::iterator itr; - - SceneIterator(list* p) : paints(p) - { - begin(); - } - - const Paint* next() override - { - if (itr == paints->end()) return nullptr; - auto paint = *itr; - ++itr; - return paint; - } - - uint32_t count() override - { - return paints->size(); - } - - void begin() override - { - itr = paints->begin(); - } -}; - -struct Scene::Impl -{ - list paints; - RenderData rd = nullptr; - Scene* scene = nullptr; - uint8_t opacity; //for composition - bool needComp = false; //composite or not - - Impl(Scene* s) : scene(s) - { - } - - ~Impl() - { - for (auto paint : paints) { - if (P(paint)->unref() == 0) delete(paint); - } - - if (auto renderer = PP(scene)->renderer) { - renderer->dispose(rd); - } - } - - bool needComposition(uint8_t opacity) - { - if (opacity == 0 || paints.empty()) return false; - - //Masking may require composition (even if opacity == 255) - auto compMethod = scene->composite(nullptr); - if (compMethod != CompositeMethod::None && compMethod != CompositeMethod::ClipPath) return true; - - //Blending may require composition (even if opacity == 255) - if (scene->blend() != BlendMethod::Normal) return true; - - //Half translucent requires intermediate composition. - if (opacity == 255) return false; - - //If scene has several children or only scene, it may require composition. - //OPTIMIZE: the bitmap type of the picture would not need the composition. - //OPTIMIZE: a single paint of a scene would not need the composition. - if (paints.size() == 1 && paints.front()->identifier() == TVG_CLASS_ID_SHAPE) return false; - - return true; - } - - RenderData update(RenderMethod* renderer, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag flag, bool clipper) - { - if ((needComp = needComposition(opacity))) { - /* Overriding opacity value. If this scene is half-translucent, - It must do intermediate composition with that opacity value. */ - this->opacity = opacity; - opacity = 255; - } - - if (clipper) { - Array rds(paints.size()); - for (auto paint : paints) { - rds.push(paint->pImpl->update(renderer, transform, clips, opacity, flag, true)); - } - rd = renderer->prepare(rds, rd, transform, clips, opacity, flag); - return rd; - } else { - for (auto paint : paints) { - paint->pImpl->update(renderer, transform, clips, opacity, flag, false); - } - return nullptr; - } - } - - bool render(RenderMethod* renderer) - { - Compositor* cmp = nullptr; - auto ret = true; - - if (needComp) { - cmp = renderer->target(bounds(renderer), renderer->colorSpace()); - renderer->beginComposite(cmp, CompositeMethod::None, opacity); - } - - for (auto paint : paints) { - ret &= paint->pImpl->render(renderer); - } - - if (cmp) renderer->endComposite(cmp); - - return ret; - } - - RenderRegion bounds(RenderMethod* renderer) const - { - if (paints.empty()) return {0, 0, 0, 0}; - - int32_t x1 = INT32_MAX; - int32_t y1 = INT32_MAX; - int32_t x2 = 0; - int32_t y2 = 0; - - for (auto paint : paints) { - auto region = paint->pImpl->bounds(renderer); - - //Merge regions - if (region.x < x1) x1 = region.x; - if (x2 < region.x + region.w) x2 = (region.x + region.w); - if (region.y < y1) y1 = region.y; - if (y2 < region.y + region.h) y2 = (region.y + region.h); - } - - return {x1, y1, (x2 - x1), (y2 - y1)}; - } - - bool bounds(float* px, float* py, float* pw, float* ph, bool stroking) - { - if (paints.empty()) return false; - - auto x1 = FLT_MAX; - auto y1 = FLT_MAX; - auto x2 = -FLT_MAX; - auto y2 = -FLT_MAX; - - for (auto paint : paints) { - auto x = FLT_MAX; - auto y = FLT_MAX; - auto w = 0.0f; - auto h = 0.0f; - - if (!P(paint)->bounds(&x, &y, &w, &h, true, stroking)) continue; - - //Merge regions - if (x < x1) x1 = x; - if (x2 < x + w) x2 = (x + w); - if (y < y1) y1 = y; - if (y2 < y + h) y2 = (y + h); - } - - if (px) *px = x1; - if (py) *py = y1; - if (pw) *pw = (x2 - x1); - if (ph) *ph = (y2 - y1); - - return true; - } - - Paint* duplicate() - { - auto ret = Scene::gen().release(); - auto dup = ret->pImpl; - - for (auto paint : paints) { - auto cdup = paint->duplicate(); - P(cdup)->ref(); - dup->paints.push_back(cdup); - } - - return ret; - } - - void clear(bool free) - { - for (auto paint : paints) { - if (P(paint)->unref() == 0 && free) delete(paint); - } - paints.clear(); - } - - Iterator* iterator() - { - return new SceneIterator(&paints); - } -}; - -#endif //_TVG_SCENE_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgShape.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgShape.cpp deleted file mode 100644 index fcf77e2..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgShape.cpp +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgMath.h" -#include "tvgShape.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -Shape :: Shape() : pImpl(new Impl(this)) -{ - Paint::pImpl->id = TVG_CLASS_ID_SHAPE; -} - - -Shape :: ~Shape() -{ - delete(pImpl); -} - - -unique_ptr Shape::gen() noexcept -{ - return unique_ptr(new Shape); -} - - -uint32_t Shape::identifier() noexcept -{ - return TVG_CLASS_ID_SHAPE; -} - - -Result Shape::reset() noexcept -{ - pImpl->rs.path.cmds.clear(); - pImpl->rs.path.pts.clear(); - - pImpl->flag |= RenderUpdateFlag::Path; - - return Result::Success; -} - - -uint32_t Shape::pathCommands(const PathCommand** cmds) const noexcept -{ - if (cmds) *cmds = pImpl->rs.path.cmds.data; - return pImpl->rs.path.cmds.count; -} - - -uint32_t Shape::pathCoords(const Point** pts) const noexcept -{ - if (pts) *pts = pImpl->rs.path.pts.data; - return pImpl->rs.path.pts.count; -} - - -Result Shape::appendPath(const PathCommand *cmds, uint32_t cmdCnt, const Point* pts, uint32_t ptsCnt) noexcept -{ - if (cmdCnt == 0 || ptsCnt == 0 || !cmds || !pts) return Result::InvalidArguments; - - pImpl->grow(cmdCnt, ptsCnt); - pImpl->append(cmds, cmdCnt, pts, ptsCnt); - - return Result::Success; -} - - -Result Shape::moveTo(float x, float y) noexcept -{ - pImpl->moveTo(x, y); - - return Result::Success; -} - - -Result Shape::lineTo(float x, float y) noexcept -{ - pImpl->lineTo(x, y); - - return Result::Success; -} - - -Result Shape::cubicTo(float cx1, float cy1, float cx2, float cy2, float x, float y) noexcept -{ - pImpl->cubicTo(cx1, cy1, cx2, cy2, x, y); - - return Result::Success; -} - - -Result Shape::close() noexcept -{ - pImpl->close(); - - return Result::Success; -} - - -Result Shape::appendCircle(float cx, float cy, float rx, float ry) noexcept -{ - auto rxKappa = rx * PATH_KAPPA; - auto ryKappa = ry * PATH_KAPPA; - - pImpl->grow(6, 13); - pImpl->moveTo(cx + rx, cy); - pImpl->cubicTo(cx + rx, cy + ryKappa, cx + rxKappa, cy + ry, cx, cy + ry); - pImpl->cubicTo(cx - rxKappa, cy + ry, cx - rx, cy + ryKappa, cx - rx, cy); - pImpl->cubicTo(cx - rx, cy - ryKappa, cx - rxKappa, cy - ry, cx, cy - ry); - pImpl->cubicTo(cx + rxKappa, cy - ry, cx + rx, cy - ryKappa, cx + rx, cy); - pImpl->close(); - - return Result::Success; -} - -Result Shape::appendArc(float cx, float cy, float radius, float startAngle, float sweep, bool pie) noexcept -{ - //just circle - if (sweep >= 360.0f || sweep <= -360.0f) return appendCircle(cx, cy, radius, radius); - - const float arcPrecision = 1e-5f; - startAngle = mathDeg2Rad(startAngle); - sweep = mathDeg2Rad(sweep); - - auto nCurves = static_cast(fabsf(sweep / MATH_PI2)); - if (fabsf(sweep / MATH_PI2) - nCurves > arcPrecision) ++nCurves; - auto sweepSign = (sweep < 0 ? -1 : 1); - auto fract = fmodf(sweep, MATH_PI2); - fract = (fabsf(fract) < arcPrecision) ? MATH_PI2 * sweepSign : fract; - - //Start from here - Point start = {radius * cosf(startAngle), radius * sinf(startAngle)}; - - if (pie) { - pImpl->moveTo(cx, cy); - pImpl->lineTo(start.x + cx, start.y + cy); - } else { - pImpl->moveTo(start.x + cx, start.y + cy); - } - - for (int i = 0; i < nCurves; ++i) { - auto endAngle = startAngle + ((i != nCurves - 1) ? MATH_PI2 * sweepSign : fract); - Point end = {radius * cosf(endAngle), radius * sinf(endAngle)}; - - //variables needed to calculate bezier control points - - //get bezier control points using article: - //(http://itc.ktu.lt/index.php/ITC/article/view/11812/6479) - auto ax = start.x; - auto ay = start.y; - auto bx = end.x; - auto by = end.y; - auto q1 = ax * ax + ay * ay; - auto q2 = ax * bx + ay * by + q1; - auto k2 = (4.0f/3.0f) * ((sqrtf(2 * q1 * q2) - q2) / (ax * by - ay * bx)); - - start = end; //Next start point is the current end point - - end.x += cx; - end.y += cy; - - Point ctrl1 = {ax - k2 * ay + cx, ay + k2 * ax + cy}; - Point ctrl2 = {bx + k2 * by + cx, by - k2 * bx + cy}; - - pImpl->cubicTo(ctrl1.x, ctrl1.y, ctrl2.x, ctrl2.y, end.x, end.y); - - startAngle = endAngle; - } - - if (pie) pImpl->close(); - - return Result::Success; -} - - -Result Shape::appendRect(float x, float y, float w, float h, float rx, float ry) noexcept -{ - auto halfW = w * 0.5f; - auto halfH = h * 0.5f; - - //clamping cornerRadius by minimum size - if (rx > halfW) rx = halfW; - if (ry > halfH) ry = halfH; - - //rectangle - if (rx == 0 && ry == 0) { - pImpl->grow(5, 4); - pImpl->moveTo(x, y); - pImpl->lineTo(x + w, y); - pImpl->lineTo(x + w, y + h); - pImpl->lineTo(x, y + h); - pImpl->close(); - //rounded rectangle or circle - } else { - auto hrx = rx * PATH_KAPPA; - auto hry = ry * PATH_KAPPA; - pImpl->grow(10, 17); - pImpl->moveTo(x + rx, y); - pImpl->lineTo(x + w - rx, y); - pImpl->cubicTo(x + w - rx + hrx, y, x + w, y + ry - hry, x + w, y + ry); - pImpl->lineTo(x + w, y + h - ry); - pImpl->cubicTo(x + w, y + h - ry + hry, x + w - rx + hrx, y + h, x + w - rx, y + h); - pImpl->lineTo(x + rx, y + h); - pImpl->cubicTo(x + rx - hrx, y + h, x, y + h - ry + hry, x, y + h - ry); - pImpl->lineTo(x, y + ry); - pImpl->cubicTo(x, y + ry - hry, x + rx - hrx, y, x + rx, y); - pImpl->close(); - } - - return Result::Success; -} - - -Result Shape::fill(uint8_t r, uint8_t g, uint8_t b, uint8_t a) noexcept -{ - if (pImpl->rs.fill) { - delete(pImpl->rs.fill); - pImpl->rs.fill = nullptr; - pImpl->flag |= RenderUpdateFlag::Gradient; - } - - if (r == pImpl->rs.color[0] && g == pImpl->rs.color[1] && b == pImpl->rs.color[2] && a == pImpl->rs.color[3]) return Result::Success; - - pImpl->rs.color[0] = r; - pImpl->rs.color[1] = g; - pImpl->rs.color[2] = b; - pImpl->rs.color[3] = a; - pImpl->flag |= RenderUpdateFlag::Color; - - return Result::Success; -} - - -Result Shape::fill(unique_ptr f) noexcept -{ - auto p = f.release(); - if (!p) return Result::MemoryCorruption; - - if (pImpl->rs.fill && pImpl->rs.fill != p) delete(pImpl->rs.fill); - pImpl->rs.fill = p; - pImpl->flag |= RenderUpdateFlag::Gradient; - - return Result::Success; -} - - -Result Shape::fillColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a) const noexcept -{ - pImpl->rs.fillColor(r, g, b, a); - - return Result::Success; -} - - -const Fill* Shape::fill() const noexcept -{ - return pImpl->rs.fill; -} - - -Result Shape::order(bool strokeFirst) noexcept -{ - if (!pImpl->strokeFirst(strokeFirst)) return Result::FailedAllocation; - - return Result::Success; -} - - -Result Shape::stroke(float width) noexcept -{ - if (!pImpl->strokeWidth(width)) return Result::FailedAllocation; - - return Result::Success; -} - - -float Shape::strokeWidth() const noexcept -{ - return pImpl->rs.strokeWidth(); -} - - -Result Shape::stroke(uint8_t r, uint8_t g, uint8_t b, uint8_t a) noexcept -{ - if (!pImpl->strokeColor(r, g, b, a)) return Result::FailedAllocation; - - return Result::Success; -} - - -Result Shape::strokeColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a) const noexcept -{ - if (!pImpl->rs.strokeColor(r, g, b, a)) return Result::InsufficientCondition; - - return Result::Success; -} - - -Result Shape::stroke(unique_ptr f) noexcept -{ - return pImpl->strokeFill(std::move(f)); -} - - -const Fill* Shape::strokeFill() const noexcept -{ - return pImpl->rs.strokeFill(); -} - - -Result Shape::stroke(const float* dashPattern, uint32_t cnt) noexcept -{ - return pImpl->strokeDash(dashPattern, cnt, 0); -} - - -uint32_t Shape::strokeDash(const float** dashPattern) const noexcept -{ - return pImpl->rs.strokeDash(dashPattern, nullptr); -} - - -Result Shape::stroke(StrokeCap cap) noexcept -{ - if (!pImpl->strokeCap(cap)) return Result::FailedAllocation; - - return Result::Success; -} - - -Result Shape::stroke(StrokeJoin join) noexcept -{ - if (!pImpl->strokeJoin(join)) return Result::FailedAllocation; - - return Result::Success; -} - -Result Shape::strokeMiterlimit(float miterlimit) noexcept -{ - // https://www.w3.org/TR/SVG2/painting.html#LineJoin - // - A negative value for stroke-miterlimit must be treated as an illegal value. - if (miterlimit < 0.0f) return Result::NonSupport; - // TODO Find out a reasonable max value. - if (!pImpl->strokeMiterlimit(miterlimit)) return Result::FailedAllocation; - - return Result::Success; -} - - -StrokeCap Shape::strokeCap() const noexcept -{ - return pImpl->rs.strokeCap(); -} - - -StrokeJoin Shape::strokeJoin() const noexcept -{ - return pImpl->rs.strokeJoin(); -} - -float Shape::strokeMiterlimit() const noexcept -{ - return pImpl->rs.strokeMiterlimit(); -} - - -Result Shape::fill(FillRule r) noexcept -{ - pImpl->rs.rule = r; - - return Result::Success; -} - - -FillRule Shape::fillRule() const noexcept -{ - return pImpl->rs.rule; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgShape.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgShape.h deleted file mode 100644 index bb5e6f3..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgShape.h +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SHAPE_H_ -#define _TVG_SHAPE_H_ - -#include -#include "tvgMath.h" -#include "tvgPaint.h" - - -struct Shape::Impl -{ - RenderShape rs; //shape data - RenderData rd = nullptr; //engine data - Shape* shape; - uint8_t flag = RenderUpdateFlag::None; - uint8_t opacity; //for composition - bool needComp = false; //composite or not - - Impl(Shape* s) : shape(s) - { - } - - ~Impl() - { - if (auto renderer = PP(shape)->renderer) { - renderer->dispose(rd); - } - } - - bool render(RenderMethod* renderer) - { - Compositor* cmp = nullptr; - bool ret; - - if (needComp) { - cmp = renderer->target(bounds(renderer), renderer->colorSpace()); - renderer->beginComposite(cmp, CompositeMethod::None, opacity); - } - ret = renderer->renderShape(rd); - if (cmp) renderer->endComposite(cmp); - return ret; - } - - bool needComposition(uint8_t opacity) - { - if (opacity == 0) return false; - - //Shape composition is only necessary when stroking & fill are valid. - if (!rs.stroke || rs.stroke->width < FLOAT_EPSILON || (!rs.stroke->fill && rs.stroke->color[3] == 0)) return false; - if (!rs.fill && rs.color[3] == 0) return false; - - //translucent fill & stroke - if (opacity < 255) return true; - - //Composition test - const Paint* target; - auto method = shape->composite(&target); - if (!target || method == CompositeMethod::ClipPath) return false; - if (target->pImpl->opacity == 255 || target->pImpl->opacity == 0) { - if (target->identifier() == TVG_CLASS_ID_SHAPE) { - auto shape = static_cast(target); - if (!shape->fill()) { - uint8_t r, g, b, a; - shape->fillColor(&r, &g, &b, &a); - if (a == 0 || a == 255) { - if (method == CompositeMethod::LumaMask || method == CompositeMethod::InvLumaMask) { - if ((r == 255 && g == 255 && b == 255) || (r == 0 && g == 0 && b == 0)) return false; - } else return false; - } - } - } - } - - return true; - } - - RenderData update(RenderMethod* renderer, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag pFlag, bool clipper) - { - if ((needComp = needComposition(opacity))) { - /* Overriding opacity value. If this scene is half-translucent, - It must do intermediate composition with that opacity value. */ - this->opacity = opacity; - opacity = 255; - } - - rd = renderer->prepare(rs, rd, transform, clips, opacity, static_cast(pFlag | flag), clipper); - flag = RenderUpdateFlag::None; - return rd; - } - - RenderRegion bounds(RenderMethod* renderer) - { - return renderer->region(rd); - } - - bool bounds(float* x, float* y, float* w, float* h, bool stroking) - { - //Path bounding size - if (rs.path.pts.count > 0 ) { - auto pts = rs.path.pts.begin(); - Point min = { pts->x, pts->y }; - Point max = { pts->x, pts->y }; - - for (auto pts2 = pts + 1; pts2 < rs.path.pts.end(); ++pts2) { - if (pts2->x < min.x) min.x = pts2->x; - if (pts2->y < min.y) min.y = pts2->y; - if (pts2->x > max.x) max.x = pts2->x; - if (pts2->y > max.y) max.y = pts2->y; - } - - if (x) *x = min.x; - if (y) *y = min.y; - if (w) *w = max.x - min.x; - if (h) *h = max.y - min.y; - } - - //Stroke feathering - if (stroking && rs.stroke) { - if (x) *x -= rs.stroke->width * 0.5f; - if (y) *y -= rs.stroke->width * 0.5f; - if (w) *w += rs.stroke->width; - if (h) *h += rs.stroke->width; - } - return rs.path.pts.count > 0 ? true : false; - } - - void reserveCmd(uint32_t cmdCnt) - { - rs.path.cmds.reserve(cmdCnt); - } - - void reservePts(uint32_t ptsCnt) - { - rs.path.pts.reserve(ptsCnt); - } - - void grow(uint32_t cmdCnt, uint32_t ptsCnt) - { - rs.path.cmds.grow(cmdCnt); - rs.path.pts.grow(ptsCnt); - } - - void append(const PathCommand* cmds, uint32_t cmdCnt, const Point* pts, uint32_t ptsCnt) - { - memcpy(rs.path.cmds.end(), cmds, sizeof(PathCommand) * cmdCnt); - memcpy(rs.path.pts.end(), pts, sizeof(Point) * ptsCnt); - rs.path.cmds.count += cmdCnt; - rs.path.pts.count += ptsCnt; - - flag |= RenderUpdateFlag::Path; - } - - void moveTo(float x, float y) - { - rs.path.cmds.push(PathCommand::MoveTo); - rs.path.pts.push({x, y}); - - flag |= RenderUpdateFlag::Path; - } - - void lineTo(float x, float y) - { - rs.path.cmds.push(PathCommand::LineTo); - rs.path.pts.push({x, y}); - - flag |= RenderUpdateFlag::Path; - } - - void cubicTo(float cx1, float cy1, float cx2, float cy2, float x, float y) - { - rs.path.cmds.push(PathCommand::CubicTo); - rs.path.pts.push({cx1, cy1}); - rs.path.pts.push({cx2, cy2}); - rs.path.pts.push({x, y}); - - flag |= RenderUpdateFlag::Path; - } - - void close() - { - //Don't close multiple times. - if (rs.path.cmds.count > 0 && rs.path.cmds.last() == PathCommand::Close) return; - - rs.path.cmds.push(PathCommand::Close); - - flag |= RenderUpdateFlag::Path; - } - - bool strokeWidth(float width) - { - if (!rs.stroke) rs.stroke = new RenderStroke(); - rs.stroke->width = width; - flag |= RenderUpdateFlag::Stroke; - - return true; - } - - bool strokeTrim(float begin, float end, bool individual) - { - if (!rs.stroke) { - if (begin == 0.0f && end == 1.0f) return true; - rs.stroke = new RenderStroke(); - } - - if (mathEqual(rs.stroke->trim.begin, begin) && mathEqual(rs.stroke->trim.end, end)) return true; - - rs.stroke->trim.begin = begin; - rs.stroke->trim.end = end; - rs.stroke->trim.individual = individual; - flag |= RenderUpdateFlag::Stroke; - - return true; - } - - bool strokeCap(StrokeCap cap) - { - if (!rs.stroke) rs.stroke = new RenderStroke(); - rs.stroke->cap = cap; - flag |= RenderUpdateFlag::Stroke; - - return true; - } - - bool strokeJoin(StrokeJoin join) - { - if (!rs.stroke) rs.stroke = new RenderStroke(); - rs.stroke->join = join; - flag |= RenderUpdateFlag::Stroke; - - return true; - } - - bool strokeMiterlimit(float miterlimit) - { - if (!rs.stroke) rs.stroke = new RenderStroke(); - rs.stroke->miterlimit = miterlimit; - flag |= RenderUpdateFlag::Stroke; - - return true; - } - - bool strokeColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a) - { - if (!rs.stroke) rs.stroke = new RenderStroke(); - if (rs.stroke->fill) { - delete(rs.stroke->fill); - rs.stroke->fill = nullptr; - flag |= RenderUpdateFlag::GradientStroke; - } - - rs.stroke->color[0] = r; - rs.stroke->color[1] = g; - rs.stroke->color[2] = b; - rs.stroke->color[3] = a; - - flag |= RenderUpdateFlag::Stroke; - - return true; - } - - Result strokeFill(unique_ptr f) - { - auto p = f.release(); - if (!p) return Result::MemoryCorruption; - - if (!rs.stroke) rs.stroke = new RenderStroke(); - if (rs.stroke->fill && rs.stroke->fill != p) delete(rs.stroke->fill); - rs.stroke->fill = p; - - flag |= RenderUpdateFlag::Stroke; - flag |= RenderUpdateFlag::GradientStroke; - - return Result::Success; - } - - Result strokeDash(const float* pattern, uint32_t cnt, float offset) - { - if ((cnt == 1) || (!pattern && cnt > 0) || (pattern && cnt == 0)) { - return Result::InvalidArguments; - } - - for (uint32_t i = 0; i < cnt; i++) { - if (pattern[i] < FLOAT_EPSILON) return Result::InvalidArguments; - } - - //Reset dash - if (!pattern && cnt == 0) { - free(rs.stroke->dashPattern); - rs.stroke->dashPattern = nullptr; - } else { - if (!rs.stroke) rs.stroke = new RenderStroke(); - if (rs.stroke->dashCnt != cnt) { - free(rs.stroke->dashPattern); - rs.stroke->dashPattern = nullptr; - } - if (!rs.stroke->dashPattern) { - rs.stroke->dashPattern = static_cast(malloc(sizeof(float) * cnt)); - if (!rs.stroke->dashPattern) return Result::FailedAllocation; - } - for (uint32_t i = 0; i < cnt; ++i) { - rs.stroke->dashPattern[i] = pattern[i]; - } - } - rs.stroke->dashCnt = cnt; - rs.stroke->dashOffset = offset; - flag |= RenderUpdateFlag::Stroke; - - return Result::Success; - } - - bool strokeFirst() - { - if (!rs.stroke) return true; - return rs.stroke->strokeFirst; - } - - bool strokeFirst(bool strokeFirst) - { - if (!rs.stroke) rs.stroke = new RenderStroke(); - rs.stroke->strokeFirst = strokeFirst; - flag |= RenderUpdateFlag::Stroke; - - return true; - } - - void update(RenderUpdateFlag flag) - { - this->flag |= flag; - } - - Paint* duplicate() - { - auto ret = Shape::gen().release(); - auto dup = ret->pImpl; - - dup->rs.rule = rs.rule; - - //Color - memcpy(dup->rs.color, rs.color, sizeof(rs.color)); - dup->flag = RenderUpdateFlag::Color; - - //Path - if (rs.path.cmds.count > 0 && rs.path.pts.count > 0) { - dup->rs.path.cmds = rs.path.cmds; - dup->rs.path.pts = rs.path.pts; - dup->flag |= RenderUpdateFlag::Path; - } - - //Stroke - if (rs.stroke) { - dup->rs.stroke = new RenderStroke(); - *dup->rs.stroke = *rs.stroke; - memcpy(dup->rs.stroke->color, rs.stroke->color, sizeof(rs.stroke->color)); - if (rs.stroke->dashCnt > 0) { - dup->rs.stroke->dashPattern = static_cast(malloc(sizeof(float) * rs.stroke->dashCnt)); - memcpy(dup->rs.stroke->dashPattern, rs.stroke->dashPattern, sizeof(float) * rs.stroke->dashCnt); - } - if (rs.stroke->fill) { - dup->rs.stroke->fill = rs.stroke->fill->duplicate(); - dup->flag |= RenderUpdateFlag::GradientStroke; - } - dup->flag |= RenderUpdateFlag::Stroke; - } - - //Fill - if (rs.fill) { - dup->rs.fill = rs.fill->duplicate(); - dup->flag |= RenderUpdateFlag::Gradient; - } - - return ret; - } - - Iterator* iterator() - { - return nullptr; - } -}; - -#endif //_TVG_SHAPE_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgStr.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgStr.cpp deleted file mode 100644 index 1838e75..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgStr.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "config.h" -#include -#include -#include -#include "tvgMath.h" -#include "tvgStr.h" - - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static inline bool _floatExact(float a, float b) -{ - return memcmp(&a, &b, sizeof(float)) == 0; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -namespace tvg { - -/* - * https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strtof-strtof-l-wcstof-wcstof-l?view=msvc-160 - * - * src should be one of the following form : - * - * [whitespace] [sign] {digits [radix digits] | radix digits} [{e | E} [sign] digits] - * [whitespace] [sign] {INF | INFINITY} - * [whitespace] [sign] NAN [sequence] - * - * No hexadecimal form supported - * no sequence supported after NAN - */ -float strToFloat(const char *nPtr, char **endPtr) -{ - if (endPtr) *endPtr = (char *) (nPtr); - if (!nPtr) return 0.0f; - - auto a = nPtr; - auto iter = nPtr; - auto val = 0.0f; - unsigned long long integerPart = 0; - int minus = 1; - - //ignore leading whitespaces - while (isspace(*iter)) iter++; - - //signed or not - if (*iter == '-') { - minus = -1; - iter++; - } else if (*iter == '+') { - iter++; - } - - if (tolower(*iter) == 'i') { - if ((tolower(*(iter + 1)) == 'n') && (tolower(*(iter + 2)) == 'f')) iter += 3; - else goto error; - - if (tolower(*(iter)) == 'i') { - if ((tolower(*(iter + 1)) == 'n') && (tolower(*(iter + 2)) == 'i') && (tolower(*(iter + 3)) == 't') && - (tolower(*(iter + 4)) == 'y')) - iter += 5; - else goto error; - } - if (endPtr) *endPtr = (char *) (iter); - return (minus == -1) ? -INFINITY : INFINITY; - } - - if (tolower(*iter) == 'n') { - if ((tolower(*(iter + 1)) == 'a') && (tolower(*(iter + 2)) == 'n')) iter += 3; - else goto error; - - if (endPtr) *endPtr = (char *) (iter); - return (minus == -1) ? -NAN : NAN; - } - - //Optional: integer part before dot - if (isdigit(*iter)) { - for (; isdigit(*iter); iter++) { - integerPart = integerPart * 10ULL + (unsigned long long) (*iter - '0'); - } - a = iter; - } else if (*iter != '.') { - goto success; - } - - val = static_cast(integerPart); - - //Optional: decimal part after dot - if (*iter == '.') { - unsigned long long decimalPart = 0; - unsigned long long pow10 = 1; - int count = 0; - - iter++; - - if (isdigit(*iter)) { - for (; isdigit(*iter); iter++, count++) { - if (count < 19) { - decimalPart = decimalPart * 10ULL + +static_cast(*iter - '0'); - pow10 *= 10ULL; - } - } - } else if (isspace(*iter)) { //skip if there is a space after the dot. - a = iter; - goto success; - } - - val += static_cast(decimalPart) / static_cast(pow10); - a = iter; - } - - //Optional: exponent - if (*iter == 'e' || *iter == 'E') { - ++iter; - - //Exception: svg may have 'em' unit for fonts. ex) 5em, 10.5em - if ((*iter == 'm') || (*iter == 'M')) { - //TODO: We don't support font em unit now, but has to multiply val * font size later... - a = iter + 1; - goto success; - } - - //signed or not - int minus_e = 1; - - if (*iter == '-') { - minus_e = -1; - ++iter; - } else if (*iter == '+') { - iter++; - } - - unsigned int exponentPart = 0; - - if (isdigit(*iter)) { - while (*iter == '0') iter++; - for (; isdigit(*iter); iter++) { - exponentPart = exponentPart * 10U + static_cast(*iter - '0'); - } - } else if (!isdigit(*(a - 1))) { - a = nPtr; - goto success; - } else if (*iter == 0) { - goto success; - } - - //if ((_floatExact(val, 2.2250738585072011f)) && ((minus_e * static_cast(exponentPart)) <= -308)) { - if ((_floatExact(val, 1.175494351f)) && ((minus_e * static_cast(exponentPart)) <= -38)) { - //val *= 1.0e-308f; - val *= 1.0e-38f; - a = iter; - goto success; - } - - a = iter; - auto scale = 1.0f; - - while (exponentPart >= 8U) { - scale *= 1E8f; - exponentPart -= 8U; - } - while (exponentPart > 0U) { - scale *= 10.0f; - exponentPart--; - } - val = (minus_e == -1) ? (val / scale) : (val * scale); - } else if ((iter > nPtr) && !isdigit(*(iter - 1))) { - a = nPtr; - goto success; - } - -success: - if (endPtr) *endPtr = (char *)(a); - if (!std::isfinite(val)) return 0.0f; - - return minus * val; - -error: - if (endPtr) *endPtr = (char *)(nPtr); - return 0.0f; -} - - -int str2int(const char* str, size_t n) -{ - int ret = 0; - for(size_t i = 0; i < n; ++i) { - ret = ret * 10 + (str[i] - '0'); - } - return ret; -} - -char* strDuplicate(const char *str, size_t n) -{ - auto len = strlen(str); - if (len < n) n = len; - - auto ret = (char *) malloc(n + 1); - if (!ret) return nullptr; - ret[n] = '\0'; - - return (char *) memcpy(ret, str, n); -} - -char* strDirname(const char* path) -{ - const char *ptr = strrchr(path, '/'); -#ifdef _WIN32 - if (ptr) ptr = strrchr(ptr + 1, '\\'); -#endif - int len = int(ptr + 1 - path); // +1 to include '/' - return strDuplicate(path, len); -} - -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgStr.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgStr.h deleted file mode 100644 index 154a199..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgStr.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_STR_H_ -#define _TVG_STR_H_ - -#include - -namespace tvg -{ - -float strToFloat(const char *nPtr, char **endPtr); //convert to float -int str2int(const char* str, size_t n); //convert to integer -char* strDuplicate(const char *str, size_t n); //copy the string -char* strDirname(const char* path); //return the full directory name - -} -#endif //_TVG_STR_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgCssStyle.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgCssStyle.cpp deleted file mode 100644 index 11274e3..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgCssStyle.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 2022 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgSvgCssStyle.h" - -#include - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static bool _isImportanceApplicable(SvgStyleFlags &toFlagsImportance, SvgStyleFlags fromFlagsImportance, SvgStyleFlags flag) -{ - if (!(toFlagsImportance & flag) && (fromFlagsImportance & flag)) { - return true; - } - return false; -} - -static void _copyStyle(SvgStyleProperty* to, const SvgStyleProperty* from) -{ - if (from == nullptr) return; - //Copy the properties of 'from' only if they were explicitly set (not the default ones). - if ((from->curColorSet && !(to->flags & SvgStyleFlags::Color)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::Color)) { - to->color = from->color; - to->curColorSet = true; - to->flags = (to->flags | SvgStyleFlags::Color); - if (from->flagsImportance & SvgStyleFlags::Color) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::Color); - } - } - if (((from->flags & SvgStyleFlags::PaintOrder) && !(to->flags & SvgStyleFlags::PaintOrder)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::PaintOrder)) { - to->paintOrder = from->paintOrder; - to->flags = (to->flags | SvgStyleFlags::PaintOrder); - if (from->flagsImportance & SvgStyleFlags::PaintOrder) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::PaintOrder); - } - } - if (((from->flags & SvgStyleFlags::Display) && !(to->flags & SvgStyleFlags::Display)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::Display)) { - to->display = from->display; - to->flags = (to->flags | SvgStyleFlags::Display); - if (from->flagsImportance & SvgStyleFlags::Display) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::Display); - } - } - //Fill - if (((from->fill.flags & SvgFillFlags::Paint) && !(to->flags & SvgStyleFlags::Fill)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::Fill)) { - to->fill.paint.color = from->fill.paint.color; - to->fill.paint.none = from->fill.paint.none; - to->fill.paint.curColor = from->fill.paint.curColor; - if (from->fill.paint.url) { - if (to->fill.paint.url) free(to->fill.paint.url); - to->fill.paint.url = strdup(from->fill.paint.url); - } - to->fill.flags = (to->fill.flags | SvgFillFlags::Paint); - to->flags = (to->flags | SvgStyleFlags::Fill); - if (from->flagsImportance & SvgStyleFlags::Fill) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::Fill); - } - } - if (((from->fill.flags & SvgFillFlags::Opacity) && !(to->flags & SvgStyleFlags::FillOpacity)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::FillOpacity)) { - to->fill.opacity = from->fill.opacity; - to->fill.flags = (to->fill.flags | SvgFillFlags::Opacity); - to->flags = (to->flags | SvgStyleFlags::FillOpacity); - if (from->flagsImportance & SvgStyleFlags::FillOpacity) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::FillOpacity); - } - } - if (((from->fill.flags & SvgFillFlags::FillRule) && !(to->flags & SvgStyleFlags::FillRule)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::FillRule)) { - to->fill.fillRule = from->fill.fillRule; - to->fill.flags = (to->fill.flags | SvgFillFlags::FillRule); - to->flags = (to->flags | SvgStyleFlags::FillRule); - if (from->flagsImportance & SvgStyleFlags::FillRule) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::FillRule); - } - } - //Stroke - if (((from->stroke.flags & SvgStrokeFlags::Paint) && !(to->flags & SvgStyleFlags::Stroke)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::Stroke)) { - to->stroke.paint.color = from->stroke.paint.color; - to->stroke.paint.none = from->stroke.paint.none; - to->stroke.paint.curColor = from->stroke.paint.curColor; - if (from->stroke.paint.url) { - if (to->stroke.paint.url) free(to->stroke.paint.url); - to->stroke.paint.url = strdup(from->stroke.paint.url); - } - to->stroke.flags = (to->stroke.flags | SvgStrokeFlags::Paint); - to->flags = (to->flags | SvgStyleFlags::Stroke); - if (from->flagsImportance & SvgStyleFlags::Stroke) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::Stroke); - } - } - if (((from->stroke.flags & SvgStrokeFlags::Opacity) && !(to->flags & SvgStyleFlags::StrokeOpacity)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::StrokeOpacity)) { - to->stroke.opacity = from->stroke.opacity; - to->stroke.flags = (to->stroke.flags | SvgStrokeFlags::Opacity); - to->flags = (to->flags | SvgStyleFlags::StrokeOpacity); - if (from->flagsImportance & SvgStyleFlags::StrokeOpacity) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::StrokeOpacity); - } - } - if (((from->stroke.flags & SvgStrokeFlags::Width) && !(to->flags & SvgStyleFlags::StrokeWidth)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::StrokeWidth)) { - to->stroke.width = from->stroke.width; - to->stroke.flags = (to->stroke.flags | SvgStrokeFlags::Width); - to->flags = (to->flags | SvgStyleFlags::StrokeWidth); - if (from->flagsImportance & SvgStyleFlags::StrokeWidth) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::StrokeWidth); - } - } - if (((from->stroke.flags & SvgStrokeFlags::Dash) && !(to->flags & SvgStyleFlags::StrokeDashArray)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::StrokeDashArray)) { - if (from->stroke.dash.array.count > 0) { - to->stroke.dash.array.clear(); - to->stroke.dash.array.reserve(from->stroke.dash.array.count); - for (uint32_t i = 0; i < from->stroke.dash.array.count; ++i) { - to->stroke.dash.array.push(from->stroke.dash.array[i]); - } - to->stroke.flags = (to->stroke.flags | SvgStrokeFlags::Dash); - to->flags = (to->flags | SvgStyleFlags::StrokeDashArray); - if (from->flagsImportance & SvgStyleFlags::StrokeDashArray) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::StrokeDashArray); - } - } - } - if (((from->stroke.flags & SvgStrokeFlags::Cap) && !(to->flags & SvgStyleFlags::StrokeLineCap)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::StrokeLineCap)) { - to->stroke.cap = from->stroke.cap; - to->stroke.flags = (to->stroke.flags | SvgStrokeFlags::Cap); - to->flags = (to->flags | SvgStyleFlags::StrokeLineCap); - if (from->flagsImportance & SvgStyleFlags::StrokeLineCap) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::StrokeLineCap); - } - } - if (((from->stroke.flags & SvgStrokeFlags::Join) && !(to->flags & SvgStyleFlags::StrokeLineJoin)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::StrokeLineJoin)) { - to->stroke.join = from->stroke.join; - to->stroke.flags = (to->stroke.flags | SvgStrokeFlags::Join); - to->flags = (to->flags | SvgStyleFlags::StrokeLineJoin); - if (from->flagsImportance & SvgStyleFlags::StrokeLineJoin) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::StrokeLineJoin); - } - } - //Opacity - //TODO: it can be set to be 255 and shouldn't be changed by attribute 'opacity' - if ((from->opacity < 255 && !(to->flags & SvgStyleFlags::Opacity)) || - _isImportanceApplicable(to->flagsImportance, from->flagsImportance, SvgStyleFlags::Opacity)) { - to->opacity = from->opacity; - to->flags = (to->flags | SvgStyleFlags::Opacity); - if (from->flagsImportance & SvgStyleFlags::Opacity) { - to->flagsImportance = (to->flagsImportance | SvgStyleFlags::Opacity); - } - } -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -void cssCopyStyleAttr(SvgNode* to, const SvgNode* from) -{ - //Copy matrix attribute - if (from->transform && !(to->style->flags & SvgStyleFlags::Transform)) { - to->transform = (Matrix*)malloc(sizeof(Matrix)); - if (to->transform) { - *to->transform = *from->transform; - to->style->flags = (to->style->flags | SvgStyleFlags::Transform); - } - } - //Copy style attribute - _copyStyle(to->style, from->style); - - if (from->style->clipPath.url) { - if (to->style->clipPath.url) free(to->style->clipPath.url); - to->style->clipPath.url = strdup(from->style->clipPath.url); - } - if (from->style->mask.url) { - if (to->style->mask.url) free(to->style->mask.url); - to->style->mask.url = strdup(from->style->mask.url); - } -} - - -SvgNode* cssFindStyleNode(const SvgNode* style, const char* title, SvgNodeType type) -{ - if (!style) return nullptr; - - auto child = style->child.data; - for (uint32_t i = 0; i < style->child.count; ++i, ++child) { - if ((*child)->type == type) { - if ((!title && !(*child)->id) || (title && (*child)->id && !strcmp((*child)->id, title))) return (*child); - } - } - return nullptr; -} - - -SvgNode* cssFindStyleNode(const SvgNode* style, const char* title) -{ - if (!style || !title) return nullptr; - - auto child = style->child.data; - for (uint32_t i = 0; i < style->child.count; ++i, ++child) { - if ((*child)->type == SvgNodeType::CssStyle) { - if ((*child)->id && !strcmp((*child)->id, title)) return (*child); - } - } - return nullptr; -} - - -void cssUpdateStyle(SvgNode* doc, SvgNode* style) -{ - if (doc->child.count > 0) { - auto child = doc->child.data; - for (uint32_t i = 0; i < doc->child.count; ++i, ++child) { - if (auto cssNode = cssFindStyleNode(style, nullptr, (*child)->type)) { - cssCopyStyleAttr(*child, cssNode); - } - cssUpdateStyle(*child, style); - } - } -} - - -void cssApplyStyleToPostponeds(Array& postponeds, SvgNode* style) -{ - for (uint32_t i = 0; i < postponeds.count; ++i) { - auto nodeIdPair = postponeds[i]; - - //css styling: tag.name has higher priority than .name - if (auto cssNode = cssFindStyleNode(style, nodeIdPair.id, nodeIdPair.node->type)) { - cssCopyStyleAttr(nodeIdPair.node, cssNode); - } - if (auto cssNode = cssFindStyleNode(style, nodeIdPair.id)) { - cssCopyStyleAttr(nodeIdPair.node, cssNode); - } - } -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgCssStyle.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgCssStyle.h deleted file mode 100644 index 24812b3..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgCssStyle.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2022 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SVG_CSS_STYLE_H_ -#define _TVG_SVG_CSS_STYLE_H_ - -#include "tvgSvgLoaderCommon.h" - -void cssCopyStyleAttr(SvgNode* to, const SvgNode* from); -SvgNode* cssFindStyleNode(const SvgNode* style, const char* title, SvgNodeType type); -SvgNode* cssFindStyleNode(const SvgNode* style, const char* title); -void cssUpdateStyle(SvgNode* doc, SvgNode* style); -void cssApplyStyleToPostponeds(Array& postponeds, SvgNode* style); - -#endif //_TVG_SVG_CSS_STYLE_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoader.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoader.cpp deleted file mode 100644 index 34ca2c5..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoader.cpp +++ /dev/null @@ -1,3917 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -/* - * Copyright notice for the EFL: - - * Copyright (C) EFL developers (see AUTHORS) - - * 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. - - * THIS SOFTWARE IS PROVIDED "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 - * COPYRIGHT HOLDER 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. -*/ - -#include -#include -#include -#include "tvgLoader.h" -#include "tvgXmlParser.h" -#include "tvgSvgLoader.h" -#include "tvgSvgSceneBuilder.h" -#include "tvgStr.h" -#include "tvgSvgCssStyle.h" -#include "tvgMath.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -/* - * According to: https://www.w3.org/TR/SVG2/coords.html#Units - * and: https://www.w3.org/TR/css-values-4/#absolute-lengths - */ -#define PX_PER_IN 96 //1 in = 96 px -#define PX_PER_PC 16 //1 pc = 1/6 in -> PX_PER_IN/6 -#define PX_PER_PT 1.333333f //1 pt = 1/72 in -> PX_PER_IN/72 -#define PX_PER_MM 3.779528f //1 in = 25.4 mm -> PX_PER_IN/25.4 -#define PX_PER_CM 37.79528f //1 in = 2.54 cm -> PX_PER_IN/2.54 - -typedef bool (*parseAttributes)(const char* buf, unsigned bufLength, simpleXMLAttributeCb func, const void* data); -typedef SvgNode* (*FactoryMethod)(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func); -typedef SvgStyleGradient* (*GradientFactoryMethod)(SvgLoaderData* loader, const char* buf, unsigned bufLength); - -static char* _skipSpace(const char* str, const char* end) -{ - while (((end && str < end) || (!end && *str != '\0')) && isspace(*str)) { - ++str; - } - return (char*) str; -} - - -static char* _copyId(const char* str) -{ - if (!str) return nullptr; - if (strlen(str) == 0) return nullptr; - - return strdup(str); -} - - -static const char* _skipComma(const char* content) -{ - content = _skipSpace(content, nullptr); - if (*content == ',') return content + 1; - return content; -} - - -static bool _parseNumber(const char** content, const char** end, float* number) -{ - const char* _end = end ? *end : nullptr; - - *number = strToFloat(*content, (char**)&_end); - //If the start of string is not number - if ((*content) == _end) { - if (end) *end = _end; - return false; - } - //Skip comma if any - *content = _skipComma(_end); - if (end) *end = _end; - - return true; -} - - -static constexpr struct -{ - AspectRatioAlign align; - const char* tag; -} alignTags[] = { - { AspectRatioAlign::XMinYMin, "xMinYMin" }, - { AspectRatioAlign::XMidYMin, "xMidYMin" }, - { AspectRatioAlign::XMaxYMin, "xMaxYMin" }, - { AspectRatioAlign::XMinYMid, "xMinYMid" }, - { AspectRatioAlign::XMidYMid, "xMidYMid" }, - { AspectRatioAlign::XMaxYMid, "xMaxYMid" }, - { AspectRatioAlign::XMinYMax, "xMinYMax" }, - { AspectRatioAlign::XMidYMax, "xMidYMax" }, - { AspectRatioAlign::XMaxYMax, "xMaxYMax" }, -}; - - -static void _parseAspectRatio(const char** content, AspectRatioAlign* align, AspectRatioMeetOrSlice* meetOrSlice) -{ - if (!strcmp(*content, "none")) { - *align = AspectRatioAlign::None; - return; - } - - for (unsigned int i = 0; i < sizeof(alignTags) / sizeof(alignTags[0]); i++) { - if (!strncmp(*content, alignTags[i].tag, 8)) { - *align = alignTags[i].align; - *content += 8; - *content = _skipSpace(*content, nullptr); - break; - } - } - - if (!strcmp(*content, "meet")) { - *meetOrSlice = AspectRatioMeetOrSlice::Meet; - } else if (!strcmp(*content, "slice")) { - *meetOrSlice = AspectRatioMeetOrSlice::Slice; - } -} - - -/** - * According to https://www.w3.org/TR/SVG/coords.html#Units - */ -static float _toFloat(const SvgParser* svgParse, const char* str, SvgParserLengthType type) -{ - float parsedValue = strToFloat(str, nullptr); - - if (strstr(str, "cm")) parsedValue *= PX_PER_CM; - else if (strstr(str, "mm")) parsedValue *= PX_PER_MM; - else if (strstr(str, "pt")) parsedValue *= PX_PER_PT; - else if (strstr(str, "pc")) parsedValue *= PX_PER_PC; - else if (strstr(str, "in")) parsedValue *= PX_PER_IN; - else if (strstr(str, "%")) { - if (type == SvgParserLengthType::Vertical) parsedValue = (parsedValue / 100.0f) * svgParse->global.h; - else if (type == SvgParserLengthType::Horizontal) parsedValue = (parsedValue / 100.0f) * svgParse->global.w; - else //if other then it's radius - { - float max = svgParse->global.w; - if (max < svgParse->global.h) - max = svgParse->global.h; - parsedValue = (parsedValue / 100.0f) * max; - } - } - //TODO: Implement 'em', 'ex' attributes - - return parsedValue; -} - - -static float _gradientToFloat(const SvgParser* svgParse, const char* str, bool& isPercentage) -{ - char* end = nullptr; - - float parsedValue = strToFloat(str, &end); - isPercentage = false; - - if (strstr(str, "%")) { - parsedValue = parsedValue / 100.0f; - isPercentage = true; - } - else if (strstr(str, "cm")) parsedValue *= PX_PER_CM; - else if (strstr(str, "mm")) parsedValue *= PX_PER_MM; - else if (strstr(str, "pt")) parsedValue *= PX_PER_PT; - else if (strstr(str, "pc")) parsedValue *= PX_PER_PC; - else if (strstr(str, "in")) parsedValue *= PX_PER_IN; - //TODO: Implement 'em', 'ex' attributes - - return parsedValue; -} - - -static float _toOffset(const char* str) -{ - char* end = nullptr; - auto strEnd = str + strlen(str); - - float parsedValue = strToFloat(str, &end); - - end = _skipSpace(end, nullptr); - auto ptr = strstr(str, "%"); - - if (ptr) { - parsedValue = parsedValue / 100.0f; - if (end != ptr || (end + 1) != strEnd) return 0; - } else if (end != strEnd) return 0; - - return parsedValue; -} - - -static int _toOpacity(const char* str) -{ - char* end = nullptr; - float opacity = strToFloat(str, &end); - - if (end) { - if (end[0] == '%' && end[1] == '\0') return lrint(opacity * 2.55f); - else if (*end == '\0') return lrint(opacity * 255); - } - return 255; -} - - -static SvgMaskType _toMaskType(const char* str) -{ - if (!strcmp(str, "Alpha")) return SvgMaskType::Alpha; - - return SvgMaskType::Luminance; -} - - -//The default rendering order: fill, stroke, markers -//If any is omitted, will be rendered in its default order after the specified ones. -static bool _toPaintOrder(const char* str) -{ - uint8_t position = 1; - uint8_t strokePosition = 0; - uint8_t fillPosition = 0; - - while (*str != '\0') { - str = _skipSpace(str, nullptr); - if (!strncmp(str, "fill", 4)) { - fillPosition = position++; - str += 4; - } else if (!strncmp(str, "stroke", 6)) { - strokePosition = position++; - str += 6; - } else if (!strncmp(str, "markers", 7)) { - str += 7; - } else { - return _toPaintOrder("fill stroke"); - } - } - - if (fillPosition == 0) fillPosition = position++; - if (strokePosition == 0) strokePosition = position++; - - return fillPosition < strokePosition; -} - - -#define _PARSE_TAG(Type, Name, Name1, Tags_Array, Default) \ - static Type _to##Name1(const char* str) \ - { \ - unsigned int i; \ - \ - for (i = 0; i < sizeof(Tags_Array) / sizeof(Tags_Array[0]); i++) { \ - if (!strcmp(str, Tags_Array[i].tag)) return Tags_Array[i].Name; \ - } \ - return Default; \ - } - - -/* parse the line cap used during stroking a path. - * Value: butt | round | square | inherit - * Initial: butt - * https://www.w3.org/TR/SVG/painting.html - */ -static constexpr struct -{ - StrokeCap lineCap; - const char* tag; -} lineCapTags[] = { - { StrokeCap::Butt, "butt" }, - { StrokeCap::Round, "round" }, - { StrokeCap::Square, "square" } -}; - - -_PARSE_TAG(StrokeCap, lineCap, LineCap, lineCapTags, StrokeCap::Butt) - - -/* parse the line join used during stroking a path. - * Value: miter | round | bevel | inherit - * Initial: miter - * https://www.w3.org/TR/SVG/painting.html - */ -static constexpr struct -{ - StrokeJoin lineJoin; - const char* tag; -} lineJoinTags[] = { - { StrokeJoin::Miter, "miter" }, - { StrokeJoin::Round, "round" }, - { StrokeJoin::Bevel, "bevel" } -}; - - -_PARSE_TAG(StrokeJoin, lineJoin, LineJoin, lineJoinTags, StrokeJoin::Miter) - - -/* parse the fill rule used during filling a path. - * Value: nonzero | evenodd | inherit - * Initial: nonzero - * https://www.w3.org/TR/SVG/painting.html - */ -static constexpr struct -{ - FillRule fillRule; - const char* tag; -} fillRuleTags[] = { - { FillRule::EvenOdd, "evenodd" } -}; - - -_PARSE_TAG(FillRule, fillRule, FillRule, fillRuleTags, FillRule::Winding) - - -/* parse the dash pattern used during stroking a path. - * Value: none | | inherit - * Initial: none - * https://www.w3.org/TR/SVG/painting.html - */ -static void _parseDashArray(SvgLoaderData* loader, const char *str, SvgDash* dash) -{ - if (!strncmp(str, "none", 4)) return; - - char *end = nullptr; - - while (*str) { - str = _skipComma(str); - float parsedValue = strToFloat(str, &end); - if (str == end) break; - if (parsedValue <= 0.0f) break; - if (*end == '%') { - ++end; - //Refers to the diagonal length of the viewport. - //https://www.w3.org/TR/SVG2/coords.html#Units - parsedValue = (sqrtf(powf(loader->svgParse->global.w, 2) + powf(loader->svgParse->global.h, 2)) / sqrtf(2.0f)) * (parsedValue / 100.0f); - } - (*dash).array.push(parsedValue); - str = end; - } - //If dash array size is 1, it means that dash and gap size are the same. - if ((*dash).array.count == 1) (*dash).array.push((*dash).array[0]); -} - - -static char* _idFromUrl(const char* url) -{ - auto open = strchr(url, '('); - auto close = strchr(url, ')'); - if (!open || !close || open >= close) return nullptr; - - open = strchr(url, '#'); - if (!open || open >= close) return nullptr; - - ++open; - --close; - - //trim the rest of the spaces if any - while (open < close && *close == ' ') --close; - - //quick verification - for (auto id = open; id < close; id++) { - if (*id == ' ' || *id == '\'') return nullptr; - } - - return strDuplicate(open, (close - open + 1)); -} - - -static unsigned char _parseColor(const char* value, char** end) -{ - float r; - - r = strToFloat(value, end); - *end = _skipSpace(*end, nullptr); - if (**end == '%') { - r = 255 * r / 100; - (*end)++; - } - *end = _skipSpace(*end, nullptr); - - if (r < 0 || r > 255) { - *end = nullptr; - return 0; - } - - return lrint(r); -} - - -static constexpr struct -{ - const char* name; - unsigned int value; -} colors[] = { - { "aliceblue", 0xfff0f8ff }, - { "antiquewhite", 0xfffaebd7 }, - { "aqua", 0xff00ffff }, - { "aquamarine", 0xff7fffd4 }, - { "azure", 0xfff0ffff }, - { "beige", 0xfff5f5dc }, - { "bisque", 0xffffe4c4 }, - { "black", 0xff000000 }, - { "blanchedalmond", 0xffffebcd }, - { "blue", 0xff0000ff }, - { "blueviolet", 0xff8a2be2 }, - { "brown", 0xffa52a2a }, - { "burlywood", 0xffdeb887 }, - { "cadetblue", 0xff5f9ea0 }, - { "chartreuse", 0xff7fff00 }, - { "chocolate", 0xffd2691e }, - { "coral", 0xffff7f50 }, - { "cornflowerblue", 0xff6495ed }, - { "cornsilk", 0xfffff8dc }, - { "crimson", 0xffdc143c }, - { "cyan", 0xff00ffff }, - { "darkblue", 0xff00008b }, - { "darkcyan", 0xff008b8b }, - { "darkgoldenrod", 0xffb8860b }, - { "darkgray", 0xffa9a9a9 }, - { "darkgrey", 0xffa9a9a9 }, - { "darkgreen", 0xff006400 }, - { "darkkhaki", 0xffbdb76b }, - { "darkmagenta", 0xff8b008b }, - { "darkolivegreen", 0xff556b2f }, - { "darkorange", 0xffff8c00 }, - { "darkorchid", 0xff9932cc }, - { "darkred", 0xff8b0000 }, - { "darksalmon", 0xffe9967a }, - { "darkseagreen", 0xff8fbc8f }, - { "darkslateblue", 0xff483d8b }, - { "darkslategray", 0xff2f4f4f }, - { "darkslategrey", 0xff2f4f4f }, - { "darkturquoise", 0xff00ced1 }, - { "darkviolet", 0xff9400d3 }, - { "deeppink", 0xffff1493 }, - { "deepskyblue", 0xff00bfff }, - { "dimgray", 0xff696969 }, - { "dimgrey", 0xff696969 }, - { "dodgerblue", 0xff1e90ff }, - { "firebrick", 0xffb22222 }, - { "floralwhite", 0xfffffaf0 }, - { "forestgreen", 0xff228b22 }, - { "fuchsia", 0xffff00ff }, - { "gainsboro", 0xffdcdcdc }, - { "ghostwhite", 0xfff8f8ff }, - { "gold", 0xffffd700 }, - { "goldenrod", 0xffdaa520 }, - { "gray", 0xff808080 }, - { "grey", 0xff808080 }, - { "green", 0xff008000 }, - { "greenyellow", 0xffadff2f }, - { "honeydew", 0xfff0fff0 }, - { "hotpink", 0xffff69b4 }, - { "indianred", 0xffcd5c5c }, - { "indigo", 0xff4b0082 }, - { "ivory", 0xfffffff0 }, - { "khaki", 0xfff0e68c }, - { "lavender", 0xffe6e6fa }, - { "lavenderblush", 0xfffff0f5 }, - { "lawngreen", 0xff7cfc00 }, - { "lemonchiffon", 0xfffffacd }, - { "lightblue", 0xffadd8e6 }, - { "lightcoral", 0xfff08080 }, - { "lightcyan", 0xffe0ffff }, - { "lightgoldenrodyellow", 0xfffafad2 }, - { "lightgray", 0xffd3d3d3 }, - { "lightgrey", 0xffd3d3d3 }, - { "lightgreen", 0xff90ee90 }, - { "lightpink", 0xffffb6c1 }, - { "lightsalmon", 0xffffa07a }, - { "lightseagreen", 0xff20b2aa }, - { "lightskyblue", 0xff87cefa }, - { "lightslategray", 0xff778899 }, - { "lightslategrey", 0xff778899 }, - { "lightsteelblue", 0xffb0c4de }, - { "lightyellow", 0xffffffe0 }, - { "lime", 0xff00ff00 }, - { "limegreen", 0xff32cd32 }, - { "linen", 0xfffaf0e6 }, - { "magenta", 0xffff00ff }, - { "maroon", 0xff800000 }, - { "mediumaquamarine", 0xff66cdaa }, - { "mediumblue", 0xff0000cd }, - { "mediumorchid", 0xffba55d3 }, - { "mediumpurple", 0xff9370d8 }, - { "mediumseagreen", 0xff3cb371 }, - { "mediumslateblue", 0xff7b68ee }, - { "mediumspringgreen", 0xff00fa9a }, - { "mediumturquoise", 0xff48d1cc }, - { "mediumvioletred", 0xffc71585 }, - { "midnightblue", 0xff191970 }, - { "mintcream", 0xfff5fffa }, - { "mistyrose", 0xffffe4e1 }, - { "moccasin", 0xffffe4b5 }, - { "navajowhite", 0xffffdead }, - { "navy", 0xff000080 }, - { "oldlace", 0xfffdf5e6 }, - { "olive", 0xff808000 }, - { "olivedrab", 0xff6b8e23 }, - { "orange", 0xffffa500 }, - { "orangered", 0xffff4500 }, - { "orchid", 0xffda70d6 }, - { "palegoldenrod", 0xffeee8aa }, - { "palegreen", 0xff98fb98 }, - { "paleturquoise", 0xffafeeee }, - { "palevioletred", 0xffd87093 }, - { "papayawhip", 0xffffefd5 }, - { "peachpuff", 0xffffdab9 }, - { "peru", 0xffcd853f }, - { "pink", 0xffffc0cb }, - { "plum", 0xffdda0dd }, - { "powderblue", 0xffb0e0e6 }, - { "purple", 0xff800080 }, - { "red", 0xffff0000 }, - { "rosybrown", 0xffbc8f8f }, - { "royalblue", 0xff4169e1 }, - { "saddlebrown", 0xff8b4513 }, - { "salmon", 0xfffa8072 }, - { "sandybrown", 0xfff4a460 }, - { "seagreen", 0xff2e8b57 }, - { "seashell", 0xfffff5ee }, - { "sienna", 0xffa0522d }, - { "silver", 0xffc0c0c0 }, - { "skyblue", 0xff87ceeb }, - { "slateblue", 0xff6a5acd }, - { "slategray", 0xff708090 }, - { "slategrey", 0xff708090 }, - { "snow", 0xfffffafa }, - { "springgreen", 0xff00ff7f }, - { "steelblue", 0xff4682b4 }, - { "tan", 0xffd2b48c }, - { "teal", 0xff008080 }, - { "thistle", 0xffd8bfd8 }, - { "tomato", 0xffff6347 }, - { "turquoise", 0xff40e0d0 }, - { "violet", 0xffee82ee }, - { "wheat", 0xfff5deb3 }, - { "white", 0xffffffff }, - { "whitesmoke", 0xfff5f5f5 }, - { "yellow", 0xffffff00 }, - { "yellowgreen", 0xff9acd32 } -}; - - -static bool _hslToRgb(float hue, float saturation, float brightness, uint8_t* red, uint8_t* green, uint8_t* blue) -{ - if (!red || !green || !blue) return false; - - float sv, vsf, f, p, q, t, v; - float _red = 0, _green = 0, _blue = 0; - uint32_t i = 0; - - if (mathZero(saturation)) _red = _green = _blue = brightness; - else { - if (mathEqual(hue, 360.0)) hue = 0.0f; - hue /= 60.0f; - - v = (brightness <= 0.5f) ? (brightness * (1.0f + saturation)) : (brightness + saturation - (brightness * saturation)); - p = brightness + brightness - v; - - if (!mathZero(v)) sv = (v - p) / v; - else sv = 0; - - i = static_cast(hue); - f = hue - i; - - vsf = v * sv * f; - - t = p + vsf; - q = v - vsf; - - switch (i) { - case 0: { - _red = v; - _green = t; - _blue = p; - break; - } - case 1: { - _red = q; - _green = v; - _blue = p; - break; - } - case 2: { - _red = p; - _green = v; - _blue = t; - break; - } - case 3: { - _red = p; - _green = q; - _blue = v; - break; - } - case 4: { - _red = t; - _green = p; - _blue = v; - break; - } - case 5: { - _red = v; - _green = p; - _blue = q; - break; - } - } - } - - *red = static_cast(roundf(_red * 255.0f)); - *green = static_cast(roundf(_green * 255.0f)); - *blue = static_cast(roundf(_blue * 255.0f)); - - return true; -} - - -static bool _toColor(const char* str, uint8_t* r, uint8_t* g, uint8_t* b, char** ref) -{ - unsigned int len = strlen(str); - char *red, *green, *blue; - unsigned char tr, tg, tb; - - if (len == 4 && str[0] == '#') { - //Case for "#456" should be interpreted as "#445566" - if (isxdigit(str[1]) && isxdigit(str[2]) && isxdigit(str[3])) { - char tmp[3] = { '\0', '\0', '\0' }; - tmp[0] = str[1]; - tmp[1] = str[1]; - *r = strtol(tmp, nullptr, 16); - tmp[0] = str[2]; - tmp[1] = str[2]; - *g = strtol(tmp, nullptr, 16); - tmp[0] = str[3]; - tmp[1] = str[3]; - *b = strtol(tmp, nullptr, 16); - } - return true; - } else if (len == 7 && str[0] == '#') { - if (isxdigit(str[1]) && isxdigit(str[2]) && isxdigit(str[3]) && isxdigit(str[4]) && isxdigit(str[5]) && isxdigit(str[6])) { - char tmp[3] = { '\0', '\0', '\0' }; - tmp[0] = str[1]; - tmp[1] = str[2]; - *r = strtol(tmp, nullptr, 16); - tmp[0] = str[3]; - tmp[1] = str[4]; - *g = strtol(tmp, nullptr, 16); - tmp[0] = str[5]; - tmp[1] = str[6]; - *b = strtol(tmp, nullptr, 16); - } - return true; - } else if (len >= 10 && (str[0] == 'r' || str[0] == 'R') && (str[1] == 'g' || str[1] == 'G') && (str[2] == 'b' || str[2] == 'B') && str[3] == '(' && str[len - 1] == ')') { - tr = _parseColor(str + 4, &red); - if (red && *red == ',') { - tg = _parseColor(red + 1, &green); - if (green && *green == ',') { - tb = _parseColor(green + 1, &blue); - if (blue && blue[0] == ')' && blue[1] == '\0') { - *r = tr; - *g = tg; - *b = tb; - } - } - } - return true; - } else if (ref && len >= 3 && !strncmp(str, "url", 3)) { - if (*ref) free(*ref); - *ref = _idFromUrl((const char*)(str + 3)); - return true; - } else if (len >= 10 && (str[0] == 'h' || str[0] == 'H') && (str[1] == 's' || str[1] == 'S') && (str[2] == 'l' || str[2] == 'L') && str[3] == '(' && str[len - 1] == ')') { - float th, ts, tb; - const char *content, *hue, *saturation, *brightness; - content = str + 4; - content = _skipSpace(content, nullptr); - if (_parseNumber(&content, &hue, &th) && hue) { - th = float(uint32_t(th) % 360); - hue = _skipSpace(hue, nullptr); - hue = (char*)_skipComma(hue); - hue = _skipSpace(hue, nullptr); - if (_parseNumber(&hue, &saturation, &ts) && saturation && *saturation == '%') { - ts /= 100.0f; - saturation = _skipSpace(saturation + 1, nullptr); - saturation = (char*)_skipComma(saturation); - saturation = _skipSpace(saturation, nullptr); - if (_parseNumber(&saturation, &brightness, &tb) && brightness && *brightness == '%') { - tb /= 100.0f; - brightness = _skipSpace(brightness + 1, nullptr); - if (brightness && brightness[0] == ')' && brightness[1] == '\0') { - return _hslToRgb(th, ts, tb, r, g, b); - } - } - } - } - } else { - //Handle named color - for (unsigned int i = 0; i < (sizeof(colors) / sizeof(colors[0])); i++) { - if (!strcasecmp(colors[i].name, str)) { - *r = (((uint8_t*)(&(colors[i].value)))[2]); - *g = (((uint8_t*)(&(colors[i].value)))[1]); - *b = (((uint8_t*)(&(colors[i].value)))[0]); - return true; - } - } - } - return false; -} - - -static char* _parseNumbersArray(char* str, float* points, int* ptCount, int len) -{ - int count = 0; - char* end = nullptr; - - str = _skipSpace(str, nullptr); - while ((count < len) && (isdigit(*str) || *str == '-' || *str == '+' || *str == '.')) { - points[count++] = strToFloat(str, &end); - str = end; - str = _skipSpace(str, nullptr); - if (*str == ',') ++str; - //Eat the rest of space - str = _skipSpace(str, nullptr); - } - *ptCount = count; - return str; -} - - -enum class MatrixState { - Unknown, - Matrix, - Translate, - Rotate, - Scale, - SkewX, - SkewY -}; - - -#define MATRIX_DEF(Name, Value) \ - { \ -#Name, sizeof(#Name), Value \ - } - - -static constexpr struct -{ - const char* tag; - int sz; - MatrixState state; -} matrixTags[] = { - MATRIX_DEF(matrix, MatrixState::Matrix), - MATRIX_DEF(translate, MatrixState::Translate), - MATRIX_DEF(rotate, MatrixState::Rotate), - MATRIX_DEF(scale, MatrixState::Scale), - MATRIX_DEF(skewX, MatrixState::SkewX), - MATRIX_DEF(skewY, MatrixState::SkewY) -}; - - -/* parse transform attribute - * https://www.w3.org/TR/SVG/coords.html#TransformAttribute - */ -static Matrix* _parseTransformationMatrix(const char* value) -{ - const int POINT_CNT = 8; - - auto matrix = (Matrix*)malloc(sizeof(Matrix)); - if (!matrix) return nullptr; - *matrix = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - - float points[POINT_CNT]; - int ptCount = 0; - char* str = (char*)value; - char* end = str + strlen(str); - - while (str < end) { - auto state = MatrixState::Unknown; - - if (isspace(*str) || (*str == ',')) { - ++str; - continue; - } - for (unsigned int i = 0; i < sizeof(matrixTags) / sizeof(matrixTags[0]); i++) { - if (!strncmp(matrixTags[i].tag, str, matrixTags[i].sz - 1)) { - state = matrixTags[i].state; - str += (matrixTags[i].sz - 1); - break; - } - } - if (state == MatrixState::Unknown) goto error; - - str = _skipSpace(str, end); - if (*str != '(') goto error; - ++str; - str = _parseNumbersArray(str, points, &ptCount, POINT_CNT); - if (*str != ')') goto error; - ++str; - - if (state == MatrixState::Matrix) { - if (ptCount != 6) goto error; - Matrix tmp = {points[0], points[2], points[4], points[1], points[3], points[5], 0, 0, 1}; - *matrix = mathMultiply(matrix, &tmp); - } else if (state == MatrixState::Translate) { - if (ptCount == 1) { - Matrix tmp = {1, 0, points[0], 0, 1, 0, 0, 0, 1}; - *matrix = mathMultiply(matrix, &tmp); - } else if (ptCount == 2) { - Matrix tmp = {1, 0, points[0], 0, 1, points[1], 0, 0, 1}; - *matrix = mathMultiply(matrix, &tmp); - } else goto error; - } else if (state == MatrixState::Rotate) { - //Transform to signed. - points[0] = fmodf(points[0], 360.0f); - if (points[0] < 0) points[0] += 360.0f; - auto c = cosf(mathDeg2Rad(points[0])); - auto s = sinf(mathDeg2Rad(points[0])); - if (ptCount == 1) { - Matrix tmp = { c, -s, 0, s, c, 0, 0, 0, 1 }; - *matrix = mathMultiply(matrix, &tmp); - } else if (ptCount == 3) { - Matrix tmp = { 1, 0, points[1], 0, 1, points[2], 0, 0, 1 }; - *matrix = mathMultiply(matrix, &tmp); - tmp = { c, -s, 0, s, c, 0, 0, 0, 1 }; - *matrix = mathMultiply(matrix, &tmp); - tmp = { 1, 0, -points[1], 0, 1, -points[2], 0, 0, 1 }; - *matrix = mathMultiply(matrix, &tmp); - } else { - goto error; - } - } else if (state == MatrixState::Scale) { - if (ptCount < 1 || ptCount > 2) goto error; - auto sx = points[0]; - auto sy = sx; - if (ptCount == 2) sy = points[1]; - Matrix tmp = { sx, 0, 0, 0, sy, 0, 0, 0, 1 }; - *matrix = mathMultiply(matrix, &tmp); - } else if (state == MatrixState::SkewX) { - if (ptCount != 1) goto error; - auto deg = tanf(mathDeg2Rad(points[0])); - Matrix tmp = { 1, deg, 0, 0, 1, 0, 0, 0, 1 }; - *matrix = mathMultiply(matrix, &tmp); - } else if (state == MatrixState::SkewY) { - if (ptCount != 1) goto error; - auto deg = tanf(mathDeg2Rad(points[0])); - Matrix tmp = { 1, 0, 0, deg, 1, 0, 0, 0, 1 }; - *matrix = mathMultiply(matrix, &tmp); - } - } - return matrix; -error: - if (matrix) free(matrix); - return nullptr; -} - - -#define LENGTH_DEF(Name, Value) \ - { \ -#Name, sizeof(#Name), Value \ - } - - -static void _postpone(Array& nodes, SvgNode *node, char* id) -{ - nodes.push({node, id}); -} - - -/* -// TODO - remove? -static constexpr struct -{ - const char* tag; - int sz; - SvgLengthType type; -} lengthTags[] = { - LENGTH_DEF(%, SvgLengthType::Percent), - LENGTH_DEF(px, SvgLengthType::Px), - LENGTH_DEF(pc, SvgLengthType::Pc), - LENGTH_DEF(pt, SvgLengthType::Pt), - LENGTH_DEF(mm, SvgLengthType::Mm), - LENGTH_DEF(cm, SvgLengthType::Cm), - LENGTH_DEF(in, SvgLengthType::In) -}; - -static float _parseLength(const char* str, SvgLengthType* type) -{ - float value; - int sz = strlen(str); - - *type = SvgLengthType::Px; - for (unsigned int i = 0; i < sizeof(lengthTags) / sizeof(lengthTags[0]); i++) { - if (lengthTags[i].sz - 1 == sz && !strncmp(lengthTags[i].tag, str, sz)) *type = lengthTags[i].type; - } - value = svgUtilStrtof(str, nullptr); - return value; -} -*/ - -static bool _parseStyleAttr(void* data, const char* key, const char* value); -static bool _parseStyleAttr(void* data, const char* key, const char* value, bool style); - - -static bool _attrParseSvgNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - SvgDocNode* doc = &(node->node.doc); - - if (!strcmp(key, "width")) { - doc->w = _toFloat(loader->svgParse, value, SvgParserLengthType::Horizontal); - if (strstr(value, "%") && !(doc->viewFlag & SvgViewFlag::Viewbox)) { - doc->viewFlag = (doc->viewFlag | SvgViewFlag::WidthInPercent); - } else { - doc->viewFlag = (doc->viewFlag | SvgViewFlag::Width); - } - } else if (!strcmp(key, "height")) { - doc->h = _toFloat(loader->svgParse, value, SvgParserLengthType::Vertical); - if (strstr(value, "%") && !(doc->viewFlag & SvgViewFlag::Viewbox)) { - doc->viewFlag = (doc->viewFlag | SvgViewFlag::HeightInPercent); - } else { - doc->viewFlag = (doc->viewFlag | SvgViewFlag::Height); - } - } else if (!strcmp(key, "viewBox")) { - if (_parseNumber(&value, nullptr, &doc->vx)) { - if (_parseNumber(&value, nullptr, &doc->vy)) { - if (_parseNumber(&value, nullptr, &doc->vw)) { - if (_parseNumber(&value, nullptr, &doc->vh)) { - doc->viewFlag = (doc->viewFlag | SvgViewFlag::Viewbox); - loader->svgParse->global.h = doc->vh; - } - loader->svgParse->global.w = doc->vw; - } - loader->svgParse->global.y = doc->vy; - } - loader->svgParse->global.x = doc->vx; - } - if ((doc->viewFlag & SvgViewFlag::Viewbox) && (doc->vw < 0.0f || doc->vh < 0.0f)) { - doc->viewFlag = (SvgViewFlag)((uint32_t)doc->viewFlag & ~(uint32_t)SvgViewFlag::Viewbox); - TVGLOG("SVG", "Negative values of the width and/or height - the attribute invalidated."); - } - if (!(doc->viewFlag & SvgViewFlag::Viewbox)) { - loader->svgParse->global.x = loader->svgParse->global.y = 0.0f; - loader->svgParse->global.w = loader->svgParse->global.h = 1.0f; - } - } else if (!strcmp(key, "preserveAspectRatio")) { - _parseAspectRatio(&value, &doc->align, &doc->meetOrSlice); - } else if (!strcmp(key, "style")) { - return simpleXmlParseW3CAttribute(value, strlen(value), _parseStyleAttr, loader); -#ifdef THORVG_LOG_ENABLED - } else if ((!strcmp(key, "x") || !strcmp(key, "y")) && fabsf(strToFloat(value, nullptr)) > FLOAT_EPSILON) { - TVGLOG("SVG", "Unsupported attributes used [Elements type: Svg][Attribute: %s][Value: %s]", key, value); -#endif - } else { - return _parseStyleAttr(loader, key, value, false); - } - return true; -} - - -//https://www.w3.org/TR/SVGTiny12/painting.html#SpecifyingPaint -static void _handlePaintAttr(SvgPaint* paint, const char* value) -{ - if (!strcmp(value, "none")) { - //No paint property - paint->none = true; - return; - } - if (!strcmp(value, "currentColor")) { - paint->curColor = true; - paint->none = false; - return; - } - if (_toColor(value, &paint->color.r, &paint->color.g, &paint->color.b, &paint->url)) paint->none = false; -} - - -static void _handleColorAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - SvgStyleProperty* style = node->style; - if (_toColor(value, &style->color.r, &style->color.g, &style->color.b, nullptr)) { - style->curColorSet = true; - } -} - - -static void _handleFillAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - SvgStyleProperty* style = node->style; - style->fill.flags = (style->fill.flags | SvgFillFlags::Paint); - _handlePaintAttr(&style->fill.paint, value); -} - - -static void _handleStrokeAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - SvgStyleProperty* style = node->style; - style->stroke.flags = (style->stroke.flags | SvgStrokeFlags::Paint); - _handlePaintAttr(&style->stroke.paint, value); -} - - -static void _handleStrokeOpacityAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->style->stroke.flags = (node->style->stroke.flags | SvgStrokeFlags::Opacity); - node->style->stroke.opacity = _toOpacity(value); -} - -static void _handleStrokeDashArrayAttr(SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->style->stroke.flags = (node->style->stroke.flags | SvgStrokeFlags::Dash); - _parseDashArray(loader, value, &node->style->stroke.dash); -} - -static void _handleStrokeDashOffsetAttr(SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->style->stroke.flags = (node->style->stroke.flags | SvgStrokeFlags::DashOffset); - node->style->stroke.dash.offset = _toFloat(loader->svgParse, value, SvgParserLengthType::Horizontal); -} - -static void _handleStrokeWidthAttr(SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->style->stroke.flags = (node->style->stroke.flags | SvgStrokeFlags::Width); - node->style->stroke.width = _toFloat(loader->svgParse, value, SvgParserLengthType::Horizontal); -} - - -static void _handleStrokeLineCapAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->style->stroke.flags = (node->style->stroke.flags | SvgStrokeFlags::Cap); - node->style->stroke.cap = _toLineCap(value); -} - - -static void _handleStrokeLineJoinAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->style->stroke.flags = (node->style->stroke.flags | SvgStrokeFlags::Join); - node->style->stroke.join = _toLineJoin(value); -} - -static void _handleStrokeMiterlimitAttr(SvgLoaderData* loader, SvgNode* node, const char* value) -{ - char* end = nullptr; - const float miterlimit = strToFloat(value, &end); - - // https://www.w3.org/TR/SVG2/painting.html#LineJoin - // - A negative value for stroke-miterlimit must be treated as an illegal value. - if (miterlimit < 0.0f) { - TVGERR("SVG", "A stroke-miterlimit change (%f <- %f) with a negative value is omitted.", - node->style->stroke.miterlimit, miterlimit); - return; - } - - node->style->stroke.flags = (node->style->stroke.flags | SvgStrokeFlags::Miterlimit); - node->style->stroke.miterlimit = miterlimit; -} - -static void _handleFillRuleAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->style->fill.flags = (node->style->fill.flags | SvgFillFlags::FillRule); - node->style->fill.fillRule = _toFillRule(value); -} - - -static void _handleOpacityAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->style->flags = (node->style->flags | SvgStyleFlags::Opacity); - node->style->opacity = _toOpacity(value); -} - - -static void _handleFillOpacityAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->style->fill.flags = (node->style->fill.flags | SvgFillFlags::Opacity); - node->style->fill.opacity = _toOpacity(value); -} - - -static void _handleTransformAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->transform = _parseTransformationMatrix(value); -} - - -static void _handleClipPathAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - SvgStyleProperty* style = node->style; - int len = strlen(value); - if (len >= 3 && !strncmp(value, "url", 3)) { - if (style->clipPath.url) free(style->clipPath.url); - style->clipPath.url = _idFromUrl((const char*)(value + 3)); - } -} - - -static void _handleMaskAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - SvgStyleProperty* style = node->style; - int len = strlen(value); - if (len >= 3 && !strncmp(value, "url", 3)) { - if (style->mask.url) free(style->mask.url); - style->mask.url = _idFromUrl((const char*)(value + 3)); - } -} - - -static void _handleMaskTypeAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->node.mask.type = _toMaskType(value); -} - - -static void _handleDisplayAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - //TODO : The display attribute can have various values as well as "none". - // The default is "inline" which means visible and "none" means invisible. - // Depending on the type of node, additional functionality may be required. - // refer to https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/display - node->style->flags = (node->style->flags | SvgStyleFlags::Display); - if (!strcmp(value, "none")) node->style->display = false; - else node->style->display = true; -} - - -static void _handlePaintOrderAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value) -{ - node->style->flags = (node->style->flags | SvgStyleFlags::PaintOrder); - node->style->paintOrder = _toPaintOrder(value); -} - - -static void _handleCssClassAttr(SvgLoaderData* loader, SvgNode* node, const char* value) -{ - auto cssClass = &node->style->cssClass; - - if (*cssClass && value) free(*cssClass); - *cssClass = _copyId(value); - - bool cssClassFound = false; - - //css styling: tag.name has higher priority than .name - if (auto cssNode = cssFindStyleNode(loader->cssStyle, *cssClass, node->type)) { - cssClassFound = true; - cssCopyStyleAttr(node, cssNode); - } - if (auto cssNode = cssFindStyleNode(loader->cssStyle, *cssClass)) { - cssClassFound = true; - cssCopyStyleAttr(node, cssNode); - } - - if (!cssClassFound) _postpone(loader->nodesToStyle, node, *cssClass); -} - - -typedef void (*styleMethod)(SvgLoaderData* loader, SvgNode* node, const char* value); - -#define STYLE_DEF(Name, Name1, Flag) { #Name, sizeof(#Name), _handle##Name1##Attr, Flag } - - -static constexpr struct -{ - const char* tag; - int sz; - styleMethod tagHandler; - SvgStyleFlags flag; -} styleTags[] = { - STYLE_DEF(color, Color, SvgStyleFlags::Color), - STYLE_DEF(fill, Fill, SvgStyleFlags::Fill), - STYLE_DEF(fill-rule, FillRule, SvgStyleFlags::FillRule), - STYLE_DEF(fill-opacity, FillOpacity, SvgStyleFlags::FillOpacity), - STYLE_DEF(opacity, Opacity, SvgStyleFlags::Opacity), - STYLE_DEF(stroke, Stroke, SvgStyleFlags::Stroke), - STYLE_DEF(stroke-width, StrokeWidth, SvgStyleFlags::StrokeWidth), - STYLE_DEF(stroke-linejoin, StrokeLineJoin, SvgStyleFlags::StrokeLineJoin), - STYLE_DEF(stroke-miterlimit, StrokeMiterlimit, SvgStyleFlags::StrokeMiterlimit), - STYLE_DEF(stroke-linecap, StrokeLineCap, SvgStyleFlags::StrokeLineCap), - STYLE_DEF(stroke-opacity, StrokeOpacity, SvgStyleFlags::StrokeOpacity), - STYLE_DEF(stroke-dasharray, StrokeDashArray, SvgStyleFlags::StrokeDashArray), - STYLE_DEF(stroke-dashoffset, StrokeDashOffset, SvgStyleFlags::StrokeDashOffset), - STYLE_DEF(transform, Transform, SvgStyleFlags::Transform), - STYLE_DEF(clip-path, ClipPath, SvgStyleFlags::ClipPath), - STYLE_DEF(mask, Mask, SvgStyleFlags::Mask), - STYLE_DEF(mask-type, MaskType, SvgStyleFlags::MaskType), - STYLE_DEF(display, Display, SvgStyleFlags::Display), - STYLE_DEF(paint-order, PaintOrder, SvgStyleFlags::PaintOrder) -}; - - -static bool _parseStyleAttr(void* data, const char* key, const char* value, bool style) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - int sz; - if (!key || !value) return false; - - //Trim the white space - key = _skipSpace(key, nullptr); - value = _skipSpace(value, nullptr); - - sz = strlen(key); - for (unsigned int i = 0; i < sizeof(styleTags) / sizeof(styleTags[0]); i++) { - if (styleTags[i].sz - 1 == sz && !strncmp(styleTags[i].tag, key, sz)) { - bool importance = false; - if (auto ptr = strstr(value, "!important")) { - size_t size = ptr - value; - while (size > 0 && isspace(value[size - 1])) { - size--; - } - value = strDuplicate(value, size); - importance = true; - } - if (style) { - if (importance || !(node->style->flagsImportance & styleTags[i].flag)) { - styleTags[i].tagHandler(loader, node, value); - node->style->flags = (node->style->flags | styleTags[i].flag); - } - } else if (!(node->style->flags & styleTags[i].flag)) { - styleTags[i].tagHandler(loader, node, value); - } - if (importance) { - node->style->flagsImportance = (node->style->flags | styleTags[i].flag); - free(const_cast(value)); - } - return true; - } - } - - return false; -} - - -static bool _parseStyleAttr(void* data, const char* key, const char* value) -{ - return _parseStyleAttr(data, key, value, true); -} - - -/* parse g node - * https://www.w3.org/TR/SVG/struct.html#Groups - */ -static bool _attrParseGNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - - if (!strcmp(key, "style")) { - return simpleXmlParseW3CAttribute(value, strlen(value), _parseStyleAttr, loader); - } else if (!strcmp(key, "transform")) { - node->transform = _parseTransformationMatrix(value); - } else if (!strcmp(key, "id")) { - if (node->id && value) free(node->id); - node->id = _copyId(value); - } else if (!strcmp(key, "class")) { - _handleCssClassAttr(loader, node, value); - } else if (!strcmp(key, "clip-path")) { - _handleClipPathAttr(loader, node, value); - } else if (!strcmp(key, "mask")) { - _handleMaskAttr(loader, node, value); - } else { - return _parseStyleAttr(loader, key, value, false); - } - return true; -} - - -/* parse clipPath node - * https://www.w3.org/TR/SVG/struct.html#Groups - */ -static bool _attrParseClipPathNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - SvgClipNode* clip = &(node->node.clip); - - if (!strcmp(key, "style")) { - return simpleXmlParseW3CAttribute(value, strlen(value), _parseStyleAttr, loader); - } else if (!strcmp(key, "transform")) { - node->transform = _parseTransformationMatrix(value); - } else if (!strcmp(key, "id")) { - if (node->id && value) free(node->id); - node->id = _copyId(value); - } else if (!strcmp(key, "class")) { - _handleCssClassAttr(loader, node, value); - } else if (!strcmp(key, "clipPathUnits")) { - if (!strcmp(value, "objectBoundingBox")) clip->userSpace = false; - } else { - return _parseStyleAttr(loader, key, value, false); - } - return true; -} - - -static bool _attrParseMaskNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - SvgMaskNode* mask = &(node->node.mask); - - if (!strcmp(key, "style")) { - return simpleXmlParseW3CAttribute(value, strlen(value), _parseStyleAttr, loader); - } else if (!strcmp(key, "transform")) { - node->transform = _parseTransformationMatrix(value); - } else if (!strcmp(key, "id")) { - if (node->id && value) free(node->id); - node->id = _copyId(value); - } else if (!strcmp(key, "class")) { - _handleCssClassAttr(loader, node, value); - } else if (!strcmp(key, "maskContentUnits")) { - if (!strcmp(value, "objectBoundingBox")) mask->userSpace = false; - } else if (!strcmp(key, "mask-type")) { - mask->type = _toMaskType(value); - } else { - return _parseStyleAttr(loader, key, value, false); - } - return true; -} - - -static bool _attrParseCssStyleNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - - if (!strcmp(key, "id")) { - if (node->id && value) free(node->id); - node->id = _copyId(value); - } else { - return _parseStyleAttr(loader, key, value, false); - } - return true; -} - - -static bool _attrParseSymbolNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - SvgSymbolNode* symbol = &(node->node.symbol); - - if (!strcmp(key, "viewBox")) { - if (!_parseNumber(&value, nullptr, &symbol->vx) || !_parseNumber(&value, nullptr, &symbol->vy)) return false; - if (!_parseNumber(&value, nullptr, &symbol->vw) || !_parseNumber(&value, nullptr, &symbol->vh)) return false; - symbol->hasViewBox = true; - } else if (!strcmp(key, "width")) { - symbol->w = _toFloat(loader->svgParse, value, SvgParserLengthType::Horizontal); - symbol->hasWidth = true; - } else if (!strcmp(key, "height")) { - symbol->h = _toFloat(loader->svgParse, value, SvgParserLengthType::Vertical); - symbol->hasHeight = true; - } else if (!strcmp(key, "preserveAspectRatio")) { - _parseAspectRatio(&value, &symbol->align, &symbol->meetOrSlice); - } else if (!strcmp(key, "overflow")) { - if (!strcmp(value, "visible")) symbol->overflowVisible = true; - } else { - return _attrParseGNode(data, key, value); - } - - return true; -} - - -static SvgNode* _createNode(SvgNode* parent, SvgNodeType type) -{ - SvgNode* node = (SvgNode*)calloc(1, sizeof(SvgNode)); - - if (!node) return nullptr; - - //Default fill property - node->style = (SvgStyleProperty*)calloc(1, sizeof(SvgStyleProperty)); - - if (!node->style) { - free(node); - return nullptr; - } - - //Update the default value of stroke and fill - //https://www.w3.org/TR/SVGTiny12/painting.html#SpecifyingPaint - node->style->fill.paint.none = false; - //Default fill opacity is 1 - node->style->fill.opacity = 255; - node->style->opacity = 255; - //Default current color is not set - node->style->fill.paint.curColor = false; - node->style->curColorSet = false; - //Default fill rule is nonzero - node->style->fill.fillRule = FillRule::Winding; - - //Default stroke is none - node->style->stroke.paint.none = true; - //Default stroke opacity is 1 - node->style->stroke.opacity = 255; - //Default stroke current color is not set - node->style->stroke.paint.curColor = false; - //Default stroke width is 1 - node->style->stroke.width = 1; - //Default line cap is butt - node->style->stroke.cap = StrokeCap::Butt; - //Default line join is miter - node->style->stroke.join = StrokeJoin::Miter; - node->style->stroke.miterlimit = 4.0f; - node->style->stroke.scale = 1.0; - - node->style->paintOrder = _toPaintOrder("fill stroke"); - - //Default display is true("inline"). - node->style->display = true; - - node->parent = parent; - node->type = type; - - if (parent) parent->child.push(node); - return node; -} - - -static SvgNode* _createDefsNode(TVG_UNUSED SvgLoaderData* loader, TVG_UNUSED SvgNode* parent, const char* buf, unsigned bufLength, TVG_UNUSED parseAttributes func) -{ - if (loader->def && loader->doc->node.doc.defs) return loader->def; - SvgNode* node = _createNode(nullptr, SvgNodeType::Defs); - - loader->def = node; - loader->doc->node.doc.defs = node; - return node; -} - - -static SvgNode* _createGNode(TVG_UNUSED SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::G); - if (!loader->svgParse->node) return nullptr; - - func(buf, bufLength, _attrParseGNode, loader); - return loader->svgParse->node; -} - - -static SvgNode* _createSvgNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Doc); - if (!loader->svgParse->node) return nullptr; - SvgDocNode* doc = &(loader->svgParse->node->node.doc); - - loader->svgParse->global.w = 1.0f; - loader->svgParse->global.h = 1.0f; - - doc->align = AspectRatioAlign::XMidYMid; - doc->meetOrSlice = AspectRatioMeetOrSlice::Meet; - doc->viewFlag = SvgViewFlag::None; - func(buf, bufLength, _attrParseSvgNode, loader); - - if (!(doc->viewFlag & SvgViewFlag::Viewbox)) { - if (doc->viewFlag & SvgViewFlag::Width) { - loader->svgParse->global.w = doc->w; - } - if (doc->viewFlag & SvgViewFlag::Height) { - loader->svgParse->global.h = doc->h; - } - } - return loader->svgParse->node; -} - - -static SvgNode* _createMaskNode(SvgLoaderData* loader, SvgNode* parent, TVG_UNUSED const char* buf, TVG_UNUSED unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Mask); - if (!loader->svgParse->node) return nullptr; - - loader->svgParse->node->node.mask.userSpace = true; - loader->svgParse->node->node.mask.type = SvgMaskType::Luminance; - - func(buf, bufLength, _attrParseMaskNode, loader); - - return loader->svgParse->node; -} - - -static SvgNode* _createClipPathNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::ClipPath); - if (!loader->svgParse->node) return nullptr; - - loader->svgParse->node->style->display = false; - loader->svgParse->node->node.clip.userSpace = true; - - func(buf, bufLength, _attrParseClipPathNode, loader); - - return loader->svgParse->node; -} - - -static SvgNode* _createCssStyleNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::CssStyle); - if (!loader->svgParse->node) return nullptr; - - func(buf, bufLength, _attrParseCssStyleNode, loader); - - return loader->svgParse->node; -} - - -static SvgNode* _createSymbolNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Symbol); - if (!loader->svgParse->node) return nullptr; - - loader->svgParse->node->node.symbol.align = AspectRatioAlign::XMidYMid; - loader->svgParse->node->node.symbol.meetOrSlice = AspectRatioMeetOrSlice::Meet; - loader->svgParse->node->node.symbol.overflowVisible = false; - - loader->svgParse->node->node.symbol.hasViewBox = false; - loader->svgParse->node->node.symbol.hasWidth = false; - loader->svgParse->node->node.symbol.hasHeight = false; - loader->svgParse->node->node.symbol.vx = 0.0f; - loader->svgParse->node->node.symbol.vy = 0.0f; - - func(buf, bufLength, _attrParseSymbolNode, loader); - - return loader->svgParse->node; -} - - -static bool _attrParsePathNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - SvgPathNode* path = &(node->node.path); - - if (!strcmp(key, "d")) { - if (path->path) free(path->path); - //Temporary: need to copy - path->path = _copyId(value); - } else if (!strcmp(key, "style")) { - return simpleXmlParseW3CAttribute(value, strlen(value), _parseStyleAttr, loader); - } else if (!strcmp(key, "clip-path")) { - _handleClipPathAttr(loader, node, value); - } else if (!strcmp(key, "mask")) { - _handleMaskAttr(loader, node, value); - } else if (!strcmp(key, "id")) { - if (node->id && value) free(node->id); - node->id = _copyId(value); - } else if (!strcmp(key, "class")) { - _handleCssClassAttr(loader, node, value); - } else { - return _parseStyleAttr(loader, key, value, false); - } - return true; -} - - -static SvgNode* _createPathNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Path); - - if (!loader->svgParse->node) return nullptr; - - func(buf, bufLength, _attrParsePathNode, loader); - - return loader->svgParse->node; -} - - -static constexpr struct -{ - const char* tag; - SvgParserLengthType type; - int sz; - size_t offset; -} circleTags[] = { - {"cx", SvgParserLengthType::Horizontal, sizeof("cx"), offsetof(SvgCircleNode, cx)}, - {"cy", SvgParserLengthType::Vertical, sizeof("cy"), offsetof(SvgCircleNode, cy)}, - {"r", SvgParserLengthType::Other, sizeof("r"), offsetof(SvgCircleNode, r)} -}; - - -/* parse the attributes for a circle element. - * https://www.w3.org/TR/SVG/shapes.html#CircleElement - */ -static bool _attrParseCircleNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - SvgCircleNode* circle = &(node->node.circle); - unsigned char* array; - int sz = strlen(key); - - array = (unsigned char*)circle; - for (unsigned int i = 0; i < sizeof(circleTags) / sizeof(circleTags[0]); i++) { - if (circleTags[i].sz - 1 == sz && !strncmp(circleTags[i].tag, key, sz)) { - *((float*)(array + circleTags[i].offset)) = _toFloat(loader->svgParse, value, circleTags[i].type); - return true; - } - } - - if (!strcmp(key, "style")) { - return simpleXmlParseW3CAttribute(value, strlen(value), _parseStyleAttr, loader); - } else if (!strcmp(key, "clip-path")) { - _handleClipPathAttr(loader, node, value); - } else if (!strcmp(key, "mask")) { - _handleMaskAttr(loader, node, value); - } else if (!strcmp(key, "id")) { - if (node->id && value) free(node->id); - node->id = _copyId(value); - } else if (!strcmp(key, "class")) { - _handleCssClassAttr(loader, node, value); - } else { - return _parseStyleAttr(loader, key, value, false); - } - return true; -} - - -static SvgNode* _createCircleNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Circle); - - if (!loader->svgParse->node) return nullptr; - - func(buf, bufLength, _attrParseCircleNode, loader); - return loader->svgParse->node; -} - - -static constexpr struct -{ - const char* tag; - SvgParserLengthType type; - int sz; - size_t offset; -} ellipseTags[] = { - {"cx", SvgParserLengthType::Horizontal, sizeof("cx"), offsetof(SvgEllipseNode, cx)}, - {"cy", SvgParserLengthType::Vertical, sizeof("cy"), offsetof(SvgEllipseNode, cy)}, - {"rx", SvgParserLengthType::Horizontal, sizeof("rx"), offsetof(SvgEllipseNode, rx)}, - {"ry", SvgParserLengthType::Vertical, sizeof("ry"), offsetof(SvgEllipseNode, ry)} -}; - - -/* parse the attributes for an ellipse element. - * https://www.w3.org/TR/SVG/shapes.html#EllipseElement - */ -static bool _attrParseEllipseNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - SvgEllipseNode* ellipse = &(node->node.ellipse); - unsigned char* array; - int sz = strlen(key); - - array = (unsigned char*)ellipse; - for (unsigned int i = 0; i < sizeof(ellipseTags) / sizeof(ellipseTags[0]); i++) { - if (ellipseTags[i].sz - 1 == sz && !strncmp(ellipseTags[i].tag, key, sz)) { - *((float*)(array + ellipseTags[i].offset)) = _toFloat(loader->svgParse, value, ellipseTags[i].type); - return true; - } - } - - if (!strcmp(key, "id")) { - if (node->id && value) free(node->id); - node->id = _copyId(value); - } else if (!strcmp(key, "class")) { - _handleCssClassAttr(loader, node, value); - } else if (!strcmp(key, "style")) { - return simpleXmlParseW3CAttribute(value, strlen(value), _parseStyleAttr, loader); - } else if (!strcmp(key, "clip-path")) { - _handleClipPathAttr(loader, node, value); - } else if (!strcmp(key, "mask")) { - _handleMaskAttr(loader, node, value); - } else { - return _parseStyleAttr(loader, key, value, false); - } - return true; -} - - -static SvgNode* _createEllipseNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Ellipse); - - if (!loader->svgParse->node) return nullptr; - - func(buf, bufLength, _attrParseEllipseNode, loader); - return loader->svgParse->node; -} - - -static bool _attrParsePolygonPoints(const char* str, SvgPolygonNode* polygon) -{ - float num_x, num_y; - while (_parseNumber(&str, nullptr, &num_x) && _parseNumber(&str, nullptr, &num_y)) { - polygon->pts.push(num_x); - polygon->pts.push(num_y); - } - return true; -} - - -/* parse the attributes for a polygon element. - * https://www.w3.org/TR/SVG/shapes.html#PolylineElement - */ -static bool _attrParsePolygonNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - SvgPolygonNode* polygon = nullptr; - - if (node->type == SvgNodeType::Polygon) polygon = &(node->node.polygon); - else polygon = &(node->node.polyline); - - if (!strcmp(key, "points")) { - return _attrParsePolygonPoints(value, polygon); - } else if (!strcmp(key, "style")) { - return simpleXmlParseW3CAttribute(value, strlen(value), _parseStyleAttr, loader); - } else if (!strcmp(key, "clip-path")) { - _handleClipPathAttr(loader, node, value); - } else if (!strcmp(key, "mask")) { - _handleMaskAttr(loader, node, value); - } else if (!strcmp(key, "id")) { - if (node->id && value) free(node->id); - node->id = _copyId(value); - } else if (!strcmp(key, "class")) { - _handleCssClassAttr(loader, node, value); - } else { - return _parseStyleAttr(loader, key, value, false); - } - return true; -} - - -static SvgNode* _createPolygonNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Polygon); - - if (!loader->svgParse->node) return nullptr; - - func(buf, bufLength, _attrParsePolygonNode, loader); - return loader->svgParse->node; -} - - -static SvgNode* _createPolylineNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Polyline); - - if (!loader->svgParse->node) return nullptr; - - func(buf, bufLength, _attrParsePolygonNode, loader); - return loader->svgParse->node; -} - -static constexpr struct -{ - const char* tag; - SvgParserLengthType type; - int sz; - size_t offset; -} rectTags[] = { - {"x", SvgParserLengthType::Horizontal, sizeof("x"), offsetof(SvgRectNode, x)}, - {"y", SvgParserLengthType::Vertical, sizeof("y"), offsetof(SvgRectNode, y)}, - {"width", SvgParserLengthType::Horizontal, sizeof("width"), offsetof(SvgRectNode, w)}, - {"height", SvgParserLengthType::Vertical, sizeof("height"), offsetof(SvgRectNode, h)}, - {"rx", SvgParserLengthType::Horizontal, sizeof("rx"), offsetof(SvgRectNode, rx)}, - {"ry", SvgParserLengthType::Vertical, sizeof("ry"), offsetof(SvgRectNode, ry)} -}; - - -/* parse the attributes for a rect element. - * https://www.w3.org/TR/SVG/shapes.html#RectElement - */ -static bool _attrParseRectNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - SvgRectNode* rect = &(node->node.rect); - unsigned char* array; - bool ret = true; - int sz = strlen(key); - - array = (unsigned char*)rect; - for (unsigned int i = 0; i < sizeof(rectTags) / sizeof(rectTags[0]); i++) { - if (rectTags[i].sz - 1 == sz && !strncmp(rectTags[i].tag, key, sz)) { - *((float*)(array + rectTags[i].offset)) = _toFloat(loader->svgParse, value, rectTags[i].type); - - //Case if only rx or ry is declared - if (!strncmp(rectTags[i].tag, "rx", sz)) rect->hasRx = true; - if (!strncmp(rectTags[i].tag, "ry", sz)) rect->hasRy = true; - - if ((rect->rx >= FLOAT_EPSILON) && (rect->ry < FLOAT_EPSILON) && rect->hasRx && !rect->hasRy) rect->ry = rect->rx; - if ((rect->ry >= FLOAT_EPSILON) && (rect->rx < FLOAT_EPSILON) && !rect->hasRx && rect->hasRy) rect->rx = rect->ry; - return ret; - } - } - - if (!strcmp(key, "id")) { - if (node->id && value) free(node->id); - node->id = _copyId(value); - } else if (!strcmp(key, "class")) { - _handleCssClassAttr(loader, node, value); - } else if (!strcmp(key, "style")) { - ret = simpleXmlParseW3CAttribute(value, strlen(value), _parseStyleAttr, loader); - } else if (!strcmp(key, "clip-path")) { - _handleClipPathAttr(loader, node, value); - } else if (!strcmp(key, "mask")) { - _handleMaskAttr(loader, node, value); - } else { - ret = _parseStyleAttr(loader, key, value, false); - } - - return ret; -} - - -static SvgNode* _createRectNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Rect); - - if (!loader->svgParse->node) return nullptr; - - loader->svgParse->node->node.rect.hasRx = loader->svgParse->node->node.rect.hasRy = false; - - func(buf, bufLength, _attrParseRectNode, loader); - return loader->svgParse->node; -} - - -static constexpr struct -{ - const char* tag; - SvgParserLengthType type; - int sz; - size_t offset; -} lineTags[] = { - {"x1", SvgParserLengthType::Horizontal, sizeof("x1"), offsetof(SvgLineNode, x1)}, - {"y1", SvgParserLengthType::Vertical, sizeof("y1"), offsetof(SvgLineNode, y1)}, - {"x2", SvgParserLengthType::Horizontal, sizeof("x2"), offsetof(SvgLineNode, x2)}, - {"y2", SvgParserLengthType::Vertical, sizeof("y2"), offsetof(SvgLineNode, y2)} -}; - - -/* parse the attributes for a line element. - * https://www.w3.org/TR/SVG/shapes.html#LineElement - */ -static bool _attrParseLineNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - SvgLineNode* line = &(node->node.line); - unsigned char* array; - int sz = strlen(key); - - array = (unsigned char*)line; - for (unsigned int i = 0; i < sizeof(lineTags) / sizeof(lineTags[0]); i++) { - if (lineTags[i].sz - 1 == sz && !strncmp(lineTags[i].tag, key, sz)) { - *((float*)(array + lineTags[i].offset)) = _toFloat(loader->svgParse, value, lineTags[i].type); - return true; - } - } - - if (!strcmp(key, "id")) { - if (node->id && value) free(node->id); - node->id = _copyId(value); - } else if (!strcmp(key, "class")) { - _handleCssClassAttr(loader, node, value); - } else if (!strcmp(key, "style")) { - return simpleXmlParseW3CAttribute(value, strlen(value), _parseStyleAttr, loader); - } else if (!strcmp(key, "clip-path")) { - _handleClipPathAttr(loader, node, value); - } else if (!strcmp(key, "mask")) { - _handleMaskAttr(loader, node, value); - } else { - return _parseStyleAttr(loader, key, value, false); - } - return true; -} - - -static SvgNode* _createLineNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Line); - - if (!loader->svgParse->node) return nullptr; - - func(buf, bufLength, _attrParseLineNode, loader); - return loader->svgParse->node; -} - - -static char* _idFromHref(const char* href) -{ - href = _skipSpace(href, nullptr); - if ((*href) == '#') href++; - return strdup(href); -} - - -static constexpr struct -{ - const char* tag; - SvgParserLengthType type; - int sz; - size_t offset; -} imageTags[] = { - {"x", SvgParserLengthType::Horizontal, sizeof("x"), offsetof(SvgRectNode, x)}, - {"y", SvgParserLengthType::Vertical, sizeof("y"), offsetof(SvgRectNode, y)}, - {"width", SvgParserLengthType::Horizontal, sizeof("width"), offsetof(SvgRectNode, w)}, - {"height", SvgParserLengthType::Vertical, sizeof("height"), offsetof(SvgRectNode, h)}, -}; - - -/* parse the attributes for a image element. - * https://www.w3.org/TR/SVG/embedded.html#ImageElement - */ -static bool _attrParseImageNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode* node = loader->svgParse->node; - SvgImageNode* image = &(node->node.image); - unsigned char* array; - int sz = strlen(key); - - array = (unsigned char*)image; - for (unsigned int i = 0; i < sizeof(imageTags) / sizeof(imageTags[0]); i++) { - if (imageTags[i].sz - 1 == sz && !strncmp(imageTags[i].tag, key, sz)) { - *((float*)(array + imageTags[i].offset)) = _toFloat(loader->svgParse, value, imageTags[i].type); - return true; - } - } - - if (!strcmp(key, "href") || !strcmp(key, "xlink:href")) { - if (image->href && value) free(image->href); - image->href = _idFromHref(value); - } else if (!strcmp(key, "id")) { - if (node->id && value) free(node->id); - node->id = _copyId(value); - } else if (!strcmp(key, "class")) { - _handleCssClassAttr(loader, node, value); - } else if (!strcmp(key, "style")) { - return simpleXmlParseW3CAttribute(value, strlen(value), _parseStyleAttr, loader); - } else if (!strcmp(key, "clip-path")) { - _handleClipPathAttr(loader, node, value); - } else if (!strcmp(key, "mask")) { - _handleMaskAttr(loader, node, value); - } else if (!strcmp(key, "transform")) { - node->transform = _parseTransformationMatrix(value); - } else { - return _parseStyleAttr(loader, key, value); - } - return true; -} - - -static SvgNode* _createImageNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Image); - - if (!loader->svgParse->node) return nullptr; - - func(buf, bufLength, _attrParseImageNode, loader); - return loader->svgParse->node; -} - - -static SvgNode* _getDefsNode(SvgNode* node) -{ - if (!node) return nullptr; - - while (node->parent != nullptr) { - node = node->parent; - } - - if (node->type == SvgNodeType::Doc) return node->node.doc.defs; - if (node->type == SvgNodeType::Defs) return node; - - return nullptr; -} - - -static SvgNode* _findNodeById(SvgNode *node, const char* id) -{ - if (!node) return nullptr; - - SvgNode* result = nullptr; - if (node->id && !strcmp(node->id, id)) return node; - - if (node->child.count > 0) { - auto child = node->child.data; - for (uint32_t i = 0; i < node->child.count; ++i, ++child) { - result = _findNodeById(*child, id); - if (result) break; - } - } - return result; -} - - -static SvgNode* _findParentById(SvgNode* node, char* id, SvgNode* doc) -{ - SvgNode *parent = node->parent; - while (parent != nullptr && parent != doc) { - if (parent->id && !strcmp(parent->id, id)) { - return parent; - } - parent = parent->parent; - } - return nullptr; -} - - -static constexpr struct -{ - const char* tag; - SvgParserLengthType type; - int sz; - size_t offset; -} useTags[] = { - {"x", SvgParserLengthType::Horizontal, sizeof("x"), offsetof(SvgUseNode, x)}, - {"y", SvgParserLengthType::Vertical, sizeof("y"), offsetof(SvgUseNode, y)}, - {"width", SvgParserLengthType::Horizontal, sizeof("width"), offsetof(SvgUseNode, w)}, - {"height", SvgParserLengthType::Vertical, sizeof("height"), offsetof(SvgUseNode, h)} -}; - - -static void _cloneNode(SvgNode* from, SvgNode* parent, int depth); -static bool _attrParseUseNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgNode *defs, *nodeFrom, *node = loader->svgParse->node; - char* id; - - SvgUseNode* use = &(node->node.use); - int sz = strlen(key); - unsigned char* array = (unsigned char*)use; - for (unsigned int i = 0; i < sizeof(useTags) / sizeof(useTags[0]); i++) { - if (useTags[i].sz - 1 == sz && !strncmp(useTags[i].tag, key, sz)) { - *((float*)(array + useTags[i].offset)) = _toFloat(loader->svgParse, value, useTags[i].type); - - if (useTags[i].offset == offsetof(SvgUseNode, w)) use->isWidthSet = true; - else if (useTags[i].offset == offsetof(SvgUseNode, h)) use->isHeightSet = true; - - return true; - } - } - - if (!strcmp(key, "href") || !strcmp(key, "xlink:href")) { - id = _idFromHref(value); - defs = _getDefsNode(node); - nodeFrom = _findNodeById(defs, id); - if (nodeFrom) { - if (!_findParentById(node, id, loader->doc)) { - _cloneNode(nodeFrom, node, 0); - if (nodeFrom->type == SvgNodeType::Symbol) use->symbol = nodeFrom; - } else { - TVGLOG("SVG", "%s is ancestor element. This reference is invalid.", id); - } - free(id); - } else { - //some svg export software include element at the end of the file - //if so the 'from' element won't be found now and we have to repeat finding - //after the whole file is parsed - _postpone(loader->cloneNodes, node, id); - } - } else { - return _attrParseGNode(data, key, value); - } - return true; -} - - -static SvgNode* _createUseNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength, parseAttributes func) -{ - loader->svgParse->node = _createNode(parent, SvgNodeType::Use); - - if (!loader->svgParse->node) return nullptr; - - loader->svgParse->node->node.use.isWidthSet = false; - loader->svgParse->node->node.use.isHeightSet = false; - - func(buf, bufLength, _attrParseUseNode, loader); - return loader->svgParse->node; -} - - -//TODO: Implement 'text' primitive -static constexpr struct -{ - const char* tag; - int sz; - FactoryMethod tagHandler; -} graphicsTags[] = { - {"use", sizeof("use"), _createUseNode}, - {"circle", sizeof("circle"), _createCircleNode}, - {"ellipse", sizeof("ellipse"), _createEllipseNode}, - {"path", sizeof("path"), _createPathNode}, - {"polygon", sizeof("polygon"), _createPolygonNode}, - {"rect", sizeof("rect"), _createRectNode}, - {"polyline", sizeof("polyline"), _createPolylineNode}, - {"line", sizeof("line"), _createLineNode}, - {"image", sizeof("image"), _createImageNode} -}; - - -static constexpr struct -{ - const char* tag; - int sz; - FactoryMethod tagHandler; -} groupTags[] = { - {"defs", sizeof("defs"), _createDefsNode}, - {"g", sizeof("g"), _createGNode}, - {"svg", sizeof("svg"), _createSvgNode}, - {"mask", sizeof("mask"), _createMaskNode}, - {"clipPath", sizeof("clipPath"), _createClipPathNode}, - {"style", sizeof("style"), _createCssStyleNode}, - {"symbol", sizeof("symbol"), _createSymbolNode} -}; - - -#define FIND_FACTORY(Short_Name, Tags_Array) \ - static FactoryMethod \ - _find##Short_Name##Factory(const char* name) \ - { \ - unsigned int i; \ - int sz = strlen(name); \ - \ - for (i = 0; i < sizeof(Tags_Array) / sizeof(Tags_Array[0]); i++) { \ - if (Tags_Array[i].sz - 1 == sz && !strncmp(Tags_Array[i].tag, name, sz)) { \ - return Tags_Array[i].tagHandler; \ - } \ - } \ - return nullptr; \ - } - -FIND_FACTORY(Group, groupTags) -FIND_FACTORY(Graphics, graphicsTags) - - -FillSpread _parseSpreadValue(const char* value) -{ - auto spread = FillSpread::Pad; - - if (!strcmp(value, "reflect")) { - spread = FillSpread::Reflect; - } else if (!strcmp(value, "repeat")) { - spread = FillSpread::Repeat; - } - - return spread; -} - - -static void _handleRadialCxAttr(SvgLoaderData* loader, SvgRadialGradient* radial, const char* value) -{ - radial->cx = _gradientToFloat(loader->svgParse, value, radial->isCxPercentage); - if (!loader->svgParse->gradient.parsedFx) { - radial->fx = radial->cx; - radial->isFxPercentage = radial->isCxPercentage; - } -} - - -static void _handleRadialCyAttr(SvgLoaderData* loader, SvgRadialGradient* radial, const char* value) -{ - radial->cy = _gradientToFloat(loader->svgParse, value, radial->isCyPercentage); - if (!loader->svgParse->gradient.parsedFy) { - radial->fy = radial->cy; - radial->isFyPercentage = radial->isCyPercentage; - } -} - - -static void _handleRadialFxAttr(SvgLoaderData* loader, SvgRadialGradient* radial, const char* value) -{ - radial->fx = _gradientToFloat(loader->svgParse, value, radial->isFxPercentage); - loader->svgParse->gradient.parsedFx = true; -} - - -static void _handleRadialFyAttr(SvgLoaderData* loader, SvgRadialGradient* radial, const char* value) -{ - radial->fy = _gradientToFloat(loader->svgParse, value, radial->isFyPercentage); - loader->svgParse->gradient.parsedFy = true; -} - - -static void _handleRadialFrAttr(SvgLoaderData* loader, SvgRadialGradient* radial, const char* value) -{ - radial->fr = _gradientToFloat(loader->svgParse, value, radial->isFrPercentage); -} - - -static void _handleRadialRAttr(SvgLoaderData* loader, SvgRadialGradient* radial, const char* value) -{ - radial->r = _gradientToFloat(loader->svgParse, value, radial->isRPercentage); -} - - -static void _recalcRadialCxAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - if (userSpace && !radial->isCxPercentage) radial->cx = radial->cx / loader->svgParse->global.w; -} - - -static void _recalcRadialCyAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - if (userSpace && !radial->isCyPercentage) radial->cy = radial->cy / loader->svgParse->global.h; -} - - -static void _recalcRadialFxAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - if (userSpace && !radial->isFxPercentage) radial->fx = radial->fx / loader->svgParse->global.w; -} - - -static void _recalcRadialFyAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - if (userSpace && !radial->isFyPercentage) radial->fy = radial->fy / loader->svgParse->global.h; -} - - -static void _recalcRadialFrAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - // scaling factor based on the Units paragraph from : https://www.w3.org/TR/2015/WD-SVG2-20150915/coords.html - if (userSpace && !radial->isFrPercentage) radial->fr = radial->fr / (sqrtf(powf(loader->svgParse->global.h, 2) + powf(loader->svgParse->global.w, 2)) / sqrtf(2.0)); -} - - -static void _recalcRadialRAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - // scaling factor based on the Units paragraph from : https://www.w3.org/TR/2015/WD-SVG2-20150915/coords.html - if (userSpace && !radial->isRPercentage) radial->r = radial->r / (sqrtf(powf(loader->svgParse->global.h, 2) + powf(loader->svgParse->global.w, 2)) / sqrtf(2.0)); -} - - -static void _recalcInheritedRadialCxAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - if (!radial->isCxPercentage) { - if (userSpace) radial->cx /= loader->svgParse->global.w; - else radial->cx *= loader->svgParse->global.w; - } -} - - -static void _recalcInheritedRadialCyAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - if (!radial->isCyPercentage) { - if (userSpace) radial->cy /= loader->svgParse->global.h; - else radial->cy *= loader->svgParse->global.h; - } -} - - -static void _recalcInheritedRadialFxAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - if (!radial->isFxPercentage) { - if (userSpace) radial->fx /= loader->svgParse->global.w; - else radial->fx *= loader->svgParse->global.w; - } -} - - -static void _recalcInheritedRadialFyAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - if (!radial->isFyPercentage) { - if (userSpace) radial->fy /= loader->svgParse->global.h; - else radial->fy *= loader->svgParse->global.h; - } -} - - -static void _recalcInheritedRadialFrAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - if (!radial->isFrPercentage) { - if (userSpace) radial->fr /= sqrtf(powf(loader->svgParse->global.h, 2) + powf(loader->svgParse->global.w, 2)) / sqrtf(2.0); - else radial->fr *= sqrtf(powf(loader->svgParse->global.h, 2) + powf(loader->svgParse->global.w, 2)) / sqrtf(2.0); - } -} - - -static void _recalcInheritedRadialRAttr(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace) -{ - if (!radial->isRPercentage) { - if (userSpace) radial->r /= sqrtf(powf(loader->svgParse->global.h, 2) + powf(loader->svgParse->global.w, 2)) / sqrtf(2.0); - else radial->r *= sqrtf(powf(loader->svgParse->global.h, 2) + powf(loader->svgParse->global.w, 2)) / sqrtf(2.0); - } -} - - -static void _inheritRadialCxAttr(SvgStyleGradient* to, SvgStyleGradient* from) -{ - to->radial->cx = from->radial->cx; - to->radial->isCxPercentage = from->radial->isCxPercentage; - to->flags = (to->flags | SvgGradientFlags::Cx); -} - - -static void _inheritRadialCyAttr(SvgStyleGradient* to, SvgStyleGradient* from) -{ - to->radial->cy = from->radial->cy; - to->radial->isCyPercentage = from->radial->isCyPercentage; - to->flags = (to->flags | SvgGradientFlags::Cy); -} - - -static void _inheritRadialFxAttr(SvgStyleGradient* to, SvgStyleGradient* from) -{ - to->radial->fx = from->radial->fx; - to->radial->isFxPercentage = from->radial->isFxPercentage; - to->flags = (to->flags | SvgGradientFlags::Fx); -} - - -static void _inheritRadialFyAttr(SvgStyleGradient* to, SvgStyleGradient* from) -{ - to->radial->fy = from->radial->fy; - to->radial->isFyPercentage = from->radial->isFyPercentage; - to->flags = (to->flags | SvgGradientFlags::Fy); -} - - -static void _inheritRadialFrAttr(SvgStyleGradient* to, SvgStyleGradient* from) -{ - to->radial->fr = from->radial->fr; - to->radial->isFrPercentage = from->radial->isFrPercentage; - to->flags = (to->flags | SvgGradientFlags::Fr); -} - - -static void _inheritRadialRAttr(SvgStyleGradient* to, SvgStyleGradient* from) -{ - to->radial->r = from->radial->r; - to->radial->isRPercentage = from->radial->isRPercentage; - to->flags = (to->flags | SvgGradientFlags::R); -} - - -typedef void (*radialMethod)(SvgLoaderData* loader, SvgRadialGradient* radial, const char* value); -typedef void (*radialInheritMethod)(SvgStyleGradient* to, SvgStyleGradient* from); -typedef void (*radialMethodRecalc)(SvgLoaderData* loader, SvgRadialGradient* radial, bool userSpace); - - -#define RADIAL_DEF(Name, Name1, Flag) \ - { \ -#Name, sizeof(#Name), _handleRadial##Name1##Attr, _inheritRadial##Name1##Attr, _recalcRadial##Name1##Attr, _recalcInheritedRadial##Name1##Attr, Flag \ - } - - -static constexpr struct -{ - const char* tag; - int sz; - radialMethod tagHandler; - radialInheritMethod tagInheritHandler; - radialMethodRecalc tagRecalc; - radialMethodRecalc tagInheritedRecalc; - SvgGradientFlags flag; -} radialTags[] = { - RADIAL_DEF(cx, Cx, SvgGradientFlags::Cx), - RADIAL_DEF(cy, Cy, SvgGradientFlags::Cy), - RADIAL_DEF(fx, Fx, SvgGradientFlags::Fx), - RADIAL_DEF(fy, Fy, SvgGradientFlags::Fy), - RADIAL_DEF(r, R, SvgGradientFlags::R), - RADIAL_DEF(fr, Fr, SvgGradientFlags::Fr) -}; - - -static bool _attrParseRadialGradientNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgStyleGradient* grad = loader->svgParse->styleGrad; - SvgRadialGradient* radial = grad->radial; - int sz = strlen(key); - - for (unsigned int i = 0; i < sizeof(radialTags) / sizeof(radialTags[0]); i++) { - if (radialTags[i].sz - 1 == sz && !strncmp(radialTags[i].tag, key, sz)) { - radialTags[i].tagHandler(loader, radial, value); - grad->flags = (grad->flags | radialTags[i].flag); - return true; - } - } - - if (!strcmp(key, "id")) { - if (grad->id && value) free(grad->id); - grad->id = _copyId(value); - } else if (!strcmp(key, "spreadMethod")) { - grad->spread = _parseSpreadValue(value); - grad->flags = (grad->flags | SvgGradientFlags::SpreadMethod); - } else if (!strcmp(key, "href") || !strcmp(key, "xlink:href")) { - if (grad->ref && value) free(grad->ref); - grad->ref = _idFromHref(value); - } else if (!strcmp(key, "gradientUnits")) { - if (!strcmp(value, "userSpaceOnUse")) grad->userSpace = true; - grad->flags = (grad->flags | SvgGradientFlags::GradientUnits); - } else if (!strcmp(key, "gradientTransform")) { - grad->transform = _parseTransformationMatrix(value); - } else { - return false; - } - - return true; -} - - -static SvgStyleGradient* _createRadialGradient(SvgLoaderData* loader, const char* buf, unsigned bufLength) -{ - auto grad = (SvgStyleGradient*)(calloc(1, sizeof(SvgStyleGradient))); - loader->svgParse->styleGrad = grad; - - grad->flags = SvgGradientFlags::None; - grad->type = SvgGradientType::Radial; - grad->userSpace = false; - grad->radial = (SvgRadialGradient*)calloc(1, sizeof(SvgRadialGradient)); - if (!grad->radial) { - grad->clear(); - free(grad); - return nullptr; - } - /** - * Default values of gradient transformed into global percentage - */ - grad->radial->cx = 0.5f; - grad->radial->cy = 0.5f; - grad->radial->fx = 0.5f; - grad->radial->fy = 0.5f; - grad->radial->r = 0.5f; - grad->radial->isCxPercentage = true; - grad->radial->isCyPercentage = true; - grad->radial->isFxPercentage = true; - grad->radial->isFyPercentage = true; - grad->radial->isRPercentage = true; - grad->radial->isFrPercentage = true; - - loader->svgParse->gradient.parsedFx = false; - loader->svgParse->gradient.parsedFy = false; - simpleXmlParseAttributes(buf, bufLength, - _attrParseRadialGradientNode, loader); - - for (unsigned int i = 0; i < sizeof(radialTags) / sizeof(radialTags[0]); i++) { - radialTags[i].tagRecalc(loader, grad->radial, grad->userSpace); - } - - return loader->svgParse->styleGrad; -} - - -static bool _attrParseStopsStyle(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - auto stop = &loader->svgParse->gradStop; - - if (!strcmp(key, "stop-opacity")) { - stop->a = _toOpacity(value); - loader->svgParse->flags = (loader->svgParse->flags | SvgStopStyleFlags::StopOpacity); - } else if (!strcmp(key, "stop-color")) { - if (_toColor(value, &stop->r, &stop->g, &stop->b, nullptr)) { - loader->svgParse->flags = (loader->svgParse->flags | SvgStopStyleFlags::StopColor); - } - } else { - return false; - } - - return true; -} - - -static bool _attrParseStops(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - auto stop = &loader->svgParse->gradStop; - - if (!strcmp(key, "offset")) { - stop->offset = _toOffset(value); - } else if (!strcmp(key, "stop-opacity")) { - if (!(loader->svgParse->flags & SvgStopStyleFlags::StopOpacity)) { - stop->a = _toOpacity(value); - } - } else if (!strcmp(key, "stop-color")) { - if (!(loader->svgParse->flags & SvgStopStyleFlags::StopColor)) { - _toColor(value, &stop->r, &stop->g, &stop->b, nullptr); - } - } else if (!strcmp(key, "style")) { - simpleXmlParseW3CAttribute(value, strlen(value), _attrParseStopsStyle, data); - } else { - return false; - } - - return true; -} - - -static void _handleLinearX1Attr(SvgLoaderData* loader, SvgLinearGradient* linear, const char* value) -{ - linear->x1 = _gradientToFloat(loader->svgParse, value, linear->isX1Percentage); -} - - -static void _handleLinearY1Attr(SvgLoaderData* loader, SvgLinearGradient* linear, const char* value) -{ - linear->y1 = _gradientToFloat(loader->svgParse, value, linear->isY1Percentage); -} - - -static void _handleLinearX2Attr(SvgLoaderData* loader, SvgLinearGradient* linear, const char* value) -{ - linear->x2 = _gradientToFloat(loader->svgParse, value, linear->isX2Percentage); -} - - -static void _handleLinearY2Attr(SvgLoaderData* loader, SvgLinearGradient* linear, const char* value) -{ - linear->y2 = _gradientToFloat(loader->svgParse, value, linear->isY2Percentage); -} - - -static void _recalcLinearX1Attr(SvgLoaderData* loader, SvgLinearGradient* linear, bool userSpace) -{ - if (userSpace && !linear->isX1Percentage) linear->x1 = linear->x1 / loader->svgParse->global.w; -} - - -static void _recalcLinearY1Attr(SvgLoaderData* loader, SvgLinearGradient* linear, bool userSpace) -{ - if (userSpace && !linear->isY1Percentage) linear->y1 = linear->y1 / loader->svgParse->global.h; -} - - -static void _recalcLinearX2Attr(SvgLoaderData* loader, SvgLinearGradient* linear, bool userSpace) -{ - if (userSpace && !linear->isX2Percentage) linear->x2 = linear->x2 / loader->svgParse->global.w; -} - - -static void _recalcLinearY2Attr(SvgLoaderData* loader, SvgLinearGradient* linear, bool userSpace) -{ - if (userSpace && !linear->isY2Percentage) linear->y2 = linear->y2 / loader->svgParse->global.h; -} - - -static void _recalcInheritedLinearX1Attr(SvgLoaderData* loader, SvgLinearGradient* linear, bool userSpace) -{ - if (!linear->isX1Percentage) { - if (userSpace) linear->x1 /= loader->svgParse->global.w; - else linear->x1 *= loader->svgParse->global.w; - } -} - - -static void _recalcInheritedLinearX2Attr(SvgLoaderData* loader, SvgLinearGradient* linear, bool userSpace) -{ - if (!linear->isX2Percentage) { - if (userSpace) linear->x2 /= loader->svgParse->global.w; - else linear->x2 *= loader->svgParse->global.w; - } -} - - -static void _recalcInheritedLinearY1Attr(SvgLoaderData* loader, SvgLinearGradient* linear, bool userSpace) -{ - if (!linear->isY1Percentage) { - if (userSpace) linear->y1 /= loader->svgParse->global.h; - else linear->y1 *= loader->svgParse->global.h; - } -} - - -static void _recalcInheritedLinearY2Attr(SvgLoaderData* loader, SvgLinearGradient* linear, bool userSpace) -{ - if (!linear->isY2Percentage) { - if (userSpace) linear->y2 /= loader->svgParse->global.h; - else linear->y2 *= loader->svgParse->global.h; - } -} - - -static void _inheritLinearX1Attr(SvgStyleGradient* to, SvgStyleGradient* from) -{ - to->linear->x1 = from->linear->x1; - to->linear->isX1Percentage = from->linear->isX1Percentage; - to->flags = (to->flags | SvgGradientFlags::X1); -} - - -static void _inheritLinearX2Attr(SvgStyleGradient* to, SvgStyleGradient* from) -{ - to->linear->x2 = from->linear->x2; - to->linear->isX2Percentage = from->linear->isX2Percentage; - to->flags = (to->flags | SvgGradientFlags::X2); -} - - -static void _inheritLinearY1Attr(SvgStyleGradient* to, SvgStyleGradient* from) -{ - to->linear->y1 = from->linear->y1; - to->linear->isY1Percentage = from->linear->isY1Percentage; - to->flags = (to->flags | SvgGradientFlags::Y1); -} - - -static void _inheritLinearY2Attr(SvgStyleGradient* to, SvgStyleGradient* from) -{ - to->linear->y2 = from->linear->y2; - to->linear->isY2Percentage = from->linear->isY2Percentage; - to->flags = (to->flags | SvgGradientFlags::Y2); -} - - -typedef void (*Linear_Method)(SvgLoaderData* loader, SvgLinearGradient* linear, const char* value); -typedef void (*Linear_Inherit_Method)(SvgStyleGradient* to, SvgStyleGradient* from); -typedef void (*Linear_Method_Recalc)(SvgLoaderData* loader, SvgLinearGradient* linear, bool userSpace); - - -#define LINEAR_DEF(Name, Name1, Flag) \ - { \ -#Name, sizeof(#Name), _handleLinear##Name1##Attr, _inheritLinear##Name1##Attr, _recalcLinear##Name1##Attr, _recalcInheritedLinear##Name1##Attr, Flag \ - } - - -static constexpr struct -{ - const char* tag; - int sz; - Linear_Method tagHandler; - Linear_Inherit_Method tagInheritHandler; - Linear_Method_Recalc tagRecalc; - Linear_Method_Recalc tagInheritedRecalc; - SvgGradientFlags flag; -} linear_tags[] = { - LINEAR_DEF(x1, X1, SvgGradientFlags::X1), - LINEAR_DEF(y1, Y1, SvgGradientFlags::Y1), - LINEAR_DEF(x2, X2, SvgGradientFlags::X2), - LINEAR_DEF(y2, Y2, SvgGradientFlags::Y2) -}; - - -static bool _attrParseLinearGradientNode(void* data, const char* key, const char* value) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - SvgStyleGradient* grad = loader->svgParse->styleGrad; - SvgLinearGradient* linear = grad->linear; - int sz = strlen(key); - - for (unsigned int i = 0; i < sizeof(linear_tags) / sizeof(linear_tags[0]); i++) { - if (linear_tags[i].sz - 1 == sz && !strncmp(linear_tags[i].tag, key, sz)) { - linear_tags[i].tagHandler(loader, linear, value); - grad->flags = (grad->flags | linear_tags[i].flag); - return true; - } - } - - if (!strcmp(key, "id")) { - if (grad->id && value) free(grad->id); - grad->id = _copyId(value); - } else if (!strcmp(key, "spreadMethod")) { - grad->spread = _parseSpreadValue(value); - grad->flags = (grad->flags | SvgGradientFlags::SpreadMethod); - } else if (!strcmp(key, "href") || !strcmp(key, "xlink:href")) { - if (grad->ref && value) free(grad->ref); - grad->ref = _idFromHref(value); - } else if (!strcmp(key, "gradientUnits")) { - if (!strcmp(value, "userSpaceOnUse")) grad->userSpace = true; - grad->flags = (grad->flags | SvgGradientFlags::GradientUnits); - } else if (!strcmp(key, "gradientTransform")) { - grad->transform = _parseTransformationMatrix(value); - } else { - return false; - } - - return true; -} - - -static SvgStyleGradient* _createLinearGradient(SvgLoaderData* loader, const char* buf, unsigned bufLength) -{ - auto grad = (SvgStyleGradient*)(calloc(1, sizeof(SvgStyleGradient))); - loader->svgParse->styleGrad = grad; - - grad->flags = SvgGradientFlags::None; - grad->type = SvgGradientType::Linear; - grad->userSpace = false; - grad->linear = (SvgLinearGradient*)calloc(1, sizeof(SvgLinearGradient)); - if (!grad->linear) { - grad->clear(); - free(grad); - return nullptr; - } - /** - * Default value of x2 is 100% - transformed to the global percentage - */ - grad->linear->x2 = 1.0f; - grad->linear->isX2Percentage = true; - - simpleXmlParseAttributes(buf, bufLength, _attrParseLinearGradientNode, loader); - - for (unsigned int i = 0; i < sizeof(linear_tags) / sizeof(linear_tags[0]); i++) { - linear_tags[i].tagRecalc(loader, grad->linear, grad->userSpace); - } - - return loader->svgParse->styleGrad; -} - - -#define GRADIENT_DEF(Name, Name1) \ - { \ -#Name, sizeof(#Name), _create##Name1 \ - } - - -/** - * In the case when the gradients lengths are given as numbers (not percentages) - * in the current user coordinate system, they are recalculated into percentages - * related to the canvas width and height. - */ -static constexpr struct -{ - const char* tag; - int sz; - GradientFactoryMethod tagHandler; -} gradientTags[] = { - GRADIENT_DEF(linearGradient, LinearGradient), - GRADIENT_DEF(radialGradient, RadialGradient) -}; - - -static GradientFactoryMethod _findGradientFactory(const char* name) -{ - int sz = strlen(name); - - for (unsigned int i = 0; i < sizeof(gradientTags) / sizeof(gradientTags[0]); i++) { - if (gradientTags[i].sz - 1 == sz && !strncmp(gradientTags[i].tag, name, sz)) { - return gradientTags[i].tagHandler; - } - } - return nullptr; -} - - -static void _cloneGradStops(Array& dst, const Array& src) -{ - for (uint32_t i = 0; i < src.count; ++i) { - dst.push(src[i]); - } -} - - -static void _inheritGradient(SvgLoaderData* loader, SvgStyleGradient* to, SvgStyleGradient* from) -{ - if (!to || !from) return; - - if (!(to->flags & SvgGradientFlags::SpreadMethod) && (from->flags & SvgGradientFlags::SpreadMethod)) { - to->spread = from->spread; - to->flags = (to->flags | SvgGradientFlags::SpreadMethod); - } - bool gradUnitSet = (to->flags & SvgGradientFlags::GradientUnits); - if (!(to->flags & SvgGradientFlags::GradientUnits) && (from->flags & SvgGradientFlags::GradientUnits)) { - to->userSpace = from->userSpace; - to->flags = (to->flags | SvgGradientFlags::GradientUnits); - } - - if (!to->transform && from->transform) { - to->transform = (Matrix*)malloc(sizeof(Matrix)); - if (to->transform) memcpy(to->transform, from->transform, sizeof(Matrix)); - } - - if (to->type == SvgGradientType::Linear) { - for (unsigned int i = 0; i < sizeof(linear_tags) / sizeof(linear_tags[0]); i++) { - bool coordSet = to->flags & linear_tags[i].flag; - if (!(to->flags & linear_tags[i].flag) && (from->flags & linear_tags[i].flag)) { - linear_tags[i].tagInheritHandler(to, from); - } - - //GradUnits not set directly, coord set - if (!gradUnitSet && coordSet) { - linear_tags[i].tagRecalc(loader, to->linear, to->userSpace); - } - //GradUnits set, coord not set directly - if (to->userSpace == from->userSpace) continue; - if (gradUnitSet && !coordSet) { - linear_tags[i].tagInheritedRecalc(loader, to->linear, to->userSpace); - } - } - } else if (to->type == SvgGradientType::Radial) { - for (unsigned int i = 0; i < sizeof(radialTags) / sizeof(radialTags[0]); i++) { - bool coordSet = (to->flags & radialTags[i].flag); - if (!(to->flags & radialTags[i].flag) && (from->flags & radialTags[i].flag)) { - radialTags[i].tagInheritHandler(to, from); - } - - //GradUnits not set directly, coord set - if (!gradUnitSet && coordSet) { - radialTags[i].tagRecalc(loader, to->radial, to->userSpace); - //If fx and fy are not set, set cx and cy. - if (!strcmp(radialTags[i].tag, "cx") && !(to->flags & SvgGradientFlags::Fx)) to->radial->fx = to->radial->cx; - if (!strcmp(radialTags[i].tag, "cy") && !(to->flags & SvgGradientFlags::Fy)) to->radial->fy = to->radial->cy; - } - //GradUnits set, coord not set directly - if (to->userSpace == from->userSpace) continue; - if (gradUnitSet && !coordSet) { - //If fx and fx are not set, do not call recalc. - if (!strcmp(radialTags[i].tag, "fx") && !(to->flags & SvgGradientFlags::Fx)) continue; - if (!strcmp(radialTags[i].tag, "fy") && !(to->flags & SvgGradientFlags::Fy)) continue; - radialTags[i].tagInheritedRecalc(loader, to->radial, to->userSpace); - } - } - } - - if (to->stops.empty()) _cloneGradStops(to->stops, from->stops); -} - - -static SvgStyleGradient* _cloneGradient(SvgStyleGradient* from) -{ - if (!from) return nullptr; - - auto grad = (SvgStyleGradient*)(calloc(1, sizeof(SvgStyleGradient))); - if (!grad) return nullptr; - - grad->type = from->type; - grad->id = from->id ? _copyId(from->id) : nullptr; - grad->ref = from->ref ? _copyId(from->ref) : nullptr; - grad->spread = from->spread; - grad->userSpace = from->userSpace; - grad->flags = from->flags; - - if (from->transform) { - grad->transform = (Matrix*)calloc(1, sizeof(Matrix)); - if (grad->transform) memcpy(grad->transform, from->transform, sizeof(Matrix)); - } - - if (grad->type == SvgGradientType::Linear) { - grad->linear = (SvgLinearGradient*)calloc(1, sizeof(SvgLinearGradient)); - if (!grad->linear) goto error_grad_alloc; - memcpy(grad->linear, from->linear, sizeof(SvgLinearGradient)); - } else if (grad->type == SvgGradientType::Radial) { - grad->radial = (SvgRadialGradient*)calloc(1, sizeof(SvgRadialGradient)); - if (!grad->radial) goto error_grad_alloc; - memcpy(grad->radial, from->radial, sizeof(SvgRadialGradient)); - } - - _cloneGradStops(grad->stops, from->stops); - - return grad; - - error_grad_alloc: - if (grad) { - grad->clear(); - free(grad); - } - return nullptr; -} - - -static void _styleInherit(SvgStyleProperty* child, const SvgStyleProperty* parent) -{ - if (parent == nullptr) return; - //Inherit the property of parent if not present in child. - if (!child->curColorSet) { - child->color = parent->color; - child->curColorSet = parent->curColorSet; - } - if (!(child->flags & SvgStyleFlags::PaintOrder)) { - child->paintOrder = parent->paintOrder; - } - //Fill - if (!(child->fill.flags & SvgFillFlags::Paint)) { - child->fill.paint.color = parent->fill.paint.color; - child->fill.paint.none = parent->fill.paint.none; - child->fill.paint.curColor = parent->fill.paint.curColor; - if (parent->fill.paint.url) { - if (child->fill.paint.url) free(child->fill.paint.url); - child->fill.paint.url = _copyId(parent->fill.paint.url); - } - } - if (!(child->fill.flags & SvgFillFlags::Opacity)) { - child->fill.opacity = parent->fill.opacity; - } - if (!(child->fill.flags & SvgFillFlags::FillRule)) { - child->fill.fillRule = parent->fill.fillRule; - } - //Stroke - if (!(child->stroke.flags & SvgStrokeFlags::Paint)) { - child->stroke.paint.color = parent->stroke.paint.color; - child->stroke.paint.none = parent->stroke.paint.none; - child->stroke.paint.curColor = parent->stroke.paint.curColor; - if (parent->stroke.paint.url) { - if (child->stroke.paint.url) free(child->stroke.paint.url); - child->stroke.paint.url = _copyId(parent->stroke.paint.url); - } - } - if (!(child->stroke.flags & SvgStrokeFlags::Opacity)) { - child->stroke.opacity = parent->stroke.opacity; - } - if (!(child->stroke.flags & SvgStrokeFlags::Width)) { - child->stroke.width = parent->stroke.width; - } - if (!(child->stroke.flags & SvgStrokeFlags::Dash)) { - if (parent->stroke.dash.array.count > 0) { - child->stroke.dash.array.clear(); - child->stroke.dash.array.reserve(parent->stroke.dash.array.count); - for (uint32_t i = 0; i < parent->stroke.dash.array.count; ++i) { - child->stroke.dash.array.push(parent->stroke.dash.array[i]); - } - } - } - if (!(child->stroke.flags & SvgStrokeFlags::DashOffset)) { - child->stroke.dash.offset = parent->stroke.dash.offset; - } - if (!(child->stroke.flags & SvgStrokeFlags::Cap)) { - child->stroke.cap = parent->stroke.cap; - } - if (!(child->stroke.flags & SvgStrokeFlags::Join)) { - child->stroke.join = parent->stroke.join; - } - if (!(child->stroke.flags & SvgStrokeFlags::Miterlimit)) { - child->stroke.miterlimit = parent->stroke.miterlimit; - } -} - - -static void _styleCopy(SvgStyleProperty* to, const SvgStyleProperty* from) -{ - if (from == nullptr) return; - //Copy the properties of 'from' only if they were explicitly set (not the default ones). - if (from->curColorSet) { - to->color = from->color; - to->curColorSet = true; - } - if (from->flags & SvgStyleFlags::Opacity) { - to->opacity = from->opacity; - } - if (from->flags & SvgStyleFlags::PaintOrder) { - to->paintOrder = from->paintOrder; - } - if (from->flags & SvgStyleFlags::Display) { - to->display = from->display; - } - //Fill - to->fill.flags = (to->fill.flags | from->fill.flags); - if (from->fill.flags & SvgFillFlags::Paint) { - to->fill.paint.color = from->fill.paint.color; - to->fill.paint.none = from->fill.paint.none; - to->fill.paint.curColor = from->fill.paint.curColor; - if (from->fill.paint.url) { - if (to->fill.paint.url) free(to->fill.paint.url); - to->fill.paint.url = _copyId(from->fill.paint.url); - } - } - if (from->fill.flags & SvgFillFlags::Opacity) { - to->fill.opacity = from->fill.opacity; - } - if (from->fill.flags & SvgFillFlags::FillRule) { - to->fill.fillRule = from->fill.fillRule; - } - //Stroke - to->stroke.flags = (to->stroke.flags | from->stroke.flags); - if (from->stroke.flags & SvgStrokeFlags::Paint) { - to->stroke.paint.color = from->stroke.paint.color; - to->stroke.paint.none = from->stroke.paint.none; - to->stroke.paint.curColor = from->stroke.paint.curColor; - if (from->stroke.paint.url) { - if (to->stroke.paint.url) free(to->stroke.paint.url); - to->stroke.paint.url = _copyId(from->stroke.paint.url); - } - } - if (from->stroke.flags & SvgStrokeFlags::Opacity) { - to->stroke.opacity = from->stroke.opacity; - } - if (from->stroke.flags & SvgStrokeFlags::Width) { - to->stroke.width = from->stroke.width; - } - if (from->stroke.flags & SvgStrokeFlags::Dash) { - if (from->stroke.dash.array.count > 0) { - to->stroke.dash.array.clear(); - to->stroke.dash.array.reserve(from->stroke.dash.array.count); - for (uint32_t i = 0; i < from->stroke.dash.array.count; ++i) { - to->stroke.dash.array.push(from->stroke.dash.array[i]); - } - } - } - if (from->stroke.flags & SvgStrokeFlags::DashOffset) { - to->stroke.dash.offset = from->stroke.dash.offset; - } - if (from->stroke.flags & SvgStrokeFlags::Cap) { - to->stroke.cap = from->stroke.cap; - } - if (from->stroke.flags & SvgStrokeFlags::Join) { - to->stroke.join = from->stroke.join; - } - if (from->stroke.flags & SvgStrokeFlags::Miterlimit) { - to->stroke.miterlimit = from->stroke.miterlimit; - } -} - - -static void _copyAttr(SvgNode* to, const SvgNode* from) -{ - //Copy matrix attribute - if (from->transform) { - to->transform = (Matrix*)malloc(sizeof(Matrix)); - if (to->transform) *to->transform = *from->transform; - } - //Copy style attribute - _styleCopy(to->style, from->style); - to->style->flags = (to->style->flags | from->style->flags); - if (from->style->clipPath.url) { - if (to->style->clipPath.url) free(to->style->clipPath.url); - to->style->clipPath.url = strdup(from->style->clipPath.url); - } - if (from->style->mask.url) { - if (to->style->mask.url) free(to->style->mask.url); - to->style->mask.url = strdup(from->style->mask.url); - } - - //Copy node attribute - switch (from->type) { - case SvgNodeType::Circle: { - to->node.circle.cx = from->node.circle.cx; - to->node.circle.cy = from->node.circle.cy; - to->node.circle.r = from->node.circle.r; - break; - } - case SvgNodeType::Ellipse: { - to->node.ellipse.cx = from->node.ellipse.cx; - to->node.ellipse.cy = from->node.ellipse.cy; - to->node.ellipse.rx = from->node.ellipse.rx; - to->node.ellipse.ry = from->node.ellipse.ry; - break; - } - case SvgNodeType::Rect: { - to->node.rect.x = from->node.rect.x; - to->node.rect.y = from->node.rect.y; - to->node.rect.w = from->node.rect.w; - to->node.rect.h = from->node.rect.h; - to->node.rect.rx = from->node.rect.rx; - to->node.rect.ry = from->node.rect.ry; - to->node.rect.hasRx = from->node.rect.hasRx; - to->node.rect.hasRy = from->node.rect.hasRy; - break; - } - case SvgNodeType::Line: { - to->node.line.x1 = from->node.line.x1; - to->node.line.y1 = from->node.line.y1; - to->node.line.x2 = from->node.line.x2; - to->node.line.y2 = from->node.line.y2; - break; - } - case SvgNodeType::Path: { - if (from->node.path.path) { - if (to->node.path.path) free(to->node.path.path); - to->node.path.path = strdup(from->node.path.path); - } - break; - } - case SvgNodeType::Polygon: { - if ((to->node.polygon.pts.count = from->node.polygon.pts.count)) { - to->node.polygon.pts = from->node.polygon.pts; - } - break; - } - case SvgNodeType::Polyline: { - if ((to->node.polyline.pts.count = from->node.polyline.pts.count)) { - to->node.polyline.pts = from->node.polyline.pts; - } - break; - } - case SvgNodeType::Image: { - to->node.image.x = from->node.image.x; - to->node.image.y = from->node.image.y; - to->node.image.w = from->node.image.w; - to->node.image.h = from->node.image.h; - if (from->node.image.href) { - if (to->node.image.href) free(to->node.image.href); - to->node.image.href = strdup(from->node.image.href); - } - break; - } - case SvgNodeType::Use: { - to->node.use.x = from->node.use.x; - to->node.use.y = from->node.use.y; - to->node.use.w = from->node.use.w; - to->node.use.h = from->node.use.h; - to->node.use.isWidthSet = from->node.use.isWidthSet; - to->node.use.isHeightSet = from->node.use.isHeightSet; - to->node.use.symbol = from->node.use.symbol; - break; - } - default: { - break; - } - } -} - - -static void _cloneNode(SvgNode* from, SvgNode* parent, int depth) -{ - /* Exception handling: Prevent invalid SVG data input. - The size is the arbitrary value, we need an experimental size. */ - if (depth == 8192) { - TVGERR("SVG", "Infinite recursive call - stopped after %d calls! Svg file may be incorrectly formatted.", depth); - return; - } - - SvgNode* newNode; - if (!from || !parent || from == parent) return; - - newNode = _createNode(parent, from->type); - if (!newNode) return; - - _styleInherit(newNode->style, parent->style); - _copyAttr(newNode, from); - - auto child = from->child.data; - for (uint32_t i = 0; i < from->child.count; ++i, ++child) { - _cloneNode(*child, newNode, depth + 1); - } -} - - -static void _clonePostponedNodes(Array* cloneNodes, SvgNode* doc) -{ - for (uint32_t i = 0; i < cloneNodes->count; ++i) { - auto nodeIdPair = (*cloneNodes)[i]; - auto defs = _getDefsNode(nodeIdPair.node); - auto nodeFrom = _findNodeById(defs, nodeIdPair.id); - if (!nodeFrom) nodeFrom = _findNodeById(doc, nodeIdPair.id); - if (!_findParentById(nodeIdPair.node, nodeIdPair.id, doc)) { - _cloneNode(nodeFrom, nodeIdPair.node, 0); - if (nodeFrom && nodeFrom->type == SvgNodeType::Symbol && nodeIdPair.node->type == SvgNodeType::Use) { - nodeIdPair.node->node.use.symbol = nodeFrom; - } - } else { - TVGLOG("SVG", "%s is ancestor element. This reference is invalid.", nodeIdPair.id); - } - free(nodeIdPair.id); - } -} - - -static constexpr struct -{ - const char* tag; - size_t sz; -} popArray[] = { - {"g", sizeof("g")}, - {"svg", sizeof("svg")}, - {"defs", sizeof("defs")}, - {"mask", sizeof("mask")}, - {"clipPath", sizeof("clipPath")}, - {"style", sizeof("style")}, - {"symbol", sizeof("symbol")} -}; - - -static void _svgLoaderParserXmlClose(SvgLoaderData* loader, const char* content) -{ - content = _skipSpace(content, nullptr); - - for (unsigned int i = 0; i < sizeof(popArray) / sizeof(popArray[0]); i++) { - if (!strncmp(content, popArray[i].tag, popArray[i].sz - 1)) { - loader->stack.pop(); - break; - } - } - - for (unsigned int i = 0; i < sizeof(graphicsTags) / sizeof(graphicsTags[0]); i++) { - if (!strncmp(content, graphicsTags[i].tag, graphicsTags[i].sz - 1)) { - loader->currentGraphicsNode = nullptr; - loader->stack.pop(); - break; - } - } - - loader->level--; -} - - -static void _svgLoaderParserXmlOpen(SvgLoaderData* loader, const char* content, unsigned int length, bool empty) -{ - const char* attrs = nullptr; - int attrsLength = 0; - int sz = length; - char tagName[20] = ""; - FactoryMethod method; - GradientFactoryMethod gradientMethod; - SvgNode *node = nullptr, *parent = nullptr; - loader->level++; - attrs = simpleXmlFindAttributesTag(content, length); - - if (!attrs) { - //Parse the empty tag - attrs = content; - while ((attrs != nullptr) && *attrs != '>') attrs++; - if (empty) attrs--; - } - - if (attrs) { - //Find out the tag name starting from content till sz length - sz = attrs - content; - while ((sz > 0) && (isspace(content[sz - 1]))) sz--; - if ((unsigned)sz >= sizeof(tagName)) return; - strncpy(tagName, content, sz); - tagName[sz] = '\0'; - attrsLength = length - sz; - } - - if ((method = _findGroupFactory(tagName))) { - //Group - if (empty) return; - if (!loader->doc) { - if (strcmp(tagName, "svg")) return; //Not a valid svg document - node = method(loader, nullptr, attrs, attrsLength, simpleXmlParseAttributes); - loader->doc = node; - } else { - if (!strcmp(tagName, "svg")) return; //Already loaded (SvgNodeType::Doc) tag - if (loader->stack.count > 0) parent = loader->stack.last(); - else parent = loader->doc; - if (!strcmp(tagName, "style")) { - // TODO: For now only the first style node is saved. After the css id selector - // is introduced this if condition shouldn't be necessary any more - if (!loader->cssStyle) { - node = method(loader, nullptr, attrs, attrsLength, simpleXmlParseAttributes); - loader->cssStyle = node; - loader->doc->node.doc.style = node; - loader->style = true; - } - } else { - node = method(loader, parent, attrs, attrsLength, simpleXmlParseAttributes); - } - } - - if (!node) return; - if (node->type != SvgNodeType::Defs || !empty) { - loader->stack.push(node); - } - } else if ((method = _findGraphicsFactory(tagName))) { - if (loader->stack.count > 0) parent = loader->stack.last(); - else parent = loader->doc; - node = method(loader, parent, attrs, attrsLength, simpleXmlParseAttributes); - if (node && !empty) { - auto defs = _createDefsNode(loader, nullptr, nullptr, 0, nullptr); - loader->stack.push(defs); - loader->currentGraphicsNode = node; - } - } else if ((gradientMethod = _findGradientFactory(tagName))) { - SvgStyleGradient* gradient; - gradient = gradientMethod(loader, attrs, attrsLength); - //FIXME: The current parsing structure does not distinguish end tags. - // There is no way to know if the currently parsed gradient is in defs. - // If a gradient is declared outside of defs after defs is set, it is included in the gradients of defs. - // But finally, the loader has a gradient style list regardless of defs. - // This is only to support this when multiple gradients are declared, even if no defs are declared. - // refer to: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs - if (loader->def && loader->doc->node.doc.defs) { - loader->def->node.defs.gradients.push(gradient); - } else { - loader->gradients.push(gradient); - } - loader->latestGradient = gradient; - } else if (!strcmp(tagName, "stop")) { - if (!loader->latestGradient) { - TVGLOG("SVG", "Stop element is used outside of the Gradient element"); - return; - } - /* default value for opacity */ - loader->svgParse->gradStop = {0.0f, 0, 0, 0, 255}; - loader->svgParse->flags = SvgStopStyleFlags::StopDefault; - simpleXmlParseAttributes(attrs, attrsLength, _attrParseStops, loader); - loader->latestGradient->stops.push(loader->svgParse->gradStop); - } else if (!isIgnoreUnsupportedLogElements(tagName)) { - TVGLOG("SVG", "Unsupported elements used [Elements: %s]", tagName); - } -} - - -static void _svgLoaderParserXmlCssStyle(SvgLoaderData* loader, const char* content, unsigned int length) -{ - char* tag; - char* name; - const char* attrs = nullptr; - unsigned int attrsLength = 0; - - FactoryMethod method; - GradientFactoryMethod gradientMethod; - SvgNode *node = nullptr; - - while (auto next = simpleXmlParseCSSAttribute(content, length, &tag, &name, &attrs, &attrsLength)) { - if ((method = _findGroupFactory(tag))) { - if ((node = method(loader, loader->cssStyle, attrs, attrsLength, simpleXmlParseW3CAttribute))) node->id = _copyId(name); - } else if ((method = _findGraphicsFactory(tag))) { - if ((node = method(loader, loader->cssStyle, attrs, attrsLength, simpleXmlParseW3CAttribute))) node->id = _copyId(name); - } else if ((gradientMethod = _findGradientFactory(tag))) { - TVGLOG("SVG", "Unsupported elements used in the internal CSS style sheets [Elements: %s]", tag); - } else if (!strcmp(tag, "stop")) { - TVGLOG("SVG", "Unsupported elements used in the internal CSS style sheets [Elements: %s]", tag); - } else if (!strcmp(tag, "all")) { - if ((node = _createCssStyleNode(loader, loader->cssStyle, attrs, attrsLength, simpleXmlParseW3CAttribute))) node->id = _copyId(name); - } else if (!isIgnoreUnsupportedLogElements(tag)) { - TVGLOG("SVG", "Unsupported elements used in the internal CSS style sheets [Elements: %s]", tag); - } - - length -= next - content; - content = next; - - free(tag); - free(name); - } - loader->style = false; -} - - -static bool _svgLoaderParser(void* data, SimpleXMLType type, const char* content, unsigned int length) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - - switch (type) { - case SimpleXMLType::Open: { - _svgLoaderParserXmlOpen(loader, content, length, false); - break; - } - case SimpleXMLType::OpenEmpty: { - _svgLoaderParserXmlOpen(loader, content, length, true); - break; - } - case SimpleXMLType::Close: { - _svgLoaderParserXmlClose(loader, content); - break; - } - case SimpleXMLType::Data: - case SimpleXMLType::CData: { - if (loader->style) _svgLoaderParserXmlCssStyle(loader, content, length); - break; - } - case SimpleXMLType::DoctypeChild: { - break; - } - case SimpleXMLType::Ignored: - case SimpleXMLType::Comment: - case SimpleXMLType::Doctype: { - break; - } - default: { - break; - } - } - - return true; -} - - -static void _inefficientNodeCheck(TVG_UNUSED SvgNode* node) -{ -#ifdef THORVG_LOG_ENABLED - auto type = simpleXmlNodeTypeToString(node->type); - - if (!node->style->display && node->type != SvgNodeType::ClipPath) TVGLOG("SVG", "Inefficient elements used [Display is none][Node Type : %s]", type); - if (node->style->opacity == 0) TVGLOG("SVG", "Inefficient elements used [Opacity is zero][Node Type : %s]", type); - if (node->style->fill.opacity == 0 && node->style->stroke.opacity == 0) TVGLOG("SVG", "Inefficient elements used [Fill opacity and stroke opacity are zero][Node Type : %s]", type); - - switch (node->type) { - case SvgNodeType::Path: { - if (!node->node.path.path) TVGLOG("SVG", "Inefficient elements used [Empty path][Node Type : %s]", type); - break; - } - case SvgNodeType::Ellipse: { - if (node->node.ellipse.rx == 0 && node->node.ellipse.ry == 0) TVGLOG("SVG", "Inefficient elements used [Size is zero][Node Type : %s]", type); - break; - } - case SvgNodeType::Polygon: - case SvgNodeType::Polyline: { - if (node->node.polygon.pts.count < 2) TVGLOG("SVG", "Inefficient elements used [Invalid Polygon][Node Type : %s]", type); - break; - } - case SvgNodeType::Circle: { - if (node->node.circle.r == 0) TVGLOG("SVG", "Inefficient elements used [Size is zero][Node Type : %s]", type); - break; - } - case SvgNodeType::Rect: { - if (node->node.rect.w == 0 && node->node.rect.h) TVGLOG("SVG", "Inefficient elements used [Size is zero][Node Type : %s]", type); - break; - } - case SvgNodeType::Line: { - if (node->node.line.x1 == node->node.line.x2 && node->node.line.y1 == node->node.line.y2) TVGLOG("SVG", "Inefficient elements used [Size is zero][Node Type : %s]", type); - break; - } - default: break; - } -#endif -} - - -static void _updateStyle(SvgNode* node, SvgStyleProperty* parentStyle) -{ - _styleInherit(node->style, parentStyle); - _inefficientNodeCheck(node); - - auto child = node->child.data; - for (uint32_t i = 0; i < node->child.count; ++i, ++child) { - _updateStyle(*child, node->style); - } -} - - -static SvgStyleGradient* _gradientDup(SvgLoaderData* loader, Array* gradients, const char* id) -{ - SvgStyleGradient* result = nullptr; - - auto gradList = gradients->data; - - for (uint32_t i = 0; i < gradients->count; ++i) { - if ((*gradList)->id && !strcmp((*gradList)->id, id)) { - result = _cloneGradient(*gradList); - break; - } - ++gradList; - } - - if (result && result->ref) { - gradList = gradients->data; - for (uint32_t i = 0; i < gradients->count; ++i) { - if ((*gradList)->id && !strcmp((*gradList)->id, result->ref)) { - _inheritGradient(loader, result, *gradList); - break; - } - ++gradList; - } - } - - return result; -} - - -static void _updateGradient(SvgLoaderData* loader, SvgNode* node, Array* gradients) -{ - if (node->child.count > 0) { - auto child = node->child.data; - for (uint32_t i = 0; i < node->child.count; ++i, ++child) { - _updateGradient(loader, *child, gradients); - } - } else { - if (node->style->fill.paint.url) { - auto newGrad = _gradientDup(loader, gradients, node->style->fill.paint.url); - if (newGrad) { - if (node->style->fill.paint.gradient) { - node->style->fill.paint.gradient->clear(); - free(node->style->fill.paint.gradient); - } - node->style->fill.paint.gradient = newGrad; - } - } - if (node->style->stroke.paint.url) { - auto newGrad = _gradientDup(loader, gradients, node->style->stroke.paint.url); - if (newGrad) { - if (node->style->stroke.paint.gradient) { - node->style->stroke.paint.gradient->clear(); - free(node->style->stroke.paint.gradient); - } - node->style->stroke.paint.gradient = newGrad; - } - } - } -} - - -static void _updateComposite(SvgNode* node, SvgNode* root) -{ - if (node->style->clipPath.url && !node->style->clipPath.node) { - SvgNode* findResult = _findNodeById(root, node->style->clipPath.url); - if (findResult) node->style->clipPath.node = findResult; - } - if (node->style->mask.url && !node->style->mask.node) { - SvgNode* findResult = _findNodeById(root, node->style->mask.url); - if (findResult) node->style->mask.node = findResult; - } - if (node->child.count > 0) { - auto child = node->child.data; - for (uint32_t i = 0; i < node->child.count; ++i, ++child) { - _updateComposite(*child, root); - } - } -} - - -static void _freeNodeStyle(SvgStyleProperty* style) -{ - if (!style) return; - - //style->clipPath.node and style->mask.node has only the addresses of node. Therefore, node is released from _freeNode. - free(style->clipPath.url); - free(style->mask.url); - free(style->cssClass); - - if (style->fill.paint.gradient) { - style->fill.paint.gradient->clear(); - free(style->fill.paint.gradient); - } - if (style->stroke.paint.gradient) { - style->stroke.paint.gradient->clear(); - free(style->stroke.paint.gradient); - } - free(style->fill.paint.url); - free(style->stroke.paint.url); - style->stroke.dash.array.reset(); - free(style); -} - - -static void _freeNode(SvgNode* node) -{ - if (!node) return; - - auto child = node->child.data; - for (uint32_t i = 0; i < node->child.count; ++i, ++child) { - _freeNode(*child); - } - node->child.reset(); - - free(node->id); - free(node->transform); - _freeNodeStyle(node->style); - switch (node->type) { - case SvgNodeType::Path: { - free(node->node.path.path); - break; - } - case SvgNodeType::Polygon: { - free(node->node.polygon.pts.data); - break; - } - case SvgNodeType::Polyline: { - free(node->node.polyline.pts.data); - break; - } - case SvgNodeType::Doc: { - _freeNode(node->node.doc.defs); - _freeNode(node->node.doc.style); - break; - } - case SvgNodeType::Defs: { - auto gradients = node->node.defs.gradients.data; - for (size_t i = 0; i < node->node.defs.gradients.count; ++i) { - (*gradients)->clear(); - free(*gradients); - ++gradients; - } - node->node.defs.gradients.reset(); - break; - } - case SvgNodeType::Image: { - free(node->node.image.href); - break; - } - default: { - break; - } - } - free(node); -} - - -static bool _svgLoaderParserForValidCheckXmlOpen(SvgLoaderData* loader, const char* content, unsigned int length) -{ - const char* attrs = nullptr; - int sz = length; - char tagName[20] = ""; - FactoryMethod method; - SvgNode *node = nullptr; - int attrsLength = 0; - loader->level++; - attrs = simpleXmlFindAttributesTag(content, length); - - if (!attrs) { - //Parse the empty tag - attrs = content; - while ((attrs != nullptr) && *attrs != '>') attrs++; - } - - if (attrs) { - sz = attrs - content; - while ((sz > 0) && (isspace(content[sz - 1]))) sz--; - if ((unsigned)sz >= sizeof(tagName)) return false; - strncpy(tagName, content, sz); - tagName[sz] = '\0'; - attrsLength = length - sz; - } - - if ((method = _findGroupFactory(tagName))) { - if (!loader->doc) { - if (strcmp(tagName, "svg")) return true; //Not a valid svg document - node = method(loader, nullptr, attrs, attrsLength, simpleXmlParseAttributes); - loader->doc = node; - loader->stack.push(node); - return false; - } - } - return true; -} - - -static bool _svgLoaderParserForValidCheck(void* data, SimpleXMLType type, const char* content, unsigned int length) -{ - SvgLoaderData* loader = (SvgLoaderData*)data; - bool res = true;; - - switch (type) { - case SimpleXMLType::Open: - case SimpleXMLType::OpenEmpty: { - //If 'res' is false, it means tag is found. - res = _svgLoaderParserForValidCheckXmlOpen(loader, content, length); - break; - } - default: { - break; - } - } - - return res; -} - - -void SvgLoader::clear(bool all) -{ - //flush out the intermediate data - free(loaderData.svgParse); - loaderData.svgParse = nullptr; - - for (auto gradient = loaderData.gradients.begin(); gradient < loaderData.gradients.end(); ++gradient) { - (*gradient)->clear(); - free(*gradient); - } - loaderData.gradients.reset(); - - _freeNode(loaderData.doc); - loaderData.doc = nullptr; - loaderData.stack.reset(); - - if (!all) return; - - for (auto p = loaderData.images.begin(); p < loaderData.images.end(); ++p) { - free(*p); - } - loaderData.images.reset(); - - if (copy) free((char*)content); - - delete(root); - root = nullptr; - - size = 0; - content = nullptr; - copy = false; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -SvgLoader::SvgLoader() : ImageLoader(FileType::Svg) -{ -} - - -SvgLoader::~SvgLoader() -{ - this->done(); - clear(); -} - - -void SvgLoader::run(unsigned tid) -{ - //According to the SVG standard the value of the width/height of the viewbox set to 0 disables rendering - if ((viewFlag & SvgViewFlag::Viewbox) && (fabsf(vw) <= FLOAT_EPSILON || fabsf(vh) <= FLOAT_EPSILON)) { - TVGLOG("SVG", "The width and/or height set to 0 - rendering disabled."); - root = Scene::gen().release(); - return; - } - - if (!simpleXmlParse(content, size, true, _svgLoaderParser, &(loaderData))) return; - - if (loaderData.doc) { - auto defs = loaderData.doc->node.doc.defs; - - if (loaderData.nodesToStyle.count > 0) cssApplyStyleToPostponeds(loaderData.nodesToStyle, loaderData.cssStyle); - if (loaderData.cssStyle) cssUpdateStyle(loaderData.doc, loaderData.cssStyle); - - if (loaderData.cloneNodes.count > 0) _clonePostponedNodes(&loaderData.cloneNodes, loaderData.doc); - - _updateComposite(loaderData.doc, loaderData.doc); - if (defs) _updateComposite(loaderData.doc, defs); - - _updateStyle(loaderData.doc, nullptr); - if (defs) _updateStyle(defs, nullptr); - - if (loaderData.gradients.count > 0) _updateGradient(&loaderData, loaderData.doc, &loaderData.gradients); - if (defs) _updateGradient(&loaderData, loaderData.doc, &defs->node.defs.gradients); - } - root = svgSceneBuild(loaderData, {vx, vy, vw, vh}, w, h, align, meetOrSlice, svgPath, viewFlag); - - //In case no viewbox and width/height data is provided the completion of loading - //has to be forced, in order to establish this data based on the whole picture. - if (!(viewFlag & SvgViewFlag::Viewbox)) { - //Override viewbox & size again after svg loading. - vx = loaderData.doc->node.doc.vx; - vy = loaderData.doc->node.doc.vy; - vw = loaderData.doc->node.doc.vw; - vh = loaderData.doc->node.doc.vh; - w = loaderData.doc->node.doc.w; - h = loaderData.doc->node.doc.h; - } - - clear(false); -} - - -bool SvgLoader::header() -{ - //For valid check, only tag is parsed first. - //If the tag is found, the loaded file is valid and stores viewbox information. - //After that, the remaining content data is parsed in order with async. - loaderData.svgParse = (SvgParser*)malloc(sizeof(SvgParser)); - if (!loaderData.svgParse) return false; - - loaderData.svgParse->flags = SvgStopStyleFlags::StopDefault; - viewFlag = SvgViewFlag::None; - - simpleXmlParse(content, size, true, _svgLoaderParserForValidCheck, &(loaderData)); - - if (loaderData.doc && loaderData.doc->type == SvgNodeType::Doc) { - viewFlag = loaderData.doc->node.doc.viewFlag; - align = loaderData.doc->node.doc.align; - meetOrSlice = loaderData.doc->node.doc.meetOrSlice; - - if (viewFlag & SvgViewFlag::Viewbox) { - vx = loaderData.doc->node.doc.vx; - vy = loaderData.doc->node.doc.vy; - vw = loaderData.doc->node.doc.vw; - vh = loaderData.doc->node.doc.vh; - - if (viewFlag & SvgViewFlag::Width) w = loaderData.doc->node.doc.w; - else { - w = loaderData.doc->node.doc.vw; - if (viewFlag & SvgViewFlag::WidthInPercent) { - w *= loaderData.doc->node.doc.w; - viewFlag = (viewFlag ^ SvgViewFlag::WidthInPercent); - } - viewFlag = (viewFlag | SvgViewFlag::Width); - } - if (viewFlag & SvgViewFlag::Height) h = loaderData.doc->node.doc.h; - else { - h = loaderData.doc->node.doc.vh; - if (viewFlag & SvgViewFlag::HeightInPercent) { - h *= loaderData.doc->node.doc.h; - viewFlag = (viewFlag ^ SvgViewFlag::HeightInPercent); - } - viewFlag = (viewFlag | SvgViewFlag::Height); - } - //In case no viewbox and width/height data is provided the completion of loading - //has to be forced, in order to establish this data based on the whole picture. - } else { - //Before loading, set default viewbox & size if they are empty - vx = vy = 0.0f; - if (viewFlag & SvgViewFlag::Width) { - vw = w = loaderData.doc->node.doc.w; - } else { - vw = 1.0f; - if (viewFlag & SvgViewFlag::WidthInPercent) { - w = loaderData.doc->node.doc.w; - } else w = 1.0f; - } - - if (viewFlag & SvgViewFlag::Height) { - vh = h = loaderData.doc->node.doc.h; - } else { - vh = 1.0f; - if (viewFlag & SvgViewFlag::HeightInPercent) { - h = loaderData.doc->node.doc.h; - } else h = 1.0f; - } - - run(0); - } - - return true; - } - - TVGLOG("SVG", "No SVG File. There is no "); - return false; -} - - -bool SvgLoader::open(const char* data, uint32_t size, bool copy) -{ - clear(); - - if (copy) { - content = (char*)malloc(size + 1); - if (!content) return false; - memcpy((char*)content, data, size); - content[size] = '\0'; - } else content = (char*)data; - - this->size = size; - this->copy = copy; - - return header(); -} - - -bool SvgLoader::open(const string& path) -{ - clear(); - - ifstream f; - f.open(path); - - if (!f.is_open()) return false; - - svgPath = path; - getline(f, filePath, '\0'); - f.close(); - - if (filePath.empty()) return false; - - content = (char*)filePath.c_str(); - size = filePath.size(); - - return header(); -} - - -bool SvgLoader::resize(Paint* paint, float w, float h) -{ - if (!paint) return false; - - auto sx = w / this->w; - auto sy = h / this->h; - Matrix m = {sx, 0, 0, 0, sy, 0, 0, 0, 1}; - paint->transform(m); - - return true; -} - - -bool SvgLoader::read() -{ - if (!content || size == 0) return false; - - //the loading has been already completed in header() - if (root || !LoadModule::read()) return true; - - TaskScheduler::request(this); - - return true; -} - - -bool SvgLoader::close() -{ - if (!LoadModule::close()) return false; - this->done(); - clear(); - return true; -} - - -Paint* SvgLoader::paint() -{ - this->done(); - auto ret = root; - root = nullptr; - return ret; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoader.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoader.h deleted file mode 100644 index d5cd7bb..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoader.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SVG_LOADER_H_ -#define _TVG_SVG_LOADER_H_ - -#include "tvgTaskScheduler.h" -#include "tvgSvgLoaderCommon.h" - -class SvgLoader : public ImageLoader, public Task -{ -public: - string filePath; - string svgPath = ""; - char* content = nullptr; - uint32_t size = 0; - - SvgLoaderData loaderData; - Scene* root = nullptr; - - bool copy = false; - - SvgLoader(); - ~SvgLoader(); - - bool open(const string& path) override; - bool open(const char* data, uint32_t size, bool copy) override; - bool resize(Paint* paint, float w, float h) override; - bool read() override; - bool close() override; - - Paint* paint() override; - -private: - SvgViewFlag viewFlag = SvgViewFlag::None; - AspectRatioAlign align = AspectRatioAlign::XMidYMid; - AspectRatioMeetOrSlice meetOrSlice = AspectRatioMeetOrSlice::Meet; - float vx = 0; - float vy = 0; - float vw = 0; - float vh = 0; - - bool header(); - void clear(bool all = true); - void run(unsigned tid) override; -}; - - -#endif //_TVG_SVG_LOADER_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoaderCommon.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoaderCommon.h deleted file mode 100644 index b037390..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgLoaderCommon.h +++ /dev/null @@ -1,577 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SVG_LOADER_COMMON_H_ -#define _TVG_SVG_LOADER_COMMON_H_ - -#include "tvgCommon.h" -#include "tvgArray.h" - -struct SvgNode; -struct SvgStyleGradient; - -//NOTE: Please update simpleXmlNodeTypeToString() as well. -enum class SvgNodeType -{ - Doc, - G, - Defs, - Animation, - Arc, - Circle, - Ellipse, - Image, - Line, - Path, - Polygon, - Polyline, - Rect, - Text, - TextArea, - Tspan, - Use, - Video, - ClipPath, - Mask, - CssStyle, - Symbol, - Unknown -}; - -/* -// TODO - remove? -enum class SvgLengthType -{ - Percent, - Px, - Pc, - Pt, - Mm, - Cm, - In, -}; -*/ - -enum class SvgFillFlags -{ - Paint = 0x01, - Opacity = 0x02, - Gradient = 0x04, - FillRule = 0x08, - ClipPath = 0x16 -}; - -constexpr bool operator &(SvgFillFlags a, SvgFillFlags b) -{ - return int(a) & int(b); -} - -constexpr SvgFillFlags operator |(SvgFillFlags a, SvgFillFlags b) -{ - return SvgFillFlags(int(a) | int(b)); -} - -enum class SvgStrokeFlags -{ - Paint = 0x1, - Opacity = 0x2, - Gradient = 0x4, - Scale = 0x8, - Width = 0x10, - Cap = 0x20, - Join = 0x40, - Dash = 0x80, - Miterlimit = 0x100, - DashOffset = 0x200 -}; - -constexpr bool operator &(SvgStrokeFlags a, SvgStrokeFlags b) -{ - return int(a) & int(b); -} - -constexpr SvgStrokeFlags operator |(SvgStrokeFlags a, SvgStrokeFlags b) -{ - return SvgStrokeFlags(int(a) | int(b)); -} - - -enum class SvgGradientType -{ - Linear, - Radial -}; - -enum class SvgStyleFlags -{ - Color = 0x01, - Fill = 0x02, - FillRule = 0x04, - FillOpacity = 0x08, - Opacity = 0x010, - Stroke = 0x20, - StrokeWidth = 0x40, - StrokeLineJoin = 0x80, - StrokeLineCap = 0x100, - StrokeOpacity = 0x200, - StrokeDashArray = 0x400, - Transform = 0x800, - ClipPath = 0x1000, - Mask = 0x2000, - MaskType = 0x4000, - Display = 0x8000, - PaintOrder = 0x10000, - StrokeMiterlimit = 0x20000, - StrokeDashOffset = 0x40000, -}; - -constexpr bool operator &(SvgStyleFlags a, SvgStyleFlags b) -{ - return int(a) & int(b); -} - -constexpr SvgStyleFlags operator |(SvgStyleFlags a, SvgStyleFlags b) -{ - return SvgStyleFlags(int(a) | int(b)); -} - -enum class SvgStopStyleFlags -{ - StopDefault = 0x0, - StopOpacity = 0x01, - StopColor = 0x02 -}; - -constexpr bool operator &(SvgStopStyleFlags a, SvgStopStyleFlags b) -{ - return int(a) & int(b); -} - -constexpr SvgStopStyleFlags operator |(SvgStopStyleFlags a, SvgStopStyleFlags b) -{ - return SvgStopStyleFlags(int(a) | int(b)); -} - -enum class SvgGradientFlags -{ - None = 0x0, - GradientUnits = 0x1, - SpreadMethod = 0x2, - X1 = 0x4, - X2 = 0x8, - Y1 = 0x10, - Y2 = 0x20, - Cx = 0x40, - Cy = 0x80, - R = 0x100, - Fx = 0x200, - Fy = 0x400, - Fr = 0x800 -}; - -constexpr bool operator &(SvgGradientFlags a, SvgGradientFlags b) -{ - return int(a) & int(b); -} - -constexpr SvgGradientFlags operator |(SvgGradientFlags a, SvgGradientFlags b) -{ - return SvgGradientFlags(int(a) | int(b)); -} - -enum class SvgFillRule -{ - Winding = 0, - OddEven = 1 -}; - -enum class SvgMaskType -{ - Luminance = 0, - Alpha -}; - -//Length type to recalculate %, pt, pc, mm, cm etc -enum class SvgParserLengthType -{ - Vertical, - Horizontal, - //In case of, for example, radius of radial gradient - Other -}; - -enum class SvgViewFlag -{ - None = 0x0, - Width = 0x01, //viewPort width - Height = 0x02, //viewPort height - Viewbox = 0x04, //viewBox x,y,w,h - used only if all 4 are correctly set - WidthInPercent = 0x08, - HeightInPercent = 0x10 -}; - -constexpr bool operator &(SvgViewFlag a, SvgViewFlag b) -{ - return static_cast(a) & static_cast(b); -} - -constexpr SvgViewFlag operator |(SvgViewFlag a, SvgViewFlag b) -{ - return SvgViewFlag(int(a) | int(b)); -} - -constexpr SvgViewFlag operator ^(SvgViewFlag a, SvgViewFlag b) -{ - return SvgViewFlag(int(a) ^ int(b)); -} - -enum class AspectRatioAlign -{ - None, - XMinYMin, - XMidYMin, - XMaxYMin, - XMinYMid, - XMidYMid, - XMaxYMid, - XMinYMax, - XMidYMax, - XMaxYMax -}; - -enum class AspectRatioMeetOrSlice -{ - Meet, - Slice -}; - -struct SvgDocNode -{ - float w; //unit: point or in percentage see: SvgViewFlag - float h; //unit: point or in percentage see: SvgViewFlag - float vx; - float vy; - float vw; - float vh; - SvgViewFlag viewFlag; - SvgNode* defs; - SvgNode* style; - AspectRatioAlign align; - AspectRatioMeetOrSlice meetOrSlice; -}; - -struct SvgGNode -{ -}; - -struct SvgDefsNode -{ - Array gradients; -}; - -struct SvgSymbolNode -{ - float w, h; - float vx, vy, vw, vh; - AspectRatioAlign align; - AspectRatioMeetOrSlice meetOrSlice; - bool overflowVisible; - bool hasViewBox; - bool hasWidth; - bool hasHeight; -}; - -struct SvgUseNode -{ - float x, y, w, h; - bool isWidthSet; - bool isHeightSet; - SvgNode* symbol; -}; - -struct SvgEllipseNode -{ - float cx; - float cy; - float rx; - float ry; -}; - -struct SvgCircleNode -{ - float cx; - float cy; - float r; -}; - -struct SvgRectNode -{ - float x; - float y; - float w; - float h; - float rx; - float ry; - bool hasRx; - bool hasRy; -}; - -struct SvgLineNode -{ - float x1; - float y1; - float x2; - float y2; -}; - -struct SvgImageNode -{ - float x, y, w, h; - char* href; -}; - -struct SvgPathNode -{ - char* path; -}; - -struct SvgPolygonNode -{ - Array pts; -}; - -struct SvgClipNode -{ - bool userSpace; -}; - -struct SvgMaskNode -{ - SvgMaskType type; - bool userSpace; -}; - -struct SvgCssStyleNode -{ -}; - -struct SvgLinearGradient -{ - float x1; - float y1; - float x2; - float y2; - bool isX1Percentage; - bool isY1Percentage; - bool isX2Percentage; - bool isY2Percentage; -}; - -struct SvgRadialGradient -{ - float cx; - float cy; - float fx; - float fy; - float r; - float fr; - bool isCxPercentage; - bool isCyPercentage; - bool isFxPercentage; - bool isFyPercentage; - bool isRPercentage; - bool isFrPercentage; -}; - -struct SvgComposite -{ - char *url; - SvgNode* node; - bool applying; //flag for checking circular dependency. -}; - -struct SvgColor -{ - uint8_t r; - uint8_t g; - uint8_t b; -}; - -struct SvgPaint -{ - SvgStyleGradient* gradient; - char *url; - SvgColor color; - bool none; - bool curColor; -}; - -struct SvgDash -{ - Array array; - float offset; -}; - -struct SvgStyleGradient -{ - SvgGradientType type; - char* id; - char* ref; - FillSpread spread; - SvgRadialGradient* radial; - SvgLinearGradient* linear; - Matrix* transform; - Array stops; - SvgGradientFlags flags; - bool userSpace; - - void clear() - { - stops.reset(); - free(transform); - free(radial); - free(linear); - free(ref); - free(id); - } -}; - -struct SvgStyleFill -{ - SvgFillFlags flags; - SvgPaint paint; - int opacity; - FillRule fillRule; -}; - -struct SvgStyleStroke -{ - SvgStrokeFlags flags; - SvgPaint paint; - int opacity; - float scale; - float width; - float centered; - StrokeCap cap; - StrokeJoin join; - float miterlimit; - SvgDash dash; -}; - -struct SvgStyleProperty -{ - SvgStyleFill fill; - SvgStyleStroke stroke; - SvgComposite clipPath; - SvgComposite mask; - int opacity; - SvgColor color; - char* cssClass; - SvgStyleFlags flags; - SvgStyleFlags flagsImportance; //indicates the importance of the flag - if set, higher priority is applied (https://drafts.csswg.org/css-cascade-4/#importance) - bool curColorSet; - bool paintOrder; //true if default (fill, stroke), false otherwise - bool display; -}; - -struct SvgNode -{ - SvgNodeType type; - SvgNode* parent; - Array child; - char *id; - SvgStyleProperty *style; - Matrix* transform; - union { - SvgGNode g; - SvgDocNode doc; - SvgDefsNode defs; - SvgUseNode use; - SvgCircleNode circle; - SvgEllipseNode ellipse; - SvgPolygonNode polygon; - SvgPolygonNode polyline; - SvgRectNode rect; - SvgPathNode path; - SvgLineNode line; - SvgImageNode image; - SvgMaskNode mask; - SvgClipNode clip; - SvgCssStyleNode cssStyle; - SvgSymbolNode symbol; - } node; - ~SvgNode(); -}; - -struct SvgParser -{ - SvgNode* node; - SvgStyleGradient* styleGrad; - Fill::ColorStop gradStop; - SvgStopStyleFlags flags; - struct - { - float x, y, w, h; - } global; - struct - { - bool parsedFx; - bool parsedFy; - } gradient; -}; - -struct SvgNodeIdPair -{ - SvgNode* node; - char *id; -}; - -struct SvgLoaderData -{ - Array stack; - SvgNode* doc = nullptr; - SvgNode* def = nullptr; - SvgNode* cssStyle = nullptr; - Array gradients; - SvgStyleGradient* latestGradient = nullptr; //For stops - SvgParser* svgParse = nullptr; - Array cloneNodes; - Array nodesToStyle; - Array images; //embedded images - int level = 0; - bool result = false; - bool style = false; - SvgNode* currentGraphicsNode = nullptr; -}; - -struct Box -{ - float x, y, w, h; -}; - -#endif - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgPath.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgPath.cpp deleted file mode 100644 index 42312c3..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgPath.cpp +++ /dev/null @@ -1,577 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -/* - * Copyright notice for the EFL: - - * Copyright (C) EFL developers (see AUTHORS) - - * 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. - - * THIS SOFTWARE IS PROVIDED "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 - * COPYRIGHT HOLDER 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. -*/ - -#define _USE_MATH_DEFINES //Math Constants are not defined in Standard C/C++. - -#include -#include -#include "tvgMath.h" -#include "tvgShape.h" -#include "tvgSvgLoaderCommon.h" -#include "tvgSvgPath.h" -#include "tvgStr.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static char* _skipComma(const char* content) -{ - while (*content && isspace(*content)) { - content++; - } - if (*content == ',') return (char*)content + 1; - return (char*)content; -} - - -static bool _parseNumber(char** content, float* number) -{ - char* end = NULL; - *number = strToFloat(*content, &end); - //If the start of string is not number - if ((*content) == end) return false; - //Skip comma if any - *content = _skipComma(end); - return true; -} - - -static bool _parseFlag(char** content, int* number) -{ - char* end = NULL; - if (*(*content) != '0' && *(*content) != '1') return false; - *number = *(*content) - '0'; - *content += 1; - end = *content; - *content = _skipComma(end); - - return true; -} - - -void _pathAppendArcTo(Array* cmds, Array* pts, Point* cur, Point* curCtl, float x, float y, float rx, float ry, float angle, bool largeArc, bool sweep) -{ - float cxp, cyp, cx, cy; - float sx, sy; - float cosPhi, sinPhi; - float dx2, dy2; - float x1p, y1p; - float x1p2, y1p2; - float rx2, ry2; - float lambda; - float c; - float at; - float theta1, deltaTheta; - float nat; - float delta, bcp; - float cosPhiRx, cosPhiRy; - float sinPhiRx, sinPhiRy; - float cosTheta1, sinTheta1; - int segments; - - //Some helpful stuff is available here: - //http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes - sx = cur->x; - sy = cur->y; - - //Correction of out-of-range radii, see F6.6.1 (step 2) - rx = fabsf(rx); - ry = fabsf(ry); - - angle = mathDeg2Rad(angle); - cosPhi = cosf(angle); - sinPhi = sinf(angle); - dx2 = (sx - x) / 2.0f; - dy2 = (sy - y) / 2.0f; - x1p = cosPhi * dx2 + sinPhi * dy2; - y1p = cosPhi * dy2 - sinPhi * dx2; - x1p2 = x1p * x1p; - y1p2 = y1p * y1p; - rx2 = rx * rx; - ry2 = ry * ry; - lambda = (x1p2 / rx2) + (y1p2 / ry2); - - //Correction of out-of-range radii, see F6.6.2 (step 4) - if (lambda > 1.0f) { - //See F6.6.3 - float lambdaRoot = sqrtf(lambda); - - rx *= lambdaRoot; - ry *= lambdaRoot; - //Update rx2 and ry2 - rx2 = rx * rx; - ry2 = ry * ry; - } - - c = (rx2 * ry2) - (rx2 * y1p2) - (ry2 * x1p2); - - //Check if there is no possible solution - //(i.e. we can't do a square root of a negative value) - if (c < 0.0f) { - //Scale uniformly until we have a single solution - //(see F6.2) i.e. when c == 0.0 - float scale = sqrtf(1.0f - c / (rx2 * ry2)); - rx *= scale; - ry *= scale; - //Update rx2 and ry2 - rx2 = rx * rx; - ry2 = ry * ry; - - //Step 2 (F6.5.2) - simplified since c == 0.0 - cxp = 0.0f; - cyp = 0.0f; - //Step 3 (F6.5.3 first part) - simplified since cxp and cyp == 0.0 - cx = 0.0f; - cy = 0.0f; - } else { - //Complete c calculation - c = sqrtf(c / ((rx2 * y1p2) + (ry2 * x1p2))); - //Inverse sign if Fa == Fs - if (largeArc == sweep) c = -c; - - //Step 2 (F6.5.2) - cxp = c * (rx * y1p / ry); - cyp = c * (-ry * x1p / rx); - - //Step 3 (F6.5.3 first part) - cx = cosPhi * cxp - sinPhi * cyp; - cy = sinPhi * cxp + cosPhi * cyp; - } - - //Step 3 (F6.5.3 second part) we now have the center point of the ellipse - cx += (sx + x) / 2.0f; - cy += (sy + y) / 2.0f; - - //Step 4 (F6.5.4) - //We dont' use arccos (as per w3c doc), see - //http://www.euclideanspace.com/maths/algebra/vectors/angleBetween/index.htm - //Note: atan2 (0.0, 1.0) == 0.0 - at = atan2(((y1p - cyp) / ry), ((x1p - cxp) / rx)); - theta1 = (at < 0.0f) ? 2.0f * MATH_PI + at : at; - - nat = atan2(((-y1p - cyp) / ry), ((-x1p - cxp) / rx)); - deltaTheta = (nat < at) ? 2.0f * MATH_PI - at + nat : nat - at; - - if (sweep) { - //Ensure delta theta < 0 or else add 360 degrees - if (deltaTheta < 0.0f) deltaTheta += 2.0f * MATH_PI; - } else { - //Ensure delta theta > 0 or else substract 360 degrees - if (deltaTheta > 0.0f) deltaTheta -= 2.0f * MATH_PI; - } - - //Add several cubic bezier to approximate the arc - //(smaller than 90 degrees) - //We add one extra segment because we want something - //Smaller than 90deg (i.e. not 90 itself) - segments = static_cast(fabsf(deltaTheta / MATH_PI2) + 1.0f); - delta = deltaTheta / segments; - - //http://www.stillhq.com/ctpfaq/2001/comp.text.pdf-faq-2001-04.txt (section 2.13) - bcp = 4.0f / 3.0f * (1.0f - cosf(delta / 2.0f)) / sinf(delta / 2.0f); - - cosPhiRx = cosPhi * rx; - cosPhiRy = cosPhi * ry; - sinPhiRx = sinPhi * rx; - sinPhiRy = sinPhi * ry; - - cosTheta1 = cosf(theta1); - sinTheta1 = sinf(theta1); - - for (int i = 0; i < segments; ++i) { - //End angle (for this segment) = current + delta - float c1x, c1y, ex, ey, c2x, c2y; - float theta2 = theta1 + delta; - float cosTheta2 = cosf(theta2); - float sinTheta2 = sinf(theta2); - Point p[3]; - - //First control point (based on start point sx,sy) - c1x = sx - bcp * (cosPhiRx * sinTheta1 + sinPhiRy * cosTheta1); - c1y = sy + bcp * (cosPhiRy * cosTheta1 - sinPhiRx * sinTheta1); - - //End point (for this segment) - ex = cx + (cosPhiRx * cosTheta2 - sinPhiRy * sinTheta2); - ey = cy + (sinPhiRx * cosTheta2 + cosPhiRy * sinTheta2); - - //Second control point (based on end point ex,ey) - c2x = ex + bcp * (cosPhiRx * sinTheta2 + sinPhiRy * cosTheta2); - c2y = ey + bcp * (sinPhiRx * sinTheta2 - cosPhiRy * cosTheta2); - cmds->push(PathCommand::CubicTo); - p[0] = {c1x, c1y}; - p[1] = {c2x, c2y}; - p[2] = {ex, ey}; - pts->push(p[0]); - pts->push(p[1]); - pts->push(p[2]); - *curCtl = p[1]; - *cur = p[2]; - - //Next start point is the current end point (same for angle) - sx = ex; - sy = ey; - theta1 = theta2; - //Avoid recomputations - cosTheta1 = cosTheta2; - sinTheta1 = sinTheta2; - } -} - -static int _numberCount(char cmd) -{ - int count = 0; - switch (cmd) { - case 'M': - case 'm': - case 'L': - case 'l': - case 'T': - case 't': { - count = 2; - break; - } - case 'C': - case 'c': - case 'E': - case 'e': { - count = 6; - break; - } - case 'H': - case 'h': - case 'V': - case 'v': { - count = 1; - break; - } - case 'S': - case 's': - case 'Q': - case 'q': { - count = 4; - break; - } - case 'A': - case 'a': { - count = 7; - break; - } - default: - break; - } - return count; -} - - -static bool _processCommand(Array* cmds, Array* pts, char cmd, float* arr, int count, Point* cur, Point* curCtl, Point* startPoint, bool *isQuadratic, bool* closed) -{ - switch (cmd) { - case 'm': - case 'l': - case 'c': - case 's': - case 'q': - case 't': { - for (int i = 0; i < count - 1; i += 2) { - arr[i] = arr[i] + cur->x; - arr[i + 1] = arr[i + 1] + cur->y; - } - break; - } - case 'h': { - arr[0] = arr[0] + cur->x; - break; - } - case 'v': { - arr[0] = arr[0] + cur->y; - break; - } - case 'a': { - arr[5] = arr[5] + cur->x; - arr[6] = arr[6] + cur->y; - break; - } - default: { - break; - } - } - - switch (cmd) { - case 'm': - case 'M': { - Point p = {arr[0], arr[1]}; - cmds->push(PathCommand::MoveTo); - pts->push(p); - *cur = {arr[0], arr[1]}; - *startPoint = {arr[0], arr[1]}; - break; - } - case 'l': - case 'L': { - Point p = {arr[0], arr[1]}; - cmds->push(PathCommand::LineTo); - pts->push(p); - *cur = {arr[0], arr[1]}; - break; - } - case 'c': - case 'C': { - Point p[3]; - cmds->push(PathCommand::CubicTo); - p[0] = {arr[0], arr[1]}; - p[1] = {arr[2], arr[3]}; - p[2] = {arr[4], arr[5]}; - pts->push(p[0]); - pts->push(p[1]); - pts->push(p[2]); - *curCtl = p[1]; - *cur = p[2]; - *isQuadratic = false; - break; - } - case 's': - case 'S': { - Point p[3], ctrl; - if ((cmds->count > 1) && (cmds->last() == PathCommand::CubicTo) && - !(*isQuadratic)) { - ctrl.x = 2 * cur->x - curCtl->x; - ctrl.y = 2 * cur->y - curCtl->y; - } else { - ctrl = *cur; - } - cmds->push(PathCommand::CubicTo); - p[0] = ctrl; - p[1] = {arr[0], arr[1]}; - p[2] = {arr[2], arr[3]}; - pts->push(p[0]); - pts->push(p[1]); - pts->push(p[2]); - *curCtl = p[1]; - *cur = p[2]; - *isQuadratic = false; - break; - } - case 'q': - case 'Q': { - Point p[3]; - float ctrl_x0 = (cur->x + 2 * arr[0]) * (1.0f / 3.0f); - float ctrl_y0 = (cur->y + 2 * arr[1]) * (1.0f / 3.0f); - float ctrl_x1 = (arr[2] + 2 * arr[0]) * (1.0f / 3.0f); - float ctrl_y1 = (arr[3] + 2 * arr[1]) * (1.0f / 3.0f); - cmds->push(PathCommand::CubicTo); - p[0] = {ctrl_x0, ctrl_y0}; - p[1] = {ctrl_x1, ctrl_y1}; - p[2] = {arr[2], arr[3]}; - pts->push(p[0]); - pts->push(p[1]); - pts->push(p[2]); - *curCtl = {arr[0], arr[1]}; - *cur = p[2]; - *isQuadratic = true; - break; - } - case 't': - case 'T': { - Point p[3], ctrl; - if ((cmds->count > 1) && (cmds->last() == PathCommand::CubicTo) && - *isQuadratic) { - ctrl.x = 2 * cur->x - curCtl->x; - ctrl.y = 2 * cur->y - curCtl->y; - } else { - ctrl = *cur; - } - float ctrl_x0 = (cur->x + 2 * ctrl.x) * (1.0f / 3.0f); - float ctrl_y0 = (cur->y + 2 * ctrl.y) * (1.0f / 3.0f); - float ctrl_x1 = (arr[0] + 2 * ctrl.x) * (1.0f / 3.0f); - float ctrl_y1 = (arr[1] + 2 * ctrl.y) * (1.0f / 3.0f); - cmds->push(PathCommand::CubicTo); - p[0] = {ctrl_x0, ctrl_y0}; - p[1] = {ctrl_x1, ctrl_y1}; - p[2] = {arr[0], arr[1]}; - pts->push(p[0]); - pts->push(p[1]); - pts->push(p[2]); - *curCtl = {ctrl.x, ctrl.y}; - *cur = p[2]; - *isQuadratic = true; - break; - } - case 'h': - case 'H': { - Point p = {arr[0], cur->y}; - cmds->push(PathCommand::LineTo); - pts->push(p); - cur->x = arr[0]; - break; - } - case 'v': - case 'V': { - Point p = {cur->x, arr[0]}; - cmds->push(PathCommand::LineTo); - pts->push(p); - cur->y = arr[0]; - break; - } - case 'z': - case 'Z': { - cmds->push(PathCommand::Close); - *cur = *startPoint; - *closed = true; - break; - } - case 'a': - case 'A': { - if (mathZero(arr[0]) || mathZero(arr[1])) { - Point p = {arr[5], arr[6]}; - cmds->push(PathCommand::LineTo); - pts->push(p); - *cur = {arr[5], arr[6]}; - } else if (!mathEqual(cur->x, arr[5]) || !mathEqual(cur->y, arr[6])) { - _pathAppendArcTo(cmds, pts, cur, curCtl, arr[5], arr[6], fabsf(arr[0]), fabsf(arr[1]), arr[2], arr[3], arr[4]); - *cur = *curCtl = {arr[5], arr[6]}; - *isQuadratic = false; - } - break; - } - default: { - return false; - } - } - return true; -} - - -static char* _nextCommand(char* path, char* cmd, float* arr, int* count, bool* closed) -{ - int large, sweep; - - path = _skipComma(path); - if (isalpha(*path)) { - *cmd = *path; - path++; - *count = _numberCount(*cmd); - } else { - if (*cmd == 'm') *cmd = 'l'; - else if (*cmd == 'M') *cmd = 'L'; - else { - if (*closed) return nullptr; - } - } - if (*count == 7) { - //Special case for arc command - if (_parseNumber(&path, &arr[0])) { - if (_parseNumber(&path, &arr[1])) { - if (_parseNumber(&path, &arr[2])) { - if (_parseFlag(&path, &large)) { - if (_parseFlag(&path, &sweep)) { - if (_parseNumber(&path, &arr[5])) { - if (_parseNumber(&path, &arr[6])) { - arr[3] = (float)large; - arr[4] = (float)sweep; - return path; - } - } - } - } - } - } - } - *count = 0; - return NULL; - } - for (int i = 0; i < *count; i++) { - if (!_parseNumber(&path, &arr[i])) { - *count = 0; - return NULL; - } - path = _skipComma(path); - } - return path; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - - -bool svgPathToShape(const char* svgPath, Shape* shape) -{ - float numberArray[7]; - int numberCount = 0; - Point cur = { 0, 0 }; - Point curCtl = { 0, 0 }; - Point startPoint = { 0, 0 }; - char cmd = 0; - bool isQuadratic = false; - bool closed = false; - char* path = (char*)svgPath; - - auto& pts = P(shape)->rs.path.pts; - auto& cmds = P(shape)->rs.path.cmds; - auto lastCmds = cmds.count; - - while ((path[0] != '\0')) { - path = _nextCommand(path, &cmd, numberArray, &numberCount, &closed); - if (!path) break; - closed = false; - if (!_processCommand(&cmds, &pts, cmd, numberArray, numberCount, &cur, &curCtl, &startPoint, &isQuadratic, &closed)) break; - } - - if (cmds.count > lastCmds && cmds[lastCmds] != PathCommand::MoveTo) return false; - return true; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgPath.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgPath.h deleted file mode 100644 index 673fa0d..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgPath.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SVG_PATH_H_ -#define _TVG_SVG_PATH_H_ - -#include "tvgCommon.h" - -bool svgPathToShape(const char* svgPath, Shape* shape); - -#endif //_TVG_SVG_PATH_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgSceneBuilder.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgSceneBuilder.cpp deleted file mode 100644 index 585e487..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgSceneBuilder.cpp +++ /dev/null @@ -1,888 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgMath.h" /* to include math.h before cstring */ -#include -#include -#include "tvgShape.h" -#include "tvgCompressor.h" -#include "tvgPaint.h" -#include "tvgFill.h" -#include "tvgStr.h" -#include "tvgSvgLoaderCommon.h" -#include "tvgSvgSceneBuilder.h" -#include "tvgSvgPath.h" -#include "tvgSvgUtil.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static bool _appendShape(SvgLoaderData& loaderData, SvgNode* node, Shape* shape, const Box& vBox, const string& svgPath); -static bool _appendClipShape(SvgLoaderData& loaderData, SvgNode* node, Shape* shape, const Box& vBox, const string& svgPath, const Matrix* transform); -static unique_ptr _sceneBuildHelper(SvgLoaderData& loaderData, const SvgNode* node, const Box& vBox, const string& svgPath, bool mask, int depth, bool* isMaskWhite = nullptr); - - -static inline bool _isGroupType(SvgNodeType type) -{ - if (type == SvgNodeType::Doc || type == SvgNodeType::G || type == SvgNodeType::Use || type == SvgNodeType::ClipPath || type == SvgNodeType::Symbol) return true; - return false; -} - - -//According to: https://www.w3.org/TR/SVG11/coords.html#ObjectBoundingBoxUnits (the last paragraph) -//a stroke width should be ignored for bounding box calculations -static Box _boundingBox(const Shape* shape) -{ - float x, y, w, h; - shape->bounds(&x, &y, &w, &h, false); - - if (auto strokeW = shape->strokeWidth()) { - x += 0.5f * strokeW; - y += 0.5f * strokeW; - w -= strokeW; - h -= strokeW; - } - - return {x, y, w, h}; -} - - -static void _transformMultiply(const Matrix* mBBox, Matrix* gradTransf) -{ - gradTransf->e13 = gradTransf->e13 * mBBox->e11 + mBBox->e13; - gradTransf->e12 *= mBBox->e11; - gradTransf->e11 *= mBBox->e11; - - gradTransf->e23 = gradTransf->e23 * mBBox->e22 + mBBox->e23; - gradTransf->e22 *= mBBox->e22; - gradTransf->e21 *= mBBox->e22; -} - - -static unique_ptr _applyLinearGradientProperty(SvgStyleGradient* g, const Shape* vg, const Box& vBox, int opacity) -{ - Fill::ColorStop* stops; - int stopCount = 0; - auto fillGrad = LinearGradient::gen(); - - bool isTransform = (g->transform ? true : false); - Matrix finalTransform = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - if (isTransform) finalTransform = *g->transform; - - if (g->userSpace) { - g->linear->x1 = g->linear->x1 * vBox.w; - g->linear->y1 = g->linear->y1 * vBox.h; - g->linear->x2 = g->linear->x2 * vBox.w; - g->linear->y2 = g->linear->y2 * vBox.h; - } else { - Matrix m = {vBox.w, 0, vBox.x, 0, vBox.h, vBox.y, 0, 0, 1}; - if (isTransform) _transformMultiply(&m, &finalTransform); - else { - finalTransform = m; - isTransform = true; - } - } - - if (isTransform) fillGrad->transform(finalTransform); - - fillGrad->linear(g->linear->x1, g->linear->y1, g->linear->x2, g->linear->y2); - fillGrad->spread(g->spread); - - //Update the stops - stopCount = g->stops.count; - if (stopCount > 0) { - stops = (Fill::ColorStop*)calloc(stopCount, sizeof(Fill::ColorStop)); - if (!stops) return fillGrad; - auto prevOffset = 0.0f; - for (uint32_t i = 0; i < g->stops.count; ++i) { - auto colorStop = &g->stops[i]; - //Use premultiplied color - stops[i].r = colorStop->r; - stops[i].g = colorStop->g; - stops[i].b = colorStop->b; - stops[i].a = static_cast((colorStop->a * opacity) / 255); - stops[i].offset = colorStop->offset; - //check the offset corner cases - refer to: https://svgwg.org/svg2-draft/pservers.html#StopNotes - if (colorStop->offset < prevOffset) stops[i].offset = prevOffset; - else if (colorStop->offset > 1) stops[i].offset = 1; - prevOffset = stops[i].offset; - } - fillGrad->colorStops(stops, stopCount); - free(stops); - } - return fillGrad; -} - - -static unique_ptr _applyRadialGradientProperty(SvgStyleGradient* g, const Shape* vg, const Box& vBox, int opacity) -{ - Fill::ColorStop *stops; - int stopCount = 0; - auto fillGrad = RadialGradient::gen(); - - bool isTransform = (g->transform ? true : false); - Matrix finalTransform = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - if (isTransform) finalTransform = *g->transform; - - if (g->userSpace) { - //The radius scaling is done according to the Units section: - //https://www.w3.org/TR/2015/WD-SVG2-20150915/coords.html - g->radial->cx = g->radial->cx * vBox.w; - g->radial->cy = g->radial->cy * vBox.h; - g->radial->r = g->radial->r * sqrtf(powf(vBox.w, 2.0f) + powf(vBox.h, 2.0f)) / sqrtf(2.0f); - g->radial->fx = g->radial->fx * vBox.w; - g->radial->fy = g->radial->fy * vBox.h; - g->radial->fr = g->radial->fr * sqrtf(powf(vBox.w, 2.0f) + powf(vBox.h, 2.0f)) / sqrtf(2.0f); - } else { - Matrix m = {vBox.w, 0, vBox.x, 0, vBox.h, vBox.y, 0, 0, 1}; - if (isTransform) _transformMultiply(&m, &finalTransform); - else { - finalTransform = m; - isTransform = true; - } - } - - if (isTransform) fillGrad->transform(finalTransform); - - P(fillGrad)->radial(g->radial->cx, g->radial->cy, g->radial->r, g->radial->fx, g->radial->fy, g->radial->fr); - fillGrad->spread(g->spread); - - //Update the stops - stopCount = g->stops.count; - if (stopCount > 0) { - stops = (Fill::ColorStop*)calloc(stopCount, sizeof(Fill::ColorStop)); - if (!stops) return fillGrad; - auto prevOffset = 0.0f; - for (uint32_t i = 0; i < g->stops.count; ++i) { - auto colorStop = &g->stops[i]; - //Use premultiplied color - stops[i].r = colorStop->r; - stops[i].g = colorStop->g; - stops[i].b = colorStop->b; - stops[i].a = static_cast((colorStop->a * opacity) / 255); - stops[i].offset = colorStop->offset; - //check the offset corner cases - refer to: https://svgwg.org/svg2-draft/pservers.html#StopNotes - if (colorStop->offset < prevOffset) stops[i].offset = prevOffset; - else if (colorStop->offset > 1) stops[i].offset = 1; - prevOffset = stops[i].offset; - } - fillGrad->colorStops(stops, stopCount); - free(stops); - } - return fillGrad; -} - - -//The SVG standard allows only for 'use' nodes that point directly to a basic shape. -static bool _appendClipUseNode(SvgLoaderData& loaderData, SvgNode* node, Shape* shape, const Box& vBox, const string& svgPath) -{ - if (node->child.count != 1) return false; - auto child = *(node->child.data); - - Matrix finalTransform = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - if (node->transform) finalTransform = *node->transform; - if (node->node.use.x != 0.0f || node->node.use.y != 0.0f) { - Matrix m = {1, 0, node->node.use.x, 0, 1, node->node.use.y, 0, 0, 1}; - finalTransform = mathMultiply(&finalTransform, &m); - } - if (child->transform) finalTransform = mathMultiply(child->transform, &finalTransform); - - return _appendClipShape(loaderData, child, shape, vBox, svgPath, mathIdentity((const Matrix*)(&finalTransform)) ? nullptr : &finalTransform); -} - - -static bool _appendClipChild(SvgLoaderData& loaderData, SvgNode* node, Shape* shape, const Box& vBox, const string& svgPath, bool clip) -{ - if (node->type == SvgNodeType::Use) { - return _appendClipUseNode(loaderData, node, shape, vBox, svgPath); - } - return _appendClipShape(loaderData, node, shape, vBox, svgPath, nullptr); -} - - -static Matrix _compositionTransform(Paint* paint, const SvgNode* node, const SvgNode* compNode, SvgNodeType type) -{ - Matrix m = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - //The initial mask transformation ignored according to the SVG standard. - if (node->transform && type != SvgNodeType::Mask) { - m = *node->transform; - } - if (compNode->transform) { - m = mathMultiply(&m, compNode->transform); - } - if (!compNode->node.clip.userSpace) { - float x, y, w, h; - P(paint)->bounds(&x, &y, &w, &h, false, false); - Matrix mBBox = {w, 0, x, 0, h, y, 0, 0, 1}; - m = mathMultiply(&m, &mBBox); - } - return m; -} - - -static void _applyComposition(SvgLoaderData& loaderData, Paint* paint, const SvgNode* node, const Box& vBox, const string& svgPath) -{ - /* ClipPath */ - /* Do not drop in Circular Dependency for ClipPath. - Composition can be applied recursively if its children nodes have composition target to this one. */ - if (node->style->clipPath.applying) { - TVGLOG("SVG", "Multiple Composition Tried! Check out Circular dependency?"); - } else { - auto compNode = node->style->clipPath.node; - if (compNode && compNode->child.count > 0) { - node->style->clipPath.applying = true; - - auto comp = Shape::gen(); - - auto child = compNode->child.data; - auto valid = false; //Composite only when valid shapes exist - - for (uint32_t i = 0; i < compNode->child.count; ++i, ++child) { - if (_appendClipChild(loaderData, *child, comp.get(), vBox, svgPath, compNode->child.count > 1)) valid = true; - } - - if (valid) { - Matrix finalTransform = _compositionTransform(paint, node, compNode, SvgNodeType::ClipPath); - comp->transform(finalTransform); - - paint->composite(std::move(comp), CompositeMethod::ClipPath); - } - - node->style->clipPath.applying = false; - } - } - - /* Mask */ - /* Do not drop in Circular Dependency for Mask. - Composition can be applied recursively if its children nodes have composition target to this one. */ - if (node->style->mask.applying) { - TVGLOG("SVG", "Multiple Composition Tried! Check out Circular dependency?"); - } else { - auto compNode = node->style->mask.node; - if (compNode && compNode->child.count > 0) { - node->style->mask.applying = true; - - bool isMaskWhite = true; - if (auto comp = _sceneBuildHelper(loaderData, compNode, vBox, svgPath, true, 0, &isMaskWhite)) { - if (!compNode->node.mask.userSpace) { - Matrix finalTransform = _compositionTransform(paint, node, compNode, SvgNodeType::Mask); - comp->transform(finalTransform); - } else { - if (node->transform) comp->transform(*node->transform); - } - - if (compNode->node.mask.type == SvgMaskType::Luminance && !isMaskWhite) { - paint->composite(std::move(comp), CompositeMethod::LumaMask); - } else { - paint->composite(std::move(comp), CompositeMethod::AlphaMask); - } - } - - node->style->mask.applying = false; - } - } -} - - -static void _applyProperty(SvgLoaderData& loaderData, SvgNode* node, Shape* vg, const Box& vBox, const string& svgPath, bool clip) -{ - SvgStyleProperty* style = node->style; - - //Clip transformation is applied directly to the path in the _appendClipShape function - if (node->transform && !clip) vg->transform(*node->transform); - if (node->type == SvgNodeType::Doc || !node->style->display) return; - - //If fill property is nullptr then do nothing - if (style->fill.paint.none) { - //Do nothing - } else if (style->fill.paint.gradient) { - Box bBox = vBox; - if (!style->fill.paint.gradient->userSpace) bBox = _boundingBox(vg); - - if (style->fill.paint.gradient->type == SvgGradientType::Linear) { - auto linear = _applyLinearGradientProperty(style->fill.paint.gradient, vg, bBox, style->fill.opacity); - vg->fill(std::move(linear)); - } else if (style->fill.paint.gradient->type == SvgGradientType::Radial) { - auto radial = _applyRadialGradientProperty(style->fill.paint.gradient, vg, bBox, style->fill.opacity); - vg->fill(std::move(radial)); - } - } else if (style->fill.paint.url) { - //TODO: Apply the color pointed by url - } else if (style->fill.paint.curColor) { - //Apply the current style color - vg->fill(style->color.r, style->color.g, style->color.b, style->fill.opacity); - } else { - //Apply the fill color - vg->fill(style->fill.paint.color.r, style->fill.paint.color.g, style->fill.paint.color.b, style->fill.opacity); - } - - //Apply the fill rule - vg->fill((tvg::FillRule)style->fill.fillRule); - //Rendering order - vg->order(!style->paintOrder); - - //Apply node opacity - if (style->opacity < 255) vg->opacity(style->opacity); - - if (node->type == SvgNodeType::G || node->type == SvgNodeType::Use) return; - - //Apply the stroke style property - vg->stroke(style->stroke.width); - vg->stroke(style->stroke.cap); - vg->stroke(style->stroke.join); - vg->strokeMiterlimit(style->stroke.miterlimit); - if (style->stroke.dash.array.count > 0) { - P(vg)->strokeDash(style->stroke.dash.array.data, style->stroke.dash.array.count, style->stroke.dash.offset); - } - - //If stroke property is nullptr then do nothing - if (style->stroke.paint.none) { - vg->stroke(0.0f); - } else if (style->stroke.paint.gradient) { - Box bBox = vBox; - if (!style->stroke.paint.gradient->userSpace) bBox = _boundingBox(vg); - - if (style->stroke.paint.gradient->type == SvgGradientType::Linear) { - auto linear = _applyLinearGradientProperty(style->stroke.paint.gradient, vg, bBox, style->stroke.opacity); - vg->stroke(std::move(linear)); - } else if (style->stroke.paint.gradient->type == SvgGradientType::Radial) { - auto radial = _applyRadialGradientProperty(style->stroke.paint.gradient, vg, bBox, style->stroke.opacity); - vg->stroke(std::move(radial)); - } - } else if (style->stroke.paint.url) { - //TODO: Apply the color pointed by url - } else if (style->stroke.paint.curColor) { - //Apply the current style color - vg->stroke(style->color.r, style->color.g, style->color.b, style->stroke.opacity); - } else { - //Apply the stroke color - vg->stroke(style->stroke.paint.color.r, style->stroke.paint.color.g, style->stroke.paint.color.b, style->stroke.opacity); - } - - _applyComposition(loaderData, vg, node, vBox, svgPath); -} - - -static unique_ptr _shapeBuildHelper(SvgLoaderData& loaderData, SvgNode* node, const Box& vBox, const string& svgPath) -{ - auto shape = Shape::gen(); - if (_appendShape(loaderData, node, shape.get(), vBox, svgPath)) return shape; - else return nullptr; -} - - -static bool _recognizeShape(SvgNode* node, Shape* shape) -{ - switch (node->type) { - case SvgNodeType::Path: { - if (node->node.path.path) { - if (!svgPathToShape(node->node.path.path, shape)) { - TVGERR("SVG", "Invalid path information."); - return false; - } - } - break; - } - case SvgNodeType::Ellipse: { - shape->appendCircle(node->node.ellipse.cx, node->node.ellipse.cy, node->node.ellipse.rx, node->node.ellipse.ry); - break; - } - case SvgNodeType::Polygon: { - if (node->node.polygon.pts.count < 2) break; - auto pts = node->node.polygon.pts.begin(); - shape->moveTo(pts[0], pts[1]); - for (pts += 2; pts < node->node.polygon.pts.end(); pts += 2) { - shape->lineTo(pts[0], pts[1]); - } - shape->close(); - break; - } - case SvgNodeType::Polyline: { - if (node->node.polyline.pts.count < 2) break; - auto pts = node->node.polyline.pts.begin(); - shape->moveTo(pts[0], pts[1]); - for (pts += 2; pts < node->node.polyline.pts.end(); pts += 2) { - shape->lineTo(pts[0], pts[1]); - } - break; - } - case SvgNodeType::Circle: { - shape->appendCircle(node->node.circle.cx, node->node.circle.cy, node->node.circle.r, node->node.circle.r); - break; - } - case SvgNodeType::Rect: { - shape->appendRect(node->node.rect.x, node->node.rect.y, node->node.rect.w, node->node.rect.h, node->node.rect.rx, node->node.rect.ry); - break; - } - case SvgNodeType::Line: { - shape->moveTo(node->node.line.x1, node->node.line.y1); - shape->lineTo(node->node.line.x2, node->node.line.y2); - break; - } - default: { - return false; - } - } - return true; -} - - -static bool _appendShape(SvgLoaderData& loaderData, SvgNode* node, Shape* shape, const Box& vBox, const string& svgPath) -{ - if (!_recognizeShape(node, shape)) return false; - - _applyProperty(loaderData, node, shape, vBox, svgPath, false); - return true; -} - - -static bool _appendClipShape(SvgLoaderData& loaderData, SvgNode* node, Shape* shape, const Box& vBox, const string& svgPath, const Matrix* transform) -{ - //The 'transform' matrix has higher priority than the node->transform, since it already contains it - auto m = transform ? transform : (node->transform ? node->transform : nullptr); - - uint32_t currentPtsCnt = 0; - if (m) { - const Point *tmp = nullptr; - currentPtsCnt = shape->pathCoords(&tmp); - } - - if (!_recognizeShape(node, shape)) return false; - - if (m) { - const Point *pts = nullptr; - auto ptsCnt = shape->pathCoords(&pts); - - auto p = const_cast(pts) + currentPtsCnt; - while (currentPtsCnt++ < ptsCnt) mathMultiply(p++, m); - } - - _applyProperty(loaderData, node, shape, vBox, svgPath, true); - return true; -} - - -enum class imageMimeTypeEncoding -{ - base64 = 0x1, - utf8 = 0x2 -}; - -constexpr imageMimeTypeEncoding operator|(imageMimeTypeEncoding a, imageMimeTypeEncoding b) { - return static_cast(static_cast(a) | static_cast(b)); -} - -constexpr bool operator&(imageMimeTypeEncoding a, imageMimeTypeEncoding b) { - return (static_cast(a) & static_cast(b)); -} - - -static constexpr struct -{ - const char* name; - int sz; - imageMimeTypeEncoding encoding; -} imageMimeTypes[] = { - {"jpeg", sizeof("jpeg"), imageMimeTypeEncoding::base64}, - {"png", sizeof("png"), imageMimeTypeEncoding::base64}, - {"svg+xml", sizeof("svg+xml"), imageMimeTypeEncoding::base64 | imageMimeTypeEncoding::utf8}, -}; - - -static bool _isValidImageMimeTypeAndEncoding(const char** href, const char** mimetype, imageMimeTypeEncoding* encoding) { - if (strncmp(*href, "image/", sizeof("image/") - 1)) return false; //not allowed mime type - *href += sizeof("image/") - 1; - - //RFC2397 data:[][;base64], - //mediatype := [ type "/" subtype ] *( ";" parameter ) - //parameter := attribute "=" value - for (unsigned int i = 0; i < sizeof(imageMimeTypes) / sizeof(imageMimeTypes[0]); i++) { - if (!strncmp(*href, imageMimeTypes[i].name, imageMimeTypes[i].sz - 1)) { - *href += imageMimeTypes[i].sz - 1; - *mimetype = imageMimeTypes[i].name; - - while (**href && **href != ',') { - while (**href && **href != ';') ++(*href); - if (!**href) return false; - ++(*href); - - if (imageMimeTypes[i].encoding & imageMimeTypeEncoding::base64) { - if (!strncmp(*href, "base64,", sizeof("base64,") - 1)) { - *href += sizeof("base64,") - 1; - *encoding = imageMimeTypeEncoding::base64; - return true; //valid base64 - } - } - if (imageMimeTypes[i].encoding & imageMimeTypeEncoding::utf8) { - if (!strncmp(*href, "utf8,", sizeof("utf8,") - 1)) { - *href += sizeof("utf8,") - 1; - *encoding = imageMimeTypeEncoding::utf8; - return true; //valid utf8 - } - } - } - //no encoding defined - if (**href == ',' && (imageMimeTypes[i].encoding & imageMimeTypeEncoding::utf8)) { - ++(*href); - *encoding = imageMimeTypeEncoding::utf8; - return true; //allow no encoding defined if utf8 expected - } - return false; - } - } - return false; -} - -#include "tvgTaskScheduler.h" - -static unique_ptr _imageBuildHelper(SvgLoaderData& loaderData, SvgNode* node, const Box& vBox, const string& svgPath) -{ - if (!node->node.image.href || !strlen(node->node.image.href)) return nullptr; - auto picture = Picture::gen(); - - TaskScheduler::async(false); //force to load a picture on the same thread - - const char* href = node->node.image.href; - if (!strncmp(href, "data:", sizeof("data:") - 1)) { - href += sizeof("data:") - 1; - const char* mimetype; - imageMimeTypeEncoding encoding; - if (!_isValidImageMimeTypeAndEncoding(&href, &mimetype, &encoding)) return nullptr; //not allowed mime type or encoding - char *decoded = nullptr; - if (encoding == imageMimeTypeEncoding::base64) { - auto size = b64Decode(href, strlen(href), &decoded); - if (picture->load(decoded, size, mimetype, false) != Result::Success) { - free(decoded); - TaskScheduler::async(true); - return nullptr; - } - } else { - auto size = svgUtilURLDecode(href, &decoded); - if (picture->load(decoded, size, mimetype, false) != Result::Success) { - free(decoded); - TaskScheduler::async(true); - return nullptr; - } - } - loaderData.images.push(decoded); - } else { - if (!strncmp(href, "file://", sizeof("file://") - 1)) href += sizeof("file://") - 1; - //TODO: protect against recursive svg image loading - //Temporarily disable embedded svg: - const char *dot = strrchr(href, '.'); - if (dot && !strcmp(dot, ".svg")) { - TVGLOG("SVG", "Embedded svg file is disabled."); - TaskScheduler::async(true); - return nullptr; - } - string imagePath = href; - if (strncmp(href, "/", 1)) { - auto last = svgPath.find_last_of("/"); - imagePath = svgPath.substr(0, (last == string::npos ? 0 : last + 1)) + imagePath; - } - if (picture->load(imagePath) != Result::Success) { - TaskScheduler::async(true); - return nullptr; - } - } - - TaskScheduler::async(true); - - float w, h; - Matrix m = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - if (picture->size(&w, &h) == Result::Success && w > 0 && h > 0) { - auto sx = node->node.image.w / w; - auto sy = node->node.image.h / h; - m = {sx, 0, node->node.image.x, 0, sy, node->node.image.y, 0, 0, 1}; - } - if (node->transform) m = mathMultiply(node->transform, &m); - picture->transform(m); - - _applyComposition(loaderData, picture.get(), node, vBox, svgPath); - - return picture; -} - - -static Matrix _calculateAspectRatioMatrix(AspectRatioAlign align, AspectRatioMeetOrSlice meetOrSlice, float width, float height, const Box& box) -{ - auto sx = width / box.w; - auto sy = height / box.h; - auto tvx = box.x * sx; - auto tvy = box.y * sy; - - if (align == AspectRatioAlign::None) - return {sx, 0, -tvx, 0, sy, -tvy, 0, 0, 1}; - - //Scale - if (meetOrSlice == AspectRatioMeetOrSlice::Meet) { - if (sx < sy) sy = sx; - else sx = sy; - } else { - if (sx < sy) sx = sy; - else sy = sx; - } - - //Align - tvx = box.x * sx; - tvy = box.y * sy; - auto tvw = box.w * sx; - auto tvh = box.h * sy; - - switch (align) { - case AspectRatioAlign::XMinYMin: { - break; - } - case AspectRatioAlign::XMidYMin: { - tvx -= (width - tvw) * 0.5f; - break; - } - case AspectRatioAlign::XMaxYMin: { - tvx -= width - tvw; - break; - } - case AspectRatioAlign::XMinYMid: { - tvy -= (height - tvh) * 0.5f; - break; - } - case AspectRatioAlign::XMidYMid: { - tvx -= (width - tvw) * 0.5f; - tvy -= (height - tvh) * 0.5f; - break; - } - case AspectRatioAlign::XMaxYMid: { - tvx -= width - tvw; - tvy -= (height - tvh) * 0.5f; - break; - } - case AspectRatioAlign::XMinYMax: { - tvy -= height - tvh; - break; - } - case AspectRatioAlign::XMidYMax: { - tvx -= (width - tvw) * 0.5f; - tvy -= height - tvh; - break; - } - case AspectRatioAlign::XMaxYMax: { - tvx -= width - tvw; - tvy -= height - tvh; - break; - } - default: { - break; - } - } - - return {sx, 0, -tvx, 0, sy, -tvy, 0, 0, 1}; -} - - -static unique_ptr _useBuildHelper(SvgLoaderData& loaderData, const SvgNode* node, const Box& vBox, const string& svgPath, int depth, bool* isMaskWhite) -{ - unique_ptr finalScene; - auto scene = _sceneBuildHelper(loaderData, node, vBox, svgPath, false, depth + 1, isMaskWhite); - - // mUseTransform = mUseTransform * mTranslate - Matrix mUseTransform = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - if (node->transform) mUseTransform = *node->transform; - if (node->node.use.x != 0.0f || node->node.use.y != 0.0f) { - Matrix mTranslate = {1, 0, node->node.use.x, 0, 1, node->node.use.y, 0, 0, 1}; - mUseTransform = mathMultiply(&mUseTransform, &mTranslate); - } - - if (node->node.use.symbol) { - auto symbol = node->node.use.symbol->node.symbol; - - auto width = (symbol.hasWidth ? symbol.w : vBox.w); - if (node->node.use.isWidthSet) width = node->node.use.w; - auto height = (symbol.hasHeight ? symbol.h : vBox.h);; - if (node->node.use.isHeightSet) height = node->node.use.h; - auto vw = (symbol.hasViewBox ? symbol.vw : width); - auto vh = (symbol.hasViewBox ? symbol.vh : height); - - Matrix mViewBox = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - if ((!mathEqual(width, vw) || !mathEqual(height, vh)) && vw > 0 && vh > 0) { - Box box = {symbol.vx, symbol.vy, vw, vh}; - mViewBox = _calculateAspectRatioMatrix(symbol.align, symbol.meetOrSlice, width, height, box); - } else if (!mathZero(symbol.vx) || !mathZero(symbol.vy)) { - mViewBox = {1, 0, -symbol.vx, 0, 1, -symbol.vy, 0, 0, 1}; - } - - // mSceneTransform = mUseTransform * mSymbolTransform * mViewBox - Matrix mSceneTransform = mViewBox; - if (node->node.use.symbol->transform) { - mSceneTransform = mathMultiply(node->node.use.symbol->transform, &mViewBox); - } - mSceneTransform = mathMultiply(&mUseTransform, &mSceneTransform); - scene->transform(mSceneTransform); - - if (node->node.use.symbol->node.symbol.overflowVisible) { - finalScene = std::move(scene); - } else { - auto viewBoxClip = Shape::gen(); - viewBoxClip->appendRect(0, 0, width, height, 0, 0); - - // mClipTransform = mUseTransform * mSymbolTransform - Matrix mClipTransform = mUseTransform; - if (node->node.use.symbol->transform) { - mClipTransform = mathMultiply(&mUseTransform, node->node.use.symbol->transform); - } - viewBoxClip->transform(mClipTransform); - - auto compositeLayer = Scene::gen(); - compositeLayer->composite(std::move(viewBoxClip), CompositeMethod::ClipPath); - compositeLayer->push(std::move(scene)); - - auto root = Scene::gen(); - root->push(std::move(compositeLayer)); - - finalScene = std::move(root); - } - } else { - scene->transform(mUseTransform); - finalScene = std::move(scene); - } - - return finalScene; -} - - -static unique_ptr _sceneBuildHelper(SvgLoaderData& loaderData, const SvgNode* node, const Box& vBox, const string& svgPath, bool mask, int depth, bool* isMaskWhite) -{ - /* Exception handling: Prevent invalid SVG data input. - The size is the arbitrary value, we need an experimental size. */ - if (depth > 2192) { - TVGERR("SVG", "Infinite recursive call - stopped after %d calls! Svg file may be incorrectly formatted.", depth); - return nullptr; - } - - if (_isGroupType(node->type) || mask) { - auto scene = Scene::gen(); - // For a Symbol node, the viewBox transformation has to be applied first - see _useBuildHelper() - if (!mask && node->transform && node->type != SvgNodeType::Symbol) scene->transform(*node->transform); - - if (node->style->display && node->style->opacity != 0) { - auto child = node->child.data; - for (uint32_t i = 0; i < node->child.count; ++i, ++child) { - if (_isGroupType((*child)->type)) { - if ((*child)->type == SvgNodeType::Use) - scene->push(_useBuildHelper(loaderData, *child, vBox, svgPath, depth + 1, isMaskWhite)); - else if (!((*child)->type == SvgNodeType::Symbol && node->type != SvgNodeType::Use)) - scene->push(_sceneBuildHelper(loaderData, *child, vBox, svgPath, false, depth + 1, isMaskWhite)); - } else if ((*child)->type == SvgNodeType::Image) { - auto image = _imageBuildHelper(loaderData, *child, vBox, svgPath); - if (image) { - scene->push(std::move(image)); - if (isMaskWhite) *isMaskWhite = false; - } - } else if ((*child)->type != SvgNodeType::Mask) { - auto shape = _shapeBuildHelper(loaderData, *child, vBox, svgPath); - if (shape) { - if (isMaskWhite) { - uint8_t r, g, b; - shape->fillColor(&r, &g, &b); - if (shape->fill() || r < 255 || g < 255 || b < 255 || shape->strokeFill() || - (shape->strokeColor(&r, &g, &b) == Result::Success && (r < 255 || g < 255 || b < 255))) { - *isMaskWhite = false; - } - } - scene->push(std::move(shape)); - } - } - } - _applyComposition(loaderData, scene.get(), node, vBox, svgPath); - scene->opacity(node->style->opacity); - } - return scene; - } - return nullptr; -} - - -static void _updateInvalidViewSize(const Scene* scene, Box& vBox, float& w, float& h, SvgViewFlag viewFlag) -{ - bool validWidth = (viewFlag & SvgViewFlag::Width); - bool validHeight = (viewFlag & SvgViewFlag::Height); - - float x, y; - scene->bounds(&x, &y, &vBox.w, &vBox.h, false); - if (!validWidth && !validHeight) { - vBox.x = x; - vBox.y = y; - } else { - if (validWidth) vBox.w = w; - if (validHeight) vBox.h = h; - } - - //the size would have 1x1 or percentage values. - if (!validWidth) w *= vBox.w; - if (!validHeight) h *= vBox.h; -} - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -Scene* svgSceneBuild(SvgLoaderData& loaderData, Box vBox, float w, float h, AspectRatioAlign align, AspectRatioMeetOrSlice meetOrSlice, const string& svgPath, SvgViewFlag viewFlag) -{ - //TODO: aspect ratio is valid only if viewBox was set - - if (!loaderData.doc || (loaderData.doc->type != SvgNodeType::Doc)) return nullptr; - - auto docNode = _sceneBuildHelper(loaderData, loaderData.doc, vBox, svgPath, false, 0); - - if (!(viewFlag & SvgViewFlag::Viewbox)) _updateInvalidViewSize(docNode.get(), vBox, w, h, viewFlag); - - if (!mathEqual(w, vBox.w) || !mathEqual(h, vBox.h)) { - Matrix m = _calculateAspectRatioMatrix(align, meetOrSlice, w, h, vBox); - docNode->transform(m); - } else if (!mathZero(vBox.x) || !mathZero(vBox.y)) { - docNode->translate(-vBox.x, -vBox.y); - } - - auto viewBoxClip = Shape::gen(); - viewBoxClip->appendRect(0, 0, w, h); - - auto compositeLayer = Scene::gen(); - compositeLayer->composite(std::move(viewBoxClip), CompositeMethod::ClipPath); - compositeLayer->push(std::move(docNode)); - - auto root = Scene::gen(); - root->push(std::move(compositeLayer)); - - loaderData.doc->node.doc.vx = vBox.x; - loaderData.doc->node.doc.vy = vBox.y; - loaderData.doc->node.doc.vw = vBox.w; - loaderData.doc->node.doc.vh = vBox.h; - loaderData.doc->node.doc.w = w; - loaderData.doc->node.doc.h = h; - - return root.release(); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgSceneBuilder.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgSceneBuilder.h deleted file mode 100644 index 8ab1b67..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgSceneBuilder.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SVG_SCENE_BUILDER_H_ -#define _TVG_SVG_SCENE_BUILDER_H_ - -#include "tvgCommon.h" - -Scene* svgSceneBuild(SvgLoaderData& loaderData, Box vBox, float w, float h, AspectRatioAlign align, AspectRatioMeetOrSlice meetOrSlice, const string& svgPath, SvgViewFlag viewFlag); - -#endif //_TVG_SVG_SCENE_BUILDER_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgUtil.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgUtil.cpp deleted file mode 100644 index e77e2a0..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgUtil.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include -#include "tvgSvgUtil.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static uint8_t _hexCharToDec(const char c) -{ - if (c >= 'a') return c - 'a' + 10; - else if (c >= 'A') return c - 'A' + 10; - else return c - '0'; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -size_t svgUtilURLDecode(const char *src, char** dst) -{ - if (!src) return 0; - - auto length = strlen(src); - if (length == 0) return 0; - - char* decoded = (char*)malloc(sizeof(char) * length + 1); - - char a, b; - int idx =0; - while (*src) { - if (*src == '%' && - ((a = src[1]) && (b = src[2])) && - (isxdigit(a) && isxdigit(b))) { - decoded[idx++] = (_hexCharToDec(a) << 4) + _hexCharToDec(b); - src+=3; - } else if (*src == '+') { - decoded[idx++] = ' '; - src++; - } else { - decoded[idx++] = *src++; - } - } - decoded[idx] = '\0'; - - *dst = decoded; - return idx + 1; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgUtil.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgUtil.h deleted file mode 100644 index cc4b54c..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSvgUtil.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SVG_UTIL_H_ -#define _TVG_SVG_UTIL_H_ - -#include "tvgCommon.h" - -size_t svgUtilURLDecode(const char *src, char** dst); - -#endif //_TVG_SVG_UTIL_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwCanvas.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwCanvas.cpp deleted file mode 100644 index 27bd7e3..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwCanvas.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgCanvas.h" -#include "tvgLoadModule.h" - -#ifdef THORVG_SW_RASTER_SUPPORT - #include "tvgSwRenderer.h" -#else - class SwRenderer : public RenderMethod - { - //Non Supported. Dummy Class */ - }; -#endif - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -struct SwCanvas::Impl -{ -}; - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -#ifdef THORVG_SW_RASTER_SUPPORT -SwCanvas::SwCanvas() : Canvas(SwRenderer::gen()), pImpl(new Impl) -#else -SwCanvas::SwCanvas() : Canvas(nullptr), pImpl(new Impl) -#endif -{ -} - - -SwCanvas::~SwCanvas() -{ - delete(pImpl); -} - - -Result SwCanvas::mempool(MempoolPolicy policy) noexcept -{ -#ifdef THORVG_SW_RASTER_SUPPORT - //We know renderer type, avoid dynamic_cast for performance. - auto renderer = static_cast(Canvas::pImpl->renderer); - if (!renderer) return Result::MemoryCorruption; - - //It can't change the policy during the running. - if (!Canvas::pImpl->paints.empty()) return Result::InsufficientCondition; - - if (policy == MempoolPolicy::Individual) renderer->mempool(false); - else renderer->mempool(true); - - return Result::Success; -#endif - return Result::NonSupport; -} - - -Result SwCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, Colorspace cs) noexcept -{ -#ifdef THORVG_SW_RASTER_SUPPORT - //We know renderer type, avoid dynamic_cast for performance. - auto renderer = static_cast(Canvas::pImpl->renderer); - if (!renderer) return Result::MemoryCorruption; - - if (!renderer->target(buffer, stride, w, h, static_cast(cs))) return Result::InvalidArguments; - Canvas::pImpl->vport = {0, 0, (int32_t)w, (int32_t)h}; - renderer->viewport(Canvas::pImpl->vport); - - //Paints must be updated again with this new target. - Canvas::pImpl->needRefresh(); - - //FIXME: The value must be associated with an individual canvas instance. - ImageLoader::cs = static_cast(cs); - - return Result::Success; -#endif - return Result::NonSupport; -} - - -unique_ptr SwCanvas::gen() noexcept -{ -#ifdef THORVG_SW_RASTER_SUPPORT - if (SwRenderer::init() <= 0) return nullptr; - return unique_ptr(new SwCanvas); -#endif - return nullptr; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwCommon.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwCommon.h deleted file mode 100644 index 182cf8f..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwCommon.h +++ /dev/null @@ -1,593 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SW_COMMON_H_ -#define _TVG_SW_COMMON_H_ - -#include "tvgCommon.h" -#include "tvgRender.h" - -#include - -#if 0 -#include -static double timeStamp() -{ - struct timeval tv; - gettimeofday(&tv, NULL); - return (tv.tv_sec + tv.tv_usec / 1000000.0); -} -#endif - -#define SW_CURVE_TYPE_POINT 0 -#define SW_CURVE_TYPE_CUBIC 1 -#define SW_ANGLE_PI (180L << 16) -#define SW_ANGLE_2PI (SW_ANGLE_PI << 1) -#define SW_ANGLE_PI2 (SW_ANGLE_PI >> 1) - -using SwCoord = signed long; -using SwFixed = signed long long; - - -static inline float TO_FLOAT(SwCoord val) -{ - return static_cast(val) / 64.0f; -} - -struct SwPoint -{ - SwCoord x, y; - - SwPoint& operator+=(const SwPoint& rhs) - { - x += rhs.x; - y += rhs.y; - return *this; - } - - SwPoint operator+(const SwPoint& rhs) const - { - return {x + rhs.x, y + rhs.y}; - } - - SwPoint operator-(const SwPoint& rhs) const - { - return {x - rhs.x, y - rhs.y}; - } - - bool operator==(const SwPoint& rhs) const - { - return (x == rhs.x && y == rhs.y); - } - - bool operator!=(const SwPoint& rhs) const - { - return (x != rhs.x || y != rhs.y); - } - - bool zero() const - { - if (x == 0 && y == 0) return true; - else return false; - } - - bool small() const - { - //2 is epsilon... - if (abs(x) < 2 && abs(y) < 2) return true; - else return false; - } - - Point toPoint() const - { - return {TO_FLOAT(x), TO_FLOAT(y)}; - } -}; - -struct SwSize -{ - SwCoord w, h; -}; - -struct SwOutline -{ - Array pts; //the outline's points - Array cntrs; //the contour end points - Array types; //curve type - Array closed; //opened or closed path? - FillRule fillRule; -}; - -struct SwSpan -{ - uint16_t x, y; - uint16_t len; - uint8_t coverage; -}; - -struct SwRleData -{ - SwSpan *spans; - uint32_t alloc; - uint32_t size; -}; - -struct SwBBox -{ - SwPoint min, max; - - void reset() - { - min.x = min.y = max.x = max.y = 0; - } -}; - -struct SwFill -{ - struct SwLinear { - float dx, dy; - float len; - float offset; - }; - - struct SwRadial { - float a11, a12, a13; - float a21, a22, a23; - float fx, fy, fr; - float dx, dy, dr; - float invA, a; - }; - - union { - SwLinear linear; - SwRadial radial; - }; - - uint32_t* ctable; - FillSpread spread; - - bool translucent; -}; - -struct SwStrokeBorder -{ - uint32_t ptsCnt; - uint32_t maxPts; - SwPoint* pts; - uint8_t* tags; - int32_t start; //index of current sub-path start point - bool movable; //true: for ends of lineto borders -}; - -struct SwStroke -{ - SwFixed angleIn; - SwFixed angleOut; - SwPoint center; - SwFixed lineLength; - SwFixed subPathAngle; - SwPoint ptStartSubPath; - SwFixed subPathLineLength; - SwFixed width; - SwFixed miterlimit; - - StrokeCap cap; - StrokeJoin join; - StrokeJoin joinSaved; - SwFill* fill = nullptr; - - SwStrokeBorder borders[2]; - - float sx, sy; - - bool firstPt; - bool closedSubPath; - bool handleWideStrokes; -}; - -struct SwDashStroke -{ - SwOutline* outline = nullptr; - float curLen = 0; - int32_t curIdx = 0; - Point ptStart = {0, 0}; - Point ptCur = {0, 0}; - float* pattern = nullptr; - uint32_t cnt = 0; - bool curOpGap = false; - bool move = true; -}; - -struct SwShape -{ - SwOutline* outline = nullptr; - SwStroke* stroke = nullptr; - SwFill* fill = nullptr; - SwRleData* rle = nullptr; - SwRleData* strokeRle = nullptr; - SwBBox bbox; //Keep it boundary without stroke region. Using for optimal filling. - - bool fastTrack = false; //Fast Track: axis-aligned rectangle without any clips? -}; - -struct SwImage -{ - SwOutline* outline = nullptr; - SwRleData* rle = nullptr; - union { - pixel_t* data; //system based data pointer - uint32_t* buf32; //for explicit 32bits channels - uint8_t* buf8; //for explicit 8bits grayscale - }; - uint32_t w, h, stride; - int32_t ox = 0; //offset x - int32_t oy = 0; //offset y - float scale; - uint8_t channelSize; - - bool direct = false; //draw image directly (with offset) - bool scaled = false; //draw scaled image -}; - -typedef uint8_t(*SwMask)(uint8_t s, uint8_t d, uint8_t a); //src, dst, alpha -typedef uint32_t(*SwBlender)(uint32_t s, uint32_t d, uint8_t a); //src, dst, alpha -typedef uint32_t(*SwJoin)(uint8_t r, uint8_t g, uint8_t b, uint8_t a); //color channel join -typedef uint8_t(*SwAlpha)(uint8_t*); //blending alpha - -struct SwCompositor; - -struct SwSurface : Surface -{ - SwJoin join; - SwAlpha alphas[4]; //Alpha:2, InvAlpha:3, Luma:4, InvLuma:5 - SwBlender blender = nullptr; //blender (optional) - SwCompositor* compositor = nullptr; //compositor (optional) - BlendMethod blendMethod; //blending method (uint8_t) - - SwAlpha alpha(CompositeMethod method) - { - auto idx = (int)(method) - 2; //0: None, 1: ClipPath - return alphas[idx > 3 ? 0 : idx]; //CompositeMethod has only four Matting methods. - } - - SwSurface() - { - } - - SwSurface(const SwSurface* rhs) : Surface(rhs) - { - join = rhs->join; - memcpy(alphas, rhs->alphas, sizeof(alphas)); - blender = rhs->blender; - compositor = rhs->compositor; - blendMethod = rhs->blendMethod; - } -}; - -struct SwCompositor : Compositor -{ - SwSurface* recoverSfc; //Recover surface when composition is started - SwCompositor* recoverCmp; //Recover compositor when composition is done - SwImage image; - SwBBox bbox; - bool valid; -}; - -struct SwMpool -{ - SwOutline* outline; - SwOutline* strokeOutline; - SwOutline* dashOutline; - unsigned allocSize; -}; - -static inline SwCoord TO_SWCOORD(float val) -{ - return SwCoord(val * 64.0f); -} - -static inline uint32_t JOIN(uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3) -{ - return (c0 << 24 | c1 << 16 | c2 << 8 | c3); -} - -static inline uint32_t ALPHA_BLEND(uint32_t c, uint32_t a) -{ - return (((((c >> 8) & 0x00ff00ff) * a + 0x00ff00ff) & 0xff00ff00) + - ((((c & 0x00ff00ff) * a + 0x00ff00ff) >> 8) & 0x00ff00ff)); -} - -static inline uint32_t INTERPOLATE(uint32_t s, uint32_t d, uint8_t a) -{ - return (((((((s >> 8) & 0xff00ff) - ((d >> 8) & 0xff00ff)) * a) + (d & 0xff00ff00)) & 0xff00ff00) + ((((((s & 0xff00ff) - (d & 0xff00ff)) * a) >> 8) + (d & 0xff00ff)) & 0xff00ff)); -} - -static inline uint8_t INTERPOLATE8(uint8_t s, uint8_t d, uint8_t a) -{ - return (((s) * (a) + 0xff) >> 8) + (((d) * ~(a) + 0xff) >> 8); -} - -static inline SwCoord HALF_STROKE(float width) -{ - return TO_SWCOORD(width * 0.5f); -} - -static inline uint8_t A(uint32_t c) -{ - return ((c) >> 24); -} - -static inline uint8_t IA(uint32_t c) -{ - return (~(c) >> 24); -} - -static inline uint8_t C1(uint32_t c) -{ - return ((c) >> 16); -} - -static inline uint8_t C2(uint32_t c) -{ - return ((c) >> 8); -} - -static inline uint8_t C3(uint32_t c) -{ - return (c); -} - -static inline uint32_t opBlendInterp(uint32_t s, uint32_t d, uint8_t a) -{ - return INTERPOLATE(s, d, a); -} - -static inline uint32_t opBlendNormal(uint32_t s, uint32_t d, uint8_t a) -{ - auto t = ALPHA_BLEND(s, a); - return t + ALPHA_BLEND(d, IA(t)); -} - -static inline uint32_t opBlendPreNormal(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - return s + ALPHA_BLEND(d, IA(s)); -} - -static inline uint32_t opBlendSrcOver(uint32_t s, TVG_UNUSED uint32_t d, TVG_UNUSED uint8_t a) -{ - return s; -} - -//TODO: BlendMethod could remove the alpha parameter. -static inline uint32_t opBlendDifference(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - //if (s > d) => s - d - //else => d - s - auto c1 = (C1(s) > C1(d)) ? (C1(s) - C1(d)) : (C1(d) - C1(s)); - auto c2 = (C2(s) > C2(d)) ? (C2(s) - C2(d)) : (C2(d) - C2(s)); - auto c3 = (C3(s) > C3(d)) ? (C3(s) - C3(d)) : (C3(d) - C3(s)); - return JOIN(255, c1, c2, c3); -} - -static inline uint32_t opBlendExclusion(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - //A + B - 2AB - auto c1 = std::min(255, C1(s) + C1(d) - std::min(255, (C1(s) * C1(d)) << 1)); - auto c2 = std::min(255, C2(s) + C2(d) - std::min(255, (C2(s) * C2(d)) << 1)); - auto c3 = std::min(255, C3(s) + C3(d) - std::min(255, (C3(s) * C3(d)) << 1)); - return JOIN(255, c1, c2, c3); -} - -static inline uint32_t opBlendAdd(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - // s + d - auto c1 = std::min(C1(s) + C1(d), 255); - auto c2 = std::min(C2(s) + C2(d), 255); - auto c3 = std::min(C3(s) + C3(d), 255); - return JOIN(255, c1, c2, c3); -} - -static inline uint32_t opBlendScreen(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - // s + d - s * d - auto c1 = C1(s) + C1(d) - MULTIPLY(C1(s), C1(d)); - auto c2 = C2(s) + C2(d) - MULTIPLY(C2(s), C2(d)); - auto c3 = C3(s) + C3(d) - MULTIPLY(C3(s), C3(d)); - return JOIN(255, c1, c2, c3); -} - - -static inline uint32_t opBlendMultiply(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - // s * d - auto c1 = MULTIPLY(C1(s), C1(d)); - auto c2 = MULTIPLY(C2(s), C2(d)); - auto c3 = MULTIPLY(C3(s), C3(d)); - return JOIN(255, c1, c2, c3); -} - - -static inline uint32_t opBlendOverlay(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - // if (2 * d < da) => 2 * s * d, - // else => 1 - 2 * (1 - s) * (1 - d) - auto c1 = (C1(d) < 128) ? std::min(255, 2 * MULTIPLY(C1(s), C1(d))) : (255 - std::min(255, 2 * MULTIPLY(255 - C1(s), 255 - C1(d)))); - auto c2 = (C2(d) < 128) ? std::min(255, 2 * MULTIPLY(C2(s), C2(d))) : (255 - std::min(255, 2 * MULTIPLY(255 - C2(s), 255 - C2(d)))); - auto c3 = (C3(d) < 128) ? std::min(255, 2 * MULTIPLY(C3(s), C3(d))) : (255 - std::min(255, 2 * MULTIPLY(255 - C3(s), 255 - C3(d)))); - return JOIN(255, c1, c2, c3); -} - -static inline uint32_t opBlendDarken(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - // min(s, d) - auto c1 = std::min(C1(s), C1(d)); - auto c2 = std::min(C2(s), C2(d)); - auto c3 = std::min(C3(s), C3(d)); - return JOIN(255, c1, c2, c3); -} - -static inline uint32_t opBlendLighten(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - // max(s, d) - auto c1 = std::max(C1(s), C1(d)); - auto c2 = std::max(C2(s), C2(d)); - auto c3 = std::max(C3(s), C3(d)); - return JOIN(255, c1, c2, c3); -} - -static inline uint32_t opBlendColorDodge(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - // d / (1 - s) - auto is = 0xffffffff - s; - auto c1 = (C1(is) > 0) ? (C1(d) / C1(is)) : C1(d); - auto c2 = (C2(is) > 0) ? (C2(d) / C2(is)) : C2(d); - auto c3 = (C3(is) > 0) ? (C3(d) / C3(is)) : C3(d); - return JOIN(255, c1, c2, c3); -} - -static inline uint32_t opBlendColorBurn(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - // 1 - (1 - d) / s - auto id = 0xffffffff - d; - auto c1 = 255 - ((C1(s) > 0) ? (C1(id) / C1(s)) : C1(id)); - auto c2 = 255 - ((C2(s) > 0) ? (C2(id) / C2(s)) : C2(id)); - auto c3 = 255 - ((C3(s) > 0) ? (C3(id) / C3(s)) : C3(id)); - return JOIN(255, c1, c2, c3); -} - -static inline uint32_t opBlendHardLight(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - auto c1 = (C1(s) < 128) ? std::min(255, 2 * MULTIPLY(C1(s), C1(d))) : (255 - std::min(255, 2 * MULTIPLY(255 - C1(s), 255 - C1(d)))); - auto c2 = (C2(s) < 128) ? std::min(255, 2 * MULTIPLY(C2(s), C2(d))) : (255 - std::min(255, 2 * MULTIPLY(255 - C2(s), 255 - C2(d)))); - auto c3 = (C3(s) < 128) ? std::min(255, 2 * MULTIPLY(C3(s), C3(d))) : (255 - std::min(255, 2 * MULTIPLY(255 - C3(s), 255 - C3(d)))); - return JOIN(255, c1, c2, c3); -} - -static inline uint32_t opBlendSoftLight(uint32_t s, uint32_t d, TVG_UNUSED uint8_t a) -{ - //(255 - 2 * s) * (d * d) + (2 * s * b) - auto c1 = std::min(255, MULTIPLY(255 - std::min(255, 2 * C1(s)), MULTIPLY(C1(d), C1(d))) + 2 * MULTIPLY(C1(s), C1(d))); - auto c2 = std::min(255, MULTIPLY(255 - std::min(255, 2 * C2(s)), MULTIPLY(C2(d), C2(d))) + 2 * MULTIPLY(C2(s), C2(d))); - auto c3 = std::min(255, MULTIPLY(255 - std::min(255, 2 * C3(s)), MULTIPLY(C3(d), C3(d))) + 2 * MULTIPLY(C3(s), C3(d))); - return JOIN(255, c1, c2, c3); -} - - -int64_t mathMultiply(int64_t a, int64_t b); -int64_t mathDivide(int64_t a, int64_t b); -int64_t mathMulDiv(int64_t a, int64_t b, int64_t c); -void mathRotate(SwPoint& pt, SwFixed angle); -SwFixed mathTan(SwFixed angle); -SwFixed mathAtan(const SwPoint& pt); -SwFixed mathCos(SwFixed angle); -SwFixed mathSin(SwFixed angle); -void mathSplitCubic(SwPoint* base); -SwFixed mathDiff(SwFixed angle1, SwFixed angle2); -SwFixed mathLength(const SwPoint& pt); -bool mathSmallCubic(const SwPoint* base, SwFixed& angleIn, SwFixed& angleMid, SwFixed& angleOut); -SwFixed mathMean(SwFixed angle1, SwFixed angle2); -SwPoint mathTransform(const Point* to, const Matrix* transform); -bool mathUpdateOutlineBBox(const SwOutline* outline, const SwBBox& clipRegion, SwBBox& renderRegion, bool fastTrack); -bool mathClipBBox(const SwBBox& clipper, SwBBox& clipee); - -void shapeReset(SwShape* shape); -bool shapePrepare(SwShape* shape, const RenderShape* rshape, const Matrix* transform, const SwBBox& clipRegion, SwBBox& renderRegion, SwMpool* mpool, unsigned tid, bool hasComposite); -bool shapePrepared(const SwShape* shape); -bool shapeGenRle(SwShape* shape, const RenderShape* rshape, bool antiAlias); -void shapeDelOutline(SwShape* shape, SwMpool* mpool, uint32_t tid); -void shapeResetStroke(SwShape* shape, const RenderShape* rshape, const Matrix* transform); -bool shapeGenStrokeRle(SwShape* shape, const RenderShape* rshape, const Matrix* transform, const SwBBox& clipRegion, SwBBox& renderRegion, SwMpool* mpool, unsigned tid); -void shapeFree(SwShape* shape); -void shapeDelStroke(SwShape* shape); -bool shapeGenFillColors(SwShape* shape, const Fill* fill, const Matrix* transform, SwSurface* surface, uint8_t opacity, bool ctable); -bool shapeGenStrokeFillColors(SwShape* shape, const Fill* fill, const Matrix* transform, SwSurface* surface, uint8_t opacity, bool ctable); -void shapeResetFill(SwShape* shape); -void shapeResetStrokeFill(SwShape* shape); -void shapeDelFill(SwShape* shape); -void shapeDelStrokeFill(SwShape* shape); - -void strokeReset(SwStroke* stroke, const RenderShape* shape, const Matrix* transform); -bool strokeParseOutline(SwStroke* stroke, const SwOutline& outline); -SwOutline* strokeExportOutline(SwStroke* stroke, SwMpool* mpool, unsigned tid); -void strokeFree(SwStroke* stroke); - -bool imagePrepare(SwImage* image, const RenderMesh* mesh, const Matrix* transform, const SwBBox& clipRegion, SwBBox& renderRegion, SwMpool* mpool, unsigned tid); -bool imageGenRle(SwImage* image, const SwBBox& renderRegion, bool antiAlias); -void imageDelOutline(SwImage* image, SwMpool* mpool, uint32_t tid); -void imageReset(SwImage* image); -void imageFree(SwImage* image); - -bool fillGenColorTable(SwFill* fill, const Fill* fdata, const Matrix* transform, SwSurface* surface, uint8_t opacity, bool ctable); -void fillReset(SwFill* fill); -void fillFree(SwFill* fill); - -//OPTIMIZE_ME: Skip the function pointer access -void fillLinear(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, SwMask maskOp, uint8_t opacity); //composite masking ver. -void fillLinear(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwMask maskOp, uint8_t opacity); //direct masking ver. -void fillLinear(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, uint8_t a); //blending ver. -void fillLinear(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, SwBlender op2, uint8_t a); //blending + BlendingMethod(op2) ver. -void fillLinear(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwAlpha alpha, uint8_t csize, uint8_t opacity); //matting ver. - -void fillRadial(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, SwMask op, uint8_t a); //composite masking ver. -void fillRadial(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwMask op, uint8_t a) ; //direct masking ver. -void fillRadial(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, uint8_t a); //blending ver. -void fillRadial(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, SwBlender op2, uint8_t a); //blending + BlendingMethod(op2) ver. -void fillRadial(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwAlpha alpha, uint8_t csize, uint8_t opacity); //matting ver. - -SwRleData* rleRender(SwRleData* rle, const SwOutline* outline, const SwBBox& renderRegion, bool antiAlias); -SwRleData* rleRender(const SwBBox* bbox); -void rleFree(SwRleData* rle); -void rleReset(SwRleData* rle); -void rleMerge(SwRleData* rle, SwRleData* clip1, SwRleData* clip2); -void rleClipPath(SwRleData* rle, const SwRleData* clip); -void rleClipRect(SwRleData* rle, const SwBBox* clip); - -SwMpool* mpoolInit(uint32_t threads); -bool mpoolTerm(SwMpool* mpool); -bool mpoolClear(SwMpool* mpool); -SwOutline* mpoolReqOutline(SwMpool* mpool, unsigned idx); -void mpoolRetOutline(SwMpool* mpool, unsigned idx); -SwOutline* mpoolReqStrokeOutline(SwMpool* mpool, unsigned idx); -void mpoolRetStrokeOutline(SwMpool* mpool, unsigned idx); -SwOutline* mpoolReqDashOutline(SwMpool* mpool, unsigned idx); -void mpoolRetDashOutline(SwMpool* mpool, unsigned idx); - -bool rasterCompositor(SwSurface* surface); -bool rasterGradientShape(SwSurface* surface, SwShape* shape, unsigned id); -bool rasterShape(SwSurface* surface, SwShape* shape, uint8_t r, uint8_t g, uint8_t b, uint8_t a); -bool rasterImage(SwSurface* surface, SwImage* image, const RenderMesh* mesh, const Matrix* transform, const SwBBox& bbox, uint8_t opacity); -bool rasterStroke(SwSurface* surface, SwShape* shape, uint8_t r, uint8_t g, uint8_t b, uint8_t a); -bool rasterGradientStroke(SwSurface* surface, SwShape* shape, unsigned id); -bool rasterClear(SwSurface* surface, uint32_t x, uint32_t y, uint32_t w, uint32_t h); -void rasterPixel32(uint32_t *dst, uint32_t val, uint32_t offset, int32_t len); -void rasterGrayscale8(uint8_t *dst, uint8_t val, uint32_t offset, int32_t len); -void rasterUnpremultiply(Surface* surface); -void rasterPremultiply(Surface* surface); -bool rasterConvertCS(Surface* surface, ColorSpace to); - -#endif /* _TVG_SW_COMMON_H_ */ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwFill.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwFill.cpp deleted file mode 100644 index f939fc8..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwFill.cpp +++ /dev/null @@ -1,790 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgMath.h" -#include "tvgSwCommon.h" -#include "tvgFill.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -#define RADIAL_A_THRESHOLD 0.0005f -#define GRADIENT_STOP_SIZE 1024 -#define FIXPT_BITS 8 -#define FIXPT_SIZE (1<radial.a - * B = 2 * (dr * fr + rx * dx + ry * dy) - * C = fr^2 - rx^2 - ry^2 - * Derivatives are computed with respect to dx. - * This procedure aims to optimize and eliminate the need to calculate all values from the beginning - * for consecutive x values with a constant y. The Taylor series expansions are computed as long as - * its terms are non-zero. - */ -static void _calculateCoefficients(const SwFill* fill, uint32_t x, uint32_t y, float& b, float& deltaB, float& det, float& deltaDet, float& deltaDeltaDet) -{ - auto radial = &fill->radial; - - auto rx = (x + 0.5f) * radial->a11 + (y + 0.5f) * radial->a12 + radial->a13 - radial->fx; - auto ry = (x + 0.5f) * radial->a21 + (y + 0.5f) * radial->a22 + radial->a23 - radial->fy; - - b = (radial->dr * radial->fr + rx * radial->dx + ry * radial->dy) * radial->invA; - deltaB = (radial->a11 * radial->dx + radial->a21 * radial->dy) * radial->invA; - - auto rr = rx * rx + ry * ry; - auto deltaRr = 2.0f * (rx * radial->a11 + ry * radial->a21) * radial->invA; - auto deltaDeltaRr = 2.0f * (radial->a11 * radial->a11 + radial->a21 * radial->a21) * radial->invA; - - det = b * b + (rr - radial->fr * radial->fr) * radial->invA; - deltaDet = 2.0f * b * deltaB + deltaB * deltaB + deltaRr + deltaDeltaRr; - deltaDeltaDet = 2.0f * deltaB * deltaB + deltaDeltaRr; -} - - -static bool _updateColorTable(SwFill* fill, const Fill* fdata, const SwSurface* surface, uint8_t opacity) -{ - if (!fill->ctable) { - fill->ctable = static_cast(malloc(GRADIENT_STOP_SIZE * sizeof(uint32_t))); - if (!fill->ctable) return false; - } - - const Fill::ColorStop* colors; - auto cnt = fdata->colorStops(&colors); - if (cnt == 0 || !colors) return false; - - auto pColors = colors; - - auto a = MULTIPLY(pColors->a, opacity); - if (a < 255) fill->translucent = true; - - auto r = pColors->r; - auto g = pColors->g; - auto b = pColors->b; - auto rgba = surface->join(r, g, b, a); - - auto inc = 1.0f / static_cast(GRADIENT_STOP_SIZE); - auto pos = 1.5f * inc; - uint32_t i = 0; - - fill->ctable[i++] = ALPHA_BLEND(rgba | 0xff000000, a); - - while (pos <= pColors->offset) { - fill->ctable[i] = fill->ctable[i - 1]; - ++i; - pos += inc; - } - - for (uint32_t j = 0; j < cnt - 1; ++j) { - auto curr = colors + j; - auto next = curr + 1; - auto delta = 1.0f / (next->offset - curr->offset); - auto a2 = MULTIPLY(next->a, opacity); - if (!fill->translucent && a2 < 255) fill->translucent = true; - - auto rgba2 = surface->join(next->r, next->g, next->b, a2); - - while (pos < next->offset && i < GRADIENT_STOP_SIZE) { - auto t = (pos - curr->offset) * delta; - auto dist = static_cast(255 * t); - auto dist2 = 255 - dist; - - auto color = INTERPOLATE(rgba, rgba2, dist2); - fill->ctable[i] = ALPHA_BLEND((color | 0xff000000), (color >> 24)); - - ++i; - pos += inc; - } - rgba = rgba2; - a = a2; - } - rgba = ALPHA_BLEND((rgba | 0xff000000), a); - - for (; i < GRADIENT_STOP_SIZE; ++i) - fill->ctable[i] = rgba; - - //Make sure the last color stop is represented at the end of the table - fill->ctable[GRADIENT_STOP_SIZE - 1] = rgba; - - return true; -} - - -bool _prepareLinear(SwFill* fill, const LinearGradient* linear, const Matrix* transform) -{ - float x1, x2, y1, y2; - if (linear->linear(&x1, &y1, &x2, &y2) != Result::Success) return false; - - fill->linear.dx = x2 - x1; - fill->linear.dy = y2 - y1; - fill->linear.len = fill->linear.dx * fill->linear.dx + fill->linear.dy * fill->linear.dy; - - if (fill->linear.len < FLOAT_EPSILON) return true; - - fill->linear.dx /= fill->linear.len; - fill->linear.dy /= fill->linear.len; - fill->linear.offset = -fill->linear.dx * x1 - fill->linear.dy * y1; - - auto gradTransform = linear->transform(); - bool isTransformation = !mathIdentity((const Matrix*)(&gradTransform)); - - if (isTransformation) { - if (transform) gradTransform = mathMultiply(transform, &gradTransform); - } else if (transform) { - gradTransform = *transform; - isTransformation = true; - } - - if (isTransformation) { - Matrix invTransform; - if (!mathInverse(&gradTransform, &invTransform)) return false; - - fill->linear.offset += fill->linear.dx * invTransform.e13 + fill->linear.dy * invTransform.e23; - - auto dx = fill->linear.dx; - fill->linear.dx = dx * invTransform.e11 + fill->linear.dy * invTransform.e21; - fill->linear.dy = dx * invTransform.e12 + fill->linear.dy * invTransform.e22; - - fill->linear.len = fill->linear.dx * fill->linear.dx + fill->linear.dy * fill->linear.dy; - } - - return true; -} - - -bool _prepareRadial(SwFill* fill, const RadialGradient* radial, const Matrix* transform) -{ - auto cx = P(radial)->cx; - auto cy = P(radial)->cy; - auto r = P(radial)->r; - auto fx = P(radial)->fx; - auto fy = P(radial)->fy; - auto fr = P(radial)->fr; - - if (r < FLOAT_EPSILON) return true; - - fill->radial.dr = r - fr; - fill->radial.dx = cx - fx; - fill->radial.dy = cy - fy; - fill->radial.fr = fr; - fill->radial.fx = fx; - fill->radial.fy = fy; - fill->radial.a = fill->radial.dr * fill->radial.dr - fill->radial.dx * fill->radial.dx - fill->radial.dy * fill->radial.dy; - - //This condition fulfills the SVG 1.1 std: - //the focal point, if outside the end circle, is moved to be on the end circle - //See: the SVG 2 std requirements: https://www.w3.org/TR/SVG2/pservers.html#RadialGradientNotes - if (fill->radial.a < 0) { - auto dist = sqrtf(fill->radial.dx * fill->radial.dx + fill->radial.dy * fill->radial.dy); - fill->radial.fx = cx + r * (fx - cx) / dist; - fill->radial.fy = cy + r * (fy - cy) / dist; - fill->radial.dx = cx - fill->radial.fx; - fill->radial.dy = cy - fill->radial.fy; - // Prevent loss of precision on Apple Silicon when dr=dy and dx=0 due to FMA - // https://github.com/thorvg/thorvg/issues/2014 - auto dr2 = fill->radial.dr * fill->radial.dr; - auto dx2 = fill->radial.dx * fill->radial.dx; - auto dy2 = fill->radial.dy * fill->radial.dy; - - fill->radial.a = dr2 - dx2 - dy2; - } - - if (fill->radial.a > 0) fill->radial.invA = 1.0f / fill->radial.a; - - auto gradTransform = radial->transform(); - bool isTransformation = !mathIdentity((const Matrix*)(&gradTransform)); - - if (transform) { - if (isTransformation) gradTransform = mathMultiply(transform, &gradTransform); - else { - gradTransform = *transform; - isTransformation = true; - } - } - - if (isTransformation) { - Matrix invTransform; - if (!mathInverse(&gradTransform, &invTransform)) return false; - fill->radial.a11 = invTransform.e11; - fill->radial.a12 = invTransform.e12; - fill->radial.a13 = invTransform.e13; - fill->radial.a21 = invTransform.e21; - fill->radial.a22 = invTransform.e22; - fill->radial.a23 = invTransform.e23; - } else { - fill->radial.a11 = fill->radial.a22 = 1.0f; - fill->radial.a12 = fill->radial.a13 = 0.0f; - fill->radial.a21 = fill->radial.a23 = 0.0f; - } - return true; -} - - -static inline uint32_t _clamp(const SwFill* fill, int32_t pos) -{ - switch (fill->spread) { - case FillSpread::Pad: { - if (pos >= GRADIENT_STOP_SIZE) pos = GRADIENT_STOP_SIZE - 1; - else if (pos < 0) pos = 0; - break; - } - case FillSpread::Repeat: { - pos = pos % GRADIENT_STOP_SIZE; - if (pos < 0) pos = GRADIENT_STOP_SIZE + pos; - break; - } - case FillSpread::Reflect: { - auto limit = GRADIENT_STOP_SIZE * 2; - pos = pos % limit; - if (pos < 0) pos = limit + pos; - if (pos >= GRADIENT_STOP_SIZE) pos = (limit - pos - 1); - break; - } - } - return pos; -} - - -static inline uint32_t _fixedPixel(const SwFill* fill, int32_t pos) -{ - int32_t i = (pos + (FIXPT_SIZE / 2)) >> FIXPT_BITS; - return fill->ctable[_clamp(fill, i)]; -} - - -static inline uint32_t _pixel(const SwFill* fill, float pos) -{ - auto i = static_cast(pos * (GRADIENT_STOP_SIZE - 1) + 0.5f); - return fill->ctable[_clamp(fill, i)]; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - - -void fillRadial(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwAlpha alpha, uint8_t csize, uint8_t opacity) -{ - //edge case - if (fill->radial.a < RADIAL_A_THRESHOLD) { - auto radial = &fill->radial; - auto rx = (x + 0.5f) * radial->a11 + (y + 0.5f) * radial->a12 + radial->a13 - radial->fx; - auto ry = (x + 0.5f) * radial->a21 + (y + 0.5f) * radial->a22 + radial->a23 - radial->fy; - - if (opacity == 255) { - for (uint32_t i = 0 ; i < len ; ++i, ++dst, cmp += csize) { - auto x0 = 0.5f * (rx * rx + ry * ry - radial->fr * radial->fr) / (radial->dr * radial->fr + rx * radial->dx + ry * radial->dy); - *dst = opBlendNormal(_pixel(fill, x0), *dst, alpha(cmp)); - rx += radial->a11; - ry += radial->a21; - } - } else { - for (uint32_t i = 0 ; i < len ; ++i, ++dst, cmp += csize) { - auto x0 = 0.5f * (rx * rx + ry * ry - radial->fr * radial->fr) / (radial->dr * radial->fr + rx * radial->dx + ry * radial->dy); - *dst = opBlendNormal(_pixel(fill, x0), *dst, MULTIPLY(opacity, alpha(cmp))); - rx += radial->a11; - ry += radial->a21; - } - } - } else { - float b, deltaB, det, deltaDet, deltaDeltaDet; - _calculateCoefficients(fill, x, y, b, deltaB, det, deltaDet, deltaDeltaDet); - - if (opacity == 255) { - for (uint32_t i = 0 ; i < len ; ++i, ++dst, cmp += csize) { - *dst = opBlendNormal(_pixel(fill, sqrtf(det) - b), *dst, alpha(cmp)); - det += deltaDet; - deltaDet += deltaDeltaDet; - b += deltaB; - } - } else { - for (uint32_t i = 0 ; i < len ; ++i, ++dst, cmp += csize) { - *dst = opBlendNormal(_pixel(fill, sqrtf(det) - b), *dst, MULTIPLY(opacity, alpha(cmp))); - det += deltaDet; - deltaDet += deltaDeltaDet; - b += deltaB; - } - } - } -} - - -void fillRadial(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, uint8_t a) -{ - if (fill->radial.a < RADIAL_A_THRESHOLD) { - auto radial = &fill->radial; - auto rx = (x + 0.5f) * radial->a11 + (y + 0.5f) * radial->a12 + radial->a13 - radial->fx; - auto ry = (x + 0.5f) * radial->a21 + (y + 0.5f) * radial->a22 + radial->a23 - radial->fy; - for (uint32_t i = 0; i < len; ++i, ++dst) { - auto x0 = 0.5f * (rx * rx + ry * ry - radial->fr * radial->fr) / (radial->dr * radial->fr + rx * radial->dx + ry * radial->dy); - *dst = op(_pixel(fill, x0), *dst, a); - rx += radial->a11; - ry += radial->a21; - } - } else { - float b, deltaB, det, deltaDet, deltaDeltaDet; - _calculateCoefficients(fill, x, y, b, deltaB, det, deltaDet, deltaDeltaDet); - - for (uint32_t i = 0; i < len; ++i, ++dst) { - *dst = op(_pixel(fill, sqrtf(det) - b), *dst, a); - det += deltaDet; - deltaDet += deltaDeltaDet; - b += deltaB; - } - } -} - - -void fillRadial(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, SwMask maskOp, uint8_t a) -{ - if (fill->radial.a < RADIAL_A_THRESHOLD) { - auto radial = &fill->radial; - auto rx = (x + 0.5f) * radial->a11 + (y + 0.5f) * radial->a12 + radial->a13 - radial->fx; - auto ry = (x + 0.5f) * radial->a21 + (y + 0.5f) * radial->a22 + radial->a23 - radial->fy; - for (uint32_t i = 0 ; i < len ; ++i, ++dst) { - auto x0 = 0.5f * (rx * rx + ry * ry - radial->fr * radial->fr) / (radial->dr * radial->fr + rx * radial->dx + ry * radial->dy); - auto src = MULTIPLY(a, A(_pixel(fill, x0))); - *dst = maskOp(src, *dst, ~src); - rx += radial->a11; - ry += radial->a21; - } - } else { - float b, deltaB, det, deltaDet, deltaDeltaDet; - _calculateCoefficients(fill, x, y, b, deltaB, det, deltaDet, deltaDeltaDet); - - for (uint32_t i = 0 ; i < len ; ++i, ++dst) { - auto src = MULTIPLY(a, A(_pixel(fill, sqrtf(det) - b))); - *dst = maskOp(src, *dst, ~src); - det += deltaDet; - deltaDet += deltaDeltaDet; - b += deltaB; - } - } -} - - -void fillRadial(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwMask maskOp, uint8_t a) -{ - if (fill->radial.a < RADIAL_A_THRESHOLD) { - auto radial = &fill->radial; - auto rx = (x + 0.5f) * radial->a11 + (y + 0.5f) * radial->a12 + radial->a13 - radial->fx; - auto ry = (x + 0.5f) * radial->a21 + (y + 0.5f) * radial->a22 + radial->a23 - radial->fy; - for (uint32_t i = 0 ; i < len ; ++i, ++dst, ++cmp) { - auto x0 = 0.5f * (rx * rx + ry * ry - radial->fr * radial->fr) / (radial->dr * radial->fr + rx * radial->dx + ry * radial->dy); - auto src = MULTIPLY(A(A(_pixel(fill, x0))), a); - auto tmp = maskOp(src, *cmp, 0); - *dst = tmp + MULTIPLY(*dst, ~tmp); - rx += radial->a11; - ry += radial->a21; - } - } else { - float b, deltaB, det, deltaDet, deltaDeltaDet; - _calculateCoefficients(fill, x, y, b, deltaB, det, deltaDet, deltaDeltaDet); - - for (uint32_t i = 0 ; i < len ; ++i, ++dst, ++cmp) { - auto src = MULTIPLY(A(_pixel(fill, sqrtf(det))), a); - auto tmp = maskOp(src, *cmp, 0); - *dst = tmp + MULTIPLY(*dst, ~tmp); - deltaDet += deltaDeltaDet; - b += deltaB; - } - } -} - - -void fillRadial(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, SwBlender op2, uint8_t a) -{ - if (fill->radial.a < RADIAL_A_THRESHOLD) { - auto radial = &fill->radial; - auto rx = (x + 0.5f) * radial->a11 + (y + 0.5f) * radial->a12 + radial->a13 - radial->fx; - auto ry = (x + 0.5f) * radial->a21 + (y + 0.5f) * radial->a22 + radial->a23 - radial->fy; - - if (a == 255) { - for (uint32_t i = 0; i < len; ++i, ++dst) { - auto x0 = 0.5f * (rx * rx + ry * ry - radial->fr * radial->fr) / (radial->dr * radial->fr + rx * radial->dx + ry * radial->dy); - auto tmp = op(_pixel(fill, x0), *dst, 255); - *dst = op2(tmp, *dst, 255); - rx += radial->a11; - ry += radial->a21; - } - } else { - for (uint32_t i = 0; i < len; ++i, ++dst) { - auto x0 = 0.5f * (rx * rx + ry * ry - radial->fr * radial->fr) / (radial->dr * radial->fr + rx * radial->dx + ry * radial->dy); - auto tmp = op(_pixel(fill, x0), *dst, 255); - auto tmp2 = op2(tmp, *dst, 255); - *dst = INTERPOLATE(tmp2, *dst, a); - rx += radial->a11; - ry += radial->a21; - } - } - } else { - float b, deltaB, det, deltaDet, deltaDeltaDet; - _calculateCoefficients(fill, x, y, b, deltaB, det, deltaDet, deltaDeltaDet); - if (a == 255) { - for (uint32_t i = 0 ; i < len ; ++i, ++dst) { - auto tmp = op(_pixel(fill, sqrtf(det) - b), *dst, 255); - *dst = op2(tmp, *dst, 255); - det += deltaDet; - deltaDet += deltaDeltaDet; - b += deltaB; - } - } else { - for (uint32_t i = 0 ; i < len ; ++i, ++dst) { - auto tmp = op(_pixel(fill, sqrtf(det) - b), *dst, 255); - auto tmp2 = op2(tmp, *dst, 255); - *dst = INTERPOLATE(tmp2, *dst, a); - det += deltaDet; - deltaDet += deltaDeltaDet; - b += deltaB; - } - } - } -} - - -void fillLinear(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwAlpha alpha, uint8_t csize, uint8_t opacity) -{ - //Rotation - float rx = x + 0.5f; - float ry = y + 0.5f; - float t = (fill->linear.dx * rx + fill->linear.dy * ry + fill->linear.offset) * (GRADIENT_STOP_SIZE - 1); - float inc = (fill->linear.dx) * (GRADIENT_STOP_SIZE - 1); - - if (opacity == 255) { - if (mathZero(inc)) { - auto color = _fixedPixel(fill, static_cast(t * FIXPT_SIZE)); - for (uint32_t i = 0; i < len; ++i, ++dst, cmp += csize) { - *dst = opBlendNormal(color, *dst, alpha(cmp)); - } - return; - } - - auto vMax = static_cast(INT32_MAX >> (FIXPT_BITS + 1)); - auto vMin = -vMax; - auto v = t + (inc * len); - - //we can use fixed point math - if (v < vMax && v > vMin) { - auto t2 = static_cast(t * FIXPT_SIZE); - auto inc2 = static_cast(inc * FIXPT_SIZE); - for (uint32_t j = 0; j < len; ++j, ++dst, cmp += csize) { - *dst = opBlendNormal(_fixedPixel(fill, t2), *dst, alpha(cmp)); - t2 += inc2; - } - //we have to fallback to float math - } else { - uint32_t counter = 0; - while (counter++ < len) { - *dst = opBlendNormal(_pixel(fill, t / GRADIENT_STOP_SIZE), *dst, alpha(cmp)); - ++dst; - t += inc; - cmp += csize; - } - } - } else { - if (mathZero(inc)) { - auto color = _fixedPixel(fill, static_cast(t * FIXPT_SIZE)); - for (uint32_t i = 0; i < len; ++i, ++dst, cmp += csize) { - *dst = opBlendNormal(color, *dst, MULTIPLY(alpha(cmp), opacity)); - } - return; - } - - auto vMax = static_cast(INT32_MAX >> (FIXPT_BITS + 1)); - auto vMin = -vMax; - auto v = t + (inc * len); - - //we can use fixed point math - if (v < vMax && v > vMin) { - auto t2 = static_cast(t * FIXPT_SIZE); - auto inc2 = static_cast(inc * FIXPT_SIZE); - for (uint32_t j = 0; j < len; ++j, ++dst, cmp += csize) { - *dst = opBlendNormal(_fixedPixel(fill, t2), *dst, MULTIPLY(alpha(cmp), opacity)); - t2 += inc2; - } - //we have to fallback to float math - } else { - uint32_t counter = 0; - while (counter++ < len) { - *dst = opBlendNormal(_pixel(fill, t / GRADIENT_STOP_SIZE), *dst, MULTIPLY(opacity, alpha(cmp))); - ++dst; - t += inc; - cmp += csize; - } - } - } -} - - -void fillLinear(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, SwMask maskOp, uint8_t a) -{ - //Rotation - float rx = x + 0.5f; - float ry = y + 0.5f; - float t = (fill->linear.dx * rx + fill->linear.dy * ry + fill->linear.offset) * (GRADIENT_STOP_SIZE - 1); - float inc = (fill->linear.dx) * (GRADIENT_STOP_SIZE - 1); - - if (mathZero(inc)) { - auto src = MULTIPLY(a, A(_fixedPixel(fill, static_cast(t * FIXPT_SIZE)))); - for (uint32_t i = 0; i < len; ++i, ++dst) { - *dst = maskOp(src, *dst, ~src); - } - return; - } - - auto vMax = static_cast(INT32_MAX >> (FIXPT_BITS + 1)); - auto vMin = -vMax; - auto v = t + (inc * len); - - //we can use fixed point math - if (v < vMax && v > vMin) { - auto t2 = static_cast(t * FIXPT_SIZE); - auto inc2 = static_cast(inc * FIXPT_SIZE); - for (uint32_t j = 0; j < len; ++j, ++dst) { - auto src = MULTIPLY(_fixedPixel(fill, t2), a); - *dst = maskOp(src, *dst, ~src); - t2 += inc2; - } - //we have to fallback to float math - } else { - uint32_t counter = 0; - while (counter++ < len) { - auto src = MULTIPLY(_pixel(fill, t / GRADIENT_STOP_SIZE), a); - *dst = maskOp(src, *dst, ~src); - ++dst; - t += inc; - } - } -} - - -void fillLinear(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwMask maskOp, uint8_t a) -{ - //Rotation - float rx = x + 0.5f; - float ry = y + 0.5f; - float t = (fill->linear.dx * rx + fill->linear.dy * ry + fill->linear.offset) * (GRADIENT_STOP_SIZE - 1); - float inc = (fill->linear.dx) * (GRADIENT_STOP_SIZE - 1); - - if (mathZero(inc)) { - auto src = A(_fixedPixel(fill, static_cast(t * FIXPT_SIZE))); - src = MULTIPLY(src, a); - for (uint32_t i = 0; i < len; ++i, ++dst, ++cmp) { - auto tmp = maskOp(src, *cmp, 0); - *dst = tmp + MULTIPLY(*dst, ~tmp); - } - return; - } - - auto vMax = static_cast(INT32_MAX >> (FIXPT_BITS + 1)); - auto vMin = -vMax; - auto v = t + (inc * len); - - //we can use fixed point math - if (v < vMax && v > vMin) { - auto t2 = static_cast(t * FIXPT_SIZE); - auto inc2 = static_cast(inc * FIXPT_SIZE); - for (uint32_t j = 0; j < len; ++j, ++dst, ++cmp) { - auto src = MULTIPLY(a, A(_fixedPixel(fill, t2))); - auto tmp = maskOp(src, *cmp, 0); - *dst = tmp + MULTIPLY(*dst, ~tmp); - t2 += inc2; - } - //we have to fallback to float math - } else { - uint32_t counter = 0; - while (counter++ < len) { - auto src = MULTIPLY(A(_pixel(fill, t / GRADIENT_STOP_SIZE)), a); - auto tmp = maskOp(src, *cmp, 0); - *dst = tmp + MULTIPLY(*dst, ~tmp); - ++dst; - ++cmp; - t += inc; - } - } -} - - -void fillLinear(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, uint8_t a) -{ - //Rotation - float rx = x + 0.5f; - float ry = y + 0.5f; - float t = (fill->linear.dx * rx + fill->linear.dy * ry + fill->linear.offset) * (GRADIENT_STOP_SIZE - 1); - float inc = (fill->linear.dx) * (GRADIENT_STOP_SIZE - 1); - - if (mathZero(inc)) { - auto color = _fixedPixel(fill, static_cast(t * FIXPT_SIZE)); - for (uint32_t i = 0; i < len; ++i, ++dst) { - *dst = op(color, *dst, a); - } - return; - } - - auto vMax = static_cast(INT32_MAX >> (FIXPT_BITS + 1)); - auto vMin = -vMax; - auto v = t + (inc * len); - - //we can use fixed point math - if (v < vMax && v > vMin) { - auto t2 = static_cast(t * FIXPT_SIZE); - auto inc2 = static_cast(inc * FIXPT_SIZE); - for (uint32_t j = 0; j < len; ++j, ++dst) { - *dst = op(_fixedPixel(fill, t2), *dst, a); - t2 += inc2; - } - //we have to fallback to float math - } else { - uint32_t counter = 0; - while (counter++ < len) { - *dst = op(_pixel(fill, t / GRADIENT_STOP_SIZE), *dst, a); - ++dst; - t += inc; - } - } -} - - -void fillLinear(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, SwBlender op2, uint8_t a) -{ - //Rotation - float rx = x + 0.5f; - float ry = y + 0.5f; - float t = (fill->linear.dx * rx + fill->linear.dy * ry + fill->linear.offset) * (GRADIENT_STOP_SIZE - 1); - float inc = (fill->linear.dx) * (GRADIENT_STOP_SIZE - 1); - - if (mathZero(inc)) { - auto color = _fixedPixel(fill, static_cast(t * FIXPT_SIZE)); - if (a == 255) { - for (uint32_t i = 0; i < len; ++i, ++dst) { - auto tmp = op(color, *dst, a); - *dst = op2(tmp, *dst, 255); - } - } else { - for (uint32_t i = 0; i < len; ++i, ++dst) { - auto tmp = op(color, *dst, a); - auto tmp2 = op2(tmp, *dst, 255); - *dst = INTERPOLATE(tmp2, *dst, a); - } - } - return; - } - - auto vMax = static_cast(INT32_MAX >> (FIXPT_BITS + 1)); - auto vMin = -vMax; - auto v = t + (inc * len); - - if (a == 255) { - //we can use fixed point math - if (v < vMax && v > vMin) { - auto t2 = static_cast(t * FIXPT_SIZE); - auto inc2 = static_cast(inc * FIXPT_SIZE); - for (uint32_t j = 0; j < len; ++j, ++dst) { - auto tmp = op(_fixedPixel(fill, t2), *dst, 255); - *dst = op2(tmp, *dst, 255); - t2 += inc2; - } - //we have to fallback to float math - } else { - uint32_t counter = 0; - while (counter++ < len) { - auto tmp = op(_pixel(fill, t / GRADIENT_STOP_SIZE), *dst, 255); - *dst = op2(tmp, *dst, 255); - ++dst; - t += inc; - } - } - } else { - //we can use fixed point math - if (v < vMax && v > vMin) { - auto t2 = static_cast(t * FIXPT_SIZE); - auto inc2 = static_cast(inc * FIXPT_SIZE); - for (uint32_t j = 0; j < len; ++j, ++dst) { - auto tmp = op(_fixedPixel(fill, t2), *dst, 255); - auto tmp2 = op2(tmp, *dst, 255); - *dst = INTERPOLATE(tmp2, *dst, a); - t2 += inc2; - } - //we have to fallback to float math - } else { - uint32_t counter = 0; - while (counter++ < len) { - auto tmp = op(_pixel(fill, t / GRADIENT_STOP_SIZE), *dst, 255); - auto tmp2 = op2(tmp, *dst, 255); - *dst = INTERPOLATE(tmp2, *dst, a); - ++dst; - t += inc; - } - } - } -} - - -bool fillGenColorTable(SwFill* fill, const Fill* fdata, const Matrix* transform, SwSurface* surface, uint8_t opacity, bool ctable) -{ - if (!fill) return false; - - fill->spread = fdata->spread(); - - if (ctable) { - if (!_updateColorTable(fill, fdata, surface, opacity)) return false; - } - - if (fdata->identifier() == TVG_CLASS_ID_LINEAR) { - return _prepareLinear(fill, static_cast(fdata), transform); - } else if (fdata->identifier() == TVG_CLASS_ID_RADIAL) { - return _prepareRadial(fill, static_cast(fdata), transform); - } - - //LOG: What type of gradient?! - - return false; -} - - -void fillReset(SwFill* fill) -{ - if (fill->ctable) { - free(fill->ctable); - fill->ctable = nullptr; - } - fill->translucent = false; -} - - -void fillFree(SwFill* fill) -{ - if (!fill) return; - - if (fill->ctable) free(fill->ctable); - - free(fill); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwImage.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwImage.cpp deleted file mode 100644 index 22d1cf7..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwImage.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgMath.h" -#include "tvgSwCommon.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static inline bool _onlyShifted(const Matrix* m) -{ - if (mathEqual(m->e11, 1.0f) && mathEqual(m->e22, 1.0f) && mathZero(m->e12) && mathZero(m->e21)) return true; - return false; -} - - -static bool _genOutline(SwImage* image, const RenderMesh* mesh, const Matrix* transform, SwMpool* mpool, unsigned tid) -{ - image->outline = mpoolReqOutline(mpool, tid); - auto outline = image->outline; - - outline->pts.reserve(5); - outline->types.reserve(5); - outline->cntrs.reserve(1); - outline->closed.reserve(1); - - Point to[4]; - if (mesh->triangleCnt > 0) { - // TODO: Optimise me. We appear to calculate this exact min/max bounding area in multiple - // places. We should be able to re-use one we have already done? Also see: - // tvgPicture.h --> bounds - // tvgSwRasterTexmap.h --> _rasterTexmapPolygonMesh - // - // TODO: Should we calculate the exact path(s) of the triangle mesh instead? - // i.e. copy tvgSwShape.capp -> _genOutline? - // - // TODO: Cntrs? - auto triangles = mesh->triangles; - auto min = triangles[0].vertex[0].pt; - auto max = triangles[0].vertex[0].pt; - - for (uint32_t i = 0; i < mesh->triangleCnt; ++i) { - if (triangles[i].vertex[0].pt.x < min.x) min.x = triangles[i].vertex[0].pt.x; - else if (triangles[i].vertex[0].pt.x > max.x) max.x = triangles[i].vertex[0].pt.x; - if (triangles[i].vertex[0].pt.y < min.y) min.y = triangles[i].vertex[0].pt.y; - else if (triangles[i].vertex[0].pt.y > max.y) max.y = triangles[i].vertex[0].pt.y; - - if (triangles[i].vertex[1].pt.x < min.x) min.x = triangles[i].vertex[1].pt.x; - else if (triangles[i].vertex[1].pt.x > max.x) max.x = triangles[i].vertex[1].pt.x; - if (triangles[i].vertex[1].pt.y < min.y) min.y = triangles[i].vertex[1].pt.y; - else if (triangles[i].vertex[1].pt.y > max.y) max.y = triangles[i].vertex[1].pt.y; - - if (triangles[i].vertex[2].pt.x < min.x) min.x = triangles[i].vertex[2].pt.x; - else if (triangles[i].vertex[2].pt.x > max.x) max.x = triangles[i].vertex[2].pt.x; - if (triangles[i].vertex[2].pt.y < min.y) min.y = triangles[i].vertex[2].pt.y; - else if (triangles[i].vertex[2].pt.y > max.y) max.y = triangles[i].vertex[2].pt.y; - } - to[0] = {min.x, min.y}; - to[1] = {max.x, min.y}; - to[2] = {max.x, max.y}; - to[3] = {min.x, max.y}; - } else { - auto w = static_cast(image->w); - auto h = static_cast(image->h); - to[0] = {0, 0}; - to[1] = {w, 0}; - to[2] = {w, h}; - to[3] = {0, h}; - } - - for (int i = 0; i < 4; i++) { - outline->pts.push(mathTransform(&to[i], transform)); - outline->types.push(SW_CURVE_TYPE_POINT); - } - - outline->pts.push(outline->pts[0]); - outline->types.push(SW_CURVE_TYPE_POINT); - outline->cntrs.push(outline->pts.count - 1); - outline->closed.push(true); - - image->outline = outline; - - return true; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -bool imagePrepare(SwImage* image, const RenderMesh* mesh, const Matrix* transform, const SwBBox& clipRegion, SwBBox& renderRegion, SwMpool* mpool, unsigned tid) -{ - image->direct = _onlyShifted(transform); - - //Fast track: Non-transformed image but just shifted. - if (image->direct) { - image->ox = -static_cast(round(transform->e13)); - image->oy = -static_cast(round(transform->e23)); - //Figure out the scale factor by transform matrix - } else { - auto scaleX = sqrtf((transform->e11 * transform->e11) + (transform->e21 * transform->e21)); - auto scaleY = sqrtf((transform->e22 * transform->e22) + (transform->e12 * transform->e12)); - image->scale = (fabsf(scaleX - scaleY) > 0.01f) ? 1.0f : scaleX; - - if (mathZero(transform->e12) && mathZero(transform->e21)) image->scaled = true; - else image->scaled = false; - } - - if (!_genOutline(image, mesh, transform, mpool, tid)) return false; - return mathUpdateOutlineBBox(image->outline, clipRegion, renderRegion, image->direct); -} - - -bool imageGenRle(SwImage* image, const SwBBox& renderRegion, bool antiAlias) -{ - if ((image->rle = rleRender(image->rle, image->outline, renderRegion, antiAlias))) return true; - - return false; -} - - -void imageDelOutline(SwImage* image, SwMpool* mpool, uint32_t tid) -{ - mpoolRetOutline(mpool, tid); - image->outline = nullptr; -} - - -void imageReset(SwImage* image) -{ - rleReset(image->rle); -} - - -void imageFree(SwImage* image) -{ - rleFree(image->rle); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwMath.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwMath.cpp deleted file mode 100644 index 8b8d8a4..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwMath.cpp +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgMath.h" -#include "tvgSwCommon.h" - - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static float TO_RADIAN(SwFixed angle) -{ - return (float(angle) / 65536.0f) * (MATH_PI / 180.0f); -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -SwFixed mathMean(SwFixed angle1, SwFixed angle2) -{ - return angle1 + mathDiff(angle1, angle2) / 2; -} - - -bool mathSmallCubic(const SwPoint* base, SwFixed& angleIn, SwFixed& angleMid, SwFixed& angleOut) -{ - auto d1 = base[2] - base[3]; - auto d2 = base[1] - base[2]; - auto d3 = base[0] - base[1]; - - if (d1.small()) { - if (d2.small()) { - if (d3.small()) { - angleIn = angleMid = angleOut = 0; - return true; - } else { - angleIn = angleMid = angleOut = mathAtan(d3); - } - } else { - if (d3.small()) { - angleIn = angleMid = angleOut = mathAtan(d2); - } else { - angleIn = angleMid = mathAtan(d2); - angleOut = mathAtan(d3); - } - } - } else { - if (d2.small()) { - if (d3.small()) { - angleIn = angleMid = angleOut = mathAtan(d1); - } else { - angleIn = mathAtan(d1); - angleOut = mathAtan(d3); - angleMid = mathMean(angleIn, angleOut); - } - } else { - if (d3.small()) { - angleIn = mathAtan(d1); - angleMid = angleOut = mathAtan(d2); - } else { - angleIn = mathAtan(d1); - angleMid = mathAtan(d2); - angleOut = mathAtan(d3); - } - } - } - - auto theta1 = abs(mathDiff(angleIn, angleMid)); - auto theta2 = abs(mathDiff(angleMid, angleOut)); - - if ((theta1 < (SW_ANGLE_PI / 8)) && (theta2 < (SW_ANGLE_PI / 8))) return true; - return false; -} - - -int64_t mathMultiply(int64_t a, int64_t b) -{ - int32_t s = 1; - - //move sign - if (a < 0) { - a = -a; - s = -s; - } - if (b < 0) { - b = -b; - s = -s; - } - int64_t c = (a * b + 0x8000L) >> 16; - return (s > 0) ? c : -c; -} - - -int64_t mathDivide(int64_t a, int64_t b) -{ - int32_t s = 1; - - //move sign - if (a < 0) { - a = -a; - s = -s; - } - if (b < 0) { - b = -b; - s = -s; - } - int64_t q = b > 0 ? ((a << 16) + (b >> 1)) / b : 0x7FFFFFFFL; - return (s < 0 ? -q : q); -} - - -int64_t mathMulDiv(int64_t a, int64_t b, int64_t c) -{ - int32_t s = 1; - - //move sign - if (a < 0) { - a = -a; - s = -s; - } - if (b < 0) { - b = -b; - s = -s; - } - if (c < 0) { - c = -c; - s = -s; - } - int64_t d = c > 0 ? (a * b + (c >> 1)) / c : 0x7FFFFFFFL; - - return (s > 0 ? d : -d); -} - - -void mathRotate(SwPoint& pt, SwFixed angle) -{ - if (angle == 0 || pt.zero()) return; - - Point v = pt.toPoint(); - - auto radian = TO_RADIAN(angle); - auto cosv = cosf(radian); - auto sinv = sinf(radian); - - pt.x = SwCoord(roundf((v.x * cosv - v.y * sinv) * 64.0f)); - pt.y = SwCoord(roundf((v.x * sinv + v.y * cosv) * 64.0f)); -} - - -SwFixed mathTan(SwFixed angle) -{ - if (angle == 0) return 0; - return SwFixed(tanf(TO_RADIAN(angle)) * 65536.0f); -} - - -SwFixed mathAtan(const SwPoint& pt) -{ - if (pt.zero()) return 0; - return SwFixed(atan2f(TO_FLOAT(pt.y), TO_FLOAT(pt.x)) * (180.0f / MATH_PI) * 65536.0f); -} - - -SwFixed mathSin(SwFixed angle) -{ - if (angle == 0) return 0; - return mathCos(SW_ANGLE_PI2 - angle); -} - - -SwFixed mathCos(SwFixed angle) -{ - return SwFixed(cosf(TO_RADIAN(angle)) * 65536.0f); -} - - -SwFixed mathLength(const SwPoint& pt) -{ - if (pt.zero()) return 0; - - //trivial case - if (pt.x == 0) return abs(pt.y); - if (pt.y == 0) return abs(pt.x); - - auto v = pt.toPoint(); - //return static_cast(sqrtf(v.x * v.x + v.y * v.y) * 65536.0f); - - /* approximate sqrt(x*x + y*y) using alpha max plus beta min algorithm. - With alpha = 1, beta = 3/8, giving results with the largest error less - than 7% compared to the exact value. */ - if (v.x < 0) v.x = -v.x; - if (v.y < 0) v.y = -v.y; - return static_cast((v.x > v.y) ? (v.x + v.y * 0.375f) : (v.y + v.x * 0.375f)); -} - - -void mathSplitCubic(SwPoint* base) -{ - SwCoord a, b, c, d; - - base[6].x = base[3].x; - c = base[1].x; - d = base[2].x; - base[1].x = a = (base[0].x + c) >> 1; - base[5].x = b = (base[3].x + d) >> 1; - c = (c + d) >> 1; - base[2].x = a = (a + c) >> 1; - base[4].x = b = (b + c) >> 1; - base[3].x = (a + b) >> 1; - - base[6].y = base[3].y; - c = base[1].y; - d = base[2].y; - base[1].y = a = (base[0].y + c) >> 1; - base[5].y = b = (base[3].y + d) >> 1; - c = (c + d) >> 1; - base[2].y = a = (a + c) >> 1; - base[4].y = b = (b + c) >> 1; - base[3].y = (a + b) >> 1; -} - - -SwFixed mathDiff(SwFixed angle1, SwFixed angle2) -{ - auto delta = angle2 - angle1; - - delta %= SW_ANGLE_2PI; - if (delta < 0) delta += SW_ANGLE_2PI; - if (delta > SW_ANGLE_PI) delta -= SW_ANGLE_2PI; - - return delta; -} - - -SwPoint mathTransform(const Point* to, const Matrix* transform) -{ - if (!transform) return {TO_SWCOORD(to->x), TO_SWCOORD(to->y)}; - - auto tx = to->x * transform->e11 + to->y * transform->e12 + transform->e13; - auto ty = to->x * transform->e21 + to->y * transform->e22 + transform->e23; - - return {TO_SWCOORD(tx), TO_SWCOORD(ty)}; -} - - -bool mathClipBBox(const SwBBox& clipper, SwBBox& clipee) -{ - clipee.max.x = (clipee.max.x < clipper.max.x) ? clipee.max.x : clipper.max.x; - clipee.max.y = (clipee.max.y < clipper.max.y) ? clipee.max.y : clipper.max.y; - clipee.min.x = (clipee.min.x > clipper.min.x) ? clipee.min.x : clipper.min.x; - clipee.min.y = (clipee.min.y > clipper.min.y) ? clipee.min.y : clipper.min.y; - - //Check valid region - if (clipee.max.x - clipee.min.x < 1 && clipee.max.y - clipee.min.y < 1) return false; - - //Check boundary - if (clipee.min.x >= clipper.max.x || clipee.min.y >= clipper.max.y || - clipee.max.x <= clipper.min.x || clipee.max.y <= clipper.min.y) return false; - - return true; -} - - -bool mathUpdateOutlineBBox(const SwOutline* outline, const SwBBox& clipRegion, SwBBox& renderRegion, bool fastTrack) -{ - if (!outline) return false; - - if (outline->pts.empty() || outline->cntrs.empty()) { - renderRegion.reset(); - return false; - } - - auto pt = outline->pts.begin(); - - auto xMin = pt->x; - auto xMax = pt->x; - auto yMin = pt->y; - auto yMax = pt->y; - - for (++pt; pt < outline->pts.end(); ++pt) { - if (xMin > pt->x) xMin = pt->x; - if (xMax < pt->x) xMax = pt->x; - if (yMin > pt->y) yMin = pt->y; - if (yMax < pt->y) yMax = pt->y; - } - //Since no antialiasing is applied in the Fast Track case, - //the rasterization region has to be rearranged. - //https://github.com/Samsung/thorvg/issues/916 - if (fastTrack) { - renderRegion.min.x = static_cast(round(xMin / 64.0f)); - renderRegion.max.x = static_cast(round(xMax / 64.0f)); - renderRegion.min.y = static_cast(round(yMin / 64.0f)); - renderRegion.max.y = static_cast(round(yMax / 64.0f)); - } else { - renderRegion.min.x = xMin >> 6; - renderRegion.max.x = (xMax + 63) >> 6; - renderRegion.min.y = yMin >> 6; - renderRegion.max.y = (yMax + 63) >> 6; - } - return mathClipBBox(clipRegion, renderRegion); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwMemPool.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwMemPool.cpp deleted file mode 100644 index 4a9d7f5..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwMemPool.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgSwCommon.h" - - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -SwOutline* mpoolReqOutline(SwMpool* mpool, unsigned idx) -{ - return &mpool->outline[idx]; -} - - -void mpoolRetOutline(SwMpool* mpool, unsigned idx) -{ - mpool->outline[idx].pts.clear(); - mpool->outline[idx].cntrs.clear(); - mpool->outline[idx].types.clear(); - mpool->outline[idx].closed.clear(); -} - - -SwOutline* mpoolReqStrokeOutline(SwMpool* mpool, unsigned idx) -{ - return &mpool->strokeOutline[idx]; -} - - -void mpoolRetStrokeOutline(SwMpool* mpool, unsigned idx) -{ - mpool->strokeOutline[idx].pts.clear(); - mpool->strokeOutline[idx].cntrs.clear(); - mpool->strokeOutline[idx].types.clear(); - mpool->strokeOutline[idx].closed.clear(); -} - - -SwOutline* mpoolReqDashOutline(SwMpool* mpool, unsigned idx) -{ - return &mpool->dashOutline[idx]; -} - - -void mpoolRetDashOutline(SwMpool* mpool, unsigned idx) -{ - mpool->dashOutline[idx].pts.clear(); - mpool->dashOutline[idx].cntrs.clear(); - mpool->dashOutline[idx].types.clear(); - mpool->dashOutline[idx].closed.clear(); -} - - -SwMpool* mpoolInit(uint32_t threads) -{ - auto allocSize = threads + 1; - - auto mpool = static_cast(calloc(sizeof(SwMpool), 1)); - mpool->outline = static_cast(calloc(1, sizeof(SwOutline) * allocSize)); - mpool->strokeOutline = static_cast(calloc(1, sizeof(SwOutline) * allocSize)); - mpool->dashOutline = static_cast(calloc(1, sizeof(SwOutline) * allocSize)); - mpool->allocSize = allocSize; - - return mpool; -} - - -bool mpoolClear(SwMpool* mpool) -{ - for (unsigned i = 0; i < mpool->allocSize; ++i) { - mpool->outline[i].pts.reset(); - mpool->outline[i].cntrs.reset(); - mpool->outline[i].types.reset(); - mpool->outline[i].closed.reset(); - - mpool->strokeOutline[i].pts.reset(); - mpool->strokeOutline[i].cntrs.reset(); - mpool->strokeOutline[i].types.reset(); - mpool->strokeOutline[i].closed.reset(); - - mpool->dashOutline[i].pts.reset(); - mpool->dashOutline[i].cntrs.reset(); - mpool->dashOutline[i].types.reset(); - mpool->dashOutline[i].closed.reset(); - } - - return true; -} - - -bool mpoolTerm(SwMpool* mpool) -{ - if (!mpool) return false; - - mpoolClear(mpool); - - free(mpool->outline); - free(mpool->strokeOutline); - free(mpool->dashOutline); - free(mpool); - - return true; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRaster.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRaster.cpp deleted file mode 100644 index 237e30d..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRaster.cpp +++ /dev/null @@ -1,1967 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifdef _WIN32 - #include -#elif defined(__linux__) - #include -#else - #include -#endif - -#include "tvgMath.h" -#include "tvgRender.h" -#include "tvgSwCommon.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ -constexpr auto DOWN_SCALE_TOLERANCE = 0.5f; - -struct FillLinear -{ - void operator()(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, SwMask op, uint8_t a) - { - fillLinear(fill, dst, y, x, len, op, a); - } - - void operator()(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwMask op, uint8_t a) - { - fillLinear(fill, dst, y, x, len, cmp, op, a); - } - - void operator()(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, uint8_t a) - { - fillLinear(fill, dst, y, x, len, op, a); - } - - void operator()(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwAlpha alpha, uint8_t csize, uint8_t opacity) - { - fillLinear(fill, dst, y, x, len, cmp, alpha, csize, opacity); - } - - void operator()(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, SwBlender op2, uint8_t a) - { - fillLinear(fill, dst, y, x, len, op, op2, a); - } - -}; - -struct FillRadial -{ - void operator()(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, SwMask op, uint8_t a) - { - fillRadial(fill, dst, y, x, len, op, a); - } - - void operator()(const SwFill* fill, uint8_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwMask op, uint8_t a) - { - fillRadial(fill, dst, y, x, len, cmp, op, a); - } - - void operator()(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, uint8_t a) - { - fillRadial(fill, dst, y, x, len, op, a); - } - - void operator()(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, uint8_t* cmp, SwAlpha alpha, uint8_t csize, uint8_t opacity) - { - fillRadial(fill, dst, y, x, len, cmp, alpha, csize, opacity); - } - - void operator()(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len, SwBlender op, SwBlender op2, uint8_t a) - { - fillRadial(fill, dst, y, x, len, op, op2, a); - } -}; - - -static inline uint8_t _alpha(uint8_t* a) -{ - return *a; -} - - -static inline uint8_t _ialpha(uint8_t* a) -{ - return ~(*a); -} - - -static inline uint8_t _abgrLuma(uint8_t* c) -{ - auto v = *(uint32_t*)c; - return ((((v&0xff)*54) + (((v>>8)&0xff)*183) + (((v>>16)&0xff)*19))) >> 8; //0.2125*R + 0.7154*G + 0.0721*B -} - - -static inline uint8_t _argbLuma(uint8_t* c) -{ - auto v = *(uint32_t*)c; - return ((((v&0xff)*19) + (((v>>8)&0xff)*183) + (((v>>16)&0xff)*54))) >> 8; //0.0721*B + 0.7154*G + 0.2125*R -} - - -static inline uint8_t _abgrInvLuma(uint8_t* c) -{ - return ~_abgrLuma(c); -} - - -static inline uint8_t _argbInvLuma(uint8_t* c) -{ - return ~_argbLuma(c); -} - - -static inline uint32_t _abgrJoin(uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - return (a << 24 | b << 16 | g << 8 | r); -} - - -static inline uint32_t _argbJoin(uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - return (a << 24 | r << 16 | g << 8 | b); -} - -static inline bool _blending(const SwSurface* surface) -{ - return (surface->blender) ? true : false; -} - - -/* OPTIMIZE_ME: Probably, we can separate masking(8bits) / composition(32bits) - This would help to enhance the performance by avoiding the unnecessary matting from the composition */ -static inline bool _compositing(const SwSurface* surface) -{ - if (!surface->compositor || (int)surface->compositor->method <= (int)CompositeMethod::ClipPath) return false; - return true; -} - - -static inline bool _matting(const SwSurface* surface) -{ - if ((int)surface->compositor->method < (int)CompositeMethod::AddMask) return true; - else return false; -} - -static inline uint8_t _opMaskNone(uint8_t s, TVG_UNUSED uint8_t d, TVG_UNUSED uint8_t a) -{ - return s; -} - -static inline uint8_t _opMaskAdd(uint8_t s, uint8_t d, uint8_t a) -{ - return s + MULTIPLY(d, a); -} - - -static inline uint8_t _opMaskSubtract(uint8_t s, uint8_t d, TVG_UNUSED uint8_t a) -{ - return MULTIPLY(s, 255 - d); -} - - -static inline uint8_t _opMaskIntersect(uint8_t s, uint8_t d, TVG_UNUSED uint8_t a) -{ - return MULTIPLY(s, d); -} - - -static inline uint8_t _opMaskDifference(uint8_t s, uint8_t d, uint8_t a) -{ - return MULTIPLY(s, 255 - d) + MULTIPLY(d, a); -} - - -static inline bool _direct(CompositeMethod method) -{ - //subtract & Intersect allows the direct composition - if (method == CompositeMethod::SubtractMask || method == CompositeMethod::IntersectMask) return true; - return false; -} - - -static inline SwMask _getMaskOp(CompositeMethod method) -{ - switch (method) { - case CompositeMethod::AddMask: return _opMaskAdd; - case CompositeMethod::SubtractMask: return _opMaskSubtract; - case CompositeMethod::DifferenceMask: return _opMaskDifference; - case CompositeMethod::IntersectMask: return _opMaskIntersect; - default: return nullptr; - } -} - - -static bool _compositeMaskImage(SwSurface* surface, const SwImage* image, const SwBBox& region) -{ - auto dbuffer = &surface->buf8[region.min.y * surface->stride + region.min.x]; - auto sbuffer = image->buf8 + (region.min.y + image->oy) * image->stride + (region.min.x + image->ox); - - for (auto y = region.min.y; y < region.max.y; ++y) { - auto dst = dbuffer; - auto src = sbuffer; - for (auto x = region.min.x; x < region.max.x; x++, dst++, src++) { - *dst = *src + MULTIPLY(*dst, ~*src); - } - dbuffer += surface->stride; - sbuffer += image->stride; - } - return true; -} - - -#include "tvgSwRasterTexmap.h" -#include "tvgSwRasterC.h" -#include "tvgSwRasterAvx.h" -#include "tvgSwRasterNeon.h" - - -static inline uint32_t _sampleSize(float scale) -{ - auto sampleSize = static_cast(0.5f / scale); - if (sampleSize == 0) sampleSize = 1; - return sampleSize; -} - - -//Bilinear Interpolation -//OPTIMIZE_ME: Skip the function pointer access -static uint32_t _interpUpScaler(const uint32_t *img, TVG_UNUSED uint32_t stride, uint32_t w, uint32_t h, float sx, float sy, TVG_UNUSED int32_t miny, TVG_UNUSED int32_t maxy, TVG_UNUSED int32_t n) -{ - auto rx = (size_t)(sx); - auto ry = (size_t)(sy); - auto rx2 = rx + 1; - if (rx2 >= w) rx2 = w - 1; - auto ry2 = ry + 1; - if (ry2 >= h) ry2 = h - 1; - - auto dx = (sx > 0.0f) ? static_cast((sx - rx) * 255.0f) : 0; - auto dy = (sy > 0.0f) ? static_cast((sy - ry) * 255.0f) : 0; - - auto c1 = img[rx + ry * w]; - auto c2 = img[rx2 + ry * w]; - auto c3 = img[rx + ry2 * w]; - auto c4 = img[rx2 + ry2 * w]; - - return INTERPOLATE(INTERPOLATE(c4, c3, dx), INTERPOLATE(c2, c1, dx), dy); -} - - -//2n x 2n Mean Kernel -//OPTIMIZE_ME: Skip the function pointer access -static uint32_t _interpDownScaler(const uint32_t *img, uint32_t stride, uint32_t w, uint32_t h, float sx, TVG_UNUSED float sy, int32_t miny, int32_t maxy, int32_t n) -{ - size_t c[4] = {0, 0, 0, 0}; - - int32_t minx = (int32_t)sx - n; - if (minx < 0) minx = 0; - - int32_t maxx = (int32_t)sx + n; - if (maxx >= (int32_t)w) maxx = w; - - int32_t inc = (n / 2) + 1; - n = 0; - - auto src = img + minx + miny * stride; - - for (auto y = miny; y < maxy; y += inc) { - auto p = src; - for (auto x = minx; x < maxx; x += inc, p += inc) { - c[0] += A(*p); - c[1] += C1(*p); - c[2] += C2(*p); - c[3] += C3(*p); - ++n; - } - src += (stride * inc); - } - - c[0] /= n; - c[1] /= n; - c[2] /= n; - c[3] /= n; - - return (c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3]; -} - - -/************************************************************************/ -/* Rect */ -/************************************************************************/ - -static bool _rasterCompositeMaskedRect(SwSurface* surface, const SwBBox& region, SwMask maskOp, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - auto w = static_cast(region.max.x - region.min.x); - auto h = static_cast(region.max.y - region.min.y); - auto cstride = surface->compositor->image.stride; - auto cbuffer = surface->compositor->image.buf8 + (region.min.y * cstride + region.min.x); //compositor buffer - auto ialpha = 255 - a; - - for (uint32_t y = 0; y < h; ++y) { - auto cmp = cbuffer; - for (uint32_t x = 0; x < w; ++x, ++cmp) { - *cmp = maskOp(a, *cmp, ialpha); - } - cbuffer += cstride; - } - return _compositeMaskImage(surface, &surface->compositor->image, surface->compositor->bbox); -} - - -static bool _rasterDirectMaskedRect(SwSurface* surface, const SwBBox& region, SwMask maskOp, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - auto w = static_cast(region.max.x - region.min.x); - auto h = static_cast(region.max.y - region.min.y); - auto cbuffer = surface->compositor->image.buf8 + (region.min.y * surface->compositor->image.stride + region.min.x); //compositor buffer - auto dbuffer = surface->buf8 + (region.min.y * surface->stride + region.min.x); //destination buffer - - for (uint32_t y = 0; y < h; ++y) { - auto cmp = cbuffer; - auto dst = dbuffer; - for (uint32_t x = 0; x < w; ++x, ++cmp, ++dst) { - auto tmp = maskOp(a, *cmp, 0); //not use alpha. - *dst = tmp + MULTIPLY(*dst, ~tmp); - } - cbuffer += surface->compositor->image.stride; - dbuffer += surface->stride; - } - return true; -} - - -static bool _rasterMaskedRect(SwSurface* surface, const SwBBox& region, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - //8bit masking channels composition - if (surface->channelSize != sizeof(uint8_t)) return false; - - TVGLOG("SW_ENGINE", "Masked(%d) Rect [Region: %lu %lu %lu %lu]", (int)surface->compositor->method, region.min.x, region.min.y, region.max.x - region.min.x, region.max.y - region.min.y); - - auto maskOp = _getMaskOp(surface->compositor->method); - if (_direct(surface->compositor->method)) return _rasterDirectMaskedRect(surface, region, maskOp, r, g, b, a); - else return _rasterCompositeMaskedRect(surface, region, maskOp, r, g, b, a); - return false; -} - - -static bool _rasterMattedRect(SwSurface* surface, const SwBBox& region, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - auto w = static_cast(region.max.x - region.min.x); - auto h = static_cast(region.max.y - region.min.y); - auto csize = surface->compositor->image.channelSize; - auto cbuffer = surface->compositor->image.buf8 + ((region.min.y * surface->compositor->image.stride + region.min.x) * csize); //compositor buffer - auto alpha = surface->alpha(surface->compositor->method); - - TVGLOG("SW_ENGINE", "Matted(%d) Rect [Region: %lu %lu %u %u]", (int)surface->compositor->method, region.min.x, region.min.y, w, h); - - //32bits channels - if (surface->channelSize == sizeof(uint32_t)) { - auto color = surface->join(r, g, b, a); - auto buffer = surface->buf32 + (region.min.y * surface->stride) + region.min.x; - for (uint32_t y = 0; y < h; ++y) { - auto dst = &buffer[y * surface->stride]; - auto cmp = &cbuffer[y * surface->compositor->image.stride * csize]; - for (uint32_t x = 0; x < w; ++x, ++dst, cmp += csize) { - *dst = INTERPOLATE(color, *dst, alpha(cmp)); - } - } - //8bits grayscale - } else if (surface->channelSize == sizeof(uint8_t)) { - auto buffer = surface->buf8 + (region.min.y * surface->stride) + region.min.x; - for (uint32_t y = 0; y < h; ++y) { - auto dst = &buffer[y * surface->stride]; - auto cmp = &cbuffer[y * surface->compositor->image.stride * csize]; - for (uint32_t x = 0; x < w; ++x, ++dst, cmp += csize) { - *dst = INTERPOLATE8(a, *dst, alpha(cmp)); - } - } - } - return true; -} - - -static bool _rasterBlendingRect(SwSurface* surface, const SwBBox& region, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (surface->channelSize != sizeof(uint32_t)) return false; - - auto w = static_cast(region.max.x - region.min.x); - auto h = static_cast(region.max.y - region.min.y); - auto color = surface->join(r, g, b, a); - auto buffer = surface->buf32 + (region.min.y * surface->stride) + region.min.x; - auto ialpha = 255 - a; - - for (uint32_t y = 0; y < h; ++y) { - auto dst = &buffer[y * surface->stride]; - for (uint32_t x = 0; x < w; ++x, ++dst) { - *dst = surface->blender(color, *dst, ialpha); - } - } - return true; -} - - -static bool _rasterTranslucentRect(SwSurface* surface, const SwBBox& region, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ -#if defined(THORVG_AVX_VECTOR_SUPPORT) - return avxRasterTranslucentRect(surface, region, r, g, b, a); -#elif defined(THORVG_NEON_VECTOR_SUPPORT) - return neonRasterTranslucentRect(surface, region, r, g, b, a); -#else - return cRasterTranslucentRect(surface, region, r, g, b, a); -#endif -} - - -static bool _rasterSolidRect(SwSurface* surface, const SwBBox& region, uint8_t r, uint8_t g, uint8_t b) -{ - auto w = static_cast(region.max.x - region.min.x); - auto h = static_cast(region.max.y - region.min.y); - - //32bits channels - if (surface->channelSize == sizeof(uint32_t)) { - auto color = surface->join(r, g, b, 255); - auto buffer = surface->buf32 + (region.min.y * surface->stride); - for (uint32_t y = 0; y < h; ++y) { - rasterPixel32(buffer + y * surface->stride, color, region.min.x, w); - } - return true; - } - //8bits grayscale - if (surface->channelSize == sizeof(uint8_t)) { - for (uint32_t y = 0; y < h; ++y) { - rasterGrayscale8(surface->buf8, 255, (y + region.min.y) * surface->stride + region.min.x, w); - } - return true; - } - return false; -} - - -static bool _rasterRect(SwSurface* surface, const SwBBox& region, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (_compositing(surface)) { - if (_matting(surface)) return _rasterMattedRect(surface, region, r, g, b, a); - else return _rasterMaskedRect(surface, region, r, g, b, a); - } else if (_blending(surface)) { - return _rasterBlendingRect(surface, region, r, g, b, a); - } else { - if (a == 255) return _rasterSolidRect(surface, region, r, g, b); - else return _rasterTranslucentRect(surface, region, r, g, b, a); - } - return false; -} - - -/************************************************************************/ -/* Rle */ -/************************************************************************/ - -static bool _rasterCompositeMaskedRle(SwSurface* surface, SwRleData* rle, SwMask maskOp, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - auto span = rle->spans; - auto cbuffer = surface->compositor->image.buf8; - auto cstride = surface->compositor->image.stride; - uint8_t src; - - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto cmp = &cbuffer[span->y * cstride + span->x]; - if (span->coverage == 255) src = a; - else src = MULTIPLY(a, span->coverage); - auto ialpha = 255 - src; - for (auto x = 0; x < span->len; ++x, ++cmp) { - *cmp = maskOp(src, *cmp, ialpha); - } - } - return _compositeMaskImage(surface, &surface->compositor->image, surface->compositor->bbox); -} - - -static bool _rasterDirectMaskedRle(SwSurface* surface, SwRleData* rle, SwMask maskOp, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - auto span = rle->spans; - auto cbuffer = surface->compositor->image.buf8; - auto cstride = surface->compositor->image.stride; - uint8_t src; - - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto cmp = &cbuffer[span->y * cstride + span->x]; - auto dst = &surface->buf8[span->y * surface->stride + span->x]; - if (span->coverage == 255) src = a; - else src = MULTIPLY(a, span->coverage); - for (auto x = 0; x < span->len; ++x, ++cmp, ++dst) { - auto tmp = maskOp(src, *cmp, 0); //not use alpha - *dst = tmp + MULTIPLY(*dst, ~tmp); - } - } - return true; -} - - -static bool _rasterMaskedRle(SwSurface* surface, SwRleData* rle, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - TVGLOG("SW_ENGINE", "Masked(%d) Rle", (int)surface->compositor->method); - - //8bit masking channels composition - if (surface->channelSize != sizeof(uint8_t)) return false; - - auto maskOp = _getMaskOp(surface->compositor->method); - if (_direct(surface->compositor->method)) return _rasterDirectMaskedRle(surface, rle, maskOp, r, g, b, a); - else return _rasterCompositeMaskedRle(surface, rle, maskOp, r, g, b, a); - return false; -} - - -static bool _rasterMattedRle(SwSurface* surface, SwRleData* rle, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - TVGLOG("SW_ENGINE", "Matted(%d) Rle", (int)surface->compositor->method); - - auto span = rle->spans; - auto cbuffer = surface->compositor->image.buf8; - auto csize = surface->compositor->image.channelSize; - auto alpha = surface->alpha(surface->compositor->method); - - //32bit channels - if (surface->channelSize == sizeof(uint32_t)) { - uint32_t src; - auto color = surface->join(r, g, b, a); - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - auto cmp = &cbuffer[(span->y * surface->compositor->image.stride + span->x) * csize]; - if (span->coverage == 255) src = color; - else src = ALPHA_BLEND(color, span->coverage); - for (uint32_t x = 0; x < span->len; ++x, ++dst, cmp += csize) { - auto tmp = ALPHA_BLEND(src, alpha(cmp)); - *dst = tmp + ALPHA_BLEND(*dst, IA(tmp)); - } - } - return true; - } - //8bit grayscale - if (surface->channelSize == sizeof(uint8_t)) { - uint8_t src; - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto dst = &surface->buf8[span->y * surface->stride + span->x]; - auto cmp = &cbuffer[(span->y * surface->compositor->image.stride + span->x) * csize]; - if (span->coverage == 255) src = a; - else src = MULTIPLY(a, span->coverage); - for (uint32_t x = 0; x < span->len; ++x, ++dst, cmp += csize) { - *dst = INTERPOLATE8(src, *dst, alpha(cmp)); - } - } - return true; - } - return false; -} - - -static bool _rasterBlendingRle(SwSurface* surface, const SwRleData* rle, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (surface->channelSize != sizeof(uint32_t)) return false; - - auto span = rle->spans; - auto color = surface->join(r, g, b, a); - auto ialpha = 255 - a; - - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - if (span->coverage == 255) { - for (uint32_t x = 0; x < span->len; ++x, ++dst) { - *dst = surface->blender(color, *dst, ialpha); - } - } else { - for (uint32_t x = 0; x < span->len; ++x, ++dst) { - auto tmp = surface->blender(color, *dst, ialpha); - *dst = INTERPOLATE(tmp, *dst, span->coverage); - } - } - } - return true; -} - - -static bool _rasterTranslucentRle(SwSurface* surface, const SwRleData* rle, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ -#if defined(THORVG_AVX_VECTOR_SUPPORT) - return avxRasterTranslucentRle(surface, rle, r, g, b, a); -#elif defined(THORVG_NEON_VECTOR_SUPPORT) - return neonRasterTranslucentRle(surface, rle, r, g, b, a); -#else - return cRasterTranslucentRle(surface, rle, r, g, b, a); -#endif -} - - -static bool _rasterSolidRle(SwSurface* surface, const SwRleData* rle, uint8_t r, uint8_t g, uint8_t b) -{ - auto span = rle->spans; - - //32bit channels - if (surface->channelSize == sizeof(uint32_t)) { - auto color = surface->join(r, g, b, 255); - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - if (span->coverage == 255) { - rasterPixel32(surface->buf32 + span->y * surface->stride, color, span->x, span->len); - } else { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - auto src = ALPHA_BLEND(color, span->coverage); - auto ialpha = 255 - span->coverage; - for (uint32_t x = 0; x < span->len; ++x, ++dst) { - *dst = src + ALPHA_BLEND(*dst, ialpha); - } - } - } - //8bit grayscale - } else if (surface->channelSize == sizeof(uint8_t)) { - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - if (span->coverage == 255) { - rasterGrayscale8(surface->buf8, span->coverage, span->y * surface->stride + span->x, span->len); - } else { - auto dst = &surface->buf8[span->y * surface->stride + span->x]; - auto ialpha = 255 - span->coverage; - for (uint32_t x = 0; x < span->len; ++x, ++dst) { - *dst = span->coverage + MULTIPLY(*dst, ialpha); - } - } - } - } - return true; -} - - -static bool _rasterRle(SwSurface* surface, SwRleData* rle, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (!rle) return false; - - if (_compositing(surface)) { - if (_matting(surface)) return _rasterMattedRle(surface, rle, r, g, b, a); - else return _rasterMaskedRle(surface, rle, r, g, b, a); - } else if (_blending(surface)) { - return _rasterBlendingRle(surface, rle, r, g, b, a); - } else { - if (a == 255) return _rasterSolidRle(surface, rle, r, g, b); - else return _rasterTranslucentRle(surface, rle, r, g, b, a); - } - return false; -} - - -/************************************************************************/ -/* RLE Scaled Image */ -/************************************************************************/ - -#define SCALED_IMAGE_RANGE_Y(y) \ - auto sy = (y) * itransform->e22 + itransform->e23 - 0.49f; \ - if (sy <= -0.5f || (uint32_t)(sy + 0.5f) >= image->h) continue; \ - if (scaleMethod == _interpDownScaler) { \ - auto my = (int32_t)round(sy); \ - miny = my - (int32_t)sampleSize; \ - if (miny < 0) miny = 0; \ - maxy = my + (int32_t)sampleSize; \ - if (maxy >= (int32_t)image->h) maxy = (int32_t)image->h; \ - } - -#define SCALED_IMAGE_RANGE_X \ - auto sx = (x) * itransform->e11 + itransform->e13 - 0.49f; \ - if (sx <= -0.5f || (uint32_t)(sx + 0.5f) >= image->w) continue; \ - - -#if 0 //Enable it when GRAYSCALE image is supported -static bool _rasterCompositeScaledMaskedRleImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, SwMask maskOp, uint8_t opacity) -{ - auto scaleMethod = image->scale < DOWN_SCALE_TOLERANCE ? _interpDownScaler : _interpUpScaler; - auto sampleSize = _sampleSize(image->scale); - auto span = image->rle->spans; - int32_t miny = 0, maxy = 0; - - for (uint32_t i = 0; i < image->rle->size; ++i, ++span) { - SCALED_IMAGE_RANGE_Y(span->y) - auto cmp = &surface->compositor->image.buf8[span->y * surface->compositor->image.stride + span->x]; - auto a = MULTIPLY(span->coverage, opacity); - for (uint32_t x = static_cast(span->x); x < static_cast(span->x) + span->len; ++x, ++cmp) { - SCALED_IMAGE_RANGE_X - auto src = scaleMethod(image->buf8, image->stride, image->w, image->h, sx, sy, miny, maxy, sampleSize); - if (a < 255) src = MULTIPLY(src, a); - *cmp = maskOp(src, *cmp, ~src); - } - } - return true; -} - - -static bool _rasterDirectScaledMaskedRleImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, SwMask maskOp, uint8_t opacity) -{ - auto scaleMethod = image->scale < DOWN_SCALE_TOLERANCE ? _interpDownScaler : _interpUpScaler; - auto sampleSize = _sampleSize(image->scale); - auto span = image->rle->spans; - int32_t miny = 0, maxy = 0; - - for (uint32_t i = 0; i < image->rle->size; ++i, ++span) { - SCALED_IMAGE_RANGE_Y(span->y) - auto cmp = &surface->compositor->image.buf8[span->y * surface->compositor->image.stride + span->x]; - auto dst = &surface->buf8[span->y * surface->stride + span->x]; - auto a = MULTIPLY(span->coverage, opacity); - for (uint32_t x = static_cast(span->x); x < static_cast(span->x) + span->len; ++x, ++cmp, ++dst) { - SCALED_IMAGE_RANGE_X - auto src = scaleMethod(image->buf8, image->stride, image->w, image->h, sx, sy, miny, maxy, sampleSize); - if (a < 255) src = MULTIPLY(src, a); - src = maskOp(src, *cmp, 0); //not use alpha - *dst = src + MULTIPLY(*dst, ~src); - } - } - return _compositeMaskImage(surface, &surface->compositor->image, surface->compositor->bbox); -} -#endif - -static bool _rasterScaledMaskedRleImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, uint8_t opacity) -{ -#if 0 //Enable it when GRAYSCALE image is supported - TVGLOG("SW_ENGINE", "Scaled Masked(%d) Rle Image", (int)surface->compositor->method); - - //8bit masking channels composition - if (surface->channelSize != sizeof(uint8_t)) return false; - - auto maskOp = _getMaskOp(surface->compositor->method); - if (_direct(surface->compositor->method)) return _rasterDirectScaledMaskedRleImage(surface, image, itransform, region, maskOp, opacity); - else return _rasterCompositeScaledMaskedRleImage(surface, image, itransform, region, maskOp, opacity); -#endif - return false; -} - - -static bool _rasterScaledMattedRleImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, uint8_t opacity) -{ - TVGLOG("SW_ENGINE", "Scaled Matted(%d) Rle Image", (int)surface->compositor->method); - - auto span = image->rle->spans; - auto csize = surface->compositor->image.channelSize; - auto alpha = surface->alpha(surface->compositor->method); - auto scaleMethod = image->scale < DOWN_SCALE_TOLERANCE ? _interpDownScaler : _interpUpScaler; - auto sampleSize = _sampleSize(image->scale); - int32_t miny = 0, maxy = 0; - - for (uint32_t i = 0; i < image->rle->size; ++i, ++span) { - SCALED_IMAGE_RANGE_Y(span->y) - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - auto cmp = &surface->compositor->image.buf8[(span->y * surface->compositor->image.stride + span->x) * csize]; - auto a = MULTIPLY(span->coverage, opacity); - for (uint32_t x = static_cast(span->x); x < static_cast(span->x) + span->len; ++x, ++dst, cmp += csize) { - SCALED_IMAGE_RANGE_X - auto src = scaleMethod(image->buf32, image->stride, image->w, image->h, sx, sy, miny, maxy, sampleSize); - src = ALPHA_BLEND(src, (a == 255) ? alpha(cmp) : MULTIPLY(alpha(cmp), a)); - *dst = src + ALPHA_BLEND(*dst, IA(src)); - } - } - - return true; -} - - -static bool _rasterScaledBlendingRleImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, uint8_t opacity) -{ - auto span = image->rle->spans; - auto scaleMethod = image->scale < DOWN_SCALE_TOLERANCE ? _interpDownScaler : _interpUpScaler; - auto sampleSize = _sampleSize(image->scale); - int32_t miny = 0, maxy = 0; - - for (uint32_t i = 0; i < image->rle->size; ++i, ++span) { - SCALED_IMAGE_RANGE_Y(span->y) - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - auto alpha = MULTIPLY(span->coverage, opacity); - if (alpha == 255) { - for (uint32_t x = static_cast(span->x); x < static_cast(span->x) + span->len; ++x, ++dst) { - SCALED_IMAGE_RANGE_X - auto src = scaleMethod(image->buf32, image->stride, image->w, image->h, sx, sy, miny, maxy, sampleSize); - auto tmp = surface->blender(src, *dst, 255); - *dst = INTERPOLATE(tmp, *dst, A(src)); - } - } else { - for (uint32_t x = static_cast(span->x); x < static_cast(span->x) + span->len; ++x, ++dst) { - SCALED_IMAGE_RANGE_X - auto src = scaleMethod(image->buf32, image->stride, image->w, image->h, sx, sy, miny, maxy, sampleSize); - if (opacity < 255) src = ALPHA_BLEND(src, opacity); - auto tmp = surface->blender(src, *dst, 255); - *dst = INTERPOLATE(tmp, *dst, MULTIPLY(span->coverage, A(src))); - } - } - } - return true; -} - - -static bool _rasterScaledRleImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, uint8_t opacity) -{ - auto span = image->rle->spans; - auto scaleMethod = image->scale < DOWN_SCALE_TOLERANCE ? _interpDownScaler : _interpUpScaler; - auto sampleSize = _sampleSize(image->scale); - int32_t miny = 0, maxy = 0; - - for (uint32_t i = 0; i < image->rle->size; ++i, ++span) { - SCALED_IMAGE_RANGE_Y(span->y) - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - auto alpha = MULTIPLY(span->coverage, opacity); - for (uint32_t x = static_cast(span->x); x < static_cast(span->x) + span->len; ++x, ++dst) { - SCALED_IMAGE_RANGE_X - auto src = scaleMethod(image->buf32, image->stride, image->w, image->h, sx, sy, miny, maxy, sampleSize); - if (alpha < 255) src = ALPHA_BLEND(src, alpha); - *dst = src + ALPHA_BLEND(*dst, IA(src)); - } - } - return true; -} - - -static bool _scaledRleImage(SwSurface* surface, const SwImage* image, const Matrix* transform, const SwBBox& region, uint8_t opacity) -{ - if (surface->channelSize == sizeof(uint8_t)) { - TVGERR("SW_ENGINE", "Not supported scaled rle image!"); - return false; - } - - Matrix itransform; - - if (transform) { - if (!mathInverse(transform, &itransform)) return false; - } else mathIdentity(&itransform); - - if (_compositing(surface)) { - if (_matting(surface)) return _rasterScaledMattedRleImage(surface, image, &itransform, region, opacity); - else return _rasterScaledMaskedRleImage(surface, image, &itransform, region, opacity); - } else if (_blending(surface)) { - return _rasterScaledBlendingRleImage(surface, image, &itransform, region, opacity); - } else { - return _rasterScaledRleImage(surface, image, &itransform, region, opacity); - } - return false; -} - - -/************************************************************************/ -/* RLE Direct Image */ -/************************************************************************/ - -#if 0 //Enable it when GRAYSCALE image is supported -static bool _rasterCompositeDirectMaskedRleImage(SwSurface* surface, const SwImage* image, SwMask maskOp, uint8_t opacity) -{ - auto span = image->rle->spans; - auto cbuffer = surface->compositor->image.buf8; - auto cstride = surface->compositor->image.stride; - - for (uint32_t i = 0; i < image->rle->size; ++i, ++span) { - auto src = image->buf8 + (span->y + image->oy) * image->stride + (span->x + image->ox); - auto cmp = &cbuffer[span->y * cstride + span->x]; - auto alpha = MULTIPLY(span->coverage, opacity); - if (alpha == 255) { - for (uint32_t x = 0; x < span->len; ++x, ++src, ++cmp) { - *cmp = maskOp(*src, *cmp, ~*src); - } - } else { - for (uint32_t x = 0; x < span->len; ++x, ++src, ++cmp) { - auto tmp = MULTIPLY(*src, alpha); - *cmp = maskOp(*src, *cmp, ~tmp); - } - } - } - return _compositeMaskImage(surface, &surface->compositor->image, surface->compositor->bbox); -} - - -static bool _rasterDirectDirectMaskedRleImage(SwSurface* surface, const SwImage* image, SwMask maskOp, uint8_t opacity) -{ - auto span = image->rle->spans; - auto cbuffer = surface->compositor->image.buf8; - auto cstride = surface->compositor->image.stride; - - for (uint32_t i = 0; i < image->rle->size; ++i, ++span) { - auto src = image->buf8 + (span->y + image->oy) * image->stride + (span->x + image->ox); - auto cmp = &cbuffer[span->y * cstride + span->x]; - auto dst = &surface->buf8[span->y * surface->stride + span->x]; - auto alpha = MULTIPLY(span->coverage, opacity); - if (alpha == 255) { - for (uint32_t x = 0; x < span->len; ++x, ++src, ++cmp, ++dst) { - auto tmp = maskOp(*src, *cmp, 0); //not use alpha - *dst = INTERPOLATE8(tmp, *dst, (255 - tmp)); - } - } else { - for (uint32_t x = 0; x < span->len; ++x, ++src, ++cmp, ++dst) { - auto tmp = maskOp(MULTIPLY(*src, alpha), *cmp, 0); //not use alpha - *dst = INTERPOLATE8(tmp, *dst, (255 - tmp)); - } - } - } - return true; -} -#endif - -static bool _rasterDirectMaskedRleImage(SwSurface* surface, const SwImage* image, uint8_t opacity) -{ -#if 0 //Enable it when GRAYSCALE image is supported - TVGLOG("SW_ENGINE", "Direct Masked(%d) Rle Image", (int)surface->compositor->method); - - //8bit masking channels composition - if (surface->channelSize != sizeof(uint8_t)) return false; - - auto maskOp = _getMaskOp(surface->compositor->method); - if (_direct(surface->compositor->method)) _rasterDirectDirectMaskedRleImage(surface, image, maskOp, opacity); - else return _rasterCompositeDirectMaskedRleImage(surface, image, maskOp, opacity); -#endif - return false; -} - - -static bool _rasterDirectMattedRleImage(SwSurface* surface, const SwImage* image, uint8_t opacity) -{ - TVGLOG("SW_ENGINE", "Direct Matted(%d) Rle Image", (int)surface->compositor->method); - - auto span = image->rle->spans; - auto csize = surface->compositor->image.channelSize; - auto cbuffer = surface->compositor->image.buf8; - auto alpha = surface->alpha(surface->compositor->method); - - for (uint32_t i = 0; i < image->rle->size; ++i, ++span) { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - auto cmp = &cbuffer[(span->y * surface->compositor->image.stride + span->x) * csize]; - auto img = image->buf32 + (span->y + image->oy) * image->stride + (span->x + image->ox); - auto a = MULTIPLY(span->coverage, opacity); - if (a == 255) { - for (uint32_t x = 0; x < span->len; ++x, ++dst, ++img, cmp += csize) { - auto tmp = ALPHA_BLEND(*img, alpha(cmp)); - *dst = tmp + ALPHA_BLEND(*dst, IA(tmp)); - } - } else { - for (uint32_t x = 0; x < span->len; ++x, ++dst, ++img, cmp += csize) { - auto tmp = ALPHA_BLEND(*img, MULTIPLY(a, alpha(cmp))); - *dst = tmp + ALPHA_BLEND(*dst, IA(tmp)); - } - } - } - return true; -} - - -static bool _rasterDirectBlendingRleImage(SwSurface* surface, const SwImage* image, uint8_t opacity) -{ - auto span = image->rle->spans; - - for (uint32_t i = 0; i < image->rle->size; ++i, ++span) { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - auto img = image->buf32 + (span->y + image->oy) * image->stride + (span->x + image->ox); - auto alpha = MULTIPLY(span->coverage, opacity); - if (alpha == 255) { - for (uint32_t x = 0; x < span->len; ++x, ++dst, ++img) { - *dst = surface->blender(*img, *dst, IA(*img)); - } - } else if (opacity == 255) { - for (uint32_t x = 0; x < span->len; ++x, ++dst, ++img) { - auto tmp = surface->blender(*img, *dst, 255); - *dst = INTERPOLATE(tmp, *dst, MULTIPLY(span->coverage, A(*img))); - } - } else { - for (uint32_t x = 0; x < span->len; ++x, ++dst, ++img) { - auto src = ALPHA_BLEND(*img, opacity); - auto tmp = surface->blender(src, *dst, IA(src)); - *dst = INTERPOLATE(tmp, *dst, MULTIPLY(span->coverage, A(src))); - } - } - } - return true; -} - - -static bool _rasterDirectRleImage(SwSurface* surface, const SwImage* image, uint8_t opacity) -{ - auto span = image->rle->spans; - - for (uint32_t i = 0; i < image->rle->size; ++i, ++span) { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - auto img = image->buf32 + (span->y + image->oy) * image->stride + (span->x + image->ox); - auto alpha = MULTIPLY(span->coverage, opacity); - if (alpha == 255) { - for (uint32_t x = 0; x < span->len; ++x, ++dst, ++img) { - *dst = *img + ALPHA_BLEND(*dst, IA(*img)); - } - } else { - for (uint32_t x = 0; x < span->len; ++x, ++dst, ++img) { - auto src = ALPHA_BLEND(*img, alpha); - *dst = src + ALPHA_BLEND(*dst, IA(src)); - } - } - } - return true; -} - - -static bool _directRleImage(SwSurface* surface, const SwImage* image, uint8_t opacity) -{ - if (surface->channelSize == sizeof(uint8_t)) { - TVGERR("SW_ENGINE", "Not supported grayscale rle image!"); - return false; - } - - if (_compositing(surface)) { - if (_matting(surface)) return _rasterDirectMattedRleImage(surface, image, opacity); - else return _rasterDirectMaskedRleImage(surface, image, opacity); - } else if (_blending(surface)) { - return _rasterDirectBlendingRleImage(surface, image, opacity); - } else { - return _rasterDirectRleImage(surface, image, opacity); - } - return false; -} - - -/************************************************************************/ -/*Scaled Image */ -/************************************************************************/ - -#if 0 //Enable it when GRAYSCALE image is supported -static bool _rasterCompositeScaledMaskedImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, SwMask maskOp, uint8_t opacity) -{ - auto scaleMethod = image->scale < DOWN_SCALE_TOLERANCE ? _interpDownScaler : _interpUpScaler; - auto sampleSize = _sampleSize(image->scale); - auto cstride = surface->compositor->image.stride; - auto cbuffer = surface->compositor->image.buf8 + (region.min.y * cstride + region.min.x); - int32_t miny = 0, maxy = 0; - - for (auto y = region.min.y; y < region.max.y; ++y) { - SCALED_IMAGE_RANGE_Y(y) - auto cmp = cbuffer; - for (auto x = region.min.x; x < region.max.x; ++x, ++cmp) { - SCALED_IMAGE_RANGE_X - auto src = scaleMethod(image->buf8, image->stride, image->w, image->h, sx, sy, miny, maxy, sampleSize); - if (opacity < 255) src = MULTIPLY(src, opacity); - *cmp = maskOp(src, *cmp, ~src); - } - cbuffer += cstride; - } - return _compositeMaskImage(surface, &surface->compositor->image, surface->compositor->bbox); -} - - -static bool _rasterDirectScaledMaskedImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, SwMask maskOp, uint8_t opacity) -{ - auto scaleMethod = image->scale < DOWN_SCALE_TOLERANCE ? _interpDownScaler : _interpUpScaler; - auto sampleSize = _sampleSize(image->scale); - auto cstride = surface->compositor->image.stride; - auto cbuffer = surface->compositor->image.buf8 + (region.min.y * cstride + region.min.x); - auto dbuffer = surface->buf8 + (region.min.y * surface->stride + region.min.x); - int32_t miny = 0, maxy = 0; - - for (auto y = region.min.y; y < region.max.y; ++y) { - SCALED_IMAGE_RANGE_Y(y) - auto cmp = cbuffer; - auto dst = dbuffer; - for (auto x = region.min.x; x < region.max.x; ++x, ++cmp, ++dst) { - SCALED_IMAGE_RANGE_X - auto src = scaleMethod(image->buf8, image->stride, image->w, image->h, sx, sy, miny, maxy, sampleSize); - if (opacity < 255) src = MULTIPLY(src, opacity); - src = maskOp(src, *cmp, 0); //not use alpha - *dst = src + MULTIPLY(*dst, ~src); - } - cbuffer += cstride; - dbuffer += surface->stride; - } - return true; -} -#endif - -static bool _rasterScaledMaskedImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, uint8_t opacity) -{ -#if 0 //Enable it when GRAYSCALE image is supported - TVGLOG("SW_ENGINE", "Scaled Masked(%d) Image [Region: %lu %lu %lu %lu]", (int)surface->compositor->method, region.min.x, region.min.y, region.max.x - region.min.x, region.max.y - region.min.y); - - auto maskOp = _getMaskOp(surface->compositor->method); - if (_direct(surface->compositor->method)) return _rasterDirectScaledMaskedImage(surface, image, itransform, region, maskOp, opacity); - else return _rasterCompositeScaledMaskedImage(surface, image, itransform, region, maskOp, opacity); -#endif - return false; -} - - -static bool _rasterScaledMattedImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, uint8_t opacity) -{ - auto dbuffer = surface->buf32 + (region.min.y * surface->stride + region.min.x); - auto csize = surface->compositor->image.channelSize; - auto cbuffer = surface->compositor->image.buf8 + (region.min.y * surface->compositor->image.stride + region.min.x) * csize; - auto alpha = surface->alpha(surface->compositor->method); - - TVGLOG("SW_ENGINE", "Scaled Matted(%d) Image [Region: %lu %lu %lu %lu]", (int)surface->compositor->method, region.min.x, region.min.y, region.max.x - region.min.x, region.max.y - region.min.y); - - auto scaleMethod = image->scale < DOWN_SCALE_TOLERANCE ? _interpDownScaler : _interpUpScaler; - auto sampleSize = _sampleSize(image->scale); - int32_t miny = 0, maxy = 0; - - for (auto y = region.min.y; y < region.max.y; ++y) { - SCALED_IMAGE_RANGE_Y(y) - auto dst = dbuffer; - auto cmp = cbuffer; - for (auto x = region.min.x; x < region.max.x; ++x, ++dst, cmp += csize) { - SCALED_IMAGE_RANGE_X - auto src = scaleMethod(image->buf32, image->stride, image->w, image->h, sx, sy, miny, maxy, sampleSize); - auto tmp = ALPHA_BLEND(src, opacity == 255 ? alpha(cmp) : MULTIPLY(opacity, alpha(cmp))); - *dst = tmp + ALPHA_BLEND(*dst, IA(tmp)); - } - dbuffer += surface->stride; - cbuffer += surface->compositor->image.stride * csize; - } - return true; -} - - -static bool _rasterScaledBlendingImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, uint8_t opacity) -{ - auto dbuffer = surface->buf32 + (region.min.y * surface->stride + region.min.x); - auto scaleMethod = image->scale < DOWN_SCALE_TOLERANCE ? _interpDownScaler : _interpUpScaler; - auto sampleSize = _sampleSize(image->scale); - int32_t miny = 0, maxy = 0; - - for (auto y = region.min.y; y < region.max.y; ++y, dbuffer += surface->stride) { - SCALED_IMAGE_RANGE_Y(y) - auto dst = dbuffer; - for (auto x = region.min.x; x < region.max.x; ++x, ++dst) { - SCALED_IMAGE_RANGE_X - auto src = scaleMethod(image->buf32, image->stride, image->w, image->h, sx, sy, miny, maxy, sampleSize); - if (opacity < 255) ALPHA_BLEND(src, opacity); - auto tmp = surface->blender(src, *dst, 255); - *dst = INTERPOLATE(tmp, *dst, A(src)); - } - } - return true; -} - - -static bool _rasterScaledImage(SwSurface* surface, const SwImage* image, const Matrix* itransform, const SwBBox& region, uint8_t opacity) -{ - auto dbuffer = surface->buf32 + (region.min.y * surface->stride + region.min.x); - auto scaleMethod = image->scale < DOWN_SCALE_TOLERANCE ? _interpDownScaler : _interpUpScaler; - auto sampleSize = _sampleSize(image->scale); - int32_t miny = 0, maxy = 0; - - for (auto y = region.min.y; y < region.max.y; ++y, dbuffer += surface->stride) { - SCALED_IMAGE_RANGE_Y(y) - auto dst = dbuffer; - for (auto x = region.min.x; x < region.max.x; ++x, ++dst) { - SCALED_IMAGE_RANGE_X - auto src = scaleMethod(image->buf32, image->stride, image->w, image->h, sx, sy, miny, maxy, sampleSize); - if (opacity < 255) src = ALPHA_BLEND(src, opacity); - *dst = src + ALPHA_BLEND(*dst, IA(src)); - } - } - return true; -} - - -static bool _scaledImage(SwSurface* surface, const SwImage* image, const Matrix* transform, const SwBBox& region, uint8_t opacity) -{ - if (surface->channelSize == sizeof(uint8_t)) { - TVGERR("SW_ENGINE", "Not supported grayscale Textmap polygon mesh!"); - return false; - } - - Matrix itransform; - - if (transform) { - if (!mathInverse(transform, &itransform)) return false; - } else mathIdentity(&itransform); - - if (_compositing(surface)) { - if (_matting(surface)) return _rasterScaledMattedImage(surface, image, &itransform, region, opacity); - else return _rasterScaledMaskedImage(surface, image, &itransform, region, opacity); - } else if (_blending(surface)) { - return _rasterScaledBlendingImage(surface, image, &itransform, region, opacity); - } else { - return _rasterScaledImage(surface, image, &itransform, region, opacity); - } - return false; -} - - -/************************************************************************/ -/* Direct Image */ -/************************************************************************/ - -#if 0 //Enable it when GRAYSCALE image is supported -static bool _rasterCompositeDirectMaskedImage(SwSurface* surface, const SwImage* image, const SwBBox& region, SwMask maskOp, uint8_t opacity) -{ - auto h = static_cast(region.max.y - region.min.y); - auto w = static_cast(region.max.x - region.min.x); - auto cstride = surface->compositor->image.stride; - - auto cbuffer = surface->compositor->image.buf8 + (region.min.y * cstride + region.min.x); //compositor buffer - auto sbuffer = image->buf8 + (region.min.y + image->oy) * image->stride + (region.min.x + image->ox); - - for (uint32_t y = 0; y < h; ++y) { - auto cmp = cbuffer; - auto src = sbuffer; - if (opacity == 255) { - for (uint32_t x = 0; x < w; ++x, ++src, ++cmp) { - *cmp = maskOp(*src, *cmp, ~*src); - } - } else { - for (uint32_t x = 0; x < w; ++x, ++src, ++cmp) { - auto tmp = MULTIPLY(*src, opacity); - *cmp = maskOp(tmp, *cmp, ~tmp); - } - } - cbuffer += cstride; - sbuffer += image->stride; - } - return _compositeMaskImage(surface, &surface->compositor->image, surface->compositor->bbox); -} - - -static bool _rasterDirectDirectMaskedImage(SwSurface* surface, const SwImage* image, const SwBBox& region, SwMask maskOp, uint8_t opacity) -{ - auto h = static_cast(region.max.y - region.min.y); - auto w = static_cast(region.max.x - region.min.x); - auto cstride = surface->compositor->image.stride; - - auto cbuffer = surface->compositor->image.buf32 + (region.min.y * cstride + region.min.x); //compositor buffer - auto dbuffer = surface->buf8 + (region.min.y * surface->stride + region.min.x); //destination buffer - auto sbuffer = image->buf8 + (region.min.y + image->oy) * image->stride + (region.min.x + image->ox); - - for (uint32_t y = 0; y < h; ++y) { - auto cmp = cbuffer; - auto dst = dbuffer; - auto src = sbuffer; - if (opacity == 255) { - for (uint32_t x = 0; x < w; ++x, ++src, ++cmp, ++dst) { - auto tmp = maskOp(*src, *cmp, 0); //not use alpha - *dst = tmp + MULTIPLY(*dst, ~tmp); - } - } else { - for (uint32_t x = 0; x < w; ++x, ++src, ++cmp, ++dst) { - auto tmp = maskOp(MULTIPLY(*src, opacity), *cmp, 0); //not use alpha - *dst = tmp + MULTIPLY(*dst, ~tmp); - } - } - cbuffer += cstride; - dbuffer += surface->stride; - sbuffer += image->stride; - } - return true; -} -#endif - -static bool _rasterDirectMaskedImage(SwSurface* surface, const SwImage* image, const SwBBox& region, uint8_t opacity) -{ - TVGERR("SW_ENGINE", "Not Supported: Direct Masked(%d) Image [Region: %lu %lu %lu %lu]", (int)surface->compositor->method, region.min.x, region.min.y, region.max.x - region.min.x, region.max.y - region.min.y); - -#if 0 //Enable it when GRAYSCALE image is supported - auto maskOp = _getMaskOp(surface->compositor->method); - if (_direct(surface->compositor->method)) return _rasterDirectDirectMaskedImage(surface, image, region, maskOp, opacity); - else return _rasterCompositeDirectMaskedImage(surface, image, region, maskOp, opacity); -#endif - return false; -} - - -static bool _rasterDirectMattedImage(SwSurface* surface, const SwImage* image, const SwBBox& region, uint8_t opacity) -{ - auto h = static_cast(region.max.y - region.min.y); - auto w = static_cast(region.max.x - region.min.x); - auto csize = surface->compositor->image.channelSize; - auto alpha = surface->alpha(surface->compositor->method); - auto sbuffer = image->buf32 + (region.min.y + image->oy) * image->stride + (region.min.x + image->ox); - auto cbuffer = surface->compositor->image.buf8 + (region.min.y * surface->compositor->image.stride + region.min.x) * csize; //compositor buffer - - TVGLOG("SW_ENGINE", "Direct Matted(%d) Image [Region: %lu %lu %u %u]", (int)surface->compositor->method, region.min.x, region.min.y, w, h); - - //32 bits - if (surface->channelSize == sizeof(uint32_t)) { - auto buffer = surface->buf32 + (region.min.y * surface->stride) + region.min.x; - for (uint32_t y = 0; y < h; ++y) { - auto dst = buffer; - auto cmp = cbuffer; - auto src = sbuffer; - if (opacity == 255) { - for (uint32_t x = 0; x < w; ++x, ++dst, ++src, cmp += csize) { - auto tmp = ALPHA_BLEND(*src, alpha(cmp)); - *dst = tmp + ALPHA_BLEND(*dst, IA(tmp)); - } - } else { - for (uint32_t x = 0; x < w; ++x, ++dst, ++src, cmp += csize) { - auto tmp = ALPHA_BLEND(*src, MULTIPLY(opacity, alpha(cmp))); - *dst = tmp + ALPHA_BLEND(*dst, IA(tmp)); - } - } - buffer += surface->stride; - cbuffer += surface->compositor->image.stride * csize; - sbuffer += image->stride; - } - //8 bits - } else if (surface->channelSize == sizeof(uint8_t)) { - auto buffer = surface->buf8 + (region.min.y * surface->stride) + region.min.x; - for (uint32_t y = 0; y < h; ++y) { - auto dst = buffer; - auto cmp = cbuffer; - auto src = sbuffer; - if (opacity == 255) { - for (uint32_t x = 0; x < w; ++x, ++dst, ++src, cmp += csize) { - *dst = MULTIPLY(A(*src), alpha(cmp)); - } - } else { - for (uint32_t x = 0; x < w; ++x, ++dst, ++src, cmp += csize) { - *dst = MULTIPLY(A(*src), MULTIPLY(opacity, alpha(cmp))); - } - } - buffer += surface->stride; - cbuffer += surface->compositor->image.stride * csize; - sbuffer += image->stride; - } - } - return true; -} - - -static bool _rasterDirectBlendingImage(SwSurface* surface, const SwImage* image, const SwBBox& region, uint8_t opacity) -{ - if (surface->channelSize == sizeof(uint8_t)) { - TVGERR("SW_ENGINE", "Not supported grayscale image!"); - return false; - } - - auto dbuffer = &surface->buf32[region.min.y * surface->stride + region.min.x]; - auto sbuffer = image->buf32 + (region.min.y + image->oy) * image->stride + (region.min.x + image->ox); - - for (auto y = region.min.y; y < region.max.y; ++y) { - auto dst = dbuffer; - auto src = sbuffer; - if (opacity == 255) { - for (auto x = region.min.x; x < region.max.x; x++, dst++, src++) { - auto tmp = surface->blender(*src, *dst, 255); - *dst = INTERPOLATE(tmp, *dst, A(*src)); - } - } else { - for (auto x = region.min.x; x < region.max.x; ++x, ++dst, ++src) { - auto tmp = ALPHA_BLEND(*src, opacity); - auto tmp2 = surface->blender(tmp, *dst, 255); - *dst = INTERPOLATE(tmp2, *dst, A(tmp)); - } - } - dbuffer += surface->stride; - sbuffer += image->stride; - } - return true; -} - - -static bool _rasterDirectImage(SwSurface* surface, const SwImage* image, const SwBBox& region, uint8_t opacity) -{ - if (surface->channelSize == sizeof(uint8_t)) { - TVGERR("SW_ENGINE", "Not supported grayscale image!"); - return false; - } - - auto dbuffer = &surface->buf32[region.min.y * surface->stride + region.min.x]; - auto sbuffer = image->buf32 + (region.min.y + image->oy) * image->stride + (region.min.x + image->ox); - - for (auto y = region.min.y; y < region.max.y; ++y) { - auto dst = dbuffer; - auto src = sbuffer; - if (opacity == 255) { - for (auto x = region.min.x; x < region.max.x; x++, dst++, src++) { - *dst = *src + ALPHA_BLEND(*dst, IA(*src)); - } - } else { - for (auto x = region.min.x; x < region.max.x; ++x, ++dst, ++src) { - auto tmp = ALPHA_BLEND(*src, opacity); - *dst = tmp + ALPHA_BLEND(*dst, IA(tmp)); - } - } - dbuffer += surface->stride; - sbuffer += image->stride; - } - return true; -} - - -//Blenders for the following scenarios: [Composition / Non-Composition] * [Opaque / Translucent] -static bool _directImage(SwSurface* surface, const SwImage* image, const SwBBox& region, uint8_t opacity) -{ - if (_compositing(surface)) { - if (_matting(surface)) return _rasterDirectMattedImage(surface, image, region, opacity); - else return _rasterDirectMaskedImage(surface, image, region, opacity); - } else if (_blending(surface)) { - return _rasterDirectBlendingImage(surface, image, region, opacity); - } else { - return _rasterDirectImage(surface, image, region, opacity); - } - return false; -} - - -//Blenders for the following scenarios: [RLE / Whole] * [Direct / Scaled / Transformed] -static bool _rasterImage(SwSurface* surface, SwImage* image, const Matrix* transform, const SwBBox& region, uint8_t opacity) -{ - //RLE Image - if (image->rle) { - if (image->direct) return _directRleImage(surface, image, opacity); - else if (image->scaled) return _scaledRleImage(surface, image, transform, region, opacity); - else return _rasterTexmapPolygon(surface, image, transform, nullptr, opacity); - //Whole Image - } else { - if (image->direct) return _directImage(surface, image, region, opacity); - else if (image->scaled) return _scaledImage(surface, image, transform, region, opacity); - else return _rasterTexmapPolygon(surface, image, transform, ®ion, opacity); - } -} - - -/************************************************************************/ -/* Rect Gradient */ -/************************************************************************/ - -template -static bool _rasterCompositeGradientMaskedRect(SwSurface* surface, const SwBBox& region, const SwFill* fill, SwMask maskOp) -{ - auto h = static_cast(region.max.y - region.min.y); - auto w = static_cast(region.max.x - region.min.x); - auto cstride = surface->compositor->image.stride; - auto cbuffer = surface->compositor->image.buf8 + (region.min.y * cstride + region.min.x); - - for (uint32_t y = 0; y < h; ++y) { - fillMethod()(fill, cbuffer, region.min.y + y, region.min.x, w, maskOp, 255); - cbuffer += surface->stride; - } - return _compositeMaskImage(surface, &surface->compositor->image, surface->compositor->bbox); -} - - -template -static bool _rasterDirectGradientMaskedRect(SwSurface* surface, const SwBBox& region, const SwFill* fill, SwMask maskOp) -{ - auto h = static_cast(region.max.y - region.min.y); - auto w = static_cast(region.max.x - region.min.x); - auto cstride = surface->compositor->image.stride; - auto cbuffer = surface->compositor->image.buf8 + (region.min.y * cstride + region.min.x); - auto dbuffer = surface->buf8 + (region.min.y * surface->stride + region.min.x); - - for (uint32_t y = 0; y < h; ++y) { - fillMethod()(fill, dbuffer, region.min.y + y, region.min.x, w, cbuffer, maskOp, 255); - cbuffer += cstride; - dbuffer += surface->stride; - } - return true; -} - - -template -static bool _rasterGradientMaskedRect(SwSurface* surface, const SwBBox& region, const SwFill* fill) -{ - auto method = surface->compositor->method; - - TVGLOG("SW_ENGINE", "Masked(%d) Gradient [Region: %lu %lu %lu %lu]", (int)method, region.min.x, region.min.y, region.max.x - region.min.x, region.max.y - region.min.y); - - auto maskOp = _getMaskOp(method); - - if (_direct(method)) return _rasterDirectGradientMaskedRect(surface, region, fill, maskOp); - else return _rasterCompositeGradientMaskedRect(surface, region, fill, maskOp); - - return false; -} - - -template -static bool _rasterGradientMattedRect(SwSurface* surface, const SwBBox& region, const SwFill* fill) -{ - auto buffer = surface->buf32 + (region.min.y * surface->stride) + region.min.x; - auto h = static_cast(region.max.y - region.min.y); - auto w = static_cast(region.max.x - region.min.x); - auto csize = surface->compositor->image.channelSize; - auto cbuffer = surface->compositor->image.buf8 + (region.min.y * surface->compositor->image.stride + region.min.x) * csize; - auto alpha = surface->alpha(surface->compositor->method); - - TVGLOG("SW_ENGINE", "Matted(%d) Gradient [Region: %lu %lu %u %u]", (int)surface->compositor->method, region.min.x, region.min.y, w, h); - - for (uint32_t y = 0; y < h; ++y) { - fillMethod()(fill, buffer, region.min.y + y, region.min.x, w, cbuffer, alpha, csize, 255); - buffer += surface->stride; - cbuffer += surface->stride * csize; - } - return true; -} - - -template -static bool _rasterBlendingGradientRect(SwSurface* surface, const SwBBox& region, const SwFill* fill) -{ - auto buffer = surface->buf32 + (region.min.y * surface->stride) + region.min.x; - auto w = static_cast(region.max.x - region.min.x); - auto h = static_cast(region.max.y - region.min.y); - - if (fill->translucent) { - for (uint32_t y = 0; y < h; ++y) { - fillMethod()(fill, buffer + y * surface->stride, region.min.y + y, region.min.x, w, opBlendPreNormal, surface->blender, 255); - } - } else { - for (uint32_t y = 0; y < h; ++y) { - fillMethod()(fill, buffer + y * surface->stride, region.min.y + y, region.min.x, w, opBlendSrcOver, surface->blender, 255); - } - } - return true; -} - -template -static bool _rasterTranslucentGradientRect(SwSurface* surface, const SwBBox& region, const SwFill* fill) -{ - auto buffer = surface->buf32 + (region.min.y * surface->stride) + region.min.x; - auto h = static_cast(region.max.y - region.min.y); - auto w = static_cast(region.max.x - region.min.x); - - for (uint32_t y = 0; y < h; ++y) { - fillMethod()(fill, buffer, region.min.y + y, region.min.x, w, opBlendPreNormal, 255); - buffer += surface->stride; - } - return true; -} - - -template -static bool _rasterSolidGradientRect(SwSurface* surface, const SwBBox& region, const SwFill* fill) -{ - auto buffer = surface->buf32 + (region.min.y * surface->stride) + region.min.x; - auto w = static_cast(region.max.x - region.min.x); - auto h = static_cast(region.max.y - region.min.y); - - for (uint32_t y = 0; y < h; ++y) { - fillMethod()(fill, buffer + y * surface->stride, region.min.y + y, region.min.x, w, opBlendSrcOver, 255); - } - return true; -} - - -static bool _rasterLinearGradientRect(SwSurface* surface, const SwBBox& region, const SwFill* fill) -{ - if (fill->linear.len < FLOAT_EPSILON) return false; - - if (_compositing(surface)) { - if (_matting(surface)) return _rasterGradientMattedRect(surface, region, fill); - else return _rasterGradientMaskedRect(surface, region, fill); - } else if (_blending(surface)) { - return _rasterBlendingGradientRect(surface, region, fill); - } else { - if (fill->translucent) return _rasterTranslucentGradientRect(surface, region, fill); - else _rasterSolidGradientRect(surface, region, fill); - } - return false; -} - - -static bool _rasterRadialGradientRect(SwSurface* surface, const SwBBox& region, const SwFill* fill) -{ - if (_compositing(surface)) { - if (_matting(surface)) return _rasterGradientMattedRect(surface, region, fill); - else return _rasterGradientMaskedRect(surface, region, fill); - } else if (_blending(surface)) { - return _rasterBlendingGradientRect(surface, region, fill); - } else { - if (fill->translucent) return _rasterTranslucentGradientRect(surface, region, fill); - else _rasterSolidGradientRect(surface, region, fill); - } - return false; -} - - -/************************************************************************/ -/* Rle Gradient */ -/************************************************************************/ - -template -static bool _rasterCompositeGradientMaskedRle(SwSurface* surface, const SwRleData* rle, const SwFill* fill, SwMask maskOp) -{ - auto span = rle->spans; - auto cstride = surface->compositor->image.stride; - auto cbuffer = surface->compositor->image.buf8; - - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto cmp = &cbuffer[span->y * cstride + span->x]; - fillMethod()(fill, cmp, span->y, span->x, span->len, maskOp, span->coverage); - } - return _compositeMaskImage(surface, &surface->compositor->image, surface->compositor->bbox); -} - - -template -static bool _rasterDirectGradientMaskedRle(SwSurface* surface, const SwRleData* rle, const SwFill* fill, SwMask maskOp) -{ - auto span = rle->spans; - auto cstride = surface->compositor->image.stride; - auto cbuffer = surface->compositor->image.buf8; - auto dbuffer = surface->buf8; - - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto cmp = &cbuffer[span->y * cstride + span->x]; - auto dst = &dbuffer[span->y * surface->stride + span->x]; - fillMethod()(fill, dst, span->y, span->x, span->len, cmp, maskOp, span->coverage); - } - return true; -} - - -template -static bool _rasterGradientMaskedRle(SwSurface* surface, const SwRleData* rle, const SwFill* fill) -{ - auto method = surface->compositor->method; - - TVGLOG("SW_ENGINE", "Masked(%d) Rle Linear Gradient", (int)method); - - auto maskOp = _getMaskOp(method); - - if (_direct(method)) return _rasterDirectGradientMaskedRle(surface, rle, fill, maskOp); - else return _rasterCompositeGradientMaskedRle(surface, rle, fill, maskOp); - return false; -} - - -template -static bool _rasterGradientMattedRle(SwSurface* surface, const SwRleData* rle, const SwFill* fill) -{ - TVGLOG("SW_ENGINE", "Matted(%d) Rle Linear Gradient", (int)surface->compositor->method); - - auto span = rle->spans; - auto csize = surface->compositor->image.channelSize; - auto cbuffer = surface->compositor->image.buf8; - auto alpha = surface->alpha(surface->compositor->method); - - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - auto cmp = &cbuffer[(span->y * surface->compositor->image.stride + span->x) * csize]; - fillMethod()(fill, dst, span->y, span->x, span->len, cmp, alpha, csize, span->coverage); - } - return true; -} - - -template -static bool _rasterBlendingGradientRle(SwSurface* surface, const SwRleData* rle, const SwFill* fill) -{ - auto span = rle->spans; - - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - fillMethod()(fill, dst, span->y, span->x, span->len, opBlendPreNormal, surface->blender, span->coverage); - } - return true; -} - - -template -static bool _rasterTranslucentGradientRle(SwSurface* surface, const SwRleData* rle, const SwFill* fill) -{ - auto span = rle->spans; - - //32 bits - if (surface->channelSize == sizeof(uint32_t)) { - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - if (span->coverage == 255) fillMethod()(fill, dst, span->y, span->x, span->len, opBlendPreNormal, 255); - else fillMethod()(fill, dst, span->y, span->x, span->len, opBlendNormal, span->coverage); - } - //8 bits - } else if (surface->channelSize == sizeof(uint8_t)) { - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto dst = &surface->buf8[span->y * surface->stride + span->x]; - fillMethod()(fill, dst, span->y, span->x, span->len, _opMaskAdd, 255); - } - } - return true; -} - - -template -static bool _rasterSolidGradientRle(SwSurface* surface, const SwRleData* rle, const SwFill* fill) -{ - auto span = rle->spans; - - //32 bits - if (surface->channelSize == sizeof(uint32_t)) { - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - if (span->coverage == 255) fillMethod()(fill, dst, span->y, span->x, span->len, opBlendSrcOver, 255); - else fillMethod()(fill, dst, span->y, span->x, span->len, opBlendInterp, span->coverage); - } - //8 bits - } else if (surface->channelSize == sizeof(uint8_t)) { - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto dst = &surface->buf8[span->y * surface->stride + span->x]; - if (span->coverage == 255) fillMethod()(fill, dst, span->y, span->x, span->len, _opMaskNone, 255); - else fillMethod()(fill, dst, span->y, span->x, span->len, _opMaskAdd, span->coverage); - } - } - - return true; -} - - -static bool _rasterLinearGradientRle(SwSurface* surface, const SwRleData* rle, const SwFill* fill) -{ - if (!rle) return false; - - if (_compositing(surface)) { - if (_matting(surface)) return _rasterGradientMattedRle(surface, rle, fill); - else return _rasterGradientMaskedRle(surface, rle, fill); - } else if (_blending(surface)) { - return _rasterBlendingGradientRle(surface, rle, fill); - } else { - if (fill->translucent) return _rasterTranslucentGradientRle(surface, rle, fill); - else return _rasterSolidGradientRle(surface, rle, fill); - } - return false; -} - - -static bool _rasterRadialGradientRle(SwSurface* surface, const SwRleData* rle, const SwFill* fill) -{ - if (!rle) return false; - - if (_compositing(surface)) { - if (_matting(surface)) return _rasterGradientMattedRle(surface, rle, fill); - else return _rasterGradientMaskedRle(surface, rle, fill); - } else if (_blending(surface)) { - _rasterBlendingGradientRle(surface, rle, fill); - } else { - if (fill->translucent) _rasterTranslucentGradientRle(surface, rle, fill); - else return _rasterSolidGradientRle(surface, rle, fill); - } - return false; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - - -void rasterGrayscale8(uint8_t *dst, uint8_t val, uint32_t offset, int32_t len) -{ -#if defined(THORVG_AVX_VECTOR_SUPPORT) - avxRasterGrayscale8(dst, val, offset, len); -#elif defined(THORVG_NEON_VECTOR_SUPPORT) - neonRasterGrayscale8(dst, val, offset, len); -#else - cRasterPixels(dst, val, offset, len); -#endif -} - - -void rasterPixel32(uint32_t *dst, uint32_t val, uint32_t offset, int32_t len) -{ -#if defined(THORVG_AVX_VECTOR_SUPPORT) - avxRasterPixel32(dst, val, offset, len); -#elif defined(THORVG_NEON_VECTOR_SUPPORT) - neonRasterPixel32(dst, val, offset, len); -#else - cRasterPixels(dst, val, offset, len); -#endif -} - - -bool rasterCompositor(SwSurface* surface) -{ - //See CompositeMethod, Alpha:3, InvAlpha:4, Luma:5, InvLuma:6 - surface->alphas[0] = _alpha; - surface->alphas[1] = _ialpha; - - if (surface->cs == ColorSpace::ABGR8888 || surface->cs == ColorSpace::ABGR8888S) { - surface->join = _abgrJoin; - surface->alphas[2] = _abgrLuma; - surface->alphas[3] = _abgrInvLuma; - } else if (surface->cs == ColorSpace::ARGB8888 || surface->cs == ColorSpace::ARGB8888S) { - surface->join = _argbJoin; - surface->alphas[2] = _argbLuma; - surface->alphas[3] = _argbInvLuma; - } else { - TVGERR("SW_ENGINE", "Unsupported Colorspace(%d) is expected!", surface->cs); - return false; - } - return true; -} - - -bool rasterClear(SwSurface* surface, uint32_t x, uint32_t y, uint32_t w, uint32_t h) -{ - if (!surface || !surface->buf32 || surface->stride == 0 || surface->w == 0 || surface->h == 0) return false; - - //32 bits - if (surface->channelSize == sizeof(uint32_t)) { - //full clear - if (w == surface->stride) { - rasterPixel32(surface->buf32, 0x00000000, surface->stride * y, w * h); - //partial clear - } else { - for (uint32_t i = 0; i < h; i++) { - rasterPixel32(surface->buf32, 0x00000000, (surface->stride * y + x) + (surface->stride * i), w); - } - } - //8 bits - } else if (surface->channelSize == sizeof(uint8_t)) { - //full clear - if (w == surface->stride) { - rasterGrayscale8(surface->buf8, 0x00, surface->stride * y, w * h); - //partial clear - } else { - for (uint32_t i = 0; i < h; i++) { - rasterGrayscale8(surface->buf8, 0x00, (surface->stride * y + x) + (surface->stride * i), w); - } - } - } - return true; -} - - -void rasterUnpremultiply(Surface* surface) -{ - if (surface->channelSize != sizeof(uint32_t)) return; - - TVGLOG("SW_ENGINE", "Unpremultiply [Size: %d x %d]", surface->w, surface->h); - - //OPTIMIZE_ME: +SIMD - for (uint32_t y = 0; y < surface->h; y++) { - auto buffer = surface->buf32 + surface->stride * y; - for (uint32_t x = 0; x < surface->w; ++x) { - uint8_t a = buffer[x] >> 24; - if (a == 255) { - continue; - } else if (a == 0) { - buffer[x] = 0x00ffffff; - } else { - uint16_t r = ((buffer[x] >> 8) & 0xff00) / a; - uint16_t g = ((buffer[x]) & 0xff00) / a; - uint16_t b = ((buffer[x] << 8) & 0xff00) / a; - if (r > 0xff) r = 0xff; - if (g > 0xff) g = 0xff; - if (b > 0xff) b = 0xff; - buffer[x] = (a << 24) | (r << 16) | (g << 8) | (b); - } - } - } - surface->premultiplied = false; -} - - -void rasterPremultiply(Surface* surface) -{ - ScopedLock lock(surface->key); - if (surface->premultiplied || (surface->channelSize != sizeof(uint32_t))) return; - surface->premultiplied = true; - - TVGLOG("SW_ENGINE", "Premultiply [Size: %d x %d]", surface->w, surface->h); - - //OPTIMIZE_ME: +SIMD - auto buffer = surface->buf32; - for (uint32_t y = 0; y < surface->h; ++y, buffer += surface->stride) { - auto dst = buffer; - for (uint32_t x = 0; x < surface->w; ++x, ++dst) { - auto c = *dst; - auto a = (c >> 24); - *dst = (c & 0xff000000) + ((((c >> 8) & 0xff) * a) & 0xff00) + ((((c & 0x00ff00ff) * a) >> 8) & 0x00ff00ff); - } - } -} - - -bool rasterGradientShape(SwSurface* surface, SwShape* shape, unsigned id) -{ - if (!shape->fill) return false; - - if (shape->fastTrack) { - if (id == TVG_CLASS_ID_LINEAR) return _rasterLinearGradientRect(surface, shape->bbox, shape->fill); - else if (id == TVG_CLASS_ID_RADIAL)return _rasterRadialGradientRect(surface, shape->bbox, shape->fill); - } else { - if (id == TVG_CLASS_ID_LINEAR) return _rasterLinearGradientRle(surface, shape->rle, shape->fill); - else if (id == TVG_CLASS_ID_RADIAL) return _rasterRadialGradientRle(surface, shape->rle, shape->fill); - } - return false; -} - - -bool rasterGradientStroke(SwSurface* surface, SwShape* shape, unsigned id) -{ - if (!shape->stroke || !shape->stroke->fill || !shape->strokeRle) return false; - - if (id == TVG_CLASS_ID_LINEAR) return _rasterLinearGradientRle(surface, shape->strokeRle, shape->stroke->fill); - else if (id == TVG_CLASS_ID_RADIAL) return _rasterRadialGradientRle(surface, shape->strokeRle, shape->stroke->fill); - - return false; -} - - -bool rasterShape(SwSurface* surface, SwShape* shape, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (a < 255) { - r = MULTIPLY(r, a); - g = MULTIPLY(g, a); - b = MULTIPLY(b, a); - } - if (shape->fastTrack) return _rasterRect(surface, shape->bbox, r, g, b, a); - else return _rasterRle(surface, shape->rle, r, g, b, a); -} - - -bool rasterStroke(SwSurface* surface, SwShape* shape, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (a < 255) { - r = MULTIPLY(r, a); - g = MULTIPLY(g, a); - b = MULTIPLY(b, a); - } - - return _rasterRle(surface, shape->strokeRle, r, g, b, a); -} - - -bool rasterImage(SwSurface* surface, SwImage* image, const RenderMesh* mesh, const Matrix* transform, const SwBBox& bbox, uint8_t opacity) -{ - //Outside of the viewport, skip the rendering - if (bbox.max.x < 0 || bbox.max.y < 0 || bbox.min.x >= static_cast(surface->w) || bbox.min.y >= static_cast(surface->h)) return true; - - if (mesh && mesh->triangleCnt > 0) return _rasterTexmapPolygonMesh(surface, image, mesh, transform, &bbox, opacity); - else return _rasterImage(surface, image, transform, bbox, opacity); -} - - -bool rasterConvertCS(Surface* surface, ColorSpace to) -{ - ScopedLock lock(surface->key); - if (surface->cs == to) return true; - - //TODO: Support SIMD accelerations - auto from = surface->cs; - - if (((from == ColorSpace::ABGR8888) || (from == ColorSpace::ABGR8888S)) && ((to == ColorSpace::ARGB8888) || (to == ColorSpace::ARGB8888S))) { - surface->cs = to; - return cRasterABGRtoARGB(surface); - } - if (((from == ColorSpace::ARGB8888) || (from == ColorSpace::ARGB8888S)) && ((to == ColorSpace::ABGR8888) || (to == ColorSpace::ABGR8888S))) { - surface->cs = to; - return cRasterARGBtoABGR(surface); - } - return false; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterAvx.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterAvx.h deleted file mode 100644 index 82c177c..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterAvx.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifdef THORVG_AVX_VECTOR_SUPPORT - -#include - -#define N_32BITS_IN_128REG 4 -#define N_32BITS_IN_256REG 8 - -static inline __m128i ALPHA_BLEND(__m128i c, __m128i a) -{ - //1. set the masks for the A/G and R/B channels - auto AG = _mm_set1_epi32(0xff00ff00); - auto RB = _mm_set1_epi32(0x00ff00ff); - - //2. mask the alpha vector - originally quartet [a, a, a, a] - auto aAG = _mm_and_si128(a, AG); - auto aRB = _mm_and_si128(a, RB); - - //3. calculate the alpha blending of the 2nd and 4th channel - //- mask the color vector - //- multiply it by the masked alpha vector - //- add the correction to compensate bit shifting used instead of dividing by 255 - //- shift bits - corresponding to division by 256 - auto even = _mm_and_si128(c, RB); - even = _mm_mullo_epi16(even, aRB); - even =_mm_add_epi16(even, RB); - even = _mm_srli_epi16(even, 8); - - //4. calculate the alpha blending of the 1st and 3rd channel: - //- mask the color vector - //- multiply it by the corresponding masked alpha vector and store the high bits of the result - //- add the correction to compensate division by 256 instead of by 255 (next step) - //- remove the low 8 bits to mimic the division by 256 - auto odd = _mm_and_si128(c, AG); - odd = _mm_mulhi_epu16(odd, aAG); - odd = _mm_add_epi16(odd, RB); - odd = _mm_and_si128(odd, AG); - - //5. the final result - return _mm_or_si128(odd, even); -} - - -static void avxRasterGrayscale8(uint8_t* dst, uint8_t val, uint32_t offset, int32_t len) -{ - dst += offset; - - __m256i vecVal = _mm256_set1_epi8(val); - - int32_t i = 0; - for (; i <= len - 32; i += 32) { - _mm256_storeu_si256((__m256i*)(dst + i), vecVal); - } - - for (; i < len; ++i) { - dst[i] = val; - } -} - - -static void avxRasterPixel32(uint32_t *dst, uint32_t val, uint32_t offset, int32_t len) -{ - //1. calculate how many iterations we need to cover the length - uint32_t iterations = len / N_32BITS_IN_256REG; - uint32_t avxFilled = iterations * N_32BITS_IN_256REG; - - //2. set the beginning of the array - dst += offset; - - //3. fill the octets - for (uint32_t i = 0; i < iterations; ++i, dst += N_32BITS_IN_256REG) { - _mm256_storeu_si256((__m256i*)dst, _mm256_set1_epi32(val)); - } - - //4. fill leftovers (in the first step we have to set the pointer to the place where the avx job is done) - int32_t leftovers = len - avxFilled; - while (leftovers--) *dst++ = val; -} - - -static bool avxRasterTranslucentRect(SwSurface* surface, const SwBBox& region, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (surface->channelSize != sizeof(uint32_t)) { - TVGERR("SW_ENGINE", "Unsupported Channel Size = %d", surface->channelSize); - return false; - } - - auto color = surface->join(r, g, b, a); - auto buffer = surface->buf32 + (region.min.y * surface->stride) + region.min.x; - auto h = static_cast(region.max.y - region.min.y); - auto w = static_cast(region.max.x - region.min.x); - - uint32_t ialpha = 255 - a; - - auto avxColor = _mm_set1_epi32(color); - auto avxIalpha = _mm_set1_epi8(ialpha); - - for (uint32_t y = 0; y < h; ++y) { - auto dst = &buffer[y * surface->stride]; - - //1. fill the not aligned memory (for 128-bit registers a 16-bytes alignment is required) - auto notAligned = ((uintptr_t)dst & 0xf) / 4; - if (notAligned) { - notAligned = (N_32BITS_IN_128REG - notAligned > w ? w : N_32BITS_IN_128REG - notAligned); - for (uint32_t x = 0; x < notAligned; ++x, ++dst) { - *dst = color + ALPHA_BLEND(*dst, ialpha); - } - } - - //2. fill the aligned memory - N_32BITS_IN_128REG pixels processed at once - uint32_t iterations = (w - notAligned) / N_32BITS_IN_128REG; - uint32_t avxFilled = iterations * N_32BITS_IN_128REG; - auto avxDst = (__m128i*)dst; - for (uint32_t x = 0; x < iterations; ++x, ++avxDst) { - *avxDst = _mm_add_epi32(avxColor, ALPHA_BLEND(*avxDst, avxIalpha)); - } - - //3. fill the remaining pixels - int32_t leftovers = w - notAligned - avxFilled; - dst += avxFilled; - while (leftovers--) { - *dst = color + ALPHA_BLEND(*dst, ialpha); - dst++; - } - } - return true; -} - - -static bool avxRasterTranslucentRle(SwSurface* surface, const SwRleData* rle, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (surface->channelSize != sizeof(uint32_t)) { - TVGERR("SW_ENGINE", "Unsupported Channel Size = %d", surface->channelSize); - return false; - } - - auto color = surface->join(r, g, b, a); - auto span = rle->spans; - uint32_t src; - - for (uint32_t i = 0; i < rle->size; ++i) { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - - if (span->coverage < 255) src = ALPHA_BLEND(color, span->coverage); - else src = color; - - auto ialpha = IA(src); - - //1. fill the not aligned memory (for 128-bit registers a 16-bytes alignment is required) - auto notAligned = ((uintptr_t)dst & 0xf) / 4; - if (notAligned) { - notAligned = (N_32BITS_IN_128REG - notAligned > span->len ? span->len : N_32BITS_IN_128REG - notAligned); - for (uint32_t x = 0; x < notAligned; ++x, ++dst) { - *dst = src + ALPHA_BLEND(*dst, ialpha); - } - } - - //2. fill the aligned memory using avx - N_32BITS_IN_128REG pixels processed at once - //In order to avoid unnecessary avx variables declarations a check is made whether there are any iterations at all - uint32_t iterations = (span->len - notAligned) / N_32BITS_IN_128REG; - uint32_t avxFilled = 0; - if (iterations > 0) { - auto avxSrc = _mm_set1_epi32(src); - auto avxIalpha = _mm_set1_epi8(ialpha); - - avxFilled = iterations * N_32BITS_IN_128REG; - auto avxDst = (__m128i*)dst; - for (uint32_t x = 0; x < iterations; ++x, ++avxDst) { - *avxDst = _mm_add_epi32(avxSrc, ALPHA_BLEND(*avxDst, avxIalpha)); - } - } - - //3. fill the remaining pixels - int32_t leftovers = span->len - notAligned - avxFilled; - dst += avxFilled; - while (leftovers--) { - *dst = src + ALPHA_BLEND(*dst, ialpha); - dst++; - } - - ++span; - } - return true; -} - - -#endif - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterC.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterC.h deleted file mode 100644 index bc5211e..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterC.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -template -static void inline cRasterPixels(PIXEL_T* dst, PIXEL_T val, uint32_t offset, int32_t len) -{ - dst += offset; - - //fix the misaligned memory - auto alignOffset = (long long) dst % 8; - if (alignOffset > 0) { - if (sizeof(PIXEL_T) == 4) alignOffset /= 4; - else if (sizeof(PIXEL_T) == 1) alignOffset = 8 - alignOffset; - while (alignOffset > 0 && len > 0) { - *dst++ = val; - --len; - --alignOffset; - } - } - - //64bits faster clear - if ((sizeof(PIXEL_T) == 4)) { - auto val64 = (uint64_t(val) << 32) | uint64_t(val); - while (len > 1) { - *reinterpret_cast(dst) = val64; - len -= 2; - dst += 2; - } - } else if (sizeof(PIXEL_T) == 1) { - auto val32 = (uint32_t(val) << 24) | (uint32_t(val) << 16) | (uint32_t(val) << 8) | uint32_t(val); - auto val64 = (uint64_t(val32) << 32) | val32; - while (len > 7) { - *reinterpret_cast(dst) = val64; - len -= 8; - dst += 8; - } - } - - //leftovers - while (len--) *dst++ = val; -} - - -static bool inline cRasterTranslucentRle(SwSurface* surface, const SwRleData* rle, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - auto span = rle->spans; - - //32bit channels - if (surface->channelSize == sizeof(uint32_t)) { - auto color = surface->join(r, g, b, a); - uint32_t src; - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - if (span->coverage < 255) src = ALPHA_BLEND(color, span->coverage); - else src = color; - auto ialpha = IA(src); - for (uint32_t x = 0; x < span->len; ++x, ++dst) { - *dst = src + ALPHA_BLEND(*dst, ialpha); - } - } - //8bit grayscale - } else if (surface->channelSize == sizeof(uint8_t)) { - uint8_t src; - for (uint32_t i = 0; i < rle->size; ++i, ++span) { - auto dst = &surface->buf8[span->y * surface->stride + span->x]; - if (span->coverage < 255) src = MULTIPLY(span->coverage, a); - else src = a; - auto ialpha = ~a; - for (uint32_t x = 0; x < span->len; ++x, ++dst) { - *dst = src + MULTIPLY(*dst, ialpha); - } - } - } - return true; -} - - -static bool inline cRasterTranslucentRect(SwSurface* surface, const SwBBox& region, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - auto h = static_cast(region.max.y - region.min.y); - auto w = static_cast(region.max.x - region.min.x); - - //32bits channels - if (surface->channelSize == sizeof(uint32_t)) { - auto color = surface->join(r, g, b, a); - auto buffer = surface->buf32 + (region.min.y * surface->stride) + region.min.x; - auto ialpha = 255 - a; - for (uint32_t y = 0; y < h; ++y) { - auto dst = &buffer[y * surface->stride]; - for (uint32_t x = 0; x < w; ++x, ++dst) { - *dst = color + ALPHA_BLEND(*dst, ialpha); - } - } - //8bit grayscale - } else if (surface->channelSize == sizeof(uint8_t)) { - auto buffer = surface->buf8 + (region.min.y * surface->stride) + region.min.x; - auto ialpha = ~a; - for (uint32_t y = 0; y < h; ++y) { - auto dst = &buffer[y * surface->stride]; - for (uint32_t x = 0; x < w; ++x, ++dst) { - *dst = a + MULTIPLY(*dst, ialpha); - } - } - } - return true; -} - - -static bool inline cRasterABGRtoARGB(Surface* surface) -{ - TVGLOG("SW_ENGINE", "Convert ColorSpace ABGR - ARGB [Size: %d x %d]", surface->w, surface->h); - - //64bits faster converting - if (surface->w % 2 == 0) { - auto buffer = reinterpret_cast(surface->buf32); - for (uint32_t y = 0; y < surface->h; ++y, buffer += surface->stride / 2) { - auto dst = buffer; - for (uint32_t x = 0; x < surface->w / 2; ++x, ++dst) { - auto c = *dst; - //flip Blue, Red channels - *dst = (c & 0xff000000ff000000) + ((c & 0x00ff000000ff0000) >> 16) + (c & 0x0000ff000000ff00) + ((c & 0x000000ff000000ff) << 16); - } - } - //default converting - } else { - auto buffer = surface->buf32; - for (uint32_t y = 0; y < surface->h; ++y, buffer += surface->stride) { - auto dst = buffer; - for (uint32_t x = 0; x < surface->w; ++x, ++dst) { - auto c = *dst; - //flip Blue, Red channels - *dst = (c & 0xff000000) + ((c & 0x00ff0000) >> 16) + (c & 0x0000ff00) + ((c & 0x000000ff) << 16); - } - } - } - return true; -} - - -static bool inline cRasterARGBtoABGR(Surface* surface) -{ - //exactly same with ABGRtoARGB - return cRasterABGRtoARGB(surface); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterNeon.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterNeon.h deleted file mode 100644 index a84bfe8..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterNeon.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifdef THORVG_NEON_VECTOR_SUPPORT - -#include - -//TODO : need to support windows ARM - -#if defined(__ARM_64BIT_STATE) || defined(_M_ARM64) -#define TVG_AARCH64 1 -#else -#define TVG_AARCH64 0 -#endif - - -static inline uint8x8_t ALPHA_BLEND(uint8x8_t c, uint8x8_t a) -{ - uint16x8_t t = vmull_u8(c, a); - return vshrn_n_u16(t, 8); -} - - -static void neonRasterGrayscale8(uint8_t* dst, uint8_t val, uint32_t offset, int32_t len) -{ - dst += offset; - - int32_t i = 0; - const uint8x16_t valVec = vdupq_n_u8(val); -#if TVG_AARCH64 - uint8x16x4_t valQuad = {valVec, valVec, valVec, valVec}; - for (; i <= len - 16 * 4; i += 16 * 4) { - vst1q_u8_x4(dst + i, valQuad); - } -#else - for (; i <= len - 16; i += 16) { - vst1q_u8(dst + i, valVec); - } -#endif - for (; i < len; i++) { - dst[i] = val; - } -} - - -static void neonRasterPixel32(uint32_t *dst, uint32_t val, uint32_t offset, int32_t len) -{ - dst += offset; - - uint32x4_t vectorVal = vdupq_n_u32(val); - -#if TVG_AARCH64 - uint32_t iterations = len / 16; - uint32_t neonFilled = iterations * 16; - uint32x4x4_t valQuad = {vectorVal, vectorVal, vectorVal, vectorVal}; - for (uint32_t i = 0; i < iterations; ++i) { - vst4q_u32(dst, valQuad); - dst += 16; - } -#else - uint32_t iterations = len / 4; - uint32_t neonFilled = iterations * 4; - for (uint32_t i = 0; i < iterations; ++i) { - vst1q_u32(dst, vectorVal); - dst += 4; - } -#endif - int32_t leftovers = len - neonFilled; - while (leftovers--) *dst++ = val; -} - - -static bool neonRasterTranslucentRle(SwSurface* surface, const SwRleData* rle, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (surface->channelSize != sizeof(uint32_t)) { - TVGERR("SW_ENGINE", "Unsupported Channel Size = %d", surface->channelSize); - return false; - } - - auto color = surface->join(r, g, b, a); - auto span = rle->spans; - uint32_t src; - uint8x8_t *vDst = nullptr; - uint16_t align; - - for (uint32_t i = 0; i < rle->size; ++i) { - if (span->coverage < 255) src = ALPHA_BLEND(color, span->coverage); - else src = color; - - auto dst = &surface->buf32[span->y * surface->stride + span->x]; - auto ialpha = IA(src); - - if ((((uintptr_t) dst) & 0x7) != 0) { - //fill not aligned byte - *dst = src + ALPHA_BLEND(*dst, ialpha); - vDst = (uint8x8_t*)(dst + 1); - align = 1; - } else { - vDst = (uint8x8_t*) dst; - align = 0; - } - - uint8x8_t vSrc = (uint8x8_t) vdup_n_u32(src); - uint8x8_t vIalpha = vdup_n_u8((uint8_t) ialpha); - - for (uint32_t x = 0; x < (span->len - align) / 2; ++x) - vDst[x] = vadd_u8(vSrc, ALPHA_BLEND(vDst[x], vIalpha)); - - auto leftovers = (span->len - align) % 2; - if (leftovers > 0) dst[span->len - 1] = src + ALPHA_BLEND(dst[span->len - 1], ialpha); - - ++span; - } - return true; -} - - -static bool neonRasterTranslucentRect(SwSurface* surface, const SwBBox& region, uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - if (surface->channelSize != sizeof(uint32_t)) { - TVGERR("SW_ENGINE", "Unsupported Channel Size = %d", surface->channelSize); - return false; - } - - auto color = surface->join(r, g, b, a); - auto buffer = surface->buf32 + (region.min.y * surface->stride) + region.min.x; - auto h = static_cast(region.max.y - region.min.y); - auto w = static_cast(region.max.x - region.min.x); - auto ialpha = 255 - a; - - auto vColor = vdup_n_u32(color); - auto vIalpha = vdup_n_u8((uint8_t) ialpha); - - uint8x8_t* vDst = nullptr; - uint32_t align; - - for (uint32_t y = 0; y < h; ++y) { - auto dst = &buffer[y * surface->stride]; - - if ((((uintptr_t) dst) & 0x7) != 0) { - //fill not aligned byte - *dst = color + ALPHA_BLEND(*dst, ialpha); - vDst = (uint8x8_t*) (dst + 1); - align = 1; - } else { - vDst = (uint8x8_t*) dst; - align = 0; - } - - for (uint32_t x = 0; x < (w - align) / 2; ++x) - vDst[x] = vadd_u8((uint8x8_t)vColor, ALPHA_BLEND(vDst[x], vIalpha)); - - auto leftovers = (w - align) % 2; - if (leftovers > 0) dst[w - 1] = color + ALPHA_BLEND(dst[w - 1], ialpha); - } - return true; -} - -#endif - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterTexmap.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterTexmap.h deleted file mode 100644 index 6ef2e32..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRasterTexmap.h +++ /dev/null @@ -1,1214 +0,0 @@ -/* - * Copyright (c) 2021 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -struct AALine -{ - int32_t x[2]; - int32_t coverage[2]; - int32_t length[2]; -}; - -struct AASpans -{ - AALine *lines; - int32_t yStart; - int32_t yEnd; -}; - -static inline void _swap(float& a, float& b, float& tmp) -{ - tmp = a; - a = b; - b = tmp; -} - - -//Careful! Shared resource, No support threading -static float dudx, dvdx; -static float dxdya, dxdyb, dudya, dvdya; -static float xa, xb, ua, va; - - -//Y Range exception handling -static bool _arrange(const SwImage* image, const SwBBox* region, int& yStart, int& yEnd) -{ - int32_t regionTop, regionBottom; - - if (region) { - regionTop = region->min.y; - regionBottom = region->max.y; - } else { - regionTop = image->rle->spans->y; - regionBottom = image->rle->spans[image->rle->size - 1].y; - } - - if (yStart >= regionBottom) return false; - - if (yStart < regionTop) yStart = regionTop; - if (yEnd > regionBottom) yEnd = regionBottom; - - return true; -} - - -static bool _rasterMaskedPolygonImageSegment(SwSurface* surface, const SwImage* image, const SwBBox* region, int yStart, int yEnd, AASpans* aaSpans, uint8_t opacity, uint8_t dirFlag = 0) -{ - return false; - -#if 0 //Enable it when GRAYSCALE image is supported - auto maskOp = _getMaskOp(surface->compositor->method); - auto direct = _direct(surface->compositor->method); - float _dudx = dudx, _dvdx = dvdx; - float _dxdya = dxdya, _dxdyb = dxdyb, _dudya = dudya, _dvdya = dvdya; - float _xa = xa, _xb = xb, _ua = ua, _va = va; - auto sbuf = image->buf8; - int32_t sw = static_cast(image->stride); - int32_t sh = image->h; - int32_t x1, x2, x, y, ar, ab, iru, irv, px, ay; - int32_t vv = 0, uu = 0; - int32_t minx = INT32_MAX, maxx = 0; - float dx, u, v, iptr; - SwSpan* span = nullptr; //used only when rle based. - - if (!_arrange(image, region, yStart, yEnd)) return false; - - //Loop through all lines in the segment - uint32_t spanIdx = 0; - - if (region) { - minx = region->min.x; - maxx = region->max.x; - } else { - span = image->rle->spans; - while (span->y < yStart) { - ++span; - ++spanIdx; - } - } - - y = yStart; - - while (y < yEnd) { - x1 = (int32_t)_xa; - x2 = (int32_t)_xb; - - if (!region) { - minx = INT32_MAX; - maxx = 0; - //one single row, could be consisted of multiple spans. - while (span->y == y && spanIdx < image->rle->size) { - if (minx > span->x) minx = span->x; - if (maxx < span->x + span->len) maxx = span->x + span->len; - ++span; - ++spanIdx; - } - } - if (x1 < minx) x1 = minx; - if (x2 > maxx) x2 = maxx; - - //Anti-Aliasing frames - ay = y - aaSpans->yStart; - if (aaSpans->lines[ay].x[0] > x1) aaSpans->lines[ay].x[0] = x1; - if (aaSpans->lines[ay].x[1] < x2) aaSpans->lines[ay].x[1] = x2; - - //Range allowed - if ((x2 - x1) >= 1 && (x1 < maxx) && (x2 > minx)) { - - //Perform subtexel pre-stepping on UV - dx = 1 - (_xa - x1); - u = _ua + dx * _dudx; - v = _va + dx * _dvdx; - - x = x1; - - auto cmp = &surface->compositor->image.buf8[y * surface->compositor->image.stride + x1]; - auto dst = &surface->buf8[y * surface->stride + x1]; - - if (opacity == 255) { - //Draw horizontal line - while (x++ < x2) { - uu = (int) u; - if (uu >= sw) continue; - vv = (int) v; - if (vv >= sh) continue; - - ar = (int)(255 * (1 - modff(u, &iptr))); - ab = (int)(255 * (1 - modff(v, &iptr))); - iru = uu + 1; - irv = vv + 1; - - px = *(sbuf + (vv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* right pixel */ - int px2 = *(sbuf + (vv * sw) + iru); - px = INTERPOLATE(px, px2, ar); - } - /* vertical interpolate */ - if (irv < sh) { - /* bottom pixel */ - int px2 = *(sbuf + (irv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* bottom right pixel */ - int px3 = *(sbuf + (irv * sw) + iru); - px2 = INTERPOLATE(px2, px3, ar); - } - px = INTERPOLATE(px, px2, ab); - } - if (direct) { - auto tmp = maskOp(px, *cmp, 0); //not use alpha - *dst = tmp + MULTIPLY(*dst, ~tmp); - ++dst; - } else { - *cmp = maskOp(px, *cmp, ~px); - } - ++cmp; - - //Step UV horizontally - u += _dudx; - v += _dvdx; - //range over? - if ((uint32_t)v >= image->h) break; - } - } else { - //Draw horizontal line - while (x++ < x2) { - uu = (int) u; - if (uu >= sw) continue; - vv = (int) v; - if (vv >= sh) continue; - - ar = (int)(255 * (1 - modff(u, &iptr))); - ab = (int)(255 * (1 - modff(v, &iptr))); - iru = uu + 1; - irv = vv + 1; - - px = *(sbuf + (vv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* right pixel */ - int px2 = *(sbuf + (vv * sw) + iru); - px = INTERPOLATE(px, px2, ar); - } - /* vertical interpolate */ - if (irv < sh) { - /* bottom pixel */ - int px2 = *(sbuf + (irv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* bottom right pixel */ - int px3 = *(sbuf + (irv * sw) + iru); - px2 = INTERPOLATE(px2, px3, ar); - } - px = INTERPOLATE(px, px2, ab); - } - - if (direct) { - auto tmp = maskOp(MULTIPLY(px, opacity), *cmp, 0); - *dst = tmp + MULTIPLY(*dst, ~tmp); - ++dst; - } else { - auto tmp = MULTIPLY(px, opacity); - *cmp = maskOp(tmp, *cmp, ~px); - } - ++cmp; - - //Step UV horizontally - u += _dudx; - v += _dvdx; - //range over? - if ((uint32_t)v >= image->h) break; - } - } - } - - //Step along both edges - _xa += _dxdya; - _xb += _dxdyb; - _ua += _dudya; - _va += _dvdya; - - if (!region && spanIdx >= image->rle->size) break; - - ++y; - } - xa = _xa; - xb = _xb; - ua = _ua; - va = _va; - - return true; -#endif -} - - -static void _rasterBlendingPolygonImageSegment(SwSurface* surface, const SwImage* image, const SwBBox* region, int yStart, int yEnd, AASpans* aaSpans, uint8_t opacity) -{ - float _dudx = dudx, _dvdx = dvdx; - float _dxdya = dxdya, _dxdyb = dxdyb, _dudya = dudya, _dvdya = dvdya; - float _xa = xa, _xb = xb, _ua = ua, _va = va; - auto sbuf = image->buf32; - auto dbuf = surface->buf32; - int32_t sw = static_cast(image->stride); - int32_t sh = image->h; - int32_t dw = surface->stride; - int32_t x1, x2, x, y, ar, ab, iru, irv, px, ay; - int32_t vv = 0, uu = 0; - int32_t minx = INT32_MAX, maxx = 0; - float dx, u, v, iptr; - uint32_t* buf; - SwSpan* span = nullptr; //used only when rle based. - - if (!_arrange(image, region, yStart, yEnd)) return; - - //Loop through all lines in the segment - uint32_t spanIdx = 0; - - if (region) { - minx = region->min.x; - maxx = region->max.x; - } else { - span = image->rle->spans; - while (span->y < yStart) { - ++span; - ++spanIdx; - } - } - - y = yStart; - - while (y < yEnd) { - x1 = (int32_t)_xa; - x2 = (int32_t)_xb; - - if (!region) { - minx = INT32_MAX; - maxx = 0; - //one single row, could be consisted of multiple spans. - while (span->y == y && spanIdx < image->rle->size) { - if (minx > span->x) minx = span->x; - if (maxx < span->x + span->len) maxx = span->x + span->len; - ++span; - ++spanIdx; - } - } - if (x1 < minx) x1 = minx; - if (x2 > maxx) x2 = maxx; - - //Anti-Aliasing frames - ay = y - aaSpans->yStart; - if (aaSpans->lines[ay].x[0] > x1) aaSpans->lines[ay].x[0] = x1; - if (aaSpans->lines[ay].x[1] < x2) aaSpans->lines[ay].x[1] = x2; - - //Range allowed - if ((x2 - x1) >= 1 && (x1 < maxx) && (x2 > minx)) { - - //Perform subtexel pre-stepping on UV - dx = 1 - (_xa - x1); - u = _ua + dx * _dudx; - v = _va + dx * _dvdx; - - buf = dbuf + ((y * dw) + x1); - - x = x1; - - if (opacity == 255) { - //Draw horizontal line - while (x++ < x2) { - uu = (int) u; - if (uu >= sw) continue; - vv = (int) v; - if (vv >= sh) continue; - - ar = (int)(255 * (1 - modff(u, &iptr))); - ab = (int)(255 * (1 - modff(v, &iptr))); - iru = uu + 1; - irv = vv + 1; - - px = *(sbuf + (vv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* right pixel */ - int px2 = *(sbuf + (vv * sw) + iru); - px = INTERPOLATE(px, px2, ar); - } - /* vertical interpolate */ - if (irv < sh) { - /* bottom pixel */ - int px2 = *(sbuf + (irv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* bottom right pixel */ - int px3 = *(sbuf + (irv * sw) + iru); - px2 = INTERPOLATE(px2, px3, ar); - } - px = INTERPOLATE(px, px2, ab); - } - *buf = surface->blender(px, *buf, IA(px)); - ++buf; - - //Step UV horizontally - u += _dudx; - v += _dvdx; - //range over? - if ((uint32_t)v >= image->h) break; - } - } else { - //Draw horizontal line - while (x++ < x2) { - uu = (int) u; - if (uu >= sw) continue; - vv = (int) v; - if (vv >= sh) continue; - - ar = (int)(255 * (1 - modff(u, &iptr))); - ab = (int)(255 * (1 - modff(v, &iptr))); - iru = uu + 1; - irv = vv + 1; - - px = *(sbuf + (vv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* right pixel */ - int px2 = *(sbuf + (vv * sw) + iru); - px = INTERPOLATE(px, px2, ar); - } - /* vertical interpolate */ - if (irv < sh) { - /* bottom pixel */ - int px2 = *(sbuf + (irv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* bottom right pixel */ - int px3 = *(sbuf + (irv * sw) + iru); - px2 = INTERPOLATE(px2, px3, ar); - } - px = INTERPOLATE(px, px2, ab); - } - auto src = ALPHA_BLEND(px, opacity); - *buf = surface->blender(src, *buf, IA(src)); - ++buf; - - //Step UV horizontally - u += _dudx; - v += _dvdx; - //range over? - if ((uint32_t)v >= image->h) break; - } - } - } - - //Step along both edges - _xa += _dxdya; - _xb += _dxdyb; - _ua += _dudya; - _va += _dvdya; - - if (!region && spanIdx >= image->rle->size) break; - - ++y; - } - xa = _xa; - xb = _xb; - ua = _ua; - va = _va; -} - - -static void _rasterPolygonImageSegment(SwSurface* surface, const SwImage* image, const SwBBox* region, int yStart, int yEnd, AASpans* aaSpans, uint8_t opacity, bool matting) -{ - float _dudx = dudx, _dvdx = dvdx; - float _dxdya = dxdya, _dxdyb = dxdyb, _dudya = dudya, _dvdya = dvdya; - float _xa = xa, _xb = xb, _ua = ua, _va = va; - auto sbuf = image->buf32; - auto dbuf = surface->buf32; - int32_t sw = static_cast(image->stride); - int32_t sh = image->h; - int32_t dw = surface->stride; - int32_t x1, x2, x, y, ar, ab, iru, irv, px, ay; - int32_t vv = 0, uu = 0; - int32_t minx = INT32_MAX, maxx = 0; - float dx, u, v, iptr; - uint32_t* buf; - SwSpan* span = nullptr; //used only when rle based. - - //for matting(composition) - auto csize = matting ? surface->compositor->image.channelSize: 0; - auto alpha = matting ? surface->alpha(surface->compositor->method) : nullptr; - uint8_t* cmp = nullptr; - - if (!_arrange(image, region, yStart, yEnd)) return; - - //Loop through all lines in the segment - uint32_t spanIdx = 0; - - if (region) { - minx = region->min.x; - maxx = region->max.x; - } else { - span = image->rle->spans; - while (span->y < yStart) { - ++span; - ++spanIdx; - } - } - - y = yStart; - - while (y < yEnd) { - x1 = (int32_t)_xa; - x2 = (int32_t)_xb; - - if (!region) { - minx = INT32_MAX; - maxx = 0; - //one single row, could be consisted of multiple spans. - while (span->y == y && spanIdx < image->rle->size) { - if (minx > span->x) minx = span->x; - if (maxx < span->x + span->len) maxx = span->x + span->len; - ++span; - ++spanIdx; - } - } - if (x1 < minx) x1 = minx; - if (x2 > maxx) x2 = maxx; - - //Anti-Aliasing frames - ay = y - aaSpans->yStart; - if (aaSpans->lines[ay].x[0] > x1) aaSpans->lines[ay].x[0] = x1; - if (aaSpans->lines[ay].x[1] < x2) aaSpans->lines[ay].x[1] = x2; - - //Range allowed - if ((x2 - x1) >= 1 && (x1 < maxx) && (x2 > minx)) { - - //Perform subtexel pre-stepping on UV - dx = 1 - (_xa - x1); - u = _ua + dx * _dudx; - v = _va + dx * _dvdx; - - buf = dbuf + ((y * dw) + x1); - - x = x1; - - if (matting) cmp = &surface->compositor->image.buf8[(y * surface->compositor->image.stride + x1) * csize]; - - if (opacity == 255) { - //Draw horizontal line - while (x++ < x2) { - uu = (int) u; - if (uu >= sw) continue; - vv = (int) v; - if (vv >= sh) continue; - - ar = (int)(255.0f * (1.0f - modff(u, &iptr))); - ab = (int)(255.0f * (1.0f - modff(v, &iptr))); - iru = uu + 1; - irv = vv + 1; - - px = *(sbuf + (vv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* right pixel */ - int px2 = *(sbuf + (vv * sw) + iru); - px = INTERPOLATE(px, px2, ar); - } - /* vertical interpolate */ - if (irv < sh) { - /* bottom pixel */ - int px2 = *(sbuf + (irv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* bottom right pixel */ - int px3 = *(sbuf + (irv * sw) + iru); - px2 = INTERPOLATE(px2, px3, ar); - } - px = INTERPOLATE(px, px2, ab); - } - uint32_t src; - if (matting) { - src = ALPHA_BLEND(px, alpha(cmp)); - cmp += csize; - } else { - src = px; - } - *buf = src + ALPHA_BLEND(*buf, IA(src)); - ++buf; - - //Step UV horizontally - u += _dudx; - v += _dvdx; - //range over? - if ((uint32_t)v >= image->h) break; - } - } else { - //Draw horizontal line - while (x++ < x2) { - uu = (int) u; - vv = (int) v; - - ar = (int)(255.0f * (1.0f - modff(u, &iptr))); - ab = (int)(255.0f * (1.0f - modff(v, &iptr))); - iru = uu + 1; - irv = vv + 1; - - if (vv >= sh) continue; - - px = *(sbuf + (vv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* right pixel */ - int px2 = *(sbuf + (vv * sw) + iru); - px = INTERPOLATE(px, px2, ar); - } - /* vertical interpolate */ - if (irv < sh) { - /* bottom pixel */ - int px2 = *(sbuf + (irv * sw) + uu); - - /* horizontal interpolate */ - if (iru < sw) { - /* bottom right pixel */ - int px3 = *(sbuf + (irv * sw) + iru); - px2 = INTERPOLATE(px2, px3, ar); - } - px = INTERPOLATE(px, px2, ab); - } - uint32_t src; - if (matting) { - src = ALPHA_BLEND(px, MULTIPLY(opacity, alpha(cmp))); - cmp += csize; - } else { - src = ALPHA_BLEND(px, opacity); - } - *buf = src + ALPHA_BLEND(*buf, IA(src)); - ++buf; - - //Step UV horizontally - u += _dudx; - v += _dvdx; - //range over? - if ((uint32_t)v >= image->h) break; - } - } - } - - //Step along both edges - _xa += _dxdya; - _xb += _dxdyb; - _ua += _dudya; - _va += _dvdya; - - if (!region && spanIdx >= image->rle->size) break; - - ++y; - } - xa = _xa; - xb = _xb; - ua = _ua; - va = _va; -} - - -/* This mapping algorithm is based on Mikael Kalms's. */ -static void _rasterPolygonImage(SwSurface* surface, const SwImage* image, const SwBBox* region, Polygon& polygon, AASpans* aaSpans, uint8_t opacity) -{ - float x[3] = {polygon.vertex[0].pt.x, polygon.vertex[1].pt.x, polygon.vertex[2].pt.x}; - float y[3] = {polygon.vertex[0].pt.y, polygon.vertex[1].pt.y, polygon.vertex[2].pt.y}; - float u[3] = {polygon.vertex[0].uv.x, polygon.vertex[1].uv.x, polygon.vertex[2].uv.x}; - float v[3] = {polygon.vertex[0].uv.y, polygon.vertex[1].uv.y, polygon.vertex[2].uv.y}; - - float off_y; - float dxdy[3] = {0.0f, 0.0f, 0.0f}; - float tmp; - - auto upper = false; - - //Sort the vertices in ascending Y order - if (y[0] > y[1]) { - _swap(x[0], x[1], tmp); - _swap(y[0], y[1], tmp); - _swap(u[0], u[1], tmp); - _swap(v[0], v[1], tmp); - } - if (y[0] > y[2]) { - _swap(x[0], x[2], tmp); - _swap(y[0], y[2], tmp); - _swap(u[0], u[2], tmp); - _swap(v[0], v[2], tmp); - } - if (y[1] > y[2]) { - _swap(x[1], x[2], tmp); - _swap(y[1], y[2], tmp); - _swap(u[1], u[2], tmp); - _swap(v[1], v[2], tmp); - } - - //Y indexes - int yi[3] = {(int)y[0], (int)y[1], (int)y[2]}; - - //Skip drawing if it's too thin to cover any pixels at all. - if ((yi[0] == yi[1] && yi[0] == yi[2]) || ((int) x[0] == (int) x[1] && (int) x[0] == (int) x[2])) return; - - //Calculate horizontal and vertical increments for UV axes (these calcs are certainly not optimal, although they're stable (handles any dy being 0) - auto denom = ((x[2] - x[0]) * (y[1] - y[0]) - (x[1] - x[0]) * (y[2] - y[0])); - - //Skip poly if it's an infinitely thin line - if (mathZero(denom)) return; - - denom = 1 / denom; //Reciprocal for speeding up - dudx = ((u[2] - u[0]) * (y[1] - y[0]) - (u[1] - u[0]) * (y[2] - y[0])) * denom; - dvdx = ((v[2] - v[0]) * (y[1] - y[0]) - (v[1] - v[0]) * (y[2] - y[0])) * denom; - auto dudy = ((u[1] - u[0]) * (x[2] - x[0]) - (u[2] - u[0]) * (x[1] - x[0])) * denom; - auto dvdy = ((v[1] - v[0]) * (x[2] - x[0]) - (v[2] - v[0]) * (x[1] - x[0])) * denom; - - //Calculate X-slopes along the edges - if (y[1] > y[0]) dxdy[0] = (x[1] - x[0]) / (y[1] - y[0]); - if (y[2] > y[0]) dxdy[1] = (x[2] - x[0]) / (y[2] - y[0]); - if (y[2] > y[1]) dxdy[2] = (x[2] - x[1]) / (y[2] - y[1]); - - //Determine which side of the polygon the longer edge is on - auto side = (dxdy[1] > dxdy[0]) ? true : false; - - if (mathEqual(y[0], y[1])) side = x[0] > x[1]; - if (mathEqual(y[1], y[2])) side = x[2] > x[1]; - - auto regionTop = region ? region->min.y : image->rle->spans->y; //Normal Image or Rle Image? - auto compositing = _compositing(surface); //Composition required - auto blending = _blending(surface); //Blending required - - //Longer edge is on the left side - if (!side) { - //Calculate slopes along left edge - dxdya = dxdy[1]; - dudya = dxdya * dudx + dudy; - dvdya = dxdya * dvdx + dvdy; - - //Perform subpixel pre-stepping along left edge - auto dy = 1.0f - (y[0] - yi[0]); - xa = x[0] + dy * dxdya; - ua = u[0] + dy * dudya; - va = v[0] + dy * dvdya; - - //Draw upper segment if possibly visible - if (yi[0] < yi[1]) { - off_y = y[0] < regionTop ? (regionTop - y[0]) : 0; - xa += (off_y * dxdya); - ua += (off_y * dudya); - va += (off_y * dvdya); - - // Set right edge X-slope and perform subpixel pre-stepping - dxdyb = dxdy[0]; - xb = x[0] + dy * dxdyb + (off_y * dxdyb); - - if (compositing) { - if (_matting(surface)) _rasterPolygonImageSegment(surface, image, region, yi[0], yi[1], aaSpans, opacity, true); - else _rasterMaskedPolygonImageSegment(surface, image, region, yi[0], yi[1], aaSpans, opacity, 1); - } else if (blending) { - _rasterBlendingPolygonImageSegment(surface, image, region, yi[0], yi[1], aaSpans, opacity); - } else { - _rasterPolygonImageSegment(surface, image, region, yi[0], yi[1], aaSpans, opacity, false); - } - upper = true; - } - //Draw lower segment if possibly visible - if (yi[1] < yi[2]) { - off_y = y[1] < regionTop ? (regionTop - y[1]) : 0; - if (!upper) { - xa += (off_y * dxdya); - ua += (off_y * dudya); - va += (off_y * dvdya); - } - // Set right edge X-slope and perform subpixel pre-stepping - dxdyb = dxdy[2]; - xb = x[1] + (1 - (y[1] - yi[1])) * dxdyb + (off_y * dxdyb); - if (compositing) { - if (_matting(surface)) _rasterPolygonImageSegment(surface, image, region, yi[1], yi[2], aaSpans, opacity, true); - else _rasterMaskedPolygonImageSegment(surface, image, region, yi[1], yi[2], aaSpans, opacity, 2); - } else if (blending) { - _rasterBlendingPolygonImageSegment(surface, image, region, yi[1], yi[2], aaSpans, opacity); - } else { - _rasterPolygonImageSegment(surface, image, region, yi[1], yi[2], aaSpans, opacity, false); - } - } - //Longer edge is on the right side - } else { - //Set right edge X-slope and perform subpixel pre-stepping - dxdyb = dxdy[1]; - auto dy = 1.0f - (y[0] - yi[0]); - xb = x[0] + dy * dxdyb; - - //Draw upper segment if possibly visible - if (yi[0] < yi[1]) { - off_y = y[0] < regionTop ? (regionTop - y[0]) : 0; - xb += (off_y *dxdyb); - - // Set slopes along left edge and perform subpixel pre-stepping - dxdya = dxdy[0]; - dudya = dxdya * dudx + dudy; - dvdya = dxdya * dvdx + dvdy; - - xa = x[0] + dy * dxdya + (off_y * dxdya); - ua = u[0] + dy * dudya + (off_y * dudya); - va = v[0] + dy * dvdya + (off_y * dvdya); - - if (compositing) { - if (_matting(surface)) _rasterPolygonImageSegment(surface, image, region, yi[0], yi[1], aaSpans, opacity, true); - else _rasterMaskedPolygonImageSegment(surface, image, region, yi[0], yi[1], aaSpans, opacity, 3); - } else if (blending) { - _rasterBlendingPolygonImageSegment(surface, image, region, yi[0], yi[1], aaSpans, opacity); - } else { - _rasterPolygonImageSegment(surface, image, region, yi[0], yi[1], aaSpans, opacity, false); - } - upper = true; - } - //Draw lower segment if possibly visible - if (yi[1] < yi[2]) { - off_y = y[1] < regionTop ? (regionTop - y[1]) : 0; - if (!upper) xb += (off_y *dxdyb); - - // Set slopes along left edge and perform subpixel pre-stepping - dxdya = dxdy[2]; - dudya = dxdya * dudx + dudy; - dvdya = dxdya * dvdx + dvdy; - dy = 1 - (y[1] - yi[1]); - xa = x[1] + dy * dxdya + (off_y * dxdya); - ua = u[1] + dy * dudya + (off_y * dudya); - va = v[1] + dy * dvdya + (off_y * dvdya); - - if (compositing) { - if (_matting(surface)) _rasterPolygonImageSegment(surface, image, region, yi[1], yi[2], aaSpans, opacity, true); - else _rasterMaskedPolygonImageSegment(surface, image, region, yi[1], yi[2], aaSpans, opacity, 4); - } else if (blending) { - _rasterBlendingPolygonImageSegment(surface, image, region, yi[1], yi[2], aaSpans, opacity); - } else { - _rasterPolygonImageSegment(surface, image, region, yi[1], yi[2], aaSpans, opacity, false); - } - } - } -} - - -static AASpans* _AASpans(float ymin, float ymax, const SwImage* image, const SwBBox* region) -{ - auto yStart = static_cast(ymin); - auto yEnd = static_cast(ymax); - - if (!_arrange(image, region, yStart, yEnd)) return nullptr; - - auto aaSpans = static_cast(malloc(sizeof(AASpans))); - aaSpans->yStart = yStart; - aaSpans->yEnd = yEnd; - - //Initialize X range - auto height = yEnd - yStart; - - aaSpans->lines = static_cast(malloc(height * sizeof(AALine))); - - for (int32_t i = 0; i < height; i++) { - aaSpans->lines[i].x[0] = INT32_MAX; - aaSpans->lines[i].x[1] = 0; - aaSpans->lines[i].length[0] = 0; - aaSpans->lines[i].length[1] = 0; - } - return aaSpans; -} - - -static void _calcIrregularCoverage(AALine* lines, int32_t eidx, int32_t y, int32_t diagonal, int32_t edgeDist, bool reverse) -{ - if (eidx == 1) reverse = !reverse; - int32_t coverage = (255 / (diagonal + 2)); - int32_t tmp; - for (int32_t ry = 0; ry < (diagonal + 2); ry++) { - tmp = y - ry - edgeDist; - if (tmp < 0) return; - lines[tmp].length[eidx] = 1; - if (reverse) lines[tmp].coverage[eidx] = 255 - (coverage * ry); - else lines[tmp].coverage[eidx] = (coverage * ry); - } -} - - -static void _calcVertCoverage(AALine *lines, int32_t eidx, int32_t y, int32_t rewind, bool reverse) -{ - if (eidx == 1) reverse = !reverse; - int32_t coverage = (255 / (rewind + 1)); - int32_t tmp; - for (int ry = 1; ry < (rewind + 1); ry++) { - tmp = y - ry; - if (tmp < 0) return; - lines[tmp].length[eidx] = 1; - if (reverse) lines[tmp].coverage[eidx] = (255 - (coverage * ry)); - else lines[tmp].coverage[eidx] = (coverage * ry); - } -} - - -static void _calcHorizCoverage(AALine *lines, int32_t eidx, int32_t y, int32_t x, int32_t x2) -{ - if (lines[y].length[eidx] < abs(x - x2)) { - lines[y].length[eidx] = abs(x - x2); - lines[y].coverage[eidx] = (255 / (lines[y].length[eidx] + 1)); - } -} - - -/* - * This Anti-Aliasing mechanism is originated from Hermet Park's idea. - * To understand this AA logic, you can refer this page: - * www.hermet.pe.kr/122 (hermetpark@gmail.com) -*/ -static void _calcAAEdge(AASpans *aaSpans, int32_t eidx) -{ -//Previous edge direction: -#define DirOutHor 0x0011 -#define DirOutVer 0x0001 -#define DirInHor 0x0010 -#define DirInVer 0x0000 -#define DirNone 0x1000 - -#define PUSH_VERTEX() \ - do { \ - pEdge.x = lines[y].x[eidx]; \ - pEdge.y = y; \ - ptx[0] = tx[0]; \ - ptx[1] = tx[1]; \ - } while (0) - - int32_t y = 0; - SwPoint pEdge = {-1, -1}; //previous edge point - SwPoint edgeDiff = {0, 0}; //temporary used for point distance - - /* store bigger to tx[0] between prev and current edge's x positions. */ - int32_t tx[2] = {0, 0}; - /* back up prev tx values */ - int32_t ptx[2] = {0, 0}; - int32_t diagonal = 0; //straight diagonal pixels count - - auto yStart = aaSpans->yStart; - auto yEnd = aaSpans->yEnd; - auto lines = aaSpans->lines; - - int32_t prevDir = DirNone; - int32_t curDir = DirNone; - - yEnd -= yStart; - - //Start Edge - if (y < yEnd) { - pEdge.x = lines[y].x[eidx]; - pEdge.y = y; - } - - //Calculates AA Edges - for (y++; y < yEnd; y++) { - //Ready tx - if (eidx == 0) { - tx[0] = pEdge.x; - tx[1] = lines[y].x[0]; - } else { - tx[0] = lines[y].x[1]; - tx[1] = pEdge.x; - } - edgeDiff.x = (tx[0] - tx[1]); - edgeDiff.y = (y - pEdge.y); - - //Confirm current edge direction - if (edgeDiff.x > 0) { - if (edgeDiff.y == 1) curDir = DirOutHor; - else curDir = DirOutVer; - } else if (edgeDiff.x < 0) { - if (edgeDiff.y == 1) curDir = DirInHor; - else curDir = DirInVer; - } else curDir = DirNone; - - //straight diagonal increase - if ((curDir == prevDir) && (y < yEnd)) { - if ((abs(edgeDiff.x) == 1) && (edgeDiff.y == 1)) { - ++diagonal; - PUSH_VERTEX(); - continue; - } - } - - switch (curDir) { - case DirOutHor: { - _calcHorizCoverage(lines, eidx, y, tx[0], tx[1]); - if (diagonal > 0) { - _calcIrregularCoverage(lines, eidx, y, diagonal, 0, true); - diagonal = 0; - } - /* Increment direction is changed: Outside Vertical -> Outside Horizontal */ - if (prevDir == DirOutVer) _calcHorizCoverage(lines, eidx, pEdge.y, ptx[0], ptx[1]); - - //Trick, but fine-tunning! - if (y == 1) _calcHorizCoverage(lines, eidx, pEdge.y, tx[0], tx[1]); - PUSH_VERTEX(); - } - break; - case DirOutVer: { - _calcVertCoverage(lines, eidx, y, edgeDiff.y, true); - if (diagonal > 0) { - _calcIrregularCoverage(lines, eidx, y, diagonal, edgeDiff.y, false); - diagonal = 0; - } - /* Increment direction is changed: Outside Horizontal -> Outside Vertical */ - if (prevDir == DirOutHor) _calcHorizCoverage(lines, eidx, pEdge.y, ptx[0], ptx[1]); - PUSH_VERTEX(); - } - break; - case DirInHor: { - _calcHorizCoverage(lines, eidx, (y - 1), tx[0], tx[1]); - if (diagonal > 0) { - _calcIrregularCoverage(lines, eidx, y, diagonal, 0, false); - diagonal = 0; - } - /* Increment direction is changed: Outside Horizontal -> Inside Horizontal */ - if (prevDir == DirOutHor) _calcHorizCoverage(lines, eidx, pEdge.y, ptx[0], ptx[1]); - PUSH_VERTEX(); - } - break; - case DirInVer: { - _calcVertCoverage(lines, eidx, y, edgeDiff.y, false); - if (prevDir == DirOutHor) edgeDiff.y -= 1; //Weird, fine tuning????????????????????? - if (diagonal > 0) { - _calcIrregularCoverage(lines, eidx, y, diagonal, edgeDiff.y, true); - diagonal = 0; - } - /* Increment direction is changed: Outside Horizontal -> Inside Vertical */ - if (prevDir == DirOutHor) _calcHorizCoverage(lines, eidx, pEdge.y, ptx[0], ptx[1]); - PUSH_VERTEX(); - } - break; - } - if (curDir != DirNone) prevDir = curDir; - } - - //leftovers...? - if ((edgeDiff.y == 1) && (edgeDiff.x != 0)) { - if (y >= yEnd) y = (yEnd - 1); - _calcHorizCoverage(lines, eidx, y - 1, ptx[0], ptx[1]); - _calcHorizCoverage(lines, eidx, y, tx[0], tx[1]); - } else { - ++y; - if (y > yEnd) y = yEnd; - _calcVertCoverage(lines, eidx, y, (edgeDiff.y + 1), (prevDir & 0x00000001)); - } -} - - -static bool _apply(SwSurface* surface, AASpans* aaSpans) -{ - auto y = aaSpans->yStart; - uint32_t pixel; - uint32_t* dst; - int32_t pos; - - //left side - _calcAAEdge(aaSpans, 0); - //right side - _calcAAEdge(aaSpans, 1); - - while (y < aaSpans->yEnd) { - auto line = &aaSpans->lines[y - aaSpans->yStart]; - auto width = line->x[1] - line->x[0]; - if (width > 0) { - auto offset = y * surface->stride; - - //Left edge - dst = surface->buf32 + (offset + line->x[0]); - if (line->x[0] > 1) pixel = *(dst - 1); - else pixel = *dst; - - pos = 1; - while (pos <= line->length[0]) { - *dst = INTERPOLATE(*dst, pixel, line->coverage[0] * pos); - ++dst; - ++pos; - } - - //Right edge - dst = surface->buf32 + (offset + line->x[1] - 1); - if (line->x[1] < (int32_t)(surface->w - 1)) pixel = *(dst + 1); - else pixel = *dst; - - pos = width; - while ((int32_t)(width - line->length[1]) < pos) { - *dst = INTERPOLATE(*dst, pixel, 255 - (line->coverage[1] * (line->length[1] - (width - pos)))); - --dst; - --pos; - } - } - y++; - } - - free(aaSpans->lines); - free(aaSpans); - - return true; -} - - -/* - 2 triangles constructs 1 mesh. - below figure illustrates vert[4] index info. - If you need better quality, please divide a mesh by more number of triangles. - - 0 -- 1 - | / | - | / | - 3 -- 2 -*/ -static bool _rasterTexmapPolygon(SwSurface* surface, const SwImage* image, const Matrix* transform, const SwBBox* region, uint8_t opacity) -{ - if (surface->channelSize == sizeof(uint8_t)) { - TVGERR("SW_ENGINE", "Not supported grayscale Textmap polygon!"); - return false; - } - - //Exceptions: No dedicated drawing area? - if ((!image->rle && !region) || (image->rle && image->rle->size == 0)) return false; - - /* Prepare vertices. - shift XY coordinates to match the sub-pixeling technique. */ - Vertex vertices[4]; - vertices[0] = {{0.0f, 0.0f}, {0.0f, 0.0f}}; - vertices[1] = {{float(image->w), 0.0f}, {float(image->w), 0.0f}}; - vertices[2] = {{float(image->w), float(image->h)}, {float(image->w), float(image->h)}}; - vertices[3] = {{0.0f, float(image->h)}, {0.0f, float(image->h)}}; - - float ys = FLT_MAX, ye = -1.0f; - for (int i = 0; i < 4; i++) { - if (transform) mathMultiply(&vertices[i].pt, transform); - if (vertices[i].pt.y < ys) ys = vertices[i].pt.y; - if (vertices[i].pt.y > ye) ye = vertices[i].pt.y; - } - - auto aaSpans = _AASpans(ys, ye, image, region); - if (!aaSpans) return true; - - Polygon polygon; - - //Draw the first polygon - polygon.vertex[0] = vertices[0]; - polygon.vertex[1] = vertices[1]; - polygon.vertex[2] = vertices[3]; - - _rasterPolygonImage(surface, image, region, polygon, aaSpans, opacity); - - //Draw the second polygon - polygon.vertex[0] = vertices[1]; - polygon.vertex[1] = vertices[2]; - polygon.vertex[2] = vertices[3]; - - _rasterPolygonImage(surface, image, region, polygon, aaSpans, opacity); - -#if 0 - if (_compositing(surface) && _masking(surface) && !_direct(surface->compositor->method)) { - _compositeMaskImage(surface, &surface->compositor->image, surface->compositor->bbox); - } -#endif - return _apply(surface, aaSpans); -} - - -/* - Provide any number of triangles to draw a mesh using the supplied image. - Indexes are not used, so each triangle (Polygon) vertex has to be defined, even if they copy the previous one. - Example: - - 0 -- 1 0 -- 1 0 - | / | --> | / / | - | / | | / / | - 2 -- 3 2 1 -- 2 - - Should provide two Polygons, one for each triangle. - // TODO: region? -*/ -static bool _rasterTexmapPolygonMesh(SwSurface* surface, const SwImage* image, const RenderMesh* mesh, const Matrix* transform, const SwBBox* region, uint8_t opacity) -{ - if (surface->channelSize == sizeof(uint8_t)) { - TVGERR("SW_ENGINE", "Not supported grayscale Textmap polygon mesh!"); - return false; - } - - //Exceptions: No dedicated drawing area? - if ((!image->rle && !region) || (image->rle && image->rle->size == 0)) return false; - - // Step polygons once to transform - auto transformedTris = (Polygon*)malloc(sizeof(Polygon) * mesh->triangleCnt); - float ys = FLT_MAX, ye = -1.0f; - for (uint32_t i = 0; i < mesh->triangleCnt; i++) { - transformedTris[i] = mesh->triangles[i]; - mathMultiply(&transformedTris[i].vertex[0].pt, transform); - mathMultiply(&transformedTris[i].vertex[1].pt, transform); - mathMultiply(&transformedTris[i].vertex[2].pt, transform); - - if (transformedTris[i].vertex[0].pt.y < ys) ys = transformedTris[i].vertex[0].pt.y; - else if (transformedTris[i].vertex[0].pt.y > ye) ye = transformedTris[i].vertex[0].pt.y; - if (transformedTris[i].vertex[1].pt.y < ys) ys = transformedTris[i].vertex[1].pt.y; - else if (transformedTris[i].vertex[1].pt.y > ye) ye = transformedTris[i].vertex[1].pt.y; - if (transformedTris[i].vertex[2].pt.y < ys) ys = transformedTris[i].vertex[2].pt.y; - else if (transformedTris[i].vertex[2].pt.y > ye) ye = transformedTris[i].vertex[2].pt.y; - - // Convert normalized UV coordinates to image coordinates - transformedTris[i].vertex[0].uv.x *= (float)image->w; - transformedTris[i].vertex[0].uv.y *= (float)image->h; - transformedTris[i].vertex[1].uv.x *= (float)image->w; - transformedTris[i].vertex[1].uv.y *= (float)image->h; - transformedTris[i].vertex[2].uv.x *= (float)image->w; - transformedTris[i].vertex[2].uv.y *= (float)image->h; - } - - // Get AA spans and step polygons again to draw - if (auto aaSpans = _AASpans(ys, ye, image, region)) { - for (uint32_t i = 0; i < mesh->triangleCnt; i++) { - _rasterPolygonImage(surface, image, region, transformedTris[i], aaSpans, opacity); - } -#if 0 - if (_compositing(surface) && _masking(surface) && !_direct(surface->compositor->method)) { - _compositeMaskImage(surface, &surface->compositor->image, surface->compositor->bbox); - } -#endif - _apply(surface, aaSpans); - } - free(transformedTris); - return true; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRenderer.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRenderer.cpp deleted file mode 100644 index 9a09654..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRenderer.cpp +++ /dev/null @@ -1,859 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgMath.h" -#include "tvgSwCommon.h" -#include "tvgTaskScheduler.h" -#include "tvgSwRenderer.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ -static int32_t initEngineCnt = false; -static int32_t rendererCnt = 0; -static SwMpool* globalMpool = nullptr; -static uint32_t threadsCnt = 0; - -struct SwTask : Task -{ - SwSurface* surface = nullptr; - SwMpool* mpool = nullptr; - SwBBox bbox = {{0, 0}, {0, 0}}; //Whole Rendering Region - Matrix* transform = nullptr; - Array clips; - RenderUpdateFlag flags = RenderUpdateFlag::None; - uint8_t opacity; - bool pushed = false; //Pushed into task list? - bool disposed = false; //Disposed task? - - RenderRegion bounds() - { - //Can we skip the synchronization? - done(); - - RenderRegion region; - - //Range over? - region.x = bbox.min.x > 0 ? bbox.min.x : 0; - region.y = bbox.min.y > 0 ? bbox.min.y : 0; - region.w = bbox.max.x - region.x; - region.h = bbox.max.y - region.y; - if (region.w < 0) region.w = 0; - if (region.h < 0) region.h = 0; - - return region; - } - - virtual void dispose() = 0; - virtual bool clip(SwRleData* target) = 0; - virtual SwRleData* rle() = 0; - - virtual ~SwTask() - { - free(transform); - } -}; - - -struct SwShapeTask : SwTask -{ - SwShape shape; - const RenderShape* rshape = nullptr; - bool cmpStroking = false; - bool clipper = false; - - /* We assume that if the stroke width is greater than 2, - the shape's outline beneath the stroke could be adequately covered by the stroke drawing. - Therefore, antialiasing is disabled under this condition. - Additionally, the stroke style should not be dashed. */ - bool antialiasing(float strokeWidth) - { - return strokeWidth < 2.0f || rshape->stroke->dashCnt > 0 || rshape->stroke->strokeFirst; - } - - float validStrokeWidth() - { - if (!rshape->stroke) return 0.0f; - - auto width = rshape->stroke->width; - if (mathZero(width)) return 0.0f; - - if (!rshape->stroke->fill && (MULTIPLY(rshape->stroke->color[3], opacity) == 0)) return 0.0f; - if (mathZero(rshape->stroke->trim.begin - rshape->stroke->trim.end)) return 0.0f; - - if (transform) return (width * sqrt(transform->e11 * transform->e11 + transform->e12 * transform->e12)); - else return width; - } - - - bool clip(SwRleData* target) override - { - if (shape.fastTrack) rleClipRect(target, &bbox); - else if (shape.rle) rleClipPath(target, shape.rle); - else return false; - - return true; - } - - SwRleData* rle() override - { - if (!shape.rle && shape.fastTrack) { - shape.rle = rleRender(&shape.bbox); - } - return shape.rle; - } - - void run(unsigned tid) override - { - if (opacity == 0 && !clipper) return; //Invisible - - auto strokeWidth = validStrokeWidth(); - bool visibleFill = false; - auto clipRegion = bbox; - - //This checks also for the case, if the invisible shape turned to visible by alpha. - auto prepareShape = false; - if (!shapePrepared(&shape) && (flags & RenderUpdateFlag::Color)) prepareShape = true; - - //Shape - if (flags & (RenderUpdateFlag::Path | RenderUpdateFlag::Transform) || prepareShape) { - uint8_t alpha = 0; - rshape->fillColor(nullptr, nullptr, nullptr, &alpha); - alpha = MULTIPLY(alpha, opacity); - visibleFill = (alpha > 0 || rshape->fill); - if (visibleFill || clipper) { - shapeReset(&shape); - if (!shapePrepare(&shape, rshape, transform, clipRegion, bbox, mpool, tid, clips.count > 0 ? true : false)) { - visibleFill = false; - } - } - } - //Fill - if (flags & (RenderUpdateFlag::Gradient | RenderUpdateFlag::Transform | RenderUpdateFlag::Color)) { - if (visibleFill || clipper) { - if (!shapeGenRle(&shape, rshape, antialiasing(strokeWidth))) goto err; - } - if (auto fill = rshape->fill) { - auto ctable = (flags & RenderUpdateFlag::Gradient) ? true : false; - if (ctable) shapeResetFill(&shape); - if (!shapeGenFillColors(&shape, fill, transform, surface, opacity, ctable)) goto err; - } else { - shapeDelFill(&shape); - } - } - //Stroke - if (flags & (RenderUpdateFlag::Stroke | RenderUpdateFlag::Transform)) { - if (strokeWidth > 0.0f) { - shapeResetStroke(&shape, rshape, transform); - if (!shapeGenStrokeRle(&shape, rshape, transform, clipRegion, bbox, mpool, tid)) goto err; - - if (auto fill = rshape->strokeFill()) { - auto ctable = (flags & RenderUpdateFlag::GradientStroke) ? true : false; - if (ctable) shapeResetStrokeFill(&shape); - if (!shapeGenStrokeFillColors(&shape, fill, transform, surface, opacity, ctable)) goto err; - } else { - shapeDelStrokeFill(&shape); - } - } else { - shapeDelStroke(&shape); - } - } - - //Clear current task memorypool here if the clippers would use the same memory pool - shapeDelOutline(&shape, mpool, tid); - - //Clip Path - for (auto clip = clips.begin(); clip < clips.end(); ++clip) { - auto clipper = static_cast(*clip); - //Clip shape rle - if (shape.rle && !clipper->clip(shape.rle)) goto err; - //Clip stroke rle - if (shape.strokeRle && !clipper->clip(shape.strokeRle)) goto err; - } - return; - - err: - shapeReset(&shape); - shapeDelOutline(&shape, mpool, tid); - } - - void dispose() override - { - shapeFree(&shape); - } -}; - - -struct SwSceneTask : SwTask -{ - Array scene; //list of paints render data (SwTask) - SwRleData* sceneRle = nullptr; - - bool clip(SwRleData* target) override - { - //Only one shape - if (scene.count == 1) { - return static_cast(*scene.data)->clip(target); - } - - //More than one shapes - if (sceneRle) rleClipPath(target, sceneRle); - else TVGLOG("SW_ENGINE", "No clippers in a scene?"); - - return true; - } - - SwRleData* rle() override - { - return sceneRle; - } - - void run(unsigned tid) override - { - //TODO: Skip the run if the scene hasn't changed. - if (!sceneRle) sceneRle = static_cast(calloc(1, sizeof(SwRleData))); - else rleReset(sceneRle); - - //Merge shapes if it has more than one shapes - if (scene.count > 1) { - //Merge first two clippers - auto clipper1 = static_cast(*scene.data); - auto clipper2 = static_cast(*(scene.data + 1)); - - rleMerge(sceneRle, clipper1->rle(), clipper2->rle()); - - //Unify the remained clippers - for (auto rd = scene.begin() + 2; rd < scene.end(); ++rd) { - auto clipper = static_cast(*rd); - rleMerge(sceneRle, sceneRle, clipper->rle()); - } - } - } - - void dispose() override - { - rleFree(sceneRle); - } -}; - - -struct SwImageTask : SwTask -{ - SwImage image; - Surface* source; //Image source - const RenderMesh* mesh = nullptr; //Should be valid ptr in action - - bool clip(SwRleData* target) override - { - TVGERR("SW_ENGINE", "Image is used as ClipPath?"); - return true; - } - - SwRleData* rle() override - { - TVGERR("SW_ENGINE", "Image is used as Scene ClipPath?"); - return nullptr; - } - - void run(unsigned tid) override - { - auto clipRegion = bbox; - - //Convert colorspace if it's not aligned. - rasterConvertCS(source, surface->cs); - rasterPremultiply(source); - - image.data = source->data; - image.w = source->w; - image.h = source->h; - image.stride = source->stride; - image.channelSize = source->channelSize; - - //Invisible shape turned to visible by alpha. - if ((flags & (RenderUpdateFlag::Image | RenderUpdateFlag::Transform | RenderUpdateFlag::Color)) && (opacity > 0)) { - imageReset(&image); - if (!image.data || image.w == 0 || image.h == 0) goto end; - - if (!imagePrepare(&image, mesh, transform, clipRegion, bbox, mpool, tid)) goto end; - - // TODO: How do we clip the triangle mesh? Only clip non-meshed images for now - if (mesh->triangleCnt == 0 && clips.count > 0) { - if (!imageGenRle(&image, bbox, false)) goto end; - if (image.rle) { - //Clear current task memorypool here if the clippers would use the same memory pool - imageDelOutline(&image, mpool, tid); - for (auto clip = clips.begin(); clip < clips.end(); ++clip) { - auto clipper = static_cast(*clip); - if (!clipper->clip(image.rle)) goto err; - } - return; - } - } - } - goto end; - err: - rleReset(image.rle); - end: - imageDelOutline(&image, mpool, tid); - } - - void dispose() override - { - imageFree(&image); - } -}; - - -static void _termEngine() -{ - if (rendererCnt > 0) return; - - mpoolTerm(globalMpool); - globalMpool = nullptr; -} - - -static void _renderFill(SwShapeTask* task, SwSurface* surface, uint8_t opacity) -{ - uint8_t r, g, b, a; - if (auto fill = task->rshape->fill) { - rasterGradientShape(surface, &task->shape, fill->identifier()); - } else { - task->rshape->fillColor(&r, &g, &b, &a); - a = MULTIPLY(opacity, a); - if (a > 0) rasterShape(surface, &task->shape, r, g, b, a); - } -} - -static void _renderStroke(SwShapeTask* task, SwSurface* surface, uint8_t opacity) -{ - uint8_t r, g, b, a; - if (auto strokeFill = task->rshape->strokeFill()) { - rasterGradientStroke(surface, &task->shape, strokeFill->identifier()); - } else { - if (task->rshape->strokeColor(&r, &g, &b, &a)) { - a = MULTIPLY(opacity, a); - if (a > 0) rasterStroke(surface, &task->shape, r, g, b, a); - } - } -} - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -SwRenderer::~SwRenderer() -{ - clearCompositors(); - - delete(surface); - - if (!sharedMpool) mpoolTerm(mpool); - - --rendererCnt; - - if (rendererCnt == 0 && initEngineCnt == 0) _termEngine(); -} - - -bool SwRenderer::clear() -{ - for (auto task = tasks.begin(); task < tasks.end(); ++task) { - if ((*task)->disposed) { - delete(*task); - } else { - (*task)->done(); - (*task)->pushed = false; - } - } - tasks.clear(); - - if (!sharedMpool) mpoolClear(mpool); - - if (surface) { - vport.x = vport.y = 0; - vport.w = surface->w; - vport.h = surface->h; - } - - return true; -} - - -bool SwRenderer::sync() -{ - return true; -} - - -RenderRegion SwRenderer::viewport() -{ - return vport; -} - - -bool SwRenderer::viewport(const RenderRegion& vp) -{ - vport = vp; - return true; -} - - -bool SwRenderer::target(pixel_t* data, uint32_t stride, uint32_t w, uint32_t h, ColorSpace cs) -{ - if (!data || stride == 0 || w == 0 || h == 0 || w > stride) return false; - - clearCompositors(); - - if (!surface) surface = new SwSurface; - - surface->data = data; - surface->stride = stride; - surface->w = w; - surface->h = h; - surface->cs = cs; - surface->channelSize = CHANNEL_SIZE(cs); - surface->premultiplied = true; - - return rasterCompositor(surface); -} - - -bool SwRenderer::preRender() -{ - return true; -} - - -void SwRenderer::clearCompositors() -{ - //Free Composite Caches - for (auto comp = compositors.begin(); comp < compositors.end(); ++comp) { - free((*comp)->compositor->image.data); - delete((*comp)->compositor); - delete(*comp); - } - compositors.reset(); -} - - -bool SwRenderer::postRender() -{ - //Unmultiply alpha if needed - if (surface->cs == ColorSpace::ABGR8888S || surface->cs == ColorSpace::ARGB8888S) { - rasterUnpremultiply(surface); - } - - for (auto task = tasks.begin(); task < tasks.end(); ++task) { - if ((*task)->disposed) delete(*task); - else (*task)->pushed = false; - } - tasks.clear(); - - return true; -} - - -bool SwRenderer::renderImage(RenderData data) -{ - auto task = static_cast(data); - task->done(); - - if (task->opacity == 0) return true; - - return rasterImage(surface, &task->image, task->mesh, task->transform, task->bbox, task->opacity); -} - - -bool SwRenderer::renderShape(RenderData data) -{ - auto task = static_cast(data); - if (!task) return false; - - task->done(); - - if (task->opacity == 0) return true; - - //Main raster stage - if (task->rshape->stroke && task->rshape->stroke->strokeFirst) { - _renderStroke(task, surface, task->opacity); - _renderFill(task, surface, task->opacity); - } else { - _renderFill(task, surface, task->opacity); - _renderStroke(task, surface, task->opacity); - } - - return true; -} - - -bool SwRenderer::blend(BlendMethod method) -{ - if (surface->blendMethod == method) return true; - surface->blendMethod = method; - - switch (method) { - case BlendMethod::Add: - surface->blender = opBlendAdd; - break; - case BlendMethod::Screen: - surface->blender = opBlendScreen; - break; - case BlendMethod::Multiply: - surface->blender = opBlendMultiply; - break; - case BlendMethod::Overlay: - surface->blender = opBlendOverlay; - break; - case BlendMethod::Difference: - surface->blender = opBlendDifference; - break; - case BlendMethod::Exclusion: - surface->blender = opBlendExclusion; - break; - case BlendMethod::SrcOver: - surface->blender = opBlendSrcOver; - break; - case BlendMethod::Darken: - surface->blender = opBlendDarken; - break; - case BlendMethod::Lighten: - surface->blender = opBlendLighten; - break; - case BlendMethod::ColorDodge: - surface->blender = opBlendColorDodge; - break; - case BlendMethod::ColorBurn: - surface->blender = opBlendColorBurn; - break; - case BlendMethod::HardLight: - surface->blender = opBlendHardLight; - break; - case BlendMethod::SoftLight: - surface->blender = opBlendSoftLight; - break; - default: - surface->blender = nullptr; - break; - } - return false; -} - - -RenderRegion SwRenderer::region(RenderData data) -{ - return static_cast(data)->bounds(); -} - - -bool SwRenderer::beginComposite(Compositor* cmp, CompositeMethod method, uint8_t opacity) -{ - if (!cmp) return false; - auto p = static_cast(cmp); - - p->method = method; - p->opacity = opacity; - - //Current Context? - if (p->method != CompositeMethod::None) { - surface = p->recoverSfc; - surface->compositor = p; - } - - return true; -} - - -bool SwRenderer::mempool(bool shared) -{ - if (shared == sharedMpool) return true; - - if (shared) { - if (!sharedMpool) { - if (!mpoolTerm(mpool)) return false; - mpool = globalMpool; - } - } else { - if (sharedMpool) mpool = mpoolInit(threadsCnt); - } - - sharedMpool = shared; - - if (mpool) return true; - return false; -} - - -const Surface* SwRenderer::mainSurface() -{ - return surface; -} - - -Compositor* SwRenderer::target(const RenderRegion& region, ColorSpace cs) -{ - auto x = region.x; - auto y = region.y; - auto w = region.w; - auto h = region.h; - auto sw = static_cast(surface->w); - auto sh = static_cast(surface->h); - - //Out of boundary - if (x >= sw || y >= sh || x + w < 0 || y + h < 0) return nullptr; - - SwSurface* cmp = nullptr; - - auto reqChannelSize = CHANNEL_SIZE(cs); - - //Use cached data - for (auto p = compositors.begin(); p < compositors.end(); ++p) { - if ((*p)->compositor->valid && (*p)->compositor->image.channelSize == reqChannelSize) { - cmp = *p; - break; - } - } - - //New Composition - if (!cmp) { - //Inherits attributes from main surface - cmp = new SwSurface(surface); - cmp->compositor = new SwCompositor; - - //TODO: We can optimize compositor surface size from (surface->stride x surface->h) to Parameter(w x h) - cmp->compositor->image.data = (pixel_t*)malloc(reqChannelSize * surface->stride * surface->h); - cmp->channelSize = cmp->compositor->image.channelSize = reqChannelSize; - - compositors.push(cmp); - } - - //Boundary Check - if (x + w > sw) w = (sw - x); - if (y + h > sh) h = (sh - y); - - cmp->compositor->recoverSfc = surface; - cmp->compositor->recoverCmp = surface->compositor; - cmp->compositor->valid = false; - cmp->compositor->bbox.min.x = x; - cmp->compositor->bbox.min.y = y; - cmp->compositor->bbox.max.x = x + w; - cmp->compositor->bbox.max.y = y + h; - cmp->compositor->image.stride = surface->stride; - cmp->compositor->image.w = surface->w; - cmp->compositor->image.h = surface->h; - cmp->compositor->image.direct = true; - - cmp->data = cmp->compositor->image.data; - cmp->w = cmp->compositor->image.w; - cmp->h = cmp->compositor->image.h; - - rasterClear(cmp, x, y, w, h); - - //Switch render target - surface = cmp; - - return cmp->compositor; -} - - -bool SwRenderer::endComposite(Compositor* cmp) -{ - if (!cmp) return false; - - auto p = static_cast(cmp); - p->valid = true; - - //Recover Context - surface = p->recoverSfc; - surface->compositor = p->recoverCmp; - - //Default is alpha blending - if (p->method == CompositeMethod::None) { - return rasterImage(surface, &p->image, nullptr, nullptr, p->bbox, p->opacity); - } - - return true; -} - - -ColorSpace SwRenderer::colorSpace() -{ - if (surface) return surface->cs; - else return ColorSpace::Unsupported; -} - - -void SwRenderer::dispose(RenderData data) -{ - auto task = static_cast(data); - if (!task) return; - task->done(); - task->dispose(); - - if (task->pushed) task->disposed = true; - else delete(task); -} - - -void* SwRenderer::prepareCommon(SwTask* task, const RenderTransform* transform, const Array& clips, uint8_t opacity, RenderUpdateFlag flags) -{ - if (!surface) return task; - if (flags == RenderUpdateFlag::None) return task; - - //Finish previous task if it has duplicated request. - task->done(); - - //TODO: Failed threading them. It would be better if it's possible. - //See: https://github.com/thorvg/thorvg/issues/1409 - //Guarantee composition targets get ready. - for (auto clip = clips.begin(); clip < clips.end(); ++clip) { - static_cast(*clip)->done(); - } - - task->clips = clips; - - if (transform) { - if (!task->transform) task->transform = static_cast(malloc(sizeof(Matrix))); - *task->transform = transform->m; - } else { - if (task->transform) free(task->transform); - task->transform = nullptr; - } - - //zero size? - if (task->transform) { - if (task->transform->e11 == 0.0f && task->transform->e12 == 0.0f) return task; //zero width - if (task->transform->e21 == 0.0f && task->transform->e22 == 0.0f) return task; //zero height - } - - task->opacity = opacity; - task->surface = surface; - task->mpool = mpool; - task->flags = flags; - task->bbox.min.x = mathMax(static_cast(0), static_cast(vport.x)); - task->bbox.min.y = mathMax(static_cast(0), static_cast(vport.y)); - task->bbox.max.x = mathMin(static_cast(surface->w), static_cast(vport.x + vport.w)); - task->bbox.max.y = mathMin(static_cast(surface->h), static_cast(vport.y + vport.h)); - - if (!task->pushed) { - task->pushed = true; - tasks.push(task); - } - - TaskScheduler::request(task); - - return task; -} - - -RenderData SwRenderer::prepare(Surface* surface, const RenderMesh* mesh, RenderData data, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag flags) -{ - //prepare task - auto task = static_cast(data); - if (!task) task = new SwImageTask; - task->source = surface; - task->mesh = mesh; - return prepareCommon(task, transform, clips, opacity, flags); -} - - -RenderData SwRenderer::prepare(const Array& scene, RenderData data, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag flags) -{ - //prepare task - auto task = static_cast(data); - if (!task) task = new SwSceneTask; - task->scene = scene; - - //TODO: Failed threading them. It would be better if it's possible. - //See: https://github.com/thorvg/thorvg/issues/1409 - //Guarantee composition targets get ready. - for (auto task = scene.begin(); task < scene.end(); ++task) { - static_cast(*task)->done(); - } - return prepareCommon(task, transform, clips, opacity, flags); -} - - -RenderData SwRenderer::prepare(const RenderShape& rshape, RenderData data, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag flags, bool clipper) -{ - //prepare task - auto task = static_cast(data); - if (!task) { - task = new SwShapeTask; - task->rshape = &rshape; - } - task->clipper = clipper; - - return prepareCommon(task, transform, clips, opacity, flags); -} - - -SwRenderer::SwRenderer():mpool(globalMpool) -{ -} - - -bool SwRenderer::init(uint32_t threads) -{ - if ((initEngineCnt++) > 0) return true; - - threadsCnt = threads; - - //Share the memory pool among the renderer - globalMpool = mpoolInit(threads); - if (!globalMpool) { - --initEngineCnt; - return false; - } - - return true; -} - - -int32_t SwRenderer::init() -{ - return initEngineCnt; -} - - -bool SwRenderer::term() -{ - if ((--initEngineCnt) > 0) return true; - - initEngineCnt = 0; - - _termEngine(); - - return true; -} - -SwRenderer* SwRenderer::gen() -{ - ++rendererCnt; - return new SwRenderer(); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRenderer.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRenderer.h deleted file mode 100644 index 593ba52..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRenderer.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SW_RENDERER_H_ -#define _TVG_SW_RENDERER_H_ - -#include "tvgRender.h" - -struct SwSurface; -struct SwTask; -struct SwCompositor; -struct SwMpool; - -namespace tvg -{ - -class SwRenderer : public RenderMethod -{ -public: - RenderData prepare(const RenderShape& rshape, RenderData data, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag flags, bool clipper) override; - RenderData prepare(const Array& scene, RenderData data, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag flags) override; - RenderData prepare(Surface* surface, const RenderMesh* mesh, RenderData data, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag flags) override; - bool preRender() override; - bool renderShape(RenderData data) override; - bool renderImage(RenderData data) override; - bool postRender() override; - void dispose(RenderData data) override; - RenderRegion region(RenderData data) override; - RenderRegion viewport() override; - bool viewport(const RenderRegion& vp) override; - bool blend(BlendMethod method) override; - ColorSpace colorSpace() override; - const Surface* mainSurface() override; - - bool clear() override; - bool sync() override; - bool target(pixel_t* data, uint32_t stride, uint32_t w, uint32_t h, ColorSpace cs); - bool mempool(bool shared); - - Compositor* target(const RenderRegion& region, ColorSpace cs) override; - bool beginComposite(Compositor* cmp, CompositeMethod method, uint8_t opacity) override; - bool endComposite(Compositor* cmp) override; - void clearCompositors(); - - static SwRenderer* gen(); - static bool init(uint32_t threads); - static int32_t init(); - static bool term(); - -private: - SwSurface* surface = nullptr; //active surface - Array tasks; //async task list - Array compositors; //render targets cache list - SwMpool* mpool; //private memory pool - RenderRegion vport; //viewport - bool sharedMpool = true; //memory-pool behavior policy - - SwRenderer(); - ~SwRenderer(); - - RenderData prepareCommon(SwTask* task, const RenderTransform* transform, const Array& clips, uint8_t opacity, RenderUpdateFlag flags); -}; - -} - -#endif /* _TVG_SW_RENDERER_H_ */ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRle.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRle.cpp deleted file mode 100644 index 689f2fe..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwRle.cpp +++ /dev/null @@ -1,1134 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -/* - * The FreeType Project LICENSE - * ---------------------------- - - * 2006-Jan-27 - - * Copyright 1996-2002, 2006 by - * David Turner, Robert Wilhelm, and Werner Lemberg - - - - * Introduction - * ============ - - * The FreeType Project is distributed in several archive packages; - * some of them may contain, in addition to the FreeType font engine, - * various tools and contributions which rely on, or relate to, the - * FreeType Project. - - * This license applies to all files found in such packages, and - * which do not fall under their own explicit license. The license - * affects thus the FreeType font engine, the test programs, - * documentation and makefiles, at the very least. - - * This license was inspired by the BSD, Artistic, and IJG - * (Independent JPEG Group) licenses, which all encourage inclusion - * and use of free software in commercial and freeware products - * alike. As a consequence, its main points are that: - - * o We don't promise that this software works. However, we will be - * interested in any kind of bug reports. (`as is' distribution) - - * o You can use this software for whatever you want, in parts or - * full form, without having to pay us. (`royalty-free' usage) - - * o You may not pretend that you wrote this software. If you use - * it, or only parts of it, in a program, you must acknowledge - * somewhere in your documentation that you have used the - * FreeType code. (`credits') - - * We specifically permit and encourage the inclusion of this - * software, with or without modifications, in commercial products. - * We disclaim all warranties covering The FreeType Project and - * assume no liability related to The FreeType Project. - - - * Finally, many people asked us for a preferred form for a - * credit/disclaimer to use in compliance with this license. We thus - * encourage you to use the following text: - - * """ - * Portions of this software are copyright � The FreeType - * Project (www.freetype.org). All rights reserved. - * """ - - * Please replace with the value from the FreeType version you - * actually use. - -* Legal Terms -* =========== - -* 0. Definitions -* -------------- - -* Throughout this license, the terms `package', `FreeType Project', -* and `FreeType archive' refer to the set of files originally -* distributed by the authors (David Turner, Robert Wilhelm, and -* Werner Lemberg) as the `FreeType Project', be they named as alpha, -* beta or final release. - -* `You' refers to the licensee, or person using the project, where -* `using' is a generic term including compiling the project's source -* code as well as linking it to form a `program' or `executable'. -* This program is referred to as `a program using the FreeType -* engine'. - -* This license applies to all files distributed in the original -* FreeType Project, including all source code, binaries and -* documentation, unless otherwise stated in the file in its -* original, unmodified form as distributed in the original archive. -* If you are unsure whether or not a particular file is covered by -* this license, you must contact us to verify this. - -* The FreeType Project is copyright (C) 1996-2000 by David Turner, -* Robert Wilhelm, and Werner Lemberg. All rights reserved except as -* specified below. - -* 1. No Warranty -* -------------- - -* THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY -* KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -* PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS -* BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO -* USE, OF THE FREETYPE PROJECT. - -* 2. Redistribution -* ----------------- - -* This license grants a worldwide, royalty-free, perpetual and -* irrevocable right and license to use, execute, perform, compile, -* display, copy, create derivative works of, distribute and -* sublicense the FreeType Project (in both source and object code -* forms) and derivative works thereof for any purpose; and to -* authorize others to exercise some or all of the rights granted -* herein, subject to the following conditions: - -* o Redistribution of source code must retain this license file -* (`FTL.TXT') unaltered; any additions, deletions or changes to -* the original files must be clearly indicated in accompanying -* documentation. The copyright notices of the unaltered, -* original files must be preserved in all copies of source -* files. - -* o Redistribution in binary form must provide a disclaimer that -* states that the software is based in part of the work of the -* FreeType Team, in the distribution documentation. We also -* encourage you to put an URL to the FreeType web page in your -* documentation, though this isn't mandatory. - -* These conditions apply to any software derived from or based on -* the FreeType Project, not just the unmodified files. If you use -* our work, you must acknowledge us. However, no fee need be paid -* to us. - -* 3. Advertising -* -------------- - -* Neither the FreeType authors and contributors nor you shall use -* the name of the other for commercial, advertising, or promotional -* purposes without specific prior written permission. - -* We suggest, but do not require, that you use one or more of the -* following phrases to refer to this software in your documentation -* or advertising materials: `FreeType Project', `FreeType Engine', -* `FreeType library', or `FreeType Distribution'. - -* As you have not signed this license, you are not required to -* accept it. However, as the FreeType Project is copyrighted -* material, only this license, or another one contracted with the -* authors, grants you the right to use, distribute, and modify it. -* Therefore, by using, distributing, or modifying the FreeType -* Project, you indicate that you understand and accept all the terms -* of this license. - -* 4. Contacts -* ----------- - -* There are two mailing lists related to FreeType: - -* o freetype@nongnu.org - -* Discusses general use and applications of FreeType, as well as -* future and wanted additions to the library and distribution. -* If you are looking for support, start in this list if you -* haven't found anything to help you in the documentation. - -* o freetype-devel@nongnu.org - -* Discusses bugs, as well as engine internals, design issues, -* specific licenses, porting, etc. - -* Our home page can be found at - -* http://www.freetype.org -*/ - -#include -#include -#include -#include "tvgSwCommon.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -constexpr auto MAX_SPANS = 256; -constexpr auto PIXEL_BITS = 8; //must be at least 6 bits! -constexpr auto ONE_PIXEL = (1L << PIXEL_BITS); - -using Area = long; - -struct Band -{ - SwCoord min, max; -}; - -struct Cell -{ - SwCoord x; - SwCoord cover; - Area area; - Cell *next; -}; - -struct RleWorker -{ - SwRleData* rle; - - SwPoint cellPos; - SwPoint cellMin; - SwPoint cellMax; - SwCoord cellXCnt; - SwCoord cellYCnt; - - Area area; - SwCoord cover; - - Cell* cells; - ptrdiff_t maxCells; - ptrdiff_t cellsCnt; - - SwPoint pos; - - SwPoint bezStack[32 * 3 + 1]; - int levStack[32]; - - SwOutline* outline; - - SwSpan spans[MAX_SPANS]; - int spansCnt; - int ySpan; - - int bandSize; - int bandShoot; - - jmp_buf jmpBuf; - - void* buffer; - long bufferSize; - - Cell** yCells; - SwCoord yCnt; - - bool invalid; - bool antiAlias; -}; - - -static inline SwPoint UPSCALE(const SwPoint& pt) -{ - return {SwCoord(((unsigned long) pt.x) << (PIXEL_BITS - 6)), SwCoord(((unsigned long) pt.y) << (PIXEL_BITS - 6))}; -} - - -static inline SwPoint TRUNC(const SwPoint& pt) -{ - return {pt.x >> PIXEL_BITS, pt.y >> PIXEL_BITS}; -} - - -static inline SwCoord TRUNC(const SwCoord x) -{ - return x >> PIXEL_BITS; -} - - -static inline SwPoint SUBPIXELS(const SwPoint& pt) -{ - return {SwCoord(((unsigned long) pt.x) << PIXEL_BITS), SwCoord(((unsigned long) pt.y) << PIXEL_BITS)}; -} - - -static inline SwCoord SUBPIXELS(const SwCoord x) -{ - return SwCoord(((unsigned long) x) << PIXEL_BITS); -} - -/* - * Approximate sqrt(x*x+y*y) using the `alpha max plus beta min' - * algorithm. We use alpha = 1, beta = 3/8, giving us results with a - * largest error less than 7% compared to the exact value. - */ -static inline SwCoord HYPOT(SwPoint pt) -{ - if (pt.x < 0) pt.x = -pt.x; - if (pt.y < 0) pt.y = -pt.y; - return ((pt.x > pt.y) ? (pt.x + (3 * pt.y >> 3)) : (pt.y + (3 * pt.x >> 3))); -} - -static void _genSpan(SwRleData* rle, const SwSpan* spans, uint32_t count) -{ - auto newSize = rle->size + count; - - /* allocate enough memory for new spans */ - /* alloc is required to prevent free and reallocation */ - /* when the rle needs to be regenerated because of attribute change. */ - if (rle->alloc < newSize) { - rle->alloc = (newSize * 2); - //OPTIMIZE: use mempool! - rle->spans = static_cast(realloc(rle->spans, rle->alloc * sizeof(SwSpan))); - } - - //copy the new spans to the allocated memory - SwSpan* lastSpan = rle->spans + rle->size; - memcpy(lastSpan, spans, count * sizeof(SwSpan)); - - rle->size = newSize; -} - - -static void _horizLine(RleWorker& rw, SwCoord x, SwCoord y, SwCoord area, SwCoord aCount) -{ - x += rw.cellMin.x; - y += rw.cellMin.y; - - //Clip Y range - if (y < rw.cellMin.y || y >= rw.cellMax.y) return; - - /* compute the coverage line's coverage, depending on the outline fill rule */ - /* the coverage percentage is area/(PIXEL_BITS*PIXEL_BITS*2) */ - auto coverage = static_cast(area >> (PIXEL_BITS * 2 + 1 - 8)); //range 0 - 255 - - if (coverage < 0) coverage = -coverage; - - if (rw.outline->fillRule == FillRule::EvenOdd) { - coverage &= 511; - if (coverage > 255) coverage = 511 - coverage; - } else { - //normal non-zero winding rule - if (coverage > 255) coverage = 255; - } - - //span has ushort coordinates. check limit overflow - if (x >= SHRT_MAX) { - TVGERR("SW_ENGINE", "X-coordinate overflow!"); - x = SHRT_MAX; - } - if (y >= SHRT_MAX) { - TVGERR("SW_ENGINE", "Y Coordinate overflow!"); - y = SHRT_MAX; - } - - if (coverage > 0) { - if (!rw.antiAlias) coverage = 255; - auto count = rw.spansCnt; - auto span = rw.spans + count - 1; - - //see whether we can add this span to the current list - if ((count > 0) && (rw.ySpan == y) && - (span->x + span->len == x) && (span->coverage == coverage)) { - - //Clip x range - SwCoord xOver = 0; - if (x + aCount >= rw.cellMax.x) xOver -= (x + aCount - rw.cellMax.x); - if (x < rw.cellMin.x) xOver -= (rw.cellMin.x - x); - - //span->len += (aCount + xOver) - 1; - span->len += (aCount + xOver); - return; - } - - if (count >= MAX_SPANS) { - _genSpan(rw.rle, rw.spans, count); - rw.spansCnt = 0; - rw.ySpan = 0; - span = rw.spans; - } else { - ++span; - } - - //Clip x range - SwCoord xOver = 0; - if (x + aCount >= rw.cellMax.x) xOver -= (x + aCount - rw.cellMax.x); - if (x < rw.cellMin.x) { - xOver -= (rw.cellMin.x - x); - x = rw.cellMin.x; - } - - //Nothing to draw - if (aCount + xOver <= 0) return; - - //add a span to the current list - span->x = x; - span->y = y; - span->len = (aCount + xOver); - span->coverage = coverage; - ++rw.spansCnt; - rw.ySpan = y; - } -} - - -static void _sweep(RleWorker& rw) -{ - if (rw.cellsCnt == 0) return; - - rw.spansCnt = 0; - rw.ySpan = 0; - - for (int y = 0; y < rw.yCnt; ++y) { - auto cover = 0; - auto x = 0; - auto cell = rw.yCells[y]; - - while (cell) { - if (cell->x > x && cover != 0) _horizLine(rw, x, y, cover * (ONE_PIXEL * 2), cell->x - x); - cover += cell->cover; - auto area = cover * (ONE_PIXEL * 2) - cell->area; - if (area != 0 && cell->x >= 0) _horizLine(rw, cell->x, y, area, 1); - x = cell->x + 1; - cell = cell->next; - } - - if (cover != 0) _horizLine(rw, x, y, cover * (ONE_PIXEL * 2), rw.cellXCnt - x); - } - - if (rw.spansCnt > 0) _genSpan(rw.rle, rw.spans, rw.spansCnt); -} - - -static Cell* _findCell(RleWorker& rw) -{ - auto x = rw.cellPos.x; - if (x > rw.cellXCnt) x = rw.cellXCnt; - - auto pcell = &rw.yCells[rw.cellPos.y]; - - while(true) { - Cell* cell = *pcell; - if (!cell || cell->x > x) break; - if (cell->x == x) return cell; - pcell = &cell->next; - } - - if (rw.cellsCnt >= rw.maxCells) longjmp(rw.jmpBuf, 1); - - auto cell = rw.cells + rw.cellsCnt++; - cell->x = x; - cell->area = 0; - cell->cover = 0; - cell->next = *pcell; - *pcell = cell; - - return cell; -} - - -static void _recordCell(RleWorker& rw) -{ - if (rw.area | rw.cover) { - auto cell = _findCell(rw); - cell->area += rw.area; - cell->cover += rw.cover; - } -} - - -static void _setCell(RleWorker& rw, SwPoint pos) -{ - /* Move the cell pointer to a new position. We set the `invalid' */ - /* flag to indicate that the cell isn't part of those we're interested */ - /* in during the render phase. This means that: */ - /* */ - /* . the new vertical position must be within min_ey..max_ey-1. */ - /* . the new horizontal position must be strictly less than max_ex */ - /* */ - /* Note that if a cell is to the left of the clipping region, it is */ - /* actually set to the (min_ex-1) horizontal position. */ - - /* All cells that are on the left of the clipping region go to the - min_ex - 1 horizontal position. */ - pos.x -= rw.cellMin.x; - pos.y -= rw.cellMin.y; - - if (pos.x > rw.cellMax.x) pos.x = rw.cellMax.x; - - //Are we moving to a different cell? - if (pos != rw.cellPos) { - //Record the current one if it is valid - if (!rw.invalid) _recordCell(rw); - } - - rw.area = 0; - rw.cover = 0; - rw.cellPos = pos; - rw.invalid = ((unsigned)pos.y >= (unsigned)rw.cellYCnt || pos.x >= rw.cellXCnt); -} - - -static void _startCell(RleWorker& rw, SwPoint pos) -{ - if (pos.x > rw.cellMax.x) pos.x = rw.cellMax.x; - if (pos.x < rw.cellMin.x) pos.x = rw.cellMin.x; - - rw.area = 0; - rw.cover = 0; - rw.cellPos = pos - rw.cellMin; - rw.invalid = false; - - _setCell(rw, pos); -} - - -static void _moveTo(RleWorker& rw, const SwPoint& to) -{ - //record current cell, if any */ - if (!rw.invalid) _recordCell(rw); - - //start to a new position - _startCell(rw, TRUNC(to)); - - rw.pos = to; -} - - -static void _lineTo(RleWorker& rw, const SwPoint& to) -{ -#define SW_UDIV(a, b) \ - static_cast(((unsigned long)(a) * (unsigned long)(b)) >> \ - (sizeof(long) * CHAR_BIT - PIXEL_BITS)) - - auto e1 = TRUNC(rw.pos); - auto e2 = TRUNC(to); - - //vertical clipping - if ((e1.y >= rw.cellMax.y && e2.y >= rw.cellMax.y) || (e1.y < rw.cellMin.y && e2.y < rw.cellMin.y)) { - rw.pos = to; - return; - } - - auto diff = to - rw.pos; - auto f1 = rw.pos - SUBPIXELS(e1); - SwPoint f2; - - //inside one cell - if (e1 == e2) { - ; - //any horizontal line - } else if (diff.y == 0) { - e1.x = e2.x; - _setCell(rw, e1); - } else if (diff.x == 0) { - //vertical line up - if (diff.y > 0) { - do { - f2.y = ONE_PIXEL; - rw.cover += (f2.y - f1.y); - rw.area += (f2.y - f1.y) * f1.x * 2; - f1.y = 0; - ++e1.y; - _setCell(rw, e1); - } while(e1.y != e2.y); - //vertical line down - } else { - do { - f2.y = 0; - rw.cover += (f2.y - f1.y); - rw.area += (f2.y - f1.y) * f1.x * 2; - f1.y = ONE_PIXEL; - --e1.y; - _setCell(rw, e1); - } while(e1.y != e2.y); - } - //any other line - } else { - Area prod = diff.x * f1.y - diff.y * f1.x; - - /* These macros speed up repetitive divisions by replacing them - with multiplications and right shifts. */ - auto dx_r = static_cast(ULONG_MAX >> PIXEL_BITS) / (diff.x); - auto dy_r = static_cast(ULONG_MAX >> PIXEL_BITS) / (diff.y); - - /* The fundamental value `prod' determines which side and the */ - /* exact coordinate where the line exits current cell. It is */ - /* also easily updated when moving from one cell to the next. */ - do { - auto px = diff.x * ONE_PIXEL; - auto py = diff.y * ONE_PIXEL; - - //left - if (prod <= 0 && prod - px > 0) { - f2 = {0, SW_UDIV(-prod, -dx_r)}; - prod -= py; - rw.cover += (f2.y - f1.y); - rw.area += (f2.y - f1.y) * (f1.x + f2.x); - f1 = {ONE_PIXEL, f2.y}; - --e1.x; - //up - } else if (prod - px <= 0 && prod - px + py > 0) { - prod -= px; - f2 = {SW_UDIV(-prod, dy_r), ONE_PIXEL}; - rw.cover += (f2.y - f1.y); - rw.area += (f2.y - f1.y) * (f1.x + f2.x); - f1 = {f2.x, 0}; - ++e1.y; - //right - } else if (prod - px + py <= 0 && prod + py >= 0) { - prod += py; - f2 = {ONE_PIXEL, SW_UDIV(prod, dx_r)}; - rw.cover += (f2.y - f1.y); - rw.area += (f2.y - f1.y) * (f1.x + f2.x); - f1 = {0, f2.y}; - ++e1.x; - //down - } else { - f2 = {SW_UDIV(prod, -dy_r), 0}; - prod += px; - rw.cover += (f2.y - f1.y); - rw.area += (f2.y - f1.y) * (f1.x + f2.x); - f1 = {f2.x, ONE_PIXEL}; - --e1.y; - } - - _setCell(rw, e1); - - } while(e1 != e2); - } - - f2 = {to.x - SUBPIXELS(e2.x), to.y - SUBPIXELS(e2.y)}; - rw.cover += (f2.y - f1.y); - rw.area += (f2.y - f1.y) * (f1.x + f2.x); - rw.pos = to; -} - - -static void _cubicTo(RleWorker& rw, const SwPoint& ctrl1, const SwPoint& ctrl2, const SwPoint& to) -{ - auto arc = rw.bezStack; - arc[0] = to; - arc[1] = ctrl2; - arc[2] = ctrl1; - arc[3] = rw.pos; - - //Short-cut the arc that crosses the current band - auto min = arc[0].y; - auto max = arc[0].y; - - SwCoord y; - for (auto i = 1; i < 4; ++i) { - y = arc[i].y; - if (y < min) min = y; - if (y > max) max = y; - } - - if (TRUNC(min) >= rw.cellMax.y || TRUNC(max) < rw.cellMin.y) goto draw; - - /* Decide whether to split or draw. See `Rapid Termination */ - /* Evaluation for Recursive Subdivision of Bezier Curves' by Thomas */ - /* F. Hain, at */ - /* http://www.cis.southalabama.edu/~hain/general/Publications/Bezier/Camera-ready%20CISST02%202.pdf */ - while (true) { - { - //diff is the P0 - P3 chord vector - auto diff = arc[3] - arc[0]; - auto L = HYPOT(diff); - - //avoid possible arithmetic overflow below by splitting - if (L > SHRT_MAX) goto split; - - //max deviation may be as much as (s/L) * 3/4 (if Hain's v = 1) - auto sLimit = L * (ONE_PIXEL / 6); - - auto diff1 = arc[1] - arc[0]; - auto s = diff.y * diff1.x - diff.x * diff1.y; - if (s < 0) s = -s; - if (s > sLimit) goto split; - - //s is L * the perpendicular distance from P2 to the line P0 - P3 - auto diff2 = arc[2] - arc[0]; - s = diff.y * diff2.x - diff.x * diff2.y; - if (s < 0) s = -s; - if (s > sLimit) goto split; - - /* Split super curvy segments where the off points are so far - from the chord that the angles P0-P1-P3 or P0-P2-P3 become - acute as detected by appropriate dot products */ - if (diff1.x * (diff1.x - diff.x) + diff1.y * (diff1.y - diff.y) > 0 || - diff2.x * (diff2.x - diff.x) + diff2.y * (diff2.y - diff.y) > 0) - goto split; - - //no reason to split - goto draw; - } - split: - mathSplitCubic(arc); - arc += 3; - continue; - - draw: - _lineTo(rw, arc[0]); - if (arc == rw.bezStack) return; - arc -= 3; - } -} - - -static void _decomposeOutline(RleWorker& rw) -{ - auto outline = rw.outline; - auto first = 0; //index of first point in contour - - for (auto cntr = outline->cntrs.begin(); cntr < outline->cntrs.end(); ++cntr) { - auto last = *cntr; - auto limit = outline->pts.data + last; - auto start = UPSCALE(outline->pts[first]); - auto pt = outline->pts.data + first; - auto types = outline->types.data + first; - - _moveTo(rw, UPSCALE(outline->pts[first])); - - while (pt < limit) { - ++pt; - ++types; - - //emit a single line_to - if (types[0] == SW_CURVE_TYPE_POINT) { - _lineTo(rw, UPSCALE(*pt)); - //types cubic - } else { - pt += 2; - types += 2; - - if (pt <= limit) { - _cubicTo(rw, UPSCALE(pt[-2]), UPSCALE(pt[-1]), UPSCALE(pt[0])); - continue; - } - _cubicTo(rw, UPSCALE(pt[-2]), UPSCALE(pt[-1]), start); - goto close; - } - } - _lineTo(rw, start); - close: - first = last + 1; - } -} - - -static int _genRle(RleWorker& rw) -{ - if (setjmp(rw.jmpBuf) == 0) { - _decomposeOutline(rw); - if (!rw.invalid) _recordCell(rw); - return 0; - } - return -1; //lack of cell memory -} - - -static SwSpan* _intersectSpansRegion(const SwRleData *clip, const SwRleData *target, SwSpan *outSpans, uint32_t outSpansCnt) -{ - auto out = outSpans; - auto spans = target->spans; - auto end = target->spans + target->size; - auto clipSpans = clip->spans; - auto clipEnd = clip->spans + clip->size; - - while (spans < end && clipSpans < clipEnd) { - //align y coordinates. - if (clipSpans->y > spans->y) { - ++spans; - continue; - } - if (spans->y > clipSpans->y) { - ++clipSpans; - continue; - } - - //Try clipping with all clip spans which have a same y coordinate. - auto temp = clipSpans; - while(temp < clipEnd && outSpansCnt > 0 && temp->y == clipSpans->y) { - auto sx1 = spans->x; - auto sx2 = sx1 + spans->len; - auto cx1 = temp->x; - auto cx2 = cx1 + temp->len; - - //The span must be left(x1) to right(x2) direction. Not intersected. - if (cx2 < sx1 || sx2 < cx1) { - ++temp; - continue; - } - - //clip span region. - auto x = sx1 > cx1 ? sx1 : cx1; - auto len = (sx2 < cx2 ? sx2 : cx2) - x; - if (len > 0) { - out->x = x; - out->y = temp->y; - out->len = len; - out->coverage = (uint8_t)(((spans->coverage * temp->coverage) + 0xff) >> 8); - ++out; - --outSpansCnt; - } - ++temp; - } - ++spans; - } - return out; -} - - -static SwSpan* _intersectSpansRect(const SwBBox *bbox, const SwRleData *targetRle, SwSpan *outSpans, uint32_t outSpansCnt) -{ - auto out = outSpans; - auto spans = targetRle->spans; - auto end = targetRle->spans + targetRle->size; - auto minx = static_cast(bbox->min.x); - auto miny = static_cast(bbox->min.y); - auto maxx = minx + static_cast(bbox->max.x - bbox->min.x) - 1; - auto maxy = miny + static_cast(bbox->max.y - bbox->min.y) - 1; - - while (outSpansCnt > 0 && spans < end) { - if (spans->y > maxy) { - spans = end; - break; - } - if (spans->y < miny || spans->x > maxx || spans->x + spans->len <= minx) { - ++spans; - continue; - } - if (spans->x < minx) { - out->len = (spans->len - (minx - spans->x)) < (maxx - minx + 1) ? (spans->len - (minx - spans->x)) : (maxx - minx + 1); - out->x = minx; - } - else { - out->x = spans->x; - out->len = spans->len < (maxx - spans->x + 1) ? spans->len : (maxx - spans->x + 1); - } - if (out->len > 0) { - out->y = spans->y; - out->coverage = spans->coverage; - ++out; - --outSpansCnt; - } - ++spans; - } - return out; -} - - -static SwSpan* _mergeSpansRegion(const SwRleData *clip1, const SwRleData *clip2, SwSpan *outSpans) -{ - auto out = outSpans; - auto spans1 = clip1->spans; - auto end1 = clip1->spans + clip1->size; - auto spans2 = clip2->spans; - auto end2 = clip2->spans + clip2->size; - - //list two spans up in y order - //TODO: Remove duplicated regions? - while (spans1 < end1 && spans2 < end2) { - while (spans1 < end1 && spans1->y <= spans2->y) { - *out = *spans1; - ++spans1; - ++out; - } - if (spans1 >= end1) break; - while (spans2 < end2 && spans2->y <= spans1->y) { - *out = *spans2; - ++spans2; - ++out; - } - } - - //Leftovers - while (spans1 < end1) { - *out = *spans1; - ++spans1; - ++out; - } - while (spans2 < end2) { - *out = *spans2; - ++spans2; - ++out; - } - - return out; -} - - -void _replaceClipSpan(SwRleData *rle, SwSpan* clippedSpans, uint32_t size) -{ - free(rle->spans); - rle->spans = clippedSpans; - rle->size = rle->alloc = size; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -SwRleData* rleRender(SwRleData* rle, const SwOutline* outline, const SwBBox& renderRegion, bool antiAlias) -{ - constexpr auto RENDER_POOL_SIZE = 16384L; - constexpr auto BAND_SIZE = 40; - - //TODO: We can preserve several static workers in advance - RleWorker rw; - Cell buffer[RENDER_POOL_SIZE / sizeof(Cell)]; - - //Init Cells - rw.buffer = buffer; - rw.bufferSize = sizeof(buffer); - rw.yCells = reinterpret_cast(buffer); - rw.cells = nullptr; - rw.maxCells = 0; - rw.cellsCnt = 0; - rw.area = 0; - rw.cover = 0; - rw.invalid = true; - rw.cellMin = renderRegion.min; - rw.cellMax = renderRegion.max; - rw.cellXCnt = rw.cellMax.x - rw.cellMin.x; - rw.cellYCnt = rw.cellMax.y - rw.cellMin.y; - rw.ySpan = 0; - rw.outline = const_cast(outline); - rw.bandSize = rw.bufferSize / (sizeof(Cell) * 8); //bandSize: 64 - rw.bandShoot = 0; - rw.antiAlias = antiAlias; - - if (!rle) rw.rle = reinterpret_cast(calloc(1, sizeof(SwRleData))); - else rw.rle = rle; - - //Generate RLE - Band bands[BAND_SIZE]; - Band* band; - - /* set up vertical bands */ - auto bandCnt = static_cast((rw.cellMax.y - rw.cellMin.y) / rw.bandSize); - if (bandCnt == 0) bandCnt = 1; - else if (bandCnt >= BAND_SIZE) bandCnt = (BAND_SIZE - 1); - - auto min = rw.cellMin.y; - auto yMax = rw.cellMax.y; - SwCoord max; - int ret; - - for (int n = 0; n < bandCnt; ++n, min = max) { - max = min + rw.bandSize; - if (n == bandCnt -1 || max > yMax) max = yMax; - - bands[0].min = min; - bands[0].max = max; - band = bands; - - while (band >= bands) { - rw.yCells = static_cast(rw.buffer); - rw.yCnt = band->max - band->min; - - int cellStart = sizeof(Cell*) * (int)rw.yCnt; - int cellMod = cellStart % sizeof(Cell); - - if (cellMod > 0) cellStart += sizeof(Cell) - cellMod; - - auto cellEnd = rw.bufferSize; - cellEnd -= cellEnd % sizeof(Cell); - - auto cellsMax = reinterpret_cast((char*)rw.buffer + cellEnd); - rw.cells = reinterpret_cast((char*)rw.buffer + cellStart); - - if (rw.cells >= cellsMax) goto reduce_bands; - - rw.maxCells = cellsMax - rw.cells; - if (rw.maxCells < 2) goto reduce_bands; - - for (int y = 0; y < rw.yCnt; ++y) - rw.yCells[y] = nullptr; - - rw.cellsCnt = 0; - rw.invalid = true; - rw.cellMin.y = band->min; - rw.cellMax.y = band->max; - rw.cellYCnt = band->max - band->min; - - ret = _genRle(rw); - if (ret == 0) { - _sweep(rw); - --band; - continue; - } else if (ret == 1) { - goto error; - } - - reduce_bands: - /* render pool overflow: we will reduce the render band by half */ - auto bottom = band->min; - auto top = band->max; - auto middle = bottom + ((top - bottom) >> 1); - - /* This is too complex for a single scanline; there must - be some problems */ - if (middle == bottom) goto error; - - if (bottom - top >= rw.bandSize) ++rw.bandShoot; - - band[1].min = bottom; - band[1].max = middle; - band[0].min = middle; - band[0].max = top; - ++band; - } - } - - if (rw.bandShoot > 8 && rw.bandSize > 16) - rw.bandSize = (rw.bandSize >> 1); - - return rw.rle; - -error: - free(rw.rle); - rw.rle = nullptr; - return nullptr; -} - - -SwRleData* rleRender(const SwBBox* bbox) -{ - auto width = static_cast(bbox->max.x - bbox->min.x); - auto height = static_cast(bbox->max.y - bbox->min.y); - - auto rle = static_cast(malloc(sizeof(SwRleData))); - rle->spans = static_cast(malloc(sizeof(SwSpan) * height)); - rle->size = height; - rle->alloc = height; - - auto span = rle->spans; - for (uint16_t i = 0; i < height; ++i, ++span) { - span->x = bbox->min.x; - span->y = bbox->min.y + i; - span->len = width; - span->coverage = 255; - } - - return rle; -} - - -void rleReset(SwRleData* rle) -{ - if (!rle) return; - rle->size = 0; -} - - -void rleFree(SwRleData* rle) -{ - if (!rle) return; - if (rle->spans) free(rle->spans); - free(rle); -} - - -void rleMerge(SwRleData* rle, SwRleData* clip1, SwRleData* clip2) -{ - if (!rle || (!clip1 && !clip2)) return; - if (clip1 && clip1->size == 0 && clip2 && clip2->size == 0) return; - - TVGLOG("SW_ENGINE", "Unifying Rle!"); - - //clip1 is empty, just copy clip2 - if (!clip1 || clip1->size == 0) { - if (clip2) { - auto spans = static_cast(malloc(sizeof(SwSpan) * (clip2->size))); - memcpy(spans, clip2->spans, clip2->size); - _replaceClipSpan(rle, spans, clip2->size); - } else { - _replaceClipSpan(rle, nullptr, 0); - } - return; - } - - //clip2 is empty, just copy clip1 - if (!clip2 || clip2->size == 0) { - if (clip1) { - auto spans = static_cast(malloc(sizeof(SwSpan) * (clip1->size))); - memcpy(spans, clip1->spans, clip1->size); - _replaceClipSpan(rle, spans, clip1->size); - } else { - _replaceClipSpan(rle, nullptr, 0); - } - return; - } - - auto spanCnt = clip1->size + clip2->size; - auto spans = static_cast(malloc(sizeof(SwSpan) * spanCnt)); - auto spansEnd = _mergeSpansRegion(clip1, clip2, spans); - - _replaceClipSpan(rle, spans, spansEnd - spans); -} - - -void rleClipPath(SwRleData *rle, const SwRleData *clip) -{ - if (rle->size == 0 || clip->size == 0) return; - auto spanCnt = rle->size > clip->size ? rle->size : clip->size; - auto spans = static_cast(malloc(sizeof(SwSpan) * (spanCnt))); - auto spansEnd = _intersectSpansRegion(clip, rle, spans, spanCnt); - - _replaceClipSpan(rle, spans, spansEnd - spans); - - TVGLOG("SW_ENGINE", "Using ClipPath!"); -} - - -void rleClipRect(SwRleData *rle, const SwBBox* clip) -{ - if (rle->size == 0) return; - auto spans = static_cast(malloc(sizeof(SwSpan) * (rle->size))); - auto spansEnd = _intersectSpansRect(clip, rle, spans, rle->size); - - _replaceClipSpan(rle, spans, spansEnd - spans); - - TVGLOG("SW_ENGINE", "Using ClipRect!"); -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwShape.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwShape.cpp deleted file mode 100644 index e2652c1..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwShape.cpp +++ /dev/null @@ -1,675 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgSwCommon.h" -#include "tvgMath.h" -#include "tvgLines.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static bool _outlineBegin(SwOutline& outline) -{ - //Make a contour if lineTo/curveTo without calling close or moveTo beforehand. - if (outline.pts.empty()) return false; - outline.cntrs.push(outline.pts.count - 1); - outline.closed.push(false); - outline.pts.push(outline.pts[outline.cntrs.last()]); - outline.types.push(SW_CURVE_TYPE_POINT); - return false; -} - - -static bool _outlineEnd(SwOutline& outline) -{ - if (outline.pts.empty()) return false; - outline.cntrs.push(outline.pts.count - 1); - outline.closed.push(false); - return false; -} - - -static bool _outlineMoveTo(SwOutline& outline, const Point* to, const Matrix* transform, bool closed = false) -{ - //make it a contour, if the last contour is not closed yet. - if (!closed) _outlineEnd(outline); - - outline.pts.push(mathTransform(to, transform)); - outline.types.push(SW_CURVE_TYPE_POINT); - return false; -} - - -static void _outlineLineTo(SwOutline& outline, const Point* to, const Matrix* transform) -{ - outline.pts.push(mathTransform(to, transform)); - outline.types.push(SW_CURVE_TYPE_POINT); -} - - -static void _outlineCubicTo(SwOutline& outline, const Point* ctrl1, const Point* ctrl2, const Point* to, const Matrix* transform) -{ - outline.pts.push(mathTransform(ctrl1, transform)); - outline.types.push(SW_CURVE_TYPE_CUBIC); - - outline.pts.push(mathTransform(ctrl2, transform)); - outline.types.push(SW_CURVE_TYPE_CUBIC); - - outline.pts.push(mathTransform(to, transform)); - outline.types.push(SW_CURVE_TYPE_POINT); -} - - -static bool _outlineClose(SwOutline& outline) -{ - uint32_t i; - if (outline.cntrs.count > 0) i = outline.cntrs.last() + 1; - else i = 0; - - //Make sure there is at least one point in the current path - if (outline.pts.count == i) return false; - - //Close the path - outline.pts.push(outline.pts[i]); - outline.cntrs.push(outline.pts.count - 1); - outline.types.push(SW_CURVE_TYPE_POINT); - outline.closed.push(true); - - return true; -} - - -static void _dashLineTo(SwDashStroke& dash, const Point* to, const Matrix* transform) -{ - Line cur = {dash.ptCur, *to}; - auto len = lineLength(cur.pt1, cur.pt2); - - if (mathZero(len)) { - _outlineMoveTo(*dash.outline, &dash.ptCur, transform); - //draw the current line fully - } else if (len < dash.curLen) { - dash.curLen -= len; - if (!dash.curOpGap) { - if (dash.move) { - _outlineMoveTo(*dash.outline, &dash.ptCur, transform); - dash.move = false; - } - _outlineLineTo(*dash.outline, to, transform); - } - //draw the current line partially - } else { - while (len - dash.curLen > 0.0001f) { - Line left, right; - if (dash.curLen > 0) { - len -= dash.curLen; - lineSplitAt(cur, dash.curLen, left, right); - if (!dash.curOpGap) { - if (dash.move || dash.pattern[dash.curIdx] - dash.curLen < FLOAT_EPSILON) { - _outlineMoveTo(*dash.outline, &left.pt1, transform); - dash.move = false; - } - _outlineLineTo(*dash.outline, &left.pt2, transform); - } - } else { - right = cur; - } - dash.curIdx = (dash.curIdx + 1) % dash.cnt; - dash.curLen = dash.pattern[dash.curIdx]; - dash.curOpGap = !dash.curOpGap; - cur = right; - dash.ptCur = cur.pt1; - dash.move = true; - } - //leftovers - dash.curLen -= len; - if (!dash.curOpGap) { - if (dash.move) { - _outlineMoveTo(*dash.outline, &cur.pt1, transform); - dash.move = false; - } - _outlineLineTo(*dash.outline, &cur.pt2, transform); - } - if (dash.curLen < 1 && TO_SWCOORD(len) > 1) { - //move to next dash - dash.curIdx = (dash.curIdx + 1) % dash.cnt; - dash.curLen = dash.pattern[dash.curIdx]; - dash.curOpGap = !dash.curOpGap; - } - } - dash.ptCur = *to; -} - - -static void _dashCubicTo(SwDashStroke& dash, const Point* ctrl1, const Point* ctrl2, const Point* to, const Matrix* transform) -{ - Bezier cur = {dash.ptCur, *ctrl1, *ctrl2, *to}; - auto len = bezLength(cur); - - //draw the current line fully - if (mathZero(len)) { - _outlineMoveTo(*dash.outline, &dash.ptCur, transform); - } else if (len < dash.curLen) { - dash.curLen -= len; - if (!dash.curOpGap) { - if (dash.move) { - _outlineMoveTo(*dash.outline, &dash.ptCur, transform); - dash.move = false; - } - _outlineCubicTo(*dash.outline, ctrl1, ctrl2, to, transform); - } - //draw the current line partially - } else { - while ((len - dash.curLen) > 0.0001f) { - Bezier left, right; - if (dash.curLen > 0) { - len -= dash.curLen; - bezSplitAt(cur, dash.curLen, left, right); - if (!dash.curOpGap) { - if (dash.move || dash.pattern[dash.curIdx] - dash.curLen < FLOAT_EPSILON) { - _outlineMoveTo(*dash.outline, &left.start, transform); - dash.move = false; - } - _outlineCubicTo(*dash.outline, &left.ctrl1, &left.ctrl2, &left.end, transform); - } - } else { - right = cur; - } - dash.curIdx = (dash.curIdx + 1) % dash.cnt; - dash.curLen = dash.pattern[dash.curIdx]; - dash.curOpGap = !dash.curOpGap; - cur = right; - dash.ptCur = right.start; - dash.move = true; - } - //leftovers - dash.curLen -= len; - if (!dash.curOpGap) { - if (dash.move) { - _outlineMoveTo(*dash.outline, &cur.start, transform); - dash.move = false; - } - _outlineCubicTo(*dash.outline, &cur.ctrl1, &cur.ctrl2, &cur.end, transform); - } - if (dash.curLen < 1 && TO_SWCOORD(len) > 1) { - //move to next dash - dash.curIdx = (dash.curIdx + 1) % dash.cnt; - dash.curLen = dash.pattern[dash.curIdx]; - dash.curOpGap = !dash.curOpGap; - } - } - dash.ptCur = *to; -} - - -static void _dashClose(SwDashStroke& dash, const Matrix* transform) -{ - _dashLineTo(dash, &dash.ptStart, transform); -} - - -static void _dashMoveTo(SwDashStroke& dash, const Point* pts) -{ - dash.ptCur = *pts; - dash.ptStart = *pts; - dash.move = true; -} - - -static void _dashMoveTo(SwDashStroke& dash, uint32_t offIdx, float offset, const Point* pts) -{ - dash.curIdx = offIdx % dash.cnt; - dash.curLen = dash.pattern[dash.curIdx] - offset; - dash.curOpGap = offIdx % 2; - dash.ptStart = dash.ptCur = *pts; - dash.move = true; -} - - -static SwOutline* _genDashOutline(const RenderShape* rshape, const Matrix* transform, float length, SwMpool* mpool, unsigned tid) -{ - const PathCommand* cmds = rshape->path.cmds.data; - auto cmdCnt = rshape->path.cmds.count; - const Point* pts = rshape->path.pts.data; - auto ptsCnt = rshape->path.pts.count; - - //No actual shape data - if (cmdCnt == 0 || ptsCnt == 0) return nullptr; - - SwDashStroke dash; - auto offset = 0.0f; - auto trimmed = false; - - dash.cnt = rshape->strokeDash((const float**)&dash.pattern, &offset); - - //dash by trimming. - if (length > 0.0f && dash.cnt == 0) { - auto begin = length * rshape->stroke->trim.begin; - auto end = length * rshape->stroke->trim.end; - - //TODO: mix trimming + dash style - - //default - if (end > begin) { - if (begin > 0.0f) dash.cnt += 4; - else dash.cnt += 2; - //looping - } else dash.cnt += 3; - - dash.pattern = (float*)malloc(sizeof(float) * dash.cnt); - - if (dash.cnt == 2) { - dash.pattern[0] = end - begin; - dash.pattern[1] = length - (end - begin); - } else if (dash.cnt == 3) { - dash.pattern[0] = end; - dash.pattern[1] = (begin - end); - dash.pattern[2] = length - begin; - } else { - dash.pattern[0] = 0; //zero dash to start with a space. - dash.pattern[1] = begin; - dash.pattern[2] = end - begin; - dash.pattern[3] = length - end; - } - - trimmed = true; - //just a dash style. - } else { - if (dash.cnt == 0) return nullptr; - } - - //offset? - auto patternLength = 0.0f; - uint32_t offIdx = 0; - if (!mathZero(offset)) { - for (size_t i = 0; i < dash.cnt; ++i) patternLength += dash.pattern[i]; - bool isOdd = dash.cnt % 2; - if (isOdd) patternLength *= 2; - - offset = fmodf(offset, patternLength); - if (offset < 0) offset += patternLength; - - for (size_t i = 0; i < dash.cnt * (1 + (size_t)isOdd); ++i, ++offIdx) { - auto curPattern = dash.pattern[i % dash.cnt]; - if (offset < curPattern) break; - offset -= curPattern; - } - } - - dash.outline = mpoolReqDashOutline(mpool, tid); - - //must begin with moveTo - if (cmds[0] == PathCommand::MoveTo) { - _dashMoveTo(dash, offIdx, offset, pts); - cmds++; - pts++; - } - - while (--cmdCnt > 0) { - switch (*cmds) { - case PathCommand::Close: { - _dashClose(dash, transform); - break; - } - case PathCommand::MoveTo: { - if (rshape->stroke->trim.individual) _dashMoveTo(dash, pts); - else _dashMoveTo(dash, offIdx, offset, pts); - ++pts; - break; - } - case PathCommand::LineTo: { - _dashLineTo(dash, pts, transform); - ++pts; - break; - } - case PathCommand::CubicTo: { - _dashCubicTo(dash, pts, pts + 1, pts + 2, transform); - pts += 3; - break; - } - } - ++cmds; - } - - _outlineEnd(*dash.outline); - - if (trimmed) free(dash.pattern); - - return dash.outline; -} - - -static float _outlineLength(const RenderShape* rshape) -{ - const PathCommand* cmds = rshape->path.cmds.data; - auto cmdCnt = rshape->path.cmds.count; - const Point* pts = rshape->path.pts.data; - auto ptsCnt = rshape->path.pts.count; - - //No actual shape data - if (cmdCnt == 0 || ptsCnt == 0) return 0.0f; - - const Point* close = nullptr; - auto length = 0.0f; - auto slength = -1.0f; - auto simultaneous = !rshape->stroke->trim.individual; - - //Compute the whole length - while (cmdCnt-- > 0) { - switch (*cmds) { - case PathCommand::Close: { - length += mathLength(pts - 1, close); - //retrieve the max length of the shape if the simultaneous mode. - if (simultaneous) { - if (slength < length) slength = length; - length = 0.0f; - } - break; - } - case PathCommand::MoveTo: { - close = pts; - ++pts; - break; - } - case PathCommand::LineTo: { - length += mathLength(pts - 1, pts); - ++pts; - break; - } - case PathCommand::CubicTo: { - length += bezLength({*(pts - 1), *pts, *(pts + 1), *(pts + 2)}); - pts += 3; - break; - } - } - ++cmds; - } - if (simultaneous && slength > length) return slength; - else return length; -} - - -static bool _axisAlignedRect(const SwOutline* outline) -{ - //Fast Track: axis-aligned rectangle? - if (outline->pts.count != 5) return false; - - auto pt1 = outline->pts.data + 0; - auto pt2 = outline->pts.data + 1; - auto pt3 = outline->pts.data + 2; - auto pt4 = outline->pts.data + 3; - - auto a = SwPoint{pt1->x, pt3->y}; - auto b = SwPoint{pt3->x, pt1->y}; - - if ((*pt2 == a && *pt4 == b) || (*pt2 == b && *pt4 == a)) return true; - - return false; -} - - -static bool _genOutline(SwShape* shape, const RenderShape* rshape, const Matrix* transform, SwMpool* mpool, unsigned tid, bool hasComposite) -{ - const PathCommand* cmds = rshape->path.cmds.data; - auto cmdCnt = rshape->path.cmds.count; - const Point* pts = rshape->path.pts.data; - auto ptsCnt = rshape->path.pts.count; - - //No actual shape data - if (cmdCnt == 0 || ptsCnt == 0) return false; - - shape->outline = mpoolReqOutline(mpool, tid); - auto outline = shape->outline; - auto closed = false; - - //Generate Outlines - while (cmdCnt-- > 0) { - switch (*cmds) { - case PathCommand::Close: { - if (!closed) closed = _outlineClose(*outline); - break; - } - case PathCommand::MoveTo: { - closed = _outlineMoveTo(*outline, pts, transform, closed); - ++pts; - break; - } - case PathCommand::LineTo: { - if (closed) closed = _outlineBegin(*outline); - _outlineLineTo(*outline, pts, transform); - ++pts; - break; - } - case PathCommand::CubicTo: { - if (closed) closed = _outlineBegin(*outline); - _outlineCubicTo(*outline, pts, pts + 1, pts + 2, transform); - pts += 3; - break; - } - } - ++cmds; - } - - if (!closed) _outlineEnd(*outline); - - outline->fillRule = rshape->rule; - shape->outline = outline; - - shape->fastTrack = (!hasComposite && _axisAlignedRect(shape->outline)); - return true; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -bool shapePrepare(SwShape* shape, const RenderShape* rshape, const Matrix* transform, const SwBBox& clipRegion, SwBBox& renderRegion, SwMpool* mpool, unsigned tid, bool hasComposite) -{ - if (!_genOutline(shape, rshape, transform, mpool, tid, hasComposite)) return false; - if (!mathUpdateOutlineBBox(shape->outline, clipRegion, renderRegion, shape->fastTrack)) return false; - - //Keep it for Rasterization Region - shape->bbox = renderRegion; - - //Check valid region - if (renderRegion.max.x - renderRegion.min.x < 1 && renderRegion.max.y - renderRegion.min.y < 1) return false; - - //Check boundary - if (renderRegion.min.x >= clipRegion.max.x || renderRegion.min.y >= clipRegion.max.y || - renderRegion.max.x <= clipRegion.min.x || renderRegion.max.y <= clipRegion.min.y) return false; - - return true; -} - - -bool shapePrepared(const SwShape* shape) -{ - return shape->rle ? true : false; -} - - -bool shapeGenRle(SwShape* shape, TVG_UNUSED const RenderShape* rshape, bool antiAlias) -{ - //FIXME: Should we draw it? - //Case: Stroke Line - //if (shape.outline->opened) return true; - - //Case A: Fast Track Rectangle Drawing - if (shape->fastTrack) return true; - - //Case B: Normal Shape RLE Drawing - if ((shape->rle = rleRender(shape->rle, shape->outline, shape->bbox, antiAlias))) return true; - - return false; -} - - -void shapeDelOutline(SwShape* shape, SwMpool* mpool, uint32_t tid) -{ - mpoolRetOutline(mpool, tid); - shape->outline = nullptr; -} - - -void shapeReset(SwShape* shape) -{ - rleReset(shape->rle); - rleReset(shape->strokeRle); - shape->fastTrack = false; - shape->bbox.reset(); -} - - -void shapeFree(SwShape* shape) -{ - rleFree(shape->rle); - shape->rle = nullptr; - - shapeDelFill(shape); - - if (shape->stroke) { - rleFree(shape->strokeRle); - shape->strokeRle = nullptr; - strokeFree(shape->stroke); - shape->stroke = nullptr; - } -} - - -void shapeDelStroke(SwShape* shape) -{ - if (!shape->stroke) return; - rleFree(shape->strokeRle); - shape->strokeRle = nullptr; - strokeFree(shape->stroke); - shape->stroke = nullptr; -} - - -void shapeResetStroke(SwShape* shape, const RenderShape* rshape, const Matrix* transform) -{ - if (!shape->stroke) shape->stroke = static_cast(calloc(1, sizeof(SwStroke))); - auto stroke = shape->stroke; - if (!stroke) return; - - strokeReset(stroke, rshape, transform); - rleReset(shape->strokeRle); -} - - -bool shapeGenStrokeRle(SwShape* shape, const RenderShape* rshape, const Matrix* transform, const SwBBox& clipRegion, SwBBox& renderRegion, SwMpool* mpool, unsigned tid) -{ - SwOutline* shapeOutline = nullptr; - SwOutline* strokeOutline = nullptr; - auto dashStroking = false; - auto ret = true; - - auto length = rshape->strokeTrim() ? _outlineLength(rshape) : 0.0f; - - //Dash style (+trimming) - if (rshape->stroke->dashCnt > 0 || length > 0) { - shapeOutline = _genDashOutline(rshape, transform, length, mpool, tid); - if (!shapeOutline) return false; - dashStroking = true; - //Normal style - } else { - if (!shape->outline) { - if (!_genOutline(shape, rshape, transform, mpool, tid, false)) return false; - } - shapeOutline = shape->outline; - } - - if (!strokeParseOutline(shape->stroke, *shapeOutline)) { - ret = false; - goto clear; - } - - strokeOutline = strokeExportOutline(shape->stroke, mpool, tid); - - if (!mathUpdateOutlineBBox(strokeOutline, clipRegion, renderRegion, false)) { - ret = false; - goto clear; - } - - shape->strokeRle = rleRender(shape->strokeRle, strokeOutline, renderRegion, true); - -clear: - if (dashStroking) mpoolRetDashOutline(mpool, tid); - mpoolRetStrokeOutline(mpool, tid); - - return ret; -} - - -bool shapeGenFillColors(SwShape* shape, const Fill* fill, const Matrix* transform, SwSurface* surface, uint8_t opacity, bool ctable) -{ - return fillGenColorTable(shape->fill, fill, transform, surface, opacity, ctable); -} - - -bool shapeGenStrokeFillColors(SwShape* shape, const Fill* fill, const Matrix* transform, SwSurface* surface, uint8_t opacity, bool ctable) -{ - return fillGenColorTable(shape->stroke->fill, fill, transform, surface, opacity, ctable); -} - - -void shapeResetFill(SwShape* shape) -{ - if (!shape->fill) { - shape->fill = static_cast(calloc(1, sizeof(SwFill))); - if (!shape->fill) return; - } - fillReset(shape->fill); -} - - -void shapeResetStrokeFill(SwShape* shape) -{ - if (!shape->stroke->fill) { - shape->stroke->fill = static_cast(calloc(1, sizeof(SwFill))); - if (!shape->stroke->fill) return; - } - fillReset(shape->stroke->fill); -} - - -void shapeDelFill(SwShape* shape) -{ - if (!shape->fill) return; - fillFree(shape->fill); - shape->fill = nullptr; -} - - -void shapeDelStrokeFill(SwShape* shape) -{ - if (!shape->stroke->fill) return; - fillFree(shape->stroke->fill); - shape->stroke->fill = nullptr; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwStroke.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwStroke.cpp deleted file mode 100644 index 954250c..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgSwStroke.cpp +++ /dev/null @@ -1,913 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include -#include -#include "tvgSwCommon.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -static constexpr auto SW_STROKE_TAG_POINT = 1; -static constexpr auto SW_STROKE_TAG_CUBIC = 2; -static constexpr auto SW_STROKE_TAG_BEGIN = 4; -static constexpr auto SW_STROKE_TAG_END = 8; - -static inline SwFixed SIDE_TO_ROTATE(const int32_t s) -{ - return (SW_ANGLE_PI2 - static_cast(s) * SW_ANGLE_PI); -} - - -static inline void SCALE(const SwStroke& stroke, SwPoint& pt) -{ - pt.x = static_cast(pt.x * stroke.sx); - pt.y = static_cast(pt.y * stroke.sy); -} - - -static void _growBorder(SwStrokeBorder* border, uint32_t newPts) -{ - auto maxOld = border->maxPts; - auto maxNew = border->ptsCnt + newPts; - - if (maxNew <= maxOld) return; - - auto maxCur = maxOld; - - while (maxCur < maxNew) - maxCur += (maxCur >> 1) + 16; - //OPTIMIZE: use mempool! - border->pts = static_cast(realloc(border->pts, maxCur * sizeof(SwPoint))); - border->tags = static_cast(realloc(border->tags, maxCur * sizeof(uint8_t))); - border->maxPts = maxCur; -} - - -static void _borderClose(SwStrokeBorder* border, bool reverse) -{ - auto start = border->start; - auto count = border->ptsCnt; - - //Don't record empty paths! - if (count <= start + 1U) { - border->ptsCnt = start; - } else { - /* Copy the last point to the start of this sub-path, - since it contains the adjusted starting coordinates */ - border->ptsCnt = --count; - border->pts[start] = border->pts[count]; - - if (reverse) { - //reverse the points - auto pt1 = border->pts + start + 1; - auto pt2 = border->pts + count - 1; - - while (pt1 < pt2) { - auto tmp = *pt1; - *pt1 = *pt2; - *pt2 = tmp; - ++pt1; - --pt2; - } - - //reverse the tags - auto tag1 = border->tags + start + 1; - auto tag2 = border->tags + count - 1; - - while (tag1 < tag2) { - auto tmp = *tag1; - *tag1 = *tag2; - *tag2 = tmp; - ++tag1; - --tag2; - } - } - - border->tags[start] |= SW_STROKE_TAG_BEGIN; - border->tags[count - 1] |= SW_STROKE_TAG_END; - } - - border->start = -1; - border->movable = false; -} - - -static void _borderCubicTo(SwStrokeBorder* border, const SwPoint& ctrl1, const SwPoint& ctrl2, const SwPoint& to) -{ - _growBorder(border, 3); - - auto pt = border->pts + border->ptsCnt; - auto tag = border->tags + border->ptsCnt; - - pt[0] = ctrl1; - pt[1] = ctrl2; - pt[2] = to; - - tag[0] = SW_STROKE_TAG_CUBIC; - tag[1] = SW_STROKE_TAG_CUBIC; - tag[2] = SW_STROKE_TAG_POINT; - - border->ptsCnt += 3; - border->movable = false; -} - - -static void _borderArcTo(SwStrokeBorder* border, const SwPoint& center, SwFixed radius, SwFixed angleStart, SwFixed angleDiff, SwStroke& stroke) -{ - constexpr SwFixed ARC_CUBIC_ANGLE = SW_ANGLE_PI / 2; - SwPoint a = {static_cast(radius), 0}; - mathRotate(a, angleStart); - SCALE(stroke, a); - a += center; - - auto total = angleDiff; - auto angle = angleStart; - auto rotate = (angleDiff >= 0) ? SW_ANGLE_PI2 : -SW_ANGLE_PI2; - - while (total != 0) { - auto step = total; - if (step > ARC_CUBIC_ANGLE) step = ARC_CUBIC_ANGLE; - else if (step < -ARC_CUBIC_ANGLE) step = -ARC_CUBIC_ANGLE; - - auto next = angle + step; - auto theta = step; - if (theta < 0) theta = -theta; - - theta >>= 1; - - //compute end point - SwPoint b = {static_cast(radius), 0}; - mathRotate(b, next); - SCALE(stroke, b); - b += center; - - //compute first and second control points - auto length = mathMulDiv(radius, mathSin(theta) * 4, (0x10000L + mathCos(theta)) * 3); - - SwPoint a2 = {static_cast(length), 0}; - mathRotate(a2, angle + rotate); - SCALE(stroke, a2); - a2 += a; - - SwPoint b2 = {static_cast(length), 0}; - mathRotate(b2, next - rotate); - SCALE(stroke, b2); - b2 += b; - - //add cubic arc - _borderCubicTo(border, a2, b2, b); - - //process the rest of the arc? - a = b; - total -= step; - angle = next; - } -} - - -static void _borderLineTo(SwStrokeBorder* border, const SwPoint& to, bool movable) -{ - if (border->movable) { - //move last point - border->pts[border->ptsCnt - 1] = to; - } else { - //don't add zero-length line_to - if (border->ptsCnt > 0 && (border->pts[border->ptsCnt - 1] - to).small()) return; - - _growBorder(border, 1); - border->pts[border->ptsCnt] = to; - border->tags[border->ptsCnt] = SW_STROKE_TAG_POINT; - border->ptsCnt += 1; - } - - border->movable = movable; -} - - -static void _borderMoveTo(SwStrokeBorder* border, SwPoint& to) -{ - //close current open path if any? - if (border->start >= 0) _borderClose(border, false); - - border->start = border->ptsCnt; - border->movable = false; - - _borderLineTo(border, to, false); -} - - -static void _arcTo(SwStroke& stroke, int32_t side) -{ - auto border = stroke.borders + side; - auto rotate = SIDE_TO_ROTATE(side); - auto total = mathDiff(stroke.angleIn, stroke.angleOut); - if (total == SW_ANGLE_PI) total = -rotate * 2; - - _borderArcTo(border, stroke.center, stroke.width, stroke.angleIn + rotate, total, stroke); - border->movable = false; -} - - -static void _outside(SwStroke& stroke, int32_t side, SwFixed lineLength) -{ - auto border = stroke.borders + side; - - if (stroke.join == StrokeJoin::Round) { - _arcTo(stroke, side); - } else { - //this is a mitered (pointed) or beveled (truncated) corner - auto rotate = SIDE_TO_ROTATE(side); - auto bevel = (stroke.join == StrokeJoin::Bevel) ? true : false; - SwFixed phi = 0; - SwFixed thcos = 0; - - if (!bevel) { - auto theta = mathDiff(stroke.angleIn, stroke.angleOut); - if (theta == SW_ANGLE_PI) { - theta = rotate; - phi = stroke.angleIn; - } else { - theta /= 2; - phi = stroke.angleIn + theta + rotate; - } - - thcos = mathCos(theta); - auto sigma = mathMultiply(stroke.miterlimit, thcos); - - //is miter limit exceeded? - if (sigma < 0x10000L) bevel = true; - } - - //this is a bevel (broken angle) - if (bevel) { - SwPoint delta = {static_cast(stroke.width), 0}; - mathRotate(delta, stroke.angleOut + rotate); - SCALE(stroke, delta); - delta += stroke.center; - border->movable = false; - _borderLineTo(border, delta, false); - //this is a miter (intersection) - } else { - auto length = mathDivide(stroke.width, thcos); - SwPoint delta = {static_cast(length), 0}; - mathRotate(delta, phi); - SCALE(stroke, delta); - delta += stroke.center; - _borderLineTo(border, delta, false); - - /* Now add and end point - Only needed if not lineto (lineLength is zero for curves) */ - if (lineLength == 0) { - delta = {static_cast(stroke.width), 0}; - mathRotate(delta, stroke.angleOut + rotate); - SCALE(stroke, delta); - delta += stroke.center; - _borderLineTo(border, delta, false); - } - } - } -} - - -static void _inside(SwStroke& stroke, int32_t side, SwFixed lineLength) -{ - auto border = stroke.borders + side; - auto theta = mathDiff(stroke.angleIn, stroke.angleOut) / 2; - SwPoint delta; - bool intersect = false; - - /* Only intersect borders if between two line_to's and both - lines are long enough (line length is zero for curves). */ - if (border->movable && lineLength > 0) { - //compute minimum required length of lines - SwFixed minLength = abs(mathMultiply(stroke.width, mathTan(theta))); - if (stroke.lineLength >= minLength && lineLength >= minLength) intersect = true; - } - - auto rotate = SIDE_TO_ROTATE(side); - - if (!intersect) { - delta = {static_cast(stroke.width), 0}; - mathRotate(delta, stroke.angleOut + rotate); - SCALE(stroke, delta); - delta += stroke.center; - border->movable = false; - } else { - //compute median angle - auto phi = stroke.angleIn + theta; - auto thcos = mathCos(theta); - delta = {static_cast(mathDivide(stroke.width, thcos)), 0}; - mathRotate(delta, phi + rotate); - SCALE(stroke, delta); - delta += stroke.center; - } - - _borderLineTo(border, delta, false); -} - - -void _processCorner(SwStroke& stroke, SwFixed lineLength) -{ - auto turn = mathDiff(stroke.angleIn, stroke.angleOut); - - //no specific corner processing is required if the turn is 0 - if (turn == 0) return; - - //when we turn to the right, the inside side is 0 - int32_t inside = 0; - - //otherwise, the inside is 1 - if (turn < 0) inside = 1; - - //process the inside - _inside(stroke, inside, lineLength); - - //process the outside - _outside(stroke, 1 - inside, lineLength); -} - - -void _firstSubPath(SwStroke& stroke, SwFixed startAngle, SwFixed lineLength) -{ - SwPoint delta = {static_cast(stroke.width), 0}; - mathRotate(delta, startAngle + SW_ANGLE_PI2); - SCALE(stroke, delta); - - auto pt = stroke.center + delta; - auto border = stroke.borders; - _borderMoveTo(border, pt); - - pt = stroke.center - delta; - ++border; - _borderMoveTo(border, pt); - - /* Save angle, position and line length for last join - lineLength is zero for curves */ - stroke.subPathAngle = startAngle; - stroke.firstPt = false; - stroke.subPathLineLength = lineLength; -} - - -static void _lineTo(SwStroke& stroke, const SwPoint& to) -{ - auto delta = to - stroke.center; - - //a zero-length lineto is a no-op; avoid creating a spurious corner - if (delta.zero()) return; - - /* The lineLength is used to determine the intersection of strokes outlines. - The scale needs to be reverted since the stroke width has not been scaled. - An alternative option is to scale the width of the stroke properly by - calculating the mixture of the sx/sy rating on the stroke direction. */ - delta.x = static_cast(delta.x / stroke.sx); - delta.y = static_cast(delta.y / stroke.sy); - auto lineLength = mathLength(delta); - auto angle = mathAtan(delta); - - delta = {static_cast(stroke.width), 0}; - mathRotate(delta, angle + SW_ANGLE_PI2); - SCALE(stroke, delta); - - //process corner if necessary - if (stroke.firstPt) { - /* This is the first segment of a subpath. We need to add a point to each border - at their respective starting point locations. */ - _firstSubPath(stroke, angle, lineLength); - } else { - //process the current corner - stroke.angleOut = angle; - _processCorner(stroke, lineLength); - } - - //now add a line segment to both the inside and outside paths - auto border = stroke.borders; - auto side = 1; - - while (side >= 0) { - auto pt = to + delta; - - //the ends of lineto borders are movable - _borderLineTo(border, pt, true); - - delta.x = -delta.x; - delta.y = -delta.y; - - --side; - ++border; - } - - stroke.angleIn = angle; - stroke.center = to; - stroke.lineLength = lineLength; -} - - -static void _cubicTo(SwStroke& stroke, const SwPoint& ctrl1, const SwPoint& ctrl2, const SwPoint& to) -{ - SwPoint bezStack[37]; //TODO: static? - auto limit = bezStack + 32; - auto arc = bezStack; - auto firstArc = true; - arc[0] = to; - arc[1] = ctrl2; - arc[2] = ctrl1; - arc[3] = stroke.center; - - while (arc >= bezStack) { - SwFixed angleIn, angleOut, angleMid; - - //initialize with current direction - angleIn = angleOut = angleMid = stroke.angleIn; - - if (arc < limit && !mathSmallCubic(arc, angleIn, angleMid, angleOut)) { - if (stroke.firstPt) stroke.angleIn = angleIn; - mathSplitCubic(arc); - arc += 3; - continue; - } - - if (firstArc) { - firstArc = false; - //process corner if necessary - if (stroke.firstPt) { - _firstSubPath(stroke, angleIn, 0); - } else { - stroke.angleOut = angleIn; - _processCorner(stroke, 0); - } - } else if (abs(mathDiff(stroke.angleIn, angleIn)) > (SW_ANGLE_PI / 8) / 4) { - //if the deviation from one arc to the next is too great add a round corner - stroke.center = arc[3]; - stroke.angleOut = angleIn; - stroke.join = StrokeJoin::Round; - - _processCorner(stroke, 0); - - //reinstate line join style - stroke.join = stroke.joinSaved; - } - - //the arc's angle is small enough; we can add it directly to each border - auto theta1 = mathDiff(angleIn, angleMid) / 2; - auto theta2 = mathDiff(angleMid, angleOut) / 2; - auto phi1 = mathMean(angleIn, angleMid); - auto phi2 = mathMean(angleMid, angleOut); - auto length1 = mathDivide(stroke.width, mathCos(theta1)); - auto length2 = mathDivide(stroke.width, mathCos(theta2)); - SwFixed alpha0 = 0; - - //compute direction of original arc - if (stroke.handleWideStrokes) { - alpha0 = mathAtan(arc[0] - arc[3]); - } - - auto border = stroke.borders; - int32_t side = 0; - - while (side < 2) { - auto rotate = SIDE_TO_ROTATE(side); - - //compute control points - SwPoint _ctrl1 = {static_cast(length1), 0}; - mathRotate(_ctrl1, phi1 + rotate); - SCALE(stroke, _ctrl1); - _ctrl1 += arc[2]; - - SwPoint _ctrl2 = {static_cast(length2), 0}; - mathRotate(_ctrl2, phi2 + rotate); - SCALE(stroke, _ctrl2); - _ctrl2 += arc[1]; - - //compute end point - SwPoint _end = {static_cast(stroke.width), 0}; - mathRotate(_end, angleOut + rotate); - SCALE(stroke, _end); - _end += arc[0]; - - if (stroke.handleWideStrokes) { - /* determine whether the border radius is greater than the radius of - curvature of the original arc */ - auto _start = border->pts[border->ptsCnt - 1]; - auto alpha1 = mathAtan(_end - _start); - - //is the direction of the border arc opposite to that of the original arc? - if (abs(mathDiff(alpha0, alpha1)) > SW_ANGLE_PI / 2) { - - //use the sine rule to find the intersection point - auto beta = mathAtan(arc[3] - _start); - auto gamma = mathAtan(arc[0] - _end); - auto bvec = _end - _start; - auto blen = mathLength(bvec); - auto sinA = abs(mathSin(alpha1 - gamma)); - auto sinB = abs(mathSin(beta - gamma)); - auto alen = mathMulDiv(blen, sinA, sinB); - - SwPoint delta = {static_cast(alen), 0}; - mathRotate(delta, beta); - delta += _start; - - //circumnavigate the negative sector backwards - border->movable = false; - _borderLineTo(border, delta, false); - _borderLineTo(border, _end, false); - _borderCubicTo(border, _ctrl2, _ctrl1, _start); - - //and then move to the endpoint - _borderLineTo(border, _end, false); - - ++side; - ++border; - continue; - } - } - _borderCubicTo(border, _ctrl1, _ctrl2, _end); - ++side; - ++border; - } - arc -= 3; - stroke.angleIn = angleOut; - } - stroke.center = to; -} - - -static void _addCap(SwStroke& stroke, SwFixed angle, int32_t side) -{ - if (stroke.cap == StrokeCap::Square) { - auto rotate = SIDE_TO_ROTATE(side); - auto border = stroke.borders + side; - - SwPoint delta = {static_cast(stroke.width), 0}; - mathRotate(delta, angle); - SCALE(stroke, delta); - - SwPoint delta2 = {static_cast(stroke.width), 0}; - mathRotate(delta2, angle + rotate); - SCALE(stroke, delta2); - delta += stroke.center + delta2; - - _borderLineTo(border, delta, false); - - delta = {static_cast(stroke.width), 0}; - mathRotate(delta, angle); - SCALE(stroke, delta); - - delta2 = {static_cast(stroke.width), 0}; - mathRotate(delta2, angle - rotate); - SCALE(stroke, delta2); - delta += delta2 + stroke.center; - - _borderLineTo(border, delta, false); - - } else if (stroke.cap == StrokeCap::Round) { - - stroke.angleIn = angle; - stroke.angleOut = angle + SW_ANGLE_PI; - _arcTo(stroke, side); - return; - - } else { //Butt - auto rotate = SIDE_TO_ROTATE(side); - auto border = stroke.borders + side; - - SwPoint delta = {static_cast(stroke.width), 0}; - mathRotate(delta, angle + rotate); - SCALE(stroke, delta); - delta += stroke.center; - - _borderLineTo(border, delta, false); - - delta = {static_cast(stroke.width), 0}; - mathRotate(delta, angle - rotate); - SCALE(stroke, delta); - delta += stroke.center; - - _borderLineTo(border, delta, false); - } -} - - -static void _addReverseLeft(SwStroke& stroke, bool opened) -{ - auto right = stroke.borders + 0; - auto left = stroke.borders + 1; - auto newPts = left->ptsCnt - left->start; - - if (newPts <= 0) return; - - _growBorder(right, newPts); - - auto dstPt = right->pts + right->ptsCnt; - auto dstTag = right->tags + right->ptsCnt; - auto srcPt = left->pts + left->ptsCnt - 1; - auto srcTag = left->tags + left->ptsCnt - 1; - - while (srcPt >= left->pts + left->start) { - *dstPt = *srcPt; - *dstTag = *srcTag; - - if (opened) { - dstTag[0] &= ~(SW_STROKE_TAG_BEGIN | SW_STROKE_TAG_END); - } else { - //switch begin/end tags if necessary - auto ttag = dstTag[0] & (SW_STROKE_TAG_BEGIN | SW_STROKE_TAG_END); - if (ttag == SW_STROKE_TAG_BEGIN || ttag == SW_STROKE_TAG_END) - dstTag[0] ^= (SW_STROKE_TAG_BEGIN | SW_STROKE_TAG_END); - } - --srcPt; - --srcTag; - ++dstPt; - ++dstTag; - } - - left->ptsCnt = left->start; - right->ptsCnt += newPts; - right->movable = false; - left->movable = false; -} - - -static void _beginSubPath(SwStroke& stroke, const SwPoint& to, bool closed) -{ - /* We cannot process the first point because there is not enough - information regarding its corner/cap. Later, it will be processed - in the _endSubPath() */ - - stroke.firstPt = true; - stroke.center = to; - stroke.closedSubPath = closed; - - /* Determine if we need to check whether the border radius is greater - than the radius of curvature of a curve, to handle this case specially. - This is only required if bevel joins or butt caps may be created because - round & miter joins and round & square caps cover the negative sector - created with wide strokes. */ - if ((stroke.join != StrokeJoin::Round) || (!stroke.closedSubPath && stroke.cap == StrokeCap::Butt)) - stroke.handleWideStrokes = true; - else - stroke.handleWideStrokes = false; - - stroke.ptStartSubPath = to; - stroke.angleIn = 0; -} - - -static void _endSubPath(SwStroke& stroke) -{ - if (stroke.closedSubPath) { - //close the path if needed - if (stroke.center != stroke.ptStartSubPath) - _lineTo(stroke, stroke.ptStartSubPath); - - //process the corner - stroke.angleOut = stroke.subPathAngle; - auto turn = mathDiff(stroke.angleIn, stroke.angleOut); - - //No specific corner processing is required if the turn is 0 - if (turn != 0) { - //when we turn to the right, the inside is 0 - int32_t inside = 0; - - //otherwise, the inside is 1 - if (turn < 0) inside = 1; - - _inside(stroke, inside, stroke.subPathLineLength); //inside - _outside(stroke, 1 - inside, stroke.subPathLineLength); //outside - } - - _borderClose(stroke.borders + 0, false); - _borderClose(stroke.borders + 1, true); - } else { - auto right = stroke.borders; - - /* all right, this is an opened path, we need to add a cap between - right & left, add the reverse of left, then add a final cap - between left & right */ - _addCap(stroke, stroke.angleIn, 0); - - //add reversed points from 'left' to 'right' - _addReverseLeft(stroke, true); - - //now add the final cap - stroke.center = stroke.ptStartSubPath; - _addCap(stroke, stroke.subPathAngle + SW_ANGLE_PI, 0); - - /* now end the right subpath accordingly. The left one is rewind - and doesn't need further processing */ - _borderClose(right, false); - } -} - - -static void _getCounts(SwStrokeBorder* border, uint32_t& ptsCnt, uint32_t& cntrsCnt) -{ - auto count = border->ptsCnt; - auto tags = border->tags; - uint32_t _ptsCnt = 0; - uint32_t _cntrsCnt = 0; - bool inCntr = false; - - while (count > 0) { - if (tags[0] & SW_STROKE_TAG_BEGIN) { - if (inCntr) goto fail; - inCntr = true; - } else if (!inCntr) goto fail; - - if (tags[0] & SW_STROKE_TAG_END) { - inCntr = false; - ++_cntrsCnt; - } - --count; - ++_ptsCnt; - ++tags; - } - - if (inCntr) goto fail; - - ptsCnt = _ptsCnt; - cntrsCnt = _cntrsCnt; - - return; - -fail: - ptsCnt = 0; - cntrsCnt = 0; -} - - -static void _exportBorderOutline(const SwStroke& stroke, SwOutline* outline, uint32_t side) -{ - auto border = stroke.borders + side; - if (border->ptsCnt == 0) return; - - memcpy(outline->pts.data + outline->pts.count, border->pts, border->ptsCnt * sizeof(SwPoint)); - - auto cnt = border->ptsCnt; - auto src = border->tags; - auto tags = outline->types.data + outline->types.count; - auto idx = outline->pts.count; - - while (cnt > 0) { - if (*src & SW_STROKE_TAG_POINT) *tags = SW_CURVE_TYPE_POINT; - else if (*src & SW_STROKE_TAG_CUBIC) *tags = SW_CURVE_TYPE_CUBIC; - else TVGERR("SW_ENGINE", "Invalid stroke tag was given! = %d", *src); - if (*src & SW_STROKE_TAG_END) outline->cntrs.push(idx); - ++src; - ++tags; - ++idx; - --cnt; - } - outline->pts.count += border->ptsCnt; - outline->types.count += border->ptsCnt; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -void strokeFree(SwStroke* stroke) -{ - if (!stroke) return; - - //free borders - if (stroke->borders[0].pts) free(stroke->borders[0].pts); - if (stroke->borders[0].tags) free(stroke->borders[0].tags); - if (stroke->borders[1].pts) free(stroke->borders[1].pts); - if (stroke->borders[1].tags) free(stroke->borders[1].tags); - - fillFree(stroke->fill); - stroke->fill = nullptr; - - free(stroke); -} - - -void strokeReset(SwStroke* stroke, const RenderShape* rshape, const Matrix* transform) -{ - if (transform) { - stroke->sx = sqrtf(powf(transform->e11, 2.0f) + powf(transform->e21, 2.0f)); - stroke->sy = sqrtf(powf(transform->e12, 2.0f) + powf(transform->e22, 2.0f)); - } else { - stroke->sx = stroke->sy = 1.0f; - } - - stroke->width = HALF_STROKE(rshape->strokeWidth()); - stroke->cap = rshape->strokeCap(); - stroke->miterlimit = static_cast(rshape->strokeMiterlimit()) << 16; - - //Save line join: it can be temporarily changed when stroking curves... - stroke->joinSaved = stroke->join = rshape->strokeJoin(); - - stroke->borders[0].ptsCnt = 0; - stroke->borders[0].start = -1; - stroke->borders[1].ptsCnt = 0; - stroke->borders[1].start = -1; -} - - -bool strokeParseOutline(SwStroke* stroke, const SwOutline& outline) -{ - uint32_t first = 0; - uint32_t i = 0; - - for (auto cntr = outline.cntrs.begin(); cntr < outline.cntrs.end(); ++cntr, ++i) { - auto last = *cntr; //index of last point in contour - auto limit = outline.pts.data + last; - - //Skip empty points - if (last <= first) { - first = last + 1; - continue; - } - - auto start = outline.pts[first]; - auto pt = outline.pts.data + first; - auto types = outline.types.data + first; - auto type = types[0]; - - //A contour cannot start with a cubic control point - if (type == SW_CURVE_TYPE_CUBIC) return false; - - auto closed = outline.closed.data ? outline.closed.data[i]: false; - - _beginSubPath(*stroke, start, closed); - - while (pt < limit) { - ++pt; - ++types; - - //emit a single line_to - if (types[0] == SW_CURVE_TYPE_POINT) { - _lineTo(*stroke, *pt); - //types cubic - } else { - if (pt + 1 > limit || types[1] != SW_CURVE_TYPE_CUBIC) return false; - - pt += 2; - types += 2; - - if (pt <= limit) { - _cubicTo(*stroke, pt[-2], pt[-1], pt[0]); - continue; - } - _cubicTo(*stroke, pt[-2], pt[-1], start); - goto close; - } - } - close: - if (!stroke->firstPt) _endSubPath(*stroke); - first = last + 1; - } - return true; -} - - -SwOutline* strokeExportOutline(SwStroke* stroke, SwMpool* mpool, unsigned tid) -{ - uint32_t count1, count2, count3, count4; - - _getCounts(stroke->borders + 0, count1, count2); - _getCounts(stroke->borders + 1, count3, count4); - - auto ptsCnt = count1 + count3; - auto cntrsCnt = count2 + count4; - - auto outline = mpoolReqStrokeOutline(mpool, tid); - outline->pts.reserve(ptsCnt); - outline->types.reserve(ptsCnt); - outline->cntrs.reserve(cntrsCnt); - - _exportBorderOutline(*stroke, outline, 0); //left - _exportBorderOutline(*stroke, outline, 1); //right - - return outline; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgTaskScheduler.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgTaskScheduler.cpp deleted file mode 100644 index b5c7c2e..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgTaskScheduler.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgArray.h" -#include "tvgInlist.h" -#include "tvgTaskScheduler.h" - -#ifdef THORVG_THREAD_SUPPORT - #include - #include -#endif - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -namespace tvg { - -struct TaskSchedulerImpl; -static TaskSchedulerImpl* inst = nullptr; - -#ifdef THORVG_THREAD_SUPPORT - -static thread_local bool _async = true; - -struct TaskQueue { - Inlist taskDeque; - mutex mtx; - condition_variable ready; - bool done = false; - - bool tryPop(Task** task) - { - unique_lock lock{mtx, try_to_lock}; - if (!lock || taskDeque.empty()) return false; - *task = taskDeque.front(); - return true; - } - - bool tryPush(Task* task) - { - { - unique_lock lock{mtx, try_to_lock}; - if (!lock) return false; - taskDeque.back(task); - } - ready.notify_one(); - return true; - } - - void complete() - { - { - lock_guard lock{mtx}; - done = true; - } - ready.notify_all(); - } - - bool pop(Task** task) - { - unique_lock lock{mtx}; - - while (taskDeque.empty() && !done) { - ready.wait(lock); - } - - if (taskDeque.empty()) return false; - - *task = taskDeque.front(); - return true; - } - - void push(Task* task) - { - { - lock_guard lock{mtx}; - taskDeque.back(task); - } - ready.notify_one(); - } -}; - - -struct TaskSchedulerImpl -{ - Array threads; - Array taskQueues; - atomic idx{0}; - - TaskSchedulerImpl(uint32_t threadCnt) - { - threads.reserve(threadCnt); - taskQueues.reserve(threadCnt); - - for (uint32_t i = 0; i < threadCnt; ++i) { - taskQueues.push(new TaskQueue); - threads.push(new thread); - } - for (uint32_t i = 0; i < threadCnt; ++i) { - *threads.data[i] = thread([&, i] { run(i); }); - } - } - - ~TaskSchedulerImpl() - { - for (auto tq = taskQueues.begin(); tq < taskQueues.end(); ++tq) { - (*tq)->complete(); - } - for (auto thread = threads.begin(); thread < threads.end(); ++thread) { - (*thread)->join(); - delete(*thread); - } - for (auto tq = taskQueues.begin(); tq < taskQueues.end(); ++tq) { - delete(*tq); - } - } - - void run(unsigned i) - { - Task* task; - - //Thread Loop - while (true) { - auto success = false; - for (uint32_t x = 0; x < threads.count * 2; ++x) { - if (taskQueues[(i + x) % threads.count]->tryPop(&task)) { - success = true; - break; - } - } - - if (!success && !taskQueues[i]->pop(&task)) break; - (*task)(i + 1); - } - } - - void request(Task* task) - { - //Async - if (threads.count > 0 && _async) { - task->prepare(); - auto i = idx++; - for (uint32_t n = 0; n < threads.count; ++n) { - if (taskQueues[(i + n) % threads.count]->tryPush(task)) return; - } - taskQueues[i % threads.count]->push(task); - //Sync - } else { - task->run(0); - } - } - - uint32_t threadCnt() - { - return threads.count; - } -}; - -#else //THORVG_THREAD_SUPPORT - -static bool _async = true; - -struct TaskSchedulerImpl -{ - TaskSchedulerImpl(TVG_UNUSED uint32_t threadCnt) {} - void request(Task* task) { task->run(0); } - uint32_t threadCnt() { return 0; } -}; - -#endif //THORVG_THREAD_SUPPORT - -} //namespace - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -void TaskScheduler::init(uint32_t threads) -{ - if (inst) return; - inst = new TaskSchedulerImpl(threads); -} - - -void TaskScheduler::term() -{ - delete(inst); - inst = nullptr; -} - - -void TaskScheduler::request(Task* task) -{ - if (inst) inst->request(task); -} - - -uint32_t TaskScheduler::threads() -{ - if (inst) return inst->threadCnt(); - return 0; -} - - -void TaskScheduler::async(bool on) -{ - //toggle async tasking for each thread on/off - _async = on; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgTaskScheduler.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgTaskScheduler.h deleted file mode 100644 index af1334b..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgTaskScheduler.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_TASK_SCHEDULER_H_ -#define _TVG_TASK_SCHEDULER_H_ - -#include -#include - -#include "tvgCommon.h" -#include "tvgInlist.h" - -namespace tvg { - -#ifdef THORVG_THREAD_SUPPORT - -struct Task -{ -private: - mutex mtx; - condition_variable cv; - bool ready = true; - bool pending = false; - -public: - INLIST_ITEM(Task); - - virtual ~Task() = default; - - void done() - { - if (!pending) return; - - unique_lock lock(mtx); - while (!ready) cv.wait(lock); - pending = false; - } - -protected: - virtual void run(unsigned tid) = 0; - -private: - void operator()(unsigned tid) - { - run(tid); - - lock_guard lock(mtx); - ready = true; - cv.notify_one(); - } - - void prepare() - { - ready = false; - pending = true; - } - - friend struct TaskSchedulerImpl; -}; - -#else //THORVG_THREAD_SUPPORT - -struct Task -{ -public: - INLIST_ITEM(Task); - - virtual ~Task() = default; - void done() {} - -protected: - virtual void run(unsigned tid) = 0; - -private: - friend struct TaskSchedulerImpl; -}; - -#endif //THORVG_THREAD_SUPPORT - - -struct TaskScheduler -{ - static uint32_t threads(); - static void init(uint32_t threads); - static void term(); - static void request(Task* task); - static void async(bool on); -}; - -} //namespace - -#endif //_TVG_TASK_SCHEDULER_H_ - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgText.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgText.cpp deleted file mode 100644 index 6cb2b4f..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgText.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - - -#include "tvgText.h" - - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - - -Text::Text() : pImpl(new Impl) -{ - Paint::pImpl->id = TVG_CLASS_ID_TEXT; -} - - -Text::~Text() -{ - delete(pImpl); -} - - -Result Text::text(const char* text) noexcept -{ - return pImpl->text(text); -} - - -Result Text::font(const char* name, float size, const char* style) noexcept -{ - return pImpl->font(name, size, style); -} - - -Result Text::load(const std::string& path) noexcept -{ - bool invalid; //invalid path - if (!LoaderMgr::loader(path, &invalid)) { - if (invalid) return Result::InvalidArguments; - else return Result::NonSupport; - } - - return Result::Success; -} - - -Result Text::unload(const std::string& path) noexcept -{ - if (LoaderMgr::retrieve(path)) return Result::Success; - return Result::InsufficientCondition; -} - - -Result Text::fill(uint8_t r, uint8_t g, uint8_t b) noexcept -{ - if (!pImpl->paint) return Result::InsufficientCondition; - - return pImpl->fill(r, g, b); -} - - -Result Text::fill(unique_ptr f) noexcept -{ - if (!pImpl->paint) return Result::InsufficientCondition; - - auto p = f.release(); - if (!p) return Result::MemoryCorruption; - - return pImpl->fill(p); -} - - -unique_ptr Text::gen() noexcept -{ - return unique_ptr(new Text); -} - - -uint32_t Text::identifier() noexcept -{ - return TVG_CLASS_ID_TEXT; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgText.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgText.h deleted file mode 100644 index 89cef18..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgText.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_TEXT_H -#define _TVG_TEXT_H - -#include -#include "tvgShape.h" -#include "tvgFill.h" - -#ifdef THORVG_TTF_LOADER_SUPPORT - #include "tvgTtfLoader.h" -#else - #include "tvgLoader.h" -#endif - -struct Text::Impl -{ - FontLoader* loader = nullptr; - Shape* paint = nullptr; - char* utf8 = nullptr; - float fontSize; - bool italic = false; - bool changed = false; - - ~Impl() - { - free(utf8); - LoaderMgr::retrieve(loader); - delete(paint); - } - - Result fill(uint8_t r, uint8_t g, uint8_t b) - { - return paint->fill(r, g, b); - } - - Result fill(Fill* f) - { - return paint->fill(cast(f)); - } - - Result text(const char* utf8) - { - free(this->utf8); - if (utf8) this->utf8 = strdup(utf8); - else this->utf8 = nullptr; - changed = true; - - return Result::Success; - } - - Result font(const char* name, float size, const char* style) - { - auto loader = LoaderMgr::loader(name); - if (!loader) return Result::InsufficientCondition; - - //Same resource has been loaded. - if (this->loader == loader) { - this->loader->sharing--; //make it sure the reference counting. - return Result::Success; - } else if (this->loader) { - LoaderMgr::retrieve(this->loader); - } - this->loader = static_cast(loader); - - if (!paint) paint = Shape::gen().release(); - - fontSize = size; - if (style && strstr(style, "italic")) italic = true; - changed = true; - return Result::Success; - } - - RenderRegion bounds(RenderMethod* renderer) - { - if (paint) return P(paint)->bounds(renderer); - else return {0, 0, 0, 0}; - } - - bool render(RenderMethod* renderer) - { - if (paint) return PP(paint)->render(renderer); - return false; - } - - bool load() - { - if (!loader) return false; - - //reload - if (changed) { - loader->request(paint, utf8, italic); - loader->read(); - changed = false; - } - if (paint) { - loader->resize(paint, fontSize, fontSize); - return true; - } - return false; - } - - RenderData update(RenderMethod* renderer, const RenderTransform* transform, Array& clips, uint8_t opacity, RenderUpdateFlag pFlag, bool clipper) - { - if (!load()) return nullptr; - - //transform the gradient coordinates based on the final scaled font. - if (P(paint)->flag & RenderUpdateFlag::Gradient) { - auto fill = P(paint)->rs.fill; - auto scale = 1.0f / loader->scale; - if (fill->identifier() == TVG_CLASS_ID_LINEAR) { - P(static_cast(fill))->x1 *= scale; - P(static_cast(fill))->y1 *= scale; - P(static_cast(fill))->x2 *= scale; - P(static_cast(fill))->y2 *= scale; - } else { - P(static_cast(fill))->cx *= scale; - P(static_cast(fill))->cy *= scale; - P(static_cast(fill))->r *= scale; - P(static_cast(fill))->fx *= scale; - P(static_cast(fill))->fy *= scale; - P(static_cast(fill))->fr *= scale; - } - } - return PP(paint)->update(renderer, transform, clips, opacity, pFlag, clipper); - } - - bool bounds(float* x, float* y, float* w, float* h, TVG_UNUSED bool stroking) - { - if (!load() || !paint) return false; - paint->bounds(x, y, w, h, true); - return true; - } - - Paint* duplicate() - { - load(); - - auto ret = Text::gen().release(); - auto dup = ret->pImpl; - if (paint) dup->paint = static_cast(paint->duplicate()); - - if (loader) { - dup->loader = loader; - ++dup->loader->sharing; - } - - dup->utf8 = strdup(utf8); - dup->italic = italic; - dup->fontSize = fontSize; - - return ret; - } - - Iterator* iterator() - { - return nullptr; - } -}; - - - -#endif //_TVG_TEXT_H - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgWgCanvas.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgWgCanvas.cpp deleted file mode 100644 index 3bdaec9..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgWgCanvas.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2023 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include "tvgCanvas.h" - -#ifdef THORVG_WG_RASTER_SUPPORT - #include "tvgWgRenderer.h" -#endif - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -struct WgCanvas::Impl -{ -}; - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -#ifdef THORVG_WG_RASTER_SUPPORT -WgCanvas::WgCanvas() : Canvas(WgRenderer::gen()), pImpl(new Impl) -#else -WgCanvas::WgCanvas() : Canvas(nullptr), pImpl(nullptr) -#endif -{ -} - -WgCanvas::~WgCanvas() -{ - delete pImpl; -} - -Result WgCanvas::target(void* window, uint32_t w, uint32_t h) noexcept -{ -#ifdef THORVG_WG_RASTER_SUPPORT - if (!window) return Result::InvalidArguments; - if ((w == 0) || (h == 0)) return Result::InvalidArguments; - - //We know renderer type, avoid dynamic_cast for performance. - auto renderer = static_cast(Canvas::pImpl->renderer); - if (!renderer) return Result::MemoryCorruption; - - if (!renderer->target(window, w, h)) return Result::Unknown; - Canvas::pImpl->vport = {0, 0, (int32_t)w, (int32_t)h}; - renderer->viewport(Canvas::pImpl->vport); - - //Paints must be updated again with this new target. - Canvas::pImpl->needRefresh(); - - return Result::Success; -#endif - return Result::NonSupport; -} - -unique_ptr WgCanvas::gen() noexcept -{ -#ifdef THORVG_WG_RASTER_SUPPORT - return unique_ptr(new WgCanvas); -#endif - return nullptr; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgXmlParser.cpp b/L3_Middlewares/LVGL/src/libs/thorvg/tvgXmlParser.cpp deleted file mode 100644 index ffb9b5d..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgXmlParser.cpp +++ /dev/null @@ -1,595 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#include -#include -#include - -#ifdef _WIN32 - #include -#elif defined(__linux__) - #include -#else - #include -#endif - -#include "tvgXmlParser.h" -#include "tvgStr.h" - -/************************************************************************/ -/* Internal Class Implementation */ -/************************************************************************/ - -bool _isIgnoreUnsupportedLogAttributes(TVG_UNUSED const char* tagAttribute, TVG_UNUSED const char* tagValue) -{ -#ifdef THORVG_LOG_ENABLED - const auto attributesNum = 6; - const struct - { - const char* tag; - bool tagWildcard; //If true, it is assumed that a wildcard is used after the tag. (ex: tagName*) - const char* value; - } attributes[] = { - {"id", false, nullptr}, - {"data-name", false, nullptr}, - {"overflow", false, "visible"}, - {"version", false, nullptr}, - {"xmlns", true, nullptr}, - {"xml:space", false, nullptr}, - }; - - for (unsigned int i = 0; i < attributesNum; ++i) { - if (!strncmp(tagAttribute, attributes[i].tag, attributes[i].tagWildcard ? strlen(attributes[i].tag) : strlen(tagAttribute))) { - if (attributes[i].value && tagValue) { - if (!strncmp(tagValue, attributes[i].value, strlen(tagValue))) { - return true; - } else continue; - } - return true; - } - } - return false; -#endif - return true; -} - - -static const char* _simpleXmlFindWhiteSpace(const char* itr, const char* itrEnd) -{ - for (; itr < itrEnd; itr++) { - if (isspace((unsigned char)*itr)) break; - } - return itr; -} - - -static const char* _simpleXmlSkipWhiteSpace(const char* itr, const char* itrEnd) -{ - for (; itr < itrEnd; itr++) { - if (!isspace((unsigned char)*itr)) break; - } - return itr; -} - - -static const char* _simpleXmlUnskipWhiteSpace(const char* itr, const char* itrStart) -{ - for (itr--; itr > itrStart; itr--) { - if (!isspace((unsigned char)*itr)) break; - } - return itr + 1; -} - - -static const char* _simpleXmlSkipXmlEntities(const char* itr, const char* itrEnd) -{ - auto p = itr; - while (itr < itrEnd && *itr == '&') { - for (int i = 0; i < NUMBER_OF_XML_ENTITIES; ++i) { - if (strncmp(itr, xmlEntity[i], xmlEntityLength[i]) == 0) { - itr += xmlEntityLength[i]; - break; - } - } - if (itr == p) break; - p = itr; - } - return itr; -} - - -static const char* _simpleXmlUnskipXmlEntities(const char* itr, const char* itrStart) -{ - auto p = itr; - while (itr > itrStart && *(itr - 1) == ';') { - for (int i = 0; i < NUMBER_OF_XML_ENTITIES; ++i) { - if (itr - xmlEntityLength[i] > itrStart && - strncmp(itr - xmlEntityLength[i], xmlEntity[i], xmlEntityLength[i]) == 0) { - itr -= xmlEntityLength[i]; - break; - } - } - if (itr == p) break; - p = itr; - } - return itr; -} - - -static const char* _skipWhiteSpacesAndXmlEntities(const char* itr, const char* itrEnd) -{ - itr = _simpleXmlSkipWhiteSpace(itr, itrEnd); - auto p = itr; - while (true) { - if (p != (itr = _simpleXmlSkipXmlEntities(itr, itrEnd))) p = itr; - else break; - if (p != (itr = _simpleXmlSkipWhiteSpace(itr, itrEnd))) p = itr; - else break; - } - return itr; -} - - -static const char* _unskipWhiteSpacesAndXmlEntities(const char* itr, const char* itrStart) -{ - itr = _simpleXmlUnskipWhiteSpace(itr, itrStart); - auto p = itr; - while (true) { - if (p != (itr = _simpleXmlUnskipXmlEntities(itr, itrStart))) p = itr; - else break; - if (p != (itr = _simpleXmlUnskipWhiteSpace(itr, itrStart))) p = itr; - else break; - } - return itr; -} - - -static const char* _simpleXmlFindStartTag(const char* itr, const char* itrEnd) -{ - return (const char*)memchr(itr, '<', itrEnd - itr); -} - - -static const char* _simpleXmlFindEndTag(const char* itr, const char* itrEnd) -{ - bool insideQuote[2] = {false, false}; // 0: ", 1: ' - for (; itr < itrEnd; itr++) { - if (*itr == '"' && !insideQuote[1]) insideQuote[0] = !insideQuote[0]; - if (*itr == '\'' && !insideQuote[0]) insideQuote[1] = !insideQuote[1]; - if (!insideQuote[0] && !insideQuote[1]) { - if ((*itr == '>') || (*itr == '<')) - return itr; - } - } - return nullptr; -} - - -static const char* _simpleXmlFindEndCommentTag(const char* itr, const char* itrEnd) -{ - for (; itr < itrEnd; itr++) { - if ((*itr == '-') && ((itr + 1 < itrEnd) && (*(itr + 1) == '-')) && ((itr + 2 < itrEnd) && (*(itr + 2) == '>'))) return itr + 2; - } - return nullptr; -} - - -static const char* _simpleXmlFindEndCdataTag(const char* itr, const char* itrEnd) -{ - for (; itr < itrEnd; itr++) { - if ((*itr == ']') && ((itr + 1 < itrEnd) && (*(itr + 1) == ']')) && ((itr + 2 < itrEnd) && (*(itr + 2) == '>'))) return itr + 2; - } - return nullptr; -} - - -static const char* _simpleXmlFindDoctypeChildEndTag(const char* itr, const char* itrEnd) -{ - for (; itr < itrEnd; itr++) { - if (*itr == '>') return itr; - } - return nullptr; -} - - -static SimpleXMLType _getXMLType(const char* itr, const char* itrEnd, size_t &toff) -{ - toff = 0; - if (itr[1] == '/') { - toff = 1; - return SimpleXMLType::Close; - } else if (itr[1] == '?') { - toff = 1; - return SimpleXMLType::Processing; - } else if (itr[1] == '!') { - if ((itr + sizeof("") - 1 < itrEnd) && (!memcmp(itr + 2, "DOCTYPE", sizeof("DOCTYPE") - 1)) && ((itr[2 + sizeof("DOCTYPE") - 1] == '>') || (isspace((unsigned char)itr[2 + sizeof("DOCTYPE") - 1])))) { - toff = sizeof("!DOCTYPE") - 1; - return SimpleXMLType::Doctype; - } else if ((itr + sizeof("") - 1 < itrEnd) && (!memcmp(itr + 2, "[CDATA[", sizeof("[CDATA[") - 1))) { - toff = sizeof("![CDATA[") - 1; - return SimpleXMLType::CData; - } else if ((itr + sizeof("") - 1 < itrEnd) && (!memcmp(itr + 2, "--", sizeof("--") - 1))) { - toff = sizeof("!--") - 1; - return SimpleXMLType::Comment; - } else if (itr + sizeof("") - 1 < itrEnd) { - toff = sizeof("!") - 1; - return SimpleXMLType::DoctypeChild; - } - return SimpleXMLType::Open; - } - return SimpleXMLType::Open; -} - - -/************************************************************************/ -/* External Class Implementation */ -/************************************************************************/ - -const char* simpleXmlNodeTypeToString(TVG_UNUSED SvgNodeType type) -{ -#ifdef THORVG_LOG_ENABLED - static const char* TYPE_NAMES[] = { - "Svg", - "G", - "Defs", - "Animation", - "Arc", - "Circle", - "Ellipse", - "Image", - "Line", - "Path", - "Polygon", - "Polyline", - "Rect", - "Text", - "TextArea", - "Tspan", - "Use", - "Video", - "ClipPath", - "Mask", - "Symbol", - "Unknown", - }; - return TYPE_NAMES[(int) type]; -#endif - return nullptr; -} - - -bool isIgnoreUnsupportedLogElements(TVG_UNUSED const char* tagName) -{ -#ifdef THORVG_LOG_ENABLED - const auto elementsNum = 1; - const char* const elements[] = { "title" }; - - for (unsigned int i = 0; i < elementsNum; ++i) { - if (!strncmp(tagName, elements[i], strlen(tagName))) { - return true; - } - } - return false; -#else - return true; -#endif -} - - -bool simpleXmlParseAttributes(const char* buf, unsigned bufLength, simpleXMLAttributeCb func, const void* data) -{ - const char *itr = buf, *itrEnd = buf + bufLength; - char* tmpBuf = (char*)malloc(bufLength + 1); - - if (!buf || !func || !tmpBuf) goto error; - - while (itr < itrEnd) { - const char* p = _skipWhiteSpacesAndXmlEntities(itr, itrEnd); - const char *key, *keyEnd, *value, *valueEnd; - char* tval; - - if (p == itrEnd) goto success; - - key = p; - for (keyEnd = key; keyEnd < itrEnd; keyEnd++) { - if ((*keyEnd == '=') || (isspace((unsigned char)*keyEnd))) break; - } - if (keyEnd == itrEnd) goto error; - if (keyEnd == key) { // There is no key. This case is invalid, but explores the following syntax. - itr = keyEnd + 1; - continue; - } - - if (*keyEnd == '=') value = keyEnd + 1; - else { - value = (const char*)memchr(keyEnd, '=', itrEnd - keyEnd); - if (!value) goto error; - value++; - } - keyEnd = _simpleXmlUnskipXmlEntities(keyEnd, key); - - value = _skipWhiteSpacesAndXmlEntities(value, itrEnd); - if (value == itrEnd) goto error; - - if ((*value == '"') || (*value == '\'')) { - valueEnd = (const char*)memchr(value + 1, *value, itrEnd - value); - if (!valueEnd) goto error; - value++; - } else { - valueEnd = _simpleXmlFindWhiteSpace(value, itrEnd); - } - - itr = valueEnd + 1; - - value = _skipWhiteSpacesAndXmlEntities(value, itrEnd); - valueEnd = _unskipWhiteSpacesAndXmlEntities(valueEnd, value); - - memcpy(tmpBuf, key, keyEnd - key); - tmpBuf[keyEnd - key] = '\0'; - - tval = tmpBuf + (keyEnd - key) + 1; - int i = 0; - while (value < valueEnd) { - value = _simpleXmlSkipXmlEntities(value, valueEnd); - tval[i++] = *value; - value++; - } - tval[i] = '\0'; - - if (!func((void*)data, tmpBuf, tval)) { - if (!_isIgnoreUnsupportedLogAttributes(tmpBuf, tval)) { - TVGLOG("SVG", "Unsupported attributes used [Elements type: %s][Id : %s][Attribute: %s][Value: %s]", simpleXmlNodeTypeToString(((SvgLoaderData*)data)->svgParse->node->type), ((SvgLoaderData*)data)->svgParse->node->id ? ((SvgLoaderData*)data)->svgParse->node->id : "NO_ID", tmpBuf, tval ? tval : "NONE"); - } - } - } - -success: - free(tmpBuf); - return true; - -error: - free(tmpBuf); - return false; -} - - -bool simpleXmlParse(const char* buf, unsigned bufLength, bool strip, simpleXMLCb func, const void* data) -{ - const char *itr = buf, *itrEnd = buf + bufLength; - - if (!buf || !func) return false; - - while (itr < itrEnd) { - if (itr[0] == '<') { - //Invalid case - if (itr + 1 >= itrEnd) return false; - - size_t toff = 0; - SimpleXMLType type = _getXMLType(itr, itrEnd, toff); - - const char* p; - if (type == SimpleXMLType::CData) p = _simpleXmlFindEndCdataTag(itr + 1 + toff, itrEnd); - else if (type == SimpleXMLType::DoctypeChild) p = _simpleXmlFindDoctypeChildEndTag(itr + 1 + toff, itrEnd); - else if (type == SimpleXMLType::Comment) p = _simpleXmlFindEndCommentTag(itr + 1 + toff, itrEnd); - else p = _simpleXmlFindEndTag(itr + 1 + toff, itrEnd); - - if (p) { - //Invalid case: '<' nested - if (*p == '<' && type != SimpleXMLType::Doctype) return false; - const char *start, *end; - - start = itr + 1 + toff; - end = p; - - switch (type) { - case SimpleXMLType::Open: { - if (p[-1] == '/') { - type = SimpleXMLType::OpenEmpty; - end--; - } - break; - } - case SimpleXMLType::CData: { - if (!memcmp(p - 2, "]]", 2)) end -= 2; - break; - } - case SimpleXMLType::Processing: { - if (p[-1] == '?') end--; - break; - } - case SimpleXMLType::Comment: { - if (!memcmp(p - 2, "--", 2)) end -= 2; - break; - } - default: { - break; - } - } - - if (strip && (type != SimpleXMLType::CData)) { - start = _skipWhiteSpacesAndXmlEntities(start, end); - end = _unskipWhiteSpacesAndXmlEntities(end, start); - } - - if (!func((void*)data, type, start, (unsigned int)(end - start))) return false; - - itr = p + 1; - } else { - return false; - } - } else { - const char *p, *end; - - if (strip) { - p = itr; - p = _skipWhiteSpacesAndXmlEntities(p, itrEnd); - if (p) { - if (!func((void*)data, SimpleXMLType::Ignored, itr, (unsigned int)(p - itr))) return false; - itr = p; - } - } - - p = _simpleXmlFindStartTag(itr, itrEnd); - if (!p) p = itrEnd; - - end = p; - if (strip) end = _unskipWhiteSpacesAndXmlEntities(end, itr); - - if (itr != end && !func((void*)data, SimpleXMLType::Data, itr, (unsigned int)(end - itr))) return false; - - if (strip && (end < p) && !func((void*)data, SimpleXMLType::Ignored, end, (unsigned int)(p - end))) return false; - - itr = p; - } - } - return true; -} - - -bool simpleXmlParseW3CAttribute(const char* buf, unsigned bufLength, simpleXMLAttributeCb func, const void* data) -{ - const char* end; - char* key; - char* val; - char* next; - - if (!buf) return false; - - end = buf + bufLength; - key = (char*)alloca(end - buf + 1); - val = (char*)alloca(end - buf + 1); - - if (buf == end) return true; - - do { - char* sep = (char*)strchr(buf, ':'); - next = (char*)strchr(buf, ';'); - if (sep >= end) { - next = nullptr; - sep = nullptr; - } - if (next >= end) next = nullptr; - - key[0] = '\0'; - val[0] = '\0'; - - if (next == nullptr && sep != nullptr) { - memcpy(key, buf, sep - buf); - key[sep - buf] = '\0'; - - memcpy(val, sep + 1, end - sep - 1); - val[end - sep - 1] = '\0'; - } else if (sep < next && sep != nullptr) { - memcpy(key, buf, sep - buf); - key[sep - buf] = '\0'; - - memcpy(val, sep + 1, next - sep - 1); - val[next - sep - 1] = '\0'; - } else if (next) { - memcpy(key, buf, next - buf); - key[next - buf] = '\0'; - } - - if (key[0]) { - key = const_cast(_simpleXmlSkipWhiteSpace(key, key + strlen(key))); - key[_simpleXmlUnskipWhiteSpace(key + strlen(key) , key) - key] = '\0'; - val = const_cast(_simpleXmlSkipWhiteSpace(val, val + strlen(val))); - val[_simpleXmlUnskipWhiteSpace(val + strlen(val) , val) - val] = '\0'; - - if (!func((void*)data, key, val)) { - if (!_isIgnoreUnsupportedLogAttributes(key, val)) { - TVGLOG("SVG", "Unsupported attributes used [Elements type: %s][Id : %s][Attribute: %s][Value: %s]", simpleXmlNodeTypeToString(((SvgLoaderData*)data)->svgParse->node->type), ((SvgLoaderData*)data)->svgParse->node->id ? ((SvgLoaderData*)data)->svgParse->node->id : "NO_ID", key, val ? val : "NONE"); - } - } - } - - buf = next + 1; - } while (next != nullptr); - - return true; -} - - -/* - * Supported formats: - * tag {}, .name {}, tag.name{} - */ -const char* simpleXmlParseCSSAttribute(const char* buf, unsigned bufLength, char** tag, char** name, const char** attrs, unsigned* attrsLength) -{ - if (!buf) return nullptr; - - *tag = *name = nullptr; - *attrsLength = 0; - - auto itr = _simpleXmlSkipWhiteSpace(buf, buf + bufLength); - auto itrEnd = (const char*)memchr(buf, '{', bufLength); - - if (!itrEnd || itr == itrEnd) return nullptr; - - auto nextElement = (const char*)memchr(itrEnd, '}', bufLength - (itrEnd - buf)); - if (!nextElement) return nullptr; - - *attrs = itrEnd + 1; - *attrsLength = nextElement - *attrs; - - const char *p; - - itrEnd = _simpleXmlUnskipWhiteSpace(itrEnd, itr); - if (*(itrEnd - 1) == '.') return nullptr; - - for (p = itr; p < itrEnd; p++) { - if (*p == '.') break; - } - - if (p == itr) *tag = strdup("all"); - else *tag = strDuplicate(itr, p - itr); - - if (p == itrEnd) *name = nullptr; - else *name = strDuplicate(p + 1, itrEnd - p - 1); - - return (nextElement ? nextElement + 1 : nullptr); -} - - -const char* simpleXmlFindAttributesTag(const char* buf, unsigned bufLength) -{ - const char *itr = buf, *itrEnd = buf + bufLength; - - for (; itr < itrEnd; itr++) { - if (!isspace((unsigned char)*itr)) { - //User skip tagname and already gave it the attributes. - if (*itr == '=') return buf; - } else { - itr = _simpleXmlUnskipXmlEntities(itr, buf); - if (itr == itrEnd) return nullptr; - return itr; - } - } - - return nullptr; -} - -#endif /* LV_USE_THORVG_INTERNAL */ - diff --git a/L3_Middlewares/LVGL/src/libs/thorvg/tvgXmlParser.h b/L3_Middlewares/LVGL/src/libs/thorvg/tvgXmlParser.h deleted file mode 100644 index be08068..0000000 --- a/L3_Middlewares/LVGL/src/libs/thorvg/tvgXmlParser.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "../../lv_conf_internal.h" -#if LV_USE_THORVG_INTERNAL - -#ifndef _TVG_SIMPLE_XML_PARSER_H_ -#define _TVG_SIMPLE_XML_PARSER_H_ - -#include "tvgSvgLoaderCommon.h" - -#define NUMBER_OF_XML_ENTITIES 9 -const char* const xmlEntity[] = {" ", """, " ", "'", "&", "<", ">", "#", "'"}; -const int xmlEntityLength[] = {5, 6, 6, 6, 5, 4, 4, 6, 6}; - -enum class SimpleXMLType -{ - Open = 0, //!< \ - OpenEmpty, //!< \ - Close, //!< \ - Data, //!< tag text data - CData, //!< \ - Error, //!< error contents - Processing, //!< \ \ - Doctype, //!< \ - Ignored, //!< whatever is ignored by parser, like whitespace - DoctypeChild //!< \font_draw_buf_handlers) - -/********************* - * DEFINES - *********************/ - -#define STB_RECT_PACK_IMPLEMENTATION -#define STBRP_STATIC -#define STBTT_STATIC -#define STB_TRUETYPE_IMPLEMENTATION -#define STBTT_HEAP_FACTOR_SIZE_32 50 -#define STBTT_HEAP_FACTOR_SIZE_128 20 -#define STBTT_HEAP_FACTOR_SIZE_DEFAULT 10 -#define STBTT_malloc(x, u) ((void)(u), lv_malloc(x)) -#define STBTT_free(x, u) ((void)(u), lv_free(x)) - -#if LV_TINY_TTF_FILE_SUPPORT != 0 -/* for stream support */ -#define STBTT_STREAM_TYPE ttf_cb_stream_t * -#define STBTT_STREAM_SEEK(s, x) ttf_cb_stream_seek(s, x); -#define STBTT_STREAM_READ(s, x, y) ttf_cb_stream_read(s, x, y); - -/* a hydra stream that can be in memory or from a file*/ -typedef struct ttf_cb_stream { - lv_fs_file_t * file; - const void * data; - size_t size; - size_t position; -} ttf_cb_stream_t; - -static void ttf_cb_stream_read(ttf_cb_stream_t * stream, void * data, size_t to_read); -static void ttf_cb_stream_seek(ttf_cb_stream_t * stream, size_t position); -#endif - -#include "stb_rect_pack.h" -#include "stb_truetype_htcw.h" - -/********************** - * TYPEDEFS - **********************/ - -typedef struct ttf_font_desc { - lv_fs_file_t file; -#if LV_TINY_TTF_FILE_SUPPORT != 0 - ttf_cb_stream_t stream; -#else - const uint8_t * stream; -#endif - stbtt_fontinfo info; - float scale; - int ascent; - int descent; - - lv_font_kerning_t kerning; - - int cache_size; - lv_cache_t * glyph_cache; - lv_cache_t * draw_data_cache; -} ttf_font_desc_t; - -typedef struct _tiny_ttf_glyph_cache_data_t { - uint32_t unicode; - int adv_w; - lv_font_glyph_dsc_t glyph_dsc; -} tiny_ttf_glyph_cache_data_t; - -typedef struct lv_tiny_ttf_cache_data_t { - uint32_t glyph_index; - uint32_t size; - lv_draw_buf_t * draw_buf; -} tiny_ttf_cache_data_t; -/********************** - * STATIC PROTOTYPES - **********************/ -static bool ttf_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, - uint32_t unicode_letter_next); -static const void * ttf_get_glyph_bitmap_cb(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf); -static void ttf_release_glyph_cb(const lv_font_t * font, lv_font_glyph_dsc_t * g_dsc); -static lv_font_t * lv_tiny_ttf_create(const char * path, const void * data, size_t data_size, - int32_t font_size, lv_font_kerning_t kerning, - size_t cache_size); - -static bool tiny_ttf_glyph_cache_create_cb(tiny_ttf_glyph_cache_data_t * node, void * user_data); -static void tiny_ttf_glyph_cache_free_cb(tiny_ttf_glyph_cache_data_t * node, void * user_data); -static lv_cache_compare_res_t tiny_ttf_glyph_cache_compare_cb(const tiny_ttf_glyph_cache_data_t * lhs, - const tiny_ttf_glyph_cache_data_t * rhs); - -static bool tiny_ttf_draw_data_cache_create_cb(tiny_ttf_cache_data_t * node, void * user_data); -static void tiny_ttf_draw_data_cache_free_cb(tiny_ttf_cache_data_t * node, void * user_data); -static lv_cache_compare_res_t tiny_ttf_draw_data_cache_compare_cb(const tiny_ttf_cache_data_t * lhs, - const tiny_ttf_cache_data_t * rhs); - -static void lv_tiny_ttf_cache_create(ttf_font_desc_t * dsc); -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_tiny_ttf_set_size(lv_font_t * font, int32_t font_size) -{ - if(font_size <= 0) { - LV_LOG_ERROR("invalid font size: %"LV_PRIx32, font_size); - return; - } - ttf_font_desc_t * dsc = (ttf_font_desc_t *)font->dsc; - dsc->scale = stbtt_ScaleForMappingEmToPixels(&dsc->info, font_size); - int line_gap = 0; - stbtt_GetFontVMetrics(&dsc->info, &dsc->ascent, &dsc->descent, &line_gap); - font->line_height = (int32_t)(dsc->scale * (dsc->ascent - dsc->descent + line_gap)); - font->base_line = (int32_t)(dsc->scale * (line_gap - dsc->descent)); - - /* size change means cache needs to be invalidated. */ - - if(dsc->glyph_cache) { - lv_cache_destroy(dsc->glyph_cache, NULL); - dsc->glyph_cache = NULL; - } - - if(dsc->draw_data_cache) { - lv_cache_destroy(dsc->draw_data_cache, NULL); - dsc->draw_data_cache = NULL; - } - - lv_tiny_ttf_cache_create(dsc); -} - -void lv_tiny_ttf_destroy(lv_font_t * font) -{ - LV_ASSERT_NULL(font); - - if(font->dsc != NULL) { - ttf_font_desc_t * ttf = (ttf_font_desc_t *)font->dsc; -#if LV_TINY_TTF_FILE_SUPPORT != 0 - if(ttf->stream.file != NULL) { - lv_fs_close(&ttf->file); - } -#endif - lv_cache_destroy(ttf->glyph_cache, NULL); - lv_cache_destroy(ttf->draw_data_cache, NULL); - lv_free(ttf); - font->dsc = NULL; - } - - lv_free(font); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#if LV_TINY_TTF_FILE_SUPPORT != 0 -static void ttf_cb_stream_read(ttf_cb_stream_t * stream, void * data, size_t to_read) -{ - if(stream->file != NULL) { - uint32_t br; - lv_fs_read(stream->file, data, to_read, &br); - } - else { - if(to_read + stream->position >= stream->size) { - to_read = stream->size - stream->position; - } - memcpy(data, ((const unsigned char *)stream->data + stream->position), to_read); - stream->position += to_read; - } -} -static void ttf_cb_stream_seek(ttf_cb_stream_t * stream, size_t position) -{ - if(stream->file != NULL) { - lv_fs_seek(stream->file, position, LV_FS_SEEK_SET); - } - else { - if(position > stream->size) { - stream->position = stream->size; - } - else { - stream->position = position; - } - } -} -#endif - -static bool ttf_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, - uint32_t unicode_letter_next) -{ - if(unicode_letter < 0x20 || - unicode_letter == 0xf8ff || /*LV_SYMBOL_DUMMY*/ - unicode_letter == 0x200c) { /*ZERO WIDTH NON-JOINER*/ - dsc_out->box_w = 0; - dsc_out->adv_w = 0; - dsc_out->box_h = 0; /*height of the bitmap in [px]*/ - dsc_out->ofs_x = 0; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = 0; /*Y offset of the bitmap in [pf]*/ - dsc_out->format = LV_FONT_GLYPH_FORMAT_NONE; - dsc_out->is_placeholder = false; - return true; - } - - ttf_font_desc_t * dsc = (ttf_font_desc_t *)font->dsc; - - tiny_ttf_glyph_cache_data_t search_key = { - .unicode = unicode_letter, - }; - - int adv_w; - lv_cache_entry_t * entry = lv_cache_acquire_or_create(dsc->glyph_cache, &search_key, (void *)dsc); - - if(entry == NULL) { - if(!dsc->cache_size) { /* no cache, do everything directly */ - uint32_t g1 = stbtt_FindGlyphIndex(&dsc->info, (int)unicode_letter); - tiny_ttf_glyph_cache_create_cb(&search_key, dsc); - *dsc_out = search_key.glyph_dsc; - adv_w = search_key.adv_w; - - /*Kerning correction*/ - if(font->kerning == LV_FONT_KERNING_NORMAL && - unicode_letter_next != 0) { - int g2 = stbtt_FindGlyphIndex(&dsc->info, (int)unicode_letter_next); /* not using cache, only do glyph id lookup */ - if(g2) { - int k = stbtt_GetGlyphKernAdvance(&dsc->info, g1, g2); - dsc_out->adv_w = (uint16_t)floor((((float)adv_w + (float)k) * dsc->scale) + - 0.5f); /*Horizontal space required by the glyph in [px]*/ - } - } - - dsc_out->entry = NULL; - return true; - } - LV_LOG_ERROR("cache not allocated"); - return false; - } - - tiny_ttf_glyph_cache_data_t * data = lv_cache_entry_get_data(entry); - *dsc_out = data->glyph_dsc; - adv_w = data->adv_w; - lv_cache_release(dsc->glyph_cache, entry, NULL); - - /*Kerning correction*/ - if(font->kerning == LV_FONT_KERNING_NORMAL && - unicode_letter_next != 0) { /* check if we need to do any kerning calculations */ - uint32_t g1 = dsc_out->gid.index; - - int g2 = 0; - search_key.unicode = unicode_letter_next; /* reuse search key */ - lv_cache_entry_t * entry_next = lv_cache_acquire_or_create(dsc->glyph_cache, &search_key, (void *)dsc); - - if(entry_next == NULL) - g2 = stbtt_FindGlyphIndex(&dsc->info, (int)unicode_letter_next); - else { - tiny_ttf_glyph_cache_data_t * data_next = lv_cache_entry_get_data(entry_next); - g2 = data_next->glyph_dsc.gid.index; - lv_cache_release(dsc->glyph_cache, entry_next, NULL); - } - - if(g2) { - int k = stbtt_GetGlyphKernAdvance(&dsc->info, g1, g2); - dsc_out->adv_w = (uint16_t)floor((((float)adv_w + (float)k) * dsc->scale) + - 0.5f); /*Horizontal space required by the glyph in [px]*/ - } - } - - dsc_out->entry = NULL; - return true; /*true: glyph found; false: glyph was not found*/ -} - -static const void * ttf_get_glyph_bitmap_cb(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf) -{ - LV_UNUSED(draw_buf); - uint32_t glyph_index = g_dsc->gid.index; - const lv_font_t * font = g_dsc->resolved_font; - ttf_font_desc_t * dsc = (ttf_font_desc_t *)font->dsc; - tiny_ttf_cache_data_t search_key = { - .glyph_index = glyph_index, - .size = font->line_height, - }; - - lv_cache_entry_t * entry = lv_cache_acquire_or_create(dsc->draw_data_cache, &search_key, (void *)font->dsc); - if(entry == NULL) { - if(!dsc->cache_size) { /* no cache, do everything directly */ - if(tiny_ttf_draw_data_cache_create_cb(&search_key, (void *)font->dsc)) { - /* use the cache entry to store the buffer if no cache specified */ - g_dsc->entry = (lv_cache_entry_t *)search_key.draw_buf; - return g_dsc->entry; - } - else { - return NULL; - } - } - LV_LOG_ERROR("cache not allocated"); - return NULL; - } - - g_dsc->entry = entry; - tiny_ttf_cache_data_t * cached_data = lv_cache_entry_get_data(entry); - return cached_data->draw_buf; -} - -static void ttf_release_glyph_cb(const lv_font_t * font, lv_font_glyph_dsc_t * g_dsc) -{ - LV_ASSERT_NULL(font); - - ttf_font_desc_t * dsc = (ttf_font_desc_t *)font->dsc; - if(!dsc->cache_size) { /* no cache, do everything directly */ - lv_draw_buf_destroy_user(font_draw_buf_handlers, (lv_draw_buf_t *)g_dsc->entry); - } - else { - if(g_dsc->entry == NULL) { - return; - } - lv_cache_release(dsc->draw_data_cache, g_dsc->entry, NULL); - } - g_dsc->entry = NULL; -} - -static void lv_tiny_ttf_cache_create(ttf_font_desc_t * dsc) -{ - /*Init cache*/ - dsc->glyph_cache = lv_cache_create(&lv_cache_class_lru_rb_count, sizeof(tiny_ttf_glyph_cache_data_t), dsc->cache_size, - (lv_cache_ops_t) { - .compare_cb = (lv_cache_compare_cb_t)tiny_ttf_glyph_cache_compare_cb, - .create_cb = (lv_cache_create_cb_t)tiny_ttf_glyph_cache_create_cb, - .free_cb = (lv_cache_free_cb_t)tiny_ttf_glyph_cache_free_cb - }); - lv_cache_set_name(dsc->glyph_cache, "TINY_TTF_GLYPH"); - - dsc->draw_data_cache = lv_cache_create(&lv_cache_class_lru_rb_count, sizeof(tiny_ttf_cache_data_t), dsc->cache_size, - (lv_cache_ops_t) { - .compare_cb = (lv_cache_compare_cb_t)tiny_ttf_draw_data_cache_compare_cb, - .create_cb = (lv_cache_create_cb_t)tiny_ttf_draw_data_cache_create_cb, - .free_cb = (lv_cache_free_cb_t)tiny_ttf_draw_data_cache_free_cb, - }); - lv_cache_set_name(dsc->draw_data_cache, "TINY_TTF_DRAW_DATA"); -} - -static lv_font_t * lv_tiny_ttf_create(const char * path, const void * data, size_t data_size, int32_t font_size, - lv_font_kerning_t kerning, size_t cache_size) -{ - LV_UNUSED(data_size); - if((path == NULL && data == NULL) || 0 >= font_size) { - LV_LOG_ERROR("tiny_ttf: invalid argument"); - return NULL; - } - ttf_font_desc_t * dsc = lv_malloc_zeroed(sizeof(ttf_font_desc_t)); - if(dsc == NULL) { - LV_LOG_ERROR("tiny_ttf: out of memory"); - return NULL; - } -#if LV_TINY_TTF_FILE_SUPPORT != 0 - if(path != NULL) { - if(LV_FS_RES_OK != lv_fs_open(&dsc->file, path, LV_FS_MODE_RD)) { - lv_free(dsc); - LV_LOG_ERROR("tiny_ttf: unable to open %s\n", path); - return NULL; - } - dsc->stream.file = &dsc->file; - } - else { - dsc->stream.data = (const uint8_t *)data; - dsc->stream.size = data_size; - } - if(0 == stbtt_InitFont(&dsc->info, &dsc->stream, stbtt_GetFontOffsetForIndex(&dsc->stream, 0))) { - lv_free(dsc); - LV_LOG_ERROR("tiny_ttf: init failed"); - return NULL; - } - -#else - dsc->stream = (const uint8_t *)data; - if(0 == stbtt_InitFont(&dsc->info, dsc->stream, stbtt_GetFontOffsetForIndex(dsc->stream, 0))) { - lv_free(dsc); - LV_LOG_ERROR("tiny_ttf: init failed"); - return NULL; - } -#endif - - dsc->cache_size = cache_size; - - lv_font_t * out_font = lv_malloc_zeroed(sizeof(lv_font_t)); - if(out_font == NULL) { - lv_free(dsc); - LV_LOG_ERROR("tiny_ttf: out of memory"); - return NULL; - } - - /* check if font has kerning tables to use, else disable kerning automatically. */ - if(stbtt_KernTableCheck(&dsc->info) == 0) { - kerning = LV_FONT_KERNING_NONE; /* disable kerning if font has no tables. */ - } - - dsc->kerning = kerning; - out_font->kerning = kerning; - - out_font->get_glyph_dsc = ttf_get_glyph_dsc_cb; - out_font->get_glyph_bitmap = ttf_get_glyph_bitmap_cb; - out_font->release_glyph = ttf_release_glyph_cb; - out_font->dsc = dsc; - lv_tiny_ttf_set_size(out_font, font_size); - return out_font; -} -#if LV_TINY_TTF_FILE_SUPPORT != 0 -lv_font_t * lv_tiny_ttf_create_file_ex(const char * path, int32_t font_size, lv_font_kerning_t kerning, - size_t cache_size) -{ - return lv_tiny_ttf_create(path, NULL, 0, font_size, kerning, cache_size); -} -lv_font_t * lv_tiny_ttf_create_file(const char * path, int32_t font_size) -{ - return lv_tiny_ttf_create(path, NULL, 0, font_size, LV_FONT_KERNING_NORMAL, LV_TINY_TTF_CACHE_GLYPH_CNT); -} -#endif - -lv_font_t * lv_tiny_ttf_create_data_ex(const void * data, size_t data_size, int32_t font_size, - lv_font_kerning_t kerning, size_t cache_size) -{ - return lv_tiny_ttf_create(NULL, data, data_size, font_size, kerning, cache_size); -} -lv_font_t * lv_tiny_ttf_create_data(const void * data, size_t data_size, int32_t font_size) -{ - return lv_tiny_ttf_create(NULL, data, data_size, font_size, LV_FONT_KERNING_NORMAL, LV_TINY_TTF_CACHE_GLYPH_CNT); -} - -/*----------------- - * Cache Callbacks - *----------------*/ - -static bool tiny_ttf_glyph_cache_create_cb(tiny_ttf_glyph_cache_data_t * node, void * user_data) -{ - ttf_font_desc_t * dsc = (ttf_font_desc_t *)user_data; - lv_font_glyph_dsc_t * dsc_out = &node->glyph_dsc; - - uint32_t unicode_letter = node->unicode; - - int g1 = stbtt_FindGlyphIndex(&dsc->info, (int)unicode_letter); - if(g1 == 0) { - /* Glyph not found */ - return false; - } - int x1, y1, x2, y2; - - stbtt_GetGlyphBitmapBox(&dsc->info, g1, dsc->scale, dsc->scale, &x1, &y1, &x2, &y2); - - int advw, lsb; - stbtt_GetGlyphHMetrics(&dsc->info, g1, &advw, &lsb); - if(dsc->kerning != LV_FONT_KERNING_NORMAL) { /* calculate default advance */ - int k = stbtt_GetGlyphKernAdvance(&dsc->info, g1, 0); - dsc_out->adv_w = (uint16_t)floor((((float)advw + (float)k) * dsc->scale) + - 0.5f); /*Horizontal space required by the glyph in [px]*/ - } - else { - dsc_out->adv_w = (uint16_t)floor(((float)advw * dsc->scale) + - 0.5f); /*Horizontal space required by the glyph in [px]*/; - } - /* precalculate no kerning value */ - node->adv_w = advw; - dsc_out->box_w = (x2 - x1 + 1); /*width of the bitmap in [px]*/ - dsc_out->box_h = (y2 - y1 + 1); /*height of the bitmap in [px]*/ - dsc_out->ofs_x = x1; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -y2; /*Y offset of the bitmap measured from the as line*/ - dsc_out->format = LV_FONT_GLYPH_FORMAT_A8; - dsc_out->is_placeholder = false; - dsc_out->gid.index = (uint32_t)g1; - - return true; -} - -static void tiny_ttf_glyph_cache_free_cb(tiny_ttf_glyph_cache_data_t * node, void * user_data) -{ - LV_UNUSED(node); - LV_UNUSED(user_data); -} - -static lv_cache_compare_res_t tiny_ttf_glyph_cache_compare_cb(const tiny_ttf_glyph_cache_data_t * lhs, - const tiny_ttf_glyph_cache_data_t * rhs) -{ - if(lhs->unicode != rhs->unicode) { - return lhs->unicode > rhs->unicode ? 1 : -1; - } - - return 0; -} - -static bool tiny_ttf_draw_data_cache_create_cb(tiny_ttf_cache_data_t * node, void * user_data) -{ - int g1 = (int)node->glyph_index; - if(g1 == 0) { - /* Glyph not found */ - return false; - } - - ttf_font_desc_t * dsc = (ttf_font_desc_t *)user_data; - - const stbtt_fontinfo * info = (const stbtt_fontinfo *)&dsc->info; - int x1, y1, x2, y2; - stbtt_GetGlyphBitmapBox(info, g1, dsc->scale, dsc->scale, &x1, &y1, &x2, &y2); - int w, h; - w = x2 - x1 + 1; - h = y2 - y1 + 1; - - lv_draw_buf_t * draw_buf = lv_draw_buf_create_ex(font_draw_buf_handlers, w, h, LV_COLOR_FORMAT_A8, LV_STRIDE_AUTO); - if(NULL == draw_buf) { - LV_LOG_ERROR("tiny_ttf: out of memory"); - return false; - } - - lv_draw_buf_clear(draw_buf, NULL); - - uint32_t stride = draw_buf->header.stride; - stbtt_MakeGlyphBitmap(info, draw_buf->data, w, h, stride, dsc->scale, dsc->scale, g1); - - node->draw_buf = draw_buf; - return true; -} - -static void tiny_ttf_draw_data_cache_free_cb(tiny_ttf_cache_data_t * node, void * user_data) -{ - LV_UNUSED(user_data); - - lv_draw_buf_destroy(node->draw_buf); -} - -static lv_cache_compare_res_t tiny_ttf_draw_data_cache_compare_cb(const tiny_ttf_cache_data_t * lhs, - const tiny_ttf_cache_data_t * rhs) -{ - if(lhs->glyph_index != rhs->glyph_index) { - return lhs->glyph_index > rhs->glyph_index ? 1 : -1; - } - - if(lhs->size != rhs->size) { - return lhs->size > rhs->size ? 1 : -1; - } - - return 0; -} - -#endif diff --git a/L3_Middlewares/LVGL/src/libs/tiny_ttf/lv_tiny_ttf.h b/L3_Middlewares/LVGL/src/libs/tiny_ttf/lv_tiny_ttf.h deleted file mode 100644 index b6e7dc0..0000000 --- a/L3_Middlewares/LVGL/src/libs/tiny_ttf/lv_tiny_ttf.h +++ /dev/null @@ -1,98 +0,0 @@ -/** - * @file lv_tiny_ttf.h - * - */ - -#ifndef LV_TINY_TTF_H -#define LV_TINY_TTF_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" - -#if LV_USE_TINY_TTF - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -#if LV_TINY_TTF_FILE_SUPPORT != 0 -/** - * Create a font from the specified file or path with the specified line height. - * @param path the path or file name of the font - * @param font_size the font size in pixel - * @return a font object - */ -lv_font_t * lv_tiny_ttf_create_file(const char * path, int32_t font_size); - -/** - * Create a font from the specified file or path with the specified line height with the specified cache size. - * @param path the path or file name of the font - * @param font_size the font size in pixel - * @param kerning kerning value in pixel - * @param cache_size the cache size in count - * @return a font object - */ -lv_font_t * lv_tiny_ttf_create_file_ex(const char * path, int32_t font_size, lv_font_kerning_t kerning, - size_t cache_size); -#endif - -/** - * Create a font from the specified data pointer with the specified line height. - * @param data the data pointer - * @param data_size the data size - * @param font_size the font size in pixel - * @return a font object - */ -lv_font_t * lv_tiny_ttf_create_data(const void * data, size_t data_size, int32_t font_size); - -/** - * Create a font from the specified data pointer with the specified line height and the specified cache size. - * @param data the data pointer - * @param data_size the data size - * @param font_size the font size in pixel - * @param kerning kerning value in pixel - * @param cache_size the cache size in count - * @return - */ -lv_font_t * lv_tiny_ttf_create_data_ex(const void * data, size_t data_size, int32_t font_size, - lv_font_kerning_t kerning, size_t cache_size); - -/** - * Set the size of the font to a new font_size - * @note the font bitmap cache and glyph cache will be flushed. - * @param font the font object - * @param font_size the font size in pixel - */ -void lv_tiny_ttf_set_size(lv_font_t * font, int32_t font_size); - -/** - * Destroy a font previously created with lv_tiny_ttf_create_xxxx() - * @param font the font object - */ -void lv_tiny_ttf_destroy(lv_font_t * font); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_TINY_TTF*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_TINY_TTF_H*/ diff --git a/L3_Middlewares/LVGL/src/libs/tjpgd/lv_tjpgd.c b/L3_Middlewares/LVGL/src/libs/tjpgd/lv_tjpgd.c deleted file mode 100644 index 650b36a..0000000 --- a/L3_Middlewares/LVGL/src/libs/tjpgd/lv_tjpgd.c +++ /dev/null @@ -1,301 +0,0 @@ -/** - * @file lv_tjpgd.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../draw/lv_image_decoder_private.h" -#include "../../../lvgl.h" -#if LV_USE_TJPGD - -#include "tjpgd.h" -#include "lv_tjpgd.h" -#include "../../misc/lv_fs_private.h" -#include - -/********************* - * DEFINES - *********************/ - -#define DECODER_NAME "TJPGD" - -#define TJPGD_WORKBUFF_SIZE 4096 //Recommended by TJPGD library - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header); -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); - -static lv_result_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, - const lv_area_t * full_area, lv_area_t * decoded_area); -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc); -static size_t input_func(JDEC * jd, uint8_t * buff, size_t ndata); -static int is_jpg(const uint8_t * raw_data, size_t len); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_tjpgd_init(void) -{ - lv_image_decoder_t * dec = lv_image_decoder_create(); - lv_image_decoder_set_info_cb(dec, decoder_info); - lv_image_decoder_set_open_cb(dec, decoder_open); - lv_image_decoder_set_get_area_cb(dec, decoder_get_area); - lv_image_decoder_set_close_cb(dec, decoder_close); - - dec->name = DECODER_NAME; -} - -void lv_tjpgd_deinit(void) -{ - lv_image_decoder_t * dec = NULL; - while((dec = lv_image_decoder_get_next(dec)) != NULL) { - if(dec->info_cb == decoder_info) { - lv_image_decoder_delete(dec); - break; - } - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header) -{ - LV_UNUSED(decoder); - - const void * src = dsc->src; - lv_image_src_t src_type = dsc->src_type; - - if(src_type == LV_IMAGE_SRC_VARIABLE) { - const lv_image_dsc_t * img_dsc = src; - uint8_t * raw_data = (uint8_t *)img_dsc->data; - const uint32_t raw_data_size = img_dsc->data_size; - - if(is_jpg(raw_data, raw_data_size) == true) { -#if LV_USE_FS_MEMFS - header->cf = LV_COLOR_FORMAT_RAW; - header->w = img_dsc->header.w; - header->h = img_dsc->header.h; - header->stride = img_dsc->header.w * 3; - return LV_RESULT_OK; -#else - LV_LOG_WARN("LV_USE_FS_MEMFS needs to enabled to decode from data"); - return LV_RESULT_INVALID; -#endif - } - } - else if(src_type == LV_IMAGE_SRC_FILE) { - const char * fn = src; - const char * ext = lv_fs_get_ext(fn); - if((lv_strcmp(ext, "jpg") == 0) || (lv_strcmp(ext, "jpeg") == 0)) { - uint8_t workb[TJPGD_WORKBUFF_SIZE]; - JDEC jd; - JRESULT rc = jd_prepare(&jd, input_func, workb, TJPGD_WORKBUFF_SIZE, &dsc->file); - if(rc) { - LV_LOG_WARN("jd_prepare error: %d", rc); - return LV_RESULT_INVALID; - } - header->cf = LV_COLOR_FORMAT_RAW; - header->w = jd.width; - header->h = jd.height; - header->stride = jd.width * 3; - - return LV_RESULT_OK; - } - } - return LV_RESULT_INVALID; -} - -static size_t input_func(JDEC * jd, uint8_t * buff, size_t ndata) -{ - lv_fs_file_t * f = jd->device; - if(!f) return 0; - - if(buff) { - uint32_t rn = 0; - lv_fs_read(f, buff, (uint32_t)ndata, &rn); - return rn; - } - else { - uint32_t pos; - lv_fs_tell(f, &pos); - lv_fs_seek(f, (uint32_t)(ndata + pos), LV_FS_SEEK_SET); - return ndata; - } - return 0; -} - -/** - * Decode a JPG image and return the decoded data. - * @param decoder pointer to the decoder - * @param dsc pointer to the decoder descriptor - * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't open the image - */ -static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); - lv_fs_file_t * f = lv_malloc(sizeof(lv_fs_file_t)); - if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) { -#if LV_USE_FS_MEMFS - const lv_image_dsc_t * img_dsc = dsc->src; - if(is_jpg(img_dsc->data, img_dsc->data_size) == true) { - lv_fs_path_ex_t path; - lv_fs_make_path_from_buffer(&path, LV_FS_MEMFS_LETTER, img_dsc->data, img_dsc->data_size); - lv_fs_res_t res; - res = lv_fs_open(f, (const char *)&path, LV_FS_MODE_RD); - if(res != LV_FS_RES_OK) { - lv_free(f); - return LV_RESULT_INVALID; - } - } -#else - LV_LOG_WARN("LV_USE_FS_MEMFS needs to enabled to decode from data"); - return LV_RESULT_INVALID; -#endif - } - else if(dsc->src_type == LV_IMAGE_SRC_FILE) { - const char * fn = dsc->src; - if((lv_strcmp(lv_fs_get_ext(fn), "jpg") == 0) || (lv_strcmp(lv_fs_get_ext(fn), "jpeg") == 0)) { - lv_fs_res_t res; - res = lv_fs_open(f, fn, LV_FS_MODE_RD); - if(res != LV_FS_RES_OK) { - lv_free(f); - return LV_RESULT_INVALID; - } - } - } - - uint8_t * workb_temp = lv_malloc(TJPGD_WORKBUFF_SIZE); - JDEC * jd = lv_malloc(sizeof(JDEC)); - dsc->user_data = jd; - JRESULT rc = jd_prepare(jd, input_func, workb_temp, (size_t)TJPGD_WORKBUFF_SIZE, f); - if(rc) return LV_RESULT_INVALID; - - dsc->header.cf = LV_COLOR_FORMAT_RGB888; - dsc->header.w = jd->width; - dsc->header.h = jd->height; - dsc->header.stride = jd->width * 3; - - if(rc != JDR_OK) { - lv_free(workb_temp); - lv_free(jd); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -static lv_result_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, - const lv_area_t * full_area, lv_area_t * decoded_area) -{ - LV_UNUSED(decoder); - LV_UNUSED(full_area); - - JDEC * jd = dsc->user_data; - lv_draw_buf_t * decoded = (void *)dsc->decoded; - - uint32_t mx, my; - mx = jd->msx * 8; - my = jd->msy * 8; /* Size of the MCU (pixel) */ - if(decoded_area->y1 == LV_COORD_MIN) { - decoded_area->y1 = 0; - decoded_area->y2 = my - 1; - decoded_area->x1 = -((int32_t)mx); - decoded_area->x2 = -1; - jd->scale = 0; - jd->dcv[2] = jd->dcv[1] = jd->dcv[0] = 0; /* Initialize DC values */ - jd->rst = 0; - jd->rsc = 0; - if(decoded == NULL) { - decoded = lv_malloc_zeroed(sizeof(lv_draw_buf_t)); - dsc->decoded = decoded; - } - else { - lv_fs_seek(jd->device, 0, LV_FS_SEEK_SET); - JRESULT rc = jd_prepare(jd, input_func, jd->pool_original, (size_t)TJPGD_WORKBUFF_SIZE, jd->device); - if(rc) return LV_RESULT_INVALID; - } - decoded->data = jd->workbuf; - decoded->header = dsc->header; - } - - decoded_area->x1 += mx; - decoded_area->x2 += mx; - - if(decoded_area->x1 >= jd->width) { - decoded_area->x1 = 0; - decoded_area->x2 = mx - 1; - decoded_area->y1 += my; - decoded_area->y2 += my; - } - - if(decoded_area->x2 >= jd->width) decoded_area->x2 = jd->width - 1; - if(decoded_area->y2 >= jd->height) decoded_area->y2 = jd->height - 1; - - decoded->header.w = lv_area_get_width(decoded_area); - decoded->header.h = lv_area_get_height(decoded_area); - decoded->header.stride = decoded->header.w * 3; - decoded->data_size = decoded->header.stride * decoded->header.h; - - /* Process restart interval if enabled */ - JRESULT rc; - if(jd->nrst && jd->rst++ == jd->nrst) { - rc = jd_restart(jd, jd->rsc++); - if(rc != JDR_OK) return LV_RESULT_INVALID; - jd->rst = 1; - } - - /* Load an MCU (decompress huffman coded stream, dequantize and apply IDCT) */ - rc = jd_mcu_load(jd); - if(rc != JDR_OK) return LV_RESULT_INVALID; - - /* Output the MCU (YCbCr to RGB, scaling and output) */ - rc = jd_mcu_output(jd, NULL, decoded_area->x1, decoded_area->y1); - if(rc != JDR_OK) return LV_RESULT_INVALID; - - return LV_RESULT_OK; -} - -/** - * Free the allocated resources - * @param decoder pointer to the decoder where this function belongs - * @param dsc pointer to a descriptor which describes this decoding session - */ -static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc) -{ - LV_UNUSED(decoder); - JDEC * jd = dsc->user_data; - lv_fs_close(jd->device); - lv_free(jd->device); - lv_free(jd->pool_original); - lv_free(jd); - lv_free((void *)dsc->decoded); -} - -static int is_jpg(const uint8_t * raw_data, size_t len) -{ - const uint8_t jpg_signature[] = {0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46}; - if(len < sizeof(jpg_signature)) return false; - return memcmp(jpg_signature, raw_data, sizeof(jpg_signature)) == 0; -} - -#endif /*LV_USE_TJPGD*/ diff --git a/L3_Middlewares/LVGL/src/libs/tjpgd/lv_tjpgd.h b/L3_Middlewares/LVGL/src/libs/tjpgd/lv_tjpgd.h deleted file mode 100644 index ec35800..0000000 --- a/L3_Middlewares/LVGL/src/libs/tjpgd/lv_tjpgd.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @file lv_tjpgd.h - * - */ - -#ifndef LV_TJPGD_H -#define LV_TJPGD_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#if LV_USE_TJPGD - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_tjpgd_init(void); - -void lv_tjpgd_deinit(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_TJPGD*/ - -#ifdef __cplusplus -} -#endif - -#endif /* LV_TJPGD_H */ diff --git a/L3_Middlewares/LVGL/src/libs/tjpgd/tjpgd.c b/L3_Middlewares/LVGL/src/libs/tjpgd/tjpgd.c deleted file mode 100644 index 7152adf..0000000 --- a/L3_Middlewares/LVGL/src/libs/tjpgd/tjpgd.c +++ /dev/null @@ -1,1139 +0,0 @@ -/*----------------------------------------------------------------------------/ -/ TJpgDec - Tiny JPEG Decompressor R0.03 (C)ChaN, 2021 -/-----------------------------------------------------------------------------/ -/ The TJpgDec is a generic JPEG decompressor module for tiny embedded systems. -/ This is a free software that opened for education, research and commercial -/ developments under license policy of following terms. -/ -/ Copyright (C) 2021, ChaN, all right reserved. -/ -/ * The TJpgDec module is a free software and there is NO WARRANTY. -/ * No restriction on use. You can use, modify and redistribute it for -/ personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY. -/ * Redistributions of source code must retain the above copyright notice. -/ -/-----------------------------------------------------------------------------/ -/ Oct 04, 2011 R0.01 First release. -/ Feb 19, 2012 R0.01a Fixed decompression fails when scan starts with an escape seq. -/ Sep 03, 2012 R0.01b Added JD_TBLCLIP option. -/ Mar 16, 2019 R0.01c Supported stdint.h. -/ Jul 01, 2020 R0.01d Fixed wrong integer type usage. -/ May 08, 2021 R0.02 Supported grayscale image. Separated configuration options. -/ Jun 11, 2021 R0.02a Some performance improvement. -/ Jul 01, 2021 R0.03 Added JD_FASTDECODE option. -/ Some performance improvement. -/----------------------------------------------------------------------------*/ - -#include "tjpgd.h" - -#if LV_USE_TJPGD - -#if JD_FASTDECODE == 2 - #define HUFF_BIT 10 /* Bit length to apply fast huffman decode */ - #define HUFF_LEN (1 << HUFF_BIT) - #define HUFF_MASK (HUFF_LEN - 1) -#endif - - -/*-----------------------------------------------*/ -/* Zigzag-order to raster-order conversion table */ -/*-----------------------------------------------*/ - -static const uint8_t Zig[64] = { /* Zigzag-order to raster-order conversion table */ - 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 -}; - - - -/*-------------------------------------------------*/ -/* Input scale factor of Arai algorithm */ -/* (scaled up 16 bits for fixed point operations) */ -/*-------------------------------------------------*/ - -static const uint16_t Ipsf[64] = { /* See also aa_idct.png */ - (uint16_t)(1.00000 * 8192), (uint16_t)(1.38704 * 8192), (uint16_t)(1.30656 * 8192), (uint16_t)(1.17588 * 8192), (uint16_t)(1.00000 * 8192), (uint16_t)(0.78570 * 8192), (uint16_t)(0.54120 * 8192), (uint16_t)(0.27590 * 8192), - (uint16_t)(1.38704 * 8192), (uint16_t)(1.92388 * 8192), (uint16_t)(1.81226 * 8192), (uint16_t)(1.63099 * 8192), (uint16_t)(1.38704 * 8192), (uint16_t)(1.08979 * 8192), (uint16_t)(0.75066 * 8192), (uint16_t)(0.38268 * 8192), - (uint16_t)(1.30656 * 8192), (uint16_t)(1.81226 * 8192), (uint16_t)(1.70711 * 8192), (uint16_t)(1.53636 * 8192), (uint16_t)(1.30656 * 8192), (uint16_t)(1.02656 * 8192), (uint16_t)(0.70711 * 8192), (uint16_t)(0.36048 * 8192), - (uint16_t)(1.17588 * 8192), (uint16_t)(1.63099 * 8192), (uint16_t)(1.53636 * 8192), (uint16_t)(1.38268 * 8192), (uint16_t)(1.17588 * 8192), (uint16_t)(0.92388 * 8192), (uint16_t)(0.63638 * 8192), (uint16_t)(0.32442 * 8192), - (uint16_t)(1.00000 * 8192), (uint16_t)(1.38704 * 8192), (uint16_t)(1.30656 * 8192), (uint16_t)(1.17588 * 8192), (uint16_t)(1.00000 * 8192), (uint16_t)(0.78570 * 8192), (uint16_t)(0.54120 * 8192), (uint16_t)(0.27590 * 8192), - (uint16_t)(0.78570 * 8192), (uint16_t)(1.08979 * 8192), (uint16_t)(1.02656 * 8192), (uint16_t)(0.92388 * 8192), (uint16_t)(0.78570 * 8192), (uint16_t)(0.61732 * 8192), (uint16_t)(0.42522 * 8192), (uint16_t)(0.21677 * 8192), - (uint16_t)(0.54120 * 8192), (uint16_t)(0.75066 * 8192), (uint16_t)(0.70711 * 8192), (uint16_t)(0.63638 * 8192), (uint16_t)(0.54120 * 8192), (uint16_t)(0.42522 * 8192), (uint16_t)(0.29290 * 8192), (uint16_t)(0.14932 * 8192), - (uint16_t)(0.27590 * 8192), (uint16_t)(0.38268 * 8192), (uint16_t)(0.36048 * 8192), (uint16_t)(0.32442 * 8192), (uint16_t)(0.27590 * 8192), (uint16_t)(0.21678 * 8192), (uint16_t)(0.14932 * 8192), (uint16_t)(0.07612 * 8192) -}; - - - -/*---------------------------------------------*/ -/* Conversion table for fast clipping process */ -/*---------------------------------------------*/ - -#if JD_TBLCLIP - -#define BYTECLIP(v) Clip8[(unsigned int)(v) & 0x3FF] - -static const uint8_t Clip8[1024] = { - /* 0..255 */ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - /* 256..511 */ - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - /* -512..-257 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -#else /* JD_TBLCLIP */ - -static uint8_t BYTECLIP(int val) -{ - if(val < 0) return 0; - if(val > 255) return 255; - return (uint8_t)val; -} - -#endif - - - -/*-----------------------------------------------------------------------*/ -/* Allocate a memory block from memory pool */ -/*-----------------------------------------------------------------------*/ - -static void * alloc_pool( /* Pointer to allocated memory block (NULL:no memory available) */ - JDEC * jd, /* Pointer to the decompressor object */ - size_t ndata /* Number of bytes to allocate */ -) -{ - char * rp = 0; - - - ndata = (ndata + 3) & ~3; /* Align block size to the word boundary */ - - if(jd->sz_pool >= ndata) { - jd->sz_pool -= ndata; - rp = (char *)jd->pool; /* Get start of available memory pool */ - jd->pool = (void *)(rp + ndata); /* Allocate required bytes */ - } - - return (void *)rp; /* Return allocated memory block (NULL:no memory to allocate) */ -} - - - - -/*-----------------------------------------------------------------------*/ -/* Create de-quantization and prescaling tables with a DQT segment */ -/*-----------------------------------------------------------------------*/ - -static JRESULT create_qt_tbl( /* 0:OK, !0:Failed */ - JDEC * jd, /* Pointer to the decompressor object */ - const uint8_t * data, /* Pointer to the quantizer tables */ - size_t ndata /* Size of input data */ -) -{ - unsigned int i, zi; - uint8_t d; - int32_t * pb; - - - while(ndata) { /* Process all tables in the segment */ - if(ndata < 65) return JDR_FMT1; /* Err: table size is unaligned */ - ndata -= 65; - d = *data++; /* Get table property */ - if(d & 0xF0) return JDR_FMT1; /* Err: not 8-bit resolution */ - i = d & 3; /* Get table ID */ - pb = alloc_pool(jd, 64 * sizeof(int32_t)); /* Allocate a memory block for the table */ - if(!pb) return JDR_MEM1; /* Err: not enough memory */ - jd->qttbl[i] = pb; /* Register the table */ - for(i = 0; i < 64; i++) { /* Load the table */ - zi = Zig[i]; /* Zigzag-order to raster-order conversion */ - pb[zi] = (int32_t)((uint32_t) * data++ * Ipsf[zi]); /* Apply scale factor of Arai algorithm to the de-quantizers */ - } - } - - return JDR_OK; -} - - - - -/*-----------------------------------------------------------------------*/ -/* Create huffman code tables with a DHT segment */ -/*-----------------------------------------------------------------------*/ - -static JRESULT create_huffman_tbl( /* 0:OK, !0:Failed */ - JDEC * jd, /* Pointer to the decompressor object */ - const uint8_t * data, /* Pointer to the packed huffman tables */ - size_t ndata /* Size of input data */ -) -{ - unsigned int i, j, b, cls, num; - size_t np; - uint8_t d, * pb, * pd; - uint16_t hc, * ph; - - - while(ndata) { /* Process all tables in the segment */ - if(ndata < 17) return JDR_FMT1; /* Err: wrong data size */ - ndata -= 17; - d = *data++; /* Get table number and class */ - if(d & 0xEE) return JDR_FMT1; /* Err: invalid class/number */ - cls = d >> 4; - num = d & 0x0F; /* class = dc(0)/ac(1), table number = 0/1 */ - pb = alloc_pool(jd, 16); /* Allocate a memory block for the bit distribution table */ - if(!pb) return JDR_MEM1; /* Err: not enough memory */ - jd->huffbits[num][cls] = pb; - for(np = i = 0; i < 16; i++) { /* Load number of patterns for 1 to 16-bit code */ - np += (pb[i] = *data++); /* Get sum of code words for each code */ - } - ph = alloc_pool(jd, np * sizeof(uint16_t)); /* Allocate a memory block for the code word table */ - if(!ph) return JDR_MEM1; /* Err: not enough memory */ - jd->huffcode[num][cls] = ph; - hc = 0; - for(j = i = 0; i < 16; i++) { /* Re-build huffman code word table */ - b = pb[i]; - while(b--) ph[j++] = hc++; - hc <<= 1; - } - - if(ndata < np) return JDR_FMT1; /* Err: wrong data size */ - ndata -= np; - pd = alloc_pool(jd, np); /* Allocate a memory block for the decoded data */ - if(!pd) return JDR_MEM1; /* Err: not enough memory */ - jd->huffdata[num][cls] = pd; - for(i = 0; i < np; i++) { /* Load decoded data corresponds to each code word */ - d = *data++; - if(!cls && d > 11) return JDR_FMT1; - pd[i] = d; - } -#if JD_FASTDECODE == 2 - { /* Create fast huffman decode table */ - unsigned int span, td, ti; - uint16_t * tbl_ac = 0; - uint8_t * tbl_dc = 0; - - if(cls) { - tbl_ac = alloc_pool(jd, HUFF_LEN * sizeof(uint16_t)); /* LUT for AC elements */ - if(!tbl_ac) return JDR_MEM1; /* Err: not enough memory */ - jd->hufflut_ac[num] = tbl_ac; - memset(tbl_ac, 0xFF, HUFF_LEN * sizeof(uint16_t)); /* Default value (0xFFFF: may be long code) */ - } - else { - tbl_dc = alloc_pool(jd, HUFF_LEN * sizeof(uint8_t)); /* LUT for AC elements */ - if(!tbl_dc) return JDR_MEM1; /* Err: not enough memory */ - jd->hufflut_dc[num] = tbl_dc; - memset(tbl_dc, 0xFF, HUFF_LEN * sizeof(uint8_t)); /* Default value (0xFF: may be long code) */ - } - for(i = b = 0; b < HUFF_BIT; b++) { /* Create LUT */ - for(j = pb[b]; j; j--) { - ti = ph[i] << (HUFF_BIT - 1 - b) & HUFF_MASK; /* Index of input pattern for the code */ - if(cls) { - td = pd[i++] | ((b + 1) << 8); /* b15..b8: code length, b7..b0: zero run and data length */ - for(span = 1 << (HUFF_BIT - 1 - b); span; span--, tbl_ac[ti++] = (uint16_t)td) ; - } - else { - td = pd[i++] | ((b + 1) << 4); /* b7..b4: code length, b3..b0: data length */ - for(span = 1 << (HUFF_BIT - 1 - b); span; span--, tbl_dc[ti++] = (uint8_t)td) ; - } - } - } - jd->longofs[num][cls] = i; /* Code table offset for long code */ - } -#endif - } - - return JDR_OK; -} - - - - -/*-----------------------------------------------------------------------*/ -/* Extract a huffman decoded data from input stream */ -/*-----------------------------------------------------------------------*/ - -static int huffext( /* >=0: decoded data, <0: error code */ - JDEC * jd, /* Pointer to the decompressor object */ - unsigned int id, /* Table ID (0:Y, 1:C) */ - unsigned int cls /* Table class (0:DC, 1:AC) */ -) -{ - size_t dc = jd->dctr; - uint8_t * dp = jd->dptr; - unsigned int d, flg = 0; - -#if JD_FASTDECODE == 0 - uint8_t bm, nd, bl; - const uint8_t * hb = jd->huffbits[id][cls]; /* Bit distribution table */ - const uint16_t * hc = jd->huffcode[id][cls]; /* Code word table */ - const uint8_t * hd = jd->huffdata[id][cls]; /* Data table */ - - - bm = jd->dbit; /* Bit mask to extract */ - d = 0; - bl = 16; /* Max code length */ - do { - if(!bm) { /* Next byte? */ - if(!dc) { /* No input data is available, re-fill input buffer */ - dp = jd->inbuf; /* Top of input buffer */ - dc = jd->infunc(jd, dp, JD_SZBUF); - if(!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ - } - else { - dp++; /* Next data ptr */ - } - dc--; /* Decrement number of available bytes */ - if(flg) { /* In flag sequence? */ - flg = 0; /* Exit flag sequence */ - if(*dp != 0) return 0 - (int)JDR_FMT1; /* Err: unexpected flag is detected (may be corrupted data) */ - *dp = 0xFF; /* The flag is a data 0xFF */ - } - else { - if(*dp == 0xFF) { /* Is start of flag sequence? */ - flg = 1; - continue; /* Enter flag sequence, get trailing byte */ - } - } - bm = 0x80; /* Read from MSB */ - } - d <<= 1; /* Get a bit */ - if(*dp & bm) d++; - bm >>= 1; - - for(nd = *hb++; nd; nd--) { /* Search the code word in this bit length */ - if(d == *hc++) { /* Matched? */ - jd->dbit = bm; - jd->dctr = dc; - jd->dptr = dp; - return *hd; /* Return the decoded data */ - } - hd++; - } - bl--; - } while(bl); - -#else - const uint8_t * hb, * hd; - const uint16_t * hc; - unsigned int nc, bl, wbit = jd->dbit % 32; - uint32_t w = jd->wreg & ((1UL << wbit) - 1); - - - while(wbit < 16) { /* Prepare 16 bits into the working register */ - if(jd->marker) { - d = 0xFF; /* Input stream has stalled for a marker. Generate stuff bits */ - } - else { - if(!dc) { /* Buffer empty, re-fill input buffer */ - dp = jd->inbuf; /* Top of input buffer */ - dc = jd->infunc(jd, dp, JD_SZBUF); - if(!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ - } - d = *dp++; - dc--; - if(flg) { /* In flag sequence? */ - flg = 0; /* Exit flag sequence */ - if(d != 0) jd->marker = d; /* Not an escape of 0xFF but a marker */ - d = 0xFF; - } - else { - if(d == 0xFF) { /* Is start of flag sequence? */ - flg = 1; - continue; /* Enter flag sequence, get trailing byte */ - } - } - } - w = w << 8 | d; /* Shift 8 bits in the working register */ - wbit += 8; - } - jd->dctr = dc; - jd->dptr = dp; - jd->wreg = w; - -#if JD_FASTDECODE == 2 - /* Table search for the short codes */ - d = (unsigned int)(w >> (wbit - HUFF_BIT)); /* Short code as table index */ - if(cls) { /* AC element */ - d = jd->hufflut_ac[id][d]; /* Table decode */ - if(d != 0xFFFF) { /* It is done if hit in short code */ - jd->dbit = wbit - (d >> 8); /* Snip the code length */ - return d & 0xFF; /* b7..0: zero run and following data bits */ - } - } - else { /* DC element */ - d = jd->hufflut_dc[id][d]; /* Table decode */ - if(d != 0xFF) { /* It is done if hit in short code */ - jd->dbit = wbit - (d >> 4); /* Snip the code length */ - return d & 0xF; /* b3..0: following data bits */ - } - } - - /* Incremental search for the codes longer than HUFF_BIT */ - hb = jd->huffbits[id][cls] + HUFF_BIT; /* Bit distribution table */ - hc = jd->huffcode[id][cls] + jd->longofs[id][cls]; /* Code word table */ - hd = jd->huffdata[id][cls] + jd->longofs[id][cls]; /* Data table */ - bl = HUFF_BIT + 1; -#else - /* Incremental search for all codes */ - hb = jd->huffbits[id][cls]; /* Bit distribution table */ - hc = jd->huffcode[id][cls]; /* Code word table */ - hd = jd->huffdata[id][cls]; /* Data table */ - bl = 1; -#endif - for(; bl <= 16; bl++) { /* Incremental search */ - nc = *hb++; - if(nc) { - d = w >> (wbit - bl); - do { /* Search the code word in this bit length */ - if(d == *hc++) { /* Matched? */ - jd->dbit = wbit - bl; /* Snip the huffman code */ - return *hd; /* Return the decoded data */ - } - hd++; - } while(--nc); - } - } -#endif - - return 0 - (int)JDR_FMT1; /* Err: code not found (may be corrupted data) */ -} - - - - -/*-----------------------------------------------------------------------*/ -/* Extract N bits from input stream */ -/*-----------------------------------------------------------------------*/ - -static int bitext( /* >=0: extracted data, <0: error code */ - JDEC * jd, /* Pointer to the decompressor object */ - unsigned int nbit /* Number of bits to extract (1 to 16) */ -) -{ - size_t dc = jd->dctr; - uint8_t * dp = jd->dptr; - unsigned int d, flg = 0; - -#if JD_FASTDECODE == 0 - uint8_t mbit = jd->dbit; - - d = 0; - do { - if(!mbit) { /* Next byte? */ - if(!dc) { /* No input data is available, re-fill input buffer */ - dp = jd->inbuf; /* Top of input buffer */ - dc = jd->infunc(jd, dp, JD_SZBUF); - if(!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ - } - else { - dp++; /* Next data ptr */ - } - dc--; /* Decrement number of available bytes */ - if(flg) { /* In flag sequence? */ - flg = 0; /* Exit flag sequence */ - if(*dp != 0) return 0 - (int)JDR_FMT1; /* Err: unexpected flag is detected (may be corrupted data) */ - *dp = 0xFF; /* The flag is a data 0xFF */ - } - else { - if(*dp == 0xFF) { /* Is start of flag sequence? */ - flg = 1; - continue; /* Enter flag sequence */ - } - } - mbit = 0x80; /* Read from MSB */ - } - d <<= 1; /* Get a bit */ - if(*dp & mbit) d |= 1; - mbit >>= 1; - nbit--; - } while(nbit); - - jd->dbit = mbit; - jd->dctr = dc; - jd->dptr = dp; - return (int)d; - -#else - unsigned int wbit = jd->dbit % 32; - uint32_t w = jd->wreg & ((1UL << wbit) - 1); - - - while(wbit < nbit) { /* Prepare nbit bits into the working register */ - if(jd->marker) { - d = 0xFF; /* Input stream stalled, generate stuff bits */ - } - else { - if(!dc) { /* Buffer empty, re-fill input buffer */ - dp = jd->inbuf; /* Top of input buffer */ - dc = jd->infunc(jd, dp, JD_SZBUF); - if(!dc) return 0 - (int)JDR_INP; /* Err: read error or wrong stream termination */ - } - d = *dp++; - dc--; - if(flg) { /* In flag sequence? */ - flg = 0; /* Exit flag sequence */ - if(d != 0) jd->marker = d; /* Not an escape of 0xFF but a marker */ - d = 0xFF; - } - else { - if(d == 0xFF) { /* Is start of flag sequence? */ - flg = 1; - continue; /* Enter flag sequence, get trailing byte */ - } - } - } - w = w << 8 | d; /* Get 8 bits into the working register */ - wbit += 8; - } - jd->wreg = w; - jd->dbit = wbit - nbit; - jd->dctr = dc; - jd->dptr = dp; - - return (int)(w >> ((wbit - nbit) % 32)); -#endif -} - - - - -/*-----------------------------------------------------------------------*/ -/* Process restart interval */ -/*-----------------------------------------------------------------------*/ - -JRESULT jd_restart( - JDEC * jd, /* Pointer to the decompressor object */ - uint16_t rstn /* Expected restart sequence number */ -) -{ - unsigned int i; - uint8_t * dp = jd->dptr; - size_t dc = jd->dctr; - -#if JD_FASTDECODE == 0 - uint16_t d = 0; - - /* Get two bytes from the input stream */ - for(i = 0; i < 2; i++) { - if(!dc) { /* No input data is available, re-fill input buffer */ - dp = jd->inbuf; - dc = jd->infunc(jd, dp, JD_SZBUF); - if(!dc) return JDR_INP; - } - else { - dp++; - } - dc--; - d = d << 8 | *dp; /* Get a byte */ - } - jd->dptr = dp; - jd->dctr = dc; - jd->dbit = 0; - - /* Check the marker */ - if((d & 0xFFD8) != 0xFFD0 || (d & 7) != (rstn & 7)) { - return JDR_FMT1; /* Err: expected RSTn marker is not detected (may be corrupted data) */ - } - -#else - uint16_t marker; - - - if(jd->marker) { /* Generate a maker if it has been detected */ - marker = 0xFF00 | jd->marker; - jd->marker = 0; - } - else { - marker = 0; - for(i = 0; i < 2; i++) { /* Get a restart marker */ - if(!dc) { /* No input data is available, re-fill input buffer */ - dp = jd->inbuf; - dc = jd->infunc(jd, dp, JD_SZBUF); - if(!dc) return JDR_INP; - } - marker = (marker << 8) | *dp++; /* Get a byte */ - dc--; - } - jd->dptr = dp; - jd->dctr = dc; - } - - /* Check the marker */ - if((marker & 0xFFD8) != 0xFFD0 || (marker & 7) != (rstn & 7)) { - return JDR_FMT1; /* Err: expected RSTn marker was not detected (may be corrupted data) */ - } - - jd->dbit = 0; /* Discard stuff bits */ -#endif - - jd->dcv[2] = jd->dcv[1] = jd->dcv[0] = 0; /* Reset DC offset */ - return JDR_OK; -} - - - - -/*-----------------------------------------------------------------------*/ -/* Apply Inverse-DCT in Arai Algorithm (see also aa_idct.png) */ -/*-----------------------------------------------------------------------*/ - -static void block_idct( - int32_t * src, /* Input block data (de-quantized and pre-scaled for Arai Algorithm) */ - jd_yuv_t * dst /* Pointer to the destination to store the block as byte array */ -) -{ - const int32_t M13 = (int32_t)(1.41421 * 4096), M2 = (int32_t)(1.08239 * 4096), M4 = (int32_t)(2.61313 * 4096), - M5 = (int32_t)(1.84776 * 4096); - int32_t v0, v1, v2, v3, v4, v5, v6, v7; - int32_t t10, t11, t12, t13; - int i; - - /* Process columns */ - for(i = 0; i < 8; i++) { - v0 = src[8 * 0]; /* Get even elements */ - v1 = src[8 * 2]; - v2 = src[8 * 4]; - v3 = src[8 * 6]; - - t10 = v0 + v2; /* Process the even elements */ - t12 = v0 - v2; - t11 = (v1 - v3) * M13 >> 12; - v3 += v1; - t11 -= v3; - v0 = t10 + v3; - v3 = t10 - v3; - v1 = t11 + t12; - v2 = t12 - t11; - - v4 = src[8 * 7]; /* Get odd elements */ - v5 = src[8 * 1]; - v6 = src[8 * 5]; - v7 = src[8 * 3]; - - t10 = v5 - v4; /* Process the odd elements */ - t11 = v5 + v4; - t12 = v6 - v7; - v7 += v6; - v5 = (t11 - v7) * M13 >> 12; - v7 += t11; - t13 = (t10 + t12) * M5 >> 12; - v4 = t13 - (t10 * M2 >> 12); - v6 = t13 - (t12 * M4 >> 12) - v7; - v5 -= v6; - v4 -= v5; - - src[8 * 0] = v0 + v7; /* Write-back transformed values */ - src[8 * 7] = v0 - v7; - src[8 * 1] = v1 + v6; - src[8 * 6] = v1 - v6; - src[8 * 2] = v2 + v5; - src[8 * 5] = v2 - v5; - src[8 * 3] = v3 + v4; - src[8 * 4] = v3 - v4; - - src++; /* Next column */ - } - - /* Process rows */ - src -= 8; - for(i = 0; i < 8; i++) { - v0 = src[0] + (128L << 8); /* Get even elements (remove DC offset (-128) here) */ - v1 = src[2]; - v2 = src[4]; - v3 = src[6]; - - t10 = v0 + v2; /* Process the even elements */ - t12 = v0 - v2; - t11 = (v1 - v3) * M13 >> 12; - v3 += v1; - t11 -= v3; - v0 = t10 + v3; - v3 = t10 - v3; - v1 = t11 + t12; - v2 = t12 - t11; - - v4 = src[7]; /* Get odd elements */ - v5 = src[1]; - v6 = src[5]; - v7 = src[3]; - - t10 = v5 - v4; /* Process the odd elements */ - t11 = v5 + v4; - t12 = v6 - v7; - v7 += v6; - v5 = (t11 - v7) * M13 >> 12; - v7 += t11; - t13 = (t10 + t12) * M5 >> 12; - v4 = t13 - (t10 * M2 >> 12); - v6 = t13 - (t12 * M4 >> 12) - v7; - v5 -= v6; - v4 -= v5; - - /* Descale the transformed values 8 bits and output a row */ -#if JD_FASTDECODE >= 1 - dst[0] = (int16_t)((v0 + v7) >> 8); - dst[7] = (int16_t)((v0 - v7) >> 8); - dst[1] = (int16_t)((v1 + v6) >> 8); - dst[6] = (int16_t)((v1 - v6) >> 8); - dst[2] = (int16_t)((v2 + v5) >> 8); - dst[5] = (int16_t)((v2 - v5) >> 8); - dst[3] = (int16_t)((v3 + v4) >> 8); - dst[4] = (int16_t)((v3 - v4) >> 8); -#else - dst[0] = BYTECLIP((v0 + v7) >> 8); - dst[7] = BYTECLIP((v0 - v7) >> 8); - dst[1] = BYTECLIP((v1 + v6) >> 8); - dst[6] = BYTECLIP((v1 - v6) >> 8); - dst[2] = BYTECLIP((v2 + v5) >> 8); - dst[5] = BYTECLIP((v2 - v5) >> 8); - dst[3] = BYTECLIP((v3 + v4) >> 8); - dst[4] = BYTECLIP((v3 - v4) >> 8); -#endif - - dst += 8; - src += 8; /* Next row */ - } -} - - - - -/*-----------------------------------------------------------------------*/ -/* Load all blocks in an MCU into working buffer */ -/*-----------------------------------------------------------------------*/ - -JRESULT jd_mcu_load( - JDEC * jd /* Pointer to the decompressor object */ -) -{ - int32_t * tmp = (int32_t *)jd->workbuf; /* Block working buffer for de-quantize and IDCT */ - int d, e; - unsigned int blk, nby, i, bc, z, id, cmp; - jd_yuv_t * bp; - const int32_t * dqf; - - - nby = jd->msx * jd->msy; /* Number of Y blocks (1, 2 or 4) */ - bp = jd->mcubuf; /* Pointer to the first block of MCU */ - - for(blk = 0; blk < nby + 2; blk++) { /* Get nby Y blocks and two C blocks */ - cmp = (blk < nby) ? 0 : blk - nby + 1; /* Component number 0:Y, 1:Cb, 2:Cr */ - - if(cmp && jd->ncomp != 3) { /* Clear C blocks if not exist (monochrome image) */ - for(i = 0; i < 64; bp[i++] = 128) ; - - } - else { /* Load Y/C blocks from input stream */ - id = cmp ? 1 : 0; /* Huffman table ID of this component */ - - /* Extract a DC element from input stream */ - d = huffext(jd, id, 0); /* Extract a huffman coded data (bit length) */ - if(d < 0) return (JRESULT)(0 - d); /* Err: invalid code or input */ - bc = (unsigned int)d; - d = jd->dcv[cmp]; /* DC value of previous block */ - if(bc) { /* If there is any difference from previous block */ - e = bitext(jd, bc); /* Extract data bits */ - if(e < 0) return (JRESULT)(0 - e); /* Err: input */ - bc = 1 << (bc - 1); /* MSB position */ - if(!(e & bc)) e -= (bc << 1) - 1; /* Restore negative value if needed */ - d += e; /* Get current value */ - jd->dcv[cmp] = (int16_t)d; /* Save current DC value for next block */ - } - dqf = jd->qttbl[jd->qtid[cmp]]; /* De-quantizer table ID for this component */ - tmp[0] = d * dqf[0] >> 8; /* De-quantize, apply scale factor of Arai algorithm and descale 8 bits */ - - /* Extract following 63 AC elements from input stream */ - memset(&tmp[1], 0, 63 * sizeof(int32_t)); /* Initialize all AC elements */ - z = 1; /* Top of the AC elements (in zigzag-order) */ - do { - d = huffext(jd, id, 1); /* Extract a huffman coded value (zero runs and bit length) */ - if(d == 0) break; /* EOB? */ - if(d < 0) return (JRESULT)(0 - d); /* Err: invalid code or input error */ - bc = (unsigned int)d; - z += bc >> 4; /* Skip leading zero run */ - if(z >= 64) return JDR_FMT1; /* Too long zero run */ - if(bc &= 0x0F) { /* Bit length? */ - d = bitext(jd, bc); /* Extract data bits */ - if(d < 0) return (JRESULT)(0 - d); /* Err: input device */ - bc = 1 << (bc - 1); /* MSB position */ - if(!(d & bc)) d -= (bc << 1) - 1; /* Restore negative value if needed */ - i = Zig[z]; /* Get raster-order index */ - tmp[i] = d * dqf[i] >> 8; /* De-quantize, apply scale factor of Arai algorithm and descale 8 bits */ - } - } while(++z < 64); /* Next AC element */ - - if(JD_FORMAT != 2 || !cmp) { /* C components may not be processed if in grayscale output */ - if(z == 1 || (JD_USE_SCALE && - jd->scale == - 3)) { /* If no AC element or scale ratio is 1/8, IDCT can be omitted and the block is filled with DC value */ - d = (jd_yuv_t)((*tmp / 256) + 128); - if(JD_FASTDECODE >= 1) { - for(i = 0; i < 64; bp[i++] = d) ; - } - else { - memset(bp, d, 64); - } - } - else { - block_idct(tmp, bp); /* Apply IDCT and store the block to the MCU buffer */ - } - } - } - - bp += 64; /* Next block */ - } - - return JDR_OK; /* All blocks have been loaded successfully */ -} - - - - -/*-----------------------------------------------------------------------*/ -/* Output an MCU: Convert YCrCb to RGB and output it in RGB form */ -/*-----------------------------------------------------------------------*/ - -JRESULT jd_mcu_output( - JDEC * jd, /* Pointer to the decompressor object */ - int (*outfunc)(JDEC *, void *, JRECT *), /* RGB output function */ - unsigned int x, /* MCU location in the image */ - unsigned int y /* MCU location in the image */ -) -{ - const int CVACC = (sizeof(int) > 2) ? 1024 : 128; /* Adaptive accuracy for both 16-/32-bit systems */ - unsigned int ix, iy, mx, my, rx, ry; - int yy, cb, cr; - jd_yuv_t * py, * pc; - uint8_t * pix; - JRECT rect; - - - mx = jd->msx * 8; - my = jd->msy * 8; /* MCU size (pixel) */ - rx = (x + mx <= jd->width) ? mx : jd->width - - x; /* Output rectangular size (it may be clipped at right/bottom end of image) */ - ry = (y + my <= jd->height) ? my : jd->height - y; - if(JD_USE_SCALE) { - rx >>= jd->scale; - ry >>= jd->scale; - if(!rx || !ry) return JDR_OK; /* Skip this MCU if all pixel is to be rounded off */ - x >>= jd->scale; - y >>= jd->scale; - } - rect.left = x; - rect.right = x + rx - 1; /* Rectangular area in the frame buffer */ - rect.top = y; - rect.bottom = y + ry - 1; - - - if(!JD_USE_SCALE || jd->scale != 3) { /* Not for 1/8 scaling */ - pix = (uint8_t *)jd->workbuf; - - if(JD_FORMAT != 2) { /* RGB output (build an RGB MCU from Y/C component) */ - for(iy = 0; iy < my; iy++) { - pc = py = jd->mcubuf; - if(my == 16) { /* Double block height? */ - pc += 64 * 4 + (iy >> 1) * 8; - if(iy >= 8) py += 64; - } - else { /* Single block height */ - pc += mx * 8 + iy * 8; - } - py += iy * 8; - for(ix = 0; ix < mx; ix++) { - cb = pc[0] - 128; /* Get Cb/Cr component and remove offset */ - cr = pc[64] - 128; - if(mx == 16) { /* Double block width? */ - if(ix == 8) py += 64 - 8; /* Jump to next block if double block height */ - pc += ix & 1; /* Step forward chroma pointer every two pixels */ - } - else { /* Single block width */ - pc++; /* Step forward chroma pointer every pixel */ - } - yy = *py++; /* Get Y component */ - *pix++ = /*B*/ BYTECLIP(yy + ((int)(1.772 * CVACC) * cb) / CVACC); - *pix++ = /*G*/ BYTECLIP(yy - ((int)(0.344 * CVACC) * cb + (int)(0.714 * CVACC) * cr) / CVACC); - *pix++ = /*R*/ BYTECLIP(yy + ((int)(1.402 * CVACC) * cr) / CVACC); - } - } - } - } - - /* Squeeze up pixel table if a part of MCU is to be truncated */ - mx >>= jd->scale; - if(rx < mx) { /* Is the MCU spans right edge? */ - uint8_t * s, * d; - unsigned int xi, yi; - - s = d = (uint8_t *)jd->workbuf; - for(yi = 0; yi < ry; yi++) { - for(xi = 0; xi < rx; xi++) { /* Copy effective pixels */ - *d++ = *s++; - if(JD_FORMAT != 2) { - *d++ = *s++; - *d++ = *s++; - } - } - s += (mx - rx) * (JD_FORMAT != 2 ? 3 : 1); /* Skip truncated pixels */ - } - } - - /* Convert RGB888 to RGB565 if needed */ - if(JD_FORMAT == 1) { - uint8_t * s = (uint8_t *)jd->workbuf; - uint16_t w, * d = (uint16_t *)s; - unsigned int n = rx * ry; - - do { - w = (*s++ & 0xF8) << 8; /* RRRRR----------- */ - w |= (*s++ & 0xFC) << 3; /* -----GGGGGG----- */ - w |= *s++ >> 3; /* -----------BBBBB */ - *d++ = w; - } while(--n); - } - - /* Output the rectangular */ - if(outfunc) return outfunc(jd, jd->workbuf, &rect) ? JDR_OK : JDR_INTR; - return 0; -} - - - - -/*-----------------------------------------------------------------------*/ -/* Analyze the JPEG image and Initialize decompressor object */ -/*-----------------------------------------------------------------------*/ - -#define LDB_WORD(ptr) (uint16_t)(((uint16_t)*((uint8_t*)(ptr))<<8)|(uint16_t)*(uint8_t*)((ptr)+1)) - - -JRESULT jd_prepare( - JDEC * jd, /* Blank decompressor object */ - size_t (*infunc)(JDEC *, uint8_t *, size_t), /* JPEG stream input function */ - void * pool, /* Working buffer for the decompression session */ - size_t sz_pool, /* Size of working buffer */ - void * dev /* I/O device identifier for the session */ -) -{ - uint8_t * seg, b; - uint16_t marker; - unsigned int n, i, ofs; - size_t len; - JRESULT rc; - - - memset(jd, 0, sizeof( - JDEC)); /* Clear decompression object (this might be a problem if machine's null pointer is not all bits zero) */ - jd->pool = pool; /* Work memory */ - jd->pool_original = pool; - jd->sz_pool = sz_pool; /* Size of given work memory */ - jd->infunc = infunc; /* Stream input function */ - jd->device = dev; /* I/O device identifier */ - - jd->inbuf = seg = alloc_pool(jd, JD_SZBUF); /* Allocate stream input buffer */ - if(!seg) return JDR_MEM1; - - ofs = marker = 0; /* Find SOI marker */ - do { - if(jd->infunc(jd, seg, 1) != 1) return JDR_INP; /* Err: SOI was not detected */ - ofs++; - marker = marker << 8 | seg[0]; - } while(marker != 0xFFD8); - - for(;;) { /* Parse JPEG segments */ - /* Get a JPEG marker */ - if(jd->infunc(jd, seg, 4) != 4) return JDR_INP; - marker = LDB_WORD(seg); /* Marker */ - len = LDB_WORD(seg + 2); /* Length field */ - if(len <= 2 || (marker >> 8) != 0xFF) return JDR_FMT1; - len -= 2; /* Segment content size */ - ofs += 4 + len; /* Number of bytes loaded */ - - switch(marker & 0xFF) { - case 0xC0: /* SOF0 (baseline JPEG) */ - if(len > JD_SZBUF) return JDR_MEM2; - if(jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ - - jd->width = LDB_WORD(&seg[3]); /* Image width in unit of pixel */ - jd->height = LDB_WORD(&seg[1]); /* Image height in unit of pixel */ - jd->ncomp = seg[5]; /* Number of color components */ - if(jd->ncomp != 3 && jd->ncomp != 1) return JDR_FMT3; /* Err: Supports only Grayscale and Y/Cb/Cr */ - - /* Check each image component */ - for(i = 0; i < jd->ncomp; i++) { - b = seg[7 + 3 * i]; /* Get sampling factor */ - if(i == 0) { /* Y component */ - if(b != 0x11 && b != 0x22 && b != 0x21) { /* Check sampling factor */ - return JDR_FMT3; /* Err: Supports only 4:4:4, 4:2:0 or 4:2:2 */ - } - jd->msx = b >> 4; - jd->msy = b & 15; /* Size of MCU [blocks] */ - } - else { /* Cb/Cr component */ - if(b != 0x11) return JDR_FMT3; /* Err: Sampling factor of Cb/Cr must be 1 */ - } - jd->qtid[i] = seg[8 + 3 * i]; /* Get dequantizer table ID for this component */ - if(jd->qtid[i] > 3) return JDR_FMT3; /* Err: Invalid ID */ - } - break; - - case 0xDD: /* DRI - Define Restart Interval */ - if(len > JD_SZBUF) return JDR_MEM2; - if(jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ - - jd->nrst = LDB_WORD(seg); /* Get restart interval (MCUs) */ - break; - - case 0xC4: /* DHT - Define Huffman Tables */ - if(len > JD_SZBUF) return JDR_MEM2; - if(jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ - - rc = create_huffman_tbl(jd, seg, len); /* Create huffman tables */ - if(rc) return rc; - break; - - case 0xDB: /* DQT - Define Quantizer Tables */ - if(len > JD_SZBUF) return JDR_MEM2; - if(jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ - - rc = create_qt_tbl(jd, seg, len); /* Create de-quantizer tables */ - if(rc) return rc; - break; - - case 0xDA: /* SOS - Start of Scan */ - if(len > JD_SZBUF) return JDR_MEM2; - if(jd->infunc(jd, seg, len) != len) return JDR_INP; /* Load segment data */ - - if(!jd->width || !jd->height) return JDR_FMT1; /* Err: Invalid image size */ - if(seg[0] != jd->ncomp) return JDR_FMT3; /* Err: Wrong color components */ - - /* Check if all tables corresponding to each components have been loaded */ - for(i = 0; i < jd->ncomp; i++) { - b = seg[2 + 2 * i]; /* Get huffman table ID */ - if(b != 0x00 && b != 0x11) return JDR_FMT3; /* Err: Different table number for DC/AC element */ - n = i ? 1 : 0; /* Component class */ - if(!jd->huffbits[n][0] || !jd->huffbits[n][1]) { /* Check huffman table for this component */ - return JDR_FMT1; /* Err: Not loaded */ - } - if(!jd->qttbl[jd->qtid[i]]) { /* Check dequantizer table for this component */ - return JDR_FMT1; /* Err: Not loaded */ - } - } - - /* Allocate working buffer for MCU and pixel output */ - n = jd->msy * jd->msx; /* Number of Y blocks in the MCU */ - if(!n) return JDR_FMT1; /* Err: SOF0 has not been loaded */ - len = n * 64 * 2 + 64; /* Allocate buffer for IDCT and RGB output */ - if(len < 256) len = 256; /* but at least 256 byte is required for IDCT */ - jd->workbuf = alloc_pool(jd, - len); /* and it may occupy a part of following MCU working buffer for RGB output */ - if(!jd->workbuf) return JDR_MEM1; /* Err: not enough memory */ - jd->mcubuf = alloc_pool(jd, (n + 2) * 64 * sizeof(jd_yuv_t)); /* Allocate MCU working buffer */ - if(!jd->mcubuf) return JDR_MEM1; /* Err: not enough memory */ - - /* Align stream read offset to JD_SZBUF */ - if(ofs %= JD_SZBUF) { - jd->dctr = jd->infunc(jd, seg + ofs, (size_t)(JD_SZBUF - ofs)); - } - jd->dptr = seg + ofs - (JD_FASTDECODE ? 0 : 1); - - return JDR_OK; /* Initialization succeeded. Ready to decompress the JPEG image. */ - - case 0xC1: /* SOF1 */ - case 0xC2: /* SOF2 */ - case 0xC3: /* SOF3 */ - case 0xC5: /* SOF5 */ - case 0xC6: /* SOF6 */ - case 0xC7: /* SOF7 */ - case 0xC9: /* SOF9 */ - case 0xCA: /* SOF10 */ - case 0xCB: /* SOF11 */ - case 0xCD: /* SOF13 */ - case 0xCE: /* SOF14 */ - case 0xCF: /* SOF15 */ - case 0xD9: /* EOI */ - return JDR_FMT3; /* Unsupported JPEG standard (may be progressive JPEG) */ - - default: /* Unknown segment (comment, exif or etc..) */ - /* Skip segment data (null pointer specifies to remove data from the stream) */ - if(jd->infunc(jd, 0, len) != len) return JDR_INP; - } - } -} - - - - -/*-----------------------------------------------------------------------*/ -/* Start to decompress the JPEG picture */ -/*-----------------------------------------------------------------------*/ - -JRESULT jd_decomp( - JDEC * jd, /* Initialized decompression object */ - int (*outfunc)(JDEC *, void *, JRECT *), /* RGB output function */ - uint8_t scale /* Output de-scaling factor (0 to 3) */ -) -{ - unsigned int x, y, mx, my; - uint16_t rst, rsc; - JRESULT rc; - - - if(scale > (JD_USE_SCALE ? 3 : 0)) return JDR_PAR; - jd->scale = scale; - - mx = jd->msx * 8; - my = jd->msy * 8; /* Size of the MCU (pixel) */ - - jd->dcv[2] = jd->dcv[1] = jd->dcv[0] = 0; /* Initialize DC values */ - rst = rsc = 0; - - rc = JDR_OK; - for(y = 0; y < jd->height; y += my) { /* Vertical loop of MCUs */ - for(x = 0; x < jd->width; x += mx) { /* Horizontal loop of MCUs */ - if(jd->nrst && rst++ == jd->nrst) { /* Process restart interval if enabled */ - rc = jd_restart(jd, rsc++); - if(rc != JDR_OK) return rc; - rst = 1; - } - rc = jd_mcu_load(jd); /* Load an MCU (decompress huffman coded stream, dequantize and apply IDCT) */ - if(rc != JDR_OK) return rc; - rc = jd_mcu_output(jd, outfunc, x, y); /* Output the MCU (YCbCr to RGB, scaling and output) */ - if(rc != JDR_OK) return rc; - } - } - - return rc; -} -#endif diff --git a/L3_Middlewares/LVGL/src/libs/tjpgd/tjpgd.h b/L3_Middlewares/LVGL/src/libs/tjpgd/tjpgd.h deleted file mode 100644 index 887038a..0000000 --- a/L3_Middlewares/LVGL/src/libs/tjpgd/tjpgd.h +++ /dev/null @@ -1,108 +0,0 @@ -/*----------------------------------------------------------------------------/ -/ TJpgDec - Tiny JPEG Decompressor R0.03 include file (C)ChaN, 2021 -/----------------------------------------------------------------------------*/ -#ifndef DEF_TJPGDEC -#define DEF_TJPGDEC - -#ifdef __cplusplus -extern "C" { -#endif - -#include "../../lv_conf_internal.h" -#include "tjpgdcnf.h" - -#if LV_USE_TJPGD - -#include -#include - -#if JD_FASTDECODE >= 1 -typedef int16_t jd_yuv_t; -#else -typedef uint8_t jd_yuv_t; -#endif - - -/* Error code */ -typedef enum { - JDR_OK = 0, /* 0: Succeeded */ - JDR_INTR, /* 1: Interrupted by output function */ - JDR_INP, /* 2: Device error or wrong termination of input stream */ - JDR_MEM1, /* 3: Insufficient memory pool for the image */ - JDR_MEM2, /* 4: Insufficient stream input buffer */ - JDR_PAR, /* 5: Parameter error */ - JDR_FMT1, /* 6: Data format error (may be broken data) */ - JDR_FMT2, /* 7: Right format but not supported */ - JDR_FMT3 /* 8: Not supported JPEG standard */ -} JRESULT; - - - -/* Rectangular region in the output image */ -typedef struct { - uint16_t left; /* Left end */ - uint16_t right; /* Right end */ - uint16_t top; /* Top end */ - uint16_t bottom; /* Bottom end */ -} JRECT; - - - -/* Decompressor object structure */ -typedef struct JDEC JDEC; -struct JDEC { - size_t dctr; /* Number of bytes available in the input buffer */ - uint8_t * dptr; /* Current data read ptr */ - uint8_t * inbuf; /* Bit stream input buffer */ - uint8_t dbit; /* Number of bits available in wreg or reading bit mask */ - uint8_t scale; /* Output scaling ratio */ - uint8_t msx, msy; /* MCU size in unit of block (width, height) */ - uint8_t qtid[3]; /* Quantization table ID of each component, Y, Cb, Cr */ - uint8_t ncomp; /* Number of color components 1:grayscale, 3:color */ - int16_t dcv[3]; /* Previous DC element of each component */ - uint16_t nrst; /* Restart interval */ - uint16_t rst; /* Restart count*/ - uint16_t rsc; /* Expected restart sequence ID*/ - uint16_t width, height; /* Size of the input image (pixel) */ - uint8_t * huffbits[2][2]; /* Huffman bit distribution tables [id][dcac] */ - uint16_t * huffcode[2][2]; /* Huffman code word tables [id][dcac] */ - uint8_t * huffdata[2][2]; /* Huffman decoded data tables [id][dcac] */ - int32_t * qttbl[4]; /* Dequantizer tables [id] */ -#if JD_FASTDECODE >= 1 - uint32_t wreg; /* Working shift register */ - uint8_t marker; /* Detected marker (0:None) */ -#if JD_FASTDECODE == 2 - uint8_t longofs[2][2]; /* Table offset of long code [id][dcac] */ - uint16_t * hufflut_ac[2]; /* Fast huffman decode tables for AC short code [id] */ - uint8_t * hufflut_dc[2]; /* Fast huffman decode tables for DC short code [id] */ -#endif -#endif - void * workbuf; /* Working buffer for IDCT and RGB output */ - jd_yuv_t * mcubuf; /* Working buffer for the MCU */ - void * pool; /* Pointer to available memory pool */ - void * pool_original; /* Pointer to original pool */ - size_t sz_pool; /* Size of memory pool (bytes available) */ - size_t (*infunc)(JDEC *, uint8_t *, size_t); /* Pointer to jpeg stream input function */ - void * device; /* Pointer to I/O device identifier for the session */ -}; - - - -/* TJpgDec API functions */ -JRESULT jd_prepare(JDEC * jd, size_t (*infunc)(JDEC *, uint8_t *, size_t), void * pool, size_t sz_pool, void * dev); - -JRESULT jd_decomp(JDEC * jd, int (*outfunc)(JDEC *, void *, JRECT *), uint8_t scale); - -JRESULT jd_mcu_load(JDEC * jd); - -JRESULT jd_mcu_output(JDEC * jd, int (*outfunc)(JDEC *, void *, JRECT *), unsigned int x, unsigned int y); - -JRESULT jd_restart(JDEC * jd, uint16_t rstn); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _TJPGDEC */ diff --git a/L3_Middlewares/LVGL/src/lv_api_map.h b/L3_Middlewares/LVGL/src/lv_api_map.h new file mode 100644 index 0000000..f2b640a --- /dev/null +++ b/L3_Middlewares/LVGL/src/lv_api_map.h @@ -0,0 +1,88 @@ +/** + * @file lv_api_map.h + * + */ + +#ifndef LV_API_MAP_H +#define LV_API_MAP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lvgl.h" + +/********************* + * DEFINES + *********************/ + +#define LV_NO_TASK_READY LV_NO_TIMER_READY +#define LV_INDEV_STATE_REL LV_INDEV_STATE_RELEASED +#define LV_INDEV_STATE_PR LV_INDEV_STATE_PRESSED +#define LV_OBJ_FLAG_SNAPABLE LV_OBJ_FLAG_SNAPPABLE /*Fixed typo*/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +static inline LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_task_handler(void) +{ + return lv_timer_handler(); +} + +/********************** + * MACROS + **********************/ + + +/********************** + * INLINE FUNCTIONS + **********************/ + +/** + * Move the object to the foreground. + * It will look like if it was created as the last child of its parent. + * It also means it can cover any of the siblings. + * @param obj pointer to an object + */ +static inline void lv_obj_move_foreground(lv_obj_t * obj) +{ + lv_obj_t * parent = lv_obj_get_parent(obj); + lv_obj_move_to_index(obj, lv_obj_get_child_cnt(parent) - 1); +} + +/** + * Move the object to the background. + * It will look like if it was created as the first child of its parent. + * It also means any of the siblings can cover the object. + * @param obj pointer to an object + */ +static inline void lv_obj_move_background(lv_obj_t * obj) +{ + lv_obj_move_to_index(obj, 0); +} + + + +/********************** + * DEPRECATED FUNCTIONS + **********************/ + +static inline uint32_t lv_obj_get_child_id(const struct _lv_obj_t * obj) +{ + LV_LOG_WARN("lv_obj_get_child_id(obj) is deprecated, please use lv_obj_get_index(obj)."); + return lv_obj_get_index(obj); +} + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_API_MAP_H*/ diff --git a/L3_Middlewares/LVGL/src/lv_api_map_v8.h b/L3_Middlewares/LVGL/src/lv_api_map_v8.h deleted file mode 100644 index 822450f..0000000 --- a/L3_Middlewares/LVGL/src/lv_api_map_v8.h +++ /dev/null @@ -1,328 +0,0 @@ -/** - * @file lv_api_map_v8.h - * - */ - -#ifndef LV_API_MAP_V8_H -#define LV_API_MAP_V8_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "misc/lv_types.h" - -/********************* - * DEFINES - *********************/ - -#define LV_DISP_ROTATION_0 LV_DISPLAY_ROTATION_0 -#define LV_DISP_ROTATION_90 LV_DISPLAY_ROTATION_90 -#define LV_DISP_ROTATION_180 LV_DISPLAY_ROTATION_180 -#define LV_DISP_ROTATION_270 LV_DISPLAY_ROTATION_270 - -#define LV_DISP_RENDER_MODE_PARTIAL LV_DISPLAY_RENDER_MODE_PARTIAL -#define LV_DISP_RENDER_MODE_DIRECT LV_DISPLAY_RENDER_MODE_DIRECT -#define LV_DISP_RENDER_MODE_FULL LV_DISPLAY_RENDER_MODE_FULL - -#if LV_USE_BUTTONMATRIX -#define LV_BTNMATRIX_BTN_NONE LV_BUTTONMATRIX_BUTTON_NONE - -#define LV_BTNMATRIX_CTRL_HIDDEN LV_BUTTONMATRIX_CTRL_HIDDEN -#define LV_BTNMATRIX_CTRL_NO_REPEAT LV_BUTTONMATRIX_CTRL_NO_REPEAT -#define LV_BTNMATRIX_CTRL_DISABLED LV_BUTTONMATRIX_CTRL_DISABLED -#define LV_BTNMATRIX_CTRL_CHECKABLE LV_BUTTONMATRIX_CTRL_CHECKABLE -#define LV_BTNMATRIX_CTRL_CHECKED LV_BUTTONMATRIX_CTRL_CHECKED -#define LV_BTNMATRIX_CTRL_CLICK_TRIG LV_BUTTONMATRIX_CTRL_CLICK_TRIG -#define LV_BTNMATRIX_CTRL_POPOVER LV_BUTTONMATRIX_CTRL_POPOVER -#define LV_BTNMATRIX_CTRL_CUSTOM_1 LV_BUTTONMATRIX_CTRL_CUSTOM_1 -#define LV_BTNMATRIX_CTRL_CUSTOM_2 LV_BUTTONMATRIX_CTRL_CUSTOM_2 -#endif /* LV_USE_BUTTONMATRIX */ - -/********************** - * TYPEDEFS - **********************/ -typedef int32_t lv_coord_t; -typedef lv_result_t lv_res_t; -typedef lv_image_dsc_t lv_img_dsc_t; -typedef lv_display_t lv_disp_t; -typedef lv_display_rotation_t lv_disp_rotation_t; -typedef lv_display_render_mode_t lv_disp_render_t; -typedef lv_anim_completed_cb_t lv_anim_ready_cb_t; -typedef lv_screen_load_anim_t lv_scr_load_anim_t; - -#if LV_USE_BUTTONMATRIX -typedef lv_buttonmatrix_ctrl_t lv_btnmatrix_ctrl_t; -#endif /* LV_USE_BUTTONMATRIX */ - -#if LV_USE_IMAGEBUTTON -#define LV_IMGBTN_STATE_RELEASED LV_IMAGEBUTTON_STATE_RELEASED -#define LV_IMGBTN_STATE_PRESSED LV_IMAGEBUTTON_STATE_PRESSED -#define LV_IMGBTN_STATE_DISABLED LV_IMAGEBUTTON_STATE_DISABLED -#define LV_IMGBTN_STATE_CHECKED_RELEASED LV_IMAGEBUTTON_STATE_CHECKED_RELEASED -#define LV_IMGBTN_STATE_CHECKED_PRESSED LV_IMAGEBUTTON_STATE_CHECKED_PRESSED -#define LV_IMGBTN_STATE_CHECKED_DISABLED LV_IMAGEBUTTON_STATE_CHECKED_DISABLED -#endif /* LV_USE_IMAGEBUTTON */ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -static inline LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_task_handler(void) -{ - return lv_timer_handler(); -} - -/** - * Move the object to the foreground. - * It will look like if it was created as the last child of its parent. - * It also means it can cover any of the siblings. - * @param obj pointer to an object - */ -static inline void lv_obj_move_foreground(lv_obj_t * obj) -{ - lv_obj_t * parent = lv_obj_get_parent(obj); - if(!parent) { - LV_LOG_WARN("parent is NULL"); - return; - } - - lv_obj_move_to_index(obj, lv_obj_get_child_count(parent) - 1); -} - -/** - * Move the object to the background. - * It will look like if it was created as the first child of its parent. - * It also means any of the siblings can cover the object. - * @param obj pointer to an object - */ -static inline void lv_obj_move_background(lv_obj_t * obj) -{ - lv_obj_move_to_index(obj, 0); -} - -/********************** - * MACROS - **********************/ -#define LV_RES_OK LV_RESULT_OK -#define LV_RES_INV LV_RESULT_INVALID - -#define LV_INDEV_STATE_PR LV_INDEV_STATE_PRESSED -#define LV_INDEV_STATE_REL LV_INDEV_STATE_RELEASED - -#define lv_obj_del lv_obj_delete -#define lv_obj_del_async lv_obj_delete_async -#define lv_obj_clear_flag lv_obj_remove_flag -#define lv_obj_clear_state lv_obj_remove_state - -#define lv_indev_set_disp lv_indev_set_display -#define lv_indev_get_act lv_indev_active -#define lv_scr_act lv_screen_active -#define lv_disp_remove lv_display_delete -#define lv_disp_set_default lv_display_set_default -#define lv_disp_get_default lv_display_get_default -#define lv_disp_get_next lv_display_get_next -#define lv_disp_set_rotation lv_display_set_rotation -#define lv_disp_get_hor_res lv_display_get_horizontal_resolution -#define lv_disp_get_ver_res lv_display_get_vertical_resolution -#define lv_disp_get_physical_hor_res lv_display_get_physical_horizontal_resolution -#define lv_disp_get_physical_ver_res lv_display_get_physical_vertical_resolution -#define lv_disp_get_offset_x lv_display_get_offset_x -#define lv_disp_get_offset_y lv_display_get_offset_y -#define lv_disp_get_rotation lv_display_get_rotation -#define lv_disp_get_dpi lv_display_get_dpi -#define lv_disp_get_antialiasing lv_display_get_antialiasing -#define lv_disp_flush_ready lv_display_flush_ready -#define lv_disp_flush_is_last lv_display_flush_is_last -#define lv_disp_get_scr_act lv_display_get_screen_active -#define lv_disp_get_scr_prev lv_display_get_screen_prev -#define lv_disp_load_scr lv_screen_load -#define lv_scr_load lv_screen_load -#define lv_scr_load_anim lv_screen_load_anim -#define lv_disp_get_layer_top lv_display_get_layer_top -#define lv_disp_get_layer_sys lv_display_get_layer_sys -#define lv_disp_send_event lv_display_send_event -#define lv_disp_set_theme lv_display_set_theme -#define lv_disp_get_theme lv_display_get_theme -#define lv_disp_get_inactive_time lv_display_get_inactive_time -#define lv_disp_trig_activity lv_display_trigger_activity -#define lv_disp_enable_invalidation lv_display_enable_invalidation -#define lv_disp_is_invalidation_enabled lv_display_is_invalidation_enabled -#define lv_disp_refr_timer lv_display_refr_timer -#define lv_disp_get_refr_timer lv_display_get_refr_timer - -#define lv_timer_del lv_timer_delete - -#define lv_anim_del lv_anim_delete -#define lv_anim_del_all lv_anim_delete_all -#define lv_anim_set_ready_cb lv_anim_set_completed_cb - -#define lv_group_del lv_group_delete - -#if LV_USE_TEXTAREA -#define lv_txt_get_size lv_text_get_size -#define lv_txt_get_width lv_text_get_width -#endif /* LV_USE_TEXTAREA */ - -#if LV_USE_IMAGE -#define lv_img_create lv_image_create -#define lv_img_set_src lv_image_set_src -#define lv_img_set_offset_x lv_image_set_offset_x -#define lv_img_set_offset_y lv_image_set_offset_y -#define lv_img_set_angle lv_image_set_rotation -#define lv_img_set_pivot lv_image_set_pivot -#define lv_img_set_zoom lv_image_set_scale -#define lv_img_set_antialias lv_image_set_antialias -#define lv_img_get_src lv_image_get_src -#define lv_img_get_offset_x lv_image_get_offset_x -#define lv_img_get_offset_y lv_image_get_offset_y -#define lv_img_get_angle lv_image_get_rotation -#define lv_img_get_pivot lv_image_get_pivot -#define lv_img_get_zoom lv_image_get_scale -#define lv_img_get_antialias lv_image_get_antialias -#endif /* LV_USE_IMAGE */ - -#if LV_USE_IMAGEBUTTON -#define lv_imgbtn_create lv_imagebutton_create -#define lv_imgbtn_set_src lv_imagebutton_set_src -#define lv_imgbtn_set_state lv_imagebutton_set_state -#define lv_imgbtn_get_src_left lv_imagebutton_get_src_left -#define lv_imgbtn_get_src_middle lv_imagebutton_get_src_middle -#define lv_imgbtn_get_src_right lv_imagebutton_get_src_right -#endif /* LV_USE_IMAGEBUTTON */ - -#if LV_USE_LIST -#define lv_list_set_btn_text lv_list_set_button_text -#define lv_list_get_btn_text lv_list_get_button_text -#define lv_list_add_btn lv_list_add_button -#endif /* LV_USE_LIST */ - -#if LV_USE_BUTTON -#define lv_btn_create lv_button_create -#endif /* LV_USE_BUTTON */ - -#if LV_USE_BUTTONMATRIX -#define lv_btnmatrix_create lv_buttonmatrix_create -#define lv_btnmatrix_set_map lv_buttonmatrix_set_map -#define lv_btnmatrix_set_ctrl_map lv_buttonmatrix_set_ctrl_map -#define lv_btnmatrix_set_selected_btn lv_buttonmatrix_set_selected_button -#define lv_btnmatrix_set_btn_ctrl lv_buttonmatrix_set_button_ctrl -#define lv_btnmatrix_clear_btn_ctrl lv_buttonmatrix_clear_button_ctrl -#define lv_btnmatrix_set_btn_ctrl_all lv_buttonmatrix_set_button_ctrl_all -#define lv_btnmatrix_clear_btn_ctrl_all lv_buttonmatrix_clear_button_ctrl_all -#define lv_btnmatrix_set_btn_width lv_buttonmatrix_set_button_width -#define lv_btnmatrix_set_one_checked lv_buttonmatrix_set_one_checked -#define lv_btnmatrix_get_map lv_buttonmatrix_get_map -#define lv_btnmatrix_get_selected_btn lv_buttonmatrix_get_selected_button -#define lv_btnmatrix_get_btn_text lv_buttonmatrix_get_button_text -#define lv_btnmatrix_has_button_ctrl lv_buttonmatrix_has_button_ctrl -#define lv_btnmatrix_get_one_checked lv_buttonmatrix_get_one_checked -#endif /* LV_USE_BUTTONMATRIX */ - -#if LV_USE_TABVIEW -#define lv_tabview_get_tab_btns lv_tabview_get_tab_bar -#define lv_tabview_get_tab_act lv_tabview_get_tab_active -#define lv_tabview_set_act lv_tabview_set_active -#endif /* LV_USE_TABVIEW */ - -#if LV_USE_TILEVIEW -#define lv_tileview_get_tile_act lv_tileview_get_tile_active -#define lv_obj_set_tile_id lv_tileview_set_tile_by_index -#define lv_obj_set_tile lv_tileview_set_tile -#endif /* LV_USE_TILEVIEW */ - -#if LV_USE_ROLLER -#define lv_roller_set_visible_row_cnt lv_roller_set_visible_row_count -#define lv_roller_get_option_cnt lv_roller_get_option_count -#endif /* LV_USE_ROLLER */ - -#if LV_USE_TABLE -#define lv_table_set_col_cnt lv_table_set_column_count -#define lv_table_set_row_cnt lv_table_set_row_count -#define lv_table_get_col_cnt lv_table_get_column_count -#define lv_table_get_row_cnt lv_table_get_row_count -#define lv_table_set_col_width lv_table_set_column_width -#define lv_table_get_col_width lv_table_get_column_width -#endif /* LV_USE_TABLE */ - -#if LV_USE_DROPDOWN -#define lv_dropdown_get_option_cnt lv_dropdown_get_option_count -#endif /* LV_USE_DROPDOWN */ - -#define lv_obj_get_child_cnt lv_obj_get_child_count -#define lv_obj_get_disp lv_obj_get_display -#define lv_obj_delete_anim_ready_cb lv_obj_delete_anim_completed_cb - -#define LV_STYLE_ANIM_TIME LV_STYLE_ANIM_DURATION -#define LV_STYLE_IMG_OPA LV_STYLE_IMAGE_OPA -#define LV_STYLE_IMG_RECOLOR LV_STYLE_IMAGE_RECOLOR -#define LV_STYLE_IMG_RECOLOR_OPA LV_STYLE_IMAGE_RECOLOR_OPA -#define LV_STYLE_SHADOW_OFS_X LV_STYLE_SHADOW_OFFSET_X -#define LV_STYLE_SHADOW_OFS_Y LV_STYLE_SHADOW_OFFSET_Y -#define LV_STYLE_TRANSFORM_ANGLE LV_STYLE_TRANSFORM_ROTATION - -#define lv_obj_get_style_anim_time lv_obj_get_style_anim_duration -#define lv_obj_get_style_img_opa lv_obj_get_style_image_opa -#define lv_obj_get_style_img_recolor lv_obj_get_style_image_recolor -#define lv_obj_get_style_img_recolor_filtered lv_obj_get_style_image_recolor_filtered -#define lv_obj_get_style_img_recolor_opa lv_obj_get_style_image_recolor_opa -#define lv_obj_get_style_shadow_ofs_x lv_obj_get_style_shadow_offset_x -#define lv_obj_get_style_shadow_ofs_y lv_obj_get_style_shadow_offset_y -#define lv_obj_get_style_transform_angle lv_obj_get_style_transform_rotation -#define lv_obj_get_style_bg_img_src lv_obj_get_style_bg_image_src -#define lv_obj_get_style_bg_img_recolor lv_obj_get_style_bg_image_recolor -#define lv_obj_get_style_bg_img_recolor_opa lv_obj_get_style_bg_image_recolor_opa - -#define lv_obj_set_style_anim_time lv_obj_set_style_anim_duration -#define lv_obj_set_style_img_opa lv_obj_set_style_image_opa -#define lv_obj_set_style_img_recolor lv_obj_set_style_image_recolor -#define lv_obj_set_style_img_recolor_opa lv_obj_set_style_image_recolor_opa -#define lv_obj_set_style_shadow_ofs_x lv_obj_set_style_shadow_offset_x -#define lv_obj_set_style_shadow_ofs_y lv_obj_set_style_shadow_offset_y -#define lv_obj_set_style_transform_zoom lv_obj_set_style_transform_scale -#define lv_obj_set_style_transform_angle lv_obj_set_style_transform_rotation -#define lv_obj_set_style_bg_img_src lv_obj_set_style_bg_image_src -#define lv_obj_set_style_bg_img_recolor lv_obj_set_style_bg_image_recolor -#define lv_obj_set_style_bg_img_recolor_opa lv_obj_set_style_bg_image_recolor_opa - -#define lv_style_set_anim_time lv_style_set_anim_duration -#define lv_style_set_img_opa lv_style_set_image_opa -#define lv_style_set_img_recolor lv_style_set_image_recolor -#define lv_style_set_img_recolor_opa lv_style_set_image_recolor_opa -#define lv_style_set_shadow_ofs_x lv_style_set_shadow_offset_x -#define lv_style_set_shadow_ofs_y lv_style_set_shadow_offset_y -#define lv_style_set_transform_angle lv_style_set_transform_rotation -#define lv_style_set_transform_zoom lv_style_set_transform_scale -#define lv_style_set_bg_img_src lv_style_set_bg_image_src -#define lv_style_set_bg_img_recolor lv_style_set_bg_image_recolor -#define lv_style_set_bg_img_recolor_opa lv_style_set_bg_image_recolor_opa - -#if LV_USE_KEYBOARD -#define lv_keyboard_get_selected_btn lv_keyboard_get_selected_button -#define lv_keyboard_get_btn_text lv_keyboard_get_button_text -#endif /* LV_USE_KEYBOARD */ - -#define LV_ZOOM_NONE LV_SCALE_NONE - -#define lv_image_decoder_built_in_open lv_bin_decoder_open -#define lv_image_decoder_built_in_close lv_bin_decoder_close - -/********************** - * MACROS - **********************/ -/** Use this macro to declare an image in a C file*/ -#define LV_IMG_DECLARE(var_name) extern const lv_image_dsc_t var_name; - -/********************** - * DEPRECATED FUNCTIONS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_API_MAP_V8_H*/ diff --git a/L3_Middlewares/LVGL/src/lv_api_map_v9_0.h b/L3_Middlewares/LVGL/src/lv_api_map_v9_0.h deleted file mode 100644 index b0d22cd..0000000 --- a/L3_Middlewares/LVGL/src/lv_api_map_v9_0.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file lv_api_map_v9_0.h - * - */ - -#ifndef LV_API_MAP_V9_0_H -#define LV_API_MAP_V9_0_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "misc/lv_types.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ -#define lv_image_set_align lv_image_set_inner_align -#define lv_image_get_align lv_image_get_inner_align - -#ifndef LV_DRAW_LAYER_SIMPLE_BUF_SIZE -#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE -#endif - -#define lv_button_bind_checked lv_obj_bind_checked - -#define LV_DRAW_BUF_DEFINE LV_DRAW_BUF_DEFINE_STATIC - -#define _lv_utils_bsearch lv_utils_bsearch -#define lv_draw_buf_align_user lv_draw_buf_align_ex -#define lv_draw_buf_create_user lv_draw_buf_create_ex -#define lv_draw_buf_width_to_stride_user lv_draw_buf_width_to_stride_ex -#define lv_draw_buf_dup_user lv_draw_buf_dup_ex - -#define lv_draw_buf_invalidate_cache_user(handlers, drawbuf, area) lv_draw_buf_invalidate_cache(drawbuf, area) -#define lv_draw_buf_flush_cache_user(handlers, drawbuf, area) lv_draw_buf_flush_cache(drawbuf, area) -#define lv_draw_buf_destroy_user(handlers, drawbuf) lv_draw_buf_destroy(drawbuf) - -/********************** - * MACROS - **********************/ - -/********************** - * DEPRECATED FUNCTIONS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_API_MAP_V9_0_H*/ diff --git a/L3_Middlewares/LVGL/src/lv_api_map_v9_1.h b/L3_Middlewares/LVGL/src/lv_api_map_v9_1.h deleted file mode 100644 index 3264b9a..0000000 --- a/L3_Middlewares/LVGL/src/lv_api_map_v9_1.h +++ /dev/null @@ -1,98 +0,0 @@ -/** - * @file lv_api_map_v9_1.h - * - */ - -#ifndef LV_API_MAP_V9_1_H -#define LV_API_MAP_V9_1_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "misc/lv_types.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * MACROS - **********************/ - -#define _LV_EVENT_LAST LV_EVENT_LAST -#define _lv_obj_t lv_obj_t -#define _lv_obj_class_t lv_obj_class_t -#define _lv_event_t lv_event_t -#define _lv_event_code_t lv_event_code_t -#define _lv_event_mark_deleted lv_event_mark_deleted -#define lv_obj_add_event lv_obj_add_event_cb - -#define _lv_anim_t lv_anim_t - -#define _LV_STYLE_LAST_BUILT_IN_PROP LV_STYLE_LAST_BUILT_IN_PROP -#define _LV_FLEX_REVERSE LV_FLEX_REVERSE -#define _LV_FLEX_WRAP LV_FLEX_WRAP -#define _LV_FLEX_COLUMN LV_FLEX_COLUMN - -#define _lv_area_is_equal lv_area_is_equal -#define _lv_area_is_in lv_area_is_in -#define _lv_area_intersect lv_area_intersect -#define _lv_area_is_point_on lv_area_is_point_on -#define _lv_area_join lv_area_join -#define _lv_image_buf_get_transformed_area lv_image_buf_get_transformed_area - -#define _lv_ll_init lv_ll_init -#define _lv_ll_ins_head lv_ll_ins_head -#define _lv_ll_ins_prev lv_ll_ins_prev -#define _lv_ll_ins_tail lv_ll_ins_tail -#define _lv_ll_get_head lv_ll_get_head -#define _lv_ll_get_tail lv_ll_get_tail -#define _lv_ll_get_next lv_ll_get_next -#define _lv_ll_get_prev lv_ll_get_prev -#define _lv_ll_get_len lv_ll_get_len -#define _lv_ll_move_before lv_ll_move_before -#define _lv_ll_is_empty lv_ll_is_empty -#define _lv_ll_clear lv_ll_clear -#define _lv_ll_remove lv_ll_remove -#define _lv_ll_chg_list lv_ll_chg_list -#define _LV_LL_READ LV_LL_READ -#define _LV_LL_READ_BACK LV_LL_READ_BACK - -#define _lv_obj_scroll_by_raw lv_obj_scroll_by_raw -#define _lv_obj_get_ext_draw_size lv_obj_get_ext_draw_size -#define _lv_indev_scroll_handler lv_indev_scroll_handler - -#define _lv_display_t lv_display_t -#define _lv_display_refr_timer lv_disp_refr_timer -#define _lv_disp_refr_timer lv_disp_refr_timer -#define _lv_disp_get_refr_timer lv_disp_get_refr_timer - -#define _lv_timer_t lv_timer_t - -#define _lv_inv_area lv_inv_area - -/********************** - * DEPRECATED FUNCTIONS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_API_MAP_V9_0_H*/ diff --git a/L3_Middlewares/LVGL/src/lv_conf_internal.h b/L3_Middlewares/LVGL/src/lv_conf_internal.h index 0a66d94..0c29708 100644 --- a/L3_Middlewares/LVGL/src/lv_conf_internal.h +++ b/L3_Middlewares/LVGL/src/lv_conf_internal.h @@ -8,26 +8,7 @@ #define LV_CONF_INTERNAL_H /* clang-format off */ -/*Config options*/ -#define LV_OS_NONE 0 -#define LV_OS_PTHREAD 1 -#define LV_OS_FREERTOS 2 -#define LV_OS_CMSIS_RTOS2 3 -#define LV_OS_RTTHREAD 4 -#define LV_OS_WINDOWS 5 -#define LV_OS_MQX 6 -#define LV_OS_CUSTOM 255 - -#define LV_STDLIB_BUILTIN 0 -#define LV_STDLIB_CLIB 1 -#define LV_STDLIB_MICROPYTHON 2 -#define LV_STDLIB_RTTHREAD 3 -#define LV_STDLIB_CUSTOM 255 - -#define LV_DRAW_SW_ASM_NONE 0 -#define LV_DRAW_SW_ASM_NEON 1 -#define LV_DRAW_SW_ASM_HELIUM 2 -#define LV_DRAW_SW_ASM_CUSTOM 255 +#include /* Handle special Kconfig options */ #ifndef LV_KCONFIG_IGNORE @@ -47,7 +28,7 @@ #endif /*If lv_conf.h is not skipped include it*/ -#if !defined(LV_CONF_SKIP) || defined(LV_CONF_PATH) +#ifndef LV_CONF_SKIP #ifdef LV_CONF_PATH /*If there is a path defined for lv_conf.h use it*/ #define __LV_TO_STR_AUX(x) #x #define __LV_TO_STR(x) __LV_TO_STR_AUX(x) @@ -67,23 +48,20 @@ #endif #ifdef CONFIG_LV_COLOR_DEPTH - #define LV_KCONFIG_PRESENT + #define _LV_KCONFIG_PRESENT #endif /*---------------------------------- * Start parsing lv_conf_template.h -----------------------------------*/ -/*If you need to include anything here, do it inside the `__ASSEMBLY__` guard */ -#if 0 && defined(__ASSEMBLY__) -#include "my_include.h" -#endif +#include /*==================== COLOR SETTINGS *====================*/ -/*Color depth: 1 (I1), 8 (L8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/ +/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ #ifndef LV_COLOR_DEPTH #ifdef CONFIG_LV_COLOR_DEPTH #define LV_COLOR_DEPTH CONFIG_LV_COLOR_DEPTH @@ -92,98 +70,64 @@ #endif #endif -/*========================= - STDLIB WRAPPER SETTINGS - *=========================*/ - -/* Possible values - * - LV_STDLIB_BUILTIN: LVGL's built in implementation - * - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc - * - LV_STDLIB_MICROPYTHON: MicroPython implementation - * - LV_STDLIB_RTTHREAD: RT-Thread implementation - * - LV_STDLIB_CUSTOM: Implement the functions externally - */ -#ifndef LV_USE_STDLIB_MALLOC - #ifdef CONFIG_LV_USE_STDLIB_MALLOC - #define LV_USE_STDLIB_MALLOC CONFIG_LV_USE_STDLIB_MALLOC - #else - #define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN - #endif -#endif -#ifndef LV_USE_STDLIB_STRING - #ifdef CONFIG_LV_USE_STDLIB_STRING - #define LV_USE_STDLIB_STRING CONFIG_LV_USE_STDLIB_STRING +/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/ +#ifndef LV_COLOR_16_SWAP + #ifdef CONFIG_LV_COLOR_16_SWAP + #define LV_COLOR_16_SWAP CONFIG_LV_COLOR_16_SWAP #else - #define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN - #endif -#endif -#ifndef LV_USE_STDLIB_SPRINTF - #ifdef CONFIG_LV_USE_STDLIB_SPRINTF - #define LV_USE_STDLIB_SPRINTF CONFIG_LV_USE_STDLIB_SPRINTF - #else - #define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN + #define LV_COLOR_16_SWAP 0 #endif #endif -#ifndef LV_STDINT_INCLUDE - #ifdef CONFIG_LV_STDINT_INCLUDE - #define LV_STDINT_INCLUDE CONFIG_LV_STDINT_INCLUDE - #else - #define LV_STDINT_INCLUDE - #endif -#endif -#ifndef LV_STDDEF_INCLUDE - #ifdef CONFIG_LV_STDDEF_INCLUDE - #define LV_STDDEF_INCLUDE CONFIG_LV_STDDEF_INCLUDE - #else - #define LV_STDDEF_INCLUDE - #endif -#endif -#ifndef LV_STDBOOL_INCLUDE - #ifdef CONFIG_LV_STDBOOL_INCLUDE - #define LV_STDBOOL_INCLUDE CONFIG_LV_STDBOOL_INCLUDE +/*Enable features to draw on transparent background. + *It's required if opa, and transform_* style properties are used. + *Can be also used if the UI is above another layer, e.g. an OSD menu or video player.*/ +#ifndef LV_COLOR_SCREEN_TRANSP + #ifdef CONFIG_LV_COLOR_SCREEN_TRANSP + #define LV_COLOR_SCREEN_TRANSP CONFIG_LV_COLOR_SCREEN_TRANSP #else - #define LV_STDBOOL_INCLUDE + #define LV_COLOR_SCREEN_TRANSP 0 #endif #endif -#ifndef LV_INTTYPES_INCLUDE - #ifdef CONFIG_LV_INTTYPES_INCLUDE - #define LV_INTTYPES_INCLUDE CONFIG_LV_INTTYPES_INCLUDE + +/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. + * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ +#ifndef LV_COLOR_MIX_ROUND_OFS + #ifdef CONFIG_LV_COLOR_MIX_ROUND_OFS + #define LV_COLOR_MIX_ROUND_OFS CONFIG_LV_COLOR_MIX_ROUND_OFS #else - #define LV_INTTYPES_INCLUDE + #define LV_COLOR_MIX_ROUND_OFS 0 #endif #endif -#ifndef LV_LIMITS_INCLUDE - #ifdef CONFIG_LV_LIMITS_INCLUDE - #define LV_LIMITS_INCLUDE CONFIG_LV_LIMITS_INCLUDE + +/*Images pixels with this color will not be drawn if they are chroma keyed)*/ +#ifndef LV_COLOR_CHROMA_KEY + #ifdef CONFIG_LV_COLOR_CHROMA_KEY + #define LV_COLOR_CHROMA_KEY CONFIG_LV_COLOR_CHROMA_KEY #else - #define LV_LIMITS_INCLUDE + #define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/ #endif #endif -#ifndef LV_STDARG_INCLUDE - #ifdef CONFIG_LV_STDARG_INCLUDE - #define LV_STDARG_INCLUDE CONFIG_LV_STDARG_INCLUDE + +/*========================= + MEMORY SETTINGS + *=========================*/ + +/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/ +#ifndef LV_MEM_CUSTOM + #ifdef CONFIG_LV_MEM_CUSTOM + #define LV_MEM_CUSTOM CONFIG_LV_MEM_CUSTOM #else - #define LV_STDARG_INCLUDE + #define LV_MEM_CUSTOM 0 #endif #endif - -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN - /*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/ +#if LV_MEM_CUSTOM == 0 + /*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ #ifndef LV_MEM_SIZE #ifdef CONFIG_LV_MEM_SIZE #define LV_MEM_SIZE CONFIG_LV_MEM_SIZE #else - #define LV_MEM_SIZE (64 * 1024U) /*[bytes]*/ - #endif - #endif - - /*Size of the memory expand for `lv_malloc()` in bytes*/ - #ifndef LV_MEM_POOL_EXPAND_SIZE - #ifdef CONFIG_LV_MEM_POOL_EXPAND_SIZE - #define LV_MEM_POOL_EXPAND_SIZE CONFIG_LV_MEM_POOL_EXPAND_SIZE - #else - #define LV_MEM_POOL_EXPAND_SIZE 0 + #define LV_MEM_SIZE (48U * 1024U) /*[bytes]*/ #endif #endif @@ -212,571 +156,399 @@ #endif #endif #endif -#endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/ - -/*==================== - HAL SETTINGS - *====================*/ - -/*Default display refresh, input device read and animation step period.*/ -#ifndef LV_DEF_REFR_PERIOD - #ifdef CONFIG_LV_DEF_REFR_PERIOD - #define LV_DEF_REFR_PERIOD CONFIG_LV_DEF_REFR_PERIOD - #else - #define LV_DEF_REFR_PERIOD 33 /*[ms]*/ - #endif -#endif -/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. - *(Not so important, you can adjust it to modify default sizes and spaces)*/ -#ifndef LV_DPI_DEF - #ifdef CONFIG_LV_DPI_DEF - #define LV_DPI_DEF CONFIG_LV_DPI_DEF - #else - #define LV_DPI_DEF 130 /*[px/inch]*/ +#else /*LV_MEM_CUSTOM*/ + #ifndef LV_MEM_CUSTOM_INCLUDE + #ifdef CONFIG_LV_MEM_CUSTOM_INCLUDE + #define LV_MEM_CUSTOM_INCLUDE CONFIG_LV_MEM_CUSTOM_INCLUDE + #else + #define LV_MEM_CUSTOM_INCLUDE /*Header for the dynamic memory function*/ + #endif #endif -#endif - -/*================= - * OPERATING SYSTEM - *=================*/ -/*Select an operating system to use. Possible options: - * - LV_OS_NONE - * - LV_OS_PTHREAD - * - LV_OS_FREERTOS - * - LV_OS_CMSIS_RTOS2 - * - LV_OS_RTTHREAD - * - LV_OS_WINDOWS - * - LV_OS_MQX - * - LV_OS_CUSTOM */ -#ifndef LV_USE_OS - #ifdef CONFIG_LV_USE_OS - #define LV_USE_OS CONFIG_LV_USE_OS - #else - #define LV_USE_OS LV_OS_NONE + #ifndef LV_MEM_CUSTOM_ALLOC + #ifdef CONFIG_LV_MEM_CUSTOM_ALLOC + #define LV_MEM_CUSTOM_ALLOC CONFIG_LV_MEM_CUSTOM_ALLOC + #else + #define LV_MEM_CUSTOM_ALLOC malloc + #endif #endif -#endif - -#if LV_USE_OS == LV_OS_CUSTOM - #ifndef LV_OS_CUSTOM_INCLUDE - #ifdef CONFIG_LV_OS_CUSTOM_INCLUDE - #define LV_OS_CUSTOM_INCLUDE CONFIG_LV_OS_CUSTOM_INCLUDE + #ifndef LV_MEM_CUSTOM_FREE + #ifdef CONFIG_LV_MEM_CUSTOM_FREE + #define LV_MEM_CUSTOM_FREE CONFIG_LV_MEM_CUSTOM_FREE #else - #define LV_OS_CUSTOM_INCLUDE + #define LV_MEM_CUSTOM_FREE free #endif #endif -#endif -#if LV_USE_OS == LV_OS_FREERTOS - /* - * Unblocking an RTOS task with a direct notification is 45% faster and uses less RAM - * than unblocking a task using an intermediary object such as a binary semaphore. - * RTOS task notifications can only be used when there is only one task that can be the recipient of the event. - */ - #ifndef LV_USE_FREERTOS_TASK_NOTIFY - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_FREERTOS_TASK_NOTIFY - #define LV_USE_FREERTOS_TASK_NOTIFY CONFIG_LV_USE_FREERTOS_TASK_NOTIFY - #else - #define LV_USE_FREERTOS_TASK_NOTIFY 0 - #endif - #else - #define LV_USE_FREERTOS_TASK_NOTIFY 1 - #endif - #endif -#endif - -/*======================== - * RENDERING CONFIGURATION - *========================*/ - -/*Align the stride of all layers and images to this bytes*/ -#ifndef LV_DRAW_BUF_STRIDE_ALIGN - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_BUF_STRIDE_ALIGN - #define LV_DRAW_BUF_STRIDE_ALIGN CONFIG_LV_DRAW_BUF_STRIDE_ALIGN + #ifndef LV_MEM_CUSTOM_REALLOC + #ifdef CONFIG_LV_MEM_CUSTOM_REALLOC + #define LV_MEM_CUSTOM_REALLOC CONFIG_LV_MEM_CUSTOM_REALLOC #else - #define LV_DRAW_BUF_STRIDE_ALIGN 0 + #define LV_MEM_CUSTOM_REALLOC realloc #endif - #else - #define LV_DRAW_BUF_STRIDE_ALIGN 1 #endif -#endif +#endif /*LV_MEM_CUSTOM*/ -/*Align the start address of draw_buf addresses to this bytes*/ -#ifndef LV_DRAW_BUF_ALIGN - #ifdef CONFIG_LV_DRAW_BUF_ALIGN - #define LV_DRAW_BUF_ALIGN CONFIG_LV_DRAW_BUF_ALIGN +/*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms. + *You will see an error log message if there wasn't enough buffers. */ +#ifndef LV_MEM_BUF_MAX_NUM + #ifdef CONFIG_LV_MEM_BUF_MAX_NUM + #define LV_MEM_BUF_MAX_NUM CONFIG_LV_MEM_BUF_MAX_NUM #else - #define LV_DRAW_BUF_ALIGN 4 + #define LV_MEM_BUF_MAX_NUM 16 #endif #endif -/*Using matrix for transformations. - *Requirements: - `LV_USE_MATRIX = 1`. - The rendering engine needs to support 3x3 matrix transformations.*/ -#ifndef LV_DRAW_TRANSFORM_USE_MATRIX - #ifdef CONFIG_LV_DRAW_TRANSFORM_USE_MATRIX - #define LV_DRAW_TRANSFORM_USE_MATRIX CONFIG_LV_DRAW_TRANSFORM_USE_MATRIX +/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/ +#ifndef LV_MEMCPY_MEMSET_STD + #ifdef CONFIG_LV_MEMCPY_MEMSET_STD + #define LV_MEMCPY_MEMSET_STD CONFIG_LV_MEMCPY_MEMSET_STD #else - #define LV_DRAW_TRANSFORM_USE_MATRIX 0 + #define LV_MEMCPY_MEMSET_STD 0 #endif #endif -/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode - * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. - * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers - * and can't be drawn in chunks. */ +/*==================== + HAL SETTINGS + *====================*/ -/*The target buffer size for simple layer chunks.*/ -#ifndef LV_DRAW_LAYER_SIMPLE_BUF_SIZE - #ifdef CONFIG_LV_DRAW_LAYER_SIMPLE_BUF_SIZE - #define LV_DRAW_LAYER_SIMPLE_BUF_SIZE CONFIG_LV_DRAW_LAYER_SIMPLE_BUF_SIZE +/*Default display refresh period. LVG will redraw changed areas with this period time*/ +#ifndef LV_DISP_DEF_REFR_PERIOD + #ifdef CONFIG_LV_DISP_DEF_REFR_PERIOD + #define LV_DISP_DEF_REFR_PERIOD CONFIG_LV_DISP_DEF_REFR_PERIOD #else - #define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ + #define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/ #endif #endif -/* The stack size of the drawing thread. - * NOTE: If FreeType or ThorVG is enabled, it is recommended to set it to 32KB or more. - */ -#ifndef LV_DRAW_THREAD_STACK_SIZE - #ifdef CONFIG_LV_DRAW_THREAD_STACK_SIZE - #define LV_DRAW_THREAD_STACK_SIZE CONFIG_LV_DRAW_THREAD_STACK_SIZE - #else - #define LV_DRAW_THREAD_STACK_SIZE (8 * 1024) /*[bytes]*/ - #endif -#endif - -#ifndef LV_USE_DRAW_SW - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_DRAW_SW - #define LV_USE_DRAW_SW CONFIG_LV_USE_DRAW_SW - #else - #define LV_USE_DRAW_SW 0 - #endif - #else - #define LV_USE_DRAW_SW 1 - #endif -#endif -#if LV_USE_DRAW_SW == 1 - - /* - * Selectively disable color format support in order to reduce code size. - * NOTE: some features use certain color formats internally, e.g. - * - gradients use RGB888 - * - bitmaps with transparency may use ARGB8888 - */ - - #ifndef LV_DRAW_SW_SUPPORT_RGB565 - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_SW_SUPPORT_RGB565 - #define LV_DRAW_SW_SUPPORT_RGB565 CONFIG_LV_DRAW_SW_SUPPORT_RGB565 - #else - #define LV_DRAW_SW_SUPPORT_RGB565 0 - #endif - #else - #define LV_DRAW_SW_SUPPORT_RGB565 1 - #endif - #endif - #ifndef LV_DRAW_SW_SUPPORT_RGB565A8 - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_SW_SUPPORT_RGB565A8 - #define LV_DRAW_SW_SUPPORT_RGB565A8 CONFIG_LV_DRAW_SW_SUPPORT_RGB565A8 - #else - #define LV_DRAW_SW_SUPPORT_RGB565A8 0 - #endif - #else - #define LV_DRAW_SW_SUPPORT_RGB565A8 1 - #endif - #endif - #ifndef LV_DRAW_SW_SUPPORT_RGB888 - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_SW_SUPPORT_RGB888 - #define LV_DRAW_SW_SUPPORT_RGB888 CONFIG_LV_DRAW_SW_SUPPORT_RGB888 - #else - #define LV_DRAW_SW_SUPPORT_RGB888 0 - #endif - #else - #define LV_DRAW_SW_SUPPORT_RGB888 1 - #endif - #endif - #ifndef LV_DRAW_SW_SUPPORT_XRGB8888 - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_SW_SUPPORT_XRGB8888 - #define LV_DRAW_SW_SUPPORT_XRGB8888 CONFIG_LV_DRAW_SW_SUPPORT_XRGB8888 - #else - #define LV_DRAW_SW_SUPPORT_XRGB8888 0 - #endif - #else - #define LV_DRAW_SW_SUPPORT_XRGB8888 1 - #endif - #endif - #ifndef LV_DRAW_SW_SUPPORT_ARGB8888 - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_SW_SUPPORT_ARGB8888 - #define LV_DRAW_SW_SUPPORT_ARGB8888 CONFIG_LV_DRAW_SW_SUPPORT_ARGB8888 - #else - #define LV_DRAW_SW_SUPPORT_ARGB8888 0 - #endif - #else - #define LV_DRAW_SW_SUPPORT_ARGB8888 1 - #endif - #endif - #ifndef LV_DRAW_SW_SUPPORT_L8 - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_SW_SUPPORT_L8 - #define LV_DRAW_SW_SUPPORT_L8 CONFIG_LV_DRAW_SW_SUPPORT_L8 - #else - #define LV_DRAW_SW_SUPPORT_L8 0 - #endif - #else - #define LV_DRAW_SW_SUPPORT_L8 1 - #endif - #endif - #ifndef LV_DRAW_SW_SUPPORT_AL88 - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_SW_SUPPORT_AL88 - #define LV_DRAW_SW_SUPPORT_AL88 CONFIG_LV_DRAW_SW_SUPPORT_AL88 - #else - #define LV_DRAW_SW_SUPPORT_AL88 0 - #endif - #else - #define LV_DRAW_SW_SUPPORT_AL88 1 - #endif - #endif - #ifndef LV_DRAW_SW_SUPPORT_A8 - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_SW_SUPPORT_A8 - #define LV_DRAW_SW_SUPPORT_A8 CONFIG_LV_DRAW_SW_SUPPORT_A8 - #else - #define LV_DRAW_SW_SUPPORT_A8 0 - #endif - #else - #define LV_DRAW_SW_SUPPORT_A8 1 - #endif - #endif - #ifndef LV_DRAW_SW_SUPPORT_I1 - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_SW_SUPPORT_I1 - #define LV_DRAW_SW_SUPPORT_I1 CONFIG_LV_DRAW_SW_SUPPORT_I1 - #else - #define LV_DRAW_SW_SUPPORT_I1 0 - #endif - #else - #define LV_DRAW_SW_SUPPORT_I1 1 - #endif - #endif - - /* Set the number of draw unit. - * > 1 requires an operating system enabled in `LV_USE_OS` - * > 1 means multiple threads will render the screen in parallel */ - #ifndef LV_DRAW_SW_DRAW_UNIT_CNT - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_SW_DRAW_UNIT_CNT - #define LV_DRAW_SW_DRAW_UNIT_CNT CONFIG_LV_DRAW_SW_DRAW_UNIT_CNT - #else - #define LV_DRAW_SW_DRAW_UNIT_CNT 0 - #endif - #else - #define LV_DRAW_SW_DRAW_UNIT_CNT 1 - #endif +/*Input device read period in milliseconds*/ +#ifndef LV_INDEV_DEF_READ_PERIOD + #ifdef CONFIG_LV_INDEV_DEF_READ_PERIOD + #define LV_INDEV_DEF_READ_PERIOD CONFIG_LV_INDEV_DEF_READ_PERIOD + #else + #define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/ #endif +#endif - /* Use Arm-2D to accelerate the sw render */ - #ifndef LV_USE_DRAW_ARM2D_SYNC - #ifdef CONFIG_LV_USE_DRAW_ARM2D_SYNC - #define LV_USE_DRAW_ARM2D_SYNC CONFIG_LV_USE_DRAW_ARM2D_SYNC +/*Use a custom tick source that tells the elapsed time in milliseconds. + *It removes the need to manually update the tick with `lv_tick_inc()`)*/ +#ifndef LV_TICK_CUSTOM + #ifdef CONFIG_LV_TICK_CUSTOM + #define LV_TICK_CUSTOM CONFIG_LV_TICK_CUSTOM + #else + #define LV_TICK_CUSTOM 0 + #endif +#endif +#if LV_TICK_CUSTOM + #ifndef LV_TICK_CUSTOM_INCLUDE + #ifdef CONFIG_LV_TICK_CUSTOM_INCLUDE + #define LV_TICK_CUSTOM_INCLUDE CONFIG_LV_TICK_CUSTOM_INCLUDE #else - #define LV_USE_DRAW_ARM2D_SYNC 0 + #define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ #endif #endif - - /* Enable native helium assembly to be compiled */ - #ifndef LV_USE_NATIVE_HELIUM_ASM - #ifdef CONFIG_LV_USE_NATIVE_HELIUM_ASM - #define LV_USE_NATIVE_HELIUM_ASM CONFIG_LV_USE_NATIVE_HELIUM_ASM + #ifndef LV_TICK_CUSTOM_SYS_TIME_EXPR + #ifdef CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR + #define LV_TICK_CUSTOM_SYS_TIME_EXPR CONFIG_LV_TICK_CUSTOM_SYS_TIME_EXPR #else - #define LV_USE_NATIVE_HELIUM_ASM 0 + #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ #endif #endif + /*If using lvgl as ESP32 component*/ + // #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h" + // #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL)) +#endif /*LV_TICK_CUSTOM*/ - /* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only - * 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */ - #ifndef LV_DRAW_SW_COMPLEX - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_DRAW_SW_COMPLEX - #define LV_DRAW_SW_COMPLEX CONFIG_LV_DRAW_SW_COMPLEX - #else - #define LV_DRAW_SW_COMPLEX 0 - #endif - #else - #define LV_DRAW_SW_COMPLEX 1 - #endif +/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. + *(Not so important, you can adjust it to modify default sizes and spaces)*/ +#ifndef LV_DPI_DEF + #ifdef CONFIG_LV_DPI_DEF + #define LV_DPI_DEF CONFIG_LV_DPI_DEF + #else + #define LV_DPI_DEF 130 /*[px/inch]*/ #endif +#endif - #if LV_DRAW_SW_COMPLEX == 1 - /*Allow buffering some shadow calculation. - *LV_DRAW_SW_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` - *Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost*/ - #ifndef LV_DRAW_SW_SHADOW_CACHE_SIZE - #ifdef CONFIG_LV_DRAW_SW_SHADOW_CACHE_SIZE - #define LV_DRAW_SW_SHADOW_CACHE_SIZE CONFIG_LV_DRAW_SW_SHADOW_CACHE_SIZE - #else - #define LV_DRAW_SW_SHADOW_CACHE_SIZE 0 - #endif - #endif +/*======================= + * FEATURE CONFIGURATION + *=======================*/ - /* Set number of maximally cached circle data. - * The circumference of 1/4 circle are saved for anti-aliasing - * radius * 4 bytes are used per circle (the most often used radiuses are saved) - * 0: to disable caching */ - #ifndef LV_DRAW_SW_CIRCLE_CACHE_SIZE - #ifdef CONFIG_LV_DRAW_SW_CIRCLE_CACHE_SIZE - #define LV_DRAW_SW_CIRCLE_CACHE_SIZE CONFIG_LV_DRAW_SW_CIRCLE_CACHE_SIZE - #else - #define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4 - #endif - #endif - #endif +/*------------- + * Drawing + *-----------*/ - #ifndef LV_USE_DRAW_SW_ASM - #ifdef CONFIG_LV_USE_DRAW_SW_ASM - #define LV_USE_DRAW_SW_ASM CONFIG_LV_USE_DRAW_SW_ASM +/*Enable complex draw engine. + *Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/ +#ifndef LV_DRAW_COMPLEX + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_DRAW_COMPLEX + #define LV_DRAW_COMPLEX CONFIG_LV_DRAW_COMPLEX #else - #define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE + #define LV_DRAW_COMPLEX 0 #endif + #else + #define LV_DRAW_COMPLEX 1 #endif +#endif +#if LV_DRAW_COMPLEX != 0 - #if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM - #ifndef LV_DRAW_SW_ASM_CUSTOM_INCLUDE - #ifdef CONFIG_LV_DRAW_SW_ASM_CUSTOM_INCLUDE - #define LV_DRAW_SW_ASM_CUSTOM_INCLUDE CONFIG_LV_DRAW_SW_ASM_CUSTOM_INCLUDE - #else - #define LV_DRAW_SW_ASM_CUSTOM_INCLUDE "" - #endif + /*Allow buffering some shadow calculation. + *LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` + *Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/ + #ifndef LV_SHADOW_CACHE_SIZE + #ifdef CONFIG_LV_SHADOW_CACHE_SIZE + #define LV_SHADOW_CACHE_SIZE CONFIG_LV_SHADOW_CACHE_SIZE + #else + #define LV_SHADOW_CACHE_SIZE 0 #endif #endif - /* Enable drawing complex gradients in software: linear at an angle, radial or conical */ - #ifndef LV_USE_DRAW_SW_COMPLEX_GRADIENTS - #ifdef CONFIG_LV_USE_DRAW_SW_COMPLEX_GRADIENTS - #define LV_USE_DRAW_SW_COMPLEX_GRADIENTS CONFIG_LV_USE_DRAW_SW_COMPLEX_GRADIENTS + /* Set number of maximally cached circle data. + * The circumference of 1/4 circle are saved for anti-aliasing + * radius * 4 bytes are used per circle (the most often used radiuses are saved) + * 0: to disable caching */ + #ifndef LV_CIRCLE_CACHE_SIZE + #ifdef CONFIG_LV_CIRCLE_CACHE_SIZE + #define LV_CIRCLE_CACHE_SIZE CONFIG_LV_CIRCLE_CACHE_SIZE #else - #define LV_USE_DRAW_SW_COMPLEX_GRADIENTS 0 + #define LV_CIRCLE_CACHE_SIZE 4 #endif #endif -#endif +#endif /*LV_DRAW_COMPLEX*/ -/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */ -#ifndef LV_USE_DRAW_VGLITE - #ifdef CONFIG_LV_USE_DRAW_VGLITE - #define LV_USE_DRAW_VGLITE CONFIG_LV_USE_DRAW_VGLITE +/** + * "Simple layers" are used when a widget has `style_opa < 255` to buffer the widget into a layer + * and blend it as an image with the given opacity. + * Note that `bg_opa`, `text_opa` etc don't require buffering into layer) + * The widget can be buffered in smaller chunks to avoid using large buffers. + * + * - LV_LAYER_SIMPLE_BUF_SIZE: [bytes] the optimal target buffer size. LVGL will try to allocate it + * - LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE: [bytes] used if `LV_LAYER_SIMPLE_BUF_SIZE` couldn't be allocated. + * + * Both buffer sizes are in bytes. + * "Transformed layers" (where transform_angle/zoom properties are used) use larger buffers + * and can't be drawn in chunks. So these settings affects only widgets with opacity. + */ +#ifndef LV_LAYER_SIMPLE_BUF_SIZE + #ifdef CONFIG_LV_LAYER_SIMPLE_BUF_SIZE + #define LV_LAYER_SIMPLE_BUF_SIZE CONFIG_LV_LAYER_SIMPLE_BUF_SIZE #else - #define LV_USE_DRAW_VGLITE 0 + #define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024) #endif #endif - -#if LV_USE_DRAW_VGLITE - /* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */ - #ifndef LV_USE_VGLITE_BLIT_SPLIT - #ifdef CONFIG_LV_USE_VGLITE_BLIT_SPLIT - #define LV_USE_VGLITE_BLIT_SPLIT CONFIG_LV_USE_VGLITE_BLIT_SPLIT - #else - #define LV_USE_VGLITE_BLIT_SPLIT 0 - #endif +#ifndef LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE + #ifdef CONFIG_LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE + #define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE CONFIG_LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE + #else + #define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (3 * 1024) #endif +#endif - #if LV_USE_OS - /* Use additional draw thread for VG-Lite processing.*/ - #ifndef LV_USE_VGLITE_DRAW_THREAD - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_VGLITE_DRAW_THREAD - #define LV_USE_VGLITE_DRAW_THREAD CONFIG_LV_USE_VGLITE_DRAW_THREAD - #else - #define LV_USE_VGLITE_DRAW_THREAD 0 - #endif - #else - #define LV_USE_VGLITE_DRAW_THREAD 1 - #endif - #endif - - #if LV_USE_VGLITE_DRAW_THREAD - /* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */ - #ifndef LV_USE_VGLITE_DRAW_ASYNC - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_VGLITE_DRAW_ASYNC - #define LV_USE_VGLITE_DRAW_ASYNC CONFIG_LV_USE_VGLITE_DRAW_ASYNC - #else - #define LV_USE_VGLITE_DRAW_ASYNC 0 - #endif - #else - #define LV_USE_VGLITE_DRAW_ASYNC 1 - #endif - #endif - #endif +/*Default image cache size. Image caching keeps the images opened. + *If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added) + *With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. + *However the opened images might consume additional RAM. + *0: to disable caching*/ +#ifndef LV_IMG_CACHE_DEF_SIZE + #ifdef CONFIG_LV_IMG_CACHE_DEF_SIZE + #define LV_IMG_CACHE_DEF_SIZE CONFIG_LV_IMG_CACHE_DEF_SIZE + #else + #define LV_IMG_CACHE_DEF_SIZE 0 #endif +#endif - /* Enable VGLite asserts. */ - #ifndef LV_USE_VGLITE_ASSERT - #ifdef CONFIG_LV_USE_VGLITE_ASSERT - #define LV_USE_VGLITE_ASSERT CONFIG_LV_USE_VGLITE_ASSERT - #else - #define LV_USE_VGLITE_ASSERT 0 - #endif +/*Number of stops allowed per gradient. Increase this to allow more stops. + *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ +#ifndef LV_GRADIENT_MAX_STOPS + #ifdef CONFIG_LV_GRADIENT_MAX_STOPS + #define LV_GRADIENT_MAX_STOPS CONFIG_LV_GRADIENT_MAX_STOPS + #else + #define LV_GRADIENT_MAX_STOPS 2 #endif #endif -/* Use NXP's PXP on iMX RTxxx platforms. */ -#ifndef LV_USE_PXP - #ifdef CONFIG_LV_USE_PXP - #define LV_USE_PXP CONFIG_LV_USE_PXP +/*Default gradient buffer size. + *When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again. + *LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes. + *If the cache is too small the map will be allocated only while it's required for the drawing. + *0 mean no caching.*/ +#ifndef LV_GRAD_CACHE_DEF_SIZE + #ifdef CONFIG_LV_GRAD_CACHE_DEF_SIZE + #define LV_GRAD_CACHE_DEF_SIZE CONFIG_LV_GRAD_CACHE_DEF_SIZE #else - #define LV_USE_PXP 0 + #define LV_GRAD_CACHE_DEF_SIZE 0 #endif #endif -#if LV_USE_PXP - /* Use PXP for drawing.*/ - #ifndef LV_USE_DRAW_PXP - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_DRAW_PXP - #define LV_USE_DRAW_PXP CONFIG_LV_USE_DRAW_PXP - #else - #define LV_USE_DRAW_PXP 0 - #endif +/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display) + *LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface + *The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */ +#ifndef LV_DITHER_GRADIENT + #ifdef CONFIG_LV_DITHER_GRADIENT + #define LV_DITHER_GRADIENT CONFIG_LV_DITHER_GRADIENT + #else + #define LV_DITHER_GRADIENT 0 + #endif +#endif +#if LV_DITHER_GRADIENT + /*Add support for error diffusion dithering. + *Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing. + *The increase in memory consumption is (24 bits * object's width)*/ + #ifndef LV_DITHER_ERROR_DIFFUSION + #ifdef CONFIG_LV_DITHER_ERROR_DIFFUSION + #define LV_DITHER_ERROR_DIFFUSION CONFIG_LV_DITHER_ERROR_DIFFUSION #else - #define LV_USE_DRAW_PXP 1 + #define LV_DITHER_ERROR_DIFFUSION 0 #endif #endif +#endif - /* Use PXP to rotate display.*/ - #ifndef LV_USE_ROTATE_PXP - #ifdef CONFIG_LV_USE_ROTATE_PXP - #define LV_USE_ROTATE_PXP CONFIG_LV_USE_ROTATE_PXP - #else - #define LV_USE_ROTATE_PXP 0 - #endif +/*Maximum buffer size to allocate for rotation. + *Only used if software rotation is enabled in the display driver.*/ +#ifndef LV_DISP_ROT_MAX_BUF + #ifdef CONFIG_LV_DISP_ROT_MAX_BUF + #define LV_DISP_ROT_MAX_BUF CONFIG_LV_DISP_ROT_MAX_BUF + #else + #define LV_DISP_ROT_MAX_BUF (10*1024) #endif +#endif - #if LV_USE_DRAW_PXP && LV_USE_OS - /* Use additional draw thread for PXP processing.*/ - #ifndef LV_USE_PXP_DRAW_THREAD - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_PXP_DRAW_THREAD - #define LV_USE_PXP_DRAW_THREAD CONFIG_LV_USE_PXP_DRAW_THREAD - #else - #define LV_USE_PXP_DRAW_THREAD 0 - #endif - #else - #define LV_USE_PXP_DRAW_THREAD 1 - #endif - #endif +/*------------- + * GPU + *-----------*/ + +/*Use Arm's 2D acceleration library Arm-2D */ +#ifndef LV_USE_GPU_ARM2D + #ifdef CONFIG_LV_USE_GPU_ARM2D + #define LV_USE_GPU_ARM2D CONFIG_LV_USE_GPU_ARM2D + #else + #define LV_USE_GPU_ARM2D 0 #endif +#endif - /* Enable PXP asserts. */ - #ifndef LV_USE_PXP_ASSERT - #ifdef CONFIG_LV_USE_PXP_ASSERT - #define LV_USE_PXP_ASSERT CONFIG_LV_USE_PXP_ASSERT +/*Use STM32's DMA2D (aka Chrom Art) GPU*/ +#ifndef LV_USE_GPU_STM32_DMA2D + #ifdef CONFIG_LV_USE_GPU_STM32_DMA2D + #define LV_USE_GPU_STM32_DMA2D CONFIG_LV_USE_GPU_STM32_DMA2D + #else + #define LV_USE_GPU_STM32_DMA2D 0 + #endif +#endif +#if LV_USE_GPU_STM32_DMA2D + /*Must be defined to include path of CMSIS header of target processor + e.g. "stm32f7xx.h" or "stm32f4xx.h"*/ + #ifndef LV_GPU_DMA2D_CMSIS_INCLUDE + #ifdef CONFIG_LV_GPU_DMA2D_CMSIS_INCLUDE + #define LV_GPU_DMA2D_CMSIS_INCLUDE CONFIG_LV_GPU_DMA2D_CMSIS_INCLUDE #else - #define LV_USE_PXP_ASSERT 0 + #define LV_GPU_DMA2D_CMSIS_INCLUDE #endif #endif #endif -/* Use Renesas Dave2D on RA platforms. */ -#ifndef LV_USE_DRAW_DAVE2D - #ifdef CONFIG_LV_USE_DRAW_DAVE2D - #define LV_USE_DRAW_DAVE2D CONFIG_LV_USE_DRAW_DAVE2D +/*Enable RA6M3 G2D GPU*/ +#ifndef LV_USE_GPU_RA6M3_G2D + #ifdef CONFIG_LV_USE_GPU_RA6M3_G2D + #define LV_USE_GPU_RA6M3_G2D CONFIG_LV_USE_GPU_RA6M3_G2D #else - #define LV_USE_DRAW_DAVE2D 0 + #define LV_USE_GPU_RA6M3_G2D 0 #endif #endif - -/* Draw using cached SDL textures*/ -#ifndef LV_USE_DRAW_SDL - #ifdef CONFIG_LV_USE_DRAW_SDL - #define LV_USE_DRAW_SDL CONFIG_LV_USE_DRAW_SDL - #else - #define LV_USE_DRAW_SDL 0 +#if LV_USE_GPU_RA6M3_G2D + /*include path of target processor + e.g. "hal_data.h"*/ + #ifndef LV_GPU_RA6M3_G2D_INCLUDE + #ifdef CONFIG_LV_GPU_RA6M3_G2D_INCLUDE + #define LV_GPU_RA6M3_G2D_INCLUDE CONFIG_LV_GPU_RA6M3_G2D_INCLUDE + #else + #define LV_GPU_RA6M3_G2D_INCLUDE "hal_data.h" + #endif #endif #endif -/* Use VG-Lite GPU. */ -#ifndef LV_USE_DRAW_VG_LITE - #ifdef CONFIG_LV_USE_DRAW_VG_LITE - #define LV_USE_DRAW_VG_LITE CONFIG_LV_USE_DRAW_VG_LITE +/*Use SWM341's DMA2D GPU*/ +#ifndef LV_USE_GPU_SWM341_DMA2D + #ifdef CONFIG_LV_USE_GPU_SWM341_DMA2D + #define LV_USE_GPU_SWM341_DMA2D CONFIG_LV_USE_GPU_SWM341_DMA2D #else - #define LV_USE_DRAW_VG_LITE 0 + #define LV_USE_GPU_SWM341_DMA2D 0 #endif #endif - -#if LV_USE_DRAW_VG_LITE - /* Enable VG-Lite custom external 'gpu_init()' function */ - #ifndef LV_VG_LITE_USE_GPU_INIT - #ifdef CONFIG_LV_VG_LITE_USE_GPU_INIT - #define LV_VG_LITE_USE_GPU_INIT CONFIG_LV_VG_LITE_USE_GPU_INIT +#if LV_USE_GPU_SWM341_DMA2D + #ifndef LV_GPU_SWM341_DMA2D_INCLUDE + #ifdef CONFIG_LV_GPU_SWM341_DMA2D_INCLUDE + #define LV_GPU_SWM341_DMA2D_INCLUDE CONFIG_LV_GPU_SWM341_DMA2D_INCLUDE #else - #define LV_VG_LITE_USE_GPU_INIT 0 + #define LV_GPU_SWM341_DMA2D_INCLUDE "SWM341.h" #endif #endif +#endif - /* Enable VG-Lite assert. */ - #ifndef LV_VG_LITE_USE_ASSERT - #ifdef CONFIG_LV_VG_LITE_USE_ASSERT - #define LV_VG_LITE_USE_ASSERT CONFIG_LV_VG_LITE_USE_ASSERT +/*Use NXP's PXP GPU iMX RTxxx platforms*/ +#ifndef LV_USE_GPU_NXP_PXP + #ifdef CONFIG_LV_USE_GPU_NXP_PXP + #define LV_USE_GPU_NXP_PXP CONFIG_LV_USE_GPU_NXP_PXP + #else + #define LV_USE_GPU_NXP_PXP 0 + #endif +#endif +#if LV_USE_GPU_NXP_PXP + /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) + * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS + * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. + *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() + */ + #ifndef LV_USE_GPU_NXP_PXP_AUTO_INIT + #ifdef CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT + #define LV_USE_GPU_NXP_PXP_AUTO_INIT CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT #else - #define LV_VG_LITE_USE_ASSERT 0 + #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 #endif #endif +#endif - /* VG-Lite flush commit trigger threshold. GPU will try to batch these many draw tasks. */ - #ifndef LV_VG_LITE_FLUSH_MAX_COUNT - #ifdef CONFIG_LV_VG_LITE_FLUSH_MAX_COUNT - #define LV_VG_LITE_FLUSH_MAX_COUNT CONFIG_LV_VG_LITE_FLUSH_MAX_COUNT - #else - #define LV_VG_LITE_FLUSH_MAX_COUNT 8 - #endif +/*Use NXP's VG-Lite GPU iMX RTxxx platforms*/ +#ifndef LV_USE_GPU_NXP_VG_LITE + #ifdef CONFIG_LV_USE_GPU_NXP_VG_LITE + #define LV_USE_GPU_NXP_VG_LITE CONFIG_LV_USE_GPU_NXP_VG_LITE + #else + #define LV_USE_GPU_NXP_VG_LITE 0 #endif +#endif - /* Enable border to simulate shadow - * NOTE: which usually improves performance, - * but does not guarantee the same rendering quality as the software. */ - #ifndef LV_VG_LITE_USE_BOX_SHADOW - #ifdef CONFIG_LV_VG_LITE_USE_BOX_SHADOW - #define LV_VG_LITE_USE_BOX_SHADOW CONFIG_LV_VG_LITE_USE_BOX_SHADOW +/*Use SDL renderer API*/ +#ifndef LV_USE_GPU_SDL + #ifdef CONFIG_LV_USE_GPU_SDL + #define LV_USE_GPU_SDL CONFIG_LV_USE_GPU_SDL + #else + #define LV_USE_GPU_SDL 0 + #endif +#endif +#if LV_USE_GPU_SDL + #ifndef LV_GPU_SDL_INCLUDE_PATH + #ifdef CONFIG_LV_GPU_SDL_INCLUDE_PATH + #define LV_GPU_SDL_INCLUDE_PATH CONFIG_LV_GPU_SDL_INCLUDE_PATH #else - #define LV_VG_LITE_USE_BOX_SHADOW 0 + #define LV_GPU_SDL_INCLUDE_PATH #endif #endif - - /* VG-Lite gradient maximum cache number. - * NOTE: The memory usage of a single gradient image is 4K bytes. - */ - #ifndef LV_VG_LITE_GRAD_CACHE_CNT - #ifdef CONFIG_LV_VG_LITE_GRAD_CACHE_CNT - #define LV_VG_LITE_GRAD_CACHE_CNT CONFIG_LV_VG_LITE_GRAD_CACHE_CNT + /*Texture cache size, 8MB by default*/ + #ifndef LV_GPU_SDL_LRU_SIZE + #ifdef CONFIG_LV_GPU_SDL_LRU_SIZE + #define LV_GPU_SDL_LRU_SIZE CONFIG_LV_GPU_SDL_LRU_SIZE #else - #define LV_VG_LITE_GRAD_CACHE_CNT 32 + #define LV_GPU_SDL_LRU_SIZE (1024 * 1024 * 8) #endif #endif - - /* VG-Lite stroke maximum cache number. - */ - #ifndef LV_VG_LITE_STROKE_CACHE_CNT - #ifdef CONFIG_LV_VG_LITE_STROKE_CACHE_CNT - #define LV_VG_LITE_STROKE_CACHE_CNT CONFIG_LV_VG_LITE_STROKE_CACHE_CNT + /*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/ + #ifndef LV_GPU_SDL_CUSTOM_BLEND_MODE + #ifdef CONFIG_LV_GPU_SDL_CUSTOM_BLEND_MODE + #define LV_GPU_SDL_CUSTOM_BLEND_MODE CONFIG_LV_GPU_SDL_CUSTOM_BLEND_MODE #else - #define LV_VG_LITE_STROKE_CACHE_CNT 32 + #define LV_GPU_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6)) #endif #endif - #endif -/*======================= - * FEATURE CONFIGURATION - *=======================*/ - /*------------- * Logging *-----------*/ @@ -816,43 +588,9 @@ #endif #endif - /*Set callback to print the logs. - *E.g `my_print`. The prototype should be `void my_print(lv_log_level_t level, const char * buf)` - *Can be overwritten by `lv_log_register_print_cb`*/ - //#define LV_LOG_PRINT_CB - - /*1: Enable print timestamp; - *0: Disable print timestamp*/ - #ifndef LV_LOG_USE_TIMESTAMP - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_LOG_USE_TIMESTAMP - #define LV_LOG_USE_TIMESTAMP CONFIG_LV_LOG_USE_TIMESTAMP - #else - #define LV_LOG_USE_TIMESTAMP 0 - #endif - #else - #define LV_LOG_USE_TIMESTAMP 1 - #endif - #endif - - /*1: Print file and line number of the log; - *0: Do not print file and line number of the log*/ - #ifndef LV_LOG_USE_FILE_LINE - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_LOG_USE_FILE_LINE - #define LV_LOG_USE_FILE_LINE CONFIG_LV_LOG_USE_FILE_LINE - #else - #define LV_LOG_USE_FILE_LINE 0 - #endif - #else - #define LV_LOG_USE_FILE_LINE 1 - #endif - #endif - - /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ #ifndef LV_LOG_TRACE_MEM - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_LOG_TRACE_MEM #define LV_LOG_TRACE_MEM CONFIG_LV_LOG_TRACE_MEM #else @@ -863,7 +601,7 @@ #endif #endif #ifndef LV_LOG_TRACE_TIMER - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_LOG_TRACE_TIMER #define LV_LOG_TRACE_TIMER CONFIG_LV_LOG_TRACE_TIMER #else @@ -874,7 +612,7 @@ #endif #endif #ifndef LV_LOG_TRACE_INDEV - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_LOG_TRACE_INDEV #define LV_LOG_TRACE_INDEV CONFIG_LV_LOG_TRACE_INDEV #else @@ -885,7 +623,7 @@ #endif #endif #ifndef LV_LOG_TRACE_DISP_REFR - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_LOG_TRACE_DISP_REFR #define LV_LOG_TRACE_DISP_REFR CONFIG_LV_LOG_TRACE_DISP_REFR #else @@ -896,7 +634,7 @@ #endif #endif #ifndef LV_LOG_TRACE_EVENT - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_LOG_TRACE_EVENT #define LV_LOG_TRACE_EVENT CONFIG_LV_LOG_TRACE_EVENT #else @@ -907,7 +645,7 @@ #endif #endif #ifndef LV_LOG_TRACE_OBJ_CREATE - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_LOG_TRACE_OBJ_CREATE #define LV_LOG_TRACE_OBJ_CREATE CONFIG_LV_LOG_TRACE_OBJ_CREATE #else @@ -918,7 +656,7 @@ #endif #endif #ifndef LV_LOG_TRACE_LAYOUT - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_LOG_TRACE_LAYOUT #define LV_LOG_TRACE_LAYOUT CONFIG_LV_LOG_TRACE_LAYOUT #else @@ -929,7 +667,7 @@ #endif #endif #ifndef LV_LOG_TRACE_ANIM - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_LOG_TRACE_ANIM #define LV_LOG_TRACE_ANIM CONFIG_LV_LOG_TRACE_ANIM #else @@ -939,17 +677,6 @@ #define LV_LOG_TRACE_ANIM 1 #endif #endif - #ifndef LV_LOG_TRACE_CACHE - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_LOG_TRACE_CACHE - #define LV_LOG_TRACE_CACHE CONFIG_LV_LOG_TRACE_CACHE - #else - #define LV_LOG_TRACE_CACHE 0 - #endif - #else - #define LV_LOG_TRACE_CACHE 1 - #endif - #endif #endif /*LV_USE_LOG*/ @@ -960,7 +687,7 @@ /*Enable asserts if an operation is failed or an invalid data is found. *If LV_USE_LOG is enabled an error message will be printed on failure*/ #ifndef LV_USE_ASSERT_NULL - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_ASSERT_NULL #define LV_USE_ASSERT_NULL CONFIG_LV_USE_ASSERT_NULL #else @@ -971,7 +698,7 @@ #endif #endif #ifndef LV_USE_ASSERT_MALLOC - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_ASSERT_MALLOC #define LV_USE_ASSERT_MALLOC CONFIG_LV_USE_ASSERT_MALLOC #else @@ -1019,241 +746,126 @@ #endif #endif -/*------------- - * Debug - *-----------*/ - -/*1: Draw random colored rectangles over the redrawn areas*/ -#ifndef LV_USE_REFR_DEBUG - #ifdef CONFIG_LV_USE_REFR_DEBUG - #define LV_USE_REFR_DEBUG CONFIG_LV_USE_REFR_DEBUG - #else - #define LV_USE_REFR_DEBUG 0 - #endif -#endif - -/*1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/ -#ifndef LV_USE_LAYER_DEBUG - #ifdef CONFIG_LV_USE_LAYER_DEBUG - #define LV_USE_LAYER_DEBUG CONFIG_LV_USE_LAYER_DEBUG - #else - #define LV_USE_LAYER_DEBUG 0 - #endif -#endif - -/*1: Draw overlays with different colors for each draw_unit's tasks. - *Also add the index number of the draw unit on white background. - *For layers add the index number of the draw unit on black background.*/ -#ifndef LV_USE_PARALLEL_DRAW_DEBUG - #ifdef CONFIG_LV_USE_PARALLEL_DRAW_DEBUG - #define LV_USE_PARALLEL_DRAW_DEBUG CONFIG_LV_USE_PARALLEL_DRAW_DEBUG - #else - #define LV_USE_PARALLEL_DRAW_DEBUG 0 - #endif -#endif - /*------------- * Others *-----------*/ -#ifndef LV_ENABLE_GLOBAL_CUSTOM - #ifdef CONFIG_LV_ENABLE_GLOBAL_CUSTOM - #define LV_ENABLE_GLOBAL_CUSTOM CONFIG_LV_ENABLE_GLOBAL_CUSTOM +/*1: Show CPU usage and FPS count*/ +#ifndef LV_USE_PERF_MONITOR + #ifdef CONFIG_LV_USE_PERF_MONITOR + #define LV_USE_PERF_MONITOR CONFIG_LV_USE_PERF_MONITOR #else - #define LV_ENABLE_GLOBAL_CUSTOM 0 + #define LV_USE_PERF_MONITOR 0 #endif #endif -#if LV_ENABLE_GLOBAL_CUSTOM - /*Header to include for the custom 'lv_global' function"*/ - #ifndef LV_GLOBAL_CUSTOM_INCLUDE - #ifdef CONFIG_LV_GLOBAL_CUSTOM_INCLUDE - #define LV_GLOBAL_CUSTOM_INCLUDE CONFIG_LV_GLOBAL_CUSTOM_INCLUDE +#if LV_USE_PERF_MONITOR + #ifndef LV_USE_PERF_MONITOR_POS + #ifdef CONFIG_LV_USE_PERF_MONITOR_POS + #define LV_USE_PERF_MONITOR_POS CONFIG_LV_USE_PERF_MONITOR_POS #else - #define LV_GLOBAL_CUSTOM_INCLUDE + #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT #endif #endif #endif -/*Default cache size in bytes. - *Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory. - *If size is not set to 0, the decoder will fail to decode when the cache is full. - *If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/ -#ifndef LV_CACHE_DEF_SIZE - #ifdef CONFIG_LV_CACHE_DEF_SIZE - #define LV_CACHE_DEF_SIZE CONFIG_LV_CACHE_DEF_SIZE +/*1: Show the used memory and the memory fragmentation + * Requires LV_MEM_CUSTOM = 0*/ +#ifndef LV_USE_MEM_MONITOR + #ifdef CONFIG_LV_USE_MEM_MONITOR + #define LV_USE_MEM_MONITOR CONFIG_LV_USE_MEM_MONITOR #else - #define LV_CACHE_DEF_SIZE 0 + #define LV_USE_MEM_MONITOR 0 #endif #endif - -/*Default number of image header cache entries. The cache is used to store the headers of images - *The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/ -#ifndef LV_IMAGE_HEADER_CACHE_DEF_CNT - #ifdef CONFIG_LV_IMAGE_HEADER_CACHE_DEF_CNT - #define LV_IMAGE_HEADER_CACHE_DEF_CNT CONFIG_LV_IMAGE_HEADER_CACHE_DEF_CNT - #else - #define LV_IMAGE_HEADER_CACHE_DEF_CNT 0 +#if LV_USE_MEM_MONITOR + #ifndef LV_USE_MEM_MONITOR_POS + #ifdef CONFIG_LV_USE_MEM_MONITOR_POS + #define LV_USE_MEM_MONITOR_POS CONFIG_LV_USE_MEM_MONITOR_POS + #else + #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT + #endif #endif #endif -/*Number of stops allowed per gradient. Increase this to allow more stops. - *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ -#ifndef LV_GRADIENT_MAX_STOPS - #ifdef CONFIG_LV_GRADIENT_MAX_STOPS - #define LV_GRADIENT_MAX_STOPS CONFIG_LV_GRADIENT_MAX_STOPS +/*1: Draw random colored rectangles over the redrawn areas*/ +#ifndef LV_USE_REFR_DEBUG + #ifdef CONFIG_LV_USE_REFR_DEBUG + #define LV_USE_REFR_DEBUG CONFIG_LV_USE_REFR_DEBUG #else - #define LV_GRADIENT_MAX_STOPS 2 + #define LV_USE_REFR_DEBUG 0 #endif #endif -/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. - * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ -#ifndef LV_COLOR_MIX_ROUND_OFS - #ifdef CONFIG_LV_COLOR_MIX_ROUND_OFS - #define LV_COLOR_MIX_ROUND_OFS CONFIG_LV_COLOR_MIX_ROUND_OFS +/*Change the built in (v)snprintf functions*/ +#ifndef LV_SPRINTF_CUSTOM + #ifdef CONFIG_LV_SPRINTF_CUSTOM + #define LV_SPRINTF_CUSTOM CONFIG_LV_SPRINTF_CUSTOM #else - #define LV_COLOR_MIX_ROUND_OFS 0 + #define LV_SPRINTF_CUSTOM 0 #endif #endif - -/* Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties */ -#ifndef LV_OBJ_STYLE_CACHE - #ifdef CONFIG_LV_OBJ_STYLE_CACHE - #define LV_OBJ_STYLE_CACHE CONFIG_LV_OBJ_STYLE_CACHE - #else - #define LV_OBJ_STYLE_CACHE 0 +#if LV_SPRINTF_CUSTOM + #ifndef LV_SPRINTF_INCLUDE + #ifdef CONFIG_LV_SPRINTF_INCLUDE + #define LV_SPRINTF_INCLUDE CONFIG_LV_SPRINTF_INCLUDE + #else + #define LV_SPRINTF_INCLUDE + #endif #endif -#endif - -/* Add `id` field to `lv_obj_t` */ -#ifndef LV_USE_OBJ_ID - #ifdef CONFIG_LV_USE_OBJ_ID - #define LV_USE_OBJ_ID CONFIG_LV_USE_OBJ_ID - #else - #define LV_USE_OBJ_ID 0 + #ifndef lv_snprintf + #ifdef CONFIG_LV_SNPRINTF + #define lv_snprintf CONFIG_LV_SNPRINTF + #else + #define lv_snprintf snprintf + #endif #endif -#endif - -/* Automatically assign an ID when obj is created */ -#ifndef LV_OBJ_ID_AUTO_ASSIGN - #ifdef CONFIG_LV_OBJ_ID_AUTO_ASSIGN - #define LV_OBJ_ID_AUTO_ASSIGN CONFIG_LV_OBJ_ID_AUTO_ASSIGN - #else - #define LV_OBJ_ID_AUTO_ASSIGN LV_USE_OBJ_ID + #ifndef lv_vsnprintf + #ifdef CONFIG_LV_VSNPRINTF + #define lv_vsnprintf CONFIG_LV_VSNPRINTF + #else + #define lv_vsnprintf vsnprintf + #endif #endif -#endif +#else /*LV_SPRINTF_CUSTOM*/ + #ifndef LV_SPRINTF_USE_FLOAT + #ifdef CONFIG_LV_SPRINTF_USE_FLOAT + #define LV_SPRINTF_USE_FLOAT CONFIG_LV_SPRINTF_USE_FLOAT + #else + #define LV_SPRINTF_USE_FLOAT 0 + #endif + #endif +#endif /*LV_SPRINTF_CUSTOM*/ -/*Use the builtin obj ID handler functions: -* - lv_obj_assign_id: Called when a widget is created. Use a separate counter for each widget class as an ID. -* - lv_obj_id_compare: Compare the ID to decide if it matches with a requested value. -* - lv_obj_stringify_id: Return e.g. "button3" -* - lv_obj_free_id: Does nothing, as there is no memory allocation for the ID. -* When disabled these functions needs to be implemented by the user.*/ -#ifndef LV_USE_OBJ_ID_BUILTIN - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_OBJ_ID_BUILTIN - #define LV_USE_OBJ_ID_BUILTIN CONFIG_LV_USE_OBJ_ID_BUILTIN +#ifndef LV_USE_USER_DATA + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_USER_DATA + #define LV_USE_USER_DATA CONFIG_LV_USE_USER_DATA #else - #define LV_USE_OBJ_ID_BUILTIN 0 + #define LV_USE_USER_DATA 0 #endif #else - #define LV_USE_OBJ_ID_BUILTIN 1 + #define LV_USE_USER_DATA 1 #endif #endif -/*Use obj property set/get API*/ -#ifndef LV_USE_OBJ_PROPERTY - #ifdef CONFIG_LV_USE_OBJ_PROPERTY - #define LV_USE_OBJ_PROPERTY CONFIG_LV_USE_OBJ_PROPERTY +/*Garbage Collector settings + *Used if lvgl is bound to higher level language and the memory is managed by that language*/ +#ifndef LV_ENABLE_GC + #ifdef CONFIG_LV_ENABLE_GC + #define LV_ENABLE_GC CONFIG_LV_ENABLE_GC #else - #define LV_USE_OBJ_PROPERTY 0 + #define LV_ENABLE_GC 0 #endif #endif - -/*Enable property name support*/ -#ifndef LV_USE_OBJ_PROPERTY_NAME - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_OBJ_PROPERTY_NAME - #define LV_USE_OBJ_PROPERTY_NAME CONFIG_LV_USE_OBJ_PROPERTY_NAME +#if LV_ENABLE_GC != 0 + #ifndef LV_GC_INCLUDE + #ifdef CONFIG_LV_GC_INCLUDE + #define LV_GC_INCLUDE CONFIG_LV_GC_INCLUDE #else - #define LV_USE_OBJ_PROPERTY_NAME 0 + #define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ #endif - #else - #define LV_USE_OBJ_PROPERTY_NAME 1 #endif -#endif - -/* VG-Lite Simulator */ -/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */ -#ifndef LV_USE_VG_LITE_THORVG - #ifdef CONFIG_LV_USE_VG_LITE_THORVG - #define LV_USE_VG_LITE_THORVG CONFIG_LV_USE_VG_LITE_THORVG - #else - #define LV_USE_VG_LITE_THORVG 0 - #endif -#endif - -#if LV_USE_VG_LITE_THORVG - - /*Enable LVGL's blend mode support*/ - #ifndef LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT - #ifdef CONFIG_LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT - #define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT CONFIG_LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT - #else - #define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0 - #endif - #endif - - /*Enable YUV color format support*/ - #ifndef LV_VG_LITE_THORVG_YUV_SUPPORT - #ifdef CONFIG_LV_VG_LITE_THORVG_YUV_SUPPORT - #define LV_VG_LITE_THORVG_YUV_SUPPORT CONFIG_LV_VG_LITE_THORVG_YUV_SUPPORT - #else - #define LV_VG_LITE_THORVG_YUV_SUPPORT 0 - #endif - #endif - - /*Enable Linear gradient extension support*/ - #ifndef LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT - #ifdef CONFIG_LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT - #define LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT CONFIG_LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT - #else - #define LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT 0 - #endif - #endif - - /*Enable 16 pixels alignment*/ - #ifndef LV_VG_LITE_THORVG_16PIXELS_ALIGN - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_VG_LITE_THORVG_16PIXELS_ALIGN - #define LV_VG_LITE_THORVG_16PIXELS_ALIGN CONFIG_LV_VG_LITE_THORVG_16PIXELS_ALIGN - #else - #define LV_VG_LITE_THORVG_16PIXELS_ALIGN 0 - #endif - #else - #define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1 - #endif - #endif - - /*Buffer address alignment*/ - #ifndef LV_VG_LITE_THORVG_BUF_ADDR_ALIGN - #ifdef CONFIG_LV_VG_LITE_THORVG_BUF_ADDR_ALIGN - #define LV_VG_LITE_THORVG_BUF_ADDR_ALIGN CONFIG_LV_VG_LITE_THORVG_BUF_ADDR_ALIGN - #else - #define LV_VG_LITE_THORVG_BUF_ADDR_ALIGN 64 - #endif - #endif - - /*Enable multi-thread render*/ - #ifndef LV_VG_LITE_THORVG_THREAD_RENDER - #ifdef CONFIG_LV_VG_LITE_THORVG_THREAD_RENDER - #define LV_VG_LITE_THORVG_THREAD_RENDER CONFIG_LV_VG_LITE_THORVG_THREAD_RENDER - #else - #define LV_VG_LITE_THORVG_THREAD_RENDER 0 - #endif - #endif - -#endif +#endif /*LV_ENABLE_GC*/ /*===================== * COMPILER SETTINGS @@ -1286,7 +898,7 @@ #endif #endif -/*Define a custom attribute to `lv_display_flush_ready` function*/ +/*Define a custom attribute to `lv_disp_flush_ready` function*/ #ifndef LV_ATTRIBUTE_FLUSH_READY #ifdef CONFIG_LV_ATTRIBUTE_FLUSH_READY #define LV_ATTRIBUTE_FLUSH_READY CONFIG_LV_ATTRIBUTE_FLUSH_READY @@ -1297,7 +909,7 @@ /*Required alignment size for buffers*/ #ifndef LV_ATTRIBUTE_MEM_ALIGN_SIZE - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE #define LV_ATTRIBUTE_MEM_ALIGN_SIZE CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE #else @@ -1345,8 +957,17 @@ #endif #endif +/*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/ +#ifndef LV_ATTRIBUTE_DMA + #ifdef CONFIG_LV_ATTRIBUTE_DMA + #define LV_ATTRIBUTE_DMA CONFIG_LV_ATTRIBUTE_DMA + #else + #define LV_ATTRIBUTE_DMA + #endif +#endif + /*Export integer constant to binding. This macro is used with constants in the form of LV_ that - *should also appear on LVGL binding API such as MicroPython.*/ + *should also appear on LVGL binding API such as Micropython.*/ #ifndef LV_EXPORT_CONST_INT #ifdef CONFIG_LV_EXPORT_CONST_INT #define LV_EXPORT_CONST_INT CONFIG_LV_EXPORT_CONST_INT @@ -1355,40 +976,12 @@ #endif #endif -/*Prefix all global extern data with this*/ -#ifndef LV_ATTRIBUTE_EXTERN_DATA - #ifdef CONFIG_LV_ATTRIBUTE_EXTERN_DATA - #define LV_ATTRIBUTE_EXTERN_DATA CONFIG_LV_ATTRIBUTE_EXTERN_DATA - #else - #define LV_ATTRIBUTE_EXTERN_DATA - #endif -#endif - -/* Use `float` as `lv_value_precise_t` */ -#ifndef LV_USE_FLOAT - #ifdef CONFIG_LV_USE_FLOAT - #define LV_USE_FLOAT CONFIG_LV_USE_FLOAT - #else - #define LV_USE_FLOAT 0 - #endif -#endif - -/*Enable matrix support - *Requires `LV_USE_FLOAT = 1`*/ -#ifndef LV_USE_MATRIX - #ifdef CONFIG_LV_USE_MATRIX - #define LV_USE_MATRIX CONFIG_LV_USE_MATRIX - #else - #define LV_USE_MATRIX 0 - #endif -#endif - -/*Include `lvgl_private.h` in `lvgl.h` to access internal data and functions by default*/ -#ifndef LV_USE_PRIVATE_API - #ifdef CONFIG_LV_USE_PRIVATE_API - #define LV_USE_PRIVATE_API CONFIG_LV_USE_PRIVATE_API +/*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/ +#ifndef LV_USE_LARGE_COORD + #ifdef CONFIG_LV_USE_LARGE_COORD + #define LV_USE_LARGE_COORD CONFIG_LV_USE_LARGE_COORD #else - #define LV_USE_PRIVATE_API 0 + #define LV_USE_LARGE_COORD 0 #endif #endif @@ -1420,7 +1013,7 @@ #endif #endif #ifndef LV_FONT_MONTSERRAT_14 - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_FONT_MONTSERRAT_14 #define LV_FONT_MONTSERRAT_14 CONFIG_LV_FONT_MONTSERRAT_14 #else @@ -1551,6 +1144,13 @@ #endif /*Demonstrate special features*/ +#ifndef LV_FONT_MONTSERRAT_12_SUBPX + #ifdef CONFIG_LV_FONT_MONTSERRAT_12_SUBPX + #define LV_FONT_MONTSERRAT_12_SUBPX CONFIG_LV_FONT_MONTSERRAT_12_SUBPX + #else + #define LV_FONT_MONTSERRAT_12_SUBPX 0 + #endif +#endif #ifndef LV_FONT_MONTSERRAT_28_COMPRESSED #ifdef CONFIG_LV_FONT_MONTSERRAT_28_COMPRESSED #define LV_FONT_MONTSERRAT_28_COMPRESSED CONFIG_LV_FONT_MONTSERRAT_28_COMPRESSED @@ -1565,13 +1165,6 @@ #define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/ #endif #endif -#ifndef LV_FONT_SIMSUN_14_CJK - #ifdef CONFIG_LV_FONT_SIMSUN_14_CJK - #define LV_FONT_SIMSUN_14_CJK CONFIG_LV_FONT_SIMSUN_14_CJK - #else - #define LV_FONT_SIMSUN_14_CJK 0 /*1000 most common CJK radicals*/ - #endif -#endif #ifndef LV_FONT_SIMSUN_16_CJK #ifdef CONFIG_LV_FONT_SIMSUN_16_CJK #define LV_FONT_SIMSUN_16_CJK CONFIG_LV_FONT_SIMSUN_16_CJK @@ -1636,9 +1229,28 @@ #endif #endif +/*Enable subpixel rendering*/ +#ifndef LV_USE_FONT_SUBPX + #ifdef CONFIG_LV_USE_FONT_SUBPX + #define LV_USE_FONT_SUBPX CONFIG_LV_USE_FONT_SUBPX + #else + #define LV_USE_FONT_SUBPX 0 + #endif +#endif +#if LV_USE_FONT_SUBPX + /*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ + #ifndef LV_FONT_SUBPX_BGR + #ifdef CONFIG_LV_FONT_SUBPX_BGR + #define LV_FONT_SUBPX_BGR CONFIG_LV_FONT_SUBPX_BGR + #else + #define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ + #endif + #endif +#endif + /*Enable drawing placeholders when glyph dsc is not found*/ #ifndef LV_USE_FONT_PLACEHOLDER - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_FONT_PLACEHOLDER #define LV_USE_FONT_PLACEHOLDER CONFIG_LV_USE_FONT_PLACEHOLDER #else @@ -1672,7 +1284,7 @@ #ifdef CONFIG_LV_TXT_BREAK_CHARS #define LV_TXT_BREAK_CHARS CONFIG_LV_TXT_BREAK_CHARS #else - #define LV_TXT_BREAK_CHARS " ,.;:-_)]}" + #define LV_TXT_BREAK_CHARS " ,.;:-_" #endif #endif @@ -1706,6 +1318,15 @@ #endif #endif +/*The control character to use for signalling text recoloring.*/ +#ifndef LV_TXT_COLOR_CMD + #ifdef CONFIG_LV_TXT_COLOR_CMD + #define LV_TXT_COLOR_CMD CONFIG_LV_TXT_COLOR_CMD + #else + #define LV_TXT_COLOR_CMD "#" + #endif +#endif + /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. *The direction will be processed according to the Unicode Bidirectional Algorithm: *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ @@ -1731,7 +1352,7 @@ #endif /*Enable Arabic/Persian processing - *In these languages characters should be replaced with another form based on their position in the text*/ + *In these languages characters should be replaced with an other form based on their position in the text*/ #ifndef LV_USE_ARABIC_PERSIAN_CHARS #ifdef CONFIG_LV_USE_ARABIC_PERSIAN_CHARS #define LV_USE_ARABIC_PERSIAN_CHARS CONFIG_LV_USE_ARABIC_PERSIAN_CHARS @@ -1741,37 +1362,13 @@ #endif /*================== - * WIDGETS + * WIDGET USAGE *================*/ /*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ -#ifndef LV_WIDGETS_HAS_DEFAULT_VALUE - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_WIDGETS_HAS_DEFAULT_VALUE - #define LV_WIDGETS_HAS_DEFAULT_VALUE CONFIG_LV_WIDGETS_HAS_DEFAULT_VALUE - #else - #define LV_WIDGETS_HAS_DEFAULT_VALUE 0 - #endif - #else - #define LV_WIDGETS_HAS_DEFAULT_VALUE 1 - #endif -#endif - -#ifndef LV_USE_ANIMIMG - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_ANIMIMG - #define LV_USE_ANIMIMG CONFIG_LV_USE_ANIMIMG - #else - #define LV_USE_ANIMIMG 0 - #endif - #else - #define LV_USE_ANIMIMG 1 - #endif -#endif - #ifndef LV_USE_ARC - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_ARC #define LV_USE_ARC CONFIG_LV_USE_ARC #else @@ -1783,7 +1380,7 @@ #endif #ifndef LV_USE_BAR - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_BAR #define LV_USE_BAR CONFIG_LV_USE_BAR #else @@ -1794,107 +1391,32 @@ #endif #endif -#ifndef LV_USE_BUTTON - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_BUTTON - #define LV_USE_BUTTON CONFIG_LV_USE_BUTTON - #else - #define LV_USE_BUTTON 0 - #endif - #else - #define LV_USE_BUTTON 1 - #endif -#endif - -#ifndef LV_USE_BUTTONMATRIX - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_BUTTONMATRIX - #define LV_USE_BUTTONMATRIX CONFIG_LV_USE_BUTTONMATRIX +#ifndef LV_USE_BTN + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_BTN + #define LV_USE_BTN CONFIG_LV_USE_BTN #else - #define LV_USE_BUTTONMATRIX 0 + #define LV_USE_BTN 0 #endif #else - #define LV_USE_BUTTONMATRIX 1 + #define LV_USE_BTN 1 #endif #endif -#ifndef LV_USE_CALENDAR - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_CALENDAR - #define LV_USE_CALENDAR CONFIG_LV_USE_CALENDAR +#ifndef LV_USE_BTNMATRIX + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_BTNMATRIX + #define LV_USE_BTNMATRIX CONFIG_LV_USE_BTNMATRIX #else - #define LV_USE_CALENDAR 0 + #define LV_USE_BTNMATRIX 0 #endif #else - #define LV_USE_CALENDAR 1 + #define LV_USE_BTNMATRIX 1 #endif #endif -#if LV_USE_CALENDAR - #ifndef LV_CALENDAR_WEEK_STARTS_MONDAY - #ifdef CONFIG_LV_CALENDAR_WEEK_STARTS_MONDAY - #define LV_CALENDAR_WEEK_STARTS_MONDAY CONFIG_LV_CALENDAR_WEEK_STARTS_MONDAY - #else - #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 - #endif - #endif - #if LV_CALENDAR_WEEK_STARTS_MONDAY - #ifndef LV_CALENDAR_DEFAULT_DAY_NAMES - #ifdef CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES - #define LV_CALENDAR_DEFAULT_DAY_NAMES CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES - #else - #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} - #endif - #endif - #else - #ifndef LV_CALENDAR_DEFAULT_DAY_NAMES - #ifdef CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES - #define LV_CALENDAR_DEFAULT_DAY_NAMES CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES - #else - #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} - #endif - #endif - #endif - - #ifndef LV_CALENDAR_DEFAULT_MONTH_NAMES - #ifdef CONFIG_LV_CALENDAR_DEFAULT_MONTH_NAMES - #define LV_CALENDAR_DEFAULT_MONTH_NAMES CONFIG_LV_CALENDAR_DEFAULT_MONTH_NAMES - #else - #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} - #endif - #endif - #ifndef LV_USE_CALENDAR_HEADER_ARROW - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_CALENDAR_HEADER_ARROW - #define LV_USE_CALENDAR_HEADER_ARROW CONFIG_LV_USE_CALENDAR_HEADER_ARROW - #else - #define LV_USE_CALENDAR_HEADER_ARROW 0 - #endif - #else - #define LV_USE_CALENDAR_HEADER_ARROW 1 - #endif - #endif - #ifndef LV_USE_CALENDAR_HEADER_DROPDOWN - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_CALENDAR_HEADER_DROPDOWN - #define LV_USE_CALENDAR_HEADER_DROPDOWN CONFIG_LV_USE_CALENDAR_HEADER_DROPDOWN - #else - #define LV_USE_CALENDAR_HEADER_DROPDOWN 0 - #endif - #else - #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 - #endif - #endif - #ifndef LV_USE_CALENDAR_CHINESE - #ifdef CONFIG_LV_USE_CALENDAR_CHINESE - #define LV_USE_CALENDAR_CHINESE CONFIG_LV_USE_CALENDAR_CHINESE - #else - #define LV_USE_CALENDAR_CHINESE 0 - #endif - #endif -#endif /*LV_USE_CALENDAR*/ #ifndef LV_USE_CANVAS - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_CANVAS #define LV_USE_CANVAS CONFIG_LV_USE_CANVAS #else @@ -1905,20 +1427,8 @@ #endif #endif -#ifndef LV_USE_CHART - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_CHART - #define LV_USE_CHART CONFIG_LV_USE_CHART - #else - #define LV_USE_CHART 0 - #endif - #else - #define LV_USE_CHART 1 - #endif -#endif - #ifndef LV_USE_CHECKBOX - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_CHECKBOX #define LV_USE_CHECKBOX CONFIG_LV_USE_CHECKBOX #else @@ -1930,7 +1440,7 @@ #endif #ifndef LV_USE_DROPDOWN - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_DROPDOWN #define LV_USE_DROPDOWN CONFIG_LV_USE_DROPDOWN #else @@ -1941,44 +1451,20 @@ #endif #endif -#ifndef LV_USE_IMAGE - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_IMAGE - #define LV_USE_IMAGE CONFIG_LV_USE_IMAGE - #else - #define LV_USE_IMAGE 0 - #endif - #else - #define LV_USE_IMAGE 1 /*Requires: lv_label*/ - #endif -#endif - -#ifndef LV_USE_IMAGEBUTTON - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_IMAGEBUTTON - #define LV_USE_IMAGEBUTTON CONFIG_LV_USE_IMAGEBUTTON - #else - #define LV_USE_IMAGEBUTTON 0 - #endif - #else - #define LV_USE_IMAGEBUTTON 1 - #endif -#endif - -#ifndef LV_USE_KEYBOARD - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_KEYBOARD - #define LV_USE_KEYBOARD CONFIG_LV_USE_KEYBOARD +#ifndef LV_USE_IMG + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_IMG + #define LV_USE_IMG CONFIG_LV_USE_IMG #else - #define LV_USE_KEYBOARD 0 + #define LV_USE_IMG 0 #endif #else - #define LV_USE_KEYBOARD 1 + #define LV_USE_IMG 1 /*Requires: lv_label*/ #endif #endif #ifndef LV_USE_LABEL - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_LABEL #define LV_USE_LABEL CONFIG_LV_USE_LABEL #else @@ -1990,7 +1476,7 @@ #endif #if LV_USE_LABEL #ifndef LV_LABEL_TEXT_SELECTION - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_LABEL_TEXT_SELECTION #define LV_LABEL_TEXT_SELECTION CONFIG_LV_LABEL_TEXT_SELECTION #else @@ -2001,7 +1487,7 @@ #endif #endif #ifndef LV_LABEL_LONG_TXT_HINT - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_LABEL_LONG_TXT_HINT #define LV_LABEL_LONG_TXT_HINT CONFIG_LV_LABEL_LONG_TXT_HINT #else @@ -2011,29 +1497,10 @@ #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ #endif #endif - #ifndef LV_LABEL_WAIT_CHAR_COUNT - #ifdef CONFIG_LV_LABEL_WAIT_CHAR_COUNT - #define LV_LABEL_WAIT_CHAR_COUNT CONFIG_LV_LABEL_WAIT_CHAR_COUNT - #else - #define LV_LABEL_WAIT_CHAR_COUNT 3 /*The count of wait chart*/ - #endif - #endif -#endif - -#ifndef LV_USE_LED - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_LED - #define LV_USE_LED CONFIG_LV_USE_LED - #else - #define LV_USE_LED 0 - #endif - #else - #define LV_USE_LED 1 - #endif #endif #ifndef LV_USE_LINE - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_LINE #define LV_USE_LINE CONFIG_LV_USE_LINE #else @@ -2044,179 +1511,327 @@ #endif #endif -#ifndef LV_USE_LIST - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_LIST - #define LV_USE_LIST CONFIG_LV_USE_LIST +#ifndef LV_USE_ROLLER + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_ROLLER + #define LV_USE_ROLLER CONFIG_LV_USE_ROLLER #else - #define LV_USE_LIST 0 + #define LV_USE_ROLLER 0 #endif #else - #define LV_USE_LIST 1 + #define LV_USE_ROLLER 1 /*Requires: lv_label*/ #endif #endif - -#ifndef LV_USE_LOTTIE - #ifdef CONFIG_LV_USE_LOTTIE - #define LV_USE_LOTTIE CONFIG_LV_USE_LOTTIE - #else - #define LV_USE_LOTTIE 0 /*Requires: lv_canvas, thorvg */ +#if LV_USE_ROLLER + #ifndef LV_ROLLER_INF_PAGES + #ifdef CONFIG_LV_ROLLER_INF_PAGES + #define LV_ROLLER_INF_PAGES CONFIG_LV_ROLLER_INF_PAGES + #else + #define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ + #endif #endif #endif -#ifndef LV_USE_MENU - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_MENU - #define LV_USE_MENU CONFIG_LV_USE_MENU +#ifndef LV_USE_SLIDER + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_SLIDER + #define LV_USE_SLIDER CONFIG_LV_USE_SLIDER #else - #define LV_USE_MENU 0 + #define LV_USE_SLIDER 0 #endif #else - #define LV_USE_MENU 1 + #define LV_USE_SLIDER 1 /*Requires: lv_bar*/ #endif #endif -#ifndef LV_USE_MSGBOX - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_MSGBOX - #define LV_USE_MSGBOX CONFIG_LV_USE_MSGBOX +#ifndef LV_USE_SWITCH + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_SWITCH + #define LV_USE_SWITCH CONFIG_LV_USE_SWITCH #else - #define LV_USE_MSGBOX 0 + #define LV_USE_SWITCH 0 #endif #else - #define LV_USE_MSGBOX 1 + #define LV_USE_SWITCH 1 #endif #endif -#ifndef LV_USE_ROLLER - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_ROLLER - #define LV_USE_ROLLER CONFIG_LV_USE_ROLLER +#ifndef LV_USE_TEXTAREA + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_TEXTAREA + #define LV_USE_TEXTAREA CONFIG_LV_USE_TEXTAREA #else - #define LV_USE_ROLLER 0 + #define LV_USE_TEXTAREA 0 #endif #else - #define LV_USE_ROLLER 1 /*Requires: lv_label*/ + #define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ #endif #endif - -#ifndef LV_USE_SCALE - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_SCALE - #define LV_USE_SCALE CONFIG_LV_USE_SCALE +#if LV_USE_TEXTAREA != 0 + #ifndef LV_TEXTAREA_DEF_PWD_SHOW_TIME + #ifdef CONFIG_LV_TEXTAREA_DEF_PWD_SHOW_TIME + #define LV_TEXTAREA_DEF_PWD_SHOW_TIME CONFIG_LV_TEXTAREA_DEF_PWD_SHOW_TIME #else - #define LV_USE_SCALE 0 + #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ #endif - #else - #define LV_USE_SCALE 1 #endif #endif -#ifndef LV_USE_SLIDER - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_SLIDER - #define LV_USE_SLIDER CONFIG_LV_USE_SLIDER +#ifndef LV_USE_TABLE + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_TABLE + #define LV_USE_TABLE CONFIG_LV_USE_TABLE #else - #define LV_USE_SLIDER 0 + #define LV_USE_TABLE 0 #endif #else - #define LV_USE_SLIDER 1 /*Requires: lv_bar*/ + #define LV_USE_TABLE 1 #endif #endif -#ifndef LV_USE_SPAN - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_SPAN - #define LV_USE_SPAN CONFIG_LV_USE_SPAN +/*================== + * EXTRA COMPONENTS + *==================*/ + +/*----------- + * Widgets + *----------*/ +#ifndef LV_USE_ANIMIMG + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_ANIMIMG + #define LV_USE_ANIMIMG CONFIG_LV_USE_ANIMIMG #else - #define LV_USE_SPAN 0 + #define LV_USE_ANIMIMG 0 #endif #else - #define LV_USE_SPAN 1 + #define LV_USE_ANIMIMG 1 #endif #endif -#if LV_USE_SPAN - /*A line text can contain maximum num of span descriptor */ - #ifndef LV_SPAN_SNIPPET_STACK_SIZE - #ifdef CONFIG_LV_SPAN_SNIPPET_STACK_SIZE - #define LV_SPAN_SNIPPET_STACK_SIZE CONFIG_LV_SPAN_SNIPPET_STACK_SIZE + +#ifndef LV_USE_CALENDAR + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_CALENDAR + #define LV_USE_CALENDAR CONFIG_LV_USE_CALENDAR #else - #define LV_SPAN_SNIPPET_STACK_SIZE 64 + #define LV_USE_CALENDAR 0 #endif + #else + #define LV_USE_CALENDAR 1 #endif #endif +#if LV_USE_CALENDAR + #ifndef LV_CALENDAR_WEEK_STARTS_MONDAY + #ifdef CONFIG_LV_CALENDAR_WEEK_STARTS_MONDAY + #define LV_CALENDAR_WEEK_STARTS_MONDAY CONFIG_LV_CALENDAR_WEEK_STARTS_MONDAY + #else + #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 + #endif + #endif + #if LV_CALENDAR_WEEK_STARTS_MONDAY + #ifndef LV_CALENDAR_DEFAULT_DAY_NAMES + #ifdef CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES + #define LV_CALENDAR_DEFAULT_DAY_NAMES CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES + #else + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} + #endif + #endif + #else + #ifndef LV_CALENDAR_DEFAULT_DAY_NAMES + #ifdef CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES + #define LV_CALENDAR_DEFAULT_DAY_NAMES CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES + #else + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} + #endif + #endif + #endif -#ifndef LV_USE_SPINBOX - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_SPINBOX - #define LV_USE_SPINBOX CONFIG_LV_USE_SPINBOX + #ifndef LV_CALENDAR_DEFAULT_MONTH_NAMES + #ifdef CONFIG_LV_CALENDAR_DEFAULT_MONTH_NAMES + #define LV_CALENDAR_DEFAULT_MONTH_NAMES CONFIG_LV_CALENDAR_DEFAULT_MONTH_NAMES #else - #define LV_USE_SPINBOX 0 + #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} + #endif + #endif + #ifndef LV_USE_CALENDAR_HEADER_ARROW + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_CALENDAR_HEADER_ARROW + #define LV_USE_CALENDAR_HEADER_ARROW CONFIG_LV_USE_CALENDAR_HEADER_ARROW + #else + #define LV_USE_CALENDAR_HEADER_ARROW 0 + #endif + #else + #define LV_USE_CALENDAR_HEADER_ARROW 1 + #endif + #endif + #ifndef LV_USE_CALENDAR_HEADER_DROPDOWN + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_CALENDAR_HEADER_DROPDOWN + #define LV_USE_CALENDAR_HEADER_DROPDOWN CONFIG_LV_USE_CALENDAR_HEADER_DROPDOWN + #else + #define LV_USE_CALENDAR_HEADER_DROPDOWN 0 + #endif + #else + #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 + #endif + #endif +#endif /*LV_USE_CALENDAR*/ + +#ifndef LV_USE_CHART + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_CHART + #define LV_USE_CHART CONFIG_LV_USE_CHART + #else + #define LV_USE_CHART 0 #endif #else - #define LV_USE_SPINBOX 1 + #define LV_USE_CHART 1 #endif #endif -#ifndef LV_USE_SPINNER - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_SPINNER - #define LV_USE_SPINNER CONFIG_LV_USE_SPINNER +#ifndef LV_USE_COLORWHEEL + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_COLORWHEEL + #define LV_USE_COLORWHEEL CONFIG_LV_USE_COLORWHEEL #else - #define LV_USE_SPINNER 0 + #define LV_USE_COLORWHEEL 0 #endif #else - #define LV_USE_SPINNER 1 + #define LV_USE_COLORWHEEL 1 #endif #endif -#ifndef LV_USE_SWITCH - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_SWITCH - #define LV_USE_SWITCH CONFIG_LV_USE_SWITCH +#ifndef LV_USE_IMGBTN + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_IMGBTN + #define LV_USE_IMGBTN CONFIG_LV_USE_IMGBTN #else - #define LV_USE_SWITCH 0 + #define LV_USE_IMGBTN 0 #endif #else - #define LV_USE_SWITCH 1 + #define LV_USE_IMGBTN 1 #endif #endif -#ifndef LV_USE_TEXTAREA - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_TEXTAREA - #define LV_USE_TEXTAREA CONFIG_LV_USE_TEXTAREA +#ifndef LV_USE_KEYBOARD + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_KEYBOARD + #define LV_USE_KEYBOARD CONFIG_LV_USE_KEYBOARD #else - #define LV_USE_TEXTAREA 0 + #define LV_USE_KEYBOARD 0 #endif #else - #define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ + #define LV_USE_KEYBOARD 1 #endif #endif -#if LV_USE_TEXTAREA != 0 - #ifndef LV_TEXTAREA_DEF_PWD_SHOW_TIME - #ifdef CONFIG_LV_TEXTAREA_DEF_PWD_SHOW_TIME - #define LV_TEXTAREA_DEF_PWD_SHOW_TIME CONFIG_LV_TEXTAREA_DEF_PWD_SHOW_TIME + +#ifndef LV_USE_LED + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_LED + #define LV_USE_LED CONFIG_LV_USE_LED #else - #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ + #define LV_USE_LED 0 #endif + #else + #define LV_USE_LED 1 #endif #endif -#ifndef LV_USE_TABLE - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_TABLE - #define LV_USE_TABLE CONFIG_LV_USE_TABLE +#ifndef LV_USE_LIST + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_LIST + #define LV_USE_LIST CONFIG_LV_USE_LIST #else - #define LV_USE_TABLE 0 + #define LV_USE_LIST 0 #endif #else - #define LV_USE_TABLE 1 + #define LV_USE_LIST 1 + #endif +#endif + +#ifndef LV_USE_MENU + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_MENU + #define LV_USE_MENU CONFIG_LV_USE_MENU + #else + #define LV_USE_MENU 0 + #endif + #else + #define LV_USE_MENU 1 + #endif +#endif + +#ifndef LV_USE_METER + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_METER + #define LV_USE_METER CONFIG_LV_USE_METER + #else + #define LV_USE_METER 0 + #endif + #else + #define LV_USE_METER 1 + #endif +#endif + +#ifndef LV_USE_MSGBOX + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_MSGBOX + #define LV_USE_MSGBOX CONFIG_LV_USE_MSGBOX + #else + #define LV_USE_MSGBOX 0 + #endif + #else + #define LV_USE_MSGBOX 1 + #endif +#endif + +#ifndef LV_USE_SPAN + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_SPAN + #define LV_USE_SPAN CONFIG_LV_USE_SPAN + #else + #define LV_USE_SPAN 0 + #endif + #else + #define LV_USE_SPAN 1 + #endif +#endif +#if LV_USE_SPAN + /*A line text can contain maximum num of span descriptor */ + #ifndef LV_SPAN_SNIPPET_STACK_SIZE + #ifdef CONFIG_LV_SPAN_SNIPPET_STACK_SIZE + #define LV_SPAN_SNIPPET_STACK_SIZE CONFIG_LV_SPAN_SNIPPET_STACK_SIZE + #else + #define LV_SPAN_SNIPPET_STACK_SIZE 64 + #endif + #endif +#endif + +#ifndef LV_USE_SPINBOX + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_SPINBOX + #define LV_USE_SPINBOX CONFIG_LV_USE_SPINBOX + #else + #define LV_USE_SPINBOX 0 + #endif + #else + #define LV_USE_SPINBOX 1 + #endif +#endif + +#ifndef LV_USE_SPINNER + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_SPINNER + #define LV_USE_SPINNER CONFIG_LV_USE_SPINNER + #else + #define LV_USE_SPINNER 0 + #endif + #else + #define LV_USE_SPINNER 1 #endif #endif #ifndef LV_USE_TABVIEW - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_TABVIEW #define LV_USE_TABVIEW CONFIG_LV_USE_TABVIEW #else @@ -2228,7 +1843,7 @@ #endif #ifndef LV_USE_TILEVIEW - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_TILEVIEW #define LV_USE_TILEVIEW CONFIG_LV_USE_TILEVIEW #else @@ -2240,7 +1855,7 @@ #endif #ifndef LV_USE_WIN - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_WIN #define LV_USE_WIN CONFIG_LV_USE_WIN #else @@ -2251,13 +1866,13 @@ #endif #endif -/*================== - * THEMES - *==================*/ +/*----------- + * Themes + *----------*/ /*A simple, impressive and very complete theme*/ #ifndef LV_USE_THEME_DEFAULT - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_THEME_DEFAULT #define LV_USE_THEME_DEFAULT CONFIG_LV_USE_THEME_DEFAULT #else @@ -2280,7 +1895,7 @@ /*1: Enable grow on press*/ #ifndef LV_THEME_DEFAULT_GROW - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_THEME_DEFAULT_GROW #define LV_THEME_DEFAULT_GROW CONFIG_LV_THEME_DEFAULT_GROW #else @@ -2302,21 +1917,21 @@ #endif /*LV_USE_THEME_DEFAULT*/ /*A very simple theme that is a good starting point for a custom theme*/ -#ifndef LV_USE_THEME_SIMPLE - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_THEME_SIMPLE - #define LV_USE_THEME_SIMPLE CONFIG_LV_USE_THEME_SIMPLE +#ifndef LV_USE_THEME_BASIC + #ifdef _LV_KCONFIG_PRESENT + #ifdef CONFIG_LV_USE_THEME_BASIC + #define LV_USE_THEME_BASIC CONFIG_LV_USE_THEME_BASIC #else - #define LV_USE_THEME_SIMPLE 0 + #define LV_USE_THEME_BASIC 0 #endif #else - #define LV_USE_THEME_SIMPLE 1 + #define LV_USE_THEME_BASIC 1 #endif #endif /*A theme designed for monochrome displays*/ #ifndef LV_USE_THEME_MONO - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_THEME_MONO #define LV_USE_THEME_MONO CONFIG_LV_USE_THEME_MONO #else @@ -2327,13 +1942,13 @@ #endif #endif -/*================== - * LAYOUTS - *==================*/ +/*----------- + * Layouts + *----------*/ /*A layout similar to Flexbox in CSS.*/ #ifndef LV_USE_FLEX - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_FLEX #define LV_USE_FLEX CONFIG_LV_USE_FLEX #else @@ -2346,7 +1961,7 @@ /*A layout similar to Grid in CSS.*/ #ifndef LV_USE_GRID - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_GRID #define LV_USE_GRID CONFIG_LV_USE_GRID #else @@ -2357,21 +1972,12 @@ #endif #endif -/*==================== - * 3RD PARTS LIBRARIES - *====================*/ +/*--------------------- + * 3rd party libraries + *--------------------*/ /*File system interfaces for common APIs */ -/*Setting a default driver letter allows skipping the driver prefix in filepaths*/ -#ifndef LV_FS_DEFAULT_DRIVE_LETTER - #ifdef CONFIG_LV_FS_DEFAULT_DRIVE_LETTER - #define LV_FS_DEFAULT_DRIVE_LETTER CONFIG_LV_FS_DEFAULT_DRIVE_LETTER - #else - #define LV_FS_DEFAULT_DRIVE_LETTER '\0' - #endif -#endif - /*API for fopen, fread, etc*/ #ifndef LV_USE_FS_STDIO #ifdef CONFIG_LV_USE_FS_STDIO @@ -2493,25 +2099,7 @@ #endif #endif -/*API for memory-mapped file access. */ -#ifndef LV_USE_FS_MEMFS - #ifdef CONFIG_LV_USE_FS_MEMFS - #define LV_USE_FS_MEMFS CONFIG_LV_USE_FS_MEMFS - #else - #define LV_USE_FS_MEMFS 0 - #endif -#endif -#if LV_USE_FS_MEMFS - #ifndef LV_FS_MEMFS_LETTER - #ifdef CONFIG_LV_FS_MEMFS_LETTER - #define LV_FS_MEMFS_LETTER CONFIG_LV_FS_MEMFS_LETTER - #else - #define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ - #endif - #endif -#endif - -/*API for LittleFs. */ +/*API for LittleFS (library needs to be added separately). Uses lfs_file_open, lfs_file_read, etc*/ #ifndef LV_USE_FS_LITTLEFS #ifdef CONFIG_LV_USE_FS_LITTLEFS #define LV_USE_FS_LITTLEFS CONFIG_LV_USE_FS_LITTLEFS @@ -2527,59 +2115,21 @@ #define LV_FS_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ #endif #endif -#endif - -/*API for Arduino LittleFs. */ -#ifndef LV_USE_FS_ARDUINO_ESP_LITTLEFS - #ifdef CONFIG_LV_USE_FS_ARDUINO_ESP_LITTLEFS - #define LV_USE_FS_ARDUINO_ESP_LITTLEFS CONFIG_LV_USE_FS_ARDUINO_ESP_LITTLEFS - #else - #define LV_USE_FS_ARDUINO_ESP_LITTLEFS 0 - #endif -#endif -#if LV_USE_FS_ARDUINO_ESP_LITTLEFS - #ifndef LV_FS_ARDUINO_ESP_LITTLEFS_LETTER - #ifdef CONFIG_LV_FS_ARDUINO_ESP_LITTLEFS_LETTER - #define LV_FS_ARDUINO_ESP_LITTLEFS_LETTER CONFIG_LV_FS_ARDUINO_ESP_LITTLEFS_LETTER - #else - #define LV_FS_ARDUINO_ESP_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ - #endif - #endif -#endif - -/*API for Arduino Sd. */ -#ifndef LV_USE_FS_ARDUINO_SD - #ifdef CONFIG_LV_USE_FS_ARDUINO_SD - #define LV_USE_FS_ARDUINO_SD CONFIG_LV_USE_FS_ARDUINO_SD - #else - #define LV_USE_FS_ARDUINO_SD 0 - #endif -#endif -#if LV_USE_FS_ARDUINO_SD - #ifndef LV_FS_ARDUINO_SD_LETTER - #ifdef CONFIG_LV_FS_ARDUINO_SD_LETTER - #define LV_FS_ARDUINO_SD_LETTER CONFIG_LV_FS_ARDUINO_SD_LETTER + #ifndef LV_FS_LITTLEFS_CACHE_SIZE + #ifdef CONFIG_LV_FS_LITTLEFS_CACHE_SIZE + #define LV_FS_LITTLEFS_CACHE_SIZE CONFIG_LV_FS_LITTLEFS_CACHE_SIZE #else - #define LV_FS_ARDUINO_SD_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_LITTLEFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ #endif #endif #endif -/*LODEPNG decoder library*/ -#ifndef LV_USE_LODEPNG - #ifdef CONFIG_LV_USE_LODEPNG - #define LV_USE_LODEPNG CONFIG_LV_USE_LODEPNG - #else - #define LV_USE_LODEPNG 0 - #endif -#endif - -/*PNG decoder(libpng) library*/ -#ifndef LV_USE_LIBPNG - #ifdef CONFIG_LV_USE_LIBPNG - #define LV_USE_LIBPNG CONFIG_LV_USE_LIBPNG +/*PNG decoder library*/ +#ifndef LV_USE_PNG + #ifdef CONFIG_LV_USE_PNG + #define LV_USE_PNG CONFIG_LV_USE_PNG #else - #define LV_USE_LIBPNG 0 + #define LV_USE_PNG 0 #endif #endif @@ -2594,21 +2144,11 @@ /* JPG + split JPG decoder library. * Split JPG is a custom format optimized for embedded systems. */ -#ifndef LV_USE_TJPGD - #ifdef CONFIG_LV_USE_TJPGD - #define LV_USE_TJPGD CONFIG_LV_USE_TJPGD - #else - #define LV_USE_TJPGD 0 - #endif -#endif - -/* libjpeg-turbo decoder library. - * Supports complete JPEG specifications and high-performance JPEG decoding. */ -#ifndef LV_USE_LIBJPEG_TURBO - #ifdef CONFIG_LV_USE_LIBJPEG_TURBO - #define LV_USE_LIBJPEG_TURBO CONFIG_LV_USE_LIBJPEG_TURBO +#ifndef LV_USE_SJPG + #ifdef CONFIG_LV_USE_SJPG + #define LV_USE_SJPG CONFIG_LV_USE_SJPG #else - #define LV_USE_LIBJPEG_TURBO 0 + #define LV_USE_SJPG 0 #endif #endif @@ -2620,35 +2160,6 @@ #define LV_USE_GIF 0 #endif #endif -#if LV_USE_GIF - /*GIF decoder accelerate*/ - #ifndef LV_GIF_CACHE_DECODE_DATA - #ifdef CONFIG_LV_GIF_CACHE_DECODE_DATA - #define LV_GIF_CACHE_DECODE_DATA CONFIG_LV_GIF_CACHE_DECODE_DATA - #else - #define LV_GIF_CACHE_DECODE_DATA 0 - #endif - #endif -#endif - - -/*Decode bin images to RAM*/ -#ifndef LV_BIN_DECODER_RAM_LOAD - #ifdef CONFIG_LV_BIN_DECODER_RAM_LOAD - #define LV_BIN_DECODER_RAM_LOAD CONFIG_LV_BIN_DECODER_RAM_LOAD - #else - #define LV_BIN_DECODER_RAM_LOAD 0 - #endif -#endif - -/*RLE decompress library*/ -#ifndef LV_USE_RLE - #ifdef CONFIG_LV_USE_RLE - #define LV_USE_RLE CONFIG_LV_USE_RLE - #else - #define LV_USE_RLE 0 - #endif -#endif /*QR code library*/ #ifndef LV_USE_QRCODE @@ -2659,15 +2170,6 @@ #endif #endif -/*Barcode code library*/ -#ifndef LV_USE_BARCODE - #ifdef CONFIG_LV_USE_BARCODE - #define LV_USE_BARCODE CONFIG_LV_USE_BARCODE - #else - #define LV_USE_BARCODE 0 - #endif -#endif - /*FreeType library*/ #ifndef LV_USE_FREETYPE #ifdef CONFIG_LV_USE_FREETYPE @@ -2677,27 +2179,45 @@ #endif #endif #if LV_USE_FREETYPE - /*Let FreeType to use LVGL memory and file porting*/ - #ifndef LV_FREETYPE_USE_LVGL_PORT - #ifdef CONFIG_LV_FREETYPE_USE_LVGL_PORT - #define LV_FREETYPE_USE_LVGL_PORT CONFIG_LV_FREETYPE_USE_LVGL_PORT + /*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/ + #ifndef LV_FREETYPE_CACHE_SIZE + #ifdef CONFIG_LV_FREETYPE_CACHE_SIZE + #define LV_FREETYPE_CACHE_SIZE CONFIG_LV_FREETYPE_CACHE_SIZE #else - #define LV_FREETYPE_USE_LVGL_PORT 0 + #define LV_FREETYPE_CACHE_SIZE (16 * 1024) #endif #endif - - /*Cache count of the glyphs in FreeType. It means the number of glyphs that can be cached. - *The higher the value, the more memory will be used.*/ - #ifndef LV_FREETYPE_CACHE_FT_GLYPH_CNT - #ifdef CONFIG_LV_FREETYPE_CACHE_FT_GLYPH_CNT - #define LV_FREETYPE_CACHE_FT_GLYPH_CNT CONFIG_LV_FREETYPE_CACHE_FT_GLYPH_CNT - #else - #define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256 + #if LV_FREETYPE_CACHE_SIZE >= 0 + /* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */ + /* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */ + /* if font size >= 256, must be configured as image cache */ + #ifndef LV_FREETYPE_SBIT_CACHE + #ifdef CONFIG_LV_FREETYPE_SBIT_CACHE + #define LV_FREETYPE_SBIT_CACHE CONFIG_LV_FREETYPE_SBIT_CACHE + #else + #define LV_FREETYPE_SBIT_CACHE 0 + #endif + #endif + /* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */ + /* (0:use system defaults) */ + #ifndef LV_FREETYPE_CACHE_FT_FACES + #ifdef CONFIG_LV_FREETYPE_CACHE_FT_FACES + #define LV_FREETYPE_CACHE_FT_FACES CONFIG_LV_FREETYPE_CACHE_FT_FACES + #else + #define LV_FREETYPE_CACHE_FT_FACES 0 + #endif + #endif + #ifndef LV_FREETYPE_CACHE_FT_SIZES + #ifdef CONFIG_LV_FREETYPE_CACHE_FT_SIZES + #define LV_FREETYPE_CACHE_FT_SIZES CONFIG_LV_FREETYPE_CACHE_FT_SIZES + #else + #define LV_FREETYPE_CACHE_FT_SIZES 0 + #endif #endif #endif #endif -/* Built-in TTF decoder */ +/*Tiny TTF library*/ #ifndef LV_USE_TINY_TTF #ifdef CONFIG_LV_USE_TINY_TTF #define LV_USE_TINY_TTF CONFIG_LV_USE_TINY_TTF @@ -2706,7 +2226,7 @@ #endif #endif #if LV_USE_TINY_TTF - /* Enable loading TTF data from files */ + /*Load TTF data from files*/ #ifndef LV_TINY_TTF_FILE_SUPPORT #ifdef CONFIG_LV_TINY_TTF_FILE_SUPPORT #define LV_TINY_TTF_FILE_SUPPORT CONFIG_LV_TINY_TTF_FILE_SUPPORT @@ -2714,13 +2234,6 @@ #define LV_TINY_TTF_FILE_SUPPORT 0 #endif #endif - #ifndef LV_TINY_TTF_CACHE_GLYPH_CNT - #ifdef CONFIG_LV_TINY_TTF_CACHE_GLYPH_CNT - #define LV_TINY_TTF_CACHE_GLYPH_CNT CONFIG_LV_TINY_TTF_CACHE_GLYPH_CNT - #else - #define LV_TINY_TTF_CACHE_GLYPH_CNT 256 - #endif - #endif #endif /*Rlottie library*/ @@ -2732,52 +2245,6 @@ #endif #endif -/*Enable Vector Graphic APIs - *Requires `LV_USE_MATRIX = 1`*/ -#ifndef LV_USE_VECTOR_GRAPHIC - #ifdef CONFIG_LV_USE_VECTOR_GRAPHIC - #define LV_USE_VECTOR_GRAPHIC CONFIG_LV_USE_VECTOR_GRAPHIC - #else - #define LV_USE_VECTOR_GRAPHIC 0 - #endif -#endif - -/* Enable ThorVG (vector graphics library) from the src/libs folder */ -#ifndef LV_USE_THORVG_INTERNAL - #ifdef CONFIG_LV_USE_THORVG_INTERNAL - #define LV_USE_THORVG_INTERNAL CONFIG_LV_USE_THORVG_INTERNAL - #else - #define LV_USE_THORVG_INTERNAL 0 - #endif -#endif - -/* Enable ThorVG by assuming that its installed and linked to the project */ -#ifndef LV_USE_THORVG_EXTERNAL - #ifdef CONFIG_LV_USE_THORVG_EXTERNAL - #define LV_USE_THORVG_EXTERNAL CONFIG_LV_USE_THORVG_EXTERNAL - #else - #define LV_USE_THORVG_EXTERNAL 0 - #endif -#endif - -/*Use lvgl built-in LZ4 lib*/ -#ifndef LV_USE_LZ4_INTERNAL - #ifdef CONFIG_LV_USE_LZ4_INTERNAL - #define LV_USE_LZ4_INTERNAL CONFIG_LV_USE_LZ4_INTERNAL - #else - #define LV_USE_LZ4_INTERNAL 0 - #endif -#endif - -/*Use external LZ4 library*/ -#ifndef LV_USE_LZ4_EXTERNAL - #ifdef CONFIG_LV_USE_LZ4_EXTERNAL - #define LV_USE_LZ4_EXTERNAL CONFIG_LV_USE_LZ4_EXTERNAL - #else - #define LV_USE_LZ4_EXTERNAL 0 - #endif -#endif - /*FFmpeg library for image decoding and playing videos *Supports all major image formats so do not enable other image decoder with it*/ #ifndef LV_USE_FFMPEG @@ -2798,9 +2265,9 @@ #endif #endif -/*================== - * OTHERS - *==================*/ +/*----------- + * Others + *----------*/ /*1: Enable API to take snapshot for object*/ #ifndef LV_USE_SNAPSHOT @@ -2811,152 +2278,6 @@ #endif #endif -/*1: Enable system monitor component*/ -#ifndef LV_USE_SYSMON - #ifdef CONFIG_LV_USE_SYSMON - #define LV_USE_SYSMON CONFIG_LV_USE_SYSMON - #else - #define LV_USE_SYSMON 0 - #endif -#endif -#if LV_USE_SYSMON - /*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/ - #ifndef LV_SYSMON_GET_IDLE - #ifdef CONFIG_LV_SYSMON_GET_IDLE - #define LV_SYSMON_GET_IDLE CONFIG_LV_SYSMON_GET_IDLE - #else - #define LV_SYSMON_GET_IDLE lv_timer_get_idle - #endif - #endif - - /*1: Show CPU usage and FPS count - * Requires `LV_USE_SYSMON = 1`*/ - #ifndef LV_USE_PERF_MONITOR - #ifdef CONFIG_LV_USE_PERF_MONITOR - #define LV_USE_PERF_MONITOR CONFIG_LV_USE_PERF_MONITOR - #else - #define LV_USE_PERF_MONITOR 0 - #endif - #endif - #if LV_USE_PERF_MONITOR - #ifndef LV_USE_PERF_MONITOR_POS - #ifdef CONFIG_LV_USE_PERF_MONITOR_POS - #define LV_USE_PERF_MONITOR_POS CONFIG_LV_USE_PERF_MONITOR_POS - #else - #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT - #endif - #endif - - /*0: Displays performance data on the screen, 1: Prints performance data using log.*/ - #ifndef LV_USE_PERF_MONITOR_LOG_MODE - #ifdef CONFIG_LV_USE_PERF_MONITOR_LOG_MODE - #define LV_USE_PERF_MONITOR_LOG_MODE CONFIG_LV_USE_PERF_MONITOR_LOG_MODE - #else - #define LV_USE_PERF_MONITOR_LOG_MODE 0 - #endif - #endif - #endif - - /*1: Show the used memory and the memory fragmentation - * Requires `LV_USE_STDLIB_MALLOC = LV_STDLIB_BUILTIN` - * Requires `LV_USE_SYSMON = 1`*/ - #ifndef LV_USE_MEM_MONITOR - #ifdef CONFIG_LV_USE_MEM_MONITOR - #define LV_USE_MEM_MONITOR CONFIG_LV_USE_MEM_MONITOR - #else - #define LV_USE_MEM_MONITOR 0 - #endif - #endif - #if LV_USE_MEM_MONITOR - #ifndef LV_USE_MEM_MONITOR_POS - #ifdef CONFIG_LV_USE_MEM_MONITOR_POS - #define LV_USE_MEM_MONITOR_POS CONFIG_LV_USE_MEM_MONITOR_POS - #else - #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT - #endif - #endif - #endif - -#endif /*LV_USE_SYSMON*/ - -/*1: Enable the runtime performance profiler*/ -#ifndef LV_USE_PROFILER - #ifdef CONFIG_LV_USE_PROFILER - #define LV_USE_PROFILER CONFIG_LV_USE_PROFILER - #else - #define LV_USE_PROFILER 0 - #endif -#endif -#if LV_USE_PROFILER - /*1: Enable the built-in profiler*/ - #ifndef LV_USE_PROFILER_BUILTIN - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_PROFILER_BUILTIN - #define LV_USE_PROFILER_BUILTIN CONFIG_LV_USE_PROFILER_BUILTIN - #else - #define LV_USE_PROFILER_BUILTIN 0 - #endif - #else - #define LV_USE_PROFILER_BUILTIN 1 - #endif - #endif - #if LV_USE_PROFILER_BUILTIN - /*Default profiler trace buffer size*/ - #ifndef LV_PROFILER_BUILTIN_BUF_SIZE - #ifdef CONFIG_LV_PROFILER_BUILTIN_BUF_SIZE - #define LV_PROFILER_BUILTIN_BUF_SIZE CONFIG_LV_PROFILER_BUILTIN_BUF_SIZE - #else - #define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /*[bytes]*/ - #endif - #endif - #endif - - /*Header to include for the profiler*/ - #ifndef LV_PROFILER_INCLUDE - #ifdef CONFIG_LV_PROFILER_INCLUDE - #define LV_PROFILER_INCLUDE CONFIG_LV_PROFILER_INCLUDE - #else - #define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h" - #endif - #endif - - /*Profiler start point function*/ - #ifndef LV_PROFILER_BEGIN - #ifdef CONFIG_LV_PROFILER_BEGIN - #define LV_PROFILER_BEGIN CONFIG_LV_PROFILER_BEGIN - #else - #define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN - #endif - #endif - - /*Profiler end point function*/ - #ifndef LV_PROFILER_END - #ifdef CONFIG_LV_PROFILER_END - #define LV_PROFILER_END CONFIG_LV_PROFILER_END - #else - #define LV_PROFILER_END LV_PROFILER_BUILTIN_END - #endif - #endif - - /*Profiler start point function with custom tag*/ - #ifndef LV_PROFILER_BEGIN_TAG - #ifdef CONFIG_LV_PROFILER_BEGIN_TAG - #define LV_PROFILER_BEGIN_TAG CONFIG_LV_PROFILER_BEGIN_TAG - #else - #define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG - #endif - #endif - - /*Profiler end point function with custom tag*/ - #ifndef LV_PROFILER_END_TAG - #ifdef CONFIG_LV_PROFILER_END_TAG - #define LV_PROFILER_END_TAG CONFIG_LV_PROFILER_END_TAG - #else - #define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG - #endif - #endif -#endif - /*1: Enable Monkey test*/ #ifndef LV_USE_MONKEY #ifdef CONFIG_LV_USE_MONKEY @@ -2993,16 +2314,12 @@ #endif #endif -/*1: Enable an observer pattern implementation*/ -#ifndef LV_USE_OBSERVER - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_OBSERVER - #define LV_USE_OBSERVER CONFIG_LV_USE_OBSERVER - #else - #define LV_USE_OBSERVER 0 - #endif +/*1: Enable a published subscriber based messaging system */ +#ifndef LV_USE_MSG + #ifdef CONFIG_LV_USE_MSG + #define LV_USE_MSG CONFIG_LV_USE_MSG #else - #define LV_USE_OBSERVER 1 + #define LV_USE_MSG 0 #endif #endif @@ -3017,9 +2334,9 @@ #endif #if LV_USE_IME_PINYIN /*1: Use default thesaurus*/ - /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesaurus*/ + /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/ #ifndef LV_IME_PINYIN_USE_DEFAULT_DICT - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_IME_PINYIN_USE_DEFAULT_DICT #define LV_IME_PINYIN_USE_DEFAULT_DICT CONFIG_LV_IME_PINYIN_USE_DEFAULT_DICT #else @@ -3041,7 +2358,7 @@ /*Use 9 key input(k9)*/ #ifndef LV_IME_PINYIN_USE_K9_MODE - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_IME_PINYIN_USE_K9_MODE #define LV_IME_PINYIN_USE_K9_MODE CONFIG_LV_IME_PINYIN_USE_K9_MODE #else @@ -3059,467 +2376,7 @@ #define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3 #endif #endif - #endif /*LV_IME_PINYIN_USE_K9_MODE*/ -#endif - -/*1: Enable file explorer*/ -/*Requires: lv_table*/ -#ifndef LV_USE_FILE_EXPLORER - #ifdef CONFIG_LV_USE_FILE_EXPLORER - #define LV_USE_FILE_EXPLORER CONFIG_LV_USE_FILE_EXPLORER - #else - #define LV_USE_FILE_EXPLORER 0 - #endif -#endif -#if LV_USE_FILE_EXPLORER - /*Maximum length of path*/ - #ifndef LV_FILE_EXPLORER_PATH_MAX_LEN - #ifdef CONFIG_LV_FILE_EXPLORER_PATH_MAX_LEN - #define LV_FILE_EXPLORER_PATH_MAX_LEN CONFIG_LV_FILE_EXPLORER_PATH_MAX_LEN - #else - #define LV_FILE_EXPLORER_PATH_MAX_LEN (128) - #endif - #endif - /*Quick access bar, 1:use, 0:not use*/ - /*Requires: lv_list*/ - #ifndef LV_FILE_EXPLORER_QUICK_ACCESS - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_FILE_EXPLORER_QUICK_ACCESS - #define LV_FILE_EXPLORER_QUICK_ACCESS CONFIG_LV_FILE_EXPLORER_QUICK_ACCESS - #else - #define LV_FILE_EXPLORER_QUICK_ACCESS 0 - #endif - #else - #define LV_FILE_EXPLORER_QUICK_ACCESS 1 - #endif - #endif -#endif - -/*================== - * DEVICES - *==================*/ - -/*Use SDL to open window on PC and handle mouse and keyboard*/ -#ifndef LV_USE_SDL - #ifdef CONFIG_LV_USE_SDL - #define LV_USE_SDL CONFIG_LV_USE_SDL - #else - #define LV_USE_SDL 0 - #endif -#endif -#if LV_USE_SDL - #ifndef LV_SDL_INCLUDE_PATH - #ifdef CONFIG_LV_SDL_INCLUDE_PATH - #define LV_SDL_INCLUDE_PATH CONFIG_LV_SDL_INCLUDE_PATH - #else - #define LV_SDL_INCLUDE_PATH - #endif - #endif - #ifndef LV_SDL_RENDER_MODE - #ifdef CONFIG_LV_SDL_RENDER_MODE - #define LV_SDL_RENDER_MODE CONFIG_LV_SDL_RENDER_MODE - #else - #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/ - #endif - #endif - #ifndef LV_SDL_BUF_COUNT - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_SDL_BUF_COUNT - #define LV_SDL_BUF_COUNT CONFIG_LV_SDL_BUF_COUNT - #else - #define LV_SDL_BUF_COUNT 0 - #endif - #else - #define LV_SDL_BUF_COUNT 1 /*1 or 2*/ - #endif - #endif - #ifndef LV_SDL_ACCELERATED - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_SDL_ACCELERATED - #define LV_SDL_ACCELERATED CONFIG_LV_SDL_ACCELERATED - #else - #define LV_SDL_ACCELERATED 0 - #endif - #else - #define LV_SDL_ACCELERATED 1 /*1: Use hardware acceleration*/ - #endif - #endif - #ifndef LV_SDL_FULLSCREEN - #ifdef CONFIG_LV_SDL_FULLSCREEN - #define LV_SDL_FULLSCREEN CONFIG_LV_SDL_FULLSCREEN - #else - #define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/ - #endif - #endif - #ifndef LV_SDL_DIRECT_EXIT - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_SDL_DIRECT_EXIT - #define LV_SDL_DIRECT_EXIT CONFIG_LV_SDL_DIRECT_EXIT - #else - #define LV_SDL_DIRECT_EXIT 0 - #endif - #else - #define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/ - #endif - #endif - #ifndef LV_SDL_MOUSEWHEEL_MODE - #ifdef CONFIG_LV_SDL_MOUSEWHEEL_MODE - #define LV_SDL_MOUSEWHEEL_MODE CONFIG_LV_SDL_MOUSEWHEEL_MODE - #else - #define LV_SDL_MOUSEWHEEL_MODE LV_SDL_MOUSEWHEEL_MODE_ENCODER /*LV_SDL_MOUSEWHEEL_MODE_ENCODER/CROWN*/ - #endif - #endif -#endif - -/*Use X11 to open window on Linux desktop and handle mouse and keyboard*/ -#ifndef LV_USE_X11 - #ifdef CONFIG_LV_USE_X11 - #define LV_USE_X11 CONFIG_LV_USE_X11 - #else - #define LV_USE_X11 0 - #endif -#endif -#if LV_USE_X11 - #ifndef LV_X11_DIRECT_EXIT - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_X11_DIRECT_EXIT - #define LV_X11_DIRECT_EXIT CONFIG_LV_X11_DIRECT_EXIT - #else - #define LV_X11_DIRECT_EXIT 0 - #endif - #else - #define LV_X11_DIRECT_EXIT 1 /*Exit the application when all X11 windows have been closed*/ - #endif - #endif - #ifndef LV_X11_DOUBLE_BUFFER - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_X11_DOUBLE_BUFFER - #define LV_X11_DOUBLE_BUFFER CONFIG_LV_X11_DOUBLE_BUFFER - #else - #define LV_X11_DOUBLE_BUFFER 0 - #endif - #else - #define LV_X11_DOUBLE_BUFFER 1 /*Use double buffers for rendering*/ - #endif - #endif - /*select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!)*/ - #ifndef LV_X11_RENDER_MODE_PARTIAL - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_X11_RENDER_MODE_PARTIAL - #define LV_X11_RENDER_MODE_PARTIAL CONFIG_LV_X11_RENDER_MODE_PARTIAL - #else - #define LV_X11_RENDER_MODE_PARTIAL 0 - #endif - #else - #define LV_X11_RENDER_MODE_PARTIAL 1 /*Partial render mode (preferred)*/ - #endif - #endif - #ifndef LV_X11_RENDER_MODE_DIRECT - #ifdef CONFIG_LV_X11_RENDER_MODE_DIRECT - #define LV_X11_RENDER_MODE_DIRECT CONFIG_LV_X11_RENDER_MODE_DIRECT - #else - #define LV_X11_RENDER_MODE_DIRECT 0 /*direct render mode*/ - #endif - #endif - #ifndef LV_X11_RENDER_MODE_FULL - #ifdef CONFIG_LV_X11_RENDER_MODE_FULL - #define LV_X11_RENDER_MODE_FULL CONFIG_LV_X11_RENDER_MODE_FULL - #else - #define LV_X11_RENDER_MODE_FULL 0 /*Full render mode*/ - #endif - #endif -#endif - -/*Use Wayland to open a window and handle input on Linux or BSD desktops */ -#ifndef LV_USE_WAYLAND - #ifdef CONFIG_LV_USE_WAYLAND - #define LV_USE_WAYLAND CONFIG_LV_USE_WAYLAND - #else - #define LV_USE_WAYLAND 0 - #endif -#endif -#if LV_USE_WAYLAND - #ifndef LV_WAYLAND_WINDOW_DECORATIONS - #ifdef CONFIG_LV_WAYLAND_WINDOW_DECORATIONS - #define LV_WAYLAND_WINDOW_DECORATIONS CONFIG_LV_WAYLAND_WINDOW_DECORATIONS - #else - #define LV_WAYLAND_WINDOW_DECORATIONS 0 /*Draw client side window decorations only necessary on Mutter/GNOME*/ - #endif - #endif - #ifndef LV_WAYLAND_WL_SHELL - #ifdef CONFIG_LV_WAYLAND_WL_SHELL - #define LV_WAYLAND_WL_SHELL CONFIG_LV_WAYLAND_WL_SHELL - #else - #define LV_WAYLAND_WL_SHELL 0 /*Use the legacy wl_shell protocol instead of the default XDG shell*/ - #endif - #endif -#endif - -/*Driver for /dev/fb*/ -#ifndef LV_USE_LINUX_FBDEV - #ifdef CONFIG_LV_USE_LINUX_FBDEV - #define LV_USE_LINUX_FBDEV CONFIG_LV_USE_LINUX_FBDEV - #else - #define LV_USE_LINUX_FBDEV 0 - #endif -#endif -#if LV_USE_LINUX_FBDEV - #ifndef LV_LINUX_FBDEV_BSD - #ifdef CONFIG_LV_LINUX_FBDEV_BSD - #define LV_LINUX_FBDEV_BSD CONFIG_LV_LINUX_FBDEV_BSD - #else - #define LV_LINUX_FBDEV_BSD 0 - #endif - #endif - #ifndef LV_LINUX_FBDEV_RENDER_MODE - #ifdef CONFIG_LV_LINUX_FBDEV_RENDER_MODE - #define LV_LINUX_FBDEV_RENDER_MODE CONFIG_LV_LINUX_FBDEV_RENDER_MODE - #else - #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL - #endif - #endif - #ifndef LV_LINUX_FBDEV_BUFFER_COUNT - #ifdef CONFIG_LV_LINUX_FBDEV_BUFFER_COUNT - #define LV_LINUX_FBDEV_BUFFER_COUNT CONFIG_LV_LINUX_FBDEV_BUFFER_COUNT - #else - #define LV_LINUX_FBDEV_BUFFER_COUNT 0 - #endif - #endif - #ifndef LV_LINUX_FBDEV_BUFFER_SIZE - #ifdef CONFIG_LV_LINUX_FBDEV_BUFFER_SIZE - #define LV_LINUX_FBDEV_BUFFER_SIZE CONFIG_LV_LINUX_FBDEV_BUFFER_SIZE - #else - #define LV_LINUX_FBDEV_BUFFER_SIZE 60 - #endif - #endif -#endif - -/*Use Nuttx to open window and handle touchscreen*/ -#ifndef LV_USE_NUTTX - #ifdef CONFIG_LV_USE_NUTTX - #define LV_USE_NUTTX CONFIG_LV_USE_NUTTX - #else - #define LV_USE_NUTTX 0 - #endif -#endif - -#if LV_USE_NUTTX - #ifndef LV_USE_NUTTX_LIBUV - #ifdef CONFIG_LV_USE_NUTTX_LIBUV - #define LV_USE_NUTTX_LIBUV CONFIG_LV_USE_NUTTX_LIBUV - #else - #define LV_USE_NUTTX_LIBUV 0 - #endif - #endif - - /*Use Nuttx custom init API to open window and handle touchscreen*/ - #ifndef LV_USE_NUTTX_CUSTOM_INIT - #ifdef CONFIG_LV_USE_NUTTX_CUSTOM_INIT - #define LV_USE_NUTTX_CUSTOM_INIT CONFIG_LV_USE_NUTTX_CUSTOM_INIT - #else - #define LV_USE_NUTTX_CUSTOM_INIT 0 - #endif - #endif - - /*Driver for /dev/lcd*/ - #ifndef LV_USE_NUTTX_LCD - #ifdef CONFIG_LV_USE_NUTTX_LCD - #define LV_USE_NUTTX_LCD CONFIG_LV_USE_NUTTX_LCD - #else - #define LV_USE_NUTTX_LCD 0 - #endif - #endif - #if LV_USE_NUTTX_LCD - #ifndef LV_NUTTX_LCD_BUFFER_COUNT - #ifdef CONFIG_LV_NUTTX_LCD_BUFFER_COUNT - #define LV_NUTTX_LCD_BUFFER_COUNT CONFIG_LV_NUTTX_LCD_BUFFER_COUNT - #else - #define LV_NUTTX_LCD_BUFFER_COUNT 0 - #endif - #endif - #ifndef LV_NUTTX_LCD_BUFFER_SIZE - #ifdef CONFIG_LV_NUTTX_LCD_BUFFER_SIZE - #define LV_NUTTX_LCD_BUFFER_SIZE CONFIG_LV_NUTTX_LCD_BUFFER_SIZE - #else - #define LV_NUTTX_LCD_BUFFER_SIZE 60 - #endif - #endif - #endif - - /*Driver for /dev/input*/ - #ifndef LV_USE_NUTTX_TOUCHSCREEN - #ifdef CONFIG_LV_USE_NUTTX_TOUCHSCREEN - #define LV_USE_NUTTX_TOUCHSCREEN CONFIG_LV_USE_NUTTX_TOUCHSCREEN - #else - #define LV_USE_NUTTX_TOUCHSCREEN 0 - #endif - #endif - -#endif - -/*Driver for /dev/dri/card*/ -#ifndef LV_USE_LINUX_DRM - #ifdef CONFIG_LV_USE_LINUX_DRM - #define LV_USE_LINUX_DRM CONFIG_LV_USE_LINUX_DRM - #else - #define LV_USE_LINUX_DRM 0 - #endif -#endif - -/*Interface for TFT_eSPI*/ -#ifndef LV_USE_TFT_ESPI - #ifdef CONFIG_LV_USE_TFT_ESPI - #define LV_USE_TFT_ESPI CONFIG_LV_USE_TFT_ESPI - #else - #define LV_USE_TFT_ESPI 0 - #endif -#endif - -/*Driver for evdev input devices*/ -#ifndef LV_USE_EVDEV - #ifdef CONFIG_LV_USE_EVDEV - #define LV_USE_EVDEV CONFIG_LV_USE_EVDEV - #else - #define LV_USE_EVDEV 0 - #endif -#endif - -/*Driver for libinput input devices*/ -#ifndef LV_USE_LIBINPUT - #ifdef CONFIG_LV_USE_LIBINPUT - #define LV_USE_LIBINPUT CONFIG_LV_USE_LIBINPUT - #else - #define LV_USE_LIBINPUT 0 - #endif -#endif - -#if LV_USE_LIBINPUT - #ifndef LV_LIBINPUT_BSD - #ifdef CONFIG_LV_LIBINPUT_BSD - #define LV_LIBINPUT_BSD CONFIG_LV_LIBINPUT_BSD - #else - #define LV_LIBINPUT_BSD 0 - #endif - #endif - - /*Full keyboard support*/ - #ifndef LV_LIBINPUT_XKB - #ifdef CONFIG_LV_LIBINPUT_XKB - #define LV_LIBINPUT_XKB CONFIG_LV_LIBINPUT_XKB - #else - #define LV_LIBINPUT_XKB 0 - #endif - #endif - #if LV_LIBINPUT_XKB - /*"setxkbmap -query" can help find the right values for your keyboard*/ - #ifndef LV_LIBINPUT_XKB_KEY_MAP - #ifdef CONFIG_LV_LIBINPUT_XKB_KEY_MAP - #define LV_LIBINPUT_XKB_KEY_MAP CONFIG_LV_LIBINPUT_XKB_KEY_MAP - #else - #define LV_LIBINPUT_XKB_KEY_MAP { .rules = NULL, .model = "pc101", .layout = "us", .variant = NULL, .options = NULL } - #endif - #endif - #endif -#endif - -/*Drivers for LCD devices connected via SPI/parallel port*/ -#ifndef LV_USE_ST7735 - #ifdef CONFIG_LV_USE_ST7735 - #define LV_USE_ST7735 CONFIG_LV_USE_ST7735 - #else - #define LV_USE_ST7735 0 - #endif -#endif -#ifndef LV_USE_ST7789 - #ifdef CONFIG_LV_USE_ST7789 - #define LV_USE_ST7789 CONFIG_LV_USE_ST7789 - #else - #define LV_USE_ST7789 0 - #endif -#endif -#ifndef LV_USE_ST7796 - #ifdef CONFIG_LV_USE_ST7796 - #define LV_USE_ST7796 CONFIG_LV_USE_ST7796 - #else - #define LV_USE_ST7796 0 - #endif -#endif -#ifndef LV_USE_ILI9341 - #ifdef CONFIG_LV_USE_ILI9341 - #define LV_USE_ILI9341 CONFIG_LV_USE_ILI9341 - #else - #define LV_USE_ILI9341 0 - #endif -#endif - -#ifndef LV_USE_GENERIC_MIPI - #ifdef CONFIG_LV_USE_GENERIC_MIPI - #define LV_USE_GENERIC_MIPI CONFIG_LV_USE_GENERIC_MIPI - #else - #define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341) - #endif -#endif - -/*Driver for Renesas GLCD*/ -#ifndef LV_USE_RENESAS_GLCDC - #ifdef CONFIG_LV_USE_RENESAS_GLCDC - #define LV_USE_RENESAS_GLCDC CONFIG_LV_USE_RENESAS_GLCDC - #else - #define LV_USE_RENESAS_GLCDC 0 - #endif -#endif - -/* LVGL Windows backend */ -#ifndef LV_USE_WINDOWS - #ifdef CONFIG_LV_USE_WINDOWS - #define LV_USE_WINDOWS CONFIG_LV_USE_WINDOWS - #else - #define LV_USE_WINDOWS 0 - #endif -#endif - -/* Use OpenGL to open window on PC and handle mouse and keyboard */ -#ifndef LV_USE_OPENGLES - #ifdef CONFIG_LV_USE_OPENGLES - #define LV_USE_OPENGLES CONFIG_LV_USE_OPENGLES - #else - #define LV_USE_OPENGLES 0 - #endif -#endif -#if LV_USE_OPENGLES - #ifndef LV_USE_OPENGLES_DEBUG - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_USE_OPENGLES_DEBUG - #define LV_USE_OPENGLES_DEBUG CONFIG_LV_USE_OPENGLES_DEBUG - #else - #define LV_USE_OPENGLES_DEBUG 0 - #endif - #else - #define LV_USE_OPENGLES_DEBUG 1 /* Enable or disable debug for opengles */ - #endif - #endif -#endif - -/* QNX Screen display and input drivers */ -#ifndef LV_USE_QNX - #ifdef CONFIG_LV_USE_QNX - #define LV_USE_QNX CONFIG_LV_USE_QNX - #else - #define LV_USE_QNX 0 - #endif -#endif -#if LV_USE_QNX - #ifndef LV_QNX_BUF_COUNT - #ifdef LV_KCONFIG_PRESENT - #ifdef CONFIG_LV_QNX_BUF_COUNT - #define LV_QNX_BUF_COUNT CONFIG_LV_QNX_BUF_COUNT - #else - #define LV_QNX_BUF_COUNT 0 - #endif - #else - #define LV_QNX_BUF_COUNT 1 /*1 or 2*/ - #endif - #endif + #endif // LV_IME_PINYIN_USE_K9_MODE #endif /*================== @@ -3528,7 +2385,7 @@ /*Enable the examples to be built with the library*/ #ifndef LV_BUILD_EXAMPLES - #ifdef LV_KCONFIG_PRESENT + #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_BUILD_EXAMPLES #define LV_BUILD_EXAMPLES CONFIG_LV_BUILD_EXAMPLES #else @@ -3551,6 +2408,15 @@ #define LV_USE_DEMO_WIDGETS 0 #endif #endif +#if LV_USE_DEMO_WIDGETS +#ifndef LV_DEMO_WIDGETS_SLIDESHOW + #ifdef CONFIG_LV_DEMO_WIDGETS_SLIDESHOW + #define LV_DEMO_WIDGETS_SLIDESHOW CONFIG_LV_DEMO_WIDGETS_SLIDESHOW + #else + #define LV_DEMO_WIDGETS_SLIDESHOW 0 + #endif +#endif +#endif /*Demonstrate the usage of encoder and keyboard*/ #ifndef LV_USE_DEMO_KEYPAD_AND_ENCODER @@ -3569,15 +2435,16 @@ #define LV_USE_DEMO_BENCHMARK 0 #endif #endif - -/*Render test for each primitives. Requires at least 480x272 display*/ -#ifndef LV_USE_DEMO_RENDER - #ifdef CONFIG_LV_USE_DEMO_RENDER - #define LV_USE_DEMO_RENDER CONFIG_LV_USE_DEMO_RENDER +#if LV_USE_DEMO_BENCHMARK +/*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/ +#ifndef LV_DEMO_BENCHMARK_RGB565A8 + #ifdef CONFIG_LV_DEMO_BENCHMARK_RGB565A8 + #define LV_DEMO_BENCHMARK_RGB565A8 CONFIG_LV_DEMO_BENCHMARK_RGB565A8 #else - #define LV_USE_DEMO_RENDER 0 + #define LV_DEMO_BENCHMARK_RGB565A8 0 #endif #endif +#endif /*Stress test for LVGL*/ #ifndef LV_USE_DEMO_STRESS @@ -3634,64 +2501,16 @@ #endif #endif -/*Flex layout demo*/ -#ifndef LV_USE_DEMO_FLEX_LAYOUT - #ifdef CONFIG_LV_USE_DEMO_FLEX_LAYOUT - #define LV_USE_DEMO_FLEX_LAYOUT CONFIG_LV_USE_DEMO_FLEX_LAYOUT - #else - #define LV_USE_DEMO_FLEX_LAYOUT 0 - #endif -#endif - -/*Smart-phone like multi-language demo*/ -#ifndef LV_USE_DEMO_MULTILANG - #ifdef CONFIG_LV_USE_DEMO_MULTILANG - #define LV_USE_DEMO_MULTILANG CONFIG_LV_USE_DEMO_MULTILANG - #else - #define LV_USE_DEMO_MULTILANG 0 - #endif -#endif - -/*Widget transformation demo*/ -#ifndef LV_USE_DEMO_TRANSFORM - #ifdef CONFIG_LV_USE_DEMO_TRANSFORM - #define LV_USE_DEMO_TRANSFORM CONFIG_LV_USE_DEMO_TRANSFORM - #else - #define LV_USE_DEMO_TRANSFORM 0 - #endif -#endif - -/*Demonstrate scroll settings*/ -#ifndef LV_USE_DEMO_SCROLL - #ifdef CONFIG_LV_USE_DEMO_SCROLL - #define LV_USE_DEMO_SCROLL CONFIG_LV_USE_DEMO_SCROLL - #else - #define LV_USE_DEMO_SCROLL 0 - #endif -#endif - -/*Vector graphic demo*/ -#ifndef LV_USE_DEMO_VECTOR_GRAPHIC - #ifdef CONFIG_LV_USE_DEMO_VECTOR_GRAPHIC - #define LV_USE_DEMO_VECTOR_GRAPHIC CONFIG_LV_USE_DEMO_VECTOR_GRAPHIC - #else - #define LV_USE_DEMO_VECTOR_GRAPHIC 0 - #endif -#endif - /*---------------------------------- * End of parsing lv_conf_template.h -----------------------------------*/ -#ifndef __ASSEMBLY__ LV_EXPORT_CONST_INT(LV_DPI_DEF); -LV_EXPORT_CONST_INT(LV_DRAW_BUF_STRIDE_ALIGN); -LV_EXPORT_CONST_INT(LV_DRAW_BUF_ALIGN); -#endif -#undef LV_KCONFIG_PRESENT +#undef _LV_KCONFIG_PRESENT + /*Set some defines if a dependency is disabled*/ #if LV_USE_LOG == 0 @@ -3706,29 +2525,6 @@ LV_EXPORT_CONST_INT(LV_DRAW_BUF_ALIGN); #define LV_LOG_TRACE_ANIM 0 #endif /*LV_USE_LOG*/ -#if LV_USE_SYSMON == 0 - #define LV_USE_PERF_MONITOR 0 - #define LV_USE_MEM_MONITOR 0 -#endif /*LV_USE_SYSMON*/ - -#ifndef LV_USE_LZ4 - #define LV_USE_LZ4 (LV_USE_LZ4_INTERNAL || LV_USE_LZ4_EXTERNAL) -#endif - -#ifndef LV_USE_THORVG - #define LV_USE_THORVG (LV_USE_THORVG_INTERNAL || LV_USE_THORVG_EXTERNAL) -#endif - -#if LV_USE_OS - #if (LV_USE_FREETYPE || LV_USE_THORVG) && LV_DRAW_THREAD_STACK_SIZE < (32 * 1024) - #warning "Increase LV_DRAW_THREAD_STACK_SIZE to at least 32KB for FreeType or ThorVG." - #endif - - #if defined(LV_DRAW_THREAD_STACKSIZE) && !defined(LV_DRAW_THREAD_STACK_SIZE) - #warning "LV_DRAW_THREAD_STACKSIZE was renamed to LV_DRAW_THREAD_STACK_SIZE. Please update lv_conf.h or run menuconfig again." - #define LV_DRAW_THREAD_STACK_SIZE LV_DRAW_THREAD_STACKSIZE - #endif -#endif /*If running without lv_conf.h add typedefs with default value*/ #ifdef LV_CONF_SKIP diff --git a/L3_Middlewares/LVGL/src/lv_conf_kconfig.h b/L3_Middlewares/LVGL/src/lv_conf_kconfig.h index 7796e0f..80f7061 100644 --- a/L3_Middlewares/LVGL/src/lv_conf_kconfig.h +++ b/L3_Middlewares/LVGL/src/lv_conf_kconfig.h @@ -18,16 +18,6 @@ extern "C" { # ifdef __NuttX__ # include -/* - * Make sure version number in Kconfig file is correctly set. - * Mismatch can happen when user manually copy lvgl/Kconfig file to their project, like what NuttX does. - */ -# include "../lv_version.h" - -# if CONFIG_LVGL_VERSION_MAJOR != LVGL_VERSION_MAJOR || CONFIG_LVGL_VERSION_MINOR != LVGL_VERSION_MINOR \ - || CONFIG_LVGL_VERSION_PATCH != LVGL_VERSION_PATCH -# warning "Version mismatch between Kconfig and lvgl/lv_version.h" -# endif # elif defined(__RTTHREAD__) # define LV_CONF_INCLUDE_SIMPLE # include @@ -36,51 +26,11 @@ extern "C" { #endif /*LV_CONF_KCONFIG_EXTERNAL_INCLUDE*/ /******************* - * LV_USE_STDLIB_MALLOC - *******************/ - -#ifdef CONFIG_LV_USE_BUILTIN_MALLOC -# define CONFIG_LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN -#elif defined(CONFIG_LV_USE_CLIB_MALLOC) -# define CONFIG_LV_USE_STDLIB_MALLOC LV_STDLIB_CLIB -#elif defined(CONFIG_LV_USE_MICROPYTHON_MALLOC) -# define CONFIG_LV_USE_STDLIB_MALLOC LV_STDLIB_MICROPYTHON -#elif defined(CONFIG_LV_USE_RTTHREAD_MALLOC) -# define CONFIG_LV_USE_STDLIB_MALLOC LV_STDLIB_RTTHREAD -#elif defined (CONFIG_LV_USE_CUSTOM_MALLOC) -# define CONFIG_LV_USE_STDLIB_MALLOC LV_STDLIB_CUSTOM -#endif - -/******************* - * LV_USE_STDLIB_STRING + * LV COLOR CHROMA KEY *******************/ -#ifdef CONFIG_LV_USE_BUILTIN_STRING -# define CONFIG_LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN -#elif defined(CONFIG_LV_USE_CLIB_STRING) -# define CONFIG_LV_USE_STDLIB_STRING LV_STDLIB_CLIB -#elif defined(CONFIG_LV_USE_MICROPYTHON_STRING) -# define CONFIG_LV_USE_STDLIB_STRING LV_STDLIB_MICROPYTHON -#elif defined(CONFIG_LV_USE_RTTHREAD_STRING) -# define CONFIG_LV_USE_STDLIB_STRING LV_STDLIB_RTTHREAD -#elif defined (CONFIG_LV_USE_CUSTOM_STRING) -# define CONFIG_LV_USE_STDLIB_STRING LV_STDLIB_CUSTOM -#endif - -/******************* - * LV_USE_STDLIB_SPRINTF - *******************/ - -#ifdef CONFIG_LV_USE_BUILTIN_SPRINTF -# define CONFIG_LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN -#elif defined(CONFIG_LV_USE_CLIB_SPRINTF) -# define CONFIG_LV_USE_STDLIB_SPRINTF LV_STDLIB_CLIB -#elif defined(CONFIG_LV_USE_MICROPYTHON_SPRINTF) -# define CONFIG_LV_USE_STDLIB_SPRINTF LV_STDLIB_MICROPYTHON -#elif defined(CONFIG_LV_USE_RTTHREAD_SPRINTF) -# define CONFIG_LV_USE_STDLIB_SPRINTF LV_STDLIB_RTTHREAD -#elif defined (CONFIG_LV_USE_CUSTOM_SPRINTF) -# define CONFIG_LV_USE_STDLIB_SPRINTF LV_STDLIB_CUSTOM +#ifdef CONFIG_LV_COLOR_CHROMA_KEY_HEX +# define CONFIG_LV_COLOR_CHROMA_KEY lv_color_hex(CONFIG_LV_COLOR_CHROMA_KEY_HEX) #endif /******************* @@ -88,24 +38,16 @@ extern "C" { *******************/ #ifdef CONFIG_LV_MEM_SIZE_KILOBYTES -# if(CONFIG_LV_MEM_SIZE_KILOBYTES < 2) -# error "LV_MEM_SIZE >= 2kB is required" -# endif - # define CONFIG_LV_MEM_SIZE (CONFIG_LV_MEM_SIZE_KILOBYTES * 1024U) #endif -#ifdef CONFIG_LV_MEM_POOL_EXPAND_SIZE_KILOBYTES -# define CONFIG_LV_MEM_POOL_EXPAND_SIZE (CONFIG_LV_MEM_POOL_EXPAND_SIZE_KILOBYTES * 1024U) -#endif - /*------------------ * MONITOR POSITION *-----------------*/ #ifdef CONFIG_LV_PERF_MONITOR_ALIGN_TOP_LEFT # define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_LEFT -#elif defined(CONFIG_LV_USE_PERF_MONITOR_ALIGN_TOP_MID) +#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_TOP_MID) # define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_MID #elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_TOP_RIGHT) # define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_RIGHT @@ -125,7 +67,7 @@ extern "C" { #ifdef CONFIG_LV_MEM_MONITOR_ALIGN_TOP_LEFT # define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_LEFT -#elif defined(CONFIG_LV_USE_MEM_MONITOR_ALIGN_TOP_MID) +#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_TOP_MID) # define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_MID #elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_TOP_RIGHT) # define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_RIGHT @@ -204,8 +146,6 @@ extern "C" { # define CONFIG_LV_FONT_DEFAULT &lv_font_montserrat_28_compressed #elif defined(CONFIG_LV_FONT_DEFAULT_DEJAVU_16_PERSIAN_HEBREW) # define CONFIG_LV_FONT_DEFAULT &lv_font_dejavu_16_persian_hebrew -#elif defined(CONFIG_LV_FONT_DEFAULT_SIMSUN_14_CJK) -# define CONFIG_LV_FONT_DEFAULT &lv_font_simsun_14_cjk #elif defined(CONFIG_LV_FONT_DEFAULT_SIMSUN_16_CJK) # define CONFIG_LV_FONT_DEFAULT &lv_font_simsun_16_cjk #elif defined(CONFIG_LV_FONT_DEFAULT_UNSCII_8) @@ -235,30 +175,6 @@ extern "C" { # define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO #endif -/*------------------ - * SDL - *-----------------*/ - -#ifdef CONFIG_LV_SDL_RENDER_MODE_PARTIAL -# define CONFIG_LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL -#elif defined(CONFIG_LV_SDL_RENDER_MODE_DIRECT) -# define CONFIG_LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT -#elif defined(CONFIG_LV_SDL_RENDER_MODE_FULL) -# define CONFIG_LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_FULL -#endif - -/*------------------ - * LINUX FBDEV - *-----------------*/ - -#ifdef CONFIG_LV_LINUX_FBDEV_RENDER_MODE_PARTIAL -# define CONFIG_LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL -#elif defined(CONFIG_LV_LINUX_FBDEV_RENDER_MODE_DIRECT) -# define CONFIG_LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT -#elif defined(CONFIG_LV_LINUX_FBDEV_RENDER_MODE_FULL) -# define CONFIG_LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_FULL -#endif - #ifdef __cplusplus } /*extern "C"*/ #endif diff --git a/L3_Middlewares/LVGL/src/lv_init.c b/L3_Middlewares/LVGL/src/lv_init.c deleted file mode 100644 index a019d6e..0000000 --- a/L3_Middlewares/LVGL/src/lv_init.c +++ /dev/null @@ -1,444 +0,0 @@ -/** - * @file lv_init.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "others/sysmon/lv_sysmon_private.h" -#include "misc/lv_timer_private.h" -#include "misc/lv_profiler_builtin_private.h" -#include "misc/lv_anim_private.h" -#include "draw/lv_image_decoder_private.h" -#include "draw/lv_draw_buf_private.h" -#include "core/lv_refr_private.h" -#include "core/lv_obj_style_private.h" -#include "core/lv_group_private.h" -#include "lv_init.h" -#include "core/lv_global.h" -#include "core/lv_obj.h" -#include "display/lv_display_private.h" -#include "indev/lv_indev_private.h" -#include "layouts/lv_layout_private.h" -#include "libs/bin_decoder/lv_bin_decoder.h" -#include "libs/bmp/lv_bmp.h" -#include "libs/ffmpeg/lv_ffmpeg.h" -#include "libs/freetype/lv_freetype.h" -#include "libs/fsdrv/lv_fsdrv.h" -#include "libs/gif/lv_gif.h" -#include "libs/tjpgd/lv_tjpgd.h" -#include "libs/libjpeg_turbo/lv_libjpeg_turbo.h" -#include "libs/lodepng/lv_lodepng.h" -#include "libs/libpng/lv_libpng.h" -#include "libs/tiny_ttf/lv_tiny_ttf.h" -#include "draw/lv_draw.h" -#include "misc/lv_async.h" -#include "misc/lv_fs_private.h" -#include "widgets/span/lv_span.h" -#include "themes/simple/lv_theme_simple.h" -#include "misc/lv_fs.h" -#include "osal/lv_os_private.h" - -#if LV_USE_DRAW_VGLITE - #include "draw/nxp/vglite/lv_draw_vglite.h" -#endif -#if LV_USE_PXP - #if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP - #include "draw/nxp/pxp/lv_draw_pxp.h" - #endif -#endif -#if LV_USE_DRAW_DAVE2D - #include "draw/renesas/dave2d/lv_draw_dave2d.h" -#endif -#if LV_USE_DRAW_SDL - #include "draw/sdl/lv_draw_sdl.h" -#endif -#if LV_USE_DRAW_VG_LITE - #include "draw/vg_lite/lv_draw_vg_lite.h" -#endif -#if LV_USE_WINDOWS - #include "drivers/windows/lv_windows_context.h" -#endif - -/********************* - * DEFINES - *********************/ -#define lv_initialized LV_GLOBAL_DEFAULT()->inited -#define lv_deinit_in_progress LV_GLOBAL_DEFAULT()->deinit_in_progress - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ -#if LV_ENABLE_GLOBAL_CUSTOM == 0 - lv_global_t lv_global; -#endif - -/********************** - * MACROS - **********************/ - -#ifndef LV_GLOBAL_INIT - #define LV_GLOBAL_INIT(__GLOBAL_PTR) lv_global_init((lv_global_t *)(__GLOBAL_PTR)) -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ -static inline void lv_global_init(lv_global_t * global) -{ - LV_ASSERT_NULL(global); - - if(global == NULL) { - LV_LOG_ERROR("lv_global cannot be null"); - return; - } - - lv_memzero(global, sizeof(lv_global_t)); - - lv_ll_init(&(global->disp_ll), sizeof(lv_display_t)); - lv_ll_init(&(global->indev_ll), sizeof(lv_indev_t)); - - global->memory_zero = ZERO_MEM_SENTINEL; - global->style_refresh = true; - global->layout_count = LV_LAYOUT_LAST; - global->style_last_custom_prop_id = (uint32_t)LV_STYLE_LAST_BUILT_IN_PROP; - global->event_last_register_id = LV_EVENT_LAST; - lv_rand_set_seed(0x1234ABCD); - -#ifdef LV_LOG_PRINT_CB - void LV_LOG_PRINT_CB(lv_log_level_t, const char * txt); - global->custom_log_print_cb = LV_LOG_PRINT_CB; -#endif - -#if defined(LV_DRAW_SW_SHADOW_CACHE_SIZE) && LV_DRAW_SW_SHADOW_CACHE_SIZE > 0 - global->sw_shadow_cache.cache_size = -1; - global->sw_shadow_cache.cache_r = -1; -#endif -} - -static inline void lv_cleanup_devices(lv_global_t * global) -{ - LV_ASSERT_NULL(global); - - if(global) { - /* cleanup indev and display */ - lv_ll_clear_custom(&(global->indev_ll), (void (*)(void *)) lv_indev_delete); - lv_ll_clear_custom(&(global->disp_ll), (void (*)(void *)) lv_display_delete); - } -} - -bool lv_is_initialized(void) -{ -#if LV_ENABLE_GLOBAL_CUSTOM - if(LV_GLOBAL_DEFAULT()) return lv_initialized; - else return false; -#else - return lv_initialized; -#endif -} - -void lv_init(void) -{ - /*First initialize Garbage Collection if needed*/ -#ifdef LV_GC_INIT - LV_GC_INIT(); -#endif - - /*Do nothing if already initialized*/ - if(lv_initialized) { - LV_LOG_WARN("lv_init: already initialized"); - return; - } - - LV_LOG_INFO("begin"); - - /*Initialize members of static variable lv_global */ - LV_GLOBAL_INIT(LV_GLOBAL_DEFAULT()); - - lv_mem_init(); - - lv_draw_buf_init_handlers(); - -#if LV_USE_SPAN != 0 - lv_span_stack_init(); -#endif - -#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN - lv_profiler_builtin_config_t profiler_config; - lv_profiler_builtin_config_init(&profiler_config); - lv_profiler_builtin_init(&profiler_config); -#endif - - lv_os_init(); - - lv_timer_core_init(); - - lv_fs_init(); - - lv_layout_init(); - - lv_anim_core_init(); - - lv_group_init(); - - lv_draw_init(); - -#if LV_USE_DRAW_SW - lv_draw_sw_init(); -#endif - -#if LV_USE_DRAW_VGLITE - lv_draw_vglite_init(); -#endif - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP - lv_draw_pxp_init(); -#endif -#endif - -#if LV_USE_DRAW_DAVE2D - lv_draw_dave2d_init(); -#endif - -#if LV_USE_DRAW_SDL - lv_draw_sdl_init(); -#endif - -#if LV_USE_WINDOWS - lv_windows_platform_init(); -#endif - - lv_obj_style_init(); - - /*Initialize the screen refresh system*/ - lv_refr_init(); - -#if LV_USE_SYSMON - lv_sysmon_builtin_init(); -#endif - - lv_image_decoder_init(LV_CACHE_DEF_SIZE, LV_IMAGE_HEADER_CACHE_DEF_CNT); - lv_bin_decoder_init(); /*LVGL built-in binary image decoder*/ - -#if LV_USE_DRAW_VG_LITE - lv_draw_vg_lite_init(); -#endif - - /*Test if the IDE has UTF-8 encoding*/ - const char * txt = "Á"; - - uint8_t * txt_u8 = (uint8_t *)txt; - if(txt_u8[0] != 0xc3 || txt_u8[1] != 0x81 || txt_u8[2] != 0x00) { - LV_LOG_WARN("The strings have no UTF-8 encoding. Non-ASCII characters won't be displayed."); - } - - uint32_t endianness_test = 0x11223344; - uint8_t * endianness_test_p = (uint8_t *) &endianness_test; - bool big_endian = endianness_test_p[0] == 0x11; - - if(big_endian) { - LV_ASSERT_MSG(LV_BIG_ENDIAN_SYSTEM == 1, - "It's a big endian system but LV_BIG_ENDIAN_SYSTEM is not enabled in lv_conf.h"); - } - else { - LV_ASSERT_MSG(LV_BIG_ENDIAN_SYSTEM == 0, - "It's a little endian system but LV_BIG_ENDIAN_SYSTEM is enabled in lv_conf.h"); - } - -#if LV_USE_ASSERT_MEM_INTEGRITY - LV_LOG_WARN("Memory integrity checks are enabled via LV_USE_ASSERT_MEM_INTEGRITY which makes LVGL much slower"); -#endif - -#if LV_USE_ASSERT_OBJ - LV_LOG_WARN("Object sanity checks are enabled via LV_USE_ASSERT_OBJ which makes LVGL much slower"); -#endif - -#if LV_USE_ASSERT_STYLE - LV_LOG_WARN("Style sanity checks are enabled that uses more RAM"); -#endif - -#if LV_LOG_LEVEL == LV_LOG_LEVEL_TRACE - LV_LOG_WARN("Log level is set to 'Trace' which makes LVGL much slower"); -#endif - -#if LV_USE_FS_FATFS != '\0' - lv_fs_fatfs_init(); -#endif - -#if LV_USE_FS_STDIO != '\0' - lv_fs_stdio_init(); -#endif - -#if LV_USE_FS_POSIX != '\0' - lv_fs_posix_init(); -#endif - -#if LV_USE_FS_WIN32 != '\0' - lv_fs_win32_init(); -#endif - -#if LV_USE_FS_MEMFS - lv_fs_memfs_init(); -#endif - -#if LV_USE_FS_LITTLEFS - lv_fs_littlefs_init(); -#endif - -#if LV_USE_FS_ARDUINO_ESP_LITTLEFS - lv_fs_arduino_esp_littlefs_init(); -#endif - -#if LV_USE_FS_ARDUINO_SD - lv_fs_arduino_sd_init(); -#endif - -#if LV_USE_LODEPNG - lv_lodepng_init(); -#endif - -#if LV_USE_LIBPNG - lv_libpng_init(); -#endif - -#if LV_USE_TJPGD - lv_tjpgd_init(); -#endif - -#if LV_USE_LIBJPEG_TURBO - lv_libjpeg_turbo_init(); -#endif - -#if LV_USE_BMP - lv_bmp_init(); -#endif - - /*Make FFMPEG last because the last converter will be checked first and - *it's superior to any other */ -#if LV_USE_FFMPEG - lv_ffmpeg_init(); -#endif - -#if LV_USE_FREETYPE - /*Init freetype library*/ - lv_freetype_init(LV_FREETYPE_CACHE_FT_GLYPH_CNT); -#endif - - lv_initialized = true; - - LV_LOG_TRACE("finished"); -} - -void lv_deinit(void) -{ - /*Do nothing if already deinit*/ - if(!lv_initialized) { - LV_LOG_WARN("lv_deinit: already deinit!"); - return; - } - - if(lv_deinit_in_progress) return; - - lv_deinit_in_progress = true; - -#if LV_USE_SYSMON - lv_sysmon_builtin_deinit(); -#endif - - lv_display_set_default(NULL); - - lv_cleanup_devices(LV_GLOBAL_DEFAULT()); - -#if LV_USE_SPAN != 0 - lv_span_stack_deinit(); -#endif - -#if LV_USE_DRAW_SW - lv_draw_sw_deinit(); -#endif - -#if LV_USE_FREETYPE - lv_freetype_uninit(); -#endif - -#if LV_USE_THEME_DEFAULT - lv_theme_default_deinit(); -#endif - -#if LV_USE_THEME_SIMPLE - lv_theme_simple_deinit(); -#endif - -#if LV_USE_THEME_MONO - lv_theme_mono_deinit(); -#endif - - lv_image_decoder_deinit(); - - lv_refr_deinit(); - - lv_obj_style_deinit(); - -#if LV_USE_PXP -#if LV_USE_DRAW_PXP || LV_USE_ROTATE_PXP - lv_draw_pxp_deinit(); -#endif -#endif - -#if LV_USE_DRAW_VGLITE - lv_draw_vglite_deinit(); -#endif - -#if LV_USE_DRAW_VG_LITE - lv_draw_vg_lite_deinit(); -#endif - -#if LV_USE_DRAW_SW - lv_draw_sw_deinit(); -#endif - - lv_draw_deinit(); - - lv_group_deinit(); - - lv_anim_core_deinit(); - - lv_layout_deinit(); - - lv_fs_deinit(); - - lv_timer_core_deinit(); - -#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN - lv_profiler_builtin_uninit(); -#endif - -#if LV_USE_OBJ_ID && LV_USE_OBJ_ID_BUILTIN - lv_objid_builtin_destroy(); -#endif - - lv_mem_deinit(); - - lv_initialized = false; - - LV_LOG_INFO("lv_deinit done"); - -#if LV_USE_LOG - lv_log_register_print_cb(NULL); -#endif - -} - -/********************** - * STATIC FUNCTIONS - **********************/ diff --git a/L3_Middlewares/LVGL/src/lv_init.h b/L3_Middlewares/LVGL/src/lv_init.h deleted file mode 100644 index 0815142..0000000 --- a/L3_Middlewares/LVGL/src/lv_init.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file lv_init.h - * - */ - -#ifndef LV_INIT_H -#define LV_INIT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_conf_internal.h" -#include "misc/lv_types.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize LVGL library. - * Should be called before any other LVGL related function. - */ -void lv_init(void); - -/** - * Deinit the 'lv' library - */ -void lv_deinit(void); - -/** - * Returns whether the 'lv' library is currently initialized - */ -bool lv_is_initialized(void); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_INIT_H*/ diff --git a/L3_Middlewares/LVGL/src/lvgl.h b/L3_Middlewares/LVGL/src/lvgl.h index f49fcc7..a7db27c 100644 --- a/L3_Middlewares/LVGL/src/lvgl.h +++ b/L3_Middlewares/LVGL/src/lvgl.h @@ -13,8 +13,8 @@ extern "C" { /********************* * INCLUDES *********************/ + #include "../lvgl.h" -#include "lv_conf_internal.h" /********************* * DEFINES @@ -36,4 +36,4 @@ extern "C" { } /*extern "C"*/ #endif -#endif /* LVGL_SRC_H */ +#endif /*LVGL_SRC_H*/ diff --git a/L3_Middlewares/LVGL/src/lvgl_private.h b/L3_Middlewares/LVGL/src/lvgl_private.h deleted file mode 100644 index 8ab64e9..0000000 --- a/L3_Middlewares/LVGL/src/lvgl_private.h +++ /dev/null @@ -1,125 +0,0 @@ -/** - * @file lvgl_private.h - * - */ - -#ifndef LVGL_PRIVATE_H -#define LVGL_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "core/lv_global.h" - -#include "display/lv_display_private.h" -#include "indev/lv_indev_private.h" -#include "misc/lv_text_private.h" -#include "misc/cache/lv_cache_entry_private.h" -#include "misc/cache/lv_cache_private.h" -#include "layouts/lv_layout_private.h" -#include "stdlib/lv_mem_private.h" -#include "others/file_explorer/lv_file_explorer_private.h" -#include "others/sysmon/lv_sysmon_private.h" -#include "others/monkey/lv_monkey_private.h" -#include "others/ime/lv_ime_pinyin_private.h" -#include "others/fragment/lv_fragment_private.h" -#include "others/observer/lv_observer_private.h" -#include "libs/qrcode/lv_qrcode_private.h" -#include "libs/barcode/lv_barcode_private.h" -#include "libs/gif/lv_gif_private.h" -#include "draw/lv_draw_triangle_private.h" -#include "draw/lv_draw_private.h" -#include "draw/lv_draw_rect_private.h" -#include "draw/lv_draw_image_private.h" -#include "draw/lv_image_decoder_private.h" -#include "draw/lv_draw_label_private.h" -#include "draw/lv_draw_vector_private.h" -#include "draw/lv_draw_buf_private.h" -#include "draw/lv_draw_mask_private.h" -#include "draw/sw/lv_draw_sw_gradient_private.h" -#include "draw/sw/lv_draw_sw_private.h" -#include "draw/sw/lv_draw_sw_mask_private.h" -#include "draw/sw/blend/lv_draw_sw_blend_private.h" -#include "drivers/libinput/lv_xkb_private.h" -#include "drivers/libinput/lv_libinput_private.h" -#include "font/lv_font_fmt_txt_private.h" -#include "themes/lv_theme_private.h" -#include "core/lv_refr_private.h" -#include "core/lv_obj_style_private.h" -#include "core/lv_obj_private.h" -#include "core/lv_obj_scroll_private.h" -#include "core/lv_obj_draw_private.h" -#include "core/lv_obj_class_private.h" -#include "core/lv_group_private.h" -#include "core/lv_obj_event_private.h" -#include "misc/lv_timer_private.h" -#include "misc/lv_area_private.h" -#include "misc/lv_fs_private.h" -#include "misc/lv_profiler_builtin_private.h" -#include "misc/lv_event_private.h" -#include "misc/lv_bidi_private.h" -#include "misc/lv_rb_private.h" -#include "misc/lv_style_private.h" -#include "misc/lv_color_op_private.h" -#include "misc/lv_anim_private.h" -#include "widgets/msgbox/lv_msgbox_private.h" -#include "widgets/buttonmatrix/lv_buttonmatrix_private.h" -#include "widgets/slider/lv_slider_private.h" -#include "widgets/switch/lv_switch_private.h" -#include "widgets/calendar/lv_calendar_private.h" -#include "widgets/imagebutton/lv_imagebutton_private.h" -#include "widgets/bar/lv_bar_private.h" -#include "widgets/image/lv_image_private.h" -#include "widgets/textarea/lv_textarea_private.h" -#include "widgets/table/lv_table_private.h" -#include "widgets/checkbox/lv_checkbox_private.h" -#include "widgets/roller/lv_roller_private.h" -#include "widgets/win/lv_win_private.h" -#include "widgets/keyboard/lv_keyboard_private.h" -#include "widgets/line/lv_line_private.h" -#include "widgets/animimage/lv_animimage_private.h" -#include "widgets/dropdown/lv_dropdown_private.h" -#include "widgets/menu/lv_menu_private.h" -#include "widgets/chart/lv_chart_private.h" -#include "widgets/button/lv_button_private.h" -#include "widgets/scale/lv_scale_private.h" -#include "widgets/led/lv_led_private.h" -#include "widgets/arc/lv_arc_private.h" -#include "widgets/tileview/lv_tileview_private.h" -#include "widgets/spinbox/lv_spinbox_private.h" -#include "widgets/span/lv_span_private.h" -#include "widgets/label/lv_label_private.h" -#include "widgets/canvas/lv_canvas_private.h" -#include "widgets/tabview/lv_tabview_private.h" -#include "tick/lv_tick_private.h" -#include "stdlib/builtin/lv_tlsf_private.h" -#include "libs/rlottie/lv_rlottie_private.h" -#include "libs/ffmpeg/lv_ffmpeg_private.h" -#include "widgets/lottie/lv_lottie_private.h" -#include "osal/lv_os_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LVGL_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_cache.c b/L3_Middlewares/LVGL/src/misc/cache/lv_cache.c deleted file mode 100644 index 0518ab5..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_cache.c +++ /dev/null @@ -1,348 +0,0 @@ -/** -* @file lv_cache.c -* -*/ - -/********************* - * INCLUDES - *********************/ -#include "lv_cache.h" -#include "../../stdlib/lv_sprintf.h" -#include "../lv_assert.h" -#include "lv_cache_entry_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void cache_drop_internal_no_lock(lv_cache_t * cache, const void * key, void * user_data); -static bool cache_evict_one_internal_no_lock(lv_cache_t * cache, void * user_data); -static lv_cache_entry_t * cache_add_internal_no_lock(lv_cache_t * cache, const void * key, void * user_data); -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_cache_t * lv_cache_create(const lv_cache_class_t * cache_class, - size_t node_size, size_t max_size, - lv_cache_ops_t ops) -{ - lv_cache_t * cache = cache_class->alloc_cb(); - LV_ASSERT_MALLOC(cache); - - cache->clz = cache_class; - cache->node_size = node_size; - cache->max_size = max_size; - cache->size = 0; - cache->ops = ops; - - if(cache->clz->init_cb(cache) == false) { - LV_LOG_ERROR("Cache init failed"); - lv_free(cache); - return NULL; - } - - lv_mutex_init(&cache->lock); - - return cache; -} - -void lv_cache_destroy(lv_cache_t * cache, void * user_data) -{ - LV_ASSERT_NULL(cache); - - lv_mutex_lock(&cache->lock); - cache->clz->destroy_cb(cache, user_data); - lv_mutex_unlock(&cache->lock); - lv_mutex_delete(&cache->lock); - lv_free(cache); -} - -lv_cache_entry_t * lv_cache_acquire(lv_cache_t * cache, const void * key, void * user_data) -{ - LV_ASSERT_NULL(cache); - LV_ASSERT_NULL(key); - - LV_PROFILER_BEGIN; - - lv_mutex_lock(&cache->lock); - - if(cache->size == 0) { - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; - return NULL; - } - - lv_cache_entry_t * entry = cache->clz->get_cb(cache, key, user_data); - if(entry != NULL) { - lv_cache_entry_acquire_data(entry); - } - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; - return entry; -} -void lv_cache_release(lv_cache_t * cache, lv_cache_entry_t * entry, void * user_data) -{ - LV_ASSERT_NULL(entry); - - LV_PROFILER_BEGIN; - - lv_mutex_lock(&cache->lock); - lv_cache_entry_release_data(entry, user_data); - - if(lv_cache_entry_get_ref(entry) == 0 && lv_cache_entry_is_invalid(entry)) { - cache->ops.free_cb(lv_cache_entry_get_data(entry), user_data); - lv_cache_entry_delete(entry); - } - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; -} -lv_cache_entry_t * lv_cache_add(lv_cache_t * cache, const void * key, void * user_data) -{ - LV_ASSERT_NULL(cache); - LV_ASSERT_NULL(key); - - LV_PROFILER_BEGIN; - - lv_mutex_lock(&cache->lock); - if(cache->max_size == 0) { - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; - return NULL; - } - - lv_cache_entry_t * entry = cache_add_internal_no_lock(cache, key, user_data); - if(entry != NULL) { - lv_cache_entry_acquire_data(entry); - } - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; - return entry; -} -lv_cache_entry_t * lv_cache_acquire_or_create(lv_cache_t * cache, const void * key, void * user_data) -{ - LV_ASSERT_NULL(cache); - LV_ASSERT_NULL(key); - - LV_PROFILER_BEGIN; - - lv_mutex_lock(&cache->lock); - lv_cache_entry_t * entry = NULL; - - if(cache->size != 0) { - entry = cache->clz->get_cb(cache, key, user_data); - if(entry != NULL) { - lv_cache_entry_acquire_data(entry); - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; - return entry; - } - } - - if(cache->max_size == 0) { - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; - return NULL; - } - - entry = cache_add_internal_no_lock(cache, key, user_data); - if(entry == NULL) { - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; - return NULL; - } - bool create_res = cache->ops.create_cb(lv_cache_entry_get_data(entry), user_data); - if(create_res == false) { - cache->clz->remove_cb(cache, entry, user_data); - lv_cache_entry_delete(entry); - entry = NULL; - } - else { - lv_cache_entry_acquire_data(entry); - } - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; - return entry; -} -void lv_cache_reserve(lv_cache_t * cache, uint32_t reserved_size, void * user_data) -{ - LV_ASSERT_NULL(cache); - - LV_PROFILER_BEGIN; - - for(lv_cache_reserve_cond_res_t reserve_cond_res = cache->clz->reserve_cond_cb(cache, NULL, reserved_size, user_data); - reserve_cond_res == LV_CACHE_RESERVE_COND_NEED_VICTIM; - reserve_cond_res = cache->clz->reserve_cond_cb(cache, NULL, reserved_size, user_data)) - cache_evict_one_internal_no_lock(cache, user_data); - - LV_PROFILER_END; -} -void lv_cache_drop(lv_cache_t * cache, const void * key, void * user_data) -{ - LV_ASSERT_NULL(cache); - LV_ASSERT_NULL(key); - - LV_PROFILER_BEGIN; - - lv_mutex_lock(&cache->lock); - cache_drop_internal_no_lock(cache, key, user_data); - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; -} -bool lv_cache_evict_one(lv_cache_t * cache, void * user_data) -{ - LV_ASSERT_NULL(cache); - - LV_PROFILER_BEGIN; - - lv_mutex_lock(&cache->lock); - bool res = cache_evict_one_internal_no_lock(cache, user_data); - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; - return res; -} -void lv_cache_drop_all(lv_cache_t * cache, void * user_data) -{ - LV_ASSERT_NULL(cache); - - LV_PROFILER_BEGIN; - - lv_mutex_lock(&cache->lock); - cache->clz->drop_all_cb(cache, user_data); - lv_mutex_unlock(&cache->lock); - - LV_PROFILER_END; -} - -void lv_cache_set_max_size(lv_cache_t * cache, size_t max_size, void * user_data) -{ - LV_UNUSED(user_data); - cache->max_size = max_size; -} -size_t lv_cache_get_max_size(lv_cache_t * cache, void * user_data) -{ - LV_UNUSED(user_data); - return cache->max_size; -} -size_t lv_cache_get_size(lv_cache_t * cache, void * user_data) -{ - LV_UNUSED(user_data); - return cache->size; -} -size_t lv_cache_get_free_size(lv_cache_t * cache, void * user_data) -{ - LV_UNUSED(user_data); - return cache->max_size - cache->size; -} -bool lv_cache_is_enabled(lv_cache_t * cache) -{ - return cache->max_size > 0; -} -void lv_cache_set_compare_cb(lv_cache_t * cache, lv_cache_compare_cb_t compare_cb, void * user_data) -{ - LV_UNUSED(user_data); - cache->ops.compare_cb = compare_cb; -} -void lv_cache_set_create_cb(lv_cache_t * cache, lv_cache_create_cb_t alloc_cb, void * user_data) -{ - LV_UNUSED(user_data); - cache->ops.create_cb = alloc_cb; -} -void lv_cache_set_free_cb(lv_cache_t * cache, lv_cache_free_cb_t free_cb, void * user_data) -{ - LV_UNUSED(user_data); - cache->ops.free_cb = free_cb; -} -void lv_cache_set_name(lv_cache_t * cache, const char * name) -{ - if(cache == NULL) return; - cache->name = name; -} -const char * lv_cache_get_name(lv_cache_t * cache) -{ - return cache->name; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void cache_drop_internal_no_lock(lv_cache_t * cache, const void * key, void * user_data) -{ - lv_cache_entry_t * entry = cache->clz->get_cb(cache, key, user_data); - if(entry == NULL) { - return; - } - - if(lv_cache_entry_get_ref(entry) == 0) { - cache->clz->remove_cb(cache, entry, user_data); - cache->ops.free_cb(lv_cache_entry_get_data(entry), user_data); - lv_cache_entry_delete(entry); - } - else { - lv_cache_entry_set_invalid(entry, true); - cache->clz->remove_cb(cache, entry, user_data); - } -} - -static bool cache_evict_one_internal_no_lock(lv_cache_t * cache, void * user_data) -{ - lv_cache_entry_t * victim = cache->clz->get_victim_cb(cache, user_data); - - if(victim == NULL) { - LV_LOG_ERROR("No victim found"); - return false; - } - - cache->clz->remove_cb(cache, victim, user_data); - cache->ops.free_cb(lv_cache_entry_get_data(victim), user_data); - lv_cache_entry_delete(victim); - return true; -} - -static lv_cache_entry_t * cache_add_internal_no_lock(lv_cache_t * cache, const void * key, void * user_data) -{ - lv_cache_reserve_cond_res_t reserve_cond_res = cache->clz->reserve_cond_cb(cache, key, 0, user_data); - if(reserve_cond_res == LV_CACHE_RESERVE_COND_TOO_LARGE) { - LV_LOG_ERROR("data %p is too large that exceeds max size (%" LV_PRIu32 ")", key, cache->max_size); - return NULL; - } - - for(; reserve_cond_res == LV_CACHE_RESERVE_COND_NEED_VICTIM; - reserve_cond_res = cache->clz->reserve_cond_cb(cache, key, 0, user_data)) - if(cache_evict_one_internal_no_lock(cache, user_data) == false) - return NULL; - - lv_cache_entry_t * entry = cache->clz->add_cb(cache, key, user_data); - - return entry; -} diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_cache.h b/L3_Middlewares/LVGL/src/misc/cache/lv_cache.h deleted file mode 100644 index ab488be..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_cache.h +++ /dev/null @@ -1,230 +0,0 @@ -/** - * @file lv_cache.h - * - */ - -#ifndef LV_CACHE_H -#define LV_CACHE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_cache_entry.h" -#include "lv_cache_private.h" -#include "../lv_types.h" - -#include "lv_cache_lru_rb.h" - -#include "lv_image_cache.h" -#include "lv_image_header_cache.h" -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a cache object with the given parameters. - * @param cache_class The class of the cache. Currently only support one two builtin classes: - * - lv_cache_class_lru_rb_count for LRU-based cache with count-based eviction policy. - * - lv_cache_class_lru_rb_size for LRU-based cache with size-based eviction policy. - * @param node_size The node size is the size of the data stored in the cache.. - * @param max_size The max size is the maximum amount of memory or count that the cache can hold. - * - lv_cache_class_lru_rb_count: max_size is the maximum count of nodes in the cache. - * - lv_cache_class_lru_rb_size: max_size is the maximum size of the cache in bytes. - * @param ops A set of operations that can be performed on the cache. See lv_cache_ops_t for details. - * @return Returns a pointer to the created cache object on success, `NULL` on error. - */ -lv_cache_t * lv_cache_create(const lv_cache_class_t * cache_class, - size_t node_size, size_t max_size, - lv_cache_ops_t ops); - -/** - * Destroy a cache object. - * @param cache The cache object pointer to destroy. - * @param user_data A user data pointer that will be passed to the free callback. - */ -void lv_cache_destroy(lv_cache_t * cache, void * user_data); - -/** - * Acquire a cache entry with the given key. If entry not in cache, it will return `NULL` (not found). - * If the entry is found, it's priority will be changed by the cache's policy. And the `lv_cache_entry_t::ref_cnt` will be incremented. - * @param cache The cache object pointer to acquire the entry. - * @param key The key of the entry to acquire. - * @param user_data A user data pointer that will be passed to the create callback. - * @return Returns a pointer to the acquired cache entry on success with `lv_cache_entry_t::ref_cnt` incremented, `NULL` on error. - */ -lv_cache_entry_t * lv_cache_acquire(lv_cache_t * cache, const void * key, void * user_data); - -/** - * Acquire a cache entry with the given key. If the entry is not in the cache, it will create a new entry with the given key. - * If the entry is found, it's priority will be changed by the cache's policy. And the `lv_cache_entry_t::ref_cnt` will be incremented. - * If you want to use this API to simplify the code, you should provide a `lv_cache_ops_t::create_cb` that creates a new entry with the given key. - * This API is a combination of lv_cache_acquire() and lv_cache_add(). The effect is the same as calling lv_cache_acquire() and lv_cache_add() separately. - * And the internal impact on cache is also consistent with these two APIs. - * @param cache The cache object pointer to acquire the entry. - * @param key The key of the entry to acquire or create. - * @param user_data A user data pointer that will be passed to the create callback. - * @return Returns a pointer to the acquired or created cache entry on success with `lv_cache_entry_t::ref_cnt` incremented, `NULL` on error. - */ -lv_cache_entry_t * lv_cache_acquire_or_create(lv_cache_t * cache, const void * key, void * user_data); - -/** - * Add a new cache entry with the given key and data. If the cache is full, the cache's policy will be used to evict an entry. - * @param cache The cache object pointer to add the entry. - * @param key The key of the entry to add. - * @param user_data A user data pointer that will be passed to the create callback. - * @return Returns a pointer to the added cache entry on success with `lv_cache_entry_t::ref_cnt` incremented, `NULL` on error. - */ -lv_cache_entry_t * lv_cache_add(lv_cache_t * cache, const void * key, void * user_data); - -/** - * Release a cache entry. The `lv_cache_entry_t::ref_cnt` will be decremented. If the `lv_cache_entry_t::ref_cnt` is zero, it will issue an error. - * If the entry passed to this function is the last reference to the data and the entry is marked as invalid, the cache's policy will be used to evict the entry. - * @param cache The cache object pointer to release the entry. - * @param entry The cache entry pointer to release. - * @param user_data A user data pointer that will be passed to the free callback. - */ -void lv_cache_release(lv_cache_t * cache, lv_cache_entry_t * entry, void * user_data); - -/** - * Reserve a certain amount of memory/count in the cache. This function is useful when you want to reserve a certain amount of memory/count in advance, - * for example, when you know that you will need it later. - * When the current cache size is max than the reserved size, the function will evict entries until the reserved size is reached. - * @param cache The cache object pointer to reserve. - * @param reserved_size The amount of memory/count to reserve. - * @param user_data A user data pointer that will be passed to the free callback. - */ -void lv_cache_reserve(lv_cache_t * cache, uint32_t reserved_size, void * user_data); - -/** - * Drop a cache entry with the given key. If the entry is not in the cache, nothing will happen to it. - * If the entry is found, it will be removed from the cache and its data will be freed when the last reference to it is released. - * @note The data will not be freed immediately but when the last reference to it is released. But this entry will not be found by lv_cache_acquire(). - * If you want cache a same key again, you should use lv_cache_add() or lv_cache_acquire_or_create(). - * @param cache The cache object pointer to drop the entry. - * @param key The key of the entry to drop. - * @param user_data A user data pointer that will be passed to the free callback. - */ -void lv_cache_drop(lv_cache_t * cache, const void * key, void * user_data); - -/** - * Drop all cache entries. All entries will be removed from the cache and their data will be freed when the last reference to them is released. - * @note If some entries are still referenced by other objects, it will issue an error. And this case shouldn't happen in normal cases.. - * @param cache The cache object pointer to drop all entries. - * @param user_data A user data pointer that will be passed to the free callback. - */ -void lv_cache_drop_all(lv_cache_t * cache, void * user_data); - -/** - * Evict one entry from the cache. The eviction policy will be used to select the entry to evict. - * @param cache The cache object pointer to evict an entry. - * @param user_data A user data pointer that will be passed to the free callback. - * @return Returns true if an entry is evicted, false if no entry is evicted. - */ -bool lv_cache_evict_one(lv_cache_t * cache, void * user_data); - -/** - * Set the maximum size of the cache. - * If the current cache size is greater than the new maximum size, the cache's policy will be used to evict entries until the new maximum size is reached. - * If set to 0, the cache will be disabled. - * @note But this behavior will happen only new entries are added to the cache. - * @param cache The cache object pointer to set the maximum size. - * @param max_size The new maximum size of the cache. - * @param user_data A user data pointer that will be passed to the free callback. - */ -void lv_cache_set_max_size(lv_cache_t * cache, size_t max_size, void * user_data); - -/** - * Get the maximum size of the cache. - * @param cache The cache object pointer to get the maximum size. - * @param user_data A user data pointer that will be passed to the free callback. - * @return Returns the maximum size of the cache. - */ -size_t lv_cache_get_max_size(lv_cache_t * cache, void * user_data); - -/** - * Get the current size of the cache. - * @param cache The cache object pointer to get the current size. - * @param user_data A user data pointer that will be passed to the free callback. - * @return Returns the current size of the cache. - */ -size_t lv_cache_get_size(lv_cache_t * cache, void * user_data); - -/** - * Get the free size of the cache. - * @param cache The cache object pointer to get the free size. - * @param user_data A user data pointer that will be passed to the free callback. - * @return Returns the free size of the cache. - */ -size_t lv_cache_get_free_size(lv_cache_t * cache, void * user_data); - -/** - * Return true if the cache is enabled. - * Disabled cache means that when the max_size of the cache is 0. In this case, all cache operations will be no-op. - * @param cache The cache object pointer to check if it's disabled. - * @return Returns true if the cache is enabled, false otherwise. - */ -bool lv_cache_is_enabled(lv_cache_t * cache); - -/** - * Set the compare callback of the cache. - * @param cache The cache object pointer to set the compare callback. - * @param compare_cb The compare callback to set. - * @param user_data A user data pointer. - */ -void lv_cache_set_compare_cb(lv_cache_t * cache, lv_cache_compare_cb_t compare_cb, void * user_data); - -/** - * Set the create callback of the cache. - * @param cache The cache object pointer to set the create callback. - * @param alloc_cb The create callback to set. - * @param user_data A user data pointer. - */ -void lv_cache_set_create_cb(lv_cache_t * cache, lv_cache_create_cb_t alloc_cb, void * user_data); - -/** - * Set the free callback of the cache. - * @param cache The cache object pointer to set the free callback. - * @param free_cb The free callback to set. - * @param user_data A user data pointer. - */ -void lv_cache_set_free_cb(lv_cache_t * cache, lv_cache_free_cb_t free_cb, void * user_data); - -/** - * Give a name for a cache object. Only the pointer of the string is saved. - * @param cache The cache object pointer to set the name. - * @param name The name of the cache. - */ -void lv_cache_set_name(lv_cache_t * cache, const char * name); - -/** - * Get the name of a cache object. - * @param cache The cache object pointer to get the name. - * @return Returns the name of the cache. - */ -const char * lv_cache_get_name(lv_cache_t * cache); - -/************************* - * GLOBAL VARIABLES - *************************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /* LV_CACHE_H */ diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry.c b/L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry.c deleted file mode 100644 index e0cc664..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry.c +++ /dev/null @@ -1,167 +0,0 @@ -/** -* @file lv_cache_entry.c -* - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_cache_entry.h" -#include "../../stdlib/lv_sprintf.h" -#include "../lv_assert.h" -#include "lv_cache.h" -#include "lv_cache_entry_private.h" -#include "lv_cache_private.h" -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -struct lv_cache_entry_t { - const lv_cache_t * cache; - int32_t ref_cnt; - uint32_t node_size; - - bool is_invalid; -}; -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_cache_entry_reset_ref(lv_cache_entry_t * entry) -{ - LV_ASSERT_NULL(entry); - entry->ref_cnt = 0; -} -void lv_cache_entry_inc_ref(lv_cache_entry_t * entry) -{ - LV_ASSERT_NULL(entry); - entry->ref_cnt++; -} -void lv_cache_entry_dec_ref(lv_cache_entry_t * entry) -{ - LV_ASSERT_NULL(entry); - entry->ref_cnt--; - if(entry->ref_cnt < 0) { - LV_LOG_WARN("ref_cnt(%" LV_PRIu32 ") < 0", entry->ref_cnt); - entry->ref_cnt = 0; - } -} -int32_t lv_cache_entry_get_ref(lv_cache_entry_t * entry) -{ - LV_ASSERT_NULL(entry); - return entry->ref_cnt; -} -uint32_t lv_cache_entry_get_node_size(lv_cache_entry_t * entry) -{ - return entry->node_size; -} -void lv_cache_entry_set_node_size(lv_cache_entry_t * entry, uint32_t node_size) -{ - LV_ASSERT_NULL(entry); - entry->node_size = node_size; -} -void lv_cache_entry_set_invalid(lv_cache_entry_t * entry, bool is_invalid) -{ - LV_ASSERT_NULL(entry); - entry->is_invalid = is_invalid; -} -bool lv_cache_entry_is_invalid(lv_cache_entry_t * entry) -{ - LV_ASSERT_NULL(entry); - return entry->is_invalid; -} -void * lv_cache_entry_get_data(lv_cache_entry_t * entry) -{ - LV_ASSERT_NULL(entry); - return (uint8_t *)entry - entry->node_size; -} -void * lv_cache_entry_acquire_data(lv_cache_entry_t * entry) -{ - LV_ASSERT_NULL(entry); - - lv_cache_entry_inc_ref(entry); - return lv_cache_entry_get_data(entry); -} -void lv_cache_entry_release_data(lv_cache_entry_t * entry, void * user_data) -{ - LV_UNUSED(user_data); - - LV_ASSERT_NULL(entry); - if(lv_cache_entry_get_ref(entry) == 0) { - LV_LOG_ERROR("ref_cnt(%" LV_PRIu32 ") == 0", entry->ref_cnt); - return; - } - - lv_cache_entry_dec_ref(entry); -} -lv_cache_entry_t * lv_cache_entry_get_entry(void * data, const uint32_t node_size) -{ - LV_ASSERT_NULL(data); - return (lv_cache_entry_t *)((uint8_t *)data + node_size); -} -void lv_cache_entry_set_cache(lv_cache_entry_t * entry, const lv_cache_t * cache) -{ - LV_ASSERT_NULL(entry); - entry->cache = cache; -} -const lv_cache_t * lv_cache_entry_get_cache(const lv_cache_entry_t * entry) -{ - LV_ASSERT_NULL(entry); - return entry->cache; -} - -uint32_t lv_cache_entry_get_size(const uint32_t node_size) -{ - return node_size + sizeof(lv_cache_entry_t); -} -lv_cache_entry_t * lv_cache_entry_alloc(const uint32_t node_size, const lv_cache_t * cache) -{ - void * res = lv_malloc_zeroed(lv_cache_entry_get_size(node_size)); - LV_ASSERT_MALLOC(res) - if(res == NULL) { - LV_LOG_ERROR("malloc failed"); - return NULL; - } - lv_cache_entry_t * entry = (lv_cache_entry_t *)res; - lv_cache_entry_init(entry, cache, node_size); - return (lv_cache_entry_t *)((uint8_t *)entry + node_size); -} -void lv_cache_entry_init(lv_cache_entry_t * entry, const lv_cache_t * cache, const uint32_t node_size) -{ - LV_ASSERT_NULL(entry); - LV_ASSERT_NULL(cache); - - entry->cache = cache; - entry->node_size = node_size; - entry->ref_cnt = 0; - entry->is_invalid = false; -} -void lv_cache_entry_delete(lv_cache_entry_t * entry) -{ - LV_ASSERT_NULL(entry); - - void * data = lv_cache_entry_get_data(entry); - lv_free(data); -} -/********************** - * STATIC FUNCTIONS - **********************/ diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry.h b/L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry.h deleted file mode 100644 index 947f71d..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry.h +++ /dev/null @@ -1,114 +0,0 @@ -/** -* @file lv_cache_entry.h -* - */ - -#ifndef LV_CACHE_ENTRY_H -#define LV_CACHE_ENTRY_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../osal/lv_os.h" -#include "../lv_types.h" -#include "lv_cache_private.h" -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Get the size of a cache entry. - * @param node_size The size of the node in the cache. - * @return The size of the cache entry. - */ -uint32_t lv_cache_entry_get_size(const uint32_t node_size); - -/** - * Get the reference count of a cache entry. - * @param entry The cache entry to get the reference count of. - * @return The reference count of the cache entry. - */ -int32_t lv_cache_entry_get_ref(lv_cache_entry_t * entry); - -/** - * Get the node size of a cache entry. Which is the same size with lv_cache_entry_get_size()'s node_size parameter. - * @param entry The cache entry to get the node size of. - * @return The node size of the cache entry. - */ -uint32_t lv_cache_entry_get_node_size(lv_cache_entry_t * entry); - -/** - * Check if a cache entry is invalid. - * @param entry The cache entry to check. - * @return True: the cache entry is invalid. False: the cache entry is valid. - */ -bool lv_cache_entry_is_invalid(lv_cache_entry_t * entry); - -/** - * Get the data of a cache entry. - * @param entry The cache entry to get the data of. - * @return The pointer to the data of the cache entry. - */ -void * lv_cache_entry_get_data(lv_cache_entry_t * entry); - -/** - * Get the cache instance of a cache entry. - * @param entry The cache entry to get the cache instance of. - * @return The pointer to the cache instance of the cache entry. - */ -const lv_cache_t * lv_cache_entry_get_cache(const lv_cache_entry_t * entry); - -/** - * Get the cache entry of a data. The data should be allocated by the cache instance. - * @param data The data to get the cache entry of. - * @param node_size The size of the node in the cache. - * @return The pointer to the cache entry of the data. - */ -lv_cache_entry_t * lv_cache_entry_get_entry(void * data, const uint32_t node_size); - -/** - * Allocate a cache entry. - * @param node_size The size of the node in the cache. - * @param cache The cache instance to allocate the cache entry from. - * @return The pointer to the allocated cache entry. - */ -lv_cache_entry_t * lv_cache_entry_alloc(const uint32_t node_size, const lv_cache_t * cache); - -/** - * Initialize a cache entry. - * @param entry The cache entry to initialize. - * @param cache The cache instance to allocate the cache entry from. - * @param node_size The size of the node in the cache. - */ -void lv_cache_entry_init(lv_cache_entry_t * entry, const lv_cache_t * cache, const uint32_t node_size); - -/** - * Deallocate a cache entry. And the data of the cache entry will be freed. - * @param entry The cache entry to deallocate. - */ -void lv_cache_entry_delete(lv_cache_entry_t * entry); -/************************* - * GLOBAL VARIABLES - *************************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_CACHE_ENTRY_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry_private.h b/L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry_private.h deleted file mode 100644 index f8d41bb..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_entry_private.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file lv_cache_entry_private.h - * - */ - -#ifndef LV_CACHE_ENTRY_PRIVATE_H -#define LV_CACHE_ENTRY_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_types.h" -#include "../../osal/lv_os.h" -#include "../lv_profiler.h" -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ -void lv_cache_entry_reset_ref(lv_cache_entry_t * entry); -void lv_cache_entry_inc_ref(lv_cache_entry_t * entry); -void lv_cache_entry_dec_ref(lv_cache_entry_t * entry); -void lv_cache_entry_set_node_size(lv_cache_entry_t * entry, uint32_t node_size); -void lv_cache_entry_set_invalid(lv_cache_entry_t * entry, bool is_invalid); -void lv_cache_entry_set_cache(lv_cache_entry_t * entry, const lv_cache_t * cache); -void * lv_cache_entry_acquire_data(lv_cache_entry_t * entry); -void lv_cache_entry_release_data(lv_cache_entry_t * entry, void * user_data); -/************************* - * GLOBAL VARIABLES - *************************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /* LV_CACHE_ENTRY_PRIVATE_H */ diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_lru_rb.c b/L3_Middlewares/LVGL/src/misc/cache/lv_cache_lru_rb.c deleted file mode 100644 index 0a73102..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_lru_rb.c +++ /dev/null @@ -1,462 +0,0 @@ -/** -* @file lv_cache_lru_rb.c -* -*/ - -/***************************************************************************\ -* * -* ┏ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ┓ * -* ┏ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ┌ ─ ─ ─ ┐ * -* ┌ ─ ─ ─ ─ ─ ─ ─ ┃ ┃ Cache insert ┃ * -* ┃ RB Tree │ │Hitting│ head * -* └ ─ ─ ─ ─ ─ ─ ─ ┃ ┃ ─ ─ ─ ─ ┃ * -* ┃ ┌─┬─┬─┬─┐ ┌─────┐ * -* ┌──│◄│B│►│ │─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─┃─ ─ ╋ ─ ─▶│ B │ ┃ * -* ┃ │ └─┴─┴─┴─┘ └──▲──┘ * -* │ │ ┃ ┃ │ ┃ * -* ┃ │ │ ┌──┴──┐ * -* │ └──────┐ ┌ ─┃─ ─ ╋ ─ ─▶│ E │ ┃ * -* ┃ ▼ ┌ ─ ─│─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ └──▲──┘ * -* ┌─┬─┬─┬─┐ ▼ │ ┃ ┃ │ ┃ * -* ┃│◄│A│►│ │─ ─ ┘ ┌─┬─┬─┬─┐ │ ┌──┴──┐ * -* └─┴─┴─┴─┘ ┌───│◄│D│►│ │─ ─ ─ ─ ─ ─│─ ╋ ┐ ┃ ─ ▶│ A │ ┌ ─ ─ ─ ─ ─ ┐ ┃ * -* ┃ │ └─┴─┴─┴─┘ └──▲──┘ LRU * -* │ │ │ ┃ │ ┃ │ │ Cache │ ┃ * -* ┃ ▼ └──────┐ ┌──┴──┐ ─ ─ ─ ─ ─ ─ * -* ┌─┬─┬─┬─┐ ▼ │ ┃ └ ─┃─ ─ ▶│ D │ ┃ * -* ┃ │◄│C│►│ │─ ─ ┌─┬─┬─┬─┐ └──▲──┘ * -* └─┴─┴─┴─┘ │ │◄│E│►│ │─ ┘ ┃ ┃ │ ┃ * -* ┃ └─┴─┴─┴─┘ ┌──┴──┐ * -* │ │ ─ ╋ ─ ─┃─ ─ ▶│ C │ ┃ * -* ┃ ─ ─ ─ ─ ┼ ─ ─ ┘ └──▲──┘ * -* ▼ ┃ ┃ ┌ ─ ─│─ ─ ┐ ┃ * -* ┃ ┌─┬─┬─┬─┐ ┌──┴──┐ * -* │◄│F│►│ │─ ─┃─ ─ ╋ ─ ┼▶│ F │ │ ┃ * -* ┃ └─┴─┴─┴─┘ └─────┘ * -* ┃ ┃ └ ─ ─ ─ ─ ┘ ┃ * -* ┃ remove * -* ┃ ┃ tail ┃ * -* ┗ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ * -* * -\***************************************************************************/ - -/********************* - * INCLUDES - *********************/ -#include "lv_cache_lru_rb.h" -#include "../../stdlib/lv_sprintf.h" -#include "../../stdlib/lv_string.h" -#include "../lv_ll.h" -#include "../lv_rb_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef uint32_t (get_data_size_cb_t)(const void * data); - -struct lv_lru_rb_t { - lv_cache_t cache; - - lv_rb_t rb; - lv_ll_t ll; - - get_data_size_cb_t * get_data_size_cb; -}; -typedef struct lv_lru_rb_t lv_lru_rb_t_; -/********************** - * STATIC PROTOTYPES - **********************/ - -static void * alloc_cb(void); -static bool init_cnt_cb(lv_cache_t * cache); -static bool init_size_cb(lv_cache_t * cache); -static void destroy_cb(lv_cache_t * cache, void * user_data); - -static lv_cache_entry_t * get_cb(lv_cache_t * cache, const void * key, void * user_data); -static lv_cache_entry_t * add_cb(lv_cache_t * cache, const void * key, void * user_data); -static void remove_cb(lv_cache_t * cache, lv_cache_entry_t * entry, void * user_data); -static void drop_cb(lv_cache_t * cache, const void * key, void * user_data); -static void drop_all_cb(lv_cache_t * cache, void * user_data); -static lv_cache_entry_t * get_victim_cb(lv_cache_t * cache, void * user_data); -static lv_cache_reserve_cond_res_t reserve_cond_cb(lv_cache_t * cache, const void * key, size_t reserved_size, - void * user_data); - -static void * alloc_new_node(lv_lru_rb_t_ * lru, void * key, void * user_data); -inline static void ** get_lru_node(lv_lru_rb_t_ * lru, lv_rb_node_t * node); - -static uint32_t cnt_get_data_size_cb(const void * data); -static uint32_t size_get_data_size_cb(const void * data); - -/********************** - * GLOBAL VARIABLES - **********************/ -const lv_cache_class_t lv_cache_class_lru_rb_count = { - .alloc_cb = alloc_cb, - .init_cb = init_cnt_cb, - .destroy_cb = destroy_cb, - - .get_cb = get_cb, - .add_cb = add_cb, - .remove_cb = remove_cb, - .drop_cb = drop_cb, - .drop_all_cb = drop_all_cb, - .get_victim_cb = get_victim_cb, - .reserve_cond_cb = reserve_cond_cb -}; - -const lv_cache_class_t lv_cache_class_lru_rb_size = { - .alloc_cb = alloc_cb, - .init_cb = init_size_cb, - .destroy_cb = destroy_cb, - - .get_cb = get_cb, - .add_cb = add_cb, - .remove_cb = remove_cb, - .drop_cb = drop_cb, - .drop_all_cb = drop_all_cb, - .get_victim_cb = get_victim_cb, - .reserve_cond_cb = reserve_cond_cb -}; -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/********************** - * STATIC FUNCTIONS - **********************/ -static void * alloc_new_node(lv_lru_rb_t_ * lru, void * key, void * user_data) -{ - LV_UNUSED(user_data); - - LV_ASSERT_NULL(lru); - LV_ASSERT_NULL(key); - - if(lru == NULL || key == NULL) { - return NULL; - } - - lv_rb_node_t * node = lv_rb_insert(&lru->rb, key); - if(node == NULL) - goto FAILED_HANDLER2; - - void * data = node->data; - lv_cache_entry_t * entry = lv_cache_entry_get_entry(data, lru->cache.node_size); - lv_memcpy(data, key, lru->cache.node_size); - - void * lru_node = lv_ll_ins_head(&lru->ll); - if(lru_node == NULL) - goto FAILED_HANDLER1; - - lv_memcpy(lru_node, &node, sizeof(void *)); - lv_memcpy(get_lru_node(lru, node), &lru_node, sizeof(void *)); - - lv_cache_entry_init(entry, &lru->cache, lru->cache.node_size); - goto FAILED_HANDLER2; - -FAILED_HANDLER1: - lv_rb_drop_node(&lru->rb, node); - node = NULL; -FAILED_HANDLER2: - return node; -} - -inline static void ** get_lru_node(lv_lru_rb_t_ * lru, lv_rb_node_t * node) -{ - return (void **)((char *)node->data + lru->rb.size - sizeof(void *)); -} - -static void * alloc_cb(void) -{ - void * res = lv_malloc(sizeof(lv_lru_rb_t_)); - LV_ASSERT_MALLOC(res); - if(res == NULL) { - LV_LOG_ERROR("malloc failed"); - return NULL; - } - - lv_memzero(res, sizeof(lv_lru_rb_t_)); - return res; -} - -static bool init_cnt_cb(lv_cache_t * cache) -{ - lv_lru_rb_t_ * lru = (lv_lru_rb_t_ *)cache; - - LV_ASSERT_NULL(lru->cache.ops.compare_cb); - LV_ASSERT_NULL(lru->cache.ops.free_cb); - LV_ASSERT(lru->cache.node_size > 0); - - if(lru->cache.node_size <= 0 || lru->cache.ops.compare_cb == NULL || lru->cache.ops.free_cb == NULL) { - return false; - } - - /*add void* to store the ll node pointer*/ - if(!lv_rb_init(&lru->rb, lru->cache.ops.compare_cb, lv_cache_entry_get_size(lru->cache.node_size) + sizeof(void *))) { - return false; - } - lv_ll_init(&lru->ll, sizeof(void *)); - - lru->get_data_size_cb = cnt_get_data_size_cb; - - return true; -} - -static bool init_size_cb(lv_cache_t * cache) -{ - lv_lru_rb_t_ * lru = (lv_lru_rb_t_ *)cache; - - LV_ASSERT_NULL(lru->cache.ops.compare_cb); - LV_ASSERT_NULL(lru->cache.ops.free_cb); - LV_ASSERT(lru->cache.node_size > 0); - - if(lru->cache.node_size <= 0 || lru->cache.ops.compare_cb == NULL || lru->cache.ops.free_cb == NULL) { - return false; - } - - /*add void* to store the ll node pointer*/ - if(!lv_rb_init(&lru->rb, lru->cache.ops.compare_cb, lv_cache_entry_get_size(lru->cache.node_size) + sizeof(void *))) { - return false; - } - lv_ll_init(&lru->ll, sizeof(void *)); - - lru->get_data_size_cb = size_get_data_size_cb; - - return true; -} - -static void destroy_cb(lv_cache_t * cache, void * user_data) -{ - LV_UNUSED(user_data); - - lv_lru_rb_t_ * lru = (lv_lru_rb_t_ *)cache; - - LV_ASSERT_NULL(lru); - - if(lru == NULL) { - return; - } - - cache->clz->drop_all_cb(cache, user_data); -} - -static lv_cache_entry_t * get_cb(lv_cache_t * cache, const void * key, void * user_data) -{ - LV_UNUSED(user_data); - - lv_lru_rb_t_ * lru = (lv_lru_rb_t_ *)cache; - - LV_ASSERT_NULL(lru); - LV_ASSERT_NULL(key); - - if(lru == NULL || key == NULL) { - return NULL; - } - - /*try the first ll node first*/ - void * head = lv_ll_get_head(&lru->ll); - if(head) { - lv_rb_node_t * node = *(lv_rb_node_t **)head; - void * data = node->data; - lv_cache_entry_t * entry = lv_cache_entry_get_entry(data, cache->node_size); - if(lru->cache.ops.compare_cb(data, key) == 0) { - return entry; - } - } - - lv_rb_node_t * node = lv_rb_find(&lru->rb, key); - /*cache hit*/ - if(node) { - void * lru_node = *get_lru_node(lru, node); - head = lv_ll_get_head(&lru->ll); - lv_ll_move_before(&lru->ll, lru_node, head); - - lv_cache_entry_t * entry = lv_cache_entry_get_entry(node->data, cache->node_size); - return entry; - } - return NULL; -} - -static lv_cache_entry_t * add_cb(lv_cache_t * cache, const void * key, void * user_data) -{ - LV_UNUSED(user_data); - - lv_lru_rb_t_ * lru = (lv_lru_rb_t_ *)cache; - - LV_ASSERT_NULL(lru); - LV_ASSERT_NULL(key); - - if(lru == NULL || key == NULL) { - return NULL; - } - - lv_rb_node_t * new_node = alloc_new_node(lru, (void *)key, user_data); - if(new_node == NULL) { - return NULL; - } - - lv_cache_entry_t * entry = lv_cache_entry_get_entry(new_node->data, cache->node_size); - - cache->size += lru->get_data_size_cb(key); - - return entry; -} - -static void remove_cb(lv_cache_t * cache, lv_cache_entry_t * entry, void * user_data) -{ - LV_UNUSED(user_data); - - lv_lru_rb_t_ * lru = (lv_lru_rb_t_ *)cache; - - LV_ASSERT_NULL(lru); - LV_ASSERT_NULL(entry); - - if(lru == NULL || entry == NULL) { - return; - } - - void * data = lv_cache_entry_get_data(entry); - lv_rb_node_t * node = lv_rb_find(&lru->rb, data); - if(node == NULL) { - return; - } - - void * lru_node = *get_lru_node(lru, node); - lv_rb_remove_node(&lru->rb, node); - lv_ll_remove(&lru->ll, lru_node); - lv_free(lru_node); - - cache->size -= lru->get_data_size_cb(data); -} - -static void drop_cb(lv_cache_t * cache, const void * key, void * user_data) -{ - lv_lru_rb_t_ * lru = (lv_lru_rb_t_ *)cache; - - LV_ASSERT_NULL(lru); - LV_ASSERT_NULL(key); - - if(lru == NULL || key == NULL) { - return; - } - - lv_rb_node_t * node = lv_rb_find(&lru->rb, key); - if(node == NULL) { - return; - } - - void * data = node->data; - - lru->cache.ops.free_cb(data, user_data); - cache->size -= lru->get_data_size_cb(data); - - lv_cache_entry_t * entry = lv_cache_entry_get_entry(data, cache->node_size); - void * lru_node = *get_lru_node(lru, node); - - lv_rb_remove_node(&lru->rb, node); - lv_cache_entry_delete(entry); - - lv_ll_remove(&lru->ll, lru_node); - lv_free(lru_node); -} - -static void drop_all_cb(lv_cache_t * cache, void * user_data) -{ - lv_lru_rb_t_ * lru = (lv_lru_rb_t_ *)cache; - - LV_ASSERT_NULL(lru); - - if(lru == NULL) { - return; - } - - uint32_t used_cnt = 0; - lv_rb_node_t ** node; - LV_LL_READ(&lru->ll, node) { - /*free user handled data and do other clean up*/ - void * search_key = (*node)->data; - lv_cache_entry_t * entry = lv_cache_entry_get_entry(search_key, cache->node_size); - if(lv_cache_entry_get_ref(entry) == 0) { - lru->cache.ops.free_cb(search_key, user_data); - } - else { - LV_LOG_WARN("entry (%p) is still referenced (%" LV_PRId32 ")", (void *)entry, lv_cache_entry_get_ref(entry)); - used_cnt++; - } - } - if(used_cnt > 0) { - LV_LOG_WARN("%" LV_PRId32 " entries are still referenced", used_cnt); - } - - lv_rb_destroy(&lru->rb); - lv_ll_clear(&lru->ll); - - cache->size = 0; -} - -static lv_cache_entry_t * get_victim_cb(lv_cache_t * cache, void * user_data) -{ - LV_UNUSED(user_data); - - lv_lru_rb_t_ * lru = (lv_lru_rb_t_ *)cache; - - LV_ASSERT_NULL(lru); - - lv_rb_node_t ** tail; - LV_LL_READ_BACK(&lru->ll, tail) { - lv_rb_node_t * tail_node = *tail; - lv_cache_entry_t * entry = lv_cache_entry_get_entry(tail_node->data, cache->node_size); - if(lv_cache_entry_get_ref(entry) == 0) { - return entry; - } - } - - return NULL; -} - -static lv_cache_reserve_cond_res_t reserve_cond_cb(lv_cache_t * cache, const void * key, size_t reserved_size, - void * user_data) -{ - LV_UNUSED(user_data); - - lv_lru_rb_t_ * lru = (lv_lru_rb_t_ *)cache; - - LV_ASSERT_NULL(lru); - - if(lru == NULL) { - return LV_CACHE_RESERVE_COND_ERROR; - } - - uint32_t data_size = key ? lru->get_data_size_cb(key) : 0; - if(data_size > lru->cache.max_size) { - LV_LOG_ERROR("data size (%" LV_PRIu32 ") is larger than max size (%" LV_PRIu32 ")", data_size, lru->cache.max_size); - return LV_CACHE_RESERVE_COND_TOO_LARGE; - } - - return cache->size + reserved_size + data_size > lru->cache.max_size - ? LV_CACHE_RESERVE_COND_NEED_VICTIM - : LV_CACHE_RESERVE_COND_OK; -} - -static uint32_t cnt_get_data_size_cb(const void * data) -{ - LV_UNUSED(data); - return 1; -} - -static uint32_t size_get_data_size_cb(const void * data) -{ - lv_cache_slot_size_t * slot = (lv_cache_slot_size_t *)data; - return slot->size; -} diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_lru_rb.h b/L3_Middlewares/LVGL/src/misc/cache/lv_cache_lru_rb.h deleted file mode 100644 index c0f44f3..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_lru_rb.h +++ /dev/null @@ -1,44 +0,0 @@ -/** -* @file lv_cache_lru_rb.h -* -*/ - -#ifndef LV_CACHE_LRU_RB_H -#define LV_CACHE_LRU_RB_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_cache_entry.h" -#include "lv_cache_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/************************* - * GLOBAL VARIABLES - *************************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_cache_class_t lv_cache_class_lru_rb_count; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_cache_class_t lv_cache_class_lru_rb_size; -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_CACHE_LRU_RB_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_private.h b/L3_Middlewares/LVGL/src/misc/cache/lv_cache_private.h deleted file mode 100644 index c8ac249..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_cache_private.h +++ /dev/null @@ -1,193 +0,0 @@ -/** -* @file lv_cache_private.h -* -*/ - -#ifndef LV_CACHE_PRIVATE_H -#define LV_CACHE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_types.h" -#include "../../osal/lv_os.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * The result of the cache reserve condition callback - */ -typedef enum { - LV_CACHE_RESERVE_COND_OK, /**< The condition is met and no entries need to be evicted */ - LV_CACHE_RESERVE_COND_TOO_LARGE, /**< The condition is not met and the reserve size is too large */ - LV_CACHE_RESERVE_COND_NEED_VICTIM, /**< The condition is not met and a victim is needed to be evicted */ - LV_CACHE_RESERVE_COND_ERROR /**< An error occurred while checking the condition */ -} lv_cache_reserve_cond_res_t; - -struct lv_cache_ops_t; -struct lv_cache_t; -struct lv_cache_class_t; -struct lv_cache_entry_t; - -typedef struct lv_cache_ops_t lv_cache_ops_t; -typedef struct lv_cache_t lv_cache_t; -typedef struct lv_cache_class_t lv_cache_class_t; -typedef struct lv_cache_entry_t lv_cache_entry_t; - -typedef int8_t lv_cache_compare_res_t; -typedef bool (*lv_cache_create_cb_t)(void * node, void * user_data); -typedef void (*lv_cache_free_cb_t)(void * node, void * user_data); -typedef lv_cache_compare_res_t (*lv_cache_compare_cb_t)(const void * a, const void * b); - -/** - * The cache instance allocation function, used by the cache class to allocate memory for cache instances. - * @return It should return a pointer to the allocated instance. - */ -typedef void * (*lv_cache_alloc_cb_t)(void); - -/** - * The cache instance initialization function, used by the cache class to initialize the cache instance. - * @return It should return true if the initialization is successful, false otherwise. - */ -typedef bool (*lv_cache_init_cb_t)(lv_cache_t * cache); - -/** - * The cache instance destruction function, used by the cache class to destroy the cache instance. - */ -typedef void (*lv_cache_destroy_cb_t)(lv_cache_t * cache, void * user_data); - -/** - * The cache get function, used by the cache class to get a cache entry by its key. - * @return `NULL` if the key is not found. - */ -typedef lv_cache_entry_t * (*lv_cache_get_cb_t)(lv_cache_t * cache, const void * key, void * user_data); - -/** - * The cache add function, used by the cache class to add a cache entry with a given key. - * This function only cares about how to add the entry, it doesn't check if the entry already exists and doesn't care about is it a victim or not. - * @return the added cache entry, or NULL if the entry is not added. - */ -typedef lv_cache_entry_t * (*lv_cache_add_cb_t)(lv_cache_t * cache, const void * key, void * user_data); - -/** - * The cache remove function, used by the cache class to remove a cache entry from the cache but doesn't free the memory.. - * This function only cares about how to remove the entry, it doesn't care about is it a victim or not. - */ -typedef void (*lv_cache_remove_cb_t)(lv_cache_t * cache, lv_cache_entry_t * entry, void * user_data); - -/** - * The cache drop function, used by the cache class to remove a cache entry from the cache and free the memory. - */ -typedef void (*lv_cache_drop_cb_t)(lv_cache_t * cache, const void * key, void * user_data); - -/** - * The cache drop all function, used by the cache class to remove all cache entries from the cache and free the memory. - */ -typedef void (*lv_cache_drop_all_cb_t)(lv_cache_t * cache, void * user_data); - -/** - * The cache get victim function, used by the cache class to get a victim entry to be evicted. - */ -typedef lv_cache_entry_t * (*lv_cache_get_victim_cb)(lv_cache_t * cache, void * user_data); - -/** - * The cache reserve condition function, used by the cache class to check if a new entry can be added to the cache without exceeding its maximum size. - * See lv_cache_reserve_cond_res_t for the possible results. - */ -typedef lv_cache_reserve_cond_res_t (*lv_cache_reserve_cond_cb)(lv_cache_t * cache, const void * key, size_t size, - void * user_data); - -/** - * The cache operations struct - */ -struct lv_cache_ops_t { - lv_cache_compare_cb_t compare_cb; /**< Compare function for keys */ - lv_cache_create_cb_t create_cb; /**< Create function for nodes */ - lv_cache_free_cb_t free_cb; /**< Free function for nodes */ -}; - -/** - * The cache entry struct - */ -struct lv_cache_t { - const lv_cache_class_t * clz; /**< Cache class. There are two built-in classes: - * - lv_cache_class_lru_rb_count for LRU-based cache with count-based eviction policy. - * - lv_cache_class_lru_rb_size for LRU-based cache with size-based eviction policy. */ - - uint32_t node_size; /**< Size of a node */ - - uint32_t max_size; /**< Maximum size of the cache */ - uint32_t size; /**< Current size of the cache */ - - lv_cache_ops_t ops; /**< Cache operations struct lv_cache_ops_t */ - - lv_mutex_t lock; /**< Cache lock used to protect the cache in multithreading environments */ - - const char * name; /**< Name of the cache */ -}; - -/** - * Cache class struct for building custom cache classes - * - * Examples: - * - lv_cache_class_lru_rb_count for LRU-based cache with count-based eviction policy. - * - lv_cache_class_lru_rb_size for LRU-based cache with size-based eviction policy. - */ -struct lv_cache_class_t { - lv_cache_alloc_cb_t alloc_cb; /**< The allocation function for cache entries */ - lv_cache_init_cb_t init_cb; /**< The initialization function for cache entries */ - lv_cache_destroy_cb_t destroy_cb; /**< The destruction function for cache entries */ - - lv_cache_get_cb_t get_cb; /**< The get function for cache entries */ - lv_cache_add_cb_t add_cb; /**< The add function for cache entries */ - lv_cache_remove_cb_t remove_cb; /**< The remove function for cache entries */ - lv_cache_drop_cb_t drop_cb; /**< The drop function for cache entries */ - lv_cache_drop_all_cb_t drop_all_cb; /**< The drop all function for cache entries */ - lv_cache_get_victim_cb get_victim_cb; /**< The get victim function for cache entries */ - lv_cache_reserve_cond_cb reserve_cond_cb; /**< The reserve condition function for cache entries */ -}; - -/*----------------- - * Cache entry slot - *----------------*/ - -struct lv_cache_slot_size_t; - -typedef struct lv_cache_slot_size_t lv_cache_slot_size_t; - -/** - * Cache entry slot struct - * - * To add new fields to the cache entry, add them to a new struct and add it to the first - * field of the cache data struct. And this one is a size slot for the cache entry. - */ -struct lv_cache_slot_size_t { - size_t size; -}; -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/************************* - * GLOBAL VARIABLES - *************************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_CACHE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_image_cache.c b/L3_Middlewares/LVGL/src/misc/cache/lv_image_cache.c deleted file mode 100644 index c2ca435..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_image_cache.c +++ /dev/null @@ -1,145 +0,0 @@ -/** -* @file lv_image_cache.c -* - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../draw/lv_image_decoder_private.h" -#include "../lv_assert.h" -#include "../../core/lv_global.h" - -#include "lv_image_cache.h" -#include "lv_image_header_cache.h" - -/********************* - * DEFINES - *********************/ - -#define CACHE_NAME "IMAGE" - -#define img_cache_p (LV_GLOBAL_DEFAULT()->img_cache) -#define image_cache_draw_buf_handlers &(LV_GLOBAL_DEFAULT()->image_cache_draw_buf_handlers) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static lv_cache_compare_res_t image_cache_compare_cb(const lv_image_cache_data_t * lhs, - const lv_image_cache_data_t * rhs); -static void image_cache_free_cb(lv_image_cache_data_t * entry, void * user_data); - -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_image_cache_init(uint32_t size) -{ - if(img_cache_p != NULL) { - return LV_RESULT_OK; - } - - img_cache_p = lv_cache_create(&lv_cache_class_lru_rb_size, - sizeof(lv_image_cache_data_t), size, (lv_cache_ops_t) { - .compare_cb = (lv_cache_compare_cb_t) image_cache_compare_cb, - .create_cb = NULL, - .free_cb = (lv_cache_free_cb_t) image_cache_free_cb, - }); - - lv_cache_set_name(img_cache_p, CACHE_NAME); - return img_cache_p != NULL ? LV_RESULT_OK : LV_RESULT_INVALID; -} - -void lv_image_cache_resize(uint32_t new_size, bool evict_now) -{ - lv_cache_set_max_size(img_cache_p, new_size, NULL); - if(evict_now) { - lv_cache_reserve(img_cache_p, new_size, NULL); - } -} - -void lv_image_cache_drop(const void * src) -{ - /*If user invalidate image, the header cache should be invalidated too.*/ - lv_image_header_cache_drop(src); - - if(src == NULL) { - lv_cache_drop_all(img_cache_p, NULL); - return; - } - - lv_image_cache_data_t search_key = { - .src = src, - .src_type = lv_image_src_get_type(src), - }; - - lv_cache_drop(img_cache_p, &search_key, NULL); -} - -bool lv_image_cache_is_enabled(void) -{ - return lv_cache_is_enabled(img_cache_p); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -inline static lv_cache_compare_res_t image_cache_common_compare(const void * lhs_src, lv_image_src_t lhs_src_type, - const void * rhs_src, lv_image_src_t rhs_src_type) -{ - if(lhs_src_type == rhs_src_type) { - if(lhs_src_type == LV_IMAGE_SRC_FILE) { - int32_t cmp_res = lv_strcmp(lhs_src, rhs_src); - if(cmp_res != 0) { - return cmp_res > 0 ? 1 : -1; - } - } - else if(lhs_src_type == LV_IMAGE_SRC_VARIABLE) { - if(lhs_src != rhs_src) { - return lhs_src > rhs_src ? 1 : -1; - } - } - return 0; - } - return lhs_src_type > rhs_src_type ? 1 : -1; -} - -static lv_cache_compare_res_t image_cache_compare_cb( - const lv_image_cache_data_t * lhs, - const lv_image_cache_data_t * rhs) -{ - return image_cache_common_compare(lhs->src, lhs->src_type, rhs->src, rhs->src_type); -} - -static void image_cache_free_cb(lv_image_cache_data_t * entry, void * user_data) -{ - LV_UNUSED(user_data); - - /* Destroy the decoded draw buffer if necessary. */ - lv_draw_buf_t * decoded = (lv_draw_buf_t *)entry->decoded; - if(lv_draw_buf_has_flag(decoded, LV_IMAGE_FLAGS_ALLOCATED)) { - lv_draw_buf_destroy(decoded); - } - - /*Free the duplicated file name*/ - if(entry->src_type == LV_IMAGE_SRC_FILE) lv_free((void *)entry->src); -} diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_image_cache.h b/L3_Middlewares/LVGL/src/misc/cache/lv_image_cache.h deleted file mode 100644 index 1900b98..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_image_cache.h +++ /dev/null @@ -1,71 +0,0 @@ -/** -* @file lv_image_cache.h -* - */ - -#ifndef LV_IMAGE_CACHE_H -#define LV_IMAGE_CACHE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" -#include "../lv_types.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize image cache. - * @param size size of the cache in bytes. - * @return LV_RESULT_OK: initialization succeeded, LV_RESULT_INVALID: failed. - */ -lv_result_t lv_image_cache_init(uint32_t size); - -/** - * Resize image cache. - * If set to 0, the cache will be disabled. - * @param new_size new size of the cache in bytes. - * @param evict_now true: evict the images should be removed by the eviction policy, false: wait for the next cache cleanup. - */ -void lv_image_cache_resize(uint32_t new_size, bool evict_now); - -/** - * Invalidate image cache. Use NULL to invalidate all images. - * @param src pointer to an image source. - */ -void lv_image_cache_drop(const void * src); - -/** - * Return true if the image cache is enabled. - * @return true: enabled, false: disabled. - */ -bool lv_image_cache_is_enabled(void); - -/************************* - * GLOBAL VARIABLES - *************************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_IMAGE_CACHE_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_image_header_cache.c b/L3_Middlewares/LVGL/src/misc/cache/lv_image_header_cache.c deleted file mode 100644 index ef124fb..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_image_header_cache.c +++ /dev/null @@ -1,133 +0,0 @@ -/** -* @file lv_image_header_cache.c -* - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../draw/lv_image_decoder_private.h" -#include "../lv_assert.h" -#include "../../core/lv_global.h" - -#include "lv_image_header_cache.h" - -/********************* - * DEFINES - *********************/ - -#define CACHE_NAME "IMAGE_HEADER" - -#define img_header_cache_p (LV_GLOBAL_DEFAULT()->img_header_cache) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static lv_cache_compare_res_t image_header_cache_compare_cb(const lv_image_header_cache_data_t * lhs, - const lv_image_header_cache_data_t * rhs); -static void image_header_cache_free_cb(lv_image_header_cache_data_t * entry, void * user_data); - -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_image_header_cache_init(uint32_t count) -{ - if(img_header_cache_p != NULL) { - return LV_RESULT_OK; - } - - img_header_cache_p = lv_cache_create(&lv_cache_class_lru_rb_count, - sizeof(lv_image_header_cache_data_t), count, (lv_cache_ops_t) { - .compare_cb = (lv_cache_compare_cb_t) image_header_cache_compare_cb, - .create_cb = NULL, - .free_cb = (lv_cache_free_cb_t) image_header_cache_free_cb - }); - - lv_cache_set_name(img_header_cache_p, CACHE_NAME); - return img_header_cache_p != NULL ? LV_RESULT_OK : LV_RESULT_INVALID; -} - -void lv_image_header_cache_resize(uint32_t count, bool evict_now) -{ - lv_cache_set_max_size(img_header_cache_p, count, NULL); - if(evict_now) { - lv_cache_reserve(img_header_cache_p, count, NULL); - } -} - -void lv_image_header_cache_drop(const void * src) -{ - if(src == NULL) { - lv_cache_drop_all(img_header_cache_p, NULL); - return; - } - - lv_image_header_cache_data_t search_key = { - .src = src, - .src_type = lv_image_src_get_type(src), - }; - - lv_cache_drop(img_header_cache_p, &search_key, NULL); -} - -bool lv_image_header_cache_is_enabled(void) -{ - return lv_cache_is_enabled(img_header_cache_p); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -inline static lv_cache_compare_res_t image_cache_common_compare(const void * lhs_src, lv_image_src_t lhs_src_type, - const void * rhs_src, lv_image_src_t rhs_src_type) -{ - if(lhs_src_type == rhs_src_type) { - if(lhs_src_type == LV_IMAGE_SRC_FILE) { - int32_t cmp_res = lv_strcmp(lhs_src, rhs_src); - if(cmp_res != 0) { - return cmp_res > 0 ? 1 : -1; - } - } - else if(lhs_src_type == LV_IMAGE_SRC_VARIABLE) { - if(lhs_src != rhs_src) { - return lhs_src > rhs_src ? 1 : -1; - } - } - return 0; - } - return lhs_src_type > rhs_src_type ? 1 : -1; -} - -static lv_cache_compare_res_t image_header_cache_compare_cb( - const lv_image_header_cache_data_t * lhs, - const lv_image_header_cache_data_t * rhs) -{ - return image_cache_common_compare(lhs->src, lhs->src_type, rhs->src, rhs->src_type); -} - -static void image_header_cache_free_cb(lv_image_header_cache_data_t * entry, void * user_data) -{ - LV_UNUSED(user_data); /*Unused*/ - - if(entry->src_type == LV_IMAGE_SRC_FILE) lv_free((void *)entry->src); -} diff --git a/L3_Middlewares/LVGL/src/misc/cache/lv_image_header_cache.h b/L3_Middlewares/LVGL/src/misc/cache/lv_image_header_cache.h deleted file mode 100644 index bcecfaf..0000000 --- a/L3_Middlewares/LVGL/src/misc/cache/lv_image_header_cache.h +++ /dev/null @@ -1,72 +0,0 @@ -/** -* @file lv_image_header_cache.h -* - */ - -#ifndef LV_IMAGE_HEADER_CACHE_H -#define LV_IMAGE_HEADER_CACHE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" -#include "../lv_types.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize image header cache. - * @param count initial size of the cache in count of image headers. - * @return LV_RESULT_OK: initialization succeeded, LV_RESULT_INVALID: failed. - */ -lv_result_t lv_image_header_cache_init(uint32_t count); - -/** - * Resize image header cache. - * If set to 0, the cache is disabled. - * @param count new max count of cached image headers. - * @param evict_now true: evict the image headers should be removed by the eviction policy, false: wait for the next cache cleanup. - */ -void lv_image_header_cache_resize(uint32_t count, bool evict_now); - -/** - * Invalidate image header cache. Use NULL to invalidate all image headers. - * It's also automatically called when an image is invalidated. - * @param src pointer to an image source. - */ -void lv_image_header_cache_drop(const void * src); - -/** - * Return true if the image header cache is enabled. - * @return true: enabled, false: disabled. - */ -bool lv_image_header_cache_is_enabled(void); - -/************************* - * GLOBAL VARIABLES - *************************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_IMAGE_HEADER_CACHE_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_anim.c b/L3_Middlewares/LVGL/src/misc/lv_anim.c index 8fc9867..4e4253a 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_anim.c +++ b/L3_Middlewares/LVGL/src/misc/lv_anim.c @@ -6,23 +6,20 @@ /********************* * INCLUDES *********************/ -#include "lv_anim_private.h" +#include "lv_anim.h" -#include "../core/lv_global.h" -#include "../tick/lv_tick.h" +#include "../hal/lv_hal_tick.h" #include "lv_assert.h" #include "lv_timer.h" #include "lv_math.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_string.h" +#include "lv_mem.h" +#include "lv_gc.h" /********************* * DEFINES *********************/ #define LV_ANIM_RESOLUTION 1024 #define LV_ANIM_RES_SHIFT 10 -#define state LV_GLOBAL_DEFAULT()->anim_state -#define anim_ll_p &(state.anim_ll) /********************** * TYPEDEFS @@ -33,49 +30,42 @@ **********************/ static void anim_timer(lv_timer_t * param); static void anim_mark_list_change(void); -static void anim_completed_handler(lv_anim_t * a); -static int32_t lv_anim_path_cubic_bezier(const lv_anim_t * a, int32_t x1, - int32_t y1, int32_t x2, int32_t y2); -static uint32_t convert_speed_to_time(uint32_t speed, int32_t start, int32_t end); -static void resolve_time(lv_anim_t * a); -static bool remove_concurrent_anims(lv_anim_t * a_current); -static void remove_anim(void * a); +static void anim_ready_handler(lv_anim_t * a); /********************** * STATIC VARIABLES **********************/ +static uint32_t last_timer_run; +static bool anim_list_changed; +static bool anim_run_round; +static lv_timer_t * _lv_anim_tmr; /********************** * MACROS **********************/ -#if LV_USE_LOG && LV_LOG_TRACE_ANIM - #define LV_TRACE_ANIM(...) LV_LOG_TRACE(__VA_ARGS__) +#if LV_LOG_TRACE_ANIM + #define TRACE_ANIM(...) LV_LOG_TRACE(__VA_ARGS__) #else - #define LV_TRACE_ANIM(...) + #define TRACE_ANIM(...) #endif + /********************** * GLOBAL FUNCTIONS **********************/ -void lv_anim_core_init(void) +void _lv_anim_core_init(void) { - lv_ll_init(anim_ll_p, sizeof(lv_anim_t)); - state.timer = lv_timer_create(anim_timer, LV_DEF_REFR_PERIOD, NULL); + _lv_ll_init(&LV_GC_ROOT(_lv_anim_ll), sizeof(lv_anim_t)); + _lv_anim_tmr = lv_timer_create(anim_timer, LV_DISP_DEF_REFR_PERIOD, NULL); anim_mark_list_change(); /*Turn off the animation timer*/ - state.anim_list_changed = false; - state.anim_run_round = false; -} - -void lv_anim_core_deinit(void) -{ - lv_anim_delete_all(); + anim_list_changed = false; } void lv_anim_init(lv_anim_t * a) { - lv_memzero(a, sizeof(lv_anim_t)); - a->duration = 500; + lv_memset_00(a, sizeof(lv_anim_t)); + a->time = 500; a->start_value = 0; a->end_value = 100; a->repeat_cnt = 1; @@ -85,18 +75,25 @@ void lv_anim_init(lv_anim_t * a) lv_anim_t * lv_anim_start(const lv_anim_t * a) { - LV_TRACE_ANIM("begin"); + TRACE_ANIM("begin"); + + /*Do not let two animations for the same 'var' with the same 'exec_cb'*/ + if(a->exec_cb != NULL) lv_anim_del(a->var, a->exec_cb); /*exec_cb == NULL would delete all animations of var*/ + + /*If the list is empty the anim timer was suspended and it's last run measure is invalid*/ + if(_lv_ll_is_empty(&LV_GC_ROOT(_lv_anim_ll))) { + last_timer_run = lv_tick_get(); + } /*Add the new animation to the animation linked list*/ - lv_anim_t * new_anim = lv_ll_ins_head(anim_ll_p); + lv_anim_t * new_anim = _lv_ll_ins_head(&LV_GC_ROOT(_lv_anim_ll)); LV_ASSERT_MALLOC(new_anim); if(new_anim == NULL) return NULL; /*Initialize the animation descriptor*/ lv_memcpy(new_anim, a, sizeof(lv_anim_t)); if(a->var == a) new_anim->var = new_anim; - new_anim->run_round = state.anim_run_round; - new_anim->last_timer_run = lv_tick_get(); + new_anim->run_round = anim_run_round; /*Set the start value*/ if(new_anim->early_apply) { @@ -104,77 +101,75 @@ lv_anim_t * lv_anim_start(const lv_anim_t * a) int32_t v_ofs = new_anim->get_value_cb(new_anim); new_anim->start_value += v_ofs; new_anim->end_value += v_ofs; - } - resolve_time(new_anim); - - /*Do not let two animations for the same 'var' with the same 'exec_cb'*/ - if(a->exec_cb || a->custom_exec_cb) remove_concurrent_anims(new_anim); - - if(new_anim->exec_cb) { - new_anim->exec_cb(new_anim->var, new_anim->start_value); - } - if(new_anim->custom_exec_cb) { - new_anim->custom_exec_cb(new_anim, new_anim->start_value); - } + if(new_anim->exec_cb && new_anim->var) new_anim->exec_cb(new_anim->var, new_anim->start_value); } /*Creating an animation changed the linked list. *It's important if it happens in a ready callback. (see `anim_timer`)*/ anim_mark_list_change(); - LV_TRACE_ANIM("finished"); + TRACE_ANIM("finished"); return new_anim; } -uint32_t lv_anim_get_playtime(const lv_anim_t * a) +uint32_t lv_anim_get_playtime(lv_anim_t * a) { - if(a->repeat_cnt == LV_ANIM_REPEAT_INFINITE) { - return LV_ANIM_PLAYTIME_INFINITE; - } + uint32_t playtime = LV_ANIM_PLAYTIME_INFINITE; - uint32_t repeat_cnt = a->repeat_cnt; - if(repeat_cnt < 1) repeat_cnt = 1; + if(a->repeat_cnt == LV_ANIM_REPEAT_INFINITE) + return playtime; + + playtime = a->time - a->act_time; + if(a->playback_now == 0) + playtime += a->playback_delay + a->playback_time; + + if(a->repeat_cnt <= 1) + return playtime; + + playtime += (a->repeat_delay + a->time + + a->playback_delay + a->playback_time) * + (a->repeat_cnt - 1); - uint32_t playtime = a->repeat_delay + a->duration + a->playback_delay + a->playback_duration; - playtime = playtime * repeat_cnt; return playtime; } -bool lv_anim_delete(void * var, lv_anim_exec_xcb_t exec_cb) +bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb) { lv_anim_t * a; - bool del_any = false; - a = lv_ll_get_head(anim_ll_p); + lv_anim_t * a_next; + bool del = false; + a = _lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)); while(a != NULL) { - bool del = false; + /*'a' might be deleted, so get the next object while 'a' is valid*/ + a_next = _lv_ll_get_next(&LV_GC_ROOT(_lv_anim_ll), a); + if((a->var == var || var == NULL) && (a->exec_cb == exec_cb || exec_cb == NULL)) { - remove_anim(a); + _lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a); + if(a->deleted_cb != NULL) a->deleted_cb(a); + lv_mem_free(a); anim_mark_list_change(); /*Read by `anim_timer`. It need to know if a delete occurred in the linked list*/ - del_any = true; del = true; } - /*Always start from the head on delete, because we don't know - *how `anim_ll_p` was changes in `a->deleted_cb` */ - a = del ? lv_ll_get_head(anim_ll_p) : lv_ll_get_next(anim_ll_p, a); + a = a_next; } - return del_any; + return del; } -void lv_anim_delete_all(void) +void lv_anim_del_all(void) { - lv_ll_clear_custom(anim_ll_p, remove_anim); + _lv_ll_clear(&LV_GC_ROOT(_lv_anim_ll)); anim_mark_list_change(); } lv_anim_t * lv_anim_get(void * var, lv_anim_exec_xcb_t exec_cb) { lv_anim_t * a; - LV_LL_READ(anim_ll_p, a) { + _LV_LL_READ(&LV_GC_ROOT(_lv_anim_ll), a) { if(a->var == var && (a->exec_cb == exec_cb || exec_cb == NULL)) { return a; } @@ -183,56 +178,28 @@ lv_anim_t * lv_anim_get(void * var, lv_anim_exec_xcb_t exec_cb) return NULL; } -lv_timer_t * lv_anim_get_timer(void) +struct _lv_timer_t * lv_anim_get_timer(void) { - return state.timer; + return _lv_anim_tmr; } uint16_t lv_anim_count_running(void) { uint16_t cnt = 0; lv_anim_t * a; - LV_LL_READ(anim_ll_p, a) cnt++; + _LV_LL_READ(&LV_GC_ROOT(_lv_anim_ll), a) cnt++; return cnt; } -uint32_t lv_anim_speed_clamped(uint32_t speed, uint32_t min_time, uint32_t max_time) -{ - - if(speed > 10000) { - LV_LOG_WARN("speed is truncated to 10000 (was %"LV_PRIu32")", speed); - speed = 10230; - } - if(min_time > 10000) { - LV_LOG_WARN("min_time is truncated to 10000 (was %"LV_PRIu32")", min_time); - min_time = 10230; - } - if(max_time > 10000) { - LV_LOG_WARN("max_time is truncated to 10000 (was %"LV_PRIu32")", max_time); - max_time = 10230; - } - - /*Lower the resolution to fit the 0.1023 range*/ - speed = (speed + 5) / 10; - min_time = (min_time + 5) / 10; - max_time = (max_time + 5) / 10; - - return 0x80000000 + (max_time << 20) + (min_time << 10) + speed; - -} - -uint32_t lv_anim_speed(uint32_t speed) -{ - return lv_anim_speed_clamped(speed, 0, 10000); -} - uint32_t lv_anim_speed_to_time(uint32_t speed, int32_t start, int32_t end) { - uint32_t d = LV_ABS(start - end); + uint32_t d = LV_ABS(start - end); uint32_t time = (d * 1000) / speed; - time = time == 0 ? 1 : time; + if(time == 0) { + time++; + } return time; } @@ -245,7 +212,7 @@ void lv_anim_refr_now(void) int32_t lv_anim_path_linear(const lv_anim_t * a) { /*Calculate the current step*/ - int32_t step = lv_map(a->act_time, 0, a->duration, 0, LV_ANIM_RESOLUTION); + int32_t step = lv_map(a->act_time, 0, a->time, 0, LV_ANIM_RESOLUTION); /*Get the new value which will be proportional to `step` *and the `start` and `end` values*/ @@ -259,31 +226,64 @@ int32_t lv_anim_path_linear(const lv_anim_t * a) int32_t lv_anim_path_ease_in(const lv_anim_t * a) { - return lv_anim_path_cubic_bezier(a, LV_BEZIER_VAL_FLOAT(0.42), LV_BEZIER_VAL_FLOAT(0), - LV_BEZIER_VAL_FLOAT(1), LV_BEZIER_VAL_FLOAT(1)); + /*Calculate the current step*/ + uint32_t t = lv_map(a->act_time, 0, a->time, 0, LV_BEZIER_VAL_MAX); + int32_t step = lv_bezier3(t, 0, 50, 100, LV_BEZIER_VAL_MAX); + + int32_t new_value; + new_value = step * (a->end_value - a->start_value); + new_value = new_value >> LV_BEZIER_VAL_SHIFT; + new_value += a->start_value; + + return new_value; } int32_t lv_anim_path_ease_out(const lv_anim_t * a) { - return lv_anim_path_cubic_bezier(a, LV_BEZIER_VAL_FLOAT(0), LV_BEZIER_VAL_FLOAT(0), - LV_BEZIER_VAL_FLOAT(0.58), LV_BEZIER_VAL_FLOAT(1)); + /*Calculate the current step*/ + uint32_t t = lv_map(a->act_time, 0, a->time, 0, LV_BEZIER_VAL_MAX); + int32_t step = lv_bezier3(t, 0, 900, 950, LV_BEZIER_VAL_MAX); + + int32_t new_value; + new_value = step * (a->end_value - a->start_value); + new_value = new_value >> LV_BEZIER_VAL_SHIFT; + new_value += a->start_value; + + return new_value; } int32_t lv_anim_path_ease_in_out(const lv_anim_t * a) { - return lv_anim_path_cubic_bezier(a, LV_BEZIER_VAL_FLOAT(0.42), LV_BEZIER_VAL_FLOAT(0), - LV_BEZIER_VAL_FLOAT(0.58), LV_BEZIER_VAL_FLOAT(1)); + /*Calculate the current step*/ + uint32_t t = lv_map(a->act_time, 0, a->time, 0, LV_BEZIER_VAL_MAX); + int32_t step = lv_bezier3(t, 0, 50, 952, LV_BEZIER_VAL_MAX); + + int32_t new_value; + new_value = step * (a->end_value - a->start_value); + new_value = new_value >> LV_BEZIER_VAL_SHIFT; + new_value += a->start_value; + + return new_value; } int32_t lv_anim_path_overshoot(const lv_anim_t * a) { - return lv_anim_path_cubic_bezier(a, 341, 0, 683, 1300); + /*Calculate the current step*/ + uint32_t t = lv_map(a->act_time, 0, a->time, 0, LV_BEZIER_VAL_MAX); + int32_t step = lv_bezier3(t, 0, 1000, 1300, LV_BEZIER_VAL_MAX); + + int32_t new_value; + new_value = step * (a->end_value - a->start_value); + new_value = new_value >> LV_BEZIER_VAL_SHIFT; + new_value += a->start_value; + + return new_value; } int32_t lv_anim_path_bounce(const lv_anim_t * a) { /*Calculate the current step*/ - int32_t t = lv_map(a->act_time, 0, a->duration, 0, LV_BEZIER_VAL_MAX); + int32_t t = lv_map(a->act_time, 0, a->time, 0, LV_BEZIER_VAL_MAX); int32_t diff = (a->end_value - a->start_value); /*3 bounces has 5 parts: 3 down and 2 up. One part is t / 5 long*/ @@ -291,38 +291,37 @@ int32_t lv_anim_path_bounce(const lv_anim_t * a) if(t < 408) { /*Go down*/ t = (t * 2500) >> LV_BEZIER_VAL_SHIFT; /*[0..1024] range*/ - t = LV_BEZIER_VAL_MAX - t; } else if(t >= 408 && t < 614) { /*First bounce back*/ t -= 408; t = t * 5; /*to [0..1024] range*/ + t = LV_BEZIER_VAL_MAX - t; diff = diff / 20; } else if(t >= 614 && t < 819) { /*Fall back*/ t -= 614; t = t * 5; /*to [0..1024] range*/ - t = LV_BEZIER_VAL_MAX - t; diff = diff / 20; } else if(t >= 819 && t < 921) { /*Second bounce back*/ t -= 819; t = t * 10; /*to [0..1024] range*/ + t = LV_BEZIER_VAL_MAX - t; diff = diff / 40; } else if(t >= 921 && t <= LV_BEZIER_VAL_MAX) { /*Fall back*/ t -= 921; t = t * 10; /*to [0..1024] range*/ - t = LV_BEZIER_VAL_MAX - t; diff = diff / 40; } if(t > LV_BEZIER_VAL_MAX) t = LV_BEZIER_VAL_MAX; if(t < 0) t = 0; - int32_t step = lv_bezier3(t, 0, 500, 800, LV_BEZIER_VAL_MAX); + int32_t step = lv_bezier3(t, LV_BEZIER_VAL_MAX, 800, 500, 0); int32_t new_value; new_value = step * diff; @@ -334,158 +333,16 @@ int32_t lv_anim_path_bounce(const lv_anim_t * a) int32_t lv_anim_path_step(const lv_anim_t * a) { - if(a->act_time >= a->duration) + if(a->act_time >= a->time) return a->end_value; else return a->start_value; } -int32_t lv_anim_path_custom_bezier3(const lv_anim_t * a) -{ - const lv_anim_bezier3_para_t * para = &a->parameter.bezier3; - return lv_anim_path_cubic_bezier(a, para->x1, para->y1, para->x2, para->y2); -} - -void lv_anim_set_var(lv_anim_t * a, void * var) -{ - a->var = var; -} - -void lv_anim_set_exec_cb(lv_anim_t * a, lv_anim_exec_xcb_t exec_cb) -{ - a->exec_cb = exec_cb; -} - -void lv_anim_set_duration(lv_anim_t * a, uint32_t duration) -{ - a->duration = duration; -} - -void lv_anim_set_time(lv_anim_t * a, uint32_t duration) -{ - lv_anim_set_duration(a, duration); -} - -void lv_anim_set_delay(lv_anim_t * a, uint32_t delay) -{ - a->act_time = -(int32_t)(delay); -} - -void lv_anim_set_values(lv_anim_t * a, int32_t start, int32_t end) -{ - a->start_value = start; - a->current_value = INT32_MIN; - a->end_value = end; -} - -void lv_anim_set_custom_exec_cb(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb) -{ - a->custom_exec_cb = exec_cb; -} - -void lv_anim_set_path_cb(lv_anim_t * a, lv_anim_path_cb_t path_cb) -{ - a->path_cb = path_cb; -} - -void lv_anim_set_start_cb(lv_anim_t * a, lv_anim_start_cb_t start_cb) -{ - a->start_cb = start_cb; -} - -void lv_anim_set_get_value_cb(lv_anim_t * a, lv_anim_get_value_cb_t get_value_cb) -{ - a->get_value_cb = get_value_cb; -} - -void lv_anim_set_completed_cb(lv_anim_t * a, lv_anim_completed_cb_t completed_cb) -{ - a->completed_cb = completed_cb; -} - -void lv_anim_set_deleted_cb(lv_anim_t * a, lv_anim_deleted_cb_t deleted_cb) -{ - a->deleted_cb = deleted_cb; -} - -void lv_anim_set_playback_duration(lv_anim_t * a, uint32_t duration) -{ - a->playback_duration = duration; -} - -void lv_anim_set_playback_time(lv_anim_t * a, uint32_t duration) -{ - lv_anim_set_playback_duration(a, duration); -} - -void lv_anim_set_playback_delay(lv_anim_t * a, uint32_t delay) -{ - a->playback_delay = delay; -} - -void lv_anim_set_repeat_count(lv_anim_t * a, uint32_t cnt) -{ - a->repeat_cnt = cnt; -} - -void lv_anim_set_repeat_delay(lv_anim_t * a, uint32_t delay) -{ - a->repeat_delay = delay; -} - -void lv_anim_set_early_apply(lv_anim_t * a, bool en) -{ - a->early_apply = en; -} - -void lv_anim_set_user_data(lv_anim_t * a, void * user_data) -{ - a->user_data = user_data; -} - -void lv_anim_set_bezier3_param(lv_anim_t * a, int16_t x1, int16_t y1, int16_t x2, int16_t y2) -{ - lv_anim_bezier3_para_t * para = &a->parameter.bezier3; - - para->x1 = x1; - para->x2 = x2; - para->y1 = y1; - para->y2 = y2; -} - -uint32_t lv_anim_get_delay(const lv_anim_t * a) -{ - return -a->act_time; -} - -uint32_t lv_anim_get_time(const lv_anim_t * a) -{ - return a->duration; -} - -uint32_t lv_anim_get_repeat_count(const lv_anim_t * a) -{ - return a->repeat_cnt; -} - -void * lv_anim_get_user_data(const lv_anim_t * a) -{ - return a->user_data; -} - -bool lv_anim_custom_delete(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb) -{ - return lv_anim_delete(a ? a->var : NULL, (lv_anim_exec_xcb_t)exec_cb); -} - -lv_anim_t * lv_anim_custom_get(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb) -{ - return lv_anim_get(a ? a->var : NULL, (lv_anim_exec_xcb_t)exec_cb); -} - /********************** * STATIC FUNCTIONS **********************/ + /** * Periodically handle the animations. * @param param unused @@ -494,46 +351,37 @@ static void anim_timer(lv_timer_t * param) { LV_UNUSED(param); + uint32_t elaps = lv_tick_elaps(last_timer_run); + /*Flip the run round*/ - state.anim_run_round = state.anim_run_round ? false : true; + anim_run_round = anim_run_round ? false : true; - lv_anim_t * a = lv_ll_get_head(anim_ll_p); + lv_anim_t * a = _lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)); while(a != NULL) { - uint32_t elaps = lv_tick_elaps(a->last_timer_run); - a->act_time += elaps; - - a->last_timer_run = lv_tick_get(); - - /*It can be set by `lv_anim_delete()` typically in `end_cb`. If set then an animation delete - * happened in `anim_completed_handler` which could make this linked list reading corrupt + /*It can be set by `lv_anim_del()` typically in `end_cb`. If set then an animation delete + * happened in `anim_ready_handler` which could make this linked list reading corrupt * because the list is changed meanwhile */ - state.anim_list_changed = false; + anim_list_changed = false; - if(a->run_round != state.anim_run_round) { - a->run_round = state.anim_run_round; /*The list readying might be reset so need to know which anim has run already*/ + if(a->run_round != anim_run_round) { + a->run_round = anim_run_round; /*The list readying might be reset so need to know which anim has run already*/ /*The animation will run now for the first time. Call `start_cb`*/ - if(!a->start_cb_called && a->act_time >= 0) { - + int32_t new_act_time = a->act_time + elaps; + if(!a->start_cb_called && a->act_time <= 0 && new_act_time >= 0) { if(a->early_apply == 0 && a->get_value_cb) { int32_t v_ofs = a->get_value_cb(a); a->start_value += v_ofs; a->end_value += v_ofs; } - - resolve_time(a); - if(a->start_cb) a->start_cb(a); a->start_cb_called = 1; - - /*Do not let two animations for the same 'var' with the same 'exec_cb'*/ - remove_concurrent_anims(a); } - + a->act_time += elaps; if(a->act_time >= 0) { - if(a->act_time > a->duration) a->act_time = a->duration; + if(a->act_time > a->time) a->act_time = a->time; int32_t new_value; new_value = a->path_cb(a); @@ -542,32 +390,32 @@ static void anim_timer(lv_timer_t * param) a->current_value = new_value; /*Apply the calculated value*/ if(a->exec_cb) a->exec_cb(a->var, new_value); - if(!state.anim_list_changed && a->custom_exec_cb) a->custom_exec_cb(a, new_value); } /*If the time is elapsed the animation is ready*/ - if(!state.anim_list_changed && a->act_time >= a->duration) { - anim_completed_handler(a); + if(a->act_time >= a->time) { + anim_ready_handler(a); } } } /*If the linked list changed due to anim. delete then it's not safe to continue *the reading of the list from here -> start from the head*/ - if(state.anim_list_changed) - a = lv_ll_get_head(anim_ll_p); + if(anim_list_changed) + a = _lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)); else - a = lv_ll_get_next(anim_ll_p, a); + a = _lv_ll_get_next(&LV_GC_ROOT(_lv_anim_ll), a); } + last_timer_run = lv_tick_get(); } /** - * Called when an animation is completed to do the necessary things + * Called when an animation is ready to do the necessary thinks * e.g. repeat, play back, delete etc. * @param a pointer to an animation descriptor */ -static void anim_completed_handler(lv_anim_t * a) +static void anim_ready_handler(lv_anim_t * a) { /*In the end of a forward anim decrement repeat cnt.*/ if(a->playback_now == 0 && a->repeat_cnt > 0 && a->repeat_cnt != LV_ANIM_REPEAT_INFINITE) { @@ -577,24 +425,24 @@ static void anim_completed_handler(lv_anim_t * a) /*Delete the animation if * - no repeat left and no play back (simple one shot animation) * - no repeat, play back is enabled and play back is ready*/ - if(a->repeat_cnt == 0 && (a->playback_duration == 0 || a->playback_now == 1)) { + if(a->repeat_cnt == 0 && (a->playback_time == 0 || a->playback_now == 1)) { /*Delete the animation from the list. - * This way the `completed_cb` will see the animations like it's animation is already deleted*/ - lv_ll_remove(anim_ll_p, a); + * This way the `ready_cb` will see the animations like it's animation is ready deleted*/ + _lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a); /*Flag that the list has changed*/ anim_mark_list_change(); /*Call the callback function at the end*/ - if(a->completed_cb != NULL) a->completed_cb(a); + if(a->ready_cb != NULL) a->ready_cb(a); if(a->deleted_cb != NULL) a->deleted_cb(a); - lv_free(a); + lv_mem_free(a); } /*If the animation is not deleted then restart it*/ else { a->act_time = -(int32_t)(a->repeat_delay); /*Restart the animation*/ /*Swap the start and end values in play back mode*/ - if(a->playback_duration != 0) { + if(a->playback_time != 0) { /*If now turning back use the 'playback_pause*/ if(a->playback_now == 0) a->act_time = -(int32_t)(a->playback_delay); @@ -604,104 +452,19 @@ static void anim_completed_handler(lv_anim_t * a) int32_t tmp = a->start_value; a->start_value = a->end_value; a->end_value = tmp; - /*Swap the time and playback_duration*/ - tmp = a->duration; - a->duration = a->playback_duration; - a->playback_duration = tmp; + /*Swap the time and playback_time*/ + tmp = a->time; + a->time = a->playback_time; + a->playback_time = tmp; } } } static void anim_mark_list_change(void) { - state.anim_list_changed = true; - if(lv_ll_get_head(anim_ll_p) == NULL) - lv_timer_pause(state.timer); + anim_list_changed = true; + if(_lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)) == NULL) + lv_timer_pause(_lv_anim_tmr); else - lv_timer_resume(state.timer); -} - -static int32_t lv_anim_path_cubic_bezier(const lv_anim_t * a, int32_t x1, int32_t y1, int32_t x2, int32_t y2) -{ - /*Calculate the current step*/ - uint32_t t = lv_map(a->act_time, 0, a->duration, 0, LV_BEZIER_VAL_MAX); - int32_t step = lv_cubic_bezier(t, x1, y1, x2, y2); - - int32_t new_value; - new_value = step * (a->end_value - a->start_value); - new_value = new_value >> LV_BEZIER_VAL_SHIFT; - new_value += a->start_value; - - return new_value; -} - -static uint32_t convert_speed_to_time(uint32_t speed_or_time, int32_t start, int32_t end) -{ - /*It was a simple time*/ - if((speed_or_time & 0x80000000) == 0) return speed_or_time; - - uint32_t d = LV_ABS(start - end); - uint32_t speed = speed_or_time & 0x3FF; - uint32_t time = (d * 100) / speed; /*Speed is in 10 units per sec*/ - uint32_t max_time = (speed_or_time >> 20) & 0x3FF; - uint32_t min_time = (speed_or_time >> 10) & 0x3FF; - - return LV_CLAMP(min_time * 10, time, max_time * 10); -} - -static void resolve_time(lv_anim_t * a) -{ - a->duration = convert_speed_to_time(a->duration, a->start_value, a->end_value); - a->playback_duration = convert_speed_to_time(a->playback_duration, a->start_value, a->end_value); - a->playback_delay = convert_speed_to_time(a->playback_delay, a->start_value, a->end_value); - a->repeat_delay = convert_speed_to_time(a->repeat_delay, a->start_value, a->end_value); -} - -/** - * Remove animations which are animating the same var with the same exec_cb - * and they are already running or they have early_apply - * @param a_current the current animation, use its var and exec_cb as reference to know what to remove - * @return true: at least one animation was delete - */ -static bool remove_concurrent_anims(lv_anim_t * a_current) -{ - if(a_current->exec_cb == NULL && a_current->custom_exec_cb == NULL) return false; - - lv_anim_t * a; - bool del_any = false; - a = lv_ll_get_head(anim_ll_p); - while(a != NULL) { - bool del = false; - /*We can't test for custom_exec_cb equality because in the MicroPython binding - *a wrapper callback is used here an the real callback data is stored in the `user_data`. - *Therefore equality check would remove all animations.*/ - if(a != a_current && - (a->act_time >= 0 || a->early_apply) && - (a->var == a_current->var) && - ((a->exec_cb && a->exec_cb == a_current->exec_cb) - /*|| (a->custom_exec_cb && a->custom_exec_cb == a_current->custom_exec_cb)*/)) { - lv_ll_remove(anim_ll_p, a); - if(a->deleted_cb != NULL) a->deleted_cb(a); - lv_free(a); - /*Read by `anim_timer`. It need to know if a delete occurred in the linked list*/ - anim_mark_list_change(); - - del_any = true; - del = true; - } - - /*Always start from the head on delete, because we don't know - *how `anim_ll_p` was changes in `a->deleted_cb` */ - a = del ? lv_ll_get_head(anim_ll_p) : lv_ll_get_next(anim_ll_p, a); - } - - return del_any; -} - -static void remove_anim(void * a) -{ - lv_anim_t * anim = a; - lv_ll_remove(anim_ll_p, a); - if(anim->deleted_cb != NULL) anim->deleted_cb(anim); - lv_free(a); + lv_timer_resume(_lv_anim_tmr); } diff --git a/L3_Middlewares/LVGL/src/misc/lv_anim.h b/L3_Middlewares/LVGL/src/misc/lv_anim.h index 0d626c8..faef727 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_anim.h +++ b/L3_Middlewares/LVGL/src/misc/lv_anim.h @@ -14,64 +14,18 @@ extern "C" { * INCLUDES *********************/ #include "../lv_conf_internal.h" -#include "lv_types.h" -#include "lv_math.h" -#include "lv_timer.h" -#include "lv_ll.h" + +#include +#include +#include /********************* * DEFINES *********************/ -#define LV_ANIM_REPEAT_INFINITE 0xFFFFFFFF +#define LV_ANIM_REPEAT_INFINITE 0xFFFF #define LV_ANIM_PLAYTIME_INFINITE 0xFFFFFFFF -/* - * Macros used to set cubic-bezier anim parameter. - * Parameters come from https://easings.net/ - * - * Usage: - * - * lv_anim_t a; - * lv_anim_init(&a); - * ... - * lv_anim_set_path_cb(&a, lv_anim_path_custom_bezier3); - * LV_ANIM_SET_EASE_IN_SINE(&a); //Set cubic-bezier anim parameter to easeInSine - * ... - * lv_anim_start(&a); - */ - -#define _PARA(a, x1, y1, x2, y2) ((a)->parameter.bezier3 = \ -(lv_anim_bezier3_para_t) { \ - LV_BEZIER_VAL_FLOAT(x1), LV_BEZIER_VAL_FLOAT(y1), \ - LV_BEZIER_VAL_FLOAT(x2), LV_BEZIER_VAL_FLOAT(y2) } \ - ) - -#define LV_ANIM_SET_EASE_IN_SINE(a) _PARA(a, 0.12, 0, 0.39, 0) -#define LV_ANIM_SET_EASE_OUT_SINE(a) _PARA(a, 0.61, 1, 0.88, 1) -#define LV_ANIM_SET_EASE_IN_OUT_SINE(a) _PARA(a, 0.37, 0, 0.63, 1) -#define LV_ANIM_SET_EASE_IN_QUAD(a) _PARA(a, 0.11, 0, 0.5, 0) -#define LV_ANIM_SET_EASE_OUT_QUAD(a) _PARA(a, 0.5, 1, 0.89, 1) -#define LV_ANIM_SET_EASE_IN_OUT_QUAD(a) _PARA(a, 0.45, 0, 0.55, 1) -#define LV_ANIM_SET_EASE_IN_CUBIC(a) _PARA(a, 0.32, 0, 0.67, 0) -#define LV_ANIM_SET_EASE_OUT_CUBIC(a) _PARA(a, 0.33, 1, 0.68, 1) -#define LV_ANIM_SET_EASE_IN_OUT_CUBIC(a) _PARA(a, 0.65, 0, 0.35, 1) -#define LV_ANIM_SET_EASE_IN_QUART(a) _PARA(a, 0.5, 0, 0.75, 0) -#define LV_ANIM_SET_EASE_OUT_QUART(a) _PARA(a, 0.25, 1, 0.5, 1) -#define LV_ANIM_SET_EASE_IN_OUT_QUART(a) _PARA(a, 0.76, 0, 0.24, 1) -#define LV_ANIM_SET_EASE_IN_QUINT(a) _PARA(a, 0.64, 0, 0.78, 0) -#define LV_ANIM_SET_EASE_OUT_QUINT(a) _PARA(a, 0.22, 1, 0.36, 1) -#define LV_ANIM_SET_EASE_IN_OUT_QUINT(a) _PARA(a, 0.83, 0, 0.17, 1) -#define LV_ANIM_SET_EASE_IN_EXPO(a) _PARA(a, 0.7, 0, 0.84, 0) -#define LV_ANIM_SET_EASE_OUT_EXPO(a) _PARA(a, 0.16, 1, 0.3, 1) -#define LV_ANIM_SET_EASE_IN_OUT_EXPO(a) _PARA(a, 0.87, 0, 0.13, 1) -#define LV_ANIM_SET_EASE_IN_CIRC(a) _PARA(a, 0.55, 0, 1, 0.45) -#define LV_ANIM_SET_EASE_OUT_CIRC(a) _PARA(a, 0, 0.55, 0.45, 1) -#define LV_ANIM_SET_EASE_IN_OUT_CIRC(a) _PARA(a, 0.85, 0, 0.15, 1) -#define LV_ANIM_SET_EASE_IN_BACK(a) _PARA(a, 0.36, 0, 0.66, -0.56) -#define LV_ANIM_SET_EASE_OUT_BACK(a) _PARA(a, 0.34, 1.56, 0.64, 1) -#define LV_ANIM_SET_EASE_IN_OUT_BACK(a) _PARA(a, 0.68, -0.6, 0.32, 1.6) - LV_EXPORT_CONST_INT(LV_ANIM_REPEAT_INFINITE); LV_EXPORT_CONST_INT(LV_ANIM_PLAYTIME_INFINITE); @@ -85,8 +39,11 @@ typedef enum { LV_ANIM_ON, } lv_anim_enable_t; +struct _lv_anim_t; +struct _lv_timer_t; + /** Get the current value during an animation*/ -typedef int32_t (*lv_anim_path_cb_t)(const lv_anim_t *); +typedef int32_t (*lv_anim_path_cb_t)(const struct _lv_anim_t *); /** Generic prototype of "animator" functions. * First parameter is the variable to animate. @@ -98,65 +55,58 @@ typedef void (*lv_anim_exec_xcb_t)(void *, int32_t); /** Same as `lv_anim_exec_xcb_t` but receives `lv_anim_t *` as the first parameter. * It's more consistent but less convenient. Might be used by binding generator functions.*/ -typedef void (*lv_anim_custom_exec_cb_t)(lv_anim_t *, int32_t); +typedef void (*lv_anim_custom_exec_cb_t)(struct _lv_anim_t *, int32_t); /** Callback to call when the animation is ready*/ -typedef void (*lv_anim_completed_cb_t)(lv_anim_t *); +typedef void (*lv_anim_ready_cb_t)(struct _lv_anim_t *); /** Callback to call when the animation really stars (considering `delay`)*/ -typedef void (*lv_anim_start_cb_t)(lv_anim_t *); +typedef void (*lv_anim_start_cb_t)(struct _lv_anim_t *); /** Callback used when the animation values are relative to get the current value*/ -typedef int32_t (*lv_anim_get_value_cb_t)(lv_anim_t *); +typedef int32_t (*lv_anim_get_value_cb_t)(struct _lv_anim_t *); /** Callback used when the animation is deleted*/ -typedef void (*lv_anim_deleted_cb_t)(lv_anim_t *); - -/** Parameter used when path is custom_bezier */ -typedef struct { - int16_t x1; - int16_t y1; - int16_t x2; - int16_t y2; -} lv_anim_bezier3_para_t; +typedef void (*lv_anim_deleted_cb_t)(struct _lv_anim_t *); /** Describes an animation*/ -struct lv_anim_t { - void * var; /**< Variable to animate*/ - lv_anim_exec_xcb_t exec_cb; /**< Function to execute to animate*/ - lv_anim_custom_exec_cb_t custom_exec_cb; /**< Function to execute to animate, - * same purpose as exec_cb but different parameters*/ - lv_anim_start_cb_t start_cb; /**< Call it when the animation is starts (considering `delay`)*/ - lv_anim_completed_cb_t completed_cb; /**< Call it when the animation is fully completed*/ - lv_anim_deleted_cb_t deleted_cb; /**< Call it when the animation is deleted*/ - lv_anim_get_value_cb_t get_value_cb; /**< Get the current value in relative mode*/ - void * user_data; /**< Custom user data*/ - lv_anim_path_cb_t path_cb; /**< Describe the path (curve) of animations*/ - int32_t start_value; /**< Start value*/ - int32_t current_value; /**< Current value*/ - int32_t end_value; /**< End value*/ - int32_t duration; /**< Animation time in ms*/ - int32_t act_time; /**< Current time in animation. Set to negative to make delay.*/ - uint32_t playback_delay; /**< Wait before play back*/ - uint32_t playback_duration; /**< Duration of playback animation*/ - uint32_t repeat_delay; /**< Wait before repeat*/ - uint32_t repeat_cnt; /**< Repeat count for the animation*/ - union lv_anim_path_para_t { - lv_anim_bezier3_para_t bezier3; /**< Parameter used when path is custom_bezier*/ - } parameter; - - /* Animation system use these - user shouldn't set */ - uint32_t last_timer_run; - uint8_t playback_now : 1; /**< Play back is in progress*/ - uint8_t run_round : 1; /**< Indicates the animation has run in this round*/ - uint8_t start_cb_called : 1; /**< Indicates that the `start_cb` was already called*/ - uint8_t early_apply : 1; /**< 1: Apply start value immediately even is there is `delay`*/ -}; +typedef struct _lv_anim_t { + void * var; /**var = var; +} /** * Set a function to animate `var` @@ -182,26 +135,30 @@ void lv_anim_set_var(lv_anim_t * a, void * var); * LVGL's built-in functions can be used. * E.g. lv_obj_set_x */ -void lv_anim_set_exec_cb(lv_anim_t * a, lv_anim_exec_xcb_t exec_cb); +static inline void lv_anim_set_exec_cb(lv_anim_t * a, lv_anim_exec_xcb_t exec_cb) +{ + a->exec_cb = exec_cb; +} /** * Set the duration of an animation * @param a pointer to an initialized `lv_anim_t` variable * @param duration duration of the animation in milliseconds */ -void lv_anim_set_duration(lv_anim_t * a, uint32_t duration); - -/** - * Legacy `lv_anim_set_time` API will be removed soon, use `lv_anim_set_duration` instead. - */ -void lv_anim_set_time(lv_anim_t * a, uint32_t duration); +static inline void lv_anim_set_time(lv_anim_t * a, uint32_t duration) +{ + a->time = duration; +} /** * Set a delay before starting the animation * @param a pointer to an initialized `lv_anim_t` variable * @param delay delay before the animation in milliseconds */ -void lv_anim_set_delay(lv_anim_t * a, uint32_t delay); +static inline void lv_anim_set_delay(lv_anim_t * a, uint32_t delay) +{ + a->act_time = -(int32_t)(delay); +} /** * Set the start and end values of an animation @@ -209,31 +166,47 @@ void lv_anim_set_delay(lv_anim_t * a, uint32_t delay); * @param start the start value * @param end the end value */ -void lv_anim_set_values(lv_anim_t * a, int32_t start, int32_t end); +static inline void lv_anim_set_values(lv_anim_t * a, int32_t start, int32_t end) +{ + a->start_value = start; + a->current_value = start; + a->end_value = end; +} /** * Similar to `lv_anim_set_exec_cb` but `lv_anim_custom_exec_cb_t` receives * `lv_anim_t * ` as its first parameter instead of `void *`. * This function might be used when LVGL is bound to other languages because * it's more consistent to have `lv_anim_t *` as first parameter. + * The variable to animate can be stored in the animation's `user_data` * @param a pointer to an initialized `lv_anim_t` variable * @param exec_cb a function to execute. */ -void lv_anim_set_custom_exec_cb(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb); +static inline void lv_anim_set_custom_exec_cb(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb) +{ + a->var = a; + a->exec_cb = (lv_anim_exec_xcb_t)exec_cb; +} /** * Set the path (curve) of the animation. * @param a pointer to an initialized `lv_anim_t` variable * @param path_cb a function to set the current value of the animation. */ -void lv_anim_set_path_cb(lv_anim_t * a, lv_anim_path_cb_t path_cb); +static inline void lv_anim_set_path_cb(lv_anim_t * a, lv_anim_path_cb_t path_cb) +{ + a->path_cb = path_cb; +} /** * Set a function call when the animation really starts (considering `delay`) * @param a pointer to an initialized `lv_anim_t` variable * @param start_cb a function call when the animation starts */ -void lv_anim_set_start_cb(lv_anim_t * a, lv_anim_start_cb_t start_cb); +static inline void lv_anim_set_start_cb(lv_anim_t * a, lv_anim_start_cb_t start_cb) +{ + a->start_cb = start_cb; +} /** * Set a function to use the current value of the variable and make start and end value @@ -241,54 +214,70 @@ void lv_anim_set_start_cb(lv_anim_t * a, lv_anim_start_cb_t start_cb); * @param a pointer to an initialized `lv_anim_t` variable * @param get_value_cb a function call when the animation starts */ -void lv_anim_set_get_value_cb(lv_anim_t * a, lv_anim_get_value_cb_t get_value_cb); +static inline void lv_anim_set_get_value_cb(lv_anim_t * a, lv_anim_get_value_cb_t get_value_cb) +{ + a->get_value_cb = get_value_cb; +} /** - * Set a function call when the animation is completed - * @param a pointer to an initialized `lv_anim_t` variable - * @param completed_cb a function call when the animation is fully completed + * Set a function call when the animation is ready + * @param a pointer to an initialized `lv_anim_t` variable + * @param ready_cb a function call when the animation is ready */ -void lv_anim_set_completed_cb(lv_anim_t * a, lv_anim_completed_cb_t completed_cb); +static inline void lv_anim_set_ready_cb(lv_anim_t * a, lv_anim_ready_cb_t ready_cb) +{ + a->ready_cb = ready_cb; +} /** * Set a function call when the animation is deleted. * @param a pointer to an initialized `lv_anim_t` variable * @param deleted_cb a function call when the animation is deleted */ -void lv_anim_set_deleted_cb(lv_anim_t * a, lv_anim_deleted_cb_t deleted_cb); +static inline void lv_anim_set_deleted_cb(lv_anim_t * a, lv_anim_deleted_cb_t deleted_cb) +{ + a->deleted_cb = deleted_cb; +} /** * Make the animation to play back to when the forward direction is ready * @param a pointer to an initialized `lv_anim_t` variable - * @param duration duration of playback animation in milliseconds. 0: disable playback - */ -void lv_anim_set_playback_duration(lv_anim_t * a, uint32_t duration); - -/** - * Legacy `lv_anim_set_playback_time` API will be removed soon, use `lv_anim_set_playback_duration` instead. + * @param time the duration of the playback animation in milliseconds. 0: disable playback */ -void lv_anim_set_playback_time(lv_anim_t * a, uint32_t duration); +static inline void lv_anim_set_playback_time(lv_anim_t * a, uint32_t time) +{ + a->playback_time = time; +} /** * Make the animation to play back to when the forward direction is ready * @param a pointer to an initialized `lv_anim_t` variable * @param delay delay in milliseconds before starting the playback animation. */ -void lv_anim_set_playback_delay(lv_anim_t * a, uint32_t delay); +static inline void lv_anim_set_playback_delay(lv_anim_t * a, uint32_t delay) +{ + a->playback_delay = delay; +} /** * Make the animation repeat itself. * @param a pointer to an initialized `lv_anim_t` variable * @param cnt repeat count or `LV_ANIM_REPEAT_INFINITE` for infinite repetition. 0: to disable repetition. */ -void lv_anim_set_repeat_count(lv_anim_t * a, uint32_t cnt); +static inline void lv_anim_set_repeat_count(lv_anim_t * a, uint16_t cnt) +{ + a->repeat_cnt = cnt; +} /** * Set a delay before repeating the animation. * @param a pointer to an initialized `lv_anim_t` variable * @param delay delay in milliseconds before repeating the animation. */ -void lv_anim_set_repeat_delay(lv_anim_t * a, uint32_t delay); +static inline void lv_anim_set_repeat_delay(lv_anim_t * a, uint32_t delay) +{ + a->repeat_delay = delay; +} /** * Set a whether the animation's should be applied immediately or only when the delay expired. @@ -296,24 +285,22 @@ void lv_anim_set_repeat_delay(lv_anim_t * a, uint32_t delay); * @param en true: apply the start value immediately in `lv_anim_start`; * false: apply the start value only when `delay` ms is elapsed and the animations really starts */ -void lv_anim_set_early_apply(lv_anim_t * a, bool en); +static inline void lv_anim_set_early_apply(lv_anim_t * a, bool en) +{ + a->early_apply = en; +} /** * Set the custom user data field of the animation. * @param a pointer to an initialized `lv_anim_t` variable * @param user_data pointer to the new user_data. */ -void lv_anim_set_user_data(lv_anim_t * a, void * user_data); - -/** - * Set parameter for cubic bezier path - * @param a pointer to an initialized `lv_anim_t` variable - * @param x1 first control point X - * @param y1 first control point Y - * @param x2 second control point X - * @param y2 second control point Y - */ -void lv_anim_set_bezier3_param(lv_anim_t * a, int16_t x1, int16_t y1, int16_t x2, int16_t y2); +#if LV_USE_USER_DATA +static inline void lv_anim_set_user_data(lv_anim_t * a, void * user_data) +{ + a->user_data = user_data; +} +#endif /** * Create an animation @@ -327,49 +314,43 @@ lv_anim_t * lv_anim_start(const lv_anim_t * a); * @param a pointer to an initialized `lv_anim_t` variable * @return delay before the animation in milliseconds */ -uint32_t lv_anim_get_delay(const lv_anim_t * a); +static inline uint32_t lv_anim_get_delay(lv_anim_t * a) +{ + return -a->act_time; +} /** * Get the time used to play the animation. * @param a pointer to an animation. * @return the play time in milliseconds. */ -uint32_t lv_anim_get_playtime(const lv_anim_t * a); - -/** - * Get the duration of an animation - * @param a pointer to an initialized `lv_anim_t` variable - * @return the duration of the animation in milliseconds - */ -uint32_t lv_anim_get_time(const lv_anim_t * a); - -/** - * Get the repeat count of the animation. - * @param a pointer to an initialized `lv_anim_t` variable - * @return the repeat count or `LV_ANIM_REPEAT_INFINITE` for infinite repetition. 0: disabled repetition. - */ -uint32_t lv_anim_get_repeat_count(const lv_anim_t * a); +uint32_t lv_anim_get_playtime(lv_anim_t * a); /** * Get the user_data field of the animation * @param a pointer to an initialized `lv_anim_t` variable * @return the pointer to the custom user_data of the animation */ -void * lv_anim_get_user_data(const lv_anim_t * a); +#if LV_USE_USER_DATA +static inline void * lv_anim_get_user_data(lv_anim_t * a) +{ + return a->user_data; +} +#endif /** - * Delete animation(s) of a variable with a given animator function + * Delete an animation of a variable with a given animator function * @param var pointer to variable * @param exec_cb a function pointer which is animating 'var', * or NULL to ignore it and delete all the animations of 'var * @return true: at least 1 animation is deleted, false: no animation is deleted */ -bool lv_anim_delete(void * var, lv_anim_exec_xcb_t exec_cb); +bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb); /** * Delete all the animations */ -void lv_anim_delete_all(void); +void lv_anim_del_all(void); /** * Get the animation of a variable and its `exec_cb`. @@ -383,7 +364,7 @@ lv_anim_t * lv_anim_get(void * var, lv_anim_exec_xcb_t exec_cb); * Get global animation refresher timer. * @return pointer to the animation refresher timer. */ -lv_timer_t * lv_anim_get_timer(void); +struct _lv_timer_t * lv_anim_get_timer(void); /** * Delete an animation by getting the animated variable from `a`. @@ -396,7 +377,10 @@ lv_timer_t * lv_anim_get_timer(void); * or NULL to ignore it and delete all the animations of 'var * @return true: at least 1 animation is deleted, false: no animation is deleted */ -bool lv_anim_custom_delete(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb); +static inline bool lv_anim_custom_del(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb) +{ + return lv_anim_del(a ? a->var : NULL, (lv_anim_exec_xcb_t)exec_cb); +} /** * Get the animation of a variable and its `exec_cb`. @@ -407,7 +391,10 @@ bool lv_anim_custom_delete(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb); * @param exec_cb a function pointer which is animating 'var', or NULL to return first matching 'var' * @return pointer to the animation. */ -lv_anim_t * lv_anim_custom_get(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb); +static inline lv_anim_t * lv_anim_custom_get(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb) +{ + return lv_anim_get(a ? a->var : NULL, (lv_anim_exec_xcb_t)exec_cb); +} /** * Get the number of currently running animations @@ -416,32 +403,11 @@ lv_anim_t * lv_anim_custom_get(lv_anim_t * a, lv_anim_custom_exec_cb_t exec_cb); uint16_t lv_anim_count_running(void); /** - * Store the speed as a special value which can be used as time in animations. - * It will be converted to time internally based on the start and end values - * @param speed the speed of the animation in with unit / sec resolution in 0..10k range - * @return a special value which can be used as an animation time - */ -uint32_t lv_anim_speed(uint32_t speed); - -/** - * Store the speed as a special value which can be used as time in animations. - * It will be converted to time internally based on the start and end values - * @param speed the speed of the animation in as unit / sec resolution in 0..10k range - * @param min_time the minimum time in 0..10k range - * @param max_time the maximum time in 0..10k range - * @return a special value in where all three values are stored and can be used as an animation time - * @note internally speed is stored as 10 unit/sec - * @note internally min/max_time are stored with 10 ms unit - * - */ -uint32_t lv_anim_speed_clamped(uint32_t speed, uint32_t min_time, uint32_t max_time); - -/** - * Calculate the time of an animation based on its speed, start and end values. - * @param speed the speed of the animation - * @param start the start value - * @param end the end value - * @return the time of the animation in milliseconds + * Calculate the time of an animation with a given speed and the start and end values + * @param speed speed of animation in unit/sec + * @param start start value of the animation + * @param end end value of the animation + * @return the required time [ms] for the animation with the given parameters */ uint32_t lv_anim_speed_to_time(uint32_t speed, int32_t start, int32_t end); @@ -503,13 +469,6 @@ int32_t lv_anim_path_bounce(const lv_anim_t * a); */ int32_t lv_anim_path_step(const lv_anim_t * a); -/** - * A custom cubic bezier animation path, need to specify cubic-parameters in a->parameter.bezier3 - * @param a pointer to an animation - * @return the current value to set - */ -int32_t lv_anim_path_custom_bezier3(const lv_anim_t * a); - /********************** * GLOBAL VARIABLES **********************/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_anim_private.h b/L3_Middlewares/LVGL/src/misc/lv_anim_private.h deleted file mode 100644 index 5c25850..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_anim_private.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file lv_anim_private.h - * - */ - -#ifndef LV_ANIM_PRIVATE_H -#define LV_ANIM_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_anim.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - bool anim_list_changed; - bool anim_run_round; - lv_timer_t * timer; - lv_ll_t anim_ll; -} lv_anim_state_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Init the animation module - */ -void lv_anim_core_init(void); - -/** - * Deinit the animation module - */ -void lv_anim_core_deinit(void); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_ANIM_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_anim_timeline.c b/L3_Middlewares/LVGL/src/misc/lv_anim_timeline.c index f9cd530..08d5321 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_anim_timeline.c +++ b/L3_Middlewares/LVGL/src/misc/lv_anim_timeline.c @@ -6,11 +6,9 @@ /********************* * INCLUDES *********************/ -#include "lv_anim_private.h" -#include "lv_assert.h" #include "lv_anim_timeline.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_string.h" +#include "lv_mem.h" +#include "lv_assert.h" /********************* * DEFINES @@ -19,30 +17,24 @@ /********************** * TYPEDEFS **********************/ + /*Data of anim_timeline_dsc*/ typedef struct { lv_anim_t anim; uint32_t start_time; - uint8_t is_started : 1; - uint8_t is_completed : 1; } lv_anim_timeline_dsc_t; /*Data of anim_timeline*/ -struct lv_anim_timeline_t { +struct _lv_anim_timeline_t { lv_anim_timeline_dsc_t * anim_dsc; /**< Dynamically allocated anim dsc array*/ uint32_t anim_dsc_cnt; /**< The length of anim dsc array*/ - uint32_t act_time; /**< Current time of the animation*/ bool reverse; /**< Reverse playback*/ - uint32_t repeat_count; /**< Repeat count*/ - uint32_t repeat_delay; /**< Wait before repeat*/ }; /********************** * STATIC PROTOTYPES **********************/ -static void anim_timeline_exec_cb(void * var, int32_t v); -static void anim_timeline_set_act_time(lv_anim_timeline_t * at, uint32_t act_time); -static int32_t anim_timeline_path_cb(const lv_anim_t * a); +static void lv_anim_timeline_virtual_exec_cb(void * var, int32_t v); /********************** * STATIC VARIABLES @@ -58,70 +50,79 @@ static int32_t anim_timeline_path_cb(const lv_anim_t * a); lv_anim_timeline_t * lv_anim_timeline_create(void) { - lv_anim_timeline_t * at = lv_malloc_zeroed(sizeof(lv_anim_timeline_t)); + lv_anim_timeline_t * at = (lv_anim_timeline_t *)lv_mem_alloc(sizeof(lv_anim_timeline_t)); + LV_ASSERT_MALLOC(at); + + if(at) lv_memset_00(at, sizeof(lv_anim_timeline_t)); + return at; } -void lv_anim_timeline_delete(lv_anim_timeline_t * at) +void lv_anim_timeline_del(lv_anim_timeline_t * at) { LV_ASSERT_NULL(at); - lv_anim_timeline_pause(at); + lv_anim_timeline_stop(at); - lv_free(at->anim_dsc); - lv_free(at); + lv_mem_free(at->anim_dsc); + lv_mem_free(at); } -void lv_anim_timeline_add(lv_anim_timeline_t * at, uint32_t start_time, const lv_anim_t * a) +void lv_anim_timeline_add(lv_anim_timeline_t * at, uint32_t start_time, lv_anim_t * a) { LV_ASSERT_NULL(at); at->anim_dsc_cnt++; - at->anim_dsc = lv_realloc(at->anim_dsc, at->anim_dsc_cnt * sizeof(lv_anim_timeline_dsc_t)); + at->anim_dsc = lv_mem_realloc(at->anim_dsc, at->anim_dsc_cnt * sizeof(lv_anim_timeline_dsc_t)); LV_ASSERT_MALLOC(at->anim_dsc); at->anim_dsc[at->anim_dsc_cnt - 1].anim = *a; at->anim_dsc[at->anim_dsc_cnt - 1].start_time = start_time; + + /*Add default var and virtual exec_cb, used to delete animation.*/ + if(a->var == NULL && a->exec_cb == NULL) { + at->anim_dsc[at->anim_dsc_cnt - 1].anim.var = at; + at->anim_dsc[at->anim_dsc_cnt - 1].anim.exec_cb = lv_anim_timeline_virtual_exec_cb; + } } uint32_t lv_anim_timeline_start(lv_anim_timeline_t * at) { LV_ASSERT_NULL(at); - uint32_t playtime = lv_anim_timeline_get_playtime(at); - uint32_t repeat = at->repeat_count; - uint32_t delay = at->repeat_delay; - uint32_t start = at->act_time; - uint32_t end = at->reverse ? 0 : playtime; - uint32_t duration = end > start ? end - start : start - end; - - if((!at->reverse && at->act_time == 0) || (at->reverse && at->act_time == playtime)) { - for(uint32_t i = 0; i < at->anim_dsc_cnt; i++) { - at->anim_dsc[i].is_started = 0; - at->anim_dsc[i].is_completed = 0; + const uint32_t playtime = lv_anim_timeline_get_playtime(at); + bool reverse = at->reverse; + + for(uint32_t i = 0; i < at->anim_dsc_cnt; i++) { + lv_anim_t a = at->anim_dsc[i].anim; + uint32_t start_time = at->anim_dsc[i].start_time; + + if(reverse) { + int32_t temp = a.start_value; + a.start_value = a.end_value; + a.end_value = temp; + lv_anim_set_delay(&a, playtime - (start_time + a.time)); } + else { + lv_anim_set_delay(&a, start_time); + } + + lv_anim_start(&a); } - lv_anim_t a; - lv_anim_init(&a); - lv_anim_set_var(&a, at); - lv_anim_set_exec_cb(&a, anim_timeline_exec_cb); - lv_anim_set_values(&a, start, end); - lv_anim_set_time(&a, duration); - lv_anim_set_path_cb(&a, anim_timeline_path_cb); - lv_anim_set_repeat_count(&a, repeat); - lv_anim_set_repeat_delay(&a, delay); - lv_anim_start(&a); return playtime; } -void lv_anim_timeline_pause(lv_anim_timeline_t * at) +void lv_anim_timeline_stop(lv_anim_timeline_t * at) { LV_ASSERT_NULL(at); - lv_anim_delete(at, anim_timeline_exec_cb); + for(uint32_t i = 0; i < at->anim_dsc_cnt; i++) { + lv_anim_t * a = &(at->anim_dsc[i].anim); + lv_anim_del(a->var, a->exec_cb); + } } void lv_anim_timeline_set_reverse(lv_anim_timeline_t * at, bool reverse) @@ -130,25 +131,36 @@ void lv_anim_timeline_set_reverse(lv_anim_timeline_t * at, bool reverse) at->reverse = reverse; } -void lv_anim_timeline_set_repeat_count(lv_anim_timeline_t * at, uint32_t cnt) +void lv_anim_timeline_set_progress(lv_anim_timeline_t * at, uint16_t progress) { LV_ASSERT_NULL(at); - at->repeat_count = cnt; -} -void lv_anim_timeline_set_repeat_delay(lv_anim_timeline_t * at, uint32_t delay) -{ - LV_ASSERT_NULL(at); - at->repeat_delay = delay; -} + const uint32_t playtime = lv_anim_timeline_get_playtime(at); + const uint32_t act_time = progress * playtime / 0xFFFF; -void lv_anim_timeline_set_progress(lv_anim_timeline_t * at, uint16_t progress) -{ - LV_ASSERT_NULL(at); + for(uint32_t i = 0; i < at->anim_dsc_cnt; i++) { + lv_anim_t * a = &(at->anim_dsc[i].anim); + + if(a->exec_cb == NULL) { + continue; + } + + uint32_t start_time = at->anim_dsc[i].start_time; + int32_t value = 0; - uint32_t playtime = lv_anim_timeline_get_playtime(at); - uint32_t act_time = lv_map(progress, 0, LV_ANIM_TIMELINE_PROGRESS_MAX, 0, playtime); - anim_timeline_set_act_time(at, act_time); + if(act_time < start_time) { + value = a->start_value; + } + else if(act_time < (start_time + a->time)) { + a->act_time = act_time - start_time; + value = a->path_cb(a); + } + else { + value = a->end_value; + } + + a->exec_cb(a->var, value); + } } uint32_t lv_anim_timeline_get_playtime(lv_anim_timeline_t * at) @@ -175,137 +187,12 @@ bool lv_anim_timeline_get_reverse(lv_anim_timeline_t * at) return at->reverse; } -uint16_t lv_anim_timeline_get_progress(lv_anim_timeline_t * at) -{ - LV_ASSERT_NULL(at); - uint32_t playtime = lv_anim_timeline_get_playtime(at); - return lv_map(at->act_time, 0, playtime, 0, LV_ANIM_TIMELINE_PROGRESS_MAX); -} - -uint32_t lv_anim_timeline_get_repeat_count(lv_anim_timeline_t * at) -{ - LV_ASSERT_NULL(at); - return at->repeat_count; -} - -uint32_t lv_anim_timeline_get_repeat_delay(lv_anim_timeline_t * at) -{ - LV_ASSERT_NULL(at); - return at->repeat_delay; -} - /********************** * STATIC FUNCTIONS **********************/ -static void anim_timeline_set_act_time(lv_anim_timeline_t * at, uint32_t act_time) -{ - at->act_time = act_time; - bool anim_timeline_is_started = (lv_anim_get(at, anim_timeline_exec_cb) != NULL); - for(uint32_t i = 0; i < at->anim_dsc_cnt; i++) { - lv_anim_timeline_dsc_t * anim_dsc = &(at->anim_dsc[i]); - lv_anim_t * a = &(anim_dsc->anim); - - if(a->exec_cb == NULL && a->custom_exec_cb == NULL) { - continue; - } - - uint32_t start_time = anim_dsc->start_time; - int32_t value = 0; - - if(act_time < start_time && a->early_apply) { - if(anim_timeline_is_started) { - if(at->reverse) { - if(!anim_dsc->is_started && a->start_cb) a->start_cb(a); - anim_dsc->is_started = 1; - } - else { - anim_dsc->is_started = 0; - } - } - - value = a->start_value; - if(a->exec_cb) a->exec_cb(a->var, value); - if(a->custom_exec_cb) a->custom_exec_cb(a, value); - - if(anim_timeline_is_started) { - if(at->reverse) { - if(!anim_dsc->is_completed && a->completed_cb) a->completed_cb(a); - anim_dsc->is_completed = 1; - } - else { - anim_dsc->is_completed = 0; - } - } - } - else if(act_time >= start_time && act_time <= (start_time + a->duration)) { - if(anim_timeline_is_started) { - if(!anim_dsc->is_started && a->start_cb) a->start_cb(a); - anim_dsc->is_started = 1; - } - - a->act_time = act_time - start_time; - value = a->path_cb(a); - if(a->exec_cb) a->exec_cb(a->var, value); - if(a->custom_exec_cb) a->custom_exec_cb(a, value); - - if(anim_timeline_is_started) { - if(at->reverse) { - if(act_time == start_time) { - if(!anim_dsc->is_completed && a->completed_cb) a->completed_cb(a); - anim_dsc->is_completed = 1; - } - else { - anim_dsc->is_completed = 0; - } - } - else { - if(act_time == (start_time + a->duration)) { - if(!anim_dsc->is_completed && a->completed_cb) a->completed_cb(a); - anim_dsc->is_completed = 1; - } - else { - anim_dsc->is_completed = 0; - } - } - } - } - else if(act_time > start_time + a->duration) { - if(anim_timeline_is_started) { - if(at->reverse) { - anim_dsc->is_started = 0; - } - else { - if(!anim_dsc->is_started && a->start_cb) a->start_cb(a); - anim_dsc->is_started = 1; - } - } - - value = a->end_value; - if(a->exec_cb) a->exec_cb(a->var, value); - if(a->custom_exec_cb) a->custom_exec_cb(a, value); - - if(anim_timeline_is_started) { - if(at->reverse) { - anim_dsc->is_completed = 0; - } - else { - if(!anim_dsc->is_completed && a->completed_cb) a->completed_cb(a); - anim_dsc->is_completed = 1; - } - } - } - } -} - -static int32_t anim_timeline_path_cb(const lv_anim_t * a) -{ - /* Directly map original timestamps to avoid loss of accuracy */ - return lv_map(a->act_time, 0, a->duration, a->start_value, a->end_value); -} - -static void anim_timeline_exec_cb(void * var, int32_t v) +static void lv_anim_timeline_virtual_exec_cb(void * var, int32_t v) { - lv_anim_timeline_t * at = var; - anim_timeline_set_act_time(at, v); + LV_UNUSED(var); + LV_UNUSED(v); } diff --git a/L3_Middlewares/LVGL/src/misc/lv_anim_timeline.h b/L3_Middlewares/LVGL/src/misc/lv_anim_timeline.h index e8fd8be..d4dd0fc 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_anim_timeline.h +++ b/L3_Middlewares/LVGL/src/misc/lv_anim_timeline.h @@ -19,13 +19,13 @@ extern "C" { * DEFINES *********************/ -#define LV_ANIM_TIMELINE_PROGRESS_MAX 0xFFFF - /********************** * TYPEDEFS **********************/ -typedef struct lv_anim_timeline_t lv_anim_timeline_t; +struct _lv_anim_timeline_t; + +typedef struct _lv_anim_timeline_t lv_anim_timeline_t; /********************** * GLOBAL PROTOTYPES @@ -41,7 +41,7 @@ lv_anim_timeline_t * lv_anim_timeline_create(void); * Delete animation timeline. * @param at pointer to the animation timeline. */ -void lv_anim_timeline_delete(lv_anim_timeline_t * at); +void lv_anim_timeline_del(lv_anim_timeline_t * at); /** * Add animation to the animation timeline. @@ -49,7 +49,7 @@ void lv_anim_timeline_delete(lv_anim_timeline_t * at); * @param start_time the time the animation started on the timeline, note that start_time will override the value of delay. * @param a pointer to an animation. */ -void lv_anim_timeline_add(lv_anim_timeline_t * at, uint32_t start_time, const lv_anim_t * a); +void lv_anim_timeline_add(lv_anim_timeline_t * at, uint32_t start_time, lv_anim_t * a); /** * Start the animation timeline. @@ -59,10 +59,10 @@ void lv_anim_timeline_add(lv_anim_timeline_t * at, uint32_t start_time, const lv uint32_t lv_anim_timeline_start(lv_anim_timeline_t * at); /** - * Pause the animation timeline. + * Stop the animation timeline. * @param at pointer to the animation timeline. */ -void lv_anim_timeline_pause(lv_anim_timeline_t * at); +void lv_anim_timeline_stop(lv_anim_timeline_t * at); /** * Set the playback direction of the animation timeline. @@ -71,20 +71,6 @@ void lv_anim_timeline_pause(lv_anim_timeline_t * at); */ void lv_anim_timeline_set_reverse(lv_anim_timeline_t * at, bool reverse); -/** - * Make the animation timeline repeat itself. - * @param at pointer to the animation timeline. - * @param cnt repeat count or `LV_ANIM_REPEAT_INFINITE` for infinite repetition. 0: to disable repetition. - */ -void lv_anim_timeline_set_repeat_count(lv_anim_timeline_t * at, uint32_t cnt); - -/** - * Set a delay before repeating the animation timeline. - * @param at pointer to the animation timeline. - * @param delay delay in milliseconds before repeating the animation timeline. - */ -void lv_anim_timeline_set_repeat_delay(lv_anim_timeline_t * at, uint32_t delay); - /** * Set the progress of the animation timeline. * @param at pointer to the animation timeline. @@ -106,25 +92,6 @@ uint32_t lv_anim_timeline_get_playtime(lv_anim_timeline_t * at); */ bool lv_anim_timeline_get_reverse(lv_anim_timeline_t * at); -/** - * Get the progress of the animation timeline. - * @param at pointer to the animation timeline. - * @return return value 0~65535 to map 0~100% animation progress. - */ -uint16_t lv_anim_timeline_get_progress(lv_anim_timeline_t * at); - -/** - * Get repeat count of the animation timeline. - * @param at pointer to the animation timeline. - */ -uint32_t lv_anim_timeline_get_repeat_count(lv_anim_timeline_t * at); - -/** - * Get repeat delay of the animation timeline. - * @param at pointer to the animation timeline. - */ -uint32_t lv_anim_timeline_get_repeat_delay(lv_anim_timeline_t * at); - /********************** * MACROS **********************/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_area.c b/L3_Middlewares/LVGL/src/misc/lv_area.c index 4410076..493b708 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_area.c +++ b/L3_Middlewares/LVGL/src/misc/lv_area.c @@ -7,9 +7,8 @@ * INCLUDES *********************/ #include "../lv_conf_internal.h" -#include "../core/lv_global.h" -#include "lv_area_private.h" +#include "lv_area.h" #include "lv_math.h" /********************* @@ -38,7 +37,15 @@ static bool lv_point_within_circle(const lv_area_t * area, const lv_point_t * p) * GLOBAL FUNCTIONS **********************/ -void lv_area_set(lv_area_t * area_p, int32_t x1, int32_t y1, int32_t x2, int32_t y2) +/** + * Initialize an area + * @param area_p pointer to an area + * @param x1 left coordinate of the area + * @param y1 top coordinate of the area + * @param x2 right coordinate of the area + * @param y2 bottom coordinate of the area + */ +void lv_area_set(lv_area_t * area_p, lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2) { area_p->x1 = x1; area_p->y1 = y1; @@ -46,26 +53,47 @@ void lv_area_set(lv_area_t * area_p, int32_t x1, int32_t y1, int32_t x2, int32_t area_p->y2 = y2; } -void lv_area_set_width(lv_area_t * area_p, int32_t w) +/** + * Set the width of an area + * @param area_p pointer to an area + * @param w the new width of the area (w == 1 makes x1 == x2) + */ +void lv_area_set_width(lv_area_t * area_p, lv_coord_t w) { area_p->x2 = area_p->x1 + w - 1; } -void lv_area_set_height(lv_area_t * area_p, int32_t h) +/** + * Set the height of an area + * @param area_p pointer to an area + * @param h the new height of the area (h == 1 makes y1 == y2) + */ +void lv_area_set_height(lv_area_t * area_p, lv_coord_t h) { area_p->y2 = area_p->y1 + h - 1; } -void lv_area_set_pos(lv_area_t * area_p, int32_t x, int32_t y) +/** + * Set the position of an area (width and height will be kept) + * @param area_p pointer to an area + * @param x the new x coordinate of the area + * @param y the new y coordinate of the area + */ +void _lv_area_set_pos(lv_area_t * area_p, lv_coord_t x, lv_coord_t y) { - int32_t w = lv_area_get_width(area_p); - int32_t h = lv_area_get_height(area_p); + lv_coord_t w = lv_area_get_width(area_p); + lv_coord_t h = lv_area_get_height(area_p); area_p->x1 = x; area_p->y1 = y; lv_area_set_width(area_p, w); lv_area_set_height(area_p, h); } +/** + * Return with area of an area (x * y) + * @param area_p pointer to an area + * @return size of area + */ uint32_t lv_area_get_size(const lv_area_t * area_p) { uint32_t size; @@ -75,7 +103,7 @@ uint32_t lv_area_get_size(const lv_area_t * area_p) return size; } -void lv_area_increase(lv_area_t * area, int32_t w_extra, int32_t h_extra) +void lv_area_increase(lv_area_t * area, lv_coord_t w_extra, lv_coord_t h_extra) { area->x1 -= w_extra; area->x2 += w_extra; @@ -83,7 +111,7 @@ void lv_area_increase(lv_area_t * area, int32_t w_extra, int32_t h_extra) area->y2 += h_extra; } -void lv_area_move(lv_area_t * area, int32_t x_ofs, int32_t y_ofs) +void lv_area_move(lv_area_t * area, lv_coord_t x_ofs, lv_coord_t y_ofs) { area->x1 += x_ofs; area->x2 += x_ofs; @@ -91,7 +119,14 @@ void lv_area_move(lv_area_t * area, int32_t x_ofs, int32_t y_ofs) area->y2 += y_ofs; } -bool lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p) +/** + * Get the common parts of two areas + * @param res_p pointer to an area, the result will be stored here + * @param a1_p pointer to the first area + * @param a2_p pointer to the second area + * @return false: the two area has NO common parts, res_p is invalid + */ +bool _lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p) { /*Get the smaller area from 'a1_p' and 'a2_p'*/ res_p->x1 = LV_MAX(a1_p->x1, a2_p->x1); @@ -108,24 +143,31 @@ bool lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_ return union_ok; } -int8_t lv_area_diff(lv_area_t res_p[], const lv_area_t * a1_p, const lv_area_t * a2_p) +/** + * Get resulting sub areas after removing the common parts of two areas from the first area + * @param res_p pointer to an array of areas with a count of 4, the resulting areas will be stored here + * @param a1_p pointer to the first area + * @param a2_p pointer to the second area + * @return number of results or -1 if no intersect + */ +int8_t _lv_area_diff(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p) { /*Areas have no common parts*/ - if(!lv_area_is_on(a1_p, a2_p)) return -1; + if(!_lv_area_is_on(a1_p, a2_p)) return -1; /*No remaining areas after removing common parts*/ - if(lv_area_is_in(a1_p, a2_p, 0)) return 0; + if(_lv_area_is_in(a1_p, a2_p, 0)) return 0; /*Result counter*/ int8_t res_c = 0; /*Get required information*/ lv_area_t n; - int32_t a1_w = lv_area_get_width(a1_p) - 1; - int32_t a1_h = lv_area_get_height(a1_p) - 1; + lv_coord_t a1_w = lv_area_get_width(a1_p) - 1; + lv_coord_t a1_h = lv_area_get_height(a1_p) - 1; /*Compute top rectangle*/ - int32_t th = a2_p->y1 - a1_p->y1; + lv_coord_t th = a2_p->y1 - a1_p->y1; if(th > 0) { n.x1 = a1_p->x1; n.y1 = a1_p->y1; @@ -135,7 +177,7 @@ int8_t lv_area_diff(lv_area_t res_p[], const lv_area_t * a1_p, const lv_area_t * } /*Compute the bottom rectangle*/ - int32_t bh = a1_h - (a2_p->y2 - a1_p->y1); + lv_coord_t bh = a1_h - (a2_p->y2 - a1_p->y1); if(bh > 0 && a2_p->y2 < a1_p->y2) { n.x1 = a1_p->x1; n.y1 = a2_p->y2; @@ -145,12 +187,12 @@ int8_t lv_area_diff(lv_area_t res_p[], const lv_area_t * a1_p, const lv_area_t * } /*Compute side height*/ - int32_t y1 = a2_p->y1 > a1_p->y1 ? a2_p->y1 : a1_p->y1; - int32_t y2 = a2_p->y2 < a1_p->y2 ? a2_p->y2 : a1_p->y2; - int32_t sh = y2 - y1; + lv_coord_t y1 = a2_p->y1 > a1_p->y1 ? a2_p->y1 : a1_p->y1; + lv_coord_t y2 = a2_p->y2 < a1_p->y2 ? a2_p->y2 : a1_p->y2; + lv_coord_t sh = y2 - y1; /*Compute the left rectangle*/ - int32_t lw = a2_p->x1 - a1_p->x1; + lv_coord_t lw = a2_p->x1 - a1_p->x1; if(lw > 0 && sh > 0) { n.x1 = a1_p->x1; n.y1 = y1; @@ -160,7 +202,7 @@ int8_t lv_area_diff(lv_area_t res_p[], const lv_area_t * a1_p, const lv_area_t * } /*Compute the right rectangle*/ - int32_t rw = a1_w - (a2_p->x2 - a1_p->x1); + lv_coord_t rw = a1_w - (a2_p->x2 - a1_p->x1); if(rw > 0) { n.x1 = a2_p->x2; n.y1 = y1; @@ -173,7 +215,13 @@ int8_t lv_area_diff(lv_area_t res_p[], const lv_area_t * a1_p, const lv_area_t * return res_c; } -void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p) +/** + * Join two areas into a third which involves the other two + * @param res_p pointer to an area, the result will be stored here + * @param a1_p pointer to the first area + * @param a2_p pointer to the second area + */ +void _lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p) { a_res_p->x1 = LV_MIN(a1_p->x1, a2_p->x1); a_res_p->y1 = LV_MIN(a1_p->y1, a2_p->y1); @@ -181,7 +229,14 @@ void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a_res_p->y2 = LV_MAX(a1_p->y2, a2_p->y2); } -bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, int32_t radius) +/** + * Check if a point is on an area + * @param a_p pointer to an area + * @param p_p pointer to a point + * @param radius radius of area (e.g. for rounded rectangle) + * @return false:the point is out of the area + */ +bool _lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord_t radius) { /*First check the basic area*/ bool is_on_rect = false; @@ -195,9 +250,9 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, int32_t /*No radius, it is within the rectangle*/ return true; } - int32_t w = lv_area_get_width(a_p) / 2; - int32_t h = lv_area_get_height(a_p) / 2; - int32_t max_radius = LV_MIN(w, h); + lv_coord_t w = lv_area_get_width(a_p) / 2; + lv_coord_t h = lv_area_get_height(a_p) / 2; + lv_coord_t max_radius = LV_MIN(w, h); if(radius > max_radius) radius = max_radius; @@ -208,7 +263,7 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, int32_t corner_area.x2 = a_p->x1 + radius; corner_area.y1 = a_p->y1; corner_area.y2 = a_p->y1 + radius; - if(lv_area_is_point_on(&corner_area, p_p, 0)) { + if(_lv_area_is_point_on(&corner_area, p_p, 0)) { corner_area.x2 += radius; corner_area.y2 += radius; return lv_point_within_circle(&corner_area, p_p); @@ -216,7 +271,7 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, int32_t /*Bottom left*/ corner_area.y1 = a_p->y2 - radius; corner_area.y2 = a_p->y2; - if(lv_area_is_point_on(&corner_area, p_p, 0)) { + if(_lv_area_is_point_on(&corner_area, p_p, 0)) { corner_area.x2 += radius; corner_area.y1 -= radius; return lv_point_within_circle(&corner_area, p_p); @@ -224,7 +279,7 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, int32_t /*Bottom right*/ corner_area.x1 = a_p->x2 - radius; corner_area.x2 = a_p->x2; - if(lv_area_is_point_on(&corner_area, p_p, 0)) { + if(_lv_area_is_point_on(&corner_area, p_p, 0)) { corner_area.x1 -= radius; corner_area.y1 -= radius; return lv_point_within_circle(&corner_area, p_p); @@ -232,7 +287,7 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, int32_t /*Top right*/ corner_area.y1 = a_p->y1; corner_area.y2 = a_p->y1 + radius; - if(lv_area_is_point_on(&corner_area, p_p, 0)) { + if(_lv_area_is_point_on(&corner_area, p_p, 0)) { corner_area.x1 -= radius; corner_area.y2 += radius; return lv_point_within_circle(&corner_area, p_p); @@ -241,7 +296,13 @@ bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, int32_t return true; } -bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p) +/** + * Check if two area has common parts + * @param a1_p pointer to an area. + * @param a2_p pointer to an other area + * @return false: a1_p and a2_p has no common parts + */ +bool _lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p) { if((a1_p->x1 <= a2_p->x2) && (a1_p->x2 >= a2_p->x1) && (a1_p->y1 <= a2_p->y2) && (a1_p->y2 >= a2_p->y1)) { return true; @@ -251,7 +312,14 @@ bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p) } } -bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, int32_t radius) +/** + * Check if an area is fully on an other + * @param ain_p pointer to an area which could be in 'aholder_p' + * @param aholder_p pointer to an area which could involve 'ain_p' + * @param radius radius of `aholder_p` (e.g. for rounded rectangle) + * @return true: `ain_p` is fully inside `aholder_p` + */ +bool _lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, lv_coord_t radius) { bool is_in = false; @@ -266,22 +334,33 @@ bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, int32_t /*Check if the corner points are inside the radius or not*/ lv_point_t p; - lv_point_set(&p, ain_p->x1, ain_p->y1); - if(lv_area_is_point_on(aholder_p, &p, radius) == false) return false; + p.x = ain_p->x1; + p.y = ain_p->y1; + if(_lv_area_is_point_on(aholder_p, &p, radius) == false) return false; - lv_point_set(&p, ain_p->x2, ain_p->y1); - if(lv_area_is_point_on(aholder_p, &p, radius) == false) return false; + p.x = ain_p->x2; + p.y = ain_p->y1; + if(_lv_area_is_point_on(aholder_p, &p, radius) == false) return false; - lv_point_set(&p, ain_p->x1, ain_p->y2); - if(lv_area_is_point_on(aholder_p, &p, radius) == false) return false; + p.x = ain_p->x1; + p.y = ain_p->y2; + if(_lv_area_is_point_on(aholder_p, &p, radius) == false) return false; - lv_point_set(&p, ain_p->x2, ain_p->y2); - if(lv_area_is_point_on(aholder_p, &p, radius) == false) return false; + p.x = ain_p->x2; + p.y = ain_p->y2; + if(_lv_area_is_point_on(aholder_p, &p, radius) == false) return false; return true; } -bool lv_area_is_out(const lv_area_t * aout_p, const lv_area_t * aholder_p, int32_t radius) +/** + * Check if an area is fully out of an other + * @param aout_p pointer to an area which could be in 'aholder_p' + * @param aholder_p pointer to an area which could involve 'ain_p' + * @param radius radius of `aholder_p` (e.g. for rounded rectangle) + * @return true: `aout_p` is fully outside `aholder_p` + */ +bool _lv_area_is_out(const lv_area_t * aout_p, const lv_area_t * aholder_p, lv_coord_t radius) { if(aout_p->x2 < aholder_p->x1 || aout_p->y2 < aholder_p->y1 || aout_p->x1 > aholder_p->x2 || aout_p->y1 > aholder_p->y2) { @@ -293,31 +372,42 @@ bool lv_area_is_out(const lv_area_t * aout_p, const lv_area_t * aholder_p, int32 /*Check if the corner points are outside the radius or not*/ lv_point_t p; - lv_point_set(&p, aout_p->x1, aout_p->y1); - if(lv_area_is_point_on(aholder_p, &p, radius)) return false; + p.x = aout_p->x1; + p.y = aout_p->y1; + if(_lv_area_is_point_on(aholder_p, &p, radius)) return false; - lv_point_set(&p, aout_p->x2, aout_p->y1); - if(lv_area_is_point_on(aholder_p, &p, radius)) return false; + p.x = aout_p->x2; + p.y = aout_p->y1; + if(_lv_area_is_point_on(aholder_p, &p, radius)) return false; - lv_point_set(&p, aout_p->x1, aout_p->y2); - if(lv_area_is_point_on(aholder_p, &p, radius)) return false; + p.x = aout_p->x1; + p.y = aout_p->y2; + if(_lv_area_is_point_on(aholder_p, &p, radius)) return false; - lv_point_set(&p, aout_p->x2, aout_p->y2); - if(lv_area_is_point_on(aholder_p, &p, radius)) return false; + p.x = aout_p->x2; + p.y = aout_p->y2; + if(_lv_area_is_point_on(aholder_p, &p, radius)) return false; return true; } -bool lv_area_is_equal(const lv_area_t * a, const lv_area_t * b) +bool _lv_area_is_equal(const lv_area_t * a, const lv_area_t * b) { return a->x1 == b->x1 && a->x2 == b->x2 && a->y1 == b->y1 && a->y2 == b->y2; } -void lv_area_align(const lv_area_t * base, lv_area_t * to_align, lv_align_t align, int32_t ofs_x, int32_t ofs_y) +/** + * Align an area to an other + * @param base an are where the other will be aligned + * @param to_align the area to align + * @param align `LV_ALIGN_...` + * @param res x/y coordinates where `to_align` align area should be placed + */ +void lv_area_align(const lv_area_t * base, lv_area_t * to_align, lv_align_t align, lv_coord_t ofs_x, lv_coord_t ofs_y) { - int32_t x; - int32_t y; + lv_coord_t x; + lv_coord_t y; switch(align) { case LV_ALIGN_CENTER: x = lv_area_get_width(base) / 2 - lv_area_get_width(to_align) / 2; @@ -430,168 +520,82 @@ void lv_area_align(const lv_area_t * base, lv_area_t * to_align, lv_align_t alig x += base->x1; y += base->y1; - int32_t w = lv_area_get_width(to_align); - int32_t h = lv_area_get_height(to_align); + lv_coord_t w = lv_area_get_width(to_align); + lv_coord_t h = lv_area_get_height(to_align); to_align->x1 = x + ofs_x; to_align->y1 = y + ofs_y; to_align->x2 = to_align->x1 + w - 1; to_align->y2 = to_align->y1 + h - 1; } -#define LV_TRANSFORM_TRIGO_SHIFT 10 - -void lv_point_transform(lv_point_t * point, int32_t angle, int32_t scale_x, int32_t scale_y, const lv_point_t * pivot, - bool zoom_first) -{ - lv_point_array_transform(point, 1, angle, scale_x, scale_y, pivot, zoom_first); -} - -void lv_point_array_transform(lv_point_t * points, size_t count, int32_t angle, int32_t scale_x, int32_t scale_y, - const lv_point_t * pivot, - bool zoom_first) +#define _LV_TRANSFORM_TRIGO_SHIFT 10 +void lv_point_transform(lv_point_t * p, int32_t angle, int32_t zoom, const lv_point_t * pivot) { - if(angle == 0 && scale_x == 256 && scale_y == 256) { + if(angle == 0 && zoom == 256) { return; } - uint32_t i; - for(i = 0; i < count; i++) { - points[i].x -= pivot->x; - points[i].y -= pivot->y; - } + p->x -= pivot->x; + p->y -= pivot->y; if(angle == 0) { - for(i = 0; i < count; i++) { - points[i].x = (((int32_t)(points[i].x) * scale_x) >> 8) + pivot->x; - points[i].y = (((int32_t)(points[i].y) * scale_y) >> 8) + pivot->y; - } + p->x = (((int32_t)(p->x) * zoom) >> 8) + pivot->x; + p->y = (((int32_t)(p->y) * zoom) >> 8) + pivot->y; return; } - int32_t angle_limited = angle; - if(angle_limited > 3600) angle_limited -= 3600; - if(angle_limited < 0) angle_limited += 3600; - - int32_t angle_low = angle_limited / 10; - int32_t angle_high = angle_low + 1; - int32_t angle_rem = angle_limited - (angle_low * 10); - - int32_t s1 = lv_trigo_sin(angle_low); - int32_t s2 = lv_trigo_sin(angle_high); - - int32_t c1 = lv_trigo_sin(angle_low + 90); - int32_t c2 = lv_trigo_sin(angle_high + 90); - - int32_t sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10; - sinma = sinma >> (LV_TRIGO_SHIFT - LV_TRANSFORM_TRIGO_SHIFT); - int32_t cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10; - cosma = cosma >> (LV_TRIGO_SHIFT - LV_TRANSFORM_TRIGO_SHIFT); - - for(i = 0; i < count; i++) { - int32_t x = points[i].x; - int32_t y = points[i].y; - if(scale_x == 256 && scale_y == 256) { - points[i].x = ((cosma * x - sinma * y) >> LV_TRANSFORM_TRIGO_SHIFT) + pivot->x; - points[i].y = ((sinma * x + cosma * y) >> LV_TRANSFORM_TRIGO_SHIFT) + pivot->y; - } - else { - if(zoom_first) { - x *= scale_x; - y *= scale_y; - points[i].x = (((cosma * x - sinma * y)) >> (LV_TRANSFORM_TRIGO_SHIFT + 8)) + pivot->x; - points[i].y = (((sinma * x + cosma * y)) >> (LV_TRANSFORM_TRIGO_SHIFT + 8)) + pivot->y; - } - else { - points[i].x = (((cosma * x - sinma * y) * scale_x) >> (LV_TRANSFORM_TRIGO_SHIFT + 8)) + pivot->x; - points[i].y = (((sinma * x + cosma * y) * scale_y) >> (LV_TRANSFORM_TRIGO_SHIFT + 8)) + pivot->y; - } - } + static int32_t angle_prev = INT32_MIN; + static int32_t sinma; + static int32_t cosma; + if(angle_prev != angle) { + int32_t angle_limited = angle; + if(angle_limited > 3600) angle_limited -= 3600; + if(angle_limited < 0) angle_limited += 3600; + + int32_t angle_low = angle_limited / 10; + int32_t angle_high = angle_low + 1; + int32_t angle_rem = angle_limited - (angle_low * 10); + + int32_t s1 = lv_trigo_sin(angle_low); + int32_t s2 = lv_trigo_sin(angle_high); + + int32_t c1 = lv_trigo_sin(angle_low + 90); + int32_t c2 = lv_trigo_sin(angle_high + 90); + + sinma = (s1 * (10 - angle_rem) + s2 * angle_rem) / 10; + cosma = (c1 * (10 - angle_rem) + c2 * angle_rem) / 10; + sinma = sinma >> (LV_TRIGO_SHIFT - _LV_TRANSFORM_TRIGO_SHIFT); + cosma = cosma >> (LV_TRIGO_SHIFT - _LV_TRANSFORM_TRIGO_SHIFT); + angle_prev = angle; } -} - -int32_t lv_area_get_width(const lv_area_t * area_p) -{ - return (int32_t)(area_p->x2 - area_p->x1 + 1); -} - -int32_t lv_area_get_height(const lv_area_t * area_p) -{ - return (int32_t)(area_p->y2 - area_p->y1 + 1); -} - -lv_point_t lv_point_from_precise(const lv_point_precise_t * p) -{ - lv_point_t point = { - (int32_t)p->x, (int32_t)p->y - }; - - return point; -} - -lv_point_precise_t lv_point_to_precise(const lv_point_t * p) -{ - lv_point_precise_t point = { - (lv_value_precise_t)p->x, (lv_value_precise_t)p->y - }; - - return point; -} - -void lv_point_set(lv_point_t * p, int32_t x, int32_t y) -{ - p->x = x; - p->y = y; -} - -void lv_point_precise_set(lv_point_precise_t * p, lv_value_precise_t x, lv_value_precise_t y) -{ - p->x = x; - p->y = y; -} - -void lv_point_swap(lv_point_t * p1, lv_point_t * p2) -{ - lv_point_t tmp = *p1; - *p1 = *p2; - *p2 = tmp; -} - -void lv_point_precise_swap(lv_point_precise_t * p1, lv_point_precise_t * p2) -{ - lv_point_precise_t tmp = *p1; - *p1 = *p2; - *p2 = tmp; -} - -int32_t lv_pct(int32_t x) -{ - return LV_PCT(x); -} - -int32_t lv_pct_to_px(int32_t v, int32_t base) -{ - if(LV_COORD_IS_PCT(v)) { - return (LV_COORD_GET_PCT(v) * base) / 100; + int32_t x = p->x; + int32_t y = p->y; + if(zoom == 256) { + p->x = ((cosma * x - sinma * y) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->x; + p->y = ((sinma * x + cosma * y) >> _LV_TRANSFORM_TRIGO_SHIFT) + pivot->y; + } + else { + p->x = (((cosma * x - sinma * y) * zoom) >> (_LV_TRANSFORM_TRIGO_SHIFT + 8)) + pivot->x; + p->y = (((sinma * x + cosma * y) * zoom) >> (_LV_TRANSFORM_TRIGO_SHIFT + 8)) + pivot->y; } - - return v; } + /********************** * STATIC FUNCTIONS **********************/ static bool lv_point_within_circle(const lv_area_t * area, const lv_point_t * p) { - int32_t r = (area->x2 - area->x1) / 2; + lv_coord_t r = (area->x2 - area->x1) / 2; /*Circle center*/ - int32_t cx = area->x1 + r; - int32_t cy = area->y1 + r; + lv_coord_t cx = area->x1 + r; + lv_coord_t cy = area->y1 + r; /*Simplify the code by moving everything to (0, 0)*/ - int32_t px = p->x - cx; - int32_t py = p->y - cy; + lv_coord_t px = p->x - cx; + lv_coord_t py = p->y - cy; uint32_t r_sqrd = r * r; uint32_t dist = (px * px) + (py * py); diff --git a/L3_Middlewares/LVGL/src/misc/lv_area.h b/L3_Middlewares/LVGL/src/misc/lv_area.h index 0798c74..48dc807 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_area.h +++ b/L3_Middlewares/LVGL/src/misc/lv_area.h @@ -14,13 +14,19 @@ extern "C" { * INCLUDES *********************/ #include "../lv_conf_internal.h" -#include "lv_types.h" -#include "lv_math.h" +#include +#include /********************* * DEFINES *********************/ +#if LV_USE_LARGE_COORD +typedef int32_t lv_coord_t; +#else +typedef int16_t lv_coord_t; +#endif + /********************** * TYPEDEFS **********************/ @@ -29,26 +35,20 @@ extern "C" { * Represents a point on the screen. */ typedef struct { - int32_t x; - int32_t y; + lv_coord_t x; + lv_coord_t y; } lv_point_t; -typedef struct { - lv_value_precise_t x; - lv_value_precise_t y; -} lv_point_precise_t; - /** Represents an area of the screen.*/ typedef struct { - int32_t x1; - int32_t y1; - int32_t x2; - int32_t y2; + lv_coord_t x1; + lv_coord_t y1; + lv_coord_t x2; + lv_coord_t y2; } lv_area_t; /** Alignments*/ - -typedef enum { +enum { LV_ALIGN_DEFAULT = 0, LV_ALIGN_TOP_LEFT, LV_ALIGN_TOP_MID, @@ -72,9 +72,10 @@ typedef enum { LV_ALIGN_OUT_RIGHT_TOP, LV_ALIGN_OUT_RIGHT_MID, LV_ALIGN_OUT_RIGHT_BOTTOM, -} lv_align_t; +}; +typedef uint8_t lv_align_t; -typedef enum { +enum { LV_DIR_NONE = 0x00, LV_DIR_LEFT = (1 << 0), LV_DIR_RIGHT = (1 << 1), @@ -83,7 +84,9 @@ typedef enum { LV_DIR_HOR = LV_DIR_LEFT | LV_DIR_RIGHT, LV_DIR_VER = LV_DIR_TOP | LV_DIR_BOTTOM, LV_DIR_ALL = LV_DIR_HOR | LV_DIR_VER, -} lv_dir_t; +}; + +typedef uint8_t lv_dir_t; /********************** * GLOBAL PROTOTYPES @@ -97,7 +100,7 @@ typedef enum { * @param x2 right coordinate of the area * @param y2 bottom coordinate of the area */ -void lv_area_set(lv_area_t * area_p, int32_t x1, int32_t y1, int32_t x2, int32_t y2); +void lv_area_set(lv_area_t * area_p, lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2); /** * Copy an area @@ -117,28 +120,42 @@ inline static void lv_area_copy(lv_area_t * dest, const lv_area_t * src) * @param area_p pointer to an area * @return the width of the area (if x1 == x2 -> width = 1) */ -int32_t lv_area_get_width(const lv_area_t * area_p); +static inline lv_coord_t lv_area_get_width(const lv_area_t * area_p) +{ + return (lv_coord_t)(area_p->x2 - area_p->x1 + 1); +} /** * Get the height of an area * @param area_p pointer to an area * @return the height of the area (if y1 == y2 -> height = 1) */ -int32_t lv_area_get_height(const lv_area_t * area_p); +static inline lv_coord_t lv_area_get_height(const lv_area_t * area_p) +{ + return (lv_coord_t)(area_p->y2 - area_p->y1 + 1); +} /** * Set the width of an area * @param area_p pointer to an area * @param w the new width of the area (w == 1 makes x1 == x2) */ -void lv_area_set_width(lv_area_t * area_p, int32_t w); +void lv_area_set_width(lv_area_t * area_p, lv_coord_t w); /** * Set the height of an area * @param area_p pointer to an area * @param h the new height of the area (h == 1 makes y1 == y2) */ -void lv_area_set_height(lv_area_t * area_p, int32_t h); +void lv_area_set_height(lv_area_t * area_p, lv_coord_t h); + +/** + * Set the position of an area (width and height will be kept) + * @param area_p pointer to an area + * @param x the new x coordinate of the area + * @param y the new y coordinate of the area + */ +void _lv_area_set_pos(lv_area_t * area_p, lv_coord_t x, lv_coord_t y); /** * Return with area of an area (x * y) @@ -147,105 +164,138 @@ void lv_area_set_height(lv_area_t * area_p, int32_t h); */ uint32_t lv_area_get_size(const lv_area_t * area_p); -void lv_area_increase(lv_area_t * area, int32_t w_extra, int32_t h_extra); +void lv_area_increase(lv_area_t * area, lv_coord_t w_extra, lv_coord_t h_extra); -void lv_area_move(lv_area_t * area, int32_t x_ofs, int32_t y_ofs); +void lv_area_move(lv_area_t * area, lv_coord_t x_ofs, lv_coord_t y_ofs); /** - * Align an area to another - * @param base an area where the other will be aligned - * @param to_align the area to align - * @param align `LV_ALIGN_...` - * @param ofs_x X offset - * @param ofs_y Y offset + * Get the common parts of two areas + * @param res_p pointer to an area, the result will be stored her + * @param a1_p pointer to the first area + * @param a2_p pointer to the second area + * @return false: the two area has NO common parts, res_p is invalid + */ +bool _lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p); + +/** + * Get resulting sub areas after removing the common parts of two areas from the first area + * @param res_p pointer to an array of areas with a count of 4, the resulting areas will be stored here + * @param a1_p pointer to the first area + * @param a2_p pointer to the second area + * @return number of results (max 4) or -1 if no intersect + */ +int8_t _lv_area_diff(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p); + +/** + * Join two areas into a third which involves the other two + * @param res_p pointer to an area, the result will be stored here + * @param a1_p pointer to the first area + * @param a2_p pointer to the second area */ -void lv_area_align(const lv_area_t * base, lv_area_t * to_align, lv_align_t align, int32_t ofs_x, int32_t ofs_y); +void _lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p); /** - * Transform a point - * @param point pointer to a point - * @param angle angle with 0.1 resolutions (123 means 12.3°) - * @param scale_x horizontal zoom, 256 means 100% - * @param scale_y vertical zoom, 256 means 100% - * @param pivot pointer to the pivot point of the transformation - * @param zoom_first true: zoom first and rotate after that; else: opposite order + * Check if a point is on an area + * @param a_p pointer to an area + * @param p_p pointer to a point + * @param radius radius of area (e.g. for rounded rectangle) + * @return false:the point is out of the area */ -void lv_point_transform(lv_point_t * point, int32_t angle, int32_t scale_x, int32_t scale_y, const lv_point_t * pivot, - bool zoom_first); +bool _lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, lv_coord_t radius); /** - * Transform an array of points - * @param points pointer to an array of points - * @param count number of points in the array - * @param angle angle with 0.1 resolutions (123 means 12.3°) - * @param scale_x horizontal zoom, 256 means 100% - * @param scale_y vertical zoom, 256 means 100% - * @param pivot pointer to the pivot point of the transformation - * @param zoom_first true: zoom first and rotate after that; else: opposite order + * Check if two area has common parts + * @param a1_p pointer to an area. + * @param a2_p pointer to an other area + * @return false: a1_p and a2_p has no common parts */ -void lv_point_array_transform(lv_point_t * points, size_t count, int32_t angle, int32_t scale_x, int32_t scale_y, - const lv_point_t * pivot, - bool zoom_first); +bool _lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p); -lv_point_t lv_point_from_precise(const lv_point_precise_t * p); +/** + * Check if an area is fully on an other + * @param ain_p pointer to an area which could be in 'aholder_p' + * @param aholder_p pointer to an area which could involve 'ain_p' + * @param radius radius of `aholder_p` (e.g. for rounded rectangle) + * @return true: `ain_p` is fully inside `aholder_p` + */ +bool _lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, lv_coord_t radius); -lv_point_precise_t lv_point_to_precise(const lv_point_t * p); -void lv_point_set(lv_point_t * p, int32_t x, int32_t y); +/** + * Check if an area is fully out of an other + * @param aout_p pointer to an area which could be in 'aholder_p' + * @param aholder_p pointer to an area which could involve 'ain_p' + * @param radius radius of `aholder_p` (e.g. for rounded rectangle) + * @return true: `aout_p` is fully outside `aholder_p` + */ +bool _lv_area_is_out(const lv_area_t * aout_p, const lv_area_t * aholder_p, lv_coord_t radius); -void lv_point_precise_set(lv_point_precise_t * p, lv_value_precise_t x, lv_value_precise_t y); +/** + * Check if 2 area is the same + * @param a pointer to an area + * @param b pointer to another area + */ +bool _lv_area_is_equal(const lv_area_t * a, const lv_area_t * b); -void lv_point_swap(lv_point_t * p1, lv_point_t * p2); +/** + * Align an area to an other + * @param base an are where the other will be aligned + * @param to_align the area to align + * @param align `LV_ALIGN_...` + */ +void lv_area_align(const lv_area_t * base, lv_area_t * to_align, lv_align_t align, lv_coord_t ofs_x, lv_coord_t ofs_y); -void lv_point_precise_swap(lv_point_precise_t * p1, lv_point_precise_t * p2); +void lv_point_transform(lv_point_t * p, int32_t angle, int32_t zoom, const lv_point_t * pivot); /********************** * MACROS **********************/ -#define LV_COORD_TYPE_SHIFT (29U) - -#define LV_COORD_TYPE_MASK (3 << LV_COORD_TYPE_SHIFT) -#define LV_COORD_TYPE(x) ((x) & LV_COORD_TYPE_MASK) /*Extract type specifiers*/ -#define LV_COORD_PLAIN(x) ((x) & ~LV_COORD_TYPE_MASK) /*Remove type specifiers*/ +#if LV_USE_LARGE_COORD +#define _LV_COORD_TYPE_SHIFT (29U) +#else +#define _LV_COORD_TYPE_SHIFT (13U) +#endif -#define LV_COORD_TYPE_PX (0 << LV_COORD_TYPE_SHIFT) -#define LV_COORD_TYPE_SPEC (1 << LV_COORD_TYPE_SHIFT) -#define LV_COORD_TYPE_PX_NEG (3 << LV_COORD_TYPE_SHIFT) +#define _LV_COORD_TYPE_MASK (3 << _LV_COORD_TYPE_SHIFT) +#define _LV_COORD_TYPE(x) ((x) & _LV_COORD_TYPE_MASK) /*Extract type specifiers*/ +#define _LV_COORD_PLAIN(x) ((x) & ~_LV_COORD_TYPE_MASK) /*Remove type specifiers*/ -#define LV_COORD_IS_PX(x) (LV_COORD_TYPE(x) == LV_COORD_TYPE_PX || LV_COORD_TYPE(x) == LV_COORD_TYPE_PX_NEG) -#define LV_COORD_IS_SPEC(x) (LV_COORD_TYPE(x) == LV_COORD_TYPE_SPEC) +#define _LV_COORD_TYPE_PX (0 << _LV_COORD_TYPE_SHIFT) +#define _LV_COORD_TYPE_SPEC (1 << _LV_COORD_TYPE_SHIFT) +#define _LV_COORD_TYPE_PX_NEG (3 << _LV_COORD_TYPE_SHIFT) -#define LV_COORD_SET_SPEC(x) ((x) | LV_COORD_TYPE_SPEC) +#define LV_COORD_IS_PX(x) (_LV_COORD_TYPE(x) == _LV_COORD_TYPE_PX || \ + _LV_COORD_TYPE(x) == _LV_COORD_TYPE_PX_NEG ? true : false) +#define LV_COORD_IS_SPEC(x) (_LV_COORD_TYPE(x) == _LV_COORD_TYPE_SPEC ? true : false) -/** Max coordinate value */ -#define LV_COORD_MAX ((1 << LV_COORD_TYPE_SHIFT) - 1) -#define LV_COORD_MIN (-LV_COORD_MAX) +#define LV_COORD_SET_SPEC(x) ((x) | _LV_COORD_TYPE_SPEC) /*Special coordinates*/ -#define LV_SIZE_CONTENT LV_COORD_SET_SPEC(LV_COORD_MAX) -#define LV_PCT_STORED_MAX (LV_COORD_MAX - 1) -#if LV_PCT_STORED_MAX % 2 != 0 -#error LV_PCT_STORED_MAX should be an even number -#endif -#define LV_PCT_POS_MAX (LV_PCT_STORED_MAX / 2) -#define LV_PCT(x) (LV_COORD_SET_SPEC(((x) < 0 ? (LV_PCT_POS_MAX - LV_MAX((x), -LV_PCT_POS_MAX)) : LV_MIN((x), LV_PCT_POS_MAX)))) -#define LV_COORD_IS_PCT(x) ((LV_COORD_IS_SPEC(x) && LV_COORD_PLAIN(x) <= LV_PCT_STORED_MAX)) -#define LV_COORD_GET_PCT(x) (LV_COORD_PLAIN(x) > LV_PCT_POS_MAX ? LV_PCT_POS_MAX - LV_COORD_PLAIN(x) : LV_COORD_PLAIN(x)) +#define LV_PCT(x) (x < 0 ? LV_COORD_SET_SPEC(1000 - (x)) : LV_COORD_SET_SPEC(x)) +#define LV_COORD_IS_PCT(x) ((LV_COORD_IS_SPEC(x) && _LV_COORD_PLAIN(x) <= 2000) ? true : false) +#define LV_COORD_GET_PCT(x) (_LV_COORD_PLAIN(x) > 1000 ? 1000 - _LV_COORD_PLAIN(x) : _LV_COORD_PLAIN(x)) +#define LV_SIZE_CONTENT LV_COORD_SET_SPEC(2001) + +LV_EXPORT_CONST_INT(LV_SIZE_CONTENT); + +/*Max coordinate value*/ +#define LV_COORD_MAX ((1 << _LV_COORD_TYPE_SHIFT) - 1) +#define LV_COORD_MIN (-LV_COORD_MAX) LV_EXPORT_CONST_INT(LV_COORD_MAX); LV_EXPORT_CONST_INT(LV_COORD_MIN); -LV_EXPORT_CONST_INT(LV_SIZE_CONTENT); /** - * Convert a percentage value to `int32_t`. + * Convert a percentage value to `lv_coord_t`. * Percentage values are stored in special range * @param x the percentage (0..1000) * @return a coordinate that stores the percentage */ -int32_t lv_pct(int32_t x); - -int32_t lv_pct_to_px(int32_t v, int32_t base); +static inline lv_coord_t lv_pct(lv_coord_t x) +{ + return LV_PCT(x); +} #ifdef __cplusplus } /*extern "C"*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_area_private.h b/L3_Middlewares/LVGL/src/misc/lv_area_private.h deleted file mode 100644 index bebca59..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_area_private.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * @file lv_area_private.h - * - */ - -#ifndef LV_AREA_PRIVATE_H -#define LV_AREA_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_area.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Set the position of an area (width and height will be kept) - * @param area_p pointer to an area - * @param x the new x coordinate of the area - * @param y the new y coordinate of the area - */ -void lv_area_set_pos(lv_area_t * area_p, int32_t x, int32_t y); - -/** - * Get the common parts of two areas - * @param res_p pointer to an area, the result will be stored her - * @param a1_p pointer to the first area - * @param a2_p pointer to the second area - * @return false: the two area has NO common parts, res_p is invalid - */ -bool lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p); - -/** - * Get resulting sub areas after removing the common parts of two areas from the first area - * @param res_p pointer to an array of areas with a count of 4, the resulting areas will be stored here - * @param a1_p pointer to the first area - * @param a2_p pointer to the second area - * @return number of results (max 4) or -1 if no intersect - */ -int8_t lv_area_diff(lv_area_t res_p[], const lv_area_t * a1_p, const lv_area_t * a2_p); - -/** - * Join two areas into a third which involves the other two - * @param a_res_p pointer to an area, the result will be stored here - * @param a1_p pointer to the first area - * @param a2_p pointer to the second area - */ -void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p); - -/** - * Check if a point is on an area - * @param a_p pointer to an area - * @param p_p pointer to a point - * @param radius radius of area (e.g. for rounded rectangle) - * @return false:the point is out of the area - */ -bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p, int32_t radius); - -/** - * Check if two area has common parts - * @param a1_p pointer to an area. - * @param a2_p pointer to another area - * @return false: a1_p and a2_p has no common parts - */ -bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p); - -/** - * Check if an area is fully on another - * @param ain_p pointer to an area which could be in 'aholder_p' - * @param aholder_p pointer to an area which could involve 'ain_p' - * @param radius radius of `aholder_p` (e.g. for rounded rectangle) - * @return true: `ain_p` is fully inside `aholder_p` - */ -bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p, int32_t radius); - -/** - * Check if an area is fully out of another - * @param aout_p pointer to an area which could be in 'aholder_p' - * @param aholder_p pointer to an area which could involve 'ain_p' - * @param radius radius of `aholder_p` (e.g. for rounded rectangle) - * @return true: `aout_p` is fully outside `aholder_p` - */ -bool lv_area_is_out(const lv_area_t * aout_p, const lv_area_t * aholder_p, int32_t radius); - -/** - * Check if 2 area is the same - * @param a pointer to an area - * @param b pointer to another area - */ -bool lv_area_is_equal(const lv_area_t * a, const lv_area_t * b); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_AREA_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_array.c b/L3_Middlewares/LVGL/src/misc/lv_array.c deleted file mode 100644 index 39382bc..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_array.c +++ /dev/null @@ -1,222 +0,0 @@ -/** - * @file lv_array.c - * Array. - * The nodes are dynamically allocated by the 'lv_mem' module, - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_array.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_string.h" - -#include "lv_assert.h" -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ -void lv_array_init(lv_array_t * array, uint32_t capacity, uint32_t element_size) -{ - array->size = 0; - array->capacity = capacity; - array->element_size = element_size; - - array->data = lv_malloc(capacity * element_size); - LV_ASSERT_MALLOC(array->data); -} - -void lv_array_deinit(lv_array_t * array) -{ - if(array->data) { - lv_free(array->data); - array->data = NULL; - } - - array->size = 0; - array->capacity = 0; -} - -void lv_array_copy(lv_array_t * target, const lv_array_t * source) -{ - if(lv_array_is_empty(source)) { - return; - } - lv_array_deinit(target); - lv_array_init(target, source->capacity, source->element_size); - lv_memcpy(target->data, source->data, source->size * source->element_size); - target->size = source->size; -} - -void lv_array_shrink(lv_array_t * array) -{ - if(array->size <= array->capacity / LV_ARRAY_DEFAULT_SHRINK_RATIO) { - lv_array_resize(array, array->size); - } -} - -lv_result_t lv_array_remove(lv_array_t * array, uint32_t index) -{ - if(index >= array->size) { - return LV_RESULT_INVALID; - } - - /*Shortcut*/ - if(index == array->size - 1) { - array->size--; - lv_array_shrink(array); - return LV_RESULT_OK; - } - - uint8_t * start = lv_array_at(array, index); - uint8_t * remaining = start + array->element_size; - uint32_t remaining_size = (array->size - index - 1) * array->element_size; - lv_memmove(start, remaining, remaining_size); - array->size--; - lv_array_shrink(array); - return LV_RESULT_OK; -} - -lv_result_t lv_array_erase(lv_array_t * array, uint32_t start, uint32_t end) -{ - if(end > array->size) { - end = array->size; - } - - if(start >= end) { - return LV_RESULT_INVALID; - } - - /*Shortcut*/ - if(end == array->size) { - array->size = start; - lv_array_shrink(array); - return LV_RESULT_OK; - } - - uint8_t * start_p = lv_array_at(array, start); - uint8_t * remaining = start_p + (end - start) * array->element_size; - uint32_t remaining_size = (array->size - end) * array->element_size; - lv_memcpy(start_p, remaining, remaining_size); - array->size -= (end - start); - lv_array_shrink(array); - return LV_RESULT_OK; -} - -void lv_array_resize(lv_array_t * array, uint32_t new_capacity) -{ - uint8_t * data = lv_realloc(array->data, new_capacity * array->element_size); - LV_ASSERT_NULL(data); - array->data = data; - array->capacity = new_capacity; - if(array->size > new_capacity) { - array->size = new_capacity; - } -} - -lv_result_t lv_array_concat(lv_array_t * array, const lv_array_t * other) -{ - LV_ASSERT_NULL(array->data); - uint32_t size = other->size; - if(array->size + size > array->capacity) { - /*array is full*/ - lv_array_resize(array, array->size + size); - } - - uint8_t * data = array->data + array->size * array->element_size; - lv_memcpy(data, other->data, array->element_size * size); - array->size += size; - return LV_RESULT_OK; -} - -lv_result_t lv_array_push_back(lv_array_t * array, const void * element) -{ - LV_ASSERT_NULL(array->data); - - if(array->size == array->capacity) { - /*array is full*/ - lv_array_resize(array, array->capacity + LV_ARRAY_DEFAULT_CAPACITY); - } - - uint8_t * data = array->data + array->size * array->element_size; - lv_memcpy(data, element, array->element_size); - array->size++; - return LV_RESULT_OK; -} - -void * lv_array_at(const lv_array_t * array, uint32_t index) -{ - if(index >= array->size) { - return NULL; - } - - LV_ASSERT_NULL(array->data); - return array->data + index * array->element_size; -} - -lv_result_t lv_array_assign(lv_array_t * array, uint32_t index, const void * value) -{ - uint8_t * data = lv_array_at(array, index); - if(data == NULL) return LV_RESULT_INVALID; - - lv_memcpy(data, value, array->element_size); - return LV_RESULT_OK; -} - -uint32_t lv_array_size(const lv_array_t * array) -{ - return array->size; -} - -uint32_t lv_array_capacity(const lv_array_t * array) -{ - return array->capacity; -} - -bool lv_array_is_empty(const lv_array_t * array) -{ - return array->size == 0; -} - -bool lv_array_is_full(const lv_array_t * array) -{ - return array->size == array->capacity; -} - -void lv_array_clear(lv_array_t * array) -{ - array->size = 0; -} - -void * lv_array_front(const lv_array_t * array) -{ - return lv_array_at(array, 0); -} - -void * lv_array_back(const lv_array_t * array) -{ - return lv_array_at(array, lv_array_size(array) - 1); -} - -/********************** - * STATIC FUNCTIONS - **********************/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_array.h b/L3_Middlewares/LVGL/src/misc/lv_array.h deleted file mode 100644 index e63f563..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_array.h +++ /dev/null @@ -1,191 +0,0 @@ -/** - * @file lv_array.h - * Array. The elements are dynamically allocated by the 'lv_mem' module. - */ - -#ifndef LV_ARRAY_H -#define LV_ARRAY_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_types.h" - -/********************* - * DEFINES - *********************/ - -#ifndef LV_ARRAY_DEFAULT_CAPACITY -#define LV_ARRAY_DEFAULT_CAPACITY 4 -#endif - -#ifndef LV_ARRAY_DEFAULT_SHRINK_RATIO -#define LV_ARRAY_DEFAULT_SHRINK_RATIO 2 -#endif - -/********************** - * TYPEDEFS - **********************/ - -/** Description of a array*/ -typedef struct { - uint8_t * data; - uint32_t size; - uint32_t capacity; - uint32_t element_size; -} lv_array_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Init an array. - * @param array pointer to an `lv_array_t` variable to initialize - * @param capacity the initial capacity of the array - * @param element_size the size of an element in bytes - */ -void lv_array_init(lv_array_t * array, uint32_t capacity, uint32_t element_size); - -/** - * Resize the array to the given capacity. - * @note if the new capacity is smaller than the current size, the array will be truncated. - * @param array pointer to an `lv_array_t` variable - * @param new_capacity the new capacity of the array - */ -void lv_array_resize(lv_array_t * array, uint32_t new_capacity); - -/** - * Deinit the array, and free the allocated memory - * @param array pointer to an `lv_array_t` variable to deinitialize - */ -void lv_array_deinit(lv_array_t * array); - -/** - * Return how many elements are stored in the array. - * @param array pointer to an `lv_array_t` variable - * @return the number of elements stored in the array - */ -uint32_t lv_array_size(const lv_array_t * array); - -/** - * Return the capacity of the array, i.e. how many elements can be stored. - * @param array pointer to an `lv_array_t` variable - * @return the capacity of the array - */ -uint32_t lv_array_capacity(const lv_array_t * array); - -/** - * Return if the array is empty - * @param array pointer to an `lv_array_t` variable - * @return true: array is empty; false: array is not empty - */ -bool lv_array_is_empty(const lv_array_t * array); - -/** - * Return if the array is full - * @param array pointer to an `lv_array_t` variable - * @return true: array is full; false: array is not full - */ -bool lv_array_is_full(const lv_array_t * array); - -/** - * Copy an array to another. - * @note this will create a new array with the same capacity and size as the source array. - * @param target pointer to an `lv_array_t` variable to copy to - * @param source pointer to an `lv_array_t` variable to copy from - */ -void lv_array_copy(lv_array_t * target, const lv_array_t * source); - -/** - * Remove all elements in array. - * @param array pointer to an `lv_array_t` variable - */ -void lv_array_clear(lv_array_t * array); - -/** - * Shrink the memory capacity of array if necessary. - * @param array pointer to an `lv_array_t` variable - */ -void lv_array_shrink(lv_array_t * array); - -/** - * Remove the element at the specified position in the array. - * @param array pointer to an `lv_array_t` variable - * @param index the index of the element to remove - * @return LV_RESULT_OK: success, otherwise: error - */ -lv_result_t lv_array_remove(lv_array_t * array, uint32_t index); - -/** - * Remove from the array either a single element or a range of elements ([start, end)). - * @note This effectively reduces the container size by the number of elements removed. - * @note When start equals to end, the function has no effect. - * @param array pointer to an `lv_array_t` variable - * @param start the index of the first element to be removed - * @param end the index of the first element that is not to be removed - * @return LV_RESULT_OK: success, otherwise: error - */ -lv_result_t lv_array_erase(lv_array_t * array, uint32_t start, uint32_t end); - -/** - * Concatenate two arrays. Adds new elements to the end of the array. - * @note The destination array is automatically expanded as necessary. - * @param array pointer to an `lv_array_t` variable - * @param other pointer to the array to concatenate - * @return LV_RESULT_OK: success, otherwise: error - */ -lv_result_t lv_array_concat(lv_array_t * array, const lv_array_t * other); - -/** - * Push back element. Adds a new element to the end of the array. - * If the array capacity is not enough for the new element, the array will be resized automatically. - * @param array pointer to an `lv_array_t` variable - * @param element pointer to the element to add - * @return LV_RESULT_OK: success, otherwise: error - */ -lv_result_t lv_array_push_back(lv_array_t * array, const void * element); - -/** - * Assigns one content to the array, replacing its current content. - * @param array pointer to an `lv_array_t` variable - * @param index the index of the element to replace - * @param value pointer to the elements to add - * @return true: success; false: error - */ -lv_result_t lv_array_assign(lv_array_t * array, uint32_t index, const void * value); - -/** - * Returns a pointer to the element at position n in the array. - * @param array pointer to an `lv_array_t` variable - * @param index the index of the element to return - * @return a pointer to the requested element, NULL if `index` is out of range - */ -void * lv_array_at(const lv_array_t * array, uint32_t index); - -/** - * Returns a pointer to the first element in the array. - * @param array pointer to an `lv_array_t` variable - * @return a pointer to the first element in the array - */ -void * lv_array_front(const lv_array_t * array); - -/** - * Returns a pointer to the last element in the array. - * @param array pointer to an `lv_array_t` variable - */ -void * lv_array_back(const lv_array_t * array); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif diff --git a/L3_Middlewares/LVGL/src/misc/lv_assert.h b/L3_Middlewares/LVGL/src/misc/lv_assert.h index c9dc849..48db744 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_assert.h +++ b/L3_Middlewares/LVGL/src/misc/lv_assert.h @@ -15,7 +15,7 @@ extern "C" { *********************/ #include "../lv_conf_internal.h" #include "lv_log.h" -#include "../stdlib/lv_mem.h" +#include "lv_mem.h" #include LV_ASSERT_HANDLER_INCLUDE /********************* @@ -50,14 +50,6 @@ extern "C" { } \ } while(0) -#define LV_ASSERT_FORMAT_MSG(expr, format, ...) \ - do { \ - if(!(expr)) { \ - LV_LOG_ERROR("Asserted at expression: %s " format , #expr, __VA_ARGS__); \ - LV_ASSERT_HANDLER \ - } \ - } while(0) - /*----------------- * ASSERTS *-----------------*/ @@ -75,7 +67,7 @@ extern "C" { #endif #if LV_USE_ASSERT_MEM_INTEGRITY -# define LV_ASSERT_MEM_INTEGRITY() LV_ASSERT_MSG(lv_mem_test() == LV_RESULT_OK, "Memory integrity error"); +# define LV_ASSERT_MEM_INTEGRITY() LV_ASSERT_MSG(lv_mem_test() == LV_RES_OK, "Memory integrity error"); #else # define LV_ASSERT_MEM_INTEGRITY() #endif diff --git a/L3_Middlewares/LVGL/src/misc/lv_async.c b/L3_Middlewares/LVGL/src/misc/lv_async.c index e1657ae..c4941e8 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_async.c +++ b/L3_Middlewares/LVGL/src/misc/lv_async.c @@ -8,8 +8,8 @@ *********************/ #include "lv_async.h" -#include "lv_timer_private.h" -#include "../stdlib/lv_mem.h" +#include "lv_mem.h" +#include "lv_timer.h" /********************* * DEFINES @@ -19,7 +19,7 @@ * TYPEDEFS **********************/ -typedef struct lv_async_info_t { +typedef struct _lv_async_info_t { lv_async_cb_t cb; void * user_data; } lv_async_info_t; @@ -42,33 +42,33 @@ static void lv_async_timer_cb(lv_timer_t * timer); * GLOBAL FUNCTIONS **********************/ -lv_result_t lv_async_call(lv_async_cb_t async_xcb, void * user_data) +lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data) { /*Allocate an info structure*/ - lv_async_info_t * info = lv_malloc(sizeof(lv_async_info_t)); + lv_async_info_t * info = lv_mem_alloc(sizeof(lv_async_info_t)); if(info == NULL) - return LV_RESULT_INVALID; + return LV_RES_INV; /*Create a new timer*/ lv_timer_t * timer = lv_timer_create(lv_async_timer_cb, 0, info); if(timer == NULL) { - lv_free(info); - return LV_RESULT_INVALID; + lv_mem_free(info); + return LV_RES_INV; } info->cb = async_xcb; info->user_data = user_data; lv_timer_set_repeat_count(timer, 1); - return LV_RESULT_OK; + return LV_RES_OK; } -lv_result_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data) +lv_res_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data) { lv_timer_t * timer = lv_timer_get_next(NULL); - lv_result_t res = LV_RESULT_INVALID; + lv_res_t res = LV_RES_INV; while(timer != NULL) { /*Find the next timer node*/ @@ -80,9 +80,9 @@ lv_result_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data) /*Match user function callback and user data*/ if(info->cb == async_xcb && info->user_data == user_data) { - lv_timer_delete(timer); - lv_free(info); - res = LV_RESULT_OK; + lv_timer_del(timer); + lv_mem_free(info); + res = LV_RES_OK; } } @@ -98,11 +98,8 @@ lv_result_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data) static void lv_async_timer_cb(lv_timer_t * timer) { - /*Save the info because an lv_async_call_cancel might delete it in the callback*/ lv_async_info_t * info = (lv_async_info_t *)timer->user_data; - lv_async_info_t info_save = *info; - lv_timer_delete(timer); - lv_free(info); - info_save.cb(info_save.user_data); + info->cb(info->user_data); + lv_mem_free(info); } diff --git a/L3_Middlewares/LVGL/src/misc/lv_async.h b/L3_Middlewares/LVGL/src/misc/lv_async.h index 362a0ff..4ad5756 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_async.h +++ b/L3_Middlewares/LVGL/src/misc/lv_async.h @@ -41,14 +41,14 @@ typedef void (*lv_async_cb_t)(void *); * the `func_name(object, callback, ...)` convention) * @param user_data custom parameter */ -lv_result_t lv_async_call(lv_async_cb_t async_xcb, void * user_data); +lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data); /** * Cancel an asynchronous function call * @param async_xcb a callback which is the task itself. * @param user_data custom parameter */ -lv_result_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data); +lv_res_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/misc/lv_bidi.c b/L3_Middlewares/LVGL/src/misc/lv_bidi.c index 44f014e..70af1c4 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_bidi.c +++ b/L3_Middlewares/LVGL/src/misc/lv_bidi.c @@ -6,18 +6,17 @@ /********************* * INCLUDES *********************/ -#include "lv_bidi_private.h" -#include "lv_text_private.h" -#include "lv_types.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_string.h" +#include +#include "lv_bidi.h" +#include "lv_txt.h" +#include "../misc/lv_mem.h" #if LV_USE_BIDI /********************* * DEFINES *********************/ -#define LV_BIDI_BRACKET_DEPTH 4 +#define LV_BIDI_BRACKLET_DEPTH 4 // Highest bit of the 16-bit pos_conv value specifies whether this pos is RTL or not #define GET_POS(x) ((x) & 0x7FFF) @@ -28,15 +27,10 @@ * TYPEDEFS **********************/ typedef struct { - uint32_t bracket_pos; + uint32_t bracklet_pos; lv_base_dir_t dir; } bracket_stack_t; -typedef struct { - bracket_stack_t br_stack[LV_BIDI_BRACKET_DEPTH]; - uint8_t br_stack_p; -} lv_bidi_ctx_t; - /********************** * STATIC PROTOTYPES **********************/ @@ -47,14 +41,12 @@ static bool lv_bidi_letter_is_weak(uint32_t letter); static bool lv_bidi_letter_is_rtl(uint32_t letter); static bool lv_bidi_letter_is_neutral(uint32_t letter); -static lv_base_dir_t get_next_run(lv_bidi_ctx_t * ctx, const char * txt, lv_base_dir_t base_dir, uint32_t max_len, - uint32_t * len, +static lv_base_dir_t get_next_run(const char * txt, lv_base_dir_t base_dir, uint32_t max_len, uint32_t * len, uint16_t * pos_conv_len); static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * pos_conv_out, uint16_t pos_conv_rd_base, uint16_t pos_conv_len); static uint32_t char_change_to_pair(uint32_t letter); -static lv_base_dir_t bracket_process(lv_bidi_ctx_t * ctx, const char * txt, uint32_t next_pos, uint32_t len, - uint32_t letter, +static lv_base_dir_t bracket_process(const char * txt, uint32_t next_pos, uint32_t len, uint32_t letter, lv_base_dir_t base_dir); static void fill_pos_conv(uint16_t * out, uint16_t len, uint16_t index); static uint32_t get_txt_len(const char * txt, uint32_t max_len); @@ -64,7 +56,8 @@ static uint32_t get_txt_len(const char * txt, uint32_t max_len); **********************/ static const uint8_t bracket_left[] = {"<({["}; static const uint8_t bracket_right[] = {">)}]"}; -static const char * custom_neutrals = NULL; +static bracket_stack_t br_stack[LV_BIDI_BRACKLET_DEPTH]; +static uint8_t br_stack_p; /********************** * MACROS @@ -74,9 +67,16 @@ static const char * custom_neutrals = NULL; * GLOBAL FUNCTIONS **********************/ -void lv_bidi_process(const char * str_in, char * str_out, lv_base_dir_t base_dir) +/** + * Convert a text to get the characters in the correct visual order according to + * Unicode Bidirectional Algorithm + * @param str_in the text to process + * @param str_out store the result here. Has the be `strlen(str_in)` length + * @param base_dir `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` + */ +void _lv_bidi_process(const char * str_in, char * str_out, lv_base_dir_t base_dir) { - if(base_dir == LV_BASE_DIR_AUTO) base_dir = lv_bidi_detect_base_dir(str_in); + if(base_dir == LV_BASE_DIR_AUTO) base_dir = _lv_bidi_detect_base_dir(str_in); uint32_t par_start = 0; uint32_t par_len; @@ -88,7 +88,7 @@ void lv_bidi_process(const char * str_in, char * str_out, lv_base_dir_t base_dir while(str_in[par_start] != '\0') { par_len = lv_bidi_get_next_paragraph(&str_in[par_start]); - lv_bidi_process_paragraph(&str_in[par_start], &str_out[par_start], par_len, base_dir, NULL, 0); + _lv_bidi_process_paragraph(&str_in[par_start], &str_out[par_start], par_len, base_dir, NULL, 0); par_start += par_len; while(str_in[par_start] == '\n' || str_in[par_start] == '\r') { @@ -105,12 +105,12 @@ void lv_bidi_process(const char * str_in, char * str_out, lv_base_dir_t base_dir * @param txt the text to process * @return `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` */ -lv_base_dir_t lv_bidi_detect_base_dir(const char * txt) +lv_base_dir_t _lv_bidi_detect_base_dir(const char * txt) { uint32_t i = 0; uint32_t letter; while(txt[i] != '\0') { - letter = lv_text_encoded_next(txt, &i); + letter = _lv_txt_encoded_next(txt, &i); lv_base_dir_t dir; dir = lv_bidi_get_letter_dir(letter); @@ -122,65 +122,99 @@ lv_base_dir_t lv_bidi_detect_base_dir(const char * txt) else return LV_BIDI_BASE_DIR_DEF; } -uint16_t lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_base_dir_t base_dir, - uint32_t visual_pos, bool * is_rtl) +/** + * Get the logical position of a character in a line + * @param str_in the input string. Can be only one line. + * @param bidi_txt internally the text is bidi processed which buffer can be get here. + * If not required anymore has to freed with `lv_mem_free()` + * Can be `NULL` is unused + * @param len length of the line in character count + * @param base_dir base direction of the text: `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` + * @param visual_pos the visual character position which logical position should be get + * @param is_rtl tell the char at `visual_pos` is RTL or LTR context + * @return the logical character position + */ +uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_base_dir_t base_dir, + uint32_t visual_pos, bool * is_rtl) { uint32_t pos_conv_len = get_txt_len(str_in, len); - char * buf = lv_malloc(len + 1); + char * buf = lv_mem_buf_get(len + 1); if(buf == NULL) return (uint16_t) -1; - uint16_t * pos_conv_buf = lv_malloc(pos_conv_len * sizeof(uint16_t)); + uint16_t * pos_conv_buf = lv_mem_buf_get(pos_conv_len * sizeof(uint16_t)); if(pos_conv_buf == NULL) { - lv_free(buf); + lv_mem_buf_release(buf); return (uint16_t) -1; } if(bidi_txt) *bidi_txt = buf; - lv_bidi_process_paragraph(str_in, bidi_txt ? *bidi_txt : NULL, len, base_dir, pos_conv_buf, pos_conv_len); + _lv_bidi_process_paragraph(str_in, bidi_txt ? *bidi_txt : NULL, len, base_dir, pos_conv_buf, pos_conv_len); if(is_rtl) *is_rtl = IS_RTL_POS(pos_conv_buf[visual_pos]); - if(bidi_txt == NULL) lv_free(buf); + if(bidi_txt == NULL) lv_mem_buf_release(buf); uint16_t res = GET_POS(pos_conv_buf[visual_pos]); - lv_free(pos_conv_buf); + lv_mem_buf_release(pos_conv_buf); return res; } -uint16_t lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_base_dir_t base_dir, - uint32_t logical_pos, bool * is_rtl) +/** + * Get the visual position of a character in a line + * @param str_in the input string. Can be only one line. + * @param bidi_txt internally the text is bidi processed which buffer can be get here. + * If not required anymore has to freed with `lv_mem_free()` + * Can be `NULL` is unused + * @param len length of the line in character count + * @param base_dir base direction of the text: `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` + * @param logical_pos the logical character position which visual position should be get + * @param is_rtl tell the char at `logical_pos` is RTL or LTR context + * @return the visual character position + */ +uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_base_dir_t base_dir, + uint32_t logical_pos, bool * is_rtl) { uint32_t pos_conv_len = get_txt_len(str_in, len); - char * buf = lv_malloc(len + 1); + char * buf = lv_mem_buf_get(len + 1); if(buf == NULL) return (uint16_t) -1; - uint16_t * pos_conv_buf = lv_malloc(pos_conv_len * sizeof(uint16_t)); + uint16_t * pos_conv_buf = lv_mem_buf_get(pos_conv_len * sizeof(uint16_t)); if(pos_conv_buf == NULL) { - lv_free(buf); + lv_mem_buf_release(buf); return (uint16_t) -1; } if(bidi_txt) *bidi_txt = buf; - lv_bidi_process_paragraph(str_in, bidi_txt ? *bidi_txt : NULL, len, base_dir, pos_conv_buf, pos_conv_len); + _lv_bidi_process_paragraph(str_in, bidi_txt ? *bidi_txt : NULL, len, base_dir, pos_conv_buf, pos_conv_len); for(uint16_t i = 0; i < pos_conv_len; i++) { if(GET_POS(pos_conv_buf[i]) == logical_pos) { if(is_rtl) *is_rtl = IS_RTL_POS(pos_conv_buf[i]); - lv_free(pos_conv_buf); + lv_mem_buf_release(pos_conv_buf); - if(bidi_txt == NULL) lv_free(buf); + if(bidi_txt == NULL) lv_mem_buf_release(buf); return i; } } - lv_free(pos_conv_buf); - if(bidi_txt == NULL) lv_free(buf); + lv_mem_buf_release(pos_conv_buf); + if(bidi_txt == NULL) lv_mem_buf_release(buf); return (uint16_t) -1; } -void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len, lv_base_dir_t base_dir, - uint16_t * pos_conv_out, uint16_t pos_conv_len) +/** + * Bidi process a paragraph of text + * @param str_in the string to process + * @param str_out store the result here + * @param len length of the text + * @param base_dir base dir of the text + * @param pos_conv_out an `uint16_t` array to store the related logical position of the character. + * Can be `NULL` is unused + * @param pos_conv_len length of `pos_conv_out` in element count + */ +void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len, lv_base_dir_t base_dir, + uint16_t * pos_conv_out, uint16_t pos_conv_len) { uint32_t run_len = 0; lv_base_dir_t run_dir; @@ -190,7 +224,7 @@ void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len uint16_t pos_conv_rd = 0; uint16_t pos_conv_wr; - if(base_dir == LV_BASE_DIR_AUTO) base_dir = lv_bidi_detect_base_dir(str_in); + if(base_dir == LV_BASE_DIR_AUTO) base_dir = _lv_bidi_detect_base_dir(str_in); if(base_dir == LV_BASE_DIR_RTL) { wr = len; pos_conv_wr = pos_conv_len; @@ -205,20 +239,19 @@ void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len lv_base_dir_t dir = base_dir; /*Empty the bracket stack*/ - lv_bidi_ctx_t ctx; - lv_memzero(&ctx, sizeof(ctx)); + br_stack_p = 0; /*Process neutral chars in the beginning*/ while(rd < len) { - uint32_t letter = lv_text_encoded_next(str_in, &rd); + uint32_t letter = _lv_txt_encoded_next(str_in, &rd); pos_conv_rd++; dir = lv_bidi_get_letter_dir(letter); - if(dir == LV_BASE_DIR_NEUTRAL) dir = bracket_process(&ctx, str_in, rd, len, letter, base_dir); - else if(dir != LV_BASE_DIR_WEAK) break; + if(dir == LV_BASE_DIR_NEUTRAL) dir = bracket_process(str_in, rd, len, letter, base_dir); + if(dir != LV_BASE_DIR_NEUTRAL && dir != LV_BASE_DIR_WEAK) break; } - if(rd && str_in[rd] != '\0' && rd < len) { - lv_text_encoded_prev(str_in, &rd); + if(rd && str_in[rd] != '\0') { + _lv_txt_encoded_prev(str_in, &rd); pos_conv_rd--; } @@ -244,7 +277,7 @@ void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len /*Get and process the runs*/ while(rd < len && str_in[rd]) { - run_dir = get_next_run(&ctx, &str_in[rd], base_dir, len - rd, &run_len, &pos_conv_run_len); + run_dir = get_next_run(&str_in[rd], base_dir, len - rd, &run_len, &pos_conv_run_len); if(base_dir == LV_BASE_DIR_LTR) { if(run_dir == LV_BASE_DIR_LTR) { @@ -274,7 +307,7 @@ void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len void lv_bidi_calculate_align(lv_text_align_t * align, lv_base_dir_t * base_dir, const char * txt) { - if(*base_dir == LV_BASE_DIR_AUTO) *base_dir = lv_bidi_detect_base_dir(txt); + if(*base_dir == LV_BASE_DIR_AUTO) *base_dir = _lv_bidi_detect_base_dir(txt); if(*align == LV_TEXT_ALIGN_AUTO) { if(*base_dir == LV_BASE_DIR_RTL) *align = LV_TEXT_ALIGN_RIGHT; @@ -282,11 +315,6 @@ void lv_bidi_calculate_align(lv_text_align_t * align, lv_base_dir_t * base_dir, } } -void lv_bidi_set_custom_neutrals_static(const char * neutrals) -{ - custom_neutrals = neutrals; -} - /********************** * STATIC FUNCTIONS **********************/ @@ -300,10 +328,10 @@ static uint32_t lv_bidi_get_next_paragraph(const char * txt) { uint32_t i = 0; - lv_text_encoded_next(txt, &i); + _lv_txt_encoded_next(txt, &i); while(txt[i] != '\0' && txt[i] != '\n' && txt[i] != '\r') { - lv_text_encoded_next(txt, &i); + _lv_txt_encoded_next(txt, &i); } return i; @@ -333,7 +361,7 @@ static bool lv_bidi_letter_is_weak(uint32_t letter) static const char weaks[] = "0123456789"; do { - uint32_t x = lv_text_encoded_next(weaks, &i); + uint32_t x = _lv_txt_encoded_next(weaks, &i); if(letter == x) { return true; } @@ -370,11 +398,7 @@ static bool lv_bidi_letter_is_rtl(uint32_t letter) static bool lv_bidi_letter_is_neutral(uint32_t letter) { uint16_t i; - const char * neutrals = " \t\n\r.,:;'\"`!?%/\\-=()[]{}<>@#&$|"; - if(custom_neutrals) { - neutrals = custom_neutrals; - } - + static const char neutrals[] = " \t\n\r.,:;'\"`!?%/\\-=()[]{}<>@#&$|"; for(i = 0; neutrals[i] != '\0'; i++) { if(letter == (uint32_t)neutrals[i]) return true; } @@ -388,7 +412,7 @@ static uint32_t get_txt_len(const char * txt, uint32_t max_len) uint32_t i = 0; while(i < max_len && txt[i] != '\0') { - lv_text_encoded_next(txt, &i); + _lv_txt_encoded_next(txt, &i); len++; } @@ -404,8 +428,7 @@ static void fill_pos_conv(uint16_t * out, uint16_t len, uint16_t index) } } -static lv_base_dir_t get_next_run(lv_bidi_ctx_t * ctx, const char * txt, lv_base_dir_t base_dir, uint32_t max_len, - uint32_t * len, +static lv_base_dir_t get_next_run(const char * txt, lv_base_dir_t base_dir, uint32_t max_len, uint32_t * len, uint16_t * pos_conv_len) { uint32_t i = 0; @@ -413,17 +436,17 @@ static lv_base_dir_t get_next_run(lv_bidi_ctx_t * ctx, const char * txt, lv_base uint16_t pos_conv_i = 0; - letter = lv_text_encoded_next(txt, NULL); + letter = _lv_txt_encoded_next(txt, NULL); lv_base_dir_t dir = lv_bidi_get_letter_dir(letter); - if(dir == LV_BASE_DIR_NEUTRAL) dir = bracket_process(ctx, txt, 0, max_len, letter, base_dir); + if(dir == LV_BASE_DIR_NEUTRAL) dir = bracket_process(txt, 0, max_len, letter, base_dir); /*Find the first strong char. Skip the neutrals*/ while(dir == LV_BASE_DIR_NEUTRAL || dir == LV_BASE_DIR_WEAK) { - letter = lv_text_encoded_next(txt, &i); + letter = _lv_txt_encoded_next(txt, &i); pos_conv_i++; dir = lv_bidi_get_letter_dir(letter); - if(dir == LV_BASE_DIR_NEUTRAL) dir = bracket_process(ctx, txt, i, max_len, letter, base_dir); + if(dir == LV_BASE_DIR_NEUTRAL) dir = bracket_process(txt, i, max_len, letter, base_dir); if(dir == LV_BASE_DIR_LTR || dir == LV_BASE_DIR_RTL) break; @@ -444,10 +467,10 @@ static lv_base_dir_t get_next_run(lv_bidi_ctx_t * ctx, const char * txt, lv_base /*Find the next char which has different direction*/ lv_base_dir_t next_dir = base_dir; while(i_prev < max_len && txt[i] != '\0' && txt[i] != '\n' && txt[i] != '\r') { - letter = lv_text_encoded_next(txt, &i); + letter = _lv_txt_encoded_next(txt, &i); pos_conv_i++; next_dir = lv_bidi_get_letter_dir(letter); - if(next_dir == LV_BASE_DIR_NEUTRAL) next_dir = bracket_process(ctx, txt, i, max_len, letter, base_dir); + if(next_dir == LV_BASE_DIR_NEUTRAL) next_dir = bracket_process(txt, i, max_len, letter, base_dir); if(next_dir == LV_BASE_DIR_WEAK) { if(run_dir == LV_BASE_DIR_RTL) { @@ -507,7 +530,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * uint16_t pos_conv_wr = 0; while(i) { - uint32_t letter = lv_text_encoded_prev(src, &i); + uint32_t letter = _lv_txt_encoded_prev(src, &i); uint16_t pos_conv_letter = --pos_conv_i; /*Keep weak letters (numbers) as LTR*/ @@ -517,7 +540,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * uint16_t pos_conv_last_weak = pos_conv_i; uint16_t pos_conv_first_weak = pos_conv_i; while(i) { - letter = lv_text_encoded_prev(src, &i); + letter = _lv_txt_encoded_prev(src, &i); pos_conv_letter = --pos_conv_i; /*No need to call `char_change_to_pair` because there not such chars here*/ @@ -525,7 +548,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * /*Finish on non-weak char*/ /*but treat number and currency related chars as weak*/ if(lv_bidi_letter_is_weak(letter) == false && letter != '.' && letter != ',' && letter != '$' && letter != '%') { - lv_text_encoded_next(src, &i); /*Rewind one letter*/ + _lv_txt_encoded_next(src, &i); /*Rewind one letter*/ pos_conv_i++; first_weak = i; pos_conv_first_weak = pos_conv_i; @@ -546,7 +569,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * /*Simply store in reversed order*/ else { - uint32_t letter_size = lv_text_encoded_size((const char *)&src[i]); + uint32_t letter_size = _lv_txt_encoded_size((const char *)&src[i]); /*Swap arithmetical symbols*/ if(letter_size == 1) { uint32_t new_letter = letter = char_change_to_pair(letter); @@ -581,8 +604,7 @@ static uint32_t char_change_to_pair(uint32_t letter) return letter; } -static lv_base_dir_t bracket_process(lv_bidi_ctx_t * ctx, const char * txt, uint32_t next_pos, uint32_t len, - uint32_t letter, +static lv_base_dir_t bracket_process(const char * txt, uint32_t next_pos, uint32_t len, uint32_t letter, lv_base_dir_t base_dir) { lv_base_dir_t bracket_dir = LV_BASE_DIR_NEUTRAL; @@ -595,7 +617,7 @@ static lv_base_dir_t bracket_process(lv_bidi_ctx_t * ctx, const char * txt, uint *If a char with base dir. direction is found then the brackets will have `base_dir` direction*/ uint32_t txt_i = next_pos; while(txt_i < len) { - uint32_t letter_next = lv_text_encoded_next(txt, &txt_i); + uint32_t letter_next = _lv_txt_encoded_next(txt, &txt_i); if(letter_next == bracket_right[i]) { /*Closing bracket found*/ break; @@ -617,9 +639,9 @@ static lv_base_dir_t bracket_process(lv_bidi_ctx_t * ctx, const char * txt, uint /*If there were no matching strong chars in the brackets then check the previous chars*/ txt_i = next_pos; - if(txt_i) lv_text_encoded_prev(txt, &txt_i); + if(txt_i) _lv_txt_encoded_prev(txt, &txt_i); while(txt_i > 0) { - uint32_t letter_next = lv_text_encoded_prev(txt, &txt_i); + uint32_t letter_next = _lv_txt_encoded_prev(txt, &txt_i); lv_base_dir_t letter_dir = lv_bidi_get_letter_dir(letter_next); if(letter_dir == LV_BASE_DIR_LTR || letter_dir == LV_BASE_DIR_RTL) { bracket_dir = letter_dir; @@ -640,19 +662,19 @@ static lv_base_dir_t bracket_process(lv_bidi_ctx_t * ctx, const char * txt, uint /*The letter was an opening bracket*/ if(bracket_left[i] != '\0') { - if(bracket_dir == LV_BASE_DIR_NEUTRAL || ctx->br_stack_p == LV_BIDI_BRACKET_DEPTH) return LV_BASE_DIR_NEUTRAL; + if(bracket_dir == LV_BASE_DIR_NEUTRAL || br_stack_p == LV_BIDI_BRACKLET_DEPTH) return LV_BASE_DIR_NEUTRAL; - ctx->br_stack[ctx->br_stack_p].bracket_pos = i; - ctx->br_stack[ctx->br_stack_p].dir = bracket_dir; + br_stack[br_stack_p].bracklet_pos = i; + br_stack[br_stack_p].dir = bracket_dir; - ctx->br_stack_p++; + br_stack_p++; return bracket_dir; } - else if(ctx->br_stack_p > 0) { + else if(br_stack_p > 0) { /*Is the letter a closing bracket of the last opening?*/ - if(letter == bracket_right[ctx->br_stack[ctx->br_stack_p - 1].bracket_pos]) { - bracket_dir = ctx->br_stack[ctx->br_stack_p - 1].dir; - ctx->br_stack_p--; + if(letter == bracket_right[br_stack[br_stack_p - 1].bracklet_pos]) { + bracket_dir = br_stack[br_stack_p - 1].dir; + br_stack_p--; return bracket_dir; } } diff --git a/L3_Middlewares/LVGL/src/misc/lv_bidi.h b/L3_Middlewares/LVGL/src/misc/lv_bidi.h index 77575ef..a27b580 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_bidi.h +++ b/L3_Middlewares/LVGL/src/misc/lv_bidi.h @@ -14,34 +14,97 @@ extern "C" { * INCLUDES *********************/ #include "../lv_conf_internal.h" -#include "lv_types.h" -#include "lv_text.h" + +#include +#include +#include "lv_txt.h" /********************* * DEFINES *********************/ -/** Special non printable strong characters. - * They can be inserted to texts to affect the run's direction */ +/*Special non printable strong characters. + *They can be inserted to texts to affect the run's direction*/ #define LV_BIDI_LRO "\xE2\x80\xAD" /*U+202D*/ #define LV_BIDI_RLO "\xE2\x80\xAE" /*U+202E*/ /********************** * TYPEDEFS **********************/ -typedef enum { +enum { LV_BASE_DIR_LTR = 0x00, LV_BASE_DIR_RTL = 0x01, LV_BASE_DIR_AUTO = 0x02, LV_BASE_DIR_NEUTRAL = 0x20, LV_BASE_DIR_WEAK = 0x21, -} lv_base_dir_t; +}; + +typedef uint8_t lv_base_dir_t; /********************** * GLOBAL PROTOTYPES **********************/ #if LV_USE_BIDI +/** + * Convert a text to get the characters in the correct visual order according to + * Unicode Bidirectional Algorithm + * @param str_in the text to process + * @param str_out store the result here. Has the be `strlen(str_in)` length + * @param base_dir `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` + */ +void _lv_bidi_process(const char * str_in, char * str_out, lv_base_dir_t base_dir); + +/** + * Auto-detect the direction of a text based on the first strong character + * @param txt the text to process + * @return `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` + */ +lv_base_dir_t _lv_bidi_detect_base_dir(const char * txt); + +/** + * Get the logical position of a character in a line + * @param str_in the input string. Can be only one line. + * @param bidi_txt internally the text is bidi processed which buffer can be get here. + * If not required anymore has to freed with `lv_mem_free()` + * Can be `NULL` is unused + * @param len length of the line in character count + * @param base_dir base direction of the text: `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` + * @param visual_pos the visual character position which logical position should be get + * @param is_rtl tell the char at `visual_pos` is RTL or LTR context + * @return the logical character position + */ +uint16_t _lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_base_dir_t base_dir, + uint32_t visual_pos, bool * is_rtl); + +/** + * Get the visual position of a character in a line + * @param str_in the input string. Can be only one line. + * @param bidi_txt internally the text is bidi processed which buffer can be get here. + * If not required anymore has to freed with `lv_mem_free()` + * Can be `NULL` is unused + * @param len length of the line in character count + * @param base_dir base direction of the text: `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` + * @param logical_pos the logical character position which visual position should be get + * @param is_rtl tell the char at `logical_pos` is RTL or LTR context + * @return the visual character position + */ +uint16_t _lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_base_dir_t base_dir, + uint32_t logical_pos, bool * is_rtl); + +/** + * Bidi process a paragraph of text + * @param str_in the string to process + * @param str_out store the result here + * @param len length of the text + * @param base_dir base dir of the text + * @param pos_conv_out an `uint16_t` array to store the related logical position of the character. + * Can be `NULL` is unused + * @param pos_conv_len length of `pos_conv_out` in element count + */ +void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len, lv_base_dir_t base_dir, + uint16_t * pos_conv_out, uint16_t pos_conv_len); + /** * Get the real text alignment from the a text alignment, base direction and a text. * @param align LV_TEXT_ALIGN_..., write back the calculated align here (LV_TEXT_ALIGN_LEFT/RIGHT/CENTER) @@ -50,11 +113,6 @@ typedef enum { */ void lv_bidi_calculate_align(lv_text_align_t * align, lv_base_dir_t * base_dir, const char * txt); -/** - * Set custom neutrals string - * @param neutrals default " \t\n\r.,:;'\"`!?%/\\-=()[]{}<>@#&$|" - */ -void lv_bidi_set_custom_neutrals_static(const char * neutrals); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/misc/lv_bidi_private.h b/L3_Middlewares/LVGL/src/misc/lv_bidi_private.h deleted file mode 100644 index 0b684da..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_bidi_private.h +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @file lv_bidi_private.h - * - */ - -#ifndef LV_BIDI_PRIVATE_H -#define LV_BIDI_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_bidi.h" -#if LV_USE_BIDI - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Convert a text to get the characters in the correct visual order according to - * Unicode Bidirectional Algorithm - * @param str_in the text to process - * @param str_out store the result here. Has the be `strlen(str_in)` length - * @param base_dir `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` - */ -void lv_bidi_process(const char * str_in, char * str_out, lv_base_dir_t base_dir); - -/** - * Auto-detect the direction of a text based on the first strong character - * @param txt the text to process - * @return `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` - */ -lv_base_dir_t lv_bidi_detect_base_dir(const char * txt); - -/** - * Get the logical position of a character in a line - * @param str_in the input string. Can be only one line. - * @param bidi_txt internally the text is bidi processed which buffer can be get here. - * If not required anymore has to freed with `lv_free()` - * Can be `NULL` is unused - * @param len length of the line in character count - * @param base_dir base direction of the text: `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` - * @param visual_pos the visual character position which logical position should be get - * @param is_rtl tell the char at `visual_pos` is RTL or LTR context - * @return the logical character position - */ -uint16_t lv_bidi_get_logical_pos(const char * str_in, char ** bidi_txt, uint32_t len, lv_base_dir_t base_dir, - uint32_t visual_pos, bool * is_rtl); - -/** - * Get the visual position of a character in a line - * @param str_in the input string. Can be only one line. - * @param bidi_txt internally the text is bidi processed which buffer can be get here. - * If not required anymore has to freed with `lv_free()` - * Can be `NULL` is unused - * @param len length of the line in character count - * @param base_dir base direction of the text: `LV_BASE_DIR_LTR` or `LV_BASE_DIR_RTL` - * @param logical_pos the logical character position which visual position should be get - * @param is_rtl tell the char at `logical_pos` is RTL or LTR context - * @return the visual character position - */ -uint16_t lv_bidi_get_visual_pos(const char * str_in, char ** bidi_txt, uint16_t len, lv_base_dir_t base_dir, - uint32_t logical_pos, bool * is_rtl); - -/** - * Bidi process a paragraph of text - * @param str_in the string to process - * @param str_out store the result here - * @param len length of the text - * @param base_dir base dir of the text - * @param pos_conv_out an `uint16_t` array to store the related logical position of the character. - * Can be `NULL` is unused - * @param pos_conv_len length of `pos_conv_out` in element count - */ -void lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t len, lv_base_dir_t base_dir, - uint16_t * pos_conv_out, uint16_t pos_conv_len); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_BIDI*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_BIDI_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_color.c b/L3_Middlewares/LVGL/src/misc/lv_color.c index d62f280..9ad5a14 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_color.c +++ b/L3_Middlewares/LVGL/src/misc/lv_color.c @@ -1,4 +1,4 @@ -/** +/** * @file lv_color.c * */ @@ -20,13 +20,6 @@ /********************** * STATIC PROTOTYPES **********************/ -static lv_color_t lv_color_filter_shade_cb(const lv_color_filter_dsc_t * dsc, lv_color_t c, lv_opa_t opa); - -/********************** - * GLOBAL VARIABLES - **********************/ - -const lv_color_filter_dsc_t lv_color_filter_shade = {.filter_cb = lv_color_filter_shade_cb}; /********************** * STATIC VARIABLES @@ -40,85 +33,98 @@ const lv_color_filter_dsc_t lv_color_filter_shade = {.filter_cb = lv_color_filte * GLOBAL FUNCTIONS **********************/ -uint8_t lv_color_format_get_bpp(lv_color_format_t cf) +void LV_ATTRIBUTE_FAST_MEM lv_color_fill(lv_color_t * buf, lv_color_t color, uint32_t px_num) { - switch(cf) { - case LV_COLOR_FORMAT_I1: - case LV_COLOR_FORMAT_A1: - return 1; - case LV_COLOR_FORMAT_I2: - case LV_COLOR_FORMAT_A2: - return 2; - case LV_COLOR_FORMAT_I4: - case LV_COLOR_FORMAT_A4: - return 4; - case LV_COLOR_FORMAT_L8: - case LV_COLOR_FORMAT_A8: - case LV_COLOR_FORMAT_I8: - return 8; - - case LV_COLOR_FORMAT_RGB565A8: - case LV_COLOR_FORMAT_RGB565: - case LV_COLOR_FORMAT_AL88: - return 16; - - case LV_COLOR_FORMAT_ARGB8565: - case LV_COLOR_FORMAT_RGB888: - return 24; - case LV_COLOR_FORMAT_ARGB8888: - case LV_COLOR_FORMAT_XRGB8888: - return 32; - - case LV_COLOR_FORMAT_UNKNOWN: - default: - return 0; +#if LV_COLOR_DEPTH == 16 + uintptr_t buf_int = (uintptr_t)buf; + if(buf_int & 0x3) { + *buf = color; + buf++; + px_num--; } -} -bool lv_color_format_has_alpha(lv_color_format_t cf) -{ - switch(cf) { - case LV_COLOR_FORMAT_A1: - case LV_COLOR_FORMAT_A2: - case LV_COLOR_FORMAT_A4: - case LV_COLOR_FORMAT_A8: - case LV_COLOR_FORMAT_I1: - case LV_COLOR_FORMAT_I2: - case LV_COLOR_FORMAT_I4: - case LV_COLOR_FORMAT_I8: - case LV_COLOR_FORMAT_RGB565A8: - case LV_COLOR_FORMAT_ARGB8565: - case LV_COLOR_FORMAT_ARGB8888: - case LV_COLOR_FORMAT_AL88: - return true; - default: - return false; + uint32_t c32 = (uint32_t)color.full + ((uint32_t)color.full << 16); + uint32_t * buf32 = (uint32_t *)buf; + + while(px_num > 16) { + *buf32 = c32; + buf32++; + *buf32 = c32; + buf32++; + *buf32 = c32; + buf32++; + *buf32 = c32; + buf32++; + + *buf32 = c32; + buf32++; + *buf32 = c32; + buf32++; + *buf32 = c32; + buf32++; + *buf32 = c32; + buf32++; + + px_num -= 16; } -} -lv_color32_t lv_color_to_32(lv_color_t color, lv_opa_t opa) -{ - lv_color32_t c32; - c32.red = color.red; - c32.green = color.green; - c32.blue = color.blue; - c32.alpha = opa; - return c32; -} - -uint16_t lv_color_to_u16(lv_color_t color) -{ - return ((color.red & 0xF8) << 8) + ((color.green & 0xFC) << 3) + ((color.blue & 0xF8) >> 3); -} + buf = (lv_color_t *)buf32; -uint32_t lv_color_to_u32(lv_color_t color) -{ - return (uint32_t)((uint32_t)0xff << 24) + (color.red << 16) + (color.green << 8) + (color.blue); + while(px_num) { + *buf = color; + buf++; + px_num--; + } +#else + while(px_num > 16) { + *buf = color; + buf++; + *buf = color; + buf++; + *buf = color; + buf++; + *buf = color; + buf++; + + *buf = color; + buf++; + *buf = color; + buf++; + *buf = color; + buf++; + *buf = color; + buf++; + + *buf = color; + buf++; + *buf = color; + buf++; + *buf = color; + buf++; + *buf = color; + buf++; + + *buf = color; + buf++; + *buf = color; + buf++; + *buf = color; + buf++; + *buf = color; + buf++; + + px_num -= 16; + } + while(px_num) { + *buf = color; + buf++; + px_num--; + } +#endif } lv_color_t lv_color_lighten(lv_color_t c, lv_opa_t lvl) { - return lv_color_mix(lv_color_white(), c, lvl); } @@ -127,6 +133,21 @@ lv_color_t lv_color_darken(lv_color_t c, lv_opa_t lvl) return lv_color_mix(lv_color_black(), c, lvl); } +lv_color_t lv_color_change_lightness(lv_color_t c, lv_opa_t lvl) +{ + /*It'd be better to convert the color to HSL, change L and convert back to RGB.*/ + if(lvl == LV_OPA_50) return c; + else if(lvl < LV_OPA_50) return lv_color_darken(c, (LV_OPA_50 - lvl) * 2); + else return lv_color_lighten(c, (lvl - LV_OPA_50) * 2); +} + +/** + * Convert a HSV color to RGB + * @param h hue [0..359] + * @param s saturation [0..100] + * @param v value [0..100] + * @return the given RGB color in RGB (with LV_COLOR_DEPTH depth) + */ lv_color_t lv_color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v) { h = (uint32_t)((uint32_t)h * 255) / 360; @@ -185,6 +206,13 @@ lv_color_t lv_color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v) return result; } +/** + * Convert a 32-bit RGB color to HSV + * @param r8 8-bit red + * @param g8 8-bit green + * @param b8 8-bit blue + * @return the given RGB color in HSV + */ lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r8, uint8_t g8, uint8_t b8) { uint16_t r = ((uint32_t)r8 << 10) / 255; @@ -236,168 +264,106 @@ lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r8, uint8_t g8, uint8_t b8) * @param color color * @return the given color in HSV */ -lv_color_hsv_t lv_color_to_hsv(lv_color_t c) -{ - return lv_color_rgb_to_hsv(c.red, c.green, c.blue); -} - -uint8_t lv_color_format_get_size(lv_color_format_t cf) -{ - return (lv_color_format_get_bpp(cf) + 7) >> 3; -} - -uint32_t lv_color_to_int(lv_color_t c) -{ - uint8_t * tmp = (uint8_t *) &c; - return tmp[0] + (tmp[1] << 8) + (tmp[2] << 16); -} - -bool lv_color_eq(lv_color_t c1, lv_color_t c2) -{ - return lv_color_to_int(c1) == lv_color_to_int(c2); -} - -bool lv_color32_eq(lv_color32_t c1, lv_color32_t c2) -{ - return *((uint32_t *)&c1) == *((uint32_t *)&c2); -} - -lv_color_t lv_color_hex(uint32_t c) -{ - lv_color_t ret; - ret.red = (c >> 16) & 0xff; - ret.green = (c >> 8) & 0xff; - ret.blue = (c >> 0) & 0xff; - return ret; -} - -lv_color_t lv_color_make(uint8_t r, uint8_t g, uint8_t b) -{ - lv_color_t ret; - ret.red = r; - ret.green = g; - ret.blue = b; - return ret; -} - -lv_color32_t lv_color32_make(uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - lv_color32_t ret; - ret.red = r; - ret.green = g; - ret.blue = b; - ret.alpha = a; - return ret; -} - -lv_color_t lv_color_hex3(uint32_t c) -{ - return lv_color_make((uint8_t)(((c >> 4) & 0xF0) | ((c >> 8) & 0xF)), (uint8_t)((c & 0xF0) | ((c & 0xF0) >> 4)), - (uint8_t)((c & 0xF) | ((c & 0xF) << 4))); -} - -uint16_t LV_ATTRIBUTE_FAST_MEM lv_color_16_16_mix(uint16_t c1, uint16_t c2, uint8_t mix) -{ - if(mix == 255) return c1; - if(mix == 0) return c2; - if(c1 == c2) return c1; - - uint16_t ret; - - /* Source: https://stackoverflow.com/a/50012418/1999969*/ - mix = (uint32_t)((uint32_t)mix + 4) >> 3; - - /*0x7E0F81F = 0b00000111111000001111100000011111*/ - uint32_t bg = (uint32_t)(c2 | ((uint32_t)c2 << 16)) & 0x7E0F81F; - uint32_t fg = (uint32_t)(c1 | ((uint32_t)c1 << 16)) & 0x7E0F81F; - uint32_t result = ((((fg - bg) * mix) >> 5) + bg) & 0x7E0F81F; - ret = (uint16_t)(result >> 16) | result; - - return ret; -} - -lv_color_t lv_color_white(void) +lv_color_hsv_t lv_color_to_hsv(lv_color_t color) { - return lv_color_make(0xff, 0xff, 0xff); + lv_color32_t color32; + color32.full = lv_color_to32(color); + return lv_color_rgb_to_hsv(color32.ch.red, color32.ch.green, color32.ch.blue); } -lv_color_t lv_color_black(void) +lv_color_t lv_palette_main(lv_palette_t p) { - return lv_color_make(0x00, 0x00, 0x00); -} - -void lv_color_premultiply(lv_color32_t * c) -{ - if(c->alpha == LV_OPA_COVER) { - return; + static const lv_color_t colors[] = { + LV_COLOR_MAKE(0xF4, 0x43, 0x36), LV_COLOR_MAKE(0xE9, 0x1E, 0x63), LV_COLOR_MAKE(0x9C, 0x27, 0xB0), LV_COLOR_MAKE(0x67, 0x3A, 0xB7), + LV_COLOR_MAKE(0x3F, 0x51, 0xB5), LV_COLOR_MAKE(0x21, 0x96, 0xF3), LV_COLOR_MAKE(0x03, 0xA9, 0xF4), LV_COLOR_MAKE(0x00, 0xBC, 0xD4), + LV_COLOR_MAKE(0x00, 0x96, 0x88), LV_COLOR_MAKE(0x4C, 0xAF, 0x50), LV_COLOR_MAKE(0x8B, 0xC3, 0x4A), LV_COLOR_MAKE(0xCD, 0xDC, 0x39), + LV_COLOR_MAKE(0xFF, 0xEB, 0x3B), LV_COLOR_MAKE(0xFF, 0xC1, 0x07), LV_COLOR_MAKE(0xFF, 0x98, 0x00), LV_COLOR_MAKE(0xFF, 0x57, 0x22), + LV_COLOR_MAKE(0x79, 0x55, 0x48), LV_COLOR_MAKE(0x60, 0x7D, 0x8B), LV_COLOR_MAKE(0x9E, 0x9E, 0x9E) + }; + + if(p >= _LV_PALETTE_LAST) { + LV_LOG_WARN("Invalid palette: %d", p); + return lv_color_black(); } - if(c->alpha == LV_OPA_TRANSP) { - lv_memzero(c, sizeof(lv_color32_t)); - return; - } + return colors[p]; - c->red = LV_OPA_MIX2(c->red, c->alpha); - c->green = LV_OPA_MIX2(c->green, c->alpha); - c->blue = LV_OPA_MIX2(c->blue, c->alpha); } -void lv_color16_premultiply(lv_color16_t * c, lv_opa_t a) +lv_color_t lv_palette_lighten(lv_palette_t p, uint8_t lvl) { - if(a == LV_OPA_COVER) { - return; + static const lv_color_t colors[][5] = { + {LV_COLOR_MAKE(0xEF, 0x53, 0x50), LV_COLOR_MAKE(0xE5, 0x73, 0x73), LV_COLOR_MAKE(0xEF, 0x9A, 0x9A), LV_COLOR_MAKE(0xFF, 0xCD, 0xD2), LV_COLOR_MAKE(0xFF, 0xEB, 0xEE)}, + {LV_COLOR_MAKE(0xEC, 0x40, 0x7A), LV_COLOR_MAKE(0xF0, 0x62, 0x92), LV_COLOR_MAKE(0xF4, 0x8F, 0xB1), LV_COLOR_MAKE(0xF8, 0xBB, 0xD0), LV_COLOR_MAKE(0xFC, 0xE4, 0xEC)}, + {LV_COLOR_MAKE(0xAB, 0x47, 0xBC), LV_COLOR_MAKE(0xBA, 0x68, 0xC8), LV_COLOR_MAKE(0xCE, 0x93, 0xD8), LV_COLOR_MAKE(0xE1, 0xBE, 0xE7), LV_COLOR_MAKE(0xF3, 0xE5, 0xF5)}, + {LV_COLOR_MAKE(0x7E, 0x57, 0xC2), LV_COLOR_MAKE(0x95, 0x75, 0xCD), LV_COLOR_MAKE(0xB3, 0x9D, 0xDB), LV_COLOR_MAKE(0xD1, 0xC4, 0xE9), LV_COLOR_MAKE(0xED, 0xE7, 0xF6)}, + {LV_COLOR_MAKE(0x5C, 0x6B, 0xC0), LV_COLOR_MAKE(0x79, 0x86, 0xCB), LV_COLOR_MAKE(0x9F, 0xA8, 0xDA), LV_COLOR_MAKE(0xC5, 0xCA, 0xE9), LV_COLOR_MAKE(0xE8, 0xEA, 0xF6)}, + {LV_COLOR_MAKE(0x42, 0xA5, 0xF5), LV_COLOR_MAKE(0x64, 0xB5, 0xF6), LV_COLOR_MAKE(0x90, 0xCA, 0xF9), LV_COLOR_MAKE(0xBB, 0xDE, 0xFB), LV_COLOR_MAKE(0xE3, 0xF2, 0xFD)}, + {LV_COLOR_MAKE(0x29, 0xB6, 0xF6), LV_COLOR_MAKE(0x4F, 0xC3, 0xF7), LV_COLOR_MAKE(0x81, 0xD4, 0xFA), LV_COLOR_MAKE(0xB3, 0xE5, 0xFC), LV_COLOR_MAKE(0xE1, 0xF5, 0xFE)}, + {LV_COLOR_MAKE(0x26, 0xC6, 0xDA), LV_COLOR_MAKE(0x4D, 0xD0, 0xE1), LV_COLOR_MAKE(0x80, 0xDE, 0xEA), LV_COLOR_MAKE(0xB2, 0xEB, 0xF2), LV_COLOR_MAKE(0xE0, 0xF7, 0xFA)}, + {LV_COLOR_MAKE(0x26, 0xA6, 0x9A), LV_COLOR_MAKE(0x4D, 0xB6, 0xAC), LV_COLOR_MAKE(0x80, 0xCB, 0xC4), LV_COLOR_MAKE(0xB2, 0xDF, 0xDB), LV_COLOR_MAKE(0xE0, 0xF2, 0xF1)}, + {LV_COLOR_MAKE(0x66, 0xBB, 0x6A), LV_COLOR_MAKE(0x81, 0xC7, 0x84), LV_COLOR_MAKE(0xA5, 0xD6, 0xA7), LV_COLOR_MAKE(0xC8, 0xE6, 0xC9), LV_COLOR_MAKE(0xE8, 0xF5, 0xE9)}, + {LV_COLOR_MAKE(0x9C, 0xCC, 0x65), LV_COLOR_MAKE(0xAE, 0xD5, 0x81), LV_COLOR_MAKE(0xC5, 0xE1, 0xA5), LV_COLOR_MAKE(0xDC, 0xED, 0xC8), LV_COLOR_MAKE(0xF1, 0xF8, 0xE9)}, + {LV_COLOR_MAKE(0xD4, 0xE1, 0x57), LV_COLOR_MAKE(0xDC, 0xE7, 0x75), LV_COLOR_MAKE(0xE6, 0xEE, 0x9C), LV_COLOR_MAKE(0xF0, 0xF4, 0xC3), LV_COLOR_MAKE(0xF9, 0xFB, 0xE7)}, + {LV_COLOR_MAKE(0xFF, 0xEE, 0x58), LV_COLOR_MAKE(0xFF, 0xF1, 0x76), LV_COLOR_MAKE(0xFF, 0xF5, 0x9D), LV_COLOR_MAKE(0xFF, 0xF9, 0xC4), LV_COLOR_MAKE(0xFF, 0xFD, 0xE7)}, + {LV_COLOR_MAKE(0xFF, 0xCA, 0x28), LV_COLOR_MAKE(0xFF, 0xD5, 0x4F), LV_COLOR_MAKE(0xFF, 0xE0, 0x82), LV_COLOR_MAKE(0xFF, 0xEC, 0xB3), LV_COLOR_MAKE(0xFF, 0xF8, 0xE1)}, + {LV_COLOR_MAKE(0xFF, 0xA7, 0x26), LV_COLOR_MAKE(0xFF, 0xB7, 0x4D), LV_COLOR_MAKE(0xFF, 0xCC, 0x80), LV_COLOR_MAKE(0xFF, 0xE0, 0xB2), LV_COLOR_MAKE(0xFF, 0xF3, 0xE0)}, + {LV_COLOR_MAKE(0xFF, 0x70, 0x43), LV_COLOR_MAKE(0xFF, 0x8A, 0x65), LV_COLOR_MAKE(0xFF, 0xAB, 0x91), LV_COLOR_MAKE(0xFF, 0xCC, 0xBC), LV_COLOR_MAKE(0xFB, 0xE9, 0xE7)}, + {LV_COLOR_MAKE(0x8D, 0x6E, 0x63), LV_COLOR_MAKE(0xA1, 0x88, 0x7F), LV_COLOR_MAKE(0xBC, 0xAA, 0xA4), LV_COLOR_MAKE(0xD7, 0xCC, 0xC8), LV_COLOR_MAKE(0xEF, 0xEB, 0xE9)}, + {LV_COLOR_MAKE(0x78, 0x90, 0x9C), LV_COLOR_MAKE(0x90, 0xA4, 0xAE), LV_COLOR_MAKE(0xB0, 0xBE, 0xC5), LV_COLOR_MAKE(0xCF, 0xD8, 0xDC), LV_COLOR_MAKE(0xEC, 0xEF, 0xF1)}, + {LV_COLOR_MAKE(0xBD, 0xBD, 0xBD), LV_COLOR_MAKE(0xE0, 0xE0, 0xE0), LV_COLOR_MAKE(0xEE, 0xEE, 0xEE), LV_COLOR_MAKE(0xF5, 0xF5, 0xF5), LV_COLOR_MAKE(0xFA, 0xFA, 0xFA)}, + }; + + if(p >= _LV_PALETTE_LAST) { + LV_LOG_WARN("Invalid palette: %d", p); + return lv_color_black(); } - if(a == LV_OPA_TRANSP) { - lv_memzero(c, sizeof(lv_color16_t)); - return; + if(lvl == 0 || lvl > 5) { + LV_LOG_WARN("Invalid level: %d. Must be 1..5", lvl); + return lv_color_black(); } - c->red = LV_OPA_MIX2(c->red, a); - c->green = LV_OPA_MIX2(c->green, a); - c->blue = LV_OPA_MIX2(c->blue, a); -} + lvl--; -uint8_t lv_color_luminance(lv_color_t c) -{ - return (uint8_t)((uint16_t)(77u * c.red + 151u * c.green + 28u * c.blue) >> 8); -} - -uint8_t lv_color16_luminance(const lv_color16_t c) -{ - return (uint8_t)((uint16_t)(635u * c.red + 613u * c.green + 231u * c.blue) >> 8); + return colors[p][lvl]; } -uint8_t lv_color24_luminance(const uint8_t * c) +lv_color_t lv_palette_darken(lv_palette_t p, uint8_t lvl) { - return (uint8_t)((uint16_t)(77u * c[2] + 151u * c[1] + 28u * c[0]) >> 8); -} + static const lv_color_t colors[][4] = { + {LV_COLOR_MAKE(0xE5, 0x39, 0x35), LV_COLOR_MAKE(0xD3, 0x2F, 0x2F), LV_COLOR_MAKE(0xC6, 0x28, 0x28), LV_COLOR_MAKE(0xB7, 0x1C, 0x1C)}, + {LV_COLOR_MAKE(0xD8, 0x1B, 0x60), LV_COLOR_MAKE(0xC2, 0x18, 0x5B), LV_COLOR_MAKE(0xAD, 0x14, 0x57), LV_COLOR_MAKE(0x88, 0x0E, 0x4F)}, + {LV_COLOR_MAKE(0x8E, 0x24, 0xAA), LV_COLOR_MAKE(0x7B, 0x1F, 0xA2), LV_COLOR_MAKE(0x6A, 0x1B, 0x9A), LV_COLOR_MAKE(0x4A, 0x14, 0x8C)}, + {LV_COLOR_MAKE(0x5E, 0x35, 0xB1), LV_COLOR_MAKE(0x51, 0x2D, 0xA8), LV_COLOR_MAKE(0x45, 0x27, 0xA0), LV_COLOR_MAKE(0x31, 0x1B, 0x92)}, + {LV_COLOR_MAKE(0x39, 0x49, 0xAB), LV_COLOR_MAKE(0x30, 0x3F, 0x9F), LV_COLOR_MAKE(0x28, 0x35, 0x93), LV_COLOR_MAKE(0x1A, 0x23, 0x7E)}, + {LV_COLOR_MAKE(0x1E, 0x88, 0xE5), LV_COLOR_MAKE(0x19, 0x76, 0xD2), LV_COLOR_MAKE(0x15, 0x65, 0xC0), LV_COLOR_MAKE(0x0D, 0x47, 0xA1)}, + {LV_COLOR_MAKE(0x03, 0x9B, 0xE5), LV_COLOR_MAKE(0x02, 0x88, 0xD1), LV_COLOR_MAKE(0x02, 0x77, 0xBD), LV_COLOR_MAKE(0x01, 0x57, 0x9B)}, + {LV_COLOR_MAKE(0x00, 0xAC, 0xC1), LV_COLOR_MAKE(0x00, 0x97, 0xA7), LV_COLOR_MAKE(0x00, 0x83, 0x8F), LV_COLOR_MAKE(0x00, 0x60, 0x64)}, + {LV_COLOR_MAKE(0x00, 0x89, 0x7B), LV_COLOR_MAKE(0x00, 0x79, 0x6B), LV_COLOR_MAKE(0x00, 0x69, 0x5C), LV_COLOR_MAKE(0x00, 0x4D, 0x40)}, + {LV_COLOR_MAKE(0x43, 0xA0, 0x47), LV_COLOR_MAKE(0x38, 0x8E, 0x3C), LV_COLOR_MAKE(0x2E, 0x7D, 0x32), LV_COLOR_MAKE(0x1B, 0x5E, 0x20)}, + {LV_COLOR_MAKE(0x7C, 0xB3, 0x42), LV_COLOR_MAKE(0x68, 0x9F, 0x38), LV_COLOR_MAKE(0x55, 0x8B, 0x2F), LV_COLOR_MAKE(0x33, 0x69, 0x1E)}, + {LV_COLOR_MAKE(0xC0, 0xCA, 0x33), LV_COLOR_MAKE(0xAF, 0xB4, 0x2B), LV_COLOR_MAKE(0x9E, 0x9D, 0x24), LV_COLOR_MAKE(0x82, 0x77, 0x17)}, + {LV_COLOR_MAKE(0xFD, 0xD8, 0x35), LV_COLOR_MAKE(0xFB, 0xC0, 0x2D), LV_COLOR_MAKE(0xF9, 0xA8, 0x25), LV_COLOR_MAKE(0xF5, 0x7F, 0x17)}, + {LV_COLOR_MAKE(0xFF, 0xB3, 0x00), LV_COLOR_MAKE(0xFF, 0xA0, 0x00), LV_COLOR_MAKE(0xFF, 0x8F, 0x00), LV_COLOR_MAKE(0xFF, 0x6F, 0x00)}, + {LV_COLOR_MAKE(0xFB, 0x8C, 0x00), LV_COLOR_MAKE(0xF5, 0x7C, 0x00), LV_COLOR_MAKE(0xEF, 0x6C, 0x00), LV_COLOR_MAKE(0xE6, 0x51, 0x00)}, + {LV_COLOR_MAKE(0xF4, 0x51, 0x1E), LV_COLOR_MAKE(0xE6, 0x4A, 0x19), LV_COLOR_MAKE(0xD8, 0x43, 0x15), LV_COLOR_MAKE(0xBF, 0x36, 0x0C)}, + {LV_COLOR_MAKE(0x6D, 0x4C, 0x41), LV_COLOR_MAKE(0x5D, 0x40, 0x37), LV_COLOR_MAKE(0x4E, 0x34, 0x2E), LV_COLOR_MAKE(0x3E, 0x27, 0x23)}, + {LV_COLOR_MAKE(0x54, 0x6E, 0x7A), LV_COLOR_MAKE(0x45, 0x5A, 0x64), LV_COLOR_MAKE(0x37, 0x47, 0x4F), LV_COLOR_MAKE(0x26, 0x32, 0x38)}, + {LV_COLOR_MAKE(0x75, 0x75, 0x75), LV_COLOR_MAKE(0x61, 0x61, 0x61), LV_COLOR_MAKE(0x42, 0x42, 0x42), LV_COLOR_MAKE(0x21, 0x21, 0x21)}, + }; + + if(p >= _LV_PALETTE_LAST) { + LV_LOG_WARN("Invalid palette: %d", p); + return lv_color_black(); + } -uint8_t lv_color32_luminance(lv_color32_t c) -{ - return (uint8_t)((uint16_t)(77u * c.red + 151u * c.green + 28u * c.blue) >> 8); -} + if(lvl == 0 || lvl > 4) { + LV_LOG_WARN("Invalid level: %d. Must be 1..4", lvl); + return lv_color_black(); + } -/********************** - * STATIC FUNCTIONS - **********************/ + lvl--; -/** - * Helper function to easily create color filters - * @param dsc pointer to a color filter descriptor - * @param c the color to modify - * @param opa the intensity of the modification - * - LV_OPA_50: do nothing - * - < LV_OPA_50: darken - * - LV_OPA_0: fully black - * - > LV_OPA_50: lighten - * - LV_OPA_100: fully white - * @return the modified color - */ -static lv_color_t lv_color_filter_shade_cb(const lv_color_filter_dsc_t * dsc, lv_color_t c, lv_opa_t opa) -{ - LV_UNUSED(dsc); - if(opa == LV_OPA_50) return c; - if(opa < LV_OPA_50) return lv_color_lighten(c, (LV_OPA_50 - opa) * 2); - else return lv_color_darken(c, (opa - LV_OPA_50 * LV_OPA_50) * 2); + return colors[p][lvl]; } diff --git a/L3_Middlewares/LVGL/src/misc/lv_color.h b/L3_Middlewares/LVGL/src/misc/lv_color.h index 6328c0d..61b5013 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_color.h +++ b/L3_Middlewares/LVGL/src/misc/lv_color.h @@ -1,4 +1,4 @@ -/** +/** * @file lv_color.h * */ @@ -18,25 +18,26 @@ extern "C" { #include "lv_math.h" #include "lv_types.h" +/*Error checking*/ +#if LV_COLOR_DEPTH == 24 +#error "LV_COLOR_DEPTH 24 is deprecated. Use LV_COLOR_DEPTH 32 instead (lv_conf.h)" +#endif + +#if LV_COLOR_DEPTH != 16 && LV_COLOR_16_SWAP != 0 +#error "LV_COLOR_16_SWAP requires LV_COLOR_DEPTH == 16. Set it in lv_conf.h" +#endif + +#include + /********************* * DEFINES *********************/ LV_EXPORT_CONST_INT(LV_COLOR_DEPTH); - -#if LV_COLOR_DEPTH == 8 -#define LV_COLOR_NATIVE_WITH_ALPHA_SIZE 2 -#elif LV_COLOR_DEPTH == 16 -#define LV_COLOR_NATIVE_WITH_ALPHA_SIZE 3 -#elif LV_COLOR_DEPTH == 24 -#define LV_COLOR_NATIVE_WITH_ALPHA_SIZE 4 -#elif LV_COLOR_DEPTH == 32 -#define LV_COLOR_NATIVE_WITH_ALPHA_SIZE 4 -#endif +LV_EXPORT_CONST_INT(LV_COLOR_16_SWAP); /** * Opacity percentages. */ - enum { LV_OPA_TRANSP = 0, LV_OPA_0 = 0, @@ -53,294 +54,605 @@ enum { LV_OPA_COVER = 255, }; -#define LV_OPA_MIN 2 /**< Opacities below this will be transparent */ -#define LV_OPA_MAX 253 /**< Opacities above this will fully cover */ +#define LV_OPA_MIN 2 /*Opacities below this will be transparent*/ +#define LV_OPA_MAX 253 /*Opacities above this will fully cover*/ -/** - * Get the pixel size of a color format in bits, bpp - * @param cf a color format (`LV_COLOR_FORMAT_...`) - * @return the pixel size in bits - * @sa lv_color_format_get_bpp - */ -#define LV_COLOR_FORMAT_GET_BPP(cf) ( \ - (cf) == LV_COLOR_FORMAT_I1 ? 1 : \ - (cf) == LV_COLOR_FORMAT_A1 ? 1 : \ - (cf) == LV_COLOR_FORMAT_I2 ? 2 : \ - (cf) == LV_COLOR_FORMAT_A2 ? 2 : \ - (cf) == LV_COLOR_FORMAT_I4 ? 4 : \ - (cf) == LV_COLOR_FORMAT_A4 ? 4 : \ - (cf) == LV_COLOR_FORMAT_L8 ? 8 : \ - (cf) == LV_COLOR_FORMAT_A8 ? 8 : \ - (cf) == LV_COLOR_FORMAT_I8 ? 8 : \ - (cf) == LV_COLOR_FORMAT_AL88 ? 16 : \ - (cf) == LV_COLOR_FORMAT_RGB565 ? 16 : \ - (cf) == LV_COLOR_FORMAT_RGB565A8 ? 16 : \ - (cf) == LV_COLOR_FORMAT_ARGB8565 ? 24 : \ - (cf) == LV_COLOR_FORMAT_RGB888 ? 24 : \ - (cf) == LV_COLOR_FORMAT_ARGB8888 ? 32 : \ - (cf) == LV_COLOR_FORMAT_XRGB8888 ? 32 : \ - 0 \ - ) +#if LV_COLOR_DEPTH == 1 +#define LV_COLOR_SIZE 8 +#elif LV_COLOR_DEPTH == 8 +#define LV_COLOR_SIZE 8 +#elif LV_COLOR_DEPTH == 16 +#define LV_COLOR_SIZE 16 +#elif LV_COLOR_DEPTH == 32 +#define LV_COLOR_SIZE 32 +#else +#error "Invalid LV_COLOR_DEPTH in lv_conf.h! Set it to 1, 8, 16 or 32!" +#endif +#if defined(__cplusplus) && !defined(_LV_COLOR_HAS_MODERN_CPP) /** - * Get the pixel size of a color format in bytes - * @param cf a color format (`LV_COLOR_FORMAT_...`) - * @return the pixel size in bytes - * @sa lv_color_format_get_size - */ -#define LV_COLOR_FORMAT_GET_SIZE(cf) ((LV_COLOR_FORMAT_GET_BPP(cf) + 7) >> 3) +* MSVC compiler's definition of the __cplusplus indicating 199711L regardless to C++ standard version +* see https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-cplusplus +* so we use _MSC_VER macro instead of __cplusplus +*/ +#ifdef _MSC_VER +#if _MSC_VER >= 1900 /*Visual Studio 2015*/ +#define _LV_COLOR_HAS_MODERN_CPP 1 +#endif +#else +#if __cplusplus >= 201103L +#define _LV_COLOR_HAS_MODERN_CPP 1 +#endif +#endif +#endif /*__cplusplus*/ + +#ifndef _LV_COLOR_HAS_MODERN_CPP +#define _LV_COLOR_HAS_MODERN_CPP 0 +#endif + +#if _LV_COLOR_HAS_MODERN_CPP +/*Fix msvc compiler error C4576 inside C++ code*/ +#define _LV_COLOR_MAKE_TYPE_HELPER lv_color_t +#else +#define _LV_COLOR_MAKE_TYPE_HELPER (lv_color_t) +#endif + +/*--------------------------------------- + * Macros for all existing color depths + * to set/get values of the color channels + *------------------------------------------*/ +# define LV_COLOR_SET_R1(c, v) (c).ch.red = (uint8_t)((v) & 0x1) +# define LV_COLOR_SET_G1(c, v) (c).ch.green = (uint8_t)((v) & 0x1) +# define LV_COLOR_SET_B1(c, v) (c).ch.blue = (uint8_t)((v) & 0x1) +# define LV_COLOR_SET_A1(c, v) do {} while(0) + +# define LV_COLOR_GET_R1(c) (c).ch.red +# define LV_COLOR_GET_G1(c) (c).ch.green +# define LV_COLOR_GET_B1(c) (c).ch.blue +# define LV_COLOR_GET_A1(c) 0xFF + +# define _LV_COLOR_ZERO_INITIALIZER1 {0x00} +# define LV_COLOR_MAKE1(r8, g8, b8) {(uint8_t)((b8 >> 7) | (g8 >> 7) | (r8 >> 7))} + +# define LV_COLOR_SET_R8(c, v) (c).ch.red = (uint8_t)((v) & 0x7U) +# define LV_COLOR_SET_G8(c, v) (c).ch.green = (uint8_t)((v) & 0x7U) +# define LV_COLOR_SET_B8(c, v) (c).ch.blue = (uint8_t)((v) & 0x3U) +# define LV_COLOR_SET_A8(c, v) do {} while(0) + +# define LV_COLOR_GET_R8(c) (c).ch.red +# define LV_COLOR_GET_G8(c) (c).ch.green +# define LV_COLOR_GET_B8(c) (c).ch.blue +# define LV_COLOR_GET_A8(c) 0xFF + +# define _LV_COLOR_ZERO_INITIALIZER8 {{0x00, 0x00, 0x00}} +# define LV_COLOR_MAKE8(r8, g8, b8) {{(uint8_t)((b8 >> 6) & 0x3U), (uint8_t)((g8 >> 5) & 0x7U), (uint8_t)((r8 >> 5) & 0x7U)}} + +# define LV_COLOR_SET_R16(c, v) (c).ch.red = (uint8_t)((v) & 0x1FU) +#if LV_COLOR_16_SWAP == 0 +# define LV_COLOR_SET_G16(c, v) (c).ch.green = (uint8_t)((v) & 0x3FU) +#else +# define LV_COLOR_SET_G16(c, v) {(c).ch.green_h = (uint8_t)(((v) >> 3) & 0x7); (c).ch.green_l = (uint8_t)((v) & 0x7);} +#endif +# define LV_COLOR_SET_B16(c, v) (c).ch.blue = (uint8_t)((v) & 0x1FU) +# define LV_COLOR_SET_A16(c, v) do {} while(0) + +# define LV_COLOR_GET_R16(c) (c).ch.red +#if LV_COLOR_16_SWAP == 0 +# define LV_COLOR_GET_G16(c) (c).ch.green +#else +# define LV_COLOR_GET_G16(c) (((c).ch.green_h << 3) + (c).ch.green_l) +#endif +# define LV_COLOR_GET_B16(c) (c).ch.blue +# define LV_COLOR_GET_A16(c) 0xFF + +#if LV_COLOR_16_SWAP == 0 +# define _LV_COLOR_ZERO_INITIALIZER16 {{0x00, 0x00, 0x00}} +# define LV_COLOR_MAKE16(r8, g8, b8) {{(uint8_t)((b8 >> 3) & 0x1FU), (uint8_t)((g8 >> 2) & 0x3FU), (uint8_t)((r8 >> 3) & 0x1FU)}} +#else +# define _LV_COLOR_ZERO_INITIALIZER16 {{0x00, 0x00, 0x00, 0x00}} +# define LV_COLOR_MAKE16(r8, g8, b8) {{(uint8_t)((g8 >> 5) & 0x7U), (uint8_t)((r8 >> 3) & 0x1FU), (uint8_t)((b8 >> 3) & 0x1FU), (uint8_t)((g8 >> 2) & 0x7U)}} +#endif + +# define LV_COLOR_SET_R32(c, v) (c).ch.red = (uint8_t)((v) & 0xFF) +# define LV_COLOR_SET_G32(c, v) (c).ch.green = (uint8_t)((v) & 0xFF) +# define LV_COLOR_SET_B32(c, v) (c).ch.blue = (uint8_t)((v) & 0xFF) +# define LV_COLOR_SET_A32(c, v) (c).ch.alpha = (uint8_t)((v) & 0xFF) + +# define LV_COLOR_GET_R32(c) (c).ch.red +# define LV_COLOR_GET_G32(c) (c).ch.green +# define LV_COLOR_GET_B32(c) (c).ch.blue +# define LV_COLOR_GET_A32(c) (c).ch.alpha + +# define _LV_COLOR_ZERO_INITIALIZER32 {{0x00, 0x00, 0x00, 0x00}} +# define LV_COLOR_MAKE32(r8, g8, b8) {{b8, g8, r8, 0xff}} /*Fix 0xff alpha*/ + +/*--------------------------------------- + * Macros for the current color depth + * to set/get values of the color channels + *------------------------------------------*/ +#define LV_COLOR_SET_R(c, v) LV_CONCAT(LV_COLOR_SET_R, LV_COLOR_DEPTH)(c, v) +#define LV_COLOR_SET_G(c, v) LV_CONCAT(LV_COLOR_SET_G, LV_COLOR_DEPTH)(c, v) +#define LV_COLOR_SET_B(c, v) LV_CONCAT(LV_COLOR_SET_B, LV_COLOR_DEPTH)(c, v) +#define LV_COLOR_SET_A(c, v) LV_CONCAT(LV_COLOR_SET_A, LV_COLOR_DEPTH)(c, v) + +#define LV_COLOR_GET_R(c) LV_CONCAT(LV_COLOR_GET_R, LV_COLOR_DEPTH)(c) +#define LV_COLOR_GET_G(c) LV_CONCAT(LV_COLOR_GET_G, LV_COLOR_DEPTH)(c) +#define LV_COLOR_GET_B(c) LV_CONCAT(LV_COLOR_GET_B, LV_COLOR_DEPTH)(c) +#define LV_COLOR_GET_A(c) LV_CONCAT(LV_COLOR_GET_A, LV_COLOR_DEPTH)(c) + +#define _LV_COLOR_ZERO_INITIALIZER LV_CONCAT(_LV_COLOR_ZERO_INITIALIZER, LV_COLOR_DEPTH) +#define LV_COLOR_MAKE(r8, g8, b8) LV_CONCAT(LV_COLOR_MAKE, LV_COLOR_DEPTH)(r8, g8, b8) /********************** * TYPEDEFS **********************/ -typedef struct { - uint8_t blue; - uint8_t green; - uint8_t red; -} lv_color_t; - -typedef struct { - uint16_t blue : 5; - uint16_t green : 6; - uint16_t red : 5; +typedef union { + uint8_t full; /*must be declared first to set all bits of byte via initializer list*/ + union { + uint8_t blue : 1; + uint8_t green : 1; + uint8_t red : 1; + } ch; +} lv_color1_t; + +typedef union { + struct { + uint8_t blue : 2; + uint8_t green : 3; + uint8_t red : 3; + } ch; + uint8_t full; +} lv_color8_t; + +typedef union { + struct { +#if LV_COLOR_16_SWAP == 0 + uint16_t blue : 5; + uint16_t green : 6; + uint16_t red : 5; +#else + uint16_t green_h : 3; + uint16_t red : 5; + uint16_t blue : 5; + uint16_t green_l : 3; +#endif + } ch; + uint16_t full; } lv_color16_t; -typedef struct { - uint8_t blue; - uint8_t green; - uint8_t red; - uint8_t alpha; +typedef union { + struct { + uint8_t blue; + uint8_t green; + uint8_t red; + uint8_t alpha; + } ch; + uint32_t full; } lv_color32_t; +typedef LV_CONCAT3(uint, LV_COLOR_SIZE, _t) lv_color_int_t; +typedef LV_CONCAT3(lv_color, LV_COLOR_DEPTH, _t) lv_color_t; + typedef struct { uint16_t h; uint8_t s; uint8_t v; } lv_color_hsv_t; -typedef struct { - uint8_t lumi; - uint8_t alpha; -} lv_color16a_t; +//! @cond Doxygen_Suppress +/*No idea where the guard is required but else throws warnings in the docs*/ +typedef uint8_t lv_opa_t; +//! @endcond -typedef enum { - LV_COLOR_FORMAT_UNKNOWN = 0, - - LV_COLOR_FORMAT_RAW = 0x01, - LV_COLOR_FORMAT_RAW_ALPHA = 0x02, - - /*<=1 byte (+alpha) formats*/ - LV_COLOR_FORMAT_L8 = 0x06, - LV_COLOR_FORMAT_I1 = 0x07, - LV_COLOR_FORMAT_I2 = 0x08, - LV_COLOR_FORMAT_I4 = 0x09, - LV_COLOR_FORMAT_I8 = 0x0A, - LV_COLOR_FORMAT_A8 = 0x0E, - - /*2 byte (+alpha) formats*/ - LV_COLOR_FORMAT_RGB565 = 0x12, - LV_COLOR_FORMAT_ARGB8565 = 0x13, /**< Not supported by sw renderer yet. */ - LV_COLOR_FORMAT_RGB565A8 = 0x14, /**< Color array followed by Alpha array*/ - LV_COLOR_FORMAT_AL88 = 0x15, /**< L8 with alpha >*/ - - /*3 byte (+alpha) formats*/ - LV_COLOR_FORMAT_RGB888 = 0x0F, - LV_COLOR_FORMAT_ARGB8888 = 0x10, - LV_COLOR_FORMAT_XRGB8888 = 0x11, - - /*Formats not supported by software renderer but kept here so GPU can use it*/ - LV_COLOR_FORMAT_A1 = 0x0B, - LV_COLOR_FORMAT_A2 = 0x0C, - LV_COLOR_FORMAT_A4 = 0x0D, - - /* reference to https://wiki.videolan.org/YUV/ */ - /*YUV planar formats*/ - LV_COLOR_FORMAT_YUV_START = 0x20, - LV_COLOR_FORMAT_I420 = LV_COLOR_FORMAT_YUV_START, /*YUV420 planar(3 plane)*/ - LV_COLOR_FORMAT_I422 = 0x21, /*YUV422 planar(3 plane)*/ - LV_COLOR_FORMAT_I444 = 0x22, /*YUV444 planar(3 plane)*/ - LV_COLOR_FORMAT_I400 = 0x23, /*YUV400 no chroma channel*/ - LV_COLOR_FORMAT_NV21 = 0x24, /*YUV420 planar(2 plane), UV plane in 'V, U, V, U'*/ - LV_COLOR_FORMAT_NV12 = 0x25, /*YUV420 planar(2 plane), UV plane in 'U, V, U, V'*/ - - /*YUV packed formats*/ - LV_COLOR_FORMAT_YUY2 = 0x26, /*YUV422 packed like 'Y U Y V'*/ - LV_COLOR_FORMAT_UYVY = 0x27, /*YUV422 packed like 'U Y V Y'*/ - - LV_COLOR_FORMAT_YUV_END = LV_COLOR_FORMAT_UYVY, - - /*Color formats in which LVGL can render*/ -#if LV_COLOR_DEPTH == 1 - LV_COLOR_FORMAT_NATIVE = LV_COLOR_FORMAT_I1, - LV_COLOR_FORMAT_NATIVE_WITH_ALPHA = LV_COLOR_FORMAT_I1, -#elif LV_COLOR_DEPTH == 8 - LV_COLOR_FORMAT_NATIVE = LV_COLOR_FORMAT_L8, - LV_COLOR_FORMAT_NATIVE_WITH_ALPHA = LV_COLOR_FORMAT_AL88, -#elif LV_COLOR_DEPTH == 16 - LV_COLOR_FORMAT_NATIVE = LV_COLOR_FORMAT_RGB565, - LV_COLOR_FORMAT_NATIVE_WITH_ALPHA = LV_COLOR_FORMAT_RGB565A8, -#elif LV_COLOR_DEPTH == 24 - LV_COLOR_FORMAT_NATIVE = LV_COLOR_FORMAT_RGB888, - LV_COLOR_FORMAT_NATIVE_WITH_ALPHA = LV_COLOR_FORMAT_ARGB8888, -#elif LV_COLOR_DEPTH == 32 - LV_COLOR_FORMAT_NATIVE = LV_COLOR_FORMAT_XRGB8888, - LV_COLOR_FORMAT_NATIVE_WITH_ALPHA = LV_COLOR_FORMAT_ARGB8888, -#else -#error "LV_COLOR_DEPTH should be 1, 8, 16, 24 or 32" -#endif - -} lv_color_format_t; +struct _lv_color_filter_dsc_t; -#define LV_COLOR_FORMAT_IS_ALPHA_ONLY(cf) ((cf) >= LV_COLOR_FORMAT_A1 && (cf) <= LV_COLOR_FORMAT_A8) -#define LV_COLOR_FORMAT_IS_INDEXED(cf) ((cf) >= LV_COLOR_FORMAT_I1 && (cf) <= LV_COLOR_FORMAT_I8) -#define LV_COLOR_FORMAT_IS_YUV(cf) ((cf) >= LV_COLOR_FORMAT_YUV_START && (cf) <= LV_COLOR_FORMAT_YUV_END) -#define LV_COLOR_INDEXED_PALETTE_SIZE(cf) ((cf) == LV_COLOR_FORMAT_I1 ? 2 :\ - (cf) == LV_COLOR_FORMAT_I2 ? 4 :\ - (cf) == LV_COLOR_FORMAT_I4 ? 16 :\ - (cf) == LV_COLOR_FORMAT_I8 ? 256 : 0) +typedef lv_color_t (*lv_color_filter_cb_t)(const struct _lv_color_filter_dsc_t *, lv_color_t, lv_opa_t); -/********************** - * MACROS - **********************/ +typedef struct _lv_color_filter_dsc_t { + lv_color_filter_cb_t filter_cb; + void * user_data; +} lv_color_filter_dsc_t; -#define LV_COLOR_MAKE(r8, g8, b8) {b8, g8, r8} -#define LV_OPA_MIX2(a1, a2) (((int32_t)(a1) * (a2)) >> 8) -#define LV_OPA_MIX3(a1, a2, a3) (((int32_t)(a1) * (a2) * (a3)) >> 16) +typedef enum { + LV_PALETTE_RED, + LV_PALETTE_PINK, + LV_PALETTE_PURPLE, + LV_PALETTE_DEEP_PURPLE, + LV_PALETTE_INDIGO, + LV_PALETTE_BLUE, + LV_PALETTE_LIGHT_BLUE, + LV_PALETTE_CYAN, + LV_PALETTE_TEAL, + LV_PALETTE_GREEN, + LV_PALETTE_LIGHT_GREEN, + LV_PALETTE_LIME, + LV_PALETTE_YELLOW, + LV_PALETTE_AMBER, + LV_PALETTE_ORANGE, + LV_PALETTE_DEEP_ORANGE, + LV_PALETTE_BROWN, + LV_PALETTE_BLUE_GREY, + LV_PALETTE_GREY, + _LV_PALETTE_LAST, + LV_PALETTE_NONE = 0xff, +} lv_palette_t; /********************** * GLOBAL PROTOTYPES **********************/ -/** - * Get the pixel size of a color format in bits, bpp - * @param cf a color format (`LV_COLOR_FORMAT_...`) - * @return the pixel size in bits - * @sa LV_COLOR_FORMAT_GET_BPP +/*In color conversations: + * - When converting to bigger color type the LSB weight of 1 LSB is calculated + * E.g. 16 bit Red has 5 bits + * 8 bit Red has 3 bits + * ---------------------- + * 8 bit red LSB = (2^5 - 1) / (2^3 - 1) = 31 / 7 = 4 + * + * - When calculating to smaller color type simply shift out the LSBs + * E.g. 8 bit Red has 3 bits + * 16 bit Red has 5 bits + * ---------------------- + * Shift right with 5 - 3 = 2 */ -uint8_t lv_color_format_get_bpp(lv_color_format_t cf); +static inline uint8_t lv_color_to1(lv_color_t color) +{ +#if LV_COLOR_DEPTH == 1 + return color.full; +#elif LV_COLOR_DEPTH == 8 + if((LV_COLOR_GET_R(color) & 0x4) || (LV_COLOR_GET_G(color) & 0x4) || (LV_COLOR_GET_B(color) & 0x2)) { + return 1; + } + else { + return 0; + } +#elif LV_COLOR_DEPTH == 16 + if((LV_COLOR_GET_R(color) & 0x10) || (LV_COLOR_GET_G(color) & 0x20) || (LV_COLOR_GET_B(color) & 0x10)) { + return 1; + } + else { + return 0; + } +#elif LV_COLOR_DEPTH == 32 + if((LV_COLOR_GET_R(color) & 0x80) || (LV_COLOR_GET_G(color) & 0x80) || (LV_COLOR_GET_B(color) & 0x80)) { + return 1; + } + else { + return 0; + } +#endif +} -/** - * Get the pixel size of a color format in bytes - * @param cf a color format (`LV_COLOR_FORMAT_...`) - * @return the pixel size in bytes - * @sa LV_COLOR_FORMAT_GET_SIZE - */ -uint8_t lv_color_format_get_size(lv_color_format_t cf); +static inline uint8_t lv_color_to8(lv_color_t color) +{ +#if LV_COLOR_DEPTH == 1 + if(color.full == 0) + return 0; + else + return 0xFF; +#elif LV_COLOR_DEPTH == 8 + return color.full; +#elif LV_COLOR_DEPTH == 16 + lv_color8_t ret; + LV_COLOR_SET_R8(ret, LV_COLOR_GET_R(color) >> 2); /*5 - 3 = 2*/ + LV_COLOR_SET_G8(ret, LV_COLOR_GET_G(color) >> 3); /*6 - 3 = 3*/ + LV_COLOR_SET_B8(ret, LV_COLOR_GET_B(color) >> 3); /*5 - 2 = 3*/ + return ret.full; +#elif LV_COLOR_DEPTH == 32 + lv_color8_t ret; + LV_COLOR_SET_R8(ret, LV_COLOR_GET_R(color) >> 5); /*8 - 3 = 5*/ + LV_COLOR_SET_G8(ret, LV_COLOR_GET_G(color) >> 5); /*8 - 3 = 5*/ + LV_COLOR_SET_B8(ret, LV_COLOR_GET_B(color) >> 6); /*8 - 2 = 6*/ + return ret.full; +#endif +} -/** - * Check if a color format has alpha channel or not - * @param src_cf a color format (`LV_COLOR_FORMAT_...`) - * @return true: has alpha channel; false: doesn't have alpha channel - */ -bool lv_color_format_has_alpha(lv_color_format_t src_cf); +static inline uint16_t lv_color_to16(lv_color_t color) +{ +#if LV_COLOR_DEPTH == 1 + if(color.full == 0) + return 0; + else + return 0xFFFF; +#elif LV_COLOR_DEPTH == 8 + lv_color16_t ret; + LV_COLOR_SET_R16(ret, LV_COLOR_GET_R(color) * 4); /*(2^5 - 1)/(2^3 - 1) = 31/7 = 4*/ + LV_COLOR_SET_G16(ret, LV_COLOR_GET_G(color) * 9); /*(2^6 - 1)/(2^3 - 1) = 63/7 = 9*/ + LV_COLOR_SET_B16(ret, LV_COLOR_GET_B(color) * 10); /*(2^5 - 1)/(2^2 - 1) = 31/3 = 10*/ + return ret.full; +#elif LV_COLOR_DEPTH == 16 + return color.full; +#elif LV_COLOR_DEPTH == 32 + lv_color16_t ret; + LV_COLOR_SET_R16(ret, LV_COLOR_GET_R(color) >> 3); /*8 - 5 = 3*/ + LV_COLOR_SET_G16(ret, LV_COLOR_GET_G(color) >> 2); /*8 - 6 = 2*/ + LV_COLOR_SET_B16(ret, LV_COLOR_GET_B(color) >> 3); /*8 - 5 = 3*/ + return ret.full; +#endif +} -/** - * Create an ARGB8888 color from RGB888 + alpha - * @param color an RGB888 color - * @param opa the alpha value - * @return the ARGB8888 color - */ -lv_color32_t lv_color_to_32(lv_color_t color, lv_opa_t opa); +static inline uint32_t lv_color_to32(lv_color_t color) +{ +#if LV_COLOR_DEPTH == 1 + if(color.full == 0) + return 0xFF000000; + else + return 0xFFFFFFFF; +#elif LV_COLOR_DEPTH == 8 + lv_color32_t ret; + LV_COLOR_SET_R32(ret, LV_COLOR_GET_R(color) * 36); /*(2^8 - 1)/(2^3 - 1) = 255/7 = 36*/ + LV_COLOR_SET_G32(ret, LV_COLOR_GET_G(color) * 36); /*(2^8 - 1)/(2^3 - 1) = 255/7 = 36*/ + LV_COLOR_SET_B32(ret, LV_COLOR_GET_B(color) * 85); /*(2^8 - 1)/(2^2 - 1) = 255/3 = 85*/ + LV_COLOR_SET_A32(ret, 0xFF); + return ret.full; +#elif LV_COLOR_DEPTH == 16 + /** + * The floating point math for conversion is: + * valueto = valuefrom * ( (2^bitsto - 1) / (float)(2^bitsfrom - 1) ) + * The faster integer math for conversion is: + * valueto = ( valuefrom * multiplier + adder ) >> divisor + * multiplier = FLOOR( ( (2^bitsto - 1) << divisor ) / (float)(2^bitsfrom - 1) ) + * + * Find the first divisor where ( adder >> divisor ) <= 0 + * + * 5-bit to 8-bit: ( 31 * multiplier + adder ) >> divisor = 255 + * divisor multiplier adder min (0) max (31) + * 0 8 7 7 255 + * 1 16 14 7 255 + * 2 32 28 7 255 + * 3 65 25 3 255 + * 4 131 19 1 255 + * 5 263 7 0 255 + * + * 6-bit to 8-bit: 255 = ( 63 * multiplier + adder ) >> divisor + * divisor multiplier adder min (0) max (63) + * 0 4 3 3 255 + * 1 8 6 3 255 + * 2 16 12 3 255 + * 3 32 24 3 255 + * 4 64 48 3 255 + * 5 129 33 1 255 + * 6 259 3 0 255 + */ + + lv_color32_t ret; + LV_COLOR_SET_R32(ret, (LV_COLOR_GET_R(color) * 263 + 7) >> 5); + LV_COLOR_SET_G32(ret, (LV_COLOR_GET_G(color) * 259 + 3) >> 6); + LV_COLOR_SET_B32(ret, (LV_COLOR_GET_B(color) * 263 + 7) >> 5); + LV_COLOR_SET_A32(ret, 0xFF); + return ret.full; +#elif LV_COLOR_DEPTH == 32 + return color.full; +#endif +} -/** - * Convert an RGB888 color to an integer - * @param c an RGB888 color - * @return `c` as an integer - */ -uint32_t lv_color_to_int(lv_color_t c); +//! @cond Doxygen_Suppress /** - * Check if two RGB888 color are equal - * @param c1 the first color - * @param c2 the second color - * @return true: equal + * Mix two colors with a given ratio. + * @param c1 the first color to mix (usually the foreground) + * @param c2 the second color to mix (usually the background) + * @param mix The ratio of the colors. 0: full `c2`, 255: full `c1`, 127: half `c1` and half`c2` + * @return the mixed color */ -bool lv_color_eq(lv_color_t c1, lv_color_t c2); +static inline lv_color_t LV_ATTRIBUTE_FAST_MEM lv_color_mix(lv_color_t c1, lv_color_t c2, uint8_t mix) +{ + lv_color_t ret; + +#if LV_COLOR_DEPTH == 16 && LV_COLOR_MIX_ROUND_OFS == 0 +#if LV_COLOR_16_SWAP == 1 + c1.full = c1.full << 8 | c1.full >> 8; + c2.full = c2.full << 8 | c2.full >> 8; +#endif + /*Source: https://stackoverflow.com/a/50012418/1999969*/ + mix = (uint32_t)((uint32_t)mix + 4) >> 3; + uint32_t bg = (uint32_t)((uint32_t)c2.full | ((uint32_t)c2.full << 16)) & + 0x7E0F81F; /*0b00000111111000001111100000011111*/ + uint32_t fg = (uint32_t)((uint32_t)c1.full | ((uint32_t)c1.full << 16)) & 0x7E0F81F; + uint32_t result = ((((fg - bg) * mix) >> 5) + bg) & 0x7E0F81F; + ret.full = (uint16_t)((result >> 16) | result); +#if LV_COLOR_16_SWAP == 1 + ret.full = ret.full << 8 | ret.full >> 8; +#endif +#elif LV_COLOR_DEPTH != 1 + /*LV_COLOR_DEPTH == 8, 16 or 32*/ + LV_COLOR_SET_R(ret, LV_UDIV255((uint16_t)LV_COLOR_GET_R(c1) * mix + LV_COLOR_GET_R(c2) * + (255 - mix) + LV_COLOR_MIX_ROUND_OFS)); + LV_COLOR_SET_G(ret, LV_UDIV255((uint16_t)LV_COLOR_GET_G(c1) * mix + LV_COLOR_GET_G(c2) * + (255 - mix) + LV_COLOR_MIX_ROUND_OFS)); + LV_COLOR_SET_B(ret, LV_UDIV255((uint16_t)LV_COLOR_GET_B(c1) * mix + LV_COLOR_GET_B(c2) * + (255 - mix) + LV_COLOR_MIX_ROUND_OFS)); + LV_COLOR_SET_A(ret, 0xFF); +#else + /*LV_COLOR_DEPTH == 1*/ + ret.full = mix > LV_OPA_50 ? c1.full : c2.full; +#endif -/** - * Check if two ARGB8888 color are equal - * @param c1 the first color - * @param c2 the second color - * @return true: equal - */ -bool lv_color32_eq(lv_color32_t c1, lv_color32_t c2); + return ret; +} -/** - * Create a color from 0x000000..0xffffff input - * @param c the hex input - * @return the color - */ -lv_color_t lv_color_hex(uint32_t c); +static inline void LV_ATTRIBUTE_FAST_MEM lv_color_premult(lv_color_t c, uint8_t mix, uint16_t * out) +{ +#if LV_COLOR_DEPTH != 1 + out[0] = (uint16_t)LV_COLOR_GET_R(c) * mix; + out[1] = (uint16_t)LV_COLOR_GET_G(c) * mix; + out[2] = (uint16_t)LV_COLOR_GET_B(c) * mix; +#else + (void) mix; + /*Pre-multiplication can't be used with 1 bpp*/ + out[0] = LV_COLOR_GET_R(c); + out[1] = LV_COLOR_GET_G(c); + out[2] = LV_COLOR_GET_B(c); +#endif -/** - * Create an RGB888 color - * @param r the red channel (0..255) - * @param g the green channel (0..255) - * @param b the blue channel (0..255) - * @return the color - */ -lv_color_t lv_color_make(uint8_t r, uint8_t g, uint8_t b); +} /** - * Create an ARGB8888 color - * @param r the red channel (0..255) - * @param g the green channel (0..255) - * @param b the blue channel (0..255) - * @param a the alpha channel (0..255) - * @return the color + * Mix two colors with a given ratio. It runs faster then `lv_color_mix` but requires some pre computation. + * @param premult_c1 The first color. Should be preprocessed with `lv_color_premult(c1)` + * @param c2 The second color. As it is no pre computation required on it + * @param mix The ratio of the colors. 0: full `c1`, 255: full `c2`, 127: half `c1` and half `c2`. + * Should be modified like mix = `255 - mix` + * @return the mixed color + * @note 255 won't give clearly `c1`. */ -lv_color32_t lv_color32_make(uint8_t r, uint8_t g, uint8_t b, uint8_t a); +static inline lv_color_t LV_ATTRIBUTE_FAST_MEM lv_color_mix_premult(uint16_t * premult_c1, lv_color_t c2, uint8_t mix) +{ + lv_color_t ret; +#if LV_COLOR_DEPTH != 1 + /*LV_COLOR_DEPTH == 8 or 32*/ + LV_COLOR_SET_R(ret, LV_UDIV255(premult_c1[0] + LV_COLOR_GET_R(c2) * mix + LV_COLOR_MIX_ROUND_OFS)); + LV_COLOR_SET_G(ret, LV_UDIV255(premult_c1[1] + LV_COLOR_GET_G(c2) * mix + LV_COLOR_MIX_ROUND_OFS)); + LV_COLOR_SET_B(ret, LV_UDIV255(premult_c1[2] + LV_COLOR_GET_B(c2) * mix + LV_COLOR_MIX_ROUND_OFS)); + LV_COLOR_SET_A(ret, 0xFF); +#else + /*LV_COLOR_DEPTH == 1*/ + /*Restore color1*/ + lv_color_t c1; + LV_COLOR_SET_R(c1, premult_c1[0]); + LV_COLOR_SET_G(c1, premult_c1[1]); + LV_COLOR_SET_B(c1, premult_c1[2]); + ret.full = mix > LV_OPA_50 ? c2.full : c1.full; +#endif -/** - * Create a color from 0x000..0xfff input - * @param c the hex input (e.g. 0x123 will be 0x112233) - * @return the color - */ -lv_color_t lv_color_hex3(uint32_t c); + return ret; +} /** - * Convert am RGB888 color to RGB565 stored in `uint16_t` - * @param color and RGB888 color - * @return `color` as RGB565 on `uin16_t` + * Mix two colors. Both color can have alpha value. + * @param bg_color background color + * @param bg_opa alpha of the background color + * @param fg_color foreground color + * @param fg_opa alpha of the foreground color + * @param res_color the result color + * @param res_opa the result opacity */ -uint16_t lv_color_to_u16(lv_color_t color); +static inline void LV_ATTRIBUTE_FAST_MEM lv_color_mix_with_alpha(lv_color_t bg_color, lv_opa_t bg_opa, + lv_color_t fg_color, lv_opa_t fg_opa, + lv_color_t * res_color, lv_opa_t * res_opa) +{ + /*Pick the foreground if it's fully opaque or the Background is fully transparent*/ + if(fg_opa >= LV_OPA_MAX || bg_opa <= LV_OPA_MIN) { + res_color->full = fg_color.full; + *res_opa = fg_opa; + } + /*Transparent foreground: use the Background*/ + else if(fg_opa <= LV_OPA_MIN) { + res_color->full = bg_color.full; + *res_opa = bg_opa; + } + /*Opaque background: use simple mix*/ + else if(bg_opa >= LV_OPA_MAX) { + *res_color = lv_color_mix(fg_color, bg_color, fg_opa); + *res_opa = LV_OPA_COVER; + } + /*Both colors have alpha. Expensive calculation need to be applied*/ + else { + /*Save the parameters and the result. If they will be asked again don't compute again*/ + static lv_opa_t fg_opa_save = 0; + static lv_opa_t bg_opa_save = 0; + static lv_color_t fg_color_save = _LV_COLOR_ZERO_INITIALIZER; + static lv_color_t bg_color_save = _LV_COLOR_ZERO_INITIALIZER; + static lv_color_t res_color_saved = _LV_COLOR_ZERO_INITIALIZER; + static lv_opa_t res_opa_saved = 0; + + if(fg_opa != fg_opa_save || bg_opa != bg_opa_save || fg_color.full != fg_color_save.full || + bg_color.full != bg_color_save.full) { + fg_opa_save = fg_opa; + bg_opa_save = bg_opa; + fg_color_save.full = fg_color.full; + bg_color_save.full = bg_color.full; + /*Info: + * https://en.wikipedia.org/wiki/Alpha_compositing#Analytical_derivation_of_the_over_operator*/ + res_opa_saved = 255 - ((uint16_t)((uint16_t)(255 - fg_opa) * (255 - bg_opa)) >> 8); + LV_ASSERT(res_opa_saved != 0); + lv_opa_t ratio = (uint16_t)((uint16_t)fg_opa * 255) / res_opa_saved; + res_color_saved = lv_color_mix(fg_color, bg_color, ratio); + + } + + res_color->full = res_color_saved.full; + *res_opa = res_opa_saved; + } +} + +//! @endcond /** - * Convert am RGB888 color to XRGB8888 stored in `uint32_t` - * @param color and RGB888 color - * @return `color` as XRGB8888 on `uin32_t` (the alpha channel is always set to 0xFF) + * Get the brightness of a color + * @param color a color + * @return the brightness [0..255] */ -uint32_t lv_color_to_u32(lv_color_t color); +static inline uint8_t lv_color_brightness(lv_color_t color) +{ + lv_color32_t c32; + c32.full = lv_color_to32(color); + uint16_t bright = (uint16_t)(3u * LV_COLOR_GET_R32(c32) + LV_COLOR_GET_B32(c32) + 4u * LV_COLOR_GET_G32(c32)); + return (uint8_t)(bright >> 3); +} + +static inline lv_color_t lv_color_make(uint8_t r, uint8_t g, uint8_t b) +{ + return _LV_COLOR_MAKE_TYPE_HELPER LV_COLOR_MAKE(r, g, b); +} + +static inline lv_color_t lv_color_hex(uint32_t c) +{ +#if LV_COLOR_DEPTH == 16 + lv_color_t r; +#if LV_COLOR_16_SWAP == 0 + /* Convert a 4 bytes per pixel in format ARGB32 to R5G6B5 format + naive way (by calling lv_color_make with components): + r = ((c & 0xFF0000) >> 19) + g = ((c & 0xFF00) >> 10) + b = ((c & 0xFF) >> 3) + rgb565 = (r << 11) | (g << 5) | b + That's 3 mask, 5 bitshift and 2 or operations + + A bit better: + r = ((c & 0xF80000) >> 8) + g = ((c & 0xFC00) >> 5) + b = ((c & 0xFF) >> 3) + rgb565 = r | g | b + That's 3 mask, 3 bitshifts and 2 or operations */ + r.full = (uint16_t)(((c & 0xF80000) >> 8) | ((c & 0xFC00) >> 5) | ((c & 0xFF) >> 3)); +#else + /* We want: rrrr rrrr GGGg gggg bbbb bbbb => gggb bbbb rrrr rGGG */ + r.full = (uint16_t)(((c & 0xF80000) >> 16) | ((c & 0xFC00) >> 13) | ((c & 0x1C00) << 3) | ((c & 0xF8) << 5)); +#endif + return r; +#elif LV_COLOR_DEPTH == 32 + lv_color_t r; + r.full = c | 0xFF000000; + return r; +#else /*LV_COLOR_DEPTH == 8*/ + return lv_color_make((uint8_t)((c >> 16) & 0xFF), (uint8_t)((c >> 8) & 0xFF), (uint8_t)(c & 0xFF)); +#endif +} -/** - * Mix two RGB565 colors - * @param c1 the first color (typically the foreground color) - * @param c2 the second color (typically the background color) - * @param mix 0..255, or LV_OPA_0/10/20... - * @return mix == 0: c2 - * mix == 255: c1 - * mix == 128: 0.5 x c1 + 0.5 x c2 - */ -uint16_t LV_ATTRIBUTE_FAST_MEM lv_color_16_16_mix(uint16_t c1, uint16_t c2, uint8_t mix); +static inline lv_color_t lv_color_hex3(uint32_t c) +{ + return lv_color_make((uint8_t)(((c >> 4) & 0xF0) | ((c >> 8) & 0xF)), (uint8_t)((c & 0xF0) | ((c & 0xF0) >> 4)), + (uint8_t)((c & 0xF) | ((c & 0xF) << 4))); +} -/** - * Mix white to a color - * @param c the base color - * @param lvl the intensity of white (0: no change, 255: fully white) - * @return the mixed color - */ +static inline void lv_color_filter_dsc_init(lv_color_filter_dsc_t * dsc, lv_color_filter_cb_t cb) +{ + dsc->filter_cb = cb; +} + +//! @cond Doxygen_Suppress +//! +void /* LV_ATTRIBUTE_FAST_MEM */ lv_color_fill(lv_color_t * buf, lv_color_t color, uint32_t px_num); + +//! @endcond lv_color_t lv_color_lighten(lv_color_t c, lv_opa_t lvl); -/** - * Mix black to a color - * @param c the base color - * @param lvl the intensity of black (0: no change, 255: fully black) - * @return the mixed color - */ lv_color_t lv_color_darken(lv_color_t c, lv_opa_t lvl); +lv_color_t lv_color_change_lightness(lv_color_t c, lv_opa_t lvl); + /** * Convert a HSV color to RGB * @param h hue [0..359] @@ -366,61 +678,36 @@ lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r8, uint8_t g8, uint8_t b8); */ lv_color_hsv_t lv_color_to_hsv(lv_color_t color); -/*Source: https://vuetifyjs.com/en/styles/colors/#material-colors*/ - /** - * A helper for white color - * @return a white color + * Just a wrapper around LV_COLOR_CHROMA_KEY because it might be more convenient to use a function in some cases + * @return LV_COLOR_CHROMA_KEY */ -lv_color_t lv_color_white(void); +static inline lv_color_t lv_color_chroma_key(void) +{ + return LV_COLOR_CHROMA_KEY; +} -/** - * A helper for black color - * @return a black color - */ -lv_color_t lv_color_black(void); - -void lv_color_premultiply(lv_color32_t * c); - -void lv_color16_premultiply(lv_color16_t * c, lv_opa_t a); - -/** - * Get the luminance of a color: luminance = 0.3 R + 0.59 G + 0.11 B - * @param c a color - * @return the brightness [0..255] - */ -uint8_t lv_color_luminance(lv_color_t c); - -/** - * Get the luminance of a color16: luminance = 0.3 R + 0.59 G + 0.11 B - * @param c a color - * @return the brightness [0..255] - */ -uint8_t lv_color16_luminance(const lv_color16_t c); - -/** - * Get the luminance of a color24: luminance = 0.3 R + 0.59 G + 0.11 B - * @param c a color - * @return the brightness [0..255] - */ -uint8_t lv_color24_luminance(const uint8_t * c); +/********************** + * PREDEFINED COLORS + **********************/ +/*Source: https://vuetifyjs.com/en/styles/colors/#material-colors*/ -/** - * Get the luminance of a color32: luminance = 0.3 R + 0.59 G + 0.11 B - * @param c a color - * @return the brightness [0..255] - */ -uint8_t lv_color32_luminance(lv_color32_t c); +lv_color_t lv_palette_main(lv_palette_t p); +static inline lv_color_t lv_color_white(void) +{ + return lv_color_make(0xff, 0xff, 0xff); +} +static inline lv_color_t lv_color_black(void) +{ + return lv_color_make(0x00, 0x0, 0x00); +} +lv_color_t lv_palette_lighten(lv_palette_t p, uint8_t lvl); +lv_color_t lv_palette_darken(lv_palette_t p, uint8_t lvl); /********************** * MACROS **********************/ -#include "lv_palette.h" -#include "lv_color_op.h" - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_color_filter_dsc_t lv_color_filter_shade; - #ifdef __cplusplus } /*extern "C"*/ #endif diff --git a/L3_Middlewares/LVGL/src/misc/lv_color_op.c b/L3_Middlewares/LVGL/src/misc/lv_color_op.c deleted file mode 100644 index a26f2b4..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_color_op.c +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file lv_color.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_color_op_private.h" -#include "lv_log.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_color_t LV_ATTRIBUTE_FAST_MEM lv_color_mix(lv_color_t c1, lv_color_t c2, uint8_t mix) -{ - lv_color_t ret; - - ret.red = LV_UDIV255((uint16_t)c1.red * mix + c2.red * (255 - mix) + LV_COLOR_MIX_ROUND_OFS); - ret.green = LV_UDIV255((uint16_t)c1.green * mix + c2.green * (255 - mix) + LV_COLOR_MIX_ROUND_OFS); - ret.blue = LV_UDIV255((uint16_t)c1.blue * mix + c2.blue * (255 - mix) + LV_COLOR_MIX_ROUND_OFS); - return ret; -} - -lv_color32_t lv_color_mix32(lv_color32_t fg, lv_color32_t bg) -{ - if(fg.alpha >= LV_OPA_MAX) { - fg.alpha = bg.alpha; - return fg; - } - if(fg.alpha <= LV_OPA_MIN) { - return bg; - } - bg.red = (uint32_t)((uint32_t)fg.red * fg.alpha + (uint32_t)bg.red * (255 - fg.alpha)) >> 8; - bg.green = (uint32_t)((uint32_t)fg.green * fg.alpha + (uint32_t)bg.green * (255 - fg.alpha)) >> 8; - bg.blue = (uint32_t)((uint32_t)fg.blue * fg.alpha + (uint32_t)bg.blue * (255 - fg.alpha)) >> 8; - return bg; -} - -uint8_t lv_color_brightness(lv_color_t c) -{ - uint16_t bright = (uint16_t)(3u * c.red + c.green + 4u * c.blue); - return (uint8_t)(bright >> 3); -} - -void lv_color_filter_dsc_init(lv_color_filter_dsc_t * dsc, lv_color_filter_cb_t cb) -{ - dsc->filter_cb = cb; -} - -/********************** - * STATIC FUNCTIONS - **********************/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_color_op.h b/L3_Middlewares/LVGL/src/misc/lv_color_op.h deleted file mode 100644 index 0a59de3..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_color_op.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file lv_color_op.h - * - */ - -#ifndef LV_COLOR_OP_H -#define LV_COLOR_OP_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_assert.h" -#include "lv_math.h" -#include "lv_color.h" -#include "lv_types.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_color_filter_dsc_t; - -typedef lv_color_t (*lv_color_filter_cb_t)(const struct lv_color_filter_dsc_t *, lv_color_t, lv_opa_t); - -struct lv_color_filter_dsc_t { - lv_color_filter_cb_t filter_cb; - void * user_data; -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Mix two colors with a given ratio. - * @param c1 the first color to mix (usually the foreground) - * @param c2 the second color to mix (usually the background) - * @param mix The ratio of the colors. 0: full `c2`, 255: full `c1`, 127: half `c1` and half`c2` - * @return the mixed color - */ -lv_color_t LV_ATTRIBUTE_FAST_MEM lv_color_mix(lv_color_t c1, lv_color_t c2, uint8_t mix); - -/** - * - * @param fg - * @param bg - * @return - * @note Use bg.alpha in the return value - * @note Use fg.alpha as mix ratio - */ -lv_color32_t lv_color_mix32(lv_color32_t fg, lv_color32_t bg); - -/** - * Get the brightness of a color - * @param c a color - * @return brightness in range [0..255] - */ -uint8_t lv_color_brightness(lv_color_t c); - -void lv_color_filter_dsc_init(lv_color_filter_dsc_t * dsc, lv_color_filter_cb_t cb); - -/********************** - * PREDEFINED COLORS - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_COLOR_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_event.c b/L3_Middlewares/LVGL/src/misc/lv_event.c deleted file mode 100644 index ec985ed..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_event.c +++ /dev/null @@ -1,224 +0,0 @@ -/** - * @file lv_event.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_event_private.h" -#include "../core/lv_global.h" -#include "../stdlib/lv_mem.h" -#include "lv_assert.h" -#include "lv_types.h" - -/********************* - * DEFINES - *********************/ - -#define event_head LV_GLOBAL_DEFAULT()->event_header -#define event_last_id LV_GLOBAL_DEFAULT()->event_last_register_id - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -#if LV_USE_LOG && LV_LOG_TRACE_EVENT - #define LV_TRACE_EVENT(...) LV_LOG_TRACE(__VA_ARGS__) -#else - #define LV_TRACE_EVENT(...) -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_event_push(lv_event_t * e) -{ - /*Build a simple linked list from the objects used in the events - *It's important to know if this object was deleted by a nested event - *called from this `event_cb`.*/ - e->prev = event_head; - event_head = e; - -} - -void lv_event_pop(lv_event_t * e) -{ - event_head = e->prev; -} - -lv_result_t lv_event_send(lv_event_list_t * list, lv_event_t * e, bool preprocess) -{ - if(list == NULL) return LV_RESULT_OK; - - uint32_t i = 0; - lv_event_dsc_t ** dsc = lv_array_front(list); - uint32_t size = lv_array_size(list); - for(i = 0; i < size; i++) { - if(dsc[i]->cb == NULL) continue; - bool is_preprocessed = (dsc[i]->filter & LV_EVENT_PREPROCESS) != 0; - if(is_preprocessed != preprocess) continue; - lv_event_code_t filter = dsc[i]->filter & ~LV_EVENT_PREPROCESS; - if(filter == LV_EVENT_ALL || filter == e->code) { - e->user_data = dsc[i]->user_data; - dsc[i]->cb(e); - if(e->stop_processing) return LV_RESULT_OK; - - /*Stop if the object is deleted*/ - if(e->deleted) return LV_RESULT_INVALID; - - } - } - return LV_RESULT_OK; -} - -lv_event_dsc_t * lv_event_add(lv_event_list_t * list, lv_event_cb_t cb, lv_event_code_t filter, - void * user_data) -{ - lv_event_dsc_t * dsc = lv_malloc(sizeof(lv_event_dsc_t)); - LV_ASSERT_NULL(dsc); - - dsc->cb = cb; - dsc->filter = filter; - dsc->user_data = user_data; - - if(lv_array_size(list) == 0) { - /*event list hasn't been initialized.*/ - lv_array_init(list, 1, sizeof(lv_event_dsc_t *)); - } - - lv_array_push_back(list, &dsc); - return dsc; -} - -bool lv_event_remove_dsc(lv_event_list_t * list, lv_event_dsc_t * dsc) -{ - LV_ASSERT_NULL(list); - LV_ASSERT_NULL(dsc); - - int size = lv_array_size(list); - lv_event_dsc_t ** events = lv_array_front(list); - for(int i = 0; i < size; i++) { - if(events[i] == dsc) { - lv_free(dsc); - lv_array_remove(list, i); - return true; - } - } - - return false; -} - -uint32_t lv_event_get_count(lv_event_list_t * list) -{ - LV_ASSERT_NULL(list); - return lv_array_size(list); -} - -lv_event_dsc_t * lv_event_get_dsc(lv_event_list_t * list, uint32_t index) -{ - LV_ASSERT_NULL(list); - lv_event_dsc_t ** dsc; - dsc = lv_array_at(list, index); - return dsc ? *dsc : NULL; -} - -lv_event_cb_t lv_event_dsc_get_cb(lv_event_dsc_t * dsc) -{ - LV_ASSERT_NULL(dsc); - return dsc->cb; -} - -void * lv_event_dsc_get_user_data(lv_event_dsc_t * dsc) -{ - LV_ASSERT_NULL(dsc); - return dsc->user_data; - -} - -bool lv_event_remove(lv_event_list_t * list, uint32_t index) -{ - LV_ASSERT_NULL(list); - lv_event_dsc_t * dsc = lv_event_get_dsc(list, index); - lv_free(dsc); - return lv_array_remove(list, index); -} - -void lv_event_remove_all(lv_event_list_t * list) -{ - LV_ASSERT_NULL(list); - int size = lv_array_size(list); - lv_event_dsc_t ** dsc = lv_array_front(list); - for(int i = 0; i < size; i++) { - lv_free(dsc[i]); - } - lv_array_deinit(list); -} - -void * lv_event_get_current_target(lv_event_t * e) -{ - return e->current_target; -} - -void * lv_event_get_target(lv_event_t * e) -{ - return e->original_target; -} - -lv_event_code_t lv_event_get_code(lv_event_t * e) -{ - return e->code & ~LV_EVENT_PREPROCESS; -} - -void * lv_event_get_param(lv_event_t * e) -{ - return e->param; -} - -void * lv_event_get_user_data(lv_event_t * e) -{ - return e->user_data; -} - -void lv_event_stop_bubbling(lv_event_t * e) -{ - e->stop_bubbling = 1; -} - -void lv_event_stop_processing(lv_event_t * e) -{ - e->stop_processing = 1; -} - -uint32_t lv_event_register_id(void) -{ - event_last_id ++; - return event_last_id; -} - -void lv_event_mark_deleted(void * target) -{ - lv_event_t * e = event_head; - - while(e) { - if(e->original_target == target || e->current_target == target) e->deleted = 1; - e = e->prev; - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_event.h b/L3_Middlewares/LVGL/src/misc/lv_event.h deleted file mode 100644 index 61518e9..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_event.h +++ /dev/null @@ -1,215 +0,0 @@ -/** - * @file lv_event.h - * - */ - -#ifndef LV_EVENT_H -#define LV_EVENT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_types.h" -#include "../lv_conf_internal.h" - -#include "lv_array.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef void (*lv_event_cb_t)(lv_event_t * e); - -/** - * Type of event being sent to the object. - */ -typedef enum { - LV_EVENT_ALL = 0, - - /** Input device events*/ - LV_EVENT_PRESSED, /**< The object has been pressed*/ - LV_EVENT_PRESSING, /**< The object is being pressed (called continuously while pressing)*/ - LV_EVENT_PRESS_LOST, /**< The object is still being pressed but slid cursor/finger off of the object */ - LV_EVENT_SHORT_CLICKED, /**< The object was pressed for a short period of time, then released it. Not called if scrolled.*/ - LV_EVENT_LONG_PRESSED, /**< Object has been pressed for at least `long_press_time`. Not called if scrolled.*/ - LV_EVENT_LONG_PRESSED_REPEAT, /**< Called after `long_press_time` in every `long_press_repeat_time` ms. Not called if scrolled.*/ - LV_EVENT_CLICKED, /**< Called on release if not scrolled (regardless to long press)*/ - LV_EVENT_RELEASED, /**< Called in every cases when the object has been released*/ - LV_EVENT_SCROLL_BEGIN, /**< Scrolling begins. The event parameter is a pointer to the animation of the scroll. Can be modified*/ - LV_EVENT_SCROLL_THROW_BEGIN, - LV_EVENT_SCROLL_END, /**< Scrolling ends*/ - LV_EVENT_SCROLL, /**< Scrolling*/ - LV_EVENT_GESTURE, /**< A gesture is detected. Get the gesture with `lv_indev_get_gesture_dir(lv_indev_active());` */ - LV_EVENT_KEY, /**< A key is sent to the object. Get the key with `lv_indev_get_key(lv_indev_active());`*/ - LV_EVENT_ROTARY, /**< An encoder or wheel was rotated. Get the rotation count with `lv_event_get_rotary_diff(e);`*/ - LV_EVENT_FOCUSED, /**< The object is focused*/ - LV_EVENT_DEFOCUSED, /**< The object is defocused*/ - LV_EVENT_LEAVE, /**< The object is defocused but still selected*/ - LV_EVENT_HIT_TEST, /**< Perform advanced hit-testing*/ - LV_EVENT_INDEV_RESET, /**< Indev has been reset*/ - LV_EVENT_HOVER_OVER, /**< Indev hover over object*/ - LV_EVENT_HOVER_LEAVE, /**< Indev hover leave object*/ - - /** Drawing events*/ - LV_EVENT_COVER_CHECK, /**< Check if the object fully covers an area. The event parameter is `lv_cover_check_info_t *`.*/ - LV_EVENT_REFR_EXT_DRAW_SIZE, /**< Get the required extra draw area around the object (e.g. for shadow). The event parameter is `int32_t *` to store the size.*/ - LV_EVENT_DRAW_MAIN_BEGIN, /**< Starting the main drawing phase*/ - LV_EVENT_DRAW_MAIN, /**< Perform the main drawing*/ - LV_EVENT_DRAW_MAIN_END, /**< Finishing the main drawing phase*/ - LV_EVENT_DRAW_POST_BEGIN, /**< Starting the post draw phase (when all children are drawn)*/ - LV_EVENT_DRAW_POST, /**< Perform the post draw phase (when all children are drawn)*/ - LV_EVENT_DRAW_POST_END, /**< Finishing the post draw phase (when all children are drawn)*/ - LV_EVENT_DRAW_TASK_ADDED, /**< Adding a draw task */ - - /** Special events*/ - LV_EVENT_VALUE_CHANGED, /**< The object's value has changed (i.e. slider moved)*/ - LV_EVENT_INSERT, /**< A text is inserted to the object. The event data is `char *` being inserted.*/ - LV_EVENT_REFRESH, /**< Notify the object to refresh something on it (for the user)*/ - LV_EVENT_READY, /**< A process has finished*/ - LV_EVENT_CANCEL, /**< A process has been cancelled */ - - /** Other events*/ - LV_EVENT_CREATE, /**< Object is being created*/ - LV_EVENT_DELETE, /**< Object is being deleted*/ - LV_EVENT_CHILD_CHANGED, /**< Child was removed, added, or its size, position were changed */ - LV_EVENT_CHILD_CREATED, /**< Child was created, always bubbles up to all parents*/ - LV_EVENT_CHILD_DELETED, /**< Child was deleted, always bubbles up to all parents*/ - LV_EVENT_SCREEN_UNLOAD_START, /**< A screen unload started, fired immediately when scr_load is called*/ - LV_EVENT_SCREEN_LOAD_START, /**< A screen load started, fired when the screen change delay is expired*/ - LV_EVENT_SCREEN_LOADED, /**< A screen was loaded*/ - LV_EVENT_SCREEN_UNLOADED, /**< A screen was unloaded*/ - LV_EVENT_SIZE_CHANGED, /**< Object coordinates/size have changed*/ - LV_EVENT_STYLE_CHANGED, /**< Object's style has changed*/ - LV_EVENT_LAYOUT_CHANGED, /**< The children position has changed due to a layout recalculation*/ - LV_EVENT_GET_SELF_SIZE, /**< Get the internal size of a widget*/ - - /** Events of optional LVGL components*/ - LV_EVENT_INVALIDATE_AREA, - LV_EVENT_RESOLUTION_CHANGED, - LV_EVENT_COLOR_FORMAT_CHANGED, - LV_EVENT_REFR_REQUEST, - LV_EVENT_REFR_START, - LV_EVENT_REFR_READY, - LV_EVENT_RENDER_START, - LV_EVENT_RENDER_READY, - LV_EVENT_FLUSH_START, - LV_EVENT_FLUSH_FINISH, - LV_EVENT_FLUSH_WAIT_START, - LV_EVENT_FLUSH_WAIT_FINISH, - - LV_EVENT_VSYNC, - - LV_EVENT_LAST, /** Number of default events*/ - - LV_EVENT_PREPROCESS = 0x8000, /** This is a flag that can be set with an event so it's processed - before the class default event processing */ -} lv_event_code_t; - -typedef lv_array_t lv_event_list_t; - -/** - * @brief Event callback. - * Events are used to notify the user of some action being taken on the object. - * For details, see ::lv_event_t. - */ - -lv_result_t lv_event_send(lv_event_list_t * list, lv_event_t * e, bool preprocess); - -lv_event_dsc_t * lv_event_add(lv_event_list_t * list, lv_event_cb_t cb, lv_event_code_t filter, void * user_data); -bool lv_event_remove_dsc(lv_event_list_t * list, lv_event_dsc_t * dsc); - -uint32_t lv_event_get_count(lv_event_list_t * list); - -lv_event_dsc_t * lv_event_get_dsc(lv_event_list_t * list, uint32_t index); - -lv_event_cb_t lv_event_dsc_get_cb(lv_event_dsc_t * dsc); - -void * lv_event_dsc_get_user_data(lv_event_dsc_t * dsc); - -bool lv_event_remove(lv_event_list_t * list, uint32_t index); - -void lv_event_remove_all(lv_event_list_t * list); - -/** - * Get the object originally targeted by the event. It's the same even if the event is bubbled. - * @param e pointer to the event descriptor - * @return the target of the event_code - */ -void * lv_event_get_target(lv_event_t * e); - -/** - * Get the current target of the event. It's the object which event handler being called. - * If the event is not bubbled it's the same as "normal" target. - * @param e pointer to the event descriptor - * @return pointer to the current target of the event_code - */ -void * lv_event_get_current_target(lv_event_t * e); - -/** - * Get the event code of an event - * @param e pointer to the event descriptor - * @return the event code. (E.g. `LV_EVENT_CLICKED`, `LV_EVENT_FOCUSED`, etc) - */ -lv_event_code_t lv_event_get_code(lv_event_t * e); - -/** - * Get the parameter passed when the event was sent - * @param e pointer to the event descriptor - * @return pointer to the parameter - */ -void * lv_event_get_param(lv_event_t * e); - -/** - * Get the user_data passed when the event was registered on the object - * @param e pointer to the event descriptor - * @return pointer to the user_data - */ -void * lv_event_get_user_data(lv_event_t * e); - -/** - * Stop the event from bubbling. - * This is only valid when called in the middle of an event processing chain. - * @param e pointer to the event descriptor - */ -void lv_event_stop_bubbling(lv_event_t * e); - -/** - * Stop processing this event. - * This is only valid when called in the middle of an event processing chain. - * @param e pointer to the event descriptor - */ -void lv_event_stop_processing(lv_event_t * e); - -/** - * Register a new, custom event ID. - * It can be used the same way as e.g. `LV_EVENT_CLICKED` to send custom events - * @return the new event id - * - * Example: - * @code - * uint32_t LV_EVENT_MINE = 0; - * ... - * e = lv_event_register_id(); - * ... - * lv_obj_send_event(obj, LV_EVENT_MINE, &some_data); - * @endcode - */ -uint32_t lv_event_register_id(void); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_EVENT_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_event_private.h b/L3_Middlewares/LVGL/src/misc/lv_event_private.h deleted file mode 100644 index b31ca81..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_event_private.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @file lv_event_private.h - * - */ - -#ifndef LV_EVENT_PRIVATE_H -#define LV_EVENT_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_event.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_event_dsc_t { - lv_event_cb_t cb; - void * user_data; - uint32_t filter; -}; - -struct lv_event_t { - void * current_target; - void * original_target; - lv_event_code_t code; - void * user_data; - void * param; - lv_event_t * prev; - uint8_t deleted : 1; - uint8_t stop_processing : 1; - uint8_t stop_bubbling : 1; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_event_push(lv_event_t * e); - -void lv_event_pop(lv_event_t * e); - -/** - * Nested events can be called and one of them might belong to an object that is being deleted. - * Mark this object's `event_temp_data` deleted to know that its `lv_obj_send_event` should return `LV_RESULT_INVALID` - * @param target pointer to an event target which was deleted - */ -void lv_event_mark_deleted(void * target); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_EVENT_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_fs.c b/L3_Middlewares/LVGL/src/misc/lv_fs.c index f713698..52f3ce0 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_fs.c +++ b/L3_Middlewares/LVGL/src/misc/lv_fs.c @@ -6,39 +6,25 @@ /********************* * INCLUDES *********************/ -#include "lv_fs_private.h" +#include "lv_fs.h" #include "../misc/lv_assert.h" -#include "../misc/lv_profiler.h" -#include "../stdlib/lv_string.h" #include "lv_ll.h" -#include "../core/lv_global.h" +#include +#include "lv_gc.h" /********************* * DEFINES *********************/ -#if LV_FS_DEFAULT_DRIVE_LETTER != '\0' && (LV_FS_DEFAULT_DRIVE_LETTER < 'A' || 'Z' < LV_FS_DEFAULT_DRIVE_LETTER) - #error "When enabled, LV_FS_DEFAULT_DRIVE_LETTER needs to be a capital ASCII letter (A-Z)" -#endif - -#define fsdrv_ll_p &(LV_GLOBAL_DEFAULT()->fsdrv_ll) - /********************** * TYPEDEFS **********************/ -typedef struct { - char drive_letter; - const char * real_path; -} resolved_path_t; /********************** * STATIC PROTOTYPES **********************/ -static resolved_path_t lv_fs_resolve_path(const char * path); -static lv_fs_res_t lv_fs_read_cached(lv_fs_file_t * file_p, void * buf, uint32_t btr, uint32_t * br); -static lv_fs_res_t lv_fs_write_cached(lv_fs_file_t * file_p, const void * buf, uint32_t btw, uint32_t * bw); -static lv_fs_res_t lv_fs_seek_cached(lv_fs_file_t * file_p, uint32_t pos, lv_fs_whence_t whence); +static const char * lv_fs_get_real_path(const char * path); /********************** * STATIC VARIABLES @@ -52,14 +38,9 @@ static lv_fs_res_t lv_fs_seek_cached(lv_fs_file_t * file_p, uint32_t pos, lv_fs_ * GLOBAL FUNCTIONS **********************/ -void lv_fs_init(void) -{ - lv_ll_init(fsdrv_ll_p, sizeof(lv_fs_drv_t *)); -} - -void lv_fs_deinit(void) +void _lv_fs_init(void) { - lv_ll_clear(fsdrv_ll_p); + _lv_ll_init(&LV_GC_ROOT(_lv_fsdrv_ll), sizeof(lv_fs_drv_t *)); } bool lv_fs_is_ready(char letter) @@ -80,9 +61,8 @@ lv_fs_res_t lv_fs_open(lv_fs_file_t * file_p, const char * path, lv_fs_mode_t mo return LV_FS_RES_INV_PARAM; } - resolved_path_t resolved_path = lv_fs_resolve_path(path); - - lv_fs_drv_t * drv = lv_fs_get_drv(resolved_path.drive_letter); + char letter = path[0]; + lv_fs_drv_t * drv = lv_fs_get_drv(letter); if(drv == NULL) { LV_LOG_WARN("Can't open file (%s): unknown driver letter", path); @@ -101,56 +81,27 @@ lv_fs_res_t lv_fs_open(lv_fs_file_t * file_p, const char * path, lv_fs_mode_t mo return LV_FS_RES_NOT_IMP; } - LV_PROFILER_BEGIN; + const char * real_path = lv_fs_get_real_path(path); + void * file_d = drv->open_cb(drv, real_path, mode); - file_p->drv = drv; - - /* For memory-mapped files we set the file handle to our file descriptor so that we can access the cache from the file operations */ - if(drv->cache_size == LV_FS_CACHE_FROM_BUFFER) { - file_p->file_d = file_p; - } - else { - void * file_d = drv->open_cb(drv, resolved_path.real_path, mode); - if(file_d == NULL || file_d == (void *)(-1)) { - LV_PROFILER_END; - return LV_FS_RES_UNKNOWN; - } - file_p->file_d = file_d; + if(file_d == NULL || file_d == (void *)(-1)) { + return LV_FS_RES_UNKNOWN; } + file_p->drv = drv; + file_p->file_d = file_d; + if(drv->cache_size) { - file_p->cache = lv_malloc_zeroed(sizeof(lv_fs_file_cache_t)); + file_p->cache = lv_mem_alloc(sizeof(lv_fs_file_cache_t)); LV_ASSERT_MALLOC(file_p->cache); - - /* If this is a memory-mapped file, then set "cache" to the memory buffer */ - if(drv->cache_size == LV_FS_CACHE_FROM_BUFFER) { - lv_fs_path_ex_t * path_ex = (lv_fs_path_ex_t *)path; - file_p->cache->buffer = (void *)path_ex->buffer; - file_p->cache->start = 0; - file_p->cache->file_position = 0; - file_p->cache->end = path_ex->size; - } - /*Set an invalid range by default*/ - else { - file_p->cache->start = UINT32_MAX; - file_p->cache->end = UINT32_MAX - 1; - } + lv_memset_00(file_p->cache, sizeof(lv_fs_file_cache_t)); + file_p->cache->start = UINT32_MAX; /*Set an invalid range by default*/ + file_p->cache->end = UINT32_MAX - 1; } - LV_PROFILER_END; - return LV_FS_RES_OK; } -void lv_fs_make_path_from_buffer(lv_fs_path_ex_t * path, char letter, const void * buf, uint32_t size) -{ - path->path[0] = letter; - path->path[1] = ':'; - path->path[2] = 0; - path->buffer = buf; - path->size = size; -} - lv_fs_res_t lv_fs_close(lv_fs_file_t * file_p) { if(file_p->drv == NULL) { @@ -161,47 +112,107 @@ lv_fs_res_t lv_fs_close(lv_fs_file_t * file_p) return LV_FS_RES_NOT_IMP; } - LV_PROFILER_BEGIN; - lv_fs_res_t res = file_p->drv->close_cb(file_p->drv, file_p->file_d); if(file_p->drv->cache_size && file_p->cache) { - /* Only free cache if it was pre-allocated (for memory-mapped files it is never allocated) */ - if(file_p->drv->cache_size != LV_FS_CACHE_FROM_BUFFER && file_p->cache->buffer) { - lv_free(file_p->cache->buffer); + if(file_p->cache->buffer) { + lv_mem_free(file_p->cache->buffer); } - lv_free(file_p->cache); + lv_mem_free(file_p->cache); } file_p->file_d = NULL; file_p->drv = NULL; file_p->cache = NULL; - LV_PROFILER_END; - return res; } -lv_fs_res_t lv_fs_read(lv_fs_file_t * file_p, void * buf, uint32_t btr, uint32_t * br) +static lv_fs_res_t lv_fs_read_cached(lv_fs_file_t * file_p, char * buf, uint32_t btr, uint32_t * br) { - if(br != NULL) *br = 0; - if(file_p->drv == NULL) return LV_FS_RES_INV_PARAM; + lv_fs_res_t res = LV_FS_RES_OK; + uint32_t file_position = file_p->cache->file_position; + uint32_t start = file_p->cache->start; + uint32_t end = file_p->cache->end; + char * buffer = file_p->cache->buffer; + uint16_t buffer_size = file_p->drv->cache_size; - if(file_p->drv->cache_size) { - if(file_p->drv->read_cb == NULL || file_p->drv->seek_cb == NULL) return LV_FS_RES_NOT_IMP; + if(start <= file_position && file_position < end) { + /* Data can be read from cache buffer */ + uint16_t buffer_offset = file_position - start; + uint32_t buffer_remaining_length = LV_MIN((uint32_t)buffer_size - buffer_offset, (uint32_t)end - file_position); + + if(btr <= buffer_remaining_length) { + /*Data is in cache buffer, and buffer end not reached, no need to read from FS*/ + lv_memcpy(buf, buffer + buffer_offset, btr); + *br = btr; + } + else { + /*First part of data is in cache buffer, but we need to read rest of data from FS*/ + lv_memcpy(buf, buffer + buffer_offset, buffer_remaining_length); + + uint32_t bytes_read_to_buffer = 0; + if(btr > buffer_size) { + /*If remaining data chuck is bigger than buffer size, then do not use cache, instead read it directly from FS*/ + res = file_p->drv->read_cb(file_p->drv, file_p->file_d, (void *)(buf + buffer_remaining_length), + btr - buffer_remaining_length, &bytes_read_to_buffer); + } + else { + /*If remaining data chunk is smaller than buffer size, then read into cache buffer*/ + res = file_p->drv->read_cb(file_p->drv, file_p->file_d, (void *)buffer, buffer_size, &bytes_read_to_buffer); + file_p->cache->start = file_p->cache->end; + file_p->cache->end = file_p->cache->start + bytes_read_to_buffer; + + uint16_t data_chunk_remaining = LV_MIN(btr - buffer_remaining_length, bytes_read_to_buffer); + lv_memcpy(buf + buffer_remaining_length, buffer, data_chunk_remaining); + } + *br = LV_MIN(buffer_remaining_length + bytes_read_to_buffer, btr); + } } else { - if(file_p->drv->read_cb == NULL) return LV_FS_RES_NOT_IMP; + /*Data is not in cache buffer*/ + if(btr > buffer_size) { + /*If bigger data is requested, then do not use cache, instead read it directly*/ + res = file_p->drv->read_cb(file_p->drv, file_p->file_d, (void *)buf, btr, br); + } + else { + /*If small data is requested, then read from FS into cache buffer*/ + if(buffer == NULL) { + file_p->cache->buffer = lv_mem_alloc(buffer_size); + LV_ASSERT_MALLOC(file_p->cache->buffer); + buffer = file_p->cache->buffer; + } + + uint32_t bytes_read_to_buffer = 0; + res = file_p->drv->read_cb(file_p->drv, file_p->file_d, (void *)buffer, buffer_size, &bytes_read_to_buffer); + file_p->cache->start = file_position; + file_p->cache->end = file_p->cache->start + bytes_read_to_buffer; + + *br = LV_MIN(btr, bytes_read_to_buffer); + lv_memcpy(buf, buffer, *br); + + } + } + + if(res == LV_FS_RES_OK) { + file_p->cache->file_position += *br; } - LV_PROFILER_BEGIN; + return res; +} + +lv_fs_res_t lv_fs_read(lv_fs_file_t * file_p, void * buf, uint32_t btr, uint32_t * br) +{ + if(br != NULL) *br = 0; + if(file_p->drv == NULL) return LV_FS_RES_INV_PARAM; + if(file_p->drv->read_cb == NULL) return LV_FS_RES_NOT_IMP; uint32_t br_tmp = 0; lv_fs_res_t res; if(file_p->drv->cache_size) { - res = lv_fs_read_cached(file_p, buf, btr, &br_tmp); + res = lv_fs_read_cached(file_p, (char *)buf, btr, &br_tmp); } else { res = file_p->drv->read_cb(file_p->drv, file_p->file_d, buf, btr, &br_tmp); @@ -209,8 +220,6 @@ lv_fs_res_t lv_fs_read(lv_fs_file_t * file_p, void * buf, uint32_t btr, uint32_t if(br != NULL) *br = br_tmp; - LV_PROFILER_END; - return res; } @@ -222,27 +231,14 @@ lv_fs_res_t lv_fs_write(lv_fs_file_t * file_p, const void * buf, uint32_t btw, u return LV_FS_RES_INV_PARAM; } - if(file_p->drv->cache_size) { - if(file_p->drv->write_cb == NULL || file_p->drv->seek_cb == NULL) return LV_FS_RES_NOT_IMP; - } - else { - if(file_p->drv->write_cb == NULL) return LV_FS_RES_NOT_IMP; + if(file_p->drv->write_cb == NULL) { + return LV_FS_RES_NOT_IMP; } - LV_PROFILER_BEGIN; - - lv_fs_res_t res; uint32_t bw_tmp = 0; - if(file_p->drv->cache_size) { - res = lv_fs_write_cached(file_p, buf, btw, &bw_tmp); - } - else { - res = file_p->drv->write_cb(file_p->drv, file_p->file_d, buf, btw, &bw_tmp); - } + lv_fs_res_t res = file_p->drv->write_cb(file_p->drv, file_p->file_d, buf, btw, &bw_tmp); if(bw != NULL) *bw = bw_tmp; - LV_PROFILER_END; - return res; } @@ -252,25 +248,52 @@ lv_fs_res_t lv_fs_seek(lv_fs_file_t * file_p, uint32_t pos, lv_fs_whence_t whenc return LV_FS_RES_INV_PARAM; } - if(file_p->drv->cache_size) { - if(file_p->drv->seek_cb == NULL || file_p->drv->tell_cb == NULL) return LV_FS_RES_NOT_IMP; - } - else { - if(file_p->drv->seek_cb == NULL) return LV_FS_RES_NOT_IMP; + if(file_p->drv->seek_cb == NULL) { + return LV_FS_RES_NOT_IMP; } - LV_PROFILER_BEGIN; - - lv_fs_res_t res; + lv_fs_res_t res = LV_FS_RES_OK; if(file_p->drv->cache_size) { - res = lv_fs_seek_cached(file_p, pos, whence); + switch(whence) { + case LV_FS_SEEK_SET: { + file_p->cache->file_position = pos; + + /*FS seek if new position is outside cache buffer*/ + if(file_p->cache->file_position < file_p->cache->start || file_p->cache->file_position > file_p->cache->end) { + res = file_p->drv->seek_cb(file_p->drv, file_p->file_d, file_p->cache->file_position, LV_FS_SEEK_SET); + } + + break; + } + case LV_FS_SEEK_CUR: { + file_p->cache->file_position += pos; + + /*FS seek if new position is outside cache buffer*/ + if(file_p->cache->file_position < file_p->cache->start || file_p->cache->file_position > file_p->cache->end) { + res = file_p->drv->seek_cb(file_p->drv, file_p->file_d, file_p->cache->file_position, LV_FS_SEEK_SET); + } + + break; + } + case LV_FS_SEEK_END: { + /*Because we don't know the file size, we do a little trick: do a FS seek, then get new file position from FS*/ + res = file_p->drv->seek_cb(file_p->drv, file_p->file_d, pos, whence); + if(res == LV_FS_RES_OK) { + uint32_t tmp_position; + res = file_p->drv->tell_cb(file_p->drv, file_p->file_d, &tmp_position); + + if(res == LV_FS_RES_OK) { + file_p->cache->file_position = tmp_position; + } + } + break; + } + } } else { res = file_p->drv->seek_cb(file_p->drv, file_p->file_d, pos, whence); } - LV_PROFILER_END; - return res; } @@ -281,13 +304,11 @@ lv_fs_res_t lv_fs_tell(lv_fs_file_t * file_p, uint32_t * pos) return LV_FS_RES_INV_PARAM; } - if(file_p->drv->cache_size == 0 && file_p->drv->tell_cb == NULL) { + if(file_p->drv->tell_cb == NULL) { *pos = 0; return LV_FS_RES_NOT_IMP; } - LV_PROFILER_BEGIN; - lv_fs_res_t res; if(file_p->drv->cache_size) { *pos = file_p->cache->file_position; @@ -297,8 +318,6 @@ lv_fs_res_t lv_fs_tell(lv_fs_file_t * file_p, uint32_t * pos) res = file_p->drv->tell_cb(file_p->drv, file_p->file_d, pos); } - LV_PROFILER_END; - return res; } @@ -306,9 +325,8 @@ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path) { if(path == NULL) return LV_FS_RES_INV_PARAM; - resolved_path_t resolved_path = lv_fs_resolve_path(path); - - lv_fs_drv_t * drv = lv_fs_get_drv(resolved_path.drive_letter); + char letter = path[0]; + lv_fs_drv_t * drv = lv_fs_get_drv(letter); if(drv == NULL) { return LV_FS_RES_NOT_EX; @@ -324,29 +342,21 @@ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path) return LV_FS_RES_NOT_IMP; } - LV_PROFILER_BEGIN; - - void * dir_d = drv->dir_open_cb(drv, resolved_path.real_path); + const char * real_path = lv_fs_get_real_path(path); + void * dir_d = drv->dir_open_cb(drv, real_path); if(dir_d == NULL || dir_d == (void *)(-1)) { - LV_PROFILER_END; return LV_FS_RES_UNKNOWN; } rddir_p->drv = drv; rddir_p->dir_d = dir_d; - LV_PROFILER_END; - return LV_FS_RES_OK; } -lv_fs_res_t lv_fs_dir_read(lv_fs_dir_t * rddir_p, char * fn, uint32_t fn_len) +lv_fs_res_t lv_fs_dir_read(lv_fs_dir_t * rddir_p, char * fn) { - if(fn_len == 0) { - return LV_FS_RES_INV_PARAM; - } - if(rddir_p->drv == NULL || rddir_p->dir_d == NULL) { fn[0] = '\0'; return LV_FS_RES_INV_PARAM; @@ -357,11 +367,7 @@ lv_fs_res_t lv_fs_dir_read(lv_fs_dir_t * rddir_p, char * fn, uint32_t fn_len) return LV_FS_RES_NOT_IMP; } - LV_PROFILER_BEGIN; - - lv_fs_res_t res = rddir_p->drv->dir_read_cb(rddir_p->drv, rddir_p->dir_d, fn, fn_len); - - LV_PROFILER_END; + lv_fs_res_t res = rddir_p->drv->dir_read_cb(rddir_p->drv, rddir_p->dir_d, fn); return res; } @@ -376,28 +382,24 @@ lv_fs_res_t lv_fs_dir_close(lv_fs_dir_t * rddir_p) return LV_FS_RES_NOT_IMP; } - LV_PROFILER_BEGIN; - lv_fs_res_t res = rddir_p->drv->dir_close_cb(rddir_p->drv, rddir_p->dir_d); rddir_p->dir_d = NULL; rddir_p->drv = NULL; - LV_PROFILER_END; - return res; } void lv_fs_drv_init(lv_fs_drv_t * drv) { - lv_memzero(drv, sizeof(lv_fs_drv_t)); + lv_memset_00(drv, sizeof(lv_fs_drv_t)); } void lv_fs_drv_register(lv_fs_drv_t * drv_p) { /*Save the new driver*/ lv_fs_drv_t ** new_drv; - new_drv = lv_ll_ins_head(fsdrv_ll_p); + new_drv = _lv_ll_ins_head(&LV_GC_ROOT(_lv_fsdrv_ll)); LV_ASSERT_MALLOC(new_drv); if(new_drv == NULL) return; @@ -408,7 +410,7 @@ lv_fs_drv_t * lv_fs_get_drv(char letter) { lv_fs_drv_t ** drv; - LV_LL_READ(fsdrv_ll_p, drv) { + _LV_LL_READ(&LV_GC_ROOT(_lv_fsdrv_ll), drv) { if((*drv)->letter == letter) { return *drv; } @@ -422,7 +424,7 @@ char * lv_fs_get_letters(char * buf) lv_fs_drv_t ** drv; uint8_t i = 0; - LV_LL_READ(fsdrv_ll_p, drv) { + _LV_LL_READ(&LV_GC_ROOT(_lv_fsdrv_ll), drv) { buf[i] = (*drv)->letter; i++; } @@ -435,7 +437,7 @@ char * lv_fs_get_letters(char * buf) const char * lv_fs_get_ext(const char * fn) { size_t i; - for(i = lv_strlen(fn); i > 0; i--) { + for(i = strlen(fn); i > 0; i--) { if(fn[i] == '.') { return &fn[i + 1]; } @@ -449,7 +451,7 @@ const char * lv_fs_get_ext(const char * fn) char * lv_fs_up(char * path) { - size_t len = lv_strlen(path); + size_t len = strlen(path); if(len == 0) return path; len--; /*Go before the trailing '\0'*/ @@ -475,7 +477,7 @@ char * lv_fs_up(char * path) const char * lv_fs_get_last(const char * path) { - size_t len = lv_strlen(path); + size_t len = strlen(path); if(len == 0) return path; len--; /*Go before the trailing '\0'*/ @@ -503,193 +505,14 @@ const char * lv_fs_get_last(const char * path) **********************/ /** - * Extract the drive letter and the real path from LVGL's "abstracted file system" path string + * Skip the driver letter and the possible : after the letter * @param path path string (E.g. S:/folder/file.txt) + * @return pointer to the beginning of the real path (E.g. /folder/file.txt) */ -static resolved_path_t lv_fs_resolve_path(const char * path) -{ - resolved_path_t resolved; - -#if LV_FS_DEFAULT_DRIVE_LETTER != '\0' /*When using default drive letter, strict format (X:) is mandatory*/ - bool has_drive_prefix = ('A' <= path[0]) && (path[0] <= 'Z') && (path[1] == ':'); - - if(has_drive_prefix) { - resolved.drive_letter = path[0]; - resolved.real_path = path + 2; - } - else { - resolved.drive_letter = LV_FS_DEFAULT_DRIVE_LETTER; - resolved.real_path = path; - } -# else /*Lean rules for backward compatibility*/ - resolved.drive_letter = path[0]; - - if(*path != '\0') { - path++; /*Ignore the driver letter*/ - if(*path == ':') path++; - } - - resolved.real_path = path; -#endif - - return resolved; -} - -static lv_fs_res_t lv_fs_read_cached(lv_fs_file_t * file_p, void * buf, uint32_t btr, uint32_t * br) -{ - lv_fs_res_t res = LV_FS_RES_OK; - uint32_t file_position = file_p->cache->file_position; - uint32_t start = file_p->cache->start; - uint32_t end = file_p->cache->end; - char * buffer = file_p->cache->buffer; - uint32_t buffer_size = file_p->drv->cache_size; - - if(start <= file_position && file_position <= end) { - /* Data can be read from cache buffer */ - uint32_t buffer_remaining_length = (uint32_t)end - file_position + 1; - uint32_t buffer_offset = (end - start) - buffer_remaining_length + 1; - - /* Do not allow reading beyond the actual memory block for memory-mapped files */ - if(file_p->drv->cache_size == LV_FS_CACHE_FROM_BUFFER) { - if(btr > buffer_remaining_length) - btr = buffer_remaining_length - 1; - } - - if(btr <= buffer_remaining_length) { - /*Data is in cache buffer, and buffer end not reached, no need to read from FS*/ - lv_memcpy(buf, buffer + buffer_offset, btr); - *br = btr; - } - else { - /*First part of data is in cache buffer, but we need to read rest of data from FS*/ - lv_memcpy(buf, buffer + buffer_offset, buffer_remaining_length); - - file_p->drv->seek_cb(file_p->drv, file_p->file_d, file_p->cache->end + 1, - LV_FS_SEEK_SET); - - uint32_t bytes_read_to_buffer = 0; - if(btr - buffer_remaining_length > buffer_size) { - /*If remaining data chuck is bigger than buffer size, then do not use cache, instead read it directly from FS*/ - res = file_p->drv->read_cb(file_p->drv, file_p->file_d, (char *)buf + buffer_remaining_length, - btr - buffer_remaining_length, &bytes_read_to_buffer); - } - else { - /*If remaining data chunk is smaller than buffer size, then read into cache buffer*/ - res = file_p->drv->read_cb(file_p->drv, file_p->file_d, buffer, buffer_size, &bytes_read_to_buffer); - file_p->cache->start = file_p->cache->end + 1; - file_p->cache->end = file_p->cache->start + bytes_read_to_buffer - 1; - - uint16_t data_chunk_remaining = LV_MIN(btr - buffer_remaining_length, bytes_read_to_buffer); - lv_memcpy((char *)buf + buffer_remaining_length, buffer, data_chunk_remaining); - } - *br = LV_MIN(buffer_remaining_length + bytes_read_to_buffer, btr); - } - } - else { - file_p->drv->seek_cb(file_p->drv, file_p->file_d, file_p->cache->file_position, - LV_FS_SEEK_SET); - - /*Data is not in cache buffer*/ - if(btr > buffer_size) { - /*If bigger data is requested, then do not use cache, instead read it directly*/ - res = file_p->drv->read_cb(file_p->drv, file_p->file_d, (void *)buf, btr, br); - } - else { - /*If small data is requested, then read from FS into cache buffer*/ - if(buffer == NULL) { - file_p->cache->buffer = lv_malloc(buffer_size); - LV_ASSERT_MALLOC(file_p->cache->buffer); - buffer = file_p->cache->buffer; - } - - uint32_t bytes_read_to_buffer = 0; - res = file_p->drv->read_cb(file_p->drv, file_p->file_d, (void *)buffer, buffer_size, &bytes_read_to_buffer); - file_p->cache->start = file_position; - file_p->cache->end = file_p->cache->start + bytes_read_to_buffer - 1; - - *br = LV_MIN(btr, bytes_read_to_buffer); - lv_memcpy(buf, buffer, *br); - - } - } - - if(res == LV_FS_RES_OK) { - file_p->cache->file_position += *br; - } - - return res; -} - -static lv_fs_res_t lv_fs_write_cached(lv_fs_file_t * file_p, const void * buf, uint32_t btw, uint32_t * bw) +static const char * lv_fs_get_real_path(const char * path) { - lv_fs_res_t res = LV_FS_RES_OK; - - /*Need to do FS seek before writing data to FS*/ - res = file_p->drv->seek_cb(file_p->drv, file_p->file_d, file_p->cache->file_position, LV_FS_SEEK_SET); - if(res != LV_FS_RES_OK) return res; + path++; /*Ignore the driver letter*/ + if(*path == ':') path++; - res = file_p->drv->write_cb(file_p->drv, file_p->file_d, buf, btw, bw); - if(res != LV_FS_RES_OK) return res; - - if(file_p->cache->end >= file_p->cache->start) { - uint32_t start_position = file_p->cache->file_position; - uint32_t end_position = file_p->cache->file_position + *bw - 1; - char * cache_buffer = file_p->cache->buffer; - const char * write_buffer = buf; - - if(start_position <= file_p->cache->start && end_position >= file_p->cache->end) { - lv_memcpy(cache_buffer, - write_buffer + (file_p->cache->start - start_position), - file_p->cache->end + 1 - file_p->cache->start); - } - else if(start_position >= file_p->cache->start && end_position <= file_p->cache->end) { - lv_memcpy(cache_buffer + (start_position - file_p->cache->start), - write_buffer, - end_position + 1 - start_position); - } - else if(end_position >= file_p->cache->start && end_position <= file_p->cache->end) { - lv_memcpy(cache_buffer, - write_buffer + (file_p->cache->start - start_position), - end_position + 1 - file_p->cache->start); - } - else if(start_position >= file_p->cache->start && start_position <= file_p->cache->end) { - lv_memcpy(cache_buffer + (start_position - file_p->cache->start), - write_buffer, - file_p->cache->end + 1 - start_position); - } - } - - file_p->cache->file_position += *bw; - - return res; -} - -static lv_fs_res_t lv_fs_seek_cached(lv_fs_file_t * file_p, uint32_t pos, lv_fs_whence_t whence) -{ - lv_fs_res_t res = LV_FS_RES_OK; - switch(whence) { - case LV_FS_SEEK_SET: { - file_p->cache->file_position = pos; - break; - } - case LV_FS_SEEK_CUR: { - file_p->cache->file_position += pos; - break; - } - case LV_FS_SEEK_END: { - /*Because we don't know the file size, we do a little trick: do a FS seek, then get the new file position from FS*/ - res = file_p->drv->seek_cb(file_p->drv, file_p->file_d, pos, whence); - if(res == LV_FS_RES_OK) { - uint32_t tmp_position; - res = file_p->drv->tell_cb(file_p->drv, file_p->file_d, &tmp_position); - - if(res == LV_FS_RES_OK) { - file_p->cache->file_position = tmp_position; - } - } - break; - } - } - - return res; + return path; } diff --git a/L3_Middlewares/LVGL/src/misc/lv_fs.h b/L3_Middlewares/LVGL/src/misc/lv_fs.h index c6f938b..c941402 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_fs.h +++ b/L3_Middlewares/LVGL/src/misc/lv_fs.h @@ -14,7 +14,9 @@ extern "C" { * INCLUDES *********************/ #include "../lv_conf_internal.h" -#include "lv_types.h" + +#include +#include /********************* * DEFINES @@ -22,8 +24,6 @@ extern "C" { #define LV_FS_MAX_FN_LENGTH 64 #define LV_FS_MAX_PATH_LENGTH 256 -#define LV_FS_CACHE_FROM_BUFFER UINT32_MAX - /********************** * TYPEDEFS **********************/ @@ -31,7 +31,7 @@ extern "C" { /** * Errors in the file system module. */ -typedef enum { +enum { LV_FS_RES_OK = 0, LV_FS_RES_HW_ERR, /*Low level hardware error*/ LV_FS_RES_FS_ERR, /*Error in the file system structure*/ @@ -45,15 +45,17 @@ typedef enum { LV_FS_RES_OUT_OF_MEM, /*Not enough memory for an internal operation*/ LV_FS_RES_INV_PARAM, /*Invalid parameter among arguments*/ LV_FS_RES_UNKNOWN, /*Other unknown error*/ -} lv_fs_res_t; +}; +typedef uint8_t lv_fs_res_t; /** * File open mode. */ -typedef enum { +enum { LV_FS_MODE_WR = 0x01, LV_FS_MODE_RD = 0x02, -} lv_fs_mode_t; +}; +typedef uint8_t lv_fs_mode_t; /** * Seek modes. @@ -64,26 +66,33 @@ typedef enum { LV_FS_SEEK_END = 0x02, /**< Set the position from the end of the file*/ } lv_fs_whence_t; -struct lv_fs_drv_t; -typedef struct lv_fs_drv_t lv_fs_drv_t; -struct lv_fs_drv_t { +typedef struct _lv_fs_drv_t { char letter; - uint32_t cache_size; - bool (*ready_cb)(lv_fs_drv_t * drv); + uint16_t cache_size; + bool (*ready_cb)(struct _lv_fs_drv_t * drv); - void * (*open_cb)(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode); - lv_fs_res_t (*close_cb)(lv_fs_drv_t * drv, void * file_p); - lv_fs_res_t (*read_cb)(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br); - lv_fs_res_t (*write_cb)(lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw); - lv_fs_res_t (*seek_cb)(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); - lv_fs_res_t (*tell_cb)(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); + void * (*open_cb)(struct _lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode); + lv_fs_res_t (*close_cb)(struct _lv_fs_drv_t * drv, void * file_p); + lv_fs_res_t (*read_cb)(struct _lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br); + lv_fs_res_t (*write_cb)(struct _lv_fs_drv_t * drv, void * file_p, const void * buf, uint32_t btw, uint32_t * bw); + lv_fs_res_t (*seek_cb)(struct _lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs_whence_t whence); + lv_fs_res_t (*tell_cb)(struct _lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p); - void * (*dir_open_cb)(lv_fs_drv_t * drv, const char * path); - lv_fs_res_t (*dir_read_cb)(lv_fs_drv_t * drv, void * rddir_p, char * fn, uint32_t fn_len); - lv_fs_res_t (*dir_close_cb)(lv_fs_drv_t * drv, void * rddir_p); + void * (*dir_open_cb)(struct _lv_fs_drv_t * drv, const char * path); + lv_fs_res_t (*dir_read_cb)(struct _lv_fs_drv_t * drv, void * rddir_p, char * fn); + lv_fs_res_t (*dir_close_cb)(struct _lv_fs_drv_t * drv, void * rddir_p); +#if LV_USE_USER_DATA void * user_data; /**< Custom file user data*/ -}; +#endif +} lv_fs_drv_t; + +typedef struct { + uint32_t start; + uint32_t end; + uint32_t file_position; + void * buffer; +} lv_fs_file_cache_t; typedef struct { void * file_d; @@ -91,7 +100,6 @@ typedef struct { lv_fs_file_cache_t * cache; } lv_fs_file_t; - typedef struct { void * dir_d; lv_fs_drv_t * drv; @@ -101,9 +109,14 @@ typedef struct { * GLOBAL PROTOTYPES **********************/ +/** + * Initialize the File system interface + */ +void _lv_fs_init(void); + /** * Initialize a file system driver with default values. - * It is used to ensure all fields have known values and not memory junk. + * It is used to surly have known values in the fields ant not memory junk. * After it you can set the fields. * @param drv pointer to driver variable to initialize */ @@ -141,15 +154,6 @@ bool lv_fs_is_ready(char letter); */ lv_fs_res_t lv_fs_open(lv_fs_file_t * file_p, const char * path, lv_fs_mode_t mode); -/** - * Make a path object for the memory-mapped file compatible with the file system interface - * @param path path to a lv_fs_path_ex object - * @param letter the letter of the driver. E.g. `LV_FS_MEMFS_LETTER` - * @param buf address of the memory buffer - * @param size size of the memory buffer in bytes - */ -void lv_fs_make_path_from_buffer(lv_fs_path_ex_t * path, char letter, const void * buf, uint32_t size); - /** * Close an already opened file * @param file_p pointer to a lv_fs_file_t variable @@ -181,7 +185,7 @@ lv_fs_res_t lv_fs_write(lv_fs_file_t * file_p, const void * buf, uint32_t btw, u * Set the position of the 'cursor' (read write pointer) in a file * @param file_p pointer to a lv_fs_file_t variable * @param pos the new position expressed in bytes index (0: start of file) - * @param whence tells from where to set position. See lv_fs_whence_t + * @param whence tells from where set the position. See @lv_fs_whence_t * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ lv_fs_res_t lv_fs_seek(lv_fs_file_t * file_p, uint32_t pos, lv_fs_whence_t whence); @@ -189,7 +193,7 @@ lv_fs_res_t lv_fs_seek(lv_fs_file_t * file_p, uint32_t pos, lv_fs_whence_t whenc /** * Give the position of the read write pointer * @param file_p pointer to a lv_fs_file_t variable - * @param pos pointer to store the position of the read write pointer + * @param pos_p pointer to store the position of the read write pointer * @return LV_FS_RES_OK or any error from 'fs_res_t' */ lv_fs_res_t lv_fs_tell(lv_fs_file_t * file_p, uint32_t * pos); @@ -207,10 +211,9 @@ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path); * The name of the directories will begin with '/' * @param rddir_p pointer to an initialized 'fs_dir_t' variable * @param fn pointer to a buffer to store the filename - * @param fn_len length of the buffer to store the filename * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ -lv_fs_res_t lv_fs_dir_read(lv_fs_dir_t * rddir_p, char * fn, uint32_t fn_len); +lv_fs_res_t lv_fs_dir_read(lv_fs_dir_t * rddir_p, char * fn); /** * Close the directory reading diff --git a/L3_Middlewares/LVGL/src/misc/lv_fs_private.h b/L3_Middlewares/LVGL/src/misc/lv_fs_private.h deleted file mode 100644 index f8bb4bb..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_fs_private.h +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @file lv_fs_private.h - * - */ - -#ifndef LV_FS_PRIVATE_H -#define LV_FS_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_fs.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_fs_file_cache_t { - uint32_t start; - uint32_t end; - uint32_t file_position; - void * buffer; -}; - -/** Extended path object to specify buffer for memory-mapped files */ -struct lv_fs_path_ex_t { - char path[4]; /**< This is needed to make it compatible with a normal path */ - const void * buffer; - uint32_t size; -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize the File system interface - */ -void lv_fs_init(void); - -/** - * Deinitialize the File system interface - */ -void lv_fs_deinit(void); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_FS_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_debug.c b/L3_Middlewares/LVGL/src/misc/lv_gc.c similarity index 54% rename from L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_debug.c rename to L3_Middlewares/LVGL/src/misc/lv_gc.c index 5bf6d02..95bb549 100644 --- a/L3_Middlewares/LVGL/src/drivers/glfw/lv_opengles_debug.c +++ b/L3_Middlewares/LVGL/src/misc/lv_gc.c @@ -1,16 +1,12 @@ /** - * @file lv_opengles_debug.c + * @file lv_gc.c * */ /********************* * INCLUDES *********************/ - -#include "lv_opengles_debug.h" -#if LV_USE_OPENGLES - -#include "../../misc/lv_log.h" +#include "lv_gc.h" /********************* * DEFINES @@ -28,6 +24,10 @@ * STATIC VARIABLES **********************/ +#if(!defined(LV_ENABLE_GC)) || LV_ENABLE_GC == 0 + LV_ROOTS +#endif /*LV_ENABLE_GC*/ + /********************** * MACROS **********************/ @@ -36,23 +36,12 @@ * GLOBAL FUNCTIONS **********************/ -void GLClearError() +void _lv_gc_clear_roots(void) { - while(glGetError() != GL_NO_ERROR); -} - -bool GLLogCall(const char * function, const char * file, int line) -{ - GLenum error; - while((error = glGetError()) != GL_NO_ERROR) { - LV_LOG_ERROR("[OpenGL Error] (%d) %s %s:%d", error, function, file, line); - return false; - } - return true; +#define LV_CLEAR_ROOT(root_type, root_name) lv_memset_00(&LV_GC_ROOT(root_name), sizeof(LV_GC_ROOT(root_name))); + LV_ITERATE_ROOTS(LV_CLEAR_ROOT) } /********************** * STATIC FUNCTIONS **********************/ - -#endif /* LV_USE_OPENGLES */ diff --git a/L3_Middlewares/LVGL/src/misc/lv_gc.h b/L3_Middlewares/LVGL/src/misc/lv_gc.h new file mode 100644 index 0000000..9d7d1bb --- /dev/null +++ b/L3_Middlewares/LVGL/src/misc/lv_gc.h @@ -0,0 +1,97 @@ +/** + * @file lv_gc.h + * + */ + +#ifndef LV_GC_H +#define LV_GC_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" +#include +#include "lv_mem.h" +#include "lv_ll.h" +#include "lv_timer.h" +#include "lv_types.h" +#include "../draw/lv_img_cache.h" +#include "../draw/lv_draw_mask.h" +#include "../core/lv_obj_pos.h" + +/********************* + * DEFINES + *********************/ +#if LV_IMG_CACHE_DEF_SIZE +# define LV_IMG_CACHE_DEF 1 +#else +# define LV_IMG_CACHE_DEF 0 +#endif + +#define LV_DISPATCH(f, t, n) f(t, n) +#define LV_DISPATCH_COND(f, t, n, m, v) LV_CONCAT3(LV_DISPATCH, m, v)(f, t, n) + +#define LV_DISPATCH00(f, t, n) LV_DISPATCH(f, t, n) +#define LV_DISPATCH01(f, t, n) +#define LV_DISPATCH10(f, t, n) +#define LV_DISPATCH11(f, t, n) LV_DISPATCH(f, t, n) + +#define LV_ITERATE_ROOTS(f) \ + LV_DISPATCH(f, lv_ll_t, _lv_timer_ll) /*Linked list to store the lv_timers*/ \ + LV_DISPATCH(f, lv_ll_t, _lv_disp_ll) /*Linked list of display device*/ \ + LV_DISPATCH(f, lv_ll_t, _lv_indev_ll) /*Linked list of input device*/ \ + LV_DISPATCH(f, lv_ll_t, _lv_fsdrv_ll) \ + LV_DISPATCH(f, lv_ll_t, _lv_anim_ll) \ + LV_DISPATCH(f, lv_ll_t, _lv_group_ll) \ + LV_DISPATCH(f, lv_ll_t, _lv_img_decoder_ll) \ + LV_DISPATCH(f, lv_ll_t, _lv_obj_style_trans_ll) \ + LV_DISPATCH(f, lv_layout_dsc_t *, _lv_layout_list) \ + LV_DISPATCH_COND(f, _lv_img_cache_entry_t*, _lv_img_cache_array, LV_IMG_CACHE_DEF, 1) \ + LV_DISPATCH_COND(f, _lv_img_cache_entry_t, _lv_img_cache_single, LV_IMG_CACHE_DEF, 0) \ + LV_DISPATCH(f, lv_timer_t*, _lv_timer_act) \ + LV_DISPATCH(f, lv_mem_buf_arr_t , lv_mem_buf) \ + LV_DISPATCH_COND(f, _lv_draw_mask_radius_circle_dsc_arr_t , _lv_circle_cache, LV_DRAW_COMPLEX, 1) \ + LV_DISPATCH_COND(f, _lv_draw_mask_saved_arr_t , _lv_draw_mask_list, LV_DRAW_COMPLEX, 1) \ + LV_DISPATCH(f, void * , _lv_theme_default_styles) \ + LV_DISPATCH(f, void * , _lv_theme_basic_styles) \ + LV_DISPATCH_COND(f, uint8_t *, _lv_font_decompr_buf, LV_USE_FONT_COMPRESSED, 1) \ + LV_DISPATCH(f, uint8_t * , _lv_grad_cache_mem) \ + LV_DISPATCH(f, uint8_t * , _lv_style_custom_prop_flag_lookup_table) + +#define LV_DEFINE_ROOT(root_type, root_name) root_type root_name; +#define LV_ROOTS LV_ITERATE_ROOTS(LV_DEFINE_ROOT) + +#if LV_ENABLE_GC == 1 +#if LV_MEM_CUSTOM != 1 +#error "GC requires CUSTOM_MEM" +#endif /*LV_MEM_CUSTOM*/ +#include LV_GC_INCLUDE +#else /*LV_ENABLE_GC*/ +#define LV_GC_ROOT(x) x +#define LV_EXTERN_ROOT(root_type, root_name) extern root_type root_name; +LV_ITERATE_ROOTS(LV_EXTERN_ROOT) +#endif /*LV_ENABLE_GC*/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +void _lv_gc_clear_roots(void); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_GC_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_ll.c b/L3_Middlewares/LVGL/src/misc/lv_ll.c index ca1339e..e758231 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_ll.c +++ b/L3_Middlewares/LVGL/src/misc/lv_ll.c @@ -8,7 +8,7 @@ * INCLUDES *********************/ #include "lv_ll.h" -#include "../stdlib/lv_mem.h" +#include "lv_mem.h" /********************* * DEFINES @@ -39,7 +39,12 @@ static void node_set_next(lv_ll_t * ll_p, lv_ll_node_t * act, lv_ll_node_t * nex * GLOBAL FUNCTIONS **********************/ -void lv_ll_init(lv_ll_t * ll_p, uint32_t node_size) +/** + * Initialize linked list + * @param ll_p pointer to lv_ll_t variable + * @param node_size the size of 1 node in bytes + */ +void _lv_ll_init(lv_ll_t * ll_p, uint32_t node_size) { ll_p->head = NULL; ll_p->tail = NULL; @@ -54,11 +59,16 @@ void lv_ll_init(lv_ll_t * ll_p, uint32_t node_size) ll_p->n_size = node_size; } -void * lv_ll_ins_head(lv_ll_t * ll_p) +/** + * Add a new head to a linked list + * @param ll_p pointer to linked list + * @return pointer to the new head + */ +void * _lv_ll_ins_head(lv_ll_t * ll_p) { lv_ll_node_t * n_new; - n_new = lv_malloc(ll_p->n_size + LL_NODE_META_SIZE); + n_new = lv_mem_alloc(ll_p->n_size + LL_NODE_META_SIZE); if(n_new != NULL) { node_set_prev(ll_p, n_new, NULL); /*No prev. before the new head*/ @@ -77,22 +87,28 @@ void * lv_ll_ins_head(lv_ll_t * ll_p) return n_new; } -void * lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act) +/** + * Insert a new node in front of the n_act node + * @param ll_p pointer to linked list + * @param n_act pointer a node + * @return pointer to the new node + */ +void * _lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act) { lv_ll_node_t * n_new; if(NULL == ll_p || NULL == n_act) return NULL; - if(lv_ll_get_head(ll_p) == n_act) { - n_new = lv_ll_ins_head(ll_p); + if(_lv_ll_get_head(ll_p) == n_act) { + n_new = _lv_ll_ins_head(ll_p); if(n_new == NULL) return NULL; } else { - n_new = lv_malloc(ll_p->n_size + LL_NODE_META_SIZE); + n_new = lv_mem_alloc(ll_p->n_size + LL_NODE_META_SIZE); if(n_new == NULL) return NULL; lv_ll_node_t * n_prev; - n_prev = lv_ll_get_prev(ll_p, n_act); + n_prev = _lv_ll_get_prev(ll_p, n_act); node_set_next(ll_p, n_prev, n_new); node_set_prev(ll_p, n_new, n_prev); node_set_prev(ll_p, n_act, n_new); @@ -102,11 +118,16 @@ void * lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act) return n_new; } -void * lv_ll_ins_tail(lv_ll_t * ll_p) +/** + * Add a new tail to a linked list + * @param ll_p pointer to linked list + * @return pointer to the new tail + */ +void * _lv_ll_ins_tail(lv_ll_t * ll_p) { lv_ll_node_t * n_new; - n_new = lv_malloc(ll_p->n_size + LL_NODE_META_SIZE); + n_new = lv_mem_alloc(ll_p->n_size + LL_NODE_META_SIZE); if(n_new != NULL) { node_set_next(ll_p, n_new, NULL); /*No next after the new tail*/ @@ -124,13 +145,19 @@ void * lv_ll_ins_tail(lv_ll_t * ll_p) return n_new; } -void lv_ll_remove(lv_ll_t * ll_p, void * node_p) +/** + * Remove the node 'node_p' from 'll_p' linked list. + * It does not free the memory of node. + * @param ll_p pointer to the linked list of 'node_p' + * @param node_p pointer to node in 'll_p' linked list + */ +void _lv_ll_remove(lv_ll_t * ll_p, void * node_p) { if(ll_p == NULL) return; - if(lv_ll_get_head(ll_p) == node_p) { + if(_lv_ll_get_head(ll_p) == node_p) { /*The new head will be the node after 'n_act'*/ - ll_p->head = lv_ll_get_next(ll_p, node_p); + ll_p->head = _lv_ll_get_next(ll_p, node_p); if(ll_p->head == NULL) { ll_p->tail = NULL; } @@ -138,9 +165,9 @@ void lv_ll_remove(lv_ll_t * ll_p, void * node_p) node_set_prev(ll_p, ll_p->head, NULL); } } - else if(lv_ll_get_tail(ll_p) == node_p) { + else if(_lv_ll_get_tail(ll_p) == node_p) { /*The new tail will be the node before 'n_act'*/ - ll_p->tail = lv_ll_get_prev(ll_p, node_p); + ll_p->tail = _lv_ll_get_prev(ll_p, node_p); if(ll_p->tail == NULL) { ll_p->head = NULL; } @@ -149,38 +176,47 @@ void lv_ll_remove(lv_ll_t * ll_p, void * node_p) } } else { - lv_ll_node_t * n_prev = lv_ll_get_prev(ll_p, node_p); - lv_ll_node_t * n_next = lv_ll_get_next(ll_p, node_p); + lv_ll_node_t * n_prev = _lv_ll_get_prev(ll_p, node_p); + lv_ll_node_t * n_next = _lv_ll_get_next(ll_p, node_p); node_set_next(ll_p, n_prev, n_next); node_set_prev(ll_p, n_next, n_prev); } } -void lv_ll_clear_custom(lv_ll_t * ll_p, void(*cleanup)(void *)) +/** + * Remove and free all elements from a linked list. The list remain valid but become empty. + * @param ll_p pointer to linked list + */ +void _lv_ll_clear(lv_ll_t * ll_p) { void * i; void * i_next; - i = lv_ll_get_head(ll_p); + i = _lv_ll_get_head(ll_p); i_next = NULL; while(i != NULL) { - i_next = lv_ll_get_next(ll_p, i); - if(cleanup == NULL) { - lv_ll_remove(ll_p, i); - lv_free(i); - } - else { - cleanup(i); - } + i_next = _lv_ll_get_next(ll_p, i); + + _lv_ll_remove(ll_p, i); + lv_mem_free(i); + i = i_next; } } -void lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head) +/** + * Move a node to a new linked list + * @param ll_ori_p pointer to the original (old) linked list + * @param ll_new_p pointer to the new linked list + * @param node pointer to a node + * @param head true: be the head in the new list + * false be the tail in the new list + */ +void _lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head) { - lv_ll_remove(ll_ori_p, node); + _lv_ll_remove(ll_ori_p, node); if(head) { /*Set node as head*/ @@ -212,19 +248,35 @@ void lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool he } } -void * lv_ll_get_head(const lv_ll_t * ll_p) +/** + * Return with head node of the linked list + * @param ll_p pointer to linked list + * @return pointer to the head of 'll_p' + */ +void * _lv_ll_get_head(const lv_ll_t * ll_p) { if(ll_p == NULL) return NULL; return ll_p->head; } -void * lv_ll_get_tail(const lv_ll_t * ll_p) +/** + * Return with tail node of the linked list + * @param ll_p pointer to linked list + * @return pointer to the tail of 'll_p' + */ +void * _lv_ll_get_tail(const lv_ll_t * ll_p) { if(ll_p == NULL) return NULL; return ll_p->tail; } -void * lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act) +/** + * Return with the pointer of the next node after 'n_act' + * @param ll_p pointer to linked list + * @param n_act pointer a node + * @return pointer to the next node + */ +void * _lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act) { /*Pointer to the next node is stored in the end of this node. *Go there and return the address found there*/ @@ -233,7 +285,13 @@ void * lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act) return *((lv_ll_node_t **)n_act_d); } -void * lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act) +/** + * Return with the pointer of the previous node before 'n_act' + * @param ll_p pointer to linked list + * @param n_act pointer a node + * @return pointer to the previous node + */ +void * _lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act) { /*Pointer to the prev. node is stored in the end of this node. *Go there and return the address found there*/ @@ -242,32 +300,43 @@ void * lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act) return *((lv_ll_node_t **)n_act_d); } -uint32_t lv_ll_get_len(const lv_ll_t * ll_p) +/** + * Return the length of the linked list. + * @param ll_p pointer to linked list + * @return length of the linked list + */ +uint32_t _lv_ll_get_len(const lv_ll_t * ll_p) { uint32_t len = 0; void * node; - for(node = lv_ll_get_head(ll_p); node != NULL; node = lv_ll_get_next(ll_p, node)) { + for(node = _lv_ll_get_head(ll_p); node != NULL; node = _lv_ll_get_next(ll_p, node)) { len++; } return len; } -void lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after) +/** + * Move a node before an other node in the same linked list + * @param ll_p pointer to a linked list + * @param n_act pointer to node to move + * @param n_after pointer to a node which should be after `n_act` + */ +void _lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after) { if(n_act == n_after) return; /*Can't move before itself*/ void * n_before; if(n_after != NULL) - n_before = lv_ll_get_prev(ll_p, n_after); + n_before = _lv_ll_get_prev(ll_p, n_after); else - n_before = lv_ll_get_tail(ll_p); /*if `n_after` is NULL `n_act` should be the new tail*/ + n_before = _lv_ll_get_tail(ll_p); /*if `n_after` is NULL `n_act` should be the new tail*/ if(n_act == n_before) return; /*Already before `n_after`*/ /*It's much easier to remove from the list and add again*/ - lv_ll_remove(ll_p, n_act); + _lv_ll_remove(ll_p, n_act); /*Add again by setting the prev. and next nodes*/ node_set_next(ll_p, n_before, n_act); @@ -282,7 +351,12 @@ void lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after) if(n_before == NULL) ll_p->head = n_act; } -bool lv_ll_is_empty(lv_ll_t * ll_p) +/** + * Check if a linked list is empty + * @param ll_p pointer to a linked list + * @return true: the linked list is empty; false: not empty + */ +bool _lv_ll_is_empty(lv_ll_t * ll_p) { if(ll_p == NULL) return true; @@ -291,11 +365,6 @@ bool lv_ll_is_empty(lv_ll_t * ll_p) return false; } -void lv_ll_clear(lv_ll_t * ll_p) -{ - lv_ll_clear_custom(ll_p, NULL); -} - /********************** * STATIC FUNCTIONS **********************/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_ll.h b/L3_Middlewares/LVGL/src/misc/lv_ll.h index ee0836e..d38f692 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_ll.h +++ b/L3_Middlewares/LVGL/src/misc/lv_ll.h @@ -13,8 +13,9 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../lv_conf_internal.h" -#include "lv_types.h" +#include +#include +#include /********************* * DEFINES @@ -43,14 +44,14 @@ typedef struct { * @param ll_p pointer to lv_ll_t variable * @param node_size the size of 1 node in bytes */ -void lv_ll_init(lv_ll_t * ll_p, uint32_t node_size); +void _lv_ll_init(lv_ll_t * ll_p, uint32_t node_size); /** * Add a new head to a linked list * @param ll_p pointer to linked list * @return pointer to the new head */ -void * lv_ll_ins_head(lv_ll_t * ll_p); +void * _lv_ll_ins_head(lv_ll_t * ll_p); /** * Insert a new node in front of the n_act node @@ -58,14 +59,14 @@ void * lv_ll_ins_head(lv_ll_t * ll_p); * @param n_act pointer a node * @return pointer to the new node */ -void * lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act); +void * _lv_ll_ins_prev(lv_ll_t * ll_p, void * n_act); /** * Add a new tail to a linked list * @param ll_p pointer to linked list * @return pointer to the new tail */ -void * lv_ll_ins_tail(lv_ll_t * ll_p); +void * _lv_ll_ins_tail(lv_ll_t * ll_p); /** * Remove the node 'node_p' from 'll_p' linked list. @@ -73,15 +74,13 @@ void * lv_ll_ins_tail(lv_ll_t * ll_p); * @param ll_p pointer to the linked list of 'node_p' * @param node_p pointer to node in 'll_p' linked list */ -void lv_ll_remove(lv_ll_t * ll_p, void * node_p); - -void lv_ll_clear_custom(lv_ll_t * ll_p, void(*cleanup)(void *)); +void _lv_ll_remove(lv_ll_t * ll_p, void * node_p); /** * Remove and free all elements from a linked list. The list remain valid but become empty. * @param ll_p pointer to linked list */ -void lv_ll_clear(lv_ll_t * ll_p); +void _lv_ll_clear(lv_ll_t * ll_p); /** * Move a node to a new linked list @@ -91,21 +90,21 @@ void lv_ll_clear(lv_ll_t * ll_p); * @param head true: be the head in the new list * false be the tail in the new list */ -void lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head); +void _lv_ll_chg_list(lv_ll_t * ll_ori_p, lv_ll_t * ll_new_p, void * node, bool head); /** * Return with head node of the linked list * @param ll_p pointer to linked list * @return pointer to the head of 'll_p' */ -void * lv_ll_get_head(const lv_ll_t * ll_p); +void * _lv_ll_get_head(const lv_ll_t * ll_p); /** * Return with tail node of the linked list * @param ll_p pointer to linked list * @return pointer to the tail of 'll_p' */ -void * lv_ll_get_tail(const lv_ll_t * ll_p); +void * _lv_ll_get_tail(const lv_ll_t * ll_p); /** * Return with the pointer of the next node after 'n_act' @@ -113,7 +112,7 @@ void * lv_ll_get_tail(const lv_ll_t * ll_p); * @param n_act pointer a node * @return pointer to the next node */ -void * lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act); +void * _lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act); /** * Return with the pointer of the previous node after 'n_act' @@ -121,16 +120,16 @@ void * lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act); * @param n_act pointer a node * @return pointer to the previous node */ -void * lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act); +void * _lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act); /** * Return the length of the linked list. * @param ll_p pointer to linked list * @return length of the linked list */ -uint32_t lv_ll_get_len(const lv_ll_t * ll_p); +uint32_t _lv_ll_get_len(const lv_ll_t * ll_p); -/* +/** * TODO * @param ll_p * @param n1_p @@ -139,28 +138,27 @@ void lv_ll_swap(lv_ll_t * ll_p, void * n1_p, void * n2_p); */ /** - * Move a node before another node in the same linked list - * + * Move a node before an other node in the same linked list * @param ll_p pointer to a linked list * @param n_act pointer to node to move * @param n_after pointer to a node which should be after `n_act` */ -void lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after); +void _lv_ll_move_before(lv_ll_t * ll_p, void * n_act, void * n_after); /** * Check if a linked list is empty * @param ll_p pointer to a linked list * @return true: the linked list is empty; false: not empty */ -bool lv_ll_is_empty(lv_ll_t * ll_p); +bool _lv_ll_is_empty(lv_ll_t * ll_p); /********************** * MACROS **********************/ -#define LV_LL_READ(list, i) for(i = lv_ll_get_head(list); i != NULL; i = lv_ll_get_next(list, i)) +#define _LV_LL_READ(list, i) for(i = _lv_ll_get_head(list); i != NULL; i = _lv_ll_get_next(list, i)) -#define LV_LL_READ_BACK(list, i) for(i = lv_ll_get_tail(list); i != NULL; i = lv_ll_get_prev(list, i)) +#define _LV_LL_READ_BACK(list, i) for(i = _lv_ll_get_tail(list); i != NULL; i = _lv_ll_get_prev(list, i)) #ifdef __cplusplus } /*extern "C"*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_log.c b/L3_Middlewares/LVGL/src/misc/lv_log.c index 3f3caec..d79463f 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_log.c +++ b/L3_Middlewares/LVGL/src/misc/lv_log.c @@ -9,12 +9,10 @@ #include "lv_log.h" #if LV_USE_LOG -#include "../misc/lv_types.h" -#include "../stdlib/lv_sprintf.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_string.h" -#include "../tick/lv_tick.h" -#include "../core/lv_global.h" +#include +#include +#include "lv_printf.h" +#include "../hal/lv_hal_tick.h" #if LV_LOG_PRINTF #include @@ -23,26 +21,6 @@ /********************* * DEFINES *********************/ -#if LV_LOG_USE_TIMESTAMP - #define last_log_time LV_GLOBAL_DEFAULT()->log_last_log_time -#endif -#define custom_print_cb LV_GLOBAL_DEFAULT()->custom_log_print_cb - -#if LV_LOG_USE_TIMESTAMP - #define LOG_TIMESTAMP_FMT "\t(%" LV_PRIu32 ".%03" LV_PRIu32 ", +%" LV_PRIu32 ")\t" - #define LOG_TIMESTAMP_EXPR t / 1000, t % 1000, t - last_log_time, -#else - #define LOG_TIMESTAMP_FMT - #define LOG_TIMESTAMP_EXPR -#endif - -#if LV_LOG_USE_FILE_LINE - #define LOG_FILE_LINE_FMT " %s:%d" - #define LOG_FILE_LINE_EXPR , &file[p], line -#else - #define LOG_FILE_LINE_FMT - #define LOG_FILE_LINE_EXPR -#endif /********************** * TYPEDEFS @@ -55,6 +33,7 @@ /********************** * STATIC VARIABLES **********************/ +static lv_log_print_g_cb_t custom_print_cb; /********************** * MACROS @@ -64,57 +43,71 @@ * GLOBAL FUNCTIONS **********************/ +/** + * Register custom print/write function to call when a log is added. + * It can format its "File path", "Line number" and "Description" as required + * and send the formatted log message to a console or serial port. + * @param print_cb a function pointer to print a log + */ void lv_log_register_print_cb(lv_log_print_g_cb_t print_cb) { custom_print_cb = print_cb; } -void lv_log_add(lv_log_level_t level, const char * file, int line, const char * func, const char * format, ...) +/** + * Add a log + * @param level the level of log. (From `lv_log_level_t` enum) + * @param file name of the file when the log added + * @param line line number in the source code where the log added + * @param func name of the function when the log added + * @param format printf-like format string + * @param ... parameters for `format` + */ +void _lv_log_add(lv_log_level_t level, const char * file, int line, const char * func, const char * format, ...) { - if(level >= LV_LOG_LEVEL_NUM) return; /*Invalid level*/ + if(level >= _LV_LOG_LEVEL_NUM) return; /*Invalid level*/ + + static uint32_t last_log_time = 0; if(level >= LV_LOG_LEVEL) { va_list args; va_start(args, format); -#if LV_LOG_USE_FILE_LINE /*Use only the file name not the path*/ size_t p; - for(p = lv_strlen(file); p > 0; p--) { + for(p = strlen(file); p > 0; p--) { if(file[p] == '/' || file[p] == '\\') { p++; /*Skip the slash*/ break; } } -#else - LV_UNUSED(file); - LV_UNUSED(line); -#endif -#if LV_LOG_USE_TIMESTAMP uint32_t t = lv_tick_get(); -#endif static const char * lvl_prefix[] = {"Trace", "Info", "Warn", "Error", "User"}; #if LV_LOG_PRINTF - printf("[%s]" LOG_TIMESTAMP_FMT " %s: ", - lvl_prefix[level], LOG_TIMESTAMP_EXPR func); + printf("[%s]\t(%" LV_PRId32 ".%03" LV_PRId32 ", +%" LV_PRId32 ")\t %s: ", + lvl_prefix[level], t / 1000, t % 1000, t - last_log_time, func); vprintf(format, args); - printf(LOG_FILE_LINE_FMT "\n" LOG_FILE_LINE_EXPR); - fflush(stdout); -#endif + printf(" \t(in %s line #%d)\n", &file[p], line); +#else if(custom_print_cb) { char buf[512]; +#if LV_SPRINTF_CUSTOM char msg[256]; lv_vsnprintf(msg, sizeof(msg), format, args); - lv_snprintf(buf, sizeof(buf), "[%s]" LOG_TIMESTAMP_FMT " %s: %s" LOG_FILE_LINE_FMT "\n", - lvl_prefix[level], LOG_TIMESTAMP_EXPR func, msg LOG_FILE_LINE_EXPR); - custom_print_cb(level, buf); + lv_snprintf(buf, sizeof(buf), "[%s]\t(%" LV_PRId32 ".%03" LV_PRId32 ", +%" LV_PRId32 ")\t %s: %s \t(in %s line #%d)\n", + lvl_prefix[level], t / 1000, t % 1000, t - last_log_time, func, msg, &file[p], line); +#else + lv_vaformat_t vaf = {format, &args}; + lv_snprintf(buf, sizeof(buf), "[%s]\t(%" LV_PRId32 ".%03" LV_PRId32 ", +%" LV_PRId32 ")\t %s: %pV \t(in %s line #%d)\n", + lvl_prefix[level], t / 1000, t % 1000, t - last_log_time, func, (void *)&vaf, &file[p], line); +#endif + custom_print_cb(buf); } +#endif -#if LV_LOG_USE_TIMESTAMP last_log_time = t; -#endif va_end(args); } } @@ -131,8 +124,13 @@ void lv_log(const char * format, ...) #else if(custom_print_cb) { char buf[512]; +#if LV_SPRINTF_CUSTOM lv_vsnprintf(buf, sizeof(buf), format, args); - custom_print_cb(LV_LOG_LEVEL_USER, buf); +#else + lv_vaformat_t vaf = {format, &args}; + lv_snprintf(buf, sizeof(buf), "%pV", (void *)&vaf); +#endif + custom_print_cb(buf); } #endif diff --git a/L3_Middlewares/LVGL/src/misc/lv_log.h b/L3_Middlewares/LVGL/src/misc/lv_log.h index 7774ba6..9a00993 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_log.h +++ b/L3_Middlewares/LVGL/src/misc/lv_log.h @@ -14,6 +14,7 @@ extern "C" { * INCLUDES *********************/ #include "../lv_conf_internal.h" +#include #include "lv_types.h" @@ -23,13 +24,13 @@ extern "C" { /*Possible log level. For compatibility declare it independently from `LV_USE_LOG`*/ -#define LV_LOG_LEVEL_TRACE 0 /**< Log detailed information. */ -#define LV_LOG_LEVEL_INFO 1 /**< Log important events. */ -#define LV_LOG_LEVEL_WARN 2 /**< Log if something unwanted happened but didn't caused problem. */ -#define LV_LOG_LEVEL_ERROR 3 /**< Log only critical issues, when system may fail. */ -#define LV_LOG_LEVEL_USER 4 /**< Log only custom log messages added by the user. */ -#define LV_LOG_LEVEL_NONE 5 /**< Do not log anything. */ -#define LV_LOG_LEVEL_NUM 6 /**< Number of log levels */ +#define LV_LOG_LEVEL_TRACE 0 /**< A lot of logs to give detailed information*/ +#define LV_LOG_LEVEL_INFO 1 /**< Log important events*/ +#define LV_LOG_LEVEL_WARN 2 /**< Log if something unwanted happened but didn't caused problem*/ +#define LV_LOG_LEVEL_ERROR 3 /**< Only critical issue, when the system may fail*/ +#define LV_LOG_LEVEL_USER 4 /**< Custom logs from the user*/ +#define LV_LOG_LEVEL_NONE 5 /**< Do not log anything*/ +#define _LV_LOG_LEVEL_NUM 6 /**< Number of log levels*/ LV_EXPORT_CONST_INT(LV_LOG_LEVEL_TRACE); LV_EXPORT_CONST_INT(LV_LOG_LEVEL_INFO); @@ -41,15 +42,6 @@ LV_EXPORT_CONST_INT(LV_LOG_LEVEL_NONE); typedef int8_t lv_log_level_t; #if LV_USE_LOG - -#if LV_LOG_USE_FILE_LINE -#define LV_LOG_FILE __FILE__ -#define LV_LOG_LINE __LINE__ -#else -#define LV_LOG_FILE NULL -#define LV_LOG_LINE 0 -#endif - /********************** * TYPEDEFS **********************/ @@ -57,7 +49,7 @@ typedef int8_t lv_log_level_t; /** * Log print function. Receives a string buffer to print". */ -typedef void (*lv_log_print_g_cb_t)(lv_log_level_t level, const char * buf); +typedef void (*lv_log_print_g_cb_t)(const char * buf); /********************** * GLOBAL PROTOTYPES @@ -88,15 +80,15 @@ void lv_log(const char * format, ...) LV_FORMAT_ATTRIBUTE(1, 2); * @param format printf-like format string * @param ... parameters for `format` */ -void lv_log_add(lv_log_level_t level, const char * file, int line, - const char * func, const char * format, ...) LV_FORMAT_ATTRIBUTE(5, 6); +void _lv_log_add(lv_log_level_t level, const char * file, int line, + const char * func, const char * format, ...) LV_FORMAT_ATTRIBUTE(5, 6); /********************** * MACROS **********************/ #ifndef LV_LOG_TRACE # if LV_LOG_LEVEL <= LV_LOG_LEVEL_TRACE -# define LV_LOG_TRACE(...) lv_log_add(LV_LOG_LEVEL_TRACE, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__) +# define LV_LOG_TRACE(...) _lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, __func__, __VA_ARGS__) # else # define LV_LOG_TRACE(...) do {}while(0) # endif @@ -104,7 +96,7 @@ void lv_log_add(lv_log_level_t level, const char * file, int line, #ifndef LV_LOG_INFO # if LV_LOG_LEVEL <= LV_LOG_LEVEL_INFO -# define LV_LOG_INFO(...) lv_log_add(LV_LOG_LEVEL_INFO, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__) +# define LV_LOG_INFO(...) _lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__) # else # define LV_LOG_INFO(...) do {}while(0) # endif @@ -112,7 +104,7 @@ void lv_log_add(lv_log_level_t level, const char * file, int line, #ifndef LV_LOG_WARN # if LV_LOG_LEVEL <= LV_LOG_LEVEL_WARN -# define LV_LOG_WARN(...) lv_log_add(LV_LOG_LEVEL_WARN, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__) +# define LV_LOG_WARN(...) _lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, __func__, __VA_ARGS__) # else # define LV_LOG_WARN(...) do {}while(0) # endif @@ -120,7 +112,7 @@ void lv_log_add(lv_log_level_t level, const char * file, int line, #ifndef LV_LOG_ERROR # if LV_LOG_LEVEL <= LV_LOG_LEVEL_ERROR -# define LV_LOG_ERROR(...) lv_log_add(LV_LOG_LEVEL_ERROR, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__) +# define LV_LOG_ERROR(...) _lv_log_add(LV_LOG_LEVEL_ERROR, __FILE__, __LINE__, __func__, __VA_ARGS__) # else # define LV_LOG_ERROR(...) do {}while(0) # endif @@ -128,7 +120,7 @@ void lv_log_add(lv_log_level_t level, const char * file, int line, #ifndef LV_LOG_USER # if LV_LOG_LEVEL <= LV_LOG_LEVEL_USER -# define LV_LOG_USER(...) lv_log_add(LV_LOG_LEVEL_USER, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__) +# define LV_LOG_USER(...) _lv_log_add(LV_LOG_LEVEL_USER, __FILE__, __LINE__, __func__, __VA_ARGS__) # else # define LV_LOG_USER(...) do {}while(0) # endif @@ -145,7 +137,7 @@ void lv_log_add(lv_log_level_t level, const char * file, int line, #else /*LV_USE_LOG*/ /*Do nothing if `LV_USE_LOG 0`*/ -#define lv_log_add(level, file, line, ...) +#define _lv_log_add(level, file, line, ...) #define LV_LOG_TRACE(...) do {}while(0) #define LV_LOG_INFO(...) do {}while(0) #define LV_LOG_WARN(...) do {}while(0) diff --git a/L3_Middlewares/LVGL/src/misc/lv_lru.c b/L3_Middlewares/LVGL/src/misc/lv_lru.c index f8d4c06..6ff8390 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_lru.c +++ b/L3_Middlewares/LVGL/src/misc/lv_lru.c @@ -10,8 +10,7 @@ #include "lv_lru.h" #include "lv_math.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_string.h" +#include "lv_mem.h" #include "lv_assert.h" #include "lv_log.h" @@ -23,13 +22,13 @@ * TYPEDEFS **********************/ -struct lv_lru_item_t { +struct _lv_lru_item_t { void * value; void * key; size_t value_length; size_t key_length; uint64_t access_count; - struct lv_lru_item_t * next; + struct _lv_lru_item_t * next; }; /********************** @@ -71,11 +70,12 @@ static lv_lru_item_t * lv_lru_pop_or_create_item(lv_lru_t * cache); * GLOBAL FUNCTIONS **********************/ -lv_lru_t * lv_lru_create(size_t cache_size, size_t average_length, lv_lru_free_cb_t value_free, - lv_lru_free_cb_t key_free) +lv_lru_t * lv_lru_create(size_t cache_size, size_t average_length, lv_lru_free_t * value_free, + lv_lru_free_t * key_free) { // create the cache - lv_lru_t * cache = lv_malloc_zeroed(sizeof(lv_lru_t)); + lv_lru_t * cache = (lv_lru_t *) lv_mem_alloc(sizeof(lv_lru_t)); + lv_memset_00(cache, sizeof(lv_lru_t)); if(!cache) { LV_LOG_WARN("LRU Cache unable to create cache object"); return NULL; @@ -85,25 +85,27 @@ lv_lru_t * lv_lru_create(size_t cache_size, size_t average_length, lv_lru_free_c cache->free_memory = cache_size; cache->total_memory = cache_size; cache->seed = lv_rand(1, UINT32_MAX); - cache->value_free = value_free ? value_free : lv_free; - cache->key_free = key_free ? key_free : lv_free; + cache->value_free = value_free ? value_free : lv_mem_free; + cache->key_free = key_free ? key_free : lv_mem_free; // size the hash table to a guestimate of the number of slots required (assuming a perfect hash) - cache->items = lv_malloc_zeroed(sizeof(lv_lru_item_t *) * cache->hash_table_size); + cache->items = (lv_lru_item_t **) lv_mem_alloc(sizeof(lv_lru_item_t *) * cache->hash_table_size); + lv_memset_00(cache->items, sizeof(lv_lru_item_t *) * cache->hash_table_size); if(!cache->items) { LV_LOG_WARN("LRU Cache unable to create cache hash table"); - lv_free(cache); + lv_mem_free(cache); return NULL; } return cache; } -void lv_lru_delete(lv_lru_t * cache) + +void lv_lru_del(lv_lru_t * cache) { LV_ASSERT_NULL(cache); // free each of the cached items, and the hash table - lv_lru_item_t * item = NULL, * next = NULL; + lv_lru_item_t * item = NULL, *next = NULL; uint32_t i = 0; if(cache->items) { for(; i < cache->hash_table_size; i++) { @@ -113,26 +115,27 @@ void lv_lru_delete(lv_lru_t * cache) cache->value_free(item->value); cache->key_free(item->key); cache->free_memory += item->value_length; - lv_free(item); + lv_mem_free(item); item = next; } } - lv_free(cache->items); + lv_mem_free(cache->items); } if(cache->free_items) { item = cache->free_items; while(item) { next = (lv_lru_item_t *) item->next; - lv_free(item); + lv_mem_free(item); item = next; } } // free the cache - lv_free(cache); + lv_mem_free(cache); } + lv_lru_res_t lv_lru_set(lv_lru_t * cache, const void * key, size_t key_length, void * value, size_t value_length) { test_for_missing_cache(); @@ -143,7 +146,7 @@ lv_lru_res_t lv_lru_set(lv_lru_t * cache, const void * key, size_t key_length, v // see if the key already exists uint32_t hash_index = lv_lru_hash(cache, key, key_length); int required = 0; - lv_lru_item_t * item = NULL, * prev = NULL; + lv_lru_item_t * item = NULL, *prev = NULL; item = cache->items[hash_index]; while(item && lv_lru_cmp_keys(item, key, key_length)) { @@ -163,8 +166,8 @@ lv_lru_res_t lv_lru_set(lv_lru_t * cache, const void * key, size_t key_length, v // insert a new item item = lv_lru_pop_or_create_item(cache); item->value = value; - item->key = lv_malloc(key_length); - lv_memcpy(item->key, key, key_length); + item->key = lv_mem_alloc(key_length); + memcpy(item->key, key, key_length); item->value_length = value_length; item->key_length = key_length; required = (int) value_length; @@ -185,6 +188,7 @@ lv_lru_res_t lv_lru_set(lv_lru_t * cache, const void * key, size_t key_length, v return LV_LRU_OK; } + lv_lru_res_t lv_lru_get(lv_lru_t * cache, const void * key, size_t key_size, void ** value) { test_for_missing_cache(); @@ -214,7 +218,7 @@ lv_lru_res_t lv_lru_remove(lv_lru_t * cache, const void * key, size_t key_size) test_for_missing_key(); // loop until we find the item, or hit the end of a chain - lv_lru_item_t * item = NULL, * prev = NULL; + lv_lru_item_t * item = NULL, *prev = NULL; uint32_t hash_index = lv_lru_hash(cache, key, key_size); item = cache->items[hash_index]; @@ -232,8 +236,8 @@ lv_lru_res_t lv_lru_remove(lv_lru_t * cache, const void * key, size_t key_size) void lv_lru_remove_lru_item(lv_lru_t * cache) { - lv_lru_item_t * min_item = NULL, * min_prev = NULL; - lv_lru_item_t * item = NULL, * prev = NULL; + lv_lru_item_t * min_item = NULL, *min_prev = NULL; + lv_lru_item_t * item = NULL, *prev = NULL; uint32_t i = 0, min_index = -1; uint64_t min_access_count = -1; @@ -303,7 +307,7 @@ static int lv_lru_cmp_keys(lv_lru_item_t * item, const void * key, uint32_t key_ return 1; } else { - return lv_memcmp(key, item->key, key_length); + return memcmp(key, item->key, key_length); } } @@ -322,7 +326,7 @@ static void lv_lru_remove_item(lv_lru_t * cache, lv_lru_item_t * prev, lv_lru_it cache->key_free(item->key); // push the item to the free items queue - lv_memzero(item, sizeof(lv_lru_item_t)); + lv_memset_00(item, sizeof(lv_lru_item_t)); item->next = cache->free_items; cache->free_items = item; } @@ -334,10 +338,11 @@ static lv_lru_item_t * lv_lru_pop_or_create_item(lv_lru_t * cache) if(cache->free_items) { item = cache->free_items; cache->free_items = item->next; - lv_memzero(item, sizeof(lv_lru_item_t)); + lv_memset_00(item, sizeof(lv_lru_item_t)); } else { - item = lv_malloc_zeroed(sizeof(lv_lru_item_t)); + item = (lv_lru_item_t *) lv_mem_alloc(sizeof(lv_lru_item_t)); + lv_memset_00(item, sizeof(lv_lru_item_t)); } return item; diff --git a/L3_Middlewares/LVGL/src/misc/lv_lru.h b/L3_Middlewares/LVGL/src/misc/lv_lru.h index 1bb2586..2d0134e 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_lru.h +++ b/L3_Middlewares/LVGL/src/misc/lv_lru.h @@ -18,6 +18,10 @@ extern "C" { #include "lv_types.h" +#include +#include + + /********************* * DEFINES *********************/ @@ -35,9 +39,8 @@ typedef enum { LV_LRU_VALUE_TOO_LARGE } lv_lru_res_t; -typedef void (*lv_lru_free_cb_t)(void * v); - -typedef struct lv_lru_item_t lv_lru_item_t; +typedef void (lv_lru_free_t)(void * v); +typedef struct _lv_lru_item_t lv_lru_item_t; typedef struct lv_lru_t { lv_lru_item_t ** items; @@ -47,19 +50,20 @@ typedef struct lv_lru_t { size_t average_item_length; size_t hash_table_size; uint32_t seed; - lv_lru_free_cb_t value_free; - lv_lru_free_cb_t key_free; + lv_lru_free_t * value_free; + lv_lru_free_t * key_free; lv_lru_item_t * free_items; } lv_lru_t; + /********************** * GLOBAL PROTOTYPES **********************/ -lv_lru_t * lv_lru_create(size_t cache_size, size_t average_length, lv_lru_free_cb_t value_free, - lv_lru_free_cb_t key_free); +lv_lru_t * lv_lru_create(size_t cache_size, size_t average_length, lv_lru_free_t * value_free, + lv_lru_free_t * key_free); -void lv_lru_delete(lv_lru_t * cache); +void lv_lru_del(lv_lru_t * cache); lv_lru_res_t lv_lru_set(lv_lru_t * cache, const void * key, size_t key_length, void * value, size_t value_length); diff --git a/L3_Middlewares/LVGL/src/misc/lv_math.c b/L3_Middlewares/LVGL/src/misc/lv_math.c index bd728fb..cf2d0fb 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_math.c +++ b/L3_Middlewares/LVGL/src/misc/lv_math.c @@ -1,4 +1,4 @@ -/** +/** * @file lv_math.c * */ @@ -7,24 +7,15 @@ * INCLUDES *********************/ #include "lv_math.h" -#include "../core/lv_global.h" /********************* * DEFINES *********************/ -#define rand_seed LV_GLOBAL_DEFAULT()->math_rand_seed /********************** * TYPEDEFS **********************/ -#define CUBIC_NEWTON_ITERATIONS 8 -#define CUBIC_PRECISION_BITS 10 /* 10 or 14 bits recommended, int64_t calculation is used for >14bit precision */ - -#if CUBIC_PRECISION_BITS < 10 || CUBIC_PRECISION_BITS > 20 - #error "cubic precision bits should be in range of [10, 20] for 32bit/64bit calculations." -#endif - /********************** * STATIC PROTOTYPES **********************/ @@ -32,13 +23,13 @@ /********************** * STATIC VARIABLES **********************/ -static const uint16_t sin0_90_table[] = { +static const int16_t sin0_90_table[] = { 0, 572, 1144, 1715, 2286, 2856, 3425, 3993, 4560, 5126, 5690, 6252, 6813, 7371, 7927, 8481, - 9032, 9580, 10126, 10668, 11207, 11743, 12275, 12803, 13328, 13848, 14365, 14876, 15384, 15886, 16384, 16877, - 17364, 17847, 18324, 18795, 19261, 19720, 20174, 20622, 21063, 21498, 21926, 22348, 22763, 23170, 23571, 23965, - 24351, 24730, 25102, 25466, 25822, 26170, 26510, 26842, 27166, 27482, 27789, 28088, 28378, 28660, 28932, 29197, - 29452, 29698, 29935, 30163, 30382, 30592, 30792, 30983, 31164, 31336, 31499, 31651, 31795, 31928, 32052, 32166, - 32270, 32365, 32449, 32524, 32588, 32643, 32688, 32723, 32748, 32763, 32768 + 9032, 9580, 10126, 10668, 11207, 11743, 12275, 12803, 13328, 13848, 14364, 14876, 15383, 15886, 16383, 16876, + 17364, 17846, 18323, 18794, 19260, 19720, 20173, 20621, 21062, 21497, 21925, 22347, 22762, 23170, 23571, 23964, + 24351, 24730, 25101, 25465, 25821, 26169, 26509, 26841, 27165, 27481, 27788, 28087, 28377, 28659, 28932, 29196, + 29451, 29697, 29934, 30162, 30381, 30591, 30791, 30982, 31163, 31335, 31498, 31650, 31794, 31927, 32051, 32165, + 32269, 32364, 32448, 32523, 32587, 32642, 32687, 32722, 32747, 32762, 32767 }; /********************** @@ -49,11 +40,17 @@ static const uint16_t sin0_90_table[] = { * GLOBAL FUNCTIONS **********************/ -int32_t LV_ATTRIBUTE_FAST_MEM lv_trigo_sin(int16_t angle) +/** + * Return with sinus of an angle + * @param angle + * @return sinus of 'angle'. sin(-90) = -32767, sin(90) = 32767 + */ +int16_t LV_ATTRIBUTE_FAST_MEM lv_trigo_sin(int16_t angle) { - int32_t ret = 0; - while(angle < 0) angle += 360; - while(angle >= 360) angle -= 360; + int16_t ret = 0; + angle = angle % 360; + + if(angle < 0) angle = 360 + angle; if(angle < 90) { ret = sin0_90_table[angle]; @@ -71,147 +68,51 @@ int32_t LV_ATTRIBUTE_FAST_MEM lv_trigo_sin(int16_t angle) ret = -sin0_90_table[angle]; } - if(ret == 32767) return 32768; - else if(ret == -32767) return -32768; - else return ret; + return ret; } /** - * cubic-bezier Reference: - * - * https://github.com/gre/bezier-easing - * https://opensource.apple.com/source/WebCore/WebCore-955.66/platform/graphics/UnitBezier.h - * - * Copyright (c) 2014 Gaëtan Renaudeau - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * + * Calculate a value of a Cubic Bezier function. + * @param t time in range of [0..LV_BEZIER_VAL_MAX] + * @param u0 start values in range of [0..LV_BEZIER_VAL_MAX] + * @param u1 control value 1 values in range of [0..LV_BEZIER_VAL_MAX] + * @param u2 control value 2 in range of [0..LV_BEZIER_VAL_MAX] + * @param u3 end values in range of [0..LV_BEZIER_VAL_MAX] + * @return the value calculated from the given parameters in range of [0..LV_BEZIER_VAL_MAX] */ - -static int32_t do_cubic_bezier(int32_t t, int32_t a, int32_t b, int32_t c) +uint32_t lv_bezier3(uint32_t t, uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3) { - /*a * t^3 + b * t^2 + c * t*/ -#if CUBIC_PRECISION_BITS > 14 - int64_t ret; -#else - int32_t ret; -#endif - - ret = a; - ret = (ret * t) >> CUBIC_PRECISION_BITS; - ret = ((ret + b) * t) >> CUBIC_PRECISION_BITS; - ret = ((ret + c) * t) >> CUBIC_PRECISION_BITS; - return ret; -} - -int32_t lv_cubic_bezier(int32_t x, int32_t x1, int32_t y1, int32_t x2, int32_t y2) -{ - int32_t ax, bx, cx, ay, by, cy; - int32_t tl, tr, t; /*t in cubic-bezier function, used for bisection */ - int32_t xs; /*x sampled on curve */ -#if CUBIC_PRECISION_BITS > 14 - int64_t d; /*slope value at specified t*/ -#else - int32_t d; -#endif - - if(x == 0 || x == LV_BEZIER_VAL_MAX) return x; - - /* input is always LV_BEZIER_VAL_SHIFT bit precision */ - -#if CUBIC_PRECISION_BITS != LV_BEZIER_VAL_SHIFT - x <<= CUBIC_PRECISION_BITS - LV_BEZIER_VAL_SHIFT; - x1 <<= CUBIC_PRECISION_BITS - LV_BEZIER_VAL_SHIFT; - x2 <<= CUBIC_PRECISION_BITS - LV_BEZIER_VAL_SHIFT; - y1 <<= CUBIC_PRECISION_BITS - LV_BEZIER_VAL_SHIFT; - y2 <<= CUBIC_PRECISION_BITS - LV_BEZIER_VAL_SHIFT; -#endif - - cx = 3 * x1; - bx = 3 * (x2 - x1) - cx; - ax = (1L << CUBIC_PRECISION_BITS) - cx - bx; - - cy = 3 * y1; - by = 3 * (y2 - y1) - cy; - ay = (1L << CUBIC_PRECISION_BITS) - cy - by; - - /*Try Newton's method firstly */ - t = x; /*Make a guess*/ - for(int i = 0; i < CUBIC_NEWTON_ITERATIONS; i++) { - /*Check if x on curve at t matches input x*/ - xs = do_cubic_bezier(t, ax, bx, cx) - x; - if(LV_ABS(xs) <= 1) goto found; - - /* get slop at t, d = 3 * ax * t^2 + 2 * bx + t + cx */ - d = ax; /* use 64bit operation if needed. */ - d = (3 * d * t) >> CUBIC_PRECISION_BITS; - d = ((d + 2 * bx) * t) >> CUBIC_PRECISION_BITS; - d += cx; - - if(LV_ABS(d) <= 1) break; - - d = ((int64_t)xs * (1L << CUBIC_PRECISION_BITS)) / d; - if(d == 0) break; /*Reached precision limits*/ - t -= d; - } - - /*Fallback to bisection method for reliability*/ - tl = 0, tr = 1L << CUBIC_PRECISION_BITS, t = x; - - if(t < tl) { - t = tl; - goto found; - } - - if(t > tr) { - t = tr; - goto found; - } - - while(tl < tr) { - xs = do_cubic_bezier(t, ax, bx, cx); - if(LV_ABS(xs - x) <= 1) goto found; - x > xs ? (tl = t) : (tr = t); - t = (tr - tl) / 2 + tl; - if(t == tl) break; - } - - /*Failed to find suitable t for given x, return a value anyway.*/ -found: - /*Return y at t*/ -#if CUBIC_PRECISION_BITS != LV_BEZIER_VAL_SHIFT - return do_cubic_bezier(t, ay, by, cy) >> (CUBIC_PRECISION_BITS - LV_BEZIER_VAL_SHIFT); -#else - return do_cubic_bezier(t, ay, by, cy); -#endif + uint32_t t_rem = 1024 - t; + uint32_t t_rem2 = (t_rem * t_rem) >> 10; + uint32_t t_rem3 = (t_rem2 * t_rem) >> 10; + uint32_t t2 = (t * t) >> 10; + uint32_t t3 = (t2 * t) >> 10; + + uint32_t v1 = (t_rem3 * u0) >> 10; + uint32_t v2 = (3 * t_rem2 * t * u1) >> 20; + uint32_t v3 = (3 * t_rem * t2 * u2) >> 20; + uint32_t v4 = (t3 * u3) >> 10; + + return v1 + v2 + v3 + v4; } +/** + * Get the square root of a number + * @param x integer which square root should be calculated + * @param q store the result here. q->i: integer part, q->f: fractional part in 1/256 unit + * @param mask optional to skip some iterations if the magnitude of the root is known. + * Set to 0x8000 by default. + * If root < 16: mask = 0x80 + * If root < 256: mask = 0x800 + * Else: mask = 0x8000 + */ void LV_ATTRIBUTE_FAST_MEM lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask) { x = x << 8; /*To get 4 bit precision. (sqrt(256) = 16 = 4 bit)*/ uint32_t root = 0; uint32_t trial; - /*http://ww1.microchip.com/...en/AppNotes/91040a.pdf*/ + // http://ww1.microchip.com/...en/AppNotes/91040a.pdf do { trial = root + mask; if(trial * trial <= x) root = trial; @@ -222,172 +123,94 @@ void LV_ATTRIBUTE_FAST_MEM lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask) q->f = (root & 0xf) << 4; } -/* -// Alternative Integer Square Root function -// Contributors include Arne Steinarson for the basic approximation idea, -// Dann Corbit and Mathew Hendry for the first cut at the algorithm, -// Lawrence Kirby for the rearrangement, improvements and range optimization -// and Paul Hsieh for the round-then-adjust idea. -*/ -int32_t LV_ATTRIBUTE_FAST_MEM lv_sqrt32(uint32_t x) -{ - static const unsigned char sqq_table[] = { - 0, 16, 22, 27, 32, 35, 39, 42, 45, 48, 50, 53, 55, 57, - 59, 61, 64, 65, 67, 69, 71, 73, 75, 76, 78, 80, 81, 83, - 84, 86, 87, 89, 90, 91, 93, 94, 96, 97, 98, 99, 101, 102, - 103, 104, 106, 107, 108, 109, 110, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 128, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 144, 145, - 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 155, 156, 157, - 158, 159, 160, 160, 161, 162, 163, 163, 164, 165, 166, 167, 167, 168, - 169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178, 178, - 179, 180, 181, 181, 182, 183, 183, 184, 185, 185, 186, 187, 187, 188, - 189, 189, 190, 191, 192, 192, 193, 193, 194, 195, 195, 196, 197, 197, - 198, 199, 199, 200, 201, 201, 202, 203, 203, 204, 204, 205, 206, 206, - 207, 208, 208, 209, 209, 210, 211, 211, 212, 212, 213, 214, 214, 215, - 215, 216, 217, 217, 218, 218, 219, 219, 220, 221, 221, 222, 222, 223, - 224, 224, 225, 225, 226, 226, 227, 227, 228, 229, 229, 230, 230, 231, - 231, 232, 232, 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 238, - 239, 240, 240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, - 246, 247, 247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, - 253, 254, 254, 255 - }; - - int32_t xn; - - if(x >= 0x10000) - if(x >= 0x1000000) - if(x >= 0x10000000) - if(x >= 0x40000000) { - if(x >= 65535UL * 65535UL) - return 65535; - xn = sqq_table[x >> 24] << 8; - } - else - xn = sqq_table[x >> 22] << 7; - else if(x >= 0x4000000) - xn = sqq_table[x >> 20] << 6; - else - xn = sqq_table[x >> 18] << 5; - else { - if(x >= 0x100000) - if(x >= 0x400000) - xn = sqq_table[x >> 16] << 4; - else - xn = sqq_table[x >> 14] << 3; - else if(x >= 0x40000) - xn = sqq_table[x >> 12] << 2; - else - xn = sqq_table[x >> 10] << 1; - - goto nr1; - } - else if(x >= 0x100) { - if(x >= 0x1000) - if(x >= 0x4000) - xn = (sqq_table[x >> 8] >> 0) + 1; - else - xn = (sqq_table[x >> 6] >> 1) + 1; - else if(x >= 0x400) - xn = (sqq_table[x >> 4] >> 2) + 1; - else - xn = (sqq_table[x >> 2] >> 3) + 1; - - goto adj; - } - else - return sqq_table[x] >> 4; - - /* Run two iterations of the standard convergence formula */ - - xn = (xn + 1 + x / xn) / 2; -nr1: - xn = (xn + 1 + x / xn) / 2; -adj: - - if(xn * xn > (int32_t)x) /* Correct rounding if necessary */ - xn--; - - return xn; -} - +/** + * Calculate the atan2 of a vector. + * @param x + * @param y + * @return the angle in degree calculated from the given parameters in range of [0..360] + */ uint16_t lv_atan2(int x, int y) { - /** - * Fast XY vector to integer degree algorithm - Jan 2011 www.RomanBlack.com - * Converts any XY values including 0 to a degree value that should be - * within +/- 1 degree of the accurate value without needing - * large slow trig functions like ArcTan() or ArcCos(). - * NOTE! at least one of the X or Y values must be non-zero! - * This is the full version, for all 4 quadrants and will generate - * the angle in integer degrees from 0-360. - * Any values of X and Y are usable including negative values provided - * they are between -1456 and 1456 so the 16bit multiply does not overflow. - */ + // Fast XY vector to integer degree algorithm - Jan 2011 www.RomanBlack.com + // Converts any XY values including 0 to a degree value that should be + // within +/- 1 degree of the accurate value without needing + // large slow trig functions like ArcTan() or ArcCos(). + // NOTE! at least one of the X or Y values must be non-zero! + // This is the full version, for all 4 quadrants and will generate + // the angle in integer degrees from 0-360. + // Any values of X and Y are usable including negative values provided + // they are between -1456 and 1456 so the 16bit multiply does not overflow. + unsigned char negflag; unsigned char tempdegree; unsigned char comp; - unsigned int degree; /*this will hold the result*/ + unsigned int degree; // this will hold the result unsigned int ux; unsigned int uy; - /*Save the sign flags then remove signs and get XY as unsigned ints*/ + // Save the sign flags then remove signs and get XY as unsigned ints negflag = 0; if(x < 0) { - negflag += 0x01; /*x flag bit*/ - x = (0 - x); /*is now +*/ + negflag += 0x01; // x flag bit + x = (0 - x); // is now + } - ux = x; /*copy to unsigned var before multiply*/ + ux = x; // copy to unsigned var before multiply if(y < 0) { - negflag += 0x02; /*y flag bit*/ - y = (0 - y); /*is now +*/ + negflag += 0x02; // y flag bit + y = (0 - y); // is now + } - uy = y; /*copy to unsigned var before multiply*/ + uy = y; // copy to unsigned var before multiply - /*1. Calc the scaled "degrees"*/ + // 1. Calc the scaled "degrees" if(ux > uy) { - degree = (uy * 45) / ux; /*degree result will be 0-45 range*/ - negflag += 0x10; /*octant flag bit*/ + degree = (uy * 45) / ux; // degree result will be 0-45 range + negflag += 0x10; // octant flag bit } else { - degree = (ux * 45) / uy; /*degree result will be 0-45 range*/ + degree = (ux * 45) / uy; // degree result will be 0-45 range } - /*2. Compensate for the 4 degree error curve*/ + // 2. Compensate for the 4 degree error curve comp = 0; - tempdegree = degree; /*use an unsigned char for speed!*/ - if(tempdegree > 22) { /*if top half of range*/ + tempdegree = degree; // use an unsigned char for speed! + if(tempdegree > 22) { // if top half of range if(tempdegree <= 44) comp++; if(tempdegree <= 41) comp++; if(tempdegree <= 37) comp++; - if(tempdegree <= 32) comp++; /*max is 4 degrees compensated*/ + if(tempdegree <= 32) comp++; // max is 4 degrees compensated } - else { /*else is lower half of range*/ + else { // else is lower half of range if(tempdegree >= 2) comp++; if(tempdegree >= 6) comp++; if(tempdegree >= 10) comp++; - if(tempdegree >= 15) comp++; /*max is 4 degrees compensated*/ + if(tempdegree >= 15) comp++; // max is 4 degrees compensated } - degree += comp; /*degree is now accurate to +/- 1 degree!*/ + degree += comp; // degree is now accurate to +/- 1 degree! - /*Invert degree if it was X>Y octant, makes 0-45 into 90-45*/ + // Invert degree if it was X>Y octant, makes 0-45 into 90-45 if(negflag & 0x10) degree = (90 - degree); - /*3. Degree is now 0-90 range for this quadrant,*/ - /*need to invert it for whichever quadrant it was in*/ - if(negflag & 0x02) { /*if -Y*/ - if(negflag & 0x01) /*if -Y -X*/ + // 3. Degree is now 0-90 range for this quadrant, + // need to invert it for whichever quadrant it was in + if(negflag & 0x02) { // if -Y + if(negflag & 0x01) // if -Y -X degree = (180 + degree); - else /*else is -Y +X*/ + else // else is -Y +X degree = (180 - degree); } - else { /*else is +Y*/ - if(negflag & 0x01) /*if +Y -X*/ + else { // else is +Y + if(negflag & 0x01) // if +Y -X degree = (360 - degree); } return degree; } +/** + * Calculate the integer exponents. + * @param base + * @param power + * @return base raised to the power exponent + */ int64_t lv_pow(int64_t base, int8_t exp) { int64_t result = 1; @@ -401,6 +224,15 @@ int64_t lv_pow(int64_t base, int8_t exp) return result; } +/** + * Get the mapped of a number given an input and output range + * @param x integer which mapped value should be calculated + * @param min_in min input range + * @param max_in max input range + * @param min_out max output range + * @param max_out max output range + * @return the mapped number + */ int32_t lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min_out, int32_t max_out) { if(max_in >= min_in && x >= max_in) return max_out; @@ -422,33 +254,18 @@ int32_t lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min_out, int32 return ((x - min_in) * delta_out) / delta_in + min_out; } -void lv_rand_set_seed(uint32_t seed) -{ - rand_seed = seed; -} - uint32_t lv_rand(uint32_t min, uint32_t max) { + static uint32_t a = 0x1234ABCD; /*Seed*/ + /*Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs"*/ - uint32_t x = rand_seed; + uint32_t x = a; x ^= x << 13; x ^= x >> 17; x ^= x << 5; - rand_seed = x; - - return (rand_seed % (max - min + 1)) + min; -} + a = x; -int32_t LV_ATTRIBUTE_FAST_MEM lv_trigo_cos(int16_t angle) -{ - return lv_trigo_sin(angle + 90); -} - -int32_t lv_bezier3(int32_t t, int32_t u0, uint32_t u1, int32_t u2, int32_t u3) -{ - LV_UNUSED(u0); - LV_UNUSED(u3); - return lv_cubic_bezier(t, 341, u1, 683, u2); + return (a % (max - min + 1)) + min; } /********************** diff --git a/L3_Middlewares/LVGL/src/misc/lv_math.h b/L3_Middlewares/LVGL/src/misc/lv_math.h index 05e159f..771b4aa 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_math.h +++ b/L3_Middlewares/LVGL/src/misc/lv_math.h @@ -1,4 +1,4 @@ -/** +/** * @file lv_math.h * */ @@ -14,23 +14,16 @@ extern "C" { * INCLUDES *********************/ #include "../lv_conf_internal.h" -#include "lv_types.h" +#include /********************* * DEFINES *********************/ -#define LV_TRIGO_SIN_MAX 32768 +#define LV_TRIGO_SIN_MAX 32767 #define LV_TRIGO_SHIFT 15 /**< >> LV_TRIGO_SHIFT to normalize*/ +#define LV_BEZIER_VAL_MAX 1024 /**< Max time in Bezier functions (not [0..1] to use integers)*/ #define LV_BEZIER_VAL_SHIFT 10 /**< log2(LV_BEZIER_VAL_MAX): used to normalize up scaled values*/ -#define LV_BEZIER_VAL_MAX (1L << LV_BEZIER_VAL_SHIFT) /**< Max time in Bezier functions (not [0..1] to use integers)*/ -#define LV_BEZIER_VAL_FLOAT(f) ((int32_t)((f) * LV_BEZIER_VAL_MAX)) /**< Convert const float number cubic-bezier values to fix-point value*/ - -/** Align up value x to align, align must be a power of two */ -#define LV_ALIGN_UP(x, align) (((x) + ((align) - 1)) & ~((align) - 1)) - -/** Round up value x to round, round can be any integer number */ -#define LV_ROUND_UP(x, round) ((((x) + ((round) - 1)) / (round)) * (round)) /********************** * TYPEDEFS @@ -51,34 +44,25 @@ typedef struct { * @param angle * @return sinus of 'angle'. sin(-90) = -32767, sin(90) = 32767 */ -int32_t /* LV_ATTRIBUTE_FAST_MEM */ lv_trigo_sin(int16_t angle); +int16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_trigo_sin(int16_t angle); -int32_t LV_ATTRIBUTE_FAST_MEM lv_trigo_cos(int16_t angle); +static inline int16_t LV_ATTRIBUTE_FAST_MEM lv_trigo_cos(int16_t angle) +{ + return lv_trigo_sin(angle + 90); +} //! @endcond -/** - * Calculate the y value of cubic-bezier(x1, y1, x2, y2) function as specified x. - * @param x time in range of [0..LV_BEZIER_VAL_MAX] - * @param x1 x of control point 1 in range of [0..LV_BEZIER_VAL_MAX] - * @param y1 y of control point 1 in range of [0..LV_BEZIER_VAL_MAX] - * @param x2 x of control point 2 in range of [0..LV_BEZIER_VAL_MAX] - * @param y2 y of control point 2 in range of [0..LV_BEZIER_VAL_MAX] - * @return the value calculated - */ -int32_t lv_cubic_bezier(int32_t x, int32_t x1, int32_t y1, int32_t x2, int32_t y2); - /** * Calculate a value of a Cubic Bezier function. * @param t time in range of [0..LV_BEZIER_VAL_MAX] - * @param u0 must be 0 + * @param u0 start values in range of [0..LV_BEZIER_VAL_MAX] * @param u1 control value 1 values in range of [0..LV_BEZIER_VAL_MAX] * @param u2 control value 2 in range of [0..LV_BEZIER_VAL_MAX] - * @param u3 must be LV_BEZIER_VAL_MAX + * @param u3 end values in range of [0..LV_BEZIER_VAL_MAX] * @return the value calculated from the given parameters in range of [0..LV_BEZIER_VAL_MAX] */ -int32_t lv_bezier3(int32_t t, int32_t u0, uint32_t u1, int32_t u2, int32_t u3); - +uint32_t lv_bezier3(uint32_t t, uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3); /** * Calculate the atan2 of a vector. @@ -104,26 +88,10 @@ void /* LV_ATTRIBUTE_FAST_MEM */ lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t //! @endcond -/** - * Alternative (fast, approximate) implementation for getting the square root of an integer. - * @param x integer which square root should be calculated - */ -int32_t /* LV_ATTRIBUTE_FAST_MEM */ lv_sqrt32(uint32_t x); - -/** - * Calculate the square of an integer (input range is 0..32767). - * @param x input - * @return square - */ -static inline int32_t lv_sqr(int32_t x) -{ - return x * x; -} - /** * Calculate the integer exponents. * @param base - * @param exp + * @param power * @return base raised to the power exponent */ int64_t lv_pow(int64_t base, int8_t exp); @@ -139,12 +107,6 @@ int64_t lv_pow(int64_t base, int8_t exp); */ int32_t lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min_out, int32_t max_out); -/** - * Set the seed of the pseudo random number generator - * @param seed a number to initialize the random generator - */ -void lv_rand_set_seed(uint32_t seed); - /** * Get a pseudo random number in the given range * @param min the minimum value diff --git a/L3_Middlewares/LVGL/src/misc/lv_matrix.c b/L3_Middlewares/LVGL/src/misc/lv_matrix.c deleted file mode 100644 index 4a6bb63..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_matrix.c +++ /dev/null @@ -1,225 +0,0 @@ -/** - * @file lv_matrix.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_matrix.h" - -#if LV_USE_MATRIX - -#include "../stdlib/lv_string.h" -#include "lv_math.h" -#include -/********************* - * DEFINES - *********************/ -#ifndef M_PI - #define M_PI 3.1415926f -#endif - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_matrix_identity(lv_matrix_t * matrix) -{ - matrix->m[0][0] = 1.0f; - matrix->m[0][1] = 0.0f; - matrix->m[0][2] = 0.0f; - matrix->m[1][0] = 0.0f; - matrix->m[1][1] = 1.0f; - matrix->m[1][2] = 0.0f; - matrix->m[2][0] = 0.0f; - matrix->m[2][1] = 0.0f; - matrix->m[2][2] = 1.0f; -} - -void lv_matrix_translate(lv_matrix_t * matrix, float dx, float dy) -{ - if(lv_matrix_is_identity_or_translation(matrix)) { - /*optimization for matrix translation.*/ - matrix->m[0][2] += dx; - matrix->m[1][2] += dy; - return; - } - - lv_matrix_t tlm = {{ - {1.0f, 0.0f, dx}, - {0.0f, 1.0f, dy}, - {0.0f, 0.0f, 1.0f}, - } - }; - - lv_matrix_multiply(matrix, &tlm); -} - -void lv_matrix_scale(lv_matrix_t * matrix, float scale_x, float scale_y) -{ - lv_matrix_t scm = {{ - {scale_x, 0.0f, 0.0f}, - {0.0f, scale_y, 0.0f}, - {0.0f, 0.0f, 1.0f}, - } - }; - - lv_matrix_multiply(matrix, &scm); -} - -void lv_matrix_rotate(lv_matrix_t * matrix, float degree) -{ - float radian = degree / 180.0f * (float)M_PI; - float cos_r = cosf(radian); - float sin_r = sinf(radian); - - lv_matrix_t rtm = {{ - {cos_r, -sin_r, 0.0f}, - {sin_r, cos_r, 0.0f}, - {0.0f, 0.0f, 1.0f}, - } - }; - - lv_matrix_multiply(matrix, &rtm); -} - -void lv_matrix_skew(lv_matrix_t * matrix, float skew_x, float skew_y) -{ - float rskew_x = skew_x / 180.0f * (float)M_PI; - float rskew_y = skew_y / 180.0f * (float)M_PI; - float tan_x = tanf(rskew_x); - float tan_y = tanf(rskew_y); - - lv_matrix_t skm = {{ - {1.0f, tan_x, 0.0f}, - {tan_y, 1.0f, 0.0f}, - {0.0f, 0.0f, 1.0f}, - } - }; - - lv_matrix_multiply(matrix, &skm); -} - -void lv_matrix_multiply(lv_matrix_t * matrix, const lv_matrix_t * mul) -{ - /*TODO: use NEON to optimize this function on ARM architecture.*/ - lv_matrix_t tmp; - - for(int y = 0; y < 3; y++) { - for(int x = 0; x < 3; x++) { - tmp.m[y][x] = (matrix->m[y][0] * mul->m[0][x]) - + (matrix->m[y][1] * mul->m[1][x]) - + (matrix->m[y][2] * mul->m[2][x]); - } - } - - lv_memcpy(matrix, &tmp, sizeof(lv_matrix_t)); -} - -bool lv_matrix_inverse(lv_matrix_t * matrix, const lv_matrix_t * m) -{ - float det00, det01, det02; - float d; - bool is_affine; - - /* Test for identity matrix. */ - if(m == NULL) { - lv_matrix_identity(matrix); - return true; - } - - det00 = (m->m[1][1] * m->m[2][2]) - (m->m[2][1] * m->m[1][2]); - det01 = (m->m[2][0] * m->m[1][2]) - (m->m[1][0] * m->m[2][2]); - det02 = (m->m[1][0] * m->m[2][1]) - (m->m[2][0] * m->m[1][1]); - - /* Compute determinant. */ - d = (m->m[0][0] * det00) + (m->m[0][1] * det01) + (m->m[0][2] * det02); - - /* Return 0 if there is no inverse matrix. */ - if(d == 0.0f) - return false; - - /* Compute reciprocal. */ - d = 1.0f / d; - - /* Determine if the matrix is affine. */ - is_affine = (m->m[2][0] == 0.0f) && (m->m[2][1] == 0.0f) && (m->m[2][2] == 1.0f); - - matrix->m[0][0] = d * det00; - matrix->m[0][1] = d * ((m->m[2][1] * m->m[0][2]) - (m->m[0][1] * m->m[2][2])); - matrix->m[0][2] = d * ((m->m[0][1] * m->m[1][2]) - (m->m[1][1] * m->m[0][2])); - matrix->m[1][0] = d * det01; - matrix->m[1][1] = d * ((m->m[0][0] * m->m[2][2]) - (m->m[2][0] * m->m[0][2])); - matrix->m[1][2] = d * ((m->m[1][0] * m->m[0][2]) - (m->m[0][0] * m->m[1][2])); - matrix->m[2][0] = is_affine ? 0.0f : d * det02; - matrix->m[2][1] = is_affine ? 0.0f : d * ((m->m[2][0] * m->m[0][1]) - (m->m[0][0] * m->m[2][1])); - matrix->m[2][2] = is_affine ? 1.0f : d * ((m->m[0][0] * m->m[1][1]) - (m->m[1][0] * m->m[0][1])); - - /* Success. */ - return true; -} - -lv_point_precise_t lv_matrix_transform_precise_point(const lv_matrix_t * matrix, const lv_point_precise_t * point) -{ - lv_point_precise_t p; - p.x = (lv_value_precise_t)roundf(point->x * matrix->m[0][0] + point->y * matrix->m[0][1] + matrix->m[0][2]); - p.y = (lv_value_precise_t)roundf(point->x * matrix->m[1][0] + point->y * matrix->m[1][1] + matrix->m[1][2]); - return p; -} - -lv_area_t lv_matrix_transform_area(const lv_matrix_t * matrix, const lv_area_t * area) -{ - lv_area_t res; - lv_point_precise_t p[4] = { - {area->x1, area->y1}, - {area->x1, area->y2}, - {area->x2, area->y1}, - {area->x2, area->y2}, - }; - p[0] = lv_matrix_transform_precise_point(matrix, &p[0]); - p[1] = lv_matrix_transform_precise_point(matrix, &p[1]); - p[2] = lv_matrix_transform_precise_point(matrix, &p[2]); - p[3] = lv_matrix_transform_precise_point(matrix, &p[3]); - - res.x1 = (int32_t)(LV_MIN4(p[0].x, p[1].x, p[2].x, p[3].x)); - res.x2 = (int32_t)(LV_MAX4(p[0].x, p[1].x, p[2].x, p[3].x)); - res.y1 = (int32_t)(LV_MIN4(p[0].y, p[1].y, p[2].y, p[3].y)); - res.y2 = (int32_t)(LV_MAX4(p[0].y, p[1].y, p[2].y, p[3].y)); - - return res; -} - -bool lv_matrix_is_identity_or_translation(const lv_matrix_t * matrix) -{ - return (matrix->m[0][0] == 1.0f && - matrix->m[0][1] == 0.0f && - matrix->m[1][0] == 0.0f && - matrix->m[1][1] == 1.0f && - matrix->m[2][0] == 0.0f && - matrix->m[2][1] == 0.0f && - matrix->m[2][2] == 1.0f); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_MATRIX*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_matrix.h b/L3_Middlewares/LVGL/src/misc/lv_matrix.h deleted file mode 100644 index 9583fa9..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_matrix.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @file lv_matrix.h - * - */ - -#ifndef LV_MATRIX_H -#define LV_MATRIX_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../lv_conf_internal.h" - -#if LV_USE_MATRIX - -#include "lv_types.h" -#include "lv_area.h" - -/********************* - * DEFINES - *********************/ - -#if !LV_USE_FLOAT -#error "LV_USE_FLOAT is required for lv_matrix" -#endif - -/********************** - * TYPEDEFS - **********************/ - -struct lv_matrix_t { - float m[3][3]; -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Set matrix to identity matrix - * @param matrix pointer to a matrix - */ -void lv_matrix_identity(lv_matrix_t * matrix); - -/** - * Translate the matrix to new position - * @param matrix pointer to a matrix - * @param tx the amount of translate in x direction - * @param tx the amount of translate in y direction - */ -void lv_matrix_translate(lv_matrix_t * matrix, float tx, float ty); - -/** - * Change the scale factor of the matrix - * @param matrix pointer to a matrix - * @param scale_x the scale factor for the X direction - * @param scale_y the scale factor for the Y direction - */ -void lv_matrix_scale(lv_matrix_t * matrix, float scale_x, float scale_y); - -/** - * Rotate the matrix with origin - * @param matrix pointer to a matrix - * @param degree angle to rotate - */ -void lv_matrix_rotate(lv_matrix_t * matrix, float degree); - -/** - * Change the skew factor of the matrix - * @param matrix pointer to a matrix - * @param skew_x the skew factor for x direction - * @param skew_y the skew factor for y direction - */ -void lv_matrix_skew(lv_matrix_t * matrix, float skew_x, float skew_y); - -/** - * Multiply two matrix and store the result to the first one - * @param matrix pointer to a matrix - * @param matrix2 pointer to another matrix - */ -void lv_matrix_multiply(lv_matrix_t * matrix, const lv_matrix_t * mul); - -/** - * Invert the matrix - * @param matrix pointer to a matrix - * @param m pointer to another matrix (optional) - * @return true: the matrix is invertible, false: the matrix is singular and cannot be inverted - */ -bool lv_matrix_inverse(lv_matrix_t * matrix, const lv_matrix_t * m); - -/** - * Transform a point by a matrix - * @param matrix pointer to a matrix - * @param point pointer to a point - * @return the transformed point - */ -lv_point_precise_t lv_matrix_transform_precise_point(const lv_matrix_t * matrix, const lv_point_precise_t * point); - -/** - * Transform an area by a matrix - * @param matrix pointer to a matrix - * @param area pointer to an area - * @return the transformed area - */ -lv_area_t lv_matrix_transform_area(const lv_matrix_t * matrix, const lv_area_t * area); - -/** - * Check if the matrix is identity or translation matrix - * @param matrix pointer to a matrix - * @return true: the matrix is identity or translation matrix, false: the matrix is not identity or translation matrix - */ -bool lv_matrix_is_identity_or_translation(const lv_matrix_t * matrix); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_MATRIX*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_MATRIX_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_mem.c b/L3_Middlewares/LVGL/src/misc/lv_mem.c new file mode 100644 index 0000000..25f24c9 --- /dev/null +++ b/L3_Middlewares/LVGL/src/misc/lv_mem.c @@ -0,0 +1,566 @@ +/** + * @file lv_mem.c + * General and portable implementation of malloc and free. + * The dynamic memory monitoring is also supported. + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_mem.h" +#include "lv_tlsf.h" +#include "lv_gc.h" +#include "lv_assert.h" +#include "lv_log.h" + +#if LV_MEM_CUSTOM != 0 + #include LV_MEM_CUSTOM_INCLUDE +#endif + +#ifdef LV_MEM_POOL_INCLUDE + #include LV_MEM_POOL_INCLUDE +#endif + +/********************* + * DEFINES + *********************/ +/*memset the allocated memories to 0xaa and freed memories to 0xbb (just for testing purposes)*/ +#ifndef LV_MEM_ADD_JUNK + #define LV_MEM_ADD_JUNK 0 +#endif + +#ifdef LV_ARCH_64 + #define MEM_UNIT uint64_t + #define ALIGN_MASK 0x7 +#else + #define MEM_UNIT uint32_t + #define ALIGN_MASK 0x3 +#endif + +#define ZERO_MEM_SENTINEL 0xa1b2c3d4 + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +#if LV_MEM_CUSTOM == 0 + static void lv_mem_walker(void * ptr, size_t size, int used, void * user); +#endif + +/********************** + * STATIC VARIABLES + **********************/ +#if LV_MEM_CUSTOM == 0 + static lv_tlsf_t tlsf; + static uint32_t cur_used; + static uint32_t max_used; +#endif + +static uint32_t zero_mem = ZERO_MEM_SENTINEL; /*Give the address of this variable if 0 byte should be allocated*/ + +/********************** + * MACROS + **********************/ +#if LV_LOG_TRACE_MEM + #define MEM_TRACE(...) LV_LOG_TRACE(__VA_ARGS__) +#else + #define MEM_TRACE(...) +#endif + +#define COPY32 *d32 = *s32; d32++; s32++; +#define COPY8 *d8 = *s8; d8++; s8++; +#define SET32(x) *d32 = x; d32++; +#define SET8(x) *d8 = x; d8++; +#define REPEAT8(expr) expr expr expr expr expr expr expr expr + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Initialize the dyn_mem module (work memory and other variables) + */ +void lv_mem_init(void) +{ +#if LV_MEM_CUSTOM == 0 + +#if LV_MEM_ADR == 0 +#ifdef LV_MEM_POOL_ALLOC + tlsf = lv_tlsf_create_with_pool((void *)LV_MEM_POOL_ALLOC(LV_MEM_SIZE), LV_MEM_SIZE); +#else + /*Allocate a large array to store the dynamically allocated data*/ + static LV_ATTRIBUTE_LARGE_RAM_ARRAY MEM_UNIT work_mem_int[LV_MEM_SIZE / sizeof(MEM_UNIT)]; + tlsf = lv_tlsf_create_with_pool((void *)work_mem_int, LV_MEM_SIZE); +#endif +#else + tlsf = lv_tlsf_create_with_pool((void *)LV_MEM_ADR, LV_MEM_SIZE); +#endif +#endif + +#if LV_MEM_ADD_JUNK + LV_LOG_WARN("LV_MEM_ADD_JUNK is enabled which makes LVGL much slower"); +#endif +} + +/** + * Clean up the memory buffer which frees all the allocated memories. + * @note It work only if `LV_MEM_CUSTOM == 0` + */ +void lv_mem_deinit(void) +{ +#if LV_MEM_CUSTOM == 0 + lv_tlsf_destroy(tlsf); + lv_mem_init(); +#endif +} + +/** + * Allocate a memory dynamically + * @param size size of the memory to allocate in bytes + * @return pointer to the allocated memory + */ +void * lv_mem_alloc(size_t size) +{ + MEM_TRACE("allocating %lu bytes", (unsigned long)size); + if(size == 0) { + MEM_TRACE("using zero_mem"); + return &zero_mem; + } + +#if LV_MEM_CUSTOM == 0 + void * alloc = lv_tlsf_malloc(tlsf, size); +#else + void * alloc = LV_MEM_CUSTOM_ALLOC(size); +#endif + + if(alloc == NULL) { + LV_LOG_INFO("couldn't allocate memory (%lu bytes)", (unsigned long)size); +#if LV_LOG_LEVEL <= LV_LOG_LEVEL_INFO + lv_mem_monitor_t mon; + lv_mem_monitor(&mon); + LV_LOG_INFO("used: %6d (%3d %%), frag: %3d %%, biggest free: %6d", + (int)(mon.total_size - mon.free_size), mon.used_pct, mon.frag_pct, + (int)mon.free_biggest_size); +#endif + } +#if LV_MEM_ADD_JUNK + else { + lv_memset(alloc, 0xaa, size); + } +#endif + + if(alloc) { +#if LV_MEM_CUSTOM == 0 + cur_used += size; + max_used = LV_MAX(cur_used, max_used); +#endif + MEM_TRACE("allocated at %p", alloc); + } + return alloc; +} + +/** + * Free an allocated data + * @param data pointer to an allocated memory + */ +void lv_mem_free(void * data) +{ + MEM_TRACE("freeing %p", data); + if(data == &zero_mem) return; + if(data == NULL) return; + +#if LV_MEM_CUSTOM == 0 +# if LV_MEM_ADD_JUNK + lv_memset(data, 0xbb, lv_tlsf_block_size(data)); +# endif + size_t size = lv_tlsf_free(tlsf, data); + if(cur_used > size) cur_used -= size; + else cur_used = 0; +#else + LV_MEM_CUSTOM_FREE(data); +#endif +} + +/** + * Reallocate a memory with a new size. The old content will be kept. + * @param data pointer to an allocated memory. + * Its content will be copied to the new memory block and freed + * @param new_size the desired new size in byte + * @return pointer to the new memory + */ +void * lv_mem_realloc(void * data_p, size_t new_size) +{ + MEM_TRACE("reallocating %p with %lu size", data_p, (unsigned long)new_size); + if(new_size == 0) { + MEM_TRACE("using zero_mem"); + lv_mem_free(data_p); + return &zero_mem; + } + + if(data_p == &zero_mem) return lv_mem_alloc(new_size); + +#if LV_MEM_CUSTOM == 0 + void * new_p = lv_tlsf_realloc(tlsf, data_p, new_size); +#else + void * new_p = LV_MEM_CUSTOM_REALLOC(data_p, new_size); +#endif + if(new_p == NULL) { + LV_LOG_ERROR("couldn't allocate memory"); + return NULL; + } + + MEM_TRACE("allocated at %p", new_p); + return new_p; +} + +lv_res_t lv_mem_test(void) +{ + if(zero_mem != ZERO_MEM_SENTINEL) { + LV_LOG_WARN("zero_mem is written"); + return LV_RES_INV; + } + +#if LV_MEM_CUSTOM == 0 + if(lv_tlsf_check(tlsf)) { + LV_LOG_WARN("failed"); + return LV_RES_INV; + } + + if(lv_tlsf_check_pool(lv_tlsf_get_pool(tlsf))) { + LV_LOG_WARN("pool failed"); + return LV_RES_INV; + } +#endif + MEM_TRACE("passed"); + return LV_RES_OK; +} + +/** + * Give information about the work memory of dynamic allocation + * @param mon_p pointer to a lv_mem_monitor_t variable, + * the result of the analysis will be stored here + */ +void lv_mem_monitor(lv_mem_monitor_t * mon_p) +{ + /*Init the data*/ + lv_memset(mon_p, 0, sizeof(lv_mem_monitor_t)); +#if LV_MEM_CUSTOM == 0 + MEM_TRACE("begin"); + + lv_tlsf_walk_pool(lv_tlsf_get_pool(tlsf), lv_mem_walker, mon_p); + + mon_p->total_size = LV_MEM_SIZE; + mon_p->used_pct = 100 - (100U * mon_p->free_size) / mon_p->total_size; + if(mon_p->free_size > 0) { + mon_p->frag_pct = mon_p->free_biggest_size * 100U / mon_p->free_size; + mon_p->frag_pct = 100 - mon_p->frag_pct; + } + else { + mon_p->frag_pct = 0; /*no fragmentation if all the RAM is used*/ + } + + mon_p->max_used = max_used; + + MEM_TRACE("finished"); +#endif +} + + +/** + * Get a temporal buffer with the given size. + * @param size the required size + */ +void * lv_mem_buf_get(uint32_t size) +{ + if(size == 0) return NULL; + + MEM_TRACE("begin, getting %d bytes", size); + + /*Try to find a free buffer with suitable size*/ + int8_t i_guess = -1; + for(uint8_t i = 0; i < LV_MEM_BUF_MAX_NUM; i++) { + if(LV_GC_ROOT(lv_mem_buf[i]).used == 0 && LV_GC_ROOT(lv_mem_buf[i]).size >= size) { + if(LV_GC_ROOT(lv_mem_buf[i]).size == size) { + LV_GC_ROOT(lv_mem_buf[i]).used = 1; + return LV_GC_ROOT(lv_mem_buf[i]).p; + } + else if(i_guess < 0) { + i_guess = i; + } + /*If size of `i` is closer to `size` prefer it*/ + else if(LV_GC_ROOT(lv_mem_buf[i]).size < LV_GC_ROOT(lv_mem_buf[i_guess]).size) { + i_guess = i; + } + } + } + + if(i_guess >= 0) { + LV_GC_ROOT(lv_mem_buf[i_guess]).used = 1; + MEM_TRACE("returning already allocated buffer (buffer id: %d, address: %p)", i_guess, + LV_GC_ROOT(lv_mem_buf[i_guess]).p); + return LV_GC_ROOT(lv_mem_buf[i_guess]).p; + } + + /*Reallocate a free buffer*/ + for(uint8_t i = 0; i < LV_MEM_BUF_MAX_NUM; i++) { + if(LV_GC_ROOT(lv_mem_buf[i]).used == 0) { + /*if this fails you probably need to increase your LV_MEM_SIZE/heap size*/ + void * buf = lv_mem_realloc(LV_GC_ROOT(lv_mem_buf[i]).p, size); + LV_ASSERT_MSG(buf != NULL, "Out of memory, can't allocate a new buffer (increase your LV_MEM_SIZE/heap size)"); + if(buf == NULL) return NULL; + + LV_GC_ROOT(lv_mem_buf[i]).used = 1; + LV_GC_ROOT(lv_mem_buf[i]).size = size; + LV_GC_ROOT(lv_mem_buf[i]).p = buf; + MEM_TRACE("allocated (buffer id: %d, address: %p)", i, LV_GC_ROOT(lv_mem_buf[i]).p); + return LV_GC_ROOT(lv_mem_buf[i]).p; + } + } + + LV_LOG_ERROR("no more buffers. (increase LV_MEM_BUF_MAX_NUM)"); + LV_ASSERT_MSG(false, "No more buffers. Increase LV_MEM_BUF_MAX_NUM."); + return NULL; +} + +/** + * Release a memory buffer + * @param p buffer to release + */ +void lv_mem_buf_release(void * p) +{ + MEM_TRACE("begin (address: %p)", p); + + for(uint8_t i = 0; i < LV_MEM_BUF_MAX_NUM; i++) { + if(LV_GC_ROOT(lv_mem_buf[i]).p == p) { + LV_GC_ROOT(lv_mem_buf[i]).used = 0; + return; + } + } + + LV_LOG_ERROR("p is not a known buffer"); +} + +/** + * Free all memory buffers + */ +void lv_mem_buf_free_all(void) +{ + for(uint8_t i = 0; i < LV_MEM_BUF_MAX_NUM; i++) { + if(LV_GC_ROOT(lv_mem_buf[i]).p) { + lv_mem_free(LV_GC_ROOT(lv_mem_buf[i]).p); + LV_GC_ROOT(lv_mem_buf[i]).p = NULL; + LV_GC_ROOT(lv_mem_buf[i]).used = 0; + LV_GC_ROOT(lv_mem_buf[i]).size = 0; + } + } +} + +#if LV_MEMCPY_MEMSET_STD == 0 +/** + * Same as `memcpy` but optimized for 4 byte operation. + * @param dst pointer to the destination buffer + * @param src pointer to the source buffer + * @param len number of byte to copy + */ +void * LV_ATTRIBUTE_FAST_MEM lv_memcpy(void * dst, const void * src, size_t len) +{ + uint8_t * d8 = dst; + const uint8_t * s8 = src; + + lv_uintptr_t d_align = (lv_uintptr_t)d8 & ALIGN_MASK; + lv_uintptr_t s_align = (lv_uintptr_t)s8 & ALIGN_MASK; + + /*Byte copy for unaligned memories*/ + if(s_align != d_align) { + while(len > 32) { + REPEAT8(COPY8); + REPEAT8(COPY8); + REPEAT8(COPY8); + REPEAT8(COPY8); + len -= 32; + } + while(len) { + COPY8 + len--; + } + return dst; + } + + /*Make the memories aligned*/ + if(d_align) { + d_align = ALIGN_MASK + 1 - d_align; + while(d_align && len) { + COPY8; + d_align--; + len--; + } + } + + uint32_t * d32 = (uint32_t *)d8; + const uint32_t * s32 = (uint32_t *)s8; + while(len > 32) { + REPEAT8(COPY32) + len -= 32; + } + + while(len > 4) { + COPY32; + len -= 4; + } + + d8 = (uint8_t *)d32; + s8 = (const uint8_t *)s32; + while(len) { + COPY8 + len--; + } + + return dst; +} + +/** + * Same as `memset` but optimized for 4 byte operation. + * @param dst pointer to the destination buffer + * @param v value to set [0..255] + * @param len number of byte to set + */ +void LV_ATTRIBUTE_FAST_MEM lv_memset(void * dst, uint8_t v, size_t len) +{ + + uint8_t * d8 = (uint8_t *)dst; + + uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK; + + /*Make the address aligned*/ + if(d_align) { + d_align = ALIGN_MASK + 1 - d_align; + while(d_align && len) { + SET8(v); + len--; + d_align--; + } + } + + uint32_t v32 = (uint32_t)v + ((uint32_t)v << 8) + ((uint32_t)v << 16) + ((uint32_t)v << 24); + + uint32_t * d32 = (uint32_t *)d8; + + while(len > 32) { + REPEAT8(SET32(v32)); + len -= 32; + } + + while(len > 4) { + SET32(v32); + len -= 4; + } + + d8 = (uint8_t *)d32; + while(len) { + SET8(v); + len--; + } +} + +/** + * Same as `memset(dst, 0x00, len)` but optimized for 4 byte operation. + * @param dst pointer to the destination buffer + * @param len number of byte to set + */ +void LV_ATTRIBUTE_FAST_MEM lv_memset_00(void * dst, size_t len) +{ + uint8_t * d8 = (uint8_t *)dst; + uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK; + + /*Make the address aligned*/ + if(d_align) { + d_align = ALIGN_MASK + 1 - d_align; + while(d_align && len) { + SET8(0); + len--; + d_align--; + } + } + + uint32_t * d32 = (uint32_t *)d8; + while(len > 32) { + REPEAT8(SET32(0)); + len -= 32; + } + + while(len > 4) { + SET32(0); + len -= 4; + } + + d8 = (uint8_t *)d32; + while(len) { + SET8(0); + len--; + } +} + +/** + * Same as `memset(dst, 0xFF, len)` but optimized for 4 byte operation. + * @param dst pointer to the destination buffer + * @param len number of byte to set + */ +void LV_ATTRIBUTE_FAST_MEM lv_memset_ff(void * dst, size_t len) +{ + uint8_t * d8 = (uint8_t *)dst; + uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK; + + /*Make the address aligned*/ + if(d_align) { + d_align = ALIGN_MASK + 1 - d_align; + while(d_align && len) { + SET8(0xFF); + len--; + d_align--; + } + } + + uint32_t * d32 = (uint32_t *)d8; + while(len > 32) { + REPEAT8(SET32(0xFFFFFFFF)); + len -= 32; + } + + while(len > 4) { + SET32(0xFFFFFFFF); + len -= 4; + } + + d8 = (uint8_t *)d32; + while(len) { + SET8(0xFF); + len--; + } +} + +#endif /*LV_MEMCPY_MEMSET_STD*/ + +/********************** + * STATIC FUNCTIONS + **********************/ + +#if LV_MEM_CUSTOM == 0 +static void lv_mem_walker(void * ptr, size_t size, int used, void * user) +{ + LV_UNUSED(ptr); + + lv_mem_monitor_t * mon_p = user; + if(used) { + mon_p->used_cnt++; + } + else { + mon_p->free_cnt++; + mon_p->free_size += size; + if(size > mon_p->free_biggest_size) + mon_p->free_biggest_size = size; + } +} +#endif diff --git a/L3_Middlewares/LVGL/src/misc/lv_mem.h b/L3_Middlewares/LVGL/src/misc/lv_mem.h new file mode 100644 index 0000000..9be9425 --- /dev/null +++ b/L3_Middlewares/LVGL/src/misc/lv_mem.h @@ -0,0 +1,243 @@ +/** + * @file lv_mem.h + * + */ + +#ifndef LV_MEM_H +#define LV_MEM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" + +#include +#include +#include + +#include "lv_types.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/** + * Heap information structure. + */ +typedef struct { + uint32_t total_size; /**< Total heap size*/ + uint32_t free_cnt; + uint32_t free_size; /**< Size of available memory*/ + uint32_t free_biggest_size; + uint32_t used_cnt; + uint32_t max_used; /**< Max size of Heap memory used*/ + uint8_t used_pct; /**< Percentage used*/ + uint8_t frag_pct; /**< Amount of fragmentation*/ +} lv_mem_monitor_t; + +typedef struct { + void * p; + uint16_t size; + uint8_t used : 1; +} lv_mem_buf_t; + +typedef lv_mem_buf_t lv_mem_buf_arr_t[LV_MEM_BUF_MAX_NUM]; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Initialize the dyn_mem module (work memory and other variables) + */ +void lv_mem_init(void); + +/** + * Clean up the memory buffer which frees all the allocated memories. + * @note It work only if `LV_MEM_CUSTOM == 0` + */ +void lv_mem_deinit(void); + +/** + * Allocate a memory dynamically + * @param size size of the memory to allocate in bytes + * @return pointer to the allocated memory + */ +void * lv_mem_alloc(size_t size); + +/** + * Free an allocated data + * @param data pointer to an allocated memory + */ +void lv_mem_free(void * data); + +/** + * Reallocate a memory with a new size. The old content will be kept. + * @param data pointer to an allocated memory. + * Its content will be copied to the new memory block and freed + * @param new_size the desired new size in byte + * @return pointer to the new memory, NULL on failure + */ +void * lv_mem_realloc(void * data_p, size_t new_size); + +/** + * + * @return + */ +lv_res_t lv_mem_test(void); + +/** + * Give information about the work memory of dynamic allocation + * @param mon_p pointer to a lv_mem_monitor_t variable, + * the result of the analysis will be stored here + */ +void lv_mem_monitor(lv_mem_monitor_t * mon_p); + + +/** + * Get a temporal buffer with the given size. + * @param size the required size + */ +void * lv_mem_buf_get(uint32_t size); + +/** + * Release a memory buffer + * @param p buffer to release + */ +void lv_mem_buf_release(void * p); + +/** + * Free all memory buffers + */ +void lv_mem_buf_free_all(void); + +//! @cond Doxygen_Suppress + +#if LV_MEMCPY_MEMSET_STD + +/** + * Wrapper for the standard memcpy + * @param dst pointer to the destination buffer + * @param src pointer to the source buffer + * @param len number of byte to copy + */ +static inline void * lv_memcpy(void * dst, const void * src, size_t len) +{ + return memcpy(dst, src, len); +} + +/** + * Wrapper for the standard memcpy + * @param dst pointer to the destination buffer + * @param src pointer to the source buffer + * @param len number of byte to copy + */ +static inline void * lv_memcpy_small(void * dst, const void * src, size_t len) +{ + return memcpy(dst, src, len); +} + +/** + * Wrapper for the standard memset + * @param dst pointer to the destination buffer + * @param v value to set [0..255] + * @param len number of byte to set + */ +static inline void lv_memset(void * dst, uint8_t v, size_t len) +{ + memset(dst, v, len); +} + +/** + * Wrapper for the standard memset with fixed 0x00 value + * @param dst pointer to the destination buffer + * @param len number of byte to set + */ +static inline void lv_memset_00(void * dst, size_t len) +{ + memset(dst, 0x00, len); +} + +/** + * Wrapper for the standard memset with fixed 0xFF value + * @param dst pointer to the destination buffer + * @param len number of byte to set + */ +static inline void lv_memset_ff(void * dst, size_t len) +{ + memset(dst, 0xFF, len); +} + +#else +/** + * Same as `memcpy` but optimized for 4 byte operation. + * @param dst pointer to the destination buffer + * @param src pointer to the source buffer + * @param len number of byte to copy + */ +void * /* LV_ATTRIBUTE_FAST_MEM */ lv_memcpy(void * dst, const void * src, size_t len); + +/** + * Same as `memcpy` but optimized to copy only a few bytes. + * @param dst pointer to the destination buffer + * @param src pointer to the source buffer + * @param len number of byte to copy + */ +static inline void * LV_ATTRIBUTE_FAST_MEM lv_memcpy_small(void * dst, const void * src, size_t len) +{ + uint8_t * d8 = (uint8_t *)dst; + const uint8_t * s8 = (const uint8_t *)src; + + while(len) { + *d8 = *s8; + d8++; + s8++; + len--; + } + + return dst; +} + +/** + * Same as `memset` but optimized for 4 byte operation. + * @param dst pointer to the destination buffer + * @param v value to set [0..255] + * @param len number of byte to set + */ +void /* LV_ATTRIBUTE_FAST_MEM */ lv_memset(void * dst, uint8_t v, size_t len); + +/** + * Same as `memset(dst, 0x00, len)` but optimized for 4 byte operation. + * @param dst pointer to the destination buffer + * @param len number of byte to set + */ +void /* LV_ATTRIBUTE_FAST_MEM */ lv_memset_00(void * dst, size_t len); + +/** + * Same as `memset(dst, 0xFF, len)` but optimized for 4 byte operation. + * @param dst pointer to the destination buffer + * @param len number of byte to set + */ +void /* LV_ATTRIBUTE_FAST_MEM */ lv_memset_ff(void * dst, size_t len); + +//! @endcond + +#endif + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_MEM_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_misc.mk b/L3_Middlewares/LVGL/src/misc/lv_misc.mk new file mode 100644 index 0000000..1dfd4ee --- /dev/null +++ b/L3_Middlewares/LVGL/src/misc/lv_misc.mk @@ -0,0 +1,26 @@ +CSRCS += lv_anim.c +CSRCS += lv_anim_timeline.c +CSRCS += lv_area.c +CSRCS += lv_async.c +CSRCS += lv_bidi.c +CSRCS += lv_color.c +CSRCS += lv_fs.c +CSRCS += lv_gc.c +CSRCS += lv_ll.c +CSRCS += lv_log.c +CSRCS += lv_lru.c +CSRCS += lv_math.c +CSRCS += lv_mem.c +CSRCS += lv_printf.c +CSRCS += lv_style.c +CSRCS += lv_style_gen.c +CSRCS += lv_timer.c +CSRCS += lv_tlsf.c +CSRCS += lv_txt.c +CSRCS += lv_txt_ap.c +CSRCS += lv_utils.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/misc" diff --git a/L3_Middlewares/LVGL/src/misc/lv_palette.c b/L3_Middlewares/LVGL/src/misc/lv_palette.c deleted file mode 100644 index cbcdf4e..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_palette.c +++ /dev/null @@ -1,130 +0,0 @@ -/** - * @file lv_palette.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_palette.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_color_t lv_palette_main(lv_palette_t p) -{ - static const lv_color_t colors[] = { - LV_COLOR_MAKE(0xF4, 0x43, 0x36), LV_COLOR_MAKE(0xE9, 0x1E, 0x63), LV_COLOR_MAKE(0x9C, 0x27, 0xB0), LV_COLOR_MAKE(0x67, 0x3A, 0xB7), - LV_COLOR_MAKE(0x3F, 0x51, 0xB5), LV_COLOR_MAKE(0x21, 0x96, 0xF3), LV_COLOR_MAKE(0x03, 0xA9, 0xF4), LV_COLOR_MAKE(0x00, 0xBC, 0xD4), - LV_COLOR_MAKE(0x00, 0x96, 0x88), LV_COLOR_MAKE(0x4C, 0xAF, 0x50), LV_COLOR_MAKE(0x8B, 0xC3, 0x4A), LV_COLOR_MAKE(0xCD, 0xDC, 0x39), - LV_COLOR_MAKE(0xFF, 0xEB, 0x3B), LV_COLOR_MAKE(0xFF, 0xC1, 0x07), LV_COLOR_MAKE(0xFF, 0x98, 0x00), LV_COLOR_MAKE(0xFF, 0x57, 0x22), - LV_COLOR_MAKE(0x79, 0x55, 0x48), LV_COLOR_MAKE(0x60, 0x7D, 0x8B), LV_COLOR_MAKE(0x9E, 0x9E, 0x9E) - }; - - if(p >= LV_PALETTE_LAST) { - LV_LOG_WARN("Invalid palette: %d", p); - return lv_color_black(); - } - - return colors[p]; - -} - -lv_color_t lv_palette_lighten(lv_palette_t p, uint8_t lvl) -{ - static const lv_color_t colors[][5] = { - {LV_COLOR_MAKE(0xEF, 0x53, 0x50), LV_COLOR_MAKE(0xE5, 0x73, 0x73), LV_COLOR_MAKE(0xEF, 0x9A, 0x9A), LV_COLOR_MAKE(0xFF, 0xCD, 0xD2), LV_COLOR_MAKE(0xFF, 0xEB, 0xEE)}, - {LV_COLOR_MAKE(0xEC, 0x40, 0x7A), LV_COLOR_MAKE(0xF0, 0x62, 0x92), LV_COLOR_MAKE(0xF4, 0x8F, 0xB1), LV_COLOR_MAKE(0xF8, 0xBB, 0xD0), LV_COLOR_MAKE(0xFC, 0xE4, 0xEC)}, - {LV_COLOR_MAKE(0xAB, 0x47, 0xBC), LV_COLOR_MAKE(0xBA, 0x68, 0xC8), LV_COLOR_MAKE(0xCE, 0x93, 0xD8), LV_COLOR_MAKE(0xE1, 0xBE, 0xE7), LV_COLOR_MAKE(0xF3, 0xE5, 0xF5)}, - {LV_COLOR_MAKE(0x7E, 0x57, 0xC2), LV_COLOR_MAKE(0x95, 0x75, 0xCD), LV_COLOR_MAKE(0xB3, 0x9D, 0xDB), LV_COLOR_MAKE(0xD1, 0xC4, 0xE9), LV_COLOR_MAKE(0xED, 0xE7, 0xF6)}, - {LV_COLOR_MAKE(0x5C, 0x6B, 0xC0), LV_COLOR_MAKE(0x79, 0x86, 0xCB), LV_COLOR_MAKE(0x9F, 0xA8, 0xDA), LV_COLOR_MAKE(0xC5, 0xCA, 0xE9), LV_COLOR_MAKE(0xE8, 0xEA, 0xF6)}, - {LV_COLOR_MAKE(0x42, 0xA5, 0xF5), LV_COLOR_MAKE(0x64, 0xB5, 0xF6), LV_COLOR_MAKE(0x90, 0xCA, 0xF9), LV_COLOR_MAKE(0xBB, 0xDE, 0xFB), LV_COLOR_MAKE(0xE3, 0xF2, 0xFD)}, - {LV_COLOR_MAKE(0x29, 0xB6, 0xF6), LV_COLOR_MAKE(0x4F, 0xC3, 0xF7), LV_COLOR_MAKE(0x81, 0xD4, 0xFA), LV_COLOR_MAKE(0xB3, 0xE5, 0xFC), LV_COLOR_MAKE(0xE1, 0xF5, 0xFE)}, - {LV_COLOR_MAKE(0x26, 0xC6, 0xDA), LV_COLOR_MAKE(0x4D, 0xD0, 0xE1), LV_COLOR_MAKE(0x80, 0xDE, 0xEA), LV_COLOR_MAKE(0xB2, 0xEB, 0xF2), LV_COLOR_MAKE(0xE0, 0xF7, 0xFA)}, - {LV_COLOR_MAKE(0x26, 0xA6, 0x9A), LV_COLOR_MAKE(0x4D, 0xB6, 0xAC), LV_COLOR_MAKE(0x80, 0xCB, 0xC4), LV_COLOR_MAKE(0xB2, 0xDF, 0xDB), LV_COLOR_MAKE(0xE0, 0xF2, 0xF1)}, - {LV_COLOR_MAKE(0x66, 0xBB, 0x6A), LV_COLOR_MAKE(0x81, 0xC7, 0x84), LV_COLOR_MAKE(0xA5, 0xD6, 0xA7), LV_COLOR_MAKE(0xC8, 0xE6, 0xC9), LV_COLOR_MAKE(0xE8, 0xF5, 0xE9)}, - {LV_COLOR_MAKE(0x9C, 0xCC, 0x65), LV_COLOR_MAKE(0xAE, 0xD5, 0x81), LV_COLOR_MAKE(0xC5, 0xE1, 0xA5), LV_COLOR_MAKE(0xDC, 0xED, 0xC8), LV_COLOR_MAKE(0xF1, 0xF8, 0xE9)}, - {LV_COLOR_MAKE(0xD4, 0xE1, 0x57), LV_COLOR_MAKE(0xDC, 0xE7, 0x75), LV_COLOR_MAKE(0xE6, 0xEE, 0x9C), LV_COLOR_MAKE(0xF0, 0xF4, 0xC3), LV_COLOR_MAKE(0xF9, 0xFB, 0xE7)}, - {LV_COLOR_MAKE(0xFF, 0xEE, 0x58), LV_COLOR_MAKE(0xFF, 0xF1, 0x76), LV_COLOR_MAKE(0xFF, 0xF5, 0x9D), LV_COLOR_MAKE(0xFF, 0xF9, 0xC4), LV_COLOR_MAKE(0xFF, 0xFD, 0xE7)}, - {LV_COLOR_MAKE(0xFF, 0xCA, 0x28), LV_COLOR_MAKE(0xFF, 0xD5, 0x4F), LV_COLOR_MAKE(0xFF, 0xE0, 0x82), LV_COLOR_MAKE(0xFF, 0xEC, 0xB3), LV_COLOR_MAKE(0xFF, 0xF8, 0xE1)}, - {LV_COLOR_MAKE(0xFF, 0xA7, 0x26), LV_COLOR_MAKE(0xFF, 0xB7, 0x4D), LV_COLOR_MAKE(0xFF, 0xCC, 0x80), LV_COLOR_MAKE(0xFF, 0xE0, 0xB2), LV_COLOR_MAKE(0xFF, 0xF3, 0xE0)}, - {LV_COLOR_MAKE(0xFF, 0x70, 0x43), LV_COLOR_MAKE(0xFF, 0x8A, 0x65), LV_COLOR_MAKE(0xFF, 0xAB, 0x91), LV_COLOR_MAKE(0xFF, 0xCC, 0xBC), LV_COLOR_MAKE(0xFB, 0xE9, 0xE7)}, - {LV_COLOR_MAKE(0x8D, 0x6E, 0x63), LV_COLOR_MAKE(0xA1, 0x88, 0x7F), LV_COLOR_MAKE(0xBC, 0xAA, 0xA4), LV_COLOR_MAKE(0xD7, 0xCC, 0xC8), LV_COLOR_MAKE(0xEF, 0xEB, 0xE9)}, - {LV_COLOR_MAKE(0x78, 0x90, 0x9C), LV_COLOR_MAKE(0x90, 0xA4, 0xAE), LV_COLOR_MAKE(0xB0, 0xBE, 0xC5), LV_COLOR_MAKE(0xCF, 0xD8, 0xDC), LV_COLOR_MAKE(0xEC, 0xEF, 0xF1)}, - {LV_COLOR_MAKE(0xBD, 0xBD, 0xBD), LV_COLOR_MAKE(0xE0, 0xE0, 0xE0), LV_COLOR_MAKE(0xEE, 0xEE, 0xEE), LV_COLOR_MAKE(0xF5, 0xF5, 0xF5), LV_COLOR_MAKE(0xFA, 0xFA, 0xFA)}, - }; - - if(p >= LV_PALETTE_LAST) { - LV_LOG_WARN("Invalid palette: %d", p); - return lv_color_black(); - } - - if(lvl == 0 || lvl > 5) { - LV_LOG_WARN("Invalid level: %d. Must be 1..5", lvl); - return lv_color_black(); - } - - lvl--; - - return colors[p][lvl]; -} - -lv_color_t lv_palette_darken(lv_palette_t p, uint8_t lvl) -{ - static const lv_color_t colors[][4] = { - {LV_COLOR_MAKE(0xE5, 0x39, 0x35), LV_COLOR_MAKE(0xD3, 0x2F, 0x2F), LV_COLOR_MAKE(0xC6, 0x28, 0x28), LV_COLOR_MAKE(0xB7, 0x1C, 0x1C)}, - {LV_COLOR_MAKE(0xD8, 0x1B, 0x60), LV_COLOR_MAKE(0xC2, 0x18, 0x5B), LV_COLOR_MAKE(0xAD, 0x14, 0x57), LV_COLOR_MAKE(0x88, 0x0E, 0x4F)}, - {LV_COLOR_MAKE(0x8E, 0x24, 0xAA), LV_COLOR_MAKE(0x7B, 0x1F, 0xA2), LV_COLOR_MAKE(0x6A, 0x1B, 0x9A), LV_COLOR_MAKE(0x4A, 0x14, 0x8C)}, - {LV_COLOR_MAKE(0x5E, 0x35, 0xB1), LV_COLOR_MAKE(0x51, 0x2D, 0xA8), LV_COLOR_MAKE(0x45, 0x27, 0xA0), LV_COLOR_MAKE(0x31, 0x1B, 0x92)}, - {LV_COLOR_MAKE(0x39, 0x49, 0xAB), LV_COLOR_MAKE(0x30, 0x3F, 0x9F), LV_COLOR_MAKE(0x28, 0x35, 0x93), LV_COLOR_MAKE(0x1A, 0x23, 0x7E)}, - {LV_COLOR_MAKE(0x1E, 0x88, 0xE5), LV_COLOR_MAKE(0x19, 0x76, 0xD2), LV_COLOR_MAKE(0x15, 0x65, 0xC0), LV_COLOR_MAKE(0x0D, 0x47, 0xA1)}, - {LV_COLOR_MAKE(0x03, 0x9B, 0xE5), LV_COLOR_MAKE(0x02, 0x88, 0xD1), LV_COLOR_MAKE(0x02, 0x77, 0xBD), LV_COLOR_MAKE(0x01, 0x57, 0x9B)}, - {LV_COLOR_MAKE(0x00, 0xAC, 0xC1), LV_COLOR_MAKE(0x00, 0x97, 0xA7), LV_COLOR_MAKE(0x00, 0x83, 0x8F), LV_COLOR_MAKE(0x00, 0x60, 0x64)}, - {LV_COLOR_MAKE(0x00, 0x89, 0x7B), LV_COLOR_MAKE(0x00, 0x79, 0x6B), LV_COLOR_MAKE(0x00, 0x69, 0x5C), LV_COLOR_MAKE(0x00, 0x4D, 0x40)}, - {LV_COLOR_MAKE(0x43, 0xA0, 0x47), LV_COLOR_MAKE(0x38, 0x8E, 0x3C), LV_COLOR_MAKE(0x2E, 0x7D, 0x32), LV_COLOR_MAKE(0x1B, 0x5E, 0x20)}, - {LV_COLOR_MAKE(0x7C, 0xB3, 0x42), LV_COLOR_MAKE(0x68, 0x9F, 0x38), LV_COLOR_MAKE(0x55, 0x8B, 0x2F), LV_COLOR_MAKE(0x33, 0x69, 0x1E)}, - {LV_COLOR_MAKE(0xC0, 0xCA, 0x33), LV_COLOR_MAKE(0xAF, 0xB4, 0x2B), LV_COLOR_MAKE(0x9E, 0x9D, 0x24), LV_COLOR_MAKE(0x82, 0x77, 0x17)}, - {LV_COLOR_MAKE(0xFD, 0xD8, 0x35), LV_COLOR_MAKE(0xFB, 0xC0, 0x2D), LV_COLOR_MAKE(0xF9, 0xA8, 0x25), LV_COLOR_MAKE(0xF5, 0x7F, 0x17)}, - {LV_COLOR_MAKE(0xFF, 0xB3, 0x00), LV_COLOR_MAKE(0xFF, 0xA0, 0x00), LV_COLOR_MAKE(0xFF, 0x8F, 0x00), LV_COLOR_MAKE(0xFF, 0x6F, 0x00)}, - {LV_COLOR_MAKE(0xFB, 0x8C, 0x00), LV_COLOR_MAKE(0xF5, 0x7C, 0x00), LV_COLOR_MAKE(0xEF, 0x6C, 0x00), LV_COLOR_MAKE(0xE6, 0x51, 0x00)}, - {LV_COLOR_MAKE(0xF4, 0x51, 0x1E), LV_COLOR_MAKE(0xE6, 0x4A, 0x19), LV_COLOR_MAKE(0xD8, 0x43, 0x15), LV_COLOR_MAKE(0xBF, 0x36, 0x0C)}, - {LV_COLOR_MAKE(0x6D, 0x4C, 0x41), LV_COLOR_MAKE(0x5D, 0x40, 0x37), LV_COLOR_MAKE(0x4E, 0x34, 0x2E), LV_COLOR_MAKE(0x3E, 0x27, 0x23)}, - {LV_COLOR_MAKE(0x54, 0x6E, 0x7A), LV_COLOR_MAKE(0x45, 0x5A, 0x64), LV_COLOR_MAKE(0x37, 0x47, 0x4F), LV_COLOR_MAKE(0x26, 0x32, 0x38)}, - {LV_COLOR_MAKE(0x75, 0x75, 0x75), LV_COLOR_MAKE(0x61, 0x61, 0x61), LV_COLOR_MAKE(0x42, 0x42, 0x42), LV_COLOR_MAKE(0x21, 0x21, 0x21)}, - }; - - if(p >= LV_PALETTE_LAST) { - LV_LOG_WARN("Invalid palette: %d", p); - return lv_color_black(); - } - - if(lvl == 0 || lvl > 4) { - LV_LOG_WARN("Invalid level: %d. Must be 1..4", lvl); - return lv_color_black(); - } - - lvl--; - - return colors[p][lvl]; -} diff --git a/L3_Middlewares/LVGL/src/misc/lv_palette.h b/L3_Middlewares/LVGL/src/misc/lv_palette.h deleted file mode 100644 index d2f408c..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_palette.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file lv_palette.h - * - */ - -#ifndef LV_PALETTE_H -#define LV_PALETTE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_color.h" -#include "lv_types.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef enum { - LV_PALETTE_RED, - LV_PALETTE_PINK, - LV_PALETTE_PURPLE, - LV_PALETTE_DEEP_PURPLE, - LV_PALETTE_INDIGO, - LV_PALETTE_BLUE, - LV_PALETTE_LIGHT_BLUE, - LV_PALETTE_CYAN, - LV_PALETTE_TEAL, - LV_PALETTE_GREEN, - LV_PALETTE_LIGHT_GREEN, - LV_PALETTE_LIME, - LV_PALETTE_YELLOW, - LV_PALETTE_AMBER, - LV_PALETTE_ORANGE, - LV_PALETTE_DEEP_ORANGE, - LV_PALETTE_BROWN, - LV_PALETTE_BLUE_GREY, - LV_PALETTE_GREY, - LV_PALETTE_LAST, - LV_PALETTE_NONE = 0xff, -} lv_palette_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/*Source: https://vuetifyjs.com/en/styles/colors/#material-colors*/ - -lv_color_t lv_palette_main(lv_palette_t p); -lv_color_t lv_palette_lighten(lv_palette_t p, uint8_t lvl); -lv_color_t lv_palette_darken(lv_palette_t p, uint8_t lvl); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_PALETTE_H*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_sprintf_builtin.c b/L3_Middlewares/LVGL/src/misc/lv_printf.c similarity index 97% rename from L3_Middlewares/LVGL/src/stdlib/builtin/lv_sprintf_builtin.c rename to L3_Middlewares/LVGL/src/misc/lv_printf.c index fc34db4..9077a7a 100644 --- a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_sprintf_builtin.c +++ b/L3_Middlewares/LVGL/src/misc/lv_printf.c @@ -32,13 +32,13 @@ /*Original repository: https://github.com/mpaland/printf*/ -#include "../../lv_conf_internal.h" -#if LV_USE_STDLIB_SPRINTF == LV_STDLIB_BUILTIN +#include "lv_printf.h" -#include "../lv_sprintf.h" -#include "../../misc/lv_types.h" +#if LV_SPRINTF_CUSTOM == 0 -#define PRINTF_DISABLE_SUPPORT_FLOAT (!LV_USE_FLOAT) +#include + +#define PRINTF_DISABLE_SUPPORT_FLOAT (!LV_SPRINTF_USE_FLOAT) // 'ntoa' conversion buffer size, this must be big enough to hold one converted // numeric number including padded zeros (dynamically created on stack) @@ -107,11 +107,6 @@ #define FLAGS_PRECISION (1U << 10U) #define FLAGS_ADAPT_EXP (1U << 11U) -typedef struct { - const char * fmt; - va_list * va; -} lv_vaformat_t; - // import float.h for DBL_MAX #if defined(PRINTF_SUPPORT_FLOAT) #include @@ -552,7 +547,7 @@ static size_t _etoa(out_fct_type out, char * buffer, size_t idx, size_t maxlen, #endif // PRINTF_SUPPORT_FLOAT // internal vsnprintf -static int lv_vsnprintf_inner(out_fct_type out, char * buffer, const size_t maxlen, const char * format, va_list va) +static int _vsnprintf(out_fct_type out, char * buffer, const size_t maxlen, const char * format, va_list va) { unsigned int flags, width, precision, n; size_t idx = 0U; @@ -759,7 +754,7 @@ static int lv_vsnprintf_inner(out_fct_type out, char * buffer, const size_t maxl va_list copy; va_copy(copy, *vaf->va); - idx += lv_vsnprintf_inner(out, buffer + idx, maxlen - idx, vaf->fmt, copy); + idx += _vsnprintf(out, buffer + idx, maxlen - idx, vaf->fmt, copy); va_end(copy); } else { @@ -865,22 +860,20 @@ static int lv_vsnprintf_inner(out_fct_type out, char * buffer, const size_t maxl return (int)idx; } -/////////////////////////////////////////////////////////////////////////////// -/// GLOBAL FUNCTIONS FOR LVGL /////////////////////////////////////////////////////////////////////////////// int lv_snprintf(char * buffer, size_t count, const char * format, ...) { va_list va; va_start(va, format); - const int ret = lv_vsnprintf_inner(_out_buffer, buffer, count, format, va); + const int ret = _vsnprintf(_out_buffer, buffer, count, format, va); va_end(va); return ret; } int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va) { - return lv_vsnprintf_inner(_out_buffer, buffer, count, format, va); + return _vsnprintf(_out_buffer, buffer, count, format, va); } -#endif /*LV_STDLIB_BUILTIN*/ +#endif /*LV_SPRINTF_CUSTOM*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_printf.h b/L3_Middlewares/LVGL/src/misc/lv_printf.h new file mode 100644 index 0000000..09563db --- /dev/null +++ b/L3_Middlewares/LVGL/src/misc/lv_printf.h @@ -0,0 +1,98 @@ +/////////////////////////////////////////////////////////////////////////////// +// \author (c) Marco Paland (info@paland.com) +// 2014-2019, PALANDesign Hannover, Germany +// +// \license The MIT License (MIT) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// \brief Tiny printf, sprintf and snprintf implementation, optimized for speed on +// embedded systems with a very limited resources. +// Use this instead of bloated standard/newlib printf. +// These routines are thread safe and reentrant. +// +/////////////////////////////////////////////////////////////////////////////// + +/*Original repository: https://github.com/mpaland/printf*/ + +#ifndef _LV_PRINTF_H_ +#define _LV_PRINTF_H_ + +#if defined(__has_include) + #if __has_include() + #include + /* platform-specific printf format for int32_t, usually "d" or "ld" */ + #define LV_PRId32 PRId32 + #define LV_PRIu32 PRIu32 + #define LV_PRIx32 PRIx32 + #define LV_PRIX32 PRIX32 + #else + #define LV_PRId32 "d" + #define LV_PRIu32 "u" + #define LV_PRIx32 "x" + #define LV_PRIX32 "X" + #endif +#else + /* hope this is correct for ports without __has_include or without inttypes.h */ + #define LV_PRId32 "d" + #define LV_PRIu32 "u" + #define LV_PRIx32 "x" + #define LV_PRIX32 "X" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include "../lv_conf_internal.h" + +#if LV_SPRINTF_CUSTOM == 0 + +#include +#include + +#include "lv_types.h" + +typedef struct { + const char * fmt; + va_list * va; +} lv_vaformat_t; + +/** + * Tiny snprintf/vsnprintf implementation + * \param buffer A pointer to the buffer where to store the formatted string + * \param count The maximum number of characters to store in the buffer, including a terminating null character + * \param format A string that specifies the format of the output + * \param va A value identifying a variable arguments list + * \return The number of characters that COULD have been written into the buffer, not counting the terminating + * null character. A value equal or larger than count indicates truncation. Only when the returned value + * is non-negative and less than count, the string has been completely written. + */ +int lv_snprintf(char * buffer, size_t count, const char * format, ...) LV_FORMAT_ATTRIBUTE(3, 4); +int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va) LV_FORMAT_ATTRIBUTE(3, 0); + +#else +#include LV_SPRINTF_INCLUDE +#endif + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif // _LV_PRINTF_H_ diff --git a/L3_Middlewares/LVGL/src/misc/lv_profiler.h b/L3_Middlewares/LVGL/src/misc/lv_profiler.h deleted file mode 100644 index 47d5bd2..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_profiler.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file lv_profiler.h - * - */ - -#ifndef LV_PROFILER_H -#define LV_PROFILER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../lv_conf_internal.h" - -#if LV_USE_PROFILER - -#include LV_PROFILER_INCLUDE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#else - -#define LV_PROFILER_BEGIN -#define LV_PROFILER_END -#define LV_PROFILER_BEGIN_TAG(tag) LV_UNUSED(tag) -#define LV_PROFILER_END_TAG(tag) LV_UNUSED(tag) - -#endif /*LV_USE_PROFILER*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_PROFILER_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_profiler_builtin.c b/L3_Middlewares/LVGL/src/misc/lv_profiler_builtin.c deleted file mode 100644 index b6b6fd4..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_profiler_builtin.c +++ /dev/null @@ -1,262 +0,0 @@ -/** - * @file lv_profiler_builtin.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_profiler_builtin_private.h" -#include "../lvgl.h" -#include "../core/lv_global.h" - -/********************* - * DEFINES - *********************/ - -#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN - -#define profiler_ctx LV_GLOBAL_DEFAULT()->profiler_context - -#define LV_PROFILER_STR_MAX_LEN 128 -#define LV_PROFILER_TICK_PER_SEC_MAX 1000000 - -#if LV_USE_OS - #define LV_PROFILER_MULTEX_INIT lv_mutex_init(&profiler_ctx->mutex) - #define LV_PROFILER_MULTEX_DEINIT lv_mutex_delete(&profiler_ctx->mutex) - #define LV_PROFILER_MULTEX_LOCK lv_mutex_lock(&profiler_ctx->mutex) - #define LV_PROFILER_MULTEX_UNLOCK lv_mutex_unlock(&profiler_ctx->mutex) -#else - #define LV_PROFILER_MULTEX_INIT - #define LV_PROFILER_MULTEX_DEINIT - #define LV_PROFILER_MULTEX_LOCK - #define LV_PROFILER_MULTEX_UNLOCK -#endif - -/********************** - * TYPEDEFS - **********************/ - -/** - * @brief Structure representing a built-in profiler item in LVGL - */ -typedef struct { - char tag; /**< The tag of the profiler item */ - uint32_t tick; /**< The tick value of the profiler item */ - const char * func; /**< A pointer to the function associated with the profiler item */ -#if LV_USE_OS - int tid; /**< The thread ID of the profiler item */ - int cpu; /**< The CPU ID of the profiler item */ -#endif -} lv_profiler_builtin_item_t; - -/** - * @brief Structure representing a context for the LVGL built-in profiler - */ -typedef struct lv_profiler_builtin_ctx_t { - lv_profiler_builtin_item_t * item_arr; /**< Pointer to an array of profiler items */ - uint32_t item_num; /**< Number of profiler items in the array */ - uint32_t cur_index; /**< Index of the current profiler item */ - lv_profiler_builtin_config_t config; /**< Configuration for the built-in profiler */ - bool enable; /**< Whether the built-in profiler is enabled */ -#if LV_USE_OS - lv_mutex_t mutex; /**< Mutex to protect the built-in profiler */ -#endif -} lv_profiler_builtin_ctx_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void default_flush_cb(const char * buf); -static int default_tid_get_cb(void); -static int default_cpu_get_cb(void); -static void flush_no_lock(void); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_profiler_builtin_config_init(lv_profiler_builtin_config_t * config) -{ - LV_ASSERT_NULL(config); - lv_memzero(config, sizeof(lv_profiler_builtin_config_t)); - config->buf_size = LV_PROFILER_BUILTIN_BUF_SIZE; - config->tick_per_sec = 1000; - config->tick_get_cb = lv_tick_get; - config->flush_cb = default_flush_cb; - config->tid_get_cb = default_tid_get_cb; - config->cpu_get_cb = default_cpu_get_cb; -} - -void lv_profiler_builtin_init(const lv_profiler_builtin_config_t * config) -{ - LV_ASSERT_NULL(config); - LV_ASSERT_NULL(config->tick_get_cb); - - uint32_t num = config->buf_size / sizeof(lv_profiler_builtin_item_t); - if(num == 0) { - LV_LOG_WARN("buf_size must > %d", (int)sizeof(lv_profiler_builtin_item_t)); - return; - } - - if(config->tick_per_sec == 0 || config->tick_per_sec > LV_PROFILER_TICK_PER_SEC_MAX) { - LV_LOG_WARN("tick_per_sec range must be between 1~%d", LV_PROFILER_TICK_PER_SEC_MAX); - return; - } - - /*Free the old item_arr memory*/ - if(profiler_ctx) { - lv_profiler_builtin_uninit(); - } - - profiler_ctx = lv_malloc_zeroed(sizeof(lv_profiler_builtin_ctx_t)); - LV_ASSERT_MALLOC(profiler_ctx); - - profiler_ctx->item_arr = lv_malloc(num * sizeof(lv_profiler_builtin_item_t)); - LV_ASSERT_MALLOC(profiler_ctx->item_arr); - if(profiler_ctx->item_arr == NULL) { - lv_free(profiler_ctx); - profiler_ctx = NULL; - LV_LOG_ERROR("malloc failed for item_arr"); - return; - } - - LV_PROFILER_MULTEX_INIT; - profiler_ctx->item_num = num; - profiler_ctx->config = *config; - - if(profiler_ctx->config.flush_cb) { - /* add profiler header for perfetto */ - profiler_ctx->config.flush_cb("# tracer: nop\n"); - profiler_ctx->config.flush_cb("#\n"); - } - - lv_profiler_builtin_set_enable(true); - - LV_LOG_INFO("init OK, item_num = %d", (int)num); -} - -void lv_profiler_builtin_uninit(void) -{ - LV_ASSERT_NULL(profiler_ctx); - LV_PROFILER_MULTEX_DEINIT; - lv_free(profiler_ctx->item_arr); - lv_free(profiler_ctx); - profiler_ctx = NULL; -} - -void lv_profiler_builtin_set_enable(bool enable) -{ - if(!profiler_ctx) { - return; - } - - profiler_ctx->enable = enable; -} - -void lv_profiler_builtin_flush(void) -{ - LV_ASSERT_NULL(profiler_ctx); - - LV_PROFILER_MULTEX_LOCK; - flush_no_lock(); - LV_PROFILER_MULTEX_UNLOCK; -} - -void lv_profiler_builtin_write(const char * func, char tag) -{ - LV_ASSERT_NULL(profiler_ctx); - LV_ASSERT_NULL(func); - - if(!profiler_ctx->enable) { - return; - } - - LV_PROFILER_MULTEX_LOCK; - - if(profiler_ctx->cur_index >= profiler_ctx->item_num) { - flush_no_lock(); - profiler_ctx->cur_index = 0; - } - - lv_profiler_builtin_item_t * item = &profiler_ctx->item_arr[profiler_ctx->cur_index]; - item->func = func; - item->tag = tag; - item->tick = profiler_ctx->config.tick_get_cb(); - -#if LV_USE_OS - item->tid = profiler_ctx->config.tid_get_cb(); - item->cpu = profiler_ctx->config.cpu_get_cb(); -#endif - - profiler_ctx->cur_index++; - - LV_PROFILER_MULTEX_UNLOCK; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void default_flush_cb(const char * buf) -{ - LV_LOG("%s", buf); -} - -static int default_tid_get_cb(void) -{ - return 1; -} - -static int default_cpu_get_cb(void) -{ - return 0; -} - -static void flush_no_lock(void) -{ - if(!profiler_ctx->config.flush_cb) { - LV_LOG_WARN("flush_cb is not registered"); - return; - } - - uint32_t cur = 0; - char buf[LV_PROFILER_STR_MAX_LEN]; - uint32_t tick_per_sec = profiler_ctx->config.tick_per_sec; - while(cur < profiler_ctx->cur_index) { - lv_profiler_builtin_item_t * item = &profiler_ctx->item_arr[cur++]; - uint32_t sec = item->tick / tick_per_sec; - uint32_t usec = (item->tick % tick_per_sec) * (LV_PROFILER_TICK_PER_SEC_MAX / tick_per_sec); - -#if LV_USE_OS - lv_snprintf(buf, sizeof(buf), - " LVGL-%d [%d] %" LV_PRIu32 ".%06" LV_PRIu32 ": tracing_mark_write: %c|1|%s\n", - item->tid, - item->cpu, - sec, - usec, - item->tag, - item->func); -#else - lv_snprintf(buf, sizeof(buf), - " LVGL-1 [0] %" LV_PRIu32 ".%06" LV_PRIu32 ": tracing_mark_write: %c|1|%s\n", - sec, - usec, - item->tag, - item->func); -#endif - profiler_ctx->config.flush_cb(buf); - } -} - -#endif /*LV_USE_PROFILER_BUILTIN*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_profiler_builtin.h b/L3_Middlewares/LVGL/src/misc/lv_profiler_builtin.h deleted file mode 100644 index aa0220b..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_profiler_builtin.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @file lv_profiler_builtin.h - * - */ - -#ifndef LV_PROFILER_BUILTIN_H -#define LV_PROFILER_BUILTIN_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../lv_conf_internal.h" - -#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN - -#include "lv_types.h" - -/********************* - * DEFINES - *********************/ - -#define LV_PROFILER_BUILTIN_BEGIN_TAG(tag) lv_profiler_builtin_write((tag), 'B') -#define LV_PROFILER_BUILTIN_END_TAG(tag) lv_profiler_builtin_write((tag), 'E') -#define LV_PROFILER_BUILTIN_BEGIN LV_PROFILER_BUILTIN_BEGIN_TAG(__func__) -#define LV_PROFILER_BUILTIN_END LV_PROFILER_BUILTIN_END_TAG(__func__) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * @brief Initialize the configuration of the built-in profiler - * @param config Pointer to the configuration structure of the built-in profiler - */ -void lv_profiler_builtin_config_init(lv_profiler_builtin_config_t * config); - -/** - * @brief Initialize the built-in profiler with the given configuration - * @param config Pointer to the configuration structure of the built-in profiler - */ -void lv_profiler_builtin_init(const lv_profiler_builtin_config_t * config); - -/** - * @brief Uninitialize the built-in profiler - */ -void lv_profiler_builtin_uninit(void); - -/** - * @brief Enable or disable the built-in profiler - * @param enable true to enable the built-in profiler, false to disable - */ -void lv_profiler_builtin_set_enable(bool enable); - -/** - * @brief Flush the profiling data to the console - */ -void lv_profiler_builtin_flush(void); - -/** - * @brief Write the profiling data for a function with the given tag - * @param func Name of the function being profiled - * @param tag Tag to associate with the profiling data for the function - */ -void lv_profiler_builtin_write(const char * func, char tag); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_PROFILER_BUILTIN*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_PROFILER_BUILTIN_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_profiler_builtin_private.h b/L3_Middlewares/LVGL/src/misc/lv_profiler_builtin_private.h deleted file mode 100644 index 3fb9938..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_profiler_builtin_private.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file lv_profiler_builtin_private.h - * - */ - -#ifndef LV_PROFILER_BUILTIN_PRIVATE_H -#define LV_PROFILER_BUILTIN_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_profiler_builtin.h" - -#if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * @brief LVGL profiler built-in configuration structure - */ -struct lv_profiler_builtin_config_t { - size_t buf_size; /**< The size of the buffer used for profiling data */ - uint32_t tick_per_sec; /**< The number of ticks per second */ - uint32_t (*tick_get_cb)(void); /**< Callback function to get the current tick count */ - void (*flush_cb)(const char * buf); /**< Callback function to flush the profiling data */ - int (*tid_get_cb)(void); /**< Callback function to get the current thread ID */ - int (*cpu_get_cb)(void); /**< Callback function to get the current CPU */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_PROFILER_BUILTIN_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_rb.c b/L3_Middlewares/LVGL/src/misc/lv_rb.c deleted file mode 100644 index 8a7328c..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_rb.c +++ /dev/null @@ -1,556 +0,0 @@ -/** - * @file lv_rb.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_rb_private.h" -#include "../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static lv_rb_node_t * rb_create_node(lv_rb_t * tree); -static lv_rb_node_t * rb_find_leaf_parent(lv_rb_t * tree, lv_rb_node_t * node); -static void rb_right_rotate(lv_rb_t * tree, lv_rb_node_t * node); -static void rb_left_rotate(lv_rb_t * tree, lv_rb_node_t * node); -static void rb_insert_color(lv_rb_t * tree, lv_rb_node_t * node); -static void rb_delete_color(lv_rb_t * tree, lv_rb_node_t * node1, lv_rb_node_t * node2); - -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -bool lv_rb_init(lv_rb_t * tree, lv_rb_compare_t compare, size_t node_size) -{ - LV_ASSERT_NULL(tree); - LV_ASSERT_NULL(compare); - LV_ASSERT(node_size > 0); - - if(tree == NULL || compare == NULL || node_size == 0) { - return false; - } - - lv_memzero(tree, sizeof(lv_rb_t)); - - tree->root = NULL; - tree->compare = compare; - tree->size = node_size; - - return true; -} - -lv_rb_node_t * lv_rb_insert(lv_rb_t * tree, void * key) -{ - LV_ASSERT_NULL(tree); - if(tree == NULL) { - return NULL; - } - - lv_rb_node_t * node = lv_rb_find(tree, key); - if(node) return node; - else { - node = rb_create_node(tree); - if(node == NULL) return NULL; - - if(tree->root == NULL) { - tree->root = node; - node->parent = NULL; - node->color = LV_RB_COLOR_BLACK; - return node; - } - } - - void * new_data = node->data; - node->data = key; - lv_rb_node_t * parent = rb_find_leaf_parent(tree, node); - - node->parent = parent; - node->color = LV_RB_COLOR_RED; - - if(tree->compare(key, parent->data) < 0) parent->left = node; - else parent->right = node; - - rb_insert_color(tree, node); - - node->data = new_data; - return node; -} - -lv_rb_node_t * lv_rb_find(lv_rb_t * tree, const void * key) -{ - LV_ASSERT_NULL(tree); - if(tree == NULL) { - return NULL; - } - - lv_rb_node_t * current = tree->root; - - while(current != NULL) { - lv_rb_compare_res_t cmp = tree->compare(key, current->data); - - if(cmp == 0) { - return current; - } - else if(cmp < 0) { - current = current->left; - } - else { - current = current->right; - } - } - - return NULL; -} - -void * lv_rb_remove_node(lv_rb_t * tree, lv_rb_node_t * node) -{ - lv_rb_node_t * child = NULL; - lv_rb_node_t * parent = NULL; - lv_rb_color_t color = LV_RB_COLOR_BLACK; - - if(node->left != NULL && node->right != NULL) { - lv_rb_node_t * replace = node; - replace = lv_rb_minimum_from(replace->right); - - if(node->parent != NULL) { - if(node->parent->left == node) { - node->parent->left = replace; - } - else { - node->parent->right = replace; - } - } - else { - tree->root = replace; - } - - child = replace->right; - parent = replace->parent; - color = replace->color; - - if(parent == node) { - parent = replace; - } - else { - if(child != NULL) { - child->parent = parent; - } - parent->left = child; - replace->right = node->right; - node->right->parent = replace; - } - - replace->parent = node->parent; - replace->color = node->color; - replace->left = node->left; - node->left->parent = replace; - - if(color == LV_RB_COLOR_BLACK) { - rb_delete_color(tree, child, parent); - } - - void * data = node->data; - lv_free(node); - return data; - } - - child = node->right != NULL ? node->right : node->left; - parent = node->parent; - color = node->color; - - if(child != NULL) { - child->parent = parent; - } - - if(parent != NULL) { - if(parent->left == node) { - parent->left = child; - } - else { - parent->right = child; - } - } - else { - tree->root = child; - } - - if(color == LV_RB_COLOR_BLACK) { - rb_delete_color(tree, child, parent); - } - - void * data = node->data; - lv_free(node); - return data; -} - -void * lv_rb_remove(lv_rb_t * tree, const void * key) -{ - LV_ASSERT_NULL(tree); - if(tree == NULL) { - return NULL; - } - - lv_rb_node_t * node = lv_rb_find(tree, key); - LV_ASSERT_NULL(node); - if(node == NULL) { - LV_LOG_WARN("rb delete %d not found", (int)(uintptr_t)key); - return NULL; - } - - return lv_rb_remove_node(tree, node); -} - -bool lv_rb_drop_node(lv_rb_t * tree, lv_rb_node_t * node) -{ - LV_ASSERT_NULL(tree); - if(tree == NULL) { - return false; - } - - void * data = lv_rb_remove_node(tree, node); - if(data) { - lv_free(data); - return true; - } - return false; -} - -bool lv_rb_drop(lv_rb_t * tree, const void * key) -{ - LV_ASSERT_NULL(tree); - if(tree == NULL) { - return false; - } - - void * data = lv_rb_remove(tree, key); - if(data) { - lv_free(data); - return true; - } - return false; -} - -void lv_rb_destroy(lv_rb_t * tree) -{ - LV_ASSERT_NULL(tree); - - if(tree == NULL) { - return; - } - - lv_rb_node_t * node = tree->root; - lv_rb_node_t * parent = NULL; - - while(node != NULL) { - if(node->left != NULL) { - node = node->left; - } - else if(node->right != NULL) { - node = node->right; - } - else { - parent = node->parent; - if(parent != NULL) { - if(parent->left == node) { - parent->left = NULL; - } - else { - parent->right = NULL; - } - } - lv_free(node->data); - lv_free(node); - node = parent; - } - } - tree->root = NULL; -} - -lv_rb_node_t * lv_rb_minimum(lv_rb_t * tree) -{ - LV_ASSERT_NULL(tree); - if(tree == NULL) { - return NULL; - } - return lv_rb_minimum_from(tree->root); -} - -lv_rb_node_t * lv_rb_maximum(lv_rb_t * tree) -{ - LV_ASSERT_NULL(tree); - if(tree == NULL) { - return NULL; - } - return lv_rb_maximum_from(tree->root); -} - -lv_rb_node_t * lv_rb_minimum_from(lv_rb_node_t * node) -{ - while(node->left != NULL) { - node = node->left; - } - - return node; -} - -lv_rb_node_t * lv_rb_maximum_from(lv_rb_node_t * node) -{ - while(node->right != NULL) { - node = node->right; - } - - return node; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static lv_rb_node_t * rb_create_node(lv_rb_t * tree) -{ - lv_rb_node_t * node = lv_malloc_zeroed(sizeof(lv_rb_node_t)); - LV_ASSERT_MALLOC(node); - if(node == NULL) { - return NULL; - } - - node->data = lv_malloc_zeroed(tree->size); - LV_ASSERT_MALLOC(node->data); - if(node->data == NULL) { - lv_free(node); - return NULL; - } - - node->color = LV_RB_COLOR_RED; - node->left = NULL; - node->right = NULL; - - return node; -} - -static lv_rb_node_t * rb_find_leaf_parent(lv_rb_t * tree, lv_rb_node_t * node) -{ - lv_rb_node_t * current = tree->root; - lv_rb_node_t * parent = current; - - while(current != NULL) { - parent = current; - - if(tree->compare(node->data, current->data) < 0) { - current = current->left; - } - else { - current = current->right; - } - } - - return parent; -} - -static void rb_right_rotate(lv_rb_t * tree, lv_rb_node_t * node) -{ - lv_rb_node_t * left = node->left; - node->left = left->right; - - if(left->right != NULL) { - left->right->parent = node; - } - - left->parent = node->parent; - - if(node->parent == NULL) { - tree->root = left; - } - else if(node == node->parent->right) { - node->parent->right = left; - } - else { - node->parent->left = left; - } - - left->right = node; - node->parent = left; -} - -static void rb_left_rotate(lv_rb_t * tree, lv_rb_node_t * node) -{ - lv_rb_node_t * right = node->right; - node->right = right->left; - - if(right->left != NULL) { - right->left->parent = node; - } - - right->parent = node->parent; - - if(node->parent == NULL) { - tree->root = right; - } - else if(node == node->parent->left) { - node->parent->left = right; - } - else { - node->parent->right = right; - } - - right->left = node; - node->parent = right; -} - -static void rb_insert_color(lv_rb_t * tree, lv_rb_node_t * node) -{ - lv_rb_node_t * parent = NULL; - lv_rb_node_t * gparent = NULL; - - while((parent = node->parent) && parent->color == LV_RB_COLOR_RED) { - gparent = parent->parent; - - if(parent == gparent->left) { - { - lv_rb_node_t * uncle = gparent->right; - if(uncle && uncle->color == LV_RB_COLOR_RED) { - uncle->color = LV_RB_COLOR_BLACK; - parent->color = LV_RB_COLOR_BLACK; - gparent->color = LV_RB_COLOR_RED; - node = gparent; - continue; - } - } - - if(parent->right == node) { - lv_rb_node_t * tmp; - rb_left_rotate(tree, parent); - tmp = parent; - parent = node; - node = tmp; - } - - parent->color = LV_RB_COLOR_BLACK; - gparent->color = LV_RB_COLOR_RED; - rb_right_rotate(tree, gparent); - } - else { - { - lv_rb_node_t * uncle = gparent->left; - if(uncle && uncle->color == LV_RB_COLOR_RED) { - uncle->color = LV_RB_COLOR_BLACK; - parent->color = LV_RB_COLOR_BLACK; - gparent->color = LV_RB_COLOR_RED; - node = gparent; - continue; - } - } - - if(parent->left == node) { - lv_rb_node_t * tmp; - rb_right_rotate(tree, parent); - tmp = parent; - parent = node; - node = tmp; - } - - parent->color = LV_RB_COLOR_BLACK; - gparent->color = LV_RB_COLOR_RED; - rb_left_rotate(tree, gparent); - } - } - - tree->root->color = LV_RB_COLOR_BLACK; -} - -static void rb_delete_color(lv_rb_t * tree, lv_rb_node_t * node1, lv_rb_node_t * node2) -{ - LV_ASSERT_NULL(tree); - if(tree == NULL) { - return; - } - - while((node1 == NULL || node1->color == LV_RB_COLOR_BLACK) && node1 != tree->root) { - if(node2->left == node1) { - lv_rb_node_t * pNode2 = node2->right; - if(pNode2->color == LV_RB_COLOR_RED) { - pNode2->color = LV_RB_COLOR_BLACK; - node2->color = LV_RB_COLOR_RED; - rb_left_rotate(tree, node2); - pNode2 = node2->right; - } - - if((pNode2->left == NULL || pNode2->left->color == LV_RB_COLOR_BLACK) - && (pNode2->right == NULL || pNode2->right->color == LV_RB_COLOR_BLACK)) { - pNode2->color = LV_RB_COLOR_RED; - node1 = node2; - node2 = node2->parent; - } - else { - if(pNode2->right == NULL || pNode2->right->color == LV_RB_COLOR_BLACK) { - pNode2->left->color = LV_RB_COLOR_BLACK; - pNode2->color = LV_RB_COLOR_RED; - rb_right_rotate(tree, pNode2); - pNode2 = node2->right; - } - pNode2->color = node2->color; - node2->color = LV_RB_COLOR_BLACK; - pNode2->right->color = LV_RB_COLOR_BLACK; - rb_left_rotate(tree, node2); - node1 = tree->root; - break; - } - } - else { - lv_rb_node_t * pNode2 = node2->left; - if(pNode2->color == LV_RB_COLOR_RED) { - pNode2->color = LV_RB_COLOR_BLACK; - node2->color = LV_RB_COLOR_RED; - rb_right_rotate(tree, node2); - pNode2 = node2->left; - } - - if((pNode2->left == NULL || pNode2->left->color == LV_RB_COLOR_BLACK) - && (pNode2->right == NULL || pNode2->right->color == LV_RB_COLOR_BLACK)) { - pNode2->color = LV_RB_COLOR_RED; - node1 = node2; - node2 = node2->parent; - } - else { - if(pNode2->left == NULL || pNode2->left->color == LV_RB_COLOR_BLACK) { - pNode2->right->color = LV_RB_COLOR_BLACK; - pNode2->color = LV_RB_COLOR_RED; - rb_left_rotate(tree, pNode2); - pNode2 = node2->left; - } - pNode2->color = node2->color; - node2->color = LV_RB_COLOR_BLACK; - pNode2->left->color = LV_RB_COLOR_BLACK; - rb_right_rotate(tree, node2); - node1 = tree->root; - break; - } - } - } - if(node1 != NULL) - node1->color = LV_RB_COLOR_BLACK; -} diff --git a/L3_Middlewares/LVGL/src/misc/lv_rb.h b/L3_Middlewares/LVGL/src/misc/lv_rb.h deleted file mode 100644 index bec0a78..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_rb.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file lv_rb.h - * - */ - -#ifndef LV_RB_H -#define LV_RB_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_types.h" -#include "lv_assert.h" -#include "lv_types.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef enum { - LV_RB_COLOR_RED, - LV_RB_COLOR_BLACK -} lv_rb_color_t; - -typedef int8_t lv_rb_compare_res_t; - -typedef lv_rb_compare_res_t (*lv_rb_compare_t)(const void * a, const void * b); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -bool lv_rb_init(lv_rb_t * tree, lv_rb_compare_t compare, size_t node_size); -lv_rb_node_t * lv_rb_insert(lv_rb_t * tree, void * key); -lv_rb_node_t * lv_rb_find(lv_rb_t * tree, const void * key); -void * lv_rb_remove_node(lv_rb_t * tree, lv_rb_node_t * node); -void * lv_rb_remove(lv_rb_t * tree, const void * key); -bool lv_rb_drop_node(lv_rb_t * tree, lv_rb_node_t * node); -bool lv_rb_drop(lv_rb_t * tree, const void * key); -lv_rb_node_t * lv_rb_minimum(lv_rb_t * node); -lv_rb_node_t * lv_rb_maximum(lv_rb_t * node); -lv_rb_node_t * lv_rb_minimum_from(lv_rb_node_t * node); -lv_rb_node_t * lv_rb_maximum_from(lv_rb_node_t * node); -void lv_rb_destroy(lv_rb_t * tree); - -/************************* - * GLOBAL VARIABLES - *************************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_RB_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_rb_private.h b/L3_Middlewares/LVGL/src/misc/lv_rb_private.h deleted file mode 100644 index 327b7b0..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_rb_private.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file lv_rb_private.h - * - */ - -#ifndef LV_RB_PRIVATE_H -#define LV_RB_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_rb.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_rb_node_t { - struct lv_rb_node_t * parent; - struct lv_rb_node_t * left; - struct lv_rb_node_t * right; - lv_rb_color_t color; - void * data; -}; - -struct lv_rb_t { - lv_rb_node_t * root; - lv_rb_compare_t compare; - size_t size; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_RB_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_style.c b/L3_Middlewares/LVGL/src/misc/lv_style.c index d137d67..994be81 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_style.c +++ b/L3_Middlewares/LVGL/src/misc/lv_style.c @@ -6,19 +6,15 @@ /********************* * INCLUDES *********************/ -#include "lv_style_private.h" -#include "../core/lv_global.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_string.h" +#include "lv_style.h" +#include "../misc/lv_gc.h" +#include "../misc/lv_mem.h" #include "lv_assert.h" #include "lv_types.h" /********************* * DEFINES *********************/ -#define lv_style_custom_prop_flag_lookup_table_size LV_GLOBAL_DEFAULT()->style_custom_table_size -#define lv_style_custom_prop_flag_lookup_table LV_GLOBAL_DEFAULT()->style_custom_prop_flag_lookup_table -#define last_custom_prop_id LV_GLOBAL_DEFAULT()->style_last_custom_prop_id /********************** * TYPEDEFS @@ -28,43 +24,40 @@ * STATIC PROTOTYPES **********************/ +static void lv_style_set_prop_internal(lv_style_t * style, lv_style_prop_t prop_and_meta, lv_style_value_t value, + void (*value_adjustment_helper)(lv_style_prop_t, lv_style_value_t, uint16_t *, lv_style_value_t *)); +static void lv_style_set_prop_helper(lv_style_prop_t prop, lv_style_value_t value, uint16_t * prop_storage, + lv_style_value_t * value_storage); +static void lv_style_set_prop_meta_helper(lv_style_prop_t prop, lv_style_value_t value, uint16_t * prop_storage, + lv_style_value_t * value_storage); + /********************** * GLOBAL VARIABLES **********************/ -const lv_style_prop_t lv_style_const_prop_id_inv = LV_STYLE_PROP_INV; - -const uint8_t lv_style_builtin_prop_flag_lookup_table[LV_STYLE_NUM_BUILT_IN_PROPS] = { - [LV_STYLE_WIDTH] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_MIN_WIDTH] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_MAX_WIDTH] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_HEIGHT] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_MIN_HEIGHT] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_MAX_HEIGHT] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_LENGTH] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, - [LV_STYLE_X] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_Y] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_ALIGN] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_TRANSFORM_WIDTH] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM, - [LV_STYLE_TRANSFORM_HEIGHT] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM, - [LV_STYLE_TRANSLATE_X] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE | LV_STYLE_PROP_FLAG_PARENT_LAYOUT_UPDATE, - [LV_STYLE_TRANSLATE_Y] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE | LV_STYLE_PROP_FLAG_PARENT_LAYOUT_UPDATE, - [LV_STYLE_TRANSFORM_SCALE_X] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYER_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM, - [LV_STYLE_TRANSFORM_SCALE_Y] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYER_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM, - [LV_STYLE_TRANSFORM_SKEW_X] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYER_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM, - [LV_STYLE_TRANSFORM_SKEW_Y] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYER_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM, - [LV_STYLE_TRANSFORM_ROTATION] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYER_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM, - - [LV_STYLE_PAD_TOP] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_PAD_BOTTOM] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_PAD_LEFT] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_PAD_RIGHT] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_PAD_ROW] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_PAD_COLUMN] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_MARGIN_TOP] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_MARGIN_BOTTOM] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_MARGIN_LEFT] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_MARGIN_RIGHT] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, +const uint8_t _lv_style_builtin_prop_flag_lookup_table[_LV_STYLE_NUM_BUILT_IN_PROPS] = { + [LV_STYLE_WIDTH] = LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_MIN_WIDTH] = LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_MAX_WIDTH] = LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_HEIGHT] = LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_MIN_HEIGHT] = LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_MAX_HEIGHT] = LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_X] = LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_Y] = LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_ALIGN] = LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_TRANSFORM_WIDTH] = LV_STYLE_PROP_EXT_DRAW, + [LV_STYLE_TRANSFORM_HEIGHT] = LV_STYLE_PROP_EXT_DRAW, + [LV_STYLE_TRANSLATE_X] = LV_STYLE_PROP_LAYOUT_REFR | LV_STYLE_PROP_PARENT_LAYOUT_REFR, + [LV_STYLE_TRANSLATE_Y] = LV_STYLE_PROP_LAYOUT_REFR | LV_STYLE_PROP_PARENT_LAYOUT_REFR, + [LV_STYLE_TRANSFORM_ZOOM] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYER_REFR, + [LV_STYLE_TRANSFORM_ANGLE] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYER_REFR, + + [LV_STYLE_PAD_TOP] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_PAD_BOTTOM] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_PAD_LEFT] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_PAD_RIGHT] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_PAD_ROW] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_PAD_COLUMN] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYOUT_REFR, [LV_STYLE_BG_COLOR] = 0, [LV_STYLE_BG_OPA] = 0, @@ -72,99 +65,81 @@ const uint8_t lv_style_builtin_prop_flag_lookup_table[LV_STYLE_NUM_BUILT_IN_PROP [LV_STYLE_BG_GRAD_DIR] = 0, [LV_STYLE_BG_MAIN_STOP] = 0, [LV_STYLE_BG_GRAD_STOP] = 0, - [LV_STYLE_BG_MAIN_OPA] = 0, - [LV_STYLE_BG_GRAD_OPA] = 0, [LV_STYLE_BG_GRAD] = 0, + [LV_STYLE_BG_DITHER_MODE] = 0, - [LV_STYLE_BG_IMAGE_SRC] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, - [LV_STYLE_BG_IMAGE_OPA] = 0, - [LV_STYLE_BG_IMAGE_RECOLOR] = 0, - [LV_STYLE_BG_IMAGE_RECOLOR_OPA] = 0, - [LV_STYLE_BG_IMAGE_TILED] = 0, + [LV_STYLE_BG_IMG_SRC] = LV_STYLE_PROP_EXT_DRAW, + [LV_STYLE_BG_IMG_OPA] = 0, + [LV_STYLE_BG_IMG_RECOLOR] = 0, + [LV_STYLE_BG_IMG_RECOLOR_OPA] = 0, + [LV_STYLE_BG_IMG_TILED] = 0, [LV_STYLE_BORDER_COLOR] = 0, [LV_STYLE_BORDER_OPA] = 0, - [LV_STYLE_BORDER_WIDTH] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, + [LV_STYLE_BORDER_WIDTH] = LV_STYLE_PROP_LAYOUT_REFR, [LV_STYLE_BORDER_SIDE] = 0, [LV_STYLE_BORDER_POST] = 0, - [LV_STYLE_OUTLINE_WIDTH] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, + [LV_STYLE_OUTLINE_WIDTH] = LV_STYLE_PROP_EXT_DRAW, [LV_STYLE_OUTLINE_COLOR] = 0, - [LV_STYLE_OUTLINE_OPA] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, - [LV_STYLE_OUTLINE_PAD] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, + [LV_STYLE_OUTLINE_OPA] = LV_STYLE_PROP_EXT_DRAW, + [LV_STYLE_OUTLINE_PAD] = LV_STYLE_PROP_EXT_DRAW, - [LV_STYLE_SHADOW_WIDTH] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, - [LV_STYLE_SHADOW_OFFSET_X] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, - [LV_STYLE_SHADOW_OFFSET_Y] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, - [LV_STYLE_SHADOW_SPREAD] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, + [LV_STYLE_SHADOW_WIDTH] = LV_STYLE_PROP_EXT_DRAW, + [LV_STYLE_SHADOW_OFS_X] = LV_STYLE_PROP_EXT_DRAW, + [LV_STYLE_SHADOW_OFS_Y] = LV_STYLE_PROP_EXT_DRAW, + [LV_STYLE_SHADOW_SPREAD] = LV_STYLE_PROP_EXT_DRAW, [LV_STYLE_SHADOW_COLOR] = 0, - [LV_STYLE_SHADOW_OPA] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, + [LV_STYLE_SHADOW_OPA] = LV_STYLE_PROP_EXT_DRAW, - [LV_STYLE_IMAGE_OPA] = 0, - [LV_STYLE_IMAGE_RECOLOR] = 0, - [LV_STYLE_IMAGE_RECOLOR_OPA] = 0, + [LV_STYLE_IMG_OPA] = 0, + [LV_STYLE_IMG_RECOLOR] = 0, + [LV_STYLE_IMG_RECOLOR_OPA] = 0, - [LV_STYLE_LINE_WIDTH] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, + [LV_STYLE_LINE_WIDTH] = LV_STYLE_PROP_EXT_DRAW, [LV_STYLE_LINE_DASH_WIDTH] = 0, [LV_STYLE_LINE_DASH_GAP] = 0, [LV_STYLE_LINE_ROUNDED] = 0, [LV_STYLE_LINE_COLOR] = 0, [LV_STYLE_LINE_OPA] = 0, - [LV_STYLE_ARC_WIDTH] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE, + [LV_STYLE_ARC_WIDTH] = LV_STYLE_PROP_EXT_DRAW, [LV_STYLE_ARC_ROUNDED] = 0, [LV_STYLE_ARC_COLOR] = 0, [LV_STYLE_ARC_OPA] = 0, - [LV_STYLE_ARC_IMAGE_SRC] = 0, + [LV_STYLE_ARC_IMG_SRC] = 0, - [LV_STYLE_TEXT_COLOR] = LV_STYLE_PROP_FLAG_INHERITABLE, - [LV_STYLE_TEXT_OPA] = LV_STYLE_PROP_FLAG_INHERITABLE, - [LV_STYLE_TEXT_FONT] = LV_STYLE_PROP_FLAG_INHERITABLE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_TEXT_LETTER_SPACE] = LV_STYLE_PROP_FLAG_INHERITABLE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_TEXT_LINE_SPACE] = LV_STYLE_PROP_FLAG_INHERITABLE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_TEXT_DECOR] = LV_STYLE_PROP_FLAG_INHERITABLE, - [LV_STYLE_TEXT_ALIGN] = LV_STYLE_PROP_FLAG_INHERITABLE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, + [LV_STYLE_TEXT_COLOR] = LV_STYLE_PROP_INHERIT, + [LV_STYLE_TEXT_OPA] = LV_STYLE_PROP_INHERIT, + [LV_STYLE_TEXT_FONT] = LV_STYLE_PROP_INHERIT | LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_TEXT_LETTER_SPACE] = LV_STYLE_PROP_INHERIT | LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_TEXT_LINE_SPACE] = LV_STYLE_PROP_INHERIT | LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_TEXT_DECOR] = LV_STYLE_PROP_INHERIT, + [LV_STYLE_TEXT_ALIGN] = LV_STYLE_PROP_INHERIT | LV_STYLE_PROP_LAYOUT_REFR, [LV_STYLE_RADIUS] = 0, [LV_STYLE_CLIP_CORNER] = 0, - [LV_STYLE_OPA] = 0, - [LV_STYLE_OPA_LAYERED] = LV_STYLE_PROP_FLAG_LAYER_UPDATE, - [LV_STYLE_COLOR_FILTER_DSC] = LV_STYLE_PROP_FLAG_INHERITABLE, - [LV_STYLE_COLOR_FILTER_OPA] = LV_STYLE_PROP_FLAG_INHERITABLE, - [LV_STYLE_ANIM_DURATION] = 0, + [LV_STYLE_OPA] = 0, + [LV_STYLE_OPA_LAYERED] = LV_STYLE_PROP_LAYER_REFR, + [LV_STYLE_COLOR_FILTER_DSC] = LV_STYLE_PROP_INHERIT, + [LV_STYLE_COLOR_FILTER_OPA] = LV_STYLE_PROP_INHERIT, + [LV_STYLE_ANIM_TIME] = 0, + [LV_STYLE_ANIM_SPEED] = 0, [LV_STYLE_TRANSITION] = 0, - [LV_STYLE_BLEND_MODE] = LV_STYLE_PROP_FLAG_LAYER_UPDATE, - [LV_STYLE_LAYOUT] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_BASE_DIR] = LV_STYLE_PROP_FLAG_INHERITABLE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_BITMAP_MASK_SRC] = LV_STYLE_PROP_FLAG_LAYER_UPDATE, - -#if LV_USE_FLEX - [LV_STYLE_FLEX_FLOW] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_FLEX_MAIN_PLACE] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_FLEX_CROSS_PLACE] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_FLEX_TRACK_PLACE] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_FLEX_GROW] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, -#endif - -#if LV_USE_GRID - [LV_STYLE_GRID_COLUMN_DSC_ARRAY] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_GRID_ROW_DSC_ARRAY] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_GRID_COLUMN_ALIGN] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_GRID_ROW_ALIGN] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_GRID_CELL_ROW_SPAN] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_GRID_CELL_ROW_POS] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_GRID_CELL_COLUMN_SPAN] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_GRID_CELL_COLUMN_POS] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_GRID_CELL_X_ALIGN] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, - [LV_STYLE_GRID_CELL_Y_ALIGN] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE, -#endif - + [LV_STYLE_BLEND_MODE] = LV_STYLE_PROP_LAYER_REFR, + [LV_STYLE_LAYOUT] = LV_STYLE_PROP_LAYOUT_REFR, + [LV_STYLE_BASE_DIR] = LV_STYLE_PROP_INHERIT | LV_STYLE_PROP_LAYOUT_REFR, }; +uint32_t _lv_style_custom_prop_flag_lookup_table_size = 0; + /********************** * STATIC VARIABLES **********************/ +static uint16_t last_custom_prop_id = (uint16_t)_LV_STYLE_LAST_BUILT_IN_PROP; +static const lv_style_value_t null_style_value = { .num = 0 }; + /********************** * MACROS **********************/ @@ -181,7 +156,7 @@ void lv_style_init(lv_style_t * style) } #endif - lv_memzero(style, sizeof(lv_style_t)); + lv_memset_00(style, sizeof(lv_style_t)); #if LV_USE_ASSERT_STYLE style->sentinel = LV_STYLE_SENTINEL_VALUE; #endif @@ -191,8 +166,13 @@ void lv_style_reset(lv_style_t * style) { LV_ASSERT_STYLE(style); - if(style->prop_cnt != 255) lv_free(style->values_and_props); - lv_memzero(style, sizeof(lv_style_t)); + if(style->prop1 == LV_STYLE_PROP_ANY) { + LV_LOG_ERROR("Cannot reset const style"); + return; + } + + if(style->prop_cnt > 1) lv_mem_free(style->v_p.values_and_props); + lv_memset_00(style, sizeof(lv_style_t)); #if LV_USE_ASSERT_STYLE style->sentinel = LV_STYLE_SENTINEL_VALUE; #endif @@ -200,83 +180,99 @@ void lv_style_reset(lv_style_t * style) lv_style_prop_t lv_style_register_prop(uint8_t flag) { - if(lv_style_custom_prop_flag_lookup_table == NULL) { - lv_style_custom_prop_flag_lookup_table_size = 0; - last_custom_prop_id = (uint16_t)LV_STYLE_LAST_BUILT_IN_PROP; + if(LV_GC_ROOT(_lv_style_custom_prop_flag_lookup_table) == NULL) { + _lv_style_custom_prop_flag_lookup_table_size = 0; + last_custom_prop_id = (uint16_t)_LV_STYLE_LAST_BUILT_IN_PROP; } - // if((last_custom_prop_id + 1) != 0) { - // LV_LOG_ERROR("No more custom property IDs available"); - // return LV_STYLE_PROP_INV; - // } + if(((last_custom_prop_id + 1) & LV_STYLE_PROP_META_MASK) != 0) { + LV_LOG_ERROR("No more custom property IDs available"); + return LV_STYLE_PROP_INV; + } /* * Allocate the lookup table if it's not yet available. */ - size_t required_size = (last_custom_prop_id + 1 - LV_STYLE_LAST_BUILT_IN_PROP); - if(lv_style_custom_prop_flag_lookup_table_size < required_size) { + size_t required_size = (last_custom_prop_id + 1 - _LV_STYLE_LAST_BUILT_IN_PROP); + if(_lv_style_custom_prop_flag_lookup_table_size < required_size) { /* Round required_size up to the nearest 32-byte value */ required_size = (required_size + 31) & ~31; LV_ASSERT_MSG(required_size > 0, "required size has become 0?"); - uint8_t * old_p = lv_style_custom_prop_flag_lookup_table; - uint8_t * new_p = lv_realloc(old_p, required_size * sizeof(uint8_t)); + uint8_t * old_p = LV_GC_ROOT(_lv_style_custom_prop_flag_lookup_table); + uint8_t * new_p = lv_mem_realloc(old_p, required_size * sizeof(uint8_t)); if(new_p == NULL) { LV_LOG_ERROR("Unable to allocate space for custom property lookup table"); return LV_STYLE_PROP_INV; } - lv_style_custom_prop_flag_lookup_table = new_p; - lv_style_custom_prop_flag_lookup_table_size = required_size; + LV_GC_ROOT(_lv_style_custom_prop_flag_lookup_table) = new_p; + _lv_style_custom_prop_flag_lookup_table_size = required_size; } last_custom_prop_id++; /* This should never happen - we should bail out above */ - LV_ASSERT_NULL(lv_style_custom_prop_flag_lookup_table); - lv_style_custom_prop_flag_lookup_table[last_custom_prop_id - LV_STYLE_NUM_BUILT_IN_PROPS] = flag; + LV_ASSERT_NULL(LV_GC_ROOT(_lv_style_custom_prop_flag_lookup_table)); + LV_GC_ROOT(_lv_style_custom_prop_flag_lookup_table)[last_custom_prop_id - _LV_STYLE_NUM_BUILT_IN_PROPS] = flag; return last_custom_prop_id; } lv_style_prop_t lv_style_get_num_custom_props(void) { - return last_custom_prop_id - LV_STYLE_LAST_BUILT_IN_PROP; + return last_custom_prop_id - _LV_STYLE_LAST_BUILT_IN_PROP; } bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop) { LV_ASSERT_STYLE(style); - if(lv_style_is_const(style)) { + if(style->prop1 == LV_STYLE_PROP_ANY) { LV_LOG_ERROR("Cannot remove prop from const style"); return false; } if(style->prop_cnt == 0) return false; - uint8_t * tmp = (lv_style_prop_t *)style->values_and_props + style->prop_cnt * sizeof(lv_style_value_t); - uint8_t * old_props = (uint8_t *)tmp; + if(style->prop_cnt == 1) { + if(LV_STYLE_PROP_ID_MASK(style->prop1) == prop) { + style->prop1 = LV_STYLE_PROP_INV; + style->prop_cnt = 0; + return true; + } + return false; + } + + uint8_t * tmp = style->v_p.values_and_props + style->prop_cnt * sizeof(lv_style_value_t); + uint16_t * old_props = (uint16_t *)tmp; uint32_t i; for(i = 0; i < style->prop_cnt; i++) { - if(old_props[i] == prop) { - lv_style_value_t * old_values = (lv_style_value_t *)style->values_and_props; - - size_t size = (style->prop_cnt - 1) * (sizeof(lv_style_value_t) + sizeof(lv_style_prop_t)); - uint8_t * new_values_and_props = lv_malloc(size); - if(new_values_and_props == NULL) return false; - style->values_and_props = new_values_and_props; - style->prop_cnt--; - - tmp = new_values_and_props + style->prop_cnt * sizeof(lv_style_value_t); - uint8_t * new_props = (uint8_t *)tmp; - lv_style_value_t * new_values = (lv_style_value_t *)new_values_and_props; - - uint32_t j; - for(i = j = 0; j <= style->prop_cnt; - j++) { /*<=: because prop_cnt already reduced but all the old props. needs to be checked.*/ - if(old_props[j] != prop) { - new_values[i] = old_values[j]; - new_props[i++] = old_props[j]; + if(LV_STYLE_PROP_ID_MASK(old_props[i]) == prop) { + lv_style_value_t * old_values = (lv_style_value_t *)style->v_p.values_and_props; + + if(style->prop_cnt == 2) { + style->prop_cnt = 1; + style->prop1 = i == 0 ? old_props[1] : old_props[0]; + style->v_p.value1 = i == 0 ? old_values[1] : old_values[0]; + } + else { + size_t size = (style->prop_cnt - 1) * (sizeof(lv_style_value_t) + sizeof(uint16_t)); + uint8_t * new_values_and_props = lv_mem_alloc(size); + if(new_values_and_props == NULL) return false; + style->v_p.values_and_props = new_values_and_props; + style->prop_cnt--; + + tmp = new_values_and_props + style->prop_cnt * sizeof(lv_style_value_t); + uint16_t * new_props = (uint16_t *)tmp; + lv_style_value_t * new_values = (lv_style_value_t *)new_values_and_props; + + uint32_t j; + for(i = j = 0; j <= style->prop_cnt; + j++) { /*<=: because prop_cnt already reduced but all the old props. needs to be checked.*/ + if(old_props[j] != prop) { + new_values[i] = old_values[j]; + new_props[i++] = old_props[j]; + } } } - lv_free(old_values); + lv_mem_free(old_values); return true; } } @@ -286,51 +282,12 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop) void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t value) { - LV_ASSERT_STYLE(style); - - if(lv_style_is_const(style)) { - LV_LOG_ERROR("Cannot set property of constant style"); - return; - } - - LV_ASSERT(prop != LV_STYLE_PROP_INV); - - lv_style_prop_t * props; - int32_t i; - - if(style->values_and_props) { - props = (lv_style_prop_t *)style->values_and_props + style->prop_cnt * sizeof(lv_style_value_t); - for(i = style->prop_cnt - 1; i >= 0; i--) { - if(props[i] == prop) { - lv_style_value_t * values = (lv_style_value_t *)style->values_and_props; - values[i] = value; - return; - } - } - } - - size_t size = (style->prop_cnt + 1) * (sizeof(lv_style_value_t) + sizeof(lv_style_prop_t)); - uint8_t * values_and_props = lv_realloc(style->values_and_props, size); - if(values_and_props == NULL) return; - style->values_and_props = values_and_props; - - props = values_and_props + style->prop_cnt * sizeof(lv_style_value_t); - /*Shift all props to make place for the value before them*/ - for(i = style->prop_cnt - 1; i >= 0; i--) { - props[i + sizeof(lv_style_value_t) / sizeof(lv_style_prop_t)] = props[i]; - } - style->prop_cnt++; - - /*Go to the new position with the props*/ - props = values_and_props + style->prop_cnt * sizeof(lv_style_value_t); - lv_style_value_t * values = (lv_style_value_t *)values_and_props; - - /*Set the new property and value*/ - props[style->prop_cnt - 1] = prop; - values[style->prop_cnt - 1] = value; + lv_style_set_prop_internal(style, prop, value, lv_style_set_prop_helper); +} - uint32_t group = lv_style_get_prop_group(prop); - style->has_group |= (uint32_t)1 << group; +void lv_style_set_prop_meta(lv_style_t * style, lv_style_prop_t prop, uint16_t meta) +{ + lv_style_set_prop_internal(style, prop | meta, null_style_value, lv_style_set_prop_meta_helper); } lv_style_res_t lv_style_get_prop(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value) @@ -341,28 +298,28 @@ lv_style_res_t lv_style_get_prop(const lv_style_t * style, lv_style_prop_t prop, void lv_style_transition_dsc_init(lv_style_transition_dsc_t * tr, const lv_style_prop_t props[], lv_anim_path_cb_t path_cb, uint32_t time, uint32_t delay, void * user_data) { - lv_memzero(tr, sizeof(lv_style_transition_dsc_t)); + lv_memset_00(tr, sizeof(lv_style_transition_dsc_t)); tr->props = props; tr->path_xcb = path_cb == NULL ? lv_anim_path_linear : path_cb; tr->time = time; tr->delay = delay; +#if LV_USE_USER_DATA tr->user_data = user_data; +#else + LV_UNUSED(user_data); +#endif } lv_style_value_t lv_style_prop_get_default(lv_style_prop_t prop) { - const lv_color_t black = LV_COLOR_MAKE(0x00, 0x00, 0x00); - const lv_color_t white = LV_COLOR_MAKE(0xff, 0xff, 0xff); + lv_style_value_t value; switch(prop) { - case LV_STYLE_TRANSFORM_SCALE_X: - case LV_STYLE_TRANSFORM_SCALE_Y: - return (lv_style_value_t) { - .num = LV_SCALE_NONE - }; + case LV_STYLE_TRANSFORM_ZOOM: + value.num = LV_IMG_ZOOM_NONE; + break; case LV_STYLE_BG_COLOR: - return (lv_style_value_t) { - .color = white - }; + value.color = lv_color_white(); + break; case LV_STYLE_BG_GRAD_COLOR: case LV_STYLE_BORDER_COLOR: case LV_STYLE_SHADOW_COLOR: @@ -370,73 +327,161 @@ lv_style_value_t lv_style_prop_get_default(lv_style_prop_t prop) case LV_STYLE_ARC_COLOR: case LV_STYLE_LINE_COLOR: case LV_STYLE_TEXT_COLOR: - case LV_STYLE_IMAGE_RECOLOR: - return (lv_style_value_t) { - .color = black - }; + case LV_STYLE_IMG_RECOLOR: + value.color = lv_color_black(); + break; case LV_STYLE_OPA: case LV_STYLE_OPA_LAYERED: case LV_STYLE_BORDER_OPA: case LV_STYLE_TEXT_OPA: - case LV_STYLE_IMAGE_OPA: - case LV_STYLE_BG_GRAD_OPA: - case LV_STYLE_BG_MAIN_OPA: - case LV_STYLE_BG_IMAGE_OPA: + case LV_STYLE_IMG_OPA: + case LV_STYLE_BG_IMG_OPA: case LV_STYLE_OUTLINE_OPA: case LV_STYLE_SHADOW_OPA: case LV_STYLE_LINE_OPA: case LV_STYLE_ARC_OPA: - return (lv_style_value_t) { - .num = LV_OPA_COVER - }; + value.num = LV_OPA_COVER; + break; case LV_STYLE_BG_GRAD_STOP: - return (lv_style_value_t) { - .num = 255 - }; + value.num = 255; + break; case LV_STYLE_BORDER_SIDE: - return (lv_style_value_t) { - .num = LV_BORDER_SIDE_FULL - }; + value.num = LV_BORDER_SIDE_FULL; + break; case LV_STYLE_TEXT_FONT: - return (lv_style_value_t) { - .ptr = LV_FONT_DEFAULT - }; + value.ptr = LV_FONT_DEFAULT; + break; case LV_STYLE_MAX_WIDTH: case LV_STYLE_MAX_HEIGHT: - return (lv_style_value_t) { - .num = LV_COORD_MAX - }; - case LV_STYLE_ROTARY_SENSITIVITY: - return (lv_style_value_t) { - .num = 256 - }; + value.num = LV_COORD_MAX; + break; default: - return (lv_style_value_t) { - .ptr = NULL - }; + value.ptr = NULL; + value.num = 0; + break; } + + return value; } bool lv_style_is_empty(const lv_style_t * style) { LV_ASSERT_STYLE(style); - return style->prop_cnt == 0; + return style->prop_cnt == 0 ? true : false; +} + +uint8_t _lv_style_get_prop_group(lv_style_prop_t prop) +{ + uint16_t group = (prop & 0x1FF) >> 4; + if(group > 7) group = 7; /*The MSB marks all the custom properties*/ + return (uint8_t)group; } -uint8_t lv_style_prop_lookup_flags(lv_style_prop_t prop) +uint8_t _lv_style_prop_lookup_flags(lv_style_prop_t prop) { - if(prop == LV_STYLE_PROP_ANY) return LV_STYLE_PROP_FLAG_ALL; /*Any prop can have any flags*/ + extern const uint8_t _lv_style_builtin_prop_flag_lookup_table[]; + extern uint32_t _lv_style_custom_prop_flag_lookup_table_size; + if(prop == LV_STYLE_PROP_ANY) return LV_STYLE_PROP_ALL; /*Any prop can have any flags*/ if(prop == LV_STYLE_PROP_INV) return 0; - if(prop < LV_STYLE_NUM_BUILT_IN_PROPS) - return lv_style_builtin_prop_flag_lookup_table[prop]; - prop -= LV_STYLE_NUM_BUILT_IN_PROPS; - if(lv_style_custom_prop_flag_lookup_table != NULL && prop < lv_style_custom_prop_flag_lookup_table_size) - return lv_style_custom_prop_flag_lookup_table[prop]; + if(prop < _LV_STYLE_NUM_BUILT_IN_PROPS) + return _lv_style_builtin_prop_flag_lookup_table[prop]; + prop -= _LV_STYLE_NUM_BUILT_IN_PROPS; + if(LV_GC_ROOT(_lv_style_custom_prop_flag_lookup_table) != NULL && prop < _lv_style_custom_prop_flag_lookup_table_size) + return LV_GC_ROOT(_lv_style_custom_prop_flag_lookup_table)[prop]; return 0; } /********************** * STATIC FUNCTIONS **********************/ + +static void lv_style_set_prop_helper(lv_style_prop_t prop, lv_style_value_t value, uint16_t * prop_storage, + lv_style_value_t * value_storage) +{ + *prop_storage = prop; + *value_storage = value; +} + +static void lv_style_set_prop_meta_helper(lv_style_prop_t prop, lv_style_value_t value, uint16_t * prop_storage, + lv_style_value_t * value_storage) +{ + LV_UNUSED(value); + LV_UNUSED(value_storage); + *prop_storage = prop; /* meta is OR-ed into the prop ID already */ +} + +static void lv_style_set_prop_internal(lv_style_t * style, lv_style_prop_t prop_and_meta, lv_style_value_t value, + void (*value_adjustment_helper)(lv_style_prop_t, lv_style_value_t, uint16_t *, lv_style_value_t *)) +{ + LV_ASSERT_STYLE(style); + + if(style->prop1 == LV_STYLE_PROP_ANY) { + LV_LOG_ERROR("Cannot set property of constant style"); + return; + } + + lv_style_prop_t prop_id = LV_STYLE_PROP_ID_MASK(prop_and_meta); + + if(style->prop_cnt > 1) { + uint8_t * tmp = style->v_p.values_and_props + style->prop_cnt * sizeof(lv_style_value_t); + uint16_t * props = (uint16_t *)tmp; + int32_t i; + for(i = style->prop_cnt - 1; i >= 0; i--) { + if(LV_STYLE_PROP_ID_MASK(props[i]) == prop_id) { + lv_style_value_t * values = (lv_style_value_t *)style->v_p.values_and_props; + value_adjustment_helper(prop_and_meta, value, &props[i], &values[i]); + return; + } + } + + size_t size = (style->prop_cnt + 1) * (sizeof(lv_style_value_t) + sizeof(uint16_t)); + uint8_t * values_and_props = lv_mem_realloc(style->v_p.values_and_props, size); + if(values_and_props == NULL) return; + style->v_p.values_and_props = values_and_props; + + tmp = values_and_props + style->prop_cnt * sizeof(lv_style_value_t); + props = (uint16_t *)tmp; + /*Shift all props to make place for the value before them*/ + for(i = style->prop_cnt - 1; i >= 0; i--) { + props[i + sizeof(lv_style_value_t) / sizeof(uint16_t)] = props[i]; + } + style->prop_cnt++; + + /*Go to the new position wit the props*/ + tmp = values_and_props + style->prop_cnt * sizeof(lv_style_value_t); + props = (uint16_t *)tmp; + lv_style_value_t * values = (lv_style_value_t *)values_and_props; + + /*Set the new property and value*/ + value_adjustment_helper(prop_and_meta, value, &props[style->prop_cnt - 1], &values[style->prop_cnt - 1]); + } + else if(style->prop_cnt == 1) { + if(LV_STYLE_PROP_ID_MASK(style->prop1) == prop_id) { + value_adjustment_helper(prop_and_meta, value, &style->prop1, &style->v_p.value1); + return; + } + size_t size = (style->prop_cnt + 1) * (sizeof(lv_style_value_t) + sizeof(uint16_t)); + uint8_t * values_and_props = lv_mem_alloc(size); + if(values_and_props == NULL) return; + lv_style_value_t value_tmp = style->v_p.value1; + style->v_p.values_and_props = values_and_props; + style->prop_cnt++; + + uint8_t * tmp = values_and_props + style->prop_cnt * sizeof(lv_style_value_t); + uint16_t * props = (uint16_t *)tmp; + lv_style_value_t * values = (lv_style_value_t *)values_and_props; + props[0] = style->prop1; + values[0] = value_tmp; + value_adjustment_helper(prop_and_meta, value, &props[1], &values[1]); + } + else { + style->prop_cnt = 1; + value_adjustment_helper(prop_and_meta, value, &style->prop1, &style->v_p.value1); + } + + uint8_t group = _lv_style_get_prop_group(prop_id); + style->has_group |= 1 << group; +} + diff --git a/L3_Middlewares/LVGL/src/misc/lv_style.h b/L3_Middlewares/LVGL/src/misc/lv_style.h index dcce7dc..77bf283 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_style.h +++ b/L3_Middlewares/LVGL/src/misc/lv_style.h @@ -1,4 +1,4 @@ -/** +/** * @file lv_style.h * */ @@ -13,15 +13,16 @@ extern "C" { /********************* * INCLUDES *********************/ +#include +#include #include "../font/lv_font.h" #include "lv_color.h" #include "lv_area.h" #include "lv_anim.h" -#include "lv_text.h" +#include "lv_txt.h" #include "lv_types.h" #include "lv_assert.h" #include "lv_bidi.h" -#include "../layouts/lv_layout.h" /********************* * DEFINES @@ -29,74 +30,86 @@ extern "C" { #define LV_STYLE_SENTINEL_VALUE 0xAABBCCDD -/* +/** * Flags for style behavior + * + * The rest of the flags will have _FLAG added to their name in v9. */ -#define LV_STYLE_PROP_FLAG_NONE (0) /**< No special behavior */ -#define LV_STYLE_PROP_FLAG_INHERITABLE (1 << 0) /**< Inherited */ -#define LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE (1 << 1) /**< Requires ext. draw size update when changed */ -#define LV_STYLE_PROP_FLAG_LAYOUT_UPDATE (1 << 2) /**< Requires layout update when changed */ -#define LV_STYLE_PROP_FLAG_PARENT_LAYOUT_UPDATE (1 << 3) /**< Requires layout update on parent when changed */ -#define LV_STYLE_PROP_FLAG_LAYER_UPDATE (1 << 4) /**< Affects layer handling */ -#define LV_STYLE_PROP_FLAG_TRANSFORM (1 << 5) /**< Affects the object's transformation */ -#define LV_STYLE_PROP_FLAG_ALL (0x3F) /**< Indicating all flags */ - -/* +#define LV_STYLE_PROP_FLAG_NONE (0) +#define LV_STYLE_PROP_INHERIT (1 << 0) /*Inherited*/ +#define LV_STYLE_PROP_EXT_DRAW (1 << 1) /*Requires ext. draw size update when changed*/ +#define LV_STYLE_PROP_LAYOUT_REFR (1 << 2) /*Requires layout update when changed*/ +#define LV_STYLE_PROP_PARENT_LAYOUT_REFR (1 << 3) /*Requires layout update on parent when changed*/ +#define LV_STYLE_PROP_LAYER_REFR (1 << 4) /*Affects layer handling*/ +#define LV_STYLE_PROP_ALL (0x1F) /*Indicating all flags*/ + +/** * Other constants */ -#define LV_SCALE_NONE 256 /**< Value for not zooming the image */ -LV_EXPORT_CONST_INT(LV_SCALE_NONE); +#define LV_IMG_ZOOM_NONE 256 /*Value for not zooming the image*/ +LV_EXPORT_CONST_INT(LV_IMG_ZOOM_NONE); // *INDENT-OFF* #if LV_USE_ASSERT_STYLE #define LV_STYLE_CONST_INIT(var_name, prop_array) \ const lv_style_t var_name = { \ .sentinel = LV_STYLE_SENTINEL_VALUE, \ - .values_and_props = (void*)prop_array, \ - .has_group = 0xFFFFFFFF, \ - .prop_cnt = 255 \ + .v_p = { .const_props = prop_array }, \ + .has_group = 0xFF, \ + .prop1 = LV_STYLE_PROP_ANY, \ + .prop_cnt = (sizeof(prop_array) / sizeof((prop_array)[0])), \ } #else #define LV_STYLE_CONST_INIT(var_name, prop_array) \ const lv_style_t var_name = { \ - .values_and_props = prop_array, \ - .has_group = 0xFFFFFFFF, \ - .prop_cnt = 255, \ + .v_p = { .const_props = prop_array }, \ + .has_group = 0xFF, \ + .prop1 = LV_STYLE_PROP_ANY, \ + .prop_cnt = (sizeof(prop_array) / sizeof((prop_array)[0])), \ } #endif // *INDENT-ON* -#define LV_STYLE_CONST_PROPS_END { .prop = LV_STYLE_PROP_INV, .value = { .num = 0 } } +#define LV_STYLE_PROP_META_INHERIT 0x8000 +#define LV_STYLE_PROP_META_INITIAL 0x4000 +#define LV_STYLE_PROP_META_MASK (LV_STYLE_PROP_META_INHERIT | LV_STYLE_PROP_META_INITIAL) + +#define LV_STYLE_PROP_ID_MASK(prop) ((lv_style_prop_t)((prop) & ~LV_STYLE_PROP_META_MASK)) /********************** * TYPEDEFS **********************/ /** - * Possible options for blending opaque drawings + * Possible options how to blend opaque drawings */ -typedef enum { +enum { LV_BLEND_MODE_NORMAL, /**< Simply mix according to the opacity value*/ LV_BLEND_MODE_ADDITIVE, /**< Add the respective color channels*/ LV_BLEND_MODE_SUBTRACTIVE,/**< Subtract the foreground from the background*/ LV_BLEND_MODE_MULTIPLY, /**< Multiply the foreground and background*/ -} lv_blend_mode_t; + LV_BLEND_MODE_REPLACE, /**< Replace background with foreground in the area*/ +}; + +typedef uint8_t lv_blend_mode_t; /** * Some options to apply decorations on texts. * 'OR'ed values can be used. */ -typedef enum { +enum { LV_TEXT_DECOR_NONE = 0x00, LV_TEXT_DECOR_UNDERLINE = 0x01, LV_TEXT_DECOR_STRIKETHROUGH = 0x02, -} lv_text_decor_t; +}; + +typedef uint8_t lv_text_decor_t; /** * Selects on which sides border should be drawn * 'OR'ed values can be used. */ -typedef enum { +enum { LV_BORDER_SIDE_NONE = 0x00, LV_BORDER_SIDE_BOTTOM = 0x01, LV_BORDER_SIDE_TOP = 0x02, @@ -104,71 +117,48 @@ typedef enum { LV_BORDER_SIDE_RIGHT = 0x08, LV_BORDER_SIDE_FULL = 0x0F, LV_BORDER_SIDE_INTERNAL = 0x10, /**< FOR matrix-like objects (e.g. Button matrix)*/ -} lv_border_side_t; +}; +typedef uint8_t lv_border_side_t; /** * The direction of the gradient. */ -typedef enum { - LV_GRAD_DIR_NONE, /**< No gradient (the `grad_color` property is ignored)*/ - LV_GRAD_DIR_VER, /**< Simple vertical (top to bottom) gradient*/ - LV_GRAD_DIR_HOR, /**< Simple horizontal (left to right) gradient*/ - LV_GRAD_DIR_LINEAR, /**< Linear gradient defined by start and end points. Can be at any angle.*/ - LV_GRAD_DIR_RADIAL, /**< Radial gradient defined by start and end circles*/ - LV_GRAD_DIR_CONICAL, /**< Conical gradient defined by center point, start and end angles*/ -} lv_grad_dir_t; +enum { + LV_GRAD_DIR_NONE, /**< No gradient (the `grad_color` property is ignored)*/ + LV_GRAD_DIR_VER, /**< Vertical (top to bottom) gradient*/ + LV_GRAD_DIR_HOR, /**< Horizontal (left to right) gradient*/ +}; + +typedef uint8_t lv_grad_dir_t; /** - * Gradient behavior outside the defined range. -*/ -typedef enum { - LV_GRAD_EXTEND_PAD, /**< Repeat the same color*/ - LV_GRAD_EXTEND_REPEAT, /**< Repeat the pattern*/ - LV_GRAD_EXTEND_REFLECT, /**< Repeat the pattern mirrored*/ -} lv_grad_extend_t; + * The dithering algorithm for the gradient + * Depends on LV_DITHER_GRADIENT + */ +enum { + LV_DITHER_NONE, /**< No dithering, colors are just quantized to the output resolution*/ + LV_DITHER_ORDERED, /**< Ordered dithering. Faster to compute and use less memory but lower quality*/ + LV_DITHER_ERR_DIFF, /**< Error diffusion mode. Slower to compute and use more memory but give highest dither quality*/ +}; + +typedef uint8_t lv_dither_mode_t; /** A gradient stop definition. * This matches a color and a position in a virtual 0-255 scale. */ typedef struct { lv_color_t color; /**< The stop color */ - lv_opa_t opa; /**< The opacity of the color*/ uint8_t frac; /**< The stop position in 1/255 unit */ } lv_gradient_stop_t; /** A descriptor of a gradient. */ typedef struct { - lv_gradient_stop_t stops[LV_GRADIENT_MAX_STOPS]; /**< A gradient stop array */ - uint8_t stops_count; /**< The number of used stops in the array */ - lv_grad_dir_t dir : 3; /**< The gradient direction. - * Any of LV_GRAD_DIR_NONE, LV_GRAD_DIR_VER, LV_GRAD_DIR_HOR, - * LV_GRAD_TYPE_LINEAR, LV_GRAD_TYPE_RADIAL, LV_GRAD_TYPE_CONICAL */ - lv_grad_extend_t extend : 2; /**< Behaviour outside the defined range. - * LV_GRAD_EXTEND_NONE, LV_GRAD_EXTEND_PAD, LV_GRAD_EXTEND_REPEAT, LV_GRAD_EXTEND_REFLECT */ -#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS - union { - /*Linear gradient parameters*/ - struct { - lv_point_t start; /**< Linear gradient vector start point */ - lv_point_t end; /**< Linear gradient vector end point */ - } linear; - /*Radial gradient parameters*/ - struct { - lv_point_t focal; /**< Center of the focal (starting) circle in local coordinates */ - /* (can be the same as the ending circle to create concentric circles) */ - lv_point_t focal_extent; /**< Point on the circle (can be the same as the center) */ - lv_point_t end; /**< Center of the ending circle in local coordinates */ - lv_point_t end_extent; /**< Point on the circle determining the radius of the gradient */ - } radial; - /*Conical gradient parameters*/ - struct { - lv_point_t center; /**< Conical gradient center point */ - int16_t start_angle; /**< Start angle 0..3600 */ - int16_t end_angle; /**< End angle 0..3600 */ - } conical; - } params; - void * state; -#endif + lv_gradient_stop_t stops[LV_GRADIENT_MAX_STOPS]; /**< A gradient stop array */ + uint8_t stops_count; /**< The number of used stops in the array */ + lv_grad_dir_t dir : 3; /**< The gradient direction. + * Any of LV_GRAD_DIR_HOR, LV_GRAD_DIR_VER, LV_GRAD_DIR_NONE */ + lv_dither_mode_t dither : 3; /**< Whether to dither the gradient or not. + * Any of LV_DITHER_NONE, LV_DITHER_ORDERED, LV_DITHER_ERR_DIFF */ } lv_grad_dsc_t; /** @@ -185,170 +175,132 @@ typedef union { * * Props are split into groups of 16. When adding a new prop to a group, ensure it does not overflow into the next one. */ -enum { +typedef enum { LV_STYLE_PROP_INV = 0, /*Group 0*/ LV_STYLE_WIDTH = 1, - LV_STYLE_HEIGHT = 2, - LV_STYLE_LENGTH = 3, - - LV_STYLE_MIN_WIDTH = 4, - LV_STYLE_MAX_WIDTH = 5, - LV_STYLE_MIN_HEIGHT = 6, - LV_STYLE_MAX_HEIGHT = 7, - - LV_STYLE_X = 8, - LV_STYLE_Y = 9, - LV_STYLE_ALIGN = 10, - - LV_STYLE_RADIUS = 12, + LV_STYLE_MIN_WIDTH = 2, + LV_STYLE_MAX_WIDTH = 3, + LV_STYLE_HEIGHT = 4, + LV_STYLE_MIN_HEIGHT = 5, + LV_STYLE_MAX_HEIGHT = 6, + LV_STYLE_X = 7, + LV_STYLE_Y = 8, + LV_STYLE_ALIGN = 9, + LV_STYLE_LAYOUT = 10, + LV_STYLE_RADIUS = 11, /*Group 1*/ LV_STYLE_PAD_TOP = 16, LV_STYLE_PAD_BOTTOM = 17, LV_STYLE_PAD_LEFT = 18, LV_STYLE_PAD_RIGHT = 19, - LV_STYLE_PAD_ROW = 20, LV_STYLE_PAD_COLUMN = 21, - LV_STYLE_LAYOUT = 22, - - LV_STYLE_MARGIN_TOP = 24, - LV_STYLE_MARGIN_BOTTOM = 25, - LV_STYLE_MARGIN_LEFT = 26, - LV_STYLE_MARGIN_RIGHT = 27, + LV_STYLE_BASE_DIR = 22, + LV_STYLE_CLIP_CORNER = 23, /*Group 2*/ - LV_STYLE_BG_COLOR = 28, - LV_STYLE_BG_OPA = 29, - - LV_STYLE_BG_GRAD_DIR = 32, - LV_STYLE_BG_MAIN_STOP = 33, - LV_STYLE_BG_GRAD_STOP = 34, - LV_STYLE_BG_GRAD_COLOR = 35, - - LV_STYLE_BG_MAIN_OPA = 36, - LV_STYLE_BG_GRAD_OPA = 37, + LV_STYLE_BG_COLOR = 32, + LV_STYLE_BG_OPA = 33, + LV_STYLE_BG_GRAD_COLOR = 34, + LV_STYLE_BG_GRAD_DIR = 35, + LV_STYLE_BG_MAIN_STOP = 36, + LV_STYLE_BG_GRAD_STOP = 37, LV_STYLE_BG_GRAD = 38, - LV_STYLE_BASE_DIR = 39, - - LV_STYLE_BG_IMAGE_SRC = 40, - LV_STYLE_BG_IMAGE_OPA = 41, - LV_STYLE_BG_IMAGE_RECOLOR = 42, - LV_STYLE_BG_IMAGE_RECOLOR_OPA = 43, - - LV_STYLE_BG_IMAGE_TILED = 44, - LV_STYLE_CLIP_CORNER = 45, + LV_STYLE_BG_DITHER_MODE = 39, + LV_STYLE_BG_IMG_SRC = 40, + LV_STYLE_BG_IMG_OPA = 41, + LV_STYLE_BG_IMG_RECOLOR = 42, + LV_STYLE_BG_IMG_RECOLOR_OPA = 43, + LV_STYLE_BG_IMG_TILED = 44, /*Group 3*/ - LV_STYLE_BORDER_WIDTH = 48, - LV_STYLE_BORDER_COLOR = 49, - LV_STYLE_BORDER_OPA = 50, - - LV_STYLE_BORDER_SIDE = 52, - LV_STYLE_BORDER_POST = 53, - - LV_STYLE_OUTLINE_WIDTH = 56, - LV_STYLE_OUTLINE_COLOR = 57, - LV_STYLE_OUTLINE_OPA = 58, - LV_STYLE_OUTLINE_PAD = 59, + LV_STYLE_BORDER_COLOR = 48, + LV_STYLE_BORDER_OPA = 49, + LV_STYLE_BORDER_WIDTH = 50, + LV_STYLE_BORDER_SIDE = 51, + LV_STYLE_BORDER_POST = 52, + LV_STYLE_OUTLINE_WIDTH = 53, + LV_STYLE_OUTLINE_COLOR = 54, + LV_STYLE_OUTLINE_OPA = 55, + LV_STYLE_OUTLINE_PAD = 56, /*Group 4*/ - LV_STYLE_SHADOW_WIDTH = 60, - LV_STYLE_SHADOW_COLOR = 61, - LV_STYLE_SHADOW_OPA = 62, - - LV_STYLE_SHADOW_OFFSET_X = 64, - LV_STYLE_SHADOW_OFFSET_Y = 65, - LV_STYLE_SHADOW_SPREAD = 66, - - LV_STYLE_IMAGE_OPA = 68, - LV_STYLE_IMAGE_RECOLOR = 69, - LV_STYLE_IMAGE_RECOLOR_OPA = 70, - - LV_STYLE_LINE_WIDTH = 72, - LV_STYLE_LINE_DASH_WIDTH = 73, - LV_STYLE_LINE_DASH_GAP = 74, - LV_STYLE_LINE_ROUNDED = 75, - LV_STYLE_LINE_COLOR = 76, - LV_STYLE_LINE_OPA = 77, + LV_STYLE_SHADOW_WIDTH = 64, + LV_STYLE_SHADOW_OFS_X = 65, + LV_STYLE_SHADOW_OFS_Y = 66, + LV_STYLE_SHADOW_SPREAD = 67, + LV_STYLE_SHADOW_COLOR = 68, + LV_STYLE_SHADOW_OPA = 69, + LV_STYLE_IMG_OPA = 70, + LV_STYLE_IMG_RECOLOR = 71, + LV_STYLE_IMG_RECOLOR_OPA = 72, + LV_STYLE_LINE_WIDTH = 73, + LV_STYLE_LINE_DASH_WIDTH = 74, + LV_STYLE_LINE_DASH_GAP = 75, + LV_STYLE_LINE_ROUNDED = 76, + LV_STYLE_LINE_COLOR = 77, + LV_STYLE_LINE_OPA = 78, /*Group 5*/ LV_STYLE_ARC_WIDTH = 80, LV_STYLE_ARC_ROUNDED = 81, LV_STYLE_ARC_COLOR = 82, LV_STYLE_ARC_OPA = 83, - LV_STYLE_ARC_IMAGE_SRC = 84, - - LV_STYLE_TEXT_COLOR = 88, - LV_STYLE_TEXT_OPA = 89, - LV_STYLE_TEXT_FONT = 90, - - LV_STYLE_TEXT_LETTER_SPACE = 91, - LV_STYLE_TEXT_LINE_SPACE = 92, - LV_STYLE_TEXT_DECOR = 93, - LV_STYLE_TEXT_ALIGN = 94, - - LV_STYLE_OPA = 95, - LV_STYLE_OPA_LAYERED = 96, - LV_STYLE_COLOR_FILTER_DSC = 97, - LV_STYLE_COLOR_FILTER_OPA = 98, - LV_STYLE_ANIM = 99, - LV_STYLE_ANIM_DURATION = 100, - LV_STYLE_TRANSITION = 102, - LV_STYLE_BLEND_MODE = 103, - LV_STYLE_TRANSFORM_WIDTH = 104, - LV_STYLE_TRANSFORM_HEIGHT = 105, - LV_STYLE_TRANSLATE_X = 106, - LV_STYLE_TRANSLATE_Y = 107, - LV_STYLE_TRANSFORM_SCALE_X = 108, - LV_STYLE_TRANSFORM_SCALE_Y = 109, - LV_STYLE_TRANSFORM_ROTATION = 110, + LV_STYLE_ARC_IMG_SRC = 84, + LV_STYLE_TEXT_COLOR = 85, + LV_STYLE_TEXT_OPA = 86, + LV_STYLE_TEXT_FONT = 87, + LV_STYLE_TEXT_LETTER_SPACE = 88, + LV_STYLE_TEXT_LINE_SPACE = 89, + LV_STYLE_TEXT_DECOR = 90, + LV_STYLE_TEXT_ALIGN = 91, + + /*Group 6*/ + LV_STYLE_OPA = 96, + LV_STYLE_OPA_LAYERED = 97, + LV_STYLE_COLOR_FILTER_DSC = 98, + LV_STYLE_COLOR_FILTER_OPA = 99, + LV_STYLE_ANIM = 100, + LV_STYLE_ANIM_TIME = 101, + LV_STYLE_ANIM_SPEED = 102, + LV_STYLE_TRANSITION = 103, + LV_STYLE_BLEND_MODE = 104, + LV_STYLE_TRANSFORM_WIDTH = 105, + LV_STYLE_TRANSFORM_HEIGHT = 106, + LV_STYLE_TRANSLATE_X = 107, + LV_STYLE_TRANSLATE_Y = 108, + LV_STYLE_TRANSFORM_ZOOM = 109, + LV_STYLE_TRANSFORM_ANGLE = 110, LV_STYLE_TRANSFORM_PIVOT_X = 111, LV_STYLE_TRANSFORM_PIVOT_Y = 112, - LV_STYLE_TRANSFORM_SKEW_X = 113, - LV_STYLE_TRANSFORM_SKEW_Y = 114, - LV_STYLE_BITMAP_MASK_SRC = 115, - LV_STYLE_ROTARY_SENSITIVITY = 116, - - LV_STYLE_FLEX_FLOW = 125, - LV_STYLE_FLEX_MAIN_PLACE = 126, - LV_STYLE_FLEX_CROSS_PLACE = 127, - LV_STYLE_FLEX_TRACK_PLACE = 128, - LV_STYLE_FLEX_GROW = 129, - - LV_STYLE_GRID_COLUMN_ALIGN = 130, - LV_STYLE_GRID_ROW_ALIGN = 131, - LV_STYLE_GRID_ROW_DSC_ARRAY = 132, - LV_STYLE_GRID_COLUMN_DSC_ARRAY = 133, - LV_STYLE_GRID_CELL_COLUMN_POS = 134, - LV_STYLE_GRID_CELL_COLUMN_SPAN = 135, - LV_STYLE_GRID_CELL_X_ALIGN = 136, - LV_STYLE_GRID_CELL_ROW_POS = 137, - LV_STYLE_GRID_CELL_ROW_SPAN = 138, - LV_STYLE_GRID_CELL_Y_ALIGN = 139, - - LV_STYLE_LAST_BUILT_IN_PROP = 140, - - LV_STYLE_NUM_BUILT_IN_PROPS = LV_STYLE_LAST_BUILT_IN_PROP + 1, - - LV_STYLE_PROP_ANY = 0xFF, - LV_STYLE_PROP_CONST = 0xFF /* magic value for const styles */ -}; -typedef enum { + _LV_STYLE_LAST_BUILT_IN_PROP = 112, + _LV_STYLE_NUM_BUILT_IN_PROPS = _LV_STYLE_LAST_BUILT_IN_PROP + 1, + + LV_STYLE_PROP_ANY = 0xFFFF, + _LV_STYLE_PROP_CONST = 0xFFFF /* magic value for const styles */ +} lv_style_prop_t; + +enum { LV_STYLE_RES_NOT_FOUND, LV_STYLE_RES_FOUND, -} lv_style_res_t; + LV_STYLE_RES_INHERIT +}; + +typedef uint8_t lv_style_res_t; /** * Descriptor for style transitions */ typedef struct { const lv_style_prop_t * props; /**< An array with the properties to animate.*/ +#if LV_USE_USER_DATA void * user_data; /**< A custom user data that will be passed to the animation's user_data */ - lv_anim_path_cb_t path_xcb; /**< A path for the animation.*/ +#endif + lv_anim_path_cb_t path_xcb; /**< A path for the animation.*/ uint32_t time; /**< Duration of the transition in [ms]*/ uint32_t delay; /**< Delay before the transition in [ms]*/ } lv_style_transition_dsc_t; @@ -370,16 +322,24 @@ typedef struct { uint32_t sentinel; #endif - void * values_and_props; - - uint32_t has_group; - uint8_t prop_cnt; /**< 255 means it's a constant style*/ + /*If there is only one property store it directly. + *For more properties allocate an array*/ + union { + lv_style_value_t value1; + uint8_t * values_and_props; + const lv_style_const_prop_t * const_props; + } v_p; + + uint16_t prop1; + uint8_t has_group; + uint8_t prop_cnt; } lv_style_t; /********************** * GLOBAL PROTOTYPES **********************/ + /** * Initialize a style * @param style pointer to a style to initialize @@ -395,23 +355,10 @@ void lv_style_init(lv_style_t * style); */ void lv_style_reset(lv_style_t * style); -/** - * Check if a style is constant - * @param style pointer to a style - * @return true: the style is constant - */ -static inline bool lv_style_is_const(const lv_style_t * style) -{ - if(style->prop_cnt == 255) return true; - return false; -} - /** * Register a new style property for custom usage * @return a new property ID, or LV_STYLE_PROP_INV if there are no more available. - * - * Example: - * @code + * @example * lv_style_prop_t MY_PROP; * static inline void lv_style_set_my_prop(lv_style_t * style, lv_color_t value) { * lv_style_value_t v = {.color = value}; lv_style_set_prop(style, MY_PROP, v); } @@ -420,7 +367,6 @@ static inline bool lv_style_is_const(const lv_style_t * style) * MY_PROP = lv_style_register_prop(); * ... * lv_style_set_my_prop(&style1, lv_palette_main(LV_PALETTE_RED)); - * @endcode */ lv_style_prop_t lv_style_register_prop(uint8_t flag); @@ -447,13 +393,22 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop); */ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_t value); +/** + * Set a special meta state for a property in a style. + * This function shouldn't be used directly by the user. + * @param style pointer to style + * @param prop the ID of a property (e.g. `LV_STYLE_BG_COLOR`) + * @param meta the meta value to attach to the property in the style + */ +void lv_style_set_prop_meta(lv_style_t * style, lv_style_prop_t prop, uint16_t meta); + /** * Get the value of a property * @param style pointer to a style * @param prop the ID of a property * @param value pointer to a `lv_style_value_t` variable to store the value - * @return LV_RESULT_INVALID: the property wasn't found in the style (`value` is unchanged) - * LV_RESULT_OK: the property was fond, and `value` is set accordingly + * @return LV_RES_INV: the property wasn't found in the style (`value` is unchanged) + * LV_RES_OK: the property was fond, and `value` is set accordingly * @note For performance reasons there are no sanity check on `style` */ lv_style_res_t lv_style_get_prop(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value); @@ -466,13 +421,10 @@ lv_style_res_t lv_style_get_prop(const lv_style_t * style, lv_style_prop_t prop, * @param time duration of the transition in [ms] * @param delay delay before the transition in [ms] * @param user_data any custom data that will be saved in the transition animation and will be available when `path_cb` is called - * - * Example: - * @code + * @example * const static lv_style_prop_t trans_props[] = { LV_STYLE_BG_OPA, LV_STYLE_BG_COLOR, 0 }; - * static lv_style_transition_dsc_t trans1; - * lv_style_transition_dsc_init(&trans1, trans_props, NULL, 300, 0, NULL); - * @endcode + * static lv_style_transition_dsc_t trans1; + * lv_style_transition_dsc_init(&trans1, trans_props, NULL, 300, 0, NULL); */ void lv_style_transition_dsc_init(lv_style_transition_dsc_t * tr, const lv_style_prop_t props[], lv_anim_path_cb_t path_cb, uint32_t time, uint32_t delay, void * user_data); @@ -489,35 +441,58 @@ lv_style_value_t lv_style_prop_get_default(lv_style_prop_t prop); * @param style pointer to a style * @param prop the ID of a property * @param value pointer to a `lv_style_value_t` variable to store the value - * @return LV_RESULT_INVALID: the property wasn't found in the style (`value` is unchanged) - * LV_RESULT_OK: the property was fond, and `value` is set accordingly + * @return LV_RES_INV: the property wasn't found in the style (`value` is unchanged) + * LV_RES_OK: the property was fond, and `value` is set accordingly * @note For performance reasons there are no sanity check on `style` * @note This function is the same as ::lv_style_get_prop but inlined. Use it only on performance critical places */ static inline lv_style_res_t lv_style_get_prop_inlined(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value) { - if(lv_style_is_const(style)) { - lv_style_const_prop_t * props = (lv_style_const_prop_t *)style->values_and_props; + if(style->prop1 == LV_STYLE_PROP_ANY) { + const lv_style_const_prop_t * const_prop; uint32_t i; - for(i = 0; props[i].prop != LV_STYLE_PROP_INV; i++) { - if(props[i].prop == prop) { - *value = props[i].value; + for(i = 0; i < style->prop_cnt; i++) { + const_prop = style->v_p.const_props + i; + lv_style_prop_t prop_id = LV_STYLE_PROP_ID_MASK(const_prop->prop); + if(prop_id == prop) { + if(const_prop->prop & LV_STYLE_PROP_META_INHERIT) + return LV_STYLE_RES_INHERIT; + *value = (const_prop->prop & LV_STYLE_PROP_META_INITIAL) ? lv_style_prop_get_default(prop_id) : const_prop->value; return LV_STYLE_RES_FOUND; } } + return LV_STYLE_RES_NOT_FOUND; } - else { - lv_style_prop_t * props = (lv_style_prop_t *)style->values_and_props + style->prop_cnt * sizeof(lv_style_value_t); + + if(style->prop_cnt == 0) return LV_STYLE_RES_NOT_FOUND; + + if(style->prop_cnt > 1) { + uint8_t * tmp = style->v_p.values_and_props + style->prop_cnt * sizeof(lv_style_value_t); + uint16_t * props = (uint16_t *)tmp; uint32_t i; for(i = 0; i < style->prop_cnt; i++) { - if(props[i] == prop) { - lv_style_value_t * values = (lv_style_value_t *)style->values_and_props; - *value = values[i]; + lv_style_prop_t prop_id = LV_STYLE_PROP_ID_MASK(props[i]); + if(prop_id == prop) { + if(props[i] & LV_STYLE_PROP_META_INHERIT) + return LV_STYLE_RES_INHERIT; + if(props[i] & LV_STYLE_PROP_META_INITIAL) + *value = lv_style_prop_get_default(prop_id); + else { + lv_style_value_t * values = (lv_style_value_t *)style->v_p.values_and_props; + *value = values[i]; + } return LV_STYLE_RES_FOUND; } } } + else if(LV_STYLE_PROP_ID_MASK(style->prop1) == prop) { + if(style->prop1 & LV_STYLE_PROP_META_INHERIT) + return LV_STYLE_RES_INHERIT; + *value = (style->prop1 & LV_STYLE_PROP_META_INITIAL) ? lv_style_prop_get_default(LV_STYLE_PROP_ID_MASK( + style->prop1)) : style->v_p.value1; + return LV_STYLE_RES_FOUND; + } return LV_STYLE_RES_NOT_FOUND; } @@ -532,15 +507,9 @@ bool lv_style_is_empty(const lv_style_t * style); * Tell the group of a property. If the a property from a group is set in a style the (1 << group) bit of style->has_group is set. * It allows early skipping the style if the property is not exists in the style at all. * @param prop a style property - * @return the group [0..30] 30 means all the custom properties with index > 120 + * @return the group [0..7] 7 means all the custom properties with index > 112 */ -static inline uint32_t lv_style_get_prop_group(lv_style_prop_t prop) -{ - uint32_t group = prop >> 2; - if(group > 30) group = 31; /*The MSB marks all the custom properties*/ - return group; - -} +uint8_t _lv_style_get_prop_group(lv_style_prop_t prop); /** * Get the flags of a built-in or custom property. @@ -548,17 +517,17 @@ static inline uint32_t lv_style_get_prop_group(lv_style_prop_t prop) * @param prop a style property * @return the flags of the property */ -uint8_t lv_style_prop_lookup_flags(lv_style_prop_t prop); +uint8_t _lv_style_prop_lookup_flags(lv_style_prop_t prop); #include "lv_style_gen.h" -static inline void lv_style_set_size(lv_style_t * style, int32_t width, int32_t height) +static inline void lv_style_set_size(lv_style_t * style, lv_coord_t value) { - lv_style_set_width(style, width); - lv_style_set_height(style, height); + lv_style_set_width(style, value); + lv_style_set_height(style, value); } -static inline void lv_style_set_pad_all(lv_style_t * style, int32_t value) +static inline void lv_style_set_pad_all(lv_style_t * style, lv_coord_t value) { lv_style_set_pad_left(style, value); lv_style_set_pad_right(style, value); @@ -566,30 +535,24 @@ static inline void lv_style_set_pad_all(lv_style_t * style, int32_t value) lv_style_set_pad_bottom(style, value); } -static inline void lv_style_set_pad_hor(lv_style_t * style, int32_t value) +static inline void lv_style_set_pad_hor(lv_style_t * style, lv_coord_t value) { lv_style_set_pad_left(style, value); lv_style_set_pad_right(style, value); } -static inline void lv_style_set_pad_ver(lv_style_t * style, int32_t value) +static inline void lv_style_set_pad_ver(lv_style_t * style, lv_coord_t value) { lv_style_set_pad_top(style, value); lv_style_set_pad_bottom(style, value); } -static inline void lv_style_set_pad_gap(lv_style_t * style, int32_t value) +static inline void lv_style_set_pad_gap(lv_style_t * style, lv_coord_t value) { lv_style_set_pad_row(style, value); lv_style_set_pad_column(style, value); } -static inline void lv_style_set_transform_scale(lv_style_t * style, int32_t value) -{ - lv_style_set_transform_scale_x(style, value); - lv_style_set_transform_scale_y(style, value); -} - /** * @brief Check if the style property has a specified behavioral flag. * @@ -602,15 +565,13 @@ static inline void lv_style_set_transform_scale(lv_style_t * style, int32_t valu */ static inline bool lv_style_prop_has_flag(lv_style_prop_t prop, uint8_t flag) { - return lv_style_prop_lookup_flags(prop) & flag; + return _lv_style_prop_lookup_flags(prop) & flag; } /************************* * GLOBAL VARIABLES *************************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_style_prop_t lv_style_const_prop_id_inv; - /********************** * MACROS **********************/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_style_gen.c b/L3_Middlewares/LVGL/src/misc/lv_style_gen.c index 233cf7b..0b8479d 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_style_gen.c +++ b/L3_Middlewares/LVGL/src/misc/lv_style_gen.c @@ -1,16 +1,6 @@ - -/* - ********************************************************************** - * DO NOT EDIT - * This file is automatically generated by "style_api_gen.py" - ********************************************************************** - */ - - #include "lv_style.h" - -void lv_style_set_width(lv_style_t * style, int32_t value) +void lv_style_set_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -18,7 +8,7 @@ void lv_style_set_width(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_WIDTH, v); } -void lv_style_set_min_width(lv_style_t * style, int32_t value) +void lv_style_set_min_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -26,7 +16,7 @@ void lv_style_set_min_width(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_MIN_WIDTH, v); } -void lv_style_set_max_width(lv_style_t * style, int32_t value) +void lv_style_set_max_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -34,7 +24,7 @@ void lv_style_set_max_width(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_MAX_WIDTH, v); } -void lv_style_set_height(lv_style_t * style, int32_t value) +void lv_style_set_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -42,7 +32,7 @@ void lv_style_set_height(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_HEIGHT, v); } -void lv_style_set_min_height(lv_style_t * style, int32_t value) +void lv_style_set_min_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -50,7 +40,7 @@ void lv_style_set_min_height(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_MIN_HEIGHT, v); } -void lv_style_set_max_height(lv_style_t * style, int32_t value) +void lv_style_set_max_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -58,15 +48,7 @@ void lv_style_set_max_height(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_MAX_HEIGHT, v); } -void lv_style_set_length(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_LENGTH, v); -} - -void lv_style_set_x(lv_style_t * style, int32_t value) +void lv_style_set_x(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -74,7 +56,7 @@ void lv_style_set_x(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_X, v); } -void lv_style_set_y(lv_style_t * style, int32_t value) +void lv_style_set_y(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -90,7 +72,7 @@ void lv_style_set_align(lv_style_t * style, lv_align_t value) lv_style_set_prop(style, LV_STYLE_ALIGN, v); } -void lv_style_set_transform_width(lv_style_t * style, int32_t value) +void lv_style_set_transform_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -98,7 +80,7 @@ void lv_style_set_transform_width(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_TRANSFORM_WIDTH, v); } -void lv_style_set_transform_height(lv_style_t * style, int32_t value) +void lv_style_set_transform_height(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -106,7 +88,7 @@ void lv_style_set_transform_height(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_TRANSFORM_HEIGHT, v); } -void lv_style_set_translate_x(lv_style_t * style, int32_t value) +void lv_style_set_translate_x(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -114,7 +96,7 @@ void lv_style_set_translate_x(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_TRANSLATE_X, v); } -void lv_style_set_translate_y(lv_style_t * style, int32_t value) +void lv_style_set_translate_y(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -122,31 +104,23 @@ void lv_style_set_translate_y(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_TRANSLATE_Y, v); } -void lv_style_set_transform_scale_x(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_TRANSFORM_SCALE_X, v); -} - -void lv_style_set_transform_scale_y(lv_style_t * style, int32_t value) +void lv_style_set_transform_zoom(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value }; - lv_style_set_prop(style, LV_STYLE_TRANSFORM_SCALE_Y, v); + lv_style_set_prop(style, LV_STYLE_TRANSFORM_ZOOM, v); } -void lv_style_set_transform_rotation(lv_style_t * style, int32_t value) +void lv_style_set_transform_angle(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value }; - lv_style_set_prop(style, LV_STYLE_TRANSFORM_ROTATION, v); + lv_style_set_prop(style, LV_STYLE_TRANSFORM_ANGLE, v); } -void lv_style_set_transform_pivot_x(lv_style_t * style, int32_t value) +void lv_style_set_transform_pivot_x(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -154,7 +128,7 @@ void lv_style_set_transform_pivot_x(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_TRANSFORM_PIVOT_X, v); } -void lv_style_set_transform_pivot_y(lv_style_t * style, int32_t value) +void lv_style_set_transform_pivot_y(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -162,23 +136,7 @@ void lv_style_set_transform_pivot_y(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_TRANSFORM_PIVOT_Y, v); } -void lv_style_set_transform_skew_x(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_TRANSFORM_SKEW_X, v); -} - -void lv_style_set_transform_skew_y(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_TRANSFORM_SKEW_Y, v); -} - -void lv_style_set_pad_top(lv_style_t * style, int32_t value) +void lv_style_set_pad_top(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -186,7 +144,7 @@ void lv_style_set_pad_top(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_PAD_TOP, v); } -void lv_style_set_pad_bottom(lv_style_t * style, int32_t value) +void lv_style_set_pad_bottom(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -194,7 +152,7 @@ void lv_style_set_pad_bottom(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_PAD_BOTTOM, v); } -void lv_style_set_pad_left(lv_style_t * style, int32_t value) +void lv_style_set_pad_left(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -202,7 +160,7 @@ void lv_style_set_pad_left(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_PAD_LEFT, v); } -void lv_style_set_pad_right(lv_style_t * style, int32_t value) +void lv_style_set_pad_right(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -210,7 +168,7 @@ void lv_style_set_pad_right(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_PAD_RIGHT, v); } -void lv_style_set_pad_row(lv_style_t * style, int32_t value) +void lv_style_set_pad_row(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -218,7 +176,7 @@ void lv_style_set_pad_row(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_PAD_ROW, v); } -void lv_style_set_pad_column(lv_style_t * style, int32_t value) +void lv_style_set_pad_column(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -226,38 +184,6 @@ void lv_style_set_pad_column(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_PAD_COLUMN, v); } -void lv_style_set_margin_top(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_MARGIN_TOP, v); -} - -void lv_style_set_margin_bottom(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_MARGIN_BOTTOM, v); -} - -void lv_style_set_margin_left(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_MARGIN_LEFT, v); -} - -void lv_style_set_margin_right(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_MARGIN_RIGHT, v); -} - void lv_style_set_bg_color(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { @@ -290,7 +216,7 @@ void lv_style_set_bg_grad_dir(lv_style_t * style, lv_grad_dir_t value) lv_style_set_prop(style, LV_STYLE_BG_GRAD_DIR, v); } -void lv_style_set_bg_main_stop(lv_style_t * style, int32_t value) +void lv_style_set_bg_main_stop(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -298,7 +224,7 @@ void lv_style_set_bg_main_stop(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_BG_MAIN_STOP, v); } -void lv_style_set_bg_grad_stop(lv_style_t * style, int32_t value) +void lv_style_set_bg_grad_stop(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -306,68 +232,60 @@ void lv_style_set_bg_grad_stop(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_BG_GRAD_STOP, v); } -void lv_style_set_bg_main_opa(lv_style_t * style, lv_opa_t value) +void lv_style_set_bg_grad(lv_style_t * style, const lv_grad_dsc_t * value) { lv_style_value_t v = { - .num = (int32_t)value + .ptr = value }; - lv_style_set_prop(style, LV_STYLE_BG_MAIN_OPA, v); + lv_style_set_prop(style, LV_STYLE_BG_GRAD, v); } -void lv_style_set_bg_grad_opa(lv_style_t * style, lv_opa_t value) +void lv_style_set_bg_dither_mode(lv_style_t * style, lv_dither_mode_t value) { lv_style_value_t v = { .num = (int32_t)value }; - lv_style_set_prop(style, LV_STYLE_BG_GRAD_OPA, v); + lv_style_set_prop(style, LV_STYLE_BG_DITHER_MODE, v); } -void lv_style_set_bg_grad(lv_style_t * style, const lv_grad_dsc_t * value) +void lv_style_set_bg_img_src(lv_style_t * style, const void * value) { lv_style_value_t v = { .ptr = value }; - lv_style_set_prop(style, LV_STYLE_BG_GRAD, v); + lv_style_set_prop(style, LV_STYLE_BG_IMG_SRC, v); } -void lv_style_set_bg_image_src(lv_style_t * style, const void * value) -{ - lv_style_value_t v = { - .ptr = value - }; - lv_style_set_prop(style, LV_STYLE_BG_IMAGE_SRC, v); -} - -void lv_style_set_bg_image_opa(lv_style_t * style, lv_opa_t value) +void lv_style_set_bg_img_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { .num = (int32_t)value }; - lv_style_set_prop(style, LV_STYLE_BG_IMAGE_OPA, v); + lv_style_set_prop(style, LV_STYLE_BG_IMG_OPA, v); } -void lv_style_set_bg_image_recolor(lv_style_t * style, lv_color_t value) +void lv_style_set_bg_img_recolor(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { .color = value }; - lv_style_set_prop(style, LV_STYLE_BG_IMAGE_RECOLOR, v); + lv_style_set_prop(style, LV_STYLE_BG_IMG_RECOLOR, v); } -void lv_style_set_bg_image_recolor_opa(lv_style_t * style, lv_opa_t value) +void lv_style_set_bg_img_recolor_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { .num = (int32_t)value }; - lv_style_set_prop(style, LV_STYLE_BG_IMAGE_RECOLOR_OPA, v); + lv_style_set_prop(style, LV_STYLE_BG_IMG_RECOLOR_OPA, v); } -void lv_style_set_bg_image_tiled(lv_style_t * style, bool value) +void lv_style_set_bg_img_tiled(lv_style_t * style, bool value) { lv_style_value_t v = { .num = (int32_t)value }; - lv_style_set_prop(style, LV_STYLE_BG_IMAGE_TILED, v); + lv_style_set_prop(style, LV_STYLE_BG_IMG_TILED, v); } void lv_style_set_border_color(lv_style_t * style, lv_color_t value) @@ -386,7 +304,7 @@ void lv_style_set_border_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_BORDER_OPA, v); } -void lv_style_set_border_width(lv_style_t * style, int32_t value) +void lv_style_set_border_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -410,7 +328,7 @@ void lv_style_set_border_post(lv_style_t * style, bool value) lv_style_set_prop(style, LV_STYLE_BORDER_POST, v); } -void lv_style_set_outline_width(lv_style_t * style, int32_t value) +void lv_style_set_outline_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -434,7 +352,7 @@ void lv_style_set_outline_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_OUTLINE_OPA, v); } -void lv_style_set_outline_pad(lv_style_t * style, int32_t value) +void lv_style_set_outline_pad(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -442,7 +360,7 @@ void lv_style_set_outline_pad(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_OUTLINE_PAD, v); } -void lv_style_set_shadow_width(lv_style_t * style, int32_t value) +void lv_style_set_shadow_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -450,23 +368,23 @@ void lv_style_set_shadow_width(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_SHADOW_WIDTH, v); } -void lv_style_set_shadow_offset_x(lv_style_t * style, int32_t value) +void lv_style_set_shadow_ofs_x(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value }; - lv_style_set_prop(style, LV_STYLE_SHADOW_OFFSET_X, v); + lv_style_set_prop(style, LV_STYLE_SHADOW_OFS_X, v); } -void lv_style_set_shadow_offset_y(lv_style_t * style, int32_t value) +void lv_style_set_shadow_ofs_y(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value }; - lv_style_set_prop(style, LV_STYLE_SHADOW_OFFSET_Y, v); + lv_style_set_prop(style, LV_STYLE_SHADOW_OFS_Y, v); } -void lv_style_set_shadow_spread(lv_style_t * style, int32_t value) +void lv_style_set_shadow_spread(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -490,31 +408,31 @@ void lv_style_set_shadow_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_SHADOW_OPA, v); } -void lv_style_set_image_opa(lv_style_t * style, lv_opa_t value) +void lv_style_set_img_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { .num = (int32_t)value }; - lv_style_set_prop(style, LV_STYLE_IMAGE_OPA, v); + lv_style_set_prop(style, LV_STYLE_IMG_OPA, v); } -void lv_style_set_image_recolor(lv_style_t * style, lv_color_t value) +void lv_style_set_img_recolor(lv_style_t * style, lv_color_t value) { lv_style_value_t v = { .color = value }; - lv_style_set_prop(style, LV_STYLE_IMAGE_RECOLOR, v); + lv_style_set_prop(style, LV_STYLE_IMG_RECOLOR, v); } -void lv_style_set_image_recolor_opa(lv_style_t * style, lv_opa_t value) +void lv_style_set_img_recolor_opa(lv_style_t * style, lv_opa_t value) { lv_style_value_t v = { .num = (int32_t)value }; - lv_style_set_prop(style, LV_STYLE_IMAGE_RECOLOR_OPA, v); + lv_style_set_prop(style, LV_STYLE_IMG_RECOLOR_OPA, v); } -void lv_style_set_line_width(lv_style_t * style, int32_t value) +void lv_style_set_line_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -522,7 +440,7 @@ void lv_style_set_line_width(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_LINE_WIDTH, v); } -void lv_style_set_line_dash_width(lv_style_t * style, int32_t value) +void lv_style_set_line_dash_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -530,7 +448,7 @@ void lv_style_set_line_dash_width(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_LINE_DASH_WIDTH, v); } -void lv_style_set_line_dash_gap(lv_style_t * style, int32_t value) +void lv_style_set_line_dash_gap(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -562,7 +480,7 @@ void lv_style_set_line_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_LINE_OPA, v); } -void lv_style_set_arc_width(lv_style_t * style, int32_t value) +void lv_style_set_arc_width(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -594,12 +512,12 @@ void lv_style_set_arc_opa(lv_style_t * style, lv_opa_t value) lv_style_set_prop(style, LV_STYLE_ARC_OPA, v); } -void lv_style_set_arc_image_src(lv_style_t * style, const void * value) +void lv_style_set_arc_img_src(lv_style_t * style, const void * value) { lv_style_value_t v = { .ptr = value }; - lv_style_set_prop(style, LV_STYLE_ARC_IMAGE_SRC, v); + lv_style_set_prop(style, LV_STYLE_ARC_IMG_SRC, v); } void lv_style_set_text_color(lv_style_t * style, lv_color_t value) @@ -626,7 +544,7 @@ void lv_style_set_text_font(lv_style_t * style, const lv_font_t * value) lv_style_set_prop(style, LV_STYLE_TEXT_FONT, v); } -void lv_style_set_text_letter_space(lv_style_t * style, int32_t value) +void lv_style_set_text_letter_space(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -634,7 +552,7 @@ void lv_style_set_text_letter_space(lv_style_t * style, int32_t value) lv_style_set_prop(style, LV_STYLE_TEXT_LETTER_SPACE, v); } -void lv_style_set_text_line_space(lv_style_t * style, int32_t value) +void lv_style_set_text_line_space(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -658,7 +576,7 @@ void lv_style_set_text_align(lv_style_t * style, lv_text_align_t value) lv_style_set_prop(style, LV_STYLE_TEXT_ALIGN, v); } -void lv_style_set_radius(lv_style_t * style, int32_t value) +void lv_style_set_radius(lv_style_t * style, lv_coord_t value) { lv_style_value_t v = { .num = (int32_t)value @@ -714,12 +632,20 @@ void lv_style_set_anim(lv_style_t * style, const lv_anim_t * value) lv_style_set_prop(style, LV_STYLE_ANIM, v); } -void lv_style_set_anim_duration(lv_style_t * style, uint32_t value) +void lv_style_set_anim_time(lv_style_t * style, uint32_t value) { lv_style_value_t v = { .num = (int32_t)value }; - lv_style_set_prop(style, LV_STYLE_ANIM_DURATION, v); + lv_style_set_prop(style, LV_STYLE_ANIM_TIME, v); +} + +void lv_style_set_anim_speed(lv_style_t * style, uint32_t value) +{ + lv_style_value_t v = { + .num = (int32_t)value + }; + lv_style_set_prop(style, LV_STYLE_ANIM_SPEED, v); } void lv_style_set_transition(lv_style_t * style, const lv_style_transition_dsc_t * value) @@ -753,145 +679,3 @@ void lv_style_set_base_dir(lv_style_t * style, lv_base_dir_t value) }; lv_style_set_prop(style, LV_STYLE_BASE_DIR, v); } - -void lv_style_set_bitmap_mask_src(lv_style_t * style, const void * value) -{ - lv_style_value_t v = { - .ptr = value - }; - lv_style_set_prop(style, LV_STYLE_BITMAP_MASK_SRC, v); -} - -void lv_style_set_rotary_sensitivity(lv_style_t * style, uint32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_ROTARY_SENSITIVITY, v); -} -#if LV_USE_FLEX - -void lv_style_set_flex_flow(lv_style_t * style, lv_flex_flow_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_FLEX_FLOW, v); -} - -void lv_style_set_flex_main_place(lv_style_t * style, lv_flex_align_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_FLEX_MAIN_PLACE, v); -} - -void lv_style_set_flex_cross_place(lv_style_t * style, lv_flex_align_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_FLEX_CROSS_PLACE, v); -} - -void lv_style_set_flex_track_place(lv_style_t * style, lv_flex_align_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_FLEX_TRACK_PLACE, v); -} - -void lv_style_set_flex_grow(lv_style_t * style, uint8_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_FLEX_GROW, v); -} -#endif /*LV_USE_FLEX*/ - -#if LV_USE_GRID - -void lv_style_set_grid_column_dsc_array(lv_style_t * style, const int32_t * value) -{ - lv_style_value_t v = { - .ptr = value - }; - lv_style_set_prop(style, LV_STYLE_GRID_COLUMN_DSC_ARRAY, v); -} - -void lv_style_set_grid_column_align(lv_style_t * style, lv_grid_align_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_GRID_COLUMN_ALIGN, v); -} - -void lv_style_set_grid_row_dsc_array(lv_style_t * style, const int32_t * value) -{ - lv_style_value_t v = { - .ptr = value - }; - lv_style_set_prop(style, LV_STYLE_GRID_ROW_DSC_ARRAY, v); -} - -void lv_style_set_grid_row_align(lv_style_t * style, lv_grid_align_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_GRID_ROW_ALIGN, v); -} - -void lv_style_set_grid_cell_column_pos(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_GRID_CELL_COLUMN_POS, v); -} - -void lv_style_set_grid_cell_x_align(lv_style_t * style, lv_grid_align_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_GRID_CELL_X_ALIGN, v); -} - -void lv_style_set_grid_cell_column_span(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_GRID_CELL_COLUMN_SPAN, v); -} - -void lv_style_set_grid_cell_row_pos(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_GRID_CELL_ROW_POS, v); -} - -void lv_style_set_grid_cell_y_align(lv_style_t * style, lv_grid_align_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_GRID_CELL_Y_ALIGN, v); -} - -void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value) -{ - lv_style_value_t v = { - .num = (int32_t)value - }; - lv_style_set_prop(style, LV_STYLE_GRID_CELL_ROW_SPAN, v); -} -#endif /*LV_USE_GRID*/ - diff --git a/L3_Middlewares/LVGL/src/misc/lv_style_gen.h b/L3_Middlewares/LVGL/src/misc/lv_style_gen.h index 5714e74..66ba068 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_style_gen.h +++ b/L3_Middlewares/LVGL/src/misc/lv_style_gen.h @@ -1,135 +1,88 @@ - -/* - ********************************************************************** - * DO NOT EDIT - * This file is automatically generated by "style_api_gen.py" - ********************************************************************** - */ - - -#ifndef LV_STYLE_GEN_H -#define LV_STYLE_GEN_H - -#ifdef __cplusplus -extern "C" { -#endif - -void lv_style_set_width(lv_style_t * style, int32_t value); -void lv_style_set_min_width(lv_style_t * style, int32_t value); -void lv_style_set_max_width(lv_style_t * style, int32_t value); -void lv_style_set_height(lv_style_t * style, int32_t value); -void lv_style_set_min_height(lv_style_t * style, int32_t value); -void lv_style_set_max_height(lv_style_t * style, int32_t value); -void lv_style_set_length(lv_style_t * style, int32_t value); -void lv_style_set_x(lv_style_t * style, int32_t value); -void lv_style_set_y(lv_style_t * style, int32_t value); +void lv_style_set_width(lv_style_t * style, lv_coord_t value); +void lv_style_set_min_width(lv_style_t * style, lv_coord_t value); +void lv_style_set_max_width(lv_style_t * style, lv_coord_t value); +void lv_style_set_height(lv_style_t * style, lv_coord_t value); +void lv_style_set_min_height(lv_style_t * style, lv_coord_t value); +void lv_style_set_max_height(lv_style_t * style, lv_coord_t value); +void lv_style_set_x(lv_style_t * style, lv_coord_t value); +void lv_style_set_y(lv_style_t * style, lv_coord_t value); void lv_style_set_align(lv_style_t * style, lv_align_t value); -void lv_style_set_transform_width(lv_style_t * style, int32_t value); -void lv_style_set_transform_height(lv_style_t * style, int32_t value); -void lv_style_set_translate_x(lv_style_t * style, int32_t value); -void lv_style_set_translate_y(lv_style_t * style, int32_t value); -void lv_style_set_transform_scale_x(lv_style_t * style, int32_t value); -void lv_style_set_transform_scale_y(lv_style_t * style, int32_t value); -void lv_style_set_transform_rotation(lv_style_t * style, int32_t value); -void lv_style_set_transform_pivot_x(lv_style_t * style, int32_t value); -void lv_style_set_transform_pivot_y(lv_style_t * style, int32_t value); -void lv_style_set_transform_skew_x(lv_style_t * style, int32_t value); -void lv_style_set_transform_skew_y(lv_style_t * style, int32_t value); -void lv_style_set_pad_top(lv_style_t * style, int32_t value); -void lv_style_set_pad_bottom(lv_style_t * style, int32_t value); -void lv_style_set_pad_left(lv_style_t * style, int32_t value); -void lv_style_set_pad_right(lv_style_t * style, int32_t value); -void lv_style_set_pad_row(lv_style_t * style, int32_t value); -void lv_style_set_pad_column(lv_style_t * style, int32_t value); -void lv_style_set_margin_top(lv_style_t * style, int32_t value); -void lv_style_set_margin_bottom(lv_style_t * style, int32_t value); -void lv_style_set_margin_left(lv_style_t * style, int32_t value); -void lv_style_set_margin_right(lv_style_t * style, int32_t value); +void lv_style_set_transform_width(lv_style_t * style, lv_coord_t value); +void lv_style_set_transform_height(lv_style_t * style, lv_coord_t value); +void lv_style_set_translate_x(lv_style_t * style, lv_coord_t value); +void lv_style_set_translate_y(lv_style_t * style, lv_coord_t value); +void lv_style_set_transform_zoom(lv_style_t * style, lv_coord_t value); +void lv_style_set_transform_angle(lv_style_t * style, lv_coord_t value); +void lv_style_set_transform_pivot_x(lv_style_t * style, lv_coord_t value); +void lv_style_set_transform_pivot_y(lv_style_t * style, lv_coord_t value); +void lv_style_set_pad_top(lv_style_t * style, lv_coord_t value); +void lv_style_set_pad_bottom(lv_style_t * style, lv_coord_t value); +void lv_style_set_pad_left(lv_style_t * style, lv_coord_t value); +void lv_style_set_pad_right(lv_style_t * style, lv_coord_t value); +void lv_style_set_pad_row(lv_style_t * style, lv_coord_t value); +void lv_style_set_pad_column(lv_style_t * style, lv_coord_t value); void lv_style_set_bg_color(lv_style_t * style, lv_color_t value); void lv_style_set_bg_opa(lv_style_t * style, lv_opa_t value); void lv_style_set_bg_grad_color(lv_style_t * style, lv_color_t value); void lv_style_set_bg_grad_dir(lv_style_t * style, lv_grad_dir_t value); -void lv_style_set_bg_main_stop(lv_style_t * style, int32_t value); -void lv_style_set_bg_grad_stop(lv_style_t * style, int32_t value); -void lv_style_set_bg_main_opa(lv_style_t * style, lv_opa_t value); -void lv_style_set_bg_grad_opa(lv_style_t * style, lv_opa_t value); +void lv_style_set_bg_main_stop(lv_style_t * style, lv_coord_t value); +void lv_style_set_bg_grad_stop(lv_style_t * style, lv_coord_t value); void lv_style_set_bg_grad(lv_style_t * style, const lv_grad_dsc_t * value); -void lv_style_set_bg_image_src(lv_style_t * style, const void * value); -void lv_style_set_bg_image_opa(lv_style_t * style, lv_opa_t value); -void lv_style_set_bg_image_recolor(lv_style_t * style, lv_color_t value); -void lv_style_set_bg_image_recolor_opa(lv_style_t * style, lv_opa_t value); -void lv_style_set_bg_image_tiled(lv_style_t * style, bool value); +void lv_style_set_bg_dither_mode(lv_style_t * style, lv_dither_mode_t value); +void lv_style_set_bg_img_src(lv_style_t * style, const void * value); +void lv_style_set_bg_img_opa(lv_style_t * style, lv_opa_t value); +void lv_style_set_bg_img_recolor(lv_style_t * style, lv_color_t value); +void lv_style_set_bg_img_recolor_opa(lv_style_t * style, lv_opa_t value); +void lv_style_set_bg_img_tiled(lv_style_t * style, bool value); void lv_style_set_border_color(lv_style_t * style, lv_color_t value); void lv_style_set_border_opa(lv_style_t * style, lv_opa_t value); -void lv_style_set_border_width(lv_style_t * style, int32_t value); +void lv_style_set_border_width(lv_style_t * style, lv_coord_t value); void lv_style_set_border_side(lv_style_t * style, lv_border_side_t value); void lv_style_set_border_post(lv_style_t * style, bool value); -void lv_style_set_outline_width(lv_style_t * style, int32_t value); +void lv_style_set_outline_width(lv_style_t * style, lv_coord_t value); void lv_style_set_outline_color(lv_style_t * style, lv_color_t value); void lv_style_set_outline_opa(lv_style_t * style, lv_opa_t value); -void lv_style_set_outline_pad(lv_style_t * style, int32_t value); -void lv_style_set_shadow_width(lv_style_t * style, int32_t value); -void lv_style_set_shadow_offset_x(lv_style_t * style, int32_t value); -void lv_style_set_shadow_offset_y(lv_style_t * style, int32_t value); -void lv_style_set_shadow_spread(lv_style_t * style, int32_t value); +void lv_style_set_outline_pad(lv_style_t * style, lv_coord_t value); +void lv_style_set_shadow_width(lv_style_t * style, lv_coord_t value); +void lv_style_set_shadow_ofs_x(lv_style_t * style, lv_coord_t value); +void lv_style_set_shadow_ofs_y(lv_style_t * style, lv_coord_t value); +void lv_style_set_shadow_spread(lv_style_t * style, lv_coord_t value); void lv_style_set_shadow_color(lv_style_t * style, lv_color_t value); void lv_style_set_shadow_opa(lv_style_t * style, lv_opa_t value); -void lv_style_set_image_opa(lv_style_t * style, lv_opa_t value); -void lv_style_set_image_recolor(lv_style_t * style, lv_color_t value); -void lv_style_set_image_recolor_opa(lv_style_t * style, lv_opa_t value); -void lv_style_set_line_width(lv_style_t * style, int32_t value); -void lv_style_set_line_dash_width(lv_style_t * style, int32_t value); -void lv_style_set_line_dash_gap(lv_style_t * style, int32_t value); +void lv_style_set_img_opa(lv_style_t * style, lv_opa_t value); +void lv_style_set_img_recolor(lv_style_t * style, lv_color_t value); +void lv_style_set_img_recolor_opa(lv_style_t * style, lv_opa_t value); +void lv_style_set_line_width(lv_style_t * style, lv_coord_t value); +void lv_style_set_line_dash_width(lv_style_t * style, lv_coord_t value); +void lv_style_set_line_dash_gap(lv_style_t * style, lv_coord_t value); void lv_style_set_line_rounded(lv_style_t * style, bool value); void lv_style_set_line_color(lv_style_t * style, lv_color_t value); void lv_style_set_line_opa(lv_style_t * style, lv_opa_t value); -void lv_style_set_arc_width(lv_style_t * style, int32_t value); +void lv_style_set_arc_width(lv_style_t * style, lv_coord_t value); void lv_style_set_arc_rounded(lv_style_t * style, bool value); void lv_style_set_arc_color(lv_style_t * style, lv_color_t value); void lv_style_set_arc_opa(lv_style_t * style, lv_opa_t value); -void lv_style_set_arc_image_src(lv_style_t * style, const void * value); +void lv_style_set_arc_img_src(lv_style_t * style, const void * value); void lv_style_set_text_color(lv_style_t * style, lv_color_t value); void lv_style_set_text_opa(lv_style_t * style, lv_opa_t value); void lv_style_set_text_font(lv_style_t * style, const lv_font_t * value); -void lv_style_set_text_letter_space(lv_style_t * style, int32_t value); -void lv_style_set_text_line_space(lv_style_t * style, int32_t value); +void lv_style_set_text_letter_space(lv_style_t * style, lv_coord_t value); +void lv_style_set_text_line_space(lv_style_t * style, lv_coord_t value); void lv_style_set_text_decor(lv_style_t * style, lv_text_decor_t value); void lv_style_set_text_align(lv_style_t * style, lv_text_align_t value); -void lv_style_set_radius(lv_style_t * style, int32_t value); +void lv_style_set_radius(lv_style_t * style, lv_coord_t value); void lv_style_set_clip_corner(lv_style_t * style, bool value); void lv_style_set_opa(lv_style_t * style, lv_opa_t value); void lv_style_set_opa_layered(lv_style_t * style, lv_opa_t value); void lv_style_set_color_filter_dsc(lv_style_t * style, const lv_color_filter_dsc_t * value); void lv_style_set_color_filter_opa(lv_style_t * style, lv_opa_t value); void lv_style_set_anim(lv_style_t * style, const lv_anim_t * value); -void lv_style_set_anim_duration(lv_style_t * style, uint32_t value); +void lv_style_set_anim_time(lv_style_t * style, uint32_t value); +void lv_style_set_anim_speed(lv_style_t * style, uint32_t value); void lv_style_set_transition(lv_style_t * style, const lv_style_transition_dsc_t * value); void lv_style_set_blend_mode(lv_style_t * style, lv_blend_mode_t value); void lv_style_set_layout(lv_style_t * style, uint16_t value); void lv_style_set_base_dir(lv_style_t * style, lv_base_dir_t value); -void lv_style_set_bitmap_mask_src(lv_style_t * style, const void * value); -void lv_style_set_rotary_sensitivity(lv_style_t * style, uint32_t value); -#if LV_USE_FLEX -void lv_style_set_flex_flow(lv_style_t * style, lv_flex_flow_t value); -void lv_style_set_flex_main_place(lv_style_t * style, lv_flex_align_t value); -void lv_style_set_flex_cross_place(lv_style_t * style, lv_flex_align_t value); -void lv_style_set_flex_track_place(lv_style_t * style, lv_flex_align_t value); -void lv_style_set_flex_grow(lv_style_t * style, uint8_t value); -#endif /*LV_USE_FLEX*/ - -#if LV_USE_GRID -void lv_style_set_grid_column_dsc_array(lv_style_t * style, const int32_t * value); -void lv_style_set_grid_column_align(lv_style_t * style, lv_grid_align_t value); -void lv_style_set_grid_row_dsc_array(lv_style_t * style, const int32_t * value); -void lv_style_set_grid_row_align(lv_style_t * style, lv_grid_align_t value); -void lv_style_set_grid_cell_column_pos(lv_style_t * style, int32_t value); -void lv_style_set_grid_cell_x_align(lv_style_t * style, lv_grid_align_t value); -void lv_style_set_grid_cell_column_span(lv_style_t * style, int32_t value); -void lv_style_set_grid_cell_row_pos(lv_style_t * style, int32_t value); -void lv_style_set_grid_cell_y_align(lv_style_t * style, lv_grid_align_t value); -void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value); -#endif /*LV_USE_GRID*/ - #define LV_STYLE_CONST_WIDTH(val) \ { \ @@ -161,11 +114,6 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value); .prop = LV_STYLE_MAX_HEIGHT, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_LENGTH(val) \ - { \ - .prop = LV_STYLE_LENGTH, .value = { .num = (int32_t)val } \ - } - #define LV_STYLE_CONST_X(val) \ { \ .prop = LV_STYLE_X, .value = { .num = (int32_t)val } \ @@ -201,19 +149,14 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value); .prop = LV_STYLE_TRANSLATE_Y, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_TRANSFORM_SCALE_X(val) \ - { \ - .prop = LV_STYLE_TRANSFORM_SCALE_X, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_TRANSFORM_SCALE_Y(val) \ +#define LV_STYLE_CONST_TRANSFORM_ZOOM(val) \ { \ - .prop = LV_STYLE_TRANSFORM_SCALE_Y, .value = { .num = (int32_t)val } \ + .prop = LV_STYLE_TRANSFORM_ZOOM, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_TRANSFORM_ROTATION(val) \ +#define LV_STYLE_CONST_TRANSFORM_ANGLE(val) \ { \ - .prop = LV_STYLE_TRANSFORM_ROTATION, .value = { .num = (int32_t)val } \ + .prop = LV_STYLE_TRANSFORM_ANGLE, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TRANSFORM_PIVOT_X(val) \ @@ -226,16 +169,6 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value); .prop = LV_STYLE_TRANSFORM_PIVOT_Y, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_TRANSFORM_SKEW_X(val) \ - { \ - .prop = LV_STYLE_TRANSFORM_SKEW_X, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_TRANSFORM_SKEW_Y(val) \ - { \ - .prop = LV_STYLE_TRANSFORM_SKEW_Y, .value = { .num = (int32_t)val } \ - } - #define LV_STYLE_CONST_PAD_TOP(val) \ { \ .prop = LV_STYLE_PAD_TOP, .value = { .num = (int32_t)val } \ @@ -266,26 +199,6 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value); .prop = LV_STYLE_PAD_COLUMN, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_MARGIN_TOP(val) \ - { \ - .prop = LV_STYLE_MARGIN_TOP, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_MARGIN_BOTTOM(val) \ - { \ - .prop = LV_STYLE_MARGIN_BOTTOM, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_MARGIN_LEFT(val) \ - { \ - .prop = LV_STYLE_MARGIN_LEFT, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_MARGIN_RIGHT(val) \ - { \ - .prop = LV_STYLE_MARGIN_RIGHT, .value = { .num = (int32_t)val } \ - } - #define LV_STYLE_CONST_BG_COLOR(val) \ { \ .prop = LV_STYLE_BG_COLOR, .value = { .color = val } \ @@ -316,44 +229,39 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value); .prop = LV_STYLE_BG_GRAD_STOP, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_BG_MAIN_OPA(val) \ - { \ - .prop = LV_STYLE_BG_MAIN_OPA, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_BG_GRAD_OPA(val) \ +#define LV_STYLE_CONST_BG_GRAD(val) \ { \ - .prop = LV_STYLE_BG_GRAD_OPA, .value = { .num = (int32_t)val } \ + .prop = LV_STYLE_BG_GRAD, .value = { .ptr = val } \ } -#define LV_STYLE_CONST_BG_GRAD(val) \ +#define LV_STYLE_CONST_BG_DITHER_MODE(val) \ { \ - .prop = LV_STYLE_BG_GRAD, .value = { .ptr = val } \ + .prop = LV_STYLE_BG_DITHER_MODE, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_BG_IMAGE_SRC(val) \ +#define LV_STYLE_CONST_BG_IMG_SRC(val) \ { \ - .prop = LV_STYLE_BG_IMAGE_SRC, .value = { .ptr = val } \ + .prop = LV_STYLE_BG_IMG_SRC, .value = { .ptr = val } \ } -#define LV_STYLE_CONST_BG_IMAGE_OPA(val) \ +#define LV_STYLE_CONST_BG_IMG_OPA(val) \ { \ - .prop = LV_STYLE_BG_IMAGE_OPA, .value = { .num = (int32_t)val } \ + .prop = LV_STYLE_BG_IMG_OPA, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_BG_IMAGE_RECOLOR(val) \ +#define LV_STYLE_CONST_BG_IMG_RECOLOR(val) \ { \ - .prop = LV_STYLE_BG_IMAGE_RECOLOR, .value = { .color = val } \ + .prop = LV_STYLE_BG_IMG_RECOLOR, .value = { .color = val } \ } -#define LV_STYLE_CONST_BG_IMAGE_RECOLOR_OPA(val) \ +#define LV_STYLE_CONST_BG_IMG_RECOLOR_OPA(val) \ { \ - .prop = LV_STYLE_BG_IMAGE_RECOLOR_OPA, .value = { .num = (int32_t)val } \ + .prop = LV_STYLE_BG_IMG_RECOLOR_OPA, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_BG_IMAGE_TILED(val) \ +#define LV_STYLE_CONST_BG_IMG_TILED(val) \ { \ - .prop = LV_STYLE_BG_IMAGE_TILED, .value = { .num = (int32_t)val } \ + .prop = LV_STYLE_BG_IMG_TILED, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_BORDER_COLOR(val) \ @@ -406,14 +314,14 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value); .prop = LV_STYLE_SHADOW_WIDTH, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_SHADOW_OFFSET_X(val) \ +#define LV_STYLE_CONST_SHADOW_OFS_X(val) \ { \ - .prop = LV_STYLE_SHADOW_OFFSET_X, .value = { .num = (int32_t)val } \ + .prop = LV_STYLE_SHADOW_OFS_X, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_SHADOW_OFFSET_Y(val) \ +#define LV_STYLE_CONST_SHADOW_OFS_Y(val) \ { \ - .prop = LV_STYLE_SHADOW_OFFSET_Y, .value = { .num = (int32_t)val } \ + .prop = LV_STYLE_SHADOW_OFS_Y, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_SHADOW_SPREAD(val) \ @@ -431,19 +339,19 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value); .prop = LV_STYLE_SHADOW_OPA, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_IMAGE_OPA(val) \ +#define LV_STYLE_CONST_IMG_OPA(val) \ { \ - .prop = LV_STYLE_IMAGE_OPA, .value = { .num = (int32_t)val } \ + .prop = LV_STYLE_IMG_OPA, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_IMAGE_RECOLOR(val) \ +#define LV_STYLE_CONST_IMG_RECOLOR(val) \ { \ - .prop = LV_STYLE_IMAGE_RECOLOR, .value = { .color = val } \ + .prop = LV_STYLE_IMG_RECOLOR, .value = { .color = val } \ } -#define LV_STYLE_CONST_IMAGE_RECOLOR_OPA(val) \ +#define LV_STYLE_CONST_IMG_RECOLOR_OPA(val) \ { \ - .prop = LV_STYLE_IMAGE_RECOLOR_OPA, .value = { .num = (int32_t)val } \ + .prop = LV_STYLE_IMG_RECOLOR_OPA, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_LINE_WIDTH(val) \ @@ -496,9 +404,9 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value); .prop = LV_STYLE_ARC_OPA, .value = { .num = (int32_t)val } \ } -#define LV_STYLE_CONST_ARC_IMAGE_SRC(val) \ +#define LV_STYLE_CONST_ARC_IMG_SRC(val) \ { \ - .prop = LV_STYLE_ARC_IMAGE_SRC, .value = { .ptr = val } \ + .prop = LV_STYLE_ARC_IMG_SRC, .value = { .ptr = val } \ } #define LV_STYLE_CONST_TEXT_COLOR(val) \ @@ -571,9 +479,14 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value); .prop = LV_STYLE_ANIM, .value = { .ptr = val } \ } -#define LV_STYLE_CONST_ANIM_DURATION(val) \ +#define LV_STYLE_CONST_ANIM_TIME(val) \ { \ - .prop = LV_STYLE_ANIM_DURATION, .value = { .num = (int32_t)val } \ + .prop = LV_STYLE_ANIM_TIME, .value = { .num = (int32_t)val } \ + } + +#define LV_STYLE_CONST_ANIM_SPEED(val) \ + { \ + .prop = LV_STYLE_ANIM_SPEED, .value = { .num = (int32_t)val } \ } #define LV_STYLE_CONST_TRANSITION(val) \ @@ -595,100 +508,3 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value); { \ .prop = LV_STYLE_BASE_DIR, .value = { .num = (int32_t)val } \ } - -#define LV_STYLE_CONST_BITMAP_MASK_SRC(val) \ - { \ - .prop = LV_STYLE_BITMAP_MASK_SRC, .value = { .ptr = val } \ - } - -#define LV_STYLE_CONST_ROTARY_SENSITIVITY(val) \ - { \ - .prop = LV_STYLE_ROTARY_SENSITIVITY, .value = { .num = (int32_t)val } \ - } -#if LV_USE_FLEX - -#define LV_STYLE_CONST_FLEX_FLOW(val) \ - { \ - .prop = LV_STYLE_FLEX_FLOW, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_FLEX_MAIN_PLACE(val) \ - { \ - .prop = LV_STYLE_FLEX_MAIN_PLACE, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_FLEX_CROSS_PLACE(val) \ - { \ - .prop = LV_STYLE_FLEX_CROSS_PLACE, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_FLEX_TRACK_PLACE(val) \ - { \ - .prop = LV_STYLE_FLEX_TRACK_PLACE, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_FLEX_GROW(val) \ - { \ - .prop = LV_STYLE_FLEX_GROW, .value = { .num = (int32_t)val } \ - } -#endif /*LV_USE_FLEX*/ - -#if LV_USE_GRID - -#define LV_STYLE_CONST_GRID_COLUMN_DSC_ARRAY(val) \ - { \ - .prop = LV_STYLE_GRID_COLUMN_DSC_ARRAY, .value = { .ptr = val } \ - } - -#define LV_STYLE_CONST_GRID_COLUMN_ALIGN(val) \ - { \ - .prop = LV_STYLE_GRID_COLUMN_ALIGN, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_GRID_ROW_DSC_ARRAY(val) \ - { \ - .prop = LV_STYLE_GRID_ROW_DSC_ARRAY, .value = { .ptr = val } \ - } - -#define LV_STYLE_CONST_GRID_ROW_ALIGN(val) \ - { \ - .prop = LV_STYLE_GRID_ROW_ALIGN, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_GRID_CELL_COLUMN_POS(val) \ - { \ - .prop = LV_STYLE_GRID_CELL_COLUMN_POS, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_GRID_CELL_X_ALIGN(val) \ - { \ - .prop = LV_STYLE_GRID_CELL_X_ALIGN, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_GRID_CELL_COLUMN_SPAN(val) \ - { \ - .prop = LV_STYLE_GRID_CELL_COLUMN_SPAN, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_GRID_CELL_ROW_POS(val) \ - { \ - .prop = LV_STYLE_GRID_CELL_ROW_POS, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_GRID_CELL_Y_ALIGN(val) \ - { \ - .prop = LV_STYLE_GRID_CELL_Y_ALIGN, .value = { .num = (int32_t)val } \ - } - -#define LV_STYLE_CONST_GRID_CELL_ROW_SPAN(val) \ - { \ - .prop = LV_STYLE_GRID_CELL_ROW_SPAN, .value = { .num = (int32_t)val } \ - } -#endif /*LV_USE_GRID*/ - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV_STYLE_GEN_H */ diff --git a/L3_Middlewares/LVGL/src/misc/lv_text.h b/L3_Middlewares/LVGL/src/misc/lv_text.h deleted file mode 100644 index f2407dd..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_text.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @file lv_text.h - * - */ - -#ifndef LV_TEXT_H -#define LV_TEXT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_conf_internal.h" - -#include "lv_types.h" -#include "lv_area.h" -#include "../font/lv_font.h" -#include "../stdlib/lv_sprintf.h" - -/********************* - * DEFINES - *********************/ - -#define LV_TXT_ENC_UTF8 1 -#define LV_TXT_ENC_ASCII 2 - -/********************** - * TYPEDEFS - **********************/ - -/** - * Options for text rendering. - */ - -typedef enum { - LV_TEXT_FLAG_NONE = 0x00, - LV_TEXT_FLAG_EXPAND = 0x01, /**< Ignore max-width to avoid automatic word wrapping*/ - LV_TEXT_FLAG_FIT = 0x02, /**< Max-width is already equal to the longest line. (Used to skip some calculation)*/ - LV_TEXT_FLAG_BREAK_ALL = 0x04, /**< To prevent overflow, insert breaks between any two characters. - Otherwise breaks are inserted at word boundaries, as configured via LV_TXT_BREAK_CHARS - or according to LV_TXT_LINE_BREAK_LONG_LEN, LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN, - and LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN.*/ -} lv_text_flag_t; - -/** Label align policy*/ -typedef enum { - LV_TEXT_ALIGN_AUTO, /**< Align text auto*/ - LV_TEXT_ALIGN_LEFT, /**< Align text to left*/ - LV_TEXT_ALIGN_CENTER, /**< Align text to center*/ - LV_TEXT_ALIGN_RIGHT, /**< Align text to right*/ -} lv_text_align_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Get size of a text - * @param size_res pointer to a 'point_t' variable to store the result - * @param text pointer to a text - * @param font pointer to font of the text - * @param letter_space letter space of the text - * @param line_space line space of the text - * @param max_width max width of the text (break the lines to fit this size). Set COORD_MAX to avoid - * @param flag settings for the text from ::lv_text_flag_t - - * line breaks - */ -void lv_text_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, int32_t letter_space, - int32_t line_space, int32_t max_width, lv_text_flag_t flag); - -/** - * Give the length of a text with a given font - * @param txt a '\0' terminate string - * @param length length of 'txt' in byte count and not characters (Á is 1 character but 2 bytes in - * UTF-8) - * @param font pointer to a font - * @param letter_space letter space - * @return length of a char_num long text - */ -int32_t lv_text_get_width(const char * txt, uint32_t length, const lv_font_t * font, int32_t letter_space); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_TEXT_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_text_private.h b/L3_Middlewares/LVGL/src/misc/lv_text_private.h deleted file mode 100644 index 858f593..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_text_private.h +++ /dev/null @@ -1,273 +0,0 @@ -/** - * @file lv_text_private.h - * - */ - -#ifndef LV_TEXT_PRIVATE_H -#define LV_TEXT_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_text.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Get the next line of text. Check line length and break chars too. - * @param txt a '\0' terminated string - * @param font pointer to a font - * @param letter_space letter space - * @param max_width max width of the text (break the lines to fit this size). Set COORD_MAX to avoid - * line breaks - * @param used_width When used_width != NULL, save the width of this line if - * flag == LV_TEXT_FLAG_NONE, otherwise save -1. - * @param flag settings for the text from 'txt_flag_type' enum - * @return the index of the first char of the new line (in byte index not letter index. With UTF-8 - * they are different) - */ -uint32_t lv_text_get_next_line(const char * txt, const lv_font_t * font, int32_t letter_space, - int32_t max_width, int32_t * used_width, lv_text_flag_t flag); - -/** - * Insert a string into another - * @param txt_buf the original text (must be big enough for the result text and NULL terminated) - * @param pos position to insert (0: before the original text, 1: after the first char etc.) - * @param ins_txt text to insert, must be '\0' terminated - */ -void lv_text_ins(char * txt_buf, uint32_t pos, const char * ins_txt); - -/** - * Delete a part of a string - * @param txt string to modify, must be '\0' terminated and should point to a heap or stack frame, not read-only memory. - * @param pos position where to start the deleting (0: before the first char, 1: after the first - * char etc.) - * @param len number of characters to delete - */ -void lv_text_cut(char * txt, uint32_t pos, uint32_t len); - -/** - * return a new formatted text. Memory will be allocated to store the text. - * @param fmt `printf`-like format - * @param ap items to print - - * @return pointer to the allocated text string. - */ -char * lv_text_set_text_vfmt(const char * fmt, va_list ap) LV_FORMAT_ATTRIBUTE(1, 0); - -/** - * Decode two encoded character from a string. - * @param txt pointer to '\0' terminated string - * @param letter the first decoded Unicode character or 0 on invalid data code - * @param letter_next the second decoded Unicode character or 0 on invalid data code - * @param ofs start index in 'txt' where to start. - * After the call it will point to the next encoded char in 'txt'. - * NULL to use txt[0] as index - */ -void lv_text_encoded_letter_next_2(const char * txt, uint32_t * letter, uint32_t * letter_next, uint32_t * ofs); - -/** - * Test if char is break char or not (a text can broken here or not) - * @param letter a letter - * @return false: 'letter' is not break char - */ -static inline bool lv_text_is_break_char(uint32_t letter) -{ - uint8_t i; - bool ret = false; - - /*Compare the letter to TXT_BREAK_CHARS*/ - for(i = 0; LV_TXT_BREAK_CHARS[i] != '\0'; i++) { - if(letter == (uint32_t)LV_TXT_BREAK_CHARS[i]) { - ret = true; /*If match then it is break char*/ - break; - } - } - - return ret; -} - -/** - * Test if char is break char or not (a text can broken here or not) - * @param letter a letter - * @return false: 'letter' is not break char - */ -static inline bool lv_text_is_a_word(uint32_t letter) -{ - /*Cheap check on invalid letter*/ - if(letter == 0) return false; - - /*CJK Unified Ideographs*/ - if(letter >= 0x4E00 && letter <= 0x9FFF) { - return true; - } - - /*Fullwidth ASCII variants*/ - if(letter >= 0xFF01 && letter <= 0xFF5E) { - return true; - } - - /*CJK symbols and punctuation*/ - if(letter >= 0x3000 && letter <= 0x303F) { - return true; - } - - /*CJK Radicals Supplement*/ - if(letter >= 0x2E80 && letter <= 0x2EFF) { - return true; - } - - /*CJK Strokes*/ - if(letter >= 0x31C0 && letter <= 0x31EF) { - return true; - } - - /*Hiragana and Katakana*/ - if(letter >= 0x3040 && letter <= 0x30FF) { - return true; - } - - /*Chinese Vertical Forms*/ - if(letter >= 0xFE10 && letter <= 0xFE1F) { - return true; - } - - /*CJK Compatibility Forms*/ - if(letter >= 0xFE30 && letter <= 0xFE4F) { - return true; - } - - return false; -} - -/** - * Test if character can be treated as marker, and don't need to be rendered. - * Note, this is not a full list. Add your findings to the list. - * - * @param letter a letter - * @return true if so - */ -static inline bool lv_text_is_marker(uint32_t letter) -{ - if(letter < 0x20) return true; - - /*U+061C ARABIC LETTER MARK, see https://www.compart.com/en/unicode/block/U+0600*/ - if(letter == 0x061C) return true; - - /*U+115F HANGUL CHOSEONG FILLER, See https://www.compart.com/en/unicode/block/U+1100*/ - if(letter == 0x115F) return true; - /*U+1160 HANGUL JUNGSEONG FILLER*/ - if(letter == 0x1160) return true; - - /*See https://www.compart.com/en/unicode/block/U+1800*/ - if(letter >= 0x180B && letter <= 0x180E) return true; - - /*See https://www.compart.com/en/unicode/block/U+2000*/ - if(letter >= 0x200B && letter <= 0x200F) return true; - if(letter >= 0x2028 && letter <= 0x202F) return true; - if(letter >= 0x205F && letter <= 0x206F) return true; - - /*U+FEFF ZERO WIDTH NO-BREAK SPACE, see https://www.compart.com/en/unicode/block/U+FE70*/ - if(letter == 0xFEFF) return true; - - if(letter == 0xF8FF) return true; /*LV_SYMBOL_DUMMY*/ - - return false; -} - -/*************************************************************** - * GLOBAL FUNCTION POINTERS FOR CHARACTER ENCODING INTERFACE - ***************************************************************/ - -/** - * Give the size of an encoded character - * @param txt pointer to a character in a string - * @return length of the encoded character (1,2,3 ...). O in invalid - */ -extern uint8_t (*const lv_text_encoded_size)(const char * txt); - -/** - * Convert a Unicode letter to encoded - * @param letter_uni a Unicode letter - * @return Encoded character in Little Endian to be compatible with C chars (e.g. 'Á', 'Ü') - */ -extern uint32_t (*const lv_text_unicode_to_encoded)(uint32_t letter_uni); - -/** - * Convert a wide character, e.g. 'Á' little endian to be compatible with the encoded format. - * @param c a wide character - * @return `c` in the encoded format - */ -extern uint32_t (*const lv_text_encoded_conv_wc)(uint32_t c); - -/** - * Decode the next encoded character from a string. - * @param txt pointer to '\0' terminated string - * @param i_start start index in 'txt' where to start. - * After the call it will point to the next encoded char in 'txt'. - * NULL to use txt[0] as index - * @return the decoded Unicode character or 0 on invalid data code - */ -extern uint32_t (*const lv_text_encoded_next)(const char * txt, uint32_t * i_start); - -/** - * Get the previous encoded character form a string. - * - * @param txt pointer to '\0' terminated string - * @param i_start index in 'txt' where to start. After the call it will point to the previous - * encoded char in 'txt'. - * - * @return the decoded Unicode character or 0 on invalid data - */ -extern uint32_t (*const lv_text_encoded_prev)(const char * txt, uint32_t * i_start); - -/** - * Convert a letter index (in the encoded text) to byte index. - * E.g. in UTF-8 "AÁRT" index of 'R' is 2 but start at byte 3 because 'Á' is 2 bytes long - * @param txt a '\0' terminated UTF-8 string - * @param utf8_id character index - * @return byte index of the 'enc_id'th letter - */ -extern uint32_t (*const lv_text_encoded_get_byte_id)(const char * txt, uint32_t utf8_id); - -/** - * Convert a byte index (in an encoded text) to character index. - * E.g. in UTF-8 "AÁRT" index of 'R' is 2 but start at byte 3 because 'Á' is 2 bytes long - * @param txt a '\0' terminated UTF-8 string - * @param byte_id byte index - * @return character index of the letter at 'byte_id'th position - */ -extern uint32_t (*const lv_text_encoded_get_char_id)(const char * txt, uint32_t byte_id); - -/** - * Get the number of characters (and NOT bytes) in a string. - * E.g. in UTF-8 "ÁBC" is 3 characters (but 4 bytes) - * @param txt a '\0' terminated char string - * @return number of characters - */ -extern uint32_t (*const lv_text_get_encoded_length)(const char * txt); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_TEXT_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_timer.c b/L3_Middlewares/LVGL/src/misc/lv_timer.c index 959ce53..a21038a 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_timer.c +++ b/L3_Middlewares/LVGL/src/misc/lv_timer.c @@ -5,25 +5,19 @@ /********************* * INCLUDES *********************/ -#include "lv_timer_private.h" -#include "../core/lv_global.h" -#include "../tick/lv_tick.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_sprintf.h" +#include "lv_timer.h" +#include "../hal/lv_hal_tick.h" #include "lv_assert.h" +#include "lv_mem.h" #include "lv_ll.h" -#include "lv_profiler.h" +#include "lv_gc.h" /********************* * DEFINES *********************/ - #define IDLE_MEAS_PERIOD 500 /*[ms]*/ #define DEF_PERIOD 500 -#define state LV_GLOBAL_DEFAULT()->timer_state -#define timer_ll_p &(state.timer_ll) - /********************** * TYPEDEFS **********************/ @@ -33,141 +27,148 @@ **********************/ static bool lv_timer_exec(lv_timer_t * timer); static uint32_t lv_timer_time_remaining(lv_timer_t * timer); -static void lv_timer_handler_resume(void); /********************** * STATIC VARIABLES **********************/ +static bool lv_timer_run = false; +static uint8_t idle_last = 0; +static bool timer_deleted; +static bool timer_created; /********************** * MACROS **********************/ -#if LV_USE_LOG && LV_LOG_TRACE_TIMER - #define LV_TRACE_TIMER(...) LV_LOG_TRACE(__VA_ARGS__) +#if LV_LOG_TRACE_TIMER + #define TIMER_TRACE(...) LV_LOG_TRACE(__VA_ARGS__) #else - #define LV_TRACE_TIMER(...) + #define TIMER_TRACE(...) #endif /********************** * GLOBAL FUNCTIONS **********************/ -void lv_timer_core_init(void) +/** + * Init the lv_timer module + */ +void _lv_timer_core_init(void) { - lv_ll_init(timer_ll_p, sizeof(lv_timer_t)); + _lv_ll_init(&LV_GC_ROOT(_lv_timer_ll), sizeof(lv_timer_t)); /*Initially enable the lv_timer handling*/ lv_timer_enable(true); } -LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void) +/** + * Call it periodically to handle lv_timers. + * @return the time after which it must be called again + */ +uint32_t LV_ATTRIBUTE_TIMER_HANDLER lv_timer_handler(void) { - LV_TRACE_TIMER("begin"); + TIMER_TRACE("begin"); - lv_timer_state_t * state_p = &state; /*Avoid concurrent running of the timer handler*/ - if(state_p->already_running) { - LV_TRACE_TIMER("already running, concurrent calls are not allow, returning"); + static bool already_running = false; + if(already_running) { + TIMER_TRACE("already running, concurrent calls are not allow, returning"); return 1; } - state_p->already_running = true; + already_running = true; - if(state_p->lv_timer_run == false) { - state_p->already_running = false; /*Release mutex*/ + if(lv_timer_run == false) { + already_running = false; /*Release mutex*/ return 1; } - LV_PROFILER_BEGIN; - lv_lock(); + static uint32_t idle_period_start = 0; + static uint32_t busy_time = 0; uint32_t handler_start = lv_tick_get(); if(handler_start == 0) { - state.run_cnt++; - if(state.run_cnt > 100) { - state.run_cnt = 0; + static uint32_t run_cnt = 0; + run_cnt++; + if(run_cnt > 100) { + run_cnt = 0; LV_LOG_WARN("It seems lv_tick_inc() is not called."); } } /*Run all timer from the list*/ lv_timer_t * next; - lv_timer_t * timer_active; - lv_ll_t * timer_head = timer_ll_p; do { - state_p->timer_deleted = false; - state_p->timer_created = false; - - timer_active = lv_ll_get_head(timer_head); - while(timer_active) { + timer_deleted = false; + timer_created = false; + LV_GC_ROOT(_lv_timer_act) = _lv_ll_get_head(&LV_GC_ROOT(_lv_timer_ll)); + while(LV_GC_ROOT(_lv_timer_act)) { /*The timer might be deleted if it runs only once ('repeat_count = 1') *So get next element until the current is surely valid*/ - next = lv_ll_get_next(timer_head, timer_active); + next = _lv_ll_get_next(&LV_GC_ROOT(_lv_timer_ll), LV_GC_ROOT(_lv_timer_act)); - if(lv_timer_exec(timer_active)) { + if(lv_timer_exec(LV_GC_ROOT(_lv_timer_act))) { /*If a timer was created or deleted then this or the next item might be corrupted*/ - if(state_p->timer_created || state_p->timer_deleted) { - LV_TRACE_TIMER("Start from the first timer again because a timer was created or deleted"); + if(timer_created || timer_deleted) { + TIMER_TRACE("Start from the first timer again because a timer was created or deleted"); break; } } - timer_active = next; /*Load the next timer*/ + LV_GC_ROOT(_lv_timer_act) = next; /*Load the next timer*/ } - } while(timer_active); + } while(LV_GC_ROOT(_lv_timer_act)); - uint32_t time_until_next = LV_NO_TIMER_READY; - next = lv_ll_get_head(timer_head); + uint32_t time_till_next = LV_NO_TIMER_READY; + next = _lv_ll_get_head(&LV_GC_ROOT(_lv_timer_ll)); while(next) { if(!next->paused) { uint32_t delay = lv_timer_time_remaining(next); - if(delay < time_until_next) - time_until_next = delay; + if(delay < time_till_next) + time_till_next = delay; } - next = lv_ll_get_next(timer_head, next); /*Find the next timer*/ + next = _lv_ll_get_next(&LV_GC_ROOT(_lv_timer_ll), next); /*Find the next timer*/ } - state_p->busy_time += lv_tick_elaps(handler_start); - uint32_t idle_period_time = lv_tick_elaps(state_p->idle_period_start); + busy_time += lv_tick_elaps(handler_start); + uint32_t idle_period_time = lv_tick_elaps(idle_period_start); if(idle_period_time >= IDLE_MEAS_PERIOD) { - state_p->idle_last = (state_p->busy_time * 100) / idle_period_time; /*Calculate the busy percentage*/ - state_p->idle_last = state_p->idle_last > 100 ? 0 : 100 - state_p->idle_last; /*But we need idle time*/ - state_p->busy_time = 0; - state_p->idle_period_start = lv_tick_get(); + idle_last = (busy_time * 100) / idle_period_time; /*Calculate the busy percentage*/ + idle_last = idle_last > 100 ? 0 : 100 - idle_last; /*But we need idle time*/ + busy_time = 0; + idle_period_start = lv_tick_get(); } - state_p->timer_time_until_next = time_until_next; - state_p->already_running = false; /*Release the mutex*/ - - LV_TRACE_TIMER("finished (%" LV_PRIu32 " ms until the next timer call)", time_until_next); - lv_unlock(); - - LV_PROFILER_END; - - return time_until_next; -} + already_running = false; /*Release the mutex*/ -LV_ATTRIBUTE_TIMER_HANDLER void lv_timer_periodic_handler(void) -{ - lv_timer_state_t * state_p = &state; - if(lv_tick_elaps(state_p->periodic_last_tick) >= state_p->timer_time_until_next) { - LV_TRACE_TIMER("calling lv_timer_handler()"); - lv_timer_handler(); - state_p->periodic_last_tick = lv_tick_get(); - } + TIMER_TRACE("finished (%d ms until the next timer call)", time_till_next); + return time_till_next; } +/** + * Create an "empty" timer. It needs to initialized with at least + * `lv_timer_set_cb` and `lv_timer_set_period` + * @return pointer to the created timer + */ lv_timer_t * lv_timer_create_basic(void) { return lv_timer_create(NULL, DEF_PERIOD, NULL); } +/** + * Create a new lv_timer + * @param timer_xcb a callback which is the timer itself. It will be called periodically. + * (the 'x' in the argument name indicates that it's not a fully generic function because it not follows + * the `func_name(object, callback, ...)` convention) + * @param period call period in ms unit + * @param user_data custom parameter + * @return pointer to the new timer + */ lv_timer_t * lv_timer_create(lv_timer_cb_t timer_xcb, uint32_t period, void * user_data) { lv_timer_t * new_timer = NULL; - new_timer = lv_ll_ins_head(timer_ll_p); + new_timer = _lv_ll_ins_head(&LV_GC_ROOT(_lv_timer_ll)); LV_ASSERT_MALLOC(new_timer); if(new_timer == NULL) return NULL; @@ -177,127 +178,114 @@ lv_timer_t * lv_timer_create(lv_timer_cb_t timer_xcb, uint32_t period, void * us new_timer->paused = 0; new_timer->last_run = lv_tick_get(); new_timer->user_data = user_data; - new_timer->auto_delete = true; - - state.timer_created = true; - lv_timer_handler_resume(); + timer_created = true; return new_timer; } +/** + * Set the callback the timer (the function to call periodically) + * @param timer pointer to a timer + * @param timer_cb the function to call periodically + */ void lv_timer_set_cb(lv_timer_t * timer, lv_timer_cb_t timer_cb) { - LV_ASSERT_NULL(timer); timer->timer_cb = timer_cb; } -void lv_timer_delete(lv_timer_t * timer) +/** + * Delete a lv_timer + * @param timer pointer to timer created by timer + */ +void lv_timer_del(lv_timer_t * timer) { - lv_ll_remove(timer_ll_p, timer); - state.timer_deleted = true; + _lv_ll_remove(&LV_GC_ROOT(_lv_timer_ll), timer); + timer_deleted = true; - lv_free(timer); + lv_mem_free(timer); } +/** + * Pause/resume a timer. + * @param timer pointer to an lv_timer + */ void lv_timer_pause(lv_timer_t * timer) { - LV_ASSERT_NULL(timer); timer->paused = true; } void lv_timer_resume(lv_timer_t * timer) { - LV_ASSERT_NULL(timer); timer->paused = false; - lv_timer_handler_resume(); } +/** + * Set new period for a lv_timer + * @param timer pointer to a lv_timer + * @param period the new period + */ void lv_timer_set_period(lv_timer_t * timer, uint32_t period) { - LV_ASSERT_NULL(timer); timer->period = period; } +/** + * Make a lv_timer ready. It will not wait its period. + * @param timer pointer to a lv_timer. + */ void lv_timer_ready(lv_timer_t * timer) { - LV_ASSERT_NULL(timer); timer->last_run = lv_tick_get() - timer->period - 1; } +/** + * Set the number of times a timer will repeat. + * @param timer pointer to a lv_timer. + * @param repeat_count -1 : infinity; 0 : stop ; n >0: residual times + */ void lv_timer_set_repeat_count(lv_timer_t * timer, int32_t repeat_count) { - LV_ASSERT_NULL(timer); timer->repeat_count = repeat_count; } -void lv_timer_set_auto_delete(lv_timer_t * timer, bool auto_delete) -{ - LV_ASSERT_NULL(timer); - timer->auto_delete = auto_delete; -} - -void lv_timer_set_user_data(lv_timer_t * timer, void * user_data) -{ - LV_ASSERT_NULL(timer); - timer->user_data = user_data; -} - +/** + * Reset a lv_timer. + * It will be called the previously set period milliseconds later. + * @param timer pointer to a lv_timer. + */ void lv_timer_reset(lv_timer_t * timer) { - LV_ASSERT_NULL(timer); timer->last_run = lv_tick_get(); - lv_timer_handler_resume(); } +/** + * Enable or disable the whole lv_timer handling + * @param en true: lv_timer handling is running, false: lv_timer handling is suspended + */ void lv_timer_enable(bool en) { - state.lv_timer_run = en; - if(en) lv_timer_handler_resume(); -} - -void lv_timer_core_deinit(void) -{ - lv_timer_enable(false); - - lv_ll_clear(timer_ll_p); -} - -uint32_t lv_timer_get_idle(void) -{ - return state.idle_last; + lv_timer_run = en; } -uint32_t lv_timer_get_time_until_next(void) +/** + * Get idle percentage + * @return the lv_timer idle in percentage + */ +uint8_t lv_timer_get_idle(void) { - return state.timer_time_until_next; + return idle_last; } +/** + * Iterate through the timers + * @param timer NULL to start iteration or the previous return value to get the next timer + * @return the next timer or NULL if there is no more timer + */ lv_timer_t * lv_timer_get_next(lv_timer_t * timer) { - if(timer == NULL) return lv_ll_get_head(timer_ll_p); - else return lv_ll_get_next(timer_ll_p, timer); -} - -LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler_run_in_period(uint32_t period) -{ - static uint32_t last_tick = 0; - - if(lv_tick_elaps(last_tick) >= period) { - last_tick = lv_tick_get(); - return lv_timer_handler(); - } - return 1; -} - -void * lv_timer_get_user_data(lv_timer_t * timer) -{ - return timer->user_data; -} - -bool lv_timer_get_paused(lv_timer_t * timer) -{ - return timer->paused; + if(timer == NULL) return _lv_ll_get_head(&LV_GC_ROOT(_lv_timer_ll)); + else return _lv_ll_get_next(&LV_GC_ROOT(_lv_timer_ll), timer); } /********************** @@ -321,31 +309,17 @@ static bool lv_timer_exec(lv_timer_t * timer) int32_t original_repeat_count = timer->repeat_count; if(timer->repeat_count > 0) timer->repeat_count--; timer->last_run = lv_tick_get(); - LV_TRACE_TIMER("calling timer callback: %p", *((void **)&timer->timer_cb)); - + TIMER_TRACE("calling timer callback: %p", *((void **)&timer->timer_cb)); if(timer->timer_cb && original_repeat_count != 0) timer->timer_cb(timer); - - if(!state.timer_deleted) { - LV_TRACE_TIMER("timer callback %p finished", *((void **)&timer->timer_cb)); - } - else { - LV_TRACE_TIMER("timer callback finished"); - } - + TIMER_TRACE("timer callback %p finished", *((void **)&timer->timer_cb)); LV_ASSERT_MEM_INTEGRITY(); exec = true; } - if(state.timer_deleted == false) { /*The timer might be deleted by itself as well*/ + if(timer_deleted == false) { /*The timer might be deleted by itself as well*/ if(timer->repeat_count == 0) { /*The repeat count is over, delete the timer*/ - if(timer->auto_delete) { - LV_TRACE_TIMER("deleting timer with %p callback because the repeat count is over", *((void **)&timer->timer_cb)); - lv_timer_delete(timer); - } - else { - LV_TRACE_TIMER("pausing timer with %p callback because the repeat count is over", *((void **)&timer->timer_cb)); - lv_timer_pause(timer); - } + TIMER_TRACE("deleting timer with %p callback because the repeat count is over", *((void **)&timer->timer_cb)); + lv_timer_del(timer); } } @@ -365,21 +339,3 @@ static uint32_t lv_timer_time_remaining(lv_timer_t * timer) return 0; return timer->period - elp; } - -/** - * Call the ready lv_timer - */ -static void lv_timer_handler_resume(void) -{ - /*If there is a timer which is ready to run then resume the timer loop*/ - state.timer_time_until_next = 0; - if(state.resume_cb) { - state.resume_cb(state.resume_data); - } -} - -void lv_timer_handler_set_resume_cb(lv_timer_handler_resume_cb_t cb, void * data) -{ - state.resume_cb = cb; - state.resume_data = data; -} diff --git a/L3_Middlewares/LVGL/src/misc/lv_timer.h b/L3_Middlewares/LVGL/src/misc/lv_timer.h index be25003..50da8c9 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_timer.h +++ b/L3_Middlewares/LVGL/src/misc/lv_timer.h @@ -13,9 +13,10 @@ extern "C" { * INCLUDES *********************/ #include "../lv_conf_internal.h" -#include "../tick/lv_tick.h" -#include "lv_types.h" -#include "lv_ll.h" +#include "../hal/lv_hal_tick.h" + +#include +#include /********************* * DEFINES @@ -30,27 +31,41 @@ extern "C" { * TYPEDEFS **********************/ +struct _lv_timer_t; + /** * Timers execute this type of functions. */ -typedef void (*lv_timer_cb_t)(lv_timer_t *); +typedef void (*lv_timer_cb_t)(struct _lv_timer_t *); /** - * Timer handler resume this type of function. + * Descriptor of a lv_timer */ -typedef void (*lv_timer_handler_resume_cb_t)(void * data); +typedef struct _lv_timer_t { + uint32_t period; /**< How often the timer should run*/ + uint32_t last_run; /**< Last time the timer ran*/ + lv_timer_cb_t timer_cb; /**< Timer function*/ + void * user_data; /**< Custom user data*/ + int32_t repeat_count; /**< 1: One time; -1 : infinity; n>0: residual times*/ + uint32_t paused : 1; +} lv_timer_t; /********************** * GLOBAL PROTOTYPES **********************/ +/** + * Init the lv_timer module + */ +void _lv_timer_core_init(void); + //! @cond Doxygen_Suppress /** * Call it periodically to handle lv_timers. * @return time till it needs to be run next (in ms) */ -LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void); +uint32_t /* LV_ATTRIBUTE_TIMER_HANDLER */ lv_timer_handler(void); //! @endcond @@ -58,26 +73,22 @@ LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void); * Call it in the super-loop of main() or threads. It will run lv_timer_handler() * with a given period in ms. You can use it with sleep or delay in OS environment. * This function is used to simplify the porting. - * @param period the period for running lv_timer_handler() - * @return the time after which it must be called again + * @param __ms the period for running lv_timer_handler() */ -LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler_run_in_period(uint32_t period); +static inline uint32_t LV_ATTRIBUTE_TIMER_HANDLER lv_timer_handler_run_in_period(uint32_t ms) +{ + static uint32_t last_tick = 0; + uint32_t curr_tick = lv_tick_get(); -/** - * Call it in the super-loop of main() or threads. It will automatically call lv_timer_handler() at the right time. - * This function is used to simplify the porting. - */ -LV_ATTRIBUTE_TIMER_HANDLER void lv_timer_periodic_handler(void); + if((curr_tick - last_tick) >= (ms)) { + last_tick = curr_tick; + return lv_timer_handler(); + } + return 1; +} /** - * Set the resume callback to the timer handler - * @param cb the function to call when timer handler is resumed - * @param data pointer to a resume data - */ -void lv_timer_handler_set_resume_cb(lv_timer_handler_resume_cb_t cb, void * data); - -/** - * Create an "empty" timer. It needs to be initialized with at least + * Create an "empty" timer. It needs to initialized with at least * `lv_timer_set_cb` and `lv_timer_set_period` * @return pointer to the created timer */ @@ -98,22 +109,18 @@ lv_timer_t * lv_timer_create(lv_timer_cb_t timer_xcb, uint32_t period, void * us * Delete a lv_timer * @param timer pointer to an lv_timer */ -void lv_timer_delete(lv_timer_t * timer); +void lv_timer_del(lv_timer_t * timer); /** - * Pause a timer. + * Pause/resume a timer. * @param timer pointer to an lv_timer */ void lv_timer_pause(lv_timer_t * timer); -/** - * Resume a timer. - * @param timer pointer to an lv_timer - */ void lv_timer_resume(lv_timer_t * timer); /** - * Set the callback to the timer (the function to call periodically) + * Set the callback the timer (the function to call periodically) * @param timer pointer to a timer * @param timer_cb the function to call periodically */ @@ -139,20 +146,6 @@ void lv_timer_ready(lv_timer_t * timer); */ void lv_timer_set_repeat_count(lv_timer_t * timer, int32_t repeat_count); -/** - * Set whether a lv_timer will be deleted automatically when it is called `repeat_count` times. - * @param timer pointer to a lv_timer. - * @param auto_delete true: auto delete; false: timer will be paused when it is called `repeat_count` times. - */ -void lv_timer_set_auto_delete(lv_timer_t * timer, bool auto_delete); - -/** - * Set custom parameter to the lv_timer. - * @param timer pointer to a lv_timer. - * @param user_data custom parameter - */ -void lv_timer_set_user_data(lv_timer_t * timer, void * user_data); - /** * Reset a lv_timer. * It will be called the previously set period milliseconds later. @@ -170,13 +163,7 @@ void lv_timer_enable(bool en); * Get idle percentage * @return the lv_timer idle in percentage */ -uint32_t lv_timer_get_idle(void); - -/** - * Get the time remaining until the next timer will run - * @return the time remaining in ms - */ -uint32_t lv_timer_get_time_until_next(void); +uint8_t lv_timer_get_idle(void); /** * Iterate through the timers @@ -185,20 +172,6 @@ uint32_t lv_timer_get_time_until_next(void); */ lv_timer_t * lv_timer_get_next(lv_timer_t * timer); -/** - * Get the user_data passed when the timer was created - * @param timer pointer to the lv_timer - * @return pointer to the user_data - */ -void * lv_timer_get_user_data(lv_timer_t * timer); - -/** - * Get the pause state of a timer - * @param timer pointer to a lv_timer - * @return true: timer is paused; false: timer is running - */ -bool lv_timer_get_paused(lv_timer_t * timer); - /********************** * MACROS **********************/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_timer_private.h b/L3_Middlewares/LVGL/src/misc/lv_timer_private.h deleted file mode 100644 index b7f42b0..0000000 --- a/L3_Middlewares/LVGL/src/misc/lv_timer_private.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @file lv_timer_private.h - * - */ - -#ifndef LV_TIMER_PRIVATE_H -#define LV_TIMER_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_timer.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * Descriptor of a lv_timer - */ -struct lv_timer_t { - uint32_t period; /**< How often the timer should run */ - uint32_t last_run; /**< Last time the timer ran */ - lv_timer_cb_t timer_cb; /**< Timer function */ - void * user_data; /**< Custom user data */ - int32_t repeat_count; /**< 1: One time; -1 : infinity; n>0: residual times */ - uint32_t paused : 1; - uint32_t auto_delete : 1; -}; - -typedef struct { - lv_ll_t timer_ll; /**< Linked list to store the lv_timers */ - - bool lv_timer_run; - uint8_t idle_last; - bool timer_deleted; - bool timer_created; - uint32_t timer_time_until_next; - - bool already_running; - uint32_t periodic_last_tick; - uint32_t busy_time; - uint32_t idle_period_start; - uint32_t run_cnt; - - lv_timer_handler_resume_cb_t resume_cb; - void * resume_data; -} lv_timer_state_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Init the lv_timer module - */ -void lv_timer_core_init(void); - -/** - * Deinit the lv_timer module - */ -void lv_timer_core_deinit(void); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_TIMER_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_tlsf.c b/L3_Middlewares/LVGL/src/misc/lv_tlsf.c similarity index 98% rename from L3_Middlewares/LVGL/src/stdlib/builtin/lv_tlsf.c rename to L3_Middlewares/LVGL/src/misc/lv_tlsf.c index 4232ae3..27e0a46 100644 --- a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_tlsf.c +++ b/L3_Middlewares/LVGL/src/misc/lv_tlsf.c @@ -1,16 +1,16 @@ -#include "../../lv_conf_internal.h" -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN +#include "../lv_conf_internal.h" +#if LV_MEM_CUSTOM == 0 -#include "lv_tlsf_private.h" -#include "../../stdlib/lv_string.h" -#include "../../misc/lv_log.h" -#include "../../misc/lv_assert.h" -#include "../../misc/lv_types.h" +#include +#include "lv_tlsf.h" +#include "lv_mem.h" +#include "lv_log.h" +#include "lv_assert.h" #undef printf #define printf LV_LOG_ERROR -#define TLSF_MAX_POOL_SIZE (LV_MEM_SIZE + LV_MEM_POOL_EXPAND_SIZE) +#define TLSF_MAX_POOL_SIZE LV_MEM_SIZE #if !defined(_DEBUG) #define _DEBUG 0 @@ -80,7 +80,7 @@ && defined (__GNUC_PATCHLEVEL__) #if defined (__SNC__) -/* SNC for PlayStation 3. */ +/* SNC for Playstation 3. */ tlsf_decl int tlsf_ffs(unsigned int word) { @@ -219,16 +219,16 @@ tlsf_decl int tlsf_fls_sizet(size_t size) */ /* Public constants: may be modified. */ -typedef enum { +enum tlsf_public { /* log2 of number of linear subdivisions of block sizes. Larger ** values require more memory in the control structure. Values of ** 4 or 5 are typical. */ SL_INDEX_COUNT_LOG2 = 5, -} tlsf_public; +}; /* Private constants: do not modify. */ -typedef enum { +enum tlsf_private { #if defined (TLSF_64BIT) /* All allocation sizes and addresses are aligned to 8 bytes. */ ALIGN_SIZE_LOG2 = 3, @@ -265,7 +265,7 @@ typedef enum { FL_INDEX_COUNT = (FL_INDEX_MAX - FL_INDEX_SHIFT + 1), SMALL_BLOCK_SIZE = (1 << FL_INDEX_SHIFT), -} tlsf_private; +}; /* ** Cast and min/max macros. @@ -358,6 +358,7 @@ static const size_t block_size_min = sizeof(block_header_t) - sizeof(block_header_t *); static const size_t block_size_max = tlsf_cast(size_t, 1) << FL_INDEX_MAX; + /* The TLSF control structure. */ typedef struct control_t { /* Empty lists point at this block to indicate they are free. */ @@ -586,8 +587,8 @@ static void remove_free_block(control_t * control, block_header_t * block, int f { block_header_t * prev = block->prev_free; block_header_t * next = block->next_free; - tlsf_assert(prev && "prev_free field cannot be null"); - tlsf_assert(next && "next_free field cannot be null"); + tlsf_assert(prev && "prev_free field can not be null"); + tlsf_assert(next && "next_free field can not be null"); next->prev_free = prev; prev->next_free = next; @@ -1242,4 +1243,4 @@ void * lv_tlsf_realloc(lv_tlsf_t tlsf, void * ptr, size_t size) return p; } -#endif /*LV_STDLIB_BUILTIN*/ +#endif /* LV_MEM_CUSTOM == 0 */ diff --git a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_tlsf.h b/L3_Middlewares/LVGL/src/misc/lv_tlsf.h similarity index 94% rename from L3_Middlewares/LVGL/src/stdlib/builtin/lv_tlsf.h rename to L3_Middlewares/LVGL/src/misc/lv_tlsf.h index 4127271..f12590b 100644 --- a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_tlsf.h +++ b/L3_Middlewares/LVGL/src/misc/lv_tlsf.h @@ -1,5 +1,5 @@ -#include "../../lv_conf_internal.h" -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN +#include "../lv_conf_internal.h" +#if LV_MEM_CUSTOM == 0 #ifndef LV_TLSF_H #define LV_TLSF_H @@ -41,9 +41,7 @@ ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../../osal/lv_os.h" -#include "../../misc/lv_ll.h" -#include "../../misc/lv_types.h" +#include #if defined(__cplusplus) extern "C" { @@ -94,4 +92,4 @@ int lv_tlsf_check_pool(lv_pool_t pool); #endif /*LV_TLSF_H*/ -#endif /*LV_STDLIB_BUILTIN*/ +#endif /* LV_MEM_CUSTOM == 0 */ diff --git a/L3_Middlewares/LVGL/src/misc/lv_text.c b/L3_Middlewares/LVGL/src/misc/lv_txt.c similarity index 64% rename from L3_Middlewares/LVGL/src/misc/lv_text.c rename to L3_Middlewares/LVGL/src/misc/lv_txt.c index 11081f9..da7eca0 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_text.c +++ b/L3_Middlewares/LVGL/src/misc/lv_txt.c @@ -1,19 +1,18 @@ /** - * @file lv_text.c + * @file lv_txt.c * */ /********************* * INCLUDES *********************/ -#include "lv_text_private.h" -#include "lv_text_ap.h" +#include +#include "lv_txt.h" +#include "lv_txt_ap.h" #include "lv_math.h" #include "lv_log.h" +#include "lv_mem.h" #include "lv_assert.h" -#include "../stdlib/lv_mem.h" -#include "../stdlib/lv_string.h" -#include "../misc/lv_types.h" /********************* * DEFINES @@ -29,23 +28,23 @@ **********************/ #if LV_TXT_ENC == LV_TXT_ENC_UTF8 - static uint8_t lv_text_utf8_size(const char * str); - static uint32_t lv_text_unicode_to_utf8(uint32_t letter_uni); - static uint32_t lv_text_utf8_conv_wc(uint32_t c); - static uint32_t lv_text_utf8_next(const char * txt, uint32_t * i); - static uint32_t lv_text_utf8_prev(const char * txt, uint32_t * i_start); - static uint32_t lv_text_utf8_get_byte_id(const char * txt, uint32_t utf8_id); - static uint32_t lv_text_utf8_get_char_id(const char * txt, uint32_t byte_id); - static uint32_t lv_text_utf8_get_length(const char * txt); + static uint8_t lv_txt_utf8_size(const char * str); + static uint32_t lv_txt_unicode_to_utf8(uint32_t letter_uni); + static uint32_t lv_txt_utf8_conv_wc(uint32_t c); + static uint32_t lv_txt_utf8_next(const char * txt, uint32_t * i); + static uint32_t lv_txt_utf8_prev(const char * txt, uint32_t * i_start); + static uint32_t lv_txt_utf8_get_byte_id(const char * txt, uint32_t utf8_id); + static uint32_t lv_txt_utf8_get_char_id(const char * txt, uint32_t byte_id); + static uint32_t lv_txt_utf8_get_length(const char * txt); #elif LV_TXT_ENC == LV_TXT_ENC_ASCII - static uint8_t lv_text_iso8859_1_size(const char * str); - static uint32_t lv_text_unicode_to_iso8859_1(uint32_t letter_uni); - static uint32_t lv_text_iso8859_1_conv_wc(uint32_t c); - static uint32_t lv_text_iso8859_1_next(const char * txt, uint32_t * i); - static uint32_t lv_text_iso8859_1_prev(const char * txt, uint32_t * i_start); - static uint32_t lv_text_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id); - static uint32_t lv_text_iso8859_1_get_char_id(const char * txt, uint32_t byte_id); - static uint32_t lv_text_iso8859_1_get_length(const char * txt); + static uint8_t lv_txt_iso8859_1_size(const char * str); + static uint32_t lv_txt_unicode_to_iso8859_1(uint32_t letter_uni); + static uint32_t lv_txt_iso8859_1_conv_wc(uint32_t c); + static uint32_t lv_txt_iso8859_1_next(const char * txt, uint32_t * i); + static uint32_t lv_txt_iso8859_1_prev(const char * txt, uint32_t * i_start); + static uint32_t lv_txt_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id); + static uint32_t lv_txt_iso8859_1_get_char_id(const char * txt, uint32_t byte_id); + static uint32_t lv_txt_iso8859_1_get_length(const char * txt); #endif /********************** * STATIC VARIABLES @@ -55,23 +54,23 @@ * GLOBAL VARIABLES **********************/ #if LV_TXT_ENC == LV_TXT_ENC_UTF8 - uint8_t (*const lv_text_encoded_size)(const char *) = lv_text_utf8_size; - uint32_t (*const lv_text_unicode_to_encoded)(uint32_t) = lv_text_unicode_to_utf8; - uint32_t (*const lv_text_encoded_conv_wc)(uint32_t) = lv_text_utf8_conv_wc; - uint32_t (*const lv_text_encoded_next)(const char *, uint32_t *) = lv_text_utf8_next; - uint32_t (*const lv_text_encoded_prev)(const char *, uint32_t *) = lv_text_utf8_prev; - uint32_t (*const lv_text_encoded_get_byte_id)(const char *, uint32_t) = lv_text_utf8_get_byte_id; - uint32_t (*const lv_text_encoded_get_char_id)(const char *, uint32_t) = lv_text_utf8_get_char_id; - uint32_t (*const lv_text_get_encoded_length)(const char *) = lv_text_utf8_get_length; + uint8_t (*_lv_txt_encoded_size)(const char *) = lv_txt_utf8_size; + uint32_t (*_lv_txt_unicode_to_encoded)(uint32_t) = lv_txt_unicode_to_utf8; + uint32_t (*_lv_txt_encoded_conv_wc)(uint32_t) = lv_txt_utf8_conv_wc; + uint32_t (*_lv_txt_encoded_next)(const char *, uint32_t *) = lv_txt_utf8_next; + uint32_t (*_lv_txt_encoded_prev)(const char *, uint32_t *) = lv_txt_utf8_prev; + uint32_t (*_lv_txt_encoded_get_byte_id)(const char *, uint32_t) = lv_txt_utf8_get_byte_id; + uint32_t (*_lv_txt_encoded_get_char_id)(const char *, uint32_t) = lv_txt_utf8_get_char_id; + uint32_t (*_lv_txt_get_encoded_length)(const char *) = lv_txt_utf8_get_length; #elif LV_TXT_ENC == LV_TXT_ENC_ASCII - uint8_t (*const lv_text_encoded_size)(const char *) = lv_text_iso8859_1_size; - uint32_t (*const lv_text_unicode_to_encoded)(uint32_t) = lv_text_unicode_to_iso8859_1; - uint32_t (*const lv_text_encoded_conv_wc)(uint32_t) = lv_text_iso8859_1_conv_wc; - uint32_t (*const lv_text_encoded_next)(const char *, uint32_t *) = lv_text_iso8859_1_next; - uint32_t (*const lv_text_encoded_prev)(const char *, uint32_t *) = lv_text_iso8859_1_prev; - uint32_t (*const lv_text_encoded_get_byte_id)(const char *, uint32_t) = lv_text_iso8859_1_get_byte_id; - uint32_t (*const lv_text_encoded_get_char_id)(const char *, uint32_t) = lv_text_iso8859_1_get_char_id; - uint32_t (*const lv_text_get_encoded_length)(const char *) = lv_text_iso8859_1_get_length; + uint8_t (*_lv_txt_encoded_size)(const char *) = lv_txt_iso8859_1_size; + uint32_t (*_lv_txt_unicode_to_encoded)(uint32_t) = lv_txt_unicode_to_iso8859_1; + uint32_t (*_lv_txt_encoded_conv_wc)(uint32_t) = lv_txt_iso8859_1_conv_wc; + uint32_t (*_lv_txt_encoded_next)(const char *, uint32_t *) = lv_txt_iso8859_1_next; + uint32_t (*_lv_txt_encoded_prev)(const char *, uint32_t *) = lv_txt_iso8859_1_prev; + uint32_t (*_lv_txt_encoded_get_byte_id)(const char *, uint32_t) = lv_txt_iso8859_1_get_byte_id; + uint32_t (*_lv_txt_encoded_get_char_id)(const char *, uint32_t) = lv_txt_iso8859_1_get_char_id; + uint32_t (*_lv_txt_get_encoded_length)(const char *) = lv_txt_iso8859_1_get_length; #endif @@ -89,8 +88,8 @@ * GLOBAL FUNCTIONS **********************/ -void lv_text_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, int32_t letter_space, - int32_t line_space, int32_t max_width, lv_text_flag_t flag) +void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space, + lv_coord_t line_space, lv_coord_t max_width, lv_text_flag_t flag) { size_res->x = 0; size_res->y = 0; @@ -106,10 +105,10 @@ void lv_text_get_size(lv_point_t * size_res, const char * text, const lv_font_t /*Calc. the height and longest line*/ while(text[line_start] != '\0') { - new_line_start += lv_text_get_next_line(&text[line_start], font, letter_space, max_width, NULL, flag); + new_line_start += _lv_txt_get_next_line(&text[line_start], font, letter_space, max_width, NULL, flag); - if((unsigned long)size_res->y + (unsigned long)letter_height + (unsigned long)line_space > LV_MAX_OF(int32_t)) { - LV_LOG_WARN("integer overflow while calculating text height"); + if((unsigned long)size_res->y + (unsigned long)letter_height + (unsigned long)line_space > LV_MAX_OF(lv_coord_t)) { + LV_LOG_WARN("lv_txt_get_size: integer overflow while calculating text height"); return; } else { @@ -118,7 +117,8 @@ void lv_text_get_size(lv_point_t * size_res, const char * text, const lv_font_t } /*Calculate the longest line*/ - int32_t act_line_length = lv_text_get_width(&text[line_start], new_line_start - line_start, font, letter_space); + lv_coord_t act_line_length = lv_txt_get_width(&text[line_start], new_line_start - line_start, font, letter_space, + flag); size_res->x = LV_MAX(act_line_length, size_res->x); line_start = new_line_start; @@ -145,7 +145,7 @@ void lv_text_get_size(lv_point_t * size_res, const char * text, const lv_font_t * * If the first character is a break character, returns the next index. * - * Example calls from lv_text_get_next_line() assuming sufficient max_width and + * Example calls from lv_txt_get_next_line() assuming sufficient max_width and * txt = "Test text\n" * 0123456789 * @@ -153,7 +153,7 @@ void lv_text_get_size(lv_point_t * size_res, const char * text, const lv_font_t * 1. Return i=4, pointing at breakchar ' ', for the string "Test" * 2. Return i=5, since i=4 was a breakchar. * 3. Return i=9, pointing at breakchar '\n' - * 4. Parenting lv_text_get_next_line() would detect subsequent '\0' + * 4. Parenting lv_txt_get_next_line() would detect subsequent '\0' * * TODO: Returned word_w_ptr may overestimate the returned word's width when * max_width is reached. In current usage, this has no impact. @@ -164,11 +164,13 @@ void lv_text_get_size(lv_point_t * size_res, const char * text, const lv_font_t * @param max_width max width of the text (break the lines to fit this size). Set COORD_MAX to avoid line breaks * @param flags settings for the text from 'txt_flag_type' enum * @param[out] word_w_ptr width (in pixels) of the parsed word. May be NULL. + * @param cmd_state pointer to a txt_cmd_state_t variable which stores the current state of command processing + * @param force Force return the fraction of the word that can fit in the provided space. * @return the index of the first char of the next word (in byte index not letter index. With UTF-8 they are different) */ -static uint32_t lv_text_get_next_word(const char * txt, const lv_font_t * font, - int32_t letter_space, int32_t max_width, - lv_text_flag_t flag, uint32_t * word_w_ptr) +static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font, + lv_coord_t letter_space, lv_coord_t max_width, + lv_text_flag_t flag, uint32_t * word_w_ptr, lv_text_cmd_state_t * cmd_state, bool force) { if(txt == NULL || txt[0] == '\0') return 0; if(font == NULL) return 0; @@ -178,20 +180,30 @@ static uint32_t lv_text_get_next_word(const char * txt, const lv_font_t * font, uint32_t i = 0, i_next = 0, i_next_next = 0; /*Iterating index into txt*/ uint32_t letter = 0; /*Letter at i*/ uint32_t letter_next = 0; /*Letter at i_next*/ - int32_t letter_w; - int32_t cur_w = 0; /*Pixel Width of traversed string*/ - uint32_t word_len = 0; /*Number of characters in the traversed word*/ + lv_coord_t letter_w; + lv_coord_t cur_w = 0; /*Pixel Width of transversed string*/ + uint32_t word_len = 0; /*Number of characters in the transversed word*/ uint32_t break_index = NO_BREAK_FOUND; /*only used for "long" words*/ uint32_t break_letter_count = 0; /*Number of characters up to the long word break point*/ - letter = lv_text_encoded_next(txt, &i_next); + letter = _lv_txt_encoded_next(txt, &i_next); i_next_next = i_next; /*Obtain the full word, regardless if it fits or not in max_width*/ while(txt[i] != '\0') { - letter_next = lv_text_encoded_next(txt, &i_next_next); + letter_next = _lv_txt_encoded_next(txt, &i_next_next); word_len++; + /*Handle the recolor command*/ + if((flag & LV_TEXT_FLAG_RECOLOR) != 0) { + if(_lv_txt_is_cmd(cmd_state, letter) != false) { + i = i_next; + i_next = i_next_next; + letter = letter_next; + continue; /*Skip the letter if it is part of a command*/ + } + } + letter_w = lv_font_get_glyph_width(font, letter, letter_next); cur_w += letter_w; @@ -207,19 +219,13 @@ static uint32_t lv_text_get_next_word(const char * txt, const lv_font_t * font, } /*Check for new line chars and breakchars*/ - if(letter == '\n' || letter == '\r' || lv_text_is_break_char(letter)) { + if(letter == '\n' || letter == '\r' || _lv_txt_is_break_char(letter)) { /*Update the output width on the first character if it fits. *Must do this here in case first letter is a break character.*/ if(i == 0 && break_index == NO_BREAK_FOUND && word_w_ptr != NULL) *word_w_ptr = cur_w; word_len--; break; } - else if(lv_text_is_a_word(letter_next) || lv_text_is_a_word(letter)) { - /*Found a word for single letter, usually true for CJK*/ - *word_w_ptr = cur_w; - i = i_next; - break; - } /*Update the output width*/ if(word_w_ptr != NULL && break_index == NO_BREAK_FOUND) *word_w_ptr = cur_w; @@ -238,14 +244,14 @@ static uint32_t lv_text_get_next_word(const char * txt, const lv_font_t * font, #if LV_TXT_LINE_BREAK_LONG_LEN > 0 /*Word doesn't fit in provided space, but isn't "long"*/ if(word_len < LV_TXT_LINE_BREAK_LONG_LEN) { - if(flag & LV_TEXT_FLAG_BREAK_ALL) return break_index; + if(force) return break_index; if(word_w_ptr != NULL) *word_w_ptr = 0; /*Return no word*/ return 0; } /*Word is "long," but insufficient amounts can fit in provided space*/ if(break_letter_count < LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN) { - if(flag & LV_TEXT_FLAG_BREAK_ALL) return break_index; + if(force) return break_index; if(word_w_ptr != NULL) *word_w_ptr = 0; return 0; } @@ -256,25 +262,23 @@ static uint32_t lv_text_get_next_word(const char * txt, const lv_font_t * font, int32_t n_move = LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN - (word_len - break_letter_count); /*Move pointer "i" backwards*/ for(; n_move > 0; n_move--) { - lv_text_encoded_prev(txt, &i); - /** - * TODO: it would be appropriate to update the returned - * word width hereHowever, in current usage, this doesn't impact anything. - */ + _lv_txt_encoded_prev(txt, &i); + // TODO: it would be appropriate to update the returned word width here + // However, in current usage, this doesn't impact anything. } } return i; #else - if(flag & LV_TEXT_FLAG_BREAK_ALL) return break_index; + if(force) return break_index; if(word_w_ptr != NULL) *word_w_ptr = 0; /*Return no word*/ (void) break_letter_count; return 0; #endif } -uint32_t lv_text_get_next_line(const char * txt, const lv_font_t * font, - int32_t letter_space, int32_t max_width, - int32_t * used_width, lv_text_flag_t flag) +uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, + lv_coord_t letter_space, lv_coord_t max_width, + lv_coord_t * used_width, lv_text_flag_t flag) { if(used_width) *used_width = 0; @@ -282,9 +286,9 @@ uint32_t lv_text_get_next_line(const char * txt, const lv_font_t * font, if(txt[0] == '\0') return 0; if(font == NULL) return 0; - int32_t line_w = 0; + lv_coord_t line_w = 0; - /*If max_width doesn't matter simply find the new line character + /*If max_width doesn't mater simply find the new line character *without thinking about word wrapping*/ if((flag & LV_TEXT_FLAG_EXPAND) || (flag & LV_TEXT_FLAG_FIT)) { uint32_t i; @@ -297,14 +301,12 @@ uint32_t lv_text_get_next_line(const char * txt, const lv_font_t * font, } if(flag & LV_TEXT_FLAG_EXPAND) max_width = LV_COORD_MAX; + lv_text_cmd_state_t cmd_state = LV_TEXT_CMD_STATE_WAIT; uint32_t i = 0; /*Iterating index into txt*/ while(txt[i] != '\0' && max_width > 0) { - lv_text_flag_t word_flag = flag; - if(i == 0) word_flag |= LV_TEXT_FLAG_BREAK_ALL; - uint32_t word_w = 0; - uint32_t advance = lv_text_get_next_word(&txt[i], font, letter_space, max_width, word_flag, &word_w); + uint32_t advance = lv_txt_get_next_word(&txt[i], font, letter_space, max_width, flag, &word_w, &cmd_state, i == 0); max_width -= word_w; line_w += word_w; @@ -325,7 +327,7 @@ uint32_t lv_text_get_next_line(const char * txt, const lv_font_t * font, /*Always step at least one to avoid infinite loops*/ if(i == 0) { - uint32_t letter = lv_text_encoded_next(txt, &i); + uint32_t letter = _lv_txt_encoded_next(txt, &i); if(used_width != NULL) { line_w = lv_font_get_glyph_width(font, letter, '\0'); } @@ -338,22 +340,30 @@ uint32_t lv_text_get_next_line(const char * txt, const lv_font_t * font, return i; } -int32_t lv_text_get_width(const char * txt, uint32_t length, const lv_font_t * font, int32_t letter_space) +lv_coord_t lv_txt_get_width(const char * txt, uint32_t length, const lv_font_t * font, lv_coord_t letter_space, + lv_text_flag_t flag) { if(txt == NULL) return 0; if(font == NULL) return 0; if(txt[0] == '\0') return 0; uint32_t i = 0; - int32_t width = 0; + lv_coord_t width = 0; + lv_text_cmd_state_t cmd_state = LV_TEXT_CMD_STATE_WAIT; if(length != 0) { while(i < length) { uint32_t letter; uint32_t letter_next; - lv_text_encoded_letter_next_2(txt, &letter, &letter_next, &i); + _lv_txt_encoded_letter_next_2(txt, &letter, &letter_next, &i); + + if((flag & LV_TEXT_FLAG_RECOLOR) != 0) { + if(_lv_txt_is_cmd(&cmd_state, letter) != false) { + continue; + } + } - int32_t char_width = lv_font_get_glyph_width(font, letter, letter_next); + lv_coord_t char_width = lv_font_get_glyph_width(font, letter, letter_next); if(char_width > 0) { width += char_width; width += letter_space; @@ -369,16 +379,47 @@ int32_t lv_text_get_width(const char * txt, uint32_t length, const lv_font_t * f return width; } -void lv_text_ins(char * txt_buf, uint32_t pos, const char * ins_txt) +bool _lv_txt_is_cmd(lv_text_cmd_state_t * state, uint32_t c) +{ + bool ret = false; + + if(c == (uint32_t)LV_TXT_COLOR_CMD[0]) { + if(*state == LV_TEXT_CMD_STATE_WAIT) { /*Start char*/ + *state = LV_TEXT_CMD_STATE_PAR; + ret = true; + } + /*Other start char in parameter is escaped cmd. char*/ + else if(*state == LV_TEXT_CMD_STATE_PAR) { + *state = LV_TEXT_CMD_STATE_WAIT; + } + /*Command end*/ + else if(*state == LV_TEXT_CMD_STATE_IN) { + *state = LV_TEXT_CMD_STATE_WAIT; + ret = true; + } + } + + /*Skip the color parameter and wait the space after it*/ + if(*state == LV_TEXT_CMD_STATE_PAR) { + if(c == ' ') { + *state = LV_TEXT_CMD_STATE_IN; /*After the parameter the text is in the command*/ + } + ret = true; + } + + return ret; +} + +void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt) { if(txt_buf == NULL || ins_txt == NULL) return; - size_t old_len = lv_strlen(txt_buf); - size_t ins_len = lv_strlen(ins_txt); + size_t old_len = strlen(txt_buf); + size_t ins_len = strlen(ins_txt); if(ins_len == 0) return; size_t new_len = ins_len + old_len; - pos = lv_text_encoded_get_byte_id(txt_buf, pos); /*Convert to byte index instead of letter index*/ + pos = _lv_txt_encoded_get_byte_id(txt_buf, pos); /*Convert to byte index instead of letter index*/ /*Copy the second part into the end to make place to text to insert*/ size_t i; @@ -387,17 +428,17 @@ void lv_text_ins(char * txt_buf, uint32_t pos, const char * ins_txt) } /*Copy the text into the new space*/ - lv_memcpy(txt_buf + pos, ins_txt, ins_len); + lv_memcpy_small(txt_buf + pos, ins_txt, ins_len); } -void lv_text_cut(char * txt, uint32_t pos, uint32_t len) +void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len) { if(txt == NULL) return; - size_t old_len = lv_strlen(txt); + size_t old_len = strlen(txt); - pos = lv_text_encoded_get_byte_id(txt, pos); /*Convert to byte index instead of letter index*/ - len = lv_text_encoded_get_byte_id(&txt[pos], len); + pos = _lv_txt_encoded_get_byte_id(txt, pos); /*Convert to byte index instead of letter index*/ + len = _lv_txt_encoded_get_byte_id(&txt[pos], len); /*Copy the second part into the end to make place to text to insert*/ uint32_t i; @@ -406,7 +447,7 @@ void lv_text_cut(char * txt, uint32_t pos, uint32_t len) } } -char * lv_text_set_text_vfmt(const char * fmt, va_list ap) +char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap) { /*Allocate space for the new text by using trick from C99 standard section 7.19.6.12*/ va_list ap_copy; @@ -417,7 +458,7 @@ char * lv_text_set_text_vfmt(const char * fmt, va_list ap) char * text = 0; #if LV_USE_ARABIC_PERSIAN_CHARS /*Put together the text according to the format string*/ - char * raw_txt = lv_malloc(len + 1); + char * raw_txt = lv_mem_buf_get(len + 1); LV_ASSERT_MALLOC(raw_txt); if(raw_txt == NULL) { return NULL; @@ -426,21 +467,22 @@ char * lv_text_set_text_vfmt(const char * fmt, va_list ap) lv_vsnprintf(raw_txt, len + 1, fmt, ap); /*Get the size of the Arabic text and process it*/ - size_t len_ap = lv_text_ap_calc_bytes_count(raw_txt); - text = lv_malloc(len_ap + 1); + size_t len_ap = _lv_txt_ap_calc_bytes_cnt(raw_txt); + text = lv_mem_alloc(len_ap + 1); LV_ASSERT_MALLOC(text); if(text == NULL) { return NULL; } - lv_text_ap_proc(raw_txt, text); + _lv_txt_ap_proc(raw_txt, text); - lv_free(raw_txt); + lv_mem_buf_release(raw_txt); #else - text = lv_malloc(len + 1); + text = lv_mem_alloc(len + 1); LV_ASSERT_MALLOC(text); if(text == NULL) { return NULL; } + text[len] = 0; /*Ensure NULL termination*/ lv_vsnprintf(text, len + 1, fmt, ap); #endif @@ -448,10 +490,10 @@ char * lv_text_set_text_vfmt(const char * fmt, va_list ap) return text; } -void lv_text_encoded_letter_next_2(const char * txt, uint32_t * letter, uint32_t * letter_next, uint32_t * ofs) +void _lv_txt_encoded_letter_next_2(const char * txt, uint32_t * letter, uint32_t * letter_next, uint32_t * ofs) { - *letter = lv_text_encoded_next(txt, ofs); - *letter_next = *letter != '\0' ? lv_text_encoded_next(&txt[*ofs], NULL) : 0; + *letter = _lv_txt_encoded_next(txt, ofs); + *letter_next = *letter != '\0' ? _lv_txt_encoded_next(&txt[*ofs], NULL) : 0; } #if LV_TXT_ENC == LV_TXT_ENC_UTF8 @@ -464,7 +506,7 @@ void lv_text_encoded_letter_next_2(const char * txt, uint32_t * letter, uint32_t * @param str pointer to a character in a string * @return length of the UTF-8 character (1,2,3 or 4), 0 on invalid code. */ -static uint8_t lv_text_utf8_size(const char * str) +static uint8_t lv_txt_utf8_size(const char * str) { if(LV_IS_ASCII(str[0])) return 1; @@ -482,7 +524,7 @@ static uint8_t lv_text_utf8_size(const char * str) * @param letter_uni a Unicode letter * @return UTF-8 coded character in Little Endian to be compatible with C chars (e.g. 'Á', 'Ű') */ -static uint32_t lv_text_unicode_to_utf8(uint32_t letter_uni) +static uint32_t lv_txt_unicode_to_utf8(uint32_t letter_uni) { if(letter_uni < 128) return letter_uni; uint8_t bytes[4]; @@ -518,14 +560,14 @@ static uint32_t lv_text_unicode_to_utf8(uint32_t letter_uni) * @param c a wide character or a Little endian number * @return `c` in big endian */ -static uint32_t lv_text_utf8_conv_wc(uint32_t c) +static uint32_t lv_txt_utf8_conv_wc(uint32_t c) { #if LV_BIG_ENDIAN_SYSTEM == 0 /*Swap the bytes (UTF-8 is big endian, but the MCUs are little endian)*/ if((c & 0x80) != 0) { uint32_t swapped; uint8_t c8[4]; - lv_memcpy(c8, &c, 4); + lv_memcpy_small(c8, &c, 4); swapped = (c8[0] << 24) + (c8[1] << 16) + (c8[2] << 8) + (c8[3]); uint8_t i; for(i = 0; i < 4; i++) { @@ -546,7 +588,7 @@ static uint32_t lv_text_utf8_conv_wc(uint32_t c) * NULL to use txt[0] as index * @return the decoded Unicode character or 0 on invalid UTF-8 code */ -static uint32_t lv_text_utf8_next(const char * txt, uint32_t * i) +static uint32_t lv_txt_utf8_next(const char * txt, uint32_t * i) { /** * Unicode to UTF-8 @@ -621,7 +663,7 @@ static uint32_t lv_text_utf8_next(const char * txt, uint32_t * i) * UTF-8 char in 'txt'. * @return the decoded Unicode character or 0 on invalid UTF-8 code */ -static uint32_t lv_text_utf8_prev(const char * txt, uint32_t * i) +static uint32_t lv_txt_utf8_prev(const char * txt, uint32_t * i) { uint8_t c_size; uint8_t cnt = 0; @@ -631,7 +673,7 @@ static uint32_t lv_text_utf8_prev(const char * txt, uint32_t * i) do { if(cnt >= 4) return 0; /*No UTF-8 char found before the initial*/ - c_size = lv_text_encoded_size(&txt[*i]); + c_size = _lv_txt_encoded_size(&txt[*i]); if(c_size == 0) { if(*i != 0) (*i)--; @@ -642,7 +684,7 @@ static uint32_t lv_text_utf8_prev(const char * txt, uint32_t * i) } while(c_size == 0); uint32_t i_tmp = *i; - uint32_t letter = lv_text_encoded_next(txt, &i_tmp); /*Character found, get it*/ + uint32_t letter = _lv_txt_encoded_next(txt, &i_tmp); /*Character found, get it*/ return letter; } @@ -654,12 +696,12 @@ static uint32_t lv_text_utf8_prev(const char * txt, uint32_t * i) * @param utf8_id character index * @return byte index of the 'utf8_id'th letter */ -static uint32_t lv_text_utf8_get_byte_id(const char * txt, uint32_t utf8_id) +static uint32_t lv_txt_utf8_get_byte_id(const char * txt, uint32_t utf8_id) { uint32_t i; uint32_t byte_cnt = 0; for(i = 0; i < utf8_id && txt[byte_cnt] != '\0'; i++) { - uint8_t c_size = lv_text_encoded_size(&txt[byte_cnt]); + uint8_t c_size = _lv_txt_encoded_size(&txt[byte_cnt]); /* If the char was invalid tell it's 1 byte long*/ byte_cnt += c_size ? c_size : 1; } @@ -674,13 +716,13 @@ static uint32_t lv_text_utf8_get_byte_id(const char * txt, uint32_t utf8_id) * @param byte_id byte index * @return character index of the letter at 'byte_id'th position */ -static uint32_t lv_text_utf8_get_char_id(const char * txt, uint32_t byte_id) +static uint32_t lv_txt_utf8_get_char_id(const char * txt, uint32_t byte_id) { uint32_t i = 0; uint32_t char_cnt = 0; while(i < byte_id) { - lv_text_encoded_next(txt, &i); /*'i' points to the next letter so use the prev. value*/ + _lv_txt_encoded_next(txt, &i); /*'i' points to the next letter so use the prev. value*/ char_cnt++; } @@ -693,13 +735,13 @@ static uint32_t lv_text_utf8_get_char_id(const char * txt, uint32_t byte_id) * @param txt a '\0' terminated char string * @return number of characters */ -static uint32_t lv_text_utf8_get_length(const char * txt) +static uint32_t lv_txt_utf8_get_length(const char * txt) { uint32_t len = 0; uint32_t i = 0; while(txt[i] != '\0') { - lv_text_encoded_next(txt, &i); + _lv_txt_encoded_next(txt, &i); len++; } @@ -714,9 +756,9 @@ static uint32_t lv_text_utf8_get_length(const char * txt) /** * Give the size of an ISO8859-1 coded character * @param str pointer to a character in a string - * @return length of the ISO8859-1 coded character, will be always 1. + * @return length of the UTF-8 character (1,2,3 or 4). O on invalid code */ -static uint8_t lv_text_iso8859_1_size(const char * str) +static uint8_t lv_txt_iso8859_1_size(const char * str) { LV_UNUSED(str); /*Unused*/ return 1; @@ -727,7 +769,7 @@ static uint8_t lv_text_iso8859_1_size(const char * str) * @param letter_uni a Unicode letter * @return ISO8859-1 coded character in Little Endian to be compatible with C chars (e.g. 'Á', 'Ű') */ -static uint32_t lv_text_unicode_to_iso8859_1(uint32_t letter_uni) +static uint32_t lv_txt_unicode_to_iso8859_1(uint32_t letter_uni) { if(letter_uni < 256) return letter_uni; @@ -741,7 +783,7 @@ static uint32_t lv_text_unicode_to_iso8859_1(uint32_t letter_uni) * @param c a character, e.g. 'A' * @return same as `c` */ -static uint32_t lv_text_iso8859_1_conv_wc(uint32_t c) +static uint32_t lv_txt_iso8859_1_conv_wc(uint32_t c) { return c; } @@ -750,11 +792,11 @@ static uint32_t lv_text_iso8859_1_conv_wc(uint32_t c) * Decode an ISO8859-1 character from a string. * @param txt pointer to '\0' terminated string * @param i start byte index in 'txt' where to start. - * After call it will point to the next ISO8859-1 coded char in 'txt'. + * After call it will point to the next UTF-8 char in 'txt'. * NULL to use txt[0] as index - * @return the decoded ISO8859-1 character. + * @return the decoded Unicode character or 0 on invalid UTF-8 code */ -static uint32_t lv_text_iso8859_1_next(const char * txt, uint32_t * i) +static uint32_t lv_txt_iso8859_1_next(const char * txt, uint32_t * i) { if(i == NULL) return txt[0]; /*Get the next char*/ @@ -766,10 +808,10 @@ static uint32_t lv_text_iso8859_1_next(const char * txt, uint32_t * i) /** * Get previous ISO8859-1 character form a string. * @param txt pointer to '\0' terminated string - * @param i start byte index in 'txt' where to start. After the call it will point to the previous ISO8859-1 coded char in 'txt'. - * @return the decoded ISO8859-1 character. + * @param i start byte index in 'txt' where to start. After the call it will point to the previous UTF-8 char in 'txt'. + * @return the decoded Unicode character or 0 on invalid UTF-8 code */ -static uint32_t lv_text_iso8859_1_prev(const char * txt, uint32_t * i) +static uint32_t lv_txt_iso8859_1_prev(const char * txt, uint32_t * i) { if(i == NULL) return *(txt - 1); /*Get the prev. char*/ @@ -781,12 +823,12 @@ static uint32_t lv_text_iso8859_1_prev(const char * txt, uint32_t * i) /** * Convert a character index (in an ISO8859-1 text) to byte index. - * The ISO8859-1 encoding is compatible with ASCII so the indices of characters is the same as the indices of bytes. - * @param txt a '\0' terminated char string + * E.g. in "AÁRT" index of 'R' is 2th char but start at byte 3 because 'Á' is 2 bytes long + * @param txt a '\0' terminated UTF-8 string * @param utf8_id character index * @return byte index of the 'utf8_id'th letter */ -static uint32_t lv_text_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id) +static uint32_t lv_txt_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id) { LV_UNUSED(txt); /*Unused*/ return utf8_id; /*In Non encoded no difference*/ @@ -794,26 +836,26 @@ static uint32_t lv_text_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id /** * Convert a byte index (in an ISO8859-1 text) to character index. - * The ISO8859-1 encoding is compatible with ASCII so the indices of characters is the same as the indices of bytes. - * @param txt a '\0' terminated char string + * E.g. in "AÁRT" index of 'R' is 2th char but start at byte 3 because 'Á' is 2 bytes long + * @param txt a '\0' terminated UTF-8 string * @param byte_id byte index * @return character index of the letter at 'byte_id'th position */ -static uint32_t lv_text_iso8859_1_get_char_id(const char * txt, uint32_t byte_id) +static uint32_t lv_txt_iso8859_1_get_char_id(const char * txt, uint32_t byte_id) { LV_UNUSED(txt); /*Unused*/ return byte_id; /*In Non encoded no difference*/ } /** - * Get the number of characters (and NOT bytes) in a string. - * The ISO8859-1 encoding is compatible with ASCII so the number of characters is the same as the number of bytes. + * Get the number of characters (and NOT bytes) in a string. Decode it with UTF-8 if enabled. + * E.g.: "ÁBC" is 3 characters (but 4 bytes) * @param txt a '\0' terminated char string * @return number of characters */ -static uint32_t lv_text_iso8859_1_get_length(const char * txt) +static uint32_t lv_txt_iso8859_1_get_length(const char * txt) { - return lv_strlen(txt); + return strlen(txt); } #else diff --git a/L3_Middlewares/LVGL/src/misc/lv_txt.h b/L3_Middlewares/LVGL/src/misc/lv_txt.h new file mode 100644 index 0000000..46050dc --- /dev/null +++ b/L3_Middlewares/LVGL/src/misc/lv_txt.h @@ -0,0 +1,264 @@ +/** + * @file lv_txt.h + * + */ + +#ifndef LV_TXT_H +#define LV_TXT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" + +#include +#include +#include "lv_area.h" +#include "../font/lv_font.h" +#include "lv_printf.h" +#include "lv_types.h" + +/********************* + * DEFINES + *********************/ +#ifndef LV_TXT_COLOR_CMD +#define LV_TXT_COLOR_CMD "#" +#endif + +#define LV_TXT_ENC_UTF8 1 +#define LV_TXT_ENC_ASCII 2 + +/********************** + * TYPEDEFS + **********************/ + +/** + * Options for text rendering. + */ +enum { + LV_TEXT_FLAG_NONE = 0x00, + LV_TEXT_FLAG_RECOLOR = 0x01, /**< Enable parsing of recolor command*/ + LV_TEXT_FLAG_EXPAND = 0x02, /**< Ignore max-width to avoid automatic word wrapping*/ + LV_TEXT_FLAG_FIT = 0x04, /**< Max-width is already equal to the longest line. (Used to skip some calculation)*/ +}; +typedef uint8_t lv_text_flag_t; + +/** + * State machine for text renderer.*/ +enum { + LV_TEXT_CMD_STATE_WAIT, /**< Waiting for command*/ + LV_TEXT_CMD_STATE_PAR, /**< Processing the parameter*/ + LV_TEXT_CMD_STATE_IN, /**< Processing the command*/ +}; +typedef uint8_t lv_text_cmd_state_t; + +/** Label align policy*/ +enum { + LV_TEXT_ALIGN_AUTO, /**< Align text auto*/ + LV_TEXT_ALIGN_LEFT, /**< Align text to left*/ + LV_TEXT_ALIGN_CENTER, /**< Align text to center*/ + LV_TEXT_ALIGN_RIGHT, /**< Align text to right*/ +}; +typedef uint8_t lv_text_align_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Get size of a text + * @param size_res pointer to a 'point_t' variable to store the result + * @param text pointer to a text + * @param font pointer to font of the text + * @param letter_space letter space of the text + * @param line_space line space of the text + * @param flags settings for the text from ::lv_text_flag_t + * @param max_width max width of the text (break the lines to fit this size). Set COORD_MAX to avoid + * line breaks + */ +void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space, + lv_coord_t line_space, lv_coord_t max_width, lv_text_flag_t flag); + +/** + * Get the next line of text. Check line length and break chars too. + * @param txt a '\0' terminated string + * @param font pointer to a font + * @param letter_space letter space + * @param max_width max width of the text (break the lines to fit this size). Set COORD_MAX to avoid + * line breaks + * @param used_width When used_width != NULL, save the width of this line if + * flag == LV_TEXT_FLAG_NONE, otherwise save -1. + * @param flags settings for the text from 'txt_flag_type' enum + * @return the index of the first char of the new line (in byte index not letter index. With UTF-8 + * they are different) + */ +uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, lv_coord_t letter_space, + lv_coord_t max_width, lv_coord_t * used_width, lv_text_flag_t flag); + +/** + * Give the length of a text with a given font + * @param txt a '\0' terminate string + * @param length length of 'txt' in byte count and not characters (Á is 1 character but 2 bytes in + * UTF-8) + * @param font pointer to a font + * @param letter_space letter space + * @param flags settings for the text from 'txt_flag_t' enum + * @return length of a char_num long text + */ +lv_coord_t lv_txt_get_width(const char * txt, uint32_t length, const lv_font_t * font, lv_coord_t letter_space, + lv_text_flag_t flag); + +/** + * Check next character in a string and decide if the character is part of the command or not + * @param state pointer to a txt_cmd_state_t variable which stores the current state of command + * processing + * @param c the current character + * @return true: the character is part of a command and should not be written, + * false: the character should be written + */ +bool _lv_txt_is_cmd(lv_text_cmd_state_t * state, uint32_t c); + +/** + * Insert a string into an other + * @param txt_buf the original text (must be big enough for the result text and NULL terminated) + * @param pos position to insert (0: before the original text, 1: after the first char etc.) + * @param ins_txt text to insert, must be '\0' terminated + */ +void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt); + +/** + * Delete a part of a string + * @param txt string to modify, must be '\0' terminated and should point to a heap or stack frame, not read-only memory. + * @param pos position where to start the deleting (0: before the first char, 1: after the first + * char etc.) + * @param len number of characters to delete + */ +void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len); + +/** + * return a new formatted text. Memory will be allocated to store the text. + * @param fmt `printf`-like format + * @return pointer to the allocated text string. + */ +char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap) LV_FORMAT_ATTRIBUTE(1, 0); + +/** + * Decode two encoded character from a string. + * @param txt pointer to '\0' terminated string + * @param letter the first decoded Unicode character or 0 on invalid data code + * @param letter_next the second decoded Unicode character or 0 on invalid data code + * @param ofs start index in 'txt' where to start. + * After the call it will point to the next encoded char in 'txt'. + * NULL to use txt[0] as index + */ +void _lv_txt_encoded_letter_next_2(const char * txt, uint32_t * letter, uint32_t * letter_next, uint32_t * ofs); + +/** + * Test if char is break char or not (a text can broken here or not) + * @param letter a letter + * @return false: 'letter' is not break char + */ +static inline bool _lv_txt_is_break_char(uint32_t letter) +{ + uint8_t i; + bool ret = false; + + /* each chinese character can be break */ + if(letter >= 0x4E00 && letter <= 0x9FA5) { + return true; + } + + /*Compare the letter to TXT_BREAK_CHARS*/ + for(i = 0; LV_TXT_BREAK_CHARS[i] != '\0'; i++) { + if(letter == (uint32_t)LV_TXT_BREAK_CHARS[i]) { + ret = true; /*If match then it is break char*/ + break; + } + } + + return ret; +} + +/*************************************************************** + * GLOBAL FUNCTION POINTERS FOR CHARACTER ENCODING INTERFACE + ***************************************************************/ + +/** + * Give the size of an encoded character + * @param str pointer to a character in a string + * @return length of the encoded character (1,2,3 ...). O in invalid + */ +extern uint8_t (*_lv_txt_encoded_size)(const char *); + +/** + * Convert a Unicode letter to encoded + * @param letter_uni a Unicode letter + * @return Encoded character in Little Endian to be compatible with C chars (e.g. 'Á', 'Ü') + */ +extern uint32_t (*_lv_txt_unicode_to_encoded)(uint32_t); + +/** + * Convert a wide character, e.g. 'Á' little endian to be compatible with the encoded format. + * @param c a wide character + * @return `c` in the encoded format + */ +extern uint32_t (*_lv_txt_encoded_conv_wc)(uint32_t c); + +/** + * Decode the next encoded character from a string. + * @param txt pointer to '\0' terminated string + * @param i start index in 'txt' where to start. + * After the call it will point to the next encoded char in 'txt'. + * NULL to use txt[0] as index + * @return the decoded Unicode character or 0 on invalid data code + */ +extern uint32_t (*_lv_txt_encoded_next)(const char *, uint32_t *); + +/** + * Get the previous encoded character form a string. + * @param txt pointer to '\0' terminated string + * @param i_start index in 'txt' where to start. After the call it will point to the previous + * encoded char in 'txt'. + * @return the decoded Unicode character or 0 on invalid data + */ +extern uint32_t (*_lv_txt_encoded_prev)(const char *, uint32_t *); + +/** + * Convert a letter index (in the encoded text) to byte index. + * E.g. in UTF-8 "AÁRT" index of 'R' is 2 but start at byte 3 because 'Á' is 2 bytes long + * @param txt a '\0' terminated UTF-8 string + * @param enc_id letter index + * @return byte index of the 'enc_id'th letter + */ +extern uint32_t (*_lv_txt_encoded_get_byte_id)(const char *, uint32_t); + +/** + * Convert a byte index (in an encoded text) to character index. + * E.g. in UTF-8 "AÁRT" index of 'R' is 2 but start at byte 3 because 'Á' is 2 bytes long + * @param txt a '\0' terminated UTF-8 string + * @param byte_id byte index + * @return character index of the letter at 'byte_id'th position + */ +extern uint32_t (*_lv_txt_encoded_get_char_id)(const char *, uint32_t); + +/** + * Get the number of characters (and NOT bytes) in a string. + * E.g. in UTF-8 "ÁBC" is 3 characters (but 4 bytes) + * @param txt a '\0' terminated char string + * @return number of characters + */ +extern uint32_t (*_lv_txt_get_encoded_length)(const char *); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_TXT_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_text_ap.c b/L3_Middlewares/LVGL/src/misc/lv_txt_ap.c similarity index 83% rename from L3_Middlewares/LVGL/src/misc/lv_text_ap.c rename to L3_Middlewares/LVGL/src/misc/lv_txt_ap.c index 320debd..54faf8b 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_text_ap.c +++ b/L3_Middlewares/LVGL/src/misc/lv_txt_ap.c @@ -1,16 +1,16 @@ /** - * @file lv_text_ap.c + * @file lv_txt_ap.c * */ /********************* * INCLUDES *********************/ +#include #include "lv_bidi.h" -#include "lv_text_private.h" -#include "lv_text_ap.h" -#include "lv_types.h" -#include "../stdlib/lv_mem.h" +#include "lv_txt.h" +#include "lv_txt_ap.h" +#include "lv_mem.h" #include "../draw/lv_draw.h" /********************* @@ -23,7 +23,7 @@ typedef struct { uint8_t char_offset; uint16_t char_end_form; - int8_t char_beginning_form_offset; + int8_t char_begining_form_offset; int8_t char_middle_form_offset; int8_t char_isolated_form_offset; struct { @@ -37,8 +37,8 @@ typedef struct { **********************/ #if LV_USE_ARABIC_PERSIAN_CHARS == 1 static uint32_t lv_ap_get_char_index(uint16_t c); -static uint32_t lv_text_lam_alef(uint32_t ch_curr, uint32_t ch_next); -static bool lv_text_is_arabic_vowel(uint16_t c); +static uint32_t lv_txt_lam_alef(uint32_t ch_curr, uint32_t ch_next); +static bool lv_txt_is_arabic_vowel(uint16_t c); /********************** * STATIC VARIABLES @@ -49,7 +49,7 @@ const ap_chars_map_t ap_chars_map[] = { {1, 0xFE84, -1, 0, -1, {1, 0}}, // أ {2, 0xFE86, -1, 0, -1, {1, 0}}, // ؤ {3, 0xFE88, -1, 0, -1, {1, 0}}, // ﺇ - {4, 0xFE8A, 1, 2, -1, {1, 1}}, // ئ + {4, 0xFE8A, 1, 2, -1, {1, 0}}, // ئ {5, 0xFE8E, -1, 0, -1, {1, 0}}, // آ {6, 0xFE90, 1, 2, -1, {1, 1}}, // ب {92, 0xFB57, 1, 2, -1, {1, 1}}, // پ @@ -86,8 +86,8 @@ const ap_chars_map_t ap_chars_map[] = { {39, 0xFEF0, 0, 0, -1, {1, 0}}, // ى {40, 0xFEF2, 1, 2, -1, {1, 1}}, // ي {170, 0xFBFD, 1, 2, -1, {1, 1}}, // ی - {7, 0xFE94, -1, 2, -1, {1, 0}}, // ة - {206, 0x06F0, -1, 2, 0, {0, 0}}, // ۰ + {7, 0xFE94, 1, 2, -1, {1, 0}}, // ة + {206, 0x06F0, 1, 2, -1, {0, 0}}, // ۰ {207, 0x06F1, 0, 0, 0, {0, 0}}, // ۱ {208, 0x06F2, 0, 0, 0, {0, 0}}, // ۲ {209, 0x06F3, 0, 0, 0, {0, 0}}, // ۳ @@ -106,7 +106,7 @@ const ap_chars_map_t ap_chars_map[] = { /********************** * GLOBAL FUNCTIONS **********************/ -uint32_t lv_text_ap_calc_bytes_count(const char * txt) +uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt) { uint32_t txt_length = 0; uint32_t chars_cnt = 0; @@ -114,12 +114,12 @@ uint32_t lv_text_ap_calc_bytes_count(const char * txt) uint32_t i, j; uint32_t ch_enc; - txt_length = lv_text_get_encoded_length(txt); + txt_length = _lv_txt_get_encoded_length(txt); i = 0; j = 0; while(i < txt_length) { - ch_enc = lv_text_encoded_next(txt, &j); + ch_enc = _lv_txt_encoded_next(txt, &j); current_ap_idx = lv_ap_get_char_index(ch_enc); if(current_ap_idx != LV_UNDEF_ARABIC_PERSIAN_CHARS) @@ -140,7 +140,7 @@ uint32_t lv_text_ap_calc_bytes_count(const char * txt) return chars_cnt + 1; } -void lv_text_ap_proc(const char * txt, char * txt_out) +void _lv_txt_ap_proc(const char * txt, char * txt_out) { uint32_t txt_length = 0; uint32_t index_current, idx_next, idx_previous, i, j; @@ -148,15 +148,15 @@ void lv_text_ap_proc(const char * txt, char * txt_out) uint32_t * ch_fin; char * txt_out_temp; - txt_length = lv_text_get_encoded_length(txt); + txt_length = _lv_txt_get_encoded_length(txt); - ch_enc = (uint32_t *)lv_malloc(sizeof(uint32_t) * (txt_length + 1)); - ch_fin = (uint32_t *)lv_malloc(sizeof(uint32_t) * (txt_length + 1)); + ch_enc = (uint32_t *)lv_mem_alloc(sizeof(uint32_t) * (txt_length + 1)); + ch_fin = (uint32_t *)lv_mem_alloc(sizeof(uint32_t) * (txt_length + 1)); i = 0; j = 0; while(j < txt_length) - ch_enc[j++] = lv_text_encoded_next(txt, &i); + ch_enc[j++] = _lv_txt_encoded_next(txt, &i); ch_enc[j] = 0; @@ -167,13 +167,13 @@ void lv_text_ap_proc(const char * txt, char * txt_out) index_current = lv_ap_get_char_index(ch_enc[i]); idx_next = lv_ap_get_char_index(ch_enc[i + 1]); - if(lv_text_is_arabic_vowel(ch_enc[i])) { // Current character is a vowel + if(lv_txt_is_arabic_vowel(ch_enc[i])) { // Current character is a vowel ch_fin[j] = ch_enc[i]; i++; j++; continue; // Skip this character } - else if(lv_text_is_arabic_vowel(ch_enc[i + 1])) { // Next character is a vowel + else if(lv_txt_is_arabic_vowel(ch_enc[i + 1])) { // Next character is a vowel idx_next = lv_ap_get_char_index(ch_enc[i + 2]); // Skip the vowel character to join with the character after it } @@ -185,14 +185,14 @@ void lv_text_ap_proc(const char * txt, char * txt_out) continue; } - uint8_t conjunction_to_previous = (i == 0 || + uint8_t conjunction_to_previuse = (i == 0 || idx_previous == LV_UNDEF_ARABIC_PERSIAN_CHARS) ? 0 : ap_chars_map[idx_previous].ap_chars_conjunction.conj_to_next; uint8_t conjunction_to_next = ((i == txt_length - 1) || idx_next == LV_UNDEF_ARABIC_PERSIAN_CHARS) ? 0 : ap_chars_map[idx_next].ap_chars_conjunction.conj_to_previous; - uint32_t lam_alef = lv_text_lam_alef(index_current, idx_next); + uint32_t lam_alef = lv_txt_lam_alef(index_current, idx_next); if(lam_alef) { - if(conjunction_to_previous) { + if(conjunction_to_previuse) { lam_alef ++; } ch_fin[j] = lam_alef; @@ -202,11 +202,11 @@ void lv_text_ap_proc(const char * txt, char * txt_out) continue; } - if(conjunction_to_previous && conjunction_to_next) + if(conjunction_to_previuse && conjunction_to_next) ch_fin[j] = ap_chars_map[index_current].char_end_form + ap_chars_map[index_current].char_middle_form_offset; - else if(!conjunction_to_previous && conjunction_to_next) - ch_fin[j] = ap_chars_map[index_current].char_end_form + ap_chars_map[index_current].char_beginning_form_offset; - else if(conjunction_to_previous && !conjunction_to_next) + else if(!conjunction_to_previuse && conjunction_to_next) + ch_fin[j] = ap_chars_map[index_current].char_end_form + ap_chars_map[index_current].char_begining_form_offset; + else if(conjunction_to_previuse && !conjunction_to_next) ch_fin[j] = ap_chars_map[index_current].char_end_form; else ch_fin[j] = ap_chars_map[index_current].char_end_form + ap_chars_map[index_current].char_isolated_form_offset; @@ -219,7 +219,7 @@ void lv_text_ap_proc(const char * txt, char * txt_out) ch_enc[i] = 0; for(i = 0; i < j; i++) ch_enc[i] = ch_fin[i]; - lv_free(ch_fin); + lv_mem_free(ch_fin); txt_out_temp = txt_out; i = 0; @@ -247,7 +247,7 @@ void lv_text_ap_proc(const char * txt, char * txt_out) i++; } *(txt_out_temp) = '\0'; - lv_free(ch_enc); + lv_mem_free(ch_enc); } /********************** * STATIC FUNCTIONS @@ -259,7 +259,7 @@ static uint32_t lv_ap_get_char_index(uint16_t c) if(c == (ap_chars_map[i].char_offset + LV_AP_ALPHABET_BASE_CODE)) return i; else if(c == ap_chars_map[i].char_end_form //is it an End form - || c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_beginning_form_offset) //is it a Beginning form + || c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_begining_form_offset) //is it a Beginning form || c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_middle_form_offset) //is it a middle form || c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_isolated_form_offset)) { //is it an isolated form return i; @@ -268,7 +268,7 @@ static uint32_t lv_ap_get_char_index(uint16_t c) return LV_UNDEF_ARABIC_PERSIAN_CHARS; } -static uint32_t lv_text_lam_alef(uint32_t ch_curr, uint32_t ch_next) +static uint32_t lv_txt_lam_alef(uint32_t ch_curr, uint32_t ch_next) { uint32_t ch_code = 0; if(ap_chars_map[ch_curr].char_offset != 34) { @@ -293,7 +293,7 @@ static uint32_t lv_text_lam_alef(uint32_t ch_curr, uint32_t ch_next) return 0; } -static bool lv_text_is_arabic_vowel(uint16_t c) +static bool lv_txt_is_arabic_vowel(uint16_t c) { return (c >= 0x064B) && (c <= 0x0652); } diff --git a/L3_Middlewares/LVGL/src/misc/lv_text_ap.h b/L3_Middlewares/LVGL/src/misc/lv_txt_ap.h similarity index 74% rename from L3_Middlewares/LVGL/src/misc/lv_text_ap.h rename to L3_Middlewares/LVGL/src/misc/lv_txt_ap.h index cac7c71..e2d94b8 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_text_ap.h +++ b/L3_Middlewares/LVGL/src/misc/lv_txt_ap.h @@ -1,10 +1,10 @@ /** - * @file lv_text_ap.h + * @file lv_txt_ap.h * */ -#ifndef LV_TEXT_AP_H -#define LV_TEXT_AP_H +#ifndef LV_TXT_AP_H +#define LV_TXT_AP_H #ifdef __cplusplus extern "C" { @@ -13,8 +13,8 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "lv_text.h" -#include "lv_types.h" +#include +#include "lv_txt.h" #include "../draw/lv_draw.h" #if LV_USE_ARABIC_PERSIAN_CHARS == 1 @@ -33,8 +33,8 @@ extern "C" { /********************** * GLOBAL PROTOTYPES **********************/ -uint32_t lv_text_ap_calc_bytes_count(const char * txt); -void lv_text_ap_proc(const char * txt, char * txt_out); +uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt); +void _lv_txt_ap_proc(const char * txt, char * txt_out); /********************** * MACROS @@ -46,4 +46,4 @@ void lv_text_ap_proc(const char * txt, char * txt_out); } /*extern "C"*/ #endif -#endif /*LV_TEXT_AP_H*/ +#endif /*LV_TXT_AP_H*/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_types.h b/L3_Middlewares/LVGL/src/misc/lv_types.h index b362e7a..84aee10 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_types.h +++ b/L3_Middlewares/LVGL/src/misc/lv_types.h @@ -13,29 +13,20 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../lv_conf_internal.h" - -#ifndef __ASSEMBLY__ -#include LV_STDINT_INCLUDE -#include LV_STDDEF_INCLUDE -#include LV_STDBOOL_INCLUDE -#include LV_INTTYPES_INCLUDE -#include LV_LIMITS_INCLUDE -#include LV_STDARG_INCLUDE -#endif +#include /********************* * DEFINES *********************/ -/*If __UINTPTR_MAX__ or UINTPTR_MAX are available, use them to determine arch size*/ +// If __UINTPTR_MAX__ or UINTPTR_MAX are available, use them to determine arch size #if defined(__UINTPTR_MAX__) && __UINTPTR_MAX__ > 0xFFFFFFFF #define LV_ARCH_64 #elif defined(UINTPTR_MAX) && UINTPTR_MAX > 0xFFFFFFFF #define LV_ARCH_64 -/*Otherwise use compiler-dependent means to determine arch size*/ +// Otherwise use compiler-dependent means to determine arch size #elif defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__) || defined (__aarch64__) #define LV_ARCH_64 @@ -45,301 +36,31 @@ extern "C" { * TYPEDEFS **********************/ -/* Exclude C enum and struct definitions when included by assembly code */ -#ifndef __ASSEMBLY__ - /** * LVGL error codes. */ -typedef enum { - LV_RESULT_INVALID = 0, /*Typically indicates that the object is deleted (become invalid) in the action +enum { + LV_RES_INV = 0, /*Typically indicates that the object is deleted (become invalid) in the action function or an operation was failed*/ - LV_RESULT_OK, /*The object is valid (no deleted) after the action*/ -} lv_result_t; + LV_RES_OK, /*The object is valid (no deleted) after the action*/ +}; +typedef uint8_t lv_res_t; #if defined(__cplusplus) || __STDC_VERSION__ >= 199901L -/*If c99 or newer, use the definition of uintptr_t directly from */ +// If c99 or newer, use the definition of uintptr_t directly from typedef uintptr_t lv_uintptr_t; -typedef intptr_t lv_intptr_t; #else -/*Otherwise, use the arch size determination*/ +// Otherwise, use the arch size determination #ifdef LV_ARCH_64 typedef uint64_t lv_uintptr_t; -typedef int64_t lv_intptr_t; #else typedef uint32_t lv_uintptr_t; -typedef int32_t lv_intptr_t; -#endif - #endif -#if LV_USE_FLOAT -typedef float lv_value_precise_t; -#else -typedef int32_t lv_value_precise_t; -#endif - -/** - * Typedefs from various lvgl modules. - * They are defined here to avoid circular dependencies. - */ - -typedef struct lv_obj_t lv_obj_t; - -typedef uint16_t lv_state_t; -typedef uint32_t lv_part_t; - -typedef uint8_t lv_opa_t; - -typedef uint8_t lv_style_prop_t; - -typedef struct lv_obj_class_t lv_obj_class_t; - -typedef struct lv_group_t lv_group_t; - -typedef struct lv_display_t lv_display_t; - -typedef struct lv_layer_t lv_layer_t; -typedef struct lv_draw_unit_t lv_draw_unit_t; -typedef struct lv_draw_task_t lv_draw_task_t; - -typedef struct lv_indev_t lv_indev_t; - -typedef struct lv_event_t lv_event_t; - -typedef struct lv_timer_t lv_timer_t; - -typedef struct lv_theme_t lv_theme_t; - -typedef struct lv_anim_t lv_anim_t; - -typedef struct lv_font_t lv_font_t; - -typedef struct lv_image_decoder_t lv_image_decoder_t; - -typedef struct lv_image_decoder_dsc_t lv_image_decoder_dsc_t; - -typedef struct lv_fragment_t lv_fragment_t; -typedef struct lv_fragment_class_t lv_fragment_class_t; -typedef struct lv_fragment_managed_states_t lv_fragment_managed_states_t; - -typedef struct lv_profiler_builtin_config_t lv_profiler_builtin_config_t; - -typedef struct lv_rb_node_t lv_rb_node_t; - -typedef struct lv_rb_t lv_rb_t; - -typedef struct lv_color_filter_dsc_t lv_color_filter_dsc_t; - -typedef struct lv_event_dsc_t lv_event_dsc_t; - -typedef struct lv_fs_file_cache_t lv_fs_file_cache_t; - -typedef struct lv_fs_path_ex_t lv_fs_path_ex_t; - -typedef struct lv_image_decoder_args_t lv_image_decoder_args_t; - -typedef struct lv_image_cache_data_t lv_image_cache_data_t; - -typedef struct lv_image_header_cache_data_t lv_image_header_cache_data_t; - -typedef struct lv_draw_mask_t lv_draw_mask_t; - -typedef struct lv_grad_t lv_grad_t; - -typedef struct lv_draw_label_hint_t lv_draw_label_hint_t; - -typedef struct lv_draw_glyph_dsc_t lv_draw_glyph_dsc_t; - -typedef struct lv_draw_image_sup_t lv_draw_image_sup_t; - -typedef struct lv_draw_mask_rect_dsc_t lv_draw_mask_rect_dsc_t; - -typedef struct lv_obj_style_t lv_obj_style_t; - -typedef struct lv_obj_style_transition_dsc_t lv_obj_style_transition_dsc_t; - -typedef struct lv_hit_test_info_t lv_hit_test_info_t; - -typedef struct lv_cover_check_info_t lv_cover_check_info_t; - -typedef struct lv_obj_spec_attr_t lv_obj_spec_attr_t; - -typedef struct lv_image_t lv_image_t; - -typedef struct lv_animimg_t lv_animimg_t; - -typedef struct lv_arc_t lv_arc_t; - -typedef struct lv_label_t lv_label_t; - -typedef struct lv_bar_anim_t lv_bar_anim_t; - -typedef struct lv_bar_t lv_bar_t; - -typedef struct lv_button_t lv_button_t; - -typedef struct lv_buttonmatrix_t lv_buttonmatrix_t; - -typedef struct lv_calendar_t lv_calendar_t; - -typedef struct lv_canvas_t lv_canvas_t; - -typedef struct lv_chart_series_t lv_chart_series_t; - -typedef struct lv_chart_cursor_t lv_chart_cursor_t; - -typedef struct lv_chart_t lv_chart_t; - -typedef struct lv_checkbox_t lv_checkbox_t; - -typedef struct lv_dropdown_t lv_dropdown_t; - -typedef struct lv_dropdown_list_t lv_dropdown_list_t; - -typedef struct lv_imagebutton_src_info_t lv_imagebutton_src_info_t; - -typedef struct lv_imagebutton_t lv_imagebutton_t; - -typedef struct lv_keyboard_t lv_keyboard_t; - -typedef struct lv_led_t lv_led_t; - -typedef struct lv_line_t lv_line_t; - -typedef struct lv_menu_load_page_event_data_t lv_menu_load_page_event_data_t; - -typedef struct lv_menu_history_t lv_menu_history_t; - -typedef struct lv_menu_t lv_menu_t; - -typedef struct lv_menu_page_t lv_menu_page_t; - -typedef struct lv_msgbox_t lv_msgbox_t; - -typedef struct lv_roller_t lv_roller_t; - -typedef struct lv_scale_section_t lv_scale_section_t; - -typedef struct lv_scale_t lv_scale_t; - -typedef struct lv_slider_t lv_slider_t; - -typedef struct lv_span_t lv_span_t; - -typedef struct lv_spangroup_t lv_spangroup_t; - -typedef struct lv_textarea_t lv_textarea_t; - -typedef struct lv_spinbox_t lv_spinbox_t; - -typedef struct lv_switch_t lv_switch_t; - -typedef struct lv_table_cell_t lv_table_cell_t; - -typedef struct lv_table_t lv_table_t; - -typedef struct lv_tabview_t lv_tabview_t; - -typedef struct lv_tileview_t lv_tileview_t; - -typedef struct lv_tileview_tile_t lv_tileview_tile_t; - -typedef struct lv_win_t lv_win_t; - -typedef struct lv_observer_t lv_observer_t; - -typedef struct lv_monkey_config_t lv_monkey_config_t; - -typedef struct lv_ime_pinyin_t lv_ime_pinyin_t; - -typedef struct lv_file_explorer_t lv_file_explorer_t; - -typedef struct lv_barcode_t lv_barcode_t; - -typedef struct lv_gif_t lv_gif_t; - -typedef struct lv_qrcode_t lv_qrcode_t; - -typedef struct lv_freetype_outline_vector_t lv_freetype_outline_vector_t; - -typedef struct lv_freetype_outline_event_param_t lv_freetype_outline_event_param_t; - -typedef struct lv_fpoint_t lv_fpoint_t; - -typedef struct lv_matrix_t lv_matrix_t; - -typedef struct lv_vector_path_t lv_vector_path_t; - -typedef struct lv_vector_gradient_t lv_vector_gradient_t; - -typedef struct lv_vector_fill_dsc_t lv_vector_fill_dsc_t; - -typedef struct lv_vector_stroke_dsc_t lv_vector_stroke_dsc_t; - -typedef struct lv_vector_draw_dsc_t lv_vector_draw_dsc_t; - -typedef struct lv_draw_vector_task_dsc_t lv_draw_vector_task_dsc_t; - -typedef struct lv_vector_dsc_t lv_vector_dsc_t; - -typedef struct lv_xkb_t lv_xkb_t; - -typedef struct lv_libinput_event_t lv_libinput_event_t; - -typedef struct lv_libinput_t lv_libinput_t; - -typedef struct lv_draw_sw_unit_t lv_draw_sw_unit_t; - -typedef struct lv_draw_sw_mask_common_dsc_t lv_draw_sw_mask_common_dsc_t; - -typedef struct lv_draw_sw_mask_line_param_t lv_draw_sw_mask_line_param_t; - -typedef struct lv_draw_sw_mask_angle_param_t lv_draw_sw_mask_angle_param_t; - -typedef struct lv_draw_sw_mask_radius_param_t lv_draw_sw_mask_radius_param_t; - -typedef struct lv_draw_sw_mask_fade_param_t lv_draw_sw_mask_fade_param_t; - -typedef struct lv_draw_sw_mask_map_param_t lv_draw_sw_mask_map_param_t; - -typedef struct lv_draw_sw_blend_dsc_t lv_draw_sw_blend_dsc_t; - -typedef struct lv_draw_sw_blend_fill_dsc_t lv_draw_sw_blend_fill_dsc_t; - -typedef struct lv_draw_sw_blend_image_dsc_t lv_draw_sw_blend_image_dsc_t; - -typedef struct lv_draw_buf_handlers_t lv_draw_buf_handlers_t; - -typedef struct lv_rlottie_t lv_rlottie_t; - -typedef struct lv_ffmpeg_player_t lv_ffmpeg_player_t; - -typedef struct lv_glfw_window_t lv_glfw_window_t; -typedef struct lv_glfw_texture_t lv_glfw_texture_t; - -typedef uint32_t lv_prop_id_t; - -typedef struct lv_draw_buf_t lv_draw_buf_t; - -#if LV_USE_OBJ_PROPERTY -typedef struct lv_property_name_t lv_property_name_t; #endif -#if LV_USE_SYSMON - -typedef struct lv_sysmon_backend_data_t lv_sysmon_backend_data_t; - -#if LV_USE_PERF_MONITOR -typedef struct lv_sysmon_perf_info_t lv_sysmon_perf_info_t; -#endif /*LV_USE_PERF_MONITOR*/ - -#endif /*LV_USE_SYSMON*/ - -#endif /*__ASSEMBLY__*/ - /********************** * GLOBAL PROTOTYPES **********************/ @@ -352,17 +73,15 @@ typedef struct lv_sysmon_perf_info_t lv_sysmon_perf_info_t; #define _LV_CONCAT(x, y) x ## y #define LV_CONCAT(x, y) _LV_CONCAT(x, y) -#undef _LV_CONCAT #define _LV_CONCAT3(x, y, z) x ## y ## z #define LV_CONCAT3(x, y, z) _LV_CONCAT3(x, y, z) -#undef _LV_CONCAT3 #if defined(PYCPARSER) || defined(__CC_ARM) #define LV_FORMAT_ATTRIBUTE(fmtstr, vararg) #elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 4) || __GNUC__ > 4) #define LV_FORMAT_ATTRIBUTE(fmtstr, vararg) __attribute__((format(gnu_printf, fmtstr, vararg))) -#elif (defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) || defined(__IAR_SYSTEMS_ICC__)) +#elif (defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)) #define LV_FORMAT_ATTRIBUTE(fmtstr, vararg) __attribute__((format(printf, fmtstr, vararg))) #else #define LV_FORMAT_ATTRIBUTE(fmtstr, vararg) diff --git a/L3_Middlewares/LVGL/src/misc/lv_utils.c b/L3_Middlewares/LVGL/src/misc/lv_utils.c index 8686921..e17a231 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_utils.c +++ b/L3_Middlewares/LVGL/src/misc/lv_utils.c @@ -6,10 +6,9 @@ /********************* * INCLUDES *********************/ +#include + #include "lv_utils.h" -#include "lv_fs.h" -#include "lv_types.h" -#include "cache/lv_image_cache.h" /********************* * DEFINES @@ -35,8 +34,25 @@ * GLOBAL FUNCTIONS **********************/ -void * lv_utils_bsearch(const void * key, const void * base, size_t n, size_t size, - int (*cmp)(const void * pRef, const void * pElement)) +/** Searches base[0] to base[n - 1] for an item that matches *key. + * + * @note The function cmp must return negative if its first + * argument (the search key) is less than its second (a table entry), + * zero if equal, and positive if greater. + * + * @note Items in the array must be in ascending order. + * + * @param key Pointer to item being searched for + * @param base Pointer to first element to search + * @param n Number of elements + * @param size Size of each element + * @param cmp Pointer to comparison function (see #unicode_list_compare as a comparison function + * example) + * + * @return a pointer to a matching item, or NULL if none exists. + */ +void * _lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32_t size, + int32_t (*cmp)(const void * pRef, const void * pElement)) { const char * middle; int32_t c; @@ -58,38 +74,6 @@ void * lv_utils_bsearch(const void * key, const void * base, size_t n, size_t si return NULL; } -lv_result_t lv_draw_buf_save_to_file(const lv_draw_buf_t * draw_buf, const char * path) -{ - lv_fs_file_t file; - lv_fs_res_t res = lv_fs_open(&file, path, LV_FS_MODE_WR); - if(res != LV_FS_RES_OK) { - LV_LOG_ERROR("create file %s failed", path); - return LV_RESULT_INVALID; - } - - /*Image content modified, invalidate image cache.*/ - lv_image_cache_drop(path); - - uint32_t bw; - res = lv_fs_write(&file, &draw_buf->header, sizeof(draw_buf->header), &bw); - if(res != LV_FS_RES_OK || bw != sizeof(draw_buf->header)) { - LV_LOG_ERROR("write draw_buf->header failed"); - lv_fs_close(&file); - return LV_RESULT_INVALID; - } - - res = lv_fs_write(&file, draw_buf->data, draw_buf->data_size, &bw); - if(res != LV_FS_RES_OK || bw != draw_buf->data_size) { - LV_LOG_ERROR("write draw_buf->data failed"); - lv_fs_close(&file); - return LV_RESULT_INVALID; - } - - lv_fs_close(&file); - LV_LOG_TRACE("saved draw_buf to %s", path); - return LV_RESULT_OK; -} - /********************** * STATIC FUNCTIONS **********************/ diff --git a/L3_Middlewares/LVGL/src/misc/lv_utils.h b/L3_Middlewares/LVGL/src/misc/lv_utils.h index 7a8d610..84d2bb9 100644 --- a/L3_Middlewares/LVGL/src/misc/lv_utils.h +++ b/L3_Middlewares/LVGL/src/misc/lv_utils.h @@ -13,9 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ - -#include "lv_types.h" -#include "../draw/lv_draw_buf.h" +#include /********************* * DEFINES @@ -35,27 +33,19 @@ extern "C" { * argument (the search key) is less that it's second (a table entry), * zero if equal, and positive if greater. * - * @note Items in the array must be in ascending order. + * @note Items in the array must be in ascending order. * * @param key Pointer to item being searched for * @param base Pointer to first element to search * @param n Number of elements * @param size Size of each element - * @param cmp Pointer to comparison function (see unicode_list_compare() - * as a comparison function example) + * @param cmp Pointer to comparison function (see #unicode_list_compare as a comparison function + * example) * * @return a pointer to a matching item, or NULL if none exists. */ -void * lv_utils_bsearch(const void * key, const void * base, size_t n, size_t size, - int (*cmp)(const void * pRef, const void * pElement)); - -/** - * Save a draw buf to a file - * @param draw_buf pointer to a draw buffer - * @param path path to the file to save - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: error - */ -lv_result_t lv_draw_buf_save_to_file(const lv_draw_buf_t * draw_buf, const char * path); +void * _lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32_t size, + int32_t (*cmp)(const void * pRef, const void * pElement)); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/osal/lv_cmsis_rtos2.c b/L3_Middlewares/LVGL/src/osal/lv_cmsis_rtos2.c deleted file mode 100644 index ed414c8..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_cmsis_rtos2.c +++ /dev/null @@ -1,195 +0,0 @@ -/** - * @file lv_cmsis_rtos2.c - * - */ - -/* - * Copyright (C) 2023 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_os.h" - -#if LV_USE_OS == LV_OS_CMSIS_RTOS2 - -#include "../misc/lv_log.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size, - void * user_data) -{ - static const osPriority_t prio_map[] = { - [LV_THREAD_PRIO_LOWEST] = osPriorityLow, - [LV_THREAD_PRIO_LOW] = osPriorityBelowNormal, - [LV_THREAD_PRIO_MID] = osPriorityNormal, - [LV_THREAD_PRIO_HIGH] = osPriorityHigh, - [LV_THREAD_PRIO_HIGHEST] = osPriorityRealtime7, - }; - - osThreadAttr_t c_tThreadAttribute = { - .stack_size = stack_size, - .priority = prio_map[prio], - }; - - *thread = osThreadNew(callback, user_data, &c_tThreadAttribute); - - if(NULL == *thread) { - LV_LOG_WARN("Error: Failed to create a cmsis-rtos2 thread."); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; - -} - -lv_result_t lv_thread_delete(lv_thread_t * thread) -{ - osThreadDetach(*thread); - osStatus_t status = osThreadTerminate(*thread); - if(status == osOK) { - return LV_RESULT_OK; - } - return LV_RESULT_INVALID; -} - -lv_result_t lv_mutex_init(lv_mutex_t * mutex) -{ - const osMutexAttr_t Thread_Mutex_attr = { - "LVGLMutex", - osMutexRecursive | osMutexPrioInherit | osMutexRobust, - }; - - *mutex = osMutexNew(&Thread_Mutex_attr); - if(*mutex == NULL) { - LV_LOG_WARN("Error: failed to create cmsis-rtos mutex"); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; - -} - -lv_result_t lv_mutex_lock(lv_mutex_t * mutex) -{ - osStatus_t status = osMutexAcquire(*mutex, 0U); - if(status != osOK) { - LV_LOG_WARN("Error: failed to lock cmsis-rtos2 mutex %d", (int)status); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex) -{ - osStatus_t status = osMutexAcquire(*mutex, 0U); - if(status != osOK) { - LV_LOG_WARN("Error: failed to lock cmsis-rtos2 mutex in an ISR %d", (int)status); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_unlock(lv_mutex_t * mutex) -{ - osStatus_t status = osMutexRelease(*mutex); - if(status != osOK) { - LV_LOG_WARN("Error: failed to release cmsis-rtos2 mutex %d", (int)status); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_delete(lv_mutex_t * mutex) -{ - osStatus_t status = osMutexDelete(*mutex); - if(status != osOK) { - LV_LOG_WARN("Error: failed to delete cmsis-rtos2 mutex %d", (int)status); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync) -{ - *sync = osEventFlagsNew(NULL); - if(NULL == *sync) { - LV_LOG_WARN("Error: failed to create a cmsis-rtos2 EventFlag"); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync) -{ - uint32_t ret = osEventFlagsWait(*sync, 0x01, osFlagsWaitAny, osWaitForever); - if(ret & (1 << 31)) { - LV_LOG_WARN("Error: failed to wait a cmsis-rtos2 EventFlag %d", ret); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync) -{ - uint32_t ret = osEventFlagsSet(*sync, 0x01); - if(ret & (1 << 31)) { - LV_LOG_WARN("Error: failed to set a cmsis-rtos2 EventFlag %d", ret); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_signal_isr(lv_thread_sync_t * sync) -{ - return lv_thread_sync_signal(sync); -} - -lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync) -{ - osStatus_t status = osEventFlagsDelete(*sync); - if(status != osOK) { - LV_LOG_WARN("Error: failed to delete a cmsis-rtos2 EventFlag %d", (int)status); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_OS == LV_OS_CMSIS_RTOS2*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_cmsis_rtos2.h b/L3_Middlewares/LVGL/src/osal/lv_cmsis_rtos2.h deleted file mode 100644 index 62481e7..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_cmsis_rtos2.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file lv_cmsis_rtos2.h - * - */ - -/* - * Copyright (C) 2023 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef LV_CMSIS_RTOS2_H -#define LV_CMSIS_RTOS2_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#if LV_USE_OS == LV_OS_CMSIS_RTOS2 - -#include "cmsis_os2.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef osThreadId_t lv_thread_t; - -typedef osMutexId_t lv_mutex_t; - -typedef osEventFlagsId_t lv_thread_sync_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_OS == LV_OS_CMSIS_RTOS2*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OS_CMSIS_RTOS2*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_freertos.c b/L3_Middlewares/LVGL/src/osal/lv_freertos.c deleted file mode 100644 index f65a299..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_freertos.c +++ /dev/null @@ -1,563 +0,0 @@ -/** - * @file lv_freertos.c - * - */ - -/** - * Copyright 2023 NXP - * - * SPDX-License-Identifier: MIT - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_os.h" -#if LV_USE_OS == LV_OS_FREERTOS - -#include "atomic.h" - -#include "../tick/lv_tick.h" -#include "../misc/lv_log.h" -#include "../core/lv_global.h" - -/********************* - * DEFINES - *********************/ - -#define ulMAX_COUNT 10U -#ifndef pcTASK_NAME - #define pcTASK_NAME "lvglDraw" -#endif - -#define globals LV_GLOBAL_DEFAULT() - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void prvRunThread(void * pxArg); - -static void prvMutexInit(lv_mutex_t * pxMutex); - -static void prvCheckMutexInit(lv_mutex_t * pxMutex); - -static void prvCondInit(lv_thread_sync_t * pxCond); - -static void prvCheckCondInit(lv_thread_sync_t * pxCond); - -static void prvCheckCondInitIsr(lv_thread_sync_t * pxCond); - -#if !LV_USE_FREERTOS_TASK_NOTIFY -static void prvTestAndDecrement(lv_thread_sync_t * pxCond, - uint32_t ulLocalWaitingThreads); -#endif - -/********************** - * STATIC VARIABLES - **********************/ - -#if (ESP_PLATFORM) - static portMUX_TYPE critSectionMux = portMUX_INITIALIZER_UNLOCKED; -#endif - -/********************** - * MACROS - **********************/ - -#if (ESP_PLATFORM) - #define _enter_critical() taskENTER_CRITICAL(&critSectionMux); - #define _exit_critical() taskEXIT_CRITICAL(&critSectionMux); - #define _enter_critical_isr() taskENTER_CRITICAL_FROM_ISR(); - #define _exit_critical_isr(x) taskEXIT_CRITICAL_FROM_ISR(x); -#else - #define _enter_critical() taskENTER_CRITICAL(); - #define _exit_critical() taskEXIT_CRITICAL(); - #define _enter_critical_isr() taskENTER_CRITICAL_FROM_ISR(); - #define _exit_critical_isr(x) taskEXIT_CRITICAL_FROM_ISR(x); -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_thread_init(lv_thread_t * pxThread, lv_thread_prio_t xSchedPriority, - void (*pvStartRoutine)(void *), size_t usStackSize, - void * xAttr) -{ - pxThread->pTaskArg = xAttr; - pxThread->pvStartRoutine = pvStartRoutine; - - BaseType_t xTaskCreateStatus = xTaskCreate( - prvRunThread, - pcTASK_NAME, - (configSTACK_DEPTH_TYPE)(usStackSize / sizeof(StackType_t)), - (void *)pxThread, - tskIDLE_PRIORITY + xSchedPriority, - &pxThread->xTaskHandle); - - /* Ensure that the FreeRTOS task was successfully created. */ - if(xTaskCreateStatus != pdPASS) { - LV_LOG_ERROR("xTaskCreate failed!"); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_delete(lv_thread_t * pxThread) -{ - vTaskDelete(pxThread->xTaskHandle); - - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_init(lv_mutex_t * pxMutex) -{ - /* If mutex in uninitialized, perform initialization. */ - prvCheckMutexInit(pxMutex); - - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_lock(lv_mutex_t * pxMutex) -{ - /* If mutex in uninitialized, perform initialization. */ - prvCheckMutexInit(pxMutex); - - BaseType_t xMutexTakeStatus = xSemaphoreTake(pxMutex->xMutex, portMAX_DELAY); - if(xMutexTakeStatus != pdTRUE) { - LV_LOG_ERROR("xSemaphoreTake failed!"); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_lock_isr(lv_mutex_t * pxMutex) -{ - /* If mutex in uninitialized, perform initialization. */ - prvCheckMutexInit(pxMutex); - - BaseType_t xHigherPriorityTaskWoken = pdFALSE; - - BaseType_t xMutexTakeStatus = xSemaphoreTakeFromISR(pxMutex->xMutex, &xHigherPriorityTaskWoken); - if(xMutexTakeStatus != pdTRUE) { - LV_LOG_ERROR("xSemaphoreTake failed!"); - return LV_RESULT_INVALID; - } - - /* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch - should be performed to ensure the interrupt returns directly to the highest - priority task. The macro used for this purpose is dependent on the port in - use and may be called portEND_SWITCHING_ISR(). */ - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); - - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_unlock(lv_mutex_t * pxMutex) -{ - /* If mutex in uninitialized, perform initialization. */ - prvCheckMutexInit(pxMutex); - - BaseType_t xMutexGiveStatus = xSemaphoreGive(pxMutex->xMutex); - if(xMutexGiveStatus != pdTRUE) { - LV_LOG_ERROR("xSemaphoreGive failed!"); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_delete(lv_mutex_t * pxMutex) -{ - vSemaphoreDelete(pxMutex->xMutex); - pxMutex->xIsInitialized = pdFALSE; - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_init(lv_thread_sync_t * pxCond) -{ - /* If the cond is uninitialized, perform initialization. */ - prvCheckCondInit(pxCond); - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_wait(lv_thread_sync_t * pxCond) -{ - lv_result_t lvRes = LV_RESULT_OK; - - /* If the cond is uninitialized, perform initialization. */ - prvCheckCondInit(pxCond); - -#if LV_USE_FREERTOS_TASK_NOTIFY - TaskHandle_t xCurrentTaskHandle = xTaskGetCurrentTaskHandle(); - - _enter_critical(); - BaseType_t xSyncSygnal = pxCond->xSyncSignal; - pxCond->xSyncSignal = pdFALSE; - if(xSyncSygnal == pdFALSE) { - /* The signal hasn't been sent yet. Tell the sender to notify this task */ - pxCond->xTaskToNotify = xCurrentTaskHandle; - } - /* If we have a signal from the other task, we should not ask to be notified */ - _exit_critical(); - - if(xSyncSygnal == pdFALSE) { - /* Wait for other task to notify this task. */ - ulTaskNotifyTake(pdTRUE, portMAX_DELAY); - } - /* If the signal was received, no wait needs to be done */ -#else - uint32_t ulLocalWaitingThreads; - - /* Acquire the mutex. */ - xSemaphoreTake(pxCond->xSyncMutex, portMAX_DELAY); - - while(!pxCond->xSyncSignal) { - /* Increase the counter of threads blocking on condition variable, then - * release the mutex. */ - - /* Atomically increments thread waiting by 1, and - * stores number of threads waiting before increment. */ - ulLocalWaitingThreads = Atomic_Increment_u32(&pxCond->ulWaitingThreads); - - BaseType_t xMutexStatus = xSemaphoreGive(pxCond->xSyncMutex); - - /* Wait on the condition variable. */ - if(xMutexStatus == pdTRUE) { - BaseType_t xCondWaitStatus = xSemaphoreTake( - pxCond->xCondWaitSemaphore, - portMAX_DELAY); - - /* Relock the mutex. */ - xSemaphoreTake(pxCond->xSyncMutex, portMAX_DELAY); - - if(xCondWaitStatus != pdTRUE) { - LV_LOG_ERROR("xSemaphoreTake(xCondWaitSemaphore) failed!"); - lvRes = LV_RESULT_INVALID; - - /* Atomically decrements thread waiting by 1. - * If iLocalWaitingThreads is updated by other thread(s) in between, - * this implementation guarantees to decrement by 1 based on the - * value currently in pxCond->ulWaitingThreads. */ - prvTestAndDecrement(pxCond, ulLocalWaitingThreads + 1); - } - } - else { - LV_LOG_ERROR("xSemaphoreGive(xSyncMutex) failed!"); - lvRes = LV_RESULT_INVALID; - - /* Atomically decrements thread waiting by 1. - * If iLocalWaitingThreads is updated by other thread(s) in between, - * this implementation guarantees to decrement by 1 based on the - * value currently in pxCond->ulWaitingThreads. */ - prvTestAndDecrement(pxCond, ulLocalWaitingThreads + 1); - } - } - - pxCond->xSyncSignal = pdFALSE; - - /* Release the mutex. */ - xSemaphoreGive(pxCond->xSyncMutex); -#endif - - return lvRes; -} - -lv_result_t lv_thread_sync_signal(lv_thread_sync_t * pxCond) -{ - /* If the cond is uninitialized, perform initialization. */ - prvCheckCondInit(pxCond); - -#if LV_USE_FREERTOS_TASK_NOTIFY - _enter_critical(); - TaskHandle_t xTaskToNotify = pxCond->xTaskToNotify; - pxCond->xTaskToNotify = NULL; - if(xTaskToNotify == NULL) { - /* No task waiting to be notified. Send this signal for later */ - pxCond->xSyncSignal = pdTRUE; - } - /* If a task is already waiting, there is no need to set the sync signal */ - _exit_critical(); - - if(xTaskToNotify != NULL) { - /* There is a task waiting. Send a notification to it */ - xTaskNotifyGive(xTaskToNotify); - } - /* If there was no task waiting to be notified, we sent a signal for it to see later. */ -#else - /* Acquire the mutex. */ - xSemaphoreTake(pxCond->xSyncMutex, portMAX_DELAY); - - pxCond->xSyncSignal = pdTRUE; - - /* Local copy of number of threads waiting. */ - uint32_t ulLocalWaitingThreads = pxCond->ulWaitingThreads; - - /* Test local copy of threads waiting is larger than zero. */ - while(ulLocalWaitingThreads > 0) { - /* Atomically check whether the copy in memory has changed. - * If not, set the copy of threads waiting in memory to zero. */ - if(ATOMIC_COMPARE_AND_SWAP_SUCCESS == Atomic_CompareAndSwap_u32( - &pxCond->ulWaitingThreads, - 0, - ulLocalWaitingThreads)) { - /* Unblock all. */ - for(uint32_t i = 0; i < ulLocalWaitingThreads; i++) { - xSemaphoreGive(pxCond->xCondWaitSemaphore); - } - - break; - } - - /* Local copy is out dated. Reload from memory and retry. */ - ulLocalWaitingThreads = pxCond->ulWaitingThreads; - } - - /* Release the mutex. */ - xSemaphoreGive(pxCond->xSyncMutex); -#endif - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_delete(lv_thread_sync_t * pxCond) -{ -#if !LV_USE_FREERTOS_TASK_NOTIFY - /* Cleanup all resources used by the cond. */ - vSemaphoreDelete(pxCond->xCondWaitSemaphore); - vSemaphoreDelete(pxCond->xSyncMutex); - pxCond->ulWaitingThreads = 0; -#endif - pxCond->xSyncSignal = pdFALSE; - pxCond->xIsInitialized = pdFALSE; - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_signal_isr(lv_thread_sync_t * pxCond) -{ - BaseType_t xHigherPriorityTaskWoken = pdFALSE; - - /* If the cond is uninitialized, perform initialization. */ - prvCheckCondInitIsr(pxCond); - -#if LV_USE_FREERTOS_TASK_NOTIFY - uint32_t mask = _enter_critical_isr(); - TaskHandle_t xTaskToNotify = pxCond->xTaskToNotify; - pxCond->xTaskToNotify = NULL; - if(xTaskToNotify == NULL) { - /* No task waiting to be notified. Send this signal for later */ - pxCond->xSyncSignal = pdTRUE; - } - /* If a task is already waiting, there is no need to set the sync signal */ - _exit_critical_isr(mask); - - if(xTaskToNotify != NULL) { - /* There is a task waiting. Send a notification to it */ - vTaskNotifyGiveFromISR(xTaskToNotify, &xHigherPriorityTaskWoken); - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); - } - /* If there was no task waiting to be notified, we sent a signal for it to see later. */ -#else - /* Enter critical section to prevent preemption. */ - uint32_t mask = _enter_critical_isr(); - - pxCond->xSyncSignal = pdTRUE; - BaseType_t xAnyHigherPriorityTaskWoken = pdFALSE; - - /* Unblock all. */ - for(uint32_t i = 0; i < pxCond->ulWaitingThreads; i++) { - xSemaphoreGiveFromISR(pxCond->xCondWaitSemaphore, &xAnyHigherPriorityTaskWoken); - xHigherPriorityTaskWoken |= xAnyHigherPriorityTaskWoken; - } - - _exit_critical_isr(mask); - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); -#endif - - return LV_RESULT_OK; -} - - -void lv_freertos_task_switch_in(const char * name) -{ - if(lv_strcmp(name, "IDLE")) globals->freertos_idle_task_running = false; - else globals->freertos_idle_task_running = true; - - globals->freertos_task_switch_timestamp = lv_tick_get(); -} - -void lv_freertos_task_switch_out(void) -{ - uint32_t elaps = lv_tick_elaps(globals->freertos_task_switch_timestamp); - if(globals->freertos_idle_task_running) globals->freertos_idle_time_sum += elaps; - else globals->freertos_non_idle_time_sum += elaps; -} - -uint32_t lv_os_get_idle_percent(void) -{ - if(globals->freertos_non_idle_time_sum + globals->freertos_idle_time_sum == 0) { - LV_LOG_WARN("Not enough time elapsed to provide idle percentage"); - return 0; - } - - uint32_t pct = (globals->freertos_idle_time_sum * 100) / (globals->freertos_idle_time_sum + - globals->freertos_non_idle_time_sum); - - globals->freertos_non_idle_time_sum = 0; - globals->freertos_idle_time_sum = 0; - - return pct; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void prvRunThread(void * pxArg) -{ - lv_thread_t * pxThread = (lv_thread_t *)pxArg; - - /* Run the thread routine. */ - pxThread->pvStartRoutine((void *)pxThread->pTaskArg); - - vTaskDelete(NULL); -} - -static void prvMutexInit(lv_mutex_t * pxMutex) -{ - pxMutex->xMutex = xSemaphoreCreateRecursiveMutex(); - - /* Ensure that the FreeRTOS mutex was successfully created. */ - if(pxMutex->xMutex == NULL) { - LV_LOG_ERROR("xSemaphoreCreateMutex failed!"); - return; - } - - /* Mutex successfully created. */ - pxMutex->xIsInitialized = pdTRUE; -} - -static void prvCheckMutexInit(lv_mutex_t * pxMutex) -{ - /* Check if the mutex needs to be initialized. */ - if(pxMutex->xIsInitialized == pdFALSE) { - /* Mutex initialization must be in a critical section to prevent two threads - * from initializing it at the same time. */ - _enter_critical(); - - /* Check again that the mutex is still uninitialized, i.e. it wasn't - * initialized while this function was waiting to enter the critical - * section. */ - if(pxMutex->xIsInitialized == pdFALSE) { - prvMutexInit(pxMutex); - } - - /* Exit the critical section. */ - _exit_critical(); - } -} - -static void prvCondInit(lv_thread_sync_t * pxCond) -{ - pxCond->xIsInitialized = pdTRUE; - pxCond->xSyncSignal = pdFALSE; - -#if LV_USE_FREERTOS_TASK_NOTIFY - pxCond->xTaskToNotify = NULL; -#else - pxCond->xCondWaitSemaphore = xSemaphoreCreateCounting(ulMAX_COUNT, 0U); - - /* Ensure that the FreeRTOS semaphore was successfully created. */ - if(pxCond->xCondWaitSemaphore == NULL) { - LV_LOG_ERROR("xSemaphoreCreateCounting failed!"); - return; - } - - pxCond->xSyncMutex = xSemaphoreCreateMutex(); - - /* Ensure that the FreeRTOS mutex was successfully created. */ - if(pxCond->xSyncMutex == NULL) { - LV_LOG_ERROR("xSemaphoreCreateMutex failed!"); - /* Cleanup. */ - vSemaphoreDelete(pxCond->xCondWaitSemaphore); - return; - } - - /* Condition variable successfully created. */ - pxCond->ulWaitingThreads = 0; -#endif -} - -static void prvCheckCondInit(lv_thread_sync_t * pxCond) -{ - /* Check if the condition variable needs to be initialized. */ - if(pxCond->xIsInitialized == pdFALSE) { - /* Cond initialization must be in a critical section to prevent two - * threads from initializing it at the same time. */ - _enter_critical(); - - /* Check again that the condition is still uninitialized, i.e. it wasn't - * initialized while this function was waiting to enter the critical - * section. */ - if(pxCond->xIsInitialized == pdFALSE) { - prvCondInit(pxCond); - } - - /* Exit the critical section. */ - _exit_critical(); - } -} - -static void prvCheckCondInitIsr(lv_thread_sync_t * pxCond) -{ - /* Check if the condition variable needs to be initialized. */ - if(pxCond->xIsInitialized == pdFALSE) { - /* Cond initialization must be in a critical section to prevent two - * threads from initializing it at the same time. */ - uint32_t mask = _enter_critical_isr(); - - /* Check again that the condition is still uninitialized, i.e. it wasn't - * initialized while this function was waiting to enter the critical - * section. */ - if(pxCond->xIsInitialized == pdFALSE) { - prvCondInit(pxCond); - } - - /* Exit the critical section. */ - _exit_critical_isr(mask); - } -} - -#if !LV_USE_FREERTOS_TASK_NOTIFY -static void prvTestAndDecrement(lv_thread_sync_t * pxCond, - uint32_t ulLocalWaitingThreads) -{ - /* Test local copy of threads waiting is larger than zero. */ - while(ulLocalWaitingThreads > 0) { - /* Atomically check whether the copy in memory has changed. - * If not, decrease the copy of threads waiting in memory. */ - if(ATOMIC_COMPARE_AND_SWAP_SUCCESS == Atomic_CompareAndSwap_u32( - &pxCond->ulWaitingThreads, - ulLocalWaitingThreads - 1, - ulLocalWaitingThreads)) { - /* Signal one succeeded. Break. */ - break; - } - - /* Local copy may be out dated. Reload from memory and retry. */ - ulLocalWaitingThreads = pxCond->ulWaitingThreads; - } -} -#endif - -#endif /*LV_USE_OS == LV_OS_FREERTOS*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_freertos.h b/L3_Middlewares/LVGL/src/osal/lv_freertos.h deleted file mode 100644 index 67a5a1e..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_freertos.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @file lv_freertos.h - * - */ - -/** - * Copyright 2023 NXP - * - * SPDX-License-Identifier: MIT - */ - -#ifndef LV_FREERTOS_H -#define LV_FREERTOS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_os.h" - -#if LV_USE_OS == LV_OS_FREERTOS - -#if (ESP_PLATFORM) -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#else -#include "FreeRTOS.h" -#include "task.h" -#include "semphr.h" -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - void (*pvStartRoutine)(void *); /**< Application thread function. */ - void * pTaskArg; /**< Arguments for application thread function. */ - TaskHandle_t xTaskHandle; /**< FreeRTOS task handle. */ -} lv_thread_t; - -typedef struct { - BaseType_t xIsInitialized; /**< Set to pdTRUE if this mutex is initialized, pdFALSE otherwise. */ - SemaphoreHandle_t xMutex; /**< FreeRTOS mutex. */ -} lv_mutex_t; - -typedef struct { - BaseType_t - xIsInitialized; /**< Set to pdTRUE if this condition variable is initialized, pdFALSE otherwise. */ - BaseType_t xSyncSignal; /**< Set to pdTRUE if the thread is signaled, pdFALSE otherwise. */ -#if LV_USE_FREERTOS_TASK_NOTIFY - TaskHandle_t xTaskToNotify; /**< The task waiting to be signalled. NULL if nothing is waiting. */ -#else - SemaphoreHandle_t xCondWaitSemaphore; /**< Threads block on this semaphore in lv_thread_sync_wait. */ - uint32_t ulWaitingThreads; /**< The number of threads currently waiting on this condition variable. */ - SemaphoreHandle_t xSyncMutex; /**< Threads take this mutex before accessing the condition variable. */ -#endif -} lv_thread_sync_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Set it for `traceTASK_SWITCHED_IN()` as - * `lv_freertos_task_switch_in(pxCurrentTCB->pcTaskName)` - * to save the start time stamp of a task - * @param name the name of the which is switched in - */ -void lv_freertos_task_switch_in(const char * name); - -/** - * Set it for `traceTASK_SWITCHED_OUT()` as - * `lv_freertos_task_switch_out()` - * to save finish time stamp of a task - */ -void lv_freertos_task_switch_out(void); - -/** - * Set it for `LV_SYSMON_GET_IDLE` to show the CPU usage - * as reported based the usage of FreeRTOS's idle task - * If it's important when a GPU is used. - * @return the idle percentage since the last call - */ -uint32_t lv_os_get_idle_percent(void); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_OS == LV_OS_FREERTOS*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_FREERTOS_H*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_mqx.c b/L3_Middlewares/LVGL/src/osal/lv_mqx.c deleted file mode 100644 index fed82f4..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_mqx.c +++ /dev/null @@ -1,169 +0,0 @@ -/** - * @file lv_mqx.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_os.h" - -#if LV_USE_OS == LV_OS_MQX - -#include "../misc/lv_log.h" -#include "../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size, - void * user_data) -{ - TASK_TEMPLATE_STRUCT task_template; - - lv_memzero(&task_template, sizeof(task_template)); - - task_template.TASK_ADDRESS = (TASK_FPTR)callback; - task_template.TASK_STACKSIZE = stack_size; - task_template.TASK_PRIORITY = _sched_get_min_priority(0) - prio; - task_template.TASK_NAME = "lvglDraw"; - task_template.CREATION_PARAMETER = (uint32_t)user_data; - - *thread = _task_create(0, 0, (uint32_t)&task_template); - if(*thread == MQX_NULL_TASK_ID) { - LV_LOG_WARN("_task_create failed!"); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_thread_delete(lv_thread_t * thread) -{ - _mqx_uint ret = _task_destroy(*thread); - if(ret != MQX_OK) { - LV_LOG_WARN("_task_destroy failed!"); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_init(lv_mutex_t * mutex) -{ - if(MQX_OK != _mutex_init(mutex, NULL)) { - LV_LOG_WARN("create mutex failed"); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_lock(lv_mutex_t * mutex) -{ - _mqx_uint ret = _mutex_lock(mutex); - if(ret != MQX_OK) { - LV_LOG_WARN("Error: %x", ret); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex) -{ - _mqx_uint ret = _mutex_lock(mutex); - if(ret != MQX_OK) { - LV_LOG_WARN("Error: %x", ret); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_unlock(lv_mutex_t * mutex) -{ - _mqx_uint ret = _mutex_unlock(mutex); - if(ret != MQX_OK) { - LV_LOG_WARN("Error: %x", ret); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_delete(lv_mutex_t * mutex) -{ - _mqx_uint ret = _mutex_destroy(mutex); - if(ret != MQX_OK) { - LV_LOG_WARN("Error: %x", ret); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync) -{ - if(MQX_OK != _lwsem_create(sync, 0)) { - LV_LOG_WARN("create semaphore failed"); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync) -{ - _mqx_uint ret = _lwsem_wait(sync); - if(ret != MQX_OK) { - LV_LOG_WARN("Error: %x", ret); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync) -{ - _mqx_uint ret = _lwsem_post(sync); - if(ret != MQX_OK) { - LV_LOG_WARN("Error: %x", ret); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync) -{ - _mqx_uint ret = _lwsem_destroy(sync); - if(ret != MQX_OK) { - LV_LOG_WARN("Error: %x", ret); - return LV_RESULT_INVALID; - } - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_signal_isr(lv_thread_sync_t * sync) -{ - LV_UNUSED(sync); - return LV_RESULT_INVALID; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_OS == LV_OS_MQX*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_mqx.h b/L3_Middlewares/LVGL/src/osal/lv_mqx.h deleted file mode 100644 index 601f596..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_mqx.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file lv_mqx.h - * - */ - -#ifndef LV_MQX_H -#define LV_MQX_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "lv_os.h" - -#if LV_USE_OS == LV_OS_MQX - -#include "mqx.h" -#include "mutex.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef _task_id lv_thread_t; - -typedef MUTEX_STRUCT lv_mutex_t; - -typedef LWSEM_STRUCT lv_thread_sync_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_OS == LV_OS_MQX*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_MQX_H*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_os.c b/L3_Middlewares/LVGL/src/osal/lv_os.c deleted file mode 100644 index 7b775f0..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_os.c +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @file lv_os.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_os.h" -#include "lv_os_private.h" -#include "../core/lv_global.h" - -/********************* - * DEFINES - *********************/ -#define lv_general_mutex LV_GLOBAL_DEFAULT()->lv_general_mutex - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_os_init(void) -{ -#if LV_USE_OS != LV_OS_NONE - lv_mutex_init(&lv_general_mutex); -#endif /*LV_USE_OS != LV_OS_NONE*/ -} - -void lv_lock(void) -{ -#if LV_USE_OS != LV_OS_NONE - lv_mutex_lock(&lv_general_mutex); -#endif /*LV_USE_OS != LV_OS_NONE*/ -} - -lv_result_t lv_lock_isr(void) -{ -#if LV_USE_OS != LV_OS_NONE - return lv_mutex_lock_isr(&lv_general_mutex); -#else /*LV_USE_OS != LV_OS_NONE*/ - return LV_RESULT_OK; -#endif /*LV_USE_OS != LV_OS_NONE*/ -} - -void lv_unlock(void) -{ -#if LV_USE_OS != LV_OS_NONE - lv_mutex_unlock(&lv_general_mutex); -#endif /*LV_USE_OS != LV_OS_NONE*/ -} - -/********************** - * STATIC FUNCTIONS - **********************/ - diff --git a/L3_Middlewares/LVGL/src/osal/lv_os.h b/L3_Middlewares/LVGL/src/osal/lv_os.h deleted file mode 100644 index d0a4e02..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_os.h +++ /dev/null @@ -1,186 +0,0 @@ -/** - * @file lv_os.h - * - */ - -#ifndef LV_OS_H -#define LV_OS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * OS OPTIONS - *********************/ - -/********************* - * INCLUDES - *********************/ -#include "../lv_conf_internal.h" - -#include "../misc/lv_types.h" - -#if LV_USE_OS == LV_OS_NONE -#include "lv_os_none.h" -#elif LV_USE_OS == LV_OS_PTHREAD -#include "lv_pthread.h" -#elif LV_USE_OS == LV_OS_FREERTOS -#include "lv_freertos.h" -#elif LV_USE_OS == LV_OS_CMSIS_RTOS2 -#include "lv_cmsis_rtos2.h" -#elif LV_USE_OS == LV_OS_RTTHREAD -#include "lv_rtthread.h" -#elif LV_USE_OS == LV_OS_WINDOWS -#include "lv_windows.h" -#elif LV_USE_OS == LV_OS_MQX -#include "lv_mqx.h" -#elif LV_USE_OS == LV_OS_CUSTOM -#include LV_OS_CUSTOM_INCLUDE -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef enum { - LV_THREAD_PRIO_LOWEST, - LV_THREAD_PRIO_LOW, - LV_THREAD_PRIO_MID, - LV_THREAD_PRIO_HIGH, - LV_THREAD_PRIO_HIGHEST, -} lv_thread_prio_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/*---------------------------------------- - * These functions needs to be implemented - * for specific operating systems - *---------------------------------------*/ - -/** - * Create a new thread - * @param thread a variable in which the thread will be stored - * @param prio priority of the thread - * @param callback function of the thread - * @param stack_size stack size in bytes - * @param user_data arbitrary data, will be available in the callback - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size, - void * user_data); - -/** - * Delete a thread - * @param thread the thread to delete - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_thread_delete(lv_thread_t * thread); - -/** - * Create a mutex - * @param mutex a variable in which the thread will be stored - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_mutex_init(lv_mutex_t * mutex); - -/** - * Lock a mutex - * @param mutex the mutex to lock - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_mutex_lock(lv_mutex_t * mutex); - -/** - * Lock a mutex from interrupt - * @param mutex the mutex to lock - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex); - -/** - * Unlock a mutex - * @param mutex the mutex to unlock - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_mutex_unlock(lv_mutex_t * mutex); - -/** - * Delete a mutex - * @param mutex the mutex to delete - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_mutex_delete(lv_mutex_t * mutex); - -/** - * Create a thread synchronization object - * @param sync a variable in which the sync will be stored - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync); - -/** - * Wait for a "signal" on a sync object - * @param sync a sync object - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync); - -/** - * Send a wake-up signal to a sync object - * @param sync a sync object - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync); - -/** - * Send a wake-up signal to a sync object from interrupt - * @param sync a sync object - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_thread_sync_signal_isr(lv_thread_sync_t * sync); - -/** - * Delete a sync object - * @param sync a sync object to delete - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync); - -/** - * Lock LVGL's general mutex. - * LVGL is not thread safe, so a mutex is used to avoid executing multiple LVGL functions at the same time - * from different threads. It shall be called when calling LVGL functions from threads - * different than lv_timer_handler's thread. It doesn't need to be called in LVGL events because - * they are called from lv_timer_handler(). - * It is called internally in lv_timer_handler(). - */ -void lv_lock(void); - -/** - * Same as `lv_lock()` but can be called from an interrupt. - * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure - */ -lv_result_t lv_lock_isr(void); - -/** - * The pair of `lv_lock()` and `lv_lock_isr()`. - * It unlocks LVGL general mutex. - * It is called internally in lv_timer_handler(). - */ -void lv_unlock(void); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OS_H*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_os_none.c b/L3_Middlewares/LVGL/src/osal/lv_os_none.c deleted file mode 100644 index 547810d..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_os_none.c +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @file lv_os_none.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_os.h" - -#if LV_USE_OS == LV_OS_NONE -#include "../misc/lv_types.h" -#include "../misc/lv_assert.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size, - void * user_data) -{ - LV_UNUSED(thread); - LV_UNUSED(callback); - LV_UNUSED(prio); - LV_UNUSED(stack_size); - LV_UNUSED(user_data); - LV_ASSERT(0); - return LV_RESULT_INVALID; -} - -lv_result_t lv_thread_delete(lv_thread_t * thread) -{ - LV_UNUSED(thread); - LV_ASSERT(0); - return LV_RESULT_INVALID; -} - -lv_result_t lv_mutex_init(lv_mutex_t * mutex) -{ - LV_UNUSED(mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_lock(lv_mutex_t * mutex) -{ - LV_UNUSED(mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex) -{ - LV_UNUSED(mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_unlock(lv_mutex_t * mutex) -{ - LV_UNUSED(mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_delete(lv_mutex_t * mutex) -{ - LV_UNUSED(mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync) -{ - LV_UNUSED(sync); - LV_ASSERT(0); - return LV_RESULT_INVALID; -} - -lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync) -{ - LV_UNUSED(sync); - LV_ASSERT(0); - return LV_RESULT_INVALID; -} - -lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync) -{ - LV_UNUSED(sync); - LV_ASSERT(0); - return LV_RESULT_INVALID; -} - -lv_result_t lv_thread_sync_signal_isr(lv_thread_sync_t * sync) -{ - LV_UNUSED(sync); - LV_ASSERT(0); - return LV_RESULT_INVALID; -} - -lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync) -{ - LV_UNUSED(sync); - LV_ASSERT(0); - return LV_RESULT_INVALID; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_OS == LV_OS_NONE*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_os_none.h b/L3_Middlewares/LVGL/src/osal/lv_os_none.h deleted file mode 100644 index e08a0dc..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_os_none.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file lv_os_none.h - * - */ - -#ifndef LV_OS_NONE_H -#define LV_OS_NONE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#if LV_USE_OS == LV_OS_NONE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef int lv_mutex_t; -typedef int lv_thread_t; -typedef int lv_thread_sync_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_OS == LV_OS_NONE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OS_NONE_H*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_pthread.c b/L3_Middlewares/LVGL/src/osal/lv_pthread.c deleted file mode 100644 index 268f055..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_pthread.c +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @file lv_pthread.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_os.h" - -#if LV_USE_OS == LV_OS_PTHREAD - -#include -#include "../misc/lv_log.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void * generic_callback(void * user_data); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size, - void * user_data) -{ - LV_UNUSED(prio); - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setstacksize(&attr, stack_size); - thread->callback = callback; - thread->user_data = user_data; - pthread_create(&thread->thread, &attr, generic_callback, thread); - return LV_RESULT_OK; -} - -lv_result_t lv_thread_delete(lv_thread_t * thread) -{ - int ret = pthread_join(thread->thread, NULL); - if(ret != 0) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_init(lv_mutex_t * mutex) -{ - pthread_mutexattr_t attr; - - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - int ret = pthread_mutex_init(mutex, &attr); - pthread_mutexattr_destroy(&attr); - - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_mutex_lock(lv_mutex_t * mutex) -{ - int ret = pthread_mutex_lock(mutex); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex) -{ - int ret = pthread_mutex_lock(mutex); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_mutex_unlock(lv_mutex_t * mutex) -{ - int ret = pthread_mutex_unlock(mutex); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_mutex_delete(lv_mutex_t * mutex) -{ - pthread_mutex_destroy(mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync) -{ - pthread_mutex_init(&sync->mutex, 0); - pthread_cond_init(&sync->cond, 0); - sync->v = false; - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync) -{ - pthread_mutex_lock(&sync->mutex); - while(!sync->v) { - pthread_cond_wait(&sync->cond, &sync->mutex); - } - sync->v = false; - pthread_mutex_unlock(&sync->mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync) -{ - pthread_mutex_lock(&sync->mutex); - sync->v = true; - pthread_cond_signal(&sync->cond); - pthread_mutex_unlock(&sync->mutex); - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync) -{ - pthread_mutex_destroy(&sync->mutex); - pthread_cond_destroy(&sync->cond); - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_signal_isr(lv_thread_sync_t * sync) -{ - LV_UNUSED(sync); - return LV_RESULT_INVALID; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void * generic_callback(void * user_data) -{ - lv_thread_t * thread = user_data; - thread->callback(thread->user_data); - return NULL; -} - -#endif /*LV_USE_OS == LV_OS_PTHREAD*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_pthread.h b/L3_Middlewares/LVGL/src/osal/lv_pthread.h deleted file mode 100644 index e7abc90..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_pthread.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file lv_pthread.h - * - */ - -#ifndef LV_PTHREAD_H -#define LV_PTHREAD_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#if LV_USE_OS == LV_OS_PTHREAD - -#include -#include -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - pthread_t thread; - void (*callback)(void *); - void * user_data; -} lv_thread_t; - -typedef pthread_mutex_t lv_mutex_t; - -typedef struct { - pthread_mutex_t mutex; - pthread_cond_t cond; - bool v; -} lv_thread_sync_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_OS == LV_OS_PTHREAD*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_PTHREAD_H*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_rtthread.c b/L3_Middlewares/LVGL/src/osal/lv_rtthread.c deleted file mode 100644 index e781634..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_rtthread.c +++ /dev/null @@ -1,190 +0,0 @@ -/** - * @file lv_rtthread.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_os.h" - -#if LV_USE_OS == LV_OS_RTTHREAD - -#include "../misc/lv_log.h" - -/********************* - * DEFINES - *********************/ - -#define THREAD_TIMESLICE 20U - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size, - void * user_data) -{ - thread->thread = rt_thread_create("thread", - callback, - user_data, - stack_size, - prio, - THREAD_TIMESLICE); - rt_err_t ret = rt_thread_startup(thread->thread); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_thread_delete(lv_thread_t * thread) -{ - rt_err_t ret = rt_thread_delete(thread->thread); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_mutex_init(lv_mutex_t * mutex) -{ - mutex->mutex = rt_mutex_create("mutex", RT_IPC_FLAG_PRIO); - if(mutex->mutex == RT_NULL) { - LV_LOG_WARN("create mutex failed"); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_mutex_lock(lv_mutex_t * mutex) -{ - rt_err_t ret = rt_mutex_take(mutex->mutex, RT_WAITING_FOREVER); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex) -{ - rt_err_t ret = rt_mutex_take(mutex->mutex, RT_WAITING_FOREVER); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_mutex_unlock(lv_mutex_t * mutex) -{ - rt_err_t ret = rt_mutex_release(mutex->mutex); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_mutex_delete(lv_mutex_t * mutex) -{ - rt_err_t ret = rt_mutex_delete(mutex->mutex); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync) -{ - sync->sem = rt_sem_create("sem", 0, RT_IPC_FLAG_PRIO); - if(sync->sem == RT_NULL) { - LV_LOG_WARN("create semaphore failed"); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync) -{ - rt_err_t ret = rt_sem_take(sync->sem, RT_WAITING_FOREVER); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync) -{ - rt_err_t ret = rt_sem_release(sync->sem); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync) -{ - rt_err_t ret = rt_sem_delete(sync->sem); - if(ret) { - LV_LOG_WARN("Error: %d", ret); - return LV_RESULT_INVALID; - } - else { - return LV_RESULT_OK; - } -} - -lv_result_t lv_thread_sync_signal_isr(lv_thread_sync_t * sync) -{ - LV_UNUSED(sync); - return LV_RESULT_INVALID; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_OS == LV_OS_RTTHREAD*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_rtthread.h b/L3_Middlewares/LVGL/src/osal/lv_rtthread.h deleted file mode 100644 index 255a47a..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_rtthread.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file lv_rtthread.h - * - */ - -#ifndef LV_RTTHREAD_H -#define LV_RTTHREAD_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#if LV_USE_OS == LV_OS_RTTHREAD - -#include -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - rt_thread_t thread; -} lv_thread_t; - -typedef struct { - rt_mutex_t mutex; -} lv_mutex_t; - -typedef struct { - rt_sem_t sem; -} lv_thread_sync_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_OS == LV_OS_RTTHREAD*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_RTTHREAD_H*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_windows.c b/L3_Middlewares/LVGL/src/osal/lv_windows.c deleted file mode 100644 index 78ac293..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_windows.c +++ /dev/null @@ -1,222 +0,0 @@ -/** - * @file lv_windows.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_os.h" - -#if LV_USE_OS == LV_OS_WINDOWS - -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - void (*callback)(void *); - void * user_data; -} lv_thread_init_data_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static unsigned __stdcall thread_start_routine(void * parameter); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_result_t lv_thread_init( - lv_thread_t * thread, - lv_thread_prio_t prio, - void (*callback)(void *), - size_t stack_size, - void * user_data) -{ - if(!thread) { - return LV_RESULT_INVALID; - } - - static const int prio_map[] = { - [LV_THREAD_PRIO_LOWEST] = THREAD_PRIORITY_LOWEST, - [LV_THREAD_PRIO_LOW] = THREAD_PRIORITY_BELOW_NORMAL, - [LV_THREAD_PRIO_MID] = THREAD_PRIORITY_NORMAL, - [LV_THREAD_PRIO_HIGH] = THREAD_PRIORITY_ABOVE_NORMAL, - [LV_THREAD_PRIO_HIGHEST] = THREAD_PRIORITY_HIGHEST, - }; - - lv_thread_init_data_t * init_data = - (lv_thread_init_data_t *)(malloc( - sizeof(lv_thread_init_data_t))); - if(!init_data) { - return LV_RESULT_INVALID; - } - init_data->callback = callback; - init_data->user_data = user_data; - - /* - Reference: https://learn.microsoft.com/en-us/windows/win32/api - /processthreadsapi/nf-processthreadsapi-createthread - - A thread in an executable that calls the C run-time library (CRT) should - use the _beginthreadex and _endthreadex functions for thread management - rather than CreateThread and ExitThread; this requires the use of the - multithreaded version of the CRT. If a thread created using CreateThread - calls the CRT, the CRT may terminate the process in low-memory conditions. - */ - *thread = (HANDLE)(_beginthreadex( - NULL, - (unsigned)(stack_size), - thread_start_routine, - init_data, - 0, - NULL)); - if(!*thread) { - return LV_RESULT_INVALID; - } - - /* - Try to set the thread priority. (Not mandatory for creating a new thread.) - */ - SetThreadPriority(*thread, prio_map[prio]); - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_delete(lv_thread_t * thread) -{ - lv_result_t result = LV_RESULT_OK; - - if(!TerminateThread(thread, 0)) { - result = LV_RESULT_INVALID; - } - - CloseHandle(thread); - - return result; -} - -lv_result_t lv_mutex_init(lv_mutex_t * mutex) -{ - InitializeCriticalSection(mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_lock(lv_mutex_t * mutex) -{ - EnterCriticalSection(mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex) -{ - EnterCriticalSection(mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_unlock(lv_mutex_t * mutex) -{ - LeaveCriticalSection(mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_mutex_delete(lv_mutex_t * mutex) -{ - DeleteCriticalSection(mutex); - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync) -{ - if(!sync) { - return LV_RESULT_INVALID; - } - - InitializeCriticalSection(&sync->cs); - InitializeConditionVariable(&sync->cv); - sync->v = false; - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync) -{ - if(!sync) { - return LV_RESULT_INVALID; - } - - EnterCriticalSection(&sync->cs); - while(!sync->v) { - SleepConditionVariableCS(&sync->cv, &sync->cs, INFINITE); - } - sync->v = false; - LeaveCriticalSection(&sync->cs); - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync) -{ - if(!sync) { - return LV_RESULT_INVALID; - } - - EnterCriticalSection(&sync->cs); - sync->v = true; - WakeConditionVariable(&sync->cv); - LeaveCriticalSection(&sync->cs); - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync) -{ - if(!sync) { - return LV_RESULT_INVALID; - } - - DeleteCriticalSection(&sync->cs); - - return LV_RESULT_OK; -} - -lv_result_t lv_thread_sync_signal_isr(lv_thread_sync_t * sync) -{ - LV_UNUSED(sync); - return LV_RESULT_INVALID; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static unsigned __stdcall thread_start_routine(void * parameter) -{ - lv_thread_init_data_t * init_data = (lv_thread_init_data_t *)(parameter); - if(init_data) { - init_data->callback(init_data->user_data); - free(init_data); - } - - return 0; -} - -#endif /*LV_USE_OS == LV_OS_WINDOWS*/ diff --git a/L3_Middlewares/LVGL/src/osal/lv_windows.h b/L3_Middlewares/LVGL/src/osal/lv_windows.h deleted file mode 100644 index fd930e8..0000000 --- a/L3_Middlewares/LVGL/src/osal/lv_windows.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file lv_windows.h - * - */ - -#ifndef LV_WINDOWS_H -#define LV_WINDOWS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#if LV_USE_OS == LV_OS_WINDOWS - -#include -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef HANDLE lv_thread_t; - -typedef CRITICAL_SECTION lv_mutex_t; - -typedef struct { - CRITICAL_SECTION cs; - CONDITION_VARIABLE cv; - bool v; -} lv_thread_sync_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_OS == LV_OS_WINDOWS*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_WINDOWS_H*/ diff --git a/L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer.c b/L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer.c deleted file mode 100644 index bb0220c..0000000 --- a/L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer.c +++ /dev/null @@ -1,707 +0,0 @@ -/** - * @file lv_file_explorer.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_file_explorer_private.h" -#include "../../misc/lv_fs_private.h" -#include "../../core/lv_obj_class_private.h" -#if LV_USE_FILE_EXPLORER != 0 - -#include "../../lvgl.h" -#include "../../core/lv_global.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_file_explorer_class) - -#define FILE_EXPLORER_QUICK_ACCESS_AREA_WIDTH (22) -#define FILE_EXPLORER_BROWSER_AREA_WIDTH (100 - FILE_EXPLORER_QUICK_ACCESS_AREA_WIDTH) - -#define quick_access_list_button_style (LV_GLOBAL_DEFAULT()->fe_list_button_style) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_file_explorer_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); - -static void browser_file_event_handler(lv_event_t * e); -#if LV_FILE_EXPLORER_QUICK_ACCESS - static void quick_access_event_handler(lv_event_t * e); - static void quick_access_area_event_handler(lv_event_t * e); -#endif - -static void init_style(lv_obj_t * obj); -static void show_dir(lv_obj_t * obj, const char * path); -static void strip_ext(char * dir); -static void file_explorer_sort(lv_obj_t * obj); -static void sort_by_file_kind(lv_obj_t * tb, int16_t lo, int16_t hi); -static void exch_table_item(lv_obj_t * tb, int16_t i, int16_t j); -static bool is_end_with(const char * str1, const char * str2); - -/********************** - * STATIC VARIABLES - **********************/ - -const lv_obj_class_t lv_file_explorer_class = { - .constructor_cb = lv_file_explorer_constructor, - .width_def = LV_SIZE_CONTENT, - .height_def = LV_SIZE_CONTENT, - .instance_size = sizeof(lv_file_explorer_t), - .base_class = &lv_obj_class, - .name = "file-explorer", -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_file_explorer_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -/*===================== - * Setter functions - *====================*/ -#if LV_FILE_EXPLORER_QUICK_ACCESS -void lv_file_explorer_set_quick_access_path(lv_obj_t * obj, lv_file_explorer_dir_t dir, const char * path) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - /*If path is unavailable */ - if((path == NULL) || (lv_strlen(path) <= 0)) return; - - char ** dir_str = NULL; - switch(dir) { - case LV_EXPLORER_HOME_DIR: - dir_str = &(explorer->home_dir); - break; - case LV_EXPLORER_MUSIC_DIR: - dir_str = &(explorer->music_dir); - break; - case LV_EXPLORER_PICTURES_DIR: - dir_str = &(explorer->pictures_dir); - break; - case LV_EXPLORER_VIDEO_DIR: - dir_str = &(explorer->video_dir); - break; - case LV_EXPLORER_DOCS_DIR: - dir_str = &(explorer->docs_dir); - break; - case LV_EXPLORER_FS_DIR: - dir_str = &(explorer->fs_dir); - break; - - default: - return; - break; - } - - /*Free the old text*/ - if(*dir_str != NULL) { - lv_free(*dir_str); - *dir_str = NULL; - } - - /*Allocate space for the new text*/ - *dir_str = lv_strdup(path); -} - -#endif - -void lv_file_explorer_set_sort(lv_obj_t * obj, lv_file_explorer_sort_t sort) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - explorer->sort = sort; - - file_explorer_sort(obj); -} - -/*===================== - * Getter functions - *====================*/ -const char * lv_file_explorer_get_selected_file_name(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - return explorer->sel_fn; -} - -const char * lv_file_explorer_get_current_path(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - return explorer->current_path; -} - -lv_obj_t * lv_file_explorer_get_file_table(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - return explorer->file_table; -} - -lv_obj_t * lv_file_explorer_get_header(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - return explorer->head_area; -} - -lv_obj_t * lv_file_explorer_get_path_label(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - return explorer->path_label; -} - -#if LV_FILE_EXPLORER_QUICK_ACCESS -lv_obj_t * lv_file_explorer_get_quick_access_area(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - return explorer->quick_access_area; -} - -lv_obj_t * lv_file_explorer_get_places_list(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - return explorer->list_places; -} - -lv_obj_t * lv_file_explorer_get_device_list(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - return explorer->list_device; -} - -#endif - -lv_file_explorer_sort_t lv_file_explorer_get_sort(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - return explorer->sort; -} - -/*===================== - * Other functions - *====================*/ -void lv_file_explorer_open_dir(lv_obj_t * obj, const char * dir) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - show_dir(obj, dir); -} - -/********************** - * STATIC FUNCTIONS - **********************/ -static void lv_file_explorer_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_TRACE_OBJ_CREATE("begin"); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - -#if LV_FILE_EXPLORER_QUICK_ACCESS - explorer->home_dir = NULL; - explorer->video_dir = NULL; - explorer->pictures_dir = NULL; - explorer->music_dir = NULL; - explorer->docs_dir = NULL; - explorer->fs_dir = NULL; -#endif - - explorer->sort = LV_EXPLORER_SORT_NONE; - - lv_memzero(explorer->current_path, sizeof(explorer->current_path)); - - lv_obj_set_size(obj, LV_PCT(100), LV_PCT(100)); - lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); - - explorer->cont = lv_obj_create(obj); - lv_obj_set_width(explorer->cont, LV_PCT(100)); - lv_obj_set_flex_grow(explorer->cont, 1); - -#if LV_FILE_EXPLORER_QUICK_ACCESS - /*Quick access bar area on the left*/ - explorer->quick_access_area = lv_obj_create(explorer->cont); - lv_obj_set_size(explorer->quick_access_area, LV_PCT(FILE_EXPLORER_QUICK_ACCESS_AREA_WIDTH), LV_PCT(100)); - lv_obj_set_flex_flow(explorer->quick_access_area, LV_FLEX_FLOW_COLUMN); - lv_obj_add_event_cb(explorer->quick_access_area, quick_access_area_event_handler, LV_EVENT_ALL, - explorer); -#endif - - /*File table area on the right*/ - explorer->browser_area = lv_obj_create(explorer->cont); -#if LV_FILE_EXPLORER_QUICK_ACCESS - lv_obj_set_size(explorer->browser_area, LV_PCT(FILE_EXPLORER_BROWSER_AREA_WIDTH), LV_PCT(100)); -#else - lv_obj_set_size(explorer->browser_area, LV_PCT(100), LV_PCT(100)); -#endif - lv_obj_set_flex_flow(explorer->browser_area, LV_FLEX_FLOW_COLUMN); - - /*The area displayed above the file browse list(head)*/ - explorer->head_area = lv_obj_create(explorer->browser_area); - lv_obj_set_size(explorer->head_area, LV_PCT(100), LV_PCT(14)); - lv_obj_remove_flag(explorer->head_area, LV_OBJ_FLAG_SCROLLABLE); - -#if LV_FILE_EXPLORER_QUICK_ACCESS - /*Two lists of quick access bar*/ - lv_obj_t * btn; - /*list 1*/ - explorer->list_device = lv_list_create(explorer->quick_access_area); - lv_obj_set_size(explorer->list_device, LV_PCT(100), LV_SIZE_CONTENT); - lv_obj_set_style_bg_color(lv_list_add_text(explorer->list_device, "DEVICE"), lv_palette_main(LV_PALETTE_ORANGE), 0); - - btn = lv_list_add_button(explorer->list_device, NULL, LV_SYMBOL_DRIVE " File System"); - lv_obj_add_event_cb(btn, quick_access_event_handler, LV_EVENT_CLICKED, obj); - - /*list 2*/ - explorer->list_places = lv_list_create(explorer->quick_access_area); - lv_obj_set_size(explorer->list_places, LV_PCT(100), LV_SIZE_CONTENT); - lv_obj_set_style_bg_color(lv_list_add_text(explorer->list_places, "PLACES"), lv_palette_main(LV_PALETTE_LIME), 0); - - btn = lv_list_add_button(explorer->list_places, NULL, LV_SYMBOL_HOME " HOME"); - lv_obj_add_event_cb(btn, quick_access_event_handler, LV_EVENT_CLICKED, obj); - btn = lv_list_add_button(explorer->list_places, NULL, LV_SYMBOL_VIDEO " Video"); - lv_obj_add_event_cb(btn, quick_access_event_handler, LV_EVENT_CLICKED, obj); - btn = lv_list_add_button(explorer->list_places, NULL, LV_SYMBOL_IMAGE " Pictures"); - lv_obj_add_event_cb(btn, quick_access_event_handler, LV_EVENT_CLICKED, obj); - btn = lv_list_add_button(explorer->list_places, NULL, LV_SYMBOL_AUDIO " Music"); - lv_obj_add_event_cb(btn, quick_access_event_handler, LV_EVENT_CLICKED, obj); - btn = lv_list_add_button(explorer->list_places, NULL, LV_SYMBOL_FILE " Documents"); - lv_obj_add_event_cb(btn, quick_access_event_handler, LV_EVENT_CLICKED, obj); -#endif - - /*Show current path*/ - explorer->path_label = lv_label_create(explorer->head_area); - lv_label_set_text(explorer->path_label, LV_SYMBOL_EYE_OPEN"https://lvgl.io"); - lv_obj_center(explorer->path_label); - - /*Table showing the contents of the table of contents*/ - explorer->file_table = lv_table_create(explorer->browser_area); - lv_obj_set_size(explorer->file_table, LV_PCT(100), LV_PCT(86)); - lv_table_set_column_width(explorer->file_table, 0, LV_PCT(100)); - lv_table_set_column_count(explorer->file_table, 1); - lv_obj_add_event_cb(explorer->file_table, browser_file_event_handler, LV_EVENT_ALL, obj); - - /*only scroll up and down*/ - lv_obj_set_scroll_dir(explorer->file_table, LV_DIR_TOP | LV_DIR_BOTTOM); - - /*Initialize style*/ - init_style(obj); - - LV_TRACE_OBJ_CREATE("finished"); -} - -static void init_style(lv_obj_t * obj) -{ - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - /*lv_file_explorer obj style*/ - lv_obj_set_style_radius(obj, 0, 0); - lv_obj_set_style_bg_color(obj, lv_color_hex(0xf2f1f6), 0); - - /*main container style*/ - lv_obj_set_style_radius(explorer->cont, 0, 0); - lv_obj_set_style_bg_opa(explorer->cont, LV_OPA_0, 0); - lv_obj_set_style_border_width(explorer->cont, 0, 0); - lv_obj_set_style_outline_width(explorer->cont, 0, 0); - lv_obj_set_style_pad_column(explorer->cont, 0, 0); - lv_obj_set_style_pad_row(explorer->cont, 0, 0); - lv_obj_set_style_flex_flow(explorer->cont, LV_FLEX_FLOW_ROW, 0); - lv_obj_set_style_pad_all(explorer->cont, 0, 0); - lv_obj_set_style_layout(explorer->cont, LV_LAYOUT_FLEX, 0); - - /*head cont style*/ - lv_obj_set_style_radius(explorer->head_area, 0, 0); - lv_obj_set_style_border_width(explorer->head_area, 0, 0); - lv_obj_set_style_pad_top(explorer->head_area, 0, 0); - -#if LV_FILE_EXPLORER_QUICK_ACCESS - /*Quick access bar container style*/ - lv_obj_set_style_pad_all(explorer->quick_access_area, 0, 0); - lv_obj_set_style_pad_row(explorer->quick_access_area, 20, 0); - lv_obj_set_style_radius(explorer->quick_access_area, 0, 0); - lv_obj_set_style_border_width(explorer->quick_access_area, 1, 0); - lv_obj_set_style_outline_width(explorer->quick_access_area, 0, 0); - lv_obj_set_style_bg_color(explorer->quick_access_area, lv_color_hex(0xf2f1f6), 0); -#endif - - /*File browser container style*/ - lv_obj_set_style_pad_all(explorer->browser_area, 0, 0); - lv_obj_set_style_pad_row(explorer->browser_area, 0, 0); - lv_obj_set_style_radius(explorer->browser_area, 0, 0); - lv_obj_set_style_border_width(explorer->browser_area, 0, 0); - lv_obj_set_style_outline_width(explorer->browser_area, 0, 0); - lv_obj_set_style_bg_color(explorer->browser_area, lv_color_hex(0xffffff), 0); - - /*Style of the table in the browser container*/ - lv_obj_set_style_bg_color(explorer->file_table, lv_color_hex(0xffffff), 0); - lv_obj_set_style_pad_all(explorer->file_table, 0, 0); - lv_obj_set_style_radius(explorer->file_table, 0, 0); - lv_obj_set_style_border_width(explorer->file_table, 0, 0); - lv_obj_set_style_outline_width(explorer->file_table, 0, 0); - -#if LV_FILE_EXPLORER_QUICK_ACCESS - /*Style of the list in the quick access bar*/ - lv_obj_set_style_border_width(explorer->list_device, 0, 0); - lv_obj_set_style_outline_width(explorer->list_device, 0, 0); - lv_obj_set_style_radius(explorer->list_device, 0, 0); - lv_obj_set_style_pad_all(explorer->list_device, 0, 0); - - lv_obj_set_style_border_width(explorer->list_places, 0, 0); - lv_obj_set_style_outline_width(explorer->list_places, 0, 0); - lv_obj_set_style_radius(explorer->list_places, 0, 0); - lv_obj_set_style_pad_all(explorer->list_places, 0, 0); - - /*Style of the quick access list btn in the quick access bar*/ - lv_style_init(&quick_access_list_button_style); - lv_style_set_border_width(&quick_access_list_button_style, 0); - lv_style_set_bg_color(&quick_access_list_button_style, lv_color_hex(0xf2f1f6)); - - uint32_t i, j; - for(i = 0; i < lv_obj_get_child_count(explorer->quick_access_area); i++) { - lv_obj_t * child = lv_obj_get_child(explorer->quick_access_area, i); - if(lv_obj_check_type(child, &lv_list_class)) { - for(j = 0; j < lv_obj_get_child_count(child); j++) { - lv_obj_t * list_child = lv_obj_get_child(child, j); - if(lv_obj_check_type(list_child, &lv_list_button_class)) { - lv_obj_add_style(list_child, &quick_access_list_button_style, 0); - } - } - } - } -#endif - -} - -#if LV_FILE_EXPLORER_QUICK_ACCESS -static void quick_access_event_handler(lv_event_t * e) -{ - lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * btn = lv_event_get_current_target(e); - lv_obj_t * obj = lv_event_get_user_data(e); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - if(code == LV_EVENT_CLICKED) { - char ** path = NULL; - lv_obj_t * label = lv_obj_get_child(btn, -1); - char * label_text = lv_label_get_text(label); - - if((lv_strcmp(label_text, LV_SYMBOL_HOME " HOME") == 0)) { - path = &(explorer->home_dir); - } - else if((lv_strcmp(label_text, LV_SYMBOL_VIDEO " Video") == 0)) { - path = &(explorer->video_dir); - } - else if((lv_strcmp(label_text, LV_SYMBOL_IMAGE " Pictures") == 0)) { - path = &(explorer->pictures_dir); - } - else if((lv_strcmp(label_text, LV_SYMBOL_AUDIO " Music") == 0)) { - path = &(explorer->music_dir); - } - else if((lv_strcmp(label_text, LV_SYMBOL_FILE " Documents") == 0)) { - path = &(explorer->docs_dir); - } - else if((lv_strcmp(label_text, LV_SYMBOL_DRIVE " File System") == 0)) { - path = &(explorer->fs_dir); - } - - if(path != NULL) - show_dir(obj, *path); - } -} - -static void quick_access_area_event_handler(lv_event_t * e) -{ - lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * area = lv_event_get_current_target(e); - lv_obj_t * obj = lv_event_get_user_data(e); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - if(code == LV_EVENT_LAYOUT_CHANGED) { - if(lv_obj_has_flag(area, LV_OBJ_FLAG_HIDDEN)) - lv_obj_set_size(explorer->browser_area, LV_PCT(100), LV_PCT(100)); - else - lv_obj_set_size(explorer->browser_area, LV_PCT(FILE_EXPLORER_BROWSER_AREA_WIDTH), LV_PCT(100)); - } -} -#endif - -static void browser_file_event_handler(lv_event_t * e) -{ - lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_user_data(e); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - if(code == LV_EVENT_VALUE_CHANGED) { - char file_name[LV_FILE_EXPLORER_PATH_MAX_LEN]; - const char * str_fn = NULL; - uint32_t row; - uint32_t col; - - lv_memzero(file_name, sizeof(file_name)); - lv_table_get_selected_cell(explorer->file_table, &row, &col); - str_fn = lv_table_get_cell_value(explorer->file_table, row, col); - - str_fn = str_fn + 5; - if((lv_strcmp(str_fn, ".") == 0)) return; - - if((lv_strcmp(str_fn, "..") == 0) && (lv_strlen(explorer->current_path) > 3)) { - strip_ext(explorer->current_path); - /*Remove the last '/' character*/ - strip_ext(explorer->current_path); - lv_snprintf((char *)file_name, sizeof(file_name), "%s", explorer->current_path); - } - else { - if(lv_strcmp(str_fn, "..") != 0) { - lv_snprintf((char *)file_name, sizeof(file_name), "%s%s", explorer->current_path, str_fn); - } - } - - lv_fs_dir_t dir; - if(lv_fs_dir_open(&dir, file_name) == LV_FS_RES_OK) { - lv_fs_dir_close(&dir); - show_dir(obj, (char *)file_name); - } - else { - if(lv_strcmp(str_fn, "..") != 0) { - explorer->sel_fn = str_fn; - lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - } - } - } - else if(code == LV_EVENT_SIZE_CHANGED) { - lv_table_set_column_width(explorer->file_table, 0, lv_obj_get_width(explorer->file_table)); - } - else if((code == LV_EVENT_CLICKED) || (code == LV_EVENT_RELEASED)) { - lv_obj_send_event(obj, LV_EVENT_CLICKED, NULL); - } -} - -static void show_dir(lv_obj_t * obj, const char * path) -{ - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - char fn[LV_FILE_EXPLORER_PATH_MAX_LEN]; - uint16_t index = 0; - lv_fs_dir_t dir; - lv_fs_res_t res; - - res = lv_fs_dir_open(&dir, path); - if(res != LV_FS_RES_OK) { - LV_LOG_USER("Open dir error %d!", res); - return; - } - - lv_table_set_cell_value_fmt(explorer->file_table, index++, 0, LV_SYMBOL_DIRECTORY " %s", "."); - lv_table_set_cell_value_fmt(explorer->file_table, index++, 0, LV_SYMBOL_DIRECTORY " %s", ".."); - lv_table_set_cell_value(explorer->file_table, 0, 1, "0"); - lv_table_set_cell_value(explorer->file_table, 1, 1, "0"); - - while(1) { - res = lv_fs_dir_read(&dir, fn, sizeof(fn)); - if(res != LV_FS_RES_OK) { - LV_LOG_USER("Driver, file or directory is not exists %d!", res); - break; - } - - /*fn is empty, if not more files to read*/ - if(lv_strlen(fn) == 0) { - LV_LOG_USER("Not more files to read!"); - break; - } - - if((is_end_with(fn, ".png") == true) || (is_end_with(fn, ".PNG") == true) || \ - (is_end_with(fn, ".jpg") == true) || (is_end_with(fn, ".JPG") == true) || \ - (is_end_with(fn, ".bmp") == true) || (is_end_with(fn, ".BMP") == true) || \ - (is_end_with(fn, ".gif") == true) || (is_end_with(fn, ".GIF") == true)) { - lv_table_set_cell_value_fmt(explorer->file_table, index, 0, LV_SYMBOL_IMAGE " %s", fn); - lv_table_set_cell_value(explorer->file_table, index, 1, "1"); - } - else if((is_end_with(fn, ".mp3") == true) || (is_end_with(fn, ".MP3") == true) || \ - (is_end_with(fn, ".wav") == true) || (is_end_with(fn, ".WAV") == true)) { - lv_table_set_cell_value_fmt(explorer->file_table, index, 0, LV_SYMBOL_AUDIO " %s", fn); - lv_table_set_cell_value(explorer->file_table, index, 1, "2"); - } - else if((is_end_with(fn, ".mp4") == true) || (is_end_with(fn, ".MP4") == true)) { - lv_table_set_cell_value_fmt(explorer->file_table, index, 0, LV_SYMBOL_VIDEO " %s", fn); - lv_table_set_cell_value(explorer->file_table, index, 1, "3"); - } - else if((is_end_with(fn, ".") == true) || (is_end_with(fn, "..") == true)) { - /*is dir*/ - continue; - } - else if(fn[0] == '/') {/*is dir*/ - lv_table_set_cell_value_fmt(explorer->file_table, index, 0, LV_SYMBOL_DIRECTORY " %s", fn + 1); - lv_table_set_cell_value(explorer->file_table, index, 1, "0"); - } - else { - lv_table_set_cell_value_fmt(explorer->file_table, index, 0, LV_SYMBOL_FILE " %s", fn); - lv_table_set_cell_value(explorer->file_table, index, 1, "4"); - } - - index++; - } - - lv_fs_dir_close(&dir); - - lv_table_set_row_count(explorer->file_table, index); - file_explorer_sort(obj); - lv_obj_send_event(obj, LV_EVENT_READY, NULL); - - /*Move the table to the top*/ - lv_obj_scroll_to_y(explorer->file_table, 0, LV_ANIM_OFF); - - lv_strlcpy(explorer->current_path, path, sizeof(explorer->current_path)); - lv_label_set_text_fmt(explorer->path_label, LV_SYMBOL_EYE_OPEN" %s", path); - - size_t current_path_len = lv_strlen(explorer->current_path); - if((*((explorer->current_path) + current_path_len) != '/') && (current_path_len < LV_FILE_EXPLORER_PATH_MAX_LEN)) { - *((explorer->current_path) + current_path_len) = '/'; - } -} - -/*Remove the specified suffix*/ -static void strip_ext(char * dir) -{ - char * end = dir + lv_strlen(dir); - - while(end >= dir && *end != '/') { - --end; - } - - if(end > dir) { - *end = '\0'; - } - else if(end == dir) { - *(end + 1) = '\0'; - } -} - -static void exch_table_item(lv_obj_t * tb, int16_t i, int16_t j) -{ - const char * tmp; - tmp = lv_table_get_cell_value(tb, i, 0); - lv_table_set_cell_value(tb, 0, 2, tmp); - lv_table_set_cell_value(tb, i, 0, lv_table_get_cell_value(tb, j, 0)); - lv_table_set_cell_value(tb, j, 0, lv_table_get_cell_value(tb, 0, 2)); - - tmp = lv_table_get_cell_value(tb, i, 1); - lv_table_set_cell_value(tb, 0, 2, tmp); - lv_table_set_cell_value(tb, i, 1, lv_table_get_cell_value(tb, j, 1)); - lv_table_set_cell_value(tb, j, 1, lv_table_get_cell_value(tb, 0, 2)); -} - -static void file_explorer_sort(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_file_explorer_t * explorer = (lv_file_explorer_t *)obj; - - uint16_t sum = lv_table_get_row_count(explorer->file_table); - - if(sum > 1) { - switch(explorer->sort) { - case LV_EXPLORER_SORT_NONE: - break; - case LV_EXPLORER_SORT_KIND: - sort_by_file_kind(explorer->file_table, 0, (sum - 1)); - break; - default: - break; - } - } -} - -/*Quick sort 3 way*/ -static void sort_by_file_kind(lv_obj_t * tb, int16_t lo, int16_t hi) -{ - if(lo >= hi) return; - - int16_t lt = lo; - int16_t i = lo + 1; - int16_t gt = hi; - const char * v = lv_table_get_cell_value(tb, lo, 1); - while(i <= gt) { - if(lv_strcmp(lv_table_get_cell_value(tb, i, 1), v) < 0) - exch_table_item(tb, lt++, i++); - else if(lv_strcmp(lv_table_get_cell_value(tb, i, 1), v) > 0) - exch_table_item(tb, i, gt--); - else - i++; - } - - sort_by_file_kind(tb, lo, lt - 1); - sort_by_file_kind(tb, gt + 1, hi); -} - -static bool is_end_with(const char * str1, const char * str2) -{ - if(str1 == NULL || str2 == NULL) - return false; - - uint16_t len1 = lv_strlen(str1); - uint16_t len2 = lv_strlen(str2); - if((len1 < len2) || (len1 == 0 || len2 == 0)) - return false; - - while(len2 >= 1) { - if(str2[len2 - 1] != str1[len1 - 1]) - return false; - - len2--; - len1--; - } - - return true; -} - -#endif /*LV_USE_FILE_EXPLORER*/ diff --git a/L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer.h b/L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer.h deleted file mode 100644 index 8dd7762..0000000 --- a/L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer.h +++ /dev/null @@ -1,168 +0,0 @@ -/** - * @file lv_file_explorer.h - * - */ - -#ifndef LV_FILE_EXPLORER_H -#define LV_FILE_EXPLORER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#include "../../core/lv_obj.h" - -#if LV_USE_FILE_EXPLORER != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef enum { - LV_EXPLORER_SORT_NONE, - LV_EXPLORER_SORT_KIND, -} lv_file_explorer_sort_t; - -#if LV_FILE_EXPLORER_QUICK_ACCESS -typedef enum { - LV_EXPLORER_HOME_DIR, - LV_EXPLORER_MUSIC_DIR, - LV_EXPLORER_PICTURES_DIR, - LV_EXPLORER_VIDEO_DIR, - LV_EXPLORER_DOCS_DIR, - LV_EXPLORER_FS_DIR, -} lv_file_explorer_dir_t; -#endif - -extern const lv_obj_class_t lv_file_explorer_class; - -/*********************** - * GLOBAL VARIABLES - ***********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ -lv_obj_t * lv_file_explorer_create(lv_obj_t * parent); - -/*===================== - * Setter functions - *====================*/ - -#if LV_FILE_EXPLORER_QUICK_ACCESS -/** - * Set file_explorer - * @param obj pointer to a label object - * @param dir the dir from 'lv_file_explorer_dir_t' enum. - * @param path path - - */ -void lv_file_explorer_set_quick_access_path(lv_obj_t * obj, lv_file_explorer_dir_t dir, const char * path); -#endif - -/** - * Set file_explorer sort - * @param obj pointer to a file explorer object - * @param sort the sort from 'lv_file_explorer_sort_t' enum. - */ -void lv_file_explorer_set_sort(lv_obj_t * obj, lv_file_explorer_sort_t sort); - -/*===================== - * Getter functions - *====================*/ - -/** - * Get file explorer Selected file - * @param obj pointer to a file explorer object - * @return pointer to the file explorer selected file name - */ -const char * lv_file_explorer_get_selected_file_name(const lv_obj_t * obj); - -/** - * Get file explorer cur path - * @param obj pointer to a file explorer object - * @return pointer to the file explorer cur path - */ -const char * lv_file_explorer_get_current_path(const lv_obj_t * obj); - -/** - * Get file explorer head area obj - * @param obj pointer to a file explorer object - * @return pointer to the file explorer head area obj(lv_obj) - */ -lv_obj_t * lv_file_explorer_get_header(lv_obj_t * obj); - -/** - * Get file explorer head area obj - * @param obj pointer to a file explorer object - * @return pointer to the file explorer quick access area obj(lv_obj) - */ -lv_obj_t * lv_file_explorer_get_quick_access_area(lv_obj_t * obj); - -/** - * Get file explorer path obj(label) - * @param obj pointer to a file explorer object - * @return pointer to the file explorer path obj(lv_label) - */ -lv_obj_t * lv_file_explorer_get_path_label(lv_obj_t * obj); - -#if LV_FILE_EXPLORER_QUICK_ACCESS -/** - * Get file explorer places list obj(lv_list) - * @param obj pointer to a file explorer object - * @return pointer to the file explorer places list obj(lv_list) - */ -lv_obj_t * lv_file_explorer_get_places_list(lv_obj_t * obj); - -/** - * Get file explorer device list obj(lv_list) - * @param obj pointer to a file explorer object - * @return pointer to the file explorer device list obj(lv_list) - */ -lv_obj_t * lv_file_explorer_get_device_list(lv_obj_t * obj); -#endif - -/** - * Get file explorer file list obj(lv_table) - * @param obj pointer to a file explorer object - * @return pointer to the file explorer file table obj(lv_table) - */ -lv_obj_t * lv_file_explorer_get_file_table(lv_obj_t * obj); - -/** - * Set file_explorer sort - * @param obj pointer to a file explorer object - * @return the current mode from 'lv_file_explorer_sort_t' - */ -lv_file_explorer_sort_t lv_file_explorer_get_sort(const lv_obj_t * obj); - -/*===================== - * Other functions - *====================*/ - -/** - * Open a specified path - * @param obj pointer to a file explorer object - * @param dir pointer to the path - */ -void lv_file_explorer_open_dir(lv_obj_t * obj, const char * dir); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_FILE_EXPLORER*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_FILE_EXPLORER_H*/ diff --git a/L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer_private.h b/L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer_private.h deleted file mode 100644 index 1b7eca1..0000000 --- a/L3_Middlewares/LVGL/src/others/file_explorer/lv_file_explorer_private.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file lv_file_explorer_private.h - * - */ - -#ifndef LV_FILE_EXPLORER_PRIVATE_H -#define LV_FILE_EXPLORER_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_file_explorer.h" - -#if LV_USE_FILE_EXPLORER != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/*Data of canvas*/ -struct lv_file_explorer_t { - lv_obj_t obj; - lv_obj_t * cont; - lv_obj_t * head_area; - lv_obj_t * browser_area; - lv_obj_t * file_table; - lv_obj_t * path_label; -#if LV_FILE_EXPLORER_QUICK_ACCESS - lv_obj_t * quick_access_area; - lv_obj_t * list_device; - lv_obj_t * list_places; - char * home_dir; - char * music_dir; - char * pictures_dir; - char * video_dir; - char * docs_dir; - char * fs_dir; -#endif - const char * sel_fn; - char current_path[LV_FILE_EXPLORER_PATH_MAX_LEN]; - lv_file_explorer_sort_t sort; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_FILE_EXPLORER != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_FILE_EXPLORER_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/others/fragment/lv_fragment_private.h b/L3_Middlewares/LVGL/src/others/fragment/lv_fragment_private.h deleted file mode 100644 index 3af36dd..0000000 --- a/L3_Middlewares/LVGL/src/others/fragment/lv_fragment_private.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file lv_fragment_private.h - * - */ - -#ifndef LV_FRAGMENT_PRIVATE_H -#define LV_FRAGMENT_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_fragment.h" - -#if LV_USE_FRAGMENT - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * Fragment states - */ -struct lv_fragment_managed_states_t { - /** - * Class of the fragment - */ - const lv_fragment_class_t * cls; - /** - * Manager the fragment attached to - */ - lv_fragment_manager_t * manager; - /** - * Container object the fragment adding view to - */ - lv_obj_t * const * container; - /** - * Fragment instance - */ - lv_fragment_t * instance; - /** - * true between `create_obj_cb` and `obj_deleted_cb` - */ - bool obj_created; - /** - * true before `lv_fragment_delete_obj` is called. Don't touch any object if this is true - */ - bool destroying_obj; - /** - * true if this fragment is in navigation stack that can be popped - */ - bool in_stack; -}; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_FRAGMENT */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_FRAGMENT_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/others/ime/lv_ime_pinyin_private.h b/L3_Middlewares/LVGL/src/others/ime/lv_ime_pinyin_private.h deleted file mode 100644 index 6ec42fc..0000000 --- a/L3_Middlewares/LVGL/src/others/ime/lv_ime_pinyin_private.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file lv_ime_pinyin_private.h - * - */ - -#ifndef LV_IME_PINYIN_PRIVATE_H -#define LV_IME_PINYIN_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_ime_pinyin.h" - -#if LV_USE_IME_PINYIN != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/*Data of lv_ime_pinyin*/ -struct lv_ime_pinyin_t { - lv_obj_t obj; - lv_obj_t * kb; - lv_obj_t * cand_panel; - const lv_pinyin_dict_t * dict; - lv_ll_t k9_legal_py_ll; - char * cand_str; /* Candidate string */ - char input_char[16]; /* Input box character */ -#if LV_IME_PINYIN_USE_K9_MODE - char k9_input_str[LV_IME_PINYIN_K9_MAX_INPUT + 1]; /* 9-key input(k9) mode input string */ - uint16_t k9_py_ll_pos; /* Current pinyin map pages(k9) */ - uint16_t k9_legal_py_count; /* Count of legal Pinyin numbers(k9) */ - uint16_t k9_input_str_len; /* 9-key input(k9) mode input string max len */ -#endif - uint16_t ta_count; /* The number of characters entered in the text box this time */ - uint16_t cand_num; /* Number of candidates */ - uint16_t py_page; /* Current pinyin map pages(k26) */ - uint16_t py_num[26]; /* Number and length of Pinyin */ - uint16_t py_pos[26]; /* Pinyin position */ - lv_ime_pinyin_mode_t mode; /* Set mode, 1: 26-key input(k26), 0: 9-key input(k9). Default: 1. */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_IME_PINYIN != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_IME_PINYIN_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/others/monkey/lv_monkey_private.h b/L3_Middlewares/LVGL/src/others/monkey/lv_monkey_private.h deleted file mode 100644 index a08ea07..0000000 --- a/L3_Middlewares/LVGL/src/others/monkey/lv_monkey_private.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file lv_monkey_private.h - * - */ - -#ifndef LV_MONKEY_PRIVATE_H -#define LV_MONKEY_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_monkey.h" - -#if LV_USE_MONKEY != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_MONKEY != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_MONKEY_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/others/observer/lv_observer.c b/L3_Middlewares/LVGL/src/others/observer/lv_observer.c deleted file mode 100644 index 8d43f52..0000000 --- a/L3_Middlewares/LVGL/src/others/observer/lv_observer.c +++ /dev/null @@ -1,725 +0,0 @@ -/** - * @file lv_observer.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_observer_private.h" -#if LV_USE_OBSERVER - -#include "../../lvgl.h" -#include "../../core/lv_obj_private.h" -#include "../../misc/lv_event_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - uint32_t flag; - lv_subject_value_t value; - uint32_t inv : 1; -} flag_and_cond_t; - -/********************** - * STATIC PROTOTYPES - **********************/ -static void unsubscribe_on_delete_cb(lv_event_t * e); -static void group_notify_cb(lv_observer_t * observer, lv_subject_t * subject); -static lv_observer_t * bind_to_bitfield(lv_subject_t * subject, lv_obj_t * obj, lv_observer_cb_t cb, uint32_t flag, - int32_t ref_value, bool inv); -static void obj_flag_observer_cb(lv_observer_t * observer, lv_subject_t * subject); -static void obj_state_observer_cb(lv_observer_t * observer, lv_subject_t * subject); -static void obj_value_changed_event_cb(lv_event_t * e); - -#if LV_USE_LABEL - static void label_text_observer_cb(lv_observer_t * observer, lv_subject_t * subject); -#endif - -#if LV_USE_ARC - static void arc_value_changed_event_cb(lv_event_t * e); - static void arc_value_observer_cb(lv_observer_t * observer, lv_subject_t * subject); -#endif - -#if LV_USE_SLIDER - static void slider_value_changed_event_cb(lv_event_t * e); - static void slider_value_observer_cb(lv_observer_t * observer, lv_subject_t * subject); -#endif - -#if LV_USE_ROLLER - static void roller_value_changed_event_cb(lv_event_t * e); - static void roller_value_observer_cb(lv_observer_t * observer, lv_subject_t * subject); -#endif - -#if LV_USE_DROPDOWN - static void dropdown_value_changed_event_cb(lv_event_t * e); - static void dropdown_value_observer_cb(lv_observer_t * observer, lv_subject_t * subject); -#endif - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_subject_init_int(lv_subject_t * subject, int32_t value) -{ - lv_memzero(subject, sizeof(lv_subject_t)); - subject->type = LV_SUBJECT_TYPE_INT; - subject->value.num = value; - subject->prev_value.num = value; - lv_ll_init(&(subject->subs_ll), sizeof(lv_observer_t)); -} - -void lv_subject_set_int(lv_subject_t * subject, int32_t value) -{ - if(subject->type != LV_SUBJECT_TYPE_INT) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_INT"); - return; - } - - subject->prev_value.num = subject->value.num; - subject->value.num = value; - lv_subject_notify(subject); -} - -int32_t lv_subject_get_int(lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_INT) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_INT"); - return 0; - } - - return subject->value.num; -} - -int32_t lv_subject_get_previous_int(lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_INT) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_INT"); - return 0; - } - - return subject->prev_value.num; -} - -void lv_subject_init_string(lv_subject_t * subject, char * buf, char * prev_buf, size_t size, const char * value) -{ - lv_memzero(subject, sizeof(lv_subject_t)); - lv_strlcpy(buf, value, size); - if(prev_buf) lv_strlcpy(prev_buf, value, size); - - subject->type = LV_SUBJECT_TYPE_STRING; - subject->size = size; - subject->value.pointer = buf; - subject->prev_value.pointer = prev_buf; - - lv_ll_init(&(subject->subs_ll), sizeof(lv_observer_t)); -} - -void lv_subject_copy_string(lv_subject_t * subject, const char * buf) -{ - if(subject->type != LV_SUBJECT_TYPE_STRING) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_INT"); - return; - } - - if(subject->size < 1) return; - if(subject->prev_value.pointer) { - lv_strlcpy((char *)subject->prev_value.pointer, subject->value.pointer, subject->size); - } - - lv_strlcpy((char *)subject->value.pointer, buf, subject->size); - - lv_subject_notify(subject); - -} - -const char * lv_subject_get_string(lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_STRING) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_STRING"); - return ""; - } - - return subject->value.pointer; -} - -const char * lv_subject_get_previous_string(lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_STRING) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_STRING"); - return NULL; - } - - return subject->prev_value.pointer; -} - -void lv_subject_init_pointer(lv_subject_t * subject, void * value) -{ - lv_memzero(subject, sizeof(lv_subject_t)); - subject->type = LV_SUBJECT_TYPE_POINTER; - subject->value.pointer = value; - subject->prev_value.pointer = value; - lv_ll_init(&(subject->subs_ll), sizeof(lv_observer_t)); -} - -void lv_subject_set_pointer(lv_subject_t * subject, void * ptr) -{ - if(subject->type != LV_SUBJECT_TYPE_POINTER) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_POINTER"); - return; - } - - subject->prev_value.pointer = subject->value.pointer; - subject->value.pointer = ptr; - lv_subject_notify(subject); -} - -const void * lv_subject_get_pointer(lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_POINTER) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_POINTER"); - return NULL; - } - - return subject->value.pointer; -} - -const void * lv_subject_get_previous_pointer(lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_POINTER) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_POINTER"); - return NULL; - } - - return subject->prev_value.pointer; -} - -void lv_subject_init_color(lv_subject_t * subject, lv_color_t color) -{ - lv_memzero(subject, sizeof(lv_subject_t)); - subject->type = LV_SUBJECT_TYPE_COLOR; - subject->value.color = color; - subject->prev_value.color = color; - lv_ll_init(&(subject->subs_ll), sizeof(lv_observer_t)); -} - -void lv_subject_set_color(lv_subject_t * subject, lv_color_t color) -{ - if(subject->type != LV_SUBJECT_TYPE_COLOR) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_COLOR"); - return; - } - - subject->prev_value.color = subject->value.color; - subject->value.color = color; - lv_subject_notify(subject); -} - -lv_color_t lv_subject_get_color(lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_COLOR) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_COLOR"); - return lv_color_black(); - } - - return subject->value.color; -} - -lv_color_t lv_subject_get_previous_color(lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_COLOR) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_COLOR"); - return lv_color_black(); - } - - return subject->prev_value.color; -} - -void lv_subject_init_group(lv_subject_t * subject, lv_subject_t * list[], uint32_t list_len) -{ - subject->type = LV_SUBJECT_TYPE_GROUP; - subject->size = list_len; - lv_ll_init(&(subject->subs_ll), sizeof(lv_observer_t)); - subject->value.pointer = list; - - /* bind all subjects to this subject */ - uint32_t i; - for(i = 0; i < list_len; i++) { - /*If a subject in the group changes notify the group itself*/ - lv_subject_add_observer(list[i], group_notify_cb, subject); - } -} - -void lv_subject_deinit(lv_subject_t * subject) -{ - lv_observer_t * observer = lv_ll_get_head(&subject->subs_ll); - while(observer) { - lv_observer_t * observer_next = lv_ll_get_next(&subject->subs_ll, observer); - - if(observer->for_obj) { - lv_obj_remove_event_cb(observer->target, unsubscribe_on_delete_cb); - lv_obj_remove_event_cb_with_user_data(observer->target, NULL, subject); - } - - lv_observer_remove(observer); - observer = observer_next; - } - - lv_ll_clear(&subject->subs_ll); -} - -lv_subject_t * lv_subject_get_group_element(lv_subject_t * subject, int32_t index) -{ - if(subject->type != LV_SUBJECT_TYPE_GROUP) { - LV_LOG_WARN("Subject type is not LV_SUBJECT_TYPE_GROUP"); - return NULL; - } - - if(index >= subject->size) return NULL; - - return ((lv_subject_t **)(subject->value.pointer))[index]; -} - -lv_observer_t * lv_subject_add_observer(lv_subject_t * subject, lv_observer_cb_t cb, void * user_data) -{ - lv_observer_t * observer = lv_subject_add_observer_obj(subject, cb, NULL, user_data); - if(observer == NULL) return NULL; - - observer->for_obj = 0; - return observer; -} - -lv_observer_t * lv_subject_add_observer_obj(lv_subject_t * subject, lv_observer_cb_t cb, lv_obj_t * obj, - void * user_data) -{ - LV_ASSERT_NULL(subject); - if(subject->type == LV_SUBJECT_TYPE_INVALID) { - LV_LOG_WARN("Subject not initialized yet"); - return NULL; - } - lv_observer_t * observer = lv_ll_ins_tail(&(subject->subs_ll)); - LV_ASSERT_MALLOC(observer); - if(observer == NULL) return NULL; - - lv_memzero(observer, sizeof(*observer)); - - observer->subject = subject; - observer->cb = cb; - observer->user_data = user_data; - observer->target = obj; - observer->for_obj = 1; - /* subscribe to delete event of the object */ - if(obj != NULL) { - lv_obj_add_event_cb(obj, unsubscribe_on_delete_cb, LV_EVENT_DELETE, observer); - } - - /* update object immediately */ - if(observer->cb) observer->cb(observer, subject); - - return observer; -} - -lv_observer_t * lv_subject_add_observer_with_target(lv_subject_t * subject, lv_observer_cb_t cb, void * target, - void * user_data) -{ - LV_ASSERT_NULL(subject); - if(subject->type == LV_SUBJECT_TYPE_INVALID) { - LV_LOG_WARN("Subject not initialized yet"); - return NULL; - } - lv_observer_t * observer = lv_ll_ins_tail(&(subject->subs_ll)); - LV_ASSERT_MALLOC(observer); - if(observer == NULL) return NULL; - - lv_memzero(observer, sizeof(*observer)); - - observer->subject = subject; - observer->cb = cb; - observer->user_data = user_data; - observer->target = target; - - /* update object immediately */ - if(observer->cb) observer->cb(observer, subject); - - return observer; -} - - -void lv_observer_remove(lv_observer_t * observer) -{ - LV_ASSERT_NULL(observer); - - observer->subject->notify_restart_query = 1; - - lv_ll_remove(&(observer->subject->subs_ll), observer); - - if(observer->auto_free_user_data) { - lv_free(observer->user_data); - } - lv_free(observer); -} - -void lv_obj_remove_from_subject(lv_obj_t * obj, lv_subject_t * subject) -{ - int32_t i; - int32_t event_cnt = (int32_t)(obj->spec_attr ? lv_array_size(&obj->spec_attr->event_list) : 0); - for(i = event_cnt - 1; i >= 0; i--) { - lv_event_dsc_t * event_dsc = lv_obj_get_event_dsc(obj, i); - if(event_dsc->cb == unsubscribe_on_delete_cb) { - lv_observer_t * observer = event_dsc->user_data; - if(subject == NULL || subject == observer->subject) { - lv_observer_remove(observer); - lv_obj_remove_event(obj, i); - } - } - } -} - -void * lv_observer_get_target(lv_observer_t * observer) -{ - LV_ASSERT_NULL(observer); - - return observer->target; -} - -void lv_subject_notify(lv_subject_t * subject) -{ - LV_ASSERT_NULL(subject); - - lv_observer_t * observer; - LV_LL_READ(&(subject->subs_ll), observer) { - observer->notified = 0; - } - - do { - subject->notify_restart_query = 0; - LV_LL_READ(&(subject->subs_ll), observer) { - if(observer->cb && observer->notified == 0) { - observer->cb(observer, subject); - if(subject->notify_restart_query) break; - observer->notified = 1; - } - } - } while(subject->notify_restart_query); -} - -lv_observer_t * lv_obj_bind_flag_if_eq(lv_obj_t * obj, lv_subject_t * subject, lv_obj_flag_t flag, int32_t ref_value) -{ - lv_observer_t * observable = bind_to_bitfield(subject, obj, obj_flag_observer_cb, flag, ref_value, false); - return observable; -} - -lv_observer_t * lv_obj_bind_flag_if_not_eq(lv_obj_t * obj, lv_subject_t * subject, lv_obj_flag_t flag, - int32_t ref_value) -{ - lv_observer_t * observable = bind_to_bitfield(subject, obj, obj_flag_observer_cb, flag, ref_value, true); - return observable; -} - -lv_observer_t * lv_obj_bind_state_if_eq(lv_obj_t * obj, lv_subject_t * subject, lv_state_t state, int32_t ref_value) -{ - lv_observer_t * observable = bind_to_bitfield(subject, obj, obj_state_observer_cb, state, ref_value, false); - return observable; -} - -lv_observer_t * lv_obj_bind_state_if_not_eq(lv_obj_t * obj, lv_subject_t * subject, lv_state_t state, int32_t ref_value) -{ - lv_observer_t * observable = bind_to_bitfield(subject, obj, obj_state_observer_cb, state, ref_value, true); - return observable; -} - -lv_observer_t * lv_obj_bind_checked(lv_obj_t * obj, lv_subject_t * subject) -{ - lv_observer_t * observable = bind_to_bitfield(subject, obj, obj_state_observer_cb, LV_STATE_CHECKED, 1, false); - lv_obj_add_event_cb(obj, obj_value_changed_event_cb, LV_EVENT_VALUE_CHANGED, subject); - return observable; -} - -#if LV_USE_LABEL -lv_observer_t * lv_label_bind_text(lv_obj_t * obj, lv_subject_t * subject, const char * fmt) -{ - if(fmt == NULL) { - if(subject->type != LV_SUBJECT_TYPE_STRING && subject->type != LV_SUBJECT_TYPE_POINTER) { - LV_LOG_WARN("Incompatible subject type: %d", subject->type); - return NULL; - } - } - else { - if(subject->type != LV_SUBJECT_TYPE_STRING && subject->type != LV_SUBJECT_TYPE_POINTER && - subject->type != LV_SUBJECT_TYPE_INT) { - LV_LOG_WARN("Incompatible subject type: %d", subject->type); - return NULL; - } - } - - lv_observer_t * observer = lv_subject_add_observer_obj(subject, label_text_observer_cb, obj, (void *)fmt); - return observer; -} -#endif /*LV_USE_LABEL*/ - -#if LV_USE_ARC -lv_observer_t * lv_arc_bind_value(lv_obj_t * obj, lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_INT) { - LV_LOG_WARN("Incompatible subject type: %d", subject->type); - return NULL; - } - - lv_obj_add_event_cb(obj, arc_value_changed_event_cb, LV_EVENT_VALUE_CHANGED, subject); - - lv_observer_t * observer = lv_subject_add_observer_obj(subject, arc_value_observer_cb, obj, NULL); - return observer; -} -#endif /*LV_USE_ARC*/ - -#if LV_USE_SLIDER -lv_observer_t * lv_slider_bind_value(lv_obj_t * obj, lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_INT) { - LV_LOG_WARN("Incompatible subject type: %d", subject->type); - return NULL; - } - - lv_obj_add_event_cb(obj, slider_value_changed_event_cb, LV_EVENT_VALUE_CHANGED, subject); - - lv_observer_t * observer = lv_subject_add_observer_obj(subject, slider_value_observer_cb, obj, NULL); - return observer; -} -#endif /*LV_USE_SLIDER*/ - -#if LV_USE_ROLLER - -lv_observer_t * lv_roller_bind_value(lv_obj_t * obj, lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_INT) { - LV_LOG_WARN("Incompatible subject type: %d", subject->type); - return NULL; - } - - lv_obj_add_event_cb(obj, roller_value_changed_event_cb, LV_EVENT_VALUE_CHANGED, subject); - - lv_observer_t * observer = lv_subject_add_observer_obj(subject, roller_value_observer_cb, obj, NULL); - return observer; - -} -#endif /*LV_USE_ROLLER*/ - -#if LV_USE_DROPDOWN - -lv_observer_t * lv_dropdown_bind_value(lv_obj_t * obj, lv_subject_t * subject) -{ - if(subject->type != LV_SUBJECT_TYPE_INT) { - LV_LOG_WARN("Incompatible subject type: %d", subject->type); - return NULL; - } - - lv_obj_add_event_cb(obj, dropdown_value_changed_event_cb, LV_EVENT_VALUE_CHANGED, subject); - - lv_observer_t * observer = lv_subject_add_observer_obj(subject, dropdown_value_observer_cb, obj, NULL); - return observer; - -} - -#endif /*LV_USE_DROPDOWN*/ - -lv_obj_t * lv_observer_get_target_obj(lv_observer_t * observer) -{ - return (lv_obj_t *)lv_observer_get_target(observer); -} - -void * lv_observer_get_user_data(const lv_observer_t * observer) -{ - LV_ASSERT_NULL(observer); - - return observer->user_data; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void group_notify_cb(lv_observer_t * observer, lv_subject_t * subject) -{ - LV_UNUSED(subject); - lv_subject_t * subject_group = observer->user_data; - lv_subject_notify(subject_group); -} - -static void unsubscribe_on_delete_cb(lv_event_t * e) -{ - lv_observer_t * observer = lv_event_get_user_data(e); - lv_observer_remove(observer); -} - -static lv_observer_t * bind_to_bitfield(lv_subject_t * subject, lv_obj_t * obj, lv_observer_cb_t cb, uint32_t flag, - int32_t ref_value, bool inv) -{ - if(subject->type != LV_SUBJECT_TYPE_INT) { - LV_LOG_WARN("Incompatible subject type: %d", subject->type); - return NULL; - } - - flag_and_cond_t * p = lv_malloc(sizeof(flag_and_cond_t)); - if(p == NULL) { - LV_LOG_WARN("Out of memory"); - return NULL; - } - - p->flag = flag; - p->value.num = ref_value; - p->inv = inv; - - lv_observer_t * observable = lv_subject_add_observer_obj(subject, cb, obj, p); - observable->auto_free_user_data = 1; - return observable; -} - -static void obj_flag_observer_cb(lv_observer_t * observer, lv_subject_t * subject) -{ - flag_and_cond_t * p = observer->user_data; - - bool res = subject->value.num == p->value.num; - if(p->inv) res = !res; - - if(res) { - lv_obj_add_flag(observer->target, p->flag); - } - else { - lv_obj_remove_flag(observer->target, p->flag); - } -} - -static void obj_state_observer_cb(lv_observer_t * observer, lv_subject_t * subject) -{ - flag_and_cond_t * p = observer->user_data; - - bool res = subject->value.num == p->value.num; - if(p->inv) res = !res; - - if(res) { - lv_obj_add_state(observer->target, p->flag); - } - else { - lv_obj_remove_state(observer->target, p->flag); - } -} - -static void obj_value_changed_event_cb(lv_event_t * e) -{ - lv_obj_t * obj = lv_event_get_current_target(e); - lv_subject_t * subject = lv_event_get_user_data(e); - - lv_subject_set_int(subject, lv_obj_has_state(obj, LV_STATE_CHECKED)); -} - -#if LV_USE_LABEL - -static void label_text_observer_cb(lv_observer_t * observer, lv_subject_t * subject) -{ - const char * fmt = observer->user_data; - - if(fmt == NULL) { - lv_label_set_text(observer->target, subject->value.pointer); - } - else { - switch(subject->type) { - case LV_SUBJECT_TYPE_INT: - lv_label_set_text_fmt(observer->target, fmt, subject->value.num); - break; - case LV_SUBJECT_TYPE_STRING: - case LV_SUBJECT_TYPE_POINTER: - lv_label_set_text_fmt(observer->target, fmt, subject->value.pointer); - break; - default: - break; - } - } -} - -#endif /*LV_USE_LABEL*/ - -#if LV_USE_ARC - -static void arc_value_changed_event_cb(lv_event_t * e) -{ - lv_obj_t * arc = lv_event_get_current_target(e); - lv_subject_t * subject = lv_event_get_user_data(e); - - lv_subject_set_int(subject, lv_arc_get_value(arc)); -} - -static void arc_value_observer_cb(lv_observer_t * observer, lv_subject_t * subject) -{ - lv_arc_set_value(observer->target, subject->value.num); -} - -#endif /*LV_USE_ARC*/ - -#if LV_USE_SLIDER - -static void slider_value_changed_event_cb(lv_event_t * e) -{ - lv_obj_t * slider = lv_event_get_current_target(e); - lv_subject_t * subject = lv_event_get_user_data(e); - - lv_subject_set_int(subject, lv_slider_get_value(slider)); -} - -static void slider_value_observer_cb(lv_observer_t * observer, lv_subject_t * subject) -{ - lv_slider_set_value(observer->target, subject->value.num, LV_ANIM_OFF); -} - -#endif /*LV_USE_SLIDER*/ - -#if LV_USE_ROLLER - -static void roller_value_changed_event_cb(lv_event_t * e) -{ - lv_obj_t * roller = lv_event_get_current_target(e); - lv_subject_t * subject = lv_event_get_user_data(e); - - lv_subject_set_int(subject, lv_roller_get_selected(roller)); -} - -static void roller_value_observer_cb(lv_observer_t * observer, lv_subject_t * subject) -{ - if((int32_t)lv_roller_get_selected(observer->target) != subject->value.num) { - lv_roller_set_selected(observer->target, subject->value.num, LV_ANIM_OFF); - } -} - -#endif /*LV_USE_ROLLER*/ - -#if LV_USE_DROPDOWN - -static void dropdown_value_changed_event_cb(lv_event_t * e) -{ - lv_obj_t * dropdown = lv_event_get_current_target(e); - lv_subject_t * subject = lv_event_get_user_data(e); - - lv_subject_set_int(subject, lv_dropdown_get_selected(dropdown)); -} - -static void dropdown_value_observer_cb(lv_observer_t * observer, lv_subject_t * subject) -{ - lv_dropdown_set_selected(observer->target, subject->value.num); -} - -#endif /*LV_USE_DROPDOWN*/ - -#endif /*LV_USE_OBSERVER*/ diff --git a/L3_Middlewares/LVGL/src/others/observer/lv_observer.h b/L3_Middlewares/LVGL/src/others/observer/lv_observer.h deleted file mode 100644 index cec77fe..0000000 --- a/L3_Middlewares/LVGL/src/others/observer/lv_observer.h +++ /dev/null @@ -1,406 +0,0 @@ -/** - * @file lv_observer.h - * - */ - -#ifndef LV_OBSERVER_H -#define LV_OBSERVER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj.h" -#if LV_USE_OBSERVER - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * Values for lv_submect_t's `type` field. - */ -typedef enum { - LV_SUBJECT_TYPE_INVALID = 0, /**< indicates subject not initialized yet*/ - LV_SUBJECT_TYPE_NONE = 1, /**< a null value like None or NILt*/ - LV_SUBJECT_TYPE_INT = 2, /**< an int32_t*/ - LV_SUBJECT_TYPE_POINTER = 3, /**< a void pointer*/ - LV_SUBJECT_TYPE_COLOR = 4, /**< an lv_color_t*/ - LV_SUBJECT_TYPE_GROUP = 5, /**< an array of subjects*/ - LV_SUBJECT_TYPE_STRING = 6, /**< a char pointer*/ -} lv_subject_type_t; - -/** - * A common type to handle all the various observable types in the same way - */ -typedef union { - int32_t num; /**< Integer number (opacity, enums, booleans or "normal" numbers)*/ - const void * pointer; /**< Constant pointer (string buffer, format string, font, cone text, etc)*/ - lv_color_t color; /**< Color */ -} lv_subject_value_t; - -/** - * The subject (an observable value) - */ -typedef struct { - lv_ll_t subs_ll; /**< Subscribers*/ - uint32_t type : 4; - uint32_t size : 28; /**< Might be used to store a size related to `type`*/ - lv_subject_value_t value; /**< Actual value*/ - lv_subject_value_t prev_value; /**< Previous value*/ - uint32_t notify_restart_query : 1; /**< If an observer deleted start notifying from the beginning. */ - void * user_data; /**< Additional parameter, can be used freely by the user*/ -} lv_subject_t; - -/** - * Callback called when the observed value changes - * @param observer pointer to the observer of the callback - * @param subject pointer to the subject of the observer - */ -typedef void (*lv_observer_cb_t)(lv_observer_t * observer, lv_subject_t * subject); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize an integer type subject - * @param subject pointer to the subject - * @param value initial value - */ -void lv_subject_init_int(lv_subject_t * subject, int32_t value); - -/** - * Set the value of an integer subject. It will notify all the observers as well. - * @param subject pointer to the subject - * @param value the new value - */ -void lv_subject_set_int(lv_subject_t * subject, int32_t value); - -/** - * Get the current value of an integer subject - * @param subject pointer to the subject - * @return the current value - */ -int32_t lv_subject_get_int(lv_subject_t * subject); - -/** - * Get the previous value of an integer subject - * @param subject pointer to the subject - * @return the current value - */ -int32_t lv_subject_get_previous_int(lv_subject_t * subject); - -/** - * Initialize a string type subject - * @param subject pointer to the subject - * @param buf pointer to a buffer to store the string - * @param prev_buf pointer to a buffer to store the previous string, can be NULL if not used - * @param size size of the buffer - * @param value initial value as a string, e.g. "hello" - * @note the string subject stores the whole string, not only a pointer - */ -void lv_subject_init_string(lv_subject_t * subject, char * buf, char * prev_buf, size_t size, const char * value); - -/** - * Copy a string to a subject. It will notify all the observers as well. - * @param subject pointer to the subject - * @param buf the new string - */ -void lv_subject_copy_string(lv_subject_t * subject, const char * buf); - -/** - * Get the current value of an string subject - * @param subject pointer to the subject - * @return pointer to the buffer containing the current value - */ -const char * lv_subject_get_string(lv_subject_t * subject); - -/** - * Get the previous value of an string subject - * @param subject pointer to the subject - * @return pointer to the buffer containing the current value - * @note NULL will be returned if NULL was passed in `lv_subject_init_string()` - * as `prev_buf` - */ -const char * lv_subject_get_previous_string(lv_subject_t * subject); - -/** - * Initialize an pointer type subject - * @param subject pointer to the subject - * @param value initial value - */ -void lv_subject_init_pointer(lv_subject_t * subject, void * value); - -/** - * Set the value of a pointer subject. It will notify all the observers as well. - * @param subject pointer to the subject - * @param ptr new value - */ -void lv_subject_set_pointer(lv_subject_t * subject, void * ptr); - -/** - * Get the current value of a pointer subject - * @param subject pointer to the subject - * @return current value - */ -const void * lv_subject_get_pointer(lv_subject_t * subject); - -/** - * Get the previous value of a pointer subject - * @param subject pointer to the subject - * @return current value - */ -const void * lv_subject_get_previous_pointer(lv_subject_t * subject); - -/** - * Initialize an color type subject - * @param subject pointer to the subject - * @param color initial value - */ -void lv_subject_init_color(lv_subject_t * subject, lv_color_t color); - -/** - * Set the value of a color subject. It will notify all the observers as well. - * @param subject pointer to the subject - * @param color new value - */ -void lv_subject_set_color(lv_subject_t * subject, lv_color_t color); - -/** - * Get the current value of a color subject - * @param subject pointer to the subject - * @return current value - */ -lv_color_t lv_subject_get_color(lv_subject_t * subject); - -/** - * Get the previous value of a color subject - * @param subject pointer to the subject - * @return current value - */ -lv_color_t lv_subject_get_previous_color(lv_subject_t * subject); - -/** - * Initialize a subject group - * @param subject pointer to the subject - * @param list list of other subject addresses, any of these changes `subject` will be notified - * @param list_len number of elements in `list` - */ -void lv_subject_init_group(lv_subject_t * subject, lv_subject_t * list[], uint32_t list_len); - -/** - * Remove all the observers from a subject and free all allocated memories in it - * @param subject pointer to the subject - * @note objects added with `lv_subject_add_observer_obj` should be already deleted or - * removed manually. - */ -void lv_subject_deinit(lv_subject_t * subject); - -/** - * Get an element from the subject group's list - * @param subject pointer to the subject - * @param index index of the element to get - * @return pointer a subject from the list, or NULL if the index is out of bounds - */ -lv_subject_t * lv_subject_get_group_element(lv_subject_t * subject, int32_t index); - -/** - * Add an observer to a subject. When the subject changes `observer_cb` will be called. - * @param subject pointer to the subject - * @param observer_cb callback to call - * @param user_data optional user data - * @return pointer to the created observer - */ -lv_observer_t * lv_subject_add_observer(lv_subject_t * subject, lv_observer_cb_t observer_cb, void * user_data); - -/** - * Add an observer to a subject for an object. - * When the object is deleted, it will be removed from the subject automatically. - * @param subject pointer to the subject - * @param observer_cb callback to call - * @param obj pointer to an object - * @param user_data optional user data - * @return pointer to the created observer - */ -lv_observer_t * lv_subject_add_observer_obj(lv_subject_t * subject, lv_observer_cb_t observer_cb, lv_obj_t * obj, - void * user_data); - -/** - * Add an observer to a subject and also save a target. - * @param subject pointer to the subject - * @param observer_cb callback to call - * @param target pointer to any data - * @param user_data optional user data - * @return pointer to the created observer - */ -lv_observer_t * lv_subject_add_observer_with_target(lv_subject_t * subject, lv_observer_cb_t observer_cb, - void * target, void * user_data); - -/** - * Remove an observer from its subject - * @param observer pointer to an observer - */ -void lv_observer_remove(lv_observer_t * observer); - -/** - * Remove the observers of an object from a subject or all subjects - * @param obj the object whose observers should be removed - * @param subject the subject to remove the object from, or `NULL` to remove from all subjects - * @note This function can be used e.g. when an object's subject(s) needs to be replaced by other subject(s) - */ -void lv_obj_remove_from_subject(lv_obj_t * obj, lv_subject_t * subject); - -/** - * Get the target of an observer - * @param observer pointer to an observer - * @return pointer to the saved target - */ -void * lv_observer_get_target(lv_observer_t * observer); - -/** - * Get the target object of the observer. - * It's the same as `lv_observer_get_target` and added only - * for semantic reasons - * @param observer pointer to an observer - * @return pointer to the saved object target - */ -lv_obj_t * lv_observer_get_target_obj(lv_observer_t * observer); - -/** - * Get the user data of the observer. - * @param observer pointer to an observer - * @return void pointer to the saved user data -*/ -void * lv_observer_get_user_data(const lv_observer_t * observer); - -/** - * Notify all observers of subject - * @param subject pointer to a subject - */ -void lv_subject_notify(lv_subject_t * subject); - -/** - * Set an object flag if an integer subject's value is equal to a reference value, clear the flag otherwise - * @param obj pointer to an object - * @param subject pointer to a subject - * @param flag flag to set or clear (e.g. `LV_OBJ_FLAG_HIDDEN`) - * @param ref_value reference value to compare the subject's value with - * @return pointer to the created observer - */ -lv_observer_t * lv_obj_bind_flag_if_eq(lv_obj_t * obj, lv_subject_t * subject, lv_obj_flag_t flag, int32_t ref_value); - -/** - * Set an object flag if an integer subject's value is not equal to a reference value, clear the flag otherwise - * @param obj pointer to an object - * @param subject pointer to a subject - * @param flag flag to set or clear (e.g. `LV_OBJ_FLAG_HIDDEN`) - * @param ref_value reference value to compare the subject's value with - * @return pointer to the created observer - */ -lv_observer_t * lv_obj_bind_flag_if_not_eq(lv_obj_t * obj, lv_subject_t * subject, lv_obj_flag_t flag, - int32_t ref_value); - -/** - * Set an object state if an integer subject's value is equal to a reference value, clear the flag otherwise - * @param obj pointer to an object - * @param subject pointer to a subject - * @param state state to set or clear (e.g. `LV_STATE_CHECKED`) - * @param ref_value reference value to compare the subject's value with - * @return pointer to the created observer - */ -lv_observer_t * lv_obj_bind_state_if_eq(lv_obj_t * obj, lv_subject_t * subject, lv_state_t state, int32_t ref_value); - -/** - * Set an object state if an integer subject's value is not equal to a reference value, clear the flag otherwise - * @param obj pointer to an object - * @param subject pointer to a subject - * @param state state to set or clear (e.g. `LV_STATE_CHECKED`) - * @param ref_value reference value to compare the subject's value with - * @return pointer to the created observer - */ -lv_observer_t * lv_obj_bind_state_if_not_eq(lv_obj_t * obj, lv_subject_t * subject, lv_state_t state, - int32_t ref_value); - -/** - * Set an integer subject to 1 when an object is checked and set it 0 when unchecked. - * @param obj pointer to an object - * @param subject pointer to a subject - * @return pointer to the created observer - * @note Ensure the object's `LV_OBJ_FLAG_CHECKABLE` flag is set - */ -lv_observer_t * lv_obj_bind_checked(lv_obj_t * obj, lv_subject_t * subject); - -#if LV_USE_LABEL -/** - * Bind an integer, string, or pointer subject to a label. - * @param obj pointer to a label - * @param subject pointer to a subject - * @param fmt optional format string with 1 format specifier (e.g. "%d °C") - * or NULL to bind the value directly. - * @return pointer to the created observer - * @note fmt == NULL can be used only with string and pointer subjects. - * @note if the subject is a pointer must point to a `\0` terminated string. - */ -lv_observer_t * lv_label_bind_text(lv_obj_t * obj, lv_subject_t * subject, const char * fmt); -#endif - -#if LV_USE_ARC -/** - * Bind an integer subject to an arc's value - * @param obj pointer to an arc - * @param subject pointer to a subject - * @return pointer to the created observer - */ -lv_observer_t * lv_arc_bind_value(lv_obj_t * obj, lv_subject_t * subject); -#endif - -#if LV_USE_SLIDER -/** - * Bind an integer subject to a slider's value - * @param obj pointer to a slider - * @param subject pointer to a subject - * @return pointer to the created observer - */ -lv_observer_t * lv_slider_bind_value(lv_obj_t * obj, lv_subject_t * subject); -#endif - -#if LV_USE_ROLLER -/** - * Bind an integer subject to a roller's value - * @param obj pointer to a roller - * @param subject pointer to a subject - * @return pointer to the created observer - */ -lv_observer_t * lv_roller_bind_value(lv_obj_t * obj, lv_subject_t * subject); -#endif - -#if LV_USE_DROPDOWN -/** - * Bind an integer subject to a dropdown's value - * @param obj pointer to a drop down - * @param subject pointer to a subject - * @return pointer to the created observer - */ -lv_observer_t * lv_dropdown_bind_value(lv_obj_t * obj, lv_subject_t * subject); -#endif - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_OBSERVER*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OBSERVER_H*/ diff --git a/L3_Middlewares/LVGL/src/others/observer/lv_observer_private.h b/L3_Middlewares/LVGL/src/others/observer/lv_observer_private.h deleted file mode 100644 index 04a7992..0000000 --- a/L3_Middlewares/LVGL/src/others/observer/lv_observer_private.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file lv_observer_private.h - * - */ - -#ifndef LV_OBSERVER_PRIVATE_H -#define LV_OBSERVER_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_observer.h" - -#if LV_USE_OBSERVER - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * The observer object: a descriptor returned when subscribing LVGL widgets to subjects - */ -struct lv_observer_t { - lv_subject_t * subject; /**< The observed value */ - lv_observer_cb_t cb; /**< Callback that should be called when the value changes*/ - void * target; /**< A target for the observer, e.g. a widget or style*/ - void * user_data; /**< Additional parameter supplied when subscribing*/ - uint32_t auto_free_user_data : 1; /**< Automatically free user data when the observer is removed */ - uint32_t notified : 1; /**< Mark if this observer was already notified*/ - uint32_t for_obj : 1; /**< `target` is an `lv_obj_t *`*/ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_OBSERVER */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_OBSERVER_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/others/snapshot/lv_snapshot.c b/L3_Middlewares/LVGL/src/others/snapshot/lv_snapshot.c deleted file mode 100644 index f3f182b..0000000 --- a/L3_Middlewares/LVGL/src/others/snapshot/lv_snapshot.c +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @file lv_snapshot.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../draw/lv_draw_private.h" -#include "../../core/lv_obj_draw_private.h" -#include "lv_snapshot.h" -#if LV_USE_SNAPSHOT - -#include -#include "../../display/lv_display.h" -#include "../../core/lv_refr_private.h" -#include "../../display/lv_display_private.h" -#include "../../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Create a draw buffer for object to store the snapshot image. - */ -lv_draw_buf_t * lv_snapshot_create_draw_buf(lv_obj_t * obj, lv_color_format_t cf) -{ - lv_obj_update_layout(obj); - int32_t w = lv_obj_get_width(obj); - int32_t h = lv_obj_get_height(obj); - int32_t ext_size = lv_obj_get_ext_draw_size(obj); - w += ext_size * 2; - h += ext_size * 2; - if(w == 0 || h == 0) return NULL; - - return lv_draw_buf_create(w, h, cf, LV_STRIDE_AUTO); -} - -lv_result_t lv_snapshot_reshape_draw_buf(lv_obj_t * obj, lv_draw_buf_t * draw_buf) -{ - lv_obj_update_layout(obj); - int32_t w = lv_obj_get_width(obj); - int32_t h = lv_obj_get_height(obj); - int32_t ext_size = lv_obj_get_ext_draw_size(obj); - w += ext_size * 2; - h += ext_size * 2; - if(w == 0 || h == 0) return LV_RESULT_INVALID; - - draw_buf = lv_draw_buf_reshape(draw_buf, LV_COLOR_FORMAT_UNKNOWN, w, h, LV_STRIDE_AUTO); - return draw_buf == NULL ? LV_RESULT_INVALID : LV_RESULT_OK; -} - -lv_result_t lv_snapshot_take_to_draw_buf(lv_obj_t * obj, lv_color_format_t cf, lv_draw_buf_t * draw_buf) -{ - LV_ASSERT_NULL(obj); - LV_ASSERT_NULL(draw_buf); - lv_result_t res; - - switch(cf) { - case LV_COLOR_FORMAT_RGB565: - case LV_COLOR_FORMAT_RGB888: - case LV_COLOR_FORMAT_XRGB8888: - case LV_COLOR_FORMAT_ARGB8888: - case LV_COLOR_FORMAT_L8: - case LV_COLOR_FORMAT_I1: - break; - default: - LV_LOG_WARN("Not supported color format"); - return LV_RESULT_INVALID; - } - - res = lv_snapshot_reshape_draw_buf(obj, draw_buf); - if(res != LV_RESULT_OK) return res; - - /* clear draw buffer*/ - lv_draw_buf_clear(draw_buf, NULL); - - lv_area_t snapshot_area; - int32_t w = draw_buf->header.w; - int32_t h = draw_buf->header.h; - int32_t ext_size = lv_obj_get_ext_draw_size(obj); - lv_obj_get_coords(obj, &snapshot_area); - lv_area_increase(&snapshot_area, ext_size, ext_size); - - lv_layer_t layer; - lv_memzero(&layer, sizeof(layer)); - - layer.draw_buf = draw_buf; - layer.buf_area.x1 = snapshot_area.x1; - layer.buf_area.y1 = snapshot_area.y1; - layer.buf_area.x2 = snapshot_area.x1 + w - 1; - layer.buf_area.y2 = snapshot_area.y1 + h - 1; - layer.color_format = cf; - layer._clip_area = snapshot_area; - layer.phy_clip_area = snapshot_area; -#if LV_DRAW_TRANSFORM_USE_MATRIX - lv_matrix_identity(&layer.matrix); -#endif - - lv_display_t * disp_old = lv_refr_get_disp_refreshing(); - lv_display_t * disp_new = lv_obj_get_display(obj); - lv_layer_t * layer_old = disp_new->layer_head; - disp_new->layer_head = &layer; - - lv_refr_set_disp_refreshing(disp_new); - lv_obj_redraw(&layer, obj); - - while(layer.draw_task_head) { - lv_draw_dispatch_wait_for_request(); - lv_draw_dispatch(); - } - - disp_new->layer_head = layer_old; - lv_refr_set_disp_refreshing(disp_old); - - return LV_RESULT_OK; -} - -lv_draw_buf_t * lv_snapshot_take(lv_obj_t * obj, lv_color_format_t cf) -{ - LV_ASSERT_NULL(obj); - lv_draw_buf_t * draw_buf = lv_snapshot_create_draw_buf(obj, cf); - if(draw_buf == NULL) return NULL; - - if(lv_snapshot_take_to_draw_buf(obj, cf, draw_buf) != LV_RESULT_OK) { - lv_draw_buf_destroy(draw_buf); - return NULL; - } - - return draw_buf; -} - -void lv_snapshot_free(lv_image_dsc_t * dsc) -{ - LV_LOG_WARN("Deprecated API, use lv_draw_buf_destroy directly."); - lv_draw_buf_destroy((lv_draw_buf_t *)dsc); -} - -lv_result_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_color_format_t cf, lv_image_dsc_t * dsc, - void * buf, - uint32_t buf_size) -{ - lv_draw_buf_t draw_buf; - LV_LOG_WARN("Deprecated API, use lv_snapshot_take_to_draw_buf instead."); - lv_draw_buf_init(&draw_buf, 1, 1, cf, buf_size, buf, buf_size); - lv_result_t res = lv_snapshot_take_to_draw_buf(obj, cf, &draw_buf); - if(res == LV_RESULT_OK) { - lv_memcpy((void *)dsc, &draw_buf, sizeof(lv_image_dsc_t)); - } - return res; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_SNAPSHOT*/ diff --git a/L3_Middlewares/LVGL/src/others/snapshot/lv_snapshot.h b/L3_Middlewares/LVGL/src/others/snapshot/lv_snapshot.h deleted file mode 100644 index 90de106..0000000 --- a/L3_Middlewares/LVGL/src/others/snapshot/lv_snapshot.h +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @file lv_snapshot.h - * - */ - -#ifndef LV_SNAPSHOT_H -#define LV_SNAPSHOT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../core/lv_obj.h" - -#if LV_USE_SNAPSHOT - -#include -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Take snapshot for object with its children, create the draw buffer as needed. - * @param obj the object to generate snapshot. - * @param cf color format for generated image. - * @return a pointer to an draw buffer containing snapshot image, or NULL if failed. - */ -lv_draw_buf_t * lv_snapshot_take(lv_obj_t * obj, lv_color_format_t cf); - -/** - * Create a draw buffer to store the snapshot image for object. - * @param obj the object to generate snapshot. - * @param cf color format for generated image. - * @return a pointer to an draw buffer ready for taking snapshot, or NULL if failed. - */ -lv_draw_buf_t * lv_snapshot_create_draw_buf(lv_obj_t * obj, lv_color_format_t cf); - -/** - * Reshape the draw buffer to prepare for taking snapshot for obj. - * This is usually used to check if the existing draw buffer is enough for - * obj snapshot. If return LV_RESULT_INVALID, you should create a new one. - * @param draw_buf the draw buffer to reshape. - * @param obj the object to generate snapshot. - */ -lv_result_t lv_snapshot_reshape_draw_buf(lv_obj_t * obj, lv_draw_buf_t * draw_buf); - -/** - * Take snapshot for object with its children, save image info to provided buffer. - * @param obj the object to generate snapshot. - * @param cf color format for new snapshot image. - * It could differ with cf of `draw_buf` as long as the new cf will fit in. - * @param draw_buf the draw buffer to store the image result. It's reshaped automatically. - * @return LV_RESULT_OK on success, LV_RESULT_INVALID on error. - */ -lv_result_t lv_snapshot_take_to_draw_buf(lv_obj_t * obj, lv_color_format_t cf, lv_draw_buf_t * draw_buf); - -/** - * @deprecated Use `lv_draw_buf_destroy` instead. - * - * Free the snapshot image returned by @ref lv_snapshot_take - * @param dsc the image descriptor generated by lv_snapshot_take. - */ -void lv_snapshot_free(lv_image_dsc_t * dsc); - -/** - * Take snapshot for object with its children, save image info to provided buffer. - * @param obj the object to generate snapshot. - * @param cf color format for generated image. - * @param dsc image descriptor to store the image result. - * @param buf the buffer to store image data. It must meet align requirement. - * @param buf_size provided buffer size in bytes. - * @return LV_RESULT_OK on success, LV_RESULT_INVALID on error. - * @deprecated Use lv_snapshot_take_to_draw_buf instead. - */ -lv_result_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_color_format_t cf, lv_image_dsc_t * dsc, - void * buf, - uint32_t buf_size); - -/********************** - * MACROS - **********************/ -#endif /*LV_USE_SNAPSHOT*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif diff --git a/L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon.c b/L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon.c deleted file mode 100644 index 803ce8c..0000000 --- a/L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon.c +++ /dev/null @@ -1,335 +0,0 @@ -/** - * @file lv_sysmon.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "lv_sysmon_private.h" -#include "../../misc/lv_timer_private.h" - -#if LV_USE_SYSMON - -#include "../../core/lv_global.h" -#include "../../misc/lv_async.h" -#include "../../stdlib/lv_string.h" -#include "../../widgets/label/lv_label.h" -#include "../../display/lv_display_private.h" - -/********************* - * DEFINES - *********************/ -#ifndef LV_SYSMON_REFR_PERIOD_DEF - #define LV_SYSMON_REFR_PERIOD_DEF 300 /* ms */ -#endif - -#if LV_USE_MEM_MONITOR - #define sysmon_mem LV_GLOBAL_DEFAULT()->sysmon_mem -#endif - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -#if LV_USE_PERF_MONITOR - static void perf_update_timer_cb(lv_timer_t * t); - static void perf_observer_cb(lv_observer_t * observer, lv_subject_t * subject); - static void perf_monitor_disp_event_cb(lv_event_t * e); -#endif - -#if LV_USE_MEM_MONITOR - static void mem_update_timer_cb(lv_timer_t * t); - static void mem_observer_cb(lv_observer_t * observer, lv_subject_t * subject); -#endif - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_sysmon_builtin_init(void) -{ - -#if LV_USE_MEM_MONITOR - static lv_mem_monitor_t mem_info; - lv_subject_init_pointer(&sysmon_mem.subject, &mem_info); - sysmon_mem.timer = lv_timer_create(mem_update_timer_cb, LV_SYSMON_REFR_PERIOD_DEF, &mem_info); -#endif -} - -void lv_sysmon_builtin_deinit(void) -{ -#if LV_USE_MEM_MONITOR - lv_timer_delete(sysmon_mem.timer); -#endif -} - -lv_obj_t * lv_sysmon_create(lv_display_t * disp) -{ - LV_LOG_INFO("begin"); - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) { - LV_LOG_WARN("There is no default display"); - return NULL; - } - - lv_obj_t * label = lv_label_create(lv_display_get_layer_sys(disp)); - lv_obj_set_style_bg_opa(label, LV_OPA_50, 0); - lv_obj_set_style_bg_color(label, lv_color_black(), 0); - lv_obj_set_style_text_color(label, lv_color_white(), 0); - lv_obj_set_style_pad_all(label, 3, 0); - lv_label_set_text(label, "?"); - return label; -} - -#if LV_USE_PERF_MONITOR - -void lv_sysmon_show_performance(lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) { - LV_LOG_WARN("There is no default display"); - return; - } - - disp->perf_label = lv_sysmon_create(disp); - if(disp->perf_label == NULL) { - LV_LOG_WARN("Couldn't create sysmon"); - return; - } - - lv_subject_init_pointer(&disp->perf_sysmon_backend.subject, &disp->perf_sysmon_info); - lv_obj_align(disp->perf_label, LV_USE_PERF_MONITOR_POS, 0, 0); - lv_subject_add_observer_obj(&disp->perf_sysmon_backend.subject, perf_observer_cb, disp->perf_label, NULL); - disp->perf_sysmon_backend.timer = lv_timer_create(perf_update_timer_cb, LV_SYSMON_REFR_PERIOD_DEF, disp); - lv_display_add_event_cb(disp, perf_monitor_disp_event_cb, LV_EVENT_ALL, NULL); - -#if LV_USE_PERF_MONITOR_LOG_MODE - lv_obj_add_flag(disp->perf_label, LV_OBJ_FLAG_HIDDEN); -#else - lv_obj_remove_flag(disp->perf_label, LV_OBJ_FLAG_HIDDEN); -#endif -} - -void lv_sysmon_hide_performance(lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) { - LV_LOG_WARN("There is no default display"); - return; - } - - lv_obj_add_flag(disp->perf_label, LV_OBJ_FLAG_HIDDEN); -} - -#endif - -#if LV_USE_MEM_MONITOR - -void lv_sysmon_show_memory(lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) { - LV_LOG_WARN("There is no default display"); - return; - } - - disp->mem_label = lv_sysmon_create(disp); - if(disp->mem_label == NULL) { - LV_LOG_WARN("Couldn't create sysmon"); - return; - } - - lv_obj_align(disp->mem_label, LV_USE_MEM_MONITOR_POS, 0, 0); - lv_subject_add_observer_obj(&sysmon_mem.subject, mem_observer_cb, disp->mem_label, NULL); - - lv_obj_remove_flag(disp->mem_label, LV_OBJ_FLAG_HIDDEN); -} - -void lv_sysmon_hide_memory(lv_display_t * disp) -{ - if(disp == NULL) disp = lv_display_get_default(); - if(disp == NULL) { - LV_LOG_WARN("There is no default display"); - return; - } - - lv_obj_add_flag(disp->mem_label, LV_OBJ_FLAG_HIDDEN); -} - -#endif - -/********************** - * STATIC FUNCTIONS - **********************/ - -#if LV_USE_PERF_MONITOR - -static void perf_monitor_disp_event_cb(lv_event_t * e) -{ - lv_display_t * disp = lv_event_get_target(e); - lv_event_code_t code = lv_event_get_code(e); - lv_sysmon_perf_info_t * info = &disp->perf_sysmon_info; - - switch(code) { - case LV_EVENT_REFR_START: - info->measured.refr_interval_sum += lv_tick_elaps(info->measured.refr_start); - info->measured.refr_start = lv_tick_get(); - break; - case LV_EVENT_REFR_READY: - info->measured.refr_elaps_sum += lv_tick_elaps(info->measured.refr_start); - info->measured.refr_cnt++; - break; - case LV_EVENT_RENDER_START: - info->measured.render_in_progress = 1; - info->measured.render_start = lv_tick_get(); - break; - case LV_EVENT_RENDER_READY: - info->measured.render_in_progress = 0; - info->measured.render_elaps_sum += lv_tick_elaps(info->measured.render_start); - info->measured.render_cnt++; - break; - case LV_EVENT_FLUSH_START: - case LV_EVENT_FLUSH_WAIT_START: - if(info->measured.render_in_progress) { - info->measured.flush_in_render_start = lv_tick_get(); - } - else { - info->measured.flush_not_in_render_start = lv_tick_get(); - } - break; - case LV_EVENT_FLUSH_FINISH: - case LV_EVENT_FLUSH_WAIT_FINISH: - if(info->measured.render_in_progress) { - info->measured.flush_in_render_elaps_sum += lv_tick_elaps(info->measured.flush_in_render_start); - } - else { - info->measured.flush_not_in_render_elaps_sum += lv_tick_elaps(info->measured.flush_not_in_render_start); - } - break; - case LV_EVENT_DELETE: - lv_timer_delete(disp->perf_sysmon_backend.timer); - lv_subject_deinit(&disp->perf_sysmon_backend.subject); - break; - default: - break; - } -} - -static void perf_update_timer_cb(lv_timer_t * t) -{ - lv_display_t * disp = lv_timer_get_user_data(t); - - uint32_t LV_SYSMON_GET_IDLE(void); - - lv_sysmon_perf_info_t * info = &disp->perf_sysmon_info; - info->calculated.run_cnt++; - - uint32_t time_since_last_report = lv_tick_elaps(info->measured.last_report_timestamp); - lv_timer_t * disp_refr_timer = lv_display_get_refr_timer(NULL); - uint32_t disp_refr_period = disp_refr_timer->period; - - info->calculated.fps = info->measured.refr_interval_sum ? (1000 * info->measured.refr_cnt / time_since_last_report) : 0; - info->calculated.fps = LV_MIN(info->calculated.fps, - 1000 / disp_refr_period); /*Limit due to possible off-by-one error*/ - - info->calculated.cpu = 100 - LV_SYSMON_GET_IDLE(); - info->calculated.refr_avg_time = info->measured.refr_cnt ? (info->measured.refr_elaps_sum / info->measured.refr_cnt) : - 0; - - info->calculated.flush_avg_time = info->measured.render_cnt ? - ((info->measured.flush_in_render_elaps_sum + info->measured.flush_not_in_render_elaps_sum) - / info->measured.render_cnt) : 0; - /*Flush time was measured in rendering time so subtract it*/ - info->calculated.render_avg_time = info->measured.render_cnt ? ((info->measured.render_elaps_sum - - info->measured.flush_in_render_elaps_sum) / - info->measured.render_cnt) : 0; - - info->calculated.cpu_avg_total = ((info->calculated.cpu_avg_total * (info->calculated.run_cnt - 1)) + - info->calculated.cpu) / info->calculated.run_cnt; - info->calculated.fps_avg_total = ((info->calculated.fps_avg_total * (info->calculated.run_cnt - 1)) + - info->calculated.fps) / info->calculated.run_cnt; - - lv_subject_set_pointer(&disp->perf_sysmon_backend.subject, info); - - lv_sysmon_perf_info_t prev_info = *info; - lv_memzero(info, sizeof(lv_sysmon_perf_info_t)); - info->measured.refr_start = prev_info.measured.refr_start; - info->calculated.cpu_avg_total = prev_info.calculated.cpu_avg_total; - info->calculated.fps_avg_total = prev_info.calculated.fps_avg_total; - info->calculated.run_cnt = prev_info.calculated.run_cnt; - - info->measured.last_report_timestamp = lv_tick_get(); -} - -static void perf_observer_cb(lv_observer_t * observer, lv_subject_t * subject) -{ - const lv_sysmon_perf_info_t * perf = lv_subject_get_pointer(subject); - -#if LV_USE_PERF_MONITOR_LOG_MODE - LV_UNUSED(observer); - LV_LOG("sysmon: " - "%" LV_PRIu32 " FPS (refr_cnt: %" LV_PRIu32 " | redraw_cnt: %" LV_PRIu32"), " - "refr %" LV_PRIu32 "ms (render %" LV_PRIu32 "ms | flush %" LV_PRIu32 "ms), " - "CPU %" LV_PRIu32 "%%\n", - perf->calculated.fps, perf->measured.refr_cnt, perf->measured.render_cnt, - perf->calculated.refr_avg_time, perf->calculated.render_avg_time, perf->calculated.flush_avg_time, - perf->calculated.cpu); -#else - lv_obj_t * label = lv_observer_get_target(observer); - lv_label_set_text_fmt( - label, - "%" LV_PRIu32" FPS, %" LV_PRIu32 "%% CPU\n" - "%" LV_PRIu32" ms (%" LV_PRIu32" | %" LV_PRIu32")", - perf->calculated.fps, perf->calculated.cpu, - perf->calculated.render_avg_time + perf->calculated.flush_avg_time, - perf->calculated.render_avg_time, perf->calculated.flush_avg_time - ); -#endif /*LV_USE_PERF_MONITOR_LOG_MODE*/ -} - -#endif - -#if LV_USE_MEM_MONITOR - -static void mem_update_timer_cb(lv_timer_t * t) -{ - lv_mem_monitor_t * mem_mon = lv_timer_get_user_data(t); - lv_mem_monitor(mem_mon); - lv_subject_set_pointer(&sysmon_mem.subject, mem_mon); -} - -static void mem_observer_cb(lv_observer_t * observer, lv_subject_t * subject) -{ - lv_obj_t * label = lv_observer_get_target(observer); - const lv_mem_monitor_t * mon = lv_subject_get_pointer(subject); - - size_t used_size = mon->total_size - mon->free_size;; - size_t used_kb = used_size / 1024; - size_t used_kb_tenth = (used_size - (used_kb * 1024)) / 102; - size_t max_used_kb = mon->max_used / 1024; - size_t max_used_kb_tenth = (mon->max_used - (max_used_kb * 1024)) / 102; - lv_label_set_text_fmt(label, - "%zu.%zu kB (%d%%)\n" - "%zu.%zu kB max, %d%% frag.", - used_kb, used_kb_tenth, mon->used_pct, - max_used_kb, max_used_kb_tenth, - mon->frag_pct); -} - -#endif - -#endif /*LV_USE_SYSMON*/ diff --git a/L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon.h b/L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon.h deleted file mode 100644 index 0859c06..0000000 --- a/L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @file lv_sysmon.h - * - */ - -#ifndef LV_SYSMON_H -#define LV_SYSMON_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../misc/lv_timer.h" -#include "../../others/observer/lv_observer.h" - -#if LV_USE_SYSMON - -#if LV_USE_LABEL == 0 -#error "lv_sysmon: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) " -#endif - -#if LV_USE_OBSERVER == 0 -#error "lv_observer: lv_observer is required. Enable it in lv_conf.h (LV_USE_OBSERVER 1) " -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a new system monitor label - * @param disp create the sys. mon. on this display's system layer - * @return the create label - */ -lv_obj_t * lv_sysmon_create(lv_display_t * disp); - -#if LV_USE_PERF_MONITOR - -/** - * Show system performance monitor: CPU usage and FPS count - * @param disp target display, NULL: use the default displays - */ -void lv_sysmon_show_performance(lv_display_t * disp); - -/** - * Hide system performance monitor - * @param disp target display, NULL: use the default - */ -void lv_sysmon_hide_performance(lv_display_t * disp); - -#endif /*LV_USE_PERF_MONITOR*/ - -#if LV_USE_MEM_MONITOR - -/** - * Show system memory monitor: used memory and the memory fragmentation - * @param disp target display, NULL: use the default displays - */ -void lv_sysmon_show_memory(lv_display_t * disp); - -/** - * Hide system memory monitor - * @param disp target display, NULL: use the default displays - */ -void lv_sysmon_hide_memory(lv_display_t * disp); - -#endif /*LV_USE_MEM_MONITOR*/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_SYSMON*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_SYSMON_H*/ diff --git a/L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon_private.h b/L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon_private.h deleted file mode 100644 index 08d6156..0000000 --- a/L3_Middlewares/LVGL/src/others/sysmon/lv_sysmon_private.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @file lv_sysmon_private.h - * - */ - -#ifndef LV_SYSMON_PRIVATE_H -#define LV_SYSMON_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_sysmon.h" - -#if LV_USE_SYSMON - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_sysmon_backend_data_t { - lv_subject_t subject; - lv_timer_t * timer; -}; - -#if LV_USE_PERF_MONITOR -struct lv_sysmon_perf_info_t { - struct { - bool inited; - uint32_t refr_start; - uint32_t refr_interval_sum; - uint32_t refr_elaps_sum; - uint32_t refr_cnt; - uint32_t render_start; - uint32_t render_elaps_sum; /*Contains the flush time too*/ - uint32_t render_cnt; - uint32_t flush_in_render_start; - uint32_t flush_in_render_elaps_sum; - uint32_t flush_not_in_render_start; - uint32_t flush_not_in_render_elaps_sum; - uint32_t last_report_timestamp; - uint32_t render_in_progress : 1; - } measured; - - struct { - uint32_t fps; - uint32_t cpu; - uint32_t refr_avg_time; - uint32_t render_avg_time; /**< Pure rendering time without flush time*/ - uint32_t flush_avg_time; /**< Pure flushing time without rendering time*/ - uint32_t cpu_avg_total; - uint32_t fps_avg_total; - uint32_t run_cnt; - } calculated; - -}; -#endif - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize built-in system monitor, such as performance and memory monitor. - */ -void lv_sysmon_builtin_init(void); - -/** - * DeInitialize built-in system monitor, such as performance and memory monitor. - */ -void lv_sysmon_builtin_deinit(void); - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_SYSMON */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_SYSMON_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite.h b/L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite.h deleted file mode 100644 index abbd6e8..0000000 --- a/L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite.h +++ /dev/null @@ -1,1387 +0,0 @@ -/**************************************************************************** -* -* Copyright 2012 - 2023 Vivante Corporation, Santa Clara, California. -* All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* 'Software'), to deal in the Software without restriction, including -* without limitation the rights to use, copy, modify, merge, publish, -* distribute, sub license, and/or sell copies of the Software, and to -* permit persons to whom the Software is furnished to do so, subject -* to the following conditions: -* -* The above copyright notice and this permission notice (including the -* next paragraph) shall be included in all copies or substantial -* portions of the Software. -* -* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -* IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -* -*****************************************************************************/ - -#ifndef _vg_lite_h_ -#define _vg_lite_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * causes MSVC error C1189. - * Not needed because "The __inline keyword is equivalent to inline." - * See: https://learn.microsoft.com/en-us/cpp/cpp/inline-functions-cpp?view=msvc-170 -*/ -/* -#if defined(_MSC_VER) -#define inline __inline -#endif -*/ - -#include -#include - - -/* VGLite API Constants *******************************************************************************************************************/ - -#define VGLITE_HEADER_VERSION 7 - -#ifndef VGLITE_VERSION_3_0 -#define VGLITE_VERSION_3_0 1 - -#define VGLITE_MAKE_VERSION(major, minor, patch) (((major) << 16) | ((minor) << 8) | (patch)) -#define VGLITE_VERSION_MAJOR(version) (((uint32_t)(version) >> 16) & 0xff) -#define VGLITE_VERSION_MINOR(version) (((uint32_t)(version) >> 8) & 0xff) -#define VGLITE_VERSION_PATCH(version) ((uint32_t)(version) & 0xff) - -#define VGLITE_API_VERSION_3_0 VGLITE_MAKE_VERSION(3, 0, 0) - -#define VGLITE_RELEASE_VERSION VGLITE_MAKE_VERSION(4,0,47) - -#define VGL_FALSE 0 -#define VGL_TRUE 1 - -/* Path command (op code). */ -#define VLC_OP_END 0x00 -#define VLC_OP_CLOSE 0x01 -#define VLC_OP_MOVE 0x02 -#define VLC_OP_MOVE_REL 0x03 -#define VLC_OP_LINE 0x04 -#define VLC_OP_LINE_REL 0x05 -#define VLC_OP_QUAD 0x06 -#define VLC_OP_QUAD_REL 0x07 -#define VLC_OP_CUBIC 0x08 -#define VLC_OP_CUBIC_REL 0x09 -#define VLC_OP_BREAK 0x0A -#define VLC_OP_HLINE 0x0B -#define VLC_OP_HLINE_REL 0x0C -#define VLC_OP_VLINE 0x0D -#define VLC_OP_VLINE_REL 0x0E -#define VLC_OP_SQUAD 0x0F -#define VLC_OP_SQUAD_REL 0x10 -#define VLC_OP_SCUBIC 0x11 -#define VLC_OP_SCUBIC_REL 0x12 -#define VLC_OP_SCCWARC 0x13 -#define VLC_OP_SCCWARC_REL 0x14 -#define VLC_OP_SCWARC 0x15 -#define VLC_OP_SCWARC_REL 0x16 -#define VLC_OP_LCCWARC 0x17 -#define VLC_OP_LCCWARC_REL 0x18 -#define VLC_OP_LCWARC 0x19 -#define VLC_OP_LCWARC_REL 0x1A - -/* Macros for path manipulating: See path definitions. */ -#define VLM_PATH_ENABLE_UPLOAD(path) (path).uploaded.property |= 1 -#define VLM_PATH_DISABLE_UPLOAD(path) (path).uploaded.property &= (~1) -#define VLM_PATH_GET_UPLOAD_BIT(path) ((path).uploaded.property & 1) - -/* Gradient constants. */ -#define VLC_MAX_COLOR_RAMP_STOPS 256 /*! The max number of radial gradient stops. */ -#define VLC_MAX_GRADIENT_STOPS 16 /*! The max number of gradient stops. */ -#define VLC_GRADIENT_BUFFER_WIDTH 1024 /*! The internal gradient buffer width.*/ - - -/* API name defines for backward compatibility to VGLite 2.0 APIs */ -#define vg_lite_buffer_upload vg_lite_upload_buffer -#define vg_lite_path_append vg_lite_append_path -#define vg_lite_path_calc_length vg_lite_get_path_length -#define vg_lite_set_ts_buffer vg_lite_set_tess_buffer -#define vg_lite_set_draw_path_type vg_lite_set_path_type -#define vg_lite_create_mask_layer vg_lite_create_masklayer -#define vg_lite_fill_mask_layer vg_lite_fill_masklayer -#define vg_lite_blend_mask_layer vg_lite_blend_masklayer -#define vg_lite_generate_mask_layer_by_path vg_lite_render_masklayer -#define vg_lite_set_mask_layer vg_lite_set_masklayer -#define vg_lite_destroy_mask_layer vg_lite_destroy_masklayer -#define vg_lite_enable_mask vg_lite_enable_masklayer -#define vg_lite_enable_color_transformation vg_lite_enable_color_transform -#define vg_lite_set_color_transformation vg_lite_set_color_transform -#define vg_lite_set_image_global_alpha vg_lite_source_global_alpha -#define vg_lite_set_dest_global_alpha vg_lite_dest_global_alpha -#define vg_lite_clear_rad_grad vg_lite_clear_radial_grad -#define vg_lite_update_rad_grad vg_lite_update_radial_grad -#define vg_lite_get_rad_grad_matrix vg_lite_get_radial_grad_matrix -#define vg_lite_set_rad_grad vg_lite_set_radial_grad -#define vg_lite_draw_linear_gradient vg_lite_draw_linear_grad -#define vg_lite_draw_radial_gradient vg_lite_draw_radial_grad -#define vg_lite_draw_gradient vg_lite_draw_grad -#define vg_lite_mem_avail vg_lite_get_mem_size -#define vg_lite_set_update_stroke vg_lite_update_stroke - -#define vg_lite_buffer_image_mode_t vg_lite_image_mode_t -#define vg_lite_draw_path_type_t vg_lite_path_type_t -#define vg_lite_linear_gradient_ext_t vg_lite_ext_linear_gradient_t -#define vg_lite_buffer_transparency_mode_t vg_lite_transparency_t - - -/* VGLite API Types ***********************************************************************************************************************/ - -typedef unsigned char vg_lite_uint8_t; -typedef char vg_lite_int8_t; -typedef short vg_lite_int16_t; -typedef unsigned short vg_lite_uint16_t; -typedef int vg_lite_int32_t; -typedef unsigned int vg_lite_uint32_t; -typedef unsigned long long vg_lite_uint64_t; -typedef float vg_lite_float_t; -typedef double vg_lite_double_t; -typedef char vg_lite_char; -typedef char* vg_lite_string; -typedef void* vg_lite_pointer; -typedef void vg_lite_void; -typedef unsigned int vg_lite_color_t; - - -/* VGLite API Enumerations ****************************************************************************************************************/ - -#ifndef VG_LITE_ERROR -#define VG_LITE_ERROR 1 - - /* Error codes that the vg_lite functions can return. */ - typedef enum vg_lite_error - { - VG_LITE_SUCCESS = 0, /*! Success. */ - VG_LITE_INVALID_ARGUMENT, /*! An invalid argument was specified. */ - VG_LITE_OUT_OF_MEMORY, /*! Out of memory. */ - VG_LITE_NO_CONTEXT, /*! No context or an unintialized context specified. */ - VG_LITE_TIMEOUT, /*! A timeout has occurred during a wait. */ - VG_LITE_OUT_OF_RESOURCES, /*! Out of system resources. */ - VG_LITE_GENERIC_IO, /*! Cannot communicate with the kernel driver. */ - VG_LITE_NOT_SUPPORT, /*! Function call not supported. */ - VG_LITE_ALREADY_EXISTS, /*! Object already exists */ - VG_LITE_NOT_ALIGNED, /*! Data alignment error */ - VG_LITE_FLEXA_TIME_OUT, /*! VG timeout requesting for segment buffer */ - VG_LITE_FLEXA_HANDSHAKE_FAIL, /*! VG and SBI synchronizer handshake failed */ - } vg_lite_error_t; -#endif - - /* Chip features bit */ - typedef enum vg_lite_feature - { - gcFEATURE_BIT_VG_IM_INDEX_FORMAT, - gcFEATURE_BIT_VG_SCISSOR, - gcFEATURE_BIT_VG_BORDER_CULLING, - gcFEATURE_BIT_VG_RGBA2_FORMAT, - gcFEATURE_BIT_VG_QUALITY_8X, - gcFEATURE_BIT_VG_IM_FASTCLAER, - gcFEATURE_BIT_VG_RADIAL_GRADIENT, - gcFEATURE_BIT_VG_GLOBAL_ALPHA, - gcFEATURE_BIT_VG_RGBA8_ETC2_EAC, - gcFEATURE_BIT_VG_COLOR_KEY, - gcFEATURE_BIT_VG_DOUBLE_IMAGE, - gcFEATURE_BIT_VG_YUV_OUTPUT, - gcFEATURE_BIT_VG_FLEXA, - gcFEATURE_BIT_VG_24BIT, - gcFEATURE_BIT_VG_DITHER, - gcFEATURE_BIT_VG_USE_DST, - gcFEATURE_BIT_VG_PE_CLEAR, - gcFEATURE_BIT_VG_IM_INPUT, - gcFEATURE_BIT_VG_DEC_COMPRESS, - gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT, - gcFEATURE_BIT_VG_MASK, - gcFEATURE_BIT_VG_MIRROR, - gcFEATURE_BIT_VG_GAMMA, - gcFEATURE_BIT_VG_NEW_BLEND_MODE, - gcFEATURE_BIT_VG_STENCIL, - gcFEATURE_BIT_VG_SRC_PREMULTIPLIED, /*! Valid only if gcFEATURE_BIT_VG_HW_PREMULTIPLY is 0 */ - gcFEATURE_BIT_VG_HW_PREMULTIPLY, /*! HW multiplier can accept either premultiplied or not */ - gcFEATURE_BIT_VG_COLOR_TRANSFORMATION, - gcFEATURE_BIT_VG_LVGL_SUPPORT, - gcFEATURE_BIT_VG_INDEX_ENDIAN, - gcFEATURE_BIT_VG_24BIT_PLANAR, - gcFEATURE_BIT_VG_PIXEL_MATRIX, - gcFEATURE_BIT_VG_NEW_IMAGE_INDEX, - gcFEATURE_BIT_VG_PARALLEL_PATHS, - gcFEATURE_BIT_VG_STRIPE_MODE, - gcFEATURE_BIT_VG_IM_DEC_INPUT, - gcFEATURE_BIT_VG_GAUSSIAN_BLUR, - gcFEATURE_BIT_VG_RECTANGLE_TILED_OUT, - gcFEATURE_BIT_VG_TESSELLATION_TILED_OUT, - gcFEATURE_BIT_VG_IM_REPEAT_REFLECT, - gcFEATURE_BIT_VG_YUY2_INPUT, - gcFEATURE_BIT_VG_YUV_INPUT, - gcFEATURE_BIT_VG_YUV_TILED_INPUT, - gcFEATURE_BIT_VG_AYUV_INPUT, - gcFEATURE_BIT_VG_16PIXELS_ALIGN, - gcFEATURE_BIT_VG_DEC_COMPRESS_2_0, - gcFEATURE_COUNT - } vg_lite_feature_t; - - /* Rendering quality enums. */ - typedef enum vg_lite_quality - { - VG_LITE_HIGH, /*! High quality 16x anti-aliasing path. */ - VG_LITE_UPPER, /*! Upper quality 8x anti-aliasing path. */ - VG_LITE_MEDIUM, /*! Medium quality 4x anti-aliasing path. */ - VG_LITE_LOW, /*! Low quality path without any anti-aliasing. */ - } vg_lite_quality_t; - - /* Format of path coordinates. */ - typedef enum vg_lite_format - { - VG_LITE_S8, /*! Signed 8-bit coordinates. */ - VG_LITE_S16, /*! Signed 16-bit coordinates. */ - VG_LITE_S32, /*! Signed 32-bit coordinates. */ - VG_LITE_FP32, /*! 32-bit floating point coordinates. */ - } vg_lite_format_t; - - /* Format of pixel buffer. */ - typedef enum vg_lite_buffer_format - { - /* OpenVG VGImageFormat enums: - * Note: The bits for each color channel are stored within a machine word - * from MSB to LSB in the order indicated by the pixel format name. - * This is opposite of VG_LITE_* formats (from LSB to MSB). - */ - - /* RGB{A,X} channel ordering */ - VG_sRGBX_8888 = 0, - VG_sRGBA_8888 = 1, - VG_sRGBA_8888_PRE = 2, - VG_sRGB_565 = 3, - VG_sRGBA_5551 = 4, - VG_sRGBA_4444 = 5, - VG_sL_8 = 6, - VG_lRGBX_8888 = 7, - VG_lRGBA_8888 = 8, - VG_lRGBA_8888_PRE = 9, - VG_lL_8 = 10, - VG_A_8 = 11, - VG_BW_1 = 12, - VG_A_1 = 13, - VG_A_4 = 14, - - VG_sRGBX_8888_PRE = 15, - VG_sRGB_565_PRE = 16, - VG_sRGBA_5551_PRE = 17, - VG_sRGBA_4444_PRE = 18, - VG_lRGBX_8888_PRE = 19, - VG_lRGB_565 = 20, - VG_lRGB_565_PRE = 21, - VG_lRGBA_5551 = 22, - VG_lRGBA_5551_PRE = 23, - VG_lRGBA_4444 = 24, - VG_lRGBA_4444_PRE = 25, - - /* {A,X}RGB channel ordering */ - VG_sXRGB_8888 = 0 | (1 << 6), - VG_sARGB_8888 = 1 | (1 << 6), - VG_sARGB_8888_PRE = 2 | (1 << 6), - VG_sARGB_1555 = 4 | (1 << 6), - VG_sARGB_4444 = 5 | (1 << 6), - VG_lXRGB_8888 = 7 | (1 << 6), - VG_lARGB_8888 = 8 | (1 << 6), - VG_lARGB_8888_PRE = 9 | (1 << 6), - - /* BGR{A,X} channel ordering */ - VG_sBGRX_8888 = 0 | (1 << 7), - VG_sBGRA_8888 = 1 | (1 << 7), - VG_sBGRA_8888_PRE = 2 | (1 << 7), - VG_sBGR_565 = 3 | (1 << 7), - VG_sBGRA_5551 = 4 | (1 << 7), - VG_sBGRA_4444 = 5 | (1 << 7), - VG_lBGRX_8888 = 7 | (1 << 7), - VG_lBGRA_8888 = 8 | (1 << 7), - VG_lBGRA_8888_PRE = 9 | (1 << 7), - - /* {A,X}BGR channel ordering */ - VG_sXBGR_8888 = 0 | (1 << 6) | (1 << 7), - VG_sABGR_8888 = 1 | (1 << 6) | (1 << 7), - VG_sABGR_8888_PRE = 2 | (1 << 6) | (1 << 7), - VG_sABGR_1555 = 4 | (1 << 6) | (1 << 7), - VG_sABGR_4444 = 5 | (1 << 6) | (1 << 7), - VG_lXBGR_8888 = 7 | (1 << 6) | (1 << 7), - VG_lABGR_8888 = 8 | (1 << 6) | (1 << 7), - VG_lABGR_8888_PRE = 9 | (1 << 6) | (1 << 7), - - /* Original VGLite API image format enums: - * Note: The bits for each color channel are stored within a machine word - * from LSB to MSB in the order indicated by the pixel format name. - * This is opposite of OPENVG VG_* formats (from MSB to LSB). - */ - VG_LITE_RGBA8888 = 0 | (1 << 10), - VG_LITE_BGRA8888 = 1 | (1 << 10), - VG_LITE_RGBX8888 = 2 | (1 << 10), - VG_LITE_BGRX8888 = 3 | (1 << 10), - VG_LITE_RGB565 = 4 | (1 << 10), - VG_LITE_BGR565 = 5 | (1 << 10), - VG_LITE_RGBA4444 = 6 | (1 << 10), - VG_LITE_BGRA4444 = 7 | (1 << 10), - VG_LITE_BGRA5551 = 8 | (1 << 10), - VG_LITE_A4 = 9 | (1 << 10), - VG_LITE_A8 = 10 | (1 << 10), - VG_LITE_L8 = 11 | (1 << 10), - VG_LITE_YUYV = 12 | (1 << 10), - VG_LITE_YUY2 = 13 | (1 << 10), - VG_LITE_ANV12 = 14 | (1 << 10), - VG_LITE_AYUY2 = 15 | (1 << 10), - VG_LITE_NV12 = 16 | (1 << 10), - VG_LITE_YV12 = 17 | (1 << 10), - VG_LITE_YV24 = 18 | (1 << 10), - VG_LITE_YV16 = 19 | (1 << 10), - VG_LITE_NV16 = 20 | (1 << 10), - VG_LITE_YUY2_TILED = 21 | (1 << 10), - VG_LITE_NV12_TILED = 22 | (1 << 10), - VG_LITE_ANV12_TILED = 23 | (1 << 10), - VG_LITE_AYUY2_TILED = 24 | (1 << 10), - VG_LITE_RGBA2222 = 25 | (1 << 10), - VG_LITE_BGRA2222 = 26 | (1 << 10), - VG_LITE_ABGR2222 = 27 | (1 << 10), - VG_LITE_ARGB2222 = 28 | (1 << 10), - VG_LITE_ABGR4444 = 29 | (1 << 10), - VG_LITE_ARGB4444 = 30 | (1 << 10), - VG_LITE_ABGR8888 = 31 | (1 << 10), - VG_LITE_ARGB8888 = 32 | (1 << 10), - VG_LITE_ABGR1555 = 33 | (1 << 10), - VG_LITE_RGBA5551 = 34 | (1 << 10), - VG_LITE_ARGB1555 = 35 | (1 << 10), - VG_LITE_XBGR8888 = 36 | (1 << 10), - VG_LITE_XRGB8888 = 37 | (1 << 10), - VG_LITE_RGBA8888_ETC2_EAC = 38 | (1 << 10), - VG_LITE_RGB888 = 39 | (1 << 10), - VG_LITE_BGR888 = 40 | (1 << 10), - VG_LITE_ABGR8565 = 41 | (1 << 10), - VG_LITE_BGRA5658 = 42 | (1 << 10), - VG_LITE_ARGB8565 = 43 | (1 << 10), - VG_LITE_RGBA5658 = 44 | (1 << 10), - VG_LITE_ABGR8565_PLANAR = 45 | (1 << 10), - VG_LITE_BGRA5658_PLANAR = 46 | (1 << 10), - VG_LITE_ARGB8565_PLANAR = 47 | (1 << 10), - VG_LITE_RGBA5658_PLANAR = 48 | (1 << 10), - - VG_LITE_INDEX_1 = 0 | (1 << 11), /*! Indexed format. */ - VG_LITE_INDEX_2 = 1 | (1 << 11), - VG_LITE_INDEX_4 = 2 | (1 << 11), - VG_LITE_INDEX_8 = 3 | (1 << 11), - - } vg_lite_buffer_format_t; - - /* Swizzle of packed YUV format UV channels. */ - typedef enum vg_lite_swizzle - { - VG_LITE_SWIZZLE_UV, - VG_LITE_SWIZZLE_VU, - } vg_lite_swizzle_t; - - /* The YUV<->RGB conversion rule. */ - typedef enum vg_lite_yuv2rgb - { - VG_LITE_YUV601, - VG_LITE_YUV709, - } vg_lite_yuv2rgb_t; - - /* The pixel layout in a buffer. */ - typedef enum vg_lite_buffer_layout - { - VG_LITE_LINEAR, - VG_LITE_TILED, - } vg_lite_buffer_layout_t; - - /* The image (buffer) rendering mode. Match OpenVG enum VGImageMode */ - typedef enum vg_lite_image_mode - { - /* For enum value backward compatibility */ - VG_LITE_ZERO = 0, - VG_LITE_NORMAL_IMAGE_MODE = 0x1F00, - VG_LITE_MULTIPLY_IMAGE_MODE = 0x1F01, - VG_LITE_STENCIL_MODE = 0x1F02, - VG_LITE_NONE_IMAGE_MODE = 0x1F03, - VG_LITE_RECOLOR_MODE = 0x1F04, - } vg_lite_image_mode_t; - - /* The image (buffer) transparency mode. */ - typedef enum vg_lite_transparency - { - VG_LITE_IMAGE_OPAQUE, - VG_LITE_IMAGE_TRANSPARENT - } vg_lite_transparency_t; - - /* Blending modes. VG_BLEND_* match OpenVG enum VGBlendMode. - * S and D represent source and destination color channels. - * Sa and Da represent the source and destination alpha channels. - */ - typedef enum vg_lite_blend - { - VG_LITE_BLEND_NONE = 0, /*! S, No blend, Non-premultiplied */ - VG_LITE_BLEND_SRC_OVER = 1, /*! S + (1 - Sa) * D , Non-premultiplied */ - VG_LITE_BLEND_DST_OVER = 2, /*! (1 - Da) * S + D , Non-premultiplied */ - VG_LITE_BLEND_SRC_IN = 3, /*! Da * S , Non-premultiplied */ - VG_LITE_BLEND_DST_IN = 4, /*! Sa * D , Non-premultiplied */ - VG_LITE_BLEND_MULTIPLY = 5, /*! S * (1 - Da) + D * (1 - Sa) + S * D , Non-premultiplied */ - VG_LITE_BLEND_SCREEN = 6, /*! S + D - S * D , Non-premultiplied */ - VG_LITE_BLEND_DARKEN = 7, /*! min(SrcOver, DstOver) , Non-premultiplied */ - VG_LITE_BLEND_LIGHTEN = 8, /*! max(SrcOver, DstOver) , Non-premultiplied */ - VG_LITE_BLEND_ADDITIVE = 9, /*! S + D , Non-premultiplied */ - VG_LITE_BLEND_SUBTRACT = 10, /*! D * (1 - Sa) , Non-premultiplied */ - VG_LITE_BLEND_SUBTRACT_LVGL = 11, /*! D - S , Non-premultiplied */ - VG_LITE_BLEND_NORMAL_LVGL = 12, /*! S * Sa + (1 - Sa) * D , Non-premultiplied */ - VG_LITE_BLEND_ADDITIVE_LVGL = 13, /*! (S + D) * Sa + D * (1 - Sa) , Non-premultiplied */ - VG_LITE_BLEND_MULTIPLY_LVGL = 14, /*! (S * D) * Sa + D * (1 - Sa) , Non-premultiplied */ - VG_LITE_BLEND_PREMULTIPLY_SRC_OVER = 15, /*! S * Sa + (1 - Sa) * D , Non-premultiplied */ - - OPENVG_BLEND_SRC = 0x2000, /*! Copy SRC, no blend, Premultiplied */ - OPENVG_BLEND_SRC_OVER = 0x2001, /*! Porter-Duff SRC_OVER blend, Premultiplied */ - OPENVG_BLEND_DST_OVER = 0x2002, /*! Porter-Duff DST_OVER blend, Premultiplied */ - OPENVG_BLEND_SRC_IN = 0x2003, /*! Porter-Duff SRC_IN blend, Premultiplied */ - OPENVG_BLEND_DST_IN = 0x2004, /*! Porter-Duff DST_IN blend, Premultiplied */ - OPENVG_BLEND_MULTIPLY = 0x2005, /*! Porter-Duff MULTIPLY blend, Premultiplied */ - OPENVG_BLEND_SCREEN = 0x2006, /*! Porter-Duff SCREEN blend, Premultiplied */ - OPENVG_BLEND_DARKEN = 0x2007, /*! Porter-Duff DARKEN blend, Premultiplied */ - OPENVG_BLEND_LIGHTEN = 0x2008, /*! Porter-Duff LIGHTEN blend, Premultiplied */ - OPENVG_BLEND_ADDITIVE = 0x2009, /*! Porter-Duff ADDITIVE blend, Premultiplied */ - } vg_lite_blend_t; - - /* Fill rules. Match OpenVG enum VGFillRule */ - typedef enum vg_lite_fill - { - VG_LITE_FILL_EVEN_ODD = 0x1900, /*! A pixel is drawn it it crosses an odd number of path pixels. */ - VG_LITE_FILL_NON_ZERO = 0x1901, /*! A pixel is drawn if it crosses at least one path pixel. */ - } vg_lite_fill_t; - - /* Global alpha modes. */ - typedef enum vg_lite_global_alpha - { - VG_LITE_NORMAL = 0, /*! Use original src/dst alpha value. */ - VG_LITE_GLOBAL, /*! Use global src/dst alpha value to replace original src/dst alpha value. */ - VG_LITE_SCALED, /*! Multiply global src/dst alpha value and original src/dst alpha value. */ - } vg_lite_global_alpha_t; - - /* Filter modes. */ - typedef enum vg_lite_filter - { - VG_LITE_FILTER_POINT = 0, /*! Fetch the nearest image pixel. */ - VG_LITE_FILTER_LINEAR = 0x1000, /*! Used for linear paint. */ - VG_LITE_FILTER_BI_LINEAR = 0x2000, /*! Use a 2x2 box around the image pixel and perform an interpolation. */ - VG_LITE_FILTER_GAUSSIAN = 0x3000, /*! Perform 3x3 gaussian blur with the convolution for image pixel. */ - } vg_lite_filter_t; - - /* Pattern padding mode. Match OpenVG enum VGTilingMode. */ - typedef enum vg_lite_pattern_mode - { - VG_LITE_PATTERN_COLOR = 0x1D00, /*! Pixel outside the bounds of sourceimage should be taken as the color */ - VG_LITE_PATTERN_PAD = 0x1D01, /*! Pixel outside the bounds of sourceimage should be taken as having the same color as the closest edge pixel */ - VG_LITE_PATTERN_REPEAT = 0x1D02, /*! Pixel outside the bounds of sourceimage should be repeated indefinitely in all directions */ - VG_LITE_PATTERN_REFLECT = 0x1D03, /*! Pixel outside the bounds of sourceimage should be reflected indefinitely in all directions */ - } vg_lite_pattern_mode_t; - - /* Paint type. Match OpenVG enum VGPaintType. */ - typedef enum vg_lite_paint_type - { - /* For enum value backward compatibility */ - VG_LITE_PAINT_ZERO = 0, - VG_LITE_PAINT_COLOR = 0x1B00, - VG_LITE_PAINT_LINEAR_GRADIENT = 0x1B01, - VG_LITE_PAINT_RADIAL_GRADIENT = 0x1B02, - VG_LITE_PAINT_PATTERN = 0x1B03, - } vg_lite_paint_type_t; - - /* Radial gradient padding mode. Match OpenVG enum VGColorRampSpreadMode */ - typedef enum - { - VG_LITE_GRADIENT_SPREAD_FILL = 0, - VG_LITE_GRADIENT_SPREAD_PAD = 0x1C00, - VG_LITE_GRADIENT_SPREAD_REPEAT = 0x1C01, - VG_LITE_GRADIENT_SPREAD_REFLECT = 0x1C02, - } vg_lite_gradient_spreadmode_t; - - /* Decnano Compress mode. */ - typedef enum vg_lite_compress_mode - { - VG_LITE_DEC_DISABLE = 0, /*! disable compress */ - VG_LITE_DEC_NON_SAMPLE, /*! compress ratio is 1.6 if use ARGB8888, compress ratio is 2 if use XRGB8888 */ - VG_LITE_DEC_HSAMPLE, /*! compress ratio is 2 if use ARGB8888, compress ratio is 2.6 if use XRGB8888 */ - VG_LITE_DEC_HV_SAMPLE, /*! compress ratio is 2.6 if use ARGB8888, compress ratio is 4 if use XRGB8888 */ - } vg_lite_compress_mode_t; - - /* Draw path type. Match OpenVG enum VGPaintMode */ - typedef enum vg_lite_path_type - { - /* For enum value backward compatibility */ - VG_LITE_DRAW_ZERO = 0, - VG_LITE_DRAW_STROKE_PATH = (1<<0), - VG_LITE_DRAW_FILL_PATH = (1<<1), - VG_LITE_DRAW_FILL_STROKE_PATH = (1<<1 | 1<<0), - } vg_lite_path_type_t; - - /* End cap style. Match OpenVG enum VGCapStyle */ - typedef enum vg_lite_cap_style - { - VG_LITE_CAP_BUTT = 0x1700, - VG_LITE_CAP_ROUND = 0x1701, - VG_LITE_CAP_SQUARE = 0x1702, - } vg_lite_cap_style_t; - - /* Line join styles. Match OpenVG enum VGJoinStyle */ - typedef enum vg_lite_join_style - { - VG_LITE_JOIN_MITER = 0x1800, - VG_LITE_JOIN_ROUND = 0x1801, - VG_LITE_JOIN_BEVEL = 0x1802, - } vg_lite_join_style_t; - - /* Mask operation mode. Match OpenVG enum VGMaskOperation */ - typedef enum vg_lite_mask_operation - { - VG_LITE_CLEAR_MASK = 0x1500, /*! Set all dest mask values to 0 */ - VG_LITE_FILL_MASK = 0x1501, /*! Set all dest mask values to 1 */ - VG_LITE_SET_MASK = 0x1502, /*! Copy from src masklayer to dest masklayer. */ - VG_LITE_UNION_MASK = 0x1503, /*! Replace dest masklayer by its union with src masklayer. */ - VG_LITE_INTERSECT_MASK = 0x1504, /*! Replace dest masklayer by its intersection with src masklayer. */ - VG_LITE_SUBTRACT_MASK = 0x1505, /*! Subtract src mask in dest masklayer */ - } vg_lite_mask_operation_t; - - /* Mirror orientation mode. */ - typedef enum vg_lite_orientation - { - VG_LITE_ORIENTATION_TOP_BOTTOM, - VG_LITE_ORIENTATION_BOTTOM_TOP, - } vg_lite_orientation_t; - - /* Gamma conversion mode. */ - typedef enum vg_lite_gamma_conversion - { - VG_LITE_GAMMA_NO_CONVERSION, /*! Leave color as is. */ - VG_LITE_GAMMA_LINEAR, /*! Convert from sRGB to linear space. */ - VG_LITE_GAMMA_NON_LINEAR /*! Convert from linear to sRGB space. */ - } vg_lite_gamma_conversion_t; - - /* Index endian */ - typedef enum vg_lite_index_endian - { - VG_LITE_INDEX_LITTLE_ENDIAN, /*! Parse the index pixel from low to high, - *! when using index1, the parsing order is bit0~bit7. - *! when using index2, the parsing order is bit0:1,bit2:3,bit4:5.bit6:7. - *! when using index4, the parsing order is bit0:3,bit4:7. - */ - VG_LITE_INDEX_BIG_ENDIAN, /*! Parse the index pixel from low to high, - *! when using index1, the parsing order is bit7~bit0. - *! when using index2, the parsing order is bit7:6,bit5:4,bit3:2.bit1:0. - *! when using index4, the parsing order is bit4:7,bit0:3. - */ - } vg_lite_index_endian_t; - - /* Map flag*/ - typedef enum vg_lite_map_flag - { - VG_LITE_MAP_USER_MEMORY = 0, - VG_LITE_MAP_DMABUF = 0x01, - } vg_lite_map_flag_t; - - /*VGLite parameters variable*/ - typedef enum vg_lite_param_type - { - VG_LITE_SCISSOR_RECT, /*! count must be 4n for x, y, right, bottom */ - VG_LITE_GPU_IDLE_STATE, /*! 0: busy, 1: idle */ - } vg_lite_param_type_t; - -/* VGLite API Structures ******************************************************************************************************************/ - - /* VGLite driver information */ - typedef struct vg_lite_info { - vg_lite_uint32_t api_version; - vg_lite_uint32_t header_version; - vg_lite_uint32_t release_version; - vg_lite_uint32_t reserved; - } vg_lite_info_t; - - /* A 2D Point definition. */ - typedef struct vg_lite_point { - vg_lite_int32_t x; - vg_lite_int32_t y; - } vg_lite_point_t; - - /* Four 2D Point that form a polygon */ - typedef vg_lite_point_t vg_lite_point4_t[4]; - - /* A rectangle.*/ - typedef struct vg_lite_rectangle { - vg_lite_int32_t x; /*! Left coordinate of rectangle. */ - vg_lite_int32_t y; /*! Top coordinate of rectangle. */ - vg_lite_int32_t width; /*! Width of rectangle. */ - vg_lite_int32_t height; /*! Height of rectangle. */ - } vg_lite_rectangle_t; - - typedef struct vg_lite_matrix { - vg_lite_float_t m[3][3]; /*! The 3x3 matrix is in [row][column] order. */ - vg_lite_float_t scaleX; - vg_lite_float_t scaleY; - vg_lite_float_t angle; - } vg_lite_matrix_t; - - typedef struct vg_lite_yuvinfo - { - vg_lite_swizzle_t swizzle; /*! UV swizzle. */ - vg_lite_yuv2rgb_t yuv2rgb; /*! 601 or 709 conversion standard. */ - vg_lite_uint32_t uv_planar; /*! UV(U) planar address. */ - vg_lite_uint32_t v_planar; /*! V planar address. */ - vg_lite_uint32_t alpha_planar; /*! Alpha planar address. */ - vg_lite_uint32_t uv_stride; /*! UV(U) stride. */ - vg_lite_uint32_t v_stride; /*! V stride. */ - vg_lite_uint32_t alpha_stride; /*! Alpha stride. */ - vg_lite_uint32_t uv_height; /*! UV(U) height. */ - vg_lite_uint32_t v_height; /*! V height. */ - vg_lite_pointer uv_memory; /*! The logical pointer to the UV(U) planar memory. */ - vg_lite_pointer v_memory; /*! The logical pointer to the V planar memory. */ - vg_lite_pointer uv_handle; /*! The memory handle of the UV(U) planar. */ - vg_lite_pointer v_handle; /*! The memory handle of the V planar. */ - } vg_lite_yuvinfo_t; - - typedef struct vg_lite_path_point* vg_lite_path_point_ptr; - typedef struct vg_lite_path_point - { - /* X coordinate. */ - vg_lite_float_t x; - - /* Y coordinate. */ - vg_lite_float_t y; - - /* Flatten flag for flattened path. */ - vg_lite_uint8_t flatten_flag; - - /* Curve type for stroke path. */ - vg_lite_uint8_t curve_type; - - /* X tangent. */ - vg_lite_float_t tangentX; - - /* Y tangent. */ - vg_lite_float_t tangentY; - - /* Length of the line. */ - vg_lite_float_t length; - - /* Pointer to next point node. */ - vg_lite_path_point_ptr next; - - /* Pointer to previous point node. */ - vg_lite_path_point_ptr prev; - - } vg_lite_path_point_t; - - typedef struct vg_lite_sub_path* vg_lite_sub_path_ptr; - typedef struct vg_lite_sub_path - { - /* Pointer to next sub path. */ - vg_lite_sub_path_ptr next; - - /* Number of points. */ - vg_lite_uint32_t point_count; - - /* Point list. */ - vg_lite_path_point_ptr point_list; - - /* Last point. */ - vg_lite_path_point_ptr end_point; - - /* Whether is path is closed. */ - vg_lite_uint8_t closed; - - /* Sub path length. */ - vg_lite_float_t length; - - } vg_lite_sub_path_t; - - /* Save divided path data according to MOVE/MOVE_REL. */ - typedef struct vg_lite_path_list* vg_lite_path_list_ptr; - typedef struct vg_lite_path_list - { - vg_lite_path_point_ptr path_points; - vg_lite_path_point_ptr path_end; - vg_lite_uint32_t point_count; - vg_lite_path_list_ptr next; - vg_lite_uint8_t closed; - - } vg_lite_path_list_t; - - typedef struct vg_lite_stroke - { - /* Stroke parameters */ - vg_lite_cap_style_t cap_style; - vg_lite_join_style_t join_style; - vg_lite_float_t line_width; - vg_lite_float_t miter_limit; - vg_lite_float_t *dash_pattern; - vg_lite_uint32_t pattern_count; - vg_lite_float_t dash_phase; - vg_lite_float_t dash_length; - vg_lite_uint32_t dash_index; - vg_lite_float_t half_width; - - /* Total length of stroke dash patterns. */ - vg_lite_float_t pattern_length; - - /* For fast checking. */ - vg_lite_float_t miter_square; - - /* Temp storage of stroke subPath. */ - vg_lite_path_point_ptr path_points; - vg_lite_path_point_ptr path_end; - vg_lite_uint32_t point_count; - vg_lite_path_point_ptr left_point; - vg_lite_path_point_ptr right_point; - vg_lite_path_point_ptr stroke_points; - vg_lite_path_point_ptr stroke_end; - vg_lite_uint32_t stroke_count; - - /* Divide stroke path according to move or move_rel for avoiding implicit closure. */ - vg_lite_path_list_ptr path_list_divide; - - /* pointer to current divided path data. */ - vg_lite_path_list_ptr cur_list; - - /* Flag that add end_path in driver. */ - vg_lite_uint8_t add_end; - vg_lite_uint8_t dash_reset; - - /* Sub path list. */ - vg_lite_sub_path_ptr stroke_paths; - - /* Last sub path. */ - vg_lite_sub_path_ptr last_stroke; - - /* Swing area handling. */ - vg_lite_uint32_t swing_handling; - vg_lite_float_t swing_deltax; - vg_lite_float_t swing_deltay; - vg_lite_path_point_ptr swing_start; - vg_lite_path_point_ptr swing_stroke; - vg_lite_float_t swing_length; - vg_lite_float_t swing_centlen; - vg_lite_uint32_t swing_count; - vg_lite_uint8_t need_swing; - vg_lite_uint8_t swing_ccw; - - vg_lite_float_t stroke_length; - vg_lite_uint32_t stroke_size; - - /* The stroke line is fat line. */ - vg_lite_uint8_t fattened; - vg_lite_uint8_t closed; - - } vg_lite_stroke_t; - - /* Fast clear buffer. */ - typedef struct vg_lite_fc_buffer - { - vg_lite_int32_t width; /*! Width of the buffer in pixels. */ - vg_lite_int32_t height; /*! height of the buffer in pixels. */ - vg_lite_int32_t stride; /*! The number of bytes to move from one line in the buffer to the next line. */ - vg_lite_pointer handle; /*! The memory handle of the buffer's memory as allocated by the VGLite kernel. */ - vg_lite_pointer memory; /*! The logical pointer to the buffer's memory for the CPU. */ - vg_lite_uint32_t address; /*! The address to the buffer's memory for the hardware. */ - vg_lite_uint32_t color; /*! The fastclear color value. */ - } vg_lite_fc_buffer_t; - - /* Structure for any image or render target. */ - typedef struct vg_lite_buffer - { - vg_lite_int32_t width; /*! Width of the buffer in pixels. */ - vg_lite_int32_t height; /*! Height of the buffer in pixels. */ - vg_lite_int32_t stride; /*! The number of bytes to move from one line in the buffer to the next line. */ - vg_lite_buffer_layout_t tiled; /*! Indicating the buffer memory layout is linear or tiled. */ - vg_lite_buffer_format_t format; /*! The pixel format of the buffer. */ - vg_lite_pointer handle; /*! The memory handle of the buffer's memory as allocated by the VGLite kernel. */ - vg_lite_pointer memory; /*! The logical pointer to the buffer's memory for the CPU. */ - vg_lite_uint32_t address; /*! The address to the buffer's memory for the hardware. */ - vg_lite_yuvinfo_t yuv; /*! The yuv format details. */ - vg_lite_image_mode_t image_mode; /*! The blit image mode. */ - vg_lite_transparency_t transparency_mode; /*! image transparency mode. */ - vg_lite_fc_buffer_t fc_buffer[3]; /*! 3 fastclear buffers,reserved YUV format. */ - vg_lite_compress_mode_t compress_mode; /*! Refer to the definition by vg_lite_compress_mode_t. */ - vg_lite_index_endian_t index_endian; /*! Refer to the definition by vg_lite_index_endian_t. */ - vg_lite_paint_type_t paintType; /*! Get paintcolor from different paint types. */ - vg_lite_uint8_t fc_enable; /*! enable im fastclear. */ - vg_lite_uint8_t scissor_layer; /*! The buffer is scissor buffer. */ - vg_lite_uint8_t premultiplied; /*! The RGB pixel values are alpha-premultiplied */ - } vg_lite_buffer_t; - - /* Memory allocation info by kernel. */ - typedef struct vg_lite_hw_memory - { - vg_lite_pointer handle; /*! gpu memory object handle. */ - vg_lite_pointer memory; /*! logical memory address. */ - vg_lite_uint32_t address; /*! GPU memory address. */ - vg_lite_uint32_t bytes; /*! Size of memory. */ - vg_lite_uint32_t property; /*! Currently bit0 is used for path upload state: - *! 1 : enable auto path data uploading. - *! 0 : disable path data uploading. path data is embedded in command buffer. */ - } vg_lite_hw_memory_t; - - /* Path info for drawing command. */ - typedef struct vg_lite_path - { - vg_lite_float_t bounding_box[4]; /*! Bounding box specified as left, top, right, and bottom. */ - vg_lite_quality_t quality; /*! Quality hint for the path. */ - vg_lite_format_t format; /*! Coordinate format. */ - vg_lite_hw_memory_t uploaded; /*! Path data that has been upload into GPU addressable memory. */ - vg_lite_uint32_t path_length; /*! Number of bytes in the path data. */ - vg_lite_pointer path; /*! Pointer to the physical description of the path. */ - vg_lite_int8_t path_changed; /*! Indicate whether path data is synced with command buffer (uploaded) or not. */ - vg_lite_int8_t pdata_internal; /*! Indicate whether path data memory is allocated by driver. */ - vg_lite_path_type_t path_type; /*! Refer to the definition by vg_lite_path_type_t. */ - vg_lite_stroke_t *stroke; /*! Pointer to a vg_lite_stroke_t structure.*/ - vg_lite_pointer stroke_path; /*! Pointer to the physical description of the stroke path. */ - vg_lite_uint32_t stroke_size; /*! Number of bytes in the stroke path data. */ - vg_lite_color_t stroke_color; /*! The stroke path fill color. */ - vg_lite_int8_t add_end; /*! Flag that add end_path in driver. */ - } vg_lite_path_t; - - /* Color ramp definition. */ - typedef struct vg_lite_color_ramp - { - vg_lite_float_t stop; /*! Value for the color stop. */ - vg_lite_float_t red; /*! Red color channel value for the color stop. */ - vg_lite_float_t green; /*! Green color channel value for the color stop. */ - vg_lite_float_t blue; /*! Blue color channel value for the color stop. */ - vg_lite_float_t alpha; /*! Alpha color channel value for the color stop. */ - } vg_lite_color_ramp_t; - - /* Linear gradient parameter */ - typedef struct vg_lite_linear_gradient_parameter - { - vg_lite_float_t X0; - vg_lite_float_t Y0; - vg_lite_float_t X1; - vg_lite_float_t Y1; - } vg_lite_linear_gradient_parameter_t; - - typedef struct vg_lite_radial_gradient_parameter - { - vg_lite_float_t cx; /*! x coordinate of the center point. */ - vg_lite_float_t cy; /*! y coordinate of the center point. */ - vg_lite_float_t r; /*! radius. */ - vg_lite_float_t fx; /*! x coordinate of the focal point. */ - vg_lite_float_t fy; /*! y coordinate of the focal point. */ - } vg_lite_radial_gradient_parameter_t; - - /* Linear gradient definition. */ - typedef struct vg_lite_linear_gradient { - vg_lite_uint32_t colors[VLC_MAX_GRADIENT_STOPS]; /*! Colors for stops. */ - vg_lite_uint32_t count; /*! Count of colors, up to 16. */ - vg_lite_uint32_t stops[VLC_MAX_GRADIENT_STOPS]; /*! Color stops, value from 0 to 255. */ - vg_lite_matrix_t matrix; /*! The matrix to transform the gradient. */ - vg_lite_buffer_t image; /*! The image for rendering as gradient pattern. */ - } vg_lite_linear_gradient_t; - - /* Extended linear gradient definition. */ - typedef struct vg_lite_ext_linear_gradient { - vg_lite_uint32_t count; /*! Count of colors, up to 256. */ - vg_lite_matrix_t matrix; /*! The matrix to transform the gradient. */ - vg_lite_buffer_t image; /*! The image for rendering as gradient pattern. */ - vg_lite_linear_gradient_parameter_t linear_grad; /*! Include center point,focal point and radius.*/ - - vg_lite_uint32_t ramp_length; /*! Color ramp for gradient paints provided to driver. */ - vg_lite_color_ramp_t color_ramp[VLC_MAX_COLOR_RAMP_STOPS]; - - vg_lite_uint32_t converted_length; /*! Converted internal color ramp. */ - vg_lite_color_ramp_t converted_ramp[VLC_MAX_COLOR_RAMP_STOPS + 2]; - - vg_lite_uint8_t pre_multiplied; /*! If color values of color_ramp[] are multiply by alpha value of color_ramp[]. */ - vg_lite_gradient_spreadmode_t spread_mode; /*! The spread mode that applied to the pixels out of the image after transformed. */ - } vg_lite_ext_linear_gradient_t; - - /* Radial gradient definition. */ - typedef struct vg_lite_radial_gradient - { - vg_lite_uint32_t count; /*! Count of colors, up to 256. */ - vg_lite_matrix_t matrix; /*! The matrix to transform the gradient. */ - vg_lite_buffer_t image; /*! The image for rendering as gradient pattern. */ - vg_lite_radial_gradient_parameter_t radial_grad; /*! Include center point,focal point and radius.*/ - - vg_lite_uint32_t ramp_length; /*! Color ramp for gradient paints provided to the driver. */ - vg_lite_color_ramp_t color_ramp[VLC_MAX_COLOR_RAMP_STOPS]; - - vg_lite_uint32_t converted_length; /*! Converted internal color ramp. */ - vg_lite_color_ramp_t converted_ramp[VLC_MAX_COLOR_RAMP_STOPS + 2]; - - vg_lite_uint8_t pre_multiplied; /*! If color values of color_ramp[] are multiply by alpha value of color_ramp[]. */ - vg_lite_gradient_spreadmode_t spread_mode; /*! The spread mode that applied to the pixels out of the image after transformed. */ - } vg_lite_radial_gradient_t; - - /* Colorkey definition */ - typedef struct vg_lite_color_key - { - vg_lite_uint8_t enable; /*! The color key is effective only when "enable" is true, */ - vg_lite_uint8_t low_r; /*! The R channel of low_rgb. */ - vg_lite_uint8_t low_g; /*! The G channel of low_rgb. */ - vg_lite_uint8_t low_b; /*! The B channel of low_rgb. */ - vg_lite_uint8_t alpha; /*! The alpha channel to replace destination pixel alpha channel.*/ - vg_lite_uint8_t hign_r; /*! The R channel of hign_rgb. */ - vg_lite_uint8_t hign_g; /*! The G channel of hign_rgb. */ - vg_lite_uint8_t hign_b; /*! The B channel of hign_rgb. */ - } vg_lite_color_key_t; - - /* Four colorkey definition. - * rgb_hi_0, rgb_lo_0, alpha_0, enable_0; - * rgb_hi_1, rgb_lo_1, alpha_1, enable_1; - * rgb_hi_2, rgb_lo_2, alpha_2, enable_2; - * rgb_hi_3, rgb_lo_3, alpha_3, enable_3; - * Priority order: color_key_0 > color_key_1 > color_key_2 > color_key_3. - */ - typedef vg_lite_color_key_t vg_lite_color_key4_t[4]; - - /* Pixel matrix values */ - typedef vg_lite_float_t vg_lite_pixel_matrix_t[20]; - - /* HW pixel channel enable flags */ - typedef struct vg_lite_pixel_channel_enable - { - vg_lite_uint8_t enable_a; /*! Enable A channel.*/ - vg_lite_uint8_t enable_b; /*! Enable B channel. */ - vg_lite_uint8_t enable_g; /*! Enable G channel. */ - vg_lite_uint8_t enable_r; /*! Enable R channel. */ - } vg_lite_pixel_channel_enable_t; - - /* Pixel color transform */ - typedef struct vg_lite_color_transform - { - vg_lite_float_t a_scale; - vg_lite_float_t a_bias; - vg_lite_float_t r_scale; - vg_lite_float_t r_bias; - vg_lite_float_t g_scale; - vg_lite_float_t g_bias; - vg_lite_float_t b_scale; - vg_lite_float_t b_bias; - } vg_lite_color_transform_t; - -/* VGLite API Functions *******************************************************************************************************************/ - - /* Initialize a vglite context. */ - vg_lite_error_t vg_lite_init(vg_lite_int32_t tess_width, vg_lite_int32_t tess_height); - - /* Destroy a vglite context. */ - vg_lite_error_t vg_lite_close(void); - - /* Get the VGLite driver information. */ - vg_lite_error_t vg_lite_get_info(vg_lite_info_t* info); - - /* Get the GPU chip information. */ - vg_lite_uint32_t vg_lite_get_product_info(vg_lite_char *name, vg_lite_uint32_t *chip_id, vg_lite_uint32_t *chip_rev); - - /* Query if a specific feature is supported. */ - vg_lite_uint32_t vg_lite_query_feature(vg_lite_feature_t feature); - - /* Flush command buffer and wait for GPU to complete. */ - vg_lite_error_t vg_lite_finish(void); - - /* Flush the command buffer without waiting for GPU to complete. */ - vg_lite_error_t vg_lite_flush(void); - - /* Get the value of register from register's address. */ - vg_lite_error_t vg_lite_get_register(vg_lite_uint32_t address, vg_lite_uint32_t* result); - - /* Generate a 3x3 homogenous matrix to transform 4 source coordinates to 4 target coordinates. */ - vg_lite_error_t vg_lite_get_transform_matrix(vg_lite_point4_t src, vg_lite_point4_t dst, vg_lite_matrix_t *mat); - - /* Allocate a buffer from GPU hardware accessible memory. */ - vg_lite_error_t vg_lite_allocate(vg_lite_buffer_t *buffer); - - /* Free a buffer allocated by vg_lite_allocate() */ - vg_lite_error_t vg_lite_free(vg_lite_buffer_t *buffer); - - /* Upload RGB or YUV pixel data to an allocated buffer. */ - vg_lite_error_t vg_lite_upload_buffer(vg_lite_buffer_t *buffer, vg_lite_uint8_t *data[3], vg_lite_uint32_t stride[3]); - - /* Map a buffer into hardware accessible address space. */ - vg_lite_error_t vg_lite_map(vg_lite_buffer_t *buffer, vg_lite_map_flag_t flag, int32_t fd); - - /* Unmap a buffer that is mapped */ - vg_lite_error_t vg_lite_unmap(vg_lite_buffer_t *buffer); - - /* flush cache */ - vg_lite_error_t vg_lite_flush_mapped_buffer(vg_lite_buffer_t * buffer); - - /* Fill a buffer rectangle area with a specified color. */ - vg_lite_error_t vg_lite_clear(vg_lite_buffer_t *target, vg_lite_rectangle_t *rect, vg_lite_color_t color); - - /* Copy a source image to target buffer with transformation, blending, color mixing, and filtering. */ - vg_lite_error_t vg_lite_blit(vg_lite_buffer_t *target, - vg_lite_buffer_t *source, - vg_lite_matrix_t *matrix, - vg_lite_blend_t blend, - vg_lite_color_t color, - vg_lite_filter_t filter); - - /* Copy a rectangle area of source image to target buffer with transformation, blending, color mixing, and filtering. */ - vg_lite_error_t vg_lite_blit_rect(vg_lite_buffer_t *target, - vg_lite_buffer_t *source, - vg_lite_rectangle_t *rect, - vg_lite_matrix_t *matrix, - vg_lite_blend_t blend, - vg_lite_color_t color, - vg_lite_filter_t filter); - - /* Copy two source images to the target buffer with transformation, blending, and filtering. */ - vg_lite_error_t vg_lite_blit2(vg_lite_buffer_t *target, - vg_lite_buffer_t *source0, - vg_lite_buffer_t *source1, - vg_lite_matrix_t *matrix0, - vg_lite_matrix_t *matrix1, - vg_lite_blend_t blend, - vg_lite_filter_t filter); - - /* Copy a rectangle area of source image to target buffer without transformation, blending, color mixing, and filtering. */ - vg_lite_error_t vg_lite_copy_image(vg_lite_buffer_t *target, - vg_lite_buffer_t *source, - vg_lite_int32_t sx, - vg_lite_int32_t sy, - vg_lite_int32_t dx, - vg_lite_int32_t dy, - vg_lite_int32_t width, - vg_lite_int32_t height); - - /* Draw a path to a target buffer with transformation, color, and blending */ - vg_lite_error_t vg_lite_draw(vg_lite_buffer_t *target, - vg_lite_path_t *path, - vg_lite_fill_t fill_rule, - vg_lite_matrix_t *matrix, - vg_lite_blend_t blend, - vg_lite_color_t color); - - /* Set stroke path attributes. */ - vg_lite_error_t vg_lite_set_stroke(vg_lite_path_t *path, - vg_lite_cap_style_t cap_style, - vg_lite_join_style_t join_style, - vg_lite_float_t line_width, - vg_lite_float_t miter_limit, - vg_lite_float_t *dash_pattern, - vg_lite_uint32_t pattern_count, - vg_lite_float_t dash_phase, - vg_lite_color_t color); - - /* Update stroke path. */ - vg_lite_error_t vg_lite_update_stroke(vg_lite_path_t *path); - - /* Set path type. */ - vg_lite_error_t vg_lite_set_path_type(vg_lite_path_t *path, vg_lite_path_type_t path_type); - - /* Clears all attributes of a path. */ - vg_lite_error_t vg_lite_clear_path(vg_lite_path_t *path); - - /* Upload a path to GPU memory so GPU can access it directly. */ - vg_lite_error_t vg_lite_upload_path(vg_lite_path_t *path); - - /* Initialize a path object with attributes. */ - vg_lite_error_t vg_lite_init_path(vg_lite_path_t *path, - vg_lite_format_t format, - vg_lite_quality_t quality, - vg_lite_uint32_t length, - vg_lite_pointer data, - vg_lite_float_t min_x, - vg_lite_float_t min_y, - vg_lite_float_t max_x, - vg_lite_float_t max_y); - - /* Initializes a arc path with attributes. */ - vg_lite_error_t vg_lite_init_arc_path(vg_lite_path_t *path, - vg_lite_format_t format, - vg_lite_quality_t quality, - vg_lite_uint32_t length, - vg_lite_pointer data, - vg_lite_float_t min_x, - vg_lite_float_t min_y, - vg_lite_float_t max_x, - vg_lite_float_t max_y); - - /* Return the size (in bytes) of command buffer for a path opcode array. */ - vg_lite_uint32_t vg_lite_get_path_length(vg_lite_uint8_t *opcode, - vg_lite_uint32_t count, - vg_lite_format_t format); - - /* Generate command buffer for the (path) based on input opcodes (opcode) and coordinates (data). */ - vg_lite_error_t vg_lite_append_path(vg_lite_path_t *path, - vg_lite_uint8_t *opcode, - vg_lite_pointer data, - vg_lite_uint32_t seg_count); - - /* Set CLUT (Color Look Up Table) for index image. The (colors) is in ARGB format. */ - vg_lite_error_t vg_lite_set_CLUT(vg_lite_uint32_t count, vg_lite_uint32_t *colors); - - /* Draw a path that is filled by a transformed image pattern. */ - vg_lite_error_t vg_lite_draw_pattern(vg_lite_buffer_t *target, - vg_lite_path_t *path, - vg_lite_fill_t fill_rule, - vg_lite_matrix_t *path_matrix, - vg_lite_buffer_t *pattern_image, - vg_lite_matrix_t *pattern_matrix, - vg_lite_blend_t blend, - vg_lite_pattern_mode_t pattern_mode, - vg_lite_color_t pattern_color, - vg_lite_color_t color, - vg_lite_filter_t filter); - - /* Initialize a linear gradient object with default attributes. */ - vg_lite_error_t vg_lite_init_grad(vg_lite_linear_gradient_t *grad); - - /* Reset a linear gradient object attributes. */ - vg_lite_error_t vg_lite_clear_grad(vg_lite_linear_gradient_t *grad); - - /* Update a linear gradient object. */ - vg_lite_error_t vg_lite_update_grad(vg_lite_linear_gradient_t *grad); - - /* Return pointer to a linear gradient object's matrix. */ - vg_lite_matrix_t* vg_lite_get_grad_matrix(vg_lite_linear_gradient_t *grad); - - /* Set attributes for a linear gradient object. */ - vg_lite_error_t vg_lite_set_grad(vg_lite_linear_gradient_t *grad, - vg_lite_uint32_t count, - vg_lite_uint32_t *colors, - vg_lite_uint32_t *stops); - - /* Draw a path with a linear gradient object pattern. */ - vg_lite_error_t vg_lite_draw_grad(vg_lite_buffer_t *target, - vg_lite_path_t *path, - vg_lite_fill_t fill_rule, - vg_lite_matrix_t *matrix, - vg_lite_linear_gradient_t *grad, - vg_lite_blend_t blend); - - /* Reset an extended linear gradient object attributes and free image buffer. */ - vg_lite_error_t vg_lite_clear_linear_grad(vg_lite_ext_linear_gradient_t *grad); - - /* Update an extended linear gradient object. */ - vg_lite_error_t vg_lite_update_linear_grad(vg_lite_ext_linear_gradient_t *grad); - - /* Return pointer to an extended linear gradient object's matrix. */ - vg_lite_matrix_t* vg_lite_get_linear_grad_matrix(vg_lite_ext_linear_gradient_t *grad); - - /* Set attributes for an extended linear gradient object. */ - vg_lite_error_t vg_lite_set_linear_grad(vg_lite_ext_linear_gradient_t *grad, - vg_lite_uint32_t count, - vg_lite_color_ramp_t *color_ramp, - vg_lite_linear_gradient_parameter_t grad_param, - vg_lite_gradient_spreadmode_t spread_mode, - vg_lite_uint8_t pre_mult); - - /* Draw a path with an extended linear gradient object. */ - vg_lite_error_t vg_lite_draw_linear_grad(vg_lite_buffer_t *target, - vg_lite_path_t *path, - vg_lite_fill_t fill_rule, - vg_lite_matrix_t *path_matrix, - vg_lite_ext_linear_gradient_t *grad, - vg_lite_color_t paint_color, - vg_lite_blend_t blend, - vg_lite_filter_t filter); - - /* Reset a radial gradient object attributes and free image buffer. */ - vg_lite_error_t vg_lite_clear_radial_grad(vg_lite_radial_gradient_t *grad); - - /* Update a radial gradient object. */ - vg_lite_error_t vg_lite_update_radial_grad(vg_lite_radial_gradient_t *grad); - - /* Return pointer to a radial gradient object's matrix. */ - vg_lite_matrix_t* vg_lite_get_radial_grad_matrix(vg_lite_radial_gradient_t *grad); - - /* Set attributes for a radial gradient object. */ - vg_lite_error_t vg_lite_set_radial_grad(vg_lite_radial_gradient_t *grad, - vg_lite_uint32_t count, - vg_lite_color_ramp_t *color_ramp, - vg_lite_radial_gradient_parameter_t grad_param, - vg_lite_gradient_spreadmode_t spread_mode, - vg_lite_uint8_t pre_mult); - - /* Draw a path with a radial gradient object pattern. */ - vg_lite_error_t vg_lite_draw_radial_grad(vg_lite_buffer_t *target, - vg_lite_path_t *path, - vg_lite_fill_t fill_rule, - vg_lite_matrix_t *path_matrix, - vg_lite_radial_gradient_t *grad, - vg_lite_color_t paint_color, - vg_lite_blend_t blend, - vg_lite_filter_t filter); - - /* Load an identity matrix. */ - vg_lite_error_t vg_lite_identity(vg_lite_matrix_t *matrix); - - /* Translate a matrix. */ - vg_lite_error_t vg_lite_translate(vg_lite_float_t x, vg_lite_float_t y, vg_lite_matrix_t *matrix); - - /* Scale a matrix. */ - vg_lite_error_t vg_lite_scale(vg_lite_float_t scale_x, vg_lite_float_t scale_y, vg_lite_matrix_t *matrix); - - /* Rotate a matrix. */ - vg_lite_error_t vg_lite_rotate(vg_lite_float_t degrees, vg_lite_matrix_t *matrix); - - /* Set and enable a scissor rectangle for render target. */ - vg_lite_error_t vg_lite_set_scissor(vg_lite_int32_t x, vg_lite_int32_t y, vg_lite_int32_t right, vg_lite_int32_t bottom); - - /* Set scissor rectangles on mask layer. Scissor rects are enabled/disabled by following APIs. */ - vg_lite_error_t vg_lite_scissor_rects(vg_lite_uint32_t nums, vg_lite_rectangle_t rect[]); - - /* Enable scissor rects defined on mask layer. */ - vg_lite_error_t vg_lite_enable_scissor(void); - - /* Disable scissor rects defined on mask layer. */ - vg_lite_error_t vg_lite_disable_scissor(void); - - /* Query size of available contiguous video memory. */ - vg_lite_error_t vg_lite_get_mem_size(vg_lite_uint32_t *size); - - /* Set global alpha value for source image */ - vg_lite_error_t vg_lite_source_global_alpha(vg_lite_global_alpha_t alpha_mode, vg_lite_uint8_t alpha_value); - - /* Set global alpha value for destination image. */ - vg_lite_error_t vg_lite_dest_global_alpha(vg_lite_global_alpha_t alpha_mode, vg_lite_uint8_t alpha_value); - - /* Set colorkey. */ - vg_lite_error_t vg_lite_set_color_key(vg_lite_color_key4_t colorkey); - - /* Enable dither function. Dither is OFF by default. */ - vg_lite_error_t vg_lite_enable_dither(void); - - /* Disable dither function. Dither is OFF by default. */ - vg_lite_error_t vg_lite_disable_dither(void); - - /* Set a 64-byte aligned memory buffer (physical) as VGLite tessellation buffer. */ - vg_lite_error_t vg_lite_set_tess_buffer(vg_lite_uint32_t physical, vg_lite_uint32_t size); - - /* Can be called before vg_lite_init() to overwrite the default VG_LITE_COMMAND_BUFFER_SIZE */ - vg_lite_error_t vg_lite_set_command_buffer_size(vg_lite_uint32_t size); - - /* Set a user-defined external memory buffer (physical, 64-byte aligned) as VGLite command buffer. */ - vg_lite_error_t vg_lite_set_command_buffer(vg_lite_uint32_t physical, vg_lite_uint32_t size); - - /* Setup a pixel transform matrix m[20] which transforms each pixel as following: - * - * |a'| |m0 m1 m2 m3 m4 | |a| - * |r'| |m5 m6 m7 m8 m9 | |r| - * |g'| = |m10 m11 m12 m13 m14|.|g| - * |b'| |m15 m16 m17 m18 m19| |b| - * |1 | |0 0 0 0 1 | |1| - * - * The pixel transform for A, R, G, B channel can be enabled/disabled individually with (channel) parameter. - */ - vg_lite_error_t vg_lite_set_pixel_matrix(vg_lite_pixel_matrix_t matrix, vg_lite_pixel_channel_enable_t *channel); - - /* Setup 3x3 gaussian blur weight values to filter image pixels. - * - * Parameters w0, w1, w2 define a 3x3 gaussian blur weight matrix as below - * - * | w2 w1 w2 | - * | w1 w0 w1 | - * | w2 w1 w2 | - * - * The sum of 9 kernel weights must be 1.0 to avoid convolution overflow ( w0 + 4*w1 + 4*w2 = 1.0 ). - * The 3x3 weight matrix applies to a 3x3 pixel block - * - * | pixel[i-1][j-1] pixel[i][j-1] pixel[i+1][j-1]| - * | pixel[i-1][j] pixel[i][j] pixel[i+1][j] | - * | pixel[i-1][j+1] pixel[i][j+1] pixel[i+1][j+1]| - * - * With the following dot product equation: - * - * color[i][j] = w2*pixel[i-1][j-1] + w1*pixel[i][j-1] + w2*pixel[i+1][j-1] - * + w1*pixel[i-1][j] + w0*pixel[i][j] + w1*pixel[i+1][j] - * + w2*pixel[i-1][j+1] + w1*pixel[i][j+1] + w2*pixel[i+1][j+1]; - */ - vg_lite_error_t vg_lite_gaussian_filter(vg_lite_float_t w0, vg_lite_float_t w1, vg_lite_float_t w2); - - /* Enable masklayer function. Masklayer is OFF by default. */ - vg_lite_error_t vg_lite_enable_masklayer(void); - - /* Disable masklayer function. Masklayer is OFF by default. */ - vg_lite_error_t vg_lite_disable_masklayer(void); - - /* Setup a masklayer. */ - vg_lite_error_t vg_lite_set_masklayer(vg_lite_buffer_t *masklayer); - - /* Free a masklayer and disable mask operation. */ - vg_lite_error_t vg_lite_destroy_masklayer(vg_lite_buffer_t *masklayer); - - /* Create a masklayer with default format A8 and default pixel value 255. */ - vg_lite_error_t vg_lite_create_masklayer(vg_lite_buffer_t *masklayer, - vg_lite_uint32_t width, - vg_lite_uint32_t height); - - /* Set pixel values for a rectangle area in a masklayer */ - vg_lite_error_t vg_lite_fill_masklayer(vg_lite_buffer_t *masklayer, - vg_lite_rectangle_t *rect, - vg_lite_uint8_t value); - - /* Blend a rectangle area of src masklayer with dst masklayer according to (operation). */ - vg_lite_error_t vg_lite_blend_masklayer(vg_lite_buffer_t *dst, - vg_lite_buffer_t *src, - vg_lite_mask_operation_t operation, - vg_lite_rectangle_t *rect); - - /* Render a (path) with (fill_rule), (color), (matrix) to the masklayer. */ - vg_lite_error_t vg_lite_render_masklayer(vg_lite_buffer_t *masklayer, - vg_lite_mask_operation_t operation, - vg_lite_path_t *path, - vg_lite_fill_t fill_rule, - vg_lite_color_t color, - vg_lite_matrix_t *matrix); - - /* Set mirror orientation. */ - vg_lite_error_t vg_lite_set_mirror(vg_lite_orientation_t orientation); - - /* Set gamma value. */ - vg_lite_error_t vg_lite_set_gamma(vg_lite_gamma_conversion_t gamma_value); - - /* Enable color transformation, which is OFF by default. */ - vg_lite_error_t vg_lite_enable_color_transform(void); - - /* Disable color transformation, which is OFF by default. */ - vg_lite_error_t vg_lite_disable_color_transform(void); - - /* Set pixel color transformation scale and bias values for each pixel channel. */ - vg_lite_error_t vg_lite_set_color_transform(vg_lite_color_transform_t *values); - - /* Set flexa stream id. */ - vg_lite_error_t vg_lite_flexa_set_stream(vg_lite_uint8_t stream_id); - - /* set flexa background buffer.*/ - vg_lite_error_t vg_lite_flexa_bg_buffer(vg_lite_uint8_t stream_id, - vg_lite_buffer_t *buffer, - vg_lite_uint32_t seg_count, - vg_lite_uint32_t seg_size); - - /* Enable flexa. */ - vg_lite_error_t vg_lite_flexa_enable(void); - - /* Disable flexa.*/ - vg_lite_error_t vg_lite_flexa_disable(void); - - /* Set flexa stop flag after the last frame. */ - vg_lite_error_t vg_lite_flexa_stop_frame(void); - - /* Dump command buffer */ - vg_lite_error_t vg_lite_dump_command_buffer(void); - - /* Return VGLite parameters in params[] array */ - vg_lite_error_t vg_lite_get_parameter(vg_lite_param_type_t type, - vg_lite_int32_t count, - vg_lite_float_t* params); - -#endif /* VGLITE_VERSION_3_0 */ - -#ifdef __cplusplus -} -#endif -#endif /* _vg_lite_h_ */ diff --git a/L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite_matrix.c b/L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite_matrix.c deleted file mode 100644 index 42f8ce3..0000000 --- a/L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite_matrix.c +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @file vg_lite_matrix.c - * - */ - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" - -#if LV_USE_DRAW_VG_LITE && LV_USE_VG_LITE_THORVG - -#include -#include -#include "vg_lite.h" - -/********************* - * DEFINES - *********************/ - -#define VG_SW_BLIT_PRECISION_OPT 1 - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -vg_lite_error_t vg_lite_identity(vg_lite_matrix_t * matrix) -{ - /* Set identify matrix. */ - matrix->m[0][0] = 1.0f; - matrix->m[0][1] = 0.0f; - matrix->m[0][2] = 0.0f; - matrix->m[1][0] = 0.0f; - matrix->m[1][1] = 1.0f; - matrix->m[1][2] = 0.0f; - matrix->m[2][0] = 0.0f; - matrix->m[2][1] = 0.0f; - matrix->m[2][2] = 1.0f; - -#if VG_SW_BLIT_PRECISION_OPT - matrix->scaleX = 1.0f; - matrix->scaleY = 1.0f; - matrix->angle = 0.0f; -#endif /* VG_SW_BLIT_PRECISION_OPT */ - - return VG_LITE_SUCCESS; -} - -static void multiply(vg_lite_matrix_t * matrix, vg_lite_matrix_t * mult) -{ - vg_lite_matrix_t temp; - int row, column; - - /* Process all rows. */ - for(row = 0; row < 3; row++) { - /* Process all columns. */ - for(column = 0; column < 3; column++) { - /* Compute matrix entry. */ - temp.m[row][column] = (matrix->m[row][0] * mult->m[0][column]) - + (matrix->m[row][1] * mult->m[1][column]) - + (matrix->m[row][2] * mult->m[2][column]); - } - } - - /* Copy temporary matrix into result. */ -#if VG_SW_BLIT_PRECISION_OPT - memcpy(matrix, &temp, sizeof(vg_lite_float_t) * 9); -#else - memcpy(matrix, &temp, sizeof(temp)); -#endif /* VG_SW_BLIT_PRECISION_OPT */ -} - -vg_lite_error_t vg_lite_translate(vg_lite_float_t x, vg_lite_float_t y, vg_lite_matrix_t * matrix) -{ - /* Set translation matrix. */ - vg_lite_matrix_t t = { { {1.0f, 0.0f, x}, - {0.0f, 1.0f, y}, - {0.0f, 0.0f, 1.0f}, - }, - 0.0f, 0.0f, 0.0f - }; - - /* Multiply with current matrix. */ - multiply(matrix, &t); - - return VG_LITE_SUCCESS; -} - -vg_lite_error_t vg_lite_scale(vg_lite_float_t scale_x, vg_lite_float_t scale_y, vg_lite_matrix_t * matrix) -{ - /* Set scale matrix. */ - vg_lite_matrix_t s = { { {scale_x, 0.0f, 0.0f}, - {0.0f, scale_y, 0.0f}, - {0.0f, 0.0f, 1.0f}, - }, - 0.0f, 0.0f, 0.0f - }; - - /* Multiply with current matrix. */ - multiply(matrix, &s); - -#if VG_SW_BLIT_PRECISION_OPT - matrix->scaleX = matrix->scaleX * scale_x; - matrix->scaleY = matrix->scaleY * scale_y; -#endif /* VG_SW_BLIT_PRECISION_OPT */ - - return VG_LITE_SUCCESS; -} - -vg_lite_error_t vg_lite_rotate(vg_lite_float_t degrees, vg_lite_matrix_t * matrix) -{ - /* Convert degrees into radians. */ - vg_lite_float_t angle = (degrees / 180.0f) * 3.141592654f; - - /* Compute cosine and sine values. */ - vg_lite_float_t cos_angle = cosf(angle); - vg_lite_float_t sin_angle = sinf(angle); - - /* Set rotation matrix. */ - vg_lite_matrix_t r = { { {cos_angle, -sin_angle, 0.0f}, - {sin_angle, cos_angle, 0.0f}, - {0.0f, 0.0f, 1.0f}, - }, - 0.0f, 0.0f, 0.0f - }; - - /* Multiply with current matrix. */ - multiply(matrix, &r); - -#if VG_SW_BLIT_PRECISION_OPT - matrix->angle = matrix->angle + degrees; - if(matrix->angle >= 360) { - vg_lite_uint32_t count = (vg_lite_uint32_t)matrix->angle / 360; - matrix->angle = matrix->angle - count * 360; - } -#endif /* VG_SW_BLIT_PRECISION_OPT */ - - return VG_LITE_SUCCESS; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_VG_LITE_THORVG*/ diff --git a/L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite_tvg.cpp b/L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite_tvg.cpp deleted file mode 100644 index 28338be..0000000 --- a/L3_Middlewares/LVGL/src/others/vg_lite_tvg/vg_lite_tvg.cpp +++ /dev/null @@ -1,2767 +0,0 @@ -/** - * @file vg_lite_tvg.cpp - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#if LV_USE_DRAW_VG_LITE && LV_USE_VG_LITE_THORVG - -#include "vg_lite.h" -#include "../../lvgl.h" -#include "../../libs/thorvg/thorvg.h" -#include -#include -#include -#include -#include -#include - -#if LV_VG_LITE_THORVG_YUV_SUPPORT - #include -#endif - -/********************* - * DEFINES - *********************/ - -#define TVG_CANVAS_ENGINE CanvasEngine::Sw -#define TVG_COLOR(COLOR) B(COLOR), G(COLOR), R(COLOR), A(COLOR) -#define TVG_IS_VG_FMT_SUPPORT(fmt) ((fmt) == VG_LITE_BGRA8888 || (fmt) == VG_LITE_BGRX8888) - -#define TVG_CHECK_RETURN_VG_ERROR(FUNC) \ - do { \ - Result res = FUNC; \ - if (res != Result::Success) { \ - LV_LOG_ERROR("Executed '" #FUNC "' error: %d", (int)res); \ - return vg_lite_error_conv(res); \ - } \ - } while (0) -#define TVG_CHECK_RETURN_RESULT(FUNC) \ - do { \ - Result res = FUNC; \ - if (res != Result::Success) { \ - LV_LOG_ERROR("Executed '" #FUNC "' error: %d", (int)res);\ - return res; \ - } \ - } while (0) - -/* clang-format off */ - -#define IS_INDEX_FMT(fmt) \ - ((fmt) == VG_LITE_INDEX_1 \ - || (fmt) == VG_LITE_INDEX_2 \ - || (fmt) == VG_LITE_INDEX_4 \ - || (fmt) == VG_LITE_INDEX_8) - -#define VLC_GET_ARG(CUR, INDEX) vlc_get_arg((cur + (INDEX) * fmt_len), path->format); -#define VLC_GET_OP_CODE(ptr) (*((uint8_t*)ptr)) -#define VLC_OP_ARG_LEN(OP, LEN) \ - case VLC_OP_##OP: \ - return (LEN) - -#define A(color) ((color) >> 24) -#define R(color) (((color) & 0x00ff0000) >> 16) -#define G(color) (((color) & 0x0000ff00) >> 8) -#define B(color) ((color) & 0xff) -#define ARGB(a, r, g, b) ((a) << 24) | ((r) << 16) | ((g) << 8) | (b) -#define MIN(a, b) (a) > (b) ? (b) : (a) -#define MAX(a, b) (a) > (b) ? (a) : (b) -#define UDIV255(x) (((x) * 0x8081U) >> 0x17) -#define LERP(v1, v2, w) ((v1) * (w) + (v2) * (1.0f - (w))) -#define CLAMP(x, min, max) (((x) < (min)) ? (min) : ((x) > (max)) ? (max) : (x)) -#define COLOR_FROM_RAMP(ColorRamp) (((vg_lite_float_t*)ColorRamp) + 1) - -#define VG_LITE_RETURN_ERROR(func) \ - if ((error = func) != VG_LITE_SUCCESS) \ - return error - -#define VG_LITE_ALIGN(number, align_bytes) \ - (((number) + ((align_bytes)-1)) & ~((align_bytes)-1)) - -#define VG_LITE_IS_ALIGNED(num, align) (((uintptr_t)(num) & ((align)-1)) == 0) - -#define VG_LITE_IS_ALPHA_FORMAT(format) \ - ((format) == VG_LITE_A8 || (format) == VG_LITE_A4) - -/* clang-format on */ - -/********************** - * TYPEDEFS - **********************/ - -using namespace tvg; - -#pragma pack(1) -typedef struct { - uint8_t blue; - uint8_t green; - uint8_t red; -} vg_color24_t; - -typedef struct { - uint16_t blue : 5; - uint16_t green : 6; - uint16_t red : 5; -} vg_color16_t; - -typedef struct { - vg_color16_t c; - uint8_t alpha; -} vg_color16_alpha_t; - -typedef struct { - uint8_t blue; - uint8_t green; - uint8_t red; - uint8_t alpha; -} vg_color32_t; - -typedef struct { - vg_lite_float_t x; - vg_lite_float_t y; -} vg_lite_fpoint_t; - -#pragma pack() - -class vg_lite_ctx -{ - public: - std::unique_ptr canvas; - void * target_buffer; - vg_lite_uint32_t target_px_size; - vg_lite_buffer_format_t target_format; - - public: - vg_lite_ctx() - : target_buffer { nullptr } - , target_px_size { 0 } - , target_format { VG_LITE_BGRA8888 } - , clut_2colors { 0 } - , clut_4colors { 0 } - , clut_16colors { 0 } - , clut_256colors { 0 } - { - canvas = SwCanvas::gen(); - } - - vg_lite_uint32_t * get_image_buffer(vg_lite_uint32_t w, vg_lite_uint32_t h) - { - src_buffer.resize(w * h); - return src_buffer.data(); - } - - vg_lite_uint32_t * get_temp_target_buffer(vg_lite_uint32_t w, vg_lite_uint32_t h) - { - vg_lite_uint32_t px_size = w * h; - if(px_size > dest_buffer.size()) { - dest_buffer.resize(w * h); - } - return dest_buffer.data(); - } - - vg_lite_uint32_t * get_temp_target_buffer() - { - return dest_buffer.data(); - } - - void set_CLUT(vg_lite_uint32_t count, const vg_lite_uint32_t * colors) - { - switch(count) { - case 2: - memcpy(clut_2colors, colors, sizeof(clut_2colors)); - break; - case 4: - memcpy(clut_4colors, colors, sizeof(clut_4colors)); - break; - case 16: - memcpy(clut_16colors, colors, sizeof(clut_16colors)); - break; - case 256: - memcpy(clut_256colors, colors, sizeof(clut_256colors)); - break; - default: - LV_ASSERT(false); - break; - } - } - - const vg_lite_uint32_t * get_CLUT(vg_lite_buffer_format_t format) - { - switch(format) { - case VG_LITE_INDEX_1: - return clut_2colors; - - case VG_LITE_INDEX_2: - return clut_2colors; - - case VG_LITE_INDEX_4: - return clut_4colors; - - case VG_LITE_INDEX_8: - return clut_256colors; - - default: - break; - } - - LV_ASSERT(false); - return nullptr; - } - - static vg_lite_ctx * get_instance() - { - static vg_lite_ctx instance; - return &instance; - } - - private: - /* */ - std::vector src_buffer; - std::vector dest_buffer; - - vg_lite_uint32_t clut_2colors[2]; - vg_lite_uint32_t clut_4colors[4]; - vg_lite_uint32_t clut_16colors[16]; - vg_lite_uint32_t clut_256colors[256]; -}; - -template -class vg_lite_converter -{ - public: - typedef void (*converter_cb_t)(DEST_TYPE * dest, const SRC_TYPE * src, vg_lite_uint32_t px_size, - vg_lite_uint32_t color); - - public: - vg_lite_converter(converter_cb_t converter) - : _converter_cb(converter) - { - } - - void convert(vg_lite_buffer_t * dest_buf, const vg_lite_buffer_t * src_buf, vg_lite_uint32_t color = 0) - { - LV_ASSERT(_converter_cb); - uint8_t * dest = (uint8_t *)dest_buf->memory; - const uint8_t * src = (const uint8_t *)src_buf->memory; - vg_lite_uint32_t h = src_buf->height; - - while(h--) { - _converter_cb((DEST_TYPE *)dest, (const SRC_TYPE *)src, src_buf->width, color); - dest += dest_buf->stride; - src += src_buf->stride; - } - } - - private: - converter_cb_t _converter_cb; -}; - -typedef vg_lite_float_t FLOATVECTOR4[4]; - -/********************** - * STATIC PROTOTYPES - **********************/ - -static vg_lite_error_t vg_lite_error_conv(Result result); -static Matrix matrix_conv(const vg_lite_matrix_t * matrix); -static FillRule fill_rule_conv(vg_lite_fill_t fill); -static BlendMethod blend_method_conv(vg_lite_blend_t blend); -static StrokeCap stroke_cap_conv(vg_lite_cap_style_t cap); -static StrokeJoin stroke_join_conv(vg_lite_join_style_t join); -static FillSpread fill_spread_conv(vg_lite_gradient_spreadmode_t spread); -static Result shape_append_path(std::unique_ptr & shape, vg_lite_path_t * path, vg_lite_matrix_t * matrix); -static Result shape_append_rect(std::unique_ptr & shape, const vg_lite_buffer_t * target, - const vg_lite_rectangle_t * rect); -static Result canvas_set_target(vg_lite_ctx * ctx, vg_lite_buffer_t * target); -static Result picture_load(vg_lite_ctx * ctx, std::unique_ptr & picture, const vg_lite_buffer_t * source, - vg_lite_color_t color = 0); - -static inline bool math_zero(float a) -{ - return (fabs(a) < FLT_EPSILON); -} - -static inline bool math_equal(float a, float b) -{ - return math_zero(a - b); -} - -static void ClampColor(FLOATVECTOR4 Source, FLOATVECTOR4 Target, uint8_t Premultiplied); -static uint8_t PackColorComponent(vg_lite_float_t value); -static void get_format_bytes(vg_lite_buffer_format_t format, - vg_lite_uint32_t * mul, - vg_lite_uint32_t * div, - vg_lite_uint32_t * bytes_align); - -static vg_lite_fpoint_t matrix_transform_point(const vg_lite_matrix_t * matrix, const vg_lite_fpoint_t * point); -static bool vg_lite_matrix_inverse(vg_lite_matrix_t * result, const vg_lite_matrix_t * matrix); -static void vg_lite_matrix_multiply(vg_lite_matrix_t * matrix, const vg_lite_matrix_t * mult); - -/********************** - * STATIC VARIABLES - **********************/ - -/* color converters */ - -static vg_lite_converter conv_bgra8888_to_bgr565( - [](vg_color16_t * dest, const vg_color32_t * src, vg_lite_uint32_t px_size, vg_lite_uint32_t /* color */) -{ - while(px_size--) { - dest->red = src->red * 0x1F / 0xFF; - dest->green = src->green * 0x3F / 0xFF; - dest->blue = src->blue * 0x1F / 0xFF; - src++; - dest++; - } -}); - -static vg_lite_converter conv_bgra8888_to_bgra5658( - [](vg_color16_alpha_t * dest, const vg_color32_t * src, vg_lite_uint32_t px_size, vg_lite_uint32_t /* color */) -{ - while(px_size--) { - dest->c.red = src->red * 0x1F / 0xFF; - dest->c.green = src->green * 0x3F / 0xFF; - dest->c.blue = src->blue * 0x1F / 0xFF; - dest->alpha = src->alpha; - src++; - dest++; - } -}); - -static vg_lite_converter conv_bgr565_to_bgra8888( - [](vg_color32_t * dest, const vg_color16_t * src, vg_lite_uint32_t px_size, vg_lite_uint32_t /* color */) -{ - while(px_size--) { - dest->red = src->red * 0xFF / 0x1F; - dest->green = src->green * 0xFF / 0x3F; - dest->blue = src->blue * 0xFF / 0x1F; - dest->alpha = 0xFF; - src++; - dest++; - } -}); - -static vg_lite_converter conv_bgra5658_to_bgra8888( - [](vg_color32_t * dest, const vg_color16_alpha_t * src, vg_lite_uint32_t px_size, vg_lite_uint32_t /* color */) -{ - while(px_size--) { - dest->red = src->c.red * 0xFF / 0x1F; - dest->green = src->c.green * 0xFF / 0x3F; - dest->blue = src->c.blue * 0xFF / 0x1F; - dest->alpha = src->alpha; - src++; - dest++; - } -}); - -static vg_lite_converter conv_bgrx8888_to_bgra8888( - [](vg_color32_t * dest, const vg_color32_t * src, vg_lite_uint32_t px_size, vg_lite_uint32_t /* color */) -{ - while(px_size--) { - *dest = *src; - dest->alpha = 0xFF; - dest++; - src++; - } -}); - -static vg_lite_converter conv_bgr888_to_bgra8888( - [](vg_color32_t * dest, const vg_color24_t * src, vg_lite_uint32_t px_size, vg_lite_uint32_t /* color */) -{ - while(px_size--) { - dest->red = src->red; - dest->green = src->green; - dest->blue = src->blue; - dest->alpha = 0xFF; - src++; - dest++; - } -}); - -static vg_lite_converter conv_alpha8_to_bgra8888( - [](vg_color32_t * dest, const uint8_t * src, vg_lite_uint32_t px_size, vg_lite_uint32_t color) -{ - while(px_size--) { - uint8_t alpha = *src; - dest->alpha = alpha; - dest->red = UDIV255(B(color) * alpha); - dest->green = UDIV255(G(color) * alpha); - dest->blue = UDIV255(R(color) * alpha); - dest++; - src++; - } -}); - -static vg_lite_converter conv_alpha4_to_bgra8888( - [](vg_color32_t * dest, const uint8_t * src, vg_lite_uint32_t px_size, vg_lite_uint32_t color) -{ - /* 1 byte -> 2 px */ - px_size /= 2; - - while(px_size--) { - /* high 4bit */ - uint8_t alpha = (*src & 0xF0); - dest->alpha = alpha; - dest->red = UDIV255(B(color) * alpha); - dest->green = UDIV255(G(color) * alpha); - dest->blue = UDIV255(R(color) * alpha); - dest++; - - /* low 4bit */ - alpha = (*src & 0x0F) << 4; - dest->alpha = alpha; - dest->red = UDIV255(B(color) * alpha); - dest->green = UDIV255(G(color) * alpha); - dest->blue = UDIV255(R(color) * alpha); - - dest++; - src++; - } -}); - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -extern "C" { - - void gpu_init(void) - { - vg_lite_init(0, 0); - } - - vg_lite_error_t vg_lite_allocate(vg_lite_buffer_t * buffer) - { - if(buffer->format == VG_LITE_RGBA8888_ETC2_EAC && (buffer->width % 16 || buffer->height % 4)) { - return VG_LITE_INVALID_ARGUMENT; - } - - /* Reset planar. */ - buffer->yuv.uv_planar = buffer->yuv.v_planar = buffer->yuv.alpha_planar = 0; - - /* Align height in case format is tiled. */ - if(buffer->format >= VG_LITE_YUY2 && buffer->format <= VG_LITE_NV16) { - buffer->height = VG_LITE_ALIGN(buffer->height, 4); - buffer->yuv.swizzle = VG_LITE_SWIZZLE_UV; - } - - if(buffer->format >= VG_LITE_YUY2_TILED && buffer->format <= VG_LITE_AYUY2_TILED) { - buffer->height = VG_LITE_ALIGN(buffer->height, 4); - buffer->tiled = VG_LITE_TILED; - buffer->yuv.swizzle = VG_LITE_SWIZZLE_UV; - } - - vg_lite_uint32_t mul, div, align; - get_format_bytes(buffer->format, &mul, &div, &align); - vg_lite_uint32_t stride = VG_LITE_ALIGN((buffer->width * mul / div), align); - - buffer->stride = stride; - - /* Size must be multiple of align, See: https://en.cppreference.com/w/c/memory/aligned_alloc */ - size_t size = VG_LITE_ALIGN(buffer->height * stride, LV_VG_LITE_THORVG_BUF_ADDR_ALIGN); -#ifndef _WIN32 - buffer->memory = aligned_alloc(LV_VG_LITE_THORVG_BUF_ADDR_ALIGN, size); -#else - buffer->memory = _aligned_malloc(size, LV_VG_LITE_THORVG_BUF_ADDR_ALIGN); -#endif - LV_ASSERT(buffer->memory); - buffer->address = (vg_lite_uint32_t)(uintptr_t)buffer->memory; - buffer->handle = buffer->memory; - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_free(vg_lite_buffer_t * buffer) - { - LV_ASSERT(buffer->memory); -#ifndef _WIN32 - free(buffer->memory); -#else - _aligned_free(buffer->memory); -#endif - memset(buffer, 0, sizeof(vg_lite_buffer_t)); - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_upload_buffer(vg_lite_buffer_t * buffer, vg_lite_uint8_t * data[3], vg_lite_uint32_t stride[3]) - { - LV_UNUSED(buffer); - LV_UNUSED(data); - LV_UNUSED(stride); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_map(vg_lite_buffer_t * buffer, vg_lite_map_flag_t flag, int32_t fd) - { - LV_UNUSED(buffer); - LV_UNUSED(flag); - LV_UNUSED(fd); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_unmap(vg_lite_buffer_t * buffer) - { - LV_UNUSED(buffer); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_clear(vg_lite_buffer_t * target, vg_lite_rectangle_t * rectangle, vg_lite_color_t color) - { - auto ctx = vg_lite_ctx::get_instance(); - TVG_CHECK_RETURN_VG_ERROR(canvas_set_target(ctx, target)); - - auto shape = Shape::gen(); - TVG_CHECK_RETURN_VG_ERROR(shape_append_rect(shape, target, rectangle)); - TVG_CHECK_RETURN_VG_ERROR(shape->blend(BlendMethod::SrcOver)); - TVG_CHECK_RETURN_VG_ERROR(shape->fill(TVG_COLOR(color))); - TVG_CHECK_RETURN_VG_ERROR(ctx->canvas->push(std::move(shape))); - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_blit(vg_lite_buffer_t * target, - vg_lite_buffer_t * source, - vg_lite_matrix_t * matrix, - vg_lite_blend_t blend, - vg_lite_color_t color, - vg_lite_filter_t filter) - { - LV_UNUSED(filter); - auto ctx = vg_lite_ctx::get_instance(); - canvas_set_target(ctx, target); - - auto picture = Picture::gen(); - - TVG_CHECK_RETURN_VG_ERROR(picture_load(ctx, picture, source, color)); - TVG_CHECK_RETURN_VG_ERROR(picture->transform(matrix_conv(matrix))); - TVG_CHECK_RETURN_VG_ERROR(picture->blend(blend_method_conv(blend))); - TVG_CHECK_RETURN_VG_ERROR(ctx->canvas->push(std::move(picture))); - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_blit2(vg_lite_buffer_t * target, - vg_lite_buffer_t * source0, - vg_lite_buffer_t * source1, - vg_lite_matrix_t * matrix0, - vg_lite_matrix_t * matrix1, - vg_lite_blend_t blend, - vg_lite_filter_t filter) - { - if(!vg_lite_query_feature(gcFEATURE_BIT_VG_DOUBLE_IMAGE)) { - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t error; - - VG_LITE_RETURN_ERROR(vg_lite_blit(target, source0, matrix0, blend, 0, filter)); - VG_LITE_RETURN_ERROR(vg_lite_blit(target, source1, matrix1, blend, 0, filter)); - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_blit_rect(vg_lite_buffer_t * target, - vg_lite_buffer_t * source, - vg_lite_rectangle_t * rect, - vg_lite_matrix_t * matrix, - vg_lite_blend_t blend, - vg_lite_color_t color, - vg_lite_filter_t filter) - { - LV_UNUSED(filter); - auto ctx = vg_lite_ctx::get_instance(); - TVG_CHECK_RETURN_VG_ERROR(canvas_set_target(ctx, target)); - - auto shape = Shape::gen(); - TVG_CHECK_RETURN_VG_ERROR(shape_append_rect(shape, target, rect)); - TVG_CHECK_RETURN_VG_ERROR(shape->transform(matrix_conv(matrix))); - - auto picture = tvg::Picture::gen(); - TVG_CHECK_RETURN_VG_ERROR(picture_load(ctx, picture, source, color)); - TVG_CHECK_RETURN_VG_ERROR(picture->transform(matrix_conv(matrix))); - TVG_CHECK_RETURN_VG_ERROR(picture->blend(blend_method_conv(blend))); - TVG_CHECK_RETURN_VG_ERROR(picture->composite(std::move(shape), CompositeMethod::ClipPath)); - TVG_CHECK_RETURN_VG_ERROR(ctx->canvas->push(std::move(picture))); - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_init(int32_t tessellation_width, int32_t tessellation_height) - { - LV_UNUSED(tessellation_width); - LV_UNUSED(tessellation_height); -#if LV_VG_LITE_THORVG_THREAD_RENDER - /* Threads Count */ - auto threads = std::thread::hardware_concurrency(); - if(threads > 0) { - --threads; /* Allow the designated main thread capacity */ - } -#endif - - /* Initialize ThorVG Engine */ - TVG_CHECK_RETURN_VG_ERROR(Initializer::init(TVG_CANVAS_ENGINE, 0)); - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_close(void) - { - TVG_CHECK_RETURN_VG_ERROR(Initializer::term(TVG_CANVAS_ENGINE)); - return VG_LITE_SUCCESS; - } - - static void picture_bgra8888_to_bgr565(vg_color16_t * dest, const vg_color32_t * src, vg_lite_uint32_t px_size) - { - while(px_size--) { - dest->red = src->red * 0x1F / 0xFF; - dest->green = src->green * 0x3F / 0xFF; - dest->blue = src->blue * 0x1F / 0xFF; - src++; - dest++; - } - } - - static void picture_bgra8888_to_bgra5658(vg_color16_alpha_t * dest, const vg_color32_t * src, vg_lite_uint32_t px_size) - { - while(px_size--) { - dest->c.red = src->red * 0x1F / 0xFF; - dest->c.green = src->green * 0x3F / 0xFF; - dest->c.blue = src->blue * 0x1F / 0xFF; - dest->alpha = src->alpha; - src++; - dest++; - } - } - - static void picture_bgra8888_to_bgr888(vg_color24_t * dest, const vg_color32_t * src, vg_lite_uint32_t px_size) - { - while(px_size--) { - dest->red = src->red; - dest->green = src->green; - dest->blue = src->blue; - src++; - dest++; - } - } - - vg_lite_error_t vg_lite_finish(void) - { - vg_lite_ctx * ctx = vg_lite_ctx::get_instance(); - - if(ctx->canvas->draw() == Result::InsufficientCondition) { - return VG_LITE_SUCCESS; - } - - TVG_CHECK_RETURN_VG_ERROR(ctx->canvas->sync()); - TVG_CHECK_RETURN_VG_ERROR(ctx->canvas->clear(true)); - - /* make sure target buffer is valid */ - LV_ASSERT_NULL(ctx->target_buffer); - - /* If target_buffer is not in a format supported by thorvg, software conversion is required. */ - switch(ctx->target_format) { - case VG_LITE_BGR565: - picture_bgra8888_to_bgr565( - (vg_color16_t *)ctx->target_buffer, - (const vg_color32_t *)ctx->get_temp_target_buffer(), - ctx->target_px_size); - break; - case VG_LITE_BGRA5658: - picture_bgra8888_to_bgra5658( - (vg_color16_alpha_t *)ctx->target_buffer, - (const vg_color32_t *)ctx->get_temp_target_buffer(), - ctx->target_px_size); - break; - case VG_LITE_BGR888: - picture_bgra8888_to_bgr888( - (vg_color24_t *)ctx->target_buffer, - (const vg_color32_t *)ctx->get_temp_target_buffer(), - ctx->target_px_size); - break; - case VG_LITE_BGRA8888: - case VG_LITE_BGRX8888: - /* No conversion required. */ - break; - default: - LV_LOG_ERROR("unsupported format: %d", ctx->target_format); - LV_ASSERT(false); - break; - } - - /* finish convert, clean target buffer info */ - ctx->target_buffer = nullptr; - ctx->target_px_size = 0; - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_flush(void) - { - return vg_lite_finish(); - } - - vg_lite_error_t vg_lite_draw(vg_lite_buffer_t * target, - vg_lite_path_t * path, - vg_lite_fill_t fill_rule, - vg_lite_matrix_t * matrix, - vg_lite_blend_t blend, - vg_lite_color_t color) - { - auto ctx = vg_lite_ctx::get_instance(); - TVG_CHECK_RETURN_VG_ERROR(canvas_set_target(ctx, target)); - - auto shape = Shape::gen(); - TVG_CHECK_RETURN_VG_ERROR(shape_append_path(shape, path, matrix)); - TVG_CHECK_RETURN_VG_ERROR(shape->transform(matrix_conv(matrix))); - TVG_CHECK_RETURN_VG_ERROR(shape->fill(fill_rule_conv(fill_rule));); - TVG_CHECK_RETURN_VG_ERROR(shape->blend(blend_method_conv(blend))); - TVG_CHECK_RETURN_VG_ERROR(shape->fill(TVG_COLOR(color))); - TVG_CHECK_RETURN_VG_ERROR(ctx->canvas->push(std::move(shape))); - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_set_stroke(vg_lite_path_t * path, - vg_lite_cap_style_t cap_style, - vg_lite_join_style_t join_style, - vg_lite_float_t line_width, - vg_lite_float_t miter_limit, - vg_lite_float_t * dash_pattern, - vg_lite_uint32_t pattern_count, - vg_lite_float_t dash_phase, - vg_lite_color_t color) - { - if(!path || line_width <= 0) { - return VG_LITE_INVALID_ARGUMENT; - } - - if(miter_limit < 1.0f) { - miter_limit = 1.0f; - } - - if(!path->stroke) { - path->stroke = (vg_lite_stroke_t *)lv_malloc_zeroed(sizeof(vg_lite_stroke_t)); - - if(!path->stroke) { - return VG_LITE_OUT_OF_RESOURCES; - } - } - - path->stroke->cap_style = cap_style; - path->stroke->join_style = join_style; - path->stroke->line_width = line_width; - path->stroke->miter_limit = miter_limit; - path->stroke->half_width = line_width / 2.0f; - path->stroke->miter_square = path->stroke->miter_limit * path->stroke->miter_limit; - path->stroke->dash_pattern = dash_pattern; - path->stroke->pattern_count = pattern_count; - path->stroke->dash_phase = dash_phase; - path->stroke_color = color; - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_update_stroke(vg_lite_path_t * path) - { - LV_UNUSED(path); - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_set_path_type(vg_lite_path_t * path, vg_lite_path_type_t path_type) - { - if(!path || - (path_type != VG_LITE_DRAW_FILL_PATH && - path_type != VG_LITE_DRAW_STROKE_PATH && - path_type != VG_LITE_DRAW_FILL_STROKE_PATH) - ) - return VG_LITE_INVALID_ARGUMENT; - - path->path_type = path_type; - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_get_register(vg_lite_uint32_t address, vg_lite_uint32_t * result) - { - LV_UNUSED(address); - LV_UNUSED(result); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_get_info(vg_lite_info_t * info) - { - info->api_version = VGLITE_API_VERSION_3_0; - info->header_version = VGLITE_HEADER_VERSION; - info->release_version = VGLITE_RELEASE_VERSION; - info->reserved = 0; - return VG_LITE_SUCCESS; - } - - vg_lite_uint32_t vg_lite_get_product_info(char * name, vg_lite_uint32_t * chip_id, vg_lite_uint32_t * chip_rev) - { - strcpy(name, "GCNanoLiteV"); - *chip_id = 0x265; - *chip_rev = 0x2000; - return 1; - } - - vg_lite_uint32_t vg_lite_query_feature(vg_lite_feature_t feature) - { - switch(feature) { - case gcFEATURE_BIT_VG_IM_INDEX_FORMAT: - case gcFEATURE_BIT_VG_BORDER_CULLING: - case gcFEATURE_BIT_VG_RGBA2_FORMAT: - case gcFEATURE_BIT_VG_IM_FASTCLAER: - case gcFEATURE_BIT_VG_GLOBAL_ALPHA: - case gcFEATURE_BIT_VG_COLOR_KEY: - case gcFEATURE_BIT_VG_24BIT: - case gcFEATURE_BIT_VG_DITHER: - case gcFEATURE_BIT_VG_USE_DST: - case gcFEATURE_BIT_VG_RADIAL_GRADIENT: - case gcFEATURE_BIT_VG_IM_REPEAT_REFLECT: - -#if LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT - case gcFEATURE_BIT_VG_LVGL_SUPPORT: -#endif - -#if LV_VG_LITE_THORVG_YUV_SUPPORT - case gcFEATURE_BIT_VG_YUV_INPUT: -#endif - -#if LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT - case gcFEATURE_BIT_VG_LINEAR_GRADIENT_EXT: -#endif - -#if LV_VG_LITE_THORVG_16PIXELS_ALIGN - case gcFEATURE_BIT_VG_16PIXELS_ALIGN: -#endif - return 1; - default: - break; - } - return 0; - } - - vg_lite_error_t vg_lite_init_path(vg_lite_path_t * path, - vg_lite_format_t data_format, - vg_lite_quality_t quality, - vg_lite_uint32_t path_length, - void * path_data, - vg_lite_float_t min_x, vg_lite_float_t min_y, - vg_lite_float_t max_x, vg_lite_float_t max_y) - { - if(!path) { - return VG_LITE_INVALID_ARGUMENT; - } - - lv_memzero(path, sizeof(vg_lite_path_t)); - - path->format = data_format; - path->quality = quality; - path->bounding_box[0] = min_x; - path->bounding_box[1] = min_y; - path->bounding_box[2] = max_x; - path->bounding_box[3] = max_y; - - path->path_length = path_length; - path->path = path_data; - - path->path_changed = 1; - path->uploaded.address = 0; - path->uploaded.bytes = 0; - path->uploaded.handle = NULL; - path->uploaded.memory = NULL; - path->pdata_internal = 0; - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_init_arc_path(vg_lite_path_t * path, - vg_lite_format_t data_format, - vg_lite_quality_t quality, - vg_lite_uint32_t path_length, - void * path_data, - vg_lite_float_t min_x, vg_lite_float_t min_y, - vg_lite_float_t max_x, vg_lite_float_t max_y) - { - LV_UNUSED(path); - LV_UNUSED(data_format); - LV_UNUSED(quality); - LV_UNUSED(path_length); - LV_UNUSED(path_data); - LV_UNUSED(min_x); - LV_UNUSED(min_y); - LV_UNUSED(max_x); - LV_UNUSED(max_y); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_clear_path(vg_lite_path_t * path) - { - LV_ASSERT_NULL(path); - - if(path->stroke) { - lv_free(path->stroke); - path->stroke = NULL; - } - - return VG_LITE_SUCCESS; - } - - vg_lite_uint32_t vg_lite_get_path_length(vg_lite_uint8_t * opcode, - vg_lite_uint32_t count, - vg_lite_format_t format) - { - LV_UNUSED(opcode); - LV_UNUSED(count); - LV_UNUSED(format); - return 0; - } - - vg_lite_error_t vg_lite_append_path(vg_lite_path_t * path, - uint8_t * cmd, - void * data, - vg_lite_uint32_t seg_count) - { - LV_UNUSED(path); - LV_UNUSED(cmd); - LV_UNUSED(data); - LV_UNUSED(seg_count); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_upload_path(vg_lite_path_t * path) - { - LV_UNUSED(path); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_set_CLUT(vg_lite_uint32_t count, - vg_lite_uint32_t * colors) - { - if(!vg_lite_query_feature(gcFEATURE_BIT_VG_IM_INDEX_FORMAT)) { - return VG_LITE_NOT_SUPPORT; - } - LV_ASSERT(colors); - - auto ctx = vg_lite_ctx::get_instance(); - ctx->set_CLUT(count, colors); - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_draw_pattern(vg_lite_buffer_t * target, - vg_lite_path_t * path, - vg_lite_fill_t fill_rule, - vg_lite_matrix_t * path_matrix, - vg_lite_buffer_t * pattern_image, - vg_lite_matrix_t * pattern_matrix, - vg_lite_blend_t blend, - vg_lite_pattern_mode_t pattern_mode, - vg_lite_color_t pattern_color, - vg_lite_color_t color, - vg_lite_filter_t filter) - { - LV_UNUSED(pattern_mode); - LV_UNUSED(pattern_color); - LV_UNUSED(filter); - - auto ctx = vg_lite_ctx::get_instance(); - TVG_CHECK_RETURN_VG_ERROR(canvas_set_target(ctx, target)); - - auto shape = Shape::gen(); - TVG_CHECK_RETURN_VG_ERROR(shape_append_path(shape, path, path_matrix)); - TVG_CHECK_RETURN_VG_ERROR(shape->fill(fill_rule_conv(fill_rule))); - TVG_CHECK_RETURN_VG_ERROR(shape->transform(matrix_conv(path_matrix))); - - auto picture = tvg::Picture::gen(); - TVG_CHECK_RETURN_VG_ERROR(picture_load(ctx, picture, pattern_image, color)); - TVG_CHECK_RETURN_VG_ERROR(picture->transform(matrix_conv(pattern_matrix))); - TVG_CHECK_RETURN_VG_ERROR(picture->blend(blend_method_conv(blend))); - TVG_CHECK_RETURN_VG_ERROR(picture->composite(std::move(shape), CompositeMethod::ClipPath)); - TVG_CHECK_RETURN_VG_ERROR(ctx->canvas->push(std::move(picture))); - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_init_grad(vg_lite_linear_gradient_t * grad) - { - vg_lite_error_t error = VG_LITE_SUCCESS; - - /* Set the member values according to driver defaults. */ - grad->image.width = VLC_GRADIENT_BUFFER_WIDTH; - grad->image.height = 1; - grad->image.stride = 0; - grad->image.format = VG_LITE_BGRA8888; - - /* Allocate the image for gradient. */ - error = vg_lite_allocate(&grad->image); - - grad->count = 0; - - return error; - } - - vg_lite_error_t vg_lite_set_linear_grad(vg_lite_ext_linear_gradient_t * grad, - vg_lite_uint32_t count, - vg_lite_color_ramp_t * color_ramp, - vg_lite_linear_gradient_parameter_t linear_gradient, - vg_lite_gradient_spreadmode_t spread_mode, - vg_lite_uint8_t pre_multiplied) - { - static vg_lite_color_ramp_t default_ramp[] = { - { - 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f - }, - { - 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f - } - }; - - vg_lite_uint32_t i, trg_count; - vg_lite_float_t prev_stop; - vg_lite_color_ramp_t * src_ramp; - vg_lite_color_ramp_t * src_ramp_last; - vg_lite_color_ramp_t * trg_ramp; - - /* Reset the count. */ - trg_count = 0; - - if((linear_gradient.X0 == linear_gradient.X1) && (linear_gradient.Y0 == linear_gradient.Y1)) - return VG_LITE_INVALID_ARGUMENT; - - grad->linear_grad = linear_gradient; - grad->pre_multiplied = pre_multiplied; - grad->spread_mode = spread_mode; - - if(!count || count > VLC_MAX_COLOR_RAMP_STOPS || color_ramp == NULL) - goto Empty_sequence_handler; - - for(i = 0; i < count; i++) - grad->color_ramp[i] = color_ramp[i]; - grad->ramp_length = count; - - /* Determine the last source ramp. */ - src_ramp_last - = grad->color_ramp - + grad->ramp_length; - - /* Set the initial previous stop. */ - prev_stop = -1; - - /* Reset the count. */ - trg_count = 0; - - /* Walk through the source ramp. */ - for( - src_ramp = grad->color_ramp, trg_ramp = grad->converted_ramp; - (src_ramp < src_ramp_last) && (trg_count < VLC_MAX_COLOR_RAMP_STOPS + 2); - src_ramp += 1) { - /* Must be in increasing order. */ - if(src_ramp->stop < prev_stop) { - /* Ignore the entire sequence. */ - trg_count = 0; - break; - } - - /* Update the previous stop value. */ - prev_stop = src_ramp->stop; - - /* Must be within [0..1] range. */ - if((src_ramp->stop < 0.0f) || (src_ramp->stop > 1.0f)) { - /* Ignore. */ - continue; - } - - /* Clamp color. */ - ClampColor(COLOR_FROM_RAMP(src_ramp), COLOR_FROM_RAMP(trg_ramp), 0); - - /* First stop greater than zero? */ - if((trg_count == 0) && (src_ramp->stop > 0.0f)) { - /* Force the first stop to 0.0f. */ - trg_ramp->stop = 0.0f; - - /* Replicate the entry. */ - trg_ramp[1] = *trg_ramp; - trg_ramp[1].stop = src_ramp->stop; - - /* Advance. */ - trg_ramp += 2; - trg_count += 2; - } - else { - /* Set the stop value. */ - trg_ramp->stop = src_ramp->stop; - - /* Advance. */ - trg_ramp += 1; - trg_count += 1; - } - } - - /* Empty sequence? */ - if(trg_count == 0) { - memcpy(grad->converted_ramp, default_ramp, sizeof(default_ramp)); - grad->converted_length = sizeof(default_ramp) / 5; - } - else { - /* The last stop must be at 1.0. */ - if(trg_ramp[-1].stop != 1.0f) { - /* Replicate the last entry. */ - *trg_ramp = trg_ramp[-1]; - - /* Force the last stop to 1.0f. */ - trg_ramp->stop = 1.0f; - - /* Update the final entry count. */ - trg_count += 1; - } - - /* Set new length. */ - grad->converted_length = trg_count; - } - return VG_LITE_SUCCESS; - -Empty_sequence_handler: - memcpy(grad->converted_ramp, default_ramp, sizeof(default_ramp)); - grad->converted_length = sizeof(default_ramp) / 5; - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_update_linear_grad(vg_lite_ext_linear_gradient_t * grad) - { - vg_lite_uint32_t ramp_length; - vg_lite_color_ramp_t * color_ramp; - vg_lite_uint32_t common, stop; - vg_lite_uint32_t i, width; - uint8_t * bits; - vg_lite_float_t x0, y0, x1, y1, length; - vg_lite_error_t error = VG_LITE_SUCCESS; - - /* Get shortcuts to the color ramp. */ - ramp_length = grad->converted_length; - color_ramp = grad->converted_ramp; - - x0 = grad->linear_grad.X0; - y0 = grad->linear_grad.Y0; - x1 = grad->linear_grad.X1; - y1 = grad->linear_grad.Y1; - length = (vg_lite_float_t)sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)); - - if(length <= 0) - return VG_LITE_INVALID_ARGUMENT; - /* Find the common denominator of the color ramp stops. */ - if(length < 1) { - common = 1; - } - else { - common = (vg_lite_uint32_t)length; - } - - for(i = 0; i < ramp_length; ++i) { - if(color_ramp[i].stop != 0.0f) { - vg_lite_float_t mul = common * color_ramp[i].stop; - vg_lite_float_t frac = mul - (vg_lite_float_t)floor(mul); - if(frac > 0.00013f) { /* Suppose error for zero is 0.00013 */ - common = MAX(common, (vg_lite_uint32_t)(1.0f / frac + 0.5f)); - } - } - } - - /* Compute the width of the required color array. */ - width = common + 1; - - /* Allocate the color ramp surface. */ - memset(&grad->image, 0, sizeof(grad->image)); - grad->image.width = width; - grad->image.height = 1; - grad->image.stride = 0; - grad->image.image_mode = VG_LITE_NONE_IMAGE_MODE; - grad->image.format = VG_LITE_ABGR8888; - - /* Allocate the image for gradient. */ - VG_LITE_RETURN_ERROR(vg_lite_allocate(&grad->image)); - memset(grad->image.memory, 0, grad->image.stride * grad->image.height); - width = common + 1; - /* Set pointer to color array. */ - bits = (uint8_t *)grad->image.memory; - - /* Start filling the color array. */ - stop = 0; - for(i = 0; i < width; ++i) { - vg_lite_float_t gradient; - vg_lite_float_t color[4]; - vg_lite_float_t color1[4]; - vg_lite_float_t color2[4]; - vg_lite_float_t weight; - - if(i == 241) - i = 241; - /* Compute gradient for current color array entry. */ - gradient = (vg_lite_float_t)i / (vg_lite_float_t)(width - 1); - - /* Find the entry in the color ramp that matches or exceeds this - ** gradient. */ - while(gradient > color_ramp[stop].stop) { - ++stop; - } - - if(gradient == color_ramp[stop].stop) { - /* Perfect match weight 1.0. */ - weight = 1.0f; - - /* Use color ramp color. */ - color1[3] = color_ramp[stop].alpha; - color1[2] = color_ramp[stop].blue; - color1[1] = color_ramp[stop].green; - color1[0] = color_ramp[stop].red; - - color2[3] = color2[2] = color2[1] = color2[0] = 0.0f; - } - else { - if(stop == 0) { - return VG_LITE_INVALID_ARGUMENT; - } - /* Compute weight. */ - weight = (color_ramp[stop].stop - gradient) - / (color_ramp[stop].stop - color_ramp[stop - 1].stop); - - /* Grab color ramp color of previous stop. */ - color1[3] = color_ramp[stop - 1].alpha; - color1[2] = color_ramp[stop - 1].blue; - color1[1] = color_ramp[stop - 1].green; - color1[0] = color_ramp[stop - 1].red; - - /* Grab color ramp color of current stop. */ - color2[3] = color_ramp[stop].alpha; - color2[2] = color_ramp[stop].blue; - color2[1] = color_ramp[stop].green; - color2[0] = color_ramp[stop].red; - } - - if(grad->pre_multiplied) { - /* Pre-multiply the first color. */ - color1[2] *= color1[3]; - color1[1] *= color1[3]; - color1[0] *= color1[3]; - - /* Pre-multiply the second color. */ - color2[2] *= color2[3]; - color2[1] *= color2[3]; - color2[0] *= color2[3]; - } - - /* Filter the colors per channel. */ - color[3] = LERP(color1[3], color2[3], weight); - color[2] = LERP(color1[2], color2[2], weight); - color[1] = LERP(color1[1], color2[1], weight); - color[0] = LERP(color1[0], color2[0], weight); - - /* Pack the final color. */ - *bits++ = PackColorComponent(color[3]); - *bits++ = PackColorComponent(color[2]); - *bits++ = PackColorComponent(color[1]); - *bits++ = PackColorComponent(color[0]); - } - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_draw_linear_grad(vg_lite_buffer_t * target, - vg_lite_path_t * path, - vg_lite_fill_t fill_rule, - vg_lite_matrix_t * path_matrix, - vg_lite_ext_linear_gradient_t * grad, - vg_lite_color_t paint_color, - vg_lite_blend_t blend, - vg_lite_filter_t filter) - { - LV_UNUSED(paint_color); - LV_UNUSED(filter); - - auto ctx = vg_lite_ctx::get_instance(); - TVG_CHECK_RETURN_VG_ERROR(canvas_set_target(ctx, target)); - - auto shape = Shape::gen(); - TVG_CHECK_RETURN_VG_ERROR(shape_append_path(shape, path, path_matrix)); - TVG_CHECK_RETURN_VG_ERROR(shape->transform(matrix_conv(path_matrix))); - TVG_CHECK_RETURN_VG_ERROR(shape->fill(fill_rule_conv(fill_rule));); - TVG_CHECK_RETURN_VG_ERROR(shape->blend(blend_method_conv(blend))); - - auto linearGrad = LinearGradient::gen(); - TVG_CHECK_RETURN_VG_ERROR(linearGrad->linear(grad->linear_grad.X0, grad->linear_grad.Y0, grad->linear_grad.X1, - grad->linear_grad.Y1)); - TVG_CHECK_RETURN_VG_ERROR(linearGrad->transform(matrix_conv(&grad->matrix))); - TVG_CHECK_RETURN_VG_ERROR(linearGrad->spread(fill_spread_conv(grad->spread_mode))); - - tvg::Fill::ColorStop colorStops[VLC_MAX_COLOR_RAMP_STOPS]; - for(vg_lite_uint32_t i = 0; i < grad->ramp_length; i++) { - colorStops[i].offset = grad->color_ramp[i].stop; - colorStops[i].r = grad->color_ramp[i].red * 255.0f; - colorStops[i].g = grad->color_ramp[i].green * 255.0f; - colorStops[i].b = grad->color_ramp[i].blue * 255.0f; - colorStops[i].a = grad->color_ramp[i].alpha * 255.0f; - } - TVG_CHECK_RETURN_VG_ERROR(linearGrad->colorStops(colorStops, grad->ramp_length)); - - TVG_CHECK_RETURN_VG_ERROR(shape->fill(std::move(linearGrad))); - TVG_CHECK_RETURN_VG_ERROR(ctx->canvas->push(std::move(shape))); - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_set_radial_grad(vg_lite_radial_gradient_t * grad, - vg_lite_uint32_t count, - vg_lite_color_ramp_t * color_ramp, - vg_lite_radial_gradient_parameter_t radial_grad, - vg_lite_gradient_spreadmode_t spread_mode, - vg_lite_uint8_t pre_multiplied) - { - static vg_lite_color_ramp_t defaultRamp[] = { - { - 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f - }, - { - 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f - } - }; - - vg_lite_uint32_t i, trgCount; - vg_lite_float_t prevStop; - vg_lite_color_ramp_t * srcRamp; - vg_lite_color_ramp_t * srcRampLast; - vg_lite_color_ramp_t * trgRamp; - - /* Reset the count. */ - trgCount = 0; - - if(radial_grad.r <= 0) - return VG_LITE_INVALID_ARGUMENT; - - grad->radial_grad = radial_grad; - grad->pre_multiplied = pre_multiplied; - grad->spread_mode = spread_mode; - - if(!count || count > VLC_MAX_COLOR_RAMP_STOPS || color_ramp == NULL) - goto Empty_sequence_handler; - - for(i = 0; i < count; i++) - grad->color_ramp[i] = color_ramp[i]; - grad->ramp_length = count; - - /* Determine the last source ramp. */ - srcRampLast - = grad->color_ramp - + grad->ramp_length; - - /* Set the initial previous stop. */ - prevStop = -1; - - /* Reset the count. */ - trgCount = 0; - - /* Walk through the source ramp. */ - for( - srcRamp = grad->color_ramp, trgRamp = grad->converted_ramp; - (srcRamp < srcRampLast) && (trgCount < VLC_MAX_COLOR_RAMP_STOPS + 2); - srcRamp += 1) { - /* Must be in increasing order. */ - if(srcRamp->stop < prevStop) { - /* Ignore the entire sequence. */ - trgCount = 0; - break; - } - - /* Update the previous stop value. */ - prevStop = srcRamp->stop; - - /* Must be within [0..1] range. */ - if((srcRamp->stop < 0.0f) || (srcRamp->stop > 1.0f)) { - /* Ignore. */ - continue; - } - - /* Clamp color. */ - ClampColor(COLOR_FROM_RAMP(srcRamp), COLOR_FROM_RAMP(trgRamp), 0); - - /* First stop greater than zero? */ - if((trgCount == 0) && (srcRamp->stop > 0.0f)) { - /* Force the first stop to 0.0f. */ - trgRamp->stop = 0.0f; - - /* Replicate the entry. */ - trgRamp[1] = *trgRamp; - trgRamp[1].stop = srcRamp->stop; - - /* Advance. */ - trgRamp += 2; - trgCount += 2; - } - else { - /* Set the stop value. */ - trgRamp->stop = srcRamp->stop; - - /* Advance. */ - trgRamp += 1; - trgCount += 1; - } - } - - /* Empty sequence? */ - if(trgCount == 0) { - memcpy(grad->converted_ramp, defaultRamp, sizeof(defaultRamp)); - grad->converted_length = sizeof(defaultRamp) / 5; - } - else { - /* The last stop must be at 1.0. */ - if(trgRamp[-1].stop != 1.0f) { - /* Replicate the last entry. */ - *trgRamp = trgRamp[-1]; - - /* Force the last stop to 1.0f. */ - trgRamp->stop = 1.0f; - - /* Update the final entry count. */ - trgCount += 1; - } - - /* Set new length. */ - grad->converted_length = trgCount; - } - return VG_LITE_SUCCESS; - -Empty_sequence_handler: - memcpy(grad->converted_ramp, defaultRamp, sizeof(defaultRamp)); - grad->converted_length = sizeof(defaultRamp) / 5; - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_update_radial_grad(vg_lite_radial_gradient_t * grad) - { - vg_lite_uint32_t ramp_length; - vg_lite_color_ramp_t * colorRamp; - vg_lite_uint32_t common, stop; - vg_lite_uint32_t i, width; - uint8_t * bits; - vg_lite_error_t error = VG_LITE_SUCCESS; - vg_lite_uint32_t align, mul, div; - - /* Get shortcuts to the color ramp. */ - ramp_length = grad->converted_length; - colorRamp = grad->converted_ramp; - - if(grad->radial_grad.r <= 0) - return VG_LITE_INVALID_ARGUMENT; - - /* Find the common denominator of the color ramp stops. */ - if(grad->radial_grad.r < 1) { - common = 1; - } - else { - common = (vg_lite_uint32_t)grad->radial_grad.r; - } - - for(i = 0; i < ramp_length; ++i) { - if(colorRamp[i].stop != 0.0f) { - vg_lite_float_t m = common * colorRamp[i].stop; - vg_lite_float_t frac = m - (vg_lite_float_t)floor(m); - if(frac > 0.00013f) { /* Suppose error for zero is 0.00013 */ - common = MAX(common, (vg_lite_uint32_t)(1.0f / frac + 0.5f)); - } - } - } - - /* Compute the width of the required color array. */ - width = common + 1; - width = (width + 15) & (~0xf); - - /* Allocate the color ramp surface. */ - memset(&grad->image, 0, sizeof(grad->image)); - grad->image.width = width; - grad->image.height = 1; - grad->image.stride = 0; - grad->image.image_mode = VG_LITE_NONE_IMAGE_MODE; - grad->image.format = VG_LITE_ABGR8888; - - /* Allocate the image for gradient. */ - VG_LITE_RETURN_ERROR(vg_lite_allocate(&grad->image)); - - get_format_bytes(VG_LITE_ABGR8888, &mul, &div, &align); - width = grad->image.stride * div / mul; - - /* Set pointer to color array. */ - bits = (uint8_t *)grad->image.memory; - - /* Start filling the color array. */ - stop = 0; - for(i = 0; i < width; ++i) { - vg_lite_float_t gradient; - vg_lite_float_t color[4]; - vg_lite_float_t color1[4]; - vg_lite_float_t color2[4]; - vg_lite_float_t weight; - - /* Compute gradient for current color array entry. */ - gradient = (vg_lite_float_t)i / (vg_lite_float_t)(width - 1); - - /* Find the entry in the color ramp that matches or exceeds this - ** gradient. */ - while(gradient > colorRamp[stop].stop) { - ++stop; - } - - if(gradient == colorRamp[stop].stop) { - /* Perfect match weight 1.0. */ - weight = 1.0f; - - /* Use color ramp color. */ - color1[3] = colorRamp[stop].alpha; - color1[2] = colorRamp[stop].blue; - color1[1] = colorRamp[stop].green; - color1[0] = colorRamp[stop].red; - - color2[3] = color2[2] = color2[1] = color2[0] = 0.0f; - } - else { - /* Compute weight. */ - weight = (colorRamp[stop].stop - gradient) - / (colorRamp[stop].stop - colorRamp[stop - 1].stop); - - /* Grab color ramp color of previous stop. */ - color1[3] = colorRamp[stop - 1].alpha; - color1[2] = colorRamp[stop - 1].blue; - color1[1] = colorRamp[stop - 1].green; - color1[0] = colorRamp[stop - 1].red; - - /* Grab color ramp color of current stop. */ - color2[3] = colorRamp[stop].alpha; - color2[2] = colorRamp[stop].blue; - color2[1] = colorRamp[stop].green; - color2[0] = colorRamp[stop].red; - } - - if(grad->pre_multiplied) { - /* Pre-multiply the first color. */ - color1[2] *= color1[3]; - color1[1] *= color1[3]; - color1[0] *= color1[3]; - - /* Pre-multiply the second color. */ - color2[2] *= color2[3]; - color2[1] *= color2[3]; - color2[0] *= color2[3]; - } - - /* Filter the colors per channel. */ - color[3] = LERP(color1[3], color2[3], weight); - color[2] = LERP(color1[2], color2[2], weight); - color[1] = LERP(color1[1], color2[1], weight); - color[0] = LERP(color1[0], color2[0], weight); - - /* Pack the final color. */ - *bits++ = PackColorComponent(color[3]); - *bits++ = PackColorComponent(color[2]); - *bits++ = PackColorComponent(color[1]); - *bits++ = PackColorComponent(color[0]); - } - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_set_grad(vg_lite_linear_gradient_t * grad, - vg_lite_uint32_t count, - vg_lite_uint32_t * colors, - vg_lite_uint32_t * stops) - { - vg_lite_uint32_t i; - - grad->count = 0; /* Opaque B&W gradient */ - if(!count || count > VLC_MAX_GRADIENT_STOPS || colors == NULL || stops == NULL) - return VG_LITE_SUCCESS; - - /* Check stops validity */ - for(i = 0; i < count; i++) - if(stops[i] < VLC_GRADIENT_BUFFER_WIDTH) { - if(!grad->count || stops[i] > grad->stops[grad->count - 1]) { - grad->stops[grad->count] = stops[i]; - grad->colors[grad->count] = colors[i]; - grad->count++; - } - else if(stops[i] == grad->stops[grad->count - 1]) { - /* Equal stops : use the color corresponding to the last stop - in the sequence */ - grad->colors[grad->count - 1] = colors[i]; - } - } - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_update_grad(vg_lite_linear_gradient_t * grad) - { - vg_lite_error_t error = VG_LITE_SUCCESS; - int32_t r0, g0, b0, a0; - int32_t r1, g1, b1, a1; - int32_t lr, lg, lb, la; - vg_lite_uint32_t i; - int32_t j; - int32_t ds, dr, dg, db, da; - vg_lite_uint32_t * buffer = (vg_lite_uint32_t *)grad->image.memory; - - if(grad->count == 0) { - /* If no valid stops have been specified (e.g., due to an empty input - * array, out-of-range, or out-of-order stops), a stop at 0 with color - * 0xFF000000 (opaque black) and a stop at 255 with color 0xFFFFFFFF - * (opaque white) are implicitly defined. */ - grad->stops[0] = 0; - grad->colors[0] = 0xFF000000; /* Opaque black */ - grad->stops[1] = 255; - grad->colors[1] = 0xFFFFFFFF; /* Opaque white */ - grad->count = 2; - } - else if(grad->count && grad->stops[0] != 0) { - /* If at least one valid stop has been specified, but none has been - * defined with an offset of 0, an implicit stop is added with an - * offset of 0 and the same color as the first user-defined stop. */ - for(i = 0; i < grad->stops[0]; i++) - buffer[i] = grad->colors[0]; - } - a0 = A(grad->colors[0]); - r0 = R(grad->colors[0]); - g0 = G(grad->colors[0]); - b0 = B(grad->colors[0]); - - /* Calculate the colors for each pixel of the image. */ - for(i = 0; i < grad->count - 1; i++) { - buffer[grad->stops[i]] = grad->colors[i]; - ds = grad->stops[i + 1] - grad->stops[i]; - a1 = A(grad->colors[i + 1]); - r1 = R(grad->colors[i + 1]); - g1 = G(grad->colors[i + 1]); - b1 = B(grad->colors[i + 1]); - - da = a1 - a0; - dr = r1 - r0; - dg = g1 - g0; - db = b1 - b0; - - for(j = 1; j < ds; j++) { - la = a0 + da * j / ds; - lr = r0 + dr * j / ds; - lg = g0 + dg * j / ds; - lb = b0 + db * j / ds; - - buffer[grad->stops[i] + j] = ARGB(la, lr, lg, lb); - } - - a0 = a1; - r0 = r1; - g0 = g1; - b0 = b1; - } - - /* If at least one valid stop has been specified, but none has been defined - * with an offset of 255, an implicit stop is added with an offset of 255 - * and the same color as the last user-defined stop. */ - for(i = grad->stops[grad->count - 1]; i < VLC_GRADIENT_BUFFER_WIDTH; i++) - buffer[i] = grad->colors[grad->count - 1]; - - return error; - } - - vg_lite_error_t vg_lite_clear_linear_grad(vg_lite_ext_linear_gradient_t * grad) - { - vg_lite_error_t error = VG_LITE_SUCCESS; - - grad->count = 0; - /* Release the image resource. */ - if(grad->image.handle != NULL) { - error = vg_lite_free(&grad->image); - } - - return error; - } - - vg_lite_error_t vg_lite_clear_grad(vg_lite_linear_gradient_t * grad) - { - vg_lite_error_t error = VG_LITE_SUCCESS; - - grad->count = 0; - /* Release the image resource. */ - if(grad->image.handle != NULL) { - error = vg_lite_free(&grad->image); - } - - return error; - } - - vg_lite_error_t vg_lite_clear_radial_grad(vg_lite_radial_gradient_t * grad) - { - vg_lite_error_t error = VG_LITE_SUCCESS; - - grad->count = 0; - /* Release the image resource. */ - if(grad->image.handle != NULL) { - error = vg_lite_free(&grad->image); - } - - return error; - } - - vg_lite_matrix_t * vg_lite_get_linear_grad_matrix(vg_lite_ext_linear_gradient_t * grad) - { - return &grad->matrix; - } - - vg_lite_matrix_t * vg_lite_get_grad_matrix(vg_lite_linear_gradient_t * grad) - { - return &grad->matrix; - } - - vg_lite_matrix_t * vg_lite_get_radial_grad_matrix(vg_lite_radial_gradient_t * grad) - { - return &grad->matrix; - } - - vg_lite_error_t vg_lite_draw_grad(vg_lite_buffer_t * target, - vg_lite_path_t * path, - vg_lite_fill_t fill_rule, - vg_lite_matrix_t * matrix, - vg_lite_linear_gradient_t * grad, - vg_lite_blend_t blend) - { - auto ctx = vg_lite_ctx::get_instance(); - TVG_CHECK_RETURN_VG_ERROR(canvas_set_target(ctx, target)); - - auto shape = Shape::gen(); - TVG_CHECK_RETURN_VG_ERROR(shape_append_path(shape, path, matrix)); - TVG_CHECK_RETURN_VG_ERROR(shape->transform(matrix_conv(matrix))); - TVG_CHECK_RETURN_VG_ERROR(shape->fill(fill_rule_conv(fill_rule));); - TVG_CHECK_RETURN_VG_ERROR(shape->blend(blend_method_conv(blend))); - - vg_lite_matrix_t grad_matrix; - vg_lite_identity(&grad_matrix); - vg_lite_matrix_inverse(&grad_matrix, matrix); - vg_lite_matrix_multiply(&grad_matrix, &grad->matrix); - - vg_lite_fpoint_t p1 = {0.0f, 0.0f}; - vg_lite_fpoint_t p2 = {1.0f, 0}; - - vg_lite_fpoint_t p1_trans = p1; - vg_lite_fpoint_t p2_trans = p2; - - p1_trans = matrix_transform_point(&grad_matrix, &p1); - p2_trans = matrix_transform_point(&grad_matrix, &p2); - float dx = (p2_trans.x - p1_trans.x); - float dy = (p2_trans.y - p1_trans.y); - float scale = sqrtf(dx * dx + dy * dy); - float angle = (float)(atan2f(dy, dx)); - float dlen = 256 * scale; - float x_min = grad_matrix.m[0][2]; - float y_min = grad_matrix.m[1][2]; - float x_max = x_min + dlen * cosf(angle); - float y_max = y_min + dlen * sinf(angle); - LV_LOG_TRACE("linear gradient {%.2f, %.2f} ~ {%.2f, %.2f}", x_min, y_min, x_max, y_max); - auto linearGrad = LinearGradient::gen(); - TVG_CHECK_RETURN_VG_ERROR(linearGrad->linear(x_min, y_min, x_max, y_max)); - TVG_CHECK_RETURN_VG_ERROR(linearGrad->spread(FillSpread::Pad)); - - tvg::Fill::ColorStop colorStops[VLC_MAX_GRADIENT_STOPS]; - for(vg_lite_uint32_t i = 0; i < grad->count; i++) { - colorStops[i].offset = grad->stops[i] / 255.0f; - colorStops[i].r = R(grad->colors[i]); - colorStops[i].g = G(grad->colors[i]); - colorStops[i].b = B(grad->colors[i]); - colorStops[i].a = A(grad->colors[i]); - } - TVG_CHECK_RETURN_VG_ERROR(linearGrad->colorStops(colorStops, grad->count)); - - TVG_CHECK_RETURN_VG_ERROR(shape->fill(std::move(linearGrad))); - TVG_CHECK_RETURN_VG_ERROR(ctx->canvas->push(std::move(shape))); - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_draw_radial_grad(vg_lite_buffer_t * target, - vg_lite_path_t * path, - vg_lite_fill_t fill_rule, - vg_lite_matrix_t * path_matrix, - vg_lite_radial_gradient_t * grad, - vg_lite_color_t paint_color, - vg_lite_blend_t blend, - vg_lite_filter_t filter) - { - LV_UNUSED(paint_color); - LV_UNUSED(filter); - - auto ctx = vg_lite_ctx::get_instance(); - TVG_CHECK_RETURN_VG_ERROR(canvas_set_target(ctx, target)); - - auto shape = Shape::gen(); - TVG_CHECK_RETURN_VG_ERROR(shape_append_path(shape, path, path_matrix)); - TVG_CHECK_RETURN_VG_ERROR(shape->transform(matrix_conv(path_matrix))); - TVG_CHECK_RETURN_VG_ERROR(shape->fill(fill_rule_conv(fill_rule));); - TVG_CHECK_RETURN_VG_ERROR(shape->blend(blend_method_conv(blend))); - - auto radialGrad = RadialGradient::gen(); - TVG_CHECK_RETURN_VG_ERROR(radialGrad->transform(matrix_conv(&grad->matrix))); - TVG_CHECK_RETURN_VG_ERROR(radialGrad->radial(grad->radial_grad.cx, grad->radial_grad.cy, grad->radial_grad.r)); - TVG_CHECK_RETURN_VG_ERROR(radialGrad->spread(fill_spread_conv(grad->spread_mode))); - - tvg::Fill::ColorStop colorStops[VLC_MAX_COLOR_RAMP_STOPS]; - for(vg_lite_uint32_t i = 0; i < grad->ramp_length; i++) { - colorStops[i].offset = grad->color_ramp[i].stop; - colorStops[i].r = grad->color_ramp[i].red * 255.0f; - colorStops[i].g = grad->color_ramp[i].green * 255.0f; - colorStops[i].b = grad->color_ramp[i].blue * 255.0f; - colorStops[i].a = grad->color_ramp[i].alpha * 255.0f; - } - TVG_CHECK_RETURN_VG_ERROR(radialGrad->colorStops(colorStops, grad->ramp_length)); - - TVG_CHECK_RETURN_VG_ERROR(shape->fill(std::move(radialGrad))); - TVG_CHECK_RETURN_VG_ERROR(ctx->canvas->push(std::move(shape))); - - return VG_LITE_SUCCESS; - } - - vg_lite_error_t vg_lite_set_command_buffer_size(vg_lite_uint32_t size) - { - LV_UNUSED(size); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_set_scissor(int32_t x, int32_t y, int32_t right, int32_t bottom) - { - LV_UNUSED(x); - LV_UNUSED(y); - LV_UNUSED(right); - LV_UNUSED(bottom); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_enable_scissor(void) - { - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_disable_scissor(void) - { - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_get_mem_size(vg_lite_uint32_t * size) - { - *size = 0; - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_source_global_alpha(vg_lite_global_alpha_t alpha_mode, uint8_t alpha_value) - { - LV_UNUSED(alpha_mode); - LV_UNUSED(alpha_value); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_dest_global_alpha(vg_lite_global_alpha_t alpha_mode, uint8_t alpha_value) - { - LV_UNUSED(alpha_mode); - LV_UNUSED(alpha_value); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_set_color_key(vg_lite_color_key4_t colorkey) - { - LV_UNUSED(colorkey); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_set_flexa_stream_id(uint8_t stream_id) - { - LV_UNUSED(stream_id); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_set_flexa_current_background_buffer(uint8_t stream_id, - vg_lite_buffer_t * buffer, - vg_lite_uint32_t background_segment_count, - vg_lite_uint32_t background_segment_size) - { - LV_UNUSED(stream_id); - LV_UNUSED(buffer); - LV_UNUSED(background_segment_count); - LV_UNUSED(background_segment_size); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_enable_flexa(void) - { - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_disable_flexa(void) - { - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_set_flexa_stop_frame(void) - { - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_enable_dither(void) - { - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_disable_dither(void) - { - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_set_tess_buffer(vg_lite_uint32_t physical, vg_lite_uint32_t size) - { - LV_UNUSED(physical); - LV_UNUSED(size); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_set_command_buffer(vg_lite_uint32_t physical, vg_lite_uint32_t size) - { - LV_UNUSED(physical); - LV_UNUSED(size); - return VG_LITE_NOT_SUPPORT; - } - - vg_lite_error_t vg_lite_get_parameter(vg_lite_param_type_t type, - vg_lite_int32_t count, - vg_lite_float_t * params) - { - switch(type) { - case VG_LITE_GPU_IDLE_STATE: - if(count != 1 || params == NULL) { - return VG_LITE_INVALID_ARGUMENT; - } - - *(vg_lite_uint32_t *)params = 1; - return VG_LITE_SUCCESS; - - default: - break; - } - - return VG_LITE_NOT_SUPPORT; - } -} /* extern "C" */ - -/********************** - * STATIC FUNCTIONS - **********************/ - -static vg_lite_error_t vg_lite_error_conv(Result result) -{ - switch(result) { - case Result::Success: - return VG_LITE_SUCCESS; - - case Result::InvalidArguments: - return VG_LITE_INVALID_ARGUMENT; - - case Result::InsufficientCondition: - return VG_LITE_OUT_OF_RESOURCES; - - case Result::FailedAllocation: - return VG_LITE_OUT_OF_MEMORY; - - case Result::NonSupport: - return VG_LITE_NOT_SUPPORT; - - default: - break; - } - - return VG_LITE_TIMEOUT; -} - -static Matrix matrix_conv(const vg_lite_matrix_t * matrix) -{ - return *(Matrix *)matrix; -} - -static FillRule fill_rule_conv(vg_lite_fill_t fill) -{ - if(fill == VG_LITE_FILL_EVEN_ODD) { - return FillRule::EvenOdd; - } - - return FillRule::Winding; -} - -static BlendMethod blend_method_conv(vg_lite_blend_t blend) -{ - switch(blend) { - case VG_LITE_BLEND_NONE: - return BlendMethod::SrcOver; - - case VG_LITE_BLEND_NORMAL_LVGL: - return BlendMethod::Normal; - - case VG_LITE_BLEND_SRC_OVER: - return BlendMethod::Normal; - - case VG_LITE_BLEND_SCREEN: - return BlendMethod::Screen; - - case VG_LITE_BLEND_ADDITIVE: - return BlendMethod::Add; - - case VG_LITE_BLEND_MULTIPLY: - return BlendMethod::Multiply; - - default: - break; - } - - return BlendMethod::Normal; -} - -static StrokeCap stroke_cap_conv(vg_lite_cap_style_t cap) -{ - switch(cap) { - case VG_LITE_CAP_SQUARE: - return StrokeCap::Square; - case VG_LITE_CAP_ROUND: - return StrokeCap::Round; - case VG_LITE_CAP_BUTT: - return StrokeCap::Butt; - default: - break; - } - - return StrokeCap::Square; -} - -static StrokeJoin stroke_join_conv(vg_lite_join_style_t join) -{ - switch(join) { - case VG_LITE_JOIN_BEVEL: - return StrokeJoin::Bevel; - case VG_LITE_JOIN_ROUND: - return StrokeJoin::Round; - case VG_LITE_JOIN_MITER: - return StrokeJoin::Miter; - default: - break; - } - - return StrokeJoin::Bevel; -} - -static FillSpread fill_spread_conv(vg_lite_gradient_spreadmode_t spread) -{ - switch(spread) { - case VG_LITE_GRADIENT_SPREAD_PAD: - return FillSpread::Pad; - case VG_LITE_GRADIENT_SPREAD_REPEAT: - return FillSpread::Repeat; - case VG_LITE_GRADIENT_SPREAD_REFLECT: - return FillSpread::Reflect; - default: - return FillSpread::Pad; - } -} - -static float vlc_get_arg(const void * data, vg_lite_format_t format) -{ - switch(format) { - case VG_LITE_S8: - return *((int8_t *)data); - - case VG_LITE_S16: - return *((int16_t *)data); - - case VG_LITE_S32: - return *((int32_t *)data); - - case VG_LITE_FP32: - return *((float *)data); - - default: - LV_LOG_ERROR("UNKNOW_FORMAT: %d", format); - break; - } - - return 0; -} - -static uint8_t vlc_format_len(vg_lite_format_t format) -{ - switch(format) { - case VG_LITE_S8: - return 1; - case VG_LITE_S16: - return 2; - case VG_LITE_S32: - return 4; - case VG_LITE_FP32: - return 4; - default: - LV_LOG_ERROR("UNKNOW_FORMAT: %d", format); - LV_ASSERT(false); - break; - } - - return 0; -} - -static uint8_t vlc_op_arg_len(uint8_t vlc_op) -{ - switch(vlc_op) { - VLC_OP_ARG_LEN(END, 0); - VLC_OP_ARG_LEN(CLOSE, 0); - VLC_OP_ARG_LEN(MOVE, 2); - VLC_OP_ARG_LEN(MOVE_REL, 2); - VLC_OP_ARG_LEN(LINE, 2); - VLC_OP_ARG_LEN(LINE_REL, 2); - VLC_OP_ARG_LEN(QUAD, 4); - VLC_OP_ARG_LEN(QUAD_REL, 4); - VLC_OP_ARG_LEN(CUBIC, 6); - VLC_OP_ARG_LEN(CUBIC_REL, 6); - VLC_OP_ARG_LEN(SCCWARC, 5); - VLC_OP_ARG_LEN(SCCWARC_REL, 5); - VLC_OP_ARG_LEN(SCWARC, 5); - VLC_OP_ARG_LEN(SCWARC_REL, 5); - VLC_OP_ARG_LEN(LCCWARC, 5); - VLC_OP_ARG_LEN(LCCWARC_REL, 5); - VLC_OP_ARG_LEN(LCWARC, 5); - VLC_OP_ARG_LEN(LCWARC_REL, 5); - default: - LV_LOG_ERROR("UNKNOW_VLC_OP: 0x%x", vlc_op); - LV_ASSERT(false); - break; - } - - return 0; -} - -static Result shape_set_stroke(std::unique_ptr & shape, const vg_lite_path_t * path) -{ - switch(path->path_type) { - case VG_LITE_DRAW_ZERO: - case VG_LITE_DRAW_FILL_PATH: - /* if path is not a stroke, return */ - return Result::Success; - - case VG_LITE_DRAW_STROKE_PATH: - case VG_LITE_DRAW_FILL_STROKE_PATH: - break; - - default: - LV_LOG_ERROR("unknown path type: %d", path->path_type); - return Result::InvalidArguments; - } - - LV_ASSERT_NULL(path->stroke); - TVG_CHECK_RETURN_RESULT(shape->stroke(path->stroke->line_width)); - TVG_CHECK_RETURN_RESULT(shape->strokeMiterlimit(path->stroke->miter_limit)); - TVG_CHECK_RETURN_RESULT(shape->stroke(stroke_cap_conv(path->stroke->cap_style))); - TVG_CHECK_RETURN_RESULT(shape->stroke(stroke_join_conv(path->stroke->join_style))); - TVG_CHECK_RETURN_RESULT(shape->stroke(TVG_COLOR(path->stroke_color))); - - if(path->stroke->pattern_count) { - LV_ASSERT_NULL(path->stroke->dash_pattern); - TVG_CHECK_RETURN_RESULT(shape->stroke(path->stroke->dash_pattern, path->stroke->pattern_count)); - } - - return Result::Success; -} - -static Result shape_append_path(std::unique_ptr & shape, vg_lite_path_t * path, vg_lite_matrix_t * matrix) -{ - uint8_t fmt_len = vlc_format_len(path->format); - uint8_t * cur = (uint8_t *)path->path; - uint8_t * end = cur + path->path_length; - - while(cur < end) { - /* get op code */ - uint8_t op_code = VLC_GET_OP_CODE(cur); - - /* get arguments length */ - uint8_t arg_len = vlc_op_arg_len(op_code); - - /* skip op code */ - cur += fmt_len; - - switch(op_code) { - case VLC_OP_MOVE: { - float x = VLC_GET_ARG(cur, 0); - float y = VLC_GET_ARG(cur, 1); - TVG_CHECK_RETURN_RESULT(shape->moveTo(x, y)); - } - break; - - case VLC_OP_LINE: { - float x = VLC_GET_ARG(cur, 0); - float y = VLC_GET_ARG(cur, 1); - TVG_CHECK_RETURN_RESULT(shape->lineTo(x, y)); - } - break; - - case VLC_OP_QUAD: { - /* hack pre point */ - float qcx0 = VLC_GET_ARG(cur, -3); - float qcy0 = VLC_GET_ARG(cur, -2); - float qcx1 = VLC_GET_ARG(cur, 0); - float qcy1 = VLC_GET_ARG(cur, 1); - float x = VLC_GET_ARG(cur, 2); - float y = VLC_GET_ARG(cur, 3); - - qcx0 += (qcx1 - qcx0) * 2 / 3; - qcy0 += (qcy1 - qcy0) * 2 / 3; - qcx1 = x + (qcx1 - x) * 2 / 3; - qcy1 = y + (qcy1 - y) * 2 / 3; - - TVG_CHECK_RETURN_RESULT(shape->cubicTo(qcx0, qcy0, qcx1, qcy1, x, y)); - } - break; - - case VLC_OP_CUBIC: { - float cx1 = VLC_GET_ARG(cur, 0); - float cy1 = VLC_GET_ARG(cur, 1); - float cx2 = VLC_GET_ARG(cur, 2); - float cy2 = VLC_GET_ARG(cur, 3); - float x = VLC_GET_ARG(cur, 4); - float y = VLC_GET_ARG(cur, 5); - TVG_CHECK_RETURN_RESULT(shape->cubicTo(cx1, cy1, cx2, cy2, x, y)); - } - break; - - case VLC_OP_CLOSE: - TVG_CHECK_RETURN_RESULT(shape->close()); - break; - - default: - break; - } - - cur += arg_len * fmt_len; - } - - float x_min = path->bounding_box[0]; - float y_min = path->bounding_box[1]; - float x_max = path->bounding_box[2]; - float y_max = path->bounding_box[3]; - - if(math_equal(x_min, FLT_MIN) && math_equal(y_min, FLT_MIN) - && math_equal(x_max, FLT_MAX) && math_equal(y_max, FLT_MAX)) { - return Result::Success; - } - - TVG_CHECK_RETURN_RESULT(shape_set_stroke(shape, path)); - - auto cilp = Shape::gen(); - TVG_CHECK_RETURN_RESULT(cilp->appendRect(x_min, y_min, x_max - x_min, y_max - y_min, 0, 0)); - TVG_CHECK_RETURN_RESULT(cilp->transform(matrix_conv(matrix))); - TVG_CHECK_RETURN_RESULT(shape->composite(std::move(cilp), CompositeMethod::ClipPath)); - - return Result::Success; -} - -static Result shape_append_rect(std::unique_ptr & shape, const vg_lite_buffer_t * target, - const vg_lite_rectangle_t * rect) -{ - if(rect) { - TVG_CHECK_RETURN_RESULT(shape->appendRect(rect->x, rect->y, rect->width, rect->height, 0, 0)); - } - else if(target) { - TVG_CHECK_RETURN_RESULT(shape->appendRect(0, 0, target->width, target->height, 0, 0)); - } - else { - return Result::InvalidArguments; - } - - return Result::Success; -} - -static Result canvas_set_target(vg_lite_ctx * ctx, vg_lite_buffer_t * target) -{ - void * tvg_target_buffer = nullptr; - - /* if target_buffer needs to be changed, finish current drawing */ - if(ctx->target_buffer && ctx->target_buffer != target->memory) { - vg_lite_finish(); - } - - ctx->target_buffer = target->memory; - ctx->target_format = target->format; - ctx->target_px_size = target->width * target->height; - - if(TVG_IS_VG_FMT_SUPPORT(target->format)) { - /* if target format is supported by VG, use target buffer directly */ - tvg_target_buffer = target->memory; - } - else { - /* if target format is not supported by VG, use internal buffer */ - tvg_target_buffer = ctx->get_temp_target_buffer(target->width, target->height); - } - - Result res = ctx->canvas->target( - (uint32_t *)tvg_target_buffer, - target->width, - target->width, - target->height, - SwCanvas::ARGB8888); - - return res; -} - -static vg_lite_uint32_t width_to_stride(vg_lite_uint32_t w, vg_lite_buffer_format_t color_format) -{ - if(vg_lite_query_feature(gcFEATURE_BIT_VG_16PIXELS_ALIGN)) { - w = VG_LITE_ALIGN(w, 16); - } - - vg_lite_uint32_t mul, div, align; - get_format_bytes(color_format, &mul, &div, &align); - return VG_LITE_ALIGN((w * mul / div), align); -} - -static bool decode_indexed_line( - vg_lite_buffer_format_t color_format, - const vg_lite_uint32_t * palette, - int32_t x, int32_t y, - int32_t w_px, const uint8_t * in, vg_lite_uint32_t * out) -{ - uint8_t px_size; - uint16_t mask; - - vg_lite_uint32_t w_byte = width_to_stride(w_px, color_format); - - in += w_byte * y; /*First pixel*/ - out += w_px * y; - - int8_t shift = 0; - switch(color_format) { - case VG_LITE_INDEX_1: - px_size = 1; - in += x / 8; /*8pixel per byte*/ - shift = 7 - (x & 0x7); - break; - case VG_LITE_INDEX_2: - px_size = 2; - in += x / 4; /*4pixel per byte*/ - shift = 6 - 2 * (x & 0x3); - break; - case VG_LITE_INDEX_4: - px_size = 4; - in += x / 2; /*2pixel per byte*/ - shift = 4 - 4 * (x & 0x1); - break; - case VG_LITE_INDEX_8: - px_size = 8; - in += x; - shift = 0; - break; - default: - LV_ASSERT(false); - return false; - } - - mask = (1 << px_size) - 1; /*E.g. px_size = 2; mask = 0x03*/ - - int32_t i; - for(i = 0; i < w_px; i++) { - uint8_t val_act = (*in >> shift) & mask; - out[i] = palette[val_act]; - - shift -= px_size; - if(shift < 0) { - shift = 8 - px_size; - in++; - } - } - return true; -} - -static Result picture_load(vg_lite_ctx * ctx, std::unique_ptr & picture, const vg_lite_buffer_t * source, - vg_lite_color_t color) -{ - vg_lite_uint32_t * image_buffer; - LV_ASSERT(VG_LITE_IS_ALIGNED(source->memory, LV_VG_LITE_THORVG_BUF_ADDR_ALIGN)); - -#if LV_VG_LITE_THORVG_16PIXELS_ALIGN - LV_ASSERT(VG_LITE_IS_ALIGNED(source->width, 16)); -#endif - - if(source->format == VG_LITE_BGRA8888 && source->image_mode == VG_LITE_NORMAL_IMAGE_MODE) { - image_buffer = (vg_lite_uint32_t *)source->memory; - } - else { - vg_lite_uint32_t width = source->width; - vg_lite_uint32_t height = source->height; - vg_lite_uint32_t px_size = width * height; - image_buffer = ctx->get_image_buffer(width, height); - - vg_lite_buffer_t target; - memset(&target, 0, sizeof(target)); - target.memory = image_buffer; - target.format = VG_LITE_BGRA8888; - target.width = width; - target.height = height; - target.stride = width_to_stride(width, target.format); - - switch(source->format) { - case VG_LITE_INDEX_1: - case VG_LITE_INDEX_2: - case VG_LITE_INDEX_4: - case VG_LITE_INDEX_8: { - const vg_lite_uint32_t * clut_colors = ctx->get_CLUT(source->format); - for(vg_lite_uint32_t y = 0; y < height; y++) { - decode_indexed_line(source->format, clut_colors, 0, y, width, (uint8_t *)source->memory, image_buffer); - } - } - break; - - case VG_LITE_A4: { - conv_alpha4_to_bgra8888.convert(&target, source, color); - } - break; - - case VG_LITE_A8: { - conv_alpha8_to_bgra8888.convert(&target, source, color); - } - break; - - case VG_LITE_BGRX8888: { - conv_bgrx8888_to_bgra8888.convert(&target, source); - } - break; - - case VG_LITE_BGR888: { - conv_bgr888_to_bgra8888.convert(&target, source); - } - break; - - case VG_LITE_BGRA5658: { - conv_bgra5658_to_bgra8888.convert(&target, source); - } - break; - - case VG_LITE_BGR565: { - conv_bgr565_to_bgra8888.convert(&target, source); - } - break; - -#if LV_VG_LITE_THORVG_YUV_SUPPORT - case VG_LITE_NV12: { - libyuv::NV12ToARGB((const uint8_t *)source->memory, source->stride, (const uint8_t *)source->yuv.uv_memory, - source->yuv.uv_stride, - (uint8_t *)image_buffer, source->width * sizeof(vg_lite_uint32_t), width, height); - } - break; -#endif - - case VG_LITE_BGRA8888: { - memcpy(image_buffer, source->memory, px_size * sizeof(vg_color32_t)); - } - break; - - default: - LV_LOG_ERROR("unsupported format: %d", source->format); - LV_ASSERT(false); - break; - } - - /* multiply color */ - if(source->image_mode == VG_LITE_MULTIPLY_IMAGE_MODE && !VG_LITE_IS_ALPHA_FORMAT(source->format)) { - vg_color32_t * dest = (vg_color32_t *)image_buffer; - while(px_size--) { - dest->alpha = UDIV255(dest->alpha * A(color)); - dest->red = UDIV255(dest->red * B(color)); - dest->green = UDIV255(dest->green * G(color)); - dest->blue = UDIV255(dest->blue * R(color)); - dest++; - } - } - } - - TVG_CHECK_RETURN_RESULT(picture->load((uint32_t *)image_buffer, source->width, source->height, true)); - - return Result::Success; -} - -static void ClampColor(FLOATVECTOR4 Source, FLOATVECTOR4 Target, uint8_t Premultiplied) -{ - vg_lite_float_t colorMax; - /* Clamp the alpha channel. */ - Target[3] = CLAMP(Source[3], 0.0f, 1.0f); - - /* Determine the maximum value for the color channels. */ - colorMax = Premultiplied ? Target[3] : 1.0f; - - /* Clamp the color channels. */ - Target[0] = CLAMP(Source[0], 0.0f, colorMax); - Target[1] = CLAMP(Source[1], 0.0f, colorMax); - Target[2] = CLAMP(Source[2], 0.0f, colorMax); -} - -static uint8_t PackColorComponent(vg_lite_float_t value) -{ - /* Compute the rounded normalized value. */ - vg_lite_float_t rounded = value * 255.0f + 0.5f; - - /* Get the integer part. */ - int32_t roundedInt = (int32_t)rounded; - - /* Clamp to 0..1 range. */ - uint8_t clamped = (uint8_t)CLAMP(roundedInt, 0, 255); - - /* Return result. */ - return clamped; -} - -/* Get the bpp information of a color format. */ -static void get_format_bytes(vg_lite_buffer_format_t format, - vg_lite_uint32_t * mul, - vg_lite_uint32_t * div, - vg_lite_uint32_t * bytes_align) -{ - *mul = *div = 1; - *bytes_align = 4; - switch(format) { - case VG_LITE_L8: - case VG_LITE_A8: - case VG_LITE_RGBA8888_ETC2_EAC: - break; - - case VG_LITE_A4: - *div = 2; - break; - - case VG_LITE_ABGR1555: - case VG_LITE_ARGB1555: - case VG_LITE_BGRA5551: - case VG_LITE_RGBA5551: - case VG_LITE_RGBA4444: - case VG_LITE_BGRA4444: - case VG_LITE_ABGR4444: - case VG_LITE_ARGB4444: - case VG_LITE_RGB565: - case VG_LITE_BGR565: - case VG_LITE_YUYV: - case VG_LITE_YUY2: - case VG_LITE_YUY2_TILED: - /* AYUY2 buffer memory = YUY2 + alpha. */ - case VG_LITE_AYUY2: - case VG_LITE_AYUY2_TILED: - /* ABGR8565_PLANAR buffer memory = RGB565 + alpha. */ - case VG_LITE_ABGR8565_PLANAR: - case VG_LITE_ARGB8565_PLANAR: - case VG_LITE_RGBA5658_PLANAR: - case VG_LITE_BGRA5658_PLANAR: - *mul = 2; - break; - - case VG_LITE_RGBA8888: - case VG_LITE_BGRA8888: - case VG_LITE_ABGR8888: - case VG_LITE_ARGB8888: - case VG_LITE_RGBX8888: - case VG_LITE_BGRX8888: - case VG_LITE_XBGR8888: - case VG_LITE_XRGB8888: - *mul = 4; - break; - - case VG_LITE_NV12: - case VG_LITE_NV12_TILED: - *mul = 3; - break; - - case VG_LITE_ANV12: - case VG_LITE_ANV12_TILED: - *mul = 4; - break; - - case VG_LITE_INDEX_1: - *div = 8; - *bytes_align = 8; - break; - - case VG_LITE_INDEX_2: - *div = 4; - *bytes_align = 8; - break; - - case VG_LITE_INDEX_4: - *div = 2; - *bytes_align = 8; - break; - - case VG_LITE_INDEX_8: - *bytes_align = 1; - break; - - case VG_LITE_RGBA2222: - case VG_LITE_BGRA2222: - case VG_LITE_ABGR2222: - case VG_LITE_ARGB2222: - *mul = 1; - break; - - case VG_LITE_RGB888: - case VG_LITE_BGR888: - case VG_LITE_ABGR8565: - case VG_LITE_BGRA5658: - case VG_LITE_ARGB8565: - case VG_LITE_RGBA5658: - *mul = 3; - break; - - /* OpenVG format*/ - case VG_sRGBX_8888: - case VG_sRGBA_8888: - case VG_sRGBA_8888_PRE: - case VG_lRGBX_8888: - case VG_lRGBA_8888: - case VG_lRGBA_8888_PRE: - case VG_sXRGB_8888: - case VG_sARGB_8888: - case VG_sARGB_8888_PRE: - case VG_lXRGB_8888: - case VG_lARGB_8888: - case VG_lARGB_8888_PRE: - case VG_sBGRX_8888: - case VG_sBGRA_8888: - case VG_sBGRA_8888_PRE: - case VG_lBGRX_8888: - case VG_lBGRA_8888: - case VG_sXBGR_8888: - case VG_sABGR_8888: - case VG_lBGRA_8888_PRE: - case VG_sABGR_8888_PRE: - case VG_lXBGR_8888: - case VG_lABGR_8888: - case VG_lABGR_8888_PRE: - *mul = 4; - break; - - case VG_sRGBA_5551: - case VG_sRGBA_4444: - case VG_sARGB_1555: - case VG_sARGB_4444: - case VG_sBGRA_5551: - case VG_sBGRA_4444: - case VG_sABGR_1555: - case VG_sABGR_4444: - case VG_sRGB_565: - case VG_sBGR_565: - *mul = 2; - break; - - case VG_sL_8: - case VG_lL_8: - case VG_A_8: - break; - - case VG_BW_1: - case VG_A_4: - case VG_A_1: - *div = 2; - break; - - default: - break; - } -} - -static vg_lite_fpoint_t matrix_transform_point(const vg_lite_matrix_t * matrix, const vg_lite_fpoint_t * point) -{ - vg_lite_fpoint_t p; - p.x = (vg_lite_float_t)(point->x * matrix->m[0][0] + point->y * matrix->m[0][1] + matrix->m[0][2]); - p.y = (vg_lite_float_t)(point->x * matrix->m[1][0] + point->y * matrix->m[1][1] + matrix->m[1][2]); - return p; -} - -static bool vg_lite_matrix_inverse(vg_lite_matrix_t * result, const vg_lite_matrix_t * matrix) -{ - vg_lite_float_t det00, det01, det02; - vg_lite_float_t d; - bool is_affine; - - /* Test for identity matrix. */ - if(matrix == NULL) { - result->m[0][0] = 1.0f; - result->m[0][1] = 0.0f; - result->m[0][2] = 0.0f; - result->m[1][0] = 0.0f; - result->m[1][1] = 1.0f; - result->m[1][2] = 0.0f; - result->m[2][0] = 0.0f; - result->m[2][1] = 0.0f; - result->m[2][2] = 1.0f; - - /* Success. */ - return true; - } - - det00 = (matrix->m[1][1] * matrix->m[2][2]) - (matrix->m[2][1] * matrix->m[1][2]); - det01 = (matrix->m[2][0] * matrix->m[1][2]) - (matrix->m[1][0] * matrix->m[2][2]); - det02 = (matrix->m[1][0] * matrix->m[2][1]) - (matrix->m[2][0] * matrix->m[1][1]); - - /* Compute determinant. */ - d = (matrix->m[0][0] * det00) + (matrix->m[0][1] * det01) + (matrix->m[0][2] * det02); - - /* Return 0 if there is no inverse matrix. */ - if(d == 0.0f) - return false; - - /* Compute reciprocal. */ - d = 1.0f / d; - - /* Determine if the matrix is affine. */ - is_affine = (matrix->m[2][0] == 0.0f) && (matrix->m[2][1] == 0.0f) && (matrix->m[2][2] == 1.0f); - - result->m[0][0] = d * det00; - result->m[0][1] = d * ((matrix->m[2][1] * matrix->m[0][2]) - (matrix->m[0][1] * matrix->m[2][2])); - result->m[0][2] = d * ((matrix->m[0][1] * matrix->m[1][2]) - (matrix->m[1][1] * matrix->m[0][2])); - result->m[1][0] = d * det01; - result->m[1][1] = d * ((matrix->m[0][0] * matrix->m[2][2]) - (matrix->m[2][0] * matrix->m[0][2])); - result->m[1][2] = d * ((matrix->m[1][0] * matrix->m[0][2]) - (matrix->m[0][0] * matrix->m[1][2])); - result->m[2][0] = is_affine ? 0.0f : d * det02; - result->m[2][1] = is_affine ? 0.0f : d * ((matrix->m[2][0] * matrix->m[0][1]) - (matrix->m[0][0] * matrix->m[2][1])); - result->m[2][2] = is_affine ? 1.0f : d * ((matrix->m[0][0] * matrix->m[1][1]) - (matrix->m[1][0] * matrix->m[0][1])); - - /* Success. */ - return true; -} - -static void vg_lite_matrix_multiply(vg_lite_matrix_t * matrix, const vg_lite_matrix_t * mult) -{ - vg_lite_matrix_t temp; - int row, column; - - /* Process all rows. */ - for(row = 0; row < 3; row++) { - /* Process all columns. */ - for(column = 0; column < 3; column++) { - /* Compute matrix entry. */ - temp.m[row][column] = (matrix->m[row][0] * mult->m[0][column]) - + (matrix->m[row][1] * mult->m[1][column]) - + (matrix->m[row][2] * mult->m[2][column]); - } - } - - /* Copy temporary matrix into result. */ - lv_memcpy(matrix->m, &temp.m, sizeof(temp.m)); -} - -#endif diff --git a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_mem_core_builtin.c b/L3_Middlewares/LVGL/src/stdlib/builtin/lv_mem_core_builtin.c deleted file mode 100644 index 23a2181..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_mem_core_builtin.c +++ /dev/null @@ -1,273 +0,0 @@ -/** - * @file lv_malloc_core.c - */ - -/********************* - * INCLUDES - *********************/ -#include "../lv_mem.h" -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN - -#include "lv_tlsf.h" -#include "../lv_string.h" -#include "../../misc/lv_assert.h" -#include "../../misc/lv_log.h" -#include "../../misc/lv_ll.h" -#include "../../misc/lv_math.h" -#include "../../osal/lv_os.h" -#include "../../core/lv_global.h" - -#ifdef LV_MEM_POOL_INCLUDE - #include LV_MEM_POOL_INCLUDE -#endif - -/********************* - * DEFINES - *********************/ -/*memset the allocated memories to 0xaa and freed memories to 0xbb (just for testing purposes)*/ -#ifndef LV_MEM_ADD_JUNK - #define LV_MEM_ADD_JUNK 0 -#endif - -#ifdef LV_ARCH_64 - #define MEM_UNIT uint64_t - #define ALIGN_MASK 0x7 -#else - #define MEM_UNIT uint32_t - #define ALIGN_MASK 0x3 -#endif -#define state LV_GLOBAL_DEFAULT()->tlsf_state - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_mem_walker(void * ptr, size_t size, int used, void * user); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ -#if LV_USE_LOG && LV_LOG_TRACE_MEM - #define LV_TRACE_MEM(...) LV_LOG_TRACE(__VA_ARGS__) -#else - #define LV_TRACE_MEM(...) -#endif - -#define _COPY(d, s) *d = *s; d++; s++; -#define _SET(d, v) *d = v; d++; -#define _REPEAT8(expr) expr expr expr expr expr expr expr expr - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_mem_init(void) -{ -#if LV_USE_OS - lv_mutex_init(&state.mutex); -#endif - -#if LV_MEM_ADR == 0 -#ifdef LV_MEM_POOL_ALLOC - state.tlsf = lv_tlsf_create_with_pool((void *)LV_MEM_POOL_ALLOC(LV_MEM_SIZE), LV_MEM_SIZE); -#else - /*Allocate a large array to store the dynamically allocated data*/ - static LV_ATTRIBUTE_LARGE_RAM_ARRAY MEM_UNIT work_mem_int[LV_MEM_SIZE / sizeof(MEM_UNIT)]; - state.tlsf = lv_tlsf_create_with_pool((void *)work_mem_int, LV_MEM_SIZE); -#endif -#else - state.tlsf = lv_tlsf_create_with_pool((void *)LV_MEM_ADR, LV_MEM_SIZE); -#endif - - lv_ll_init(&state.pool_ll, sizeof(lv_pool_t)); - - /*Record the first pool*/ - lv_pool_t * pool_p = lv_ll_ins_tail(&state.pool_ll); - LV_ASSERT_MALLOC(pool_p); - *pool_p = lv_tlsf_get_pool(state.tlsf); - -#if LV_MEM_ADD_JUNK - LV_LOG_WARN("LV_MEM_ADD_JUNK is enabled which makes LVGL much slower"); -#endif -} - -void lv_mem_deinit(void) -{ - lv_ll_clear(&state.pool_ll); - lv_tlsf_destroy(state.tlsf); -#if LV_USE_OS - lv_mutex_delete(&state.mutex); -#endif -} - -lv_mem_pool_t lv_mem_add_pool(void * mem, size_t bytes) -{ - lv_mem_pool_t new_pool = lv_tlsf_add_pool(state.tlsf, mem, bytes); - if(!new_pool) { - LV_LOG_WARN("failed to add memory pool, address: %p, size: %zu", mem, bytes); - return NULL; - } - - lv_pool_t * pool_p = lv_ll_ins_tail(&state.pool_ll); - LV_ASSERT_MALLOC(pool_p); - *pool_p = new_pool; - - return new_pool; -} - -void lv_mem_remove_pool(lv_mem_pool_t pool) -{ - lv_pool_t * pool_p; - LV_LL_READ(&state.pool_ll, pool_p) { - if(*pool_p == pool) { - lv_ll_remove(&state.pool_ll, pool_p); - lv_free(pool_p); - lv_tlsf_remove_pool(state.tlsf, pool); - return; - } - } - LV_LOG_WARN("invalid pool: %p", pool); -} - -void * lv_malloc_core(size_t size) -{ -#if LV_USE_OS - lv_mutex_lock(&state.mutex); -#endif - void * p = lv_tlsf_malloc(state.tlsf, size); - - if(p) { - state.cur_used += lv_tlsf_block_size(p); - state.max_used = LV_MAX(state.cur_used, state.max_used); - } - -#if LV_USE_OS - lv_mutex_unlock(&state.mutex); -#endif - return p; -} - -void * lv_realloc_core(void * p, size_t new_size) -{ -#if LV_USE_OS - lv_mutex_lock(&state.mutex); -#endif - - size_t old_size = lv_tlsf_block_size(p); - void * p_new = lv_tlsf_realloc(state.tlsf, p, new_size); - - if(p_new) { - state.cur_used -= old_size; - state.cur_used += lv_tlsf_block_size(p_new); - state.max_used = LV_MAX(state.cur_used, state.max_used); - } -#if LV_USE_OS - lv_mutex_unlock(&state.mutex); -#endif - - return p_new; -} - -void lv_free_core(void * p) -{ -#if LV_USE_OS - lv_mutex_lock(&state.mutex); -#endif - -#if LV_MEM_ADD_JUNK - lv_memset(p, 0xbb, lv_tlsf_block_size(data)); -#endif - size_t size = lv_tlsf_block_size(p); - lv_tlsf_free(state.tlsf, p); - if(state.cur_used > size) state.cur_used -= size; - else state.cur_used = 0; - -#if LV_USE_OS - lv_mutex_unlock(&state.mutex); -#endif -} - -void lv_mem_monitor_core(lv_mem_monitor_t * mon_p) -{ - /*Init the data*/ - lv_memzero(mon_p, sizeof(lv_mem_monitor_t)); - LV_TRACE_MEM("begin"); - - lv_pool_t * pool_p; - LV_LL_READ(&state.pool_ll, pool_p) { - lv_tlsf_walk_pool(*pool_p, lv_mem_walker, mon_p); - } - - mon_p->used_pct = 100 - (uint64_t)100U * mon_p->free_size / mon_p->total_size; - if(mon_p->free_size > 0) { - mon_p->frag_pct = (uint64_t)mon_p->free_biggest_size * 100U / mon_p->free_size; - mon_p->frag_pct = 100 - mon_p->frag_pct; - } - else { - mon_p->frag_pct = 0; /*no fragmentation if all the RAM is used*/ - } - - mon_p->max_used = state.max_used; - - LV_TRACE_MEM("finished"); -} - -lv_result_t lv_mem_test_core(void) -{ -#if LV_USE_OS - lv_mutex_lock(&state.mutex); -#endif - if(lv_tlsf_check(state.tlsf)) { - LV_LOG_WARN("failed"); -#if LV_USE_OS - lv_mutex_unlock(&state.mutex); -#endif - return LV_RESULT_INVALID; - } - - lv_pool_t * pool_p; - LV_LL_READ(&state.pool_ll, pool_p) { - if(lv_tlsf_check_pool(*pool_p)) { - LV_LOG_WARN("pool failed"); -#if LV_USE_OS - lv_mutex_unlock(&state.mutex); -#endif - return LV_RESULT_INVALID; - } - } - - LV_TRACE_MEM("passed"); -#if LV_USE_OS - lv_mutex_unlock(&state.mutex); -#endif - return LV_RESULT_OK; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_mem_walker(void * ptr, size_t size, int used, void * user) -{ - LV_UNUSED(ptr); - - lv_mem_monitor_t * mon_p = user; - mon_p->total_size += size; - if(used) { - mon_p->used_cnt++; - } - else { - mon_p->free_cnt++; - mon_p->free_size += size; - if(size > mon_p->free_biggest_size) - mon_p->free_biggest_size = size; - } -} -#endif /*LV_STDLIB_BUILTIN*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_string_builtin.c b/L3_Middlewares/LVGL/src/stdlib/builtin/lv_string_builtin.c deleted file mode 100644 index f225adc..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_string_builtin.c +++ /dev/null @@ -1,269 +0,0 @@ -/** - * @file lv_string.c - */ - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#if LV_USE_STDLIB_STRING == LV_STDLIB_BUILTIN -#include "../../misc/lv_assert.h" -#include "../../misc/lv_log.h" -#include "../../misc/lv_math.h" -#include "../../stdlib/lv_string.h" -#include "../../stdlib/lv_mem.h" - -/********************* - * DEFINES - *********************/ -#ifdef LV_ARCH_64 - #define MEM_UNIT uint64_t - #define ALIGN_MASK 0x7 -#else - #define MEM_UNIT uint32_t - #define ALIGN_MASK 0x3 -#endif - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ -#if LV_USE_LOG && LV_LOG_TRACE_MEM - #define LV_TRACE_MEM(...) LV_LOG_TRACE(__VA_ARGS__) -#else - #define LV_TRACE_MEM(...) -#endif - -#define _COPY(d, s) *d = *s; d++; s++; -#define _SET(d, v) *d = v; d++; -#define _REPEAT8(expr) expr expr expr expr expr expr expr expr - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void * LV_ATTRIBUTE_FAST_MEM lv_memcpy(void * dst, const void * src, size_t len) -{ - uint8_t * d8 = dst; - const uint8_t * s8 = src; - - /*Simplify for small memories*/ - if(len < 16) { - while(len) { - *d8 = *s8; - d8++; - s8++; - len--; - } - return dst; - } - - lv_uintptr_t d_align = (lv_uintptr_t)d8 & ALIGN_MASK; - lv_uintptr_t s_align = (lv_uintptr_t)s8 & ALIGN_MASK; - - /*Byte copy for unaligned memories*/ - if(s_align != d_align) { - while(len > 32) { - _REPEAT8(_COPY(d8, s8)); - _REPEAT8(_COPY(d8, s8)); - _REPEAT8(_COPY(d8, s8)); - _REPEAT8(_COPY(d8, s8)); - len -= 32; - } - while(len) { - _COPY(d8, s8) - len--; - } - return dst; - } - - /*Make the memories aligned*/ - if(d_align) { - d_align = ALIGN_MASK + 1 - d_align; - while(d_align && len) { - _COPY(d8, s8); - d_align--; - len--; - } - } - - uint32_t * d32 = (uint32_t *)d8; - const uint32_t * s32 = (uint32_t *)s8; - while(len > 32) { - _REPEAT8(_COPY(d32, s32)) - len -= 32; - } - - d8 = (uint8_t *)d32; - s8 = (const uint8_t *)s32; - while(len) { - _COPY(d8, s8) - len--; - } - - return dst; -} - -void LV_ATTRIBUTE_FAST_MEM lv_memset(void * dst, uint8_t v, size_t len) -{ - uint8_t * d8 = (uint8_t *)dst; - uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK; - - /*Make the address aligned*/ - if(d_align) { - d_align = ALIGN_MASK + 1 - d_align; - while(d_align && len) { - _SET(d8, v); - len--; - d_align--; - } - } - - uint32_t v32 = (uint32_t)v + ((uint32_t)v << 8) + ((uint32_t)v << 16) + ((uint32_t)v << 24); - uint32_t * d32 = (uint32_t *)d8; - - while(len > 32) { - _REPEAT8(_SET(d32, v32)); - len -= 32; - } - - d8 = (uint8_t *)d32; - while(len) { - _SET(d8, v); - len--; - } -} - -void * LV_ATTRIBUTE_FAST_MEM lv_memmove(void * dst, const void * src, size_t len) -{ - if(dst < src || (char *)dst > ((char *)src + len)) { - return lv_memcpy(dst, src, len); - } - - if(dst > src) { - char * tmp = (char *)dst + len - 1; - char * s = (char *)src + len - 1; - - while(len--) { - *tmp-- = *s--; - } - } - else { - char * tmp = (char *)dst; - char * s = (char *)src; - - while(len--) { - *tmp++ = *s++; - } - } - - return dst; -} - -int lv_memcmp(const void * p1, const void * p2, size_t len) -{ - const char * s1 = (const char *) p1; - const char * s2 = (const char *) p2; - while(--len > 0 && (*s1 == *s2)) { - s1++; - s2++; - } - return *s1 - *s2; -} - -/* See https://en.cppreference.com/w/c/string/byte/strlen for reference */ -size_t lv_strlen(const char * str) -{ - size_t i = 0; - while(str[i]) i++; - - return i; -} - -size_t lv_strlcpy(char * dst, const char * src, size_t dst_size) -{ - size_t i = 0; - if(dst_size > 0) { - for(; i < dst_size - 1 && src[i]; i++) { - dst[i] = src[i]; - } - dst[i] = '\0'; - } - while(src[i]) i++; - return i; -} - -char * lv_strncpy(char * dst, const char * src, size_t dst_size) -{ - size_t i; - for(i = 0; i < dst_size && src[i]; i++) { - dst[i] = src[i]; - } - for(; i < dst_size; i++) { - dst[i] = '\0'; - } - return dst; -} - -char * lv_strcpy(char * dst, const char * src) -{ - char * tmp = dst; - while((*dst++ = *src++) != '\0'); - return tmp; -} - -int lv_strcmp(const char * s1, const char * s2) -{ - while(*s1 && (*s1 == *s2)) { - s1++; - s2++; - } - return *(const unsigned char *)s1 - *(const unsigned char *)s2; -} - -char * lv_strdup(const char * src) -{ - size_t len = lv_strlen(src) + 1; - char * dst = lv_malloc(len); - if(dst == NULL) return NULL; - - lv_memcpy(dst, src, len); /*memcpy is faster than strncpy when length is known*/ - return dst; -} - -char * lv_strcat(char * dst, const char * src) -{ - lv_strcpy(dst + lv_strlen(dst), src); - return dst; -} - -char * lv_strncat(char * dst, const char * src, size_t src_len) -{ - char * tmp = dst; - while(*dst != '\0') { - dst++; - } - while(src_len != 0 && *src != '\0') { - src_len--; - *dst++ = *src++; - } - *dst = '\0'; - return tmp; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_STDLIB_BUILTIN*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_tlsf_private.h b/L3_Middlewares/LVGL/src/stdlib/builtin/lv_tlsf_private.h deleted file mode 100644 index 036e9d7..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/builtin/lv_tlsf_private.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file lv_tlsf_private.h - * - */ - -#ifndef LV_TLSF_PRIVATE_H -#define LV_TLSF_PRIVATE_H - -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_tlsf.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { -#if LV_USE_OS - lv_mutex_t mutex; -#endif - lv_tlsf_t tlsf; - size_t cur_used; - size_t max_used; - lv_ll_t pool_ll; -} lv_tlsf_state_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/ - -#endif /*LV_TLSF_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/clib/lv_mem_core_clib.c b/L3_Middlewares/LVGL/src/stdlib/clib/lv_mem_core_clib.c deleted file mode 100644 index 9cdddf4..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/clib/lv_mem_core_clib.c +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @file lv_malloc_core.c - */ - -/********************* - * INCLUDES - *********************/ -#include "../lv_mem.h" -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_CLIB -#include "../../stdlib/lv_mem.h" -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_mem_init(void) -{ - return; /*Nothing to init*/ -} - -void lv_mem_deinit(void) -{ - return; /*Nothing to deinit*/ - -} - -lv_mem_pool_t lv_mem_add_pool(void * mem, size_t bytes) -{ - /*Not supported*/ - LV_UNUSED(mem); - LV_UNUSED(bytes); - return NULL; -} - -void lv_mem_remove_pool(lv_mem_pool_t pool) -{ - /*Not supported*/ - LV_UNUSED(pool); - return; -} - -void * lv_malloc_core(size_t size) -{ - return malloc(size); -} - -void * lv_realloc_core(void * p, size_t new_size) -{ - return realloc(p, new_size); -} - -void lv_free_core(void * p) -{ - free(p); -} - -void lv_mem_monitor_core(lv_mem_monitor_t * mon_p) -{ - /*Not supported*/ - LV_UNUSED(mon_p); - return; -} - -lv_result_t lv_mem_test_core(void) -{ - /*Not supported*/ - return LV_RESULT_OK; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_STDLIB_CLIB*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/clib/lv_sprintf_clib.c b/L3_Middlewares/LVGL/src/stdlib/clib/lv_sprintf_clib.c deleted file mode 100644 index 4f4fb9c..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/clib/lv_sprintf_clib.c +++ /dev/null @@ -1,58 +0,0 @@ - -/** - * @file lv_templ.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#if LV_USE_STDLIB_SPRINTF == LV_STDLIB_CLIB -#include -#include -#include "../lv_sprintf.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -int lv_snprintf(char * buffer, size_t count, const char * format, ...) -{ - va_list va; - va_start(va, format); - const int ret = vsnprintf(buffer, count, format, va); - va_end(va); - return ret; -} - -int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va) -{ - return vsnprintf(buffer, count, format, va); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif diff --git a/L3_Middlewares/LVGL/src/stdlib/clib/lv_string_clib.c b/L3_Middlewares/LVGL/src/stdlib/clib/lv_string_clib.c deleted file mode 100644 index fd01b93..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/clib/lv_string_clib.c +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @file lv_string.c - */ - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#if LV_USE_STDLIB_STRING == LV_STDLIB_CLIB -#include "../lv_string.h" -#include "../lv_mem.h" /*Need lv_malloc*/ -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void * LV_ATTRIBUTE_FAST_MEM lv_memcpy(void * dst, const void * src, size_t len) -{ - return memcpy(dst, src, len); -} - -void LV_ATTRIBUTE_FAST_MEM lv_memset(void * dst, uint8_t v, size_t len) -{ - memset(dst, v, len); -} - -void * LV_ATTRIBUTE_FAST_MEM lv_memmove(void * dst, const void * src, size_t len) -{ - return memmove(dst, src, len); -} - -int lv_memcmp(const void * p1, const void * p2, size_t len) -{ - return memcmp(p1, p2, len); -} - -size_t lv_strlen(const char * str) -{ - return strlen(str); -} - -size_t lv_strlcpy(char * dst, const char * src, size_t dst_size) -{ - size_t src_len = strlen(src); - if(dst_size > 0) { - size_t copy_size = src_len < dst_size ? src_len : dst_size - 1; - memcpy(dst, src, copy_size); - dst[copy_size] = '\0'; - } - return src_len; -} - -char * lv_strncpy(char * dst, const char * src, size_t dest_size) -{ - return strncpy(dst, src, dest_size); -} - -char * lv_strcpy(char * dst, const char * src) -{ - return strcpy(dst, src); -} - -int lv_strcmp(const char * s1, const char * s2) -{ - return strcmp(s1, s2); -} - -char * lv_strdup(const char * src) -{ - /*strdup uses malloc, so use the lv_malloc when LV_USE_STDLIB_MALLOC is not LV_STDLIB_CLIB */ - size_t len = lv_strlen(src) + 1; - char * dst = lv_malloc(len); - if(dst == NULL) return NULL; - - lv_memcpy(dst, src, len); /*do memcpy is faster than strncpy when length is known*/ - return dst; -} - -char * lv_strcat(char * dst, const char * src) -{ - return strcat(dst, src); -} - -char * lv_strncat(char * dst, const char * src, size_t src_len) -{ - return strncat(dst, src, src_len); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_STDLIB_CLIB*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/lv_mem.c b/L3_Middlewares/LVGL/src/stdlib/lv_mem.c deleted file mode 100644 index bfc887f..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/lv_mem.c +++ /dev/null @@ -1,168 +0,0 @@ -/** - * @file lv_mem.c - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_mem_private.h" -#include "lv_string.h" -#include "../misc/lv_assert.h" -#include "../misc/lv_log.h" -#include "../core/lv_global.h" - -#if LV_USE_OS == LV_OS_PTHREAD - #include -#endif - -/********************* - * DEFINES - *********************/ -/*memset the allocated memories to 0xaa and freed memories to 0xbb (just for testing purposes)*/ -#ifndef LV_MEM_ADD_JUNK - #define LV_MEM_ADD_JUNK 0 -#endif - -#define zero_mem LV_GLOBAL_DEFAULT()->memory_zero - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ -void * lv_malloc_core(size_t size); -void * lv_realloc_core(void * p, size_t new_size); -void lv_free_core(void * p); -void lv_mem_monitor_core(lv_mem_monitor_t * mon_p); -lv_result_t lv_mem_test_core(void); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ -#if LV_USE_LOG && LV_LOG_TRACE_MEM - #define LV_TRACE_MEM(...) LV_LOG_TRACE(__VA_ARGS__) -#else - #define LV_TRACE_MEM(...) -#endif - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void * lv_malloc(size_t size) -{ - LV_TRACE_MEM("allocating %lu bytes", (unsigned long)size); - if(size == 0) { - LV_TRACE_MEM("using zero_mem"); - return &zero_mem; - } - - void * alloc = lv_malloc_core(size); - - if(alloc == NULL) { - LV_LOG_INFO("couldn't allocate memory (%lu bytes)", (unsigned long)size); -#if LV_LOG_LEVEL <= LV_LOG_LEVEL_INFO - lv_mem_monitor_t mon; - lv_mem_monitor(&mon); - LV_LOG_INFO("used: %zu (%3d %%), frag: %3d %%, biggest free: %zu", - mon.total_size - mon.free_size, mon.used_pct, mon.frag_pct, - mon.free_biggest_size); -#endif - return NULL; - } - -#if LV_MEM_ADD_JUNK - lv_memset(alloc, 0xaa, size); -#endif - - LV_TRACE_MEM("allocated at %p", alloc); - return alloc; -} - -void * lv_malloc_zeroed(size_t size) -{ - LV_TRACE_MEM("allocating %lu bytes", (unsigned long)size); - if(size == 0) { - LV_TRACE_MEM("using zero_mem"); - return &zero_mem; - } - - void * alloc = lv_malloc_core(size); - if(alloc == NULL) { - LV_LOG_INFO("couldn't allocate memory (%lu bytes)", (unsigned long)size); -#if LV_LOG_LEVEL <= LV_LOG_LEVEL_INFO - lv_mem_monitor_t mon; - lv_mem_monitor(&mon); - LV_LOG_INFO("used: %zu (%3d %%), frag: %3d %%, biggest free: %zu", - mon.total_size - mon.free_size, mon.used_pct, mon.frag_pct, - mon.free_biggest_size); -#endif - return NULL; - } - - lv_memzero(alloc, size); - - LV_TRACE_MEM("allocated at %p", alloc); - return alloc; -} - -void lv_free(void * data) -{ - LV_TRACE_MEM("freeing %p", data); - if(data == &zero_mem) return; - if(data == NULL) return; - - lv_free_core(data); -} - -void * lv_realloc(void * data_p, size_t new_size) -{ - LV_TRACE_MEM("reallocating %p with %lu size", data_p, (unsigned long)new_size); - if(new_size == 0) { - LV_TRACE_MEM("using zero_mem"); - lv_free(data_p); - return &zero_mem; - } - - if(data_p == &zero_mem) return lv_malloc(new_size); - - void * new_p = lv_realloc_core(data_p, new_size); - - if(new_p == NULL) { - LV_LOG_ERROR("couldn't reallocate memory"); - return NULL; - } - - LV_TRACE_MEM("reallocated at %p", new_p); - return new_p; -} - -lv_result_t lv_mem_test(void) -{ - if(zero_mem != ZERO_MEM_SENTINEL) { - LV_LOG_WARN("zero_mem is written"); - return LV_RESULT_INVALID; - } - - return lv_mem_test_core(); -} - -void lv_mem_monitor(lv_mem_monitor_t * mon_p) -{ - lv_memzero(mon_p, sizeof(lv_mem_monitor_t)); - lv_mem_monitor_core(mon_p); -} - -/********************** - * STATIC FUNCTIONS - **********************/ diff --git a/L3_Middlewares/LVGL/src/stdlib/lv_mem.h b/L3_Middlewares/LVGL/src/stdlib/lv_mem.h deleted file mode 100644 index 210c189..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/lv_mem.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - * @file lv_mem.h - * - */ - -#ifndef LV_MEM_H -#define LV_MEM_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_conf_internal.h" - -#include "lv_string.h" - -#include "../misc/lv_types.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef void * lv_mem_pool_t; - -/** - * Heap information structure. - */ -typedef struct { - size_t total_size; /**< Total heap size */ - size_t free_cnt; - size_t free_size; /**< Size of available memory */ - size_t free_biggest_size; - size_t used_cnt; - size_t max_used; /**< Max size of Heap memory used */ - uint8_t used_pct; /**< Percentage used */ - uint8_t frag_pct; /**< Amount of fragmentation */ -} lv_mem_monitor_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Initialize to use malloc/free/realloc etc - */ -void lv_mem_init(void); - -/** - * Drop all dynamically allocated memory and reset the memory pools' state - */ -void lv_mem_deinit(void); - -lv_mem_pool_t lv_mem_add_pool(void * mem, size_t bytes); - -void lv_mem_remove_pool(lv_mem_pool_t pool); - -/** - * Allocate memory dynamically - * @param size requested size in bytes - * @return pointer to allocated uninitialized memory, or NULL on failure - */ -void * lv_malloc(size_t size); - -/** - * Allocate zeroed memory dynamically - * @param size requested size in bytes - * @return pointer to allocated zeroed memory, or NULL on failure - */ -void * lv_malloc_zeroed(size_t size); - -/** - * Free an allocated data - * @param data pointer to an allocated memory - */ -void lv_free(void * data); - -/** - * Reallocate a memory with a new size. The old content will be kept. - * @param data_p pointer to an allocated memory. - * Its content will be copied to the new memory block and freed - * @param new_size the desired new size in byte - * @return pointer to the new memory, NULL on failure - */ -void * lv_realloc(void * data_p, size_t new_size); - -/** - * Used internally to execute a plain `malloc` operation - * @param size size in bytes to `malloc` - */ -void * lv_malloc_core(size_t size); - -/** - * Used internally to execute a plain `free` operation - * @param p memory address to free - */ -void lv_free_core(void * p); - -/** - * Used internally to execute a plain realloc operation - * @param p memory address to realloc - * @param new_size size in bytes to realloc - */ -void * lv_realloc_core(void * p, size_t new_size); - -/** - * Used internally by lv_mem_monitor() to gather LVGL heap state information. - * @param mon_p pointer to lv_mem_monitor_t object to be populated. - */ -void lv_mem_monitor_core(lv_mem_monitor_t * mon_p); - -lv_result_t lv_mem_test_core(void); - -/** - * @brief Tests the memory allocation system by allocating and freeing a block of memory. - * @return LV_RESULT_OK if the memory allocation system is working properly, or LV_RESULT_INVALID if there is an error. - */ -lv_result_t lv_mem_test(void); - -/** - * Give information about the work memory of dynamic allocation - * @param mon_p pointer to a lv_mem_monitor_t variable, - * the result of the analysis will be stored here - */ -void lv_mem_monitor(lv_mem_monitor_t * mon_p); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_MEM_H*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/lv_mem_private.h b/L3_Middlewares/LVGL/src/stdlib/lv_mem_private.h deleted file mode 100644 index 9e70ae1..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/lv_mem_private.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @file lv_mem_private.h - * - */ - -#ifndef LV_MEM_PRIVATE_H -#define LV_MEM_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_mem.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_MEM_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/lv_sprintf.h b/L3_Middlewares/LVGL/src/stdlib/lv_sprintf.h deleted file mode 100644 index a7f2188..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/lv_sprintf.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @file lv_sprintf.h - * - */ - -#ifndef LV_SPRINTF_H -#define LV_SPRINTF_H - -#if defined(__has_include) - #if __has_include(LV_INTTYPES_INCLUDE) - #include LV_INTTYPES_INCLUDE - /* platform-specific printf format for int32_t, usually "d" or "ld" */ - #define LV_PRId32 PRId32 - #define LV_PRIu32 PRIu32 - #define LV_PRIx32 PRIx32 - #define LV_PRIX32 PRIX32 - #else - #define LV_PRId32 "d" - #define LV_PRIu32 "u" - #define LV_PRIx32 "x" - #define LV_PRIX32 "X" - #endif -#else - /* hope this is correct for ports without __has_include or without inttypes.h */ - #define LV_PRId32 "d" - #define LV_PRIu32 "u" - #define LV_PRIx32 "x" - #define LV_PRIX32 "X" -#endif - -#include "../misc/lv_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -int lv_snprintf(char * buffer, size_t count, const char * format, ...); - -int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va); - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /* LV_SPRINTF_H */ diff --git a/L3_Middlewares/LVGL/src/stdlib/lv_string.h b/L3_Middlewares/LVGL/src/stdlib/lv_string.h deleted file mode 100644 index 10aee50..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/lv_string.h +++ /dev/null @@ -1,158 +0,0 @@ -/** - * @file lv_string.h - * - */ - -#ifndef LV_STRING_H -#define LV_STRING_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_conf_internal.h" -#include "../misc/lv_types.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * @brief Copies a block of memory from a source address to a destination address. - * @param dst Pointer to the destination array where the content is to be copied. - * @param src Pointer to the source of data to be copied. - * @param len Number of bytes to copy. - * @return Pointer to the destination array. - * @note The function does not check for any overlapping of the source and destination memory blocks. - */ -void * lv_memcpy(void * dst, const void * src, size_t len); - -/** - * @brief Fills a block of memory with a specified value. - * @param dst Pointer to the destination array to fill with the specified value. - * @param v Value to be set. The value is passed as an int, but the function fills - * the block of memory using the unsigned char conversion of this value. - * @param len Number of bytes to be set to the value. - */ -void lv_memset(void * dst, uint8_t v, size_t len); - -/** - * @brief Move a block of memory from source to destination - * @param dst Pointer to the destination array where the content is to be copied. - * @param src Pointer to the source of data to be copied. - * @param len Number of bytes to copy - * @return Pointer to the destination array. - */ -void * lv_memmove(void * dst, const void * src, size_t len); - -/** - * @brief This function will compare two memory blocks - * @param p1 Pointer to the first memory block - * @param p2 Pointer to the second memory block - * @param len Number of bytes to compare - * @return The difference between the value of the first unmatching byte. - */ -int lv_memcmp(const void * p1, const void * p2, size_t len); - -/** - * Same as `memset(dst, 0x00, len)`. - * @param dst pointer to the destination buffer - * @param len number of byte to set - */ -static inline void lv_memzero(void * dst, size_t len) -{ - lv_memset(dst, 0x00, len); -} - -/** - * @brief Computes the length of the string str up to, but not including the terminating null character. - * @param str Pointer to the null-terminated byte string to be examined. - * @return The length of the string in bytes. - */ -size_t lv_strlen(const char * str); - -/** - * @brief Copies up to dst_size-1 (non-null) characters from src to dst. A null terminator is always added. - * @param dst Pointer to the destination array where the content is to be copied. - * @param src Pointer to the source of data to be copied. - * @param dst_size Maximum number of characters to be copied to dst, including the null character. - * @return The length of src. The return value is equivalent to the value returned by lv_strlen(src) - */ -size_t lv_strlcpy(char * dst, const char * src, size_t dst_size); - -/** - * @brief Copies up to dest_size characters from the string pointed to by src to the character array pointed to by dst - * and fills the remaining length with null bytes. - * @param dst Pointer to the destination array where the content is to be copied. - * @param src Pointer to the source of data to be copied. - * @param dest_size Maximum number of characters to be copied to dst. - * @return A pointer to the destination array, which is dst. - * @note dst will not be null terminated if dest_size bytes were copied from src before the end of src was reached. - */ -char * lv_strncpy(char * dst, const char * src, size_t dest_size); - -/** - * @brief Copies the string pointed to by src, including the terminating null character, - * to the character array pointed to by dst. - * @param dst Pointer to the destination array where the content is to be copied. - * @param src Pointer to the source of data to be copied. - * @return A pointer to the destination array, which is dst. - */ -char * lv_strcpy(char * dst, const char * src); - -/** - * @brief This function will compare two strings without specified length. - * @param s1 pointer to the first string - * @param s2 pointer to the second string - * @return the difference between the value of the first unmatching character. - */ -int lv_strcmp(const char * s1, const char * s2); - -/** - * @brief Duplicate a string by allocating a new one and copying the content. - * @param src Pointer to the source of data to be copied. - * @return A pointer to the new allocated string. NULL if failed. - */ -char * lv_strdup(const char * src); - -/** - * @brief Copies the string pointed to by src, including the terminating null character, - * to the end of the string pointed to by dst. - * @param dst Pointer to the destination string where the content is to be appended. - * @param src Pointer to the source of data to be copied. - * @return A pointer to the destination string, which is dst. - */ -char * lv_strcat(char * dst, const char * src); - -/** - * @brief Copies up to src_len characters from the string pointed to by src - * to the end of the string pointed to by dst. - * A terminating null character is appended to dst even if no null character - * was encountered in src after src_len characters were copied. - * @param dst Pointer to the destination string where the content is to be appended. - * @param src Pointer to the source of data to be copied. - * @param src_len Maximum number of characters from src to be copied to the end of dst. - * @return A pointer to the destination string, which is dst. - */ -char * lv_strncat(char * dst, const char * src, size_t src_len); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_STRING_H*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/micropython/lv_mem_core_micropython.c b/L3_Middlewares/LVGL/src/stdlib/micropython/lv_mem_core_micropython.c deleted file mode 100644 index a671b5e..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/micropython/lv_mem_core_micropython.c +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @file lv_malloc_core.c - */ - -/********************* - * INCLUDES - *********************/ -#include "../lv_mem.h" -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_MICROPYTHON -#include "../../stdlib/lv_mem.h" -#include "include/lv_mp_mem_custom_include.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_mem_init(void) -{ - return; /*Nothing to init*/ -} - -void lv_mem_deinit(void) -{ - return; /*Nothing to deinit*/ - -} - -lv_mem_pool_t lv_mem_add_pool(void * mem, size_t bytes) -{ - /*Not supported*/ - LV_UNUSED(mem); - LV_UNUSED(bytes); - return NULL; -} - -void lv_mem_remove_pool(lv_mem_pool_t pool) -{ - /*Not supported*/ - LV_UNUSED(pool); - return; -} - -void * lv_malloc_core(size_t size) -{ -#if MICROPY_MALLOC_USES_ALLOCATED_SIZE - return gc_alloc(size, true); -#else - return m_malloc(size); -#endif -} - -void * lv_realloc_core(void * p, size_t new_size) -{ - -#if MICROPY_MALLOC_USES_ALLOCATED_SIZE - return gc_realloc(p, new_size, true); -#else - return m_realloc(p, new_size); -#endif -} - -void lv_free_core(void * p) -{ - -#if MICROPY_MALLOC_USES_ALLOCATED_SIZE - gc_free(p); - -#else - m_free(p); -#endif -} - -void lv_mem_monitor_core(lv_mem_monitor_t * mon_p) -{ - /*Not supported*/ - LV_UNUSED(mon_p); - return; -} - -lv_result_t lv_mem_test_core(void) -{ - /*Not supported*/ - return LV_RESULT_OK; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_STDLIB_MICROPYTHON*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/rtthread/lv_mem_core_rtthread.c b/L3_Middlewares/LVGL/src/stdlib/rtthread/lv_mem_core_rtthread.c deleted file mode 100644 index 29a600a..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/rtthread/lv_mem_core_rtthread.c +++ /dev/null @@ -1,98 +0,0 @@ -/** - * @file lv_malloc_core_rtthread.c - */ - -/********************* - * INCLUDES - *********************/ -#include "../lv_mem.h" -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_RTTHREAD -#include "../../stdlib/lv_mem.h" -#include - -#ifndef RT_USING_HEAP - #error "lv_mem_core_rtthread: RT_USING_HEAP is required. Define it in rtconfig.h" -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_mem_init(void) -{ - return; /*Nothing to init*/ -} - -void lv_mem_deinit(void) -{ - return; /*Nothing to deinit*/ -} - -lv_mem_pool_t lv_mem_add_pool(void * mem, size_t bytes) -{ - /*Not supported*/ - LV_UNUSED(mem); - LV_UNUSED(bytes); - return NULL; -} - -void lv_mem_remove_pool(lv_mem_pool_t pool) -{ - /*Not supported*/ - LV_UNUSED(pool); - return; -} - -void * lv_malloc_core(size_t size) -{ - return rt_malloc(size); -} - -void * lv_realloc_core(void * p, size_t new_size) -{ - return rt_realloc(p, new_size); -} - -void lv_free_core(void * p) -{ - rt_free(p); -} - -void lv_mem_monitor_core(lv_mem_monitor_t * mon_p) -{ - /*Not supported*/ - LV_UNUSED(mon_p); - return; -} - -lv_result_t lv_mem_test_core(void) -{ - /*Not supported*/ - return LV_RESULT_OK; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_STDLIB_RTTHREAD*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/rtthread/lv_sprintf_rtthread.c b/L3_Middlewares/LVGL/src/stdlib/rtthread/lv_sprintf_rtthread.c deleted file mode 100644 index 721f4fd..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/rtthread/lv_sprintf_rtthread.c +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @file lv_sprintf_rtthread.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#if LV_USE_STDLIB_SPRINTF == LV_STDLIB_RTTHREAD -#include -#include -#include "../lv_sprintf.h" - -#if LV_USE_FLOAT == 1 - #warning "lv_sprintf_rtthread: rtthread not support float in sprintf" -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -int lv_snprintf(char * buffer, size_t count, const char * format, ...) -{ - va_list va; - va_start(va, format); - const int ret = rt_vsnprintf(buffer, count, format, va); - va_end(va); - return ret; -} - -int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va) -{ - return rt_vsnprintf(buffer, count, format, va); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_STDLIB_RTTHREAD*/ diff --git a/L3_Middlewares/LVGL/src/stdlib/rtthread/lv_string_rtthread.c b/L3_Middlewares/LVGL/src/stdlib/rtthread/lv_string_rtthread.c deleted file mode 100644 index 2ab0a47..0000000 --- a/L3_Middlewares/LVGL/src/stdlib/rtthread/lv_string_rtthread.c +++ /dev/null @@ -1,123 +0,0 @@ -/** - * @file lv_string_rtthread.c - */ - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#if LV_USE_STDLIB_STRING == LV_STDLIB_RTTHREAD -#include "../lv_string.h" -#include "../lv_mem.h" /*Need lv_malloc*/ -#include - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void * LV_ATTRIBUTE_FAST_MEM lv_memcpy(void * dst, const void * src, size_t len) -{ - return rt_memcpy(dst, src, len); -} - -void LV_ATTRIBUTE_FAST_MEM lv_memset(void * dst, uint8_t v, size_t len) -{ - rt_memset(dst, v, len); -} - -void * LV_ATTRIBUTE_FAST_MEM lv_memmove(void * dst, const void * src, size_t len) -{ - return rt_memmove(dst, src, len); -} - -size_t lv_strlen(const char * str) -{ - return rt_strlen(str); -} - -int lv_memcmp(const void * p1, const void * p2, size_t len) -{ - return rt_memcmp(p1, p2, len); -} - -size_t lv_strlcpy(char * dst, const char * src, size_t dst_size) -{ - size_t src_len = lv_strlen(src); - if(dst_size > 0) { - size_t copy_size = src_len < dst_size ? src_len : dst_size - 1; - lv_memcpy(dst, src, copy_size); - dst[copy_size] = '\0'; - } - return src_len; -} - -char * lv_strncpy(char * dst, const char * src, size_t dest_size) -{ - return rt_strncpy(dst, src, dest_size); -} - -char * lv_strcpy(char * dst, const char * src) -{ - return rt_strcpy(dst, src); -} - -int lv_strcmp(const char * s1, const char * s2) -{ - return rt_strcmp(s1, s2); -} - -char * lv_strdup(const char * src) -{ - size_t len = lv_strlen(src) + 1; - char * dst = lv_malloc(len); - if(dst == NULL) return NULL; - - lv_memcpy(dst, src, len); /*memcpy is faster than strncpy when length is known*/ - return dst; -} - -char * lv_strcat(char * dst, const char * src) -{ - /*Since RT-thread does not have rt_strcat, - the following code is used instead.*/ - lv_strcpy(dst + lv_strlen(dst), src); - return dst; -} - -char * lv_strncat(char * dst, const char * src, size_t src_len) -{ - char * tmp = dst; - dst += lv_strlen(dst); - while(src_len != 0 && *src != '\0') { - src_len--; - *dst++ = *src++; - } - *dst = '\0'; - return tmp; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_STDLIB_RTTHREAD*/ diff --git a/L3_Middlewares/LVGL/src/themes/default/lv_theme_default.c b/L3_Middlewares/LVGL/src/themes/default/lv_theme_default.c deleted file mode 100644 index fa12662..0000000 --- a/L3_Middlewares/LVGL/src/themes/default/lv_theme_default.c +++ /dev/null @@ -1,1228 +0,0 @@ -/** - * @file lv_theme_default.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../../../lvgl.h" /*To see all the widgets*/ - -#if LV_USE_THEME_DEFAULT - -#include "../lv_theme_private.h" -#include "../../misc/lv_color.h" -#include "../../core/lv_global.h" - -/********************* - * DEFINES - *********************/ - -struct _my_theme_t; -typedef struct _my_theme_t my_theme_t; - -#define theme_def (*(my_theme_t **)(&LV_GLOBAL_DEFAULT()->theme_default)) - -#define MODE_DARK 1 -#define RADIUS_DEFAULT LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 12 : 8) - -/*SCREEN*/ -#define LIGHT_COLOR_SCR lv_palette_lighten(LV_PALETTE_GREY, 4) -#define LIGHT_COLOR_CARD lv_color_white() -#define LIGHT_COLOR_TEXT lv_palette_darken(LV_PALETTE_GREY, 4) -#define LIGHT_COLOR_GREY lv_palette_lighten(LV_PALETTE_GREY, 2) -#define DARK_COLOR_SCR lv_color_hex(0x15171A) -#define DARK_COLOR_CARD lv_color_hex(0x282b30) -#define DARK_COLOR_TEXT lv_palette_lighten(LV_PALETTE_GREY, 5) -#define DARK_COLOR_GREY lv_color_hex(0x2f3237) - -#define TRANSITION_TIME LV_THEME_DEFAULT_TRANSITION_TIME -#define BORDER_WIDTH LV_DPX_CALC(theme->disp_dpi, 2) -#define OUTLINE_WIDTH LV_DPX_CALC(theme->disp_dpi, 3) - -#define PAD_DEF LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 24 : theme->disp_size == DISP_MEDIUM ? 20 : 16) -#define PAD_SMALL LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 14 : theme->disp_size == DISP_MEDIUM ? 12 : 10) -#define PAD_TINY LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 8 : theme->disp_size == DISP_MEDIUM ? 6 : 2) - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - lv_style_t scr; - lv_style_t scrollbar; - lv_style_t scrollbar_scrolled; - lv_style_t card; - lv_style_t btn; - - /*Utility*/ - lv_style_t bg_color_primary; - lv_style_t bg_color_primary_muted; - lv_style_t bg_color_secondary; - lv_style_t bg_color_secondary_muted; - lv_style_t bg_color_grey; - lv_style_t bg_color_white; - lv_style_t pressed; - lv_style_t disabled; - lv_style_t pad_zero; - lv_style_t pad_tiny; - lv_style_t pad_small; - lv_style_t pad_normal; - lv_style_t pad_gap; - lv_style_t line_space_large; - lv_style_t text_align_center; - lv_style_t outline_primary; - lv_style_t outline_secondary; - lv_style_t circle; - lv_style_t no_radius; - lv_style_t clip_corner; - lv_style_t rotary_scroll; -#if LV_THEME_DEFAULT_GROW - lv_style_t grow; -#endif - lv_style_t transition_delayed; - lv_style_t transition_normal; - lv_style_t anim; - lv_style_t anim_fast; - - /*Parts*/ - lv_style_t knob; - -#if LV_USE_ARC - lv_style_t arc_indic; - lv_style_t arc_indic_primary; -#endif - -#if LV_USE_CHART - lv_style_t chart_series, chart_indic, chart_bg; -#endif - -#if LV_USE_DROPDOWN - lv_style_t dropdown_list; -#endif - -#if LV_USE_CHECKBOX - lv_style_t cb_marker, cb_marker_checked; -#endif - -#if LV_USE_SWITCH - lv_style_t switch_knob; -#endif - -#if LV_USE_LINE - lv_style_t line; -#endif - -#if LV_USE_TABLE - lv_style_t table_cell; -#endif - -#if LV_USE_TEXTAREA - lv_style_t ta_cursor, ta_placeholder; -#endif - -#if LV_USE_CALENDAR - lv_style_t calendar_btnm_bg, calendar_btnm_day, calendar_header; -#endif - -#if LV_USE_MENU - lv_style_t menu_bg, menu_cont, menu_sidebar_cont, menu_main_cont, menu_page, menu_header_cont, menu_header_btn, - menu_section, menu_pressed, menu_separator; -#endif - -#if LV_USE_MSGBOX - lv_style_t msgbox_backdrop_bg; -#endif - -#if LV_USE_KEYBOARD - lv_style_t keyboard_button_bg; -#endif - -#if LV_USE_LIST - lv_style_t list_bg, list_btn, list_item_grow; -#endif - -#if LV_USE_TABVIEW - lv_style_t tab_bg_focus, tab_btn; -#endif -#if LV_USE_LED - lv_style_t led; -#endif - -#if LV_USE_SCALE - lv_style_t scale; -#endif -} my_theme_styles_t; - -typedef enum { - DISP_SMALL = 3, - DISP_MEDIUM = 2, - DISP_LARGE = 1, -} disp_size_t; - -struct _my_theme_t { - lv_theme_t base; - disp_size_t disp_size; - int32_t disp_dpi; - lv_color_t color_scr; - lv_color_t color_text; - lv_color_t color_card; - lv_color_t color_grey; - bool inited; - my_theme_styles_t styles; - - lv_color_filter_dsc_t dark_filter; - lv_color_filter_dsc_t grey_filter; - -#if LV_THEME_DEFAULT_TRANSITION_TIME - lv_style_transition_dsc_t trans_delayed; - lv_style_transition_dsc_t trans_normal; -#endif -}; - -/********************** - * STATIC PROTOTYPES - **********************/ -static void theme_apply(lv_theme_t * th, lv_obj_t * obj); -static void style_init_reset(lv_style_t * style); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * STATIC FUNCTIONS - **********************/ - -static lv_color_t dark_color_filter_cb(const lv_color_filter_dsc_t * f, lv_color_t c, lv_opa_t opa) -{ - LV_UNUSED(f); - return lv_color_darken(c, opa); -} - -static lv_color_t grey_filter_cb(const lv_color_filter_dsc_t * f, lv_color_t color, lv_opa_t opa) -{ - LV_UNUSED(f); - if(theme_def->base.flags & MODE_DARK) return lv_color_mix(lv_palette_darken(LV_PALETTE_GREY, 2), color, opa); - else return lv_color_mix(lv_palette_lighten(LV_PALETTE_GREY, 2), color, opa); -} - -static void style_init(my_theme_t * theme) -{ -#if TRANSITION_TIME - static const lv_style_prop_t trans_props[] = { - LV_STYLE_BG_OPA, LV_STYLE_BG_COLOR, - LV_STYLE_TRANSFORM_WIDTH, LV_STYLE_TRANSFORM_HEIGHT, - LV_STYLE_TRANSLATE_Y, LV_STYLE_TRANSLATE_X, - LV_STYLE_TRANSFORM_ROTATION, - LV_STYLE_TRANSFORM_SCALE_X, LV_STYLE_TRANSFORM_SCALE_Y, - LV_STYLE_COLOR_FILTER_OPA, LV_STYLE_COLOR_FILTER_DSC, - 0 - }; -#endif - - theme->color_scr = theme->base.flags & MODE_DARK ? DARK_COLOR_SCR : LIGHT_COLOR_SCR; - theme->color_text = theme->base.flags & MODE_DARK ? DARK_COLOR_TEXT : LIGHT_COLOR_TEXT; - theme->color_card = theme->base.flags & MODE_DARK ? DARK_COLOR_CARD : LIGHT_COLOR_CARD; - theme->color_grey = theme->base.flags & MODE_DARK ? DARK_COLOR_GREY : LIGHT_COLOR_GREY; - - style_init_reset(&theme->styles.transition_delayed); - style_init_reset(&theme->styles.transition_normal); -#if TRANSITION_TIME - lv_style_transition_dsc_init(&theme->trans_delayed, trans_props, lv_anim_path_linear, TRANSITION_TIME, 70, NULL); - lv_style_transition_dsc_init(&theme->trans_normal, trans_props, lv_anim_path_linear, TRANSITION_TIME, 0, NULL); - - lv_style_set_transition(&theme->styles.transition_delayed, - &theme->trans_delayed); /*Go back to default state with delay*/ - - lv_style_set_transition(&theme->styles.transition_normal, &theme->trans_normal); /*Go back to default state with delay*/ -#endif - - style_init_reset(&theme->styles.scrollbar); - lv_color_t sb_color = (theme->base.flags & MODE_DARK) ? lv_palette_darken(LV_PALETTE_GREY, - 2) : lv_palette_main(LV_PALETTE_GREY); - lv_style_set_bg_color(&theme->styles.scrollbar, sb_color); - - lv_style_set_radius(&theme->styles.scrollbar, LV_RADIUS_CIRCLE); - lv_style_set_pad_all(&theme->styles.scrollbar, LV_DPX_CALC(theme->disp_dpi, 7)); - lv_style_set_width(&theme->styles.scrollbar, LV_DPX_CALC(theme->disp_dpi, 5)); - lv_style_set_bg_opa(&theme->styles.scrollbar, LV_OPA_40); -#if TRANSITION_TIME - lv_style_set_transition(&theme->styles.scrollbar, &theme->trans_normal); -#endif - - style_init_reset(&theme->styles.scrollbar_scrolled); - lv_style_set_bg_opa(&theme->styles.scrollbar_scrolled, LV_OPA_COVER); - - style_init_reset(&theme->styles.scr); - lv_style_set_bg_opa(&theme->styles.scr, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.scr, theme->color_scr); - lv_style_set_text_color(&theme->styles.scr, theme->color_text); - lv_style_set_text_font(&theme->styles.scr, theme->base.font_normal); - lv_style_set_pad_row(&theme->styles.scr, PAD_SMALL); - lv_style_set_pad_column(&theme->styles.scr, PAD_SMALL); - lv_style_set_rotary_sensitivity(&theme->styles.scr, theme->disp_dpi / 4 * 256); - - style_init_reset(&theme->styles.card); - lv_style_set_radius(&theme->styles.card, RADIUS_DEFAULT); - lv_style_set_bg_opa(&theme->styles.card, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.card, theme->color_card); - lv_style_set_border_color(&theme->styles.card, theme->color_grey); - lv_style_set_border_width(&theme->styles.card, BORDER_WIDTH); - lv_style_set_border_post(&theme->styles.card, true); - lv_style_set_text_color(&theme->styles.card, theme->color_text); - lv_style_set_pad_all(&theme->styles.card, PAD_DEF); - lv_style_set_pad_row(&theme->styles.card, PAD_SMALL); - lv_style_set_pad_column(&theme->styles.card, PAD_SMALL); - lv_style_set_line_color(&theme->styles.card, lv_palette_main(LV_PALETTE_GREY)); - lv_style_set_line_width(&theme->styles.card, LV_DPX_CALC(theme->disp_dpi, 1)); - - style_init_reset(&theme->styles.outline_primary); - lv_style_set_outline_color(&theme->styles.outline_primary, theme->base.color_primary); - lv_style_set_outline_width(&theme->styles.outline_primary, OUTLINE_WIDTH); - lv_style_set_outline_pad(&theme->styles.outline_primary, OUTLINE_WIDTH); - lv_style_set_outline_opa(&theme->styles.outline_primary, LV_OPA_50); - - style_init_reset(&theme->styles.outline_secondary); - lv_style_set_outline_color(&theme->styles.outline_secondary, theme->base.color_secondary); - lv_style_set_outline_width(&theme->styles.outline_secondary, OUTLINE_WIDTH); - lv_style_set_outline_opa(&theme->styles.outline_secondary, LV_OPA_50); - - style_init_reset(&theme->styles.btn); - lv_style_set_radius(&theme->styles.btn, - LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 16 : theme->disp_size == DISP_MEDIUM ? 12 : 8)); - lv_style_set_bg_opa(&theme->styles.btn, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.btn, theme->color_grey); - if(!(theme->base.flags & MODE_DARK)) { - lv_style_set_shadow_color(&theme->styles.btn, lv_palette_main(LV_PALETTE_GREY)); - lv_style_set_shadow_width(&theme->styles.btn, LV_DPX(3)); - lv_style_set_shadow_opa(&theme->styles.btn, LV_OPA_50); - lv_style_set_shadow_offset_y(&theme->styles.btn, LV_DPX_CALC(theme->disp_dpi, LV_DPX(4))); - } - lv_style_set_text_color(&theme->styles.btn, theme->color_text); - lv_style_set_pad_hor(&theme->styles.btn, PAD_DEF); - lv_style_set_pad_ver(&theme->styles.btn, PAD_SMALL); - lv_style_set_pad_column(&theme->styles.btn, LV_DPX_CALC(theme->disp_dpi, 5)); - lv_style_set_pad_row(&theme->styles.btn, LV_DPX_CALC(theme->disp_dpi, 5)); - - lv_color_filter_dsc_init(&theme->dark_filter, dark_color_filter_cb); - lv_color_filter_dsc_init(&theme->grey_filter, grey_filter_cb); - - style_init_reset(&theme->styles.pressed); - lv_style_set_color_filter_dsc(&theme->styles.pressed, &theme->dark_filter); - lv_style_set_color_filter_opa(&theme->styles.pressed, 35); - - style_init_reset(&theme->styles.disabled); - lv_style_set_color_filter_dsc(&theme->styles.disabled, &theme->grey_filter); - lv_style_set_color_filter_opa(&theme->styles.disabled, LV_OPA_50); - - style_init_reset(&theme->styles.clip_corner); - lv_style_set_clip_corner(&theme->styles.clip_corner, true); - lv_style_set_border_post(&theme->styles.clip_corner, true); - - style_init_reset(&theme->styles.pad_normal); - lv_style_set_pad_all(&theme->styles.pad_normal, PAD_DEF); - lv_style_set_pad_row(&theme->styles.pad_normal, PAD_DEF); - lv_style_set_pad_column(&theme->styles.pad_normal, PAD_DEF); - - style_init_reset(&theme->styles.pad_small); - lv_style_set_pad_all(&theme->styles.pad_small, PAD_SMALL); - lv_style_set_pad_gap(&theme->styles.pad_small, PAD_SMALL); - - style_init_reset(&theme->styles.pad_gap); - lv_style_set_pad_row(&theme->styles.pad_gap, LV_DPX_CALC(theme->disp_dpi, 10)); - lv_style_set_pad_column(&theme->styles.pad_gap, LV_DPX_CALC(theme->disp_dpi, 10)); - - style_init_reset(&theme->styles.line_space_large); - lv_style_set_text_line_space(&theme->styles.line_space_large, LV_DPX_CALC(theme->disp_dpi, 20)); - - style_init_reset(&theme->styles.text_align_center); - lv_style_set_text_align(&theme->styles.text_align_center, LV_TEXT_ALIGN_CENTER); - - style_init_reset(&theme->styles.pad_zero); - lv_style_set_pad_all(&theme->styles.pad_zero, 0); - lv_style_set_pad_row(&theme->styles.pad_zero, 0); - lv_style_set_pad_column(&theme->styles.pad_zero, 0); - - style_init_reset(&theme->styles.pad_tiny); - lv_style_set_pad_all(&theme->styles.pad_tiny, PAD_TINY); - lv_style_set_pad_row(&theme->styles.pad_tiny, PAD_TINY); - lv_style_set_pad_column(&theme->styles.pad_tiny, PAD_TINY); - - style_init_reset(&theme->styles.bg_color_primary); - lv_style_set_bg_color(&theme->styles.bg_color_primary, theme->base.color_primary); - lv_style_set_text_color(&theme->styles.bg_color_primary, lv_color_white()); - lv_style_set_bg_opa(&theme->styles.bg_color_primary, LV_OPA_COVER); - - style_init_reset(&theme->styles.bg_color_primary_muted); - lv_style_set_bg_color(&theme->styles.bg_color_primary_muted, theme->base.color_primary); - lv_style_set_text_color(&theme->styles.bg_color_primary_muted, theme->base.color_primary); - lv_style_set_bg_opa(&theme->styles.bg_color_primary_muted, LV_OPA_20); - - style_init_reset(&theme->styles.bg_color_secondary); - lv_style_set_bg_color(&theme->styles.bg_color_secondary, theme->base.color_secondary); - lv_style_set_text_color(&theme->styles.bg_color_secondary, lv_color_white()); - lv_style_set_bg_opa(&theme->styles.bg_color_secondary, LV_OPA_COVER); - - style_init_reset(&theme->styles.bg_color_secondary_muted); - lv_style_set_bg_color(&theme->styles.bg_color_secondary_muted, theme->base.color_secondary); - lv_style_set_text_color(&theme->styles.bg_color_secondary_muted, theme->base.color_secondary); - lv_style_set_bg_opa(&theme->styles.bg_color_secondary_muted, LV_OPA_20); - - style_init_reset(&theme->styles.bg_color_grey); - lv_style_set_bg_color(&theme->styles.bg_color_grey, theme->color_grey); - lv_style_set_bg_opa(&theme->styles.bg_color_grey, LV_OPA_COVER); - lv_style_set_text_color(&theme->styles.bg_color_grey, theme->color_text); - - style_init_reset(&theme->styles.bg_color_white); - lv_style_set_bg_color(&theme->styles.bg_color_white, theme->color_card); - lv_style_set_bg_opa(&theme->styles.bg_color_white, LV_OPA_COVER); - lv_style_set_text_color(&theme->styles.bg_color_white, theme->color_text); - - style_init_reset(&theme->styles.circle); - lv_style_set_radius(&theme->styles.circle, LV_RADIUS_CIRCLE); - - style_init_reset(&theme->styles.no_radius); - lv_style_set_radius(&theme->styles.no_radius, 0); - - style_init_reset(&theme->styles.rotary_scroll); - lv_style_set_rotary_sensitivity(&theme->styles.rotary_scroll, theme->disp_dpi / 4 * 256); - -#if LV_THEME_DEFAULT_GROW - style_init_reset(&theme->styles.grow); - lv_style_set_transform_width(&theme->styles.grow, LV_DPX_CALC(theme->disp_dpi, 3)); - lv_style_set_transform_height(&theme->styles.grow, LV_DPX_CALC(theme->disp_dpi, 3)); -#endif - - style_init_reset(&theme->styles.knob); - lv_style_set_bg_color(&theme->styles.knob, theme->base.color_primary); - lv_style_set_bg_opa(&theme->styles.knob, LV_OPA_COVER); - lv_style_set_pad_all(&theme->styles.knob, LV_DPX_CALC(theme->disp_dpi, 6)); - lv_style_set_radius(&theme->styles.knob, LV_RADIUS_CIRCLE); - - style_init_reset(&theme->styles.anim); - lv_style_set_anim_duration(&theme->styles.anim, 200); - - style_init_reset(&theme->styles.anim_fast); - lv_style_set_anim_duration(&theme->styles.anim_fast, 120); - -#if LV_USE_ARC - style_init_reset(&theme->styles.arc_indic); - lv_style_set_arc_color(&theme->styles.arc_indic, theme->color_grey); - lv_style_set_arc_width(&theme->styles.arc_indic, LV_DPX_CALC(theme->disp_dpi, 15)); - lv_style_set_arc_rounded(&theme->styles.arc_indic, true); - - style_init_reset(&theme->styles.arc_indic_primary); - lv_style_set_arc_color(&theme->styles.arc_indic_primary, theme->base.color_primary); -#endif - -#if LV_USE_DROPDOWN - style_init_reset(&theme->styles.dropdown_list); - lv_style_set_max_height(&theme->styles.dropdown_list, LV_DPI_DEF * 2); -#endif -#if LV_USE_CHECKBOX - style_init_reset(&theme->styles.cb_marker); - lv_style_set_pad_all(&theme->styles.cb_marker, LV_DPX_CALC(theme->disp_dpi, 3)); - lv_style_set_border_width(&theme->styles.cb_marker, BORDER_WIDTH); - lv_style_set_border_color(&theme->styles.cb_marker, theme->base.color_primary); - lv_style_set_bg_color(&theme->styles.cb_marker, theme->color_card); - lv_style_set_bg_opa(&theme->styles.cb_marker, LV_OPA_COVER); - lv_style_set_radius(&theme->styles.cb_marker, RADIUS_DEFAULT / 2); - lv_style_set_text_font(&theme->styles.cb_marker, theme->base.font_small); - lv_style_set_text_color(&theme->styles.cb_marker, lv_color_white()); - - style_init_reset(&theme->styles.cb_marker_checked); - lv_style_set_bg_image_src(&theme->styles.cb_marker_checked, LV_SYMBOL_OK); -#endif - -#if LV_USE_SWITCH - style_init_reset(&theme->styles.switch_knob); - lv_style_set_pad_all(&theme->styles.switch_knob, - LV_DPX_CALC(theme->disp_dpi, 4)); - lv_style_set_bg_color(&theme->styles.switch_knob, lv_color_white()); -#endif - -#if LV_USE_LINE - style_init_reset(&theme->styles.line); - lv_style_set_line_width(&theme->styles.line, 1); - lv_style_set_line_color(&theme->styles.line, theme->color_text); -#endif - -#if LV_USE_CHART - style_init_reset(&theme->styles.chart_bg); - lv_style_set_border_post(&theme->styles.chart_bg, false); - lv_style_set_pad_column(&theme->styles.chart_bg, LV_DPX_CALC(theme->disp_dpi, 10)); - lv_style_set_line_color(&theme->styles.chart_bg, theme->color_grey); - - style_init_reset(&theme->styles.chart_series); - lv_style_set_line_width(&theme->styles.chart_series, LV_DPX_CALC(theme->disp_dpi, 3)); - lv_style_set_radius(&theme->styles.chart_series, LV_DPX_CALC(theme->disp_dpi, 3)); - - int32_t chart_size = LV_DPX_CALC(theme->disp_dpi, 8); - lv_style_set_size(&theme->styles.chart_series, chart_size, chart_size); - lv_style_set_pad_column(&theme->styles.chart_series, LV_DPX_CALC(theme->disp_dpi, 2)); - - style_init_reset(&theme->styles.chart_indic); - lv_style_set_radius(&theme->styles.chart_indic, LV_RADIUS_CIRCLE); - lv_style_set_size(&theme->styles.chart_indic, chart_size, chart_size); - lv_style_set_bg_color(&theme->styles.chart_indic, theme->base.color_primary); - lv_style_set_bg_opa(&theme->styles.chart_indic, LV_OPA_COVER); -#endif - -#if LV_USE_MENU - style_init_reset(&theme->styles.menu_bg); - lv_style_set_pad_all(&theme->styles.menu_bg, 0); - lv_style_set_pad_gap(&theme->styles.menu_bg, 0); - lv_style_set_radius(&theme->styles.menu_bg, 0); - lv_style_set_clip_corner(&theme->styles.menu_bg, true); - lv_style_set_border_side(&theme->styles.menu_bg, LV_BORDER_SIDE_NONE); - - style_init_reset(&theme->styles.menu_section); - lv_style_set_radius(&theme->styles.menu_section, RADIUS_DEFAULT); - lv_style_set_clip_corner(&theme->styles.menu_section, true); - lv_style_set_bg_opa(&theme->styles.menu_section, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.menu_section, theme->color_card); - lv_style_set_text_color(&theme->styles.menu_section, theme->color_text); - - style_init_reset(&theme->styles.menu_cont); - lv_style_set_pad_hor(&theme->styles.menu_cont, PAD_SMALL); - lv_style_set_pad_ver(&theme->styles.menu_cont, PAD_SMALL); - lv_style_set_pad_gap(&theme->styles.menu_cont, PAD_SMALL); - lv_style_set_border_width(&theme->styles.menu_cont, LV_DPX_CALC(theme->disp_dpi, 1)); - lv_style_set_border_opa(&theme->styles.menu_cont, LV_OPA_10); - lv_style_set_border_color(&theme->styles.menu_cont, theme->color_text); - lv_style_set_border_side(&theme->styles.menu_cont, LV_BORDER_SIDE_NONE); - - style_init_reset(&theme->styles.menu_sidebar_cont); - lv_style_set_pad_all(&theme->styles.menu_sidebar_cont, 0); - lv_style_set_pad_gap(&theme->styles.menu_sidebar_cont, 0); - lv_style_set_border_width(&theme->styles.menu_sidebar_cont, LV_DPX_CALC(theme->disp_dpi, 1)); - lv_style_set_border_opa(&theme->styles.menu_sidebar_cont, LV_OPA_10); - lv_style_set_border_color(&theme->styles.menu_sidebar_cont, theme->color_text); - lv_style_set_border_side(&theme->styles.menu_sidebar_cont, LV_BORDER_SIDE_RIGHT); - - style_init_reset(&theme->styles.menu_main_cont); - lv_style_set_pad_all(&theme->styles.menu_main_cont, 0); - lv_style_set_pad_gap(&theme->styles.menu_main_cont, 0); - - style_init_reset(&theme->styles.menu_header_cont); - lv_style_set_pad_hor(&theme->styles.menu_header_cont, PAD_SMALL); - lv_style_set_pad_ver(&theme->styles.menu_header_cont, PAD_TINY); - lv_style_set_pad_gap(&theme->styles.menu_header_cont, PAD_SMALL); - - style_init_reset(&theme->styles.menu_header_btn); - lv_style_set_pad_hor(&theme->styles.menu_header_btn, PAD_TINY); - lv_style_set_pad_ver(&theme->styles.menu_header_btn, PAD_TINY); - lv_style_set_shadow_opa(&theme->styles.menu_header_btn, LV_OPA_TRANSP); - lv_style_set_bg_opa(&theme->styles.menu_header_btn, LV_OPA_TRANSP); - lv_style_set_text_color(&theme->styles.menu_header_btn, theme->color_text); - - style_init_reset(&theme->styles.menu_page); - lv_style_set_pad_hor(&theme->styles.menu_page, 0); - lv_style_set_pad_gap(&theme->styles.menu_page, 0); - - style_init_reset(&theme->styles.menu_pressed); - lv_style_set_bg_opa(&theme->styles.menu_pressed, LV_OPA_20); - lv_style_set_bg_color(&theme->styles.menu_pressed, lv_palette_main(LV_PALETTE_GREY)); - - style_init_reset(&theme->styles.menu_separator); - lv_style_set_bg_opa(&theme->styles.menu_separator, LV_OPA_TRANSP); - lv_style_set_pad_ver(&theme->styles.menu_separator, PAD_TINY); -#endif - -#if LV_USE_TABLE - style_init_reset(&theme->styles.table_cell); - lv_style_set_border_width(&theme->styles.table_cell, LV_DPX_CALC(theme->disp_dpi, 1)); - lv_style_set_border_color(&theme->styles.table_cell, theme->color_grey); - lv_style_set_border_side(&theme->styles.table_cell, LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_BOTTOM); -#endif - -#if LV_USE_TEXTAREA - style_init_reset(&theme->styles.ta_cursor); - lv_style_set_border_color(&theme->styles.ta_cursor, theme->color_text); - lv_style_set_border_width(&theme->styles.ta_cursor, LV_DPX_CALC(theme->disp_dpi, 2)); - lv_style_set_pad_left(&theme->styles.ta_cursor, - LV_DPX_CALC(theme->disp_dpi, 1)); - lv_style_set_border_side(&theme->styles.ta_cursor, LV_BORDER_SIDE_LEFT); - lv_style_set_anim_duration(&theme->styles.ta_cursor, 400); - - style_init_reset(&theme->styles.ta_placeholder); - lv_style_set_text_color(&theme->styles.ta_placeholder, - (theme->base.flags & MODE_DARK) ? lv_palette_darken(LV_PALETTE_GREY, - 2) : lv_palette_lighten(LV_PALETTE_GREY, 1)); -#endif - -#if LV_USE_CALENDAR - style_init_reset(&theme->styles.calendar_btnm_bg); - lv_style_set_pad_all(&theme->styles.calendar_btnm_bg, PAD_SMALL); - lv_style_set_pad_gap(&theme->styles.calendar_btnm_bg, PAD_SMALL / 2); - - style_init_reset(&theme->styles.calendar_btnm_day); - lv_style_set_border_width(&theme->styles.calendar_btnm_day, LV_DPX_CALC(theme->disp_dpi, 1)); - lv_style_set_border_color(&theme->styles.calendar_btnm_day, theme->color_grey); - lv_style_set_bg_color(&theme->styles.calendar_btnm_day, theme->color_card); - lv_style_set_bg_opa(&theme->styles.calendar_btnm_day, LV_OPA_20); - - style_init_reset(&theme->styles.calendar_header); - lv_style_set_pad_hor(&theme->styles.calendar_header, PAD_SMALL); - lv_style_set_pad_top(&theme->styles.calendar_header, PAD_SMALL); - lv_style_set_pad_bottom(&theme->styles.calendar_header, PAD_TINY); - lv_style_set_pad_gap(&theme->styles.calendar_header, PAD_SMALL); -#endif - -#if LV_USE_MSGBOX - style_init_reset(&theme->styles.msgbox_backdrop_bg); - lv_style_set_bg_color(&theme->styles.msgbox_backdrop_bg, lv_palette_main(LV_PALETTE_GREY)); - lv_style_set_bg_opa(&theme->styles.msgbox_backdrop_bg, LV_OPA_50); -#endif -#if LV_USE_KEYBOARD - style_init_reset(&theme->styles.keyboard_button_bg); - lv_style_set_shadow_width(&theme->styles.keyboard_button_bg, 0); - lv_style_set_radius(&theme->styles.keyboard_button_bg, - theme->disp_size == DISP_SMALL ? RADIUS_DEFAULT / 2 : RADIUS_DEFAULT); -#endif - -#if LV_USE_TABVIEW - style_init_reset(&theme->styles.tab_btn); - lv_style_set_border_color(&theme->styles.tab_btn, theme->base.color_primary); - lv_style_set_border_width(&theme->styles.tab_btn, BORDER_WIDTH * 2); - lv_style_set_border_side(&theme->styles.tab_btn, LV_BORDER_SIDE_BOTTOM); - lv_style_set_pad_top(&theme->styles.tab_btn, BORDER_WIDTH * 2); - - style_init_reset(&theme->styles.tab_bg_focus); - lv_style_set_outline_pad(&theme->styles.tab_bg_focus, -BORDER_WIDTH); -#endif - -#if LV_USE_LIST - style_init_reset(&theme->styles.list_bg); - lv_style_set_pad_hor(&theme->styles.list_bg, PAD_DEF); - lv_style_set_pad_ver(&theme->styles.list_bg, 0); - lv_style_set_pad_gap(&theme->styles.list_bg, 0); - lv_style_set_clip_corner(&theme->styles.list_bg, true); - - style_init_reset(&theme->styles.list_btn); - lv_style_set_border_width(&theme->styles.list_btn, LV_DPX_CALC(theme->disp_dpi, 1)); - lv_style_set_border_color(&theme->styles.list_btn, theme->color_grey); - lv_style_set_border_side(&theme->styles.list_btn, LV_BORDER_SIDE_BOTTOM); - lv_style_set_pad_all(&theme->styles.list_btn, PAD_SMALL); - lv_style_set_pad_column(&theme->styles.list_btn, PAD_SMALL); - - style_init_reset(&theme->styles.list_item_grow); - lv_style_set_transform_width(&theme->styles.list_item_grow, PAD_DEF); -#endif - -#if LV_USE_LED - style_init_reset(&theme->styles.led); - lv_style_set_bg_opa(&theme->styles.led, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.led, lv_color_white()); - lv_style_set_bg_grad_color(&theme->styles.led, lv_palette_main(LV_PALETTE_GREY)); - lv_style_set_radius(&theme->styles.led, LV_RADIUS_CIRCLE); - lv_style_set_shadow_width(&theme->styles.led, LV_DPX_CALC(theme->disp_dpi, 15)); - lv_style_set_shadow_color(&theme->styles.led, lv_color_white()); - lv_style_set_shadow_spread(&theme->styles.led, LV_DPX_CALC(theme->disp_dpi, 5)); -#endif - -#if LV_USE_SCALE - style_init_reset(&theme->styles.scale); - lv_style_set_line_color(&theme->styles.scale, theme->color_text); - lv_style_set_line_width(&theme->styles.scale, LV_DPX(2)); - lv_style_set_arc_color(&theme->styles.scale, theme->color_text); - lv_style_set_arc_width(&theme->styles.scale, LV_DPX(2)); - lv_style_set_length(&theme->styles.scale, LV_DPX(6)); -#endif -} - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_theme_t * lv_theme_default_init(lv_display_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, - const lv_font_t * font) -{ - /*This trick is required only to avoid the garbage collection of - *styles' data if LVGL is used in a binding (e.g. MicroPython) - *In a general case styles could be in a simple `static lv_style_t my_style...` variables*/ - - if(!lv_theme_default_is_inited()) { - theme_def = lv_malloc_zeroed(sizeof(my_theme_t)); - } - - my_theme_t * theme = theme_def; - - lv_display_t * new_disp = disp == NULL ? lv_display_get_default() : disp; - int32_t new_dpi = lv_display_get_dpi(new_disp); - int32_t hor_res = lv_display_get_horizontal_resolution(new_disp); - disp_size_t new_size; - - if(hor_res <= 320) new_size = DISP_SMALL; - else if(hor_res < 720) new_size = DISP_MEDIUM; - else new_size = DISP_LARGE; - - /* check theme information whether will change or not*/ - if(theme->inited && theme->disp_dpi == new_dpi && - theme->disp_size == new_size && - lv_color_eq(theme->base.color_primary, color_primary) && - lv_color_eq(theme->base.color_secondary, color_secondary) && - (theme->base.flags == dark ? MODE_DARK : 0) && - theme->base.font_small == font) { - return (lv_theme_t *) theme; - - } - - theme->disp_size = new_size; - theme->disp_dpi = new_dpi; - theme->base.disp = new_disp; - theme->base.color_primary = color_primary; - theme->base.color_secondary = color_secondary; - theme->base.font_small = font; - theme->base.font_normal = font; - theme->base.font_large = font; - theme->base.apply_cb = theme_apply; - theme->base.flags = dark ? MODE_DARK : 0; - - style_init(theme); - - if(disp == NULL || lv_display_get_theme(disp) == (lv_theme_t *)theme) lv_obj_report_style_change(NULL); - - theme->inited = true; - - return (lv_theme_t *) theme; -} - -void lv_theme_default_deinit(void) -{ - my_theme_t * theme = theme_def; - if(theme) { - if(theme->inited) { - lv_style_t * theme_styles = (lv_style_t *)(&(theme->styles)); - uint32_t i; - for(i = 0; i < sizeof(my_theme_styles_t) / sizeof(lv_style_t); i++) { - lv_style_reset(theme_styles + i); - } - - } - lv_free(theme_def); - theme_def = NULL; - } -} - -lv_theme_t * lv_theme_default_get(void) -{ - if(!lv_theme_default_is_inited()) { - return NULL; - } - - return (lv_theme_t *)theme_def; -} - -bool lv_theme_default_is_inited(void) -{ - my_theme_t * theme = theme_def; - if(theme == NULL) return false; - return theme->inited; -} - -static void theme_apply(lv_theme_t * th, lv_obj_t * obj) -{ - LV_UNUSED(th); - - my_theme_t * theme = theme_def; - lv_obj_t * parent = lv_obj_get_parent(obj); - - if(parent == NULL) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - return; - } - - if(lv_obj_check_type(obj, &lv_obj_class)) { -#if LV_USE_TABVIEW - /*Tabview content area*/ - if(lv_obj_check_type(parent, &lv_tabview_class) && lv_obj_get_child(parent, 1) == obj) { - return; - } - /*Tabview button container*/ - else if(lv_obj_check_type(parent, &lv_tabview_class) && lv_obj_get_child(parent, 0) == obj) { - lv_obj_add_style(obj, &theme->styles.bg_color_white, 0); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.tab_bg_focus, LV_STATE_FOCUS_KEY); - return; - } - /*Tabview pages*/ - else if(lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) { - lv_obj_add_style(obj, &theme->styles.pad_normal, 0); - lv_obj_add_style(obj, &theme->styles.rotary_scroll, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - return; - } -#endif - -#if LV_USE_WIN - /*Header*/ - if(lv_obj_check_type(parent, &lv_win_class) && lv_obj_get_child(parent, 0) == obj) { - lv_obj_add_style(obj, &theme->styles.bg_color_grey, 0); - lv_obj_add_style(obj, &theme->styles.pad_tiny, 0); - return; - } - /*Content*/ - else if(lv_obj_check_type(parent, &lv_win_class) && lv_obj_get_child(parent, 1) == obj) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - lv_obj_add_style(obj, &theme->styles.pad_normal, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - return; - } -#endif - -#if LV_USE_CALENDAR - if(lv_obj_check_type(parent, &lv_calendar_class)) { - /*No style*/ - return; - } -#endif - - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - } -#if LV_USE_BUTTON - else if(lv_obj_check_type(obj, &lv_button_class)) { - -#if LV_USE_TABVIEW - lv_obj_t * tv = lv_obj_get_parent(parent); /*parent is the tabview header*/ - if(tv && lv_obj_get_child(tv, 0) == parent) { /*The button is on the tab view header*/ - if(lv_obj_check_type(tv, &lv_tabview_class)) { - lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.tab_btn, LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.tab_bg_focus, LV_STATE_FOCUS_KEY); - return; - } - } - -#endif - lv_obj_add_style(obj, &theme->styles.btn, 0); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, 0); - lv_obj_add_style(obj, &theme->styles.transition_delayed, 0); - lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.transition_normal, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); -#if LV_THEME_DEFAULT_GROW - lv_obj_add_style(obj, &theme->styles.grow, LV_STATE_PRESSED); -#endif - lv_obj_add_style(obj, &theme->styles.bg_color_secondary, LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED); - -#if LV_USE_MENU - if(lv_obj_check_type(parent, &lv_menu_sidebar_header_cont_class) || - lv_obj_check_type(parent, &lv_menu_main_header_cont_class)) { - lv_obj_add_style(obj, &theme->styles.menu_header_btn, 0); - lv_obj_add_style(obj, &theme->styles.menu_pressed, LV_STATE_PRESSED); - } -#endif - } -#endif - -#if LV_USE_LINE - else if(lv_obj_check_type(obj, &lv_line_class)) { - lv_obj_add_style(obj, &theme->styles.line, 0); - } -#endif - -#if LV_USE_BUTTONMATRIX - else if(lv_obj_check_type(obj, &lv_buttonmatrix_class)) { - -#if LV_USE_CALENDAR - if(lv_obj_check_type(parent, &lv_calendar_class)) { - lv_obj_add_style(obj, &theme->styles.calendar_btnm_bg, 0); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.calendar_btnm_day, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED); - return; - } -#endif - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.btn, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_ITEMS | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED); - } -#endif - -#if LV_USE_BAR - else if(lv_obj_check_type(obj, &lv_bar_class)) { - lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, 0); - lv_obj_add_style(obj, &theme->styles.circle, 0); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.circle, LV_PART_INDICATOR); - } -#endif - -#if LV_USE_SLIDER - else if(lv_obj_check_type(obj, &lv_slider_class)) { - lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, 0); - lv_obj_add_style(obj, &theme->styles.circle, 0); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.circle, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.knob, LV_PART_KNOB); -#if LV_THEME_DEFAULT_GROW - lv_obj_add_style(obj, &theme->styles.grow, LV_PART_KNOB | LV_STATE_PRESSED); -#endif - lv_obj_add_style(obj, &theme->styles.transition_delayed, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.transition_normal, LV_PART_KNOB | LV_STATE_PRESSED); - } -#endif - -#if LV_USE_TABLE - else if(lv_obj_check_type(obj, &lv_table_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pad_zero, 0); - lv_obj_add_style(obj, &theme->styles.no_radius, 0); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - lv_obj_add_style(obj, &theme->styles.bg_color_white, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.table_cell, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.pad_normal, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.bg_color_secondary, LV_PART_ITEMS | LV_STATE_EDITED); - } -#endif - -#if LV_USE_CHECKBOX - else if(lv_obj_check_type(obj, &lv_checkbox_class)) { - lv_obj_add_style(obj, &theme->styles.pad_gap, 0); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_INDICATOR | LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.cb_marker, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_INDICATOR | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.cb_marker_checked, LV_PART_INDICATOR | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_INDICATOR | LV_STATE_PRESSED); -#if LV_THEME_DEFAULT_GROW - lv_obj_add_style(obj, &theme->styles.grow, LV_PART_INDICATOR | LV_STATE_PRESSED); -#endif - lv_obj_add_style(obj, &theme->styles.transition_normal, LV_PART_INDICATOR | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.transition_delayed, LV_PART_INDICATOR); - } -#endif - -#if LV_USE_SWITCH - else if(lv_obj_check_type(obj, &lv_switch_class)) { - lv_obj_add_style(obj, &theme->styles.bg_color_grey, 0); - lv_obj_add_style(obj, &theme->styles.circle, 0); - lv_obj_add_style(obj, &theme->styles.anim_fast, 0); - lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_INDICATOR | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.circle, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_INDICATOR | LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.knob, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.bg_color_white, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.switch_knob, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_KNOB | LV_STATE_DISABLED); - - lv_obj_add_style(obj, &theme->styles.transition_normal, LV_PART_INDICATOR | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.transition_normal, LV_PART_INDICATOR); - } -#endif - -#if LV_USE_CHART - else if(lv_obj_check_type(obj, &lv_chart_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pad_small, 0); - lv_obj_add_style(obj, &theme->styles.chart_bg, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - lv_obj_add_style(obj, &theme->styles.chart_series, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.chart_indic, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.chart_series, LV_PART_CURSOR); - } -#endif - -#if LV_USE_ROLLER - else if(lv_obj_check_type(obj, &lv_roller_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.anim, 0); - lv_obj_add_style(obj, &theme->styles.line_space_large, 0); - lv_obj_add_style(obj, &theme->styles.text_align_center, 0); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_SELECTED); - } -#endif - -#if LV_USE_DROPDOWN - else if(lv_obj_check_type(obj, &lv_dropdown_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pad_small, 0); - lv_obj_add_style(obj, &theme->styles.transition_delayed, 0); - lv_obj_add_style(obj, &theme->styles.transition_normal, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.transition_normal, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED); - } - else if(lv_obj_check_type(obj, &lv_dropdownlist_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.clip_corner, 0); - lv_obj_add_style(obj, &theme->styles.line_space_large, 0); - lv_obj_add_style(obj, &theme->styles.dropdown_list, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - lv_obj_add_style(obj, &theme->styles.bg_color_white, LV_PART_SELECTED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_SELECTED | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_SELECTED | LV_STATE_PRESSED); - } -#endif - -#if LV_USE_ARC - else if(lv_obj_check_type(obj, &lv_arc_class)) { - lv_obj_add_style(obj, &theme->styles.arc_indic, 0); - lv_obj_add_style(obj, &theme->styles.arc_indic, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.arc_indic_primary, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.knob, LV_PART_KNOB); - } -#endif - -#if LV_USE_SPINNER - else if(lv_obj_check_type(obj, &lv_spinner_class)) { - lv_obj_add_style(obj, &theme->styles.arc_indic, 0); - lv_obj_add_style(obj, &theme->styles.arc_indic, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.arc_indic_primary, LV_PART_INDICATOR); - } -#endif - -#if LV_USE_TEXTAREA - else if(lv_obj_check_type(obj, &lv_textarea_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pad_small, 0); - lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - lv_obj_add_style(obj, &theme->styles.ta_cursor, LV_PART_CURSOR | LV_STATE_FOCUSED); - lv_obj_add_style(obj, &theme->styles.ta_placeholder, LV_PART_TEXTAREA_PLACEHOLDER); - } -#endif - -#if LV_USE_CALENDAR - else if(lv_obj_check_type(obj, &lv_calendar_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pad_zero, 0); - } - -#if LV_USE_CALENDAR_HEADER_ARROW - else if(lv_obj_check_type(obj, &lv_calendar_header_arrow_class)) { - lv_obj_add_style(obj, &theme->styles.calendar_header, 0); - } -#endif - -#if LV_USE_CALENDAR_HEADER_DROPDOWN - else if(lv_obj_check_type(obj, &lv_calendar_header_dropdown_class)) { - lv_obj_add_style(obj, &theme->styles.calendar_header, 0); - } -#endif -#endif - -#if LV_USE_KEYBOARD - else if(lv_obj_check_type(obj, &lv_keyboard_class)) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - lv_obj_add_style(obj, theme->disp_size == DISP_LARGE ? &theme->styles.pad_small : &theme->styles.pad_tiny, 0); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.btn, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.bg_color_white, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.keyboard_button_bg, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.bg_color_grey, LV_PART_ITEMS | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.bg_color_secondary_muted, LV_PART_ITEMS | LV_STATE_EDITED); - } -#endif -#if LV_USE_LIST - else if(lv_obj_check_type(obj, &lv_list_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.list_bg, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - return; - } - else if(lv_obj_check_type(obj, &lv_list_text_class)) { - lv_obj_add_style(obj, &theme->styles.bg_color_grey, 0); - lv_obj_add_style(obj, &theme->styles.list_item_grow, 0); - } - else if(lv_obj_check_type(obj, &lv_list_button_class)) { - lv_obj_add_style(obj, &theme->styles.bg_color_white, 0); - lv_obj_add_style(obj, &theme->styles.list_btn, 0); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.list_item_grow, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.list_item_grow, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED); - - } -#endif -#if LV_USE_MENU - else if(lv_obj_check_type(obj, &lv_menu_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.menu_bg, 0); - } - else if(lv_obj_check_type(obj, &lv_menu_sidebar_cont_class)) { - lv_obj_add_style(obj, &theme->styles.menu_sidebar_cont, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - } - else if(lv_obj_check_type(obj, &lv_menu_main_cont_class)) { - lv_obj_add_style(obj, &theme->styles.menu_main_cont, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - } - else if(lv_obj_check_type(obj, &lv_menu_cont_class)) { - lv_obj_add_style(obj, &theme->styles.menu_cont, 0); - lv_obj_add_style(obj, &theme->styles.menu_pressed, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, LV_STATE_PRESSED | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_STATE_FOCUS_KEY); - } - else if(lv_obj_check_type(obj, &lv_menu_sidebar_header_cont_class) || - lv_obj_check_type(obj, &lv_menu_main_header_cont_class)) { - lv_obj_add_style(obj, &theme->styles.menu_header_cont, 0); - } - else if(lv_obj_check_type(obj, &lv_menu_page_class)) { - lv_obj_add_style(obj, &theme->styles.menu_page, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - } - else if(lv_obj_check_type(obj, &lv_menu_section_class)) { - lv_obj_add_style(obj, &theme->styles.menu_section, 0); - } - else if(lv_obj_check_type(obj, &lv_menu_separator_class)) { - lv_obj_add_style(obj, &theme->styles.menu_separator, 0); - } -#endif -#if LV_USE_MSGBOX - else if(lv_obj_check_type(obj, &lv_msgbox_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pad_zero, 0); - lv_obj_add_style(obj, &theme->styles.clip_corner, 0); - return; - } - else if(lv_obj_check_type(obj, &lv_msgbox_backdrop_class)) { - lv_obj_add_style(obj, &theme->styles.msgbox_backdrop_bg, 0); - return; - } - else if(lv_obj_check_type(obj, &lv_msgbox_header_class)) { - lv_obj_add_style(obj, &theme->styles.pad_tiny, 0); - lv_obj_add_style(obj, &theme->styles.bg_color_grey, 0); - return; - } - else if(lv_obj_check_type(obj, &lv_msgbox_footer_class)) { - lv_obj_add_style(obj, &theme->styles.pad_tiny, 0); - return; - } - else if(lv_obj_check_type(obj, &lv_msgbox_content_class)) { - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - lv_obj_add_style(obj, &theme->styles.pad_tiny, 0); - return; - } - else if(lv_obj_check_type(obj, &lv_msgbox_header_button_class) || - lv_obj_check_type(obj, &lv_msgbox_footer_button_class)) { - lv_obj_add_style(obj, &theme->styles.btn, 0); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, 0); - lv_obj_add_style(obj, &theme->styles.transition_delayed, 0); - lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.transition_normal, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.bg_color_secondary, LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED); - return; - } - -#endif - -#if LV_USE_SPINBOX - else if(lv_obj_check_type(obj, &lv_spinbox_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pad_small, 0); - lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_CURSOR); - } -#endif -#if LV_USE_TILEVIEW - else if(lv_obj_check_type(obj, &lv_tileview_class)) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - } - else if(lv_obj_check_type(obj, &lv_tileview_tile_class)) { - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - } -#endif - -#if LV_USE_TABVIEW - else if(lv_obj_check_type(obj, &lv_tabview_class)) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - lv_obj_add_style(obj, &theme->styles.pad_zero, 0); - } -#endif - -#if LV_USE_WIN - else if(lv_obj_check_type(obj, &lv_win_class)) { - lv_obj_add_style(obj, &theme->styles.clip_corner, 0); - } -#endif - -#if LV_USE_LED - else if(lv_obj_check_type(obj, &lv_led_class)) { - lv_obj_add_style(obj, &theme->styles.led, 0); - } -#endif - -#if LV_USE_SCALE - else if(lv_obj_check_type(obj, &lv_scale_class)) { - lv_obj_add_style(obj, &theme->styles.scale, LV_PART_MAIN); - lv_obj_add_style(obj, &theme->styles.scale, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.scale, LV_PART_ITEMS); - } -#endif -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void style_init_reset(lv_style_t * style) -{ - if(theme_def->inited) { - lv_style_reset(style); - } - else { - lv_style_init(style); - } -} - -#endif diff --git a/L3_Middlewares/LVGL/src/themes/lv_theme_private.h b/L3_Middlewares/LVGL/src/themes/lv_theme_private.h deleted file mode 100644 index 6fd10a5..0000000 --- a/L3_Middlewares/LVGL/src/themes/lv_theme_private.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file lv_theme_private.h - * - */ - -#ifndef LV_THEME_PRIVATE_H -#define LV_THEME_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_theme.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_theme_t { - lv_theme_apply_cb_t apply_cb; - lv_theme_t * parent; /**< Apply the current theme's style on top of this theme. */ - void * user_data; - lv_display_t * disp; - lv_color_t color_primary; - lv_color_t color_secondary; - const lv_font_t * font_small; - const lv_font_t * font_normal; - const lv_font_t * font_large; - uint32_t flags; /**< Any custom flag used by the theme */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_THEME_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/themes/mono/lv_theme_mono.c b/L3_Middlewares/LVGL/src/themes/mono/lv_theme_mono.c deleted file mode 100644 index cd71ecb..0000000 --- a/L3_Middlewares/LVGL/src/themes/mono/lv_theme_mono.c +++ /dev/null @@ -1,532 +0,0 @@ -/** - * @file lv_theme_mono.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../lv_theme_private.h" -#include "../../../lvgl.h" - -#if LV_USE_THEME_MONO - -#include "lv_theme_mono.h" -#include "../../core/lv_global.h" - -/********************* - * DEFINES - *********************/ -struct _my_theme_t; -typedef struct _my_theme_t my_theme_t; - -#define theme_def (*(my_theme_t **)(&LV_GLOBAL_DEFAULT()->theme_mono)) - -#define COLOR_FG dark_bg ? lv_color_white() : lv_color_black() -#define COLOR_BG dark_bg ? lv_color_black() : lv_color_white() - -#define BORDER_W_NORMAL 1 -#define BORDER_W_PR 3 -#define BORDER_W_DIS 0 -#define BORDER_W_FOCUS 1 -#define BORDER_W_EDIT 2 -#define PAD_DEF 4 - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - lv_style_t scr; - lv_style_t card; - lv_style_t scrollbar; - lv_style_t pr; - lv_style_t inv; - lv_style_t disabled; - lv_style_t focus; - lv_style_t edit; - lv_style_t pad_gap; - lv_style_t pad_zero; - lv_style_t no_radius; - lv_style_t radius_circle; - lv_style_t large_border; - lv_style_t large_line_space; - lv_style_t underline; -#if LV_USE_TEXTAREA - lv_style_t ta_cursor; -#endif -#if LV_USE_CHART - lv_style_t chart_indic; -#endif -} my_theme_styles_t; - -struct _my_theme_t { - lv_theme_t base; - my_theme_styles_t styles; - bool inited; -}; - -/********************** - * STATIC PROTOTYPES - **********************/ -static void style_init_reset(lv_style_t * style); -static void theme_apply(lv_theme_t * th, lv_obj_t * obj); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void style_init(my_theme_t * theme, bool dark_bg, const lv_font_t * font) -{ - style_init_reset(&theme->styles.scrollbar); - lv_style_set_bg_opa(&theme->styles.scrollbar, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.scrollbar, COLOR_FG); - lv_style_set_width(&theme->styles.scrollbar, PAD_DEF); - - style_init_reset(&theme->styles.scr); - lv_style_set_bg_opa(&theme->styles.scr, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.scr, COLOR_BG); - lv_style_set_text_color(&theme->styles.scr, COLOR_FG); - lv_style_set_pad_row(&theme->styles.scr, PAD_DEF); - lv_style_set_pad_column(&theme->styles.scr, PAD_DEF); - lv_style_set_text_font(&theme->styles.scr, font); - - style_init_reset(&theme->styles.card); - lv_style_set_bg_opa(&theme->styles.card, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.card, COLOR_BG); - lv_style_set_border_color(&theme->styles.card, COLOR_FG); - lv_style_set_radius(&theme->styles.card, 2); - lv_style_set_border_width(&theme->styles.card, BORDER_W_NORMAL); - lv_style_set_pad_all(&theme->styles.card, PAD_DEF); - lv_style_set_pad_gap(&theme->styles.card, PAD_DEF); - lv_style_set_text_color(&theme->styles.card, COLOR_FG); - lv_style_set_line_width(&theme->styles.card, 2); - lv_style_set_line_color(&theme->styles.card, COLOR_FG); - lv_style_set_arc_width(&theme->styles.card, 2); - lv_style_set_arc_color(&theme->styles.card, COLOR_FG); - lv_style_set_outline_color(&theme->styles.card, COLOR_FG); - lv_style_set_anim_duration(&theme->styles.card, 300); - - style_init_reset(&theme->styles.pr); - lv_style_set_border_width(&theme->styles.pr, BORDER_W_PR); - - style_init_reset(&theme->styles.inv); - lv_style_set_bg_opa(&theme->styles.inv, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.inv, COLOR_FG); - lv_style_set_border_color(&theme->styles.inv, COLOR_BG); - lv_style_set_line_color(&theme->styles.inv, COLOR_BG); - lv_style_set_arc_color(&theme->styles.inv, COLOR_BG); - lv_style_set_text_color(&theme->styles.inv, COLOR_BG); - lv_style_set_outline_color(&theme->styles.inv, COLOR_BG); - - style_init_reset(&theme->styles.disabled); - lv_style_set_border_width(&theme->styles.disabled, BORDER_W_DIS); - - style_init_reset(&theme->styles.focus); - lv_style_set_outline_width(&theme->styles.focus, 1); - lv_style_set_outline_pad(&theme->styles.focus, BORDER_W_FOCUS); - - style_init_reset(&theme->styles.edit); - lv_style_set_outline_width(&theme->styles.edit, BORDER_W_EDIT); - - style_init_reset(&theme->styles.large_border); - lv_style_set_border_width(&theme->styles.large_border, BORDER_W_EDIT); - - style_init_reset(&theme->styles.pad_gap); - lv_style_set_pad_gap(&theme->styles.pad_gap, PAD_DEF); - - style_init_reset(&theme->styles.pad_zero); - lv_style_set_pad_all(&theme->styles.pad_zero, 0); - lv_style_set_pad_gap(&theme->styles.pad_zero, 0); - - style_init_reset(&theme->styles.no_radius); - lv_style_set_radius(&theme->styles.no_radius, 0); - - style_init_reset(&theme->styles.radius_circle); - lv_style_set_radius(&theme->styles.radius_circle, LV_RADIUS_CIRCLE); - - style_init_reset(&theme->styles.large_line_space); - lv_style_set_text_line_space(&theme->styles.large_line_space, 6); - - style_init_reset(&theme->styles.underline); - lv_style_set_text_decor(&theme->styles.underline, LV_TEXT_DECOR_UNDERLINE); - -#if LV_USE_TEXTAREA - style_init_reset(&theme->styles.ta_cursor); - lv_style_set_border_side(&theme->styles.ta_cursor, LV_BORDER_SIDE_LEFT); - lv_style_set_border_color(&theme->styles.ta_cursor, COLOR_FG); - lv_style_set_border_width(&theme->styles.ta_cursor, 2); - lv_style_set_bg_opa(&theme->styles.ta_cursor, LV_OPA_TRANSP); - lv_style_set_anim_duration(&theme->styles.ta_cursor, 500); -#endif - -#if LV_USE_CHART - style_init_reset(&theme->styles.chart_indic); - lv_style_set_radius(&theme->styles.chart_indic, LV_RADIUS_CIRCLE); - lv_style_set_size(&theme->styles.chart_indic, lv_display_dpx(theme->base.disp, 8), lv_display_dpx(theme->base.disp, 8)); - lv_style_set_bg_color(&theme->styles.chart_indic, COLOR_FG); - lv_style_set_bg_opa(&theme->styles.chart_indic, LV_OPA_COVER); -#endif -} - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -bool lv_theme_mono_is_inited(void) -{ - my_theme_t * theme = theme_def; - if(theme == NULL) return false; - return theme->inited; -} - -void lv_theme_mono_deinit(void) -{ - my_theme_t * theme = theme_def; - if(theme) { - if(theme->inited) { - lv_style_t * theme_styles = (lv_style_t *)(&(theme->styles)); - uint32_t i; - for(i = 0; i < sizeof(my_theme_styles_t) / sizeof(lv_style_t); i++) { - lv_style_reset(theme_styles + i); - } - } - lv_free(theme_def); - theme_def = NULL; - } -} - -lv_theme_t * lv_theme_mono_init(lv_display_t * disp, bool dark_bg, const lv_font_t * font) -{ - /*This trick is required only to avoid the garbage collection of - *styles' data if LVGL is used in a binding (e.g. MicroPython) - *In a general case styles could be in simple `static lv_style_t my_style...` variables*/ - if(!lv_theme_mono_is_inited()) { - theme_def = lv_malloc_zeroed(sizeof(my_theme_t)); - } - - my_theme_t * theme = theme_def; - - theme->base.disp = disp; - theme->base.font_small = LV_FONT_DEFAULT; - theme->base.font_normal = LV_FONT_DEFAULT; - theme->base.font_large = LV_FONT_DEFAULT; - theme->base.apply_cb = theme_apply; - - style_init(theme, dark_bg, font); - - if(disp == NULL || lv_display_get_theme(disp) == (lv_theme_t *) theme) lv_obj_report_style_change(NULL); - - theme->inited = true; - - return (lv_theme_t *)theme_def; -} - -static void theme_apply(lv_theme_t * th, lv_obj_t * obj) -{ - LV_UNUSED(th); - - my_theme_t * theme = theme_def; - lv_obj_t * parent = lv_obj_get_parent(obj); - - if(parent == NULL) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - return; - } - - if(lv_obj_check_type(obj, &lv_obj_class)) { -#if LV_USE_TABVIEW - /*Tabview content area*/ - if(lv_obj_check_type(parent, &lv_tabview_class)) { - return; - } - /*Tabview pages*/ - else if(lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.no_radius, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - return; - } -#endif - -#if LV_USE_WIN - /*Header*/ - if(lv_obj_check_type(parent, &lv_win_class) && lv_obj_get_child(parent, 0) == 0) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.no_radius, 0); - return; - } - /*Content*/ - else if(lv_obj_check_type(parent, &lv_win_class) && lv_obj_get_child(parent, 1) == obj) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.no_radius, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - return; - } -#endif - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - } -#if LV_USE_BUTTON - else if(lv_obj_check_type(obj, &lv_button_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pr, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.inv, LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - } -#endif - -#if LV_USE_BUTTONMATRIX - else if(lv_obj_check_type(obj, &lv_buttonmatrix_class)) { -#if LV_USE_MSGBOX - if(lv_obj_check_type(parent, &lv_msgbox_class)) { - lv_obj_add_style(obj, &theme->styles.pad_gap, 0); - lv_obj_add_style(obj, &theme->styles.card, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.pr, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.underline, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.large_border, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - return; - } -#endif -#if LV_USE_TABVIEW - if(lv_obj_check_type(parent, &lv_tabview_class)) { - lv_obj_add_style(obj, &theme->styles.pad_gap, 0); - lv_obj_add_style(obj, &theme->styles.card, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.pr, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_ITEMS | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.underline, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.large_border, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - return; - } -#endif - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.card, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.pr, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_ITEMS | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.underline, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.large_border, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - } -#endif - -#if LV_USE_BAR - else if(lv_obj_check_type(obj, &lv_bar_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pad_zero, 0); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - } -#endif - -#if LV_USE_SLIDER - else if(lv_obj_check_type(obj, &lv_slider_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pad_zero, 0); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.card, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.radius_circle, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - } -#endif - -#if LV_USE_TABLE - else if(lv_obj_check_type(obj, &lv_table_class)) { - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.card, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.no_radius, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.pr, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - } -#endif - -#if LV_USE_CHECKBOX - else if(lv_obj_check_type(obj, &lv_checkbox_class)) { - lv_obj_add_style(obj, &theme->styles.pad_gap, LV_PART_MAIN); - lv_obj_add_style(obj, &theme->styles.card, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_INDICATOR | LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_INDICATOR | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.pr, LV_PART_INDICATOR | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - } -#endif - -#if LV_USE_SWITCH - else if(lv_obj_check_type(obj, &lv_switch_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.radius_circle, 0); - lv_obj_add_style(obj, &theme->styles.pad_zero, 0); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.radius_circle, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.card, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.radius_circle, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.pad_zero, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - } -#endif - -#if LV_USE_CHART - else if(lv_obj_check_type(obj, &lv_chart_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.chart_indic, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.card, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.card, LV_PART_CURSOR); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - } -#endif - -#if LV_USE_ROLLER - else if(lv_obj_check_type(obj, &lv_roller_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.large_line_space, 0); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_SELECTED); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - } -#endif - -#if LV_USE_DROPDOWN - else if(lv_obj_check_type(obj, &lv_dropdown_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pr, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - } - else if(lv_obj_check_type(obj, &lv_dropdownlist_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.large_line_space, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_SELECTED | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.pr, LV_PART_SELECTED | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - } -#endif - -#if LV_USE_ARC - else if(lv_obj_check_type(obj, &lv_arc_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.pad_zero, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.card, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.radius_circle, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - } -#endif - -#if LV_USE_TEXTAREA - else if(lv_obj_check_type(obj, &lv_textarea_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.ta_cursor, LV_PART_CURSOR | LV_STATE_FOCUSED); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUSED); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - } -#endif - -#if LV_USE_CALENDAR - else if(lv_obj_check_type(obj, &lv_calendar_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.no_radius, 0); - lv_obj_add_style(obj, &theme->styles.pr, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.large_border, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - } -#endif - -#if LV_USE_KEYBOARD - else if(lv_obj_check_type(obj, &lv_keyboard_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.card, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.pr, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_ITEMS | LV_STATE_CHECKED); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - lv_obj_add_style(obj, &theme->styles.large_border, LV_PART_ITEMS | LV_STATE_EDITED); - } -#endif -#if LV_USE_LIST - else if(lv_obj_check_type(obj, &lv_list_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - return; - } - else if(lv_obj_check_type(obj, &lv_list_text_class)) { - - } - else if(lv_obj_check_type(obj, &lv_list_button_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.pr, LV_STATE_PRESSED); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.large_border, LV_STATE_EDITED); - - } -#endif -#if LV_USE_MSGBOX - else if(lv_obj_check_type(obj, &lv_msgbox_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - return; - } -#endif -#if LV_USE_SPINBOX - else if(lv_obj_check_type(obj, &lv_spinbox_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - lv_obj_add_style(obj, &theme->styles.inv, LV_PART_CURSOR); - lv_obj_add_style(obj, &theme->styles.focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &theme->styles.edit, LV_STATE_EDITED); - } -#endif -#if LV_USE_TILEVIEW - else if(lv_obj_check_type(obj, &lv_tileview_class)) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - } - else if(lv_obj_check_type(obj, &lv_tileview_tile_class)) { - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - } -#endif - -#if LV_USE_LED - else if(lv_obj_check_type(obj, &lv_led_class)) { - lv_obj_add_style(obj, &theme->styles.card, 0); - } -#endif -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void style_init_reset(lv_style_t * style) -{ - if(lv_theme_mono_is_inited()) { - lv_style_reset(style); - } - else { - lv_style_init(style); - } -} - -#endif diff --git a/L3_Middlewares/LVGL/src/themes/simple/lv_theme_simple.c b/L3_Middlewares/LVGL/src/themes/simple/lv_theme_simple.c deleted file mode 100644 index 8a32555..0000000 --- a/L3_Middlewares/LVGL/src/themes/simple/lv_theme_simple.c +++ /dev/null @@ -1,438 +0,0 @@ -/** - * @file lv_theme_simple.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "../lv_theme_private.h" -#include "../../../lvgl.h" /*To see all the widgets*/ - -#if LV_USE_THEME_SIMPLE - -#include "lv_theme_simple.h" -#include "../../core/lv_global.h" - -/********************* - * DEFINES - *********************/ - -struct _my_theme_t; -typedef struct _my_theme_t my_theme_t; - -#define theme_def (*(my_theme_t **)(&LV_GLOBAL_DEFAULT()->theme_simple)) - -#define COLOR_SCR lv_palette_lighten(LV_PALETTE_GREY, 4) -#define COLOR_WHITE lv_color_white() -#define COLOR_LIGHT lv_palette_lighten(LV_PALETTE_GREY, 2) -#define COLOR_DARK lv_palette_main(LV_PALETTE_GREY) -#define COLOR_DIM lv_palette_darken(LV_PALETTE_GREY, 2) -#define SCROLLBAR_WIDTH 2 - -/********************** - * TYPEDEFS - **********************/ -typedef struct { - lv_style_t scr; - lv_style_t transp; - lv_style_t white; - lv_style_t light; - lv_style_t dark; - lv_style_t dim; - lv_style_t scrollbar; -#if LV_USE_ARC - lv_style_t arc_line; - lv_style_t arc_knob; -#endif -#if LV_USE_TEXTAREA - lv_style_t ta_cursor; -#endif -} my_theme_styles_t; - -struct _my_theme_t { - lv_theme_t base; - my_theme_styles_t styles; - bool inited; -}; - -/********************** - * STATIC PROTOTYPES - **********************/ -static void style_init_reset(lv_style_t * style); -static void theme_apply(lv_theme_t * th, lv_obj_t * obj); - -/********************** - * STATIC VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void style_init(my_theme_t * theme) -{ - style_init_reset(&theme->styles.scrollbar); - lv_style_set_bg_opa(&theme->styles.scrollbar, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.scrollbar, COLOR_DARK); - lv_style_set_width(&theme->styles.scrollbar, SCROLLBAR_WIDTH); - - style_init_reset(&theme->styles.scr); - lv_style_set_bg_opa(&theme->styles.scr, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.scr, COLOR_SCR); - lv_style_set_text_color(&theme->styles.scr, COLOR_DIM); - - style_init_reset(&theme->styles.transp); - lv_style_set_bg_opa(&theme->styles.transp, LV_OPA_TRANSP); - - style_init_reset(&theme->styles.white); - lv_style_set_bg_opa(&theme->styles.white, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.white, COLOR_WHITE); - lv_style_set_line_width(&theme->styles.white, 1); - lv_style_set_line_color(&theme->styles.white, COLOR_WHITE); - lv_style_set_arc_width(&theme->styles.white, 2); - lv_style_set_arc_color(&theme->styles.white, COLOR_WHITE); - - style_init_reset(&theme->styles.light); - lv_style_set_bg_opa(&theme->styles.light, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.light, COLOR_LIGHT); - lv_style_set_line_width(&theme->styles.light, 1); - lv_style_set_line_color(&theme->styles.light, COLOR_LIGHT); - lv_style_set_arc_width(&theme->styles.light, 2); - lv_style_set_arc_color(&theme->styles.light, COLOR_LIGHT); - - style_init_reset(&theme->styles.dark); - lv_style_set_bg_opa(&theme->styles.dark, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.dark, COLOR_DARK); - lv_style_set_line_width(&theme->styles.dark, 1); - lv_style_set_line_color(&theme->styles.dark, COLOR_DARK); - lv_style_set_arc_width(&theme->styles.dark, 2); - lv_style_set_arc_color(&theme->styles.dark, COLOR_DARK); - - style_init_reset(&theme->styles.dim); - lv_style_set_bg_opa(&theme->styles.dim, LV_OPA_COVER); - lv_style_set_bg_color(&theme->styles.dim, COLOR_DIM); - lv_style_set_line_width(&theme->styles.dim, 1); - lv_style_set_line_color(&theme->styles.dim, COLOR_DIM); - lv_style_set_arc_width(&theme->styles.dim, 2); - lv_style_set_arc_color(&theme->styles.dim, COLOR_DIM); - -#if LV_USE_ARC - style_init_reset(&theme->styles.arc_line); - lv_style_set_arc_width(&theme->styles.arc_line, 6); - style_init_reset(&theme->styles.arc_knob); - lv_style_set_pad_all(&theme->styles.arc_knob, 5); -#endif - -#if LV_USE_TEXTAREA - style_init_reset(&theme->styles.ta_cursor); - lv_style_set_border_side(&theme->styles.ta_cursor, LV_BORDER_SIDE_LEFT); - lv_style_set_border_color(&theme->styles.ta_cursor, COLOR_DIM); - lv_style_set_border_width(&theme->styles.ta_cursor, 2); - lv_style_set_bg_opa(&theme->styles.ta_cursor, LV_OPA_TRANSP); - lv_style_set_anim_duration(&theme->styles.ta_cursor, 500); -#endif -} - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -bool lv_theme_simple_is_inited(void) -{ - my_theme_t * theme = theme_def; - if(theme == NULL) return false; - return theme->inited; -} - -lv_theme_t * lv_theme_simple_get(void) -{ - if(!lv_theme_simple_is_inited()) { - return NULL; - } - - return (lv_theme_t *)theme_def; -} - -void lv_theme_simple_deinit(void) -{ - my_theme_t * theme = theme_def; - if(theme) { - if(theme->inited) { - lv_style_t * theme_styles = (lv_style_t *)(&(theme->styles)); - uint32_t i; - for(i = 0; i < sizeof(my_theme_styles_t) / sizeof(lv_style_t); i++) { - lv_style_reset(theme_styles + i); - } - } - lv_free(theme_def); - theme_def = NULL; - } -} - -lv_theme_t * lv_theme_simple_init(lv_display_t * disp) -{ - /*This trick is required only to avoid the garbage collection of - *styles' data if LVGL is used in a binding (e.g. MicroPython) - *In a general case styles could be in simple `static lv_style_t my_style...` variables*/ - if(!lv_theme_simple_is_inited()) { - theme_def = lv_malloc_zeroed(sizeof(my_theme_t)); - } - - my_theme_t * theme = theme_def; - - theme->base.disp = disp; - theme->base.font_small = LV_FONT_DEFAULT; - theme->base.font_normal = LV_FONT_DEFAULT; - theme->base.font_large = LV_FONT_DEFAULT; - theme->base.apply_cb = theme_apply; - - style_init(theme); - - if(disp == NULL || lv_display_get_theme(disp) == (lv_theme_t *)theme) { - lv_obj_report_style_change(NULL); - } - - theme->inited = true; - - return (lv_theme_t *)theme_def; -} - -static void theme_apply(lv_theme_t * th, lv_obj_t * obj) -{ - LV_UNUSED(th); - - my_theme_t * theme = theme_def; - lv_obj_t * parent = lv_obj_get_parent(obj); - - if(parent == NULL) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - return; - } - - if(lv_obj_check_type(obj, &lv_obj_class)) { -#if LV_USE_TABVIEW - /*Tabview content area*/ - if(lv_obj_check_type(parent, &lv_tabview_class)) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - return; - } - /*Tabview pages*/ - else if(lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - return; - } -#endif - -#if LV_USE_WIN - /*Header*/ - if(lv_obj_check_type(parent, &lv_win_class) && lv_obj_get_child(parent, 0) == obj) { - lv_obj_add_style(obj, &theme->styles.light, 0); - return; - } - /*Content*/ - else if(lv_obj_check_type(parent, &lv_win_class) && lv_obj_get_child(parent, 1) == obj) { - lv_obj_add_style(obj, &theme->styles.light, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - return; - } -#endif - lv_obj_add_style(obj, &theme->styles.white, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - } -#if LV_USE_BUTTON - else if(lv_obj_check_type(obj, &lv_button_class)) { - lv_obj_add_style(obj, &theme->styles.dark, 0); - } -#endif - -#if LV_USE_BUTTONMATRIX - else if(lv_obj_check_type(obj, &lv_buttonmatrix_class)) { -#if LV_USE_MSGBOX - if(lv_obj_check_type(parent, &lv_msgbox_class)) { - lv_obj_add_style(obj, &theme->styles.light, LV_PART_ITEMS); - return; - } -#endif -#if LV_USE_TABVIEW - if(lv_obj_check_type(parent, &lv_tabview_class)) { - lv_obj_add_style(obj, &theme->styles.light, LV_PART_ITEMS); - return; - } -#endif - lv_obj_add_style(obj, &theme->styles.white, 0); - lv_obj_add_style(obj, &theme->styles.light, LV_PART_ITEMS); - } -#endif - -#if LV_USE_BAR - else if(lv_obj_check_type(obj, &lv_bar_class)) { - lv_obj_add_style(obj, &theme->styles.light, 0); - lv_obj_add_style(obj, &theme->styles.dark, LV_PART_INDICATOR); - } -#endif - -#if LV_USE_SLIDER - else if(lv_obj_check_type(obj, &lv_slider_class)) { - lv_obj_add_style(obj, &theme->styles.light, 0); - lv_obj_add_style(obj, &theme->styles.dark, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.dim, LV_PART_KNOB); - } -#endif - -#if LV_USE_TABLE - else if(lv_obj_check_type(obj, &lv_table_class)) { - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.light, LV_PART_ITEMS); - } -#endif - -#if LV_USE_CHECKBOX - else if(lv_obj_check_type(obj, &lv_checkbox_class)) { - lv_obj_add_style(obj, &theme->styles.light, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.dark, LV_PART_INDICATOR | LV_STATE_CHECKED); - } -#endif - -#if LV_USE_SWITCH - else if(lv_obj_check_type(obj, &lv_switch_class)) { - lv_obj_add_style(obj, &theme->styles.light, 0); - lv_obj_add_style(obj, &theme->styles.dim, LV_PART_KNOB); - } -#endif - -#if LV_USE_CHART - else if(lv_obj_check_type(obj, &lv_chart_class)) { - lv_obj_add_style(obj, &theme->styles.white, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.light, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.dark, LV_PART_CURSOR); - } -#endif - -#if LV_USE_ROLLER - else if(lv_obj_check_type(obj, &lv_roller_class)) { - lv_obj_add_style(obj, &theme->styles.light, 0); - lv_obj_add_style(obj, &theme->styles.dark, LV_PART_SELECTED); - } -#endif - -#if LV_USE_DROPDOWN - else if(lv_obj_check_type(obj, &lv_dropdown_class)) { - lv_obj_add_style(obj, &theme->styles.white, 0); - } - else if(lv_obj_check_type(obj, &lv_dropdownlist_class)) { - lv_obj_add_style(obj, &theme->styles.white, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.light, LV_PART_SELECTED); - lv_obj_add_style(obj, &theme->styles.dark, LV_PART_SELECTED | LV_STATE_CHECKED); - } -#endif - -#if LV_USE_ARC - else if(lv_obj_check_type(obj, &lv_arc_class)) { - lv_obj_add_style(obj, &theme->styles.light, 0); - lv_obj_add_style(obj, &theme->styles.transp, 0); - lv_obj_add_style(obj, &theme->styles.arc_line, 0); - lv_obj_add_style(obj, &theme->styles.dark, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.arc_line, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.dim, LV_PART_KNOB); - lv_obj_add_style(obj, &theme->styles.arc_knob, LV_PART_KNOB); - } -#endif - -#if LV_USE_SPINNER - else if(lv_obj_check_type(obj, &lv_spinner_class)) { - lv_obj_add_style(obj, &theme->styles.light, 0); - lv_obj_add_style(obj, &theme->styles.transp, 0); - lv_obj_add_style(obj, &theme->styles.arc_line, 0); - lv_obj_add_style(obj, &theme->styles.dark, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.arc_line, LV_PART_INDICATOR); - } -#endif - -#if LV_USE_TEXTAREA - else if(lv_obj_check_type(obj, &lv_textarea_class)) { - lv_obj_add_style(obj, &theme->styles.white, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &theme->styles.ta_cursor, LV_PART_CURSOR | LV_STATE_FOCUSED); - } -#endif - -#if LV_USE_CALENDAR - else if(lv_obj_check_type(obj, &lv_calendar_class)) { - lv_obj_add_style(obj, &theme->styles.light, 0); - } -#endif - -#if LV_USE_KEYBOARD - else if(lv_obj_check_type(obj, &lv_keyboard_class)) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - lv_obj_add_style(obj, &theme->styles.white, LV_PART_ITEMS); - lv_obj_add_style(obj, &theme->styles.light, LV_PART_ITEMS | LV_STATE_CHECKED); - } -#endif -#if LV_USE_LIST - else if(lv_obj_check_type(obj, &lv_list_class)) { - lv_obj_add_style(obj, &theme->styles.light, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - return; - } - else if(lv_obj_check_type(obj, &lv_list_text_class)) { - - } - else if(lv_obj_check_type(obj, &lv_list_button_class)) { - lv_obj_add_style(obj, &theme->styles.dark, 0); - - } -#endif -#if LV_USE_MSGBOX - else if(lv_obj_check_type(obj, &lv_msgbox_class)) { - lv_obj_add_style(obj, &theme->styles.light, 0); - return; - } -#endif -#if LV_USE_SPINBOX - else if(lv_obj_check_type(obj, &lv_spinbox_class)) { - lv_obj_add_style(obj, &theme->styles.light, 0); - lv_obj_add_style(obj, &theme->styles.dark, LV_PART_CURSOR); - } -#endif -#if LV_USE_TILEVIEW - else if(lv_obj_check_type(obj, &lv_tileview_class)) { - lv_obj_add_style(obj, &theme->styles.scr, 0); - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - } - else if(lv_obj_check_type(obj, &lv_tileview_tile_class)) { - lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); - } -#endif - -#if LV_USE_LED - else if(lv_obj_check_type(obj, &lv_led_class)) { - lv_obj_add_style(obj, &theme->styles.light, 0); - } -#endif -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void style_init_reset(lv_style_t * style) -{ - if(lv_theme_simple_is_inited()) { - lv_style_reset(style); - } - else { - lv_style_init(style); - } -} - -#endif diff --git a/L3_Middlewares/LVGL/src/tick/lv_tick.h b/L3_Middlewares/LVGL/src/tick/lv_tick.h deleted file mode 100644 index 048b93a..0000000 --- a/L3_Middlewares/LVGL/src/tick/lv_tick.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @file lv_tick.h - * Provide access to the system tick with 1 millisecond resolution - */ - -#ifndef LV_TICK_H -#define LV_TICK_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../lv_conf_internal.h" - -#include "../misc/lv_types.h" - -/********************* - * DEFINES - *********************/ -#ifndef LV_ATTRIBUTE_TICK_INC -#define LV_ATTRIBUTE_TICK_INC -#endif - -/********************** - * TYPEDEFS - **********************/ -typedef uint32_t (*lv_tick_get_cb_t)(void); - -typedef void (*lv_delay_cb_t)(uint32_t ms); - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * You have to call this function periodically - * @param tick_period the call period of this function in milliseconds - */ -LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period); - -/** - * Get the elapsed milliseconds since start up - * @return the elapsed milliseconds - */ -uint32_t lv_tick_get(void); - -/** - * Get the elapsed milliseconds since a previous time stamp - * @param prev_tick a previous time stamp (return value of lv_tick_get() ) - * @return the elapsed milliseconds since 'prev_tick' - */ -uint32_t lv_tick_elaps(uint32_t prev_tick); - -/** - * Delay for the given milliseconds. - * By default it's a blocking delay, but with `lv_delay_set_cb()` - * a custom delay function can be set too - * @param ms the number of milliseconds to delay - */ -void lv_delay_ms(uint32_t ms); - -/** - * Set the custom callback for 'lv_tick_get' - * @param cb call this callback on 'lv_tick_get' - */ -void lv_tick_set_cb(lv_tick_get_cb_t cb); - -/** - * Set a custom callback for 'lv_delay_ms' - * @param cb call this callback in 'lv_delay_ms' - */ -void lv_delay_set_cb(lv_delay_cb_t cb); - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_TICK_H*/ diff --git a/L3_Middlewares/LVGL/src/tick/lv_tick_private.h b/L3_Middlewares/LVGL/src/tick/lv_tick_private.h deleted file mode 100644 index cf8ae9b..0000000 --- a/L3_Middlewares/LVGL/src/tick/lv_tick_private.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file lv_tick_private.h - * - */ - -#ifndef LV_TICK_PRIVATE_H -#define LV_TICK_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_tick.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - uint32_t sys_time; - volatile uint8_t sys_irq_flag; - lv_tick_get_cb_t tick_get_cb; - lv_delay_cb_t delay_cb; -} lv_tick_state_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_TICK_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/animimage/lv_animimage.h b/L3_Middlewares/LVGL/src/widgets/animimage/lv_animimage.h deleted file mode 100644 index a2f1926..0000000 --- a/L3_Middlewares/LVGL/src/widgets/animimage/lv_animimage.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @file lv_animimage.h - * - */ - -#ifndef LV_ANIMIMAGE_H -#define LV_ANIMIMAGE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../image/lv_image.h" -#include "../../misc/lv_types.h" - -#if LV_USE_ANIMIMG != 0 - -/*Testing of dependencies*/ -#if LV_USE_IMAGE == 0 -#error "lv_animimg: lv_img is required. Enable it in lv_conf.h (LV_USE_IMAGE 1)" -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_animimg_class; - -/** Image parts */ -typedef enum { - LV_ANIM_IMAGE_PART_MAIN, -} lv_animimg_part_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an animation image objects - * @param parent pointer to an object, it will be the parent of the new button - * @return pointer to the created animation image object - */ -lv_obj_t * lv_animimg_create(lv_obj_t * parent); - -/*===================== - * Setter functions - *====================*/ - -/** - * Set the image animation images source. - * @param img pointer to an animation image object - * @param dsc pointer to a series images - * @param num images' number - */ -void lv_animimg_set_src(lv_obj_t * img, const void * dsc[], size_t num); - -/** - * Startup the image animation. - * @param obj pointer to an animation image object - */ -void lv_animimg_start(lv_obj_t * obj); - -/** - * Set the image animation duration time. unit:ms - * @param img pointer to an animation image object - * @param duration the duration in milliseconds - */ -void lv_animimg_set_duration(lv_obj_t * img, uint32_t duration); - -/** - * Set the image animation repeatedly play times. - * @param img pointer to an animation image object - * @param count the number of times to repeat the animation - */ -void lv_animimg_set_repeat_count(lv_obj_t * img, uint32_t count); - -/*===================== - * Getter functions - *====================*/ - -/** - * Get the image animation images source. - * @param img pointer to an animation image object - * @return a pointer that will point to a series images - */ -const void ** lv_animimg_get_src(lv_obj_t * img); - -/** - * Get the image animation images source. - * @param img pointer to an animation image object - * @return the number of source images - */ -uint8_t lv_animimg_get_src_count(lv_obj_t * img); - -/** - * Get the image animation duration time. unit:ms - * @param img pointer to an animation image object - * @return the animation duration time - */ -uint32_t lv_animimg_get_duration(lv_obj_t * img); - -/** - * Get the image animation repeat play times. - * @param img pointer to an animation image object - * @return the repeat count - */ -uint32_t lv_animimg_get_repeat_count(lv_obj_t * img); - -/** - * Get the image animation underlying animation. - * @param img pointer to an animation image object - * @return the animation reference - */ -lv_anim_t * lv_animimg_get_anim(lv_obj_t * img); - -#endif /*LV_USE_ANIMIMG*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*LV_ANIMIMAGE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/animimage/lv_animimage_private.h b/L3_Middlewares/LVGL/src/widgets/animimage/lv_animimage_private.h deleted file mode 100644 index c4cf663..0000000 --- a/L3_Middlewares/LVGL/src/widgets/animimage/lv_animimage_private.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file lv_animimage_private.h - * - */ - -#ifndef LV_ANIMIMAGE_PRIVATE_H -#define LV_ANIMIMAGE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../image/lv_image_private.h" -#include "../../misc/lv_anim_private.h" -#include "lv_animimage.h" - -#if LV_USE_ANIMIMG != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Data of the animimage */ -struct lv_animimg_t { - lv_image_t img; - lv_anim_t anim; - /* picture sequence */ - const void ** dsc; - int8_t pic_count; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_ANIMIMG != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_ANIMIMAGE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/arc/lv_arc.h b/L3_Middlewares/LVGL/src/widgets/arc/lv_arc.h deleted file mode 100644 index f241745..0000000 --- a/L3_Middlewares/LVGL/src/widgets/arc/lv_arc.h +++ /dev/null @@ -1,247 +0,0 @@ -/** - * @file lv_arc.h - * - */ - -#ifndef LV_ARC_H -#define LV_ARC_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" - -#if LV_USE_ARC != 0 - -#include "../../core/lv_obj.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef enum { - LV_ARC_MODE_NORMAL, - LV_ARC_MODE_SYMMETRICAL, - LV_ARC_MODE_REVERSE -} lv_arc_mode_t; - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_arc_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an arc object - * @param parent pointer to an object, it will be the parent of the new arc - * @return pointer to the created arc - */ -lv_obj_t * lv_arc_create(lv_obj_t * parent); - -/*====================== - * Add/remove functions - *=====================*/ - -/*===================== - * Setter functions - *====================*/ - -/** - * Set the start angle of an arc. 0 deg: right, 90 bottom, etc. - * @param obj pointer to an arc object - * @param start the start angle. (if `LV_USE_FLOAT` is enabled it can be fractional too.) - */ -void lv_arc_set_start_angle(lv_obj_t * obj, lv_value_precise_t start); - -/** - * Set the end angle of an arc. 0 deg: right, 90 bottom, etc. - * @param obj pointer to an arc object - * @param end the end angle (if `LV_USE_FLOAT` is enabled it can be fractional too.) - */ -void lv_arc_set_end_angle(lv_obj_t * obj, lv_value_precise_t end); - -/** - * Set the start and end angles - * @param obj pointer to an arc object - * @param start the start angle (if `LV_USE_FLOAT` is enabled it can be fractional too.) - * @param end the end angle (if `LV_USE_FLOAT` is enabled it can be fractional too.) - */ -void lv_arc_set_angles(lv_obj_t * obj, lv_value_precise_t start, lv_value_precise_t end); - -/** - * Set the start angle of an arc background. 0 deg: right, 90 bottom, etc. - * @param obj pointer to an arc object - * @param start the start angle (if `LV_USE_FLOAT` is enabled it can be fractional too.) - */ -void lv_arc_set_bg_start_angle(lv_obj_t * obj, lv_value_precise_t start); - -/** - * Set the start angle of an arc background. 0 deg: right, 90 bottom etc. - * @param obj pointer to an arc object - * @param end the end angle (if `LV_USE_FLOAT` is enabled it can be fractional too.) - */ -void lv_arc_set_bg_end_angle(lv_obj_t * obj, lv_value_precise_t end); - -/** - * Set the start and end angles of the arc background - * @param obj pointer to an arc object - * @param start the start angle (if `LV_USE_FLOAT` is enabled it can be fractional too.) - * @param end the end angle (if `LV_USE_FLOAT` is enabled it can be fractional too.) - */ -void lv_arc_set_bg_angles(lv_obj_t * obj, lv_value_precise_t start, lv_value_precise_t end); - -/** - * Set the rotation for the whole arc - * @param obj pointer to an arc object - * @param rotation rotation angle - */ -void lv_arc_set_rotation(lv_obj_t * obj, int32_t rotation); - -/** - * Set the type of arc. - * @param obj pointer to arc object - * @param type arc's mode - */ -void lv_arc_set_mode(lv_obj_t * obj, lv_arc_mode_t type); - -/** - * Set a new value on the arc - * @param obj pointer to an arc object - * @param value new value - */ -void lv_arc_set_value(lv_obj_t * obj, int32_t value); - -/** - * Set minimum and the maximum values of an arc - * @param obj pointer to the arc object - * @param min minimum value - * @param max maximum value - */ -void lv_arc_set_range(lv_obj_t * obj, int32_t min, int32_t max); - -/** - * Set a change rate to limit the speed how fast the arc should reach the pressed point. - * @param obj pointer to an arc object - * @param rate the change rate - */ -void lv_arc_set_change_rate(lv_obj_t * obj, uint32_t rate); - -/** - * Set an offset angle for the knob - * @param obj pointer to an arc object - * @param offset knob offset from main arc in degrees - */ -void lv_arc_set_knob_offset(lv_obj_t * obj, int32_t offset); - -/*===================== - * Getter functions - *====================*/ - -/** - * Get the start angle of an arc. - * @param obj pointer to an arc object - * @return the start angle [0..360] (if `LV_USE_FLOAT` is enabled it can be fractional too.) - */ -lv_value_precise_t lv_arc_get_angle_start(lv_obj_t * obj); - -/** - * Get the end angle of an arc. - * @param obj pointer to an arc object - * @return the end angle [0..360] (if `LV_USE_FLOAT` is enabled it can be fractional too.) - */ -lv_value_precise_t lv_arc_get_angle_end(lv_obj_t * obj); - -/** - * Get the start angle of an arc background. - * @param obj pointer to an arc object - * @return the start angle [0..360] (if `LV_USE_FLOAT` is enabled it can be fractional too.) - */ -lv_value_precise_t lv_arc_get_bg_angle_start(lv_obj_t * obj); - -/** - * Get the end angle of an arc background. - * @param obj pointer to an arc object - * @return the end angle [0..360] (if `LV_USE_FLOAT` is enabled it can be fractional too.) - */ -lv_value_precise_t lv_arc_get_bg_angle_end(lv_obj_t * obj); - -/** - * Get the value of an arc - * @param obj pointer to an arc object - * @return the value of the arc - */ -int32_t lv_arc_get_value(const lv_obj_t * obj); - -/** - * Get the minimum value of an arc - * @param obj pointer to an arc object - * @return the minimum value of the arc - */ -int32_t lv_arc_get_min_value(const lv_obj_t * obj); - -/** - * Get the maximum value of an arc - * @param obj pointer to an arc object - * @return the maximum value of the arc - */ -int32_t lv_arc_get_max_value(const lv_obj_t * obj); - -/** - * Get whether the arc is type or not. - * @param obj pointer to an arc object - * @return arc's mode - */ -lv_arc_mode_t lv_arc_get_mode(const lv_obj_t * obj); - -/** - * Get the rotation for the whole arc - * @param obj pointer to an arc object - * @return arc's current rotation - */ -int32_t lv_arc_get_rotation(const lv_obj_t * obj); - -/** - * Get the current knob angle offset - * @param obj pointer to an arc object - * @return arc's current knob offset - */ -int32_t lv_arc_get_knob_offset(const lv_obj_t * obj); - -/*===================== - * Other functions - *====================*/ - -/** - * Align an object to the current position of the arc (knob) - * @param obj pointer to an arc object - * @param obj_to_align pointer to an object to align - * @param r_offset consider the radius larger with this value (< 0: for smaller radius) - */ -void lv_arc_align_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_align, int32_t r_offset); - -/** - * Rotate an object to the current position of the arc (knob) - * @param obj pointer to an arc object - * @param obj_to_rotate pointer to an object to rotate - * @param r_offset consider the radius larger with this value (< 0: for smaller radius) - */ -void lv_arc_rotate_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_rotate, int32_t r_offset); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_ARC*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_ARC_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/arc/lv_arc_private.h b/L3_Middlewares/LVGL/src/widgets/arc/lv_arc_private.h deleted file mode 100644 index 03513ea..0000000 --- a/L3_Middlewares/LVGL/src/widgets/arc/lv_arc_private.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file lv_arc_private.h - * - */ - -#ifndef LV_ARC_PRIVATE_H -#define LV_ARC_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../core/lv_obj_private.h" -#include "lv_arc.h" - -#if LV_USE_ARC != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_arc_t { - lv_obj_t obj; - int32_t rotation; - lv_value_precise_t indic_angle_start; - lv_value_precise_t indic_angle_end; - lv_value_precise_t bg_angle_start; - lv_value_precise_t bg_angle_end; - int32_t value; /**< Current value of the arc */ - int32_t min_value; /**< Minimum value of the arc */ - int32_t max_value; /**< Maximum value of the arc */ - uint32_t dragging : 1; - uint32_t type : 2; - uint32_t min_close : 1; /**< 1: the last pressed angle was closer to minimum end */ - uint32_t in_out : 1; /**< 1: The click was within the background arc angles. 0: Click outside */ - uint32_t chg_rate; /**< Drag angle rate of change of the arc (degrees/sec) */ - uint32_t last_tick; /**< Last dragging event timestamp of the arc */ - lv_value_precise_t last_angle; /**< Last dragging angle of the arc */ - int16_t knob_offset; /**< knob offset from the main arc */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_ARC != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_ARC_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/bar/lv_bar_private.h b/L3_Middlewares/LVGL/src/widgets/bar/lv_bar_private.h deleted file mode 100644 index 1a8dd4b..0000000 --- a/L3_Middlewares/LVGL/src/widgets/bar/lv_bar_private.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file lv_bar_private.h - * - */ - -#ifndef LV_BAR_PRIVATE_H -#define LV_BAR_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_bar.h" - -#if LV_USE_BAR != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_bar_anim_t { - lv_obj_t * bar; - int32_t anim_start; - int32_t anim_end; - int32_t anim_state; -}; - -struct lv_bar_t { - lv_obj_t obj; - int32_t cur_value; /**< Current value of the bar*/ - int32_t min_value; /**< Minimum value of the bar*/ - int32_t max_value; /**< Maximum value of the bar*/ - int32_t start_value; /**< Start value of the bar*/ - lv_area_t indic_area; /**< Save the indicator area. Might be used by derived types*/ - bool val_reversed; /**< Whether value been reversed */ - lv_bar_anim_t cur_value_anim; - lv_bar_anim_t start_value_anim; - lv_bar_mode_t mode : 3; /**< Type of bar*/ - lv_bar_orientation_t orientation : 3; /**< Orientation of bar*/ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_BAR != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_BAR_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/button/lv_button_private.h b/L3_Middlewares/LVGL/src/widgets/button/lv_button_private.h deleted file mode 100644 index ce310f3..0000000 --- a/L3_Middlewares/LVGL/src/widgets/button/lv_button_private.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file lv_button_private.h - * - */ - -#ifndef LV_BUTTON_PRIVATE_H -#define LV_BUTTON_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_button.h" - -#if LV_USE_BUTTON != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_button_t { - lv_obj_t obj; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_BUTTON != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_BUTTON_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/buttonmatrix/lv_buttonmatrix.h b/L3_Middlewares/LVGL/src/widgets/buttonmatrix/lv_buttonmatrix.h deleted file mode 100644 index c272662..0000000 --- a/L3_Middlewares/LVGL/src/widgets/buttonmatrix/lv_buttonmatrix.h +++ /dev/null @@ -1,202 +0,0 @@ -/** - * @file lv_buttonmatrix.h - * - */ - -#ifndef LV_BUTTONMATRIX_H -#define LV_BUTTONMATRIX_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" - -#if LV_USE_BUTTONMATRIX != 0 - -#include "../../core/lv_obj.h" - -/********************* - * DEFINES - *********************/ -#define LV_BUTTONMATRIX_BUTTON_NONE 0xFFFF -LV_EXPORT_CONST_INT(LV_BUTTONMATRIX_BUTTON_NONE); - -/********************** - * TYPEDEFS - **********************/ - -/** Type to store button control bits (disabled, hidden etc.) - * The first 3 bits are used to store the width*/ -typedef enum { - LV_BUTTONMATRIX_CTRL_HIDDEN = 0x0010, /**< Button hidden*/ - LV_BUTTONMATRIX_CTRL_NO_REPEAT = 0x0020, /**< Do not repeat press this button.*/ - LV_BUTTONMATRIX_CTRL_DISABLED = 0x0040, /**< Disable this button.*/ - LV_BUTTONMATRIX_CTRL_CHECKABLE = 0x0080, /**< The button can be toggled.*/ - LV_BUTTONMATRIX_CTRL_CHECKED = 0x0100, /**< Button is currently toggled (e.g. checked).*/ - LV_BUTTONMATRIX_CTRL_CLICK_TRIG = 0x0200, /**< 1: Send LV_EVENT_VALUE_CHANGE on CLICK, 0: Send LV_EVENT_VALUE_CHANGE on PRESS*/ - LV_BUTTONMATRIX_CTRL_POPOVER = 0x0400, /**< Show a popover when pressing this key*/ - LV_BUTTONMATRIX_CTRL_RESERVED_1 = 0x0800, /**< Reserved for later use*/ - LV_BUTTONMATRIX_CTRL_RESERVED_2 = 0x1000, /**< Reserved for later use*/ - LV_BUTTONMATRIX_CTRL_RESERVED_3 = 0x2000, /**< Reserved for later use*/ - LV_BUTTONMATRIX_CTRL_CUSTOM_1 = 0x4000, /**< Custom free to use flag*/ - LV_BUTTONMATRIX_CTRL_CUSTOM_2 = 0x8000, /**< Custom free to use flag*/ -} lv_buttonmatrix_ctrl_t; - -typedef bool (*lv_buttonmatrix_button_draw_cb_t)(lv_obj_t * btnm, uint32_t btn_id, const lv_area_t * draw_area, - const lv_area_t * clip_area); - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_buttonmatrix_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a button matrix object - * @param parent pointer to an object, it will be the parent of the new button matrix - * @return pointer to the created button matrix - */ -lv_obj_t * lv_buttonmatrix_create(lv_obj_t * parent); - -/*===================== - * Setter functions - *====================*/ - -/** - * Set a new map. Buttons will be created/deleted according to the map. The - * button matrix keeps a reference to the map and so the string array must not - * be deallocated during the life of the matrix. - * @param obj pointer to a button matrix object - * @param map pointer a string array. The last string has to be: "". Use "\n" to make a line break. - */ -void lv_buttonmatrix_set_map(lv_obj_t * obj, const char * const map[]); - -/** - * Set the button control map (hidden, disabled etc.) for a button matrix. - * The control map array will be copied and so may be deallocated after this - * function returns. - * @param obj pointer to a button matrix object - * @param ctrl_map pointer to an array of `lv_button_ctrl_t` control bytes. The - * length of the array and position of the elements must match - * the number and order of the individual buttons (i.e. excludes - * newline entries). - * An element of the map should look like e.g.: - * `ctrl_map[0] = width | LV_BUTTONMATRIX_CTRL_NO_REPEAT | LV_BUTTONMATRIX_CTRL_TGL_ENABLE` - */ -void lv_buttonmatrix_set_ctrl_map(lv_obj_t * obj, const lv_buttonmatrix_ctrl_t ctrl_map[]); - -/** - * Set the selected buttons - * @param obj pointer to button matrix object - * @param btn_id 0 based index of the button to modify. (Not counting new lines) - */ -void lv_buttonmatrix_set_selected_button(lv_obj_t * obj, uint32_t btn_id); - -/** - * Set the attributes of a button of the button matrix - * @param obj pointer to button matrix object - * @param btn_id 0 based index of the button to modify. (Not counting new lines) - * @param ctrl OR-ed attributes. E.g. `LV_BUTTONMATRIX_CTRL_NO_REPEAT | LV_BUTTONMATRIX_CTRL_CHECKABLE` - */ -void lv_buttonmatrix_set_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl); - -/** - * Clear the attributes of a button of the button matrix - * @param obj pointer to button matrix object - * @param btn_id 0 based index of the button to modify. (Not counting new lines) - * @param ctrl OR-ed attributes. E.g. `LV_BUTTONMATRIX_CTRL_NO_REPEAT | LV_BUTTONMATRIX_CTRL_CHECKABLE` - */ -void lv_buttonmatrix_clear_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl); - -/** - * Set attributes of all buttons of a button matrix - * @param obj pointer to a button matrix object - * @param ctrl attribute(s) to set from `lv_buttonmatrix_ctrl_t`. Values can be ORed. - */ -void lv_buttonmatrix_set_button_ctrl_all(lv_obj_t * obj, lv_buttonmatrix_ctrl_t ctrl); - -/** - * Clear the attributes of all buttons of a button matrix - * @param obj pointer to a button matrix object - * @param ctrl attribute(s) to set from `lv_buttonmatrix_ctrl_t`. Values can be ORed. - */ -void lv_buttonmatrix_clear_button_ctrl_all(lv_obj_t * obj, lv_buttonmatrix_ctrl_t ctrl); - -/** - * Set a single button's relative width. - * This method will cause the matrix be regenerated and is a relatively - * expensive operation. It is recommended that initial width be specified using - * `lv_buttonmatrix_set_ctrl_map` and this method only be used for dynamic changes. - * @param obj pointer to button matrix object - * @param btn_id 0 based index of the button to modify. - * @param width relative width compared to the buttons in the same row. [1..15] - */ -void lv_buttonmatrix_set_button_width(lv_obj_t * obj, uint32_t btn_id, uint32_t width); - -/** - * Make the button matrix like a selector widget (only one button may be checked at a time). - * `LV_BUTTONMATRIX_CTRL_CHECKABLE` must be enabled on the buttons to be selected using - * `lv_buttonmatrix_set_ctrl()` or `lv_buttonmatrix_set_button_ctrl_all()`. - * @param obj pointer to a button matrix object - * @param en whether "one check" mode is enabled - */ -void lv_buttonmatrix_set_one_checked(lv_obj_t * obj, bool en); - -/*===================== - * Getter functions - *====================*/ - -/** - * Get the current map of a button matrix - * @param obj pointer to a button matrix object - * @return the current map - */ -const char * const * lv_buttonmatrix_get_map(const lv_obj_t * obj); - -/** - * Get the index of the lastly "activated" button by the user (pressed, released, focused etc) - * Useful in the `event_cb` to get the text of the button, check if hidden etc. - * @param obj pointer to button matrix object - * @return index of the last released button (LV_BUTTONMATRIX_BUTTON_NONE: if unset) - */ -uint32_t lv_buttonmatrix_get_selected_button(const lv_obj_t * obj); - -/** - * Get the button's text - * @param obj pointer to button matrix object - * @param btn_id the index a button not counting new line characters. - * @return text of btn_index` button - */ -const char * lv_buttonmatrix_get_button_text(const lv_obj_t * obj, uint32_t btn_id); - -/** - * Get the whether a control value is enabled or disabled for button of a button matrix - * @param obj pointer to a button matrix object - * @param btn_id the index of a button not counting new line characters. - * @param ctrl control values to check (ORed value can be used) - * @return true: the control attribute is enabled false: disabled - */ -bool lv_buttonmatrix_has_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl); - -/** - * Tell whether "one check" mode is enabled or not. - * @param obj Button matrix object - * @return true: "one check" mode is enabled; false: disabled - */ -bool lv_buttonmatrix_get_one_checked(const lv_obj_t * obj); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_BUTTONMATRIX*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_BUTTONMATRIX_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/buttonmatrix/lv_buttonmatrix_private.h b/L3_Middlewares/LVGL/src/widgets/buttonmatrix/lv_buttonmatrix_private.h deleted file mode 100644 index cab042d..0000000 --- a/L3_Middlewares/LVGL/src/widgets/buttonmatrix/lv_buttonmatrix_private.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file lv_buttonmatrix_private.h - * - */ - -#ifndef LV_BUTTONMATRIX_PRIVATE_H -#define LV_BUTTONMATRIX_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_buttonmatrix.h" - -#if LV_USE_BUTTONMATRIX != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Data of button matrix */ -struct lv_buttonmatrix_t { - lv_obj_t obj; - const char * const * map_p; /**< Pointer to the current map */ - lv_area_t * button_areas; /**< Array of areas of buttons */ - lv_buttonmatrix_ctrl_t * ctrl_bits; /**< Array of control bytes */ - uint32_t btn_cnt; /**< Number of button in 'map_p'(Handled by the library) */ - uint32_t row_cnt; /**< Number of rows in 'map_p'(Handled by the library) */ - uint32_t btn_id_sel; /**< Index of the active button (being pressed/released etc) or LV_BUTTONMATRIX_BUTTON_NONE */ - uint32_t one_check : 1; /**< Single button toggled at once */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_BUTTONMATRIX != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_BUTTONMATRIX_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese.c b/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese.c deleted file mode 100644 index ee24133..0000000 --- a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese.c +++ /dev/null @@ -1,285 +0,0 @@ -/** - * @file lv_calendar_chinese.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_calendar_private.h" -#if LV_USE_CALENDAR && LV_USE_CALENDAR_CHINESE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - const char festival_name[20]; - uint8_t month; - uint8_t day; -} lv_calendar_festival_t; - -/********************** - * STATIC PROTOTYPES - **********************/ - -/********************** - * STATIC VARIABLES - **********************/ - -static const uint32_t calendar_chinese_table[199] = {/*1901-2099*/ - 0x04AE53, 0x0A5748, 0x5526BD, 0x0D2650, 0x0D9544, 0x46AAB9, 0x056A4D, 0x09AD42, 0x24AEB6, 0x04AE4A, /*1901-1910*/ - 0x6A4DBE, 0x0A4D52, 0x0D2546, 0x5D52BA, 0x0B544E, 0x0D6A43, 0x296D37, 0x095B4B, 0x749BC1, 0x049754, /*1911-1920*/ - 0x0A4B48, 0x5B25BC, 0x06A550, 0x06D445, 0x4ADAB8, 0x02B64D, 0x095742, 0x2497B7, 0x04974A, 0x664B3E, /*1921-1930*/ - 0x0D4A51, 0x0EA546, 0x56D4BA, 0x05AD4E, 0x02B644, 0x393738, 0x092E4B, 0x7C96BF, 0x0C9553, 0x0D4A48, /*1931-1940*/ - 0x6DA53B, 0x0B554F, 0x056A45, 0x4AADB9, 0x025D4D, 0x092D42, 0x2C95B6, 0x0A954A, 0x7B4ABD, 0x06CA51, /*1941-1950*/ - 0x0B5546, 0x555ABB, 0x04DA4E, 0x0A5B43, 0x352BB8, 0x052B4C, 0x8A953F, 0x0E9552, 0x06AA48, 0x6AD53C, /*1951-1960*/ - 0x0AB54F, 0x04B645, 0x4A5739, 0x0A574D, 0x052642, 0x3E9335, 0x0D9549, 0x75AABE, 0x056A51, 0x096D46, /*1961-1970*/ - 0x54AEBB, 0x04AD4F, 0x0A4D43, 0x4D26B7, 0x0D254B, 0x8D52BF, 0x0B5452, 0x0B6A47, 0x696D3C, 0x095B50, /*1971-1980*/ - 0x049B45, 0x4A4BB9, 0x0A4B4D, 0xAB25C2, 0x06A554, 0x06D449, 0x6ADA3D, 0x0AB651, 0x093746, 0x5497BB, /*1981-1990*/ - 0x04974F, 0x064B44, 0x36A537, 0x0EA54A, 0x86B2BF, 0x05AC53, 0x0AB647, 0x5936BC, 0x092E50, 0x0C9645, /*1991-2000*/ - 0x4D4AB8, 0x0D4A4C, 0x0DA541, 0x25AAB6, 0x056A49, 0x7AADBD, 0x025D52, 0x092D47, 0x5C95BA, 0x0A954E, /*2001-2010*/ - 0x0B4A43, 0x4B5537, 0x0AD54A, 0x955ABF, 0x04BA53, 0x0A5B48, 0x652BBC, 0x052B50, 0x0A9345, 0x474AB9, /*2011-2020*/ - 0x06AA4C, 0x0AD541, 0x24DAB6, 0x04B64A, 0x69573D, 0x0A4E51, 0x0D2646, 0x5E933A, 0x0D534D, 0x05AA43, /*2021-2030*/ - 0x36B537, 0x096D4B, 0xB4AEBF, 0x04AD53, 0x0A4D48, 0x6D25BC, 0x0D254F, 0x0D5244, 0x5DAA38, 0x0B5A4C, /*2031-2040*/ - 0x056D41, 0x24ADB6, 0x049B4A, 0x7A4BBE, 0x0A4B51, 0x0AA546, 0x5B52BA, 0x06D24E, 0x0ADA42, 0x355B37, /*2041-2050*/ - 0x09374B, 0x8497C1, 0x049753, 0x064B48, 0x66A53C, 0x0EA54F, 0x06B244, 0x4AB638, 0x0AAE4C, 0x092E42, /*2051-2060*/ - 0x3C9735, 0x0C9649, 0x7D4ABD, 0x0D4A51, 0x0DA545, 0x55AABA, 0x056A4E, 0x0A6D43, 0x452EB7, 0x052D4B, /*2061-2070*/ - 0x8A95BF, 0x0A9553, 0x0B4A47, 0x6B553B, 0x0AD54F, 0x055A45, 0x4A5D38, 0x0A5B4C, 0x052B42, 0x3A93B6, /*2071-2080*/ - 0x069349, 0x7729BD, 0x06AA51, 0x0AD546, 0x54DABA, 0x04B64E, 0x0A5743, 0x452738, 0x0D264A, 0x8E933E, /*2081-2090*/ - 0x0D5252, 0x0DAA47, 0x66B53B, 0x056D4F, 0x04AE45, 0x4A4EB9, 0x0A4D4C, 0x0D1541, 0x2D92B5 /*2091-2099*/ -}; - -static const uint16_t month_total_day[13] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}; - -static const char * chinese_calendar_month_name[] = {"正月", "二月", "三月", "四月", "五月", "六月", - "七月", "八月", "九月", "十月", "十一月", "腊月" - }; - -static const char * chinese_calendar_leep_month_name[] = {"闰正月", "闰二月", "闰三月", "闰四月", "闰五月", "闰六月", - "闰七月", "闰八月", "闰九月", "闰十月", "闰十一月", "闰腊月" - }; - -static const char * chinese_calendar_day_name[] = {"初一", "初二", "初三", "初四", "初五", - "初六", "初七", "初八", "初九", "初十", - "十一", "十二", "十三", "十四", "十五", - "十六", "十七", "十八", "十九", "二十", - "廿一", "廿二", "廿三", "廿四", "廿五", - "廿六", "廿七", "廿八", "廿九", "三十" - }; - -static const lv_calendar_festival_t festivals_base_chinese[] = { - {"春节", 1, 1}, - {"元宵节", 1, 15}, - {"端午节", 5, 5}, - {"七夕节", 7, 7}, - {"中元节", 7, 15}, - {"中秋节", 8, 15}, - {"重阳节", 9, 9}, - {"腊八节", 12, 8}, - {"除夕", 12, 29},/* To determine whether it is 12.29 or 12.30. */ - {"除夕", 12, 30},/* To determine whether it is 12.29 or 12.30. */ -}; - -static const lv_calendar_festival_t festivals_base_gregorian[] = { - {"元旦", 1, 1}, - {"情人节", 2, 14}, - {"妇女节", 3, 8}, - {"植树节", 3, 12}, - {"消费节", 3, 15}, - {"愚人节", 4, 1}, - {"劳动节", 5, 1}, - {"青年节", 5, 4}, - {"儿童节", 6, 1}, - {"建党节", 7, 1}, - {"建军节", 8, 1}, - {"教师节", 9, 10}, - {"国庆节", 10, 1}, - {"万圣节", 10, 31}, - {"平安夜", 12, 24}, - {"圣诞节", 12, 25}, -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -void lv_calendar_set_chinese_mode(lv_obj_t * obj, bool en) -{ - lv_calendar_t * calendar = (lv_calendar_t *)obj; - calendar->use_chinese_calendar = en; - lv_calendar_set_showed_date(obj, calendar->today.year, calendar->today.month); -} - -const char * lv_calendar_get_day_name(lv_calendar_date_t * gregorian) -{ - uint16_t i, len; - lv_calendar_chinese_t chinese_calendar; - lv_calendar_gregorian_to_chinese(gregorian, &chinese_calendar); - - if(gregorian->year > 2099 || gregorian->year < 1901) - return NULL; - - len = sizeof(festivals_base_chinese) / sizeof(lv_calendar_festival_t); - for(i = 0; i < len; i++) { - if((chinese_calendar.today.month == festivals_base_chinese[i].month) && - (chinese_calendar.today.day == festivals_base_chinese[i].day) && - chinese_calendar.leep_month == false) { - if(chinese_calendar.today.month == 12 && chinese_calendar.today.day == 29) { - if((calendar_chinese_table[chinese_calendar.today.year - 1901] & 0xf00000) != 0) { - if((calendar_chinese_table[chinese_calendar.today.year - 1901] & 0x000080) == 0) { - return festivals_base_chinese[i].festival_name; - } - } - else { - if((calendar_chinese_table[chinese_calendar.today.year - 1901] & 0x000100) == 0) { - return festivals_base_chinese[i].festival_name; - } - } - } - else { - return festivals_base_chinese[i].festival_name; - } - } - } - - len = sizeof(festivals_base_gregorian) / sizeof(lv_calendar_festival_t); - for(i = 0; i < len; i++) { - if((gregorian->month == festivals_base_gregorian[i].month) && - (gregorian->day == festivals_base_gregorian[i].day)) - return festivals_base_gregorian[i].festival_name; - } - - if(chinese_calendar.today.day == 1) { - if(chinese_calendar.leep_month == false) - return chinese_calendar_month_name[chinese_calendar.today.month - 1]; - else { - return chinese_calendar_leep_month_name[chinese_calendar.today.month - 1]; - } - } - - return (char *)chinese_calendar_day_name[chinese_calendar.today.day - 1]; -} - -void lv_calendar_gregorian_to_chinese(lv_calendar_date_t * gregorian_time, lv_calendar_chinese_t * chinese_time) -{ - uint16_t year = gregorian_time->year; - uint8_t month = gregorian_time->month; - uint8_t day = gregorian_time->day; - - /*Record the number of days between the Spring Festival - and the New Year's Day of that year.*/ - uint16_t by_spring; - - /*Record the number of days from the gregorian calendar - to the New Year's Day of that year.*/ - uint16_t by_gregorian; - - /*Record the number of days in that month*/ - uint8_t days_per_month; - - /*Record from which month the calculation starts.*/ - uint8_t index; - - bool leep_month; - - if(year < 1901 || year > 2099) { - chinese_time->leep_month = 0; - chinese_time->today.year = 2000; - chinese_time->today.month = 1; - chinese_time->today.day = 1; - return; - } - - if(((calendar_chinese_table[year - 1901] & 0x0060) >> 5) == 1) - by_spring = (calendar_chinese_table[year - 1901] & 0x001F) - 1; - else - by_spring = (calendar_chinese_table[year - 1901] & 0x001F) - 1 + 31; - - by_gregorian = month_total_day[month - 1] + day - 1; - - if((!(year % 4)) && (month > 2)) - by_gregorian++; - - if(by_gregorian >= by_spring) {/*Gregorian calendar days after the Spring Festival*/ - by_gregorian -= by_spring; - month = 1; - index = 1; - leep_month = false; - - if((calendar_chinese_table[year - 1901] & (0x80000 >> (index - 1))) == 0) - days_per_month = 29; - else - days_per_month = 30; - - while(by_gregorian >= days_per_month) { - by_gregorian -= days_per_month; - index++; - - if(month == ((calendar_chinese_table[year - 1901] & 0xF00000) >> 20)) { - leep_month = !leep_month; - if(leep_month == false) - month++; - } - else - month++; - - if((calendar_chinese_table[year - 1901] & (0x80000 >> (index - 1))) == 0) - days_per_month = 29; - else - days_per_month = 30; - } - day = by_gregorian + 1; - } - else {/*Solar day before the Spring Festival*/ - by_spring -= by_gregorian; - year--; - month = 12; - if(((calendar_chinese_table[year - 1901] & 0xF00000) >> 20) == 0) - index = 12; - else - index = 13; - leep_month = false; - - if((calendar_chinese_table[year - 1901] & (0x80000 >> (index - 1))) == 0) - days_per_month = 29; - else - days_per_month = 30; - - while(by_spring > days_per_month) { - by_spring -= days_per_month; - index--; - - if(leep_month == false) - month--; - - if(month == ((calendar_chinese_table[year - 1901] & 0xF00000) >> 20)) - leep_month = !leep_month; - - if((calendar_chinese_table[year - 1901] & (0x80000 >> (index - 1))) == 0) - days_per_month = 29; - else - days_per_month = 30; - } - - day = days_per_month - by_spring + 1; - } - chinese_time->today.day = day; - chinese_time->today.month = month; - chinese_time->today.year = year; - chinese_time->leep_month = leep_month; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -#endif /*LV_USE_CALENDAR_CHINESE*/ diff --git a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese.h b/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese.h deleted file mode 100644 index fb7a1bc..0000000 --- a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file lv_calendar_chinese.h - * - */ - -#ifndef LV_CALENDAR_CHINESE_H -#define LV_CALENDAR_CHINESE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../core/lv_obj.h" -#include "lv_calendar.h" -#if LV_USE_CALENDAR && LV_USE_CALENDAR_CHINESE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -typedef struct { - lv_calendar_date_t today; - bool leep_month; -} lv_calendar_chinese_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Enable the chinese calendar. - * @param obj pointer to a calendar object. - * @param en true: enable chinese calendar; false: disable - */ -void lv_calendar_set_chinese_mode(lv_obj_t * obj, bool en); - -/** - * Get the name of the day - * @param gregorian to obtain the gregorian time for the name - * @return return the name of the day - */ -const char * lv_calendar_get_day_name(lv_calendar_date_t * gregorian); - -/** - * Get the chinese time of the gregorian time (reference: https://www.cnblogs.com/liyang31tg/p/4123171.html) - * @param gregorian_time need to convert to chinese time in gregorian time - * @param chinese_time the chinese time convert from gregorian time - */ -void lv_calendar_gregorian_to_chinese(lv_calendar_date_t * gregorian_time, lv_calendar_chinese_t * chinese_time); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_CALENDAR_CHINESE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_CALENDAR_CHINESE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese_private.h b/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese_private.h deleted file mode 100644 index 5572259..0000000 --- a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_chinese_private.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file lv_calendar_chinese_private.h - * - */ - -#ifndef LV_CALENDAR_CHINESE_PRIVATE_H -#define LV_CALENDAR_CHINESE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_calendar_chinese.h" - -#if LV_USE_CALENDAR && LV_USE_CALENDAR_CHINESE - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_calendar_chinese_t { - lv_calendar_date_t today; - bool leep_month; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_CALENDAR && LV_USE_CALENDAR_CHINESE */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_CALENDAR_CHINESE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_private.h b/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_private.h deleted file mode 100644 index d4a9b53..0000000 --- a/L3_Middlewares/LVGL/src/widgets/calendar/lv_calendar_private.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file lv_calendar_private.h - * - */ - -#ifndef LV_CALENDAR_PRIVATE_H -#define LV_CALENDAR_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_calendar.h" - -#if LV_USE_CALENDAR - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Data of calendar */ -struct lv_calendar_t { - lv_obj_t obj; - /* New data for this type */ - lv_obj_t * btnm; - lv_calendar_date_t today; /**< Date of today */ - lv_calendar_date_t showed_date; /**< Currently visible month (day is ignored) */ - lv_calendar_date_t * highlighted_dates; /**< Apply different style on these days (pointer to user-defined array) */ - size_t highlighted_dates_num; /**< Number of elements in `highlighted_days` */ - const char * map[8 * 7]; -#ifdef LV_USE_CALENDAR_CHINESE - bool use_chinese_calendar; - - /** 7 * 6: A week has 7 days, and the calendar displays 6 weeks in total. - * 20: Including the number of dates, line breaks, names for each day, - * and reserving several spaces for addresses. */ - char nums [7 * 6][20]; -#else - /** 7 * 6: A week has 7 days, and the calendar displays 6 weeks in total. - * 6: Including the number of dates, and reserving several spaces for - * addresses.*/ - char nums [7 * 6][4]; -#endif -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_CALENDAR */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_CALENDAR_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas.c b/L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas.c deleted file mode 100644 index 4aa46f3..0000000 --- a/L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas.c +++ /dev/null @@ -1,435 +0,0 @@ -/** - * @file lv_canvas.c - * - */ - -/** - * Modified by NXP in 2024 - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_canvas_private.h" -#include "../../core/lv_obj_class_private.h" -#if LV_USE_CANVAS != 0 -#include "../../misc/lv_assert.h" -#include "../../misc/lv_math.h" -#include "../../draw/lv_draw_private.h" -#include "../../core/lv_refr.h" -#include "../../display/lv_display.h" -#include "../../draw/sw/lv_draw_sw.h" -#include "../../stdlib/lv_string.h" -#include "../../misc/cache/lv_cache.h" -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_canvas_class) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_canvas_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_canvas_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); - -/********************** - * STATIC VARIABLES - **********************/ - -const lv_obj_class_t lv_canvas_class = { - .constructor_cb = lv_canvas_constructor, - .destructor_cb = lv_canvas_destructor, - .instance_size = sizeof(lv_canvas_t), - .base_class = &lv_image_class, - .name = "canvas", -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_canvas_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -/*===================== - * Setter functions - *====================*/ - -void lv_canvas_set_buffer(lv_obj_t * obj, void * buf, int32_t w, int32_t h, lv_color_format_t cf) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(buf); - - lv_canvas_t * canvas = (lv_canvas_t *)obj; - uint32_t stride = lv_draw_buf_width_to_stride(w, cf); - lv_draw_buf_init(&canvas->static_buf, w, h, cf, stride, buf, stride * h); - canvas->draw_buf = &canvas->static_buf; - - const void * src = lv_image_get_src(obj); - if(src) { - lv_image_cache_drop(src); - } - - lv_image_set_src(obj, canvas->draw_buf); - lv_image_cache_drop(canvas->draw_buf); -} - -void lv_canvas_set_draw_buf(lv_obj_t * obj, lv_draw_buf_t * draw_buf) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(draw_buf); - - lv_canvas_t * canvas = (lv_canvas_t *)obj; - canvas->draw_buf = draw_buf; - - const void * src = lv_image_get_src(obj); - if(src) { - lv_image_cache_drop(src); - } - - lv_image_set_src(obj, draw_buf); - lv_image_cache_drop(draw_buf); -} - -void lv_canvas_set_px(lv_obj_t * obj, int32_t x, int32_t y, lv_color_t color, lv_opa_t opa) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_canvas_t * canvas = (lv_canvas_t *)obj; - lv_draw_buf_t * draw_buf = canvas->draw_buf; - - lv_color_format_t cf = draw_buf->header.cf; - uint8_t * data = lv_draw_buf_goto_xy(draw_buf, x, y); - - if(LV_COLOR_FORMAT_IS_INDEXED(cf)) { - uint8_t shift; - uint8_t c_int = color.blue; - switch(cf) { - case LV_COLOR_FORMAT_I1: - shift = 7 - (x & 0x7); - break; - case LV_COLOR_FORMAT_I2: - shift = 6 - 2 * (x & 0x3); - break; - case LV_COLOR_FORMAT_I4: - shift = 4 - 4 * (x & 0x1); - break; - case LV_COLOR_FORMAT_I8: - /*Indexed8 format is a easy case, process and return.*/ - *data = c_int; - default: - return; - } - - uint8_t bpp = lv_color_format_get_bpp(cf); - uint8_t mask = (1 << bpp) - 1; - c_int &= mask; - *data = (*data & ~(mask << shift)) | (c_int << shift); - } - else if(cf == LV_COLOR_FORMAT_L8) { - *data = lv_color_luminance(color); - } - else if(cf == LV_COLOR_FORMAT_A8) { - *data = opa; - } - else if(cf == LV_COLOR_FORMAT_RGB565) { - lv_color16_t * buf = (lv_color16_t *)data; - buf->red = color.red >> 3; - buf->green = color.green >> 2; - buf->blue = color.blue >> 3; - } - else if(cf == LV_COLOR_FORMAT_RGB888) { - data[2] = color.red; - data[1] = color.green; - data[0] = color.blue; - } - else if(cf == LV_COLOR_FORMAT_XRGB8888) { - data[2] = color.red; - data[1] = color.green; - data[0] = color.blue; - data[3] = 0xFF; - } - else if(cf == LV_COLOR_FORMAT_ARGB8888) { - lv_color32_t * buf = (lv_color32_t *)data; - buf->red = color.red; - buf->green = color.green; - buf->blue = color.blue; - buf->alpha = opa; - } - else if(cf == LV_COLOR_FORMAT_AL88) { - lv_color16a_t * buf = (lv_color16a_t *)data; - buf->lumi = lv_color_luminance(color); - buf->alpha = 255; - } - lv_obj_invalidate(obj); -} - -void lv_canvas_set_palette(lv_obj_t * obj, uint8_t index, lv_color32_t color) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_canvas_t * canvas = (lv_canvas_t *)obj; - - lv_draw_buf_set_palette(canvas->draw_buf, index, color); - lv_obj_invalidate(obj); -} - -/*===================== - * Getter functions - *====================*/ - -lv_draw_buf_t * lv_canvas_get_draw_buf(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_canvas_t * canvas = (lv_canvas_t *)obj; - return canvas->draw_buf; -} - -lv_color32_t lv_canvas_get_px(lv_obj_t * obj, int32_t x, int32_t y) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_color32_t ret = { 0 }; - lv_canvas_t * canvas = (lv_canvas_t *)obj; - if(canvas->draw_buf == NULL) return ret; - - lv_image_header_t * header = &canvas->draw_buf->header; - const uint8_t * px = lv_draw_buf_goto_xy(canvas->draw_buf, x, y); - - switch(header->cf) { - case LV_COLOR_FORMAT_ARGB8888: - ret = *(lv_color32_t *)px; - break; - case LV_COLOR_FORMAT_RGB888: - case LV_COLOR_FORMAT_XRGB8888: - ret.red = px[2]; - ret.green = px[1]; - ret.blue = px[0]; - ret.alpha = 0xFF; - break; - case LV_COLOR_FORMAT_RGB565: { - lv_color16_t * c16 = (lv_color16_t *) px; - ret.red = (c16[x].red * 2106) >> 8; /*To make it rounded*/ - ret.green = (c16[x].green * 1037) >> 8; - ret.blue = (c16[x].blue * 2106) >> 8; - ret.alpha = 0xFF; - break; - } - case LV_COLOR_FORMAT_A8: { - lv_color_t alpha_color = lv_obj_get_style_image_recolor(obj, LV_PART_MAIN); - ret.red = alpha_color.red; - ret.green = alpha_color.green; - ret.blue = alpha_color.blue; - ret.alpha = px[0]; - break; - } - case LV_COLOR_FORMAT_L8: { - ret.red = *px; - ret.green = *px; - ret.blue = *px; - ret.alpha = 0xFF; - break; - } - default: - lv_memzero(&ret, sizeof(lv_color32_t)); - break; - } - - return ret; -} - -lv_image_dsc_t * lv_canvas_get_image(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_canvas_t * canvas = (lv_canvas_t *)obj; - return (lv_image_dsc_t *)canvas->draw_buf; -} - -const void * lv_canvas_get_buf(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_canvas_t * canvas = (lv_canvas_t *)obj; - if(canvas->draw_buf) - return canvas->draw_buf->unaligned_data; - - return NULL; -} - -/*===================== - * Other functions - *====================*/ - -void lv_canvas_copy_buf(lv_obj_t * obj, const lv_area_t * canvas_area, lv_draw_buf_t * dest_buf, - const lv_area_t * dest_area) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(canvas_area && dest_buf); - - lv_canvas_t * canvas = (lv_canvas_t *)obj; - if(canvas->draw_buf == NULL) return; - - LV_ASSERT_MSG(canvas->draw_buf->header.cf == dest_buf->header.cf, "Color formats must be the same"); - - lv_draw_buf_copy(canvas->draw_buf, canvas_area, dest_buf, dest_area); -} - -void lv_canvas_fill_bg(lv_obj_t * obj, lv_color_t color, lv_opa_t opa) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_canvas_t * canvas = (lv_canvas_t *)obj; - lv_draw_buf_t * draw_buf = canvas->draw_buf; - if(draw_buf == NULL) return; - - lv_image_header_t * header = &draw_buf->header; - uint32_t x; - uint32_t y; - - uint32_t stride = header->stride; - uint8_t * data = draw_buf->data; - if(header->cf == LV_COLOR_FORMAT_RGB565) { - uint16_t c16 = lv_color_to_u16(color); - for(y = 0; y < header->h; y++) { - uint16_t * buf16 = (uint16_t *)(data + y * stride); - for(x = 0; x < header->w; x++) { - buf16[x] = c16; - } - } - } - else if(header->cf == LV_COLOR_FORMAT_XRGB8888 || header->cf == LV_COLOR_FORMAT_ARGB8888) { - uint32_t c32 = lv_color_to_u32(color); - if(header->cf == LV_COLOR_FORMAT_ARGB8888) { - c32 &= 0x00ffffff; - c32 |= (uint32_t)opa << 24; - } - for(y = 0; y < header->h; y++) { - uint32_t * buf32 = (uint32_t *)(data + y * stride); - for(x = 0; x < header->w; x++) { - buf32[x] = c32; - } - } - } - else if(header->cf == LV_COLOR_FORMAT_RGB888) { - for(y = 0; y < header->h; y++) { - uint8_t * buf8 = (uint8_t *)(data + y * stride); - for(x = 0; x < header->w * 3; x += 3) { - buf8[x + 0] = color.blue; - buf8[x + 1] = color.green; - buf8[x + 2] = color.red; - } - } - } - else if(header->cf == LV_COLOR_FORMAT_L8) { - uint8_t c8 = lv_color_luminance(color); - for(y = 0; y < header->h; y++) { - uint8_t * buf = (uint8_t *)(data + y * stride); - for(x = 0; x < header->w; x++) { - buf[x] = c8; - } - } - } - else if(header->cf == LV_COLOR_FORMAT_AL88) { - lv_color16a_t c; - c.lumi = lv_color_luminance(color); - c.alpha = 255; - for(y = 0; y < header->h; y++) { - lv_color16a_t * buf = (lv_color16a_t *)(data + y * stride); - for(x = 0; x < header->w; x++) { - buf[x] = c; - } - } - } - - else { - for(y = 0; y < header->h; y++) { - for(x = 0; x < header->w; x++) { - lv_canvas_set_px(obj, x, y, color, opa); - } - } - } - - lv_obj_invalidate(obj); -} - -void lv_canvas_init_layer(lv_obj_t * obj, lv_layer_t * layer) -{ - LV_ASSERT_NULL(obj); - LV_ASSERT_NULL(layer); - lv_canvas_t * canvas = (lv_canvas_t *)obj; - if(canvas->draw_buf == NULL) return; - - lv_image_header_t * header = &canvas->draw_buf->header; - lv_area_t canvas_area = {0, 0, header->w - 1, header->h - 1}; - lv_memzero(layer, sizeof(*layer)); - - layer->draw_buf = canvas->draw_buf; - layer->color_format = header->cf; - layer->buf_area = canvas_area; - layer->_clip_area = canvas_area; - layer->phy_clip_area = canvas_area; -#if LV_DRAW_TRANSFORM_USE_MATRIX - lv_matrix_identity(&layer->matrix); -#endif -} - -void lv_canvas_finish_layer(lv_obj_t * canvas, lv_layer_t * layer) -{ - if(layer->draw_task_head == NULL) return; - - bool task_dispatched; - - while(layer->draw_task_head) { - lv_draw_dispatch_wait_for_request(); - task_dispatched = lv_draw_dispatch_layer(lv_obj_get_display(canvas), layer); - - if(!task_dispatched) { - lv_draw_wait_for_finish(); - lv_draw_dispatch_request(); - } - } - lv_obj_invalidate(canvas); -} - -uint32_t lv_canvas_buf_size(int32_t w, int32_t h, uint8_t bpp, uint8_t stride) -{ - return (uint32_t)LV_CANVAS_BUF_SIZE(w, h, bpp, stride); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_canvas_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_UNUSED(obj); -} - -static void lv_canvas_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_TRACE_OBJ_CREATE("begin"); - - lv_canvas_t * canvas = (lv_canvas_t *)obj; - if(canvas->draw_buf == NULL) return; - - lv_image_cache_drop(&canvas->draw_buf); -} - -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas.h b/L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas.h deleted file mode 100644 index d669b17..0000000 --- a/L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas.h +++ /dev/null @@ -1,185 +0,0 @@ -/** - * @file lv_canvas.h - * - */ - -#ifndef LV_CANVAS_H -#define LV_CANVAS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" - -#if LV_USE_CANVAS != 0 - -#include "../image/lv_image.h" -#include "../../draw/lv_draw_image.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_canvas_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a canvas object - * @param parent pointer to an object, it will be the parent of the new canvas - * @return pointer to the created canvas - */ -lv_obj_t * lv_canvas_create(lv_obj_t * parent); - -/*===================== - * Setter functions - *====================*/ - -/** - * Set a buffer for the canvas. - * - * Use lv_canvas_set_draw_buf() instead if you need to set a buffer with alignment requirement. - * - * @param obj pointer to a canvas object - * @param buf buffer where content of canvas will be. - * The required size is (lv_image_color_format_get_px_size(cf) * w) / 8 * h) - * It can be allocated with `lv_malloc()` or - * it can be statically allocated array (e.g. static lv_color_t buf[100*50]) or - * it can be an address in RAM or external SRAM - * @param w width of canvas - * @param h height of canvas - * @param cf color format. `LV_COLOR_FORMAT...` - */ -void lv_canvas_set_buffer(lv_obj_t * obj, void * buf, int32_t w, int32_t h, lv_color_format_t cf); - -/** - * Set a draw buffer for the canvas. A draw buffer either can be allocated by `lv_draw_buf_create()` - * or defined statically by `LV_DRAW_BUF_DEFINE_STATIC`. When buffer start address and stride has alignment - * requirement, it's recommended to use `lv_draw_buf_create`. - * @param obj pointer to a canvas object - * @param draw_buf pointer to a draw buffer - */ -void lv_canvas_set_draw_buf(lv_obj_t * obj, lv_draw_buf_t * draw_buf); - -/** - * Set a pixel's color and opacity - * @param obj pointer to a canvas - * @param x X coordinate of the pixel - * @param y Y coordinate of the pixel - * @param color the color - * @param opa the opacity - * @note The following color formats are supported - * LV_COLOR_FORMAT_I1/2/4/8, LV_COLOR_FORMAT_A8, - * LV_COLOR_FORMAT_RGB565, LV_COLOR_FORMAT_RGB888, - * LV_COLOR_FORMAT_XRGB8888, LV_COLOR_FORMAT_ARGB8888 - */ -void lv_canvas_set_px(lv_obj_t * obj, int32_t x, int32_t y, lv_color_t color, lv_opa_t opa); - -/** - * Set the palette color of a canvas for index format. Valid only for `LV_COLOR_FORMAT_I1/2/4/8` - * @param obj pointer to canvas object - * @param index the palette color to set: - * - for `LV_COLOR_FORMAT_I1`: 0..1 - * - for `LV_COLOR_FORMAT_I2`: 0..3 - * - for `LV_COLOR_FORMAT_I4`: 0..15 - * - for `LV_COLOR_FORMAT_I8`: 0..255 - * @param color the color to set - */ -void lv_canvas_set_palette(lv_obj_t * obj, uint8_t index, lv_color32_t color); - -/*===================== - * Getter functions - *====================*/ - -lv_draw_buf_t * lv_canvas_get_draw_buf(lv_obj_t * obj); - -/** - * Get a pixel's color and opacity - * @param obj pointer to a canvas - * @param x X coordinate of the pixel - * @param y Y coordinate of the pixel - * @return ARGB8888 color of the pixel - */ -lv_color32_t lv_canvas_get_px(lv_obj_t * obj, int32_t x, int32_t y); - -/** - * Get the image of the canvas as a pointer to an `lv_image_dsc_t` variable. - * @param canvas pointer to a canvas object - * @return pointer to the image descriptor. - */ -lv_image_dsc_t * lv_canvas_get_image(lv_obj_t * canvas); - -/** - * Return the pointer for the buffer. - * It's recommended to use this function instead of the buffer form the - * return value of lv_canvas_get_image() as is can be aligned - * @param canvas pointer to a canvas object - * @return pointer to the buffer - */ -const void * lv_canvas_get_buf(lv_obj_t * canvas); - -/*===================== - * Other functions - *====================*/ - -/** - * Copy a buffer to the canvas - * @param obj pointer to a canvas object - * @param canvas_area the area of the canvas to copy - * @param dest_buf pointer to a buffer to store the copied data - * @param dest_area the area of the destination buffer to copy to. If omitted NULL, copy to the whole `dest_buf` - */ -void lv_canvas_copy_buf(lv_obj_t * obj, const lv_area_t * canvas_area, lv_draw_buf_t * dest_buf, - const lv_area_t * dest_area); - -/** - * Fill the canvas with color - * @param obj pointer to a canvas - * @param color the background color - * @param opa the desired opacity - */ -void lv_canvas_fill_bg(lv_obj_t * obj, lv_color_t color, lv_opa_t opa); - -/** - * Initialize a layer to use LVGL's generic draw functions (lv_draw_rect/label/...) on the canvas. - * Needs to be usd in pair with `lv_canvas_finish_layer`. - * @param canvas pointer to a canvas - * @param layer pointer to a layer variable to initialize - */ -void lv_canvas_init_layer(lv_obj_t * canvas, lv_layer_t * layer); - -/** - * Wait until all the drawings are finished on layer. - * Needs to be usd in pair with `lv_canvas_init_layer`. - * @param canvas pointer to a canvas - * @param layer pointer to a layer to finalize - */ -void lv_canvas_finish_layer(lv_obj_t * canvas, lv_layer_t * layer); - -/********************** - * MACROS - **********************/ - -#define LV_CANVAS_BUF_SIZE(w, h, bpp, stride) (((((w * bpp + 7) >> 3) + stride - 1) & ~(stride - 1)) * h + LV_DRAW_BUF_ALIGN) - -/** - * Just a wrapper to `LV_CANVAS_BUF_SIZE` for bindings. - */ -uint32_t lv_canvas_buf_size(int32_t w, int32_t h, uint8_t bpp, uint8_t stride); - -#endif /*LV_USE_CANVAS*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_CANVAS_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas_private.h b/L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas_private.h deleted file mode 100644 index e43b8f3..0000000 --- a/L3_Middlewares/LVGL/src/widgets/canvas/lv_canvas_private.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file lv_canvas_private.h - * - */ - -#ifndef LV_CANVAS_PRIVATE_H -#define LV_CANVAS_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../image/lv_image_private.h" -#include "lv_canvas.h" - -#if LV_USE_CANVAS != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Canvas data */ -struct lv_canvas_t { - lv_image_t img; - lv_draw_buf_t * draw_buf; - lv_draw_buf_t static_buf; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_CANVAS != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_CANVAS_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/chart/lv_chart.c b/L3_Middlewares/LVGL/src/widgets/chart/lv_chart.c deleted file mode 100644 index 4639cd5..0000000 --- a/L3_Middlewares/LVGL/src/widgets/chart/lv_chart.c +++ /dev/null @@ -1,1360 +0,0 @@ -/** - * @file lv_chart.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_chart_private.h" -#include "../../misc/lv_area_private.h" -#include "../../draw/lv_draw_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_class_private.h" -#if LV_USE_CHART != 0 - -#include "../../misc/lv_assert.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_chart_class) - -#define LV_CHART_HDIV_DEF 3 -#define LV_CHART_VDIV_DEF 5 -#define LV_CHART_POINT_CNT_DEF 10 -#define LV_CHART_LABEL_MAX_TEXT_LENGTH 16 - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_chart_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_chart_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_chart_event(const lv_obj_class_t * class_p, lv_event_t * e); - -static void draw_div_lines(lv_obj_t * obj, lv_layer_t * layer); -static void draw_series_line(lv_obj_t * obj, lv_layer_t * layer); -static void draw_series_bar(lv_obj_t * obj, lv_layer_t * layer); -static void draw_series_scatter(lv_obj_t * obj, lv_layer_t * layer); -static void draw_cursors(lv_obj_t * obj, lv_layer_t * layer); -static uint32_t get_index_from_x(lv_obj_t * obj, int32_t x); -static void invalidate_point(lv_obj_t * obj, uint32_t i); -static void new_points_alloc(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t cnt, int32_t ** a); - -/********************** - * STATIC VARIABLES - **********************/ - -const lv_obj_class_t lv_chart_class = { - .constructor_cb = lv_chart_constructor, - .destructor_cb = lv_chart_destructor, - .event_cb = lv_chart_event, - .width_def = LV_PCT(100), - .height_def = LV_DPI_DEF * 2, - .instance_size = sizeof(lv_chart_t), - .base_class = &lv_obj_class, - .name = "chart", -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_chart_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -void lv_chart_set_type(lv_obj_t * obj, lv_chart_type_t type) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(chart->type == type) return; - - if(chart->type == LV_CHART_TYPE_SCATTER) { - lv_chart_series_t * ser; - LV_LL_READ_BACK(&chart->series_ll, ser) { - lv_free(ser->x_points); - ser->x_points = NULL; - } - } - - if(type == LV_CHART_TYPE_SCATTER) { - lv_chart_series_t * ser; - LV_LL_READ_BACK(&chart->series_ll, ser) { - ser->x_points = lv_malloc(sizeof(lv_point_t) * chart->point_cnt); - LV_ASSERT_MALLOC(ser->x_points); - if(ser->x_points == NULL) return; - } - } - - chart->type = type; - - lv_chart_refresh(obj); -} - -void lv_chart_set_point_count(lv_obj_t * obj, uint32_t cnt) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(chart->point_cnt == cnt) return; - - lv_chart_series_t * ser; - - if(cnt < 1) cnt = 1; - - LV_LL_READ_BACK(&chart->series_ll, ser) { - if(chart->type == LV_CHART_TYPE_SCATTER) { - if(!ser->x_ext_buf_assigned) new_points_alloc(obj, ser, cnt, &ser->x_points); - } - if(!ser->y_ext_buf_assigned) new_points_alloc(obj, ser, cnt, &ser->y_points); - ser->start_point = 0; - } - - chart->point_cnt = cnt; - - lv_chart_refresh(obj); -} - -void lv_chart_set_range(lv_obj_t * obj, lv_chart_axis_t axis, int32_t min, int32_t max) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - max = max == min ? max + 1 : max; - - lv_chart_t * chart = (lv_chart_t *)obj; - switch(axis) { - case LV_CHART_AXIS_PRIMARY_Y: - chart->ymin[0] = min; - chart->ymax[0] = max; - break; - case LV_CHART_AXIS_SECONDARY_Y: - chart->ymin[1] = min; - chart->ymax[1] = max; - break; - case LV_CHART_AXIS_PRIMARY_X: - chart->xmin[0] = min; - chart->xmax[0] = max; - break; - case LV_CHART_AXIS_SECONDARY_X: - chart->xmin[1] = min; - chart->xmax[1] = max; - break; - default: - LV_LOG_WARN("Invalid axis: %d", axis); - return; - } - - lv_chart_refresh(obj); -} - -void lv_chart_set_update_mode(lv_obj_t * obj, lv_chart_update_mode_t update_mode) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(chart->update_mode == update_mode) return; - - chart->update_mode = update_mode; - lv_obj_invalidate(obj); -} - -void lv_chart_set_div_line_count(lv_obj_t * obj, uint8_t hdiv, uint8_t vdiv) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(chart->hdiv_cnt == hdiv && chart->vdiv_cnt == vdiv) return; - - chart->hdiv_cnt = hdiv; - chart->vdiv_cnt = vdiv; - - lv_obj_invalidate(obj); -} - -lv_chart_type_t lv_chart_get_type(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - return chart->type; -} - -uint32_t lv_chart_get_point_count(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - return chart->point_cnt; -} - -uint32_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * ser) -{ - LV_ASSERT_NULL(ser); - LV_UNUSED(obj); - - return ser->start_point; -} - -void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, lv_point_t * p_out) -{ - LV_ASSERT_NULL(obj); - LV_ASSERT_NULL(ser); - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(id >= chart->point_cnt) { - LV_LOG_WARN("Invalid index: %"LV_PRIu32, id); - p_out->x = 0; - p_out->y = 0; - return; - } - - int32_t w = lv_obj_get_content_width(obj); - int32_t h = lv_obj_get_content_height(obj); - - if(chart->type == LV_CHART_TYPE_LINE) { - p_out->x = (w * id) / (chart->point_cnt - 1); - } - else if(chart->type == LV_CHART_TYPE_SCATTER) { - p_out->x = lv_map(ser->x_points[id], chart->xmin[ser->x_axis_sec], chart->xmax[ser->x_axis_sec], 0, w); - } - else if(chart->type == LV_CHART_TYPE_BAR) { - uint32_t ser_cnt = lv_ll_get_len(&chart->series_ll); - int32_t ser_gap = lv_obj_get_style_pad_column(obj, LV_PART_ITEMS); - - /*Gap between the columns on adjacent X ticks*/ - int32_t block_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); - - int32_t block_w = (w - ((chart->point_cnt - 1) * block_gap)) / chart->point_cnt; - - p_out->x = (int32_t)((int32_t)(w - block_w) * id) / (chart->point_cnt - 1); - lv_chart_series_t * ser_i = NULL; - uint32_t ser_idx = 0; - LV_LL_READ_BACK(&chart->series_ll, ser_i) { - if(ser_i == ser) break; - ser_idx++; - } - - p_out->x = (int32_t)((int32_t)(w + block_gap) * id) / chart->point_cnt; - p_out->x += block_w * ser_idx / ser_cnt; - - int32_t col_w = (block_w - (ser_gap * (ser_cnt - 1))) / ser_cnt; - p_out->x += col_w / 2; - } - - int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - p_out->x += lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; - p_out->x -= lv_obj_get_scroll_left(obj); - - uint32_t start_point = chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0; - id = ((int32_t)start_point + id) % chart->point_cnt; - int32_t temp_y = 0; - temp_y = (int32_t)((int32_t)ser->y_points[id] - chart->ymin[ser->y_axis_sec]) * h; - temp_y = temp_y / (chart->ymax[ser->y_axis_sec] - chart->ymin[ser->y_axis_sec]); - p_out->y = h - temp_y; - p_out->y += lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; - p_out->y -= lv_obj_get_scroll_top(obj); -} - -void lv_chart_refresh(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_obj_invalidate(obj); -} - -/*====================== - * Series - *=====================*/ - -lv_chart_series_t * lv_chart_add_series(lv_obj_t * obj, lv_color_t color, lv_chart_axis_t axis) -{ - LV_LOG_INFO("begin"); - - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - - /* Allocate space for a new series and add it to the chart series linked list */ - lv_chart_series_t * ser = lv_ll_ins_tail(&chart->series_ll); - LV_ASSERT_MALLOC(ser); - if(ser == NULL) return NULL; - lv_memzero(ser, sizeof(lv_chart_series_t)); - - /* Allocate memory for point_cnt points, handle failure below */ - ser->y_points = lv_malloc(sizeof(int32_t) * chart->point_cnt); - LV_ASSERT_MALLOC(ser->y_points); - - if(chart->type == LV_CHART_TYPE_SCATTER) { - ser->x_points = lv_malloc(sizeof(int32_t) * chart->point_cnt); - LV_ASSERT_MALLOC(ser->x_points); - if(NULL == ser->x_points) { - lv_free(ser->y_points); - lv_ll_remove(&chart->series_ll, ser); - lv_free(ser); - return NULL; - } - } - else { - ser->x_points = NULL; - } - - if(ser->y_points == NULL) { - if(ser->x_points) { - lv_free(ser->x_points); - ser->x_points = NULL; - } - - lv_ll_remove(&chart->series_ll, ser); - lv_free(ser); - return NULL; - } - - /* Set series properties on successful allocation */ - ser->color = color; - ser->start_point = 0; - ser->y_ext_buf_assigned = false; - ser->hidden = 0; - ser->x_axis_sec = axis & LV_CHART_AXIS_SECONDARY_X ? 1 : 0; - ser->y_axis_sec = axis & LV_CHART_AXIS_SECONDARY_Y ? 1 : 0; - - uint32_t i; - const int32_t def = LV_CHART_POINT_NONE; - int32_t * p_tmp = ser->y_points; - for(i = 0; i < chart->point_cnt; i++) { - *p_tmp = def; - p_tmp++; - } - - return ser; -} - -void lv_chart_remove_series(lv_obj_t * obj, lv_chart_series_t * series) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(series); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(!series->y_ext_buf_assigned && series->y_points) lv_free(series->y_points); - if(!series->x_ext_buf_assigned && series->x_points) lv_free(series->x_points); - - lv_ll_remove(&chart->series_ll, series); - lv_free(series); - - return; -} - -void lv_chart_hide_series(lv_obj_t * chart, lv_chart_series_t * series, bool hide) -{ - LV_ASSERT_OBJ(chart, MY_CLASS); - LV_ASSERT_NULL(series); - - series->hidden = hide ? 1 : 0; - lv_chart_refresh(chart); -} - -void lv_chart_set_series_color(lv_obj_t * chart, lv_chart_series_t * series, lv_color_t color) -{ - LV_ASSERT_OBJ(chart, MY_CLASS); - LV_ASSERT_NULL(series); - - series->color = color; - lv_chart_refresh(chart); -} - -lv_color_t lv_chart_get_series_color(lv_obj_t * chart, const lv_chart_series_t * series) -{ - LV_ASSERT_OBJ(chart, MY_CLASS); - LV_ASSERT_NULL(series); - LV_UNUSED(chart); - - return series->color; -} - -void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(ser); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(id >= chart->point_cnt) return; - ser->start_point = id; -} - -lv_chart_series_t * lv_chart_get_series_next(const lv_obj_t * obj, const lv_chart_series_t * ser) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(ser == NULL) return lv_ll_get_head(&chart->series_ll); - else return lv_ll_get_next(&chart->series_ll, ser); -} - -/*===================== - * Cursor - *====================*/ - -lv_chart_cursor_t * lv_chart_add_cursor(lv_obj_t * obj, lv_color_t color, lv_dir_t dir) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - lv_chart_cursor_t * cursor = lv_ll_ins_head(&chart->cursor_ll); - LV_ASSERT_MALLOC(cursor); - if(cursor == NULL) return NULL; - - lv_point_set(&cursor->pos, LV_CHART_POINT_NONE, LV_CHART_POINT_NONE); - cursor->point_id = LV_CHART_POINT_NONE; - cursor->pos_set = 0; - cursor->color = color; - cursor->dir = dir; - - return cursor; -} - -void lv_chart_set_cursor_pos(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_point_t * pos) -{ - LV_ASSERT_NULL(cursor); - LV_UNUSED(chart); - - cursor->pos = *pos; - cursor->pos_set = 1; - lv_chart_refresh(chart); -} - -void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_chart_series_t * ser, uint32_t point_id) -{ - LV_ASSERT_NULL(cursor); - LV_UNUSED(chart); - - cursor->point_id = point_id; - cursor->pos_set = 0; - if(ser == NULL) ser = lv_chart_get_series_next(chart, NULL); - cursor->ser = ser; - lv_chart_refresh(chart); -} - -lv_point_t lv_chart_get_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor) -{ - LV_ASSERT_NULL(cursor); - LV_UNUSED(chart); - - return cursor->pos; -} - -/*===================== - * Set/Get value(s) - *====================*/ - -void lv_chart_set_all_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(ser); - - lv_chart_t * chart = (lv_chart_t *)obj; - uint32_t i; - for(i = 0; i < chart->point_cnt; i++) { - ser->y_points[i] = value; - } - ser->start_point = 0; - lv_chart_refresh(obj); -} - -void lv_chart_set_next_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(ser); - - lv_chart_t * chart = (lv_chart_t *)obj; - ser->y_points[ser->start_point] = value; - invalidate_point(obj, ser->start_point); - ser->start_point = (ser->start_point + 1) % chart->point_cnt; - invalidate_point(obj, ser->start_point); -} - -void lv_chart_set_next_value2(lv_obj_t * obj, lv_chart_series_t * ser, int32_t x_value, int32_t y_value) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(ser); - - lv_chart_t * chart = (lv_chart_t *)obj; - - if(chart->type != LV_CHART_TYPE_SCATTER) { - LV_LOG_WARN("Type must be LV_CHART_TYPE_SCATTER"); - return; - } - - ser->x_points[ser->start_point] = x_value; - ser->y_points[ser->start_point] = y_value; - ser->start_point = (ser->start_point + 1) % chart->point_cnt; - invalidate_point(obj, ser->start_point); -} - -void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, int32_t value) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(ser); - lv_chart_t * chart = (lv_chart_t *)obj; - - if(id >= chart->point_cnt) return; - ser->y_points[id] = value; - invalidate_point(obj, id); -} - -void lv_chart_set_value_by_id2(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, int32_t x_value, - int32_t y_value) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(ser); - lv_chart_t * chart = (lv_chart_t *)obj; - - if(chart->type != LV_CHART_TYPE_SCATTER) { - LV_LOG_WARN("Type must be LV_CHART_TYPE_SCATTER"); - return; - } - - if(id >= chart->point_cnt) return; - ser->x_points[id] = x_value; - ser->y_points[id] = y_value; - invalidate_point(obj, id); -} - -void lv_chart_set_ext_y_array(lv_obj_t * obj, lv_chart_series_t * ser, int32_t array[]) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(ser); - - if(!ser->y_ext_buf_assigned && ser->y_points) lv_free(ser->y_points); - ser->y_ext_buf_assigned = true; - ser->y_points = array; - lv_obj_invalidate(obj); -} - -void lv_chart_set_ext_x_array(lv_obj_t * obj, lv_chart_series_t * ser, int32_t array[]) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(ser); - - if(!ser->x_ext_buf_assigned && ser->x_points) lv_free(ser->x_points); - ser->x_ext_buf_assigned = true; - ser->x_points = array; - lv_obj_invalidate(obj); -} - -int32_t * lv_chart_get_y_array(const lv_obj_t * obj, lv_chart_series_t * ser) -{ - LV_UNUSED(obj); - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(ser); - return ser->y_points; -} - -int32_t * lv_chart_get_x_array(const lv_obj_t * obj, lv_chart_series_t * ser) -{ - LV_UNUSED(obj); - LV_ASSERT_OBJ(obj, MY_CLASS); - LV_ASSERT_NULL(ser); - return ser->x_points; -} - -uint32_t lv_chart_get_pressed_point(const lv_obj_t * obj) -{ - lv_chart_t * chart = (lv_chart_t *)obj; - return chart->pressed_point_id; -} - -int32_t lv_chart_get_first_point_center_offset(lv_obj_t * obj) -{ - lv_chart_t * chart = (lv_chart_t *)obj; - - int32_t x_ofs = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - if(chart->type == LV_CHART_TYPE_BAR) { - lv_obj_update_layout(obj); - /*Gap between the columns on ~adjacent X*/ - int32_t block_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); - int32_t w = lv_obj_get_content_width(obj); - int32_t block_w = (w + block_gap) / (chart->point_cnt); - - x_ofs += (block_w - block_gap) / 2; - } - - return x_ofs; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_chart_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_TRACE_OBJ_CREATE("begin"); - - lv_chart_t * chart = (lv_chart_t *)obj; - - lv_ll_init(&chart->series_ll, sizeof(lv_chart_series_t)); - lv_ll_init(&chart->cursor_ll, sizeof(lv_chart_cursor_t)); - - chart->ymin[0] = 0; - chart->xmin[0] = 0; - chart->ymin[1] = 0; - chart->xmin[1] = 0; - chart->ymax[0] = 100; - chart->xmax[0] = 100; - chart->ymax[1] = 100; - chart->xmax[1] = 100; - - chart->hdiv_cnt = LV_CHART_HDIV_DEF; - chart->vdiv_cnt = LV_CHART_VDIV_DEF; - chart->point_cnt = LV_CHART_POINT_CNT_DEF; - chart->pressed_point_id = LV_CHART_POINT_NONE; - chart->type = LV_CHART_TYPE_LINE; - chart->update_mode = LV_CHART_UPDATE_MODE_SHIFT; - - LV_TRACE_OBJ_CREATE("finished"); -} - -static void lv_chart_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_TRACE_OBJ_CREATE("begin"); - - lv_chart_t * chart = (lv_chart_t *)obj; - lv_chart_series_t * ser; - while(chart->series_ll.head) { - ser = lv_ll_get_head(&chart->series_ll); - if(!ser) continue; - - if(!ser->y_ext_buf_assigned) lv_free(ser->y_points); - if(!ser->x_ext_buf_assigned) lv_free(ser->x_points); - - lv_ll_remove(&chart->series_ll, ser); - lv_free(ser); - } - lv_ll_clear(&chart->series_ll); - - lv_chart_cursor_t * cur; - while(chart->cursor_ll.head) { - cur = lv_ll_get_head(&chart->cursor_ll); - lv_ll_remove(&chart->cursor_ll, cur); - lv_free(cur); - } - lv_ll_clear(&chart->cursor_ll); - - LV_TRACE_OBJ_CREATE("finished"); -} - -static void lv_chart_event(const lv_obj_class_t * class_p, lv_event_t * e) -{ - LV_UNUSED(class_p); - - /*Call the ancestor's event handler*/ - lv_result_t res; - - res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; - - lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(code == LV_EVENT_PRESSED) { - lv_indev_t * indev = lv_indev_active(); - lv_point_t p; - lv_indev_get_point(indev, &p); - - p.x -= obj->coords.x1; - uint32_t id = get_index_from_x(obj, p.x + lv_obj_get_scroll_left(obj)); - if(id != (uint32_t)chart->pressed_point_id) { - invalidate_point(obj, id); - invalidate_point(obj, chart->pressed_point_id); - chart->pressed_point_id = id; - lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - } - } - else if(code == LV_EVENT_RELEASED) { - invalidate_point(obj, chart->pressed_point_id); - chart->pressed_point_id = LV_CHART_POINT_NONE; - } - else if(code == LV_EVENT_DRAW_MAIN) { - lv_layer_t * layer = lv_event_get_layer(e); - draw_div_lines(obj, layer); - - if(lv_ll_is_empty(&chart->series_ll) == false) { - if(chart->type == LV_CHART_TYPE_LINE) draw_series_line(obj, layer); - else if(chart->type == LV_CHART_TYPE_BAR) draw_series_bar(obj, layer); - else if(chart->type == LV_CHART_TYPE_SCATTER) draw_series_scatter(obj, layer); - } - - draw_cursors(obj, layer); - } -} - -static void draw_div_lines(lv_obj_t * obj, lv_layer_t * layer) -{ - lv_chart_t * chart = (lv_chart_t *)obj; - - lv_area_t series_clip_area; - bool mask_ret = lv_area_intersect(&series_clip_area, &obj->coords, &layer->_clip_area); - if(mask_ret == false) return; - - const lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = series_clip_area; - - int16_t i; - int16_t i_start; - int16_t i_end; - int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - int32_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; - int32_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; - int32_t w = lv_obj_get_content_width(obj); - int32_t h = lv_obj_get_content_height(obj); - - lv_draw_line_dsc_t line_dsc; - lv_draw_line_dsc_init(&line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_MAIN, &line_dsc); - - lv_opa_t border_opa = lv_obj_get_style_border_opa(obj, LV_PART_MAIN); - int32_t border_w = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - lv_border_side_t border_side = lv_obj_get_style_border_side(obj, LV_PART_MAIN); - - int32_t scroll_left = lv_obj_get_scroll_left(obj); - int32_t scroll_top = lv_obj_get_scroll_top(obj); - if(chart->hdiv_cnt != 0) { - int32_t y_ofs = obj->coords.y1 + pad_top - scroll_top; - line_dsc.p1.x = obj->coords.x1; - line_dsc.p2.x = obj->coords.x2; - - i_start = 0; - i_end = chart->hdiv_cnt; - if(border_opa > LV_OPA_MIN && border_w > 0) { - if((border_side & LV_BORDER_SIDE_TOP) && (lv_obj_get_style_pad_top(obj, LV_PART_MAIN) == 0)) i_start++; - if((border_side & LV_BORDER_SIDE_BOTTOM) && (lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN) == 0)) i_end--; - } - - for(i = i_start; i < i_end; i++) { - line_dsc.p1.y = (int32_t)((int32_t)h * i) / (chart->hdiv_cnt - 1); - line_dsc.p1.y += y_ofs; - line_dsc.p2.y = line_dsc.p1.y; - line_dsc.base.id1 = i; - - lv_draw_line(layer, &line_dsc); - } - } - - if(chart->vdiv_cnt != 0) { - int32_t x_ofs = obj->coords.x1 + pad_left - scroll_left; - line_dsc.p1.y = obj->coords.y1; - line_dsc.p2.y = obj->coords.y2; - i_start = 0; - i_end = chart->vdiv_cnt; - if(border_opa > LV_OPA_MIN && border_w > 0) { - if((border_side & LV_BORDER_SIDE_LEFT) && (lv_obj_get_style_pad_left(obj, LV_PART_MAIN) == 0)) i_start++; - if((border_side & LV_BORDER_SIDE_RIGHT) && (lv_obj_get_style_pad_right(obj, LV_PART_MAIN) == 0)) i_end--; - } - - for(i = i_start; i < i_end; i++) { - line_dsc.p1.x = (int32_t)((int32_t)w * i) / (chart->vdiv_cnt - 1); - line_dsc.p1.x += x_ofs; - line_dsc.p2.x = line_dsc.p1.x; - line_dsc.base.id1 = i; - - lv_draw_line(layer, &line_dsc); - } - } - - layer->_clip_area = clip_area_ori; -} - -static void draw_series_line(lv_obj_t * obj, lv_layer_t * layer) -{ - lv_area_t clip_area; - if(lv_area_intersect(&clip_area, &obj->coords, &layer->_clip_area) == false) return; - - const lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = clip_area; - - lv_chart_t * chart = (lv_chart_t *)obj; - if(chart->point_cnt < 2) return; - - uint32_t i; - int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - int32_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; - int32_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; - int32_t w = lv_obj_get_content_width(obj); - int32_t h = lv_obj_get_content_height(obj); - int32_t x_ofs = obj->coords.x1 + pad_left - lv_obj_get_scroll_left(obj); - int32_t y_ofs = obj->coords.y1 + pad_top - lv_obj_get_scroll_top(obj); - lv_chart_series_t * ser; - - lv_area_t series_clip_area; - bool mask_ret = lv_area_intersect(&series_clip_area, &obj->coords, &layer->_clip_area); - if(mask_ret == false) return; - - lv_draw_line_dsc_t line_dsc; - lv_draw_line_dsc_init(&line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &line_dsc); - - lv_draw_rect_dsc_t point_dsc_default; - lv_draw_rect_dsc_init(&point_dsc_default); - lv_obj_init_draw_rect_dsc(obj, LV_PART_INDICATOR, &point_dsc_default); - - int32_t point_w = lv_obj_get_style_width(obj, LV_PART_INDICATOR) / 2; - int32_t point_h = lv_obj_get_style_height(obj, LV_PART_INDICATOR) / 2; - - /*Do not bother with line ending is the point will over it*/ - if(LV_MIN(point_w, point_h) > line_dsc.width / 2) line_dsc.raw_end = 1; - if(line_dsc.width == 1) line_dsc.raw_end = 1; - - /*If there are at least as many points as pixels then draw only vertical lines*/ - bool crowded_mode = (int32_t)chart->point_cnt >= w; - - line_dsc.base.id1 = lv_ll_get_len(&chart->series_ll) - 1; - point_dsc_default.base.id1 = line_dsc.base.id1; - /*Go through all data lines*/ - LV_LL_READ_BACK(&chart->series_ll, ser) { - if(ser->hidden) { - line_dsc.base.id1--; - point_dsc_default.base.id1--; - continue; - } - line_dsc.color = ser->color; - point_dsc_default.bg_color = ser->color; - line_dsc.base.id2 = 0; - point_dsc_default.base.id2 = 0; - - int32_t start_point = chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0; - - line_dsc.p1.x = x_ofs; - line_dsc.p2.x = x_ofs; - - int32_t p_act = start_point; - int32_t p_prev = start_point; - int32_t y_tmp = (int32_t)((int32_t)ser->y_points[p_prev] - chart->ymin[ser->y_axis_sec]) * h; - y_tmp = y_tmp / (chart->ymax[ser->y_axis_sec] - chart->ymin[ser->y_axis_sec]); - line_dsc.p2.y = h - y_tmp + y_ofs; - - lv_value_precise_t y_min = line_dsc.p2.y; - lv_value_precise_t y_max = line_dsc.p2.y; - - for(i = 0; i < chart->point_cnt; i++) { - line_dsc.p1.x = line_dsc.p2.x; - line_dsc.p1.y = line_dsc.p2.y; - - if(line_dsc.p1.x > clip_area_ori.x2 + point_w + 1) break; - line_dsc.p2.x = (lv_value_precise_t)((w * i) / (chart->point_cnt - 1)) + x_ofs; - - p_act = (start_point + i) % chart->point_cnt; - - y_tmp = (int32_t)((int32_t)ser->y_points[p_act] - chart->ymin[ser->y_axis_sec]) * h; - y_tmp = y_tmp / (chart->ymax[ser->y_axis_sec] - chart->ymin[ser->y_axis_sec]); - line_dsc.p2.y = h - y_tmp + y_ofs; - - if(line_dsc.p2.x < clip_area_ori.x1 - point_w - 1) { - p_prev = p_act; - continue; - } - - /*Don't draw the first point. A second point is also required to draw the line*/ - if(i != 0) { - if(crowded_mode) { - if(ser->y_points[p_prev] != LV_CHART_POINT_NONE && ser->y_points[p_act] != LV_CHART_POINT_NONE) { - /*Draw only one vertical line between the min and max y-values on the same x-value*/ - y_max = LV_MAX(y_max, line_dsc.p2.y); - y_min = LV_MIN(y_min, line_dsc.p2.y); - if(line_dsc.p1.x != line_dsc.p2.x) { - lv_value_precise_t y_cur = line_dsc.p2.y; - line_dsc.p2.x--; /*It's already on the next x value*/ - line_dsc.p1.x = line_dsc.p2.x; - line_dsc.p1.y = y_min; - line_dsc.p2.y = y_max; - if(line_dsc.p1.y == line_dsc.p2.y) line_dsc.p2.y++; /*If they are the same no line will be drawn*/ - lv_draw_line(layer, &line_dsc); - line_dsc.p2.x++; /*Compensate the previous x--*/ - y_min = y_cur; /*Start the line of the next x from the current last y*/ - y_max = y_cur; - } - } - } - else { - lv_area_t point_area; - point_area.x1 = (int32_t)line_dsc.p1.x - point_w; - point_area.x2 = (int32_t)line_dsc.p1.x + point_w; - point_area.y1 = (int32_t)line_dsc.p1.y - point_h; - point_area.y2 = (int32_t)line_dsc.p1.y + point_h; - - if(ser->y_points[p_prev] != LV_CHART_POINT_NONE && ser->y_points[p_act] != LV_CHART_POINT_NONE) { - line_dsc.base.id2 = i; - lv_draw_line(layer, &line_dsc); - } - - if(point_w && point_h && ser->y_points[p_prev] != LV_CHART_POINT_NONE) { - point_dsc_default.base.id2 = i - 1; - lv_draw_rect(layer, &point_dsc_default, &point_area); - } - } - - } - p_prev = p_act; - } - - /*Draw the last point*/ - if(!crowded_mode && i == chart->point_cnt) { - - if(ser->y_points[p_act] != LV_CHART_POINT_NONE) { - lv_area_t point_area; - point_area.x1 = (int32_t)line_dsc.p2.x - point_w; - point_area.x2 = (int32_t)line_dsc.p2.x + point_w; - point_area.y1 = (int32_t)line_dsc.p2.y - point_h; - point_area.y2 = (int32_t)line_dsc.p2.y + point_h; - point_dsc_default.base.id2 = i - 1; - lv_draw_rect(layer, &point_dsc_default, &point_area); - } - } - - point_dsc_default.base.id1--; - line_dsc.base.id1--; - } - - layer->_clip_area = clip_area_ori; -} - -static void draw_series_scatter(lv_obj_t * obj, lv_layer_t * layer) -{ - - lv_area_t clip_area; - if(lv_area_intersect(&clip_area, &obj->coords, &layer->_clip_area) == false) return; - - const lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = clip_area; - - lv_chart_t * chart = (lv_chart_t *)obj; - - uint32_t i; - int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - int32_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t w = lv_obj_get_content_width(obj); - int32_t h = lv_obj_get_content_height(obj); - int32_t x_ofs = obj->coords.x1 + pad_left + border_width - lv_obj_get_scroll_left(obj); - int32_t y_ofs = obj->coords.y1 + pad_top + border_width - lv_obj_get_scroll_top(obj); - lv_chart_series_t * ser; - - lv_draw_line_dsc_t line_dsc; - lv_draw_line_dsc_init(&line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &line_dsc); - - lv_draw_rect_dsc_t point_dsc_default; - lv_draw_rect_dsc_init(&point_dsc_default); - lv_obj_init_draw_rect_dsc(obj, LV_PART_INDICATOR, &point_dsc_default); - - int32_t point_w = lv_obj_get_style_width(obj, LV_PART_INDICATOR) / 2; - int32_t point_h = lv_obj_get_style_height(obj, LV_PART_INDICATOR) / 2; - - /*Do not bother with line ending is the point will over it*/ - if(LV_MIN(point_w, point_h) > line_dsc.width / 2) line_dsc.raw_end = 1; - if(line_dsc.width == 1) line_dsc.raw_end = 1; - - /*Go through all data lines*/ - LV_LL_READ_BACK(&chart->series_ll, ser) { - if(ser->hidden) continue; - line_dsc.color = ser->color; - point_dsc_default.bg_color = ser->color; - - int32_t start_point = chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0; - - line_dsc.p1.x = x_ofs; - line_dsc.p2.x = x_ofs; - - int32_t p_act = start_point; - int32_t p_prev = start_point; - if(ser->y_points[p_act] != LV_CHART_POINT_CNT_DEF) { - line_dsc.p2.x = lv_map(ser->x_points[p_act], chart->xmin[ser->x_axis_sec], chart->xmax[ser->x_axis_sec], 0, w); - line_dsc.p2.x += x_ofs; - - line_dsc.p2.y = lv_map(ser->y_points[p_act], chart->ymin[ser->y_axis_sec], chart->ymax[ser->y_axis_sec], 0, h); - line_dsc.p2.y = h - line_dsc.p2.y; - line_dsc.p2.y += y_ofs; - } - else { - line_dsc.p2.x = (lv_value_precise_t)LV_COORD_MIN; - line_dsc.p2.y = (lv_value_precise_t)LV_COORD_MIN; - } - - for(i = 0; i < chart->point_cnt; i++) { - line_dsc.p1.x = line_dsc.p2.x; - line_dsc.p1.y = line_dsc.p2.y; - - p_act = (start_point + i) % chart->point_cnt; - if(ser->y_points[p_act] != LV_CHART_POINT_NONE) { - line_dsc.p2.y = lv_map(ser->y_points[p_act], chart->ymin[ser->y_axis_sec], chart->ymax[ser->y_axis_sec], 0, h); - line_dsc.p2.y = h - line_dsc.p2.y; - line_dsc.p2.y += y_ofs; - - line_dsc.p2.x = lv_map(ser->x_points[p_act], chart->xmin[ser->x_axis_sec], chart->xmax[ser->x_axis_sec], 0, w); - line_dsc.p2.x += x_ofs; - } - else { - p_prev = p_act; - continue; - } - - /*Don't draw the first point. A second point is also required to draw the line*/ - if(i != 0) { - lv_area_t point_area; - point_area.x1 = (int32_t)line_dsc.p1.x - point_w; - point_area.x2 = (int32_t)line_dsc.p1.x + point_w; - point_area.y1 = (int32_t)line_dsc.p1.y - point_h; - point_area.y2 = (int32_t)line_dsc.p1.y + point_h; - - if(ser->y_points[p_prev] != LV_CHART_POINT_NONE && ser->y_points[p_act] != LV_CHART_POINT_NONE) { - line_dsc.base.id2 = i; - lv_draw_line(layer, &line_dsc); - if(point_w && point_h) { - point_dsc_default.base.id2 = i; - lv_draw_rect(layer, &point_dsc_default, &point_area); - } - } - - p_prev = p_act; - } - - /*Draw the last point*/ - if(i == chart->point_cnt) { - - if(ser->y_points[p_act] != LV_CHART_POINT_NONE) { - lv_area_t point_area; - point_area.x1 = (int32_t)line_dsc.p2.x - point_w; - point_area.x2 = (int32_t)line_dsc.p2.x + point_w; - point_area.y1 = (int32_t)line_dsc.p2.y - point_h; - point_area.y2 = (int32_t)line_dsc.p2.y + point_h; - - point_dsc_default.base.id2 = i; - lv_draw_rect(layer, &point_dsc_default, &point_area); - } - } - } - line_dsc.base.id1++; - point_dsc_default.base.id1++; - layer->_clip_area = clip_area_ori; - } -} - -static void draw_series_bar(lv_obj_t * obj, lv_layer_t * layer) -{ - lv_area_t clip_area; - if(lv_area_intersect(&clip_area, &obj->coords, &layer->_clip_area) == false) return; - - const lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = clip_area; - - lv_chart_t * chart = (lv_chart_t *)obj; - - uint32_t i; - lv_area_t col_a; - int32_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t w = lv_obj_get_content_width(obj); - int32_t h = lv_obj_get_content_height(obj); - int32_t y_tmp; - lv_chart_series_t * ser; - uint32_t ser_cnt = lv_ll_get_len(&chart->series_ll); - int32_t block_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); /*Gap between the column on ~adjacent X*/ - int32_t block_w = (w - ((chart->point_cnt - 1) * block_gap)) / chart->point_cnt; - int32_t ser_gap = lv_obj_get_style_pad_column(obj, LV_PART_ITEMS); /*Gap between the columns on the ~same X*/ - int32_t col_w = (block_w - (ser_cnt - 1) * ser_gap) / ser_cnt; - if(col_w < 1) col_w = 1; - - int32_t border_w = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - int32_t x_ofs = pad_left - lv_obj_get_scroll_left(obj) + border_w; - int32_t y_ofs = pad_top - lv_obj_get_scroll_top(obj) + border_w; - - lv_draw_rect_dsc_t col_dsc; - lv_draw_rect_dsc_init(&col_dsc); - lv_obj_init_draw_rect_dsc(obj, LV_PART_ITEMS, &col_dsc); - col_dsc.bg_grad.dir = LV_GRAD_DIR_NONE; - col_dsc.bg_opa = LV_OPA_COVER; - - /*Make the cols longer with `radius` to clip the rounding from the bottom*/ - col_a.y2 = obj->coords.y2 + col_dsc.radius; - - /*Go through all points*/ - for(i = 0; i < chart->point_cnt; i++) { - int32_t x_act = (int32_t)((int32_t)(w - block_w) * i) / (chart->point_cnt - 1) + obj->coords.x1 + x_ofs; - col_dsc.base.id2 = i; - col_dsc.base.id1 = 0; - - /*Draw the current point of all data line*/ - LV_LL_READ(&chart->series_ll, ser) { - if(ser->hidden) continue; - - int32_t start_point = chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0; - - col_a.x1 = x_act; - col_a.x2 = col_a.x1 + col_w - 1; - x_act += col_w + ser_gap; - - if(col_a.x2 < clip_area.x1) { - col_dsc.base.id1++; - continue; - } - if(col_a.x1 > clip_area.x2) break; - - col_dsc.bg_color = ser->color; - - int32_t p_act = (start_point + i) % chart->point_cnt; - y_tmp = (int32_t)((int32_t)ser->y_points[p_act] - chart->ymin[ser->y_axis_sec]) * h; - y_tmp = y_tmp / (chart->ymax[ser->y_axis_sec] - chart->ymin[ser->y_axis_sec]); - col_a.y1 = h - y_tmp + obj->coords.y1 + y_ofs; - - if(ser->y_points[p_act] != LV_CHART_POINT_NONE) { - lv_draw_rect(layer, &col_dsc, &col_a); - } - col_dsc.base.id1++; - } - } - layer->_clip_area = clip_area_ori; -} - -static void draw_cursors(lv_obj_t * obj, lv_layer_t * layer) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(lv_ll_is_empty(&chart->cursor_ll)) return; - - lv_area_t clip_area; - if(!lv_area_intersect(&clip_area, &layer->_clip_area, &obj->coords)) return; - - const lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = clip_area; - - lv_chart_cursor_t * cursor; - - lv_draw_line_dsc_t line_dsc_ori; - lv_draw_line_dsc_init(&line_dsc_ori); - lv_obj_init_draw_line_dsc(obj, LV_PART_CURSOR, &line_dsc_ori); - - lv_draw_rect_dsc_t point_dsc_ori; - lv_draw_rect_dsc_init(&point_dsc_ori); - lv_obj_init_draw_rect_dsc(obj, LV_PART_CURSOR, &point_dsc_ori); - - lv_draw_line_dsc_t line_dsc; - lv_draw_rect_dsc_t point_dsc_tmp; - - int32_t point_w = lv_obj_get_style_width(obj, LV_PART_CURSOR) / 2; - int32_t point_h = lv_obj_get_style_width(obj, LV_PART_CURSOR) / 2; - - /*Go through all cursor lines*/ - LV_LL_READ_BACK(&chart->cursor_ll, cursor) { - lv_memcpy(&line_dsc, &line_dsc_ori, sizeof(lv_draw_line_dsc_t)); - lv_memcpy(&point_dsc_tmp, &point_dsc_ori, sizeof(lv_draw_rect_dsc_t)); - line_dsc.color = cursor->color; - point_dsc_tmp.bg_color = cursor->color; - - int32_t cx; - int32_t cy; - if(cursor->pos_set) { - cx = cursor->pos.x; - cy = cursor->pos.y; - } - else { - if(cursor->point_id == LV_CHART_POINT_NONE) continue; - lv_point_t p; - lv_chart_get_point_pos_by_id(obj, cursor->ser, cursor->point_id, &p); - cx = p.x; - cy = p.y; - } - - cx += obj->coords.x1; - cy += obj->coords.y1; - - lv_area_t point_area; - bool draw_point = point_w && point_h; - point_area.x1 = cx - point_w; - point_area.x2 = cx + point_w; - point_area.y1 = cy - point_h; - point_area.y2 = cy + point_h; - - if(cursor->dir & LV_DIR_HOR) { - line_dsc.p1.x = cursor->dir & LV_DIR_LEFT ? obj->coords.x1 : cx; - line_dsc.p1.y = cy; - line_dsc.p2.x = cursor->dir & LV_DIR_RIGHT ? obj->coords.x2 : cx; - line_dsc.p2.y = line_dsc.p1.y; - - line_dsc.base.id2 = 0; - point_dsc_tmp.base.id2 = 0; - - lv_draw_line(layer, &line_dsc); - - if(draw_point) { - lv_draw_rect(layer, &point_dsc_tmp, &point_area); - } - } - - if(cursor->dir & LV_DIR_VER) { - line_dsc.p1.x = cx; - line_dsc.p1.y = cursor->dir & LV_DIR_TOP ? obj->coords.y1 : cy; - line_dsc.p2.x = line_dsc.p1.x; - line_dsc.p2.y = cursor->dir & LV_DIR_BOTTOM ? obj->coords.y2 : cy; - - line_dsc.base.id2 = 1; - point_dsc_tmp.base.id2 = 1; - - lv_draw_line(layer, &line_dsc); - - if(draw_point) { - lv_draw_rect(layer, &point_dsc_tmp, &point_area); - } - } - line_dsc_ori.base.id1++; - point_dsc_ori.base.id1++; - } - - layer->_clip_area = clip_area_ori; -} - -/** - * Get the nearest index to an X coordinate - * @param chart pointer to a chart object - * @param coord the coordination of the point relative to the series area. - * @return the found index - */ -static uint32_t get_index_from_x(lv_obj_t * obj, int32_t x) -{ - lv_chart_t * chart = (lv_chart_t *)obj; - int32_t w = lv_obj_get_content_width(obj); - int32_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - x -= pad_left; - - if(x < 0) return 0; - if(x > w) return chart->point_cnt - 1; - if(chart->type == LV_CHART_TYPE_LINE) return (x * (chart->point_cnt - 1) + w / 2) / w; - if(chart->type == LV_CHART_TYPE_BAR) return (x * chart->point_cnt) / w; - - return 0; -} - -static void invalidate_point(lv_obj_t * obj, uint32_t i) -{ - lv_chart_t * chart = (lv_chart_t *)obj; - if(i >= chart->point_cnt) return; - - int32_t w = lv_obj_get_content_width(obj); - int32_t scroll_left = lv_obj_get_scroll_left(obj); - - /*In shift mode the whole chart changes so the whole object*/ - if(chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT) { - lv_obj_invalidate(obj); - return; - } - - if(chart->type == LV_CHART_TYPE_LINE) { - int32_t bwidth = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - int32_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t x_ofs = obj->coords.x1 + pleft + bwidth - scroll_left; - int32_t line_width = lv_obj_get_style_line_width(obj, LV_PART_ITEMS); - int32_t point_w = lv_obj_get_style_width(obj, LV_PART_INDICATOR); - - lv_area_t coords; - lv_area_copy(&coords, &obj->coords); - coords.y1 -= line_width + point_w; - coords.y2 += line_width + point_w; - - if(i < chart->point_cnt - 1) { - coords.x1 = ((w * i) / (chart->point_cnt - 1)) + x_ofs - line_width - point_w; - coords.x2 = ((w * (i + 1)) / (chart->point_cnt - 1)) + x_ofs + line_width + point_w; - lv_obj_invalidate_area(obj, &coords); - } - - if(i > 0) { - coords.x1 = ((w * (i - 1)) / (chart->point_cnt - 1)) + x_ofs - line_width - point_w; - coords.x2 = ((w * i) / (chart->point_cnt - 1)) + x_ofs + line_width + point_w; - lv_obj_invalidate_area(obj, &coords); - } - } - else if(chart->type == LV_CHART_TYPE_BAR) { - lv_area_t col_a; - /*Gap between the column on ~adjacent X*/ - int32_t block_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); - - int32_t block_w = (w + block_gap) / chart->point_cnt; - - int32_t bwidth = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - int32_t x_act; - x_act = (int32_t)((int32_t)(block_w) * i) ; - x_act += obj->coords.x1 + bwidth + lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - - lv_obj_get_coords(obj, &col_a); - col_a.x1 = x_act - scroll_left; - col_a.x2 = col_a.x1 + block_w; - col_a.x1 -= block_gap; - - lv_obj_invalidate_area(obj, &col_a); - } - else { - lv_obj_invalidate(obj); - } -} - -static void new_points_alloc(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t cnt, int32_t ** a) -{ - if((*a) == NULL) return; - - lv_chart_t * chart = (lv_chart_t *) obj; - uint32_t point_cnt_old = chart->point_cnt; - uint32_t i; - - if(ser->start_point != 0) { - int32_t * new_points = lv_malloc(sizeof(int32_t) * cnt); - LV_ASSERT_MALLOC(new_points); - if(new_points == NULL) return; - - if(cnt >= point_cnt_old) { - for(i = 0; i < point_cnt_old; i++) { - new_points[i] = - (*a)[(i + ser->start_point) % point_cnt_old]; /*Copy old contents to new array*/ - } - for(i = point_cnt_old; i < cnt; i++) { - new_points[i] = LV_CHART_POINT_NONE; /*Fill up the rest with default value*/ - } - } - else { - for(i = 0; i < cnt; i++) { - new_points[i] = - (*a)[(i + ser->start_point) % point_cnt_old]; /*Copy old contents to new array*/ - } - } - - /*Switch over pointer from old to new*/ - lv_free((*a)); - (*a) = new_points; - } - else { - (*a) = lv_realloc((*a), sizeof(int32_t) * cnt); - LV_ASSERT_MALLOC((*a)); - if((*a) == NULL) return; - /*Initialize the new points*/ - if(cnt > point_cnt_old) { - for(i = point_cnt_old - 1; i < cnt; i++) { - (*a)[i] = LV_CHART_POINT_NONE; - } - } - } -} - -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/chart/lv_chart_private.h b/L3_Middlewares/LVGL/src/widgets/chart/lv_chart_private.h deleted file mode 100644 index 7cf9052..0000000 --- a/L3_Middlewares/LVGL/src/widgets/chart/lv_chart_private.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @file lv_chart_private.h - * - */ - -#ifndef LV_CHART_PRIVATE_H -#define LV_CHART_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_chart.h" - -#if LV_USE_CHART != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * Descriptor a chart series - */ -struct lv_chart_series_t { - int32_t * x_points; - int32_t * y_points; - lv_color_t color; - uint32_t start_point; - uint32_t hidden : 1; - uint32_t x_ext_buf_assigned : 1; - uint32_t y_ext_buf_assigned : 1; - uint32_t x_axis_sec : 1; - uint32_t y_axis_sec : 1; -}; - -struct lv_chart_cursor_t { - lv_point_t pos; - int32_t point_id; - lv_color_t color; - lv_chart_series_t * ser; - lv_dir_t dir; - uint32_t pos_set: 1; /**< 1: pos is set; 0: point_id is set*/ -}; - -struct lv_chart_t { - lv_obj_t obj; - lv_ll_t series_ll; /**< Linked list for the series (stores lv_chart_series_t)*/ - lv_ll_t cursor_ll; /**< Linked list for the cursors (stores lv_chart_cursor_t)*/ - int32_t ymin[2]; - int32_t ymax[2]; - int32_t xmin[2]; - int32_t xmax[2]; - int32_t pressed_point_id; - uint32_t hdiv_cnt; /**< Number of horizontal division lines*/ - uint32_t vdiv_cnt; /**< Number of vertical division lines*/ - uint32_t point_cnt; /**< Point number in a data line*/ - lv_chart_type_t type : 3; /**< Line or column chart*/ - lv_chart_update_mode_t update_mode : 1; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_CHART != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_CHART_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/checkbox/lv_checkbox_private.h b/L3_Middlewares/LVGL/src/widgets/checkbox/lv_checkbox_private.h deleted file mode 100644 index c927b65..0000000 --- a/L3_Middlewares/LVGL/src/widgets/checkbox/lv_checkbox_private.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file lv_checkbox_private.h - * - */ - -#ifndef LV_CHECKBOX_PRIVATE_H -#define LV_CHECKBOX_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_checkbox.h" - -#if LV_USE_CHECKBOX != 0 -#include "../../core/lv_obj_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_checkbox_t { - lv_obj_t obj; - char * txt; - uint32_t static_txt : 1; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_CHECKBOX != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_CHECKBOX_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/dropdown/lv_dropdown_private.h b/L3_Middlewares/LVGL/src/widgets/dropdown/lv_dropdown_private.h deleted file mode 100644 index 67d879a..0000000 --- a/L3_Middlewares/LVGL/src/widgets/dropdown/lv_dropdown_private.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file lv_dropdown_private.h - * - */ - -#ifndef LV_DROPDOWN_PRIVATE_H -#define LV_DROPDOWN_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_dropdown.h" - -#if LV_USE_DROPDOWN != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_dropdown_t { - lv_obj_t obj; - lv_obj_t * list; /**< The dropped down list*/ - const char * text; /**< Text to display on the dropdown's button*/ - const void * symbol; /**< Arrow or other icon when the drop-down list is closed*/ - char * options; /**< Options in a '\n' separated list*/ - uint32_t option_cnt; /**< Number of options*/ - uint32_t sel_opt_id; /**< Index of the currently selected option*/ - uint32_t sel_opt_id_orig; /**< Store the original index on focus*/ - uint32_t pr_opt_id; /**< Index of the currently pressed option*/ - uint8_t dir : 4; /**< Direction in which the list should open*/ - uint8_t static_txt : 1; /**< 1: Only a pointer is saved in `options`*/ - uint8_t selected_highlight: 1; /**< 1: Make the selected option highlighted in the list*/ -}; - -struct lv_dropdown_list_t { - lv_obj_t obj; - lv_obj_t * dropdown; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_DROPDOWN != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_DROPDOWN_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/image/lv_image.c b/L3_Middlewares/LVGL/src/widgets/image/lv_image.c deleted file mode 100644 index 5fdcc12..0000000 --- a/L3_Middlewares/LVGL/src/widgets/image/lv_image.c +++ /dev/null @@ -1,885 +0,0 @@ -/** - * @file lv_img.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_image_private.h" -#include "../../misc/lv_area_private.h" -#include "../../draw/lv_draw_image_private.h" -#include "../../draw/lv_draw_private.h" -#include "../../core/lv_obj_event_private.h" -#include "../../core/lv_obj_class_private.h" -#if LV_USE_IMAGE != 0 - -#include "../../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_image_class) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_image_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_image_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_image_event(const lv_obj_class_t * class_p, lv_event_t * e); -static void draw_image(lv_event_t * e); -static void scale_update(lv_obj_t * obj, int32_t scale_x, int32_t scale_y); -static void update_align(lv_obj_t * obj); -#if LV_USE_OBJ_PROPERTY - static void lv_image_set_pivot_helper(lv_obj_t * obj, lv_point_t * pivot); - static lv_point_t lv_image_get_pivot_helper(lv_obj_t * obj); -#endif - -#if LV_USE_OBJ_PROPERTY -static const lv_property_ops_t properties[] = { - { - .id = LV_PROPERTY_IMAGE_SRC, - .setter = lv_image_set_src, - .getter = lv_image_get_src, - }, - { - .id = LV_PROPERTY_IMAGE_OFFSET_X, - .setter = lv_image_set_offset_x, - .getter = lv_image_get_offset_x, - }, - { - .id = LV_PROPERTY_IMAGE_OFFSET_Y, - .setter = lv_image_set_offset_y, - .getter = lv_image_get_offset_y, - }, - { - .id = LV_PROPERTY_IMAGE_ROTATION, - .setter = lv_image_set_rotation, - .getter = lv_image_get_rotation, - }, - { - .id = LV_PROPERTY_IMAGE_PIVOT, - .setter = lv_image_set_pivot_helper, - .getter = lv_image_get_pivot_helper, - }, - { - .id = LV_PROPERTY_IMAGE_SCALE, - .setter = lv_image_set_scale, - .getter = lv_image_get_scale, - }, - { - .id = LV_PROPERTY_IMAGE_SCALE_X, - .setter = lv_image_set_scale_x, - .getter = lv_image_get_scale_x, - }, - { - .id = LV_PROPERTY_IMAGE_SCALE_Y, - .setter = lv_image_set_scale_y, - .getter = lv_image_get_scale_y, - }, - { - .id = LV_PROPERTY_IMAGE_BLEND_MODE, - .setter = lv_image_set_blend_mode, - .getter = lv_image_get_blend_mode, - }, - { - .id = LV_PROPERTY_IMAGE_ANTIALIAS, - .setter = lv_image_set_antialias, - .getter = lv_image_get_antialias, - }, - { - .id = LV_PROPERTY_IMAGE_INNER_ALIGN, - .setter = lv_image_set_inner_align, - .getter = lv_image_get_inner_align, - }, -}; -#endif - -/********************** - * STATIC VARIABLES - **********************/ -const lv_obj_class_t lv_image_class = { - .constructor_cb = lv_image_constructor, - .destructor_cb = lv_image_destructor, - .event_cb = lv_image_event, - .width_def = LV_SIZE_CONTENT, - .height_def = LV_SIZE_CONTENT, - .instance_size = sizeof(lv_image_t), - .base_class = &lv_obj_class, - .name = "image", -#if LV_USE_OBJ_PROPERTY - .prop_index_start = LV_PROPERTY_IMAGE_START, - .prop_index_end = LV_PROPERTY_IMAGE_END, - .properties = properties, - .properties_count = sizeof(properties) / sizeof(properties[0]), - -#if LV_USE_OBJ_PROPERTY_NAME - .property_names = lv_image_property_names, - .names_count = sizeof(lv_image_property_names) / sizeof(lv_property_name_t), -#endif - -#endif -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_image_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -/*===================== - * Setter functions - *====================*/ - -void lv_image_set_src(lv_obj_t * obj, const void * src) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_obj_invalidate(obj); - - lv_image_src_t src_type = lv_image_src_get_type(src); - lv_image_t * img = (lv_image_t *)obj; - -#if LV_USE_LOG && LV_LOG_LEVEL <= LV_LOG_LEVEL_INFO - switch(src_type) { - case LV_IMAGE_SRC_FILE: - LV_LOG_TRACE("`LV_IMAGE_SRC_FILE` type found"); - break; - case LV_IMAGE_SRC_VARIABLE: - LV_LOG_TRACE("`LV_IMAGE_SRC_VARIABLE` type found"); - break; - case LV_IMAGE_SRC_SYMBOL: - LV_LOG_TRACE("`LV_IMAGE_SRC_SYMBOL` type found"); - break; - default: - LV_LOG_WARN("unknown type"); - } -#endif - - /*If the new source type is unknown free the memories of the old source*/ - if(src_type == LV_IMAGE_SRC_UNKNOWN) { - LV_LOG_WARN("unknown image type"); - if(img->src_type == LV_IMAGE_SRC_SYMBOL || img->src_type == LV_IMAGE_SRC_FILE) { - lv_free((void *)img->src); - } - img->src = NULL; - img->src_type = LV_IMAGE_SRC_UNKNOWN; - return; - } - - lv_image_header_t header; - lv_result_t res = lv_image_decoder_get_info(src, &header); - if(res != LV_RESULT_OK) { -#if LV_USE_LOG - char buf[24]; - LV_LOG_WARN("failed to get image info: %s", - src_type == LV_IMAGE_SRC_FILE ? (const char *)src : (lv_snprintf(buf, sizeof(buf), "%p", src), buf)); -#endif /*LV_USE_LOG*/ - return; - } - - /*Save the source*/ - if(src_type == LV_IMAGE_SRC_VARIABLE) { - /*If memory was allocated because of the previous `src_type` then free it*/ - if(img->src_type == LV_IMAGE_SRC_FILE || img->src_type == LV_IMAGE_SRC_SYMBOL) { - lv_free((void *)img->src); - } - img->src = src; - } - else if(src_type == LV_IMAGE_SRC_FILE || src_type == LV_IMAGE_SRC_SYMBOL) { - /*If the new and the old src are the same then it was only a refresh.*/ - if(img->src != src) { - const void * old_src = NULL; - /*If memory was allocated because of the previous `src_type` then save its pointer and free after allocation. - *It's important to allocate first to be sure the new data will be on a new address. - *Else `img_cache` wouldn't see the change in source.*/ - if(img->src_type == LV_IMAGE_SRC_FILE || img->src_type == LV_IMAGE_SRC_SYMBOL) { - old_src = img->src; - } - char * new_str = lv_strdup(src); - LV_ASSERT_MALLOC(new_str); - if(new_str == NULL) return; - img->src = new_str; - - if(old_src) lv_free((void *)old_src); - } - } - - if(src_type == LV_IMAGE_SRC_SYMBOL) { - /*`lv_image_dsc_get_info` couldn't set the width and height of a font so set it here*/ - const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - int32_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - lv_point_t size; - lv_text_get_size(&size, src, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE); - header.w = size.x; - header.h = size.y; - } - - img->src_type = src_type; - img->w = header.w; - img->h = header.h; - img->cf = header.cf; - - lv_obj_refresh_self_size(obj); - - update_align(obj); - - /*Provide enough room for the rotated corners*/ - if(img->rotation || img->scale_x != LV_SCALE_NONE || img->scale_y != LV_SCALE_NONE) { - lv_obj_refresh_ext_draw_size(obj); - } - - lv_obj_invalidate(obj); -} - -void lv_image_set_offset_x(lv_obj_t * obj, int32_t x) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - img->offset.x = x; - lv_obj_invalidate(obj); -} - -void lv_image_set_offset_y(lv_obj_t * obj, int32_t y) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - img->offset.y = y; - lv_obj_invalidate(obj); -} - -void lv_image_set_rotation(lv_obj_t * obj, int32_t angle) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - if(img->align > LV_IMAGE_ALIGN_AUTO_TRANSFORM) { - angle = 0; - } - else { - while(angle >= 3600) angle -= 3600; - while(angle < 0) angle += 3600; - } - - if((uint32_t)angle == img->rotation) return; - - lv_obj_update_layout(obj); /*Be sure the object's size is calculated*/ - int32_t w = lv_obj_get_width(obj); - int32_t h = lv_obj_get_height(obj); - lv_area_t a; - lv_point_t pivot_px; - lv_image_get_pivot(obj, &pivot_px); - lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); - a.x1 += obj->coords.x1; - a.y1 += obj->coords.y1; - a.x2 += obj->coords.x1; - a.y2 += obj->coords.y1; - lv_obj_invalidate_area(obj, &a); - - img->rotation = angle; - - /* Disable invalidations because lv_obj_refresh_ext_draw_size would invalidate - * the whole ext draw area */ - lv_display_t * disp = lv_obj_get_display(obj); - lv_display_enable_invalidation(disp, false); - lv_obj_refresh_ext_draw_size(obj); - lv_display_enable_invalidation(disp, true); - - lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); - a.x1 += obj->coords.x1; - a.y1 += obj->coords.y1; - a.x2 += obj->coords.x1; - a.y2 += obj->coords.y1; - lv_obj_invalidate_area(obj, &a); -} - -void lv_image_set_pivot(lv_obj_t * obj, int32_t x, int32_t y) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - if(img->align > LV_IMAGE_ALIGN_AUTO_TRANSFORM) { - x = 0; - y = 0; - } - - if(img->pivot.x == x && img->pivot.y == y) return; - - lv_obj_update_layout(obj); /*Be sure the object's size is calculated*/ - int32_t w = lv_obj_get_width(obj); - int32_t h = lv_obj_get_height(obj); - lv_area_t a; - lv_point_t pivot_px; - lv_image_get_pivot(obj, &pivot_px); - lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); - a.x1 += obj->coords.x1; - a.y1 += obj->coords.y1; - a.x2 += obj->coords.x1; - a.y2 += obj->coords.y1; - lv_obj_invalidate_area(obj, &a); - - lv_point_set(&img->pivot, x, y); - - /* Disable invalidations because lv_obj_refresh_ext_draw_size would invalidate - * the whole ext draw area */ - lv_display_t * disp = lv_obj_get_display(obj); - lv_display_enable_invalidation(disp, false); - lv_obj_refresh_ext_draw_size(obj); - lv_display_enable_invalidation(disp, true); - - lv_image_get_pivot(obj, &pivot_px); - lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); - a.x1 += obj->coords.x1; - a.y1 += obj->coords.y1; - a.x2 += obj->coords.x1; - a.y2 += obj->coords.y1; - lv_obj_invalidate_area(obj, &a); -} - -void lv_image_set_scale(lv_obj_t * obj, uint32_t zoom) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - /*If scale is set internally, do no overwrite it*/ - if(img->align > LV_IMAGE_ALIGN_AUTO_TRANSFORM) return; - - if(zoom == img->scale_x && zoom == img->scale_y) return; - - if(zoom == 0) zoom = 1; - - scale_update(obj, zoom, zoom); -} - -void lv_image_set_scale_x(lv_obj_t * obj, uint32_t zoom) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - /*If scale is set internally, do no overwrite it*/ - if(img->align > LV_IMAGE_ALIGN_AUTO_TRANSFORM) return; - - if(zoom == img->scale_x) return; - - if(zoom == 0) zoom = 1; - - scale_update(obj, zoom, img->scale_y); -} - -void lv_image_set_scale_y(lv_obj_t * obj, uint32_t zoom) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - /*If scale is set internally, do no overwrite it*/ - if(img->align > LV_IMAGE_ALIGN_AUTO_TRANSFORM) return; - - if(zoom == img->scale_y) return; - - if(zoom == 0) zoom = 1; - - scale_update(obj, img->scale_x, zoom); -} - -void lv_image_set_blend_mode(lv_obj_t * obj, lv_blend_mode_t blend_mode) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - /*If scale is set internally, do no overwrite it*/ - if(img->blend_mode == blend_mode) return; - - img->blend_mode = blend_mode; - - lv_obj_invalidate(obj); -} - -void lv_image_set_antialias(lv_obj_t * obj, bool antialias) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - if(antialias == img->antialias) return; - - img->antialias = antialias; - lv_obj_invalidate(obj); -} - -void lv_image_set_inner_align(lv_obj_t * obj, lv_image_align_t align) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - if(align == img->align) return; - - /*If we're removing STRETCH, reset the scale*/ - if(img->align == LV_IMAGE_ALIGN_STRETCH) { - lv_image_set_scale(obj, LV_SCALE_NONE); - } - - img->align = align; - update_align(obj); - - lv_obj_invalidate(obj); -} - -void lv_image_set_bitmap_map_src(lv_obj_t * obj, const lv_image_dsc_t * src) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_image_t * img = (lv_image_t *)obj; - img->bitmap_mask_src = src; - lv_obj_invalidate(obj); -} - -/*===================== - * Getter functions - *====================*/ - -const void * lv_image_get_src(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - return img->src; -} - -int32_t lv_image_get_offset_x(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - return img->offset.x; -} - -int32_t lv_image_get_offset_y(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - return img->offset.y; -} - -int32_t lv_image_get_rotation(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - return img->rotation; -} - -void lv_image_get_pivot(lv_obj_t * obj, lv_point_t * pivot) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - pivot->x = lv_pct_to_px(img->pivot.x, img->w); - pivot->y = lv_pct_to_px(img->pivot.y, img->h); -} - -int32_t lv_image_get_scale(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - return img->scale_x; -} - -int32_t lv_image_get_scale_x(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - return img->scale_x; -} - -int32_t lv_image_get_scale_y(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - return img->scale_y; -} - -lv_blend_mode_t lv_image_get_blend_mode(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - return img->blend_mode; -} - -bool lv_image_get_antialias(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - return img->antialias ? true : false; -} - -lv_image_align_t lv_image_get_inner_align(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - return img->align; -} - -const lv_image_dsc_t * lv_image_get_bitmap_map_src(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_image_t * img = (lv_image_t *)obj; - - return img->bitmap_mask_src; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_image_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_TRACE_OBJ_CREATE("begin"); - - lv_image_t * img = (lv_image_t *)obj; - - img->src = NULL; - img->src_type = LV_IMAGE_SRC_UNKNOWN; - img->cf = LV_COLOR_FORMAT_UNKNOWN; - img->w = lv_obj_get_width(obj); - img->h = lv_obj_get_height(obj); - img->rotation = 0; - img->scale_x = LV_SCALE_NONE; - img->scale_y = LV_SCALE_NONE; - img->antialias = LV_COLOR_DEPTH > 8 ? 1 : 0; - lv_point_set(&img->offset, 0, 0); - lv_point_set(&img->pivot, LV_PCT(50), LV_PCT(50)); /*Default pivot to image center*/ - img->align = LV_IMAGE_ALIGN_CENTER; - - lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); - lv_obj_add_flag(obj, LV_OBJ_FLAG_ADV_HITTEST); - - LV_TRACE_OBJ_CREATE("finished"); -} - -static void lv_image_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - lv_image_t * img = (lv_image_t *)obj; - if(img->src_type == LV_IMAGE_SRC_FILE || img->src_type == LV_IMAGE_SRC_SYMBOL) { - lv_free((void *)img->src); - img->src = NULL; - img->src_type = LV_IMAGE_SRC_UNKNOWN; - } -} - -static void lv_image_event(const lv_obj_class_t * class_p, lv_event_t * e) -{ - LV_UNUSED(class_p); - - lv_event_code_t code = lv_event_get_code(e); - - /*Call the ancestor's event handler*/ - lv_result_t res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; - - lv_obj_t * obj = lv_event_get_current_target(e); - lv_image_t * img = (lv_image_t *)obj; - lv_point_t pivot_px; - lv_image_get_pivot(obj, &pivot_px); - - if(code == LV_EVENT_STYLE_CHANGED) { - /*Refresh the file name to refresh the symbol text size*/ - if(img->src_type == LV_IMAGE_SRC_SYMBOL) { - lv_image_set_src(obj, img->src); - } - else { - /*With transformation it might change*/ - lv_obj_refresh_ext_draw_size(obj); - } - } - else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { - - int32_t * s = lv_event_get_param(e); - - /*If the image has angle provide enough room for the rotated corners*/ - if(img->rotation || img->scale_x != LV_SCALE_NONE || img->scale_y != LV_SCALE_NONE) { - lv_area_t a; - int32_t w = lv_obj_get_width(obj); - int32_t h = lv_obj_get_height(obj); - lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); - *s = LV_MAX(*s, -a.x1); - *s = LV_MAX(*s, -a.y1); - *s = LV_MAX(*s, a.x2 - w); - *s = LV_MAX(*s, a.y2 - h); - } - } - else if(code == LV_EVENT_HIT_TEST) { - lv_hit_test_info_t * info = lv_event_get_param(e); - - /*If the object is exactly image sized (not cropped, not mosaic) and transformed - *perform hit test on its transformed area*/ - if(img->w == lv_obj_get_width(obj) && img->h == lv_obj_get_height(obj) && - (img->scale_x != LV_SCALE_NONE || img->scale_y != LV_SCALE_NONE || - img->rotation != 0 || img->pivot.x != img->w / 2 || img->pivot.y != img->h / 2)) { - - int32_t w = lv_obj_get_width(obj); - int32_t h = lv_obj_get_height(obj); - lv_area_t coords; - lv_image_buf_get_transformed_area(&coords, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); - coords.x1 += obj->coords.x1; - coords.y1 += obj->coords.y1; - coords.x2 += obj->coords.x1; - coords.y2 += obj->coords.y1; - - info->res = lv_area_is_point_on(&coords, info->point, 0); - } - else { - lv_area_t a; - lv_obj_get_click_area(obj, &a); - info->res = lv_area_is_point_on(&a, info->point, 0); - } - } - else if(code == LV_EVENT_GET_SELF_SIZE) { - lv_point_t * p = lv_event_get_param(e); - p->x = img->w; - p->y = img->h; - } - else if(code == LV_EVENT_DRAW_MAIN || code == LV_EVENT_DRAW_POST || code == LV_EVENT_COVER_CHECK) { - draw_image(e); - } -} - -static void draw_image(lv_event_t * e) -{ - lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); - lv_image_t * img = (lv_image_t *)obj; - if(code == LV_EVENT_COVER_CHECK) { - lv_cover_check_info_t * info = lv_event_get_param(e); - if(info->res == LV_COVER_RES_MASKED) return; - if(img->src_type == LV_IMAGE_SRC_UNKNOWN || img->src_type == LV_IMAGE_SRC_SYMBOL) { - info->res = LV_COVER_RES_NOT_COVER; - return; - } - - /*Non true color format might have "holes"*/ - if(lv_color_format_has_alpha(img->cf)) { - info->res = LV_COVER_RES_NOT_COVER; - return; - } - - /*With not LV_OPA_COVER images can't cover an area */ - if(lv_obj_get_style_image_opa(obj, LV_PART_MAIN) != LV_OPA_COVER) { - info->res = LV_COVER_RES_NOT_COVER; - return; - } - - if(img->rotation != 0) { - info->res = LV_COVER_RES_NOT_COVER; - return; - } - - if(img->scale_x == LV_SCALE_NONE && img->scale_y == LV_SCALE_NONE) { - if(lv_area_is_in(info->area, &obj->coords, 0) == false) { - info->res = LV_COVER_RES_NOT_COVER; - return; - } - } - else { - lv_area_t a; - lv_point_t pivot_px; - lv_image_get_pivot(obj, &pivot_px); - lv_image_buf_get_transformed_area(&a, lv_obj_get_width(obj), lv_obj_get_height(obj), 0, img->scale_x, img->scale_y, - &pivot_px); - a.x1 += obj->coords.x1; - a.y1 += obj->coords.y1; - a.x2 += obj->coords.x1; - a.y2 += obj->coords.y1; - - if(lv_area_is_in(info->area, &a, 0) == false) { - info->res = LV_COVER_RES_NOT_COVER; - return; - } - } - if(img->bitmap_mask_src) { - info->res = LV_COVER_RES_NOT_COVER; - return; - } - } - else if(code == LV_EVENT_DRAW_MAIN) { - - if(img->h == 0 || img->w == 0) return; - if(img->scale_x == 0 || img->scale_y == 0) return; - - lv_layer_t * layer = lv_event_get_layer(e); - - if(img->src_type == LV_IMAGE_SRC_FILE || img->src_type == LV_IMAGE_SRC_VARIABLE) { - lv_draw_image_dsc_t draw_dsc; - lv_draw_image_dsc_init(&draw_dsc); - lv_obj_init_draw_image_dsc(obj, LV_PART_MAIN, &draw_dsc); - - lv_area_t clip_area_ori = layer->_clip_area; - - lv_image_get_pivot(obj, &draw_dsc.pivot); - draw_dsc.scale_x = img->scale_x; - draw_dsc.scale_y = img->scale_y; - draw_dsc.rotation = img->rotation; - draw_dsc.antialias = img->antialias; - draw_dsc.blend_mode = img->blend_mode; - draw_dsc.bitmap_mask_src = img->bitmap_mask_src; - draw_dsc.src = img->src; - - lv_area_set(&draw_dsc.image_area, obj->coords.x1, - obj->coords.y1, - obj->coords.x1 + img->w - 1, - obj->coords.y1 + img->h - 1); - - draw_dsc.clip_radius = lv_obj_get_style_radius(obj, LV_PART_MAIN); - - lv_area_t coords; - if(img->align < LV_IMAGE_ALIGN_AUTO_TRANSFORM) { - lv_area_align(&obj->coords, &draw_dsc.image_area, img->align, img->offset.x, img->offset.y); - coords = draw_dsc.image_area; - } - else if(img->align == LV_IMAGE_ALIGN_TILE) { - lv_area_intersect(&layer->_clip_area, &layer->_clip_area, &obj->coords); - lv_area_move(&draw_dsc.image_area, img->offset.x, img->offset.y); - - lv_area_move(&draw_dsc.image_area, - ((layer->_clip_area.x1 - draw_dsc.image_area.x1 - (img->w - 1)) / img->w) * img->w, - ((layer->_clip_area.y1 - draw_dsc.image_area.y1 - (img->h - 1)) / img->h) * img->h); - coords = layer->_clip_area; - draw_dsc.tile = 1; - } - else { - coords = draw_dsc.image_area; - } - - lv_draw_image(layer, &draw_dsc, &coords); - layer->_clip_area = clip_area_ori; - - } - else if(img->src_type == LV_IMAGE_SRC_SYMBOL) { - lv_draw_label_dsc_t label_dsc; - lv_draw_label_dsc_init(&label_dsc); - lv_obj_init_draw_label_dsc(obj, LV_PART_MAIN, &label_dsc); - label_dsc.text = img->src; - lv_draw_label(layer, &label_dsc, &obj->coords); - } - else if(img->src == NULL) { - /*Do not need to draw image when src is NULL*/ - LV_LOG_WARN("image source is NULL"); - } - else { - /*Trigger the error handler of image draw*/ - LV_LOG_WARN("image source type is unknown"); - } - } -} - -static void scale_update(lv_obj_t * obj, int32_t scale_x, int32_t scale_y) -{ - lv_image_t * img = (lv_image_t *)obj; - - lv_obj_update_layout(obj); /*Be sure the object's size is calculated*/ - int32_t w = lv_obj_get_width(obj); - int32_t h = lv_obj_get_height(obj); - lv_area_t a; - lv_point_t pivot_px; - lv_image_get_pivot(obj, &pivot_px); - lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); - a.x1 += obj->coords.x1 - 1; - a.y1 += obj->coords.y1 - 1; - a.x2 += obj->coords.x1 + 1; - a.y2 += obj->coords.y1 + 1; - lv_obj_invalidate_area(obj, &a); - - img->scale_x = scale_x; - img->scale_y = scale_y; - - /* Disable invalidations because lv_obj_refresh_ext_draw_size would invalidate - * the whole ext draw area */ - lv_display_t * disp = lv_obj_get_display(obj); - lv_display_enable_invalidation(disp, false); - lv_obj_refresh_ext_draw_size(obj); - lv_display_enable_invalidation(disp, true); - - lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); - a.x1 += obj->coords.x1 - 1; - a.y1 += obj->coords.y1 - 1; - a.x2 += obj->coords.x1 + 1; - a.y2 += obj->coords.y1 + 1; - lv_obj_invalidate_area(obj, &a); -} - -static void update_align(lv_obj_t * obj) -{ - lv_image_t * img = (lv_image_t *)obj; - if(img->align == LV_IMAGE_ALIGN_STRETCH) { - lv_image_set_rotation(obj, 0); - lv_image_set_pivot(obj, 0, 0); - if(img->w != 0 && img->h != 0) { - int32_t scale_x = lv_obj_get_width(obj) * LV_SCALE_NONE / img->w; - int32_t scale_y = lv_obj_get_height(obj) * LV_SCALE_NONE / img->h; - scale_update(obj, scale_x, scale_y); - } - } - else if(img->align == LV_IMAGE_ALIGN_TILE) { - lv_image_set_rotation(obj, 0); - lv_image_set_pivot(obj, 0, 0); - scale_update(obj, LV_SCALE_NONE, LV_SCALE_NONE); - - } -} - -#if LV_USE_OBJ_PROPERTY -static void lv_image_set_pivot_helper(lv_obj_t * obj, lv_point_t * pivot) -{ - lv_image_set_pivot(obj, pivot->x, pivot->y); -} - -static lv_point_t lv_image_get_pivot_helper(lv_obj_t * obj) -{ - lv_point_t pivot; - lv_image_get_pivot(obj, &pivot); - return pivot; -} -#endif - -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/image/lv_image.h b/L3_Middlewares/LVGL/src/widgets/image/lv_image.h deleted file mode 100644 index abc5217..0000000 --- a/L3_Middlewares/LVGL/src/widgets/image/lv_image.h +++ /dev/null @@ -1,310 +0,0 @@ -/** - * @file lv_image.h - * - */ - -#ifndef LV_IMAGE_H -#define LV_IMAGE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" - -#if LV_USE_IMAGE != 0 - -/*Testing of dependencies*/ -#if LV_USE_LABEL == 0 -#error "lv_img: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" -#endif - -#include "../../core/lv_obj.h" -#include "../../misc/lv_fs.h" -#include "../../draw/lv_draw.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_image_class; - -/** - * Image size mode, when image size and object size is different - */ -typedef enum { - LV_IMAGE_ALIGN_DEFAULT = 0, - LV_IMAGE_ALIGN_TOP_LEFT, - LV_IMAGE_ALIGN_TOP_MID, - LV_IMAGE_ALIGN_TOP_RIGHT, - LV_IMAGE_ALIGN_BOTTOM_LEFT, - LV_IMAGE_ALIGN_BOTTOM_MID, - LV_IMAGE_ALIGN_BOTTOM_RIGHT, - LV_IMAGE_ALIGN_LEFT_MID, - LV_IMAGE_ALIGN_RIGHT_MID, - LV_IMAGE_ALIGN_CENTER, - LV_IMAGE_ALIGN_AUTO_TRANSFORM, - LV_IMAGE_ALIGN_STRETCH, - LV_IMAGE_ALIGN_TILE, -} lv_image_align_t; - -#if LV_USE_OBJ_PROPERTY -enum { - LV_PROPERTY_ID(IMAGE, SRC, LV_PROPERTY_TYPE_IMGSRC, 0), - LV_PROPERTY_ID(IMAGE, OFFSET_X, LV_PROPERTY_TYPE_INT, 1), - LV_PROPERTY_ID(IMAGE, OFFSET_Y, LV_PROPERTY_TYPE_INT, 2), - LV_PROPERTY_ID(IMAGE, ROTATION, LV_PROPERTY_TYPE_INT, 3), - LV_PROPERTY_ID(IMAGE, PIVOT, LV_PROPERTY_TYPE_POINT, 4), - LV_PROPERTY_ID(IMAGE, SCALE, LV_PROPERTY_TYPE_INT, 5), - LV_PROPERTY_ID(IMAGE, SCALE_X, LV_PROPERTY_TYPE_INT, 6), - LV_PROPERTY_ID(IMAGE, SCALE_Y, LV_PROPERTY_TYPE_INT, 7), - LV_PROPERTY_ID(IMAGE, BLEND_MODE, LV_PROPERTY_TYPE_INT, 8), - LV_PROPERTY_ID(IMAGE, ANTIALIAS, LV_PROPERTY_TYPE_INT, 9), - LV_PROPERTY_ID(IMAGE, INNER_ALIGN, LV_PROPERTY_TYPE_INT, 10), - LV_PROPERTY_IMAGE_END, -}; -#endif - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an image object - * @param parent pointer to an object, it will be the parent of the new image - * @return pointer to the created image - */ -lv_obj_t * lv_image_create(lv_obj_t * parent); - -/*===================== - * Setter functions - *====================*/ - -/** - * Set the image data to display on the object - * @param obj pointer to an image object - * @param src 1) pointer to an ::lv_image_dsc_t descriptor (converted by LVGL's image converter) (e.g. &my_img) or - * 2) path to an image file (e.g. "S:/dir/img.bin")or - * 3) a SYMBOL (e.g. LV_SYMBOL_OK) - */ -void lv_image_set_src(lv_obj_t * obj, const void * src); - -/** - * Set an offset for the source of an image so the image will be displayed from the new origin. - * @param obj pointer to an image - * @param x the new offset along x axis. - */ -void lv_image_set_offset_x(lv_obj_t * obj, int32_t x); - -/** - * Set an offset for the source of an image. - * so the image will be displayed from the new origin. - * @param obj pointer to an image - * @param y the new offset along y axis. - */ -void lv_image_set_offset_y(lv_obj_t * obj, int32_t y); - -/** - * Set the rotation angle of the image. - * The image will be rotated around the set pivot set by `lv_image_set_pivot()` - * Note that indexed and alpha only images can't be transformed. - * @param obj pointer to an image object - * @param angle rotation in degree with 0.1 degree resolution (0..3600: clock wise) - * @note if image_align is `LV_IMAGE_ALIGN_STRETCH` or `LV_IMAGE_ALIGN_FIT` - * rotation will be set to 0 automatically. - * - */ -void lv_image_set_rotation(lv_obj_t * obj, int32_t angle); - -/** - * Set the rotation center of the image. - * The image will be rotated around this point. - * x, y can be set with value of LV_PCT, lv_image_get_pivot will return the true pixel coordinate of pivot in this case. - * @param obj pointer to an image object - * @param x rotation center x of the image - * @param y rotation center y of the image - */ -void lv_image_set_pivot(lv_obj_t * obj, int32_t x, int32_t y); - -/** - * Set the zoom factor of the image. - * Note that indexed and alpha only images can't be transformed. - * @param obj pointer to an image object - * @param zoom the zoom factor. Example values: - * - 256 or LV_ZOOM_IMAGE_NONE: no zoom - * - <256: scale down - * - >256: scale up - * - 128: half size - * - 512: double size - */ -void lv_image_set_scale(lv_obj_t * obj, uint32_t zoom); - -/** - * Set the horizontal zoom factor of the image. - * Note that indexed and alpha only images can't be transformed. - * @param obj pointer to an image object - * @param zoom the zoom factor. Example values: - * - 256 or LV_ZOOM_IMAGE_NONE: no zoom - * - <256: scale down - * - >256: scale up - * - 128: half size - * - 512: double size - */ -void lv_image_set_scale_x(lv_obj_t * obj, uint32_t zoom); - -/** - * Set the vertical zoom factor of the image. - * Note that indexed and alpha only images can't be transformed. - * @param obj pointer to an image object - * @param zoom the zoom factor. Example values: - * - 256 or LV_ZOOM_IMAGE_NONE: no zoom - * - <256: scale down - * - >256: scale up - * - 128: half size - * - 512: double size - */ -void lv_image_set_scale_y(lv_obj_t * obj, uint32_t zoom); - -/** - * Set the blend mode of an image. - * @param obj pointer to an image object - * @param blend_mode the new blend mode - */ -void lv_image_set_blend_mode(lv_obj_t * obj, lv_blend_mode_t blend_mode); - -/** - * Enable/disable anti-aliasing for the transformations (rotate, zoom) or not. - * The quality is better with anti-aliasing looks better but slower. - * @param obj pointer to an image object - * @param antialias true: anti-aliased; false: not anti-aliased - */ -void lv_image_set_antialias(lv_obj_t * obj, bool antialias); - -/** - * Set the image object size mode. - * @param obj pointer to an image object - * @param align the new align mode. - * @note if image_align is `LV_IMAGE_ALIGN_STRETCH` or `LV_IMAGE_ALIGN_FIT` - * rotation, scale and pivot will be overwritten and controlled internally. - */ -void lv_image_set_inner_align(lv_obj_t * obj, lv_image_align_t align); - -/** - * Set an A8 bitmap mask for the image. - * @param obj pointer to an image object - * @param src an lv_image_dsc_t bitmap mask source. - */ -void lv_image_set_bitmap_map_src(lv_obj_t * obj, const lv_image_dsc_t * src); - -/*===================== - * Getter functions - *====================*/ - -/** - * Get the source of the image - * @param obj pointer to an image object - * @return the image source (symbol, file name or ::lv-img_dsc_t for C arrays) - */ -const void * lv_image_get_src(lv_obj_t * obj); - -/** - * Get the offset's x attribute of the image object. - * @param obj pointer to an image - * @return offset X value. - */ -int32_t lv_image_get_offset_x(lv_obj_t * obj); - -/** - * Get the offset's y attribute of the image object. - * @param obj pointer to an image - * @return offset Y value. - */ -int32_t lv_image_get_offset_y(lv_obj_t * obj); - -/** - * Get the rotation of the image. - * @param obj pointer to an image object - * @return rotation in 0.1 degrees (0..3600) - * @note if image_align is `LV_IMAGE_ALIGN_STRETCH` or `LV_IMAGE_ALIGN_FIT` - * rotation will be set to 0 automatically. - */ -int32_t lv_image_get_rotation(lv_obj_t * obj); - -/** - * Get the pivot (rotation center) of the image. - * If pivot is set with LV_PCT, convert it to px before return. - * @param obj pointer to an image object - * @param pivot store the rotation center here - */ -void lv_image_get_pivot(lv_obj_t * obj, lv_point_t * pivot); - -/** - * Get the zoom factor of the image. - * @param obj pointer to an image object - * @return zoom factor (256: no zoom) - */ -int32_t lv_image_get_scale(lv_obj_t * obj); - -/** - * Get the horizontal zoom factor of the image. - * @param obj pointer to an image object - * @return zoom factor (256: no zoom) - */ -int32_t lv_image_get_scale_x(lv_obj_t * obj); - -/** - * Get the vertical zoom factor of the image. - * @param obj pointer to an image object - * @return zoom factor (256: no zoom) - */ -int32_t lv_image_get_scale_y(lv_obj_t * obj); - -/** - * Get the current blend mode of the image - * @param obj pointer to an image object - * @return the current blend mode - */ -lv_blend_mode_t lv_image_get_blend_mode(lv_obj_t * obj); - -/** - * Get whether the transformations (rotate, zoom) are anti-aliased or not - * @param obj pointer to an image object - * @return true: anti-aliased; false: not anti-aliased - */ -bool lv_image_get_antialias(lv_obj_t * obj); - -/** - * Get the size mode of the image - * @param obj pointer to an image object - * @return element of `lv_image_align_t` - */ -lv_image_align_t lv_image_get_inner_align(lv_obj_t * obj); - -/** - * Get the bitmap mask source. - * @param obj pointer to an image object - * @return an lv_image_dsc_t bitmap mask source. - */ -const lv_image_dsc_t * lv_image_get_bitmap_map_src(lv_obj_t * obj); - -/********************** - * MACROS - **********************/ - -/** Use this macro to declare an image in a C file*/ -#define LV_IMAGE_DECLARE(var_name) extern const lv_image_dsc_t var_name - -#endif /*LV_USE_IMAGE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_IMAGE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/image/lv_image_private.h b/L3_Middlewares/LVGL/src/widgets/image/lv_image_private.h deleted file mode 100644 index e880f5d..0000000 --- a/L3_Middlewares/LVGL/src/widgets/image/lv_image_private.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file lv_image_private.h - * - */ - -#ifndef LV_IMAGE_PRIVATE_H -#define LV_IMAGE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_image.h" - -#if LV_USE_IMAGE != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** - * Data of image - */ -struct lv_image_t { - lv_obj_t obj; - const void * src; /**< Image source: Pointer to an array or a file or a symbol*/ - const lv_image_dsc_t * bitmap_mask_src; /**< Pointer to an A8 bitmap mask */ - lv_point_t offset; - int32_t w; /**< Width of the image (Handled by the library)*/ - int32_t h; /**< Height of the image (Handled by the library)*/ - uint32_t rotation; /**< Rotation angle of the image*/ - uint32_t scale_x; /**< 256 means no zoom, 512 double size, 128 half size*/ - uint32_t scale_y; /**< 256 means no zoom, 512 double size, 128 half size*/ - lv_point_t pivot; /**< Rotation center of the image*/ - uint32_t src_type : 2; /**< See: lv_image_src_t*/ - uint32_t cf : 5; /**< Color format from `lv_color_format_t`*/ - uint32_t antialias : 1; /**< Apply anti-aliasing in transformations (rotate, zoom)*/ - uint32_t align: 4; /**< Image size mode when image size and object size is different. See lv_image_align_t*/ - uint32_t blend_mode: 4; /**< Element of `lv_blend_mode_t`*/ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_IMAGE != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_IMAGE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton.c b/L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton.c deleted file mode 100644 index 3aef3a4..0000000 --- a/L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton.c +++ /dev/null @@ -1,340 +0,0 @@ -/** - * @file lv_imagebutton.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_imagebutton_private.h" -#include "../../misc/lv_area_private.h" -#include "../../draw/lv_draw_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_event_private.h" -#include "../../core/lv_obj_class_private.h" - - -#if LV_USE_IMAGEBUTTON != 0 - -#include "../../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_imagebutton_class) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_imagebutton_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void draw_main(lv_event_t * e); -static void lv_imagebutton_event(const lv_obj_class_t * class_p, lv_event_t * e); -static void refr_image(lv_obj_t * imagebutton); -static lv_imagebutton_state_t suggest_state(lv_obj_t * imagebutton, lv_imagebutton_state_t state); -static lv_imagebutton_state_t get_state(const lv_obj_t * imagebutton); -static void update_src_info(lv_imagebutton_src_info_t * info, const void * src); - -/********************** - * STATIC VARIABLES - **********************/ - -const lv_obj_class_t lv_imagebutton_class = { - .base_class = &lv_obj_class, - .width_def = LV_SIZE_CONTENT, - .height_def = LV_SIZE_CONTENT, - .instance_size = sizeof(lv_imagebutton_t), - .constructor_cb = lv_imagebutton_constructor, - .event_cb = lv_imagebutton_event, - .name = "imagebutton", -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_imagebutton_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -/*===================== - * Setter functions - *====================*/ - -void lv_imagebutton_set_src(lv_obj_t * obj, lv_imagebutton_state_t state, const void * src_left, const void * src_mid, - const void * src_right) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_imagebutton_t * imagebutton = (lv_imagebutton_t *)obj; - - update_src_info(&imagebutton->src_left[state], src_left); - update_src_info(&imagebutton->src_mid[state], src_mid); - update_src_info(&imagebutton->src_right[state], src_right); - - refr_image(obj); -} - -void lv_imagebutton_set_state(lv_obj_t * obj, lv_imagebutton_state_t state) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_state_t obj_state = LV_STATE_DEFAULT; - if(state == LV_IMAGEBUTTON_STATE_PRESSED || - state == LV_IMAGEBUTTON_STATE_CHECKED_PRESSED) obj_state |= LV_STATE_PRESSED; - if(state == LV_IMAGEBUTTON_STATE_DISABLED || - state == LV_IMAGEBUTTON_STATE_CHECKED_DISABLED) obj_state |= LV_STATE_DISABLED; - if(state == LV_IMAGEBUTTON_STATE_CHECKED_DISABLED || state == LV_IMAGEBUTTON_STATE_CHECKED_PRESSED || - state == LV_IMAGEBUTTON_STATE_CHECKED_RELEASED) { - obj_state |= LV_STATE_CHECKED; - } - - lv_obj_remove_state(obj, LV_STATE_CHECKED | LV_STATE_PRESSED | LV_STATE_DISABLED); - lv_obj_add_state(obj, obj_state); - - refr_image(obj); -} - -/*===================== - * Getter functions - *====================*/ - -const void * lv_imagebutton_get_src_left(lv_obj_t * obj, lv_imagebutton_state_t state) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_imagebutton_t * imagebutton = (lv_imagebutton_t *)obj; - - return imagebutton->src_left[state].img_src; -} - -const void * lv_imagebutton_get_src_middle(lv_obj_t * obj, lv_imagebutton_state_t state) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_imagebutton_t * imagebutton = (lv_imagebutton_t *)obj; - - return imagebutton->src_mid[state].img_src; -} - -const void * lv_imagebutton_get_src_right(lv_obj_t * obj, lv_imagebutton_state_t state) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_imagebutton_t * imagebutton = (lv_imagebutton_t *)obj; - - return imagebutton->src_right[state].img_src; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_imagebutton_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - lv_imagebutton_t * imagebutton = (lv_imagebutton_t *)obj; - /*Initialize the allocated 'ext'*/ - - lv_memzero(&imagebutton->src_mid, sizeof(imagebutton->src_mid)); - lv_memzero(&imagebutton->src_left, sizeof(imagebutton->src_left)); - lv_memzero(&imagebutton->src_right, sizeof(imagebutton->src_right)); -} - -static void lv_imagebutton_event(const lv_obj_class_t * class_p, lv_event_t * e) -{ - LV_UNUSED(class_p); - - lv_result_t res = lv_obj_event_base(&lv_imagebutton_class, e); - if(res != LV_RESULT_OK) return; - - lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); - if(code == LV_EVENT_PRESSED || code == LV_EVENT_RELEASED || code == LV_EVENT_PRESS_LOST) { - refr_image(obj); - } - else if(code == LV_EVENT_DRAW_MAIN) { - draw_main(e); - } - else if(code == LV_EVENT_COVER_CHECK) { - lv_cover_check_info_t * info = lv_event_get_param(e); - if(info->res != LV_COVER_RES_MASKED) info->res = LV_COVER_RES_NOT_COVER; - } - else if(code == LV_EVENT_GET_SELF_SIZE) { - lv_point_t * p = lv_event_get_self_size_info(e); - lv_imagebutton_t * imagebutton = (lv_imagebutton_t *)obj; - lv_imagebutton_state_t state = suggest_state(obj, get_state(obj)); - if(imagebutton->src_left[state].img_src == NULL && - imagebutton->src_mid[state].img_src != NULL && - imagebutton->src_right[state].img_src == NULL) { - p->x = LV_MAX(p->x, imagebutton->src_mid[state].header.w); - } - } -} - -static void draw_main(lv_event_t * e) -{ - lv_obj_t * obj = lv_event_get_current_target(e); - lv_imagebutton_t * imagebutton = (lv_imagebutton_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); - - /*Just draw_main an image*/ - lv_imagebutton_state_t state = suggest_state(obj, get_state(obj)); - - /*Simply draw the middle src if no tiled*/ - lv_imagebutton_src_info_t * src_info = &imagebutton->src_left[state]; - - int32_t tw = lv_obj_get_style_transform_width(obj, LV_PART_MAIN); - int32_t th = lv_obj_get_style_transform_height(obj, LV_PART_MAIN); - lv_area_t coords; - lv_area_copy(&coords, &obj->coords); - lv_area_increase(&coords, tw, th); - - lv_draw_image_dsc_t img_dsc; - lv_draw_image_dsc_init(&img_dsc); - lv_obj_init_draw_image_dsc(obj, LV_PART_MAIN, &img_dsc); - - lv_area_t coords_part; - int32_t left_w = 0; - int32_t right_w = 0; - - if(src_info->img_src) { - left_w = src_info->header.w; - coords_part.x1 = coords.x1; - coords_part.y1 = coords.y1; - coords_part.x2 = coords.x1 + src_info->header.w - 1; - coords_part.y2 = coords.y1 + src_info->header.h - 1; - img_dsc.src = src_info->img_src; - lv_draw_image(layer, &img_dsc, &coords_part); - } - - src_info = &imagebutton->src_right[state]; - if(src_info->img_src) { - right_w = src_info->header.w; - coords_part.x1 = coords.x2 - src_info->header.w + 1; - coords_part.y1 = coords.y1; - coords_part.x2 = coords.x2; - coords_part.y2 = coords.y1 + src_info->header.h - 1; - img_dsc.src = src_info->img_src; - lv_draw_image(layer, &img_dsc, &coords_part); - } - - src_info = &imagebutton->src_mid[state]; - if(src_info->img_src) { - coords_part.x1 = coords.x1 + left_w; - coords_part.x2 = coords.x2 - right_w; - coords_part.y1 = coords.y1; - coords_part.y2 = coords.y2; - - lv_area_t clip_area_center; - if(lv_area_intersect(&clip_area_center, &coords_part, &layer->_clip_area)) { - lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = clip_area_center; - img_dsc.src = src_info->img_src; - img_dsc.tile = 1; - lv_draw_image(layer, &img_dsc, &coords_part); - layer->_clip_area = clip_area_ori; - } - - } -} - -static void refr_image(lv_obj_t * obj) -{ - lv_imagebutton_t * imagebutton = (lv_imagebutton_t *)obj; - lv_imagebutton_state_t state = suggest_state(obj, get_state(obj)); - - const void * src = imagebutton->src_mid[state].img_src; - if(src == NULL) return; - - lv_obj_refresh_self_size(obj); - lv_obj_set_height(obj, imagebutton->src_mid[state].header.h); /*Keep the user defined width*/ - - lv_obj_invalidate(obj); -} - -/** - * If `src` is not defined for the current state try to get a state which is related to the current but has `src`. - * E.g. if the PRESSED src is not set but the RELEASED does, use the RELEASED. - * @param imagebutton pointer to an image button - * @param state the state to convert - * @return the suggested state - */ -static lv_imagebutton_state_t suggest_state(lv_obj_t * obj, lv_imagebutton_state_t state) -{ - lv_imagebutton_t * imagebutton = (lv_imagebutton_t *)obj; - if(imagebutton->src_mid[state].img_src == NULL) { - switch(state) { - case LV_IMAGEBUTTON_STATE_PRESSED: - if(imagebutton->src_mid[LV_IMAGEBUTTON_STATE_RELEASED].img_src) return LV_IMAGEBUTTON_STATE_RELEASED; - break; - case LV_IMAGEBUTTON_STATE_CHECKED_RELEASED: - if(imagebutton->src_mid[LV_IMAGEBUTTON_STATE_RELEASED].img_src) return LV_IMAGEBUTTON_STATE_RELEASED; - break; - case LV_IMAGEBUTTON_STATE_CHECKED_PRESSED: - if(imagebutton->src_mid[LV_IMAGEBUTTON_STATE_CHECKED_RELEASED].img_src) return LV_IMAGEBUTTON_STATE_CHECKED_RELEASED; - if(imagebutton->src_mid[LV_IMAGEBUTTON_STATE_PRESSED].img_src) return LV_IMAGEBUTTON_STATE_PRESSED; - if(imagebutton->src_mid[LV_IMAGEBUTTON_STATE_RELEASED].img_src) return LV_IMAGEBUTTON_STATE_RELEASED; - break; - case LV_IMAGEBUTTON_STATE_DISABLED: - if(imagebutton->src_mid[LV_IMAGEBUTTON_STATE_RELEASED].img_src) return LV_IMAGEBUTTON_STATE_RELEASED; - break; - case LV_IMAGEBUTTON_STATE_CHECKED_DISABLED: - if(imagebutton->src_mid[LV_IMAGEBUTTON_STATE_CHECKED_RELEASED].img_src) return LV_IMAGEBUTTON_STATE_CHECKED_RELEASED; - if(imagebutton->src_mid[LV_IMAGEBUTTON_STATE_RELEASED].img_src) return LV_IMAGEBUTTON_STATE_RELEASED; - break; - default: - break; - } - } - - return state; -} - -static lv_imagebutton_state_t get_state(const lv_obj_t * imagebutton) -{ - LV_ASSERT_OBJ(imagebutton, MY_CLASS); - - lv_state_t obj_state = lv_obj_get_state(imagebutton); - - if(obj_state & LV_STATE_DISABLED) { - if(obj_state & LV_STATE_CHECKED) return LV_IMAGEBUTTON_STATE_CHECKED_DISABLED; - else return LV_IMAGEBUTTON_STATE_DISABLED; - } - - if(obj_state & LV_STATE_CHECKED) { - if(obj_state & LV_STATE_PRESSED) return LV_IMAGEBUTTON_STATE_CHECKED_PRESSED; - else return LV_IMAGEBUTTON_STATE_CHECKED_RELEASED; - } - else { - if(obj_state & LV_STATE_PRESSED) return LV_IMAGEBUTTON_STATE_PRESSED; - else return LV_IMAGEBUTTON_STATE_RELEASED; - } -} - -static void update_src_info(lv_imagebutton_src_info_t * info, const void * src) -{ - if(!src) { - lv_memzero(info, sizeof(lv_imagebutton_src_info_t)); - return; - } - - lv_result_t res = lv_image_decoder_get_info(src, &info->header); - if(res != LV_RESULT_OK) { - LV_LOG_WARN("can't get info"); - return; - } - - info->img_src = src; -} - -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton.h b/L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton.h deleted file mode 100644 index ed6dc3a..0000000 --- a/L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton.h +++ /dev/null @@ -1,121 +0,0 @@ -/** - * @file lv_imagebutton.h - * - */ - -#ifndef LV_IMAGEBUTTON_H -#define LV_IMAGEBUTTON_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../core/lv_obj.h" - -#if LV_USE_IMAGEBUTTON != 0 - -/********************* - * DEFINES - *********************/ -typedef enum { - LV_IMAGEBUTTON_STATE_RELEASED, - LV_IMAGEBUTTON_STATE_PRESSED, - LV_IMAGEBUTTON_STATE_DISABLED, - LV_IMAGEBUTTON_STATE_CHECKED_RELEASED, - LV_IMAGEBUTTON_STATE_CHECKED_PRESSED, - LV_IMAGEBUTTON_STATE_CHECKED_DISABLED, - LV_IMAGEBUTTON_STATE_NUM, -} lv_imagebutton_state_t; - -/********************** - * TYPEDEFS - **********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_imagebutton_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an image button object - * @param parent pointer to an object, it will be the parent of the new image button - * @return pointer to the created image button - */ -lv_obj_t * lv_imagebutton_create(lv_obj_t * parent); - -/*====================== - * Add/remove functions - *=====================*/ - -/*===================== - * Setter functions - *====================*/ - -/** - * Set images for a state of the image button - * @param imagebutton pointer to an image button object - * @param state for which state set the new image - * @param src_left pointer to an image source for the left side of the button (a C array or path to - * a file) - * @param src_mid pointer to an image source for the middle of the button (ideally 1px wide) (a C - * array or path to a file) - * @param src_right pointer to an image source for the right side of the button (a C array or path - * to a file) - */ -void lv_imagebutton_set_src(lv_obj_t * imagebutton, lv_imagebutton_state_t state, const void * src_left, - const void * src_mid, - const void * src_right); - -/** - * Use this function instead of `lv_obj_add/remove_state` to set a state manually - * @param imagebutton pointer to an image button object - * @param state the new state - */ -void lv_imagebutton_set_state(lv_obj_t * imagebutton, lv_imagebutton_state_t state); - -/*===================== - * Getter functions - *====================*/ - -/** - * Get the left image in a given state - * @param imagebutton pointer to an image button object - * @param state the state where to get the image (from `lv_button_state_t`) ` - * @return pointer to the left image source (a C array or path to a file) - */ -const void * lv_imagebutton_get_src_left(lv_obj_t * imagebutton, lv_imagebutton_state_t state); - -/** - * Get the middle image in a given state - * @param imagebutton pointer to an image button object - * @param state the state where to get the image (from `lv_button_state_t`) ` - * @return pointer to the middle image source (a C array or path to a file) - */ -const void * lv_imagebutton_get_src_middle(lv_obj_t * imagebutton, lv_imagebutton_state_t state); - -/** - * Get the right image in a given state - * @param imagebutton pointer to an image button object - * @param state the state where to get the image (from `lv_button_state_t`) ` - * @return pointer to the left image source (a C array or path to a file) - */ -const void * lv_imagebutton_get_src_right(lv_obj_t * imagebutton, lv_imagebutton_state_t state); - -/*===================== - * Other functions - *====================*/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_IMAGEBUTTON*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_IMAGEBUTTON_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton_private.h b/L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton_private.h deleted file mode 100644 index bf9c4ef..0000000 --- a/L3_Middlewares/LVGL/src/widgets/imagebutton/lv_imagebutton_private.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @file lv_imagebutton_private.h - * - */ - -#ifndef LV_IMAGEBUTTON_PRIVATE_H -#define LV_IMAGEBUTTON_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_imagebutton.h" - -#if LV_USE_IMAGEBUTTON != 0 -#include "../../core/lv_obj_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_imagebutton_src_info_t { - const void * img_src; - lv_image_header_t header; -}; - -/** Data of image button */ -struct lv_imagebutton_t { - lv_obj_t obj; - lv_imagebutton_src_info_t src_mid[LV_IMAGEBUTTON_STATE_NUM]; /**< Store center images to each state */ - lv_imagebutton_src_info_t src_left[LV_IMAGEBUTTON_STATE_NUM]; /**< Store left side images to each state */ - lv_imagebutton_src_info_t src_right[LV_IMAGEBUTTON_STATE_NUM]; /**< Store right side images to each state */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_IMAGEBUTTON != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_IMAGEBUTTON_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/keyboard/lv_keyboard.c b/L3_Middlewares/LVGL/src/widgets/keyboard/lv_keyboard.c deleted file mode 100644 index e781eb3..0000000 --- a/L3_Middlewares/LVGL/src/widgets/keyboard/lv_keyboard.c +++ /dev/null @@ -1,490 +0,0 @@ - -/** - * @file lv_keyboard.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_keyboard_private.h" -#include "../../core/lv_obj_class_private.h" -#if LV_USE_KEYBOARD - -#include "../textarea/lv_textarea.h" -#include "../../misc/lv_assert.h" -#include "../../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_keyboard_class) -#define LV_KB_BTN(width) LV_BUTTONMATRIX_CTRL_POPOVER | width - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_keyboard_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); - -static void lv_keyboard_update_map(lv_obj_t * obj); - -static void lv_keyboard_update_ctrl_map(lv_obj_t * obj); - -/********************** - * STATIC VARIABLES - **********************/ -#if LV_USE_OBJ_PROPERTY -static const lv_property_ops_t properties[] = { - { - .id = LV_PROPERTY_KEYBOARD_TEXTAREA, - .setter = lv_keyboard_set_textarea, - .getter = lv_keyboard_get_textarea, - }, - { - .id = LV_PROPERTY_KEYBOARD_MODE, - .setter = lv_keyboard_set_mode, - .getter = lv_keyboard_get_mode, - }, - { - .id = LV_PROPERTY_KEYBOARD_POPOVERS, - .setter = lv_keyboard_set_popovers, - .getter = lv_keyboard_get_popovers, - }, - { - .id = LV_PROPERTY_KEYBOARD_SELECTED_BUTTON, - .setter = lv_buttonmatrix_set_selected_button, - .getter = lv_keyboard_get_selected_button, - }, -}; -#endif - -const lv_obj_class_t lv_keyboard_class = { - .constructor_cb = lv_keyboard_constructor, - .width_def = LV_PCT(100), - .height_def = LV_PCT(50), - .instance_size = sizeof(lv_keyboard_t), - .editable = 1, - .base_class = &lv_buttonmatrix_class, - .name = "keyboard", -#if LV_USE_OBJ_PROPERTY - .prop_index_start = LV_PROPERTY_KEYBOARD_START, - .prop_index_end = LV_PROPERTY_KEYBOARD_END, - .properties = properties, - .properties_count = sizeof(properties) / sizeof(properties[0]), - -#if LV_USE_OBJ_PROPERTY_NAME - .property_names = lv_keyboard_property_names, - .names_count = sizeof(lv_keyboard_property_names) / sizeof(lv_property_name_t), -#endif - -#endif -}; - -static const char * const default_kb_map_lc[] = {"1#", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", LV_SYMBOL_BACKSPACE, "\n", - "ABC", "a", "s", "d", "f", "g", "h", "j", "k", "l", LV_SYMBOL_NEW_LINE, "\n", - "_", "-", "z", "x", "c", "v", "b", "n", "m", ".", ",", ":", "\n", - LV_SYMBOL_KEYBOARD, -#if LV_USE_ARABIC_PERSIAN_CHARS == 1 - "أب", -#endif - LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" - }; - -static const lv_buttonmatrix_ctrl_t default_kb_ctrl_lc_map[] = { - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 5, LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_BUTTONMATRIX_CTRL_CHECKED | 7, - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 6, LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_BUTTONMATRIX_CTRL_CHECKED | 7, - LV_BUTTONMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BUTTONMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_BUTTONMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BUTTONMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BUTTONMATRIX_CTRL_CHECKED | LV_KB_BTN(1), - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2, -#if LV_USE_ARABIC_PERSIAN_CHARS == 1 - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2, -#endif - LV_BUTTONMATRIX_CTRL_CHECKED | 2, 6, LV_BUTTONMATRIX_CTRL_CHECKED | 2, LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2 -}; - -static const char * const default_kb_map_uc[] = {"1#", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", LV_SYMBOL_BACKSPACE, "\n", - "abc", "A", "S", "D", "F", "G", "H", "J", "K", "L", LV_SYMBOL_NEW_LINE, "\n", - "_", "-", "Z", "X", "C", "V", "B", "N", "M", ".", ",", ":", "\n", - LV_SYMBOL_CLOSE, -#if LV_USE_ARABIC_PERSIAN_CHARS == 1 - "أب", -#endif - LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" - }; - -static const lv_buttonmatrix_ctrl_t default_kb_ctrl_uc_map[] = { - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 5, LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_KB_BTN(4), LV_BUTTONMATRIX_CTRL_CHECKED | 7, - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 6, LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_KB_BTN(3), LV_BUTTONMATRIX_CTRL_CHECKED | 7, - LV_BUTTONMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BUTTONMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_BUTTONMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BUTTONMATRIX_CTRL_CHECKED | LV_KB_BTN(1), LV_BUTTONMATRIX_CTRL_CHECKED | LV_KB_BTN(1), - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2, -#if LV_USE_ARABIC_PERSIAN_CHARS == 1 - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2, -#endif - LV_BUTTONMATRIX_CTRL_CHECKED | 2, 6, LV_BUTTONMATRIX_CTRL_CHECKED | 2, LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2 -}; - -#if LV_USE_ARABIC_PERSIAN_CHARS == 1 -static const char * const default_kb_map_ar[] = { - "1#", "ض", "ص", "ث", "ق", "ف", "غ", "ع", "ه", "خ", "ح", "ج", "\n", - "ش", "س", "ي", "ب", "ل", "ا", "ت", "ن", "م", "ك", "ط", LV_SYMBOL_BACKSPACE, "\n", - "ذ", "ء", "ؤ", "ر", "ى", "ة", "و", "ز", "ظ", "د", "ز", "ظ", "د", "\n", - LV_SYMBOL_CLOSE, "abc", LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_NEW_LINE, LV_SYMBOL_OK, "" -}; - -static const lv_buttonmatrix_ctrl_t default_kb_ctrl_ar_map[] = { - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2, LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2, 2, 6, 2, 3, LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2 -}; -#endif - -static const char * const default_kb_map_spec[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", LV_SYMBOL_BACKSPACE, "\n", - "abc", "+", "&", "/", "*", "=", "%", "!", "?", "#", "<", ">", "\n", - "\\", "@", "$", "(", ")", "{", "}", "[", "]", ";", "\"", "'", "\n", - LV_SYMBOL_KEYBOARD, -#if LV_USE_ARABIC_PERSIAN_CHARS == 1 - "أب", -#endif - LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, "" - }; - -static const lv_buttonmatrix_ctrl_t default_kb_ctrl_spec_map[] = { - LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_BUTTONMATRIX_CTRL_CHECKED | 2, - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2, LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), - LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), LV_KB_BTN(1), - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2, -#if LV_USE_ARABIC_PERSIAN_CHARS == 1 - LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2, -#endif - LV_BUTTONMATRIX_CTRL_CHECKED | 2, 6, LV_BUTTONMATRIX_CTRL_CHECKED | 2, LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2 -}; - -static const char * const default_kb_map_num[] = {"1", "2", "3", LV_SYMBOL_KEYBOARD, "\n", - "4", "5", "6", LV_SYMBOL_OK, "\n", - "7", "8", "9", LV_SYMBOL_BACKSPACE, "\n", - "+/-", "0", ".", LV_SYMBOL_LEFT, LV_SYMBOL_RIGHT, "" - }; - -static const lv_buttonmatrix_ctrl_t default_kb_ctrl_num_map[] = { - 1, 1, 1, LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2, - 1, 1, 1, LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2, - 1, 1, 1, 2, - 1, 1, 1, 1, 1 -}; - -static const char * const * kb_map[10] = { - default_kb_map_lc, - default_kb_map_uc, - default_kb_map_spec, - default_kb_map_num, - default_kb_map_lc, - default_kb_map_lc, - default_kb_map_lc, - default_kb_map_lc, -#if LV_USE_ARABIC_PERSIAN_CHARS == 1 - default_kb_map_ar, -#endif - NULL -}; -static const lv_buttonmatrix_ctrl_t * kb_ctrl[10] = { - default_kb_ctrl_lc_map, - default_kb_ctrl_uc_map, - default_kb_ctrl_spec_map, - default_kb_ctrl_num_map, - default_kb_ctrl_lc_map, - default_kb_ctrl_lc_map, - default_kb_ctrl_lc_map, - default_kb_ctrl_lc_map, -#if LV_USE_ARABIC_PERSIAN_CHARS == 1 - default_kb_ctrl_ar_map, -#endif - NULL -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_keyboard_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(&lv_keyboard_class, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -/*===================== - * Setter functions - *====================*/ - -void lv_keyboard_set_textarea(lv_obj_t * obj, lv_obj_t * ta) -{ - if(ta) { - LV_ASSERT_OBJ(ta, &lv_textarea_class); - } - - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; - - /*Hide the cursor of the old Text area if cursor management is enabled*/ - if(keyboard->ta) { - lv_obj_remove_state(obj, LV_STATE_FOCUSED); - } - - keyboard->ta = ta; - - /*Show the cursor of the new Text area if cursor management is enabled*/ - if(keyboard->ta) { - lv_obj_add_state(obj, LV_STATE_FOCUSED); - } -} - -void lv_keyboard_set_mode(lv_obj_t * obj, lv_keyboard_mode_t mode) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; - if(keyboard->mode == mode) return; - - keyboard->mode = mode; - lv_keyboard_update_map(obj); -} - -void lv_keyboard_set_popovers(lv_obj_t * obj, bool en) -{ - lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; - - if(keyboard->popovers == en) { - return; - } - - keyboard->popovers = en; - lv_keyboard_update_ctrl_map(obj); -} - -void lv_keyboard_set_map(lv_obj_t * obj, lv_keyboard_mode_t mode, const char * const map[], - const lv_buttonmatrix_ctrl_t ctrl_map[]) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - kb_map[mode] = map; - kb_ctrl[mode] = ctrl_map; - lv_keyboard_update_map(obj); -} - -/*===================== - * Getter functions - *====================*/ - -lv_obj_t * lv_keyboard_get_textarea(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; - return keyboard->ta; -} - -lv_keyboard_mode_t lv_keyboard_get_mode(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; - return keyboard->mode; -} - -bool lv_keyboard_get_popovers(const lv_obj_t * obj) -{ - lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; - return keyboard->popovers; -} - -/*===================== - * Other functions - *====================*/ - -void lv_keyboard_def_event_cb(lv_event_t * e) -{ - lv_obj_t * obj = lv_event_get_current_target(e); - - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; - uint32_t btn_id = lv_buttonmatrix_get_selected_button(obj); - if(btn_id == LV_BUTTONMATRIX_BUTTON_NONE) return; - - const char * txt = lv_buttonmatrix_get_button_text(obj, btn_id); - if(txt == NULL) return; - - if(lv_strcmp(txt, "abc") == 0) { - keyboard->mode = LV_KEYBOARD_MODE_TEXT_LOWER; - lv_buttonmatrix_set_map(obj, kb_map[LV_KEYBOARD_MODE_TEXT_LOWER]); - lv_keyboard_update_ctrl_map(obj); - return; - } -#if LV_USE_ARABIC_PERSIAN_CHARS == 1 - else if(lv_strcmp(txt, "أب") == 0) { - keyboard->mode = LV_KEYBOARD_MODE_TEXT_ARABIC; - lv_buttonmatrix_set_map(obj, kb_map[LV_KEYBOARD_MODE_TEXT_ARABIC]); - lv_keyboard_update_ctrl_map(obj); - return; - } -#endif - else if(lv_strcmp(txt, "ABC") == 0) { - keyboard->mode = LV_KEYBOARD_MODE_TEXT_UPPER; - lv_buttonmatrix_set_map(obj, kb_map[LV_KEYBOARD_MODE_TEXT_UPPER]); - lv_keyboard_update_ctrl_map(obj); - return; - } - else if(lv_strcmp(txt, "1#") == 0) { - keyboard->mode = LV_KEYBOARD_MODE_SPECIAL; - lv_buttonmatrix_set_map(obj, kb_map[LV_KEYBOARD_MODE_SPECIAL]); - lv_keyboard_update_ctrl_map(obj); - return; - } - else if(lv_strcmp(txt, LV_SYMBOL_CLOSE) == 0 || lv_strcmp(txt, LV_SYMBOL_KEYBOARD) == 0) { - lv_result_t res = lv_obj_send_event(obj, LV_EVENT_CANCEL, NULL); - if(res != LV_RESULT_OK) return; - - if(keyboard->ta) { - res = lv_obj_send_event(keyboard->ta, LV_EVENT_CANCEL, NULL); - if(res != LV_RESULT_OK) return; - } - return; - } - else if(lv_strcmp(txt, LV_SYMBOL_OK) == 0) { - lv_result_t res = lv_obj_send_event(obj, LV_EVENT_READY, NULL); - if(res != LV_RESULT_OK) return; - - if(keyboard->ta) { - res = lv_obj_send_event(keyboard->ta, LV_EVENT_READY, NULL); - if(res != LV_RESULT_OK) return; - } - return; - } - - /*Add the characters to the text area if set*/ - if(keyboard->ta == NULL) return; - - if(lv_strcmp(txt, "Enter") == 0 || lv_strcmp(txt, LV_SYMBOL_NEW_LINE) == 0) { - lv_textarea_add_char(keyboard->ta, '\n'); - if(lv_textarea_get_one_line(keyboard->ta)) { - lv_result_t res = lv_obj_send_event(keyboard->ta, LV_EVENT_READY, NULL); - if(res != LV_RESULT_OK) return; - } - } - else if(lv_strcmp(txt, LV_SYMBOL_LEFT) == 0) { - lv_textarea_cursor_left(keyboard->ta); - } - else if(lv_strcmp(txt, LV_SYMBOL_RIGHT) == 0) { - lv_textarea_cursor_right(keyboard->ta); - } - else if(lv_strcmp(txt, LV_SYMBOL_BACKSPACE) == 0) { - lv_textarea_delete_char(keyboard->ta); - } - else if(lv_strcmp(txt, "+/-") == 0) { - uint32_t cur = lv_textarea_get_cursor_pos(keyboard->ta); - const char * ta_txt = lv_textarea_get_text(keyboard->ta); - if(ta_txt[0] == '-') { - lv_textarea_set_cursor_pos(keyboard->ta, 1); - lv_textarea_delete_char(keyboard->ta); - lv_textarea_add_char(keyboard->ta, '+'); - lv_textarea_set_cursor_pos(keyboard->ta, cur); - } - else if(ta_txt[0] == '+') { - lv_textarea_set_cursor_pos(keyboard->ta, 1); - lv_textarea_delete_char(keyboard->ta); - lv_textarea_add_char(keyboard->ta, '-'); - lv_textarea_set_cursor_pos(keyboard->ta, cur); - } - else { - lv_textarea_set_cursor_pos(keyboard->ta, 0); - lv_textarea_add_char(keyboard->ta, '-'); - lv_textarea_set_cursor_pos(keyboard->ta, cur + 1); - } - } - else { - lv_textarea_add_text(keyboard->ta, txt); - } -} - -const char * const * lv_keyboard_get_map_array(const lv_obj_t * kb) -{ - return lv_buttonmatrix_get_map(kb); -} - -uint32_t lv_keyboard_get_selected_button(const lv_obj_t * obj) -{ - return lv_buttonmatrix_get_selected_button(obj); -} - -const char * lv_keyboard_get_button_text(const lv_obj_t * obj, uint32_t btn_id) -{ - return lv_buttonmatrix_get_button_text(obj, btn_id); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_keyboard_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICK_FOCUSABLE); - - lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; - keyboard->ta = NULL; - keyboard->mode = LV_KEYBOARD_MODE_TEXT_LOWER; - keyboard->popovers = 0; - - lv_obj_align(obj, LV_ALIGN_BOTTOM_MID, 0, 0); - lv_obj_add_event_cb(obj, lv_keyboard_def_event_cb, LV_EVENT_VALUE_CHANGED, NULL); - lv_obj_set_style_base_dir(obj, LV_BASE_DIR_LTR, 0); - - lv_keyboard_update_map(obj); -} - -/** - * Update the key and control map for the current mode - * @param obj pointer to a keyboard object - */ -static void lv_keyboard_update_map(lv_obj_t * obj) -{ - lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; - lv_buttonmatrix_set_map(obj, kb_map[keyboard->mode]); - lv_keyboard_update_ctrl_map(obj); -} - -/** - * Update the control map for the current mode - * @param obj pointer to a keyboard object - */ -static void lv_keyboard_update_ctrl_map(lv_obj_t * obj) -{ - lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; - - if(keyboard->popovers) { - /*Apply the current control map (already includes LV_BUTTONMATRIX_CTRL_POPOVER flags)*/ - lv_buttonmatrix_set_ctrl_map(obj, kb_ctrl[keyboard->mode]); - } - else { - /*Make a copy of the current control map*/ - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; - lv_buttonmatrix_ctrl_t * ctrl_map = lv_malloc(btnm->btn_cnt * sizeof(lv_buttonmatrix_ctrl_t)); - lv_memcpy(ctrl_map, kb_ctrl[keyboard->mode], sizeof(lv_buttonmatrix_ctrl_t) * btnm->btn_cnt); - - /*Remove all LV_BUTTONMATRIX_CTRL_POPOVER flags*/ - uint32_t i; - for(i = 0; i < btnm->btn_cnt; i++) { - ctrl_map[i] &= (~LV_BUTTONMATRIX_CTRL_POPOVER); - } - - /*Apply new control map and clean up*/ - lv_buttonmatrix_set_ctrl_map(obj, ctrl_map); - lv_free(ctrl_map); - } -} - -#endif /*LV_USE_KEYBOARD*/ diff --git a/L3_Middlewares/LVGL/src/widgets/keyboard/lv_keyboard_private.h b/L3_Middlewares/LVGL/src/widgets/keyboard/lv_keyboard_private.h deleted file mode 100644 index 757b23e..0000000 --- a/L3_Middlewares/LVGL/src/widgets/keyboard/lv_keyboard_private.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file lv_keyboard_private.h - * - */ - -#ifndef LV_KEYBOARD_PRIVATE_H -#define LV_KEYBOARD_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../buttonmatrix/lv_buttonmatrix_private.h" -#include "lv_keyboard.h" - -#if LV_USE_KEYBOARD - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Data of keyboard */ -struct lv_keyboard_t { - lv_buttonmatrix_t btnm; - lv_obj_t * ta; /**< Pointer to the assigned text area */ - lv_keyboard_mode_t mode; /**< Key map type */ - uint8_t popovers : 1; /**< Show button titles in popovers on press */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_KEYBOARD */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_KEYBOARD_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/label/lv_label_private.h b/L3_Middlewares/LVGL/src/widgets/label/lv_label_private.h deleted file mode 100644 index 81a2e68..0000000 --- a/L3_Middlewares/LVGL/src/widgets/label/lv_label_private.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @file lv_label_private.h - * - */ - -#ifndef LV_LABEL_PRIVATE_H -#define LV_LABEL_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../draw/lv_draw_label_private.h" -#include "../../core/lv_obj_private.h" -#include "lv_label.h" - -#if LV_USE_LABEL != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_label_t { - lv_obj_t obj; - char * text; - union { - char * tmp_ptr; /**< Pointer to the allocated memory containing the character replaced by dots */ - char tmp[LV_LABEL_DOT_NUM + 1]; /**< Directly store the characters if <=4 characters */ - } dot; - uint32_t dot_end; /**< The real text length, used in dot mode */ - -#if LV_LABEL_LONG_TXT_HINT - lv_draw_label_hint_t hint; -#endif - -#if LV_LABEL_TEXT_SELECTION - uint32_t sel_start; - uint32_t sel_end; -#endif - - lv_point_t size_cache; /**< Text size cache */ - lv_point_t offset; /**< Text draw position offset */ - lv_label_long_mode_t long_mode : 3; /**< Determine what to do with the long texts */ - uint8_t static_txt : 1; /**< Flag to indicate the text is static */ - uint8_t expand : 1; /**< Ignore real width (used by the library with LV_LABEL_LONG_SCROLL) */ - uint8_t dot_tmp_alloc : 1; /**< 1: dot is allocated, 0: dot directly holds up to 4 chars */ - uint8_t invalid_size_cache : 1; /**< 1: Recalculate size and update cache */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_LABEL != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_LABEL_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/led/lv_led_private.h b/L3_Middlewares/LVGL/src/widgets/led/lv_led_private.h deleted file mode 100644 index af76b4f..0000000 --- a/L3_Middlewares/LVGL/src/widgets/led/lv_led_private.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file lv_led_private.h - * - */ - -#ifndef LV_LED_PRIVATE_H -#define LV_LED_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_led.h" - -#if LV_USE_LED -#include "../../core/lv_obj_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Data of led */ -struct lv_led_t { - lv_obj_t obj; - lv_color_t color; - uint8_t bright; /**< Current brightness of the LED (0..255)*/ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_LED */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_LED_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/line/lv_line.c b/L3_Middlewares/LVGL/src/widgets/line/lv_line.c deleted file mode 100644 index a251aae..0000000 --- a/L3_Middlewares/LVGL/src/widgets/line/lv_line.c +++ /dev/null @@ -1,267 +0,0 @@ -/** - * @file lv_line.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_line_private.h" -#include "../../core/lv_obj_class_private.h" - - -#if LV_USE_LINE != 0 -#include "../../misc/lv_assert.h" -#include "../../misc/lv_math.h" -#include "../../misc/lv_types.h" -#include "../../draw/lv_draw.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_line_class) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_line_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void line_set_points(lv_obj_t * obj, const lv_point_precise_t points[], uint32_t point_num, bool mut); -static void lv_line_event(const lv_obj_class_t * class_p, lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ -const lv_obj_class_t lv_line_class = { - .constructor_cb = lv_line_constructor, - .event_cb = lv_line_event, - .width_def = LV_SIZE_CONTENT, - .height_def = LV_SIZE_CONTENT, - .instance_size = sizeof(lv_line_t), - .base_class = &lv_obj_class, - .name = "line", -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_line_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -/*===================== - * Setter functions - *====================*/ - -void lv_line_set_points(lv_obj_t * obj, const lv_point_precise_t points[], uint32_t point_num) -{ - line_set_points(obj, points, point_num, false); -} - -void lv_line_set_points_mutable(lv_obj_t * obj, lv_point_precise_t points[], uint32_t point_num) -{ - line_set_points(obj, points, point_num, true); -} - -void lv_line_set_y_invert(lv_obj_t * obj, bool en) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_line_t * line = (lv_line_t *)obj; - if(line->y_inv == en) return; - - line->y_inv = en ? 1U : 0U; - - lv_obj_invalidate(obj); -} - -/*===================== - * Getter functions - *====================*/ - -const lv_point_precise_t * lv_line_get_points(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_line_t * line = (lv_line_t *)obj; - return line->point_array.constant; -} - -uint32_t lv_line_get_point_count(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_line_t * line = (lv_line_t *)obj; - return line->point_num; -} - -bool lv_line_is_point_array_mutable(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_line_t * line = (lv_line_t *)obj; - return line->point_array_is_mutable; -} - -lv_point_precise_t * lv_line_get_points_mutable(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_line_t * line = (lv_line_t *)obj; - if(!line->point_array_is_mutable) { - LV_LOG_WARN("the line point array is not mutable"); - return NULL; - } - return line->point_array.mut; -} - -bool lv_line_get_y_invert(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_line_t * line = (lv_line_t *)obj; - - return line->y_inv == 1U; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_line_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_TRACE_OBJ_CREATE("begin"); - - lv_line_t * line = (lv_line_t *)obj; - - line->point_num = 0; - line->point_array.constant = NULL; - line->y_inv = 0; - line->point_array_is_mutable = 0; - - lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); - - LV_TRACE_OBJ_CREATE("finished"); -} - -static void line_set_points(lv_obj_t * obj, const lv_point_precise_t points[], uint32_t point_num, bool mut) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_line_t * line = (lv_line_t *)obj; - line->point_array.constant = points; - line->point_num = point_num; - line->point_array_is_mutable = mut; - - lv_obj_refresh_self_size(obj); - - lv_obj_invalidate(obj); -} - -static inline lv_value_precise_t resolve_point_coord(lv_value_precise_t coord, int32_t max) -{ - if(LV_COORD_IS_PCT((int32_t)coord)) { - return LV_CLAMP(0, max * LV_COORD_GET_PCT((int32_t)coord) / 100, max); - } - else { - return coord; - } -} - -static void lv_line_event(const lv_obj_class_t * class_p, lv_event_t * e) -{ - LV_UNUSED(class_p); - - lv_result_t res; - - /*Call the ancestor's event handler*/ - res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; - - lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); - - if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { - /*The corner of the skew lines is out of the intended area*/ - int32_t line_width = lv_obj_get_style_line_width(obj, LV_PART_MAIN); - int32_t * s = lv_event_get_param(e); - if(*s < line_width) *s = line_width; - } - else if(code == LV_EVENT_GET_SELF_SIZE) { - lv_line_t * line = (lv_line_t *)obj; - - if(line->point_num == 0 || line->point_array.constant == NULL) return; - - lv_point_t * p = lv_event_get_param(e); - int32_t w = 0; - int32_t h = 0; - - uint32_t i; - for(i = 0; i < line->point_num; i++) { - if(!LV_COORD_IS_PCT((int32_t)line->point_array.constant[i].x)) { - w = (int32_t)LV_MAX(line->point_array.constant[i].x, w); - } - - if(!LV_COORD_IS_PCT((int32_t)line->point_array.constant[i].y)) { - h = (int32_t)LV_MAX(line->point_array.constant[i].y, h); - } - } - - p->x = w; - p->y = h; - } - else if(code == LV_EVENT_DRAW_MAIN) { - lv_line_t * line = (lv_line_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); - - if(line->point_num == 0 || line->point_array.constant == NULL) return; - - lv_area_t area; - lv_obj_get_coords(obj, &area); - int32_t x_ofs = area.x1 - lv_obj_get_scroll_x(obj); - int32_t y_ofs = area.y1 - lv_obj_get_scroll_y(obj); - - lv_draw_line_dsc_t line_dsc; - lv_draw_line_dsc_init(&line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_MAIN, &line_dsc); - - /*Read all points and draw the lines*/ - uint32_t i; - for(i = 0; i < line->point_num - 1; i++) { - int32_t w = lv_obj_get_width(obj); - int32_t h = lv_obj_get_height(obj); - - line_dsc.p1.x = resolve_point_coord(line->point_array.constant[i].x, w) + x_ofs; - line_dsc.p1.y = resolve_point_coord(line->point_array.constant[i].y, h); - - line_dsc.p2.x = resolve_point_coord(line->point_array.constant[i + 1].x, w) + x_ofs; - line_dsc.p2.y = resolve_point_coord(line->point_array.constant[i + 1].y, h); - - if(line->y_inv == 0) { - line_dsc.p1.y = line_dsc.p1.y + y_ofs; - line_dsc.p2.y = line_dsc.p2.y + y_ofs; - } - else { - line_dsc.p1.y = h - line_dsc.p1.y + y_ofs; - line_dsc.p2.y = h - line_dsc.p2.y + y_ofs; - } - - lv_draw_line(layer, &line_dsc); - line_dsc.round_start = 0; /*Draw the rounding only on the end points after the first line*/ - } - } -} -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/line/lv_line_private.h b/L3_Middlewares/LVGL/src/widgets/line/lv_line_private.h deleted file mode 100644 index 4cbce9c..0000000 --- a/L3_Middlewares/LVGL/src/widgets/line/lv_line_private.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file lv_line_private.h - * - */ - -#ifndef LV_LINE_PRIVATE_H -#define LV_LINE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_line.h" - -#if LV_USE_LINE != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Data of line */ -struct lv_line_t { - lv_obj_t obj; - union { - const lv_point_precise_t * constant; - lv_point_precise_t * mut; - } point_array; /**< Pointer to an array with the points of the line*/ - uint32_t point_num; /**< Number of points in 'point_array'*/ - uint32_t y_inv : 1; /**< 1: y == 0 will be on the bottom*/ - uint32_t point_array_is_mutable : 1; /**< whether the point array is const or mutable*/ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_LINE != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_LINE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/list/lv_list.h b/L3_Middlewares/LVGL/src/widgets/list/lv_list.h deleted file mode 100644 index 0c3894d..0000000 --- a/L3_Middlewares/LVGL/src/widgets/list/lv_list.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @file lv_list.h - * - */ - -#ifndef LV_LIST_H -#define LV_LIST_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../core/lv_obj.h" - -#if LV_USE_LIST - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_list_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_list_text_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_list_button_class; -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a list object - * @param parent pointer to an object, it will be the parent of the new list - * @return pointer to the created list - */ -lv_obj_t * lv_list_create(lv_obj_t * parent); - -/** - * Add text to a list - * @param list pointer to a list, it will be the parent of the new label - * @param txt text of the new label - * @return pointer to the created label - */ -lv_obj_t * lv_list_add_text(lv_obj_t * list, const char * txt); - -/** - * Add button to a list - * @param list pointer to a list, it will be the parent of the new button - * @param icon icon for the button, when NULL it will have no icon - * @param txt text of the new button, when NULL no text will be added - * @return pointer to the created button - */ -lv_obj_t * lv_list_add_button(lv_obj_t * list, const void * icon, const char * txt); - -/** - * Get text of a given list button - * @param list pointer to a list - * @param btn pointer to the button - * @return text of btn, if btn doesn't have text "" will be returned - */ -const char * lv_list_get_button_text(lv_obj_t * list, lv_obj_t * btn); - -/** - * Set text of a given list button - * @param list pointer to a list - * @param btn pointer to the button - * @param txt pointer to the text - */ -void lv_list_set_button_text(lv_obj_t * list, lv_obj_t * btn, const char * txt); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_LIST*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_LIST_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie.c b/L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie.c deleted file mode 100644 index 48ae258..0000000 --- a/L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie.c +++ /dev/null @@ -1,237 +0,0 @@ -/** - * @file lv_lottie.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_lottie_private.h" -#include "../../lv_conf_internal.h" -#if LV_USE_LOTTIE - -#if LV_USE_THORVG_EXTERNAL - #include -#else - #include "../../libs/thorvg/thorvg_capi.h" -#endif - -#include "../../misc/lv_timer.h" -#include "../../core/lv_obj_class_private.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_lottie_class) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_lottie_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_lottie_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void anim_exec_cb(void * var, int32_t v); -static void lottie_update(lv_lottie_t * lottie, int32_t v); - -/********************** - * STATIC VARIABLES - **********************/ -const lv_obj_class_t lv_lottie_class = { - .constructor_cb = lv_lottie_constructor, - .destructor_cb = lv_lottie_destructor, - .width_def = LV_DPI_DEF, - .height_def = LV_DPI_DEF, - .instance_size = sizeof(lv_lottie_t), - .base_class = &lv_canvas_class, - .name = "lottie", -}; - -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_lottie_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -void lv_lottie_set_buffer(lv_obj_t * obj, int32_t w, int32_t h, void * buf) -{ - lv_lottie_t * lottie = (lv_lottie_t *)obj; - int32_t stride = lv_draw_buf_width_to_stride(w, LV_COLOR_FORMAT_ARGB8888); - buf = lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888); - - tvg_swcanvas_set_target(lottie->tvg_canvas, buf, stride / 4, w, h, TVG_COLORSPACE_ARGB8888); - tvg_canvas_push(lottie->tvg_canvas, lottie->tvg_paint); - lv_canvas_set_buffer(obj, buf, w, h, LV_COLOR_FORMAT_ARGB8888); - tvg_picture_set_size(lottie->tvg_paint, w, h); - - /* Rendered output images are premultiplied */ - lv_draw_buf_t * draw_buf = lv_canvas_get_draw_buf(obj); - lv_draw_buf_set_flag(draw_buf, LV_IMAGE_FLAGS_PREMULTIPLIED); - - /*Force updating when the buffer changes*/ - float f_current; - tvg_animation_get_frame(lottie->tvg_anim, &f_current); - anim_exec_cb(obj, (int32_t) f_current); -} - -void lv_lottie_set_draw_buf(lv_obj_t * obj, lv_draw_buf_t * draw_buf) -{ - if(draw_buf->header.cf != LV_COLOR_FORMAT_ARGB8888) { - LV_LOG_WARN("The draw buf needs to have ARGB8888 color format"); - return; - } - - lv_lottie_t * lottie = (lv_lottie_t *)obj; - tvg_swcanvas_set_target(lottie->tvg_canvas, (void *)draw_buf->data, draw_buf->header.stride / 4, - draw_buf->header.w, draw_buf->header.h, TVG_COLORSPACE_ARGB8888); - tvg_canvas_push(lottie->tvg_canvas, lottie->tvg_paint); - lv_canvas_set_draw_buf(obj, draw_buf); - tvg_picture_set_size(lottie->tvg_paint, draw_buf->header.w, draw_buf->header.h); - - /* Rendered output images are premultiplied */ - lv_draw_buf_set_flag(draw_buf, LV_IMAGE_FLAGS_PREMULTIPLIED); - - /*Force updating when the buffer changes*/ - float f_current; - tvg_animation_get_frame(lottie->tvg_anim, &f_current); - anim_exec_cb(obj, (int32_t) f_current); -} - -void lv_lottie_set_src_data(lv_obj_t * obj, const void * src, size_t src_size) -{ - lv_lottie_t * lottie = (lv_lottie_t *)obj; - tvg_picture_load_data(lottie->tvg_paint, src, src_size, "lottie", true); - lv_draw_buf_t * canvas_draw_buf = lv_canvas_get_draw_buf(obj); - if(canvas_draw_buf) { - tvg_picture_set_size(lottie->tvg_paint, canvas_draw_buf->header.w, canvas_draw_buf->header.h); - } - - float f_total; - tvg_animation_get_total_frame(lottie->tvg_anim, &f_total); - lv_anim_set_time(lottie->anim, (int32_t)f_total * 1000 / 60); /*60 FPS*/ - lottie->anim->act_time = 0; - lottie->anim->end_value = (int32_t)f_total; - lottie->anim->playback_now = false; - lottie_update(lottie, 0); /*Render immediately*/ -} - -void lv_lottie_set_src_file(lv_obj_t * obj, const char * src) -{ - lv_lottie_t * lottie = (lv_lottie_t *)obj; - tvg_picture_load(lottie->tvg_paint, src); - lv_draw_buf_t * canvas_draw_buf = lv_canvas_get_draw_buf(obj); - if(canvas_draw_buf) { - tvg_picture_set_size(lottie->tvg_paint, canvas_draw_buf->header.w, canvas_draw_buf->header.h); - } - - float f_total; - tvg_animation_get_total_frame(lottie->tvg_anim, &f_total); - lv_anim_set_time(lottie->anim, (int32_t)f_total * 1000 / 60); /*60 FPS*/ - lottie->anim->act_time = 0; - lottie->anim->end_value = (int32_t)f_total; - lottie->anim->playback_now = false; - lottie_update(lottie, 0); /*Render immediately*/ -} - - -lv_anim_t * lv_lottie_get_anim(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_lottie_t * lottie = (lv_lottie_t *)obj; - return lottie->anim; -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_lottie_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_TRACE_OBJ_CREATE("begin"); - - lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); - - lv_lottie_t * lottie = (lv_lottie_t *)obj; - lottie->tvg_anim = tvg_animation_new(); - - lottie->tvg_paint = tvg_animation_get_picture(lottie->tvg_anim); - - lottie->tvg_canvas = tvg_swcanvas_create(); - - lv_anim_t a; - lv_anim_init(&a); - lv_anim_set_exec_cb(&a, anim_exec_cb); - lv_anim_set_var(&a, obj); - lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); - lottie->anim = lv_anim_start(&a); - - LV_TRACE_OBJ_CREATE("finished"); -} - -static void lv_lottie_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - lv_lottie_t * lottie = (lv_lottie_t *)obj; - - tvg_animation_del(lottie->tvg_anim); - tvg_canvas_destroy(lottie->tvg_canvas); -} - -static void anim_exec_cb(void * var, int32_t v) -{ - lv_lottie_t * lottie = var; - - /*Do not render not visible animations.*/ - if(lv_obj_is_visible(var)) { - lottie_update(lottie, v); - if(lottie->anim) { - lottie->last_rendered_time = lottie->anim->act_time; - } - } - else { - /*Artificially keep the animation on the last rendered frame's time - *To avoid a jump when the widget becomes visible*/ - if(lottie->anim) { - lottie->anim->act_time = lottie->last_rendered_time; - } - } -} - -static void lottie_update(lv_lottie_t * lottie, int32_t v) -{ - lv_obj_t * obj = (lv_obj_t *) lottie; - - lv_draw_buf_t * draw_buf = lv_canvas_get_draw_buf(obj); - if(draw_buf) { - lv_draw_buf_clear(draw_buf, NULL); - - /*Drop old cached image*/ - lv_image_cache_drop(lv_image_get_src(obj)); - } - - tvg_animation_set_frame(lottie->tvg_anim, v); - tvg_canvas_update(lottie->tvg_canvas); - tvg_canvas_draw(lottie->tvg_canvas); - tvg_canvas_sync(lottie->tvg_canvas); - - lv_obj_invalidate(obj); -} - -#endif /*LV_USE_LOTTIE*/ diff --git a/L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie.h b/L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie.h deleted file mode 100644 index 1ccfe16..0000000 --- a/L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file lv_lottie.h - * - */ - -#ifndef LV_LOTTIE_H -#define LV_LOTTIE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../misc/lv_types.h" -#if LV_USE_LOTTIE - -/*Testing of dependencies*/ -#if LV_USE_CANVAS == 0 -#error "lv_lottie: lv_canvas is required. Enable it in lv_conf.h (LV_USE_CANVAS 1)" -#endif - -#if LV_USE_THORVG == 0 -#error "lv_lottie: ThorVG is required. Enable it in lv_conf.h (LV_USE_THORVG_INTERNAL/EXTERNAL 1)" -#endif - -#include "../../draw/lv_draw_buf.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a lottie animation - * @param parent pointer to the parent widget - * @return pointer to the created Lottie animation widget - */ -lv_obj_t * lv_lottie_create(lv_obj_t * parent); - -/** - * Set a buffer for the animation. It also defines the size of the animation - * @param obj pointer to a lottie widget - * @param w width of the animation and buffer - * @param h height of the animation and buffer - * @param buf a static buffer with `width x height x 4` byte size - */ -void lv_lottie_set_buffer(lv_obj_t * obj, int32_t w, int32_t h, void * buf); - -/** - * Set a draw buffer for the animation. It also defines the size of the animation - * @param obj pointer to a lottie widget - * @param draw_buf an initialized draw buffer with ARGB8888 color format - */ -void lv_lottie_set_draw_buf(lv_obj_t * obj, lv_draw_buf_t * draw_buf); - -/** - * Set the source for the animation as an array - * @param obj pointer to a lottie widget - * @param src the lottie animation converted to an nul terminated array - * @param src_size size of the source array in bytes - */ -void lv_lottie_set_src_data(lv_obj_t * obj, const void * src, size_t src_size); - -/** - * Set the source for the animation as a path. - * Lottie doesn't use LVGL's File System API. - * @param obj pointer to a lottie widget - * @param src path to a json file, e.g. "path/to/file.json" - */ -void lv_lottie_set_src_file(lv_obj_t * obj, const char * src); - -/** - * Get the LVGL animation which controls the lottie animation - * @param obj pointer to a lottie widget - * @return the LVGL animation - */ -lv_anim_t * lv_lottie_get_anim(lv_obj_t * obj); - -/********************** - * GLOBAL VARIABLES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_LOTTIE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_LOTTIE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie_private.h b/L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie_private.h deleted file mode 100644 index 6362afb..0000000 --- a/L3_Middlewares/LVGL/src/widgets/lottie/lv_lottie_private.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file lv_lottie_private.h - * - */ - -#ifndef LV_LOTTIE_PRIVATE_H -#define LV_LOTTIE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../lv_conf_internal.h" -#if LV_USE_LOTTIE - -#include "lv_lottie.h" -#include "../canvas/lv_canvas_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -#if LV_USE_THORVG_EXTERNAL -#include -#else -#include "../../libs/thorvg/thorvg_capi.h" -#endif - -typedef struct { - lv_canvas_t canvas; - Tvg_Paint * tvg_paint; - Tvg_Canvas * tvg_canvas; - Tvg_Animation * tvg_anim; - lv_anim_t * anim; - int32_t last_rendered_time; -} lv_lottie_t; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /*LV_LOTTIE_H*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_LOTTIE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/arc/lv_arc.c b/L3_Middlewares/LVGL/src/widgets/lv_arc.c similarity index 62% rename from L3_Middlewares/LVGL/src/widgets/arc/lv_arc.c rename to L3_Middlewares/LVGL/src/widgets/lv_arc.c index 6aa1484..63cf577 100644 --- a/L3_Middlewares/LVGL/src/widgets/arc/lv_arc.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_arc.c @@ -6,23 +6,19 @@ /********************* * INCLUDES *********************/ -#include "lv_arc_private.h" -#include "../../misc/lv_area_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_event_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_arc.h" #if LV_USE_ARC != 0 -#include "../../core/lv_group.h" -#include "../../indev/lv_indev.h" -#include "../../misc/lv_assert.h" -#include "../../misc/lv_math.h" -#include "../../draw/lv_draw_arc.h" +#include "../core/lv_group.h" +#include "../core/lv_indev.h" +#include "../misc/lv_assert.h" +#include "../misc/lv_math.h" +#include "../draw/lv_draw_arc.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_arc_class) +#define MY_CLASS &lv_arc_class #define VALUE_UNSET INT16_MIN #define CLICK_OUTSIDE_BG_ANGLES ((uint32_t) 0x00U) @@ -41,15 +37,14 @@ static void lv_arc_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); static void lv_arc_draw(lv_event_t * e); static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e); -static void inv_arc_area(lv_obj_t * arc, lv_value_precise_t start_angle, lv_value_precise_t end_angle, lv_part_t part); +static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angle, lv_part_t part); static void inv_knob_area(lv_obj_t * obj); -static void get_center(const lv_obj_t * obj, lv_point_t * center, int32_t * arc_r); -static lv_value_precise_t get_angle(const lv_obj_t * obj); -static void get_knob_area(lv_obj_t * arc, const lv_point_t * center, int32_t r, lv_area_t * knob_area); +static void get_center(const lv_obj_t * obj, lv_point_t * center, lv_coord_t * arc_r); +static lv_coord_t get_angle(const lv_obj_t * obj); +static void get_knob_area(lv_obj_t * arc, const lv_point_t * center, lv_coord_t r, lv_area_t * knob_area); static void value_update(lv_obj_t * arc); -static int32_t knob_get_extra_size(lv_obj_t * obj); -static bool lv_arc_angle_within_bg_bounds(lv_obj_t * obj, const lv_value_precise_t angle, - const lv_value_precise_t tolerance_deg); +static lv_coord_t knob_get_extra_size(lv_obj_t * obj); +static bool lv_arc_angle_within_bg_bounds(lv_obj_t * obj, const uint32_t angle, const uint32_t tolerance_deg); /********************** * STATIC VARIABLES @@ -59,8 +54,7 @@ const lv_obj_class_t lv_arc_class = { .event_cb = lv_arc_event, .instance_size = sizeof(lv_arc_t), .editable = LV_OBJ_CLASS_EDITABLE_TRUE, - .base_class = &lv_obj_class, - .name = "arc", + .base_class = &lv_obj_class }; /********************** @@ -91,15 +85,15 @@ lv_obj_t * lv_arc_create(lv_obj_t * parent) * Setter functions *====================*/ -void lv_arc_set_start_angle(lv_obj_t * obj, lv_value_precise_t start) +void lv_arc_set_start_angle(lv_obj_t * obj, uint16_t start) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; if(start > 360) start -= 360; - lv_value_precise_t old_delta = arc->indic_angle_end - arc->indic_angle_start; - lv_value_precise_t new_delta = arc->indic_angle_end - start; + int16_t old_delta = arc->indic_angle_end - arc->indic_angle_start; + int16_t new_delta = arc->indic_angle_end - start; if(old_delta < 0) old_delta = 360 + old_delta; if(new_delta < 0) new_delta = 360 + new_delta; @@ -115,14 +109,14 @@ void lv_arc_set_start_angle(lv_obj_t * obj, lv_value_precise_t start) inv_knob_area(obj); } -void lv_arc_set_end_angle(lv_obj_t * obj, lv_value_precise_t end) +void lv_arc_set_end_angle(lv_obj_t * obj, uint16_t end) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; if(end > 360) end -= 360; - lv_value_precise_t old_delta = arc->indic_angle_end - arc->indic_angle_start; - lv_value_precise_t new_delta = end - arc->indic_angle_start; + int16_t old_delta = arc->indic_angle_end - arc->indic_angle_start; + int16_t new_delta = end - arc->indic_angle_start; if(old_delta < 0) old_delta = 360 + old_delta; if(new_delta < 0) new_delta = 360 + new_delta; @@ -138,21 +132,21 @@ void lv_arc_set_end_angle(lv_obj_t * obj, lv_value_precise_t end) inv_knob_area(obj); } -void lv_arc_set_angles(lv_obj_t * obj, lv_value_precise_t start, lv_value_precise_t end) +void lv_arc_set_angles(lv_obj_t * obj, uint16_t start, uint16_t end) { lv_arc_set_end_angle(obj, end); lv_arc_set_start_angle(obj, start); } -void lv_arc_set_bg_start_angle(lv_obj_t * obj, lv_value_precise_t start) +void lv_arc_set_bg_start_angle(lv_obj_t * obj, uint16_t start) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; if(start > 360) start -= 360; - lv_value_precise_t old_delta = arc->bg_angle_end - arc->bg_angle_start; - lv_value_precise_t new_delta = arc->bg_angle_end - start; + int16_t old_delta = arc->bg_angle_end - arc->bg_angle_start; + int16_t new_delta = arc->bg_angle_end - start; if(old_delta < 0) old_delta = 360 + old_delta; if(new_delta < 0) new_delta = 360 + new_delta; @@ -166,15 +160,15 @@ void lv_arc_set_bg_start_angle(lv_obj_t * obj, lv_value_precise_t start) value_update(obj); } -void lv_arc_set_bg_end_angle(lv_obj_t * obj, lv_value_precise_t end) +void lv_arc_set_bg_end_angle(lv_obj_t * obj, uint16_t end) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; if(end > 360) end -= 360; - lv_value_precise_t old_delta = arc->bg_angle_end - arc->bg_angle_start; - lv_value_precise_t new_delta = end - arc->bg_angle_start; + int16_t old_delta = arc->bg_angle_end - arc->bg_angle_start; + int16_t new_delta = end - arc->bg_angle_start; if(old_delta < 0) old_delta = 360 + old_delta; if(new_delta < 0) new_delta = 360 + new_delta; @@ -188,20 +182,17 @@ void lv_arc_set_bg_end_angle(lv_obj_t * obj, lv_value_precise_t end) value_update(obj); } -void lv_arc_set_bg_angles(lv_obj_t * obj, lv_value_precise_t start, lv_value_precise_t end) +void lv_arc_set_bg_angles(lv_obj_t * obj, uint16_t start, uint16_t end) { lv_arc_set_bg_end_angle(obj, end); lv_arc_set_bg_start_angle(obj, start); } -void lv_arc_set_rotation(lv_obj_t * obj, int32_t rotation) +void lv_arc_set_rotation(lv_obj_t * obj, uint16_t rotation) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; - /* ensure the angle is in the range [0, 360) */ - while(rotation < 0) rotation += 360; - while(rotation >= 360) rotation -= 360; arc->rotation = rotation; lv_obj_invalidate(obj); @@ -212,12 +203,12 @@ void lv_arc_set_mode(lv_obj_t * obj, lv_arc_mode_t type) LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; - int32_t val = arc->value; + int16_t val = arc->value; arc->type = type; arc->value = -1; /** Force set_value handling*/ - lv_value_precise_t bg_midpoint, bg_end = arc->bg_angle_end; + int16_t bg_midpoint, bg_end = arc->bg_angle_end; if(arc->bg_angle_end < arc->bg_angle_start) bg_end = arc->bg_angle_end + 360; switch(arc->type) { @@ -236,14 +227,14 @@ void lv_arc_set_mode(lv_obj_t * obj, lv_arc_mode_t type) lv_arc_set_value(obj, val); } -void lv_arc_set_value(lv_obj_t * obj, int32_t value) +void lv_arc_set_value(lv_obj_t * obj, int16_t value) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; if(arc->value == value) return; - int32_t new_value; + int16_t new_value; new_value = value > arc->max_value ? arc->max_value : value; new_value = new_value < arc->min_value ? arc->min_value : new_value; @@ -253,7 +244,7 @@ void lv_arc_set_value(lv_obj_t * obj, int32_t value) value_update(obj); } -void lv_arc_set_range(lv_obj_t * obj, int32_t min, int32_t max) +void lv_arc_set_range(lv_obj_t * obj, int16_t min, int16_t max) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; @@ -273,7 +264,7 @@ void lv_arc_set_range(lv_obj_t * obj, int32_t min, int32_t max) value_update(obj); /*value has changed relative to the new range*/ } -void lv_arc_set_change_rate(lv_obj_t * obj, uint32_t rate) +void lv_arc_set_change_rate(lv_obj_t * obj, uint16_t rate) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; @@ -281,55 +272,47 @@ void lv_arc_set_change_rate(lv_obj_t * obj, uint32_t rate) arc->chg_rate = rate; } -void lv_arc_set_knob_offset(lv_obj_t * obj, int32_t offset) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_arc_t * arc = (lv_arc_t *)obj; - - arc->knob_offset = offset; -} - /*===================== * Getter functions *====================*/ -lv_value_precise_t lv_arc_get_angle_start(lv_obj_t * obj) +uint16_t lv_arc_get_angle_start(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->indic_angle_start; } -lv_value_precise_t lv_arc_get_angle_end(lv_obj_t * obj) +uint16_t lv_arc_get_angle_end(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->indic_angle_end; } -lv_value_precise_t lv_arc_get_bg_angle_start(lv_obj_t * obj) +uint16_t lv_arc_get_bg_angle_start(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->bg_angle_start; } -lv_value_precise_t lv_arc_get_bg_angle_end(lv_obj_t * obj) +uint16_t lv_arc_get_bg_angle_end(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->bg_angle_end; } -int32_t lv_arc_get_value(const lv_obj_t * obj) +int16_t lv_arc_get_value(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->value; } -int32_t lv_arc_get_min_value(const lv_obj_t * obj) +int16_t lv_arc_get_min_value(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->min_value; } -int32_t lv_arc_get_max_value(const lv_obj_t * obj) +int16_t lv_arc_get_max_value(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->max_value; @@ -341,23 +324,12 @@ lv_arc_mode_t lv_arc_get_mode(const lv_obj_t * obj) return ((lv_arc_t *) obj)->type; } -int32_t lv_arc_get_rotation(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - return ((lv_arc_t *)obj)->rotation; -} - -int32_t lv_arc_get_knob_offset(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - return ((lv_arc_t *)obj)->knob_offset; -} - /*===================== * Other functions *====================*/ -void lv_arc_align_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_align, int32_t r_offset) + +void lv_arc_align_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_align, lv_coord_t r_offset) { LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_NULL(obj_to_align); @@ -365,20 +337,20 @@ void lv_arc_align_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_align, in lv_obj_update_layout(obj); lv_point_t center; - int32_t arc_r; + lv_coord_t arc_r; get_center(obj, ¢er, &arc_r); - int32_t indic_width = lv_obj_get_style_arc_width(obj, LV_PART_INDICATOR); - int32_t indic_width_half = indic_width / 2; + lv_coord_t indic_width = lv_obj_get_style_arc_width(obj, LV_PART_INDICATOR); + lv_coord_t indic_width_half = indic_width / 2; arc_r -= indic_width_half; arc_r += r_offset; - int32_t angle = (int32_t)get_angle(obj); - int32_t knob_x = (arc_r * lv_trigo_sin(angle + 90)) >> LV_TRIGO_SHIFT; - int32_t knob_y = (arc_r * lv_trigo_sin(angle)) >> LV_TRIGO_SHIFT; + uint16_t angle = get_angle(obj); + lv_coord_t knob_x = (arc_r * lv_trigo_sin(angle + 90)) >> LV_TRIGO_SHIFT; + lv_coord_t knob_y = (arc_r * lv_trigo_sin(angle)) >> LV_TRIGO_SHIFT; lv_obj_align_to(obj_to_align, obj, LV_ALIGN_CENTER, knob_x, knob_y); } -void lv_arc_rotate_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_rotate, int32_t r_offset) +void lv_arc_rotate_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_rotate, lv_coord_t r_offset) { LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_NULL(obj_to_rotate); @@ -386,10 +358,10 @@ void lv_arc_rotate_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_rotate, lv_obj_update_layout(obj); lv_point_t center; - int32_t arc_r; + lv_coord_t arc_r; get_center(obj, ¢er, &arc_r); - int32_t indic_width = lv_obj_get_style_arc_width(obj, LV_PART_INDICATOR); - int32_t indic_width_half = indic_width / 2; + lv_coord_t indic_width = lv_obj_get_style_arc_width(obj, LV_PART_INDICATOR); + lv_coord_t indic_width_half = indic_width / 2; arc_r -= indic_width_half; arc_r += r_offset; @@ -397,14 +369,15 @@ void lv_arc_rotate_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_rotate, lv_obj_update_layout(obj); - int32_t angle = (int32_t)get_angle(obj); - int32_t pivot_x = obj_to_rotate->coords.x1 - center.x; - int32_t pivot_y = obj_to_rotate->coords.y1 - center.y; + uint16_t angle = get_angle(obj); + lv_coord_t pivot_x = obj_to_rotate->coords.x1 - center.x; + lv_coord_t pivot_y = obj_to_rotate->coords.y1 - center.y; lv_obj_set_style_transform_pivot_x(obj_to_rotate, -pivot_x, 0); lv_obj_set_style_transform_pivot_y(obj_to_rotate, -pivot_y, 0); - lv_obj_set_style_transform_rotation(obj_to_rotate, angle * 10 + 900, 0); + lv_obj_set_style_transform_angle(obj_to_rotate, angle * 10 + 900, 0); } + /********************** * STATIC FUNCTIONS **********************/ @@ -424,7 +397,7 @@ static void lv_arc_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) arc->indic_angle_end = 270; arc->type = LV_ARC_MODE_NORMAL; arc->value = VALUE_UNSET; - arc->min_close = CLICK_CLOSER_TO_MIN_END; + arc->min_close = 1; arc->min_value = 0; arc->max_value = 100; arc->dragging = false; @@ -434,9 +407,10 @@ static void lv_arc_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) arc->in_out = CLICK_OUTSIDE_BG_ANGLES; lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN | LV_OBJ_FLAG_SCROLLABLE); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN | LV_OBJ_FLAG_SCROLLABLE); lv_obj_set_ext_click_area(obj, LV_DPI_DEF / 10); + LV_TRACE_OBJ_CREATE("finished"); } @@ -444,17 +418,17 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /*Call the ancestor's event handler*/ res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); - lv_arc_t * arc = (lv_arc_t *)obj; + lv_obj_t * obj = lv_event_get_target(e); + lv_arc_t * arc = (lv_arc_t *)lv_event_get_target(e); if(code == LV_EVENT_PRESSING) { - lv_indev_t * indev = lv_indev_active(); + lv_indev_t * indev = lv_indev_get_act(); if(indev == NULL) return; /*Handle only pointers here*/ @@ -466,7 +440,7 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e) /*Make point relative to the arc's center*/ lv_point_t center; - int32_t r; + lv_coord_t r; get_center(obj, ¢er, &r); p.x -= center.x; @@ -474,12 +448,13 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e) /*Enter dragging mode if pressed out of the knob*/ if(arc->dragging == false) { - int32_t indic_width = lv_obj_get_style_arc_width(obj, LV_PART_INDICATOR); + lv_coord_t indic_width = lv_obj_get_style_arc_width(obj, LV_PART_INDICATOR); r -= indic_width; - /*Add some more sensitive area if there is no advanced hit testing. + /*Add some more sensitive area if there is no advanced git testing. * (Advanced hit testing is more precise)*/ if(lv_obj_has_flag(obj, LV_OBJ_FLAG_ADV_HITTEST)) { r -= indic_width; + } else { r -= LV_MAX(r / 4, indic_width); @@ -499,8 +474,8 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e) if(p.x == 0 && p.y == 0) return; /*Calculate the angle of the pressed point*/ - lv_value_precise_t angle; - lv_value_precise_t bg_end = arc->bg_angle_end; + int16_t angle; + int16_t bg_end = arc->bg_angle_end; if(arc->bg_angle_end < arc->bg_angle_start) { bg_end = arc->bg_angle_end + 360; } @@ -509,33 +484,32 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e) angle -= arc->rotation; angle -= arc->bg_angle_start; /*Make the angle relative to the start angle*/ - /* ensure the angle is in the range [0, 360) */ - while(angle < 0) angle += 360; - while(angle >= 360) angle -= 360; + /* If we click near the bg_angle_start the angle will be close to 360° instead of an small angle */ + if(angle < 0) angle += 360; const uint32_t circumference = (uint32_t)((2U * r * 314U) / 100U); /* Equivalent to: 2r * 3.14, avoiding floats */ - const lv_value_precise_t tolerance_deg = (360 * lv_dpx(50U)) / circumference; + const uint32_t tolerance_deg = (360U * LV_DPX(50U)) / circumference; const uint32_t min_close_prev = (uint32_t) arc->min_close; - const bool is_angle_within_bg_bounds = lv_arc_angle_within_bg_bounds(obj, angle, tolerance_deg); + const bool is_angle_within_bg_bounds = lv_arc_angle_within_bg_bounds(obj, (uint32_t) angle, tolerance_deg); if(!is_angle_within_bg_bounds) { return; } - lv_value_precise_t deg_range = bg_end - arc->bg_angle_start; - lv_value_precise_t last_angle_rel = arc->last_angle - arc->bg_angle_start; - lv_value_precise_t delta_angle = angle - last_angle_rel; + int16_t deg_range = bg_end - arc->bg_angle_start; + int16_t last_angle_rel = arc->last_angle - arc->bg_angle_start; + int16_t delta_angle = angle - last_angle_rel; /*Do not allow big jumps (jumps bigger than 280°). *It's mainly to avoid jumping to the opposite end if the "dead" range between min. and max. is crossed. *Check which end was closer on the last valid press (arc->min_close) and prefer that end*/ if(LV_ABS(delta_angle) > 280) { - if(arc->min_close == CLICK_CLOSER_TO_MIN_END) angle = 0; + if(arc->min_close) angle = 0; else angle = deg_range; } /* Check if click was outside the background arc start and end angles */ else if(CLICK_OUTSIDE_BG_ANGLES == arc->in_out) { - if(arc->min_close == CLICK_CLOSER_TO_MIN_END) angle = -deg_range; + if(arc->min_close) angle = -deg_range; else angle = deg_range; } else { /* Keep the angle value */ } @@ -545,12 +519,10 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e) if(((min_close_prev == CLICK_CLOSER_TO_MIN_END) && (arc->min_close == CLICK_CLOSER_TO_MAX_END)) && ((CLICK_OUTSIDE_BG_ANGLES == arc->in_out) && (LV_ABS(delta_angle) > 280))) { angle = 0; - arc->min_close = min_close_prev; } else if(((min_close_prev == CLICK_CLOSER_TO_MAX_END) && (arc->min_close == CLICK_CLOSER_TO_MIN_END)) - && (CLICK_OUTSIDE_BG_ANGLES == arc->in_out) && (360 - LV_ABS(delta_angle) > 280)) { + && (CLICK_OUTSIDE_BG_ANGLES == arc->in_out)) { angle = deg_range; - arc->min_close = min_close_prev; } else { /* Keep the angle value */ } @@ -559,7 +531,7 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e) uint32_t delta_tick = lv_tick_elaps(arc->last_tick); /* delta_angle_max can never be signed. delta_tick is always signed, same for ch_rate */ - const lv_value_precise_t delta_angle_max = (arc->chg_rate * delta_tick) / 1000; + const uint16_t delta_angle_max = (arc->chg_rate * delta_tick) / 1000; if(delta_angle > delta_angle_max) { delta_angle = delta_angle_max; @@ -572,26 +544,21 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e) angle = last_angle_rel + delta_angle; /*Apply the limited angle change*/ /*Rounding for symmetry*/ - lv_value_precise_t round = ((bg_end - arc->bg_angle_start) * 8) / (arc->max_value - arc->min_value); - round = (round + 4) / 16; + int32_t round = ((bg_end - arc->bg_angle_start) * 8) / (arc->max_value - arc->min_value); + round = (round + 4) >> 4; angle += round; angle += arc->bg_angle_start; /*Make the angle absolute again*/ /*Set the new value*/ - int32_t old_value = arc->value; - int32_t new_value = lv_map((int32_t)angle, (int32_t)arc->bg_angle_start, (int32_t)bg_end, arc->min_value, - arc->max_value); - if(arc->type == LV_ARC_MODE_REVERSE) { - new_value = arc->max_value - new_value + arc->min_value; - } - + int16_t old_value = arc->value; + int16_t new_value = lv_map(angle, arc->bg_angle_start, bg_end, arc->min_value, arc->max_value); if(new_value != lv_arc_get_value(obj)) { arc->last_tick = lv_tick_get(); /*Cache timestamp for the next iteration*/ lv_arc_set_value(obj, new_value); /*set_value caches the last_angle for the next iteration*/ if(new_value != old_value) { - res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - if(res != LV_RESULT_OK) return; + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return; } } @@ -606,16 +573,16 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e) /*Leave edit mode if released. (No need to wait for LONG_PRESS)*/ lv_group_t * g = lv_obj_get_group(obj); bool editing = lv_group_get_editing(g); - lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_active()); + lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); if(indev_type == LV_INDEV_TYPE_ENCODER) { if(editing) lv_group_set_editing(g, false); } } else if(code == LV_EVENT_KEY) { - uint32_t c = lv_event_get_key(e); + char c = *((char *)lv_event_get_param(e)); - int32_t old_value = arc->value; + int16_t old_value = arc->value; if(c == LV_KEY_RIGHT || c == LV_KEY_UP) { lv_arc_set_value(obj, lv_arc_get_value(obj) + 1); } @@ -624,81 +591,52 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e) } if(old_value != arc->value) { - res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - if(res != LV_RESULT_OK) return; - } - } - else if(code == LV_EVENT_ROTARY) { - int32_t r = lv_event_get_rotary_diff(e); - - int32_t old_value = arc->value; - lv_arc_set_value(obj, lv_arc_get_value(obj) + r); - if(old_value != arc->value) { - res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - if(res != LV_RESULT_OK) return; + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return; } } else if(code == LV_EVENT_HIT_TEST) { lv_hit_test_info_t * info = lv_event_get_param(e); lv_point_t p; - int32_t r; + lv_coord_t r; get_center(obj, &p, &r); - int32_t ext_click_area = 0; + lv_coord_t ext_click_area = 0; if(obj->spec_attr) ext_click_area = obj->spec_attr->ext_click_pad; - int32_t w = lv_obj_get_style_arc_width(obj, LV_PART_MAIN); + lv_coord_t w = lv_obj_get_style_arc_width(obj, LV_PART_MAIN); r -= w + ext_click_area; lv_area_t a; /*Invalid if clicked inside*/ lv_area_set(&a, p.x - r, p.y - r, p.x + r, p.y + r); - if(lv_area_is_point_on(&a, info->point, LV_RADIUS_CIRCLE)) { - info->res = false; - return; - } - - /*Calculate the angle of the pressed point*/ - lv_value_precise_t angle = lv_atan2(info->point->y - p.y, info->point->x - p.x); - angle -= arc->rotation; - angle -= arc->bg_angle_start; /*Make the angle relative to the start angle*/ - - /* ensure the angle is in the range [0, 360) */ - while(angle < 0) angle += 360; - while(angle >= 360) angle -= 360; - - const uint32_t circumference = (uint32_t)((2U * r * 314U) / 100U); /* Equivalent to: 2r * 3.14, avoiding floats */ - const lv_value_precise_t tolerance_deg = (360 * lv_dpx(50U)) / circumference; - - /* Check if the angle is outside the drawn background arc */ - const bool is_angle_within_bg_bounds = lv_arc_angle_within_bg_bounds(obj, angle, tolerance_deg); - if(!is_angle_within_bg_bounds) { + if(_lv_area_is_point_on(&a, info->point, LV_RADIUS_CIRCLE)) { info->res = false; return; } /*Valid if no clicked outside*/ lv_area_increase(&a, w + ext_click_area * 2, w + ext_click_area * 2); - info->res = lv_area_is_point_on(&a, info->point, LV_RADIUS_CIRCLE); + info->res = _lv_area_is_point_on(&a, info->point, LV_RADIUS_CIRCLE); } else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { - int32_t bg_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t bg_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); - int32_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); - int32_t bg_pad = LV_MAX4(bg_left, bg_right, bg_top, bg_bottom); - - int32_t knob_left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); - int32_t knob_right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); - int32_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); - int32_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); - int32_t knob_pad = LV_MAX4(knob_left, knob_right, knob_top, knob_bottom) + 2; - - int32_t knob_extra_size = knob_pad - bg_pad; + lv_coord_t bg_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t bg_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); + lv_coord_t bg_pad = LV_MAX4(bg_left, bg_right, bg_top, bg_bottom); + + lv_coord_t knob_left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); + lv_coord_t knob_right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); + lv_coord_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); + lv_coord_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); + lv_coord_t knob_pad = LV_MAX4(knob_left, knob_right, knob_top, knob_bottom) + 2; + + lv_coord_t knob_extra_size = knob_pad - bg_pad; knob_extra_size += knob_get_extra_size(obj); - int32_t * s = lv_event_get_param(e); + lv_coord_t * s = lv_event_get_param(e); *s = LV_MAX(*s, knob_extra_size); } else if(code == LV_EVENT_DRAW_MAIN) { @@ -708,44 +646,62 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e) static void lv_arc_draw(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_arc_t * arc = (lv_arc_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); lv_point_t center; - int32_t arc_r; + lv_coord_t arc_r; get_center(obj, ¢er, &arc_r); + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + /*Draw the background arc*/ lv_draw_arc_dsc_t arc_dsc; if(arc_r > 0) { lv_draw_arc_dsc_init(&arc_dsc); lv_obj_init_draw_arc_dsc(obj, LV_PART_MAIN, &arc_dsc); - arc_dsc.center = center; - arc_dsc.start_angle = arc->bg_angle_start + arc->rotation; - arc_dsc.end_angle = arc->bg_angle_end + arc->rotation; - arc_dsc.radius = arc_r; - lv_draw_arc(layer, &arc_dsc); + + part_draw_dsc.part = LV_PART_MAIN; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_ARC_DRAW_PART_BACKGROUND; + part_draw_dsc.p1 = ¢er; + part_draw_dsc.radius = arc_r; + part_draw_dsc.arc_dsc = &arc_dsc; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + + lv_draw_arc(draw_ctx, &arc_dsc, ¢er, part_draw_dsc.radius, arc->bg_angle_start + arc->rotation, + arc->bg_angle_end + arc->rotation); + + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); } /*Make the indicator arc smaller or larger according to its greatest padding value*/ - int32_t left_indic = lv_obj_get_style_pad_left(obj, LV_PART_INDICATOR); - int32_t right_indic = lv_obj_get_style_pad_right(obj, LV_PART_INDICATOR); - int32_t top_indic = lv_obj_get_style_pad_top(obj, LV_PART_INDICATOR); - int32_t bottom_indic = lv_obj_get_style_pad_bottom(obj, LV_PART_INDICATOR); - int32_t indic_r = arc_r - LV_MAX4(left_indic, right_indic, top_indic, bottom_indic); + lv_coord_t left_indic = lv_obj_get_style_pad_left(obj, LV_PART_INDICATOR); + lv_coord_t right_indic = lv_obj_get_style_pad_right(obj, LV_PART_INDICATOR); + lv_coord_t top_indic = lv_obj_get_style_pad_top(obj, LV_PART_INDICATOR); + lv_coord_t bottom_indic = lv_obj_get_style_pad_bottom(obj, LV_PART_INDICATOR); + lv_coord_t indic_r = arc_r - LV_MAX4(left_indic, right_indic, top_indic, bottom_indic); if(indic_r > 0) { lv_draw_arc_dsc_init(&arc_dsc); lv_obj_init_draw_arc_dsc(obj, LV_PART_INDICATOR, &arc_dsc); - arc_dsc.center = center; - arc_dsc.start_angle = arc->indic_angle_start + arc->rotation; - arc_dsc.end_angle = arc->indic_angle_end + arc->rotation; - arc_dsc.radius = indic_r; + part_draw_dsc.part = LV_PART_INDICATOR; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_ARC_DRAW_PART_FOREGROUND; + part_draw_dsc.p1 = ¢er; + part_draw_dsc.radius = indic_r; + part_draw_dsc.arc_dsc = &arc_dsc; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); - lv_draw_arc(layer, &arc_dsc); + if(arc_dsc.width > part_draw_dsc.radius) arc_dsc.width = part_draw_dsc.radius; + lv_draw_arc(draw_ctx, &arc_dsc, ¢er, part_draw_dsc.radius, arc->indic_angle_start + arc->rotation, + arc->indic_angle_end + arc->rotation); + + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); } lv_area_t knob_area; @@ -754,10 +710,20 @@ static void lv_arc_draw(lv_event_t * e) lv_draw_rect_dsc_t knob_rect_dsc; lv_draw_rect_dsc_init(&knob_rect_dsc); lv_obj_init_draw_rect_dsc(obj, LV_PART_KNOB, &knob_rect_dsc); - lv_draw_rect(layer, &knob_rect_dsc, &knob_area); + + part_draw_dsc.part = LV_PART_KNOB; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_ARC_DRAW_PART_KNOB; + part_draw_dsc.draw_area = &knob_area; + part_draw_dsc.rect_dsc = &knob_rect_dsc; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + + lv_draw_rect(draw_ctx, &knob_rect_dsc, &knob_area); + + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); } -static void inv_arc_area(lv_obj_t * obj, lv_value_precise_t start_angle, lv_value_precise_t end_angle, lv_part_t part) +static void inv_arc_area(lv_obj_t * obj, uint16_t start_angle, uint16_t end_angle, lv_part_t part) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -777,12 +743,12 @@ static void inv_arc_area(lv_obj_t * obj, lv_value_precise_t start_angle, lv_valu if(start_angle > 360) start_angle -= 360; if(end_angle > 360) end_angle -= 360; - int32_t r; + lv_coord_t r; lv_point_t c; get_center(obj, &c, &r); - int32_t w = lv_obj_get_style_arc_width(obj, part); - int32_t rounded = lv_obj_get_style_arc_rounded(obj, part); + lv_coord_t w = lv_obj_get_style_arc_width(obj, part); + lv_coord_t rounded = lv_obj_get_style_arc_rounded(obj, part); lv_area_t inv_area; lv_draw_arc_get_area(c.x, c.y, r, start_angle, end_angle, w, rounded, &inv_area); @@ -793,13 +759,13 @@ static void inv_arc_area(lv_obj_t * obj, lv_value_precise_t start_angle, lv_valu static void inv_knob_area(lv_obj_t * obj) { lv_point_t c; - int32_t r; + lv_coord_t r; get_center(obj, &c, &r); lv_area_t a; get_knob_area(obj, &c, r, &a); - int32_t knob_extra_size = knob_get_extra_size(obj); + lv_coord_t knob_extra_size = knob_get_extra_size(obj); if(knob_extra_size > 0) { lv_area_increase(&a, knob_extra_size, knob_extra_size); @@ -808,15 +774,15 @@ static void inv_knob_area(lv_obj_t * obj) lv_obj_invalidate_area(obj, &a); } -static void get_center(const lv_obj_t * obj, lv_point_t * center, int32_t * arc_r) +static void get_center(const lv_obj_t * obj, lv_point_t * center, lv_coord_t * arc_r) { - int32_t left_bg = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t right_bg = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); - int32_t top_bg = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t bottom_bg = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); + lv_coord_t left_bg = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t right_bg = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t top_bg = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t bottom_bg = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); - int32_t r = (LV_MIN(lv_obj_get_width(obj) - left_bg - right_bg, - lv_obj_get_height(obj) - top_bg - bottom_bg)) / 2; + lv_coord_t r = (LV_MIN(lv_obj_get_width(obj) - left_bg - right_bg, + lv_obj_get_height(obj) - top_bg - bottom_bg)) / 2; center->x = obj->coords.x1 + r + left_bg; center->y = obj->coords.y1 + r + top_bg; @@ -824,10 +790,10 @@ static void get_center(const lv_obj_t * obj, lv_point_t * center, int32_t * arc_ if(arc_r) *arc_r = r; } -static lv_value_precise_t get_angle(const lv_obj_t * obj) +static lv_coord_t get_angle(const lv_obj_t * obj) { lv_arc_t * arc = (lv_arc_t *)obj; - lv_value_precise_t angle = arc->rotation; + uint16_t angle = arc->rotation; if(arc->type == LV_ARC_MODE_NORMAL) { angle += arc->indic_angle_end; } @@ -835,12 +801,12 @@ static lv_value_precise_t get_angle(const lv_obj_t * obj) angle += arc->indic_angle_start; } else if(arc->type == LV_ARC_MODE_SYMMETRICAL) { - lv_value_precise_t bg_end = arc->bg_angle_end; + int16_t bg_end = arc->bg_angle_end; if(arc->bg_angle_end < arc->bg_angle_start) bg_end = arc->bg_angle_end + 360; - lv_value_precise_t indic_end = arc->indic_angle_end; + int16_t indic_end = arc->indic_angle_end; if(arc->indic_angle_end < arc->indic_angle_start) indic_end = arc->indic_angle_end + 360; - lv_value_precise_t angle_midpoint = (int32_t)(arc->bg_angle_start + bg_end) / 2; + int32_t angle_midpoint = (int32_t)(arc->bg_angle_start + bg_end) / 2; if(arc->indic_angle_start < angle_midpoint) angle += arc->indic_angle_start; else if(indic_end > angle_midpoint) angle += arc->indic_angle_end; else angle += angle_midpoint; @@ -849,21 +815,21 @@ static lv_value_precise_t get_angle(const lv_obj_t * obj) return angle; } -static void get_knob_area(lv_obj_t * obj, const lv_point_t * center, int32_t r, lv_area_t * knob_area) + +static void get_knob_area(lv_obj_t * obj, const lv_point_t * center, lv_coord_t r, lv_area_t * knob_area) { - int32_t indic_width = lv_obj_get_style_arc_width(obj, LV_PART_INDICATOR); - int32_t indic_width_half = indic_width / 2; + lv_coord_t indic_width = lv_obj_get_style_arc_width(obj, LV_PART_INDICATOR); + lv_coord_t indic_width_half = indic_width / 2; r -= indic_width_half; - int32_t angle = (int32_t)get_angle(obj); - int32_t knob_offset = lv_arc_get_knob_offset(obj); - int32_t knob_x = (r * lv_trigo_sin(knob_offset + angle + 90)) >> LV_TRIGO_SHIFT; - int32_t knob_y = (r * lv_trigo_sin(knob_offset + angle)) >> LV_TRIGO_SHIFT; + lv_coord_t angle = get_angle(obj); + lv_coord_t knob_x = (r * lv_trigo_sin(angle + 90)) >> LV_TRIGO_SHIFT; + lv_coord_t knob_y = (r * lv_trigo_sin(angle)) >> LV_TRIGO_SHIFT; - int32_t left_knob = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); - int32_t right_knob = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); - int32_t top_knob = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); - int32_t bottom_knob = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); + lv_coord_t left_knob = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); + lv_coord_t right_knob = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); + lv_coord_t top_knob = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); + lv_coord_t bottom_knob = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); knob_area->x1 = center->x + knob_x - left_knob - indic_width_half; knob_area->x2 = center->x + knob_x + right_knob + indic_width_half; @@ -883,33 +849,32 @@ static void value_update(lv_obj_t * obj) /*If the value is still not set to any value do not update*/ if(arc->value == VALUE_UNSET) return; - lv_value_precise_t bg_midpoint, bg_end = arc->bg_angle_end; - int32_t range_midpoint; + int16_t bg_midpoint, range_midpoint, bg_end = arc->bg_angle_end; if(arc->bg_angle_end < arc->bg_angle_start) bg_end = arc->bg_angle_end + 360; - int32_t angle; + int16_t angle; switch(arc->type) { case LV_ARC_MODE_SYMMETRICAL: bg_midpoint = (arc->bg_angle_start + bg_end) / 2; range_midpoint = (int32_t)(arc->min_value + arc->max_value) / 2; if(arc->value < range_midpoint) { - angle = lv_map(arc->value, arc->min_value, range_midpoint, (int32_t)arc->bg_angle_start, (int32_t)bg_midpoint); + angle = lv_map(arc->value, arc->min_value, range_midpoint, arc->bg_angle_start, bg_midpoint); lv_arc_set_start_angle(obj, angle); lv_arc_set_end_angle(obj, bg_midpoint); } else { - angle = lv_map(arc->value, range_midpoint, arc->max_value, (int32_t)bg_midpoint, (int32_t)bg_end); + angle = lv_map(arc->value, range_midpoint, arc->max_value, bg_midpoint, bg_end); lv_arc_set_start_angle(obj, bg_midpoint); lv_arc_set_end_angle(obj, angle); } break; case LV_ARC_MODE_REVERSE: - angle = lv_map(arc->value, arc->min_value, arc->max_value, (int32_t)bg_end, (int32_t)arc->bg_angle_start); + angle = lv_map(arc->value, arc->min_value, arc->max_value, bg_end, arc->bg_angle_start); lv_arc_set_angles(obj, angle, arc->bg_angle_end); break; case LV_ARC_MODE_NORMAL: - angle = lv_map(arc->value, arc->min_value, arc->max_value, (int32_t)arc->bg_angle_start, (int32_t)bg_end); + angle = lv_map(arc->value, arc->min_value, arc->max_value, arc->bg_angle_start, bg_end); lv_arc_set_angles(obj, arc->bg_angle_start, angle); break; @@ -920,15 +885,15 @@ static void value_update(lv_obj_t * obj) arc->last_angle = angle; /*Cache angle for slew rate limiting*/ } -static int32_t knob_get_extra_size(lv_obj_t * obj) +static lv_coord_t knob_get_extra_size(lv_obj_t * obj) { - int32_t knob_shadow_size = 0; + lv_coord_t knob_shadow_size = 0; knob_shadow_size += lv_obj_get_style_shadow_width(obj, LV_PART_KNOB); knob_shadow_size += lv_obj_get_style_shadow_spread(obj, LV_PART_KNOB); - knob_shadow_size += LV_ABS(lv_obj_get_style_shadow_offset_x(obj, LV_PART_KNOB)); - knob_shadow_size += LV_ABS(lv_obj_get_style_shadow_offset_y(obj, LV_PART_KNOB)); + knob_shadow_size += LV_ABS(lv_obj_get_style_shadow_ofs_x(obj, LV_PART_KNOB)); + knob_shadow_size += LV_ABS(lv_obj_get_style_shadow_ofs_y(obj, LV_PART_KNOB)); - int32_t knob_outline_size = 0; + lv_coord_t knob_outline_size = 0; knob_outline_size += lv_obj_get_style_outline_width(obj, LV_PART_KNOB); knob_outline_size += lv_obj_get_style_outline_pad(obj, LV_PART_KNOB); @@ -952,56 +917,102 @@ static int32_t knob_get_extra_size(lv_obj_t * obj) * and we click a bit to the left, angle is 10, not the expected 40. * * @param obj Pointer to lv_arc - * @param angle Angle to be checked. Is 0<=angle<=360 and relative to bg_angle_start + * @param angle Angle to be checked * @param tolerance_deg Tolerance * * @return true if angle is within arc background bounds, false otherwise */ -static bool lv_arc_angle_within_bg_bounds(lv_obj_t * obj, const lv_value_precise_t angle, - const lv_value_precise_t tolerance_deg) +static bool lv_arc_angle_within_bg_bounds(lv_obj_t * obj, const uint32_t angle, const uint32_t tolerance_deg) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; - lv_value_precise_t bounds_angle = arc->bg_angle_end - arc->bg_angle_start; + uint32_t smaller_angle = 0; + uint32_t bigger_angle = 0; - /* ensure the angle is in the range [0, 360) */ - while(bounds_angle < 0) bounds_angle += 360; - while(bounds_angle >= 360) bounds_angle -= 360; + /* Determine which background angle is smaller and bigger */ + if(arc->bg_angle_start < arc->bg_angle_end) { + bigger_angle = arc->bg_angle_end; + smaller_angle = arc->bg_angle_start; + } + else { + bigger_angle = (360 - arc->bg_angle_start) + arc->bg_angle_end; + smaller_angle = 0; + } - /* Angle is in the bounds */ - if(angle <= bounds_angle) { - if(angle < (bounds_angle / 2)) { - arc->min_close = CLICK_CLOSER_TO_MIN_END; + /* Angle is between both background angles */ + if((smaller_angle <= angle) && (angle <= bigger_angle)) { + + if(((bigger_angle - smaller_angle) / 2U) >= angle) { + arc->min_close = 1; } else { - arc->min_close = CLICK_CLOSER_TO_MAX_END; + arc->min_close = 0; } + arc->in_out = CLICK_INSIDE_BG_ANGLES; + return true; } - /* Distance between background start and end angles is less than tolerance, * consider the click inside the arc */ - if(360 - bounds_angle <= tolerance_deg) { - arc->min_close = CLICK_CLOSER_TO_MIN_END; + else if(((smaller_angle - tolerance_deg) <= 0U) && + (360U - (bigger_angle + (smaller_angle - tolerance_deg)))) { + + arc->min_close = 1; arc->in_out = CLICK_INSIDE_BG_ANGLES; return true; } + else { /* Case handled below */ } + + /* Legends: + * 0° = angle 0 + * 360° = angle 360 + * T: Tolerance + * A: Angle + * S: Arc background start angle + * E: Arc background end angle + * + * Start angle is bigger or equal to tolerance */ + if((smaller_angle >= tolerance_deg) + /* (360° - T) --- A --- 360° */ + && ((angle >= (360U - tolerance_deg)) && (angle <= 360U))) { + + arc->min_close = 1; + arc->in_out = CLICK_OUTSIDE_BG_ANGLES; + return true; + } + /* Tolerance is bigger than bg start angle */ + else if((smaller_angle < tolerance_deg) + /* (360° - (T - S)) --- A --- 360° */ + && (((360U - (tolerance_deg - smaller_angle)) <= angle)) && (angle <= 360U)) { - /* angle is within the tolerance of the min end */ - if(360 - angle <= tolerance_deg) { - arc->min_close = CLICK_CLOSER_TO_MIN_END; + arc->min_close = 1; arc->in_out = CLICK_OUTSIDE_BG_ANGLES; return true; } + /* 360° is bigger than background end angle + tolerance */ + else if((360U >= (bigger_angle + tolerance_deg)) + /* E --- A --- (E + T) */ + && ((bigger_angle <= (angle + smaller_angle)) && + ((angle + smaller_angle) <= (bigger_angle + tolerance_deg)))) { - /* angle is within the tolerance of the max end */ - if(angle <= bounds_angle + tolerance_deg) { - arc->min_close = CLICK_CLOSER_TO_MAX_END; + arc->min_close = 0; arc->in_out = CLICK_OUTSIDE_BG_ANGLES; return true; } + /* Background end angle + tolerance is bigger than 360° and bg_start_angle + tolerance is not near 0° + ((bg_end_angle + tolerance) - 360°) + * Here we can assume background is not near 0° because of the first two initial checks */ + else if((360U < (bigger_angle + tolerance_deg)) + && (angle <= 0U + ((bigger_angle + tolerance_deg) - 360U)) && (angle > bigger_angle)) { + + arc->min_close = 0; + arc->in_out = CLICK_OUTSIDE_BG_ANGLES; + return true; + } + else { + /* Nothing to do */ + } return false; } diff --git a/L3_Middlewares/LVGL/src/widgets/lv_arc.h b/L3_Middlewares/LVGL/src/widgets/lv_arc.h new file mode 100644 index 0000000..6a8a072 --- /dev/null +++ b/L3_Middlewares/LVGL/src/widgets/lv_arc.h @@ -0,0 +1,257 @@ +/** + * @file lv_arc.h + * + */ + +#ifndef LV_ARC_H +#define LV_ARC_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" + +#if LV_USE_ARC != 0 + +#include "../core/lv_obj.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +enum { + LV_ARC_MODE_NORMAL, + LV_ARC_MODE_SYMMETRICAL, + LV_ARC_MODE_REVERSE +}; +typedef uint8_t lv_arc_mode_t; + +typedef struct { + lv_obj_t obj; + uint16_t rotation; + uint16_t indic_angle_start; + uint16_t indic_angle_end; + uint16_t bg_angle_start; + uint16_t bg_angle_end; + int16_t value; /*Current value of the arc*/ + int16_t min_value; /*Minimum value of the arc*/ + int16_t max_value; /*Maximum value of the arc*/ + uint32_t dragging : 1; + uint32_t type : 2; + uint32_t min_close : 1; /*1: the last pressed angle was closer to minimum end*/ + uint32_t in_out : 1; /* 1: The click was within the background arc angles. 0: Click outside */ + uint32_t chg_rate; /*Drag angle rate of change of the arc (degrees/sec)*/ + uint32_t last_tick; /*Last dragging event timestamp of the arc*/ + int16_t last_angle; /*Last dragging angle of the arc*/ +} lv_arc_t; + +extern const lv_obj_class_t lv_arc_class; + +/** + * `type` field in `lv_obj_draw_part_dsc_t` if `class_p = lv_arc_class` + * Used in `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` + */ +typedef enum { + LV_ARC_DRAW_PART_BACKGROUND, /**< The background arc*/ + LV_ARC_DRAW_PART_FOREGROUND, /**< The foreground arc*/ + LV_ARC_DRAW_PART_KNOB, /**< The knob*/ +} lv_arc_draw_part_type_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create an arc object + * @param parent pointer to an object, it will be the parent of the new arc + * @return pointer to the created arc + */ +lv_obj_t * lv_arc_create(lv_obj_t * parent); + +/*====================== + * Add/remove functions + *=====================*/ + +/*===================== + * Setter functions + *====================*/ + +/** + * Set the start angle of an arc. 0 deg: right, 90 bottom, etc. + * @param obj pointer to an arc object + * @param start the start angle + */ +void lv_arc_set_start_angle(lv_obj_t * obj, uint16_t start); + +/** + * Set the end angle of an arc. 0 deg: right, 90 bottom, etc. + * @param obj pointer to an arc object + * @param end the end angle + */ +void lv_arc_set_end_angle(lv_obj_t * obj, uint16_t end); + +/** + * Set the start and end angles + * @param obj pointer to an arc object + * @param start the start angle + * @param end the end angle + */ +void lv_arc_set_angles(lv_obj_t * obj, uint16_t start, uint16_t end); + +/** + * Set the start angle of an arc background. 0 deg: right, 90 bottom, etc. + * @param obj pointer to an arc object + * @param start the start angle + */ +void lv_arc_set_bg_start_angle(lv_obj_t * obj, uint16_t start); + +/** + * Set the start angle of an arc background. 0 deg: right, 90 bottom etc. + * @param obj pointer to an arc object + * @param end the end angle + */ +void lv_arc_set_bg_end_angle(lv_obj_t * obj, uint16_t end); + +/** + * Set the start and end angles of the arc background + * @param obj pointer to an arc object + * @param start the start angle + * @param end the end angle + */ +void lv_arc_set_bg_angles(lv_obj_t * obj, uint16_t start, uint16_t end); + +/** + * Set the rotation for the whole arc + * @param obj pointer to an arc object + * @param rotation rotation angle + */ +void lv_arc_set_rotation(lv_obj_t * obj, uint16_t rotation); + +/** + * Set the type of arc. + * @param obj pointer to arc object + * @param mode arc's mode + */ +void lv_arc_set_mode(lv_obj_t * obj, lv_arc_mode_t type); + +/** + * Set a new value on the arc + * @param obj pointer to an arc object + * @param value new value + */ +void lv_arc_set_value(lv_obj_t * obj, int16_t value); + +/** + * Set minimum and the maximum values of an arc + * @param obj pointer to the arc object + * @param min minimum value + * @param max maximum value + */ +void lv_arc_set_range(lv_obj_t * obj, int16_t min, int16_t max); + +/** + * Set a change rate to limit the speed how fast the arc should reach the pressed point. + * @param obj pointer to an arc object + * @param rate the change rate + */ +void lv_arc_set_change_rate(lv_obj_t * obj, uint16_t rate); + +/*===================== + * Getter functions + *====================*/ + +/** + * Get the start angle of an arc. + * @param obj pointer to an arc object + * @return the start angle [0..360] + */ +uint16_t lv_arc_get_angle_start(lv_obj_t * obj); + +/** + * Get the end angle of an arc. + * @param obj pointer to an arc object + * @return the end angle [0..360] + */ +uint16_t lv_arc_get_angle_end(lv_obj_t * obj); + +/** + * Get the start angle of an arc background. + * @param obj pointer to an arc object + * @return the start angle [0..360] + */ +uint16_t lv_arc_get_bg_angle_start(lv_obj_t * obj); + +/** + * Get the end angle of an arc background. + * @param obj pointer to an arc object + * @return the end angle [0..360] + */ +uint16_t lv_arc_get_bg_angle_end(lv_obj_t * obj); + +/** + * Get the value of an arc + * @param obj pointer to an arc object + * @return the value of the arc + */ +int16_t lv_arc_get_value(const lv_obj_t * obj); + +/** + * Get the minimum value of an arc + * @param obj pointer to an arc object + * @return the minimum value of the arc + */ +int16_t lv_arc_get_min_value(const lv_obj_t * obj); + +/** + * Get the maximum value of an arc + * @param obj pointer to an arc object + * @return the maximum value of the arc + */ +int16_t lv_arc_get_max_value(const lv_obj_t * obj); + +/** + * Get whether the arc is type or not. + * @param obj pointer to an arc object + * @return arc's mode + */ +lv_arc_mode_t lv_arc_get_mode(const lv_obj_t * obj); + +/*===================== + * Other functions + *====================*/ + +/** + * Align an object to the current position of the arc (knob) + * @param obj pointer to an arc object + * @param obj_to_align pointer to an object to align + * @param r_offset consider the radius larger with this value (< 0: for smaller radius) + */ +void lv_arc_align_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_align, lv_coord_t r_offset); + +/** + * Rotate an object to the current position of the arc (knob) + * @param obj pointer to an arc object + * @param obj_to_align pointer to an object to rotate + * @param r_offset consider the radius larger with this value (< 0: for smaller radius) + */ +void lv_arc_rotate_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_rotate, lv_coord_t r_offset); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_ARC*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_ARC_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/bar/lv_bar.c b/L3_Middlewares/LVGL/src/widgets/lv_bar.c similarity index 52% rename from L3_Middlewares/LVGL/src/widgets/bar/lv_bar.c rename to L3_Middlewares/LVGL/src/widgets/lv_bar.c index 6fc7b23..a057618 100644 --- a/L3_Middlewares/LVGL/src/widgets/bar/lv_bar.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_bar.c @@ -6,22 +6,18 @@ /********************* * INCLUDES *********************/ -#include "lv_bar_private.h" -#include "../../misc/lv_area_private.h" -#include "../../draw/lv_draw_mask_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_bar.h" #if LV_USE_BAR != 0 -#include "../../draw/lv_draw.h" -#include "../../misc/lv_assert.h" -#include "../../misc/lv_anim_private.h" -#include "../../misc/lv_math.h" +#include "../misc/lv_assert.h" +#include "../draw/lv_draw.h" +#include "../misc/lv_anim.h" +#include "../misc/lv_math.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_bar_class) +#define MY_CLASS &lv_bar_class /** hor. pad and ver. pad cannot make the indicator smaller than this [px]*/ #define LV_BAR_SIZE_MIN 4 @@ -53,10 +49,10 @@ static void lv_bar_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); static void lv_bar_event(const lv_obj_class_t * class_p, lv_event_t * e); static void draw_indic(lv_event_t * e); static void lv_bar_set_value_with_anim(lv_obj_t * obj, int32_t new_value, int32_t * value_ptr, - lv_bar_anim_t * anim_info, lv_anim_enable_t en); -static void lv_bar_init_anim(lv_obj_t * bar, lv_bar_anim_t * bar_anim); + _lv_bar_anim_t * anim_info, lv_anim_enable_t en); +static void lv_bar_init_anim(lv_obj_t * bar, _lv_bar_anim_t * bar_anim); static void lv_bar_anim(void * bar, int32_t value); -static void lv_bar_anim_completed(lv_anim_t * a); +static void lv_bar_anim_ready(lv_anim_t * a); /********************** * STATIC VARIABLES @@ -68,8 +64,7 @@ const lv_obj_class_t lv_bar_class = { .width_def = LV_DPI_DEF * 2, .height_def = LV_DPI_DEF / 10, .instance_size = sizeof(lv_bar_t), - .base_class = &lv_obj_class, - .name = "bar", + .base_class = &lv_obj_class }; /********************** @@ -103,7 +98,6 @@ void lv_bar_set_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim) value = value < bar->start_value ? bar->start_value : value; /*Can't be smaller than the left value*/ if(bar->cur_value == value) return; - lv_bar_set_value_with_anim(obj, value, &bar->cur_value, &bar->cur_value_anim, anim); } @@ -121,7 +115,6 @@ void lv_bar_set_start_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim value = value > bar->cur_value ? bar->cur_value : value; /*Can't be greater than the right value*/ if(bar->start_value == value) return; - lv_bar_set_value_with_anim(obj, value, &bar->start_value, &bar->start_value_anim, anim); } @@ -131,27 +124,22 @@ void lv_bar_set_range(lv_obj_t * obj, int32_t min, int32_t max) lv_bar_t * bar = (lv_bar_t *)obj; - bar->val_reversed = min > max; + if(bar->min_value == min && bar->max_value == max) return; - int32_t real_min = bar->val_reversed ? max : min; - int32_t real_max = bar->val_reversed ? min : max; - if(bar->min_value == real_min && bar->max_value == real_max) return; - - bar->max_value = real_max; - bar->min_value = real_min; + bar->max_value = max; + bar->min_value = min; if(lv_bar_get_mode(obj) != LV_BAR_MODE_RANGE) - bar->start_value = real_min; + bar->start_value = min; - if(bar->cur_value > real_max) { - bar->cur_value = real_max; + if(bar->cur_value > max) { + bar->cur_value = max; lv_bar_set_value(obj, bar->cur_value, LV_ANIM_OFF); } - if(bar->cur_value < real_min) { - bar->cur_value = real_min; + if(bar->cur_value < min) { + bar->cur_value = min; lv_bar_set_value(obj, bar->cur_value, LV_ANIM_OFF); } - lv_obj_invalidate(obj); } @@ -168,15 +156,6 @@ void lv_bar_set_mode(lv_obj_t * obj, lv_bar_mode_t mode) lv_obj_invalidate(obj); } -void lv_bar_set_orientation(lv_obj_t * obj, lv_bar_orientation_t orientation) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_bar_t * bar = (lv_bar_t *)obj; - - bar->orientation = orientation; - lv_obj_invalidate(obj); -} - /*===================== * Getter functions *====================*/ @@ -203,7 +182,7 @@ int32_t lv_bar_get_min_value(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_bar_t * bar = (lv_bar_t *)obj; - return bar->val_reversed ? bar->max_value : bar->min_value; + return bar->min_value; } int32_t lv_bar_get_max_value(const lv_obj_t * obj) @@ -211,7 +190,7 @@ int32_t lv_bar_get_max_value(const lv_obj_t * obj) LV_ASSERT_OBJ(obj, MY_CLASS); lv_bar_t * bar = (lv_bar_t *)obj; - return bar->val_reversed ? bar->min_value : bar->max_value; + return bar->max_value; } lv_bar_mode_t lv_bar_get_mode(lv_obj_t * obj) @@ -222,23 +201,6 @@ lv_bar_mode_t lv_bar_get_mode(lv_obj_t * obj) return bar->mode; } -lv_bar_orientation_t lv_bar_get_orientation(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_bar_t * bar = (lv_bar_t *)obj; - - return bar->orientation; -} - -bool lv_bar_is_symmetrical(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_bar_t * bar = (lv_bar_t *)obj; - - return bar->mode == LV_BAR_MODE_SYMMETRICAL && bar->min_value < 0 && bar->max_value > 0 && - bar->start_value == bar->min_value; -} - /********************** * STATIC FUNCTIONS **********************/ @@ -258,14 +220,12 @@ static void lv_bar_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) bar->indic_area.y1 = 0; bar->indic_area.y2 = 0; bar->mode = LV_BAR_MODE_NORMAL; - bar->orientation = LV_BAR_ORIENTATION_AUTO; - bar->val_reversed = false; lv_bar_init_anim(obj, &bar->cur_value_anim); lv_bar_init_anim(obj, &bar->start_value_anim); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_CHECKABLE); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_CHECKABLE); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); lv_bar_set_value(obj, 0, LV_ANIM_OFF); LV_TRACE_OBJ_CREATE("finished"); @@ -276,54 +236,39 @@ static void lv_bar_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) LV_UNUSED(class_p); lv_bar_t * bar = (lv_bar_t *)obj; - lv_anim_delete(&bar->cur_value_anim, NULL); - lv_anim_delete(&bar->start_value_anim, NULL); + lv_anim_del(&bar->cur_value_anim, NULL); + lv_anim_del(&bar->start_value_anim, NULL); } static void draw_indic(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_bar_t * bar = (lv_bar_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); lv_area_t bar_coords; lv_obj_get_coords(obj, &bar_coords); - int32_t transf_w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN); - int32_t transf_h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN); - lv_area_increase(&bar_coords, transf_w, transf_h); - int32_t barw = lv_area_get_width(&bar_coords); - int32_t barh = lv_area_get_height(&bar_coords); + lv_coord_t transf_w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN); + lv_coord_t transf_h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN); + bar_coords.x1 -= transf_w; + bar_coords.x2 += transf_w; + bar_coords.y1 -= transf_h; + bar_coords.y2 += transf_h; + lv_coord_t barw = lv_area_get_width(&bar_coords); + lv_coord_t barh = lv_area_get_height(&bar_coords); int32_t range = bar->max_value - bar->min_value; - - /*Prevent division by 0*/ - if(range == 0) { - range = 1; - } - - bool hor = false; - switch(bar->orientation) { - case LV_BAR_ORIENTATION_HORIZONTAL: - hor = true; - break; - case LV_BAR_ORIENTATION_VERTICAL: - hor = false; - break; - case LV_BAR_ORIENTATION_AUTO: - default: - hor = (barw >= barh); - break; - } - - bool sym = lv_bar_is_symmetrical(obj); + bool hor = barw >= barh ? true : false; + bool sym = false; + if(bar->mode == LV_BAR_MODE_SYMMETRICAL && bar->min_value < 0 && bar->max_value > 0 && + bar->start_value == bar->min_value) sym = true; /*Calculate the indicator area*/ - int32_t bg_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t bg_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); - int32_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); - + lv_coord_t bg_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t bg_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); /*Respect padding and minimum width/height too*/ lv_area_copy(&bar->indic_area, &bar_coords); bar->indic_area.x1 += bg_left; @@ -339,16 +284,17 @@ static void draw_indic(lv_event_t * e) bar->indic_area.x1 = obj->coords.x1 + (barw / 2) - (LV_BAR_SIZE_MIN / 2); bar->indic_area.x2 = bar->indic_area.x1 + LV_BAR_SIZE_MIN; } - int32_t indic_max_w = lv_area_get_width(&bar->indic_area); - int32_t indic_max_h = lv_area_get_height(&bar->indic_area); + + lv_coord_t indicw = lv_area_get_width(&bar->indic_area); + lv_coord_t indich = lv_area_get_height(&bar->indic_area); /*Calculate the indicator length*/ - int32_t anim_length = hor ? indic_max_w : indic_max_h; + lv_coord_t anim_length = hor ? indicw : indich; - int32_t anim_cur_value_x, anim_start_value_x; + lv_coord_t anim_cur_value_x, anim_start_value_x; - int32_t * axis1, * axis2; - int32_t (*indic_length_calc)(const lv_area_t * area); + lv_coord_t * axis1, * axis2; + lv_coord_t (*indic_length_calc)(const lv_area_t * area); if(hor) { axis1 = &bar->indic_area.x1; @@ -362,9 +308,9 @@ static void draw_indic(lv_event_t * e) } if(LV_BAR_IS_ANIMATING(bar->start_value_anim)) { - int32_t anim_start_value_start_x = + lv_coord_t anim_start_value_start_x = (int32_t)((int32_t)anim_length * (bar->start_value_anim.anim_start - bar->min_value)) / range; - int32_t anim_start_value_end_x = + lv_coord_t anim_start_value_end_x = (int32_t)((int32_t)anim_length * (bar->start_value_anim.anim_end - bar->min_value)) / range; anim_start_value_x = (((anim_start_value_end_x - anim_start_value_start_x) * bar->start_value_anim.anim_state) / @@ -377,9 +323,9 @@ static void draw_indic(lv_event_t * e) } if(LV_BAR_IS_ANIMATING(bar->cur_value_anim)) { - int32_t anim_cur_value_start_x = + lv_coord_t anim_cur_value_start_x = (int32_t)((int32_t)anim_length * (bar->cur_value_anim.anim_start - bar->min_value)) / range; - int32_t anim_cur_value_end_x = + lv_coord_t anim_cur_value_end_x = (int32_t)((int32_t)anim_length * (bar->cur_value_anim.anim_end - bar->min_value)) / range; anim_cur_value_x = anim_cur_value_start_x + (((anim_cur_value_end_x - anim_cur_value_start_x) * @@ -390,17 +336,10 @@ static void draw_indic(lv_event_t * e) anim_cur_value_x = (int32_t)((int32_t)anim_length * (bar->cur_value - bar->min_value)) / range; } - /** - * The drawing direction of the bar can be reversed only when one of the two conditions(value inversion - * or horizontal direction base dir is LV_BASE_DIR_RTL) is met. - */ lv_base_dir_t base_dir = lv_obj_get_style_base_dir(obj, LV_PART_MAIN); - bool hor_need_reversed = hor && base_dir == LV_BASE_DIR_RTL; - bool reversed = bar->val_reversed ^ hor_need_reversed; - - if(reversed) { + if(hor && base_dir == LV_BASE_DIR_RTL) { /*Swap axes*/ - int32_t * tmp; + lv_coord_t * tmp; tmp = axis1; axis1 = axis2; axis2 = tmp; @@ -417,50 +356,47 @@ static void draw_indic(lv_event_t * e) *axis1 = *axis2 - anim_cur_value_x + 1; *axis2 -= anim_start_value_x; } - if(sym) { - int32_t zero, shift; + lv_coord_t zero, shift; shift = (-bar->min_value * anim_length) / range; - if(hor) { - int32_t * left = reversed ? axis2 : axis1; - int32_t * right = reversed ? axis1 : axis2; - if(reversed) - zero = *axis1 - shift + 1; - else - zero = *axis1 + shift; - - if(*axis2 > zero) { - *right = *axis2; - *left = zero; - } + zero = *axis1 + shift; + if(*axis2 > zero) + *axis1 = zero; else { - *left = *axis2; - *right = zero; + *axis1 = *axis2; + *axis2 = zero; } } else { - int32_t * top = reversed ? axis2 : axis1; - int32_t * bottom = reversed ? axis1 : axis2; - if(reversed) - zero = *axis2 + shift; - else - zero = *axis2 - shift + 1; - - if(*axis1 > zero) { - *bottom = *axis1; - *top = zero; - } + zero = *axis2 - shift + 1; + if(*axis1 > zero) + *axis2 = zero; else { - *top = *axis1; - *bottom = zero; + *axis2 = *axis1; + *axis1 = zero; + } + if(*axis2 < *axis1) { + /*swap*/ + zero = *axis1; + *axis1 = *axis2; + *axis2 = zero; } } } - /*Do not draw a zero length indicator but at least call the draw task event*/ + /*Do not draw a zero length indicator but at least call the draw part events*/ if(!sym && indic_length_calc(&bar->indic_area) <= 1) { - lv_obj_send_event(obj, LV_EVENT_DRAW_TASK_ADDED, NULL); + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.part = LV_PART_INDICATOR; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_BAR_DRAW_PART_INDICATOR; + part_draw_dsc.draw_area = &bar->indic_area; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); return; } @@ -471,150 +407,134 @@ static void draw_indic(lv_event_t * e) lv_draw_rect_dsc_init(&draw_rect_dsc); lv_obj_init_draw_rect_dsc(obj, LV_PART_INDICATOR, &draw_rect_dsc); - int32_t bg_radius = lv_obj_get_style_radius(obj, LV_PART_MAIN); - int32_t short_side = LV_MIN(barw, barh); - if(bg_radius > short_side >> 1) bg_radius = short_side >> 1; + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.part = LV_PART_INDICATOR; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_BAR_DRAW_PART_INDICATOR; + part_draw_dsc.rect_dsc = &draw_rect_dsc; + part_draw_dsc.draw_area = &bar->indic_area; - int32_t indic_radius = draw_rect_dsc.radius; - short_side = LV_MIN(lv_area_get_width(&bar->indic_area), lv_area_get_height(&bar->indic_area)); - if(indic_radius > short_side >> 1) indic_radius = short_side >> 1; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); - /*Cases: - * Simple: - * - indicator area is the same or smaller then the bg - * - indicator has the same or larger radius than the bg - * - what to do? just draw the indicator - * Radius issue: - * - indicator area is the same or smaller then bg - * - indicator has smaller radius than the bg and the indicator overflows on the corners - * - what to do? draw the indicator on a layer and clip to bg radius - * Larger indicator: - * - indicator area is the larger then the bg - * - radius doesn't matter - * - shadow doesn't matter - * - what to do? just draw the indicator - * Shadow: - * - indicator area is the same or smaller then the bg - * - indicator has the same or larger radius than the bg (shadow needs to be drawn on strange clipped shape) - * - what to do? don't draw the shadow if the indicator is too small has strange shape - * Gradient: - * - the indicator has a gradient - * - what to do? draw it on a bg sized layer clip the indicator are from the gradient - * - */ - - bool mask_needed = false; - if(hor && draw_rect_dsc.bg_grad.dir == LV_GRAD_DIR_HOR) mask_needed = true; - else if(!hor && draw_rect_dsc.bg_grad.dir == LV_GRAD_DIR_VER) mask_needed = true; - - if(draw_rect_dsc.bg_image_src) mask_needed = true; - - bool radius_issue = true; - /*The indicator is fully drawn if it's larger than the bg*/ - if((bg_left < 0 || bg_right < 0 || bg_top < 0 || bg_bottom < 0)) radius_issue = false; - else if(indic_radius >= bg_radius) radius_issue = false; - else if(lv_area_is_in(&indic_area, &bar_coords, bg_radius)) radius_issue = false; - - if(radius_issue || mask_needed) { - if(!radius_issue) { - /*Draw only the shadow*/ - lv_draw_rect_dsc_t draw_tmp_dsc = draw_rect_dsc; - draw_tmp_dsc.border_opa = 0; - draw_tmp_dsc.outline_opa = 0; - draw_tmp_dsc.bg_opa = 0; - draw_tmp_dsc.bg_image_opa = 0; - lv_draw_rect(layer, &draw_tmp_dsc, &indic_area); - } - else { - draw_rect_dsc.border_opa = 0; - draw_rect_dsc.outline_opa = 0; - } - draw_rect_dsc.shadow_opa = 0; - - /*If clipped for any reason cannot the border, outline, and shadow - *as they would be clipped and looked ugly*/ - lv_draw_rect_dsc_t draw_tmp_dsc = draw_rect_dsc; - draw_tmp_dsc.border_opa = 0; - draw_tmp_dsc.outline_opa = 0; - draw_tmp_dsc.shadow_opa = 0; - lv_area_t indic_draw_area = indic_area; - if(mask_needed) { - if(hor) { - indic_draw_area.x1 = bar_coords.x1 + bg_left; - indic_draw_area.x2 = bar_coords.x2 - bg_right; - } - else { - indic_draw_area.y1 = bar_coords.y1 + bg_top; - indic_draw_area.y2 = bar_coords.y2 - bg_bottom; - } - draw_tmp_dsc.radius = 0; - } + lv_coord_t bg_radius = lv_obj_get_style_radius(obj, LV_PART_MAIN); + lv_coord_t short_side = LV_MIN(barw, barh); + if(bg_radius > short_side >> 1) bg_radius = short_side >> 1; - lv_layer_t * layer_indic = lv_draw_layer_create(layer, LV_COLOR_FORMAT_ARGB8888, &indic_draw_area); + lv_coord_t indic_radius = draw_rect_dsc.radius; + short_side = LV_MIN(indicw, indich); + if(indic_radius > short_side >> 1) indic_radius = short_side >> 1; - lv_draw_rect(layer_indic, &draw_tmp_dsc, &indic_draw_area); + /*Draw only the shadow and outline only if the indicator is long enough. + *The radius of the bg and the indicator can make a strange shape where + *it'd be very difficult to draw shadow.*/ + if((hor && lv_area_get_width(&bar->indic_area) > indic_radius * 2) || + (!hor && lv_area_get_height(&bar->indic_area) > indic_radius * 2)) { + lv_opa_t bg_opa = draw_rect_dsc.bg_opa; + lv_opa_t bg_img_opa = draw_rect_dsc.bg_img_opa; + lv_opa_t border_opa = draw_rect_dsc.border_opa; + draw_rect_dsc.bg_opa = LV_OPA_TRANSP; + draw_rect_dsc.bg_img_opa = LV_OPA_TRANSP; + draw_rect_dsc.border_opa = LV_OPA_TRANSP; + + lv_draw_rect(draw_ctx, &draw_rect_dsc, &bar->indic_area); + + draw_rect_dsc.bg_opa = bg_opa; + draw_rect_dsc.bg_img_opa = bg_img_opa; + draw_rect_dsc.border_opa = border_opa; + } - lv_draw_mask_rect_dsc_t mask_dsc; - lv_draw_mask_rect_dsc_init(&mask_dsc); - if(radius_issue) { - mask_dsc.area = bar_coords; - mask_dsc.radius = bg_radius; - lv_draw_mask_rect(layer_indic, &mask_dsc); - } +#if LV_DRAW_COMPLEX + lv_draw_mask_radius_param_t mask_bg_param; + lv_area_t bg_mask_area; + bg_mask_area.x1 = obj->coords.x1 + bg_left; + bg_mask_area.x2 = obj->coords.x2 - bg_right; + bg_mask_area.y1 = obj->coords.y1 + bg_top; + bg_mask_area.y2 = obj->coords.y2 - bg_bottom; - if(mask_needed) { - mask_dsc.area = indic_area; - mask_dsc.radius = indic_radius; - lv_draw_mask_rect(layer_indic, &mask_dsc); - } + lv_draw_mask_radius_init(&mask_bg_param, &bg_mask_area, bg_radius, false); + lv_coord_t mask_bg_id = lv_draw_mask_add(&mask_bg_param, NULL); +#endif - lv_draw_image_dsc_t layer_draw_dsc; - lv_draw_image_dsc_init(&layer_draw_dsc); - layer_draw_dsc.src = layer_indic; - lv_draw_layer(layer, &layer_draw_dsc, &indic_draw_area); - - /*Add the border, outline, and shadow only to the indicator area. - *They might have disabled if there is a radius_issue*/ - draw_tmp_dsc = draw_rect_dsc; - draw_tmp_dsc.bg_opa = 0; - draw_tmp_dsc.bg_image_opa = 0; - lv_draw_rect(layer, &draw_tmp_dsc, &indic_area); + /*Draw_only the background and background image*/ + lv_opa_t shadow_opa = draw_rect_dsc.shadow_opa; + lv_opa_t border_opa = draw_rect_dsc.border_opa; + draw_rect_dsc.border_opa = LV_OPA_TRANSP; + draw_rect_dsc.shadow_opa = LV_OPA_TRANSP; + + /*Get the max possible indicator area. The gradient should be applied on this*/ + lv_area_t mask_indic_max_area; + lv_area_copy(&mask_indic_max_area, &bar_coords); + mask_indic_max_area.x1 += bg_left; + mask_indic_max_area.y1 += bg_top; + mask_indic_max_area.x2 -= bg_right; + mask_indic_max_area.y2 -= bg_bottom; + if(hor && lv_area_get_height(&mask_indic_max_area) < LV_BAR_SIZE_MIN) { + mask_indic_max_area.y1 = obj->coords.y1 + (barh / 2) - (LV_BAR_SIZE_MIN / 2); + mask_indic_max_area.y2 = mask_indic_max_area.y1 + LV_BAR_SIZE_MIN; } - else { - lv_draw_rect(layer, &draw_rect_dsc, &indic_area); + else if(!hor && lv_area_get_width(&mask_indic_max_area) < LV_BAR_SIZE_MIN) { + mask_indic_max_area.x1 = obj->coords.x1 + (barw / 2) - (LV_BAR_SIZE_MIN / 2); + mask_indic_max_area.x2 = mask_indic_max_area.x1 + LV_BAR_SIZE_MIN; } + +#if LV_DRAW_COMPLEX + /*Create a mask to the current indicator area to see only this part from the whole gradient.*/ + lv_draw_mask_radius_param_t mask_indic_param; + lv_draw_mask_radius_init(&mask_indic_param, &bar->indic_area, draw_rect_dsc.radius, false); + int16_t mask_indic_id = lv_draw_mask_add(&mask_indic_param, NULL); +#endif + + lv_draw_rect(draw_ctx, &draw_rect_dsc, &mask_indic_max_area); + draw_rect_dsc.border_opa = border_opa; + draw_rect_dsc.shadow_opa = shadow_opa; + + /*Draw the border*/ + draw_rect_dsc.bg_opa = LV_OPA_TRANSP; + draw_rect_dsc.bg_img_opa = LV_OPA_TRANSP; + draw_rect_dsc.shadow_opa = LV_OPA_TRANSP; + lv_draw_rect(draw_ctx, &draw_rect_dsc, &bar->indic_area); + +#if LV_DRAW_COMPLEX + lv_draw_mask_free_param(&mask_indic_param); + lv_draw_mask_free_param(&mask_bg_param); + lv_draw_mask_remove_id(mask_indic_id); + lv_draw_mask_remove_id(mask_bg_id); +#endif + + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); } static void lv_bar_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /*Call the ancestor's event handler*/ res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { - int32_t indic_size; + lv_coord_t indic_size; indic_size = lv_obj_calculate_ext_draw_size(obj, LV_PART_INDICATOR); /*Bg size is handled by lv_obj*/ - int32_t * s = lv_event_get_param(e); + lv_coord_t * s = lv_event_get_param(e); *s = LV_MAX(*s, indic_size); /*Calculate the indicator area*/ - int32_t bg_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t bg_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); - int32_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); + lv_coord_t bg_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t bg_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); - int32_t pad = LV_MIN4(bg_left, bg_right, bg_top, bg_bottom); + lv_coord_t pad = LV_MIN4(bg_left, bg_right, bg_top, bg_bottom); if(pad < 0) { - *s = *s - pad; + *s = LV_MAX(*s, -pad); } } else if(code == LV_EVENT_PRESSED || code == LV_EVENT_RELEASED) { @@ -628,14 +548,14 @@ static void lv_bar_event(const lv_obj_class_t * class_p, lv_event_t * e) static void lv_bar_anim(void * var, int32_t value) { - lv_bar_anim_t * bar_anim = var; + _lv_bar_anim_t * bar_anim = var; bar_anim->anim_state = value; lv_obj_invalidate(bar_anim->bar); } -static void lv_bar_anim_completed(lv_anim_t * a) +static void lv_bar_anim_ready(lv_anim_t * a) { - lv_bar_anim_t * var = a->var; + _lv_bar_anim_t * var = a->var; lv_obj_t * obj = (lv_obj_t *)var->bar; lv_bar_t * bar = (lv_bar_t *)obj; @@ -648,18 +568,13 @@ static void lv_bar_anim_completed(lv_anim_t * a) } static void lv_bar_set_value_with_anim(lv_obj_t * obj, int32_t new_value, int32_t * value_ptr, - lv_bar_anim_t * anim_info, lv_anim_enable_t en) + _lv_bar_anim_t * anim_info, lv_anim_enable_t en) { if(en == LV_ANIM_OFF) { - lv_anim_delete(anim_info, NULL); + lv_anim_del(anim_info, NULL); anim_info->anim_state = LV_BAR_ANIM_STATE_INV; *value_ptr = new_value; lv_obj_invalidate((lv_obj_t *)obj); - - /*Stop the previous animation if it exists*/ - lv_anim_delete(anim_info, NULL); - /*Reset animation state*/ - lv_bar_init_anim(obj, anim_info); } else { /*No animation in progress -> simply set the values*/ @@ -674,20 +589,20 @@ static void lv_bar_set_value_with_anim(lv_obj_t * obj, int32_t new_value, int32_ } *value_ptr = new_value; /*Stop the previous animation if it exists*/ - lv_anim_delete(anim_info, NULL); + lv_anim_del(anim_info, NULL); lv_anim_t a; lv_anim_init(&a); lv_anim_set_var(&a, anim_info); lv_anim_set_exec_cb(&a, lv_bar_anim); lv_anim_set_values(&a, LV_BAR_ANIM_STATE_START, LV_BAR_ANIM_STATE_END); - lv_anim_set_completed_cb(&a, lv_bar_anim_completed); - lv_anim_set_duration(&a, lv_obj_get_style_anim_duration(obj, LV_PART_MAIN)); + lv_anim_set_ready_cb(&a, lv_bar_anim_ready); + lv_anim_set_time(&a, lv_obj_get_style_anim_time(obj, LV_PART_MAIN)); lv_anim_start(&a); } } -static void lv_bar_init_anim(lv_obj_t * obj, lv_bar_anim_t * bar_anim) +static void lv_bar_init_anim(lv_obj_t * obj, _lv_bar_anim_t * bar_anim) { bar_anim->bar = obj; bar_anim->anim_start = 0; diff --git a/L3_Middlewares/LVGL/src/widgets/bar/lv_bar.h b/L3_Middlewares/LVGL/src/widgets/lv_bar.h similarity index 60% rename from L3_Middlewares/LVGL/src/widgets/bar/lv_bar.h rename to L3_Middlewares/LVGL/src/widgets/lv_bar.h index 93c8878..1726425 100644 --- a/L3_Middlewares/LVGL/src/widgets/bar/lv_bar.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_bar.h @@ -13,13 +13,14 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" +#include "../lv_conf_internal.h" #if LV_USE_BAR != 0 -#include "../../core/lv_obj.h" -#include "../../misc/lv_anim.h" -#include "../label/lv_label.h" +#include "../core/lv_obj.h" +#include "../misc/lv_anim.h" +#include "lv_btn.h" +#include "lv_label.h" /********************* * DEFINES @@ -28,19 +29,42 @@ extern "C" { /********************** * TYPEDEFS **********************/ -typedef enum { + +enum { LV_BAR_MODE_NORMAL, LV_BAR_MODE_SYMMETRICAL, LV_BAR_MODE_RANGE -} lv_bar_mode_t; +}; +typedef uint8_t lv_bar_mode_t; + +typedef struct { + lv_obj_t * bar; + int32_t anim_start; + int32_t anim_end; + int32_t anim_state; +} _lv_bar_anim_t; + +typedef struct { + lv_obj_t obj; + int32_t cur_value; /**< Current value of the bar*/ + int32_t min_value; /**< Minimum value of the bar*/ + int32_t max_value; /**< Maximum value of the bar*/ + int32_t start_value; /**< Start value of the bar*/ + lv_area_t indic_area; /**< Save the indicator area. Might be used by derived types*/ + _lv_bar_anim_t cur_value_anim; + _lv_bar_anim_t start_value_anim; + lv_bar_mode_t mode : 2; /**< Type of bar*/ +} lv_bar_t; + +extern const lv_obj_class_t lv_bar_class; +/** + * `type` field in `lv_obj_draw_part_dsc_t` if `class_p = lv_bar_class` + * Used in `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` + */ typedef enum { - LV_BAR_ORIENTATION_AUTO, - LV_BAR_ORIENTATION_HORIZONTAL, - LV_BAR_ORIENTATION_VERTICAL -} lv_bar_orientation_t; - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_bar_class; + LV_BAR_DRAW_PART_INDICATOR, /**< The indicator*/ +} lv_bar_draw_part_type_t; /********************** * GLOBAL PROTOTYPES @@ -48,8 +72,8 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_bar_class; /** * Create a bar object - * @param parent pointer to an object, it will be the parent of the new bar - * @return pointer to the created bar + * @param parent pointer to an object, it will be the parent of the new bar + * @return pointer to the created bar */ lv_obj_t * lv_bar_create(lv_obj_t * parent); @@ -59,17 +83,17 @@ lv_obj_t * lv_bar_create(lv_obj_t * parent); /** * Set a new value on the bar - * @param obj pointer to a bar object - * @param value new value - * @param anim LV_ANIM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately + * @param bar pointer to a bar object + * @param value new value + * @param anim LV_ANIM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately */ void lv_bar_set_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim); /** * Set a new start value on the bar - * @param obj pointer to a bar object - * @param start_value new start value - * @param anim LV_ANIM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately + * @param obj pointer to a bar object + * @param value new start value + * @param anim LV_ANIM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately */ void lv_bar_set_start_value(lv_obj_t * obj, int32_t start_value, lv_anim_enable_t anim); @@ -78,7 +102,6 @@ void lv_bar_set_start_value(lv_obj_t * obj, int32_t start_value, lv_anim_enable_ * @param obj pointer to the bar object * @param min minimum value * @param max maximum value - * @note If min is greater than max, the drawing direction becomes to the opposite direction. */ void lv_bar_set_range(lv_obj_t * obj, int32_t min, int32_t max); @@ -89,13 +112,6 @@ void lv_bar_set_range(lv_obj_t * obj, int32_t min, int32_t max); */ void lv_bar_set_mode(lv_obj_t * obj, lv_bar_mode_t mode); -/** - * Set the orientation of bar. - * @param obj pointer to bar object - * @param orientation bar orientation from `lv_bar_orientation_t` - */ -void lv_bar_set_orientation(lv_obj_t * obj, lv_bar_orientation_t orientation); - /*===================== * Getter functions *====================*/ @@ -135,20 +151,6 @@ int32_t lv_bar_get_max_value(const lv_obj_t * obj); */ lv_bar_mode_t lv_bar_get_mode(lv_obj_t * obj); -/** - * Get the orientation of bar. - * @param obj pointer to bar object - * @return bar orientation from ::lv_bar_orientation_t - */ -lv_bar_orientation_t lv_bar_get_orientation(lv_obj_t * obj); - -/** - * Give the bar is in symmetrical mode or not - * @param obj pointer to bar object - * @return true: in symmetrical mode false : not in -*/ -bool lv_bar_is_symmetrical(lv_obj_t * obj); - /********************** * MACROS **********************/ diff --git a/L3_Middlewares/LVGL/src/widgets/button/lv_button.c b/L3_Middlewares/LVGL/src/widgets/lv_btn.c similarity index 63% rename from L3_Middlewares/LVGL/src/widgets/button/lv_button.c rename to L3_Middlewares/LVGL/src/widgets/lv_btn.c index 096dc29..5676dc7 100644 --- a/L3_Middlewares/LVGL/src/widgets/button/lv_button.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_btn.c @@ -7,14 +7,15 @@ * INCLUDES *********************/ -#include "lv_button_private.h" -#include "../../core/lv_obj_class_private.h" -#if LV_USE_BUTTON != 0 +#include "lv_btn.h" +#if LV_USE_BTN != 0 + +#include "../extra/layouts/flex/lv_flex.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_button_class) +#define MY_CLASS &lv_btn_class /********************** * TYPEDEFS @@ -23,19 +24,18 @@ /********************** * STATIC PROTOTYPES **********************/ -static void lv_button_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_btn_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); /********************** * STATIC VARIABLES **********************/ -const lv_obj_class_t lv_button_class = { - .constructor_cb = lv_button_constructor, +const lv_obj_class_t lv_btn_class = { + .constructor_cb = lv_btn_constructor, .width_def = LV_SIZE_CONTENT, .height_def = LV_SIZE_CONTENT, .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, - .instance_size = sizeof(lv_button_t), - .base_class = &lv_obj_class, - .name = "btn", + .instance_size = sizeof(lv_btn_t), + .base_class = &lv_obj_class }; /********************** @@ -46,7 +46,7 @@ const lv_obj_class_t lv_button_class = { * GLOBAL FUNCTIONS **********************/ -lv_obj_t * lv_button_create(lv_obj_t * parent) +lv_obj_t * lv_btn_create(lv_obj_t * parent) { LV_LOG_INFO("begin"); lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); @@ -58,12 +58,12 @@ lv_obj_t * lv_button_create(lv_obj_t * parent) * STATIC FUNCTIONS **********************/ -static void lv_button_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +static void lv_btn_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { LV_UNUSED(class_p); LV_TRACE_OBJ_CREATE("begin"); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); LV_TRACE_OBJ_CREATE("finished"); diff --git a/L3_Middlewares/LVGL/src/widgets/button/lv_button.h b/L3_Middlewares/LVGL/src/widgets/lv_btn.h similarity index 58% rename from L3_Middlewares/LVGL/src/widgets/button/lv_button.h rename to L3_Middlewares/LVGL/src/widgets/lv_btn.h index eb7a0a5..1d471f9 100644 --- a/L3_Middlewares/LVGL/src/widgets/button/lv_button.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_btn.h @@ -1,10 +1,10 @@ /** - * @file lv_button.h + * @file lv_btn.h * */ -#ifndef LV_BUTTON_H -#define LV_BUTTON_H +#ifndef LV_BTN_H +#define LV_BTN_H #ifdef __cplusplus extern "C" { @@ -13,16 +13,24 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" +#include "../lv_conf_internal.h" -#if LV_USE_BUTTON != 0 -#include "../../core/lv_obj.h" +#if LV_USE_BTN != 0 +#include "../core/lv_obj.h" /********************* * DEFINES *********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_button_class; +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_obj_t obj; +} lv_btn_t; + +extern const lv_obj_class_t lv_btn_class; /********************** * GLOBAL PROTOTYPES @@ -33,16 +41,16 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_button_class; * @param parent pointer to an object, it will be the parent of the new button * @return pointer to the created button */ -lv_obj_t * lv_button_create(lv_obj_t * parent); +lv_obj_t * lv_btn_create(lv_obj_t * parent); /********************** * MACROS **********************/ -#endif /*LV_USE_BUTTON*/ +#endif /*LV_USE_BTN*/ #ifdef __cplusplus } /*extern "C"*/ #endif -#endif /*LV_BUTTON_H*/ +#endif /*LV_BTN_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/buttonmatrix/lv_buttonmatrix.c b/L3_Middlewares/LVGL/src/widgets/lv_btnmatrix.c similarity index 56% rename from L3_Middlewares/LVGL/src/widgets/buttonmatrix/lv_buttonmatrix.c rename to L3_Middlewares/LVGL/src/widgets/lv_btnmatrix.c index e20ac2e..fd14e56 100644 --- a/L3_Middlewares/LVGL/src/widgets/buttonmatrix/lv_buttonmatrix.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_btnmatrix.c @@ -6,28 +6,24 @@ /********************* * INCLUDES *********************/ -#include "lv_buttonmatrix_private.h" -#include "../../misc/lv_area_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_class_private.h" -#if LV_USE_BUTTONMATRIX != 0 - -#include "../../misc/lv_assert.h" -#include "../../indev/lv_indev.h" -#include "../../core/lv_group.h" -#include "../../draw/lv_draw.h" -#include "../../core/lv_refr.h" -#include "../../misc/lv_text.h" -#include "../../misc/lv_text_ap.h" -#include "../../stdlib/lv_string.h" +#include "lv_btnmatrix.h" +#if LV_USE_BTNMATRIX != 0 + +#include "../misc/lv_assert.h" +#include "../core/lv_indev.h" +#include "../core/lv_group.h" +#include "../draw/lv_draw.h" +#include "../core/lv_refr.h" +#include "../misc/lv_txt.h" +#include "../misc/lv_txt_ap.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_buttonmatrix_class) +#define MY_CLASS &lv_btnmatrix_class #define BTN_EXTRA_CLICK_AREA_MAX (LV_DPI_DEF / 10) -#define LV_BUTTONMATRIX_WIDTH_MASK 0x000F +#define LV_BTNMATRIX_WIDTH_MASK 0x000F /********************** * TYPEDEFS @@ -36,44 +32,42 @@ /********************** * STATIC PROTOTYPES **********************/ -static void lv_buttonmatrix_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_buttonmatrix_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e); +static void lv_btnmatrix_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_btnmatrix_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_btnmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e); static void draw_main(lv_event_t * e); -static uint32_t get_button_width(lv_buttonmatrix_ctrl_t ctrl_bits); -static bool button_is_hidden(lv_buttonmatrix_ctrl_t ctrl_bits); -static bool button_is_checked(lv_buttonmatrix_ctrl_t ctrl_bits); -static bool button_is_repeat_disabled(lv_buttonmatrix_ctrl_t ctrl_bits); -static bool button_is_inactive(lv_buttonmatrix_ctrl_t ctrl_bits); -static bool button_is_click_trig(lv_buttonmatrix_ctrl_t ctrl_bits); -static bool button_is_popover(lv_buttonmatrix_ctrl_t ctrl_bits); -static bool button_is_checkable(lv_buttonmatrix_ctrl_t ctrl_bits); -static bool button_get_checked(lv_buttonmatrix_ctrl_t ctrl_bits); -static uint32_t get_button_from_point(lv_obj_t * obj, lv_point_t * p); -static void allocate_button_areas_and_controls(const lv_obj_t * obj, const char * const * map); -static void invalidate_button_area(const lv_obj_t * obj, uint32_t btn_idx); -static void make_one_button_checked(lv_obj_t * obj, uint32_t btn_idx); +static uint8_t get_button_width(lv_btnmatrix_ctrl_t ctrl_bits); +static bool button_is_hidden(lv_btnmatrix_ctrl_t ctrl_bits); +static bool button_is_checked(lv_btnmatrix_ctrl_t ctrl_bits); +static bool button_is_repeat_disabled(lv_btnmatrix_ctrl_t ctrl_bits); +static bool button_is_inactive(lv_btnmatrix_ctrl_t ctrl_bits); +static bool button_is_click_trig(lv_btnmatrix_ctrl_t ctrl_bits); +static bool button_is_popover(lv_btnmatrix_ctrl_t ctrl_bits); +static bool button_is_checkable(lv_btnmatrix_ctrl_t ctrl_bits); +static bool button_is_recolor(lv_btnmatrix_ctrl_t ctrl_bits); +static bool button_get_checked(lv_btnmatrix_ctrl_t ctrl_bits); +static uint16_t get_button_from_point(lv_obj_t * obj, lv_point_t * p); +static void allocate_btn_areas_and_controls(const lv_obj_t * obj, const char ** map); +static void invalidate_button_area(const lv_obj_t * obj, uint16_t btn_idx); +static void make_one_button_checked(lv_obj_t * obj, uint16_t btn_idx); static bool has_popovers_in_top_row(lv_obj_t * obj); /********************** * STATIC VARIABLES **********************/ -#if LV_WIDGETS_HAS_DEFAULT_VALUE -static const char * const lv_buttonmatrix_def_map[] = {"Btn1", "Btn2", "Btn3", "\n", "Btn4", "Btn5", ""}; -#endif +static const char * lv_btnmatrix_def_map[] = {"Btn1", "Btn2", "Btn3", "\n", "Btn4", "Btn5", ""}; -const lv_obj_class_t lv_buttonmatrix_class = { - .constructor_cb = lv_buttonmatrix_constructor, - .destructor_cb = lv_buttonmatrix_destructor, - .event_cb = lv_buttonmatrix_event, +const lv_obj_class_t lv_btnmatrix_class = { + .constructor_cb = lv_btnmatrix_constructor, + .destructor_cb = lv_btnmatrix_destructor, + .event_cb = lv_btnmatrix_event, .width_def = LV_DPI_DEF * 2, .height_def = LV_DPI_DEF, - .instance_size = sizeof(lv_buttonmatrix_t), + .instance_size = sizeof(lv_btnmatrix_t), .editable = LV_OBJ_CLASS_EDITABLE_TRUE, .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, - .base_class = &lv_obj_class, - .name = "btnmatrix", + .base_class = &lv_obj_class }; /********************** @@ -84,7 +78,7 @@ const lv_obj_class_t lv_buttonmatrix_class = { * GLOBAL FUNCTIONS **********************/ -lv_obj_t * lv_buttonmatrix_create(lv_obj_t * parent) +lv_obj_t * lv_btnmatrix_create(lv_obj_t * parent) { LV_LOG_INFO("begin"); lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); @@ -96,44 +90,44 @@ lv_obj_t * lv_buttonmatrix_create(lv_obj_t * parent) * Setter functions *====================*/ -void lv_buttonmatrix_set_map(lv_obj_t * obj, const char * const map[]) +void lv_btnmatrix_set_map(lv_obj_t * obj, const char * map[]) { LV_ASSERT_OBJ(obj, MY_CLASS); if(map == NULL) return; - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; /*Analyze the map and create the required number of buttons*/ - allocate_button_areas_and_controls(obj, map); + allocate_btn_areas_and_controls(obj, map); btnm->map_p = map; lv_base_dir_t base_dir = lv_obj_get_style_base_dir(obj, LV_PART_MAIN); /*Set size and positions of the buttons*/ - int32_t sleft = lv_obj_get_style_space_left(obj, LV_PART_MAIN); - int32_t stop = lv_obj_get_style_space_top(obj, LV_PART_MAIN); - int32_t prow = lv_obj_get_style_pad_row(obj, LV_PART_MAIN); - int32_t pcol = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); + lv_coord_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t ptop = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t prow = lv_obj_get_style_pad_row(obj, LV_PART_MAIN); + lv_coord_t pcol = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); - int32_t max_w = lv_obj_get_content_width(obj); - int32_t max_h = lv_obj_get_content_height(obj); + lv_coord_t max_w = lv_obj_get_content_width(obj); + lv_coord_t max_h = lv_obj_get_content_height(obj); /*Calculate the position of each row*/ - int32_t max_h_no_gap = max_h - (prow * (btnm->row_cnt - 1)); + lv_coord_t max_h_no_gap = max_h - (prow * (btnm->row_cnt - 1)); /*Count the units and the buttons in a line *(A button can be 1,2,3... unit wide)*/ uint32_t txt_tot_i = 0; /*Act. index in the str map*/ uint32_t btn_tot_i = 0; /*Act. index of button areas*/ - const char * const * map_row = map; + const char ** map_row = map; /*Count the units and the buttons in a line*/ uint32_t row; for(row = 0; row < btnm->row_cnt; row++) { - uint32_t unit_cnt = 0; /*Number of units in a row*/ - uint32_t btn_cnt = 0; /*Number of buttons in a row*/ + uint16_t unit_cnt = 0; /*Number of units in a row*/ + uint16_t btn_cnt = 0; /*Number of buttons in a row*/ /*Count the buttons and units in this row*/ - while(map_row[btn_cnt] && lv_strcmp(map_row[btn_cnt], "\n") != 0 && map_row[btn_cnt][0] != '\0') { + while(map_row[btn_cnt] && strcmp(map_row[btn_cnt], "\n") != 0 && map_row[btn_cnt][0] != '\0') { unit_cnt += get_button_width(btnm->ctrl_bits[btn_tot_i + btn_cnt]); btn_cnt++; } @@ -144,11 +138,11 @@ void lv_buttonmatrix_set_map(lv_obj_t * obj, const char * const map[]) continue; } - int32_t row_y1 = stop + (max_h_no_gap * row) / btnm->row_cnt + row * prow; - int32_t row_y2 = stop + (max_h_no_gap * (row + 1)) / btnm->row_cnt + row * prow - 1; + lv_coord_t row_y1 = ptop + (max_h_no_gap * row) / btnm->row_cnt + row * prow; + lv_coord_t row_y2 = ptop + (max_h_no_gap * (row + 1)) / btnm->row_cnt + row * prow - 1; /*Set the button size and positions*/ - int32_t max_w_no_gap = max_w - (pcol * (btn_cnt - 1)); + lv_coord_t max_w_no_gap = max_w - (pcol * (btn_cnt - 1)); if(max_w_no_gap < 0) max_w_no_gap = 0; uint32_t row_unit_cnt = 0; /*The current unit position in the row*/ @@ -156,12 +150,12 @@ void lv_buttonmatrix_set_map(lv_obj_t * obj, const char * const map[]) for(btn = 0; btn < btn_cnt; btn++, btn_tot_i++, txt_tot_i++) { uint32_t btn_u = get_button_width(btnm->ctrl_bits[btn_tot_i]); - int32_t btn_x1 = (max_w_no_gap * row_unit_cnt) / unit_cnt + btn * pcol; - int32_t btn_x2 = (max_w_no_gap * (row_unit_cnt + btn_u)) / unit_cnt + btn * pcol - 1; + lv_coord_t btn_x1 = (max_w_no_gap * row_unit_cnt) / unit_cnt + btn * pcol; + lv_coord_t btn_x2 = (max_w_no_gap * (row_unit_cnt + btn_u)) / unit_cnt + btn * pcol - 1; /*If RTL start from the right*/ if(base_dir == LV_BASE_DIR_RTL) { - int32_t tmp = btn_x1; + lv_coord_t tmp = btn_x1; btn_x1 = btn_x2; btn_x2 = tmp; @@ -169,8 +163,8 @@ void lv_buttonmatrix_set_map(lv_obj_t * obj, const char * const map[]) btn_x2 = max_w - btn_x2; } - btn_x1 += sleft; - btn_x2 += sleft; + btn_x1 += pleft; + btn_x2 += pleft; lv_area_set(&btnm->button_areas[btn_tot_i], btn_x1, row_y1, btn_x2, row_y2); @@ -187,104 +181,122 @@ void lv_buttonmatrix_set_map(lv_obj_t * obj, const char * const map[]) lv_obj_invalidate(obj); } -void lv_buttonmatrix_set_ctrl_map(lv_obj_t * obj, const lv_buttonmatrix_ctrl_t ctrl_map[]) +void lv_btnmatrix_set_ctrl_map(lv_obj_t * obj, const lv_btnmatrix_ctrl_t ctrl_map[]) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; - lv_memcpy(btnm->ctrl_bits, ctrl_map, sizeof(lv_buttonmatrix_ctrl_t) * btnm->btn_cnt); + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; + lv_memcpy(btnm->ctrl_bits, ctrl_map, sizeof(lv_btnmatrix_ctrl_t) * btnm->btn_cnt); - lv_buttonmatrix_set_map(obj, btnm->map_p); + lv_btnmatrix_set_map(obj, btnm->map_p); } -void lv_buttonmatrix_set_selected_button(lv_obj_t * obj, uint32_t btn_id) +void lv_btnmatrix_set_selected_btn(lv_obj_t * obj, uint16_t btn_id) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; - if(btn_id >= btnm->btn_cnt && btn_id != LV_BUTTONMATRIX_BUTTON_NONE) return; + if(btn_id >= btnm->btn_cnt && btn_id != LV_BTNMATRIX_BTN_NONE) return; invalidate_button_area(obj, btnm->btn_id_sel); btnm->btn_id_sel = btn_id; invalidate_button_area(obj, btn_id); } -void lv_buttonmatrix_set_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl) +void lv_btnmatrix_set_btn_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; if(btn_id >= btnm->btn_cnt) return; - if(btnm->one_check && (ctrl & LV_BUTTONMATRIX_CTRL_CHECKED)) { - lv_buttonmatrix_clear_button_ctrl_all(obj, LV_BUTTONMATRIX_CTRL_CHECKED); + if(btnm->one_check && (ctrl & LV_BTNMATRIX_CTRL_CHECKED)) { + lv_btnmatrix_clear_btn_ctrl_all(obj, LV_BTNMATRIX_CTRL_CHECKED); + } + + /* If we hide a button if all buttons are now hidden hide the whole button matrix to make focus behave correctly */ + if(ctrl & LV_BTNMATRIX_CTRL_HIDDEN) { + bool all_buttons_hidden = true; + if(btnm->btn_cnt > 1) { + for(uint16_t btn_idx = 0; btn_idx < btnm->btn_cnt; btn_idx++) { + if(btn_idx == btn_id) continue; + if(!(btnm->ctrl_bits[btn_idx] & LV_BTNMATRIX_CTRL_HIDDEN)) all_buttons_hidden = false; + } + + } + if(all_buttons_hidden) lv_obj_add_flag(obj, LV_OBJ_FLAG_HIDDEN); } btnm->ctrl_bits[btn_id] |= ctrl; invalidate_button_area(obj, btn_id); - if(ctrl & LV_BUTTONMATRIX_CTRL_POPOVER) { + if(ctrl & LV_BTNMATRIX_CTRL_POPOVER) { lv_obj_refresh_ext_draw_size(obj); } } -void lv_buttonmatrix_clear_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl) +void lv_btnmatrix_clear_btn_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; if(btn_id >= btnm->btn_cnt) return; + /* If all buttons were hidden the whole button matrix is hidden so we need to check and remove hidden flag if present */ + if(ctrl & LV_BTNMATRIX_CTRL_HIDDEN) { + if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) lv_obj_clear_flag(obj, LV_OBJ_FLAG_HIDDEN); + } + btnm->ctrl_bits[btn_id] &= (~ctrl); invalidate_button_area(obj, btn_id); - if(ctrl & LV_BUTTONMATRIX_CTRL_POPOVER) { + if(ctrl & LV_BTNMATRIX_CTRL_POPOVER) { lv_obj_refresh_ext_draw_size(obj); } } -void lv_buttonmatrix_set_button_ctrl_all(lv_obj_t * obj, lv_buttonmatrix_ctrl_t ctrl) +void lv_btnmatrix_set_btn_ctrl_all(lv_obj_t * obj, lv_btnmatrix_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; - uint32_t i; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;; + uint16_t i; for(i = 0; i < btnm->btn_cnt; i++) { - lv_buttonmatrix_set_button_ctrl(obj, i, ctrl); + lv_btnmatrix_set_btn_ctrl(obj, i, ctrl); } } -void lv_buttonmatrix_clear_button_ctrl_all(lv_obj_t * obj, lv_buttonmatrix_ctrl_t ctrl) +void lv_btnmatrix_clear_btn_ctrl_all(lv_obj_t * obj, lv_btnmatrix_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; - uint32_t i; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;; + uint16_t i; for(i = 0; i < btnm->btn_cnt; i++) { - lv_buttonmatrix_clear_button_ctrl(obj, i, ctrl); + lv_btnmatrix_clear_btn_ctrl(obj, i, ctrl); } } -void lv_buttonmatrix_set_button_width(lv_obj_t * obj, uint32_t btn_id, uint32_t width) +void lv_btnmatrix_set_btn_width(lv_obj_t * obj, uint16_t btn_id, uint8_t width) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;; if(btn_id >= btnm->btn_cnt) return; - btnm->ctrl_bits[btn_id] &= (~LV_BUTTONMATRIX_WIDTH_MASK); - btnm->ctrl_bits[btn_id] |= (LV_BUTTONMATRIX_WIDTH_MASK & width); + btnm->ctrl_bits[btn_id] &= (~LV_BTNMATRIX_WIDTH_MASK); + btnm->ctrl_bits[btn_id] |= (LV_BTNMATRIX_WIDTH_MASK & width); - lv_buttonmatrix_set_map(obj, btnm->map_p); + lv_btnmatrix_set_map(obj, btnm->map_p); } -void lv_buttonmatrix_set_one_checked(lv_obj_t * obj, bool en) +void lv_btnmatrix_set_one_checked(lv_obj_t * obj, bool en) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;; btnm->one_check = en; /*If more than one button is toggled only the first one should be*/ @@ -295,40 +307,40 @@ void lv_buttonmatrix_set_one_checked(lv_obj_t * obj, bool en) * Getter functions *====================*/ -const char * const * lv_buttonmatrix_get_map(const lv_obj_t * obj) +const char ** lv_btnmatrix_get_map(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;; return btnm->map_p; } -uint32_t lv_buttonmatrix_get_selected_button(const lv_obj_t * obj) +uint16_t lv_btnmatrix_get_selected_btn(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;; return btnm->btn_id_sel; } -const char * lv_buttonmatrix_get_button_text(const lv_obj_t * obj, uint32_t btn_id) +const char * lv_btnmatrix_get_btn_text(const lv_obj_t * obj, uint16_t btn_id) { LV_ASSERT_OBJ(obj, MY_CLASS); - if(btn_id == LV_BUTTONMATRIX_BUTTON_NONE) return NULL; + if(btn_id == LV_BTNMATRIX_BTN_NONE) return NULL; - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; if(btn_id > btnm->btn_cnt) return NULL; - uint32_t txt_i = 0; - uint32_t btn_i = 0; + uint16_t txt_i = 0; + uint16_t btn_i = 0; /*Search the text of btnm->btn_pr the buttons text in the map *Skip "\n"-s*/ while(btn_i != btn_id) { btn_i++; txt_i++; - if(lv_strcmp(btnm->map_p[txt_i], "\n") == 0) txt_i++; + if(strcmp(btnm->map_p[txt_i], "\n") == 0) txt_i++; } if(btn_i == btnm->btn_cnt) return NULL; @@ -336,21 +348,21 @@ const char * lv_buttonmatrix_get_button_text(const lv_obj_t * obj, uint32_t btn_ return btnm->map_p[txt_i]; } -bool lv_buttonmatrix_has_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl) +bool lv_btnmatrix_has_btn_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;; if(btn_id >= btnm->btn_cnt) return false; - return (btnm->ctrl_bits[btn_id] & ctrl) == ctrl; + return ((btnm->ctrl_bits[btn_id] & ctrl) == ctrl) ? true : false; } -bool lv_buttonmatrix_get_one_checked(const lv_obj_t * obj) +bool lv_btnmatrix_get_one_checked(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;; return btnm->one_check; } @@ -359,79 +371,77 @@ bool lv_buttonmatrix_get_one_checked(const lv_obj_t * obj) * STATIC FUNCTIONS **********************/ -static void lv_buttonmatrix_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +static void lv_btnmatrix_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { LV_UNUSED(class_p); LV_TRACE_OBJ_CREATE("begin"); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; btnm->btn_cnt = 0; btnm->row_cnt = 0; - btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; + btnm->btn_id_sel = LV_BTNMATRIX_BTN_NONE; btnm->button_areas = NULL; btnm->ctrl_bits = NULL; btnm->map_p = NULL; btnm->one_check = 0; -#if LV_WIDGETS_HAS_DEFAULT_VALUE - lv_buttonmatrix_set_map(obj, lv_buttonmatrix_def_map); -#endif + lv_btnmatrix_set_map(obj, lv_btnmatrix_def_map); LV_TRACE_OBJ_CREATE("finished"); } -static void lv_buttonmatrix_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +static void lv_btnmatrix_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { LV_TRACE_OBJ_CREATE("begin"); LV_UNUSED(class_p); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; - lv_free(btnm->button_areas); - lv_free(btnm->ctrl_bits); + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; + lv_mem_free(btnm->button_areas); + lv_mem_free(btnm->ctrl_bits); btnm->button_areas = NULL; btnm->ctrl_bits = NULL; LV_TRACE_OBJ_CREATE("finished"); } -static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e) +static void lv_btnmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /*Call the ancestor's event handler*/ res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_obj_t * obj = lv_event_get_target(e); + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; lv_point_t p; if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { if(has_popovers_in_top_row(obj)) { /*reserve one row worth of extra space to account for popovers in the top row*/ - int32_t s = btnm->row_cnt > 0 ? lv_obj_get_content_height(obj) / btnm->row_cnt : 0; + lv_coord_t s = btnm->row_cnt > 0 ? lv_obj_get_content_height(obj) / btnm->row_cnt : 0; lv_event_set_ext_draw_size(e, s); } } if(code == LV_EVENT_STYLE_CHANGED) { - lv_buttonmatrix_set_map(obj, btnm->map_p); + lv_btnmatrix_set_map(obj, btnm->map_p); } else if(code == LV_EVENT_SIZE_CHANGED) { - lv_buttonmatrix_set_map(obj, btnm->map_p); + lv_btnmatrix_set_map(obj, btnm->map_p); } else if(code == LV_EVENT_PRESSED) { - lv_indev_t * indev = lv_event_get_indev(e); + void * param = lv_event_get_param(e); invalidate_button_area(obj, btnm->btn_id_sel); - lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_active()); + lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); if(indev_type == LV_INDEV_TYPE_POINTER || indev_type == LV_INDEV_TYPE_BUTTON) { - uint32_t btn_pr; + uint16_t btn_pr; /*Search the pressed area*/ - lv_indev_get_point(indev, &p); + lv_indev_get_point(param, &p); btn_pr = get_button_from_point(obj, &p); /*Handle the case where there is no button there*/ - btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; - if(btn_pr != LV_BUTTONMATRIX_BUTTON_NONE) { + btnm->btn_id_sel = LV_BTNMATRIX_BTN_NONE; + if(btn_pr != LV_BTNMATRIX_BTN_NONE) { if(button_is_inactive(btnm->ctrl_bits[btn_pr]) == false && button_is_hidden(btnm->ctrl_bits[btn_pr]) == false) { btnm->btn_id_sel = btn_pr; @@ -439,54 +449,76 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e } } else { - btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; + btnm->btn_id_sel = LV_BTNMATRIX_BTN_NONE; } } - if(btnm->btn_id_sel != LV_BUTTONMATRIX_BUTTON_NONE) { + if(btnm->btn_id_sel != LV_BTNMATRIX_BTN_NONE) { if(button_is_click_trig(btnm->ctrl_bits[btnm->btn_id_sel]) == false && button_is_popover(btnm->ctrl_bits[btnm->btn_id_sel]) == false && button_is_inactive(btnm->ctrl_bits[btnm->btn_id_sel]) == false && button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) == false) { uint32_t b = btnm->btn_id_sel; - res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, &b); - if(res != LV_RESULT_OK) return; + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, &b); + if(res != LV_RES_OK) return; } } } else if(code == LV_EVENT_PRESSING) { - /*If a slid to a new button, discard the current button and don't press any buttons*/ - if(btnm->btn_id_sel != LV_BUTTONMATRIX_BUTTON_NONE) { - lv_indev_t * indev = lv_event_get_indev(e); - lv_indev_get_point(indev, &p); - uint32_t btn_pr = get_button_from_point(obj, &p); - if(btn_pr != btnm->btn_id_sel) { - invalidate_button_area(obj, btnm->btn_id_sel); /*Invalidate the old area*/ - btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; + void * param = lv_event_get_param(e); + uint16_t btn_pr = LV_BTNMATRIX_BTN_NONE; + /*Search the pressed area*/ + lv_indev_t * indev = lv_indev_get_act(); + lv_indev_type_t indev_type = lv_indev_get_type(indev); + if(indev_type == LV_INDEV_TYPE_ENCODER || indev_type == LV_INDEV_TYPE_KEYPAD) return; + + lv_indev_get_point(indev, &p); + btn_pr = get_button_from_point(obj, &p); + /*Invalidate to old and the new areas*/ + if(btn_pr != btnm->btn_id_sel) { + if(btnm->btn_id_sel != LV_BTNMATRIX_BTN_NONE) { + invalidate_button_area(obj, btnm->btn_id_sel); + } + + btnm->btn_id_sel = btn_pr; + + lv_indev_reset_long_press(param); /*Start the log press time again on the new button*/ + if(btn_pr != LV_BTNMATRIX_BTN_NONE && + button_is_inactive(btnm->ctrl_bits[btn_pr]) == false && + button_is_hidden(btnm->ctrl_bits[btn_pr]) == false) { + invalidate_button_area(obj, btn_pr); + /*Send VALUE_CHANGED for the newly pressed button*/ + if(button_is_click_trig(btnm->ctrl_bits[btn_pr]) == false && + button_is_popover(btnm->ctrl_bits[btnm->btn_id_sel]) == false) { + uint32_t b = btn_pr; + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, &b); + if(res != LV_RES_OK) return; + } } } } else if(code == LV_EVENT_RELEASED) { - if(btnm->btn_id_sel != LV_BUTTONMATRIX_BUTTON_NONE) { + if(btnm->btn_id_sel != LV_BTNMATRIX_BTN_NONE) { /*Toggle the button if enabled*/ if(button_is_checkable(btnm->ctrl_bits[btnm->btn_id_sel]) && !button_is_inactive(btnm->ctrl_bits[btnm->btn_id_sel])) { if(button_get_checked(btnm->ctrl_bits[btnm->btn_id_sel]) && !btnm->one_check) { - btnm->ctrl_bits[btnm->btn_id_sel] &= (~LV_BUTTONMATRIX_CTRL_CHECKED); + btnm->ctrl_bits[btnm->btn_id_sel] &= (~LV_BTNMATRIX_CTRL_CHECKED); } else { - btnm->ctrl_bits[btnm->btn_id_sel] |= LV_BUTTONMATRIX_CTRL_CHECKED; + btnm->ctrl_bits[btnm->btn_id_sel] |= LV_BTNMATRIX_CTRL_CHECKED; } if(btnm->one_check) make_one_button_checked(obj, btnm->btn_id_sel); } + if((button_is_click_trig(btnm->ctrl_bits[btnm->btn_id_sel]) == true || button_is_popover(btnm->ctrl_bits[btnm->btn_id_sel]) == true) && button_is_inactive(btnm->ctrl_bits[btnm->btn_id_sel]) == false && button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) == false) { uint32_t b = btnm->btn_id_sel; - res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, &b); - if(res != LV_RESULT_OK) return; + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, &b); + if(res != LV_RES_OK) return; } } @@ -495,24 +527,24 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e } else if(code == LV_EVENT_LONG_PRESSED_REPEAT) { - if(btnm->btn_id_sel != LV_BUTTONMATRIX_BUTTON_NONE) { + if(btnm->btn_id_sel != LV_BTNMATRIX_BTN_NONE) { if(button_is_repeat_disabled(btnm->ctrl_bits[btnm->btn_id_sel]) == false && button_is_inactive(btnm->ctrl_bits[btnm->btn_id_sel]) == false && button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) == false) { uint32_t b = btnm->btn_id_sel; - res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, &b); - if(res != LV_RESULT_OK) return; + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, &b); + if(res != LV_RES_OK) return; } } } else if(code == LV_EVENT_PRESS_LOST) { invalidate_button_area(obj, btnm->btn_id_sel); - btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; + btnm->btn_id_sel = LV_BTNMATRIX_BTN_NONE; } else if(code == LV_EVENT_FOCUSED) { if(btnm->btn_cnt == 0) return; - lv_indev_t * indev = lv_event_get_indev(e); + lv_indev_t * indev = lv_event_get_param(e); lv_indev_type_t indev_type = lv_indev_get_type(indev); /*If not focused by an input device assume the last input device*/ @@ -523,91 +555,82 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e bool editing = lv_group_get_editing(lv_obj_get_group(obj)); /*Focus the first button if there is not selected button*/ - if(btnm->btn_id_sel == LV_BUTTONMATRIX_BUTTON_NONE) { + if(btnm->btn_id_sel == LV_BTNMATRIX_BTN_NONE) { if(indev_type == LV_INDEV_TYPE_KEYPAD || (indev_type == LV_INDEV_TYPE_ENCODER && editing)) { uint32_t b = 0; if(btnm->one_check) { - while(b < btnm->btn_cnt && - (button_is_hidden(btnm->ctrl_bits[b]) || - button_is_inactive(btnm->ctrl_bits[b]) || - button_is_checked(btnm->ctrl_bits[b]) == false)) { - b++; - } + while(button_is_hidden(btnm->ctrl_bits[b]) || button_is_inactive(btnm->ctrl_bits[b]) || + button_is_checked(btnm->ctrl_bits[b]) == false) b++; } else { - while(b < btnm->btn_cnt && - (button_is_hidden(btnm->ctrl_bits[b]) || - button_is_inactive(btnm->ctrl_bits[b]))) { - b++; - } + while(button_is_hidden(btnm->ctrl_bits[b]) || button_is_inactive(btnm->ctrl_bits[b])) b++; } btnm->btn_id_sel = b; } else { - btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; + btnm->btn_id_sel = LV_BTNMATRIX_BTN_NONE; } } } else if(code == LV_EVENT_DEFOCUSED || code == LV_EVENT_LEAVE) { - // TODO - // if(btnm->btn_id_sel != LV_BUTTONMATRIX_BUTTON_NONE) invalidate_button_area(obj, btnm->btn_id_sel); - // btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; + if(btnm->btn_id_sel != LV_BTNMATRIX_BTN_NONE) invalidate_button_area(obj, btnm->btn_id_sel); + btnm->btn_id_sel = LV_BTNMATRIX_BTN_NONE; } else if(code == LV_EVENT_KEY) { invalidate_button_area(obj, btnm->btn_id_sel); - uint32_t c = lv_event_get_key(e); + char c = *((char *)lv_event_get_param(e)); if(c == LV_KEY_RIGHT) { - if(btnm->btn_id_sel == LV_BUTTONMATRIX_BUTTON_NONE) btnm->btn_id_sel = 0; + if(btnm->btn_id_sel == LV_BTNMATRIX_BTN_NONE) btnm->btn_id_sel = 0; else btnm->btn_id_sel++; if(btnm->btn_id_sel >= btnm->btn_cnt) btnm->btn_id_sel = 0; - uint32_t btn_id_start = btnm->btn_id_sel; + uint16_t btn_id_start = btnm->btn_id_sel; while(button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) || button_is_inactive(btnm->ctrl_bits[btnm->btn_id_sel])) { btnm->btn_id_sel++; if(btnm->btn_id_sel >= btnm->btn_cnt) btnm->btn_id_sel = 0; if(btnm->btn_id_sel == btn_id_start) { - btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; + btnm->btn_id_sel = LV_BTNMATRIX_BTN_NONE; break; } } } else if(c == LV_KEY_LEFT) { - if(btnm->btn_id_sel == LV_BUTTONMATRIX_BUTTON_NONE) btnm->btn_id_sel = 0; + if(btnm->btn_id_sel == LV_BTNMATRIX_BTN_NONE) btnm->btn_id_sel = 0; if(btnm->btn_id_sel == 0) btnm->btn_id_sel = btnm->btn_cnt - 1; else if(btnm->btn_id_sel > 0) btnm->btn_id_sel--; - uint32_t btn_id_start = btnm->btn_id_sel; + uint16_t btn_id_start = btnm->btn_id_sel; while(button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) || button_is_inactive(btnm->ctrl_bits[btnm->btn_id_sel])) { if(btnm->btn_id_sel > 0) btnm->btn_id_sel--; else btnm->btn_id_sel = btnm->btn_cnt - 1; if(btnm->btn_id_sel == btn_id_start) { - btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; + btnm->btn_id_sel = LV_BTNMATRIX_BTN_NONE; break; } } } else if(c == LV_KEY_DOWN) { - int32_t col_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); + lv_coord_t col_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); /*Find the area below the current*/ - if(btnm->btn_id_sel == LV_BUTTONMATRIX_BUTTON_NONE) { + if(btnm->btn_id_sel == LV_BTNMATRIX_BTN_NONE) { btnm->btn_id_sel = 0; while(button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) || button_is_inactive(btnm->ctrl_bits[btnm->btn_id_sel])) { btnm->btn_id_sel++; if(btnm->btn_id_sel >= btnm->btn_cnt) { - btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; + btnm->btn_id_sel = LV_BTNMATRIX_BTN_NONE; break; } } } else { - uint32_t area_below; - int32_t pr_center = + uint16_t area_below; + lv_coord_t pr_center = btnm->button_areas[btnm->btn_id_sel].x1 + (lv_area_get_width(&btnm->button_areas[btnm->btn_id_sel]) >> 1); for(area_below = btnm->btn_id_sel; area_below < btnm->btn_cnt; area_below++) { @@ -624,21 +647,21 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e } } else if(c == LV_KEY_UP) { - int32_t col_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); + lv_coord_t col_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); /*Find the area below the current*/ - if(btnm->btn_id_sel == LV_BUTTONMATRIX_BUTTON_NONE) { + if(btnm->btn_id_sel == LV_BTNMATRIX_BTN_NONE) { btnm->btn_id_sel = 0; while(button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) || button_is_inactive(btnm->ctrl_bits[btnm->btn_id_sel])) { btnm->btn_id_sel++; if(btnm->btn_id_sel >= btnm->btn_cnt) { - btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; + btnm->btn_id_sel = LV_BTNMATRIX_BTN_NONE; break; } } } else { int16_t area_above; - int32_t pr_center = + lv_coord_t pr_center = btnm->button_areas[btnm->btn_id_sel].x1 + (lv_area_get_width(&btnm->button_areas[btnm->btn_id_sel]) >> 1); for(area_above = btnm->btn_id_sel; area_above >= 0; area_above--) { @@ -664,11 +687,11 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e static void draw_main(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_obj_t * obj = lv_event_get_target(e); + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; if(btnm->btn_cnt == 0) return; - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); obj->skip_trans = 1; lv_area_t area_obj; @@ -676,8 +699,8 @@ static void draw_main(lv_event_t * e) lv_area_t btn_area; - uint32_t btn_i = 0; - uint32_t txt_i = 0; + uint16_t btn_i = 0; + uint16_t txt_i = 0; lv_draw_rect_dsc_t draw_rect_dsc_act; lv_draw_label_dsc_t draw_label_dsc_act; @@ -695,18 +718,27 @@ static void draw_main(lv_event_t * e) obj->skip_trans = 0; obj->state = state_ori; - int32_t ptop = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t pbottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); - int32_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t pright = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t ptop = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t pbottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); + lv_coord_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t pright = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); #if LV_USE_ARABIC_PERSIAN_CHARS - char txt_ap[256]; + const size_t txt_ap_size = 256 ; + char * txt_ap = lv_mem_buf_get(txt_ap_size); #endif + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.part = LV_PART_ITEMS; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_BTNMATRIX_DRAW_PART_BTN; + part_draw_dsc.rect_dsc = &draw_rect_dsc_act; + part_draw_dsc.label_dsc = &draw_label_dsc_act; + for(btn_i = 0; btn_i < btnm->btn_cnt; btn_i++, txt_i++) { /*Search the next valid text in the map*/ - while(lv_strcmp(btnm->map_p[txt_i], "\n") == 0) { + while(strcmp(btnm->map_p[txt_i], "\n") == 0) { txt_i++; } @@ -749,7 +781,14 @@ static void draw_main(lv_event_t * e) obj->skip_trans = 0; } - draw_rect_dsc_act.base.id1 = btn_i; + bool recolor = button_is_recolor(btnm->ctrl_bits[btn_i]); + if(recolor) draw_label_dsc_act.flag |= LV_TEXT_FLAG_RECOLOR; + else draw_label_dsc_act.flag &= ~LV_TEXT_FLAG_RECOLOR; + + + part_draw_dsc.draw_area = &btn_area; + part_draw_dsc.id = btn_i; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); /*Remove borders on the edges if `LV_BORDER_SIDE_INTERNAL`*/ if(draw_rect_dsc_act.border_side & LV_BORDER_SIDE_INTERNAL) { @@ -760,68 +799,70 @@ static void draw_main(lv_event_t * e) if(btn_area.y2 == obj->coords.y2 - pbottom) draw_rect_dsc_act.border_side &= ~LV_BORDER_SIDE_BOTTOM; } - int32_t btn_height = lv_area_get_height(&btn_area); + lv_coord_t btn_height = lv_area_get_height(&btn_area); - if((btn_state & LV_STATE_PRESSED) && (btnm->ctrl_bits[btn_i] & LV_BUTTONMATRIX_CTRL_POPOVER)) { + if((btn_state & LV_STATE_PRESSED) && (btnm->ctrl_bits[btn_i] & LV_BTNMATRIX_CTRL_POPOVER)) { /*Push up the upper boundary of the btn area to create the popover*/ btn_area.y1 -= btn_height; } /*Draw the background*/ - lv_draw_rect(layer, &draw_rect_dsc_act, &btn_area); + lv_draw_rect(draw_ctx, &draw_rect_dsc_act, &btn_area); /*Calculate the size of the text*/ const lv_font_t * font = draw_label_dsc_act.font; - int32_t letter_space = draw_label_dsc_act.letter_space; - int32_t line_space = draw_label_dsc_act.line_space; + lv_coord_t letter_space = draw_label_dsc_act.letter_space; + lv_coord_t line_space = draw_label_dsc_act.line_space; const char * txt = btnm->map_p[txt_i]; #if LV_USE_ARABIC_PERSIAN_CHARS /*Get the size of the Arabic text and process it*/ - size_t len_ap = lv_text_ap_calc_bytes_count(txt); - if(len_ap < sizeof(txt_ap)) { - lv_text_ap_proc(txt, txt_ap); + size_t len_ap = _lv_txt_ap_calc_bytes_cnt(txt); + if(len_ap < txt_ap_size) { + _lv_txt_ap_proc(txt, txt_ap); txt = txt_ap; } #endif lv_point_t txt_size; - lv_text_get_size(&txt_size, txt, font, letter_space, - line_space, lv_area_get_width(&area_obj), draw_label_dsc_act.flag); + lv_txt_get_size(&txt_size, txt, font, letter_space, + line_space, lv_area_get_width(&area_obj), draw_label_dsc_act.flag); btn_area.x1 += (lv_area_get_width(&btn_area) - txt_size.x) / 2; btn_area.y1 += (lv_area_get_height(&btn_area) - txt_size.y) / 2; btn_area.x2 = btn_area.x1 + txt_size.x; btn_area.y2 = btn_area.y1 + txt_size.y; - if((btn_state & LV_STATE_PRESSED) && (btnm->ctrl_bits[btn_i] & LV_BUTTONMATRIX_CTRL_POPOVER)) { + if((btn_state & LV_STATE_PRESSED) && (btnm->ctrl_bits[btn_i] & LV_BTNMATRIX_CTRL_POPOVER)) { /*Push up the button text into the popover*/ btn_area.y1 -= btn_height / 2; btn_area.y2 -= btn_height / 2; } /*Draw the text*/ - draw_label_dsc_act.text = txt; - draw_label_dsc_act.text_local = true; - draw_label_dsc_act.base.id1 = btn_i; - lv_draw_label(layer, &draw_label_dsc_act, &btn_area); + lv_draw_label(draw_ctx, &draw_label_dsc_act, &btn_area, txt, NULL); + + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); } obj->skip_trans = 0; +#if LV_USE_ARABIC_PERSIAN_CHARS + lv_mem_buf_release(txt_ap); +#endif } /** * Create the required number of buttons and control bytes according to a map * @param obj pointer to button matrix object * @param map_p pointer to a string array */ -static void allocate_button_areas_and_controls(const lv_obj_t * obj, const char * const * map) +static void allocate_btn_areas_and_controls(const lv_obj_t * obj, const char ** map) { - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; btnm->row_cnt = 1; /*Count the buttons in the map*/ - uint32_t btn_cnt = 0; - uint32_t i = 0; + uint16_t btn_cnt = 0; + uint16_t i = 0; while(map[i] && map[i][0] != '\0') { - if(lv_strcmp(map[i], "\n") != 0) { /*Do not count line breaks*/ + if(strcmp(map[i], "\n") != 0) { /*Do not count line breaks*/ btn_cnt++; } else { @@ -834,21 +875,21 @@ static void allocate_button_areas_and_controls(const lv_obj_t * obj, const char if(btn_cnt == btnm->btn_cnt) return; if(btnm->button_areas != NULL) { - lv_free(btnm->button_areas); + lv_mem_free(btnm->button_areas); btnm->button_areas = NULL; } if(btnm->ctrl_bits != NULL) { - lv_free(btnm->ctrl_bits); + lv_mem_free(btnm->ctrl_bits); btnm->ctrl_bits = NULL; } - btnm->button_areas = lv_malloc(sizeof(lv_area_t) * btn_cnt); + btnm->button_areas = lv_mem_alloc(sizeof(lv_area_t) * btn_cnt); LV_ASSERT_MALLOC(btnm->button_areas); - btnm->ctrl_bits = lv_malloc(sizeof(lv_buttonmatrix_ctrl_t) * btn_cnt); + btnm->ctrl_bits = lv_mem_alloc(sizeof(lv_btnmatrix_ctrl_t) * btn_cnt); LV_ASSERT_MALLOC(btnm->ctrl_bits); if(btnm->button_areas == NULL || btnm->ctrl_bits == NULL) btn_cnt = 0; - lv_memzero(btnm->ctrl_bits, sizeof(lv_buttonmatrix_ctrl_t) * btn_cnt); + lv_memset_00(btnm->ctrl_bits, sizeof(lv_btnmatrix_ctrl_t) * btn_cnt); btnm->btn_cnt = btn_cnt; } @@ -858,74 +899,78 @@ static void allocate_button_areas_and_controls(const lv_obj_t * obj, const char * @param ctrl_bits least significant 3 bits used (1..7 valid values) * @return the width of the button in units */ -static uint32_t get_button_width(lv_buttonmatrix_ctrl_t ctrl_bits) +static uint8_t get_button_width(lv_btnmatrix_ctrl_t ctrl_bits) { - uint32_t w = ctrl_bits & LV_BUTTONMATRIX_WIDTH_MASK; + uint8_t w = ctrl_bits & LV_BTNMATRIX_WIDTH_MASK; return w != 0 ? w : 1; } -static bool button_is_hidden(lv_buttonmatrix_ctrl_t ctrl_bits) +static bool button_is_hidden(lv_btnmatrix_ctrl_t ctrl_bits) { - return ctrl_bits & LV_BUTTONMATRIX_CTRL_HIDDEN; + return (ctrl_bits & LV_BTNMATRIX_CTRL_HIDDEN) ? true : false; } -static bool button_is_checked(lv_buttonmatrix_ctrl_t ctrl_bits) +static bool button_is_checked(lv_btnmatrix_ctrl_t ctrl_bits) { - return ctrl_bits & LV_BUTTONMATRIX_CTRL_CHECKED; + return (ctrl_bits & LV_BTNMATRIX_CTRL_CHECKED) ? true : false; } -static bool button_is_repeat_disabled(lv_buttonmatrix_ctrl_t ctrl_bits) +static bool button_is_repeat_disabled(lv_btnmatrix_ctrl_t ctrl_bits) { - return ctrl_bits & LV_BUTTONMATRIX_CTRL_NO_REPEAT; + return (ctrl_bits & LV_BTNMATRIX_CTRL_NO_REPEAT) ? true : false; } -static bool button_is_inactive(lv_buttonmatrix_ctrl_t ctrl_bits) +static bool button_is_inactive(lv_btnmatrix_ctrl_t ctrl_bits) { - return ctrl_bits & LV_BUTTONMATRIX_CTRL_DISABLED; + return (ctrl_bits & LV_BTNMATRIX_CTRL_DISABLED) ? true : false; } -static bool button_is_click_trig(lv_buttonmatrix_ctrl_t ctrl_bits) +static bool button_is_click_trig(lv_btnmatrix_ctrl_t ctrl_bits) { - return ctrl_bits & LV_BUTTONMATRIX_CTRL_CLICK_TRIG; + return (ctrl_bits & LV_BTNMATRIX_CTRL_CLICK_TRIG) ? true : false; } -static bool button_is_popover(lv_buttonmatrix_ctrl_t ctrl_bits) +static bool button_is_popover(lv_btnmatrix_ctrl_t ctrl_bits) { - return ctrl_bits & LV_BUTTONMATRIX_CTRL_POPOVER; + return (ctrl_bits & LV_BTNMATRIX_CTRL_POPOVER) ? true : false; } -static bool button_is_checkable(lv_buttonmatrix_ctrl_t ctrl_bits) +static bool button_is_checkable(lv_btnmatrix_ctrl_t ctrl_bits) { - return ctrl_bits & LV_BUTTONMATRIX_CTRL_CHECKABLE; + return (ctrl_bits & LV_BTNMATRIX_CTRL_CHECKABLE) ? true : false; } -static bool button_get_checked(lv_buttonmatrix_ctrl_t ctrl_bits) +static bool button_get_checked(lv_btnmatrix_ctrl_t ctrl_bits) { - return ctrl_bits & LV_BUTTONMATRIX_CTRL_CHECKED; + return (ctrl_bits & LV_BTNMATRIX_CTRL_CHECKED) ? true : false; } +static bool button_is_recolor(lv_btnmatrix_ctrl_t ctrl_bits) +{ + return (ctrl_bits & LV_BTNMATRIX_CTRL_RECOLOR) ? true : false; +} /** * Gives the button id of a button under a given point * @param obj pointer to a button matrix object * @param p a point with absolute coordinates - * @return the id of the button or LV_BUTTONMATRIX_BUTTON_NONE. + * @return the id of the button or LV_BTNMATRIX_BTN_NONE. */ -static uint32_t get_button_from_point(lv_obj_t * obj, lv_point_t * p) +static uint16_t get_button_from_point(lv_obj_t * obj, lv_point_t * p) { lv_area_t obj_cords; lv_area_t btn_area; - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; - uint32_t i; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;; + uint16_t i; lv_obj_get_coords(obj, &obj_cords); - int32_t w = lv_obj_get_width(obj); - int32_t h = lv_obj_get_height(obj); - int32_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t pright = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); - int32_t ptop = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t pbottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); - int32_t prow = lv_obj_get_style_pad_row(obj, LV_PART_MAIN); - int32_t pcol = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); + lv_coord_t w = lv_obj_get_width(obj); + lv_coord_t h = lv_obj_get_height(obj); + lv_coord_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t pright = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t ptop = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t pbottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); + lv_coord_t prow = lv_obj_get_style_pad_row(obj, LV_PART_MAIN); + lv_coord_t pcol = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); /*Get the half gap. Button look larger with this value. (+1 for rounding error)*/ prow = (prow / 2) + 1 + (prow & 1); @@ -953,24 +998,24 @@ static uint32_t get_button_from_point(lv_obj_t * obj, lv_point_t * p) BTN_EXTRA_CLICK_AREA_MAX); /*-2 for rounding error*/ else btn_area.y2 += obj_cords.y1 + prow; - if(lv_area_is_point_on(&btn_area, p, 0) != false) { + if(_lv_area_is_point_on(&btn_area, p, 0) != false) { break; } } - if(i == btnm->btn_cnt) i = LV_BUTTONMATRIX_BUTTON_NONE; + if(i == btnm->btn_cnt) i = LV_BTNMATRIX_BTN_NONE; return i; } -static void invalidate_button_area(const lv_obj_t * obj, uint32_t btn_idx) +static void invalidate_button_area(const lv_obj_t * obj, uint16_t btn_idx) { - if(btn_idx == LV_BUTTONMATRIX_BUTTON_NONE) return; + if(btn_idx == LV_BTNMATRIX_BTN_NONE) return; lv_area_t btn_area; lv_area_t obj_area; - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;; if(btn_idx >= btnm->btn_cnt) return; lv_area_copy(&btn_area, &btnm->button_areas[btn_idx]); @@ -978,11 +1023,11 @@ static void invalidate_button_area(const lv_obj_t * obj, uint32_t btn_idx) /*The buttons might have outline and shadow so make the invalidation larger with the gaps between the buttons. *It assumes that the outline or shadow is smaller than the gaps*/ - int32_t row_gap = lv_obj_get_style_pad_row(obj, LV_PART_MAIN); - int32_t col_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); + lv_coord_t row_gap = lv_obj_get_style_pad_row(obj, LV_PART_MAIN); + lv_coord_t col_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); /*Be sure to have a minimal extra space if row/col_gap is small*/ - int32_t dpi = lv_display_get_dpi(lv_obj_get_display(obj)); + lv_coord_t dpi = lv_disp_get_dpi(lv_obj_get_disp(obj)); row_gap = LV_MAX(row_gap, dpi / 10); col_gap = LV_MAX(col_gap, dpi / 10); @@ -992,7 +1037,7 @@ static void invalidate_button_area(const lv_obj_t * obj, uint32_t btn_idx) btn_area.x2 += obj_area.x1 + row_gap; btn_area.y2 += obj_area.y1 + col_gap; - if((btn_idx == btnm->btn_id_sel) && (btnm->ctrl_bits[btn_idx] & LV_BUTTONMATRIX_CTRL_POPOVER)) { + if((btn_idx == btnm->btn_id_sel) && (btnm->ctrl_bits[btn_idx] & LV_BTNMATRIX_CTRL_POPOVER)) { /*Push up the upper boundary of the btn area to also invalidate the popover*/ btn_area.y1 -= lv_area_get_height(&btn_area); } @@ -1006,33 +1051,33 @@ static void invalidate_button_area(const lv_obj_t * obj, uint32_t btn_idx) * @param obj Button matrix object * @param btn_idx Button that should remain toggled */ -static void make_one_button_checked(lv_obj_t * obj, uint32_t btn_idx) +static void make_one_button_checked(lv_obj_t * obj, uint16_t btn_idx) { /*Save whether the button was toggled*/ - bool was_toggled = lv_buttonmatrix_has_button_ctrl(obj, btn_idx, LV_BUTTONMATRIX_CTRL_CHECKED); + bool was_toggled = lv_btnmatrix_has_btn_ctrl(obj, btn_idx, LV_BTNMATRIX_CTRL_CHECKED); - lv_buttonmatrix_clear_button_ctrl_all(obj, LV_BUTTONMATRIX_CTRL_CHECKED); + lv_btnmatrix_clear_btn_ctrl_all(obj, LV_BTNMATRIX_CTRL_CHECKED); - if(was_toggled) lv_buttonmatrix_set_button_ctrl(obj, btn_idx, LV_BUTTONMATRIX_CTRL_CHECKED); + if(was_toggled) lv_btnmatrix_set_btn_ctrl(obj, btn_idx, LV_BTNMATRIX_CTRL_CHECKED); } /** - * Check if any of the buttons in the first row has the LV_BUTTONMATRIX_CTRL_POPOVER control flag set. + * Check if any of the buttons in the first row has the LV_BTNMATRIX_CTRL_POPOVER control flag set. * @param obj Button matrix object * @return true if at least one button has the flag, false otherwise */ static bool has_popovers_in_top_row(lv_obj_t * obj) { - lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; + lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj; if(btnm->row_cnt <= 0) { return false; } - const char * const * map_row = btnm->map_p; - uint32_t btn_cnt = 0; + const char ** map_row = btnm->map_p; + uint16_t btn_cnt = 0; - while(map_row[btn_cnt] && lv_strcmp(map_row[btn_cnt], "\n") != 0 && map_row[btn_cnt][0] != '\0') { + while(map_row[btn_cnt] && strcmp(map_row[btn_cnt], "\n") != 0 && map_row[btn_cnt][0] != '\0') { if(button_is_popover(btnm->ctrl_bits[btn_cnt])) { return true; } diff --git a/L3_Middlewares/LVGL/src/widgets/lv_btnmatrix.h b/L3_Middlewares/LVGL/src/widgets/lv_btnmatrix.h new file mode 100644 index 0000000..2edf202 --- /dev/null +++ b/L3_Middlewares/LVGL/src/widgets/lv_btnmatrix.h @@ -0,0 +1,226 @@ +/** + * @file lv_btnmatrix.h + * + */ + +#ifndef LV_BTNMATRIX_H +#define LV_BTNMATRIX_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" + +#if LV_USE_BTNMATRIX != 0 + +#include "../core/lv_obj.h" + +/********************* + * DEFINES + *********************/ +#define LV_BTNMATRIX_BTN_NONE 0xFFFF +LV_EXPORT_CONST_INT(LV_BTNMATRIX_BTN_NONE); + +/********************** + * TYPEDEFS + **********************/ + +/** Type to store button control bits (disabled, hidden etc.) + * The first 3 bits are used to store the width*/ +enum { + _LV_BTNMATRIX_WIDTH = 0x000F, /**< Reserved to store the size units*/ + LV_BTNMATRIX_CTRL_HIDDEN = 0x0010, /**< Button hidden*/ + LV_BTNMATRIX_CTRL_NO_REPEAT = 0x0020, /**< Do not repeat press this button.*/ + LV_BTNMATRIX_CTRL_DISABLED = 0x0040, /**< Disable this button.*/ + LV_BTNMATRIX_CTRL_CHECKABLE = 0x0080, /**< The button can be toggled.*/ + LV_BTNMATRIX_CTRL_CHECKED = 0x0100, /**< Button is currently toggled (e.g. checked).*/ + LV_BTNMATRIX_CTRL_CLICK_TRIG = 0x0200, /**< 1: Send LV_EVENT_VALUE_CHANGE on CLICK, 0: Send LV_EVENT_VALUE_CHANGE on PRESS*/ + LV_BTNMATRIX_CTRL_POPOVER = 0x0400, /**< Show a popover when pressing this key*/ + LV_BTNMATRIX_CTRL_RECOLOR = 0x0800, /**< Enable text recoloring with `#color`*/ + _LV_BTNMATRIX_CTRL_RESERVED_1 = 0x1000, /**< Reserved for later use*/ + _LV_BTNMATRIX_CTRL_RESERVED_2 = 0x2000, /**< Reserved for later use*/ + LV_BTNMATRIX_CTRL_CUSTOM_1 = 0x4000, /**< Custom free to use flag*/ + LV_BTNMATRIX_CTRL_CUSTOM_2 = 0x8000, /**< Custom free to use flag*/ +}; + +typedef uint16_t lv_btnmatrix_ctrl_t; + +typedef bool (*lv_btnmatrix_btn_draw_cb_t)(lv_obj_t * btnm, uint32_t btn_id, const lv_area_t * draw_area, + const lv_area_t * clip_area); + +/*Data of button matrix*/ +typedef struct { + lv_obj_t obj; + const char ** map_p; /*Pointer to the current map*/ + lv_area_t * button_areas; /*Array of areas of buttons*/ + lv_btnmatrix_ctrl_t * ctrl_bits; /*Array of control bytes*/ + uint16_t btn_cnt; /*Number of button in 'map_p'(Handled by the library)*/ + uint16_t row_cnt; /*Number of rows in 'map_p'(Handled by the library)*/ + uint16_t btn_id_sel; /*Index of the active button (being pressed/released etc) or LV_BTNMATRIX_BTN_NONE*/ + uint8_t one_check : 1; /*Single button toggled at once*/ +} lv_btnmatrix_t; + +extern const lv_obj_class_t lv_btnmatrix_class; + +/** + * `type` field in `lv_obj_draw_part_dsc_t` if `class_p = lv_btnmatrix_class` + * Used in `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` + */ +typedef enum { + LV_BTNMATRIX_DRAW_PART_BTN, /**< The rectangle and label of buttons*/ +} lv_btnmatrix_draw_part_type_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create a button matrix object + * @param parent pointer to an object, it will be the parent of the new button matrix + * @return pointer to the created button matrix + */ +lv_obj_t * lv_btnmatrix_create(lv_obj_t * parent); + +/*===================== + * Setter functions + *====================*/ + +/** + * Set a new map. Buttons will be created/deleted according to the map. The + * button matrix keeps a reference to the map and so the string array must not + * be deallocated during the life of the matrix. + * @param obj pointer to a button matrix object + * @param map pointer a string array. The last string has to be: "". Use "\n" to make a line break. + */ +void lv_btnmatrix_set_map(lv_obj_t * obj, const char * map[]); + +/** + * Set the button control map (hidden, disabled etc.) for a button matrix. + * The control map array will be copied and so may be deallocated after this + * function returns. + * @param obj pointer to a button matrix object + * @param ctrl_map pointer to an array of `lv_btn_ctrl_t` control bytes. The + * length of the array and position of the elements must match + * the number and order of the individual buttons (i.e. excludes + * newline entries). + * An element of the map should look like e.g.: + * `ctrl_map[0] = width | LV_BTNMATRIX_CTRL_NO_REPEAT | LV_BTNMATRIX_CTRL_TGL_ENABLE` + */ +void lv_btnmatrix_set_ctrl_map(lv_obj_t * obj, const lv_btnmatrix_ctrl_t ctrl_map[]); + +/** + * Set the selected buttons + * @param obj pointer to button matrix object + * @param btn_id 0 based index of the button to modify. (Not counting new lines) + */ +void lv_btnmatrix_set_selected_btn(lv_obj_t * obj, uint16_t btn_id); + +/** + * Set the attributes of a button of the button matrix + * @param obj pointer to button matrix object + * @param btn_id 0 based index of the button to modify. (Not counting new lines) + * @param ctrl OR-ed attributs. E.g. `LV_BTNMATRIX_CTRL_NO_REPEAT | LV_BTNMATRIX_CTRL_CHECKABLE` + */ +void lv_btnmatrix_set_btn_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl); + +/** + * Clear the attributes of a button of the button matrix + * @param obj pointer to button matrix object + * @param btn_id 0 based index of the button to modify. (Not counting new lines) + * @param ctrl OR-ed attributs. E.g. `LV_BTNMATRIX_CTRL_NO_REPEAT | LV_BTNMATRIX_CTRL_CHECKABLE` + */ +void lv_btnmatrix_clear_btn_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl); + +/** + * Set attributes of all buttons of a button matrix + * @param obj pointer to a button matrix object + * @param ctrl attribute(s) to set from `lv_btnmatrix_ctrl_t`. Values can be ORed. + */ +void lv_btnmatrix_set_btn_ctrl_all(lv_obj_t * obj, lv_btnmatrix_ctrl_t ctrl); + +/** + * Clear the attributes of all buttons of a button matrix + * @param obj pointer to a button matrix object + * @param ctrl attribute(s) to set from `lv_btnmatrix_ctrl_t`. Values can be ORed. + * @param en true: set the attributes; false: clear the attributes + */ +void lv_btnmatrix_clear_btn_ctrl_all(lv_obj_t * obj, lv_btnmatrix_ctrl_t ctrl); + +/** + * Set a single button's relative width. + * This method will cause the matrix be regenerated and is a relatively + * expensive operation. It is recommended that initial width be specified using + * `lv_btnmatrix_set_ctrl_map` and this method only be used for dynamic changes. + * @param obj pointer to button matrix object + * @param btn_id 0 based index of the button to modify. + * @param width relative width compared to the buttons in the same row. [1..7] + */ +void lv_btnmatrix_set_btn_width(lv_obj_t * obj, uint16_t btn_id, uint8_t width); + +/** + * Make the button matrix like a selector widget (only one button may be checked at a time). + * `LV_BTNMATRIX_CTRL_CHECKABLE` must be enabled on the buttons to be selected using + * `lv_btnmatrix_set_ctrl()` or `lv_btnmatrix_set_btn_ctrl_all()`. + * @param obj pointer to a button matrix object + * @param en whether "one check" mode is enabled + */ +void lv_btnmatrix_set_one_checked(lv_obj_t * obj, bool en); + +/*===================== + * Getter functions + *====================*/ + +/** + * Get the current map of a button matrix + * @param obj pointer to a button matrix object + * @return the current map + */ +const char ** lv_btnmatrix_get_map(const lv_obj_t * obj); + +/** + * Get the index of the lastly "activated" button by the user (pressed, released, focused etc) + * Useful in the `event_cb` to get the text of the button, check if hidden etc. + * @param obj pointer to button matrix object + * @return index of the last released button (LV_BTNMATRIX_BTN_NONE: if unset) + */ +uint16_t lv_btnmatrix_get_selected_btn(const lv_obj_t * obj); + +/** + * Get the button's text + * @param obj pointer to button matrix object + * @param btn_id the index a button not counting new line characters. + * @return text of btn_index` button + */ +const char * lv_btnmatrix_get_btn_text(const lv_obj_t * obj, uint16_t btn_id); + +/** + * Get the whether a control value is enabled or disabled for button of a button matrix + * @param obj pointer to a button matrix object + * @param btn_id the index of a button not counting new line characters. + * @param ctrl control values to check (ORed value can be used) + * @return true: the control attribute is enabled false: disabled + */ +bool lv_btnmatrix_has_btn_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_btnmatrix_ctrl_t ctrl); + +/** + * Tell whether "one check" mode is enabled or not. + * @param obj Button matrix object + * @return true: "one check" mode is enabled; false: disabled + */ +bool lv_btnmatrix_get_one_checked(const lv_obj_t * obj); + +/********************** + * MACROS + **********************/ + +#endif /*LV_USE_BTNMATRIX*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_BTNMATRIX_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/lv_canvas.c b/L3_Middlewares/LVGL/src/widgets/lv_canvas.c new file mode 100644 index 0000000..1f94927 --- /dev/null +++ b/L3_Middlewares/LVGL/src/widgets/lv_canvas.c @@ -0,0 +1,836 @@ +/** + * @file lv_canvas.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_canvas.h" +#include "../misc/lv_assert.h" +#include "../misc/lv_math.h" +#include "../draw/lv_draw.h" +#include "../core/lv_refr.h" + +#if LV_USE_CANVAS != 0 + +#include "../draw/sw/lv_draw_sw.h" + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_canvas_class + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_canvas_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_canvas_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void init_fake_disp(lv_obj_t * canvas, lv_disp_t * disp, lv_disp_drv_t * drv, lv_area_t * clip_area); +static void deinit_fake_disp(lv_obj_t * canvas, lv_disp_t * disp); + +/********************** + * STATIC VARIABLES + **********************/ +const lv_obj_class_t lv_canvas_class = { + .constructor_cb = lv_canvas_constructor, + .destructor_cb = lv_canvas_destructor, + .instance_size = sizeof(lv_canvas_t), + .base_class = &lv_img_class +}; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_obj_t * lv_canvas_create(lv_obj_t * parent) +{ + LV_LOG_INFO("begin"); + lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); + lv_obj_class_init_obj(obj); + return obj; +} + +/*===================== + * Setter functions + *====================*/ + +void lv_canvas_set_buffer(lv_obj_t * obj, void * buf, lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(buf); + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + + canvas->dsc.header.cf = cf; + canvas->dsc.header.w = w; + canvas->dsc.header.h = h; + canvas->dsc.data = buf; + + lv_img_set_src(obj, &canvas->dsc); + lv_img_cache_invalidate_src(&canvas->dsc); +} + +void lv_canvas_set_px_color(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_color_t c) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + + lv_img_buf_set_px_color(&canvas->dsc, x, y, c); + lv_obj_invalidate(obj); +} + +void lv_canvas_set_px_opa(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_opa_t opa) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + + lv_img_buf_set_px_alpha(&canvas->dsc, x, y, opa); + lv_obj_invalidate(obj); +} + +void lv_canvas_set_palette(lv_obj_t * obj, uint8_t id, lv_color_t c) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + + lv_img_buf_set_palette(&canvas->dsc, id, c); + lv_obj_invalidate(obj); +} + +/*===================== + * Getter functions + *====================*/ + +lv_color_t lv_canvas_get_px(lv_obj_t * obj, lv_coord_t x, lv_coord_t y) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + lv_color_t color = lv_obj_get_style_img_recolor(obj, LV_PART_MAIN); + + return lv_img_buf_get_px_color(&canvas->dsc, x, y, color); +} + +lv_img_dsc_t * lv_canvas_get_img(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + return &canvas->dsc; +} + +/*===================== + * Other functions + *====================*/ + +void lv_canvas_copy_buf(lv_obj_t * obj, const void * to_copy, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(to_copy); + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + + if(x + w - 1 >= (lv_coord_t)canvas->dsc.header.w || y + h - 1 >= (lv_coord_t)canvas->dsc.header.h) { + LV_LOG_WARN("lv_canvas_copy_buf: x or y out of the canvas"); + return; + } + + uint32_t px_size = lv_img_cf_get_px_size(canvas->dsc.header.cf) >> 3; + uint32_t px = canvas->dsc.header.w * y * px_size + x * px_size; + uint8_t * to_copy8 = (uint8_t *)to_copy; + lv_coord_t i; + for(i = 0; i < h; i++) { + lv_memcpy((void *)&canvas->dsc.data[px], to_copy8, w * px_size); + px += canvas->dsc.header.w * px_size; + to_copy8 += w * px_size; + } +} + +void lv_canvas_transform(lv_obj_t * obj, lv_img_dsc_t * src_img, int16_t angle, uint16_t zoom, lv_coord_t offset_x, + lv_coord_t offset_y, + int32_t pivot_x, int32_t pivot_y, bool antialias) +{ +#if LV_DRAW_COMPLEX + LV_ASSERT_OBJ(obj, MY_CLASS); + LV_ASSERT_NULL(src_img); + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + lv_img_dsc_t * dest_img = &canvas->dsc; + + int32_t x; + int32_t y; + + lv_draw_img_dsc_t draw_dsc; + lv_draw_img_dsc_init(&draw_dsc); + draw_dsc.angle = angle; + draw_dsc.zoom = zoom; + draw_dsc.pivot.x = pivot_x; + draw_dsc.pivot.y = pivot_y; + draw_dsc.antialias = antialias; + + lv_area_t dest_area; + dest_area.x1 = -offset_x; + dest_area.x2 = dest_area.x1 + dest_img->header.w - 1; + dest_area.y1 = -offset_y; + dest_area.y2 = -offset_y; + + lv_color_t * cbuf = lv_mem_alloc(dest_img->header.w * sizeof(lv_color_t)); + lv_opa_t * abuf = lv_mem_alloc(dest_img->header.w * sizeof(lv_opa_t)); + for(y = 0; y < dest_img->header.h; y++) { + if(y + offset_y >= 0) { + lv_draw_sw_transform(NULL, &dest_area, src_img->data, src_img->header.w, src_img->header.h, src_img->header.w, + &draw_dsc, canvas->dsc.header.cf, cbuf, abuf); + + for(x = 0; x < dest_img->header.w; x++) { + if(abuf[x]) { + lv_img_buf_set_px_color(dest_img, x, y, cbuf[x]); + lv_img_buf_set_px_alpha(dest_img, x, y, abuf[x]); + } + } + + dest_area.y1++; + dest_area.y2++; + } + } + lv_mem_free(cbuf); + lv_mem_free(abuf); + + lv_obj_invalidate(obj); + +#else + LV_UNUSED(obj); + LV_UNUSED(src_img); + LV_UNUSED(angle); + LV_UNUSED(zoom); + LV_UNUSED(offset_x); + LV_UNUSED(offset_y); + LV_UNUSED(pivot_x); + LV_UNUSED(pivot_y); + LV_UNUSED(antialias); + LV_LOG_WARN("Can't transform canvas with LV_DRAW_COMPLEX == 0"); +#endif +} + +void lv_canvas_blur_hor(lv_obj_t * obj, const lv_area_t * area, uint16_t r) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + if(r == 0) return; + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + + lv_area_t a; + if(area) { + lv_area_copy(&a, area); + if(a.x1 < 0) a.x1 = 0; + if(a.y1 < 0) a.y1 = 0; + if(a.x2 > canvas->dsc.header.w - 1) a.x2 = canvas->dsc.header.w - 1; + if(a.y2 > canvas->dsc.header.h - 1) a.y2 = canvas->dsc.header.h - 1; + } + else { + a.x1 = 0; + a.y1 = 0; + a.x2 = canvas->dsc.header.w - 1; + a.y2 = canvas->dsc.header.h - 1; + } + + lv_color_t color = lv_obj_get_style_img_recolor(obj, LV_PART_MAIN); + + uint16_t r_back = r / 2; + uint16_t r_front = r / 2; + + if((r & 0x1) == 0) r_back--; + + bool has_alpha = lv_img_cf_has_alpha(canvas->dsc.header.cf); + + lv_coord_t line_w = lv_img_buf_get_img_size(canvas->dsc.header.w, 1, canvas->dsc.header.cf); + uint8_t * line_buf = lv_mem_buf_get(line_w); + + lv_img_dsc_t line_img; + line_img.data = line_buf; + line_img.header.always_zero = 0; + line_img.header.w = canvas->dsc.header.w; + line_img.header.h = 1; + line_img.header.cf = canvas->dsc.header.cf; + + lv_coord_t x; + lv_coord_t y; + lv_coord_t x_safe; + + for(y = a.y1; y <= a.y2; y++) { + uint32_t asum = 0; + uint32_t rsum = 0; + uint32_t gsum = 0; + uint32_t bsum = 0; + + lv_color_t c; + lv_opa_t opa = LV_OPA_TRANSP; + lv_memcpy(line_buf, &canvas->dsc.data[y * line_w], line_w); + + for(x = a.x1 - r_back; x <= a.x1 + r_front; x++) { + x_safe = x < 0 ? 0 : x; + x_safe = x_safe > canvas->dsc.header.w - 1 ? canvas->dsc.header.w - 1 : x_safe; + + c = lv_img_buf_get_px_color(&line_img, x_safe, 0, color); + if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, x_safe, 0); + + rsum += c.ch.red; +#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP + gsum += (c.ch.green_h << 3) + c.ch.green_l; +#else + gsum += c.ch.green; +#endif + bsum += c.ch.blue; + if(has_alpha) asum += opa; + } + + /*Just to indicate that the px is visible*/ + if(has_alpha == false) asum = LV_OPA_COVER; + + for(x = a.x1; x <= a.x2; x++) { + + if(asum) { + c.ch.red = rsum / r; +#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP + uint8_t gtmp = gsum / r; + c.ch.green_h = gtmp >> 3; + c.ch.green_l = gtmp & 0x7; +#else + c.ch.green = gsum / r; +#endif + c.ch.blue = bsum / r; + if(has_alpha) opa = asum / r; + + lv_img_buf_set_px_color(&canvas->dsc, x, y, c); + } + if(has_alpha) lv_img_buf_set_px_alpha(&canvas->dsc, x, y, opa); + + x_safe = x - r_back; + x_safe = x_safe < 0 ? 0 : x_safe; + c = lv_img_buf_get_px_color(&line_img, x_safe, 0, color); + if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, x_safe, 0); + + rsum -= c.ch.red; +#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP + gsum -= (c.ch.green_h << 3) + c.ch.green_l; +#else + gsum -= c.ch.green; +#endif + bsum -= c.ch.blue; + if(has_alpha) asum -= opa; + + x_safe = x + 1 + r_front; + x_safe = x_safe > canvas->dsc.header.w - 1 ? canvas->dsc.header.w - 1 : x_safe; + c = lv_img_buf_get_px_color(&line_img, x_safe, 0, lv_color_white()); + if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, x_safe, 0); + + rsum += c.ch.red; +#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP + gsum += (c.ch.green_h << 3) + c.ch.green_l; +#else + gsum += c.ch.green; +#endif + bsum += c.ch.blue; + if(has_alpha) asum += opa; + } + } + lv_obj_invalidate(obj); + + lv_mem_buf_release(line_buf); +} + +void lv_canvas_blur_ver(lv_obj_t * obj, const lv_area_t * area, uint16_t r) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + if(r == 0) return; + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + + lv_area_t a; + if(area) { + lv_area_copy(&a, area); + if(a.x1 < 0) a.x1 = 0; + if(a.y1 < 0) a.y1 = 0; + if(a.x2 > canvas->dsc.header.w - 1) a.x2 = canvas->dsc.header.w - 1; + if(a.y2 > canvas->dsc.header.h - 1) a.y2 = canvas->dsc.header.h - 1; + } + else { + a.x1 = 0; + a.y1 = 0; + a.x2 = canvas->dsc.header.w - 1; + a.y2 = canvas->dsc.header.h - 1; + } + + lv_color_t color = lv_obj_get_style_img_recolor(obj, LV_PART_MAIN); + + uint16_t r_back = r / 2; + uint16_t r_front = r / 2; + + if((r & 0x1) == 0) r_back--; + + bool has_alpha = lv_img_cf_has_alpha(canvas->dsc.header.cf); + lv_coord_t col_w = lv_img_buf_get_img_size(1, canvas->dsc.header.h, canvas->dsc.header.cf); + uint8_t * col_buf = lv_mem_buf_get(col_w); + lv_img_dsc_t line_img; + + line_img.data = col_buf; + line_img.header.always_zero = 0; + line_img.header.w = 1; + line_img.header.h = canvas->dsc.header.h; + line_img.header.cf = canvas->dsc.header.cf; + + lv_coord_t x; + lv_coord_t y; + lv_coord_t y_safe; + + for(x = a.x1; x <= a.x2; x++) { + uint32_t asum = 0; + uint32_t rsum = 0; + uint32_t gsum = 0; + uint32_t bsum = 0; + + lv_color_t c; + lv_opa_t opa = LV_OPA_COVER; + + for(y = a.y1 - r_back; y <= a.y1 + r_front; y++) { + y_safe = y < 0 ? 0 : y; + y_safe = y_safe > canvas->dsc.header.h - 1 ? canvas->dsc.header.h - 1 : y_safe; + + c = lv_img_buf_get_px_color(&canvas->dsc, x, y_safe, color); + if(has_alpha) opa = lv_img_buf_get_px_alpha(&canvas->dsc, x, y_safe); + + lv_img_buf_set_px_color(&line_img, 0, y_safe, c); + if(has_alpha) lv_img_buf_set_px_alpha(&line_img, 0, y_safe, opa); + + rsum += c.ch.red; +#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP + gsum += (c.ch.green_h << 3) + c.ch.green_l; +#else + gsum += c.ch.green; +#endif + bsum += c.ch.blue; + if(has_alpha) asum += opa; + } + + /*Just to indicate that the px is visible*/ + if(has_alpha == false) asum = LV_OPA_COVER; + + for(y = a.y1; y <= a.y2; y++) { + if(asum) { + c.ch.red = rsum / r; +#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP + uint8_t gtmp = gsum / r; + c.ch.green_h = gtmp >> 3; + c.ch.green_l = gtmp & 0x7; +#else + c.ch.green = gsum / r; +#endif + c.ch.blue = bsum / r; + if(has_alpha) opa = asum / r; + + lv_img_buf_set_px_color(&canvas->dsc, x, y, c); + } + if(has_alpha) lv_img_buf_set_px_alpha(&canvas->dsc, x, y, opa); + + y_safe = y - r_back; + y_safe = y_safe < 0 ? 0 : y_safe; + c = lv_img_buf_get_px_color(&line_img, 0, y_safe, color); + if(has_alpha) opa = lv_img_buf_get_px_alpha(&line_img, 0, y_safe); + + rsum -= c.ch.red; +#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP + gsum -= (c.ch.green_h << 3) + c.ch.green_l; +#else + gsum -= c.ch.green; +#endif + bsum -= c.ch.blue; + if(has_alpha) asum -= opa; + + y_safe = y + 1 + r_front; + y_safe = y_safe > canvas->dsc.header.h - 1 ? canvas->dsc.header.h - 1 : y_safe; + + c = lv_img_buf_get_px_color(&canvas->dsc, x, y_safe, color); + if(has_alpha) opa = lv_img_buf_get_px_alpha(&canvas->dsc, x, y_safe); + + lv_img_buf_set_px_color(&line_img, 0, y_safe, c); + if(has_alpha) lv_img_buf_set_px_alpha(&line_img, 0, y_safe, opa); + + rsum += c.ch.red; +#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP + gsum += (c.ch.green_h << 3) + c.ch.green_l; +#else + gsum += c.ch.green; +#endif + bsum += c.ch.blue; + if(has_alpha) asum += opa; + } + } + + lv_obj_invalidate(obj); + + lv_mem_buf_release(col_buf); +} + +void lv_canvas_fill_bg(lv_obj_t * canvas, lv_color_t color, lv_opa_t opa) +{ + LV_ASSERT_OBJ(canvas, MY_CLASS); + + lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); + + if(dsc->header.cf == LV_IMG_CF_INDEXED_1BIT) { + uint32_t row_byte_cnt = (dsc->header.w + 7) >> 3; + /*+8 skip the palette*/ + lv_memset((uint8_t *)dsc->data + 8, color.full ? 0xff : 0x00, row_byte_cnt * dsc->header.h); + } + else if(dsc->header.cf == LV_IMG_CF_ALPHA_1BIT) { + uint32_t row_byte_cnt = (dsc->header.w + 7) >> 3; + lv_memset((uint8_t *)dsc->data, opa > LV_OPA_50 ? 0xff : 0x00, row_byte_cnt * dsc->header.h); + } + else { + uint32_t x; + uint32_t y; + for(y = 0; y < dsc->header.h; y++) { + for(x = 0; x < dsc->header.w; x++) { + lv_img_buf_set_px_color(dsc, x, y, color); + lv_img_buf_set_px_alpha(dsc, x, y, opa); + } + } + } + + lv_obj_invalidate(canvas); +} + +void lv_canvas_draw_rect(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, + const lv_draw_rect_dsc_t * draw_dsc) +{ + LV_ASSERT_OBJ(canvas, MY_CLASS); + + lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); + + if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { + LV_LOG_WARN("lv_canvas_draw_rect: can't draw to LV_IMG_CF_INDEXED canvas"); + return; + } + + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ + lv_disp_t fake_disp; + lv_disp_drv_t driver; + lv_area_t clip_area; + init_fake_disp(canvas, &fake_disp, &driver, &clip_area); + + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&fake_disp); + + /*Disable anti-aliasing if drawing with transparent color to chroma keyed canvas*/ + lv_color_t ctransp = LV_COLOR_CHROMA_KEY; + if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED && + draw_dsc->bg_color.full == ctransp.full) { + fake_disp.driver->antialiasing = 0; + } + + lv_area_t coords; + coords.x1 = x; + coords.y1 = y; + coords.x2 = x + w - 1; + coords.y2 = y + h - 1; + + lv_draw_rect(driver.draw_ctx, draw_dsc, &coords); + + _lv_refr_set_disp_refreshing(refr_ori); + + deinit_fake_disp(canvas, &fake_disp); + + lv_obj_invalidate(canvas); +} + +void lv_canvas_draw_text(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_t max_w, + lv_draw_label_dsc_t * draw_dsc, const char * txt) +{ + LV_ASSERT_OBJ(canvas, MY_CLASS); + + lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); + + if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { + LV_LOG_WARN("lv_canvas_draw_text: can't draw to LV_IMG_CF_INDEXED canvas"); + return; + } + + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ + lv_disp_t fake_disp; + lv_disp_drv_t driver; + lv_area_t clip_area; + init_fake_disp(canvas, &fake_disp, &driver, &clip_area); + + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&fake_disp); + + lv_area_t coords; + coords.x1 = x; + coords.y1 = y; + coords.x2 = x + max_w - 1; + coords.y2 = dsc->header.h - 1; + lv_draw_label(driver.draw_ctx, draw_dsc, &coords, txt, NULL); + + _lv_refr_set_disp_refreshing(refr_ori); + + deinit_fake_disp(canvas, &fake_disp); + + lv_obj_invalidate(canvas); +} + +void lv_canvas_draw_img(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, const void * src, + const lv_draw_img_dsc_t * draw_dsc) +{ + LV_ASSERT_OBJ(canvas, MY_CLASS); + + lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); + + if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { + LV_LOG_WARN("lv_canvas_draw_img: can't draw to LV_IMG_CF_INDEXED canvas"); + return; + } + + lv_img_header_t header; + lv_res_t res = lv_img_decoder_get_info(src, &header); + if(res != LV_RES_OK) { + LV_LOG_WARN("lv_canvas_draw_img: Couldn't get the image data."); + return; + } + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ + lv_disp_t fake_disp; + lv_disp_drv_t driver; + lv_area_t clip_area; + init_fake_disp(canvas, &fake_disp, &driver, &clip_area); + + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&fake_disp); + + lv_area_t coords; + coords.x1 = x; + coords.y1 = y; + coords.x2 = x + header.w - 1; + coords.y2 = y + header.h - 1; + + lv_draw_img(driver.draw_ctx, draw_dsc, &coords, src); + + _lv_refr_set_disp_refreshing(refr_ori); + + deinit_fake_disp(canvas, &fake_disp); + + lv_obj_invalidate(canvas); +} + +void lv_canvas_draw_line(lv_obj_t * canvas, const lv_point_t points[], uint32_t point_cnt, + const lv_draw_line_dsc_t * draw_dsc) +{ + LV_ASSERT_OBJ(canvas, MY_CLASS); + + lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); + + if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { + LV_LOG_WARN("lv_canvas_draw_line: can't draw to LV_IMG_CF_INDEXED canvas"); + return; + } + + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ + lv_disp_t fake_disp; + lv_disp_drv_t driver; + lv_area_t clip_area; + init_fake_disp(canvas, &fake_disp, &driver, &clip_area); + + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&fake_disp); + + + /*Disable anti-aliasing if drawing with transparent color to chroma keyed canvas*/ + lv_color_t ctransp = LV_COLOR_CHROMA_KEY; + if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED && + draw_dsc->color.full == ctransp.full) { + fake_disp.driver->antialiasing = 0; + } + + uint32_t i; + for(i = 0; i < point_cnt - 1; i++) { + lv_draw_line(driver.draw_ctx, draw_dsc, &points[i], &points[i + 1]); + } + + _lv_refr_set_disp_refreshing(refr_ori); + + deinit_fake_disp(canvas, &fake_disp); + + lv_obj_invalidate(canvas); +} + +void lv_canvas_draw_polygon(lv_obj_t * canvas, const lv_point_t points[], uint32_t point_cnt, + const lv_draw_rect_dsc_t * draw_dsc) +{ + LV_ASSERT_OBJ(canvas, MY_CLASS); + + lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); + + if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { + LV_LOG_WARN("lv_canvas_draw_polygon: can't draw to LV_IMG_CF_INDEXED canvas"); + return; + } + + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ + lv_disp_t fake_disp; + lv_disp_drv_t driver; + lv_area_t clip_area; + init_fake_disp(canvas, &fake_disp, &driver, &clip_area); + + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&fake_disp); + + /*Disable anti-aliasing if drawing with transparent color to chroma keyed canvas*/ + lv_color_t ctransp = LV_COLOR_CHROMA_KEY; + if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED && + draw_dsc->bg_color.full == ctransp.full) { + fake_disp.driver->antialiasing = 0; + } + + lv_draw_polygon(driver.draw_ctx, draw_dsc, points, point_cnt); + + _lv_refr_set_disp_refreshing(refr_ori); + + deinit_fake_disp(canvas, &fake_disp); + + lv_obj_invalidate(canvas); +} + +void lv_canvas_draw_arc(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_t r, int32_t start_angle, + int32_t end_angle, const lv_draw_arc_dsc_t * draw_dsc) +{ +#if LV_DRAW_COMPLEX + LV_ASSERT_OBJ(canvas, MY_CLASS); + + lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); + + if(dsc->header.cf >= LV_IMG_CF_INDEXED_1BIT && dsc->header.cf <= LV_IMG_CF_INDEXED_8BIT) { + LV_LOG_WARN("lv_canvas_draw_arc: can't draw to LV_IMG_CF_INDEXED canvas"); + return; + } + + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ + lv_disp_t fake_disp; + lv_disp_drv_t driver; + lv_area_t clip_area; + init_fake_disp(canvas, &fake_disp, &driver, &clip_area); + + lv_disp_t * refr_ori = _lv_refr_get_disp_refreshing(); + _lv_refr_set_disp_refreshing(&fake_disp); + + lv_point_t p = {x, y}; + lv_draw_arc(driver.draw_ctx, draw_dsc, &p, r, start_angle, end_angle); + + _lv_refr_set_disp_refreshing(refr_ori); + + deinit_fake_disp(canvas, &fake_disp); + + lv_obj_invalidate(canvas); +#else + LV_UNUSED(canvas); + LV_UNUSED(x); + LV_UNUSED(y); + LV_UNUSED(r); + LV_UNUSED(start_angle); + LV_UNUSED(end_angle); + LV_UNUSED(draw_dsc); + LV_LOG_WARN("Can't draw arc with LV_DRAW_COMPLEX == 0"); +#endif +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_canvas_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + LV_TRACE_OBJ_CREATE("begin"); + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + + canvas->dsc.header.always_zero = 0; + canvas->dsc.header.cf = LV_IMG_CF_TRUE_COLOR; + canvas->dsc.header.h = 0; + canvas->dsc.header.w = 0; + canvas->dsc.data_size = 0; + canvas->dsc.data = NULL; + + lv_img_set_src(obj, &canvas->dsc); + + LV_TRACE_OBJ_CREATE("finished"); +} + +static void lv_canvas_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + LV_TRACE_OBJ_CREATE("begin"); + + lv_canvas_t * canvas = (lv_canvas_t *)obj; + lv_img_cache_invalidate_src(&canvas->dsc); +} + + +static void init_fake_disp(lv_obj_t * canvas, lv_disp_t * disp, lv_disp_drv_t * drv, lv_area_t * clip_area) +{ + lv_img_dsc_t * dsc = lv_canvas_get_img(canvas); + + clip_area->x1 = 0; + clip_area->x2 = dsc->header.w - 1; + clip_area->y1 = 0; + clip_area->y2 = dsc->header.h - 1; + + /*Allocate the fake driver on the stack as the entire display doesn't outlive this function*/ + lv_memset_00(disp, sizeof(lv_disp_t)); + disp->driver = drv; + + lv_disp_drv_init(disp->driver); + disp->driver->hor_res = dsc->header.w; + disp->driver->ver_res = dsc->header.h; + + lv_draw_ctx_t * draw_ctx = lv_mem_alloc(sizeof(lv_draw_sw_ctx_t)); + LV_ASSERT_MALLOC(draw_ctx); + if(draw_ctx == NULL) return; + lv_draw_sw_init_ctx(drv, draw_ctx); + disp->driver->draw_ctx = draw_ctx; + draw_ctx->clip_area = clip_area; + draw_ctx->buf_area = clip_area; + draw_ctx->buf = (void *)dsc->data; + + lv_disp_drv_use_generic_set_px_cb(disp->driver, dsc->header.cf); + if(LV_COLOR_SCREEN_TRANSP && dsc->header.cf != LV_IMG_CF_TRUE_COLOR_ALPHA) { + drv->screen_transp = 0; + } +} + +static void deinit_fake_disp(lv_obj_t * canvas, lv_disp_t * disp) +{ + LV_UNUSED(canvas); + lv_draw_sw_deinit_ctx(disp->driver, disp->driver->draw_ctx); + lv_mem_free(disp->driver->draw_ctx); +} + + + +#endif diff --git a/L3_Middlewares/LVGL/src/widgets/lv_canvas.h b/L3_Middlewares/LVGL/src/widgets/lv_canvas.h new file mode 100644 index 0000000..71f0516 --- /dev/null +++ b/L3_Middlewares/LVGL/src/widgets/lv_canvas.h @@ -0,0 +1,280 @@ +/** + * @file lv_canvas.h + * + */ + +#ifndef LV_CANVAS_H +#define LV_CANVAS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" + +#if LV_USE_CANVAS != 0 + +#include "../core/lv_obj.h" +#include "../widgets/lv_img.h" +#include "../draw/lv_draw_img.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ +extern const lv_obj_class_t lv_canvas_class; + +/*Data of canvas*/ +typedef struct { + lv_img_t img; + lv_img_dsc_t dsc; +} lv_canvas_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create a canvas object + * @param parent pointer to an object, it will be the parent of the new canvas + * @return pointer to the created canvas + */ +lv_obj_t * lv_canvas_create(lv_obj_t * parent); + +/*===================== + * Setter functions + *====================*/ + +/** + * Set a buffer for the canvas. + * @param buf a buffer where the content of the canvas will be. + * The required size is (lv_img_color_format_get_px_size(cf) * w) / 8 * h) + * It can be allocated with `lv_mem_alloc()` or + * it can be statically allocated array (e.g. static lv_color_t buf[100*50]) or + * it can be an address in RAM or external SRAM + * @param canvas pointer to a canvas object + * @param w width of the canvas + * @param h height of the canvas + * @param cf color format. `LV_IMG_CF_...` + */ +void lv_canvas_set_buffer(lv_obj_t * canvas, void * buf, lv_coord_t w, lv_coord_t h, lv_img_cf_t cf); + +/** + * Set the color of a pixel on the canvas + * @param canvas + * @param x x coordinate of the point to set + * @param y x coordinate of the point to set + * @param c color of the pixel + */ +void lv_canvas_set_px_color(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_color_t c); + +/** + * DEPRECATED: added only for backward compatibility + */ +static inline void lv_canvas_set_px(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_color_t c) +{ + lv_canvas_set_px_color(canvas, x, y, c); +} + +/** + * Set the opacity of a pixel on the canvas + * @param canvas + * @param x x coordinate of the point to set + * @param y x coordinate of the point to set + * @param opa opacity of the pixel (0..255) + */ +void lv_canvas_set_px_opa(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_opa_t opa); + + +/** + * Set the palette color of a canvas with index format. Valid only for `LV_IMG_CF_INDEXED1/2/4/8` + * @param canvas pointer to canvas object + * @param id the palette color to set: + * - for `LV_IMG_CF_INDEXED1`: 0..1 + * - for `LV_IMG_CF_INDEXED2`: 0..3 + * - for `LV_IMG_CF_INDEXED4`: 0..15 + * - for `LV_IMG_CF_INDEXED8`: 0..255 + * @param c the color to set + */ +void lv_canvas_set_palette(lv_obj_t * canvas, uint8_t id, lv_color_t c); + +/*===================== + * Getter functions + *====================*/ + +/** + * Get the color of a pixel on the canvas + * @param canvas + * @param x x coordinate of the point to set + * @param y x coordinate of the point to set + * @return color of the point + */ +lv_color_t lv_canvas_get_px(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y); + +/** + * Get the image of the canvas as a pointer to an `lv_img_dsc_t` variable. + * @param canvas pointer to a canvas object + * @return pointer to the image descriptor. + */ +lv_img_dsc_t * lv_canvas_get_img(lv_obj_t * canvas); + +/*===================== + * Other functions + *====================*/ + +/** + * Copy a buffer to the canvas + * @param canvas pointer to a canvas object + * @param to_copy buffer to copy. The color format has to match with the canvas's buffer color + * format + * @param x left side of the destination position + * @param y top side of the destination position + * @param w width of the buffer to copy + * @param h height of the buffer to copy + */ +void lv_canvas_copy_buf(lv_obj_t * canvas, const void * to_copy, lv_coord_t x, lv_coord_t y, lv_coord_t w, + lv_coord_t h); + +/** + * Transform and image and store the result on a canvas. + * @param canvas pointer to a canvas object to store the result of the transformation. + * @param img pointer to an image descriptor to transform. + * Can be the image descriptor of an other canvas too (`lv_canvas_get_img()`). + * @param angle the angle of rotation (0..3600), 0.1 deg resolution + * @param zoom zoom factor (256 no zoom); + * @param offset_x offset X to tell where to put the result data on destination canvas + * @param offset_y offset X to tell where to put the result data on destination canvas + * @param pivot_x pivot X of rotation. Relative to the source canvas + * Set to `source width / 2` to rotate around the center + * @param pivot_y pivot Y of rotation. Relative to the source canvas + * Set to `source height / 2` to rotate around the center + * @param antialias apply anti-aliasing during the transformation. Looks better but slower. + */ +void lv_canvas_transform(lv_obj_t * canvas, lv_img_dsc_t * img, int16_t angle, uint16_t zoom, lv_coord_t offset_x, + lv_coord_t offset_y, + int32_t pivot_x, int32_t pivot_y, bool antialias); + +/** + * Apply horizontal blur on the canvas + * @param canvas pointer to a canvas object + * @param area the area to blur. If `NULL` the whole canvas will be blurred. + * @param r radius of the blur + */ +void lv_canvas_blur_hor(lv_obj_t * canvas, const lv_area_t * area, uint16_t r); + +/** + * Apply vertical blur on the canvas + * @param canvas pointer to a canvas object + * @param area the area to blur. If `NULL` the whole canvas will be blurred. + * @param r radius of the blur + */ +void lv_canvas_blur_ver(lv_obj_t * canvas, const lv_area_t * area, uint16_t r); + +/** + * Fill the canvas with color + * @param canvas pointer to a canvas + * @param color the background color + * @param opa the desired opacity + */ +void lv_canvas_fill_bg(lv_obj_t * canvas, lv_color_t color, lv_opa_t opa); + +/** + * Draw a rectangle on the canvas + * @param canvas pointer to a canvas object + * @param x left coordinate of the rectangle + * @param y top coordinate of the rectangle + * @param w width of the rectangle + * @param h height of the rectangle + * @param draw_dsc descriptor of the rectangle + */ +void lv_canvas_draw_rect(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_t w, lv_coord_t h, + const lv_draw_rect_dsc_t * draw_dsc); + +/** + * Draw a text on the canvas. + * @param canvas pointer to a canvas object + * @param x left coordinate of the text + * @param y top coordinate of the text + * @param max_w max width of the text. The text will be wrapped to fit into this size + * @param draw_dsc pointer to a valid label descriptor `lv_draw_label_dsc_t` + * @param txt text to display + */ +void lv_canvas_draw_text(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_t max_w, + lv_draw_label_dsc_t * draw_dsc, const char * txt); + +/** + * Draw an image on the canvas + * @param canvas pointer to a canvas object + * @param x left coordinate of the image + * @param y top coordinate of the image + * @param src image source. Can be a pointer an `lv_img_dsc_t` variable or a path an image. + * @param draw_dsc pointer to a valid label descriptor `lv_draw_img_dsc_t` + */ +void lv_canvas_draw_img(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, const void * src, + const lv_draw_img_dsc_t * draw_dsc); + +/** + * Draw a line on the canvas + * @param canvas pointer to a canvas object + * @param points point of the line + * @param point_cnt number of points + * @param draw_dsc pointer to an initialized `lv_draw_line_dsc_t` variable + */ +void lv_canvas_draw_line(lv_obj_t * canvas, const lv_point_t points[], uint32_t point_cnt, + const lv_draw_line_dsc_t * draw_dsc); + +/** + * Draw a polygon on the canvas + * @param canvas pointer to a canvas object + * @param points point of the polygon + * @param point_cnt number of points + * @param draw_dsc pointer to an initialized `lv_draw_rect_dsc_t` variable + */ +void lv_canvas_draw_polygon(lv_obj_t * canvas, const lv_point_t points[], uint32_t point_cnt, + const lv_draw_rect_dsc_t * draw_dsc); + +/** + * Draw an arc on the canvas + * @param canvas pointer to a canvas object + * @param x origo x of the arc + * @param y origo y of the arc + * @param r radius of the arc + * @param start_angle start angle in degrees + * @param end_angle end angle in degrees + * @param draw_dsc pointer to an initialized `lv_draw_line_dsc_t` variable + */ +void lv_canvas_draw_arc(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_t r, int32_t start_angle, + int32_t end_angle, const lv_draw_arc_dsc_t * draw_dsc); + +/********************** + * MACROS + **********************/ +#define LV_CANVAS_BUF_SIZE_TRUE_COLOR(w, h) LV_IMG_BUF_SIZE_TRUE_COLOR(w, h) +#define LV_CANVAS_BUF_SIZE_TRUE_COLOR_CHROMA_KEYED(w, h) LV_IMG_BUF_SIZE_TRUE_COLOR_CHROMA_KEYED(w, h) +#define LV_CANVAS_BUF_SIZE_TRUE_COLOR_ALPHA(w, h) LV_IMG_BUF_SIZE_TRUE_COLOR_ALPHA(w, h) + +/*+ 1: to be sure no fractional row*/ +#define LV_CANVAS_BUF_SIZE_ALPHA_1BIT(w, h) LV_IMG_BUF_SIZE_ALPHA_1BIT(w, h) +#define LV_CANVAS_BUF_SIZE_ALPHA_2BIT(w, h) LV_IMG_BUF_SIZE_ALPHA_2BIT(w, h) +#define LV_CANVAS_BUF_SIZE_ALPHA_4BIT(w, h) LV_IMG_BUF_SIZE_ALPHA_4BIT(w, h) +#define LV_CANVAS_BUF_SIZE_ALPHA_8BIT(w, h) LV_IMG_BUF_SIZE_ALPHA_8BIT(w, h) + +/*4 * X: for palette*/ +#define LV_CANVAS_BUF_SIZE_INDEXED_1BIT(w, h) LV_IMG_BUF_SIZE_INDEXED_1BIT(w, h) +#define LV_CANVAS_BUF_SIZE_INDEXED_2BIT(w, h) LV_IMG_BUF_SIZE_INDEXED_2BIT(w, h) +#define LV_CANVAS_BUF_SIZE_INDEXED_4BIT(w, h) LV_IMG_BUF_SIZE_INDEXED_4BIT(w, h) +#define LV_CANVAS_BUF_SIZE_INDEXED_8BIT(w, h) LV_IMG_BUF_SIZE_INDEXED_8BIT(w, h) + +#endif /*LV_USE_CANVAS*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_CANVAS_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/checkbox/lv_checkbox.c b/L3_Middlewares/LVGL/src/widgets/lv_checkbox.c similarity index 52% rename from L3_Middlewares/LVGL/src/widgets/checkbox/lv_checkbox.c rename to L3_Middlewares/LVGL/src/widgets/lv_checkbox.c index 7a987ef..fa79b37 100644 --- a/L3_Middlewares/LVGL/src/widgets/checkbox/lv_checkbox.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_checkbox.c @@ -6,21 +6,18 @@ /********************* * INCLUDES *********************/ -#include "lv_checkbox_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_checkbox.h" #if LV_USE_CHECKBOX != 0 -#include "../../misc/lv_assert.h" -#include "../../misc/lv_text_ap.h" -#include "../../core/lv_group.h" -#include "../../draw/lv_draw.h" -#include "../../stdlib/lv_string.h" +#include "../misc/lv_assert.h" +#include "../misc/lv_txt_ap.h" +#include "../core/lv_group.h" +#include "../draw/lv_draw.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_checkbox_class) +#define MY_CLASS &lv_checkbox_class /********************** * TYPEDEFS @@ -45,8 +42,7 @@ const lv_obj_class_t lv_checkbox_class = { .height_def = LV_SIZE_CONTENT, .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, .instance_size = sizeof(lv_checkbox_t), - .base_class = &lv_obj_class, - .name = "checkbox", + .base_class = &lv_obj_class }; /********************** @@ -72,30 +68,23 @@ lv_obj_t * lv_checkbox_create(lv_obj_t * parent) void lv_checkbox_set_text(lv_obj_t * obj, const char * txt) { lv_checkbox_t * cb = (lv_checkbox_t *)obj; - - if(NULL != txt) { - size_t len; - #if LV_USE_ARABIC_PERSIAN_CHARS - len = lv_text_ap_calc_bytes_count(txt) + 1; + size_t len = _lv_txt_ap_calc_bytes_cnt(txt); #else - len = lv_strlen(txt) + 1; + size_t len = strlen(txt); #endif - if(!cb->static_txt) cb->txt = lv_realloc(cb->txt, len); - else cb->txt = lv_malloc(len); - - LV_ASSERT_MALLOC(cb->txt); - if(NULL == cb->txt) return; - + char * _txt = (char *)cb->txt; + if(!cb->static_txt) _txt = lv_mem_realloc(_txt, len + 1); + else _txt = lv_mem_alloc(len + 1); #if LV_USE_ARABIC_PERSIAN_CHARS - lv_text_ap_proc(txt, cb->txt); + _lv_txt_ap_proc(txt, _txt); #else - lv_strcpy(cb->txt, txt); + strcpy(_txt, txt); #endif - cb->static_txt = 0; - } + cb->txt = _txt; + cb->static_txt = 0; lv_obj_refresh_self_size(obj); lv_obj_invalidate(obj); @@ -105,7 +94,7 @@ void lv_checkbox_set_text_static(lv_obj_t * obj, const char * txt) { lv_checkbox_t * cb = (lv_checkbox_t *)obj; - if(!cb->static_txt) lv_free(cb->txt); + if(!cb->static_txt) lv_mem_free((void *)cb->txt); cb->txt = (char *)txt; cb->static_txt = 1; @@ -135,18 +124,11 @@ static void lv_checkbox_constructor(const lv_obj_class_t * class_p, lv_obj_t * o lv_checkbox_t * cb = (lv_checkbox_t *)obj; -#if LV_WIDGETS_HAS_DEFAULT_VALUE - cb->txt = (char *)"Check box"; - cb->static_txt = 1; -#else - cb->txt = (char *)""; + cb->txt = "Check box"; cb->static_txt = 1; -#endif - lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_CHECKABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); LV_TRACE_OBJ_CREATE("finished"); } @@ -158,7 +140,7 @@ static void lv_checkbox_destructor(const lv_obj_class_t * class_p, lv_obj_t * ob lv_checkbox_t * cb = (lv_checkbox_t *)obj; if(!cb->static_txt) { - lv_free(cb->txt); + lv_mem_free((void *)cb->txt); cb->txt = NULL; } LV_TRACE_OBJ_CREATE("finished"); @@ -168,31 +150,31 @@ static void lv_checkbox_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /*Call the ancestor's event handler*/ res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); if(code == LV_EVENT_GET_SELF_SIZE) { lv_point_t * p = lv_event_get_param(e); lv_checkbox_t * cb = (lv_checkbox_t *)obj; const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - int32_t font_h = lv_font_get_line_height(font); - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - int32_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); + lv_coord_t font_h = lv_font_get_line_height(font); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); lv_point_t txt_size; - lv_text_get_size(&txt_size, cb->txt, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE); + lv_txt_get_size(&txt_size, cb->txt, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE); - int32_t bg_colp = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); - int32_t marker_leftp = lv_obj_get_style_pad_left(obj, LV_PART_INDICATOR); - int32_t marker_rightp = lv_obj_get_style_pad_right(obj, LV_PART_INDICATOR); - int32_t marker_topp = lv_obj_get_style_pad_top(obj, LV_PART_INDICATOR); - int32_t marker_bottomp = lv_obj_get_style_pad_bottom(obj, LV_PART_INDICATOR); + lv_coord_t bg_colp = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); + lv_coord_t marker_leftp = lv_obj_get_style_pad_left(obj, LV_PART_INDICATOR); + lv_coord_t marker_rightp = lv_obj_get_style_pad_right(obj, LV_PART_INDICATOR); + lv_coord_t marker_topp = lv_obj_get_style_pad_top(obj, LV_PART_INDICATOR); + lv_coord_t marker_bottomp = lv_obj_get_style_pad_bottom(obj, LV_PART_INDICATOR); lv_point_t marker_size; marker_size.x = font_h + marker_leftp + marker_rightp; marker_size.y = font_h + marker_topp + marker_bottomp; @@ -201,8 +183,8 @@ static void lv_checkbox_event(const lv_obj_class_t * class_p, lv_event_t * e) p->y = LV_MAX(marker_size.y, txt_size.y); } else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { - int32_t * s = lv_event_get_param(e); - int32_t m = lv_obj_calculate_ext_draw_size(obj, LV_PART_INDICATOR); + lv_coord_t * s = lv_event_get_param(e); + lv_coord_t m = lv_obj_calculate_ext_draw_size(obj, LV_PART_INDICATOR); *s = LV_MAX(*s, m); } else if(code == LV_EVENT_DRAW_MAIN) { @@ -212,74 +194,71 @@ static void lv_checkbox_event(const lv_obj_class_t * class_p, lv_event_t * e) static void lv_checkbox_draw(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_checkbox_t * cb = (lv_checkbox_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - int32_t font_h = lv_font_get_line_height(font); - - const bool is_rtl = LV_BASE_DIR_RTL == lv_obj_get_style_base_dir(obj, LV_PART_MAIN); + lv_coord_t font_h = lv_font_get_line_height(font); - int32_t bg_border = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - int32_t bg_topp = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + bg_border; - int32_t bg_p = is_rtl ? lv_obj_get_style_pad_right(obj, LV_PART_MAIN) : lv_obj_get_style_pad_left(obj, - LV_PART_MAIN) + bg_border; - int32_t bg_colp = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); + lv_coord_t bg_border = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t bg_topp = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + bg_border; + lv_coord_t bg_leftp = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + bg_border; + lv_coord_t bg_colp = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); - int32_t marker_leftp = lv_obj_get_style_pad_left(obj, LV_PART_INDICATOR); - int32_t marker_rightp = lv_obj_get_style_pad_right(obj, LV_PART_INDICATOR); - int32_t marker_topp = lv_obj_get_style_pad_top(obj, LV_PART_INDICATOR); - int32_t marker_bottomp = lv_obj_get_style_pad_bottom(obj, LV_PART_INDICATOR); + lv_coord_t marker_leftp = lv_obj_get_style_pad_left(obj, LV_PART_INDICATOR); + lv_coord_t marker_rightp = lv_obj_get_style_pad_right(obj, LV_PART_INDICATOR); + lv_coord_t marker_topp = lv_obj_get_style_pad_top(obj, LV_PART_INDICATOR); + lv_coord_t marker_bottomp = lv_obj_get_style_pad_bottom(obj, LV_PART_INDICATOR); - int32_t transf_w = lv_obj_get_style_transform_width(obj, LV_PART_INDICATOR); - int32_t transf_h = lv_obj_get_style_transform_height(obj, LV_PART_INDICATOR); + lv_coord_t transf_w = lv_obj_get_style_transform_width(obj, LV_PART_INDICATOR); + lv_coord_t transf_h = lv_obj_get_style_transform_height(obj, LV_PART_INDICATOR); lv_draw_rect_dsc_t indic_dsc; lv_draw_rect_dsc_init(&indic_dsc); lv_obj_init_draw_rect_dsc(obj, LV_PART_INDICATOR, &indic_dsc); lv_area_t marker_area; - if(is_rtl) { - marker_area.x2 = obj->coords.x2 - bg_p; - marker_area.x1 = marker_area.x2 - font_h - marker_leftp - marker_rightp + 1; - } - else { - marker_area.x1 = obj->coords.x1 + bg_p; - marker_area.x2 = marker_area.x1 + font_h + marker_leftp + marker_rightp - 1; - } + marker_area.x1 = obj->coords.x1 + bg_leftp; + marker_area.x2 = marker_area.x1 + font_h + marker_leftp + marker_rightp - 1; marker_area.y1 = obj->coords.y1 + bg_topp; marker_area.y2 = marker_area.y1 + font_h + marker_topp + marker_bottomp - 1; lv_area_t marker_area_transf; lv_area_copy(&marker_area_transf, &marker_area); - lv_area_increase(&marker_area_transf, transf_w, transf_h); - - lv_draw_rect(layer, &indic_dsc, &marker_area_transf); - - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - int32_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); + marker_area_transf.x1 -= transf_w; + marker_area_transf.x2 += transf_w; + marker_area_transf.y1 -= transf_h; + marker_area_transf.y2 += transf_h; + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.rect_dsc = &indic_dsc; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_CHECKBOX_DRAW_PART_BOX; + part_draw_dsc.draw_area = &marker_area_transf; + part_draw_dsc.part = LV_PART_INDICATOR; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_rect(draw_ctx, &indic_dsc, &marker_area_transf); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); lv_point_t txt_size; - lv_text_get_size(&txt_size, cb->txt, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE); + lv_txt_get_size(&txt_size, cb->txt, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE); lv_draw_label_dsc_t txt_dsc; lv_draw_label_dsc_init(&txt_dsc); lv_obj_init_draw_label_dsc(obj, LV_PART_MAIN, &txt_dsc); - txt_dsc.text = cb->txt; - int32_t y_ofs = (lv_area_get_height(&marker_area) - font_h) / 2; + lv_coord_t y_ofs = (lv_area_get_height(&marker_area) - font_h) / 2; lv_area_t txt_area; - if(is_rtl) { - txt_area.x2 = marker_area.x1 - bg_colp; - txt_area.x1 = txt_area.x2 - txt_size.x; - } - else { - txt_area.x1 = marker_area.x2 + bg_colp; - txt_area.x2 = txt_area.x1 + txt_size.x; - } + txt_area.x1 = marker_area.x2 + bg_colp; + txt_area.x2 = txt_area.x1 + txt_size.x; txt_area.y1 = obj->coords.y1 + bg_topp + y_ofs; txt_area.y2 = txt_area.y1 + txt_size.y; - lv_draw_label(layer, &txt_dsc, &txt_area); + lv_draw_label(draw_ctx, &txt_dsc, &txt_area, cb->txt, NULL); } #endif diff --git a/L3_Middlewares/LVGL/src/widgets/checkbox/lv_checkbox.h b/L3_Middlewares/LVGL/src/widgets/lv_checkbox.h similarity index 68% rename from L3_Middlewares/LVGL/src/widgets/checkbox/lv_checkbox.h rename to L3_Middlewares/LVGL/src/widgets/lv_checkbox.h index 804ff60..11405bd 100644 --- a/L3_Middlewares/LVGL/src/widgets/checkbox/lv_checkbox.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_checkbox.h @@ -1,5 +1,5 @@ /** - * @file lv_checkbox.h + * @file lv_cb.h * */ @@ -13,8 +13,8 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" -#include "../../core/lv_obj.h" +#include "../lv_conf_internal.h" +#include "../core/lv_obj.h" #if LV_USE_CHECKBOX != 0 @@ -22,7 +22,25 @@ extern "C" { * DEFINES *********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_checkbox_class; +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_obj_t obj; + const char * txt; + uint32_t static_txt : 1; +} lv_checkbox_t; + +extern const lv_obj_class_t lv_checkbox_class; + +/** + * `type` field in `lv_obj_draw_part_dsc_t` if `class_p = lv_checkbox_class` + * Used in `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` + */ +typedef enum { + LV_CHECKBOX_DRAW_PART_BOX, /**< The tick box*/ +} lv_checkbox_draw_part_type_t; /********************** * GLOBAL PROTOTYPES @@ -42,7 +60,7 @@ lv_obj_t * lv_checkbox_create(lv_obj_t * parent); /** * Set the text of a check box. `txt` will be copied and may be deallocated * after this function returns. - * @param obj pointer to a check box + * @param cb pointer to a check box * @param txt the text of the check box. NULL to refresh with the current text. */ void lv_checkbox_set_text(lv_obj_t * obj, const char * txt); @@ -50,7 +68,7 @@ void lv_checkbox_set_text(lv_obj_t * obj, const char * txt); /** * Set the text of a check box. `txt` must not be deallocated during the life * of this checkbox. - * @param obj pointer to a check box + * @param cb pointer to a check box * @param txt the text of the check box. */ void lv_checkbox_set_text_static(lv_obj_t * obj, const char * txt); @@ -61,7 +79,7 @@ void lv_checkbox_set_text_static(lv_obj_t * obj, const char * txt); /** * Get the text of a check box - * @param obj pointer to check box object + * @param cb pointer to check box object * @return pointer to the text of the check box */ const char * lv_checkbox_get_text(const lv_obj_t * obj); diff --git a/L3_Middlewares/LVGL/src/widgets/dropdown/lv_dropdown.c b/L3_Middlewares/LVGL/src/widgets/lv_dropdown.c similarity index 70% rename from L3_Middlewares/LVGL/src/widgets/dropdown/lv_dropdown.c rename to L3_Middlewares/LVGL/src/widgets/lv_dropdown.c index 517479c..765bdde 100644 --- a/L3_Middlewares/LVGL/src/widgets/dropdown/lv_dropdown.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_dropdown.c @@ -6,28 +6,25 @@ /********************* * INCLUDES *********************/ -#include "lv_dropdown_private.h" -#include "../../misc/lv_area_private.h" -#include "../../core/lv_obj_class_private.h" -#include "../../core/lv_obj.h" +#include "../core/lv_obj.h" +#include "lv_dropdown.h" #if LV_USE_DROPDOWN != 0 -#include "../../misc/lv_assert.h" -#include "../../draw/lv_draw_private.h" -#include "../../core/lv_group.h" -#include "../../indev/lv_indev.h" -#include "../../display/lv_display.h" -#include "../../font/lv_symbol_def.h" -#include "../../misc/lv_anim.h" -#include "../../misc/lv_math.h" -#include "../../misc/lv_text_ap.h" -#include "../../misc/lv_text_private.h" -#include "../../stdlib/lv_string.h" +#include "../misc/lv_assert.h" +#include "../draw/lv_draw.h" +#include "../core/lv_group.h" +#include "../core/lv_indev.h" +#include "../core/lv_disp.h" +#include "../font/lv_symbol_def.h" +#include "../misc/lv_anim.h" +#include "../misc/lv_math.h" +#include "../misc/lv_txt_ap.h" +#include /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_dropdown_class) +#define MY_CLASS &lv_dropdown_class #define MY_CLASS_LIST &lv_dropdownlist_class #define LV_DROPDOWN_PR_NONE 0xFFFF @@ -50,68 +47,18 @@ static void lv_dropdownlist_destructor(const lv_obj_class_t * class_p, lv_obj_t static void lv_dropdown_list_event(const lv_obj_class_t * class_p, lv_event_t * e); static void draw_list(lv_event_t * e); -static void draw_box(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t id, lv_state_t state); -static void draw_box_label(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t id, lv_state_t state); -static lv_result_t btn_release_handler(lv_obj_t * obj); -static lv_result_t list_release_handler(lv_obj_t * list_obj); +static void draw_box(lv_obj_t * dropdown_obj, lv_draw_ctx_t * draw_ctx, uint16_t id, lv_state_t state); +static void draw_box_label(lv_obj_t * dropdown_obj, lv_draw_ctx_t * draw_ctx, uint16_t id, lv_state_t state); +static lv_res_t btn_release_handler(lv_obj_t * obj); +static lv_res_t list_release_handler(lv_obj_t * list_obj); static void list_press_handler(lv_obj_t * page); -static uint32_t get_id_on_point(lv_obj_t * dropdown_obj, int32_t y); +static uint16_t get_id_on_point(lv_obj_t * dropdown_obj, lv_coord_t y); static void position_to_selected(lv_obj_t * obj); static lv_obj_t * get_label(const lv_obj_t * obj); /********************** * STATIC VARIABLES **********************/ -#if LV_USE_OBJ_PROPERTY -static const lv_property_ops_t properties[] = { - { - .id = LV_PROPERTY_DROPDOWN_TEXT, - .setter = lv_dropdown_set_text, - .getter = lv_dropdown_get_text, - }, - { - .id = LV_PROPERTY_DROPDOWN_OPTIONS, - .setter = lv_dropdown_set_options, - .getter = lv_dropdown_get_options, - }, - { - .id = LV_PROPERTY_DROPDOWN_OPTION_COUNT, - .setter = NULL, - .getter = lv_dropdown_get_option_count, - }, - { - .id = LV_PROPERTY_DROPDOWN_SELECTED, - .setter = lv_dropdown_set_selected, - .getter = lv_dropdown_get_selected, - }, - { - .id = LV_PROPERTY_DROPDOWN_DIR, - .setter = lv_dropdown_set_dir, - .getter = lv_dropdown_get_dir, - }, - { - .id = LV_PROPERTY_DROPDOWN_SYMBOL, - .setter = lv_dropdown_set_symbol, - .getter = lv_dropdown_get_symbol, - }, - { - .id = LV_PROPERTY_DROPDOWN_SELECTED_HIGHLIGHT, - .setter = lv_dropdown_set_selected_highlight, - .getter = lv_dropdown_get_selected_highlight, - }, - { - .id = LV_PROPERTY_DROPDOWN_LIST, - .setter = NULL, - .getter = lv_dropdown_get_list, - }, - { - .id = LV_PROPERTY_DROPDOWN_IS_OPEN, - .setter = NULL, - .getter = lv_dropdown_is_open, - }, -}; -#endif - const lv_obj_class_t lv_dropdown_class = { .constructor_cb = lv_dropdown_constructor, .destructor_cb = lv_dropdown_destructor, @@ -121,19 +68,7 @@ const lv_obj_class_t lv_dropdown_class = { .instance_size = sizeof(lv_dropdown_t), .editable = LV_OBJ_CLASS_EDITABLE_TRUE, .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, - .base_class = &lv_obj_class, - .name = "dropdown", -#if LV_USE_OBJ_PROPERTY - .prop_index_start = LV_PROPERTY_DROPDOWN_START, - .prop_index_end = LV_PROPERTY_DROPDOWN_END, - .properties = properties, - .properties_count = sizeof(properties) / sizeof(properties[0]), - -#if LV_USE_OBJ_PROPERTY_NAME - .property_names = lv_dropdown_property_names, - .names_count = sizeof(lv_dropdown_property_names) / sizeof(lv_property_name_t), -#endif -#endif + .base_class = &lv_obj_class }; const lv_obj_class_t lv_dropdownlist_class = { @@ -141,10 +76,10 @@ const lv_obj_class_t lv_dropdownlist_class = { .destructor_cb = lv_dropdownlist_destructor, .event_cb = lv_dropdown_list_event, .instance_size = sizeof(lv_dropdown_list_t), - .base_class = &lv_obj_class, - .name = "dropdown-list", + .base_class = &lv_obj_class }; + /********************** * MACROS **********************/ @@ -195,25 +130,25 @@ void lv_dropdown_set_options(lv_obj_t * obj, const char * options) /*Allocate space for the new text*/ #if LV_USE_ARABIC_PERSIAN_CHARS == 0 - size_t len = lv_strlen(options) + 1; + size_t len = strlen(options) + 1; #else - size_t len = lv_text_ap_calc_bytes_count(options) + 1; + size_t len = _lv_txt_ap_calc_bytes_cnt(options) + 1; #endif if(dropdown->options != NULL && dropdown->static_txt == 0) { - lv_free(dropdown->options); + lv_mem_free(dropdown->options); dropdown->options = NULL; } - dropdown->options = lv_malloc(len); + dropdown->options = lv_mem_alloc(len); LV_ASSERT_MALLOC(dropdown->options); if(dropdown->options == NULL) return; #if LV_USE_ARABIC_PERSIAN_CHARS == 0 - lv_strcpy(dropdown->options, options); + strcpy(dropdown->options, options); #else - lv_text_ap_proc(options, dropdown->options); + _lv_txt_ap_proc(options, dropdown->options); #endif /*Now the text is dynamically allocated*/ @@ -241,7 +176,7 @@ void lv_dropdown_set_options_static(lv_obj_t * obj, const char * options) dropdown->sel_opt_id_orig = 0; if(dropdown->static_txt == 0 && dropdown->options != NULL) { - lv_free(dropdown->options); + lv_mem_free(dropdown->options); dropdown->options = NULL; } @@ -262,22 +197,26 @@ void lv_dropdown_add_option(lv_obj_t * obj, const char * option, uint32_t pos) /*Convert static options to dynamic*/ if(dropdown->static_txt != 0) { char * static_options = dropdown->options; - dropdown->options = lv_strdup(static_options); + size_t len = strlen(static_options) + 1; + + dropdown->options = lv_mem_alloc(len); LV_ASSERT_MALLOC(dropdown->options); if(dropdown->options == NULL) return; + + strcpy(dropdown->options, static_options); dropdown->static_txt = 0; } /*Allocate space for the new option*/ - size_t old_len = (dropdown->options == NULL) ? 0 : lv_strlen(dropdown->options); + size_t old_len = (dropdown->options == NULL) ? 0 : strlen(dropdown->options); #if LV_USE_ARABIC_PERSIAN_CHARS == 0 - size_t ins_len = lv_strlen(option) + 1; + size_t ins_len = strlen(option) + 1; #else - size_t ins_len = lv_text_ap_calc_bytes_count(option) + 1; + size_t ins_len = _lv_txt_ap_calc_bytes_cnt(option) + 1; #endif size_t new_len = ins_len + old_len + 2; /*+2 for terminating NULL and possible \n*/ - dropdown->options = lv_realloc(dropdown->options, new_len + 1); + dropdown->options = lv_mem_realloc(dropdown->options, new_len + 1); LV_ASSERT_MALLOC(dropdown->options); if(dropdown->options == NULL) return; @@ -297,21 +236,21 @@ void lv_dropdown_add_option(lv_obj_t * obj, const char * option, uint32_t pos) /*Add delimiter to existing options*/ if((insert_pos > 0) && (pos >= dropdown->option_cnt)) - lv_text_ins(dropdown->options, lv_text_encoded_get_char_id(dropdown->options, insert_pos++), "\n"); + _lv_txt_ins(dropdown->options, _lv_txt_encoded_get_char_id(dropdown->options, insert_pos++), "\n"); /*Insert the new option, adding \n if necessary*/ - char * ins_buf = lv_malloc(ins_len + 2); /*+ 2 for terminating NULL and possible \n*/ + char * ins_buf = lv_mem_buf_get(ins_len + 2); /*+ 2 for terminating NULL and possible \n*/ LV_ASSERT_MALLOC(ins_buf); if(ins_buf == NULL) return; #if LV_USE_ARABIC_PERSIAN_CHARS == 0 - lv_strcpy(ins_buf, option); + strcpy(ins_buf, option); #else - lv_text_ap_proc(option, ins_buf); + _lv_txt_ap_proc(option, ins_buf); #endif - if(pos < dropdown->option_cnt) lv_strcat(ins_buf, "\n"); + if(pos < dropdown->option_cnt) strcat(ins_buf, "\n"); - lv_text_ins(dropdown->options, lv_text_encoded_get_char_id(dropdown->options, insert_pos), ins_buf); - lv_free(ins_buf); + _lv_txt_ins(dropdown->options, _lv_txt_encoded_get_char_id(dropdown->options, insert_pos), ins_buf); + lv_mem_buf_release(ins_buf); dropdown->option_cnt++; @@ -326,7 +265,7 @@ void lv_dropdown_clear_options(lv_obj_t * obj) if(dropdown->options == NULL) return; if(dropdown->static_txt == 0) - lv_free(dropdown->options); + lv_mem_free(dropdown->options); dropdown->options = NULL; dropdown->static_txt = 0; @@ -336,7 +275,7 @@ void lv_dropdown_clear_options(lv_obj_t * obj) if(dropdown->list) lv_obj_invalidate(dropdown->list); } -void lv_dropdown_set_selected(lv_obj_t * obj, uint32_t sel_opt) +void lv_dropdown_set_selected(lv_obj_t * obj, uint16_t sel_opt) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -411,7 +350,7 @@ const char * lv_dropdown_get_options(const lv_obj_t * obj) return dropdown->options == NULL ? "" : dropdown->options; } -uint32_t lv_dropdown_get_selected(const lv_obj_t * obj) +uint16_t lv_dropdown_get_selected(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -420,7 +359,7 @@ uint32_t lv_dropdown_get_selected(const lv_obj_t * obj) return dropdown->sel_opt_id; } -uint32_t lv_dropdown_get_option_count(const lv_obj_t * obj) +uint16_t lv_dropdown_get_option_cnt(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -440,7 +379,7 @@ void lv_dropdown_get_selected_str(const lv_obj_t * obj, char * buf, uint32_t buf size_t txt_len; if(dropdown->options) { - txt_len = lv_strlen(dropdown->options); + txt_len = strlen(dropdown->options); } else { buf[0] = '\0'; @@ -454,7 +393,7 @@ void lv_dropdown_get_selected_str(const lv_obj_t * obj, char * buf, uint32_t buf uint32_t c; for(c = 0; i < txt_len && dropdown->options[i] != '\n'; c++, i++) { if(buf_size && c >= buf_size - 1) { - LV_LOG_WARN("the buffer was too small"); + LV_LOG_WARN("lv_dropdown_get_selected_str: the buffer was too small"); break; } buf[c] = dropdown->options[i]; @@ -468,13 +407,13 @@ int32_t lv_dropdown_get_option_index(lv_obj_t * obj, const char * option) const char * opts = lv_dropdown_get_options(obj); uint32_t char_i = 0; uint32_t opt_i = 0; + uint32_t option_len = strlen(option); const char * start = opts; - const size_t option_len = lv_strlen(option); /*avoid recomputing this multiple times in the loop*/ - while(start[0] != '\0') { + while(start[char_i] != '\0') { for(char_i = 0; (start[char_i] != '\n') && (start[char_i] != '\0'); char_i++); - if(option_len == char_i && lv_memcmp(start, option, LV_MIN(option_len, char_i)) == 0) { + if(option_len == char_i && memcmp(start, option, LV_MIN(option_len, char_i)) == 0) { return opt_i; } @@ -487,6 +426,7 @@ int32_t lv_dropdown_get_option_index(lv_obj_t * obj, const char * option) return -1; } + const char * lv_dropdown_get_symbol(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -521,10 +461,10 @@ void lv_dropdown_open(lv_obj_t * dropdown_obj) lv_obj_add_state(dropdown_obj, LV_STATE_CHECKED); lv_obj_set_parent(dropdown->list, lv_obj_get_screen(dropdown_obj)); lv_obj_move_to_index(dropdown->list, -1); - lv_obj_remove_flag(dropdown->list, LV_OBJ_FLAG_HIDDEN); + lv_obj_clear_flag(dropdown->list, LV_OBJ_FLAG_HIDDEN); /*To allow styling the list*/ - lv_obj_send_event(dropdown_obj, LV_EVENT_READY, NULL); + lv_event_send(dropdown_obj, LV_EVENT_READY, NULL); lv_obj_t * label = get_label(dropdown_obj); lv_label_set_text_static(label, dropdown->options); @@ -537,13 +477,13 @@ void lv_dropdown_open(lv_obj_t * dropdown_obj) lv_obj_set_width(dropdown->list, lv_obj_get_width(dropdown_obj)); } - int32_t label_h = lv_obj_get_height(label); - int32_t border_width = lv_obj_get_style_border_width(dropdown->list, LV_PART_MAIN); - int32_t top = lv_obj_get_style_pad_top(dropdown->list, LV_PART_MAIN) + border_width; - int32_t bottom = lv_obj_get_style_pad_bottom(dropdown->list, LV_PART_MAIN) + border_width; + lv_coord_t label_h = lv_obj_get_height(label); + lv_coord_t border_width = lv_obj_get_style_border_width(dropdown->list, LV_PART_MAIN); + lv_coord_t top = lv_obj_get_style_pad_top(dropdown->list, LV_PART_MAIN) + border_width; + lv_coord_t bottom = lv_obj_get_style_pad_bottom(dropdown->list, LV_PART_MAIN) + border_width; - int32_t list_fit_h = label_h + top + bottom; - int32_t list_h = list_fit_h; + lv_coord_t list_fit_h = label_h + top + bottom; + lv_coord_t list_h = list_fit_h; lv_dir_t dir = dropdown->dir; /*No space on the bottom? See if top is better.*/ @@ -586,8 +526,8 @@ void lv_dropdown_open(lv_obj_t * dropdown_obj) lv_obj_update_layout(dropdown->list); if(dropdown->dir == LV_DIR_LEFT || dropdown->dir == LV_DIR_RIGHT) { - int32_t y1 = lv_obj_get_y(dropdown->list); - int32_t y2 = lv_obj_get_y2(dropdown->list); + lv_coord_t y1 = lv_obj_get_y(dropdown->list); + lv_coord_t y2 = lv_obj_get_y2(dropdown->list); if(y2 >= LV_VER_RES) { lv_obj_set_y(dropdown->list, y1 - (y2 - LV_VER_RES) - 1); } @@ -614,13 +554,13 @@ void lv_dropdown_close(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - lv_obj_remove_state(obj, LV_STATE_CHECKED); + lv_obj_clear_state(obj, LV_STATE_CHECKED); lv_dropdown_t * dropdown = (lv_dropdown_t *)obj; dropdown->pr_opt_id = LV_DROPDOWN_PR_NONE; lv_obj_add_flag(dropdown->list, LV_OBJ_FLAG_HIDDEN); - lv_obj_send_event(obj, LV_EVENT_CANCEL, NULL); + lv_event_send(obj, LV_EVENT_CANCEL, NULL); } bool lv_dropdown_is_open(lv_obj_t * obj) @@ -664,9 +604,7 @@ static void lv_dropdown_constructor(const lv_obj_class_t * class_p, lv_obj_t * o dropdown->dir = LV_DIR_BOTTOM; lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); -#if LV_WIDGETS_HAS_DEFAULT_VALUE lv_dropdown_set_options_static(obj, "Option 1\nOption 2\nOption 3"); -#endif dropdown->list = lv_dropdown_list_create(lv_obj_get_screen(obj)); lv_dropdown_list_t * list = (lv_dropdown_list_t *)dropdown->list; @@ -681,12 +619,12 @@ static void lv_dropdown_destructor(const lv_obj_class_t * class_p, lv_obj_t * ob lv_dropdown_t * dropdown = (lv_dropdown_t *)obj; if(dropdown->list) { - lv_obj_delete(dropdown->list); + lv_obj_del(dropdown->list); dropdown->list = NULL; } if(!dropdown->static_txt) { - lv_free(dropdown->options); + lv_mem_free(dropdown->options); dropdown->options = NULL; } } @@ -696,8 +634,8 @@ static void lv_dropdownlist_constructor(const lv_obj_class_t * class_p, lv_obj_t LV_UNUSED(class_p); LV_TRACE_OBJ_CREATE("begin"); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICK_FOCUSABLE); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICK_FOCUSABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_IGNORE_LAYOUT); lv_obj_add_flag(obj, LV_OBJ_FLAG_HIDDEN); @@ -719,20 +657,20 @@ static void lv_dropdown_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /*Call the ancestor's event handler*/ res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_dropdown_t * dropdown = (lv_dropdown_t *)obj; if(code == LV_EVENT_FOCUSED) { lv_group_t * g = lv_obj_get_group(obj); bool editing = lv_group_get_editing(g); - lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_active()); + lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); /*Encoders need special handling*/ if(indev_type == LV_INDEV_TYPE_ENCODER) { @@ -752,7 +690,7 @@ static void lv_dropdown_event(const lv_obj_class_t * class_p, lv_event_t * e) } else if(code == LV_EVENT_RELEASED) { res = btn_release_handler(obj); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; } else if(code == LV_EVENT_STYLE_CHANGED) { lv_obj_refresh_self_size(obj); @@ -766,7 +704,7 @@ static void lv_dropdown_event(const lv_obj_class_t * class_p, lv_event_t * e) p->y = lv_font_get_line_height(font); } else if(code == LV_EVENT_KEY) { - uint32_t c = lv_event_get_key(e); + char c = *((char *)lv_event_get_param(e)); if(c == LV_KEY_RIGHT || c == LV_KEY_DOWN) { if(!lv_dropdown_is_open(obj)) { lv_dropdown_open(obj); @@ -791,28 +729,15 @@ static void lv_dropdown_event(const lv_obj_class_t * class_p, lv_event_t * e) lv_dropdown_close(obj); } else if(c == LV_KEY_ENTER) { - /* Handle the ENTER key only if it was send by another object. + /* Handle the ENTER key only if it was send by an other object. * Do no process it if ENTER is sent by the dropdown because it's handled in LV_EVENT_RELEASED */ - lv_obj_t * indev_obj = lv_indev_get_active_obj(); + lv_obj_t * indev_obj = lv_indev_get_obj_act(); if(indev_obj != obj) { res = btn_release_handler(obj); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; } } } - else if(code == LV_EVENT_ROTARY) { - if(!lv_dropdown_is_open(obj)) { - lv_dropdown_open(obj); - } - else { - int32_t r = lv_event_get_rotary_diff(e); - int32_t new_id = dropdown->sel_opt_id + r; - new_id = LV_CLAMP(0, new_id, (int32_t)dropdown->option_cnt - 1); - - dropdown->sel_opt_id = new_id; - position_to_selected(obj); - } - } else if(code == LV_EVENT_DRAW_MAIN) { draw_main(e); } @@ -822,20 +747,20 @@ static void lv_dropdown_list_event(const lv_obj_class_t * class_p, lv_event_t * { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /*Call the ancestor's event handler*/ lv_event_code_t code = lv_event_get_code(e); if(code != LV_EVENT_DRAW_POST) { res = lv_obj_event_base(MY_CLASS_LIST, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; } - lv_obj_t * list = lv_event_get_current_target(e); + lv_obj_t * list = lv_event_get_target(e); lv_obj_t * dropdown_obj = ((lv_dropdown_list_t *)list)->dropdown; lv_dropdown_t * dropdown = (lv_dropdown_t *)dropdown_obj; if(code == LV_EVENT_RELEASED) { - if(lv_indev_get_scroll_obj(lv_indev_active()) == NULL) { + if(lv_indev_get_scroll_obj(lv_indev_get_act()) == NULL) { list_release_handler(list); } } @@ -849,19 +774,21 @@ static void lv_dropdown_list_event(const lv_obj_class_t * class_p, lv_event_t * else if(code == LV_EVENT_DRAW_POST) { draw_list(e); res = lv_obj_event_base(MY_CLASS_LIST, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; } } + static void draw_main(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_dropdown_t * dropdown = (lv_dropdown_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); - int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - int32_t left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; - int32_t right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN) + border_width; + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; + lv_coord_t right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN) + border_width; + lv_coord_t top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; lv_draw_label_dsc_t symbol_dsc; lv_draw_label_dsc_init(&symbol_dsc); @@ -869,9 +796,9 @@ static void draw_main(lv_event_t * e) /*If no text specified use the selected option*/ const char * opt_txt; - char buf[128]; if(dropdown->text) opt_txt = dropdown->text; else { + char * buf = lv_mem_buf_get(128); lv_dropdown_get_selected_str(obj, buf, 128); opt_txt = buf; } @@ -881,20 +808,20 @@ static void draw_main(lv_event_t * e) if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) == LV_BASE_DIR_RTL) symbol_to_left = true; if(dropdown->symbol) { - lv_image_src_t symbol_type = lv_image_src_get_type(dropdown->symbol); - int32_t symbol_w; - int32_t symbol_h; - if(symbol_type == LV_IMAGE_SRC_SYMBOL) { + lv_img_src_t symbol_type = lv_img_src_get_type(dropdown->symbol); + lv_coord_t symbol_w; + lv_coord_t symbol_h; + if(symbol_type == LV_IMG_SRC_SYMBOL) { lv_point_t size; - lv_text_get_size(&size, dropdown->symbol, symbol_dsc.font, symbol_dsc.letter_space, symbol_dsc.line_space, LV_COORD_MAX, - symbol_dsc.flag); + lv_txt_get_size(&size, dropdown->symbol, symbol_dsc.font, symbol_dsc.letter_space, symbol_dsc.line_space, LV_COORD_MAX, + symbol_dsc.flag); symbol_w = size.x; symbol_h = size.y; } else { - lv_image_header_t header; - lv_result_t res = lv_image_decoder_get_info(dropdown->symbol, &header); - if(res == LV_RESULT_OK) { + lv_img_header_t header; + lv_res_t res = lv_img_decoder_get_info(dropdown->symbol, &header); + if(res == LV_RES_OK) { symbol_w = header.w; symbol_h = header.h; } @@ -905,29 +832,30 @@ static void draw_main(lv_event_t * e) } lv_area_t symbol_area; - symbol_area.y1 = obj->coords.y1; - symbol_area.y2 = symbol_area.y1 + symbol_h - 1; - symbol_area.x1 = obj->coords.x1; - symbol_area.x2 = symbol_area.x1 + symbol_w - 1; if(symbol_to_left) { - lv_area_align(&obj->coords, &symbol_area, LV_ALIGN_LEFT_MID, left, 0); + symbol_area.x1 = obj->coords.x1 + left; + symbol_area.x2 = symbol_area.x1 + symbol_w - 1; } else { - lv_area_align(&obj->coords, &symbol_area, LV_ALIGN_RIGHT_MID, -right, 0); + symbol_area.x1 = obj->coords.x2 - right - symbol_w; + symbol_area.x2 = symbol_area.x1 + symbol_w - 1; } - if(symbol_type == LV_IMAGE_SRC_SYMBOL) { - symbol_dsc.text = dropdown->symbol; - lv_draw_label(layer, &symbol_dsc, &symbol_area); + if(symbol_type == LV_IMG_SRC_SYMBOL) { + symbol_area.y1 = obj->coords.y1 + top; + symbol_area.y2 = symbol_area.y1 + symbol_h - 1; + lv_draw_label(draw_ctx, &symbol_dsc, &symbol_area, dropdown->symbol, NULL); } else { - lv_draw_image_dsc_t img_dsc; - lv_draw_image_dsc_init(&img_dsc); - lv_obj_init_draw_image_dsc(obj, LV_PART_INDICATOR, &img_dsc); - lv_point_set(&img_dsc.pivot, symbol_w / 2, symbol_h / 2); - img_dsc.rotation = lv_obj_get_style_transform_rotation(obj, LV_PART_INDICATOR); - img_dsc.src = dropdown->symbol; - lv_draw_image(layer, &img_dsc, &symbol_area); + symbol_area.y1 = obj->coords.y1 + (lv_obj_get_height(obj) - symbol_h) / 2; + symbol_area.y2 = symbol_area.y1 + symbol_h - 1; + lv_draw_img_dsc_t img_dsc; + lv_draw_img_dsc_init(&img_dsc); + lv_obj_init_draw_img_dsc(obj, LV_PART_INDICATOR, &img_dsc); + img_dsc.pivot.x = symbol_w / 2; + img_dsc.pivot.y = symbol_h / 2; + img_dsc.angle = lv_obj_get_style_transform_angle(obj, LV_PART_INDICATOR); + lv_draw_img(draw_ctx, &img_dsc, &symbol_area, dropdown->symbol); } } @@ -936,73 +864,72 @@ static void draw_main(lv_event_t * e) lv_obj_init_draw_label_dsc(obj, LV_PART_MAIN, &label_dsc); lv_point_t size; - lv_text_get_size(&size, opt_txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, - label_dsc.flag); + lv_txt_get_size(&size, opt_txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, + label_dsc.flag); lv_area_t txt_area; - txt_area.x1 = obj->coords.x1; - txt_area.x2 = txt_area.x1 + size.x - 1; - txt_area.y1 = obj->coords.y1; - txt_area.y2 = txt_area.y1 + size.y - 1; + txt_area.y1 = obj->coords.y1 + top; + txt_area.y2 = txt_area.y1 + size.y; /*Center align the text if no symbol*/ if(dropdown->symbol == NULL) { - lv_area_align(&obj->coords, &txt_area, LV_ALIGN_CENTER, 0, 0); + txt_area.x1 = obj->coords.x1 + (lv_obj_get_width(obj) - size.x) / 2; + txt_area.x2 = txt_area.x1 + size.x; } else { /*Text to the right*/ if(symbol_to_left) { - lv_area_align(&obj->coords, &txt_area, LV_ALIGN_RIGHT_MID, -right, 0); + txt_area.x1 = obj->coords.x2 - right - size.x; + txt_area.x2 = txt_area.x1 + size.x; } else { - lv_area_align(&obj->coords, &txt_area, LV_ALIGN_LEFT_MID, left, 0); + txt_area.x1 = obj->coords.x1 + left; + txt_area.x2 = txt_area.x1 + size.x; } } + lv_draw_label(draw_ctx, &label_dsc, &txt_area, opt_txt, NULL); - label_dsc.text = opt_txt; if(dropdown->text == NULL) { - label_dsc.text_local = true; + lv_mem_buf_release((char *)opt_txt); } - - lv_draw_label(layer, &label_dsc, &txt_area); } static void draw_list(lv_event_t * e) { - lv_obj_t * list_obj = lv_event_get_current_target(e); + lv_obj_t * list_obj = lv_event_get_target(e); lv_dropdown_list_t * list = (lv_dropdown_list_t *)list_obj; lv_obj_t * dropdown_obj = list->dropdown; lv_dropdown_t * dropdown = (lv_dropdown_t *)dropdown_obj; - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); /* Clip area might be too large too to shadow but * the selected option can be drawn on only the background*/ lv_area_t clip_area_core; bool has_common; - has_common = lv_area_intersect(&clip_area_core, &layer->_clip_area, &dropdown->list->coords); + has_common = _lv_area_intersect(&clip_area_core, draw_ctx->clip_area, &dropdown->list->coords); if(has_common) { - const lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = clip_area_core; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_area_core; if(dropdown->selected_highlight) { if(dropdown->pr_opt_id == dropdown->sel_opt_id) { - draw_box(dropdown_obj, layer, dropdown->pr_opt_id, LV_STATE_CHECKED | LV_STATE_PRESSED); - draw_box_label(dropdown_obj, layer, dropdown->pr_opt_id, LV_STATE_CHECKED | LV_STATE_PRESSED); + draw_box(dropdown_obj, draw_ctx, dropdown->pr_opt_id, LV_STATE_CHECKED | LV_STATE_PRESSED); + draw_box_label(dropdown_obj, draw_ctx, dropdown->pr_opt_id, LV_STATE_CHECKED | LV_STATE_PRESSED); } else { - draw_box(dropdown_obj, layer, dropdown->pr_opt_id, LV_STATE_PRESSED); - draw_box_label(dropdown_obj, layer, dropdown->pr_opt_id, LV_STATE_PRESSED); - draw_box(dropdown_obj, layer, dropdown->sel_opt_id, LV_STATE_CHECKED); - draw_box_label(dropdown_obj, layer, dropdown->sel_opt_id, LV_STATE_CHECKED); + draw_box(dropdown_obj, draw_ctx, dropdown->pr_opt_id, LV_STATE_PRESSED); + draw_box_label(dropdown_obj, draw_ctx, dropdown->pr_opt_id, LV_STATE_PRESSED); + draw_box(dropdown_obj, draw_ctx, dropdown->sel_opt_id, LV_STATE_CHECKED); + draw_box_label(dropdown_obj, draw_ctx, dropdown->sel_opt_id, LV_STATE_CHECKED); } } else { - draw_box(dropdown_obj, layer, dropdown->pr_opt_id, LV_STATE_PRESSED); - draw_box_label(dropdown_obj, layer, dropdown->pr_opt_id, LV_STATE_PRESSED); + draw_box(dropdown_obj, draw_ctx, dropdown->pr_opt_id, LV_STATE_PRESSED); + draw_box_label(dropdown_obj, draw_ctx, dropdown->pr_opt_id, LV_STATE_PRESSED); } - layer->_clip_area = clip_area_ori; + draw_ctx->clip_area = clip_area_ori; } } -static void draw_box(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t id, lv_state_t state) +static void draw_box(lv_obj_t * dropdown_obj, lv_draw_ctx_t * draw_ctx, uint16_t id, lv_state_t state) { if(id == LV_DROPDOWN_PR_NONE) return; @@ -1017,8 +944,8 @@ static void draw_box(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t id, l /*Draw a rectangle under the selected item*/ const lv_font_t * font = lv_obj_get_style_text_font(list_obj, LV_PART_SELECTED); - int32_t line_space = lv_obj_get_style_text_line_space(list_obj, LV_PART_SELECTED); - int32_t font_h = lv_font_get_line_height(font); + lv_coord_t line_space = lv_obj_get_style_text_line_space(list_obj, LV_PART_SELECTED); + lv_coord_t font_h = lv_font_get_line_height(font); /*Draw the selected*/ lv_obj_t * label = get_label(dropdown_obj); @@ -1034,13 +961,13 @@ static void draw_box(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t id, l lv_draw_rect_dsc_t sel_rect; lv_draw_rect_dsc_init(&sel_rect); lv_obj_init_draw_rect_dsc(list_obj, LV_PART_SELECTED, &sel_rect); - lv_draw_rect(layer, &sel_rect, &rect_area); + lv_draw_rect(draw_ctx, &sel_rect, &rect_area); list_obj->state = state_ori; list_obj->skip_trans = 0; } -static void draw_box_label(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t id, lv_state_t state) +static void draw_box_label(lv_obj_t * dropdown_obj, lv_draw_ctx_t * draw_ctx, uint16_t id, lv_state_t state) { if(id == LV_DROPDOWN_PR_NONE) return; @@ -1063,7 +990,7 @@ static void draw_box_label(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t lv_obj_t * label = get_label(dropdown_obj); if(label == NULL) return; - int32_t font_h = lv_font_get_line_height(label_dsc.font); + lv_coord_t font_h = lv_font_get_line_height(label_dsc.font); lv_area_t area_sel; area_sel.y1 = label->coords.y1; @@ -1075,31 +1002,31 @@ static void draw_box_label(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t area_sel.x2 = list_obj->coords.x2; lv_area_t mask_sel; bool area_ok; - area_ok = lv_area_intersect(&mask_sel, &layer->_clip_area, &area_sel); + area_ok = _lv_area_intersect(&mask_sel, draw_ctx->clip_area, &area_sel); if(area_ok) { - const lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = mask_sel; - label_dsc.text = lv_label_get_text(label); - lv_draw_label(layer, &label_dsc, &label->coords); - layer->_clip_area = clip_area_ori; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &mask_sel; + lv_draw_label(draw_ctx, &label_dsc, &label->coords, lv_label_get_text(label), NULL); + draw_ctx->clip_area = clip_area_ori; } list_obj->state = state_orig; list_obj->skip_trans = 0; } -static lv_result_t btn_release_handler(lv_obj_t * obj) + +static lv_res_t btn_release_handler(lv_obj_t * obj) { lv_dropdown_t * dropdown = (lv_dropdown_t *)obj; - lv_indev_t * indev = lv_indev_active(); + lv_indev_t * indev = lv_indev_get_act(); if(lv_indev_get_scroll_obj(indev) == NULL) { if(lv_dropdown_is_open(obj)) { lv_dropdown_close(obj); if(dropdown->sel_opt_id_orig != dropdown->sel_opt_id) { dropdown->sel_opt_id_orig = dropdown->sel_opt_id; - lv_result_t res; + lv_res_t res; uint32_t id = dropdown->sel_opt_id; /*Just to use uint32_t in event data*/ - res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, &id); - if(res != LV_RESULT_OK) return res; + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, &id); + if(res != LV_RES_OK) return res; lv_obj_invalidate(obj); } lv_indev_type_t indev_type = lv_indev_get_type(indev); @@ -1115,21 +1042,21 @@ static lv_result_t btn_release_handler(lv_obj_t * obj) dropdown->sel_opt_id = dropdown->sel_opt_id_orig; lv_obj_invalidate(obj); } - return LV_RESULT_OK; + return LV_RES_OK; } /** * Called when a drop down list is released to open it or set new option * @param list pointer to the drop down list's list - * @return LV_RESULT_INVALID if the list is not being deleted in the user callback. Else LV_RESULT_OK + * @return LV_RES_INV if the list is not being deleted in the user callback. Else LV_RES_OK */ -static lv_result_t list_release_handler(lv_obj_t * list_obj) +static lv_res_t list_release_handler(lv_obj_t * list_obj) { lv_dropdown_list_t * list = (lv_dropdown_list_t *) list_obj; lv_obj_t * dropdown_obj = list->dropdown; lv_dropdown_t * dropdown = (lv_dropdown_t *)dropdown_obj; - lv_indev_t * indev = lv_indev_active(); + lv_indev_t * indev = lv_indev_get_act(); /*Leave edit mode once a new item is selected*/ if(lv_indev_get_type(indev) == LV_INDEV_TYPE_ENCODER) { dropdown->sel_opt_id_orig = dropdown->sel_opt_id; @@ -1153,10 +1080,10 @@ static lv_result_t list_release_handler(lv_obj_t * list_obj) if(dropdown->text == NULL) lv_obj_invalidate(dropdown_obj); uint32_t id = dropdown->sel_opt_id; /*Just to use uint32_t in event data*/ - lv_result_t res = lv_obj_send_event(dropdown_obj, LV_EVENT_VALUE_CHANGED, &id); - if(res != LV_RESULT_OK) return res; + lv_res_t res = lv_event_send(dropdown_obj, LV_EVENT_VALUE_CHANGED, &id); + if(res != LV_RES_OK) return res; - return LV_RESULT_OK; + return LV_RES_OK; } static void list_press_handler(lv_obj_t * list_obj) @@ -1165,7 +1092,7 @@ static void list_press_handler(lv_obj_t * list_obj) lv_obj_t * dropdown_obj = list->dropdown; lv_dropdown_t * dropdown = (lv_dropdown_t *)dropdown_obj; - lv_indev_t * indev = lv_indev_active(); + lv_indev_t * indev = lv_indev_get_act(); if(indev && (lv_indev_get_type(indev) == LV_INDEV_TYPE_POINTER || lv_indev_get_type(indev) == LV_INDEV_TYPE_BUTTON)) { lv_point_t p; lv_indev_get_point(indev, &p); @@ -1174,7 +1101,7 @@ static void list_press_handler(lv_obj_t * list_obj) } } -static uint32_t get_id_on_point(lv_obj_t * dropdown_obj, int32_t y) +static uint16_t get_id_on_point(lv_obj_t * dropdown_obj, lv_coord_t y) { lv_dropdown_t * dropdown = (lv_dropdown_t *)dropdown_obj; lv_obj_t * label = get_label(dropdown_obj); @@ -1182,13 +1109,13 @@ static uint32_t get_id_on_point(lv_obj_t * dropdown_obj, int32_t y) y -= label->coords.y1; const lv_font_t * font = lv_obj_get_style_text_font(label, LV_PART_MAIN); - int32_t font_h = lv_font_get_line_height(font); - int32_t line_space = lv_obj_get_style_text_line_space(label, LV_PART_MAIN); + lv_coord_t font_h = lv_font_get_line_height(font); + lv_coord_t line_space = lv_obj_get_style_text_line_space(label, LV_PART_MAIN); y += line_space / 2; - int32_t h = font_h + line_space; + lv_coord_t h = font_h + line_space; - uint32_t opt = y / h; + uint16_t opt = y / h; if(opt >= dropdown->option_cnt) opt = dropdown->option_cnt - 1; return opt; @@ -1208,10 +1135,10 @@ static void position_to_selected(lv_obj_t * dropdown_obj) if(lv_obj_get_height(label) <= lv_obj_get_content_height(dropdown_obj)) return; const lv_font_t * font = lv_obj_get_style_text_font(label, LV_PART_MAIN); - int32_t font_h = lv_font_get_line_height(font); - int32_t line_space = lv_obj_get_style_text_line_space(label, LV_PART_MAIN); - int32_t unit_h = font_h + line_space; - int32_t line_y1 = dropdown->sel_opt_id * unit_h; + lv_coord_t font_h = lv_font_get_line_height(font); + lv_coord_t line_space = lv_obj_get_style_text_line_space(label, LV_PART_MAIN); + lv_coord_t unit_h = font_h + line_space; + lv_coord_t line_y1 = dropdown->sel_opt_id * unit_h; /*Scroll to the selected option*/ lv_obj_scroll_to_y(dropdown->list, line_y1, LV_ANIM_OFF); diff --git a/L3_Middlewares/LVGL/src/widgets/dropdown/lv_dropdown.h b/L3_Middlewares/LVGL/src/widgets/lv_dropdown.h similarity index 82% rename from L3_Middlewares/LVGL/src/widgets/dropdown/lv_dropdown.h rename to L3_Middlewares/LVGL/src/widgets/lv_dropdown.h index c9f55be..0c55e86 100644 --- a/L3_Middlewares/LVGL/src/widgets/dropdown/lv_dropdown.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_dropdown.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" +#include "../lv_conf_internal.h" #if LV_USE_DROPDOWN != 0 @@ -23,7 +23,7 @@ extern "C" { #error "lv_dropdown: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" #endif -#include "../label/lv_label.h" +#include "../widgets/lv_label.h" /********************* * DEFINES @@ -31,24 +31,32 @@ extern "C" { #define LV_DROPDOWN_POS_LAST 0xFFFF LV_EXPORT_CONST_INT(LV_DROPDOWN_POS_LAST); -#if LV_USE_OBJ_PROPERTY -enum { - LV_PROPERTY_ID(DROPDOWN, TEXT, LV_PROPERTY_TYPE_TEXT, 0), - LV_PROPERTY_ID(DROPDOWN, OPTIONS, LV_PROPERTY_TYPE_TEXT, 1), - LV_PROPERTY_ID(DROPDOWN, OPTION_COUNT, LV_PROPERTY_TYPE_INT, 2), - LV_PROPERTY_ID(DROPDOWN, SELECTED, LV_PROPERTY_TYPE_INT, 3), - // LV_PROPERTY_ID(DROPDOWN, SELECTED_STR, LV_PROPERTY_TYPE_TEXT, 4), - LV_PROPERTY_ID(DROPDOWN, DIR, LV_PROPERTY_TYPE_INT, 5), - LV_PROPERTY_ID(DROPDOWN, SYMBOL, LV_PROPERTY_TYPE_TEXT, 6), - LV_PROPERTY_ID(DROPDOWN, SELECTED_HIGHLIGHT, LV_PROPERTY_TYPE_INT, 7), - LV_PROPERTY_ID(DROPDOWN, LIST, LV_PROPERTY_TYPE_OBJ, 8), - LV_PROPERTY_ID(DROPDOWN, IS_OPEN, LV_PROPERTY_TYPE_BOOL, 9), - LV_PROPERTY_DROPDOWN_END, -}; -#endif +/********************** + * TYPEDEFS + **********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_dropdown_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_dropdownlist_class; +typedef struct { + lv_obj_t obj; + lv_obj_t * list; /**< The dropped down list*/ + const char * text; /**< Text to display on the dropdown's button*/ + const void * symbol; /**< Arrow or other icon when the drop-down list is closed*/ + char * options; /**< Options in a '\n' separated list*/ + uint16_t option_cnt; /**< Number of options*/ + uint16_t sel_opt_id; /**< Index of the currently selected option*/ + uint16_t sel_opt_id_orig; /**< Store the original index on focus*/ + uint16_t pr_opt_id; /**< Index of the currently pressed option*/ + lv_dir_t dir : 4; /**< Direction in which the list should open*/ + uint8_t static_txt : 1; /**< 1: Only a pointer is saved in `options`*/ + uint8_t selected_highlight: 1; /**< 1: Make the selected option highlighted in the list*/ +} lv_dropdown_t; + +typedef struct { + lv_obj_t obj; + lv_obj_t * dropdown; +} lv_dropdown_list_t; + +extern const lv_obj_class_t lv_dropdown_class; +extern const lv_obj_class_t lv_dropdownlist_class; /********************** * GLOBAL PROTOTYPES @@ -109,7 +117,7 @@ void lv_dropdown_clear_options(lv_obj_t * obj); * @param obj pointer to drop-down list object * @param sel_opt id of the selected option (0 ... number of option - 1); */ -void lv_dropdown_set_selected(lv_obj_t * obj, uint32_t sel_opt); +void lv_dropdown_set_selected(lv_obj_t * obj, uint16_t sel_opt); /** * Set the direction of the a drop-down list @@ -164,14 +172,14 @@ const char * lv_dropdown_get_options(const lv_obj_t * obj); * @param obj pointer to drop-down list object * @return index of the selected option (0 ... number of option - 1); */ -uint32_t lv_dropdown_get_selected(const lv_obj_t * obj); +uint16_t lv_dropdown_get_selected(const lv_obj_t * obj); /** * Get the total number of options * @param obj pointer to drop-down list object * @return the total number of options in the list */ -uint32_t lv_dropdown_get_option_count(const lv_obj_t * obj); +uint16_t lv_dropdown_get_option_cnt(const lv_obj_t * obj); /** * Get the current selected option as a string @@ -216,7 +224,7 @@ lv_dir_t lv_dropdown_get_dir(const lv_obj_t * obj); /** * Open the drop.down list - * @param dropdown_obj pointer to drop-down list object + * @param obj pointer to drop-down list object */ void lv_dropdown_open(lv_obj_t * dropdown_obj); diff --git a/L3_Middlewares/LVGL/src/widgets/lv_img.c b/L3_Middlewares/LVGL/src/widgets/lv_img.c new file mode 100644 index 0000000..3246e4a --- /dev/null +++ b/L3_Middlewares/LVGL/src/widgets/lv_img.c @@ -0,0 +1,692 @@ +/** + * @file lv_img.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_img.h" +#if LV_USE_IMG != 0 + +#include "../core/lv_disp.h" +#include "../misc/lv_assert.h" +#include "../draw/lv_img_decoder.h" +#include "../misc/lv_fs.h" +#include "../misc/lv_txt.h" +#include "../misc/lv_math.h" +#include "../misc/lv_log.h" + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_img_class + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_img_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_img_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_img_event(const lv_obj_class_t * class_p, lv_event_t * e); +static void draw_img(lv_event_t * e); + +/********************** + * STATIC VARIABLES + **********************/ +const lv_obj_class_t lv_img_class = { + .constructor_cb = lv_img_constructor, + .destructor_cb = lv_img_destructor, + .event_cb = lv_img_event, + .width_def = LV_SIZE_CONTENT, + .height_def = LV_SIZE_CONTENT, + .instance_size = sizeof(lv_img_t), + .base_class = &lv_obj_class +}; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_obj_t * lv_img_create(lv_obj_t * parent) +{ + LV_LOG_INFO("begin"); + lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); + lv_obj_class_init_obj(obj); + return obj; +} + +/*===================== + * Setter functions + *====================*/ + +void lv_img_set_src(lv_obj_t * obj, const void * src) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_obj_invalidate(obj); + + lv_img_src_t src_type = lv_img_src_get_type(src); + lv_img_t * img = (lv_img_t *)obj; + +#if LV_USE_LOG && LV_LOG_LEVEL >= LV_LOG_LEVEL_INFO + switch(src_type) { + case LV_IMG_SRC_FILE: + LV_LOG_TRACE("lv_img_set_src: `LV_IMG_SRC_FILE` type found"); + break; + case LV_IMG_SRC_VARIABLE: + LV_LOG_TRACE("lv_img_set_src: `LV_IMG_SRC_VARIABLE` type found"); + break; + case LV_IMG_SRC_SYMBOL: + LV_LOG_TRACE("lv_img_set_src: `LV_IMG_SRC_SYMBOL` type found"); + break; + default: + LV_LOG_WARN("lv_img_set_src: unknown type"); + } +#endif + + /*If the new source type is unknown free the memories of the old source*/ + if(src_type == LV_IMG_SRC_UNKNOWN) { + LV_LOG_WARN("lv_img_set_src: unknown image type"); + if(img->src_type == LV_IMG_SRC_SYMBOL || img->src_type == LV_IMG_SRC_FILE) { + lv_mem_free((void *)img->src); + } + img->src = NULL; + img->src_type = LV_IMG_SRC_UNKNOWN; + return; + } + + lv_img_header_t header; + lv_img_decoder_get_info(src, &header); + + /*Save the source*/ + if(src_type == LV_IMG_SRC_VARIABLE) { + /*If memory was allocated because of the previous `src_type` then free it*/ + if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_SYMBOL) { + lv_mem_free((void *)img->src); + } + img->src = src; + } + else if(src_type == LV_IMG_SRC_FILE || src_type == LV_IMG_SRC_SYMBOL) { + /*If the new and the old src are the same then it was only a refresh.*/ + if(img->src != src) { + const void * old_src = NULL; + /*If memory was allocated because of the previous `src_type` then save its pointer and free after allocation. + *It's important to allocate first to be sure the new data will be on a new address. + *Else `img_cache` wouldn't see the change in source.*/ + if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_SYMBOL) { + old_src = img->src; + } + char * new_str = lv_mem_alloc(strlen(src) + 1); + LV_ASSERT_MALLOC(new_str); + if(new_str == NULL) return; + strcpy(new_str, src); + img->src = new_str; + + if(old_src) lv_mem_free((void *)old_src); + } + } + + if(src_type == LV_IMG_SRC_SYMBOL) { + /*`lv_img_dsc_get_info` couldn't set the width and height of a font so set it here*/ + const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); + lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_point_t size; + lv_txt_get_size(&size, src, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE); + header.w = size.x; + header.h = size.y; + } + + img->src_type = src_type; + img->w = header.w; + img->h = header.h; + img->cf = header.cf; + img->pivot.x = header.w / 2; + img->pivot.y = header.h / 2; + + lv_obj_refresh_self_size(obj); + + /*Provide enough room for the rotated corners*/ + if(img->angle || img->zoom != LV_IMG_ZOOM_NONE) lv_obj_refresh_ext_draw_size(obj); + + lv_obj_invalidate(obj); +} + +void lv_img_set_offset_x(lv_obj_t * obj, lv_coord_t x) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_img_t * img = (lv_img_t *)obj; + + img->offset.x = x; + lv_obj_invalidate(obj); +} + +void lv_img_set_offset_y(lv_obj_t * obj, lv_coord_t y) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_img_t * img = (lv_img_t *)obj; + + img->offset.y = y; + lv_obj_invalidate(obj); +} + +void lv_img_set_angle(lv_obj_t * obj, int16_t angle) +{ + while(angle >= 3600) angle -= 3600; + while(angle < 0) angle += 3600; + + lv_img_t * img = (lv_img_t *)obj; + if(angle == img->angle) return; + + lv_obj_update_layout(obj); /*Be sure the object's size is calculated*/ + lv_coord_t w = lv_obj_get_width(obj); + lv_coord_t h = lv_obj_get_height(obj); + lv_area_t a; + _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); + a.x1 += obj->coords.x1; + a.y1 += obj->coords.y1; + a.x2 += obj->coords.x1; + a.y2 += obj->coords.y1; + lv_obj_invalidate_area(obj, &a); + + img->angle = angle; + + /* Disable invalidations because lv_obj_refresh_ext_draw_size would invalidate + * the whole ext draw area */ + lv_disp_t * disp = lv_obj_get_disp(obj); + lv_disp_enable_invalidation(disp, false); + lv_obj_refresh_ext_draw_size(obj); + lv_disp_enable_invalidation(disp, true); + + _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); + a.x1 += obj->coords.x1; + a.y1 += obj->coords.y1; + a.x2 += obj->coords.x1; + a.y2 += obj->coords.y1; + lv_obj_invalidate_area(obj, &a); +} + +void lv_img_set_pivot(lv_obj_t * obj, lv_coord_t x, lv_coord_t y) +{ + lv_img_t * img = (lv_img_t *)obj; + if(img->pivot.x == x && img->pivot.y == y) return; + + lv_obj_update_layout(obj); /*Be sure the object's size is calculated*/ + lv_coord_t w = lv_obj_get_width(obj); + lv_coord_t h = lv_obj_get_height(obj); + lv_area_t a; + _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); + a.x1 += obj->coords.x1; + a.y1 += obj->coords.y1; + a.x2 += obj->coords.x1; + a.y2 += obj->coords.y1; + lv_obj_invalidate_area(obj, &a); + + img->pivot.x = x; + img->pivot.y = y; + + /* Disable invalidations because lv_obj_refresh_ext_draw_size would invalidate + * the whole ext draw area */ + lv_disp_t * disp = lv_obj_get_disp(obj); + lv_disp_enable_invalidation(disp, false); + lv_obj_refresh_ext_draw_size(obj); + lv_disp_enable_invalidation(disp, true); + + _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); + a.x1 += obj->coords.x1; + a.y1 += obj->coords.y1; + a.x2 += obj->coords.x1; + a.y2 += obj->coords.y1; + lv_obj_invalidate_area(obj, &a); +} + +void lv_img_set_zoom(lv_obj_t * obj, uint16_t zoom) +{ + lv_img_t * img = (lv_img_t *)obj; + if(zoom == img->zoom) return; + + if(zoom == 0) zoom = 1; + + lv_obj_update_layout(obj); /*Be sure the object's size is calculated*/ + lv_coord_t w = lv_obj_get_width(obj); + lv_coord_t h = lv_obj_get_height(obj); + lv_area_t a; + _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom >> 8, &img->pivot); + a.x1 += obj->coords.x1 - 1; + a.y1 += obj->coords.y1 - 1; + a.x2 += obj->coords.x1 + 1; + a.y2 += obj->coords.y1 + 1; + lv_obj_invalidate_area(obj, &a); + + img->zoom = zoom; + + /* Disable invalidations because lv_obj_refresh_ext_draw_size would invalidate + * the whole ext draw area */ + lv_disp_t * disp = lv_obj_get_disp(obj); + lv_disp_enable_invalidation(disp, false); + lv_obj_refresh_ext_draw_size(obj); + lv_disp_enable_invalidation(disp, true); + + _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); + a.x1 += obj->coords.x1 - 1; + a.y1 += obj->coords.y1 - 1; + a.x2 += obj->coords.x1 + 1; + a.y2 += obj->coords.y1 + 1; + lv_obj_invalidate_area(obj, &a); +} + +void lv_img_set_antialias(lv_obj_t * obj, bool antialias) +{ + lv_img_t * img = (lv_img_t *)obj; + if(antialias == img->antialias) return; + + img->antialias = antialias; + lv_obj_invalidate(obj); +} + +void lv_img_set_size_mode(lv_obj_t * obj, lv_img_size_mode_t mode) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_img_t * img = (lv_img_t *)obj; + if(mode == img->obj_size_mode) return; + + img->obj_size_mode = mode; + lv_obj_invalidate(obj); +} + +/*===================== + * Getter functions + *====================*/ + +const void * lv_img_get_src(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_img_t * img = (lv_img_t *)obj; + + return img->src; +} + +lv_coord_t lv_img_get_offset_x(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_img_t * img = (lv_img_t *)obj; + + return img->offset.x; +} + +lv_coord_t lv_img_get_offset_y(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_img_t * img = (lv_img_t *)obj; + + return img->offset.y; +} + +uint16_t lv_img_get_angle(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_img_t * img = (lv_img_t *)obj; + + return img->angle; +} + +void lv_img_get_pivot(lv_obj_t * obj, lv_point_t * pivot) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_img_t * img = (lv_img_t *)obj; + + *pivot = img->pivot; +} + +uint16_t lv_img_get_zoom(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_img_t * img = (lv_img_t *)obj; + + return img->zoom; +} + +bool lv_img_get_antialias(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_img_t * img = (lv_img_t *)obj; + + return img->antialias ? true : false; +} + +lv_img_size_mode_t lv_img_get_size_mode(lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_img_t * img = (lv_img_t *)obj; + return img->obj_size_mode; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_img_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + LV_TRACE_OBJ_CREATE("begin"); + + lv_img_t * img = (lv_img_t *)obj; + + img->src = NULL; + img->src_type = LV_IMG_SRC_UNKNOWN; + img->cf = LV_IMG_CF_UNKNOWN; + img->w = lv_obj_get_width(obj); + img->h = lv_obj_get_height(obj); + img->angle = 0; + img->zoom = LV_IMG_ZOOM_NONE; + img->antialias = LV_COLOR_DEPTH > 8 ? 1 : 0; + img->offset.x = 0; + img->offset.y = 0; + img->pivot.x = 0; + img->pivot.y = 0; + img->obj_size_mode = LV_IMG_SIZE_MODE_VIRTUAL; + + lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); + lv_obj_add_flag(obj, LV_OBJ_FLAG_ADV_HITTEST); + + LV_TRACE_OBJ_CREATE("finished"); +} + +static void lv_img_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + lv_img_t * img = (lv_img_t *)obj; + if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_SYMBOL) { + lv_mem_free((void *)img->src); + img->src = NULL; + img->src_type = LV_IMG_SRC_UNKNOWN; + } +} + +static lv_point_t lv_img_get_transformed_size(lv_obj_t * obj) +{ + lv_img_t * img = (lv_img_t *)obj; + + + lv_area_t area_transform; + _lv_img_buf_get_transformed_area(&area_transform, img->w, img->h, + img->angle, img->zoom, &img->pivot); + + return (lv_point_t) { + lv_area_get_width(&area_transform), lv_area_get_height(&area_transform) + }; +} + +static void lv_img_event(const lv_obj_class_t * class_p, lv_event_t * e) +{ + LV_UNUSED(class_p); + + lv_event_code_t code = lv_event_get_code(e); + + /*Ancestor events will be called during drawing*/ + if(code != LV_EVENT_DRAW_MAIN && code != LV_EVENT_DRAW_POST) { + /*Call the ancestor's event handler*/ + lv_res_t res = lv_obj_event_base(MY_CLASS, e); + if(res != LV_RES_OK) return; + } + + lv_obj_t * obj = lv_event_get_target(e); + lv_img_t * img = (lv_img_t *)obj; + + if(code == LV_EVENT_STYLE_CHANGED) { + /*Refresh the file name to refresh the symbol text size*/ + if(img->src_type == LV_IMG_SRC_SYMBOL) { + lv_img_set_src(obj, img->src); + } + else { + /*With transformation it might change*/ + lv_obj_refresh_ext_draw_size(obj); + } + } + else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { + + lv_coord_t * s = lv_event_get_param(e); + + /*If the image has angle provide enough room for the rotated corners*/ + if(img->angle || img->zoom != LV_IMG_ZOOM_NONE) { + lv_area_t a; + lv_coord_t w = lv_obj_get_width(obj); + lv_coord_t h = lv_obj_get_height(obj); + _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); + *s = LV_MAX(*s, -a.x1); + *s = LV_MAX(*s, -a.y1); + *s = LV_MAX(*s, a.x2 - w); + *s = LV_MAX(*s, a.y2 - h); + } + } + else if(code == LV_EVENT_HIT_TEST) { + lv_hit_test_info_t * info = lv_event_get_param(e); + + /*If the object is exactly image sized (not cropped, not mosaic) and transformed + *perform hit test on its transformed area*/ + if(img->w == lv_obj_get_width(obj) && img->h == lv_obj_get_height(obj) && + (img->zoom != LV_IMG_ZOOM_NONE || img->angle != 0 || img->pivot.x != img->w / 2 || img->pivot.y != img->h / 2)) { + + lv_coord_t w = lv_obj_get_width(obj); + lv_coord_t h = lv_obj_get_height(obj); + lv_area_t coords; + _lv_img_buf_get_transformed_area(&coords, w, h, img->angle, img->zoom, &img->pivot); + coords.x1 += obj->coords.x1; + coords.y1 += obj->coords.y1; + coords.x2 += obj->coords.x1; + coords.y2 += obj->coords.y1; + + info->res = _lv_area_is_point_on(&coords, info->point, 0); + } + else { + lv_area_t a; + lv_obj_get_click_area(obj, &a); + info->res = _lv_area_is_point_on(&a, info->point, 0); + } + } + else if(code == LV_EVENT_GET_SELF_SIZE) { + lv_point_t * p = lv_event_get_param(e); + if(img->obj_size_mode == LV_IMG_SIZE_MODE_REAL) { + *p = lv_img_get_transformed_size(obj); + } + else { + p->x = img->w; + p->y = img->h; + } + } + else if(code == LV_EVENT_DRAW_MAIN || code == LV_EVENT_DRAW_POST || code == LV_EVENT_COVER_CHECK) { + draw_img(e); + } +} + +static void draw_img(lv_event_t * e) +{ + lv_event_code_t code = lv_event_get_code(e); + lv_obj_t * obj = lv_event_get_target(e); + lv_img_t * img = (lv_img_t *)obj; + if(code == LV_EVENT_COVER_CHECK) { + lv_cover_check_info_t * info = lv_event_get_param(e); + if(info->res == LV_COVER_RES_MASKED) return; + if(img->src_type == LV_IMG_SRC_UNKNOWN || img->src_type == LV_IMG_SRC_SYMBOL) { + info->res = LV_COVER_RES_NOT_COVER; + return; + } + + /*Non true color format might have "holes"*/ + if(img->cf != LV_IMG_CF_TRUE_COLOR && img->cf != LV_IMG_CF_RAW) { + info->res = LV_COVER_RES_NOT_COVER; + return; + } + + /*With not LV_OPA_COVER images can't cover an area */ + if(lv_obj_get_style_img_opa(obj, LV_PART_MAIN) != LV_OPA_COVER) { + info->res = LV_COVER_RES_NOT_COVER; + return; + } + + if(img->angle != 0) { + info->res = LV_COVER_RES_NOT_COVER; + return; + } + + const lv_area_t * clip_area = lv_event_get_param(e); + if(img->zoom == LV_IMG_ZOOM_NONE) { + if(_lv_area_is_in(clip_area, &obj->coords, 0) == false) { + info->res = LV_COVER_RES_NOT_COVER; + return; + } + } + else { + lv_area_t a; + _lv_img_buf_get_transformed_area(&a, lv_obj_get_width(obj), lv_obj_get_height(obj), 0, img->zoom, &img->pivot); + a.x1 += obj->coords.x1; + a.y1 += obj->coords.y1; + a.x2 += obj->coords.x1; + a.y2 += obj->coords.y1; + + if(_lv_area_is_in(clip_area, &a, 0) == false) { + info->res = LV_COVER_RES_NOT_COVER; + return; + } + } + } + else if(code == LV_EVENT_DRAW_MAIN || code == LV_EVENT_DRAW_POST) { + + lv_coord_t obj_w = lv_obj_get_width(obj); + lv_coord_t obj_h = lv_obj_get_height(obj); + + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; + lv_coord_t pright = lv_obj_get_style_pad_right(obj, LV_PART_MAIN) + border_width; + lv_coord_t ptop = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; + lv_coord_t pbottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN) + border_width; + + lv_point_t bg_pivot; + bg_pivot.x = img->pivot.x + pleft; + bg_pivot.y = img->pivot.y + ptop; + lv_area_t bg_coords; + + if(img->obj_size_mode == LV_IMG_SIZE_MODE_REAL) { + /*Object size equals to transformed image size*/ + lv_obj_get_coords(obj, &bg_coords); + } + else { + _lv_img_buf_get_transformed_area(&bg_coords, obj_w, obj_h, + img->angle, img->zoom, &bg_pivot); + + /*Modify the coordinates to draw the background for the rotated and scaled coordinates*/ + bg_coords.x1 += obj->coords.x1; + bg_coords.y1 += obj->coords.y1; + bg_coords.x2 += obj->coords.x1; + bg_coords.y2 += obj->coords.y1; + } + + lv_area_t ori_coords; + lv_area_copy(&ori_coords, &obj->coords); + lv_area_copy(&obj->coords, &bg_coords); + + lv_res_t res = lv_obj_event_base(MY_CLASS, e); + if(res != LV_RES_OK) return; + + lv_area_copy(&obj->coords, &ori_coords); + + if(code == LV_EVENT_DRAW_MAIN) { + if(img->h == 0 || img->w == 0) return; + if(img->zoom == 0) return; + + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); + + lv_area_t img_max_area; + lv_area_copy(&img_max_area, &obj->coords); + + lv_point_t img_size_final = lv_img_get_transformed_size(obj); + + if(img->obj_size_mode == LV_IMG_SIZE_MODE_REAL) { + img_max_area.x1 -= ((img->w - img_size_final.x) + 1) / 2; + img_max_area.x2 -= ((img->w - img_size_final.x) + 1) / 2; + img_max_area.y1 -= ((img->h - img_size_final.y) + 1) / 2; + img_max_area.y2 -= ((img->h - img_size_final.y) + 1) / 2; + } + else { + img_max_area.x2 = img_max_area.x1 + lv_area_get_width(&bg_coords) - 1; + img_max_area.y2 = img_max_area.y1 + lv_area_get_height(&bg_coords) - 1; + } + + img_max_area.x1 += pleft; + img_max_area.y1 += ptop; + img_max_area.x2 -= pright; + img_max_area.y2 -= pbottom; + + if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_VARIABLE) { + lv_draw_img_dsc_t img_dsc; + lv_draw_img_dsc_init(&img_dsc); + lv_obj_init_draw_img_dsc(obj, LV_PART_MAIN, &img_dsc); + + img_dsc.zoom = img->zoom; + img_dsc.angle = img->angle; + img_dsc.pivot.x = img->pivot.x; + img_dsc.pivot.y = img->pivot.y; + img_dsc.antialias = img->antialias; + + lv_area_t img_clip_area; + img_clip_area.x1 = bg_coords.x1 + pleft; + img_clip_area.y1 = bg_coords.y1 + ptop; + img_clip_area.x2 = bg_coords.x2 - pright; + img_clip_area.y2 = bg_coords.y2 - pbottom; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + + if(!_lv_area_intersect(&img_clip_area, draw_ctx->clip_area, &img_clip_area)) return; + draw_ctx->clip_area = &img_clip_area; + + lv_area_t coords_tmp; + lv_coord_t offset_x = img->offset.x % img->w; + lv_coord_t offset_y = img->offset.y % img->h; + coords_tmp.y1 = img_max_area.y1 + offset_y; + if(coords_tmp.y1 > img_max_area.y1) coords_tmp.y1 -= img->h; + coords_tmp.y2 = coords_tmp.y1 + img->h - 1; + + for(; coords_tmp.y1 < img_max_area.y2; coords_tmp.y1 += img_size_final.y, coords_tmp.y2 += img_size_final.y) { + coords_tmp.x1 = img_max_area.x1 + offset_x; + if(coords_tmp.x1 > img_max_area.x1) coords_tmp.x1 -= img->w; + coords_tmp.x2 = coords_tmp.x1 + img->w - 1; + + for(; coords_tmp.x1 < img_max_area.x2; coords_tmp.x1 += img_size_final.x, coords_tmp.x2 += img_size_final.x) { + lv_draw_img(draw_ctx, &img_dsc, &coords_tmp, img->src); + } + } + draw_ctx->clip_area = clip_area_ori; + } + else if(img->src_type == LV_IMG_SRC_SYMBOL) { + lv_draw_label_dsc_t label_dsc; + lv_draw_label_dsc_init(&label_dsc); + lv_obj_init_draw_label_dsc(obj, LV_PART_MAIN, &label_dsc); + + lv_draw_label(draw_ctx, &label_dsc, &obj->coords, img->src, NULL); + } + else { + /*Trigger the error handler of image draw*/ + LV_LOG_WARN("draw_img: image source type is unknown"); + lv_draw_img(draw_ctx, NULL, &obj->coords, NULL); + } + } + } +} + +#endif diff --git a/L3_Middlewares/LVGL/src/widgets/lv_img.h b/L3_Middlewares/LVGL/src/widgets/lv_img.h new file mode 100644 index 0000000..eb76c8d --- /dev/null +++ b/L3_Middlewares/LVGL/src/widgets/lv_img.h @@ -0,0 +1,234 @@ +/** + * @file lv_img.h + * + */ + +#ifndef LV_IMG_H +#define LV_IMG_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ +#include "../lv_conf_internal.h" + +#if LV_USE_IMG != 0 + +/*Testing of dependencies*/ +#if LV_USE_LABEL == 0 +#error "lv_img: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" +#endif + +#include "../core/lv_obj.h" +#include "../misc/lv_fs.h" +#include "../draw/lv_draw.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/** + * Data of image + */ +typedef struct { + lv_obj_t obj; + const void * src; /*Image source: Pointer to an array or a file or a symbol*/ + lv_point_t offset; + lv_coord_t w; /*Width of the image (Handled by the library)*/ + lv_coord_t h; /*Height of the image (Handled by the library)*/ + uint16_t angle; /*rotation angle of the image*/ + lv_point_t pivot; /*rotation center of the image*/ + uint16_t zoom; /*256 means no zoom, 512 double size, 128 half size*/ + uint8_t src_type : 2; /*See: lv_img_src_t*/ + uint8_t cf : 5; /*Color format from `lv_img_color_format_t`*/ + uint8_t antialias : 1; /*Apply anti-aliasing in transformations (rotate, zoom)*/ + uint8_t obj_size_mode: 2; /*Image size mode when image size and object size is different.*/ +} lv_img_t; + +extern const lv_obj_class_t lv_img_class; + +/** + * Image size mode, when image size and object size is different + */ +enum { + /** Zoom doesn't affect the coordinates of the object, + * however if zoomed in the image is drawn out of the its coordinates. + * The layout's won't change on zoom */ + LV_IMG_SIZE_MODE_VIRTUAL = 0, + + /** If the object size is set to SIZE_CONTENT, then object size equals zoomed image size. + * It causes layout recalculation. + * If the object size is set explicitly, the image will be cropped when zoomed in.*/ + LV_IMG_SIZE_MODE_REAL, +}; + +typedef uint8_t lv_img_size_mode_t; + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Create an image object + * @param parent pointer to an object, it will be the parent of the new image + * @return pointer to the created image + */ +lv_obj_t * lv_img_create(lv_obj_t * parent); + +/*===================== + * Setter functions + *====================*/ + +/** + * Set the image data to display on the object + * @param obj pointer to an image object + * @param src_img 1) pointer to an ::lv_img_dsc_t descriptor (converted by LVGL's image converter) (e.g. &my_img) or + * 2) path to an image file (e.g. "S:/dir/img.bin")or + * 3) a SYMBOL (e.g. LV_SYMBOL_OK) + */ +void lv_img_set_src(lv_obj_t * obj, const void * src); + +/** + * Set an offset for the source of an image so the image will be displayed from the new origin. + * @param obj pointer to an image + * @param x the new offset along x axis. + */ +void lv_img_set_offset_x(lv_obj_t * obj, lv_coord_t x); + +/** + * Set an offset for the source of an image. + * so the image will be displayed from the new origin. + * @param obj pointer to an image + * @param y the new offset along y axis. + */ +void lv_img_set_offset_y(lv_obj_t * obj, lv_coord_t y); + + +/** + * Set the rotation angle of the image. + * The image will be rotated around the set pivot set by `lv_img_set_pivot()` + * Note that indexed and alpha only images can't be transformed. + * @param obj pointer to an image object + * @param angle rotation angle in degree with 0.1 degree resolution (0..3600: clock wise) + */ +void lv_img_set_angle(lv_obj_t * obj, int16_t angle); + +/** + * Set the rotation center of the image. + * The image will be rotated around this point. + * @param obj pointer to an image object + * @param x rotation center x of the image + * @param y rotation center y of the image + */ +void lv_img_set_pivot(lv_obj_t * obj, lv_coord_t x, lv_coord_t y); + + +/** + * Set the zoom factor of the image. + * Note that indexed and alpha only images can't be transformed. + * @param img pointer to an image object + * @param zoom the zoom factor. + * @example 256 or LV_ZOOM_IMG_NONE for no zoom + * @example <256: scale down + * @example >256 scale up + * @example 128 half size + * @example 512 double size + */ +void lv_img_set_zoom(lv_obj_t * obj, uint16_t zoom); + +/** + * Enable/disable anti-aliasing for the transformations (rotate, zoom) or not. + * The quality is better with anti-aliasing looks better but slower. + * @param obj pointer to an image object + * @param antialias true: anti-aliased; false: not anti-aliased + */ +void lv_img_set_antialias(lv_obj_t * obj, bool antialias); + +/** + * Set the image object size mode. + * + * @param obj pointer to an image object + * @param mode the new size mode. + */ +void lv_img_set_size_mode(lv_obj_t * obj, lv_img_size_mode_t mode); +/*===================== + * Getter functions + *====================*/ + +/** + * Get the source of the image + * @param obj pointer to an image object + * @return the image source (symbol, file name or ::lv-img_dsc_t for C arrays) + */ +const void * lv_img_get_src(lv_obj_t * obj); + +/** + * Get the offset's x attribute of the image object. + * @param img pointer to an image + * @return offset X value. + */ +lv_coord_t lv_img_get_offset_x(lv_obj_t * obj); + +/** + * Get the offset's y attribute of the image object. + * @param obj pointer to an image + * @return offset Y value. + */ +lv_coord_t lv_img_get_offset_y(lv_obj_t * obj); + +/** + * Get the rotation angle of the image. + * @param obj pointer to an image object + * @return rotation angle in 0.1 degrees (0..3600) + */ +uint16_t lv_img_get_angle(lv_obj_t * obj); + +/** + * Get the pivot (rotation center) of the image. + * @param img pointer to an image object + * @param pivot store the rotation center here + */ +void lv_img_get_pivot(lv_obj_t * obj, lv_point_t * pivot); + +/** + * Get the zoom factor of the image. + * @param obj pointer to an image object + * @return zoom factor (256: no zoom) + */ +uint16_t lv_img_get_zoom(lv_obj_t * obj); + +/** + * Get whether the transformations (rotate, zoom) are anti-aliased or not + * @param obj pointer to an image object + * @return true: anti-aliased; false: not anti-aliased + */ +bool lv_img_get_antialias(lv_obj_t * obj); + +/** + * Get the size mode of the image + * @param obj pointer to an image object + * @return element of @ref lv_img_size_mode_t + */ +lv_img_size_mode_t lv_img_get_size_mode(lv_obj_t * obj); + +/********************** + * MACROS + **********************/ + +/** Use this macro to declare an image in a C file*/ +#define LV_IMG_DECLARE(var_name) extern const lv_img_dsc_t var_name; + +#endif /*LV_USE_IMG*/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_IMG_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/label/lv_label.c b/L3_Middlewares/LVGL/src/widgets/lv_label.c similarity index 62% rename from L3_Middlewares/LVGL/src/widgets/label/lv_label.c rename to L3_Middlewares/LVGL/src/widgets/lv_label.c index ae07112..f4fbe01 100644 --- a/L3_Middlewares/LVGL/src/widgets/label/lv_label.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_label.c @@ -6,31 +6,24 @@ /********************* * INCLUDES *********************/ -#include "lv_label_private.h" -#include "../../misc/lv_area_private.h" -#include "../../misc/lv_anim_private.h" -#include "../../draw/lv_draw_label_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_label.h" #if LV_USE_LABEL != 0 -#include "../../core/lv_obj_private.h" -#include "../../misc/lv_assert.h" -#include "../../core/lv_group.h" -#include "../../display/lv_display.h" -#include "../../draw/lv_draw_private.h" -#include "../../misc/lv_color.h" -#include "../../misc/lv_math.h" -#include "../../misc/lv_bidi_private.h" -#include "../../misc/lv_text_ap.h" -#include "../../misc/lv_text_private.h" -#include "../../stdlib/lv_sprintf.h" -#include "../../stdlib/lv_string.h" +#include "../core/lv_obj.h" +#include "../misc/lv_assert.h" +#include "../core/lv_group.h" +#include "../draw/lv_draw.h" +#include "../misc/lv_color.h" +#include "../misc/lv_math.h" +#include "../misc/lv_bidi.h" +#include "../misc/lv_txt_ap.h" +#include "../misc/lv_printf.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_label_class) +#define MY_CLASS &lv_label_class -#define LV_LABEL_DEF_SCROLL_SPEED lv_anim_speed_clamped(40, 300, 10000) +#define LV_LABEL_DEF_SCROLL_SPEED (lv_disp_get_dpi(lv_obj_get_disp(obj)) / 3) #define LV_LABEL_SCROLL_DELAY 300 #define LV_LABEL_DOT_END_INV 0xFFFFFFFF #define LV_LABEL_HINT_HEIGHT_LIMIT 1024 /*Enable "hint" to buffer info about labels larger than this. (Speed up drawing)*/ @@ -55,40 +48,10 @@ static char * lv_label_get_dot_tmp(lv_obj_t * label); static void lv_label_dot_tmp_free(lv_obj_t * label); static void set_ofs_x_anim(void * obj, int32_t v); static void set_ofs_y_anim(void * obj, int32_t v); -static size_t get_text_length(const char * text); -static void copy_text_to_label(lv_label_t * label, const char * text); -static lv_text_flag_t get_label_flags(lv_label_t * label); -static void calculate_x_coordinate(int32_t * x, const lv_text_align_t align, const char * txt, - uint32_t length, const lv_font_t * font, int32_t letter_space, lv_area_t * txt_coords); /********************** * STATIC VARIABLES **********************/ -#if LV_USE_OBJ_PROPERTY -static const lv_property_ops_t properties[] = { - { - .id = LV_PROPERTY_LABEL_TEXT, - .setter = lv_label_set_text, - .getter = lv_label_get_text, - }, - { - .id = LV_PROPERTY_LABEL_LONG_MODE, - .setter = lv_label_set_long_mode, - .getter = lv_label_get_long_mode, - }, - { - .id = LV_PROPERTY_LABEL_TEXT_SELECTION_START, - .setter = lv_label_set_text_selection_start, - .getter = lv_label_get_text_selection_start, - }, - { - .id = LV_PROPERTY_LABEL_TEXT_SELECTION_END, - .setter = lv_label_set_text_selection_end, - .getter = lv_label_get_text_selection_end, - }, -}; -#endif - const lv_obj_class_t lv_label_class = { .constructor_cb = lv_label_constructor, .destructor_cb = lv_label_destructor, @@ -96,20 +59,7 @@ const lv_obj_class_t lv_label_class = { .width_def = LV_SIZE_CONTENT, .height_def = LV_SIZE_CONTENT, .instance_size = sizeof(lv_label_t), - .base_class = &lv_obj_class, - .name = "label", -#if LV_USE_OBJ_PROPERTY - .prop_index_start = LV_PROPERTY_LABEL_START, - .prop_index_end = LV_PROPERTY_LABEL_END, - .properties = properties, - .properties_count = sizeof(properties) / sizeof(properties[0]), - -#if LV_USE_OBJ_PROPERTY_NAME - .property_names = lv_label_property_names, - .names_count = sizeof(lv_label_property_names) / sizeof(lv_property_name_t), -#endif - -#endif + .base_class = &lv_obj_class }; /********************** @@ -142,31 +92,50 @@ void lv_label_set_text(lv_obj_t * obj, const char * text) /*If text is NULL then just refresh with the current text*/ if(text == NULL) text = label->text; - const size_t text_len = get_text_length(text); - - /*If set its own text then reallocate it (maybe its size changed)*/ if(label->text == text && label->static_txt == 0) { - label->text = lv_realloc(label->text, text_len); + /*If set its own text then reallocate it (maybe its size changed)*/ +#if LV_USE_ARABIC_PERSIAN_CHARS + /*Get the size of the text and process it*/ + size_t len = _lv_txt_ap_calc_bytes_cnt(text); + + label->text = lv_mem_realloc(label->text, len); LV_ASSERT_MALLOC(label->text); if(label->text == NULL) return; -#if LV_USE_ARABIC_PERSIAN_CHARS - lv_text_ap_proc(label->text, label->text); + _lv_txt_ap_proc(label->text, label->text); +#else + label->text = lv_mem_realloc(label->text, strlen(label->text) + 1); #endif + LV_ASSERT_MALLOC(label->text); + if(label->text == NULL) return; } else { /*Free the old text*/ if(label->text != NULL && label->static_txt == 0) { - lv_free(label->text); + lv_mem_free(label->text); label->text = NULL; } - label->text = lv_malloc(text_len); +#if LV_USE_ARABIC_PERSIAN_CHARS + /*Get the size of the text and process it*/ + size_t len = _lv_txt_ap_calc_bytes_cnt(text); + + label->text = lv_mem_alloc(len); LV_ASSERT_MALLOC(label->text); if(label->text == NULL) return; - copy_text_to_label(label, text); + _lv_txt_ap_proc(text, label->text); +#else + /*Get the size of the text*/ + size_t len = strlen(text) + 1; + + /*Allocate space for the new text*/ + label->text = lv_mem_alloc(len); + LV_ASSERT_MALLOC(label->text); + if(label->text == NULL) return; + strcpy(label->text, text); +#endif /*Now the text is dynamically allocated*/ label->static_txt = 0; @@ -190,13 +159,13 @@ void lv_label_set_text_fmt(lv_obj_t * obj, const char * fmt, ...) } if(label->text != NULL && label->static_txt == 0) { - lv_free(label->text); + lv_mem_free(label->text); label->text = NULL; } va_list args; va_start(args, fmt); - label->text = lv_text_set_text_vfmt(fmt, args); + label->text = _lv_txt_set_text_vfmt(fmt, args); va_end(args); label->static_txt = 0; /*Now the text is dynamically allocated*/ @@ -209,7 +178,7 @@ void lv_label_set_text_static(lv_obj_t * obj, const char * text) lv_label_t * label = (lv_label_t *)obj; if(label->static_txt == 0 && label->text != NULL) { - lv_free(label->text); + lv_mem_free(label->text); label->text = NULL; } @@ -228,9 +197,10 @@ void lv_label_set_long_mode(lv_obj_t * obj, lv_label_long_mode_t long_mode) lv_label_t * label = (lv_label_t *)obj; /*Delete the old animation (if exists)*/ - lv_anim_delete(obj, set_ofs_x_anim); - lv_anim_delete(obj, set_ofs_y_anim); - lv_point_set(&label->offset, 0, 0); + lv_anim_del(obj, set_ofs_x_anim); + lv_anim_del(obj, set_ofs_y_anim); + label->offset.x = 0; + label->offset.y = 0; if(long_mode == LV_LABEL_LONG_SCROLL || long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR || long_mode == LV_LABEL_LONG_CLIP) label->expand = 1; @@ -246,7 +216,20 @@ void lv_label_set_long_mode(lv_obj_t * obj, lv_label_long_mode_t long_mode) lv_label_refr_text(obj); } -void lv_label_set_text_selection_start(lv_obj_t * obj, uint32_t index) +void lv_label_set_recolor(lv_obj_t * obj, bool en) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_label_t * label = (lv_label_t *)obj; + if(label->recolor == en) return; + + label->recolor = en == false ? 0 : 1; + + /*Refresh the text because the potential color codes in text needs to be hidden or revealed*/ + lv_label_refr_text(obj); +} + +void lv_label_set_text_sel_start(lv_obj_t * obj, uint32_t index) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -260,7 +243,7 @@ void lv_label_set_text_selection_start(lv_obj_t * obj, uint32_t index) #endif } -void lv_label_set_text_selection_end(lv_obj_t * obj, uint32_t index) +void lv_label_set_text_sel_end(lv_obj_t * obj, uint32_t index) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -292,14 +275,22 @@ lv_label_long_mode_t lv_label_get_long_mode(const lv_obj_t * obj) return label->long_mode; } +bool lv_label_get_recolor(const lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_label_t * label = (lv_label_t *)obj; + return label->recolor == 0 ? false : true; +} + void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t * pos) { LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_NULL(pos); lv_label_t * label = (lv_label_t *)obj; - const char * txt = lv_label_get_text(obj); - const lv_text_align_t align = lv_obj_calculate_style_text_align(obj, LV_PART_MAIN, txt); + const char * txt = lv_label_get_text(obj); + lv_text_align_t align = lv_obj_calculate_style_text_align(obj, LV_PART_MAIN, txt); if(txt[0] == '\0') { pos->y = 0; @@ -313,35 +304,32 @@ void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t case LV_TEXT_ALIGN_CENTER: pos->x = lv_obj_get_content_width(obj) / 2; break; - default: - break; } return; } - lv_text_flag_t flag = get_label_flags(label); + lv_area_t txt_coords; + lv_obj_get_content_coords(obj, &txt_coords); - const uint32_t byte_id = lv_text_encoded_get_byte_id(txt, char_id); - /*Search the line of the index letter*/ - const int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - const int32_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); + uint32_t line_start = 0; + uint32_t new_line_start = 0; + lv_coord_t max_w = lv_area_get_width(&txt_coords); + const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); + lv_coord_t letter_height = lv_font_get_line_height(font); + lv_coord_t y = 0; + lv_text_flag_t flag = LV_TEXT_FLAG_NONE; - const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - const int32_t letter_height = lv_font_get_line_height(font); + if(label->recolor != 0) flag |= LV_TEXT_FLAG_RECOLOR; + if(label->expand != 0) flag |= LV_TEXT_FLAG_EXPAND; + if(lv_obj_get_style_width(obj, LV_PART_MAIN) == LV_SIZE_CONTENT && !obj->w_layout) flag |= LV_TEXT_FLAG_FIT; - lv_area_t txt_coords; - lv_obj_get_content_coords(obj, &txt_coords); - const int32_t max_w = lv_area_get_width(&txt_coords); - const int32_t max_h = lv_area_get_height(&txt_coords); + uint32_t byte_id = _lv_txt_encoded_get_byte_id(txt, char_id); - int32_t y = 0; - uint32_t line_start = 0; - uint32_t new_line_start = 0; + /*Search the line of the index letter*/; while(txt[new_line_start] != '\0') { - bool last_line = y + letter_height + line_space + letter_height > max_h; - if(last_line && label->long_mode == LV_LABEL_LONG_DOT) flag |= LV_TEXT_FLAG_BREAK_ALL; - - new_line_start += lv_text_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag); + new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag); if(byte_id < new_line_start || txt[new_line_start] == '\0') break; /*The line of 'index' letter begins at 'line_start'*/ @@ -361,7 +349,7 @@ void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t uint32_t visual_byte_pos; #if LV_USE_BIDI lv_base_dir_t base_dir = lv_obj_get_style_base_dir(obj, LV_PART_MAIN); - if(base_dir == LV_BASE_DIR_AUTO) base_dir = lv_bidi_detect_base_dir(txt); + if(base_dir == LV_BASE_DIR_AUTO) base_dir = _lv_bidi_detect_base_dir(txt); char * mutable_bidi_txt = NULL; /*Handle Bidi*/ @@ -370,15 +358,15 @@ void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t bidi_txt = &txt[line_start]; } else { - uint32_t line_char_id = lv_text_encoded_get_char_id(&txt[line_start], byte_id - line_start); + uint32_t line_char_id = _lv_txt_encoded_get_char_id(&txt[line_start], byte_id - line_start); bool is_rtl; - uint32_t visual_char_pos = lv_bidi_get_visual_pos(&txt[line_start], &mutable_bidi_txt, new_line_start - line_start, - base_dir, line_char_id, &is_rtl); + uint32_t visual_char_pos = _lv_bidi_get_visual_pos(&txt[line_start], &mutable_bidi_txt, new_line_start - line_start, + base_dir, line_char_id, &is_rtl); bidi_txt = mutable_bidi_txt; if(is_rtl) visual_char_pos++; - visual_byte_pos = lv_text_encoded_get_byte_id(bidi_txt, visual_char_pos); + visual_byte_pos = _lv_txt_encoded_get_byte_id(bidi_txt, visual_char_pos); } #else bidi_txt = &txt[line_start]; @@ -386,22 +374,31 @@ void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t #endif /*Calculate the x coordinate*/ - int32_t x = lv_text_get_width(bidi_txt, visual_byte_pos, font, letter_space); + lv_coord_t x = lv_txt_get_width(bidi_txt, visual_byte_pos, font, letter_space, flag); if(char_id != line_start) x += letter_space; - uint32_t length = new_line_start - line_start; - calculate_x_coordinate(&x, align, bidi_txt, length, font, letter_space, &txt_coords); + if(align == LV_TEXT_ALIGN_CENTER) { + lv_coord_t line_w; + line_w = lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); + x += lv_area_get_width(&txt_coords) / 2 - line_w / 2; + + } + else if(align == LV_TEXT_ALIGN_RIGHT) { + lv_coord_t line_w; + line_w = lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); + + x += lv_area_get_width(&txt_coords) - line_w; + } pos->x = x; pos->y = y; #if LV_USE_BIDI - if(mutable_bidi_txt) lv_free(mutable_bidi_txt); + if(mutable_bidi_txt) lv_mem_buf_release(mutable_bidi_txt); #endif } -uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in, bool bidi) +uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in) { - LV_UNUSED(bidi); LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_NULL(pos_in); lv_label_t * label = (lv_label_t *)obj; @@ -415,31 +412,32 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in, bool const char * txt = lv_label_get_text(obj); uint32_t line_start = 0; uint32_t new_line_start = 0; - int32_t max_w = lv_area_get_width(&txt_coords); - int32_t max_h = lv_area_get_height(&txt_coords); + lv_coord_t max_w = lv_area_get_width(&txt_coords); const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - const int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - const int32_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); - const int32_t letter_height = lv_font_get_line_height(font); - int32_t y = 0; + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); + lv_coord_t letter_height = lv_font_get_line_height(font); + lv_coord_t y = 0; + lv_text_flag_t flag = LV_TEXT_FLAG_NONE; + uint32_t logical_pos; + char * bidi_txt; - lv_text_flag_t flag = get_label_flags(label); + if(label->recolor != 0) flag |= LV_TEXT_FLAG_RECOLOR; + if(label->expand != 0) flag |= LV_TEXT_FLAG_EXPAND; + if(lv_obj_get_style_width(obj, LV_PART_MAIN) == LV_SIZE_CONTENT && !obj->w_layout) flag |= LV_TEXT_FLAG_FIT; + + lv_text_align_t align = lv_obj_calculate_style_text_align(obj, LV_PART_MAIN, label->text); /*Search the line of the index letter*/; while(txt[line_start] != '\0') { - /*If dots will be shown, break the last visible line anywhere, - *not only at word boundaries.*/ - bool last_line = y + letter_height + line_space + letter_height > max_h; - if(last_line && label->long_mode == LV_LABEL_LONG_DOT) flag |= LV_TEXT_FLAG_BREAK_ALL; - - new_line_start += lv_text_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag); + new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag); if(pos.y <= y + letter_height) { /*The line is found (stored in 'line_start')*/ /*Include the NULL terminator in the last line*/ uint32_t tmp = new_line_start; uint32_t letter; - letter = lv_text_encoded_prev(txt, &tmp); + letter = _lv_txt_encoded_prev(txt, &tmp); if(letter != '\n' && txt[new_line_start] == '\0') new_line_start++; break; } @@ -448,27 +446,29 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in, bool line_start = new_line_start; } - char * bidi_txt; - #if LV_USE_BIDI - uint32_t txt_len = 0; - if(bidi) { - bidi_txt = lv_malloc(new_line_start - line_start + 1); - txt_len = new_line_start - line_start; - if(new_line_start > 0 && txt[new_line_start - 1] == '\0' && txt_len > 0) txt_len--; - lv_bidi_process_paragraph(txt + line_start, bidi_txt, txt_len, lv_obj_get_style_base_dir(obj, LV_PART_MAIN), NULL, 0); - } - else + bidi_txt = lv_mem_buf_get(new_line_start - line_start + 1); + uint32_t txt_len = new_line_start - line_start; + if(new_line_start > 0 && txt[new_line_start - 1] == '\0' && txt_len > 0) txt_len--; + _lv_bidi_process_paragraph(txt + line_start, bidi_txt, txt_len, lv_obj_get_style_base_dir(obj, LV_PART_MAIN), NULL, 0); +#else + bidi_txt = (char *)txt + line_start; #endif - { - bidi_txt = (char *)txt + line_start; - } /*Calculate the x coordinate*/ - int32_t x = 0; - const lv_text_align_t align = lv_obj_calculate_style_text_align(obj, LV_PART_MAIN, label->text); - uint32_t length = new_line_start - line_start; - calculate_x_coordinate(&x, align, bidi_txt, length, font, letter_space, &txt_coords); + lv_coord_t x = 0; + if(align == LV_TEXT_ALIGN_CENTER) { + lv_coord_t line_w; + line_w = lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); + x += lv_area_get_width(&txt_coords) / 2 - line_w / 2; + } + else if(align == LV_TEXT_ALIGN_RIGHT) { + lv_coord_t line_w; + line_w = lv_txt_get_width(bidi_txt, new_line_start - line_start, font, letter_space, flag); + x += lv_area_get_width(&txt_coords) - line_w; + } + + lv_text_cmd_state_t cmd_state = LV_TEXT_CMD_STATE_WAIT; uint32_t i = 0; uint32_t i_act = i; @@ -479,9 +479,16 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in, bool /*Be careful 'i' already points to the next character*/ uint32_t letter; uint32_t letter_next; - lv_text_encoded_letter_next_2(bidi_txt, &letter, &letter_next, &i); + _lv_txt_encoded_letter_next_2(bidi_txt, &letter, &letter_next, &i); + + /*Handle the recolor command*/ + if((flag & LV_TEXT_FLAG_RECOLOR) != 0) { + if(_lv_txt_is_cmd(&cmd_state, bidi_txt[i]) != false) { + continue; /*Skip the letter if it is part of a command*/ + } + } - int32_t gw = lv_font_get_glyph_width(font, letter, letter_next); + lv_coord_t gw = lv_font_get_glyph_width(font, letter, letter_next); /*Finish if the x position or the last char of the next line is reached*/ if(pos.x < x + gw || i + line_start == new_line_start || txt[i_act + line_start] == '\0') { @@ -494,29 +501,24 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in, bool } } - uint32_t logical_pos; #if LV_USE_BIDI - if(bidi) { - /*Handle Bidi*/ - uint32_t cid = lv_text_encoded_get_char_id(bidi_txt, i); - if(txt[line_start + i] == '\0') { - logical_pos = i; - } - else { - bool is_rtl; - logical_pos = lv_bidi_get_logical_pos(&txt[line_start], NULL, - txt_len, lv_obj_get_style_base_dir(obj, LV_PART_MAIN), cid, &is_rtl); - if(is_rtl) logical_pos++; - } - lv_free(bidi_txt); + /*Handle Bidi*/ + uint32_t cid = _lv_txt_encoded_get_char_id(bidi_txt, i); + if(txt[line_start + i] == '\0') { + logical_pos = i; } - else -#endif - { - logical_pos = lv_text_encoded_get_char_id(bidi_txt, i); + else { + bool is_rtl; + logical_pos = _lv_bidi_get_logical_pos(&txt[line_start], NULL, + txt_len, lv_obj_get_style_base_dir(obj, LV_PART_MAIN), cid, &is_rtl); + if(is_rtl) logical_pos++; } + lv_mem_buf_release(bidi_txt); +#else + logical_pos = _lv_txt_encoded_get_char_id(bidi_txt, i); +#endif - return logical_pos + lv_text_encoded_get_char_id(txt, line_start); + return logical_pos + _lv_txt_encoded_get_char_id(txt, line_start); } bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos) @@ -530,22 +532,23 @@ bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos) lv_label_t * label = (lv_label_t *)obj; uint32_t line_start = 0; uint32_t new_line_start = 0; - const int32_t max_w = lv_area_get_width(&txt_coords); - const int32_t max_h = lv_area_get_height(&txt_coords); + lv_coord_t max_w = lv_area_get_width(&txt_coords); const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - const int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - const int32_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); - const int32_t letter_height = lv_font_get_line_height(font); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); + lv_coord_t letter_height = lv_font_get_line_height(font); + lv_text_align_t align = lv_obj_calculate_style_text_align(obj, LV_PART_MAIN, label->text); - lv_text_flag_t flag = get_label_flags(label); + lv_coord_t y = 0; + lv_text_flag_t flag = LV_TEXT_FLAG_NONE; - /*Search the line of the index letter*/ - int32_t y = 0; - while(txt[line_start] != '\0') { - bool last_line = y + letter_height + line_space + letter_height > max_h; - if(last_line && label->long_mode == LV_LABEL_LONG_DOT) flag |= LV_TEXT_FLAG_BREAK_ALL; + if(label->recolor != 0) flag |= LV_TEXT_FLAG_RECOLOR; + if(label->expand != 0) flag |= LV_TEXT_FLAG_EXPAND; + if(lv_obj_get_style_width(obj, LV_PART_MAIN) == LV_SIZE_CONTENT && !obj->w_layout) flag |= LV_TEXT_FLAG_FIT; - new_line_start += lv_text_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag); + /*Search the line of the index letter*/; + while(txt[line_start] != '\0') { + new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag); if(pos->y <= y + letter_height) break; /*The line is found (stored in 'line_start')*/ y += letter_height + line_space; @@ -554,19 +557,21 @@ bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos) } /*Calculate the x coordinate*/ - const lv_text_align_t align = lv_obj_calculate_style_text_align(obj, LV_PART_MAIN, label->text); - - int32_t x = 0; + lv_coord_t x = 0; + lv_coord_t last_x = 0; if(align == LV_TEXT_ALIGN_CENTER) { - const int32_t line_w = lv_text_get_width(&txt[line_start], new_line_start - line_start, font, letter_space); + lv_coord_t line_w; + line_w = lv_txt_get_width(&txt[line_start], new_line_start - line_start, font, letter_space, flag); x += lv_area_get_width(&txt_coords) / 2 - line_w / 2; } else if(align == LV_TEXT_ALIGN_RIGHT) { - const int32_t line_w = lv_text_get_width(&txt[line_start], new_line_start - line_start, font, letter_space); + lv_coord_t line_w; + line_w = lv_txt_get_width(&txt[line_start], new_line_start - line_start, font, letter_space, flag); x += lv_area_get_width(&txt_coords) - line_w; } - int32_t last_x = 0; + lv_text_cmd_state_t cmd_state = LV_TEXT_CMD_STATE_WAIT; + uint32_t i = line_start; uint32_t i_current = i; uint32_t letter = '\0'; @@ -576,8 +581,14 @@ bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos) while(i <= new_line_start - 1) { /*Get the current letter and the next letter for kerning*/ /*Be careful 'i' already points to the next character*/ - lv_text_encoded_letter_next_2(txt, &letter, &letter_next, &i); + _lv_txt_encoded_letter_next_2(txt, &letter, &letter_next, &i); + /*Handle the recolor command*/ + if((flag & LV_TEXT_FLAG_RECOLOR) != 0) { + if(_lv_txt_is_cmd(&cmd_state, txt[i]) != false) { + continue; /*Skip the letter if it is part of a command*/ + } + } last_x = x; x += lv_font_get_glyph_width(font, letter, letter_next); if(pos->x < x) { @@ -589,7 +600,7 @@ bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos) } } - const int32_t max_diff = lv_font_get_glyph_width(font, letter, letter_next) + letter_space + 1; + int32_t max_diff = lv_font_get_glyph_width(font, letter, letter_next) + letter_space + 1; return (pos->x >= (last_x - letter_space) && pos->x <= (last_x + max_diff)); } @@ -600,6 +611,7 @@ uint32_t lv_label_get_text_selection_start(const lv_obj_t * obj) #if LV_LABEL_TEXT_SELECTION lv_label_t * label = (lv_label_t *)obj; return label->sel_start; + #else LV_UNUSED(obj); /*Unused*/ return LV_LABEL_TEXT_SELECTION_OFF; @@ -630,24 +642,24 @@ void lv_label_ins_text(lv_obj_t * obj, uint32_t pos, const char * txt) lv_label_t * label = (lv_label_t *)obj; - /*Cannot append to static text*/ + /*Can not append to static text*/ if(label->static_txt != 0) return; lv_obj_invalidate(obj); /*Allocate space for the new text*/ - size_t old_len = lv_strlen(label->text); - size_t ins_len = lv_strlen(txt); + size_t old_len = strlen(label->text); + size_t ins_len = strlen(txt); size_t new_len = ins_len + old_len; - label->text = lv_realloc(label->text, new_len + 1); + label->text = lv_mem_realloc(label->text, new_len + 1); LV_ASSERT_MALLOC(label->text); if(label->text == NULL) return; if(pos == LV_LABEL_POS_LAST) { - pos = lv_text_get_encoded_length(label->text); + pos = _lv_txt_get_encoded_length(label->text); } - lv_text_ins(label->text, pos, txt); + _lv_txt_ins(label->text, pos, txt); lv_label_set_text(obj, NULL); } @@ -656,14 +668,14 @@ void lv_label_cut_text(lv_obj_t * obj, uint32_t pos, uint32_t cnt) LV_ASSERT_OBJ(obj, MY_CLASS); lv_label_t * label = (lv_label_t *)obj; - /*Cannot append to static text*/ - if(label->static_txt) return; + /*Can not append to static text*/ + if(label->static_txt != 0) return; lv_obj_invalidate(obj); char * label_txt = lv_label_get_text(obj); /*Delete the characters*/ - lv_text_cut(label_txt, pos, cnt); + _lv_txt_cut(label_txt, pos, cnt); /*Refresh the label*/ lv_label_refr_text(obj); @@ -682,9 +694,11 @@ static void lv_label_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) label->text = NULL; label->static_txt = 0; + label->recolor = 0; label->dot_end = LV_LABEL_DOT_END_INV; label->long_mode = LV_LABEL_LONG_WRAP; - lv_point_set(&label->offset, 0, 0); + label->offset.x = 0; + label->offset.y = 0; #if LV_LABEL_LONG_TXT_HINT label->hint.line_start = -1; @@ -699,9 +713,10 @@ static void lv_label_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) label->dot.tmp_ptr = NULL; label->dot_tmp_alloc = 0; - lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); lv_label_set_long_mode(obj, LV_LABEL_LONG_WRAP); - lv_label_set_text(obj, LV_LABEL_DEFAULT_TEXT); + lv_label_set_text(obj, "Text"); + LV_TRACE_OBJ_CREATE("finished"); } @@ -712,7 +727,7 @@ static void lv_label_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) lv_label_t * label = (lv_label_t *)obj; lv_label_dot_tmp_free(obj); - if(!label->static_txt) lv_free(label->text); + if(!label->static_txt) lv_mem_free(label->text); label->text = NULL; } @@ -720,14 +735,16 @@ static void lv_label_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); + lv_res_t res; + /*Call the ancestor's event handler*/ - const lv_result_t res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + res = lv_obj_event_base(MY_CLASS, e); + if(res != LV_RES_OK) return; - const lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_event_code_t code = lv_event_get_code(e); + lv_obj_t * obj = lv_event_get_target(e); - if((code == LV_EVENT_STYLE_CHANGED) || (code == LV_EVENT_SIZE_CHANGED)) { + if(code == LV_EVENT_STYLE_CHANGED) { /*Revert dots for proper refresh*/ lv_label_revert_dots(obj); lv_label_refr_text(obj); @@ -738,58 +755,58 @@ static void lv_label_event(const lv_obj_class_t * class_p, lv_event_t * e) * To avoid this add some extra draw area. * font_h / 4 is an empirical value. */ const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - const int32_t font_h = lv_font_get_line_height(font); + lv_coord_t font_h = lv_font_get_line_height(font); lv_event_set_ext_draw_size(e, font_h / 4); } + else if(code == LV_EVENT_SIZE_CHANGED) { + lv_label_revert_dots(obj); + lv_label_refr_text(obj); + } else if(code == LV_EVENT_GET_SELF_SIZE) { + lv_point_t size; lv_label_t * label = (lv_label_t *)obj; - if(label->invalid_size_cache) { - const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - int32_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - lv_text_flag_t flag = LV_TEXT_FLAG_NONE; - if(label->expand != 0) flag |= LV_TEXT_FLAG_EXPAND; - - int32_t w = lv_obj_get_content_width(obj); - if(lv_obj_get_style_width(obj, LV_PART_MAIN) == LV_SIZE_CONTENT && !obj->w_layout) w = LV_COORD_MAX; - else w = lv_obj_get_content_width(obj); + const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); + lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_text_flag_t flag = LV_TEXT_FLAG_NONE; + if(label->recolor != 0) flag |= LV_TEXT_FLAG_RECOLOR; + if(label->expand != 0) flag |= LV_TEXT_FLAG_EXPAND; - w = LV_MIN(w, lv_obj_get_style_max_width(obj, 0)); + lv_coord_t w = lv_obj_get_content_width(obj); + if(lv_obj_get_style_width(obj, LV_PART_MAIN) == LV_SIZE_CONTENT && !obj->w_layout) w = LV_COORD_MAX; + else w = lv_obj_get_content_width(obj); - lv_text_get_size(&label->size_cache, label->text, font, letter_space, line_space, w, flag); - label->invalid_size_cache = false; - } + lv_txt_get_size(&size, label->text, font, letter_space, line_space, w, flag); lv_point_t * self_size = lv_event_get_param(e); - self_size->x = LV_MAX(self_size->x, label->size_cache.x); - self_size->y = LV_MAX(self_size->y, label->size_cache.y); + self_size->x = LV_MAX(self_size->x, size.x); + self_size->y = LV_MAX(self_size->y, size.y); } else if(code == LV_EVENT_DRAW_MAIN) { draw_main(e); } } + static void draw_main(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_label_t * label = (lv_label_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); lv_area_t txt_coords; lv_obj_get_content_coords(obj, &txt_coords); - lv_text_flag_t flag = get_label_flags(label); + lv_text_flag_t flag = LV_TEXT_FLAG_NONE; + if(label->recolor != 0) flag |= LV_TEXT_FLAG_RECOLOR; + if(label->expand != 0) flag |= LV_TEXT_FLAG_EXPAND; + if(lv_obj_get_style_width(obj, LV_PART_MAIN) == LV_SIZE_CONTENT && !obj->w_layout) flag |= LV_TEXT_FLAG_FIT; lv_draw_label_dsc_t label_draw_dsc; lv_draw_label_dsc_init(&label_draw_dsc); - label_draw_dsc.text = label->text; + label_draw_dsc.ofs_x = label->offset.x; label_draw_dsc.ofs_y = label->offset.y; -#if LV_LABEL_LONG_TXT_HINT - if(label->long_mode != LV_LABEL_LONG_SCROLL_CIRCULAR && lv_area_get_height(&txt_coords) >= LV_LABEL_HINT_HEIGHT_LIMIT) { - label_draw_dsc.hint = &label->hint; - } -#endif label_draw_dsc.flag = flag; lv_obj_init_draw_label_dsc(obj, LV_PART_MAIN, &label_draw_dsc); @@ -807,41 +824,48 @@ static void draw_main(lv_event_t * e) if((label->long_mode == LV_LABEL_LONG_SCROLL || label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR) && (label_draw_dsc.align == LV_TEXT_ALIGN_CENTER || label_draw_dsc.align == LV_TEXT_ALIGN_RIGHT)) { lv_point_t size; - lv_text_get_size(&size, label->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space, - LV_COORD_MAX, flag); + lv_txt_get_size(&size, label->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space, + LV_COORD_MAX, flag); if(size.x > lv_area_get_width(&txt_coords)) { label_draw_dsc.align = LV_TEXT_ALIGN_LEFT; } } +#if LV_LABEL_LONG_TXT_HINT + lv_draw_label_hint_t * hint = &label->hint; + if(label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR || lv_area_get_height(&txt_coords) < LV_LABEL_HINT_HEIGHT_LIMIT) + hint = NULL; + +#else + /*Just for compatibility*/ + lv_draw_label_hint_t * hint = NULL; +#endif lv_area_t txt_clip; - bool is_common = lv_area_intersect(&txt_clip, &txt_coords, &layer->_clip_area); - if(!is_common) { - return; - } + bool is_common = _lv_area_intersect(&txt_clip, &txt_coords, draw_ctx->clip_area); + if(!is_common) return; if(label->long_mode == LV_LABEL_LONG_WRAP) { - int32_t s = lv_obj_get_scroll_top(obj); + lv_coord_t s = lv_obj_get_scroll_top(obj); lv_area_move(&txt_coords, 0, -s); txt_coords.y2 = obj->coords.y2; } if(label->long_mode == LV_LABEL_LONG_SCROLL || label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR) { - const lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = txt_clip; - lv_draw_label(layer, &label_draw_dsc, &txt_coords); - layer->_clip_area = clip_area_ori; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &txt_clip; + lv_draw_label(draw_ctx, &label_draw_dsc, &txt_coords, label->text, hint); + draw_ctx->clip_area = clip_area_ori; } else { - lv_draw_label(layer, &label_draw_dsc, &txt_coords); + lv_draw_label(draw_ctx, &label_draw_dsc, &txt_coords, label->text, hint); } - lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = txt_clip; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &txt_clip; if(label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR) { lv_point_t size; - lv_text_get_size(&size, label->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space, - LV_COORD_MAX, flag); + lv_txt_get_size(&size, label->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space, + LV_COORD_MAX, flag); /*Draw the text again on label to the original to make a circular effect */ if(size.x > lv_area_get_width(&txt_coords)) { @@ -849,7 +873,7 @@ static void draw_main(lv_event_t * e) lv_font_get_glyph_width(label_draw_dsc.font, ' ', ' ') * LV_LABEL_WAIT_CHAR_COUNT; label_draw_dsc.ofs_y = label->offset.y; - lv_draw_label(layer, &label_draw_dsc, &txt_coords); + lv_draw_label(draw_ctx, &label_draw_dsc, &txt_coords, label->text, hint); } /*Draw the text again below the original to make a circular effect */ @@ -857,36 +881,11 @@ static void draw_main(lv_event_t * e) label_draw_dsc.ofs_x = label->offset.x; label_draw_dsc.ofs_y = label->offset.y + size.y + lv_font_get_line_height(label_draw_dsc.font); - lv_draw_label(layer, &label_draw_dsc, &txt_coords); + lv_draw_label(draw_ctx, &label_draw_dsc, &txt_coords, label->text, hint); } } - layer->_clip_area = clip_area_ori; -} - -static void overwrite_anim_property(lv_anim_t * dest, const lv_anim_t * src, lv_label_long_mode_t mode) -{ - switch(mode) { - case LV_LABEL_LONG_SCROLL: - /** If the dest animation is already running, overwrite is not allowed */ - if(dest->act_time <= 0) - dest->act_time = src->act_time; - dest->repeat_cnt = src->repeat_cnt; - dest->repeat_delay = src->repeat_delay; - dest->completed_cb = src->completed_cb; - dest->playback_delay = src->playback_delay; - break; - case LV_LABEL_LONG_SCROLL_CIRCULAR: - /** If the dest animation is already running, overwrite is not allowed */ - if(dest->act_time <= 0) - dest->act_time = src->act_time; - dest->repeat_cnt = src->repeat_cnt; - dest->repeat_delay = src->repeat_delay; - dest->completed_cb = src->completed_cb; - break; - default: - break; - } + draw_ctx->clip_area = clip_area_ori; } /** @@ -900,28 +899,29 @@ static void lv_label_refr_text(lv_obj_t * obj) #if LV_LABEL_LONG_TXT_HINT label->hint.line_start = -1; /*The hint is invalid if the text changes*/ #endif - label->invalid_size_cache = true; lv_area_t txt_coords; lv_obj_get_content_coords(obj, &txt_coords); - int32_t max_w = lv_area_get_width(&txt_coords); + lv_coord_t max_w = lv_area_get_width(&txt_coords); const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - int32_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN); /*Calc. the height and longest line*/ lv_point_t size; - lv_text_flag_t flag = get_label_flags(label); + lv_text_flag_t flag = LV_TEXT_FLAG_NONE; + if(label->recolor != 0) flag |= LV_TEXT_FLAG_RECOLOR; + if(label->expand != 0) flag |= LV_TEXT_FLAG_EXPAND; + if(lv_obj_get_style_width(obj, LV_PART_MAIN) == LV_SIZE_CONTENT && !obj->w_layout) flag |= LV_TEXT_FLAG_FIT; - lv_text_get_size(&size, label->text, font, letter_space, line_space, max_w, flag); + lv_txt_get_size(&size, label->text, font, letter_space, line_space, max_w, flag); lv_obj_refresh_self_size(obj); /*In scroll mode start an offset animation*/ if(label->long_mode == LV_LABEL_LONG_SCROLL) { - const lv_anim_t * anim_template = lv_obj_get_style_anim(obj, LV_PART_MAIN); - uint32_t anim_time = lv_obj_get_style_anim_duration(obj, LV_PART_MAIN); - if(anim_time == 0) anim_time = LV_LABEL_DEF_SCROLL_SPEED; + uint16_t anim_speed = lv_obj_get_style_anim_speed(obj, LV_PART_MAIN); + if(anim_speed == 0) anim_speed = LV_LABEL_DEF_SCROLL_SPEED; lv_anim_t a; lv_anim_init(&a); lv_anim_set_var(&a, obj); @@ -931,14 +931,12 @@ static void lv_label_refr_text(lv_obj_t * obj) bool hor_anim = false; if(size.x > lv_area_get_width(&txt_coords)) { - int32_t start = 0; - int32_t end = 0; - #if LV_USE_BIDI + int32_t start, end; lv_base_dir_t base_dir = lv_obj_get_style_base_dir(obj, LV_PART_MAIN); if(base_dir == LV_BASE_DIR_AUTO) - base_dir = lv_bidi_detect_base_dir(label->text); + base_dir = _lv_bidi_detect_base_dir(label->text); if(base_dir == LV_BASE_DIR_RTL) { start = lv_area_get_width(&txt_coords) - size.x; @@ -948,11 +946,12 @@ static void lv_label_refr_text(lv_obj_t * obj) start = 0; end = lv_area_get_width(&txt_coords) - size.x; } -#else - end = lv_area_get_width(&txt_coords) - size.x; -#endif lv_anim_set_values(&a, start, end); +#else + lv_anim_set_values(&a, 0, lv_area_get_width(&txt_coords) - size.x); + lv_anim_set_exec_cb(&a, set_ofs_x_anim); +#endif lv_anim_set_exec_cb(&a, set_ofs_x_anim); lv_anim_t * anim_cur = lv_anim_get(obj, set_ofs_x_anim); @@ -962,7 +961,7 @@ static void lv_label_refr_text(lv_obj_t * obj) act_time = anim_cur->act_time; playback_now = anim_cur->playback_now; } - if(act_time < a.duration) { + if(act_time < a.time) { a.act_time = act_time; /*To keep the old position*/ a.early_apply = 0; if(playback_now) { @@ -975,18 +974,14 @@ static void lv_label_refr_text(lv_obj_t * obj) } } - lv_anim_set_duration(&a, anim_time); - lv_anim_set_playback_duration(&a, a.duration); - - /*If a template animation exists, overwrite some property*/ - if(anim_template) - overwrite_anim_property(&a, anim_template, label->long_mode); + lv_anim_set_time(&a, lv_anim_speed_to_time(anim_speed, a.start_value, a.end_value)); + lv_anim_set_playback_time(&a, a.time); lv_anim_start(&a); hor_anim = true; } else { /*Delete the offset animation if not required*/ - lv_anim_delete(obj, set_ofs_x_anim); + lv_anim_del(obj, set_ofs_x_anim); label->offset.x = 0; } @@ -1001,7 +996,7 @@ static void lv_label_refr_text(lv_obj_t * obj) act_time = anim_cur->act_time; playback_now = anim_cur->playback_now; } - if(act_time < a.duration) { + if(act_time < a.time) { a.act_time = act_time; /*To keep the old position*/ a.early_apply = 0; if(playback_now) { @@ -1014,25 +1009,21 @@ static void lv_label_refr_text(lv_obj_t * obj) } } - lv_anim_set_duration(&a, anim_time); - lv_anim_set_playback_duration(&a, a.duration); - - /*If a template animation exists, overwrite some property*/ - if(anim_template) - overwrite_anim_property(&a, anim_template, label->long_mode); + lv_anim_set_time(&a, lv_anim_speed_to_time(anim_speed, a.start_value, a.end_value)); + lv_anim_set_playback_time(&a, a.time); lv_anim_start(&a); } else { /*Delete the offset animation if not required*/ - lv_anim_delete(obj, set_ofs_y_anim); + lv_anim_del(obj, set_ofs_y_anim); label->offset.y = 0; } } /*In roll inf. mode keep the size but start offset animations*/ else if(label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR) { const lv_anim_t * anim_template = lv_obj_get_style_anim(obj, LV_PART_MAIN); - uint32_t anim_time = lv_obj_get_style_anim_duration(obj, LV_PART_MAIN); - if(anim_time == 0) anim_time = LV_LABEL_DEF_SCROLL_SPEED; + uint16_t anim_speed = lv_obj_get_style_anim_speed(obj, LV_PART_MAIN); + if(anim_speed == 0) anim_speed = LV_LABEL_DEF_SCROLL_SPEED; lv_anim_t a; lv_anim_init(&a); lv_anim_set_var(&a, obj); @@ -1045,7 +1036,7 @@ static void lv_label_refr_text(lv_obj_t * obj) lv_base_dir_t base_dir = lv_obj_get_style_base_dir(obj, LV_PART_MAIN); if(base_dir == LV_BASE_DIR_AUTO) - base_dir = lv_bidi_detect_base_dir(label->text); + base_dir = _lv_bidi_detect_base_dir(label->text); if(base_dir == LV_BASE_DIR_RTL) { start = -size.x - lv_font_get_glyph_width(font, ' ', ' ') * LV_LABEL_WAIT_CHAR_COUNT; @@ -1061,16 +1052,17 @@ static void lv_label_refr_text(lv_obj_t * obj) lv_anim_set_values(&a, 0, -size.x - lv_font_get_glyph_width(font, ' ', ' ') * LV_LABEL_WAIT_CHAR_COUNT); #endif lv_anim_set_exec_cb(&a, set_ofs_x_anim); - lv_anim_set_duration(&a, anim_time); + lv_anim_set_time(&a, lv_anim_speed_to_time(anim_speed, a.start_value, a.end_value)); lv_anim_t * anim_cur = lv_anim_get(obj, set_ofs_x_anim); int32_t act_time = anim_cur ? anim_cur->act_time : 0; - /*If a template animation exists, overwrite some property*/ + /*If a template animation exists, consider it's start delay and repeat delay*/ if(anim_template) { - overwrite_anim_property(&a, anim_template, label->long_mode); + a.act_time = anim_template->act_time; + a.repeat_delay = anim_template->repeat_delay; } - else if(act_time < a.duration) { + else if(act_time < a.time) { a.act_time = act_time; /*To keep the old position when the label text is updated mid-scrolling*/ a.early_apply = 0; } @@ -1080,23 +1072,24 @@ static void lv_label_refr_text(lv_obj_t * obj) } else { /*Delete the offset animation if not required*/ - lv_anim_delete(obj, set_ofs_x_anim); + lv_anim_del(obj, set_ofs_x_anim); label->offset.x = 0; } if(size.y > lv_area_get_height(&txt_coords) && hor_anim == false) { lv_anim_set_values(&a, 0, -size.y - (lv_font_get_line_height(font))); lv_anim_set_exec_cb(&a, set_ofs_y_anim); - lv_anim_set_duration(&a, anim_time); + lv_anim_set_time(&a, lv_anim_speed_to_time(anim_speed, a.start_value, a.end_value)); lv_anim_t * anim_cur = lv_anim_get(obj, set_ofs_y_anim); int32_t act_time = anim_cur ? anim_cur->act_time : 0; - /*If a template animation exists, overwrite some property*/ + /*If a template animation exists, consider it's start delay and repeat delay*/ if(anim_template) { - overwrite_anim_property(&a, anim_template, label->long_mode); + a.act_time = anim_template->act_time; + a.repeat_delay = anim_template->repeat_delay; } - else if(act_time < a.duration) { + else if(act_time < a.time) { a.act_time = act_time; /*To keep the old position when the label text is updated mid-scrolling*/ a.early_apply = 0; } @@ -1105,7 +1098,7 @@ static void lv_label_refr_text(lv_obj_t * obj) } else { /*Delete the offset animation if not required*/ - lv_anim_delete(obj, set_ofs_y_anim); + lv_anim_del(obj, set_ofs_y_anim); label->offset.y = 0; } } @@ -1116,12 +1109,12 @@ static void lv_label_refr_text(lv_obj_t * obj) else if(size.y <= lv_font_get_line_height(font)) { /*No dots are required for one-line texts*/ label->dot_end = LV_LABEL_DOT_END_INV; } - else if(lv_text_get_encoded_length(label->text) <= LV_LABEL_DOT_NUM) { /*Don't turn to dots all the characters*/ + else if(_lv_txt_get_encoded_length(label->text) <= LV_LABEL_DOT_NUM) { /*Don't turn to dots all the characters*/ label->dot_end = LV_LABEL_DOT_END_INV; } else { lv_point_t p; - int32_t y_overed; + lv_coord_t y_overed; p.x = lv_area_get_width(&txt_coords) - (lv_font_get_glyph_width(font, '.', '.') + letter_space) * LV_LABEL_DOT_NUM; /*Shrink with dots*/ @@ -1137,13 +1130,13 @@ static void lv_label_refr_text(lv_obj_t * obj) p.y -= line_space; } - uint32_t letter_id = lv_label_get_letter_on(obj, &p, false); + uint32_t letter_id = lv_label_get_letter_on(obj, &p); /*Be sure there is space for the dots*/ - size_t txt_len = lv_strlen(label->text); - uint32_t byte_id = lv_text_encoded_get_byte_id(label->text, letter_id); + size_t txt_len = strlen(label->text); + uint32_t byte_id = _lv_txt_encoded_get_byte_id(label->text, letter_id); while(byte_id + LV_LABEL_DOT_NUM > txt_len) { - lv_text_encoded_prev(label->text, &byte_id); + _lv_txt_encoded_prev(label->text, &byte_id); letter_id--; } @@ -1152,8 +1145,8 @@ static void lv_label_refr_text(lv_obj_t * obj) uint32_t i; uint8_t len = 0; for(i = 0; i <= LV_LABEL_DOT_NUM; i++) { - len += lv_text_encoded_size(&label->text[byte_id]); - lv_text_encoded_next(label->text, &byte_id); + len += _lv_txt_encoded_size(&label->text[byte_id]); + _lv_txt_encoded_next(label->text, &byte_id); if(len > LV_LABEL_DOT_NUM || byte_id > txt_len) { break; } @@ -1175,25 +1168,25 @@ static void lv_label_refr_text(lv_obj_t * obj) lv_obj_invalidate(obj); } + static void lv_label_revert_dots(lv_obj_t * obj) { + lv_label_t * label = (lv_label_t *)obj; if(label->long_mode != LV_LABEL_LONG_DOT) return; if(label->dot_end == LV_LABEL_DOT_END_INV) return; - - const uint32_t letter_i = label->dot_end - LV_LABEL_DOT_NUM; - const uint32_t byte_i = lv_text_encoded_get_byte_id(label->text, letter_i); + uint32_t letter_i = label->dot_end - LV_LABEL_DOT_NUM; + uint32_t byte_i = _lv_txt_encoded_get_byte_id(label->text, letter_i); /*Restore the characters*/ - uint8_t i = 0; + uint8_t i = 0; char * dot_tmp = lv_label_get_dot_tmp(obj); while(label->text[byte_i + i] != '\0') { label->text[byte_i + i] = dot_tmp[i]; i++; } label->text[byte_i + i] = dot_tmp[i]; - lv_label_dot_tmp_free(obj); label->dot_end = LV_LABEL_DOT_END_INV; @@ -1214,7 +1207,7 @@ static bool lv_label_set_dot_tmp(lv_obj_t * obj, char * data, uint32_t len) if(len > sizeof(char *)) { /*Memory needs to be allocated. Allocates an additional byte *for a NULL-terminator so it can be copied.*/ - label->dot.tmp_ptr = lv_malloc(len + 1); + label->dot.tmp_ptr = lv_mem_alloc(len + 1); if(label->dot.tmp_ptr == NULL) { LV_LOG_ERROR("Failed to allocate memory for dot_tmp_ptr"); return false; @@ -1256,12 +1249,13 @@ static void lv_label_dot_tmp_free(lv_obj_t * obj) { lv_label_t * label = (lv_label_t *)obj; if(label->dot_tmp_alloc && label->dot.tmp_ptr) { - lv_free(label->dot.tmp_ptr); + lv_mem_free(label->dot.tmp_ptr); } label->dot_tmp_alloc = false; label->dot.tmp_ptr = NULL; } + static void set_ofs_x_anim(void * obj, int32_t v) { lv_label_t * label = (lv_label_t *)obj; @@ -1276,58 +1270,5 @@ static void set_ofs_y_anim(void * obj, int32_t v) lv_obj_invalidate(obj); } -static size_t get_text_length(const char * text) -{ - size_t len = 0; -#if LV_USE_ARABIC_PERSIAN_CHARS - len = lv_text_ap_calc_bytes_count(text); -#else - len = lv_strlen(text) + 1; -#endif - - return len; -} - -static void copy_text_to_label(lv_label_t * label, const char * text) -{ -#if LV_USE_ARABIC_PERSIAN_CHARS - lv_text_ap_proc(text, label->text); -#else - lv_strcpy(label->text, text); -#endif -} - -static lv_text_flag_t get_label_flags(lv_label_t * label) -{ - lv_text_flag_t flag = LV_TEXT_FLAG_NONE; - - if(label->expand) flag |= LV_TEXT_FLAG_EXPAND; - - lv_obj_t * obj = (lv_obj_t *) label; - if(lv_obj_get_style_width(obj, LV_PART_MAIN) == LV_SIZE_CONTENT && - lv_obj_get_style_max_width(obj, LV_PART_MAIN) == LV_COORD_MAX && - !obj->w_layout) { - flag |= LV_TEXT_FLAG_FIT; - } - - return flag; -} - -/* Function created because of this pattern be used in multiple functions */ -static void calculate_x_coordinate(int32_t * x, const lv_text_align_t align, const char * txt, uint32_t length, - const lv_font_t * font, int32_t letter_space, lv_area_t * txt_coords) -{ - if(align == LV_TEXT_ALIGN_CENTER) { - const int32_t line_w = lv_text_get_width(txt, length, font, letter_space); - *x += lv_area_get_width(txt_coords) / 2 - line_w / 2; - } - else if(align == LV_TEXT_ALIGN_RIGHT) { - const int32_t line_w = lv_text_get_width(txt, length, font, letter_space); - *x += lv_area_get_width(txt_coords) - line_w; - } - else { - /* Nothing to do */ - } -} #endif diff --git a/L3_Middlewares/LVGL/src/widgets/label/lv_label.h b/L3_Middlewares/LVGL/src/widgets/lv_label.h similarity index 71% rename from L3_Middlewares/LVGL/src/widgets/label/lv_label.h rename to L3_Middlewares/LVGL/src/widgets/lv_label.h index 86964f3..b31a63e 100644 --- a/L3_Middlewares/LVGL/src/widgets/label/lv_label.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_label.h @@ -13,28 +13,24 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" +#include "../lv_conf_internal.h" #if LV_USE_LABEL != 0 -#include "../../misc/lv_types.h" -#include "../../core/lv_obj.h" -#include "../../font/lv_font.h" -#include "../../font/lv_symbol_def.h" -#include "../../misc/lv_text.h" -#include "../../draw/lv_draw.h" +#include +#include "../core/lv_obj.h" +#include "../font/lv_font.h" +#include "../font/lv_symbol_def.h" +#include "../misc/lv_txt.h" +#include "../draw/lv_draw.h" /********************* * DEFINES *********************/ +#define LV_LABEL_WAIT_CHAR_COUNT 3 #define LV_LABEL_DOT_NUM 3 #define LV_LABEL_POS_LAST 0xFFFF #define LV_LABEL_TEXT_SELECTION_OFF LV_DRAW_LABEL_NO_TXT_SEL -#if LV_WIDGETS_HAS_DEFAULT_VALUE -#define LV_LABEL_DEFAULT_TEXT "Text" -#else -#define LV_LABEL_DEFAULT_TEXT "" -#endif LV_EXPORT_CONST_INT(LV_LABEL_DOT_NUM); LV_EXPORT_CONST_INT(LV_LABEL_POS_LAST); @@ -45,25 +41,42 @@ LV_EXPORT_CONST_INT(LV_LABEL_TEXT_SELECTION_OFF); **********************/ /** Long mode behaviors. Used in 'lv_label_ext_t'*/ -typedef enum { - LV_LABEL_LONG_WRAP, /**< Keep the object width, wrap lines longer than object width and expand the object height*/ +enum { + LV_LABEL_LONG_WRAP, /**< Keep the object width, wrap the too long lines and expand the object height*/ LV_LABEL_LONG_DOT, /**< Keep the size and write dots at the end if the text is too long*/ LV_LABEL_LONG_SCROLL, /**< Keep the size and roll the text back and forth*/ LV_LABEL_LONG_SCROLL_CIRCULAR, /**< Keep the size and roll the text circularly*/ LV_LABEL_LONG_CLIP, /**< Keep the size and clip the text out of it*/ -} lv_label_long_mode_t; - -#if LV_USE_OBJ_PROPERTY -enum { - LV_PROPERTY_ID(LABEL, TEXT, LV_PROPERTY_TYPE_TEXT, 0), - LV_PROPERTY_ID(LABEL, LONG_MODE, LV_PROPERTY_TYPE_INT, 1), - LV_PROPERTY_ID(LABEL, TEXT_SELECTION_START, LV_PROPERTY_TYPE_INT, 2), - LV_PROPERTY_ID(LABEL, TEXT_SELECTION_END, LV_PROPERTY_TYPE_INT, 3), - LV_PROPERTY_LABEL_END, }; +typedef uint8_t lv_label_long_mode_t; + +typedef struct { + lv_obj_t obj; + char * text; + union { + char * tmp_ptr; /*Pointer to the allocated memory containing the character replaced by dots*/ + char tmp[LV_LABEL_DOT_NUM + 1]; /*Directly store the characters if <=4 characters*/ + } dot; + uint32_t dot_end; /*The real text length, used in dot mode*/ + +#if LV_LABEL_LONG_TXT_HINT + lv_draw_label_hint_t hint; #endif -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_label_class; +#if LV_LABEL_TEXT_SELECTION + uint32_t sel_start; + uint32_t sel_end; +#endif + + lv_point_t offset; /*Text draw position offset*/ + lv_label_long_mode_t long_mode : 3; /*Determine what to do with the long texts*/ + uint8_t static_txt : 1; /*Flag to indicate the text is static*/ + uint8_t recolor : 1; /*Enable in-line letter re-coloring*/ + uint8_t expand : 1; /*Ignore real width (used by the library with LV_LABEL_LONG_SCROLL)*/ + uint8_t dot_tmp_alloc : 1; /*1: dot is allocated, 0: dot directly holds up to 4 chars*/ +} lv_label_t; + +extern const lv_obj_class_t lv_label_class; /********************** * GLOBAL PROTOTYPES @@ -91,11 +104,7 @@ void lv_label_set_text(lv_obj_t * obj, const char * text); * Set a new formatted text for a label. Memory will be allocated to store the text by the label. * @param obj pointer to a label object * @param fmt `printf`-like format - * - * Example: - * @code - * lv_label_set_text_fmt(label1, "%d user", user_num); - * @endcode + * @example lv_label_set_text_fmt(label1, "%d user", user_num); */ void lv_label_set_text_fmt(lv_obj_t * obj, const char * fmt, ...) LV_FORMAT_ATTRIBUTE(2, 3); @@ -108,26 +117,34 @@ void lv_label_set_text_fmt(lv_obj_t * obj, const char * fmt, ...) LV_FORMAT_ATTR void lv_label_set_text_static(lv_obj_t * obj, const char * text); /** - * Set the behavior of the label with text longer than the object size + * Set the behavior of the label with longer text then the object size * @param obj pointer to a label object * @param long_mode the new mode from 'lv_label_long_mode' enum. * In LV_LONG_WRAP/DOT/SCROLL/SCROLL_CIRC the size of the label should be set AFTER this function */ void lv_label_set_long_mode(lv_obj_t * obj, lv_label_long_mode_t long_mode); +/** + * Enable the recoloring by in-line commands + * @param obj pointer to a label object + * @param en true: enable recoloring, false: disable + * @example "This is a #ff0000 red# word" + */ +void lv_label_set_recolor(lv_obj_t * obj, bool en); + /** * Set where text selection should start * @param obj pointer to a label object * @param index character index from where selection should start. `LV_LABEL_TEXT_SELECTION_OFF` for no selection */ -void lv_label_set_text_selection_start(lv_obj_t * obj, uint32_t index); +void lv_label_set_text_sel_start(lv_obj_t * obj, uint32_t index); /** * Set where text selection should end * @param obj pointer to a label object * @param index character index where selection should end. `LV_LABEL_TEXT_SELECTION_OFF` for no selection */ -void lv_label_set_text_selection_end(lv_obj_t * obj, uint32_t index); +void lv_label_set_text_sel_end(lv_obj_t * obj, uint32_t index); /*===================== * Getter functions @@ -147,10 +164,17 @@ char * lv_label_get_text(const lv_obj_t * obj); */ lv_label_long_mode_t lv_label_get_long_mode(const lv_obj_t * obj); +/** + * Get the recoloring attribute + * @param obj pointer to a label object + * @return true: recoloring is enabled, false: disable + */ +bool lv_label_get_recolor(const lv_obj_t * obj); + /** * Get the relative x and y coordinates of a letter * @param obj pointer to a label object - * @param char_id index of the character [0 ... text length - 1]. + * @param index index of the character [0 ... text length - 1]. * Expressed in character index, not byte index (different in UTF-8) * @param pos store the result here (E.g. index = 0 gives 0;0 coordinates if the text if aligned to the left) */ @@ -159,12 +183,11 @@ void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t /** * Get the index of letter on a relative point of a label. * @param obj pointer to label object - * @param pos_in pointer to point with coordinates on a the label - * @param bidi whether to use bidi processed + * @param pos pointer to point with coordinates on a the label * @return The index of the letter on the 'pos_p' point (E.g. on 0;0 is the 0. letter if aligned to the left) * Expressed in character index and not byte index (different in UTF-8) */ -uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in, bool bidi); +uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in); /** * Check if a character is drawn under a point. @@ -193,7 +216,7 @@ uint32_t lv_label_get_text_selection_end(const lv_obj_t * obj); *====================*/ /** - * Insert a text to a label. The label text cannot be static. + * Insert a text to a label. The label text can not be static. * @param obj pointer to a label object * @param pos character index to insert. Expressed in character index and not byte index. * 0: before first char. LV_LABEL_POS_LAST: after last char. @@ -202,10 +225,10 @@ uint32_t lv_label_get_text_selection_end(const lv_obj_t * obj); void lv_label_ins_text(lv_obj_t * obj, uint32_t pos, const char * txt); /** - * Delete characters from a label. The label text cannot be static. + * Delete characters from a label. The label text can not be static. * @param obj pointer to a label object * @param pos character index from where to cut. Expressed in character index and not byte index. - * 0: start in front of the first character + * 0: start in from of the first character * @param cnt number of characters to cut */ void lv_label_cut_text(lv_obj_t * obj, uint32_t pos, uint32_t cnt); diff --git a/L3_Middlewares/LVGL/src/widgets/lv_line.c b/L3_Middlewares/LVGL/src/widgets/lv_line.c new file mode 100644 index 0000000..df32bd0 --- /dev/null +++ b/L3_Middlewares/LVGL/src/widgets/lv_line.c @@ -0,0 +1,201 @@ +/** + * @file lv_line.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_line.h" + +#if LV_USE_LINE != 0 +#include "../misc/lv_assert.h" +#include "../draw/lv_draw.h" +#include "../misc/lv_math.h" +#include +#include +#include + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_line_class + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_line_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_line_event(const lv_obj_class_t * class_p, lv_event_t * e); + +/********************** + * STATIC VARIABLES + **********************/ +const lv_obj_class_t lv_line_class = { + .constructor_cb = lv_line_constructor, + .event_cb = lv_line_event, + .width_def = LV_SIZE_CONTENT, + .height_def = LV_SIZE_CONTENT, + .instance_size = sizeof(lv_line_t), + .base_class = &lv_obj_class +}; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_obj_t * lv_line_create(lv_obj_t * parent) +{ + LV_LOG_INFO("begin"); + lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); + lv_obj_class_init_obj(obj); + return obj; +} + +/*===================== + * Setter functions + *====================*/ + +void lv_line_set_points(lv_obj_t * obj, const lv_point_t points[], uint16_t point_num) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_line_t * line = (lv_line_t *)obj; + line->point_array = points; + line->point_num = point_num; + + lv_obj_refresh_self_size(obj); + + lv_obj_invalidate(obj); +} + +void lv_line_set_y_invert(lv_obj_t * obj, bool en) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_line_t * line = (lv_line_t *)obj; + if(line->y_inv == en) return; + + line->y_inv = en ? 1U : 0U; + + lv_obj_invalidate(obj); +} + +/*===================== + * Getter functions + *====================*/ + +bool lv_line_get_y_invert(const lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + + lv_line_t * line = (lv_line_t *)obj; + + return line->y_inv == 1U; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_line_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + LV_TRACE_OBJ_CREATE("begin"); + + lv_line_t * line = (lv_line_t *)obj; + + line->point_num = 0; + line->point_array = NULL; + line->y_inv = 0; + + lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); + + LV_TRACE_OBJ_CREATE("finished"); +} + +static void lv_line_event(const lv_obj_class_t * class_p, lv_event_t * e) +{ + LV_UNUSED(class_p); + + lv_res_t res; + + /*Call the ancestor's event handler*/ + res = lv_obj_event_base(MY_CLASS, e); + if(res != LV_RES_OK) return; + + lv_event_code_t code = lv_event_get_code(e); + lv_obj_t * obj = lv_event_get_target(e); + + if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { + /*The corner of the skew lines is out of the intended area*/ + lv_coord_t line_width = lv_obj_get_style_line_width(obj, LV_PART_MAIN); + lv_coord_t * s = lv_event_get_param(e); + if(*s < line_width) *s = line_width; + } + else if(code == LV_EVENT_GET_SELF_SIZE) { + lv_line_t * line = (lv_line_t *)obj; + + if(line->point_num == 0 || line->point_array == NULL) return; + + lv_point_t * p = lv_event_get_param(e); + lv_coord_t w = 0; + lv_coord_t h = 0; + + uint16_t i; + for(i = 0; i < line->point_num; i++) { + w = LV_MAX(line->point_array[i].x, w); + h = LV_MAX(line->point_array[i].y, h); + } + + lv_coord_t line_width = lv_obj_get_style_line_width(obj, LV_PART_MAIN); + w += line_width; + h += line_width; + p->x = w; + p->y = h; + } + else if(code == LV_EVENT_DRAW_MAIN) { + lv_line_t * line = (lv_line_t *)obj; + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); + + if(line->point_num == 0 || line->point_array == NULL) return; + + lv_area_t area; + lv_obj_get_coords(obj, &area); + lv_coord_t x_ofs = area.x1 - lv_obj_get_scroll_x(obj); + lv_coord_t y_ofs = area.y1 - lv_obj_get_scroll_y(obj); + lv_coord_t h = lv_obj_get_height(obj); + + lv_draw_line_dsc_t line_dsc; + lv_draw_line_dsc_init(&line_dsc); + lv_obj_init_draw_line_dsc(obj, LV_PART_MAIN, &line_dsc); + + /*Read all points and draw the lines*/ + uint16_t i; + for(i = 0; i < line->point_num - 1; i++) { + lv_point_t p1; + lv_point_t p2; + p1.x = line->point_array[i].x + x_ofs; + p2.x = line->point_array[i + 1].x + x_ofs; + + if(line->y_inv == 0) { + p1.y = line->point_array[i].y + y_ofs; + p2.y = line->point_array[i + 1].y + y_ofs; + } + else { + p1.y = h - line->point_array[i].y + y_ofs; + p2.y = h - line->point_array[i + 1].y + y_ofs; + } + lv_draw_line(draw_ctx, &line_dsc, &p1, &p2); + line_dsc.round_start = 0; /*Draw the rounding only on the end points after the first line*/ + } + } +} +#endif diff --git a/L3_Middlewares/LVGL/src/widgets/line/lv_line.h b/L3_Middlewares/LVGL/src/widgets/lv_line.h similarity index 51% rename from L3_Middlewares/LVGL/src/widgets/line/lv_line.h rename to L3_Middlewares/LVGL/src/widgets/lv_line.h index d6a1d60..54fa248 100644 --- a/L3_Middlewares/LVGL/src/widgets/line/lv_line.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_line.h @@ -13,9 +13,12 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../core/lv_obj.h" +#include "../lv_conf_internal.h" + #if LV_USE_LINE != 0 +#include "../core/lv_obj.h" + /********************* * DEFINES *********************/ @@ -24,7 +27,15 @@ extern "C" { * TYPEDEFS **********************/ -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_line_class; +/*Data of line*/ +typedef struct { + lv_obj_t obj; + const lv_point_t * point_array; /**< Pointer to an array with the points of the line*/ + uint16_t point_num; /**< Number of points in 'point_array'*/ + uint8_t y_inv : 1; /**< 1: y == 0 will be on the bottom*/ +} lv_line_t; + +extern const lv_obj_class_t lv_line_class; /********************** * GLOBAL PROTOTYPES @@ -47,15 +58,7 @@ lv_obj_t * lv_line_create(lv_obj_t * parent); * @param points an array of points. Only the address is saved, so the array needs to be alive while the line exists * @param point_num number of points in 'point_a' */ -void lv_line_set_points(lv_obj_t * obj, const lv_point_precise_t points[], uint32_t point_num); - -/** - * Set a non-const array of points. Identical to `lv_line_set_points` except the array may be retrieved by `lv_line_get_points_mutable`. - * @param obj pointer to a line object - * @param points a non-const array of points. Only the address is saved, so the array needs to be alive while the line exists. - * @param point_num number of points in 'point_a' - */ -void lv_line_set_points_mutable(lv_obj_t * obj, lv_point_precise_t points[], uint32_t point_num); +void lv_line_set_points(lv_obj_t * obj, const lv_point_t points[], uint16_t point_num); /** * Enable (or disable) the y coordinate inversion. @@ -70,34 +73,6 @@ void lv_line_set_y_invert(lv_obj_t * obj, bool en); * Getter functions *====================*/ -/** - * Get the pointer to the array of points. - * @param obj pointer to a line object - * @return const pointer to the array of points - */ -const lv_point_precise_t * lv_line_get_points(lv_obj_t * obj); - -/** - * Get the number of points in the array of points. - * @param obj pointer to a line object - * @return number of points in array of points - */ -uint32_t lv_line_get_point_count(lv_obj_t * obj); - -/** - * Check the mutability of the stored point array pointer. - * @param obj pointer to a line object - * @return true: the point array pointer is mutable, false: constant - */ -bool lv_line_is_point_array_mutable(lv_obj_t * obj); - -/** - * Get a pointer to the mutable array of points or NULL if it is not mutable - * @param obj pointer to a line object - * @return pointer to the array of points. NULL if not mutable. - */ -lv_point_precise_t * lv_line_get_points_mutable(lv_obj_t * obj); - /** * Get the y inversion attribute * @param obj pointer to a line object diff --git a/L3_Middlewares/LVGL/src/widgets/objx_templ/lv_objx_templ.c b/L3_Middlewares/LVGL/src/widgets/lv_objx_templ.c similarity index 94% rename from L3_Middlewares/LVGL/src/widgets/objx_templ/lv_objx_templ.c rename to L3_Middlewares/LVGL/src/widgets/lv_objx_templ.c index eaf5c12..9156546 100644 --- a/L3_Middlewares/LVGL/src/widgets/objx_templ/lv_objx_templ.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_objx_templ.c @@ -22,7 +22,7 @@ /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_templ_class) +#define MY_CLASS &lv_templ_class /********************** * TYPEDEFS @@ -47,8 +47,7 @@ const lv_obj_class_t lv_templ_class = { .instance_size = sizeof(lv_templ_t), .group_def = LV_OBJ_CLASS_GROUP_DEF_INHERIT, .editable = LV_OBJ_CLASS_EDITABLE_INHERIT, - .base_class = &lv_templ_class, - .name = "templ", + .base_class = &lv_templ_class }; /********************** @@ -125,11 +124,11 @@ static void lv_templ_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /*Call the ancestor's event handler*/ - res = LV_EVENT_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + res = lv_obj_event_base(MY_CLASS, e); + if(res != LV_RES_OK) return; /*Add the widget specific event handling here*/ } diff --git a/L3_Middlewares/LVGL/src/widgets/objx_templ/lv_objx_templ.h b/L3_Middlewares/LVGL/src/widgets/lv_objx_templ.h similarity index 95% rename from L3_Middlewares/LVGL/src/widgets/objx_templ/lv_objx_templ.h rename to L3_Middlewares/LVGL/src/widgets/lv_objx_templ.h index ccf1e1c..9de5285 100644 --- a/L3_Middlewares/LVGL/src/widgets/objx_templ/lv_objx_templ.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_objx_templ.h @@ -39,7 +39,7 @@ typedef struct { /*New data for this type*/ } lv_templ_t; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_templ_class; +extern const lv_obj_class_t lv_templ_class; /********************** * GLOBAL PROTOTYPES diff --git a/L3_Middlewares/LVGL/src/widgets/roller/lv_roller.c b/L3_Middlewares/LVGL/src/widgets/lv_roller.c similarity index 57% rename from L3_Middlewares/LVGL/src/widgets/roller/lv_roller.c rename to L3_Middlewares/LVGL/src/widgets/lv_roller.c index b762a1e..f79e882 100644 --- a/L3_Middlewares/LVGL/src/widgets/roller/lv_roller.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_roller.c @@ -6,29 +6,20 @@ /********************* * INCLUDES *********************/ -#include "lv_roller_private.h" -#include "../label/lv_label_private.h" -#include "../../misc/lv_area_private.h" -#include "../../misc/lv_anim_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_roller.h" #if LV_USE_ROLLER != 0 -#include "../../misc/lv_assert.h" -#include "../../misc/lv_text_private.h" -#include "../../draw/lv_draw_private.h" -#include "../../core/lv_group.h" -#include "../../indev/lv_indev.h" -#include "../../indev/lv_indev_scroll.h" -#include "../../indev/lv_indev_private.h" -#include "../../stdlib/lv_string.h" +#include "../misc/lv_assert.h" +#include "../draw/lv_draw.h" +#include "../core/lv_group.h" +#include "../core/lv_indev.h" +#include "../core/lv_indev_scroll.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_roller_class) +#define MY_CLASS &lv_roller_class #define MY_CLASS_LABEL &lv_roller_label_class -#define EXTRA_INF_SIZE 1000 /*[px]: add the options multiple times until getting this height*/ /********************** * TYPEDEFS @@ -44,37 +35,16 @@ static void draw_main(lv_event_t * e); static void draw_label(lv_event_t * e); static void get_sel_area(lv_obj_t * obj, lv_area_t * sel_area); static void refr_position(lv_obj_t * obj, lv_anim_enable_t animen); -static lv_result_t release_handler(lv_obj_t * obj); +static lv_res_t release_handler(lv_obj_t * obj); static void inf_normalize(lv_obj_t * obj_scrl); static lv_obj_t * get_label(const lv_obj_t * obj); -static int32_t get_selected_label_width(const lv_obj_t * obj); -static void scroll_anim_completed_cb(lv_anim_t * a); +static lv_coord_t get_selected_label_width(const lv_obj_t * obj); +static void scroll_anim_ready_cb(lv_anim_t * a); static void set_y_anim(void * obj, int32_t v); -static void transform_vect_recursive(lv_obj_t * roller, lv_point_t * vect); /********************** * STATIC VARIABLES **********************/ -#if LV_USE_OBJ_PROPERTY -static const lv_property_ops_t properties[] = { - { - .id = LV_PROPERTY_ROLLER_OPTIONS, - .setter = NULL, - .getter = lv_roller_get_options, - }, - { - .id = LV_PROPERTY_ROLLER_SELECTED, - .setter = NULL, - .getter = lv_roller_get_selected, - }, - { - .id = LV_PROPERTY_ROLLER_VISIBLE_ROW_COUNT, - .setter = lv_roller_set_visible_row_count, - .getter = NULL, - }, -}; -#endif - const lv_obj_class_t lv_roller_class = { .constructor_cb = lv_roller_constructor, .event_cb = lv_roller_event, @@ -83,26 +53,13 @@ const lv_obj_class_t lv_roller_class = { .instance_size = sizeof(lv_roller_t), .editable = LV_OBJ_CLASS_EDITABLE_TRUE, .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, - .base_class = &lv_obj_class, - .name = "roller", -#if LV_USE_OBJ_PROPERTY - .prop_index_start = LV_PROPERTY_ROLLER_START, - .prop_index_end = LV_PROPERTY_ROLLER_END, - .properties = properties, - .properties_count = sizeof(properties) / sizeof(properties[0]), - -#if LV_USE_OBJ_PROPERTY_NAME - .property_names = lv_roller_property_names, - .names_count = sizeof(lv_roller_property_names) / sizeof(lv_property_name_t), -#endif -#endif + .base_class = &lv_obj_class }; const lv_obj_class_t lv_roller_label_class = { .event_cb = lv_roller_label_event, .instance_size = sizeof(lv_label_t), - .base_class = &lv_label_class, - .name = "roller-label", + .base_class = &lv_label_class }; /********************** @@ -113,6 +70,11 @@ const lv_obj_class_t lv_roller_label_class = { * GLOBAL FUNCTIONS **********************/ +/** + * Create a roller object + * @param parent pointer to an object, it will be the parent of the new roller + * @return pointer to the created roller + */ lv_obj_t * lv_roller_create(lv_obj_t * parent) { LV_LOG_INFO("begin"); @@ -125,6 +87,12 @@ lv_obj_t * lv_roller_create(lv_obj_t * parent) * Setter functions *====================*/ +/** + * Set the options on a roller + * @param roller pointer to roller object + * @param options a string with '\n' separated options. E.g. "One\nTwo\nThree" + * @param mode `LV_ROLLER_MODE_NORMAL` or `LV_ROLLER_MODE_INFINITE` + */ void lv_roller_set_options(lv_obj_t * obj, const char * options, lv_roller_mode_t mode) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -151,32 +119,20 @@ void lv_roller_set_options(lv_obj_t * obj, const char * options, lv_roller_mode_ else { roller->mode = LV_ROLLER_MODE_INFINITE; - const lv_font_t * font = lv_obj_get_style_text_font(obj, 0); - int32_t normal_h = roller->option_cnt * (lv_font_get_line_height(font) + lv_obj_get_style_text_letter_space(obj, 0)); - roller->inf_page_cnt = LV_CLAMP(3, EXTRA_INF_SIZE / normal_h, 15); - if(!(roller->inf_page_cnt & 1)) roller->inf_page_cnt++; /*Make it odd*/ - LV_LOG_INFO("Using %" LV_PRIu32 " pages to make the roller look infinite", roller->inf_page_cnt); - - size_t opt_len = lv_strlen(options) + 1; /*+1 to add '\n' after option lists*/ - size_t opt_extra_len = opt_len * roller->inf_page_cnt; - if(opt_extra_len == 0) { - /*Prevent write overflow*/ - opt_extra_len = 1; - } - - char * opt_extra = lv_malloc(opt_extra_len); - uint32_t i; - for(i = 0; i < roller->inf_page_cnt; i++) { - lv_strcpy(&opt_extra[opt_len * i], options); + size_t opt_len = strlen(options) + 1; /*+1 to add '\n' after option lists*/ + char * opt_extra = lv_mem_buf_get(opt_len * LV_ROLLER_INF_PAGES); + uint8_t i; + for(i = 0; i < LV_ROLLER_INF_PAGES; i++) { + strcpy(&opt_extra[opt_len * i], options); opt_extra[opt_len * (i + 1) - 1] = '\n'; } - opt_extra[opt_extra_len - 1] = '\0'; + opt_extra[opt_len * LV_ROLLER_INF_PAGES - 1] = '\0'; lv_label_set_text(label, opt_extra); - lv_free(opt_extra); + lv_mem_buf_release(opt_extra); - roller->sel_opt_id = ((roller->inf_page_cnt / 2) + 0) * roller->option_cnt; + roller->sel_opt_id = ((LV_ROLLER_INF_PAGES / 2) + 0) * roller->option_cnt; - roller->option_cnt = roller->option_cnt * roller->inf_page_cnt; + roller->option_cnt = roller->option_cnt * LV_ROLLER_INF_PAGES; inf_normalize(obj); } @@ -184,9 +140,16 @@ void lv_roller_set_options(lv_obj_t * obj, const char * options, lv_roller_mode_ /*If the selected text has larger font the label needs some extra draw padding to draw it.*/ lv_obj_refresh_ext_draw_size(label); + } -void lv_roller_set_selected(lv_obj_t * obj, uint32_t sel_opt, lv_anim_enable_t anim) +/** + * Set the selected option + * @param roller pointer to a roller object + * @param sel_opt id of the selected option (0 ... number of option - 1); + * @param anim_en LV_ANIM_ON: set with animation; LV_ANOM_OFF set immediately + */ +void lv_roller_set_selected(lv_obj_t * obj, uint16_t sel_opt, lv_anim_enable_t anim) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -198,15 +161,15 @@ void lv_roller_set_selected(lv_obj_t * obj, uint32_t sel_opt, lv_anim_enable_t a /*In infinite mode interpret the new ID relative to the currently visible "page"*/ if(roller->mode == LV_ROLLER_MODE_INFINITE) { - uint32_t real_option_cnt = roller->option_cnt / roller->inf_page_cnt; - uint32_t current_page = roller->sel_opt_id / real_option_cnt; + uint32_t real_option_cnt = roller->option_cnt / LV_ROLLER_INF_PAGES; + uint16_t current_page = roller->sel_opt_id / real_option_cnt; /*Set by the user to e.g. 0, 1, 2, 3... *Upscale the value to the current page*/ if(sel_opt < real_option_cnt) { - uint32_t act_opt = roller->sel_opt_id - current_page * real_option_cnt; + uint16_t act_opt = roller->sel_opt_id - current_page * real_option_cnt; int32_t sel_opt_signed = sel_opt; /*Huge jump? Probably from last to first or first to last option.*/ - if((uint32_t)LV_ABS((int16_t)(act_opt - sel_opt)) > real_option_cnt / 2) { + if(LV_ABS((int16_t)act_opt - sel_opt) > real_option_cnt / 2) { if(act_opt > sel_opt) sel_opt_signed += real_option_cnt; else sel_opt_signed -= real_option_cnt; } @@ -220,13 +183,18 @@ void lv_roller_set_selected(lv_obj_t * obj, uint32_t sel_opt, lv_anim_enable_t a refr_position(obj, anim); } -void lv_roller_set_visible_row_count(lv_obj_t * obj, uint32_t row_cnt) +/** + * Set the height to show the given number of rows (options) + * @param roller pointer to a roller object + * @param row_cnt number of desired visible rows + */ +void lv_roller_set_visible_row_count(lv_obj_t * obj, uint8_t row_cnt) { LV_ASSERT_OBJ(obj, MY_CLASS); const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); lv_obj_set_height(obj, (lv_font_get_line_height(font) + line_space) * row_cnt + 2 * border_width); } @@ -234,13 +202,18 @@ void lv_roller_set_visible_row_count(lv_obj_t * obj, uint32_t row_cnt) * Getter functions *====================*/ -uint32_t lv_roller_get_selected(const lv_obj_t * obj) +/** + * Get the id of the selected option + * @param roller pointer to a roller object + * @return id of the selected option (0 ... number of option - 1); + */ +uint16_t lv_roller_get_selected(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_roller_t * roller = (lv_roller_t *)obj; if(roller->mode == LV_ROLLER_MODE_INFINITE) { - uint32_t real_id_cnt = roller->option_cnt / roller->inf_page_cnt; + uint16_t real_id_cnt = roller->option_cnt / LV_ROLLER_INF_PAGES; return roller->sel_opt_id % real_id_cnt; } else { @@ -248,6 +221,12 @@ uint32_t lv_roller_get_selected(const lv_obj_t * obj) } } +/** + * Get the current selected option as a string + * @param ddlist pointer to ddlist object + * @param buf pointer to an array to store the string + * @param buf_size size of `buf` in bytes. 0: to ignore it. + */ void lv_roller_get_selected_str(const lv_obj_t * obj, char * buf, uint32_t buf_size) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -255,9 +234,9 @@ void lv_roller_get_selected_str(const lv_obj_t * obj, char * buf, uint32_t buf_s lv_roller_t * roller = (lv_roller_t *)obj; lv_obj_t * label = get_label(obj); uint32_t i; - uint32_t line = 0; + uint16_t line = 0; const char * opt_txt = lv_label_get_text(label); - size_t txt_len = lv_strlen(opt_txt); + size_t txt_len = strlen(opt_txt); for(i = 0; i < txt_len && line != roller->sel_opt_id; i++) { if(opt_txt[i] == '\n') line++; @@ -266,7 +245,7 @@ void lv_roller_get_selected_str(const lv_obj_t * obj, char * buf, uint32_t buf_s uint32_t c; for(c = 0; i < txt_len && opt_txt[i] != '\n'; c++, i++) { if(buf_size && c >= buf_size - 1) { - LV_LOG_WARN("the buffer was too small"); + LV_LOG_WARN("lv_dropdown_get_selected_str: the buffer was too small"); break; } buf[c] = opt_txt[i]; @@ -275,6 +254,7 @@ void lv_roller_get_selected_str(const lv_obj_t * obj, char * buf, uint32_t buf_s buf[c] = '\0'; } + /** * Get the options of a roller * @param roller pointer to roller object @@ -287,13 +267,19 @@ const char * lv_roller_get_options(const lv_obj_t * obj) return lv_label_get_text(get_label(obj)); } -uint32_t lv_roller_get_option_count(const lv_obj_t * obj) + +/** + * Get the total number of options + * @param roller pointer to a roller object + * @return the total number of options + */ +uint16_t lv_roller_get_option_cnt(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_roller_t * roller = (lv_roller_t *)obj; if(roller->mode == LV_ROLLER_MODE_INFINITE) { - return roller->option_cnt / roller->inf_page_cnt; + return roller->option_cnt / LV_ROLLER_INF_PAGES; } else { return roller->option_cnt; @@ -304,6 +290,7 @@ uint32_t lv_roller_get_option_count(const lv_obj_t * obj) * STATIC FUNCTIONS **********************/ + static void lv_roller_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) { LV_UNUSED(class_p); @@ -314,30 +301,29 @@ static void lv_roller_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj roller->sel_opt_id = 0; roller->sel_opt_id_ori = 0; - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); LV_LOG_INFO("begin"); lv_obj_t * label = lv_obj_class_create_obj(&lv_roller_label_class, obj); lv_obj_class_init_obj(label); -#if LV_WIDGETS_HAS_DEFAULT_VALUE lv_roller_set_options(obj, "Option 1\nOption 2\nOption 3\nOption 4\nOption 5", LV_ROLLER_MODE_NORMAL); -#endif - LV_LOG_TRACE("finished"); + + LV_LOG_TRACE("finshed"); } static void lv_roller_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /*Call the ancestor's event handler*/ res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; - const lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_event_code_t code = lv_event_get_code(e); + lv_obj_t * obj = lv_event_get_target(e); lv_roller_t * roller = (lv_roller_t *)obj; if(code == LV_EVENT_GET_SELF_SIZE) { @@ -347,7 +333,7 @@ static void lv_roller_event(const lv_obj_class_t * class_p, lv_event_t * e) else if(code == LV_EVENT_STYLE_CHANGED) { lv_obj_t * label = get_label(obj); /*Be sure the label's style is updated before processing the roller*/ - if(label) lv_obj_send_event(label, LV_EVENT_STYLE_CHANGED, NULL); + if(label) lv_event_send(label, LV_EVENT_STYLE_CHANGED, NULL); lv_obj_refresh_self_size(obj); refr_position(obj, LV_ANIM_OFF); } @@ -355,52 +341,44 @@ static void lv_roller_event(const lv_obj_class_t * class_p, lv_event_t * e) refr_position(obj, LV_ANIM_OFF); } else if(code == LV_EVENT_PRESSED) { - if(roller->option_cnt <= 1) return; - roller->moved = 0; - lv_anim_delete(get_label(obj), set_y_anim); + lv_anim_del(get_label(obj), set_y_anim); } else if(code == LV_EVENT_PRESSING) { - if(roller->option_cnt <= 1) return; - - lv_indev_t * indev = lv_indev_active(); + lv_indev_t * indev = lv_indev_get_act(); lv_point_t p; lv_indev_get_vect(indev, &p); - transform_vect_recursive(obj, &p); if(p.y) { lv_obj_t * label = get_label(obj); - lv_obj_set_y(label, lv_obj_get_y_aligned(label) + p.y); + lv_obj_set_y(label, lv_obj_get_y(label) + p.y); roller->moved = 1; } } else if(code == LV_EVENT_RELEASED || code == LV_EVENT_PRESS_LOST) { - if(roller->option_cnt <= 1) return; - release_handler(obj); } else if(code == LV_EVENT_FOCUSED) { lv_group_t * g = lv_obj_get_group(obj); - lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_active()); + bool editing = lv_group_get_editing(g); + lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); /*Encoders need special handling*/ if(indev_type == LV_INDEV_TYPE_ENCODER) { - const bool editing = lv_group_get_editing(g); - - /*Save the current state when entered to edit mode*/ - if(editing) { - roller->sel_opt_id_ori = roller->sel_opt_id; - } - else { /*In navigate mode revert the original value*/ + /*In navigate mode revert the original value*/ + if(!editing) { if(roller->sel_opt_id != roller->sel_opt_id_ori) { roller->sel_opt_id = roller->sel_opt_id_ori; refr_position(obj, LV_ANIM_ON); } } + /*Save the current state when entered to edit mode*/ + else { + roller->sel_opt_id_ori = roller->sel_opt_id; + } } else { - /*Save the current value. Used to revert this - *state if ENTER won't be pressed*/ - roller->sel_opt_id_ori = roller->sel_opt_id; + roller->sel_opt_id_ori = roller->sel_opt_id; /*Save the current value. Used to revert this state if + ENTER won't be pressed*/ } } else if(code == LV_EVENT_DEFOCUSED) { @@ -411,36 +389,23 @@ static void lv_roller_event(const lv_obj_class_t * class_p, lv_event_t * e) } } else if(code == LV_EVENT_KEY) { - if(roller->option_cnt <= 1) return; - - uint32_t c = lv_event_get_key(e); + char c = *((char *)lv_event_get_param(e)); if(c == LV_KEY_RIGHT || c == LV_KEY_DOWN) { if(roller->sel_opt_id + 1 < roller->option_cnt) { - uint32_t ori_id = roller->sel_opt_id_ori; /*lv_roller_set_selected will overwrite this*/ + uint16_t ori_id = roller->sel_opt_id_ori; /*lv_roller_set_selected will overwrite this*/ lv_roller_set_selected(obj, roller->sel_opt_id + 1, LV_ANIM_ON); roller->sel_opt_id_ori = ori_id; } } else if(c == LV_KEY_LEFT || c == LV_KEY_UP) { if(roller->sel_opt_id > 0) { - uint32_t ori_id = roller->sel_opt_id_ori; /*lv_roller_set_selected will overwrite this*/ + uint16_t ori_id = roller->sel_opt_id_ori; /*lv_roller_set_selected will overwrite this*/ + lv_roller_set_selected(obj, roller->sel_opt_id - 1, LV_ANIM_ON); roller->sel_opt_id_ori = ori_id; } } } - else if(code == LV_EVENT_ROTARY) { - if(roller->option_cnt <= 1) return; - - int32_t r = lv_event_get_rotary_diff(e); - int32_t new_id = roller->sel_opt_id + r; - new_id = LV_CLAMP(0, new_id, (int32_t)roller->option_cnt - 1); - if((int32_t)roller->sel_opt_id != new_id) { - uint32_t ori_id = roller->sel_opt_id_ori; /*lv_roller_set_selected will overwrite this*/ - lv_roller_set_selected(obj, new_id, LV_ANIM_ON); - roller->sel_opt_id_ori = ori_id; - } - } else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { lv_obj_t * label = get_label(obj); lv_obj_refresh_ext_draw_size(label); @@ -454,23 +419,23 @@ static void lv_roller_label_event(const lv_obj_class_t * class_p, lv_event_t * e { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; lv_event_code_t code = lv_event_get_code(e); /*LV_EVENT_DRAW_MAIN will be called in the draw function*/ if(code != LV_EVENT_DRAW_MAIN) { /* Call the ancestor's event handler */ res = lv_obj_event_base(MY_CLASS_LABEL, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; } - lv_obj_t * label = lv_event_get_current_target(e); + lv_obj_t * label = lv_event_get_target(e); if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { /*If the selected text has a larger font it needs some extra space to draw it*/ - int32_t * s = lv_event_get_param(e); + lv_coord_t * s = lv_event_get_param(e); lv_obj_t * obj = lv_obj_get_parent(label); - int32_t sel_w = get_selected_label_width(obj); - int32_t label_w = lv_obj_get_width(label); + lv_coord_t sel_w = get_selected_label_width(obj); + lv_coord_t label_w = lv_obj_get_width(label); *s = LV_MAX(*s, sel_w - label_w); } else if(code == LV_EVENT_SIZE_CHANGED) { @@ -481,23 +446,24 @@ static void lv_roller_label_event(const lv_obj_class_t * class_p, lv_event_t * e } } + static void draw_main(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); if(code == LV_EVENT_DRAW_MAIN) { /*Draw the selected rectangle*/ - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); lv_area_t sel_area; get_sel_area(obj, &sel_area); lv_draw_rect_dsc_t sel_dsc; lv_draw_rect_dsc_init(&sel_dsc); lv_obj_init_draw_rect_dsc(obj, LV_PART_SELECTED, &sel_dsc); - lv_draw_rect(layer, &sel_dsc, &sel_area); + lv_draw_rect(draw_ctx, &sel_dsc, &sel_area); } /*Post draw when the children are drawn*/ else if(code == LV_EVENT_DRAW_POST) { - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); lv_draw_label_dsc_t label_dsc; lv_draw_label_dsc_init(&label_dsc); @@ -508,54 +474,49 @@ static void draw_main(lv_event_t * e) get_sel_area(obj, &sel_area); lv_area_t mask_sel; bool area_ok; - area_ok = lv_area_intersect(&mask_sel, &layer->_clip_area, &sel_area); + area_ok = _lv_area_intersect(&mask_sel, draw_ctx->clip_area, &sel_area); if(area_ok) { lv_obj_t * label = get_label(obj); + if(lv_label_get_recolor(label)) label_dsc.flag |= LV_TEXT_FLAG_RECOLOR; /*Get the size of the "selected text"*/ - lv_point_t label_sel_size; - lv_text_get_size(&label_sel_size, lv_label_get_text(label), label_dsc.font, label_dsc.letter_space, - label_dsc.line_space, lv_obj_get_width(obj), LV_TEXT_FLAG_EXPAND); + lv_point_t res_p; + lv_txt_get_size(&res_p, lv_label_get_text(label), label_dsc.font, label_dsc.letter_space, label_dsc.line_space, + lv_obj_get_width(obj), LV_TEXT_FLAG_EXPAND); /*Move the selected label proportionally with the background label*/ - int32_t roller_h = lv_obj_get_height(obj); - const lv_font_t * normal_label_font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - /*label offset from the middle line of the roller*/ - int32_t label_y_prop = (label->coords.y1 + normal_label_font->line_height / 2) - (roller_h / 2 + obj->coords.y1); - - /*Proportional position from the middle line. - *Will be 0 for the first option, and 1 for the last option (upscaled by << 14)*/ - int32_t remain_h = lv_obj_get_height(label) - normal_label_font->line_height; - if(remain_h > 0) { - label_y_prop = (label_y_prop << 14) / remain_h; - } + lv_coord_t roller_h = lv_obj_get_height(obj); + int32_t label_y_prop = label->coords.y1 - (roller_h / 2 + + obj->coords.y1); /*label offset from the middle line of the roller*/ + label_y_prop = (label_y_prop * 16384) / lv_obj_get_height( + label); /*Proportional position from the middle line (upscaled by << 14)*/ - /*We don't want the selected label start and end exactly where the normal label is as - *a larger font won't centered on selected area.*/ - int32_t corr = label_dsc.font->line_height; + /*Apply a correction with different line heights*/ + const lv_font_t * normal_label_font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); + lv_coord_t corr = (label_dsc.font->line_height - normal_label_font->line_height) / 2; /*Apply the proportional position to the selected text*/ + res_p.y -= corr; int32_t label_sel_y = roller_h / 2 + obj->coords.y1; - label_sel_y += ((label_sel_size.y - corr) * label_y_prop) >> 14; - label_sel_y -= corr / 2; + label_sel_y += (label_y_prop * res_p.y) >> 14; + label_sel_y -= corr; - int32_t bwidth = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - int32_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t pright = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t bwidth = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t pleft = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t pright = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); /*Draw the selected text*/ lv_area_t label_sel_area; label_sel_area.x1 = obj->coords.x1 + pleft + bwidth; label_sel_area.y1 = label_sel_y; label_sel_area.x2 = obj->coords.x2 - pright - bwidth; - label_sel_area.y2 = label_sel_area.y1 + label_sel_size.y; + label_sel_area.y2 = label_sel_area.y1 + res_p.y; label_dsc.flag |= LV_TEXT_FLAG_EXPAND; - const lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = mask_sel; - label_dsc.text = lv_label_get_text(label); - lv_draw_label(layer, &label_dsc, &label_sel_area); - layer->_clip_area = clip_area_ori; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &mask_sel; + lv_draw_label(draw_ctx, &label_dsc, &label_sel_area, lv_label_get_text(label), NULL); + draw_ctx->clip_area = clip_area_ori; } } } @@ -564,20 +525,22 @@ static void draw_label(lv_event_t * e) { /* Split the drawing of the label into an upper (above the selected area) * and a lower (below the selected area)*/ - lv_obj_t * label_obj = lv_event_get_current_target(e); + lv_obj_t * label_obj = lv_event_get_target(e); lv_obj_t * roller = lv_obj_get_parent(label_obj); lv_draw_label_dsc_t label_draw_dsc; lv_draw_label_dsc_init(&label_draw_dsc); lv_obj_init_draw_label_dsc(roller, LV_PART_MAIN, &label_draw_dsc); - lv_layer_t * layer = lv_event_get_layer(e); + if(lv_label_get_recolor(label_obj)) label_draw_dsc.flag |= LV_TEXT_FLAG_RECOLOR; + + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); /*If the roller has shadow or outline it has some ext. draw size *therefore the label can overflow the roller's boundaries. *To solve this limit the clip area to the "plain" roller.*/ - const lv_area_t clip_area_ori = layer->_clip_area; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; lv_area_t roller_clip_area; - if(!lv_area_intersect(&roller_clip_area, &layer->_clip_area, &roller->coords)) return; - layer->_clip_area = roller_clip_area; + if(!_lv_area_intersect(&roller_clip_area, draw_ctx->clip_area, &roller->coords)) return; + draw_ctx->clip_area = &roller_clip_area; lv_area_t sel_area; get_sel_area(roller, &sel_area); @@ -587,27 +550,25 @@ static void draw_label(lv_event_t * e) clip2.y1 = label_obj->coords.y1; clip2.x2 = label_obj->coords.x2; clip2.y2 = sel_area.y1; - if(lv_area_intersect(&clip2, &layer->_clip_area, &clip2)) { - const lv_area_t clip_area_ori2 = layer->_clip_area; - layer->_clip_area = clip2; - label_draw_dsc.text = lv_label_get_text(label_obj); - lv_draw_label(layer, &label_draw_dsc, &label_obj->coords); - layer->_clip_area = clip_area_ori2; + if(_lv_area_intersect(&clip2, draw_ctx->clip_area, &clip2)) { + const lv_area_t * clip_area_ori2 = draw_ctx->clip_area; + draw_ctx->clip_area = &clip2; + lv_draw_label(draw_ctx, &label_draw_dsc, &label_obj->coords, lv_label_get_text(label_obj), NULL); + draw_ctx->clip_area = clip_area_ori2; } clip2.x1 = label_obj->coords.x1; clip2.y1 = sel_area.y2; clip2.x2 = label_obj->coords.x2; clip2.y2 = label_obj->coords.y2; - if(lv_area_intersect(&clip2, &layer->_clip_area, &clip2)) { - const lv_area_t clip_area_ori2 = layer->_clip_area; - layer->_clip_area = clip2; - label_draw_dsc.text = lv_label_get_text(label_obj); - lv_draw_label(layer, &label_draw_dsc, &label_obj->coords); - layer->_clip_area = clip_area_ori2; + if(_lv_area_intersect(&clip2, draw_ctx->clip_area, &clip2)) { + const lv_area_t * clip_area_ori2 = draw_ctx->clip_area; + draw_ctx->clip_area = &clip2; + lv_draw_label(draw_ctx, &label_draw_dsc, &label_obj->coords, lv_label_get_text(label_obj), NULL); + draw_ctx->clip_area = clip_area_ori2; } - layer->_clip_area = clip_area_ori; + draw_ctx->clip_area = clip_area_ori; } static void get_sel_area(lv_obj_t * obj, lv_area_t * sel_area) @@ -615,10 +576,10 @@ static void get_sel_area(lv_obj_t * obj, lv_area_t * sel_area) const lv_font_t * font_main = lv_obj_get_style_text_font(obj, LV_PART_MAIN); const lv_font_t * font_sel = lv_obj_get_style_text_font(obj, LV_PART_SELECTED); - int32_t font_main_h = lv_font_get_line_height(font_main); - int32_t font_sel_h = lv_font_get_line_height(font_sel); - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - int32_t d = (font_sel_h + font_main_h) / 2 + line_space; + lv_coord_t font_main_h = lv_font_get_line_height(font_main); + lv_coord_t font_sel_h = lv_font_get_line_height(font_sel); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t d = (font_sel_h + font_main_h) / 2 + line_space; sel_area->y1 = obj->coords.y1 + lv_obj_get_height(obj) / 2 - d / 2; sel_area->y2 = sel_area->y1 + d; lv_area_t roller_coords; @@ -632,53 +593,48 @@ static void get_sel_area(lv_obj_t * obj, lv_area_t * sel_area) /** * Refresh the position of the roller. It uses the id stored in: roller->ddlist.selected_option_id * @param roller pointer to a roller object - * @param anim_en LV_ANIM_ON: refresh with animation; LV_ANIM_OFF: without animation + * @param anim_en LV_ANIM_ON: refresh with animation; LV_ANOM_OFF: without animation */ static void refr_position(lv_obj_t * obj, lv_anim_enable_t anim_en) { lv_obj_t * label = get_label(obj); if(label == NULL) return; - const lv_text_align_t align = lv_obj_calculate_style_text_align(label, LV_PART_MAIN, lv_label_get_text(label)); + lv_text_align_t align = lv_obj_calculate_style_text_align(label, LV_PART_MAIN, lv_label_get_text(label)); - int32_t x = 0; switch(align) { case LV_TEXT_ALIGN_CENTER: - x = (lv_obj_get_content_width(obj) - lv_obj_get_width(label)) / 2; + lv_obj_set_x(label, (lv_obj_get_content_width(obj) - lv_obj_get_width(label)) / 2); break; case LV_TEXT_ALIGN_RIGHT: - x = lv_obj_get_content_width(obj) - lv_obj_get_width(label); + lv_obj_set_x(label, lv_obj_get_content_width(obj) - lv_obj_get_width(label)); break; case LV_TEXT_ALIGN_LEFT: - x = 0; - break; - default: - /* Invalid alignment */ + lv_obj_set_x(label, 0); break; } - lv_obj_set_x(label, x); + lv_roller_t * roller = (lv_roller_t *)obj; const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - const int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - const int32_t font_h = lv_font_get_line_height(font); - const int32_t h = lv_obj_get_content_height(obj); - uint32_t anim_time = lv_obj_get_style_anim_duration(obj, LV_PART_MAIN); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t font_h = lv_font_get_line_height(font); + lv_coord_t h = lv_obj_get_content_height(obj); + uint16_t anim_time = lv_obj_get_style_anim_time(obj, LV_PART_MAIN); /*Normally the animation's `end_cb` sets correct position of the roller if infinite. - *But without animations we have to do it manually*/ + *But without animations do it manually*/ if(anim_en == LV_ANIM_OFF || anim_time == 0) { inf_normalize(obj); } - /* Calculate animation configuration */ - lv_roller_t * roller = (lv_roller_t *)obj; int32_t id = roller->sel_opt_id; - const int32_t sel_y1 = id * (font_h + line_space); - const int32_t mid_y1 = h / 2 - font_h / 2; - const int32_t new_y = mid_y1 - sel_y1; + lv_coord_t sel_y1 = id * (font_h + line_space); + lv_coord_t mid_y1 = h / 2 - font_h / 2; + + lv_coord_t new_y = mid_y1 - sel_y1; if(anim_en == LV_ANIM_OFF || anim_time == 0) { - lv_anim_delete(label, set_y_anim); + lv_anim_del(label, set_y_anim); lv_obj_set_y(label, new_y); } else { @@ -687,19 +643,19 @@ static void refr_position(lv_obj_t * obj, lv_anim_enable_t anim_en) lv_anim_set_var(&a, label); lv_anim_set_exec_cb(&a, set_y_anim); lv_anim_set_values(&a, lv_obj_get_y(label), new_y); - lv_anim_set_duration(&a, anim_time); - lv_anim_set_completed_cb(&a, scroll_anim_completed_cb); + lv_anim_set_time(&a, anim_time); + lv_anim_set_ready_cb(&a, scroll_anim_ready_cb); lv_anim_set_path_cb(&a, lv_anim_path_ease_out); lv_anim_start(&a); } } -static lv_result_t release_handler(lv_obj_t * obj) +static lv_res_t release_handler(lv_obj_t * obj) { lv_obj_t * label = get_label(obj); - if(label == NULL) return LV_RESULT_OK; + if(label == NULL) return LV_RES_OK; - lv_indev_t * indev = lv_indev_active(); + lv_indev_t * indev = lv_indev_get_act(); lv_roller_t * roller = (lv_roller_t *)obj; /*Leave edit mode once a new option is selected*/ @@ -725,7 +681,7 @@ static lv_result_t release_handler(lv_obj_t * obj) p.y -= label->coords.y1; p.x -= label->coords.x1; uint32_t letter_i; - letter_i = lv_label_get_letter_on(label, &p, true); + letter_i = lv_label_get_letter_on(label, &p); const char * txt = lv_label_get_text(label); uint32_t i = 0; @@ -733,7 +689,7 @@ static lv_result_t release_handler(lv_obj_t * obj) uint32_t letter_cnt = 0; for(letter_cnt = 0; letter_cnt < letter_i; letter_cnt++) { - uint32_t letter = lv_text_encoded_next(txt, &i); + uint32_t letter = _lv_txt_encoded_next(txt, &i); /*Count he lines to reach the clicked letter. But ignore the last '\n' because it * still belongs to the clicked line*/ if(letter == '\n' && i_prev != letter_i) new_opt++; @@ -743,28 +699,16 @@ static lv_result_t release_handler(lv_obj_t * obj) else { /*If dragged then align the list to have an element in the middle*/ const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - int32_t font_h = lv_font_get_line_height(font); - - int32_t label_unit = font_h + line_space; - int32_t mid = obj->coords.y1 + (obj->coords.y2 - obj->coords.y1) / 2; - - lv_point_t p = indev->pointer.scroll_throw_vect_ori; - transform_vect_recursive(obj, &p); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t font_h = lv_font_get_line_height(font); - int32_t scroll_throw = indev->scroll_throw; - int32_t sum = 0; - int32_t v = p.y; - while(v) { - sum += v; - v = v * (100 - scroll_throw) / 100; - } - - int32_t label_y1 = label->coords.y1 + sum; + lv_coord_t label_unit = font_h + line_space; + lv_coord_t mid = obj->coords.y1 + (obj->coords.y2 - obj->coords.y1) / 2; + lv_coord_t label_y1 = label->coords.y1 + lv_indev_scroll_throw_predict(indev, LV_DIR_VER); int32_t id = (mid - label_y1) / label_unit; if(id < 0) id = 0; - if(id >= (int32_t)roller->option_cnt) id = roller->option_cnt - 1; + if(id >= roller->option_cnt) id = roller->option_cnt - 1; new_opt = id; } @@ -775,7 +719,7 @@ static lv_result_t release_handler(lv_obj_t * obj) } uint32_t id = roller->sel_opt_id; /*Just to use uint32_t in event data*/ - lv_result_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, &id); + lv_res_t res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, &id); return res; } @@ -788,24 +732,25 @@ static void inf_normalize(lv_obj_t * obj) lv_roller_t * roller = (lv_roller_t *)obj; if(roller->mode == LV_ROLLER_MODE_INFINITE) { - uint32_t real_id_cnt = roller->option_cnt / roller->inf_page_cnt; + uint16_t real_id_cnt = roller->option_cnt / LV_ROLLER_INF_PAGES; roller->sel_opt_id = roller->sel_opt_id % real_id_cnt; - roller->sel_opt_id += (roller->inf_page_cnt / 2) * real_id_cnt; /*Select the middle page*/ + roller->sel_opt_id += (LV_ROLLER_INF_PAGES / 2) * real_id_cnt; /*Select the middle page*/ roller->sel_opt_id_ori = roller->sel_opt_id % real_id_cnt; - roller->sel_opt_id_ori += (roller->inf_page_cnt / 2) * real_id_cnt; /*Select the middle page*/ + roller->sel_opt_id_ori += (LV_ROLLER_INF_PAGES / 2) * real_id_cnt; /*Select the middle page*/ /*Move to the new id*/ const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); - int32_t font_h = lv_font_get_line_height(font); - int32_t h = lv_obj_get_content_height(obj); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t font_h = lv_font_get_line_height(font); + lv_coord_t h = lv_obj_get_content_height(obj); lv_obj_t * label = get_label(obj); - int32_t sel_y1 = roller->sel_opt_id * (font_h + line_space); - int32_t mid_y1 = h / 2 - font_h / 2; - int32_t new_y = mid_y1 - sel_y1; + + lv_coord_t sel_y1 = roller->sel_opt_id * (font_h + line_space); + lv_coord_t mid_y1 = h / 2 - font_h / 2; + lv_coord_t new_y = mid_y1 - sel_y1; lv_obj_set_y(label, new_y); } } @@ -815,49 +760,30 @@ static lv_obj_t * get_label(const lv_obj_t * obj) return lv_obj_get_child(obj, 0); } -static int32_t get_selected_label_width(const lv_obj_t * obj) + +static lv_coord_t get_selected_label_width(const lv_obj_t * obj) { lv_obj_t * label = get_label(obj); if(label == NULL) return 0; const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_SELECTED); - int32_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_SELECTED); + lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_SELECTED); const char * txt = lv_label_get_text(label); lv_point_t size; - lv_text_get_size(&size, txt, font, letter_space, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE); + lv_txt_get_size(&size, txt, font, letter_space, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE); return size.x; } -static void scroll_anim_completed_cb(lv_anim_t * a) +static void scroll_anim_ready_cb(lv_anim_t * a) { lv_obj_t * obj = lv_obj_get_parent(a->var); /*The label is animated*/ inf_normalize(obj); } + static void set_y_anim(void * obj, int32_t v) { lv_obj_set_y(obj, v); } -static void transform_vect_recursive(lv_obj_t * roller, lv_point_t * vect) -{ - int16_t angle = 0; - int32_t scale_x = 256; - int32_t scale_y = 256; - lv_obj_t * parent = roller; - while(parent) { - angle += lv_obj_get_style_transform_rotation(parent, 0); - int32_t zoom_act_x = lv_obj_get_style_transform_scale_x_safe(parent, 0); - int32_t zoom_act_y = lv_obj_get_style_transform_scale_y_safe(parent, 0); - scale_x = (scale_y * zoom_act_x) >> 8; - scale_y = (scale_y * zoom_act_y) >> 8; - parent = lv_obj_get_parent(parent); - } - lv_point_t pivot = { 0, 0 }; - - scale_x = 256 * 256 / scale_x; - scale_y = 256 * 256 / scale_y; - lv_point_transform(vect, -angle, scale_x, scale_y, &pivot, false); -} - #endif diff --git a/L3_Middlewares/LVGL/src/widgets/roller/lv_roller.h b/L3_Middlewares/LVGL/src/widgets/lv_roller.h similarity index 72% rename from L3_Middlewares/LVGL/src/widgets/roller/lv_roller.h rename to L3_Middlewares/LVGL/src/widgets/lv_roller.h index e6a94b2..14411de 100644 --- a/L3_Middlewares/LVGL/src/widgets/roller/lv_roller.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_roller.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../core/lv_obj.h" +#include "../lv_conf_internal.h" #if LV_USE_ROLLER != 0 @@ -22,7 +22,8 @@ extern "C" { #error "lv_roller: lv_label is required. Enable it in lv_conf.h (LV_USE_ROLLER 1)" #endif -#include "../label/lv_label.h" +#include "../core/lv_obj.h" +#include "lv_label.h" /********************* * DEFINES @@ -32,22 +33,25 @@ extern "C" { * TYPEDEFS **********************/ -/** Roller mode. */ -typedef enum { - LV_ROLLER_MODE_NORMAL, /**< Normal mode (roller ends at the end of the options). */ - LV_ROLLER_MODE_INFINITE, /**< Infinite mode (roller can be scrolled forever). */ -} lv_roller_mode_t; - -#if LV_USE_OBJ_PROPERTY +/** Roller mode.*/ enum { - LV_PROPERTY_ID(ROLLER, OPTIONS, LV_PROPERTY_TYPE_TEXT, 0), - LV_PROPERTY_ID(ROLLER, SELECTED, LV_PROPERTY_TYPE_INT, 1), - LV_PROPERTY_ID(ROLLER, VISIBLE_ROW_COUNT, LV_PROPERTY_TYPE_INT, 2), - LV_PROPERTY_ROLLER_END, + LV_ROLLER_MODE_NORMAL, /**< Normal mode (roller ends at the end of the options).*/ + LV_ROLLER_MODE_INFINITE, /**< Infinite mode (roller can be scrolled forever).*/ }; -#endif -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_roller_class; +typedef uint8_t lv_roller_mode_t; + +typedef struct { + lv_obj_t obj; + uint16_t option_cnt; /**< Number of options*/ + uint16_t sel_opt_id; /**< Index of the current option*/ + uint16_t sel_opt_id_ori; /**< Store the original index on focus*/ + lv_roller_mode_t mode : 1; + uint32_t moved : 1; +} lv_roller_t; + +extern const lv_obj_class_t lv_roller_class; + /********************** * GLOBAL PROTOTYPES @@ -76,16 +80,16 @@ void lv_roller_set_options(lv_obj_t * obj, const char * options, lv_roller_mode_ * Set the selected option * @param obj pointer to a roller object * @param sel_opt index of the selected option (0 ... number of option - 1); - * @param anim LV_ANIM_ON: set with animation; LV_ANOM_OFF set immediately + * @param anim_en LV_ANIM_ON: set with animation; LV_ANOM_OFF set immediately */ -void lv_roller_set_selected(lv_obj_t * obj, uint32_t sel_opt, lv_anim_enable_t anim); +void lv_roller_set_selected(lv_obj_t * obj, uint16_t sel_opt, lv_anim_enable_t anim); /** * Set the height to show the given number of rows (options) * @param obj pointer to a roller object * @param row_cnt number of desired visible rows */ -void lv_roller_set_visible_row_count(lv_obj_t * obj, uint32_t row_cnt); +void lv_roller_set_visible_row_count(lv_obj_t * obj, uint8_t row_cnt); /*===================== * Getter functions @@ -96,16 +100,17 @@ void lv_roller_set_visible_row_count(lv_obj_t * obj, uint32_t row_cnt); * @param obj pointer to a roller object * @return index of the selected option (0 ... number of option - 1); */ -uint32_t lv_roller_get_selected(const lv_obj_t * obj); +uint16_t lv_roller_get_selected(const lv_obj_t * obj); /** * Get the current selected option as a string. - * @param obj pointer to roller object + * @param obj pointer to ddlist object * @param buf pointer to an array to store the string * @param buf_size size of `buf` in bytes. 0: to ignore it. */ void lv_roller_get_selected_str(const lv_obj_t * obj, char * buf, uint32_t buf_size); + /** * Get the options of a roller * @param obj pointer to roller object @@ -118,7 +123,7 @@ const char * lv_roller_get_options(const lv_obj_t * obj); * @param obj pointer to a roller object * @return the total number of options */ -uint32_t lv_roller_get_option_count(const lv_obj_t * obj); +uint16_t lv_roller_get_option_cnt(const lv_obj_t * obj); /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/widgets/lv_slider.c b/L3_Middlewares/LVGL/src/widgets/lv_slider.c new file mode 100644 index 0000000..98711da --- /dev/null +++ b/L3_Middlewares/LVGL/src/widgets/lv_slider.c @@ -0,0 +1,447 @@ +/** + * @file lv_slider.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "lv_slider.h" +#if LV_USE_SLIDER != 0 + +#include "../misc/lv_assert.h" +#include "../core/lv_group.h" +#include "../core/lv_indev.h" +#include "../draw/lv_draw.h" +#include "../misc/lv_math.h" +#include "../core/lv_disp.h" +#include "lv_img.h" + +/********************* + * DEFINES + *********************/ +#define MY_CLASS &lv_slider_class + +#define LV_SLIDER_KNOB_COORD(is_rtl, area) (is_rtl ? area.x1 : area.x2) + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void lv_slider_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); +static void lv_slider_event(const lv_obj_class_t * class_p, lv_event_t * e); +static void position_knob(lv_obj_t * obj, lv_area_t * knob_area, const lv_coord_t knob_size, const bool hor); +static void draw_knob(lv_event_t * e); +static bool is_slider_horizontal(lv_obj_t * obj); + +/********************** + * STATIC VARIABLES + **********************/ +const lv_obj_class_t lv_slider_class = { + .constructor_cb = lv_slider_constructor, + .event_cb = lv_slider_event, + .editable = LV_OBJ_CLASS_EDITABLE_TRUE, + .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, + .instance_size = sizeof(lv_slider_t), + .base_class = &lv_bar_class +}; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +lv_obj_t * lv_slider_create(lv_obj_t * parent) +{ + LV_LOG_INFO("begin"); + lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); + lv_obj_class_init_obj(obj); + return obj; +} + +bool lv_slider_is_dragged(const lv_obj_t * obj) +{ + LV_ASSERT_OBJ(obj, MY_CLASS); + lv_slider_t * slider = (lv_slider_t *)obj; + + return slider->dragging ? true : false; +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +static void lv_slider_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) +{ + LV_UNUSED(class_p); + lv_slider_t * slider = (lv_slider_t *)obj; + + /*Initialize the allocated 'slider'*/ + slider->value_to_set = NULL; + slider->dragging = 0U; + slider->left_knob_focus = 0U; + + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_set_ext_click_area(obj, LV_DPX(8)); +} + +static void lv_slider_event(const lv_obj_class_t * class_p, lv_event_t * e) +{ + LV_UNUSED(class_p); + + lv_res_t res; + + /*Call the ancestor's event handler*/ + res = lv_obj_event_base(MY_CLASS, e); + if(res != LV_RES_OK) return; + + lv_event_code_t code = lv_event_get_code(e); + lv_obj_t * obj = lv_event_get_target(e); + lv_slider_t * slider = (lv_slider_t *)obj; + lv_slider_mode_t type = lv_slider_get_mode(obj); + + /*Advanced hit testing: react only on dragging the knob(s)*/ + if(code == LV_EVENT_HIT_TEST) { + lv_hit_test_info_t * info = lv_event_get_param(e); + lv_coord_t ext_click_area = obj->spec_attr ? obj->spec_attr->ext_click_pad : 0; + + /*Ordinary slider: was the knob area hit?*/ + lv_area_t a; + lv_area_copy(&a, &slider->right_knob_area); + lv_area_increase(&a, ext_click_area, ext_click_area); + info->res = _lv_area_is_point_on(&a, info->point, 0); + + /*There's still a chance that there is a hit if there is another knob*/ + if((info->res == false) && (type == LV_SLIDER_MODE_RANGE)) { + lv_area_copy(&a, &slider->left_knob_area); + lv_area_increase(&a, ext_click_area, ext_click_area); + info->res = _lv_area_is_point_on(&a, info->point, 0); + } + } + else if(code == LV_EVENT_PRESSED) { + lv_obj_invalidate(obj); + + lv_point_t p; + slider->dragging = true; + if(type == LV_SLIDER_MODE_NORMAL || type == LV_SLIDER_MODE_SYMMETRICAL) { + slider->value_to_set = &slider->bar.cur_value; + } + else if(type == LV_SLIDER_MODE_RANGE) { + lv_indev_get_point(lv_indev_get_act(), &p); + bool hor = lv_obj_get_width(obj) >= lv_obj_get_height(obj); + lv_base_dir_t base_dir = lv_obj_get_style_base_dir(obj, LV_PART_MAIN); + + lv_coord_t dist_left, dist_right; + if(hor) { + if((base_dir != LV_BASE_DIR_RTL && p.x > slider->right_knob_area.x2) || (base_dir == LV_BASE_DIR_RTL && + p.x < slider->right_knob_area.x1)) { + slider->value_to_set = &slider->bar.cur_value; + } + else if((base_dir != LV_BASE_DIR_RTL && p.x < slider->left_knob_area.x1) || (base_dir == LV_BASE_DIR_RTL && + p.x > slider->left_knob_area.x2)) { + slider->value_to_set = &slider->bar.start_value; + } + else { + /*Calculate the distance from each knob*/ + dist_left = LV_ABS((slider->left_knob_area.x1 + (slider->left_knob_area.x2 - slider->left_knob_area.x1) / 2) - p.x); + dist_right = LV_ABS((slider->right_knob_area.x1 + (slider->right_knob_area.x2 - slider->right_knob_area.x1) / 2) - p.x); + + /*Use whichever one is closer*/ + if(dist_right < dist_left) { + slider->value_to_set = &slider->bar.cur_value; + slider->left_knob_focus = 0; + } + else { + slider->value_to_set = &slider->bar.start_value; + slider->left_knob_focus = 1; + } + } + } + else { + if(p.y < slider->right_knob_area.y1) { + slider->value_to_set = &slider->bar.cur_value; + } + else if(p.y > slider->left_knob_area.y2) { + slider->value_to_set = &slider->bar.start_value; + } + else { + /*Calculate the distance from each knob*/ + dist_left = LV_ABS((slider->left_knob_area.y1 + (slider->left_knob_area.y2 - slider->left_knob_area.y1) / 2) - p.y); + dist_right = LV_ABS((slider->right_knob_area.y1 + (slider->right_knob_area.y2 - slider->right_knob_area.y1) / 2) - p.y); + + /*Use whichever one is closer*/ + if(dist_right < dist_left) { + slider->value_to_set = &slider->bar.cur_value; + slider->left_knob_focus = 0; + } + else { + slider->value_to_set = &slider->bar.start_value; + slider->left_knob_focus = 1; + } + } + } + } + } + else if(code == LV_EVENT_PRESSING && slider->value_to_set != NULL) { + lv_indev_t * indev = lv_indev_get_act(); + if(lv_indev_get_type(indev) != LV_INDEV_TYPE_POINTER) return; + + lv_point_t p; + lv_indev_get_point(indev, &p); + int32_t new_value = 0; + + const int32_t range = slider->bar.max_value - slider->bar.min_value; + if(is_slider_horizontal(obj)) { + const lv_coord_t bg_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + const lv_coord_t bg_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + const lv_coord_t w = lv_obj_get_width(obj); + const lv_coord_t indic_w = w - bg_left - bg_right; + + if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) == LV_BASE_DIR_RTL) { + /*Make the point relative to the indicator*/ + new_value = (obj->coords.x2 - bg_right) - p.x; + } + else { + /*Make the point relative to the indicator*/ + new_value = p.x - (obj->coords.x1 + bg_left); + } + new_value = (new_value * range + indic_w / 2) / indic_w; + new_value += slider->bar.min_value; + } + else { + const lv_coord_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + const lv_coord_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); + const lv_coord_t h = lv_obj_get_height(obj); + const lv_coord_t indic_h = h - bg_bottom - bg_top; + + /*Make the point relative to the indicator*/ + new_value = p.y - (obj->coords.y2 + bg_bottom); + new_value = (-new_value * range + indic_h / 2) / indic_h; + new_value += slider->bar.min_value; + } + + int32_t real_max_value = slider->bar.max_value; + int32_t real_min_value = slider->bar.min_value; + /*Figure out the min. and max. for this mode*/ + if(slider->value_to_set == &slider->bar.start_value) { + real_max_value = slider->bar.cur_value; + } + else { + real_min_value = slider->bar.start_value; + } + + new_value = LV_CLAMP(real_min_value, new_value, real_max_value); + if(*slider->value_to_set != new_value) { + if(slider->value_to_set == &slider->bar.start_value) { + lv_bar_set_start_value(obj, new_value, LV_ANIM_ON); + } + else { + lv_bar_set_value(obj, new_value, LV_ANIM_ON); + } + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return; + } + + } + else if(code == LV_EVENT_RELEASED || code == LV_EVENT_PRESS_LOST) { + slider->dragging = false; + slider->value_to_set = NULL; + + lv_obj_invalidate(obj); + + /*Leave edit mode if released. (No need to wait for LONG_PRESS)*/ + lv_group_t * g = lv_obj_get_group(obj); + bool editing = lv_group_get_editing(g); + lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); + if(indev_type == LV_INDEV_TYPE_ENCODER) { + if(editing) { + if(lv_slider_get_mode(obj) == LV_SLIDER_MODE_RANGE) { + if(slider->left_knob_focus == 0) slider->left_knob_focus = 1; + else { + slider->left_knob_focus = 0; + lv_group_set_editing(g, false); + } + } + else { + lv_group_set_editing(g, false); + } + } + } + + } + else if(code == LV_EVENT_FOCUSED) { + lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); + if(indev_type == LV_INDEV_TYPE_ENCODER || indev_type == LV_INDEV_TYPE_KEYPAD) { + slider->left_knob_focus = 0; + } + } + else if(code == LV_EVENT_SIZE_CHANGED) { + lv_obj_refresh_ext_draw_size(obj); + } + else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { + lv_coord_t knob_left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); + lv_coord_t knob_right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); + lv_coord_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); + lv_coord_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); + + /*The smaller size is the knob diameter*/ + lv_coord_t zoom = lv_obj_get_style_transform_zoom(obj, LV_PART_KNOB); + lv_coord_t trans_w = lv_obj_get_style_transform_width(obj, LV_PART_KNOB); + lv_coord_t trans_h = lv_obj_get_style_transform_height(obj, LV_PART_KNOB); + lv_coord_t knob_size = LV_MIN(lv_obj_get_width(obj) + 2 * trans_w, lv_obj_get_height(obj) + 2 * trans_h) >> 1; + knob_size = (knob_size * zoom) >> 8; + knob_size += LV_MAX(LV_MAX(knob_left, knob_right), LV_MAX(knob_bottom, knob_top)); + knob_size += 2; /*For rounding error*/ + knob_size += lv_obj_calculate_ext_draw_size(obj, LV_PART_KNOB); + + /*Indic. size is handled by bar*/ + lv_coord_t * s = lv_event_get_param(e); + *s = LV_MAX(*s, knob_size); + + } + else if(code == LV_EVENT_KEY) { + char c = *((char *)lv_event_get_param(e)); + + if(c == LV_KEY_RIGHT || c == LV_KEY_UP) { + if(!slider->left_knob_focus) lv_slider_set_value(obj, lv_slider_get_value(obj) + 1, LV_ANIM_ON); + else lv_slider_set_left_value(obj, lv_slider_get_left_value(obj) + 1, LV_ANIM_ON); + } + else if(c == LV_KEY_LEFT || c == LV_KEY_DOWN) { + if(!slider->left_knob_focus) lv_slider_set_value(obj, lv_slider_get_value(obj) - 1, LV_ANIM_ON); + else lv_slider_set_left_value(obj, lv_slider_get_left_value(obj) - 1, LV_ANIM_ON); + } + else { + return; + } + + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return; + } + else if(code == LV_EVENT_DRAW_MAIN) { + draw_knob(e); + } +} + +static void draw_knob(lv_event_t * e) +{ + lv_obj_t * obj = lv_event_get_target(e); + lv_slider_t * slider = (lv_slider_t *)obj; + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); + + const bool is_rtl = LV_BASE_DIR_RTL == lv_obj_get_style_base_dir(obj, LV_PART_MAIN); + const bool is_horizontal = is_slider_horizontal(obj); + + lv_area_t knob_area; + lv_coord_t knob_size; + bool is_symmetrical = false; + if(slider->bar.mode == LV_BAR_MODE_SYMMETRICAL && slider->bar.min_value < 0 && + slider->bar.max_value > 0) is_symmetrical = true; + + if(is_horizontal) { + knob_size = lv_obj_get_height(obj); + if(is_symmetrical && slider->bar.cur_value < 0) knob_area.x1 = slider->bar.indic_area.x1; + else knob_area.x1 = LV_SLIDER_KNOB_COORD(is_rtl, slider->bar.indic_area); + } + else { + knob_size = lv_obj_get_width(obj); + if(is_symmetrical && slider->bar.cur_value < 0) knob_area.y1 = slider->bar.indic_area.y2; + else knob_area.y1 = slider->bar.indic_area.y1; + } + + lv_draw_rect_dsc_t knob_rect_dsc; + lv_draw_rect_dsc_init(&knob_rect_dsc); + lv_obj_init_draw_rect_dsc(obj, LV_PART_KNOB, &knob_rect_dsc); + /* Update knob area with knob style */ + position_knob(obj, &knob_area, knob_size, is_horizontal); + /* Update right knob area with calculated knob area */ + lv_area_copy(&slider->right_knob_area, &knob_area); + + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.part = LV_PART_KNOB; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_SLIDER_DRAW_PART_KNOB; + part_draw_dsc.id = 0; + part_draw_dsc.draw_area = &slider->right_knob_area; + part_draw_dsc.rect_dsc = &knob_rect_dsc; + + if(lv_slider_get_mode(obj) != LV_SLIDER_MODE_RANGE) { + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_rect(draw_ctx, &knob_rect_dsc, &slider->right_knob_area); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } + else { + /*Save the draw part_draw_dsc. because it can be modified in the event*/ + lv_draw_rect_dsc_t knob_rect_dsc_tmp; + lv_memcpy(&knob_rect_dsc_tmp, &knob_rect_dsc, sizeof(lv_draw_rect_dsc_t)); + /* Draw the right knob */ + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_rect(draw_ctx, &knob_rect_dsc, &slider->right_knob_area); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + + /*Calculate the second knob area*/ + if(is_horizontal) { + /*use !is_rtl to get the other knob*/ + knob_area.x1 = LV_SLIDER_KNOB_COORD(!is_rtl, slider->bar.indic_area); + } + else { + knob_area.y1 = slider->bar.indic_area.y2; + } + position_knob(obj, &knob_area, knob_size, is_horizontal); + lv_area_copy(&slider->left_knob_area, &knob_area); + + lv_memcpy(&knob_rect_dsc, &knob_rect_dsc_tmp, sizeof(lv_draw_rect_dsc_t)); + part_draw_dsc.type = LV_SLIDER_DRAW_PART_KNOB_LEFT; + part_draw_dsc.draw_area = &slider->left_knob_area; + part_draw_dsc.rect_dsc = &knob_rect_dsc; + part_draw_dsc.id = 1; + + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); + lv_draw_rect(draw_ctx, &knob_rect_dsc, &slider->left_knob_area); + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + } +} + +static void position_knob(lv_obj_t * obj, lv_area_t * knob_area, const lv_coord_t knob_size, const bool hor) +{ + if(hor) { + knob_area->x1 -= (knob_size >> 1); + knob_area->x2 = knob_area->x1 + knob_size - 1; + knob_area->y1 = obj->coords.y1; + knob_area->y2 = obj->coords.y2; + } + else { + knob_area->y1 -= (knob_size >> 1); + knob_area->y2 = knob_area->y1 + knob_size - 1; + knob_area->x1 = obj->coords.x1; + knob_area->x2 = obj->coords.x2; + } + + lv_coord_t knob_left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); + lv_coord_t knob_right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); + lv_coord_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); + lv_coord_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); + + lv_coord_t transf_w = lv_obj_get_style_transform_width(obj, LV_PART_KNOB); + lv_coord_t transf_h = lv_obj_get_style_transform_height(obj, LV_PART_KNOB); + + /*Apply the paddings on the knob area*/ + knob_area->x1 -= knob_left + transf_w; + knob_area->x2 += knob_right + transf_w; + knob_area->y1 -= knob_top + transf_h; + knob_area->y2 += knob_bottom + transf_h; +} + +static bool is_slider_horizontal(lv_obj_t * obj) +{ + return lv_obj_get_width(obj) >= lv_obj_get_height(obj); +} + +#endif diff --git a/L3_Middlewares/LVGL/src/widgets/slider/lv_slider.h b/L3_Middlewares/LVGL/src/widgets/lv_slider.h similarity index 57% rename from L3_Middlewares/LVGL/src/widgets/slider/lv_slider.h rename to L3_Middlewares/LVGL/src/widgets/lv_slider.h index 5f08a5c..386950c 100644 --- a/L3_Middlewares/LVGL/src/widgets/slider/lv_slider.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_slider.h @@ -13,7 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../bar/lv_bar.h" +#include "../lv_conf_internal.h" #if LV_USE_SLIDER != 0 @@ -22,6 +22,9 @@ extern "C" { #error "lv_slider: lv_bar is required. Enable it in lv_conf.h (LV_USE_BAR 1)" #endif +#include "../core/lv_obj.h" +#include "lv_bar.h" + /********************* * DEFINES *********************/ @@ -29,13 +32,33 @@ extern "C" { /********************** * TYPEDEFS **********************/ -typedef enum { + +enum { LV_SLIDER_MODE_NORMAL = LV_BAR_MODE_NORMAL, LV_SLIDER_MODE_SYMMETRICAL = LV_BAR_MODE_SYMMETRICAL, LV_SLIDER_MODE_RANGE = LV_BAR_MODE_RANGE -} lv_slider_mode_t; +}; +typedef uint8_t lv_slider_mode_t; + +typedef struct { + lv_bar_t bar; /*Add the ancestor's type first*/ + lv_area_t left_knob_area; + lv_area_t right_knob_area; + int32_t * value_to_set; /*Which bar value to set*/ + uint8_t dragging : 1; /*1: the slider is being dragged*/ + uint8_t left_knob_focus : 1; /*1: with encoder now the right knob can be adjusted*/ +} lv_slider_t; + +extern const lv_obj_class_t lv_slider_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_slider_class; +/** + * `type` field in `lv_obj_draw_part_dsc_t` if `class_p = lv_slider_class` + * Used in `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` + */ +typedef enum { + LV_SLIDER_DRAW_PART_KNOB, /**< The main (right) knob's rectangle*/ + LV_SLIDER_DRAW_PART_KNOB_LEFT, /**< The left knob's rectangle*/ +} lv_slider_draw_part_type_t; /********************** * GLOBAL PROTOTYPES @@ -58,7 +81,10 @@ lv_obj_t * lv_slider_create(lv_obj_t * parent); * @param value the new value * @param anim LV_ANIM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately */ -void lv_slider_set_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim); +static inline void lv_slider_set_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim) +{ + lv_bar_set_value(obj, value, anim); +} /** * Set a new value for the left knob of a slider @@ -66,7 +92,10 @@ void lv_slider_set_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim); * @param value new value * @param anim LV_ANIM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately */ -void lv_slider_set_left_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim); +static inline void lv_slider_set_left_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim) +{ + lv_bar_set_start_value(obj, value, anim); +} /** * Set minimum and the maximum values of a bar @@ -74,14 +103,20 @@ void lv_slider_set_left_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t an * @param min minimum value * @param max maximum value */ -void lv_slider_set_range(lv_obj_t * obj, int32_t min, int32_t max); +static inline void lv_slider_set_range(lv_obj_t * obj, int32_t min, int32_t max) +{ + lv_bar_set_range(obj, min, max); +} /** * Set the mode of slider. * @param obj pointer to a slider object * @param mode the mode of the slider. See ::lv_slider_mode_t */ -void lv_slider_set_mode(lv_obj_t * obj, lv_slider_mode_t mode); +static inline void lv_slider_set_mode(lv_obj_t * obj, lv_slider_mode_t mode) +{ + lv_bar_set_mode(obj, (lv_bar_mode_t)mode); +} /*===================== * Getter functions @@ -92,28 +127,40 @@ void lv_slider_set_mode(lv_obj_t * obj, lv_slider_mode_t mode); * @param obj pointer to a slider object * @return the value of the main knob of the slider */ -int32_t lv_slider_get_value(const lv_obj_t * obj); +static inline int32_t lv_slider_get_value(const lv_obj_t * obj) +{ + return lv_bar_get_value(obj); +} /** * Get the value of the left knob of a slider * @param obj pointer to a slider object * @return the value of the left knob of the slider */ -int32_t lv_slider_get_left_value(const lv_obj_t * obj); +static inline int32_t lv_slider_get_left_value(const lv_obj_t * obj) +{ + return lv_bar_get_start_value(obj); +} /** * Get the minimum value of a slider * @param obj pointer to a slider object * @return the minimum value of the slider */ -int32_t lv_slider_get_min_value(const lv_obj_t * obj); +static inline int32_t lv_slider_get_min_value(const lv_obj_t * obj) +{ + return lv_bar_get_min_value(obj); +} /** * Get the maximum value of a slider * @param obj pointer to a slider object * @return the maximum value of the slider */ -int32_t lv_slider_get_max_value(const lv_obj_t * obj); +static inline int32_t lv_slider_get_max_value(const lv_obj_t * obj) +{ + return lv_bar_get_max_value(obj); +} /** * Give the slider is being dragged or not @@ -124,17 +171,16 @@ bool lv_slider_is_dragged(const lv_obj_t * obj); /** * Get the mode of the slider. - * @param slider pointer to a slider object + * @param obj pointer to a bar object * @return see ::lv_slider_mode_t */ -lv_slider_mode_t lv_slider_get_mode(lv_obj_t * slider); - -/** - * Give the slider is in symmetrical mode or not - * @param obj pointer to slider object - * @return true: in symmetrical mode false : not in -*/ -bool lv_slider_is_symmetrical(lv_obj_t * obj); +static inline lv_slider_mode_t lv_slider_get_mode(lv_obj_t * slider) +{ + lv_bar_mode_t mode = lv_bar_get_mode(slider); + if(mode == LV_BAR_MODE_SYMMETRICAL) return LV_SLIDER_MODE_SYMMETRICAL; + else if(mode == LV_BAR_MODE_RANGE) return LV_SLIDER_MODE_RANGE; + else return LV_SLIDER_MODE_NORMAL; +} /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/widgets/switch/lv_switch.c b/L3_Middlewares/LVGL/src/widgets/lv_switch.c similarity index 70% rename from L3_Middlewares/LVGL/src/widgets/switch/lv_switch.c rename to L3_Middlewares/LVGL/src/widgets/lv_switch.c index 89b4b63..b328610 100644 --- a/L3_Middlewares/LVGL/src/widgets/switch/lv_switch.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_switch.c @@ -6,22 +6,21 @@ /********************* * INCLUDES *********************/ -#include "lv_switch_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_switch.h" #if LV_USE_SWITCH != 0 -#include "../../misc/lv_assert.h" -#include "../../misc/lv_math.h" -#include "../../misc/lv_anim_private.h" -#include "../../indev/lv_indev.h" -#include "../../display/lv_display.h" +#include "../misc/lv_assert.h" +#include "../misc/lv_math.h" +#include "../misc/lv_anim.h" +#include "../core/lv_indev.h" +#include "../core/lv_disp.h" +#include "lv_img.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_switch_class) +#define MY_CLASS &lv_switch_class #define LV_SWITCH_IS_ANIMATING(sw) (((sw)->anim_state) != LV_SWITCH_ANIM_STATE_INV) @@ -48,7 +47,7 @@ static void draw_main(lv_event_t * e); static void lv_switch_anim_exec_cb(void * sw, int32_t value); static void lv_switch_trigger_anim(lv_obj_t * obj); -static void lv_switch_anim_completed(lv_anim_t * a); +static void lv_switch_anim_ready(lv_anim_t * a); /********************** * STATIC VARIABLES **********************/ @@ -60,8 +59,7 @@ const lv_obj_class_t lv_switch_class = { .height_def = (4 * LV_DPI_DEF) / 17, .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, .instance_size = sizeof(lv_switch_t), - .base_class = &lv_obj_class, - .name = "switch", + .base_class = &lv_obj_class }; /********************** @@ -93,7 +91,7 @@ static void lv_switch_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj sw->anim_state = LV_SWITCH_ANIM_STATE_INV; - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_CHECKABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); @@ -105,34 +103,34 @@ static void lv_switch_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) LV_UNUSED(class_p); lv_switch_t * sw = (lv_switch_t *)obj; - lv_anim_delete(sw, NULL); + lv_anim_del(sw, NULL); } static void lv_switch_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /*Call the ancestor's event handler*/ res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { - int32_t knob_left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); - int32_t knob_right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); - int32_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); - int32_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); + lv_coord_t knob_left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); + lv_coord_t knob_right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); + lv_coord_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); + lv_coord_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); /*The smaller size is the knob diameter*/ - int32_t knob_size = LV_MAX4(knob_left, knob_right, knob_bottom, knob_top); - knob_size += LV_SWITCH_KNOB_EXT_AREA_CORRECTION; + lv_coord_t knob_size = LV_MAX4(knob_left, knob_right, knob_bottom, knob_top); + knob_size += _LV_SWITCH_KNOB_EXT_AREA_CORRECTION; knob_size += lv_obj_calculate_ext_draw_size(obj, LV_PART_KNOB); - int32_t * s = lv_event_get_param(e); + lv_coord_t * s = lv_event_get_param(e); *s = LV_MAX(*s, knob_size); *s = LV_MAX(*s, lv_obj_calculate_ext_draw_size(obj, LV_PART_INDICATOR)); } @@ -147,25 +145,35 @@ static void lv_switch_event(const lv_obj_class_t * class_p, lv_event_t * e) static void draw_main(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_switch_t * sw = (lv_switch_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); + + /*Calculate the indicator area*/ + lv_coord_t bg_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t bg_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); /*Draw the indicator*/ + /*Respect the background's padding*/ lv_area_t indic_area; - /*Exclude background's padding*/ - lv_obj_get_content_coords(obj, &indic_area); + lv_area_copy(&indic_area, &obj->coords); + indic_area.x1 += bg_left; + indic_area.x2 -= bg_right; + indic_area.y1 += bg_top; + indic_area.y2 -= bg_bottom; lv_draw_rect_dsc_t draw_indic_dsc; lv_draw_rect_dsc_init(&draw_indic_dsc); lv_obj_init_draw_rect_dsc(obj, LV_PART_INDICATOR, &draw_indic_dsc); - lv_draw_rect(layer, &draw_indic_dsc, &indic_area); + lv_draw_rect(draw_ctx, &draw_indic_dsc, &indic_area); /*Draw the knob*/ - int32_t anim_value_x = 0; - int32_t knob_size = lv_obj_get_height(obj); - int32_t anim_length = lv_area_get_width(&obj->coords) - knob_size; + lv_coord_t anim_value_x = 0; + lv_coord_t knob_size = lv_obj_get_height(obj); + lv_coord_t anim_length = lv_area_get_width(&obj->coords) - knob_size; if(LV_SWITCH_IS_ANIMATING(sw)) { /* Use the animation's coordinate */ @@ -182,14 +190,16 @@ static void draw_main(lv_event_t * e) } lv_area_t knob_area; - lv_area_copy(&knob_area, &obj->coords); - knob_area.x1 += anim_value_x; - knob_area.x2 = knob_area.x1 + (knob_size > 0 ? knob_size - 1 : 0); + knob_area.x1 = obj->coords.x1 + anim_value_x; + knob_area.x2 = knob_area.x1 + knob_size; + + knob_area.y1 = obj->coords.y1; + knob_area.y2 = obj->coords.y2; - int32_t knob_left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); - int32_t knob_right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); - int32_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); - int32_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); + lv_coord_t knob_left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); + lv_coord_t knob_right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); + lv_coord_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); + lv_coord_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); /*Apply the paddings on the knob area*/ knob_area.x1 -= knob_left; @@ -201,7 +211,7 @@ static void draw_main(lv_event_t * e) lv_draw_rect_dsc_init(&knob_rect_dsc); lv_obj_init_draw_rect_dsc(obj, LV_PART_KNOB, &knob_rect_dsc); - lv_draw_rect(layer, &knob_rect_dsc, &knob_area); + lv_draw_rect(draw_ctx, &knob_rect_dsc, &knob_area); } static void lv_switch_anim_exec_cb(void * var, int32_t value) @@ -214,7 +224,7 @@ static void lv_switch_anim_exec_cb(void * var, int32_t value) /** * Resets the switch's animation state to "no animation in progress". */ -static void lv_switch_anim_completed(lv_anim_t * a) +static void lv_switch_anim_ready(lv_anim_t * a) { lv_switch_t * sw = a->var; sw->anim_state = LV_SWITCH_ANIM_STATE_INV; @@ -230,7 +240,7 @@ static void lv_switch_trigger_anim(lv_obj_t * obj) LV_ASSERT_OBJ(obj, MY_CLASS); lv_switch_t * sw = (lv_switch_t *)obj; - uint32_t anim_dur_full = lv_obj_get_style_anim_duration(obj, LV_PART_MAIN); + uint32_t anim_dur_full = lv_obj_get_style_anim_time(obj, LV_PART_MAIN); if(anim_dur_full > 0) { bool chk = lv_obj_get_state(obj) & LV_STATE_CHECKED; @@ -250,17 +260,18 @@ static void lv_switch_trigger_anim(lv_obj_t * obj) uint32_t anim_dur = (anim_dur_full * LV_ABS(anim_start - anim_end)) / LV_SWITCH_ANIM_STATE_END; /*Stop the previous animation if it exists*/ - lv_anim_delete(sw, NULL); + lv_anim_del(sw, NULL); lv_anim_t a; lv_anim_init(&a); lv_anim_set_var(&a, sw); lv_anim_set_exec_cb(&a, lv_switch_anim_exec_cb); lv_anim_set_values(&a, anim_start, anim_end); - lv_anim_set_completed_cb(&a, lv_switch_anim_completed); - lv_anim_set_duration(&a, anim_dur); + lv_anim_set_ready_cb(&a, lv_switch_anim_ready); + lv_anim_set_time(&a, anim_dur); lv_anim_start(&a); } } + #endif diff --git a/L3_Middlewares/LVGL/src/widgets/switch/lv_switch.h b/L3_Middlewares/LVGL/src/widgets/lv_switch.h similarity index 60% rename from L3_Middlewares/LVGL/src/widgets/switch/lv_switch.h rename to L3_Middlewares/LVGL/src/widgets/lv_switch.h index 989a3dd..83ca81b 100644 --- a/L3_Middlewares/LVGL/src/widgets/switch/lv_switch.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_switch.h @@ -13,20 +13,29 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../../lv_conf_internal.h" +#include "../lv_conf_internal.h" #if LV_USE_SWITCH != 0 -#include "../../core/lv_obj.h" +#include "../core/lv_obj.h" /********************* * DEFINES *********************/ /** Switch knob extra area correction factor */ -#define LV_SWITCH_KNOB_EXT_AREA_CORRECTION 2 +#define _LV_SWITCH_KNOB_EXT_AREA_CORRECTION 2 -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_switch_class; +/********************** + * TYPEDEFS + **********************/ + +typedef struct { + lv_obj_t obj; + int32_t anim_state; +} lv_switch_t; + +extern const lv_obj_class_t lv_switch_class; /********************** * GLOBAL PROTOTYPES @@ -34,8 +43,8 @@ LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_switch_class; /** * Create a switch object - * @param parent pointer to an object, it will be the parent of the new switch - * @return pointer to the created switch + * @param parent pointer to an object, it will be the parent of the new switch + * @return pointer to the created switch */ lv_obj_t * lv_switch_create(lv_obj_t * parent); diff --git a/L3_Middlewares/LVGL/src/widgets/table/lv_table.c b/L3_Middlewares/LVGL/src/widgets/lv_table.c similarity index 67% rename from L3_Middlewares/LVGL/src/widgets/table/lv_table.c rename to L3_Middlewares/LVGL/src/widgets/lv_table.c index affb99b..968cf87 100644 --- a/L3_Middlewares/LVGL/src/widgets/table/lv_table.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_table.c @@ -6,25 +6,21 @@ /********************* * INCLUDES *********************/ -#include "lv_table_private.h" -#include "../../misc/lv_area_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_table.h" #if LV_USE_TABLE != 0 -#include "../../indev/lv_indev.h" -#include "../../misc/lv_assert.h" -#include "../../misc/lv_text.h" -#include "../../misc/lv_text_ap.h" -#include "../../misc/lv_math.h" -#include "../../stdlib/lv_sprintf.h" -#include "../../draw/lv_draw_private.h" -#include "../../stdlib/lv_string.h" +#include "../core/lv_indev.h" +#include "../misc/lv_assert.h" +#include "../misc/lv_txt.h" +#include "../misc/lv_txt_ap.h" +#include "../misc/lv_math.h" +#include "../misc/lv_printf.h" +#include "../draw/lv_draw.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_table_class) +#define MY_CLASS &lv_table_class /********************** * TYPEDEFS @@ -37,15 +33,15 @@ static void lv_table_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) static void lv_table_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e); static void draw_main(lv_event_t * e); -static int32_t get_row_height(lv_obj_t * obj, uint32_t row_id, const lv_font_t * font, - int32_t letter_space, int32_t line_space, - int32_t cell_left, int32_t cell_right, int32_t cell_top, int32_t cell_bottom); +static lv_coord_t get_row_height(lv_obj_t * obj, uint16_t row_id, const lv_font_t * font, + lv_coord_t letter_space, lv_coord_t line_space, + lv_coord_t cell_left, lv_coord_t cell_right, lv_coord_t cell_top, lv_coord_t cell_bottom); static void refr_size_form_row(lv_obj_t * obj, uint32_t start_row); static void refr_cell_size(lv_obj_t * obj, uint32_t row, uint32_t col); -static lv_result_t get_pressed_cell(lv_obj_t * obj, uint32_t * row, uint32_t * col); +static lv_res_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col); static size_t get_cell_txt_len(const char * txt); static void copy_cell_txt(lv_table_cell_t * dst, const char * txt); -static void get_cell_area(lv_obj_t * obj, uint32_t row, uint32_t col, lv_area_t * area); +static void get_cell_area(lv_obj_t * obj, uint16_t row, uint16_t col, lv_area_t * area); static void scroll_to_selected_cell(lv_obj_t * obj); static inline bool is_cell_empty(void * cell) @@ -66,7 +62,6 @@ const lv_obj_class_t lv_table_class = { .editable = LV_OBJ_CLASS_EDITABLE_TRUE, .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, .instance_size = sizeof(lv_table_t), - .name = "table", }; /********************** * MACROS @@ -88,7 +83,7 @@ lv_obj_t * lv_table_create(lv_obj_t * parent) * Setter functions *====================*/ -void lv_table_set_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col, const char * txt) +void lv_table_set_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col, const char * txt) { LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_NULL(txt); @@ -96,8 +91,8 @@ void lv_table_set_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col, const c lv_table_t * table = (lv_table_t *)obj; /*Auto expand*/ - if(col >= table->col_cnt) lv_table_set_column_count(obj, col + 1); - if(row >= table->row_cnt) lv_table_set_row_count(obj, row + 1); + if(col >= table->col_cnt) lv_table_set_col_cnt(obj, col + 1); + if(row >= table->row_cnt) lv_table_set_row_cnt(obj, row + 1); uint32_t cell = row * table->col_cnt + col; lv_table_cell_ctrl_t ctrl = 0; @@ -105,37 +100,41 @@ void lv_table_set_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col, const c /*Save the control byte*/ if(table->cell_data[cell]) ctrl = table->cell_data[cell]->ctrl; +#if LV_USE_USER_DATA void * user_data = NULL; /*Save the user data*/ if(table->cell_data[cell]) user_data = table->cell_data[cell]->user_data; +#endif size_t to_allocate = get_cell_txt_len(txt); - table->cell_data[cell] = lv_realloc(table->cell_data[cell], to_allocate); + table->cell_data[cell] = lv_mem_realloc(table->cell_data[cell], to_allocate); LV_ASSERT_MALLOC(table->cell_data[cell]); if(table->cell_data[cell] == NULL) return; copy_cell_txt(table->cell_data[cell], txt); table->cell_data[cell]->ctrl = ctrl; +#if LV_USE_USER_DATA table->cell_data[cell]->user_data = user_data; +#endif refr_cell_size(obj, row, col); } -void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint32_t row, uint32_t col, const char * fmt, ...) +void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, const char * fmt, ...) { LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_NULL(fmt); lv_table_t * table = (lv_table_t *)obj; if(col >= table->col_cnt) { - lv_table_set_column_count(obj, col + 1); + lv_table_set_col_cnt(obj, col + 1); } /*Auto expand*/ if(row >= table->row_cnt) { - lv_table_set_row_count(obj, row + 1); + lv_table_set_row_cnt(obj, row + 1); } uint32_t cell = row * table->col_cnt + col; @@ -144,10 +143,12 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint32_t row, uint32_t col, con /*Save the control byte*/ if(table->cell_data[cell]) ctrl = table->cell_data[cell]->ctrl; +#if LV_USE_USER_DATA void * user_data = NULL; /*Save the user_data*/ if(table->cell_data[cell]) user_data = table->cell_data[cell]->user_data; +#endif va_list ap, ap2; va_start(ap, fmt); @@ -159,7 +160,7 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint32_t row, uint32_t col, con #if LV_USE_ARABIC_PERSIAN_CHARS /*Put together the text according to the format string*/ - char * raw_txt = lv_malloc(len + 1); + char * raw_txt = lv_mem_buf_get(len + 1); LV_ASSERT_MALLOC(raw_txt); if(raw_txt == NULL) { va_end(ap2); @@ -169,19 +170,19 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint32_t row, uint32_t col, con lv_vsnprintf(raw_txt, len + 1, fmt, ap2); /*Get the size of the Arabic text and process it*/ - size_t len_ap = lv_text_ap_calc_bytes_count(raw_txt); - table->cell_data[cell] = lv_realloc(table->cell_data[cell], sizeof(lv_table_cell_t) + len_ap + 1); + size_t len_ap = _lv_txt_ap_calc_bytes_cnt(raw_txt); + table->cell_data[cell] = lv_mem_realloc(table->cell_data[cell], sizeof(lv_table_cell_t) + len_ap + 1); LV_ASSERT_MALLOC(table->cell_data[cell]); if(table->cell_data[cell] == NULL) { va_end(ap2); return; } - lv_text_ap_proc(raw_txt, table->cell_data[cell]->txt); + _lv_txt_ap_proc(raw_txt, table->cell_data[cell]->txt); - lv_free(raw_txt); + lv_mem_buf_release(raw_txt); #else - table->cell_data[cell] = lv_realloc(table->cell_data[cell], - sizeof(lv_table_cell_t) + len + 1); /*+1: trailing '\0; */ + table->cell_data[cell] = lv_mem_realloc(table->cell_data[cell], + sizeof(lv_table_cell_t) + len + 1); /*+1: trailing '\0; */ LV_ASSERT_MALLOC(table->cell_data[cell]); if(table->cell_data[cell] == NULL) { va_end(ap2); @@ -196,11 +197,13 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint32_t row, uint32_t col, con va_end(ap2); table->cell_data[cell]->ctrl = ctrl; +#if LV_USE_USER_DATA table->cell_data[cell]->user_data = user_data; +#endif refr_cell_size(obj, row, col); } -void lv_table_set_row_count(lv_obj_t * obj, uint32_t row_cnt) +void lv_table_set_row_cnt(lv_obj_t * obj, uint16_t row_cnt) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -208,28 +211,30 @@ void lv_table_set_row_count(lv_obj_t * obj, uint32_t row_cnt) if(table->row_cnt == row_cnt) return; - uint32_t old_row_cnt = table->row_cnt; + uint16_t old_row_cnt = table->row_cnt; table->row_cnt = row_cnt; - table->row_h = lv_realloc(table->row_h, table->row_cnt * sizeof(table->row_h[0])); + table->row_h = lv_mem_realloc(table->row_h, table->row_cnt * sizeof(table->row_h[0])); LV_ASSERT_MALLOC(table->row_h); if(table->row_h == NULL) return; /*Free the unused cells*/ if(old_row_cnt > row_cnt) { - uint32_t old_cell_cnt = old_row_cnt * table->col_cnt; + uint16_t old_cell_cnt = old_row_cnt * table->col_cnt; uint32_t new_cell_cnt = table->col_cnt * table->row_cnt; uint32_t i; for(i = new_cell_cnt; i < old_cell_cnt; i++) { - if(table->cell_data[i] && table->cell_data[i]->user_data) { - lv_free(table->cell_data[i]->user_data); +#if LV_USE_USER_DATA + if(table->cell_data[i]->user_data) { + lv_mem_free(table->cell_data[i]->user_data); table->cell_data[i]->user_data = NULL; } - lv_free(table->cell_data[i]); +#endif + lv_mem_free(table->cell_data[i]); } } - table->cell_data = lv_realloc(table->cell_data, table->row_cnt * table->col_cnt * sizeof(lv_table_cell_t *)); + table->cell_data = lv_mem_realloc(table->cell_data, table->row_cnt * table->col_cnt * sizeof(lv_table_cell_t *)); LV_ASSERT_MALLOC(table->cell_data); if(table->cell_data == NULL) return; @@ -237,13 +242,13 @@ void lv_table_set_row_count(lv_obj_t * obj, uint32_t row_cnt) if(old_row_cnt < row_cnt) { uint32_t old_cell_cnt = old_row_cnt * table->col_cnt; uint32_t new_cell_cnt = table->col_cnt * table->row_cnt; - lv_memzero(&table->cell_data[old_cell_cnt], (new_cell_cnt - old_cell_cnt) * sizeof(table->cell_data[0])); + lv_memset_00(&table->cell_data[old_cell_cnt], (new_cell_cnt - old_cell_cnt) * sizeof(table->cell_data[0])); } refr_size_form_row(obj, 0); } -void lv_table_set_column_count(lv_obj_t * obj, uint32_t col_cnt) +void lv_table_set_col_cnt(lv_obj_t * obj, uint16_t col_cnt) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -251,15 +256,15 @@ void lv_table_set_column_count(lv_obj_t * obj, uint32_t col_cnt) if(table->col_cnt == col_cnt) return; - uint32_t old_col_cnt = table->col_cnt; + uint16_t old_col_cnt = table->col_cnt; table->col_cnt = col_cnt; - lv_table_cell_t ** new_cell_data = lv_malloc(table->row_cnt * table->col_cnt * sizeof(lv_table_cell_t *)); + lv_table_cell_t ** new_cell_data = lv_mem_alloc(table->row_cnt * table->col_cnt * sizeof(lv_table_cell_t *)); LV_ASSERT_MALLOC(new_cell_data); if(new_cell_data == NULL) return; uint32_t new_cell_cnt = table->col_cnt * table->row_cnt; - lv_memzero(new_cell_data, new_cell_cnt * sizeof(table->cell_data[0])); + lv_memset_00(new_cell_data, new_cell_cnt * sizeof(table->cell_data[0])); /*The new column(s) messes up the mapping of `cell_data`*/ uint32_t old_col_start; @@ -270,27 +275,29 @@ void lv_table_set_column_count(lv_obj_t * obj, uint32_t col_cnt) old_col_start = row * old_col_cnt; new_col_start = row * col_cnt; - lv_memcpy(&new_cell_data[new_col_start], &table->cell_data[old_col_start], - sizeof(new_cell_data[0]) * min_col_cnt); + lv_memcpy_small(&new_cell_data[new_col_start], &table->cell_data[old_col_start], + sizeof(new_cell_data[0]) * min_col_cnt); /*Free the old cells (only if the table becomes smaller)*/ int32_t i; - for(i = 0; i < (int32_t)old_col_cnt - (int32_t)col_cnt; i++) { + for(i = 0; i < (int32_t)old_col_cnt - col_cnt; i++) { uint32_t idx = old_col_start + min_col_cnt + i; +#if LV_USE_USER_DATA if(table->cell_data[idx]->user_data) { - lv_free(table->cell_data[idx]->user_data); + lv_mem_free(table->cell_data[idx]->user_data); table->cell_data[idx]->user_data = NULL; } - lv_free(table->cell_data[idx]); +#endif + lv_mem_free(table->cell_data[idx]); table->cell_data[idx] = NULL; } } - lv_free(table->cell_data); + lv_mem_free(table->cell_data); table->cell_data = new_cell_data; /*Initialize the new column widths if any*/ - table->col_w = lv_realloc(table->col_w, col_cnt * sizeof(table->col_w[0])); + table->col_w = lv_mem_realloc(table->col_w, col_cnt * sizeof(table->col_w[0])); LV_ASSERT_MALLOC(table->col_w); if(table->col_w == NULL) return; @@ -299,72 +306,78 @@ void lv_table_set_column_count(lv_obj_t * obj, uint32_t col_cnt) table->col_w[col] = LV_DPI_DEF; } + refr_size_form_row(obj, 0) ; } -void lv_table_set_column_width(lv_obj_t * obj, uint32_t col_id, int32_t w) +void lv_table_set_col_width(lv_obj_t * obj, uint16_t col_id, lv_coord_t w) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_table_t * table = (lv_table_t *)obj; /*Auto expand*/ - if(col_id >= table->col_cnt) lv_table_set_column_count(obj, col_id + 1); + if(col_id >= table->col_cnt) lv_table_set_col_cnt(obj, col_id + 1); table->col_w[col_id] = w; refr_size_form_row(obj, 0); } -void lv_table_add_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl) +void lv_table_add_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_table_t * table = (lv_table_t *)obj; /*Auto expand*/ - if(col >= table->col_cnt) lv_table_set_column_count(obj, col + 1); - if(row >= table->row_cnt) lv_table_set_row_count(obj, row + 1); + if(col >= table->col_cnt) lv_table_set_col_cnt(obj, col + 1); + if(row >= table->row_cnt) lv_table_set_row_cnt(obj, row + 1); uint32_t cell = row * table->col_cnt + col; if(is_cell_empty(table->cell_data[cell])) { - table->cell_data[cell] = lv_malloc(sizeof(lv_table_cell_t) + 1); /*+1: trailing '\0 */ + table->cell_data[cell] = lv_mem_alloc(sizeof(lv_table_cell_t) + 1); /*+1: trailing '\0 */ LV_ASSERT_MALLOC(table->cell_data[cell]); if(table->cell_data[cell] == NULL) return; table->cell_data[cell]->ctrl = 0; +#if LV_USE_USER_DATA table->cell_data[cell]->user_data = NULL; +#endif table->cell_data[cell]->txt[0] = '\0'; } table->cell_data[cell]->ctrl |= ctrl; } -void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl) +void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_table_t * table = (lv_table_t *)obj; /*Auto expand*/ - if(col >= table->col_cnt) lv_table_set_column_count(obj, col + 1); - if(row >= table->row_cnt) lv_table_set_row_count(obj, row + 1); + if(col >= table->col_cnt) lv_table_set_col_cnt(obj, col + 1); + if(row >= table->row_cnt) lv_table_set_row_cnt(obj, row + 1); uint32_t cell = row * table->col_cnt + col; if(is_cell_empty(table->cell_data[cell])) { - table->cell_data[cell] = lv_malloc(sizeof(lv_table_cell_t) + 1); /*+1: trailing '\0 */ + table->cell_data[cell] = lv_mem_alloc(sizeof(lv_table_cell_t) + 1); /*+1: trailing '\0 */ LV_ASSERT_MALLOC(table->cell_data[cell]); if(table->cell_data[cell] == NULL) return; table->cell_data[cell]->ctrl = 0; +#if LV_USE_USER_DATA table->cell_data[cell]->user_data = NULL; +#endif table->cell_data[cell]->txt[0] = '\0'; } table->cell_data[cell]->ctrl &= (~ctrl); } +#if LV_USE_USER_DATA void lv_table_set_cell_user_data(lv_obj_t * obj, uint16_t row, uint16_t col, void * user_data) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -372,13 +385,13 @@ void lv_table_set_cell_user_data(lv_obj_t * obj, uint16_t row, uint16_t col, voi lv_table_t * table = (lv_table_t *)obj; /*Auto expand*/ - if(col >= table->col_cnt) lv_table_set_column_count(obj, col + 1); - if(row >= table->row_cnt) lv_table_set_row_count(obj, row + 1); + if(col >= table->col_cnt) lv_table_set_col_cnt(obj, col + 1); + if(row >= table->row_cnt) lv_table_set_row_cnt(obj, row + 1); uint32_t cell = row * table->col_cnt + col; if(is_cell_empty(table->cell_data[cell])) { - table->cell_data[cell] = lv_malloc(sizeof(lv_table_cell_t) + 1); /*+1: trailing '\0 */ + table->cell_data[cell] = lv_mem_alloc(sizeof(lv_table_cell_t) + 1); /*+1: trailing '\0 */ LV_ASSERT_MALLOC(table->cell_data[cell]); if(table->cell_data[cell] == NULL) return; @@ -388,37 +401,18 @@ void lv_table_set_cell_user_data(lv_obj_t * obj, uint16_t row, uint16_t col, voi } if(table->cell_data[cell]->user_data) { - lv_free(table->cell_data[cell]->user_data); + lv_mem_free(table->cell_data[cell]->user_data); } table->cell_data[cell]->user_data = user_data; } - -void lv_table_set_selected_cell(lv_obj_t * obj, uint16_t row, uint16_t col) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_table_t * table = (lv_table_t *)obj; - - if(table->col_cnt == 0 || table->row_cnt == 0) return; - - if(table->col_act != col || table->row_act != row) { - table->col_act = (col >= table->col_cnt) ? (table->col_cnt - 1) : col; - table->row_act = (row >= table->row_cnt) ? (table->row_cnt - 1) : row; - - lv_obj_invalidate(obj); - - scroll_to_selected_cell(obj); - - lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - } -} +#endif /*===================== * Getter functions *====================*/ -const char * lv_table_get_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col) +const char * lv_table_get_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -434,7 +428,7 @@ const char * lv_table_get_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col) return table->cell_data[cell]->txt; } -uint32_t lv_table_get_row_count(lv_obj_t * obj) +uint16_t lv_table_get_row_cnt(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -442,7 +436,7 @@ uint32_t lv_table_get_row_count(lv_obj_t * obj) return table->row_cnt; } -uint32_t lv_table_get_column_count(lv_obj_t * obj) +uint16_t lv_table_get_col_cnt(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -450,27 +444,27 @@ uint32_t lv_table_get_column_count(lv_obj_t * obj) return table->col_cnt; } -int32_t lv_table_get_column_width(lv_obj_t * obj, uint32_t col) +lv_coord_t lv_table_get_col_width(lv_obj_t * obj, uint16_t col) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_table_t * table = (lv_table_t *)obj; if(col >= table->col_cnt) { - LV_LOG_WARN("too big 'col_id'. Must be < LV_TABLE_COL_MAX."); + LV_LOG_WARN("lv_table_set_col_width: too big 'col_id'. Must be < LV_TABLE_COL_MAX."); return 0; } return table->col_w[col]; } -bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl) +bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_table_t * table = (lv_table_t *)obj; if(row >= table->row_cnt || col >= table->col_cnt) { - LV_LOG_WARN("invalid row or column"); + LV_LOG_WARN("lv_table_get_cell_crop: invalid row or column"); return false; } uint32_t cell = row * table->col_cnt + col; @@ -479,13 +473,14 @@ bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table else return (table->cell_data[cell]->ctrl & ctrl) == ctrl; } -void lv_table_get_selected_cell(lv_obj_t * obj, uint32_t * row, uint32_t * col) +void lv_table_get_selected_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col) { lv_table_t * table = (lv_table_t *)obj; *row = table->row_act; *col = table->col_act; } +#if LV_USE_USER_DATA void * lv_table_get_cell_user_data(lv_obj_t * obj, uint16_t row, uint16_t col) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -501,6 +496,7 @@ void * lv_table_get_cell_user_data(lv_obj_t * obj, uint16_t row, uint16_t col) return table->cell_data[cell]->user_data; } +#endif /********************** * STATIC FUNCTIONS @@ -515,11 +511,11 @@ static void lv_table_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) table->col_cnt = 1; table->row_cnt = 1; - table->col_w = lv_malloc(table->col_cnt * sizeof(table->col_w[0])); - table->row_h = lv_malloc(table->row_cnt * sizeof(table->row_h[0])); + table->col_w = lv_mem_alloc(table->col_cnt * sizeof(table->col_w[0])); + table->row_h = lv_mem_alloc(table->row_cnt * sizeof(table->row_h[0])); table->col_w[0] = LV_DPI_DEF; table->row_h[0] = LV_DPI_DEF; - table->cell_data = lv_realloc(table->cell_data, table->row_cnt * table->col_cnt * sizeof(lv_table_cell_t *)); + table->cell_data = lv_mem_realloc(table->cell_data, table->row_cnt * table->col_cnt * sizeof(lv_table_cell_t *)); table->cell_data[0] = NULL; LV_TRACE_OBJ_CREATE("finished"); @@ -530,35 +526,37 @@ static void lv_table_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) LV_UNUSED(class_p); lv_table_t * table = (lv_table_t *)obj; /*Free the cell texts*/ - uint32_t i; + uint16_t i; for(i = 0; i < table->col_cnt * table->row_cnt; i++) { if(table->cell_data[i]) { +#if LV_USE_USER_DATA if(table->cell_data[i]->user_data) { - lv_free(table->cell_data[i]->user_data); + lv_mem_free(table->cell_data[i]->user_data); table->cell_data[i]->user_data = NULL; } - lv_free(table->cell_data[i]); +#endif + lv_mem_free(table->cell_data[i]); table->cell_data[i] = NULL; } } - if(table->cell_data) lv_free(table->cell_data); - if(table->row_h) lv_free(table->row_h); - if(table->col_w) lv_free(table->col_w); + if(table->cell_data) lv_mem_free(table->cell_data); + if(table->row_h) lv_mem_free(table->row_h); + if(table->col_w) lv_mem_free(table->col_w); } static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /*Call the ancestor's event handler*/ res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_table_t * table = (lv_table_t *)obj; if(code == LV_EVENT_STYLE_CHANGED) { @@ -567,21 +565,21 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e) else if(code == LV_EVENT_GET_SELF_SIZE) { lv_point_t * p = lv_event_get_param(e); uint32_t i; - int32_t w = 0; + lv_coord_t w = 0; for(i = 0; i < table->col_cnt; i++) w += table->col_w[i]; - int32_t h = 0; + lv_coord_t h = 0; for(i = 0; i < table->row_cnt; i++) h += table->row_h[i]; p->x = w - 1; p->y = h - 1; } else if(code == LV_EVENT_PRESSED || code == LV_EVENT_PRESSING) { - uint32_t col; - uint32_t row; - lv_result_t pr_res = get_pressed_cell(obj, &row, &col); + uint16_t col; + uint16_t row; + lv_res_t pr_res = get_pressed_cell(obj, &row, &col); - if(pr_res == LV_RESULT_OK && (table->col_act != col || table->row_act != row)) { + if(pr_res == LV_RES_OK && (table->col_act != col || table->row_act != row)) { table->col_act = col; table->row_act = row; lv_obj_invalidate(obj); @@ -589,14 +587,14 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e) } else if(code == LV_EVENT_RELEASED) { lv_obj_invalidate(obj); - lv_indev_t * indev = lv_indev_active(); + lv_indev_t * indev = lv_indev_get_act(); lv_obj_t * scroll_obj = lv_indev_get_scroll_obj(indev); if(table->col_act != LV_TABLE_CELL_NONE && table->row_act != LV_TABLE_CELL_NONE && scroll_obj == NULL) { - res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - if(res != LV_RESULT_OK) return; + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return; } - lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_active()); + lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); if(indev_type == LV_INDEV_TYPE_POINTER || indev_type == LV_INDEV_TYPE_BUTTON) { table->col_act = LV_TABLE_CELL_NONE; table->row_act = LV_TABLE_CELL_NONE; @@ -617,8 +615,8 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e) return; } - if(col >= (int32_t)table->col_cnt) col = 0; - if(row >= (int32_t)table->row_cnt) row = 0; + if(col >= table->col_cnt) col = 0; + if(row >= table->row_cnt) row = 0; if(c == LV_KEY_LEFT) col--; else if(c == LV_KEY_RIGHT) col++; @@ -626,8 +624,8 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e) else if(c == LV_KEY_DOWN) row++; else return; - if(col >= (int32_t)table->col_cnt) { - if(row < (int32_t)table->row_cnt - 1) { + if(col >= table->col_cnt) { + if(row < table->row_cnt - 1) { col = 0; row++; } @@ -645,22 +643,22 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e) } } - if(row >= (int32_t)table->row_cnt) { + if(row >= table->row_cnt) { row = table->row_cnt - 1; } else if(row < 0) { row = 0; } - if((int32_t)table->col_act != col || (int32_t)table->row_act != row) { + if(table->col_act != col || table->row_act != row) { table->col_act = col; table->row_act = row; lv_obj_invalidate(obj); scroll_to_selected_cell(obj); - res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - if(res != LV_RESULT_OK) return; + res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); + if(res != LV_RES_OK) return; } } else if(code == LV_EVENT_DRAW_MAIN) { @@ -668,25 +666,26 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e) } } + static void draw_main(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_table_t * table = (lv_table_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); lv_area_t clip_area; - if(!lv_area_intersect(&clip_area, &obj->coords, &layer->_clip_area)) return; + if(!_lv_area_intersect(&clip_area, &obj->coords, draw_ctx->clip_area)) return; - const lv_area_t clip_area_ori = layer->_clip_area; - layer->_clip_area = clip_area; + const lv_area_t * clip_area_ori = draw_ctx->clip_area; + draw_ctx->clip_area = &clip_area; lv_point_t txt_size; lv_area_t cell_area; - int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - int32_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); - int32_t bg_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t bg_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); + lv_coord_t bg_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t bg_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); lv_state_t state_ori = obj->state; obj->state = LV_STATE_DEFAULT; @@ -703,19 +702,25 @@ static void draw_main(lv_event_t * e) obj->state = state_ori; obj->skip_trans = 0; - uint32_t col; - uint32_t row; - uint32_t cell = 0; + uint16_t col; + uint16_t row; + uint16_t cell = 0; cell_area.y2 = obj->coords.y1 + bg_top - 1 - lv_obj_get_scroll_y(obj) + border_width; - cell_area.x1 = 0; - cell_area.x2 = 0; - int32_t scroll_x = lv_obj_get_scroll_x(obj) ; + lv_coord_t scroll_x = lv_obj_get_scroll_x(obj) ; bool rtl = lv_obj_get_style_base_dir(obj, LV_PART_MAIN) == LV_BASE_DIR_RTL; /*Handle custom drawer*/ + lv_obj_draw_part_dsc_t part_draw_dsc; + lv_obj_draw_dsc_init(&part_draw_dsc, draw_ctx); + part_draw_dsc.part = LV_PART_ITEMS; + part_draw_dsc.class_p = MY_CLASS; + part_draw_dsc.type = LV_TABLE_DRAW_PART_CELL; + part_draw_dsc.rect_dsc = &rect_dsc_act; + part_draw_dsc.label_dsc = &label_dsc_act; + for(row = 0; row < table->row_cnt; row++) { - int32_t h_row = table->row_h[row]; + lv_coord_t h_row = table->row_h[row]; cell_area.y1 = cell_area.y2 + 1; cell_area.y2 = cell_area.y1 + h_row - 1; @@ -738,7 +743,7 @@ static void draw_main(lv_event_t * e) cell_area.x2 = cell_area.x1 + table->col_w[col] - 1; } - uint32_t col_merge = 0; + uint16_t col_merge = 0; for(col_merge = 0; col_merge + col < table->col_cnt - 1; col_merge++) { lv_table_cell_t * next_cell_data = table->cell_data[cell + col_merge]; @@ -746,7 +751,7 @@ static void draw_main(lv_event_t * e) lv_table_cell_ctrl_t merge_ctrl = (lv_table_cell_ctrl_t) next_cell_data->ctrl; if(merge_ctrl & LV_TABLE_CELL_CTRL_MERGE_RIGHT) { - int32_t offset = table->col_w[col + col_merge + 1]; + lv_coord_t offset = table->col_w[col + col_merge + 1]; if(rtl) cell_area.x1 -= offset; else cell_area.x2 += offset; @@ -804,18 +809,17 @@ static void draw_main(lv_event_t * e) obj->skip_trans = 0; } - rect_dsc_act.base.id1 = row; - rect_dsc_act.base.id2 = col; - label_dsc_act.base.id1 = row; - label_dsc_act.base.id2 = col; + part_draw_dsc.draw_area = &cell_area_border; + part_draw_dsc.id = row * table->col_cnt + col; + lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc); - lv_draw_rect(layer, &rect_dsc_act, &cell_area_border); + lv_draw_rect(draw_ctx, &rect_dsc_act, &cell_area_border); if(table->cell_data[cell]) { - const int32_t cell_left = lv_obj_get_style_pad_left(obj, LV_PART_ITEMS); - const int32_t cell_right = lv_obj_get_style_pad_right(obj, LV_PART_ITEMS); - const int32_t cell_top = lv_obj_get_style_pad_top(obj, LV_PART_ITEMS); - const int32_t cell_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_ITEMS); + const lv_coord_t cell_left = lv_obj_get_style_pad_left(obj, LV_PART_ITEMS); + const lv_coord_t cell_right = lv_obj_get_style_pad_right(obj, LV_PART_ITEMS); + const lv_coord_t cell_top = lv_obj_get_style_pad_top(obj, LV_PART_ITEMS); + const lv_coord_t cell_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_ITEMS); lv_text_flag_t txt_flags = LV_TEXT_FLAG_NONE; lv_area_t txt_area; @@ -825,12 +829,12 @@ static void draw_main(lv_event_t * e) txt_area.y2 = cell_area.y2 - cell_bottom; /*Align the content to the middle if not cropped*/ - bool crop = ctrl & LV_TABLE_CELL_CTRL_TEXT_CROP; + bool crop = ctrl & LV_TABLE_CELL_CTRL_TEXT_CROP ? true : false; if(crop) txt_flags = LV_TEXT_FLAG_EXPAND; - lv_text_get_size(&txt_size, table->cell_data[cell]->txt, label_dsc_def.font, - label_dsc_act.letter_space, label_dsc_act.line_space, - lv_area_get_width(&txt_area), txt_flags); + lv_txt_get_size(&txt_size, table->cell_data[cell]->txt, label_dsc_def.font, + label_dsc_act.letter_space, label_dsc_act.line_space, + lv_area_get_width(&txt_area), txt_flags); /*Align the content to the middle if not cropped*/ if(!crop) { @@ -840,43 +844,44 @@ static void draw_main(lv_event_t * e) lv_area_t label_clip_area; bool label_mask_ok; - label_mask_ok = lv_area_intersect(&label_clip_area, &clip_area, &cell_area); + label_mask_ok = _lv_area_intersect(&label_clip_area, &clip_area, &cell_area); if(label_mask_ok) { - layer->_clip_area = label_clip_area; - label_dsc_act.text = table->cell_data[cell]->txt; - lv_draw_label(layer, &label_dsc_act, &txt_area); - layer->_clip_area = clip_area; + draw_ctx->clip_area = &label_clip_area; + lv_draw_label(draw_ctx, &label_dsc_act, &txt_area, table->cell_data[cell]->txt, NULL); + draw_ctx->clip_area = &clip_area; } } + lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc); + cell += col_merge + 1; col += col_merge; } } - layer->_clip_area = clip_area_ori; + draw_ctx->clip_area = clip_area_ori; } /* Refreshes size of the table starting from @start_row row */ static void refr_size_form_row(lv_obj_t * obj, uint32_t start_row) { - const int32_t cell_pad_left = lv_obj_get_style_pad_left(obj, LV_PART_ITEMS); - const int32_t cell_pad_right = lv_obj_get_style_pad_right(obj, LV_PART_ITEMS); - const int32_t cell_pad_top = lv_obj_get_style_pad_top(obj, LV_PART_ITEMS); - const int32_t cell_pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_ITEMS); + const lv_coord_t cell_pad_left = lv_obj_get_style_pad_left(obj, LV_PART_ITEMS); + const lv_coord_t cell_pad_right = lv_obj_get_style_pad_right(obj, LV_PART_ITEMS); + const lv_coord_t cell_pad_top = lv_obj_get_style_pad_top(obj, LV_PART_ITEMS); + const lv_coord_t cell_pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_ITEMS); - int32_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_ITEMS); - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_ITEMS); + lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_ITEMS); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_ITEMS); const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_ITEMS); - const int32_t minh = lv_obj_get_style_min_height(obj, LV_PART_ITEMS); - const int32_t maxh = lv_obj_get_style_max_height(obj, LV_PART_ITEMS); + const lv_coord_t minh = lv_obj_get_style_min_height(obj, LV_PART_ITEMS); + const lv_coord_t maxh = lv_obj_get_style_max_height(obj, LV_PART_ITEMS); lv_table_t * table = (lv_table_t *)obj; uint32_t i; for(i = start_row; i < table->row_cnt; i++) { - int32_t calculated_height = get_row_height(obj, i, font, letter_space, line_space, - cell_pad_left, cell_pad_right, cell_pad_top, cell_pad_bottom); + lv_coord_t calculated_height = get_row_height(obj, i, font, letter_space, line_space, + cell_pad_left, cell_pad_right, cell_pad_top, cell_pad_bottom); table->row_h[i] = LV_CLAMP(minh, calculated_height, maxh); } @@ -884,28 +889,29 @@ static void refr_size_form_row(lv_obj_t * obj, uint32_t start_row) lv_obj_invalidate(obj); } + static void refr_cell_size(lv_obj_t * obj, uint32_t row, uint32_t col) { - const int32_t cell_pad_left = lv_obj_get_style_pad_left(obj, LV_PART_ITEMS); - const int32_t cell_pad_right = lv_obj_get_style_pad_right(obj, LV_PART_ITEMS); - const int32_t cell_pad_top = lv_obj_get_style_pad_top(obj, LV_PART_ITEMS); - const int32_t cell_pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_ITEMS); + const lv_coord_t cell_pad_left = lv_obj_get_style_pad_left(obj, LV_PART_ITEMS); + const lv_coord_t cell_pad_right = lv_obj_get_style_pad_right(obj, LV_PART_ITEMS); + const lv_coord_t cell_pad_top = lv_obj_get_style_pad_top(obj, LV_PART_ITEMS); + const lv_coord_t cell_pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_ITEMS); - int32_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_ITEMS); - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_ITEMS); + lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_ITEMS); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_ITEMS); const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_ITEMS); - const int32_t minh = lv_obj_get_style_min_height(obj, LV_PART_ITEMS); - const int32_t maxh = lv_obj_get_style_max_height(obj, LV_PART_ITEMS); + const lv_coord_t minh = lv_obj_get_style_min_height(obj, LV_PART_ITEMS); + const lv_coord_t maxh = lv_obj_get_style_max_height(obj, LV_PART_ITEMS); lv_table_t * table = (lv_table_t *)obj; - int32_t calculated_height = get_row_height(obj, row, font, letter_space, line_space, - cell_pad_left, cell_pad_right, cell_pad_top, cell_pad_bottom); + lv_coord_t calculated_height = get_row_height(obj, row, font, letter_space, line_space, + cell_pad_left, cell_pad_right, cell_pad_top, cell_pad_bottom); - int32_t prev_row_size = table->row_h[row]; + lv_coord_t prev_row_size = table->row_h[row]; table->row_h[row] = LV_CLAMP(minh, calculated_height, maxh); - /*If the row height haven't changed invalidate only this cell*/ + /*If the row height havn't changed invalidate only this cell*/ if(prev_row_size == table->row_h[row]) { lv_area_t cell_area; get_cell_area(obj, row, col, &cell_area); @@ -918,19 +924,19 @@ static void refr_cell_size(lv_obj_t * obj, uint32_t row, uint32_t col) } } -static int32_t get_row_height(lv_obj_t * obj, uint32_t row_id, const lv_font_t * font, - int32_t letter_space, int32_t line_space, - int32_t cell_left, int32_t cell_right, int32_t cell_top, int32_t cell_bottom) +static lv_coord_t get_row_height(lv_obj_t * obj, uint16_t row_id, const lv_font_t * font, + lv_coord_t letter_space, lv_coord_t line_space, + lv_coord_t cell_left, lv_coord_t cell_right, lv_coord_t cell_top, lv_coord_t cell_bottom) { lv_table_t * table = (lv_table_t *)obj; - int32_t h_max = lv_font_get_line_height(font) + cell_top + cell_bottom; + lv_coord_t h_max = lv_font_get_line_height(font) + cell_top + cell_bottom; /* Calculate the cell_data index where to start */ - uint32_t row_start = row_id * table->col_cnt; + uint16_t row_start = row_id * table->col_cnt; /* Traverse the cells in the row_id row */ - uint32_t cell; - uint32_t col; + uint16_t cell; + uint16_t col; for(cell = row_start, col = 0; cell < row_start + table->col_cnt; cell++, col++) { lv_table_cell_t * cell_data = table->cell_data[cell]; @@ -938,12 +944,12 @@ static int32_t get_row_height(lv_obj_t * obj, uint32_t row_id, const lv_font_t * continue; } - int32_t txt_w = table->col_w[col]; + lv_coord_t txt_w = table->col_w[col]; /* Traverse the current row from the first until the penultimate column. * Increment the text width if the cell has the LV_TABLE_CELL_CTRL_MERGE_RIGHT control, * exit the traversal when the current cell control is not LV_TABLE_CELL_CTRL_MERGE_RIGHT */ - uint32_t col_merge = 0; + uint16_t col_merge = 0; for(col_merge = 0; col_merge + col < table->col_cnt - 1; col_merge++) { lv_table_cell_t * next_cell_data = table->cell_data[cell + col_merge]; @@ -970,8 +976,8 @@ static int32_t get_row_height(lv_obj_t * obj, uint32_t row_id, const lv_font_t * lv_point_t txt_size; txt_w -= cell_left + cell_right; - lv_text_get_size(&txt_size, table->cell_data[cell]->txt, font, - letter_space, line_space, txt_w, LV_TEXT_FLAG_NONE); + lv_txt_get_size(&txt_size, table->cell_data[cell]->txt, font, + letter_space, line_space, txt_w, LV_TEXT_FLAG_NONE); h_max = LV_MAX(txt_size.y + cell_top + cell_bottom, h_max); /*Skip until one element after the last merged column*/ @@ -983,23 +989,23 @@ static int32_t get_row_height(lv_obj_t * obj, uint32_t row_id, const lv_font_t * return h_max; } -static lv_result_t get_pressed_cell(lv_obj_t * obj, uint32_t * row, uint32_t * col) +static lv_res_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col) { lv_table_t * table = (lv_table_t *)obj; - lv_indev_type_t type = lv_indev_get_type(lv_indev_active()); + lv_indev_type_t type = lv_indev_get_type(lv_indev_get_act()); if(type != LV_INDEV_TYPE_POINTER && type != LV_INDEV_TYPE_BUTTON) { if(col) *col = LV_TABLE_CELL_NONE; if(row) *row = LV_TABLE_CELL_NONE; - return LV_RESULT_INVALID; + return LV_RES_INV; } lv_point_t p; - lv_indev_get_point(lv_indev_active(), &p); + lv_indev_get_point(lv_indev_get_act(), &p); - int32_t tmp; + lv_coord_t tmp; if(col) { - int32_t x = p.x + lv_obj_get_scroll_x(obj); + lv_coord_t x = p.x + lv_obj_get_scroll_x(obj); if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) == LV_BASE_DIR_RTL) { x = obj->coords.x2 - lv_obj_get_style_pad_right(obj, LV_PART_MAIN) - x; @@ -1018,7 +1024,7 @@ static lv_result_t get_pressed_cell(lv_obj_t * obj, uint32_t * row, uint32_t * c } if(row) { - int32_t y = p.y + lv_obj_get_scroll_y(obj);; + lv_coord_t y = p.y + lv_obj_get_scroll_y(obj);; y -= obj->coords.y1; y -= lv_obj_get_style_pad_top(obj, LV_PART_MAIN); @@ -1031,7 +1037,7 @@ static lv_result_t get_pressed_cell(lv_obj_t * obj, uint32_t * row, uint32_t * c } } - return LV_RESULT_OK; + return LV_RES_OK; } /* Returns number of bytes to allocate based on chars configuration */ @@ -1040,9 +1046,9 @@ static size_t get_cell_txt_len(const char * txt) size_t retval = 0; #if LV_USE_ARABIC_PERSIAN_CHARS - retval = sizeof(lv_table_cell_t) + lv_text_ap_calc_bytes_count(txt) + 1; + retval = sizeof(lv_table_cell_t) + _lv_txt_ap_calc_bytes_cnt(txt) + 1; #else - retval = sizeof(lv_table_cell_t) + lv_strlen(txt) + 1; + retval = sizeof(lv_table_cell_t) + strlen(txt) + 1; #endif return retval; @@ -1052,13 +1058,13 @@ static size_t get_cell_txt_len(const char * txt) static void copy_cell_txt(lv_table_cell_t * dst, const char * txt) { #if LV_USE_ARABIC_PERSIAN_CHARS - lv_text_ap_proc(txt, dst->txt); + _lv_txt_ap_proc(txt, dst->txt); #else - lv_strcpy(dst->txt, txt); + strcpy(dst->txt, txt); #endif } -static void get_cell_area(lv_obj_t * obj, uint32_t row, uint32_t col, lv_area_t * area) +static void get_cell_area(lv_obj_t * obj, uint16_t row, uint16_t col, lv_area_t * area) { lv_table_t * table = (lv_table_t *)obj; @@ -1071,7 +1077,7 @@ static void get_cell_area(lv_obj_t * obj, uint32_t row, uint32_t col, lv_area_t bool rtl = lv_obj_get_style_base_dir(obj, LV_PART_MAIN) == LV_BASE_DIR_RTL; if(rtl) { area->x1 += lv_obj_get_scroll_x(obj); - int32_t w = lv_obj_get_width(obj); + lv_coord_t w = lv_obj_get_width(obj); area->x2 = w - area->x1 - lv_obj_get_style_pad_right(obj, 0); area->x1 = area->x2 - table->col_w[col]; } @@ -1093,6 +1099,7 @@ static void get_cell_area(lv_obj_t * obj, uint32_t row, uint32_t col, lv_area_t } + static void scroll_to_selected_cell(lv_obj_t * obj) { lv_table_t * table = (lv_table_t *)obj; diff --git a/L3_Middlewares/LVGL/src/widgets/table/lv_table.h b/L3_Middlewares/LVGL/src/widgets/lv_table.h similarity index 73% rename from L3_Middlewares/LVGL/src/widgets/table/lv_table.h rename to L3_Middlewares/LVGL/src/widgets/lv_table.h index 0d615a1..9c60a76 100644 --- a/L3_Middlewares/LVGL/src/widgets/table/lv_table.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_table.h @@ -13,8 +13,7 @@ extern "C" { /********************* * INCLUDES *********************/ - -#include "../label/lv_label.h" +#include "../lv_conf_internal.h" #if LV_USE_TABLE != 0 @@ -23,6 +22,9 @@ extern "C" { #error "lv_table: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" #endif +#include "../core/lv_obj.h" +#include "lv_label.h" + /********************* * DEFINES *********************/ @@ -33,16 +35,47 @@ LV_EXPORT_CONST_INT(LV_TABLE_CELL_NONE); * TYPEDEFS **********************/ -typedef enum { +enum { LV_TABLE_CELL_CTRL_MERGE_RIGHT = 1 << 0, LV_TABLE_CELL_CTRL_TEXT_CROP = 1 << 1, LV_TABLE_CELL_CTRL_CUSTOM_1 = 1 << 4, LV_TABLE_CELL_CTRL_CUSTOM_2 = 1 << 5, LV_TABLE_CELL_CTRL_CUSTOM_3 = 1 << 6, LV_TABLE_CELL_CTRL_CUSTOM_4 = 1 << 7, -} lv_table_cell_ctrl_t; +}; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_table_class; +typedef uint8_t lv_table_cell_ctrl_t; + +/*Data of cell*/ +typedef struct { + lv_table_cell_ctrl_t ctrl; +#if LV_USE_USER_DATA + void * user_data; /**< Custom user data*/ +#endif + char txt[]; +} lv_table_cell_t; + +/*Data of table*/ +typedef struct { + lv_obj_t obj; + uint16_t col_cnt; + uint16_t row_cnt; + lv_table_cell_t ** cell_data; + lv_coord_t * row_h; + lv_coord_t * col_w; + uint16_t col_act; + uint16_t row_act; +} lv_table_t; + +extern const lv_obj_class_t lv_table_class; + +/** + * `type` field in `lv_obj_draw_part_dsc_t` if `class_p = lv_table_class` + * Used in `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` + */ +typedef enum { + LV_TABLE_DRAW_PART_CELL, /**< A cell*/ +} lv_table_draw_part_type_t; /********************** * GLOBAL PROTOTYPES @@ -67,7 +100,7 @@ lv_obj_t * lv_table_create(lv_obj_t * parent); * @param txt text to display in the cell. It will be copied and saved so this variable is not required after this function call. * @note New roes/columns are added automatically if required */ -void lv_table_set_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col, const char * txt); +void lv_table_set_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col, const char * txt); /** * Set the value of a cell. Memory will be allocated to store the text by the table. @@ -77,22 +110,21 @@ void lv_table_set_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col, const c * @param fmt `printf`-like format * @note New roes/columns are added automatically if required */ -void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint32_t row, uint32_t col, const char * fmt, - ...) LV_FORMAT_ATTRIBUTE(4, 5); +void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, const char * fmt, ...); /** * Set the number of rows * @param obj table pointer to a Table object * @param row_cnt number of rows */ -void lv_table_set_row_count(lv_obj_t * obj, uint32_t row_cnt); +void lv_table_set_row_cnt(lv_obj_t * obj, uint16_t row_cnt); /** * Set the number of columns * @param obj table pointer to a Table object * @param col_cnt number of columns. */ -void lv_table_set_column_count(lv_obj_t * obj, uint32_t col_cnt); +void lv_table_set_col_cnt(lv_obj_t * obj, uint16_t col_cnt); /** * Set the width of a column @@ -100,7 +132,7 @@ void lv_table_set_column_count(lv_obj_t * obj, uint32_t col_cnt); * @param col_id id of the column [0 .. LV_TABLE_COL_MAX -1] * @param w width of the column */ -void lv_table_set_column_width(lv_obj_t * obj, uint32_t col_id, int32_t w); +void lv_table_set_col_width(lv_obj_t * obj, uint16_t col_id, lv_coord_t w); /** * Add control bits to the cell. @@ -109,7 +141,8 @@ void lv_table_set_column_width(lv_obj_t * obj, uint32_t col_id, int32_t w); * @param col id of the column [0 .. col_cnt -1] * @param ctrl OR-ed values from ::lv_table_cell_ctrl_t */ -void lv_table_add_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl); +void lv_table_add_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl); + /** * Clear control bits of the cell. @@ -118,27 +151,18 @@ void lv_table_add_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table * @param col id of the column [0 .. col_cnt -1] * @param ctrl OR-ed values from ::lv_table_cell_ctrl_t */ -void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl); +void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl); +#if LV_USE_USER_DATA /** * Add custom user data to the cell. * @param obj pointer to a Table object * @param row id of the row [0 .. row_cnt -1] * @param col id of the column [0 .. col_cnt -1] - * @param user_data pointer to the new user_data. - * Should be allocated by `lv_malloc`, - * and it will be freed automatically when the table is deleted or - * when the cell is dropped due to lower row or column count. + * @param user_data pointer to the new user_data. It must be allocated by user as it will be freed automatically */ void lv_table_set_cell_user_data(lv_obj_t * obj, uint16_t row, uint16_t col, void * user_data); - -/** - * Set the selected cell - * @param obj pointer to a table object - * @param row id of the cell row to select - * @param col id of the cell column to select - */ -void lv_table_set_selected_cell(lv_obj_t * obj, uint16_t row, uint16_t col); +#endif /*===================== * Getter functions @@ -151,21 +175,21 @@ void lv_table_set_selected_cell(lv_obj_t * obj, uint16_t row, uint16_t col); * @param col id of the column [0 .. col_cnt -1] * @return text in the cell */ -const char * lv_table_get_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col); +const char * lv_table_get_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col); /** * Get the number of rows. * @param obj table pointer to a Table object * @return number of rows. */ -uint32_t lv_table_get_row_count(lv_obj_t * obj); +uint16_t lv_table_get_row_cnt(lv_obj_t * obj); /** * Get the number of columns. * @param obj table pointer to a Table object * @return number of columns. */ -uint32_t lv_table_get_column_count(lv_obj_t * obj); +uint16_t lv_table_get_col_cnt(lv_obj_t * obj); /** * Get the width of a column @@ -173,7 +197,7 @@ uint32_t lv_table_get_column_count(lv_obj_t * obj); * @param col id of the column [0 .. LV_TABLE_COL_MAX -1] * @return width of the column */ -int32_t lv_table_get_column_width(lv_obj_t * obj, uint32_t col); +lv_coord_t lv_table_get_col_width(lv_obj_t * obj, uint16_t col); /** * Get whether a cell has the control bits @@ -183,7 +207,7 @@ int32_t lv_table_get_column_width(lv_obj_t * obj, uint32_t col); * @param ctrl OR-ed values from ::lv_table_cell_ctrl_t * @return true: all control bits are set; false: not all control bits are set */ -bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl); +bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl); /** * Get the selected cell (pressed and or focused) @@ -191,8 +215,9 @@ bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table * @param row pointer to variable to store the selected row (LV_TABLE_CELL_NONE: if no cell selected) * @param col pointer to variable to store the selected column (LV_TABLE_CELL_NONE: if no cell selected) */ -void lv_table_get_selected_cell(lv_obj_t * obj, uint32_t * row, uint32_t * col); +void lv_table_get_selected_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col); +#if LV_USE_USER_DATA /** * Get custom user data to the cell. * @param obj pointer to a Table object @@ -200,6 +225,7 @@ void lv_table_get_selected_cell(lv_obj_t * obj, uint32_t * row, uint32_t * col); * @param col id of the column [0 .. col_cnt -1] */ void * lv_table_get_cell_user_data(lv_obj_t * obj, uint16_t row, uint16_t col); +#endif /********************** * MACROS diff --git a/L3_Middlewares/LVGL/src/widgets/textarea/lv_textarea.c b/L3_Middlewares/LVGL/src/widgets/lv_textarea.c similarity index 73% rename from L3_Middlewares/LVGL/src/widgets/textarea/lv_textarea.c rename to L3_Middlewares/LVGL/src/widgets/lv_textarea.c index 1958371..4d497e6 100644 --- a/L3_Middlewares/LVGL/src/widgets/textarea/lv_textarea.c +++ b/L3_Middlewares/LVGL/src/widgets/lv_textarea.c @@ -6,25 +6,23 @@ /********************* * INCLUDES *********************/ -#include "lv_textarea_private.h" -#include "../label/lv_label_private.h" -#include "../../core/lv_obj_class_private.h" +#include "lv_textarea.h" #if LV_USE_TEXTAREA != 0 -#include "../../core/lv_group.h" -#include "../../core/lv_refr.h" -#include "../../indev/lv_indev.h" -#include "../../draw/lv_draw.h" -#include "../../misc/lv_assert.h" -#include "../../misc/lv_anim_private.h" -#include "../../misc/lv_text_private.h" -#include "../../misc/lv_math.h" -#include "../../stdlib/lv_string.h" +#include +#include "../misc/lv_assert.h" +#include "../core/lv_group.h" +#include "../core/lv_refr.h" +#include "../core/lv_indev.h" +#include "../draw/lv_draw.h" +#include "../misc/lv_anim.h" +#include "../misc/lv_txt.h" +#include "../misc/lv_math.h" /********************* * DEFINES *********************/ -#define MY_CLASS (&lv_textarea_class) +#define MY_CLASS &lv_textarea_class /*Test configuration*/ #ifndef LV_TEXTAREA_DEF_CURSOR_BLINK_TIME @@ -51,102 +49,21 @@ static void lv_textarea_event(const lv_obj_class_t * class_p, lv_event_t * e); static void label_event_cb(lv_event_t * e); static void cursor_blink_anim_cb(void * obj, int32_t show); static void pwd_char_hider_anim(void * obj, int32_t x); -static void pwd_char_hider_anim_completed(lv_anim_t * a); +static void pwd_char_hider_anim_ready(lv_anim_t * a); static void pwd_char_hider(lv_obj_t * obj); static bool char_is_accepted(lv_obj_t * obj, uint32_t c); static void start_cursor_blink(lv_obj_t * obj); static void refr_cursor_area(lv_obj_t * obj); static void update_cursor_position_on_click(lv_event_t * e); -static lv_result_t insert_handler(lv_obj_t * obj, const char * txt); +static lv_res_t insert_handler(lv_obj_t * obj, const char * txt); static void draw_placeholder(lv_event_t * e); static void draw_cursor(lv_event_t * e); static void auto_hide_characters(lv_obj_t * obj); -static void auto_hide_characters_cancel(lv_obj_t * obj); static inline bool is_valid_but_non_printable_char(const uint32_t letter); /********************** * STATIC VARIABLES **********************/ -#if LV_USE_OBJ_PROPERTY -static const lv_property_ops_t properties[] = { - { - .id = LV_PROPERTY_TEXTAREA_TEXT, - .setter = lv_textarea_set_text, - .getter = lv_textarea_get_text, - }, - { - .id = LV_PROPERTY_TEXTAREA_PLACEHOLDER_TEXT, - .setter = lv_textarea_set_placeholder_text, - .getter = lv_textarea_get_placeholder_text, - }, - { - .id = LV_PROPERTY_TEXTAREA_CURSOR_POS, - .setter = lv_textarea_set_cursor_pos, - .getter = lv_textarea_get_cursor_pos, - }, - { - .id = LV_PROPERTY_TEXTAREA_CURSOR_CLICK_POS, - .setter = lv_textarea_set_cursor_click_pos, - .getter = lv_textarea_get_cursor_click_pos, - }, - { - .id = LV_PROPERTY_TEXTAREA_PASSWORD_MODE, - .setter = lv_textarea_set_password_mode, - .getter = lv_textarea_get_password_mode, - }, - { - .id = LV_PROPERTY_TEXTAREA_PASSWORD_BULLET, - .setter = lv_textarea_set_password_bullet, - .getter = lv_textarea_get_password_bullet, - }, - { - .id = LV_PROPERTY_TEXTAREA_ONE_LINE, - .setter = lv_textarea_set_one_line, - .getter = lv_textarea_get_one_line, - }, - { - .id = LV_PROPERTY_TEXTAREA_ACCEPTED_CHARS, - .setter = lv_textarea_set_accepted_chars, - .getter = lv_textarea_get_accepted_chars, - }, - { - .id = LV_PROPERTY_TEXTAREA_MAX_LENGTH, - .setter = lv_textarea_set_max_length, - .getter = lv_textarea_get_max_length, - }, - { - .id = LV_PROPERTY_TEXTAREA_INSERT_REPLACE, - .setter = lv_textarea_set_insert_replace, - .getter = NULL, - }, - { - .id = LV_PROPERTY_TEXTAREA_TEXT_SELECTION, - .setter = lv_textarea_set_text_selection, - .getter = lv_textarea_get_text_selection, - }, - { - .id = LV_PROPERTY_TEXTAREA_PASSWORD_SHOW_TIME, - .setter = lv_textarea_set_password_show_time, - .getter = lv_textarea_get_password_show_time, - }, - { - .id = LV_PROPERTY_TEXTAREA_LABEL, - .setter = NULL, - .getter = lv_textarea_get_label, - }, - { - .id = LV_PROPERTY_TEXTAREA_TEXT_IS_SELECTED, - .setter = NULL, - .getter = lv_textarea_text_is_selected, - }, - { - .id = LV_PROPERTY_TEXTAREA_CURRENT_CHAR, - .setter = NULL, - .getter = lv_textarea_get_current_char, - }, -}; -#endif - const lv_obj_class_t lv_textarea_class = { .constructor_cb = lv_textarea_constructor, .destructor_cb = lv_textarea_destructor, @@ -154,22 +71,8 @@ const lv_obj_class_t lv_textarea_class = { .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, .width_def = LV_DPI_DEF * 2, .height_def = LV_DPI_DEF, - .editable = LV_OBJ_CLASS_EDITABLE_TRUE, .instance_size = sizeof(lv_textarea_t), - .base_class = &lv_obj_class, - .name = "textarea", -#if LV_USE_OBJ_PROPERTY - .prop_index_start = LV_PROPERTY_TEXTAREA_START, - .prop_index_end = LV_PROPERTY_TEXTAREA_END, - .properties = properties, - .properties_count = sizeof(properties) / sizeof(properties[0]), - -#if LV_USE_OBJ_PROPERTY_NAME - .property_names = lv_textarea_property_names, - .names_count = sizeof(lv_textarea_property_names) / sizeof(lv_property_name_t), -#endif - -#endif + .base_class = &lv_obj_class }; static const char * ta_insert_replace; @@ -211,25 +114,14 @@ void lv_textarea_add_char(lv_obj_t * obj, uint32_t c) const char * letter_buf = (char *)&u32_buf; - uint32_t c2 = c; #if LV_BIG_ENDIAN_SYSTEM if(c != 0) while(*letter_buf == 0) ++letter_buf; - - /*The byte order may or may not need to be swapped here to get correct c_uni below, - since lv_textarea_add_text is ordering bytes correctly before calling lv_textarea_add_char. - Assume swapping is needed if MSB is zero. May not be foolproof. */ - if((c != 0) && ((c & 0xff000000) == 0)) { - c2 = ((c >> 24) & 0xff) | /*move byte 3 to byte 0*/ - ((c << 8) & 0xff0000) | /*move byte 1 to byte 2*/ - ((c >> 8) & 0xff00) | /*move byte 2 to byte 1*/ - ((c << 24) & 0xff000000); /*byte 0 to byte 3*/ - } #endif - lv_result_t res = insert_handler(obj, letter_buf); - if(res != LV_RESULT_OK) return; + lv_res_t res = insert_handler(obj, letter_buf); + if(res != LV_RES_OK) return; - uint32_t c_uni = lv_text_encoded_next((const char *)&c2, NULL); + uint32_t c_uni = _lv_txt_encoded_next((const char *)&c, NULL); if(char_is_accepted(obj, c_uni) == false) { LV_LOG_INFO("Character is not accepted by the text area (too long text or not in the accepted list)"); @@ -249,12 +141,12 @@ void lv_textarea_add_char(lv_obj_t * obj, uint32_t c) if(ta->pwd_mode) { /*+2: the new char + \0*/ - size_t realloc_size = lv_strlen(ta->pwd_tmp) + lv_strlen(letter_buf) + 1; - ta->pwd_tmp = lv_realloc(ta->pwd_tmp, realloc_size); + size_t realloc_size = strlen(ta->pwd_tmp) + strlen(letter_buf) + 1; + ta->pwd_tmp = lv_mem_realloc(ta->pwd_tmp, realloc_size); LV_ASSERT_MALLOC(ta->pwd_tmp); if(ta->pwd_tmp == NULL) return; - lv_text_ins(ta->pwd_tmp, ta->cursor.pos, (const char *)letter_buf); + _lv_txt_ins(ta->pwd_tmp, ta->cursor.pos, (const char *)letter_buf); /*Auto hide characters*/ auto_hide_characters(obj); @@ -263,7 +155,7 @@ void lv_textarea_add_char(lv_obj_t * obj, uint32_t c) /*Move the cursor after the new character*/ lv_textarea_set_cursor_pos(obj, lv_textarea_get_cursor_pos(obj) + 1); - lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); + lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); } void lv_textarea_add_text(lv_obj_t * obj, const char * txt) @@ -279,14 +171,14 @@ void lv_textarea_add_text(lv_obj_t * obj, const char * txt) if(lv_textarea_get_accepted_chars(obj) || lv_textarea_get_max_length(obj)) { uint32_t i = 0; while(txt[i] != '\0') { - uint32_t c = lv_text_encoded_next(txt, &i); - lv_textarea_add_char(obj, lv_text_unicode_to_encoded(c)); + uint32_t c = _lv_txt_encoded_next(txt, &i); + lv_textarea_add_char(obj, _lv_txt_unicode_to_encoded(c)); } return; } - lv_result_t res = insert_handler(obj, txt); - if(res != LV_RESULT_OK) return; + lv_res_t res = insert_handler(obj, txt); + if(res != LV_RES_OK) return; /*If the textarea is empty, invalidate it to hide the placeholder*/ if(ta->placeholder_txt) { @@ -299,24 +191,24 @@ void lv_textarea_add_text(lv_obj_t * obj, const char * txt) lv_textarea_clear_selection(obj); if(ta->pwd_mode) { - size_t realloc_size = lv_strlen(ta->pwd_tmp) + lv_strlen(txt) + 1; - ta->pwd_tmp = lv_realloc(ta->pwd_tmp, realloc_size); + size_t realloc_size = strlen(ta->pwd_tmp) + strlen(txt) + 1; + ta->pwd_tmp = lv_mem_realloc(ta->pwd_tmp, realloc_size); LV_ASSERT_MALLOC(ta->pwd_tmp); if(ta->pwd_tmp == NULL) return; - lv_text_ins(ta->pwd_tmp, ta->cursor.pos, txt); + _lv_txt_ins(ta->pwd_tmp, ta->cursor.pos, txt); /*Auto hide characters*/ auto_hide_characters(obj); } /*Move the cursor after the new text*/ - lv_textarea_set_cursor_pos(obj, lv_textarea_get_cursor_pos(obj) + lv_text_get_encoded_length(txt)); + lv_textarea_set_cursor_pos(obj, lv_textarea_get_cursor_pos(obj) + _lv_txt_get_encoded_length(txt)); - lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); + lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); } -void lv_textarea_delete_char(lv_obj_t * obj) +void lv_textarea_del_char(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -327,13 +219,13 @@ void lv_textarea_delete_char(lv_obj_t * obj) char del_buf[2] = {LV_KEY_DEL, '\0'}; - lv_result_t res = insert_handler(obj, del_buf); - if(res != LV_RESULT_OK) return; + lv_res_t res = insert_handler(obj, del_buf); + if(res != LV_RES_OK) return; char * label_txt = lv_label_get_text(ta->label); /*Delete a character*/ - lv_text_cut(label_txt, ta->cursor.pos - 1, 1); + _lv_txt_cut(label_txt, ta->cursor.pos - 1, 1); /*Refresh the label*/ lv_label_set_text(ta->label, label_txt); @@ -346,9 +238,9 @@ void lv_textarea_delete_char(lv_obj_t * obj) } if(ta->pwd_mode) { - lv_text_cut(ta->pwd_tmp, ta->cursor.pos - 1, 1); + _lv_txt_cut(ta->pwd_tmp, ta->cursor.pos - 1, 1); - ta->pwd_tmp = lv_realloc(ta->pwd_tmp, lv_strlen(ta->pwd_tmp) + 1); + ta->pwd_tmp = lv_mem_realloc(ta->pwd_tmp, strlen(ta->pwd_tmp) + 1); LV_ASSERT_MALLOC(ta->pwd_tmp); if(ta->pwd_tmp == NULL) return; } @@ -356,17 +248,17 @@ void lv_textarea_delete_char(lv_obj_t * obj) /*Move the cursor to the place of the deleted character*/ lv_textarea_set_cursor_pos(obj, ta->cursor.pos - 1); - lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); + lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); } -void lv_textarea_delete_char_forward(lv_obj_t * obj) +void lv_textarea_del_char_forward(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); uint32_t cp = lv_textarea_get_cursor_pos(obj); lv_textarea_set_cursor_pos(obj, cp + 1); - if(cp != lv_textarea_get_cursor_pos(obj)) lv_textarea_delete_char(obj); + if(cp != lv_textarea_get_cursor_pos(obj)) lv_textarea_del_char(obj); } /*===================== @@ -392,8 +284,8 @@ void lv_textarea_set_text(lv_obj_t * obj, const char * txt) } uint32_t i = 0; while(txt[i] != '\0') { - uint32_t c = lv_text_encoded_next(txt, &i); - lv_textarea_add_char(obj, lv_text_unicode_to_encoded(c)); + uint32_t c = _lv_txt_encoded_next(txt, &i); + lv_textarea_add_char(obj, _lv_txt_unicode_to_encoded(c)); } } else { @@ -408,15 +300,16 @@ void lv_textarea_set_text(lv_obj_t * obj, const char * txt) } if(ta->pwd_mode) { - lv_free(ta->pwd_tmp); - ta->pwd_tmp = lv_strdup(txt); + ta->pwd_tmp = lv_mem_realloc(ta->pwd_tmp, strlen(txt) + 1); LV_ASSERT_MALLOC(ta->pwd_tmp); if(ta->pwd_tmp == NULL) return; + strcpy(ta->pwd_tmp, txt); - pwd_char_hider(obj); + /*Auto hide characters*/ + auto_hide_characters(obj); } - lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); + lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); } void lv_textarea_set_placeholder_text(lv_obj_t * obj, const char * txt) @@ -426,22 +319,22 @@ void lv_textarea_set_placeholder_text(lv_obj_t * obj, const char * txt) lv_textarea_t * ta = (lv_textarea_t *)obj; - size_t txt_len = lv_strlen(txt); + size_t txt_len = strlen(txt); if((txt_len == 0) && (ta->placeholder_txt)) { - lv_free(ta->placeholder_txt); + lv_mem_free(ta->placeholder_txt); ta->placeholder_txt = NULL; } else { /*Allocate memory for the placeholder_txt text*/ /*NOTE: Using special realloc behavior, malloc-like when data_p is NULL*/ - ta->placeholder_txt = lv_realloc(ta->placeholder_txt, txt_len + 1); + ta->placeholder_txt = lv_mem_realloc(ta->placeholder_txt, txt_len + 1); LV_ASSERT_MALLOC(ta->placeholder_txt); if(ta->placeholder_txt == NULL) { - LV_LOG_ERROR("couldn't allocate memory for placeholder"); + LV_LOG_ERROR("lv_textarea_set_placeholder_text: couldn't allocate memory for placeholder"); return; } - lv_strcpy(ta->placeholder_txt, txt); + strcpy(ta->placeholder_txt, txt); ta->placeholder_txt[txt_len] = '\0'; } @@ -455,7 +348,7 @@ void lv_textarea_set_cursor_pos(lv_obj_t * obj, int32_t pos) lv_textarea_t * ta = (lv_textarea_t *)obj; if((uint32_t)ta->cursor.pos == (uint32_t)pos) return; - uint32_t len = lv_text_get_encoded_length(lv_label_get_text(ta->label)); + uint32_t len = _lv_txt_get_encoded_length(lv_label_get_text(ta->label)); if(pos < 0) pos = len + pos; @@ -473,12 +366,12 @@ void lv_textarea_set_cursor_pos(lv_obj_t * obj, int32_t pos) /*The text area needs to have it's final size to see if the cursor is out of the area or not*/ /*Check the top*/ - int32_t font_h = lv_font_get_line_height(font); + lv_coord_t font_h = lv_font_get_line_height(font); if(cur_pos.y < lv_obj_get_scroll_top(obj)) { lv_obj_scroll_to_y(obj, cur_pos.y, LV_ANIM_ON); } /*Check the bottom*/ - int32_t h = lv_obj_get_content_height(obj); + lv_coord_t h = lv_obj_get_content_height(obj); if(cur_pos.y + font_h - lv_obj_get_scroll_top(obj) > h) { lv_obj_scroll_to_y(obj, cur_pos.y - h + font_h, LV_ANIM_ON); } @@ -488,7 +381,7 @@ void lv_textarea_set_cursor_pos(lv_obj_t * obj, int32_t pos) lv_obj_scroll_to_x(obj, cur_pos.x, LV_ANIM_ON); } /*Check the right*/ - int32_t w = lv_obj_get_content_width(obj); + lv_coord_t w = lv_obj_get_content_width(obj); if(cur_pos.x + font_h - lv_obj_get_scroll_left(obj) > w) { lv_obj_scroll_to_x(obj, cur_pos.x - w + font_h, LV_ANIM_ON); } @@ -519,11 +412,14 @@ void lv_textarea_set_password_mode(lv_obj_t * obj, bool en) /*Pwd mode is now enabled*/ if(en) { char * txt = lv_label_get_text(ta->label); - lv_free(ta->pwd_tmp); - ta->pwd_tmp = lv_strdup(txt); + size_t len = strlen(txt); + + ta->pwd_tmp = lv_mem_alloc(len + 1); LV_ASSERT_MALLOC(ta->pwd_tmp); if(ta->pwd_tmp == NULL) return; + strcpy(ta->pwd_tmp, txt); + pwd_char_hider(obj); lv_textarea_clear_selection(obj); @@ -532,7 +428,7 @@ void lv_textarea_set_password_mode(lv_obj_t * obj, bool en) else { lv_textarea_clear_selection(obj); lv_label_set_text(ta->label, ta->pwd_tmp); - lv_free(ta->pwd_tmp); + lv_mem_free(ta->pwd_tmp); ta->pwd_tmp = NULL; } @@ -547,26 +443,26 @@ void lv_textarea_set_password_bullet(lv_obj_t * obj, const char * bullet) lv_textarea_t * ta = (lv_textarea_t *)obj; if(!bullet && (ta->pwd_bullet)) { - lv_free(ta->pwd_bullet); + lv_mem_free(ta->pwd_bullet); ta->pwd_bullet = NULL; } else { - size_t txt_len = lv_strlen(bullet); + size_t txt_len = strlen(bullet); /*Allocate memory for the pwd_bullet text*/ /*NOTE: Using special realloc behavior, malloc-like when data_p is NULL*/ - ta->pwd_bullet = lv_realloc(ta->pwd_bullet, txt_len + 1); + ta->pwd_bullet = lv_mem_realloc(ta->pwd_bullet, txt_len + 1); LV_ASSERT_MALLOC(ta->pwd_bullet); if(ta->pwd_bullet == NULL) { - LV_LOG_ERROR("couldn't allocate memory for bullet"); + LV_LOG_ERROR("lv_textarea_set_password_bullet: couldn't allocate memory for bullet"); return; } - lv_memcpy(ta->pwd_bullet, bullet, txt_len); + strcpy(ta->pwd_bullet, bullet); ta->pwd_bullet[txt_len] = '\0'; } - pwd_char_hider(obj); + lv_obj_invalidate(obj); } void lv_textarea_set_one_line(lv_obj_t * obj, bool en) @@ -577,8 +473,8 @@ void lv_textarea_set_one_line(lv_obj_t * obj, bool en) if(ta->one_line == en) return; ta->one_line = en ? 1U : 0U; - int32_t width = en ? LV_SIZE_CONTENT : lv_pct(100); - int32_t min_width_value = en ? lv_pct(100) : 0; + lv_coord_t width = en ? LV_SIZE_CONTENT : lv_pct(100); + lv_coord_t min_width_value = en ? lv_pct(100) : 0; lv_obj_set_width(ta->label, width); lv_obj_set_style_min_width(ta->label, min_width_value, 0); @@ -635,13 +531,12 @@ void lv_textarea_set_text_selection(lv_obj_t * obj, bool en) #endif } -void lv_textarea_set_password_show_time(lv_obj_t * obj, uint32_t time) +void lv_textarea_set_password_show_time(lv_obj_t * obj, uint16_t time) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_textarea_t * ta = (lv_textarea_t *)obj; ta->pwd_show_time = time; - pwd_char_hider(obj); } void lv_textarea_set_align(lv_obj_t * obj, lv_text_align_t align) @@ -714,7 +609,7 @@ bool lv_textarea_get_cursor_click_pos(lv_obj_t * obj) LV_ASSERT_OBJ(obj, MY_CLASS); lv_textarea_t * ta = (lv_textarea_t *)obj; - return ta->cursor.click_pos; + return ta->cursor.click_pos ? true : false; } bool lv_textarea_get_password_mode(const lv_obj_t * obj) @@ -800,7 +695,7 @@ bool lv_textarea_get_text_selection(lv_obj_t * obj) #endif } -uint32_t lv_textarea_get_password_show_time(lv_obj_t * obj) +uint16_t lv_textarea_get_password_show_time(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -809,19 +704,6 @@ uint32_t lv_textarea_get_password_show_time(lv_obj_t * obj) return ta->pwd_show_time; } -uint32_t lv_textarea_get_current_char(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - const char * txt = lv_textarea_get_text(obj); - lv_textarea_t * ta = (lv_textarea_t *)obj; - uint32_t pos = ta->cursor.pos; - if(lv_text_get_encoded_length(txt) >= pos && pos > 0) - return lv_text_encoded_prev(txt, &pos); - else - return 0; -} - /*===================== * Other functions *====================*/ @@ -835,8 +717,8 @@ void lv_textarea_clear_selection(lv_obj_t * obj) if(lv_label_get_text_selection_start(ta->label) != LV_DRAW_LABEL_NO_TXT_SEL || lv_label_get_text_selection_end(ta->label) != LV_DRAW_LABEL_NO_TXT_SEL) { - lv_label_set_text_selection_start(ta->label, LV_DRAW_LABEL_NO_TXT_SEL); - lv_label_set_text_selection_end(ta->label, LV_DRAW_LABEL_NO_TXT_SEL); + lv_label_set_text_sel_start(ta->label, LV_DRAW_LABEL_NO_TXT_SEL); + lv_label_set_text_sel_end(ta->label, LV_DRAW_LABEL_NO_TXT_SEL); } #else LV_UNUSED(obj); /*Unused*/ @@ -875,18 +757,18 @@ void lv_textarea_cursor_down(lv_obj_t * obj) /*Increment the y with one line and keep the valid x*/ - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - int32_t font_h = lv_font_get_line_height(font); + lv_coord_t font_h = lv_font_get_line_height(font); pos.y += font_h + line_space + 1; pos.x = ta->cursor.valid_x; /*Do not go below the last line*/ if(pos.y < lv_obj_get_height(ta->label)) { /*Get the letter index on the new cursor position and set it*/ - uint32_t new_cur_pos = lv_label_get_letter_on(ta->label, &pos, true); + uint32_t new_cur_pos = lv_label_get_letter_on(ta->label, &pos); - int32_t cur_valid_x_tmp = ta->cursor.valid_x; /*Cursor position set overwrites the valid position*/ + lv_coord_t cur_valid_x_tmp = ta->cursor.valid_x; /*Cursor position set overwrites the valid position*/ lv_textarea_set_cursor_pos(obj, new_cur_pos); ta->cursor.valid_x = cur_valid_x_tmp; } @@ -903,15 +785,15 @@ void lv_textarea_cursor_up(lv_obj_t * obj) lv_label_get_letter_pos(ta->label, lv_textarea_get_cursor_pos(obj), &pos); /*Decrement the y with one line and keep the valid x*/ - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - int32_t font_h = lv_font_get_line_height(font); + lv_coord_t font_h = lv_font_get_line_height(font); pos.y -= font_h + line_space - 1; pos.x = ta->cursor.valid_x; /*Get the letter index on the new cursor position and set it*/ - uint32_t new_cur_pos = lv_label_get_letter_on(ta->label, &pos, true); - int32_t cur_valid_x_tmp = ta->cursor.valid_x; /*Cursor position set overwrites the valid position*/ + uint32_t new_cur_pos = lv_label_get_letter_on(ta->label, &pos); + lv_coord_t cur_valid_x_tmp = ta->cursor.valid_x; /*Cursor position set overwrites the valid position*/ lv_textarea_set_cursor_pos(obj, new_cur_pos); ta->cursor.valid_x = cur_valid_x_tmp; } @@ -950,8 +832,6 @@ static void lv_textarea_constructor(const lv_obj_class_t * class_p, lv_obj_t * o lv_label_set_text(ta->label, ""); lv_obj_add_event_cb(ta->label, label_event_cb, LV_EVENT_ALL, NULL); lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_WITH_ARROW); - lv_textarea_set_cursor_pos(obj, 0); start_cursor_blink(obj); @@ -965,15 +845,15 @@ static void lv_textarea_destructor(const lv_obj_class_t * class_p, lv_obj_t * ob lv_textarea_t * ta = (lv_textarea_t *)obj; if(ta->pwd_tmp != NULL) { - lv_free(ta->pwd_tmp); + lv_mem_free(ta->pwd_tmp); ta->pwd_tmp = NULL; } if(ta->pwd_bullet != NULL) { - lv_free(ta->pwd_bullet); + lv_mem_free(ta->pwd_bullet); ta->pwd_bullet = NULL; } if(ta->placeholder_txt != NULL) { - lv_free(ta->placeholder_txt); + lv_mem_free(ta->placeholder_txt); ta->placeholder_txt = NULL; } } @@ -982,13 +862,13 @@ static void lv_textarea_event(const lv_obj_class_t * class_p, lv_event_t * e) { LV_UNUSED(class_p); - lv_result_t res; + lv_res_t res; /*Call the ancestor's event handler*/ res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; + if(res != LV_RES_OK) return; lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); if(code == LV_EVENT_FOCUSED) { start_cursor_blink(obj); @@ -1004,15 +884,15 @@ static void lv_textarea_event(const lv_obj_class_t * class_p, lv_event_t * e) else if(c == LV_KEY_DOWN) lv_textarea_cursor_down(obj); else if(c == LV_KEY_BACKSPACE) - lv_textarea_delete_char(obj); + lv_textarea_del_char(obj); else if(c == LV_KEY_DEL) - lv_textarea_delete_char_forward(obj); + lv_textarea_del_char_forward(obj); else if(c == LV_KEY_HOME) lv_textarea_set_cursor_pos(obj, 0); else if(c == LV_KEY_END) lv_textarea_set_cursor_pos(obj, LV_TEXTAREA_CURSOR_LAST); else if(c == LV_KEY_ENTER && lv_textarea_get_one_line(obj)) - lv_obj_send_event(obj, LV_EVENT_READY, NULL); + lv_event_send(obj, LV_EVENT_READY, NULL); else { lv_textarea_add_char(obj, c); } @@ -1032,7 +912,7 @@ static void lv_textarea_event(const lv_obj_class_t * class_p, lv_event_t * e) static void label_event_cb(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * label = lv_event_get_current_target(e); + lv_obj_t * label = lv_event_get_target(e); lv_obj_t * ta = lv_obj_get_parent(label); if(code == LV_EVENT_STYLE_CHANGED || code == LV_EVENT_SIZE_CHANGED) { @@ -1042,6 +922,8 @@ static void label_event_cb(lv_event_t * e) } } + + /** * Called to blink the cursor * @param ta pointer to a text area @@ -1079,7 +961,7 @@ static void pwd_char_hider_anim(void * obj, int32_t x) * Call when an animation is ready to convert all characters to '*' * @param a pointer to the animation */ -static void pwd_char_hider_anim_completed(lv_anim_t * a) +static void pwd_char_hider_anim_ready(lv_anim_t * a) { lv_obj_t * obj = a->var; pwd_char_hider(obj); @@ -1098,12 +980,12 @@ static void pwd_char_hider(lv_obj_t * obj) /* When ta->label is empty we get 0 back */ char * txt = lv_label_get_text(ta->label); - uint32_t enc_len = lv_text_get_encoded_length(txt); + uint32_t enc_len = _lv_txt_get_encoded_length(txt); if(enc_len == 0) return; const char * bullet = lv_textarea_get_password_bullet(obj); - const size_t bullet_len = lv_strlen(bullet); - char * txt_tmp = lv_malloc(enc_len * bullet_len + 1); + const size_t bullet_len = strlen(bullet); + char * txt_tmp = lv_mem_buf_get(enc_len * bullet_len + 1); uint32_t i; for(i = 0; i < enc_len; i++) { @@ -1112,9 +994,7 @@ static void pwd_char_hider(lv_obj_t * obj) txt_tmp[i * bullet_len] = '\0'; lv_label_set_text(ta->label, txt_tmp); - lv_free(txt_tmp); - - auto_hide_characters_cancel(obj); + lv_mem_buf_release(txt_tmp); refr_cursor_area(obj); } @@ -1130,7 +1010,7 @@ static bool char_is_accepted(lv_obj_t * obj, uint32_t c) lv_textarea_t * ta = (lv_textarea_t *)obj; /*Too many characters?*/ - if(ta->max_length > 0 && lv_text_get_encoded_length(lv_textarea_get_text(obj)) >= ta->max_length) { + if(ta->max_length > 0 && _lv_txt_get_encoded_length(lv_textarea_get_text(obj)) >= ta->max_length) { return false; } @@ -1139,7 +1019,7 @@ static bool char_is_accepted(lv_obj_t * obj, uint32_t c) uint32_t i = 0; while(ta->accepted_chars[i] != '\0') { - uint32_t a = lv_text_encoded_next(ta->accepted_chars, &i); + uint32_t a = _lv_txt_encoded_next(ta->accepted_chars, &i); if(a == c) return true; /*Accepted*/ } @@ -1149,9 +1029,9 @@ static bool char_is_accepted(lv_obj_t * obj, uint32_t c) static void start_cursor_blink(lv_obj_t * obj) { lv_textarea_t * ta = (lv_textarea_t *)obj; - uint32_t blink_time = lv_obj_get_style_anim_duration(obj, LV_PART_CURSOR); + uint32_t blink_time = lv_obj_get_style_anim_time(obj, LV_PART_CURSOR); if(blink_time == 0) { - lv_anim_delete(obj, cursor_blink_anim_cb); + lv_anim_del(obj, cursor_blink_anim_cb); ta->cursor.show = 1; } else { @@ -1159,8 +1039,8 @@ static void start_cursor_blink(lv_obj_t * obj) lv_anim_init(&a); lv_anim_set_var(&a, ta); lv_anim_set_exec_cb(&a, cursor_blink_anim_cb); - lv_anim_set_duration(&a, blink_time); - lv_anim_set_playback_duration(&a, blink_time); + lv_anim_set_time(&a, blink_time); + lv_anim_set_playback_time(&a, blink_time); lv_anim_set_values(&a, 1, 0); lv_anim_set_path_cb(&a, lv_anim_path_step); lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); @@ -1173,22 +1053,22 @@ static void refr_cursor_area(lv_obj_t * obj) lv_textarea_t * ta = (lv_textarea_t *)obj; const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN); - int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); + lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); uint32_t cur_pos = lv_textarea_get_cursor_pos(obj); const char * txt = lv_label_get_text(ta->label); - uint32_t byte_pos = lv_text_encoded_get_byte_id(txt, cur_pos); - uint32_t letter = lv_text_encoded_next(&txt[byte_pos], NULL); + uint32_t byte_pos = _lv_txt_encoded_get_byte_id(txt, cur_pos); + uint32_t letter = _lv_txt_encoded_next(&txt[byte_pos], NULL); /* Letter height and width */ - const int32_t letter_h = lv_font_get_line_height(font); + const lv_coord_t letter_h = lv_font_get_line_height(font); /*Set letter_w (set not 0 on non printable but valid chars)*/ uint32_t letter_space = letter; if(is_valid_but_non_printable_char(letter)) { letter_space = ' '; } - int32_t letter_w = lv_font_get_glyph_width(font, letter_space, IGNORE_KERNING); + lv_coord_t letter_w = lv_font_get_glyph_width(font, letter_space, IGNORE_KERNING); lv_point_t letter_pos; lv_label_get_letter_pos(ta->label, cur_pos, &letter_pos); @@ -1203,8 +1083,8 @@ static void refr_cursor_area(lv_obj_t * obj) letter_pos.y += letter_h + line_space; if(letter != '\0') { - byte_pos += lv_text_encoded_size(&txt[byte_pos]); - letter = lv_text_encoded_next(&txt[byte_pos], NULL); + byte_pos += _lv_txt_encoded_size(&txt[byte_pos]); + letter = _lv_txt_encoded_next(&txt[byte_pos], NULL); } uint32_t tmp = letter; @@ -1218,11 +1098,11 @@ static void refr_cursor_area(lv_obj_t * obj) ta->cursor.txt_byte_pos = byte_pos; /*Calculate the cursor according to its type*/ - int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_CURSOR); - int32_t top = lv_obj_get_style_pad_top(obj, LV_PART_CURSOR) + border_width; - int32_t bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_CURSOR) + border_width; - int32_t left = lv_obj_get_style_pad_left(obj, LV_PART_CURSOR) + border_width; - int32_t right = lv_obj_get_style_pad_right(obj, LV_PART_CURSOR) + border_width; + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_CURSOR); + lv_coord_t top = lv_obj_get_style_pad_top(obj, LV_PART_CURSOR) + border_width; + lv_coord_t bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_CURSOR) + border_width; + lv_coord_t left = lv_obj_get_style_pad_left(obj, LV_PART_CURSOR) + border_width; + lv_coord_t right = lv_obj_get_style_pad_right(obj, LV_PART_CURSOR) + border_width; lv_area_t cur_area; cur_area.x1 = letter_pos.x - left; @@ -1251,10 +1131,10 @@ static void refr_cursor_area(lv_obj_t * obj) static void update_cursor_position_on_click(lv_event_t * e) { - lv_indev_t * click_source = lv_indev_active(); + lv_indev_t * click_source = lv_indev_get_act(); if(click_source == NULL) return; - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_textarea_t * ta = (lv_textarea_t *)obj; if(ta->cursor.click_pos == 0) return; @@ -1277,8 +1157,8 @@ static void update_cursor_position_on_click(lv_event_t * e) const lv_event_code_t code = lv_event_get_code(e); - int32_t label_width = lv_obj_get_width(ta->label); - uint32_t char_id_at_click = 0; + lv_coord_t label_width = lv_obj_get_width(ta->label); + uint16_t char_id_at_click = 0; #if LV_LABEL_TEXT_SELECTION lv_label_t * label_data = (lv_label_t *)ta->label; @@ -1294,7 +1174,7 @@ static void update_cursor_position_on_click(lv_event_t * e) click_outside_label = true; } else { - char_id_at_click = lv_label_get_letter_on(ta->label, &rel_pos, true); + char_id_at_click = lv_label_get_letter_on(ta->label, &rel_pos); click_outside_label = !lv_label_is_char_under_pos(ta->label, &rel_pos); } @@ -1304,7 +1184,7 @@ static void update_cursor_position_on_click(lv_event_t * e) ta->sel_start = char_id_at_click; ta->sel_end = LV_LABEL_TEXT_SELECTION_OFF; ta->text_sel_in_prog = 1; - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN); + lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN); } else if(ta->text_sel_in_prog && code == LV_EVENT_PRESSING) { /*Input device may be moving. Store the end position*/ @@ -1358,40 +1238,40 @@ static void update_cursor_position_on_click(lv_event_t * e) char_id_at_click = LV_TEXTAREA_CURSOR_LAST; } else { - char_id_at_click = lv_label_get_letter_on(ta->label, &rel_pos, true); + char_id_at_click = lv_label_get_letter_on(ta->label, &rel_pos); } if(code == LV_EVENT_PRESSED) lv_textarea_set_cursor_pos(obj, char_id_at_click); #endif } -/* Returns LV_RESULT_OK when no operation were performed - * Returns LV_RESULT_INVALID when a user defined text was inserted */ -static lv_result_t insert_handler(lv_obj_t * obj, const char * txt) +/* Returns LV_RES_OK when no operation were performed + * Returns LV_RES_INV when a user defined text was inserted */ +static lv_res_t insert_handler(lv_obj_t * obj, const char * txt) { ta_insert_replace = NULL; - lv_obj_send_event(obj, LV_EVENT_INSERT, (char *)txt); + lv_event_send(obj, LV_EVENT_INSERT, (char *)txt); /* Drop txt if insert replace is set to '\0' */ if(ta_insert_replace && ta_insert_replace[0] == '\0') - return LV_RESULT_INVALID; + return LV_RES_INV; if(ta_insert_replace) { /*Add the replaced text directly it's different from the original*/ - if(lv_strcmp(ta_insert_replace, txt)) { + if(strcmp(ta_insert_replace, txt)) { lv_textarea_add_text(obj, ta_insert_replace); - return LV_RESULT_INVALID; + return LV_RES_INV; } } - return LV_RESULT_OK; + return LV_RES_OK; } static void draw_placeholder(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_textarea_t * ta = (lv_textarea_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); const char * txt = lv_label_get_text(ta->label); /*Draw the place holder*/ @@ -1402,27 +1282,21 @@ static void draw_placeholder(lv_event_t * e) if(ta->one_line) ph_dsc.flag |= LV_TEXT_FLAG_EXPAND; - int32_t left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); - int32_t top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); - int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); + lv_coord_t left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + lv_coord_t top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); lv_area_t ph_coords; lv_area_copy(&ph_coords, &obj->coords); - ph_coords.x1 += left + border_width; - ph_coords.x2 -= right + border_width; - ph_coords.y1 += top + border_width; - ph_coords.y2 -= bottom + border_width; - ph_dsc.text = ta->placeholder_txt; - lv_draw_label(layer, &ph_dsc, &ph_coords); + lv_area_move(&ph_coords, left + border_width, top + border_width); + lv_draw_label(draw_ctx, &ph_dsc, &ph_coords, ta->placeholder_txt, NULL); } } static void draw_cursor(lv_event_t * e) { - lv_obj_t * obj = lv_event_get_current_target(e); + lv_obj_t * obj = lv_event_get_target(e); lv_textarea_t * ta = (lv_textarea_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); + lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); const char * txt = lv_label_get_text(ta->label); if(ta->cursor.show == 0) return; @@ -1435,18 +1309,19 @@ static void draw_cursor(lv_event_t * e) lv_area_t cur_area; lv_area_copy(&cur_area, &ta->cursor.area); + cur_area.x1 += ta->label->coords.x1; cur_area.y1 += ta->label->coords.y1; cur_area.x2 += ta->label->coords.x1; cur_area.y2 += ta->label->coords.y1; - lv_draw_rect(layer, &cur_dsc, &cur_area); + lv_draw_rect(draw_ctx, &cur_dsc, &cur_area); - int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_CURSOR); - int32_t left = lv_obj_get_style_pad_left(obj, LV_PART_CURSOR) + border_width; - int32_t top = lv_obj_get_style_pad_top(obj, LV_PART_CURSOR) + border_width; + lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_CURSOR); + lv_coord_t left = lv_obj_get_style_pad_left(obj, LV_PART_CURSOR) + border_width; + lv_coord_t top = lv_obj_get_style_pad_top(obj, LV_PART_CURSOR) + border_width; char letter_buf[8] = {0}; - lv_memcpy(letter_buf, &txt[ta->cursor.txt_byte_pos], lv_text_encoded_size(&txt[ta->cursor.txt_byte_pos])); + lv_memcpy(letter_buf, &txt[ta->cursor.txt_byte_pos], _lv_txt_encoded_size(&txt[ta->cursor.txt_byte_pos])); cur_area.x1 += left; cur_area.y1 += top; @@ -1458,10 +1333,8 @@ static void draw_cursor(lv_event_t * e) lv_draw_label_dsc_t cur_label_dsc; lv_draw_label_dsc_init(&cur_label_dsc); lv_obj_init_draw_label_dsc(obj, LV_PART_CURSOR, &cur_label_dsc); - if(cur_dsc.bg_opa > LV_OPA_MIN || !lv_color_eq(cur_label_dsc.color, label_color)) { - cur_label_dsc.text = letter_buf; - cur_label_dsc.text_local = true; - lv_draw_label(layer, &cur_label_dsc, &cur_area); + if(cur_dsc.bg_opa > LV_OPA_MIN || cur_label_dsc.color.full != label_color.full) { + lv_draw_label(draw_ctx, &cur_label_dsc, &cur_area, letter_buf, NULL); } } @@ -1477,19 +1350,14 @@ static void auto_hide_characters(lv_obj_t * obj) lv_anim_init(&a); lv_anim_set_var(&a, ta); lv_anim_set_exec_cb(&a, pwd_char_hider_anim); - lv_anim_set_duration(&a, ta->pwd_show_time); + lv_anim_set_time(&a, ta->pwd_show_time); lv_anim_set_values(&a, 0, 1); lv_anim_set_path_cb(&a, lv_anim_path_step); - lv_anim_set_completed_cb(&a, pwd_char_hider_anim_completed); + lv_anim_set_ready_cb(&a, pwd_char_hider_anim_ready); lv_anim_start(&a); } } -static void auto_hide_characters_cancel(lv_obj_t * obj) -{ - lv_anim_delete(obj, pwd_char_hider_anim); -} - static inline bool is_valid_but_non_printable_char(const uint32_t letter) { if(letter == '\0' || letter == '\n' || letter == '\r') { diff --git a/L3_Middlewares/LVGL/src/widgets/textarea/lv_textarea.h b/L3_Middlewares/LVGL/src/widgets/lv_textarea.h similarity index 79% rename from L3_Middlewares/LVGL/src/widgets/textarea/lv_textarea.h rename to L3_Middlewares/LVGL/src/widgets/lv_textarea.h index 0804029..4b3289b 100644 --- a/L3_Middlewares/LVGL/src/widgets/textarea/lv_textarea.h +++ b/L3_Middlewares/LVGL/src/widgets/lv_textarea.h @@ -13,15 +13,18 @@ extern "C" { /********************* * INCLUDES *********************/ -#include "../label/lv_label.h" +#include "../lv_conf_internal.h" #if LV_USE_TEXTAREA != 0 /*Testing of dependencies*/ #if LV_USE_LABEL == 0 -#error "lv_textarea: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" +#error "lv_ta: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1)" #endif +#include "../core/lv_obj.h" +#include "lv_label.h" + /********************* * DEFINES *********************/ @@ -33,28 +36,37 @@ LV_EXPORT_CONST_INT(LV_TEXTAREA_CURSOR_LAST); * TYPEDEFS **********************/ -#if LV_USE_OBJ_PROPERTY -enum { - LV_PROPERTY_ID(TEXTAREA, TEXT, LV_PROPERTY_TYPE_TEXT, 0), - LV_PROPERTY_ID(TEXTAREA, PLACEHOLDER_TEXT, LV_PROPERTY_TYPE_TEXT, 1), - LV_PROPERTY_ID(TEXTAREA, CURSOR_POS, LV_PROPERTY_TYPE_INT, 2), - LV_PROPERTY_ID(TEXTAREA, CURSOR_CLICK_POS, LV_PROPERTY_TYPE_INT, 3), - LV_PROPERTY_ID(TEXTAREA, PASSWORD_MODE, LV_PROPERTY_TYPE_INT, 4), - LV_PROPERTY_ID(TEXTAREA, PASSWORD_BULLET, LV_PROPERTY_TYPE_TEXT, 5), - LV_PROPERTY_ID(TEXTAREA, ONE_LINE, LV_PROPERTY_TYPE_BOOL, 6), - LV_PROPERTY_ID(TEXTAREA, ACCEPTED_CHARS, LV_PROPERTY_TYPE_TEXT, 7), - LV_PROPERTY_ID(TEXTAREA, MAX_LENGTH, LV_PROPERTY_TYPE_INT, 8), - LV_PROPERTY_ID(TEXTAREA, INSERT_REPLACE, LV_PROPERTY_TYPE_TEXT, 9), - LV_PROPERTY_ID(TEXTAREA, TEXT_SELECTION, LV_PROPERTY_TYPE_BOOL, 10), - LV_PROPERTY_ID(TEXTAREA, PASSWORD_SHOW_TIME, LV_PROPERTY_TYPE_INT, 11), - LV_PROPERTY_ID(TEXTAREA, LABEL, LV_PROPERTY_TYPE_OBJ, 12), - LV_PROPERTY_ID(TEXTAREA, TEXT_IS_SELECTED, LV_PROPERTY_TYPE_INT, 13), - LV_PROPERTY_ID(TEXTAREA, CURRENT_CHAR, LV_PROPERTY_TYPE_INT, 14), - LV_PROPERTY_TEXTAREA_END, -}; +/*Data of text area*/ +typedef struct { + lv_obj_t obj; + lv_obj_t * label; /*Label of the text area*/ + char * placeholder_txt; /*Place holder label. only visible if text is an empty string*/ + char * pwd_tmp; /*Used to store the original text in password mode*/ + char * pwd_bullet; /*Replacement characters displayed in password mode*/ + const char * accepted_chars; /*Only these characters will be accepted. NULL: accept all*/ + uint32_t max_length; /*The max. number of characters. 0: no limit*/ + uint16_t pwd_show_time; /*Time to show characters in password mode before change them to '*'*/ + struct { + lv_coord_t valid_x; /*Used when stepping up/down to a shorter line. + *(Used by the library)*/ + uint32_t pos; /*The current cursor position + *(0: before 1st letter; 1: before 2nd letter ...)*/ + lv_area_t area; /*Cursor area relative to the Text Area*/ + uint32_t txt_byte_pos; /*Byte index of the letter after (on) the cursor*/ + uint8_t show : 1; /*Cursor is visible now or not (Handled by the library)*/ + uint8_t click_pos : 1; /*1: Enable positioning the cursor by clicking the text area*/ + } cursor; +#if LV_LABEL_TEXT_SELECTION + uint32_t sel_start; /*Temporary values for text selection*/ + uint32_t sel_end; + uint8_t text_sel_in_prog : 1; /*User is in process of selecting*/ + uint8_t text_sel_en : 1; /*Text can be selected on this text area*/ #endif + uint8_t pwd_mode : 1; /*Replace characters with '*'*/ + uint8_t one_line : 1; /*One line mode (ignore line breaks)*/ +} lv_textarea_t; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_textarea_class; +extern const lv_obj_class_t lv_textarea_class; enum { LV_PART_TEXTAREA_PLACEHOLDER = LV_PART_CUSTOM_FIRST, @@ -77,7 +89,7 @@ lv_obj_t * lv_textarea_create(lv_obj_t * parent); /** * Insert a character to the current cursor position. - * To add a wide char, e.g. 'Á' use `lv_text_encoded_conv_wc('Á')` + * To add a wide char, e.g. 'Á' use `_lv_txt_encoded_conv_wc('Á')` * @param obj pointer to a text area object * @param c a character (e.g. 'a') */ @@ -94,13 +106,13 @@ void lv_textarea_add_text(lv_obj_t * obj, const char * txt); * Delete a the left character from the current cursor position * @param obj pointer to a text area object */ -void lv_textarea_delete_char(lv_obj_t * obj); +void lv_textarea_del_char(lv_obj_t * obj); /** * Delete the right character from the current cursor position * @param obj pointer to a text area object */ -void lv_textarea_delete_char_forward(lv_obj_t * obj); +void lv_textarea_del_char_forward(lv_obj_t * obj); /*===================== * Setter functions @@ -172,7 +184,7 @@ void lv_textarea_set_accepted_chars(lv_obj_t * obj, const char * list); void lv_textarea_set_max_length(lv_obj_t * obj, uint32_t num); /** - * In `LV_EVENT_INSERT` the text which planned to be inserted can be replaced by another text. + * In `LV_EVENT_INSERT` the text which planned to be inserted can be replaced by an other text. * It can be used to add automatic formatting to the text area. * @param obj pointer to a text area object * @param txt pointer to a new string to insert. If `""` no text will be added. @@ -192,10 +204,10 @@ void lv_textarea_set_text_selection(lv_obj_t * obj, bool en); * @param obj pointer to a text area object * @param time show time in milliseconds. 0: hide immediately. */ -void lv_textarea_set_password_show_time(lv_obj_t * obj, uint32_t time); +void lv_textarea_set_password_show_time(lv_obj_t * obj, uint16_t time); /** - * @deprecated Use the normal text_align style property instead + * Deprecated: use the normal text_align style property instead * Set the label's alignment. * It sets where the label is aligned (in one line mode it can be smaller than the text area) * and how the lines of the area align in case of multiline text area @@ -297,14 +309,7 @@ bool lv_textarea_get_text_selection(lv_obj_t * obj); * @param obj pointer to a text area object * @return show time in milliseconds. 0: hide immediately. */ -uint32_t lv_textarea_get_password_show_time(lv_obj_t * obj); - -/** - * Get a the character from the current cursor position - * @param obj pointer to a text area object - * @return a the character or 0 - */ -uint32_t lv_textarea_get_current_char(lv_obj_t * obj); +uint16_t lv_textarea_get_password_show_time(lv_obj_t * obj); /*===================== * Other functions diff --git a/L3_Middlewares/LVGL/src/widgets/lv_widgets.mk b/L3_Middlewares/LVGL/src/widgets/lv_widgets.mk new file mode 100644 index 0000000..4e62dc5 --- /dev/null +++ b/L3_Middlewares/LVGL/src/widgets/lv_widgets.mk @@ -0,0 +1,20 @@ +CSRCS += lv_arc.c +CSRCS += lv_bar.c +CSRCS += lv_btn.c +CSRCS += lv_btnmatrix.c +CSRCS += lv_canvas.c +CSRCS += lv_checkbox.c +CSRCS += lv_dropdown.c +CSRCS += lv_img.c +CSRCS += lv_label.c +CSRCS += lv_line.c +CSRCS += lv_roller.c +CSRCS += lv_slider.c +CSRCS += lv_switch.c +CSRCS += lv_table.c +CSRCS += lv_textarea.c + +DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/widgets +VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/widgets + +CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/widgets" diff --git a/L3_Middlewares/LVGL/src/widgets/menu/lv_menu.h b/L3_Middlewares/LVGL/src/widgets/menu/lv_menu.h deleted file mode 100644 index 3d75f8d..0000000 --- a/L3_Middlewares/LVGL/src/widgets/menu/lv_menu.h +++ /dev/null @@ -1,213 +0,0 @@ -/** - * @file lv_menu.h - * - */ - -#ifndef LV_MENU_H -#define LV_MENU_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../core/lv_obj.h" - -#if LV_USE_MENU - -#if LV_USE_FLEX == 0 -#error "LV_USE_FLEX needs to be enabled" -#endif - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ -typedef enum { - LV_MENU_HEADER_TOP_FIXED, /**< Header is positioned at the top */ - LV_MENU_HEADER_TOP_UNFIXED, /**< Header is positioned at the top and can be scrolled out of view*/ - LV_MENU_HEADER_BOTTOM_FIXED /**< Header is positioned at the bottom */ -} lv_menu_mode_header_t; - -typedef enum { - LV_MENU_ROOT_BACK_BUTTON_DISABLED, - LV_MENU_ROOT_BACK_BUTTON_ENABLED -} lv_menu_mode_root_back_button_t; - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_page_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_cont_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_section_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_separator_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_sidebar_cont_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_main_cont_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_sidebar_header_cont_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_menu_main_header_cont_class; -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a menu object - * @param parent pointer to an object, it will be the parent of the new menu - * @return pointer to the created menu - */ -lv_obj_t * lv_menu_create(lv_obj_t * parent); - -/** - * Create a menu page object - * @param parent pointer to menu object - * @param title pointer to text for title in header (NULL to not display title) - * @return pointer to the created menu page - */ -lv_obj_t * lv_menu_page_create(lv_obj_t * parent, char const * const title); - -/** - * Create a menu cont object - * @param parent pointer to an object, it will be the parent of the new menu cont object - * @return pointer to the created menu cont - */ -lv_obj_t * lv_menu_cont_create(lv_obj_t * parent); - -/** - * Create a menu section object - * @param parent pointer to an object, it will be the parent of the new menu section object - * @return pointer to the created menu section - */ -lv_obj_t * lv_menu_section_create(lv_obj_t * parent); - -/** - * Create a menu separator object - * @param parent pointer to an object, it will be the parent of the new menu separator object - * @return pointer to the created menu separator - */ -lv_obj_t * lv_menu_separator_create(lv_obj_t * parent); -/*===================== - * Setter functions - *====================*/ -/** - * Set menu page to display in main - * @param obj pointer to the menu - * @param page pointer to the menu page to set (NULL to clear main and clear menu history) - */ -void lv_menu_set_page(lv_obj_t * obj, lv_obj_t * page); - -/** - * Set menu page title - * @param page pointer to the menu page - * @param title pointer to text for title in header (NULL to not display title) - */ -void lv_menu_set_page_title(lv_obj_t * page, char const * const title); - -/** - * Set menu page title with a static text. It will not be saved by the label so the 'text' variable - * has to be 'alive' while the page exists. - * @param page pointer to the menu page - * @param title pointer to text for title in header (NULL to not display title) - */ -void lv_menu_set_page_title_static(lv_obj_t * page, char const * const title); - -/** - * Set menu page to display in sidebar - * @param obj pointer to the menu - * @param page pointer to the menu page to set (NULL to clear sidebar) - */ -void lv_menu_set_sidebar_page(lv_obj_t * obj, lv_obj_t * page); - -/** - * Set the how the header should behave and its position - * @param obj pointer to a menu - * @param mode LV_MENU_HEADER_TOP_FIXED/TOP_UNFIXED/BOTTOM_FIXED - */ -void lv_menu_set_mode_header(lv_obj_t * obj, lv_menu_mode_header_t mode); - -/** - * Set whether back button should appear at root - * @param obj pointer to a menu - * @param mode LV_MENU_ROOT_BACK_BUTTON_DISABLED/ENABLED - */ -void lv_menu_set_mode_root_back_button(lv_obj_t * obj, lv_menu_mode_root_back_button_t mode); - -/** - * Add menu to the menu item - * @param menu pointer to the menu - * @param obj pointer to the obj - * @param page pointer to the page to load when obj is clicked - */ -void lv_menu_set_load_page_event(lv_obj_t * menu, lv_obj_t * obj, lv_obj_t * page); - -/*===================== - * Getter functions - *====================*/ -/** -* Get a pointer to menu page that is currently displayed in main -* @param obj pointer to the menu -* @return pointer to current page -*/ -lv_obj_t * lv_menu_get_cur_main_page(lv_obj_t * obj); - -/** -* Get a pointer to menu page that is currently displayed in sidebar -* @param obj pointer to the menu -* @return pointer to current page -*/ -lv_obj_t * lv_menu_get_cur_sidebar_page(lv_obj_t * obj); - -/** -* Get a pointer to main header obj -* @param obj pointer to the menu -* @return pointer to main header obj -*/ -lv_obj_t * lv_menu_get_main_header(lv_obj_t * obj); - -/** -* Get a pointer to main header back btn obj -* @param obj pointer to the menu -* @return pointer to main header back btn obj -*/ -lv_obj_t * lv_menu_get_main_header_back_button(lv_obj_t * obj); - -/** -* Get a pointer to sidebar header obj -* @param obj pointer to the menu -* @return pointer to sidebar header obj -*/ -lv_obj_t * lv_menu_get_sidebar_header(lv_obj_t * obj); - -/** -* Get a pointer to sidebar header obj -* @param obj pointer to the menu -* @return pointer to sidebar header back btn obj -*/ -lv_obj_t * lv_menu_get_sidebar_header_back_button(lv_obj_t * obj); - -/** - * Check if an obj is a root back btn - * @param menu pointer to the menu - * @param obj pointer to the back button - * @return true if it is a root back btn - */ -bool lv_menu_back_button_is_root(lv_obj_t * menu, lv_obj_t * obj); - -/** - * Clear menu history - * @param obj pointer to the menu - */ -void lv_menu_clear_history(lv_obj_t * obj); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_MENU*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_MENU_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/menu/lv_menu_private.h b/L3_Middlewares/LVGL/src/widgets/menu/lv_menu_private.h deleted file mode 100644 index fca898d..0000000 --- a/L3_Middlewares/LVGL/src/widgets/menu/lv_menu_private.h +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file lv_menu_private.h - * - */ - -#ifndef LV_MENU_PRIVATE_H -#define LV_MENU_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_menu.h" - -#if LV_USE_MENU - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_menu_load_page_event_data_t { - lv_obj_t * menu; - lv_obj_t * page; -}; - -struct lv_menu_history_t { - lv_obj_t * page; -}; - -struct lv_menu_t { - lv_obj_t obj; - lv_obj_t * storage; /**< a pointer to obj that is the parent of all pages not displayed */ - lv_obj_t * main; - lv_obj_t * main_page; - lv_obj_t * main_header; - lv_obj_t * - main_header_back_btn; /**< a pointer to obj that on click triggers back btn event handler, can be same as 'main_header' */ - lv_obj_t * main_header_title; - lv_obj_t * sidebar; - lv_obj_t * sidebar_page; - lv_obj_t * sidebar_header; - lv_obj_t * - sidebar_header_back_btn; /**< a pointer to obj that on click triggers back btn event handler, can be same as 'sidebar_header' */ - lv_obj_t * sidebar_header_title; - lv_obj_t * selected_tab; - lv_ll_t history_ll; - uint8_t cur_depth; - uint8_t prev_depth; - uint8_t sidebar_generated : 1; - lv_menu_mode_header_t mode_header : 2; - lv_menu_mode_root_back_button_t mode_root_back_btn : 1; -}; - -struct lv_menu_page_t { - lv_obj_t obj; - char * title; - bool static_title; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_MENU */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_MENU_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox.c b/L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox.c deleted file mode 100644 index 98ad81e..0000000 --- a/L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox.c +++ /dev/null @@ -1,294 +0,0 @@ -/** - * @file lv_msgbox.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_msgbox_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_class_private.h" -#if LV_USE_MSGBOX - -#include "../label/lv_label.h" -#include "../button/lv_button.h" -#include "../image/lv_image.h" -#include "../../misc/lv_assert.h" -#include "../../display/lv_display.h" -#include "../../layouts/flex/lv_flex.h" -#include "../../stdlib/lv_string.h" - -/********************* - * DEFINES - *********************/ -#define LV_MSGBOX_FLAG_AUTO_PARENT LV_OBJ_FLAG_WIDGET_1 /*Mark that the parent was automatically created*/ -#define MY_CLASS (&lv_msgbox_class) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void msgbox_close_click_event_cb(lv_event_t * e); -static void msgbox_size_changed_event_cb(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ -const lv_obj_class_t lv_msgbox_class = { - .base_class = &lv_obj_class, - .width_def = LV_DPI_DEF * 2, - .height_def = LV_SIZE_CONTENT, - .instance_size = sizeof(lv_msgbox_t), - .name = "msgbox", -}; - -const lv_obj_class_t lv_msgbox_header_class = { - .base_class = &lv_obj_class, - .width_def = LV_PCT(100), - .height_def = LV_DPI_DEF / 3, - .instance_size = sizeof(lv_obj_t), - .name = "msgbox-header", -}; - -const lv_obj_class_t lv_msgbox_content_class = { - .base_class = &lv_obj_class, - .width_def = LV_PCT(100), - .height_def = LV_SIZE_CONTENT, - .instance_size = sizeof(lv_obj_t), - .name = "msgbox-content", -}; - -const lv_obj_class_t lv_msgbox_footer_class = { - .base_class = &lv_obj_class, - .width_def = LV_PCT(100), - .height_def = LV_DPI_DEF / 3, - .instance_size = sizeof(lv_obj_t), - .name = "msgbox-footer", -}; - -const lv_obj_class_t lv_msgbox_footer_button_class = { - .base_class = &lv_obj_class, - .width_def = LV_SIZE_CONTENT, - .height_def = LV_PCT(100), - .instance_size = sizeof(lv_obj_t), - .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, - .name = "msgbox-footer-button", -}; - -const lv_obj_class_t lv_msgbox_header_button_class = { - .base_class = &lv_obj_class, - .width_def = LV_DPI_DEF / 3, - .height_def = LV_PCT(100), - .instance_size = sizeof(lv_obj_t), - .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, - .name = "msgbox-header-button", -}; - -const lv_obj_class_t lv_msgbox_backdrop_class = { - .base_class = &lv_obj_class, - .width_def = LV_PCT(100), - .height_def = LV_PCT(100), - .instance_size = sizeof(lv_obj_t), - .name = "msgbox-backdrop", -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_msgbox_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - bool auto_parent = false; - if(parent == NULL) { - auto_parent = true; - parent = lv_obj_class_create_obj(&lv_msgbox_backdrop_class, lv_layer_top()); - LV_ASSERT_MALLOC(parent); - lv_obj_class_init_obj(parent); - lv_obj_remove_flag(parent, LV_OBJ_FLAG_IGNORE_LAYOUT); - lv_obj_set_size(parent, LV_PCT(100), LV_PCT(100)); - } - - lv_obj_t * obj = lv_obj_class_create_obj(&lv_msgbox_class, parent); - LV_ASSERT_MALLOC(obj); - if(obj == NULL) return NULL; - lv_obj_class_init_obj(obj); - lv_msgbox_t * mbox = (lv_msgbox_t *)obj; - lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); - - if(auto_parent) lv_obj_add_flag(obj, LV_MSGBOX_FLAG_AUTO_PARENT); - - mbox->content = lv_obj_class_create_obj(&lv_msgbox_content_class, obj); - LV_ASSERT_MALLOC(obj); - if(mbox->content == NULL) return NULL; - lv_obj_class_init_obj(mbox->content); - lv_obj_set_flex_flow(mbox->content, LV_FLEX_FLOW_COLUMN); - lv_obj_add_event_cb(obj, msgbox_size_changed_event_cb, LV_EVENT_SIZE_CHANGED, 0); - - lv_obj_center(obj); - return obj; -} - -lv_obj_t * lv_msgbox_add_title(lv_obj_t * obj, const char * title) -{ - lv_msgbox_t * mbox = (lv_msgbox_t *)obj; - if(mbox->header == NULL) { - mbox->header = lv_obj_class_create_obj(&lv_msgbox_header_class, obj); - LV_ASSERT_MALLOC(obj); - if(mbox->header == NULL) return NULL; - lv_obj_class_init_obj(mbox->header); - - lv_obj_set_size(mbox->header, lv_pct(100), lv_display_get_dpi(lv_obj_get_display(obj)) / 3); - lv_obj_set_flex_flow(mbox->header, LV_FLEX_FLOW_ROW); - lv_obj_set_flex_align(mbox->header, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); - lv_obj_remove_flag(mbox->header, LV_OBJ_FLAG_SCROLLABLE); - lv_obj_move_to_index(mbox->header, 0); - } - - if(mbox->title == NULL) { - mbox->title = lv_label_create(mbox->header); - lv_obj_set_flex_grow(mbox->title, 1); - } - - lv_label_set_text(mbox->title, title); - - return mbox->title; -} - -lv_obj_t * lv_msgbox_add_header_button(lv_obj_t * obj, const void * icon) -{ - lv_msgbox_t * mbox = (lv_msgbox_t *)obj; - if(mbox->header == NULL) { - lv_msgbox_add_title(obj, ""); /*Just to push the buttons to the right*/ - } - - lv_obj_t * btn = lv_obj_class_create_obj(&lv_msgbox_header_button_class, mbox->header); - LV_ASSERT_MALLOC(obj); - if(btn == NULL) return NULL; - lv_obj_class_init_obj(btn); - lv_obj_remove_flag(btn, LV_OBJ_FLAG_SCROLLABLE); - - if(icon) { - lv_obj_t * img = lv_image_create(btn); - lv_image_set_src(img, icon); - lv_obj_align(img, LV_ALIGN_CENTER, 0, 0); - } - - return btn; -} - -lv_obj_t * lv_msgbox_add_text(lv_obj_t * obj, const char * text) -{ - lv_msgbox_t * mbox = (lv_msgbox_t *)obj; - - lv_obj_t * label = lv_label_create(mbox->content); - lv_label_set_text(label, text); - lv_obj_set_width(label, lv_pct(100)); - - return label; -} - -lv_obj_t * lv_msgbox_add_footer_button(lv_obj_t * obj, const char * text) -{ - lv_msgbox_t * mbox = (lv_msgbox_t *)obj; - if(mbox->footer == NULL) { - mbox->footer = lv_obj_class_create_obj(&lv_msgbox_footer_class, obj); - LV_ASSERT_MALLOC(obj); - if(mbox->footer == NULL) return NULL; - lv_obj_class_init_obj(mbox->footer); - - lv_obj_set_flex_flow(mbox->footer, LV_FLEX_FLOW_ROW); - lv_obj_set_flex_align(mbox->footer, LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER); - lv_obj_remove_flag(mbox->footer, LV_OBJ_FLAG_SCROLLABLE); - } - - lv_obj_t * btn = lv_obj_class_create_obj(&lv_msgbox_footer_button_class, mbox->footer); - LV_ASSERT_MALLOC(obj); - if(btn == NULL) return NULL; - lv_obj_class_init_obj(btn); - lv_obj_remove_flag(btn, LV_OBJ_FLAG_SCROLLABLE); - - if(text) { - lv_obj_t * label = lv_label_create(btn); - lv_label_set_text(label, text); - lv_obj_align(label, LV_ALIGN_CENTER, 0, 0); - } - - return btn; -} - -lv_obj_t * lv_msgbox_add_close_button(lv_obj_t * obj) -{ - lv_obj_t * btn = lv_msgbox_add_header_button(obj, LV_SYMBOL_CLOSE); - lv_obj_add_event_cb(btn, msgbox_close_click_event_cb, LV_EVENT_CLICKED, NULL); - return btn; -} - -lv_obj_t * lv_msgbox_get_header(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_msgbox_t * mbox = (lv_msgbox_t *)obj; - return mbox->header; -} - -lv_obj_t * lv_msgbox_get_footer(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_msgbox_t * mbox = (lv_msgbox_t *)obj; - return mbox->footer; -} - -lv_obj_t * lv_msgbox_get_content(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_msgbox_t * mbox = (lv_msgbox_t *)obj; - return mbox->content; -} - -lv_obj_t * lv_msgbox_get_title(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_msgbox_t * mbox = (lv_msgbox_t *)obj; - return mbox->title; -} - -void lv_msgbox_close(lv_obj_t * obj) -{ - if(lv_obj_has_flag(obj, LV_MSGBOX_FLAG_AUTO_PARENT)) lv_obj_delete(lv_obj_get_parent(obj)); - else lv_obj_delete(obj); -} - -void lv_msgbox_close_async(lv_obj_t * obj) -{ - if(lv_obj_has_flag(obj, LV_MSGBOX_FLAG_AUTO_PARENT)) lv_obj_delete_async(lv_obj_get_parent(obj)); - else lv_obj_delete_async(obj); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void msgbox_close_click_event_cb(lv_event_t * e) -{ - lv_obj_t * btn = lv_event_get_current_target(e); - lv_obj_t * mbox = lv_obj_get_parent(lv_obj_get_parent(btn)); - lv_msgbox_close(mbox); -} - -static void msgbox_size_changed_event_cb(lv_event_t * e) -{ - lv_obj_t * mbox = lv_event_get_target(e); - lv_obj_t * content = lv_msgbox_get_content(mbox); - bool is_msgbox_height_size_content = (lv_obj_get_style_height(mbox, 0) == LV_SIZE_CONTENT); - lv_obj_set_flex_grow(content, !is_msgbox_height_size_content); -} - -#endif /*LV_USE_MSGBOX*/ diff --git a/L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox.h b/L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox.h deleted file mode 100644 index 5605b80..0000000 --- a/L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - * @file lv_msgbox.h - * - */ - -#ifndef LV_MSGBOX_H -#define LV_MSGBOX_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../core/lv_obj.h" - -#if LV_USE_MSGBOX - -/*Testing of dependencies*/ -#if LV_USE_BUTTONMATRIX == 0 -#error "lv_mbox: lv_buttonmatrix is required. Enable it in lv_conf.h (LV_USE_BUTTONMATRIX 1) " -#endif - -#if LV_USE_LABEL == 0 -#error "lv_mbox: lv_label is required. Enable it in lv_conf.h (LV_USE_LABEL 1) " -#endif - -/********************* - * DEFINES - *********************/ - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_msgbox_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_msgbox_header_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_msgbox_content_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_msgbox_footer_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_msgbox_header_button_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_msgbox_footer_button_class; -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_msgbox_backdrop_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an empty message box - * @param parent the parent or NULL to create a modal msgbox - * @return the created message box - */ -lv_obj_t * lv_msgbox_create(lv_obj_t * parent); - -/** - * Add title to the message box. It also creates a header for the title. - * @param obj pointer to a message box - * @param title the text of the tile - * @return the created title label - */ -lv_obj_t * lv_msgbox_add_title(lv_obj_t * obj, const char * title); - -/** - * Add a button to the header of to the message box. It also creates a header. - * @param obj pointer to a message box - * @param icon the icon of the button - * @return the created button - */ -lv_obj_t * lv_msgbox_add_header_button(lv_obj_t * obj, const void * icon); - -/** - * Add a text to the content area of message box. Multiple texts will be created below each other. - * @param obj pointer to a message box - * @param text text to add - * @return the created button - */ -lv_obj_t * lv_msgbox_add_text(lv_obj_t * obj, const char * text); - -/** - * Add a button to the footer of to the message box. It also creates a footer. - * @param obj pointer to a message box - * @param text the text of the button - * @return the created button - */ -lv_obj_t * lv_msgbox_add_footer_button(lv_obj_t * obj, const char * text); - -/** - * Add a close button to the message box. It also creates a header. - * @param obj pointer to a message box - * @return the created close button - */ -lv_obj_t * lv_msgbox_add_close_button(lv_obj_t * obj); - -/** - * Get the header widget - * @param obj pointer to a message box - * @return the header, or NULL if not exists - */ -lv_obj_t * lv_msgbox_get_header(lv_obj_t * obj); - -/** - * Get the footer widget - * @param obj pointer to a message box - * @return the footer, or NULL if not exists - */ -lv_obj_t * lv_msgbox_get_footer(lv_obj_t * obj); - -/** - * Get the content widget - * @param obj pointer to a message box - * @return the content - */ -lv_obj_t * lv_msgbox_get_content(lv_obj_t * obj); - -/** - * Get the title label - * @param obj pointer to a message box - * @return the title, or NULL if it does not exist - */ -lv_obj_t * lv_msgbox_get_title(lv_obj_t * obj); - -/** - * Close a message box - * @param mbox pointer to a message box - */ -void lv_msgbox_close(lv_obj_t * mbox); - -/** - * Close a message box in the next call of the message box - * @param mbox pointer to a message box - */ -void lv_msgbox_close_async(lv_obj_t * mbox); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_MSGBOX*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_MSGBOX_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox_private.h b/L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox_private.h deleted file mode 100644 index 640a39c..0000000 --- a/L3_Middlewares/LVGL/src/widgets/msgbox/lv_msgbox_private.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file lv_msgbox_private.h - * - */ - -#ifndef LV_MSGBOX_PRIVATE_H -#define LV_MSGBOX_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_msgbox.h" - -#if LV_USE_MSGBOX -#include "../../core/lv_obj_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_msgbox_t { - lv_obj_t obj; - lv_obj_t * header; - lv_obj_t * content; - lv_obj_t * footer; - lv_obj_t * title; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_MSGBOX */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_MSGBOX_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/property/lv_dropdown_properties.c b/L3_Middlewares/LVGL/src/widgets/property/lv_dropdown_properties.c deleted file mode 100644 index 9477ca3..0000000 --- a/L3_Middlewares/LVGL/src/widgets/property/lv_dropdown_properties.c +++ /dev/null @@ -1,31 +0,0 @@ - -/** - * GENERATED FILE, DO NOT EDIT IT! - * @file lv_dropdown_properties.c - */ - -#include "../dropdown/lv_dropdown.h" - -#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME - -#if LV_USE_DROPDOWN -/** - * Dropdown widget property names, name must be in order. - * Generated code from properties.py - */ -/* *INDENT-OFF* */ -const lv_property_name_t lv_dropdown_property_names[9] = { - {"dir", LV_PROPERTY_DROPDOWN_DIR,}, - {"is_open", LV_PROPERTY_DROPDOWN_IS_OPEN,}, - {"list", LV_PROPERTY_DROPDOWN_LIST,}, - {"option_count", LV_PROPERTY_DROPDOWN_OPTION_COUNT,}, - {"options", LV_PROPERTY_DROPDOWN_OPTIONS,}, - {"selected", LV_PROPERTY_DROPDOWN_SELECTED,}, - {"selected_highlight", LV_PROPERTY_DROPDOWN_SELECTED_HIGHLIGHT,}, - {"symbol", LV_PROPERTY_DROPDOWN_SYMBOL,}, - {"text", LV_PROPERTY_DROPDOWN_TEXT,}, -}; -#endif /*LV_USE_DROPDOWN*/ - -/* *INDENT-ON* */ -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/property/lv_image_properties.c b/L3_Middlewares/LVGL/src/widgets/property/lv_image_properties.c deleted file mode 100644 index fd7fd7d..0000000 --- a/L3_Middlewares/LVGL/src/widgets/property/lv_image_properties.c +++ /dev/null @@ -1,33 +0,0 @@ - -/** - * GENERATED FILE, DO NOT EDIT IT! - * @file lv_image_properties.c - */ - -#include "../image/lv_image.h" - -#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME - -#if LV_USE_IMAGE -/** - * Image widget property names, name must be in order. - * Generated code from properties.py - */ -/* *INDENT-OFF* */ -const lv_property_name_t lv_image_property_names[11] = { - {"antialias", LV_PROPERTY_IMAGE_ANTIALIAS,}, - {"blend_mode", LV_PROPERTY_IMAGE_BLEND_MODE,}, - {"inner_align", LV_PROPERTY_IMAGE_INNER_ALIGN,}, - {"offset_x", LV_PROPERTY_IMAGE_OFFSET_X,}, - {"offset_y", LV_PROPERTY_IMAGE_OFFSET_Y,}, - {"pivot", LV_PROPERTY_IMAGE_PIVOT,}, - {"rotation", LV_PROPERTY_IMAGE_ROTATION,}, - {"scale", LV_PROPERTY_IMAGE_SCALE,}, - {"scale_x", LV_PROPERTY_IMAGE_SCALE_X,}, - {"scale_y", LV_PROPERTY_IMAGE_SCALE_Y,}, - {"src", LV_PROPERTY_IMAGE_SRC,}, -}; -#endif /*LV_USE_IMAGE*/ - -/* *INDENT-ON* */ -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/property/lv_keyboard_properties.c b/L3_Middlewares/LVGL/src/widgets/property/lv_keyboard_properties.c deleted file mode 100644 index 90cfc3e..0000000 --- a/L3_Middlewares/LVGL/src/widgets/property/lv_keyboard_properties.c +++ /dev/null @@ -1,26 +0,0 @@ - -/** - * GENERATED FILE, DO NOT EDIT IT! - * @file lv_keyboard_properties.c - */ - -#include "../keyboard/lv_keyboard.h" - -#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME - -#if LV_USE_KEYBOARD -/** - * Keyboard widget property names, name must be in order. - * Generated code from properties.py - */ -/* *INDENT-OFF* */ -const lv_property_name_t lv_keyboard_property_names[4] = { - {"mode", LV_PROPERTY_KEYBOARD_MODE,}, - {"popovers", LV_PROPERTY_KEYBOARD_POPOVERS,}, - {"selected_button", LV_PROPERTY_KEYBOARD_SELECTED_BUTTON,}, - {"textarea", LV_PROPERTY_KEYBOARD_TEXTAREA,}, -}; -#endif /*LV_USE_KEYBOARD*/ - -/* *INDENT-ON* */ -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/property/lv_label_properties.c b/L3_Middlewares/LVGL/src/widgets/property/lv_label_properties.c deleted file mode 100644 index 5fc6708..0000000 --- a/L3_Middlewares/LVGL/src/widgets/property/lv_label_properties.c +++ /dev/null @@ -1,26 +0,0 @@ - -/** - * GENERATED FILE, DO NOT EDIT IT! - * @file lv_label_properties.c - */ - -#include "../label/lv_label.h" - -#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME - -#if LV_USE_LABEL -/** - * Label widget property names, name must be in order. - * Generated code from properties.py - */ -/* *INDENT-OFF* */ -const lv_property_name_t lv_label_property_names[4] = { - {"long_mode", LV_PROPERTY_LABEL_LONG_MODE,}, - {"text", LV_PROPERTY_LABEL_TEXT,}, - {"text_selection_end", LV_PROPERTY_LABEL_TEXT_SELECTION_END,}, - {"text_selection_start", LV_PROPERTY_LABEL_TEXT_SELECTION_START,}, -}; -#endif /*LV_USE_LABEL*/ - -/* *INDENT-ON* */ -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/property/lv_obj_properties.c b/L3_Middlewares/LVGL/src/widgets/property/lv_obj_properties.c deleted file mode 100644 index 1008b36..0000000 --- a/L3_Middlewares/LVGL/src/widgets/property/lv_obj_properties.c +++ /dev/null @@ -1,93 +0,0 @@ - -/** - * GENERATED FILE, DO NOT EDIT IT! - * @file lv_obj_properties.c - */ - -#include "../../core/lv_obj.h" - -#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME - - -/** - * Obj widget property names, name must be in order. - * Generated code from properties.py - */ -/* *INDENT-OFF* */ -const lv_property_name_t lv_obj_property_names[73] = { - {"align", LV_PROPERTY_OBJ_ALIGN,}, - {"child_count", LV_PROPERTY_OBJ_CHILD_COUNT,}, - {"content_height", LV_PROPERTY_OBJ_CONTENT_HEIGHT,}, - {"content_width", LV_PROPERTY_OBJ_CONTENT_WIDTH,}, - {"display", LV_PROPERTY_OBJ_DISPLAY,}, - {"event_count", LV_PROPERTY_OBJ_EVENT_COUNT,}, - {"ext_draw_size", LV_PROPERTY_OBJ_EXT_DRAW_SIZE,}, - {"flag_adv_hittest", LV_PROPERTY_OBJ_FLAG_ADV_HITTEST,}, - {"flag_checkable", LV_PROPERTY_OBJ_FLAG_CHECKABLE,}, - {"flag_click_focusable", LV_PROPERTY_OBJ_FLAG_CLICK_FOCUSABLE,}, - {"flag_clickable", LV_PROPERTY_OBJ_FLAG_CLICKABLE,}, - {"flag_end", LV_PROPERTY_OBJ_FLAG_END,}, - {"flag_event_bubble", LV_PROPERTY_OBJ_FLAG_EVENT_BUBBLE,}, - {"flag_flex_in_new_track", LV_PROPERTY_OBJ_FLAG_FLEX_IN_NEW_TRACK,}, - {"flag_floating", LV_PROPERTY_OBJ_FLAG_FLOATING,}, - {"flag_gesture_bubble", LV_PROPERTY_OBJ_FLAG_GESTURE_BUBBLE,}, - {"flag_hidden", LV_PROPERTY_OBJ_FLAG_HIDDEN,}, - {"flag_ignore_layout", LV_PROPERTY_OBJ_FLAG_IGNORE_LAYOUT,}, - {"flag_layout_1", LV_PROPERTY_OBJ_FLAG_LAYOUT_1,}, - {"flag_layout_2", LV_PROPERTY_OBJ_FLAG_LAYOUT_2,}, - {"flag_overflow_visible", LV_PROPERTY_OBJ_FLAG_OVERFLOW_VISIBLE,}, - {"flag_press_lock", LV_PROPERTY_OBJ_FLAG_PRESS_LOCK,}, - {"flag_scroll_chain_hor", LV_PROPERTY_OBJ_FLAG_SCROLL_CHAIN_HOR,}, - {"flag_scroll_chain_ver", LV_PROPERTY_OBJ_FLAG_SCROLL_CHAIN_VER,}, - {"flag_scroll_elastic", LV_PROPERTY_OBJ_FLAG_SCROLL_ELASTIC,}, - {"flag_scroll_momentum", LV_PROPERTY_OBJ_FLAG_SCROLL_MOMENTUM,}, - {"flag_scroll_on_focus", LV_PROPERTY_OBJ_FLAG_SCROLL_ON_FOCUS,}, - {"flag_scroll_one", LV_PROPERTY_OBJ_FLAG_SCROLL_ONE,}, - {"flag_scroll_with_arrow", LV_PROPERTY_OBJ_FLAG_SCROLL_WITH_ARROW,}, - {"flag_scrollable", LV_PROPERTY_OBJ_FLAG_SCROLLABLE,}, - {"flag_send_draw_task_events", LV_PROPERTY_OBJ_FLAG_SEND_DRAW_TASK_EVENTS,}, - {"flag_snappable", LV_PROPERTY_OBJ_FLAG_SNAPPABLE,}, - {"flag_start", LV_PROPERTY_OBJ_FLAG_START,}, - {"flag_user_1", LV_PROPERTY_OBJ_FLAG_USER_1,}, - {"flag_user_2", LV_PROPERTY_OBJ_FLAG_USER_2,}, - {"flag_user_3", LV_PROPERTY_OBJ_FLAG_USER_3,}, - {"flag_user_4", LV_PROPERTY_OBJ_FLAG_USER_4,}, - {"flag_widget_1", LV_PROPERTY_OBJ_FLAG_WIDGET_1,}, - {"flag_widget_2", LV_PROPERTY_OBJ_FLAG_WIDGET_2,}, - {"h", LV_PROPERTY_OBJ_H,}, - {"index", LV_PROPERTY_OBJ_INDEX,}, - {"layout", LV_PROPERTY_OBJ_LAYOUT,}, - {"parent", LV_PROPERTY_OBJ_PARENT,}, - {"screen", LV_PROPERTY_OBJ_SCREEN,}, - {"scroll_bottom", LV_PROPERTY_OBJ_SCROLL_BOTTOM,}, - {"scroll_dir", LV_PROPERTY_OBJ_SCROLL_DIR,}, - {"scroll_end", LV_PROPERTY_OBJ_SCROLL_END,}, - {"scroll_left", LV_PROPERTY_OBJ_SCROLL_LEFT,}, - {"scroll_right", LV_PROPERTY_OBJ_SCROLL_RIGHT,}, - {"scroll_snap_x", LV_PROPERTY_OBJ_SCROLL_SNAP_X,}, - {"scroll_snap_y", LV_PROPERTY_OBJ_SCROLL_SNAP_Y,}, - {"scroll_top", LV_PROPERTY_OBJ_SCROLL_TOP,}, - {"scroll_x", LV_PROPERTY_OBJ_SCROLL_X,}, - {"scroll_y", LV_PROPERTY_OBJ_SCROLL_Y,}, - {"scrollbar_mode", LV_PROPERTY_OBJ_SCROLLBAR_MODE,}, - {"state_any", LV_PROPERTY_OBJ_STATE_ANY,}, - {"state_checked", LV_PROPERTY_OBJ_STATE_CHECKED,}, - {"state_disabled", LV_PROPERTY_OBJ_STATE_DISABLED,}, - {"state_edited", LV_PROPERTY_OBJ_STATE_EDITED,}, - {"state_end", LV_PROPERTY_OBJ_STATE_END,}, - {"state_focus_key", LV_PROPERTY_OBJ_STATE_FOCUS_KEY,}, - {"state_focused", LV_PROPERTY_OBJ_STATE_FOCUSED,}, - {"state_hovered", LV_PROPERTY_OBJ_STATE_HOVERED,}, - {"state_pressed", LV_PROPERTY_OBJ_STATE_PRESSED,}, - {"state_scrolled", LV_PROPERTY_OBJ_STATE_SCROLLED,}, - {"state_start", LV_PROPERTY_OBJ_STATE_START,}, - {"state_user_1", LV_PROPERTY_OBJ_STATE_USER_1,}, - {"state_user_2", LV_PROPERTY_OBJ_STATE_USER_2,}, - {"state_user_3", LV_PROPERTY_OBJ_STATE_USER_3,}, - {"state_user_4", LV_PROPERTY_OBJ_STATE_USER_4,}, - {"w", LV_PROPERTY_OBJ_W,}, - {"x", LV_PROPERTY_OBJ_X,}, - {"y", LV_PROPERTY_OBJ_Y,}, -}; -/* *INDENT-ON* */ -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/property/lv_obj_property_names.h b/L3_Middlewares/LVGL/src/widgets/property/lv_obj_property_names.h deleted file mode 100644 index 4b4ff67..0000000 --- a/L3_Middlewares/LVGL/src/widgets/property/lv_obj_property_names.h +++ /dev/null @@ -1,22 +0,0 @@ - -/** - * @file lv_obj_property_names.h - * GENERATED FILE, DO NOT EDIT IT! - */ -#ifndef LV_OBJ_PROPERTY_NAMES_H -#define LV_OBJ_PROPERTY_NAMES_H - -#include "../../misc/lv_types.h" - -#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME - - extern const lv_property_name_t lv_dropdown_property_names[9]; - extern const lv_property_name_t lv_image_property_names[11]; - extern const lv_property_name_t lv_keyboard_property_names[4]; - extern const lv_property_name_t lv_label_property_names[4]; - extern const lv_property_name_t lv_obj_property_names[73]; - extern const lv_property_name_t lv_roller_property_names[3]; - extern const lv_property_name_t lv_style_property_names[112]; - extern const lv_property_name_t lv_textarea_property_names[15]; -#endif -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/property/lv_roller_properties.c b/L3_Middlewares/LVGL/src/widgets/property/lv_roller_properties.c deleted file mode 100644 index 72aa017..0000000 --- a/L3_Middlewares/LVGL/src/widgets/property/lv_roller_properties.c +++ /dev/null @@ -1,25 +0,0 @@ - -/** - * GENERATED FILE, DO NOT EDIT IT! - * @file lv_roller_properties.c - */ - -#include "../roller/lv_roller.h" - -#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME - -#if LV_USE_ROLLER -/** - * Roller widget property names, name must be in order. - * Generated code from properties.py - */ -/* *INDENT-OFF* */ -const lv_property_name_t lv_roller_property_names[3] = { - {"options", LV_PROPERTY_ROLLER_OPTIONS,}, - {"selected", LV_PROPERTY_ROLLER_SELECTED,}, - {"visible_row_count", LV_PROPERTY_ROLLER_VISIBLE_ROW_COUNT,}, -}; -#endif /*LV_USE_ROLLER*/ - -/* *INDENT-ON* */ -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/property/lv_style_properties.c b/L3_Middlewares/LVGL/src/widgets/property/lv_style_properties.c deleted file mode 100644 index 22ef3e2..0000000 --- a/L3_Middlewares/LVGL/src/widgets/property/lv_style_properties.c +++ /dev/null @@ -1,132 +0,0 @@ - -/** - * GENERATED FILE, DO NOT EDIT IT! - * @file lv_style_properties.c - */ - -#include "lv_style_properties.h" - -#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME - - -/** - * Style property names, name must be in order. - * Generated code from properties.py - */ -/* *INDENT-OFF* */ -const lv_property_name_t lv_style_property_names[112] = { - {"align", LV_PROPERTY_STYLE_ALIGN,}, - {"anim", LV_PROPERTY_STYLE_ANIM,}, - {"anim_duration", LV_PROPERTY_STYLE_ANIM_DURATION,}, - {"arc_color", LV_PROPERTY_STYLE_ARC_COLOR,}, - {"arc_image_src", LV_PROPERTY_STYLE_ARC_IMAGE_SRC,}, - {"arc_opa", LV_PROPERTY_STYLE_ARC_OPA,}, - {"arc_rounded", LV_PROPERTY_STYLE_ARC_ROUNDED,}, - {"arc_width", LV_PROPERTY_STYLE_ARC_WIDTH,}, - {"base_dir", LV_PROPERTY_STYLE_BASE_DIR,}, - {"bg_color", LV_PROPERTY_STYLE_BG_COLOR,}, - {"bg_grad", LV_PROPERTY_STYLE_BG_GRAD,}, - {"bg_grad_color", LV_PROPERTY_STYLE_BG_GRAD_COLOR,}, - {"bg_grad_dir", LV_PROPERTY_STYLE_BG_GRAD_DIR,}, - {"bg_grad_opa", LV_PROPERTY_STYLE_BG_GRAD_OPA,}, - {"bg_grad_stop", LV_PROPERTY_STYLE_BG_GRAD_STOP,}, - {"bg_image_opa", LV_PROPERTY_STYLE_BG_IMAGE_OPA,}, - {"bg_image_recolor", LV_PROPERTY_STYLE_BG_IMAGE_RECOLOR,}, - {"bg_image_recolor_opa", LV_PROPERTY_STYLE_BG_IMAGE_RECOLOR_OPA,}, - {"bg_image_src", LV_PROPERTY_STYLE_BG_IMAGE_SRC,}, - {"bg_image_tiled", LV_PROPERTY_STYLE_BG_IMAGE_TILED,}, - {"bg_main_opa", LV_PROPERTY_STYLE_BG_MAIN_OPA,}, - {"bg_main_stop", LV_PROPERTY_STYLE_BG_MAIN_STOP,}, - {"bg_opa", LV_PROPERTY_STYLE_BG_OPA,}, - {"bitmap_mask_src", LV_PROPERTY_STYLE_BITMAP_MASK_SRC,}, - {"blend_mode", LV_PROPERTY_STYLE_BLEND_MODE,}, - {"border_color", LV_PROPERTY_STYLE_BORDER_COLOR,}, - {"border_opa", LV_PROPERTY_STYLE_BORDER_OPA,}, - {"border_post", LV_PROPERTY_STYLE_BORDER_POST,}, - {"border_side", LV_PROPERTY_STYLE_BORDER_SIDE,}, - {"border_width", LV_PROPERTY_STYLE_BORDER_WIDTH,}, - {"clip_corner", LV_PROPERTY_STYLE_CLIP_CORNER,}, - {"color_filter_dsc", LV_PROPERTY_STYLE_COLOR_FILTER_DSC,}, - {"color_filter_opa", LV_PROPERTY_STYLE_COLOR_FILTER_OPA,}, - {"flex_cross_place", LV_PROPERTY_STYLE_FLEX_CROSS_PLACE,}, - {"flex_flow", LV_PROPERTY_STYLE_FLEX_FLOW,}, - {"flex_grow", LV_PROPERTY_STYLE_FLEX_GROW,}, - {"flex_main_place", LV_PROPERTY_STYLE_FLEX_MAIN_PLACE,}, - {"flex_track_place", LV_PROPERTY_STYLE_FLEX_TRACK_PLACE,}, - {"grid_cell_column_pos", LV_PROPERTY_STYLE_GRID_CELL_COLUMN_POS,}, - {"grid_cell_column_span", LV_PROPERTY_STYLE_GRID_CELL_COLUMN_SPAN,}, - {"grid_cell_row_pos", LV_PROPERTY_STYLE_GRID_CELL_ROW_POS,}, - {"grid_cell_row_span", LV_PROPERTY_STYLE_GRID_CELL_ROW_SPAN,}, - {"grid_cell_x_align", LV_PROPERTY_STYLE_GRID_CELL_X_ALIGN,}, - {"grid_cell_y_align", LV_PROPERTY_STYLE_GRID_CELL_Y_ALIGN,}, - {"grid_column_align", LV_PROPERTY_STYLE_GRID_COLUMN_ALIGN,}, - {"grid_column_dsc_array", LV_PROPERTY_STYLE_GRID_COLUMN_DSC_ARRAY,}, - {"grid_row_align", LV_PROPERTY_STYLE_GRID_ROW_ALIGN,}, - {"grid_row_dsc_array", LV_PROPERTY_STYLE_GRID_ROW_DSC_ARRAY,}, - {"height", LV_PROPERTY_STYLE_HEIGHT,}, - {"image_opa", LV_PROPERTY_STYLE_IMAGE_OPA,}, - {"image_recolor", LV_PROPERTY_STYLE_IMAGE_RECOLOR,}, - {"image_recolor_opa", LV_PROPERTY_STYLE_IMAGE_RECOLOR_OPA,}, - {"last_built_in_prop", LV_PROPERTY_STYLE_LAST_BUILT_IN_PROP,}, - {"layout", LV_PROPERTY_STYLE_LAYOUT,}, - {"length", LV_PROPERTY_STYLE_LENGTH,}, - {"line_color", LV_PROPERTY_STYLE_LINE_COLOR,}, - {"line_dash_gap", LV_PROPERTY_STYLE_LINE_DASH_GAP,}, - {"line_dash_width", LV_PROPERTY_STYLE_LINE_DASH_WIDTH,}, - {"line_opa", LV_PROPERTY_STYLE_LINE_OPA,}, - {"line_rounded", LV_PROPERTY_STYLE_LINE_ROUNDED,}, - {"line_width", LV_PROPERTY_STYLE_LINE_WIDTH,}, - {"margin_bottom", LV_PROPERTY_STYLE_MARGIN_BOTTOM,}, - {"margin_left", LV_PROPERTY_STYLE_MARGIN_LEFT,}, - {"margin_right", LV_PROPERTY_STYLE_MARGIN_RIGHT,}, - {"margin_top", LV_PROPERTY_STYLE_MARGIN_TOP,}, - {"max_height", LV_PROPERTY_STYLE_MAX_HEIGHT,}, - {"max_width", LV_PROPERTY_STYLE_MAX_WIDTH,}, - {"min_height", LV_PROPERTY_STYLE_MIN_HEIGHT,}, - {"min_width", LV_PROPERTY_STYLE_MIN_WIDTH,}, - {"opa", LV_PROPERTY_STYLE_OPA,}, - {"opa_layered", LV_PROPERTY_STYLE_OPA_LAYERED,}, - {"outline_color", LV_PROPERTY_STYLE_OUTLINE_COLOR,}, - {"outline_opa", LV_PROPERTY_STYLE_OUTLINE_OPA,}, - {"outline_pad", LV_PROPERTY_STYLE_OUTLINE_PAD,}, - {"outline_width", LV_PROPERTY_STYLE_OUTLINE_WIDTH,}, - {"pad_bottom", LV_PROPERTY_STYLE_PAD_BOTTOM,}, - {"pad_column", LV_PROPERTY_STYLE_PAD_COLUMN,}, - {"pad_left", LV_PROPERTY_STYLE_PAD_LEFT,}, - {"pad_right", LV_PROPERTY_STYLE_PAD_RIGHT,}, - {"pad_row", LV_PROPERTY_STYLE_PAD_ROW,}, - {"pad_top", LV_PROPERTY_STYLE_PAD_TOP,}, - {"prop_inv", LV_PROPERTY_STYLE_PROP_INV,}, - {"radius", LV_PROPERTY_STYLE_RADIUS,}, - {"rotary_sensitivity", LV_PROPERTY_STYLE_ROTARY_SENSITIVITY,}, - {"shadow_color", LV_PROPERTY_STYLE_SHADOW_COLOR,}, - {"shadow_offset_x", LV_PROPERTY_STYLE_SHADOW_OFFSET_X,}, - {"shadow_offset_y", LV_PROPERTY_STYLE_SHADOW_OFFSET_Y,}, - {"shadow_opa", LV_PROPERTY_STYLE_SHADOW_OPA,}, - {"shadow_spread", LV_PROPERTY_STYLE_SHADOW_SPREAD,}, - {"shadow_width", LV_PROPERTY_STYLE_SHADOW_WIDTH,}, - {"text_align", LV_PROPERTY_STYLE_TEXT_ALIGN,}, - {"text_color", LV_PROPERTY_STYLE_TEXT_COLOR,}, - {"text_decor", LV_PROPERTY_STYLE_TEXT_DECOR,}, - {"text_font", LV_PROPERTY_STYLE_TEXT_FONT,}, - {"text_letter_space", LV_PROPERTY_STYLE_TEXT_LETTER_SPACE,}, - {"text_line_space", LV_PROPERTY_STYLE_TEXT_LINE_SPACE,}, - {"text_opa", LV_PROPERTY_STYLE_TEXT_OPA,}, - {"transform_height", LV_PROPERTY_STYLE_TRANSFORM_HEIGHT,}, - {"transform_pivot_x", LV_PROPERTY_STYLE_TRANSFORM_PIVOT_X,}, - {"transform_pivot_y", LV_PROPERTY_STYLE_TRANSFORM_PIVOT_Y,}, - {"transform_rotation", LV_PROPERTY_STYLE_TRANSFORM_ROTATION,}, - {"transform_scale_x", LV_PROPERTY_STYLE_TRANSFORM_SCALE_X,}, - {"transform_scale_y", LV_PROPERTY_STYLE_TRANSFORM_SCALE_Y,}, - {"transform_skew_x", LV_PROPERTY_STYLE_TRANSFORM_SKEW_X,}, - {"transform_skew_y", LV_PROPERTY_STYLE_TRANSFORM_SKEW_Y,}, - {"transform_width", LV_PROPERTY_STYLE_TRANSFORM_WIDTH,}, - {"transition", LV_PROPERTY_STYLE_TRANSITION,}, - {"translate_x", LV_PROPERTY_STYLE_TRANSLATE_X,}, - {"translate_y", LV_PROPERTY_STYLE_TRANSLATE_Y,}, - {"width", LV_PROPERTY_STYLE_WIDTH,}, - {"x", LV_PROPERTY_STYLE_X,}, - {"y", LV_PROPERTY_STYLE_Y,}, -}; -/* *INDENT-ON* */ -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/property/lv_style_properties.h b/L3_Middlewares/LVGL/src/widgets/property/lv_style_properties.h deleted file mode 100644 index 146f35a..0000000 --- a/L3_Middlewares/LVGL/src/widgets/property/lv_style_properties.h +++ /dev/null @@ -1,130 +0,0 @@ - -/** - * GENERATED FILE, DO NOT EDIT IT! - * @file lv_style_properties.h - */ -#ifndef LV_STYLE_PROPERTIES_H -#define LV_STYLE_PROPERTIES_H - -#include "../../core/lv_obj_property.h" -#if LV_USE_OBJ_PROPERTY - - -/* *INDENT-OFF* */ -enum { - LV_PROPERTY_ID(STYLE, ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_ALIGN), - LV_PROPERTY_ID(STYLE, ANIM, LV_PROPERTY_TYPE_INT, LV_STYLE_ANIM), - LV_PROPERTY_ID(STYLE, ANIM_DURATION, LV_PROPERTY_TYPE_INT, LV_STYLE_ANIM_DURATION), - LV_PROPERTY_ID(STYLE, ARC_COLOR, LV_PROPERTY_TYPE_INT, LV_STYLE_ARC_COLOR), - LV_PROPERTY_ID(STYLE, ARC_IMAGE_SRC, LV_PROPERTY_TYPE_INT, LV_STYLE_ARC_IMAGE_SRC), - LV_PROPERTY_ID(STYLE, ARC_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_ARC_OPA), - LV_PROPERTY_ID(STYLE, ARC_ROUNDED, LV_PROPERTY_TYPE_INT, LV_STYLE_ARC_ROUNDED), - LV_PROPERTY_ID(STYLE, ARC_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_ARC_WIDTH), - LV_PROPERTY_ID(STYLE, BASE_DIR, LV_PROPERTY_TYPE_INT, LV_STYLE_BASE_DIR), - LV_PROPERTY_ID(STYLE, BG_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_BG_COLOR), - LV_PROPERTY_ID(STYLE, BG_GRAD, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_GRAD), - LV_PROPERTY_ID(STYLE, BG_GRAD_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_BG_GRAD_COLOR), - LV_PROPERTY_ID(STYLE, BG_GRAD_DIR, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_GRAD_DIR), - LV_PROPERTY_ID(STYLE, BG_GRAD_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_GRAD_OPA), - LV_PROPERTY_ID(STYLE, BG_GRAD_STOP, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_GRAD_STOP), - LV_PROPERTY_ID(STYLE, BG_IMAGE_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_IMAGE_OPA), - LV_PROPERTY_ID(STYLE, BG_IMAGE_RECOLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_BG_IMAGE_RECOLOR), - LV_PROPERTY_ID(STYLE, BG_IMAGE_RECOLOR_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_IMAGE_RECOLOR_OPA), - LV_PROPERTY_ID(STYLE, BG_IMAGE_SRC, LV_PROPERTY_TYPE_IMGSRC, LV_STYLE_BG_IMAGE_SRC), - LV_PROPERTY_ID(STYLE, BG_IMAGE_TILED, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_IMAGE_TILED), - LV_PROPERTY_ID(STYLE, BG_MAIN_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_MAIN_OPA), - LV_PROPERTY_ID(STYLE, BG_MAIN_STOP, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_MAIN_STOP), - LV_PROPERTY_ID(STYLE, BG_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BG_OPA), - LV_PROPERTY_ID(STYLE, BITMAP_MASK_SRC, LV_PROPERTY_TYPE_INT, LV_STYLE_BITMAP_MASK_SRC), - LV_PROPERTY_ID(STYLE, BLEND_MODE, LV_PROPERTY_TYPE_INT, LV_STYLE_BLEND_MODE), - LV_PROPERTY_ID(STYLE, BORDER_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_BORDER_COLOR), - LV_PROPERTY_ID(STYLE, BORDER_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_BORDER_OPA), - LV_PROPERTY_ID(STYLE, BORDER_POST, LV_PROPERTY_TYPE_INT, LV_STYLE_BORDER_POST), - LV_PROPERTY_ID(STYLE, BORDER_SIDE, LV_PROPERTY_TYPE_INT, LV_STYLE_BORDER_SIDE), - LV_PROPERTY_ID(STYLE, BORDER_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_BORDER_WIDTH), - LV_PROPERTY_ID(STYLE, CLIP_CORNER, LV_PROPERTY_TYPE_INT, LV_STYLE_CLIP_CORNER), - LV_PROPERTY_ID(STYLE, COLOR_FILTER_DSC, LV_PROPERTY_TYPE_INT, LV_STYLE_COLOR_FILTER_DSC), - LV_PROPERTY_ID(STYLE, COLOR_FILTER_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_COLOR_FILTER_OPA), - LV_PROPERTY_ID(STYLE, FLEX_CROSS_PLACE, LV_PROPERTY_TYPE_INT, LV_STYLE_FLEX_CROSS_PLACE), - LV_PROPERTY_ID(STYLE, FLEX_FLOW, LV_PROPERTY_TYPE_INT, LV_STYLE_FLEX_FLOW), - LV_PROPERTY_ID(STYLE, FLEX_GROW, LV_PROPERTY_TYPE_INT, LV_STYLE_FLEX_GROW), - LV_PROPERTY_ID(STYLE, FLEX_MAIN_PLACE, LV_PROPERTY_TYPE_INT, LV_STYLE_FLEX_MAIN_PLACE), - LV_PROPERTY_ID(STYLE, FLEX_TRACK_PLACE, LV_PROPERTY_TYPE_INT, LV_STYLE_FLEX_TRACK_PLACE), - LV_PROPERTY_ID(STYLE, GRID_CELL_COLUMN_POS, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_COLUMN_POS), - LV_PROPERTY_ID(STYLE, GRID_CELL_COLUMN_SPAN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_COLUMN_SPAN), - LV_PROPERTY_ID(STYLE, GRID_CELL_ROW_POS, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_ROW_POS), - LV_PROPERTY_ID(STYLE, GRID_CELL_ROW_SPAN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_ROW_SPAN), - LV_PROPERTY_ID(STYLE, GRID_CELL_X_ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_X_ALIGN), - LV_PROPERTY_ID(STYLE, GRID_CELL_Y_ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_CELL_Y_ALIGN), - LV_PROPERTY_ID(STYLE, GRID_COLUMN_ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_COLUMN_ALIGN), - LV_PROPERTY_ID(STYLE, GRID_COLUMN_DSC_ARRAY, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_COLUMN_DSC_ARRAY), - LV_PROPERTY_ID(STYLE, GRID_ROW_ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_ROW_ALIGN), - LV_PROPERTY_ID(STYLE, GRID_ROW_DSC_ARRAY, LV_PROPERTY_TYPE_INT, LV_STYLE_GRID_ROW_DSC_ARRAY), - LV_PROPERTY_ID(STYLE, HEIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_HEIGHT), - LV_PROPERTY_ID(STYLE, IMAGE_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_IMAGE_OPA), - LV_PROPERTY_ID(STYLE, IMAGE_RECOLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_IMAGE_RECOLOR), - LV_PROPERTY_ID(STYLE, IMAGE_RECOLOR_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_IMAGE_RECOLOR_OPA), - LV_PROPERTY_ID(STYLE, LAST_BUILT_IN_PROP, LV_PROPERTY_TYPE_INT, LV_STYLE_LAST_BUILT_IN_PROP), - LV_PROPERTY_ID(STYLE, LAYOUT, LV_PROPERTY_TYPE_INT, LV_STYLE_LAYOUT), - LV_PROPERTY_ID(STYLE, LENGTH, LV_PROPERTY_TYPE_INT, LV_STYLE_LENGTH), - LV_PROPERTY_ID(STYLE, LINE_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_LINE_COLOR), - LV_PROPERTY_ID(STYLE, LINE_DASH_GAP, LV_PROPERTY_TYPE_INT, LV_STYLE_LINE_DASH_GAP), - LV_PROPERTY_ID(STYLE, LINE_DASH_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_LINE_DASH_WIDTH), - LV_PROPERTY_ID(STYLE, LINE_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_LINE_OPA), - LV_PROPERTY_ID(STYLE, LINE_ROUNDED, LV_PROPERTY_TYPE_INT, LV_STYLE_LINE_ROUNDED), - LV_PROPERTY_ID(STYLE, LINE_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_LINE_WIDTH), - LV_PROPERTY_ID(STYLE, MARGIN_BOTTOM, LV_PROPERTY_TYPE_INT, LV_STYLE_MARGIN_BOTTOM), - LV_PROPERTY_ID(STYLE, MARGIN_LEFT, LV_PROPERTY_TYPE_INT, LV_STYLE_MARGIN_LEFT), - LV_PROPERTY_ID(STYLE, MARGIN_RIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_MARGIN_RIGHT), - LV_PROPERTY_ID(STYLE, MARGIN_TOP, LV_PROPERTY_TYPE_INT, LV_STYLE_MARGIN_TOP), - LV_PROPERTY_ID(STYLE, MAX_HEIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_MAX_HEIGHT), - LV_PROPERTY_ID(STYLE, MAX_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_MAX_WIDTH), - LV_PROPERTY_ID(STYLE, MIN_HEIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_MIN_HEIGHT), - LV_PROPERTY_ID(STYLE, MIN_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_MIN_WIDTH), - LV_PROPERTY_ID(STYLE, OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_OPA), - LV_PROPERTY_ID(STYLE, OPA_LAYERED, LV_PROPERTY_TYPE_INT, LV_STYLE_OPA_LAYERED), - LV_PROPERTY_ID(STYLE, OUTLINE_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_OUTLINE_COLOR), - LV_PROPERTY_ID(STYLE, OUTLINE_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_OUTLINE_OPA), - LV_PROPERTY_ID(STYLE, OUTLINE_PAD, LV_PROPERTY_TYPE_INT, LV_STYLE_OUTLINE_PAD), - LV_PROPERTY_ID(STYLE, OUTLINE_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_OUTLINE_WIDTH), - LV_PROPERTY_ID(STYLE, PAD_BOTTOM, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_BOTTOM), - LV_PROPERTY_ID(STYLE, PAD_COLUMN, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_COLUMN), - LV_PROPERTY_ID(STYLE, PAD_LEFT, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_LEFT), - LV_PROPERTY_ID(STYLE, PAD_RIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_RIGHT), - LV_PROPERTY_ID(STYLE, PAD_ROW, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_ROW), - LV_PROPERTY_ID(STYLE, PAD_TOP, LV_PROPERTY_TYPE_INT, LV_STYLE_PAD_TOP), - LV_PROPERTY_ID(STYLE, PROP_INV, LV_PROPERTY_TYPE_INT, LV_STYLE_PROP_INV), - LV_PROPERTY_ID(STYLE, RADIUS, LV_PROPERTY_TYPE_INT, LV_STYLE_RADIUS), - LV_PROPERTY_ID(STYLE, ROTARY_SENSITIVITY, LV_PROPERTY_TYPE_INT, LV_STYLE_ROTARY_SENSITIVITY), - LV_PROPERTY_ID(STYLE, SHADOW_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_SHADOW_COLOR), - LV_PROPERTY_ID(STYLE, SHADOW_OFFSET_X, LV_PROPERTY_TYPE_INT, LV_STYLE_SHADOW_OFFSET_X), - LV_PROPERTY_ID(STYLE, SHADOW_OFFSET_Y, LV_PROPERTY_TYPE_INT, LV_STYLE_SHADOW_OFFSET_Y), - LV_PROPERTY_ID(STYLE, SHADOW_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_SHADOW_OPA), - LV_PROPERTY_ID(STYLE, SHADOW_SPREAD, LV_PROPERTY_TYPE_INT, LV_STYLE_SHADOW_SPREAD), - LV_PROPERTY_ID(STYLE, SHADOW_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_SHADOW_WIDTH), - LV_PROPERTY_ID(STYLE, TEXT_ALIGN, LV_PROPERTY_TYPE_INT, LV_STYLE_TEXT_ALIGN), - LV_PROPERTY_ID(STYLE, TEXT_COLOR, LV_PROPERTY_TYPE_COLOR, LV_STYLE_TEXT_COLOR), - LV_PROPERTY_ID(STYLE, TEXT_DECOR, LV_PROPERTY_TYPE_INT, LV_STYLE_TEXT_DECOR), - LV_PROPERTY_ID(STYLE, TEXT_FONT, LV_PROPERTY_TYPE_FONT, LV_STYLE_TEXT_FONT), - LV_PROPERTY_ID(STYLE, TEXT_LETTER_SPACE, LV_PROPERTY_TYPE_INT, LV_STYLE_TEXT_LETTER_SPACE), - LV_PROPERTY_ID(STYLE, TEXT_LINE_SPACE, LV_PROPERTY_TYPE_INT, LV_STYLE_TEXT_LINE_SPACE), - LV_PROPERTY_ID(STYLE, TEXT_OPA, LV_PROPERTY_TYPE_INT, LV_STYLE_TEXT_OPA), - LV_PROPERTY_ID(STYLE, TRANSFORM_HEIGHT, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_HEIGHT), - LV_PROPERTY_ID(STYLE, TRANSFORM_PIVOT_X, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_PIVOT_X), - LV_PROPERTY_ID(STYLE, TRANSFORM_PIVOT_Y, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_PIVOT_Y), - LV_PROPERTY_ID(STYLE, TRANSFORM_ROTATION, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_ROTATION), - LV_PROPERTY_ID(STYLE, TRANSFORM_SCALE_X, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_SCALE_X), - LV_PROPERTY_ID(STYLE, TRANSFORM_SCALE_Y, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_SCALE_Y), - LV_PROPERTY_ID(STYLE, TRANSFORM_SKEW_X, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_SKEW_X), - LV_PROPERTY_ID(STYLE, TRANSFORM_SKEW_Y, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_SKEW_Y), - LV_PROPERTY_ID(STYLE, TRANSFORM_WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSFORM_WIDTH), - LV_PROPERTY_ID(STYLE, TRANSITION, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSITION), - LV_PROPERTY_ID(STYLE, TRANSLATE_X, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSLATE_X), - LV_PROPERTY_ID(STYLE, TRANSLATE_Y, LV_PROPERTY_TYPE_INT, LV_STYLE_TRANSLATE_Y), - LV_PROPERTY_ID(STYLE, WIDTH, LV_PROPERTY_TYPE_INT, LV_STYLE_WIDTH), - LV_PROPERTY_ID(STYLE, X, LV_PROPERTY_TYPE_INT, LV_STYLE_X), - LV_PROPERTY_ID(STYLE, Y, LV_PROPERTY_TYPE_INT, LV_STYLE_Y), -}; - -#endif -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/property/lv_textarea_properties.c b/L3_Middlewares/LVGL/src/widgets/property/lv_textarea_properties.c deleted file mode 100644 index 7bed65e..0000000 --- a/L3_Middlewares/LVGL/src/widgets/property/lv_textarea_properties.c +++ /dev/null @@ -1,37 +0,0 @@ - -/** - * GENERATED FILE, DO NOT EDIT IT! - * @file lv_textarea_properties.c - */ - -#include "../textarea/lv_textarea.h" - -#if LV_USE_OBJ_PROPERTY && LV_USE_OBJ_PROPERTY_NAME - -#if LV_USE_TEXTAREA -/** - * Textarea widget property names, name must be in order. - * Generated code from properties.py - */ -/* *INDENT-OFF* */ -const lv_property_name_t lv_textarea_property_names[15] = { - {"accepted_chars", LV_PROPERTY_TEXTAREA_ACCEPTED_CHARS,}, - {"current_char", LV_PROPERTY_TEXTAREA_CURRENT_CHAR,}, - {"cursor_click_pos", LV_PROPERTY_TEXTAREA_CURSOR_CLICK_POS,}, - {"cursor_pos", LV_PROPERTY_TEXTAREA_CURSOR_POS,}, - {"insert_replace", LV_PROPERTY_TEXTAREA_INSERT_REPLACE,}, - {"label", LV_PROPERTY_TEXTAREA_LABEL,}, - {"max_length", LV_PROPERTY_TEXTAREA_MAX_LENGTH,}, - {"one_line", LV_PROPERTY_TEXTAREA_ONE_LINE,}, - {"password_bullet", LV_PROPERTY_TEXTAREA_PASSWORD_BULLET,}, - {"password_mode", LV_PROPERTY_TEXTAREA_PASSWORD_MODE,}, - {"password_show_time", LV_PROPERTY_TEXTAREA_PASSWORD_SHOW_TIME,}, - {"placeholder_text", LV_PROPERTY_TEXTAREA_PLACEHOLDER_TEXT,}, - {"text", LV_PROPERTY_TEXTAREA_TEXT,}, - {"text_is_selected", LV_PROPERTY_TEXTAREA_TEXT_IS_SELECTED,}, - {"text_selection", LV_PROPERTY_TEXTAREA_TEXT_SELECTION,}, -}; -#endif /*LV_USE_TEXTAREA*/ - -/* *INDENT-ON* */ -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/roller/lv_roller_private.h b/L3_Middlewares/LVGL/src/widgets/roller/lv_roller_private.h deleted file mode 100644 index 5f784a3..0000000 --- a/L3_Middlewares/LVGL/src/widgets/roller/lv_roller_private.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file lv_roller_private.h - * - */ - -#ifndef LV_ROLLER_PRIVATE_H -#define LV_ROLLER_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_roller.h" - -#if LV_USE_ROLLER != 0 -#include "../../core/lv_obj_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_roller_t { - lv_obj_t obj; - uint32_t option_cnt; /**< Number of options*/ - uint32_t sel_opt_id; /**< Index of the current option*/ - uint32_t sel_opt_id_ori; /**< Store the original index on focus*/ - uint32_t inf_page_cnt; /**< Number of extra pages added to make the roller look infinite */ - lv_roller_mode_t mode : 2; - uint32_t moved : 1; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_ROLLER != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_ROLLER_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/scale/lv_scale.c b/L3_Middlewares/LVGL/src/widgets/scale/lv_scale.c deleted file mode 100644 index fbab460..0000000 --- a/L3_Middlewares/LVGL/src/widgets/scale/lv_scale.c +++ /dev/null @@ -1,1504 +0,0 @@ -/** - * @file lv_scale.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_scale_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_class_private.h" -#if LV_USE_SCALE != 0 - -#include "../../core/lv_group.h" -#include "../../misc/lv_assert.h" -#include "../../misc/lv_math.h" -#include "../../draw/lv_draw_arc.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_scale_class) - -#define LV_SCALE_LABEL_TXT_LEN (20U) -#define LV_SCALE_DEFAULT_ANGLE_RANGE ((uint32_t) 270U) -#define LV_SCALE_DEFAULT_ROTATION ((int32_t) 135U) -#define LV_SCALE_TICK_IDX_DEFAULT_ID ((uint32_t) 255U) -#define LV_SCALE_DEFAULT_LABEL_GAP ((uint32_t) 15U) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ - -static void lv_scale_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_scale_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_scale_event(const lv_obj_class_t * class_p, lv_event_t * event); - -static void scale_draw_main(lv_obj_t * obj, lv_event_t * event); -static void scale_draw_indicator(lv_obj_t * obj, lv_event_t * event); -static void scale_draw_label(lv_obj_t * obj, lv_event_t * event, lv_draw_label_dsc_t * label_dsc, - const uint32_t major_tick_idx, const int32_t tick_value, lv_point_t * tick_point_b, const uint32_t tick_idx); -static void scale_calculate_main_compensation(lv_obj_t * obj); - -static void scale_get_center(const lv_obj_t * obj, lv_point_t * center, int32_t * arc_r); -static void scale_get_tick_points(lv_obj_t * obj, const uint32_t tick_idx, bool is_major_tick, - lv_point_t * tick_point_a, lv_point_t * tick_point_b); -static void scale_get_label_coords(lv_obj_t * obj, lv_draw_label_dsc_t * label_dsc, lv_point_t * tick_point, - lv_area_t * label_coords); -static void scale_set_indicator_label_properties(lv_obj_t * obj, lv_draw_label_dsc_t * label_dsc, - lv_style_t * indicator_section_style); -static void scale_set_line_properties(lv_obj_t * obj, lv_draw_line_dsc_t * line_dsc, lv_style_t * section_style, - lv_part_t part); -static void scale_set_arc_properties(lv_obj_t * obj, lv_draw_arc_dsc_t * arc_dsc, lv_style_t * section_style); -/* Helpers */ -static void scale_find_section_tick_idx(lv_obj_t * obj); -static void scale_store_main_line_tick_width_compensation(lv_obj_t * obj, const uint32_t tick_idx, - const bool is_major_tick, const int32_t major_tick_width, const int32_t minor_tick_width); -static void scale_store_section_line_tick_width_compensation(lv_obj_t * obj, const bool is_major_tick, - lv_draw_line_dsc_t * major_tick_dsc, lv_draw_line_dsc_t * minor_tick_dsc, - const int32_t tick_value, const uint8_t tick_idx, lv_point_t * tick_point_a); -static void scale_build_custom_label_text(lv_obj_t * obj, lv_draw_label_dsc_t * label_dsc, - const uint16_t major_tick_idx); - -static void scale_free_line_needle_points_cb(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ - -const lv_obj_class_t lv_scale_class = { - .constructor_cb = lv_scale_constructor, - .destructor_cb = lv_scale_destructor, - .event_cb = lv_scale_event, - .instance_size = sizeof(lv_scale_t), - .editable = LV_OBJ_CLASS_EDITABLE_TRUE, - .base_class = &lv_obj_class, - .name = "scale", -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_scale_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -/*====================== - * Add/remove functions - *=====================*/ - -/* - * New object specific "add" or "remove" functions come here - */ - -/*===================== - * Setter functions - *====================*/ - -void lv_scale_set_mode(lv_obj_t * obj, lv_scale_mode_t mode) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - - scale->mode = mode; - - lv_obj_invalidate(obj); -} - -void lv_scale_set_total_tick_count(lv_obj_t * obj, uint32_t total_tick_count) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - - scale->total_tick_count = total_tick_count; - - lv_obj_invalidate(obj); -} - -void lv_scale_set_major_tick_every(lv_obj_t * obj, uint32_t major_tick_every) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - - scale->major_tick_every = major_tick_every; - - lv_obj_invalidate(obj); -} - -void lv_scale_set_label_show(lv_obj_t * obj, bool show_label) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - - scale->label_enabled = show_label; - - lv_obj_invalidate(obj); -} - -void lv_scale_set_range(lv_obj_t * obj, int32_t min, int32_t max) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - - scale->range_min = min; - scale->range_max = max; - - lv_obj_invalidate(obj); -} - -void lv_scale_set_angle_range(lv_obj_t * obj, uint32_t angle_range) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - - scale->angle_range = angle_range; - - lv_obj_invalidate(obj); -} - -void lv_scale_set_rotation(lv_obj_t * obj, int32_t rotation) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - - scale->rotation = rotation; - - lv_obj_invalidate(obj); -} - -void lv_scale_set_line_needle_value(lv_obj_t * obj, lv_obj_t * needle_line, int32_t needle_length, - int32_t value) -{ - int32_t angle; - int32_t scale_width, scale_height; - int32_t actual_needle_length; - int32_t needle_length_x, needle_length_y; - lv_point_precise_t * needle_line_points = NULL; - - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - if((scale->mode != LV_SCALE_MODE_ROUND_INNER) && - (scale->mode != LV_SCALE_MODE_ROUND_OUTER)) { - return; - } - - lv_obj_align(needle_line, LV_ALIGN_TOP_LEFT, 0, 0); - - scale_width = lv_obj_get_style_width(obj, LV_PART_MAIN); - scale_height = lv_obj_get_style_height(obj, LV_PART_MAIN); - - if(scale_width != scale_height) { - return; - } - - if(needle_length >= scale_width / 2) { - actual_needle_length = scale_width / 2; - } - else if(needle_length >= 0) { - actual_needle_length = needle_length; - } - else if(needle_length + scale_width / 2 < 0) { - actual_needle_length = 0; - } - else { - actual_needle_length = scale_width / 2 + needle_length; - } - - if(value < scale->range_min) { - angle = 0; - } - else if(value > scale->range_max) { - angle = scale->angle_range; - } - else { - angle = scale->angle_range * (value - scale->range_min) / (scale->range_max - scale->range_min); - } - - needle_length_x = (actual_needle_length * lv_trigo_cos(scale->rotation + angle)) >> LV_TRIGO_SHIFT; - needle_length_y = (actual_needle_length * lv_trigo_sin(scale->rotation + angle)) >> LV_TRIGO_SHIFT; - - if(lv_line_is_point_array_mutable(needle_line) && lv_line_get_point_count(needle_line) >= 2) { - needle_line_points = lv_line_get_points_mutable(needle_line); - } - - if(needle_line_points == NULL) { - uint32_t i; - uint32_t line_event_cnt = lv_obj_get_event_count(needle_line); - for(i = 0; i < line_event_cnt; i--) { - lv_event_dsc_t * dsc = lv_obj_get_event_dsc(needle_line, i); - if(lv_event_dsc_get_cb(dsc) == scale_free_line_needle_points_cb) { - needle_line_points = lv_event_dsc_get_user_data(dsc); - break; - } - } - } - - if(needle_line_points == NULL) { - needle_line_points = lv_malloc(sizeof(lv_point_precise_t) * 2); - LV_ASSERT_MALLOC(needle_line_points); - if(needle_line_points == NULL) return; - lv_obj_add_event_cb(needle_line, scale_free_line_needle_points_cb, LV_EVENT_DELETE, needle_line_points); - } - - needle_line_points[0].x = scale_width / 2; - needle_line_points[0].y = scale_height / 2; - needle_line_points[1].x = scale_width / 2 + needle_length_x; - needle_line_points[1].y = scale_height / 2 + needle_length_y; - - lv_line_set_points_mutable(needle_line, needle_line_points, 2); -} - -void lv_scale_set_image_needle_value(lv_obj_t * obj, lv_obj_t * needle_img, int32_t value) -{ - int32_t angle; - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - if((scale->mode != LV_SCALE_MODE_ROUND_INNER) && - (scale->mode != LV_SCALE_MODE_ROUND_OUTER)) { - return; - } - - if(value < scale->range_min) { - angle = 0; - } - else if(value > scale->range_max) { - angle = scale->angle_range; - } - else { - angle = scale->angle_range * (value - scale->range_min) / (scale->range_max - scale->range_min); - } - - lv_image_set_rotation(needle_img, (scale->rotation + angle) * 10); -} - -void lv_scale_set_text_src(lv_obj_t * obj, const char * txt_src[]) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - - scale->txt_src = txt_src; - scale->custom_label_cnt = 0; - if(scale->txt_src) { - int32_t idx; - for(idx = 0; txt_src[idx]; ++idx) { - scale->custom_label_cnt++; - } - } - - lv_obj_invalidate(obj); -} - -void lv_scale_set_post_draw(lv_obj_t * obj, bool en) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - - scale->post_draw = en; - - lv_obj_invalidate(obj); -} - -void lv_scale_set_draw_ticks_on_top(lv_obj_t * obj, bool en) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_scale_t * scale = (lv_scale_t *)obj; - - scale->draw_ticks_on_top = en; - - lv_obj_invalidate(obj); -} - -lv_scale_section_t * lv_scale_add_section(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_scale_t * scale = (lv_scale_t *)obj; - lv_scale_section_t * section = lv_ll_ins_head(&scale->section_ll); - LV_ASSERT_MALLOC(section); - if(section == NULL) return NULL; - - /* Section default values */ - section->main_style = NULL; - section->indicator_style = NULL; - section->items_style = NULL; - section->minor_range = 0U; - section->major_range = 0U; - section->first_tick_idx_in_section = LV_SCALE_TICK_IDX_DEFAULT_ID; - section->last_tick_idx_in_section = LV_SCALE_TICK_IDX_DEFAULT_ID; - section->first_tick_idx_is_major = 0U; - section->last_tick_idx_is_major = 0U; - section->first_tick_in_section_width = 0U; - section->last_tick_in_section_width = 0U; - - return section; -} - -void lv_scale_section_set_range(lv_scale_section_t * section, int32_t minor_range, int32_t major_range) -{ - if(NULL == section) return; - - section->minor_range = minor_range; - section->major_range = major_range; -} - -void lv_scale_section_set_style(lv_scale_section_t * section, lv_part_t part, lv_style_t * section_part_style) -{ - if(NULL == section) return; - - switch(part) { - case LV_PART_MAIN: - section->main_style = section_part_style; - break; - case LV_PART_INDICATOR: - section->indicator_style = section_part_style; - break; - case LV_PART_ITEMS: - section->items_style = section_part_style; - break; - default: - /* Invalid part */ - break; - } -} - -/*===================== - * Getter functions - *====================*/ - -lv_scale_mode_t lv_scale_get_mode(lv_obj_t * obj) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - return scale->mode; -} - -int32_t lv_scale_get_total_tick_count(lv_obj_t * obj) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - return scale->total_tick_count; -} - -int32_t lv_scale_get_major_tick_every(lv_obj_t * obj) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - return scale->major_tick_every; -} - -bool lv_scale_get_label_show(lv_obj_t * obj) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - return scale->label_enabled; -} - -uint32_t lv_scale_get_angle_range(lv_obj_t * obj) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - return scale->angle_range; -} - -int32_t lv_scale_get_range_min_value(lv_obj_t * obj) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - return scale->range_min; -} - -int32_t lv_scale_get_range_max_value(lv_obj_t * obj) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - return scale->range_max; -} - -/*===================== - * Other functions - *====================*/ - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_scale_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_TRACE_OBJ_CREATE("begin"); - - lv_scale_t * scale = (lv_scale_t *)obj; - - lv_ll_init(&scale->section_ll, sizeof(lv_scale_section_t)); - - scale->total_tick_count = LV_SCALE_TOTAL_TICK_COUNT_DEFAULT; - scale->major_tick_every = LV_SCALE_MAJOR_TICK_EVERY_DEFAULT; - scale->mode = LV_SCALE_MODE_HORIZONTAL_BOTTOM; - scale->label_enabled = LV_SCALE_LABEL_ENABLED_DEFAULT; - scale->angle_range = LV_SCALE_DEFAULT_ANGLE_RANGE; - scale->rotation = LV_SCALE_DEFAULT_ROTATION; - scale->range_min = 0U; - scale->range_max = 100U; - scale->last_tick_width = 0U; - scale->first_tick_width = 0U; - scale->post_draw = false; - scale->draw_ticks_on_top = false; - scale->custom_label_cnt = 0U; - scale->txt_src = NULL; - - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); - - LV_TRACE_OBJ_CREATE("finished"); -} - -static void lv_scale_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_TRACE_OBJ_CREATE("begin"); - - lv_scale_t * scale = (lv_scale_t *)obj; - lv_scale_section_t * section; - while(scale->section_ll.head) { - section = lv_ll_get_head(&scale->section_ll); - lv_ll_remove(&scale->section_ll, section); - lv_free(section); - } - lv_ll_clear(&scale->section_ll); - - LV_TRACE_OBJ_CREATE("finished"); -} - -static void lv_scale_event(const lv_obj_class_t * class_p, lv_event_t * event) -{ - LV_UNUSED(class_p); - - /*Call the ancestor's event handler*/ - lv_result_t res = lv_obj_event_base(MY_CLASS, event); - if(res != LV_RESULT_OK) return; - - lv_event_code_t event_code = lv_event_get_code(event); - lv_obj_t * obj = lv_event_get_current_target(event); - lv_scale_t * scale = (lv_scale_t *) obj; - LV_UNUSED(scale); - - if(event_code == LV_EVENT_DRAW_MAIN) { - if(scale->post_draw == false) { - scale_find_section_tick_idx(obj); - scale_calculate_main_compensation(obj); - - if(scale->draw_ticks_on_top) { - scale_draw_main(obj, event); - scale_draw_indicator(obj, event); - } - else { - scale_draw_indicator(obj, event); - scale_draw_main(obj, event); - } - } - } - if(event_code == LV_EVENT_DRAW_POST) { - if(scale->post_draw == true) { - scale_find_section_tick_idx(obj); - scale_calculate_main_compensation(obj); - - if(scale->draw_ticks_on_top) { - scale_draw_main(obj, event); - scale_draw_indicator(obj, event); - } - else { - scale_draw_indicator(obj, event); - scale_draw_main(obj, event); - } - } - } - else if(event_code == LV_EVENT_REFR_EXT_DRAW_SIZE) { - /* NOTE: Extend scale draw size so the first tick label can be shown */ - lv_event_set_ext_draw_size(event, 100); - } - else { - /* Nothing to do. Invalid event */ - } -} - -static void scale_draw_indicator(lv_obj_t * obj, lv_event_t * event) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - lv_layer_t * layer = lv_event_get_layer(event); - - if(scale->total_tick_count <= 1) return; - - lv_draw_label_dsc_t label_dsc; - lv_draw_label_dsc_init(&label_dsc); - /* Formatting the labels with the configured style for LV_PART_INDICATOR */ - lv_obj_init_draw_label_dsc(obj, LV_PART_INDICATOR, &label_dsc); - - /* Major tick style */ - lv_draw_line_dsc_t major_tick_dsc; - lv_draw_line_dsc_init(&major_tick_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_INDICATOR, &major_tick_dsc); - if(LV_SCALE_MODE_ROUND_OUTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { - major_tick_dsc.raw_end = 0; - } - - /* Configure line draw descriptor for the minor tick drawing */ - lv_draw_line_dsc_t minor_tick_dsc; - lv_draw_line_dsc_init(&minor_tick_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &minor_tick_dsc); - - /* Main line style */ - lv_draw_line_dsc_t main_line_dsc; - lv_draw_line_dsc_init(&main_line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_MAIN, &main_line_dsc); - - const uint32_t total_tick_count = scale->total_tick_count; - uint32_t tick_idx = 0; - uint32_t major_tick_idx = 0; - for(tick_idx = 0; tick_idx < total_tick_count; tick_idx++) { - /* A major tick is the one which has a label in it */ - bool is_major_tick = false; - if(tick_idx % scale->major_tick_every == 0) is_major_tick = true; - if(is_major_tick) major_tick_idx++; - - const int32_t tick_value = lv_map(tick_idx, 0U, total_tick_count - 1, scale->range_min, scale->range_max); - - label_dsc.base.id1 = tick_idx; - label_dsc.base.id2 = tick_value; - - /* Overwrite label and tick properties if tick value is within section range */ - lv_scale_section_t * section; - LV_LL_READ_BACK(&scale->section_ll, section) { - if(section->minor_range <= tick_value && section->major_range >= tick_value) { - if(is_major_tick) { - scale_set_indicator_label_properties(obj, &label_dsc, section->indicator_style); - scale_set_line_properties(obj, &major_tick_dsc, section->indicator_style, LV_PART_INDICATOR); - } - else { - scale_set_line_properties(obj, &minor_tick_dsc, section->items_style, LV_PART_ITEMS); - } - break; - } - else { - /* Tick is not in section, get the proper styles */ - lv_obj_init_draw_label_dsc(obj, LV_PART_INDICATOR, &label_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_INDICATOR, &major_tick_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &minor_tick_dsc); - } - } - - /* The tick is represented by a line. We need two points to draw it */ - lv_point_t tick_point_a; - lv_point_t tick_point_b; - scale_get_tick_points(obj, tick_idx, is_major_tick, &tick_point_a, &tick_point_b); - - /* Setup a label if they're enabled and we're drawing a major tick */ - if(scale->label_enabled && is_major_tick) { - scale_draw_label(obj, event, &label_dsc, major_tick_idx, tick_value, &tick_point_b, tick_idx); - } - - if(is_major_tick) { - major_tick_dsc.p1 = lv_point_to_precise(&tick_point_a); - major_tick_dsc.p2 = lv_point_to_precise(&tick_point_b); - lv_draw_line(layer, &major_tick_dsc); - } - else { - minor_tick_dsc.p1 = lv_point_to_precise(&tick_point_a); - minor_tick_dsc.p2 = lv_point_to_precise(&tick_point_b); - lv_draw_line(layer, &minor_tick_dsc); - } - } -} - -static void scale_draw_label(lv_obj_t * obj, lv_event_t * event, lv_draw_label_dsc_t * label_dsc, - const uint32_t major_tick_idx, const int32_t tick_value, lv_point_t * tick_point_b, - const uint32_t tick_idx) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - lv_layer_t * layer = lv_event_get_layer(event); - - /* Label text setup */ - char text_buffer[LV_SCALE_LABEL_TXT_LEN] = {0}; - lv_area_t label_coords; - - /* Check if the custom text array has element for this major tick index */ - if(scale->txt_src) { - scale_build_custom_label_text(obj, label_dsc, major_tick_idx); - } - else { /* Add label with mapped values */ - lv_snprintf(text_buffer, sizeof(text_buffer), "%" LV_PRId32, tick_value); - label_dsc->text = text_buffer; - label_dsc->text_local = 1; - } - - if((LV_SCALE_MODE_VERTICAL_LEFT == scale->mode || LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode) - || (LV_SCALE_MODE_HORIZONTAL_BOTTOM == scale->mode || LV_SCALE_MODE_HORIZONTAL_TOP == scale->mode)) { - scale_get_label_coords(obj, label_dsc, tick_point_b, &label_coords); - } - else if(LV_SCALE_MODE_ROUND_OUTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { - lv_area_t scale_area; - lv_obj_get_content_coords(obj, &scale_area); - - /* Find the center of the scale */ - lv_point_t center_point; - int32_t radius_edge = LV_MIN(lv_area_get_width(&scale_area) / 2U, lv_area_get_height(&scale_area) / 2U); - center_point.x = scale_area.x1 + radius_edge; - center_point.y = scale_area.y1 + radius_edge; - - const int32_t major_len = lv_obj_get_style_length(obj, LV_PART_INDICATOR); - uint32_t label_gap = LV_SCALE_DEFAULT_LABEL_GAP; /* TODO: Add to style properties */ - - /* Also take into consideration the letter space of the style */ - int32_t angle_upscale = ((tick_idx * scale->angle_range) * 10U) / (scale->total_tick_count - 1); - angle_upscale += scale->rotation * 10U; - - uint32_t radius_text = 0; - if(LV_SCALE_MODE_ROUND_INNER == scale->mode) { - radius_text = (radius_edge - major_len) - (label_gap + label_dsc->letter_space); - } - else if(LV_SCALE_MODE_ROUND_OUTER == scale->mode) { - radius_text = (radius_edge + major_len) + (label_gap + label_dsc->letter_space); - } - else { /* Nothing to do */ } - - lv_point_t point; - point.x = center_point.x + radius_text; - point.y = center_point.y; - lv_point_transform(&point, angle_upscale, LV_SCALE_NONE, LV_SCALE_NONE, ¢er_point, false); - scale_get_label_coords(obj, label_dsc, &point, &label_coords); - } - /* Invalid mode */ - else { - return; - } - - lv_draw_label(layer, label_dsc, &label_coords); -} - -static void scale_calculate_main_compensation(lv_obj_t * obj) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - - const uint32_t total_tick_count = scale->total_tick_count; - - if(total_tick_count <= 1) return; - /* Not supported in round modes */ - if(LV_SCALE_MODE_ROUND_OUTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) return; - - /* Major tick style */ - lv_draw_line_dsc_t major_tick_dsc; - lv_draw_line_dsc_init(&major_tick_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_INDICATOR, &major_tick_dsc); - - /* Configure line draw descriptor for the minor tick drawing */ - lv_draw_line_dsc_t minor_tick_dsc; - lv_draw_line_dsc_init(&minor_tick_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &minor_tick_dsc); - - uint32_t tick_idx = 0; - for(tick_idx = 0; tick_idx < total_tick_count; tick_idx++) { - - const bool is_major_tick = tick_idx % scale->major_tick_every == 0; - - const int32_t tick_value = lv_map(tick_idx, 0U, total_tick_count - 1, scale->range_min, scale->range_max); - - /* Overwrite label and tick properties if tick value is within section range */ - lv_scale_section_t * section; - LV_LL_READ_BACK(&scale->section_ll, section) { - if(section->minor_range <= tick_value && section->major_range >= tick_value) { - if(is_major_tick) { - scale_set_line_properties(obj, &major_tick_dsc, section->indicator_style, LV_PART_INDICATOR); - } - else { - scale_set_line_properties(obj, &minor_tick_dsc, section->items_style, LV_PART_ITEMS); - } - break; - } - else { - /* Tick is not in section, get the proper styles */ - lv_obj_init_draw_line_dsc(obj, LV_PART_INDICATOR, &major_tick_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &minor_tick_dsc); - } - } - - /* The tick is represented by a line. We need two points to draw it */ - lv_point_t tick_point_a; - lv_point_t tick_point_b; - scale_get_tick_points(obj, tick_idx, is_major_tick, &tick_point_a, &tick_point_b); - - /* Store initial and last tick widths to be used in the main line drawing */ - scale_store_main_line_tick_width_compensation(obj, tick_idx, is_major_tick, major_tick_dsc.width, minor_tick_dsc.width); - /* Store the first and last section tick vertical/horizontal position */ - scale_store_section_line_tick_width_compensation(obj, is_major_tick, &major_tick_dsc, &minor_tick_dsc, - tick_value, tick_idx, &tick_point_a); - } -} - -static void scale_draw_main(lv_obj_t * obj, lv_event_t * event) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - lv_layer_t * layer = lv_event_get_layer(event); - - if(scale->total_tick_count <= 1) return; - - if((LV_SCALE_MODE_VERTICAL_LEFT == scale->mode || LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode) - || (LV_SCALE_MODE_HORIZONTAL_BOTTOM == scale->mode || LV_SCALE_MODE_HORIZONTAL_TOP == scale->mode)) { - - /* Configure both line and label draw descriptors for the tick and label drawings */ - lv_draw_line_dsc_t line_dsc; - lv_draw_line_dsc_init(&line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_MAIN, &line_dsc); - - /* Get style properties so they can be used in the main line drawing */ - const int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - const int32_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; - const int32_t pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN) + border_width; - const int32_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; - const int32_t pad_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN) + border_width; - - int32_t x_ofs = 0U; - int32_t y_ofs = 0U; - - if(LV_SCALE_MODE_VERTICAL_LEFT == scale->mode) { - x_ofs = obj->coords.x2 + (line_dsc.width / 2U) - pad_right; - y_ofs = obj->coords.y1 + pad_top; - } - else if(LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode) { - x_ofs = obj->coords.x1 + (line_dsc.width / 2U) + pad_left; - y_ofs = obj->coords.y1 + pad_top; - } - if(LV_SCALE_MODE_HORIZONTAL_BOTTOM == scale->mode) { - x_ofs = obj->coords.x1 + pad_right; - y_ofs = obj->coords.y1 + (line_dsc.width / 2U) + pad_top; - } - else if(LV_SCALE_MODE_HORIZONTAL_TOP == scale->mode) { - x_ofs = obj->coords.x1 + pad_left; - y_ofs = obj->coords.y2 + (line_dsc.width / 2U) - pad_bottom; - } - else { /* Nothing to do */ } - - lv_point_t main_line_point_a; - lv_point_t main_line_point_b; - - /* Setup the tick points */ - if(LV_SCALE_MODE_VERTICAL_LEFT == scale->mode || LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode) { - main_line_point_a.x = x_ofs - 1U; - main_line_point_a.y = y_ofs; - main_line_point_b.x = x_ofs - 1U; - main_line_point_b.y = obj->coords.y2 - pad_bottom; - - /* Adjust main line with initial and last tick width */ - main_line_point_a.y -= scale->last_tick_width / 2U; - main_line_point_b.y += scale->first_tick_width / 2U; - } - else { - main_line_point_a.x = x_ofs; - main_line_point_a.y = y_ofs; - /* X of second point starts at the edge of the object minus the left pad */ - main_line_point_b.x = obj->coords.x2 - (pad_left); - main_line_point_b.y = y_ofs; - - /* Adjust main line with initial and last tick width */ - main_line_point_a.x -= scale->last_tick_width / 2U; - main_line_point_b.x += scale->first_tick_width / 2U; - } - - line_dsc.p1 = lv_point_to_precise(&main_line_point_a); - line_dsc.p2 = lv_point_to_precise(&main_line_point_b); - lv_draw_line(layer, &line_dsc); - - lv_scale_section_t * section; - LV_LL_READ_BACK(&scale->section_ll, section) { - lv_draw_line_dsc_t section_line_dsc; - lv_draw_line_dsc_init(§ion_line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_MAIN, §ion_line_dsc); - - /* Calculate the points of the section line */ - lv_point_t section_point_a; - lv_point_t section_point_b; - - const int32_t first_tick_width_halved = (int32_t)(section->first_tick_in_section_width / 2U); - const int32_t last_tick_width_halved = (int32_t)(section->last_tick_in_section_width / 2U); - - /* Calculate the position of the section based on the ticks (first and last) index */ - if(LV_SCALE_MODE_VERTICAL_LEFT == scale->mode || LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode) { - /* Calculate position of the first tick in the section */ - section_point_a.x = main_line_point_a.x; - section_point_a.y = section->first_tick_in_section.y + first_tick_width_halved; - - /* Calculate position of the last tick in the section */ - section_point_b.x = main_line_point_a.x; - section_point_b.y = section->last_tick_in_section.y - last_tick_width_halved; - } - else { - /* Calculate position of the first tick in the section */ - section_point_a.x = section->first_tick_in_section.x - first_tick_width_halved; - section_point_a.y = main_line_point_a.y; - - /* Calculate position of the last tick in the section */ - section_point_b.x = section->last_tick_in_section.x + last_tick_width_halved; - section_point_b.y = main_line_point_a.y; - } - - scale_set_line_properties(obj, §ion_line_dsc, section->main_style, LV_PART_MAIN); - - section_line_dsc.p1.x = section_point_a.x; - section_line_dsc.p1.y = section_point_a.y; - section_line_dsc.p2.x = section_point_b.x; - section_line_dsc.p2.y = section_point_b.y; - lv_draw_line(layer, §ion_line_dsc); - } - } - else if(LV_SCALE_MODE_ROUND_OUTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { - /* Configure arc draw descriptors for the main part */ - lv_draw_arc_dsc_t arc_dsc; - lv_draw_arc_dsc_init(&arc_dsc); - lv_obj_init_draw_arc_dsc(obj, LV_PART_MAIN, &arc_dsc); - - lv_point_t arc_center; - int32_t arc_radius; - scale_get_center(obj, &arc_center, &arc_radius); - - /* TODO: Add compensation for the width of the first and last tick over the arc */ - const int32_t start_angle = lv_map(scale->range_min, scale->range_min, scale->range_max, scale->rotation, - scale->rotation + scale->angle_range); - const int32_t end_angle = lv_map(scale->range_max, scale->range_min, scale->range_max, scale->rotation, - scale->rotation + scale->angle_range); - - arc_dsc.center = arc_center; - arc_dsc.radius = arc_radius; - arc_dsc.start_angle = start_angle; - arc_dsc.end_angle = end_angle; - - lv_draw_arc(layer, &arc_dsc); - - lv_scale_section_t * section; - LV_LL_READ_BACK(&scale->section_ll, section) { - lv_draw_arc_dsc_t main_arc_section_dsc; - lv_draw_arc_dsc_init(&main_arc_section_dsc); - lv_obj_init_draw_arc_dsc(obj, LV_PART_MAIN, &main_arc_section_dsc); - - lv_point_t section_arc_center; - int32_t section_arc_radius; - scale_get_center(obj, §ion_arc_center, §ion_arc_radius); - - /* TODO: Add compensation for the width of the first and last tick over the arc */ - const int32_t section_start_angle = lv_map(section->minor_range, scale->range_min, scale->range_max, scale->rotation, - scale->rotation + scale->angle_range); - const int32_t section_end_angle = lv_map(section->major_range, scale->range_min, scale->range_max, scale->rotation, - scale->rotation + scale->angle_range); - - scale_set_arc_properties(obj, &main_arc_section_dsc, section->main_style); - - main_arc_section_dsc.center = section_arc_center; - main_arc_section_dsc.radius = section_arc_radius; - main_arc_section_dsc.start_angle = section_start_angle; - main_arc_section_dsc.end_angle = section_end_angle; - - lv_draw_arc(layer, &main_arc_section_dsc); - } - } - else { /* Nothing to do */ } -} - -/** - * Get center point and radius of scale arc - * @param obj pointer to a scale object - * @param center pointer to center - * @param arc_r pointer to arc radius - */ -static void scale_get_center(const lv_obj_t * obj, lv_point_t * center, int32_t * arc_r) -{ - int32_t left_bg = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - int32_t right_bg = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); - int32_t top_bg = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - int32_t bottom_bg = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); - - int32_t r = (LV_MIN(lv_obj_get_width(obj) - left_bg - right_bg, lv_obj_get_height(obj) - top_bg - bottom_bg)) / 2U; - - center->x = obj->coords.x1 + r + left_bg; - center->y = obj->coords.y1 + r + top_bg; - - if(arc_r) *arc_r = r; -} - -/** - * Get points for ticks - * - * In order to draw ticks we need two points, this interface returns both points for all scale modes. - * - * @param obj pointer to a scale object - * @param tick_idx index of the current tick - * @param is_major_tick true if tick_idx is a major tick - * @param tick_point_a pointer to point 'a' of the tick - * @param tick_point_b pointer to point 'b' of the tick - */ -static void scale_get_tick_points(lv_obj_t * obj, const uint32_t tick_idx, bool is_major_tick, - lv_point_t * tick_point_a, lv_point_t * tick_point_b) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - - /* Main line style */ - lv_draw_line_dsc_t main_line_dsc; - lv_draw_line_dsc_init(&main_line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_MAIN, &main_line_dsc); - - int32_t minor_len = 0; - int32_t major_len = 0; - - if(is_major_tick) { - major_len = lv_obj_get_style_length(obj, LV_PART_INDICATOR); - } - else { - minor_len = lv_obj_get_style_length(obj, LV_PART_ITEMS); - } - - if((LV_SCALE_MODE_VERTICAL_LEFT == scale->mode || LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode) - || (LV_SCALE_MODE_HORIZONTAL_BOTTOM == scale->mode || LV_SCALE_MODE_HORIZONTAL_TOP == scale->mode)) { - - /* Get style properties so they can be used in the tick and label drawing */ - const int32_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - const int32_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; - const int32_t pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN) + border_width; - const int32_t pad_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN) + border_width; - const int32_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; - const int32_t tick_pad_right = lv_obj_get_style_pad_right(obj, LV_PART_ITEMS); - const int32_t tick_pad_left = lv_obj_get_style_pad_left(obj, LV_PART_ITEMS); - const int32_t tick_pad_top = lv_obj_get_style_pad_top(obj, LV_PART_ITEMS); - const int32_t tick_pad_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_ITEMS); - - int32_t x_ofs = 0U; - int32_t y_ofs = 0U; - - if(LV_SCALE_MODE_VERTICAL_LEFT == scale->mode) { - x_ofs = obj->coords.x2 + (main_line_dsc.width / 2U) - pad_right; - y_ofs = obj->coords.y1 + (pad_top + tick_pad_top); - } - else if(LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode) { - x_ofs = obj->coords.x1 + (main_line_dsc.width / 2U) + pad_left; - y_ofs = obj->coords.y1 + (pad_top + tick_pad_top); - } - else if(LV_SCALE_MODE_HORIZONTAL_BOTTOM == scale->mode) { - x_ofs = obj->coords.x1 + (pad_right + tick_pad_right); - y_ofs = obj->coords.y1 + (main_line_dsc.width / 2U) + pad_top; - } - /* LV_SCALE_MODE_HORIZONTAL_TOP == scale->mode */ - else { - x_ofs = obj->coords.x1 + (pad_left + tick_pad_left); - y_ofs = obj->coords.y2 + (main_line_dsc.width / 2U) - pad_bottom; - } - - /* Adjust length when tick will be drawn on horizontal top or vertical right scales */ - if((LV_SCALE_MODE_HORIZONTAL_TOP == scale->mode) || (LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode)) { - if(is_major_tick) { - major_len *= -1; - } - else { - minor_len *= -1; - } - } - else { /* Nothing to do */ } - - const int32_t tick_length = is_major_tick ? major_len : minor_len; - /* NOTE - * Minus 1 because tick count starts at 0 - * TODO - * What if total_tick_count is 1? This will lead to an division by 0 further down */ - const uint32_t tmp_tick_count = scale->total_tick_count - 1U; - - /* Calculate the position of the tick points based on the mode and tick index */ - if(LV_SCALE_MODE_VERTICAL_LEFT == scale->mode || LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode) { - /* Vertical position starts at y2 of the scale main line, we start at y2 because the ticks are drawn from bottom to top */ - int32_t vertical_position = obj->coords.y2 - (pad_bottom + tick_pad_bottom); - - /* Position the last tick */ - if(tmp_tick_count == tick_idx) { - vertical_position = y_ofs; - } - /* Otherwise adjust the tick position depending of its index and number of ticks on the scale */ - else if(0 != tick_idx) { - const int32_t scale_total_height = lv_obj_get_height(obj) - (pad_top + pad_bottom + tick_pad_top + tick_pad_bottom); - const int32_t offset = ((int32_t) tick_idx * (int32_t) scale_total_height) / (int32_t)(tmp_tick_count); - vertical_position -= offset; - } - else { /* Nothing to do */ } - - tick_point_a->x = x_ofs - 1U; /* Move extra pixel out of scale boundary */ - tick_point_a->y = vertical_position; - tick_point_b->x = tick_point_a->x - tick_length; - tick_point_b->y = vertical_position; - } - else { - /* Horizontal position starts at x1 of the scale main line */ - int32_t horizontal_position = x_ofs; - - /* Position the last tick */ - if(tmp_tick_count == tick_idx) { - horizontal_position = obj->coords.x2 - (pad_left + tick_pad_left); - } - /* Otherwise adjust the tick position depending of its index and number of ticks on the scale */ - else if(0U != tick_idx) { - const int32_t scale_total_width = lv_obj_get_width(obj) - (pad_right + pad_left + tick_pad_right + tick_pad_left); - const int32_t offset = ((int32_t) tick_idx * (int32_t) scale_total_width) / (int32_t)(tmp_tick_count); - horizontal_position += offset; - } - else { /* Nothing to do */ } - - tick_point_a->x = horizontal_position; - tick_point_a->y = y_ofs; - tick_point_b->x = horizontal_position; - tick_point_b->y = tick_point_a->y + tick_length; - } - } - else if(LV_SCALE_MODE_ROUND_OUTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { - lv_area_t scale_area; - lv_obj_get_content_coords(obj, &scale_area); - - /* Find the center of the scale */ - lv_point_t center_point; - const int32_t radius_edge = LV_MIN(lv_area_get_width(&scale_area) / 2U, lv_area_get_height(&scale_area) / 2U); - center_point.x = scale_area.x1 + radius_edge; - center_point.y = scale_area.y1 + radius_edge; - - int32_t angle_upscale = ((tick_idx * scale->angle_range) * 10U) / (scale->total_tick_count - 1); - angle_upscale += scale->rotation * 10U; - - /* Draw a little bit longer lines to be sure the mask will clip them correctly - * and to get a better precision. Adding the main line width to the calculation so we don't have gaps - * between the arc and the ticks */ - int32_t point_closer_to_arc = 0; - int32_t adjusted_radio_with_tick_len = 0; - if(LV_SCALE_MODE_ROUND_INNER == scale->mode) { - point_closer_to_arc = radius_edge - main_line_dsc.width; - adjusted_radio_with_tick_len = point_closer_to_arc - (is_major_tick ? major_len : minor_len); - } - /* LV_SCALE_MODE_ROUND_OUTER == scale->mode */ - else { - point_closer_to_arc = radius_edge - main_line_dsc.width; - adjusted_radio_with_tick_len = point_closer_to_arc + (is_major_tick ? major_len : minor_len); - } - - tick_point_a->x = center_point.x + point_closer_to_arc; - tick_point_a->y = center_point.y; - lv_point_transform(tick_point_a, angle_upscale, LV_SCALE_NONE, LV_SCALE_NONE, ¢er_point, false); - - tick_point_b->x = center_point.x + adjusted_radio_with_tick_len; - tick_point_b->y = center_point.y; - lv_point_transform(tick_point_b, angle_upscale, LV_SCALE_NONE, LV_SCALE_NONE, ¢er_point, false); - } - else { /* Nothing to do */ } -} - -/** - * Get coordinates for label - * - * @param obj pointer to a scale object - * @param label_dsc pointer to label descriptor - * @param tick_point pointer to reference tick - * @param label_coords pointer to label coordinates output - */ -static void scale_get_label_coords(lv_obj_t * obj, lv_draw_label_dsc_t * label_dsc, lv_point_t * tick_point, - lv_area_t * label_coords) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - - /* Reserve appropriate size for the tick label */ - lv_point_t label_size; - lv_text_get_size(&label_size, label_dsc->text, - label_dsc->font, label_dsc->letter_space, label_dsc->line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE); - - /* Set the label draw area at some distance of the major tick */ - if((LV_SCALE_MODE_HORIZONTAL_BOTTOM == scale->mode) || (LV_SCALE_MODE_HORIZONTAL_TOP == scale->mode)) { - label_coords->x1 = tick_point->x - (label_size.x / 2U); - label_coords->x2 = tick_point->x + (label_size.x / 2U); - - if(LV_SCALE_MODE_HORIZONTAL_BOTTOM == scale->mode) { - label_coords->y1 = tick_point->y + lv_obj_get_style_pad_bottom(obj, LV_PART_INDICATOR); - label_coords->y2 = label_coords->y1 + label_size.y; - } - else { - label_coords->y2 = tick_point->y - lv_obj_get_style_pad_top(obj, LV_PART_INDICATOR); - label_coords->y1 = label_coords->y2 - label_size.y; - } - } - else if((LV_SCALE_MODE_VERTICAL_LEFT == scale->mode) || (LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode)) { - label_coords->y1 = tick_point->y - (label_size.y / 2U); - label_coords->y2 = tick_point->y + (label_size.y / 2U); - - if(LV_SCALE_MODE_VERTICAL_LEFT == scale->mode) { - label_coords->x1 = tick_point->x - label_size.x - lv_obj_get_style_pad_left(obj, LV_PART_INDICATOR); - label_coords->x2 = tick_point->x - lv_obj_get_style_pad_left(obj, LV_PART_INDICATOR); - } - else { - label_coords->x1 = tick_point->x + lv_obj_get_style_pad_right(obj, LV_PART_INDICATOR); - label_coords->x2 = tick_point->x + label_size.x + lv_obj_get_style_pad_right(obj, LV_PART_INDICATOR); - } - } - else if(LV_SCALE_MODE_ROUND_OUTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { - label_coords->x1 = tick_point->x - (label_size.x / 2U); - label_coords->y1 = tick_point->y - (label_size.y / 2U); - label_coords->x2 = label_coords->x1 + label_size.x; - label_coords->y2 = label_coords->y1 + label_size.y; - } - else { /* Nothing to do */ } -} - -/** - * Set line properties - * - * Checks if the line has a custom section configuration or not and sets the properties accordingly. - * - * @param obj pointer to a scale object - * @param line_dsc pointer to line descriptor - * @param items_section_style pointer to indicator section style - * @param part line part, example: LV_PART_INDICATOR, LV_PART_ITEMS, LV_PART_MAIN - */ -static void scale_set_line_properties(lv_obj_t * obj, lv_draw_line_dsc_t * line_dsc, lv_style_t * section_style, - lv_part_t part) -{ - if(section_style) { - lv_style_value_t value; - lv_style_res_t res; - - /* Line width */ - res = lv_style_get_prop(section_style, LV_STYLE_LINE_WIDTH, &value); - if(res == LV_STYLE_RES_FOUND) { - line_dsc->width = (int32_t)value.num; - } - else { - line_dsc->width = lv_obj_get_style_line_width(obj, part); - } - - /* Line color */ - res = lv_style_get_prop(section_style, LV_STYLE_LINE_COLOR, &value); - if(res == LV_STYLE_RES_FOUND) { - line_dsc->color = value.color; - } - else { - line_dsc->color = lv_obj_get_style_line_color(obj, part); - } - - /* Line opa */ - res = lv_style_get_prop(section_style, LV_STYLE_LINE_OPA, &value); - if(res == LV_STYLE_RES_FOUND) { - line_dsc->opa = (lv_opa_t)value.num; - } - else { - line_dsc->opa = lv_obj_get_style_line_opa(obj, part); - } - } - else { - line_dsc->color = lv_obj_get_style_line_color(obj, part); - line_dsc->opa = lv_obj_get_style_line_opa(obj, part); - line_dsc->width = lv_obj_get_style_line_width(obj, part); - } -} - -/** - * Set arc properties - * - * Checks if the arc has a custom section configuration or not and sets the properties accordingly. - * - * @param obj pointer to a scale object - * @param line_dsc pointer to arc descriptor - * @param items_section_style pointer to indicator section style - */ -static void scale_set_arc_properties(lv_obj_t * obj, lv_draw_arc_dsc_t * arc_dsc, lv_style_t * section_style) -{ - if(section_style) { - lv_style_value_t value; - lv_style_res_t res; - - /* Line width */ - res = lv_style_get_prop(section_style, LV_STYLE_ARC_WIDTH, &value); - if(res == LV_STYLE_RES_FOUND) { - arc_dsc->width = (int32_t)value.num; - } - else { - arc_dsc->width = lv_obj_get_style_line_width(obj, LV_PART_MAIN); - } - - /* Line color */ - res = lv_style_get_prop(section_style, LV_STYLE_ARC_COLOR, &value); - if(res == LV_STYLE_RES_FOUND) { - arc_dsc->color = value.color; - } - else { - arc_dsc->color = lv_obj_get_style_line_color(obj, LV_PART_MAIN); - } - - /* Line opa */ - res = lv_style_get_prop(section_style, LV_STYLE_ARC_OPA, &value); - if(res == LV_STYLE_RES_FOUND) { - arc_dsc->opa = (lv_opa_t)value.num; - } - else { - arc_dsc->opa = lv_obj_get_style_line_opa(obj, LV_PART_MAIN); - } - } - else { - arc_dsc->color = lv_obj_get_style_line_color(obj, LV_PART_MAIN); - arc_dsc->opa = lv_obj_get_style_line_opa(obj, LV_PART_MAIN); - arc_dsc->width = lv_obj_get_style_line_width(obj, LV_PART_MAIN); - } -} - -/** - * Set indicator label properties - * - * Checks if the indicator has a custom section configuration or not and sets the properties accordingly. - * - * @param obj pointer to a scale object - * @param label_dsc pointer to label descriptor - * @param items_section_style pointer to indicator section style - */ -static void scale_set_indicator_label_properties(lv_obj_t * obj, lv_draw_label_dsc_t * label_dsc, - lv_style_t * indicator_section_style) -{ - if(indicator_section_style) { - lv_style_value_t value; - lv_style_res_t res; - - /* Text color */ - res = lv_style_get_prop(indicator_section_style, LV_STYLE_TEXT_COLOR, &value); - if(res == LV_STYLE_RES_FOUND) { - label_dsc->color = value.color; - } - else { - label_dsc->color = lv_obj_get_style_text_color(obj, LV_PART_INDICATOR); - } - - /* Text opa */ - res = lv_style_get_prop(indicator_section_style, LV_STYLE_TEXT_OPA, &value); - if(res == LV_STYLE_RES_FOUND) { - label_dsc->opa = (lv_opa_t)value.num; - } - else { - label_dsc->opa = lv_obj_get_style_text_opa(obj, LV_PART_INDICATOR); - } - - /* Text letter space */ - res = lv_style_get_prop(indicator_section_style, LV_STYLE_TEXT_LETTER_SPACE, &value); - if(res == LV_STYLE_RES_FOUND) { - label_dsc->letter_space = (int32_t)value.num; - } - else { - label_dsc->letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_INDICATOR); - } - - /* Text font */ - res = lv_style_get_prop(indicator_section_style, LV_STYLE_TEXT_FONT, &value); - if(res == LV_STYLE_RES_FOUND) { - label_dsc->font = (const lv_font_t *)value.ptr; - } - else { - label_dsc->font = lv_obj_get_style_text_font(obj, LV_PART_INDICATOR); - } - } - else { - /* If label is not within a range then get the indicator style */ - label_dsc->color = lv_obj_get_style_text_color(obj, LV_PART_INDICATOR); - label_dsc->opa = lv_obj_get_style_text_opa(obj, LV_PART_INDICATOR); - label_dsc->letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_INDICATOR); - label_dsc->font = lv_obj_get_style_text_font(obj, LV_PART_INDICATOR); - } -} - -static void scale_find_section_tick_idx(lv_obj_t * obj) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - - const int32_t min_out = scale->range_min; - const int32_t max_out = scale->range_max; - const uint32_t total_tick_count = scale->total_tick_count; - - /* Section handling */ - uint32_t tick_idx = 0; - for(tick_idx = 0; tick_idx < total_tick_count; tick_idx++) { - bool is_major_tick = false; - if(tick_idx % scale->major_tick_every == 0) is_major_tick = true; - - const int32_t tick_value = lv_map(tick_idx, 0U, total_tick_count - 1, min_out, max_out); - - lv_scale_section_t * section; - LV_LL_READ_BACK(&scale->section_ll, section) { - if(section->minor_range <= tick_value && section->major_range >= tick_value) { - if(LV_SCALE_TICK_IDX_DEFAULT_ID == section->first_tick_idx_in_section) { - section->first_tick_idx_in_section = tick_idx; - section->first_tick_idx_is_major = is_major_tick; - } - if(section->first_tick_idx_in_section != tick_idx) { - section->last_tick_idx_in_section = tick_idx; - section->last_tick_idx_is_major = is_major_tick; - } - } - else { /* Nothing to do */ } - } - } -} - -/** - * Stores the width of the initial and last tick of the main line - * - * This width is used to compensate the main line drawing taking into consideration the widths of both ticks - * - * @param obj pointer to a scale object - * @param tick_idx index of the current tick - * @param is_major_tick true if tick_idx is a major tick - * @param major_tick_width width of the major tick - * @param minor_tick_width width of the minor tick - */ -static void scale_store_main_line_tick_width_compensation(lv_obj_t * obj, const uint32_t tick_idx, - const bool is_major_tick, const int32_t major_tick_width, const int32_t minor_tick_width) -{ - lv_scale_t * scale = (lv_scale_t *)obj; - const bool is_first_tick = 0U == tick_idx; - const bool is_last_tick = scale->total_tick_count == tick_idx; - const int32_t tick_width = is_major_tick ? major_tick_width : minor_tick_width; - - /* Exit early if tick_idx is neither the first nor last tick on the main line */ - if(((!is_last_tick) && (!is_first_tick)) - /* Exit early if scale mode is round. It doesn't support main line compensation */ - || ((LV_SCALE_MODE_ROUND_INNER == scale->mode) || (LV_SCALE_MODE_ROUND_OUTER == scale->mode))) { - return; - } - - if(is_last_tick) { - /* Mode is vertical */ - if((LV_SCALE_MODE_VERTICAL_LEFT == scale->mode) || (LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode)) { - scale->last_tick_width = tick_width; - } - /* Mode is horizontal */ - else { - scale->first_tick_width = tick_width; - } - } - /* is_first_tick */ - else { - /* Mode is vertical */ - if((LV_SCALE_MODE_VERTICAL_LEFT == scale->mode) || (LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode)) { - scale->first_tick_width = tick_width; - } - /* Mode is horizontal */ - else { - scale->last_tick_width = tick_width; - } - } -} - -/** - * Sets the text of the tick label descriptor when using custom labels - * - * Sets the text pointer when valid custom label is available, otherwise set it to NULL. - * - * @param obj pointer to a scale object - * @param label_dsc pointer to the label descriptor - * @param major_tick_idx index of the current major tick - */ -static void scale_build_custom_label_text(lv_obj_t * obj, lv_draw_label_dsc_t * label_dsc, - const uint16_t major_tick_idx) -{ - lv_scale_t * scale = (lv_scale_t *) obj; - - /* Check if the scale has valid custom labels available, - * this avoids reading past txt_src array when the scale requires more tick labels than available */ - if(major_tick_idx <= scale->custom_label_cnt) { - if(scale->txt_src[major_tick_idx - 1U]) { - label_dsc->text = scale->txt_src[major_tick_idx - 1U]; - label_dsc->text_local = 0; - } - else { - label_dsc->text = NULL; - } - } - else { - label_dsc->text = NULL; - } -} - -/** - * Stores tick width compensation information for main line sections - * - * @param obj pointer to a scale object - * @param is_major_tick Indicates if tick is major or not - * @param major_tick_dsc pointer to the major_tick_dsc - * @param minor_tick_dsc pointer to the minor_tick_dsc - * @param tick_value Current tick value, used to know if tick_idx belongs to a section or not - * @param tick_idx Current tick index - * @param tick_point_a Pointer to tick point a - */ -static void scale_store_section_line_tick_width_compensation(lv_obj_t * obj, const bool is_major_tick, - lv_draw_line_dsc_t * major_tick_dsc, lv_draw_line_dsc_t * minor_tick_dsc, - const int32_t tick_value, const uint8_t tick_idx, lv_point_t * tick_point_a) -{ - lv_scale_t * scale = (lv_scale_t *) obj; - lv_scale_section_t * section; - - LV_LL_READ_BACK(&scale->section_ll, section) { - if(section->minor_range <= tick_value && section->major_range >= tick_value) { - if(is_major_tick) { - scale_set_line_properties(obj, major_tick_dsc, section->indicator_style, LV_PART_INDICATOR); - } - else { - scale_set_line_properties(obj, minor_tick_dsc, section->items_style, LV_PART_ITEMS); - } - } - - int32_t tmp_width = 0; - - if(tick_idx == section->first_tick_idx_in_section) { - if(section->first_tick_idx_is_major) { - tmp_width = major_tick_dsc->width; - } - else { - tmp_width = minor_tick_dsc->width; - } - - section->first_tick_in_section.y = tick_point_a->y; - /* Add 1px as adjustment if tmp_width is odd */ - if(tmp_width & 0x01U) { - if(LV_SCALE_MODE_VERTICAL_LEFT == scale->mode || LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode) { - tmp_width += 1U; - } - else { - tmp_width -= 1U; - } - } - section->first_tick_in_section_width = tmp_width; - } - else if(tick_idx == section->last_tick_idx_in_section) { - if(section->last_tick_idx_is_major) { - tmp_width = major_tick_dsc->width; - } - else { - tmp_width = minor_tick_dsc->width; - } - - section->last_tick_in_section.y = tick_point_a->y; - /* Add 1px as adjustment if tmp_width is odd */ - if(tmp_width & 0x01U) { - if(LV_SCALE_MODE_VERTICAL_LEFT == scale->mode || LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode) { - tmp_width -= 1U; - } - else { - tmp_width += 1U; - } - } - section->last_tick_in_section_width = tmp_width; - } - else { /* Nothing to do */ } - } -} - -static void scale_free_line_needle_points_cb(lv_event_t * e) -{ - lv_point_precise_t * needle_line_points = lv_event_get_user_data(e); - lv_free(needle_line_points); -} - -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/scale/lv_scale.h b/L3_Middlewares/LVGL/src/widgets/scale/lv_scale.h deleted file mode 100644 index ad1bd2b..0000000 --- a/L3_Middlewares/LVGL/src/widgets/scale/lv_scale.h +++ /dev/null @@ -1,258 +0,0 @@ -/** - * @file lv_scale.h - * - */ - -#ifndef LV_SCALE_H -#define LV_SCALE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" - -#if LV_USE_SCALE != 0 - -#include "../../core/lv_obj.h" -#include "../line/lv_line.h" -#include "../image/lv_image.h" - -/********************* - * DEFINES - *********************/ - -/**Default value of total minor ticks. */ -#define LV_SCALE_TOTAL_TICK_COUNT_DEFAULT (11U) -LV_EXPORT_CONST_INT(LV_SCALE_TOTAL_TICK_COUNT_DEFAULT); - -/**Default value of major tick every nth ticks. */ -#define LV_SCALE_MAJOR_TICK_EVERY_DEFAULT (5U) -LV_EXPORT_CONST_INT(LV_SCALE_MAJOR_TICK_EVERY_DEFAULT); - -/**Default value of scale label enabled. */ -#define LV_SCALE_LABEL_ENABLED_DEFAULT (1U) -LV_EXPORT_CONST_INT(LV_SCALE_LABEL_ENABLED_DEFAULT); - -/********************** - * TYPEDEFS - **********************/ - -/** - * Scale mode - */ -typedef enum { - LV_SCALE_MODE_HORIZONTAL_TOP = 0x00U, - LV_SCALE_MODE_HORIZONTAL_BOTTOM = 0x01U, - LV_SCALE_MODE_VERTICAL_LEFT = 0x02U, - LV_SCALE_MODE_VERTICAL_RIGHT = 0x04U, - LV_SCALE_MODE_ROUND_INNER = 0x08U, - LV_SCALE_MODE_ROUND_OUTER = 0x10U, - LV_SCALE_MODE_LAST -} lv_scale_mode_t; - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_scale_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create an scale object - * @param parent pointer to an object, it will be the parent of the new scale - * @return pointer to the created scale - */ -lv_obj_t * lv_scale_create(lv_obj_t * parent); - -/*====================== - * Add/remove functions - *=====================*/ - -/*===================== - * Setter functions - *====================*/ - -/** - * Set scale mode. See lv_scale_mode_t - * @param obj pointer the scale object - * @param mode the new scale mode - */ -void lv_scale_set_mode(lv_obj_t * obj, lv_scale_mode_t mode); - -/** - * Set scale total tick count (including minor and major ticks) - * @param obj pointer the scale object - * @param total_tick_count New total tick count - */ -void lv_scale_set_total_tick_count(lv_obj_t * obj, uint32_t total_tick_count); - -/** - * Sets how often the major tick will be drawn - * @param obj pointer the scale object - * @param major_tick_every the new count for major tick drawing - */ -void lv_scale_set_major_tick_every(lv_obj_t * obj, uint32_t major_tick_every); - -/** - * Sets label visibility - * @param obj pointer the scale object - * @param show_label true/false to enable tick label - */ -void lv_scale_set_label_show(lv_obj_t * obj, bool show_label); - -/** - * Set the minimal and maximal values on a scale - * @param obj pointer to a scale object - * @param min minimum value of the scale - * @param max maximum value of the scale - */ -void lv_scale_set_range(lv_obj_t * obj, int32_t min, int32_t max); - -/** - * Set properties specific to round scale - * @param obj pointer to a scale object - * @param angle_range the angular range of the scale - */ -void lv_scale_set_angle_range(lv_obj_t * obj, uint32_t angle_range); - -/** - * Set properties specific to round scale - * @param obj pointer to a scale object - * @param rotation the angular offset from the 3 o'clock position (clock-wise) - */ -void lv_scale_set_rotation(lv_obj_t * obj, int32_t rotation); - -/** - * Point the needle to the corresponding value through the line - * @param obj pointer to a scale object - * @param needle_line needle_line of the scale. The line points will be allocated and - * managed by the scale unless the line point array was previously set - * using `lv_line_set_points_mutable`. - * @param needle_length length of the needle - * needle_length>0 needle_length=needle_length; - * needle_length<0 needle_length=radius-|needle_length|; - * @param value needle to point to the corresponding value - */ -void lv_scale_set_line_needle_value(lv_obj_t * obj, lv_obj_t * needle_line, int32_t needle_length, - int32_t value); - -/** - * Point the needle to the corresponding value through the image, - image must point to the right. E.g. -O------> - * @param obj pointer to a scale object - * @param needle_img needle_img of the scale - * @param value needle to point to the corresponding value - */ -void lv_scale_set_image_needle_value(lv_obj_t * obj, lv_obj_t * needle_img, int32_t value); - -/** - * Set custom text source for major ticks labels - * @param obj pointer to a scale object - * @param txt_src pointer to an array of strings which will be display at major ticks - */ -void lv_scale_set_text_src(lv_obj_t * obj, const char * txt_src[]); - -/** - * Draw the scale after all the children are drawn - * @param obj pointer to a scale object - * @param en true: enable post draw - */ -void lv_scale_set_post_draw(lv_obj_t * obj, bool en); - -/** - * Draw the scale ticks on top of all parts - * @param obj pointer to a scale object - * @param en true: enable draw ticks on top of all parts - */ -void lv_scale_set_draw_ticks_on_top(lv_obj_t * obj, bool en); - -/** - * Add a section to the given scale - * @param obj pointer to a scale object - * @return pointer to the new section - */ -lv_scale_section_t * lv_scale_add_section(lv_obj_t * obj); - -/** - * Set the range for the given scale section - * @param section pointer to a scale section object - * @param minor_range section new minor range - * @param major_range section new major range - */ -void lv_scale_section_set_range(lv_scale_section_t * section, int32_t minor_range, int32_t major_range); - -/** - * Set the style of the part for the given scale section - * @param section pointer to a scale section object - * @param part the part for the section, e.g. LV_PART_INDICATOR - * @param section_part_style Pointer to the section part style - */ -void lv_scale_section_set_style(lv_scale_section_t * section, lv_part_t part, lv_style_t * section_part_style); - -/*===================== - * Getter functions - *====================*/ - -/** - * Get scale mode. See lv_scale_mode_t - * @param obj pointer the scale object - * @return Scale mode - */ -lv_scale_mode_t lv_scale_get_mode(lv_obj_t * obj); - -/** - * Get scale total tick count (including minor and major ticks) - * @param obj pointer the scale object - * @return Scale total tick count - */ -int32_t lv_scale_get_total_tick_count(lv_obj_t * obj); - -/** - * Gets how often the major tick will be drawn - * @param obj pointer the scale object - * @return Scale major tick every count - */ -int32_t lv_scale_get_major_tick_every(lv_obj_t * obj); - -/** - * Gets label visibility - * @param obj pointer the scale object - * @return true if tick label is enabled, false otherwise - */ -bool lv_scale_get_label_show(lv_obj_t * obj); - -/** - * Get angle range of a round scale - * @param obj pointer to a scale object - * @return Scale angle_range - */ -uint32_t lv_scale_get_angle_range(lv_obj_t * obj); - -/** - * Get the min range for the given scale section - * @param obj pointer to a scale section object - * @return section minor range - */ -int32_t lv_scale_get_range_min_value(lv_obj_t * obj); - -/** - * Get the max range for the given scale section - * @param obj pointer to a scale section object - * @return section max range - */ -int32_t lv_scale_get_range_max_value(lv_obj_t * obj); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_SCALE*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_SCALE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/scale/lv_scale_private.h b/L3_Middlewares/LVGL/src/widgets/scale/lv_scale_private.h deleted file mode 100644 index c755c17..0000000 --- a/L3_Middlewares/LVGL/src/widgets/scale/lv_scale_private.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file lv_scale_private.h - * - */ - -#ifndef LV_SCALE_PRIVATE_H -#define LV_SCALE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_scale.h" - -#if LV_USE_SCALE != 0 -#include "../../core/lv_obj_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_scale_section_t { - lv_style_t * main_style; - lv_style_t * indicator_style; - lv_style_t * items_style; - int32_t minor_range; - int32_t major_range; - uint32_t first_tick_idx_in_section; - uint32_t last_tick_idx_in_section; - uint32_t first_tick_idx_is_major; - uint32_t last_tick_idx_is_major; - int32_t first_tick_in_section_width; - int32_t last_tick_in_section_width; - lv_point_t first_tick_in_section; - lv_point_t last_tick_in_section; -}; - -struct lv_scale_t { - lv_obj_t obj; - lv_ll_t section_ll; /**< Linked list for the sections (stores lv_scale_section_t)*/ - const char ** txt_src; - lv_scale_mode_t mode; - int32_t range_min; - int32_t range_max; - uint32_t total_tick_count : 15; - uint32_t major_tick_every : 15; - uint32_t label_enabled : 1; - uint32_t post_draw : 1; - uint32_t draw_ticks_on_top : 1; - /* Round scale */ - uint32_t angle_range; - int32_t rotation; - /* Private properties */ - int32_t custom_label_cnt; - int32_t last_tick_width; - int32_t first_tick_width; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_SCALE != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_SCALE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/slider/lv_slider.c b/L3_Middlewares/LVGL/src/widgets/slider/lv_slider.c deleted file mode 100644 index e58597c..0000000 --- a/L3_Middlewares/LVGL/src/widgets/slider/lv_slider.c +++ /dev/null @@ -1,556 +0,0 @@ -/** - * @file lv_slider.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_slider_private.h" -#include "../../misc/lv_area_private.h" -#include "../../core/lv_obj_private.h" -#include "../../core/lv_obj_event_private.h" -#include "../../core/lv_obj_class_private.h" -#if LV_USE_SLIDER != 0 - -#include "../../misc/lv_assert.h" -#include "../../core/lv_group.h" -#include "../../indev/lv_indev.h" -#include "../../indev/lv_indev_private.h" -#include "../../display/lv_display.h" -#include "../../draw/lv_draw.h" -#include "../../stdlib/lv_string.h" -#include "../../misc/lv_math.h" -#include "../image/lv_image.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_slider_class) - -#define LV_SLIDER_KNOB_COORD(is_reversed, area) (is_reversed ? area.x1 : area.x2) -#define LV_SLIDER_KNOB_COORD_VERTICAL(is_reversed, area) (is_reversed ? area.y2 : area.y1) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_slider_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_slider_event(const lv_obj_class_t * class_p, lv_event_t * e); -static void position_knob(lv_obj_t * obj, lv_area_t * knob_area, const int32_t knob_size, const bool hor); -static void draw_knob(lv_event_t * e); -static bool is_slider_horizontal(lv_obj_t * obj); -static void drag_start(lv_obj_t * obj); -static void update_knob_pos(lv_obj_t * obj, bool check_drag); - -/********************** - * STATIC VARIABLES - **********************/ -const lv_obj_class_t lv_slider_class = { - .constructor_cb = lv_slider_constructor, - .event_cb = lv_slider_event, - .editable = LV_OBJ_CLASS_EDITABLE_TRUE, - .group_def = LV_OBJ_CLASS_GROUP_DEF_TRUE, - .instance_size = sizeof(lv_slider_t), - .base_class = &lv_bar_class, - .name = "slider", -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_slider_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -bool lv_slider_is_dragged(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_slider_t * slider = (lv_slider_t *)obj; - - return slider->dragging; -} - -void lv_slider_set_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim) -{ - lv_bar_set_value(obj, value, anim); -} - -void lv_slider_set_left_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim) -{ - lv_bar_set_start_value(obj, value, anim); -} - -void lv_slider_set_range(lv_obj_t * obj, int32_t min, int32_t max) -{ - lv_bar_set_range(obj, min, max); -} - -void lv_slider_set_mode(lv_obj_t * obj, lv_slider_mode_t mode) -{ - lv_bar_set_mode(obj, (lv_bar_mode_t)mode); -} - -int32_t lv_slider_get_value(const lv_obj_t * obj) -{ - return lv_bar_get_value(obj); -} - -int32_t lv_slider_get_left_value(const lv_obj_t * obj) -{ - return lv_bar_get_start_value(obj); -} - -int32_t lv_slider_get_min_value(const lv_obj_t * obj) -{ - return lv_bar_get_min_value(obj); -} - -int32_t lv_slider_get_max_value(const lv_obj_t * obj) -{ - return lv_bar_get_max_value(obj); -} - -lv_slider_mode_t lv_slider_get_mode(lv_obj_t * slider) -{ - lv_bar_mode_t mode = lv_bar_get_mode(slider); - if(mode == LV_BAR_MODE_SYMMETRICAL) return LV_SLIDER_MODE_SYMMETRICAL; - else if(mode == LV_BAR_MODE_RANGE) return LV_SLIDER_MODE_RANGE; - else return LV_SLIDER_MODE_NORMAL; -} - -bool lv_slider_is_symmetrical(lv_obj_t * obj) -{ - return lv_bar_is_symmetrical(obj); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_slider_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - lv_slider_t * slider = (lv_slider_t *)obj; - - /*Initialize the allocated 'slider'*/ - slider->value_to_set = NULL; - slider->dragging = 0U; - slider->left_knob_focus = 0U; - - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE); - lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS); - lv_obj_set_ext_click_area(obj, LV_DPX(8)); -} - -static void lv_slider_event(const lv_obj_class_t * class_p, lv_event_t * e) -{ - LV_UNUSED(class_p); - - lv_result_t res; - - /*Call the ancestor's event handler*/ - res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; - - lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_current_target(e); - lv_slider_t * slider = (lv_slider_t *)obj; - lv_slider_mode_t type = lv_slider_get_mode(obj); - - /*Advanced hit testing: react only on dragging the knob(s)*/ - if(code == LV_EVENT_HIT_TEST) { - lv_hit_test_info_t * info = lv_event_get_param(e); - int32_t ext_click_area = obj->spec_attr ? obj->spec_attr->ext_click_pad : 0; - - /*Ordinary slider: was the knob area hit?*/ - lv_area_t a; - lv_area_copy(&a, &slider->right_knob_area); - lv_area_increase(&a, ext_click_area, ext_click_area); - info->res = lv_area_is_point_on(&a, info->point, 0); - - /*There's still a chance that there is a hit if there is another knob*/ - if((info->res == false) && (type == LV_SLIDER_MODE_RANGE)) { - lv_area_copy(&a, &slider->left_knob_area); - lv_area_increase(&a, ext_click_area, ext_click_area); - info->res = lv_area_is_point_on(&a, info->point, 0); - } - } - else if(code == LV_EVENT_PRESSED) { - /*Save the pressed coordinates*/ - lv_indev_get_point(lv_indev_active(), &slider->pressed_point); - lv_obj_transform_point(obj, &slider->pressed_point, LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE_RECURSIVE); - } - else if(code == LV_EVENT_PRESSING) { - update_knob_pos(obj, true); - } - else if(code == LV_EVENT_RELEASED || code == LV_EVENT_PRESS_LOST) { - update_knob_pos(obj, false); - slider->dragging = false; - slider->value_to_set = NULL; - - lv_obj_invalidate(obj); - - /*Leave edit mode if released. (No need to wait for LONG_PRESS)*/ - lv_group_t * g = lv_obj_get_group(obj); - bool editing = lv_group_get_editing(g); - lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_active()); - if(indev_type == LV_INDEV_TYPE_ENCODER) { - if(editing) { - if(lv_slider_get_mode(obj) == LV_SLIDER_MODE_RANGE) { - if(slider->left_knob_focus == 0) slider->left_knob_focus = 1; - else { - slider->left_knob_focus = 0; - lv_group_set_editing(g, false); - } - } - else { - lv_group_set_editing(g, false); - } - } - } - else if(indev_type == LV_INDEV_TYPE_POINTER) { - if(is_slider_horizontal(obj)) lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); - else lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); - } - } - else if(code == LV_EVENT_FOCUSED) { - lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_active()); - if(indev_type == LV_INDEV_TYPE_ENCODER || indev_type == LV_INDEV_TYPE_KEYPAD) { - slider->left_knob_focus = 0; - } - } - else if(code == LV_EVENT_SIZE_CHANGED) { - if(is_slider_horizontal(obj)) { - lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); - } - else { - lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); - } - lv_obj_refresh_ext_draw_size(obj); - } - else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { - int32_t knob_left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); - int32_t knob_right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); - int32_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); - int32_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); - - /*The smaller size is the knob diameter*/ - int32_t trans_w = lv_obj_get_style_transform_width(obj, LV_PART_KNOB); - int32_t trans_h = lv_obj_get_style_transform_height(obj, LV_PART_KNOB); - int32_t knob_size = LV_MIN(lv_obj_get_width(obj) + 2 * trans_w, lv_obj_get_height(obj) + 2 * trans_h) >> 1; - knob_size += LV_MAX(LV_MAX(knob_left, knob_right), LV_MAX(knob_bottom, knob_top)); - knob_size += 2; /*For rounding error*/ - knob_size += lv_obj_calculate_ext_draw_size(obj, LV_PART_KNOB); - - /*Indic. size is handled by bar*/ - int32_t * s = lv_event_get_param(e); - *s = LV_MAX(*s, knob_size); - - } - else if(code == LV_EVENT_KEY) { - uint32_t c = lv_event_get_key(e); - - if(c == LV_KEY_RIGHT || c == LV_KEY_UP) { - if(!slider->left_knob_focus) lv_slider_set_value(obj, lv_slider_get_value(obj) + 1, LV_ANIM_ON); - else lv_slider_set_left_value(obj, lv_slider_get_left_value(obj) + 1, LV_ANIM_ON); - } - else if(c == LV_KEY_LEFT || c == LV_KEY_DOWN) { - if(!slider->left_knob_focus) lv_slider_set_value(obj, lv_slider_get_value(obj) - 1, LV_ANIM_ON); - else lv_slider_set_left_value(obj, lv_slider_get_left_value(obj) - 1, LV_ANIM_ON); - } - else { - return; - } - - res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - if(res != LV_RESULT_OK) return; - } - else if(code == LV_EVENT_ROTARY) { - int32_t r = lv_event_get_rotary_diff(e); - - if(!slider->left_knob_focus) lv_slider_set_value(obj, lv_slider_get_value(obj) + r, LV_ANIM_ON); - else lv_slider_set_left_value(obj, lv_slider_get_left_value(obj) + 1, LV_ANIM_ON); - - res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - if(res != LV_RESULT_OK) return; - } - else if(code == LV_EVENT_DRAW_MAIN) { - draw_knob(e); - } -} - -static void draw_knob(lv_event_t * e) -{ - lv_obj_t * obj = lv_event_get_current_target(e); - lv_slider_t * slider = (lv_slider_t *)obj; - lv_layer_t * layer = lv_event_get_layer(e); - - const bool is_rtl = LV_BASE_DIR_RTL == lv_obj_get_style_base_dir(obj, LV_PART_MAIN); - const bool is_horizontal = is_slider_horizontal(obj); - const bool is_reversed = slider->bar.val_reversed ^ (is_rtl && is_horizontal); - - lv_area_t knob_area; - int32_t knob_size; - bool is_symmetrical = lv_slider_is_symmetrical(obj); - - if(is_horizontal) { - knob_size = lv_obj_get_height(obj); - if(is_symmetrical && - slider->bar.cur_value < 0) knob_area.x1 = LV_SLIDER_KNOB_COORD(!is_reversed, slider->bar.indic_area); - else knob_area.x1 = LV_SLIDER_KNOB_COORD(is_reversed, slider->bar.indic_area); - } - else { - knob_size = lv_obj_get_width(obj); - if(is_symmetrical && - slider->bar.cur_value < 0) knob_area.y1 = LV_SLIDER_KNOB_COORD_VERTICAL(!is_reversed, slider->bar.indic_area); - else knob_area.y1 = LV_SLIDER_KNOB_COORD_VERTICAL(is_reversed, slider->bar.indic_area); - } - lv_draw_rect_dsc_t knob_rect_dsc; - lv_draw_rect_dsc_init(&knob_rect_dsc); - lv_obj_init_draw_rect_dsc(obj, LV_PART_KNOB, &knob_rect_dsc); - /* Update knob area with knob style */ - position_knob(obj, &knob_area, knob_size, is_horizontal); - /* Update right knob area with calculated knob area */ - lv_area_copy(&slider->right_knob_area, &knob_area); - - if(lv_slider_get_mode(obj) != LV_SLIDER_MODE_RANGE) { - lv_draw_rect(layer, &knob_rect_dsc, &slider->right_knob_area); - } - else { - /*Save the draw part_draw_dsc. because it can be modified in the event*/ - lv_draw_rect_dsc_t knob_rect_dsc_tmp; - lv_memcpy(&knob_rect_dsc_tmp, &knob_rect_dsc, sizeof(lv_draw_rect_dsc_t)); - /* Draw the right knob */ - lv_draw_rect(layer, &knob_rect_dsc, &slider->right_knob_area); - - /*Calculate the second knob area*/ - if(is_horizontal) { - /*use !is_reversed to get the other knob*/ - knob_area.x1 = LV_SLIDER_KNOB_COORD(!is_reversed, slider->bar.indic_area); - } - else { - knob_area.y1 = LV_SLIDER_KNOB_COORD_VERTICAL(!is_reversed, slider->bar.indic_area); - } - position_knob(obj, &knob_area, knob_size, is_horizontal); - lv_area_copy(&slider->left_knob_area, &knob_area); - - lv_memcpy(&knob_rect_dsc, &knob_rect_dsc_tmp, sizeof(lv_draw_rect_dsc_t)); - - lv_draw_rect(layer, &knob_rect_dsc, &slider->left_knob_area); - } -} - -static void position_knob(lv_obj_t * obj, lv_area_t * knob_area, const int32_t knob_size, const bool hor) -{ - if(hor) { - knob_area->x1 -= (knob_size >> 1); - knob_area->x2 = knob_area->x1 + knob_size - 1; - knob_area->y1 = obj->coords.y1; - knob_area->y2 = obj->coords.y2; - } - else { - knob_area->y1 -= (knob_size >> 1); - knob_area->y2 = knob_area->y1 + knob_size - 1; - knob_area->x1 = obj->coords.x1; - knob_area->x2 = obj->coords.x2; - } - - int32_t knob_left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB); - int32_t knob_right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB); - int32_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); - int32_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); - - int32_t transf_w = lv_obj_get_style_transform_width(obj, LV_PART_KNOB); - int32_t transf_h = lv_obj_get_style_transform_height(obj, LV_PART_KNOB); - - /*Apply the paddings on the knob area*/ - knob_area->x1 -= knob_left + transf_w; - knob_area->x2 += knob_right + transf_w; - knob_area->y1 -= knob_top + transf_h; - knob_area->y2 += knob_bottom + transf_h; -} - -static bool is_slider_horizontal(lv_obj_t * obj) -{ - return lv_obj_get_width(obj) >= lv_obj_get_height(obj); -} - -static void drag_start(lv_obj_t * obj) -{ - lv_slider_t * slider = (lv_slider_t *)obj; - lv_slider_mode_t mode = lv_slider_get_mode(obj); - lv_point_t p; - slider->dragging = true; - if(mode == LV_SLIDER_MODE_NORMAL || mode == LV_SLIDER_MODE_SYMMETRICAL) { - slider->value_to_set = &slider->bar.cur_value; - } - else if(mode == LV_SLIDER_MODE_RANGE) { - lv_indev_get_point(lv_indev_active(), &p); - lv_obj_transform_point(obj, &p, LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE_RECURSIVE); - const bool is_rtl = LV_BASE_DIR_RTL == lv_obj_get_style_base_dir(obj, LV_PART_MAIN); - const bool is_horizontal = is_slider_horizontal(obj); - const bool is_reversed = slider->bar.val_reversed ^ (is_rtl && is_horizontal); - int32_t dist_left, dist_right; - if(is_horizontal) { - if((!is_reversed && p.x > slider->right_knob_area.x2) || (is_reversed && p.x < slider->right_knob_area.x1)) { - slider->value_to_set = &slider->bar.cur_value; - } - else if((!is_reversed && p.x < slider->left_knob_area.x1) || (is_reversed && p.x > slider->left_knob_area.x2)) { - slider->value_to_set = &slider->bar.start_value; - } - else { - /*Calculate the distance from each knob*/ - dist_left = LV_ABS((slider->left_knob_area.x1 + (slider->left_knob_area.x2 - slider->left_knob_area.x1) / 2) - p.x); - dist_right = LV_ABS((slider->right_knob_area.x1 + (slider->right_knob_area.x2 - slider->right_knob_area.x1) / 2) - p.x); - /*Use whichever one is closer*/ - if(dist_right < dist_left) { - slider->value_to_set = &slider->bar.cur_value; - slider->left_knob_focus = 0; - } - else { - slider->value_to_set = &slider->bar.start_value; - slider->left_knob_focus = 1; - } - } - } - else { - if((!is_reversed && p.y < slider->right_knob_area.y1) || (is_reversed && p.y > slider->right_knob_area.y2)) { - slider->value_to_set = &slider->bar.cur_value; - } - else if((!is_reversed && p.y > slider->left_knob_area.y2) || (is_reversed && p.y < slider->left_knob_area.y1)) { - slider->value_to_set = &slider->bar.start_value; - } - else { - /*Calculate the distance from each knob*/ - dist_left = LV_ABS((slider->left_knob_area.y1 + (slider->left_knob_area.y2 - slider->left_knob_area.y1) / 2) - p.y); - dist_right = LV_ABS((slider->right_knob_area.y1 + (slider->right_knob_area.y2 - slider->right_knob_area.y1) / 2) - p.y); - - /*Use whichever one is closer*/ - if(dist_right < dist_left) { - slider->value_to_set = &slider->bar.cur_value; - slider->left_knob_focus = 0; - } - else { - slider->value_to_set = &slider->bar.start_value; - slider->left_knob_focus = 1; - } - } - } - } -} - -static void update_knob_pos(lv_obj_t * obj, bool check_drag) -{ - lv_slider_t * slider = (lv_slider_t *)obj; - lv_indev_t * indev = lv_indev_active(); - if(lv_indev_get_type(indev) != LV_INDEV_TYPE_POINTER) - return; - if(lv_indev_get_scroll_obj(indev) != NULL) - return; - - lv_point_t p; - lv_indev_get_point(indev, &p); - lv_obj_transform_point(obj, &p, LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE_RECURSIVE); - - bool is_hor = is_slider_horizontal(obj); - - if(check_drag && !slider->dragging) { - int32_t ofs = is_hor ? (p.x - slider->pressed_point.x) : (p.y - slider->pressed_point.y); - - /*Stop processing when offset is below scroll_limit*/ - if(LV_ABS(ofs) < indev->scroll_limit) { - return; - } - } - - if(!slider->value_to_set) { - /*Ready to start drag*/ - drag_start(obj); - } - - int32_t new_value = 0; - const int32_t range = slider->bar.max_value - slider->bar.min_value; - const bool is_rtl = LV_BASE_DIR_RTL == lv_obj_get_style_base_dir(obj, LV_PART_MAIN); - const bool is_horizontal = is_slider_horizontal(obj); - const bool is_reversed = slider->bar.val_reversed ^ (is_rtl && is_horizontal); - - if(is_hor) { - const int32_t bg_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); - const int32_t bg_right = lv_obj_get_style_pad_right(obj, LV_PART_MAIN); - const int32_t w = lv_obj_get_width(obj); - const int32_t indic_w = w - bg_left - bg_right; - - if(is_reversed) { - /*Make the point relative to the indicator*/ - new_value = (obj->coords.x2 - bg_right) - p.x; - } - else { - /*Make the point relative to the indicator*/ - new_value = p.x - (obj->coords.x1 + bg_left); - } - if(indic_w) { - new_value = (new_value * range + indic_w / 2) / indic_w; - new_value += slider->bar.min_value; - } - } - else { - const int32_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - const int32_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN); - const int32_t h = lv_obj_get_height(obj); - const int32_t indic_h = h - bg_bottom - bg_top; - - if(is_reversed) { - /*Make the point relative to the indicator*/ - new_value = p.y - (obj->coords.y1 + bg_top); - } - else { - /*Make the point relative to the indicator*/ - new_value = p.y - (obj->coords.y2 + bg_bottom); - new_value = -new_value; - } - new_value = (new_value * range + indic_h / 2) / indic_h; - new_value += slider->bar.min_value; - } - - int32_t real_max_value = slider->bar.max_value; - int32_t real_min_value = slider->bar.min_value; - /*Figure out the min. and max. for this mode*/ - if(slider->value_to_set == &slider->bar.start_value) { - real_max_value = slider->bar.cur_value; - } - else { - real_min_value = slider->bar.start_value; - } - - new_value = LV_CLAMP(real_min_value, new_value, real_max_value); - if(*slider->value_to_set != new_value) { - *slider->value_to_set = new_value; - if(is_hor) - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_VER); - else - lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR); - - lv_obj_invalidate(obj); - lv_result_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL); - if(res != LV_RESULT_OK) - return; - } -} - -#endif diff --git a/L3_Middlewares/LVGL/src/widgets/slider/lv_slider_private.h b/L3_Middlewares/LVGL/src/widgets/slider/lv_slider_private.h deleted file mode 100644 index a1eab2f..0000000 --- a/L3_Middlewares/LVGL/src/widgets/slider/lv_slider_private.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file lv_slider_private.h - * - */ - -#ifndef LV_SLIDER_PRIVATE_H -#define LV_SLIDER_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../bar/lv_bar_private.h" -#include "lv_slider.h" - -#if LV_USE_SLIDER != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_slider_t { - lv_bar_t bar; /**< Add the ancestor's type first */ - lv_area_t left_knob_area; - lv_area_t right_knob_area; - lv_point_t pressed_point; - int32_t * value_to_set; /**< Which bar value to set */ - uint8_t dragging : 1; /**< 1: the slider is being dragged */ - uint8_t left_knob_focus : 1; /**< 1: with encoder now the right knob can be adjusted */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_SLIDER != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_SLIDER_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/span/lv_span.h b/L3_Middlewares/LVGL/src/widgets/span/lv_span.h deleted file mode 100644 index f0406b9..0000000 --- a/L3_Middlewares/LVGL/src/widgets/span/lv_span.h +++ /dev/null @@ -1,237 +0,0 @@ -/** - * @file lv_span.h - * - */ - -#ifndef LV_SPAN_H -#define LV_SPAN_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#include "../../core/lv_obj.h" - -#if LV_USE_SPAN != 0 - -/********************* - * DEFINES - *********************/ -#ifndef LV_SPAN_SNIPPET_STACK_SIZE -#define LV_SPAN_SNIPPET_STACK_SIZE 64 -#endif - -/********************** - * TYPEDEFS - **********************/ -typedef enum { - LV_SPAN_OVERFLOW_CLIP, - LV_SPAN_OVERFLOW_ELLIPSIS, - LV_SPAN_OVERFLOW_LAST, /**< Fence member*/ -} lv_span_overflow_t; - -typedef enum { - LV_SPAN_MODE_FIXED, /**< fixed the obj size */ - LV_SPAN_MODE_EXPAND, /**< Expand the object size to the text size */ - LV_SPAN_MODE_BREAK, /**< Keep width, break the too long lines and expand height */ - LV_SPAN_MODE_LAST /**< Fence member */ -} lv_span_mode_t; - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_spangroup_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -void lv_span_stack_init(void); -void lv_span_stack_deinit(void); - -/** - * Create a spangroup object - * @param parent pointer to an object, it will be the parent of the new spangroup - * @return pointer to the created spangroup - */ -lv_obj_t * lv_spangroup_create(lv_obj_t * parent); - -/** - * Create a span string descriptor and add to spangroup. - * @param obj pointer to a spangroup object. - * @return pointer to the created span. - */ -lv_span_t * lv_spangroup_new_span(lv_obj_t * obj); - -/** - * Remove the span from the spangroup and free memory. - * @param obj pointer to a spangroup object. - * @param span pointer to a span. - */ -void lv_spangroup_delete_span(lv_obj_t * obj, lv_span_t * span); - -/*===================== - * Setter functions - *====================*/ - -/** - * Set a new text for a span. Memory will be allocated to store the text by the span. - * @param span pointer to a span. - * @param text pointer to a text. - */ -void lv_span_set_text(lv_span_t * span, const char * text); - -/** - * Set a static text. It will not be saved by the span so the 'text' variable - * has to be 'alive' while the span exist. - * @param span pointer to a span. - * @param text pointer to a text. - */ -void lv_span_set_text_static(lv_span_t * span, const char * text); - -/** - * Set the align of the spangroup. - * @param obj pointer to a spangroup object. - * @param align see lv_text_align_t for details. - */ -void lv_spangroup_set_align(lv_obj_t * obj, lv_text_align_t align); - -/** - * Set the overflow of the spangroup. - * @param obj pointer to a spangroup object. - * @param overflow see lv_span_overflow_t for details. - */ -void lv_spangroup_set_overflow(lv_obj_t * obj, lv_span_overflow_t overflow); - -/** - * Set the indent of the spangroup. - * @param obj pointer to a spangroup object. - * @param indent the first line indentation - */ -void lv_spangroup_set_indent(lv_obj_t * obj, int32_t indent); - -/** - * Set the mode of the spangroup. - * @param obj pointer to a spangroup object. - * @param mode see lv_span_mode_t for details. - */ -void lv_spangroup_set_mode(lv_obj_t * obj, lv_span_mode_t mode); - -/** - * Set maximum lines of the spangroup. - * @param obj pointer to a spangroup object. - * @param lines max lines that can be displayed in LV_SPAN_MODE_BREAK mode. < 0 means no limit. - */ -void lv_spangroup_set_max_lines(lv_obj_t * obj, int32_t lines); - -/*===================== - * Getter functions - *====================*/ - -/** - * Get a pointer to the style of a span - * @param span pointer to the span - * @return pointer to the style. valid as long as the span is valid -*/ -lv_style_t * lv_span_get_style(lv_span_t * span); - -/** - * Get a spangroup child by its index. - * - * @param obj The spangroup object - * @param id the index of the child. - * 0: the oldest (firstly created) child - * 1: the second oldest - * child count-1: the youngest - * -1: the youngest - * -2: the second youngest - * @return The child span at index `id`, or NULL if the ID does not exist - */ -lv_span_t * lv_spangroup_get_child(const lv_obj_t * obj, int32_t id); - -/** - * Get number of spans - * @param obj the spangroup object to get the child count of. - * @return the span count of the spangroup. - */ -uint32_t lv_spangroup_get_span_count(const lv_obj_t * obj); - -/** - * Get the align of the spangroup. - * @param obj pointer to a spangroup object. - * @return the align value. - */ -lv_text_align_t lv_spangroup_get_align(lv_obj_t * obj); - -/** - * Get the overflow of the spangroup. - * @param obj pointer to a spangroup object. - * @return the overflow value. - */ -lv_span_overflow_t lv_spangroup_get_overflow(lv_obj_t * obj); - -/** - * Get the indent of the spangroup. - * @param obj pointer to a spangroup object. - * @return the indent value. - */ -int32_t lv_spangroup_get_indent(lv_obj_t * obj); - -/** - * Get the mode of the spangroup. - * @param obj pointer to a spangroup object. - */ -lv_span_mode_t lv_spangroup_get_mode(lv_obj_t * obj); - -/** - * Get maximum lines of the spangroup. - * @param obj pointer to a spangroup object. - * @return the max lines value. - */ -int32_t lv_spangroup_get_max_lines(lv_obj_t * obj); - -/** - * Get max line height of all span in the spangroup. - * @param obj pointer to a spangroup object. - */ -int32_t lv_spangroup_get_max_line_height(lv_obj_t * obj); - -/** - * Get the text content width when all span of spangroup on a line. - * @param obj pointer to a spangroup object. - * @param max_width if text content width >= max_width, return max_width - * to reduce computation, if max_width == 0, returns the text content width. - * @return text content width or max_width. - */ -uint32_t lv_spangroup_get_expand_width(lv_obj_t * obj, uint32_t max_width); - -/** - * Get the text content height with width fixed. - * @param obj pointer to a spangroup object. - * @param width the width of the span group. - - */ -int32_t lv_spangroup_get_expand_height(lv_obj_t * obj, int32_t width); - -/*===================== - * Other functions - *====================*/ - -/** - * Update the mode of the spangroup. - * @param obj pointer to a spangroup object. - */ -void lv_spangroup_refr_mode(lv_obj_t * obj); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_SPAN*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /*LV_SPAN_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/span/lv_span_private.h b/L3_Middlewares/LVGL/src/widgets/span/lv_span_private.h deleted file mode 100644 index 099ea1b..0000000 --- a/L3_Middlewares/LVGL/src/widgets/span/lv_span_private.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @file lv_span_private.h - * - */ - -#ifndef LV_SPAN_PRIVATE_H -#define LV_SPAN_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_span.h" - -#if LV_USE_SPAN != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_span_t { - char * txt; /**< a pointer to display text */ - lv_obj_t * spangroup; /**< a pointer to spangroup */ - lv_style_t style; /**< display text style */ - uint32_t static_flag : 1; /**< the text is static flag */ -}; - -/** Data of label*/ -struct lv_spangroup_t { - lv_obj_t obj; - int32_t lines; - int32_t indent; /**< first line indent */ - int32_t cache_w; /**< the cache automatically calculates the width */ - int32_t cache_h; /**< similar cache_w */ - lv_ll_t child_ll; - uint32_t mode : 2; /**< details see lv_span_mode_t */ - uint32_t overflow : 1; /**< details see lv_span_overflow_t */ - uint32_t refresh : 1; /**< the spangroup need refresh cache_w and cache_h */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_SPAN != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_SPAN_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/spinbox/lv_spinbox_private.h b/L3_Middlewares/LVGL/src/widgets/spinbox/lv_spinbox_private.h deleted file mode 100644 index 0569f21..0000000 --- a/L3_Middlewares/LVGL/src/widgets/spinbox/lv_spinbox_private.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file lv_spinbox_private.h - * - */ - -#ifndef LV_SPINBOX_PRIVATE_H -#define LV_SPINBOX_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../textarea/lv_textarea_private.h" -#include "lv_spinbox.h" - -#if LV_USE_SPINBOX - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Data of spinbox */ -struct lv_spinbox_t { - lv_textarea_t ta; /**< Ext. of ancestor */ - /*New data for this type*/ - int32_t value; - int32_t range_max; - int32_t range_min; - int32_t step; - uint32_t digit_count : 4; - uint32_t dec_point_pos : 4; /**< if 0, there is no separator and the number is an integer */ - uint32_t rollover : 1; /**< Set to true for rollover functionality */ - uint32_t digit_step_dir : 2; /**< the direction the digit will step on encoder button press when editing */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_SPINBOX */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_SPINBOX_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/switch/lv_switch_private.h b/L3_Middlewares/LVGL/src/widgets/switch/lv_switch_private.h deleted file mode 100644 index 7bc2576..0000000 --- a/L3_Middlewares/LVGL/src/widgets/switch/lv_switch_private.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file lv_switch_private.h - * - */ - -#ifndef LV_SWITCH_PRIVATE_H -#define LV_SWITCH_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_switch.h" - -#if LV_USE_SWITCH != 0 -#include "../../core/lv_obj_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_switch_t { - lv_obj_t obj; - int32_t anim_state; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_SWITCH != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_SWITCH_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/table/lv_table_private.h b/L3_Middlewares/LVGL/src/widgets/table/lv_table_private.h deleted file mode 100644 index 498ef5e..0000000 --- a/L3_Middlewares/LVGL/src/widgets/table/lv_table_private.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file lv_table_private.h - * - */ - -#ifndef LV_TABLE_PRIVATE_H -#define LV_TABLE_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "lv_table.h" - -#if LV_USE_TABLE != 0 -#include "../../core/lv_obj_private.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Cell data */ -struct lv_table_cell_t { - lv_table_cell_ctrl_t ctrl; - void * user_data; /**< Custom user data */ - char txt[1]; /**< Variable length array */ -}; - -/** Table data */ -struct lv_table_t { - lv_obj_t obj; - uint32_t col_cnt; - uint32_t row_cnt; - lv_table_cell_t ** cell_data; - int32_t * row_h; - int32_t * col_w; - uint32_t col_act; - uint32_t row_act; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_TABLE != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_TABLE_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview.c b/L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview.c deleted file mode 100644 index 29e3e2e..0000000 --- a/L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview.c +++ /dev/null @@ -1,357 +0,0 @@ -/** - * @file lv_tabview.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_tabview_private.h" -#include "../../core/lv_obj_class_private.h" -#include "../../lvgl.h" - -#if LV_USE_TABVIEW - -#include "../../misc/lv_assert.h" -#include "../../indev/lv_indev_private.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS (&lv_tabview_class) - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_tabview_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_tabview_event(const lv_obj_class_t * class_p, lv_event_t * e); -static void button_clicked_event_cb(lv_event_t * e); -static void cont_scroll_end_event_cb(lv_event_t * e); - -/********************** - * STATIC VARIABLES - **********************/ -const lv_obj_class_t lv_tabview_class = { - .constructor_cb = lv_tabview_constructor, - .event_cb = lv_tabview_event, - .width_def = LV_PCT(100), - .height_def = LV_PCT(100), - .base_class = &lv_obj_class, - .instance_size = sizeof(lv_tabview_t), - .name = "tabview", -}; - -typedef struct { - lv_dir_t tab_pos; - int32_t tab_size; -} lv_tabview_create_info_t; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_tabview_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - - lv_obj_t * obj = lv_obj_class_create_obj(&lv_tabview_class, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -lv_obj_t * lv_tabview_add_tab(lv_obj_t * obj, const char * name) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_obj_t * cont = lv_tabview_get_content(obj); - - lv_obj_t * page = lv_obj_create(cont); - lv_obj_set_size(page, lv_pct(100), lv_pct(100)); - uint32_t tab_idx = lv_obj_get_child_count(cont); - - lv_obj_t * tab_bar = lv_tabview_get_tab_bar(obj); - - lv_obj_t * button = lv_button_create(tab_bar); - lv_obj_set_flex_grow(button, 1); - lv_obj_set_size(button, lv_pct(100), lv_pct(100)); - lv_obj_add_event_cb(button, button_clicked_event_cb, LV_EVENT_CLICKED, NULL); - lv_group_t * g = lv_group_get_default(); - if(g) lv_group_add_obj(g, button); - - lv_obj_t * label = lv_label_create(button); - lv_label_set_text(label, name); - lv_obj_center(label); - - if(tab_idx == 1) { - lv_tabview_set_active(obj, 0, LV_ANIM_OFF); - } - - return page; -} - -void lv_tabview_rename_tab(lv_obj_t * obj, uint32_t idx, const char * new_name) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_obj_t * tab_bar = lv_tabview_get_tab_bar(obj); - lv_obj_t * button = lv_obj_get_child_by_type(tab_bar, idx, &lv_button_class); - lv_obj_t * label = lv_obj_get_child_by_type(button, 0, &lv_label_class); - lv_label_set_text(label, new_name); -} - -void lv_tabview_set_active(lv_obj_t * obj, uint32_t idx, lv_anim_enable_t anim_en) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_tabview_t * tabview = (lv_tabview_t *)obj; - - lv_obj_t * cont = lv_tabview_get_content(obj); - lv_obj_t * tab_bar = lv_tabview_get_tab_bar(obj); - - uint32_t tab_cnt = lv_tabview_get_tab_count(obj); - if(idx >= tab_cnt) { - idx = tab_cnt - 1; - } - - /*To be sure lv_obj_get_content_width will return valid value*/ - lv_obj_update_layout(obj); - - if(cont == NULL) return; - - if((tabview->tab_pos & LV_DIR_VER) != 0) { - int32_t gap = lv_obj_get_style_pad_column(cont, LV_PART_MAIN); - int32_t w = lv_obj_get_content_width(cont); - if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) != LV_BASE_DIR_RTL) { - lv_obj_scroll_to_x(cont, idx * (gap + w), anim_en); - } - else { - int32_t id_rtl = -(int32_t)idx; - lv_obj_scroll_to_x(cont, (gap + w) * id_rtl, anim_en); - } - } - else { - int32_t gap = lv_obj_get_style_pad_row(cont, LV_PART_MAIN); - int32_t h = lv_obj_get_content_height(cont); - lv_obj_scroll_to_y(cont, idx * (gap + h), anim_en); - } - - uint32_t i = 0; - lv_obj_t * button = lv_obj_get_child_by_type(tab_bar, i, &lv_button_class); - while(button) { - lv_obj_set_state(button, LV_STATE_CHECKED, i == idx); - i++; - button = lv_obj_get_child_by_type(tab_bar, (int32_t)i, &lv_button_class); - } - - tabview->tab_cur = idx; -} - -void lv_tabview_set_tab_bar_position(lv_obj_t * obj, lv_dir_t dir) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_tabview_t * tabview = (lv_tabview_t *)obj; - - switch(dir) { - case LV_DIR_TOP: - lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN); - break; - case LV_DIR_BOTTOM: - lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN_REVERSE); - break; - case LV_DIR_LEFT: - lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW); - break; - case LV_DIR_RIGHT: - lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW_REVERSE); - break; - case LV_DIR_HOR: - case LV_DIR_VER: - case LV_DIR_ALL: - case LV_DIR_NONE: - break; - } - - lv_obj_t * tab_bar = lv_tabview_get_tab_bar(obj); - lv_obj_t * cont = lv_tabview_get_content(obj); - - switch(dir) { - case LV_DIR_TOP: - case LV_DIR_BOTTOM: - lv_obj_set_width(cont, LV_PCT(100)); - lv_obj_set_flex_grow(cont, 1); - lv_obj_set_flex_flow(tab_bar, LV_FLEX_FLOW_ROW); - lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW); - lv_obj_set_scroll_snap_x(cont, LV_SCROLL_SNAP_CENTER); - lv_obj_set_scroll_snap_y(cont, LV_SCROLL_SNAP_NONE); - break; - case LV_DIR_LEFT: - case LV_DIR_RIGHT: - lv_obj_set_height(cont, LV_PCT(100)); - lv_obj_set_flex_grow(cont, 1); - lv_obj_set_flex_flow(tab_bar, LV_FLEX_FLOW_COLUMN); - lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_COLUMN); - lv_obj_set_scroll_snap_x(cont, LV_SCROLL_SNAP_NONE); - lv_obj_set_scroll_snap_y(cont, LV_SCROLL_SNAP_CENTER); - break; - case LV_DIR_HOR: - case LV_DIR_VER: - case LV_DIR_ALL: - case LV_DIR_NONE: - break; - } - - bool was_ver = tabview->tab_pos & LV_DIR_VER; - bool now_ver = dir & LV_DIR_VER; - - if(was_ver != now_ver) { - int32_t dpi = lv_display_get_dpi(lv_obj_get_display(obj)); - if(now_ver) { - lv_obj_set_size(tab_bar, lv_pct(100), dpi / 2); - } - else { - lv_obj_set_size(tab_bar, dpi, lv_pct(100)); - } - } - tabview->tab_pos = dir; -} - -void lv_tabview_set_tab_bar_size(lv_obj_t * obj, int32_t size) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_tabview_t * tabview = (lv_tabview_t *)obj; - - lv_obj_t * tab_bar = lv_tabview_get_tab_bar(obj); - if(tabview->tab_pos & LV_DIR_VER) { - lv_obj_set_height(tab_bar, size); - } - else { - lv_obj_set_width(tab_bar, size); - } - -} - -uint32_t lv_tabview_get_tab_active(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_tabview_t * tabview = (lv_tabview_t *)obj; - return tabview->tab_cur; -} - -uint32_t lv_tabview_get_tab_count(lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_obj_t * tab_bar = lv_tabview_get_tab_bar(obj); - return lv_obj_get_child_count_by_type(tab_bar, &lv_button_class); -} - -lv_obj_t * lv_tabview_get_content(lv_obj_t * tv) -{ - return lv_obj_get_child(tv, 1); -} - -lv_obj_t * lv_tabview_get_tab_bar(lv_obj_t * tv) -{ - return lv_obj_get_child(tv, 0); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_tabview_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - lv_tabview_t * tabview = (lv_tabview_t *)obj; - tabview->tab_pos = LV_DIR_NONE; /*Invalid value to apply the default TOP direction correctly*/ - - lv_obj_set_size(obj, LV_PCT(100), LV_PCT(100)); - - lv_obj_t * cont; - - lv_obj_create(obj); - cont = lv_obj_create(obj); - lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW); - - lv_obj_add_event_cb(cont, cont_scroll_end_event_cb, LV_EVENT_ALL, NULL); - lv_obj_set_scrollbar_mode(cont, LV_SCROLLBAR_MODE_OFF); - lv_tabview_set_tab_bar_position(obj, LV_DIR_TOP); - - lv_obj_add_flag(cont, LV_OBJ_FLAG_SCROLL_ONE); - lv_obj_remove_flag(cont, LV_OBJ_FLAG_SCROLL_ON_FOCUS); -} - -static void lv_tabview_event(const lv_obj_class_t * class_p, lv_event_t * e) -{ - LV_UNUSED(class_p); - lv_result_t res = lv_obj_event_base(&lv_tabview_class, e); - if(res != LV_RESULT_OK) return; - - lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * target = lv_event_get_current_target(e); - - if(code == LV_EVENT_SIZE_CHANGED) { - lv_tabview_set_active(target, lv_tabview_get_tab_active(target), LV_ANIM_OFF); - } -} - -static void button_clicked_event_cb(lv_event_t * e) -{ - lv_obj_t * button = lv_event_get_current_target(e); - - lv_obj_t * tv = lv_obj_get_parent(lv_obj_get_parent(button)); - int32_t idx = lv_obj_get_index_by_type(button, &lv_button_class); - lv_tabview_set_active(tv, idx, LV_ANIM_OFF); -} - -static void cont_scroll_end_event_cb(lv_event_t * e) -{ - lv_obj_t * cont = lv_event_get_current_target(e); - lv_event_code_t code = lv_event_get_code(e); - - lv_obj_t * tv = lv_obj_get_parent(cont); - lv_tabview_t * tv_obj = (lv_tabview_t *)tv; - if(code == LV_EVENT_LAYOUT_CHANGED) { - lv_tabview_set_active(tv, lv_tabview_get_tab_active(tv), LV_ANIM_OFF); - } - else if(code == LV_EVENT_SCROLL_END) { - lv_indev_t * indev = lv_indev_active(); - if(indev && indev->state == LV_INDEV_STATE_PRESSED) { - return; - } - - lv_point_t p; - lv_obj_get_scroll_end(cont, &p); - - int32_t t; - if((tv_obj->tab_pos & LV_DIR_VER) != 0) { - int32_t w = lv_obj_get_content_width(cont); - if(lv_obj_get_style_base_dir(tv, LV_PART_MAIN) == LV_BASE_DIR_RTL) t = -(p.x - w / 2) / w; - else t = (p.x + w / 2) / w; - } - else { - int32_t h = lv_obj_get_content_height(cont); - t = (p.y + h / 2) / h; - } - - if(t < 0) t = 0; - bool new_tab = false; - if(t != (int32_t)lv_tabview_get_tab_active(tv)) new_tab = true; - - /*If not scrolled by an indev set the tab immediately*/ - if(lv_indev_active()) { - lv_tabview_set_active(tv, t, LV_ANIM_ON); - } - else { - lv_tabview_set_active(tv, t, LV_ANIM_OFF); - } - - if(new_tab) lv_obj_send_event(tv, LV_EVENT_VALUE_CHANGED, NULL); - } -} -#endif /*LV_USE_TABVIEW*/ diff --git a/L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview.h b/L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview.h deleted file mode 100644 index f9bfdcc..0000000 --- a/L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * @file lv_tabview.h - * - */ - -#ifndef LV_TABVIEW_H -#define LV_TABVIEW_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../lv_conf_internal.h" -#include "../../core/lv_obj.h" - -#if LV_USE_TABVIEW - -/********************* - * DEFINES - *********************/ - -LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_tabview_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a tabview widget - * @param parent pointer to a parent widget - * @return the created tabview - */ -lv_obj_t * lv_tabview_create(lv_obj_t * parent); - -/** - * Add a tab to the tabview - * @param obj pointer to a tabview widget - * @param name the name of the tab, it will be displayed on the tab bar - * @return the widget where the content of the tab can be created - */ -lv_obj_t * lv_tabview_add_tab(lv_obj_t * obj, const char * name); - -/** - * Change the name of the tab - * @param obj pointer to a tabview widget - * @param idx the index of the tab to rename - * @param new_name the new name as a string - */ -void lv_tabview_rename_tab(lv_obj_t * obj, uint32_t idx, const char * new_name); - -/** - * Show a tab - * @param obj pointer to a tabview widget - * @param idx the index of the tab to show - * @param anim_en LV_ANIM_ON/OFF - */ -void lv_tabview_set_active(lv_obj_t * obj, uint32_t idx, lv_anim_enable_t anim_en); - -/** - * Set the position of the tab bar - * @param obj pointer to a tabview widget - * @param dir LV_DIR_TOP/BOTTOM/LEFT/RIGHT - */ -void lv_tabview_set_tab_bar_position(lv_obj_t * obj, lv_dir_t dir); - -/** - * Set the width or height of the tab bar - * @param obj pointer to tabview widget - * @param size size of the tab bar in pixels or percentage. - * will be used as width or height based on the position of the tab bar) - */ -void lv_tabview_set_tab_bar_size(lv_obj_t * obj, int32_t size); - -/** - * Get the number of tabs - * @param obj pointer to a tabview widget - * @return the number of tabs - */ -uint32_t lv_tabview_get_tab_count(lv_obj_t * obj); - -/** - * Get the current tab's index - * @param obj pointer to a tabview widget - * @return the zero based index of the current tab - */ -uint32_t lv_tabview_get_tab_active(lv_obj_t * obj); - -/** - * Get the widget where the container of each tab is created - * @param obj pointer to a tabview widget - * @return the main container widget - */ -lv_obj_t * lv_tabview_get_content(lv_obj_t * obj); - -/** - * Get the tab bar where the buttons are created - * @param obj pointer to a tabview widget - * @return the tab bar - */ -lv_obj_t * lv_tabview_get_tab_bar(lv_obj_t * obj); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_TABVIEW*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_TABVIEW_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview_private.h b/L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview_private.h deleted file mode 100644 index b08c968..0000000 --- a/L3_Middlewares/LVGL/src/widgets/tabview/lv_tabview_private.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file lv_tabview_private.h - * - */ - -#ifndef LV_TABVIEW_PRIVATE_H -#define LV_TABVIEW_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_tabview.h" - -#if LV_USE_TABVIEW - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ - -struct lv_tabview_t { - lv_obj_t obj; - uint32_t tab_cur; - lv_dir_t tab_pos; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_TABVIEW */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_TABVIEW_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/textarea/lv_textarea_private.h b/L3_Middlewares/LVGL/src/widgets/textarea/lv_textarea_private.h deleted file mode 100644 index e2d3aaa..0000000 --- a/L3_Middlewares/LVGL/src/widgets/textarea/lv_textarea_private.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file lv_textarea_private.h - * - */ - -#ifndef LV_TEXTAREA_PRIVATE_H -#define LV_TEXTAREA_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_textarea.h" - -#if LV_USE_TEXTAREA != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/** Data of text area */ -struct lv_textarea_t { - lv_obj_t obj; - lv_obj_t * label; /**< Label of the text area */ - char * placeholder_txt; /**< Place holder label. only visible if text is an empty string */ - char * pwd_tmp; /**< Used to store the original text in password mode */ - char * pwd_bullet; /**< Replacement characters displayed in password mode */ - const char * accepted_chars; /**< Only these characters will be accepted. NULL: accept all */ - uint32_t max_length; /**< The max. number of characters. 0: no limit */ - uint32_t pwd_show_time; /**< Time to show characters in password mode before change them to '*' */ - struct { - int32_t valid_x; /**< Used when stepping up/down to a shorter line. - *(Used by the library) */ - uint32_t pos; /**< The current cursor position - *(0: before 1st letter; 1: before 2nd letter ...) */ - lv_area_t area; /**< Cursor area relative to the Text Area */ - uint32_t txt_byte_pos; /**< Byte index of the letter after (on) the cursor */ - uint8_t show : 1; /**< Cursor is visible now or not (Handled by the library) */ - uint8_t click_pos : 1; /**< 1: Enable positioning the cursor by clicking the text area */ - } cursor; -#if LV_LABEL_TEXT_SELECTION - uint32_t sel_start; /**< Temporary values for text selection */ - uint32_t sel_end; - uint8_t text_sel_in_prog : 1; /**< User is in process of selecting */ - uint8_t text_sel_en : 1; /**< Text can be selected on this text area */ -#endif - uint8_t pwd_mode : 1; /**< Replace characters with '*' */ - uint8_t one_line : 1; /**< One line mode (ignore line breaks) */ -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_TEXTAREA != 0 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_TEXTAREA_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/tileview/lv_tileview_private.h b/L3_Middlewares/LVGL/src/widgets/tileview/lv_tileview_private.h deleted file mode 100644 index 5c91a40..0000000 --- a/L3_Middlewares/LVGL/src/widgets/tileview/lv_tileview_private.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @file lv_tileview_private.h - * - */ - -#ifndef LV_TILEVIEW_PRIVATE_H -#define LV_TILEVIEW_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_tileview.h" - -#if LV_USE_TILEVIEW - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ -struct lv_tileview_t { - lv_obj_t obj; - lv_obj_t * tile_act; -}; - -struct lv_tileview_tile_t { - lv_obj_t obj; - lv_dir_t dir; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_TILEVIEW */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_TILEVIEW_PRIVATE_H*/ diff --git a/L3_Middlewares/LVGL/src/widgets/win/lv_win_private.h b/L3_Middlewares/LVGL/src/widgets/win/lv_win_private.h deleted file mode 100644 index 0152247..0000000 --- a/L3_Middlewares/LVGL/src/widgets/win/lv_win_private.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file lv_win_private.h - * - */ - -#ifndef LV_WIN_PRIVATE_H -#define LV_WIN_PRIVATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ - -#include "../../core/lv_obj_private.h" -#include "lv_win.h" - -#if LV_USE_WIN - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * TYPEDEFS - **********************/ -struct lv_win_t { - lv_obj_t obj; -}; - - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/********************** - * MACROS - **********************/ - -#endif /* LV_USE_WIN */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_WIN_PRIVATE_H*/ diff --git a/gcc_build.sh b/gcc_build.sh index 9c31add..1887701 100755 --- a/gcc_build.sh +++ b/gcc_build.sh @@ -7,7 +7,6 @@ # -DUSE_FREERTOS=OFF\ # -DUSE_FATFS=OFF\ # -DUSE_LVGL=OFF\ -# -DUSE_LVGL_THORVG=OFF cmake -B build -G Ninja\ -DCMAKE_TOOLCHAIN_FILE="cmake/gcc-arm-none-eabi.cmake"\ @@ -16,7 +15,6 @@ cmake -B build -G Ninja\ -DMCU_MODEL="STM32F407VGT6_GCC"\ -DUSE_FREERTOS=OFF\ -DUSE_FATFS=OFF\ - -DUSE_LVGL=OFF\ - -DUSE_LVGL_THORVG=OFF + -DUSE_LVGL=OFF ninja -C build diff --git a/starm_clang_build.sh b/starm_clang_build.sh index 2ec52bb..6800ae8 100755 --- a/starm_clang_build.sh +++ b/starm_clang_build.sh @@ -7,6 +7,5 @@ cmake -B build -G Ninja\ -DUSE_FREERTOS=OFF\ -DUSE_FATFS=OFF\ -DUSE_LVGL=OFF\ - -DUSE_LVGL_THORVG=OFF\ ninja -C build From a1e7b5ed1ec620c9c782c97baef2d999cecc7d51 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Sat, 31 Jan 2026 15:35:50 +0800 Subject: [PATCH 11/12] =?UTF-8?q?[update]=E4=BF=AE=E6=94=B9gitaction?= =?UTF-8?q?=E7=9A=84windows=E7=9A=84unit=20test=E4=BD=BF=E7=94=A8gcc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cdc14f1..e1592d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -153,25 +153,36 @@ jobs: with: lfs: true + - name: Setup MSYS2 with GCC + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + install: >- + mingw-w64-x86_64-gcc + mingw-w64-x86_64-cmake + mingw-w64-x86_64-ninja + - name: Verify tools installation - shell: pwsh + shell: msys2 {0} run: | - ninja --version + gcc --version cmake --version + ninja --version - name: Run tests - shell: pwsh + shell: msys2 {0} run: | cd Test cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug cmake --build build --config Debug # 运行测试可执行文件 - if (Test-Path "build/test.exe") { - Write-Host "Running test executable..." - & .\build\test.exe - } else { - Write-Error "Test executable not found at build/test.exe" - Get-ChildItem build | Select-Object Name, Length + if [ -f "build/test.exe" ]; then + echo "Running test executable..." + ./build/test.exe + else + echo "Error: Test executable not found at build/test.exe" + ls -la build/ exit 1 - } + fi From c772b4be894f92bce868a6801c689a70701db7c5 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Sat, 31 Jan 2026 15:40:10 +0800 Subject: [PATCH 12/12] [update]fuck windows --- Test/CMakeLists.txt | 3 +++ Test/shell_symbols.c | 47 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 Test/shell_symbols.c diff --git a/Test/CMakeLists.txt b/Test/CMakeLists.txt index 6e2dc8a..8819262 100644 --- a/Test/CMakeLists.txt +++ b/Test/CMakeLists.txt @@ -19,6 +19,9 @@ aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} TestSrc) file(GLOB_RECURSE L2_TestSrc "${CMAKE_CURRENT_SOURCE_DIR}/../L2_Core/*.c") +# 添加shell_symbols.c为非嵌入式平台提供链接器符号和内存管理函数 +list(APPEND TestSrc "${CMAKE_CURRENT_SOURCE_DIR}/shell_symbols.c") + add_executable(${CMAKE_PROJECT_NAME} ${TestSrc} ${L2_TestSrc}) include_directories( ${CMAKE_PROJECT_NAME} PRIVATE diff --git a/Test/shell_symbols.c b/Test/shell_symbols.c new file mode 100644 index 0000000..08776bb --- /dev/null +++ b/Test/shell_symbols.c @@ -0,0 +1,47 @@ +/** + * @file shell_symbols.c + * @brief 为非嵌入式平台的letter_shell提供链接器符号和内存管理函数 + * + * 在嵌入式系统中,这些符号通常由链接脚本提供。 + * 在Windows/Linux上进行测试时,我们需要显式定义它们。 + * + * 同时,在Windows下weak符号支持有限,所以直接提供内存管理函数的实现。 + */ + +#include +#include "../L2_Core/third_party/letter_shell/inc/shell.h" + +/* 为测试环境提供shell命令段符号(空段) */ +#if defined(__GNUC__) && !defined(__ARMCC_VERSION) + +/* 为Windows/Linux上的GCC提供通常由链接脚本提供的符号 */ +const unsigned int _shell_command_start __attribute__((weak)) = 0; +const unsigned int _shell_command_end __attribute__((weak)) = 0; + +# if SHELL_USING_VAR == 1 +const unsigned int _shell_variable_start __attribute__((weak)) = 0; +const unsigned int _shell_variable_end __attribute__((weak)) = 0; +# endif + +#endif + +/* 为测试环境提供内存管理函数(直接使用标准库) */ +#if defined(_WIN32) || defined(_WIN64) + +/* Windows下提供强符号,避免weak符号链接问题 */ +void *_ek_malloc(size_t size) +{ + return malloc(size); +} + +void *_ek_realloc(void *ptr, size_t size) +{ + return realloc(ptr, size); +} + +void _ek_free(void *ptr) +{ + free(ptr); +} + +#endif